uiw 4.13.7 → 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
@@ -624,7 +624,7 @@
624
624
  }
625
625
 
626
626
  .w-modal {
627
- z-index: 990;
627
+ z-index: 1001;
628
628
  }
629
629
  .w-modal-inner {
630
630
  padding-bottom: 20px;
@@ -2717,6 +2717,10 @@ sup.w-badge-count {
2717
2717
  color: #dc3545;
2718
2718
  }
2719
2719
  .w-form-item-error .w-input-inner,
2720
+ .w-form-item-error .w-select,
2721
+ .w-form-item-error .w-select-default,
2722
+ .w-form-item-error .w-select:hover,
2723
+ .w-form-item-error .w-select-default:hover,
2720
2724
  .w-form-item-error .w-input-inner:hover,
2721
2725
  .w-form-item-error .w-input-inner:focus.w-input-inner:hover,
2722
2726
  .w-form-item-error .w-textarea,
@@ -3703,6 +3707,7 @@ a.w-list-item:hover:not(.w-disabled) {
3703
3707
  width: 100%;
3704
3708
  border-radius: 100px;
3705
3709
  background-color: #e5e9f2;
3710
+ overflow: hidden;
3706
3711
  }
3707
3712
  .w-progress-bg {
3708
3713
  height: 100%;
@@ -4641,10 +4646,22 @@ a.w-list-item:hover:not(.w-disabled) {
4641
4646
 
4642
4647
  .w-tabs-bar {
4643
4648
  position: relative;
4649
+ overflow-x: auto;
4650
+ height: calc(100% + 17px);
4644
4651
  }
4645
4652
  .w-tabs-nav {
4646
4653
  position: relative;
4647
4654
  }
4655
+ .w-tabs-nav-hidden {
4656
+ display: flex;
4657
+ overflow-y: auto;
4658
+ padding: 5px 10px 5px 5px;
4659
+ max-height: 200px;
4660
+ flex-direction: column;
4661
+ }
4662
+ .w-tabs-nav-hidden :hover {
4663
+ background: #d9d9d9;
4664
+ }
4648
4665
  .w-tabs-item {
4649
4666
  padding: 7px 10px;
4650
4667
  display: inline-block;
@@ -4667,6 +4684,12 @@ a.w-list-item:hover:not(.w-disabled) {
4667
4684
  user-select: none;
4668
4685
  color: rgba(0, 0, 0, 0.25);
4669
4686
  }
4687
+ .w-tabs-flow-content {
4688
+ margin-left: 5px;
4689
+ padding: 0px 10px 0px 10px;
4690
+ box-shadow: 1px 0px 0px #d9d9d9 inset;
4691
+ cursor: pointer;
4692
+ }
4670
4693
  .w-tabs-card .w-tabs-nav::after,
4671
4694
  .w-tabs-line .w-tabs-nav::after {
4672
4695
  content: '';
@@ -4771,6 +4794,7 @@ a.w-list-item:hover:not(.w-disabled) {
4771
4794
  background-color: rgba(0, 0, 0, 0.75);
4772
4795
  border-radius: 4px;
4773
4796
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
4797
+ word-break: break-all;
4774
4798
  }
4775
4799
  .w-tooltip.right .w-tooltip-arrow,
4776
4800
  .w-tooltip.rightTop .w-tooltip-arrow,
package/dist/uiw.js CHANGED
@@ -2814,7 +2814,7 @@ var normalizeDelay = delay => delay && typeof delay === 'object' ? delay : {
2814
2814
  } = props,
2815
2815
  other = _objectWithoutPropertiesLoose(props, react_overlay_trigger_esm_excluded);
2816
2816
 
2817
- var zIndex = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(990);
2817
+ var zIndex = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(999);
2818
2818
  var triggerRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
2819
2819
  var popupRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
2820
2820
  var timeoutRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)([]);
@@ -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)]);
@@ -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, {
@@ -9183,8 +9215,11 @@ var react_tabs_esm_excluded = ["prefixCls", "className", "children", "type", "ac
9183
9215
 
9184
9216
 
9185
9217
 
9218
+
9186
9219
  Tabs.Pane = Pane;
9187
9220
  function Tabs(props) {
9221
+ var _flowNav$nav;
9222
+
9188
9223
  var {
9189
9224
  prefixCls = 'w-tabs',
9190
9225
  className,
@@ -9201,6 +9236,71 @@ function Tabs(props) {
9201
9236
  });
9202
9237
  var activeItem = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
9203
9238
  var cls = [prefixCls, className, type ? prefixCls + "-" + type : null].filter(Boolean).join(' ').trim();
9239
+ var [flowNav, flowNavSet] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)({
9240
+ content: 0,
9241
+ nav: [],
9242
+ flowLeft: -1,
9243
+ displayStart: 0,
9244
+ displayEnd: 0
9245
+ });
9246
+ var [hiddenNav, hiddenNavSet] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)([]);
9247
+ var deviation = 15;
9248
+ var [nodes, nodesSet] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)();
9249
+ var divContentRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(node => {
9250
+ if (node !== null) {
9251
+ nodesSet(nodes);
9252
+ node.addEventListener('scroll', e => {
9253
+ var {
9254
+ clientWidth,
9255
+ scrollLeft
9256
+ } = e.target;
9257
+ flowNav.displayStart = scrollLeft;
9258
+ flowNav.displayEnd = clientWidth + scrollLeft;
9259
+ flowNavSet(_extends({}, flowNav));
9260
+ });
9261
+ flowNav.displayEnd = node.getBoundingClientRect().width;
9262
+ flowNavSet(_extends({}, flowNav));
9263
+ }
9264
+ }, []);
9265
+ var divNavRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)((node, key) => {
9266
+ if (node !== null) {
9267
+ node.addEventListener('click', e => {
9268
+ activeItem.current = node;
9269
+ });
9270
+ divNavWidthChange(node.getBoundingClientRect().width, key);
9271
+ }
9272
+ }, []);
9273
+
9274
+ var divNavWidthChange = (width, index) => {
9275
+ var curWidth = 0;
9276
+ flowNav.nav.slice(0, index + 1).forEach(nav => curWidth += nav.width);
9277
+ flowNav.nav[index] = {
9278
+ width,
9279
+ curWidth: Math.floor(curWidth),
9280
+ index
9281
+ };
9282
+ flowNavSet(flowNav);
9283
+ };
9284
+
9285
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
9286
+ showHideenNav();
9287
+ }, [flowNav.displayEnd > ((_flowNav$nav = flowNav.nav[flowNav.nav.length - 1]) == null ? void 0 : _flowNav$nav.curWidth)]);
9288
+
9289
+ var showHideenNav = () => {
9290
+ var hiddenNav = [];
9291
+
9292
+ if (flowNav.nav.length > 0) {
9293
+ flowNav.nav.forEach(item => {
9294
+ var curWidth = item.curWidth - deviation;
9295
+
9296
+ if (curWidth < flowNav.displayStart || curWidth > flowNav.displayEnd) {
9297
+ hiddenNav.push(item.index);
9298
+ }
9299
+ });
9300
+ hiddenNavSet(hiddenNav);
9301
+ }
9302
+ };
9303
+
9204
9304
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => setActiveKey(props.activeKey), [props.activeKey]);
9205
9305
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => calcSlideStyle(), [activeKey]);
9206
9306
 
