Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

uniforms

Package Overview
Dependencies
Maintainers
0
Versions
190
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uniforms - npm Package Compare versions

Comparing version 4.0.0-alpha.6 to 4.0.0-beta.1

224

cjs/AutoForm.d.ts

@@ -1,10 +0,12 @@

/// <reference types="react" />
/// <reference types="node" />
import { BaseForm } from './BaseForm';
import { ValidatedQuickForm, ValidatedQuickFormProps, ValidatedQuickFormState } from './ValidatedQuickForm';
import { ModelTransformMode, UnknownObject } from './types';
export declare type AutoFormProps<Model extends UnknownObject> = ValidatedQuickFormProps<Model> & {
onChangeModel?: (model: Model) => void;
export type AutoFormProps<Model extends UnknownObject> = ValidatedQuickFormProps<Model> & {
onChangeModel?: (model: Model, details: {
key: string;
value: unknown;
previousValue: unknown;
}) => void;
};
export declare type AutoFormState<Model extends UnknownObject> = ValidatedQuickFormState<Model> & {
export type AutoFormState<Model extends UnknownObject> = ValidatedQuickFormState<Model> & {
model: Model;

@@ -23,6 +25,6 @@ };

children?: import("react").ReactNode;
id?: string | undefined;
id?: string;
key: string;
noValidate: boolean;
onSubmit: (event?: import("react").SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
onSubmit: (event?: import("react").SyntheticEvent) => Promise<unknown>;
};

@@ -32,35 +34,29 @@ getModel(mode: ModelTransformMode): State["model"];

__reset(state: State): Partial<State>;
validate: (key?: string | undefined, value?: unknown) => Promise<unknown>;
validate: (key?: string, value?: unknown) => Promise<unknown>;
validateModel: (originalModel: any) => Promise<unknown>;
getContextError(): unknown;
getContextError(): import("./types").Context<Model>["error"];
getContext(): import("./types").Context<Model>;
onSubmit(event?: import("react").SyntheticEvent<Element, Event> | undefined): Promise<unknown>;
onValidate(key?: string | undefined, value?: unknown): Promise<unknown>;
onSubmit(event?: import("react").SyntheticEvent): Promise<unknown>;
onValidate(key?: string, value?: unknown): Promise<unknown>;
onValidateModel(originalModel: Props["model"]): Promise<unknown>;
componentDidMount(): void;
componentWillUnmount(): void;
delayId?: NodeJS.Timeout | undefined;
delayId?: ReturnType<typeof setTimeout> | undefined;
mounted: boolean;
reset: () => void;
change: (key: string, value: unknown) => void;
submit: (event?: import("react").SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
submit: (event?: import("react").SyntheticEvent) => Promise<unknown>;
randomId: () => string;
getContextName(): string[];
getContextName(): import("./types").Context<Model>["name"];
getContextModel(): Model;
getContextState(): {
disabled: boolean;
readOnly: boolean;
showInlineError: boolean;
};
getContextSchema(): import("./Bridge").Bridge;
getContextOnChange(): (key: string, value: unknown) => void;
getContextOnSubmit(): (event?: import("react").SyntheticEvent<Element, Event> | undefined) => unknown;
getContextState(): import("./types").Context<Model>["state"];
getContextSchema(): import("./types").Context<Model>["schema"];
getContextOnChange(): import("./types").Context<Model>["onChange"];
getContextOnSubmit(): import("./types").Context<Model>["onSubmit"];
onReset(): void;
render(): JSX.Element;
context: any;
render(): import("react").JSX.Element;
context: unknown;
setState<K extends keyof State>(state: State | ((prevState: Readonly<State>, props: Readonly<Props>) => State | Pick<State, K> | null) | Pick<State, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly<Props> & Readonly<{
children?: import("react").ReactNode;
}>;
readonly props: Readonly<Props>;
state: Readonly<State>;

@@ -114,6 +110,6 @@ refs: {

children?: import("react").ReactNode;
id?: string | undefined;
id?: string;
key: string;
noValidate: boolean;
onSubmit: (event?: import("react").SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
onSubmit: (event?: import("react").SyntheticEvent) => Promise<unknown>;
};

@@ -123,35 +119,29 @@ getModel(mode: ModelTransformMode): State["model"];

__reset(state: State): Partial<State>;
validate: (key?: string | undefined, value?: unknown) => Promise<unknown>;
validate: (key?: string, value?: unknown) => Promise<unknown>;
validateModel: (originalModel: any) => Promise<unknown>;
getContextError(): unknown;
getContextError(): import("./types").Context<Model>["error"];
getContext(): import("./types").Context<Model>;
onSubmit(event?: import("react").SyntheticEvent<Element, Event> | undefined): Promise<unknown>;
onValidate(key?: string | undefined, value?: unknown): Promise<unknown>;
onSubmit(event?: import("react").SyntheticEvent): Promise<unknown>;
onValidate(key?: string, value?: unknown): Promise<unknown>;
onValidateModel(originalModel: Props["model"]): Promise<unknown>;
componentDidMount(): void;
componentWillUnmount(): void;
delayId?: NodeJS.Timeout | undefined;
delayId?: ReturnType<typeof setTimeout> | undefined;
mounted: boolean;
reset: () => void;
change: (key: string, value: unknown) => void;
submit: (event?: import("react").SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
submit: (event?: import("react").SyntheticEvent) => Promise<unknown>;
randomId: () => string;
getContextName(): string[];
getContextName(): import("./types").Context<Model>["name"];
getContextModel(): Model;
getContextState(): {
disabled: boolean;
readOnly: boolean;
showInlineError: boolean;
};
getContextSchema(): import("./Bridge").Bridge;
getContextOnChange(): (key: string, value: unknown) => void;
getContextOnSubmit(): (event?: import("react").SyntheticEvent<Element, Event> | undefined) => unknown;
getContextState(): import("./types").Context<Model>["state"];
getContextSchema(): import("./types").Context<Model>["schema"];
getContextOnChange(): import("./types").Context<Model>["onChange"];
getContextOnSubmit(): import("./types").Context<Model>["onSubmit"];
onReset(): void;
render(): JSX.Element;
context: any;
render(): import("react").JSX.Element;
context: unknown;
setState<K extends keyof State>(state: State | ((prevState: Readonly<State>, props: Readonly<Props>) => State | Pick<State, K> | null) | Pick<State, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly<Props> & Readonly<{
children?: import("react").ReactNode;
}>;
readonly props: Readonly<Props>;
state: Readonly<State>;

@@ -194,61 +184,55 @@ refs: {

} & {
new <Model_1 extends UnknownObject, Props_1 extends import("./ValidatedForm").ValidatedFormProps<Model_1> = import("./ValidatedForm").ValidatedFormProps<Model_1>, State_1 extends import("./ValidatedForm").ValidatedFormState<Model_1> = import("./ValidatedForm").ValidatedFormState<Model_1>>(props: Props_1): {
validate: (key?: string | undefined, value?: unknown) => Promise<unknown>;
new <Model extends UnknownObject, Props extends import("./ValidatedForm").ValidatedFormProps<Model> = import("./ValidatedForm").ValidatedFormProps<Model>, State extends import("./ValidatedForm").ValidatedFormState<Model> = import("./ValidatedForm").ValidatedFormState<Model>>(props: Props): {
validate: (key?: string, value?: unknown) => Promise<unknown>;
validateModel: (originalModel: any) => Promise<unknown>;
getContextError(): unknown;
getContext(): import("./types").Context<Model_1>;
getContextError(): import("./types").Context<Model>["error"];
getContext(): import("./types").Context<Model>;
getNativeFormProps(): {
[key: string]: unknown;
children?: import("react").ReactNode;
id?: string | undefined;
id?: string;
key: string;
noValidate: boolean;
onSubmit: (event?: import("react").SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
onSubmit: (event?: import("react").SyntheticEvent) => Promise<unknown>;
};
componentDidUpdate(prevProps: Props_1, prevState: State_1, snapshot: never): void;
componentDidUpdate(prevProps: Props, prevState: State, snapshot: never): void;
onChange(key: string, value: unknown): void;
__reset(state: State_1): Partial<State_1>;
onSubmit(event?: import("react").SyntheticEvent<Element, Event> | undefined): Promise<unknown>;
onValidate(key?: string | undefined, value?: unknown): Promise<unknown>;
onValidateModel(originalModel: Props_1["model"]): Promise<unknown>;
__reset(state: State): Partial<State>;
onSubmit(event?: import("react").SyntheticEvent): Promise<unknown>;
onValidate(key?: string, value?: unknown): Promise<unknown>;
onValidateModel(originalModel: Props["model"]): Promise<unknown>;
componentDidMount(): void;
componentWillUnmount(): void;
delayId?: NodeJS.Timeout | undefined;
delayId?: ReturnType<typeof setTimeout> | undefined;
mounted: boolean;
reset: () => void;
change: (key: string, value: unknown) => void;
submit: (event?: import("react").SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
submit: (event?: import("react").SyntheticEvent) => Promise<unknown>;
randomId: () => string;
getContextName(): string[];
getContextModel(): Model_1;
getContextState(): {
disabled: boolean;
readOnly: boolean;
showInlineError: boolean;
};
getContextSchema(): import("./Bridge").Bridge;
getContextOnChange(): (key: string, value: unknown) => void;
getContextOnSubmit(): (event?: import("react").SyntheticEvent<Element, Event> | undefined) => unknown;
getModel(mode?: ModelTransformMode | undefined, model?: Model_1): Model_1;
getContextName(): import("./types").Context<Model>["name"];
getContextModel(): Model;
getContextState(): import("./types").Context<Model>["state"];
getContextSchema(): import("./types").Context<Model>["schema"];
getContextOnChange(): import("./types").Context<Model>["onChange"];
getContextOnSubmit(): import("./types").Context<Model>["onSubmit"];
getModel(mode?: ModelTransformMode, model?: Model): Model;
onReset(): void;
render(): JSX.Element;
context: any;
setState<K_1 extends keyof State_1>(state: State_1 | ((prevState: Readonly<State_1>, props: Readonly<Props_1>) => State_1 | Pick<State_1, K_1> | null) | Pick<State_1, K_1> | null, callback?: (() => void) | undefined): void;
render(): import("react").JSX.Element;
context: unknown;
setState<K extends keyof State>(state: State | ((prevState: Readonly<State>, props: Readonly<Props>) => State | Pick<State, K> | null) | Pick<State, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly<Props_1> & Readonly<{
children?: import("react").ReactNode;
}>;
state: Readonly<State_1>;
readonly props: Readonly<Props>;
state: Readonly<State>;
refs: {
[key: string]: import("react").ReactInstance;
};
shouldComponentUpdate?(nextProps: Readonly<Props_1>, nextState: Readonly<State_1>, nextContext: any): boolean;
shouldComponentUpdate?(nextProps: Readonly<Props>, nextState: Readonly<State>, nextContext: any): boolean;
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly<Props_1>, prevState: Readonly<State_1>): any;
getSnapshotBeforeUpdate?(prevProps: Readonly<Props>, prevState: Readonly<State>): any;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<Props_1>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Props_1>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<Props_1>, nextState: Readonly<State_1>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<Props_1>, nextState: Readonly<State_1>, nextContext: any): void;
componentWillReceiveProps?(nextProps: Readonly<Props>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Props>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<Props>, nextState: Readonly<State>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<Props>, nextState: Readonly<State>, nextContext: any): void;
};

@@ -269,10 +253,10 @@ Validated: typeof import("./ValidatedForm").Validated;

} & {
new <Model_2 extends UnknownObject, Props_2 extends import("./QuickForm").QuickFormProps<Model_2> = import("./QuickForm").QuickFormProps<Model_2>, State_2 extends import("./QuickForm").QuickFormState<Model_2> = import("./QuickForm").QuickFormState<Model_2>>(props: Props_2): {
new <Model extends UnknownObject, Props extends import("./QuickForm").QuickFormProps<Model> = import("./QuickForm").QuickFormProps<Model>, State extends import("./QuickForm").QuickFormState<Model> = import("./QuickForm").QuickFormState<Model>>(props: Props): {
getNativeFormProps(): {
[key: string]: unknown;
children?: import("react").ReactNode;
id?: string | undefined;
id?: string;
key: string;
noValidate: boolean;
onSubmit: (event?: import("react").SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
onSubmit: (event?: import("react").SyntheticEvent) => Promise<unknown>;
};

@@ -282,50 +266,44 @@ getAutoField(): import("react").ComponentType<{

}>;
getErrorsField(): import("react").ComponentType<{}>;
getSubmitField(): import("react").ComponentType<{}>;
getErrorsField(): import("react").ComponentType;
getSubmitField(): import("react").ComponentType;
componentDidMount(): void;
componentDidUpdate(prevProps: Props_2, prevState: State_2, snapshot: never): void;
componentDidUpdate(prevProps: Props, prevState: State, snapshot: never): void;
componentWillUnmount(): void;
delayId?: NodeJS.Timeout | undefined;
delayId?: ReturnType<typeof setTimeout> | undefined;
mounted: boolean;
reset: () => void;
change: (key: string, value: unknown) => void;
submit: (event?: import("react").SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
submit: (event?: import("react").SyntheticEvent) => Promise<unknown>;
randomId: () => string;
getContext(): import("./types").Context<Model_2>;
getContextName(): string[];
getContextError(): unknown;
getContextModel(): Model_2;
getContextState(): {
disabled: boolean;
readOnly: boolean;
showInlineError: boolean;
};
getContextSchema(): import("./Bridge").Bridge;
getContextOnChange(): (key: string, value: unknown) => void;
getContextOnSubmit(): (event?: import("react").SyntheticEvent<Element, Event> | undefined) => unknown;
getModel(mode?: ModelTransformMode | undefined, model?: Model_2): Model_2;
getContext(): import("./types").Context<Model>;
getContextName(): import("./types").Context<Model>["name"];
getContextError(): import("./types").Context<Model>["error"];
getContextModel(): Model;
getContextState(): import("./types").Context<Model>["state"];
getContextSchema(): import("./types").Context<Model>["schema"];
getContextOnChange(): import("./types").Context<Model>["onChange"];
getContextOnSubmit(): import("./types").Context<Model>["onSubmit"];
getModel(mode?: ModelTransformMode, model?: Model): Model;
onChange(key: string, value: unknown): void;
__reset(state: State_2): Partial<State_2>;
__reset(state: State): Partial<State>;
onReset(): void;
onSubmit(event?: import("react").SyntheticEvent<Element, Event> | undefined): Promise<unknown>;
render(): JSX.Element;
context: any;
setState<K_2 extends keyof State_2>(state: State_2 | ((prevState: Readonly<State_2>, props: Readonly<Props_2>) => State_2 | Pick<State_2, K_2> | null) | Pick<State_2, K_2> | null, callback?: (() => void) | undefined): void;
onSubmit(event?: import("react").SyntheticEvent): Promise<unknown>;
render(): import("react").JSX.Element;
context: unknown;
setState<K extends keyof State>(state: State | ((prevState: Readonly<State>, props: Readonly<Props>) => State | Pick<State, K> | null) | Pick<State, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly<Props_2> & Readonly<{
children?: import("react").ReactNode;
}>;
state: Readonly<State_2>;
readonly props: Readonly<Props>;
state: Readonly<State>;
refs: {
[key: string]: import("react").ReactInstance;
};
shouldComponentUpdate?(nextProps: Readonly<Props_2>, nextState: Readonly<State_2>, nextContext: any): boolean;
shouldComponentUpdate?(nextProps: Readonly<Props>, nextState: Readonly<State>, nextContext: any): boolean;
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly<Props_2>, prevState: Readonly<State_2>): any;
getSnapshotBeforeUpdate?(prevProps: Readonly<Props>, prevState: Readonly<State>): any;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<Props_2>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Props_2>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<Props_2>, nextState: Readonly<State_2>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<Props_2>, nextState: Readonly<State_2>, nextContext: any): void;
componentWillReceiveProps?(nextProps: Readonly<Props>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Props>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<Props>, nextState: Readonly<State>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<Props>, nextState: Readonly<State>, nextContext: any): void;
};

@@ -344,3 +322,3 @@ Quick: typeof import("./QuickForm").Quick;

} & typeof BaseForm;
export declare type AutoForm = typeof AutoForm;
export type AutoForm = typeof AutoForm;
//# sourceMappingURL=AutoForm.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AutoForm = exports.Auto = void 0;
exports.AutoForm = void 0;
exports.Auto = Auto;
const tslib_1 = require("tslib");
const clone_1 = (0, tslib_1.__importDefault)(require("lodash/clone"));
const isEqual_1 = (0, tslib_1.__importDefault)(require("lodash/isEqual"));
const omit_1 = (0, tslib_1.__importDefault)(require("lodash/omit"));
const setWith_1 = (0, tslib_1.__importDefault)(require("lodash/setWith"));
const clone_1 = tslib_1.__importDefault(require("lodash/clone"));
const get_1 = tslib_1.__importDefault(require("lodash/get"));
const isEqual_1 = tslib_1.__importDefault(require("lodash/isEqual"));
const omit_1 = tslib_1.__importDefault(require("lodash/omit"));
const setWith_1 = tslib_1.__importDefault(require("lodash/setWith"));
const ValidatedQuickForm_1 = require("./ValidatedQuickForm");

@@ -41,6 +43,11 @@ function Auto(Base) {

onChange(key, value) {
const previousValue = (0, get_1.default)(this.state.model, key);
super.onChange(key, value);
this.setState(state => ({ model: (0, setWith_1.default)((0, clone_1.default)(state.model), key, value, clone_1.default) }), () => {
if (this.props.onChangeModel) {
this.props.onChangeModel(this.state.model);
this.props.onChangeModel(this.state.model, {
key,
value,
previousValue,
});
}

@@ -57,3 +64,2 @@ });

}
exports.Auto = Auto;
exports.AutoForm = Auto(ValidatedQuickForm_1.ValidatedQuickForm);
import React, { Component, SyntheticEvent } from 'react';
import { Bridge } from './Bridge';
import { ChangedMap, Context, ModelTransformMode, UnknownObject } from './types';
export declare type BaseFormProps<Model extends UnknownObject> = {
export type BaseFormProps<Model extends UnknownObject> = {
autosave: boolean;
autosaveDelay: number;
children?: React.ReactNode;
disabled?: boolean;

@@ -19,3 +20,3 @@ error: unknown;

};
export declare type BaseFormState<Model extends UnknownObject> = {
export type BaseFormState<Model extends UnknownObject> = {
changed: boolean;

@@ -59,5 +60,5 @@ changedMap: ChangedMap<Model>;

children?: React.ReactNode;
id?: BaseFormProps<Model>['id'];
id?: string;
key: string;
noValidate: BaseFormProps<Model>['noValidate'];
noValidate: boolean;
onSubmit: BaseForm<Model, Props, State>['onSubmit'];

@@ -69,4 +70,4 @@ };

onSubmit(event?: SyntheticEvent): Promise<unknown>;
render(): JSX.Element;
render(): React.JSX.Element;
}
//# sourceMappingURL=BaseForm.d.ts.map

@@ -5,7 +5,7 @@ "use strict";

const tslib_1 = require("tslib");
const clone_1 = (0, tslib_1.__importDefault)(require("lodash/clone"));
const get_1 = (0, tslib_1.__importDefault)(require("lodash/get"));
const omit_1 = (0, tslib_1.__importDefault)(require("lodash/omit"));
const setWith_1 = (0, tslib_1.__importDefault)(require("lodash/setWith"));
const react_1 = (0, tslib_1.__importStar)(require("react"));
const clone_1 = tslib_1.__importDefault(require("lodash/clone"));
const get_1 = tslib_1.__importDefault(require("lodash/get"));
const omit_1 = tslib_1.__importDefault(require("lodash/omit"));
const setWith_1 = tslib_1.__importDefault(require("lodash/setWith"));
const react_1 = tslib_1.__importStar(require("react"));
const changedKeys_1 = require("./changedKeys");

@@ -12,0 +12,0 @@ const context_1 = require("./context");

@@ -5,4 +5,4 @@ "use strict";

const tslib_1 = require("tslib");
const invariant_1 = (0, tslib_1.__importDefault)(require("invariant"));
const set_1 = (0, tslib_1.__importDefault)(require("lodash/set"));
const invariant_1 = tslib_1.__importDefault(require("invariant"));
const set_1 = tslib_1.__importDefault(require("lodash/set"));
class Bridge {

@@ -9,0 +9,0 @@ // Each bridge can have a different set of parameters.

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.changedKeys = void 0;
exports.changedKeys = changedKeys;
const tslib_1 = require("tslib");
const isEqual_1 = (0, tslib_1.__importDefault)(require("lodash/isEqual"));
const isEqual_1 = tslib_1.__importDefault(require("lodash/isEqual"));
const joinName_1 = require("./joinName");

@@ -39,2 +39,1 @@ function isObject(value) {

}
exports.changedKeys = changedKeys;
import { ComponentType, FunctionComponent } from 'react';
import { GuaranteedProps, Override, UnknownObject } from './types';
/** @internal */
export declare type ConnectFieldOptions = {
export type ConnectFieldOptions = {
initialValue?: boolean;

@@ -9,3 +9,3 @@ kind?: 'leaf' | 'node';

/** @internal */
export declare type ConnectedFieldProps<Props extends UnknownObject, Value = Props['value']> = Override<Props, Override<Partial<GuaranteedProps<Value>>, {
export type ConnectedFieldProps<Props extends UnknownObject, Value = Props['value']> = Override<Props, Override<Partial<GuaranteedProps<Value>>, {
label?: Props['label'] | null | string;

@@ -15,3 +15,3 @@ name: string;

/** @internal */
export declare type ConnectedField<Props extends UnknownObject, Value = Props['value']> = FunctionComponent<ConnectedFieldProps<Props, Value>> & {
export type ConnectedField<Props extends UnknownObject, Value = Props['value']> = FunctionComponent<ConnectedFieldProps<Props, Value>> & {
Component: ComponentType<Props>;

@@ -18,0 +18,0 @@ options?: ConnectFieldOptions;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.connectField = void 0;
exports.connectField = connectField;
const tslib_1 = require("tslib");
const mapValues_1 = (0, tslib_1.__importDefault)(require("lodash/mapValues"));
const react_1 = (0, tslib_1.__importDefault)(require("react"));
const mapValues_1 = tslib_1.__importDefault(require("lodash/mapValues"));
const react_1 = tslib_1.__importDefault(require("react"));
const context_1 = require("./context");

@@ -53,2 +53,1 @@ const useField_1 = require("./useField");

}
exports.connectField = connectField;

@@ -1,4 +0,3 @@

/// <reference types="react" />
import { Context } from './types';
export declare const context: import("react").Context<Context<any> | null>;
//# sourceMappingURL=context.d.ts.map

@@ -5,3 +5,3 @@ import { ComponentType, ReactElement } from 'react';

import { useField } from './useField';
export declare type AutoFieldProps = UnknownObject & {
export type AutoFieldProps = UnknownObject & {
component?: Component;

@@ -12,5 +12,5 @@ experimental_absoluteName?: boolean;

/** @internal */
export declare type Component = ComponentType<any> | ReturnType<typeof connectField>;
export type Component = ComponentType<any> | ReturnType<typeof connectField>;
/** @internal */
export declare type ComponentDetector = (props: ReturnType<typeof useField>[0], uniforms: Context<UnknownObject>) => Component;
export type ComponentDetector = (props: ReturnType<typeof useField>[0], uniforms: Context<UnknownObject>) => Component;
export declare function createAutoField(defaultComponentDetector: ComponentDetector): (({ experimental_absoluteName: absoluteName, ...rawProps }: AutoFieldProps) => ReactElement) & {

@@ -17,0 +17,0 @@ componentDetectorContext: import("react").Context<ComponentDetector>;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createAutoField = void 0;
exports.createAutoField = createAutoField;
const tslib_1 = require("tslib");
const invariant_1 = (0, tslib_1.__importDefault)(require("invariant"));
const invariant_1 = tslib_1.__importDefault(require("invariant"));
const react_1 = require("react");

@@ -12,3 +12,3 @@ const useField_1 = require("./useField");

var _b;
var { experimental_absoluteName: absoluteName } = _a, rawProps = (0, tslib_1.__rest)(_a, ["experimental_absoluteName"]);
var { experimental_absoluteName: absoluteName } = _a, rawProps = tslib_1.__rest(_a, ["experimental_absoluteName"]);
const options = { absoluteName };

@@ -28,2 +28,1 @@ const [props, uniforms] = (0, useField_1.useField)(rawProps.name, rawProps, options);

}
exports.createAutoField = createAutoField;
import { FilterDOMProps } from '.';
/** @internal */
export declare type FilterDOMPropsKeys = keyof FilterDOMProps;
export declare const filterDOMProps: (<T extends object>(props: T) => Omit<T, keyof FilterDOMProps>) & {
export type FilterDOMPropsKeys = keyof FilterDOMProps;
export declare const filterDOMProps: (<T extends object>(props: T) => Omit<T, FilterDOMPropsKeys>) & {
register(...props: FilterDOMPropsKeys[]): void;
registered: readonly (keyof FilterDOMProps)[];
registered: readonly FilterDOMPropsKeys[];
};
//# sourceMappingURL=filterDOMProps.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
(0, tslib_1.__exportStar)(require("./AutoForm"), exports);
(0, tslib_1.__exportStar)(require("./BaseForm"), exports);
(0, tslib_1.__exportStar)(require("./Bridge"), exports);
(0, tslib_1.__exportStar)(require("./QuickForm"), exports);
(0, tslib_1.__exportStar)(require("./ValidatedForm"), exports);
(0, tslib_1.__exportStar)(require("./ValidatedQuickForm"), exports);
(0, tslib_1.__exportStar)(require("./changedKeys"), exports);
(0, tslib_1.__exportStar)(require("./connectField"), exports);
(0, tslib_1.__exportStar)(require("./context"), exports);
(0, tslib_1.__exportStar)(require("./createAutoField"), exports);
(0, tslib_1.__exportStar)(require("./filterDOMProps"), exports);
(0, tslib_1.__exportStar)(require("./joinName"), exports);
(0, tslib_1.__exportStar)(require("./randomIds"), exports);
(0, tslib_1.__exportStar)(require("./types"), exports);
(0, tslib_1.__exportStar)(require("./useField"), exports);
(0, tslib_1.__exportStar)(require("./useForm"), exports);
tslib_1.__exportStar(require("./AutoForm"), exports);
tslib_1.__exportStar(require("./BaseForm"), exports);
tslib_1.__exportStar(require("./Bridge"), exports);
tslib_1.__exportStar(require("./QuickForm"), exports);
tslib_1.__exportStar(require("./ValidatedForm"), exports);
tslib_1.__exportStar(require("./ValidatedQuickForm"), exports);
tslib_1.__exportStar(require("./changedKeys"), exports);
tslib_1.__exportStar(require("./connectField"), exports);
tslib_1.__exportStar(require("./context"), exports);
tslib_1.__exportStar(require("./createAutoField"), exports);
tslib_1.__exportStar(require("./filterDOMProps"), exports);
tslib_1.__exportStar(require("./joinName"), exports);
tslib_1.__exportStar(require("./randomIds"), exports);
tslib_1.__exportStar(require("./types"), exports);
tslib_1.__exportStar(require("./useField"), exports);
tslib_1.__exportStar(require("./useForm"), exports);

@@ -1,10 +0,9 @@

/// <reference types="node" />
import React, { ComponentType } from 'react';
import { BaseForm, BaseFormProps, BaseFormState } from './BaseForm';
import { UnknownObject } from './types';
export declare type QuickFormProps<Model extends UnknownObject> = BaseFormProps<Model> & {
export type QuickFormProps<Model extends UnknownObject> = BaseFormProps<Model> & {
errorsField?: ComponentType;
submitField?: ComponentType;
};
export declare type QuickFormState<Model extends UnknownObject> = BaseFormState<Model>;
export type QuickFormState<Model extends UnknownObject> = BaseFormState<Model>;
export declare function Quick<Base extends typeof BaseForm>(Base: Base): {

@@ -15,6 +14,6 @@ new <Model extends UnknownObject, Props extends QuickFormProps<Model> = QuickFormProps<Model>, State extends QuickFormState<Model> = QuickFormState<Model>>(props: Props): {

children?: React.ReactNode;
id?: string | undefined;
id?: string;
key: string;
noValidate: boolean;
onSubmit: (event?: React.SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
onSubmit: (event?: React.SyntheticEvent) => Promise<unknown>;
};

@@ -29,32 +28,26 @@ getAutoField(): ComponentType<{

componentWillUnmount(): void;
delayId?: NodeJS.Timeout | undefined;
delayId?: ReturnType<typeof setTimeout> | undefined;
mounted: boolean;
reset: () => void;
change: (key: string, value: unknown) => void;
submit: (event?: React.SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
submit: (event?: React.SyntheticEvent) => Promise<unknown>;
randomId: () => string;
getContext(): import("./types").Context<Model>;
getContextName(): string[];
getContextError(): unknown;
getContextName(): import("./types").Context<Model>["name"];
getContextError(): import("./types").Context<Model>["error"];
getContextModel(): Model;
getContextState(): {
disabled: boolean;
readOnly: boolean;
showInlineError: boolean;
};
getContextSchema(): import("./Bridge").Bridge;
getContextOnChange(): (key: string, value: unknown) => void;
getContextOnSubmit(): (event?: React.SyntheticEvent<Element, Event> | undefined) => unknown;
getModel(mode?: import("./types").ModelTransformMode | undefined, model?: Model): Model;
getContextState(): import("./types").Context<Model>["state"];
getContextSchema(): import("./types").Context<Model>["schema"];
getContextOnChange(): import("./types").Context<Model>["onChange"];
getContextOnSubmit(): import("./types").Context<Model>["onSubmit"];
getModel(mode?: import("./types").ModelTransformMode, model?: Model): Model;
onChange(key: string, value: unknown): void;
__reset(state: State): Partial<State>;
onReset(): void;
onSubmit(event?: React.SyntheticEvent<Element, Event> | undefined): Promise<unknown>;
render(): JSX.Element;
context: any;
onSubmit(event?: React.SyntheticEvent): Promise<unknown>;
render(): React.JSX.Element;
context: unknown;
setState<K extends keyof State>(state: State | ((prevState: Readonly<State>, props: Readonly<Props>) => State | Pick<State, K> | null) | Pick<State, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly<Props> & Readonly<{
children?: React.ReactNode;
}>;
readonly props: Readonly<Props>;
state: Readonly<State>;

@@ -91,6 +84,6 @@ refs: {

children?: React.ReactNode;
id?: string | undefined;
id?: string;
key: string;
noValidate: boolean;
onSubmit: (event?: React.SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
onSubmit: (event?: React.SyntheticEvent) => Promise<unknown>;
};

@@ -105,32 +98,26 @@ getAutoField(): React.ComponentType<{

componentWillUnmount(): void;
delayId?: NodeJS.Timeout | undefined;
delayId?: ReturnType<typeof setTimeout> | undefined;
mounted: boolean;
reset: () => void;
change: (key: string, value: unknown) => void;
submit: (event?: React.SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
submit: (event?: React.SyntheticEvent) => Promise<unknown>;
randomId: () => string;
getContext(): import("./types").Context<Model>;
getContextName(): string[];
getContextError(): unknown;
getContextName(): import("./types").Context<Model>["name"];
getContextError(): import("./types").Context<Model>["error"];
getContextModel(): Model;
getContextState(): {
disabled: boolean;
readOnly: boolean;
showInlineError: boolean;
};
getContextSchema(): import("./Bridge").Bridge;
getContextOnChange(): (key: string, value: unknown) => void;
getContextOnSubmit(): (event?: React.SyntheticEvent<Element, Event> | undefined) => unknown;
getModel(mode?: import("./types").ModelTransformMode | undefined, model?: Model): Model;
getContextState(): import("./types").Context<Model>["state"];
getContextSchema(): import("./types").Context<Model>["schema"];
getContextOnChange(): import("./types").Context<Model>["onChange"];
getContextOnSubmit(): import("./types").Context<Model>["onSubmit"];
getModel(mode?: import("./types").ModelTransformMode, model?: Model): Model;
onChange(key: string, value: unknown): void;
__reset(state: State): Partial<State>;
onReset(): void;
onSubmit(event?: React.SyntheticEvent<Element, Event> | undefined): Promise<unknown>;
render(): JSX.Element;
context: any;
onSubmit(event?: React.SyntheticEvent): Promise<unknown>;
render(): React.JSX.Element;
context: unknown;
setState<K extends keyof State>(state: State | ((prevState: Readonly<State>, props: Readonly<Props>) => State | Pick<State, K> | null) | Pick<State, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly<Props> & Readonly<{
children?: React.ReactNode;
}>;
readonly props: Readonly<Props>;
state: Readonly<State>;

@@ -162,3 +149,3 @@ refs: {

} & typeof BaseForm;
export declare type QuickForm = typeof QuickForm;
export type QuickForm = typeof QuickForm;
//# sourceMappingURL=QuickForm.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.QuickForm = exports.Quick = void 0;
exports.QuickForm = void 0;
exports.Quick = Quick;
const tslib_1 = require("tslib");
const react_1 = (0, tslib_1.__importDefault)(require("react"));
const react_1 = tslib_1.__importDefault(require("react"));
const BaseForm_1 = require("./BaseForm");

@@ -12,3 +13,3 @@ function Quick(Base) {

const _props = super.getNativeFormProps();
const { errorsField: ErrorsField = this.getErrorsField(), submitField: SubmitField = this.getSubmitField() } = _props, props = (0, tslib_1.__rest)(_props, ["errorsField", "submitField"]);
const { errorsField: ErrorsField = this.getErrorsField(), submitField: SubmitField = this.getSubmitField() } = _props, props = tslib_1.__rest(_props, ["errorsField", "submitField"]);
const AutoField = this.getAutoField();

@@ -40,3 +41,2 @@ if (!props.children) {

}
exports.Quick = Quick;
exports.QuickForm = Quick(BaseForm_1.BaseForm);
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.randomIds = void 0;
exports.randomIds = randomIds;
// Workaround for SSR

@@ -15,2 +15,1 @@ // https://github.com/vazco/uniforms/issues/40

}
exports.randomIds = randomIds;
import { HTMLProps, ReactNode, SyntheticEvent } from 'react';
import { BaseForm } from './BaseForm';
import { Bridge } from './Bridge';
export declare type ChangedMap<T> = T extends object ? {
export type ChangedMap<T> = T extends object ? {
[P in keyof T]?: ChangedMap<T[P]>;
} : Record<string, void>;
export declare type Context<Model extends UnknownObject> = {
export type Context<Model extends UnknownObject> = {
changed: boolean;

@@ -27,6 +27,6 @@ changedMap: ChangedMap<Model>;

};
export declare type FieldProps<Value, Base, Extension = object> = Override<Base, GuaranteedProps<Value> & Extension>;
export type FieldProps<Value, Base, Extension = object> = Override<Base, GuaranteedProps<Value> & Extension>;
export interface FilterDOMProps {
}
export declare type GuaranteedProps<Value> = {
export type GuaranteedProps<Value> = {
changed: boolean;

@@ -48,13 +48,13 @@ disabled: boolean;

/** @internal */
export declare type OnChange<Value> = {
export type OnChange<Value> = {
(value: Value): void;
(value: unknown, name: string): void;
};
export declare type HTMLFieldProps<Value, Element, Extension = object> = FieldProps<Value, HTMLProps<Element>, Extension>;
export declare type ModelTransformMode = 'form' | 'submit' | 'validate';
export type HTMLFieldProps<Value, Element, Extension = object> = FieldProps<Value, HTMLProps<Element>, Extension>;
export type ModelTransformMode = 'form' | 'submit' | 'validate';
/** @internal */
export declare type Override<T, U> = T extends any ? U & Omit<T, keyof U> : never;
export type Override<T, U> = T extends any ? U & Omit<T, keyof U> : never;
/** @internal */
export declare type UnknownObject = Record<string, unknown>;
export declare type ValidateMode = 'onChange' | 'onChangeAfterSubmit' | 'onSubmit';
export type UnknownObject = Record<string, unknown>;
export type ValidateMode = 'onChange' | 'onChangeAfterSubmit' | 'onSubmit';
declare module '.' {

@@ -61,0 +61,0 @@ interface FilterDOMProps {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useField = void 0;
exports.useField = useField;
const tslib_1 = require("tslib");
const get_1 = (0, tslib_1.__importDefault)(require("lodash/get"));
const mapValues_1 = (0, tslib_1.__importDefault)(require("lodash/mapValues"));
const get_1 = tslib_1.__importDefault(require("lodash/get"));
const mapValues_1 = tslib_1.__importDefault(require("lodash/mapValues"));
const react_1 = require("react");

@@ -70,2 +70,1 @@ const joinName_1 = require("./joinName");

}
exports.useField = useField;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useForm = void 0;
exports.useForm = useForm;
const tslib_1 = require("tslib");
const invariant_1 = (0, tslib_1.__importDefault)(require("invariant"));
const invariant_1 = tslib_1.__importDefault(require("invariant"));
const react_1 = require("react");

@@ -20,2 +20,1 @@ const context_1 = require("./context");

}
exports.useForm = useForm;

@@ -1,6 +0,5 @@

/// <reference types="node" />
import { SyntheticEvent } from 'react';
import { BaseForm, BaseFormProps, BaseFormState } from './BaseForm';
import { Context, UnknownObject, ValidateMode } from './types';
export declare type ValidatedFormProps<Model extends UnknownObject> = BaseFormProps<Model> & {
export type ValidatedFormProps<Model extends UnknownObject> = BaseFormProps<Model> & {
onValidate: (model: Model, error: unknown) => unknown;

@@ -10,3 +9,3 @@ validate: ValidateMode;

};
export declare type ValidatedFormState<Model extends UnknownObject> = BaseFormState<Model> & {
export type ValidatedFormState<Model extends UnknownObject> = BaseFormState<Model> & {
error: unknown;

@@ -19,5 +18,5 @@ validate: boolean;

new <Model extends UnknownObject, Props extends ValidatedFormProps<Model> = ValidatedFormProps<Model>, State extends ValidatedFormState<Model> = ValidatedFormState<Model>>(props: Props): {
validate: (key?: string | undefined, value?: unknown) => Promise<unknown>;
validate: (key?: string, value?: unknown) => Promise<unknown>;
validateModel: (originalModel: any) => Promise<unknown>;
getContextError(): unknown;
getContextError(): Context<Model>["error"];
getContext(): Context<Model>;

@@ -27,6 +26,6 @@ getNativeFormProps(): {

children?: import("react").ReactNode;
id?: string | undefined;
id?: string;
key: string;
noValidate: boolean;
onSubmit: (event?: SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
onSubmit: (event?: SyntheticEvent) => Promise<unknown>;
};

@@ -36,32 +35,26 @@ componentDidUpdate(prevProps: Props, prevState: State, snapshot: never): void;

__reset(state: State): Partial<State>;
onSubmit(event?: SyntheticEvent<Element, Event> | undefined): Promise<unknown>;
onValidate(key?: string | undefined, value?: unknown): Promise<unknown>;
onSubmit(event?: SyntheticEvent): Promise<unknown>;
onValidate(key?: string, value?: unknown): Promise<unknown>;
onValidateModel(originalModel: Props["model"]): Promise<unknown>;
componentDidMount(): void;
componentWillUnmount(): void;
delayId?: NodeJS.Timeout | undefined;
delayId?: ReturnType<typeof setTimeout> | undefined;
mounted: boolean;
reset: () => void;
change: (key: string, value: unknown) => void;
submit: (event?: SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
submit: (event?: SyntheticEvent) => Promise<unknown>;
randomId: () => string;
getContextName(): string[];
getContextName(): Context<Model>["name"];
getContextModel(): Model;
getContextState(): {
disabled: boolean;
readOnly: boolean;
showInlineError: boolean;
};
getContextSchema(): import("./Bridge").Bridge;
getContextOnChange(): (key: string, value: unknown) => void;
getContextOnSubmit(): (event?: SyntheticEvent<Element, Event> | undefined) => unknown;
getModel(mode?: import("./types").ModelTransformMode | undefined, model?: Model): Model;
getContextState(): Context<Model>["state"];
getContextSchema(): Context<Model>["schema"];
getContextOnChange(): Context<Model>["onChange"];
getContextOnSubmit(): Context<Model>["onSubmit"];
getModel(mode?: import("./types").ModelTransformMode, model?: Model): Model;
onReset(): void;
render(): JSX.Element;
context: any;
render(): import("react").JSX.Element;
context: unknown;
setState<K extends keyof State>(state: State | ((prevState: Readonly<State>, props: Readonly<Props>) => State | Pick<State, K> | null) | Pick<State, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly<Props> & Readonly<{
children?: import("react").ReactNode;
}>;
readonly props: Readonly<Props>;
state: Readonly<State>;

@@ -97,5 +90,5 @@ refs: {

new <Model extends UnknownObject, Props extends ValidatedFormProps<Model> = ValidatedFormProps<Model>, State extends ValidatedFormState<Model> = ValidatedFormState<Model>>(props: Props): {
validate: (key?: string | undefined, value?: unknown) => Promise<unknown>;
validate: (key?: string, value?: unknown) => Promise<unknown>;
validateModel: (originalModel: any) => Promise<unknown>;
getContextError(): unknown;
getContextError(): Context<Model>["error"];
getContext(): Context<Model>;

@@ -105,6 +98,6 @@ getNativeFormProps(): {

children?: import("react").ReactNode;
id?: string | undefined;
id?: string;
key: string;
noValidate: boolean;
onSubmit: (event?: SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
onSubmit: (event?: SyntheticEvent) => Promise<unknown>;
};

@@ -114,32 +107,26 @@ componentDidUpdate(prevProps: Props, prevState: State, snapshot: never): void;

__reset(state: State): Partial<State>;
onSubmit(event?: SyntheticEvent<Element, Event> | undefined): Promise<unknown>;
onValidate(key?: string | undefined, value?: unknown): Promise<unknown>;
onSubmit(event?: SyntheticEvent): Promise<unknown>;
onValidate(key?: string, value?: unknown): Promise<unknown>;
onValidateModel(originalModel: Props["model"]): Promise<unknown>;
componentDidMount(): void;
componentWillUnmount(): void;
delayId?: NodeJS.Timeout | undefined;
delayId?: ReturnType<typeof setTimeout> | undefined;
mounted: boolean;
reset: () => void;
change: (key: string, value: unknown) => void;
submit: (event?: SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
submit: (event?: SyntheticEvent) => Promise<unknown>;
randomId: () => string;
getContextName(): string[];
getContextName(): Context<Model>["name"];
getContextModel(): Model;
getContextState(): {
disabled: boolean;
readOnly: boolean;
showInlineError: boolean;
};
getContextSchema(): import("./Bridge").Bridge;
getContextOnChange(): (key: string, value: unknown) => void;
getContextOnSubmit(): (event?: SyntheticEvent<Element, Event> | undefined) => unknown;
getModel(mode?: import("./types").ModelTransformMode | undefined, model?: Model): Model;
getContextState(): Context<Model>["state"];
getContextSchema(): Context<Model>["schema"];
getContextOnChange(): Context<Model>["onChange"];
getContextOnSubmit(): Context<Model>["onSubmit"];
getModel(mode?: import("./types").ModelTransformMode, model?: Model): Model;
onReset(): void;
render(): JSX.Element;
context: any;
render(): import("react").JSX.Element;
context: unknown;
setState<K extends keyof State>(state: State | ((prevState: Readonly<State>, props: Readonly<Props>) => State | Pick<State, K> | null) | Pick<State, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly<Props> & Readonly<{
children?: import("react").ReactNode;
}>;
readonly props: Readonly<Props>;
state: Readonly<State>;

@@ -173,3 +160,3 @@ refs: {

} & typeof BaseForm;
export declare type ValidatedForm = typeof ValidatedForm;
export type ValidatedForm = typeof ValidatedForm;
//# sourceMappingURL=ValidatedForm.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ValidatedForm = exports.Validated = void 0;
exports.ValidatedForm = void 0;
exports.Validated = Validated;
const tslib_1 = require("tslib");
const clone_1 = (0, tslib_1.__importDefault)(require("lodash/clone"));
const cloneDeep_1 = (0, tslib_1.__importDefault)(require("lodash/cloneDeep"));
const isEqual_1 = (0, tslib_1.__importDefault)(require("lodash/isEqual"));
const noop_1 = (0, tslib_1.__importDefault)(require("lodash/noop"));
const omit_1 = (0, tslib_1.__importDefault)(require("lodash/omit"));
const setWith_1 = (0, tslib_1.__importDefault)(require("lodash/setWith"));
const clone_1 = tslib_1.__importDefault(require("lodash/clone"));
const cloneDeep_1 = tslib_1.__importDefault(require("lodash/cloneDeep"));
const isEqual_1 = tslib_1.__importDefault(require("lodash/isEqual"));
const noop_1 = tslib_1.__importDefault(require("lodash/noop"));
const omit_1 = tslib_1.__importDefault(require("lodash/omit"));
const setWith_1 = tslib_1.__importDefault(require("lodash/setWith"));
const BaseForm_1 = require("./BaseForm");

@@ -117,3 +118,2 @@ function Validated(Base) {

}
exports.Validated = Validated;
function makeThen(callIfAsync) {

@@ -120,0 +120,0 @@ function then(value, fn) {

@@ -1,3 +0,1 @@

/// <reference types="react" />
/// <reference types="node" />
import { BaseForm } from './BaseForm';

@@ -7,9 +5,9 @@ import { Quick, QuickFormProps, QuickFormState } from './QuickForm';

import { UnknownObject } from './types';
export declare type ValidatedQuickFormProps<Model extends UnknownObject> = QuickFormProps<Model> & ValidatedFormProps<Model>;
export declare type ValidatedQuickFormState<Model extends UnknownObject> = QuickFormState<Model> & ValidatedFormState<Model>;
export type ValidatedQuickFormProps<Model extends UnknownObject> = QuickFormProps<Model> & ValidatedFormProps<Model>;
export type ValidatedQuickFormState<Model extends UnknownObject> = QuickFormState<Model> & ValidatedFormState<Model>;
export declare const ValidatedQuickForm: {
new <Model extends UnknownObject, Props extends ValidatedFormProps<Model> = ValidatedFormProps<Model>, State extends ValidatedFormState<Model> = ValidatedFormState<Model>>(props: Props): {
validate: (key?: string | undefined, value?: unknown) => Promise<unknown>;
validate: (key?: string, value?: unknown) => Promise<unknown>;
validateModel: (originalModel: any) => Promise<unknown>;
getContextError(): unknown;
getContextError(): import("./types").Context<Model>["error"];
getContext(): import("./types").Context<Model>;

@@ -19,6 +17,6 @@ getNativeFormProps(): {

children?: import("react").ReactNode;
id?: string | undefined;
id?: string;
key: string;
noValidate: boolean;
onSubmit: (event?: import("react").SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
onSubmit: (event?: import("react").SyntheticEvent) => Promise<unknown>;
};

@@ -28,32 +26,26 @@ componentDidUpdate(prevProps: Props, prevState: State, snapshot: never): void;

__reset(state: State): Partial<State>;
onSubmit(event?: import("react").SyntheticEvent<Element, Event> | undefined): Promise<unknown>;
onValidate(key?: string | undefined, value?: unknown): Promise<unknown>;
onSubmit(event?: import("react").SyntheticEvent): Promise<unknown>;
onValidate(key?: string, value?: unknown): Promise<unknown>;
onValidateModel(originalModel: Props["model"]): Promise<unknown>;
componentDidMount(): void;
componentWillUnmount(): void;
delayId?: NodeJS.Timeout | undefined;
delayId?: ReturnType<typeof setTimeout> | undefined;
mounted: boolean;
reset: () => void;
change: (key: string, value: unknown) => void;
submit: (event?: import("react").SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
submit: (event?: import("react").SyntheticEvent) => Promise<unknown>;
randomId: () => string;
getContextName(): string[];
getContextName(): import("./types").Context<Model>["name"];
getContextModel(): Model;
getContextState(): {
disabled: boolean;
readOnly: boolean;
showInlineError: boolean;
};
getContextSchema(): import("./Bridge").Bridge;
getContextOnChange(): (key: string, value: unknown) => void;
getContextOnSubmit(): (event?: import("react").SyntheticEvent<Element, Event> | undefined) => unknown;
getModel(mode?: import("./types").ModelTransformMode | undefined, model?: Model): Model;
getContextState(): import("./types").Context<Model>["state"];
getContextSchema(): import("./types").Context<Model>["schema"];
getContextOnChange(): import("./types").Context<Model>["onChange"];
getContextOnSubmit(): import("./types").Context<Model>["onSubmit"];
getModel(mode?: import("./types").ModelTransformMode, model?: Model): Model;
onReset(): void;
render(): JSX.Element;
context: any;
render(): import("react").JSX.Element;
context: unknown;
setState<K extends keyof State>(state: State | ((prevState: Readonly<State>, props: Readonly<Props>) => State | Pick<State, K> | null) | Pick<State, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly<Props> & Readonly<{
children?: import("react").ReactNode;
}>;
readonly props: Readonly<Props>;
state: Readonly<State>;

@@ -87,10 +79,10 @@ refs: {

} & {
new <Model_1 extends UnknownObject, Props_1 extends QuickFormProps<Model_1> = QuickFormProps<Model_1>, State_1 extends QuickFormState<Model_1> = QuickFormState<Model_1>>(props: Props_1): {
new <Model extends UnknownObject, Props extends QuickFormProps<Model> = QuickFormProps<Model>, State extends QuickFormState<Model> = QuickFormState<Model>>(props: Props): {
getNativeFormProps(): {
[key: string]: unknown;
children?: import("react").ReactNode;
id?: string | undefined;
id?: string;
key: string;
noValidate: boolean;
onSubmit: (event?: import("react").SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
onSubmit: (event?: import("react").SyntheticEvent) => Promise<unknown>;
};

@@ -100,50 +92,44 @@ getAutoField(): import("react").ComponentType<{

}>;
getErrorsField(): import("react").ComponentType<{}>;
getSubmitField(): import("react").ComponentType<{}>;
getErrorsField(): import("react").ComponentType;
getSubmitField(): import("react").ComponentType;
componentDidMount(): void;
componentDidUpdate(prevProps: Props_1, prevState: State_1, snapshot: never): void;
componentDidUpdate(prevProps: Props, prevState: State, snapshot: never): void;
componentWillUnmount(): void;
delayId?: NodeJS.Timeout | undefined;
delayId?: ReturnType<typeof setTimeout> | undefined;
mounted: boolean;
reset: () => void;
change: (key: string, value: unknown) => void;
submit: (event?: import("react").SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
submit: (event?: import("react").SyntheticEvent) => Promise<unknown>;
randomId: () => string;
getContext(): import("./types").Context<Model_1>;
getContextName(): string[];
getContextError(): unknown;
getContextModel(): Model_1;
getContextState(): {
disabled: boolean;
readOnly: boolean;
showInlineError: boolean;
};
getContextSchema(): import("./Bridge").Bridge;
getContextOnChange(): (key: string, value: unknown) => void;
getContextOnSubmit(): (event?: import("react").SyntheticEvent<Element, Event> | undefined) => unknown;
getModel(mode?: import("./types").ModelTransformMode | undefined, model?: Model_1): Model_1;
getContext(): import("./types").Context<Model>;
getContextName(): import("./types").Context<Model>["name"];
getContextError(): import("./types").Context<Model>["error"];
getContextModel(): Model;
getContextState(): import("./types").Context<Model>["state"];
getContextSchema(): import("./types").Context<Model>["schema"];
getContextOnChange(): import("./types").Context<Model>["onChange"];
getContextOnSubmit(): import("./types").Context<Model>["onSubmit"];
getModel(mode?: import("./types").ModelTransformMode, model?: Model): Model;
onChange(key: string, value: unknown): void;
__reset(state: State_1): Partial<State_1>;
__reset(state: State): Partial<State>;
onReset(): void;
onSubmit(event?: import("react").SyntheticEvent<Element, Event> | undefined): Promise<unknown>;
render(): JSX.Element;
context: any;
setState<K_1 extends keyof State_1>(state: State_1 | ((prevState: Readonly<State_1>, props: Readonly<Props_1>) => State_1 | Pick<State_1, K_1> | null) | Pick<State_1, K_1> | null, callback?: (() => void) | undefined): void;
onSubmit(event?: import("react").SyntheticEvent): Promise<unknown>;
render(): import("react").JSX.Element;
context: unknown;
setState<K extends keyof State>(state: State | ((prevState: Readonly<State>, props: Readonly<Props>) => State | Pick<State, K> | null) | Pick<State, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly<Props_1> & Readonly<{
children?: import("react").ReactNode;
}>;
state: Readonly<State_1>;
readonly props: Readonly<Props>;
state: Readonly<State>;
refs: {
[key: string]: import("react").ReactInstance;
};
shouldComponentUpdate?(nextProps: Readonly<Props_1>, nextState: Readonly<State_1>, nextContext: any): boolean;
shouldComponentUpdate?(nextProps: Readonly<Props>, nextState: Readonly<State>, nextContext: any): boolean;
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly<Props_1>, prevState: Readonly<State_1>): any;
getSnapshotBeforeUpdate?(prevProps: Readonly<Props>, prevState: Readonly<State>): any;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<Props_1>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Props_1>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<Props_1>, nextState: Readonly<State_1>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<Props_1>, nextState: Readonly<State_1>, nextContext: any): void;
componentWillReceiveProps?(nextProps: Readonly<Props>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Props>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<Props>, nextState: Readonly<State>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<Props>, nextState: Readonly<State>, nextContext: any): void;
};

@@ -162,3 +148,3 @@ Quick: typeof Quick;

} & typeof BaseForm;
export declare type ValidatedQuickForm = typeof ValidatedQuickForm;
export type ValidatedQuickForm = typeof ValidatedQuickForm;
//# sourceMappingURL=ValidatedQuickForm.d.ts.map

@@ -1,10 +0,12 @@

/// <reference types="react" />
/// <reference types="node" />
import { BaseForm } from './BaseForm';
import { ValidatedQuickForm, ValidatedQuickFormProps, ValidatedQuickFormState } from './ValidatedQuickForm';
import { ModelTransformMode, UnknownObject } from './types';
export declare type AutoFormProps<Model extends UnknownObject> = ValidatedQuickFormProps<Model> & {
onChangeModel?: (model: Model) => void;
export type AutoFormProps<Model extends UnknownObject> = ValidatedQuickFormProps<Model> & {
onChangeModel?: (model: Model, details: {
key: string;
value: unknown;
previousValue: unknown;
}) => void;
};
export declare type AutoFormState<Model extends UnknownObject> = ValidatedQuickFormState<Model> & {
export type AutoFormState<Model extends UnknownObject> = ValidatedQuickFormState<Model> & {
model: Model;

@@ -23,6 +25,6 @@ };

children?: import("react").ReactNode;
id?: string | undefined;
id?: string;
key: string;
noValidate: boolean;
onSubmit: (event?: import("react").SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
onSubmit: (event?: import("react").SyntheticEvent) => Promise<unknown>;
};

@@ -32,35 +34,29 @@ getModel(mode: ModelTransformMode): State["model"];

__reset(state: State): Partial<State>;
validate: (key?: string | undefined, value?: unknown) => Promise<unknown>;
validate: (key?: string, value?: unknown) => Promise<unknown>;
validateModel: (originalModel: any) => Promise<unknown>;
getContextError(): unknown;
getContextError(): import("./types").Context<Model>["error"];
getContext(): import("./types").Context<Model>;
onSubmit(event?: import("react").SyntheticEvent<Element, Event> | undefined): Promise<unknown>;
onValidate(key?: string | undefined, value?: unknown): Promise<unknown>;
onSubmit(event?: import("react").SyntheticEvent): Promise<unknown>;
onValidate(key?: string, value?: unknown): Promise<unknown>;
onValidateModel(originalModel: Props["model"]): Promise<unknown>;
componentDidMount(): void;
componentWillUnmount(): void;
delayId?: NodeJS.Timeout | undefined;
delayId?: ReturnType<typeof setTimeout> | undefined;
mounted: boolean;
reset: () => void;
change: (key: string, value: unknown) => void;
submit: (event?: import("react").SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
submit: (event?: import("react").SyntheticEvent) => Promise<unknown>;
randomId: () => string;
getContextName(): string[];
getContextName(): import("./types").Context<Model>["name"];
getContextModel(): Model;
getContextState(): {
disabled: boolean;
readOnly: boolean;
showInlineError: boolean;
};
getContextSchema(): import("./Bridge").Bridge;
getContextOnChange(): (key: string, value: unknown) => void;
getContextOnSubmit(): (event?: import("react").SyntheticEvent<Element, Event> | undefined) => unknown;
getContextState(): import("./types").Context<Model>["state"];
getContextSchema(): import("./types").Context<Model>["schema"];
getContextOnChange(): import("./types").Context<Model>["onChange"];
getContextOnSubmit(): import("./types").Context<Model>["onSubmit"];
onReset(): void;
render(): JSX.Element;
context: any;
render(): import("react").JSX.Element;
context: unknown;
setState<K extends keyof State>(state: State | ((prevState: Readonly<State>, props: Readonly<Props>) => State | Pick<State, K> | null) | Pick<State, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly<Props> & Readonly<{
children?: import("react").ReactNode;
}>;
readonly props: Readonly<Props>;
state: Readonly<State>;

@@ -114,6 +110,6 @@ refs: {

children?: import("react").ReactNode;
id?: string | undefined;
id?: string;
key: string;
noValidate: boolean;
onSubmit: (event?: import("react").SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
onSubmit: (event?: import("react").SyntheticEvent) => Promise<unknown>;
};

@@ -123,35 +119,29 @@ getModel(mode: ModelTransformMode): State["model"];

__reset(state: State): Partial<State>;
validate: (key?: string | undefined, value?: unknown) => Promise<unknown>;
validate: (key?: string, value?: unknown) => Promise<unknown>;
validateModel: (originalModel: any) => Promise<unknown>;
getContextError(): unknown;
getContextError(): import("./types").Context<Model>["error"];
getContext(): import("./types").Context<Model>;
onSubmit(event?: import("react").SyntheticEvent<Element, Event> | undefined): Promise<unknown>;
onValidate(key?: string | undefined, value?: unknown): Promise<unknown>;
onSubmit(event?: import("react").SyntheticEvent): Promise<unknown>;
onValidate(key?: string, value?: unknown): Promise<unknown>;
onValidateModel(originalModel: Props["model"]): Promise<unknown>;
componentDidMount(): void;
componentWillUnmount(): void;
delayId?: NodeJS.Timeout | undefined;
delayId?: ReturnType<typeof setTimeout> | undefined;
mounted: boolean;
reset: () => void;
change: (key: string, value: unknown) => void;
submit: (event?: import("react").SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
submit: (event?: import("react").SyntheticEvent) => Promise<unknown>;
randomId: () => string;
getContextName(): string[];
getContextName(): import("./types").Context<Model>["name"];
getContextModel(): Model;
getContextState(): {
disabled: boolean;
readOnly: boolean;
showInlineError: boolean;
};
getContextSchema(): import("./Bridge").Bridge;
getContextOnChange(): (key: string, value: unknown) => void;
getContextOnSubmit(): (event?: import("react").SyntheticEvent<Element, Event> | undefined) => unknown;
getContextState(): import("./types").Context<Model>["state"];
getContextSchema(): import("./types").Context<Model>["schema"];
getContextOnChange(): import("./types").Context<Model>["onChange"];
getContextOnSubmit(): import("./types").Context<Model>["onSubmit"];
onReset(): void;
render(): JSX.Element;
context: any;
render(): import("react").JSX.Element;
context: unknown;
setState<K extends keyof State>(state: State | ((prevState: Readonly<State>, props: Readonly<Props>) => State | Pick<State, K> | null) | Pick<State, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly<Props> & Readonly<{
children?: import("react").ReactNode;
}>;
readonly props: Readonly<Props>;
state: Readonly<State>;

@@ -194,61 +184,55 @@ refs: {

} & {
new <Model_1 extends UnknownObject, Props_1 extends import("./ValidatedForm").ValidatedFormProps<Model_1> = import("./ValidatedForm").ValidatedFormProps<Model_1>, State_1 extends import("./ValidatedForm").ValidatedFormState<Model_1> = import("./ValidatedForm").ValidatedFormState<Model_1>>(props: Props_1): {
validate: (key?: string | undefined, value?: unknown) => Promise<unknown>;
new <Model extends UnknownObject, Props extends import("./ValidatedForm").ValidatedFormProps<Model> = import("./ValidatedForm").ValidatedFormProps<Model>, State extends import("./ValidatedForm").ValidatedFormState<Model> = import("./ValidatedForm").ValidatedFormState<Model>>(props: Props): {
validate: (key?: string, value?: unknown) => Promise<unknown>;
validateModel: (originalModel: any) => Promise<unknown>;
getContextError(): unknown;
getContext(): import("./types").Context<Model_1>;
getContextError(): import("./types").Context<Model>["error"];
getContext(): import("./types").Context<Model>;
getNativeFormProps(): {
[key: string]: unknown;
children?: import("react").ReactNode;
id?: string | undefined;
id?: string;
key: string;
noValidate: boolean;
onSubmit: (event?: import("react").SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
onSubmit: (event?: import("react").SyntheticEvent) => Promise<unknown>;
};
componentDidUpdate(prevProps: Props_1, prevState: State_1, snapshot: never): void;
componentDidUpdate(prevProps: Props, prevState: State, snapshot: never): void;
onChange(key: string, value: unknown): void;
__reset(state: State_1): Partial<State_1>;
onSubmit(event?: import("react").SyntheticEvent<Element, Event> | undefined): Promise<unknown>;
onValidate(key?: string | undefined, value?: unknown): Promise<unknown>;
onValidateModel(originalModel: Props_1["model"]): Promise<unknown>;
__reset(state: State): Partial<State>;
onSubmit(event?: import("react").SyntheticEvent): Promise<unknown>;
onValidate(key?: string, value?: unknown): Promise<unknown>;
onValidateModel(originalModel: Props["model"]): Promise<unknown>;
componentDidMount(): void;
componentWillUnmount(): void;
delayId?: NodeJS.Timeout | undefined;
delayId?: ReturnType<typeof setTimeout> | undefined;
mounted: boolean;
reset: () => void;
change: (key: string, value: unknown) => void;
submit: (event?: import("react").SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
submit: (event?: import("react").SyntheticEvent) => Promise<unknown>;
randomId: () => string;
getContextName(): string[];
getContextModel(): Model_1;
getContextState(): {
disabled: boolean;
readOnly: boolean;
showInlineError: boolean;
};
getContextSchema(): import("./Bridge").Bridge;
getContextOnChange(): (key: string, value: unknown) => void;
getContextOnSubmit(): (event?: import("react").SyntheticEvent<Element, Event> | undefined) => unknown;
getModel(mode?: ModelTransformMode | undefined, model?: Model_1): Model_1;
getContextName(): import("./types").Context<Model>["name"];
getContextModel(): Model;
getContextState(): import("./types").Context<Model>["state"];
getContextSchema(): import("./types").Context<Model>["schema"];
getContextOnChange(): import("./types").Context<Model>["onChange"];
getContextOnSubmit(): import("./types").Context<Model>["onSubmit"];
getModel(mode?: ModelTransformMode, model?: Model): Model;
onReset(): void;
render(): JSX.Element;
context: any;
setState<K_1 extends keyof State_1>(state: State_1 | ((prevState: Readonly<State_1>, props: Readonly<Props_1>) => State_1 | Pick<State_1, K_1> | null) | Pick<State_1, K_1> | null, callback?: (() => void) | undefined): void;
render(): import("react").JSX.Element;
context: unknown;
setState<K extends keyof State>(state: State | ((prevState: Readonly<State>, props: Readonly<Props>) => State | Pick<State, K> | null) | Pick<State, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly<Props_1> & Readonly<{
children?: import("react").ReactNode;
}>;
state: Readonly<State_1>;
readonly props: Readonly<Props>;
state: Readonly<State>;
refs: {
[key: string]: import("react").ReactInstance;
};
shouldComponentUpdate?(nextProps: Readonly<Props_1>, nextState: Readonly<State_1>, nextContext: any): boolean;
shouldComponentUpdate?(nextProps: Readonly<Props>, nextState: Readonly<State>, nextContext: any): boolean;
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly<Props_1>, prevState: Readonly<State_1>): any;
getSnapshotBeforeUpdate?(prevProps: Readonly<Props>, prevState: Readonly<State>): any;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<Props_1>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Props_1>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<Props_1>, nextState: Readonly<State_1>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<Props_1>, nextState: Readonly<State_1>, nextContext: any): void;
componentWillReceiveProps?(nextProps: Readonly<Props>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Props>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<Props>, nextState: Readonly<State>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<Props>, nextState: Readonly<State>, nextContext: any): void;
};

@@ -269,10 +253,10 @@ Validated: typeof import("./ValidatedForm").Validated;

} & {
new <Model_2 extends UnknownObject, Props_2 extends import("./QuickForm").QuickFormProps<Model_2> = import("./QuickForm").QuickFormProps<Model_2>, State_2 extends import("./QuickForm").QuickFormState<Model_2> = import("./QuickForm").QuickFormState<Model_2>>(props: Props_2): {
new <Model extends UnknownObject, Props extends import("./QuickForm").QuickFormProps<Model> = import("./QuickForm").QuickFormProps<Model>, State extends import("./QuickForm").QuickFormState<Model> = import("./QuickForm").QuickFormState<Model>>(props: Props): {
getNativeFormProps(): {
[key: string]: unknown;
children?: import("react").ReactNode;
id?: string | undefined;
id?: string;
key: string;
noValidate: boolean;
onSubmit: (event?: import("react").SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
onSubmit: (event?: import("react").SyntheticEvent) => Promise<unknown>;
};

@@ -282,50 +266,44 @@ getAutoField(): import("react").ComponentType<{

}>;
getErrorsField(): import("react").ComponentType<{}>;
getSubmitField(): import("react").ComponentType<{}>;
getErrorsField(): import("react").ComponentType;
getSubmitField(): import("react").ComponentType;
componentDidMount(): void;
componentDidUpdate(prevProps: Props_2, prevState: State_2, snapshot: never): void;
componentDidUpdate(prevProps: Props, prevState: State, snapshot: never): void;
componentWillUnmount(): void;
delayId?: NodeJS.Timeout | undefined;
delayId?: ReturnType<typeof setTimeout> | undefined;
mounted: boolean;
reset: () => void;
change: (key: string, value: unknown) => void;
submit: (event?: import("react").SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
submit: (event?: import("react").SyntheticEvent) => Promise<unknown>;
randomId: () => string;
getContext(): import("./types").Context<Model_2>;
getContextName(): string[];
getContextError(): unknown;
getContextModel(): Model_2;
getContextState(): {
disabled: boolean;
readOnly: boolean;
showInlineError: boolean;
};
getContextSchema(): import("./Bridge").Bridge;
getContextOnChange(): (key: string, value: unknown) => void;
getContextOnSubmit(): (event?: import("react").SyntheticEvent<Element, Event> | undefined) => unknown;
getModel(mode?: ModelTransformMode | undefined, model?: Model_2): Model_2;
getContext(): import("./types").Context<Model>;
getContextName(): import("./types").Context<Model>["name"];
getContextError(): import("./types").Context<Model>["error"];
getContextModel(): Model;
getContextState(): import("./types").Context<Model>["state"];
getContextSchema(): import("./types").Context<Model>["schema"];
getContextOnChange(): import("./types").Context<Model>["onChange"];
getContextOnSubmit(): import("./types").Context<Model>["onSubmit"];
getModel(mode?: ModelTransformMode, model?: Model): Model;
onChange(key: string, value: unknown): void;
__reset(state: State_2): Partial<State_2>;
__reset(state: State): Partial<State>;
onReset(): void;
onSubmit(event?: import("react").SyntheticEvent<Element, Event> | undefined): Promise<unknown>;
render(): JSX.Element;
context: any;
setState<K_2 extends keyof State_2>(state: State_2 | ((prevState: Readonly<State_2>, props: Readonly<Props_2>) => State_2 | Pick<State_2, K_2> | null) | Pick<State_2, K_2> | null, callback?: (() => void) | undefined): void;
onSubmit(event?: import("react").SyntheticEvent): Promise<unknown>;
render(): import("react").JSX.Element;
context: unknown;
setState<K extends keyof State>(state: State | ((prevState: Readonly<State>, props: Readonly<Props>) => State | Pick<State, K> | null) | Pick<State, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly<Props_2> & Readonly<{
children?: import("react").ReactNode;
}>;
state: Readonly<State_2>;
readonly props: Readonly<Props>;
state: Readonly<State>;
refs: {
[key: string]: import("react").ReactInstance;
};
shouldComponentUpdate?(nextProps: Readonly<Props_2>, nextState: Readonly<State_2>, nextContext: any): boolean;
shouldComponentUpdate?(nextProps: Readonly<Props>, nextState: Readonly<State>, nextContext: any): boolean;
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly<Props_2>, prevState: Readonly<State_2>): any;
getSnapshotBeforeUpdate?(prevProps: Readonly<Props>, prevState: Readonly<State>): any;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<Props_2>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Props_2>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<Props_2>, nextState: Readonly<State_2>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<Props_2>, nextState: Readonly<State_2>, nextContext: any): void;
componentWillReceiveProps?(nextProps: Readonly<Props>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Props>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<Props>, nextState: Readonly<State>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<Props>, nextState: Readonly<State>, nextContext: any): void;
};

@@ -344,3 +322,3 @@ Quick: typeof import("./QuickForm").Quick;

} & typeof BaseForm;
export declare type AutoForm = typeof AutoForm;
export type AutoForm = typeof AutoForm;
//# sourceMappingURL=AutoForm.d.ts.map
import clone from 'lodash/clone';
import get from 'lodash/get';
import isEqual from 'lodash/isEqual';

@@ -37,6 +38,11 @@ import omit from 'lodash/omit';

onChange(key, value) {
const previousValue = get(this.state.model, key);
super.onChange(key, value);
this.setState(state => ({ model: setWith(clone(state.model), key, value, clone) }), () => {
if (this.props.onChangeModel) {
this.props.onChangeModel(this.state.model);
this.props.onChangeModel(this.state.model, {
key,
value,
previousValue,
});
}

@@ -43,0 +49,0 @@ });

import React, { Component, SyntheticEvent } from 'react';
import { Bridge } from './Bridge';
import { ChangedMap, Context, ModelTransformMode, UnknownObject } from './types';
export declare type BaseFormProps<Model extends UnknownObject> = {
export type BaseFormProps<Model extends UnknownObject> = {
autosave: boolean;
autosaveDelay: number;
children?: React.ReactNode;
disabled?: boolean;

@@ -19,3 +20,3 @@ error: unknown;

};
export declare type BaseFormState<Model extends UnknownObject> = {
export type BaseFormState<Model extends UnknownObject> = {
changed: boolean;

@@ -59,5 +60,5 @@ changedMap: ChangedMap<Model>;

children?: React.ReactNode;
id?: BaseFormProps<Model>['id'];
id?: string;
key: string;
noValidate: BaseFormProps<Model>['noValidate'];
noValidate: boolean;
onSubmit: BaseForm<Model, Props, State>['onSubmit'];

@@ -69,4 +70,4 @@ };

onSubmit(event?: SyntheticEvent): Promise<unknown>;
render(): JSX.Element;
render(): React.JSX.Element;
}
//# sourceMappingURL=BaseForm.d.ts.map
import { ComponentType, FunctionComponent } from 'react';
import { GuaranteedProps, Override, UnknownObject } from './types';
/** @internal */
export declare type ConnectFieldOptions = {
export type ConnectFieldOptions = {
initialValue?: boolean;

@@ -9,3 +9,3 @@ kind?: 'leaf' | 'node';

/** @internal */
export declare type ConnectedFieldProps<Props extends UnknownObject, Value = Props['value']> = Override<Props, Override<Partial<GuaranteedProps<Value>>, {
export type ConnectedFieldProps<Props extends UnknownObject, Value = Props['value']> = Override<Props, Override<Partial<GuaranteedProps<Value>>, {
label?: Props['label'] | null | string;

@@ -15,3 +15,3 @@ name: string;

/** @internal */
export declare type ConnectedField<Props extends UnknownObject, Value = Props['value']> = FunctionComponent<ConnectedFieldProps<Props, Value>> & {
export type ConnectedField<Props extends UnknownObject, Value = Props['value']> = FunctionComponent<ConnectedFieldProps<Props, Value>> & {
Component: ComponentType<Props>;

@@ -18,0 +18,0 @@ options?: ConnectFieldOptions;

@@ -1,4 +0,3 @@

/// <reference types="react" />
import { Context } from './types';
export declare const context: import("react").Context<Context<any> | null>;
//# sourceMappingURL=context.d.ts.map

@@ -5,3 +5,3 @@ import { ComponentType, ReactElement } from 'react';

import { useField } from './useField';
export declare type AutoFieldProps = UnknownObject & {
export type AutoFieldProps = UnknownObject & {
component?: Component;

@@ -12,5 +12,5 @@ experimental_absoluteName?: boolean;

/** @internal */
export declare type Component = ComponentType<any> | ReturnType<typeof connectField>;
export type Component = ComponentType<any> | ReturnType<typeof connectField>;
/** @internal */
export declare type ComponentDetector = (props: ReturnType<typeof useField>[0], uniforms: Context<UnknownObject>) => Component;
export type ComponentDetector = (props: ReturnType<typeof useField>[0], uniforms: Context<UnknownObject>) => Component;
export declare function createAutoField(defaultComponentDetector: ComponentDetector): (({ experimental_absoluteName: absoluteName, ...rawProps }: AutoFieldProps) => ReactElement) & {

@@ -17,0 +17,0 @@ componentDetectorContext: import("react").Context<ComponentDetector>;

import { FilterDOMProps } from '.';
/** @internal */
export declare type FilterDOMPropsKeys = keyof FilterDOMProps;
export declare const filterDOMProps: (<T extends object>(props: T) => Omit<T, keyof FilterDOMProps>) & {
export type FilterDOMPropsKeys = keyof FilterDOMProps;
export declare const filterDOMProps: (<T extends object>(props: T) => Omit<T, FilterDOMPropsKeys>) & {
register(...props: FilterDOMPropsKeys[]): void;
registered: readonly (keyof FilterDOMProps)[];
registered: readonly FilterDOMPropsKeys[];
};
//# sourceMappingURL=filterDOMProps.d.ts.map

@@ -1,10 +0,9 @@

/// <reference types="node" />
import React, { ComponentType } from 'react';
import { BaseForm, BaseFormProps, BaseFormState } from './BaseForm';
import { UnknownObject } from './types';
export declare type QuickFormProps<Model extends UnknownObject> = BaseFormProps<Model> & {
export type QuickFormProps<Model extends UnknownObject> = BaseFormProps<Model> & {
errorsField?: ComponentType;
submitField?: ComponentType;
};
export declare type QuickFormState<Model extends UnknownObject> = BaseFormState<Model>;
export type QuickFormState<Model extends UnknownObject> = BaseFormState<Model>;
export declare function Quick<Base extends typeof BaseForm>(Base: Base): {

@@ -15,6 +14,6 @@ new <Model extends UnknownObject, Props extends QuickFormProps<Model> = QuickFormProps<Model>, State extends QuickFormState<Model> = QuickFormState<Model>>(props: Props): {

children?: React.ReactNode;
id?: string | undefined;
id?: string;
key: string;
noValidate: boolean;
onSubmit: (event?: React.SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
onSubmit: (event?: React.SyntheticEvent) => Promise<unknown>;
};

@@ -29,32 +28,26 @@ getAutoField(): ComponentType<{

componentWillUnmount(): void;
delayId?: NodeJS.Timeout | undefined;
delayId?: ReturnType<typeof setTimeout> | undefined;
mounted: boolean;
reset: () => void;
change: (key: string, value: unknown) => void;
submit: (event?: React.SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
submit: (event?: React.SyntheticEvent) => Promise<unknown>;
randomId: () => string;
getContext(): import("./types").Context<Model>;
getContextName(): string[];
getContextError(): unknown;
getContextName(): import("./types").Context<Model>["name"];
getContextError(): import("./types").Context<Model>["error"];
getContextModel(): Model;
getContextState(): {
disabled: boolean;
readOnly: boolean;
showInlineError: boolean;
};
getContextSchema(): import("./Bridge").Bridge;
getContextOnChange(): (key: string, value: unknown) => void;
getContextOnSubmit(): (event?: React.SyntheticEvent<Element, Event> | undefined) => unknown;
getModel(mode?: import("./types").ModelTransformMode | undefined, model?: Model): Model;
getContextState(): import("./types").Context<Model>["state"];
getContextSchema(): import("./types").Context<Model>["schema"];
getContextOnChange(): import("./types").Context<Model>["onChange"];
getContextOnSubmit(): import("./types").Context<Model>["onSubmit"];
getModel(mode?: import("./types").ModelTransformMode, model?: Model): Model;
onChange(key: string, value: unknown): void;
__reset(state: State): Partial<State>;
onReset(): void;
onSubmit(event?: React.SyntheticEvent<Element, Event> | undefined): Promise<unknown>;
render(): JSX.Element;
context: any;
onSubmit(event?: React.SyntheticEvent): Promise<unknown>;
render(): React.JSX.Element;
context: unknown;
setState<K extends keyof State>(state: State | ((prevState: Readonly<State>, props: Readonly<Props>) => State | Pick<State, K> | null) | Pick<State, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly<Props> & Readonly<{
children?: React.ReactNode;
}>;
readonly props: Readonly<Props>;
state: Readonly<State>;

@@ -91,6 +84,6 @@ refs: {

children?: React.ReactNode;
id?: string | undefined;
id?: string;
key: string;
noValidate: boolean;
onSubmit: (event?: React.SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
onSubmit: (event?: React.SyntheticEvent) => Promise<unknown>;
};

@@ -105,32 +98,26 @@ getAutoField(): React.ComponentType<{

componentWillUnmount(): void;
delayId?: NodeJS.Timeout | undefined;
delayId?: ReturnType<typeof setTimeout> | undefined;
mounted: boolean;
reset: () => void;
change: (key: string, value: unknown) => void;
submit: (event?: React.SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
submit: (event?: React.SyntheticEvent) => Promise<unknown>;
randomId: () => string;
getContext(): import("./types").Context<Model>;
getContextName(): string[];
getContextError(): unknown;
getContextName(): import("./types").Context<Model>["name"];
getContextError(): import("./types").Context<Model>["error"];
getContextModel(): Model;
getContextState(): {
disabled: boolean;
readOnly: boolean;
showInlineError: boolean;
};
getContextSchema(): import("./Bridge").Bridge;
getContextOnChange(): (key: string, value: unknown) => void;
getContextOnSubmit(): (event?: React.SyntheticEvent<Element, Event> | undefined) => unknown;
getModel(mode?: import("./types").ModelTransformMode | undefined, model?: Model): Model;
getContextState(): import("./types").Context<Model>["state"];
getContextSchema(): import("./types").Context<Model>["schema"];
getContextOnChange(): import("./types").Context<Model>["onChange"];
getContextOnSubmit(): import("./types").Context<Model>["onSubmit"];
getModel(mode?: import("./types").ModelTransformMode, model?: Model): Model;
onChange(key: string, value: unknown): void;
__reset(state: State): Partial<State>;
onReset(): void;
onSubmit(event?: React.SyntheticEvent<Element, Event> | undefined): Promise<unknown>;
render(): JSX.Element;
context: any;
onSubmit(event?: React.SyntheticEvent): Promise<unknown>;
render(): React.JSX.Element;
context: unknown;
setState<K extends keyof State>(state: State | ((prevState: Readonly<State>, props: Readonly<Props>) => State | Pick<State, K> | null) | Pick<State, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly<Props> & Readonly<{
children?: React.ReactNode;
}>;
readonly props: Readonly<Props>;
state: Readonly<State>;

@@ -162,3 +149,3 @@ refs: {

} & typeof BaseForm;
export declare type QuickForm = typeof QuickForm;
export type QuickForm = typeof QuickForm;
//# sourceMappingURL=QuickForm.d.ts.map
import { HTMLProps, ReactNode, SyntheticEvent } from 'react';
import { BaseForm } from './BaseForm';
import { Bridge } from './Bridge';
export declare type ChangedMap<T> = T extends object ? {
export type ChangedMap<T> = T extends object ? {
[P in keyof T]?: ChangedMap<T[P]>;
} : Record<string, void>;
export declare type Context<Model extends UnknownObject> = {
export type Context<Model extends UnknownObject> = {
changed: boolean;

@@ -27,6 +27,6 @@ changedMap: ChangedMap<Model>;

};
export declare type FieldProps<Value, Base, Extension = object> = Override<Base, GuaranteedProps<Value> & Extension>;
export type FieldProps<Value, Base, Extension = object> = Override<Base, GuaranteedProps<Value> & Extension>;
export interface FilterDOMProps {
}
export declare type GuaranteedProps<Value> = {
export type GuaranteedProps<Value> = {
changed: boolean;

@@ -48,13 +48,13 @@ disabled: boolean;

/** @internal */
export declare type OnChange<Value> = {
export type OnChange<Value> = {
(value: Value): void;
(value: unknown, name: string): void;
};
export declare type HTMLFieldProps<Value, Element, Extension = object> = FieldProps<Value, HTMLProps<Element>, Extension>;
export declare type ModelTransformMode = 'form' | 'submit' | 'validate';
export type HTMLFieldProps<Value, Element, Extension = object> = FieldProps<Value, HTMLProps<Element>, Extension>;
export type ModelTransformMode = 'form' | 'submit' | 'validate';
/** @internal */
export declare type Override<T, U> = T extends any ? U & Omit<T, keyof U> : never;
export type Override<T, U> = T extends any ? U & Omit<T, keyof U> : never;
/** @internal */
export declare type UnknownObject = Record<string, unknown>;
export declare type ValidateMode = 'onChange' | 'onChangeAfterSubmit' | 'onSubmit';
export type UnknownObject = Record<string, unknown>;
export type ValidateMode = 'onChange' | 'onChangeAfterSubmit' | 'onSubmit';
declare module '.' {

@@ -61,0 +61,0 @@ interface FilterDOMProps {

@@ -1,6 +0,5 @@

/// <reference types="node" />
import { SyntheticEvent } from 'react';
import { BaseForm, BaseFormProps, BaseFormState } from './BaseForm';
import { Context, UnknownObject, ValidateMode } from './types';
export declare type ValidatedFormProps<Model extends UnknownObject> = BaseFormProps<Model> & {
export type ValidatedFormProps<Model extends UnknownObject> = BaseFormProps<Model> & {
onValidate: (model: Model, error: unknown) => unknown;

@@ -10,3 +9,3 @@ validate: ValidateMode;

};
export declare type ValidatedFormState<Model extends UnknownObject> = BaseFormState<Model> & {
export type ValidatedFormState<Model extends UnknownObject> = BaseFormState<Model> & {
error: unknown;

@@ -19,5 +18,5 @@ validate: boolean;

new <Model extends UnknownObject, Props extends ValidatedFormProps<Model> = ValidatedFormProps<Model>, State extends ValidatedFormState<Model> = ValidatedFormState<Model>>(props: Props): {
validate: (key?: string | undefined, value?: unknown) => Promise<unknown>;
validate: (key?: string, value?: unknown) => Promise<unknown>;
validateModel: (originalModel: any) => Promise<unknown>;
getContextError(): unknown;
getContextError(): Context<Model>["error"];
getContext(): Context<Model>;

@@ -27,6 +26,6 @@ getNativeFormProps(): {

children?: import("react").ReactNode;
id?: string | undefined;
id?: string;
key: string;
noValidate: boolean;
onSubmit: (event?: SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
onSubmit: (event?: SyntheticEvent) => Promise<unknown>;
};

@@ -36,32 +35,26 @@ componentDidUpdate(prevProps: Props, prevState: State, snapshot: never): void;

__reset(state: State): Partial<State>;
onSubmit(event?: SyntheticEvent<Element, Event> | undefined): Promise<unknown>;
onValidate(key?: string | undefined, value?: unknown): Promise<unknown>;
onSubmit(event?: SyntheticEvent): Promise<unknown>;
onValidate(key?: string, value?: unknown): Promise<unknown>;
onValidateModel(originalModel: Props["model"]): Promise<unknown>;
componentDidMount(): void;
componentWillUnmount(): void;
delayId?: NodeJS.Timeout | undefined;
delayId?: ReturnType<typeof setTimeout> | undefined;
mounted: boolean;
reset: () => void;
change: (key: string, value: unknown) => void;
submit: (event?: SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
submit: (event?: SyntheticEvent) => Promise<unknown>;
randomId: () => string;
getContextName(): string[];
getContextName(): Context<Model>["name"];
getContextModel(): Model;
getContextState(): {
disabled: boolean;
readOnly: boolean;
showInlineError: boolean;
};
getContextSchema(): import("./Bridge").Bridge;
getContextOnChange(): (key: string, value: unknown) => void;
getContextOnSubmit(): (event?: SyntheticEvent<Element, Event> | undefined) => unknown;
getModel(mode?: import("./types").ModelTransformMode | undefined, model?: Model): Model;
getContextState(): Context<Model>["state"];
getContextSchema(): Context<Model>["schema"];
getContextOnChange(): Context<Model>["onChange"];
getContextOnSubmit(): Context<Model>["onSubmit"];
getModel(mode?: import("./types").ModelTransformMode, model?: Model): Model;
onReset(): void;
render(): JSX.Element;
context: any;
render(): import("react").JSX.Element;
context: unknown;
setState<K extends keyof State>(state: State | ((prevState: Readonly<State>, props: Readonly<Props>) => State | Pick<State, K> | null) | Pick<State, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly<Props> & Readonly<{
children?: import("react").ReactNode;
}>;
readonly props: Readonly<Props>;
state: Readonly<State>;

@@ -97,5 +90,5 @@ refs: {

new <Model extends UnknownObject, Props extends ValidatedFormProps<Model> = ValidatedFormProps<Model>, State extends ValidatedFormState<Model> = ValidatedFormState<Model>>(props: Props): {
validate: (key?: string | undefined, value?: unknown) => Promise<unknown>;
validate: (key?: string, value?: unknown) => Promise<unknown>;
validateModel: (originalModel: any) => Promise<unknown>;
getContextError(): unknown;
getContextError(): Context<Model>["error"];
getContext(): Context<Model>;

@@ -105,6 +98,6 @@ getNativeFormProps(): {

children?: import("react").ReactNode;
id?: string | undefined;
id?: string;
key: string;
noValidate: boolean;
onSubmit: (event?: SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
onSubmit: (event?: SyntheticEvent) => Promise<unknown>;
};

@@ -114,32 +107,26 @@ componentDidUpdate(prevProps: Props, prevState: State, snapshot: never): void;

__reset(state: State): Partial<State>;
onSubmit(event?: SyntheticEvent<Element, Event> | undefined): Promise<unknown>;
onValidate(key?: string | undefined, value?: unknown): Promise<unknown>;
onSubmit(event?: SyntheticEvent): Promise<unknown>;
onValidate(key?: string, value?: unknown): Promise<unknown>;
onValidateModel(originalModel: Props["model"]): Promise<unknown>;
componentDidMount(): void;
componentWillUnmount(): void;
delayId?: NodeJS.Timeout | undefined;
delayId?: ReturnType<typeof setTimeout> | undefined;
mounted: boolean;
reset: () => void;
change: (key: string, value: unknown) => void;
submit: (event?: SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
submit: (event?: SyntheticEvent) => Promise<unknown>;
randomId: () => string;
getContextName(): string[];
getContextName(): Context<Model>["name"];
getContextModel(): Model;
getContextState(): {
disabled: boolean;
readOnly: boolean;
showInlineError: boolean;
};
getContextSchema(): import("./Bridge").Bridge;
getContextOnChange(): (key: string, value: unknown) => void;
getContextOnSubmit(): (event?: SyntheticEvent<Element, Event> | undefined) => unknown;
getModel(mode?: import("./types").ModelTransformMode | undefined, model?: Model): Model;
getContextState(): Context<Model>["state"];
getContextSchema(): Context<Model>["schema"];
getContextOnChange(): Context<Model>["onChange"];
getContextOnSubmit(): Context<Model>["onSubmit"];
getModel(mode?: import("./types").ModelTransformMode, model?: Model): Model;
onReset(): void;
render(): JSX.Element;
context: any;
render(): import("react").JSX.Element;
context: unknown;
setState<K extends keyof State>(state: State | ((prevState: Readonly<State>, props: Readonly<Props>) => State | Pick<State, K> | null) | Pick<State, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly<Props> & Readonly<{
children?: import("react").ReactNode;
}>;
readonly props: Readonly<Props>;
state: Readonly<State>;

@@ -173,3 +160,3 @@ refs: {

} & typeof BaseForm;
export declare type ValidatedForm = typeof ValidatedForm;
export type ValidatedForm = typeof ValidatedForm;
//# sourceMappingURL=ValidatedForm.d.ts.map

@@ -1,3 +0,1 @@

/// <reference types="react" />
/// <reference types="node" />
import { BaseForm } from './BaseForm';

@@ -7,9 +5,9 @@ import { Quick, QuickFormProps, QuickFormState } from './QuickForm';

import { UnknownObject } from './types';
export declare type ValidatedQuickFormProps<Model extends UnknownObject> = QuickFormProps<Model> & ValidatedFormProps<Model>;
export declare type ValidatedQuickFormState<Model extends UnknownObject> = QuickFormState<Model> & ValidatedFormState<Model>;
export type ValidatedQuickFormProps<Model extends UnknownObject> = QuickFormProps<Model> & ValidatedFormProps<Model>;
export type ValidatedQuickFormState<Model extends UnknownObject> = QuickFormState<Model> & ValidatedFormState<Model>;
export declare const ValidatedQuickForm: {
new <Model extends UnknownObject, Props extends ValidatedFormProps<Model> = ValidatedFormProps<Model>, State extends ValidatedFormState<Model> = ValidatedFormState<Model>>(props: Props): {
validate: (key?: string | undefined, value?: unknown) => Promise<unknown>;
validate: (key?: string, value?: unknown) => Promise<unknown>;
validateModel: (originalModel: any) => Promise<unknown>;
getContextError(): unknown;
getContextError(): import("./types").Context<Model>["error"];
getContext(): import("./types").Context<Model>;

@@ -19,6 +17,6 @@ getNativeFormProps(): {

children?: import("react").ReactNode;
id?: string | undefined;
id?: string;
key: string;
noValidate: boolean;
onSubmit: (event?: import("react").SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
onSubmit: (event?: import("react").SyntheticEvent) => Promise<unknown>;
};

@@ -28,32 +26,26 @@ componentDidUpdate(prevProps: Props, prevState: State, snapshot: never): void;

__reset(state: State): Partial<State>;
onSubmit(event?: import("react").SyntheticEvent<Element, Event> | undefined): Promise<unknown>;
onValidate(key?: string | undefined, value?: unknown): Promise<unknown>;
onSubmit(event?: import("react").SyntheticEvent): Promise<unknown>;
onValidate(key?: string, value?: unknown): Promise<unknown>;
onValidateModel(originalModel: Props["model"]): Promise<unknown>;
componentDidMount(): void;
componentWillUnmount(): void;
delayId?: NodeJS.Timeout | undefined;
delayId?: ReturnType<typeof setTimeout> | undefined;
mounted: boolean;
reset: () => void;
change: (key: string, value: unknown) => void;
submit: (event?: import("react").SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
submit: (event?: import("react").SyntheticEvent) => Promise<unknown>;
randomId: () => string;
getContextName(): string[];
getContextName(): import("./types").Context<Model>["name"];
getContextModel(): Model;
getContextState(): {
disabled: boolean;
readOnly: boolean;
showInlineError: boolean;
};
getContextSchema(): import("./Bridge").Bridge;
getContextOnChange(): (key: string, value: unknown) => void;
getContextOnSubmit(): (event?: import("react").SyntheticEvent<Element, Event> | undefined) => unknown;
getModel(mode?: import("./types").ModelTransformMode | undefined, model?: Model): Model;
getContextState(): import("./types").Context<Model>["state"];
getContextSchema(): import("./types").Context<Model>["schema"];
getContextOnChange(): import("./types").Context<Model>["onChange"];
getContextOnSubmit(): import("./types").Context<Model>["onSubmit"];
getModel(mode?: import("./types").ModelTransformMode, model?: Model): Model;
onReset(): void;
render(): JSX.Element;
context: any;
render(): import("react").JSX.Element;
context: unknown;
setState<K extends keyof State>(state: State | ((prevState: Readonly<State>, props: Readonly<Props>) => State | Pick<State, K> | null) | Pick<State, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly<Props> & Readonly<{
children?: import("react").ReactNode;
}>;
readonly props: Readonly<Props>;
state: Readonly<State>;

@@ -87,10 +79,10 @@ refs: {

} & {
new <Model_1 extends UnknownObject, Props_1 extends QuickFormProps<Model_1> = QuickFormProps<Model_1>, State_1 extends QuickFormState<Model_1> = QuickFormState<Model_1>>(props: Props_1): {
new <Model extends UnknownObject, Props extends QuickFormProps<Model> = QuickFormProps<Model>, State extends QuickFormState<Model> = QuickFormState<Model>>(props: Props): {
getNativeFormProps(): {
[key: string]: unknown;
children?: import("react").ReactNode;
id?: string | undefined;
id?: string;
key: string;
noValidate: boolean;
onSubmit: (event?: import("react").SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
onSubmit: (event?: import("react").SyntheticEvent) => Promise<unknown>;
};

@@ -100,50 +92,44 @@ getAutoField(): import("react").ComponentType<{

}>;
getErrorsField(): import("react").ComponentType<{}>;
getSubmitField(): import("react").ComponentType<{}>;
getErrorsField(): import("react").ComponentType;
getSubmitField(): import("react").ComponentType;
componentDidMount(): void;
componentDidUpdate(prevProps: Props_1, prevState: State_1, snapshot: never): void;
componentDidUpdate(prevProps: Props, prevState: State, snapshot: never): void;
componentWillUnmount(): void;
delayId?: NodeJS.Timeout | undefined;
delayId?: ReturnType<typeof setTimeout> | undefined;
mounted: boolean;
reset: () => void;
change: (key: string, value: unknown) => void;
submit: (event?: import("react").SyntheticEvent<Element, Event> | undefined) => Promise<unknown>;
submit: (event?: import("react").SyntheticEvent) => Promise<unknown>;
randomId: () => string;
getContext(): import("./types").Context<Model_1>;
getContextName(): string[];
getContextError(): unknown;
getContextModel(): Model_1;
getContextState(): {
disabled: boolean;
readOnly: boolean;
showInlineError: boolean;
};
getContextSchema(): import("./Bridge").Bridge;
getContextOnChange(): (key: string, value: unknown) => void;
getContextOnSubmit(): (event?: import("react").SyntheticEvent<Element, Event> | undefined) => unknown;
getModel(mode?: import("./types").ModelTransformMode | undefined, model?: Model_1): Model_1;
getContext(): import("./types").Context<Model>;
getContextName(): import("./types").Context<Model>["name"];
getContextError(): import("./types").Context<Model>["error"];
getContextModel(): Model;
getContextState(): import("./types").Context<Model>["state"];
getContextSchema(): import("./types").Context<Model>["schema"];
getContextOnChange(): import("./types").Context<Model>["onChange"];
getContextOnSubmit(): import("./types").Context<Model>["onSubmit"];
getModel(mode?: import("./types").ModelTransformMode, model?: Model): Model;
onChange(key: string, value: unknown): void;
__reset(state: State_1): Partial<State_1>;
__reset(state: State): Partial<State>;
onReset(): void;
onSubmit(event?: import("react").SyntheticEvent<Element, Event> | undefined): Promise<unknown>;
render(): JSX.Element;
context: any;
setState<K_1 extends keyof State_1>(state: State_1 | ((prevState: Readonly<State_1>, props: Readonly<Props_1>) => State_1 | Pick<State_1, K_1> | null) | Pick<State_1, K_1> | null, callback?: (() => void) | undefined): void;
onSubmit(event?: import("react").SyntheticEvent): Promise<unknown>;
render(): import("react").JSX.Element;
context: unknown;
setState<K extends keyof State>(state: State | ((prevState: Readonly<State>, props: Readonly<Props>) => State | Pick<State, K> | null) | Pick<State, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly<Props_1> & Readonly<{
children?: import("react").ReactNode;
}>;
state: Readonly<State_1>;
readonly props: Readonly<Props>;
state: Readonly<State>;
refs: {
[key: string]: import("react").ReactInstance;
};
shouldComponentUpdate?(nextProps: Readonly<Props_1>, nextState: Readonly<State_1>, nextContext: any): boolean;
shouldComponentUpdate?(nextProps: Readonly<Props>, nextState: Readonly<State>, nextContext: any): boolean;
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly<Props_1>, prevState: Readonly<State_1>): any;
getSnapshotBeforeUpdate?(prevProps: Readonly<Props>, prevState: Readonly<State>): any;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<Props_1>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Props_1>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<Props_1>, nextState: Readonly<State_1>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<Props_1>, nextState: Readonly<State_1>, nextContext: any): void;
componentWillReceiveProps?(nextProps: Readonly<Props>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Props>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<Props>, nextState: Readonly<State>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<Props>, nextState: Readonly<State>, nextContext: any): void;
};

@@ -162,3 +148,3 @@ Quick: typeof Quick;

} & typeof BaseForm;
export declare type ValidatedQuickForm = typeof ValidatedQuickForm;
export type ValidatedQuickForm = typeof ValidatedQuickForm;
//# sourceMappingURL=ValidatedQuickForm.d.ts.map
{
"name": "uniforms",
"version": "4.0.0-alpha.6",
"version": "4.0.0-beta.1",
"license": "MIT",

@@ -41,6 +41,19 @@ "main": "./cjs/index.js",

"invariant": "^2.0.0",
"lodash": "^4.0.0",
"tslib": "^2.2.0"
"lodash": "^4.0.0"
},
"gitHead": "884581ac1dc9191159459d1d5ad2c7169f8769f3"
"devDependencies": {
"@types/invariant": "2.2.37",
"@types/lodash": "4.17.5",
"@types/react": "18.3.12",
"@types/simpl-schema": "1.12.8",
"moment": "2.30.1",
"simpl-schema": "1.13.1",
"tslib": "2.2.0",
"typescript": "5.5.4",
"zod": "^3.0.0"
},
"scripts": {
"build:cjs": "tsc --build tsconfig.cjs.json",
"build:esm": "tsc --build tsconfig.esm.json"
}
}

@@ -115,7 +115,7 @@ const escapeMatch = /[.[\]]/;

index -= length;
parts.splice(index + 1, length, ...part);
parts.splice(index + 1, length, ...(part as Array<unknown>));
}
} else {
// Other values -- most likely numbers and `true` -- are stringified.
name.push('' + part);
name.push('' + (part as unknown));
}

@@ -122,0 +122,0 @@ }

@@ -18,2 +18,3 @@ import { HTMLProps, ReactNode, SyntheticEvent } from 'react';

onChange: (key: string, value: unknown) => void;
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
onSubmit: (event?: SyntheticEvent) => unknown | Promise<unknown>;

@@ -37,3 +38,2 @@ randomId: () => string;

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface FilterDOMProps {}

@@ -40,0 +40,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc