Skip to content

Commit

Permalink
fix: #468 #453
Browse files Browse the repository at this point in the history
  • Loading branch information
foxhound87 committed Jan 10, 2019
1 parent 72e69ed commit fdba4ed
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 14 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,19 @@
"eslint-plugin-import": "2.8.0",
"husky": "0.13.1",
"json-loader": "0.5.4",
"mobx5": "npm:mobx@^5.0.0",
"mobx4": "npm:mobx@^4.0.0",
"mobx3": "npm:mobx@^3.0.0",
"mobx4": "npm:mobx@^4.0.0",
"mobx5": "npm:mobx@^5.0.0",
"mocha": "3.2.0",
"npm-run-all": "4.0.1",
"nyc": "^10.2.0",
"opencollective": "^1.0.3",
"replace": "^0.3.0",
"rimraf": "2.5.4",
"semantic-release": "^15.8.1",
"validator": "^8.0.0",
"validatorjs": "^3.13.3",
"webpack": "3",
"opencollective": "^1.0.3"
"webpack": "3"
},
"collective": {
"type": "opencollective",
Expand Down
3 changes: 2 additions & 1 deletion src/Base.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export default class Base {

execHandler = (name, args, fallback = null) => [$try(
this.$handlers[name] && this.$handlers[name].apply(this, [this]),
this.handlers && this.handlers.apply(this, [this])[name] && this.handlers.apply(this, [this])[name].apply(this, [this]),
this.handlers && this.handlers.apply(this, [this])[name] &&
this.handlers.apply(this, [this])[name].apply(this, [this]),
fallback,
this.noop,
).apply(this, [...args]), this.execHook(name)];
Expand Down
4 changes: 3 additions & 1 deletion src/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ export default class Form extends Base {

@computed get validatedValues() {
const data = {};
this.each($field => (data[$field.path] = $field.validatedValue));
this.each($field => // eslint-disable-line
(data[$field.path] = $field.validatedValue));

return data;
}

Expand Down
2 changes: 1 addition & 1 deletion src/validators/DVR.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default class DVR {

validateField(field, form) {
// get form fields data
const data = form.validatedValues
const data = form.validatedValues;
this.validateFieldAsync(field, form, data);
this.validateFieldSync(field, form, data);
}
Expand Down
11 changes: 5 additions & 6 deletions tests/data/forms/nested/form.z.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,17 @@ const fields = [
];

const values = {
data: Array.from(Array(300).keys()).map(idx => {
return {
data: Array.from(Array(300).keys())
.map(() => ({
f1: Math.random(),
f2: Math.random(),
f3: Math.random(),
f4: Math.random(),
f5: Math.random(),
f6: Math.random(),
f7: Math.random()
};
})
}
f7: Math.random(),
})),
};

const plugins = { dvr: validatorjs };

Expand Down
96 changes: 95 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,15 @@ babel-plugin-transform-strict-mode@^6.22.0:
babel-runtime "^6.22.0"
babel-types "^6.22.0"

[email protected]:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.23.0.tgz#8364ca62df8eafb830499f699177466c3b03499d"
integrity sha1-g2TKYt+Or7gwSZ9pkXdGbDsDSZ0=
dependencies:
babel-runtime "^6.22.0"
core-js "^2.4.0"
regenerator-runtime "^0.10.0"

babel-polyfill@^6.26.0:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153"
Expand Down Expand Up @@ -2233,6 +2242,13 @@ emojis-list@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389"

encoding@^0.1.11:
version "0.1.12"
resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb"
integrity sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=
dependencies:
iconv-lite "~0.4.13"

enhanced-resolve@^3.4.0:
version "3.4.1"
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-3.4.1.tgz#0421e339fd71419b3da13d129b3979040230476e"
Expand Down Expand Up @@ -2607,6 +2623,15 @@ external-editor@^1.1.0:
spawn-sync "^1.0.15"
tmp "^0.0.29"

external-editor@^2.0.1:
version "2.2.0"
resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.2.0.tgz#045511cfd8d133f3846673d1047c154e214ad3d5"
integrity sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==
dependencies:
chardet "^0.4.0"
iconv-lite "^0.4.17"
tmp "^0.0.33"

external-editor@^2.0.4:
version "2.1.0"
resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.1.0.tgz#3d026a21b7f95b5726387d4200ac160d372c3b48"
Expand Down Expand Up @@ -3311,6 +3336,13 @@ iconv-lite@^0.4.17:
version "0.4.19"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b"

iconv-lite@~0.4.13:
version "0.4.24"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==
dependencies:
safer-buffer ">= 2.1.2 < 3"

ieee754@^1.1.4:
version "1.1.8"
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4"
Expand Down Expand Up @@ -3379,6 +3411,25 @@ [email protected]:
strip-ansi "^3.0.0"
through "^2.3.6"

[email protected]:
version "3.0.6"
resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.0.6.tgz#e04aaa9d05b7a3cb9b0f407d04375f0447190347"
integrity sha1-4EqqnQW3o8ubD0B9BDdfBEcZA0c=
dependencies:
ansi-escapes "^1.1.0"
chalk "^1.0.0"
cli-cursor "^2.1.0"
cli-width "^2.0.0"
external-editor "^2.0.1"
figures "^2.0.0"
lodash "^4.3.0"
mute-stream "0.0.7"
run-async "^2.2.0"
rx "^4.1.0"
string-width "^2.0.0"
strip-ansi "^3.0.0"
through "^2.3.6"

inquirer@^3.0.6:
version "3.3.0"
resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9"
Expand Down Expand Up @@ -3662,7 +3713,7 @@ is-ssh@^1.3.0:
dependencies:
protocols "^1.1.0"

is-stream@^1.1.0:
is-stream@^1.0.1, is-stream@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"

Expand Down Expand Up @@ -4337,6 +4388,11 @@ [email protected], "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkd
version "5.0.3"
resolved "https://registry.yarnpkg.com/mobx/-/mobx-5.0.3.tgz#53b97f2a0f9b0dd7774c96249f81bf2d513d8e1c"

[email protected]:
version "5.0.0"
resolved "https://registry.yarnpkg.com/mobx/-/mobx-5.0.0.tgz#1214db984899b937581a5e802c65cec214eb6dd1"
integrity sha512-stLRfRPsXpHeRDgfhW5QvyIz7PXU2ti60l5Pe+hl2XGxtQdCxV3b90w5eU2nUP6tha9+kozihQclpMWqh+kzSw==

[email protected]:
version "3.2.0"
resolved "https://registry.yarnpkg.com/mocha/-/mocha-3.2.0.tgz#7dc4f45e5088075171a68896814e6ae9eb7a85e3"
Expand Down Expand Up @@ -4424,6 +4480,14 @@ node-emoji@^1.4.1:
dependencies:
lodash.toarray "^4.4.0"

[email protected]:
version "1.6.3"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.6.3.tgz#dc234edd6489982d58e8f0db4f695029abcd8c04"
integrity sha1-3CNO3WSJmC1Y6PDbT2lQKavNjAQ=
dependencies:
encoding "^0.1.11"
is-stream "^1.0.1"

node-fetch@^2.1.1:
version "2.2.0"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.2.0.tgz#4ee79bde909262f9775f731e3656d0db55ced5b5"
Expand Down Expand Up @@ -4666,6 +4730,26 @@ onetime@^2.0.0:
dependencies:
mimic-fn "^1.0.0"

opencollective@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/opencollective/-/opencollective-1.0.3.tgz#aee6372bc28144583690c3ca8daecfc120dd0ef1"
integrity sha1-ruY3K8KBRFg2kMPKja7PwSDdDvE=
dependencies:
babel-polyfill "6.23.0"
chalk "1.1.3"
inquirer "3.0.6"
minimist "1.2.0"
node-fetch "1.6.3"
opn "4.0.2"

[email protected]:
version "4.0.2"
resolved "https://registry.yarnpkg.com/opn/-/opn-4.0.2.tgz#7abc22e644dff63b0a96d5ab7f2790c0f01abc95"
integrity sha1-erwi5kTf9jsKltWrfyeQwPAavJU=
dependencies:
object-assign "^4.0.1"
pinkie-promise "^2.0.0"

optimist@^0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686"
Expand Down Expand Up @@ -5515,6 +5599,11 @@ safe-regex@^1.1.0:
dependencies:
ret "~0.1.10"

"safer-buffer@>= 2.1.2 < 3":
version "2.1.2"
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==

semantic-release@^15.8.1:
version "15.8.1"
resolved "https://registry.yarnpkg.com/semantic-release/-/semantic-release-15.8.1.tgz#b10a919180cce79e756048e7e713a36d6c42a7e7"
Expand Down Expand Up @@ -6190,6 +6279,11 @@ uid-number@^0.0.6, uid-number@~0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81"

undefined@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/undefined/-/undefined-0.1.0.tgz#9b706a4b32ad30c20ca4fe65ddcbbbdac32bded0"
integrity sha1-m3BqSzKtMMIMpP5l3cu72sMr3tA=

underscore@~1.4.4:
version "1.4.4"
resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.4.4.tgz#61a6a32010622afa07963bf325203cf12239d604"
Expand Down

0 comments on commit fdba4ed

Please sign in to comment.