@@ -9217,38 +9317,42 @@ function Tabs(props) {
9217
9317
  className: cls
9218
9318
  }, elementProps, {
9219
9319
  children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
9220
- className: prefixCls + "-bar",
9320
+ style: {
9321
+ display: 'flex'
9322
+ },
9221
9323
  children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
9222
- className: prefixCls + "-nav",
9223
- children: external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.map(children, (item, key) => {
9224
- if (!item) {
9225
- return null;
9226
- }
9227
-
9228
- var divProps = {
9229
- className: [prefixCls + "-item", item.key === activeKey ? 'active' : null, item.props.disabled ? 'disabled' : null].filter(Boolean).join(' ').trim(),
9230
- children: item.props.label
9231
- };
9232
-
9233
- if (!item.props.disabled) {
9234
- divProps.onClick = e => {
9235
- setActiveKey(item.key);
9236
- onTabClick && onTabClick(item.key, item, e);
9237
- calcSlideStyle();
9238
- };
9239
- }
9240
-
9241
- return /*#__PURE__*/(0,jsx_runtime.jsx)("div", _extends({
9242
- ref: node => {
9243
- if (node && item.key === activeKey) {
9244
- activeItem.current = node;
9245
- }
9246
- }
9247
- }, divProps), key);
9324
+ style: {
9325
+ overflow: 'hidden'
9326
+ },
9327
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
9328
+ className: prefixCls + "-bar",
9329
+ ref: divContentRef,
9330
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
9331
+ className: prefixCls + "-nav",
9332
+ style: {
9333
+ width: 'max-content'
9334
+ },
9335
+ children: renderNav(children)
9336
+ })
9248
9337
  })
9249
9338
  }), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
9250
9339
  style: slideStyle,
9251
9340
  className: prefixCls + "-slide"
