@douyinfe/semi-ui 2.13.0-beta.0 → 2.14.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 (207) 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 +719 -368
  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/hoc/withField.tsx +1 -1
  31. package/form/label.tsx +1 -1
  32. package/grid/col.tsx +1 -1
  33. package/grid/row.tsx +1 -1
  34. package/gulpfile.js +5 -5
  35. package/iconButton/index.tsx +2 -1
  36. package/input/_story/input.stories.js +32 -3
  37. package/input/index.tsx +45 -23
  38. package/input/inputGroup.tsx +3 -1
  39. package/input/textarea.tsx +2 -14
  40. package/lib/cjs/_base/base.css +36 -14
  41. package/lib/cjs/avatar/avatarGroup.d.ts +1 -1
  42. package/lib/cjs/avatar/avatarGroup.js +36 -9
  43. package/lib/cjs/avatar/index.d.ts +5 -0
  44. package/lib/cjs/avatar/index.js +121 -41
  45. package/lib/cjs/backtop/index.js +2 -1
  46. package/lib/cjs/badge/index.js +2 -1
  47. package/lib/cjs/banner/index.js +9 -4
  48. package/lib/cjs/breadcrumb/index.js +4 -3
  49. package/lib/cjs/button/Button.js +13 -3
  50. package/lib/cjs/card/index.js +10 -5
  51. package/lib/cjs/carousel/CarouselArrow.js +6 -2
  52. package/lib/cjs/carousel/index.js +2 -1
  53. package/lib/cjs/cascader/index.js +15 -8
  54. package/lib/cjs/cascader/item.js +2 -1
  55. package/lib/cjs/checkbox/checkbox.js +6 -2
  56. package/lib/cjs/collapsible/index.js +2 -1
  57. package/lib/cjs/datePicker/dateInput.js +2 -1
  58. package/lib/cjs/datePicker/datePicker.js +4 -2
  59. package/lib/cjs/divider/index.js +2 -1
  60. package/lib/cjs/dropdown/index.js +2 -1
  61. package/lib/cjs/empty/index.js +8 -4
  62. package/lib/cjs/form/hoc/withField.js +2 -1
  63. package/lib/cjs/form/label.js +2 -1
  64. package/lib/cjs/grid/col.js +2 -1
  65. package/lib/cjs/grid/row.js +2 -1
  66. package/lib/cjs/iconButton/index.js +3 -1
  67. package/lib/cjs/input/index.d.ts +0 -1
  68. package/lib/cjs/input/index.js +41 -36
  69. package/lib/cjs/input/inputGroup.js +2 -3
  70. package/lib/cjs/input/textarea.js +8 -15
  71. package/lib/cjs/list/index.js +6 -3
  72. package/lib/cjs/modal/ConfirmModal.js +2 -1
  73. package/lib/cjs/modal/Modal.js +6 -2
  74. package/lib/cjs/modal/ModalContent.js +13 -6
  75. package/lib/cjs/notification/notice.js +6 -3
  76. package/lib/cjs/pagination/index.js +4 -2
  77. package/lib/cjs/popconfirm/index.js +6 -3
  78. package/lib/cjs/radio/radio.d.ts +4 -0
  79. package/lib/cjs/radio/radio.js +32 -9
  80. package/lib/cjs/radio/radioInner.d.ts +6 -0
  81. package/lib/cjs/radio/radioInner.js +13 -4
  82. package/lib/cjs/rating/item.js +2 -1
  83. package/lib/cjs/scrollList/index.js +6 -3
  84. package/lib/cjs/select/index.js +10 -4
  85. package/lib/cjs/select/option.js +2 -1
  86. package/lib/cjs/sideSheet/SideSheetContent.js +6 -3
  87. package/lib/cjs/skeleton/index.js +3 -1
  88. package/lib/cjs/space/index.js +2 -1
  89. package/lib/cjs/spin/index.js +7 -3
  90. package/lib/cjs/switch/index.js +6 -4
  91. package/lib/cjs/table/Table.js +6 -3
  92. package/lib/cjs/tabs/TabBar.js +2 -1
  93. package/lib/cjs/tabs/TabPane.js +5 -2
  94. package/lib/cjs/tagInput/index.js +33 -22
  95. package/lib/cjs/timePicker/Combobox.js +3 -1
  96. package/lib/cjs/timePicker/TimePicker.js +2 -0
  97. package/lib/cjs/toast/toast.js +6 -3
  98. package/lib/cjs/tooltip/index.js +6 -1
  99. package/lib/cjs/transfer/index.js +2 -1
  100. package/lib/cjs/tree/treeNode.js +2 -1
  101. package/lib/cjs/treeSelect/index.js +10 -3
  102. package/lib/cjs/typography/base.js +2 -1
  103. package/lib/cjs/upload/index.d.ts +1 -1
  104. package/lib/cjs/upload/index.js +13 -6
  105. package/lib/es/_base/base.css +36 -14
  106. package/lib/es/avatar/avatarGroup.d.ts +1 -1
  107. package/lib/es/avatar/avatarGroup.js +37 -9
  108. package/lib/es/avatar/index.d.ts +5 -0
  109. package/lib/es/avatar/index.js +119 -38
  110. package/lib/es/backtop/index.js +2 -1
  111. package/lib/es/badge/index.js +2 -1
  112. package/lib/es/banner/index.js +9 -4
  113. package/lib/es/breadcrumb/index.js +4 -3
  114. package/lib/es/button/Button.js +11 -3
  115. package/lib/es/card/index.js +10 -5
  116. package/lib/es/carousel/CarouselArrow.js +6 -2
  117. package/lib/es/carousel/index.js +2 -1
  118. package/lib/es/cascader/index.js +15 -8
  119. package/lib/es/cascader/item.js +2 -1
  120. package/lib/es/checkbox/checkbox.js +6 -2
  121. package/lib/es/collapsible/index.js +2 -1
  122. package/lib/es/datePicker/dateInput.js +2 -1
  123. package/lib/es/datePicker/datePicker.js +4 -2
  124. package/lib/es/divider/index.js +2 -1
  125. package/lib/es/dropdown/index.js +2 -1
  126. package/lib/es/empty/index.js +8 -4
  127. package/lib/es/form/hoc/withField.js +2 -1
  128. package/lib/es/form/label.js +2 -1
  129. package/lib/es/grid/col.js +2 -1
  130. package/lib/es/grid/row.js +2 -1
  131. package/lib/es/iconButton/index.js +3 -1
  132. package/lib/es/input/index.d.ts +0 -1
  133. package/lib/es/input/index.js +41 -36
  134. package/lib/es/input/inputGroup.js +2 -3
  135. package/lib/es/input/textarea.js +8 -15
  136. package/lib/es/list/index.js +6 -3
  137. package/lib/es/modal/ConfirmModal.js +2 -1
  138. package/lib/es/modal/Modal.js +6 -2
  139. package/lib/es/modal/ModalContent.js +13 -6
  140. package/lib/es/notification/notice.js +6 -3
  141. package/lib/es/pagination/index.js +4 -2
  142. package/lib/es/popconfirm/index.js +6 -3
  143. package/lib/es/radio/radio.d.ts +4 -0
  144. package/lib/es/radio/radio.js +32 -9
  145. package/lib/es/radio/radioInner.d.ts +6 -0
  146. package/lib/es/radio/radioInner.js +13 -4
  147. package/lib/es/rating/item.js +2 -1
  148. package/lib/es/scrollList/index.js +6 -3
  149. package/lib/es/select/index.js +10 -4
  150. package/lib/es/select/option.js +2 -1
  151. package/lib/es/sideSheet/SideSheetContent.js +6 -3
  152. package/lib/es/skeleton/index.js +3 -1
  153. package/lib/es/space/index.js +2 -1
  154. package/lib/es/spin/index.js +7 -3
  155. package/lib/es/switch/index.js +6 -4
  156. package/lib/es/table/Table.js +6 -3
  157. package/lib/es/tabs/TabBar.js +2 -1
  158. package/lib/es/tabs/TabPane.js +5 -2
  159. package/lib/es/tagInput/index.js +31 -22
  160. package/lib/es/timePicker/Combobox.js +3 -1
  161. package/lib/es/timePicker/TimePicker.js +2 -0
  162. package/lib/es/toast/toast.js +6 -3
  163. package/lib/es/tooltip/index.js +6 -1
  164. package/lib/es/transfer/index.js +2 -1
  165. package/lib/es/tree/treeNode.js +2 -1
  166. package/lib/es/treeSelect/index.js +10 -3
  167. package/lib/es/typography/base.js +2 -1
  168. package/lib/es/upload/index.d.ts +1 -1
  169. package/lib/es/upload/index.js +13 -6
  170. package/list/index.tsx +16 -4
  171. package/modal/ConfirmModal.tsx +1 -1
  172. package/modal/Modal.tsx +2 -0
  173. package/modal/ModalContent.tsx +27 -14
  174. package/notification/notice.tsx +16 -4
  175. package/package.json +8 -8
  176. package/pagination/index.tsx +16 -2
  177. package/popconfirm/index.tsx +11 -3
  178. package/radio/_story/radio.stories.js +9 -6
  179. package/radio/radio.tsx +37 -7
  180. package/radio/radioInner.tsx +11 -2
  181. package/rating/item.tsx +1 -1
  182. package/scrollList/index.tsx +19 -3
  183. package/select/index.tsx +13 -4
  184. package/select/option.tsx +5 -1
  185. package/sideSheet/SideSheetContent.tsx +3 -3
  186. package/skeleton/index.tsx +1 -1
  187. package/space/index.tsx +1 -1
  188. package/spin/index.tsx +15 -9
  189. package/switch/index.tsx +9 -14
  190. package/table/Table.tsx +5 -3
  191. package/table/_story/v2/FixedOnHeaderRow/index.jsx +3 -0
  192. package/tabs/TabBar.tsx +1 -1
  193. package/tabs/TabPane.tsx +9 -4
  194. package/tabs/_story/tabs.stories.js +36 -0
  195. package/tag/_story/tag.stories.js +1 -1
  196. package/tagInput/index.tsx +32 -15
  197. package/timePicker/Combobox.tsx +6 -1
  198. package/timePicker/TimePicker.tsx +1 -0
  199. package/toast/toast.tsx +3 -3
  200. package/tooltip/index.tsx +4 -1
  201. package/transfer/index.tsx +1 -0
  202. package/tree/treeNode.tsx +1 -1
  203. package/treeSelect/_story/treeSelect.stories.js +161 -2
  204. package/treeSelect/index.tsx +17 -3
  205. package/typography/base.tsx +1 -1
  206. package/upload/_story/upload.stories.js +152 -0
  207. package/upload/index.tsx +107 -38
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var _context7;
3
+ var _context9;
4
4
 
