@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.
- package/checkbox/checkbox.tsx +7 -7
- package/dist/css/semi.css +25 -91
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +72 -121
- 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 +1 -0
- package/lib/cjs/checkbox/checkbox.js +2 -8
- package/lib/cjs/form/baseForm.d.ts +1 -1
- package/lib/cjs/form/baseForm.js +1 -0
- package/lib/cjs/form/field.d.ts +1 -1
- package/lib/cjs/popconfirm/index.d.ts +2 -4
- package/lib/cjs/popconfirm/index.js +31 -49
- package/lib/cjs/radio/radio.js +21 -13
- package/lib/cjs/radio/radioGroup.js +1 -1
- package/lib/cjs/tabs/TabBar.js +1 -5
- package/lib/cjs/transfer/index.js +2 -7
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/es/checkbox/checkbox.js +2 -8
- package/lib/es/form/baseForm.d.ts +1 -1
- package/lib/es/form/baseForm.js +1 -0
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/popconfirm/index.d.ts +2 -4
- package/lib/es/popconfirm/index.js +31 -49
- package/lib/es/radio/radio.js +21 -13
- package/lib/es/radio/radioGroup.js +1 -1
- package/lib/es/tabs/TabBar.js +1 -5
- package/lib/es/transfer/index.js +2 -7
- package/lib/es/typography/title.d.ts +1 -1
- package/package.json +7 -7
- package/popconfirm/_story/popconfirm.stories.js +1 -37
- package/popconfirm/index.tsx +6 -14
- package/radio/_story/radio.stories.js +5 -5
- package/radio/radio.tsx +20 -19
- package/radio/radioGroup.tsx +1 -1
- package/tabs/TabBar.tsx +1 -7
- package/transfer/index.tsx +2 -7
package/form/baseForm.tsx
CHANGED
|
@@ -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
|
-
|
|
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, "
|
|
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>;
|
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, "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) =>
|
|
31
|
-
onConfirm?: (e: React.MouseEvent) =>
|
|
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
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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() {
|
package/lib/cjs/radio/radio.js
CHANGED
|
@@ -228,16 +228,26 @@ class Radio extends _baseComponent.default {
|
|
|
228
228
|
["".concat(prefix, "-focus")]: focusVisible && isButtonRadio
|
|
229
229
|
}, addonClassName);
|
|
230
230
|
|
|
231
|
-
const renderContent = () =>
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
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
|
-
})),
|
|
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:
|
|
48
|
+
value: props.value || props.defaultValue
|
|
49
49
|
};
|
|
50
50
|
this.foundation = new _radioGroupFoundation.default(this.adapter);
|
|
51
51
|
}
|
package/lib/cjs/tabs/TabBar.js
CHANGED
|
@@ -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
|
|
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
|
|
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 =
|
|
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<
|
|
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
|
-
|
|
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, "
|
|
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>;
|
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, "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) =>
|
|
31
|
-
onConfirm?: (e: React.MouseEvent) =>
|
|
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
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
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() {
|
package/lib/es/radio/radio.js
CHANGED
|
@@ -203,16 +203,26 @@ class Radio extends BaseComponent {
|
|
|
203
203
|
["".concat(prefix, "-focus")]: focusVisible && isButtonRadio
|
|
204
204
|
}, addonClassName);
|
|
205
205
|
|
|
206
|
-
const renderContent = () =>
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
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
|
-
})),
|
|
237
|
-
className: "".concat(prefix, "-isCardRadioGroup_content")
|
|
238
|
-
}, renderContent()) : renderContent());
|
|
246
|
+
})), renderContent());
|
|
239
247
|
}
|
|
240
248
|
|
|
241
249
|
}
|
package/lib/es/tabs/TabBar.js
CHANGED
|
@@ -125,11 +125,7 @@ class TabBar extends React.Component {
|
|
|
125
125
|
var _context5, _context6;
|
|
126
126
|
|
|
127
127
|
if (_isEmpty(items)) {
|
|
128
|
-
return
|
|
129
|
-
disabled: true,
|
|
130
|
-
icon: icon,
|
|
131
|
-
theme: "borderless"
|
|
132
|
-
});
|
|
128
|
+
return null;
|
|
133
129
|
}
|
|
134
130
|
|
|
135
131
|
const {
|
package/lib/es/transfer/index.js
CHANGED
|
@@ -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
|
|
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 =
|
|
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<
|
|
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>;
|