@douyinfe/semi-ui 2.12.1-alpha.2 → 2.13.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 (224) hide show
  1. package/autoComplete/_story/autoComplete.stories.js +0 -1
  2. package/autoComplete/index.tsx +1 -1
  3. package/avatar/index.tsx +2 -2
  4. package/backtop/index.tsx +7 -11
  5. package/badge/index.tsx +1 -1
  6. package/banner/index.tsx +5 -5
  7. package/breadcrumb/index.tsx +3 -5
  8. package/button/Button.tsx +8 -10
  9. package/card/index.tsx +41 -43
  10. package/carousel/CarouselArrow.tsx +0 -2
  11. package/carousel/index.tsx +0 -1
  12. package/cascader/index.tsx +123 -101
  13. package/cascader/item.tsx +1 -1
  14. package/checkbox/checkbox.tsx +28 -20
  15. package/checkbox/checkboxInner.tsx +11 -1
  16. package/collapsible/index.tsx +1 -8
  17. package/datePicker/dateInput.tsx +0 -1
  18. package/datePicker/datePicker.tsx +5 -13
  19. package/dist/css/semi.css +9 -1
  20. package/dist/css/semi.min.css +1 -1
  21. package/dist/umd/semi-ui.js +5372 -3695
  22. package/dist/umd/semi-ui.js.map +1 -1
  23. package/dist/umd/semi-ui.min.js +1 -1
  24. package/dist/umd/semi-ui.min.js.map +1 -1
  25. package/divider/index.tsx +4 -8
  26. package/dropdown/index.tsx +1 -1
  27. package/empty/index.tsx +5 -13
  28. package/form/hoc/withField.tsx +1 -1
  29. package/form/label.tsx +1 -1
  30. package/grid/col.tsx +1 -1
  31. package/grid/row.tsx +1 -1
  32. package/iconButton/index.tsx +1 -2
  33. package/input/index.tsx +11 -38
  34. package/inputNumber/__test__/inputNumber.test.js +2 -3
  35. package/inputNumber/_story/inputNumber.stories.js +53 -0
  36. package/inputNumber/index.tsx +0 -4
  37. package/lib/cjs/autoComplete/index.js +1 -1
  38. package/lib/cjs/avatar/index.js +2 -4
  39. package/lib/cjs/backtop/index.js +1 -2
  40. package/lib/cjs/badge/index.js +1 -2
  41. package/lib/cjs/banner/index.js +4 -9
  42. package/lib/cjs/breadcrumb/index.js +3 -4
  43. package/lib/cjs/button/Button.d.ts +1 -1
  44. package/lib/cjs/button/Button.js +3 -13
  45. package/lib/cjs/button/index.d.ts +1 -1
  46. package/lib/cjs/card/index.js +5 -10
  47. package/lib/cjs/carousel/CarouselArrow.js +2 -6
  48. package/lib/cjs/carousel/CarouselIndicator.d.ts +1 -1
  49. package/lib/cjs/carousel/index.d.ts +1 -1
  50. package/lib/cjs/carousel/index.js +1 -2
  51. package/lib/cjs/cascader/index.js +6 -9
  52. package/lib/cjs/cascader/item.js +1 -2
  53. package/lib/cjs/checkbox/checkbox.d.ts +3 -2
  54. package/lib/cjs/checkbox/checkbox.js +33 -15
  55. package/lib/cjs/checkbox/checkboxInner.d.ts +6 -0
  56. package/lib/cjs/checkbox/checkboxInner.js +14 -4
  57. package/lib/cjs/collapsible/index.js +1 -2
  58. package/lib/cjs/datePicker/dateInput.d.ts +1 -1
  59. package/lib/cjs/datePicker/dateInput.js +1 -2
  60. package/lib/cjs/datePicker/datePicker.d.ts +1 -1
  61. package/lib/cjs/datePicker/datePicker.js +2 -4
  62. package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
  63. package/lib/cjs/divider/index.js +1 -2
  64. package/lib/cjs/dropdown/index.js +1 -2
  65. package/lib/cjs/empty/index.js +4 -8
  66. package/lib/cjs/form/baseForm.d.ts +1 -1
  67. package/lib/cjs/form/field.d.ts +1 -1
  68. package/lib/cjs/form/hoc/withField.js +1 -2
  69. package/lib/cjs/form/label.js +1 -2
  70. package/lib/cjs/grid/col.js +1 -2
  71. package/lib/cjs/grid/row.js +1 -2
  72. package/lib/cjs/iconButton/index.js +1 -3
  73. package/lib/cjs/input/index.js +5 -9
  74. package/lib/cjs/inputNumber/index.js +0 -4
  75. package/lib/cjs/list/index.js +3 -6
  76. package/lib/cjs/modal/ConfirmModal.js +1 -2
  77. package/lib/cjs/modal/Modal.js +2 -6
  78. package/lib/cjs/modal/ModalContent.js +6 -13
  79. package/lib/cjs/notification/notice.js +3 -6
  80. package/lib/cjs/pagination/index.js +2 -4
  81. package/lib/cjs/popconfirm/index.js +3 -6
  82. package/lib/cjs/popover/index.d.ts +1 -0
  83. package/lib/cjs/radio/radio.d.ts +1 -1
  84. package/lib/cjs/radio/radio.js +2 -4
  85. package/lib/cjs/radio/radioGroup.d.ts +1 -1
  86. package/lib/cjs/rating/item.js +1 -2
  87. package/lib/cjs/scrollList/index.js +3 -6
  88. package/lib/cjs/select/index.js +4 -8
  89. package/lib/cjs/select/option.js +1 -2
  90. package/lib/cjs/sideSheet/SideSheetContent.js +3 -6
  91. package/lib/cjs/skeleton/index.js +1 -3
  92. package/lib/cjs/space/index.js +1 -2
  93. package/lib/cjs/spin/index.js +3 -7
  94. package/lib/cjs/switch/index.js +4 -6
  95. package/lib/cjs/table/Table.js +3 -6
  96. package/lib/cjs/tabs/TabBar.js +1 -2
  97. package/lib/cjs/tabs/TabPane.js +2 -5
  98. package/lib/cjs/tagInput/index.d.ts +6 -1
  99. package/lib/cjs/tagInput/index.js +42 -10
  100. package/lib/cjs/timePicker/Combobox.js +1 -3
  101. package/lib/cjs/timePicker/TimePicker.d.ts +2 -2
  102. package/lib/cjs/timePicker/TimeShape.d.ts +1 -1
  103. package/lib/cjs/timePicker/index.d.ts +2 -2
  104. package/lib/cjs/toast/toast.js +3 -6
  105. package/lib/cjs/transfer/index.js +1 -2
  106. package/lib/cjs/tree/treeNode.js +1 -2
  107. package/lib/cjs/treeSelect/index.js +3 -6
  108. package/lib/cjs/typography/base.d.ts +1 -1
  109. package/lib/cjs/typography/base.js +1 -2
  110. package/lib/cjs/typography/paragraph.d.ts +1 -1
  111. package/lib/cjs/typography/text.d.ts +1 -1
  112. package/lib/cjs/typography/title.d.ts +2 -2
  113. package/lib/cjs/upload/index.d.ts +2 -2
  114. package/lib/cjs/upload/index.js +6 -13
  115. package/lib/es/autoComplete/index.js +1 -1
  116. package/lib/es/avatar/index.js +2 -4
  117. package/lib/es/backtop/index.js +1 -2
  118. package/lib/es/badge/index.js +1 -2
  119. package/lib/es/banner/index.js +4 -9
  120. package/lib/es/breadcrumb/index.js +3 -4
  121. package/lib/es/button/Button.d.ts +1 -1
  122. package/lib/es/button/Button.js +3 -11
  123. package/lib/es/button/index.d.ts +1 -1
  124. package/lib/es/card/index.js +5 -10
  125. package/lib/es/carousel/CarouselArrow.js +2 -6
  126. package/lib/es/carousel/CarouselIndicator.d.ts +1 -1
  127. package/lib/es/carousel/index.d.ts +1 -1
  128. package/lib/es/carousel/index.js +1 -2
  129. package/lib/es/cascader/index.js +6 -9
  130. package/lib/es/cascader/item.js +1 -2
  131. package/lib/es/checkbox/checkbox.d.ts +3 -2
  132. package/lib/es/checkbox/checkbox.js +33 -15
  133. package/lib/es/checkbox/checkboxInner.d.ts +6 -0
  134. package/lib/es/checkbox/checkboxInner.js +14 -4
  135. package/lib/es/collapsible/index.js +1 -2
  136. package/lib/es/datePicker/dateInput.d.ts +1 -1
  137. package/lib/es/datePicker/dateInput.js +1 -2
  138. package/lib/es/datePicker/datePicker.d.ts +1 -1
  139. package/lib/es/datePicker/datePicker.js +2 -4
  140. package/lib/es/datePicker/monthsGrid.d.ts +1 -1
  141. package/lib/es/divider/index.js +1 -2
  142. package/lib/es/dropdown/index.js +1 -2
  143. package/lib/es/empty/index.js +4 -8
  144. package/lib/es/form/baseForm.d.ts +1 -1
  145. package/lib/es/form/field.d.ts +1 -1
  146. package/lib/es/form/hoc/withField.js +1 -2
  147. package/lib/es/form/label.js +1 -2
  148. package/lib/es/grid/col.js +1 -2
  149. package/lib/es/grid/row.js +1 -2
  150. package/lib/es/iconButton/index.js +1 -3
  151. package/lib/es/input/index.js +5 -9
  152. package/lib/es/inputNumber/index.js +0 -4
  153. package/lib/es/list/index.js +3 -6
  154. package/lib/es/modal/ConfirmModal.js +1 -2
  155. package/lib/es/modal/Modal.js +2 -6
  156. package/lib/es/modal/ModalContent.js +6 -13
  157. package/lib/es/notification/notice.js +3 -6
  158. package/lib/es/pagination/index.js +2 -4
  159. package/lib/es/popconfirm/index.js +3 -6
  160. package/lib/es/popover/index.d.ts +1 -0
  161. package/lib/es/radio/radio.d.ts +1 -1
  162. package/lib/es/radio/radio.js +2 -4
  163. package/lib/es/radio/radioGroup.d.ts +1 -1
  164. package/lib/es/rating/item.js +1 -2
  165. package/lib/es/scrollList/index.js +3 -6
  166. package/lib/es/select/index.js +4 -8
  167. package/lib/es/select/option.js +1 -2
  168. package/lib/es/sideSheet/SideSheetContent.js +3 -6
  169. package/lib/es/skeleton/index.js +1 -3
  170. package/lib/es/space/index.js +1 -2
  171. package/lib/es/spin/index.js +3 -7
  172. package/lib/es/switch/index.js +4 -6
  173. package/lib/es/table/Table.js +3 -6
  174. package/lib/es/tabs/TabBar.js +1 -2
  175. package/lib/es/tabs/TabPane.js +2 -5
  176. package/lib/es/tagInput/index.d.ts +6 -1
  177. package/lib/es/tagInput/index.js +41 -10
  178. package/lib/es/timePicker/Combobox.js +1 -3
  179. package/lib/es/timePicker/TimePicker.d.ts +2 -2
  180. package/lib/es/timePicker/TimeShape.d.ts +1 -1
  181. package/lib/es/timePicker/index.d.ts +2 -2
  182. package/lib/es/toast/toast.js +3 -6
  183. package/lib/es/transfer/index.js +1 -2
  184. package/lib/es/tree/treeNode.js +1 -2
  185. package/lib/es/treeSelect/index.js +3 -6
  186. package/lib/es/typography/base.d.ts +1 -1
  187. package/lib/es/typography/base.js +1 -2
  188. package/lib/es/typography/paragraph.d.ts +1 -1
  189. package/lib/es/typography/text.d.ts +1 -1
  190. package/lib/es/typography/title.d.ts +2 -2
  191. package/lib/es/upload/index.d.ts +2 -2
  192. package/lib/es/upload/index.js +6 -13
  193. package/list/index.tsx +4 -16
  194. package/modal/ConfirmModal.tsx +1 -1
  195. package/modal/Modal.tsx +0 -2
  196. package/modal/ModalContent.tsx +14 -27
  197. package/notification/notice.tsx +4 -16
  198. package/package.json +9 -9
  199. package/pagination/index.tsx +2 -16
  200. package/popconfirm/index.tsx +3 -11
  201. package/popover/index.tsx +1 -1
  202. package/radio/radio.tsx +2 -10
  203. package/rating/item.tsx +1 -1
  204. package/scrollList/index.tsx +3 -19
  205. package/select/_story/select.stories.js +11 -0
  206. package/select/index.tsx +4 -12
  207. package/select/option.tsx +1 -5
  208. package/sideSheet/SideSheetContent.tsx +3 -3
  209. package/skeleton/index.tsx +1 -1
  210. package/space/index.tsx +1 -1
  211. package/spin/index.tsx +9 -15
  212. package/switch/index.tsx +14 -9
  213. package/table/Table.tsx +3 -5
  214. package/tabs/TabBar.tsx +1 -1
  215. package/tabs/TabPane.tsx +4 -9
  216. package/tagInput/index.tsx +38 -11
  217. package/timePicker/Combobox.tsx +1 -6
  218. package/toast/toast.tsx +3 -3
  219. package/transfer/index.tsx +0 -1
  220. package/tree/treeNode.tsx +1 -1
  221. package/treeSelect/index.tsx +3 -15
  222. package/typography/base.tsx +1 -1
  223. package/upload/index.tsx +38 -107
  224. package/yarn-error.log +0 -26235