5
5
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
6
6
 
@@ -21,10 +21,10 @@ var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-st
21
21
 
22
22
  var _getOwnPropertySymbols = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols"));
23
23
 
24
- var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind"));
25
-
26
24
  var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
27
25
 
26
+ var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind"));
27
+
28
28
  var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
29
29
 
30
30
  var _react = _interopRequireDefault(require("react"));
@@ -43,9 +43,11 @@ var _function = require("@douyinfe/semi-foundation/lib/cjs/utils/function");
43
43
 
44
44
  var _baseComponent = _interopRequireDefault(require("../_base/baseComponent"));
45
45
 
46
+ var _a11y = require("@douyinfe/semi-foundation/lib/cjs/utils/a11y");
47
+
46
48
  var _interface = require("./interface");
47
49
 
48
- _forEachInstanceProperty(_context7 = _Object$keys(_interface)).call(_context7, function (key) {
50
+ _forEachInstanceProperty(_context9 = _Object$keys(_interface)).call(_context9, function (key) {
49
51
  if (key === "default" || key === "__esModule") return;
50
52
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
51
53
  if (key in exports && exports[key] === _interface[key]) return;
@@ -76,16 +78,86 @@ const prefixCls = _constants.cssClasses.PREFIX;
76
78
 
77
79
  class Avatar extends _baseComponent.default {
78
80
  constructor(props) {
79
- var _context, _context2, _context3;
81
+ var _context, _context2, _context3, _context4, _context5;
80
82
 
81
83
  super(props);
84
+
85
+ this.handleFocusVisible = event => {
86
+ this.foundation.handleFocusVisible(event);
87
+ };
88
+
89
+ this.handleBlur = event => {
90
+ this.foundation.handleBlur();
91
+ };
92
+
93
+ this.getContent = () => {
94
+ const {
95
+ children,
96
+ onClick,
97
+ imgAttr,
98
+ src,
99
+ srcSet,
100
+ alt
101
+ } = this.props;
102
+ const {
103
+ isImgExist
104
+ } = this.state;
105
+ let content = children;
106
+ const clickable = onClick !== _function.noop;
107
+ const isImg = src && isImgExist;
108
+ const a11yFocusProps = {
109
+ tabIndex: 0,
110
+ onKeyDown: this.handleKeyDown,
111
+ onFocus: this.handleFocusVisible,
112
+ onBlur: this.handleBlur
113
+ };
114
+
115
+ if (isImg) {
116
+ const finalAlt = clickable ? "clickable Avatar: ".concat(alt) : alt;
117
+ const imgBasicProps = (0, _assign.default)((0, _assign.default)({
118
+ src,
119
+ srcSet,
120
+ onError: this.handleError
121
+ }, imgAttr), {
122
+ className: (0, _classnames.default)({
123
+ ["".concat(prefixCls, "-no-focus-visible")]: clickable
124
+ })
125
+ });
126
+ const imgProps = clickable ? (0, _assign.default)((0, _assign.default)({}, imgBasicProps), a11yFocusProps) : imgBasicProps;
127
+ content = /*#__PURE__*/_react.default.createElement("img", (0, _assign.default)({
128
+ alt: finalAlt
129
+ }, imgProps));
130
+ } else if (typeof children === 'string') {
131
+ const tempAlt = alt !== null && alt !== void 0 ? alt : children;
132
+ const finalAlt = clickable ? "clickable Avatar: ".concat(tempAlt) : tempAlt;
133
+ const props = {
134
+ role: 'img',
135
+ 'aria-label': finalAlt,
136
+ className: (0, _classnames.default)("".concat(prefixCls, "-label"), {
137
+ ["".concat(prefixCls, "-no-focus-visible")]: clickable
138
+ })
139
+ };
140
+ const finalProps = clickable ? (0, _assign.default)((0, _assign.default)({}, props), a11yFocusProps) : props;
141
+ content = /*#__PURE__*/_react.default.createElement("span", {
142
+ className: "".concat(prefixCls, "-content")
143
+ }, /*#__PURE__*/_react.default.createElement("span", (0, _assign.default)({}, finalProps, {
144
+ "x-semi-prop": "children"
145
+ }), children));
146
+ }
147
+
148
+ return content;
149
+ };
150
+
82
151
  this.state = {
83
152
  isImgExist: true,
84
- hoverContent: ''
153
+ hoverContent: '',
154
+ focusVisible: false
85
155
  };
86
156
  this.onEnter = (0, _bind.default)(_context = this.onEnter).call(_context, this);
87
157
  this.onLeave = (0, _bind.default)(_context2 = this.onLeave).call(_context2, this);
88
158
  this.handleError = (0, _bind.default)(_context3 = this.handleError).call(_context3, this);
159
+ this.handleKeyDown = (0, _bind.default)(_context4 = this.handleKeyDown).call(_context4, this);
160
+ this.getContent = (0, _bind.default)(_context5 = this.getContent).call(_context5, this);
89
161
  }
90
162
 
91
163
  get adapter() {
@@ -118,6 +190,11 @@ class Avatar extends _baseComponent.default {
118
190
  } = this.props;
119
191
  onMouseLeave && onMouseLeave(e);
120
192
  });
193
+ },
194
+ setFocusVisible: focusVisible => {
195
+ this.setState({
196
+ focusVisible
197
+ });
121
198
  }
122
199
  });
123
200
  }