9341
+ }), hiddenNav.length > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(Popover, {
9342
+ trigger: "click",
9343
+ placement: "bottomRight",
9344
+ visibleArrow: false,
9345
+ content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
9346
+ className: prefixCls + "-nav-hidden",
9347
+ children: renderNav(hiddenNav.map(idx => children[idx]))
9348
+ }),
9349
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
9350
+ onClick: showHideenNav,
9351
+ className: prefixCls + "-flow-content",
9352
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
9353
+ children: "\u2026"
9354
+ })
9355
+ })
9252
9356
  })]
9253
9357
  }), external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.map(children, item => {
9254
9358
  if (!item || activeKey !== item.key) {
@@ -9258,6 +9362,31 @@ function Tabs(props) {
9258
9362
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(item, Object.assign({}, item.props, {}));
9259
9363
  })]
9260
9364
  }));
9365
+
9366
+ function renderNav(children) {
9367
+ return external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.map(children, (item, key) => {
9368
+ if (!item) {
9369
+ return null;
9370
+ }
9371
+
9372
+ var divProps = {
9373
+ className: [prefixCls + "-item", item.key === activeKey ? 'active' : null, item.props.disabled ? 'disabled' : null].filter(Boolean).join(' ').trim(),
9374
+ children: item.props.label
9375
+ };
9376
+
9377
+ if (!item.props.disabled) {
9378
+ divProps.onClick = e => {
9379
+ setActiveKey(item.key);
9380
+ onTabClick && onTabClick(item.key, item, e);
9381
+ calcSlideStyle();
9382
+ };
9383
+ }
9384
+
9385
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("div", _extends({
9386
+ ref: _ref => divNavRef(_ref, key)
9387
+ }, divProps), key);
9388
+ });
9389
+ }
9261
9390
  }
9262
9391
 
9263
9392
  ;// CONCATENATED MODULE: ../react-textarea/esm/style/index.css
@@ -9379,7 +9508,7 @@ function TreeNode(props) {
9379
9508
 
9380
9509
  var isOpen = false;
9381
9510
 
9382
- if (parent && parent.key) {
9511
+ if (parent && (parent.key || parent.key === 0)) {
9383
9512
  isOpen = !!(openKeys && openKeys.indexOf(parent.key) > -1);
9384
9513
  }
9385
9514
 
@@ -9476,7 +9605,7 @@ function TreeNode(props) {
9476
9605
  ;// CONCATENATED MODULE: ../react-tree/esm/index.js
9477
9606
 
9478
9607
 
9479
- var react_tree_esm_excluded = ["prefixCls", "icon", "data", "openKeys", "selectedKeys", "defaultExpandAll", "showLine", "iconAnimation", "isSelected", "checkStrictly", "multiple", "onExpand", "onSelected", "className", "autoExpandParent", "renderTitle", "onChange"];
9608
+ var react_tree_esm_excluded = ["prefixCls", "icon", "data", "openKeys", "selectedKeys", "defaultExpandAll", "showLine", "iconAnimation", "isSelected", "checkStrictly", "multiple", "onExpand", "onSelected", "className", "autoExpandParent", "renderTitle", "onChange", "value"];
9480
9609
 
9481
9610
 
9482
9611
 
@@ -9592,20 +9721,16 @@ function Tree(props) {
9592
9721
  className,
9593
9722
  autoExpandParent = true,
9594
9723
  renderTitle,
9595
- onChange
9724
+ onChange,
9725
+ value
9596
9726
  } = props,
9597
9727
  elementProps = _objectWithoutPropertiesLoose(props, react_tree_esm_excluded);
9598
9728
 
9599
9729
  var [curOpenKeys, setCurOpenKeys] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(openKeys);
9600
- var [curSelectedKeys, setCurSelectedKeys] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(props.value || selectedKeys);
9730
+ var [curSelectedKeys, setCurSelectedKeys] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(value || selectedKeys);
9601
9731
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
9602
- setCurSelectedKeys(props.selectedKeys || []);
9603
- }, [JSON.stringify(props.selectedKeys)]);
9604
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
9605
- setCurSelectedKeys(props.value || []);
9606
- }, [JSON.stringify(props.value)]); // useEffect(() => setCurOpenKeys(openKeys), [openKeys]);
9607
- // useEffect(() => setCurSelectedKeys(selectedKeys), [selectedKeys]);
9608
-
9732
+ setCurSelectedKeys(props.value || props.selectedKeys || []);
9733
+ }, [JSON.stringify(props.selectedKeys), JSON.stringify(props.value)]);
9609
9734
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
9610
9735
  var arrOpenKeys = [...curOpenKeys];
