@douyinfe/semi-ui 2.14.0-alpha.0 → 2.14.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/autoComplete/_story/CustomTrigger/index.jsx +1 -1
  2. package/avatar/_story/avatar.stories.js +62 -5
  3. package/avatar/avatarGroup.tsx +16 -4
  4. package/avatar/index.tsx +88 -17
  5. package/backtop/index.tsx +11 -7
  6. package/badge/index.tsx +1 -1
  7. package/banner/index.tsx +5 -5
  8. package/breadcrumb/index.tsx +5 -3
  9. package/button/Button.tsx +10 -8
  10. package/calendar/_story/calendar.stories.js +125 -1
  11. package/card/index.tsx +43 -41
  12. package/carousel/CarouselArrow.tsx +2 -0
  13. package/carousel/index.tsx +1 -0
  14. package/cascader/_story/cascader.stories.js +21 -0
  15. package/cascader/index.tsx +103 -122
  16. package/cascader/item.tsx +1 -1
  17. package/checkbox/checkbox.tsx +13 -2
  18. package/collapsible/index.tsx +8 -1
  19. package/datePicker/dateInput.tsx +1 -0
  20. package/datePicker/datePicker.tsx +13 -5
  21. package/dist/css/semi.css +73 -35
  22. package/dist/css/semi.min.css +1 -1
  23. package/dist/umd/semi-ui.js +957 -545
  24. package/dist/umd/semi-ui.js.map +1 -1
  25. package/dist/umd/semi-ui.min.js +1 -1
  26. package/dist/umd/semi-ui.min.js.map +1 -1
  27. package/divider/index.tsx +8 -4
  28. package/dropdown/index.tsx +1 -1
  29. package/empty/index.tsx +13 -5
  30. package/form/_story/form.stories.tsx +9 -2
  31. package/form/field.tsx +1 -1
  32. package/form/hoc/withField.tsx +1 -1
  33. package/form/label.tsx +1 -1
  34. package/grid/col.tsx +1 -1
  35. package/grid/row.tsx +1 -1
  36. package/gulpfile.js +5 -5
  37. package/iconButton/index.tsx +2 -1
  38. package/input/_story/input.stories.js +32 -3
  39. package/input/index.tsx +45 -23
  40. package/input/inputGroup.tsx +3 -1
  41. package/input/textarea.tsx +2 -14
  42. package/lib/cjs/_base/base.css +36 -14
  43. package/lib/cjs/avatar/avatarGroup.d.ts +1 -1
  44. package/lib/cjs/avatar/avatarGroup.js +36 -9
  45. package/lib/cjs/avatar/index.d.ts +5 -0
  46. package/lib/cjs/avatar/index.js +121 -41
  47. package/lib/cjs/backtop/index.js +2 -1
  48. package/lib/cjs/badge/index.js +2 -1
  49. package/lib/cjs/banner/index.js +9 -4
  50. package/lib/cjs/breadcrumb/index.js +4 -3
  51. package/lib/cjs/button/Button.js +13 -3
  52. package/lib/cjs/card/index.js +10 -5
  53. package/lib/cjs/carousel/CarouselArrow.js +6 -2
  54. package/lib/cjs/carousel/index.js +2 -1
  55. package/lib/cjs/cascader/index.js +15 -8
  56. package/lib/cjs/cascader/item.js +2 -1
  57. package/lib/cjs/checkbox/checkbox.js +6 -2
  58. package/lib/cjs/collapsible/index.js +2 -1
  59. package/lib/cjs/datePicker/dateInput.js +2 -1
  60. package/lib/cjs/datePicker/datePicker.js +4 -2
  61. package/lib/cjs/divider/index.js +2 -1
  62. package/lib/cjs/dropdown/index.js +2 -1
  63. package/lib/cjs/empty/index.js +8 -4
  64. package/lib/cjs/form/baseForm.d.ts +1 -1
  65. package/lib/cjs/form/field.d.ts +1 -1
  66. package/lib/cjs/form/field.js +2 -2
  67. package/lib/cjs/form/hoc/withField.js +2 -1
  68. package/lib/cjs/form/label.js +2 -1
  69. package/lib/cjs/grid/col.js +2 -1
  70. package/lib/cjs/grid/row.js +2 -1
  71. package/lib/cjs/iconButton/index.js +3 -1
  72. package/lib/cjs/input/index.d.ts +0 -1
  73. package/lib/cjs/input/index.js +41 -36
  74. package/lib/cjs/input/inputGroup.js +2 -3
  75. package/lib/cjs/input/textarea.js +8 -15
  76. package/lib/cjs/list/index.js +6 -3
  77. package/lib/cjs/modal/ConfirmModal.js +2 -1
  78. package/lib/cjs/modal/Modal.js +6 -2
  79. package/lib/cjs/modal/ModalContent.js +13 -6
  80. package/lib/cjs/notification/notice.js +6 -3
  81. package/lib/cjs/pagination/index.js +4 -2
  82. package/lib/cjs/popconfirm/index.js +6 -3
  83. package/lib/cjs/radio/radio.d.ts +4 -0
  84. package/lib/cjs/radio/radio.js +32 -9
  85. package/lib/cjs/radio/radioInner.d.ts +6 -0
  86. package/lib/cjs/radio/radioInner.js +13 -4
  87. package/lib/cjs/rating/item.js +2 -1
  88. package/lib/cjs/scrollList/index.js +6 -3
  89. package/lib/cjs/select/index.js +10 -4
  90. package/lib/cjs/select/option.js +2 -1
  91. package/lib/cjs/sideSheet/SideSheetContent.js +6 -3
  92. package/lib/cjs/skeleton/index.js +3 -1
  93. package/lib/cjs/space/index.js +2 -1
  94. package/lib/cjs/spin/index.js +7 -3
  95. package/lib/cjs/switch/index.js +6 -4
  96. package/lib/cjs/table/ColumnFilter.js +2 -2
  97. package/lib/cjs/table/ColumnSelection.js +2 -2
  98. package/lib/cjs/table/Table.js +6 -3
  99. package/lib/cjs/tabs/TabBar.js +2 -1
  100. package/lib/cjs/tabs/TabPane.js +5 -2
  101. package/lib/cjs/tagInput/index.js +33 -22
  102. package/lib/cjs/timePicker/Combobox.js +3 -1
  103. package/lib/cjs/timePicker/TimePicker.js +2 -0
  104. package/lib/cjs/toast/toast.js +6 -3
  105. package/lib/cjs/tooltip/index.js +6 -1
  106. package/lib/cjs/transfer/index.js +6 -5
  107. package/lib/cjs/tree/treeNode.js +4 -3
  108. package/lib/cjs/treeSelect/index.js +10 -3
  109. package/lib/cjs/typography/base.js +2 -1
  110. package/lib/cjs/typography/title.d.ts +1 -1
  111. package/lib/cjs/upload/index.d.ts +1 -1
  112. package/lib/cjs/upload/index.js +13 -6
  113. package/lib/es/_base/base.css +36 -14
  114. package/lib/es/avatar/avatarGroup.d.ts +1 -1
  115. package/lib/es/avatar/avatarGroup.js +37 -9
  116. package/lib/es/avatar/index.d.ts +5 -0
  117. package/lib/es/avatar/index.js +119 -38
  118. package/lib/es/backtop/index.js +2 -1
  119. package/lib/es/badge/index.js +2 -1
  120. package/lib/es/banner/index.js +9 -4
  121. package/lib/es/breadcrumb/index.js +4 -3
  122. package/lib/es/button/Button.js +11 -3
  123. package/lib/es/card/index.js +10 -5
  124. package/lib/es/carousel/CarouselArrow.js +6 -2
  125. package/lib/es/carousel/index.js +2 -1
  126. package/lib/es/cascader/index.js +15 -8
  127. package/lib/es/cascader/item.js +2 -1
  128. package/lib/es/checkbox/checkbox.js +6 -2
  129. package/lib/es/collapsible/index.js +2 -1
  130. package/lib/es/datePicker/dateInput.js +2 -1
  131. package/lib/es/datePicker/datePicker.js +4 -2
  132. package/lib/es/divider/index.js +2 -1
  133. package/lib/es/dropdown/index.js +2 -1
  134. package/lib/es/empty/index.js +8 -4
  135. package/lib/es/form/baseForm.d.ts +1 -1
  136. package/lib/es/form/field.d.ts +1 -1
  137. package/lib/es/form/field.js +1 -1
  138. package/lib/es/form/hoc/withField.js +2 -1
  139. package/lib/es/form/label.js +2 -1
  140. package/lib/es/grid/col.js +2 -1
  141. package/lib/es/grid/row.js +2 -1
  142. package/lib/es/iconButton/index.js +3 -1
  143. package/lib/es/input/index.d.ts +0 -1
  144. package/lib/es/input/index.js +41 -36
  145. package/lib/es/input/inputGroup.js +2 -3
  146. package/lib/es/input/textarea.js +8 -15
  147. package/lib/es/list/index.js +6 -3
  148. package/lib/es/modal/ConfirmModal.js +2 -1
  149. package/lib/es/modal/Modal.js +6 -2
  150. package/lib/es/modal/ModalContent.js +13 -6
  151. package/lib/es/notification/notice.js +6 -3
  152. package/lib/es/pagination/index.js +4 -2
  153. package/lib/es/popconfirm/index.js +6 -3
  154. package/lib/es/radio/radio.d.ts +4 -0
  155. package/lib/es/radio/radio.js +32 -9
  156. package/lib/es/radio/radioInner.d.ts +6 -0
  157. package/lib/es/radio/radioInner.js +13 -4
  158. package/lib/es/rating/item.js +2 -1
  159. package/lib/es/scrollList/index.js +6 -3
  160. package/lib/es/select/index.js +10 -4
  161. package/lib/es/select/option.js +2 -1
  162. package/lib/es/sideSheet/SideSheetContent.js +6 -3
  163. package/lib/es/skeleton/index.js +3 -1
  164. package/lib/es/space/index.js +2 -1
  165. package/lib/es/spin/index.js +7 -3
  166. package/lib/es/switch/index.js +6 -4
  167. package/lib/es/table/ColumnFilter.js +1 -1
  168. package/lib/es/table/ColumnSelection.js +1 -1
  169. package/lib/es/table/Table.js +6 -3
  170. package/lib/es/tabs/TabBar.js +2 -1
  171. package/lib/es/tabs/TabPane.js +5 -2
  172. package/lib/es/tagInput/index.js +31 -22
  173. package/lib/es/timePicker/Combobox.js +3 -1
  174. package/lib/es/timePicker/TimePicker.js +2 -0
  175. package/lib/es/toast/toast.js +6 -3
  176. package/lib/es/tooltip/index.js +6 -1
  177. package/lib/es/transfer/index.js +3 -2
  178. package/lib/es/tree/treeNode.js +3 -2
  179. package/lib/es/treeSelect/index.js +10 -3
  180. package/lib/es/typography/base.js +2 -1
  181. package/lib/es/typography/title.d.ts +1 -1
  182. package/lib/es/upload/index.d.ts +1 -1
  183. package/lib/es/upload/index.js +13 -6
  184. package/list/index.tsx +16 -4
  185. package/modal/ConfirmModal.tsx +1 -1
  186. package/modal/Modal.tsx +2 -0
  187. package/modal/ModalContent.tsx +27 -14
  188. package/notification/notice.tsx +16 -4
  189. package/package.json +8 -8
  190. package/pagination/index.tsx +16 -2
  191. package/popconfirm/index.tsx +11 -3
  192. package/radio/_story/radio.stories.js +9 -6
  193. package/radio/radio.tsx +37 -7
  194. package/radio/radioInner.tsx +11 -2
  195. package/rating/item.tsx +1 -1
  196. package/scrollList/index.tsx +19 -3
  197. package/select/index.tsx +13 -4
  198. package/select/option.tsx +5 -1
  199. package/sideSheet/SideSheetContent.tsx +3 -3
  200. package/skeleton/index.tsx +1 -1
  201. package/space/index.tsx +1 -1
  202. package/spin/index.tsx +15 -9
  203. package/switch/index.tsx +9 -14
  204. package/table/ColumnFilter.tsx +1 -1
  205. package/table/ColumnSelection.tsx +1 -1
  206. package/table/Table.tsx +5 -3
  207. package/table/_story/v2/FixedOnHeaderRow/index.jsx +3 -0
  208. package/tabs/TabBar.tsx +1 -1
  209. package/tabs/TabPane.tsx +9 -4
  210. package/tabs/_story/tabs.stories.js +36 -0
  211. package/tag/_story/tag.stories.js +1 -1
  212. package/tagInput/index.tsx +32 -15
  213. package/timePicker/Combobox.tsx +6 -1
  214. package/timePicker/TimePicker.tsx +1 -0
  215. package/toast/toast.tsx +3 -3
  216. package/tooltip/index.tsx +4 -1
  217. package/transfer/index.tsx +2 -1
  218. package/tree/treeNode.tsx +2 -2
  219. package/treeSelect/_story/treeSelect.stories.js +161 -2
  220. package/treeSelect/index.tsx +17 -3
  221. package/typography/base.tsx +1 -1
  222. package/upload/_story/upload.stories.js +152 -0
  223. package/upload/index.tsx +107 -38
