@douyinfe/semi-ui 2.19.0-alpha.7 → 2.19.0-beta.0
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/_utils/index.ts +9 -5
- package/avatar/index.tsx +3 -1
- package/checkbox/_story/checkbox.stories.js +2 -0
- package/checkbox/checkbox.tsx +25 -20
- package/checkbox/checkboxGroup.tsx +1 -0
- package/dist/css/semi.css +26 -59
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +301 -276
- 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/form/interface.ts +1 -1
- package/lib/cjs/_utils/index.js +4 -1
- package/lib/cjs/avatar/index.d.ts +1 -0
- package/lib/cjs/avatar/index.js +2 -1
- package/lib/cjs/carousel/CarouselIndicator.d.ts +1 -1
- package/lib/cjs/carousel/index.d.ts +1 -1
- package/lib/cjs/checkbox/checkbox.d.ts +1 -0
- package/lib/cjs/checkbox/checkbox.js +19 -10
- package/lib/cjs/checkbox/checkboxGroup.js +10 -9
- package/lib/cjs/datePicker/dateInput.d.ts +1 -1
- package/lib/cjs/datePicker/datePicker.d.ts +1 -1
- package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
- package/lib/cjs/form/interface.d.ts +1 -1
- package/lib/cjs/popconfirm/index.js +6 -6
- package/lib/cjs/radio/radio.d.ts +2 -1
- package/lib/cjs/radio/radio.js +1 -0
- package/lib/cjs/radio/radioGroup.d.ts +1 -1
- package/lib/cjs/tabs/interface.d.ts +3 -2
- package/lib/cjs/tag/group.d.ts +1 -15
- package/lib/cjs/tag/index.d.ts +1 -1
- package/lib/cjs/tag/index.js +1 -1
- package/lib/cjs/tag/interface.d.ts +6 -3
- package/lib/cjs/timePicker/TimePicker.d.ts +2 -2
- package/lib/cjs/timePicker/TimeShape.d.ts +1 -1
- package/lib/cjs/timePicker/index.d.ts +2 -2
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/cjs/upload/index.d.ts +1 -1
- package/lib/es/_utils/index.js +4 -1
- package/lib/es/avatar/index.d.ts +1 -0
- package/lib/es/avatar/index.js +2 -1
- package/lib/es/carousel/CarouselIndicator.d.ts +1 -1
- package/lib/es/carousel/index.d.ts +1 -1
- package/lib/es/checkbox/checkbox.d.ts +1 -0
- package/lib/es/checkbox/checkbox.js +19 -10
- package/lib/es/checkbox/checkboxGroup.js +8 -7
- package/lib/es/datePicker/dateInput.d.ts +1 -1
- package/lib/es/datePicker/datePicker.d.ts +1 -1
- package/lib/es/datePicker/monthsGrid.d.ts +1 -1
- package/lib/es/form/interface.d.ts +1 -1
- package/lib/es/popconfirm/index.js +6 -6
- package/lib/es/radio/radio.d.ts +2 -1
- package/lib/es/radio/radio.js +1 -0
- package/lib/es/radio/radioGroup.d.ts +1 -1
- package/lib/es/tabs/interface.d.ts +3 -2
- package/lib/es/tag/group.d.ts +1 -15
- package/lib/es/tag/index.d.ts +1 -1
- package/lib/es/tag/index.js +1 -1
- package/lib/es/tag/interface.d.ts +6 -3
- package/lib/es/timePicker/TimePicker.d.ts +2 -2
- package/lib/es/timePicker/TimeShape.d.ts +1 -1
- package/lib/es/timePicker/index.d.ts +2 -2
- package/lib/es/typography/title.d.ts +1 -1
- package/lib/es/upload/index.d.ts +1 -1
- package/package.json +7 -7
- package/popconfirm/_story/popconfirm.stories.js +1 -1
- package/popconfirm/index.tsx +6 -6
- package/radio/radio.tsx +2 -0
- package/tabs/_story/Demo.tsx +14 -5
- package/tabs/interface.ts +3 -2
- package/tag/group.tsx +2 -16
- package/tag/index.tsx +1 -1
- package/tag/interface.ts +9 -5
- package/transfer/_story/transfer.stories.js +2 -2
- package/treeSelect/_story/treeSelect.stories.js +3 -0
|
@@ -17,7 +17,7 @@ export interface MonthsGridProps extends MonthsGridFoundationProps, BaseProps {
|
|
|
17
17
|
export declare type MonthsGridState = MonthsGridFoundationState;
|
|
18
18
|
export default class MonthsGrid extends BaseComponent<MonthsGridProps, MonthsGridState> {
|
|
19
19
|
static propTypes: {
|
|
20
|
-
type: PropTypes.Requireable<"
|
|
20
|
+
type: PropTypes.Requireable<"dateTime" | "date" | "month" | "dateRange" | "year" | "dateTimeRange">;
|
|
21
21
|
defaultValue: PropTypes.Requireable<string | number | object>;
|
|
22
22
|
defaultPickerValue: PropTypes.Requireable<string | number | object>;
|
|
23
23
|
multiple: PropTypes.Requireable<boolean>;
|
|
@@ -81,7 +81,7 @@ export interface FormFCChild<K extends Record<string, any> = any> {
|
|
|
81
81
|
values: K;
|
|
82
82
|
formApi: FormApi<K>;
|
|
83
83
|
}
|
|
84
|
-
export interface BaseFormProps {
|
|
84
|
+
export interface BaseFormProps extends Omit<React.FormHTMLAttributes<HTMLFormElement>, 'children' | 'onChange'> {
|
|
85
85
|
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
86
86
|
onSubmit?: (values: Record<string, any>) => void;
|
|
87
87
|
onSubmitFail?: (errors: Record<string, FieldError>, values: any) => void;
|
|
@@ -126,7 +126,7 @@ export default class Popconfirm extends BaseComponent {
|
|
|
126
126
|
["".concat(prefixCls, "-rtl")]: direction === 'rtl'
|
|
127
127
|
});
|
|
128
128
|
const showTitle = title !== null && typeof title !== 'undefined';
|
|
129
|
-
const showContent = content
|
|
129
|
+
const showContent = !(content === null || typeof content === 'undefined');
|
|
130
130
|
return (
|
|
131
131
|
/*#__PURE__*/
|
|
132
132
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
@@ -146,17 +146,17 @@ export default class Popconfirm extends BaseComponent {
|
|
|
146
146
|
}, showTitle ? /*#__PURE__*/React.createElement("div", {
|
|
147
147
|
className: "".concat(prefixCls, "-header-title"),
|
|
148
148
|
"x-semi-prop": "title"
|
|
149
|
-
}, title) : null,
|
|
150
|
-
className: "".concat(prefixCls, "-header-content"),
|
|
151
|
-
"x-semi-prop": "content"
|
|
152
|
-
}, content) : null), /*#__PURE__*/React.createElement(Button, {
|
|
149
|
+
}, title) : null), /*#__PURE__*/React.createElement(Button, {
|
|
153
150
|
className: "".concat(prefixCls, "-btn-close"),
|
|
154
151
|
icon: /*#__PURE__*/React.createElement(IconClose, null),
|
|
155
152
|
size: "small",
|
|
156
153
|
theme: 'borderless',
|
|
157
154
|
type: cancelType,
|
|
158
155
|
onClick: this.handleCancel
|
|
159
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
156
|
+
})), showContent ? /*#__PURE__*/React.createElement("div", {
|
|
157
|
+
className: "".concat(prefixCls, "-body"),
|
|
158
|
+
"x-semi-prop": "content"
|
|
159
|
+
}, content) : null, /*#__PURE__*/React.createElement("div", {
|
|
160
160
|
className: "".concat(prefixCls, "-footer")
|
|
161
161
|
}, this.renderControls())))
|
|
162
162
|
);
|
package/lib/es/radio/radio.d.ts
CHANGED
|
@@ -66,6 +66,7 @@ declare class Radio extends BaseComponent<RadioProps, RadioState> {
|
|
|
66
66
|
preventScroll: PropTypes.Requireable<boolean>;
|
|
67
67
|
};
|
|
68
68
|
static defaultProps: Partial<RadioProps>;
|
|
69
|
+
static elementType: string;
|
|
69
70
|
radioEntity: RadioInner;
|
|
70
71
|
context: RadioContextValue;
|
|
71
72
|
foundation: RadioFoundation;
|
|
@@ -81,7 +82,7 @@ declare class Radio extends BaseComponent<RadioProps, RadioState> {
|
|
|
81
82
|
prefixCls?: string;
|
|
82
83
|
name?: string;
|
|
83
84
|
onChange?: (e: RadioChangeEvent) => void;
|
|
84
|
-
buttonSize?: "small" | "
|
|
85
|
+
buttonSize?: "small" | "middle" | "large";
|
|
85
86
|
isCardRadio?: boolean;
|
|
86
87
|
isPureCardRadio?: boolean;
|
|
87
88
|
};
|
package/lib/es/radio/radio.js
CHANGED
|
@@ -48,7 +48,7 @@ declare class RadioGroup extends BaseComponent<RadioGroupProps, RadioGroupState>
|
|
|
48
48
|
disabled: PropTypes.Requireable<boolean>;
|
|
49
49
|
name: PropTypes.Requireable<string>;
|
|
50
50
|
options: PropTypes.Requireable<any[]>;
|
|
51
|
-
buttonSize: PropTypes.Requireable<"small" | "
|
|
51
|
+
buttonSize: PropTypes.Requireable<"small" | "middle" | "large">;
|
|
52
52
|
type: PropTypes.Requireable<"default" | "button" | "card" | "pureCard">;
|
|
53
53
|
value: PropTypes.Requireable<any>;
|
|
54
54
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { CSSProperties, MouseEvent, ReactNode } from 'react';
|
|
2
2
|
import { Motion } from '../_base/base';
|
|
3
|
+
import TabBar from './TabBar';
|
|
3
4
|
export declare type TabType = 'line' | 'card' | 'button';
|
|
4
5
|
export declare type TabSize = 'small' | 'medium' | 'large';
|
|
5
6
|
export declare type TabPosition = 'top' | 'left';
|
|
@@ -21,7 +22,7 @@ export interface TabsProps {
|
|
|
21
22
|
lazyRender?: boolean;
|
|
22
23
|
onChange?: (activeKey: string) => void;
|
|
23
24
|
onTabClick?: (activeKey: string, e: MouseEvent<Element>) => void;
|
|
24
|
-
renderTabBar?: (tabBarProps: TabBarProps, defaultTabBar:
|
|
25
|
+
renderTabBar?: (tabBarProps: TabBarProps, defaultTabBar: typeof TabBar) => ReactNode;
|
|
25
26
|
size?: TabSize;
|
|
26
27
|
style?: CSSProperties;
|
|
27
28
|
tabBarClassName?: string;
|
package/lib/es/tag/group.d.ts
CHANGED
|
@@ -1,21 +1,7 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import Tag from './index';
|
|
4
|
-
import {
|
|
5
|
-
import { AvatarShape, TagProps } from './interface';
|
|
6
|
-
export interface TagGroupProps<T> {
|
|
7
|
-
style?: React.CSSProperties;
|
|
8
|
-
className?: string;
|
|
9
|
-
maxTagCount?: number;
|
|
10
|
-
restCount?: number;
|
|
11
|
-
tagList?: (T extends 'custom' ? React.ReactNode : TagProps)[];
|
|
12
|
-
size?: 'small' | 'large';
|
|
13
|
-
showPopover?: boolean;
|
|
14
|
-
popoverProps?: PopoverProps;
|
|
15
|
-
avatarShape?: AvatarShape;
|
|
16
|
-
mode?: string;
|
|
17
|
-
onTagClose: (tagChildren: React.ReactNode, event: React.MouseEvent<HTMLElement>, tagKey: string | number) => void;
|
|
18
|
-
}
|
|
4
|
+
import { TagGroupProps } from './interface';
|
|
19
5
|
export default class TagGroup<T> extends PureComponent<TagGroupProps<T>> {
|
|
20
6
|
static defaultProps: {
|
|
21
7
|
style: {};
|
package/lib/es/tag/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export default class Tag extends Component<TagProps, TagState> {
|
|
|
10
10
|
static defaultProps: TagProps;
|
|
11
11
|
static propTypes: {
|
|
12
12
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
13
|
-
tagKey: PropTypes.Requireable<
|
|
13
|
+
tagKey: PropTypes.Requireable<string | number>;
|
|
14
14
|
size: PropTypes.Requireable<string>;
|
|
15
15
|
color: PropTypes.Requireable<string>;
|
|
16
16
|
type: PropTypes.Requireable<string>;
|
package/lib/es/tag/index.js
CHANGED
|
@@ -198,7 +198,7 @@ Tag.defaultProps = {
|
|
|
198
198
|
};
|
|
199
199
|
Tag.propTypes = {
|
|
200
200
|
children: PropTypes.node,
|
|
201
|
-
tagKey: PropTypes.
|
|
201
|
+
tagKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
202
202
|
size: PropTypes.oneOf(tagSize),
|
|
203
203
|
color: PropTypes.oneOf(tagColors),
|
|
204
204
|
type: PropTypes.oneOf(tagType),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { PopoverProps } from '../popover/index';
|
|
2
3
|
export declare type TagColor = 'amber' | 'blue' | 'cyan' | 'green' | 'grey' | 'indigo' | 'light-blue' | 'light-green' | 'lime' | 'orange' | 'pink' | 'purple' | 'red' | 'teal' | 'violet' | 'yellow' | 'white';
|
|
3
4
|
export declare type TagType = 'ghost' | 'solid' | 'light';
|
|
4
5
|
export declare type TagSize = 'default' | 'small' | 'large';
|
|
@@ -21,14 +22,16 @@ export interface TagProps {
|
|
|
21
22
|
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
22
23
|
tabIndex?: number;
|
|
23
24
|
}
|
|
24
|
-
export interface TagGroupProps {
|
|
25
|
+
export interface TagGroupProps<T> {
|
|
25
26
|
style?: React.CSSProperties;
|
|
26
27
|
className?: string;
|
|
27
28
|
maxTagCount?: number;
|
|
28
|
-
|
|
29
|
+
restCount?: number;
|
|
30
|
+
tagList?: (T extends 'custom' ? React.ReactNode : TagProps)[];
|
|
29
31
|
size?: 'small' | 'large';
|
|
30
32
|
showPopover?: boolean;
|
|
31
|
-
popoverProps?:
|
|
33
|
+
popoverProps?: PopoverProps;
|
|
32
34
|
avatarShape?: AvatarShape;
|
|
33
35
|
mode?: string;
|
|
36
|
+
onTagClose: (tagChildren: React.ReactNode, event: React.MouseEvent<HTMLElement>, tagKey: string | number) => void;
|
|
34
37
|
}
|
|
@@ -99,11 +99,11 @@ export default class TimePicker extends BaseComponent<TimePickerProps, TimePicke
|
|
|
99
99
|
'aria-required': PropTypes.Requireable<boolean>;
|
|
100
100
|
prefixCls: PropTypes.Requireable<string>;
|
|
101
101
|
clearText: PropTypes.Requireable<string>;
|
|
102
|
-
value: PropTypes.Requireable<string | number | string[] |
|
|
102
|
+
value: PropTypes.Requireable<string | number | string[] | number[] | Date | Date[]>;
|
|
103
103
|
inputReadOnly: PropTypes.Requireable<boolean>;
|
|
104
104
|
disabled: PropTypes.Requireable<boolean>;
|
|
105
105
|
showClear: PropTypes.Requireable<boolean>;
|
|
106
|
-
defaultValue: PropTypes.Requireable<string | number | string[] |
|
|
106
|
+
defaultValue: PropTypes.Requireable<string | number | string[] | number[] | Date | Date[]>;
|
|
107
107
|
open: PropTypes.Requireable<boolean>;
|
|
108
108
|
defaultOpen: PropTypes.Requireable<boolean>;
|
|
109
109
|
onOpenChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -6,5 +6,5 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
* - \[12:00:12, 12:21:12]
|
|
7
7
|
* - \[[12:00:12, 12:21:12], [12:11:12, 12:32:12]]
|
|
8
8
|
*/
|
|
9
|
-
declare const TimeShape: PropTypes.Requireable<string | number | string[] |
|
|
9
|
+
declare const TimeShape: PropTypes.Requireable<string | number | string[] | number[] | Date | Date[]>;
|
|
10
10
|
export { TimeShape };
|
|
@@ -19,11 +19,11 @@ export default class LocaleTimePicker extends React.PureComponent<LocalePickerPr
|
|
|
19
19
|
'aria-required': import("prop-types").Requireable<boolean>;
|
|
20
20
|
prefixCls: import("prop-types").Requireable<string>;
|
|
21
21
|
clearText: import("prop-types").Requireable<string>;
|
|
22
|
-
value: import("prop-types").Requireable<string | number | string[] |
|
|
22
|
+
value: import("prop-types").Requireable<string | number | string[] | number[] | Date | Date[]>;
|
|
23
23
|
inputReadOnly: import("prop-types").Requireable<boolean>;
|
|
24
24
|
disabled: import("prop-types").Requireable<boolean>;
|
|
25
25
|
showClear: import("prop-types").Requireable<boolean>;
|
|
26
|
-
defaultValue: import("prop-types").Requireable<string | number | string[] |
|
|
26
|
+
defaultValue: import("prop-types").Requireable<string | number | string[] | number[] | Date | Date[]>;
|
|
27
27
|
open: import("prop-types").Requireable<boolean>;
|
|
28
28
|
defaultOpen: import("prop-types").Requireable<boolean>;
|
|
29
29
|
onOpenChange: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
@@ -37,7 +37,7 @@ export default class Title extends PureComponent<TitleProps> {
|
|
|
37
37
|
underline: PropTypes.Requireable<boolean>;
|
|
38
38
|
strong: PropTypes.Requireable<boolean>;
|
|
39
39
|
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
40
|
-
heading: PropTypes.Requireable<1 | 2 | 3 | 4 |
|
|
40
|
+
heading: PropTypes.Requireable<1 | 2 | 3 | 4 | 5 | 6>;
|
|
41
41
|
style: PropTypes.Requireable<object>;
|
|
42
42
|
className: PropTypes.Requireable<string>;
|
|
43
43
|
component: PropTypes.Requireable<string>;
|
package/lib/es/upload/index.d.ts
CHANGED
|
@@ -140,7 +140,7 @@ declare class Upload extends BaseComponent<UploadProps, UploadState> {
|
|
|
140
140
|
style: PropTypes.Requireable<object>;
|
|
141
141
|
timeout: PropTypes.Requireable<number>;
|
|
142
142
|
transformFile: PropTypes.Requireable<(...args: any[]) => any>;
|
|
143
|
-
uploadTrigger: PropTypes.Requireable<"
|
|
143
|
+
uploadTrigger: PropTypes.Requireable<"auto" | "custom">;
|
|
144
144
|
validateMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
145
145
|
validateStatus: PropTypes.Requireable<"default" | "error" | "warning" | "success">;
|
|
146
146
|
withCredentials: PropTypes.Requireable<boolean>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.19.0-
|
|
3
|
+
"version": "2.19.0-beta.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es/index.js",
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@babel/runtime-corejs3": "^7.15.4",
|
|
17
17
|
"@douyinfe/semi-animation": "2.12.0",
|
|
18
|
-
"@douyinfe/semi-animation-react": "2.19.0-
|
|
19
|
-
"@douyinfe/semi-foundation": "2.19.0-
|
|
20
|
-
"@douyinfe/semi-icons": "2.19.0-
|
|
18
|
+
"@douyinfe/semi-animation-react": "2.19.0-beta.0",
|
|
19
|
+
"@douyinfe/semi-foundation": "2.19.0-beta.0",
|
|
20
|
+
"@douyinfe/semi-icons": "2.19.0-beta.0",
|
|
21
21
|
"@douyinfe/semi-illustrations": "2.15.0",
|
|
22
|
-
"@douyinfe/semi-theme-default": "2.19.0-
|
|
22
|
+
"@douyinfe/semi-theme-default": "2.19.0-beta.0",
|
|
23
23
|
"async-validator": "^3.5.0",
|
|
24
24
|
"classnames": "^2.2.6",
|
|
25
25
|
"copy-text-to-clipboard": "^2.1.1",
|
|
@@ -66,13 +66,13 @@
|
|
|
66
66
|
],
|
|
67
67
|
"author": "",
|
|
68
68
|
"license": "MIT",
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "6c28751a18df0a8a8dee52203a0b492af667edab",
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
72
72
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
|
73
73
|
"@babel/preset-env": "^7.15.8",
|
|
74
74
|
"@babel/preset-react": "^7.14.5",
|
|
75
|
-
"@douyinfe/semi-scss-compile": "2.19.0-
|
|
75
|
+
"@douyinfe/semi-scss-compile": "2.19.0-beta.0",
|
|
76
76
|
"@storybook/addon-knobs": "^6.3.1",
|
|
77
77
|
"@types/lodash": "^4.14.176",
|
|
78
78
|
"@types/react": ">=16.0.0",
|
|
@@ -44,7 +44,7 @@ Simple.story = {
|
|
|
44
44
|
export const _Button = () => (
|
|
45
45
|
<div>
|
|
46
46
|
<div style={style}>
|
|
47
|
-
<Popconfirm position="bottomLeft" title="确定是否要保存此修改?" content="
|
|
47
|
+
<Popconfirm position="bottomLeft" title="确定是否要保存此修改?" content="此修改将不可逆此修改将不可逆此修改将不可逆此修">
|
|
48
48
|
<Button>Save</Button>
|
|
49
49
|
</Popconfirm>
|
|
50
50
|
</div>
|
package/popconfirm/index.tsx
CHANGED
|
@@ -175,7 +175,7 @@ export default class Popconfirm extends BaseComponent<PopconfirmProps, Popconfir
|
|
|
175
175
|
}
|
|
176
176
|
);
|
|
177
177
|
const showTitle = title !== null && typeof title !== 'undefined';
|
|
178
|
-
const showContent = content
|
|
178
|
+
const showContent = !(content === null || typeof content === 'undefined');
|
|
179
179
|
|
|
180
180
|
return (
|
|
181
181
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
@@ -191,11 +191,6 @@ export default class Popconfirm extends BaseComponent<PopconfirmProps, Popconfir
|
|
|
191
191
|
{title}
|
|
192
192
|
</div>
|
|
193
193
|
) : null}
|
|
194
|
-
{showContent ? (
|
|
195
|
-
<div className={`${prefixCls}-header-content`} x-semi-prop="content">
|
|
196
|
-
{content}
|
|
197
|
-
</div>
|
|
198
|
-
) : null}
|
|
199
194
|
</div>
|
|
200
195
|
<Button
|
|
201
196
|
className={`${prefixCls}-btn-close`}
|
|
@@ -206,6 +201,11 @@ export default class Popconfirm extends BaseComponent<PopconfirmProps, Popconfir
|
|
|
206
201
|
onClick={this.handleCancel}
|
|
207
202
|
/>
|
|
208
203
|
</div>
|
|
204
|
+
{showContent ? (
|
|
205
|
+
<div className={`${prefixCls}-body`} x-semi-prop="content">
|
|
206
|
+
{content}
|
|
207
|
+
</div>
|
|
208
|
+
) : null}
|
|
209
209
|
<div className={`${prefixCls}-footer`}>{this.renderControls()}</div>
|
|
210
210
|
</div>
|
|
211
211
|
</div>
|
package/radio/radio.tsx
CHANGED
|
@@ -92,6 +92,7 @@ class Radio extends BaseComponent<RadioProps, RadioState> {
|
|
|
92
92
|
mode: '',
|
|
93
93
|
type: 'default'
|
|
94
94
|
};
|
|
95
|
+
static elementType: string;
|
|
95
96
|
|
|
96
97
|
radioEntity: RadioInner;
|
|
97
98
|
context!: RadioContextValue;
|
|
@@ -317,5 +318,6 @@ class Radio extends BaseComponent<RadioProps, RadioState> {
|
|
|
317
318
|
);
|
|
318
319
|
}
|
|
319
320
|
}
|
|
321
|
+
Radio.elementType = 'Radio';
|
|
320
322
|
|
|
321
323
|
export default Radio;
|
package/tabs/_story/Demo.tsx
CHANGED
|
@@ -11,7 +11,16 @@ const Demo = () => {
|
|
|
11
11
|
|
|
12
12
|
return (
|
|
13
13
|
<div>
|
|
14
|
-
<Tabs
|
|
14
|
+
<Tabs
|
|
15
|
+
defaultActiveKey="1"
|
|
16
|
+
renderTabBar={(tabBarProps, DefaultTabBar) => {
|
|
17
|
+
return (
|
|
18
|
+
<div className="tab-bar-box">
|
|
19
|
+
这是二次封装的Tab Bar,当前ActiveKey:{tabBarProps.activeKey}
|
|
20
|
+
<DefaultTabBar {...tabBarProps} />
|
|
21
|
+
</div>
|
|
22
|
+
);
|
|
23
|
+
}}
|
|
15
24
|
tabPaneMotion>
|
|
16
25
|
{
|
|
17
26
|
tabPaneList.map((item, index) => {
|
|
@@ -19,12 +28,12 @@ const Demo = () => {
|
|
|
19
28
|
<TabPane tab={item} itemKey={index.toString()} key={item}>
|
|
20
29
|
{ item + index }
|
|
21
30
|
</TabPane>
|
|
22
|
-
)
|
|
31
|
+
);
|
|
23
32
|
})
|
|
24
33
|
}
|
|
25
34
|
</Tabs>
|
|
26
35
|
</div>
|
|
27
|
-
)
|
|
28
|
-
}
|
|
36
|
+
);
|
|
37
|
+
};
|
|
29
38
|
|
|
30
|
-
export default Demo
|
|
39
|
+
export default Demo;
|
package/tabs/interface.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { ComponentType, CSSProperties, MouseEvent, ReactNode } from 'react';
|
|
2
2
|
import { Motion } from '../_base/base';
|
|
3
|
+
import TabBar from './TabBar';
|
|
3
4
|
|
|
4
5
|
export type TabType = 'line' | 'card' | 'button';
|
|
5
6
|
export type TabSize = 'small' | 'medium' | 'large';
|
|
@@ -25,7 +26,7 @@ export interface TabsProps {
|
|
|
25
26
|
lazyRender?: boolean;
|
|
26
27
|
onChange?: (activeKey: string) => void;
|
|
27
28
|
onTabClick?: (activeKey: string, e: MouseEvent<Element>) => void;
|
|
28
|
-
renderTabBar?: (tabBarProps: TabBarProps, defaultTabBar:
|
|
29
|
+
renderTabBar?: (tabBarProps: TabBarProps, defaultTabBar: typeof TabBar) => ReactNode;
|
|
29
30
|
size?: TabSize;
|
|
30
31
|
style?: CSSProperties;
|
|
31
32
|
tabBarClassName?: string;
|
|
@@ -54,7 +55,7 @@ export interface TabBarProps {
|
|
|
54
55
|
dropdownStyle?: CSSProperties;
|
|
55
56
|
closable?: boolean;
|
|
56
57
|
deleteTabItem?: (tabKey: string, event: MouseEvent<Element>) => void;
|
|
57
|
-
handleKeyDown?:
|
|
58
|
+
handleKeyDown?: (event: React.KeyboardEvent, itemKey: string, closable: boolean) => void;
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
export interface TabPaneProps {
|
package/tag/group.tsx
CHANGED
|
@@ -3,27 +3,13 @@ import classNames from 'classnames';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { cssClasses, strings } from '@douyinfe/semi-foundation/tag/constants';
|
|
5
5
|
import Tag from './index';
|
|
6
|
-
import Popover
|
|
7
|
-
import { AvatarShape, TagProps } from './interface';
|
|
6
|
+
import Popover from '../popover/index';
|
|
7
|
+
import { AvatarShape, TagProps, TagGroupProps } from './interface';
|
|
8
8
|
|
|
9
9
|
const prefixCls = cssClasses.PREFIX;
|
|
10
10
|
const tagSize = strings.TAG_SIZE;
|
|
11
11
|
const avatarShapeSet = strings.AVATAR_SHAPE;
|
|
12
12
|
|
|
13
|
-
export interface TagGroupProps<T> {
|
|
14
|
-
style?: React.CSSProperties;
|
|
15
|
-
className?: string;
|
|
16
|
-
maxTagCount?: number;
|
|
17
|
-
restCount?: number;
|
|
18
|
-
tagList?: (T extends 'custom' ? React.ReactNode : TagProps)[];
|
|
19
|
-
size?: 'small' | 'large';
|
|
20
|
-
showPopover?: boolean;
|
|
21
|
-
popoverProps?: PopoverProps;
|
|
22
|
-
avatarShape?: AvatarShape;
|
|
23
|
-
mode?: string;
|
|
24
|
-
onTagClose: (tagChildren: React.ReactNode, event: React.MouseEvent<HTMLElement>, tagKey: string | number) => void;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
13
|
export default class TagGroup<T> extends PureComponent<TagGroupProps<T>> {
|
|
28
14
|
static defaultProps = {
|
|
29
15
|
style: {},
|
package/tag/index.tsx
CHANGED
|
@@ -40,7 +40,7 @@ export default class Tag extends Component<TagProps, TagState> {
|
|
|
40
40
|
|
|
41
41
|
static propTypes = {
|
|
42
42
|
children: PropTypes.node,
|
|
43
|
-
tagKey: PropTypes.
|
|
43
|
+
tagKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
44
44
|
size: PropTypes.oneOf(tagSize),
|
|
45
45
|
color: PropTypes.oneOf(tagColors),
|
|
46
46
|
type: PropTypes.oneOf(tagType),
|
package/tag/interface.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { PopoverProps } from '../popover/index';
|
|
2
|
+
|
|
1
3
|
export type TagColor =
|
|
2
4
|
| 'amber'
|
|
3
5
|
| 'blue'
|
|
@@ -39,14 +41,16 @@ export interface TagProps {
|
|
|
39
41
|
tabIndex?: number; // use internal, when tag in taInput, we want to use left arrow and right arrow to control the tag focus, so the tabIndex need to be -1.
|
|
40
42
|
}
|
|
41
43
|
|
|
42
|
-
export interface TagGroupProps {
|
|
44
|
+
export interface TagGroupProps<T> {
|
|
43
45
|
style?: React.CSSProperties;
|
|
44
46
|
className?: string;
|
|
45
47
|
maxTagCount?: number;
|
|
46
|
-
|
|
48
|
+
restCount?: number;
|
|
49
|
+
tagList?: (T extends 'custom' ? React.ReactNode : TagProps)[];
|
|
47
50
|
size?: 'small' | 'large';
|
|
48
51
|
showPopover?: boolean;
|
|
49
|
-
popoverProps?:
|
|
52
|
+
popoverProps?: PopoverProps;
|
|
50
53
|
avatarShape?: AvatarShape;
|
|
51
|
-
mode?: string;
|
|
52
|
-
|
|
54
|
+
mode?: string;
|
|
55
|
+
onTagClose: (tagChildren: React.ReactNode, event: React.MouseEvent<HTMLElement>, tagKey: string | number) => void;
|
|
56
|
+
}
|
|
@@ -209,9 +209,9 @@ const ControlledTransfer = () => {
|
|
|
209
209
|
);
|
|
210
210
|
};
|
|
211
211
|
|
|
212
|
-
export const
|
|
212
|
+
export const ControlledTransferDemo = () => <ControlledTransfer />;
|
|
213
213
|
|
|
214
|
-
|
|
214
|
+
ControlledTransferDemo.story = {
|
|
215
215
|
name: '受控Transfer',
|
|
216
216
|
};
|
|
217
217
|
|
|
@@ -469,6 +469,9 @@ export const Multiple = () => (
|
|
|
469
469
|
// value={this.state.value}
|
|
470
470
|
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
|
471
471
|
treeData={treeData2}
|
|
472
|
+
defaultOpen
|
|
473
|
+
defaultExpandAll
|
|
474
|
+
motion={false}
|
|
472
475
|
multiple
|
|
473
476
|
placeholder="Please select"
|
|
474
477
|
/>
|