mobx-react-form
Advanced tools
Comparing version 6.9.2 to 6.9.3
@@ -6,2 +6,3 @@ import { ObservableMap } from "mobx"; | ||
import { ValidateOptions } from "./models/ValidatorInterface"; | ||
import { SubmitHooks } from "./models/SharedActionsInterface"; | ||
export default class Base implements BaseInterface { | ||
@@ -75,3 +76,3 @@ noop: () => void; | ||
*/ | ||
submit(hooks?: any, { execOnSubmitHook, execValidationHooks, validate }?: { | ||
submit(hooks?: SubmitHooks, { execOnSubmitHook, execValidationHooks, validate }?: { | ||
execOnSubmitHook?: boolean; | ||
@@ -78,0 +79,0 @@ execValidationHooks?: boolean; |
@@ -0,8 +1,15 @@ | ||
import { ValidateOptions } from "./ValidatorInterface"; | ||
export interface SubmitOptions { | ||
execOnSubmitHook: boolean; | ||
execValidationHooks: boolean; | ||
validate: boolean; | ||
} | ||
export interface SubmitHooks { | ||
onSubmit?(instance: any): void; | ||
onSuccess?(instance: any): void; | ||
onError?(instance: any): void; | ||
} | ||
export interface SharedActionsInterface { | ||
validate(opt?: any, obj?: any): Promise<any>; | ||
submit(hooks: any, opt: { | ||
execOnSubmitHook: boolean; | ||
execValidationHooks: boolean; | ||
validate: boolean; | ||
}): Promise<any>; | ||
validate(opt?: ValidateOptions, obj?: ValidateOptions): Promise<any>; | ||
submit(hooks: SubmitHooks, opt: SubmitOptions): Promise<any>; | ||
check(prop: string, deep?: boolean): boolean; | ||
@@ -9,0 +16,0 @@ deepCheck(type: string, prop: string, fields: any): any; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
; | ||
//# sourceMappingURL=SharedActionsInterface.js.map |
@@ -41,3 +41,3 @@ import Form from "../Form"; | ||
export interface ValidationPluginConfig { | ||
package?: ValidationPackage; | ||
package: ValidationPackage; | ||
schema?: any; | ||
@@ -44,0 +44,0 @@ options?: any; |
{ | ||
"name": "mobx-react-form", | ||
"license": "MIT", | ||
"version": "6.9.2", | ||
"version": "6.9.3", | ||
"author": "Claudio Savino <claudio.savino@me.com> (https://twitter.com/foxhound87)", | ||
@@ -6,0 +6,0 @@ "description": "Automagically manage React forms state and automatic validation with MobX.", |
@@ -43,2 +43,3 @@ import { | ||
import { ValidateOptions, ValidationHooks } from "./models/ValidatorInterface"; | ||
import { SubmitHooks } from "./models/SharedActionsInterface"; | ||
export default class Base implements BaseInterface { | ||
@@ -338,3 +339,3 @@ noop = () => {}; | ||
*/ | ||
submit(hooks: any = {}, { | ||
submit(hooks: SubmitHooks = {}, { | ||
execOnSubmitHook = true, | ||
@@ -341,0 +342,0 @@ execValidationHooks = true, |
@@ -0,4 +1,18 @@ | ||
import { ValidateOptions } from "./ValidatorInterface"; | ||
export interface SubmitOptions { | ||
execOnSubmitHook: boolean, | ||
execValidationHooks: boolean, | ||
validate: boolean | ||
}; | ||
export interface SubmitHooks { | ||
onSubmit?(instance): void | ||
onSuccess?(instance): void | ||
onError?(instance): void | ||
} | ||
export interface SharedActionsInterface { | ||
validate(opt?: any, obj?: any): Promise<any>; | ||
submit(hooks: any, opt: { execOnSubmitHook: boolean, execValidationHooks: boolean, validate: boolean }): Promise<any>; | ||
validate(opt?: ValidateOptions, obj?: ValidateOptions): Promise<any>; | ||
submit(hooks: SubmitHooks, opt: SubmitOptions): Promise<any>; | ||
check(prop: string, deep?: boolean): boolean; | ||
@@ -5,0 +19,0 @@ deepCheck(type: string, prop: string, fields: any): any; |
@@ -49,3 +49,3 @@ import Form from "../Form"; | ||
export interface ValidationPluginConfig { | ||
package?: ValidationPackage; | ||
package: ValidationPackage; | ||
schema?: any; | ||
@@ -52,0 +52,0 @@ options?: any; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1232347
14132