uiw 4.17.0 → 4.18.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
@@ -2043,7 +2043,6 @@ sup.w-badge-count {
2043
2043
  padding-left: 4px;
2044
2044
  margin-right: 5px;
2045
2045
  font-size: 14px;
2046
- line-height: 14px;
2047
2046
  }
2048
2047
 
2049
2048
  .w-collapse {
@@ -3895,7 +3894,6 @@ a.w-list-item:hover:not(.w-disabled) {
3895
3894
  box-shadow: 0 0 0 0 rgba(19, 124, 189, 0), 0 0 0 0 rgba(19, 124, 189, 0), inset 0 0 0 1px rgba(16, 22, 26, 0.15), inset 0 1px 1px rgba(16, 22, 26, 0.2);
3896
3895
  box-sizing: border-box;
3897
3896
  background: #fff;
3898
- min-height: 30px;
3899
3897
  margin: 0 !important;
3900
3898
  padding: 3px 10px 3px 10px;
3901
3899
  vertical-align: middle;
@@ -3925,6 +3923,20 @@ a.w-list-item:hover:not(.w-disabled) {
3925
3923
  cursor: not-allowed;
3926
3924
  resize: none;
3927
3925
  }
3926
+ .w-search-select-inner-inner-small {
3927
+ height: 20px;
3928
+ }
3929
+ .w-search-select-inner-inner-large {
3930
+ height: 30px;
3931
+ }
3932
+ .w-search-select-inner .w-input-small .w-input-inner {
3933
+ height: 16px;
3934
+ font-size: 10px;
3935
+ padding: 0px;
3936
+ }
3937
+ .w-search-select-inner .w-input-large .w-input-inner {
3938
+ height: 28px;
3939
+ }
3928
3940
  .w-search-select-multiple-colse {
3929
3941
  left: 7px;
3930
3942
  font-size: 15px;
@@ -5119,6 +5131,20 @@ a.w-list-item:hover:not(.w-disabled) {
5119
5131
  display: flex;
5120
5132
  align-content: center;
5121
5133
  }
5134
+ .w-search-tree-inner-inner-small {
5135
+ height: 20px;
5136
+ }
5137
+ .w-search-tree-inner-inner-large {
5138
+ height: 30px;
5139
+ }
5140
+ .w-search-tree-inner .w-input-small .w-input-inner {
5141
+ height: 16px;
5142
+ font-size: 10px;
5143
+ padding: 0px;
5144
+ }
5145
+ .w-search-tree-inner .w-input-large .w-input-inner {
5146
+ height: 28px;
5147
+ }
5122
5148
 
5123
5149
  .w-transfer {
5124
5150
  display: flex;
package/dist/uiw.js CHANGED
@@ -371,6 +371,7 @@ __webpack_require__.d(__webpack_exports__, {
371
371
  "Progress": () => (/* reexport */ react_progress_esm),
372
372
  "Radio": () => (/* reexport */ Radio),
373
373
  "RadioAbstract": () => (/* reexport */ RadioAbstract),
374
+ "RadioButton": () => (/* reexport */ esm_RadioButton),
374
375
  "RadioGroup": () => (/* reexport */ RadioGroup),
375
376
  "Rate": () => (/* reexport */ Rate),
376
377
  "Row": () => (/* reexport */ Row_Row),
@@ -4552,6 +4553,7 @@ function Cascader(props) {
4552
4553
  value,
4553
4554
  onChange,
4554
4555
  onSearch,
4556
+ size,
4555
4557
  disabled,
4556
4558
  allowClear,
4557
4559
  placeholder,
@@ -4561,7 +4563,8 @@ function Cascader(props) {
4561
4563
  width: 200
4562
4564
  },
4563
4565
  option = [],
4564
- others
4566
+ others,
4567
+ inputProps
4565
4568
  } = props;
4566
4569
  var cls = [prefixCls, className].filter(Boolean).join(' ').trim();
4567
4570
  var [innerIsOpen, setInnerIsOpen] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false);
@@ -4713,9 +4716,9 @@ function Cascader(props) {
4713
4716
  return /*#__PURE__*/(0,jsx_runtime.jsx)(Dropdown, _extends({
4714
4717
  className: cls,
4715
4718
  trigger: "click",
4716
- style: _extends({
4719
+ style: {
4717
4720
  marginTop: 5
4718
- }, style),
4721
+ },
4719
4722
  overlayStyl: {
4720
4723
  width: 100
4721
4724
  },
@@ -4758,14 +4761,13 @@ function Cascader(props) {
4758
4761
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
4759
4762
  onMouseLeave: () => renderSelectIcon('leave'),
4760
4763
  onMouseOver: () => renderSelectIcon('enter'),
4761
- children: /*#__PURE__*/(0,jsx_runtime.jsx)(react_input_esm, {
4764
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)(react_input_esm, _extends({}, inputProps, {
4762
4765
  value: searchOn ? searchText : inputValue,
4763
4766
  onChange: inputChange,
4767
+ size: size,
4764
4768
  disabled: disabled,
4765
4769
  placeholder: searchOn ? inputValue : placeholder,
4766
- style: {
4767
- width: style == null ? void 0 : style.width
4768
- },
4770
+ style: style,
4769
4771
  onFocus: () => onSearch && setSearchOn(true),
4770
4772
  onBlur: () => onSearch && setSearchOn(false),
4771
4773
  readOnly: !onSearch,
@@ -4779,7 +4781,7 @@ function Cascader(props) {
4779
4781
  className: prefixCls + "-close"
4780
4782
  })
4781
4783
  })
4782
- })
4784
+ }))
4783
4785
  })
4784
4786
  }));
4785
4787
  }
