@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
@@ -285,7 +285,8 @@ class Cascader extends BaseComponent {
285
285
  ["".concat(prefixcls, "-suffix-icon")]: isSemiIcon(suffix)
286
286
  });
287
287
  return /*#__PURE__*/React.createElement("div", {
288
- className: suffixWrapperCls
288
+ className: suffixWrapperCls,
289
+ "x-semi-prop": "suffix"
289
290
  }, suffix);
290
291
  };
291
292
 
@@ -305,7 +306,8 @@ class Cascader extends BaseComponent {
305
306
  });
306
307
  return /*#__PURE__*/React.createElement("div", {
307
308
  className: prefixWrapperCls,
308
- id: insetLabelId
309
+ id: insetLabelId,
310
+ "x-semi-prop": "prefix,insetLabel"
309
311
  }, labelNode);
310
312
  };
311
313
 
@@ -363,6 +365,8 @@ class Cascader extends BaseComponent {
363
365
  * A11y: simulate clear button click
364
366
  */
365
367
 
368
+ /* istanbul ignore next */
369
+
366
370
 
367
371
  this.handleClearEnterPress = e => {
368
372
  e && e.stopPropagation();
@@ -395,7 +399,7 @@ class Cascader extends BaseComponent {
395
399
  className: clearCls,
396
400
  onClick: this.handleClear,
397
401
  onKeyPress: this.handleClearEnterPress,
398
- role: 'button',
402
+ role: "button",
399
403
  tabIndex: 0
400
404
  }, /*#__PURE__*/React.createElement(IconClear, null));
401
405
  }
@@ -414,7 +418,8 @@ class Cascader extends BaseComponent {
414
418
  }
415
419
 
416
420
  return arrowIcon ? /*#__PURE__*/React.createElement("div", {
417
- className: cls("".concat(prefixcls, "-arrow"))
421
+ className: cls("".concat(prefixcls, "-arrow")),
422
+ "x-semi-prop": "arrowIcon"
418
423
  }, arrowIcon) : null;
419
424
  };
420
425
 
@@ -489,12 +494,12 @@ class Cascader extends BaseComponent {
489
494
  "aria-errormessage": this.props['aria-errormessage'],
490
495
  "aria-label": this.props['aria-label'],
491
496
  "aria-labelledby": this.props['aria-labelledby'],
492
- "aria-describedby": this.props["aria-describedby"],
497
+ "aria-describedby": this.props['aria-describedby'],
493
498
  "aria-required": this.props['aria-required'],
494
499
  id: id
495
500
  }, mouseEvent, {
496
501
  // eslint-disable-next-line jsx-a11y/role-has-required-aria-props
497
- role: 'combobox',
502
+ role: "combobox",
498
503
  tabIndex: 0
499
504
  }), inner);
500
505
  };
@@ -741,14 +746,16 @@ class Cascader extends BaseComponent {
741
746
  if (_Array$isArray(realValue)) {
742
747
  normallizedValue = _Array$isArray(realValue[0]) ? realValue : [realValue];
743
748
  } else {
744
- normallizedValue = [[realValue]];
749
+ if (realValue !== undefined) {
750
+ normallizedValue = [[realValue]];
751
+ }
745
752
  } // formatValuePath is used to save value of valuePath
746
753
 
747
754
 
748
755
  const formatValuePath = [];
749
756
 
750
757
  _forEachInstanceProperty(normallizedValue).call(normallizedValue, valueItem => {
751
- const formatItem = onChangeWithObject ? _mapInstanceProperty(valueItem).call(valueItem, i => i.value) : valueItem;
758
+ const formatItem = onChangeWithObject ? _mapInstanceProperty(valueItem).call(valueItem, i => i === null || i === void 0 ? void 0 : i.value) : valueItem;
752
759
  formatValuePath.push(formatItem);
753
760
  }); // formatKeys is used to save key of value
754
761
 
@@ -296,7 +296,8 @@ export default class Item extends PureComponent {
296
296
  className: _concatInstanceProperty(_context6 = "".concat(prefixcls, " ")).call(_context6, prefixcls, "-empty"),
297
297
  key: 'empty-list'
298
298
  }, /*#__PURE__*/React.createElement("span", {
299
- className: "".concat(prefixcls, "-label")
299
+ className: "".concat(prefixcls, "-label"),
300
+ "x-semi-prop": "emptyContent"
300
301
  }, emptyContent || locale.emptyText));
