@douyinfe/semi-ui 2.14.0-alpha.0 → 2.14.0-beta.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/autoComplete/_story/CustomTrigger/index.jsx +1 -1
- package/avatar/_story/avatar.stories.js +62 -5
- package/avatar/avatarGroup.tsx +16 -4
- package/avatar/index.tsx +88 -17
- package/backtop/index.tsx +11 -7
- package/badge/index.tsx +1 -1
- package/banner/index.tsx +5 -5
- package/breadcrumb/index.tsx +5 -3
- package/button/Button.tsx +10 -8
- package/calendar/_story/calendar.stories.js +125 -1
- package/card/index.tsx +43 -41
- package/carousel/CarouselArrow.tsx +2 -0
- package/carousel/index.tsx +1 -0
- package/cascader/_story/cascader.stories.js +21 -0
- package/cascader/index.tsx +103 -122
- package/cascader/item.tsx +1 -1
- package/checkbox/checkbox.tsx +13 -2
- package/collapsible/index.tsx +8 -1
- package/datePicker/dateInput.tsx +1 -0
- package/datePicker/datePicker.tsx +13 -5
- package/dist/css/semi.css +73 -35
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +957 -545
- 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/divider/index.tsx +8 -4
- package/dropdown/index.tsx +1 -1
- package/empty/index.tsx +13 -5
- package/form/_story/form.stories.tsx +9 -2
- package/form/field.tsx +1 -1
- package/form/hoc/withField.tsx +1 -1
- package/form/label.tsx +1 -1
- package/grid/col.tsx +1 -1
- package/grid/row.tsx +1 -1
- package/gulpfile.js +5 -5
- package/iconButton/index.tsx +2 -1
- package/input/_story/input.stories.js +32 -3
- package/input/index.tsx +45 -23
- package/input/inputGroup.tsx +3 -1
- package/input/textarea.tsx +2 -14
- package/lib/cjs/_base/base.css +36 -14
- package/lib/cjs/avatar/avatarGroup.d.ts +1 -1
- package/lib/cjs/avatar/avatarGroup.js +36 -9
- package/lib/cjs/avatar/index.d.ts +5 -0
- package/lib/cjs/avatar/index.js +121 -41
- package/lib/cjs/backtop/index.js +2 -1
- package/lib/cjs/badge/index.js +2 -1
- package/lib/cjs/banner/index.js +9 -4
- package/lib/cjs/breadcrumb/index.js +4 -3
- package/lib/cjs/button/Button.js +13 -3
- package/lib/cjs/card/index.js +10 -5
- package/lib/cjs/carousel/CarouselArrow.js +6 -2
- package/lib/cjs/carousel/index.js +2 -1
- package/lib/cjs/cascader/index.js +15 -8
- package/lib/cjs/cascader/item.js +2 -1
- package/lib/cjs/checkbox/checkbox.js +6 -2
- package/lib/cjs/collapsible/index.js +2 -1
- package/lib/cjs/datePicker/dateInput.js +2 -1
- package/lib/cjs/datePicker/datePicker.js +4 -2
- package/lib/cjs/divider/index.js +2 -1
- package/lib/cjs/dropdown/index.js +2 -1
- package/lib/cjs/empty/index.js +8 -4
- package/lib/cjs/form/baseForm.d.ts +1 -1
- package/lib/cjs/form/field.d.ts +1 -1
- package/lib/cjs/form/field.js +2 -2
- package/lib/cjs/form/hoc/withField.js +2 -1
- package/lib/cjs/form/label.js +2 -1
- package/lib/cjs/grid/col.js +2 -1
- package/lib/cjs/grid/row.js +2 -1
- package/lib/cjs/iconButton/index.js +3 -1
- package/lib/cjs/input/index.d.ts +0 -1
- package/lib/cjs/input/index.js +41 -36
- package/lib/cjs/input/inputGroup.js +2 -3
- package/lib/cjs/input/textarea.js +8 -15
- package/lib/cjs/list/index.js +6 -3
- package/lib/cjs/modal/ConfirmModal.js +2 -1
- package/lib/cjs/modal/Modal.js +6 -2
- package/lib/cjs/modal/ModalContent.js +13 -6
- package/lib/cjs/notification/notice.js +6 -3
- package/lib/cjs/pagination/index.js +4 -2
- package/lib/cjs/popconfirm/index.js +6 -3
- package/lib/cjs/radio/radio.d.ts +4 -0
- package/lib/cjs/radio/radio.js +32 -9
- package/lib/cjs/radio/radioInner.d.ts +6 -0
- package/lib/cjs/radio/radioInner.js +13 -4
- package/lib/cjs/rating/item.js +2 -1
- package/lib/cjs/scrollList/index.js +6 -3
- package/lib/cjs/select/index.js +10 -4
- package/lib/cjs/select/option.js +2 -1
- package/lib/cjs/sideSheet/SideSheetContent.js +6 -3
- package/lib/cjs/skeleton/index.js +3 -1
- package/lib/cjs/space/index.js +2 -1
- package/lib/cjs/spin/index.js +7 -3
- package/lib/cjs/switch/index.js +6 -4
- package/lib/cjs/table/ColumnFilter.js +2 -2
- package/lib/cjs/table/ColumnSelection.js +2 -2
- package/lib/cjs/table/Table.js +6 -3
- package/lib/cjs/tabs/TabBar.js +2 -1
- package/lib/cjs/tabs/TabPane.js +5 -2
- package/lib/cjs/tagInput/index.js +33 -22
- package/lib/cjs/timePicker/Combobox.js +3 -1
- package/lib/cjs/timePicker/TimePicker.js +2 -0
- package/lib/cjs/toast/toast.js +6 -3
- package/lib/cjs/tooltip/index.js +6 -1
- package/lib/cjs/transfer/index.js +6 -5
- package/lib/cjs/tree/treeNode.js +4 -3
- package/lib/cjs/treeSelect/index.js +10 -3
- package/lib/cjs/typography/base.js +2 -1
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/cjs/upload/index.d.ts +1 -1
- package/lib/cjs/upload/index.js +13 -6
- package/lib/es/_base/base.css +36 -14
- package/lib/es/avatar/avatarGroup.d.ts +1 -1
- package/lib/es/avatar/avatarGroup.js +37 -9
- package/lib/es/avatar/index.d.ts +5 -0
- package/lib/es/avatar/index.js +119 -38
- package/lib/es/backtop/index.js +2 -1
- package/lib/es/badge/index.js +2 -1
- package/lib/es/banner/index.js +9 -4
- package/lib/es/breadcrumb/index.js +4 -3
- package/lib/es/button/Button.js +11 -3
- package/lib/es/card/index.js +10 -5
- package/lib/es/carousel/CarouselArrow.js +6 -2
- package/lib/es/carousel/index.js +2 -1
- package/lib/es/cascader/index.js +15 -8
- package/lib/es/cascader/item.js +2 -1
- package/lib/es/checkbox/checkbox.js +6 -2
- package/lib/es/collapsible/index.js +2 -1
- package/lib/es/datePicker/dateInput.js +2 -1
- package/lib/es/datePicker/datePicker.js +4 -2
- package/lib/es/divider/index.js +2 -1
- package/lib/es/dropdown/index.js +2 -1
- package/lib/es/empty/index.js +8 -4
- package/lib/es/form/baseForm.d.ts +1 -1
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/form/field.js +1 -1
- package/lib/es/form/hoc/withField.js +2 -1
- package/lib/es/form/label.js +2 -1
- package/lib/es/grid/col.js +2 -1
- package/lib/es/grid/row.js +2 -1
- package/lib/es/iconButton/index.js +3 -1
- package/lib/es/input/index.d.ts +0 -1
- package/lib/es/input/index.js +41 -36
- package/lib/es/input/inputGroup.js +2 -3
- package/lib/es/input/textarea.js +8 -15
- package/lib/es/list/index.js +6 -3
- package/lib/es/modal/ConfirmModal.js +2 -1
- package/lib/es/modal/Modal.js +6 -2
- package/lib/es/modal/ModalContent.js +13 -6
- package/lib/es/notification/notice.js +6 -3
- package/lib/es/pagination/index.js +4 -2
- package/lib/es/popconfirm/index.js +6 -3
- package/lib/es/radio/radio.d.ts +4 -0
- package/lib/es/radio/radio.js +32 -9
- package/lib/es/radio/radioInner.d.ts +6 -0
- package/lib/es/radio/radioInner.js +13 -4
- package/lib/es/rating/item.js +2 -1
- package/lib/es/scrollList/index.js +6 -3
- package/lib/es/select/index.js +10 -4
- package/lib/es/select/option.js +2 -1
- package/lib/es/sideSheet/SideSheetContent.js +6 -3
- package/lib/es/skeleton/index.js +3 -1
- package/lib/es/space/index.js +2 -1
- package/lib/es/spin/index.js +7 -3
- package/lib/es/switch/index.js +6 -4
- package/lib/es/table/ColumnFilter.js +1 -1
- package/lib/es/table/ColumnSelection.js +1 -1
- package/lib/es/table/Table.js +6 -3
- package/lib/es/tabs/TabBar.js +2 -1
- package/lib/es/tabs/TabPane.js +5 -2
- package/lib/es/tagInput/index.js +31 -22
- package/lib/es/timePicker/Combobox.js +3 -1
- package/lib/es/timePicker/TimePicker.js +2 -0
- package/lib/es/toast/toast.js +6 -3
- package/lib/es/tooltip/index.js +6 -1
- package/lib/es/transfer/index.js +3 -2
- package/lib/es/tree/treeNode.js +3 -2
- package/lib/es/treeSelect/index.js +10 -3
- package/lib/es/typography/base.js +2 -1
- package/lib/es/typography/title.d.ts +1 -1
- package/lib/es/upload/index.d.ts +1 -1
- package/lib/es/upload/index.js +13 -6
- package/list/index.tsx +16 -4
- package/modal/ConfirmModal.tsx +1 -1
- package/modal/Modal.tsx +2 -0
- package/modal/ModalContent.tsx +27 -14
- package/notification/notice.tsx +16 -4
- package/package.json +8 -8
- package/pagination/index.tsx +16 -2
- package/popconfirm/index.tsx +11 -3
- package/radio/_story/radio.stories.js +9 -6
- package/radio/radio.tsx +37 -7
- package/radio/radioInner.tsx +11 -2
- package/rating/item.tsx +1 -1
- package/scrollList/index.tsx +19 -3
- package/select/index.tsx +13 -4
- package/select/option.tsx +5 -1
- package/sideSheet/SideSheetContent.tsx +3 -3
- package/skeleton/index.tsx +1 -1
- package/space/index.tsx +1 -1
- package/spin/index.tsx +15 -9
- package/switch/index.tsx +9 -14
- package/table/ColumnFilter.tsx +1 -1
- package/table/ColumnSelection.tsx +1 -1
- package/table/Table.tsx +5 -3
- package/table/_story/v2/FixedOnHeaderRow/index.jsx +3 -0
- package/tabs/TabBar.tsx +1 -1
- package/tabs/TabPane.tsx +9 -4
- package/tabs/_story/tabs.stories.js +36 -0
- package/tag/_story/tag.stories.js +1 -1
- package/tagInput/index.tsx +32 -15
- package/timePicker/Combobox.tsx +6 -1
- package/timePicker/TimePicker.tsx +1 -0
- package/toast/toast.tsx +3 -3
- package/tooltip/index.tsx +4 -1
- package/transfer/index.tsx +2 -1
- package/tree/treeNode.tsx +2 -2
- package/treeSelect/_story/treeSelect.stories.js +161 -2
- package/treeSelect/index.tsx +17 -3
- package/typography/base.tsx +1 -1
- package/upload/_story/upload.stories.js +152 -0
- package/upload/index.tsx +107 -38
package/divider/index.tsx
CHANGED
|
@@ -60,10 +60,14 @@ const Divider: React.FC<DividerProps> = props => {
|
|
|
60
60
|
|
|
61
61
|
return (
|
|
62
62
|
<div {...rest} className={dividerClassNames} style={{ ...overrideDefaultStyle, ...style }}>
|
|
63
|
-
{
|
|
64
|
-
typeof children === 'string' ?
|
|
65
|
-
{children
|
|
66
|
-
|
|
63
|
+
{children && layout === 'horizontal' ? (
|
|
64
|
+
typeof children === 'string' ? (
|
|
65
|
+
<span className={`${prefixCls}-divider_inner-text`} x-semi-prop="children">
|
|
66
|
+
{children}
|
|
67
|
+
</span>
|
|
68
|
+
) : (
|
|
69
|
+
children
|
|
70
|
+
)
|
|
67
71
|
) : null}
|
|
68
72
|
</div>
|
|
69
73
|
);
|
package/dropdown/index.tsx
CHANGED
|
@@ -144,7 +144,7 @@ class Dropdown extends BaseComponent<DropdownProps, DropdownState> {
|
|
|
144
144
|
return (
|
|
145
145
|
<DropdownContext.Provider value={contextValue}>
|
|
146
146
|
<div className={className} style={style}>
|
|
147
|
-
<div className={`${prefixCls}-content`}>{content}</div>
|
|
147
|
+
<div className={`${prefixCls}-content`} x-semi-prop="render">{content}</div>
|
|
148
148
|
</div>
|
|
149
149
|
</DropdownContext.Provider>
|
|
150
150
|
);
|
package/empty/index.tsx
CHANGED
|
@@ -109,17 +109,25 @@ export default class Empty extends BaseComponent<EmptyProps, EmptyState> {
|
|
|
109
109
|
};
|
|
110
110
|
return (
|
|
111
111
|
<div className={wrapperCls} style={style}>
|
|
112
|
-
<div className={`${prefixCls}-image`} style={imageStyle} >
|
|
112
|
+
<div className={`${prefixCls}-image`} style={imageStyle} x-semi-prop="image,darkModeImage">
|
|
113
113
|
{imageNode}
|
|
114
114
|
</div>
|
|
115
|
-
<div className={`${prefixCls}-content`}
|
|
115
|
+
<div className={`${prefixCls}-content`}>
|
|
116
116
|
{title ? (
|
|
117
|
-
<Typography.Title {...(titleProps as any)} className={`${prefixCls}-title`} >
|
|
117
|
+
<Typography.Title {...(titleProps as any)} className={`${prefixCls}-title`} x-semi-prop="title">
|
|
118
118
|
{title}
|
|
119
119
|
</Typography.Title>
|
|
120
120
|
) : null}
|
|
121
|
-
{description ?
|
|
122
|
-
|
|
121
|
+
{description ? (
|
|
122
|
+
<div className={`${prefixCls}-description`} x-semi-prop="description">
|
|
123
|
+
{description}
|
|
124
|
+
</div>
|
|
125
|
+
) : null}
|
|
126
|
+
{children ? (
|
|
127
|
+
<div className={`${prefixCls}-footer`} x-semi-prop="children">
|
|
128
|
+
{children}
|
|
129
|
+
</div>
|
|
130
|
+
) : null}
|
|
123
131
|
</div>
|
|
124
132
|
</div>
|
|
125
133
|
);
|
|
@@ -138,14 +138,21 @@ interface IProps {
|
|
|
138
138
|
interface IState {
|
|
139
139
|
visible: boolean;
|
|
140
140
|
}
|
|
141
|
+
|
|
142
|
+
interface FData {
|
|
143
|
+
test: boolean;
|
|
144
|
+
test2: boolean;
|
|
145
|
+
test3: string;
|
|
146
|
+
// [x: string]: unknown;
|
|
147
|
+
}
|
|
141
148
|
class Demo extends React.Component<IProps, IState> {
|
|
142
149
|
constructor(props:any) {
|
|
143
150
|
super(props);
|
|
144
151
|
this.state = { visible: false};
|
|
145
152
|
}
|
|
146
153
|
|
|
147
|
-
getFormApi(formApi: FormApi) {
|
|
148
|
-
|
|
154
|
+
getFormApi(formApi: FormApi<FData>) {
|
|
155
|
+
formApi.getValue()
|
|
149
156
|
}
|
|
150
157
|
|
|
151
158
|
render() {
|
package/form/field.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import Input from '../input/index';
|
|
|
7
7
|
import TextArea from '../input/textarea';
|
|
8
8
|
import InputNumber from '../inputNumber/index';
|
|
9
9
|
import Select from '../select/index';
|
|
10
|
-
import Checkbox from '../checkbox/index';
|
|
10
|
+
import { Checkbox } from '../checkbox/index';
|
|
11
11
|
import CheckboxGroup from '../checkbox/checkboxGroup';
|
|
12
12
|
import { Radio } from '../radio/index';
|
|
13
13
|
import RadioGroup from '../radio/radioGroup';
|
package/form/hoc/withField.tsx
CHANGED
|
@@ -439,7 +439,7 @@ function withField<
|
|
|
439
439
|
[`${prefix}-field-extra-botttom`]: mergeExtraPos === 'bottom',
|
|
440
440
|
});
|
|
441
441
|
|
|
442
|
-
const extraContent = extraText ? <div className={extraCls} id={extraTextId}>{extraText}</div> : null;
|
|
442
|
+
const extraContent = extraText ? <div className={extraCls} id={extraTextId} x-semi-prop="extraText">{extraText}</div> : null;
|
|
443
443
|
|
|
444
444
|
let newProps: Record<string, any> = {
|
|
445
445
|
id: a11yId,
|
package/form/label.tsx
CHANGED
|
@@ -61,7 +61,7 @@ export default class Label extends PureComponent<LabelProps> {
|
|
|
61
61
|
width ? labelStyle.width = width : null;
|
|
62
62
|
|
|
63
63
|
const textContent = (
|
|
64
|
-
<div className={`${prefixCls}-field-label-text`}>
|
|
64
|
+
<div className={`${prefixCls}-field-label-text`} x-semi-prop="label">
|
|
65
65
|
{typeof text !== 'undefined' ? text : children}
|
|
66
66
|
</div>
|
|
67
67
|
);
|
package/grid/col.tsx
CHANGED
package/grid/row.tsx
CHANGED
|
@@ -167,7 +167,7 @@ class Row extends React.Component<RowProps, RowState> {
|
|
|
167
167
|
gutters,
|
|
168
168
|
}}
|
|
169
169
|
>
|
|
170
|
-
<div {...otherProps} className={classes} style={rowStyle}>
|
|
170
|
+
<div {...otherProps} className={classes} style={rowStyle} x-semi-prop="children">
|
|
171
171
|
{children}
|
|
172
172
|
</div>
|
|
173
173
|
</RowContext.Provider>
|
package/gulpfile.js
CHANGED
|
@@ -73,14 +73,14 @@ gulp.task('compileScss', function compileScss() {
|
|
|
73
73
|
}
|
|
74
74
|
))
|
|
75
75
|
.pipe(sass({
|
|
76
|
-
importer: (url, prev) => {
|
|
76
|
+
importer: (url, prev, done) => {
|
|
77
77
|
const rootPath = path.join(__dirname, '../../');
|
|
78
78
|
let realUrl = url;
|
|
79
79
|
if (/~@douyinfe\/semi-foundation/.test(url)) {
|
|
80
80
|
const semiUIPath = path.join(rootPath, 'packages/semi-foundation');
|
|
81
81
|
realUrl = url.replace(/~@douyinfe\/semi-foundation/, semiUIPath);
|
|
82
82
|
}
|
|
83
|
-
|
|
83
|
+
done({ file:realUrl });
|
|
84
84
|
},
|
|
85
85
|
charset: false
|
|
86
86
|
}).on('error', sass.logError))
|
|
@@ -104,11 +104,11 @@ gulp.task('moveScssForCJS', function moveScssForCJS() {
|
|
|
104
104
|
return moveScss(false);
|
|
105
105
|
});
|
|
106
106
|
|
|
107
|
-
gulp.task('compileLib',
|
|
107
|
+
gulp.task('compileLib',
|
|
108
108
|
gulp.series(
|
|
109
109
|
[
|
|
110
|
-
'cleanLib',
|
|
111
|
-
'compileScss',
|
|
110
|
+
'cleanLib',
|
|
111
|
+
'compileScss',
|
|
112
112
|
gulp.parallel('moveScssForESM', 'moveScssForCJS'),
|
|
113
113
|
gulp.parallel('compileTSXForESM', 'compileTSXForCJS')
|
|
114
114
|
]
|
package/iconButton/index.tsx
CHANGED
|
@@ -97,7 +97,8 @@ class IconButton extends PureComponent<IconButtonProps> {
|
|
|
97
97
|
[`${prefixCls}-content-right`]: iconPosition === 'left',
|
|
98
98
|
});
|
|
99
99
|
|
|
100
|
-
const
|
|
100
|
+
const xSemiProp = this.props['x-semi-children-alias'] || 'children';
|
|
101
|
+
const children = originChildren != null ? <span className={btnTextCls} x-semi-prop={xSemiProp}>{originChildren}</span> : null;
|
|
101
102
|
|
|
102
103
|
if (iconPosition === 'left') {
|
|
103
104
|
finalChildren = (
|
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
Switch,
|
|
23
23
|
Form,
|
|
24
24
|
Space,
|
|
25
|
+
Radio
|
|
25
26
|
} from '../../index';
|
|
26
27
|
import './input.scss';
|
|
27
28
|
import RTLWrapper from '../../configProvider/_story/RTLDirection/RTLWrapper';
|
|
@@ -863,8 +864,7 @@ export const ClearButton = () => {
|
|
|
863
864
|
Suffix
|
|
864
865
|
</Typography.Text>
|
|
865
866
|
}
|
|
866
|
-
|
|
867
|
-
></Input>
|
|
867
|
+
/>
|
|
868
868
|
<Input showClear defaultValue="semi" />
|
|
869
869
|
<Input showClear mode="password" defaultValue="semi" />
|
|
870
870
|
<Input mode="password" defaultValue="semi" />
|
|
@@ -906,4 +906,33 @@ export const TextAreaAutosize = () => {
|
|
|
906
906
|
</div>
|
|
907
907
|
)
|
|
908
908
|
};
|
|
909
|
-
TextAreaAutosize.storyName = "textarea autosize";
|
|
909
|
+
TextAreaAutosize.storyName = "textarea autosize";
|
|
910
|
+
|
|
911
|
+
export const InputA11y = () => {
|
|
912
|
+
return (
|
|
913
|
+
<div style={{ width: 300 }}>
|
|
914
|
+
<Input prefix="search" defaultValue="Semi Design" showClear />
|
|
915
|
+
<br/><br/>
|
|
916
|
+
<Input aria-required prefix="search" defaultValue="Semi Design" showClear suffix="semi" />
|
|
917
|
+
<br/><br/>
|
|
918
|
+
<Input data-cy="password" defaultValue="Semi Design" mode="password" />
|
|
919
|
+
<br/><br/>
|
|
920
|
+
<Input defaultValue="Semi Design" mode="password" disabled />
|
|
921
|
+
<br/><br/>
|
|
922
|
+
<Input defaultValue='this value is too long' validateStatus='error' showClear></Input>
|
|
923
|
+
<br/><br/>
|
|
924
|
+
<TextArea defaultValue='semi' showClear />
|
|
925
|
+
<TextArea aria-required defaultValue='不能为空' showClear />
|
|
926
|
+
<InputGroup label={{ text: '成绩信息' }}>
|
|
927
|
+
<Input placeholder="Name" style={{ width: 100 }} />
|
|
928
|
+
<Input placeholder="Score" style={{ width: 140 }} />
|
|
929
|
+
</InputGroup>
|
|
930
|
+
<br/><br/>
|
|
931
|
+
<Form onSubmit={() => alert('submit')}>
|
|
932
|
+
<button>submit</button>
|
|
933
|
+
<Form.Input field="password" label="密码按钮上敲击 Enter 测试是否会触发 Form submit" mode="password" />
|
|
934
|
+
</Form>
|
|
935
|
+
</div>
|
|
936
|
+
);
|
|
937
|
+
}
|
|
938
|
+
InputA11y.storyName = "input a11y";
|
package/input/index.tsx
CHANGED
|
@@ -141,7 +141,7 @@ class Input extends BaseComponent<InputProps, InputState> {
|
|
|
141
141
|
onKeyUp: noop,
|
|
142
142
|
onKeyPress: noop,
|
|
143
143
|
onEnterPress: noop,
|
|
144
|
-
validateStatus: 'default'
|
|
144
|
+
validateStatus: 'default',
|
|
145
145
|
};
|
|
146
146
|
|
|
147
147
|
inputRef!: React.RefObject<HTMLInputElement>;
|
|
@@ -195,7 +195,7 @@ class Input extends BaseComponent<InputProps, InputState> {
|
|
|
195
195
|
notifyClear: (e: React.MouseEvent<HTMLDivElement>) => this.props.onClear(e),
|
|
196
196
|
setPaddingLeft: (paddingLeft: string) => this.setState({ paddingLeft }),
|
|
197
197
|
setMinLength: (minLength: number) => this.setState({ minLength }),
|
|
198
|
-
isEventTarget: (e: React.MouseEvent) => e && e.target === e.currentTarget
|
|
198
|
+
isEventTarget: (e: React.MouseEvent) => e && e.target === e.currentTarget,
|
|
199
199
|
};
|
|
200
200
|
}
|
|
201
201
|
|
|
@@ -221,10 +221,6 @@ class Input extends BaseComponent<InputProps, InputState> {
|
|
|
221
221
|
this.foundation.handleClear(e);
|
|
222
222
|
};
|
|
223
223
|
|
|
224
|
-
handleClearEnterPress = (e: React.KeyboardEvent<HTMLDivElement>) => {
|
|
225
|
-
this.foundation.handleClearEnterPress(e);
|
|
226
|
-
};
|
|
227
|
-
|
|
228
224
|
handleClick = (e: React.MouseEvent<HTMLDivElement>) => {
|
|
229
225
|
this.foundation.handleClick(e);
|
|
230
226
|
};
|
|
@@ -255,7 +251,7 @@ class Input extends BaseComponent<InputProps, InputState> {
|
|
|
255
251
|
|
|
256
252
|
handleModeEnterPress = (e: React.KeyboardEvent<HTMLDivElement>) => {
|
|
257
253
|
this.foundation.handleModeEnterPress(e);
|
|
258
|
-
}
|
|
254
|
+
};
|
|
259
255
|
|
|
260
256
|
handleClickPrefixOrSuffix = (e: React.MouseEvent<HTMLInputElement>) => {
|
|
261
257
|
this.foundation.handleClickPrefixOrSuffix(e);
|
|
@@ -273,7 +269,11 @@ class Input extends BaseComponent<InputProps, InputState> {
|
|
|
273
269
|
[`${prefixCls}-prepend-text`]: addonBefore && isString(addonBefore),
|
|
274
270
|
[`${prefixCls}-prepend-icon`]: isSemiIcon(addonBefore),
|
|
275
271
|
});
|
|
276
|
-
return
|
|
272
|
+
return (
|
|
273
|
+
<div className={prefixWrapperCls} x-semi-prop="addonBefore">
|
|
274
|
+
{addonBefore}
|
|
275
|
+
</div>
|
|
276
|
+
);
|
|
277
277
|
}
|
|
278
278
|
return null;
|
|
279
279
|
}
|
|
@@ -286,7 +286,11 @@ class Input extends BaseComponent<InputProps, InputState> {
|
|
|
286
286
|
[`${prefixCls}-append-text`]: addonAfter && isString(addonAfter),
|
|
287
287
|
[`${prefixCls}-append-icon`]: isSemiIcon(addonAfter),
|
|
288
288
|
});
|
|
289
|
-
return
|
|
289
|
+
return (
|
|
290
|
+
<div className={prefixWrapperCls} x-semi-prop="addonAfter">
|
|
291
|
+
{addonAfter}
|
|
292
|
+
</div>
|
|
293
|
+
);
|
|
290
294
|
}
|
|
291
295
|
return null;
|
|
292
296
|
}
|
|
@@ -297,13 +301,10 @@ class Input extends BaseComponent<InputProps, InputState> {
|
|
|
297
301
|
// use onMouseDown to fix issue 1203
|
|
298
302
|
if (allowClear) {
|
|
299
303
|
return (
|
|
304
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
300
305
|
<div
|
|
301
|
-
role="button"
|
|
302
|
-
tabIndex={0}
|
|
303
|
-
aria-label="Clear input value"
|
|
304
306
|
className={clearCls}
|
|
305
307
|
onMouseDown={this.handleClear}
|
|
306
|
-
onKeyPress={this.handleClearEnterPress}
|
|
307
308
|
>
|
|
308
309
|
<IconClear />
|
|
309
310
|
</div>
|
|
@@ -313,11 +314,12 @@ class Input extends BaseComponent<InputProps, InputState> {
|
|
|
313
314
|
}
|
|
314
315
|
|
|
315
316
|
renderModeBtn() {
|
|
316
|
-
const {
|
|
317
|
+
const { eyeClosed } = this.state;
|
|
317
318
|
const { mode, disabled } = this.props;
|
|
318
319
|
const modeCls = cls(`${prefixCls}-modebtn`);
|
|
319
320
|
const modeIcon = eyeClosed ? <IconEyeClosedSolid /> : <IconEyeOpened />;
|
|
320
|
-
|
|
321
|
+
// alway show password button for a11y
|
|
322
|
+
const showModeBtn = mode === 'password' && !disabled;
|
|
321
323
|
const ariaLabel = eyeClosed ? 'Show password' : 'Hidden password';
|
|
322
324
|
if (showModeBtn) {
|
|
323
325
|
return (
|
|
@@ -351,8 +353,18 @@ class Input extends BaseComponent<InputProps, InputState> {
|
|
|
351
353
|
[`${prefixCls}-prefix-icon`]: isSemiIcon(labelNode),
|
|
352
354
|
});
|
|
353
355
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
+
return (
|
|
357
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
358
|
+
<div
|
|
359
|
+
className={prefixWrapperCls}
|
|
360
|
+
onMouseDown={this.handlePreventMouseDown}
|
|
361
|
+
onClick={this.handleClickPrefixOrSuffix}
|
|
362
|
+
id={insetLabelId}
|
|
363
|
+
x-semi-prop="prefix,insetLabel"
|
|
364
|
+
>
|
|
365
|
+
{labelNode}
|
|
366
|
+
</div>
|
|
367
|
+
);
|
|
356
368
|
}
|
|
357
369
|
|
|
358
370
|
showClearBtn() {
|
|
@@ -367,13 +379,22 @@ class Input extends BaseComponent<InputProps, InputState> {
|
|
|
367
379
|
return null;
|
|
368
380
|
}
|
|
369
381
|
const suffixWrapperCls = cls({
|
|
370
|
-
[`${prefixCls
|
|
371
|
-
[`${prefixCls
|
|
372
|
-
[`${prefixCls
|
|
382
|
+
[`${prefixCls}-suffix`]: true,
|
|
383
|
+
[`${prefixCls}-suffix-text`]: suffix && isString(suffix),
|
|
384
|
+
[`${prefixCls}-suffix-icon`]: isSemiIcon(suffix),
|
|
373
385
|
[`${prefixCls}-suffix-hidden`]: suffixAllowClear && Boolean(hideSuffix),
|
|
374
386
|
});
|
|
375
|
-
|
|
376
|
-
|
|
387
|
+
return (
|
|
388
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
389
|
+
<div
|
|
390
|
+
className={suffixWrapperCls}
|
|
391
|
+
onMouseDown={this.handlePreventMouseDown}
|
|
392
|
+
onClick={this.handleClickPrefixOrSuffix}
|
|
393
|
+
x-semi-prop="suffix"
|
|
394
|
+
>
|
|
395
|
+
{suffix}
|
|
396
|
+
</div>
|
|
397
|
+
);
|
|
377
398
|
}
|
|
378
399
|
|
|
379
400
|
render() {
|
|
@@ -383,6 +404,7 @@ class Input extends BaseComponent<InputProps, InputState> {
|
|
|
383
404
|
autofocus,
|
|
384
405
|
className,
|
|
385
406
|
disabled,
|
|
407
|
+
defaultValue,
|
|
386
408
|
placeholder,
|
|
387
409
|
prefix,
|
|
388
410
|
mode,
|
|
@@ -460,7 +482,7 @@ class Input extends BaseComponent<InputProps, InputState> {
|
|
|
460
482
|
inputProps.minLength = stateMinLength;
|
|
461
483
|
}
|
|
462
484
|
if (validateStatus === 'error') {
|
|
463
|
-
inputProps['aria-invalid'] =
|
|
485
|
+
inputProps['aria-invalid'] = 'true';
|
|
464
486
|
}
|
|
465
487
|
return (
|
|
466
488
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
package/input/inputGroup.tsx
CHANGED
|
@@ -66,9 +66,11 @@ export default class inputGroup extends BaseComponent<InputGroupProps, InputGrou
|
|
|
66
66
|
// const labelCls = cls(label.className, '');
|
|
67
67
|
const defaultName = 'input-group';
|
|
68
68
|
return (
|
|
69
|
-
<div
|
|
69
|
+
<div className={groupWrapperCls}>
|
|
70
70
|
{label && label.text ? <Label name={defaultName} {...label} /> : null}
|
|
71
71
|
<span
|
|
72
|
+
role="group"
|
|
73
|
+
aria-disabled={this.props.disabled}
|
|
72
74
|
id={label && label.name || defaultName}
|
|
73
75
|
className={groupCls}
|
|
74
76
|
style={this.props.style}
|
package/input/textarea.tsx
CHANGED
|
@@ -198,10 +198,6 @@ class TextArea extends BaseComponent<TextAreaProps, TextAreaState> {
|
|
|
198
198
|
this.foundation.handleClear(e);
|
|
199
199
|
};
|
|
200
200
|
|
|
201
|
-
handleClearEnterPress = (e: React.KeyboardEvent<HTMLDivElement>) => {
|
|
202
|
-
this.foundation.handleClearEnterPress(e);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
201
|
renderClearBtn() {
|
|
206
202
|
const { showClear } = this.props;
|
|
207
203
|
const displayClearBtn = this.foundation.isAllowClear();
|
|
@@ -210,13 +206,10 @@ class TextArea extends BaseComponent<TextAreaProps, TextAreaState> {
|
|
|
210
206
|
});
|
|
211
207
|
if (showClear) {
|
|
212
208
|
return (
|
|
209
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
213
210
|
<div
|
|
214
|
-
role="button"
|
|
215
|
-
tabIndex={0}
|
|
216
|
-
aria-label="Clear textarea value"
|
|
217
211
|
className={clearCls}
|
|
218
212
|
onClick={this.handleClear}
|
|
219
|
-
onKeyPress={this.handleClearEnterPress}
|
|
220
213
|
>
|
|
221
214
|
<IconClear />
|
|
222
215
|
</div>
|
|
@@ -243,12 +236,7 @@ class TextArea extends BaseComponent<TextAreaProps, TextAreaState> {
|
|
|
243
236
|
}
|
|
244
237
|
);
|
|
245
238
|
counter = (
|
|
246
|
-
<div
|
|
247
|
-
aria-label="Textarea value length counter"
|
|
248
|
-
aria-valuemax={maxCount}
|
|
249
|
-
aria-valuenow={current}
|
|
250
|
-
className={countCls}
|
|
251
|
-
>
|
|
239
|
+
<div className={countCls}>
|
|
252
240
|
{current}{total ? '/' : null}{total}
|
|
253
241
|
</div>
|
|
254
242
|
);
|
package/lib/cjs/_base/base.css
CHANGED
|
@@ -345,13 +345,13 @@ body, body[theme-mode=dark] .semi-always-light {
|
|
|
345
345
|
--semi-color-primary-light-default: rgba(var(--semi-blue-0), 1);
|
|
346
346
|
--semi-color-primary-light-hover: rgba(var(--semi-blue-1), 1);
|
|
347
347
|
--semi-color-primary-light-active: rgba(var(--semi-blue-2), 1);
|
|
348
|
-
--semi-color-secondary: rgba(var(--semi-blue-5), 1);
|
|
349
|
-
--semi-color-secondary-hover: rgba(var(--semi-blue-6), 1);
|
|
350
|
-
--semi-color-secondary-active: rgba(var(--semi-blue-7), 1);
|
|
351
|
-
--semi-color-secondary-disabled: rgba(var(--semi-blue-2), 1);
|
|
352
|
-
--semi-color-secondary-light-default: rgba(var(--semi-blue-0), 1);
|
|
353
|
-
--semi-color-secondary-light-hover: rgba(var(--semi-blue-1), 1);
|
|
354
|
-
--semi-color-secondary-light-active: rgba(var(--semi-blue-2), 1);
|
|
348
|
+
--semi-color-secondary: rgba(var(--semi-light-blue-5), 1);
|
|
349
|
+
--semi-color-secondary-hover: rgba(var(--semi-light-blue-6), 1);
|
|
350
|
+
--semi-color-secondary-active: rgba(var(--semi-light-blue-7), 1);
|
|
351
|
+
--semi-color-secondary-disabled: rgba(var(--semi-light-blue-2), 1);
|
|
352
|
+
--semi-color-secondary-light-default: rgba(var(--semi-light-blue-0), 1);
|
|
353
|
+
--semi-color-secondary-light-hover: rgba(var(--semi-light-blue-1), 1);
|
|
354
|
+
--semi-color-secondary-light-active: rgba(var(--semi-light-blue-2), 1);
|
|
355
355
|
--semi-color-tertiary: rgba(var(--semi-grey-5), 1);
|
|
356
356
|
--semi-color-tertiary-hover: rgba(var(--semi-grey-6), 1);
|
|
357
357
|
--semi-color-tertiary-active: rgba(var(--semi-grey-7), 1);
|
|
@@ -433,13 +433,13 @@ body[theme-mode=dark], body .semi-always-dark {
|
|
|
433
433
|
--semi-color-primary-light-default: rgba(var(--semi-blue-5), .2);
|
|
434
434
|
--semi-color-primary-light-hover: rgba(var(--semi-blue-5), .3);
|
|
435
435
|
--semi-color-primary-light-active: rgba(var(--semi-blue-5), .4);
|
|
436
|
-
--semi-color-secondary: rgba(var(--semi-blue-5), 1);
|
|
437
|
-
--semi-color-secondary-hover: rgba(var(--semi-blue-6), 1);
|
|
438
|
-
--semi-color-secondary-active: rgba(var(--semi-blue-7), 1);
|
|
439
|
-
--semi-color-secondary-disabled: rgba(var(--semi-blue-2), 1);
|
|
440
|
-
--semi-color-secondary-light-default: rgba(var(--semi-blue-5), .2);
|
|
441
|
-
--semi-color-secondary-light-hover: rgba(var(--semi-blue-5), .3);
|
|
442
|
-
--semi-color-secondary-light-active: rgba(var(--semi-blue-5), .4);
|
|
436
|
+
--semi-color-secondary: rgba(var(--semi-light-blue-5), 1);
|
|
437
|
+
--semi-color-secondary-hover: rgba(var(--semi-light-blue-6), 1);
|
|
438
|
+
--semi-color-secondary-active: rgba(var(--semi-light-blue-7), 1);
|
|
439
|
+
--semi-color-secondary-disabled: rgba(var(--semi-light-blue-2), 1);
|
|
440
|
+
--semi-color-secondary-light-default: rgba(var(--semi-light-blue-5), .2);
|
|
441
|
+
--semi-color-secondary-light-hover: rgba(var(--semi-light-blue-5), .3);
|
|
442
|
+
--semi-color-secondary-light-active: rgba(var(--semi-light-blue-5), .4);
|
|
443
443
|
--semi-color-tertiary: rgba(var(--semi-grey-5), 1);
|
|
444
444
|
--semi-color-tertiary-hover: rgba(var(--semi-grey-6), 1);
|
|
445
445
|
--semi-color-tertiary-active: rgba(var(--semi-grey-7), 1);
|
|
@@ -507,4 +507,26 @@ body[theme-mode=dark], body .semi-always-dark {
|
|
|
507
507
|
--semi-border-radius-large: 12px;
|
|
508
508
|
--semi-border-radius-circle: 50%;
|
|
509
509
|
--semi-border-radius-full: 9999px;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
.semi-light-scrollbar::-webkit-scrollbar, .semi-light-scrollbar *::-webkit-scrollbar {
|
|
513
|
+
width: 8px;
|
|
514
|
+
height: 8px;
|
|
515
|
+
}
|
|
516
|
+
.semi-light-scrollbar::-webkit-scrollbar-track, .semi-light-scrollbar *::-webkit-scrollbar-track {
|
|
517
|
+
background: rgba(0, 0, 0, 0);
|
|
518
|
+
}
|
|
519
|
+
.semi-light-scrollbar::-webkit-scrollbar-corner, .semi-light-scrollbar *::-webkit-scrollbar-corner {
|
|
520
|
+
background-color: rgba(0, 0, 0, 0);
|
|
521
|
+
}
|
|
522
|
+
.semi-light-scrollbar::-webkit-scrollbar-thumb, .semi-light-scrollbar *::-webkit-scrollbar-thumb {
|
|
523
|
+
border-radius: 6px;
|
|
524
|
+
background: transparent;
|
|
525
|
+
transition: all 1s;
|
|
526
|
+
}
|
|
527
|
+
.semi-light-scrollbar:hover::-webkit-scrollbar-thumb, .semi-light-scrollbar *:hover::-webkit-scrollbar-thumb {
|
|
528
|
+
background: var(--semi-color-fill-2);
|
|
529
|
+
}
|
|
530
|
+
.semi-light-scrollbar::-webkit-scrollbar-thumb:hover, .semi-light-scrollbar *::-webkit-scrollbar-thumb:hover {
|
|
531
|
+
background: var(--semi-color-fill-1);
|
|
510
532
|
}
|
|
@@ -15,7 +15,7 @@ export default class AvatarGroup extends PureComponent<AvatarGroupProps> {
|
|
|
15
15
|
renderMore: PropTypes.Requireable<(...args: any[]) => any>;
|
|
16
16
|
overlapFrom: PropTypes.Requireable<string>;
|
|
17
17
|
};
|
|
18
|
-
getAllAvatars(): any[];
|
|
18
|
+
getAllAvatars(): (string | number | true | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactFragment | React.ReactPortal)[];
|
|
19
19
|
getMergeAvatars(avatars: React.ReactNode[]): React.ReactNode[];
|
|
20
20
|
renderMoreAvatar(restNumber: number, restAvatars: React.ReactNode[]): JSX.Element;
|
|
21
21
|
render(): JSX.Element;
|
|
@@ -22,10 +22,12 @@ var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-st
|
|
|
22
22
|
|
|
23
23
|
var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _reduce = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/reduce"));
|
|
26
26
|
|
|
27
27
|
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
28
28
|
|
|
29
|
+
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
30
|
+
|
|
29
31
|
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
30
32
|
|
|
31
33
|
var _isNumber2 = _interopRequireDefault(require("lodash/isNumber"));
|
|
@@ -69,7 +71,12 @@ class AvatarGroup extends _react.PureComponent {
|
|
|
69
71
|
const {
|
|
70
72
|
children
|
|
71
73
|
} = this.props;
|
|
72
|
-
|
|
74
|
+
|
|
75
|
+
if (children) {
|
|
76
|
+
return (0, _isArray.default)(children) ? _react.default.Children.toArray(children) : [children];
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return [];
|
|
73
80
|
}
|
|
74
81
|
|
|
75
82
|
getMergeAvatars(avatars) {
|
|
@@ -91,14 +98,33 @@ class AvatarGroup extends _react.PureComponent {
|
|
|
91
98
|
}
|
|
92
99
|
|
|
93
100
|
renderMoreAvatar(restNumber, restAvatars) {
|
|
101
|
+
var _context2;
|
|
102
|
+
|
|
94
103
|
const {
|
|
95
104
|
renderMore
|
|
96
105
|
} = this.props;
|
|
97
106
|
const moreCls = (0, _classnames.default)("".concat(prefixCls, "-item-more"));
|
|
107
|
+
const restAvatarAlt = restAvatars === null || restAvatars === void 0 ? void 0 : (0, _reduce.default)(restAvatars).call(restAvatars, (pre, cur) => {
|
|
108
|
+
var _context;
|
|
109
|
+
|
|
110
|
+
const {
|
|
111
|
+
children,
|
|
112
|
+
alt
|
|
113
|
+
} = cur.props;
|
|
114
|
+
const avatarInfo = alt !== null && alt !== void 0 ? alt : typeof children === 'string' ? children : '';
|
|
115
|
+
|
|
116
|
+
if (avatarInfo.length === 0) {
|
|
117
|
+
return pre;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return pre.length > 0 ? (0, _concat.default)(_context = "".concat(pre, ",")).call(_context, avatarInfo) : avatarInfo;
|
|
121
|
+
}, '');
|
|
122
|
+
const finalAlt = (0, _concat.default)(_context2 = " Number of remaining Avatars\uFF1A".concat(restNumber, ",")).call(_context2, restAvatarAlt);
|
|
98
123
|
|
|
99
124
|
let moreAvatar = /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
100
125
|
className: moreCls,
|
|
101
|
-
key: "_+n"
|
|
126
|
+
key: "_+n",
|
|
127
|
+
alt: finalAlt
|
|
102
128
|
}, "+".concat(restNumber));
|
|
103
129
|
|
|
104
130
|
if ((0, _isFunction2.default)(renderMore)) {
|
|
@@ -129,15 +155,15 @@ class AvatarGroup extends _react.PureComponent {
|
|
|
129
155
|
});
|
|
130
156
|
|
|
131
157
|
if (children) {
|
|
132
|
-
var
|
|
158
|
+
var _context3;
|
|
133
159
|
|
|
134
160
|
const avatars = this.getAllAvatars();
|
|
135
|
-
inner = (0, _map.default)(
|
|
136
|
-
var
|
|
161
|
+
inner = (0, _map.default)(_context3 = (0, _isNumber2.default)(maxCount) ? this.getMergeAvatars(avatars) : avatars).call(_context3, (itm, index) => {
|
|
162
|
+
var _context4, _context5;
|
|
137
163
|
|
|
138
164
|
const className = (0, _classnames.default)((0, _get2.default)(itm.props, 'className'), {
|
|
139
|
-
[(0, _concat.default)(
|
|
140
|
-
[(0, _concat.default)(
|
|
165
|
+
[(0, _concat.default)(_context4 = "".concat(prefixCls, "-item-start-")).call(_context4, index)]: overlapFrom === 'start',
|
|
166
|
+
[(0, _concat.default)(_context5 = "".concat(prefixCls, "-item-end-")).call(_context5, index)]: overlapFrom === 'end'
|
|
141
167
|
});
|
|
142
168
|
return /*#__PURE__*/_react.default.cloneElement(itm, (0, _assign.default)((0, _assign.default)({}, rest), {
|
|
143
169
|
className,
|
|
@@ -149,7 +175,8 @@ class AvatarGroup extends _react.PureComponent {
|
|
|
149
175
|
}
|
|
150
176
|
|
|
151
177
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
152
|
-
className: groupCls
|
|
178
|
+
className: groupCls,
|
|
179
|
+
role: 'list'
|
|
153
180
|
}, inner);
|
|
154
181
|
}
|
|
155
182
|
|
|
@@ -9,6 +9,7 @@ export * from './interface';
|
|
|
9
9
|
export interface AvatarState {
|
|
10
10
|
isImgExist: boolean;
|
|
11
11
|
hoverContent: React.ReactNode;
|
|
12
|
+
focusVisible: boolean;
|
|
12
13
|
}
|
|
13
14
|
export default class Avatar extends BaseComponent<AvatarProps, AvatarState> {
|
|
14
15
|
static defaultProps: {
|
|
@@ -45,5 +46,9 @@ export default class Avatar extends BaseComponent<AvatarProps, AvatarState> {
|
|
|
45
46
|
onEnter(e: React.MouseEvent): void;
|
|
46
47
|
onLeave(e: React.MouseEvent): void;
|
|
47
48
|
handleError(): void;
|
|
49
|
+
handleKeyDown(event: any): void;
|
|
50
|
+
handleFocusVisible: (event: React.FocusEvent) => void;
|
|
51
|
+
handleBlur: (event: React.FocusEvent) => void;
|
|
52
|
+
getContent: () => React.ReactNode;
|
|
48
53
|
render(): JSX.Element;
|
|
49
54
|
}
|