uiw 4.20.0 → 4.21.2

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", "onExiting", "onEntering", "onEntered", "onExit", "children", "dialogProps"];
1521
1523
 
1522
1524
  /**
1523
1525
  * Overlay 组件
@@ -1558,6 +1560,11 @@ function Overlay(props) {
1558
1560
  onClosing = noop,
1559
1561
  onClosed = noop,
1560
1562
  onClose = noop,
1563
+ onEnter: _onEnter = noop,
1564
+ onExiting: _onExiting = noop,
1565
+ onEntering: _onEntering = noop,
1566
+ onEntered: _onEntered = noop,
1567
+ onExit = noop,
1561
1568
  children,
1562
1569
  dialogProps = {}
1563
1570
  } = props,
@@ -1632,10 +1639,29 @@ function Overlay(props) {
1632
1639
  unmountOnExit: unmountOnExit,
1633
1640
  timeout: timeout,
1634
1641
  in: isOpen,
1635
- onEntering: onOpening,
1636
- onEntered: onOpened,
1637
- onExiting: onClosing,
1638
- onExited: handleClosed
1642
+ onEnter: isAppearing => {
1643
+ _onEnter(overlay.current, isAppearing);
1644
+ },
1645
+ onEntering: isAppearing => {
1646
+ onOpening(overlay.current, isAppearing);
1647
+
1648
+ _onEntering(overlay.current);
1649
+ },
1650
+ onEntered: isAppearing => {
1651
+ onOpened(overlay.current, isAppearing);
1652
+
1653
+ _onEntered(overlay.current);
1654
+ },
1655
+ onExiting: () => {
1656
+ onClosing(overlay.current);
1657
+
1658
+ _onExiting(overlay.current);
1659
+ },
1660
+ onExited: () => {
1661
+ handleClosed(overlay.current);
1662
+ onExit(overlay.current);
1663
+ },
1664
+ nodeRef: overlay
1639
1665
  }, otherProps, {
1640
1666
  children: status => {
1641
1667
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
@@ -2335,6 +2361,7 @@ var Breadcrumb = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react
2335
2361
  Breadcrumb.Item = Item;
2336
2362
  /* harmony default export */ const esm_Breadcrumb = (Breadcrumb);
2337
2363
 
2364
+
2338
2365
  ;// CONCATENATED MODULE: ../react-breadcrumb/esm/index.js
2339
2366
 
2340
2367
 
