@douyinfe/semi-ui 2.0.9-alpha.5 → 2.1.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/dist/umd/semi-ui.js +584 -646
- 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/es/autoComplete/index.d.ts +11 -36
- package/lib/es/calendar/dayCalendar.js +1 -1
- package/lib/es/calendar/monthCalendar.js +1 -1
- package/lib/es/calendar/rangeCalendar.js +1 -1
- package/lib/es/calendar/weekCalendar.js +1 -1
- package/lib/es/collapse/index.js +5 -1
- package/lib/es/datePicker/yearAndMonth.d.ts +2 -2
- package/lib/es/form/baseForm.d.ts +11 -5
- package/lib/es/form/baseForm.js +2 -1
- package/lib/es/form/field.d.ts +23 -5
- package/lib/es/form/field.js +18 -2
- package/lib/es/form/hoc/withField.d.ts +1 -1
- package/lib/es/form/hoc/withField.js +3 -0
- package/lib/es/locale/localeConsumer.d.ts +5 -5
- package/lib/es/modal/useModal/HookModal.d.ts +2 -3
- package/lib/es/modal/useModal/index.js +1 -1
- package/lib/es/notification/index.d.ts +1 -1
- package/lib/es/notification/index.js +1 -1
- package/lib/es/rating/index.d.ts +1 -1
- package/lib/es/resizeObserver/index.js +0 -1
- package/lib/es/scrollList/scrollItem.d.ts +11 -12
- package/lib/es/scrollList/scrollItem.js +8 -8
- package/lib/es/select/index.js +2 -2
- package/lib/es/select/option.js +2 -2
- package/lib/es/select/utils.js +4 -2
- package/lib/es/sideSheet/SideSheetContent.d.ts +1 -1
- package/lib/es/sideSheet/index.d.ts +3 -3
- package/lib/es/steps/basicSteps.js +2 -2
- package/lib/es/steps/fillSteps.js +3 -3
- package/lib/es/steps/navSteps.js +2 -2
- package/lib/es/tabs/TabBar.d.ts +1 -1
- package/lib/es/tabs/index.js +5 -5
- package/lib/es/timePicker/Combobox.d.ts +4 -10
- package/lib/es/timePicker/Combobox.js +1 -2
- package/lib/es/timePicker/TimePicker.d.ts +1 -1
- package/lib/es/treeSelect/index.js +1 -2
- package/lib/es/typography/base.d.ts +1 -1
- package/lib/es/typography/paragraph.d.ts +1 -1
- package/lib/es/typography/text.d.ts +1 -1
- package/lib/es/upload/fileCard.d.ts +18 -3
- package/lib/es/upload/index.d.ts +57 -4
- package/package.json +8 -9
- package/lib/es/upload/interface.d.ts +0 -56
- package/lib/es/upload/interface.js +0 -1
|
@@ -2,7 +2,7 @@ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/insta
|
|
|
2
2
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
3
3
|
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
4
4
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
5
|
-
import React, { cloneElement, Children, useMemo
|
|
5
|
+
import React, { cloneElement, Children, useMemo } from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import cls from 'classnames';
|
|
8
8
|
import { stepsClasses as css } from '@douyinfe/semi-foundation/lib/es/steps/constants';
|
|
@@ -25,7 +25,7 @@ const Steps = props => {
|
|
|
25
25
|
const inner = useMemo(() => {
|
|
26
26
|
var _context;
|
|
27
27
|
|
|
28
|
-
const filteredChildren = _filterInstanceProperty(_context = Children.toArray(children)).call(_context, c =>
|
|
28
|
+
const filteredChildren = _filterInstanceProperty(_context = Children.toArray(children)).call(_context, c => Boolean(c));
|
|
29
29
|
|
|
30
30
|
const colStyle = direction === 'vertical' ? null : {
|
|
31
31
|
width: "".concat(100 / filteredChildren.length, "%")
|
|
@@ -69,7 +69,7 @@ const Steps = props => {
|
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
return content;
|
|
72
|
-
}, [children, initial, prefixCls, direction, status, current
|
|
72
|
+
}, [children, initial, prefixCls, direction, status, current]);
|
|
73
73
|
const wrapperCls = cls(className, {
|
|
74
74
|
[prefixCls]: true,
|
|
75
75
|
[_concatInstanceProperty(_context2 = "".concat(prefixCls, "-")).call(_context2, direction)]: true
|
package/lib/es/steps/navSteps.js
CHANGED
|
@@ -2,7 +2,7 @@ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/insta
|
|
|
2
2
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
3
3
|
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
4
4
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
5
|
-
import React, { cloneElement, Children, useMemo
|
|
5
|
+
import React, { cloneElement, Children, useMemo } from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import cls from 'classnames';
|
|
8
8
|
import { stepsClasses as css } from '@douyinfe/semi-foundation/lib/es/steps/constants';
|
|
@@ -23,7 +23,7 @@ const Steps = props => {
|
|
|
23
23
|
const inner = useMemo(() => {
|
|
24
24
|
var _context;
|
|
25
25
|
|
|
26
|
-
const filteredChildren = _filterInstanceProperty(_context = Children.toArray(children)).call(_context, c =>
|
|
26
|
+
const filteredChildren = _filterInstanceProperty(_context = Children.toArray(children)).call(_context, c => Boolean(c));
|
|
27
27
|
|
|
28
28
|
const total = filteredChildren.length;
|
|
29
29
|
|
package/lib/es/tabs/TabBar.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ declare class TabBar extends React.Component<TabBarProps, TabBarState> {
|
|
|
32
32
|
renderTabComponents: (list: Array<PlainTab>) => Array<ReactNode>;
|
|
33
33
|
handleArrowClick: (items: Array<OverflowItem>, pos: 'start' | 'end') => void;
|
|
34
34
|
renderCollapse: (items: Array<OverflowItem>, icon: ReactNode, pos: 'start' | 'end') => ReactNode;
|
|
35
|
-
renderOverflow: (items:
|
|
35
|
+
renderOverflow: (items: [Array<OverflowItem>, Array<OverflowItem>]) => Array<ReactNode>;
|
|
36
36
|
renderCollapsedTab: () => ReactNode;
|
|
37
37
|
render(): ReactNode;
|
|
38
38
|
private _isActive;
|
package/lib/es/tabs/index.js
CHANGED
|
@@ -19,7 +19,7 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
19
19
|
return t;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
import React, { createRef
|
|
22
|
+
import React, { createRef } from 'react';
|
|
23
23
|
import cls from 'classnames';
|
|
24
24
|
import PropTypes from 'prop-types';
|
|
25
25
|
import { cssClasses, strings } from '@douyinfe/semi-foundation/lib/es/tabs/constants';
|
|
@@ -79,7 +79,7 @@ class Tabs extends BaseComponent {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
return _filterInstanceProperty(_context = React.Children.toArray(children)).call(_context, pane => {
|
|
82
|
-
if (
|
|
82
|
+
if (pane && pane.type && pane.type.isTabPane) {
|
|
83
83
|
return pane.props.itemKey === activeKey;
|
|
84
84
|
}
|
|
85
85
|
|
|
@@ -155,7 +155,7 @@ class Tabs extends BaseComponent {
|
|
|
155
155
|
children
|
|
156
156
|
} = this.props;
|
|
157
157
|
let activeKey = '';
|
|
158
|
-
const list = tabList ? tabList : _mapInstanceProperty(_context3 = React.Children.toArray(children)).call(_context3, child =>
|
|
158
|
+
const list = tabList ? tabList : _mapInstanceProperty(_context3 = React.Children.toArray(children)).call(_context3, child => child.props);
|
|
159
159
|
|
|
160
160
|
_forEachInstanceProperty(list).call(list, item => {
|
|
161
161
|
if (item && !activeKey && !item.disabled) {
|
|
@@ -182,9 +182,9 @@ class Tabs extends BaseComponent {
|
|
|
182
182
|
var _context4, _context5;
|
|
183
183
|
|
|
184
184
|
// Panes state acts on tab bar, no need to compare TabPane children
|
|
185
|
-
const prevChildrenProps = _mapInstanceProperty(_context4 = React.Children.toArray(prevProps.children)).call(_context4, child => pick(
|
|
185
|
+
const prevChildrenProps = _mapInstanceProperty(_context4 = React.Children.toArray(prevProps.children)).call(_context4, child => pick(child.props, panePickKeys));
|
|
186
186
|
|
|
187
|
-
const nowChildrenProps = _mapInstanceProperty(_context5 = React.Children.toArray(this.props.children)).call(_context5, child => pick(
|
|
187
|
+
const nowChildrenProps = _mapInstanceProperty(_context5 = React.Children.toArray(this.props.children)).call(_context5, child => pick(child.props, panePickKeys));
|
|
188
188
|
|
|
189
189
|
const isTabListType = this.props.tabList || prevProps.tabList;
|
|
190
190
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import BaseComponent, { BaseProps } from '../_base/baseComponent';
|
|
3
3
|
import ScrollItem from '../scrollList/scrollItem';
|
|
4
|
-
import ComboboxFoundation
|
|
4
|
+
import ComboboxFoundation from '@douyinfe/semi-foundation/lib/es/timePicker/ComboxFoundation';
|
|
5
5
|
import { TimePickerProps } from './TimePicker';
|
|
6
6
|
import { Locale } from '../locale/interface';
|
|
7
7
|
export declare type ComboboxProps = Pick<TimePickerProps, 'format' | 'prefixCls' | 'disabledHours' | 'disabledMinutes' | 'disabledSeconds' | 'hideDisabledOptions' | 'use12Hours' | 'scrollItemProps' | 'panelFooter' | 'panelHeader'> & BaseProps & {
|
|
@@ -26,11 +26,6 @@ export interface ComboboxState {
|
|
|
26
26
|
minuteOptions: number[];
|
|
27
27
|
secondOptions: number[];
|
|
28
28
|
}
|
|
29
|
-
export declare type FormatOptionReturn = ReturnType<typeof formatOption>;
|
|
30
|
-
export interface AMPMOptionItem {
|
|
31
|
-
value: string;
|
|
32
|
-
text: string;
|
|
33
|
-
}
|
|
34
29
|
declare class Combobox extends BaseComponent<ComboboxProps, ComboboxState> {
|
|
35
30
|
static propTypes: {
|
|
36
31
|
format: PropTypes.Requireable<string>;
|
|
@@ -61,12 +56,11 @@ declare class Combobox extends BaseComponent<ComboboxProps, ComboboxState> {
|
|
|
61
56
|
componentDidUpdate(prevProps: ComboboxProps, prevState: ComboboxState): void;
|
|
62
57
|
componentWillUnmount(): void;
|
|
63
58
|
componentDidMount(): void;
|
|
64
|
-
cacheRefCurrent: (key: string, current: ScrollItem
|
|
59
|
+
cacheRefCurrent: (key: string, current: ScrollItem) => void;
|
|
65
60
|
reselect: () => void;
|
|
66
|
-
onItemChange: ({ type, value
|
|
67
|
-
type
|
|
61
|
+
onItemChange: ({ type, value }: {
|
|
62
|
+
type: string;
|
|
68
63
|
value: string;
|
|
69
|
-
disabled?: boolean;
|
|
70
64
|
}) => void;
|
|
71
65
|
onEnterSelectPanel: (range: string) => void;
|
|
72
66
|
renderHourSelect(hour: number, locale: Locale['TimePicker']): JSX.Element;
|
|
@@ -49,7 +49,7 @@ export declare type TimePickerProps = {
|
|
|
49
49
|
position?: Position;
|
|
50
50
|
prefixCls?: string;
|
|
51
51
|
rangeSeparator?: string;
|
|
52
|
-
scrollItemProps?: ScrollItemProps
|
|
52
|
+
scrollItemProps?: ScrollItemProps;
|
|
53
53
|
secondStep?: number;
|
|
54
54
|
showClear?: boolean;
|
|
55
55
|
size?: InputSize;
|
|
@@ -952,8 +952,7 @@ class TreeSelect extends BaseComponent {
|
|
|
952
952
|
registerClickOutsideHandler: cb => {
|
|
953
953
|
const clickOutsideHandler = e => {
|
|
954
954
|
const optionInstance = this.optionsRef && this.optionsRef.current;
|
|
955
|
-
const triggerDom = this.triggerRef && this.triggerRef.current;
|
|
956
|
-
|
|
955
|
+
const triggerDom = this.triggerRef && this.triggerRef.current;
|
|
957
956
|
const optionsDom = ReactDOM.findDOMNode(optionInstance);
|
|
958
957
|
const target = e.target;
|
|
959
958
|
|
|
@@ -63,7 +63,7 @@ export default class Base extends Component<BaseTypographyProps, BaseTypographyS
|
|
|
63
63
|
link: PropTypes.Requireable<boolean | object>;
|
|
64
64
|
spacing: PropTypes.Requireable<"normal" | "extended">;
|
|
65
65
|
strong: PropTypes.Requireable<boolean>;
|
|
66
|
-
size: PropTypes.Requireable<"
|
|
66
|
+
size: PropTypes.Requireable<"normal" | "small">;
|
|
67
67
|
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
68
68
|
style: PropTypes.Requireable<object>;
|
|
69
69
|
className: PropTypes.Requireable<string>;
|
|
@@ -30,7 +30,7 @@ export default class Paragraph extends PureComponent<ParagraphProps> {
|
|
|
30
30
|
underline: PropTypes.Requireable<boolean>;
|
|
31
31
|
strong: PropTypes.Requireable<boolean>;
|
|
32
32
|
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
33
|
-
size: PropTypes.Requireable<"
|
|
33
|
+
size: PropTypes.Requireable<"normal" | "small">;
|
|
34
34
|
spacing: PropTypes.Requireable<"normal" | "extended">;
|
|
35
35
|
style: PropTypes.Requireable<object>;
|
|
36
36
|
className: PropTypes.Requireable<string>;
|
|
@@ -33,7 +33,7 @@ export default class Text extends PureComponent<TextProps> {
|
|
|
33
33
|
link: PropTypes.Requireable<boolean | object>;
|
|
34
34
|
strong: PropTypes.Requireable<boolean>;
|
|
35
35
|
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
36
|
-
size: PropTypes.Requireable<"
|
|
36
|
+
size: PropTypes.Requireable<"normal" | "small">;
|
|
37
37
|
style: PropTypes.Requireable<object>;
|
|
38
38
|
className: PropTypes.Requireable<string>;
|
|
39
39
|
code: PropTypes.Requireable<boolean>;
|
|
@@ -1,10 +1,25 @@
|
|
|
1
|
-
import { PureComponent, ReactNode, MouseEvent, CSSProperties } from 'react';
|
|
1
|
+
import { PureComponent, ReactNode, MouseEventHandler, MouseEvent, CSSProperties } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { Locale } from '../locale/interface';
|
|
4
|
-
|
|
5
|
-
export interface FileCardProps extends RenderFileItemProps {
|
|
4
|
+
export interface FileCardProps {
|
|
6
5
|
className?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
listType?: 'picture' | 'list';
|
|
8
|
+
name?: string;
|
|
9
|
+
onPreviewClick?: MouseEventHandler<HTMLDivElement>;
|
|
10
|
+
onRemove?: (props: FileCardProps, e: MouseEvent) => void;
|
|
11
|
+
onReplace?: (props: FileCardProps, e: MouseEvent) => void;
|
|
12
|
+
onRetry?: (props: FileCardProps, e: MouseEvent) => void;
|
|
13
|
+
percent?: number;
|
|
14
|
+
preview?: boolean;
|
|
15
|
+
previewFile?: (props: FileCardProps) => ReactNode;
|
|
16
|
+
showReplace?: boolean;
|
|
17
|
+
showRetry?: boolean;
|
|
18
|
+
size?: string;
|
|
19
|
+
status?: string;
|
|
7
20
|
style?: CSSProperties;
|
|
21
|
+
url?: string;
|
|
22
|
+
validateMessage?: ReactNode;
|
|
8
23
|
}
|
|
9
24
|
declare class FileCard extends PureComponent<FileCardProps> {
|
|
10
25
|
static propTypes: {
|
package/lib/es/upload/index.d.ts
CHANGED
|
@@ -1,12 +1,65 @@
|
|
|
1
1
|
import { ReactNode, CSSProperties, RefObject, ChangeEvent, DragEvent } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import UploadFoundation, { UploadAdapter, BeforeUploadObjectResult, AfterUploadResult } from '@douyinfe/semi-foundation/lib/es/upload/foundation';
|
|
3
|
+
import UploadFoundation, { BaseFileItem, UploadAdapter, BeforeUploadObjectResult, AfterUploadResult } from '@douyinfe/semi-foundation/lib/es/upload/foundation';
|
|
4
|
+
import { strings } from '@douyinfe/semi-foundation/lib/es/upload/constants';
|
|
4
5
|
import FileCard from './fileCard';
|
|
5
6
|
import BaseComponent, { ValidateStatus } from '../_base/baseComponent';
|
|
6
|
-
import {
|
|
7
|
+
import { ArrayElement } from '../_base/base';
|
|
7
8
|
import { Locale } from '../locale/interface';
|
|
8
9
|
import '@douyinfe/semi-foundation/lib/es/upload/upload.css';
|
|
9
|
-
export {
|
|
10
|
+
export { BeforeUploadObjectResult, AfterUploadResult };
|
|
11
|
+
export interface FileItem extends BaseFileItem {
|
|
12
|
+
validateMessage?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export declare type UploadListType = ArrayElement<typeof strings.LIST_TYPE>;
|
|
15
|
+
export declare type PromptPositionType = ArrayElement<typeof strings.PROMPT_POSITION>;
|
|
16
|
+
export interface RenderFileItemProps extends FileItem {
|
|
17
|
+
previewFile: (fileItem: FileItem) => ReactNode;
|
|
18
|
+
listType: UploadListType;
|
|
19
|
+
onRemove: () => void;
|
|
20
|
+
onRetry: () => void;
|
|
21
|
+
onReplace: () => void;
|
|
22
|
+
key: string;
|
|
23
|
+
showRetry: boolean;
|
|
24
|
+
showReplace: boolean;
|
|
25
|
+
style: CSSProperties;
|
|
26
|
+
disabled: boolean;
|
|
27
|
+
onPreviewClick: () => void;
|
|
28
|
+
}
|
|
29
|
+
export interface BeforeUploadProps {
|
|
30
|
+
file: FileItem;
|
|
31
|
+
fileList: Array<FileItem>;
|
|
32
|
+
}
|
|
33
|
+
export interface AfterUploadProps {
|
|
34
|
+
file: FileItem;
|
|
35
|
+
fileList: Array<FileItem>;
|
|
36
|
+
response: any;
|
|
37
|
+
}
|
|
38
|
+
export interface OnChangeProps {
|
|
39
|
+
fileList: Array<FileItem>;
|
|
40
|
+
currentFile: FileItem;
|
|
41
|
+
}
|
|
42
|
+
export interface customRequestArgs {
|
|
43
|
+
fileName: string;
|
|
44
|
+
data: Record<string, any>;
|
|
45
|
+
file: FileItem;
|
|
46
|
+
fileInstance: File;
|
|
47
|
+
onProgress: (event: {
|
|
48
|
+
total: number;
|
|
49
|
+
loaded: number;
|
|
50
|
+
}) => any;
|
|
51
|
+
onError: (userXhr: {
|
|
52
|
+
status?: number;
|
|
53
|
+
}, e: Event) => any;
|
|
54
|
+
onSuccess: (response: any, e: Event) => any;
|
|
55
|
+
withCredentials: boolean;
|
|
56
|
+
action: string;
|
|
57
|
+
}
|
|
58
|
+
export interface CustomError extends Error {
|
|
59
|
+
status: number;
|
|
60
|
+
method: string;
|
|
61
|
+
url: string;
|
|
62
|
+
}
|
|
10
63
|
export interface UploadProps {
|
|
11
64
|
accept?: string;
|
|
12
65
|
action: string;
|
|
@@ -50,7 +103,7 @@ export interface UploadProps {
|
|
|
50
103
|
onRetry?: (fileItem: FileItem) => void;
|
|
51
104
|
onSizeError?: (file: File, fileList: Array<FileItem>) => void;
|
|
52
105
|
onSuccess?: (responseBody: any, file: File, fileList: Array<FileItem>) => void;
|
|
53
|
-
previewFile?: (
|
|
106
|
+
previewFile?: (fileItem: FileItem) => ReactNode;
|
|
54
107
|
prompt?: ReactNode;
|
|
55
108
|
promptPosition?: PromptPositionType;
|
|
56
109
|
renderFileItem?: (renderFileItemProps: RenderFileItemProps) => ReactNode;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0-beta.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/es/index.js",
|
|
6
6
|
"module": "lib/es/index.js",
|
|
@@ -19,12 +19,11 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@babel/runtime-corejs3": "^7.15.4",
|
|
22
|
-
"@douyinfe/semi-animation-react": "2.0.
|
|
23
|
-
"@douyinfe/semi-foundation": "2.0
|
|
24
|
-
"@douyinfe/semi-icons": "2.0
|
|
25
|
-
"@douyinfe/semi-illustrations": "2.0
|
|
26
|
-
"@douyinfe/semi-theme-default": "2.0.
|
|
27
|
-
"@types/react-window": "^1.8.2",
|
|
22
|
+
"@douyinfe/semi-animation-react": "2.1.0-beta.2",
|
|
23
|
+
"@douyinfe/semi-foundation": "2.1.0-beta.2",
|
|
24
|
+
"@douyinfe/semi-icons": "2.1.0-beta.2",
|
|
25
|
+
"@douyinfe/semi-illustrations": "2.1.0-beta.2",
|
|
26
|
+
"@douyinfe/semi-theme-default": "2.1.0-beta.2",
|
|
28
27
|
"async-validator": "^3.5.0",
|
|
29
28
|
"classnames": "^2.2.6",
|
|
30
29
|
"copy-text-to-clipboard": "^2.1.1",
|
|
@@ -65,13 +64,13 @@
|
|
|
65
64
|
],
|
|
66
65
|
"author": "",
|
|
67
66
|
"license": "MIT",
|
|
68
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "513b92cb3746033d0b7326485e85c73d80340a0d",
|
|
69
68
|
"devDependencies": {
|
|
70
69
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
71
70
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
|
72
71
|
"@babel/preset-env": "^7.15.8",
|
|
73
72
|
"@babel/preset-react": "^7.14.5",
|
|
74
|
-
"@douyinfe/semi-scss-compile": "2.0.
|
|
73
|
+
"@douyinfe/semi-scss-compile": "2.1.0-beta.2",
|
|
75
74
|
"@storybook/addon-knobs": "^6.3.1",
|
|
76
75
|
"babel-loader": "^8.2.2",
|
|
77
76
|
"case-sensitive-paths-webpack-plugin": "^2.4.0",
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { ReactNode, CSSProperties, MouseEvent } from 'react';
|
|
2
|
-
import { BaseFileItem } from '@douyinfe/semi-foundation/lib/es/upload/foundation';
|
|
3
|
-
import { strings } from '@douyinfe/semi-foundation/lib/es/upload/constants';
|
|
4
|
-
import { ArrayElement } from '../_base/base';
|
|
5
|
-
export declare type PromptPositionType = ArrayElement<typeof strings.PROMPT_POSITION>;
|
|
6
|
-
export declare type UploadListType = ArrayElement<typeof strings.LIST_TYPE>;
|
|
7
|
-
export interface BeforeUploadProps {
|
|
8
|
-
file: FileItem;
|
|
9
|
-
fileList: Array<FileItem>;
|
|
10
|
-
}
|
|
11
|
-
export interface AfterUploadProps {
|
|
12
|
-
file: FileItem;
|
|
13
|
-
fileList: Array<FileItem>;
|
|
14
|
-
response: any;
|
|
15
|
-
}
|
|
16
|
-
export interface OnChangeProps {
|
|
17
|
-
fileList: Array<FileItem>;
|
|
18
|
-
currentFile: FileItem;
|
|
19
|
-
}
|
|
20
|
-
export interface customRequestArgs {
|
|
21
|
-
fileName: string;
|
|
22
|
-
data: Record<string, any>;
|
|
23
|
-
file: FileItem;
|
|
24
|
-
fileInstance: File;
|
|
25
|
-
onProgress: (event: {
|
|
26
|
-
total: number;
|
|
27
|
-
loaded: number;
|
|
28
|
-
}) => any;
|
|
29
|
-
onError: (userXhr: {
|
|
30
|
-
status?: number;
|
|
31
|
-
}, e: Event) => any;
|
|
32
|
-
onSuccess: (response: any, e: Event) => any;
|
|
33
|
-
withCredentials: boolean;
|
|
34
|
-
action: string;
|
|
35
|
-
}
|
|
36
|
-
export interface CustomError extends Error {
|
|
37
|
-
status: number;
|
|
38
|
-
method: string;
|
|
39
|
-
url: string;
|
|
40
|
-
}
|
|
41
|
-
export interface FileItem extends BaseFileItem {
|
|
42
|
-
validateMessage?: ReactNode;
|
|
43
|
-
}
|
|
44
|
-
export interface RenderFileItemProps extends FileItem {
|
|
45
|
-
previewFile?: (fileItem: RenderFileItemProps) => ReactNode;
|
|
46
|
-
listType: UploadListType;
|
|
47
|
-
onRemove: (props: RenderFileItemProps, e: MouseEvent) => void;
|
|
48
|
-
onRetry: (props: RenderFileItemProps, e: MouseEvent) => void;
|
|
49
|
-
onReplace: (props: RenderFileItemProps, e: MouseEvent) => void;
|
|
50
|
-
key: string;
|
|
51
|
-
showRetry: boolean;
|
|
52
|
-
showReplace: boolean;
|
|
53
|
-
style?: CSSProperties;
|
|
54
|
-
disabled: boolean;
|
|
55
|
-
onPreviewClick: () => void;
|
|
56
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|