@@ -115,7 +115,8 @@ class Notice extends BaseComponent {
115
115
 
116
116
  if (iconType) {
117
117
  return /*#__PURE__*/React.createElement("div", {
118
- className: iconCls
118
+ className: iconCls,
119
+ "x-semi-prop": "icon"
119
120
  }, isSemiIcon(iconType) ? /*#__PURE__*/React.cloneElement(iconType, {
120
121
  size: iconType.props.size || 'large'
121
122
  }) : iconType);
@@ -173,9 +174,11 @@ class Notice extends BaseComponent {
173
174
  className: "".concat(prefixCls, "-content-wrapper")
174
175
  }, title ? /*#__PURE__*/React.createElement("div", {
175
176
  id: titleID,
176
- className: "".concat(prefixCls, "-title")
177
+ className: "".concat(prefixCls, "-title"),
178
+ "x-semi-prop": "title"
177
179
  }, title) : '', content ? /*#__PURE__*/React.createElement("div", {
178
- className: "".concat(prefixCls, "-content")
180
+ className: "".concat(prefixCls, "-content"),
181
+ "x-semi-prop": "content"
179
182
  }, content) : ''), showClose && /*#__PURE__*/React.createElement(Button, {
180
183
  className: "".concat(prefixCls, "-icon-close"),
181
184
  type: "tertiary",
@@ -154,7 +154,8 @@ export default class Pagination extends BaseComponent {
154
154
  "aria-disabled": prevDisabled ? true : false,
155
155
  "aria-label": "Previous",
156
156
  onClick: e => !prevDisabled && this.foundation.goPrev(e),
157
- className: preClassName
157
+ className: preClassName,
158
+ "x-semi-prop": "prevText"
158
159
  }, prevText || /*#__PURE__*/React.createElement(IconChevronLeft, {
159
160
  size: "large"
160
161
  }));
@@ -177,7 +178,8 @@ export default class Pagination extends BaseComponent {
177
178
  "aria-disabled": nextDisabled ? true : false,
178
179
  "aria-label": "Next",
179
180
  onClick: e => !nextDisabled && this.foundation.goNext(e),
180
- className: nextClassName
181
+ className: nextClassName,
182
+ "x-semi-prop": "prevText"
181
183
  }, nextText || /*#__PURE__*/React.createElement(IconChevronRight, {
182
184
  size: "large"
183
185
  }));
@@ -122,13 +122,16 @@ export default class Popconfirm extends BaseComponent {
122
122
  }, /*#__PURE__*/React.createElement("div", {
123
123
  className: "".concat(prefixCls, "-header")
124
124
  }, /*#__PURE__*/React.createElement("i", {
125
- className: "".concat(prefixCls, "-header-icon")
125
+ className: "".concat(prefixCls, "-header-icon"),
126
+ "x-semi-prop": "icon"
126
127
  }, /*#__PURE__*/React.isValidElement(icon) ? icon : null), /*#__PURE__*/React.createElement("div", {
127
128
  className: "".concat(prefixCls, "-header-body")
128
129
  }, showTitle ? /*#__PURE__*/React.createElement("div", {
129
- className: "".concat(prefixCls, "-header-title")
130
+ className: "".concat(prefixCls, "-header-title"),
131
+ "x-semi-prop": "title"
130
132
  }, title) : null, showContent ? /*#__PURE__*/React.createElement("div", {
131
- className: "".concat(prefixCls, "-header-content")
133
+ className: "".concat(prefixCls, "-header-content"),
134
+ "x-semi-prop": "content"
132
135
  }, content) : null), /*#__PURE__*/React.createElement(Button, {
133
136
  className: "".concat(prefixCls, "-btn-close"),
134
137
  icon: /*#__PURE__*/React.createElement(IconClose, null),
@@ -31,11 +31,13 @@ export declare type RadioProps = {
31
31
  'aria-label'?: React.AriaAttributes['aria-label'];
32
32
  addonId?: string;
33
33
  extraId?: string;
34
+ name?: string;
34
35
  };
35
36
  export interface RadioState {
36
37
  hover?: boolean;
37
38
  addonId?: string;
38
39
  extraId?: string;
40
+ focusVisible?: boolean;
39
41
  }
40
42
  export { RadioChangeEvent };
41
43
  declare class Radio extends BaseComponent<RadioProps, RadioState> {
@@ -84,6 +86,8 @@ declare class Radio extends BaseComponent<RadioProps, RadioState> {
84
86
  onChange: (e: RadioChangeEvent) => void;
85
87
  handleMouseEnter: (e: React.MouseEvent<HTMLLabelElement>) => void;
86
88
  handleMouseLeave: (e: React.MouseEvent<HTMLLabelElement>) => void;
89
+ handleFocusVisible: (event: React.FocusEvent) => void;
90
+ handleBlur: (event: React.FocusEvent) => void;
87
91
  render(): JSX.Element;
88
92
  }
89
93
  export default Radio;
@@ -43,6 +43,14 @@ class Radio extends BaseComponent {
43
43
  this.foundation.setHover(false);
44
44
  };
45
45
 
46
+ this.handleFocusVisible = event => {
47
+ this.foundation.handleFocusVisible(event);
48
+ };
49
+
50
+ this.handleBlur = event => {
51
+ this.foundation.handleBlur();
52
+ };
53
+
46
54
  this.state = {
47
55
  hover: false,
48
56
  addonId: props.addonId,
@@ -72,6 +80,11 @@ class Radio extends BaseComponent {
72
80
  prefix: 'extra'
73
81
  })
74
82
  });
83
+ },
84
+ setFocusVisible: focusVisible => {
85
+ this.setState({
86
+ focusVisible
87
+ });
75
88
  }
76
89
  });
