rc-field-form
Advanced tools
Comparing version 2.5.1 to 2.6.0
@@ -589,2 +589,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
function WrapperField(_ref6) { | ||
var _restProps$isListFiel; | ||
var name = _ref6.name, | ||
@@ -595,4 +596,5 @@ restProps = _objectWithoutProperties(_ref6, _excluded); | ||
var namePath = name !== undefined ? getNamePath(name) : undefined; | ||
var isMergedListField = (_restProps$isListFiel = restProps.isListField) !== null && _restProps$isListFiel !== void 0 ? _restProps$isListFiel : !!listContext; | ||
var key = 'keep'; | ||
if (!restProps.isListField) { | ||
if (!isMergedListField) { | ||
key = "_".concat((namePath || []).join('_')); | ||
@@ -603,3 +605,3 @@ } | ||
// We can still support multiple level field preserve. | ||
if (process.env.NODE_ENV !== 'production' && restProps.preserve === false && restProps.isListField && namePath.length <= 1) { | ||
if (process.env.NODE_ENV !== 'production' && restProps.preserve === false && isMergedListField && namePath.length <= 1) { | ||
warning(false, '`preserve` should not apply on Form.List fields.'); | ||
@@ -610,3 +612,3 @@ } | ||
name: namePath, | ||
isListField: !!listContext | ||
isListField: isMergedListField | ||
}, restProps, { | ||
@@ -613,0 +615,0 @@ fieldContext: fieldContext |
@@ -597,2 +597,3 @@ "use strict"; | ||
function WrapperField(_ref6) { | ||
var _restProps$isListFiel; | ||
var name = _ref6.name, | ||
@@ -603,4 +604,5 @@ restProps = (0, _objectWithoutProperties2.default)(_ref6, _excluded); | ||
var namePath = name !== undefined ? (0, _valueUtil.getNamePath)(name) : undefined; | ||
var isMergedListField = (_restProps$isListFiel = restProps.isListField) !== null && _restProps$isListFiel !== void 0 ? _restProps$isListFiel : !!listContext; | ||
var key = 'keep'; | ||
if (!restProps.isListField) { | ||
if (!isMergedListField) { | ||
key = "_".concat((namePath || []).join('_')); | ||
@@ -611,3 +613,3 @@ } | ||
// We can still support multiple level field preserve. | ||
if (process.env.NODE_ENV !== 'production' && restProps.preserve === false && restProps.isListField && namePath.length <= 1) { | ||
if (process.env.NODE_ENV !== 'production' && restProps.preserve === false && isMergedListField && namePath.length <= 1) { | ||
(0, _warning.default)(false, '`preserve` should not apply on Form.List fields.'); | ||
@@ -618,3 +620,3 @@ } | ||
name: namePath, | ||
isListField: !!listContext | ||
isListField: isMergedListField | ||
}, restProps, { | ||
@@ -621,0 +623,0 @@ fieldContext: fieldContext |
{ | ||
"name": "rc-field-form", | ||
"version": "2.5.1", | ||
"version": "2.6.0", | ||
"description": "React Form Component", | ||
@@ -42,3 +42,3 @@ "typings": "es/index.d.ts", | ||
"test:coverage": "umi-test --coverage", | ||
"prepublishOnly": "npm run compile && np --no-cleanup --yolo --no-publish", | ||
"prepublishOnly": "npm run compile", | ||
"lint": "eslint src/ --ext .tsx,.ts", | ||
@@ -70,3 +70,3 @@ "lint:tsc": "tsc -p tsconfig.json --noEmit", | ||
"eslint-plugin-jest": "^27.6.0", | ||
"eslint-plugin-unicorn": "^55.0.0", | ||
"eslint-plugin-unicorn": "^56.0.1", | ||
"father": "^4.0.0", | ||
@@ -73,0 +73,0 @@ "gh-pages": "^6.1.0", |
291894
6729