301
302
  });
302
303
  }
@@ -177,13 +177,17 @@ class Checkbox extends BaseComponent {
177
177
  const extraCls = classnames("".concat(prefix, "-extra"), {
178
178
  ["".concat(prefix, "-cardType_extra_noChildren")]: props.isCardType && !children
179
179
  });
180
+ const name = inGroup && this.context.checkboxGroup.name;
181
+ const xSemiPropChildren = this.props['x-semi-children-alias'] || 'children';
180
182
 
181
183
  const renderContent = () => /*#__PURE__*/React.createElement(React.Fragment, null, children ? /*#__PURE__*/React.createElement("span", {
182
184
  id: addonId,
183
- className: "".concat(prefix, "-addon")
185
+ className: "".concat(prefix, "-addon"),
186
+ "x-semi-prop": xSemiPropChildren
184
187
  }, children) : null, extra ? /*#__PURE__*/React.createElement("div", {
185
188
  id: extraId,
186
- className: extraCls
189
+ className: extraCls,
190
+ "x-semi-prop": "extra"
187
191
  }, extra) : null);
188
192
 
189
193
  return (
@@ -89,7 +89,8 @@ const Collapsible = props => {
89
89
  style: {
90
90
  overflow: 'hidden'
91
91
  },
92
- id: id
92
+ id: id,
93
+ "x-semi-prop": "children"
93
94
  }, children));
94
95
  };
95
96
 
@@ -153,7 +153,8 @@ export default class DateInput extends BaseComponent {
153
153
  const labelNode = prefix || insetLabel;
154
154
  return labelNode ? /*#__PURE__*/React.createElement("div", {
155
155
  className: "".concat(prefixCls, "-range-input-prefix"),
156
- onClick: e => !disabled && !rangeInputFocus && this.handleRangeStartFocus(e)
156
+ onClick: e => !disabled && !rangeInputFocus && this.handleRangeStartFocus(e),
157
+ "x-semi-prop": "prefix,insetLabel"
157
158
  }, labelNode) : null;
158
159
  }
159
160
 
@@ -182,11 +182,13 @@ export default class DatePicker extends BaseComponent {
182
182
  className: wrapCls,
183
183
  style: dropdownStyle
184
184
  }, topSlot && /*#__PURE__*/React.createElement("div", {
185
- className: "".concat(cssClasses.PREFIX, "-topSlot")
185
+ className: "".concat(cssClasses.PREFIX, "-topSlot"),
186
+ "x-semi-prop": "topSlot"
186
187
  }, topSlot), insetInput && /*#__PURE__*/React.createElement(DateInput, _Object$assign({}, insetInputProps, {
187
188
  insetInput: true
188
189
  })), this.adapter.typeIsYearOrMonth() ? this.renderYearMonthPanel(locale, localeCode) : this.renderMonthGrid(locale, localeCode, dateFnsLocale), this.renderQuickControls(), bottomSlot && /*#__PURE__*/React.createElement("div", {
189
- className: "".concat(cssClasses.PREFIX, "-bottomSlot")
190
+ className: "".concat(cssClasses.PREFIX, "-bottomSlot"),
191
+ "x-semi-prop": "bottomSlot"
190
192
  }, bottomSlot), this.renderFooter(locale, localeCode));
191
193
  };
192
194
 
@@ -61,7 +61,8 @@ const Divider = props => {
61
61
  className: dividerClassNames,
62
62
  style: _Object$assign(_Object$assign({}, overrideDefaultStyle), style)
63
63
  }), children && layout === 'horizontal' ? typeof children === 'string' ? /*#__PURE__*/React.createElement("span", {
64
- className: "".concat(prefixCls, "-divider_inner-text")
64
+ className: "".concat(prefixCls, "-divider_inner-text"),
65
+ "x-semi-prop": "children"
65
66
  }, children) : children : null);
66
67
  };
67
68
 
@@ -86,7 +86,8 @@ class Dropdown extends BaseComponent {
86
86
  className: className,
87
87
  style: style
88
88
  }, /*#__PURE__*/React.createElement("div", {
89
- className: "".concat(prefixCls, "-content")
89
+ className: "".concat(prefixCls, "-content"),
90
+ "x-semi-prop": "render"
90
91
  }, content)));
91
92
  }
92
93
 
