uiw 4.13.8 → 4.13.11

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%;
@@ -4653,11 +4654,14 @@ a.w-list-item:hover:not(.w-disabled) {
4653
4654
  }
4654
4655
  .w-tabs-nav-hidden {
4655
4656
  display: flex;
4656
- overflow-x: scroll;
4657
- padding: 5px 30px 5px 5px;
4657
+ overflow-y: auto;
4658
+ padding: 5px 10px 5px 5px;
4658
4659
  max-height: 200px;
4659
4660
  flex-direction: column;
4660
4661
  }
4662
+ .w-tabs-nav-hidden :hover {
4663
+ background: #d9d9d9;
4664
+ }
4661
4665
  .w-tabs-item {
4662
4666
  padding: 7px 10px;
4663
4667
  display: inline-block;
package/dist/uiw.js CHANGED
@@ -381,7 +381,7 @@ __webpack_require__.d(__webpack_exports__, {
381
381
  "Steps": () => (/* reexport */ react_steps_esm),
382
382
  "SubMenu": () => (/* reexport */ SubMenu),
383
383
  "Switch": () => (/* reexport */ react_switch_esm),
384
- "Table": () => (/* reexport */ react_table_esm),
384
+ "Table": () => (/* reexport */ Table),
385
385
  "Tabs": () => (/* reexport */ Tabs),
386
386
  "Tag": () => (/* reexport */ react_tag_esm),
387
387
  "Textarea": () => (/* reexport */ react_textarea_esm),
@@ -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;
@@ -3734,7 +3734,7 @@ function DatePicker(props) {
3734
3734
 
3735
3735
  setType(curType);
3736
3736
  } else {
3737
- var currentDate = new Date(selectDate || selectPanelDate);
3737
+ var currentDate = new Date(selectPanelDate);
3738
3738
  var month = currentDate.getMonth();
3739
3739
 
3740
3740
  if (curType === 'prev') {
@@ -3752,7 +3752,7 @@ function DatePicker(props) {
3752
3752
  }
3753
3753
 
3754
3754
  setSelectPanelDate(curType === 'today' ? today : currentDate);
3755
- setSelectDate(curType === 'today' ? today : currentDate);
3755
+ curType === 'today' && setSelectDate(today);
3756
3756
  setType('day');
3757
3757
  }
3758
3758
  }
@@ -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)]);
@@ -7890,6 +7896,7 @@ function SearchSelect(props) {
7890
7896
  }
7891
7897
  }
7892
7898
 
7899
+ if (!isMultiple && opts.length > 0) setSelectedLabel(opts[0].label || '');
7893
7900
  setSelectedValue(opts);
7894
7901
  }
7895
7902
 
@@ -7900,6 +7907,11 @@ function SearchSelect(props) {
7900
7907
  return values;
7901
7908
  }
7902
7909
 
