uiw 4.14.0 → 4.15.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.js CHANGED
@@ -190,7 +190,6 @@ module.exports = shouldUseNative() ? Object.assign : function (target, source) {
190
190
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
191
191
 
192
192
  "use strict";
193
- var __webpack_unused_export__;
194
193
  /** @license React v17.0.2
195
194
  * react-jsx-runtime.production.min.js
196
195
  *
@@ -199,7 +198,7 @@ var __webpack_unused_export__;
199
198
  * This source code is licensed under the MIT license found in the
200
199
  * LICENSE file in the root directory of this source tree.
201
200
  */
202
- __webpack_require__(382);var f=__webpack_require__(787),g=60103;__webpack_unused_export__=60107;if("function"===typeof Symbol&&Symbol.for){var h=Symbol.for;g=h("react.element");__webpack_unused_export__=h("react.fragment")}var m=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n=Object.prototype.hasOwnProperty,p={key:!0,ref:!0,__self:!0,__source:!0};
201
+ __webpack_require__(382);var f=__webpack_require__(787),g=60103;exports.Fragment=60107;if("function"===typeof Symbol&&Symbol.for){var h=Symbol.for;g=h("react.element");exports.Fragment=h("react.fragment")}var m=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n=Object.prototype.hasOwnProperty,p={key:!0,ref:!0,__self:!0,__source:!0};
203
202
  function q(c,a,k){var b,d={},e=null,l=null;void 0!==k&&(e=""+k);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(l=a.ref);for(b in a)n.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:g,type:c,key:e,ref:l,props:d,_owner:m.current}}exports.jsx=q;exports.jsxs=q;
204
203
 
205
204
 
@@ -322,6 +321,7 @@ __webpack_require__.d(__webpack_exports__, {
322
321
  "ButtonGroup": () => (/* reexport */ react_button_group_esm),
323
322
  "Calendar": () => (/* reexport */ Calendar),
324
323
  "Card": () => (/* reexport */ react_card_esm),
324
+ "Carousel": () => (/* reexport */ react_carousel_esm),
325
325
  "Checkbox": () => (/* reexport */ react_checkbox_esm),
326
326
  "CheckboxGroup": () => (/* reexport */ CheckboxGroup),
327
327
  "Col": () => (/* reexport */ Col),
@@ -4022,6 +4022,108 @@ var react_card_esm_excluded = ["prefixCls", "className", "title", "extra", "foot
4022
4022
  }));
4023
4023
  }));
4024
4024
 
4025
+ ;// CONCATENATED MODULE: ../react-carousel/esm/style/index.css
4026
+ // extracted by mini-css-extract-plugin
4027
+ /* harmony default export */ const react_carousel_esm_style = ({});
4028
+ ;// CONCATENATED MODULE: ../react-carousel/esm/index.js
4029
+
4030
+
4031
+
4032
+
4033
+
4034
+ function Carousel(props, ref) {
4035
+ var {
4036
+ position = 0,
4037
+ width = 400,
4038
+ height = 200,
4039
+ palyTime = 2000,
4040
+ scrollTime = 200,
4041
+ autoPlay = true,
4042
+ prefixCls = 'w-carousel',
4043
+ className,
4044
+ style
4045
+ } = props;
4046
+ var cls = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => [prefixCls, className].filter(Boolean).join(' ').trim(), [prefixCls, className]);
4047
+ var [currentPosition, currentPositionSet] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(position);
4048
+ var positionRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(currentPosition);
4049
+ var childCount = external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.count(props.children);
4050
+
4051
+ var _stopPlay = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(() => {});
4052
+
4053
+ external_root_React_commonjs2_react_commonjs_react_amd_react_default().useImperativeHandle(ref, () => ({
4054
+ gotoSlide,
4055
+ prevSlide: () => gotoSlide(positionRef.current - 1),
4056
+ nextSlide: () => gotoSlide(positionRef.current + 1),
4057
+ stopPlay: () => _stopPlay.current()
4058
+ }), [ref]);
4059
+
4060
+ var gotoSlide = slidNumber => {
4061
+ _stopPlay.current();
4062
+
4063
+ var maxSlid = childCount - 1;
4064
+ var slidNumberTemp = slidNumber > maxSlid ? maxSlid : slidNumber;
4065
+ slidNumberTemp = slidNumber < 0 ? 0 : slidNumberTemp;
4066
+ positionRef.current = slidNumberTemp;
4067
+ currentPositionSet(slidNumberTemp);
4068
+ play();
4069
+ };
4070
+
4071
+ var play = function play(ms) {
4072
+ if (ms === void 0) {
4073
+ ms = palyTime;
4074
+ }
4075
+
4076
+ if (autoPlay) {
4077
+ var time = setInterval(() => {
4078
+ positionRef.current++;
4079
+
4080
+ if (positionRef.current >= childCount) {
4081
+ positionRef.current = 0;
4082
+ }
4083
+
4084
+ currentPositionSet(positionRef.current);
4085
+ }, ms);
4086
+
4087
+ _stopPlay.current = () => {
4088
+ clearInterval(time);
4089
+ };
4090
+ }
4091
+ };
4092
+
4093
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
4094
+ play();
4095
+ return () => {
4096
+ _stopPlay.current();
4097
+ };
4098
+ }, [autoPlay]);
4099
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
4100
+ className: cls,
4101
+ style: {
4102
+ width,
4103
+ height
4104
+ },
4105
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
4106
+ className: cls + "-content",
4107
+ style: {
4108
+ width: width * childCount,
4109
+ transform: "translate3d(" + -(currentPosition * width) + "px, 0px, 0px)",
4110
+ transition: scrollTime * 0.001 + "s ease-in-out"
4111
+ },
4112
+ children: external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.map(props.children, child => {
4113
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
4114
+ style: _extends({
4115
+ width,
4116
+ height
4117
+ }, style),
4118
+ children: child
4119
+ });
4120
+ })
4121
+ })
4122
+ });
4123
+ }
4124
+
4125
+ /* harmony default export */ const react_carousel_esm = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef(Carousel));
4126
+
4025
4127
  ;// CONCATENATED MODULE: ../react-radio/esm/RadioAbstract.js
