@douyinfe/semi-ui 2.19.0-alpha.0 → 2.19.0-alpha.3
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.
- package/checkbox/checkbox.tsx +7 -7
- package/dist/css/semi.css +9 -10
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +111 -63
- package/dist/umd/semi-ui.js.map +1 -1
- package/dist/umd/semi-ui.min.js +1 -1
- package/dist/umd/semi-ui.min.js.map +1 -1
- package/form/baseForm.tsx +0 -1
- package/lib/cjs/checkbox/checkbox.js +8 -2
- package/lib/cjs/form/baseForm.d.ts +1 -1
- package/lib/cjs/form/baseForm.js +0 -1
- package/lib/cjs/form/field.d.ts +1 -1
- package/lib/cjs/popconfirm/index.d.ts +4 -2
- package/lib/cjs/popconfirm/index.js +49 -31
- package/lib/cjs/tabs/TabBar.js +5 -1
- package/lib/cjs/transfer/index.js +7 -2
- package/lib/cjs/tree/treeNode.d.ts +1 -4
- package/lib/cjs/tree/treeNode.js +4 -13
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/es/checkbox/checkbox.js +8 -2
- package/lib/es/form/baseForm.d.ts +1 -1
- package/lib/es/form/baseForm.js +0 -1
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/popconfirm/index.d.ts +4 -2
- package/lib/es/popconfirm/index.js +49 -31
- package/lib/es/tabs/TabBar.js +5 -1
- package/lib/es/transfer/index.js +7 -2
- package/lib/es/tree/treeNode.d.ts +1 -4
- package/lib/es/tree/treeNode.js +4 -13
- package/lib/es/typography/title.d.ts +1 -1
- package/package.json +7 -7
- package/popconfirm/_story/popconfirm.stories.js +37 -1
- package/popconfirm/index.tsx +14 -6
- package/tabs/TabBar.tsx +7 -1
- package/transfer/index.tsx +7 -2
- package/tree/treeNode.tsx +5 -11
package/form/baseForm.tsx
CHANGED
|
@@ -211,7 +211,13 @@ 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
|
-
|
|
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", {
|
|
215
221
|
id: addonId,
|
|
216
222
|
className: "".concat(prefix, "-addon"),
|
|
217
223
|
"x-semi-prop": xSemiPropChildren
|
|
@@ -245,7 +251,7 @@ class Checkbox extends _baseComponent.default {
|
|
|
245
251
|
focusInner: focusVisible && !focusOuter,
|
|
246
252
|
onInputFocus: this.handleFocusVisible,
|
|
247
253
|
onInputBlur: this.handleBlur
|
|
248
|
-
})),
|
|
254
|
+
})), renderContent())
|
|
249
255
|
);
|
|
250
256
|
}
|
|
251
257
|
|
|
@@ -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, "
|
|
129
|
+
} & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "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>;
|
package/lib/cjs/form/baseForm.js
CHANGED
package/lib/cjs/form/field.d.ts
CHANGED
|
@@ -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, "
|
|
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>;
|
|
@@ -72,6 +72,8 @@ 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,
|
|
75
77
|
visible: props.defaultVisible || false
|
|
76
78
|
};
|
|
77
79
|
this.foundation = new _popconfirmFoundation.default(this.adapter);
|
|
@@ -95,6 +97,12 @@ class Popconfirm extends _baseComponent.default {
|
|
|
95
97
|
setVisible: visible => this.setState({
|
|
96
98
|
visible
|
|
97
99
|
}),
|
|
100
|
+
updateConfirmLoading: loading => this.setState({
|
|
101
|
+
confirmLoading: loading
|
|
102
|
+
}),
|
|
103
|
+
updateCancelLoading: loading => this.setState({
|
|
104
|
+
cancelLoading: loading
|
|
105
|
+
}),
|
|
98
106
|
notifyConfirm: e => this.props.onConfirm(e),
|
|
99
107
|
notifyCancel: e => this.props.onCancel(e),
|
|
100
108
|
notifyVisibleChange: visible => this.props.onVisibleChange(visible),
|
|
@@ -111,15 +119,21 @@ class Popconfirm extends _baseComponent.default {
|
|
|
111
119
|
cancelButtonProps,
|
|
112
120
|
okButtonProps
|
|
113
121
|
} = this.props;
|
|
122
|
+
const {
|
|
123
|
+
cancelLoading,
|
|
124
|
+
confirmLoading
|
|
125
|
+
} = this.state;
|
|
114
126
|
return /*#__PURE__*/_react.default.createElement(_localeConsumer.default, {
|
|
115
127
|
componentName: "Popconfirm"
|
|
116
128
|
}, (locale, localeCode) => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_button.default, (0, _assign.default)({
|
|
117
129
|
type: cancelType,
|
|
118
|
-
onClick: this.handleCancel
|
|
130
|
+
onClick: this.handleCancel,
|
|
131
|
+
loading: cancelLoading
|
|
119
132
|
}, cancelButtonProps), cancelText || (0, _get2.default)(locale, 'cancel')), /*#__PURE__*/_react.default.createElement(_button.default, (0, _assign.default)({
|
|
120
133
|
type: okType,
|
|
121
134
|
theme: "solid",
|
|
122
|
-
onClick: this.handleConfirm
|
|
135
|
+
onClick: this.handleConfirm,
|
|
136
|
+
loading: confirmLoading
|
|
123
137
|
}, okButtonProps), okText || (0, _get2.default)(locale, 'confirm'))));
|
|
124
138
|
}
|
|
125
139
|
|
|
@@ -141,35 +155,39 @@ class Popconfirm extends _baseComponent.default {
|
|
|
141
155
|
});
|
|
142
156
|
const showTitle = title !== null && typeof title !== 'undefined';
|
|
143
157
|
const showContent = content !== null || typeof content !== 'undefined';
|
|
144
|
-
return
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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
|
+
);
|
|
173
191
|
}
|
|
174
192
|
|
|
175
193
|
render() {
|
package/lib/cjs/tabs/TabBar.js
CHANGED
|
@@ -151,7 +151,11 @@ class TabBar extends _react.default.Component {
|
|
|
151
151
|
var _context5, _context6;
|
|
152
152
|
|
|
153
153
|
if ((0, _isEmpty2.default)(items)) {
|
|
154
|
-
return
|
|
154
|
+
return /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
155
|
+
disabled: true,
|
|
156
|
+
icon: icon,
|
|
157
|
+
theme: "borderless"
|
|
158
|
+
});
|
|
155
159
|
}
|
|
156
160
|
|
|
157
161
|
const {
|
|
@@ -322,7 +322,8 @@ 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
|
|
325
|
+
const emptyDataCom = this.renderEmpty('left', emptyLeft);
|
|
326
|
+
const emptySearchCom = this.renderEmpty('left', emptySearch);
|
|
326
327
|
|
|
327
328
|
const loadingCom = /*#__PURE__*/_react.default.createElement(_spin.default, null);
|
|
328
329
|
|
|
@@ -334,7 +335,11 @@ class Transfer extends _baseComponent.default {
|
|
|
334
335
|
break;
|
|
335
336
|
|
|
336
337
|
case noMatch:
|
|
337
|
-
content =
|
|
338
|
+
content = emptySearchCom;
|
|
339
|
+
break;
|
|
340
|
+
|
|
341
|
+
case data.length === 0:
|
|
342
|
+
content = emptyDataCom;
|
|
338
343
|
break;
|
|
339
344
|
|
|
340
345
|
case type === _constants.strings.TYPE_TREE_TO_LIST:
|
|
@@ -55,10 +55,7 @@ export default class TreeNode extends PureComponent<TreeNodeProps, TreeNodeState
|
|
|
55
55
|
isLeaf: () => boolean;
|
|
56
56
|
isDisabled: () => boolean;
|
|
57
57
|
renderArrow(): JSX.Element;
|
|
58
|
-
renderCheckbox(
|
|
59
|
-
label: React.ReactNode;
|
|
60
|
-
icon: React.ReactNode;
|
|
61
|
-
}): JSX.Element;
|
|
58
|
+
renderCheckbox(): JSX.Element;
|
|
62
59
|
renderIcon(): any;
|
|
63
60
|
renderEmptyNode(): JSX.Element;
|
|
64
61
|
renderRealLabel: () => any;
|
package/lib/cjs/tree/treeNode.js
CHANGED
|
@@ -339,11 +339,7 @@ class TreeNode extends _react.PureComponent {
|
|
|
339
339
|
});
|
|
340
340
|
}
|
|
341
341
|
|
|
342
|
-
renderCheckbox(
|
|
343
|
-
const {
|
|
344
|
-
label,
|
|
345
|
-
icon
|
|
346
|
-
} = options;
|
|
342
|
+
renderCheckbox() {
|
|
347
343
|
const {
|
|
348
344
|
checked,
|
|
349
345
|
halfChecked,
|
|
@@ -360,7 +356,7 @@ class TreeNode extends _react.PureComponent {
|
|
|
360
356
|
indeterminate: halfChecked,
|
|
361
357
|
checked: checked,
|
|
362
358
|
disabled: Boolean(disabled)
|
|
363
|
-
}
|
|
359
|
+
}));
|
|
364
360
|
}
|
|
365
361
|
|
|
366
362
|
renderIcon() {
|
|
@@ -528,8 +524,6 @@ class TreeNode extends _react.PureComponent {
|
|
|
528
524
|
});
|
|
529
525
|
const setsize = (0, _get2.default)(rest, ['data', 'children', 'length']);
|
|
530
526
|
const posinset = (0, _isString2.default)(rest.pos) ? Number(rest.pos.split('-')[level + 1]) + 1 : 1;
|
|
531
|
-
const label = this.renderRealLabel();
|
|
532
|
-
const icon = this.renderIcon();
|
|
533
527
|
return /*#__PURE__*/_react.default.createElement("li", (0, _assign.default)({
|
|
534
528
|
className: nodeCls,
|
|
535
529
|
role: "treeitem",
|
|
@@ -549,12 +543,9 @@ class TreeNode extends _react.PureComponent {
|
|
|
549
543
|
style: style
|
|
550
544
|
}, dragProps), this.renderArrow(), /*#__PURE__*/_react.default.createElement("span", {
|
|
551
545
|
className: labelCls
|
|
552
|
-
}, multiple ? this.renderCheckbox({
|
|
553
|
-
label,
|
|
554
|
-
icon
|
|
555
|
-
}) : null, !multiple && icon, !multiple && /*#__PURE__*/_react.default.createElement("span", {
|
|
546
|
+
}, multiple ? this.renderCheckbox() : null, this.renderIcon(), /*#__PURE__*/_react.default.createElement("span", {
|
|
556
547
|
className: "".concat(prefixcls, "-label-text")
|
|
557
|
-
},
|
|
548
|
+
}, this.renderRealLabel())));
|
|
558
549
|
}
|
|
559
550
|
|
|
560
551
|
}
|
|
@@ -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<
|
|
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>;
|
|
@@ -187,7 +187,13 @@ 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
|
-
|
|
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", {
|
|
191
197
|
id: addonId,
|
|
192
198
|
className: "".concat(prefix, "-addon"),
|
|
193
199
|
"x-semi-prop": xSemiPropChildren
|
|
@@ -221,7 +227,7 @@ class Checkbox extends BaseComponent {
|
|
|
221
227
|
focusInner: focusVisible && !focusOuter,
|
|
222
228
|
onInputFocus: this.handleFocusVisible,
|
|
223
229
|
onInputBlur: this.handleBlur
|
|
224
|
-
})),
|
|
230
|
+
})), renderContent())
|
|
225
231
|
);
|
|
226
232
|
}
|
|
227
233
|
|
|
@@ -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, "
|
|
129
|
+
} & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "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>;
|
package/lib/es/form/baseForm.js
CHANGED
package/lib/es/form/field.d.ts
CHANGED
|
@@ -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, "
|
|
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
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
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() {
|
package/lib/es/tabs/TabBar.js
CHANGED
|
@@ -125,7 +125,11 @@ class TabBar extends React.Component {
|
|
|
125
125
|
var _context5, _context6;
|
|
126
126
|
|
|
127
127
|
if (_isEmpty(items)) {
|
|
128
|
-
return
|
|
128
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
129
|
+
disabled: true,
|
|
130
|
+
icon: icon,
|
|
131
|
+
theme: "borderless"
|
|
132
|
+
});
|
|
129
133
|
}
|
|
130
134
|
|
|
131
135
|
const {
|
package/lib/es/transfer/index.js
CHANGED
|
@@ -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
|
|
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 =
|
|
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:
|
|
@@ -55,10 +55,7 @@ export default class TreeNode extends PureComponent<TreeNodeProps, TreeNodeState
|
|
|
55
55
|
isLeaf: () => boolean;
|
|
56
56
|
isDisabled: () => boolean;
|
|
57
57
|
renderArrow(): JSX.Element;
|
|
58
|
-
renderCheckbox(
|
|
59
|
-
label: React.ReactNode;
|
|
60
|
-
icon: React.ReactNode;
|
|
61
|
-
}): JSX.Element;
|
|
58
|
+
renderCheckbox(): JSX.Element;
|
|
62
59
|
renderIcon(): any;
|
|
63
60
|
renderEmptyNode(): JSX.Element;
|
|
64
61
|
renderRealLabel: () => any;
|
package/lib/es/tree/treeNode.js
CHANGED
|
@@ -300,11 +300,7 @@ export default class TreeNode extends PureComponent {
|
|
|
300
300
|
});
|
|
301
301
|
}
|
|
302
302
|
|
|
303
|
-
renderCheckbox(
|
|
304
|
-
const {
|
|
305
|
-
label,
|
|
306
|
-
icon
|
|
307
|
-
} = options;
|
|
303
|
+
renderCheckbox() {
|
|
308
304
|
const {
|
|
309
305
|
checked,
|
|
310
306
|
halfChecked,
|
|
@@ -321,7 +317,7 @@ export default class TreeNode extends PureComponent {
|
|
|
321
317
|
indeterminate: halfChecked,
|
|
322
318
|
checked: checked,
|
|
323
319
|
disabled: Boolean(disabled)
|
|
324
|
-
}
|
|
320
|
+
}));
|
|
325
321
|
}
|
|
326
322
|
|
|
327
323
|
renderIcon() {
|
|
@@ -491,8 +487,6 @@ export default class TreeNode extends PureComponent {
|
|
|
491
487
|
const setsize = _get(rest, ['data', 'children', 'length']);
|
|
492
488
|
|
|
493
489
|
const posinset = _isString(rest.pos) ? Number(rest.pos.split('-')[level + 1]) + 1 : 1;
|
|
494
|
-
const label = this.renderRealLabel();
|
|
495
|
-
const icon = this.renderIcon();
|
|
496
490
|
return /*#__PURE__*/React.createElement("li", _Object$assign({
|
|
497
491
|
className: nodeCls,
|
|
498
492
|
role: "treeitem",
|
|
@@ -512,12 +506,9 @@ export default class TreeNode extends PureComponent {
|
|
|
512
506
|
style: style
|
|
513
507
|
}, dragProps), this.renderArrow(), /*#__PURE__*/React.createElement("span", {
|
|
514
508
|
className: labelCls
|
|
515
|
-
}, multiple ? this.renderCheckbox({
|
|
516
|
-
label,
|
|
517
|
-
icon
|
|
518
|
-
}) : null, !multiple && icon, !multiple && /*#__PURE__*/React.createElement("span", {
|
|
509
|
+
}, multiple ? this.renderCheckbox() : null, this.renderIcon(), /*#__PURE__*/React.createElement("span", {
|
|
519
510
|
className: "".concat(prefixcls, "-label-text")
|
|
520
|
-
},
|
|
511
|
+
}, this.renderRealLabel())));
|
|
521
512
|
}
|
|
522
513
|
|
|
523
514
|
}
|
|
@@ -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<
|
|
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>;
|