77
90
  }
@@ -105,13 +118,15 @@ class Radio extends BaseComponent {
105
118
  extra,
106
119
  mode,
107
120
  type,
108
- value: propValue
121
+ value: propValue,
122
+ name
109
123
  } = this.props;
110
124
  let realChecked, isDisabled, realMode, isButtonRadioGroup, isCardRadioGroup, isPureCardRadioGroup, isButtonRadioComponent, buttonSize, realPrefixCls;
111
125
  const {
112
126
  hover: isHover,
113
127
  addonId,
114
- extraId
128
+ extraId,
129
+ focusVisible
115
130
  } = this.state;
116
131
  let props = {};
117
132
 
@@ -138,6 +153,7 @@ class Radio extends BaseComponent {
138
153
 
139
154
  const isButtonRadio = typeof isButtonRadioGroup === 'undefined' ? isButtonRadioComponent : isButtonRadioGroup;
140
155
  const prefix = realPrefixCls || css.PREFIX;
156
+ const focusOuter = isCardRadioGroup || isPureCardRadioGroup || isButtonRadio;
141
157
  const wrapper = cls(prefix, {
142
158
  ["".concat(prefix, "-disabled")]: isDisabled,
143
159
  ["".concat(prefix, "-checked")]: realChecked,
@@ -150,25 +166,29 @@ class Radio extends BaseComponent {
150
166
  ["".concat(prefix, "-cardRadioGroup_checked")]: isCardRadioGroup && realChecked && !isDisabled,
151
167
  ["".concat(prefix, "-cardRadioGroup_checked_disabled")]: isCardRadioGroup && realChecked && isDisabled,
152
168
  ["".concat(prefix, "-cardRadioGroup_hover")]: isCardRadioGroup && !realChecked && isHover && !isDisabled,
153
- [className]: Boolean(className)
169
+ [className]: Boolean(className),
170
+ ["".concat(prefix, "-focus")]: focusVisible && (isCardRadioGroup || isPureCardRadioGroup)
154
171
  });
155
- const name = this.isInGroup() && this.context.radioGroup.name;
172
+ const groupName = this.isInGroup() && this.context.radioGroup.name;
156
173
  const addonCls = cls({
157
174
  ["".concat(prefix, "-addon")]: !isButtonRadio,
158
175
  ["".concat(prefix, "-addon-buttonRadio")]: isButtonRadio,
159
176
  ["".concat(prefix, "-addon-buttonRadio-checked")]: isButtonRadio && realChecked,
160
177
  ["".concat(prefix, "-addon-buttonRadio-disabled")]: isButtonRadio && isDisabled,
161
178
  ["".concat(prefix, "-addon-buttonRadio-hover")]: isButtonRadio && !realChecked && !isDisabled && isHover,
162
- [_concatInstanceProperty(_context3 = "".concat(prefix, "-addon-buttonRadio-")).call(_context3, buttonSize)]: isButtonRadio && buttonSize
179
+ [_concatInstanceProperty(_context3 = "".concat(prefix, "-addon-buttonRadio-")).call(_context3, buttonSize)]: isButtonRadio && buttonSize,
180
+ ["".concat(prefix, "-focus")]: focusVisible && isButtonRadio
163
181
  }, addonClassName);
164
182
 
165
183
  const renderContent = () => /*#__PURE__*/React.createElement(React.Fragment, null, children ? /*#__PURE__*/React.createElement("span", {
166
184
  className: addonCls,
167
185
  style: addonStyle,
168
- id: addonId
186
+ id: addonId,
187
+ "x-semi-prop": "children"
169
188
  }, children) : null, extra && !isButtonRadio ? /*#__PURE__*/React.createElement("div", {
170
189
  className: "".concat(prefix, "-extra"),
171
- id: extraId
190
+ id: extraId,
191
+ "x-semi-prop": "extra"
172
192
  }, extra) : null);
173
193
 
174
194
  return /*#__PURE__*/React.createElement("label", {
@@ -178,7 +198,7 @@ class Radio extends BaseComponent {
178
198
  onMouseLeave: this.handleMouseLeave
179
199
  }, /*#__PURE__*/React.createElement(RadioInner, _Object$assign({}, this.props, props, {
180
200
  mode: realMode,
181
- name: name,
201
+ name: name !== null && name !== void 0 ? name : groupName,
182
202
  isButtonRadio: isButtonRadio,
183
203
  isPureCardRadioGroup: isPureCardRadioGroup,
184
204
  onChange: this.onChange,
@@ -186,7 +206,10 @@ class Radio extends BaseComponent {
186
206
  this.radioEntity = ref;
187
207
  },
188
208
  addonId: children && addonId,
189
- extraId: extra && extraId
209
+ extraId: extra && extraId,
210
+ focusInner: focusVisible && !focusOuter,
211
+ onInputFocus: this.handleFocusVisible,
212
+ onInputBlur: this.handleBlur
190
213
  })), isCardRadioGroup ? /*#__PURE__*/React.createElement("div", {
191
214
  className: "".concat(prefix, "-isCardRadioGroup_content")
192
215
  }, renderContent()) : renderContent());
@@ -17,6 +17,9 @@ export interface RadioInnerProps extends BaseProps {
17
17
  addonId?: string;
18
18
  extraId?: string;
19
19
  'aria-label'?: React.AriaAttributes['aria-label'];
20
+ focusInner?: boolean;
21
+ onInputFocus?: (e: any) => void;
22
+ onInputBlur?: (e: any) => void;
20
23
  }
21
24
  interface RadioInnerState {
22
25
  checked?: boolean;
@@ -30,6 +33,9 @@ declare class RadioInner extends BaseComponent<RadioInnerProps, RadioInnerState>
30
33
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
31
34
  mode: PropTypes.Requireable<string>;
32
35
  'aria-label': PropTypes.Requireable<string>;
36
+ focusInner: PropTypes.Requireable<boolean>;
37
+ onInputFocus: PropTypes.Requireable<(...args: any[]) => any>;
38
+ onInputBlur: PropTypes.Requireable<(...args: any[]) => any>;
33
39
  };
34
40
  static defaultProps: {
35
41
  onChange: (...args: any[]) => void;
@@ -71,7 +71,10 @@ class RadioInner extends BaseComponent {
71
71
  isPureCardRadioGroup,
72
72
  addonId,
73
73
  extraId,
74
- 'aria-label': ariaLabel
74
+ 'aria-label': ariaLabel,
75
+ focusInner,
76
+ onInputFocus,
77
+ onInputBlur
75
78
  } = this.props;
76
79
  const {
77
80
  checked
@@ -84,6 +87,8 @@ class RadioInner extends BaseComponent {
84
87
  ["".concat(prefix, "-inner-pureCardRadio")]: isPureCardRadioGroup
85
88
  });
86
89
  const inner = classnames({
90
+ ["".concat(prefix, "-focus")]: focusInner,
91
+ ["".concat(prefix, "-focus-border")]: focusInner && !checked,
87
92
  ["".concat(prefix, "-inner-display")]: !isButtonRadio
88
93
  });
89
94
  return /*#__PURE__*/React.createElement("span", {
@@ -92,7 +97,6 @@ class RadioInner extends BaseComponent {
92
97
  ref: ref => {
93
98
  this.inputEntity = ref;
94
99
  },
95
- // eslint-disable-next-line jsx-a11y/no-autofocus
96
100
  autoFocus: autoFocus,
97
101
  type: mode === 'advanced' ? 'checkbox' : 'radio',
98
102
  checked: Boolean(checked),
@@ -101,7 +105,9 @@ class RadioInner extends BaseComponent {
101
105
  name: name,
102
106
  "aria-label": ariaLabel,
103
107
  "aria-labelledby": addonId,
104
- "aria-describedby": extraId
108
+ "aria-describedby": extraId,
109
+ onFocus: onInputFocus,
110
+ onBlur: onInputBlur
105
111
  }), /*#__PURE__*/React.createElement("span", {
106
112
  className: inner
107
113
  }, checked ? /*#__PURE__*/React.createElement(IconRadio, null) : null));
@@ -116,7 +122,10 @@ RadioInner.propTypes = {
116
122
  isButtonRadio: PropTypes.bool,
117
123
  onChange: PropTypes.func,
118
124
  mode: PropTypes.oneOf(['advanced', '']),
119
- 'aria-label': PropTypes.string
125
+ 'aria-label': PropTypes.string,
126
+ focusInner: PropTypes.bool,
127
+ onInputFocus: PropTypes.func,
128
+ onInputBlur: PropTypes.func
120
129
  };
121
130
  RadioInner.defaultProps = {
122
131
  onChange: _noop,
@@ -98,7 +98,8 @@ export default class Item extends PureComponent {
98
98
  width: "".concat(firstWidth * 100, "%")
99
99
  }
100
100
  }, content), /*#__PURE__*/React.createElement("div", {
101
- className: "".concat(prefixCls, "-second")
101
+ className: "".concat(prefixCls, "-second"),
102
+ "x-semi-prop": "character"
102
103
  }, content)));
103
104
  }
104
105
 
@@ -35,16 +35,19 @@ class ScrollList extends BaseComponent {
35
35
  }, header ? /*#__PURE__*/React.createElement("div", {
36
36
  className: clsHeader
37
37
  }, /*#__PURE__*/React.createElement("div", {
38
- className: "".concat(clsHeader, "-title")
38
+ className: "".concat(clsHeader, "-title"),
39
+ "x-semi-prop": this.props['x-semi-header-alias'] || "header"
39
40
  }, header), /*#__PURE__*/React.createElement("div", {
40
41
  className: "".concat(clsWrapper, "-line")
41
42
  })) : null, /*#__PURE__*/React.createElement("div", {
42
43
  className: "".concat(clsWrapper, "-body"),
43
44
  style: {
44
45
  height: bodyHeight ? bodyHeight : ''
45
- }
46
+ },
47
+ "x-semi-prop": "children"
46
48
  }, children), footer ? /*#__PURE__*/React.createElement("div", {
47
- className: "".concat(clsWrapper, "-footer")
49
+ className: "".concat(clsWrapper, "-footer"),
50
+ "x-semi-prop": this.props['x-semi-footer-alias'] || "footer"
48
51
  }, footer) : null);
