@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/timeline/item.js
CHANGED
|
@@ -17,8 +17,6 @@ var _constants = require("@douyinfe/semi-foundation/lib/cjs/timeline/constants")
|
|
|
17
17
|
|
|
18
18
|
require("@douyinfe/semi-foundation/lib/cjs/timeline/timeline.css");
|
|
19
19
|
|
|
20
|
-
var _context = _interopRequireDefault(require("./context"));
|
|
21
|
-
|
|
22
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
21
|
|
|
24
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -28,39 +26,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
28
26
|
const prefixCls = _constants.cssClasses.ITEM;
|
|
29
27
|
|
|
30
28
|
class Item extends _react.PureComponent {
|
|
31
|
-
constructor() {
|
|
32
|
-
super(...arguments); // getC2DCls is used in C2D, it does not work in non-C2D scenes
|
|
33
|
-
|
|
34
|
-
this.getC2DCls = () => {
|
|
35
|
-
let c2dCls = '';
|
|
36
|
-
const {
|
|
37
|
-
mode,
|
|
38
|
-
odd,
|
|
39
|
-
usedInC2D
|
|
40
|
-
} = this.props;
|
|
41
|
-
|
|
42
|
-
if (usedInC2D) {
|
|
43
|
-
switch (mode) {
|
|
44
|
-
case 'center':
|
|
45
|
-
c2dCls = `${prefixCls}-center ${prefixCls}-left`;
|
|
46
|
-
break;
|
|
47
|
-
|
|
48
|
-
case 'alternate':
|
|
49
|
-
c2dCls = `${prefixCls}-alternate ${prefixCls}-${odd ? 'left' : 'right'}`;
|
|
50
|
-
break;
|
|
51
|
-
|
|
52
|
-
default:
|
|
53
|
-
c2dCls = `${prefixCls}-${mode} ${mode === 'right' ? `${prefixCls}-mode-right` : ''}`;
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
c2dCls += ` ${prefixCls}-not-last-child`;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return c2dCls;
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
29
|
render() {
|
|
65
30
|
const {
|
|
66
31
|
className,
|
|
@@ -73,7 +38,7 @@ class Item extends _react.PureComponent {
|
|
|
73
38
|
extra,
|
|
74
39
|
onClick
|
|
75
40
|
} = this.props;
|
|
76
|
-
const itemCls = (0, _classnames.default)(prefixCls, className
|
|
41
|
+
const itemCls = (0, _classnames.default)(prefixCls, className);
|
|
77
42
|
const dotCls = (0, _classnames.default)({
|
|
78
43
|
[`${prefixCls}-head`]: true,
|
|
79
44
|
[`${prefixCls}-head-custom`]: dot,
|
|
@@ -106,7 +71,6 @@ class Item extends _react.PureComponent {
|
|
|
106
71
|
}
|
|
107
72
|
|
|
108
73
|
exports.default = Item;
|
|
109
|
-
Item.contextType = _context.default;
|
|
110
74
|
Item.propTypes = {
|
|
111
75
|
color: _propTypes.default.string,
|
|
112
76
|
time: _propTypes.default.node,
|
|
@@ -116,13 +80,10 @@ Item.propTypes = {
|
|
|
116
80
|
position: _propTypes.default.oneOf(_constants.strings.ITEM_POS),
|
|
117
81
|
className: _propTypes.default.string,
|
|
118
82
|
style: _propTypes.default.object,
|
|
119
|
-
onClick: _propTypes.default.func
|
|
120
|
-
mode: _propTypes.default.string,
|
|
121
|
-
lastChild: _propTypes.default.bool
|
|
83
|
+
onClick: _propTypes.default.func
|
|
122
84
|
};
|
|
123
85
|
Item.defaultProps = {
|
|
124
86
|
type: 'default',
|
|
125
87
|
time: '',
|
|
126
88
|
onClick: _noop2.default
|
|
127
|
-
};
|
|
128
|
-
Item.elementType = 'Timeline.Item';
|
|
89
|
+
};
|
|
@@ -38,7 +38,7 @@ export default class Title extends PureComponent<TitleProps> {
|
|
|
38
38
|
underline: PropTypes.Requireable<boolean>;
|
|
39
39
|
strong: PropTypes.Requireable<boolean>;
|
|
40
40
|
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
41
|
-
heading: PropTypes.Requireable<
|
|
41
|
+
heading: PropTypes.Requireable<4 | 2 | 1 | 3 | 6 | 5>;
|
|
42
42
|
style: PropTypes.Requireable<object>;
|
|
43
43
|
className: PropTypes.Requireable<string>;
|
|
44
44
|
component: PropTypes.Requireable<string>;
|
package/lib/es/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/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,
|
|
@@ -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>;
|
|
@@ -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>>;
|