@douyinfe/semi-ui 2.19.0-alpha.5 → 2.19.0-alpha.8

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 (50) hide show
  1. package/button/buttonGroup.tsx +1 -1
  2. package/button/index.tsx +2 -0
  3. package/checkbox/_story/checkbox.stories.js +2 -0
  4. package/checkbox/checkbox.tsx +22 -19
  5. package/checkbox/checkboxGroup.tsx +1 -0
  6. package/dist/css/semi.css +42 -135
  7. package/dist/css/semi.min.css +1 -1
  8. package/dist/umd/semi-ui.js +395 -329
  9. package/dist/umd/semi-ui.js.map +1 -1
  10. package/dist/umd/semi-ui.min.js +1 -1
  11. package/dist/umd/semi-ui.min.js.map +1 -1
  12. package/form/baseForm.tsx +0 -1
  13. package/lib/cjs/button/buttonGroup.js +5 -9
  14. package/lib/cjs/button/index.d.ts +1 -0
  15. package/lib/cjs/button/index.js +1 -0
  16. package/lib/cjs/checkbox/checkbox.js +18 -10
  17. package/lib/cjs/checkbox/checkboxGroup.js +10 -9
  18. package/lib/cjs/form/baseForm.d.ts +1 -1
  19. package/lib/cjs/form/baseForm.js +0 -1
  20. package/lib/cjs/form/field.d.ts +1 -1
  21. package/lib/cjs/popconfirm/index.d.ts +4 -2
  22. package/lib/cjs/popconfirm/index.js +49 -31
  23. package/lib/cjs/radio/radio.js +21 -13
  24. package/lib/cjs/radio/radioGroup.js +1 -1
  25. package/lib/cjs/tabs/TabBar.js +5 -1
  26. package/lib/cjs/transfer/index.js +7 -2
  27. package/lib/cjs/typography/title.d.ts +1 -1
  28. package/lib/es/button/buttonGroup.js +5 -8
  29. package/lib/es/button/index.d.ts +1 -0
  30. package/lib/es/button/index.js +1 -0
  31. package/lib/es/checkbox/checkbox.js +18 -10
  32. package/lib/es/checkbox/checkboxGroup.js +8 -7
  33. package/lib/es/form/baseForm.d.ts +1 -1
  34. package/lib/es/form/baseForm.js +0 -1
  35. package/lib/es/form/field.d.ts +1 -1
  36. package/lib/es/popconfirm/index.d.ts +4 -2
  37. package/lib/es/popconfirm/index.js +49 -31
  38. package/lib/es/radio/radio.js +21 -13
  39. package/lib/es/radio/radioGroup.js +1 -1
  40. package/lib/es/tabs/TabBar.js +5 -1
  41. package/lib/es/transfer/index.js +7 -2
  42. package/lib/es/typography/title.d.ts +1 -1
  43. package/package.json +7 -7
  44. package/popconfirm/_story/popconfirm.stories.js +37 -1
  45. package/popconfirm/index.tsx +14 -6
  46. package/radio/_story/radio.stories.js +5 -5
  47. package/radio/radio.tsx +20 -19
  48. package/radio/radioGroup.tsx +1 -1
  49. package/tabs/TabBar.tsx +7 -1
  50. package/transfer/index.tsx +7 -2
@@ -74,7 +74,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
74
74
  onListScroll?: (e: import("react").UIEvent<HTMLDivElement, UIEvent>) => void;
75
75
  children?: import("react").ReactNode;
76
76
  preventScroll?: boolean;
77
- } & 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
+ } & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
78
78
  declare const FormCheckboxGroup: import("react").ComponentType<import("utility-types").Subtract<import("../checkbox/checkboxGroup").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
79
79
  declare const FormCheckbox: import("react").ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox/checkbox").CheckboxProps & import("./interface").RCIncludeType>;
80
80
  declare const FormRadioGroup: import("react").ComponentType<import("utility-types").Subtract<import("../radio/radioGroup").RadioGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