49
52
  }
50
53
 
@@ -426,6 +426,8 @@ class Select extends BaseComponent {
426
426
  e.nativeEvent.stopImmediatePropagation();
427
427
  this.foundation.handleClearClick(e);
428
428
  }
429
+ /* istanbul ignore next */
430
+
429
431
 
430
432
  onClearBtnEnterPress(e) {
431
433
  this.foundation.handleClearBtnEnterPress(e);
@@ -663,7 +665,8 @@ class Select extends BaseComponent {
663
665
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
664
666
  className: contentWrapperCls
665
667
  }, /*#__PURE__*/React.createElement("span", {
666
- className: spanCls
668
+ className: spanCls,
669
+ "x-semi-prop": "placeholder"
667
670
  }, renderText || renderText === 0 ? renderText : placeholder), filterable && showInput ? this.renderInput() : null));
668
671
  }
669
672
 
@@ -825,7 +828,8 @@ class Select extends BaseComponent {
825
828
  ["".concat(prefixcls, "-suffix-icon")]: isSemiIcon(suffix)
826
829
  });
827
830
  return /*#__PURE__*/React.createElement("div", {
828
- className: suffixWrapperCls
831
+ className: suffixWrapperCls,
832
+ "x-semi-prop": "suffix"
829
833
  }, suffix);
