uiw 4.20.0 → 4.21.0

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
@@ -5041,6 +5041,12 @@ a.w-list-item:hover:not(.w-disabled) {
5041
5041
  .w-tree-title > * {
5042
5042
  vertical-align: middle;
5043
5043
  }
5044
+ .w-tree-disabled-mouse {
5045
+ cursor: not-allowed;
5046
+ }
5047
+ .w-tree-disabled-ele {
5048
+ color: #00000040;
5049
+ }
5044
5050
  .w-tree-title.selected {
5045
5051
  background-color: #d5e8fc;
5046
5052
  }
package/dist/uiw.js CHANGED
@@ -325,6 +325,7 @@ __webpack_require__.d(__webpack_exports__, {
325
325
  "Cascader": () => (/* reexport */ react_cascader_esm),
326
326
  "Checkbox": () => (/* reexport */ react_checkbox_esm),
327
327
  "CheckboxGroup": () => (/* reexport */ CheckboxGroup),
328
+ "Circle": () => (/* reexport */ Circle),
328
329
  "Col": () => (/* reexport */ Col),
329
330
  "Collapse": () => (/* reexport */ react_collapse_esm),
330
331
  "CopyToClipboard": () => (/* reexport */ CopyToClipboard),
@@ -353,6 +354,7 @@ __webpack_require__.d(__webpack_exports__, {
353
354
  "LayoutFooter": () => (/* reexport */ LayoutFooter),
354
355
  "LayoutHeader": () => (/* reexport */ LayoutHeader),
355
356
  "LayoutSider": () => (/* reexport */ LayoutSider),
357
+ "Line": () => (/* reexport */ Line),
356
358
  "List": () => (/* reexport */ react_list_esm),
357
359
  "ListItem": () => (/* reexport */ ListItem),
358
360
  "Loader": () => (/* reexport */ react_loader_esm),
@@ -370,10 +372,10 @@ __webpack_require__.d(__webpack_exports__, {
370
372
  "Popover": () => (/* reexport */ Popover),
371
373
  "Portal": () => (/* reexport */ Portal),
372
374
  "Progress": () => (/* reexport */ react_progress_esm),
373
- "Radio": () => (/* reexport */ Radio),
375
+ "Radio": () => (/* reexport */ esm_Radio),
374
376
  "RadioAbstract": () => (/* reexport */ RadioAbstract),
375
377
  "RadioButton": () => (/* reexport */ esm_RadioButton),
376
- "RadioGroup": () => (/* reexport */ RadioGroup),
378
+ "RadioGroup": () => (/* reexport */ esm_RadioGroup),
377
379
  "Rate": () => (/* reexport */ Rate),
378
380
  "Row": () => (/* reexport */ Row_Row),
379
381
  "SearchSelect": () => (/* reexport */ SearchSelect),
@@ -1517,7 +1519,7 @@ function Portal(props) {
1517
1519
  ;// CONCATENATED MODULE: ../react-overlay/esm/index.js
1518
1520
 
1519
1521
 
1520
- var esm_excluded = ["className", "style", "isOpen", "prefixCls", "usePortal", "maskClosable", "backdropProps", "portalProps", "hasBackdrop", "unmountOnExit", "timeout", "transitionName", "onOpening", "onOpened", "onClosing", "onClosed", "onClose", "children", "dialogProps"];
1522
+ var esm_excluded = ["className", "style", "isOpen", "prefixCls", "usePortal", "maskClosable", "backdropProps", "portalProps", "hasBackdrop", "unmountOnExit", "timeout", "transitionName", "onOpening", "onOpened", "onClosing", "onClosed", "onClose", "onEnter", "children", "dialogProps"];
1521
1523
 
1522
1524
  /**
1523
1525
  * Overlay 组件
@@ -1558,6 +1560,7 @@ function Overlay(props) {
1558
1560
  onClosing = noop,
1559
1561
  onClosed = noop,
1560
1562
  onClose = noop,
1563
+ onEnter: _onEnter = noop,
1561
1564
  children,
1562
1565
  dialogProps = {}
1563
1566
  } = props,
@@ -1632,10 +1635,22 @@ function Overlay(props) {
1632
1635
  unmountOnExit: unmountOnExit,
1633
1636
  timeout: timeout,
1634
1637
  in: isOpen,
1635
- onEntering: onOpening,
1636
- onEntered: onOpened,
1637
- onExiting: onClosing,
1638
- onExited: handleClosed
1638
+ onEnter: (_, isAppearing) => {
1639
+ _onEnter(overlay.current, isAppearing);
1640
+ },
1641
+ onEntering: (_, isAppearing) => {
1642
+ onOpening(overlay.current, isAppearing);
1643
+ },
1644
+ onEntered: (_, isAppearing) => {
1645
+ onOpened(overlay.current, isAppearing);
1646
+ },
1647
+ onExiting: () => {
1648
+ onClosing(overlay.current);
1649
+ },
1650
+ onExited: () => {
1651
+ handleClosed(overlay.current);
1652
+ },
1653
+ nodeRef: overlay
1639
1654
  }, otherProps, {
1640
1655
  children: status => {
1641
1656
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
@@ -2335,6 +2350,7 @@ var Breadcrumb = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react
2335
2350
  Breadcrumb.Item = Item;
2336
2351
  /* harmony default export */ const esm_Breadcrumb = (Breadcrumb);
2337
2352
 
2353
+
2338
2354
  ;// CONCATENATED MODULE: ../react-breadcrumb/esm/index.js
2339
2355
 
2340
2356
 
@@ -4581,25 +4597,25 @@ var SubMenu = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_am
4581
4597
  }
4582
4598
 
4583
4599
  function onExit(node) {
4584
- node.style.height = node.scrollHeight + "px";
4600
+ node && (node.style.height = node.scrollHeight + "px");
4585
4601
  setIsOpen(false);
4586
4602
  }
4587
4603
 
4588
4604
  function onExiting(node) {
4589
- node.style.height = '0px';
4605
+ node && (node.style.height = '0px');
4590
4606
  }
4591
4607
 
4592
4608
  function onEnter(node) {
4593
- node.style.height = '1px';
4609
+ node && (node.style.height = '1px');
4594
4610
  setIsOpen(true);
4595
4611
  }
4596
4612
 
4597
4613
  function onEntering(node) {
4598
- node.style.height = node.scrollHeight + "px";
4614
+ node && (node.style.height = node.scrollHeight + "px");
4599
4615
  }
4600
4616
 
4601
4617
  function onEntered(node) {
4602
- node.style.height = 'initial';
4618
+ node && (node.style.height = 'initial');
4603
4619
  }
4604
4620
 
4605
4621
  if (!collapse) {
@@ -5065,11 +5081,12 @@ var RadioAbstract = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_re
5065
5081
 
5066
5082
 
5067
5083
 
5068
- /* harmony default export */ const Radio = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef((props, ref) => {
5084
+ var Radio = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef((props, ref) => {
5069
5085
  return /*#__PURE__*/(0,jsx_runtime.jsx)(RadioAbstract, _extends({
5070
5086
  ref: ref
5071
5087
  }, props));
5072
- }));
5088
+ });
5089
+ /* harmony default export */ const esm_Radio = (Radio);
5073
5090
 
5074
5091
  ;// CONCATENATED MODULE: ../react-radio/esm/style/group.css
5075
5092
  // extracted by mini-css-extract-plugin
@@ -5082,7 +5099,7 @@ var RadioGroup_excluded = ["prefixCls", "className", "name", "value", "onChange"
5082
5099
 
5083
5100
 
5084
5101
 
5085
- /* harmony default export */ const RadioGroup = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef((props, ref) => {
5102
+ var RadioGroup = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef((props, ref) => {
5086
5103
  var {
5087
5104
  prefixCls = 'w-radio-group',
5088
5105
  className,
@@ -5108,7 +5125,8 @@ var RadioGroup_excluded = ["prefixCls", "className", "name", "value", "onChange"
5108
5125
  })
5109
5126
  })
5110
5127
  }));
5111
- }));
5128
+ });
5129
+ /* harmony default export */ const esm_RadioGroup = (RadioGroup);
5112
5130
 
5113
5131
  ;// CONCATENATED MODULE: ../react-radio/esm/RadioButton.js
5114
5132
 
@@ -8225,6 +8243,7 @@ Circle.defaultProps = {
8225
8243
 
8226
8244
  };
8227
8245
 
8246
+
8228
8247
  ;// CONCATENATED MODULE: ../react-progress/esm/style/line.css
8229
8248
  // extracted by mini-css-extract-plugin
8230
8249
  /* harmony default export */ const line = ({});
@@ -8310,6 +8329,7 @@ Line.defaultProps = {
8310
8329
 
8311
8330
  };
8312
8331
 
8332
+
8313
8333
  ;// CONCATENATED MODULE: ../react-progress/esm/index.js
8314
8334
 
8315
8335
 
@@ -8581,6 +8601,9 @@ function SearchSelect(props) {
8581
8601
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
8582
8602
  if (valueVerify(value)) {
8583
8603
  selectedValueChange(value);
8604
+ } else {
8605
+ setSelectedValue([]);
8606
+ setSelectedLabel('');
8584
8607
  }
8585
8608
  }, [JSON.stringify(value)]);
8586
8609
 
@@ -10650,9 +10673,11 @@ var TreeNode_excluded = ["prefixCls", "renderTitle", "icon", "iconAnimation", "i
10650
10673
 
10651
10674
  var Label = _ref => {
10652
10675
  var {
10653
- label
10676
+ label,
10677
+ className
10654
10678
  } = _ref;
10655
10679
  return (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
10680
+ className: className,
10656
10681
  children: label
10657
10682
  }), [label]);
10658
10683
  };
