@douyinfe/semi-ui 2.19.0-alpha.5 → 2.19.0-alpha.8
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/button/buttonGroup.tsx +1 -1
- package/button/index.tsx +2 -0
- package/checkbox/_story/checkbox.stories.js +2 -0
- package/checkbox/checkbox.tsx +22 -19
- package/checkbox/checkboxGroup.tsx +1 -0
- package/dist/css/semi.css +42 -135
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +395 -329
- 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/button/buttonGroup.js +5 -9
- package/lib/cjs/button/index.d.ts +1 -0
- package/lib/cjs/button/index.js +1 -0
- package/lib/cjs/checkbox/checkbox.js +18 -10
- package/lib/cjs/checkbox/checkboxGroup.js +10 -9
- 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/radio/radio.js +21 -13
- package/lib/cjs/radio/radioGroup.js +1 -1
- package/lib/cjs/tabs/TabBar.js +5 -1
- package/lib/cjs/transfer/index.js +7 -2
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/es/button/buttonGroup.js +5 -8
- package/lib/es/button/index.d.ts +1 -0
- package/lib/es/button/index.js +1 -0
- package/lib/es/checkbox/checkbox.js +18 -10
- package/lib/es/checkbox/checkboxGroup.js +8 -7
- 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/radio/radio.js +21 -13
- package/lib/es/radio/radioGroup.js +1 -1
- package/lib/es/tabs/TabBar.js +5 -1
- package/lib/es/transfer/index.js +7 -2
- 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/radio/_story/radio.stories.js +5 -5
- package/radio/radio.tsx +20 -19
- package/radio/radioGroup.tsx +1 -1
- package/tabs/TabBar.tsx +7 -1
- package/transfer/index.tsx +7 -2
package/form/baseForm.tsx
CHANGED
|
@@ -22,8 +22,6 @@ var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-st
|
|
|
22
22
|
|
|
23
23
|
var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
|
|
24
24
|
|
|
25
|
-
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
26
|
-
|
|
27
25
|
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
28
26
|
|
|
29
27
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
@@ -73,20 +71,18 @@ class ButtonGroup extends _baseComponent.default {
|
|
|
73
71
|
var _context;
|
|
74
72
|
|
|
75
73
|
(0, _forEach.default)(_context = (0, _slice.default)(inner).call(inner, 0, -1)).call(_context, item => {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const isButtonType = (0, _includes.default)(_context2 = [(0, _get2.default)(item, 'type.displayName'), (0, _get2.default)(item, 'type.name')]).call(_context2, 'Button');
|
|
74
|
+
const isButtonType = (0, _get2.default)(item, 'type.elementType') === 'Button';
|
|
79
75
|
const buttonProps = (0, _get2.default)(item, 'props');
|
|
80
76
|
|
|
81
77
|
if (buttonProps) {
|
|
82
|
-
var
|
|
78
|
+
var _context2, _context3;
|
|
83
79
|
|
|
84
80
|
const {
|
|
85
81
|
type,
|
|
86
82
|
theme,
|
|
87
83
|
disabled
|
|
88
84
|
} = buttonProps;
|
|
89
|
-
lineCls = (0, _classnames.default)("".concat(prefixCls, "-group-line"), (0, _concat.default)(
|
|
85
|
+
lineCls = (0, _classnames.default)("".concat(prefixCls, "-group-line"), (0, _concat.default)(_context2 = "".concat(prefixCls, "-group-line-")).call(_context2, theme !== null && theme !== void 0 ? theme : 'light'), (0, _concat.default)(_context3 = "".concat(prefixCls, "-group-line-")).call(_context3, type !== null && type !== void 0 ? type : 'primary'), {
|
|
90
86
|
["".concat(prefixCls, "-group-line-disabled")]: disabled
|
|
91
87
|
});
|
|
92
88
|
}
|
|
@@ -123,9 +119,9 @@ class ButtonGroup extends _baseComponent.default {
|
|
|
123
119
|
const cls = (0, _classnames.default)("".concat(prefixCls, "-group"), className);
|
|
124
120
|
|
|
125
121
|
if (children) {
|
|
126
|
-
var
|
|
122
|
+
var _context4;
|
|
127
123
|
|
|
128
|
-
inner = (0, _map.default)(
|
|
124
|
+
inner = (0, _map.default)(_context4 = (0, _isArray.default)(children) ? children : [children]).call(_context4, (itm, index) => /*#__PURE__*/(0, _react.isValidElement)(itm) ? /*#__PURE__*/(0, _react.cloneElement)(itm, (0, _assign.default)((0, _assign.default)((0, _assign.default)({
|
|
129
125
|
disabled,
|
|
130
126
|
size,
|
|
131
127
|
type
|
|
@@ -31,6 +31,7 @@ declare class Button extends React.PureComponent<ButtonProps> {
|
|
|
31
31
|
htmlType: import("prop-types").Requireable<"button" | "reset" | "submit">;
|
|
32
32
|
'aria-label': import("prop-types").Requireable<string>;
|
|
33
33
|
};
|
|
34
|
+
static elementType: string;
|
|
34
35
|
constructor(props?: {});
|
|
35
36
|
render(): JSX.Element;
|
|
36
37
|
}
|
package/lib/cjs/button/index.js
CHANGED
|
@@ -40,5 +40,6 @@ class Button extends _react.default.PureComponent {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
Button.propTypes = (0, _assign.default)((0, _assign.default)({}, _Button.default.propTypes), _iconButton.default.propTypes);
|
|
43
|
+
Button.elementType = 'Button';
|
|
43
44
|
var _default = Button;
|
|
44
45
|
exports.default = _default;
|
|
@@ -211,15 +211,23 @@ 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
|
-
const renderContent = () =>
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
"
|
|
222
|
-
|
|
214
|
+
const renderContent = () => {
|
|
215
|
+
if (!children && !extra) {
|
|
216
|
+
return null;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
220
|
+
className: "".concat(prefix, "-content")
|
|
221
|
+
}, children ? /*#__PURE__*/_react.default.createElement("span", {
|
|
222
|
+
id: addonId,
|
|
223
|
+
className: "".concat(prefix, "-addon"),
|
|
224
|
+
"x-semi-prop": xSemiPropChildren
|
|
225
|
+
}, children) : null, extra ? /*#__PURE__*/_react.default.createElement("div", {
|
|
226
|
+
id: extraId,
|
|
227
|
+
className: extraCls,
|
|
228
|
+
"x-semi-prop": "extra"
|
|
229
|
+
}, extra) : null);
|
|
230
|
+
};
|
|
223
231
|
|
|
224
232
|
return (
|
|
225
233
|
/*#__PURE__*/
|
|
@@ -245,7 +253,7 @@ class Checkbox extends _baseComponent.default {
|
|
|
245
253
|
focusInner: focusVisible && !focusOuter,
|
|
246
254
|
onInputFocus: this.handleFocusVisible,
|
|
247
255
|
onInputBlur: this.handleBlur
|
|
248
|
-
})),
|
|
256
|
+
})), renderContent())
|
|
249
257
|
);
|
|
250
258
|
}
|
|
251
259
|
|
|
@@ -34,7 +34,7 @@ var _checkboxGroupFoundation = _interopRequireDefault(require("@douyinfe/semi-fo
|
|
|
34
34
|
|
|
35
35
|
var _baseComponent = _interopRequireDefault(require("../_base/baseComponent"));
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _context8 = require("./context");
|
|
38
38
|
|
|
39
39
|
var _checkbox = _interopRequireDefault(require("./checkbox"));
|
|
40
40
|
|
|
@@ -83,7 +83,7 @@ class CheckboxGroup extends _baseComponent.default {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
render() {
|
|
86
|
-
var _context2, _context3, _context4;
|
|
86
|
+
var _context2, _context3, _context4, _context5;
|
|
87
87
|
|
|
88
88
|
const {
|
|
89
89
|
children,
|
|
@@ -103,15 +103,16 @@ class CheckboxGroup extends _baseComponent.default {
|
|
|
103
103
|
[prefix]: true,
|
|
104
104
|
["".concat(prefix, "-wrapper")]: true,
|
|
105
105
|
[(0, _concat.default)(_context2 = "".concat(prefix, "-")).call(_context2, direction)]: direction,
|
|
106
|
-
[(0, _concat.default)(_context3 = "".concat(prefix, "-")).call(_context3, direction, "-cardType")]: direction && isCardType
|
|
106
|
+
[(0, _concat.default)(_context3 = "".concat(prefix, "-")).call(_context3, direction, "-cardType")]: direction && isCardType,
|
|
107
|
+
[(0, _concat.default)(_context4 = "".concat(prefix, "-")).call(_context4, direction, "-pureCardType")]: direction && isPureCardType
|
|
107
108
|
}, className);
|
|
108
|
-
const realValue = (0, _slice.default)(
|
|
109
|
+
const realValue = (0, _slice.default)(_context5 = this.state.value).call(_context5);
|
|
109
110
|
let inner;
|
|
110
111
|
|
|
111
112
|
if (options) {
|
|
112
|
-
var
|
|
113
|
+
var _context6;
|
|
113
114
|
|
|
114
|
-
inner = (0, _map.default)(
|
|
115
|
+
inner = (0, _map.default)(_context6 = options || []).call(_context6, (option, index) => {
|
|
115
116
|
if (typeof option === 'string') {
|
|
116
117
|
return /*#__PURE__*/_react.default.createElement(_checkbox.default, {
|
|
117
118
|
role: "listitem",
|
|
@@ -135,9 +136,9 @@ class CheckboxGroup extends _baseComponent.default {
|
|
|
135
136
|
}
|
|
136
137
|
});
|
|
137
138
|
} else if (children) {
|
|
138
|
-
var
|
|
139
|
+
var _context7;
|
|
139
140
|
|
|
140
|
-
inner = (0, _map.default)(
|
|
141
|
+
inner = (0, _map.default)(_context7 = _react.default.Children.toArray(children)).call(_context7, (itm, index) => /*#__PURE__*/_react.default.cloneElement(itm, {
|
|
141
142
|
key: index,
|
|
142
143
|
role: 'listitem'
|
|
143
144
|
}));
|
|
@@ -151,7 +152,7 @@ class CheckboxGroup extends _baseComponent.default {
|
|
|
151
152
|
style: style,
|
|
152
153
|
"aria-labelledby": this.props['aria-labelledby'],
|
|
153
154
|
"aria-describedby": this.props['aria-describedby']
|
|
154
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
155
|
+
}, /*#__PURE__*/_react.default.createElement(_context8.Context.Provider, {
|
|
155
156
|
value: {
|
|
156
157
|
checkboxGroup: {
|
|
157
158
|
onChange: this.onChange,
|
|
@@ -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/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,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:
|
|
@@ -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>;
|
|
@@ -3,7 +3,6 @@ import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/inst
|
|
|
3
3
|
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
|
4
4
|
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
|
5
5
|
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
6
|
-
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
7
6
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
8
7
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
9
8
|
import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
|
|
@@ -37,21 +36,19 @@ export default class ButtonGroup extends BaseComponent {
|
|
|
37
36
|
var _context;
|
|
38
37
|
|
|
39
38
|
_forEachInstanceProperty(_context = _sliceInstanceProperty(inner).call(inner, 0, -1)).call(_context, item => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const isButtonType = _includesInstanceProperty(_context2 = [_get(item, 'type.displayName'), _get(item, 'type.name')]).call(_context2, 'Button');
|
|
39
|
+
const isButtonType = _get(item, 'type.elementType') === 'Button';
|
|
43
40
|
|
|
44
41
|
const buttonProps = _get(item, 'props');
|
|
45
42
|
|
|
46
43
|
if (buttonProps) {
|
|
47
|
-
var
|
|
44
|
+
var _context2, _context3;
|
|
48
45
|
|
|
49
46
|
const {
|
|
50
47
|
type,
|
|
51
48
|
theme,
|
|
52
49
|
disabled
|
|
53
50
|
} = buttonProps;
|
|
54
|
-
lineCls = classNames("".concat(prefixCls, "-group-line"), _concatInstanceProperty(
|
|
51
|
+
lineCls = classNames("".concat(prefixCls, "-group-line"), _concatInstanceProperty(_context2 = "".concat(prefixCls, "-group-line-")).call(_context2, theme !== null && theme !== void 0 ? theme : 'light'), _concatInstanceProperty(_context3 = "".concat(prefixCls, "-group-line-")).call(_context3, type !== null && type !== void 0 ? type : 'primary'), {
|
|
55
52
|
["".concat(prefixCls, "-group-line-disabled")]: disabled
|
|
56
53
|
});
|
|
57
54
|
}
|
|
@@ -89,9 +86,9 @@ export default class ButtonGroup extends BaseComponent {
|
|
|
89
86
|
const cls = classNames("".concat(prefixCls, "-group"), className);
|
|
90
87
|
|
|
91
88
|
if (children) {
|
|
92
|
-
var
|
|
89
|
+
var _context4;
|
|
93
90
|
|
|
94
|
-
inner = _mapInstanceProperty(
|
|
91
|
+
inner = _mapInstanceProperty(_context4 = _Array$isArray(children) ? children : [children]).call(_context4, (itm, index) => /*#__PURE__*/isValidElement(itm) ? /*#__PURE__*/cloneElement(itm, _Object$assign(_Object$assign(_Object$assign({
|
|
95
92
|
disabled,
|
|
96
93
|
size,
|
|
97
94
|
type
|
package/lib/es/button/index.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ declare class Button extends React.PureComponent<ButtonProps> {
|
|
|
31
31
|
htmlType: import("prop-types").Requireable<"button" | "reset" | "submit">;
|
|
32
32
|
'aria-label': import("prop-types").Requireable<string>;
|
|
33
33
|
};
|
|
34
|
+
static elementType: string;
|
|
34
35
|
constructor(props?: {});
|
|
35
36
|
render(): JSX.Element;
|
|
36
37
|
}
|
package/lib/es/button/index.js
CHANGED
|
@@ -187,15 +187,23 @@ 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
|
-
const renderContent = () =>
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
"
|
|
198
|
-
|
|
190
|
+
const renderContent = () => {
|
|
191
|
+
if (!children && !extra) {
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
196
|
+
className: "".concat(prefix, "-content")
|
|
197
|
+
}, children ? /*#__PURE__*/React.createElement("span", {
|
|
198
|
+
id: addonId,
|
|
199
|
+
className: "".concat(prefix, "-addon"),
|
|
200
|
+
"x-semi-prop": xSemiPropChildren
|
|
201
|
+
}, children) : null, extra ? /*#__PURE__*/React.createElement("div", {
|
|
202
|
+
id: extraId,
|
|
203
|
+
className: extraCls,
|
|
204
|
+
"x-semi-prop": "extra"
|
|
205
|
+
}, extra) : null);
|
|
206
|
+
};
|
|
199
207
|
|
|
200
208
|
return (
|
|
201
209
|
/*#__PURE__*/
|
|
@@ -221,7 +229,7 @@ class Checkbox extends BaseComponent {
|
|
|
221
229
|
focusInner: focusVisible && !focusOuter,
|
|
222
230
|
onInputFocus: this.handleFocusVisible,
|
|
223
231
|
onInputBlur: this.handleBlur
|
|
224
|
-
})),
|
|
232
|
+
})), renderContent())
|
|
225
233
|
);
|
|
226
234
|
}
|
|
227
235
|
|
|
@@ -59,7 +59,7 @@ class CheckboxGroup extends BaseComponent {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
render() {
|
|
62
|
-
var _context2, _context3, _context4;
|
|
62
|
+
var _context2, _context3, _context4, _context5;
|
|
63
63
|
|
|
64
64
|
const {
|
|
65
65
|
children,
|
|
@@ -79,17 +79,18 @@ class CheckboxGroup extends BaseComponent {
|
|
|
79
79
|
[prefix]: true,
|
|
80
80
|
["".concat(prefix, "-wrapper")]: true,
|
|
81
81
|
[_concatInstanceProperty(_context2 = "".concat(prefix, "-")).call(_context2, direction)]: direction,
|
|
82
|
-
[_concatInstanceProperty(_context3 = "".concat(prefix, "-")).call(_context3, direction, "-cardType")]: direction && isCardType
|
|
82
|
+
[_concatInstanceProperty(_context3 = "".concat(prefix, "-")).call(_context3, direction, "-cardType")]: direction && isCardType,
|
|
83
|
+
[_concatInstanceProperty(_context4 = "".concat(prefix, "-")).call(_context4, direction, "-pureCardType")]: direction && isPureCardType
|
|
83
84
|
}, className);
|
|
84
85
|
|
|
85
|
-
const realValue = _sliceInstanceProperty(
|
|
86
|
+
const realValue = _sliceInstanceProperty(_context5 = this.state.value).call(_context5);
|
|
86
87
|
|
|
87
88
|
let inner;
|
|
88
89
|
|
|
89
90
|
if (options) {
|
|
90
|
-
var
|
|
91
|
+
var _context6;
|
|
91
92
|
|
|
92
|
-
inner = _mapInstanceProperty(
|
|
93
|
+
inner = _mapInstanceProperty(_context6 = options || []).call(_context6, (option, index) => {
|
|
93
94
|
if (typeof option === 'string') {
|
|
94
95
|
return /*#__PURE__*/React.createElement(Checkbox, {
|
|
95
96
|
role: "listitem",
|
|
@@ -113,9 +114,9 @@ class CheckboxGroup extends BaseComponent {
|
|
|
113
114
|
}
|
|
114
115
|
});
|
|
115
116
|
} else if (children) {
|
|
116
|
-
var
|
|
117
|
+
var _context7;
|
|
117
118
|
|
|
118
|
-
inner = _mapInstanceProperty(
|
|
119
|
+
inner = _mapInstanceProperty(_context7 = React.Children.toArray(children)).call(_context7, (itm, index) => /*#__PURE__*/React.cloneElement(itm, {
|
|
119
120
|
key: index,
|
|
120
121
|
role: 'listitem'
|
|
121
122
|
}));
|
|
@@ -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>;
|