@@ -67,11 +67,8 @@ class Spin extends BaseComponent {
67
67
  return loading ? /*#__PURE__*/React.createElement("div", {
68
68
  className: "".concat(prefixCls, "-wrapper")
69
69
  }, indicator ? /*#__PURE__*/React.createElement("div", {
70
- className: spinIconCls,
71
- "x-semi-prop": "indicator"
72
- }, indicator) : /*#__PURE__*/React.createElement(SpinIcon, null), tip ? /*#__PURE__*/React.createElement("div", {
73
- "x-semi-prop": "tip"
74
- }, tip) : null) : null;
70
+ className: spinIconCls
71
+ }, indicator) : /*#__PURE__*/React.createElement(SpinIcon, null), tip ? /*#__PURE__*/React.createElement("div", null, tip) : null) : null;
75
72
  }
76
73
 
77
74
  render() {
@@ -98,8 +95,7 @@ class Spin extends BaseComponent {
98
95
  style: style
99
96
  }, this.renderSpin(), /*#__PURE__*/React.createElement("div", {
100
97
  className: "".concat(prefixCls, "-children"),
101
- style: childStyle,
102
- "x-semi-prop": "children"
98
+ style: childStyle
103
99
  }, children));
104
100
  }
105
101
 
@@ -119,21 +119,19 @@ class Switch extends BaseComponent {
119
119
  className: cssClasses.KNOB,
120
120
  "aria-hidden": true
121
121
  }), showCheckedText ? /*#__PURE__*/React.createElement("div", {
122
- className: cssClasses.CHECKED_TEXT,
123
- "x-semi-prop": "checkedText"
122
+ className: cssClasses.CHECKED_TEXT
124
123
  }, checkedText) : null, showUncheckedText ? /*#__PURE__*/React.createElement("div", {
125
- className: cssClasses.UNCHECKED_TEXT,
126
- "x-semi-prop": "uncheckedText"
124
+ className: cssClasses.UNCHECKED_TEXT
127
125
  }, uncheckedText) : null, /*#__PURE__*/React.createElement("input", _Object$assign({}, switchProps, {
128
126
  ref: this.switchRef,
129
127
  id: id,
130
- role: "switch",
128
+ role: 'switch',
131
129
  "aria-checked": nativeControlChecked,
132
130
  "aria-invalid": this.props['aria-invalid'],
133
131
  "aria-errormessage": this.props['aria-errormessage'],
134
132
  "aria-label": this.props['aria-label'],
135
133
  "aria-labelledby": this.props['aria-labelledby'],
136
- "aria-describedby": this.props['aria-describedby'],
134
+ "aria-describedby": this.props["aria-describedby"],
137
135
  "aria-disabled": this.props['disabled'],
138
136
  onChange: e => this.foundation.handleChange(e.target.checked, e),
139
137
  onFocus: e => this.handleFocusVisible(e),
@@ -582,8 +582,7 @@ class Table extends BaseComponent {
582
582
  }
583
583
 
584
584
  return /*#__PURE__*/isValidElement(title) || typeof title === 'string' ? /*#__PURE__*/React.createElement("div", {
585
- className: "".concat(prefixCls, "-title"),
586
- "x-semi-prop": "title"
585
+ className: "".concat(prefixCls, "-title")
587
586
  }, title) : null;
588
587
  };
589
588
 
@@ -608,8 +607,7 @@ class Table extends BaseComponent {
608
607
  }, (locale, localeCode) => /*#__PURE__*/React.createElement("div", {
609
608
  className: wrapCls
610
609
  }, /*#__PURE__*/React.createElement("div", {
611
- className: "".concat(prefixCls, "-empty"),
612
- "x-semi-prop": "empty"
610
+ className: "".concat(prefixCls, "-empty")
613
611
  }, empty || locale.emptyText)));
614
612
  };
