ztxkui 4.2.18-48 → 4.2.18-49
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.
- package/dist/Demo.js +4 -0
- package/dist/components/EnhanceSelect/index.js +14 -10
- package/package.json +1 -1
package/dist/Demo.js
CHANGED
|
@@ -74,6 +74,10 @@ function Demo() {
|
|
|
74
74
|
React.createElement(EnhanceSelect, { style: selectStyle, list: list, mode: "multiple", isHandAddItem: true, value: value2, joinKey: "test1", showAll: true, onChange: function (value, option, fullData) {
|
|
75
75
|
console.log(value, typeof value);
|
|
76
76
|
console.log(option);
|
|
77
|
+
var a = option.map(function (item) {
|
|
78
|
+
console.log(item);
|
|
79
|
+
return 1;
|
|
80
|
+
});
|
|
77
81
|
setValue2(value);
|
|
78
82
|
} })),
|
|
79
83
|
React.createElement("div", null,
|
|
@@ -913,20 +913,24 @@ function EnhanceSelect(_a) {
|
|
|
913
913
|
}
|
|
914
914
|
}
|
|
915
915
|
}
|
|
916
|
+
console.log(option);
|
|
916
917
|
if (!Array.isArray(currentData_1)) {
|
|
917
|
-
var newOption =
|
|
918
|
-
|
|
919
|
-
|
|
918
|
+
var newOption = option
|
|
919
|
+
? __assign(__assign({}, option), { title: !Array.isArray(currentData_1) && (currentData_1 === null || currentData_1 === void 0 ? void 0 : currentData_1[titleKey])
|
|
920
|
+
? currentData_1 === null || currentData_1 === void 0 ? void 0 : currentData_1[titleKey]
|
|
921
|
+
: option.title }) : option;
|
|
920
922
|
onChange && onChange(__value, newOption, currentData_1);
|
|
921
923
|
}
|
|
922
924
|
else {
|
|
923
|
-
var newOption = option
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
925
|
+
var newOption = option
|
|
926
|
+
? option === null || option === void 0 ? void 0 : option.map(function (item, index) {
|
|
927
|
+
var currentItem = currentData_1 === null || currentData_1 === void 0 ? void 0 : currentData_1[index];
|
|
928
|
+
if (currentItem === null || currentItem === void 0 ? void 0 : currentItem[titleKey]) {
|
|
929
|
+
return __assign(__assign({}, item), { title: currentItem ? currentItem === null || currentItem === void 0 ? void 0 : currentItem[titleKey] : option.title });
|
|
930
|
+
}
|
|
931
|
+
return item;
|
|
932
|
+
})
|
|
933
|
+
: option;
|
|
930
934
|
onChange && onChange(__value, newOption, currentData_1);
|
|
931
935
|
}
|
|
932
936
|
}
|