@autobest-ui/components 2.0.5-y.2 → 2.0.5-y.3

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.
@@ -7,7 +7,6 @@ export interface SelectOptionItem {
7
7
  name: NameValue;
8
8
  value: Value;
9
9
  actualName?: NameValue;
10
- disabled?: boolean;
11
10
  unselect?: boolean;
12
11
  className?: string;
13
12
  }
@@ -101,7 +101,7 @@ function (_super) {
101
101
  var code = event.keyCode || event.which;
102
102
 
103
103
  if (code >= 65 && code <= 90 || code >= 48 && code <= 57 || code >= 96 && code <= 105) {
104
- var findItem_1 = _this.findMatchItem(event.key);
104
+ var findItem_1 = _this.findMatchItem(event.key.toLowerCase());
105
105
 
106
106
  if (!findItem_1) {
107
107
  return;
@@ -146,10 +146,12 @@ function (_super) {
146
146
 
147
147
  for (var i = 0; i < list.length; i++) {
148
148
  for (var j = 0; j < list[i].length; j++) {
149
- var item = list[i][j];
149
+ var item = list[i][j]; // 只对string/number类型进行筛选,
150
150
 
151
- if (item.name.toString().toLowerCase().indexOf(inputVal) === 0) {
152
- return item;
151
+ if (!item.unselect && (typeof item.name === 'string' || typeof item.name === 'number')) {
152
+ if (item.name.toString().toLowerCase().indexOf(inputVal) === 0) {
153
+ return item;
154
+ }
153
155
  }
154
156
  }
155
157
  }
@@ -7,7 +7,6 @@ export interface SelectOptionItem {
7
7
  name: NameValue;
8
8
  value: Value;
9
9
  actualName?: NameValue;
10
- disabled?: boolean;
11
10
  unselect?: boolean;
12
11
  className?: string;
13
12
  }
@@ -113,7 +113,7 @@ function (_super) {
113
113
  var code = event.keyCode || event.which;
114
114
 
115
115
  if (code >= 65 && code <= 90 || code >= 48 && code <= 57 || code >= 96 && code <= 105) {
116
- var findItem_1 = _this.findMatchItem(event.key);
116
+ var findItem_1 = _this.findMatchItem(event.key.toLowerCase());
117
117
 
118
118
  if (!findItem_1) {
119
119
  return;
@@ -158,10 +158,12 @@ function (_super) {
158
158
 
159
159
  for (var i = 0; i < list.length; i++) {
160
160
  for (var j = 0; j < list[i].length; j++) {
161
- var item = list[i][j];
161
+ var item = list[i][j]; // 只对string/number类型进行筛选,
162
162
 
163
- if (item.name.toString().toLowerCase().indexOf(inputVal) === 0) {
164
- return item;
163
+ if (!item.unselect && (typeof item.name === 'string' || typeof item.name === 'number')) {
164
+ if (item.name.toString().toLowerCase().indexOf(inputVal) === 0) {
165
+ return item;
166
+ }
165
167
  }
166
168
  }
167
169
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobest-ui/components",
3
- "version": "2.0.5-y.2",
3
+ "version": "2.0.5-y.3",
4
4
  "private": false,
5
5
  "description": "components common ui for React",
6
6
  "main": "lib/index.js",
@@ -46,5 +46,5 @@
46
46
  "react": ">=16.8.6",
47
47
  "react-transition-group": ">=4.2.2"
48
48
  },
49
- "gitHead": "922987f547f608a090e509ccec8cbecc58bb8935"
49
+ "gitHead": "ab861ea82f433ed53bfeda4219b72709186e9d5b"
50
50
  }