@kdcloudjs/kdesign 1.7.29 → 1.7.30

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.
@@ -97,6 +97,17 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
97
97
  }, []);
98
98
  var getDefaultCheckbox = function getDefaultCheckbox() {
99
99
  var _context20, _context21;
100
+ var inputProps = {
101
+ type: 'checkbox',
102
+ className: inputClassName,
103
+ onChange: handleChange,
104
+ checked: selected,
105
+ disabled: mergedDisabled,
106
+ name: mergedName
107
+ };
108
+ if ((value !== null && value !== void 0 ? value : '') !== '') {
109
+ inputProps.value = value;
110
+ }
100
111
  return (
101
112
  /*#__PURE__*/
102
113
  // eslint-disable-next-line
@@ -106,30 +117,24 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
106
117
  ref: labelRef
107
118
  }, rest), /*#__PURE__*/React.createElement("span", {
108
119
  className: checkedWrapperClassName
109
- }, selected && /*#__PURE__*/React.createElement("span", {
120
+ }, selected ? /*#__PURE__*/React.createElement("span", {
110
121
  className: innerIconClassName
111
122
  }, /*#__PURE__*/React.createElement(Icon, {
112
123
  type: "right-bold",
113
124
  className: _concatInstanceProperty(_context20 = "".concat(checkboxPrefixCls, "-")).call(_context20, mergedCheckboxType, "-inner-icon")
114
- })), /*#__PURE__*/React.createElement("input", {
125
+ })) : null, /*#__PURE__*/React.createElement("input", _extends({
115
126
  type: "checkbox",
116
- className: inputClassName,
117
- onChange: handleChange,
118
- ref: ref,
119
- value: value,
120
- checked: selected,
121
- disabled: mergedDisabled,
122
- name: mergedName
123
- })), children && /*#__PURE__*/React.createElement("span", {
127
+ ref: ref
128
+ }, inputProps))), children ? /*#__PURE__*/React.createElement("span", {
124
129
  className: "".concat(checkboxPrefixCls, "-children")
125
- }, children), !isDefaultType() && /*#__PURE__*/React.createElement("span", {
130
+ }, children) : null, !isDefaultType() ? /*#__PURE__*/React.createElement("span", {
126
131
  className: triangleClassName
127
132
  }, /*#__PURE__*/React.createElement("span", {
128
133
  className: innerIconClassName
129
134
  }, /*#__PURE__*/React.createElement(Icon, {
130
135
  type: "right-bold",
131
136
  className: _concatInstanceProperty(_context21 = "".concat(checkboxPrefixCls, "-")).call(_context21, mergedCheckboxType, "-inner-icon")
132
- }))))
137
+ }))) : null)
133
138
  );
134
139
  };
135
140
  return getDefaultCheckbox();
@@ -23,7 +23,7 @@ var getCityId = function getCityId(data) {
23
23
  return data;
24
24
  };
