@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
package/lib/es/card/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _isString from "lodash/isString";
|
|
2
|
-
import _omit from "lodash/omit";
|
|
3
2
|
|
|
4
3
|
var __rest = this && this.__rest || function (s, e) {
|
|
5
4
|
var t = {};
|
|
@@ -23,53 +22,75 @@ import Typography from '../typography';
|
|
|
23
22
|
import Space from '../space';
|
|
24
23
|
const prefixcls = cssClasses.PREFIX;
|
|
25
24
|
|
|
26
|
-
class
|
|
25
|
+
class Header extends PureComponent {
|
|
26
|
+
render() {
|
|
27
|
+
const {
|
|
28
|
+
title,
|
|
29
|
+
headerExtraContent,
|
|
30
|
+
header,
|
|
31
|
+
headerLine,
|
|
32
|
+
headerStyle
|
|
33
|
+
} = this.props;
|
|
34
|
+
const headerCls = cls(`${prefixcls}-header`, {
|
|
35
|
+
[`${prefixcls}-header-bordered`]: Boolean(headerLine)
|
|
36
|
+
});
|
|
37
|
+
const headerWrapperCls = cls(`${prefixcls}-header-wrapper`);
|
|
38
|
+
const titleCls = cls(`${prefixcls}-header-wrapper-title`, {
|
|
39
|
+
[`${prefixcls}-header-wrapper-spacing`]: Boolean(headerExtraContent)
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
if (header || headerExtraContent || title) {
|
|
43
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
style: headerStyle,
|
|
45
|
+
className: headerCls
|
|
46
|
+
}, header ||
|
|
47
|
+
/*#__PURE__*/
|
|
48
|
+
// Priority of header over title and headerExtraContent
|
|
49
|
+
React.createElement("div", {
|
|
50
|
+
className: headerWrapperCls
|
|
51
|
+
}, headerExtraContent && /*#__PURE__*/React.createElement("div", {
|
|
52
|
+
className: `${prefixcls}-header-wrapper-extra`,
|
|
53
|
+
"x-semi-prop": "headerExtraContent"
|
|
54
|
+
}, headerExtraContent), title && /*#__PURE__*/React.createElement("div", {
|
|
55
|
+
className: titleCls
|
|
56
|
+
}, _isString(title) ? /*#__PURE__*/React.createElement(Typography.Title, {
|
|
57
|
+
heading: 6,
|
|
58
|
+
ellipsis: {
|
|
59
|
+
showTooltip: true,
|
|
60
|
+
rows: 1
|
|
61
|
+
},
|
|
62
|
+
"x-semi-prop": "title"
|
|
63
|
+
}, title) : title)));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
class Footer extends PureComponent {
|
|
72
|
+
render() {
|
|
73
|
+
const {
|
|
74
|
+
footer,
|
|
75
|
+
footerLine,
|
|
76
|
+
footerStyle
|
|
77
|
+
} = this.props;
|
|
78
|
+
const footerCls = cls(`${prefixcls}-footer`, {
|
|
79
|
+
[`${prefixcls}-footer-bordered`]: footerLine
|
|
80
|
+
});
|
|
81
|
+
return footer ? /*#__PURE__*/React.createElement("div", {
|
|
82
|
+
style: footerStyle,
|
|
83
|
+
className: footerCls,
|
|
84
|
+
"x-semi-prop": "footer"
|
|
85
|
+
}, footer) : null;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
class Body extends PureComponent {
|
|
27
91
|
constructor() {
|
|
28
92
|
super(...arguments);
|
|
29
93
|
|
|
30
|
-
this.renderHeader = () => {
|
|
31
|
-
const {
|
|
32
|
-
title,
|
|
33
|
-
headerExtraContent,
|
|
34
|
-
header,
|
|
35
|
-
headerLine,
|
|
36
|
-
headerStyle
|
|
37
|
-
} = this.props;
|
|
38
|
-
const headerCls = cls(`${prefixcls}-header`, {
|
|
39
|
-
[`${prefixcls}-header-bordered`]: Boolean(headerLine)
|
|
40
|
-
});
|
|
41
|
-
const headerWrapperCls = cls(`${prefixcls}-header-wrapper`);
|
|
42
|
-
const titleCls = cls(`${prefixcls}-header-wrapper-title`, {
|
|
43
|
-
[`${prefixcls}-header-wrapper-spacing`]: Boolean(headerExtraContent)
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
if (header || headerExtraContent || title) {
|
|
47
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
48
|
-
style: headerStyle,
|
|
49
|
-
className: headerCls
|
|
50
|
-
}, header ||
|
|
51
|
-
/*#__PURE__*/
|
|
52
|
-
// Priority of header over title and headerExtraContent
|
|
53
|
-
React.createElement("div", {
|
|
54
|
-
className: headerWrapperCls
|
|
55
|
-
}, headerExtraContent && /*#__PURE__*/React.createElement("div", {
|
|
56
|
-
className: `${prefixcls}-header-wrapper-extra`,
|
|
57
|
-
"x-semi-prop": "headerExtraContent"
|
|
58
|
-
}, headerExtraContent), title && /*#__PURE__*/React.createElement("div", {
|
|
59
|
-
className: titleCls
|
|
60
|
-
}, _isString(title) ? /*#__PURE__*/React.createElement(Typography.Title, {
|
|
61
|
-
heading: 6,
|
|
62
|
-
ellipsis: {
|
|
63
|
-
showTooltip: true,
|
|
64
|
-
rows: 1
|
|
65
|
-
},
|
|
66
|
-
"x-semi-prop": "title"
|
|
67
|
-
}, title) : title)));
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return null;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
94
|
this.renderCover = () => {
|
|
74
95
|
const {
|
|
75
96
|
cover
|
|
@@ -86,7 +107,7 @@ class Card extends PureComponent {
|
|
|
86
107
|
bodyStyle,
|
|
87
108
|
children,
|
|
88
109
|
actions,
|
|
89
|
-
loading
|
|
110
|
+
loading = false
|
|
90
111
|
} = this.props;
|
|
91
112
|
const bodyCls = cls(`${prefixcls}-body`);
|
|
92
113
|
const actionsCls = cls(`${prefixcls}-body-actions`);
|
|
@@ -111,51 +132,207 @@ class Card extends PureComponent {
|
|
|
111
132
|
"x-semi-prop": `actions.${idx}`
|
|
112
133
|
}, item)))));
|
|
113
134
|
};
|
|
135
|
+
}
|
|
114
136
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
footer,
|
|
118
|
-
footerLine,
|
|
119
|
-
footerStyle
|
|
120
|
-
} = this.props;
|
|
121
|
-
const footerCls = cls(`${prefixcls}-footer`, {
|
|
122
|
-
[`${prefixcls}-footer-bordered`]: footerLine
|
|
123
|
-
});
|
|
124
|
-
return footer && /*#__PURE__*/React.createElement("div", {
|
|
125
|
-
style: footerStyle,
|
|
126
|
-
className: footerCls,
|
|
127
|
-
"x-semi-prop": "footer"
|
|
128
|
-
}, footer);
|
|
129
|
-
};
|
|
137
|
+
render() {
|
|
138
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, this.renderCover(), this.renderBody());
|
|
130
139
|
}
|
|
131
140
|
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
Header.elementType = 'Card.Header';
|
|
144
|
+
Footer.elementType = 'Card.Footer';
|
|
145
|
+
Body.elementType = 'Card.Body';
|
|
146
|
+
|
|
147
|
+
class Card extends PureComponent {
|
|
148
|
+
// renderHeader = (): ReactNode => {
|
|
149
|
+
// const {
|
|
150
|
+
// title,
|
|
151
|
+
// headerExtraContent,
|
|
152
|
+
// header,
|
|
153
|
+
// headerLine,
|
|
154
|
+
// headerStyle
|
|
155
|
+
// } = this.props;
|
|
156
|
+
// const headerCls = cls(`${prefixcls}-header`, {
|
|
157
|
+
// [`${prefixcls}-header-bordered`]: Boolean(headerLine)
|
|
158
|
+
// });
|
|
159
|
+
// const headerWrapperCls = cls(`${prefixcls}-header-wrapper`);
|
|
160
|
+
// const titleCls = cls(`${prefixcls}-header-wrapper-title`, {
|
|
161
|
+
// [`${prefixcls}-header-wrapper-spacing`]: Boolean(headerExtraContent)
|
|
162
|
+
// });
|
|
163
|
+
// if (header || headerExtraContent || title) {
|
|
164
|
+
// return (
|
|
165
|
+
// <div style={headerStyle} className={headerCls}>
|
|
166
|
+
// {header || ( // Priority of header over title and headerExtraContent
|
|
167
|
+
// <div className={headerWrapperCls}>
|
|
168
|
+
// {headerExtraContent && (
|
|
169
|
+
// <div
|
|
170
|
+
// className={`${prefixcls}-header-wrapper-extra`}
|
|
171
|
+
// x-semi-prop="headerExtraContent"
|
|
172
|
+
// >
|
|
173
|
+
// {headerExtraContent}
|
|
174
|
+
// </div>
|
|
175
|
+
// )}
|
|
176
|
+
// {title && (
|
|
177
|
+
// <div className={titleCls}>
|
|
178
|
+
// {isString(title) ? (
|
|
179
|
+
// <Typography.Title
|
|
180
|
+
// heading={6}
|
|
181
|
+
// ellipsis={{ showTooltip: true, rows: 1 }}
|
|
182
|
+
// x-semi-prop="title"
|
|
183
|
+
// >
|
|
184
|
+
// {title}
|
|
185
|
+
// </Typography.Title>
|
|
186
|
+
// ) : (
|
|
187
|
+
// title
|
|
188
|
+
// )}
|
|
189
|
+
// </div>
|
|
190
|
+
// )}
|
|
191
|
+
// </div>
|
|
192
|
+
// )}
|
|
193
|
+
// </div>
|
|
194
|
+
// );
|
|
195
|
+
// }
|
|
196
|
+
// return null;
|
|
197
|
+
// };
|
|
198
|
+
// renderCover = (): ReactNode => {
|
|
199
|
+
// const {
|
|
200
|
+
// cover
|
|
201
|
+
// } = this.props;
|
|
202
|
+
// const coverCls = cls(`${prefixcls}-cover`);
|
|
203
|
+
// return (
|
|
204
|
+
// cover && (
|
|
205
|
+
// <div className={coverCls} x-semi-prop="cover">
|
|
206
|
+
// {cover}
|
|
207
|
+
// </div>
|
|
208
|
+
// )
|
|
209
|
+
// );
|
|
210
|
+
// };
|
|
211
|
+
// renderBody = (): ReactNode => {
|
|
212
|
+
// const { bodyStyle, children, actions, loading } = this.props;
|
|
213
|
+
// const bodyCls = cls(`${prefixcls}-body`);
|
|
214
|
+
// const actionsCls = cls(`${prefixcls}-body-actions`);
|
|
215
|
+
// const actionsItemCls = cls(`${prefixcls}-body-actions-item`);
|
|
216
|
+
// const placeholder = (
|
|
217
|
+
// <div>
|
|
218
|
+
// <Skeleton.Title />
|
|
219
|
+
// <br />
|
|
220
|
+
// <Skeleton.Paragraph rows={3} />
|
|
221
|
+
// </div>
|
|
222
|
+
// );
|
|
223
|
+
// return (
|
|
224
|
+
// <div style={bodyStyle} className={bodyCls}>
|
|
225
|
+
// {children && (
|
|
226
|
+
// <Skeleton placeholder={placeholder} loading={loading} active>
|
|
227
|
+
// {children}
|
|
228
|
+
// </Skeleton>
|
|
229
|
+
// )}
|
|
230
|
+
// {
|
|
231
|
+
// Array.isArray(actions) &&
|
|
232
|
+
// (
|
|
233
|
+
// <div className={actionsCls}>
|
|
234
|
+
// <Space spacing={12}>
|
|
235
|
+
// {actions.map((item, idx) => (
|
|
236
|
+
// <div key={idx} className={actionsItemCls} x-semi-prop={`actions.${idx}`}>{item}</div>
|
|
237
|
+
// ))}
|
|
238
|
+
// </Space>
|
|
239
|
+
// </div>
|
|
240
|
+
// )
|
|
241
|
+
// }
|
|
242
|
+
// </div>
|
|
243
|
+
// );
|
|
244
|
+
// };
|
|
245
|
+
// renderFooter = (): ReactNode => {
|
|
246
|
+
// const {
|
|
247
|
+
// footer,
|
|
248
|
+
// footerLine,
|
|
249
|
+
// footerStyle
|
|
250
|
+
// } = this.props;
|
|
251
|
+
// const footerCls = cls(`${prefixcls}-footer`, {
|
|
252
|
+
// [`${prefixcls}-footer-bordered`]: footerLine
|
|
253
|
+
// });
|
|
254
|
+
// return (
|
|
255
|
+
// footer && (
|
|
256
|
+
// <div style={footerStyle} className={footerCls} x-semi-prop="footer">
|
|
257
|
+
// {footer}
|
|
258
|
+
// </div>
|
|
259
|
+
// )
|
|
260
|
+
// );
|
|
261
|
+
// };
|
|
132
262
|
render() {
|
|
133
263
|
const _a = this.props,
|
|
134
264
|
{
|
|
135
265
|
bordered,
|
|
136
266
|
shadows,
|
|
137
267
|
style,
|
|
138
|
-
className
|
|
268
|
+
className,
|
|
269
|
+
actions,
|
|
270
|
+
bodyStyle,
|
|
271
|
+
cover,
|
|
272
|
+
headerExtraContent,
|
|
273
|
+
footer,
|
|
274
|
+
footerLine,
|
|
275
|
+
footerStyle,
|
|
276
|
+
header,
|
|
277
|
+
headerLine,
|
|
278
|
+
headerStyle,
|
|
279
|
+
loading,
|
|
280
|
+
title,
|
|
281
|
+
children
|
|
139
282
|
} = _a,
|
|
140
|
-
otherProps = __rest(_a, ["bordered", "shadows", "style", "className"]);
|
|
283
|
+
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
|
|
284
|
+
// 'actions',
|
|
285
|
+
// 'bodyStyle',
|
|
286
|
+
// 'cover',
|
|
287
|
+
// 'headerExtraContent',
|
|
288
|
+
// 'footer',
|
|
289
|
+
// 'footerLine',
|
|
290
|
+
// 'footerStyle',
|
|
291
|
+
// 'header',
|
|
292
|
+
// 'headerLine',
|
|
293
|
+
// 'headerStyle',
|
|
294
|
+
// 'loading',
|
|
295
|
+
// 'title'
|
|
296
|
+
// ]);
|
|
141
297
|
|
|
142
|
-
const others = _omit(otherProps, ['actions', 'bodyStyle', 'cover', 'headerExtraContent', 'footer', 'footerLine', 'footerStyle', 'header', 'headerLine', 'headerStyle', 'loading', 'title']);
|
|
143
298
|
|
|
144
299
|
const cardCls = cls(prefixcls, className, {
|
|
145
300
|
[`${prefixcls}-bordered`]: bordered,
|
|
146
301
|
[`${prefixcls}-shadows`]: shadows,
|
|
147
302
|
[`${prefixcls}-shadows-${shadows}`]: shadows
|
|
148
303
|
});
|
|
149
|
-
|
|
304
|
+
const headProps = {
|
|
305
|
+
title,
|
|
306
|
+
headerExtraContent,
|
|
307
|
+
header,
|
|
308
|
+
headerLine,
|
|
309
|
+
headerStyle
|
|
310
|
+
};
|
|
311
|
+
const bodyProps = {
|
|
312
|
+
cover,
|
|
313
|
+
bodyStyle,
|
|
314
|
+
children,
|
|
315
|
+
actions,
|
|
316
|
+
loading
|
|
317
|
+
};
|
|
318
|
+
const footerProps = {
|
|
319
|
+
footer,
|
|
320
|
+
footerLine,
|
|
321
|
+
footerStyle
|
|
322
|
+
};
|
|
323
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({}, otherProps, {
|
|
150
324
|
"aria-busy": this.props.loading,
|
|
151
325
|
className: cardCls,
|
|
152
326
|
style: style
|
|
153
|
-
}),
|
|
327
|
+
}), /*#__PURE__*/React.createElement(Header, Object.assign({}, headProps)), /*#__PURE__*/React.createElement(Body, Object.assign({}, bodyProps)), /*#__PURE__*/React.createElement(Footer, Object.assign({}, footerProps)));
|
|
154
328
|
}
|
|
155
329
|
|
|
156
330
|
}
|
|
157
331
|
|
|
158
332
|
Card.Meta = Meta;
|
|
333
|
+
Card.Header = Header;
|
|
334
|
+
Card.Footer = Footer;
|
|
335
|
+
Card.Body = Body;
|
|
159
336
|
Card.propTypes = {
|
|
160
337
|
actions: PropTypes.array,
|
|
161
338
|
bodyStyle: PropTypes.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;
|
package/lib/es/cascader/index.js
CHANGED
|
@@ -591,11 +591,6 @@ class Cascader extends BaseComponent {
|
|
|
591
591
|
preventScroll
|
|
592
592
|
});
|
|
593
593
|
}
|
|
594
|
-
},
|
|
595
|
-
blurInput: () => {
|
|
596
|
-
if (this.inputRef && this.inputRef.current) {
|
|
597
|
-
this.inputRef.current.blur();
|
|
598
|
-
}
|
|
599
594
|
}
|
|
600
595
|
};
|
|
601
596
|
const cascaderAdapter = {
|
|
@@ -932,14 +927,6 @@ class Cascader extends BaseComponent {
|
|
|
932
927
|
this.foundation.open();
|
|
933
928
|
}
|
|
934
929
|
|
|
935
|
-
focus() {
|
|
936
|
-
this.foundation.focus();
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
blur() {
|
|
940
|
-
this.foundation.blur();
|
|
941
|
-
}
|
|
942
|
-
|
|
943
930
|
render() {
|
|
944
931
|
const {
|
|
945
932
|
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/es/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/es/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/es/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>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _isFunction from "lodash/isFunction";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
import classnames from 'classnames';
|
|
@@ -86,20 +87,24 @@ const BasicStep = props => {
|
|
|
86
87
|
|
|
87
88
|
const classString = classnames(prefixCls, `${prefixCls}-${status}`, {
|
|
88
89
|
[`${prefixCls}-active`]: active,
|
|
89
|
-
[`${prefixCls}-done`]: done
|
|
90
|
-
[`${prefixCls}-hover`]: onChange || props.onClick,
|
|
91
|
-
[`${prefixCls}-${status}-hover`]: onChange || props.onClick
|
|
90
|
+
[`${prefixCls}-done`]: done
|
|
92
91
|
}, className);
|
|
93
92
|
|
|
94
93
|
const handleClick = e => {
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
if (_isFunction(onClick)) {
|
|
95
|
+
onClick(e);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
onChange();
|
|
97
99
|
};
|
|
98
100
|
|
|
99
101
|
const handleKeyDown = e => {
|
|
100
102
|
if (e.key === 'Enter') {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
+
if (_isFunction(onKeyDown)) {
|
|
104
|
+
onKeyDown(e);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
onChange();
|
|
103
108
|
}
|
|
104
109
|
};
|
|
105
110
|
|
|
@@ -46,11 +46,13 @@ const Steps = props => {
|
|
|
46
46
|
|
|
47
47
|
childProps.active = stepNumber === current;
|
|
48
48
|
childProps.done = stepNumber < current;
|
|
49
|
-
|
|
49
|
+
|
|
50
|
+
childProps.onChange = () => {
|
|
50
51
|
if (index !== current) {
|
|
51
52
|
onChange(index + initial);
|
|
52
53
|
}
|
|
53
|
-
}
|
|
54
|
+
};
|
|
55
|
+
|
|
54
56
|
return /*#__PURE__*/cloneElement(child, Object.assign({}, childProps));
|
|
55
57
|
});
|
|
56
58
|
return content;
|
package/lib/es/steps/fillStep.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _isFunction from "lodash/isFunction";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
import classnames from 'classnames';
|
|
@@ -63,8 +64,7 @@ const FillStep = props => {
|
|
|
63
64
|
[`${prefixCls}-left`]: true,
|
|
64
65
|
[`${prefixCls}-icon`]: 'icon' in props,
|
|
65
66
|
[`${prefixCls}-plain`]: !('icon' in props),
|
|
66
|
-
[`${prefixCls}-icon-process`]: progress
|
|
67
|
-
[`${prefixCls}-hover`]: onChange || onClick
|
|
67
|
+
[`${prefixCls}-icon-process`]: progress
|
|
68
68
|
});
|
|
69
69
|
return inner ? /*#__PURE__*/React.createElement("div", {
|
|
70
70
|
className: cls
|
|
@@ -72,14 +72,20 @@ const FillStep = props => {
|
|
|
72
72
|
};
|
|
73
73
|
|
|
74
74
|
const handleClick = e => {
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
if (_isFunction(onClick)) {
|
|
76
|
+
onClick(e);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
onChange();
|
|
77
80
|
};
|
|
78
81
|
|
|
79
82
|
const handleKeyDown = e => {
|
|
80
83
|
if (e.key === 'Enter') {
|
|
81
|
-
|
|
82
|
-
|
|
84
|
+
if (_isFunction(onKeyDown)) {
|
|
85
|
+
onKeyDown(e);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
onChange();
|
|
83
89
|
}
|
|
84
90
|
};
|
|
85
91
|
|
|
@@ -91,7 +97,6 @@ const FillStep = props => {
|
|
|
91
97
|
className: classnames({
|
|
92
98
|
[prefixCls]: true,
|
|
93
99
|
[`${prefixCls}-${status}`]: Boolean(status),
|
|
94
|
-
[`${prefixCls}-${status}-hover`]: Boolean(status) && (onChange || onClick),
|
|
95
100
|
[`${prefixCls}-clickable`]: onClick
|
|
96
101
|
}, className),
|
|
97
102
|
style: style,
|
|
@@ -46,11 +46,12 @@ const Steps = props => {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
childProps.onChange =
|
|
49
|
+
childProps.onChange = () => {
|
|
50
50
|
if (index !== current) {
|
|
51
51
|
onChange(index + initial);
|
|
52
52
|
}
|
|
53
|
-
}
|
|
53
|
+
};
|
|
54
|
+
|
|
54
55
|
return /*#__PURE__*/React.createElement(Col, {
|
|
55
56
|
style: colStyle
|
|
56
57
|
}, /*#__PURE__*/cloneElement(child, Object.assign({}, childProps)));
|
package/lib/es/steps/index.d.ts
CHANGED
package/lib/es/steps/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import _noop from "lodash/noop";
|
|
2
|
+
|
|
1
3
|
var __rest = this && this.__rest || function (s, e) {
|
|
2
4
|
var t = {};
|
|
3
5
|
|
|
@@ -61,6 +63,7 @@ Steps.propTypes = {
|
|
|
61
63
|
size: PropTypes.oneOf(['small', 'default'])
|
|
62
64
|
};
|
|
63
65
|
Steps.defaultProps = {
|
|
66
|
+
onChange: _noop,
|
|
64
67
|
type: 'fill',
|
|
65
68
|
size: 'default'
|
|
66
69
|
};
|
package/lib/es/steps/navStep.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _isFunction from "lodash/isFunction";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
import classnames from 'classnames';
|
|
@@ -22,14 +23,20 @@ const NavStep = props => {
|
|
|
22
23
|
}, className);
|
|
23
24
|
|
|
24
25
|
const handleClick = e => {
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
if (_isFunction(onClick)) {
|
|
27
|
+
onClick(e);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
onChange();
|
|
27
31
|
};
|
|
28
32
|
|
|
29
33
|
const handleKeyDown = e => {
|
|
30
34
|
if (e.key === 'Enter') {
|
|
31
|
-
|
|
32
|
-
|
|
35
|
+
if (_isFunction(onKeyDown)) {
|
|
36
|
+
onKeyDown(e);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
onChange();
|
|
33
40
|
}
|
|
34
41
|
};
|
|
35
42
|
|
package/lib/es/steps/navSteps.js
CHANGED
|
@@ -27,11 +27,13 @@ const Steps = props => {
|
|
|
27
27
|
total
|
|
28
28
|
}, child.props);
|
|
29
29
|
childProps.active = index === current;
|
|
30
|
-
|
|
30
|
+
|
|
31
|
+
childProps.onChange = () => {
|
|
31
32
|
if (index !== current) {
|
|
32
33
|
onChange(index + initial);
|
|
33
34
|
}
|
|
34
|
-
}
|
|
35
|
+
};
|
|
36
|
+
|
|
35
37
|
return /*#__PURE__*/cloneElement(child, Object.assign({}, childProps));
|
|
36
38
|
});
|
|
37
39
|
return content;
|
|
@@ -4,7 +4,6 @@ import Store from '@douyinfe/semi-foundation/lib/es/utils/Store';
|
|
|
4
4
|
import { BaseProps } from '../../_base/baseComponent';
|
|
5
5
|
import { ExpandedRowRender, Virtualized, GetVirtualizedListRef, ColumnProps, Size, BodyScrollEvent, Scroll, Fixed, TableComponents, RowExpandable, VirtualizedOnScroll, RowKey } from '../interface';
|
|
6
6
|
export interface BodyProps extends BaseProps {
|
|
7
|
-
tableLayout?: 'fixed' | 'auto';
|
|
8
7
|
anyColumnFixed?: boolean;
|
|
9
8
|
columns?: ColumnProps[];
|
|
10
9
|
dataSource?: Record<string, any>[];
|