830
834
  }
831
835
 
@@ -844,7 +848,8 @@ class Select extends BaseComponent {
844
848
  });
845
849
  return /*#__PURE__*/React.createElement("div", {
846
850
  className: prefixWrapperCls,
847
- id: insetLabelId
851
+ id: insetLabelId,
852
+ "x-semi-prop": "prefix,insetLabel"
848
853
  }, labelNode);
849
854
  }
850
855
 
@@ -896,7 +901,8 @@ class Select extends BaseComponent {
896
901
  });
897
902
  const showClear = this.props.showClear && (selections.size || inputValue) && !disabled && (isHovering || isOpen);
898
903
  const arrowContent = showArrow ? /*#__PURE__*/React.createElement("div", {
899
- className: "".concat(prefixcls, "-arrow")
904
+ className: "".concat(prefixcls, "-arrow"),
905
+ "x-semi-prop": "arrowIcon"
900
906
  }, arrowIcon) : /*#__PURE__*/React.createElement("div", {
901
907
  className: "".concat(prefixcls, "-arrow-empty")
902
908
  });
@@ -100,7 +100,8 @@ class Option extends PureComponent {
100
100
  return /*#__PURE__*/React.createElement(LocaleConsumer, {
101
101
  componentName: "Select"
102
102
  }, locale => /*#__PURE__*/React.createElement("div", {
103
- className: optionClassName
103
+ className: optionClassName,
104
+ "x-semi-prop": "emptyContent"
104
105
  }, emptyContent || locale.emptyText));
105
106
  } // Since there are empty, locale and other logic, the custom renderOptionItem is directly converged to the internal option instead of being placed in Select/index