615
613
 
@@ -629,8 +627,7 @@ class Table extends BaseComponent {
629
627
 
630
628
  return /*#__PURE__*/isValidElement(footer) || typeof footer === 'string' ? /*#__PURE__*/React.createElement("div", {
631
629
  className: "".concat(prefixCls, "-footer"),
632
- key: "footer",
633
- "x-semi-prop": "footer"
630
+ key: "footer"
634
631
  }, footer) : null;
635
632
  };
636
633
 
@@ -246,8 +246,7 @@ class TabBar extends React.Component {
246
246
 
247
247
  return /*#__PURE__*/React.createElement("div", {
248
248
  className: extraCls,
249
- style: tabBarStyle,
250
- "x-semi-prop": "tabBarExtraContent"
249
+ style: tabBarStyle
251
250
  }, tabBarExtraContent);
252
251
  }
253
252
 
@@ -116,17 +116,14 @@ class TabPane extends PureComponent {
116
116
  style: style,
117
117
  "aria-hidden": active ? 'false' : 'true',
118
118
  tabIndex: 0
119
- }, getDataAttr(restProps), {
120
- "x-semi-prop": "children"
121
- }), motion ? /*#__PURE__*/React.createElement(TabPaneTransition, {
119
+ }, getDataAttr(restProps)), motion ? /*#__PURE__*/React.createElement(TabPaneTransition, {
122
120
  direction: this.getDirection(this.context.activeKey, itemKey, this.context.panes),
123
121
  motion: motion,
124
122
  mode: tabPosition === 'top' ? 'horizontal' : 'vertical',
125
123
  state: active ? 'enter' : 'leave'
126
124
  }, transitionStyle => /*#__PURE__*/React.createElement("div", {
127
125
  className: "".concat(cssClasses.TABS_PANE_MOTION_OVERLAY),
128
- style: _Object$assign({}, transitionStyle),
129
- "x-semi-prop": "children"
126
+ style: _Object$assign({}, transitionStyle)
130
127
  }, shouldRender ? children : null)) : shouldRender ? children : null);