@@ -2371,7 +2398,7 @@ var react_button_group_esm_excluded = ["prefixCls", "vertical", "children", "cla
2371
2398
 
2372
2399
  ;// CONCATENATED MODULE: ../../node_modules/@uiw/formatter/esm/index.js
2373
2400
  /**!
2374
- * @uiw/formatter v1.3.2
2401
+ * @uiw/formatter v1.3.3
2375
2402
  * Get a formatted date.
2376
2403
  *
2377
2404
  * Copyright (c) 2022 Kenny Wang <wowohoo@qq.com>
@@ -2414,7 +2441,6 @@ formatter.utc = function (str, date) {
2414
2441
  };
2415
2442
 
2416
2443
 
2417
- //# sourceMappingURL=index.js.map
2418
2444
 
2419
2445
  ;// CONCATENATED MODULE: ../react-overlay-trigger/esm/utils.js
2420
2446
  var utils_canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
@@ -2866,7 +2892,8 @@ var normalizeDelay = delay => delay && typeof delay === 'object' ? delay : {
2866
2892
  });
2867
2893
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle)(ref, () => ({
2868
2894
  hide: () => _hide(),
2869
- show: () => _show()
2895
+ show: () => _show(),
2896
+ overlayDom: popupRef
2870
2897
  }));
2871
2898
  var child = external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.only(children);
2872
2899
 
@@ -2946,11 +2973,13 @@ var normalizeDelay = delay => delay && typeof delay === 'object' ? delay : {
2946
2973
  }
2947
2974
 
2948
2975
  function handleShow() {
2976
+ var _props$children;
2977
+
2949
2978
  clearTimeouts();
2950
2979
  hoverStateRef.current = 'show';
2951
2980
  var delay = normalizeDelay(props.delay);
2952
2981
 
2953
- if (!delay.show) {
2982
+ if (!delay.show && !((_props$children = props.children) != null && _props$children.props.disabled)) {
2954
2983
  _show();
2955
2984
 
2956
2985
  return;
@@ -2959,6 +2988,7 @@ var normalizeDelay = delay => delay && typeof delay === 'object' ? delay : {
2959
2988
  var handle = window.setTimeout(() => {
2960
2989
  if (hoverStateRef.current === 'show') _show();
2961
2990
  }, delay.show);
2991
+ clearTimeout(handle);
2962
2992
  timeoutRef.current.push(handle);
2963
2993
  }
2964
2994
 
@@ -4600,6 +4630,10 @@ var SubMenu = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_am
4600
4630
 
4601
4631
  function onEntered(node) {
4602
4632
  node.style.height = 'initial';
4633
+
4634
+ if (popupRef.current && popupRef.current.overlayDom) {
4635
+ node.style.height = popupRef.current.overlayDom.current.getBoundingClientRect().height + 'px';
4636
+ }
4603
4637
  }
4604
4638
 
4605
4639
  if (!collapse) {
@@ -5065,11 +5099,12 @@ var RadioAbstract = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_re
5065
5099
 
5066
5100
 
5067
5101
 
5068
- /* harmony default export */ const Radio = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef((props, ref) => {
5102
+ var Radio = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef((props, ref) => {
5069
5103
  return /*#__PURE__*/(0,jsx_runtime.jsx)(RadioAbstract, _extends({
5070
5104
  ref: ref
5071
5105
  }, props));
5072
- }));
5106
+ });
5107
+ /* harmony default export */ const esm_Radio = (Radio);
5073
5108
 
5074
5109
  ;// CONCATENATED MODULE: ../react-radio/esm/style/group.css
5075
5110
  // extracted by mini-css-extract-plugin
@@ -5082,7 +5117,7 @@ var RadioGroup_excluded = ["prefixCls", "className", "name", "value", "onChange"
5082
5117
 
5083
5118
 
5084
5119
 
5085
- /* harmony default export */ const RadioGroup = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef((props, ref) => {
5120
+ var RadioGroup = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef((props, ref) => {
5086
5121
  var {
5087
5122
  prefixCls = 'w-radio-group',
5088
5123
  className,
@@ -5108,7 +5143,8 @@ var RadioGroup_excluded = ["prefixCls", "className", "name", "value", "onChange"
5108
5143
  })
5109
5144
  })
5110
5145
  }));
5111
- }));
5146
+ });
5147
+ /* harmony default export */ const esm_RadioGroup = (RadioGroup);
5112
5148
 
5113
5149
  ;// CONCATENATED MODULE: ../react-radio/esm/RadioButton.js
5114
5150
 
@@ -8225,6 +8261,7 @@ Circle.defaultProps = {
8225
8261
 
8226
8262
  };
8227
8263
 
8264
+
8228
8265
  ;// CONCATENATED MODULE: ../react-progress/esm/style/line.css
8229
8266
  // extracted by mini-css-extract-plugin
8230
8267
  /* harmony default export */ const line = ({});
@@ -8310,6 +8347,7 @@ Line.defaultProps = {
8310
8347
 
8311
8348
  };
8312
8349
 
8350
+
8313
8351
  ;// CONCATENATED MODULE: ../react-progress/esm/index.js
8314
8352
 
8315
8353
 
@@ -8581,6 +8619,9 @@ function SearchSelect(props) {
8581
8619
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
8582
8620
  if (valueVerify(value)) {
8583
8621
  selectedValueChange(value);
8622
+ } else {
8623
+ setSelectedValue([]);
8624
+ setSelectedLabel('');
8584
8625
  }
8585
8626
  }, [JSON.stringify(value)]);