106
107
 
@@ -79,7 +79,8 @@ export default class SideSheetContent extends React.PureComponent {
79
79
 
80
80
  if (title) {
81
81
  header = /*#__PURE__*/React.createElement("div", {
82
- className: "".concat(prefixCls, "-title")
82
+ className: "".concat(prefixCls, "-title"),
83
+ "x-semi-prop": "title"
83
84
  }, this.props.title);
84
85
  }
85
86
 
@@ -134,9 +135,11 @@ export default class SideSheetContent extends React.PureComponent {
134
135
  className: "".concat(prefixCls, "-content")
135
136
  }, header, /*#__PURE__*/React.createElement("div", {
136
137
  className: "".concat(prefixCls, "-body"),
137
- style: props.bodyStyle
138
+ style: props.bodyStyle,
139
+ "x-semi-prop": "children"
138
140
  }, props.children), props.footer ? /*#__PURE__*/React.createElement("div", {
139
- className: "".concat(prefixCls, "-footer")
141
+ className: "".concat(prefixCls, "-footer"),
142
+ "x-semi-prop": "footer"
140
143
  }, props.footer) : null));
141
144
  return dialogElement;
142
145
  }
@@ -43,7 +43,9 @@ class Skeleton extends PureComponent {
43
43
  content = /*#__PURE__*/React.createElement("div", _Object$assign({
44
44
  className: skCls,
45
45
  style: style
46
- }, others), placeholder);
46
+ }, others, {
47
+ "x-semi-prop": "placeholder"
48
+ }), placeholder);
47
49
  } else {
48
50
  content = children;
49
51
  }
