uiw 4.13.9 → 4.13.10

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/uiw.css CHANGED
@@ -3707,6 +3707,7 @@ a.w-list-item:hover:not(.w-disabled) {
3707
3707
  width: 100%;
3708
3708
  border-radius: 100px;
3709
3709
  background-color: #e5e9f2;
3710
+ overflow: hidden;
3710
3711
  }
3711
3712
  .w-progress-bg {
3712
3713
  height: 100%;
package/dist/uiw.js CHANGED
@@ -3091,7 +3091,7 @@ class Popover extends (external_root_React_commonjs2_react_commonjs_react_amd_re
3091
3091
  children: this.props.content
3092
3092
  })]
3093
3093
  }),
3094
- children: typeof this.props.children === 'object' ? this.props.children : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
3094
+ children: typeof this.props.children === 'object' && this.props.children.type.name !== 'Icon' ? this.props.children : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
3095
3095
  children: this.props.children
3096
3096
  })
3097
3097
  }));
@@ -3441,7 +3441,7 @@ function DayRect(props) {
3441
3441
  }
3442
3442
  }
3443
3443
 
3444
- var cellDate = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => new Date(new Date(date).setDate(day)), [day]);
3444
+ var cellDate = new Date(new Date(date).setDate(day));
3445
3445
 
3446
3446
  if (today && today.toDateString() === cellDate.toDateString()) {
3447
3447
  cls.today = true;
@@ -7848,17 +7848,23 @@ function SearchSelect(props) {
7848
7848
  var [selectedValue, setSelectedValue] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)([]);
7849
7849
  var [selectedLabel, setSelectedLabel] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)('');
7850
7850
  var [selectIconType, setSelectIconType] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)('');
7851
+ var inputRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
7851
7852
  var omitTagCount = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => maxTagCount && selectedValue.length > maxTagCount ? selectedValue.length - maxTagCount : 0, [selectedValue.length]);
7852
7853
  var divRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
7854
+
7855
+ var valueVerify = value => {
7856
+ return value !== undefined && value !== '';
7857
+ };
7858
+
7853
7859
  var valueRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
7854
7860
  valueRef.current = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => selectedValue, [selectedValue]);
7855
7861
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
7856
- if (value === undefined && defaultValue !== undefined) {
7862
+ if (!valueVerify(value) && valueVerify(defaultValue)) {
7857
7863
  selectedValueChange(defaultValue);
7858
7864
  }
7859
7865
  }, []);
7860
7866
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
7861
- if (value !== undefined) {
7867
+ if (valueVerify(value)) {
7862
7868
  selectedValueChange(value);
7863
7869
  }
7864
7870
  }, [JSON.stringify(value)]);
@@ -7901,6 +7907,11 @@ function SearchSelect(props) {
7901
7907
  return values;
7902
7908
  }
7903
7909
 