8586
8627
 
@@ -9572,6 +9613,8 @@ var react_switch_esm_excluded = ["prefixCls"];
9572
9613
  // extracted by mini-css-extract-plugin
9573
9614
  /* harmony default export */ const react_table_esm_style = ({});
9574
9615
  ;// CONCATENATED MODULE: ../react-table/esm/util.js
9616
+
9617
+
9575
9618
  /**
9576
9619
  * Get colspan number
9577
9620
  * @param {Array} date
@@ -9727,6 +9770,10 @@ function getAllColumnsKeys(data, keys) {
9727
9770
  keys = keys.concat(getAllColumnsKeys(data[i].children || []));
9728
9771
  } else if (data[i].key) {
9729
9772
  keys.push(data[i]);
9773
+ } else {
9774
+ keys.push(_extends({}, data[i], {
9775
+ key: i.toString()
9776
+ }));
9730
9777
  }
9731
9778
  }
9732
9779
 
@@ -10325,7 +10372,7 @@ function Table(props) {
10325
10372
  }), data && data.length === 0 && empty && /*#__PURE__*/(0,jsx_runtime.jsx)("tbody", {
10326
10373
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("tr", {
10327
10374
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("td", {
10328
- colSpan: columns.length,
10375
+ colSpan: self.keys.length,
10329
10376
  style: {
10330
10377
  position: 'relative',
10331
10378
  left: 0
@@ -10650,9 +10697,11 @@ var TreeNode_excluded = ["prefixCls", "renderTitle", "icon", "iconAnimation", "i
10650
10697
 
10651
10698
  var Label = _ref => {
10652
10699
  var {
10653
- label
10700
+ label,
10701
+ className
10654
10702
  } = _ref;
10655
10703
  return (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
10704
+ className: className,
10656
10705
  children: label
10657
10706
  }), [label]);
10658
10707
  };
@@ -10675,27 +10724,29 @@ function TreeNode(props) {
10675
10724
  other = _objectWithoutPropertiesLoose(props, TreeNode_excluded);
10676
10725
 
10677
10726
  var isOpen = false;
10727
+ var node = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef(null);
10678
10728
 
10679
10729
  if (parent && (parent.key || parent.key === 0)) {
10680
10730
  isOpen = !!(openKeys && openKeys.indexOf(parent.key) > -1);
10681
10731
  }
10682
10732
 
10683
- var onExit = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(node => {
10684
- node.style.height = node.scrollHeight + "px";
10733
+ var onExit = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(() => {
10734
+ node.current.style.height = node.current.scrollHeight + "px";
10685
10735
  }, []);
10686
- var onExiting = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(node => {
10687
- node.style.height = '1px';
10736
+ var onExiting = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(() => {
10737
+ node.current.style.height = '1px';
10688
10738
  }, []);
10689
- var onEnter = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)((node, isAppearing) => {
10690
- node.style.height = '1px';
10739
+ var onEnter = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(() => {
10740
+ node.current.style.height = '1px';
10691
10741
  }, []);
10692
- var onEntering = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)((node, isAppearing) => {
10693
- node.style.height = node.scrollHeight + "px";
10742
+ var onEntering = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(() => {
10743
+ node.current.style.height = node.current.scrollHeight + "px";
10694
10744
  }, []);
10695
- var onEntered = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)((node, isAppearing) => {
10696
- node.style.height = 'initial';
10745
+ var onEntered = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(() => {
10746
+ node.current.style.height = 'initial';
10697
10747
  }, []);
10698
10748
  return /*#__PURE__*/(0,jsx_runtime.jsx)(esm_CSSTransition, {
10749
+ nodeRef: node,
10699
10750
  classNames: prefixCls,
10700
10751
  in: isOpen,
10701
10752
  timeout: 200,
@@ -10705,6 +10756,7 @@ function TreeNode(props) {
10705
10756
  onEntered: onEntered,
10706
10757
  onEntering: onEntering,
10707
10758
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("ul", {
10759
+ ref: node,
10708
10760
  className: [level !== 1 && isOpen ? [prefixCls + "-open"] : null, level !== 1 && !isOpen ? [prefixCls + "-close"] : null].filter(Boolean).join(' ').trim(),
10709
10761
  children: data.map((item, idx) => {
10710
10762
  item.parent = parent;
@@ -10720,6 +10772,24 @@ function TreeNode(props) {
10720
10772
  var childKeys = noChild ? [] : getChildKeys(item.children);
10721
10773
  var checkedKeys = selectedKeys ? selectedKeys.filter(key => childKeys.indexOf(key) > -1) : [];
10722
10774
  var isHalfChecked = checkedKeys.length > 0 && childKeys.length !== checkedKeys.length;
10775
+ var disabledObj = {
10776
+ onClick: onItemSelected,
10777
+ disabled: null,
10778
+ disabledMouse: null,
10779
+ disabledClass: undefined,
10780
+ disabledStyle: undefined
10781
+ };
10782
+
10783
+ if (item.disabled) {
10784
+ disabledObj.onClick = undefined;
10785
+ disabledObj.disabled = 'disabled';
10786
+ disabledObj.disabledMouse = prefixCls + "-disabled-mouse";
10787
+ disabledObj.disabledClass = prefixCls + "-disabled-ele";
10788
+ disabledObj.disabledStyle = {
10789
+ color: '#00000040'
10790
+ };
10791
+ }
10792
+
10723
10793
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
10724
10794
  style: {
10725
10795
  display: item.hideNode ? 'none' : 'block'
@@ -10737,16 +10807,20 @@ function TreeNode(props) {
10737
10807
  className: [typeof icon === 'function' ? prefixCls + "-switcher-noop" : null, noChild ? 'no-child' : null, !iconAnimation ? 'no-animation' : null, itemIsOpen ? 'open' : null].filter(Boolean).join(' ').trim()
10738
10808
  })
10739
10809
  }), /*#__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(),
10810
+ onClick: evn => disabledObj.onClick == null ? void 0 : disabledObj.onClick(item, evn),
10811
+ className: [prefixCls + "-title", selected && isSelected ? 'selected' : null, disabledObj.disabled, disabledObj.disabledMouse].filter(Boolean).join(' ').trim(),
10742
10812
  children: renderTitle ? renderTitle(item, {
10743
10813
  selected,
10744
10814
  noChild,
10745
10815
  openKeys,
10746
10816
  isHalfChecked,
10747
- selectedKeys
10817
+ selectedKeys,
10818
+ disabled: item.disabled,
10819
+ disabledClass: disabledObj.disabledClass,
10820
+ disabledStyle: disabledObj.disabledStyle
10748
10821
  }) : /*#__PURE__*/(0,jsx_runtime.jsx)(Label, {
10749
- label: item.label
10822
+ label: item.label,
10823
+ className: disabledObj.disabledClass
10750
10824
  })
10751
10825
  })]
10752
10826
  }), item.children && /*#__PURE__*/(0,jsx_runtime.jsx)(TreeNode, _extends({}, other, {
@@ -11034,8 +11108,10 @@ function TreeChecked(_ref) {
11034
11108
 
11035
11109
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, {
11036
11110
  children: [/*#__PURE__*/(0,jsx_runtime.jsx)(react_checkbox_esm, _extends({
11037
- className: prefixCls + "-checked"
11111
+ className: prefixCls + "-checked",
11112
+ disabled: node.disabled
11038
11113
  }, checkedProps)), item.label && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
11114
+ className: node.disabledClass,
11039
11115
  children: item.label
11040
11116
  })]
11041
11117
  });