@douyinfe/semi-ui 2.19.0-alpha.3 → 2.19.0-alpha.6

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 (38) hide show
  1. package/checkbox/checkbox.tsx +7 -7
  2. package/dist/css/semi.css +25 -91
  3. package/dist/css/semi.min.css +1 -1
  4. package/dist/umd/semi-ui.js +72 -121
  5. package/dist/umd/semi-ui.js.map +1 -1
  6. package/dist/umd/semi-ui.min.js +1 -1
  7. package/dist/umd/semi-ui.min.js.map +1 -1
  8. package/form/baseForm.tsx +1 -0
  9. package/lib/cjs/checkbox/checkbox.js +2 -8
  10. package/lib/cjs/form/baseForm.d.ts +1 -1
  11. package/lib/cjs/form/baseForm.js +1 -0
  12. package/lib/cjs/form/field.d.ts +1 -1
  13. package/lib/cjs/popconfirm/index.d.ts +2 -4
  14. package/lib/cjs/popconfirm/index.js +31 -49
  15. package/lib/cjs/radio/radio.js +21 -13
  16. package/lib/cjs/radio/radioGroup.js +1 -1
  17. package/lib/cjs/tabs/TabBar.js +1 -5
  18. package/lib/cjs/transfer/index.js +2 -7
  19. package/lib/cjs/typography/title.d.ts +1 -1
  20. package/lib/es/checkbox/checkbox.js +2 -8
  21. package/lib/es/form/baseForm.d.ts +1 -1
  22. package/lib/es/form/baseForm.js +1 -0
  23. package/lib/es/form/field.d.ts +1 -1
  24. package/lib/es/popconfirm/index.d.ts +2 -4
  25. package/lib/es/popconfirm/index.js +31 -49
  26. package/lib/es/radio/radio.js +21 -13
  27. package/lib/es/radio/radioGroup.js +1 -1
  28. package/lib/es/tabs/TabBar.js +1 -5
  29. package/lib/es/transfer/index.js +2 -7
  30. package/lib/es/typography/title.d.ts +1 -1
  31. package/package.json +7 -7
  32. package/popconfirm/_story/popconfirm.stories.js +1 -37
  33. package/popconfirm/index.tsx +6 -14
  34. package/radio/_story/radio.stories.js +5 -5
  35. package/radio/radio.tsx +20 -19
  36. package/radio/radioGroup.tsx +1 -1
  37. package/tabs/TabBar.tsx +1 -7
  38. package/transfer/index.tsx +2 -7
package/form/baseForm.tsx CHANGED
@@ -151,6 +151,7 @@ class Form extends BaseComponent<BaseFormProps, BaseFormState> {
151
151
 
152
152
  componentWillUnmount() {
153
153
  this.foundation.destroy();
154
+ this.formApi = null;
154
155
  }
155
156
 
156
157
  get adapter(): BaseFormAdapter<BaseFormProps, BaseFormState> {
@@ -211,13 +211,7 @@ class Checkbox extends _baseComponent.default {
211
211
  const name = inGroup && this.context.checkboxGroup.name;
212
212
  const xSemiPropChildren = this.props['x-semi-children-alias'] || 'children';
213
213
 
214
- if (!children && !extra) {
215
- return null;
216
- }
217
-
218
- const renderContent = () => /*#__PURE__*/_react.default.createElement("div", {
219
- className: "".concat(prefix, "-content")
220
- }, children ? /*#__PURE__*/_react.default.createElement("span", {
214
+ const renderContent = () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children ? /*#__PURE__*/_react.default.createElement("span", {
221
215
  id: addonId,
222
216
  className: "".concat(prefix, "-addon"),
223
217
  "x-semi-prop": xSemiPropChildren
@@ -251,7 +245,7 @@ class Checkbox extends _baseComponent.default {
251
245
  focusInner: focusVisible && !focusOuter,
252
246
  onInputFocus: this.handleFocusVisible,
253
247
  onInputBlur: this.handleBlur
254
- })), renderContent())
248
+ })), props.isCardType ? /*#__PURE__*/_react.default.createElement("div", null, renderContent()) : renderContent())
255
249
  );
256
250
  }
257
251
 
@@ -126,7 +126,7 @@ declare class Form extends BaseComponent<BaseFormProps, BaseFormState> {
126
126
  onListScroll?: (e: React.UIEvent<HTMLDivElement, UIEvent>) => void;
127
127
  children?: React.ReactNode;
128
128
  preventScroll?: boolean;
129
- } & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
129
+ } & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
130
130
  static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
