@douyinfe/semi-ui 2.36.0 → 2.37.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.
Files changed (175) hide show
  1. package/dist/css/semi.css +39 -1
  2. package/dist/css/semi.min.css +1 -1
  3. package/dist/umd/semi-ui.js +850 -503
  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/cjs/_base/baseComponent.d.ts +1 -0
  8. package/lib/cjs/_base/baseComponent.js +4 -0
  9. package/lib/cjs/anchor/index.js +2 -2
  10. package/lib/cjs/autoComplete/index.js +2 -2
  11. package/lib/cjs/banner/index.js +2 -2
  12. package/lib/cjs/breadcrumb/index.js +2 -2
  13. package/lib/cjs/breadcrumb/item.js +1 -1
  14. package/lib/cjs/calendar/dayCalendar.js +2 -2
  15. package/lib/cjs/calendar/monthCalendar.js +2 -2
  16. package/lib/cjs/calendar/rangeCalendar.js +2 -2
  17. package/lib/cjs/calendar/weekCalendar.d.ts +1 -1
  18. package/lib/cjs/calendar/weekCalendar.js +2 -2
  19. package/lib/cjs/carousel/index.js +2 -2
  20. package/lib/cjs/cascader/index.js +1 -1
  21. package/lib/cjs/checkbox/checkbox.js +2 -2
  22. package/lib/cjs/checkbox/checkboxGroup.js +2 -2
  23. package/lib/cjs/collapse/index.js +2 -2
  24. package/lib/cjs/collapsible/index.js +2 -2
  25. package/lib/cjs/datePicker/dateInput.d.ts +1 -0
  26. package/lib/cjs/datePicker/dateInput.js +10 -6
  27. package/lib/cjs/datePicker/datePicker.js +23 -11
  28. package/lib/cjs/datePicker/quickControl.d.ts +2 -0
  29. package/lib/cjs/datePicker/quickControl.js +5 -3
  30. package/lib/cjs/descriptions/index.js +22 -11
  31. package/lib/cjs/descriptions/item.js +22 -11
  32. package/lib/cjs/empty/index.js +23 -13
  33. package/lib/cjs/input/index.d.ts +3 -1
  34. package/lib/cjs/input/index.js +19 -16
  35. package/lib/cjs/list/index.js +30 -20
  36. package/lib/cjs/list/item.js +18 -15
  37. package/lib/cjs/locale/interface.d.ts +1 -0
  38. package/lib/cjs/locale/source/ar.js +1 -0
  39. package/lib/cjs/locale/source/de.js +1 -0
  40. package/lib/cjs/locale/source/en_GB.js +1 -0
  41. package/lib/cjs/locale/source/en_US.js +1 -0
  42. package/lib/cjs/locale/source/es.js +1 -0
  43. package/lib/cjs/locale/source/fr.js +1 -0
  44. package/lib/cjs/locale/source/id_ID.js +1 -0
  45. package/lib/cjs/locale/source/it.js +1 -0
  46. package/lib/cjs/locale/source/ja_JP.js +1 -0
  47. package/lib/cjs/locale/source/ko_KR.js +1 -0
  48. package/lib/cjs/locale/source/ms_MY.js +1 -0
  49. package/lib/cjs/locale/source/nl_NL.js +1 -0
  50. package/lib/cjs/locale/source/pl_PL.js +1 -0
  51. package/lib/cjs/locale/source/pt_BR.js +1 -0
  52. package/lib/cjs/locale/source/ro.d.ts +1 -0
  53. package/lib/cjs/locale/source/ro.js +1 -0
  54. package/lib/cjs/locale/source/ru_RU.js +1 -0
  55. package/lib/cjs/locale/source/sv_SE.js +1 -0
  56. package/lib/cjs/locale/source/th_TH.js +1 -0
  57. package/lib/cjs/locale/source/tr_TR.js +1 -0
  58. package/lib/cjs/locale/source/vi_VN.js +1 -0
  59. package/lib/cjs/locale/source/zh_CN.js +1 -0
  60. package/lib/cjs/locale/source/zh_TW.js +1 -0
  61. package/lib/cjs/modal/ModalContent.js +12 -9
  62. package/lib/cjs/navigation/index.js +34 -24
  63. package/lib/cjs/pagination/index.d.ts +3 -0
  64. package/lib/cjs/pagination/index.js +73 -39
  65. package/lib/cjs/progress/index.js +44 -31
  66. package/lib/cjs/radio/radio.js +27 -17
  67. package/lib/cjs/radio/radioGroup.js +24 -14
  68. package/lib/cjs/rating/index.js +21 -11
  69. package/lib/cjs/scrollList/index.js +21 -11
  70. package/lib/cjs/select/index.js +30 -21
  71. package/lib/cjs/sideSheet/SideSheetContent.js +27 -7
  72. package/lib/cjs/slider/index.js +20 -11
  73. package/lib/cjs/spin/index.js +19 -9
  74. package/lib/cjs/steps/basicSteps.js +24 -14
  75. package/lib/cjs/steps/fillSteps.js +22 -12
  76. package/lib/cjs/steps/navSteps.js +21 -11
  77. package/lib/cjs/switch/index.js +23 -13
  78. package/lib/cjs/table/Table.d.ts +1 -0
  79. package/lib/cjs/table/Table.js +3 -2
  80. package/lib/cjs/tabs/index.js +1 -2
  81. package/lib/cjs/tagInput/index.js +20 -10
  82. package/lib/cjs/timeline/index.js +20 -9
  83. package/lib/cjs/timeline/item.js +24 -13
  84. package/lib/cjs/toast/index.d.ts +4 -0
  85. package/lib/cjs/tooltip/index.js +3 -1
  86. package/lib/cjs/transfer/index.js +19 -9
  87. package/lib/cjs/tree/index.js +32 -22
  88. package/lib/cjs/treeSelect/index.js +32 -20
  89. package/lib/cjs/typography/title.d.ts +1 -1
  90. package/lib/cjs/upload/index.js +28 -18
  91. package/lib/es/_base/baseComponent.d.ts +1 -0
  92. package/lib/es/_base/baseComponent.js +4 -0
  93. package/lib/es/anchor/index.js +2 -2
  94. package/lib/es/autoComplete/index.js +2 -2
  95. package/lib/es/banner/index.js +2 -2
  96. package/lib/es/breadcrumb/index.js +2 -2
  97. package/lib/es/breadcrumb/item.js +1 -1
  98. package/lib/es/calendar/dayCalendar.js +2 -2
  99. package/lib/es/calendar/monthCalendar.js +2 -2
  100. package/lib/es/calendar/rangeCalendar.js +2 -2
  101. package/lib/es/calendar/weekCalendar.d.ts +1 -1
  102. package/lib/es/calendar/weekCalendar.js +2 -2
  103. package/lib/es/carousel/index.js +2 -2
  104. package/lib/es/cascader/index.js +1 -1
  105. package/lib/es/checkbox/checkbox.js +2 -2
  106. package/lib/es/checkbox/checkboxGroup.js +2 -2
  107. package/lib/es/collapse/index.js +2 -2
  108. package/lib/es/collapsible/index.js +2 -2
  109. package/lib/es/datePicker/dateInput.d.ts +1 -0
  110. package/lib/es/datePicker/dateInput.js +10 -6
  111. package/lib/es/datePicker/datePicker.js +23 -10
  112. package/lib/es/datePicker/quickControl.d.ts +2 -0
  113. package/lib/es/datePicker/quickControl.js +5 -3
  114. package/lib/es/descriptions/index.js +22 -11
  115. package/lib/es/descriptions/item.js +22 -11
  116. package/lib/es/empty/index.js +23 -13
  117. package/lib/es/input/index.d.ts +3 -1
  118. package/lib/es/input/index.js +19 -16
  119. package/lib/es/list/index.js +30 -20
  120. package/lib/es/list/item.js +18 -15
  121. package/lib/es/locale/interface.d.ts +1 -0
  122. package/lib/es/locale/source/ar.js +1 -0
  123. package/lib/es/locale/source/de.js +1 -0
  124. package/lib/es/locale/source/en_GB.js +1 -0
  125. package/lib/es/locale/source/en_US.js +1 -0
  126. package/lib/es/locale/source/es.js +1 -0
  127. package/lib/es/locale/source/fr.js +1 -0
  128. package/lib/es/locale/source/id_ID.js +1 -0
  129. package/lib/es/locale/source/it.js +1 -0
  130. package/lib/es/locale/source/ja_JP.js +1 -0
  131. package/lib/es/locale/source/ko_KR.js +1 -0
  132. package/lib/es/locale/source/ms_MY.js +1 -0
  133. package/lib/es/locale/source/nl_NL.js +1 -0
  134. package/lib/es/locale/source/pl_PL.js +1 -0
  135. package/lib/es/locale/source/pt_BR.js +1 -0
  136. package/lib/es/locale/source/ro.d.ts +1 -0
  137. package/lib/es/locale/source/ro.js +1 -0
  138. package/lib/es/locale/source/ru_RU.js +1 -0
  139. package/lib/es/locale/source/sv_SE.js +1 -0
  140. package/lib/es/locale/source/th_TH.js +1 -0
  141. package/lib/es/locale/source/tr_TR.js +1 -0
  142. package/lib/es/locale/source/vi_VN.js +1 -0
  143. package/lib/es/locale/source/zh_CN.js +1 -0
  144. package/lib/es/locale/source/zh_TW.js +1 -0
  145. package/lib/es/modal/ModalContent.js +12 -9
  146. package/lib/es/navigation/index.js +34 -24
  147. package/lib/es/pagination/index.d.ts +3 -0
  148. package/lib/es/pagination/index.js +73 -38
  149. package/lib/es/progress/index.js +44 -31
  150. package/lib/es/radio/radio.js +27 -17
  151. package/lib/es/radio/radioGroup.js +24 -14
  152. package/lib/es/rating/index.js +21 -11
  153. package/lib/es/scrollList/index.js +21 -11
  154. package/lib/es/select/index.js +30 -20
  155. package/lib/es/sideSheet/SideSheetContent.js +27 -7
  156. package/lib/es/slider/index.js +20 -10
  157. package/lib/es/spin/index.js +19 -9
  158. package/lib/es/steps/basicSteps.js +24 -14
  159. package/lib/es/steps/fillSteps.js +22 -12
  160. package/lib/es/steps/navSteps.js +21 -11
  161. package/lib/es/switch/index.js +23 -13
  162. package/lib/es/table/Table.d.ts +1 -0
  163. package/lib/es/table/Table.js +3 -2
  164. package/lib/es/tabs/index.js +1 -2
  165. package/lib/es/tagInput/index.js +20 -10
  166. package/lib/es/timeline/index.js +20 -9
  167. package/lib/es/timeline/item.js +24 -13
  168. package/lib/es/toast/index.d.ts +4 -0
  169. package/lib/es/tooltip/index.js +3 -1
  170. package/lib/es/transfer/index.js +19 -9
  171. package/lib/es/tree/index.js +32 -22
  172. package/lib/es/treeSelect/index.js +32 -20
  173. package/lib/es/typography/title.d.ts +1 -1
  174. package/lib/es/upload/index.js +28 -18
  175. package/package.json +8 -8