@@ -168,8 +245,28 @@ class Avatar extends _baseComponent.default {
168
245
  this.foundation.handleImgLoadError();
169
246
  }
170
247
 
248
+ handleKeyDown(event) {
249
+ const {
250
+ onClick
251
+ } = this.props;
252
+
253
+ switch (event.key) {
254
+ case "Enter":
255
+ onClick(event);
256
+ (0, _a11y.handlePrevent)(event);
257
+ break;
258
+
259
+ case 'Escape':
260
+ event.target.blur();
261
+ break;
262
+
263
+ default:
264
+ break;
265
+ }
266
+ }
267
+
171
268
  render() {
172
- var _context4, _context5, _context6;
269
+ var _context6, _context7, _context8;
173
270
 
174
271
  // eslint-disable-next-line max-len, no-unused-vars
175
272
  const _a = this.props,
@@ -191,46 +288,29 @@ class Avatar extends _baseComponent.default {
191
288
 
192
289
  const {
193
290
  isImgExist,
194
- hoverContent
291
+ hoverContent,
292
+ focusVisible
195
293
  } = this.state;
196
294
  const isImg = src && isImgExist;
197
295
  const avatarCls = (0, _classnames.default)(prefixCls, {
198
- [(0, _concat.default)(_context4 = "".concat(prefixCls, "-")).call(_context4, shape)]: shape,
199
- [(0, _concat.default)(_context5 = "".concat(prefixCls, "-")).call(_context5, size)]: size,
200
- [(0, _concat.default)(_context6 = "".concat(prefixCls, "-")).call(_context6, color)]: color && !isImg,
201
- ["".concat(prefixCls, "-img")]: isImg
296
+ [(0, _concat.default)(_context6 = "".concat(prefixCls, "-")).call(_context6, shape)]: shape,
297
+ [(0, _concat.default)(_context7 = "".concat(prefixCls, "-")).call(_context7, size)]: size,
298
+ [(0, _concat.default)(_context8 = "".concat(prefixCls, "-")).call(_context8, color)]: color && !isImg,
299
+ ["".concat(prefixCls, "-img")]: isImg,
300
+ ["".concat(prefixCls, "-focus")]: focusVisible
202
301
  }, className);
203
- let content = children;
204
302
  const hoverRender = hoverContent ? /*#__PURE__*/_react.default.createElement("div", {
205
- className: "".concat(prefixCls, "-hover")
303
+ className: "".concat(prefixCls, "-hover"),
304
+ "x-semi-prop": "hoverContent"
206
305
  }, hoverContent) : null;
207
-
208
- if (isImg) {
209
- content = /*#__PURE__*/_react.default.createElement("img", (0, _assign.default)({
210
- src: src,
211
- srcSet: srcSet,
212
- onError: this.handleError,
213
- alt: alt
214
- }, imgAttr));
215
- } else if (typeof children === 'string') {
216
- content = /*#__PURE__*/_react.default.createElement("span", {
217
- className: "".concat(prefixCls, "-content")
218
- }, /*#__PURE__*/_react.default.createElement("span", {
219
- className: "".concat(prefixCls, "-label")
220
- }, children));
221
- }
222
-
223
- return (
224
- /*#__PURE__*/
225
- // eslint-disable-next-line jsx-a11y/no-static-element-interactions,jsx-a11y/click-events-have-key-events
226
- _react.default.createElement("span", (0, _assign.default)({}, others, {
227
- style: style,
228
- className: avatarCls,
229
- onClick: onClick,
230
- onMouseEnter: this.onEnter,
231
- onMouseLeave: this.onLeave
232
- }), content, hoverRender)
233
- );
306
+ return /*#__PURE__*/_react.default.createElement("span", (0, _assign.default)({}, others, {
307
+ style: style,
308
+ className: avatarCls,
309
+ onClick: onClick,
310
+ onMouseEnter: this.onEnter,
311
+ onMouseLeave: this.onLeave,
312
+ role: 'listitem'
313
+ }), this.getContent(), hoverRender);
234
314
  }
235
315
 
236
316
  }