@@ -66,7 +66,8 @@ class Space extends PureComponent {
66
66
  const childrenNodes = flatten(children);
67
67
  return /*#__PURE__*/React.createElement("div", {
68
68
  className: classNames,
69
- style: realStyle
69
+ style: realStyle,
70
+ "x-semi-prop": "children"
70
71
  }, childrenNodes);
71
72
  }
72
73
 
@@ -67,8 +67,11 @@ 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
- }, indicator) : /*#__PURE__*/React.createElement(SpinIcon, null), tip ? /*#__PURE__*/React.createElement("div", null, tip) : null) : null;
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;
72
75
  }
73
76
 
74
77
  render() {
@@ -95,7 +98,8 @@ class Spin extends BaseComponent {
95
98
  style: style
96
99
  }, this.renderSpin(), /*#__PURE__*/React.createElement("div", {
97
100
  className: "".concat(prefixCls, "-children"),
98
- style: childStyle
101
+ style: childStyle,
102
+ "x-semi-prop": "children"
99
103
  }, children));
100
104
  }
101
105
 
@@ -119,19 +119,21 @@ 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
122
+ className: cssClasses.CHECKED_TEXT,
123
+ "x-semi-prop": "checkedText"
123
124
  }, checkedText) : null, showUncheckedText ? /*#__PURE__*/React.createElement("div", {
124
- className: cssClasses.UNCHECKED_TEXT
125
+ className: cssClasses.UNCHECKED_TEXT,
126
+ "x-semi-prop": "uncheckedText"
125
127
  }, uncheckedText) : null, /*#__PURE__*/React.createElement("input", _Object$assign({}, switchProps, {
126
128
  ref: this.switchRef,
127
129
  id: id,
128
- role: 'switch',
130
+ role: "switch",
129
131
  "aria-checked": nativeControlChecked,
130
132
  "aria-invalid": this.props['aria-invalid'],
131
133
  "aria-errormessage": this.props['aria-errormessage'],
132
134
  "aria-label": this.props['aria-label'],
133
135
  "aria-labelledby": this.props['aria-labelledby'],
134
- "aria-describedby": this.props["aria-describedby"],
136
+ "aria-describedby": this.props['aria-describedby'],
135
137
  "aria-disabled": this.props['disabled'],
136
138
  onChange: e => this.foundation.handleChange(e.target.checked, e),
137
139
  onFocus: e => this.handleFocusVisible(e),
@@ -16,7 +16,7 @@ import { IconFilter } from '@douyinfe/semi-icons';
16
16
  import { cssClasses } from '@douyinfe/semi-foundation/lib/es/table/constants';
17
17
  import Dropdown from '../dropdown';
18
18
  import { Radio } from '../radio';
19
- import Checkbox from '../checkbox';
19
+ import { Checkbox } from '../checkbox';
20
20
 
21
21
  function renderDropdown() {
22
22
  let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -8,7 +8,7 @@ import classnames from 'classnames';
8
8
  import PropTypes from 'prop-types';
9
9
  import { cssClasses } from '@douyinfe/semi-foundation/lib/es/table/constants';
10
10
  import TableSelectionCellFoundation from '@douyinfe/semi-foundation/lib/es/table/tableSelectionCellFoundation';
11
- import Checkbox from '../checkbox';
11
+ import { Checkbox } from '../checkbox';
12
12
  /**
13
13
  * render selection cell
14
14
  */
@@ -582,7 +582,8 @@ 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")
585
+ className: "".concat(prefixCls, "-title"),
586
+ "x-semi-prop": "title"
586
587
  }, title) : null;
587
588
  };
588
589
 
@@ -607,7 +608,8 @@ class Table extends BaseComponent {
607
608
  }, (locale, localeCode) => /*#__PURE__*/React.createElement("div", {
608
609
  className: wrapCls
609
610
  }, /*#__PURE__*/React.createElement("div", {
610
- className: "".concat(prefixCls, "-empty")
611
+ className: "".concat(prefixCls, "-empty"),
612
+ "x-semi-prop": "empty"
611
613
  }, empty || locale.emptyText)));
612
614
  };
613
615
 
@@ -627,7 +629,8 @@ class Table extends BaseComponent {
627
629
 
628
630
  return /*#__PURE__*/isValidElement(footer) || typeof footer === 'string' ? /*#__PURE__*/React.createElement("div", {
629
631
  className: "".concat(prefixCls, "-footer"),
630
- key: "footer"
632
+ key: "footer",
633
+ "x-semi-prop": "footer"
631
634
  }, footer) : null;
632
635
  };
633
636
 
@@ -246,7 +246,8 @@ class TabBar extends React.Component {
246
246
 
247
247
  return /*#__PURE__*/React.createElement("div", {
248
248
  className: extraCls,
249
- style: tabBarStyle
249
+ style: tabBarStyle,
250
+ "x-semi-prop": "tabBarExtraContent"
250
251
  }, tabBarExtraContent);
251
252
  }
252
253
 
@@ -116,14 +116,17 @@ class TabPane extends PureComponent {
116
116
  style: style,
117
117
  "aria-hidden": active ? 'false' : 'true',
118
118
  tabIndex: 0
119
- }, getDataAttr(restProps)), motion ? /*#__PURE__*/React.createElement(TabPaneTransition, {
119
+ }, getDataAttr(restProps), {
120
+ "x-semi-prop": "children"
121
+ }), motion ? /*#__PURE__*/React.createElement(TabPaneTransition, {
120
122
  direction: this.getDirection(this.context.activeKey, itemKey, this.context.panes),
121
123
  motion: motion,
122
124
  mode: tabPosition === 'top' ? 'horizontal' : 'vertical',
123
125
  state: active ? 'enter' : 'leave'
124
126
  }, transitionStyle => /*#__PURE__*/React.createElement("div", {
125
127
  className: "".concat(cssClasses.TABS_PANE_MOTION_OVERLAY),
126
- style: _Object$assign({}, transitionStyle)
128
+ style: _Object$assign({}, transitionStyle),
129
+ "x-semi-prop": "children"
127
130
  }, shouldRender ? children : null)) : shouldRender ? children : null);