@@ -4877,6 +4879,7 @@ var RadioGroup_excluded = ["prefixCls", "className", "name", "value", "onChange"
4877
4879
 
4878
4880
 
4879
4881
 
4882
+
4880
4883
  /* harmony default export */ const RadioGroup = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef((props, ref) => {
4881
4884
  var {
4882
4885
  prefixCls = 'w-radio-group',
@@ -4891,18 +4894,88 @@ var RadioGroup_excluded = ["prefixCls", "className", "name", "value", "onChange"
4891
4894
  return /*#__PURE__*/(0,jsx_runtime.jsx)("div", _extends({}, other, {
4892
4895
  ref: ref,
4893
4896
  className: [prefixCls, className].filter(Boolean).join(' ').trim(),
4894
- children: external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.toArray(children).map(child => {
4895
- if (!child) return;
4896
- if (! /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().isValidElement(child)) return child;
4897
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(child, _extends({}, child.props || {}, {
4898
- checked: child.props.value === value,
4899
- name,
4900
- onChange
4901
- }));
4897
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)(react_button_group_esm, {
4898
+ children: external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.toArray(children).map(child => {
4899
+ if (!child) return;
4900
+ if (! /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().isValidElement(child)) return child;
4901
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(child, _extends({}, child.props || {}, {
4902
+ checked: child.props.value === value,
4903
+ name,
4904
+ onChange
4905
+ }));
4906
+ })
4902
4907
  })
4903
4908
  }));
4904
4909
  }));
4905
4910
 
4911
+ ;// CONCATENATED MODULE: ../react-radio/esm/RadioButton.js
4912
+
4913
+
4914
+ var RadioButton_excluded = ["prefixCls", "type", "disabled", "value", "className", "style", "children", "size", "checked", "onChange"];
4915
+
4916
+
4917
+ /**
4918
+ * Constructs a type by picking all properties from `HTMLInputProps` and then removing `size`.
4919
+ * Omit: https://www.typescriptlang.org/docs/handbook/utility-types.html#omittk
4920
+ */
4921
+
4922
+
4923
+ var RadioButton = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef((props, ref) => {
4924
+ var {
4925
+ prefixCls = 'w-radio',
4926
+ type = 'button',
4927
+ disabled = false,
4928
+ value = '',
4929
+ className,
4930
+ style,
4931
+ children,
4932
+ size = 'small',
4933
+ checked: prChecked = false,
4934
+ onChange
4935
+ } = props,
4936
+ other = _objectWithoutPropertiesLoose(props, RadioButton_excluded);
4937
+
4938
+ var [checked, setChecked] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(prChecked);
4939
+ var [prevChecked, setPrevChecked] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)();
4940
+
4941
+ if (prChecked !== prevChecked) {
4942
+ setPrevChecked(prChecked);
4943
+ }
4944
+
4945
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
4946
+ if (prChecked !== prevChecked) {
4947
+ setChecked(prChecked);
4948
+ }
4949
+ }, [prevChecked]);
4950
+ var cls = [prefixCls, className, disabled ? 'disabled' : null, size ? prefixCls + "-" + size : null].filter(Boolean).join(' ').trim();
4951
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
4952
+ if (checked !== props.checked) {
4953
+ setChecked(!!props.checked);
4954
+ }
4955
+ }, [props.checked]);
4956
+ console.log('props.checked', props.checked);
4957
+
4958
+ function handleChange(e) {
4959
+ e.persist();
4960
+ setChecked(!checked);
4961
+ onChange && onChange(value);
4962
+ }
4963
+
4964
+ var label = children || value;
4965
+ return /*#__PURE__*/(0,jsx_runtime.jsx)(esm, _extends({}, _extends({}, other, {
4966
+ className: cls,
4967
+ style,
4968
+ disabled,
4969
+ value
4970
+ }), {
4971
+ type: checked ? 'primary' : 'light',
4972
+ ref: ref,
4973
+ onClick: handleChange,
4974
+ children: label
4975
+ }));
4976
+ });
4977
+ /* harmony default export */ const esm_RadioButton = (RadioButton);
4978
+
4906
4979
  ;// CONCATENATED MODULE: ../react-radio/esm/index.js