131
131
  static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & React.RefAttributes<any>>;
132
132
  static Radio: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../radio").RadioProps & import("./interface").RCIncludeType>;
@@ -106,6 +106,7 @@ class Form extends _baseComponent.default {
106
106
 
107
107
  componentWillUnmount() {
108
108
  this.foundation.destroy();
109
+ this.formApi = null;
109
110
  }
110
111
 
111
112
  get adapter() {
@@ -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, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
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;
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,15 +27,13 @@ export interface PopconfirmProps extends PopoverProps {
27
27
  zIndex?: number;
28
28
  trigger?: Trigger;
29
29
  position?: Position;
30
- onCancel?: (e: React.MouseEvent) => Promise<any> | void;
31
- onConfirm?: (e: React.MouseEvent) => Promise<any> | void;
30
+ onCancel?: (e: React.MouseEvent) => void;
31
+ onConfirm?: (e: React.MouseEvent) => 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;
39
37
  }
40
38
  export default class Popconfirm extends BaseComponent<PopconfirmProps, PopconfirmState> {
41
39
  static contextType: React.Context<ContextValue>;
@@ -72,8 +72,6 @@ class Popconfirm extends _baseComponent.default {
72
72
  this.stopImmediatePropagation = e => e && e.nativeEvent && e.nativeEvent.stopImmediatePropagation();
73
73
 
74
74
  this.state = {
75
- cancelLoading: false,
76
- confirmLoading: false,
77
75
  visible: props.defaultVisible || false
78
76
  };
79
77
  this.foundation = new _popconfirmFoundation.default(this.adapter);
@@ -97,12 +95,6 @@ class Popconfirm extends _baseComponent.default {
97
95
  setVisible: visible => this.setState({
98
96
  visible
99
97
  }),
100
- updateConfirmLoading: loading => this.setState({
101
- confirmLoading: loading
102
- }),
103
- updateCancelLoading: loading => this.setState({
104
- cancelLoading: loading
105
- }),
106
98
  notifyConfirm: e => this.props.onConfirm(e),
107
99
  notifyCancel: e => this.props.onCancel(e),
108
100
  notifyVisibleChange: visible => this.props.onVisibleChange(visible),
@@ -119,21 +111,15 @@ class Popconfirm extends _baseComponent.default {
119
111
  cancelButtonProps,
120
112
  okButtonProps
121
113
  } = this.props;
122
- const {
123
- cancelLoading,
124
- confirmLoading
125
- } = this.state;
126
114
  return /*#__PURE__*/_react.default.createElement(_localeConsumer.default, {
127
115
  componentName: "Popconfirm"
128
116
  }, (locale, localeCode) => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_button.default, (0, _assign.default)({
129
117
  type: cancelType,
130
- onClick: this.handleCancel,
131
- loading: cancelLoading
118
+ onClick: this.handleCancel
132
119
  }, cancelButtonProps), cancelText || (0, _get2.default)(locale, 'cancel')), /*#__PURE__*/_react.default.createElement(_button.default, (0, _assign.default)({
133
120
  type: okType,
134
121
  theme: "solid",
135
- onClick: this.handleConfirm,
136
- loading: confirmLoading
122
+ onClick: this.handleConfirm
137
123
  }, okButtonProps), okText || (0, _get2.default)(locale, 'confirm'))));
138
124
  }
139
125
 
@@ -155,39 +141,35 @@ class Popconfirm extends _baseComponent.default {
155
141
  });
156
142
  const showTitle = title !== null && typeof title !== 'undefined';
157
143
  const showContent = content !== null || typeof content !== 'undefined';
158
- return (
159
- /*#__PURE__*/
160
- // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
161
- _react.default.createElement("div", {
162
- className: popCardCls,
163
- onClick: this.stopImmediatePropagation,
164
- style: style
165
- }, /*#__PURE__*/_react.default.createElement("div", {
166
- className: "".concat(prefixCls, "-inner")
167
- }, /*#__PURE__*/_react.default.createElement("div", {
168
- className: "".concat(prefixCls, "-header")
169
- }, /*#__PURE__*/_react.default.createElement("i", {
170
- className: "".concat(prefixCls, "-header-icon"),
171
- "x-semi-prop": "icon"
172
- }, /*#__PURE__*/_react.default.isValidElement(icon) ? icon : null), /*#__PURE__*/_react.default.createElement("div", {
173
- className: "".concat(prefixCls, "-header-body")
174
- }, showTitle ? /*#__PURE__*/_react.default.createElement("div", {
175
- className: "".concat(prefixCls, "-header-title"),
176
- "x-semi-prop": "title"
177
- }, title) : null, showContent ? /*#__PURE__*/_react.default.createElement("div", {
178
- className: "".concat(prefixCls, "-header-content"),
179
- "x-semi-prop": "content"
180
- }, content) : null), /*#__PURE__*/_react.default.createElement(_button.default, {
181
- className: "".concat(prefixCls, "-btn-close"),
182
- icon: /*#__PURE__*/_react.default.createElement(_semiIcons.IconClose, null),
183
- size: "small",
184
- theme: 'borderless',
185
- type: cancelType,
186
- onClick: this.handleCancel
187
- })), /*#__PURE__*/_react.default.createElement("div", {
188
- className: "".concat(prefixCls, "-footer")
189
- }, this.renderControls())))
190
- );
144
+ return /*#__PURE__*/_react.default.createElement("div", {
145
+ className: popCardCls,
146
+ onClick: this.stopImmediatePropagation,
147
+ style: style
148
+ }, /*#__PURE__*/_react.default.createElement("div", {
149
+ className: "".concat(prefixCls, "-inner")
150
+ }, /*#__PURE__*/_react.default.createElement("div", {
151
+ className: "".concat(prefixCls, "-header")
152
+ }, /*#__PURE__*/_react.default.createElement("i", {
153
+ className: "".concat(prefixCls, "-header-icon"),
154
+ "x-semi-prop": "icon"
155
+ }, /*#__PURE__*/_react.default.isValidElement(icon) ? icon : null), /*#__PURE__*/_react.default.createElement("div", {
156
+ className: "".concat(prefixCls, "-header-body")
157
+ }, showTitle ? /*#__PURE__*/_react.default.createElement("div", {
158
+ className: "".concat(prefixCls, "-header-title"),
159
+ "x-semi-prop": "title"
160
+ }, title) : null, showContent ? /*#__PURE__*/_react.default.createElement("div", {
161
+ className: "".concat(prefixCls, "-header-content"),
162
+ "x-semi-prop": "content"
163
+ }, content) : null), /*#__PURE__*/_react.default.createElement(_button.default, {
164
+ className: "".concat(prefixCls, "-btn-close"),
165
+ icon: /*#__PURE__*/_react.default.createElement(_semiIcons.IconClose, null),
166
+ size: "small",
167
+ theme: 'borderless',
168
+ type: cancelType,
169
+ onClick: this.handleCancel
170
+ })), /*#__PURE__*/_react.default.createElement("div", {
171
+ className: "".concat(prefixCls, "-footer")
172
+ }, this.renderControls())));
191
173
  }
