@zat-design/sisyphus-react 3.9.5-beta.6 → 3.9.5-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,13 @@ import { isEmpty } from '../../utils';
|
|
3
3
|
// 过滤对象中undefined字段
|
4
4
|
// 防止{a: '1'} {a: '1', b: undefined | null}被认为不相等
|
5
5
|
var filterObject = function filterObject(data) {
|
6
|
-
if (!isObject(data) ||
|
6
|
+
if (!isObject(data) || data === null) return data;
|
7
|
+
// ['1', undefined] ['1', ''] 视为相等
|
8
|
+
if (Array.isArray(data)) {
|
9
|
+
return data.map(function (item) {
|
10
|
+
return isEmpty(item) ? null : item;
|
11
|
+
});
|
12
|
+
}
|
7
13
|
var resData = {};
|
8
14
|
Object.keys(data).forEach(function (key) {
|
9
15
|
if (!isEmpty(data[key])) {
|
package/es/ProSelect/index.js
CHANGED
@@ -296,7 +296,7 @@ export var ProSelect = function ProSelect(props, ref) {
|
|
296
296
|
showArrow: true,
|
297
297
|
loading: fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.loading,
|
298
298
|
onChange: handleChange,
|
299
|
-
optionLabelProp
|
299
|
+
// optionLabelProp={otherProps?.isDiffChange ? 'label' : 'children'} // 解决warning报错,添加默认值
|
300
300
|
// optionLabelProp="label" // 解决warning报错,添加默认值
|
301
301
|
showSearch: true,
|
302
302
|
filterOption: isFunction(_onSearch) ? false : function (input, option) {
|
@@ -9,7 +9,13 @@ var _utils = require("../../utils");
|
|
9
9
|
// 过滤对象中undefined字段
|
10
10
|
// 防止{a: '1'} {a: '1', b: undefined | null}被认为不相等
|
11
11
|
var filterObject = function filterObject(data) {
|
12
|
-
if (!(0, _lodash.isObject)(data) ||
|
12
|
+
if (!(0, _lodash.isObject)(data) || data === null) return data;
|
13
|
+
// ['1', undefined] ['1', ''] 视为相等
|
14
|
+
if (Array.isArray(data)) {
|
15
|
+
return data.map(function (item) {
|
16
|
+
return (0, _utils.isEmpty)(item) ? null : item;
|
17
|
+
});
|
18
|
+
}
|
13
19
|
var resData = {};
|
14
20
|
Object.keys(data).forEach(function (key) {
|
15
21
|
if (!(0, _utils.isEmpty)(data[key])) {
|
package/lib/ProSelect/index.js
CHANGED
@@ -297,7 +297,7 @@ var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
|
|
297
297
|
showArrow: true,
|
298
298
|
loading: fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.loading,
|
299
299
|
onChange: handleChange,
|
300
|
-
optionLabelProp
|
300
|
+
// optionLabelProp={otherProps?.isDiffChange ? 'label' : 'children'} // 解决warning报错,添加默认值
|
301
301
|
// optionLabelProp="label" // 解决warning报错,添加默认值
|
302
302
|
showSearch: true,
|
303
303
|
filterOption: (0, _lodash.isFunction)(_onSearch) ? false : function (input, option) {
|