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

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 (56) hide show
  1. package/button/buttonGroup.tsx +38 -4
  2. package/button/index.tsx +2 -0
  3. package/dist/css/semi.css +40 -3
  4. package/dist/css/semi.min.css +1 -1
  5. package/dist/umd/semi-ui.js +150 -51
  6. package/dist/umd/semi-ui.js.map +1 -1
  7. package/dist/umd/semi-ui.min.js +1 -1
  8. package/dist/umd/semi-ui.min.js.map +1 -1
  9. package/form/baseForm.tsx +0 -1
  10. package/lib/cjs/button/buttonGroup.d.ts +1 -0
  11. package/lib/cjs/button/buttonGroup.js +52 -3
  12. package/lib/cjs/button/index.d.ts +1 -0
  13. package/lib/cjs/button/index.js +1 -0
  14. package/lib/cjs/carousel/CarouselIndicator.d.ts +1 -1
  15. package/lib/cjs/carousel/index.d.ts +1 -1
  16. package/lib/cjs/datePicker/dateInput.d.ts +1 -1
  17. package/lib/cjs/datePicker/datePicker.d.ts +1 -1
  18. package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
  19. package/lib/cjs/form/baseForm.js +0 -1
  20. package/lib/cjs/popconfirm/index.d.ts +4 -2
  21. package/lib/cjs/popconfirm/index.js +49 -31
  22. package/lib/cjs/radio/radio.d.ts +1 -1
  23. package/lib/cjs/radio/radioGroup.d.ts +1 -1
  24. package/lib/cjs/tabs/TabBar.js +5 -1
  25. package/lib/cjs/timePicker/TimePicker.d.ts +2 -2
  26. package/lib/cjs/timePicker/TimeShape.d.ts +1 -1
  27. package/lib/cjs/timePicker/index.d.ts +2 -2
  28. package/lib/cjs/transfer/index.js +7 -2
  29. package/lib/cjs/typography/title.d.ts +1 -1
  30. package/lib/cjs/upload/index.d.ts +1 -1
  31. package/lib/es/button/buttonGroup.d.ts +1 -0
  32. package/lib/es/button/buttonGroup.js +50 -3
  33. package/lib/es/button/index.d.ts +1 -0
  34. package/lib/es/button/index.js +1 -0
  35. package/lib/es/carousel/CarouselIndicator.d.ts +1 -1
  36. package/lib/es/carousel/index.d.ts +1 -1
  37. package/lib/es/datePicker/dateInput.d.ts +1 -1
  38. package/lib/es/datePicker/datePicker.d.ts +1 -1
  39. package/lib/es/datePicker/monthsGrid.d.ts +1 -1
  40. package/lib/es/form/baseForm.js +0 -1
  41. package/lib/es/popconfirm/index.d.ts +4 -2
  42. package/lib/es/popconfirm/index.js +49 -31
  43. package/lib/es/radio/radio.d.ts +1 -1
  44. package/lib/es/radio/radioGroup.d.ts +1 -1
  45. package/lib/es/tabs/TabBar.js +5 -1
  46. package/lib/es/timePicker/TimePicker.d.ts +2 -2
  47. package/lib/es/timePicker/TimeShape.d.ts +1 -1
  48. package/lib/es/timePicker/index.d.ts +2 -2
  49. package/lib/es/transfer/index.js +7 -2
  50. package/lib/es/typography/title.d.ts +1 -1
  51. package/lib/es/upload/index.d.ts +1 -1
  52. package/package.json +7 -7
  53. package/popconfirm/_story/popconfirm.stories.js +37 -1
  54. package/popconfirm/index.tsx +14 -6
  55. package/tabs/TabBar.tsx +7 -1
  56. package/transfer/index.tsx +7 -2