128
131
  }
129
132
 
@@ -45,6 +45,8 @@ class TagInput extends BaseComponent {
45
45
  this.handleClearBtn = e => {
46
46
  this.foundation.handleClearBtn(e);
47
47
  };
48
+ /* istanbul ignore next */
49
+
48
50
 
49
51
  this.handleClearEnterPress = e => {
50
52
  this.foundation.handleClearEnterPress(e);
@@ -219,14 +221,18 @@ class TagInput extends BaseComponent {
219
221
  ["".concat(prefixCls, "-prefix-text")]: labelNode && _isString(labelNode),
220
222
  // eslint-disable-next-line max-len
221
223
  ["".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
-
224
- return /*#__PURE__*/React.createElement("div", {
225
- className: prefixWrapperCls,
226
- onMouseDown: this.handlePreventMouseDown,
227
- onClick: this.handleClickPrefixOrSuffix,
228
- id: insetLabelId
229
- }, labelNode);
224
+ });
225
+ return (
226
+ /*#__PURE__*/
227
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions,jsx-a11y/click-events-have-key-events
228
+ React.createElement("div", {
229
+ className: prefixWrapperCls,
230
+ onMouseDown: this.handlePreventMouseDown,
231
+ onClick: this.handleClickPrefixOrSuffix,
232
+ id: insetLabelId,
233
+ "x-semi-prop": "prefix"
234
+ }, labelNode)
235
+ );
230
236
  }
231
237
 
232
238
  renderSuffix() {
@@ -242,13 +248,17 @@ class TagInput extends BaseComponent {
242
248
  ["".concat(prefixCls, "-suffix-text")]: suffix && _isString(suffix),
243
249
  // eslint-disable-next-line max-len
244
250
  ["".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
-
247
- return /*#__PURE__*/React.createElement("div", {
248
- className: suffixWrapperCls,
249
- onMouseDown: this.handlePreventMouseDown,
250
- onClick: this.handleClickPrefixOrSuffix
251
- }, suffix);
251
+ });
252
+ return (
253
+ /*#__PURE__*/
254
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
255
+ React.createElement("div", {
256
+ className: suffixWrapperCls,
257
+ onMouseDown: this.handlePreventMouseDown,
258
+ onClick: this.handleClickPrefixOrSuffix,
259
+ "x-semi-prop": "suffix"
260
+ }, suffix)
261
+ );
252
262
  }
253
263
 
254
264
  renderTags() {
@@ -272,7 +282,7 @@ class TagInput extends BaseComponent {
272
282
  const typoCls = cls("".concat(prefixCls, "-wrapper-typo"), {
273
283
  ["".concat(prefixCls, "-wrapper-typo-disabled")]: disabled
274
284
  });
275
- const spanNotWithPopoverCls = cls("".concat(prefixCls, "-wrapper-n"), {
285
+ const restTagsCls = cls("".concat(prefixCls, "-wrapper-n"), {
276
286
  ["".concat(prefixCls, "-wrapper-n-disabled")]: disabled
277
287
  });
278
288
  const restTags = [];
@@ -314,17 +324,16 @@ class TagInput extends BaseComponent {
314
324
  }
315
325
  });
316
326
 
317
- return /*#__PURE__*/React.createElement(React.Fragment, null, tags, restTags.length > 0 && (showRestTagsPopover && !disabled ? /*#__PURE__*/React.createElement(Popover, _Object$assign({
327
+ const restTagsContent = /*#__PURE__*/React.createElement("span", {
328
+ className: restTagsCls
329
+ }, "+", tagsArray.length - maxTagCount);
330
+ return /*#__PURE__*/React.createElement(React.Fragment, null, tags, restTags.length > 0 && (showRestTagsPopover ? /*#__PURE__*/React.createElement(Popover, _Object$assign({
318
331
  content: restTags,
319
332
  showArrow: true,
320
333
  trigger: "hover",
321
334
  position: "top",
322
335
  autoAdjustOverflow: true
323
- }, restTagsPopoverProps), /*#__PURE__*/React.createElement("span", {
324
- className: cls("".concat(prefixCls, "-wrapper-n"))
325
- }, "+", tagsArray.length - maxTagCount)) : /*#__PURE__*/React.createElement("span", {
326
- className: spanNotWithPopoverCls
327
- }, "+".concat(tagsArray.length - maxTagCount))));
336
+ }, restTagsPopoverProps), restTagsContent) : restTagsContent));
328
337
  }
329
338
 
330
339
  blur() {
@@ -278,7 +278,9 @@ class Combobox extends BaseComponent {
278
278
  componentName: "TimePicker"
279
279
  }, (locale, localeCode) => /*#__PURE__*/React.createElement(ScrollList, {
280
280
  header: panelHeader,
281
- footer: panelFooter
281
+ footer: panelFooter,
282
+ "x-semi-header-alias": "panelHeader",
283
+ "x-semi-footer-alias": "panelFooter"
282
284
  }, this.renderAMPMSelect(locale, localeCode), this.renderHourSelect(value.getHours(), locale), this.renderMinuteSelect(value.getMinutes(), locale), this.renderSecondSelect(value.getSeconds(), locale)));
283
285
  }
284
286