7910
+ var selectedLabelChange = value => {
7911
+ setSelectedLabel(value);
7912
+ showSearch && (onSearch == null ? void 0 : onSearch(value));
7913
+ };
7914
+
7904
7915
  function handleItemClick(item) {
7905
7916
  setInnerIsOpen(false);
7906
7917
  var values = [item];
@@ -7927,7 +7938,7 @@ function SearchSelect(props) {
7927
7938
  function renderSelectIcon(type) {
7928
7939
  var selectIconType;
7929
7940
 
7930
- if (type === 'enter' && allowClear && selectedValue) {
7941
+ if (type === 'enter' && allowClear && (selectedValue.length > 0 || selectedLabel)) {
7931
7942
  selectIconType = 'close';
7932
7943
  } else {
7933
7944
  selectIconType = '';
@@ -7937,20 +7948,23 @@ function SearchSelect(props) {
7937
7948
  } // handle change
7938
7949
 
7939
7950
 
7940
- function handleInputChange(e) {
7941
- var value = e.target.value;
7951
+ function handleInputChange(value) {
7942
7952
  setInnerIsOpen(true);
7943
- setSelectedLabel(value);
7944
- setSelectIconType(showSearch && value ? 'loading' : '');
7945
- showSearch && onSearch && onSearch(value); // handleSelectChange(value);
7953
+ setSelectIconType(showSearch && value ? 'loading' : ''); // setSelectedLabel(value);
7954
+ // showSearch && onSearch && onSearch(value);
7955
+
7956
+ selectedLabelChange(value);
7946
7957
  } // 清除选中的值
7947
7958
 
7948
7959
 
7949
- function resetSelectedValue() {
7950
- setInnerIsOpen(false);
7960
+ function resetSelectedValue(e) {
7961
+ var _inputRef$current;
7962
+
7963
+ e.stopPropagation();
7964
+ (_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.focus();
7951
7965
  setSelectedValue([]);
7952
- setSelectedLabel('');
7953
- setSelectIconType('');
7966
+ handleInputChange('');
7967
+ setInnerIsOpen(false);
7954
7968
  handleSelectChange('', []);
7955
7969
  }
7956
7970
 
@@ -7965,14 +7979,14 @@ function SearchSelect(props) {
7965
7979
  }
7966
7980
  }
7967
7981
 
7968
- function onVisibleChange(open) {
7969
- if (!open) setSelectedLabel('');
7982
+ function onVisibleChange(isOpen) {
7983
+ var selectedValue = valueRef.current;
7984
+ setInnerIsOpen(isOpen);
7985
+ if (!isOpen) selectedLabelChange('');
7970
7986
 
7971
7987
  if (!isMultiple && selectedValue.length > 0) {
7972
7988
  setSelectedLabel(selectedValue[0].label);
7973
7989
  }
7974
-
7975
- setInnerIsOpen(open);
7976
7990
  }
7977
7991
 
7978
7992
  return /*#__PURE__*/(0,jsx_runtime.jsx)(Dropdown, _extends({
@@ -8013,6 +8027,11 @@ function SearchSelect(props) {
8013
8027
  ref: divRef,
8014
8028
  onMouseOver: () => renderSelectIcon('enter'),
8015
8029
  onMouseLeave: () => renderSelectIcon('leave'),
8030
+ onClick: () => {
8031
+ var _inputRef$current2;
8032
+
8033
+ return (_inputRef$current2 = inputRef.current) == null ? void 0 : _inputRef$current2.focus();
8034
+ },
8016
8035
  style: _extends({
8017
8036
  width: '100%',
8018
8037
  maxWidth: 'none'
@@ -8037,7 +8056,10 @@ function SearchSelect(props) {
8037
8056
  color: "#393E48"
8038
8057
  }, tagProps, {
8039
8058
  closable: true,
8040
- onClose: () => handleItemsClick(index, item),
8059
+ onClose: e => {
8060
+ e.stopPropagation();
8061
+ handleItemsClick(index, item);
8062
+ },
8041
8063
  children: item.label
8042
8064
  }), index);
8043
8065
  }), !!omitTagCount && /*#__PURE__*/(0,jsx_runtime.jsxs)(react_tag_esm, {
@@ -8056,9 +8078,10 @@ function SearchSelect(props) {
8056
8078
  className: prefixCls + "-input-contents",
8057
8079
  readOnly: !showSearch,
8058
8080
  size: size,
8081
+ ref: inputRef,
8059
8082
  disabled: disabled,
8060
8083
  onKeyDown: inputKeyDown,
8061
- onChange: handleInputChange,
8084
+ onChange: e => handleInputChange(e.target.value),
8062
8085
  value: selectedLabel,
8063
8086
  placeholder: selectedValue.length ? '' : placeholder
8064
8087
  })]
@@ -8070,8 +8093,9 @@ function SearchSelect(props) {
8070
8093
  }) : /*#__PURE__*/(0,jsx_runtime.jsx)(react_input_esm, {
8071
8094
  readOnly: !showSearch,
8072
8095
  size: size,
8096
+ ref: inputRef,
8073
8097
  disabled: disabled,
8074
- onChange: handleInputChange,
8098
+ onChange: e => handleInputChange(e.target.value),
8075
8099
  value: selectedLabel,
8076
8100
  placeholder: placeholder,
8077
8101
  addonAfter: (selectIconType === 'close' || selectIconType === 'loading' && loading) && /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
@@ -9851,8 +9875,6 @@ function TreeChecked(_ref) {
9851
9875
  ;// CONCATENATED MODULE: ../react-search-tree/esm/SearchTagInput.js
9852
9876
 
9853
9877
 
9854
- var SearchTagInput_excluded = ["prefixCls", "mode", "size", "disabled", "allowClear", "loading", "selectCloseDrop", "className", "style", "placeholder", "content", "options", "values", "onChange", "onSearch", "emptyOption"];
9855
-
9856
9878
 
9857
9879
 
9858
9880
 
@@ -9866,7 +9888,6 @@ var SearchTagInput_excluded = ["prefixCls", "mode", "size", "disabled", "allowCl
9866
9888
  function SearchTagInput(props) {
9867
9889
  var {
9868
9890
  prefixCls = 'w-search-tree',
9869
- mode = 'single',
9870
9891
  size = 'default',
9871
9892
  disabled = false,
9872
9893
  allowClear = false,
@@ -9880,12 +9901,10 @@ function SearchTagInput(props) {
9880
9901
  values,
9881
9902
  onChange,
9882
9903
  onSearch,
9883
- emptyOption
9884
- } = props,
9885
- others = _objectWithoutPropertiesLoose(props, SearchTagInput_excluded);
9886
-
9887
- var cls = [prefixCls, className].filter(Boolean).join(' ').trim(); // const isMultiple = useMemo(() => mode === 'multiple', [mode]);
9904
+ emptyOption // ...others
9888
9905
 
9906
+ } = props;
9907
+ var cls = [prefixCls, className].filter(Boolean).join(' ').trim();
9889
9908
  var [innerIsOpen, setInnerIsOpen] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false);
9890
9909
  var [selectedOption, setSelectedOption] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(values);
9891
9910
  var optionRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
@@ -9932,10 +9951,13 @@ function SearchTagInput(props) {
9932
9951
 
9933
9952
 
9934
9953
  function resetSelectedValue(e) {
9954
+ var _inputRef$current;
9955
+
9935
9956
  e.stopPropagation();
9957
+ (_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.focus();
9958
+ handleInputChange('');
9936
9959
  setInnerIsOpen(false);
9937
9960
  setSelectedOption([]);
9938
- handleInputChange('');
9939
9961
  handleSelectChange([]);
9940
9962
  }
9941
9963
 
@@ -9988,9 +10010,9 @@ function SearchTagInput(props) {
9988
10010
  onMouseOver: () => renderSelectIcon('enter'),
9989
10011
  onMouseLeave: () => renderSelectIcon('leave'),
9990
10012
  onClick: () => {
9991
- var _inputRef$current;
10013
+ var _inputRef$current2;
9992
10014
 
9993
- return (_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.focus();
10015
+ return (_inputRef$current2 = inputRef.current) == null ? void 0 : _inputRef$current2.focus();
9994
10016
  },
9995
10017
  style: _extends({
9996
10018
  minWidth: 200,
@@ -10230,7 +10252,7 @@ function SearchTree(props) {
10230
10252
  selectedOptionSet([...options]);
10231
10253
  var isEmpt = true;
10232
10254
  options.forEach(opt => isEmpt = isEmpt && !!opt.hideNode);
10233
- isEmptySet(isEmpt);
10255
+ isEmptySet(typeof emptyOption === 'boolean' && isEmpt ? isEmpt : emptyOption);
10234
10256
  };
10235
10257
 
10236
10258
  return /*#__PURE__*/(0,jsx_runtime.jsx)(esm_SearchTagInput, _extends({}, other, {