@@ -101,15 +101,19 @@ export default class Empty extends BaseComponent {
101
101
  style: style
102
102
  }, /*#__PURE__*/React.createElement("div", {
103
103
  className: "".concat(prefixCls, "-image"),
104
- style: imageStyle
104
+ style: imageStyle,
105
+ "x-semi-prop": "image,darkModeImage"
105
106
  }, imageNode), /*#__PURE__*/React.createElement("div", {
106
107
  className: "".concat(prefixCls, "-content")
107
108
  }, title ? /*#__PURE__*/React.createElement(Typography.Title, _Object$assign({}, titleProps, {
108
- className: "".concat(prefixCls, "-title")
109
+ className: "".concat(prefixCls, "-title"),
110
+ "x-semi-prop": "title"
109
111
  }), title) : null, description ? /*#__PURE__*/React.createElement("div", {
110
- className: "".concat(prefixCls, "-description")
112
+ className: "".concat(prefixCls, "-description"),
113
+ "x-semi-prop": "description"
111
114
  }, description) : null, children ? /*#__PURE__*/React.createElement("div", {
112
- className: "".concat(prefixCls, "-footer")
115
+ className: "".concat(prefixCls, "-footer"),
116
+ "x-semi-prop": "children"
113
117
  }, children) : null));
114
118
  }
115
119
 
@@ -125,7 +125,7 @@ declare class Form extends BaseComponent<BaseFormProps, BaseFormState> {
125
125
  onBlur?: (e: React.FocusEvent<Element, Element>) => void;
126
126
  onListScroll?: (e: React.UIEvent<HTMLDivElement, UIEvent>) => void;
127
127
  children?: React.ReactNode;
128
- } & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
128
+ } & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
129
129
  static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
130
130
  static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
131
131
  static Radio: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../radio").RadioProps & import("./interface").RCIncludeType>;
@@ -73,7 +73,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
73
73
  onBlur?: (e: import("react").FocusEvent<Element, Element>) => void;
74
74
  onListScroll?: (e: import("react").UIEvent<HTMLDivElement, UIEvent>) => void;
75
75
  children?: import("react").ReactNode;
76
- } & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
76
+ } & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
77
77
  declare const FormCheckboxGroup: import("react").ComponentType<import("utility-types").Subtract<import("../checkbox/checkboxGroup").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
78
78
  declare const FormCheckbox: import("react").ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox/checkbox").CheckboxProps & import("./interface").RCIncludeType>;
79
79
  declare const FormRadioGroup: import("react").ComponentType<import("utility-types").Subtract<import("../radio/radioGroup").RadioGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
@@ -5,7 +5,7 @@ import Input from '../input/index';
5
5
  import TextArea from '../input/textarea';
6
6
  import InputNumber from '../inputNumber/index';
7
7
  import Select from '../select/index';
8
- import Checkbox from '../checkbox/index';
8
+ import { Checkbox } from '../checkbox/index';
9
9
  import CheckboxGroup from '../checkbox/checkboxGroup';
10
10
  import { Radio } from '../radio/index';
11
11
  import RadioGroup from '../radio/radioGroup';
@@ -426,7 +426,8 @@ function withField(Component, opts) {
426
426
  });
427
427
  const extraContent = extraText ? /*#__PURE__*/React.createElement("div", {
428
428
  className: extraCls,
429
- id: extraTextId
429
+ id: extraTextId,
430
+ "x-semi-prop": "extraText"
430
431
  }, extraText) : null;
431
432
 
432
433
  let newProps = _Object$assign(_Object$assign({
@@ -29,7 +29,8 @@ export default class Label extends PureComponent {
29
29
  const labelStyle = style ? style : {};
30
30
  width ? labelStyle.width = width : null;
31
31
  const textContent = /*#__PURE__*/React.createElement("div", {
32
- className: "".concat(prefixCls, "-field-label-text")
32
+ className: "".concat(prefixCls, "-field-label-text"),
33
+ "x-semi-prop": "label"
33
34
  }, typeof text !== 'undefined' ? text : children);
34
35
  const contentWithExtra = /*#__PURE__*/React.createElement(React.Fragment, null, textContent, /*#__PURE__*/React.createElement("div", {
35
36
  className: "".concat(prefixCls, "-field-label-extra")
@@ -97,7 +97,8 @@ class Col extends React.Component {
97
97
  } : {}), style);
98
98
  return /*#__PURE__*/React.createElement("div", _Object$assign({}, others, {
99
99
  style: style,
100
- className: classes
100
+ className: classes,
101
+ "x-semi-prop": "children"
101
102
  }), children);
102
103
  }
103
104
 
@@ -157,7 +157,8 @@ class Row extends React.Component {
157
157
  }
158
158
  }, /*#__PURE__*/React.createElement("div", _Object$assign({}, otherProps, {
159
159
  className: classes,
160
- style: rowStyle
160
+ style: rowStyle,
161
+ "x-semi-prop": "children"
161
162
  }), children));
162
163
  }
163
164
 
@@ -71,8 +71,10 @@ class IconButton extends PureComponent {
71
71
  ["".concat(prefixCls, "-content-left")]: iconPosition === 'right',
72
72
  ["".concat(prefixCls, "-content-right")]: iconPosition === 'left'
73
73
  });