192
174
 
193
175
  render() {
@@ -228,16 +228,26 @@ class Radio extends _baseComponent.default {
228
228
  ["".concat(prefix, "-focus")]: focusVisible && isButtonRadio
229
229
  }, addonClassName);
230
230
 
231
- const renderContent = () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children ? /*#__PURE__*/_react.default.createElement("span", {
232
- className: addonCls,
233
- style: addonStyle,
234
- id: addonId,
235
- "x-semi-prop": "children"
236
- }, children) : null, extra && !isButtonRadio ? /*#__PURE__*/_react.default.createElement("div", {
237
- className: "".concat(prefix, "-extra"),
238
- id: extraId,
239
- "x-semi-prop": "extra"
240
- }, extra) : null);
231
+ const renderContent = () => {
232
+ if (!children && !extra) {
233
+ return null;
234
+ }
235
+
236
+ return /*#__PURE__*/_react.default.createElement("div", {
237
+ className: (0, _classnames.default)(["".concat(prefix, "-content"), {
238
+ ["".concat(prefix, "-isCardRadioGroup_content")]: isCardRadioGroup
239
+ }])
240
+ }, children ? /*#__PURE__*/_react.default.createElement("span", {
241
+ className: addonCls,
242
+ style: addonStyle,
243
+ id: addonId,
244
+ "x-semi-prop": "children"
245
+ }, children) : null, extra && !isButtonRadio ? /*#__PURE__*/_react.default.createElement("div", {
246
+ className: "".concat(prefix, "-extra"),
247
+ id: extraId,
248
+ "x-semi-prop": "extra"
249
+ }, extra) : null);
250
+ };
241
251
 