@@ -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() {
@@ -81,7 +81,7 @@ declare class Radio extends BaseComponent<RadioProps, RadioState> {
81
81
  prefixCls?: string;
82
82
  name?: string;
83
83
  onChange?: (e: RadioChangeEvent) => void;
84
- buttonSize?: "small" | "middle" | "large";
84
+ buttonSize?: "small" | "large" | "middle";
85
85
  isCardRadio?: boolean;
86
86
  isPureCardRadio?: boolean;
87
87
  };
@@ -48,7 +48,7 @@ declare class RadioGroup extends BaseComponent<RadioGroupProps, RadioGroupState>
48
48
  disabled: PropTypes.Requireable<boolean>;
49
49
  name: PropTypes.Requireable<string>;
50
50
  options: PropTypes.Requireable<any[]>;
51
- buttonSize: PropTypes.Requireable<"small" | "middle" | "large">;
51
+ buttonSize: PropTypes.Requireable<"small" | "large" | "middle">;
52
52
  type: PropTypes.Requireable<"default" | "button" | "card" | "pureCard">;
53
53
  value: PropTypes.Requireable<any>;
54
54
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
@@ -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 {
@@ -99,11 +99,11 @@ export default class TimePicker extends BaseComponent<TimePickerProps, TimePicke
99
99
  'aria-required': PropTypes.Requireable<boolean>;
100
100
  prefixCls: PropTypes.Requireable<string>;
101
101
  clearText: PropTypes.Requireable<string>;
102
- value: PropTypes.Requireable<string | number | string[] | number[] | Date | Date[]>;
102
+ value: PropTypes.Requireable<string | number | string[] | Date | number[] | Date[]>;
103
103
  inputReadOnly: PropTypes.Requireable<boolean>;
104
104
  disabled: PropTypes.Requireable<boolean>;
105
105
  showClear: PropTypes.Requireable<boolean>;
106
- defaultValue: PropTypes.Requireable<string | number | string[] | number[] | Date | Date[]>;
106
+ defaultValue: PropTypes.Requireable<string | number | string[] | Date | number[] | Date[]>;
107
107
  open: PropTypes.Requireable<boolean>;
108
108
  defaultOpen: PropTypes.Requireable<boolean>;
109
109
  onOpenChange: PropTypes.Requireable<(...args: any[]) => any>;
@@ -6,5 +6,5 @@ import PropTypes from 'prop-types';
6
6
  * - \[12:00:12, 12:21:12]
7
7
  * - \[[12:00:12, 12:21:12], [12:11:12, 12:32:12]]
8
8
  */
9
- declare const TimeShape: PropTypes.Requireable<string | number | string[] | number[] | Date | Date[]>;
9
+ declare const TimeShape: PropTypes.Requireable<string | number | string[] | Date | number[] | Date[]>;
10
10
  export { TimeShape };
@@ -19,11 +19,11 @@ export default class LocaleTimePicker extends React.PureComponent<LocalePickerPr
19
19
  'aria-required': import("prop-types").Requireable<boolean>;
20
20
  prefixCls: import("prop-types").Requireable<string>;
21
21
  clearText: import("prop-types").Requireable<string>;
22
- value: import("prop-types").Requireable<string | number | string[] | number[] | Date | Date[]>;
22
+ value: import("prop-types").Requireable<string | number | string[] | Date | number[] | Date[]>;
23
23
  inputReadOnly: import("prop-types").Requireable<boolean>;
24
24
  disabled: import("prop-types").Requireable<boolean>;
25
25
  showClear: import("prop-types").Requireable<boolean>;
26
- defaultValue: import("prop-types").Requireable<string | number | string[] | number[] | Date | Date[]>;
26
+ defaultValue: import("prop-types").Requireable<string | number | string[] | Date | number[] | Date[]>;
27
27
  open: import("prop-types").Requireable<boolean>;
28
28
  defaultOpen: import("prop-types").Requireable<boolean>;
29
29
  onOpenChange: import("prop-types").Requireable<(...args: any[]) => any>;
@@ -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<1 | 2 | 3 | 4 | 6 | 5>;
41
41
  style: PropTypes.Requireable<object>;
42
42
  className: PropTypes.Requireable<string>;
43
43
  component: PropTypes.Requireable<string>;
@@ -140,7 +140,7 @@ declare class Upload extends BaseComponent<UploadProps, UploadState> {
140
140
  style: PropTypes.Requireable<object>;
141
141
  timeout: PropTypes.Requireable<number>;
142
142
  transformFile: PropTypes.Requireable<(...args: any[]) => any>;
143
- uploadTrigger: PropTypes.Requireable<"auto" | "custom">;
143
+ uploadTrigger: PropTypes.Requireable<"custom" | "auto">;
144
144
  validateMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
145
145
  validateStatus: PropTypes.Requireable<"default" | "error" | "warning" | "success">;
146
146
  withCredentials: PropTypes.Requireable<boolean>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-ui",
3
- "version": "2.19.0-alpha.6",
3
+ "version": "2.19.0-alpha.7",
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.6",
19
- "@douyinfe/semi-foundation": "2.19.0-alpha.6",
20
- "@douyinfe/semi-icons": "2.19.0-alpha.6",
18
+ "@douyinfe/semi-animation-react": "2.19.0-alpha.7",
19
+ "@douyinfe/semi-foundation": "2.19.0-alpha.7",
20
+ "@douyinfe/semi-icons": "2.19.0-alpha.7",
21
21
  "@douyinfe/semi-illustrations": "2.15.0",
22
- "@douyinfe/semi-theme-default": "2.19.0-alpha.6",
22
+ "@douyinfe/semi-theme-default": "2.19.0-alpha.7",
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": "f131defbb2a909ebb7035eea975bf3466908ac15",
69
+ "gitHead": "e4926d98b1e98ec52a3bc8b7c29a51bf223b8208",
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.6",
75
+ "@douyinfe/semi-scss-compile": "2.19.0-alpha.7",
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`}>
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 = (