7910
+ var selectedLabelChange = value => {
7911
+ setSelectedLabel(value);
7912
+ showSearch && (onSearch == null ? void 0 : onSearch(value));
7913
+ };
7914
+
7903
7915
  function handleItemClick(item) {
7904
7916
  setInnerIsOpen(false);
7905
7917
  var values = [item];
@@ -7915,6 +7927,7 @@ function SearchSelect(props) {
7915
7927
  }
7916
7928
 
7917
7929
  function handleChange(resultValue, values) {
7930
+ setSelectedLabel('');
7918
7931
  onSelect && onSelect(resultValue);
7919
7932
  handleSelectChange(resultValue, values); // 支持form组件
7920
7933
 
@@ -7925,8 +7938,7 @@ function SearchSelect(props) {
7925
7938
  function renderSelectIcon(type) {
7926
7939
  var selectIconType;
7927
7940
 
7928
- if (type === 'enter' && allowClear && selectedValue) {
7929
- console.log(123);
7941
+ if (type === 'enter' && allowClear && (selectedValue.length > 0 || selectedLabel)) {
7930
7942
  selectIconType = 'close';
7931
7943
  } else {
7932
7944
  selectIconType = '';
@@ -7936,20 +7948,23 @@ function SearchSelect(props) {
7936
7948
  } // handle change
7937
7949
 
7938
7950
 
7939
- function handleInputChange(e) {
7940
- var value = e.target.value;
7941
- setInnerIsOpen(!!value);
7942
- setSelectedLabel(value);
7943
- setSelectIconType(showSearch && value ? 'loading' : '');
7944
- showSearch && onSearch && onSearch(value); // handleSelectChange(value);
7951
+ function handleInputChange(value) {
7952
+ setInnerIsOpen(true);
7953
+ setSelectIconType(showSearch && value ? 'loading' : ''); // setSelectedLabel(value);
7954
+ // showSearch && onSearch && onSearch(value);
7955
+
7956
+ selectedLabelChange(value);
7945
7957
  } // 清除选中的值
7946
7958
 
7947
7959
 
7948
- function resetSelectedValue() {
7949
- 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();
7950
7965
  setSelectedValue([]);
7951
- setSelectedLabel('');
7952
- setSelectIconType('');
7966
+ handleInputChange('');
7967
+ setInnerIsOpen(false);
7953
7968
  handleSelectChange('', []);
7954
7969
  }
7955
7970
 
@@ -7964,18 +7979,25 @@ function SearchSelect(props) {
7964
7979
  }
7965
7980
  }
7966
7981
 
7982
+ function onVisibleChange(isOpen) {
7983
+ var selectedValue = valueRef.current;
7984
+ setInnerIsOpen(isOpen);
7985
+ if (!isOpen) selectedLabelChange('');
7986
+
7987
+ if (!isMultiple && selectedValue.length > 0) {
7988
+ setSelectedLabel(selectedValue[0].label);
7989
+ }
7990
+ }
7991
+
7967
7992
  return /*#__PURE__*/(0,jsx_runtime.jsx)(Dropdown, _extends({
7968
7993
  className: cls,
7969
- trigger: "focus",
7994
+ trigger: "click",
7970
7995
  style: {
7971
7996
  marginTop: 5
7972
7997
  },
7973
7998
  disabled: option && option.length > 0 ? false : true
7974
7999
  }, others, {
7975
- onVisibleChange: open => {
7976
- if (!open && isMultiple) setSelectedLabel('');
7977
- setInnerIsOpen(open);
7978
- },
8000
+ onVisibleChange: onVisibleChange,
7979
8001
  isOpen: innerIsOpen,
7980
8002
  menu: /*#__PURE__*/(0,jsx_runtime.jsx)(react_menu_esm, {
7981
8003
  bordered: true,
@@ -8005,6 +8027,11 @@ function SearchSelect(props) {
8005
8027
  ref: divRef,
8006
8028
  onMouseOver: () => renderSelectIcon('enter'),
8007
8029
  onMouseLeave: () => renderSelectIcon('leave'),
8030
+ onClick: () => {
8031
+ var _inputRef$current2;
8032
+
8033
+ return (_inputRef$current2 = inputRef.current) == null ? void 0 : _inputRef$current2.focus();
8034
+ },
8008
8035
  style: _extends({
8009
8036
  width: '100%',
8010
8037
  maxWidth: 'none'
@@ -8029,7 +8056,10 @@ function SearchSelect(props) {
8029
8056
  color: "#393E48"
8030
8057
  }, tagProps, {
8031
8058
  closable: true,
8032
- onClose: () => handleItemsClick(index, item),
8059
+ onClose: e => {
8060
+ e.stopPropagation();
8061
+ handleItemsClick(index, item);
8062
+ },
8033
8063
  children: item.label
8034
8064
  }), index);
8035
8065
  }), !!omitTagCount && /*#__PURE__*/(0,jsx_runtime.jsxs)(react_tag_esm, {
@@ -8048,9 +8078,10 @@ function SearchSelect(props) {
8048
8078
  className: prefixCls + "-input-contents",
8049
8079
  readOnly: !showSearch,
8050
8080
  size: size,
8081
+ ref: inputRef,
8051
8082
  disabled: disabled,
8052
8083
  onKeyDown: inputKeyDown,
8053
- onChange: handleInputChange,
8084
+ onChange: e => handleInputChange(e.target.value),
8054
8085
  value: selectedLabel,
8055
8086
  placeholder: selectedValue.length ? '' : placeholder
8056
8087
  })]
@@ -8062,8 +8093,9 @@ function SearchSelect(props) {
8062
8093
  }) : /*#__PURE__*/(0,jsx_runtime.jsx)(react_input_esm, {
8063
8094
  readOnly: !showSearch,
8064
8095
  size: size,
8096
+ ref: inputRef,
8065
8097
  disabled: disabled,
8066
- onChange: handleInputChange,
8098
+ onChange: e => handleInputChange(e.target.value),
8067
8099
  value: selectedLabel,
8068
8100
  placeholder: placeholder,
8069
8101
  addonAfter: (selectIconType === 'close' || selectIconType === 'loading' && loading) && /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
@@ -8828,7 +8860,7 @@ var Thead_excluded = ["prefixCls", "className", "data", "onCellHead"],
8828
8860
 
8829
8861
 
8830
8862
 
8831
- /* harmony default export */ const Thead = (function (props) {
8863
+ function TheadComponent(props) {
8832
8864
  if (props === void 0) {
8833
8865
  props = {};
8834
8866
  }
@@ -8870,7 +8902,7 @@ var Thead_excluded = ["prefixCls", "className", "data", "onCellHead"],
8870
8902
  })
8871
8903
  }, rowNum))
8872
8904
  }));
8873
- });
8905
+ }
8874
8906
 
8875
8907
  ;// CONCATENATED MODULE: ../react-table/esm/util.js
8876
8908
  /**
@@ -8932,7 +8964,7 @@ function getRowspanNum(data, child) {
8932
8964
  * JSON Array => Array
8933
8965
  * @param {Array} date
8934
8966
  */
8935
- var getLevelItems = (data, result) => {
8967
+ function getLevelItems(data, result) {
8936
8968
  if (!result) {
8937
8969
  result = {
8938
8970
  header: [],
@@ -9012,13 +9044,13 @@ var getLevelItems = (data, result) => {
9012
9044
  }
9013
9045
 
9014
9046
  return result;
9015
- };
9047
+ }
9016
9048
  /**
9017
9049
  * Get all columns keys
9018
9050
  * @param {Array} data
9019
9051
  */
9020
9052
 
9021
- var getAllColumnsKeys = function getAllColumnsKeys(data, keys) {
9053
+ function getAllColumnsKeys(data, keys) {
9022
9054
  if (keys === void 0) {
9023
9055
  keys = [];
9024
9056
  }
@@ -9032,7 +9064,7 @@ var getAllColumnsKeys = function getAllColumnsKeys(data, keys) {
9032
9064
  }
9033
9065
 
9034
9066
  return keys;
9035
- };
9067
+ }
9036
9068
 
9037
9069
  ;// CONCATENATED MODULE: ../react-table/esm/index.js
9038
9070
 
@@ -9046,7 +9078,7 @@ var react_table_esm_excluded = ["prefixCls", "className", "columns", "data", "ti
9046
9078
 
9047
9079
 
9048
9080
 
9049
- /* harmony default export */ const react_table_esm = (function (props) {
9081
+ function Table(props) {
9050
9082
  if (props === void 0) {
9051
9083
  props = {};
9052
9084
  }
@@ -9085,7 +9117,7 @@ var react_table_esm_excluded = ["prefixCls", "className", "columns", "data", "ti
9085
9117
  } : {},
9086
9118
  children: [title && /*#__PURE__*/(0,jsx_runtime.jsx)("caption", {
9087
9119
  children: title
9088
- }), columns && columns.length > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(Thead, {
9120
+ }), columns && columns.length > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(TheadComponent, {
9089
9121
  onCellHead: onCellHead,
9090
9122
  data: header
9091
9123
  }), data && data.length > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)("tbody", {
@@ -9146,7 +9178,7 @@ var react_table_esm_excluded = ["prefixCls", "className", "columns", "data", "ti
9146
9178
  children: footer
9147
9179
  })]
9148
9180
  });
9149
- });
9181
+ }
9150
9182
 
9151
9183
  ;// CONCATENATED MODULE: ../react-tabs/esm/Pane.js
9152
9184
 
@@ -9476,7 +9508,7 @@ function TreeNode(props) {
9476
9508
 
9477
9509
  var isOpen = false;
9478
9510
 
9479
- if (parent && parent.key) {
9511
+ if (parent && (parent.key || parent.key === 0)) {
9480
9512
  isOpen = !!(openKeys && openKeys.indexOf(parent.key) > -1);
9481
9513
  }
9482
9514
 
@@ -9767,7 +9799,7 @@ function Tree(props) {
9767
9799
 
9768
9800
  setCurSelectedKeys(selKeys);
9769
9801
  onSelected && onSelected(selKeys, item.key, selected, item, evn);
9770
- onChange == null ? void 0 : onChange(selKeys);
9802
+ onChange == null ? void 0 : onChange(item.key, selKeys);
9771
9803
  }
9772
9804
 
9773
9805
  return /*#__PURE__*/(0,jsx_runtime.jsx)("div", _extends({
@@ -9843,8 +9875,6 @@ function TreeChecked(_ref) {
9843
9875
  ;// CONCATENATED MODULE: ../react-search-tree/esm/SearchTagInput.js
9844
9876
 
9845
9877
 
9846
- var SearchTagInput_excluded = ["prefixCls", "mode", "size", "disabled", "allowClear", "loading", "selectCloseDrop", "className", "style", "placeholder", "content", "options", "values", "onChange", "onSearch", "emptyOption"];
9847
-
9848
9878
 
9849
9879
 
9850
9880
 
@@ -9858,7 +9888,6 @@ var SearchTagInput_excluded = ["prefixCls", "mode", "size", "disabled", "allowCl
9858
9888
  function SearchTagInput(props) {
9859
9889
  var {
9860
9890
  prefixCls = 'w-search-tree',
9861
- mode = 'single',
9862
9891
  size = 'default',
9863
9892
  disabled = false,
9864
9893
  allowClear = false,
@@ -9872,12 +9901,10 @@ function SearchTagInput(props) {
9872
9901
  values,
9873
9902
  onChange,
9874
9903
  onSearch,
9875
- emptyOption
9876
- } = props,
9877
- others = _objectWithoutPropertiesLoose(props, SearchTagInput_excluded);
9878
-
9879
- var cls = [prefixCls, className].filter(Boolean).join(' ').trim(); // const isMultiple = useMemo(() => mode === 'multiple', [mode]);
9904
+ emptyOption // ...others
9880
9905
 
9906
+ } = props;
9907
+ var cls = [prefixCls, className].filter(Boolean).join(' ').trim();
9881
9908
  var [innerIsOpen, setInnerIsOpen] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false);
9882
9909
  var [selectedOption, setSelectedOption] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(values);
9883
9910
  var optionRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
@@ -9924,10 +9951,13 @@ function SearchTagInput(props) {
9924
9951
 
9925
9952
 
9926
9953
  function resetSelectedValue(e) {
9954
+ var _inputRef$current;
9955
+
9927
9956
  e.stopPropagation();
9957
+ (_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.focus();
9958
+ handleInputChange('');
9928
9959
  setInnerIsOpen(false);
9929
9960
  setSelectedOption([]);
9930
- handleInputChange('');
9931
9961
  handleSelectChange([]);
9932
9962
  }
9933
9963
 
@@ -9961,7 +9991,7 @@ function SearchTagInput(props) {
9961
9991
  });
9962
9992
 
9963
9993
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(content, newProps);
9964
- }, [JSON.stringify(selectedOption), options, emptyOption]);
9994
+ }, [JSON.parse(JSON.stringify(selectedOption)), options, emptyOption]);
9965
9995
  return /*#__PURE__*/(0,jsx_runtime.jsx)(Dropdown, {
9966
9996
  className: cls,
9967
9997
  trigger: "click",
@@ -9980,9 +10010,9 @@ function SearchTagInput(props) {
9980
10010
  onMouseOver: () => renderSelectIcon('enter'),
9981
10011
  onMouseLeave: () => renderSelectIcon('leave'),
9982
10012
  onClick: () => {
9983
- var _inputRef$current;
10013
+ var _inputRef$current2;
9984
10014
 
9985
- return (_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.focus();
10015
+ return (_inputRef$current2 = inputRef.current) == null ? void 0 : _inputRef$current2.focus();
9986
10016
  },
9987
10017
  style: _extends({
9988
10018
  minWidth: 200,
@@ -10072,12 +10102,14 @@ function TreeCheckeds(props) {
10072
10102
  keysSet(keys || []);
10073
10103
  }, [props.values]);
10074
10104
 
10075
- var onSelected = (_1, _2, isChecked, evn) => {
10105
+ var onSelected = (_, item, isChecked, evn) => {
10076
10106
  var curSelectOption = getOptionsRecursion([evn], selectOption, isChecked);
10107
+ var isNumberKey = false;
10108
+ if (typeof item === 'number') isNumberKey = true;
10077
10109
  var option = Object.entries(curSelectOption).map(_ref => {
10078
10110
  var [key, label] = _ref;
10079
10111
  return {
10080
- key,
10112
+ key: isNumberKey ? Number.parseInt(key) : key,
10081
10113
  label
10082
10114
  };
10083
10115
  });
@@ -10220,7 +10252,7 @@ function SearchTree(props) {
10220
10252
  selectedOptionSet([...options]);
10221
10253
  var isEmpt = true;
10222
10254
  options.forEach(opt => isEmpt = isEmpt && !!opt.hideNode);
10223
- isEmptySet(isEmpt);
10255
+ isEmptySet(typeof emptyOption === 'boolean' && isEmpt ? isEmpt : emptyOption);
10224
10256
  };
10225
10257
 
10226
10258
  return /*#__PURE__*/(0,jsx_runtime.jsx)(esm_SearchTagInput, _extends({}, other, {