@ecoding/components.antd 0.3.62 → 0.3.63
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/lib/core/tag.items/index.js +10 -7
- package/package.json +2 -2
|
@@ -36,9 +36,9 @@ const C = (props) => {
|
|
|
36
36
|
setInputVisible(true);
|
|
37
37
|
};
|
|
38
38
|
const handleInputChange = (e) => {
|
|
39
|
-
setInputValue(e.target.value);
|
|
39
|
+
setInputValue(e.target.value.trim());
|
|
40
40
|
};
|
|
41
|
-
const handleInputConfirm = () => {
|
|
41
|
+
const handleInputConfirm = (e) => {
|
|
42
42
|
if (inputValue) {
|
|
43
43
|
if (!tags.includes(inputValue.trim())) {
|
|
44
44
|
const values = [...tags, inputValue.trim()];
|
|
@@ -53,17 +53,20 @@ const C = (props) => {
|
|
|
53
53
|
setInputValue('');
|
|
54
54
|
};
|
|
55
55
|
const handleEditInputChange = (e) => {
|
|
56
|
-
|
|
56
|
+
const v = e.target.value.trim();
|
|
57
|
+
setEditInputValue(v);
|
|
57
58
|
};
|
|
58
|
-
const handleEditInputConfirm = () => {
|
|
59
|
+
const handleEditInputConfirm = (e) => {
|
|
59
60
|
const newTags = [...(tags || [])];
|
|
60
|
-
if (!newTags.includes(editInputValue
|
|
61
|
-
newTags[editInputIndex] = editInputValue
|
|
61
|
+
if (!newTags.includes(editInputValue)) {
|
|
62
|
+
newTags[editInputIndex] = editInputValue;
|
|
62
63
|
setTags(newTags);
|
|
63
64
|
props.onChange && props.onChange(newTags && newTags.length > 0 ? newTags : undefined);
|
|
64
65
|
}
|
|
65
66
|
else {
|
|
66
|
-
|
|
67
|
+
if (newTags[editInputIndex] != editInputValue) {
|
|
68
|
+
message.error(props.multipleError || '标签已存在');
|
|
69
|
+
}
|
|
67
70
|
}
|
|
68
71
|
setEditInputIndex(-1);
|
|
69
72
|
setEditInputValue('');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecoding/components.antd",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.63",
|
|
4
4
|
"author": "cxc",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"antd": "5.27.0",
|
|
48
48
|
"axios": "^1.1.2"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "e6bea003611d97fb52d8b55a25bce21561a44385"
|
|
51
51
|
}
|