uiw 4.14.1 → 4.15.1

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.js CHANGED
@@ -321,6 +321,7 @@ __webpack_require__.d(__webpack_exports__, {
321
321
  "ButtonGroup": () => (/* reexport */ react_button_group_esm),
322
322
  "Calendar": () => (/* reexport */ Calendar),
323
323
  "Card": () => (/* reexport */ react_card_esm),
324
+ "Carousel": () => (/* reexport */ react_carousel_esm),
324
325
  "Checkbox": () => (/* reexport */ react_checkbox_esm),
325
326
  "CheckboxGroup": () => (/* reexport */ CheckboxGroup),
326
327
  "Col": () => (/* reexport */ Col),
@@ -3092,6 +3093,10 @@ class Popover extends (external_root_React_commonjs2_react_commonjs_react_amd_re
3092
3093
  })]
3093
3094
  }),
3094
3095
  children: typeof this.props.children === 'object' && this.props.children.type.name !== 'Icon' ? this.props.children : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
3096
+ style: {
3097
+ display: 'block',
3098
+ writingMode: 'vertical-rl'
3099
+ },
3095
3100
  children: this.props.children
3096
3101
  })
3097
3102
  }));
@@ -4021,6 +4026,167 @@ var react_card_esm_excluded = ["prefixCls", "className", "title", "extra", "foot
4021
4026
  }));
4022
4027
  }));
4023
4028
 
4029
+ ;// CONCATENATED MODULE: ../react-carousel/esm/style/index.css
4030
+ // extracted by mini-css-extract-plugin
4031
+ /* harmony default export */ const react_carousel_esm_style = ({});
4032
+ ;// CONCATENATED MODULE: ../react-carousel/esm/index.js
4033
+
4034
+
4035
+
4036
+
4037
+
4038
+
4039
+ function Carousel(props, ref) {
4040
+ var {
4041
+ position = 0,
4042
+ direction = 'horizontal',
4043
+ width = 400,
4044
+ height = 200,
4045
+ palyTime = 2000,
4046
+ scrollTime = 200,
4047
+ autoPlay = true,
4048
+ afterChange,
4049
+ beforeChange,
4050
+ prefixCls = 'w-carousel',
4051
+ className,
4052
+ style
4053
+ } = props;
4054
+ var cls = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => [prefixCls, className].filter(Boolean).join(' ').trim(), [prefixCls, className]);
4055
+ var [currentPosition, currentPositionSet] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(position);
4056
+ var [transitionInner, transitionInnerSet] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(scrollTime * 0.001 + "s ease-in-out");
4057
+ var positionRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(currentPosition);
4058
+ var childCount = external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.count(props.children) + 1;
4059
+
4060
+ var _stopPlay = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
4061
+ stop: () => {},
4062
+ after: afterChange,
4063
+ before: beforeChange
4064
+ });
4065
+
4066
+ external_root_React_commonjs2_react_commonjs_react_amd_react_default().useImperativeHandle(ref, () => ({
4067
+ gotoSlide,
4068
+ prevSlide: () => gotoSlide(positionRef.current - 1),
4069
+ nextSlide: () => gotoSlide(positionRef.current + 1),
4070
+ stopPlay: () => _stopPlay.current.stop()
4071
+ }), [ref]);
4072
+
4073
+ var gotoSlide = slidNumber => {
4074
+ _stopPlay.current.stop();
4075
+
4076
+ var maxSlid = childCount - 1;
4077
+ var slidNumberTemp = slidNumber > maxSlid ? maxSlid : slidNumber;
4078
+ slidNumberTemp = slidNumber < 0 ? 0 : slidNumberTemp;
4079
+ positionRef.current = slidNumberTemp;
4080
+ currentPositionSet(slidNumberTemp);
4081
+ play();
4082
+ };
4083
+
4084
+ var play = function play(ms) {
4085
+ if (ms === void 0) {
4086
+ ms = palyTime;
4087
+ }
4088
+
4089
+ if (autoPlay) {
4090
+ var time = setInterval(() => {
4091
+ _stopPlay.current.after == null ? void 0 : _stopPlay.current.after(positionRef.current);
4092
+ positionRef.current++;
4093
+
4094
+ if (positionRef.current >= childCount) {
4095
+ positionRef.current = 0;
4096
+ }
4097
+
4098
+ currentPositionSet(positionRef.current);
4099
+ _stopPlay.current.before == null ? void 0 : _stopPlay.current.before(positionRef.current);
4100
+ }, ms);
4101
+
4102
+ _stopPlay.current.stop = () => {
4103
+ clearInterval(time);
4104
+ };
4105
+ }
4106
+ };
4107
+
4108
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
4109
+ play();
4110
+ return () => {
4111
+ _stopPlay.current.stop();
4112
+ };
4113
+ }, [autoPlay]);
4114
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
4115
+ var time;
4116
+
4117
+ if (childCount === currentPosition + 1) {
4118
+ time = setTimeout(() => {
4119
+ _stopPlay.current.before = () => {
4120
+ transitionInnerSet(scrollTime * 0.001 + "s ease-in-out");
4121
+ _stopPlay.current.before = props.beforeChange;
4122
+ };
4123
+
4124
+ transitionInnerSet('none');
4125
+ gotoSlide(0);
4126
+ }, scrollTime);
4127
+ }
4128
+
4129
+ return () => {
4130
+ clearTimeout(time);
4131
+ };
4132
+ }, [currentPosition]);
4133
+ var childrens = external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.map(props.children, child => {
4134
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
4135
+ style: _extends({
4136
+ width,
4137
+ height
4138
+ }, style),
4139
+ children: child
4140
+ });
4141
+ });
4142
+ var innerStyle = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
4143
+ var style = {
4144
+ transform: '',
4145
+ display: ''
4146
+ };
4147
+
4148
+ switch (direction) {
4149
+ case 'horizontal':
4150
+ style.transform = "translate3d(" + -(currentPosition * width) + "px, 0px, 0px)";
4151
+ style.display = 'flex';
4152
+ break;
4153
+
4154
+ case 'vertical':
4155
+ style.transform = "translate3d(0px, " + -(currentPosition * height) + "px, 0px)";
4156
+ style.display = 'block';
4157
+ break;
4158
+
4159
+ default:
4160
+ break;
4161
+ }
4162
+
4163
+ return style;
4164
+ }, [direction, currentPosition, width, height]);
4165
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
4166
+ className: cls,
4167
+ style: {
4168
+ width,
4169
+ height
4170
+ },
4171
+ children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
4172
+ className: cls + "-content",
4173
+ style: _extends({
4174
+ width: width * childCount,
4175
+ transition: transitionInner
4176
+ }, innerStyle),
4177
+ children: [childrens, /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
4178
+ style: _extends({
4179
+ width,
4180
+ height
4181
+ }, style),
4182
+ children: childrens == null ? void 0 : childrens[0]
4183
+ })]
4184
+ })
4185
+ });
4186
+ }
4187
+
4188
+ /* harmony default export */ const react_carousel_esm = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef(Carousel));
4189
+
4024
4190
  ;// CONCATENATED MODULE: ../react-radio/esm/RadioAbstract.js