@@ -27,13 +27,15 @@ export interface PopconfirmProps extends PopoverProps {
27
27
  zIndex?: number;
28
28
  trigger?: Trigger;
29
29
  position?: Position;
30
- onCancel?: (e: React.MouseEvent) => void;
31
- onConfirm?: (e: React.MouseEvent) => void;
30
+ onCancel?: (e: React.MouseEvent) => Promise<any> | void;
31
+ onConfirm?: (e: React.MouseEvent) => Promise<any> | void;
32
32
  onVisibleChange?: (visible: boolean) => void;
33
33
  onClickOutSide?: (e: React.MouseEvent) => void;
34
34
  }
35
35
  export interface PopconfirmState {
36
36
  visible: boolean;
37
+ cancelLoading: boolean;
38
+ confirmLoading: boolean;
37
39
  }
38
40
  export default class Popconfirm extends BaseComponent<PopconfirmProps, PopconfirmState> {
39
41
  static contextType: React.Context<ContextValue>;
@@ -44,6 +44,8 @@ export default class Popconfirm extends BaseComponent {
44
44
  this.stopImmediatePropagation = e => e && e.nativeEvent && e.nativeEvent.stopImmediatePropagation();
45
45
 
46
46
  this.state = {
47
+ cancelLoading: false,
48
+ confirmLoading: false,
47
49
  visible: props.defaultVisible || false
48
50
  };
49
51
  this.foundation = new PopconfirmFoundation(this.adapter);
@@ -67,6 +69,12 @@ export default class Popconfirm extends BaseComponent {
67
69
  setVisible: visible => this.setState({
68
70
  visible
69
71
  }),
72
+ updateConfirmLoading: loading => this.setState({
73
+ confirmLoading: loading
74
+ }),
75
+ updateCancelLoading: loading => this.setState({
76
+ cancelLoading: loading
77
+ }),
70
78
  notifyConfirm: e => this.props.onConfirm(e),
71
79
  notifyCancel: e => this.props.onCancel(e),
72
80
  notifyVisibleChange: visible => this.props.onVisibleChange(visible),
@@ -83,15 +91,21 @@ export default class Popconfirm extends BaseComponent {
83
91
  cancelButtonProps,
84
92
  okButtonProps
85
93
  } = this.props;
94
+ const {
95
+ cancelLoading,
96
+ confirmLoading
97
+ } = this.state;
86
98
  return /*#__PURE__*/React.createElement(LocaleConsumer, {
87
99
  componentName: "Popconfirm"
88
100
  }, (locale, localeCode) => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, _Object$assign({
89
101
  type: cancelType,
90
- onClick: this.handleCancel
102
+ onClick: this.handleCancel,
103
+ loading: cancelLoading
91
104
  }, cancelButtonProps), cancelText || _get(locale, 'cancel')), /*#__PURE__*/React.createElement(Button, _Object$assign({
92
105
  type: okType,
93
106
  theme: "solid",
94
- onClick: this.handleConfirm
107
+ onClick: this.handleConfirm,
108
+ loading: confirmLoading
95
109
  }, okButtonProps), okText || _get(locale, 'confirm'))));
96
110
  }
97
111
 
@@ -113,35 +127,39 @@ export default class Popconfirm extends BaseComponent {
113
127
  });
114
128
  const showTitle = title !== null && typeof title !== 'undefined';
115
129
  const showContent = content !== null || typeof content !== 'undefined';
