@douyinfe/semi-ui 2.0.9-alpha.0 → 2.0.9-alpha.5
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 +641 -579
- 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 +36 -11
- 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 +1 -5
- package/lib/es/datePicker/yearAndMonth.d.ts +2 -2
- package/lib/es/form/baseForm.d.ts +5 -11
- package/lib/es/form/baseForm.js +1 -2
- package/lib/es/form/field.d.ts +5 -23
- package/lib/es/form/field.js +2 -18
- package/lib/es/form/hoc/withField.d.ts +1 -1
- package/lib/es/form/hoc/withField.js +0 -3
- package/lib/es/locale/localeConsumer.d.ts +5 -5
- package/lib/es/modal/useModal/HookModal.d.ts +3 -2
- package/lib/es/modal/useModal/index.js +1 -1
- package/lib/es/navigation/index.d.ts +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 +1 -0
- package/lib/es/scrollList/scrollItem.d.ts +12 -11
- 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 +2 -4
- 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 +10 -4
- package/lib/es/timePicker/Combobox.js +2 -1
- package/lib/es/timePicker/TimePicker.d.ts +1 -1
- package/lib/es/toast/index.d.ts +1 -1
- package/lib/es/treeSelect/index.js +2 -1
- 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 +3 -18
- package/lib/es/upload/index.d.ts +4 -57
- package/lib/es/upload/interface.d.ts +56 -0
- package/lib/es/upload/interface.js +1 -0
- package/package.json +5 -4
|
@@ -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 } from 'react';
|
|
5
|
+
import React, { cloneElement, Children, useMemo, isValidElement } 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 => /*#__PURE__*/isValidElement(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, onChange]);
|
|
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 } from 'react';
|
|
5
|
+
import React, { cloneElement, Children, useMemo, isValidElement } 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 => /*#__PURE__*/isValidElement(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: any[]) => 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 } from 'react';
|
|
22
|
+
import React, { createRef, isValidElement } 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 (pane && pane.type && pane.type.isTabPane) {
|
|
82
|
+
if ( /*#__PURE__*/isValidElement(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 => child.props);
|
|
158
|
+
const list = tabList ? tabList : _mapInstanceProperty(_context3 = React.Children.toArray(children)).call(_context3, child => /*#__PURE__*/isValidElement(child) ? child.props : null);
|
|
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(child.props, panePickKeys));
|
|
185
|
+
const prevChildrenProps = _mapInstanceProperty(_context4 = React.Children.toArray(prevProps.children)).call(_context4, child => pick( /*#__PURE__*/isValidElement(child) ? child.props : null, panePickKeys));
|
|
186
186
|
|
|
187
|
-
const nowChildrenProps = _mapInstanceProperty(_context5 = React.Children.toArray(this.props.children)).call(_context5, child => pick(child.props, panePickKeys));
|
|
187
|
+
const nowChildrenProps = _mapInstanceProperty(_context5 = React.Children.toArray(this.props.children)).call(_context5, child => pick( /*#__PURE__*/isValidElement(child) ? child.props : null, 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 from '@douyinfe/semi-foundation/lib/es/timePicker/ComboxFoundation';
|
|
4
|
+
import ComboboxFoundation, { formatOption } 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,6 +26,11 @@ 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
|
+
}
|
|
29
34
|
declare class Combobox extends BaseComponent<ComboboxProps, ComboboxState> {
|
|
30
35
|
static propTypes: {
|
|
31
36
|
format: PropTypes.Requireable<string>;
|
|
@@ -56,11 +61,12 @@ declare class Combobox extends BaseComponent<ComboboxProps, ComboboxState> {
|
|
|
56
61
|
componentDidUpdate(prevProps: ComboboxProps, prevState: ComboboxState): void;
|
|
57
62
|
componentWillUnmount(): void;
|
|
58
63
|
componentDidMount(): void;
|
|
59
|
-
cacheRefCurrent: (key: string, current: ScrollItem) => void;
|
|
64
|
+
cacheRefCurrent: (key: string, current: ScrollItem<FormatOptionReturn> | ScrollItem<AMPMOptionItem>) => void;
|
|
60
65
|
reselect: () => void;
|
|
61
|
-
onItemChange: ({ type, value }: {
|
|
62
|
-
type
|
|
66
|
+
onItemChange: ({ type, value, disabled }: {
|
|
67
|
+
type?: string;
|
|
63
68
|
value: string;
|
|
69
|
+
disabled?: boolean;
|
|
64
70
|
}) => void;
|
|
65
71
|
onEnterSelectPanel: (range: string) => void;
|
|
66
72
|
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<any>;
|
|
53
53
|
secondStep?: number;
|
|
54
54
|
showClear?: boolean;
|
|
55
55
|
size?: InputSize;
|
package/lib/es/toast/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { ToastListAdapter, ToastListProps, ToastListState } from '@douyinfe/semi
|
|
|
4
4
|
import '@douyinfe/semi-foundation/lib/es/toast/toast.css';
|
|
5
5
|
import useToast from './useToast';
|
|
6
6
|
import { ConfigProps, ToastInstance, ToastProps, ToastState } from '@douyinfe/semi-foundation/lib/es/toast/toastFoundation';
|
|
7
|
-
import { Motion } from '_base/base';
|
|
7
|
+
import { Motion } from '../_base/base';
|
|
8
8
|
export { ToastTransitionProps } from './ToastTransition';
|
|
9
9
|
export interface ToastReactProps extends ToastProps {
|
|
10
10
|
style?: CSSProperties;
|
|
@@ -952,7 +952,8 @@ 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;
|
|
955
|
+
const triggerDom = this.triggerRef && this.triggerRef.current; // eslint-disable-next-line
|
|
956
|
+
|
|
956
957
|
const optionsDom = ReactDOM.findDOMNode(optionInstance);
|
|
957
958
|
const target = e.target;
|
|
958
959
|
|
|
@@ -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<"small" | "normal">;
|
|
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<"small" | "normal">;
|
|
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<"small" | "normal">;
|
|
37
37
|
style: PropTypes.Requireable<object>;
|
|
38
38
|
className: PropTypes.Requireable<string>;
|
|
39
39
|
code: PropTypes.Requireable<boolean>;
|
|
@@ -1,25 +1,10 @@
|
|
|
1
|
-
import { PureComponent, ReactNode,
|
|
1
|
+
import { PureComponent, ReactNode, MouseEvent, CSSProperties } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { Locale } from '../locale/interface';
|
|
4
|
-
|
|
4
|
+
import { RenderFileItemProps } from './interface';
|
|
5
|
+
export interface FileCardProps extends RenderFileItemProps {
|
|
5
6
|
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;
|
|
20
7
|
style?: CSSProperties;
|
|
21
|
-
url?: string;
|
|
22
|
-
validateMessage?: ReactNode;
|
|
23
8
|
}
|
|
24
9
|
declare class FileCard extends PureComponent<FileCardProps> {
|
|
25
10
|
static propTypes: {
|
package/lib/es/upload/index.d.ts
CHANGED
|
@@ -1,65 +1,12 @@
|
|
|
1
1
|
import { ReactNode, CSSProperties, RefObject, ChangeEvent, DragEvent } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import UploadFoundation, {
|
|
4
|
-
import { strings } from '@douyinfe/semi-foundation/lib/es/upload/constants';
|
|
3
|
+
import UploadFoundation, { UploadAdapter, BeforeUploadObjectResult, AfterUploadResult } from '@douyinfe/semi-foundation/lib/es/upload/foundation';
|
|
5
4
|
import FileCard from './fileCard';
|
|
6
5
|
import BaseComponent, { ValidateStatus } from '../_base/baseComponent';
|
|
7
|
-
import {
|
|
6
|
+
import { FileItem, RenderFileItemProps, UploadListType, PromptPositionType, BeforeUploadProps, AfterUploadProps, OnChangeProps, customRequestArgs, CustomError } from './interface';
|
|
8
7
|
import { Locale } from '../locale/interface';
|
|
9
8
|
import '@douyinfe/semi-foundation/lib/es/upload/upload.css';
|
|
10
|
-
export {
|
|
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
|
-
}
|
|
9
|
+
export { FileItem, RenderFileItemProps, UploadListType, PromptPositionType, BeforeUploadProps, AfterUploadProps, OnChangeProps, customRequestArgs, CustomError };
|
|
63
10
|
export interface UploadProps {
|
|
64
11
|
accept?: string;
|
|
65
12
|
action: string;
|
|
@@ -103,7 +50,7 @@ export interface UploadProps {
|
|
|
103
50
|
onRetry?: (fileItem: FileItem) => void;
|
|
104
51
|
onSizeError?: (file: File, fileList: Array<FileItem>) => void;
|
|
105
52
|
onSuccess?: (responseBody: any, file: File, fileList: Array<FileItem>) => void;
|
|
106
|
-
previewFile?: (
|
|
53
|
+
previewFile?: (renderFileItemProps: RenderFileItemProps) => ReactNode;
|
|
107
54
|
prompt?: ReactNode;
|
|
108
55
|
promptPosition?: PromptPositionType;
|
|
109
56
|
renderFileItem?: (renderFileItemProps: RenderFileItemProps) => ReactNode;
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.0.9-alpha.
|
|
3
|
+
"version": "2.0.9-alpha.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/es/index.js",
|
|
6
6
|
"module": "lib/es/index.js",
|
|
@@ -20,10 +20,11 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@babel/runtime-corejs3": "^7.15.4",
|
|
22
22
|
"@douyinfe/semi-animation-react": "2.0.8",
|
|
23
|
-
"@douyinfe/semi-foundation": "2.0.9-alpha.
|
|
24
|
-
"@douyinfe/semi-icons": "2.0.9-alpha.
|
|
23
|
+
"@douyinfe/semi-foundation": "2.0.9-alpha.3",
|
|
24
|
+
"@douyinfe/semi-icons": "2.0.9-alpha.3",
|
|
25
25
|
"@douyinfe/semi-illustrations": "2.0.9-alpha.0",
|
|
26
26
|
"@douyinfe/semi-theme-default": "2.0.8",
|
|
27
|
+
"@types/react-window": "^1.8.2",
|
|
27
28
|
"async-validator": "^3.5.0",
|
|
28
29
|
"classnames": "^2.2.6",
|
|
29
30
|
"copy-text-to-clipboard": "^2.1.1",
|
|
@@ -64,7 +65,7 @@
|
|
|
64
65
|
],
|
|
65
66
|
"author": "",
|
|
66
67
|
"license": "MIT",
|
|
67
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "1d7254bf8e8b953d367d85cf54f198b18dfb5750",
|
|
68
69
|
"devDependencies": {
|
|
69
70
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
70
71
|
"@babel/plugin-transform-runtime": "^7.15.8",
|