4026
4128
 
4027
4129
 
@@ -7820,6 +7922,8 @@ var react_search_select_esm_excluded = ["allowClear", "disabled", "size", "maxTa
7820
7922
 
7821
7923
 
7822
7924
  function SearchSelect(props) {
7925
+ var _style$width;
7926
+
7823
7927
  var {
7824
7928
  allowClear = false,
7825
7929
  disabled = false,
@@ -7996,6 +8100,9 @@ function SearchSelect(props) {
7996
8100
  style: {
7997
8101
  marginTop: 5
7998
8102
  },
8103
+ overlayStyl: {
8104
+ width: 100
8105
+ },
7999
8106
  disabled: option && option.length > 0 ? false : true
8000
8107
  }, others, {
8001
8108
  onVisibleChange: onVisibleChange,
@@ -8005,9 +8112,9 @@ function SearchSelect(props) {
8005
8112
  style: {
8006
8113
  minHeight: 25,
8007
8114
  maxHeight: 280,
8008
- minWidth: 200,
8115
+ minWidth: (_style$width = style == null ? void 0 : style.width) != null ? _style$width : 200,
8009
8116
  overflowY: 'scroll',
8010
- width: divRef.current ? divRef.current.offsetWidth : 'auto'
8117
+ width: style == null ? void 0 : style.width
8011
8118
  },
8012
8119
  children: !option || option.length === 0 ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
8013
8120
  style: {
@@ -8895,9 +9002,9 @@ function TheadComponent(props) {
8895
9002
  thProps.className = (thProps.className || '') + " " + prefixCls + "-ellipsis";
8896
9003
  }
8897
9004
 
8898
- return /*#__PURE__*/(0,jsx_runtime.jsx)("th", _extends({
8899
- onClick: evn => onCellHead(item, colNum, rowNum, evn)
8900
- }, thProps, {
9005
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("th", _extends({}, thProps, {
9006
+ className: prefixCls + "-tr-children-" + ((item == null ? void 0 : item.align) || 'left') + " " + (className || ''),
9007
+ onClick: evn => onCellHead(item, colNum, rowNum, evn),
8901
9008
  children: titleNode
8902
9009
  }), colNum);
8903
9010
  })
@@ -9060,7 +9167,7 @@ function getAllColumnsKeys(data, keys) {
9060
9167
  if (data[i].children) {
9061
9168
  keys = keys.concat(getAllColumnsKeys(data[i].children || []));
9062
9169
  } else if (data[i].key) {
9063
- keys.push(data[i].key);
9170
+ keys.push(data[i]);
9064
9171
  }
9065
9172
  }
9066
9173
 
@@ -9097,18 +9204,135 @@ function ExpandableComponent(_ref) {
9097
9204
  });
9098
9205
  }
9099
9206
 
9207
+ ;// CONCATENATED MODULE: ../react-table/esm/TableTr.js
9208
+
9209
+
9210
+
9211
+
9212
+
9213
+
9214
+
9215
+
9216
+
9217
+ function TableTr(props) {
9218
+ var {
9219
+ rowKey,
9220
+ data,
9221
+ keys,
9222
+ render,
9223
+ ellipsis,
9224
+ prefixCls,
9225
+ onCell = noop,
9226
+ isExpandedDom,
9227
+ hierarchy,
9228
+ indentSize,
9229
+ childrenColumnName
9230
+ } = props;
9231
+ var [isOpacity, setIsOpacity] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false);
9232
+ var [expandIndex, setExpandIndex] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)([]);
9233
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
9234
+ setIsOpacity(!!(data != null && data.find(it => it[childrenColumnName])));
9235
+ }, [data]);
9236
+ var IconDom = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
9237
+ return (key, isOpacity) => {
9238
+ var flag = expandIndex.includes(key);
9239
+ return /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
9240
+ type: flag ? 'minus-square-o' : 'plus-square-o',
9241
+ style: {
9242
+ marginRight: 10,
9243
+ opacity: isOpacity ? 1 : 0,
9244
+ marginLeft: hierarchy * indentSize,
9245
+ float: 'left',
9246
+ marginTop: 3.24
9247
+ },
9248
+ onClick: () => {
9249
+ setExpandIndex(flag ? expandIndex.filter(it => it !== key) : [...expandIndex, key]);
9250
+ }
9251
+ });
9252
+ };
9253
+ }, [expandIndex]);
9254
+
9255
+ if (!Array.isArray(data) || !data.length) {
9256
+ return null;
9257
+ }
9258
+
9259
+ return /*#__PURE__*/(0,jsx_runtime.jsx)((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, {
9260
+ children: data.map((trData, rowNum) => {
9261
+ var key = rowKey ? trData[rowKey] : rowNum;
9262
+ return /*#__PURE__*/(0,jsx_runtime.jsxs)((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, {
9263
+ children: [/*#__PURE__*/(0,jsx_runtime.jsx)("tr", {
9264
+ children: keys.map((keyName, colNum) => {
9265
+ var objs = {
9266
+ children: trData[keyName.key]
9267
+ };
9268
+
9269
+ if (render[keyName.key]) {
9270
+ var child = render[keyName.key](trData[keyName.key], keyName.key, trData, rowNum, colNum);
9271
+
9272
+ if ( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().isValidElement(child)) {
9273
+ objs.children = child;
9274
+ } else {
9275
+ if (child.props) {
9276
+ objs = _extends({}, child.props, {
9277
+ children: objs.children
9278
+ });
9279
+ if (child.props.rowSpan === 0 || child.props.colSpan === 0) return null;
9280
+ }
9281
+
9282
+ if (child.children) {
9283
+ objs.children = child.children;
9284
+ }
9285
+ }
9286
+ }
9287
+
9288
+ if (ellipsis && ellipsis[keyName.key]) {
9289
+ objs.className = prefixCls + "-ellipsis";
9290
+ }
9291
+
9292
+ var isHasChildren = Array.isArray(trData[childrenColumnName]);
9293
+
9294
+ if (colNum === 0 && (isOpacity || hierarchy || isHasChildren)) {
9295
+ objs.children = /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
9296
+ children: [IconDom(key, isHasChildren), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
9297
+ style: {
9298
+ paddingLeft: hierarchy * indentSize
9299
+ }
9300
+ }), objs.children]
9301
+ });
9302
+ }
9303
+
9304
+ return /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement)("td", _extends({}, objs, {
9305
+ key: colNum // style={keyName?.style}
9306
+ ,
9307
+ className: (objs.className || '') + " " + prefixCls + "-tr-children-" + (keyName.align || 'left') + " " + (keyName.className || ''),
9308
+ onClick: evn => onCell(trData, {
9309
+ rowNum,
9310
+ colNum,
9311
+ keyName: keyName.key
9312
+ }, evn)
9313
+ }));
9314
+ })
9315
+ }, key), expandIndex.includes(key) && /*#__PURE__*/(0,jsx_runtime.jsx)(TableTr, _extends({}, props, {
9316
+ data: trData[childrenColumnName],
9317
+ hierarchy: hierarchy + 1
9318
+ })), isExpandedDom(trData, rowNum)]
9319
+ }, rowNum);
9320
+ })
9321
+ });
9322
+ }
9323
+
9100
9324
  ;// CONCATENATED MODULE: ../react-table/esm/index.js