25
25
  var InternalSelect = function InternalSelect(props, ref) {
26
- var _context, _classNames3, _classNames5;
26
+ var _context, _classNames3, _classNames6;
27
27
  var _useContext = useContext(ConfigContext),
28
28
  getPrefixCls = _useContext.getPrefixCls,
29
29
  prefixCls = _useContext.prefixCls,
@@ -102,14 +102,18 @@ var InternalSelect = function InternalSelect(props, ref) {
102
102
  _useState6 = _slicedToArray(_useState5, 2),
103
103
  focusd = _useState6[0],
104
104
  setFocusd = _useState6[1];
105
- var _useState7 = useState(null),
105
+ var _useState7 = useState(false),
106
106
  _useState8 = _slicedToArray(_useState7, 2),
107
- seletedCity = _useState8[0],
108
- setSeletedCity = _useState8[1];
109
- var _useState9 = useState('domestic'),
107
+ afterChangeFocus = _useState8[0],
108
+ setAfterChangeFocus = _useState8[1];
109
+ var _useState9 = useState(null),
110
110
  _useState10 = _slicedToArray(_useState9, 2),
111
- tabsValue = _useState10[0],
112
- setTabsValue = _useState10[1];
111
+ seletedCity = _useState10[0],
112
+ setSeletedCity = _useState10[1];
113
+ var _useState11 = useState('domestic'),
114
+ _useState12 = _slicedToArray(_useState11, 2),
115
+ tabsValue = _useState12[0],
116
+ setTabsValue = _useState12[1];
113
117
  var isDomestic = function isDomestic(type) {
114
118
  return type === 'domestic';
115
119
  };
@@ -144,6 +148,7 @@ var InternalSelect = function InternalSelect(props, ref) {
144
148
  var handleBlur = useCallback(function (e) {
145
149
  e.stopPropagation();
146
150
  setFocusd(false);
151
+ setAfterChangeFocus(false);
147
152
  onBlur && onBlur(e);
148
153
  }, [onBlur]);
149
154
  useEffect(function () {
@@ -193,7 +198,7 @@ var InternalSelect = function InternalSelect(props, ref) {
193
198
  className: "".concat(selectPrefixCls, "-icon-clear"),
194
199
  ref: clearRef
195
200
  }, clearIcon || /*#__PURE__*/React.createElement(Icon, {
196
- type: "close-solid"
201
+ type: "close"
197
202
  })), showArrow && /*#__PURE__*/React.createElement("span", {
198
203
  className: arrowIconCls
199
204
  }, suffixIcon || /*#__PURE__*/React.createElement(Icon, {
@@ -224,9 +229,12 @@ var InternalSelect = function InternalSelect(props, ref) {
224
229
  }));
225
230
  };
226
231
  var handleOption = function handleOption(city) {
232
+ var _a;
227
233
  handleVisibleChange(false);
228
234
  city.type = tabsValue === 'domestic' ? 'domestic' : 'foreign';
229
235
  (city === null || city === void 0 ? void 0 : city.id) !== initValue && (onChange === null || onChange === void 0 ? void 0 : onChange(city === null || city === void 0 ? void 0 : city.id, city));
236
+ (_a = searchRef.current) === null || _a === void 0 ? void 0 : _a.focus();
237
+ setAfterChangeFocus(true);
230
238
  if (typeof value === 'undefined') {
231
239
  setSeletedCity(city);
232
240
  setInitValue(city === null || city === void 0 ? void 0 : city.id);
@@ -239,7 +247,10 @@ var InternalSelect = function InternalSelect(props, ref) {
239
247
  }
240
248
  return /*#__PURE__*/React.createElement("div", {
241
249
  className: "".concat(selectPrefixCls, "-list"),
242
- ref: optionsListRef
250
+ ref: optionsListRef,
251
+ onMouseDown: function onMouseDown(e) {
252
+ return e === null || e === void 0 ? void 0 : e.preventDefault();
253
+ }
243
254
  }, _mapInstanceProperty(data).call(data, function (item, index) {
244
255
  return /*#__PURE__*/React.createElement(Option, {
245
256
  key: item.id,
@@ -310,9 +321,11 @@ var InternalSelect = function InternalSelect(props, ref) {
310
321
  }
311
322
  }, [type, tabsValue]);
312
323
  var renderSingle = function renderSingle() {
324
+ var _classNames5;
313
325
  var hiddenStyle = !!searchValue || (initValue !== null && initValue !== void 0 ? initValue : '') !== '' ? {
314
326
  visibility: 'hidden'
315
327
  } : undefined;
328
+ var itemCls = classNames((_classNames5 = {}, _defineProperty(_classNames5, "".concat(selectPrefixCls, "-content-item"), true), _defineProperty(_classNames5, "".concat(selectPrefixCls, "-content-item-seleted"), afterChangeFocus), _classNames5));
316
329
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
317
330
  className: singleCls,
318
331
  ref: selectionRef
@@ -329,18 +342,18 @@ var InternalSelect = function InternalSelect(props, ref) {
329
342
  onBlur: handleBlur,
330
343
  readOnly: !!disabled
331
344
  }), !searchValue && /*#__PURE__*/React.createElement("span", {
332
- className: "".concat(selectPrefixCls, "-content-item"),
345
+ className: itemCls,
333
346
  title: seletedCity === null || seletedCity === void 0 ? void 0 : seletedCity.name
334
347
  }, seletedCity === null || seletedCity === void 0 ? void 0 : seletedCity.name)), !searchValue && /*#__PURE__*/React.createElement("span", {
335
348
  className: "".concat(selectPrefixCls, "-content-info")
336
349
  }, _renderCityInfo(seletedCity))), /*#__PURE__*/React.createElement("span", {
337
350
  className: "".concat(selectPrefixCls, "-placeholder"),
338
351
  style: hiddenStyle
339
- }, placeholder), /*#__PURE__*/React.createElement("span", {
352
+ }, !disabled ? placeholder : null), /*#__PURE__*/React.createElement("span", {
340
353
  className: "".concat(selectPrefixCls, "-suffix")
341
354
  }, renderSuffix())));
342
355
  };
343
- var singleCls = classNames(commCls, (_classNames5 = {}, _defineProperty(_classNames5, "".concat(selectPrefixCls, "-disabled"), disabled), _defineProperty(_classNames5, "".concat(selectPrefixCls, "-focused"), !disabled && focusd || optionShow), _classNames5));
356
+ var singleCls = classNames(commCls, (_classNames6 = {}, _defineProperty(_classNames6, "".concat(selectPrefixCls, "-disabled"), disabled), _defineProperty(_classNames6, "".concat(selectPrefixCls, "-focused"), !disabled && focusd || optionShow), _classNames6));
344
357
  useEffect(function () {
345
358
  if (optionShow && !disabled) {
346
359
  var onDropdownVisibleChange = selectProps.onDropdownVisibleChange;
@@ -377,16 +390,17 @@ var InternalSelect = function InternalSelect(props, ref) {
377
390
  }
378
391
  return -1;
379
392
  };
380
- var _useState11 = useState(getActiveIndex(0)),
381
- _useState12 = _slicedToArray(_useState11, 2),
382
- activeIndex = _useState12[0],
383
- setActiveIndex = _useState12[1];
393
+ var _useState13 = useState(-1),
394
+ _useState14 = _slicedToArray(_useState13, 2),
395
+ activeIndex = _useState14[0],
396
+ setActiveIndex = _useState14[1];
384
397
  var initActiveIndex = function initActiveIndex() {
385
- setActiveIndex(getActiveIndex(0));
398
+ var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
399
+ setActiveIndex(index === undefined ? getActiveIndex(0) : index);
386
400
  };
387
401
  useEffect(function () {
388
- initActiveIndex();
389
- }, [searchValue, tabsValue]);
402
+ initActiveIndex(searchValue ? undefined : -1);
403
+ }, [searchValue, tabsValue, curkeyboardList]);
390
404
  var onInternalKeyDown = function onInternalKeyDown(e) {
391
405
  var _a, _b, _c;
392
406
  var which = e.which;
@@ -410,11 +424,11 @@ var InternalSelect = function InternalSelect(props, ref) {
410
424
  var item = curkeyboardList[activeIndex];
411
425
  if (!item) return;
412
426
  handleOption(item);
413
- setOptionShow(false);
427
+ handleVisibleChange(false);
414
428
  break;
415
429
  }
416
430
  case KeyCode.ESC:
417
- setOptionShow(false);
431
+ handleVisibleChange(false);
418
432
  break;
419
433
  default:
420
434
  break;
@@ -470,7 +484,7 @@ var InternalSelect = function InternalSelect(props, ref) {
470
484
  };
471
485
  var handleVisibleChange = function handleVisibleChange(visible) {
472
486
  if (!visible) {
473
- initActiveIndex();
487
+ initActiveIndex(-1);
474
488
  }
475
489
  if (visible !== optionShow) {
476
490
  props.visible === undefined && setOptionShow(visible);
@@ -170,6 +170,7 @@
170
170
  background: #fff;
171
171
  -webkit-transition: opacity 0.15s ease;
172
172
  transition: opacity 0.15s ease;
173
+ font-size: var(--kd-c-city-picker-icon-clear-font-size, 16px);
173
174
  }
174
175
  .kd-city-picker-icon-clear:hover {
175
176
  color: var(--kd-c-city-picker-color-border-hover, var(--kd-g-color-theme, #5582f3));
@@ -239,10 +240,10 @@
239
240
  opacity: 1;
240
241
  }
241
242
  .kd-city-picker-wrapper .kd-city-picker-icon-clear {
242
- color: var(--kd-c-city-picker-icon-clear-color-text, #d9d9d9);
243
+ color: var(--kd-c-city-picker-icon-clear-color-text, #666666);
243
244
  }
244
245
  .kd-city-picker-wrapper .kd-city-picker-icon-clear:hover {
245
- color: var(--kd-c-city-picker-icon-clear-color-text-hover, #999);
246
+ color: var(--kd-c-city-picker-icon-clear-color-text-hover, var(--kd-g-color-theme, #5582f3));
246
247
  }
247
248
  .kd-city-picker-show-search {
248
249
  cursor: text;
@@ -419,7 +420,7 @@
419
420
  .kd-city-picker-focused {
420
421
  border-color: var(--kd-c-city-picker-color-border-foucs, var(--kd-g-color-theme, #5582f3)) !important;
421
422
  }
422
- .kd-city-picker-focused .kd-city-picker-content-item {
423
+ .kd-city-picker-focused .kd-city-picker-content-item:not(.kd-city-picker-content-item-seleted) {
423
424
  color: var(--kd-c-city-picker-placeholder-color-text, #b2b2b2);
424
425
  }
425
426
  .kd-city-picker-disabled {
@@ -61,6 +61,7 @@
61
61
  top: 0;
62
62
  background: #fff;
63
63
  transition: opacity 0.15s ease;
64
+ font-size: @city-picker-clear-font-size;
64
65
  &:hover {
65
66
  color: @city-picker-g-color-border-hover;
66
67
  }
@@ -297,7 +298,7 @@
297
298
  &-focused {
298
299
  .focusColor();
299
300
 
300
- .@{city-picker-prefix-cls}-content-item {
301
+ .@{city-picker-prefix-cls}-content-item:not(.@{city-picker-prefix-cls}-content-item-seleted) {
301
302
  color: @city-picker-placeholder-color;
302
303
  }
303
304
  }
@@ -17,8 +17,8 @@
17
17
  @city-picker-color-background-disabled: var(~'@{city-picker-custom-prefix}-color-background-disabled', #fff);
18
18
  @city-picker-color-text-disabled: var(~'@{city-picker-custom-prefix}-color-text-disabled', @color-disabled);
19
19
  @city-picker-arrow-icon-color-text-disabled: var(~'@{city-picker-custom-prefix}-arrow-icon-color-text-disabled', #b2b2b2);
20
- @city-picker-clear-color: var(~'@{city-picker-custom-prefix}-icon-clear-color-text', #d9d9d9);
21
- @city-picker-clear-color-hover: var(~'@{city-picker-custom-prefix}-icon-clear-color-text-hover', #999);
20
+ @city-picker-clear-color: var(~'@{city-picker-custom-prefix}-icon-clear-color-text', #666666);
21
+ @city-picker-clear-color-hover: var(~'@{city-picker-custom-prefix}-icon-clear-color-text-hover', @color-theme);
22
22
  @city-picker-list-item-color-selected: var(~'@{city-picker-custom-prefix}-list-item-color-text-selected', @color-theme);
23
23
  @city-picker-highlight-color: var(~'@{city-picker-custom-prefix}-highlight-color-text', @color-theme);
24
24
 
@@ -27,6 +27,7 @@
27
27
  @city-picker-large-font-size: var(~'@{city-picker-custom-prefix}-font-size-large', 16px); // 大号字体
28
28
  @city-picker-middle-font-size: var(~'@{city-picker-custom-prefix}-font-size-middle', 14px); // 中号高度
29
29
  @city-picker-small-font-size: var(~'@{city-picker-custom-prefix}-font-size-small', 12px); // 小号高度
30
+ @city-picker-clear-font-size: var(~'@{city-picker-custom-prefix}-icon-clear-font-size', 16px);
30
31
 
31
32
  // line-height
32
33
  @city-picker-dropdown-line-height: var(~'@{city-picker-custom-prefix}-dropdown-line-height', 22px);
package/es/grid/row.js CHANGED
@@ -76,9 +76,9 @@ var Row = function Row(props) {
76
76
  }
77
77
  var rowStyle = {
78
78
  'row-gap': "".concat(gap.v, "px"),
79
- margin: "0 ".concat(-1 * gap.h, "px")
79
+ margin: "0 ".concat(-1 * gap.h / 2, "px")
80
80
  };
81
- if (gap.v && isSogouOrIe) rowStyle['margin-bottom'] = "".concat(-1 * gap.v / 2, "px");
81
+ if (gap.v && isSogouOrIe) rowStyle['margin-bottom'] = "".concat(-1 * gap.v, "px");
82
82
  var toalign = {
83
83
  top: 'flex-start',
84
84
  middle: 'center',
@@ -456,7 +456,7 @@ var InternalSelect = function InternalSelect(props, ref) {
456
456
  var arrowIconCls = classNames((_classNames7 = {}, _defineProperty(_classNames7, "".concat(selectPrefixCls, "-icon-arrow"), true), _defineProperty(_classNames7, "".concat(selectPrefixCls, "-icon-arrow-up"), optionShow), _defineProperty(_classNames7, "".concat(selectPrefixCls, "-icon-arrow-down"), !optionShow), _defineProperty(_classNames7, "".concat(selectPrefixCls, "-icon-arrow-focus"), optionShow), _classNames7));
457
457
  var iconShow = allowClear && !disabled && ((isMultiple ? mulOptions.length > 0 : (singleVal !== null && singleVal !== void 0 ? singleVal : '') !== '') || searchValue);
458
458
  var clearIconCls = classNames(_defineProperty({}, "".concat(selectPrefixCls, "-icon-clear"), true));
459
- return /*#__PURE__*/React.createElement(React.Fragment, null, iconShow && /*#__PURE__*/React.createElement("span", {
459
+ return /*#__PURE__*/React.createElement(React.Fragment, null, iconShow ? /*#__PURE__*/React.createElement("span", {
460
460
  onClick: handleReset,
461
461
  onMouseDown: function onMouseDown(e) {
462
462
  return e.preventDefault();
@@ -465,11 +465,11 @@ var InternalSelect = function InternalSelect(props, ref) {
465
465
  ref: clearRef
466
466
  }, clearIcon || /*#__PURE__*/React.createElement(Icon, {
467
467
  type: "close-solid"
468
- })), showArrow && /*#__PURE__*/React.createElement("span", {
468
+ })) : null, showArrow ? /*#__PURE__*/React.createElement("span", {
469
469
  className: arrowIconCls
470
470
  }, suffixIcon || /*#__PURE__*/React.createElement(Icon, {
471
471
  type: "arrow-down"
472
- })));
472
+ })) : null);
473
473
  };
474
474
  var renderOption = function renderOption(child, index) {
475
475
  if ((child === null || child === void 0 ? void 0 : child.props) && (child.type.displayName === 'Option' || child.type.name === 'Option')) {
@@ -568,7 +568,7 @@ var InternalSelect = function InternalSelect(props, ref) {
568
568
  className: dropDownCls,
569
569
  style: dropdownStyle,
570
570
  ref: dropDownRef
571
- }, !dropdownRender && childrenToRender.length > 0 && dropRender(eleOptionList, heightStyle), renderNotContent(), /*#__PURE__*/React.createElement("div", null, dropdownRender && dropdownRender(dropRender(childrenToRender, heightStyle))), isMultiple && realChildren.length > 0 && /*#__PURE__*/React.createElement("div", {
571
+ }, !dropdownRender && childrenToRender.length > 0 ? dropRender(eleOptionList, heightStyle) : null, renderNotContent(), /*#__PURE__*/React.createElement("div", null, dropdownRender ? dropdownRender(dropRender(childrenToRender, heightStyle)) : null), isMultiple && realChildren.length > 0 ? /*#__PURE__*/React.createElement("div", {
572
572
  className: multipleFooterCls
573
573
  }, /*#__PURE__*/React.createElement(Checkbox, {
574
574
  style: checkboxStyle,
@@ -577,7 +577,7 @@ var InternalSelect = function InternalSelect(props, ref) {
577
577
  onChange: handleSelectAll
578
578
  }, "\u5168\u9009"), /*#__PURE__*/React.createElement("span", {
579
579
  className: "".concat(selectPrefixCls, "-multiple-footer-hadSelected")
580
- }, "\u5DF2\u9009", /*#__PURE__*/React.createElement("span", null, selectedVal.length), "\u9879"))));
580
+ }, "\u5DF2\u9009", /*#__PURE__*/React.createElement("span", null, selectedVal.length), "\u9879")) : null));
581
581
  };
582
582
  // 处理多选tag
583
583
  var handleMaxTagHolder = useCallback(function () {
@@ -652,10 +652,10 @@ var InternalSelect = function InternalSelect(props, ref) {
652
652
  return /*#__PURE__*/React.createElement("div", {
653
653
  className: multipleCls,
654
654
  ref: selectionRef
655
- }, Array.isArray(mulOptions) && /*#__PURE__*/React.createElement(React.Fragment, null, _mapInstanceProperty(mulOptions).call(mulOptions, function (item, index) {
655
+ }, Array.isArray(mulOptions) ? /*#__PURE__*/React.createElement(React.Fragment, null, _mapInstanceProperty(mulOptions).call(mulOptions, function (item, index) {
656
656
  var label = item.label,
657
657
  value = item.value;
658
- return (!maxTagCount || index <= maxTagCount - 1) && /*#__PURE__*/React.createElement("span", {
658
+ return !maxTagCount || index <= maxTagCount - 1 ? /*#__PURE__*/React.createElement("span", {
659
659
  key: value,
660
660
  className: classNames("".concat(selectPrefixCls, "-selection-tag")),
661
661
  onMouseDown: function onMouseDown(e) {
@@ -677,12 +677,12 @@ var InternalSelect = function InternalSelect(props, ref) {
677
677
  return handleRemove(e, value);
678
678
  },
679
679
  "data-tag": value
680
- }, label));
680
+ }, label)) : null;
681
681
  }), maxTagCount && mulOptions.length > maxTagCount ? maxTagPlaceholder ? handleMaxTagHolder() : /*#__PURE__*/React.createElement("span", {
682
682
  className: itemCls
683
683
  }, /*#__PURE__*/React.createElement("span", {
684
684
  className: "".concat(selectPrefixCls, "-selection-item-content")
685
- }, "\u5171", mulOptions.length, "\u9879")) : null), /*#__PURE__*/React.createElement("span", {
685
+ }, "\u5171", mulOptions.length, "\u9879")) : null) : null, /*#__PURE__*/React.createElement("span", {
686
686
  className: "".concat(selectPrefixCls, "-selection-search"),
687
687
  style: {
688
688
  width: inputWidth
@@ -700,7 +700,7 @@ var InternalSelect = function InternalSelect(props, ref) {
700
700
  className: "".concat(selectPrefixCls, "-selection-search-mirror")
701
701
  }, searchValue, "\xA0")), /*#__PURE__*/React.createElement("span", {
702
702
  className: "".concat(selectPrefixCls, "-placeholder")
703
- }, !mulOptions.length && !searchValue && placeholder), /*#__PURE__*/React.createElement("span", {
703
+ }, !mulOptions.length && !searchValue ? placeholder : null), /*#__PURE__*/React.createElement("span", {
704
704
  className: "".concat(selectPrefixCls, "-suffix")
705
705
  }, renderSuffix()));
706
706
  };
@@ -109,6 +109,17 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
109
109
  }, []);
110
110
  var getDefaultCheckbox = function getDefaultCheckbox() {
111
111
  var _context20, _context21;
112
+ var inputProps = {
113
+ type: 'checkbox',
114
+ className: inputClassName,
115
+ onChange: handleChange,
116
+ checked: selected,
117
+ disabled: mergedDisabled,
118
+ name: mergedName
119
+ };
120
+ if ((value !== null && value !== void 0 ? value : '') !== '') {
121
+ inputProps.value = value;
122
+ }
112
123
  return (
113
124
  /*#__PURE__*/
114
125
  // eslint-disable-next-line
@@ -118,30 +129,24 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
118
129
  ref: labelRef
119
130
  }, rest), /*#__PURE__*/_react.default.createElement("span", {
120
131
  className: checkedWrapperClassName
121
- }, selected && /*#__PURE__*/_react.default.createElement("span", {
132
+ }, selected ? /*#__PURE__*/_react.default.createElement("span", {
122
133
  className: innerIconClassName
123
134
  }, /*#__PURE__*/_react.default.createElement(_icon.default, {
124
135
  type: "right-bold",
125
136
  className: (0, _concat.default)(_context20 = "".concat(checkboxPrefixCls, "-")).call(_context20, mergedCheckboxType, "-inner-icon")
126
- })), /*#__PURE__*/_react.default.createElement("input", {
137
+ })) : null, /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({
127
138
  type: "checkbox",
128
- className: inputClassName,
129
- onChange: handleChange,
130
- ref: ref,
131
- value: value,
132
- checked: selected,
133
- disabled: mergedDisabled,
134
- name: mergedName
135
- })), children && /*#__PURE__*/_react.default.createElement("span", {
139
+ ref: ref
140
+ }, inputProps))), children ? /*#__PURE__*/_react.default.createElement("span", {
136
141
  className: "".concat(checkboxPrefixCls, "-children")
137
- }, children), !isDefaultType() && /*#__PURE__*/_react.default.createElement("span", {
142
+ }, children) : null, !isDefaultType() ? /*#__PURE__*/_react.default.createElement("span", {
138
143
  className: triangleClassName
139
144
  }, /*#__PURE__*/_react.default.createElement("span", {
140
145
  className: innerIconClassName
141
146
  }, /*#__PURE__*/_react.default.createElement(_icon.default, {
142
147
  type: "right-bold",
143
148
  className: (0, _concat.default)(_context21 = "".concat(checkboxPrefixCls, "-")).call(_context21, mergedCheckboxType, "-inner-icon")
144
- }))))
149
+ }))) : null)
145
150
  );
146
151
  };
147
152
  return getDefaultCheckbox();
@@ -35,7 +35,7 @@ var getCityId = function getCityId(data) {
35
35
  return data;
36
36
  };
37
37
  var InternalSelect = function InternalSelect(props, ref) {
38
- var _context, _classNames3, _classNames5;
38
+ var _context, _classNames3, _classNames6;
39
39
  var _useContext = (0, _react.useContext)(_ConfigContext.default),
40
40
  getPrefixCls = _useContext.getPrefixCls,
41
41
  prefixCls = _useContext.prefixCls,
@@ -114,14 +114,18 @@ var InternalSelect = function InternalSelect(props, ref) {
114
114
  _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
115
115
  focusd = _useState6[0],
116
116
  setFocusd = _useState6[1];
117
- var _useState7 = (0, _react.useState)(null),
117
+ var _useState7 = (0, _react.useState)(false),
118
118
  _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
119
- seletedCity = _useState8[0],
120
- setSeletedCity = _useState8[1];
121
- var _useState9 = (0, _react.useState)('domestic'),
119
+ afterChangeFocus = _useState8[0],
120
+ setAfterChangeFocus = _useState8[1];
121
+ var _useState9 = (0, _react.useState)(null),
122
122
  _useState10 = (0, _slicedToArray2.default)(_useState9, 2),
123
- tabsValue = _useState10[0],
124
- setTabsValue = _useState10[1];
123
+ seletedCity = _useState10[0],
124
+ setSeletedCity = _useState10[1];
125
+ var _useState11 = (0, _react.useState)('domestic'),
126
+ _useState12 = (0, _slicedToArray2.default)(_useState11, 2),
127
+ tabsValue = _useState12[0],
128
+ setTabsValue = _useState12[1];
125
129
  var isDomestic = function isDomestic(type) {
126
130
  return type === 'domestic';
127
131
  };
@@ -156,6 +160,7 @@ var InternalSelect = function InternalSelect(props, ref) {
156
160
  var handleBlur = (0, _react.useCallback)(function (e) {
157
161
  e.stopPropagation();
158
162
  setFocusd(false);
163
+ setAfterChangeFocus(false);
159
164
  onBlur && onBlur(e);
160
165
  }, [onBlur]);
161
166
  (0, _react.useEffect)(function () {
@@ -205,7 +210,7 @@ var InternalSelect = function InternalSelect(props, ref) {
205
210
  className: "".concat(selectPrefixCls, "-icon-clear"),
206
211
  ref: clearRef
207
212
  }, clearIcon || /*#__PURE__*/_react.default.createElement(_index.Icon, {
208
- type: "close-solid"
213
+ type: "close"
209
214
  })), showArrow && /*#__PURE__*/_react.default.createElement("span", {
210
215
  className: arrowIconCls
211
216
  }, suffixIcon || /*#__PURE__*/_react.default.createElement(_index.Icon, {
@@ -236,9 +241,12 @@ var InternalSelect = function InternalSelect(props, ref) {
236
241
  }));
237
242
  };
238
243
  var handleOption = function handleOption(city) {
244
+ var _a;
239
245
  handleVisibleChange(false);
240
246
  city.type = tabsValue === 'domestic' ? 'domestic' : 'foreign';
241
247
  (city === null || city === void 0 ? void 0 : city.id) !== initValue && (onChange === null || onChange === void 0 ? void 0 : onChange(city === null || city === void 0 ? void 0 : city.id, city));
248
+ (_a = searchRef.current) === null || _a === void 0 ? void 0 : _a.focus();
249
+ setAfterChangeFocus(true);
242
250
  if (typeof value === 'undefined') {
243
251
  setSeletedCity(city);
244
252
  setInitValue(city === null || city === void 0 ? void 0 : city.id);
@@ -251,7 +259,10 @@ var InternalSelect = function InternalSelect(props, ref) {
251
259
  }
252
260
  return /*#__PURE__*/_react.default.createElement("div", {
253
261
  className: "".concat(selectPrefixCls, "-list"),
254
- ref: optionsListRef
262
+ ref: optionsListRef,
263
+ onMouseDown: function onMouseDown(e) {
264
+ return e === null || e === void 0 ? void 0 : e.preventDefault();
265
+ }
255
266
  }, (0, _map.default)(data).call(data, function (item, index) {
256
267
  return /*#__PURE__*/_react.default.createElement(_option.default, {
257
268
  key: item.id,
@@ -322,9 +333,11 @@ var InternalSelect = function InternalSelect(props, ref) {
322
333
  }
323
334
  }, [type, tabsValue]);
324
335
  var renderSingle = function renderSingle() {
336
+ var _classNames5;
325
337
  var hiddenStyle = !!searchValue || (initValue !== null && initValue !== void 0 ? initValue : '') !== '' ? {
326
338
  visibility: 'hidden'
327
339
  } : undefined;
340
+ var itemCls = (0, _classnames.default)((_classNames5 = {}, (0, _defineProperty2.default)(_classNames5, "".concat(selectPrefixCls, "-content-item"), true), (0, _defineProperty2.default)(_classNames5, "".concat(selectPrefixCls, "-content-item-seleted"), afterChangeFocus), _classNames5));
328
341
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
329
342
  className: singleCls,
330
343
  ref: selectionRef
@@ -341,18 +354,18 @@ var InternalSelect = function InternalSelect(props, ref) {
341
354
  onBlur: handleBlur,
342
355
  readOnly: !!disabled
343
356
  }), !searchValue && /*#__PURE__*/_react.default.createElement("span", {
344
- className: "".concat(selectPrefixCls, "-content-item"),
357
+ className: itemCls,
345
358
  title: seletedCity === null || seletedCity === void 0 ? void 0 : seletedCity.name
346
359
  }, seletedCity === null || seletedCity === void 0 ? void 0 : seletedCity.name)), !searchValue && /*#__PURE__*/_react.default.createElement("span", {
347
360
  className: "".concat(selectPrefixCls, "-content-info")
348
361
  }, _renderCityInfo(seletedCity))), /*#__PURE__*/_react.default.createElement("span", {
349
362
  className: "".concat(selectPrefixCls, "-placeholder"),
350
363
  style: hiddenStyle
351
- }, placeholder), /*#__PURE__*/_react.default.createElement("span", {
364
+ }, !disabled ? placeholder : null), /*#__PURE__*/_react.default.createElement("span", {
352
365
  className: "".concat(selectPrefixCls, "-suffix")
353
366
  }, renderSuffix())));
354
367
  };
355
- var singleCls = (0, _classnames.default)(commCls, (_classNames5 = {}, (0, _defineProperty2.default)(_classNames5, "".concat(selectPrefixCls, "-disabled"), disabled), (0, _defineProperty2.default)(_classNames5, "".concat(selectPrefixCls, "-focused"), !disabled && focusd || optionShow), _classNames5));
368
+ var singleCls = (0, _classnames.default)(commCls, (_classNames6 = {}, (0, _defineProperty2.default)(_classNames6, "".concat(selectPrefixCls, "-disabled"), disabled), (0, _defineProperty2.default)(_classNames6, "".concat(selectPrefixCls, "-focused"), !disabled && focusd || optionShow), _classNames6));
356
369
  (0, _react.useEffect)(function () {
357
370
  if (optionShow && !disabled) {
358
371
  var onDropdownVisibleChange = selectProps.onDropdownVisibleChange;
@@ -389,16 +402,17 @@ var InternalSelect = function InternalSelect(props, ref) {
389
402
  }
390
403
  return -1;
391
404
  };
392
- var _useState11 = (0, _react.useState)(getActiveIndex(0)),
393
- _useState12 = (0, _slicedToArray2.default)(_useState11, 2),
394
- activeIndex = _useState12[0],
395
- setActiveIndex = _useState12[1];
405
+ var _useState13 = (0, _react.useState)(-1),
406
+ _useState14 = (0, _slicedToArray2.default)(_useState13, 2),
407
+ activeIndex = _useState14[0],
408
+ setActiveIndex = _useState14[1];
396
409
  var initActiveIndex = function initActiveIndex() {
397
- setActiveIndex(getActiveIndex(0));
410
+ var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
411
+ setActiveIndex(index === undefined ? getActiveIndex(0) : index);
398
412
  };
399
413
  (0, _react.useEffect)(function () {
400
- initActiveIndex();
401
- }, [searchValue, tabsValue]);
414
+ initActiveIndex(searchValue ? undefined : -1);
415
+ }, [searchValue, tabsValue, curkeyboardList]);
402
416
  var onInternalKeyDown = function onInternalKeyDown(e) {
403
417
  var _a, _b, _c;
404
418
  var which = e.which;
@@ -422,11 +436,11 @@ var InternalSelect = function InternalSelect(props, ref) {
422
436
  var item = curkeyboardList[activeIndex];
423
437
  if (!item) return;
424
438
  handleOption(item);
425
- setOptionShow(false);
439
+ handleVisibleChange(false);
426
440
  break;
427
441
  }
428
442
  case _KeyCode.default.ESC:
429
- setOptionShow(false);
443
+ handleVisibleChange(false);
430
444
  break;
431
445
  default:
432
446
  break;
@@ -482,7 +496,7 @@ var InternalSelect = function InternalSelect(props, ref) {
482
496
  };
483
497
  var handleVisibleChange = function handleVisibleChange(visible) {
484
498
  if (!visible) {
485
- initActiveIndex();
499
+ initActiveIndex(-1);
486
500
  }
487
501
  if (visible !== optionShow) {
488
502
  props.visible === undefined && setOptionShow(visible);
@@ -170,6 +170,7 @@
170
170
  background: #fff;
171
171
  -webkit-transition: opacity 0.15s ease;
172
172
  transition: opacity 0.15s ease;
173
+ font-size: var(--kd-c-city-picker-icon-clear-font-size, 16px);
173
174
  }
174
175
  .kd-city-picker-icon-clear:hover {
175
176
  color: var(--kd-c-city-picker-color-border-hover, var(--kd-g-color-theme, #5582f3));
@@ -239,10 +240,10 @@
239
240
  opacity: 1;
240
241
  }
241
242
  .kd-city-picker-wrapper .kd-city-picker-icon-clear {
242
- color: var(--kd-c-city-picker-icon-clear-color-text, #d9d9d9);
243
+ color: var(--kd-c-city-picker-icon-clear-color-text, #666666);
243
244
  }
244
245
  .kd-city-picker-wrapper .kd-city-picker-icon-clear:hover {
245
- color: var(--kd-c-city-picker-icon-clear-color-text-hover, #999);
246
+ color: var(--kd-c-city-picker-icon-clear-color-text-hover, var(--kd-g-color-theme, #5582f3));
246
247
  }
247
248
  .kd-city-picker-show-search {
248
249
  cursor: text;
@@ -419,7 +420,7 @@
419
420
  .kd-city-picker-focused {
420
421
  border-color: var(--kd-c-city-picker-color-border-foucs, var(--kd-g-color-theme, #5582f3)) !important;
421
422
  }
422
- .kd-city-picker-focused .kd-city-picker-content-item {
423
+ .kd-city-picker-focused .kd-city-picker-content-item:not(.kd-city-picker-content-item-seleted) {
423
424
  color: var(--kd-c-city-picker-placeholder-color-text, #b2b2b2);
424
425
  }
425
426
  .kd-city-picker-disabled {
@@ -61,6 +61,7 @@
61
61
  top: 0;
62
62
  background: #fff;
63
63
  transition: opacity 0.15s ease;
64
+ font-size: @city-picker-clear-font-size;
64
65
  &:hover {
65
66
  color: @city-picker-g-color-border-hover;
66
67
  }
@@ -297,7 +298,7 @@
297
298
  &-focused {
298
299
  .focusColor();
299
300
 
300
- .@{city-picker-prefix-cls}-content-item {
301
+ .@{city-picker-prefix-cls}-content-item:not(.@{city-picker-prefix-cls}-content-item-seleted) {
301
302
  color: @city-picker-placeholder-color;
302
303
  }
303
304
  }
@@ -17,8 +17,8 @@
17
17
  @city-picker-color-background-disabled: var(~'@{city-picker-custom-prefix}-color-background-disabled', #fff);
18
18
  @city-picker-color-text-disabled: var(~'@{city-picker-custom-prefix}-color-text-disabled', @color-disabled);
19
19
  @city-picker-arrow-icon-color-text-disabled: var(~'@{city-picker-custom-prefix}-arrow-icon-color-text-disabled', #b2b2b2);
20
- @city-picker-clear-color: var(~'@{city-picker-custom-prefix}-icon-clear-color-text', #d9d9d9);
21
- @city-picker-clear-color-hover: var(~'@{city-picker-custom-prefix}-icon-clear-color-text-hover', #999);
20
+ @city-picker-clear-color: var(~'@{city-picker-custom-prefix}-icon-clear-color-text', #666666);
21
+ @city-picker-clear-color-hover: var(~'@{city-picker-custom-prefix}-icon-clear-color-text-hover', @color-theme);
22
22
  @city-picker-list-item-color-selected: var(~'@{city-picker-custom-prefix}-list-item-color-text-selected', @color-theme);
23
23
  @city-picker-highlight-color: var(~'@{city-picker-custom-prefix}-highlight-color-text', @color-theme);
24
24
 
@@ -27,6 +27,7 @@
27
27
  @city-picker-large-font-size: var(~'@{city-picker-custom-prefix}-font-size-large', 16px); // 大号字体
28
28
  @city-picker-middle-font-size: var(~'@{city-picker-custom-prefix}-font-size-middle', 14px); // 中号高度
29
29
  @city-picker-small-font-size: var(~'@{city-picker-custom-prefix}-font-size-small', 12px); // 小号高度
30
+ @city-picker-clear-font-size: var(~'@{city-picker-custom-prefix}-icon-clear-font-size', 16px);
30
31
 
31
32
  // line-height
32
33
  @city-picker-dropdown-line-height: var(~'@{city-picker-custom-prefix}-dropdown-line-height', 22px);