74
+ const xSemiProp = this.props['x-semi-children-alias'] || 'children';
74
75
  const children = originChildren != null ? /*#__PURE__*/React.createElement("span", {
75
- className: btnTextCls
76
+ className: btnTextCls,
77
+ "x-semi-prop": xSemiProp
76
78
  }, originChildren) : null;
77
79
 
78
80
  if (iconPosition === 'left') {
@@ -161,7 +161,6 @@ declare class Input extends BaseComponent<InputProps, InputState> {
161
161
  static getDerivedStateFromProps(props: InputProps, state: InputState): Partial<InputState>;
162
162
  componentDidUpdate(prevProps: InputProps): void;
163
163
  handleClear: (e: React.MouseEvent<HTMLInputElement>) => void;
164
- handleClearEnterPress: (e: React.KeyboardEvent<HTMLDivElement>) => void;
165
164
  handleClick: (e: React.MouseEvent<HTMLDivElement>) => void;
166
165
  handleMouseOver: (e: React.MouseEvent<HTMLDivElement>) => void;
167
166
  handleMouseLeave: (e: React.MouseEvent<HTMLDivElement>) => void;
@@ -41,10 +41,6 @@ class Input extends BaseComponent {
41
41
  this.foundation.handleClear(e);
42
42
  };
43
43
 
44
- this.handleClearEnterPress = e => {
45
- this.foundation.handleClearEnterPress(e);
46
- };
47
-
48
44
  this.handleClick = e => {
49
45
  this.foundation.handleClick(e);
50
46
  };
@@ -183,7 +179,8 @@ class Input extends BaseComponent {
183
179
  ["".concat(prefixCls, "-prepend-icon")]: isSemiIcon(addonBefore)
184
180
  });
185
181
  return /*#__PURE__*/React.createElement("div", {
186
- className: prefixWrapperCls
182
+ className: prefixWrapperCls,
183
+ "x-semi-prop": "addonBefore"
187
184
  }, addonBefore);
188
185
  }
189
186
 
@@ -202,7 +199,8 @@ class Input extends BaseComponent {
202
199
  ["".concat(prefixCls, "-append-icon")]: isSemiIcon(addonAfter)
203
200
  });
204
201
  return /*#__PURE__*/React.createElement("div", {
205
- className: prefixWrapperCls
202
+ className: prefixWrapperCls,
203
+ "x-semi-prop": "addonAfter"
206
204
  }, addonAfter);
207
205
  }
208
206
 
