@douyinfe/semi-ui 2.34.0-alpha.1 → 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 +23 -493
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +297 -236
- 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/card/index.d.ts +36 -4
- package/lib/cjs/card/index.js +244 -67
- 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/navigation/Item.d.ts +0 -4
- package/lib/cjs/navigation/Item.js +10 -29
- package/lib/cjs/navigation/SubNav.d.ts +0 -5
- package/lib/cjs/navigation/SubNav.js +26 -51
- package/lib/cjs/skeleton/index.d.ts +0 -1
- package/lib/cjs/skeleton/index.js +0 -1
- package/lib/cjs/skeleton/item.d.ts +0 -1
- package/lib/cjs/skeleton/item.js +1 -6
- package/lib/cjs/steps/basicStep.d.ts +0 -3
- package/lib/cjs/steps/basicStep.js +2 -8
- package/lib/cjs/steps/basicSteps.js +1 -2
- package/lib/cjs/steps/fillStep.d.ts +0 -2
- package/lib/cjs/steps/fillStep.js +1 -3
- package/lib/cjs/steps/fillSteps.js +8 -5
- package/lib/cjs/steps/index.d.ts +1 -63
- package/lib/cjs/steps/index.js +0 -9
- package/lib/cjs/steps/navStep.d.ts +0 -3
- package/lib/cjs/steps/navStep.js +2 -6
- package/lib/cjs/steps/navSteps.js +1 -2
- package/lib/cjs/steps/step.d.ts +1 -4
- package/lib/cjs/steps/step.js +0 -1
- package/lib/cjs/timeline/index.d.ts +1 -2
- package/lib/cjs/timeline/index.js +2 -8
- package/lib/cjs/timeline/item.d.ts +0 -10
- package/lib/cjs/timeline/item.js +3 -42
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/es/card/index.d.ts +36 -4
- package/lib/es/card/index.js +243 -66
- 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/navigation/Item.d.ts +0 -4
- package/lib/es/navigation/Item.js +10 -28
- package/lib/es/navigation/SubNav.d.ts +0 -5
- package/lib/es/navigation/SubNav.js +26 -52
- package/lib/es/skeleton/index.d.ts +0 -1
- package/lib/es/skeleton/index.js +0 -1
- package/lib/es/skeleton/item.d.ts +0 -1
- package/lib/es/skeleton/item.js +1 -6
- package/lib/es/steps/basicStep.d.ts +0 -3
- package/lib/es/steps/basicStep.js +2 -8
- package/lib/es/steps/basicSteps.js +1 -2
- package/lib/es/steps/fillStep.d.ts +0 -2
- package/lib/es/steps/fillStep.js +1 -3
- package/lib/es/steps/fillSteps.js +8 -6
- package/lib/es/steps/index.d.ts +1 -63
- package/lib/es/steps/index.js +0 -6
- package/lib/es/steps/navStep.d.ts +0 -3
- package/lib/es/steps/navStep.js +2 -6
- package/lib/es/steps/navSteps.js +1 -2
- package/lib/es/steps/step.d.ts +1 -4
- package/lib/es/steps/step.js +0 -1
- package/lib/es/timeline/index.d.ts +1 -2
- package/lib/es/timeline/index.js +2 -7
- package/lib/es/timeline/item.d.ts +0 -10
- package/lib/es/timeline/item.js +3 -41
- package/lib/es/typography/title.d.ts +1 -1
- package/package.json +8 -8
- package/lib/cjs/timeline/context.d.ts +0 -8
- package/lib/cjs/timeline/context.js +0 -15
- package/lib/es/timeline/context.d.ts +0 -8
- package/lib/es/timeline/context.js +0 -3
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,
|
|
@@ -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>;
|
|
@@ -19,9 +19,6 @@ export interface NavItemProps extends ItemProps, BaseProps {
|
|
|
19
19
|
onClick?(clickItems: SelectedData): void;
|
|
20
20
|
onMouseEnter?: React.MouseEventHandler<HTMLLIElement>;
|
|
21
21
|
onMouseLeave?: React.MouseEventHandler<HTMLLIElement>;
|
|
22
|
-
selected?: boolean;
|
|
23
|
-
mode?: string;
|
|
24
|
-
isInSubNav?: boolean;
|
|
25
22
|
}
|
|
26
23
|
export interface SelectedData extends SelectedItemProps<NavItemProps> {
|
|
27
24
|
text?: React.ReactNode;
|
|
@@ -31,7 +28,6 @@ export interface NavItemState {
|
|
|
31
28
|
}
|
|
32
29
|
export default class NavItem extends BaseComponent<NavItemProps, NavItemState> {
|
|
33
30
|
static contextType: React.Context<NavContextType>;
|
|
34
|
-
static elementType: string;
|
|
35
31
|
static propTypes: {
|
|
36
32
|
text: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
37
33
|
itemKey: PropTypes.Requireable<NonNullable<string | number>>;
|
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _isUndefined2 = _interopRequireDefault(require("lodash/isUndefined"));
|
|
9
|
-
|
|
10
8
|
var _times2 = _interopRequireDefault(require("lodash/times"));
|
|
11
9
|
|
|
12
10
|
var _noop2 = _interopRequireDefault(require("lodash/noop"));
|
|
@@ -123,28 +121,21 @@ class NavItem extends _baseComponent.default {
|
|
|
123
121
|
notifyMouseLeave: function () {
|
|
124
122
|
return _this.props.onMouseLeave(...arguments);
|
|
125
123
|
},
|
|
126
|
-
getIsCollapsed: () => this.props.isCollapsed || Boolean(this.context && this.context.isCollapsed),
|
|
127
|
-
getSelected: () =>
|
|
128
|
-
getIsOpen: () => Boolean(this.context && this.context.openKeys && this.context.openKeys.includes(this.props.itemKey))
|
|
129
|
-
getIsInSubNav: () => this.props.isInSubNav || Boolean(this.context && this.context.isInSubNav),
|
|
130
|
-
getMode: () => {
|
|
131
|
-
var _a, _b;
|
|
132
|
-
|
|
133
|
-
return (_a = this.props.mode) !== null && _a !== void 0 ? _a : (_b = this.context) === null || _b === void 0 ? void 0 : _b.mode;
|
|
134
|
-
}
|
|
124
|
+
getIsCollapsed: () => this.props.isCollapsed || Boolean(this.context && this.context.isCollapsed) || false,
|
|
125
|
+
getSelected: () => Boolean(this.context && this.context.selectedKeys && this.context.selectedKeys.includes(this.props.itemKey)),
|
|
126
|
+
getIsOpen: () => Boolean(this.context && this.context.openKeys && this.context.openKeys.includes(this.props.itemKey))
|
|
135
127
|
});
|
|
136
128
|
}
|
|
137
129
|
|
|
138
130
|
renderIcon(icon, pos) {
|
|
139
131
|
let isToggleIcon = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
140
132
|
let key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
141
|
-
const mode = this.adapter.getMode();
|
|
142
133
|
|
|
143
134
|
if (this.props.isSubNav) {
|
|
144
135
|
return null;
|
|
145
136
|
}
|
|
146
137
|
|
|
147
|
-
if (!icon && mode === _constants.strings.MODE_HORIZONTAL) {
|
|
138
|
+
if (!icon && this.context.mode === _constants.strings.MODE_HORIZONTAL) {
|
|
148
139
|
return null;
|
|
149
140
|
}
|
|
150
141
|
|
|
@@ -167,8 +158,6 @@ class NavItem extends _baseComponent.default {
|
|
|
167
158
|
}
|
|
168
159
|
|
|
169
160
|
render() {
|
|
170
|
-
var _a;
|
|
171
|
-
|
|
172
161
|
const {
|
|
173
162
|
text,
|
|
174
163
|
children,
|
|
@@ -184,17 +173,16 @@ class NavItem extends _baseComponent.default {
|
|
|
184
173
|
linkOptions,
|
|
185
174
|
disabled,
|
|
186
175
|
level = 0,
|
|
187
|
-
tabIndex
|
|
188
|
-
mode: modeInProps
|
|
176
|
+
tabIndex
|
|
189
177
|
} = this.props;
|
|
190
178
|
const {
|
|
179
|
+
mode,
|
|
180
|
+
isInSubNav,
|
|
191
181
|
prefixCls,
|
|
192
182
|
limitIndent
|
|
193
183
|
} = this.context;
|
|
194
184
|
const isCollapsed = this.adapter.getIsCollapsed();
|
|
195
185
|
const selected = this.adapter.getSelected();
|
|
196
|
-
const isInSubNav = this.adapter.getIsInSubNav();
|
|
197
|
-
const mode = this.adapter.getMode();
|
|
198
186
|
let itemChildren = null;
|
|
199
187
|
|
|
200
188
|
if (!(0, _isNullOrUndefined.default)(children)) {
|
|
@@ -242,20 +230,14 @@ class NavItem extends _baseComponent.default {
|
|
|
242
230
|
onKeyDown: this.handleKeyPress
|
|
243
231
|
}, itemChildren);
|
|
244
232
|
} else {
|
|
245
|
-
//
|
|
246
|
-
// 当 this.props.isInSubNav 存在是,则由 this.props.isInSubNav 决定
|
|
247
|
-
// 否则由 this.context?.mode 决定,因为第一层节点无context
|
|
248
|
-
const isFirstLayer = !(0, _isUndefined2.default)(this.props.isInSubNav) ? !this.props.isInSubNav : (0, _isUndefined2.default)((_a = this.context) === null || _a === void 0 ? void 0 : _a.mode); // Items are divided into normal and sub-wrap
|
|
249
|
-
|
|
233
|
+
// Items are divided into normal and sub-wrap
|
|
250
234
|
const popoverItemCls = (0, _classnames.default)(`${className || `${clsPrefix}-normal`}`, {
|
|
251
235
|
[clsPrefix]: true,
|
|
252
236
|
[`${clsPrefix}-sub`]: isSubNav,
|
|
253
237
|
[`${clsPrefix}-selected`]: selected && !isSubNav,
|
|
254
238
|
[`${clsPrefix}-collapsed`]: isCollapsed,
|
|
255
239
|
[`${clsPrefix}-disabled`]: disabled,
|
|
256
|
-
[`${clsPrefix}-has-link`]: typeof link === 'string'
|
|
257
|
-
[`${_constants.cssClasses.PREFIX}-first-layer`]: isFirstLayer,
|
|
258
|
-
[`${clsPrefix}-horizontal`]: modeInProps === _constants.strings.MODE_HORIZONTAL
|
|
240
|
+
[`${clsPrefix}-has-link`]: typeof link === 'string'
|
|
259
241
|
});
|
|
260
242
|
const ariaProps = {
|
|
261
243
|
'aria-disabled': disabled
|
|
@@ -335,5 +317,4 @@ NavItem.defaultProps = {
|
|
|
335
317
|
onMouseLeave: _noop2.default,
|
|
336
318
|
disabled: false,
|
|
337
319
|
tabIndex: 0
|
|
338
|
-
};
|
|
339
|
-
NavItem.elementType = 'Nav.Item';
|
|
320
|
+
};
|
|
@@ -22,14 +22,11 @@ export interface SubNavProps extends BaseProps {
|
|
|
22
22
|
onMouseLeave?: React.MouseEventHandler<HTMLLIElement>;
|
|
23
23
|
text?: React.ReactNode;
|
|
24
24
|
toggleIcon?: ToggleIcon;
|
|
25
|
-
active?: boolean;
|
|
26
|
-
mode?: string;
|
|
27
25
|
}
|
|
28
26
|
export interface SubNavState {
|
|
29
27
|
isHovered: boolean;
|
|
30
28
|
}
|
|
31
29
|
export default class SubNav extends BaseComponent<SubNavProps, SubNavState> {
|
|
32
|
-
static elementType: string;
|
|
33
30
|
static contextType: React.Context<NavContextType>;
|
|
34
31
|
static propTypes: {
|
|
35
32
|
/**
|
|
@@ -73,7 +70,6 @@ export default class SubNav extends BaseComponent<SubNavProps, SubNavState> {
|
|
|
73
70
|
onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
|
|
74
71
|
disabled: PropTypes.Requireable<boolean>;
|
|
75
72
|
level: PropTypes.Requireable<number>;
|
|
76
|
-
active: PropTypes.Requireable<boolean>;
|
|
77
73
|
};
|
|
78
74
|
static defaultProps: {
|
|
79
75
|
level: number;
|
|
@@ -86,7 +82,6 @@ export default class SubNav extends BaseComponent<SubNavProps, SubNavState> {
|
|
|
86
82
|
closed: JSX.Element;
|
|
87
83
|
};
|
|
88
84
|
disabled: boolean;
|
|
89
|
-
active: boolean;
|
|
90
85
|
};
|
|
91
86
|
titleRef: React.RefObject<HTMLDivElement>;
|
|
92
87
|
itemRef: React.RefObject<HTMLLIElement>;
|