242
252
  return /*#__PURE__*/_react.default.createElement("label", {
243
253
  style: style,
@@ -258,9 +268,7 @@ class Radio extends _baseComponent.default {
258
268
  focusInner: focusVisible && !focusOuter,
259
269
  onInputFocus: this.handleFocusVisible,
260
270
  onInputBlur: this.handleBlur
261
- })), isCardRadioGroup ? /*#__PURE__*/_react.default.createElement("div", {
262
- className: "".concat(prefix, "-isCardRadioGroup_content")
263
- }, renderContent()) : renderContent());
271
+ })), renderContent());
264
272
  }
265
273
 
266
274
  }
@@ -45,7 +45,7 @@ class RadioGroup extends _baseComponent.default {
45
45
  this.getFormatName = () => this.props.name || 'default';
46
46
 
47
47
  this.state = {
48
- value: undefined
48
+ value: props.value || props.defaultValue
49
49
  };
50
50
  this.foundation = new _radioGroupFoundation.default(this.adapter);
51
51
  }
@@ -151,11 +151,7 @@ class TabBar extends _react.default.Component {
151
151
  var _context5, _context6;
152
152
 
153
153
  if ((0, _isEmpty2.default)(items)) {
154
- return /*#__PURE__*/_react.default.createElement(_button.default, {
155
- disabled: true,
156
- icon: icon,
157
- theme: "borderless"
158
- });
154
+ return null;
159
155
  }
160
156
 
161
157
  const {
@@ -322,8 +322,7 @@ class Transfer extends _baseComponent.default {
322
322
  const noMatch = inSearchMode && searchResult.size === 0;
323
323
  const emptySearch = emptyContent.search ? emptyContent.search : locale.emptySearch;
324
324
  const emptyLeft = emptyContent.left ? emptyContent.left : locale.emptyLeft;
325
- const emptyDataCom = this.renderEmpty('left', emptyLeft);
326
- const emptySearchCom = this.renderEmpty('left', emptySearch);
325
+ const emptyCom = this.renderEmpty('left', inputValue ? emptySearch : emptyLeft);
327
326
 
328
327
  const loadingCom = /*#__PURE__*/_react.default.createElement(_spin.default, null);
329
328
 
@@ -335,11 +334,7 @@ class Transfer extends _baseComponent.default {
335
334
  break;
336
335
 
337
336
  case noMatch:
338
- content = emptySearchCom;
339
- break;
340
-
341
- case data.length === 0:
342
- content = emptyDataCom;
337
+ content = emptyCom;
343
338
  break;
344
339
 
345
340
  case type === _constants.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<4 | 2 | 1 | 3 | 5 | 6>;
40
+ heading: PropTypes.Requireable<1 | 2 | 3 | 4 | 5 | 6>;
41
41
  style: PropTypes.Requireable<object>;
42
42
  className: PropTypes.Requireable<string>;
43
43
  component: PropTypes.Requireable<string>;
@@ -187,13 +187,7 @@ class Checkbox extends BaseComponent {
187
187
  const name = inGroup && this.context.checkboxGroup.name;
188
188
  const xSemiPropChildren = this.props['x-semi-children-alias'] || 'children';
189
189
 
190
- if (!children && !extra) {
191
- return null;
192
- }
193
-
194
- const renderContent = () => /*#__PURE__*/React.createElement("div", {
195
- className: "".concat(prefix, "-content")
196
- }, children ? /*#__PURE__*/React.createElement("span", {
190
+ const renderContent = () => /*#__PURE__*/React.createElement(React.Fragment, null, children ? /*#__PURE__*/React.createElement("span", {
197
191
  id: addonId,
198
192
  className: "".concat(prefix, "-addon"),
199
193
  "x-semi-prop": xSemiPropChildren
@@ -227,7 +221,7 @@ class Checkbox extends BaseComponent {
227
221
  focusInner: focusVisible && !focusOuter,
228
222
  onInputFocus: this.handleFocusVisible,
229
223
  onInputBlur: this.handleBlur
230
- })), renderContent())
224
+ })), props.isCardType ? /*#__PURE__*/React.createElement("div", null, renderContent()) : renderContent())
231
225
  );
232
226
  }
233
227
 
@@ -126,7 +126,7 @@ declare class Form extends BaseComponent<BaseFormProps, BaseFormState> {
126
126
  onListScroll?: (e: React.UIEvent<HTMLDivElement, UIEvent>) => void;
127
127
  children?: React.ReactNode;
128
128
  preventScroll?: boolean;
129
- } & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
129
+ } & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
130
130
  static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
131
131
  static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & React.RefAttributes<any>>;
132
132
  static Radio: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../radio").RadioProps & import("./interface").RCIncludeType>;
@@ -68,6 +68,7 @@ class Form extends BaseComponent {
68
68
 
69
69
  componentWillUnmount() {
70
70
  this.foundation.destroy();
71
+ this.formApi = null;
71
72
  }
72
73
 
73
74
  get adapter() {
@@ -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, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
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;
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,15 +27,13 @@ export interface PopconfirmProps extends PopoverProps {
27
27
  zIndex?: number;
28
28
  trigger?: Trigger;
29
29
  position?: Position;
30
- onCancel?: (e: React.MouseEvent) => Promise<any> | void;
31
- onConfirm?: (e: React.MouseEvent) => Promise<any> | void;
30
+ onCancel?: (e: React.MouseEvent) => void;
31
+ onConfirm?: (e: React.MouseEvent) => 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;
39
37
  }
40
38
  export default class Popconfirm extends BaseComponent<PopconfirmProps, PopconfirmState> {
41
39
  static contextType: React.Context<ContextValue>;
@@ -44,8 +44,6 @@ 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,
49
47
  visible: props.defaultVisible || false
50
48
  };
51
49
  this.foundation = new PopconfirmFoundation(this.adapter);
@@ -69,12 +67,6 @@ export default class Popconfirm extends BaseComponent {
69
67
  setVisible: visible => this.setState({
70
68
  visible
71
69
  }),
72
- updateConfirmLoading: loading => this.setState({
73
- confirmLoading: loading
74
- }),
75
- updateCancelLoading: loading => this.setState({
76
- cancelLoading: loading
77
- }),
78
70
  notifyConfirm: e => this.props.onConfirm(e),
79
71
  notifyCancel: e => this.props.onCancel(e),
80
72
  notifyVisibleChange: visible => this.props.onVisibleChange(visible),
@@ -91,21 +83,15 @@ export default class Popconfirm extends BaseComponent {
91
83
  cancelButtonProps,
92
84
  okButtonProps
93
85
  } = this.props;
94
- const {
95
- cancelLoading,
96
- confirmLoading
97
- } = this.state;
98
86
  return /*#__PURE__*/React.createElement(LocaleConsumer, {
99
87
  componentName: "Popconfirm"
100
88
  }, (locale, localeCode) => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, _Object$assign({
101
89
  type: cancelType,
102
- onClick: this.handleCancel,
103
- loading: cancelLoading
90
+ onClick: this.handleCancel
104
91
  }, cancelButtonProps), cancelText || _get(locale, 'cancel')), /*#__PURE__*/React.createElement(Button, _Object$assign({
105
92
  type: okType,
106
93
  theme: "solid",
107
- onClick: this.handleConfirm,
108
- loading: confirmLoading
94
+ onClick: this.handleConfirm
109
95
  }, okButtonProps), okText || _get(locale, 'confirm'))));
110
96
  }
111
97
 
@@ -127,39 +113,35 @@ export default class Popconfirm extends BaseComponent {
127
113
  });