4025
4191
 
4026
4192
 
@@ -7786,7 +7952,7 @@ var react_tag_esm_excluded = ["prefixCls", "className", "style", "title", "child
7786
7952
  className: cls,
7787
7953
  style: styl
7788
7954
  }, other, {
7789
- children: [title || children, closable ? /*#__PURE__*/(0,jsx_runtime.jsx)("svg", {
7955
+ children: [title || children, !disabled && closable ? /*#__PURE__*/(0,jsx_runtime.jsx)("svg", {
7790
7956
  onClick: onClose,
7791
7957
  className: prefixCls + "-close",
7792
7958
  width: "15",
@@ -7819,6 +7985,8 @@ var react_search_select_esm_excluded = ["allowClear", "disabled", "size", "maxTa
7819
7985
 
7820
7986
 
7821
7987
  function SearchSelect(props) {
7988
+ var _style$width;
7989
+
7822
7990
  var {
7823
7991
  allowClear = false,
7824
7992
  disabled = false,
@@ -7863,6 +8031,11 @@ function SearchSelect(props) {
7863
8031
  selectedValueChange(defaultValue);
7864
8032
  }
7865
8033
  }, []);
8034
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
8035
+ if (disabled) {
8036
+ setInnerIsOpen(false);
8037
+ }
8038
+ }, [disabled]);
7866
8039
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
7867
8040
  if (valueVerify(value)) {
7868
8041
  selectedValueChange(value);
@@ -7995,7 +8168,10 @@ function SearchSelect(props) {
7995
8168
  style: {
7996
8169
  marginTop: 5
7997
8170
  },
7998
- disabled: option && option.length > 0 ? false : true
8171
+ overlayStyl: {
8172
+ width: 100
8173
+ },
8174
+ disabled: disabled
7999
8175
  }, others, {
8000
8176
  onVisibleChange: onVisibleChange,
8001
8177
  isOpen: innerIsOpen,
@@ -8004,9 +8180,9 @@ function SearchSelect(props) {
8004
8180
  style: {
8005
8181
  minHeight: 25,
8006
8182
  maxHeight: 280,
8007
- minWidth: 200,
8183
+ minWidth: (_style$width = style == null ? void 0 : style.width) != null ? _style$width : 200,
8008
8184
  overflowY: 'scroll',
8009
- width: divRef.current ? divRef.current.offsetWidth : 'auto'
8185
+ width: style == null ? void 0 : style.width
8010
8186
  },
8011
8187
  children: !option || option.length === 0 ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
8012
8188
  style: {
@@ -8056,6 +8232,7 @@ function SearchSelect(props) {
8056
8232
  color: "#393E48"
8057
8233
  }, tagProps, {
8058
8234
  closable: true,
8235
+ disabled: disabled,
8059
8236
  onClose: e => {
8060
8237
  e.stopPropagation();
8061
8238
  handleItemsClick(index, item);
@@ -8085,7 +8262,7 @@ function SearchSelect(props) {
8085
8262
  value: selectedLabel,
8086
8263
  placeholder: selectedValue.length ? '' : placeholder
8087
8264
  })]
8088
- }), (selectIconType === 'close' || selectIconType === 'loading' && loading) && /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
8265
+ }), !disabled && (selectIconType === 'close' || selectIconType === 'loading' && loading) && /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
8089
8266
  type: selectIconType,
8090
8267
  spin: loading && selectIconType === 'loading',
8091
8268
  onClick: resetSelectedValue
@@ -8098,7 +8275,7 @@ function SearchSelect(props) {
8098
8275
  onChange: e => handleInputChange(e.target.value),
8099
8276
  value: selectedLabel,
8100
8277
  placeholder: placeholder,
8101
- addonAfter: (selectIconType === 'close' || selectIconType === 'loading' && loading) && /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
8278
+ addonAfter: !disabled && (selectIconType === 'close' || selectIconType === 'loading' && loading) && /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
8102
8279
  type: selectIconType,
8103
8280
  spin: loading && selectIconType === 'loading',
8104
8281
  onClick: resetSelectedValue
@@ -8851,59 +9028,6 @@ var react_switch_esm_excluded = ["prefixCls"];
8851
9028
  ;// CONCATENATED MODULE: ../react-table/esm/style/index.css
8852
9029
  // extracted by mini-css-extract-plugin
8853
9030
  /* harmony default export */ const react_table_esm_style = ({});
8854
- ;// CONCATENATED MODULE: ../react-table/esm/Thead.js
8855
-
8856
-
8857
- var Thead_excluded = ["prefixCls", "className", "data", "onCellHead"],
8858
- Thead_excluded2 = ["title", "key", "render", "children", "ellipsis"];
8859
-
8860
-
8861
-
8862
-
8863
- function TheadComponent(props) {
8864
- if (props === void 0) {
8865
- props = {};
8866
- }
8867
-
8868
- var {
8869
- prefixCls = 'w-table',
8870
- className,
8871
- data = [],
8872
- onCellHead = noop
8873
- } = props,
8874
- other = _objectWithoutPropertiesLoose(props, Thead_excluded);
8875
-
8876
- return /*#__PURE__*/(0,jsx_runtime.jsx)("thead", _extends({
8877
- className: [prefixCls, className].filter(Boolean).join(' ').trim()
8878
- }, other, {
8879
- children: data && data.length > 0 && data.map((tds, rowNum) => /*#__PURE__*/(0,jsx_runtime.jsx)("tr", {
8880
- children: (tds || []).map((item, colNum) => {
8881
- var {
8882
- title,
8883
- ellipsis
8884
- } = item,
8885
- thProps = _objectWithoutPropertiesLoose(item, Thead_excluded2);
8886
-
8887
- var titleNode = typeof title === 'function' ? title(item, colNum, rowNum) : title;
8888
-
8889
- if (thProps.colSpan === 0) {
8890
- return null;
8891
- }
8892
-
8893
- if (ellipsis) {
8894
- thProps.className = (thProps.className || '') + " " + prefixCls + "-ellipsis";
8895
- }
8896
-
8897
- return /*#__PURE__*/(0,jsx_runtime.jsx)("th", _extends({
8898
- onClick: evn => onCellHead(item, colNum, rowNum, evn)
8899
- }, thProps, {
8900
- children: titleNode
8901
- }), colNum);
8902
- })
8903
- }, rowNum))
8904
- }));
8905
- }
8906
-
8907
9031
  ;// CONCATENATED MODULE: ../react-table/esm/util.js
8908
9032
  /**
8909
9033
  * Get colspan number
@@ -9059,12 +9183,136 @@ function getAllColumnsKeys(data, keys) {
9059
9183
  if (data[i].children) {
9060
9184
  keys = keys.concat(getAllColumnsKeys(data[i].children || []));
9061
9185
  } else if (data[i].key) {
9062
- keys.push(data[i].key);
9186
+ keys.push(data[i]);
9063
9187
  }
9064
9188
  }
9065
9189
 
9066
9190
  return keys;
9067
9191
  }
9192
+ function locationFixed(fixed, location, index) {
9193
+ var _location$index, _location$index2;
9194
+
9195
+ if (!fixed) return {};
9196
+ if (fixed === 'right') return {
9197
+ right: (_location$index = location[index]) == null ? void 0 : _location$index.right
9198
+ };
9199
+ return {
9200
+ left: (_location$index2 = location[index]) == null ? void 0 : _location$index2.left
9201
+ };
9202
+ }
9203
+
9204
+ ;// CONCATENATED MODULE: ../react-table/esm/ThComponent.js
9205
+
9206
+
9207
+ var ThComponent_excluded = ["title", "key", "render", "children", "ellipsis", "fixed"];
9208
+
9209
+
9210
+
9211
+
9212
+ class ThComponent extends external_root_React_commonjs2_react_commonjs_react_amd_react_.Component {
9213
+ componentDidMount() {
9214
+ var rect = external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default().findDOMNode(this);
9215
+ this.props.updateLocation({
9216
+ width: rect.getBoundingClientRect().width
9217
+ }, this.props.colNum);
9218
+ }
9219
+
9220
+ render() {
9221
+ var {
9222
+ colNum,
9223
+ prefixCls,
9224
+ item,
9225
+ titleNode,
9226
+ onCellHead,
9227
+ rowNum,
9228
+ locationWidth
9229
+ } = this.props;
9230
+
9231
+ var {
9232
+ fixed = false
9233
+ } = item,
9234
+ thProps = _objectWithoutPropertiesLoose(item, ThComponent_excluded);
9235
+
9236
+ var cls = '';
9237
+
9238
+ if (fixed) {
9239
+ if (fixed === 'right') {
9240
+ cls = prefixCls + '-fixed-right';
9241
+ } else {
9242
+ cls = prefixCls + '-fixed-true';
9243
+ }
9244
+ }
9245
+
9246
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("th", _extends({}, thProps, {
9247
+ style: _extends({}, thProps.style, locationFixed(fixed, locationWidth, colNum)),
9248
+ className: prefixCls + "-tr-children-" + ((item == null ? void 0 : item.align) || 'left') + " " + (item.className || '') + " " + cls,
9249
+ onClick: evn => onCellHead == null ? void 0 : onCellHead(item, colNum, rowNum, evn),
9250
+ children: titleNode
9251
+ }), colNum);
9252
+ }
9253
+
9254
+ }
9255
+
9256
+ ;// CONCATENATED MODULE: ../react-table/esm/Thead.js
9257
+
9258
+
9259
+ var Thead_excluded = ["prefixCls", "className", "data", "onCellHead", "locationWidth", "updateLocation"],
9260
+ Thead_excluded2 = ["title", "key", "render", "children", "ellipsis", "fixed"];
9261
+
9262
+
9263
+
9264
+
9265
+
9266
+ function TheadComponent(props) {
9267
+ if (props === void 0) {
9268
+ props = {};
9269
+ }
9270
+
9271
+ var {
9272
+ prefixCls = 'w-table',
9273
+ className,
9274
+ data = [],
9275
+ onCellHead = noop,
9276
+ locationWidth,
9277
+ updateLocation
9278
+ } = props,
9279
+ other = _objectWithoutPropertiesLoose(props, Thead_excluded);
9280
+
9281
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("thead", _extends({
9282
+ className: [prefixCls, className].filter(Boolean).join(' ').trim()
9283
+ }, other, {
9284
+ children: data && data.length > 0 && data.map((tds, rowNum) => /*#__PURE__*/(0,jsx_runtime.jsx)("tr", {
9285
+ children: (tds || []).map((item, colNum) => {
9286
+ var {
9287
+ title,
9288
+ ellipsis,
9289
+ fixed = false
9290
+ } = item,
9291
+ thProps = _objectWithoutPropertiesLoose(item, Thead_excluded2);
9292
+
9293
+ var titleNode = /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
9294
+ className: ellipsis ? (thProps.className || '') + " " + prefixCls + "-ellipsis" : undefined,
9295
+ children: typeof title === 'function' ? title(item, colNum, rowNum) : title
9296
+ });
9297
+
9298
+ if (thProps.colSpan === 0) {
9299
+ return null;
9300
+ }
9301
+
9302
+ return /*#__PURE__*/(0,jsx_runtime.jsx)(ThComponent, {
9303
+ colNum: colNum,
9304
+ item: item,
9305
+ prefixCls: prefixCls,
9306
+ onCellHead: onCellHead,
9307
+ rowNum: rowNum,
9308
+ titleNode: titleNode,
9309
+ locationWidth: locationWidth,
9310
+ updateLocation: updateLocation
9311
+ }, colNum);
9312
+ })
9313
+ }, rowNum))
9314
+ }));
9315
+ }
9068
9316
 