9611
9736
 
@@ -9650,7 +9775,7 @@ function Tree(props) {
9650
9775
  var findKey = selKeys.find(v => v === item.key);
9651
9776
  var selected = false;
9652
9777
 
9653
- if (!findKey) {
9778
+ if (!findKey && findKey !== 0) {
9654
9779
  selected = true;
9655
9780
  selKeys.push(item.key);
9656
9781
  } else {
@@ -9674,7 +9799,7 @@ function Tree(props) {
9674
9799
 
9675
9800
  setCurSelectedKeys(selKeys);
9676
9801
  onSelected && onSelected(selKeys, item.key, selected, item, evn);
9677
- onChange == null ? void 0 : onChange(selKeys);
9802
+ onChange == null ? void 0 : onChange(item.key, selKeys);
9678
9803
  }
9679
9804
 
9680
9805
  return /*#__PURE__*/(0,jsx_runtime.jsx)("div", _extends({
@@ -9750,8 +9875,6 @@ function TreeChecked(_ref) {
9750
9875
  ;// CONCATENATED MODULE: ../react-search-tree/esm/SearchTagInput.js
9751
9876
 
9752
9877
 
9753
- var SearchTagInput_excluded = ["prefixCls", "mode", "size", "disabled", "allowClear", "loading", "className", "style", "placeholder", "content", "options", "values", "onChange", "onSearch", "emptyOption"];
9754
-
9755
9878
 
9756
9879
 
9757
9880
 
@@ -9765,11 +9888,11 @@ var SearchTagInput_excluded = ["prefixCls", "mode", "size", "disabled", "allowCl
9765
9888
  function SearchTagInput(props) {
9766
9889
  var {
9767
9890
  prefixCls = 'w-search-tree',
9768
- mode = 'single',
9769
9891
  size = 'default',
9770
9892
  disabled = false,
9771
9893
  allowClear = false,
9772
9894
  loading = false,
9895
+ selectCloseDrop = false,
9773
9896
  className,
9774
9897
  style,
9775
9898
  placeholder,
@@ -9778,12 +9901,10 @@ function SearchTagInput(props) {
9778
9901
  values,
9779
9902
  onChange,
9780
9903
  onSearch,
9781
- emptyOption
9782
- } = props,
9783
- others = _objectWithoutPropertiesLoose(props, SearchTagInput_excluded);
9784
-
9785
- var cls = [prefixCls, className].filter(Boolean).join(' ').trim(); // const isMultiple = useMemo(() => mode === 'multiple', [mode]);
9904
+ emptyOption // ...others
9786
9905
 
9906
+ } = props;
9907
+ var cls = [prefixCls, className].filter(Boolean).join(' ').trim();
9787
9908
  var [innerIsOpen, setInnerIsOpen] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false);
9788
9909
  var [selectedOption, setSelectedOption] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(values);
9789
9910
  var optionRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
@@ -9806,7 +9927,8 @@ function SearchTagInput(props) {
9806
9927
  }
9807
9928
 
9808
9929
  setSelectedOption(selectedAll);
9809
- onChange && onChange(selectedAll, selectd, isChecked);
9930
+ searchValueChange('');
9931
+ onChange == null ? void 0 : onChange(selectedAll, selectd, isChecked);
9810
9932
  };
9811
9933
 
9812
9934
  var removeSelectItem = index => {
@@ -9817,17 +9939,25 @@ function SearchTagInput(props) {
9817
9939
  };
9818
9940
 
9819
9941
  function handleInputChange(value) {
9942
+ setInnerIsOpen(true);
9943
+ searchValueChange(value);
9944
+ setSelectIconType(value ? 'loading' : '');
9945
+ }
9946
+
9947
+ var searchValueChange = value => {
9820
9948
  searchValueSet(value);
9821
9949
  onSearch == null ? void 0 : onSearch(value);
9822
- setSelectIconType(value ? 'loading' : '');
9823
- } // 清除选中的值
9950
+ }; // 清除选中的值
9824
9951
 
9825
9952
 
9826
9953
  function resetSelectedValue(e) {
9954
+ var _inputRef$current;
9955
+
9827
9956
  e.stopPropagation();
9957
+ (_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.focus();
9958
+ handleInputChange('');
9828
9959
  setInnerIsOpen(false);
9829
9960
  setSelectedOption([]);
9830
- handleInputChange('');
9831
9961
  handleSelectChange([]);
9832
9962
  }
9833
9963
 
@@ -9848,17 +9978,27 @@ function SearchTagInput(props) {
9848
9978
  }
9849
9979
 
9850
9980
  var newProps = _extends({}, content.props, {
9851
- onSelected: handleSelectChange,
9981
+ onSelected: function onSelected(selectedAll, selectd, isChecked) {
9982
+ if (isChecked === void 0) {
9983
+ isChecked = true;
9984
+ }
9985
+
9986
+ setInnerIsOpen(!selectCloseDrop);
9987
+ handleSelectChange(selectedAll, selectd, isChecked);
9988
+ },
9852
9989
  values: selectedOption,
9853
9990
  options
9854
9991
  });
9855
9992
 
9856
9993
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(content, newProps);
9857
9994
  }, [JSON.parse(JSON.stringify(selectedOption)), options, emptyOption]);
9858
- return /*#__PURE__*/(0,jsx_runtime.jsx)(Dropdown, _extends({
9995
+ return /*#__PURE__*/(0,jsx_runtime.jsx)(Dropdown, {
9859
9996
  className: cls,
9860
- trigger: "focus"
9861
- }, others, {
9997
+ trigger: "click",
9998
+ onVisibleChange: isOpen => {
9999
+ setInnerIsOpen(isOpen);
10000
+ if (!isOpen) searchValueChange('');
10001
+ },
9862
10002
  isOpen: innerIsOpen,
9863
10003
  menu: /*#__PURE__*/(0,jsx_runtime.jsx)(react_card_esm, {
9864
10004
  bodyStyle: emptyOption === true ? {
@@ -9870,9 +10010,9 @@ function SearchTagInput(props) {
9870
10010
  onMouseOver: () => renderSelectIcon('enter'),
9871
10011
  onMouseLeave: () => renderSelectIcon('leave'),
9872
10012
  onClick: () => {
9873
- var _inputRef$current;
10013
+ var _inputRef$current2;
9874
10014
 
9875
- return (_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.focus();
10015
+ return (_inputRef$current2 = inputRef.current) == null ? void 0 : _inputRef$current2.focus();
9876
10016
  },
9877
10017
  style: _extends({
9878
10018
  minWidth: 200,
@@ -9931,7 +10071,7 @@ function SearchTagInput(props) {
9931
10071
  })]
9932
10072
  })
9933
10073
  })
9934
- }));
10074
+ });
9935
10075
  }
9936
10076
 
9937
10077
  /* harmony default export */ const esm_SearchTagInput = (SearchTagInput);
@@ -9962,12 +10102,14 @@ function TreeCheckeds(props) {
9962
10102
  keysSet(keys || []);
9963
10103
  }, [props.values]);
9964
10104
 
9965
- var onSelected = (_1, _2, isChecked, evn) => {
10105
+ var onSelected = (_, item, isChecked, evn) => {
9966
10106
  var curSelectOption = getOptionsRecursion([evn], selectOption, isChecked);
10107
+ var isNumberKey = false;
10108
+ if (typeof item === 'number') isNumberKey = true;
9967
10109
  var option = Object.entries(curSelectOption).map(_ref => {
9968
10110
  var [key, label] = _ref;
9969
10111
  return {
9970
- key,
10112
+ key: isNumberKey ? Number.parseInt(key) : key,
9971
10113
  label
9972
10114
  };
9973
10115
  });
@@ -10036,7 +10178,7 @@ function SingeTree(props) {
10036
10178
  key,
10037
10179
  label
10038
10180
  };
10039
- props.onSelected == null ? void 0 : props.onSelected([cur], cur, isChecked);
10181
+ props.onSelected == null ? void 0 : props.onSelected(isChecked ? [cur] : [], cur, isChecked);
10040
10182
  };
10041
10183
 
10042
10184
  return /*#__PURE__*/(0,jsx_runtime.jsx)(Tree, _extends({
@@ -10110,12 +10252,13 @@ function SearchTree(props) {
10110
10252
  selectedOptionSet([...options]);
10111
10253
  var isEmpt = true;
10112
10254
  options.forEach(opt => isEmpt = isEmpt && !!opt.hideNode);
10113
- isEmptySet(isEmpt);
10255
+ isEmptySet(typeof emptyOption === 'boolean' && isEmpt ? isEmpt : emptyOption);
10114
10256
  };
10115
10257
 
10116
10258
  return /*#__PURE__*/(0,jsx_runtime.jsx)(esm_SearchTagInput, _extends({}, other, {
10117
10259
  emptyOption: isEmpty,
10118
- onSearch: debounce(selectedSearch, 600),
10260
+ selectCloseDrop: !multiple,
10261
+ onSearch: selectedSearch,
10119
10262
  onChange: selectedChange,
10120
10263
  values: selectedValues,
10121
10264
  options: selectedOptions,