@douyinfe/semi-ui 2.0.9-alpha.3 → 2.1.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/dist/css/semi.css +14 -1
  2. package/dist/css/semi.min.css +1 -1
  3. package/dist/umd/semi-ui.js +1633 -2533
  4. package/dist/umd/semi-ui.js.map +1 -1
  5. package/dist/umd/semi-ui.min.js +1 -1
  6. package/dist/umd/semi-ui.min.js.map +1 -1
  7. package/lib/es/_base/baseComponent.js +1 -5
  8. package/lib/es/_portal/index.js +7 -17
  9. package/lib/es/_utils/index.js +13 -16
  10. package/lib/es/breadcrumb/index.js +2 -4
  11. package/lib/es/breadcrumb/item.js +4 -6
  12. package/lib/es/button/index.d.ts +0 -1
  13. package/lib/es/button/index.js +2 -4
  14. package/lib/es/calendar/monthCalendar.js +9 -11
  15. package/lib/es/cascader/index.d.ts +1 -0
  16. package/lib/es/cascader/index.js +23 -14
  17. package/lib/es/cascader/item.js +1 -2
  18. package/lib/es/collapse/item.js +1 -2
  19. package/lib/es/collapsible/index.js +9 -9
  20. package/lib/es/datePicker/dateInput.d.ts +1 -1
  21. package/lib/es/datePicker/dateInput.js +9 -29
  22. package/lib/es/datePicker/datePicker.d.ts +1 -1
  23. package/lib/es/datePicker/datePicker.js +12 -49
  24. package/lib/es/datePicker/footer.js +1 -2
  25. package/lib/es/datePicker/index.js +12 -15
  26. package/lib/es/datePicker/monthsGrid.d.ts +1 -1
  27. package/lib/es/datePicker/yearAndMonth.js +17 -23
  28. package/lib/es/dropdown/dropdownDivider.js +1 -2
  29. package/lib/es/form/baseForm.d.ts +3 -9
  30. package/lib/es/form/field.d.ts +3 -21
  31. package/lib/es/form/field.js +2 -18
  32. package/lib/es/form/hoc/withField.d.ts +1 -1
  33. package/lib/es/form/hoc/withField.js +3 -14
  34. package/lib/es/iconButton/index.d.ts +0 -1
  35. package/lib/es/iconButton/index.js +0 -1
  36. package/lib/es/inputNumber/index.js +4 -12
  37. package/lib/es/locale/localeConsumer.js +3 -6
  38. package/lib/es/modal/ConfirmModal.js +2 -2
  39. package/lib/es/modal/confirm.js +2 -2
  40. package/lib/es/modal/useModal/HookModal.js +2 -2
  41. package/lib/es/motions/Rotate.js +4 -6
  42. package/lib/es/navigation/CollapseButton.js +7 -9
  43. package/lib/es/navigation/Item.js +7 -33
  44. package/lib/es/navigation/OpenIconTransition.js +4 -6
  45. package/lib/es/navigation/SubNav.js +6 -33
  46. package/lib/es/navigation/SubNavTransition.js +5 -7
  47. package/lib/es/navigation/index.js +6 -24
  48. package/lib/es/notification/NoticeTransition.js +5 -7
  49. package/lib/es/notification/index.js +8 -16
  50. package/lib/es/notification/useNotification/index.js +7 -11
  51. package/lib/es/overflowList/index.js +4 -9
  52. package/lib/es/overflowList/intersectionObserver.js +1 -2
  53. package/lib/es/popconfirm/index.d.ts +5 -1
  54. package/lib/es/popconfirm/index.js +10 -4
  55. package/lib/es/popover/Arrow.js +1 -3
  56. package/lib/es/popover/index.d.ts +3 -1
  57. package/lib/es/popover/index.js +4 -8
  58. package/lib/es/radio/context.d.ts +1 -1
  59. package/lib/es/radio/radio.d.ts +2 -2
  60. package/lib/es/radio/radioGroup.d.ts +4 -4
  61. package/lib/es/resizeObserver/index.js +1 -2
  62. package/lib/es/scrollList/scrollItem.d.ts +4 -3
  63. package/lib/es/scrollList/scrollItem.js +32 -48
  64. package/lib/es/select/index.js +19 -16
  65. package/lib/es/select/option.js +8 -10
  66. package/lib/es/select/utils.d.ts +1 -1
  67. package/lib/es/select/utils.js +10 -4
  68. package/lib/es/select/virtualRow.js +5 -6
  69. package/lib/es/sideSheet/SideSheetTransition.js +1 -3
  70. package/lib/es/slider/index.js +11 -23
  71. package/lib/es/spin/icon.js +1 -3
  72. package/lib/es/table/Body/BaseRow.js +8 -16
  73. package/lib/es/table/Body/SectionRow.js +3 -6
  74. package/lib/es/table/Body/index.js +32 -49
  75. package/lib/es/table/Column.js +1 -2
  76. package/lib/es/table/ColumnFilter.js +2 -6
  77. package/lib/es/table/ColumnSelection.js +1 -5
  78. package/lib/es/table/HeadTable.js +3 -4
  79. package/lib/es/table/ResizableTable.js +20 -31
  80. package/lib/es/table/Table.d.ts +1 -1
  81. package/lib/es/table/Table.js +63 -160
  82. package/lib/es/table/TableCell.js +3 -5
  83. package/lib/es/table/TableContextProvider.js +15 -16
  84. package/lib/es/table/TableHeader.js +1 -4
  85. package/lib/es/table/utils.js +1 -3
  86. package/lib/es/tabs/TabBar.d.ts +5 -3
  87. package/lib/es/tabs/TabBar.js +12 -4
  88. package/lib/es/tabs/TabPane.d.ts +2 -1
  89. package/lib/es/tabs/TabPane.js +3 -2
  90. package/lib/es/tabs/TabPaneTransition.js +9 -12
  91. package/lib/es/tabs/index.d.ts +3 -1
  92. package/lib/es/tabs/index.js +83 -14
  93. package/lib/es/tabs/interface.d.ts +6 -1
  94. package/lib/es/tagInput/index.d.ts +3 -0
  95. package/lib/es/tagInput/index.js +6 -1
  96. package/lib/es/timePicker/Combobox.js +5 -6
  97. package/lib/es/timePicker/TimeInput.js +3 -11
  98. package/lib/es/timePicker/TimePicker.d.ts +2 -2
  99. package/lib/es/timePicker/TimePicker.js +7 -21
  100. package/lib/es/timePicker/TimeShape.d.ts +1 -1
  101. package/lib/es/timePicker/index.d.ts +2 -2
  102. package/lib/es/timePicker/index.js +12 -15
  103. package/lib/es/toast/ToastTransition.js +8 -12
  104. package/lib/es/toast/useToast/index.js +3 -6
  105. package/lib/es/tooltip/TooltipStyledTransition.js +10 -14
  106. package/lib/es/tooltip/index.d.ts +3 -0
  107. package/lib/es/tooltip/index.js +22 -28
  108. package/lib/es/transfer/index.js +15 -18
  109. package/lib/es/tree/index.js +28 -38
  110. package/lib/es/tree/interface.d.ts +2 -2
  111. package/lib/es/treeSelect/index.d.ts +2 -11
  112. package/lib/es/treeSelect/index.js +32 -44
  113. package/lib/es/typography/title.d.ts +1 -1
  114. package/lib/es/typography/util.js +3 -12
  115. package/lib/es/upload/fileCard.js +53 -62
  116. package/lib/es/upload/index.d.ts +2 -2
  117. package/lib/es/upload/index.js +23 -32
  118. package/package.json +8 -8
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { OptionProps } from './option';
3
3
  import { OptionGroupProps } from './optionGroup';