116
- return /*#__PURE__*/React.createElement("div", {
117
- className: popCardCls,
118
- onClick: this.stopImmediatePropagation,
119
- style: style
120
- }, /*#__PURE__*/React.createElement("div", {
121
- className: "".concat(prefixCls, "-inner")
122
- }, /*#__PURE__*/React.createElement("div", {
123
- className: "".concat(prefixCls, "-header")
124
- }, /*#__PURE__*/React.createElement("i", {
125
- className: "".concat(prefixCls, "-header-icon"),
126
- "x-semi-prop": "icon"
127
- }, /*#__PURE__*/React.isValidElement(icon) ? icon : null), /*#__PURE__*/React.createElement("div", {
128
- className: "".concat(prefixCls, "-header-body")
129
- }, showTitle ? /*#__PURE__*/React.createElement("div", {
130
- className: "".concat(prefixCls, "-header-title"),
131
- "x-semi-prop": "title"
132
- }, title) : null, showContent ? /*#__PURE__*/React.createElement("div", {
133
- className: "".concat(prefixCls, "-header-content"),
134
- "x-semi-prop": "content"
135
- }, content) : null), /*#__PURE__*/React.createElement(Button, {
136
- className: "".concat(prefixCls, "-btn-close"),
137
- icon: /*#__PURE__*/React.createElement(IconClose, null),
138
- size: "small",
139
- theme: 'borderless',
140
- type: cancelType,
141
- onClick: this.handleCancel
142
- })), /*#__PURE__*/React.createElement("div", {
143
- className: "".concat(prefixCls, "-footer")
144
- }, this.renderControls())));
130
+ return (
131
+ /*#__PURE__*/
132
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
133
+ React.createElement("div", {
134
+ className: popCardCls,
135
+ onClick: this.stopImmediatePropagation,
136
+ style: style
137
+ }, /*#__PURE__*/React.createElement("div", {
138
+ className: "".concat(prefixCls, "-inner")
139
+ }, /*#__PURE__*/React.createElement("div", {
140
+ className: "".concat(prefixCls, "-header")
141
+ }, /*#__PURE__*/React.createElement("i", {
142
+ className: "".concat(prefixCls, "-header-icon"),
143
+ "x-semi-prop": "icon"
144
+ }, /*#__PURE__*/React.isValidElement(icon) ? icon : null), /*#__PURE__*/React.createElement("div", {
145
+ className: "".concat(prefixCls, "-header-body")
146
+ }, showTitle ? /*#__PURE__*/React.createElement("div", {
147
+ className: "".concat(prefixCls, "-header-title"),
148
+ "x-semi-prop": "title"
149
+ }, title) : null, showContent ? /*#__PURE__*/React.createElement("div", {
150
+ className: "".concat(prefixCls, "-header-content"),
151
+ "x-semi-prop": "content"
152
+ }, content) : null), /*#__PURE__*/React.createElement(Button, {
153
+ className: "".concat(prefixCls, "-btn-close"),
154
+ icon: /*#__PURE__*/React.createElement(IconClose, null),
155
+ size: "small",
156
+ theme: 'borderless',
157
+ type: cancelType,
158
+ onClick: this.handleCancel
159
+ })), /*#__PURE__*/React.createElement("div", {
160
+ className: "".concat(prefixCls, "-footer")
161
+ }, this.renderControls())))
162
+ );
145
163
  }
146
164
 
147
165
  render() {
@@ -203,16 +203,26 @@ class Radio extends BaseComponent {
203
203
  ["".concat(prefix, "-focus")]: focusVisible && isButtonRadio
204
204
  }, addonClassName);
205
205
 
206
- const renderContent = () => /*#__PURE__*/React.createElement(React.Fragment, null, children ? /*#__PURE__*/React.createElement("span", {
207
- className: addonCls,
208
- style: addonStyle,
209
- id: addonId,
210
- "x-semi-prop": "children"
211
- }, children) : null, extra && !isButtonRadio ? /*#__PURE__*/React.createElement("div", {
212
- className: "".concat(prefix, "-extra"),
213
- id: extraId,
214
- "x-semi-prop": "extra"
215
- }, extra) : null);
206
+ const renderContent = () => {
207
+ if (!children && !extra) {
208
+ return null;
209
+ }
210
+
211
+ return /*#__PURE__*/React.createElement("div", {
212
+ className: cls(["".concat(prefix, "-content"), {
213
+ ["".concat(prefix, "-isCardRadioGroup_content")]: isCardRadioGroup
214
+ }])
215
+ }, children ? /*#__PURE__*/React.createElement("span", {
216
+ className: addonCls,
217
+ style: addonStyle,
218
+ id: addonId,
219
+ "x-semi-prop": "children"
220
+ }, children) : null, extra && !isButtonRadio ? /*#__PURE__*/React.createElement("div", {
221
+ className: "".concat(prefix, "-extra"),
222
+ id: extraId,
223
+ "x-semi-prop": "extra"
224
+ }, extra) : null);
225
+ };
216
226
 