@@ -121,7 +121,8 @@ class BackTop extends _baseComponent.default {
121
121
  const content = visible ? /*#__PURE__*/_react.default.createElement("div", (0, _assign.default)({}, others, {
122
122
  className: preCls,
123
123
  style: style,
124
- onClick: e => this.handleClick(e)
124
+ onClick: e => this.handleClick(e),
125
+ "x-semi-prop": "children"
125
126
  }), backtopBtn) : null;
126
127
  return content;
127
128
  }
@@ -104,7 +104,8 @@ class Badge extends _react.PureComponent {
104
104
  className: prefixCls
105
105
  }, rest), children, /*#__PURE__*/_react.default.createElement("span", {
106
106
  className: wrapper,
107
- style: style
107
+ style: style,
108
+ "x-semi-prop": "count"
108
109
  }, dot ? null : content));
109
110
  }
110
111
 
@@ -93,6 +93,7 @@ class Banner extends _baseComponent.default {
93
93
  className: "".concat(prefixCls, "-close"),
94
94
  onClick: this.remove,
95
95
  icon: closeIcon || /*#__PURE__*/_react.default.createElement(_semiIcons.IconClose, {
96
+ "x-semi-prop": "closeIcon",
96
97
  "aria-hidden": true
97
98
  }),
98
99
  theme: "borderless",
@@ -139,7 +140,8 @@ class Banner extends _baseComponent.default {
139
140
 
140
141
  if (iconType) {
141
142
  return /*#__PURE__*/_react.default.createElement("div", {
142
- className: iconCls
143
+ className: iconCls,
144
+ "x-semi-prop": "icon"
143
145
  }, iconType);
144
146
  }
145
147
 
@@ -181,12 +183,15 @@ class Banner extends _baseComponent.default {
181
183
  }, title ? /*#__PURE__*/_react.default.createElement(_typography.default.Title, {
182
184
  heading: 5,
183
185
  className: "".concat(prefixCls, "-title"),
184
- component: "div"
186
+ component: "div",
187
+ "x-semi-prop": "title"
185
188
  }, title) : null, description ? /*#__PURE__*/_react.default.createElement(_typography.default.Paragraph, {
186
189
  className: "".concat(prefixCls, "-description"),
187
- component: "div"
190
+ component: "div",
191
+ "x-semi-prop": "description"
188
192
  }, description) : null)), this.renderCloser()), children ? /*#__PURE__*/_react.default.createElement("div", {
189
- className: "".concat(prefixCls, "-extra")
193
+ className: "".concat(prefixCls, "-extra"),
194
+ "x-semi-prop": "children"
190
195
  }, children) : null) : null;