131
128
  }
132
129
 
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { strings } from '@douyinfe/semi-foundation/lib/es/tagInput/constants';
4
4
  import '@douyinfe/semi-foundation/lib/es/tagInput/tagInput.css';
5
- import { TagInputAdapter } from '@douyinfe/semi-foundation/lib/es/tagInput/foundation';
5
+ import TagInputFoundation, { TagInputAdapter } from '@douyinfe/semi-foundation/lib/es/tagInput/foundation';
6
6
  import { ArrayElement } from '../_base/base';
7
7
  import BaseComponent from '../_base/baseComponent';
8
8
  import { PopoverProps } from '../popover';
@@ -32,6 +32,8 @@ export interface TagInputProps {
32
32
  onKeyDown?: (e: React.MouseEvent<HTMLInputElement>) => void;
33
33
  onRemove?: (removedValue: string, idx: number) => void;
34
34
  placeholder?: string;
35
+ insetLabel?: React.ReactNode;
36
+ insetLabelId?: string;
35
37
  prefix?: React.ReactNode;
36
38
  renderTagItem?: (value: string, index: number) => React.ReactNode;
37
39
  separator?: string | string[] | null;
@@ -108,6 +110,7 @@ declare class TagInput extends BaseComponent<TagInputProps, TagInputState> {
108
110
  onKeyDown: (...args: any[]) => void;
109
111
  };
110
112
  inputRef: React.RefObject<HTMLInputElement>;
113
+ foundation: TagInputFoundation;
111
114
  constructor(props: TagInputProps);
112
115
  static getDerivedStateFromProps(nextProps: TagInputProps, prevState: TagInputState): {
113
116
  tagsArray: string[];
@@ -124,6 +127,8 @@ declare class TagInput extends BaseComponent<TagInputProps, TagInputState> {
124
127
  handleTagClose: (idx: number) => void;
125
128
  handleInputMouseLeave: (e: React.MouseEvent<HTMLDivElement>) => void;
126
129
  handleInputMouseEnter: (e: React.MouseEvent<HTMLDivElement>) => void;
130
+ handleClickPrefixOrSuffix: (e: React.MouseEvent<HTMLInputElement>) => void;
131
+ handlePreventMouseDown: (e: React.MouseEvent<HTMLInputElement>) => void;
127
132
  renderClearBtn(): JSX.Element;
128
133
  renderPrefix(): JSX.Element;
129
134
  renderSuffix(): JSX.Element;
@@ -13,6 +13,7 @@ import PropTypes from 'prop-types';
13
13
  import { cssClasses, strings } from '@douyinfe/semi-foundation/lib/es/tagInput/constants';
14
14
  import '@douyinfe/semi-foundation/lib/es/tagInput/tagInput.css';
15
15
  import TagInputFoundation from '@douyinfe/semi-foundation/lib/es/tagInput/foundation';
16
+ import { isSemiIcon } from '../_utils';
16
17
  import BaseComponent from '../_base/baseComponent';
17
18
  import Tag from '../tag';
18
19
  import Input from '../input';
@@ -61,6 +62,14 @@ class TagInput extends BaseComponent {
61
62
  this.foundation.handleInputMouseEnter();
62
63
  };
63
64
 
65
+ this.handleClickPrefixOrSuffix = e => {
66
+ this.foundation.handleClickPrefixOrSuffix(e);
67
+ };
68
+
69
+ this.handlePreventMouseDown = e => {
70
+ this.foundation.handlePreventMouseDown(e);
71
+ };
72
+
64
73
  this.foundation = new TagInputFoundation(this.adapter);
65
74
  this.state = {
66
75
  tagsArray: props.defaultValue || [],
@@ -112,6 +121,19 @@ class TagInput extends BaseComponent {
112
121
  focusing
113
122
  });
114
123
  },
124
+ toggleFocusing: isFocus => {
125
+ const input = this.inputRef && this.inputRef.current;
126
+
127
+ if (isFocus) {
128
+ input && input.focus();
129
+ } else {
130
+ input && input.blur();
131
+ }
132
+
133
+ this.setState({
134
+ focusing: isFocus
135
+ });
136
+ },
115
137
  setHovering: hovering => {
116
138
  this.setState({
117
139
  hovering
@@ -182,22 +204,29 @@ class TagInput extends BaseComponent {
182
204
 
183
205
  renderPrefix() {
184
206
  const {
185
- prefix
207
+ prefix,
208
+ insetLabel,
209
+ insetLabelId
186
210
  } = this.props;
211
+ const labelNode = prefix || insetLabel;
187
212
 
188
- if (_isNull(prefix) || _isUndefined(prefix)) {
213
+ if (_isNull(labelNode) || _isUndefined(labelNode)) {
189
214
  return null;
190
215
  }
191
216
 
192
217
  const prefixWrapperCls = cls("".concat(prefixCls, "-prefix"), {
193
- ["".concat(prefixCls, "-prefix-text")]: prefix && _isString(prefix),
218
+ ["".concat(prefixCls, "-inset-label")]: insetLabel,
219
+ ["".concat(prefixCls, "-prefix-text")]: labelNode && _isString(labelNode),
194
220
  // eslint-disable-next-line max-len
195
- ["".concat(prefixCls, "-prefix-icon")]: /*#__PURE__*/React.isValidElement(prefix) && !(prefix && _isString(prefix))
196
- });
221
+ ["".concat(prefixCls, "-prefix-icon")]: isSemiIcon(labelNode)
222
+ }); // eslint-disable-next-line jsx-a11y/no-static-element-interactions,jsx-a11y/click-events-have-key-events
223
+
197
224
  return /*#__PURE__*/React.createElement("div", {
198
225
  className: prefixWrapperCls,
199
- "x-semi-prop": "prefix"
200
- }, prefix);
226
+ onMouseDown: this.handlePreventMouseDown,
227
+ onClick: this.handleClickPrefixOrSuffix,
228
+ id: insetLabelId
229
+ }, labelNode);
201
230
  }
202
231
 
203
232
  renderSuffix() {
@@ -212,11 +241,13 @@ class TagInput extends BaseComponent {
212
241
  const suffixWrapperCls = cls("".concat(prefixCls, "-suffix"), {
213
242
  ["".concat(prefixCls, "-suffix-text")]: suffix && _isString(suffix),
214
243
  // eslint-disable-next-line max-len
215
- ["".concat(prefixCls, "-suffix-icon")]: /*#__PURE__*/React.isValidElement(suffix) && !(suffix && _isString(suffix))
216
- });
244
+ ["".concat(prefixCls, "-suffix-icon")]: isSemiIcon(suffix)
245
+ }); // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
246
+
217
247
  return /*#__PURE__*/React.createElement("div", {
218
248
  className: suffixWrapperCls,
219
- "x-semi-prop": "suffix"
249
+ onMouseDown: this.handlePreventMouseDown,
250
+ onClick: this.handleClickPrefixOrSuffix
220
251
  }, suffix);
221
252
  }
222
253
 
@@ -278,9 +278,7 @@ class Combobox extends BaseComponent {
278
278
  componentName: "TimePicker"
279
279
  }, (locale, localeCode) => /*#__PURE__*/React.createElement(ScrollList, {
280
280
  header: panelHeader,
281
- footer: panelFooter,
282
- "x-semi-header-alias": "panelHeader",
283
- "x-semi-footer-alias": "panelFooter"
281
+ footer: panelFooter
284
282
  }, this.renderAMPMSelect(locale, localeCode), this.renderHourSelect(value.getHours(), locale), this.renderMinuteSelect(value.getMinutes(), locale), this.renderSecondSelect(value.getSeconds(), locale)));
285
283
  }