@@ -10675,27 +10700,29 @@ function TreeNode(props) {
10675
10700
  other = _objectWithoutPropertiesLoose(props, TreeNode_excluded);
10676
10701
 
10677
10702
  var isOpen = false;
10703
+ var node = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef(null);
10678
10704
 
10679
10705
  if (parent && (parent.key || parent.key === 0)) {
10680
10706
  isOpen = !!(openKeys && openKeys.indexOf(parent.key) > -1);
10681
10707
  }
10682
10708
 
10683
- var onExit = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(node => {
10684
- node.style.height = node.scrollHeight + "px";
10709
+ var onExit = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(() => {
10710
+ node.current.style.height = node.current.scrollHeight + "px";
10685
10711
  }, []);
10686
- var onExiting = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(node => {
10687
- node.style.height = '1px';
10712
+ var onExiting = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(() => {
10713
+ node.current.style.height = '1px';
10688
10714
  }, []);
10689
- var onEnter = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)((node, isAppearing) => {
10690
- node.style.height = '1px';
10715
+ var onEnter = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(() => {
10716
+ node.current.style.height = '1px';
10691
10717
  }, []);
10692
- var onEntering = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)((node, isAppearing) => {
10693
- node.style.height = node.scrollHeight + "px";
10718
+ var onEntering = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(() => {
10719
+ node.current.style.height = node.current.scrollHeight + "px";
10694
10720
  }, []);
10695
- var onEntered = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)((node, isAppearing) => {
10696
- node.style.height = 'initial';
10721
+ var onEntered = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(() => {
10722
+ node.current.style.height = 'initial';
10697
10723
  }, []);
10698
10724
  return /*#__PURE__*/(0,jsx_runtime.jsx)(esm_CSSTransition, {
10725
+ nodeRef: node,
10699
10726
  classNames: prefixCls,
10700
10727
  in: isOpen,
10701
10728
  timeout: 200,
@@ -10705,6 +10732,7 @@ function TreeNode(props) {
10705
10732
  onEntered: onEntered,
10706
10733
  onEntering: onEntering,
10707
10734
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("ul", {
10735
+ ref: node,
10708
10736
  className: [level !== 1 && isOpen ? [prefixCls + "-open"] : null, level !== 1 && !isOpen ? [prefixCls + "-close"] : null].filter(Boolean).join(' ').trim(),
10709
10737
  children: data.map((item, idx) => {
10710
10738
  item.parent = parent;
@@ -10720,6 +10748,24 @@ function TreeNode(props) {
10720
10748
  var childKeys = noChild ? [] : getChildKeys(item.children);
10721
10749
  var checkedKeys = selectedKeys ? selectedKeys.filter(key => childKeys.indexOf(key) > -1) : [];
10722
10750
  var isHalfChecked = checkedKeys.length > 0 && childKeys.length !== checkedKeys.length;
10751
+ var disabledObj = {
10752
+ onClick: onItemSelected,
10753
+ disabled: null,
10754
+ disabledMouse: null,
10755
+ disabledClass: undefined,
10756
+ disabledStyle: undefined
10757
+ };
10758
+
10759
+ if (item.disabled) {
10760
+ disabledObj.onClick = undefined;
10761
+ disabledObj.disabled = 'disabled';
10762
+ disabledObj.disabledMouse = prefixCls + "-disabled-mouse";
10763
+ disabledObj.disabledClass = prefixCls + "-disabled-ele";
10764
+ disabledObj.disabledStyle = {
10765
+ color: '#00000040'
10766
+ };
10767
+ }
10768
+
10723
10769
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
10724
10770
  style: {
10725
10771
  display: item.hideNode ? 'none' : 'block'
@@ -10737,16 +10783,20 @@ function TreeNode(props) {
10737
10783
  className: [typeof icon === 'function' ? prefixCls + "-switcher-noop" : null, noChild ? 'no-child' : null, !iconAnimation ? 'no-animation' : null, itemIsOpen ? 'open' : null].filter(Boolean).join(' ').trim()
10738
10784
  })
10739
10785
  }), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
10740
- onClick: evn => onItemSelected(item, evn),
10741
- className: [prefixCls + "-title", selected && isSelected ? 'selected' : null, item.disabled ? 'disabled' : null].filter(Boolean).join(' ').trim(),
10786
+ onClick: evn => disabledObj.onClick == null ? void 0 : disabledObj.onClick(item, evn),
10787
+ className: [prefixCls + "-title", selected && isSelected ? 'selected' : null, disabledObj.disabled, disabledObj.disabledMouse].filter(Boolean).join(' ').trim(),
10742
10788
  children: renderTitle ? renderTitle(item, {
10743
10789
  selected,
10744
10790
  noChild,
10745
10791
  openKeys,
10746
10792
  isHalfChecked,
10747
- selectedKeys
10793
+ selectedKeys,
10794
+ disabled: item.disabled,
10795
+ disabledClass: disabledObj.disabledClass,
10796
+ disabledStyle: disabledObj.disabledStyle
10748
10797
  }) : /*#__PURE__*/(0,jsx_runtime.jsx)(Label, {
10749
- label: item.label
10798
+ label: item.label,
10799
+ className: disabledObj.disabledClass
10750
10800
  })
10751
10801
  })]
10752
10802
  }), item.children && /*#__PURE__*/(0,jsx_runtime.jsx)(TreeNode, _extends({}, other, {
@@ -11034,8 +11084,10 @@ function TreeChecked(_ref) {
11034
11084
 
11035
11085
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, {
11036
11086
  children: [/*#__PURE__*/(0,jsx_runtime.jsx)(react_checkbox_esm, _extends({
11037
- className: prefixCls + "-checked"
11087
+ className: prefixCls + "-checked",
11088
+ disabled: node.disabled
11038
11089
  }, checkedProps)), item.label && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
11090
+ className: node.disabledClass,
11039
11091
  children: item.label
11040
11092
  })]
11041
11093
  });