217
227
  return /*#__PURE__*/React.createElement("label", {
218
228
  style: style,
@@ -233,9 +243,7 @@ class Radio extends BaseComponent {
233
243
  focusInner: focusVisible && !focusOuter,
234
244
  onInputFocus: this.handleFocusVisible,
235
245
  onInputBlur: this.handleBlur
236
- })), isCardRadioGroup ? /*#__PURE__*/React.createElement("div", {
237
- className: "".concat(prefix, "-isCardRadioGroup_content")
238
- }, renderContent()) : renderContent());
246
+ })), renderContent());
239
247
  }
240
248
 
241
249
  }
@@ -22,7 +22,7 @@ class RadioGroup extends BaseComponent {
22
22
  this.getFormatName = () => this.props.name || 'default';
23
23
 
24
24
  this.state = {
25
- value: undefined
25
+ value: props.value || props.defaultValue
26
26
  };
27
27
  this.foundation = new RadioGroupFoundation(this.adapter);
28
28
  }
@@ -125,7 +125,11 @@ class TabBar extends React.Component {
125
125
  var _context5, _context6;
126
126
 
127
127
  if (_isEmpty(items)) {
128
- return null;
128
+ return /*#__PURE__*/React.createElement(Button, {
129
+ disabled: true,
130
+ icon: icon,
131
+ theme: "borderless"
132
+ });
129
133
  }
130
134
 
131
135
  const {
@@ -280,7 +280,8 @@ class Transfer extends BaseComponent {
280
280
  const noMatch = inSearchMode && searchResult.size === 0;
281
281
  const emptySearch = emptyContent.search ? emptyContent.search : locale.emptySearch;
282
282
  const emptyLeft = emptyContent.left ? emptyContent.left : locale.emptyLeft;
283
- const emptyCom = this.renderEmpty('left', inputValue ? emptySearch : emptyLeft);
283
+ const emptyDataCom = this.renderEmpty('left', emptyLeft);
284
+ const emptySearchCom = this.renderEmpty('left', emptySearch);
284
285
  const loadingCom = /*#__PURE__*/React.createElement(Spin, null);
285
286
  let content = null;
286
287
 
@@ -290,7 +291,11 @@ class Transfer extends BaseComponent {
290
291
  break;
291
292
 
292
293
  case noMatch:
293
- content = emptyCom;
294
+ content = emptySearchCom;
295
+ break;
296
+
297
+ case data.length === 0:
298
+ content = emptyDataCom;
294
299
  break;
295
300
 
296
301
  case type === strings.TYPE_TREE_TO_LIST:
@@ -37,7 +37,7 @@ export default class Title extends PureComponent<TitleProps> {
37
37
  underline: PropTypes.Requireable<boolean>;
38
38
  strong: PropTypes.Requireable<boolean>;
39
39
  type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
40
- heading: PropTypes.Requireable<1 | 2 | 3 | 4 | 5 | 6>;
40
+ heading: PropTypes.Requireable<4 | 2 | 1 | 3 | 5 | 6>;
41
41
  style: PropTypes.Requireable<object>;
42
42
  className: PropTypes.Requireable<string>;
43
43
  component: PropTypes.Requireable<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-ui",
3
- "version": "2.19.0-alpha.5",
3
+ "version": "2.19.0-alpha.8",
4
4
  "description": "",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es/index.js",
@@ -15,11 +15,11 @@
15
15
  "dependencies": {
16
16
  "@babel/runtime-corejs3": "^7.15.4",
17
17
  "@douyinfe/semi-animation": "2.12.0",
18
- "@douyinfe/semi-animation-react": "2.19.0-alpha.5",
19
- "@douyinfe/semi-foundation": "2.19.0-alpha.5",
20
- "@douyinfe/semi-icons": "2.19.0-alpha.5",
18
+ "@douyinfe/semi-animation-react": "2.19.0-alpha.8",
19
+ "@douyinfe/semi-foundation": "2.19.0-alpha.8",
20
+ "@douyinfe/semi-icons": "2.19.0-alpha.8",
21
21
  "@douyinfe/semi-illustrations": "2.15.0",
22
- "@douyinfe/semi-theme-default": "2.19.0-alpha.5",
22
+ "@douyinfe/semi-theme-default": "2.19.0-alpha.8",
23
23
  "async-validator": "^3.5.0",
24
24
  "classnames": "^2.2.6",
25
25
  "copy-text-to-clipboard": "^2.1.1",
@@ -66,13 +66,13 @@
66
66
  ],
67
67
  "author": "",
68
68
  "license": "MIT",
69
- "gitHead": "f49d77763d9cf17af15945bddd04557e57858b4b",
69
+ "gitHead": "fef0097c01c675980e383efb45f182a2a4f2a507",
70
70
  "devDependencies": {
71
71
  "@babel/plugin-proposal-decorators": "^7.15.8",
72
72
  "@babel/plugin-transform-runtime": "^7.15.8",
73
73
  "@babel/preset-env": "^7.15.8",
74
74
  "@babel/preset-react": "^7.14.5",
75
- "@douyinfe/semi-scss-compile": "2.19.0-alpha.5",
75
+ "@douyinfe/semi-scss-compile": "2.19.0-alpha.8",
76
76
  "@storybook/addon-knobs": "^6.3.1",
77
77
  "@types/lodash": "^4.14.176",
78
78
  "@types/react": ">=16.0.0",
@@ -167,4 +167,40 @@ export const ClickOutSideDemo = () => {
167
167
 
168
168
  ClickOutSideDemo.story = {
169
169
  name: 'ClickOutSideDemo',
170
- };
170
+ };
171
+
172
+ export const PromiseCallback = () => {
173
+ const onConfirm = () => {
174
+ return new Promise((resolve, reject) => {
175
+ setTimeout(() => {
176
+ console.log('ccc');
177
+ resolve(1);
178
+ }, 2000)
179
+ })
180
+ };
181
+
182
+ const onCancel = () => {
183
+ return new Promise((resolve, reject) => {
184
+ setTimeout(() => {
185
+ console.log('ccc');
186
+ reject(1);
187
+ }, 2000)
188
+ })
189
+ };
190
+
191
+ return (
192
+ <Popconfirm
193
+ title="确定是否要保存此修改?"
194
+ content="此修改将不可逆"
195
+ onConfirm={onConfirm}
196
+ onCancel={onCancel}
197
+ >
198
+ <Button>保存</Button>
199
+ </Popconfirm>
200
+ );
201
+ };
202
+
203
+ PromiseCallback.story = {
204
+ name: 'PromiseCallbackDemo',
205
+ };
206
+
@@ -35,14 +35,16 @@ export interface PopconfirmProps extends PopoverProps {
35
35
  zIndex?: number;
36
36
  trigger?: Trigger;
37
37
  position?: Position;
38
- onCancel?: (e: React.MouseEvent) => void;
39
- onConfirm?: (e: React.MouseEvent) => void;
38
+ onCancel?: (e: React.MouseEvent) => Promise<any> | void;
39
+ onConfirm?: (e: React.MouseEvent) => Promise<any> | void;
40
40
  onVisibleChange?: (visible: boolean) => void;
41
41
  onClickOutSide?: (e: React.MouseEvent) => void;
42
42
  }
43
43
 
44
44
  export interface PopconfirmState {
45
45
  visible: boolean;
46
+ cancelLoading: boolean;
47
+ confirmLoading: boolean;
46
48
  }
47
49
 
48
50
  interface PopProps {
@@ -99,6 +101,8 @@ export default class Popconfirm extends BaseComponent<PopconfirmProps, Popconfir
99
101
  super(props);
100
102
 
101
103
  this.state = {
104
+ cancelLoading: false,
105
+ confirmLoading: false,
102
106
  visible: props.defaultVisible || false,
103
107
  };
104
108
 
@@ -122,8 +126,10 @@ export default class Popconfirm extends BaseComponent<PopconfirmProps, Popconfir
122
126
  return {
123
127
  ...super.adapter,
124
128
  setVisible: (visible: boolean): void => this.setState({ visible }),
125
- notifyConfirm: (e: React.MouseEvent): void => this.props.onConfirm(e),
126
- notifyCancel: (e: React.MouseEvent): void => this.props.onCancel(e),
129
+ updateConfirmLoading: (loading: boolean): void => this.setState({ confirmLoading: loading }),
130
+ updateCancelLoading: (loading: boolean): void => this.setState({ cancelLoading: loading }),
131
+ notifyConfirm: (e: React.MouseEvent): Promise<any> | void => this.props.onConfirm(e),
132
+ notifyCancel: (e: React.MouseEvent): Promise<any> | void => this.props.onCancel(e),
127
133
  notifyVisibleChange: (visible: boolean): void => this.props.onVisibleChange(visible),
128
134
  notifyClickOutSide: (e: React.MouseEvent) => this.props.onClickOutSide(e),
129
135
  };
@@ -141,14 +147,15 @@ export default class Popconfirm extends BaseComponent<PopconfirmProps, Popconfir
141
147
 
142
148
  renderControls() {
143
149
  const { okText, cancelText, okType, cancelType, cancelButtonProps, okButtonProps } = this.props;
150
+ const { cancelLoading, confirmLoading } = this.state;
144
151
  return (
145
152
  <LocaleConsumer componentName="Popconfirm">
146
153
  {(locale: LocaleObject['Popconfirm'], localeCode: string) => (
147
154
  <>
148
- <Button type={cancelType} onClick={this.handleCancel} {...cancelButtonProps}>
155
+ <Button type={cancelType} onClick={this.handleCancel} loading={cancelLoading} {...cancelButtonProps}>
149
156
  {cancelText || get(locale, 'cancel')}
150
157
  </Button>
151
- <Button type={okType} theme="solid" onClick={this.handleConfirm} {...okButtonProps}>
158
+ <Button type={okType} theme="solid" onClick={this.handleConfirm} loading={confirmLoading} {...okButtonProps}>
152
159
  {okText || get(locale, 'confirm')}
153
160
  </Button>
154
161
  </>
@@ -171,6 +178,7 @@ export default class Popconfirm extends BaseComponent<PopconfirmProps, Popconfir
171
178
  const showContent = content !== null || typeof content !== 'undefined';
172
179
 
173
180
  return (
181
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
174
182
  <div className={popCardCls} onClick={this.stopImmediatePropagation} style={style}>
175
183
  <div className={`${prefixCls}-inner`}>
176
184
  <div className={`${prefixCls}-header`}>
@@ -254,18 +254,18 @@ _RadioGroup.story = {
254
254
 
255
255
  export const RadioWithVertical = () => {
256
256
  return (
257
- <Radio.Group>
258
- <Radio value="A" displayMode="vertical">
257
+ <Radio.Group direction="vertical">
258
+ <Radio value="A">
259
259
  无限长的一串字The Storybook webapp UI can be customised with this addon. It can be used to
260
260
  change the header, show/hide various UI elements and to enable full-screen mode by default.
261
261
  </Radio>
262
- <Radio value="C" displayMode="vertical">
262
+ <Radio value="C">
263
263
  C
264
264
  </Radio>
265
- <Radio value="D" displayMode="vertical">
265
+ <Radio value="D">
266
266
  D
267
267
  </Radio>
268
- <Radio value="E" displayMode="vertical">
268
+ <Radio value="E">
269
269
  E
270
270
  </Radio>
271
271
  </Radio.Group>
package/radio/radio.tsx CHANGED
@@ -268,20 +268,25 @@ class Radio extends BaseComponent<RadioProps, RadioState> {
268
268
  [`${prefix}-addon-buttonRadio-${buttonSize}`]: isButtonRadio && buttonSize,
269
269
  [`${prefix}-focus`]: focusVisible && isButtonRadio,
270
270
  }, addonClassName);
271
- const renderContent = () => (
272
- <>
273
- {children ? (
274
- <span className={addonCls} style={addonStyle} id={addonId} x-semi-prop="children">
275
- {children}
276
- </span>
277
- ) : null}
278
- {extra && !isButtonRadio ? (
279
- <div className={`${prefix}-extra`} id={extraId} x-semi-prop="extra">
280
- {extra}
281
- </div>
282
- ) : null}
283
- </>
284
- );
271
+ const renderContent = () => {
272
+ if (!children && !extra) {
273
+ return null;
274
+ }
275
+ return (
276
+ <div className={cls([`${prefix}-content`, { [`${prefix}-isCardRadioGroup_content`]: isCardRadioGroup }])}>
277
+ {children ? (
278
+ <span className={addonCls} style={addonStyle} id={addonId} x-semi-prop="children">
279
+ {children}
280
+ </span>
281
+ ) : null}
282
+ {extra && !isButtonRadio ? (
283
+ <div className={`${prefix}-extra`} id={extraId} x-semi-prop="extra">
284
+ {extra}
285
+ </div>
286
+ ) : null}
287
+ </div>
288
+ );
289
+ };
285
290
 
286
291
  return (
287
292
  <label
@@ -307,11 +312,7 @@ class Radio extends BaseComponent<RadioProps, RadioState> {
307
312
  onInputFocus={this.handleFocusVisible}
308
313
  onInputBlur={this.handleBlur}
309
314
  />
310
- {
311
- isCardRadioGroup ?
312
- <div className={`${prefix}-isCardRadioGroup_content`}>{renderContent()}</div> :
313
- renderContent()
314
- }
315
+ {renderContent()}
315
316
  </label>
316
317
  );
317
318
  }
@@ -88,7 +88,7 @@ class RadioGroup extends BaseComponent<RadioGroupProps, RadioGroupState> {
88
88
  constructor(props: RadioGroupProps) {
89
89
  super(props);
90
90
  this.state = {
91
- value: undefined,
91
+ value: props.value || props.defaultValue,
92
92
  };
93
93
  this.foundation = new RadioGroupFoundation(this.adapter);
94
94
  }
package/tabs/TabBar.tsx CHANGED
@@ -147,7 +147,13 @@ class TabBar extends React.Component<TabBarProps, TabBarState> {
147
147
 
148
148
  renderCollapse = (items: Array<OverflowItem>, icon: ReactNode, pos: 'start' | 'end'): ReactNode => {
149
149
  if (isEmpty(items)) {
150
- return null;
150
+ return (
151
+ <Button
152
+ disabled={true}
153
+ icon={icon}
154
+ theme="borderless"
155
+ />
156
+ );
151
157
  }
152
158
  const { dropdownClassName, dropdownStyle } = this.props;
153
159
  const { rePosKey } = this.state;
@@ -393,7 +393,9 @@ class Transfer extends BaseComponent<TransferProps, TransferState> {
393
393
  const noMatch = inSearchMode && searchResult.size === 0;
394
394
  const emptySearch = emptyContent.search ? emptyContent.search : locale.emptySearch;
395
395
  const emptyLeft = emptyContent.left ? emptyContent.left : locale.emptyLeft;
396
- const emptyCom = this.renderEmpty('left', inputValue ? emptySearch : emptyLeft);
396
+ const emptyDataCom = this.renderEmpty('left', emptyLeft);
397
+ const emptySearchCom = this.renderEmpty('left', emptySearch);
398
+
397
399
  const loadingCom = <Spin />;
398
400
 
399
401
  let content: React.ReactNode = null;
@@ -402,7 +404,10 @@ class Transfer extends BaseComponent<TransferProps, TransferState> {
402
404
  content = loadingCom;
403
405
  break;
404
406
  case noMatch:
405
- content = emptyCom;
407
+ content = emptySearchCom;
408
+ break;
409
+ case data.length === 0:
410
+ content = emptyDataCom;
406
411
  break;
407
412
  case type === strings.TYPE_TREE_TO_LIST:
408
413
  content = (