@@ -214,14 +212,14 @@ class Input extends BaseComponent {
214
212
  const allowClear = this.foundation.isAllowClear(); // use onMouseDown to fix issue 1203
215
213
 
216
214
  if (allowClear) {
217
- return /*#__PURE__*/React.createElement("div", {
218
- role: "button",
219
- tabIndex: 0,
220
- "aria-label": "Clear input value",
221
- className: clearCls,
222
- onMouseDown: this.handleClear,
223
- onKeyPress: this.handleClearEnterPress
224
- }, /*#__PURE__*/React.createElement(IconClear, null));
215
+ return (
216
+ /*#__PURE__*/
217
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
218
+ React.createElement("div", {
219
+ className: clearCls,
220
+ onMouseDown: this.handleClear
221
+ }, /*#__PURE__*/React.createElement(IconClear, null))
222
+ );
225
223
  }
226
224
 
227
225
  return null;
@@ -229,9 +227,6 @@ class Input extends BaseComponent {
229
227
 
230
228
  renderModeBtn() {
231
229
  const {
232
- value,
233
- isFocus,
234
- isHovering,
235
230
  eyeClosed
236
231
  } = this.state;
237
232
  const {
@@ -239,8 +234,9 @@ class Input extends BaseComponent {
239
234
  disabled
240
235
  } = this.props;
241
236
  const modeCls = cls("".concat(prefixCls, "-modebtn"));
242
- const modeIcon = eyeClosed ? /*#__PURE__*/React.createElement(IconEyeClosedSolid, null) : /*#__PURE__*/React.createElement(IconEyeOpened, null);
243
- const showModeBtn = mode === 'password' && value && !disabled && (isFocus || isHovering);
237
+ const modeIcon = eyeClosed ? /*#__PURE__*/React.createElement(IconEyeClosedSolid, null) : /*#__PURE__*/React.createElement(IconEyeOpened, null); // alway show password button for a11y
238
+
239
+ const showModeBtn = mode === 'password' && !disabled;
244
240
  const ariaLabel = eyeClosed ? 'Show password' : 'Hidden password';
245
241
 
246
242
  if (showModeBtn) {
@@ -276,14 +272,18 @@ class Input extends BaseComponent {
276
272
  ["".concat(prefixCls, "-inset-label")]: insetLabel,
277
273
  ["".concat(prefixCls, "-prefix-text")]: labelNode && _isString(labelNode),
278
274
  ["".concat(prefixCls, "-prefix-icon")]: isSemiIcon(labelNode)
279
- }); // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
280
-
281
- return /*#__PURE__*/React.createElement("div", {
282
- className: prefixWrapperCls,
283
- onMouseDown: this.handlePreventMouseDown,
284
- onClick: this.handleClickPrefixOrSuffix,
285
- id: insetLabelId
286
- }, labelNode);
275
+ });
276
+ return (
277
+ /*#__PURE__*/
278
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
279
+ React.createElement("div", {
280
+ className: prefixWrapperCls,
281
+ onMouseDown: this.handlePreventMouseDown,
282
+ onClick: this.handleClickPrefixOrSuffix,
283
+ id: insetLabelId,
284
+ "x-semi-prop": "prefix,insetLabel"
285
+ }, labelNode)
286
+ );
287
287
  }
288
288
 
289
289
  showClearBtn() {
@@ -314,13 +314,17 @@ class Input extends BaseComponent {
314
314
  ["".concat(prefixCls, "-suffix-text")]: suffix && _isString(suffix),
315
315
  ["".concat(prefixCls, "-suffix-icon")]: isSemiIcon(suffix),
316
316
  ["".concat(prefixCls, "-suffix-hidden")]: suffixAllowClear && Boolean(hideSuffix)
317
- }); // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
318
-
319
- return /*#__PURE__*/React.createElement("div", {
320
- className: suffixWrapperCls,
321
- onMouseDown: this.handlePreventMouseDown,
322
- onClick: this.handleClickPrefixOrSuffix
323
- }, suffix);
317
+ });
318
+ return (
319
+ /*#__PURE__*/
320
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
321
+ React.createElement("div", {
322
+ className: suffixWrapperCls,
323
+ onMouseDown: this.handlePreventMouseDown,
324
+ onClick: this.handleClickPrefixOrSuffix,
325
+ "x-semi-prop": "suffix"
326
+ }, suffix)
327
+ );
324
328
  }
325
329
 