9069
9317
  ;// CONCATENATED MODULE: ../react-table/esm/Expandable.js
9070
9318
 
@@ -9106,6 +9354,7 @@ function ExpandableComponent(_ref) {
9106
9354
 
9107
9355
 
9108
9356
 
9357
+
9109
9358
  function TableTr(props) {
9110
9359
  var {
9111
9360
  rowKey,
@@ -9118,9 +9367,16 @@ function TableTr(props) {
9118
9367
  isExpandedDom,
9119
9368
  hierarchy,
9120
9369
  indentSize,
9121
- childrenColumnName
9370
+ childrenColumnName,
9371
+ locationWidth
9122
9372
  } = props;
9373
+ var [isOpacity, setIsOpacity] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false);
9374
+ var [childrenIndex, setChildrenIndex] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0);
9123
9375
  var [expandIndex, setExpandIndex] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)([]);
9376
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
9377
+ setIsOpacity(!!(data != null && data.find(it => it[childrenColumnName])));
9378
+ setChildrenIndex((keys == null ? void 0 : keys.findIndex(it => it.key === 'uiw-expanded')) === -1 ? 0 : 1);
9379
+ }, [data]);
9124
9380
  var IconDom = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
9125
9381
  return (key, isOpacity) => {
9126
9382
  var flag = expandIndex.includes(key);
@@ -9129,7 +9385,9 @@ function TableTr(props) {
9129
9385
  style: {
9130
9386
  marginRight: 10,
9131
9387
  opacity: isOpacity ? 1 : 0,
9132
- marginLeft: hierarchy * indentSize
9388
+ marginLeft: hierarchy * indentSize,
9389
+ float: 'left',
9390
+ marginTop: 3.24
9133
9391
  },
9134
9392
  onClick: () => {
9135
9393
  setExpandIndex(flag ? expandIndex.filter(it => it !== key) : [...expandIndex, key]);
@@ -9149,11 +9407,11 @@ function TableTr(props) {
9149
9407
  children: [/*#__PURE__*/(0,jsx_runtime.jsx)("tr", {
9150
9408
  children: keys.map((keyName, colNum) => {
9151
9409
  var objs = {
9152
- children: trData[keyName]
9410
+ children: trData[keyName.key]
9153
9411
  };
9154
9412
 
9155
- if (render[keyName]) {
9156
- var child = render[keyName](trData[keyName], keyName, trData, rowNum, colNum);
9413
+ if (render[keyName.key]) {
9414
+ var child = render[keyName.key](trData[keyName.key], keyName.key, trData, rowNum, colNum);
9157
9415
 
9158
9416
  if ( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().isValidElement(child)) {
9159
9417
  objs.children = child;
@@ -9171,32 +9429,45 @@ function TableTr(props) {
9171
9429
  }
9172
9430
  }
9173
9431
 
9174
- if (ellipsis && ellipsis[keyName]) {
9175
- objs.className = prefixCls + "-ellipsis";
9176
- }
9177
-
9178
9432
  var isHasChildren = Array.isArray(trData[childrenColumnName]);
9179
9433
 
9180
- if (colNum === 0 && (hierarchy || isHasChildren)) {
9181
- objs.className = objs.className + " " + prefixCls + "-has-children";
9434
+ if (colNum === childrenIndex && (isOpacity || hierarchy || isHasChildren)) {
9182
9435
  objs.children = /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
9183
- children: [IconDom(key, isHasChildren), objs.children]
9436
+ children: [IconDom(key, isHasChildren), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
9437
+ style: {
9438
+ paddingLeft: hierarchy * indentSize
9439
+ }
9440
+ }), objs.children]
9184
9441
  });
9185
9442
  }
9186
9443
 
9444
+ if (keyName.fixed) {
9445
+ if (keyName.fixed === 'right') {
9446
+ objs.className = objs.className + " " + prefixCls + "-fixed-right";
9447
+ } else {
9448
+ objs.className = objs.className + " " + prefixCls + "-fixed-true";
9449
+ }
9450
+ }
9451
+
9187
9452
  return /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement)("td", _extends({}, objs, {
9453
+ style: _extends({}, locationFixed(keyName.fixed, locationWidth, colNum)),
9454
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
9455
+ className: ellipsis && ellipsis[keyName.key] ? prefixCls + "-ellipsis" : undefined,
9456
+ children: objs.children
9457
+ }),
9188
9458
  key: colNum,
9459
+ className: prefixCls + "-tr-children-" + (keyName.align || 'left') + " " + (keyName.className || '') + " " + (objs.className || ''),
9189
9460
  onClick: evn => onCell(trData, {
9190
9461
  rowNum,
9191
9462
  colNum,
9192
- keyName
9463
+ keyName: keyName.key
9193
9464
  }, evn)
9194
9465
  }));
9195
9466
  })
9196
- }, key), expandIndex.includes(key) && /*#__PURE__*/(0,jsx_runtime.jsx)(TableTr, _extends({}, props, {
9467
+ }, key), isExpandedDom(trData, rowNum), expandIndex.includes(key) && /*#__PURE__*/(0,jsx_runtime.jsx)(TableTr, _extends({}, props, {
9197
9468
  data: trData[childrenColumnName],
9198
9469
  hierarchy: hierarchy + 1
9199
- })), isExpandedDom(trData, rowNum)]
9470
+ }))]
9200
9471
  }, rowNum);
