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

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.
@@ -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:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-ui",
3
- "version": "2.19.0-alpha.4",
3
+ "version": "2.19.0-alpha.5",
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.4",
19
- "@douyinfe/semi-foundation": "2.19.0-alpha.4",
20
- "@douyinfe/semi-icons": "2.19.0-alpha.4",
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",
21
21
  "@douyinfe/semi-illustrations": "2.15.0",
22
- "@douyinfe/semi-theme-default": "2.19.0-alpha.4",
22
+ "@douyinfe/semi-theme-default": "2.19.0-alpha.5",
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": "44b673969b77694badbba8e8648d1431d64a3b01",
69
+ "gitHead": "f49d77763d9cf17af15945bddd04557e57858b4b",
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.4",
75
+ "@douyinfe/semi-scss-compile": "2.19.0-alpha.5",
76
76
  "@storybook/addon-knobs": "^6.3.1",
77
77
  "@types/lodash": "^4.14.176",
78
78
  "@types/react": ">=16.0.0",
@@ -167,40 +167,4 @@ export const ClickOutSideDemo = () => {
167
167
 
168
168
  ClickOutSideDemo.story = {
169
169
  name: 'ClickOutSideDemo',
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
-
170
+ };
@@ -35,16 +35,14 @@ export interface PopconfirmProps extends PopoverProps {
35
35
  zIndex?: number;
36
36
  trigger?: Trigger;
37
37
  position?: Position;
38
- onCancel?: (e: React.MouseEvent) => Promise<any> | void;
39
- onConfirm?: (e: React.MouseEvent) => Promise<any> | void;
38
+ onCancel?: (e: React.MouseEvent) => void;
39
+ onConfirm?: (e: React.MouseEvent) => 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;
48
46
  }
49
47
 
50
48
  interface PopProps {
@@ -101,8 +99,6 @@ export default class Popconfirm extends BaseComponent<PopconfirmProps, Popconfir
101
99
  super(props);
102
100
 
103
101
  this.state = {
104
- cancelLoading: false,
105
- confirmLoading: false,
106
102
  visible: props.defaultVisible || false,
107
103
  };
108
104
 
@@ -126,10 +122,8 @@ export default class Popconfirm extends BaseComponent<PopconfirmProps, Popconfir
126
122
  return {
127
123
  ...super.adapter,
128
124
  setVisible: (visible: boolean): void => this.setState({ visible }),
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),
125
+ notifyConfirm: (e: React.MouseEvent): void => this.props.onConfirm(e),
126
+ notifyCancel: (e: React.MouseEvent): void => this.props.onCancel(e),
133
127
  notifyVisibleChange: (visible: boolean): void => this.props.onVisibleChange(visible),
134
128
  notifyClickOutSide: (e: React.MouseEvent) => this.props.onClickOutSide(e),
135
129
  };
@@ -147,15 +141,14 @@ export default class Popconfirm extends BaseComponent<PopconfirmProps, Popconfir
147
141
 
148
142
  renderControls() {
149
143
  const { okText, cancelText, okType, cancelType, cancelButtonProps, okButtonProps } = this.props;
150
- const { cancelLoading, confirmLoading } = this.state;
151
144
  return (
152
145
  <LocaleConsumer componentName="Popconfirm">
153
146
  {(locale: LocaleObject['Popconfirm'], localeCode: string) => (
154
147
  <>
155
- <Button type={cancelType} onClick={this.handleCancel} loading={cancelLoading} {...cancelButtonProps}>
148
+ <Button type={cancelType} onClick={this.handleCancel} {...cancelButtonProps}>
156
149
  {cancelText || get(locale, 'cancel')}
157
150
  </Button>
158
- <Button type={okType} theme="solid" onClick={this.handleConfirm} loading={confirmLoading} {...okButtonProps}>
151
+ <Button type={okType} theme="solid" onClick={this.handleConfirm} {...okButtonProps}>
159
152
  {okText || get(locale, 'confirm')}
160
153
  </Button>
161
154
  </>
@@ -178,7 +171,6 @@ export default class Popconfirm extends BaseComponent<PopconfirmProps, Popconfir
178
171
  const showContent = content !== null || typeof content !== 'undefined';
179
172
 
180
173
  return (
181
- // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
182
174
  <div className={popCardCls} onClick={this.stopImmediatePropagation} style={style}>
183
175
  <div className={`${prefixCls}-inner`}>
184
176
  <div className={`${prefixCls}-header`}>
package/tabs/TabBar.tsx CHANGED
@@ -147,13 +147,7 @@ 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 (
151
- <Button
152
- disabled={true}
153
- icon={icon}
154
- theme="borderless"
155
- />
156
- );
150
+ return null;
157
151
  }
158
152
  const { dropdownClassName, dropdownStyle } = this.props;
159
153
  const { rePosKey } = this.state;
@@ -393,9 +393,7 @@ 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 emptyDataCom = this.renderEmpty('left', emptyLeft);
397
- const emptySearchCom = this.renderEmpty('left', emptySearch);
398
-
396
+ const emptyCom = this.renderEmpty('left', inputValue ? emptySearch : emptyLeft);
399
397
  const loadingCom = <Spin />;
400
398
 
401
399
  let content: React.ReactNode = null;
@@ -404,10 +402,7 @@ class Transfer extends BaseComponent<TransferProps, TransferState> {
404
402
  content = loadingCom;
405
403
  break;
406
404
  case noMatch:
407
- content = emptySearchCom;
408
- break;
409
- case data.length === 0:
410
- content = emptyDataCom;
405
+ content = emptyCom;
411
406
  break;
412
407
  case type === strings.TYPE_TREE_TO_LIST:
413
408
  content = (