@douyinfe/semi-ui 2.34.0-beta.0 → 2.34.1-alpha.2
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/dist/css/semi.css +20 -44
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +33404 -33022
- 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/lib/cjs/breadcrumb/item.js +1 -1
- package/lib/cjs/calendar/interface.d.ts +2 -2
- package/lib/cjs/card/index.d.ts +36 -4
- package/lib/cjs/card/index.js +244 -67
- package/lib/cjs/cascader/index.d.ts +0 -2
- package/lib/cjs/cascader/index.js +0 -13
- package/lib/cjs/form/baseForm.d.ts +1 -1
- package/lib/cjs/form/field.d.ts +1 -1
- package/lib/cjs/modal/confirm.d.ts +6 -6
- package/lib/cjs/steps/basicStep.js +13 -7
- package/lib/cjs/steps/basicSteps.js +4 -2
- package/lib/cjs/steps/fillStep.js +13 -7
- package/lib/cjs/steps/fillSteps.js +3 -2
- package/lib/cjs/steps/index.d.ts +1 -0
- package/lib/cjs/steps/index.js +5 -2
- package/lib/cjs/steps/navStep.js +12 -4
- package/lib/cjs/steps/navSteps.js +4 -2
- package/lib/cjs/table/Body/index.d.ts +0 -1
- package/lib/cjs/table/Body/index.js +3 -3
- package/lib/cjs/table/HeadTable.d.ts +4 -4
- package/lib/cjs/table/HeadTable.js +3 -3
- package/lib/cjs/table/Table.js +4 -29
- package/lib/cjs/table/TableCell.js +3 -14
- package/lib/cjs/table/TableHeader.d.ts +0 -1
- package/lib/cjs/table/TableHeader.js +2 -11
- package/lib/cjs/table/TableHeaderRow.js +1 -2
- package/lib/cjs/table/interface.d.ts +1 -2
- package/lib/cjs/typography/base.d.ts +2 -1
- package/lib/cjs/typography/base.js +68 -66
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/cjs/typography/util.d.ts +1 -4
- package/lib/cjs/typography/util.js +13 -32
- package/lib/es/breadcrumb/item.js +1 -1
- package/lib/es/calendar/interface.d.ts +2 -2
- package/lib/es/card/index.d.ts +36 -4
- package/lib/es/card/index.js +243 -66
- package/lib/es/cascader/index.d.ts +0 -2
- package/lib/es/cascader/index.js +0 -13
- package/lib/es/form/baseForm.d.ts +1 -1
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/modal/confirm.d.ts +6 -6
- package/lib/es/steps/basicStep.js +12 -7
- package/lib/es/steps/basicSteps.js +4 -2
- package/lib/es/steps/fillStep.js +12 -7
- package/lib/es/steps/fillSteps.js +3 -2
- package/lib/es/steps/index.d.ts +1 -0
- package/lib/es/steps/index.js +3 -0
- package/lib/es/steps/navStep.js +11 -4
- package/lib/es/steps/navSteps.js +4 -2
- package/lib/es/table/Body/index.d.ts +0 -1
- package/lib/es/table/Body/index.js +3 -3
- package/lib/es/table/HeadTable.d.ts +4 -4
- package/lib/es/table/HeadTable.js +3 -3
- package/lib/es/table/Table.js +5 -30
- package/lib/es/table/TableCell.js +4 -15
- package/lib/es/table/TableHeader.d.ts +0 -1
- package/lib/es/table/TableHeader.js +1 -9
- package/lib/es/table/TableHeaderRow.js +1 -2
- package/lib/es/table/interface.d.ts +1 -2
- package/lib/es/typography/base.d.ts +2 -1
- package/lib/es/typography/base.js +67 -64
- package/lib/es/typography/title.d.ts +1 -1
- package/lib/es/typography/util.d.ts +1 -4
- package/lib/es/typography/util.js +14 -32
- package/package.json +9 -8
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { strings } from '@douyinfe/semi-foundation/lib/cjs/calendar/constants';
|
|
3
3
|
import type { ArrayElement } from '../_base/base';
|
|
4
4
|
import type { BaseProps } from '../_base/baseComponent';
|
|
5
|
-
import type { EventObject,
|
|
5
|
+
import type { EventObject, weeekStartsOnEnum } from '@douyinfe/semi-foundation/lib/cjs/calendar/foundation';
|
|
6
6
|
export interface CalendarProps extends BaseProps {
|
|
7
7
|
displayValue?: Date;
|
|
8
8
|
range?: Date[];
|
|
@@ -10,7 +10,7 @@ export interface CalendarProps extends BaseProps {
|
|
|
10
10
|
events?: EventObject[];
|
|
11
11
|
mode?: ArrayElement<typeof strings.MODE>;
|
|
12
12
|
showCurrTime?: boolean;
|
|
13
|
-
weekStartsOn?:
|
|
13
|
+
weekStartsOn?: weeekStartsOnEnum;
|
|
14
14
|
scrollTop?: number;
|
|
15
15
|
onClick?: (e: React.MouseEvent, value: Date) => void;
|
|
16
16
|
onClose?: (e: React.MouseEvent) => void;
|
package/lib/cjs/card/index.d.ts
CHANGED
|
@@ -42,8 +42,44 @@ export interface CardProps {
|
|
|
42
42
|
/** aria label */
|
|
43
43
|
'aria-label'?: string;
|
|
44
44
|
}
|
|
45
|
+
export interface CardHeaderProps {
|
|
46
|
+
title?: ReactNode;
|
|
47
|
+
headerExtraContent?: ReactNode;
|
|
48
|
+
header?: ReactNode;
|
|
49
|
+
headerLine?: boolean;
|
|
50
|
+
headerStyle?: CSSProperties;
|
|
51
|
+
}
|
|
52
|
+
export interface CardFooterProps {
|
|
53
|
+
footer?: ReactNode;
|
|
54
|
+
footerLine?: boolean;
|
|
55
|
+
footerStyle?: CSSProperties;
|
|
56
|
+
}
|
|
57
|
+
export interface CardBodyProps {
|
|
58
|
+
cover: ReactNode;
|
|
59
|
+
children: ReactNode;
|
|
60
|
+
actions: ReactNode[];
|
|
61
|
+
loading: boolean;
|
|
62
|
+
bodyStyle?: CSSProperties;
|
|
63
|
+
}
|
|
64
|
+
declare class Header extends PureComponent<CardHeaderProps> {
|
|
65
|
+
static elementType: string;
|
|
66
|
+
render(): JSX.Element;
|
|
67
|
+
}
|
|
68
|
+
declare class Footer extends PureComponent<CardFooterProps> {
|
|
69
|
+
static elementType: string;
|
|
70
|
+
render(): JSX.Element;
|
|
71
|
+
}
|
|
72
|
+
declare class Body extends PureComponent<CardBodyProps> {
|
|
73
|
+
static elementType: string;
|
|
74
|
+
renderCover: () => ReactNode;
|
|
75
|
+
renderBody: () => ReactNode;
|
|
76
|
+
render(): JSX.Element;
|
|
77
|
+
}
|
|
45
78
|
declare class Card extends PureComponent<CardProps> {
|
|
46
79
|
static Meta: typeof Meta;
|
|
80
|
+
static Header: typeof Header;
|
|
81
|
+
static Footer: typeof Footer;
|
|
82
|
+
static Body: typeof Body;
|
|
47
83
|
static propTypes: {
|
|
48
84
|
actions: PropTypes.Requireable<any[]>;
|
|
49
85
|
bodyStyle: PropTypes.Requireable<object>;
|
|
@@ -70,10 +106,6 @@ declare class Card extends PureComponent<CardProps> {
|
|
|
70
106
|
headerLine: boolean;
|
|
71
107
|
loading: boolean;
|
|
72
108
|
};
|
|
73
|
-
renderHeader: () => ReactNode;
|
|
74
|
-
renderCover: () => ReactNode;
|
|
75
|
-
renderBody: () => ReactNode;
|
|
76
|
-
renderFooter: () => ReactNode;
|
|
77
109
|
render(): ReactNode;
|
|
78
110
|
}
|
|
79
111
|
export default Card;
|
package/lib/cjs/card/index.js
CHANGED
|
@@ -7,8 +7,6 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _isString2 = _interopRequireDefault(require("lodash/isString"));
|
|
9
9
|
|
|
10
|
-
var _omit2 = _interopRequireDefault(require("lodash/omit"));
|
|
11
|
-
|
|
12
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
11
|
|
|
14
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -46,53 +44,75 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
46
44
|
|
|
47
45
|
const prefixcls = _constants.cssClasses.PREFIX;
|
|
48
46
|
|
|
49
|
-
class
|
|
47
|
+
class Header extends _react.PureComponent {
|
|
48
|
+
render() {
|
|
49
|
+
const {
|
|
50
|
+
title,
|
|
51
|
+
headerExtraContent,
|
|
52
|
+
header,
|
|
53
|
+
headerLine,
|
|
54
|
+
headerStyle
|
|
55
|
+
} = this.props;
|
|
56
|
+
const headerCls = (0, _classnames.default)(`${prefixcls}-header`, {
|
|
57
|
+
[`${prefixcls}-header-bordered`]: Boolean(headerLine)
|
|
58
|
+
});
|
|
59
|
+
const headerWrapperCls = (0, _classnames.default)(`${prefixcls}-header-wrapper`);
|
|
60
|
+
const titleCls = (0, _classnames.default)(`${prefixcls}-header-wrapper-title`, {
|
|
61
|
+
[`${prefixcls}-header-wrapper-spacing`]: Boolean(headerExtraContent)
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
if (header || headerExtraContent || title) {
|
|
65
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
66
|
+
style: headerStyle,
|
|
67
|
+
className: headerCls
|
|
68
|
+
}, header ||
|
|
69
|
+
/*#__PURE__*/
|
|
70
|
+
// Priority of header over title and headerExtraContent
|
|
71
|
+
_react.default.createElement("div", {
|
|
72
|
+
className: headerWrapperCls
|
|
73
|
+
}, headerExtraContent && /*#__PURE__*/_react.default.createElement("div", {
|
|
74
|
+
className: `${prefixcls}-header-wrapper-extra`,
|
|
75
|
+
"x-semi-prop": "headerExtraContent"
|
|
76
|
+
}, headerExtraContent), title && /*#__PURE__*/_react.default.createElement("div", {
|
|
77
|
+
className: titleCls
|
|
78
|
+
}, (0, _isString2.default)(title) ? /*#__PURE__*/_react.default.createElement(_typography.default.Title, {
|
|
79
|
+
heading: 6,
|
|
80
|
+
ellipsis: {
|
|
81
|
+
showTooltip: true,
|
|
82
|
+
rows: 1
|
|
83
|
+
},
|
|
84
|
+
"x-semi-prop": "title"
|
|
85
|
+
}, title) : title)));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
class Footer extends _react.PureComponent {
|
|
94
|
+
render() {
|
|
95
|
+
const {
|
|
96
|
+
footer,
|
|
97
|
+
footerLine,
|
|
98
|
+
footerStyle
|
|
99
|
+
} = this.props;
|
|
100
|
+
const footerCls = (0, _classnames.default)(`${prefixcls}-footer`, {
|
|
101
|
+
[`${prefixcls}-footer-bordered`]: footerLine
|
|
102
|
+
});
|
|
103
|
+
return footer ? /*#__PURE__*/_react.default.createElement("div", {
|
|
104
|
+
style: footerStyle,
|
|
105
|
+
className: footerCls,
|
|
106
|
+
"x-semi-prop": "footer"
|
|
107
|
+
}, footer) : null;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
class Body extends _react.PureComponent {
|
|
50
113
|
constructor() {
|
|
51
114
|
super(...arguments);
|
|
52
115
|
|
|
53
|
-
this.renderHeader = () => {
|
|
54
|
-
const {
|
|
55
|
-
title,
|
|
56
|
-
headerExtraContent,
|
|
57
|
-
header,
|
|
58
|
-
headerLine,
|
|
59
|
-
headerStyle
|
|
60
|
-
} = this.props;
|
|
61
|
-
const headerCls = (0, _classnames.default)(`${prefixcls}-header`, {
|
|
62
|
-
[`${prefixcls}-header-bordered`]: Boolean(headerLine)
|
|
63
|
-
});
|
|
64
|
-
const headerWrapperCls = (0, _classnames.default)(`${prefixcls}-header-wrapper`);
|
|
65
|
-
const titleCls = (0, _classnames.default)(`${prefixcls}-header-wrapper-title`, {
|
|
66
|
-
[`${prefixcls}-header-wrapper-spacing`]: Boolean(headerExtraContent)
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
if (header || headerExtraContent || title) {
|
|
70
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
71
|
-
style: headerStyle,
|
|
72
|
-
className: headerCls
|
|
73
|
-
}, header ||
|
|
74
|
-
/*#__PURE__*/
|
|
75
|
-
// Priority of header over title and headerExtraContent
|
|
76
|
-
_react.default.createElement("div", {
|
|
77
|
-
className: headerWrapperCls
|
|
78
|
-
}, headerExtraContent && /*#__PURE__*/_react.default.createElement("div", {
|
|
79
|
-
className: `${prefixcls}-header-wrapper-extra`,
|
|
80
|
-
"x-semi-prop": "headerExtraContent"
|
|
81
|
-
}, headerExtraContent), title && /*#__PURE__*/_react.default.createElement("div", {
|
|
82
|
-
className: titleCls
|
|
83
|
-
}, (0, _isString2.default)(title) ? /*#__PURE__*/_react.default.createElement(_typography.default.Title, {
|
|
84
|
-
heading: 6,
|
|
85
|
-
ellipsis: {
|
|
86
|
-
showTooltip: true,
|
|
87
|
-
rows: 1
|
|
88
|
-
},
|
|
89
|
-
"x-semi-prop": "title"
|
|
90
|
-
}, title) : title)));
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
return null;
|
|
94
|
-
};
|
|
95
|
-
|
|
96
116
|
this.renderCover = () => {
|
|
97
117
|
const {
|
|
98
118
|
cover
|
|
@@ -109,7 +129,7 @@ class Card extends _react.PureComponent {
|
|
|
109
129
|
bodyStyle,
|
|
110
130
|
children,
|
|
111
131
|
actions,
|
|
112
|
-
loading
|
|
132
|
+
loading = false
|
|
113
133
|
} = this.props;
|
|
114
134
|
const bodyCls = (0, _classnames.default)(`${prefixcls}-body`);
|
|
115
135
|
const actionsCls = (0, _classnames.default)(`${prefixcls}-body-actions`);
|
|
@@ -136,50 +156,207 @@ class Card extends _react.PureComponent {
|
|
|
136
156
|
"x-semi-prop": `actions.${idx}`
|
|
137
157
|
}, item)))));
|
|
138
158
|
};
|
|
159
|
+
}
|
|
139
160
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
footer,
|
|
143
|
-
footerLine,
|
|
144
|
-
footerStyle
|
|
145
|
-
} = this.props;
|
|
146
|
-
const footerCls = (0, _classnames.default)(`${prefixcls}-footer`, {
|
|
147
|
-
[`${prefixcls}-footer-bordered`]: footerLine
|
|
148
|
-
});
|
|
149
|
-
return footer && /*#__PURE__*/_react.default.createElement("div", {
|
|
150
|
-
style: footerStyle,
|
|
151
|
-
className: footerCls,
|
|
152
|
-
"x-semi-prop": "footer"
|
|
153
|
-
}, footer);
|
|
154
|
-
};
|
|
161
|
+
render() {
|
|
162
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, this.renderCover(), this.renderBody());
|
|
155
163
|
}
|
|
156
164
|
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
Header.elementType = 'Card.Header';
|
|
168
|
+
Footer.elementType = 'Card.Footer';
|
|
169
|
+
Body.elementType = 'Card.Body';
|
|
170
|
+
|
|
171
|
+
class Card extends _react.PureComponent {
|
|
172
|
+
// renderHeader = (): ReactNode => {
|
|
173
|
+
// const {
|
|
174
|
+
// title,
|
|
175
|
+
// headerExtraContent,
|
|
176
|
+
// header,
|
|
177
|
+
// headerLine,
|
|
178
|
+
// headerStyle
|
|
179
|
+
// } = this.props;
|
|
180
|
+
// const headerCls = cls(`${prefixcls}-header`, {
|
|
181
|
+
// [`${prefixcls}-header-bordered`]: Boolean(headerLine)
|
|
182
|
+
// });
|
|
183
|
+
// const headerWrapperCls = cls(`${prefixcls}-header-wrapper`);
|
|
184
|
+
// const titleCls = cls(`${prefixcls}-header-wrapper-title`, {
|
|
185
|
+
// [`${prefixcls}-header-wrapper-spacing`]: Boolean(headerExtraContent)
|
|
186
|
+
// });
|
|
187
|
+
// if (header || headerExtraContent || title) {
|
|
188
|
+
// return (
|
|
189
|
+
// <div style={headerStyle} className={headerCls}>
|
|
190
|
+
// {header || ( // Priority of header over title and headerExtraContent
|
|
191
|
+
// <div className={headerWrapperCls}>
|
|
192
|
+
// {headerExtraContent && (
|
|
193
|
+
// <div
|
|
194
|
+
// className={`${prefixcls}-header-wrapper-extra`}
|
|
195
|
+
// x-semi-prop="headerExtraContent"
|
|
196
|
+
// >
|
|
197
|
+
// {headerExtraContent}
|
|
198
|
+
// </div>
|
|
199
|
+
// )}
|
|
200
|
+
// {title && (
|
|
201
|
+
// <div className={titleCls}>
|
|
202
|
+
// {isString(title) ? (
|
|
203
|
+
// <Typography.Title
|
|
204
|
+
// heading={6}
|
|
205
|
+
// ellipsis={{ showTooltip: true, rows: 1 }}
|
|
206
|
+
// x-semi-prop="title"
|
|
207
|
+
// >
|
|
208
|
+
// {title}
|
|
209
|
+
// </Typography.Title>
|
|
210
|
+
// ) : (
|
|
211
|
+
// title
|
|
212
|
+
// )}
|
|
213
|
+
// </div>
|
|
214
|
+
// )}
|
|
215
|
+
// </div>
|
|
216
|
+
// )}
|
|
217
|
+
// </div>
|
|
218
|
+
// );
|
|
219
|
+
// }
|
|
220
|
+
// return null;
|
|
221
|
+
// };
|
|
222
|
+
// renderCover = (): ReactNode => {
|
|
223
|
+
// const {
|
|
224
|
+
// cover
|
|
225
|
+
// } = this.props;
|
|
226
|
+
// const coverCls = cls(`${prefixcls}-cover`);
|
|
227
|
+
// return (
|
|
228
|
+
// cover && (
|
|
229
|
+
// <div className={coverCls} x-semi-prop="cover">
|
|
230
|
+
// {cover}
|
|
231
|
+
// </div>
|
|
232
|
+
// )
|
|
233
|
+
// );
|
|
234
|
+
// };
|
|
235
|
+
// renderBody = (): ReactNode => {
|
|
236
|
+
// const { bodyStyle, children, actions, loading } = this.props;
|
|
237
|
+
// const bodyCls = cls(`${prefixcls}-body`);
|
|
238
|
+
// const actionsCls = cls(`${prefixcls}-body-actions`);
|
|
239
|
+
// const actionsItemCls = cls(`${prefixcls}-body-actions-item`);
|
|
240
|
+
// const placeholder = (
|
|
241
|
+
// <div>
|
|
242
|
+
// <Skeleton.Title />
|
|
243
|
+
// <br />
|
|
244
|
+
// <Skeleton.Paragraph rows={3} />
|
|
245
|
+
// </div>
|
|
246
|
+
// );
|
|
247
|
+
// return (
|
|
248
|
+
// <div style={bodyStyle} className={bodyCls}>
|
|
249
|
+
// {children && (
|
|
250
|
+
// <Skeleton placeholder={placeholder} loading={loading} active>
|
|
251
|
+
// {children}
|
|
252
|
+
// </Skeleton>
|
|
253
|
+
// )}
|
|
254
|
+
// {
|
|
255
|
+
// Array.isArray(actions) &&
|
|
256
|
+
// (
|
|
257
|
+
// <div className={actionsCls}>
|
|
258
|
+
// <Space spacing={12}>
|
|
259
|
+
// {actions.map((item, idx) => (
|
|
260
|
+
// <div key={idx} className={actionsItemCls} x-semi-prop={`actions.${idx}`}>{item}</div>
|
|
261
|
+
// ))}
|
|
262
|
+
// </Space>
|
|
263
|
+
// </div>
|
|
264
|
+
// )
|
|
265
|
+
// }
|
|
266
|
+
// </div>
|
|
267
|
+
// );
|
|
268
|
+
// };
|
|
269
|
+
// renderFooter = (): ReactNode => {
|
|
270
|
+
// const {
|
|
271
|
+
// footer,
|
|
272
|
+
// footerLine,
|
|
273
|
+
// footerStyle
|
|
274
|
+
// } = this.props;
|
|
275
|
+
// const footerCls = cls(`${prefixcls}-footer`, {
|
|
276
|
+
// [`${prefixcls}-footer-bordered`]: footerLine
|
|
277
|
+
// });
|
|
278
|
+
// return (
|
|
279
|
+
// footer && (
|
|
280
|
+
// <div style={footerStyle} className={footerCls} x-semi-prop="footer">
|
|
281
|
+
// {footer}
|
|
282
|
+
// </div>
|
|
283
|
+
// )
|
|
284
|
+
// );
|
|
285
|
+
// };
|
|
157
286
|
render() {
|
|
158
287
|
const _a = this.props,
|
|
159
288
|
{
|
|
160
289
|
bordered,
|
|
161
290
|
shadows,
|
|
162
291
|
style,
|
|
163
|
-
className
|
|
292
|
+
className,
|
|
293
|
+
actions,
|
|
294
|
+
bodyStyle,
|
|
295
|
+
cover,
|
|
296
|
+
headerExtraContent,
|
|
297
|
+
footer,
|
|
298
|
+
footerLine,
|
|
299
|
+
footerStyle,
|
|
300
|
+
header,
|
|
301
|
+
headerLine,
|
|
302
|
+
headerStyle,
|
|
303
|
+
loading,
|
|
304
|
+
title,
|
|
305
|
+
children
|
|
164
306
|
} = _a,
|
|
165
|
-
otherProps = __rest(_a, ["bordered", "shadows", "style", "className"]);
|
|
307
|
+
otherProps = __rest(_a, ["bordered", "shadows", "style", "className", "actions", "bodyStyle", "cover", "headerExtraContent", "footer", "footerLine", "footerStyle", "header", "headerLine", "headerStyle", "loading", "title", "children"]); // const others = omit(otherProps, [ // Remove APIs in otherProps that do not need to be hung on the outer node
|
|
308
|
+
// 'actions',
|
|
309
|
+
// 'bodyStyle',
|
|
310
|
+
// 'cover',
|
|
311
|
+
// 'headerExtraContent',
|
|
312
|
+
// 'footer',
|
|
313
|
+
// 'footerLine',
|
|
314
|
+
// 'footerStyle',
|
|
315
|
+
// 'header',
|
|
316
|
+
// 'headerLine',
|
|
317
|
+
// 'headerStyle',
|
|
318
|
+
// 'loading',
|
|
319
|
+
// 'title'
|
|
320
|
+
// ]);
|
|
321
|
+
|
|
166
322
|
|
|
167
|
-
const others = (0, _omit2.default)(otherProps, ['actions', 'bodyStyle', 'cover', 'headerExtraContent', 'footer', 'footerLine', 'footerStyle', 'header', 'headerLine', 'headerStyle', 'loading', 'title']);
|
|
168
323
|
const cardCls = (0, _classnames.default)(prefixcls, className, {
|
|
169
324
|
[`${prefixcls}-bordered`]: bordered,
|
|
170
325
|
[`${prefixcls}-shadows`]: shadows,
|
|
171
326
|
[`${prefixcls}-shadows-${shadows}`]: shadows
|
|
172
327
|
});
|
|
173
|
-
|
|
328
|
+
const headProps = {
|
|
329
|
+
title,
|
|
330
|
+
headerExtraContent,
|
|
331
|
+
header,
|
|
332
|
+
headerLine,
|
|
333
|
+
headerStyle
|
|
334
|
+
};
|
|
335
|
+
const bodyProps = {
|
|
336
|
+
cover,
|
|
337
|
+
bodyStyle,
|
|
338
|
+
children,
|
|
339
|
+
actions,
|
|
340
|
+
loading
|
|
341
|
+
};
|
|
342
|
+
const footerProps = {
|
|
343
|
+
footer,
|
|
344
|
+
footerLine,
|
|
345
|
+
footerStyle
|
|
346
|
+
};
|
|
347
|
+
return /*#__PURE__*/_react.default.createElement("div", Object.assign({}, otherProps, {
|
|
174
348
|
"aria-busy": this.props.loading,
|
|
175
349
|
className: cardCls,
|
|
176
350
|
style: style
|
|
177
|
-
}),
|
|
351
|
+
}), /*#__PURE__*/_react.default.createElement(Header, Object.assign({}, headProps)), /*#__PURE__*/_react.default.createElement(Body, Object.assign({}, bodyProps)), /*#__PURE__*/_react.default.createElement(Footer, Object.assign({}, footerProps)));
|
|
178
352
|
}
|
|
179
353
|
|
|
180
354
|
}
|
|
181
355
|
|
|
182
356
|
Card.Meta = _meta.default;
|
|
357
|
+
Card.Header = Header;
|
|
358
|
+
Card.Footer = Footer;
|
|
359
|
+
Card.Body = Body;
|
|
183
360
|
Card.propTypes = {
|
|
184
361
|
actions: _propTypes.default.array,
|
|
185
362
|
bodyStyle: _propTypes.default.object,
|
|
@@ -200,8 +200,6 @@ declare class Cascader extends BaseComponent<CascaderProps, CascaderState> {
|
|
|
200
200
|
handleListScroll: (e: React.UIEvent<HTMLUListElement, UIEvent>, ind: number) => void;
|
|
201
201
|
close(): void;
|
|
202
202
|
open(): void;
|
|
203
|
-
focus(): void;
|
|
204
|
-
blur(): void;
|
|
205
203
|
renderContent: () => JSX.Element;
|
|
206
204
|
renderPlusN: (hiddenTag: Array<ReactNode>) => JSX.Element;
|
|
207
205
|
renderMultipleTags: () => JSX.Element;
|
|
@@ -636,11 +636,6 @@ class Cascader extends _baseComponent.default {
|
|
|
636
636
|
preventScroll
|
|
637
637
|
});
|
|
638
638
|
}
|
|
639
|
-
},
|
|
640
|
-
blurInput: () => {
|
|
641
|
-
if (this.inputRef && this.inputRef.current) {
|
|
642
|
-
this.inputRef.current.blur();
|
|
643
|
-
}
|
|
644
639
|
}
|
|
645
640
|
};
|
|
646
641
|
const cascaderAdapter = {
|
|
@@ -980,14 +975,6 @@ class Cascader extends _baseComponent.default {
|
|
|
980
975
|
this.foundation.open();
|
|
981
976
|
}
|
|
982
977
|
|
|
983
|
-
focus() {
|
|
984
|
-
this.foundation.focus();
|
|
985
|
-
}
|
|
986
|
-
|
|
987
|
-
blur() {
|
|
988
|
-
this.foundation.blur();
|
|
989
|
-
}
|
|
990
|
-
|
|
991
978
|
render() {
|
|
992
979
|
const {
|
|
993
980
|
zIndex,
|
|
@@ -138,7 +138,7 @@ declare class Form<Values extends Record<string, any> = any> extends BaseCompone
|
|
|
138
138
|
preventScroll?: boolean;
|
|
139
139
|
showRestTagsPopover?: boolean;
|
|
140
140
|
restTagsPopoverProps?: import("../popover").PopoverProps;
|
|
141
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
141
|
+
} & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "motion" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
142
142
|
static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
143
143
|
static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & React.RefAttributes<any>>;
|
|
144
144
|
static Radio: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../radio").RadioProps & import("./interface").RCIncludeType>;
|
package/lib/cjs/form/field.d.ts
CHANGED
|
@@ -86,7 +86,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
86
86
|
preventScroll?: boolean;
|
|
87
87
|
showRestTagsPopover?: boolean;
|
|
88
88
|
restTagsPopoverProps?: import("../popover").PopoverProps;
|
|
89
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
89
|
+
} & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "motion" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
90
90
|
declare const FormCheckboxGroup: import("react").ComponentType<import("utility-types").Subtract<import("../checkbox/checkboxGroup").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
|
|
91
91
|
declare const FormCheckbox: import("react").ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox/checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
92
92
|
declare const FormRadioGroup: import("react").ComponentType<import("utility-types").Subtract<import("../radio/radioGroup").RadioGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
|
|
@@ -140,16 +140,16 @@ export declare function withWarning(props: ModalReactProps): {
|
|
|
140
140
|
type: "warning";
|
|
141
141
|
};
|
|
142
142
|
export declare function withError(props: ModalReactProps): {
|
|
143
|
-
title?: React.ReactNode;
|
|
144
143
|
children?: React.ReactNode;
|
|
145
|
-
size?: import("@douyinfe/semi-foundation/lib/cjs/modal/modalFoundation").Size;
|
|
146
144
|
style?: React.CSSProperties;
|
|
147
145
|
className?: string;
|
|
148
|
-
motion?: boolean;
|
|
149
146
|
getPopupContainer?: () => HTMLElement;
|
|
150
147
|
footer?: React.ReactNode;
|
|
151
148
|
header?: React.ReactNode;
|
|
149
|
+
title?: React.ReactNode;
|
|
152
150
|
direction?: any;
|
|
151
|
+
size?: import("@douyinfe/semi-foundation/lib/cjs/modal/modalFoundation").Size;
|
|
152
|
+
motion?: boolean;
|
|
153
153
|
width?: string | number;
|
|
154
154
|
height?: string | number;
|
|
155
155
|
mask?: boolean;
|
|
@@ -201,13 +201,13 @@ export declare function withError(props: ModalReactProps): {
|
|
|
201
201
|
onMouseEnter?: React.MouseEventHandler<HTMLButtonElement>;
|
|
202
202
|
onMouseLeave?: React.MouseEventHandler<HTMLButtonElement>;
|
|
203
203
|
'aria-label'?: string;
|
|
204
|
+
value?: string | number | readonly string[];
|
|
205
|
+
form?: string;
|
|
206
|
+
slot?: string;
|
|
204
207
|
title?: string;
|
|
205
208
|
name?: string;
|
|
206
|
-
value?: string | number | readonly string[];
|
|
207
209
|
onAnimationStart?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
208
210
|
onAnimationEnd?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
209
|
-
form?: string;
|
|
210
|
-
slot?: string;
|
|
211
211
|
hidden?: boolean;
|
|
212
212
|
color?: string;
|
|
213
213
|
onChange?: React.FormEventHandler<HTMLButtonElement>;
|
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.stepSizeMapIconSize = exports.default = void 0;
|
|
7
7
|
|
|
8
|
+
var _isFunction2 = _interopRequireDefault(require("lodash/isFunction"));
|
|
9
|
+
|
|
8
10
|
var _react = _interopRequireDefault(require("react"));
|
|
9
11
|
|
|
10
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -101,20 +103,24 @@ const BasicStep = props => {
|
|
|
101
103
|
|
|
102
104
|
const classString = (0, _classnames.default)(prefixCls, `${prefixCls}-${status}`, {
|
|
103
105
|
[`${prefixCls}-active`]: active,
|
|
104
|
-
[`${prefixCls}-done`]: done
|
|
105
|
-
[`${prefixCls}-hover`]: onChange || props.onClick,
|
|
106
|
-
[`${prefixCls}-${status}-hover`]: onChange || props.onClick
|
|
106
|
+
[`${prefixCls}-done`]: done
|
|
107
107
|
}, className);
|
|
108
108
|
|
|
109
109
|
const handleClick = e => {
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
if ((0, _isFunction2.default)(onClick)) {
|
|
111
|
+
onClick(e);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
onChange();
|
|
112
115
|
};
|
|
113
116
|
|
|
114
117
|
const handleKeyDown = e => {
|
|
115
118
|
if (e.key === 'Enter') {
|
|
116
|
-
|
|
117
|
-
|
|
119
|
+
if ((0, _isFunction2.default)(onKeyDown)) {
|
|
120
|
+
onKeyDown(e);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
onChange();
|
|
118
124
|
}
|
|
119
125
|
};
|
|
120
126
|
|
|
@@ -63,11 +63,13 @@ const Steps = props => {
|
|
|
63
63
|
|
|
64
64
|
childProps.active = stepNumber === current;
|
|
65
65
|
childProps.done = stepNumber < current;
|
|
66
|
-
|
|
66
|
+
|
|
67
|
+
childProps.onChange = () => {
|
|
67
68
|
if (index !== current) {
|
|
68
69
|
onChange(index + initial);
|
|
69
70
|
}
|
|
70
|
-
}
|
|
71
|
+
};
|
|
72
|
+
|
|
71
73
|
return /*#__PURE__*/(0, _react.cloneElement)(child, Object.assign({}, childProps));
|
|
72
74
|
});
|
|
73
75
|
|
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
+
var _isFunction2 = _interopRequireDefault(require("lodash/isFunction"));
|
|
9
|
+
|
|
8
10
|
var _react = _interopRequireDefault(require("react"));
|
|
9
11
|
|
|
10
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -76,8 +78,7 @@ const FillStep = props => {
|
|
|
76
78
|
[`${prefixCls}-left`]: true,
|
|
77
79
|
[`${prefixCls}-icon`]: 'icon' in props,
|
|
78
80
|
[`${prefixCls}-plain`]: !('icon' in props),
|
|
79
|
-
[`${prefixCls}-icon-process`]: progress
|
|
80
|
-
[`${prefixCls}-hover`]: onChange || onClick
|
|
81
|
+
[`${prefixCls}-icon-process`]: progress
|
|
81
82
|
});
|
|
82
83
|
return inner ? /*#__PURE__*/_react.default.createElement("div", {
|
|
83
84
|
className: cls
|
|
@@ -85,14 +86,20 @@ const FillStep = props => {
|
|
|
85
86
|
};
|
|
86
87
|
|
|
87
88
|
const handleClick = e => {
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
if ((0, _isFunction2.default)(onClick)) {
|
|
90
|
+
onClick(e);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
onChange();
|
|
90
94
|
};
|
|
91
95
|
|
|
92
96
|
const handleKeyDown = e => {
|
|
93
97
|
if (e.key === 'Enter') {
|
|
94
|
-
|
|
95
|
-
|
|
98
|
+
if ((0, _isFunction2.default)(onKeyDown)) {
|
|
99
|
+
onKeyDown(e);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
onChange();
|
|
96
103
|
}
|
|
97
104
|
};
|
|
98
105
|
|
|
@@ -104,7 +111,6 @@ const FillStep = props => {
|
|
|
104
111
|
className: (0, _classnames.default)({
|
|
105
112
|
[prefixCls]: true,
|
|
106
113
|
[`${prefixCls}-${status}`]: Boolean(status),
|
|
107
|
-
[`${prefixCls}-${status}-hover`]: Boolean(status) && (onChange || onClick),
|
|
108
114
|
[`${prefixCls}-clickable`]: onClick
|
|
109
115
|
}, className),
|
|
110
116
|
style: style,
|
|
@@ -65,11 +65,12 @@ const Steps = props => {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
childProps.onChange =
|
|
68
|
+
childProps.onChange = () => {
|
|
69
69
|
if (index !== current) {
|
|
70
70
|
onChange(index + initial);
|
|
71
71
|
}
|
|
72
|
-
}
|
|
72
|
+
};
|
|
73
|
+
|
|
73
74
|
return /*#__PURE__*/_react.default.createElement(_grid.Col, {
|
|
74
75
|
style: colStyle
|
|
75
76
|
}, /*#__PURE__*/(0, _react.cloneElement)(child, Object.assign({}, childProps)));
|