286
284
 
@@ -97,11 +97,11 @@ export default class TimePicker extends BaseComponent<TimePickerProps, TimePicke
97
97
  'aria-required': PropTypes.Requireable<boolean>;
98
98
  prefixCls: PropTypes.Requireable<string>;
99
99
  clearText: PropTypes.Requireable<string>;
100
- value: PropTypes.Requireable<string | number | string[] | Date | number[] | Date[]>;
100
+ value: PropTypes.Requireable<string | number | string[] | number[] | Date | Date[]>;
101
101
  inputReadOnly: PropTypes.Requireable<boolean>;
102
102
  disabled: PropTypes.Requireable<boolean>;
103
103
  showClear: PropTypes.Requireable<boolean>;
104
- defaultValue: PropTypes.Requireable<string | number | string[] | Date | number[] | Date[]>;
104
+ defaultValue: PropTypes.Requireable<string | number | string[] | number[] | Date | Date[]>;
105
105
  open: PropTypes.Requireable<boolean>;
106
106
  defaultOpen: PropTypes.Requireable<boolean>;
107
107
  onOpenChange: PropTypes.Requireable<(...args: any[]) => any>;
@@ -6,5 +6,5 @@ import PropTypes from 'prop-types';
6
6
  * - \[12:00:12, 12:21:12]
