@douyinfe/semi-ui 2.40.0-alpha.0 → 2.40.0-beta.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 (243) hide show
  1. package/dist/css/semi.css +3 -36
  2. package/dist/css/semi.min.css +1 -1
  3. package/dist/umd/semi-ui.js +280 -537
  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/_portal/index.d.ts +3 -2
  8. package/lib/cjs/_portal/index.js +33 -26
  9. package/lib/cjs/_utils/index.js +0 -3
  10. package/lib/cjs/autoComplete/index.js +0 -2
  11. package/lib/cjs/autoComplete/option.js +0 -2
  12. package/lib/cjs/avatar/avatarGroup.js +0 -1
  13. package/lib/cjs/avatar/index.js +0 -1
  14. package/lib/cjs/backtop/index.js +0 -1
  15. package/lib/cjs/badge/index.js +0 -1
  16. package/lib/cjs/banner/index.js +0 -3
  17. package/lib/cjs/breadcrumb/index.js +0 -3
  18. package/lib/cjs/button/Button.js +8 -14
  19. package/lib/cjs/calendar/dayCalendar.js +4 -9
  20. package/lib/cjs/calendar/dayCol.js +1 -1
  21. package/lib/cjs/calendar/monthCalendar.js +5 -12
  22. package/lib/cjs/calendar/rangeCalendar.js +0 -2
  23. package/lib/cjs/carousel/index.js +0 -2
  24. package/lib/cjs/checkbox/checkbox.js +0 -2
  25. package/lib/cjs/checkbox/checkboxGroup.js +0 -3
  26. package/lib/cjs/checkbox/checkboxInner.js +0 -2
  27. package/lib/cjs/collapse/index.js +0 -1
  28. package/lib/cjs/datePicker/dateInput.d.ts +1 -1
  29. package/lib/cjs/datePicker/dateInput.js +0 -3
  30. package/lib/cjs/datePicker/datePicker.d.ts +1 -1
  31. package/lib/cjs/datePicker/datePicker.js +1 -3
  32. package/lib/cjs/datePicker/month.js +0 -4
  33. package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
  34. package/lib/cjs/datePicker/monthsGrid.js +1 -5
  35. package/lib/cjs/datePicker/yearAndMonth.d.ts +1 -1
  36. package/lib/cjs/datePicker/yearAndMonth.js +0 -2
  37. package/lib/cjs/form/arrayField.js +0 -2
  38. package/lib/cjs/form/baseForm.d.ts +0 -1
  39. package/lib/cjs/form/baseForm.js +5 -7
  40. package/lib/cjs/form/context.js +0 -2
  41. package/lib/cjs/form/errorMessage.js +0 -2
  42. package/lib/cjs/form/field.d.ts +0 -1
  43. package/lib/cjs/form/field.js +0 -2
  44. package/lib/cjs/form/group.js +0 -2
  45. package/lib/cjs/form/hoc/withField.js +2 -6
  46. package/lib/cjs/form/interface.d.ts +4 -4
  47. package/lib/cjs/form/interface.js +0 -3
  48. package/lib/cjs/form/section.js +0 -2
  49. package/lib/cjs/form/slot.js +0 -3
  50. package/lib/cjs/iconButton/index.js +0 -2
  51. package/lib/cjs/image/image.js +29 -34
  52. package/lib/cjs/image/interface.d.ts +4 -1
  53. package/lib/cjs/image/preview.js +5 -3
  54. package/lib/cjs/image/previewContext.d.ts +1 -0
  55. package/lib/cjs/image/previewFooter.d.ts +5 -1
  56. package/lib/cjs/image/previewFooter.js +66 -38
  57. package/lib/cjs/image/previewInner.d.ts +2 -2
  58. package/lib/cjs/image/previewInner.js +4 -2
  59. package/lib/cjs/input/index.js +0 -2
  60. package/lib/cjs/input/inputGroup.js +0 -3
  61. package/lib/cjs/input/textarea.js +0 -2
  62. package/lib/cjs/inputNumber/index.js +1 -5
  63. package/lib/cjs/modal/ConfirmModal.js +0 -2
  64. package/lib/cjs/modal/Modal.js +0 -2
  65. package/lib/cjs/modal/ModalContent.js +0 -5
  66. package/lib/cjs/modal/confirm.d.ts +12 -12
  67. package/lib/cjs/modal/confirm.js +0 -1
  68. package/lib/cjs/modal/useModal/HookModal.js +0 -1
  69. package/lib/cjs/modal/useModal/index.js +0 -2
  70. package/lib/cjs/navigation/Item.js +0 -3
  71. package/lib/cjs/navigation/SubNav.js +0 -3
  72. package/lib/cjs/navigation/index.js +0 -2
  73. package/lib/cjs/notification/notice.js +29 -35
  74. package/lib/cjs/notification/useNotification/index.js +1 -1
  75. package/lib/cjs/overflowList/index.js +0 -2
  76. package/lib/cjs/pagination/index.d.ts +2 -0
  77. package/lib/cjs/pagination/index.js +29 -13
  78. package/lib/cjs/popconfirm/index.js +0 -2
  79. package/lib/cjs/progress/index.js +0 -1
  80. package/lib/cjs/radio/radio.js +0 -2
  81. package/lib/cjs/rating/index.js +0 -1
  82. package/lib/cjs/resizeObserver/index.js +0 -1
  83. package/lib/cjs/scrollList/scrollItem.js +0 -3
  84. package/lib/cjs/select/index.d.ts +0 -1
  85. package/lib/cjs/select/index.js +3 -12
  86. package/lib/cjs/select/option.js +0 -2
  87. package/lib/cjs/select/utils.js +0 -2
  88. package/lib/cjs/sideSheet/index.js +0 -2
  89. package/lib/cjs/slider/index.js +0 -3
  90. package/lib/cjs/spin/icon.js +0 -2
  91. package/lib/cjs/switch/index.js +0 -2
  92. package/lib/cjs/table/Body/BaseRow.js +0 -2
  93. package/lib/cjs/table/Body/ExpandedRow.js +0 -3
  94. package/lib/cjs/table/Body/SectionRow.js +0 -3
  95. package/lib/cjs/table/Body/index.js +0 -8
  96. package/lib/cjs/table/ColGroup.js +0 -1
  97. package/lib/cjs/table/ColumnFilter.js +0 -3
  98. package/lib/cjs/table/ColumnSelection.js +0 -2
  99. package/lib/cjs/table/HeadTable.js +0 -2
  100. package/lib/cjs/table/ResizableTable.js +1 -4
  101. package/lib/cjs/table/Table.js +1 -10
  102. package/lib/cjs/table/TableCell.js +0 -4
  103. package/lib/cjs/table/TableHeader.js +0 -4
  104. package/lib/cjs/table/TableHeaderRow.js +0 -2
  105. package/lib/cjs/table/TablePagination.js +0 -2
  106. package/lib/cjs/table/table-context.js +0 -2
  107. package/lib/cjs/tabs/TabBar.js +0 -2
  108. package/lib/cjs/tag/index.js +1 -3
  109. package/lib/cjs/tagInput/index.js +0 -2
  110. package/lib/cjs/timePicker/Combobox.js +0 -4
  111. package/lib/cjs/timePicker/TimeInput.js +0 -2
  112. package/lib/cjs/timePicker/TimePicker.js +0 -2
  113. package/lib/cjs/toast/index.js +0 -2
  114. package/lib/cjs/toast/toast.js +0 -2
  115. package/lib/cjs/toast/useToast/index.js +0 -1
  116. package/lib/cjs/tooltip/index.js +0 -6
  117. package/lib/cjs/transfer/index.js +0 -3
  118. package/lib/cjs/tree/index.d.ts +2 -1
  119. package/lib/cjs/tree/index.js +11 -14
  120. package/lib/cjs/tree/treeNode.js +0 -3
  121. package/lib/cjs/treeSelect/index.js +0 -7
  122. package/lib/cjs/trigger/index.js +0 -2
  123. package/lib/cjs/typography/util.js +1 -3
  124. package/lib/cjs/upload/index.js +1 -6
  125. package/lib/es/_portal/index.d.ts +3 -2
  126. package/lib/es/_portal/index.js +33 -26
  127. package/lib/es/_utils/index.js +0 -2
  128. package/lib/es/autoComplete/index.js +0 -1
  129. package/lib/es/autoComplete/option.js +0 -1
  130. package/lib/es/avatar/avatarGroup.js +0 -1
  131. package/lib/es/avatar/index.js +0 -1
  132. package/lib/es/backtop/index.js +0 -1
  133. package/lib/es/badge/index.js +0 -1
  134. package/lib/es/banner/index.js +0 -2
  135. package/lib/es/breadcrumb/index.js +0 -2
  136. package/lib/es/button/Button.js +8 -13
  137. package/lib/es/calendar/dayCalendar.js +4 -9
  138. package/lib/es/calendar/dayCol.js +1 -1
  139. package/lib/es/calendar/monthCalendar.js +5 -11
  140. package/lib/es/calendar/rangeCalendar.js +0 -1
  141. package/lib/es/carousel/index.js +0 -1
  142. package/lib/es/checkbox/checkbox.js +0 -1
  143. package/lib/es/checkbox/checkboxGroup.js +0 -2
  144. package/lib/es/checkbox/checkboxInner.js +0 -1
  145. package/lib/es/collapse/index.js +0 -1
  146. package/lib/es/datePicker/dateInput.d.ts +1 -1
  147. package/lib/es/datePicker/dateInput.js +0 -3
  148. package/lib/es/datePicker/datePicker.d.ts +1 -1
  149. package/lib/es/datePicker/datePicker.js +0 -3
  150. package/lib/es/datePicker/month.js +0 -4
  151. package/lib/es/datePicker/monthsGrid.d.ts +1 -1
  152. package/lib/es/datePicker/monthsGrid.js +1 -5
  153. package/lib/es/datePicker/yearAndMonth.d.ts +1 -1
  154. package/lib/es/datePicker/yearAndMonth.js +0 -1
  155. package/lib/es/form/arrayField.js +0 -1
  156. package/lib/es/form/baseForm.d.ts +0 -1
  157. package/lib/es/form/baseForm.js +5 -6
  158. package/lib/es/form/context.js +0 -1
  159. package/lib/es/form/errorMessage.js +0 -1
  160. package/lib/es/form/field.d.ts +0 -1
  161. package/lib/es/form/field.js +0 -1
  162. package/lib/es/form/group.js +0 -1
  163. package/lib/es/form/hoc/withField.js +2 -6
  164. package/lib/es/form/interface.d.ts +4 -4
  165. package/lib/es/form/interface.js +0 -2
  166. package/lib/es/form/section.js +0 -1
  167. package/lib/es/form/slot.js +0 -2
  168. package/lib/es/iconButton/index.js +0 -1
  169. package/lib/es/image/image.js +29 -34
  170. package/lib/es/image/interface.d.ts +4 -1
  171. package/lib/es/image/preview.js +5 -3
  172. package/lib/es/image/previewContext.d.ts +1 -0
  173. package/lib/es/image/previewFooter.d.ts +5 -1
  174. package/lib/es/image/previewFooter.js +66 -38
  175. package/lib/es/image/previewInner.d.ts +2 -2
  176. package/lib/es/image/previewInner.js +4 -1
  177. package/lib/es/input/index.js +0 -1
  178. package/lib/es/input/inputGroup.js +0 -2
  179. package/lib/es/input/textarea.js +0 -1
  180. package/lib/es/inputNumber/index.js +0 -5
  181. package/lib/es/modal/ConfirmModal.js +0 -2
  182. package/lib/es/modal/Modal.js +0 -1
  183. package/lib/es/modal/ModalContent.js +0 -3
  184. package/lib/es/modal/confirm.d.ts +12 -12
  185. package/lib/es/modal/confirm.js +0 -1
  186. package/lib/es/modal/useModal/HookModal.js +0 -1
  187. package/lib/es/modal/useModal/index.js +0 -2
  188. package/lib/es/navigation/Item.js +0 -2
  189. package/lib/es/navigation/SubNav.js +0 -2
  190. package/lib/es/navigation/index.js +0 -1
  191. package/lib/es/notification/notice.js +29 -34
  192. package/lib/es/notification/useNotification/index.js +1 -1
  193. package/lib/es/overflowList/index.js +0 -1
  194. package/lib/es/pagination/index.d.ts +2 -0
  195. package/lib/es/pagination/index.js +28 -13
  196. package/lib/es/popconfirm/index.js +0 -1
  197. package/lib/es/progress/index.js +0 -1
  198. package/lib/es/radio/radio.js +0 -1
  199. package/lib/es/rating/index.js +0 -1
  200. package/lib/es/resizeObserver/index.js +0 -1
  201. package/lib/es/scrollList/scrollItem.js +0 -3
  202. package/lib/es/select/index.d.ts +0 -1
  203. package/lib/es/select/index.js +3 -12
  204. package/lib/es/select/option.js +0 -1
  205. package/lib/es/select/utils.js +0 -2
  206. package/lib/es/sideSheet/index.js +0 -1
  207. package/lib/es/slider/index.js +0 -3
  208. package/lib/es/spin/icon.js +0 -1
  209. package/lib/es/switch/index.js +0 -1
  210. package/lib/es/table/Body/BaseRow.js +0 -2
  211. package/lib/es/table/Body/ExpandedRow.js +0 -2
  212. package/lib/es/table/Body/SectionRow.js +0 -3
  213. package/lib/es/table/Body/index.js +0 -8
  214. package/lib/es/table/ColGroup.js +0 -1
  215. package/lib/es/table/ColumnFilter.js +0 -2
  216. package/lib/es/table/ColumnSelection.js +0 -1
  217. package/lib/es/table/HeadTable.js +0 -1
  218. package/lib/es/table/ResizableTable.js +0 -4
  219. package/lib/es/table/Table.js +0 -10
  220. package/lib/es/table/TableCell.js +0 -3
  221. package/lib/es/table/TableHeader.js +0 -3
  222. package/lib/es/table/TableHeaderRow.js +0 -1
  223. package/lib/es/table/TablePagination.js +0 -1
  224. package/lib/es/table/table-context.js +0 -1
  225. package/lib/es/tabs/TabBar.js +0 -2
  226. package/lib/es/tag/index.js +1 -2
  227. package/lib/es/tagInput/index.js +0 -2
  228. package/lib/es/timePicker/Combobox.js +0 -3
  229. package/lib/es/timePicker/TimeInput.js +0 -1
  230. package/lib/es/timePicker/TimePicker.js +0 -1
  231. package/lib/es/toast/index.js +0 -1
  232. package/lib/es/toast/toast.js +0 -1
  233. package/lib/es/toast/useToast/index.js +0 -1
  234. package/lib/es/tooltip/index.js +0 -5
  235. package/lib/es/transfer/index.js +0 -3
  236. package/lib/es/tree/index.d.ts +2 -1
  237. package/lib/es/tree/index.js +11 -13
  238. package/lib/es/tree/treeNode.js +0 -3
  239. package/lib/es/treeSelect/index.js +0 -7
  240. package/lib/es/trigger/index.js +0 -2
  241. package/lib/es/typography/util.js +1 -3
  242. package/lib/es/upload/index.js +1 -5
  243. package/package.json +8 -8