9201
9472
  })
9202
9473
  });
@@ -9205,7 +9476,7 @@ function TableTr(props) {
9205
9476
  ;// CONCATENATED MODULE: ../react-table/esm/index.js
9206
9477
 
9207
9478
 
9208
- var react_table_esm_excluded = ["prefixCls", "className", "columns", "data", "title", "footer", "bordered", "onCell", "onCellHead", "empty", "children", "expandable", "rowKey"];
9479
+ var react_table_esm_excluded = ["prefixCls", "className", "columns", "data", "title", "footer", "bordered", "onCell", "onCellHead", "empty", "children", "expandable", "rowKey", "scroll"];
9209
9480
 
9210
9481
 
9211
9482
 
@@ -9234,15 +9505,64 @@ function Table(props) {
9234
9505
  onCellHead = noop,
9235
9506
  empty,
9236
9507
  expandable,
9237
- rowKey
9508
+ rowKey,
9509
+ scroll
9238
9510
  } = props,
9239
9511
  other = _objectWithoutPropertiesLoose(props, react_table_esm_excluded);
9240
9512
 
9241
9513
  var [expandIndex, setExpandIndex] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)([]);
9514
+ var [locationWidth, setLocationWidth] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)({});
9515
+ var finalLocationWidth = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({});
9516
+
9517
+ var updateLocation = (params, index) => {
9518
+ finalLocationWidth.current = _extends({}, finalLocationWidth.current, {
9519
+ [index]: _extends({}, finalLocationWidth.current[index], params)
9520
+ });
9521
+
9522
+ if (index === columns.length - 1) {
9523
+ setLocationWidth(computed());
9524
+ }
9525
+ };
9526
+
9527
+ var computed = () => {
9528
+ var left = 0,
9529
+ right = 0;
9530
+
9531
+ for (var _index = 0; _index < columns.length; _index++) {
9532
+ if (finalLocationWidth.current[_index]) {
9533
+ finalLocationWidth.current[_index].left = left;
9534
+ left = finalLocationWidth.current[_index].width + left;
9535
+ }
9536
+ }
9537
+
9538
+ for (var _index2 = columns.length - 1; _index2 > -1; _index2--) {
9539
+ if (finalLocationWidth.current[_index2]) {
9540
+ finalLocationWidth.current[_index2].right = right;
9541
+ right = finalLocationWidth.current[_index2].width + right;
9542
+ }
9543
+ }
9544
+
9545
+ return finalLocationWidth.current;
9546
+ };
9547
+
9242
9548
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
9549
+ var childKey = (expandable == null ? void 0 : expandable.childrenColumnName) || 'children';
9550
+
9551
+ var deep = params => {
9552
+ var arr1 = [];
9553
+ var arr = params.map((it, index) => {
9554
+ if (Array.isArray(it[childKey])) {
9555
+ arr1.push(...deep(it[childKey]));
9556
+ }
9557
+
9558
+ return rowKey ? it[rowKey] : index;
9559
+ });
9560
+ return [...arr1, ...arr];
9561
+ };
9562
+
9243
9563
  if (expandable) {
9244
9564
  if (expandable.defaultExpandAllRows) {
9245
- setExpandIndex(data.map((it, index) => rowKey ? it[rowKey] : index));
9565
+ setExpandIndex(deep(data));
9246
9566
  return;
9247
9567
  }
9248
9568
 
@@ -9294,7 +9614,10 @@ function Table(props) {
9294
9614
  var selfColumns = [];
9295
9615
 
9296
9616
  if (expandable != null && expandable.expandedRowRender) {
9297
- keys = ['uiw-expanded', ...keys];
9617
+ keys = [{
9618
+ key: 'uiw-expanded',
9619
+ align: 'center'
9620
+ }, ...keys];
9298
9621
  selfColumns = [{
9299
9622
  title: '',
9300
9623
  key: 'uiw-expanded',
@@ -9343,31 +9666,54 @@ function Table(props) {
9343
9666
  selfColumns
9344
9667
  };
9345
9668
  }, [columns, expandIndex]);
9669
+ var style = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
9670
+ var style = {
9671
+ table: {},
9672
+ div: {}
9673
+ };
9674
+
9675
+ if (scroll) {
9676
+ if (scroll.x !== undefined) {
9677
+ style.table.minWidth = '100%';
9678
+ style.table.width = scroll.x;
9679
+ style.div.overflowX = 'auto';
9680
+ style.div.overflowY = 'hidden';
9681
+ }
9682
+
9683
+ if (scroll.y !== undefined) {
9684
+ style.div.maxHeight = scroll.y;
9685
+ style.div.overflowY = 'scroll';
9686
+ }
9687
+ }
9688
+
9689
+ return style;
9690
+ }, [scroll]);
9346
9691
  var cls = [prefixCls, className, bordered ? prefixCls + "-bordered" : null].filter(Boolean).join(' ').trim();
9347
9692
  var {
9348
9693
  header,
9349
9694
  render,
9350
9695
  ellipsis
9351
9696
  } = getLevelItems(self.selfColumns);
9352
- return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
9697
+ return /*#__PURE__*/(0,jsx_runtime.jsxs)((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, {
9353
9698
  children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", _extends({
9354
- style: {
9355
- overflowY: 'scroll'
9356
- },
9357
9699
  className: cls
9358
9700
  }, other, {
9701
+ style: _extends({}, other.style, style.div),
9359
9702
  children: /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
9360
- style: ellipsis ? {
9361
- tableLayout: 'fixed'
9362
- } : {},
9703
+ style: _extends({
9704
+ tableLayout: ellipsis ? 'fixed' : 'auto'
9705
+ }, style.table),
9363
9706
  children: [title && /*#__PURE__*/(0,jsx_runtime.jsx)("caption", {
9364
9707
  children: title
9365
9708
  }), columns && columns.length > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(TheadComponent, {
9366
9709
  onCellHead: onCellHead,
9367
- data: header
9710
+ data: header,
9711
+ locationWidth: locationWidth,
9712
+ updateLocation: updateLocation
9368
9713
  }), data && data.length > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)("tbody", {
9369
9714
  children: /*#__PURE__*/(0,jsx_runtime.jsx)(TableTr, {
9370
9715
  rowKey: rowKey,
9716
+ locationWidth: locationWidth,
9371
9717
  data: data,
9372
9718
  keys: self.keys,
9373
9719
  render: render,
@@ -9527,7 +9873,7 @@ function Tabs(props) {
9527
9873
  if (activeItem.current && type === 'line') {
9528
9874
  setSlideStyle({
9529
9875
  width: activeItem.current.clientWidth,
9530
- left: activeItem.current.offsetLeft + 15
9876
+ left: activeItem.current.offsetLeft
9531
9877
  });
9532
9878
  }
9533
9879
  }
@@ -9546,17 +9892,17 @@ function Tabs(props) {
9546
9892
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
9547
9893
  className: prefixCls + "-bar",
9548
9894
  ref: divContentRef,
9549
- children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
9895
+ children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
9550
9896
  className: prefixCls + "-nav",
9551
9897
  style: {
9552
9898
  width: 'max-content'
9553
9899
  },
9554
- children: renderNav(children)
9900
+ children: [renderNav(children), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
9901
+ style: slideStyle,
9902
+ className: prefixCls + "-slide"
9903
+ })]
9555
9904
  })
9556
9905
  })
9557
- }), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
9558
- style: slideStyle,
9559
- className: prefixCls + "-slide"
9560
9906
  }), hiddenNav.length > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(Popover, {
9561
9907
  trigger: "click",
9562
9908
  placement: "bottomRight",
@@ -9778,6 +10124,9 @@ function TreeNode(props) {
9778
10124
  children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
9779
10125
  className: prefixCls + "-label",
9780
10126
  children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
10127
+ style: {
10128
+ display: noChild ? 'none' : 'auto'
10129
+ },
9781
10130
  className: prefixCls + "-switcher",
9782
10131
  onClick: evn => onItemClick(item, evn),
9783
10132
  children: /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
@@ -9858,7 +10207,10 @@ var getChildKeys = function getChildKeys(childs, result, depth) {
9858
10207
  }
9859
10208
 
9860
10209
  childs.forEach(item => {
9861
- result.push(item.key);
10210
+ if (!item.hideNode) {
10211
+ result.push(item.key);
10212
+ }
10213
+
9862
10214
  if (typeof depth === 'number' && !(depth - 1)) return;
9863
10215
 
9864
10216
  if (item.children && item.children.length > 0) {
@@ -10218,6 +10570,7 @@ function SearchTagInput(props) {
10218
10570
  setInnerIsOpen(isOpen);
10219
10571
  if (!isOpen) searchValueChange('');
10220
10572
  },
10573
+ disabled: disabled,
10221
10574
  isOpen: innerIsOpen,
10222
10575
  menu: /*#__PURE__*/(0,jsx_runtime.jsx)(react_card_esm, {
10223
10576
  bodyStyle: emptyOption === true ? {
@@ -10255,6 +10608,7 @@ function SearchTagInput(props) {
10255
10608
  },
10256
10609
  className: prefixCls + "-tag",
10257
10610
  closable: true,
10611
+ disabled: disabled,
10258
10612
  color: "#393E48",
10259
10613
  onClose: e => {
10260
10614
  e.stopPropagation();
@@ -10264,10 +10618,7 @@ function SearchTagInput(props) {
10264
10618
  }, index);
10265
10619
  }), /*#__PURE__*/(0,jsx_runtime.jsx)(react_input_esm, {
10266
10620
  ref: inputRef,
10267
- style: {
10268
- flex: 1,
10269
- minWidth: 30
10270
- },
10621
+ style: {},
10271
10622
  className: prefixCls + "-input-contents",
10272
10623
  size: size,
10273
10624
  disabled: disabled,
@@ -10276,7 +10627,7 @@ function SearchTagInput(props) {
10276
10627
  value: searchValue,
10277
10628
  placeholder: selectedOption.length ? '' : placeholder
10278
10629
  })]
10279
- }), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
10630
+ }), !disabled && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
10280
10631
  style: {
10281
10632
  height: 25,
10282
10633
  width: 14
@@ -10513,7 +10864,7 @@ function Transfer(props) {
10513
10864
  var {
10514
10865
  placeholder,
10515
10866
  options,
10516
- value,
10867
+ value = [],
10517
10868
  showSearch = false,
10518
10869
  selectedAll = false,
10519
10870
  bodyStyle,
@@ -10536,11 +10887,11 @@ function Transfer(props) {
10536
10887
  right: CheckedStatus.UnChecked
10537
10888
  });
10538
10889
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
10539
- leftSelectedKeySet([]);
10540
- rightSelectedKeySet([]);
10541
- rightOpionSet(value || []);
10542
- value == null ? void 0 : value.forEach(selectd => selectOption.set(selectd.key, selectd.label));
10543
- hiddenNode(child => !!(value != null && value.find(selectd => child.key === selectd.key)));
10890
+ if (value) {
10891
+ rightOpionSet(value || []);
10892
+ value == null ? void 0 : value.forEach(selectd => selectOption.set(selectd.key, selectd.label));
10893
+ hiddenNode(child => !!(value != null && value.find(selectd => child.key === selectd.key)));
10894
+ }
10544
10895
  }, [JSON.stringify(value)]);
10545
10896
 
10546
10897
  var hiddenNode = callBackfn => {
@@ -10581,7 +10932,7 @@ function Transfer(props) {
10581
10932
 
10582
10933
  var iteratorParent = child => {
10583
10934
  if (child.parent) {
10584
- var selectCount = child.parent.children.filter(child => !selectOption.get(child.key)).length;
10935
+ var selectCount = child.parent.children.filter(child => !selectOption.get(child.key) && !child.hideNode).length;
10585
10936
  addOrDel(child.parent.key, child.parent.label, selectCount === 0);
10586
10937
  iteratorParent(child.parent);
10587
10938
  }
@@ -10611,22 +10962,22 @@ function Transfer(props) {
10611
10962
  };
10612
10963
 
10613
10964
  var transferClick = transferType => {
10614
- var selectOptionTemp = selectOption;
10615
-
10616
10965
  if (transferType === 'left') {
10617
10966
  leftSelectOption.forEach((value, key) => {
10618
- selectOptionTemp.set(key, value);
10967
+ selectOption.set(key, value);
10619
10968
  });
10969
+ leftSelectOptionSet(new Map());
10970
+ leftSelectedKeySet([]);
10620
10971
  } else {
10621
10972
  rightSelectedKeys.forEach(key => {
10622
10973
  selectOption.delete(key);
10623
10974
  });
10975
+ rightSelectedKeySet([]);
10624
10976
  }
10625
10977
 
10626
- selectOptionSet(selectOptionTemp); // leftSelectOptionSet(selectOptionTemp);
10627
-
10978
+ selectOptionSet(selectOption);
10628
10979
  var option = [];
10629
- selectOptionTemp.forEach((label, key) => option.push({
10980
+ selectOption.forEach((label, key) => option.push({
10630
10981
  key,
10631
10982
  label
10632
10983
  }));
@@ -10671,22 +11022,23 @@ function Transfer(props) {
10671
11022
 
10672
11023
  if ((_child$children3 = child.children) != null && _child$children3.length) {
10673
11024
  selectedOptionsRecursion(child.children);
10674
- } else {
10675
- if (!child.hideNode) {
10676
- selectOption.set(child.key, child.label);
10677
- keys.push(child.key);
10678
- }
11025
+ }
11026
+
11027
+ if (!child.hideNode) {
11028
+ leftSelectOption.set(child.key, child.label);
11029
+ keys.push(child.key);
10679
11030
  }
10680
11031
  });
10681
11032
  };
10682
11033
 
10683
11034
  selectedOptionsRecursion(selectedOptions);
11035
+ leftSelectOptionSet(leftSelectOption);
10684
11036
  leftSelectedKeySet(keys);
10685
11037
  } else {
10686
11038
  leftSelectedKeySet([]);
11039
+ leftSelectOptionSet(new Map());
10687
11040
  }
10688
11041
 
10689
- selectOptionSet(selectOption);
10690
11042
  selectAllCheckedSet(selectAllChecked);
10691
11043
  };
10692
11044
 
@@ -10695,16 +11047,12 @@ function Transfer(props) {
10695
11047
  selectAllChecked.right = isChecked ? 1 : 0;
10696
11048
 
10697
11049
  if (isChecked) {
10698
- var keys = rightOpions.map(child => {
10699
- selectOption.delete(child.key);
10700
- return child.key;
10701
- });
11050
+ var keys = rightOpions.map(child => child.key);
10702
11051
  rightSelectedKeySet(keys);
10703
11052
  } else {
10704
11053
  rightSelectedKeySet([]);
10705
11054
  }
10706
11055
 
10707
- selectOptionSet(selectOption);
10708
11056
  selectAllCheckedSet(selectAllChecked);
10709
11057
  };
10710
11058
 
@@ -10726,16 +11074,16 @@ function Transfer(props) {
10726
11074
  }, style),
10727
11075
  children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(react_card_esm, {
10728
11076
  bodyStyle: {
10729
- padding: 5
11077
+ padding: '5px 9px'
10730
11078
  },
10731
11079
  title: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
10732
11080
  children: [selectedAll && /*#__PURE__*/(0,jsx_runtime.jsx)(react_checkbox_esm, {
10733
11081
  indeterminate: leftSelectedKeys.length < selectedOptionsShowCount.current && !!leftSelectedKeys.length,
10734
11082
  checked: leftSelectedKeys.length >= selectedOptionsShowCount.current && !!leftSelectedKeys.length,
10735
11083
  onChange: selectAllLeftChange
10736
- }), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
11084
+ }), /*#__PURE__*/(0,jsx_runtime.jsxs)("label", {
10737
11085
  style: {
10738
- marginLeft: 10
11086
+ marginLeft: 3
10739
11087
  },
10740
11088
  children: [leftSelectedKeys.length, "/", selectedOptionsShowCount.current]
10741
11089
  })]
@@ -10760,17 +11108,19 @@ function Transfer(props) {
10760
11108
  children: [/*#__PURE__*/(0,jsx_runtime.jsx)(Arrow, {
10761
11109
  click: () => transferClick('left'),
10762
11110
  style: {
10763
- transform: 'rotate(-90deg)'
11111
+ transform: 'rotate(-90deg)',
11112
+ background: leftSelectedKeys.length > 0 ? '#393E48' : 'none'
10764
11113
  }
10765
11114
  }), /*#__PURE__*/(0,jsx_runtime.jsx)(Arrow, {
10766
11115
  click: () => transferClick('right'),
10767
11116
  style: {
10768
- transform: 'rotate(90deg)'
11117
+ transform: 'rotate(90deg)',
11118
+ background: rightSelectedKeys.length > 0 ? '#393E48' : 'none'
10769
11119
  }
10770
11120
  })]
10771
11121
  }), /*#__PURE__*/(0,jsx_runtime.jsxs)(react_card_esm, {
10772
11122
  bodyStyle: {
10773
- padding: 5
11123
+ padding: '5px 9px'
10774
11124
  },
10775
11125
  className: prefixCls + "-card",
10776
11126
  title: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
@@ -10778,9 +11128,9 @@ function Transfer(props) {
10778
11128
  indeterminate: rightSelectedKeys.length < rightOpions.length && !!rightSelectedKeys.length,
10779
11129
  checked: rightSelectedKeys.length === rightOpions.length && !!rightSelectedKeys.length,
10780
11130
  onChange: selectAllRightChange
10781
- }), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
11131
+ }), /*#__PURE__*/(0,jsx_runtime.jsxs)("label", {
10782
11132
  style: {
10783
- marginLeft: 10
11133
+ marginLeft: 3
10784
11134
  },
10785
11135
  children: [rightSelectedKeys.length, "/", rightOpions.length]
10786
11136
  })]