diff --git a/CHANGELOG.md b/CHANGELOG.md index 2287d7c2..5fe54a3d 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# 6.3.6 (master) +- Fix: composer `error()` method. +- Fix: default models/interfaces have now named exports. +- Fix: check event w/ `isEvent()` to call `preventDefault()` for native support. + # 6.3.5 (master) - Fix: `parseCheckArray` checks for `incremental` field status. - Updated `semantic-release` diff --git a/README.md b/README.md index 3354c864..ef1c1691 100755 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ import MobxReactForm from 'mobx-react-form'; const myForm = new MobxReactForm({ fields }, { plugins, hooks }); ``` -> Learn about more on the docs about the [Form Instance](https://foxhound87.github.io/mobx-react-form/docs/form/) +> Learn more on the docs about the [Form Instance](https://foxhound87.github.io/mobx-react-form/docs/form/) #### Pass the myForm to a react component @@ -150,7 +150,7 @@ export default observer(({ myForm }) => ( )); ``` -> See more on the docs about the [Event Handlers](https://foxhound87.github.io/mobx-react-form/docs/events/event-handlers.html) and the [Event Hooks](https://foxhound87.github.io/mobx-react-form/docs/events/event-hooks.html). +> See more on the docs about the [Field Props Bindings](https://foxhound87.github.io/mobx-react-form/docs/bindings) ###### Extending the Form class diff --git a/package-lock.json b/package-lock.json index 01f3a0dd..c7928a72 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15158,8 +15158,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==", - "dev": true, - "requires": {} + "dev": true }, "@octokit/plugin-rest-endpoint-methods": { "version": "5.13.0", @@ -16059,8 +16058,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.1.1.tgz", "integrity": "sha512-1FBc1f9G4P/AxMqIgfZgeOTuRnwZMten8E7zap5zgpPInnCrP8D4Q81+4CWIch8i/Nf7nXjP0v6CjjbHOrXhKg==", - "dev": true, - "requires": {} + "dev": true }, "@webpack-cli/info": { "version": "1.4.1", @@ -16075,8 +16073,7 @@ "version": "1.6.1", "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.6.1.tgz", "integrity": "sha512-gNGTiTrjEVQ0OcVnzsRSqTxaBSr+dmTfm+qJsCDluky8uhdLWep7Gcr62QsAKHTMxjCS/8nEITsmFAhfIx+QSw==", - "dev": true, - "requires": {} + "dev": true }, "@xtuc/ieee754": { "version": "1.2.0", @@ -16100,15 +16097,13 @@ "version": "1.8.0", "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", - "dev": true, - "requires": {} + "dev": true }, "acorn-jsx": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "requires": {} + "dev": true }, "acorn-walk": { "version": "8.2.0", @@ -16995,8 +16990,7 @@ "resolved": "https://registry.npmjs.org/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-4.3.0.tgz", "integrity": "sha512-NTxV1MFfZDLPiBMjxbHRwSh5LaLcPMwNdCutmnHJCKoVnlvldPWlllonKwrsRJ5pYZBIBGRWWU2tfvzxgeSW5Q==", "dev": true, - "optional": true, - "requires": {} + "optional": true }, "create-require": { "version": "1.1.1", @@ -23261,8 +23255,7 @@ "version": "3.5.2", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true, - "requires": {} + "dev": true }, "json-schema-traverse": { "version": "0.4.1", diff --git a/src/Base.ts b/src/Base.ts index f687cc4c..75e29023 100755 --- a/src/Base.ts +++ b/src/Base.ts @@ -9,9 +9,9 @@ import { ObservableMap, } from "mobx"; import _ from "lodash"; -import BaseInterface from "./models/BaseInterface"; -import StateInterface from "./models/StateInterface"; -import FieldInterface from "./models/FieldInterface"; +import {BaseInterface} from "./models/BaseInterface"; +import {StateInterface} from "./models/StateInterface"; +import {FieldInterface} from "./models/FieldInterface"; import { props, @@ -22,7 +22,7 @@ import { getObservableMapValues, maxKey, $try, - $isEvent, + isEvent, hasIntKeys, pathToStruct, } from "./utils"; @@ -181,7 +181,7 @@ export default class Base implements BaseInterface { */ onClear = (...args: any): any => this.execHandler(FieldPropsEnum.onClear, args, (e: Event) => { - e.preventDefault(); + isEvent(e) && e.preventDefault(); (this as any).clear(true, false); }); @@ -190,7 +190,7 @@ export default class Base implements BaseInterface { */ onReset = (...args: any): any => this.execHandler(FieldPropsEnum.onReset, args, (e: Event) => { - e.preventDefault(); + isEvent(e) && e.preventDefault(); (this as any).reset(true, false); }); @@ -199,7 +199,7 @@ export default class Base implements BaseInterface { */ onSubmit = (...args: any): any => this.execHandler(FieldPropsEnum.onSubmit, args, (e: Event, o = {}) => { - e.preventDefault(); + isEvent(e) && e.preventDefault(); this.submit(o, { execOnSubmitHook: false }); }); @@ -208,8 +208,8 @@ export default class Base implements BaseInterface { */ onAdd = (...args: any): any => this.execHandler(FieldPropsEnum.onAdd, args, (e: Event, val: any) => { - e.preventDefault(); - this.add($isEvent(val) ? null : val, false); + isEvent(e) && e.preventDefault(); + this.add(isEvent(val) ? null : val, false); }); /** @@ -217,8 +217,8 @@ export default class Base implements BaseInterface { */ onDel = (...args: any): any => this.execHandler(FieldPropsEnum.onDel, args, (e: Event, path: string) => { - e.preventDefault(); - this.del($isEvent(path) ? this.path : path, false); + isEvent(e) && e.preventDefault(); + this.del(isEvent(path) ? this.path : path, false); }); /****************************************************************** diff --git a/src/Bindings.ts b/src/Bindings.ts index 35f0360a..d49fd407 100755 --- a/src/Bindings.ts +++ b/src/Bindings.ts @@ -2,7 +2,7 @@ import _ from "lodash"; import { $try } from "./utils"; import { FieldPropsEnum, FieldPropsType } from "./models/FieldProps"; -import BindingsInterface from "./models/BindingsInterface"; +import { BindingsInterface } from "./models/BindingsInterface"; export default class Bindings implements BindingsInterface { templates = { diff --git a/src/Field.ts b/src/Field.ts index d0f4577e..0827b5c4 100755 --- a/src/Field.ts +++ b/src/Field.ts @@ -12,7 +12,7 @@ import { import _ from "lodash"; import Base from "./Base"; -import { $try, $hasFiles, $isBool, $isEvent, pathToStruct, isArrayFromStruct } from "./utils"; +import { $try, hasFiles, isBool, isEvent, pathToStruct, isArrayFromStruct } from "./utils"; import { parseInput, @@ -20,8 +20,8 @@ import { defaultValue, } from "./parser"; -import OptionsModel, { OptionsEnum } from "./models/OptionsModel"; -import FieldInterface, { FieldConstructor } from "./models/FieldInterface"; +import { OptionsModel, OptionsEnum } from "./models/OptionsModel"; +import { FieldInterface, FieldConstructor } from "./models/FieldInterface"; import { FieldPropsEnum } from "./models/FieldProps"; const applyFieldPropFunc = (instance: FieldInterface, prop: any): any => { @@ -336,7 +336,7 @@ export default class Field extends Base implements FieldInterface { : this.getComputedProp(FieldPropsEnum.value); } - get initial() { + get initial(): any { return this.$initial ? toJS(this.$initial) : this.getComputedProp(FieldPropsEnum.initial); @@ -416,7 +416,7 @@ export default class Field extends Base implements FieldInterface { return parseCheckOutput(this, this.validatedWith); } - get error() { + get error(): string { if (this.showError === false) return null; return this.errorAsync || this.errorSync || null; } @@ -472,7 +472,7 @@ export default class Field extends Base implements FieldInterface { sync = action((e: any, v: any = null) => { const $get = ($: any) => - $isBool($, this.value) ? $.target.checked : $.target.value; + isBool($, this.value) ? $.target.checked : $.target.value; // assume "v" or "e" are the values if (_.isNil(e) || _.isNil(e.target)) { @@ -539,7 +539,7 @@ export default class Field extends Base implements FieldInterface { const e = args[0]; let files: unknown[] | null = null; - if ($isEvent(e) && $hasFiles(e)) { + if (isEvent(e) && hasFiles(e)) { files = _.map(e.target.files); } diff --git a/src/Form.ts b/src/Form.ts index e5ac9b97..2e444e6e 100755 --- a/src/Form.ts +++ b/src/Form.ts @@ -6,8 +6,8 @@ import Validator from "./Validator"; import State from "./State"; import Field from "./Field"; import ValidatorInterface from "./models/ValidatorInterface"; -import FieldInterface, { FieldConstructor } from "./models/FieldInterface"; -import FormInterface, { FieldsDefinitions, FormConfig } from "./models/FormInterface"; +import { FieldInterface, FieldConstructor } from "./models/FieldInterface"; +import { FormInterface, FieldsDefinitions, FormConfig } from "./models/FormInterface"; import { FieldPropsEnum } from "./models/FieldProps"; import { OptionsEnum } from "./models/OptionsModel"; diff --git a/src/Options.ts b/src/Options.ts index cc180071..0b6079a1 100644 --- a/src/Options.ts +++ b/src/Options.ts @@ -11,8 +11,8 @@ import _ from "lodash"; import { uniqueId } from "./utils"; -import OptionsModel from "./models/OptionsModel"; -import OptionsInterface from "./models/OptionsInterface"; +import {OptionsModel} from "./models/OptionsModel"; +import {OptionsInterface} from "./models/OptionsInterface"; export default class Options implements OptionsInterface { options: OptionsModel = { diff --git a/src/State.ts b/src/State.ts index 8394ed90..715bb355 100755 --- a/src/State.ts +++ b/src/State.ts @@ -13,13 +13,13 @@ import { $try, } from "./utils"; -import StateInterface from "./models/StateInterface"; import { RuntimeMode } from "./models/StateInterface"; -import OptionsInterface from "./models/OptionsInterface"; -import BindingsInterface from "./models/BindingsInterface"; -import FormInterface from "./models/FormInterface"; +import { StateInterface } from "./models/StateInterface"; +import { OptionsInterface } from "./models/OptionsInterface"; +import { BindingsInterface } from "./models/BindingsInterface"; +import { FormInterface } from "./models/FormInterface"; import { OptionsEnum } from "./models/OptionsModel"; -import FieldInterface from "./models/FieldInterface"; +import { FieldInterface } from "./models/FieldInterface"; export default class State implements StateInterface { mode = RuntimeMode.mixed; diff --git a/src/Validator.ts b/src/Validator.ts index 5c375965..7f2802cc 100755 --- a/src/Validator.ts +++ b/src/Validator.ts @@ -6,8 +6,8 @@ import ValidatorInterface, { ValidationPluginInterface, ValidationPlugins, } from "./models/ValidatorInterface"; -import FormInterface from "./models/FormInterface"; -import FieldInterface from "./models/FieldInterface"; +import { FormInterface } from "./models/FormInterface"; +import { FieldInterface } from "./models/FieldInterface"; import { OptionsEnum } from "./models/OptionsModel"; export default class Validator implements ValidatorInterface { diff --git a/src/composer.ts b/src/composer.ts index f055fa42..90ffe882 100644 --- a/src/composer.ts +++ b/src/composer.ts @@ -1,5 +1,5 @@ import { FieldPropsEnum } from "./models/FieldProps"; -import FormInterface from "./models/FormInterface"; +import { FormInterface } from "./models/FormInterface"; export const composer = (forms: { [key in string]: FormInterface }) => { @@ -25,7 +25,7 @@ export const composer = (forms: { [key in string]: FormInterface }) => { .every(((val: boolean) => val === true)); const error = () => Object.values(check(FieldPropsEnum.hasError)) - .every(((val: boolean) => val === true)); + .some(((val: boolean) => val === true)); const clear = ({ deep = true, execHook = false } : { deep?: boolean, execHook?: boolean } = { diff --git a/src/models/BaseInterface.ts b/src/models/BaseInterface.ts index 9a5cd34b..7b637636 100644 --- a/src/models/BaseInterface.ts +++ b/src/models/BaseInterface.ts @@ -1,11 +1,11 @@ import { ObservableMap } from "mobx"; -import SharedActionsInterface from "./SharedActionsInterface"; -import SharedEventsInterface from "./SharedEventsInterface"; -import SharedHelpersInterface from "./SharedHelpersInterface"; -import SharedInitializerInterface from "./SharedInitializerInterface"; -import SharedUtilsInferface from "./SharedUtilsInterface"; -import StateInterface from "./StateInterface"; -export default interface BaseInterface +import {SharedActionsInterface} from "./SharedActionsInterface"; +import {SharedEventsInterface} from "./SharedEventsInterface"; +import {SharedHelpersInterface} from "./SharedHelpersInterface"; +import {SharedInitializerInterface} from "./SharedInitializerInterface"; +import {SharedUtilsInferface} from "./SharedUtilsInterface"; +import {StateInterface} from "./StateInterface"; +export interface BaseInterface extends SharedInitializerInterface, SharedActionsInterface, SharedEventsInterface, @@ -40,3 +40,5 @@ export default interface BaseInterface onAdd(args: any): any; onDel(args: any): any; } + +export default BaseInterface; \ No newline at end of file diff --git a/src/models/BindingsInterface.ts b/src/models/BindingsInterface.ts index 45c23971..0824ba65 100644 --- a/src/models/BindingsInterface.ts +++ b/src/models/BindingsInterface.ts @@ -1,9 +1,7 @@ import Bindings from "../Bindings"; -import { FieldPropsEnum } from "./FieldProps"; +import { FieldPropsEnum, FieldPropsType } from "./FieldProps"; -import { FieldPropsType } from "./FieldProps"; - -export default interface BindingsInterface { +export interface BindingsInterface { templates: { [index: string]: { [key: string]: ({ field, props, keys }: any) => any; @@ -23,3 +21,5 @@ export default interface BindingsInterface { register: (bindings: FieldPropsType) => Bindings; } + +export default BindingsInterface; \ No newline at end of file diff --git a/src/models/FieldInterface.ts b/src/models/FieldInterface.ts index 8871fe8d..9143f2f0 100644 --- a/src/models/FieldInterface.ts +++ b/src/models/FieldInterface.ts @@ -1,7 +1,8 @@ -import BaseInterface from "./BaseInterface"; -import OptionsModel from "./OptionsModel"; -import StateInterface from "./StateInterface"; -export default interface FieldInterface extends BaseInterface { +import {BaseInterface} from "./BaseInterface"; +import {OptionsModel} from "./OptionsModel"; +import {StateInterface} from "./StateInterface"; +export interface FieldInterface extends BaseInterface { + incremental: boolean; hasInitialNestedFields: boolean; id: string | undefined; key: string | undefined; @@ -91,3 +92,5 @@ export interface FieldConstructor { update?: boolean; state: StateInterface; } + +export default FieldInterface; \ No newline at end of file diff --git a/src/models/FormInterface.ts b/src/models/FormInterface.ts index 5c44be85..9a8000de 100644 --- a/src/models/FormInterface.ts +++ b/src/models/FormInterface.ts @@ -1,8 +1,8 @@ -import BaseInterface from "./BaseInterface"; -import FieldInterface, { FieldConstructor } from "./FieldInterface"; -import OptionsModel from "./OptionsModel"; -import ValidatorInterface, { ValidationPlugins } from "./ValidatorInterface"; -export default interface FormInterface extends BaseInterface { +import { BaseInterface } from "./BaseInterface"; +import { FieldInterface, FieldConstructor } from "./FieldInterface"; +import { OptionsModel } from "./OptionsModel"; +import { ValidatorInterface, ValidationPlugins } from "./ValidatorInterface"; +export interface FormInterface extends BaseInterface { name: string; validator: ValidatorInterface; debouncedValidation: any; @@ -68,3 +68,5 @@ export interface FormConfig { hooks?: any; handlers?: any; } + +export default FormInterface; \ No newline at end of file diff --git a/src/models/OptionsInterface.ts b/src/models/OptionsInterface.ts index 9bb282b3..96738b52 100644 --- a/src/models/OptionsInterface.ts +++ b/src/models/OptionsInterface.ts @@ -1,7 +1,9 @@ -import OptionsModel from "./OptionsModel"; +import {OptionsModel} from "./OptionsModel"; -export default interface OptionsInterface { +export interface OptionsInterface { options: OptionsModel; get: (key?: string, instance?: any) => any; set: (options: OptionsModel) => void; } + +export default OptionsInterface; \ No newline at end of file diff --git a/src/models/OptionsModel.ts b/src/models/OptionsModel.ts index c203df24..56da674f 100644 --- a/src/models/OptionsModel.ts +++ b/src/models/OptionsModel.ts @@ -45,8 +45,7 @@ export enum OptionsEnum { applyInputConverterOnUpdate = 'applyInputConverterOnUpdate', } - -export default interface OptionsModel { +export interface OptionsModel { [OptionsEnum.uniqueId]?: Function; [OptionsEnum.fallback]?: boolean; [OptionsEnum.fallbackValue]?: any; @@ -94,4 +93,6 @@ export default interface OptionsModel { [OptionsEnum.applyInputConverterOnInit]?: boolean, [OptionsEnum.applyInputConverterOnSet]?: boolean, [OptionsEnum.applyInputConverterOnUpdate]?: boolean, -} \ No newline at end of file +} + +export default OptionsModel; \ No newline at end of file diff --git a/src/models/SharedActionsInterface.ts b/src/models/SharedActionsInterface.ts index 6d4e1263..dabe2135 100644 --- a/src/models/SharedActionsInterface.ts +++ b/src/models/SharedActionsInterface.ts @@ -1,4 +1,4 @@ -export default interface SharedActionsInterface { +export interface SharedActionsInterface { validate(opt?: any, obj?: any): Promise; submit(hooks: any, opt: { execOnSubmitHook: boolean, execValidationHooks: boolean, validate: boolean }): Promise; check(prop: string, deep?: boolean): boolean; @@ -12,3 +12,5 @@ export default interface SharedActionsInterface { add(obj: any): any; del(path?: string): any; } + +export default SharedActionsInterface; \ No newline at end of file diff --git a/src/models/SharedEventsInterface.ts b/src/models/SharedEventsInterface.ts index 8f42ebb0..874b062d 100644 --- a/src/models/SharedEventsInterface.ts +++ b/src/models/SharedEventsInterface.ts @@ -1,6 +1,8 @@ -export default interface SharedEventsInterface { +export interface SharedEventsInterface { MOBXEvent(config: any): void; dispose(config: any): void; disposeAll(): void; disposeSingle(config: any): void; } + +export default SharedEventsInterface; \ No newline at end of file diff --git a/src/models/SharedHelpersInterface.ts b/src/models/SharedHelpersInterface.ts index 6406473f..d2d5bee9 100644 --- a/src/models/SharedHelpersInterface.ts +++ b/src/models/SharedHelpersInterface.ts @@ -1,4 +1,4 @@ -export default interface SharedHelpersInterface { +export interface SharedHelpersInterface { $(key: string|number): any; values(): any; errors(): any; @@ -8,3 +8,5 @@ export default interface SharedHelpersInterface { initials(): any; types(): any; } + +export default SharedHelpersInterface; \ No newline at end of file diff --git a/src/models/SharedInitializerInterface.ts b/src/models/SharedInitializerInterface.ts index 893ca091..3c633d56 100644 --- a/src/models/SharedInitializerInterface.ts +++ b/src/models/SharedInitializerInterface.ts @@ -1,4 +1,6 @@ -export default interface SharedInitializerInterface { +export interface SharedInitializerInterface { initFields(initial: any, update: boolean): void; initField(key: string, path: string, data: any, update: boolean): any; } + +export default SharedInitializerInterface; \ No newline at end of file diff --git a/src/models/SharedUtilsInterface.ts b/src/models/SharedUtilsInterface.ts index 5664a9e6..8da70323 100644 --- a/src/models/SharedUtilsInterface.ts +++ b/src/models/SharedUtilsInterface.ts @@ -1,4 +1,4 @@ -export default interface SharedUtilsInferface { +export interface SharedUtilsInferface { select: (path: string|number, fields?: any, isStrict?: boolean) => any; container: (path?: string) => any; has: (path: string) => boolean; @@ -6,3 +6,5 @@ export default interface SharedUtilsInferface { each: (iteratee: any, fields?: any, depth?: number) => any; reduce: (iteratee: any, acc: any) => any; } + +export default SharedUtilsInferface; \ No newline at end of file diff --git a/src/models/StateInterface.ts b/src/models/StateInterface.ts index 537079e2..8fe1232b 100644 --- a/src/models/StateInterface.ts +++ b/src/models/StateInterface.ts @@ -1,6 +1,6 @@ -import BindingsInterface from "./BindingsInterface"; -import FormInterface from "./FormInterface"; -import OptionsInterface from "./OptionsInterface"; +import {BindingsInterface} from "./BindingsInterface"; +import {FormInterface} from "./FormInterface"; +import {OptionsInterface} from "./OptionsInterface"; export enum RuntimeMode { mixed = "mixed", @@ -8,7 +8,7 @@ export enum RuntimeMode { separated = "separated", } -export default interface StateInterface { +export interface StateInterface { mode: RuntimeMode; strict: boolean; form: FormInterface; @@ -40,3 +40,5 @@ export default interface StateInterface { extra(data?: any): any | null; observeOptions(): void; } + +export default StateInterface; \ No newline at end of file diff --git a/src/models/ValidatorInterface.ts b/src/models/ValidatorInterface.ts index 26a4a79c..1f2f8b63 100644 --- a/src/models/ValidatorInterface.ts +++ b/src/models/ValidatorInterface.ts @@ -1,8 +1,8 @@ -import FieldInterface from "./FieldInterface"; -import FormInterface from "./FormInterface"; -import StateInterface from "./StateInterface"; +import {FieldInterface} from "./FieldInterface"; +import {FormInterface} from "./FormInterface"; +import {StateInterface} from "./StateInterface"; -export default interface ValidatorInterface { +export interface ValidatorInterface { promises: Promise[]; form: FormInterface; drivers: any; @@ -42,4 +42,6 @@ export interface DriversMap { export enum ValidationHooks { onSuccess = 'onSuccess', onError = 'onError', -} \ No newline at end of file +} + +export default ValidatorInterface; \ No newline at end of file diff --git a/src/utils.ts b/src/utils.ts index 3cd47385..281e6950 100755 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,6 +1,6 @@ import _ from "lodash"; import { ObservableMap, values as mobxValues, keys as mobxKeys } from "mobx"; -import FieldInterface from "./models/FieldInterface"; +import { FieldInterface } from "./models/FieldInterface"; import { AllowedFieldPropsTypes, FieldPropsEnum, FieldPropsOccurrence } from "./models/FieldProps"; import { props } from "./props"; @@ -131,12 +131,12 @@ const allowNested = (field: any, strictProps: boolean): boolean => _.isObject(field) && !_.isDate(field) && !_.has(field, FieldPropsEnum.fields) && - (!hasSome(field, [ - ...props.editable, - ...props.handlers, - ...props.validation, - ...props.functions, - ]) || strictProps); + (!hasSome(field, [ + ...props.editable, + ...props.handlers, + ...props.validation, + ...props.functions, + ]) || strictProps); const parseIntKeys = (fields: any) => _.map(getObservableMapKeys(fields), _.ary(_.toNumber, 1)); @@ -146,24 +146,21 @@ const hasIntKeys = (fields: any): boolean => const maxKey = (fields: any): number => { const max = _.max(parseIntKeys(fields)); - // @ts-ignore return _.isUndefined(max) ? 0 : max + 1; }; const uniqueId = (field: any): string => - _.uniqueId( - [_.replace(field.path, new RegExp("\\.", "g"), "-"), "--"].join("") - ); + _.uniqueId([_.replace(field.path, new RegExp("\\.", "g"), "-"), "--"].join("")); -const $isEvent = (obj: any): boolean => { +const isEvent = (obj: any): boolean => { if (_.isNil(obj) || typeof Event === "undefined") return false; - return obj instanceof Event || !_.isNil(obj.target); // eslint-disable-line + return obj instanceof Event || !_.isNil(obj.target); }; -const $hasFiles = ($: any): boolean => +const hasFiles = ($: any): boolean => $.target.files && $.target.files.length !== 0; -const $isBool = ($: any, val: any): boolean => +const isBool = ($: any, val: any): boolean => _.isBoolean(val) && _.isBoolean($.target.checked); const $try = (...args: any) => { @@ -194,9 +191,9 @@ export { hasIntKeys, maxKey, uniqueId, - $isEvent, - $hasFiles, - $isBool, + isEvent, + hasFiles, + isBool, $try, getObservableMapKeys, getObservableMapValues, diff --git a/tests/data/forms/fixes/form.376.ts b/tests/data/forms/fixes/form.376.ts index c700157b..58acf279 100644 --- a/tests/data/forms/fixes/form.376.ts +++ b/tests/data/forms/fixes/form.376.ts @@ -1,7 +1,7 @@ import { expect } from "chai"; import validatorjs from "validatorjs"; import { Form } from "../../../../src"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; import { ValidationPlugins } from "../../../../src/models/ValidatorInterface"; import dvr from "../../../../src/validators/DVR"; diff --git a/tests/data/forms/fixes/form.454.ts b/tests/data/forms/fixes/form.454.ts index 7a394680..0e473ec7 100644 --- a/tests/data/forms/fixes/form.454.ts +++ b/tests/data/forms/fixes/form.454.ts @@ -1,6 +1,6 @@ import { expect } from "chai"; import { Form } from "../../../../src"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; const fields = [ 'any.type', diff --git a/tests/data/forms/fixes/form.518.ts b/tests/data/forms/fixes/form.518.ts index 5cc9b657..088ef8f8 100644 --- a/tests/data/forms/fixes/form.518.ts +++ b/tests/data/forms/fixes/form.518.ts @@ -1,7 +1,7 @@ import { expect } from "chai"; import validatorjs from "validatorjs"; import { Form } from "../../../../src"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; import { ValidationPlugins } from "../../../../src/models/ValidatorInterface"; import dvr from "../../../../src/validators/DVR"; diff --git a/tests/data/forms/fixes/form.519.ts b/tests/data/forms/fixes/form.519.ts index 47698490..436c3123 100644 --- a/tests/data/forms/fixes/form.519.ts +++ b/tests/data/forms/fixes/form.519.ts @@ -1,7 +1,7 @@ import { expect } from "chai"; import validatorjs from "validatorjs"; import { Form } from "../../../../src"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; import { ValidationPlugins } from "../../../../src/models/ValidatorInterface"; import vjf from "../../../../src/validators/VJF"; import dvr from "../../../../src/validators/DVR"; diff --git a/tests/data/forms/fixes/form.531.ts b/tests/data/forms/fixes/form.531.ts index bdfba978..a9c2de4f 100644 --- a/tests/data/forms/fixes/form.531.ts +++ b/tests/data/forms/fixes/form.531.ts @@ -1,6 +1,6 @@ import { expect } from "chai"; import { Form } from "../../../../src"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; const fields = [ 'name', diff --git a/tests/data/forms/fixes/form.544.ts b/tests/data/forms/fixes/form.544.ts index a61132f6..3df1cd4f 100644 --- a/tests/data/forms/fixes/form.544.ts +++ b/tests/data/forms/fixes/form.544.ts @@ -1,6 +1,6 @@ import { expect } from "chai"; import { Form } from "../../../../src"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; const fields = { diff --git a/tests/data/forms/fixes/form.585.ts b/tests/data/forms/fixes/form.585.ts index 2c87f800..e2a113fd 100644 --- a/tests/data/forms/fixes/form.585.ts +++ b/tests/data/forms/fixes/form.585.ts @@ -1,7 +1,7 @@ import { expect } from "chai"; import validatorjs from "validatorjs"; import { Form } from "../../../../src"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; import { ValidationPlugins } from "../../../../src/models/ValidatorInterface"; import dvr from "../../../../src/validators/DVR"; diff --git a/tests/data/forms/fixes/form.613.ts b/tests/data/forms/fixes/form.613.ts index 7b19c7f6..69c1b716 100644 --- a/tests/data/forms/fixes/form.613.ts +++ b/tests/data/forms/fixes/form.613.ts @@ -1,7 +1,7 @@ import validatorjs from "validatorjs"; import { expect } from "chai"; import { Form } from "../../../../src"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; import { ValidationPlugins } from "../../../../src/models/ValidatorInterface"; import DVR from "../../../../src/validators/DVR"; diff --git a/tests/data/forms/fixes/form.d_.ts b/tests/data/forms/fixes/form.d_.ts index 87be2ece..963a14d1 100755 --- a/tests/data/forms/fixes/form.d_.ts +++ b/tests/data/forms/fixes/form.d_.ts @@ -1,5 +1,5 @@ import { Form } from "../../../../src"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; const fields = [ "itineraryItem", diff --git a/tests/data/forms/fixes/form.e.ts b/tests/data/forms/fixes/form.e.ts index 5ccbbd5e..e0efeeef 100755 --- a/tests/data/forms/fixes/form.e.ts +++ b/tests/data/forms/fixes/form.e.ts @@ -1,6 +1,6 @@ import { expect } from "chai"; import { Form } from "../../../../src"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; const fields = [ "places[]", diff --git a/tests/data/forms/fixes/form.f.ts b/tests/data/forms/fixes/form.f.ts index 947fee03..813015cd 100755 --- a/tests/data/forms/fixes/form.f.ts +++ b/tests/data/forms/fixes/form.f.ts @@ -1,5 +1,5 @@ import { Form } from "../../../../src"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; const fields = [ "ids[]", diff --git a/tests/data/forms/fixes/form.g.ts b/tests/data/forms/fixes/form.g.ts index 3514c679..dbadb2b7 100755 --- a/tests/data/forms/fixes/form.g.ts +++ b/tests/data/forms/fixes/form.g.ts @@ -1,5 +1,5 @@ import { Form } from "../../../../src"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; const fields = ["items[].name"]; diff --git a/tests/data/forms/fixes/form.h.ts b/tests/data/forms/fixes/form.h.ts index 3b8f9449..eefe3cc6 100755 --- a/tests/data/forms/fixes/form.h.ts +++ b/tests/data/forms/fixes/form.h.ts @@ -1,5 +1,5 @@ import { Form } from "../../../../src"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; import { shouldBeEqualTo } from "../../extension/vjf"; const fields = [ diff --git a/tests/data/forms/fixes/form.i.ts b/tests/data/forms/fixes/form.i.ts index ee703883..daeeeea9 100755 --- a/tests/data/forms/fixes/form.i.ts +++ b/tests/data/forms/fixes/form.i.ts @@ -1,7 +1,7 @@ import validatorjs from "validatorjs"; import dvr from "../../../../src/validators/DVR"; import { Form } from "../../../../src"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; const fields = [ "deep", diff --git a/tests/data/forms/fixes/form.l.ts b/tests/data/forms/fixes/form.l.ts index c5d04781..585f3626 100755 --- a/tests/data/forms/fixes/form.l.ts +++ b/tests/data/forms/fixes/form.l.ts @@ -5,7 +5,7 @@ import { Form } from "../../../../src"; import dvr from "../../../../src/validators/DVR"; import vjf from "../../../../src/validators/VJF"; import { ValidationPlugins } from "../../../../src/models/ValidatorInterface"; -import OptionsModel from "../../../../src/models/OptionsModel"; +import { OptionsModel } from "../../../../src/models/OptionsModel"; const fields = ["email"]; diff --git a/tests/data/forms/fixes/form.m.ts b/tests/data/forms/fixes/form.m.ts index 8f1e3150..f8ee7ea8 100755 --- a/tests/data/forms/fixes/form.m.ts +++ b/tests/data/forms/fixes/form.m.ts @@ -1,6 +1,6 @@ import validatorjs from "validatorjs"; import { Form } from "../../../../src"; -import OptionsModel from "../../../../src/models/OptionsModel"; +import { OptionsModel } from "../../../../src/models/OptionsModel"; import { ValidationPlugins } from "../../../../src/models/ValidatorInterface"; import dvr from "../../../../src/validators/DVR"; diff --git a/tests/data/forms/fixes/form.t.ts b/tests/data/forms/fixes/form.t.ts index 6b2bc393..eb4b70f3 100755 --- a/tests/data/forms/fixes/form.t.ts +++ b/tests/data/forms/fixes/form.t.ts @@ -1,6 +1,6 @@ import { expect } from "chai"; import { Form } from "../../../../src"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; import formN from "./form.n"; // FIXES #436 #417 #450 diff --git a/tests/data/forms/fixes/form.u.ts b/tests/data/forms/fixes/form.u.ts index 2cc00a24..01597a21 100755 --- a/tests/data/forms/fixes/form.u.ts +++ b/tests/data/forms/fixes/form.u.ts @@ -1,6 +1,6 @@ import validatorjs from "validatorjs"; import { Form } from "../../../../src"; -import OptionsModel from "../../../../src/models/OptionsModel"; +import { OptionsModel } from "../../../../src/models/OptionsModel"; import dvr from "../../../../src/validators/DVR"; const fields = ["from", "to"]; diff --git a/tests/data/forms/fixes/form.v.ts b/tests/data/forms/fixes/form.v.ts index 1886240b..bf4a8112 100644 --- a/tests/data/forms/fixes/form.v.ts +++ b/tests/data/forms/fixes/form.v.ts @@ -1,6 +1,6 @@ import { Form } from "../../../../src"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; const generateNewPiece = () => ({ length: 10, diff --git a/tests/data/forms/fixes/form.z.ts b/tests/data/forms/fixes/form.z.ts index 7c0d0f66..56879357 100644 --- a/tests/data/forms/fixes/form.z.ts +++ b/tests/data/forms/fixes/form.z.ts @@ -1,6 +1,6 @@ import { Form } from "../../../../src"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; import { expect } from "chai"; const values = { pieces: [{ id: "2", blocks: [{ id: "1" }] }] }; diff --git a/tests/data/forms/flat/form.c.ts b/tests/data/forms/flat/form.c.ts index f1194bc4..5f6687ae 100755 --- a/tests/data/forms/flat/form.c.ts +++ b/tests/data/forms/flat/form.c.ts @@ -2,7 +2,7 @@ import ajv from "ajv"; import { Form } from "../../../../src"; import svkExtend from "../../extension/svk"; import svk from "../../../../src/validators/SVK"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; const fields = { username: { diff --git a/tests/data/forms/flat/form.d_.ts b/tests/data/forms/flat/form.d_.ts index ed728f7f..196e54fa 100755 --- a/tests/data/forms/flat/form.d_.ts +++ b/tests/data/forms/flat/form.d_.ts @@ -3,8 +3,8 @@ import ajv from "ajv"; import { Form } from "../../../../src"; import svkExtend from "../../extension/svk"; import svk from "../../../../src/validators/SVK"; -import FormInterface from "../../../../src/models/FormInterface"; -import OptionsModel from "../../../../src/models/OptionsModel"; +import { FormInterface } from "../../../../src/models/FormInterface"; +import { OptionsModel } from "../../../../src/models/OptionsModel"; const fields = { username: "SteveJobs", diff --git a/tests/data/forms/flat/form.i.ts b/tests/data/forms/flat/form.i.ts index 204bb517..6672adc9 100755 --- a/tests/data/forms/flat/form.i.ts +++ b/tests/data/forms/flat/form.i.ts @@ -1,8 +1,8 @@ import ajv from "ajv"; import { Form } from "../../../../src"; import svk from "../../../../src/validators/SVK"; -import FormInterface from "../../../../src/models/FormInterface"; -import OptionsModel from "../../../../src/models/OptionsModel"; +import { FormInterface } from "../../../../src/models/FormInterface"; +import { OptionsModel } from "../../../../src/models/OptionsModel"; const fields = { username: { diff --git a/tests/data/forms/flat/form.l.ts b/tests/data/forms/flat/form.l.ts index 6ef4bae3..37e6b3d7 100755 --- a/tests/data/forms/flat/form.l.ts +++ b/tests/data/forms/flat/form.l.ts @@ -2,7 +2,7 @@ import ajv from "ajv"; import { Form } from "../../../../src"; import svkExtend from "../../extension/svk"; import svk from "../../../../src/validators/SVK"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; const fields = { username: { diff --git a/tests/data/forms/flat/form.m.ts b/tests/data/forms/flat/form.m.ts index f4e84447..64df822d 100755 --- a/tests/data/forms/flat/form.m.ts +++ b/tests/data/forms/flat/form.m.ts @@ -6,8 +6,8 @@ import dvrExtend from "../../extension/dvr"; import dvr from "../../../../src/validators/DVR"; import svk from "../../../../src/validators/SVK"; -import FormInterface from "../../../../src/models/FormInterface"; -import OptionsModel from "../../../../src/models/OptionsModel"; +import { FormInterface } from "../../../../src/models/FormInterface"; +import { OptionsModel } from "../../../../src/models/OptionsModel"; const fields = { username: { diff --git a/tests/data/forms/flat/form.n.ts b/tests/data/forms/flat/form.n.ts index 9201a51a..bf85f8c2 100755 --- a/tests/data/forms/flat/form.n.ts +++ b/tests/data/forms/flat/form.n.ts @@ -4,8 +4,8 @@ import { checkUser } from "../../extension/vjf"; import svk from "../../../../src/validators/SVK"; import vjf from "../../../../src/validators/VJF"; -import FormInterface from "../../../../src/models/FormInterface"; -import OptionsModel from "../../../../src/models/OptionsModel"; +import { FormInterface } from "../../../../src/models/FormInterface"; +import { OptionsModel } from "../../../../src/models/OptionsModel"; const fields = { username: { diff --git a/tests/data/forms/flat/form.o.ts b/tests/data/forms/flat/form.o.ts index d49624ce..43399a10 100755 --- a/tests/data/forms/flat/form.o.ts +++ b/tests/data/forms/flat/form.o.ts @@ -1,6 +1,6 @@ import { Form } from "../../../../src"; -import FormInterface from "../../../../src/models/FormInterface"; -import OptionsModel from "../../../../src/models/OptionsModel"; +import { FormInterface } from "../../../../src/models/FormInterface"; +import { OptionsModel } from "../../../../src/models/OptionsModel"; const values = { username: "SteveJobs", diff --git a/tests/data/forms/flat/form.p.ts b/tests/data/forms/flat/form.p.ts index 150e1389..fe08d84f 100755 --- a/tests/data/forms/flat/form.p.ts +++ b/tests/data/forms/flat/form.p.ts @@ -6,8 +6,8 @@ import { shouldBeEqualTo } from "../../extension/vjf"; import dvr from "../../../../src/validators/DVR"; import vjf from "../../../../src/validators/VJF"; -import FormInterface from "../../../../src/models/FormInterface"; -import OptionsModel from "../../../../src/models/OptionsModel"; +import { FormInterface } from "../../../../src/models/FormInterface"; +import { OptionsModel } from "../../../../src/models/OptionsModel"; const fields = ["username", "email", "password", "passwordConfirm", "terms"]; diff --git a/tests/data/forms/flat/form.r.ts b/tests/data/forms/flat/form.r.ts index 948f9f79..0e194229 100755 --- a/tests/data/forms/flat/form.r.ts +++ b/tests/data/forms/flat/form.r.ts @@ -3,8 +3,8 @@ import { FieldConstructor } from "./../../../../src/models/FieldInterface"; import MobxReactForm, { Field } from "../../../../src"; import { isEmail, shouldBeEqualTo } from "../../extension/vjf"; import vjf from "../../../../src/validators/VJF"; -import FormInterface from "../../../../src/models/FormInterface"; -import OptionsModel from "../../../../src/models/OptionsModel"; +import { FormInterface } from "../../../../src/models/FormInterface"; +import { OptionsModel } from "../../../../src/models/OptionsModel"; const fields = { email: { diff --git a/tests/data/forms/flat/form.s.ts b/tests/data/forms/flat/form.s.ts index 069038cb..a35615c1 100755 --- a/tests/data/forms/flat/form.s.ts +++ b/tests/data/forms/flat/form.s.ts @@ -2,7 +2,7 @@ import { ValidationPlugins } from "./../../../../src/models/ValidatorInterface"; import validatorjs from "validatorjs"; import MobxReactForm from "../../../../src"; import dvr from "../../../../src/validators/DVR"; -import OptionsModel from "../../../../src/models/OptionsModel"; +import { OptionsModel } from "../../../../src/models/OptionsModel"; const fields = { email: { diff --git a/tests/data/forms/methods/form.set.ts b/tests/data/forms/methods/form.set.ts index 0ede60cb..efff6849 100644 --- a/tests/data/forms/methods/form.set.ts +++ b/tests/data/forms/methods/form.set.ts @@ -1,6 +1,6 @@ import { Form } from "../../../../src"; import { FieldPropsEnum } from "../../../../src/models/FieldProps"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; const fields = [ diff --git a/tests/data/forms/nested/form.a.ts b/tests/data/forms/nested/form.a.ts index 21d9ee73..84b831f1 100755 --- a/tests/data/forms/nested/form.a.ts +++ b/tests/data/forms/nested/form.a.ts @@ -2,8 +2,8 @@ import { ValidationPlugins } from "./../../../../src/models/ValidatorInterface"; import { Form } from "../../../../src"; import { isEmail, shouldBeEqualTo } from "../../extension/vjf"; import vjf from "../../../../src/validators/VJF"; -import OptionsModel from "../../../../src/models/OptionsModel"; -import FormInterface from "../../../../src/models/FormInterface"; +import { OptionsModel } from "../../../../src/models/OptionsModel"; +import { FormInterface } from "../../../../src/models/FormInterface"; const fields = [ { diff --git a/tests/data/forms/nested/form.b.ts b/tests/data/forms/nested/form.b.ts index 81683c00..44a4ef4e 100755 --- a/tests/data/forms/nested/form.b.ts +++ b/tests/data/forms/nested/form.b.ts @@ -1,5 +1,5 @@ import { Form } from "../../../../src"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; const fields = [ { diff --git a/tests/data/forms/nested/form.c.ts b/tests/data/forms/nested/form.c.ts index e30bb45c..c855ed91 100755 --- a/tests/data/forms/nested/form.c.ts +++ b/tests/data/forms/nested/form.c.ts @@ -1,5 +1,5 @@ import { Form } from "../../../../src"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; const fields = { state: { diff --git a/tests/data/forms/nested/form.d_.ts b/tests/data/forms/nested/form.d_.ts index 4f83ce55..18ddea53 100755 --- a/tests/data/forms/nested/form.d_.ts +++ b/tests/data/forms/nested/form.d_.ts @@ -1,5 +1,5 @@ import { Form } from "../../../../src"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; const fields = { state: { diff --git a/tests/data/forms/nested/form.m1.ts b/tests/data/forms/nested/form.m1.ts index 7b882f96..2e37ad5e 100755 --- a/tests/data/forms/nested/form.m1.ts +++ b/tests/data/forms/nested/form.m1.ts @@ -2,7 +2,7 @@ import { ValidationPlugins } from "./../../../../src/models/ValidatorInterface"; import * as yup from "yup"; import { Form } from "../../../../src"; import $yup from "../../../../src/validators/YUP"; -import OptionsModel from "../../../../src/models/OptionsModel"; +import { OptionsModel } from "../../../../src/models/OptionsModel"; const fields = { club: null, diff --git a/tests/data/forms/nested/form.o.ts b/tests/data/forms/nested/form.o.ts index 8386aef6..16cea2b4 100755 --- a/tests/data/forms/nested/form.o.ts +++ b/tests/data/forms/nested/form.o.ts @@ -1,5 +1,5 @@ import { Form } from "../../../../src"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; const fields = [ "club.name", diff --git a/tests/data/forms/nested/form.p.ts b/tests/data/forms/nested/form.p.ts index af0eae89..9651c238 100755 --- a/tests/data/forms/nested/form.p.ts +++ b/tests/data/forms/nested/form.p.ts @@ -1,5 +1,5 @@ import { Form } from "../../../../src"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; const fields = [ "club.name", diff --git a/tests/data/forms/nested/form.q.ts b/tests/data/forms/nested/form.q.ts index a12005f8..48a83160 100755 --- a/tests/data/forms/nested/form.q.ts +++ b/tests/data/forms/nested/form.q.ts @@ -1,5 +1,5 @@ import { Form } from "../../../../src"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; const fields = [ "club.name", diff --git a/tests/data/forms/nested/form.s.ts b/tests/data/forms/nested/form.s.ts index 0d57debe..8457001c 100755 --- a/tests/data/forms/nested/form.s.ts +++ b/tests/data/forms/nested/form.s.ts @@ -3,7 +3,7 @@ import { expect } from "chai"; import validatorjs from "validatorjs"; import { Form } from "../../../../src"; import dvr from "../../../../src/validators/DVR"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; const fields = [ "club.name", diff --git a/tests/data/forms/nested/form.t1.ts b/tests/data/forms/nested/form.t1.ts index 6614cb0b..a461e452 100755 --- a/tests/data/forms/nested/form.t1.ts +++ b/tests/data/forms/nested/form.t1.ts @@ -1,5 +1,5 @@ import { Form } from "../../../../src"; -import OptionsModel from "../../../../src/models/OptionsModel"; +import { OptionsModel } from "../../../../src/models/OptionsModel"; const fields = ["hobbies[]"]; diff --git a/tests/data/forms/nested/form.u.ts b/tests/data/forms/nested/form.u.ts index 6ebe2963..005a0882 100755 --- a/tests/data/forms/nested/form.u.ts +++ b/tests/data/forms/nested/form.u.ts @@ -3,7 +3,7 @@ import { Form } from "../../../../src"; import { isEmail, shouldBeEqualTo } from "../../extension/vjf"; import vjf from "../../../../src/validators/VJF"; import { ValidationPlugins } from "../../../../src/models/ValidatorInterface"; -import OptionsModel from "../../../../src/models/OptionsModel"; +import { OptionsModel } from "../../../../src/models/OptionsModel"; const fields = [ "user", diff --git a/tests/data/forms/nested/form.v.ts b/tests/data/forms/nested/form.v.ts index a378b1c5..3dd3817c 100644 --- a/tests/data/forms/nested/form.v.ts +++ b/tests/data/forms/nested/form.v.ts @@ -1,5 +1,5 @@ import { Form } from "../../../../src"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; const fields = [ 'user.id', diff --git a/tests/data/forms/nested/form.v2.ts b/tests/data/forms/nested/form.v2.ts index 7054eb30..c2919018 100644 --- a/tests/data/forms/nested/form.v2.ts +++ b/tests/data/forms/nested/form.v2.ts @@ -1,5 +1,5 @@ import { Form } from "../../../../src"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; const fields = [ 'user.id', diff --git a/tests/data/forms/nested/form.v3.ts b/tests/data/forms/nested/form.v3.ts index 7a3aaa88..a90469b7 100644 --- a/tests/data/forms/nested/form.v3.ts +++ b/tests/data/forms/nested/form.v3.ts @@ -1,6 +1,6 @@ import { Form } from "../../../../src"; -import FieldInterface from "../../../../src/models/FieldInterface"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FieldInterface } from "../../../../src/models/FieldInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; const fields = [ 'account[].id', diff --git a/tests/data/forms/nested/form.v4.ts b/tests/data/forms/nested/form.v4.ts index fb841089..665b739d 100644 --- a/tests/data/forms/nested/form.v4.ts +++ b/tests/data/forms/nested/form.v4.ts @@ -1,6 +1,6 @@ import { Form } from "../../../../src"; -import FieldInterface from "../../../../src/models/FieldInterface"; -import FormInterface from "../../../../src/models/FormInterface"; +import { FieldInterface } from "../../../../src/models/FieldInterface"; +import { FormInterface } from "../../../../src/models/FormInterface"; const fields = { user: {