128
114
  const showTitle = title !== null && typeof title !== 'undefined';
129
115
  const showContent = content !== null || typeof content !== 'undefined';
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
- );
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())));
163
145
  }
164
146
 
165
147
  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,11 +125,7 @@ class TabBar extends React.Component {
125
125
  var _context5, _context6;
126
126
 
127
127
  if (_isEmpty(items)) {
128
- return /*#__PURE__*/React.createElement(Button, {
129
- disabled: true,
130
- icon: icon,
131
- theme: "borderless"
132
- });
128
+ return null;
133
129
  }
134
130
 
135
131
  const {
@@ -280,8 +280,7 @@ 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 emptyDataCom = this.renderEmpty('left', emptyLeft);
284
- const emptySearchCom = this.renderEmpty('left', emptySearch);
283
+ const emptyCom = this.renderEmpty('left', inputValue ? emptySearch : emptyLeft);
285
284
  const loadingCom = /*#__PURE__*/React.createElement(Spin, null);
286
285
  let content = null;
287
286
 
@@ -291,11 +290,7 @@ class Transfer extends BaseComponent {
291
290
  break;
292
291
 
293
292
  case noMatch:
294
- content = emptySearchCom;
295
- break;
296
-
297
- case data.length === 0:
298
- content = emptyDataCom;
293
+ content = emptyCom;
299
294
  break;
300
295
 
301
296
  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<4 | 2 | 1 | 3 | 5 | 6>;
40
+ heading: PropTypes.Requireable<1 | 2 | 3 | 4 | 5 | 6>;
41
41
  style: PropTypes.Requireable<object>;
42
42
  className: PropTypes.Requireable<string>;
43
43
  component: PropTypes.Requireable<string>;