4907
4980
 
4908
4981
 
@@ -4910,6 +4983,8 @@ var RadioGroup_excluded = ["prefixCls", "className", "name", "value", "onChange"
4910
4983
 
4911
4984
 
4912
4985
 
4986
+
4987
+
4913
4988
  ;// CONCATENATED MODULE: ../react-checkbox/esm/style/group.css
4914
4989
  // extracted by mini-css-extract-plugin
4915
4990
  /* harmony default export */ const style_group = ({});
@@ -8243,6 +8318,11 @@ var react_search_select_esm_excluded = ["allowClear", "disabled", "valueAmount",
8243
8318
 
8244
8319
 
8245
8320
 
8321
+ var TagSize = {
8322
+ large: 25,
8323
+ default: 20,
8324
+ small: 17
8325
+ };
8246
8326
  function SearchSelect(props) {
8247
8327
  var _style$width;
8248
8328
 
@@ -8473,7 +8553,7 @@ function SearchSelect(props) {
8473
8553
  maxWidth: 'none'
8474
8554
  }, style),
8475
8555
  children: isMultiple ? /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
8476
- className: prefixCls + "-inner",
8556
+ className: [prefixCls + "-inner", prefixCls + "-" + size].filter(Boolean).join(' ').trim(),
8477
8557
  children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
8478
8558
  style: {
8479
8559
  display: 'flex',
@@ -8483,12 +8563,11 @@ function SearchSelect(props) {
8483
8563
  children: [isMultiple && selectedValue.slice(0, maxTagCount).map((item, index) => {
8484
8564
  return /*#__PURE__*/(0,jsx_runtime.jsx)(react_tag_esm, _extends({
8485
8565
  style: _extends({
8486
- height: 20,
8566
+ height: TagSize[size],
8487
8567
  margin: 1,
8488
8568
  display: 'flex',
8489
8569
  alignItems: 'center'
8490
8570
  }, tagProps.style),
8491
- className: prefixCls + "-tag",
8492
8571
  color: "#393E48"
8493
8572
  }, tagProps, {
8494
8573
  closable: true,
@@ -9716,9 +9795,9 @@ function TableTr(props) {
9716
9795
 
9717
9796
  if (keyName.fixed) {
9718
9797
  if (keyName.fixed === 'right') {
9719
- objs.className = objs.className + " " + prefixCls + "-fixed-right";
9798
+ objs.className = prefixCls + "-fixed-right";
9720
9799
  } else {
9721
- objs.className = objs.className + " " + prefixCls + "-fixed-true";
9800
+ objs.className = prefixCls + "-fixed-true";
9722
9801
  }
9723
9802
  }
9724
9803
 
@@ -9729,7 +9808,7 @@ function TableTr(props) {
9729
9808
  children: objs.children
9730
9809
  }),
9731
9810
  key: colNum,
9732
- className: prefixCls + "-tr-children-" + (keyName.align || 'left') + " " + (keyName.className || '') + " " + (objs.className || ''),
9811
+ className: [prefixCls + '-tr-children-' + (keyName.align || 'left'), keyName.className, objs.className].filter(it => it).join(' ').trim(),
9733
9812
  onClick: evn => onCell(trData, {
9734
9813
  rowNum,
9735
9814
  colNum,
@@ -9804,54 +9883,55 @@ function Table(props) {
9804
9883
  }
9805
9884
  };
9806
9885
 
9807
- var deepClumnsLocation = (params, fistIndex, leftOrRight, isReverse) => {
9886
+ var deepClumnsLocation = (params, fistIndex) => {
9808
9887
  var initialValue = 0,
9809
- lastIndex = isReverse ? 0 : params.length - 1,
9888
+ headerIndex = 0,
9810
9889
  deepParams = [];
9811
- params.forEach(() => {
9812
- var abs = Math.abs(lastIndex);
9813
- var i = "" + fistIndex + abs;
9890
+ params.forEach((_, index) => {
9891
+ var i = "" + fistIndex + headerIndex;
9814
9892
 
9815
- if (isReverse) {
9816
- lastIndex += 1;
9817
- } else {
9818
- lastIndex -= 1;
9819
- }
9820
-
9821
- if (typeof params[abs] === 'number') {
9822
- initialValue = params[abs] + initialValue;
9823
- deepParams.push(params[abs]);
9893
+ if (typeof params[index] === 'number') {
9894
+ initialValue = params[index] + initialValue;
9895
+ deepParams.push(params[index]);
9824
9896
  return;
9825
9897
  }
9826
9898
 
9827
9899
  if (finalLocationWidth.current[i]) {
9828
- finalLocationWidth.current[i][leftOrRight] = initialValue;
9900
+ finalLocationWidth.current[i].left = initialValue;
9829
9901
  initialValue = finalLocationWidth.current[i].width + initialValue;
9902
+
9903
+ if (Array.isArray(params[index].children)) {
9904
+ deepParams.push(...params[index].children);
9905
+ } else {
9906
+ deepParams.push(finalLocationWidth.current[i].width);
9907
+ }
9830
9908
  }
9831
9909
 
9832
- if (Array.isArray(params[abs].children)) {
9833
- deepParams.push(...params[abs].children);
9834
- return;
9910
+ headerIndex += 1;
9911
+ });
9912
+ initialValue = 0, headerIndex = header[fistIndex].length - 1;
9913
+
9914
+ for (var _index = params.length - 1; _index >= 0; _index--) {
9915
+ var i = "" + fistIndex + headerIndex;
9916
+
9917
+ if (typeof params[_index] === 'number') {
9918
+ initialValue = params[_index] + initialValue;
9919
+ continue;
9835
9920
  }
9836
9921
 
9837
9922
  if (finalLocationWidth.current[i]) {
9838
- deepParams.push(finalLocationWidth.current[i].width);
9839
- } else {
9840
- var parent = header.find(it => it.find(it => it.key === params[abs].key)) || [];
9841
- var sub = parent.findIndex(it => it.key === params[abs].key);
9842
-
9843
- if (finalLocationWidth.current["" + i[0] + sub]) {
9844
- // 合并单元格
9845
- deepParams.push(finalLocationWidth.current["" + i[0] + sub].width);
9846
- }
9923
+ finalLocationWidth.current[i].right = initialValue;
9924
+ initialValue = finalLocationWidth.current[i].width + initialValue;
9847
9925
  }
9848
- });
9849
- if (deepParams.filter(it => typeof it !== 'number').length) deepClumnsLocation(deepParams, fistIndex + 1, leftOrRight, isReverse);
9926
+
9927
+ headerIndex -= 1;
9928
+ }
9929
+
9930
+ if (deepParams.filter(it => typeof it !== 'number').length) deepClumnsLocation(deepParams, fistIndex + 1);
9850
9931
  };
9851
9932
 
9852
9933
  var computed = () => {
9853
- deepClumnsLocation(columns, 0, 'left', true);
9854
- deepClumnsLocation(columns, 0, 'right', false);
9934
+ deepClumnsLocation(columns, 0);
9855
9935
  return finalLocationWidth.current;
9856
9936
  };
9857
9937
 
@@ -10772,6 +10852,11 @@ function TreeChecked(_ref) {
10772
10852
 
10773
10853
 
10774
10854
 
10855
+ var SearchTagInput_TagSize = {
10856
+ large: 25,
10857
+ default: 20,
10858
+ small: 17
10859
+ };
10775
10860
 
10776
10861
  function SearchTagInput(props) {
10777
10862
  var {
@@ -10784,6 +10869,7 @@ function SearchTagInput(props) {
10784
10869
  className,
10785
10870
  style,
10786
10871
  placeholder,
10872
+ tagProps = {},
10787
10873
  content,
10788
10874
  options,
10789
10875
  values,
@@ -10904,11 +10990,11 @@ function SearchTagInput(props) {
10904
10990
  return (_inputRef$current2 = inputRef.current) == null ? void 0 : _inputRef$current2.focus();
10905
10991
  },
10906
10992
  style: _extends({
10907
- minWidth: 200,
10993
+ minWidth: (style == null ? void 0 : style.width) || 200,
10908
10994
  maxWidth: 'none'
10909
10995
  }, style),
10910
10996
  children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
10911
- className: prefixCls + "-inner",
10997
+ className: [prefixCls + "-inner", prefixCls + "-" + size].filter(Boolean).join(' ').trim(),
10912
10998
  children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
10913
10999
  style: {
10914
11000
  display: 'flex',
@@ -10916,23 +11002,24 @@ function SearchTagInput(props) {
10916
11002
  width: '100%'
10917
11003
  },
10918
11004
  children: [selectedOption.map((item, index) => {
10919
- return /*#__PURE__*/(0,jsx_runtime.jsx)(react_tag_esm, {
11005
+ return /*#__PURE__*/(0,jsx_runtime.jsx)(react_tag_esm, _extends({
10920
11006
  style: {
10921
- height: 20,
11007
+ height: SearchTagInput_TagSize[size],
10922
11008
  margin: 1,
10923
11009
  display: 'flex',
10924
11010
  alignItems: 'center'
10925
11011
  },
10926
11012
  className: prefixCls + "-tag",
10927
11013
  closable: true,
11014
+ color: "#393E48"
11015
+ }, tagProps, {
10928
11016
  disabled: disabled,
10929
- color: "#393E48",
10930
11017
  onClose: e => {
10931
11018
  e.stopPropagation();
10932
11019
  removeSelectItem(index);
10933
11020
  },
10934
11021
  children: item.label
10935
- }, index);
11022
+ }), index);
10936
11023
  }), /*#__PURE__*/(0,jsx_runtime.jsx)(react_input_esm, {
10937
11024
  ref: inputRef,
10938
11025
  style: {},