4
- declare const generateOption: (child: React.ReactElement, parent?: any) => OptionProps;
4
+ declare const generateOption: (child: React.ReactElement, parent: any, index: number) => OptionProps;
5
5
  declare const getOptionsFromGroup: (selectChildren: React.ReactNode) => {
6
6
  optionGroups: OptionGroupProps[];
7
7
  options: OptionProps[];
@@ -20,7 +20,7 @@ var __rest = this && this.__rest || function (s, e) {
20
20
  import React from 'react';
21
21
  import warning from '@douyinfe/semi-foundation/lib/es/utils/warning';
22
22
 
23
- const generateOption = (child, parent) => {
23
+ const generateOption = (child, parent, index) => {
24
24
  const childProps = child.props;
25
25
 
26
26
  if (!child || !childProps) {
@@ -32,7 +32,8 @@ const generateOption = (child, parent) => {
32
32
  // Drop-down menu rendering priority label value, children, value in turn downgrade
33
33
  label: childProps.label || childProps.children || childProps.value,
34
34
  _show: true,
35
- _selected: false
35
+ _selected: false,
36
+ _scrollIndex: index
36
37
  }, childProps), {
37
38
  _parentGroup: parent
38
39
  });
@@ -53,11 +54,13 @@ const getOptionsFromGroup = selectChildren => {
53
54
  let childNodes = React.Children.toArray(selectChildren);
54
55
  childNodes = _filterInstanceProperty(childNodes).call(childNodes, childNode => childNode && childNode.props);
55
56
  let type = '';
57
+ let optionIndex = -1;
56
58
 
57
59
  _forEachInstanceProperty(childNodes).call(childNodes, child => {
58
60
  if (child.type.isSelectOption) {
59
61
  type = 'option';
60
- const option = generateOption(child);
62
+ optionIndex++;
63
+ const option = generateOption(child, undefined, optionIndex);
61
64
  emptyGroup.children.push(option);
62
65
  options.push(option);
63
66
  } else if (child.type.isSelectOptionGroup) {
@@ -72,7 +75,10 @@ const getOptionsFromGroup = selectChildren => {
72
75
 
73
76
  children = React.Children.toArray(children);
74
77
 
75
- const childrenOption = _mapInstanceProperty(children).call(children, option => generateOption(option, restGroupProps));
78
+ const childrenOption = _mapInstanceProperty(children).call(children, option => {
79
+ optionIndex++;
80
+ return generateOption(option, restGroupProps, optionIndex);
81
+ });
76
82
 
77
83
  const group = _Object$assign(_Object$assign({}, child.props), {
78
84
  children: childrenOption,
@@ -1,9 +1,8 @@
1
- const VirtualRow = _ref => {
2
- let {
3
- index,
4
- data,
5
- style
6
- } = _ref;
1
+ const VirtualRow = ({
2
+ index,
3
+ data,
4
+ style
5
+ }) => {
7
6
  const {
8
7
  visibileOptions
9
8
  } = data;
@@ -3,9 +3,7 @@ import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign"
3
3
  import { Transition } from '@douyinfe/semi-animation-react';
4
4
  import React from 'react'; // eslint-disable-next-line max-len
5
5
 
6
- const formatStyles = function formatStyles() {
7
- let styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8
- let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6
+ const formatStyles = function formatStyles(styles = {}, props = {}) {
9
7
  const {
10
8
  placement
11
9
  } = props;
@@ -292,8 +292,6 @@ export default class Slider extends BaseComponent {
292
292
  }
293
293
 
294
294
  get adapter() {
295
- var _this = this;
296
-
297
295
  return _Object$assign(_Object$assign({}, super.adapter), {
298
296
  getSliderLengths: () => {
299
297
  if (this.sliderEl && this.sliderEl.current) {
@@ -362,8 +360,7 @@ export default class Slider extends BaseComponent {
362
360
  });
363
361
  },
364
362
 
365
- transNewPropsToState(stateObj) {
366
- let callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
363
+ transNewPropsToState(stateObj, callback = noop) {
367
364
  this.setState(stateObj, callback);
368
365
  },
369
366
 
@@ -397,11 +394,8 @@ export default class Slider extends BaseComponent {
397
394
 
398
395
  this._addEventListener(document.body, 'touchmove', this.foundation.onHandleTouchMove, false);
399
396
  },
400
- onHandleMove: function (mousePos, isMin) {
401
- let stateChangeCallback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : noop;
402
- let clickTrack = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
403
-
404
- const sliderDOMIsInRenderTree = _this.foundation.checkAndUpdateIsInRenderTreeState();
397
+ onHandleMove: (mousePos, isMin, stateChangeCallback = noop, clickTrack = false) => {
398
+ const sliderDOMIsInRenderTree = this.foundation.checkAndUpdateIsInRenderTreeState();
405
399
 
406
400
  if (!sliderDOMIsInRenderTree) {
407
401
  return;
@@ -410,29 +404,27 @@ export default class Slider extends BaseComponent {
410
404
  const {
411
405
  value,
412
406
  onChange
413
- } = _this.props;
414
-
415
- const moveValue = _this.foundation.transPosToValue(mousePos, isMin);
407
+ } = this.props;
408
+ const moveValue = this.foundation.transPosToValue(mousePos, isMin);
416
409
 
417
410
  if (moveValue === false) {
418
411
  return;
419
412
  }
420
413
 
421
- const outPutValue = _this.foundation.outPutValue(moveValue);
422
-
414
+ const outPutValue = this.foundation.outPutValue(moveValue);
423
415
  const {
424
416
  currentValue
425
- } = _this.state;
417
+ } = this.state;
426
418
 
427
- if (!isEqual(_this.foundation.outPutValue(currentValue), outPutValue)) {
419
+ if (!isEqual(this.foundation.outPutValue(currentValue), outPutValue)) {
428
420
  onChange(outPutValue);
429
421
 
430
- if (!clickTrack && _this.foundation.valueFormatIsCorrect(value)) {
422
+ if (!clickTrack && this.foundation.valueFormatIsCorrect(value)) {
431
423
  // still require afterChangeCallback when click on the track directly, need skip here
432
424
  return false;
433
425
  }
434
426
 
435
- _this.setState({
427
+ this.setState({
436
428
  currentValue: outPutValue
437
429
  }, stateChangeCallback);
438
430
  }
@@ -551,12 +543,8 @@ export default class Slider extends BaseComponent {
551
543
  return slider;
552
544
  }
553
545
 
554
- _addEventListener(target, eventName, callback) {
546
+ _addEventListener(target, eventName, callback, ...rests) {
555
547
  if (target.addEventListener) {
556
- for (var _len = arguments.length, rests = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
557
- rests[_key - 3] = arguments[_key];
558
- }
559
-
560
548
  target.addEventListener(eventName, callback, ...rests);
561
549
 
562
550
  const clearSelf = () => {
@@ -20,9 +20,7 @@ import isNullOrUndefined from '@douyinfe/semi-foundation/lib/es/utils/isNullOrUn
20
20
 
21
21
  let _id = -1;
22
22
 
23
- function Icon() {
24
- let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
25
-
23
+ function Icon(props = {}) {
26
24
  const {
27
25
  id: propsId,
28
26
  className
@@ -75,24 +75,16 @@ export default class TableRow extends BaseComponent {
75
75
  }
76
76
 
77
77
  get adapter() {
78
- var _this = this;
79
-
80
78
  return _Object$assign(_Object$assign({}, super.adapter), {
81
- notifyClick: function () {
82
- return _this.props.onRowClick(...arguments);
83
- },
84
- notifyDoubleClick: function () {
85
- return _this.props.onRowDoubleClick(...arguments);
79
+ notifyClick: (...args) => this.props.onRowClick(...args),
80
+ notifyDoubleClick: (...args) => this.props.onRowDoubleClick(...args),
81
+ notifyMouseLeave: (...args) => {
82
+ this.props.onHover(false, this.props.rowKey);
83
+ this.props.onRowMouseEnter(...args);
86
84
  },
87
- notifyMouseLeave: function () {
88
- _this.props.onHover(false, _this.props.rowKey);
89
-
90
- _this.props.onRowMouseEnter(...arguments);
91
- },
92
- notifyMouseEnter: function () {
93
- _this.props.onHover(true, _this.props.rowKey);
94
-
95
- _this.props.onRowMouseEnter(...arguments);
85
+ notifyMouseEnter: (...args) => {
86
+ this.props.onHover(true, this.props.rowKey);
87
+ this.props.onRowMouseEnter(...args);
96
88
  }
97
89
  });
98
90
  }
@@ -36,23 +36,20 @@ import TableContext from '../table-context';
36
36
 
37
37
  class SectionRow extends PureComponent {
38
38
  constructor() {
39
- var _this;
40
-
41
39
  super(...arguments);
42
- _this = this;
43
40
 
44
- this.onRow = function () {
41
+ this.onRow = (...args) => {
45
42
  const {
46
43
  onGroupedRow,
47
44
  clickGroupedRowToExpand,
48
45
  onExpand,
49
46
  groupKey,
50
47
  expanded
51
- } = _this.props;
48
+ } = this.props;
52
49
  const rowProps = {};
53
50
 
54
51
  if (typeof onGroupedRow === 'function') {
55
- _Object$assign(rowProps, onGroupedRow(...arguments));
52
+ _Object$assign(rowProps, onGroupedRow(...args));
56
53
  }
57
54
 
58
55
  return _Object$assign(_Object$assign({}, rowProps), {
@@ -46,10 +46,7 @@ import TableContext from '../table-context';
46
46
 
47
47
  class Body extends BaseComponent {
48
48
  constructor(props, context) {
49
- var _this;
50
-
51
49
  super(props);
52
- _this = this;
53
50
 
54
51
  this.forwardRef = node => {
55
52
  const {
@@ -101,9 +98,8 @@ class Body extends BaseComponent {
101
98
  handleRowExpanded(!expand, rowKey, e);
102
99
  };
103
100
 
104
- this.handleVirtualizedScroll = function () {
105
- let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
106
- const onScroll = get(_this.props.virtualized, 'onScroll');
101
+ this.handleVirtualizedScroll = (props = {}) => {
102
+ const onScroll = get(this.props.virtualized, 'onScroll');
107
103
 
108
104
  if (typeof onScroll === 'function') {
109
105
  onScroll(props);
@@ -187,21 +183,17 @@ class Body extends BaseComponent {
187
183
  }; // virtualized List innerElementType
188
184
 
189
185
 
190
- this.renderTbody = /*#__PURE__*/React.forwardRef(function () {
191
- let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
192
- let ref = arguments.length > 1 ? arguments[1] : undefined;
193
- return /*#__PURE__*/React.createElement("div", _Object$assign({}, props, {
194
- onScroll: function () {
195
- if (props.onScroll) {
196
- props.onScroll(...arguments);
197
- }
198
- },
199
- // eslint-disable-next-line react/no-this-in-sfc,react/destructuring-assignment
200
- className: classnames(props.className, "".concat(_this.props.prefixCls, "-tbody")),
201
- style: _Object$assign({}, props.style),
202
- ref: ref
203
- }));
204
- }); // virtualized List outerElementType
186
+ this.renderTbody = /*#__PURE__*/React.forwardRef((props = {}, ref) => /*#__PURE__*/React.createElement("div", _Object$assign({}, props, {
187
+ onScroll: (...args) => {
188
+ if (props.onScroll) {
189
+ props.onScroll(...args);
190
+ }
191
+ },
192
+ // eslint-disable-next-line react/no-this-in-sfc,react/destructuring-assignment
193
+ className: classnames(props.className, "".concat(this.props.prefixCls, "-tbody")),
194
+ style: _Object$assign({}, props.style),
195
+ ref: ref
196
+ }))); // virtualized List outerElementType
205
197
 
206
198
  this.renderOuter = /*#__PURE__*/React.forwardRef((props, ref) => {
207
199
  const {
@@ -221,21 +213,21 @@ class Body extends BaseComponent {
221
213
  const tableCls = classnames("".concat(prefixCls), "".concat(prefixCls, "-fixed"));
222
214
  return /*#__PURE__*/React.createElement("div", _Object$assign({}, rest, {
223
215
  ref: ref,
224
- onWheel: function () {
216
+ onWheel: (...args) => {
225
217
  if (handleWheel) {
226
- handleWheel(...arguments);
218
+ handleWheel(...args);
227
219
  }
228
220
 
229
221
  if (rest.onWheel) {
230
- rest.onWheel(...arguments);
222
+ rest.onWheel(...args);
231
223
  }
232
224
  },
233
- onScroll: function () {
225
+ onScroll: (...args) => {
234
226
  // eslint-disable-next-line react/no-this-in-sfc
235
- _this.handleVirtualizedBodyScroll(...arguments);
227
+ this.handleVirtualizedBodyScroll(...args);
236
228
 
237
229
  if (rest.onScroll) {
238
- rest.onScroll(...arguments);
230
+ rest.onScroll(...args);
239
231
  }
240
232
  }
241
233
  }), /*#__PURE__*/React.createElement("div", {
@@ -314,12 +306,11 @@ class Body extends BaseComponent {
314
306
  */
315
307
 
316
308
 
317
- this.renderSectionRow = function () {
309
+ this.renderSectionRow = (props = {
310
+ groupKey: undefined
311
+ }) => {
318
312
  var _context;
319
313
 
320
- let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
321
- groupKey: undefined
322
- };
323
314
  const {
324
315
  dataSource,
325
316
  rowKey,
@@ -333,7 +324,7 @@ class Body extends BaseComponent {
333
324
  const sectionRowProps = pick(props, sectionRowPickKeys);
334
325
  const {
335
326
  handleRowExpanded
336
- } = _this.context;
327
+ } = this.context;
337
328
  return /*#__PURE__*/React.createElement(SectionRow, _Object$assign({}, sectionRowProps, {
338
329
  record: {
339
330
  groupKey,
@@ -346,10 +337,9 @@ class Body extends BaseComponent {
346
337
  }));
347
338
  };
348
339
 
349
- this.renderExpandedRow = function () {
350
- let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
351
- renderExpandIcon: () => null
352
- };
340
+ this.renderExpandedRow = (props = {
341
+ renderExpandIcon: () => null
342
+ }) => {
353
343
  const {
354
344
  style,
355
345
  components,
@@ -371,7 +361,7 @@ class Body extends BaseComponent {
371
361
  const {
372
362
  flattenedColumns,
373
363
  getCellWidths
374
- } = _this.context;
364
+ } = this.context;
375
365
  const cellWidths = getCellWidths(flattenedColumns);
376
366
  return /*#__PURE__*/React.createElement(ExpandedRow, {
377
367
  style: style,
@@ -659,8 +649,7 @@ class Body extends BaseComponent {
659
649
  */
660
650
 
661
651
 
662
- renderBaseRow() {
663
- let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
652
+ renderBaseRow(props = {}) {
664
653
  const {
665
654
  rowKey,
666
655
  columns,
@@ -716,10 +705,7 @@ class Body extends BaseComponent {
716
705
  }));
717
706
  }
718
707
 
719
- renderBodyRows() {
720
- let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
721
- let level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
722
- let renderedRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
708
+ renderBodyRows(data = [], level = 0, renderedRows = []) {
723
709
  const {
724
710
  rowKey,
725
711
  expandedRowRender,
@@ -783,12 +769,9 @@ class Body extends BaseComponent {
783
769
  const {
784
770
  virtualized
785
771
  } = this.props;
786
- return /*#__PURE__*/React.createElement(ConfigContext.Consumer, null, _ref => {
787
- let {
788
- direction
789
- } = _ref;
790
- return virtualized ? this.renderVirtualizedBody(direction) : this.renderBody(direction);
791
- });
772
+ return /*#__PURE__*/React.createElement(ConfigContext.Consumer, null, ({
773
+ direction
774
+ }) => virtualized ? this.renderVirtualizedBody(direction) : this.renderBody(direction));
792
775
  }
793
776
 
794
777
  }
@@ -2,8 +2,7 @@ import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign"
2
2
  import React from 'react';
3
3
  import ColumnShape from './ColumnShape';
4
4
  export default class Column extends React.PureComponent {
5
- constructor() {
6
- let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5
+ constructor(props = {}) {
7
6
  super(props);
8
7
  }
9
8
 
@@ -18,10 +18,7 @@ import Dropdown from '../dropdown';
18
18
  import { Radio } from '../radio';
19
19
  import { Checkbox } from '../checkbox';
20
20
 
21
- function renderDropdown() {
22
- let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
23
- let nestedElem = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
24
- let level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
21
+ function renderDropdown(props = {}, nestedElem = null, level = 0) {
25
22
  const {
26
23
  filterMultiple = true,
27
24
  filters = [],
@@ -129,8 +126,7 @@ function renderDropdown() {
129
126
  }), nestedElem);
130
127
  }
131
128
 
132
- export default function ColumnFilter() {
133
- let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
129
+ export default function ColumnFilter(props = {}) {
134
130
  const {
135
131
  prefixCls = cssClasses.PREFIX,
136
132
  filteredValue,
@@ -23,12 +23,8 @@ export default class TableSelectionCell extends BaseComponent {
23
23
  }
24
24
 
25
25
  get adapter() {
26
- var _this = this;
27
-
28
26
  return _Object$assign(_Object$assign({}, super.adapter), {
29
- notifyChange: function () {
30
- return _this.props.onChange(...arguments);
31
- }
27
+ notifyChange: (...args) => this.props.onChange(...args)
32
28
  });
33
29
  }
34
30
 
@@ -13,10 +13,9 @@ import TableHeader from './TableHeader';
13
13
  */
14
14
 
15
15
  class HeadTable extends React.PureComponent {
16
- constructor() {
17
- let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
18
- selectedRowKeysSet: new _Set()
19
- };
16
+ constructor(props = {
17
+ selectedRowKeysSet: new _Set()
18
+ }) {
20
19
  super(props);
21
20
  }
22
21
 
@@ -35,10 +35,7 @@ import { cloneDeep } from './utils';
35
35
  import getColumns from './getColumns';
36
36
  import ResizableHeaderCell from './ResizableHeaderCell';
37
37
 
38
- const ResizableTable = function () {
39
- let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
40
- let ref = arguments.length > 1 ? arguments[1] : undefined;
41
-
38
+ const ResizableTable = (props = {}, ref) => {
42
39
  const {
43
40
  components: propComponents,
44
41
  columns: propColumns,
@@ -100,10 +97,9 @@ const ResizableTable = function () {
100
97
  }, propComponents), [propComponents]);
101
98
  const handlerClassName = get(resizable, 'handlerClassName', 'resizing');
102
99
 
103
- const handleResize = column => (e, _ref) => {
104
- let {
105
- size
106
- } = _ref;
100
+ const handleResize = column => (e, {
101
+ size
102
+ }) => {
107
103
  const nextColumns = cloneDeep(columns);
108
104
  const curColumn = findColumn(nextColumns, column, childrenColumnName);
109
105
 
@@ -151,33 +147,26 @@ const ResizableTable = function () {
151
147
  setColumns(nextColumns);
152
148
  };
153
149
 
154
- const resizableRender = function (col, index) {
155
- let level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
156
- return _Object$assign(_Object$assign({}, col), {
157
- onHeaderCell: column => ({
158
- width: column.width,
159
- onResize: handleResize(column),
160
- onResizeStart: handleResizeStart(column),
161
- onResizeStop: handleResizeStop(column)
162
- })
163
- });
164
- };
150
+ const resizableRender = (col, index, level = 0) => _Object$assign(_Object$assign({}, col), {
151
+ onHeaderCell: column => ({
152
+ width: column.width,
153
+ onResize: handleResize(column),
154
+ onResizeStart: handleResizeStart(column),
155
+ onResizeStop: handleResizeStop(column)
156
+ })
157
+ });
165
158
 
166
- const assignResizableRender = function () {
167
- let columns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
168
- let level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
169
- return _Array$isArray(columns) && columns.length ? _mapInstanceProperty(columns).call(columns, (col, index) => {
170
- _Object$assign(col, resizableRender(col, index, level));
159
+ const assignResizableRender = (columns = [], level = 0) => _Array$isArray(columns) && columns.length ? _mapInstanceProperty(columns).call(columns, (col, index) => {
160
+ _Object$assign(col, resizableRender(col, index, level));
171
161
 
172
- const children = col[childrenColumnName];
162
+ const children = col[childrenColumnName];
173
163
 
174
- if (_Array$isArray(children) && children.length) {
175
- col[childrenColumnName] = assignResizableRender(children, level + 1);
176
- }
164
+ if (_Array$isArray(children) && children.length) {
165
+ col[childrenColumnName] = assignResizableRender(children, level + 1);
166
+ }
177
167
 
178
- return col;
179
- }) : [];
180
- };
168
+ return col;
169
+ }) : [];
181
170
 
182
171
  const finalColumns = useMemo(() => assignResizableRender(columns), [columns]);
183
172
  return /*#__PURE__*/React.createElement(Table, _Object$assign({}, restProps, {
@@ -277,7 +277,7 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
277
277
  * Combine pagination and table paging processing functions
278
278
  */
279
279
  mergePagination: (pagination: TablePaginationProps) => {
280
- position?: "both" | "top" | "bottom";
280
+ position?: "top" | "bottom" | "both";
281
281
  formatPageText?: import("./interface").FormatPageText;
282
282
  style?: React.CSSProperties;
283
283
  className?: string;