326
330
  render() {
@@ -333,6 +337,7 @@ class Input extends BaseComponent {
333
337
  autofocus,
334
338
  className,
335
339
  disabled,
340
+ defaultValue,
336
341
  placeholder,
337
342
  prefix,
338
343
  mode,
@@ -353,7 +358,7 @@ class Input extends BaseComponent {
353
358
  maxLength,
354
359
  getValueLength
355
360
  } = _a,
356
- rest = __rest(_a, ["addonAfter", "addonBefore", "autofocus", "className", "disabled", "placeholder", "prefix", "mode", "insetLabel", "insetLabelId", "validateStatus", "type", "readonly", "size", "suffix", "style", "showClear", "onEnterPress", "onClear", "hideSuffix", "inputStyle", "forwardRef", "maxLength", "getValueLength"]);
361
+ rest = __rest(_a, ["addonAfter", "addonBefore", "autofocus", "className", "disabled", "defaultValue", "placeholder", "prefix", "mode", "insetLabel", "insetLabelId", "validateStatus", "type", "readonly", "size", "suffix", "style", "showClear", "onEnterPress", "onClear", "hideSuffix", "inputStyle", "forwardRef", "maxLength", "getValueLength"]);
357
362
 
358
363
  const {
359
364
  value,
@@ -421,7 +426,7 @@ class Input extends BaseComponent {
421
426
  }
422
427
 
423
428
  if (validateStatus === 'error') {
424
- inputProps['aria-invalid'] = "true";
429
+ inputProps['aria-invalid'] = 'true';
425
430
  }
426
431
 
427
432
  return (
@@ -53,13 +53,12 @@ export default class inputGroup extends BaseComponent {
53
53
 
54
54
  const defaultName = 'input-group';
55
55
  return /*#__PURE__*/React.createElement("div", {
56
- role: "group",
57
- "aria-label": "Input group",
58
- "aria-disabled": this.props.disabled,
59
56
  className: groupWrapperCls
60
57
  }, label && label.text ? /*#__PURE__*/React.createElement(Label, _Object$assign({
61
58
  name: defaultName
62
59
  }, label)) : null, /*#__PURE__*/React.createElement("span", {
60
+ role: "group",
61
+ "aria-disabled": this.props.disabled,
63
62
  id: label && label.name || defaultName,
64
63
  className: groupCls,
65
64
  style: this.props.style,
@@ -37,10 +37,6 @@ class TextArea extends BaseComponent {
37
37
  this.foundation.handleClear(e);
38
38
  };
39
39
 
40
- this.handleClearEnterPress = e => {
41
- this.foundation.handleClearEnterPress(e);
42
- };
43
-
44
40
  this.setRef = node => {
45
41
  this.libRef.current = node;
46
42
  const {
@@ -165,14 +161,14 @@ class TextArea extends BaseComponent {
165
161
  });
166
162
 
167
163
  if (showClear) {
168
- return /*#__PURE__*/React.createElement("div", {
169
- role: "button",
170
- tabIndex: 0,
171
- "aria-label": "Clear textarea value",
172
- className: clearCls,
173
- onClick: this.handleClear,
174
- onKeyPress: this.handleClearEnterPress
175
- }, /*#__PURE__*/React.createElement(IconClear, null));
164
+ return (
165
+ /*#__PURE__*/
166
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
167
+ React.createElement("div", {
168
+ className: clearCls,
169
+ onClick: this.handleClear
170
+ }, /*#__PURE__*/React.createElement(IconClear, null))
171
+ );
176
172
  }
177
173
 
178
174
  return null;
@@ -197,9 +193,6 @@ class TextArea extends BaseComponent {
197
193
  ["".concat(prefixCls, "-textarea-counter-exceed")]: current > total
198
194
  });
199
195
  counter = /*#__PURE__*/React.createElement("div", {
200
- "aria-label": "Textarea value length counter",
201
- "aria-valuemax": maxCount,
202
- "aria-valuenow": current,
203
196
  className: countCls
204
197
  }, current, total ? '/' : null, total);
205
198
  } else {
@@ -27,7 +27,8 @@ class List extends BaseComponent {
27
27
 
28
28
  if (emptyContent) {
29
29
  return /*#__PURE__*/React.createElement("div", {
30
- className: "".concat(cssClasses.PREFIX, "-empty")
30
+ className: "".concat(cssClasses.PREFIX, "-empty"),
31
+ "x-semi-prop": "emptyContent"
31
32
  }, emptyContent);
32
33
  } else {
33
34
  return /*#__PURE__*/React.createElement(LocaleConsumer, {
@@ -115,7 +116,8 @@ class List extends BaseComponent {
115
116
  className: wrapperCls,
116
117
  style: style
117
118
  }, header ? /*#__PURE__*/React.createElement("div", {
118
- className: "".concat(cssClasses.PREFIX, "-header")
119
+ className: "".concat(cssClasses.PREFIX, "-header"),
120
+ "x-semi-prop": "header"
119
121
  }, header) : null, /*#__PURE__*/React.createElement(ListContext.Provider, {
120
122
  value: {
121
123
  grid,
@@ -126,7 +128,8 @@ class List extends BaseComponent {
126
128
  spinning: loading,
127
129
  size: "large"
128
130
  }, this.wrapChildren(childrenList, children))), footer ? /*#__PURE__*/React.createElement("div", {
129
- className: "".concat(cssClasses.PREFIX, "-footer")
131
+ className: "".concat(cssClasses.PREFIX, "-footer"),
132
+ "x-semi-prop": "footer"
130
133
  }, footer) : null, loadMore ? loadMore : null);
131
134
  }
132
135
 
@@ -101,7 +101,8 @@ const ConfirmModal = props => {
101
101
  icon: iconNode,
102
102
  visible: visible
103
103
  }, rest), /*#__PURE__*/React.createElement("div", {
104
- className: contentCls
104
+ className: contentCls,
105
+ "x-semi-prop": "content"
105
106
  }, content));
106
107
  };
107
108
 
@@ -80,7 +80,9 @@ class Modal extends BaseComponent {
80
80
  loading: cancelLoading,
81
81
  type: "tertiary",
82
82
  autoFocus: true
83
- }, this.props.cancelButtonProps), cancelText || locale.cancel);
83
+ }, this.props.cancelButtonProps, {
84
+ "x-semi-children-alias": "cancelText"
85
+ }), cancelText || locale.cancel);
84
86
  }
85
87
  };
86
88
 
@@ -92,7 +94,9 @@ class Modal extends BaseComponent {
92
94
  theme: "solid",
93
95
  loading: confirmLoading,
94
96
  onClick: this.handleOk
95
- }, this.props.okButtonProps), okText || locale.confirm)));
97
+ }, this.props.okButtonProps, {
98
+ "x-semi-children-alias": "okText"
99
+ }), okText || locale.confirm)));
96
100
  }; // getDialog = () => {