@@ -1,20 +1,30 @@
1
+ var __rest = this && this.__rest || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
4
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
5
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
6
+ }
7
+ return t;
8
+ };
1
9
  import React, { cloneElement, Children, useMemo, isValidElement } from 'react';
2
10
  import PropTypes from 'prop-types';
3
11
  import cls from 'classnames';
4
12
  import { stepsClasses as css } from '@douyinfe/semi-foundation/lib/es/steps/constants';
13
+ import getDataAttr from '@douyinfe/semi-foundation/lib/es/utils/getDataAttr';
5
14
  import { Row, Col } from '../grid';
6
15
  const Steps = props => {
7
16
  const {
8
- current,
9
- status,
10
- children,
11
- prefixCls,
12
- initial,
13
- direction,
14
- className,
15
- style,
16
- onChange
17
- } = props;
17
+ current,
18
+ status,
19
+ children,
20
+ prefixCls,
21
+ initial,
22
+ direction,
23
+ className,
24
+ style,
25
+ onChange
26
+ } = props,
27
+ rest = __rest(props, ["current", "status", "children", "prefixCls", "initial", "direction", "className", "style", "onChange"]);
18
28
  const inner = useMemo(() => {
19
29
  const filteredChildren = Children.toArray(children).filter(c => /*#__PURE__*/isValidElement(c));
20
30
  const colStyle = direction === 'vertical' ? null : {
@@ -56,11 +66,11 @@ const Steps = props => {
56
66
  [prefixCls]: true,
57
67
  [`${prefixCls}-${direction}`]: true
58
68
  });
59
- return /*#__PURE__*/React.createElement("div", {
69
+ return /*#__PURE__*/React.createElement("div", Object.assign({
60
70
  className: wrapperCls,
61
71
  style: style,
62
72
  "aria-label": props["aria-label"]
63
- }, /*#__PURE__*/React.createElement(Row, {
73
+ }, getDataAttr(rest)), /*#__PURE__*/React.createElement(Row, {
64
74
  type: "flex",
65
75
  justify: "start"
66
76
  }, inner));
@@ -1,18 +1,28 @@
1
+ var __rest = this && this.__rest || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
4
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
5
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
6
+ }
7
+ return t;
8
+ };
1
9
  import React, { cloneElement, Children, useMemo, isValidElement } from 'react';
2
10
  import PropTypes from 'prop-types';
11
+ import getDataAttr from '@douyinfe/semi-foundation/lib/es/utils/getDataAttr';
3
12
  import cls from 'classnames';
4
13
  import { stepsClasses as css } from '@douyinfe/semi-foundation/lib/es/steps/constants';
5
14
  const Steps = props => {
6
15
  const {
7
- size,
8
- current,
9
- initial,
10
- children,
11
- prefixCls,
12
- className,
13
- style,
14
- onChange
15
- } = props;
16
+ size,
17
+ current,
18
+ initial,
19
+ children,
20
+ prefixCls,
21
+ className,
22
+ style,
23
+ onChange
24
+ } = props,
25
+ rest = __rest(props, ["size", "current", "initial", "children", "prefixCls", "className", "style", "onChange"]);
16
26
  const inner = useMemo(() => {
17
27
  const filteredChildren = Children.toArray(children).filter(c => /*#__PURE__*/isValidElement(c));
18
28
  const total = filteredChildren.length;
@@ -38,11 +48,11 @@ const Steps = props => {
38
48
  [`${prefixCls}-nav`]: true,
39
49
  [`${prefixCls}-${size}`]: size !== 'default'
40
50
  });
41
- return /*#__PURE__*/React.createElement("div", {
51
+ return /*#__PURE__*/React.createElement("div", Object.assign({
42
52
  "aria-label": props["aria-label"],
43
53
  className: wrapperCls,
44
54
  style: style
45
- }, inner);
55
+ }, getDataAttr(rest)), inner);
46
56
  };
47
57
  Steps.propTypes = {
48
58
  prefixCls: PropTypes.string,
@@ -1,4 +1,12 @@
1
1
  import _noop from "lodash/noop";
2
+ var __rest = this && this.__rest || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
6
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
7
+ }
8
+ return t;
9
+ };
2
10
  /* eslint-disable max-len */
3
11
  import React from 'react';
4
12
  import cls from 'classnames';
@@ -67,17 +75,19 @@ class Switch extends BaseComponent {
67
75
  nativeControlDisabled,
68
76
  focusVisible
69
77
  } = this.state;
70
- const {
71
- className,
72
- style,
73
- onMouseEnter,
74
- onMouseLeave,
75
- size,
76
- checkedText,
77
- uncheckedText,
78
- loading,
79
- id
80
- } = this.props;
78
+ const _a = this.props,
79
+ {
80
+ className,
81
+ style,
82
+ onMouseEnter,
83
+ onMouseLeave,
84
+ size,
85
+ checkedText,
86
+ uncheckedText,
87
+ loading,
88
+ id
89
+ } = _a,
90
+ rest = __rest(_a, ["className", "style", "onMouseEnter", "onMouseLeave", "size", "checkedText", "uncheckedText", "loading", "id"]);
81
91
  const wrapperCls = cls(className, {
82
92
  [cssClasses.PREFIX]: true,
83
93
  [cssClasses.CHECKED]: nativeControlChecked,
@@ -95,12 +105,12 @@ class Switch extends BaseComponent {
95
105
  };
96
106
  const showCheckedText = checkedText && nativeControlChecked && size !== 'small';
97
107
  const showUncheckedText = uncheckedText && !nativeControlChecked && size !== 'small';
98
- return /*#__PURE__*/React.createElement("div", {
108
+ return /*#__PURE__*/React.createElement("div", Object.assign({
99
109
  className: wrapperCls,
100
110
  style: style,
101
111
  onMouseEnter: onMouseEnter,
102
112
  onMouseLeave: onMouseLeave
103
- }, loading ? /*#__PURE__*/React.createElement(Spin, {
113
+ }, this.getDataAttr(rest)), loading ? /*#__PURE__*/React.createElement(Spin, {
104
114
  wrapperClassName: cssClasses.LOADING_SPIN,
105
115
  size: size === 'default' ? 'middle' : size
106
116
  }) : /*#__PURE__*/React.createElement("div", {
@@ -311,6 +311,7 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
311
311
  popoverPosition?: "left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver";
312
312
  hideOnSinglePage?: boolean;
313
313
  hoverShowPageSelect?: boolean;
314
+ disabled?: boolean;
314
315
  };
315
316
  render(): JSX.Element;
316
317
  }
@@ -1298,13 +1298,14 @@ class Table extends BaseComponent {
1298
1298
  getVirtualizedListRef,
1299
1299
  setBodyHasScrollbar: this.setBodyHasScrollbar
1300
1300
  });
1301
- return /*#__PURE__*/React.createElement("div", {
1301
+ const dataAttr = this.getDataAttr(rest);
1302
+ return /*#__PURE__*/React.createElement("div", Object.assign({
1302
1303
  ref: this.rootWrapRef,
1303
1304
  className: classnames(className, `${prefixCls}-wrapper`, `${prefixCls}-wrapper-${props.direction}`),
1304
1305
  "data-column-fixed": anyColumnFixed,
1305
1306
  style: wrapStyle,
1306
1307
  id: id
1307
- }, /*#__PURE__*/React.createElement(TableContextProvider, Object.assign({}, tableContextValue, {
1308
+ }, dataAttr), /*#__PURE__*/React.createElement(TableContextProvider, Object.assign({}, tableContextValue, {
1308
1309
  direction: props.direction
1309
1310
  }), /*#__PURE__*/React.createElement(Spin, {
1310
1311
  spinning: loading,
@@ -13,7 +13,6 @@ import cls from 'classnames';
13
13
  import PropTypes from 'prop-types';
14
14
  import { cssClasses, strings } from '@douyinfe/semi-foundation/lib/es/tabs/constants';
15
15
  import isNullOrUndefined from '@douyinfe/semi-foundation/lib/es/utils/isNullOrUndefined';
16
- import getDataAttr from '@douyinfe/semi-foundation/lib/es/utils/getDataAttr';
17
16
  import TabsFoundation from '@douyinfe/semi-foundation/lib/es/tabs/foundation';
18
17
  import BaseComponent from '../_base/baseComponent';
19
18
  import '@douyinfe/semi-foundation/lib/es/tabs/tabs.css';
@@ -279,7 +278,7 @@ class Tabs extends BaseComponent {
279
278
  return /*#__PURE__*/React.createElement("div", Object.assign({
280
279
  className: tabWrapperCls,
281
280
  style: style
282
- }, getDataAttr(restProps)), tabBar, /*#__PURE__*/React.createElement(TabsContext.Provider, {
281
+ }, this.getDataAttr(restProps)), tabBar, /*#__PURE__*/React.createElement(TabsContext.Provider, {
283
282
  value: {
284
283
  activeKey,
285
284
  lazyRender,
@@ -4,6 +4,14 @@ import _isNull from "lodash/isNull";
4
4
  import _isArray from "lodash/isArray";
5
5
  import _isString from "lodash/isString";
6
6
  import _noop from "lodash/noop";
7
+ var __rest = this && this.__rest || function (s, e) {
8
+ var t = {};
9
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
10
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
11
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
12
+ }
13
+ return t;
14
+ };
7
15
  import React from 'react';
8
16
  import cls from 'classnames';
9
17
  import PropTypes from 'prop-types';
@@ -424,14 +432,16 @@ class TagInput extends BaseComponent {
424
432
  }
425
433
  }
426
434
  render() {
427
- const {
428
- size,
429
- style,
430
- className,
431
- disabled,
432
- placeholder,
433
- validateStatus
434
- } = this.props;
435
+ const _a = this.props,
436
+ {
437
+ size,
438
+ style,
439
+ className,
440
+ disabled,
441
+ placeholder,
442
+ validateStatus
443
+ } = _a,
444
+ rest = __rest(_a, ["size", "style", "className", "disabled", "placeholder", "validateStatus"]);
435
445
  const {
436
446
  focusing,
437
447
  hovering,
@@ -453,7 +463,7 @@ class TagInput extends BaseComponent {
453
463
  return (
454
464
  /*#__PURE__*/
455
465
  // eslint-disable-next-line
456
- React.createElement("div", {
466
+ React.createElement("div", Object.assign({
457
467
  ref: this.tagInputRef,
458
468
  style: style,
459
469
  className: tagInputCls,
@@ -469,7 +479,7 @@ class TagInput extends BaseComponent {
469
479
  onClick: e => {
470
480
  this.handleClick(e);
471
481
  }
472
- }, this.renderPrefix(), /*#__PURE__*/React.createElement("div", {
482
+ }, this.getDataAttr(rest)), this.renderPrefix(), /*#__PURE__*/React.createElement("div", {
473
483
  className: wrapperCls
474
484
  }, this.renderTags(), /*#__PURE__*/React.createElement(Input, {
475
485
  "aria-label": 'input value',
@@ -1,8 +1,17 @@
1
+ var __rest = this && this.__rest || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
4
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
5
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
6
+ }
7
+ return t;
8
+ };
1
9
  import React, { PureComponent } from 'react';
2
10
  import cls from 'classnames';
3
11
  import PropTypes from 'prop-types';
4
12
  import '@douyinfe/semi-foundation/lib/es/timeline/timeline.css';
5
13
  import { cssClasses, strings } from '@douyinfe/semi-foundation/lib/es/timeline/constants';
14
+ import getDataAttr from '@douyinfe/semi-foundation/lib/es/utils/getDataAttr';
6
15
  import ConfigContext from '../configProvider/context';
7
16
  import Item from './item';
8
17
  const prefixCls = cssClasses.PREFIX;
@@ -44,13 +53,15 @@ class Timeline extends PureComponent {
44
53
  });
45
54
  }
46
55
  render() {
47
- const {
48
- children,
49
- className,
50
- style,
51
- mode,
52
- dataSource
53
- } = this.props;
56
+ const _a = this.props,
57
+ {
58
+ children,
59
+ className,
60
+ style,
61
+ mode,
62
+ dataSource
63
+ } = _a,
64
+ rest = __rest(_a, ["children", "className", "style", "mode", "dataSource"]);
54
65
  const classString = cls(prefixCls, className, {
55
66
  [`${prefixCls}-${mode}`]: mode
56
67
  });
@@ -62,11 +73,11 @@ class Timeline extends PureComponent {
62
73
  childrenList = this.addClassName(items);
63
74
  }
64
75
  const items = childrenList || this.addClassName(children);
65
- return /*#__PURE__*/React.createElement("ul", {
76
+ return /*#__PURE__*/React.createElement("ul", Object.assign({
66
77
  "aria-label": this.props['aria-label'],
67
78
  style: style,
68
79
  className: classString
69
- }, items);
80
+ }, getDataAttr(rest)), items);
70
81
  }
71
82
  }
72
83
  Timeline.contextType = ConfigContext;
@@ -1,23 +1,34 @@
1
1
  import _noop from "lodash/noop";
2
+ var __rest = this && this.__rest || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
6
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
7
+ }
8
+ return t;
9
+ };
2
10
  import React, { PureComponent } from 'react';
3
11
  import cls from 'classnames';
4
12
  import PropTypes from 'prop-types';
5
13
  import { cssClasses, strings } from '@douyinfe/semi-foundation/lib/es/timeline/constants';
14
+ import getDataAttr from '@douyinfe/semi-foundation/lib/es/utils/getDataAttr';
6
15
  import '@douyinfe/semi-foundation/lib/es/timeline/timeline.css';
7
16
  const prefixCls = cssClasses.ITEM;
8
17
  export default class Item extends PureComponent {
9
18
  render() {
10
- const {
11
- className,
12
- color,
13
- children,
14
- dot,
15
- type,
16
- style,
17
- time,
18
- extra,
19
- onClick
20
- } = this.props;
19
+ const _a = this.props,
20
+ {
21
+ className,
22
+ color,
23
+ children,
24
+ dot,
25
+ type,
26
+ style,
27
+ time,
28
+ extra,
29
+ onClick
30
+ } = _a,
31
+ rest = __rest(_a, ["className", "color", "children", "dot", "type", "style", "time", "extra", "onClick"]);
21
32
  const itemCls = cls(prefixCls, className);
22
33
  const dotCls = cls({
23
34
  [`${prefixCls}-head`]: true,
@@ -29,11 +40,11 @@ export default class Item extends PureComponent {
29
40
  backgroundColor: color
30
41
  }
31
42
  } : null;
32
- return /*#__PURE__*/React.createElement("li", {
43
+ return /*#__PURE__*/React.createElement("li", Object.assign({
33
44
  className: itemCls,
34
45
  style: style,
35
46
  onClick: onClick
36
- }, /*#__PURE__*/React.createElement("div", {
47
+ }, getDataAttr(rest)), /*#__PURE__*/React.createElement("div", {
37
48
  className: `${prefixCls}-tail`,
38
49
  "aria-hidden": true
39
50
  }), /*#__PURE__*/React.createElement("div", Object.assign({
@@ -26,6 +26,7 @@ declare const createBaseToast: () => {
26
26
  componentWillUnmount(): void;
27
27
  isControlled: (key: any) => boolean;
28
28
  log(text: string, ...rest: any): any;
29
+ getDataAttr(props?: any): {};
29
30
  context: unknown;
30
31
  setState<K extends keyof ToastListState>(state: ToastListState | ((prevState: Readonly<ToastListState>, props: Readonly<ToastListProps>) => ToastListState | Pick<ToastListState, K>) | Pick<ToastListState, K>, callback?: () => void): void;
31
32
  forceUpdate(callback?: () => void): void;
@@ -59,6 +60,7 @@ declare const createBaseToast: () => {
59
60
  componentWillUnmount(): void;
60
61
  isControlled: (key: any) => boolean;
61
62
  log(text: string, ...rest: any): any;
63
+ getDataAttr(props?: any): {};
62
64
  context: unknown;
63
65
  setState<K extends keyof ToastListState>(state: ToastListState | ((prevState: Readonly<ToastListState>, props: Readonly<ToastListProps>) => ToastListState | Pick<ToastListState, K>) | Pick<ToastListState, K>, callback?: () => void): void;
64
66
  forceUpdate(callback?: () => void): void;
@@ -120,6 +122,7 @@ declare const _default: {
120
122
  componentWillUnmount(): void;
121
123
  isControlled: (key: any) => boolean;
122
124
  log(text: string, ...rest: any): any;
125
+ getDataAttr(props?: any): {};
123
126
  context: unknown;
124
127
  setState<K extends keyof ToastListState>(state: ToastListState | ((prevState: Readonly<ToastListState>, props: Readonly<ToastListProps>) => ToastListState | Pick<ToastListState, K>) | Pick<ToastListState, K>, callback?: () => void): void;
125
128
  forceUpdate(callback?: () => void): void;
@@ -153,6 +156,7 @@ declare const _default: {
153
156
  componentWillUnmount(): void;
154
157
  isControlled: (key: any) => boolean;
155
158
  log(text: string, ...rest: any): any;
159
+ getDataAttr(props?: any): {};
156
160
  context: unknown;
157
161
  setState<K extends keyof ToastListState>(state: ToastListState | ((prevState: Readonly<ToastListState>, props: Readonly<ToastListProps>) => ToastListState | Pick<ToastListState, K>) | Pick<ToastListState, K>, callback?: () => void): void;
158
162
  forceUpdate(callback?: () => void): void;
@@ -203,7 +203,9 @@ export default class Tooltip extends BaseComponent {
203
203
  role: role,
204
204
  "x-placement": placement,
205
205
  id: id
206
- }), contentNode, icon);
206
+ }), /*#__PURE__*/React.createElement("div", {
207
+ className: `${prefix}-content`
208
+ }, contentNode), icon);
207
209
  });
208
210
  return /*#__PURE__*/React.createElement(Portal, {
209
211
  getPopupContainer: this.props.getPopupContainer,
@@ -3,6 +3,14 @@ import _isEmpty from "lodash/isEmpty";
3
3
  import _omit from "lodash/omit";
4
4
  import _noop from "lodash/noop";
5
5
  import _isEqual from "lodash/isEqual";
6
+ var __rest = this && this.__rest || function (s, e) {
7
+ var t = {};
8
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
9
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
10
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
11
+ }
12
+ return t;
13
+ };
6
14
  import React from 'react';
7
15
  import cls from 'classnames';
8
16
  import { SortableContainer, SortableElement, SortableHandle } from 'react-sortable-hoc';
@@ -544,23 +552,25 @@ class Transfer extends BaseComponent {
544
552
  }, headerCom, content);
545
553
  }
546
554
  render() {
547
- const {
548
- className,
549
- style,
550
- disabled,
551
- renderSelectedPanel,
552
- renderSourcePanel
553
- } = this.props;
555
+ const _a = this.props,
556
+ {
557
+ className,
558
+ style,
559
+ disabled,
560
+ renderSelectedPanel,
561
+ renderSourcePanel
562
+ } = _a,
563
+ rest = __rest(_a, ["className", "style", "disabled", "renderSelectedPanel", "renderSourcePanel"]);
554
564
  const transferCls = cls(prefixCls, className, {
555
565
  [`${prefixCls}-disabled`]: disabled,
556
566
  [`${prefixCls}-custom-panel`]: renderSelectedPanel && renderSourcePanel
557
567
  });
558
568
  return /*#__PURE__*/React.createElement(LocaleConsumer, {
559
569
  componentName: "Transfer"
560
- }, locale => /*#__PURE__*/React.createElement("div", {
570
+ }, locale => /*#__PURE__*/React.createElement("div", Object.assign({
561
571
  className: transferCls,
562
572
  style: style
563
- }, this.renderLeft(locale), this.renderRight(locale)));
573
+ }, this.getDataAttr(rest)), this.renderLeft(locale), this.renderRight(locale)));
564
574
  }
565
575
  }
566
576
  Transfer.propTypes = {
@@ -2,6 +2,14 @@ import _isFunction from "lodash/isFunction";
2
2
  import _get from "lodash/get";
3
3
  import _isEqual from "lodash/isEqual";
4
4
  import _isEmpty from "lodash/isEmpty";
5
+ var __rest = this && this.__rest || function (s, e) {
6
+ var t = {};
7
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
8
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
9
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
5
13
  /* eslint-disable max-lines-per-function */
6
14
  import React from 'react';
7
15
  import cls from 'classnames';
@@ -564,26 +572,28 @@ class Tree extends BaseComponent {
564
572
  checkedKeys,
565
573
  realCheckedKeys
566
574
  } = this.state;
567
- const {
568
- blockNode,
569
- className,
570
- style,
571
- filterTreeNode,
572
- disabled,
573
- icon,
574
- directory,
575
- multiple,
576
- showFilteredOnly,
577
- motion,
578
- expandAction,
579
- loadData,
580
- renderLabel,
581
- draggable,
582
- renderFullLabel,
583
- labelEllipsis,
584
- virtualize,
585
- checkRelation
586
- } = this.props;
575
+ const _a = this.props,
576
+ {
577
+ blockNode,
578
+ className,
579
+ style,
580
+ filterTreeNode,
581
+ disabled,
582
+ icon,
583
+ directory,
584
+ multiple,
585
+ showFilteredOnly,
586
+ motion,
587
+ expandAction,
588
+ loadData,
589
+ renderLabel,
590
+ draggable,
591
+ renderFullLabel,
592
+ labelEllipsis,
593
+ virtualize,
594
+ checkRelation
595
+ } = _a,
596
+ rest = __rest(_a, ["blockNode", "className", "style", "filterTreeNode", "disabled", "icon", "directory", "multiple", "showFilteredOnly", "motion", "expandAction", "loadData", "renderLabel", "draggable", "renderFullLabel", "labelEllipsis", "virtualize", "checkRelation"]);
587
597
  const wrapperCls = cls(`${prefixcls}-wrapper`, className);
588
598
  const listCls = cls(`${prefixcls}-option-list`, {
589
599
  [`${prefixcls}-option-list-block`]: blockNode
@@ -632,11 +642,11 @@ class Tree extends BaseComponent {
632
642
  dropPosition,
633
643
  labelEllipsis: typeof labelEllipsis === 'undefined' ? virtualize : labelEllipsis
634
644
  }
635
- }, /*#__PURE__*/React.createElement("div", {
645
+ }, /*#__PURE__*/React.createElement("div", Object.assign({
636
646
  "aria-label": this.props['aria-label'],
637
647
  className: wrapperCls,
638
648
  style: style
639
- }, filterTreeNode ? this.renderInput() : null, /*#__PURE__*/React.createElement("div", Object.assign({
649
+ }, this.getDataAttr(rest)), filterTreeNode ? this.renderInput() : null, /*#__PURE__*/React.createElement("div", Object.assign({
640
650
  className: listCls
641
651
  }, ariaAttr), noData ? this.renderEmpty() : multiple ? /*#__PURE__*/React.createElement(CheckboxGroup, {
642
652
  value: Array.from(checkRelation === 'related' ? checkedKeys : realCheckedKeys)
@@ -6,6 +6,14 @@ import _noop from "lodash/noop";
6
6
  import _isEmpty from "lodash/isEmpty";
7
7
  import _isString from "lodash/isString";
8
8
  import _isEqual from "lodash/isEqual";
9
+ var __rest = this && this.__rest || function (s, e) {
10
+ var t = {};
11
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
12
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
13
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
14
+ }
15
+ return t;
16
+ };
9
17
  import React, { Fragment } from 'react';
10
18
  import ReactDOM from 'react-dom';
11
19
  import cls from 'classnames';
@@ -331,24 +339,26 @@ class TreeSelect extends BaseComponent {
331
339
  return null;
332
340
  };
333
341
  this.renderSelection = () => {
334
- const {
335
- disabled,
336
- multiple,
337
- filterTreeNode,
338
- validateStatus,
339
- prefix,
340
- suffix,
341
- style,
342
- size,
343
- insetLabel,
344
- className,
345
- placeholder,
346
- showClear,
347
- leafOnly,
348
- searchPosition,
349
- triggerRender,
350
- borderless
351
- } = this.props;
342
+ const _a = this.props,
343
+ {
344
+ disabled,
345
+ multiple,
346
+ filterTreeNode,
347
+ validateStatus,
348
+ prefix,
349
+ suffix,
350
+ style,
351
+ size,
352
+ insetLabel,
353
+ className,
354
+ placeholder,
355
+ showClear,
356
+ leafOnly,
357
+ searchPosition,
358
+ triggerRender,
359
+ borderless
360
+ } = _a,
361
+ rest = __rest(_a, ["disabled", "multiple", "filterTreeNode", "validateStatus", "prefix", "suffix", "style", "size", "insetLabel", "className", "placeholder", "showClear", "leafOnly", "searchPosition", "triggerRender", "borderless"]);
352
362
  const {
353
363
  inputValue,
354
364
  selectedKeys,
@@ -430,7 +440,7 @@ class TreeSelect extends BaseComponent {
430
440
  "aria-labelledby": this.props['aria-labelledby'],
431
441
  "aria-describedby": this.props['aria-describedby'],
432
442
  "aria-required": this.props['aria-required']
433
- }, mouseEvent), inner);
443
+ }, mouseEvent, this.getDataAttr(rest)), inner);
434
444
  };
435
445
  // eslint-disable-next-line @typescript-eslint/no-shadow
436
446
  this.renderTagItem = (key, idx) => {
@@ -552,7 +562,8 @@ class TreeSelect extends BaseComponent {
552
562
  searchPosition,
553
563
  searchAutoFocus,
554
564
  multiple,
555
- disabled
565
+ disabled,
566
+ preventScroll
556
567
  } = this.props;
557
568
  const isDropdownPositionSearch = searchPosition === strings.SEARCH_POSITION_DROPDOWN;
558
569
  const inputcls = cls({
@@ -565,6 +576,7 @@ class TreeSelect extends BaseComponent {
565
576
  const baseInputProps = {
566
577
  value: inputValue,
567
578
  className: inputcls,
579
+ preventScroll,
568
580
  onChange: value => this.search(value)
569
581
  };
570
582
  const inputDropdownProps = {
@@ -39,7 +39,7 @@ export default class Title extends PureComponent<TitleProps> {
39
39
  underline: PropTypes.Requireable<boolean>;
40
40
  strong: PropTypes.Requireable<boolean>;
41
41
  type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
42
- heading: PropTypes.Requireable<1 | 2 | 3 | 4 | 6 | 5>;
42
+ heading: PropTypes.Requireable<1 | 2 | 3 | 4 | 5 | 6>;
43
43
  style: PropTypes.Requireable<object>;
44
44
  className: PropTypes.Requireable<string>;
45
45
  component: PropTypes.Requireable<string>;