7
7
  * - \[[12:00:12, 12:21:12], [12:11:12, 12:32:12]]
8
8
  */
9
- declare const TimeShape: PropTypes.Requireable<string | number | string[] | Date | number[] | Date[]>;
9
+ declare const TimeShape: PropTypes.Requireable<string | number | string[] | number[] | Date | Date[]>;
10
10
  export { TimeShape };
@@ -18,11 +18,11 @@ export default class LocaleTimePicker extends React.PureComponent<LocalePickerPr
18
18
  'aria-required': import("prop-types").Requireable<boolean>;
19
19
  prefixCls: import("prop-types").Requireable<string>;
20
20
  clearText: import("prop-types").Requireable<string>;
21
- value: import("prop-types").Requireable<string | number | string[] | Date | number[] | Date[]>;
21
+ value: import("prop-types").Requireable<string | number | string[] | number[] | Date | Date[]>;
22
22
  inputReadOnly: import("prop-types").Requireable<boolean>;
23
23
  disabled: import("prop-types").Requireable<boolean>;
24
24
  showClear: import("prop-types").Requireable<boolean>;
25
- defaultValue: import("prop-types").Requireable<string | number | string[] | Date | number[] | Date[]>;
25
+ defaultValue: import("prop-types").Requireable<string | number | string[] | number[] | Date | Date[]>;
26
26
  open: import("prop-types").Requireable<boolean>;
27
27
  defaultOpen: import("prop-types").Requireable<boolean>;
28
28
  onOpenChange: import("prop-types").Requireable<(...args: any[]) => any>;
@@ -111,7 +111,7 @@ class Toast extends BaseComponent {
111
111
  const btnTheme = 'borderless';
112
112
  const btnSize = 'small';
113
113
  return /*#__PURE__*/React.createElement("div", {
114
- role: "alert",
114
+ role: 'alert',
115
115
  "aria-label": "".concat(type ? type : 'default', " type"),
116
116
  className: toastCls,
117
117
  style: style,
@@ -121,16 +121,13 @@ class Toast extends BaseComponent {
121
121
  className: "".concat(prefixCls, "-content")
122
122
  }, this.renderIcon(), /*#__PURE__*/React.createElement("span", {
123
123
  className: "".concat(prefixCls, "-content-text"),
124
- style: textStyle,
125
- "x-semi-prop": "content"
124
+ style: textStyle
126
125
  }, content), showClose && /*#__PURE__*/React.createElement("div", {
127
126
  className: "".concat(prefixCls, "-close-button")
128
127
  }, /*#__PURE__*/React.createElement(Button, {
129
128
  onClick: e => this.close(e),
130
129
  type: "tertiary",
131
- icon: /*#__PURE__*/React.createElement(IconClose, {
132
- "x-semi-prop": "icon"
133
- }),
130
+ icon: /*#__PURE__*/React.createElement(IconClose, null),
134
131
  theme: btnTheme,
135
132
  size: btnSize
136
133
  }))));
@@ -237,8 +237,7 @@ class Transfer extends BaseComponent {
237
237
  className: leftItemCls,
238
238
  checked: checked,
239
239
  role: "listitem",
240
- onChange: () => this.onSelectOrRemove(item),
241
- "x-semi-children-alias": "dataSource[".concat(index, "].label")
240
+ onChange: () => this.onSelectOrRemove(item)
242
241
  }, item.label);
243
242
  }
244
243
 
@@ -373,8 +373,7 @@ export default class TreeNode extends PureComponent {
373
373
  return /*#__PURE__*/React.createElement("ul", {
374
374
  className: wrapperCls
375
375
  }, /*#__PURE__*/React.createElement("li", {
376
- className: _concatInstanceProperty(_context2 = "".concat(prefixcls, "-label ")).call(_context2, prefixcls, "-label-empty"),
377
- "x-semi-prop": "emptyContent"
376
+ className: _concatInstanceProperty(_context2 = "".concat(prefixcls, "-label ")).call(_context2, prefixcls, "-label-empty")
378
377
  }, emptyContent));
379
378
  } // eslint-disable-next-line max-lines-per-function
380
379
 
@@ -59,8 +59,7 @@ class TreeSelect extends BaseComponent {
59
59
  ["".concat(prefixcls, "-suffix-icon")]: isSemiIcon(suffix)
60
60
  });
61
61
  return /*#__PURE__*/React.createElement("div", {
62
- className: suffixWrapperCls,
63
- "x-semi-prop": "suffix"
62
+ className: suffixWrapperCls
64
63
  }, suffix);
65
64
  };
66
65
 
@@ -80,8 +79,7 @@ class TreeSelect extends BaseComponent {
80
79
  });
81
80
  return /*#__PURE__*/React.createElement("div", {
82
81
  className: prefixWrapperCls,
83
- id: insetLabelId,
84
- "x-semi-prop": "prefix,insetLabel"
82
+ id: insetLabelId
85
83
  }, labelNode);