97
101
  // const {
98
102
  // footer,
@@ -90,7 +90,9 @@ export default class ModalContent extends BaseComponent {
90
90
  let closer;
91
91
 
92
92
  if (closable) {
93
- const iconType = closeIcon || /*#__PURE__*/React.createElement(IconClose, null);
93
+ const iconType = closeIcon || /*#__PURE__*/React.createElement(IconClose, {
94
+ "x-semi-prop": "closeIcon"
95
+ });
94
96
  closer = /*#__PURE__*/React.createElement(Button, {
95
97
  "aria-label": "close",
96
98
  className: "".concat(cssClasses.DIALOG, "-close"),
@@ -111,7 +113,8 @@ export default class ModalContent extends BaseComponent {
111
113
  icon
112
114
  } = this.props;
113
115
  return icon ? /*#__PURE__*/React.createElement("span", {
114
- className: "".concat(cssClasses.DIALOG, "-icon-wrapper")
116
+ className: "".concat(cssClasses.DIALOG, "-icon-wrapper"),
117
+ "x-semi-prop": "icon"
115
118
  }, icon) : null;
116
119
  };
117
120
 
@@ -130,7 +133,8 @@ export default class ModalContent extends BaseComponent {
130
133
  }, icon, /*#__PURE__*/React.createElement(Typography.Title, {
131
134
  heading: 5,
132
135
  className: "".concat(cssClasses.DIALOG, "-title"),
133
- id: "".concat(cssClasses.DIALOG, "-title")
136
+ id: "".concat(cssClasses.DIALOG, "-title"),
137
+ "x-semi-prop": "title"
134
138
  }, title), closer);
135
139
  };
136
140
 
@@ -149,12 +153,14 @@ export default class ModalContent extends BaseComponent {
149
153
  return hasHeader ? /*#__PURE__*/React.createElement("div", {
150
154
  className: bodyCls,
151
155
  id: "".concat(cssClasses.DIALOG, "-body"),
152
- style: bodyStyle
156
+ style: bodyStyle,
157
+ "x-semi-prop": "children"
153
158
  }, children) : /*#__PURE__*/React.createElement("div", {
154
159
  className: "".concat(cssClasses.DIALOG, "-body-wrapper")
155
160
  }, icon, /*#__PURE__*/React.createElement("div", {
156
161
  className: bodyCls,
157
- style: bodyStyle
162
+ style: bodyStyle,
163
+ "x-semi-prop": "children"
158
164
  }, children), closer);
159
165
  };
160
166
 
@@ -186,7 +192,8 @@ export default class ModalContent extends BaseComponent {
186
192
  const body = this.renderBody();
187
193
  const header = this.renderHeader();
188
194
  const footer = props.footer ? /*#__PURE__*/React.createElement("div", {
189
- className: "".concat(cssClasses.DIALOG, "-footer")
195
+ className: "".concat(cssClasses.DIALOG, "-footer"),
196
+ "x-semi-prop": "footer"
190
197
  }, props.footer) : null;
191
198
  const dialogElement =
192
199
  /*#__PURE__*/