191
196
  return banner;
192
197
  }
@@ -76,14 +76,15 @@ class Breadcrumb extends _baseComponent.default {
76
76
  }, /*#__PURE__*/_react.default.createElement("span", {
77
77
  className: "".concat(clsPrefix, "-item-wrap")
78
78
  }, /*#__PURE__*/_react.default.createElement("span", {
79
- role: 'button',
79
+ role: "button",
80
80
  tabIndex: 0,
81
- "aria-label": 'Expand breadcrumb items',
81
+ "aria-label": "Expand breadcrumb items",
82
82
  className: (0, _concat.default)(_context = "".concat(clsPrefix, "-item ")).call(_context, clsPrefix, "-item-more"),
83
83
  onClick: item => this.foundation.handleExpand(item),
84
84
  onKeyPress: e => this.foundation.handleExpandEnterPress(e)
85
85
  }, hasRenderMore && renderMore(restItem), !hasRenderMore && moreType === 'default' && /*#__PURE__*/_react.default.createElement(_semiIcons.IconMore, null), !hasRenderMore && moreType === 'popover' && this.renderPopoverMore(restItem)), /*#__PURE__*/_react.default.createElement("span", {
86
- className: "".concat(clsPrefix, "-separator")
86
+ className: "".concat(clsPrefix, "-separator"),
87
+ "x-semi-prop": "separator"
87
88
  }, this.props.separator)));
88
89
 
89
90
  (0, _splice.default)(template).call(template, 1, itemsLen - maxItemCount, spread);
@@ -22,6 +22,10 @@ var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-sta
22
22
 
23
23
  var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
24
24
 
25
+ var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
26
+
27
+ var _omit2 = _interopRequireDefault(require("lodash/omit"));
28
+
25
29
  var _react = _interopRequireWildcard(require("react"));
26
30
 
27
31
  var _classnames = _interopRequireDefault(require("classnames"));
@@ -81,7 +85,7 @@ class Button extends _react.PureComponent {
81
85
 
82
86
  const baseProps = (0, _assign.default)((0, _assign.default)({
83
87
  disabled
84
- }, attr), {
88
+ }, (0, _omit2.default)(attr, ['x-semi-children-alias'])), {
85
89
  className: (0, _classnames.default)(prefixCls, {
86
90
  [(0, _concat.default)(_context = "".concat(prefixCls, "-")).call(_context, type)]: !disabled && type,
87
91
  ["".concat(prefixCls, "-disabled")]: disabled,
@@ -96,6 +100,12 @@ class Button extends _react.PureComponent {
96
100
  type: htmlType,
97
101
  'aria-disabled': disabled
98
102
  });
103
+ const xSemiProps = {};
104
+
105
+ if (!(className && (0, _includes.default)(className).call(className, '-with-icon'))) {
106
+ xSemiProps['x-semi-prop'] = this.props['x-semi-children-alias'] || 'children';
107
+ }
108
+
99
109
  return (
100
110
  /*#__PURE__*/
101
111
  // eslint-disable-next-line react/button-has-type
@@ -103,10 +113,10 @@ class Button extends _react.PureComponent {
103
113
  onClick: this.props.onClick,
104
114
  onMouseDown: this.props.onMouseDown,
105
115
  style: style
106
- }), /*#__PURE__*/_react.default.createElement("span", {
116
+ }), /*#__PURE__*/_react.default.createElement("span", (0, _assign.default)({
107
117
  className: "".concat(prefixCls, "-content"),
108
118
  onClick: e => disabled && e.stopPropagation()
109
- }, children))
119
+ }, xSemiProps), children))
110
120
  );