@@ -1,6 +1,5 @@
1
1
  import _isFunction from "lodash/isFunction";
2
2
  import _noop from "lodash/noop";
3
- /* eslint-disable max-len */
4
3
  import React from 'react';
5
4
  import PropTypes from 'prop-types';
6
5
  import BaseComponent from '../_base/baseComponent';
@@ -9,7 +8,6 @@ import { shouldShowEllipsisTitle } from '@douyinfe/semi-foundation/lib/es/table/
9
8
  import TableHeaderRow from './TableHeaderRow';
10
9
  function parseHeaderRows(columns) {
11
10
  const rows = [];
12
- // eslint-disable-next-line @typescript-eslint/no-shadow
13
11
  function fillRowCells(columns, colIndex) {
14
12
  let parents = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
15
13
  let rowIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
@@ -77,7 +75,6 @@ function parseHeaderRows(columns) {
77
75
  for (let rowIndex = 0; rowIndex < rowCount; rowIndex += 1) {
78
76
  rows[rowIndex].forEach(cell => {
79
77
  if (!('rowSpan' in cell) && !cell.hasSubColumns) {
80
- // eslint-disable-next-line no-param-reassign
81
78
  cell.rowSpan = rowCount - rowIndex;
82
79
  }
83
80
  });
@@ -12,7 +12,6 @@ var __rest = this && this.__rest || function (s, e) {
12
12
  }
13
13
  return t;
14
14
  };
15
- /* eslint-disable eqeqeq */
16
15
  import React from 'react';
17
16
  import classnames from 'classnames';
18
17
  import PropTypes from 'prop-types';
@@ -1,6 +1,5 @@
1
1
  import _isFunction from "lodash/isFunction";
2
2
  import _get from "lodash/get";
3
- /* eslint-disable max-len */
4
3
  import React, { PureComponent, isValidElement } from 'react';
5
4
  import PropTypes from 'prop-types';
6
5
  import { cssClasses } from '@douyinfe/semi-foundation/lib/es/table/constants';
@@ -1,5 +1,4 @@
1
1
  import _noop from "lodash/noop";
2
- /* eslint-disable max-len */
3
2
  import React from 'react';
4
3
  const TableContext = /*#__PURE__*/React.createContext({
5
4
  headWidths: [],
@@ -26,7 +26,6 @@ class TabBar extends React.Component {
26
26
  this.props.onTabClick(itemKey, e);
27
27
  if (this.props.collapsible) {
28
28
  const key = this._getItemKey(itemKey);
29
- // eslint-disable-next-line max-len
30
29
  const tabItem = document.querySelector(`[data-uuid="${this.state.uuid}"] .${cssClasses.TABS_TAB}[data-scrollkey="${key}"]`);
31
30
  tabItem.scrollIntoView({
32
31
  behavior: 'smooth',
@@ -65,7 +64,6 @@ class TabBar extends React.Component {
65
64
  return;
66
65
  }
67
66
  const key = this._getItemKey(lastItem.itemKey);
68
- // eslint-disable-next-line max-len
69
67
  const tabItem = document.querySelector(`[data-uuid="${this.state.uuid}"] .${cssClasses.TABS_TAB}[data-scrollkey="${key}"]`);
70
68
  tabItem.scrollIntoView({
71
69
  behavior: 'smooth',
@@ -7,7 +7,6 @@ var __rest = this && this.__rest || function (s, e) {
7
7
  }
8
8
  return t;
9
9
  };
10
- /* eslint-disable jsx-a11y/no-static-element-interactions */
11
10
  import React, { Component } from 'react';
12
11
  import classNames from 'classnames';
13
12
  import PropTypes from 'prop-types';
@@ -144,7 +143,7 @@ export default class Tag extends Component {
144
143
  const wrapProps = clickable ? Object.assign(Object.assign({}, baseProps), a11yProps) : baseProps;
145
144
  const closeIcon = closable ?
146
145
  /*#__PURE__*/
147
- // eslint-disable-next-line jsx-a11y/click-events-have-key-events
146
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
148
147
  React.createElement("div", {
149
148
  className: `${prefixCls}-close`,
150
149
  onClick: e => this.close(e, children, tagKey)
@@ -326,7 +326,6 @@ class TagInput extends BaseComponent {
326
326
  const prefixWrapperCls = cls(`${prefixCls}-prefix`, {
327
327
  [`${prefixCls}-inset-label`]: insetLabel,
328
328
  [`${prefixCls}-prefix-text`]: labelNode && _isString(labelNode),
329
- // eslint-disable-next-line max-len
330
329
  [`${prefixCls}-prefix-icon`]: isSemiIcon(labelNode)
331
330
  });
332
331
  return (
@@ -350,7 +349,6 @@ class TagInput extends BaseComponent {
350
349
  }
351
350
  const suffixWrapperCls = cls(`${prefixCls}-suffix`, {
352
351
  [`${prefixCls}-suffix-text`]: suffix && _isString(suffix),
353
- // eslint-disable-next-line max-len
354
352
  [`${prefixCls}-suffix-icon`]: isSemiIcon(suffix)
355
353
  });
356
354
  return (
@@ -1,6 +1,4 @@
1
1
  import _noop from "lodash/noop";
2
- /* eslint-disable max-len */
3
- /* eslint-disable react/no-did-update-set-state */
4
2
  import React from 'react';
5
3
  import PropTypes from 'prop-types';
6
4
  import { format as dateFnsFormat } from 'date-fns';
@@ -33,7 +31,6 @@ class Combobox extends BaseComponent {
33
31
  value,
34
32
  disabled
35
33
  } = _ref;
36
- // eslint-disable-next-line prefer-const
37
34
  let {
38
35
  onChange,
39
36
  use12Hours,
@@ -7,7 +7,6 @@ var __rest = this && this.__rest || function (s, e) {
7
7
  }
8
8
  return t;
9
9
  };
10
- /* eslint-disable no-unused-vars */
11
10
  import React from 'react';
12
11
  import PropTypes from 'prop-types';
13
12
  import classNames from 'classnames';
@@ -8,7 +8,6 @@ var __rest = this && this.__rest || function (s, e) {
8
8
  }
9
9
  return t;
10
10
  };
11
- /* eslint-disable no-unused-vars */
12
11
  import React from 'react';
13
12
  import PropTypes from 'prop-types';
14
13
  import classNames from 'classnames';
@@ -1,4 +1,3 @@
1
- /* eslint-disable no-param-reassign */
2
1
  import React from 'react';
3
2
  import ReactDOM from 'react-dom';
4
3
  import PropTypes from 'prop-types';
@@ -1,5 +1,4 @@
1
1
  import _noop from "lodash/noop";
2
- /* eslint-disable max-len */
3
2
  import React from 'react';
4
3
  import cls from 'classnames';
5
4
  import PropTypes from 'prop-types';
@@ -35,7 +35,6 @@ export default function useToast() {
35
35
  const mergeConfig = Object.assign(Object.assign({}, config), {
36
36
  id
37
37
  });
38
- // eslint-disable-next-line prefer-const
39
38
  let closeFunc;
40
39
  const toast = /*#__PURE__*/React.createElement(HookToast, Object.assign({}, mergeConfig, {
41
40
  key: id,
@@ -14,7 +14,6 @@ var __rest = this && this.__rest || function (s, e) {
14
14
  }
15
15
  return t;
16
16
  };
17
- /* eslint-disable prefer-destructuring, max-lines-per-function, react/no-find-dom-node, max-len, @typescript-eslint/no-empty-function */
18
17
  import React, { isValidElement, cloneElement } from 'react';
19
18
  import ReactDOM from 'react-dom';
20
19
  import classNames from 'classnames';
@@ -292,12 +291,10 @@ export default class Tooltip extends BaseComponent {
292
291
  get adapter() {
293
292
  var _this = this;
294
293
  return Object.assign(Object.assign({}, super.adapter), {
295
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
296
294
  // @ts-ignore
297
295
  on: function () {
298
296
  return _this.eventManager.on(...arguments);
299
297
  },
300
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
301
298
  // @ts-ignore
302
299
  off: function () {
303
300
  return _this.eventManager.off(...arguments);
@@ -345,7 +342,6 @@ export default class Tooltip extends BaseComponent {
345
342
  });
346
343
  },
347
344
  getTriggerBounding: () => {
348
- // eslint-disable-next-line
349
345
  // It may be a React component or an html element
350
346
  // There is no guarantee that triggerE l.current can get the real dom, so call findDOMNode to ensure that you can get the real dom
351
347
  const triggerDOM = this.adapter.getTriggerNode();
@@ -599,7 +595,6 @@ export default class Tooltip extends BaseComponent {
599
595
  this.isWrapped = true;
600
596
  }
601
597
  }
602
- // eslint-disable-next-line prefer-const
603
598
  let ariaAttribute = {};
604
599
  // Take effect when used by Popover component
605
600
  if (role === 'dialog') {
@@ -46,7 +46,6 @@ const SortableList = SortableContainer(_ref => {
46
46
  index: index,
47
47
  item: item
48
48
  })))
49
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
50
49
  // @ts-ignore see reasons: https://github.com/clauderic/react-sortable-hoc/issues/206
51
50
  ;
52
51
  }, {
@@ -69,12 +68,10 @@ class Transfer extends BaseComponent {
69
68
  inputValue: ''
70
69
  };
71
70
  if (Boolean(dataSource) && _isArray(dataSource)) {
72
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
73
71
  // @ts-ignore Avoid reporting errors this.state.xxx is read-only
74
72
  this.state.data = _generateDataByType(dataSource, type);
75
73
  }
76
74
  if (Boolean(defaultValue) && _isArray(defaultValue)) {
77
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
78
75
  // @ts-ignore Avoid reporting errors this.state.xxx is read-only
79
76
  this.state.selectedItems = _generateSelectedItems(defaultValue, this.state.data);
80
77
  }
@@ -6,7 +6,7 @@ import BaseComponent from '../_base/baseComponent';
6
6
  import Input from '../input/index';
7
7
  import TreeNode from './treeNode';
8
8
  import '@douyinfe/semi-foundation/lib/es/tree/tree.css';
9
- import { TreeProps, TreeState, TreeNodeProps, TreeNodeData, FlattenNode, KeyEntity, ScrollData } from './interface';
9
+ import { TreeProps, TreeState, TreeNodeProps, TreeNodeData, FlattenNode, KeyEntity, OptionProps, ScrollData } from './interface';
10
10
  export * from './interface';
11
11
  export type { AutoSizerProps } from './autoSizer';
12
12
  declare class Tree extends BaseComponent<TreeProps, TreeState> {
@@ -137,6 +137,7 @@ declare class Tree extends BaseComponent<TreeProps, TreeState> {
137
137
  getTreeNodeKey: (treeNode: TreeNodeData) => any;
138
138
  renderTreeNode: (treeNode: FlattenNode, ind?: number, style?: React.CSSProperties) => JSX.Element;
139
139
  itemKey: (index: number, data: KeyEntity) => any;
140
+ option: ({ index, style, data }: OptionProps) => JSX.Element;
140
141
  renderNodeList(): JSX.Element;
141
142
  render(): JSX.Element;
142
143
  }
@@ -10,7 +10,6 @@ var __rest = this && this.__rest || function (s, e) {
10
10
  }
11
11
  return t;
12
12
  };
13
- /* eslint-disable max-lines-per-function */
14
13
  import React from 'react';
15
14
  import cls from 'classnames';
16
15
  import PropTypes from 'prop-types';
@@ -165,6 +164,14 @@ class Tree extends BaseComponent {
165
164
  // Return a value that uniquely identifies this item.
166
165
  return item.key;
167
166
  };
167
+ this.option = _ref2 => {
168
+ let {
169
+ index,
170
+ style,
171
+ data
172
+ } = _ref2;
173
+ return this.renderTreeNode(data[index], index, style);
174
+ };
168
175
  this.state = {
169
176
  inputValue: '',
170
177
  keyEntities: {},
@@ -228,7 +235,6 @@ class Tree extends BaseComponent {
228
235
  };
229
236
  // Update the data of tree in state
230
237
  if (needUpdate('treeData') || props.draggable && needUpdateData()) {
231
- // eslint-disable-next-line prefer-destructuring
232
238
  treeData = props.treeData;
233
239
  newState.treeData = treeData;
234
240
  const entitiesMap = convertDataToEntities(treeData);
@@ -424,11 +430,11 @@ class Tree extends BaseComponent {
424
430
  updateState: states => {
425
431
  this.setState(Object.assign({}, states));
426
432
  },
427
- notifyExpand: (expandedKeys, _ref2) => {
433
+ notifyExpand: (expandedKeys, _ref3) => {
428
434
  let {
429
435
  expanded: bool,
430
436
  node
431
- } = _ref2;
437
+ } = _ref3;
432
438
  this.props.onExpand && this.props.onExpand([...expandedKeys], {
433
439
  expanded: bool,
434
440
  node
@@ -529,14 +535,6 @@ class Tree extends BaseComponent {
529
535
  renderTreeNode: this.renderTreeNode
530
536
  });
531
537
  }
532
- const option = _ref3 => {
533
- let {
534
- index,
535
- style,
536
- data
537
- } = _ref3;
538
- return this.renderTreeNode(data[index], index, style);
539
- };
540
538
  return /*#__PURE__*/React.createElement(AutoSizer, {
541
539
  defaultHeight: virtualize.height,
542
540
  defaultWidth: virtualize.width
@@ -557,7 +555,7 @@ class Tree extends BaseComponent {
557
555
  style: {
558
556
  direction
559
557
  }
560
- }, option);
558
+ }, this.option);
561
559
  });
562
560
  }
563
561
  render() {
@@ -294,7 +294,6 @@ export default class TreeNode extends PureComponent {
294
294
  className: `${prefixcls}-item-icon`
295
295
  });
296
296
  } else {
297
- // eslint-disable-next-line max-len
298
297
  itemIcon = expanded ? /*#__PURE__*/React.createElement(IconFolderOpen, {
299
298
  className: `${prefixcls}-item-icon`
300
299
  }) : /*#__PURE__*/React.createElement(IconFolder, {
@@ -319,7 +318,6 @@ export default class TreeNode extends PureComponent {
319
318
  "x-semi-prop": "emptyContent"
320
319
  }, emptyContent));
321
320
  }
322
- // eslint-disable-next-line max-lines-per-function
323
321
  render() {
324
322
  const _a = this.props,
325
323
  {
@@ -334,7 +332,6 @@ export default class TreeNode extends PureComponent {
334
332
  empty,
335
333
  filtered,
336
334
  treeNodeFilterProp,
337
- // eslint-disable-next-line no-unused-vars
338
335
  display,
339
336
  style
340
337
  } = _a,
@@ -176,7 +176,6 @@ class TreeSelect extends BaseComponent {
176
176
  renderKeys = [...realCheckedKeys];
177
177
  }
178
178
  const tagList = [];
179
- // eslint-disable-next-line @typescript-eslint/no-shadow
180
179
  renderKeys.forEach((key, index) => {
181
180
  const item = keyEntities[key] && keyEntities[key].data.key === key ? keyEntities[key].data : this.getDataForKeyNotInKeyEntities(key);
182
181
  const onClose = (tagContent, e) => {
@@ -395,7 +394,6 @@ class TreeSelect extends BaseComponent {
395
394
  const triggerRenderKeys = multiple ? normalizeKeyList([...checkedKeys], keyEntities, leafOnly, true) : selectedKeys;
396
395
  const inner = useCustomTrigger ? /*#__PURE__*/React.createElement(Trigger, {
397
396
  inputValue: inputValue,
398
- // eslint-disable-next-line @typescript-eslint/no-shadow
399
397
  value: triggerRenderKeys.map(key => _get(keyEntities, [key, 'data'])),
400
398
  disabled: disabled,
401
399
  placeholder: placeholder,
@@ -442,7 +440,6 @@ class TreeSelect extends BaseComponent {
442
440
  "aria-required": this.props['aria-required']
443
441
  }, mouseEvent, this.getDataAttr(rest)), inner);
444
442
  };
445
- // eslint-disable-next-line @typescript-eslint/no-shadow
446
443
  this.renderTagItem = (key, idx) => {
447
444
  const {
448
445
  keyEntities,
@@ -666,7 +663,6 @@ class TreeSelect extends BaseComponent {
666
663
  const {
667
664
  data
668
665
  } = treeNode;
669
- // eslint-disable-next-line @typescript-eslint/no-shadow
670
666
  const {
671
667
  key
672
668
  } = data;
@@ -690,7 +686,6 @@ class TreeSelect extends BaseComponent {
690
686
  const {
691
687
  data
692
688
  } = treeNode;
693
- // eslint-disable-next-line @typescript-eslint/no-shadow
694
689
  const {
695
690
  key
696
691
  } = data;
@@ -878,7 +873,6 @@ class TreeSelect extends BaseComponent {
878
873
  this.adapter.rePositionDropdown();
879
874
  };
880
875
  }
881
- // eslint-disable-next-line max-lines-per-function
882
876
  static getDerivedStateFromProps(props, prevState) {
883
877
  const {
884
878
  prevProps,
@@ -1007,7 +1001,6 @@ class TreeSelect extends BaseComponent {
1007
1001
  const clickOutsideHandler = e => {
1008
1002
  const optionInstance = this.optionsRef && this.optionsRef.current;
1009
1003
  const triggerDom = this.triggerRef && this.triggerRef.current;
1010
- // eslint-disable-next-line
1011
1004
  const optionsDom = ReactDOM.findDOMNode(optionInstance);
1012
1005
  const target = e.target;
1013
1006
  if (optionsDom && (!optionsDom.contains(target) || !optionsDom.contains(target.parentNode)) && triggerDom && !triggerDom.contains(target)) {
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/ban-types */
2
1
  var __rest = this && this.__rest || function (s, e) {
3
2
  var t = {};
4
3
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
@@ -14,7 +13,6 @@ import PropTypes from 'prop-types';
14
13
  */
15
14
  class Trigger extends React.PureComponent {
16
15
  render() {
17
- // eslint-disable-next-line no-unused-vars
18
16
  const _a = this.props,
19
17
  {
20
18
  triggerRender,
@@ -27,9 +27,7 @@ const getRenderText = function (originEle, rows) {
27
27
  let fixedContent = arguments.length > 3 ? arguments[3] : undefined;
28
28
  let ellipsisStr = arguments.length > 4 ? arguments[4] : undefined;
29
29
  let suffix = arguments.length > 5 ? arguments[5] : undefined;
30
- let ellipsisPos
31
- // eslint-disable-next-line max-params
32
- = arguments.length > 6 ? arguments[6] : undefined;
30
+ let ellipsisPos = arguments.length > 6 ? arguments[6] : undefined;
33
31
  if (content.length === 0) {
34
32
  return '';
35
33
  }
@@ -8,7 +8,6 @@ var __rest = this && this.__rest || function (s, e) {
8
8
  }
9
9
  return t;
10
10
  };
11
- /* eslint-disable max-len */
12
11
  import React from 'react';
13
12
  import cls from 'classnames';
14
13
  import PropTypes from 'prop-types';
@@ -82,10 +81,7 @@ class Upload extends BaseComponent {
82
81
  * manual upload by user
83
82
  */
84
83
  this.upload = () => {
85
- const {
86
- fileList
87
- } = this.state;
88
- this.foundation.startUpload(fileList);
84
+ this.foundation.manualUpload();
89
85
  };
90
86
  /**
91
87
  * ref method
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-ui",
3
- "version": "2.40.0-alpha.0",
3
+ "version": "2.40.0-beta.0",
4
4
  "description": "",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es/index.js",
@@ -17,12 +17,12 @@
17
17
  "lib/*"
18
18
  ],
19
19
  "dependencies": {
20
- "@douyinfe/semi-animation": "2.40.0-alpha.0",
21
- "@douyinfe/semi-animation-react": "2.40.0-alpha.0",
22
- "@douyinfe/semi-foundation": "2.40.0-alpha.0",
23
- "@douyinfe/semi-icons": "2.40.0-alpha.0",
24
- "@douyinfe/semi-illustrations": "2.40.0-alpha.0",
25
- "@douyinfe/semi-theme-default": "2.40.0-alpha.0",
20
+ "@douyinfe/semi-animation": "2.40.0-beta.0",
21
+ "@douyinfe/semi-animation-react": "2.40.0-beta.0",
22
+ "@douyinfe/semi-foundation": "2.40.0-beta.0",
23
+ "@douyinfe/semi-icons": "2.40.0-beta.0",
24
+ "@douyinfe/semi-illustrations": "2.40.0-beta.0",
25
+ "@douyinfe/semi-theme-default": "2.40.0-beta.0",
26
26
  "async-validator": "^3.5.0",
27
27
  "classnames": "^2.2.6",
28
28
  "copy-text-to-clipboard": "^2.1.1",
@@ -69,7 +69,7 @@
69
69
  ],
70
70
  "author": "",
71
71
  "license": "MIT",
72
- "gitHead": "3c30c680ff8335f275dce40e16c8994af178ca78",
72
+ "gitHead": "f42587885c81ecb266aa0d32d2feaa7633e01e67",
73
73
  "devDependencies": {
74
74
  "@babel/plugin-proposal-decorators": "^7.15.8",
75
75
  "@babel/plugin-transform-runtime": "^7.15.8",