9101
9325
 
9102
9326
 
9103
- var react_table_esm_excluded = ["prefixCls", "className", "columns", "data", "title", "footer", "bordered", "onCell", "onCellHead", "empty", "children", "expandable", "rowKey"];
9327
+ var react_table_esm_excluded = ["prefixCls", "className", "columns", "data", "title", "footer", "bordered", "onCell", "onCellHead", "empty", "children", "expandable", "rowKey", "scroll"];
9104
9328
 
9105
9329
 
9106
9330
 
9107
9331
 
9108
9332
 
9109
9333
 
9110
- // 展开配置
9111
9334
 
9335
+ // 展开配置
9112
9336
 
9113
9337
 
9114
9338
 
@@ -9129,7 +9353,8 @@ function Table(props) {
9129
9353
  onCellHead = noop,
9130
9354
  empty,
9131
9355
  expandable,
9132
- rowKey
9356
+ rowKey,
9357
+ scroll
9133
9358
  } = props,
9134
9359
  other = _objectWithoutPropertiesLoose(props, react_table_esm_excluded);
9135
9360
 
@@ -9184,119 +9409,118 @@ function Table(props) {
9184
9409
  });
9185
9410
  };
9186
9411
  }, [expandable, expandIndex]);
9187
- var keys = getAllColumnsKeys(columns);
9188
- var selfColumns = [];
9189
-
9190
- if (expandable != null && expandable.expandedRowRender) {
9191
- keys = ['uiw-expanded', ...keys];
9192
- selfColumns = [{
9193
- title: '',
9194
- key: 'uiw-expanded',
9195
- width: 50,
9196
- align: 'center',
9197
- render: (text, key, record, index) => {
9198
- var _expandable$defaultEx;
9199
-
9200
- return /*#__PURE__*/(0,jsx_runtime.jsx)(ExpandableComponent, {
9201
- defaultExpand: expandable.defaultExpandAllRows === undefined ? !!((_expandable$defaultEx = expandable.defaultExpandedRowKeys) != null && _expandable$defaultEx.includes(rowKey ? record[rowKey] : index)) : !!expandable.defaultExpandAllRows,
9202
- onClick: expand => {
9203
- expandable.onExpand == null ? void 0 : expandable.onExpand(expand, record, index);
9204
-
9205
- if (expand) {
9206
- var result = expandIndex.filter(it => rowKey ? it !== record[rowKey] : it !== index);
9207
- expandable.onExpandedRowsChange ? expandable.onExpandedRowsChange(result) : setExpandIndex(result);
9208
- } else {
9209
- var _result = [...expandIndex, rowKey ? record[rowKey] : index];
9210
- expandable.onExpandedRowsChange ? expandable.onExpandedRowsChange(_result) : setExpandIndex(_result);
9211
- }
9212
- },
9213
- expandIcon: expand => {
9214
- if (expandable.rowExpandable && !(expandable.rowExpandable != null && expandable.rowExpandable(record))) {
9215
- return null;
9412
+ var self = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
9413
+ var keys = getAllColumnsKeys(columns);
9414
+ var selfColumns = [];
9415
+
9416
+ if (expandable != null && expandable.expandedRowRender) {
9417
+ keys = [{
9418
+ key: 'uiw-expanded',
9419
+ align: 'center'
9420
+ }, ...keys];
9421
+ selfColumns = [{
9422
+ title: '',
9423
+ key: 'uiw-expanded',
9424
+ width: 50,
9425
+ align: 'center',
9426
+ render: (text, key, record, index) => {
9427
+ var _expandable$defaultEx;
9428
+
9429
+ return /*#__PURE__*/(0,jsx_runtime.jsx)(ExpandableComponent, {
9430
+ defaultExpand: expandable.defaultExpandAllRows === undefined ? !!((_expandable$defaultEx = expandable.defaultExpandedRowKeys) != null && _expandable$defaultEx.includes(rowKey ? record[rowKey] : index)) : !!expandable.defaultExpandAllRows,
9431
+ onClick: expand => {
9432
+ expandable.onExpand == null ? void 0 : expandable.onExpand(expand, record, index);
9433
+
9434
+ if (expand) {
9435
+ var result = expandIndex.filter(it => rowKey ? it !== record[rowKey] : it !== index);
9436
+ expandable.onExpandedRowsChange ? expandable.onExpandedRowsChange(result) : setExpandIndex(result);
9437
+ } else {
9438
+ var _result = [...expandIndex, rowKey ? record[rowKey] : index];
9439
+ expandable.onExpandedRowsChange ? expandable.onExpandedRowsChange(_result) : setExpandIndex(_result);
9440
+ }
9441
+ },
9442
+ expandIcon: expand => {
9443
+ if (expandable.rowExpandable && !(expandable.rowExpandable != null && expandable.rowExpandable(record))) {
9444
+ return null;
9445
+ }
9446
+
9447
+ if (expandable.expandIcon) {
9448
+ return expandable.expandIcon(expand, record, index);
9449
+ }
9450
+
9451
+ return expand ? /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
9452
+ type: "minus-square-o"
9453
+ }) : /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
9454
+ type: "plus-square-o"
9455
+ });
9216
9456
  }
9457
+ });
9458
+ }
9459
+ }, ...columns];
9460
+ } else {
9461
+ selfColumns = [...columns];
9462
+ }
9217
9463
 
9218
- if (expandable.expandIcon) {
9219
- return expandable.expandIcon(expand, record, index);
9220
- }
9464
+ return {
9465
+ keys,
9466
+ selfColumns
9467
+ };
9468
+ }, [columns, expandIndex]);
9469
+ var style = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
9470
+ var style = {
9471
+ table: {},
9472
+ div: {}
9473
+ };
9221
9474
 
9222
- return expand ? /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
9223
- type: "minus-square-o"
9224
- }) : /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
9225
- type: "plus-square-o"
9226
- });
9227
- }
9228
- });
9475
+ if (scroll) {
9476
+ if (scroll.x !== undefined) {
9477
+ style.table.minWidth = '100%';
9478
+ style.table.width = scroll.x;
9479
+ style.div.overflowX = 'auto';
9480
+ style.div.overflowY = 'hidden';
9229
9481
  }
9230
- }, ...columns];
9231
- } else {
9232
- selfColumns = [...columns];
9233
- }
9234
9482
 