111
121
  }
112
122
 
@@ -95,7 +95,8 @@ class Card extends _react.PureComponent {
95
95
  _react.default.createElement("div", {
96
96
  className: headerWrapperCls
97
97
  }, headerExtraContent && /*#__PURE__*/_react.default.createElement("div", {
98
- className: "".concat(prefixcls, "-header-wrapper-extra")
98
+ className: "".concat(prefixcls, "-header-wrapper-extra"),
99
+ "x-semi-prop": "headerExtraContent"
99
100
  }, headerExtraContent), title && /*#__PURE__*/_react.default.createElement("div", {
100
101
  className: titleCls
101
102
  }, (0, _isString2.default)(title) ? /*#__PURE__*/_react.default.createElement(_typography.default.Title, {
@@ -103,7 +104,8 @@ class Card extends _react.PureComponent {
103
104
  ellipsis: {
104
105
  showTooltip: true,
105
106
  rows: 1
106
- }
107
+ },
108
+ "x-semi-prop": "title"
107
109
  }, title) : title)));
108
110
  }
109
111
 
@@ -116,7 +118,8 @@ class Card extends _react.PureComponent {
116
118
  } = this.props;
117
119
  const coverCls = (0, _classnames.default)("".concat(prefixcls, "-cover"));
118
120
  return cover && /*#__PURE__*/_react.default.createElement("div", {
119
- className: coverCls
121
+ className: coverCls,
122
+ "x-semi-prop": "cover"
120
123
  }, cover);
121
124
  };
122
125
 
@@ -148,7 +151,8 @@ class Card extends _react.PureComponent {
148
151
  spacing: 12
149
152
  }, (0, _map.default)(actions).call(actions, (item, idx) => /*#__PURE__*/_react.default.createElement("div", {
150
153
  key: idx,
151
- className: actionsItemCls
154
+ className: actionsItemCls,
155
+ "x-semi-prop": "actions.".concat(idx)
152
156
  }, item)))));
153
157
  };
154
158
 
@@ -163,7 +167,8 @@ class Card extends _react.PureComponent {
163
167
  });
164
168
  return footer && /*#__PURE__*/_react.default.createElement("div", {
165
169
  style: footerStyle,
166
- className: footerCls
170
+ className: footerCls,
171
+ "x-semi-prop": "footer"
167
172
  }, footer);
168
173
  };
169
174
  }
@@ -74,12 +74,16 @@ class CarouselArrow extends _react.default.PureComponent {
74
74
  // role='button'
75
75
  className: leftClassNames,
76
76
  onClick: prev
77
- }, (0, _get2.default)(this.props, 'arrowProps.leftArrow.props')), this.renderLeftIcon()), /*#__PURE__*/_react.default.createElement("div", (0, _assign.default)({
77
+ }, (0, _get2.default)(this.props, 'arrowProps.leftArrow.props'), {
78
+ "x-semi-prop": "arrowProps.leftArrow.children"
79
+ }), this.renderLeftIcon()), /*#__PURE__*/_react.default.createElement("div", (0, _assign.default)({
78
80
  // role='button'
79
81
  // tabIndex={0}
80
82
  className: rightClassNames,
81
83
  onClick: next
82
- }, (0, _get2.default)(this.props, 'arrowProps.rightArrow.props')), this.renderRightIcon()));
84
+ }, (0, _get2.default)(this.props, 'arrowProps.rightArrow.props'), {
85
+ "x-semi-prop": "arrowProps.rightArrow.children"
86
+ }), this.renderRightIcon()));
83
87
  }
84
88
 
85
89
  }
@@ -296,7 +296,8 @@ class Carousel extends _baseComponent.default {
296
296
  className: (0, _classnames.default)([(0, _concat.default)(_context2 = "".concat(_constants.cssClasses.CAROUSEL_CONTENT, "-")).call(_context2, animation)], {
297
297
  ["".concat(_constants.cssClasses.CAROUSEL_CONTENT)]: true,
298
298
  ["".concat(_constants.cssClasses.CAROUSEL_CONTENT, "-reverse")]: slideDirection === 'left' ? isReverse : !isReverse
299
- })
299
+ }),
300
+ "x-semi-prop": "children"
300
301
  }, this.renderChildren()), this.renderIndicator(), this.renderArrow());
301
302
  }
302
303
 
@@ -342,7 +342,8 @@ class Cascader extends _baseComponent.default {
342
342
  ["".concat(prefixcls, "-suffix-icon")]: (0, _utils.isSemiIcon)(suffix)
343
343
  });
344
344
  return /*#__PURE__*/_react.default.createElement("div", {
345
- className: suffixWrapperCls
345
+ className: suffixWrapperCls,
346
+ "x-semi-prop": "suffix"
346
347
  }, suffix);
347
348
  };
348
349
 
@@ -362,7 +363,8 @@ class Cascader extends _baseComponent.default {
362
363
  });
363
364
  return /*#__PURE__*/_react.default.createElement("div", {
364
365
  className: prefixWrapperCls,
365
- id: insetLabelId
366
+ id: insetLabelId,
367
+ "x-semi-prop": "prefix,insetLabel"
366
368
  }, labelNode);
