@douyinfe/semi-ui 2.19.0-alpha.6 → 2.19.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/button/buttonGroup.tsx +38 -4
- package/button/index.tsx +2 -0
- package/dist/css/semi.css +40 -3
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +150 -51
- 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.d.ts +1 -0
- package/lib/cjs/button/buttonGroup.js +52 -3
- package/lib/cjs/button/index.d.ts +1 -0
- package/lib/cjs/button/index.js +1 -0
- package/lib/cjs/carousel/CarouselIndicator.d.ts +1 -1
- package/lib/cjs/carousel/index.d.ts +1 -1
- package/lib/cjs/datePicker/dateInput.d.ts +1 -1
- package/lib/cjs/datePicker/datePicker.d.ts +1 -1
- package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
- package/lib/cjs/form/baseForm.js +0 -1
- package/lib/cjs/popconfirm/index.d.ts +4 -2
- package/lib/cjs/popconfirm/index.js +49 -31
- package/lib/cjs/radio/radio.d.ts +1 -1
- package/lib/cjs/radio/radioGroup.d.ts +1 -1
- package/lib/cjs/tabs/TabBar.js +5 -1
- package/lib/cjs/timePicker/TimePicker.d.ts +2 -2
- package/lib/cjs/timePicker/TimeShape.d.ts +1 -1
- package/lib/cjs/timePicker/index.d.ts +2 -2
- package/lib/cjs/transfer/index.js +7 -2
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/cjs/upload/index.d.ts +1 -1
- package/lib/es/button/buttonGroup.d.ts +1 -0
- package/lib/es/button/buttonGroup.js +50 -3
- package/lib/es/button/index.d.ts +1 -0
- package/lib/es/button/index.js +1 -0
- package/lib/es/carousel/CarouselIndicator.d.ts +1 -1
- package/lib/es/carousel/index.d.ts +1 -1
- package/lib/es/datePicker/dateInput.d.ts +1 -1
- package/lib/es/datePicker/datePicker.d.ts +1 -1
- package/lib/es/datePicker/monthsGrid.d.ts +1 -1
- package/lib/es/form/baseForm.js +0 -1
- package/lib/es/popconfirm/index.d.ts +4 -2
- package/lib/es/popconfirm/index.js +49 -31
- package/lib/es/radio/radio.d.ts +1 -1
- package/lib/es/radio/radioGroup.d.ts +1 -1
- package/lib/es/tabs/TabBar.js +5 -1
- package/lib/es/timePicker/TimePicker.d.ts +2 -2
- package/lib/es/timePicker/TimeShape.d.ts +1 -1
- package/lib/es/timePicker/index.d.ts +2 -2
- package/lib/es/transfer/index.js +7 -2
- package/lib/es/typography/title.d.ts +1 -1
- package/lib/es/upload/index.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/form/baseForm.tsx
CHANGED
|
@@ -18,12 +18,20 @@ var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-st
|
|
|
18
18
|
|
|
19
19
|
var _getOwnPropertySymbols = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols"));
|
|
20
20
|
|
|
21
|
+
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
22
|
+
|
|
23
|
+
var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
|
|
24
|
+
|
|
25
|
+
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
26
|
+
|
|
21
27
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
22
28
|
|
|
23
29
|
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
24
30
|
|
|
25
31
|
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
26
32
|
|
|
33
|
+
var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
34
|
+
|
|
27
35
|
var _react = _interopRequireWildcard(require("react"));
|
|
28
36
|
|
|
29
37
|
var _baseComponent = _interopRequireDefault(require("../_base/baseComponent"));
|
|
@@ -55,6 +63,45 @@ const prefixCls = _constants.cssClasses.PREFIX;
|
|
|
55
63
|
const btnSizes = _constants.strings.sizes;
|
|
56
64
|
|
|
57
65
|
class ButtonGroup extends _baseComponent.default {
|
|
66
|
+
getInnerWithLine(inner) {
|
|
67
|
+
const innerWithLine = [];
|
|
68
|
+
let lineCls = "".concat(prefixCls, "-group-line");
|
|
69
|
+
|
|
70
|
+
if (inner.length > 1) {
|
|
71
|
+
var _context;
|
|
72
|
+
|
|
73
|
+
(0, _forEach.default)(_context = (0, _slice.default)(inner).call(inner, 0, -1)).call(_context, item => {
|
|
74
|
+
const isButtonType = (0, _get2.default)(item, 'type.elementType') === 'Button';
|
|
75
|
+
const buttonProps = (0, _get2.default)(item, 'props');
|
|
76
|
+
|
|
77
|
+
if (buttonProps) {
|
|
78
|
+
var _context2, _context3;
|
|
79
|
+
|
|
80
|
+
const {
|
|
81
|
+
type,
|
|
82
|
+
theme,
|
|
83
|
+
disabled
|
|
84
|
+
} = buttonProps;
|
|
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'), {
|
|
86
|
+
["".concat(prefixCls, "-group-line-disabled")]: disabled
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (isButtonType) {
|
|
91
|
+
innerWithLine.push(item, /*#__PURE__*/_react.default.createElement("span", {
|
|
92
|
+
className: lineCls
|
|
93
|
+
}));
|
|
94
|
+
} else {
|
|
95
|
+
innerWithLine.push(item);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
innerWithLine.push((0, _slice.default)(inner).call(inner, -1));
|
|
99
|
+
return innerWithLine;
|
|
100
|
+
} else {
|
|
101
|
+
return inner;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
58
105
|
render() {
|
|
59
106
|
const _a = this.props,
|
|
60
107
|
{
|
|
@@ -68,25 +115,27 @@ class ButtonGroup extends _baseComponent.default {
|
|
|
68
115
|
rest = __rest(_a, ["children", "disabled", "size", "type", "className", 'aria-label']);
|
|
69
116
|
|
|
70
117
|
let inner;
|
|
118
|
+
let innerWithLine = [];
|
|
71
119
|
const cls = (0, _classnames.default)("".concat(prefixCls, "-group"), className);
|
|
72
120
|
|
|
73
121
|
if (children) {
|
|
74
|
-
var
|
|
122
|
+
var _context4;
|
|
75
123
|
|
|
76
|
-
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)({
|
|
77
125
|
disabled,
|
|
78
126
|
size,
|
|
79
127
|
type
|
|
80
128
|
}, itm.props), rest), {
|
|
81
129
|
key: index
|
|
82
130
|
})) : itm);
|
|
131
|
+
innerWithLine = this.getInnerWithLine(inner);
|
|
83
132
|
}
|
|
84
133
|
|
|
85
134
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
86
135
|
className: cls,
|
|
87
136
|
role: "group",
|
|
88
137
|
"aria-label": ariaLabel
|
|
89
|
-
},
|
|
138
|
+
}, innerWithLine);
|
|
90
139
|
}
|
|
91
140
|
|
|
92
141
|
}
|
|
@@ -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;
|
|
@@ -8,7 +8,7 @@ declare class CarouselIndicator extends React.PureComponent<CarouselIndicatorPro
|
|
|
8
8
|
position: PropTypes.Requireable<"left" | "right" | "center">;
|
|
9
9
|
size: PropTypes.Requireable<"small" | "medium">;
|
|
10
10
|
style: PropTypes.Requireable<object>;
|
|
11
|
-
theme: PropTypes.Requireable<"
|
|
11
|
+
theme: PropTypes.Requireable<"dark" | "light" | "primary">;
|
|
12
12
|
total: PropTypes.Requireable<number>;
|
|
13
13
|
onIndicatorChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
14
14
|
type: PropTypes.Requireable<"line" | "dot" | "columnar">;
|
|
@@ -22,7 +22,7 @@ declare class Carousel extends BaseComponent<CarouselProps, CarouselState> {
|
|
|
22
22
|
indicatorPosition: PropTypes.Requireable<"left" | "right" | "center">;
|
|
23
23
|
indicatorSize: PropTypes.Requireable<"small" | "medium">;
|
|
24
24
|
indicatorType: PropTypes.Requireable<"line" | "dot" | "columnar">;
|
|
25
|
-
theme: PropTypes.Requireable<"
|
|
25
|
+
theme: PropTypes.Requireable<"dark" | "light" | "primary">;
|
|
26
26
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
27
|
arrowType: PropTypes.Requireable<"hover" | "always">;
|
|
28
28
|
showArrow: PropTypes.Requireable<boolean>;
|
|
@@ -26,7 +26,7 @@ export default class DateInput extends BaseComponent<DateInputProps, {}> {
|
|
|
26
26
|
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
27
|
value: PropTypes.Requireable<any[]>;
|
|
28
28
|
disabled: PropTypes.Requireable<boolean>;
|
|
29
|
-
type: PropTypes.Requireable<"
|
|
29
|
+
type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "dateTimeRange">;
|
|
30
30
|
showClear: PropTypes.Requireable<boolean>;
|
|
31
31
|
format: PropTypes.Requireable<string>;
|
|
32
32
|
inputStyle: PropTypes.Requireable<object>;
|
|
@@ -41,7 +41,7 @@ export default class DatePicker extends BaseComponent<DatePickerProps, DatePicke
|
|
|
41
41
|
'aria-invalid': PropTypes.Requireable<boolean>;
|
|
42
42
|
'aria-labelledby': PropTypes.Requireable<string>;
|
|
43
43
|
'aria-required': PropTypes.Requireable<boolean>;
|
|
44
|
-
type: PropTypes.Requireable<"
|
|
44
|
+
type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "dateTimeRange">;
|
|
45
45
|
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
46
46
|
density: PropTypes.Requireable<"default" | "compact">;
|
|
47
47
|
defaultValue: PropTypes.Requireable<string | number | object>;
|
|
@@ -17,7 +17,7 @@ export interface MonthsGridProps extends MonthsGridFoundationProps, BaseProps {
|
|
|
17
17
|
export declare type MonthsGridState = MonthsGridFoundationState;
|
|
18
18
|
export default class MonthsGrid extends BaseComponent<MonthsGridProps, MonthsGridState> {
|
|
19
19
|
static propTypes: {
|
|
20
|
-
type: PropTypes.Requireable<"
|
|
20
|
+
type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "dateTimeRange">;
|
|
21
21
|
defaultValue: PropTypes.Requireable<string | number | object>;
|
|
22
22
|
defaultPickerValue: PropTypes.Requireable<string | number | object>;
|
|
23
23
|
multiple: PropTypes.Requireable<boolean>;
|
package/lib/cjs/form/baseForm.js
CHANGED
|
@@ -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.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ declare class Radio extends BaseComponent<RadioProps, RadioState> {
|
|
|
81
81
|
prefixCls?: string;
|
|
82
82
|
name?: string;
|
|
83
83
|
onChange?: (e: RadioChangeEvent) => void;
|
|
84
|
-
buttonSize?: "small" | "
|
|
84
|
+
buttonSize?: "small" | "large" | "middle";
|
|
85
85
|
isCardRadio?: boolean;
|
|
86
86
|
isPureCardRadio?: boolean;
|
|
87
87
|
};
|
|
@@ -48,7 +48,7 @@ declare class RadioGroup extends BaseComponent<RadioGroupProps, RadioGroupState>
|
|
|
48
48
|
disabled: PropTypes.Requireable<boolean>;
|
|
49
49
|
name: PropTypes.Requireable<string>;
|
|
50
50
|
options: PropTypes.Requireable<any[]>;
|
|
51
|
-
buttonSize: PropTypes.Requireable<"small" | "
|
|
51
|
+
buttonSize: PropTypes.Requireable<"small" | "large" | "middle">;
|
|
52
52
|
type: PropTypes.Requireable<"default" | "button" | "card" | "pureCard">;
|
|
53
53
|
value: PropTypes.Requireable<any>;
|
|
54
54
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
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 {
|
|
@@ -99,11 +99,11 @@ export default class TimePicker extends BaseComponent<TimePickerProps, TimePicke
|
|
|
99
99
|
'aria-required': PropTypes.Requireable<boolean>;
|
|
100
100
|
prefixCls: PropTypes.Requireable<string>;
|
|
101
101
|
clearText: PropTypes.Requireable<string>;
|
|
102
|
-
value: PropTypes.Requireable<string | number | string[] | number[] | Date
|
|
102
|
+
value: PropTypes.Requireable<string | number | string[] | Date | number[] | Date[]>;
|
|
103
103
|
inputReadOnly: PropTypes.Requireable<boolean>;
|
|
104
104
|
disabled: PropTypes.Requireable<boolean>;
|
|
105
105
|
showClear: PropTypes.Requireable<boolean>;
|
|
106
|
-
defaultValue: PropTypes.Requireable<string | number | string[] | number[] | Date
|
|
106
|
+
defaultValue: PropTypes.Requireable<string | number | string[] | Date | number[] | Date[]>;
|
|
107
107
|
open: PropTypes.Requireable<boolean>;
|
|
108
108
|
defaultOpen: PropTypes.Requireable<boolean>;
|
|
109
109
|
onOpenChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -6,5 +6,5 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
* - \[12:00:12, 12:21:12]
|
|
7
7
|
* - \[[12:00:12, 12:21:12], [12:11:12, 12:32:12]]
|
|
8
8
|
*/
|
|
9
|
-
declare const TimeShape: PropTypes.Requireable<string | number | string[] | number[] | Date
|
|
9
|
+
declare const TimeShape: PropTypes.Requireable<string | number | string[] | Date | number[] | Date[]>;
|
|
10
10
|
export { TimeShape };
|
|
@@ -19,11 +19,11 @@ export default class LocaleTimePicker extends React.PureComponent<LocalePickerPr
|
|
|
19
19
|
'aria-required': import("prop-types").Requireable<boolean>;
|
|
20
20
|
prefixCls: import("prop-types").Requireable<string>;
|
|
21
21
|
clearText: import("prop-types").Requireable<string>;
|
|
22
|
-
value: import("prop-types").Requireable<string | number | string[] | number[] | Date
|
|
22
|
+
value: import("prop-types").Requireable<string | number | string[] | Date | number[] | Date[]>;
|
|
23
23
|
inputReadOnly: import("prop-types").Requireable<boolean>;
|
|
24
24
|
disabled: import("prop-types").Requireable<boolean>;
|
|
25
25
|
showClear: import("prop-types").Requireable<boolean>;
|
|
26
|
-
defaultValue: import("prop-types").Requireable<string | number | string[] | number[] | Date
|
|
26
|
+
defaultValue: import("prop-types").Requireable<string | number | string[] | Date | number[] | Date[]>;
|
|
27
27
|
open: import("prop-types").Requireable<boolean>;
|
|
28
28
|
defaultOpen: import("prop-types").Requireable<boolean>;
|
|
29
29
|
onOpenChange: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
@@ -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<1 | 2 | 3 | 4 |
|
|
40
|
+
heading: PropTypes.Requireable<1 | 2 | 3 | 4 | 6 | 5>;
|
|
41
41
|
style: PropTypes.Requireable<object>;
|
|
42
42
|
className: PropTypes.Requireable<string>;
|
|
43
43
|
component: PropTypes.Requireable<string>;
|
|
@@ -140,7 +140,7 @@ declare class Upload extends BaseComponent<UploadProps, UploadState> {
|
|
|
140
140
|
style: PropTypes.Requireable<object>;
|
|
141
141
|
timeout: PropTypes.Requireable<number>;
|
|
142
142
|
transformFile: PropTypes.Requireable<(...args: any[]) => any>;
|
|
143
|
-
uploadTrigger: PropTypes.Requireable<"
|
|
143
|
+
uploadTrigger: PropTypes.Requireable<"custom" | "auto">;
|
|
144
144
|
validateMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
145
145
|
validateStatus: PropTypes.Requireable<"default" | "error" | "warning" | "success">;
|
|
146
146
|
withCredentials: PropTypes.Requireable<boolean>;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import _get from "lodash/get";
|
|
1
2
|
import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/index-of";
|
|
2
3
|
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
|
4
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
|
5
|
+
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
6
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
3
7
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
4
8
|
import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
|
|
5
9
|
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
@@ -24,6 +28,47 @@ import '@douyinfe/semi-foundation/lib/es/button/button.css';
|
|
|
24
28
|
const prefixCls = cssClasses.PREFIX;
|
|
25
29
|
const btnSizes = strings.sizes;
|
|
26
30
|
export default class ButtonGroup extends BaseComponent {
|
|
31
|
+
getInnerWithLine(inner) {
|
|
32
|
+
const innerWithLine = [];
|
|
33
|
+
let lineCls = "".concat(prefixCls, "-group-line");
|
|
34
|
+
|
|
35
|
+
if (inner.length > 1) {
|
|
36
|
+
var _context;
|
|
37
|
+
|
|
38
|
+
_forEachInstanceProperty(_context = _sliceInstanceProperty(inner).call(inner, 0, -1)).call(_context, item => {
|
|
39
|
+
const isButtonType = _get(item, 'type.elementType') === 'Button';
|
|
40
|
+
|
|
41
|
+
const buttonProps = _get(item, 'props');
|
|
42
|
+
|
|
43
|
+
if (buttonProps) {
|
|
44
|
+
var _context2, _context3;
|
|
45
|
+
|
|
46
|
+
const {
|
|
47
|
+
type,
|
|
48
|
+
theme,
|
|
49
|
+
disabled
|
|
50
|
+
} = buttonProps;
|
|
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'), {
|
|
52
|
+
["".concat(prefixCls, "-group-line-disabled")]: disabled
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (isButtonType) {
|
|
57
|
+
innerWithLine.push(item, /*#__PURE__*/React.createElement("span", {
|
|
58
|
+
className: lineCls
|
|
59
|
+
}));
|
|
60
|
+
} else {
|
|
61
|
+
innerWithLine.push(item);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
innerWithLine.push(_sliceInstanceProperty(inner).call(inner, -1));
|
|
66
|
+
return innerWithLine;
|
|
67
|
+
} else {
|
|
68
|
+
return inner;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
27
72
|
render() {
|
|
28
73
|
const _a = this.props,
|
|
29
74
|
{
|
|
@@ -37,25 +82,27 @@ export default class ButtonGroup extends BaseComponent {
|
|
|
37
82
|
rest = __rest(_a, ["children", "disabled", "size", "type", "className", 'aria-label']);
|
|
38
83
|
|
|
39
84
|
let inner;
|
|
85
|
+
let innerWithLine = [];
|
|
40
86
|
const cls = classNames("".concat(prefixCls, "-group"), className);
|
|
41
87
|
|
|
42
88
|
if (children) {
|
|
43
|
-
var
|
|
89
|
+
var _context4;
|
|
44
90
|
|
|
45
|
-
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({
|
|
46
92
|
disabled,
|
|
47
93
|
size,
|
|
48
94
|
type
|
|
49
95
|
}, itm.props), rest), {
|
|
50
96
|
key: index
|
|
51
97
|
})) : itm);
|
|
98
|
+
innerWithLine = this.getInnerWithLine(inner);
|
|
52
99
|
}
|
|
53
100
|
|
|
54
101
|
return /*#__PURE__*/React.createElement("div", {
|
|
55
102
|
className: cls,
|
|
56
103
|
role: "group",
|
|
57
104
|
"aria-label": ariaLabel
|
|
58
|
-
},
|
|
105
|
+
}, innerWithLine);
|
|
59
106
|
}
|
|
60
107
|
|
|
61
108
|
}
|
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
|
@@ -8,7 +8,7 @@ declare class CarouselIndicator extends React.PureComponent<CarouselIndicatorPro
|
|
|
8
8
|
position: PropTypes.Requireable<"left" | "right" | "center">;
|
|
9
9
|
size: PropTypes.Requireable<"small" | "medium">;
|
|
10
10
|
style: PropTypes.Requireable<object>;
|
|
11
|
-
theme: PropTypes.Requireable<"
|
|
11
|
+
theme: PropTypes.Requireable<"dark" | "light" | "primary">;
|
|
12
12
|
total: PropTypes.Requireable<number>;
|
|
13
13
|
onIndicatorChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
14
14
|
type: PropTypes.Requireable<"line" | "dot" | "columnar">;
|
|
@@ -22,7 +22,7 @@ declare class Carousel extends BaseComponent<CarouselProps, CarouselState> {
|
|
|
22
22
|
indicatorPosition: PropTypes.Requireable<"left" | "right" | "center">;
|
|
23
23
|
indicatorSize: PropTypes.Requireable<"small" | "medium">;
|
|
24
24
|
indicatorType: PropTypes.Requireable<"line" | "dot" | "columnar">;
|
|
25
|
-
theme: PropTypes.Requireable<"
|
|
25
|
+
theme: PropTypes.Requireable<"dark" | "light" | "primary">;
|
|
26
26
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
27
|
arrowType: PropTypes.Requireable<"hover" | "always">;
|
|
28
28
|
showArrow: PropTypes.Requireable<boolean>;
|
|
@@ -26,7 +26,7 @@ export default class DateInput extends BaseComponent<DateInputProps, {}> {
|
|
|
26
26
|
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
27
|
value: PropTypes.Requireable<any[]>;
|
|
28
28
|
disabled: PropTypes.Requireable<boolean>;
|
|
29
|
-
type: PropTypes.Requireable<"
|
|
29
|
+
type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "dateTimeRange">;
|
|
30
30
|
showClear: PropTypes.Requireable<boolean>;
|
|
31
31
|
format: PropTypes.Requireable<string>;
|
|
32
32
|
inputStyle: PropTypes.Requireable<object>;
|
|
@@ -41,7 +41,7 @@ export default class DatePicker extends BaseComponent<DatePickerProps, DatePicke
|
|
|
41
41
|
'aria-invalid': PropTypes.Requireable<boolean>;
|
|
42
42
|
'aria-labelledby': PropTypes.Requireable<string>;
|
|
43
43
|
'aria-required': PropTypes.Requireable<boolean>;
|
|
44
|
-
type: PropTypes.Requireable<"
|
|
44
|
+
type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "dateTimeRange">;
|
|
45
45
|
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
46
46
|
density: PropTypes.Requireable<"default" | "compact">;
|
|
47
47
|
defaultValue: PropTypes.Requireable<string | number | object>;
|
|
@@ -17,7 +17,7 @@ export interface MonthsGridProps extends MonthsGridFoundationProps, BaseProps {
|
|
|
17
17
|
export declare type MonthsGridState = MonthsGridFoundationState;
|
|
18
18
|
export default class MonthsGrid extends BaseComponent<MonthsGridProps, MonthsGridState> {
|
|
19
19
|
static propTypes: {
|
|
20
|
-
type: PropTypes.Requireable<"
|
|
20
|
+
type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "dateTimeRange">;
|
|
21
21
|
defaultValue: PropTypes.Requireable<string | number | object>;
|
|
22
22
|
defaultPickerValue: PropTypes.Requireable<string | number | object>;
|
|
23
23
|
multiple: PropTypes.Requireable<boolean>;
|