86
84
  };
87
85
 
@@ -338,8 +336,7 @@ class TreeSelect extends BaseComponent {
338
336
  }
339
337
 
340
338
  return arrowIcon ? /*#__PURE__*/React.createElement("div", {
341
- className: cls("".concat(prefixcls, "-arrow")),
342
- "x-semi-prop": "arrowIcon"
339
+ className: cls("".concat(prefixcls, "-arrow"))
343
340
  }, arrowIcon) : null;
344
341
  };
345
342
 
@@ -64,7 +64,7 @@ export default class Base extends Component<BaseTypographyProps, BaseTypographyS
64
64
  spacing: PropTypes.Requireable<"normal" | "extended">;
65
65
  strong: PropTypes.Requireable<boolean>;
66
66
  size: PropTypes.Requireable<"small" | "normal">;
67
- type: PropTypes.Requireable<"warning" | "success" | "primary" | "secondary" | "tertiary" | "danger" | "quaternary">;
67
+ type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
68
68
  style: PropTypes.Requireable<object>;
69
69
  className: PropTypes.Requireable<string>;
70
70
  icon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
@@ -536,8 +536,7 @@ export default class Base extends Component {
536
536
 
537
537
  const iconSize = size === 'small' ? 'small' : 'default';
538
538
  return /*#__PURE__*/React.createElement("span", {
539
- className: "".concat(prefixCls, "-icon"),
540
- "x-semi-prop": "icon"
539
+ className: "".concat(prefixCls, "-icon")
541
540
  }, isSemiIcon(icon) ? /*#__PURE__*/React.cloneElement(icon, {
542
541
  size: iconSize
543
542
  }) : icon);
@@ -29,7 +29,7 @@ export default class Paragraph extends PureComponent<ParagraphProps> {
29
29
  link: PropTypes.Requireable<boolean | object>;
30
30
  underline: PropTypes.Requireable<boolean>;
31
31
  strong: PropTypes.Requireable<boolean>;
32
- type: PropTypes.Requireable<"warning" | "success" | "primary" | "secondary" | "tertiary" | "danger" | "quaternary">;
32
+ type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
33
33
  size: PropTypes.Requireable<"small" | "normal">;
34
34
  spacing: PropTypes.Requireable<"normal" | "extended">;
35
35
  style: PropTypes.Requireable<object>;
@@ -32,7 +32,7 @@ export default class Text extends PureComponent<TextProps> {
32
32
  underline: PropTypes.Requireable<boolean>;
33
33
  link: PropTypes.Requireable<boolean | object>;
34
34
  strong: PropTypes.Requireable<boolean>;
35
- type: PropTypes.Requireable<"warning" | "success" | "primary" | "secondary" | "tertiary" | "danger" | "quaternary">;
35
+ type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
36
36
  size: PropTypes.Requireable<"small" | "normal">;
37
37
  style: PropTypes.Requireable<object>;
38
38
  className: PropTypes.Requireable<string>;
@@ -36,8 +36,8 @@ export default class Title extends PureComponent<TitleProps> {
36
36
  link: PropTypes.Requireable<boolean | object>;
37
37
  underline: PropTypes.Requireable<boolean>;
38
38
  strong: PropTypes.Requireable<boolean>;
39
- type: PropTypes.Requireable<"warning" | "success" | "primary" | "secondary" | "tertiary" | "danger" | "quaternary">;
40
- heading: PropTypes.Requireable<4 | 2 | 1 | 3 | 6 | 5>;
39
+ type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
40
+ heading: PropTypes.Requireable<1 | 2 | 3 | 4 | 5 | 6>;
41
41
  style: PropTypes.Requireable<object>;
42
42
  className: PropTypes.Requireable<string>;
43
43
  component: PropTypes.Requireable<string>;
@@ -6,7 +6,7 @@ import BaseComponent, { ValidateStatus } from '../_base/baseComponent';
6
6
  import { FileItem, RenderFileItemProps, UploadListType, PromptPositionType, BeforeUploadProps, AfterUploadProps, OnChangeProps, customRequestArgs, CustomError } from './interface';
7
7
  import { Locale } from '../locale/interface';
8
8
  import '@douyinfe/semi-foundation/lib/es/upload/upload.css';
9
- export { FileItem, RenderFileItemProps, UploadListType, PromptPositionType, BeforeUploadProps, AfterUploadProps, OnChangeProps, customRequestArgs, CustomError, BeforeUploadObjectResult, AfterUploadResult, };
9
+ export { FileItem, RenderFileItemProps, UploadListType, PromptPositionType, BeforeUploadProps, AfterUploadProps, OnChangeProps, customRequestArgs, CustomError, BeforeUploadObjectResult, AfterUploadResult };
10
10
  export interface UploadProps {
11
11
  accept?: string;
12
12
  action: string;
@@ -140,7 +140,7 @@ declare class Upload extends BaseComponent<UploadProps, UploadState> {
140
140
  style: PropTypes.Requireable<object>;
141
141
  timeout: PropTypes.Requireable<number>;
142
142
  transformFile: PropTypes.Requireable<(...args: any[]) => any>;
143
- uploadTrigger: PropTypes.Requireable<"custom" | "auto">;
143
+ uploadTrigger: PropTypes.Requireable<"auto" | "custom">;
144
144
  validateMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
145
145
  validateStatus: PropTypes.Requireable<"default" | "error" | "warning" | "success">;
146
146
  withCredentials: PropTypes.Requireable<boolean>;
@@ -230,9 +230,7 @@ class Upload extends BaseComponent {
230
230
  });
231
231
  }
232
232
 
233
- const addContent = /*#__PURE__*/React.createElement("div", _Object$assign({}, addContentProps, {
234
- "x-semi-prop": "children"
235
- }), children);
233
+ const addContent = /*#__PURE__*/React.createElement("div", _Object$assign({}, addContentProps), children);
236
234
 
237
235
  if (!showUploadList || !fileList.length) {
238
236
  if (showAddTriggerInList) {
@@ -365,18 +363,15 @@ class Upload extends BaseComponent {
365
363
  onDragEnter: this.onDragEnter,
366
364
  onClick: this.onClick
367
365
  }, children ? children : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
368
- className: "".concat(dragAreaBaseCls, "-icon"),
369
- "x-semi-prop": "dragIcon"
366
+ className: "".concat(dragAreaBaseCls, "-icon")
370
367
  }, dragIcon || /*#__PURE__*/React.createElement(IconUpload, {
371
368
  size: "extra-large"
372
369
  })), /*#__PURE__*/React.createElement("div", {
373
370
  className: "".concat(dragAreaBaseCls, "-text")
374
371
  }, /*#__PURE__*/React.createElement("div", {
375
- className: "".concat(dragAreaBaseCls, "-main-text"),
376
- "x-semi-prop": "dragMainText"
372
+ className: "".concat(dragAreaBaseCls, "-main-text")
377
373
  }, dragMainText || locale.mainText), /*#__PURE__*/React.createElement("div", {
378
- className: "".concat(dragAreaBaseCls, "-sub-text"),
379
- "x-semi-prop": "dragSubText"
374
+ className: "".concat(dragAreaBaseCls, "-sub-text")
380
375
  }, dragSubText), /*#__PURE__*/React.createElement("div", {
381
376
  className: "".concat(dragAreaBaseCls, "-tips")
382
377
  }, dragAreaStatus === strings.DRAG_AREA_LEGAL && /*#__PURE__*/React.createElement("span", {
@@ -562,11 +557,9 @@ class Upload extends BaseComponent {
562
557
  className: inputReplaceCls,
563
558
  ref: this.replaceInputRef
564
559
  }), this.renderAddContent(), prompt ? /*#__PURE__*/React.createElement("div", {
565
- className: promptCls,
566
- "x-semi-prop": "prompt"
560
+ className: promptCls
567
561
  }, prompt) : null, validateMessage ? /*#__PURE__*/React.createElement("div", {
568
- className: validateMsgCls,
569
- "x-semi-prop": "validateMessage"
562
+ className: validateMsgCls
570
563
  }, validateMessage) : null, this.renderFileList());
571
564
  }
572
565
 
package/list/index.tsx CHANGED
@@ -71,11 +71,7 @@ class List<T = any> extends BaseComponent<ListProps<T>> {
71
71
  renderEmpty = () => {
72
72
  const { emptyContent } = this.props;
73
73
  if (emptyContent) {
74
- return (
75
- <div className={`${cssClasses.PREFIX}-empty`} x-semi-prop="emptyContent">
76
- {emptyContent}
77
- </div>
78
- );
74
+ return (<div className={`${cssClasses.PREFIX}-empty`}>{emptyContent}</div>);
79
75
  } else {
80
76
  return (
81
77
  <LocaleConsumer componentName="List">
@@ -156,27 +152,19 @@ class List<T = any> extends BaseComponent<ListProps<T>> {
156
152
  }
157
153
  return (
158
154
  <div className={wrapperCls} style={style}>
159
- {header ? (
160
- <div className={`${cssClasses.PREFIX}-header`} x-semi-prop="header">
161
- {header}
162
- </div>
163
- ) : null}
155
+ {header ? <div className={`${cssClasses.PREFIX}-header`}>{header}</div> : null}
164
156
  <ListContext.Provider
165
157
  value={{
166
158
  grid,
167
159
  onRightClick,
168
- onClick,
160
+ onClick
169
161
  }}
170
162
  >
171
163
  <Spin spinning={loading} size="large">
172
164
  {this.wrapChildren(childrenList, children)}
173
165
  </Spin>
174
166
  </ListContext.Provider>
175
- {footer ? (
176
- <div className={`${cssClasses.PREFIX}-footer`} x-semi-prop="footer">
177
- {footer}
178
- </div>
179
- ) : null}
167
+ {footer ? <div className={`${cssClasses.PREFIX}-footer`}>{footer}</div> : null}
180
168
  {loadMore ? loadMore : null}
181
169
  </div>
182
170
  );
@@ -81,7 +81,7 @@ const ConfirmModal = (props: ConfirmProps) => {
81
81
  visible={visible}
82
82
  {...rest}
83
83
  >
84
- <div className={contentCls} x-semi-prop="content">{content}</div>
84
+ <div className={contentCls}>{content}</div>
85
85
  </Modal>
86
86
  );
87
87
  };
package/modal/Modal.tsx CHANGED
@@ -292,7 +292,6 @@ class Modal extends BaseComponent<ModalReactProps, ModalState> {
292
292
  type="tertiary"
293
293
  autoFocus={true}
294
294
  {...this.props.cancelButtonProps}
295
- x-semi-children-alias="cancelText"
296
295
  >
297
296
  {cancelText || locale.cancel}
298
297
  </Button>
@@ -312,7 +311,6 @@ class Modal extends BaseComponent<ModalReactProps, ModalState> {
312
311
  loading={confirmLoading}
313
312
  onClick={this.handleOk}
314
313
  {...this.props.okButtonProps}
315
- x-semi-children-alias="okText"
316
314
  >
317
315
  {okText || locale.confirm}
318
316
  </Button>