9483
+ if (scroll.y !== undefined) {
9484
+ style.div.maxHeight = scroll.y;
9485
+ style.div.overflowY = 'scroll';
9486
+ }
9487
+ }
9488
+
9489
+ return style;
9490
+ }, [scroll]);
9235
9491
  var cls = [prefixCls, className, bordered ? prefixCls + "-bordered" : null].filter(Boolean).join(' ').trim();
9236
9492
  var {
9237
9493
  header,
9238
9494
  render,
9239
9495
  ellipsis
9240
- } = getLevelItems(selfColumns);
9241
- return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
9496
+ } = getLevelItems(self.selfColumns);
9497
+ return /*#__PURE__*/(0,jsx_runtime.jsxs)((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, {
9242
9498
  children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", _extends({
9243
- style: {
9244
- overflowY: 'scroll'
9245
- },
9246
9499
  className: cls
9247
9500
  }, other, {
9501
+ style: _extends({}, other.style, style.div),
9248
9502
  children: /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
9249
- style: ellipsis ? {
9250
- tableLayout: 'fixed'
9251
- } : {},
9503
+ style: _extends({
9504
+ tableLayout: ellipsis ? 'fixed' : 'auto'
9505
+ }, style.table),
9252
9506
  children: [title && /*#__PURE__*/(0,jsx_runtime.jsx)("caption", {
9253
9507
  children: title
9254
9508
  }), columns && columns.length > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(TheadComponent, {
9255
9509
  onCellHead: onCellHead,
9256
9510
  data: header
9257
9511
  }), data && data.length > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)("tbody", {
9258
- children: data.map((trData, rowNum) => {
9259
- return /*#__PURE__*/(0,jsx_runtime.jsxs)((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, {
9260
- children: [/*#__PURE__*/(0,jsx_runtime.jsx)("tr", {
9261
- children: keys.map((keyName, colNum) => {
9262
- var objs = {
9263
- children: trData[keyName]
9264
- };
9265
-
9266
- if (render[keyName]) {
9267
- var child = render[keyName](trData[keyName], keyName, trData, rowNum, colNum);
9268
-
9269
- if ( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().isValidElement(child)) {
9270
- objs.children = child;
9271
- } else {
9272
- if (child.props) {
9273
- objs = _extends({}, child.props, {
9274
- children: objs.children
9275
- });
9276
- if (child.props.rowSpan === 0 || child.props.colSpan === 0) return null;
9277
- }
9278
-
9279
- if (child.children) {
9280
- objs.children = child.children;
9281
- }
9282
- }
9283
- }
9284
-
9285
- if (ellipsis && ellipsis[keyName]) {
9286
- objs.className = prefixCls + "-ellipsis";
9287
- }
9288
-
9289
- return /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement)("td", _extends({}, objs, {
9290
- key: colNum,
9291
- onClick: evn => onCell(trData, {
9292
- rowNum,
9293
- colNum,
9294
- keyName
9295
- }, evn)
9296
- }));
9297
- })
9298
- }, rowKey ? trData[rowKey] + '' : rowNum), isExpandedDom(trData, rowNum)]
9299
- }, rowNum);
9512
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)(TableTr, {
9513
+ rowKey: rowKey,
9514
+ data: data,
9515
+ keys: self.keys,
9516
+ render: render,
9517
+ ellipsis: ellipsis,
9518
+ prefixCls: prefixCls,
9519
+ onCell: onCell,
9520
+ hierarchy: 0,
9521
+ isExpandedDom: isExpandedDom,
9522
+ indentSize: (expandable == null ? void 0 : expandable.indentSize) || 16,
9523
+ childrenColumnName: (expandable == null ? void 0 : expandable.childrenColumnName) || 'children'
9300
9524
  })
9301
9525
  }), data && data.length === 0 && empty && /*#__PURE__*/(0,jsx_runtime.jsx)("tbody", {
9302
9526
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("tr", {
@@ -9446,7 +9670,7 @@ function Tabs(props) {
9446
9670
  if (activeItem.current && type === 'line') {
9447
9671
  setSlideStyle({
9448
9672
  width: activeItem.current.clientWidth,
9449
- left: activeItem.current.offsetLeft + 15
9673
+ left: activeItem.current.offsetLeft
9450
9674
  });
9451
9675
  }
9452
9676
  }
@@ -9465,17 +9689,17 @@ function Tabs(props) {
9465
9689
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
9466
9690
  className: prefixCls + "-bar",
9467
9691
  ref: divContentRef,
9468
- children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
9692
+ children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
9469
9693
  className: prefixCls + "-nav",
9470
9694
  style: {
9471
9695
  width: 'max-content'
9472
9696
  },
9473
- children: renderNav(children)
9697
+ children: [renderNav(children), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
9698
+ style: slideStyle,
9699
+ className: prefixCls + "-slide"
9700
+ })]
9474
9701
  })
9475
9702
  })
9476
- }), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
9477
- style: slideStyle,
9478
- className: prefixCls + "-slide"
9479
9703
  }), hiddenNav.length > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(Popover, {
9480
9704
  trigger: "click",
9481
9705
  placement: "bottomRight",
@@ -9697,6 +9921,9 @@ function TreeNode(props) {
9697
9921
  children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
9698
9922
  className: prefixCls + "-label",
9699
9923
  children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
9924
+ style: {
9925
+ display: noChild ? 'none' : 'auto'
9926
+ },
9700
9927
  className: prefixCls + "-switcher",
9701
9928
  onClick: evn => onItemClick(item, evn),
9702
9929
  children: /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
@@ -9777,7 +10004,10 @@ var getChildKeys = function getChildKeys(childs, result, depth) {
9777
10004
  }
9778
10005
 
9779
10006
  childs.forEach(item => {
9780
- result.push(item.key);
10007
+ if (!item.hideNode) {
10008
+ result.push(item.key);
10009
+ }
10010
+
9781
10011
  if (typeof depth === 'number' && !(depth - 1)) return;
9782
10012
 
9783
10013
  if (item.children && item.children.length > 0) {
@@ -10420,12 +10650,21 @@ function SearchTree(props) {
10420
10650
 
10421
10651
 
10422
10652
 
10653
+ var CheckedStatus;
10654
+
10655
+ (function (CheckedStatus) {
10656
+ CheckedStatus[CheckedStatus["UnChecked"] = 0] = "UnChecked";
10657
+ CheckedStatus[CheckedStatus["AllChecked"] = 1] = "AllChecked";
10658
+ CheckedStatus[CheckedStatus["Indeterminate"] = 2] = "Indeterminate";
10659
+ })(CheckedStatus || (CheckedStatus = {}));
10660
+
10423
10661
  function Transfer(props) {
10424
10662
  var {
10425
10663
  placeholder,
10426
10664
  options,
10427
- value,
10665
+ value = [],
10428
10666
  showSearch = false,
10667
+ selectedAll = false,
10429
10668
  bodyStyle,
10430
10669
  style,
10431
10670
  className,
@@ -10435,19 +10674,27 @@ function Transfer(props) {
10435
10674
  var [searchValueLeft, searchValueLeftSet] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)('');
10436
10675
  var [searchValueRight, searchValueRightSet] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)('');
10437
10676
  var [selectedOptions, selectedOptionSet] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(options || []);
10677
+ var selectedOptionsShowCount = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(0);
10438
10678
  var [selectOption, selectOptionSet] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(new Map());
10679
+ var [leftSelectOption, leftSelectOptionSet] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(new Map());
10439
10680
  var [leftSelectedKeys, leftSelectedKeySet] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)([]);
10440
10681
  var [rightSelectedKeys, rightSelectedKeySet] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)([]);
10441
10682
  var [rightOpions, rightOpionSet] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)([]);
10683
+ var [selectAllChecked, selectAllCheckedSet] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)({
10684
+ left: CheckedStatus.UnChecked,
10685
+ right: CheckedStatus.UnChecked
10686
+ });
10442
10687
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
10443
- leftSelectedKeySet([]);
10444
- rightSelectedKeySet([]);
10445
- rightOpionSet(value || []);
10446
- value == null ? void 0 : value.forEach(selectd => selectOption.set(selectd.key, selectd.label));
10447
- hiddenNode(child => !!(value != null && value.find(selectd => child.key === selectd.key)));
10688
+ if (value) {
10689
+ rightOpionSet(value || []);
10690
+ value == null ? void 0 : value.forEach(selectd => selectOption.set(selectd.key, selectd.label));
10691
+ hiddenNode(child => !!(value != null && value.find(selectd => child.key === selectd.key)));
10692
+ }
10448
10693
  }, [JSON.stringify(value)]);
10449
10694
 
10450
10695
  var hiddenNode = callBackfn => {
10696
+ selectedOptionsShowCount.current = 0;
10697
+
10451
10698
  var hiddenNodeForSeach = childrens => {
10452
10699
  childrens.forEach(child => {
10453
10700
  var _child$children;
@@ -10461,6 +10708,10 @@ function Transfer(props) {
10461
10708
  } else {
10462
10709
  child.hideNode = isHide;
10463
10710
  }
10711
+
10712
+ if (!child.hideNode) {
10713
+ selectedOptionsShowCount.current++;
10714
+ }
10464
10715
  });
10465
10716
  };
10466
10717
 
@@ -10468,20 +10719,6 @@ function Transfer(props) {
10468
10719
  selectedOptionSet([...selectedOptions]);
10469
10720
  };
10470
10721
 
10471
- var leftTreeOnSelected = (selectedKeys, _1, isChecked, evn) => {
10472
- leftSelectedKeySet(selectedKeys);
10473
- var selectOptionTemp = getOptionsRecursion([evn], selectOption, isChecked);
10474
- selectOptionSet(selectOptionTemp);
10475
- };
10476
-
10477
- var rightTreeOnSelected = (selectedKeys, _1, _2, evn) => {
10478
- rightSelectedKeySet(selectedKeys);
10479
- selectedKeys.forEach(key => {
10480
- selectOption.delete(key);
10481
- });
10482
- selectOptionSet(selectOption);
10483
- };
10484
-
10485
10722
  var getOptionsRecursion = (childrens, selectOption, isAdd) => {
10486
10723
  var addOrDel = (key, label, isAdd) => {
10487
10724
  if (isAdd) {
@@ -10492,9 +10729,8 @@ function Transfer(props) {
10492
10729
  };
10493
10730
 
10494
10731
  var iteratorParent = child => {
10495
- // 向上迭代
10496
10732
  if (child.parent) {
10497
- var selectCount = child.parent.children.filter(child => !selectOption.get(child.key)).length;
10733
+ var selectCount = child.parent.children.filter(child => !selectOption.get(child.key) && !child.hideNode).length;
10498
10734
  addOrDel(child.parent.key, child.parent.label, selectCount === 0);
10499
10735
  iteratorParent(child.parent);
10500
10736
  }
@@ -10513,7 +10749,31 @@ function Transfer(props) {
10513
10749
  return selectOption;
10514
10750
  };
10515
10751
 
10752
+ var leftTreeOnSelected = (selectedKeys, _1, isChecked, evn) => {
10753
+ leftSelectedKeySet(selectedKeys);
10754
+ var selectOptionTemp = getOptionsRecursion([evn], leftSelectOption, isChecked);
10755
+ leftSelectOptionSet(selectOptionTemp);
10756
+ };
10757
+
10758
+ var rightTreeOnSelected = selectedKeys => {
10759
+ rightSelectedKeySet(selectedKeys);
10760
+ };
10761
+
10516
10762
  var transferClick = transferType => {
10763
+ if (transferType === 'left') {
10764
+ leftSelectOption.forEach((value, key) => {
10765
+ selectOption.set(key, value);
10766
+ });
10767
+ leftSelectOptionSet(new Map());
10768
+ leftSelectedKeySet([]);
10769
+ } else {
10770
+ rightSelectedKeys.forEach(key => {
10771
+ selectOption.delete(key);
10772
+ });
10773
+ rightSelectedKeySet([]);
10774
+ }
10775
+
10776
+ selectOptionSet(selectOption);
10517
10777
  var option = [];
10518
10778
  selectOption.forEach((label, key) => option.push({
10519
10779
  key,
@@ -10543,11 +10803,68 @@ function Transfer(props) {
10543
10803
  var isHide = !option.label.includes(searchValue.trim());
10544
10804
  option.hideNode = isHide;
10545
10805
  });
10546
- console.log('rightOpions', rightOpions);
10547
10806
  rightOpionSet(rightOpions);
10548
10807
  props.onSearch == null ? void 0 : props.onSearch('right', searchValue);
10549
10808
  };
10550
10809
 
10810
+ var selectAllLeftChange = e => {
10811
+ var isChecked = e.target.checked;
10812
+ selectAllChecked.left = isChecked ? 1 : 0;
10813
+
10814
+ if (isChecked) {
10815
+ var keys = [];
10816
+
10817
+ var selectedOptionsRecursion = selectedOptions => {
10818
+ selectedOptions.forEach(child => {
10819
+ var _child$children3;
10820
+
10821
+ if ((_child$children3 = child.children) != null && _child$children3.length) {
10822
+ selectedOptionsRecursion(child.children);
10823
+ }
10824
+
10825
+ if (!child.hideNode) {
10826
+ leftSelectOption.set(child.key, child.label);
10827
+ keys.push(child.key);
10828
+ }
10829
+ });
10830
+ };
10831
+
10832
+ selectedOptionsRecursion(selectedOptions);
10833
+ leftSelectOptionSet(leftSelectOption);
10834
+ leftSelectedKeySet(keys);
10835
+ } else {
10836
+ leftSelectedKeySet([]);
10837
+ leftSelectOptionSet(new Map());
10838
+ }
10839
+
10840
+ selectAllCheckedSet(selectAllChecked);
10841
+ };
10842
+
10843
+ var selectAllRightChange = e => {
10844
+ var isChecked = e.target.checked;
10845
+ selectAllChecked.right = isChecked ? 1 : 0;
10846
+
10847
+ if (isChecked) {
10848
+ var keys = rightOpions.map(child => child.key);
10849
+ rightSelectedKeySet(keys);
10850
+ } else {
10851
+ rightSelectedKeySet([]);
10852
+ }
10853
+
10854
+ selectAllCheckedSet(selectAllChecked);
10855
+ };
10856
+
10857
+ var Arrow = props => /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
10858
+ onClick: () => props.click(),
10859
+ type: "down-square-o",
10860
+ className: prefixCls + "-arrow",
10861
+ style: _extends({
10862
+ fontSize: 20,
10863
+ stroke: '#e9e9e9',
10864
+ fill: '#333'
10865
+ }, props.style)
10866
+ });
10867
+
10551
10868
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
10552
10869
  className: cls,
10553
10870
  style: _extends({
@@ -10555,9 +10872,20 @@ function Transfer(props) {
10555
10872
  }, style),
10556
10873
  children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(react_card_esm, {
10557
10874
  bodyStyle: {
10558
- padding: 5
10875
+ padding: '5px 9px'
10559
10876
  },
10560
- title: leftSelectedKeys.length + "/" + selectedOptions.length,
10877
+ title: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
10878
+ children: [selectedAll && /*#__PURE__*/(0,jsx_runtime.jsx)(react_checkbox_esm, {
10879
+ indeterminate: leftSelectedKeys.length < selectedOptionsShowCount.current && !!leftSelectedKeys.length,
10880
+ checked: leftSelectedKeys.length >= selectedOptionsShowCount.current && !!leftSelectedKeys.length,
10881
+ onChange: selectAllLeftChange
10882
+ }), /*#__PURE__*/(0,jsx_runtime.jsxs)("label", {
10883
+ style: {
10884
+ marginLeft: 3
10885
+ },
10886
+ children: [leftSelectedKeys.length, "/", selectedOptionsShowCount.current]
10887
+ })]
10888
+ }),
10561
10889
  className: prefixCls + "-card",
10562
10890
  children: [showSearch && /*#__PURE__*/(0,jsx_runtime.jsx)(react_input_esm, {
10563
10891
  placeholder: placeholder,
@@ -10575,29 +10903,36 @@ function Transfer(props) {
10575
10903
  })]
10576
10904
  }), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
10577
10905
  className: prefixCls + "-arrow-content",
10578
- children: [/*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
10579
- onClick: () => transferClick('left'),
10580
- type: "down-square-o",
10581
- className: prefixCls + "-arrow-left",
10906
+ children: [/*#__PURE__*/(0,jsx_runtime.jsx)(Arrow, {
10907
+ click: () => transferClick('left'),
10582
10908
  style: {
10583
10909
  transform: 'rotate(-90deg)',
10584
- fontSize: 20
10910
+ background: leftSelectedKeys.length > 0 ? '#393E48' : 'none'
10585
10911
  }
10586
- }), /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
10587
- onClick: () => transferClick('right'),
10588
- type: "down-square-o",
10589
- className: prefixCls + "-arrow-right",
10912
+ }), /*#__PURE__*/(0,jsx_runtime.jsx)(Arrow, {
10913
+ click: () => transferClick('right'),
10590
10914
  style: {
10591
10915
  transform: 'rotate(90deg)',
10592
- fontSize: 20
10916
+ background: rightSelectedKeys.length > 0 ? '#393E48' : 'none'
10593
10917
  }
10594
10918
  })]
10595
10919
  }), /*#__PURE__*/(0,jsx_runtime.jsxs)(react_card_esm, {
10596
10920
  bodyStyle: {
10597
- padding: 5
10921
+ padding: '5px 9px'
10598
10922
  },
10599
10923
  className: prefixCls + "-card",
10600
- title: rightSelectedKeys.length + "/" + rightOpions.length,
10924
+ title: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
10925
+ children: [selectedAll && /*#__PURE__*/(0,jsx_runtime.jsx)(react_checkbox_esm, {
10926
+ indeterminate: rightSelectedKeys.length < rightOpions.length && !!rightSelectedKeys.length,
10927
+ checked: rightSelectedKeys.length === rightOpions.length && !!rightSelectedKeys.length,
10928
+ onChange: selectAllRightChange
10929
+ }), /*#__PURE__*/(0,jsx_runtime.jsxs)("label", {
10930
+ style: {
10931
+ marginLeft: 3
10932
+ },
10933
+ children: [rightSelectedKeys.length, "/", rightOpions.length]
10934
+ })]
10935
+ }),
10601
10936
  children: [showSearch && /*#__PURE__*/(0,jsx_runtime.jsx)(react_input_esm, {
10602
10937
  placeholder: placeholder,
10603
10938
  value: searchValueRight,