uiw 4.21.12 → 4.21.15

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
@@ -67,7 +67,6 @@
67
67
  overflow: auto;
68
68
  -webkit-user-select: none;
69
69
  -moz-user-select: none;
70
- -ms-user-select: none;
71
70
  user-select: none;
72
71
  }
73
72
  .w-overlay-enter .w-overlay-backdrop {
@@ -147,7 +146,6 @@
147
146
  .w-btn {
148
147
  -webkit-user-select: none;
149
148
  -moz-user-select: none;
150
- -ms-user-select: none;
151
149
  user-select: none;
152
150
  display: inline-flex;
153
151
  flex-direction: row;
@@ -1409,7 +1407,6 @@ sup.w-badge-count {
1409
1407
  .w-datepicker-caption {
1410
1408
  -webkit-user-select: none;
1411
1409
  -moz-user-select: none;
1412
- -ms-user-select: none;
1413
1410
  user-select: none;
1414
1411
  text-align: center;
1415
1412
  padding: 0 0 3px 0;
@@ -1513,7 +1510,6 @@ sup.w-badge-count {
1513
1510
  color: #393e48;
1514
1511
  -webkit-user-select: none;
1515
1512
  -moz-user-select: none;
1516
- -ms-user-select: none;
1517
1513
  user-select: none;
1518
1514
  font-size: 14px;
1519
1515
  line-height: 21px;
@@ -1574,7 +1570,6 @@ sup.w-badge-count {
1574
1570
  display: inline-block;
1575
1571
  -webkit-user-select: none;
1576
1572
  -moz-user-select: none;
1577
- -ms-user-select: none;
1578
1573
  user-select: none;
1579
1574
  }
1580
1575
  .w-calendar-btn-group {
@@ -1720,7 +1715,6 @@ sup.w-badge-count {
1720
1715
  color: inherit;
1721
1716
  -webkit-user-select: none;
1722
1717
  -moz-user-select: none;
1723
- -ms-user-select: none;
1724
1718
  user-select: none;
1725
1719
  transition: initial;
1726
1720
  transition: background-color 0.3s;
@@ -2141,7 +2135,6 @@ sup.w-badge-count {
2141
2135
  .w-copy-to-clipboard-select {
2142
2136
  -webkit-user-select: text;
2143
2137
  -moz-user-select: text;
2144
- -ms-user-select: text;
2145
2138
  user-select: text;
2146
2139
  display: none;
2147
2140
  }
@@ -3484,7 +3477,6 @@ a.w-list-item:hover:not(.w-disabled) {
3484
3477
  position: relative;
3485
3478
  -webkit-user-select: none;
3486
3479
  -moz-user-select: none;
3487
- -ms-user-select: none;
3488
3480
  user-select: none;
3489
3481
  font-size: 12px;
3490
3482
  }
@@ -3827,7 +3819,6 @@ a.w-list-item:hover:not(.w-disabled) {
3827
3819
  display: inline-block;
3828
3820
  -webkit-user-select: none;
3829
3821
  -moz-user-select: none;
3830
- -ms-user-select: none;
3831
3822
  user-select: none;
3832
3823
  font-size: 12px;
3833
3824
  padding: 1px 5px;
@@ -3873,6 +3864,9 @@ a.w-list-item:hover:not(.w-disabled) {
3873
3864
  padding: 0px;
3874
3865
  height: 28px;
3875
3866
  }
3867
+ .w-search-select-input-contents.w-input-small {
3868
+ min-width: 0;
3869
+ }
3876
3870
  .w-search-select-input-contents .w-input-inner:hover {
3877
3871
  box-shadow: none !important;
3878
3872
  }
@@ -3973,8 +3967,7 @@ a.w-list-item:hover:not(.w-disabled) {
3973
3967
  display: flex;
3974
3968
  background: #f8f8f9;
3975
3969
  -webkit-user-select: none;
3976
- -ms-user-select: none;
3977
- user-select: none;
3970
+ user-select: none;
3978
3971
  }
3979
3972
  .w-split-bar::before,
3980
3973
  .w-split-bar::after {
@@ -4415,7 +4408,6 @@ a.w-list-item:hover:not(.w-disabled) {
4415
4408
  cursor: pointer;
4416
4409
  -webkit-user-select: none;
4417
4410
  -moz-user-select: none;
4418
- -ms-user-select: none;
4419
4411
  user-select: none;
4420
4412
  vertical-align: middle;
4421
4413
  }
@@ -4799,7 +4791,6 @@ a.w-list-item:hover:not(.w-disabled) {
4799
4791
  cursor: not-allowed;
4800
4792
  -webkit-user-select: none;
4801
4793
  -moz-user-select: none;
4802
- -ms-user-select: none;
4803
4794
  user-select: none;
4804
4795
  color: rgba(0, 0, 0, 0.25);
4805
4796
  }
package/dist/uiw.js CHANGED
@@ -421,7 +421,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
421
421
  }
422
422
  ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/extends.js
423
423
  function _extends() {
424
- _extends = Object.assign || function (target) {
424
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
425
425
  for (var i = 1; i < arguments.length; i++) {
426
426
  var source = arguments[i];
427
427
 
@@ -434,7 +434,6 @@ function _extends() {
434
434
 
435
435
  return target;
436
436
  };
437
-
438
437
  return _extends.apply(this, arguments);
439
438
  }
440
439
  // EXTERNAL MODULE: external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"}
@@ -697,11 +696,10 @@ function _asyncToGenerator(fn) {
697
696
  }
698
697
  ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
699
698
  function _setPrototypeOf(o, p) {
700
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
699
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
701
700
  o.__proto__ = p;
702
701
  return o;
703
702
  };
704
-
705
703
  return _setPrototypeOf(o, p);
706
704
  }
707
705
  ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
@@ -765,6 +763,10 @@ var external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_
765
763
  ;// CONCATENATED MODULE: ../../node_modules/react-transition-group/esm/TransitionGroupContext.js
766
764
 
767
765
  /* harmony default export */ const TransitionGroupContext = (external_root_React_commonjs2_react_commonjs_react_amd_react_default().createContext(null));
766
+ ;// CONCATENATED MODULE: ../../node_modules/react-transition-group/esm/utils/reflow.js
767
+ var forceReflow = function forceReflow(node) {
768
+ return node.scrollTop;
769
+ };
768
770
  ;// CONCATENATED MODULE: ../../node_modules/react-transition-group/esm/Transition.js
769
771
 
770
772
 
@@ -774,6 +776,7 @@ var external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_
774
776
 
775
777
 
776
778
 
779
+
777
780
  var UNMOUNTED = 'unmounted';
778
781
  var EXITED = 'exited';
779
782
  var ENTERING = 'entering';
@@ -993,6 +996,14 @@ var Transition = /*#__PURE__*/function (_React$Component) {
993
996
  this.cancelNextCallback();
994
997
 
995
998
  if (nextStatus === ENTERING) {
999
+ if (this.props.unmountOnExit || this.props.mountOnEnter) {
1000
+ var node = this.props.nodeRef ? this.props.nodeRef.current : external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default().findDOMNode(this); // https://github.com/reactjs/react-transition-group/pull/749
1001
+ // With unmountOnExit or mountOnEnter, the enter animation should happen at the transition between `exited` and `entering`.
1002
+ // To make the animation happen, we have to separate each rendering and avoid being processed as batched.
1003
+
1004
+ if (node) forceReflow(node);
1005
+ }
1006
+
996
1007
  this.performEnter(mounting);
997
1008
  } else {
998
1009
  this.performExit();
@@ -1207,6 +1218,7 @@ Transition.EXITING = EXITING;
1207
1218
 
1208
1219
 
1209
1220
 
1221
+
1210
1222
  var _addClass = function addClass(node, classes) {
1211
1223
  return node && classes && classes.split(' ').forEach(function (c) {
1212
1224
  return addClass_addClass(node, c);
@@ -1426,8 +1438,7 @@ var CSSTransition = /*#__PURE__*/function (_React$Component) {
1426
1438
 
1427
1439
 
1428
1440
  if (phase === 'active') {
1429
- /* eslint-disable no-unused-expressions */
1430
- node && node.scrollTop;
1441
+ if (node) forceReflow(node);
1431
1442
  }
1432
1443
 
1433
1444
  if (className) {
@@ -6703,6 +6714,7 @@ var Form_excluded = ["prefixCls", "className", "fields", "children", "resetOnSub
6703
6714
 
6704
6715
 
6705
6716
 
6717
+
6706
6718
  function newFormState(fields, cb) {
6707
6719
  var state = {
6708
6720
  initial: {},
@@ -6733,8 +6745,7 @@ function newInitialValue(value) {
6733
6745
 
6734
6746
  var isPromise = promise => promise && typeof promise.then === 'function';
6735
6747
 
6736
- function Form(_ref, ref //| React.RefObject<FormRefType>,
6737
- ) {
6748
+ function Form(props, ref) {
6738
6749
  var {
6739
6750
  prefixCls = 'w-form',
6740
6751
  className,
@@ -6745,13 +6756,13 @@ function Form(_ref, ref //| React.RefObject<FormRefType>,
6745
6756
  onChange,
6746
6757
  onSubmit,
6747
6758
  afterSubmit
6748
- } = _ref,
6749
- others = _objectWithoutPropertiesLoose(_ref, Form_excluded);
6759
+ } = props,
6760
+ others = _objectWithoutPropertiesLoose(props, Form_excluded);
6750
6761
 
6751
- var initData = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => newFormState(fields, _ref2 => {
6762
+ var initData = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => newFormState(fields, _ref => {
6752
6763
  var {
6753
6764
  initialValue
6754
- } = _ref2;
6765
+ } = _ref;
6755
6766
  initialValue = newInitialValue(initialValue);
6756
6767
  return {
6757
6768
  initialValue,
@@ -6770,28 +6781,27 @@ function Form(_ref, ref //| React.RefObject<FormRefType>,
6770
6781
  var formUnits = {};
6771
6782
 
6772
6783
  for (var name in fields) {
6773
- var props = fields[name];
6774
- if (!props) continue;
6784
+ var itemProps = fields[name];
6785
+ if (!itemProps) continue;
6775
6786
  var error = data.errors[name];
6776
6787
 
6777
- if (typeof props.initialValue === 'boolean') {
6778
- props.checked = props.initialValue;
6788
+ if (typeof itemProps.initialValue === 'boolean') {
6789
+ itemProps.checked = itemProps.initialValue;
6779
6790
  }
6780
6791
 
6781
- var childField = controlField(_extends({}, props, {
6792
+ var childField = controlField(_extends({}, itemProps, {
6782
6793
  name
6783
6794
  }));
6784
- var help = error || props.help;
6785
- var labelFor = props.labelFor;
6786
- formUnits[name] = /*#__PURE__*/(0,jsx_runtime.jsx)(FormItem, _extends({}, _extends({}, props, {
6795
+ var help = error || itemProps.help;
6796
+ var labelFor = itemProps.labelFor;
6797
+ formUnits[name] = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement)(FormItem, _extends({}, itemProps, {
6787
6798
  key: name,
6788
6799
  children: childField,
6789
- help,
6790
- labelFor,
6791
- state: data,
6792
- name,
6800
+ help: help,
6801
+ labelFor: labelFor,
6802
+ name: name,
6793
6803
  hasError: !!error
6794
- })));
6804
+ }));
6795
6805
  }
6796
6806
 
6797
6807
  function setFields(fields) {
@@ -6908,10 +6918,10 @@ function Form(_ref, ref //| React.RefObject<FormRefType>,
6908
6918
 
6909
6919
  for (var _name in fields) {
6910
6920
  if (Object.prototype.hasOwnProperty.call(fields, _name)) {
6911
- var _props = fields[_name];
6912
- if (!_props) continue;
6921
+ var fieldsProps = fields[_name];
6922
+ if (!fieldsProps) continue;
6913
6923
 
6914
- if (_props.validator && _props.validator(current[_name])) {
6924
+ if (fieldsProps.validator && fieldsProps.validator(current[_name])) {
6915
6925
  passesValidators = false;
6916
6926
  break;
6917
6927
  }
@@ -6928,8 +6938,8 @@ function Form(_ref, ref //| React.RefObject<FormRefType>,
6928
6938
 
6929
6939
  var initials = _extends({}, initial);
6930
6940
 
6931
- Object.entries(initials).map(_ref3 => {
6932
- var [key, value] = _ref3;
6941
+ Object.entries(initials).map(_ref2 => {
6942
+ var [key, value] = _ref2;
6933
6943
 
6934
6944
  if (Array.isArray(value)) {
6935
6945
  initials[key] = [...value];
@@ -6942,13 +6952,13 @@ function Form(_ref, ref //| React.RefObject<FormRefType>,
6942
6952
  }));
6943
6953
  }
6944
6954
 
6945
- function controlField(_ref4) {
6955
+ function controlField(_ref3) {
6946
6956
  var {
6947
6957
  children,
6948
6958
  validator,
6949
6959
  name
6950
- } = _ref4,
6951
- other = _objectWithoutPropertiesLoose(_ref4, Form_excluded2);
6960
+ } = _ref3,
6961
+ other = _objectWithoutPropertiesLoose(_ref3, Form_excluded2);
6952
6962
 
6953
6963
  var element = typeof children !== 'function' ? children : children({
6954
6964
  onChange: handleChange(name, validator),
@@ -6965,7 +6975,7 @@ function Form(_ref, ref //| React.RefObject<FormRefType>,
6965
6975
  props.id = element.props.id;
6966
6976
  props.value = hasCurrentValue ? data.current && data.current[name] : props.value; // : element.props.value;
6967
6977
 
6968
- var type = element.props.type; // console.log('type', element)
6978
+ var type = element.props.type;
6969
6979
 
6970
6980
  if (type === 'checkbox' || type === 'switch' || typeof props.value === 'boolean') {
6971
6981
  props.checked = !!props.value;
@@ -6976,10 +6986,9 @@ function Form(_ref, ref //| React.RefObject<FormRefType>,
6976
6986
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(element, props);
6977
6987
  }
6978
6988
 
6979
- return /*#__PURE__*/(0,jsx_runtime.jsx)("form", _extends({}, _extends({}, others, {
6989
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("form", _extends({}, others, {
6980
6990
  className: [prefixCls, className].filter(Boolean).join(' ').trim(),
6981
- onSubmit: handleSubmit
6982
- }), {
6991
+ onSubmit: handleSubmit,
6983
6992
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("fieldset", {
6984
6993
  disabled: data.submitting,
6985
6994
  children: typeof children === 'function' ? children({
@@ -7050,7 +7059,6 @@ var react_list_esm_excluded = ["prefixCls", "bordered", "striped", "noHover", "a
7050
7059
 
7051
7060
 
7052
7061
 
7053
-
7054
7062
  function InternalList(props, ref) {
7055
7063
  var {
7056
7064
  prefixCls = 'w-list',
@@ -7059,7 +7067,7 @@ function InternalList(props, ref) {
7059
7067
  noHover = false,
7060
7068
  active = false,
7061
7069
  size = 'default',
7062
- renderItem = noop,
7070
+ renderItem,
7063
7071
  className,
7064
7072
  children,
7065
7073
  header,
@@ -7071,7 +7079,7 @@ function InternalList(props, ref) {
7071
7079
  var items;
7072
7080
 
7073
7081
  if (dataSource && dataSource.length > 0) {
7074
- items = dataSource.map((item, index) => renderItem(item, index));
7082
+ items = dataSource.map((item, index) => renderItem && renderItem(item, index));
7075
7083
  } else {
7076
7084
  items = children;
7077
7085
  }
@@ -7859,7 +7867,8 @@ var react_select_esm_excluded = ["prefixCls", "className", "size"];
7859
7867
 
7860
7868
 
7861
7869
 
7862
- var Select = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef((props, ref) => {
7870
+
7871
+ var InternalSelect = (props, ref) => {
7863
7872
  var {
7864
7873
  prefixCls = 'w-select',
7865
7874
  className,
@@ -7871,7 +7880,9 @@ var Select = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd
7871
7880
  ref: ref,
7872
7881
  className: [prefixCls, className, size ? prefixCls + "-" + size : null].filter(Boolean).join(' ').trim()
7873
7882
  }));
7874
- });
7883
+ };
7884
+
7885
+ var Select = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef(InternalSelect);
7875
7886
  Select.Option = Option;
7876
7887
  Select.Group = Group;
7877
7888
  /* harmony default export */ const react_select_esm = (Select);
@@ -8660,6 +8671,8 @@ function SearchSelect(props) {
8660
8671
  var inputRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
8661
8672
  var omitTagCount = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => maxTagCount && selectedValue.length > maxTagCount ? selectedValue.length - maxTagCount : 0, [selectedValue.length]);
8662
8673
  var divRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
8674
+ var tagContentRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
8675
+ var [tagClientWidth, setTagClientWidth] = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(180);
8663
8676
 
8664
8677
  var valueVerify = value => {
8665
8678
  return value !== undefined && value !== '';
@@ -8806,6 +8819,15 @@ function SearchSelect(props) {
8806
8819
  }
8807
8820
  }
8808
8821
 
8822
+ external_root_React_commonjs2_react_commonjs_react_amd_react_default().useEffect(() => {
8823
+ var _tagContentRef$curren;
8824
+
8825
+ if ((_tagContentRef$curren = tagContentRef.current) != null && _tagContentRef$curren.clientWidth) {
8826
+ var _tagContentRef$curren2;
8827
+
8828
+ setTagClientWidth((_tagContentRef$curren2 = tagContentRef.current) == null ? void 0 : _tagContentRef$curren2.clientWidth);
8829
+ }
8830
+ }, [tagContentRef.current]);
8809
8831
  return /*#__PURE__*/(0,jsx_runtime.jsx)(Dropdown, _extends({
8810
8832
  className: cls,
8811
8833
  trigger: "click",
@@ -8859,6 +8881,7 @@ function SearchSelect(props) {
8859
8881
  children: isMultiple ? /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
8860
8882
  className: [prefixCls + "-inner", prefixCls + "-search-" + showSearch, prefixCls + "-" + size].filter(Boolean).join(' ').trim(),
8861
8883
  children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
8884
+ ref: tagContentRef,
8862
8885
  className: [prefixCls + "-tag-content", disabled && prefixCls + "-tag-content-disabled"].filter(Boolean).join(' ').trim(),
8863
8886
  children: [isMultiple && selectedValue.slice(0, maxTagCount).map((item, index) => {
8864
8887
  return /*#__PURE__*/(0,jsx_runtime.jsx)(react_tag_esm, _extends({
@@ -8876,7 +8899,14 @@ function SearchSelect(props) {
8876
8899
  e.stopPropagation();
8877
8900
  handleItemsClick(index, item);
8878
8901
  },
8879
- children: item.label
8902
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
8903
+ style: {
8904
+ maxWidth: tagClientWidth - 63,
8905
+ textOverflow: 'ellipsis',
8906
+ overflow: 'auto'
8907
+ },
8908
+ children: item.label
8909
+ })
8880
8910
  }), index);
8881
8911
  }), !!omitTagCount && /*#__PURE__*/(0,jsx_runtime.jsxs)(react_tag_esm, {
8882
8912
  style: {
@@ -10567,8 +10597,10 @@ function Tabs(props) {
10567
10597
  flowNav.nav.forEach(item => {
10568
10598
  var curWidth = item.curWidth - deviation;
10569
10599
 
10570
- if (curWidth < flowNav.displayStart || curWidth > flowNav.displayEnd) {
10571
- hiddenNav.push(item.index);
10600
+ if (flowNav.displayStart > 0 || flowNav.displayEnd > 0) {
10601
+ if (curWidth < flowNav.displayStart || curWidth > flowNav.displayEnd) {
10602
+ hiddenNav.push(item.index);
10603
+ }
10572
10604
  }
10573
10605
  });
10574
10606
  hiddenNavSet(hiddenNav);