@douyinfe/semi-ui 2.34.0 → 2.34.1-alpha.3
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 +21 -45
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +41228 -40825
- 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/anchor/index.d.ts +1 -1
- package/lib/cjs/autoComplete/index.d.ts +1 -1
- package/lib/cjs/breadcrumb/item.js +1 -1
- package/lib/cjs/button/Button.d.ts +1 -1
- package/lib/cjs/button/buttonGroup.d.ts +1 -1
- package/lib/cjs/button/index.d.ts +1 -1
- package/lib/cjs/calendar/interface.d.ts +2 -2
- package/lib/cjs/card/index.d.ts +37 -4
- package/lib/cjs/card/index.js +248 -67
- package/lib/cjs/cascader/index.d.ts +0 -2
- package/lib/cjs/cascader/index.js +0 -13
- package/lib/cjs/datePicker/dateInput.d.ts +1 -1
- package/lib/cjs/datePicker/datePicker.d.ts +2 -2
- package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
- package/lib/cjs/datePicker/yearAndMonth.d.ts +1 -1
- package/lib/cjs/form/baseForm.d.ts +2 -2
- package/lib/cjs/form/field.d.ts +2 -2
- package/lib/cjs/form/group.js +2 -4
- package/lib/cjs/image/image.d.ts +0 -4
- package/lib/cjs/image/image.js +1 -23
- package/lib/cjs/image/preview.d.ts +1 -1
- package/lib/cjs/image/preview.js +16 -9
- package/lib/cjs/image/previewContext.d.ts +0 -1
- package/lib/cjs/input/index.d.ts +1 -1
- package/lib/cjs/input/inputGroup.d.ts +1 -1
- package/lib/cjs/modal/confirm.d.ts +19 -19
- package/lib/cjs/rating/index.d.ts +1 -1
- package/lib/cjs/rating/item.d.ts +1 -1
- 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/switch/index.d.ts +1 -1
- 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.d.ts +2 -2
- package/lib/cjs/table/Table.js +14 -41
- 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/index.d.ts +1 -1
- package/lib/cjs/table/interface.d.ts +1 -2
- package/lib/cjs/tagInput/index.d.ts +1 -1
- package/lib/cjs/timePicker/TimePicker.d.ts +1 -1
- package/lib/cjs/timePicker/index.d.ts +1 -1
- 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 -36
- package/lib/es/anchor/index.d.ts +1 -1
- package/lib/es/autoComplete/index.d.ts +1 -1
- package/lib/es/breadcrumb/item.js +1 -1
- package/lib/es/button/Button.d.ts +1 -1
- package/lib/es/button/buttonGroup.d.ts +1 -1
- package/lib/es/button/index.d.ts +1 -1
- package/lib/es/calendar/interface.d.ts +2 -2
- package/lib/es/card/index.d.ts +37 -4
- package/lib/es/card/index.js +247 -66
- package/lib/es/cascader/index.d.ts +0 -2
- package/lib/es/cascader/index.js +0 -13
- package/lib/es/datePicker/dateInput.d.ts +1 -1
- package/lib/es/datePicker/datePicker.d.ts +2 -2
- package/lib/es/datePicker/monthsGrid.d.ts +1 -1
- package/lib/es/datePicker/yearAndMonth.d.ts +1 -1
- package/lib/es/form/baseForm.d.ts +2 -2
- package/lib/es/form/field.d.ts +2 -2
- package/lib/es/form/group.js +2 -4
- package/lib/es/image/image.d.ts +0 -4
- package/lib/es/image/image.js +1 -23
- package/lib/es/image/preview.d.ts +1 -1
- package/lib/es/image/preview.js +16 -9
- package/lib/es/image/previewContext.d.ts +0 -1
- package/lib/es/input/index.d.ts +1 -1
- package/lib/es/input/inputGroup.d.ts +1 -1
- package/lib/es/modal/confirm.d.ts +19 -19
- package/lib/es/rating/index.d.ts +1 -1
- package/lib/es/rating/item.d.ts +1 -1
- 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/switch/index.d.ts +1 -1
- 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.d.ts +2 -2
- package/lib/es/table/Table.js +14 -41
- 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/index.d.ts +1 -1
- package/lib/es/table/interface.d.ts +1 -2
- package/lib/es/tagInput/index.d.ts +1 -1
- package/lib/es/timePicker/TimePicker.d.ts +1 -1
- package/lib/es/timePicker/index.d.ts +1 -1
- 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 -36
- package/package.json +9 -8
|
@@ -39,7 +39,7 @@ declare class Anchor extends BaseComponent<AnchorProps, AnchorState> {
|
|
|
39
39
|
static contextType: React.Context<ContextValue>;
|
|
40
40
|
static Link: typeof Link;
|
|
41
41
|
static PropTypes: {
|
|
42
|
-
size: PropTypes.Requireable<"
|
|
42
|
+
size: PropTypes.Requireable<"small" | "default">;
|
|
43
43
|
railTheme: PropTypes.Requireable<"primary" | "tertiary" | "muted">;
|
|
44
44
|
className: PropTypes.Requireable<string>;
|
|
45
45
|
style: PropTypes.Requireable<object>;
|
|
@@ -125,7 +125,7 @@ declare class AutoComplete<T extends AutoCompleteItems> extends BaseComponent<Au
|
|
|
125
125
|
renderSelectedItem: PropTypes.Requireable<(...args: any[]) => any>;
|
|
126
126
|
suffix: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
127
127
|
showClear: PropTypes.Requireable<boolean>;
|
|
128
|
-
size: PropTypes.Requireable<"
|
|
128
|
+
size: PropTypes.Requireable<"small" | "default" | "large">;
|
|
129
129
|
style: PropTypes.Requireable<object>;
|
|
130
130
|
stopPropagation: PropTypes.Requireable<NonNullable<string | boolean>>;
|
|
131
131
|
maxHeight: PropTypes.Requireable<NonNullable<string | number>>;
|
|
@@ -47,7 +47,7 @@ export default class Button extends PureComponent<ButtonProps> {
|
|
|
47
47
|
disabled: PropTypes.Requireable<boolean>;
|
|
48
48
|
prefixCls: PropTypes.Requireable<string>;
|
|
49
49
|
style: PropTypes.Requireable<object>;
|
|
50
|
-
size: PropTypes.Requireable<"
|
|
50
|
+
size: PropTypes.Requireable<"small" | "default" | "large">;
|
|
51
51
|
type: PropTypes.Requireable<"warning" | "primary" | "tertiary" | "secondary" | "danger">;
|
|
52
52
|
block: PropTypes.Requireable<boolean>;
|
|
53
53
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -18,7 +18,7 @@ export default class ButtonGroup extends BaseComponent<ButtonGroupProps> {
|
|
|
18
18
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
19
19
|
disabled: PropTypes.Requireable<boolean>;
|
|
20
20
|
type: PropTypes.Requireable<string>;
|
|
21
|
-
size: PropTypes.Requireable<"
|
|
21
|
+
size: PropTypes.Requireable<"small" | "default" | "large">;
|
|
22
22
|
theme: PropTypes.Requireable<"solid" | "light" | "borderless">;
|
|
23
23
|
'aria-label': PropTypes.Requireable<string>;
|
|
24
24
|
};
|
|
@@ -22,7 +22,7 @@ declare class Button extends React.PureComponent<ButtonProps> {
|
|
|
22
22
|
onMouseEnter: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
23
23
|
onMouseLeave: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
24
24
|
disabled: import("prop-types").Requireable<boolean>;
|
|
25
|
-
size: import("prop-types").Requireable<"
|
|
25
|
+
size: import("prop-types").Requireable<"small" | "default" | "large">;
|
|
26
26
|
type: import("prop-types").Requireable<"warning" | "primary" | "tertiary" | "secondary" | "danger">;
|
|
27
27
|
block: import("prop-types").Requireable<boolean>;
|
|
28
28
|
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
@@ -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,45 @@ 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
|
+
style?: CSSProperties;
|
|
64
|
+
}
|
|
65
|
+
declare class Header extends PureComponent<CardHeaderProps> {
|
|
66
|
+
static elementType: string;
|
|
67
|
+
render(): JSX.Element;
|
|
68
|
+
}
|
|
69
|
+
declare class Footer extends PureComponent<CardFooterProps> {
|
|
70
|
+
static elementType: string;
|
|
71
|
+
render(): JSX.Element;
|
|
72
|
+
}
|
|
73
|
+
declare class Body extends PureComponent<CardBodyProps> {
|
|
74
|
+
static elementType: string;
|
|
75
|
+
renderCover: () => ReactNode;
|
|
76
|
+
renderBody: () => ReactNode;
|
|
77
|
+
render(): JSX.Element;
|
|
78
|
+
}
|
|
45
79
|
declare class Card extends PureComponent<CardProps> {
|
|
46
80
|
static Meta: typeof Meta;
|
|
81
|
+
static Header: typeof Header;
|
|
82
|
+
static Footer: typeof Footer;
|
|
83
|
+
static Body: typeof Body;
|
|
47
84
|
static propTypes: {
|
|
48
85
|
actions: PropTypes.Requireable<any[]>;
|
|
49
86
|
bodyStyle: PropTypes.Requireable<object>;
|
|
@@ -70,10 +107,6 @@ declare class Card extends PureComponent<CardProps> {
|
|
|
70
107
|
headerLine: boolean;
|
|
71
108
|
loading: boolean;
|
|
72
109
|
};
|
|
73
|
-
renderHeader: () => ReactNode;
|
|
74
|
-
renderCover: () => ReactNode;
|
|
75
|
-
renderBody: () => ReactNode;
|
|
76
|
-
renderFooter: () => ReactNode;
|
|
77
110
|
render(): ReactNode;
|
|
78
111
|
}
|
|
79
112
|
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
|
+
}, title && /*#__PURE__*/_react.default.createElement("div", {
|
|
74
|
+
className: titleCls
|
|
75
|
+
}, (0, _isString2.default)(title) ? /*#__PURE__*/_react.default.createElement(_typography.default.Title, {
|
|
76
|
+
heading: 6,
|
|
77
|
+
ellipsis: {
|
|
78
|
+
showTooltip: true,
|
|
79
|
+
rows: 1
|
|
80
|
+
},
|
|
81
|
+
"x-semi-prop": "title"
|
|
82
|
+
}, title) : title), headerExtraContent && /*#__PURE__*/_react.default.createElement("div", {
|
|
83
|
+
className: `${prefixcls}-header-wrapper-extra`,
|
|
84
|
+
"x-semi-prop": "headerExtraContent"
|
|
85
|
+
}, headerExtraContent)));
|
|
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,211 @@ class Card extends _react.PureComponent {
|
|
|
136
156
|
"x-semi-prop": `actions.${idx}`
|
|
137
157
|
}, item)))));
|
|
138
158
|
};
|
|
159
|
+
}
|
|
139
160
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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
|
+
const bodyWrapperCls = (0, _classnames.default)(`${prefixcls}-body-wrapper`);
|
|
163
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
164
|
+
className: bodyWrapperCls,
|
|
165
|
+
style: this.props.style
|
|
166
|
+
}, this.renderCover(), this.renderBody());
|
|
155
167
|
}
|
|
156
168
|
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
Header.elementType = 'Card.Header';
|
|
172
|
+
Footer.elementType = 'Card.Footer';
|
|
173
|
+
Body.elementType = 'Card.Body';
|
|
174
|
+
|
|
175
|
+
class Card extends _react.PureComponent {
|
|
176
|
+
// renderHeader = (): ReactNode => {
|
|
177
|
+
// const {
|
|
178
|
+
// title,
|
|
179
|
+
// headerExtraContent,
|
|
180
|
+
// header,
|
|
181
|
+
// headerLine,
|
|
182
|
+
// headerStyle
|
|
183
|
+
// } = this.props;
|
|
184
|
+
// const headerCls = cls(`${prefixcls}-header`, {
|
|
185
|
+
// [`${prefixcls}-header-bordered`]: Boolean(headerLine)
|
|
186
|
+
// });
|
|
187
|
+
// const headerWrapperCls = cls(`${prefixcls}-header-wrapper`);
|
|
188
|
+
// const titleCls = cls(`${prefixcls}-header-wrapper-title`, {
|
|
189
|
+
// [`${prefixcls}-header-wrapper-spacing`]: Boolean(headerExtraContent)
|
|
190
|
+
// });
|
|
191
|
+
// if (header || headerExtraContent || title) {
|
|
192
|
+
// return (
|
|
193
|
+
// <div style={headerStyle} className={headerCls}>
|
|
194
|
+
// {header || ( // Priority of header over title and headerExtraContent
|
|
195
|
+
// <div className={headerWrapperCls}>
|
|
196
|
+
// {headerExtraContent && (
|
|
197
|
+
// <div
|
|
198
|
+
// className={`${prefixcls}-header-wrapper-extra`}
|
|
199
|
+
// x-semi-prop="headerExtraContent"
|
|
200
|
+
// >
|
|
201
|
+
// {headerExtraContent}
|
|
202
|
+
// </div>
|
|
203
|
+
// )}
|
|
204
|
+
// {title && (
|
|
205
|
+
// <div className={titleCls}>
|
|
206
|
+
// {isString(title) ? (
|
|
207
|
+
// <Typography.Title
|
|
208
|
+
// heading={6}
|
|
209
|
+
// ellipsis={{ showTooltip: true, rows: 1 }}
|
|
210
|
+
// x-semi-prop="title"
|
|
211
|
+
// >
|
|
212
|
+
// {title}
|
|
213
|
+
// </Typography.Title>
|
|
214
|
+
// ) : (
|
|
215
|
+
// title
|
|
216
|
+
// )}
|
|
217
|
+
// </div>
|
|
218
|
+
// )}
|
|
219
|
+
// </div>
|
|
220
|
+
// )}
|
|
221
|
+
// </div>
|
|
222
|
+
// );
|
|
223
|
+
// }
|
|
224
|
+
// return null;
|
|
225
|
+
// };
|
|
226
|
+
// renderCover = (): ReactNode => {
|
|
227
|
+
// const {
|
|
228
|
+
// cover
|
|
229
|
+
// } = this.props;
|
|
230
|
+
// const coverCls = cls(`${prefixcls}-cover`);
|
|
231
|
+
// return (
|
|
232
|
+
// cover && (
|
|
233
|
+
// <div className={coverCls} x-semi-prop="cover">
|
|
234
|
+
// {cover}
|
|
235
|
+
// </div>
|
|
236
|
+
// )
|
|
237
|
+
// );
|
|
238
|
+
// };
|
|
239
|
+
// renderBody = (): ReactNode => {
|
|
240
|
+
// const { bodyStyle, children, actions, loading } = this.props;
|
|
241
|
+
// const bodyCls = cls(`${prefixcls}-body`);
|
|
242
|
+
// const actionsCls = cls(`${prefixcls}-body-actions`);
|
|
243
|
+
// const actionsItemCls = cls(`${prefixcls}-body-actions-item`);
|
|
244
|
+
// const placeholder = (
|
|
245
|
+
// <div>
|
|
246
|
+
// <Skeleton.Title />
|
|
247
|
+
// <br />
|
|
248
|
+
// <Skeleton.Paragraph rows={3} />
|
|
249
|
+
// </div>
|
|
250
|
+
// );
|
|
251
|
+
// return (
|
|
252
|
+
// <div style={bodyStyle} className={bodyCls}>
|
|
253
|
+
// {children && (
|
|
254
|
+
// <Skeleton placeholder={placeholder} loading={loading} active>
|
|
255
|
+
// {children}
|
|
256
|
+
// </Skeleton>
|
|
257
|
+
// )}
|
|
258
|
+
// {
|
|
259
|
+
// Array.isArray(actions) &&
|
|
260
|
+
// (
|
|
261
|
+
// <div className={actionsCls}>
|
|
262
|
+
// <Space spacing={12}>
|
|
263
|
+
// {actions.map((item, idx) => (
|
|
264
|
+
// <div key={idx} className={actionsItemCls} x-semi-prop={`actions.${idx}`}>{item}</div>
|
|
265
|
+
// ))}
|
|
266
|
+
// </Space>
|
|
267
|
+
// </div>
|
|
268
|
+
// )
|
|
269
|
+
// }
|
|
270
|
+
// </div>
|
|
271
|
+
// );
|
|
272
|
+
// };
|
|
273
|
+
// renderFooter = (): ReactNode => {
|
|
274
|
+
// const {
|
|
275
|
+
// footer,
|
|
276
|
+
// footerLine,
|
|
277
|
+
// footerStyle
|
|
278
|
+
// } = this.props;
|
|
279
|
+
// const footerCls = cls(`${prefixcls}-footer`, {
|
|
280
|
+
// [`${prefixcls}-footer-bordered`]: footerLine
|
|
281
|
+
// });
|
|
282
|
+
// return (
|
|
283
|
+
// footer && (
|
|
284
|
+
// <div style={footerStyle} className={footerCls} x-semi-prop="footer">
|
|
285
|
+
// {footer}
|
|
286
|
+
// </div>
|
|
287
|
+
// )
|
|
288
|
+
// );
|
|
289
|
+
// };
|
|
157
290
|
render() {
|
|
158
291
|
const _a = this.props,
|
|
159
292
|
{
|
|
160
293
|
bordered,
|
|
161
294
|
shadows,
|
|
162
295
|
style,
|
|
163
|
-
className
|
|
296
|
+
className,
|
|
297
|
+
actions,
|
|
298
|
+
bodyStyle,
|
|
299
|
+
cover,
|
|
300
|
+
headerExtraContent,
|
|
301
|
+
footer,
|
|
302
|
+
footerLine,
|
|
303
|
+
footerStyle,
|
|
304
|
+
header,
|
|
305
|
+
headerLine,
|
|
306
|
+
headerStyle,
|
|
307
|
+
loading,
|
|
308
|
+
title,
|
|
309
|
+
children
|
|
164
310
|
} = _a,
|
|
165
|
-
otherProps = __rest(_a, ["bordered", "shadows", "style", "className"]);
|
|
311
|
+
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
|
|
312
|
+
// 'actions',
|
|
313
|
+
// 'bodyStyle',
|
|
314
|
+
// 'cover',
|
|
315
|
+
// 'headerExtraContent',
|
|
316
|
+
// 'footer',
|
|
317
|
+
// 'footerLine',
|
|
318
|
+
// 'footerStyle',
|
|
319
|
+
// 'header',
|
|
320
|
+
// 'headerLine',
|
|
321
|
+
// 'headerStyle',
|
|
322
|
+
// 'loading',
|
|
323
|
+
// 'title'
|
|
324
|
+
// ]);
|
|
325
|
+
|
|
166
326
|
|
|
167
|
-
const others = (0, _omit2.default)(otherProps, ['actions', 'bodyStyle', 'cover', 'headerExtraContent', 'footer', 'footerLine', 'footerStyle', 'header', 'headerLine', 'headerStyle', 'loading', 'title']);
|
|
168
327
|
const cardCls = (0, _classnames.default)(prefixcls, className, {
|
|
169
328
|
[`${prefixcls}-bordered`]: bordered,
|
|
170
329
|
[`${prefixcls}-shadows`]: shadows,
|
|
171
330
|
[`${prefixcls}-shadows-${shadows}`]: shadows
|
|
172
331
|
});
|
|
173
|
-
|
|
332
|
+
const headProps = {
|
|
333
|
+
title,
|
|
334
|
+
headerExtraContent,
|
|
335
|
+
header,
|
|
336
|
+
headerLine,
|
|
337
|
+
headerStyle
|
|
338
|
+
};
|
|
339
|
+
const bodyProps = {
|
|
340
|
+
cover,
|
|
341
|
+
bodyStyle,
|
|
342
|
+
children,
|
|
343
|
+
actions,
|
|
344
|
+
loading
|
|
345
|
+
};
|
|
346
|
+
const footerProps = {
|
|
347
|
+
footer,
|
|
348
|
+
footerLine,
|
|
349
|
+
footerStyle
|
|
350
|
+
};
|
|
351
|
+
return /*#__PURE__*/_react.default.createElement("div", Object.assign({}, otherProps, {
|
|
174
352
|
"aria-busy": this.props.loading,
|
|
175
353
|
className: cardCls,
|
|
176
354
|
style: style
|
|
177
|
-
}),
|
|
355
|
+
}), /*#__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
356
|
}
|
|
179
357
|
|
|
180
358
|
}
|
|
181
359
|
|
|
182
360
|
Card.Meta = _meta.default;
|
|
361
|
+
Card.Header = Header;
|
|
362
|
+
Card.Footer = Footer;
|
|
363
|
+
Card.Body = Body;
|
|
183
364
|
Card.propTypes = {
|
|
184
365
|
actions: _propTypes.default.array,
|
|
185
366
|
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,
|
|
@@ -30,7 +30,7 @@ export default class DateInput extends BaseComponent<DateInputProps, {}> {
|
|
|
30
30
|
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
31
31
|
value: PropTypes.Requireable<any[]>;
|
|
32
32
|
disabled: PropTypes.Requireable<boolean>;
|
|
33
|
-
type: PropTypes.Requireable<"
|
|
33
|
+
type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "monthRange" | "dateTimeRange">;
|
|
34
34
|
showClear: PropTypes.Requireable<boolean>;
|
|
35
35
|
format: PropTypes.Requireable<string>;
|
|
36
36
|
inputStyle: PropTypes.Requireable<object>;
|
|
@@ -58,8 +58,8 @@ export default class DatePicker extends BaseComponent<DatePickerProps, DatePicke
|
|
|
58
58
|
'aria-labelledby': PropTypes.Requireable<string>;
|
|
59
59
|
'aria-required': PropTypes.Requireable<boolean>;
|
|
60
60
|
borderless: PropTypes.Requireable<boolean>;
|
|
61
|
-
type: PropTypes.Requireable<"
|
|
62
|
-
size: PropTypes.Requireable<"
|
|
61
|
+
type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "monthRange" | "dateTimeRange">;
|
|
62
|
+
size: PropTypes.Requireable<"small" | "default" | "large">;
|
|
63
63
|
clearIcon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
64
64
|
density: PropTypes.Requireable<"default" | "compact">;
|
|
65
65
|
defaultValue: PropTypes.Requireable<NonNullable<string | number | object>>;
|
|
@@ -19,7 +19,7 @@ export interface MonthsGridProps extends MonthsGridFoundationProps, BaseProps {
|
|
|
19
19
|
export declare type MonthsGridState = MonthsGridFoundationState;
|
|
20
20
|
export default class MonthsGrid extends BaseComponent<MonthsGridProps, MonthsGridState> {
|
|
21
21
|
static propTypes: {
|
|
22
|
-
type: PropTypes.Requireable<"
|
|
22
|
+
type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "monthRange" | "dateTimeRange">;
|
|
23
23
|
defaultValue: PropTypes.Requireable<any[]>;
|
|
24
24
|
defaultPickerValue: PropTypes.Requireable<NonNullable<string | number | object>>;
|
|
25
25
|
multiple: PropTypes.Requireable<boolean>;
|
|
@@ -24,7 +24,7 @@ declare class YearAndMonth extends BaseComponent<YearAndMonthProps, YearAndMonth
|
|
|
24
24
|
presetPosition: PropTypes.Requireable<"left" | "top" | "right" | "bottom">;
|
|
25
25
|
renderQuickControls: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
26
26
|
renderDateInput: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
27
|
-
type: PropTypes.Requireable<"
|
|
27
|
+
type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "monthRange" | "dateTimeRange">;
|
|
28
28
|
};
|
|
29
29
|
static defaultProps: {
|
|
30
30
|
disabledDate: {
|
|
@@ -84,7 +84,7 @@ declare class Form<Values extends Record<string, any> = any> extends BaseCompone
|
|
|
84
84
|
onDropdownVisibleChange?: (visible: boolean) => void;
|
|
85
85
|
zIndex?: number;
|
|
86
86
|
position?: "left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver";
|
|
87
|
-
onSearch?: (value: string, event: React.
|
|
87
|
+
onSearch?: (value: string, event: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>) => void;
|
|
88
88
|
dropdownClassName?: string;
|
|
89
89
|
dropdownStyle?: React.CSSProperties;
|
|
90
90
|
dropdownMargin?: number | {
|
|
@@ -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, "motion" | "getPopupContainer" | "stopPropagation" | "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
|
@@ -32,7 +32,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
32
32
|
onDropdownVisibleChange?: (visible: boolean) => void;
|
|
33
33
|
zIndex?: number;
|
|
34
34
|
position?: "left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver";
|
|
35
|
-
onSearch?: (value: string, event: import("react").
|
|
35
|
+
onSearch?: (value: string, event: import("react").MouseEvent<Element, MouseEvent> | import("react").KeyboardEvent<Element>) => void;
|
|
36
36
|
dropdownClassName?: string;
|
|
37
37
|
dropdownStyle?: import("react").CSSProperties;
|
|
38
38
|
dropdownMargin?: number | {
|
|
@@ -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, "motion" | "getPopupContainer" | "stopPropagation" | "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>>;
|
package/lib/cjs/form/group.js
CHANGED
|
@@ -99,7 +99,7 @@ class FormInputGroup extends _react.Component {
|
|
|
99
99
|
rest = __rest(_a, ["children", "label", "extraText", "extraTextPosition"]);
|
|
100
100
|
|
|
101
101
|
const updater = this.context;
|
|
102
|
-
const formProps = updater.getFormProps(['labelPosition', 'labelWidth', 'labelAlign', 'showValidateIcon', 'wrapperCol', 'labelCol'
|
|
102
|
+
const formProps = updater.getFormProps(['labelPosition', 'labelWidth', 'labelAlign', 'showValidateIcon', 'wrapperCol', 'labelCol']);
|
|
103
103
|
const labelPosition = this.props.labelPosition || formProps.labelPosition;
|
|
104
104
|
const groupFieldSet = [];
|
|
105
105
|
|
|
@@ -126,9 +126,7 @@ class FormInputGroup extends _react.Component {
|
|
|
126
126
|
const labelColCls = labelCol ? `${prefix}-col-${labelAlign}` : '';
|
|
127
127
|
const labelContent = this.renderLabel(label, formProps);
|
|
128
128
|
|
|
129
|
-
const inputGroupContent = /*#__PURE__*/_react.default.createElement(_inputGroup.default, Object.assign({
|
|
130
|
-
disabled: formProps.disabled
|
|
131
|
-
}, rest), inner);
|
|
129
|
+
const inputGroupContent = /*#__PURE__*/_react.default.createElement(_inputGroup.default, Object.assign({}, rest), inner);
|
|
132
130
|
|
|
133
131
|
const groupErrorContent = /*#__PURE__*/_react.default.createElement(GroupError, {
|
|
134
132
|
fieldSet: groupFieldSet,
|