367
369
  };
368
370
 
@@ -420,6 +422,8 @@ class Cascader extends _baseComponent.default {
420
422
  * A11y: simulate clear button click
421
423
  */
422
424
 
425
+ /* istanbul ignore next */
426
+
423
427
 
424
428
  this.handleClearEnterPress = e => {
425
429
  e && e.stopPropagation();
@@ -452,7 +456,7 @@ class Cascader extends _baseComponent.default {
452
456
  className: clearCls,
453
457
  onClick: this.handleClear,
454
458
  onKeyPress: this.handleClearEnterPress,
455
- role: 'button',
459
+ role: "button",
456
460
  tabIndex: 0
457
461
  }, /*#__PURE__*/_react.default.createElement(_semiIcons.IconClear, null));
458
462
  }
@@ -471,7 +475,8 @@ class Cascader extends _baseComponent.default {
471
475
  }
472
476
 
473
477
  return arrowIcon ? /*#__PURE__*/_react.default.createElement("div", {
474
- className: (0, _classnames.default)("".concat(prefixcls, "-arrow"))
478
+ className: (0, _classnames.default)("".concat(prefixcls, "-arrow")),
479
+ "x-semi-prop": "arrowIcon"
475
480
  }, arrowIcon) : null;
476
481
  };
477
482
 
@@ -546,12 +551,12 @@ class Cascader extends _baseComponent.default {
546
551
  "aria-errormessage": this.props['aria-errormessage'],
547
552
  "aria-label": this.props['aria-label'],
548
553
  "aria-labelledby": this.props['aria-labelledby'],
549
- "aria-describedby": this.props["aria-describedby"],
554
+ "aria-describedby": this.props['aria-describedby'],
550
555
  "aria-required": this.props['aria-required'],
551
556
  id: id
552
557
  }, mouseEvent, {
553
558
  // eslint-disable-next-line jsx-a11y/role-has-required-aria-props
554
- role: 'combobox',
559
+ role: "combobox",
555
560
  tabIndex: 0
556
561
  }), inner);
557
562
  };
@@ -800,13 +805,15 @@ class Cascader extends _baseComponent.default {
800
805
  if ((0, _isArray.default)(realValue)) {
801
806
  normallizedValue = (0, _isArray.default)(realValue[0]) ? realValue : [realValue];
802
807
  } else {
803
- normallizedValue = [[realValue]];
808
+ if (realValue !== undefined) {
809
+ normallizedValue = [[realValue]];
810
+ }
804
811
  } // formatValuePath is used to save value of valuePath
805
812
 
806
813
 
807
814
  const formatValuePath = [];
808
815
  (0, _forEach.default)(normallizedValue).call(normallizedValue, valueItem => {
809
- const formatItem = onChangeWithObject ? (0, _map.default)(valueItem).call(valueItem, i => i.value) : valueItem;
816
+ const formatItem = onChangeWithObject ? (0, _map.default)(valueItem).call(valueItem, i => i === null || i === void 0 ? void 0 : i.value) : valueItem;
810
817
  formatValuePath.push(formatItem);
811
818
  }); // formatKeys is used to save key of value
812
819
 
@@ -332,7 +332,8 @@ class Item extends _react.PureComponent {
332
332
  className: (0, _concat.default)(_context6 = "".concat(prefixcls, " ")).call(_context6, prefixcls, "-empty"),
333
333
  key: 'empty-list'
334
334
  }, /*#__PURE__*/_react.default.createElement("span", {
335
- className: "".concat(prefixcls, "-label")
335
+ className: "".concat(prefixcls, "-label"),
336
+ "x-semi-prop": "emptyContent"
336
337
  }, emptyContent || locale.emptyText));
337
338
  });
338
339
  }
@@ -201,13 +201,17 @@ class Checkbox extends _baseComponent.default {
201
201
  const extraCls = (0, _classnames.default)("".concat(prefix, "-extra"), {
202
202
  ["".concat(prefix, "-cardType_extra_noChildren")]: props.isCardType && !children
203
203
  });
204
+ const name = inGroup && this.context.checkboxGroup.name;
205
+ const xSemiPropChildren = this.props['x-semi-children-alias'] || 'children';
204
206
 
205
207
  const renderContent = () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children ? /*#__PURE__*/_react.default.createElement("span", {
206
208
  id: addonId,
207
- className: "".concat(prefix, "-addon")
209
+ className: "".concat(prefix, "-addon"),
210
+ "x-semi-prop": xSemiPropChildren
208
211
  }, children) : null, extra ? /*#__PURE__*/_react.default.createElement("div", {
209
212
  id: extraId,
210
- className: extraCls
213
+ className: extraCls,
214
+ "x-semi-prop": "extra"
211
215
  }, extra) : null);
212
216
 
213
217
  return (
@@ -115,7 +115,8 @@ const Collapsible = props => {
115
115
  style: {
116
116
  overflow: 'hidden'
117
117
  },
118
- id: id
118
+ id: id,
119
+ "x-semi-prop": "children"
119
120
  }, children));
120
121
  };
121
122
 
