antd-mini
Advanced tools
Comparing version 2.35.2 to 2.35.3
@@ -64,2 +64,4 @@ var __extends = (this && this.__extends) || (function () { | ||
import AsyncValidator from 'async-validator'; | ||
import set from 'lodash-es/set'; | ||
import get from 'lodash-es/get'; | ||
import { getValueFromProps } from '../_util/simply'; | ||
@@ -98,3 +100,3 @@ var EventEmitter = /** @class */ (function () { | ||
_this.formRules = rules; | ||
_this.create(name, initialValues[name], rules[name], validateMessages, required, label, message, validateTrigger); | ||
_this.create(name, get(initialValues, name), rules[name], validateMessages, required, label, message, validateTrigger); | ||
_this.ref.on(function (trigger, value, extraInfo) { | ||
@@ -116,3 +118,3 @@ if (trigger === 'onChange') { | ||
value.validateTrigger !== props.validateTrigger) { | ||
_this.create(value.name, initialValues[value.name], _this.formRules[value.name], validateMessages, value.required, value.message, value.label, value.validateTrigger, true); | ||
_this.create(value.name, get(initialValues, value.name), _this.formRules[value.name], validateMessages, value.required, value.message, value.label, value.validateTrigger, true); | ||
} | ||
@@ -504,6 +506,3 @@ if (value.name !== props.name) { | ||
_this.changeListeners.forEach(function (item) { | ||
var _a; | ||
return item((_a = {}, | ||
_a[name] = value, | ||
_a), _this.getFieldsValue()); | ||
return item(set({}, name, value), _this.getFieldsValue()); | ||
}); | ||
@@ -553,4 +552,4 @@ } | ||
var _this = this; | ||
Object.keys(values).forEach(function (name) { | ||
_this.setFieldValue(name, values[name]); | ||
Object.keys(this.fields).forEach(function (name) { | ||
_this.setFieldValue(name, get(values, name)); | ||
}); | ||
@@ -593,3 +592,3 @@ }; | ||
nameList.forEach(function (name) { | ||
fieldsValue[name] = _this.getFieldValue(name); | ||
set(fieldsValue, name, _this.getFieldValue(name)); | ||
}); | ||
@@ -667,4 +666,4 @@ return fieldsValue; | ||
this.changeListeners.push(function (changedValues, allValues) { | ||
if (name in changedValues) { | ||
callback(changedValues[name], allValues); | ||
if (get(changedValues, name)) { | ||
callback(get(changedValues, name), allValues); | ||
} | ||
@@ -723,3 +722,3 @@ }); | ||
} | ||
values[name] = value; | ||
set(values, name, value); | ||
}); | ||
@@ -743,3 +742,3 @@ if (errorFields.length > 0) { | ||
this.eachField(function (field, name) { | ||
var initialValue = _this.initialValues[name]; | ||
var initialValue = get(_this.initialValues, name); | ||
field.reset(initialValue); | ||
@@ -746,0 +745,0 @@ }); |
import { __assign, __awaiter, __extends, __generator } from "tslib"; | ||
import AsyncValidator from 'async-validator'; | ||
import set from 'lodash-es/set'; | ||
import get from 'lodash-es/get'; | ||
import { getValueFromProps } from '../_util/simply'; | ||
@@ -36,3 +38,3 @@ var EventEmitter = /** @class */ (function () { | ||
_this.formRules = rules; | ||
_this.create(name, initialValues[name], rules[name], validateMessages, required, label, message, validateTrigger); | ||
_this.create(name, get(initialValues, name), rules[name], validateMessages, required, label, message, validateTrigger); | ||
_this.ref.on(function (trigger, value, extraInfo) { | ||
@@ -54,3 +56,3 @@ if (trigger === 'onChange') { | ||
value.validateTrigger !== props.validateTrigger) { | ||
_this.create(value.name, initialValues[value.name], _this.formRules[value.name], validateMessages, value.required, value.message, value.label, value.validateTrigger, true); | ||
_this.create(value.name, get(initialValues, value.name), _this.formRules[value.name], validateMessages, value.required, value.message, value.label, value.validateTrigger, true); | ||
} | ||
@@ -442,6 +444,3 @@ if (value.name !== props.name) { | ||
_this.changeListeners.forEach(function (item) { | ||
var _a; | ||
return item((_a = {}, | ||
_a[name] = value, | ||
_a), _this.getFieldsValue()); | ||
return item(set({}, name, value), _this.getFieldsValue()); | ||
}); | ||
@@ -491,4 +490,4 @@ } | ||
var _this = this; | ||
Object.keys(values).forEach(function (name) { | ||
_this.setFieldValue(name, values[name]); | ||
Object.keys(this.fields).forEach(function (name) { | ||
_this.setFieldValue(name, get(values, name)); | ||
}); | ||
@@ -531,3 +530,3 @@ }; | ||
nameList.forEach(function (name) { | ||
fieldsValue[name] = _this.getFieldValue(name); | ||
set(fieldsValue, name, _this.getFieldValue(name)); | ||
}); | ||
@@ -605,4 +604,4 @@ return fieldsValue; | ||
this.changeListeners.push(function (changedValues, allValues) { | ||
if (name in changedValues) { | ||
callback(changedValues[name], allValues); | ||
if (get(changedValues, name)) { | ||
callback(get(changedValues, name), allValues); | ||
} | ||
@@ -661,3 +660,3 @@ }); | ||
} | ||
values[name] = value; | ||
set(values, name, value); | ||
}); | ||
@@ -681,3 +680,3 @@ if (errorFields.length > 0) { | ||
this.eachField(function (field, name) { | ||
var initialValue = _this.initialValues[name]; | ||
var initialValue = get(_this.initialValues, name); | ||
field.reset(initialValue); | ||
@@ -684,0 +683,0 @@ }); |
import { __assign, __awaiter, __extends, __generator } from "tslib"; | ||
import AsyncValidator from 'async-validator'; | ||
import set from 'lodash-es/set'; | ||
import get from 'lodash-es/get'; | ||
import { getValueFromProps } from '../_util/simply'; | ||
@@ -36,3 +38,3 @@ var EventEmitter = /** @class */ (function () { | ||
_this.formRules = rules; | ||
_this.create(name, initialValues[name], rules[name], validateMessages, required, label, message, validateTrigger); | ||
_this.create(name, get(initialValues, name), rules[name], validateMessages, required, label, message, validateTrigger); | ||
_this.ref.on(function (trigger, value, extraInfo) { | ||
@@ -54,3 +56,3 @@ if (trigger === 'onChange') { | ||
value.validateTrigger !== props.validateTrigger) { | ||
_this.create(value.name, initialValues[value.name], _this.formRules[value.name], validateMessages, value.required, value.message, value.label, value.validateTrigger, true); | ||
_this.create(value.name, get(initialValues, value.name), _this.formRules[value.name], validateMessages, value.required, value.message, value.label, value.validateTrigger, true); | ||
} | ||
@@ -442,6 +444,3 @@ if (value.name !== props.name) { | ||
_this.changeListeners.forEach(function (item) { | ||
var _a; | ||
return item((_a = {}, | ||
_a[name] = value, | ||
_a), _this.getFieldsValue()); | ||
return item(set({}, name, value), _this.getFieldsValue()); | ||
}); | ||
@@ -491,4 +490,4 @@ } | ||
var _this = this; | ||
Object.keys(values).forEach(function (name) { | ||
_this.setFieldValue(name, values[name]); | ||
Object.keys(this.fields).forEach(function (name) { | ||
_this.setFieldValue(name, get(values, name)); | ||
}); | ||
@@ -531,3 +530,3 @@ }; | ||
nameList.forEach(function (name) { | ||
fieldsValue[name] = _this.getFieldValue(name); | ||
set(fieldsValue, name, _this.getFieldValue(name)); | ||
}); | ||
@@ -605,4 +604,4 @@ return fieldsValue; | ||
this.changeListeners.push(function (changedValues, allValues) { | ||
if (name in changedValues) { | ||
callback(changedValues[name], allValues); | ||
if (get(changedValues, name)) { | ||
callback(get(changedValues, name), allValues); | ||
} | ||
@@ -661,3 +660,3 @@ }); | ||
} | ||
values[name] = value; | ||
set(values, name, value); | ||
}); | ||
@@ -681,3 +680,3 @@ if (errorFields.length > 0) { | ||
this.eachField(function (field, name) { | ||
var initialValue = _this.initialValues[name]; | ||
var initialValue = get(_this.initialValues, name); | ||
field.reset(initialValue); | ||
@@ -684,0 +683,0 @@ }); |
{ | ||
"name": "antd-mini", | ||
"version": "2.35.2", | ||
"version": "2.35.3", | ||
"description": "antd-mini 是支付宝小程序 UI 组件库,遵循 Ant Design 规范。", | ||
@@ -38,2 +38,3 @@ "miniprogram": "compiled/wechat/src", | ||
"fast-deep-equal": "3.1.3", | ||
"lodash-es": "^4.17.21", | ||
"tslib": "2.5.0" | ||
@@ -40,0 +41,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3713115
6
38630
+ Addedlodash-es@^4.17.21
+ Addedlodash-es@4.17.21(transitive)