@@ -179,7 +179,8 @@ class DateInput extends _baseComponent.default {
179
179
  const labelNode = prefix || insetLabel;
180
180
  return labelNode ? /*#__PURE__*/_react.default.createElement("div", {
181
181
  className: "".concat(prefixCls, "-range-input-prefix"),
182
- onClick: e => !disabled && !rangeInputFocus && this.handleRangeStartFocus(e)
182
+ onClick: e => !disabled && !rangeInputFocus && this.handleRangeStartFocus(e),
183
+ "x-semi-prop": "prefix,insetLabel"
183
184
  }, labelNode) : null;
184
185
  }
185
186
 
@@ -220,11 +220,13 @@ class DatePicker extends _baseComponent.default {
220
220
  className: wrapCls,
221
221
  style: dropdownStyle
222
222
  }, topSlot && /*#__PURE__*/_react.default.createElement("div", {
223
- className: "".concat(_constants.cssClasses.PREFIX, "-topSlot")
223
+ className: "".concat(_constants.cssClasses.PREFIX, "-topSlot"),
224
+ "x-semi-prop": "topSlot"
224
225
  }, topSlot), insetInput && /*#__PURE__*/_react.default.createElement(_dateInput.default, (0, _assign.default)({}, insetInputProps, {
225
226
  insetInput: true
226
227
  })), this.adapter.typeIsYearOrMonth() ? this.renderYearMonthPanel(locale, localeCode) : this.renderMonthGrid(locale, localeCode, dateFnsLocale), this.renderQuickControls(), bottomSlot && /*#__PURE__*/_react.default.createElement("div", {
227
- className: "".concat(_constants.cssClasses.PREFIX, "-bottomSlot")
228
+ className: "".concat(_constants.cssClasses.PREFIX, "-bottomSlot"),
229
+ "x-semi-prop": "bottomSlot"
228
230
  }, bottomSlot), this.renderFooter(locale, localeCode));
229
231
  };
230
232
 
@@ -80,7 +80,8 @@ const Divider = props => {
80
80
  className: dividerClassNames,
81
81
  style: (0, _assign.default)((0, _assign.default)({}, overrideDefaultStyle), style)
82
82
  }), children && layout === 'horizontal' ? typeof children === 'string' ? /*#__PURE__*/_react.default.createElement("span", {
83
- className: "".concat(prefixCls, "-divider_inner-text")
83
+ className: "".concat(prefixCls, "-divider_inner-text"),
84
+ "x-semi-prop": "children"
84
85
  }, children) : children : null);
85
86
  };
86
87
 
@@ -118,7 +118,8 @@ class Dropdown extends _baseComponent.default {
118
118
  className: className,
119
119
  style: style
120
120
  }, /*#__PURE__*/_react.default.createElement("div", {
121
- className: "".concat(prefixCls, "-content")
121
+ className: "".concat(prefixCls, "-content"),
122
+ "x-semi-prop": "render"
122
123
  }, content)));
123
124
  }
124
125
 
@@ -122,15 +122,19 @@ class Empty extends _baseComponent.default {
122
122
  style: style
123
123
  }, /*#__PURE__*/_react.default.createElement("div", {
124
124
  className: "".concat(prefixCls, "-image"),
125
- style: imageStyle
125
+ style: imageStyle,
126
+ "x-semi-prop": "image,darkModeImage"
126
127
  }, imageNode), /*#__PURE__*/_react.default.createElement("div", {
127
128
  className: "".concat(prefixCls, "-content")
128
129
  }, title ? /*#__PURE__*/_react.default.createElement(_typography.default.Title, (0, _assign.default)({}, titleProps, {
129
- className: "".concat(prefixCls, "-title")
130
+ className: "".concat(prefixCls, "-title"),
131
+ "x-semi-prop": "title"
130
132
  }), title) : null, description ? /*#__PURE__*/_react.default.createElement("div", {
131
- className: "".concat(prefixCls, "-description")
133
+ className: "".concat(prefixCls, "-description"),
134
+ "x-semi-prop": "description"
132
135
  }, description) : null, children ? /*#__PURE__*/_react.default.createElement("div", {
133
- className: "".concat(prefixCls, "-footer")
136
+ className: "".concat(prefixCls, "-footer"),
137
+ "x-semi-prop": "children"
134
138
  }, children) : null));
135
139
  }
136
140
 
@@ -459,7 +459,8 @@ function withField(Component, opts) {
459
459
  });
460
460
  const extraContent = extraText ? /*#__PURE__*/_react.default.createElement("div", {
461
461
  className: extraCls,
462
- id: extraTextId
462
+ id: extraTextId,
463
+ "x-semi-prop": "extraText"
463
464
  }, extraText) : null;
464
465
  let newProps = (0, _assign.default)((0, _assign.default)({
465
466
  id: a11yId,
@@ -55,7 +55,8 @@ class Label extends _react.PureComponent {
55
55
  width ? labelStyle.width = width : null;
56
56
 
57
57
  const textContent = /*#__PURE__*/_react.default.createElement("div", {
58
- className: "".concat(prefixCls, "-field-label-text")
58
+ className: "".concat(prefixCls, "-field-label-text"),
59
+ "x-semi-prop": "label"
59
60
  }, typeof text !== 'undefined' ? text : children);
60
61
 
61
62
  const contentWithExtra = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, textContent, /*#__PURE__*/_react.default.createElement("div", {