@unicom-cloud/ui 0.8.91 → 0.8.93
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/Upload.js +4 -4
- package/color-picker/Mode.js +6 -7
- package/index.js +171 -171
- package/package.json +1 -1
- package/tree/Node.js +72 -72
- package/tree/Tree.js +332 -332
- package/types/common/empty/index.d.ts +1 -1
- package/types/common/icons/file/index.d.ts +1 -1
- package/types/common/space/index.d.ts +1 -1
- package/types/pc/anchor/context.d.ts +1 -1
- package/types/pc/color-picker/InputHex.d.ts +1 -1
- package/types/pc/color-picker/InputRgb.d.ts +1 -1
- package/types/pc/color-picker/Mode.d.ts +1 -1
- package/types/pc/color-picker/Palette.d.ts +1 -1
- package/types/pc/color-picker/utils.d.ts +1 -1
- package/types/pc/config-provider/context.d.ts +1 -1
- package/types/pc/date-picker/Picker.d.ts +1 -1
- package/types/pc/date-picker/RangePicker.d.ts +1 -1
- package/types/pc/grid/context.d.ts +1 -1
- package/types/pc/grid/util.d.ts +1 -1
- package/types/pc/hooks/use-watermark/index.d.ts +1 -1
- package/types/pc/icons/file/index.d.ts +1 -1
- package/types/pc/input/index.d.ts +1 -1
- package/types/pc/message/index.d.ts +1 -2
- package/types/pc/message/useMessage.d.ts +1 -1
- package/types/pc/notification/useNotification.d.ts +1 -1
- package/types/pc/space/index.d.ts +1 -1
- package/types/pc/table/ColGroup.d.ts +1 -1
- package/types/pc/table/constant.d.ts +1 -1
- package/types/pc/tree/Context.d.ts +1 -2
- package/types/pc/tree/index.d.ts +1 -1
- package/types/pc/tree/interface.d.ts +5 -1
- package/types/pc/trigger/getPopupStyle.d.ts +1 -1
- package/types/pc/typography/EditContent.d.ts +1 -1
- package/types/pc/typography/Ellipsis.d.ts +1 -1
- package/types/pc/typography/Paragraph.d.ts +1 -1
- package/types/pc/typography/Title.d.ts +1 -1
- package/types/pc/upload/Upload.d.ts +2 -2
- package/types/pc/upload/constant.d.ts +4 -0
- package/types/pc/upload/index.d.ts +2 -0
- package/types/pc/upload/interface.d.ts +0 -3
- package/types/pc/upload/request.d.ts +1 -1
- package/types/pc/upload/util.d.ts +1 -1
- package/types/pc/verification-code/VerificationCode.d.ts +1 -1
- package/types/pc/verification-code/index.d.ts +1 -1
- package/types/pc/watermark/Watermark.d.ts +1 -1
- package/types/pc/watermark/index.d.ts +1 -1
- package/upload/Upload.js +52 -53
- package/upload/Uploader.js +1 -1
- package/upload/constant.js +9 -0
- package/upload/index.js +4 -4
- package/upload/interface.js +1 -9
- package/upload/list/PictureItem.js +1 -1
- package/upload/list/TextItem.js +1 -1
- package/upload/list/UploadProgress.js +1 -1
- package/upload/list/index.js +1 -1
- package/version/index.js +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EmptyProps } from './interface';
|
|
1
|
+
import type { EmptyProps } from './interface';
|
|
2
2
|
declare const Empty: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<EmptyProps & import("react").RefAttributes<unknown>>>;
|
|
3
3
|
export default Empty;
|
|
4
4
|
export type { EmptyProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IconFileProps } from './interface';
|
|
1
|
+
import type { IconFileProps } from './interface';
|
|
2
2
|
declare const IconFile: import("react").ForwardRefExoticComponent<IconFileProps & import("react").RefAttributes<unknown>>;
|
|
3
3
|
export default IconFile;
|
|
4
4
|
export type { IconFileProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RefAttributes } from 'react';
|
|
2
2
|
import { JSX } from 'react/jsx-dev-runtime';
|
|
3
|
-
import { SpaceProps } from './interface';
|
|
3
|
+
import type { SpaceProps } from './interface';
|
|
4
4
|
declare const Space: import("react").ForwardRefExoticComponent<SpaceProps & RefAttributes<HTMLDivElement>>;
|
|
5
5
|
declare const SpaceVertical: import("react").ForwardRefExoticComponent<Omit<JSX.IntrinsicAttributes & SpaceProps & RefAttributes<HTMLDivElement>, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
6
6
|
export { SpaceVertical };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColorPickerMode, GradientColor } from './interface';
|
|
1
|
+
import type { ColorPickerMode, GradientColor } from './interface';
|
|
2
2
|
export declare const getMode: (mode: ColorPickerMode | ColorPickerMode[]) => ColorPickerMode | ColorPickerMode[];
|
|
3
3
|
export declare const isSingleMode: (mode: ColorPickerMode | ColorPickerMode[]) => mode is ColorPickerMode.Single;
|
|
4
4
|
export declare const isGradientMode: (mode: ColorPickerMode | ColorPickerMode[]) => mode is ColorPickerMode.Gradient;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfigProviderProps } from './interface';
|
|
1
|
+
import type { ConfigProviderProps } from './interface';
|
|
2
2
|
export declare const ConfigProviderDefaultProps: ConfigProviderProps;
|
|
3
3
|
declare const ConfigContext: import("react").Context<ConfigProviderProps>;
|
|
4
4
|
export default ConfigContext;
|
|
@@ -2,7 +2,7 @@ import { Dayjs } from 'dayjs';
|
|
|
2
2
|
import React, { ReactElement } from 'react';
|
|
3
3
|
import { TimePickerProps } from '../time-picker/interface';
|
|
4
4
|
import type { CalendarValue, ModeType, PickerProps } from './interface';
|
|
5
|
-
import { DatePickerHandle } from './interface';
|
|
5
|
+
import type { DatePickerHandle } from './interface';
|
|
6
6
|
interface InnerPickerProps extends PickerProps {
|
|
7
7
|
disabledDate?: (current: Dayjs) => boolean;
|
|
8
8
|
picker?: ReactElement;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { RangePickerHandle } from './interface';
|
|
1
|
+
import type { RangePickerHandle } from './interface';
|
|
2
2
|
declare const PickerComponent: import("react").ForwardRefExoticComponent<import("./interface").BaseRangePickerProps & import("components/common/utils").Omit<import("./interface").PickerProps, "onChange" | "onSelect" | "onOk" | "inputProps" | "defaultPickerValue" | "pickerValue" | "onPickerValueChange"> & import("react").RefAttributes<RangePickerHandle>>;
|
|
3
3
|
export default PickerComponent;
|
package/types/pc/grid/util.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GridItemData } from './interface';
|
|
1
|
+
import type { GridItemData } from './interface';
|
|
2
2
|
export declare function resolveItemData(cols: number, { span, offset, suffix }: GridItemData): GridItemData;
|
|
3
3
|
export declare function setItemVisible({ cols, collapsed, collapsedRows, itemDataList, }: {
|
|
4
4
|
cols: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IconFileProps } from './interface';
|
|
1
|
+
import type { IconFileProps } from './interface';
|
|
2
2
|
declare const IconFile: import("react").ForwardRefExoticComponent<IconFileProps & import("react").RefAttributes<unknown>>;
|
|
3
3
|
export default IconFile;
|
|
4
4
|
export type { IconFileProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Input from './Input';
|
|
2
|
-
import { InputProps, RefInputType, TextAreaProps } from './interface';
|
|
2
|
+
import type { InputProps, RefInputType, TextAreaProps } from './interface';
|
|
3
3
|
import { InputPasswordProps } from './Password';
|
|
4
4
|
import { InputSearchProps } from './Search';
|
|
5
5
|
import { RefTextAreaType } from './Textarea';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { JSX } from 'react/jsx-runtime';
|
|
2
|
-
import type { MessageProps } from './interface';
|
|
3
|
-
import { MessageHookReturnType } from './interface';
|
|
2
|
+
import type { MessageHookReturnType, MessageProps } from './interface';
|
|
4
3
|
import useMessage from './useMessage';
|
|
5
4
|
export declare const messageTypes: string[];
|
|
6
5
|
export type ConfigProps = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JSX } from 'react/jsx-runtime';
|
|
2
2
|
import { ConfigProps } from '.';
|
|
3
|
-
import { MessageHookReturnType } from './interface';
|
|
3
|
+
import type { MessageHookReturnType } from './interface';
|
|
4
4
|
export type messageFuncType = MessageHookReturnType;
|
|
5
5
|
declare function useMessage(commonConfig?: ConfigProps): [MessageHookReturnType, JSX.Element];
|
|
6
6
|
export default useMessage;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JSX } from 'react/jsx-runtime';
|
|
2
2
|
import { ConfigProps } from '.';
|
|
3
|
-
import { NotificationHookReturnType } from './interface';
|
|
3
|
+
import type { NotificationHookReturnType } from './interface';
|
|
4
4
|
export type notificationFuncType = NotificationHookReturnType;
|
|
5
5
|
declare function useNotification(commonConfig?: ConfigProps): [NotificationHookReturnType, JSX.Element];
|
|
6
6
|
export default useNotification;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SpaceVertical as SpaceVerticalCommon } from '../../common/space';
|
|
2
|
-
import { SpaceProps } from './interface';
|
|
2
|
+
import type { SpaceProps } from './interface';
|
|
3
3
|
declare const Space: import("react").ForwardRefExoticComponent<SpaceProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
4
|
export { SpaceVerticalCommon as SpaceVertical };
|
|
5
5
|
export default Space;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentProps } from './interface';
|
|
1
|
+
import type { ComponentProps } from './interface';
|
|
2
2
|
export declare const INTERNAL_SELECTION_KEY = "table_internal_selection_key";
|
|
3
3
|
export declare const INTERNAL_EXPAND_KEY = "table_internal_expand_key";
|
|
4
4
|
export declare const defaultComponent: ComponentProps;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DragEvent } from 'react';
|
|
2
2
|
import { AvailableVirtualListProps } from '../virtual-list';
|
|
3
|
-
import { NodeProps, TreeDataType, TreeProps, TreeState } from './interface';
|
|
3
|
+
import type { NodeProps, TreeDataType, TreeProps, TreeState } from './interface';
|
|
4
4
|
export declare const TreeContext: import("react").Context<{
|
|
5
5
|
icons?: NodeProps["icons"];
|
|
6
6
|
loadMore?: (node: NodeProps) => void;
|
|
@@ -25,5 +25,4 @@ export declare const TreeContext: import("react").Context<{
|
|
|
25
25
|
onNodeDragLeave?: (e: DragEvent<HTMLSpanElement>, nodeProps: NodeProps) => void;
|
|
26
26
|
allowDrop?: (nodeProps: NodeProps, dragPosition: 0 | 1 | -1) => boolean;
|
|
27
27
|
getFieldInfo?: (nodeProps: NodeProps) => TreeDataType;
|
|
28
|
-
onNodeClick?: (key: string, data: unknown, extra: unknown) => void;
|
|
29
28
|
}>;
|
package/types/pc/tree/index.d.ts
CHANGED
|
@@ -221,7 +221,7 @@ export interface TreeProps {
|
|
|
221
221
|
/**
|
|
222
222
|
* @zh 点击树节点的回调
|
|
223
223
|
*/
|
|
224
|
-
|
|
224
|
+
onNodeSelect?: (key: string, data: unknown, extra: unknown) => void;
|
|
225
225
|
/**
|
|
226
226
|
* @zh 点击树节点复选框的回调
|
|
227
227
|
* @en Callback when checked node
|
|
@@ -234,6 +234,10 @@ export interface TreeProps {
|
|
|
234
234
|
halfCheckedNodes: NodeInstance[];
|
|
235
235
|
e: Event;
|
|
236
236
|
}) => void;
|
|
237
|
+
/**
|
|
238
|
+
* @zh 点击树节点复选框的回调
|
|
239
|
+
*/
|
|
240
|
+
onNodeCheck?: (key: string, data: unknown, extra: unknown) => void;
|
|
237
241
|
/**
|
|
238
242
|
* @zh 点击展开/关闭的回调
|
|
239
243
|
* @en Callback when expanded or collapsed node
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
|
-
import { MouseLocationType, TriggerProps } from './interface';
|
|
2
|
+
import type { MouseLocationType, TriggerProps } from './interface';
|
|
3
3
|
export declare const getBoundingClientRect: (dom: any, options: {
|
|
4
4
|
boundaryDistance?: TriggerProps["boundaryDistance"];
|
|
5
5
|
position: TriggerProps["position"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TypographyEllipsisProps } from './interface';
|
|
2
|
+
import type { TypographyEllipsisProps } from './interface';
|
|
3
3
|
declare const Ellipsis: React.ForwardRefExoticComponent<TypographyEllipsisProps & {
|
|
4
4
|
children?: React.ReactNode | undefined;
|
|
5
5
|
} & React.RefAttributes<unknown>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { TypographyParagraphProps } from './interface';
|
|
1
|
+
import type { TypographyParagraphProps } from './interface';
|
|
2
2
|
declare const Paragraph: import("react").ForwardRefExoticComponent<TypographyParagraphProps & import("react").RefAttributes<unknown>>;
|
|
3
3
|
export default Paragraph;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import type { UploadInstance, UploadItem, UploadProps } from './interface';
|
|
3
3
|
import UploadList from './list';
|
|
4
4
|
export type UploadState = {
|
|
5
5
|
uploadState: {
|
|
@@ -9,6 +9,6 @@ export type UploadState = {
|
|
|
9
9
|
declare const UploadRef: React.ForwardRefExoticComponent<UploadProps & {
|
|
10
10
|
children?: React.ReactNode | undefined;
|
|
11
11
|
} & React.RefAttributes<UploadInstance>>;
|
|
12
|
-
export {
|
|
12
|
+
export { UploadList };
|
|
13
13
|
export default UploadRef;
|
|
14
14
|
export { UploadItem, UploadProps };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import Upload from './Upload';
|
|
2
|
+
import { STATUS } from './constant';
|
|
2
3
|
export * from './Upload';
|
|
4
|
+
export { STATUS as UPLOAD_STATUS };
|
|
3
5
|
export default Upload;
|
|
4
6
|
export type { RequestOptions, UploadInstance, UploadItem, UploadListProps, UploadProps, UploadRequestReturn, UploadStatus, } from './interface';
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import React, { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { ProgressProps } from '../progress';
|
|
3
|
-
export declare const STATUS: {
|
|
4
|
-
[key: string]: UploadStatus;
|
|
5
|
-
};
|
|
6
3
|
export type UploadStatus = 'init' | 'uploading' | 'done' | 'error';
|
|
7
4
|
export type ListType = 'text' | 'picture-list' | 'picture-card';
|
|
8
5
|
export type CustomIconType = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UploadProps } from './interface';
|
|
1
|
+
import type { UploadProps } from './interface';
|
|
2
2
|
export declare const isAcceptFile: (file: File, propsAccept?: UploadProps["accept"]) => boolean;
|
|
3
3
|
export declare const getFiles: (fileList: any, accept: any) => never[] | undefined;
|
|
4
4
|
export declare const loopDirectory: (items: DataTransferItemList, accept: any, callback: any) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { VerificationCodeProps } from './interface';
|
|
2
|
+
import type { VerificationCodeProps } from './interface';
|
|
3
3
|
export declare function VerificationCodeComponent(baseProps: VerificationCodeProps, _: any): import("react/jsx-dev-runtime").JSX.Element;
|
|
4
4
|
export declare namespace VerificationCodeComponent {
|
|
5
5
|
var displayName: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WatermarkProps } from './interface';
|
|
1
|
+
import type { WatermarkProps } from './interface';
|
|
2
2
|
export declare function WatermarkComponent(baseProps: WatermarkProps, _: any): import("react/jsx-dev-runtime").JSX.Element | null;
|
|
3
3
|
declare const Watermark: import("react").ForwardRefExoticComponent<WatermarkProps & import("react").RefAttributes<unknown>>;
|
|
4
4
|
export default Watermark;
|
package/upload/Upload.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { jsx as m, jsxs as M, Fragment as B } from "react/jsx-runtime";
|
|
2
2
|
import H from "lodash/isFunction";
|
|
3
3
|
import W from "lodash/isNumber";
|
|
4
|
-
import { forwardRef as
|
|
4
|
+
import { forwardRef as k, useContext as z, useRef as N, useState as G, useImperativeHandle as J } from "react";
|
|
5
5
|
import "../config-provider/ConfigProvider.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { omit as
|
|
9
|
-
import { warning as
|
|
10
|
-
import { STATUS as g } from "./
|
|
11
|
-
import { FileList as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
const
|
|
6
|
+
import K from "../components/common/hooks/useMergeProps.js";
|
|
7
|
+
import Q from "@unicom-cloud/utils/class-name";
|
|
8
|
+
import { omit as V } from "../components/common/utils/omit.js";
|
|
9
|
+
import { warning as y } from "../components/common/utils/warning.js";
|
|
10
|
+
import { STATUS as g } from "./constant.js";
|
|
11
|
+
import { FileList as X } from "./list/index.js";
|
|
12
|
+
import Y from "./Uploader.js";
|
|
13
|
+
import Z from "../config-provider/context.js";
|
|
14
|
+
const U = function(f) {
|
|
15
15
|
const c = [].concat(f || []).filter(Boolean);
|
|
16
|
-
return c.reduce((a, n,
|
|
16
|
+
return c.reduce((a, n, h) => {
|
|
17
17
|
if (n.uid) {
|
|
18
18
|
const e = c.findIndex(
|
|
19
19
|
(s) => n.uid === s.uid && n !== s
|
|
20
20
|
);
|
|
21
|
-
|
|
21
|
+
y(e !== -1, "[Upload]: duplicate uid");
|
|
22
22
|
const r = {
|
|
23
23
|
status: g.success,
|
|
24
24
|
percent: 100,
|
|
@@ -26,8 +26,8 @@ const h = function(f) {
|
|
|
26
26
|
};
|
|
27
27
|
e === -1 ? a.push(r) : a.splice(e, 1, r);
|
|
28
28
|
} else {
|
|
29
|
-
|
|
30
|
-
const e = `${String(+/* @__PURE__ */ new Date())}${
|
|
29
|
+
y(!0, "[Upload]: uid is required");
|
|
30
|
+
const e = `${String(+/* @__PURE__ */ new Date())}${h}`;
|
|
31
31
|
a.push({
|
|
32
32
|
uid: e,
|
|
33
33
|
status: g.success,
|
|
@@ -37,18 +37,18 @@ const h = function(f) {
|
|
|
37
37
|
}
|
|
38
38
|
return a;
|
|
39
39
|
}, []);
|
|
40
|
-
},
|
|
40
|
+
}, _ = {
|
|
41
41
|
listType: "text",
|
|
42
42
|
autoUpload: !0,
|
|
43
43
|
showUploadList: !0,
|
|
44
44
|
beforeUpload: () => !0,
|
|
45
45
|
method: "post"
|
|
46
46
|
}, ee = (f, c) => {
|
|
47
|
-
const { getPrefixCls: a, componentConfig: n, rtl:
|
|
47
|
+
const { getPrefixCls: a, componentConfig: n, rtl: h } = z(Z), e = K(
|
|
48
48
|
f,
|
|
49
|
-
|
|
49
|
+
_,
|
|
50
50
|
n == null ? void 0 : n.Upload
|
|
51
|
-
), r = a == null ? void 0 : a("upload"), s =
|
|
51
|
+
), r = a == null ? void 0 : a("upload"), s = N(), x = N(), [D, b] = G(() => "fileList" in e ? U(e.fileList) : "defaultFileList" in e ? U(e.defaultFileList) : []), d = "fileList" in e ? U(e.fileList) : D, v = (t, i) => {
|
|
52
52
|
var o;
|
|
53
53
|
"fileList" in e || b(t), (o = e.onChange) == null || o.call(e, t, i);
|
|
54
54
|
}, F = (t) => {
|
|
@@ -58,7 +58,7 @@ const h = function(f) {
|
|
|
58
58
|
}, R = (t) => {
|
|
59
59
|
var i;
|
|
60
60
|
s.current && s.current.reupload(t), (i = e.onReupload) == null || i.call(e, t);
|
|
61
|
-
},
|
|
61
|
+
}, E = (t) => {
|
|
62
62
|
if (t) {
|
|
63
63
|
const { onRemove: i } = e;
|
|
64
64
|
Promise.resolve(
|
|
@@ -72,10 +72,10 @@ const h = function(f) {
|
|
|
72
72
|
console.error(o);
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
|
-
},
|
|
75
|
+
}, w = (t) => {
|
|
76
76
|
t && s.current && s.current.abort(t);
|
|
77
77
|
};
|
|
78
|
-
|
|
78
|
+
J(c, () => ({
|
|
79
79
|
submit: (t) => {
|
|
80
80
|
let i = [];
|
|
81
81
|
t ? i = [t] : i = d.filter((o) => o.status === g.init), i.forEach((o) => {
|
|
@@ -84,7 +84,7 @@ const h = function(f) {
|
|
|
84
84
|
},
|
|
85
85
|
// file: fileList中的file对象
|
|
86
86
|
abort: (t) => {
|
|
87
|
-
|
|
87
|
+
w(t);
|
|
88
88
|
},
|
|
89
89
|
// file: fileList中的file对象
|
|
90
90
|
reupload: (t) => {
|
|
@@ -94,18 +94,18 @@ const h = function(f) {
|
|
|
94
94
|
}));
|
|
95
95
|
const {
|
|
96
96
|
listType: l,
|
|
97
|
-
className:
|
|
98
|
-
style:
|
|
99
|
-
renderUploadItem:
|
|
100
|
-
showUploadList:
|
|
101
|
-
renderUploadList:
|
|
102
|
-
progressProps:
|
|
103
|
-
imagePreview:
|
|
104
|
-
...
|
|
105
|
-
} = e, u = W(e.limit) ? { hideOnExceedLimit: !0, maxCount: e.limit } : { hideOnExceedLimit: !0, ...e.limit },
|
|
97
|
+
className: O,
|
|
98
|
+
style: S,
|
|
99
|
+
renderUploadItem: I,
|
|
100
|
+
showUploadList: C,
|
|
101
|
+
renderUploadList: T,
|
|
102
|
+
progressProps: j,
|
|
103
|
+
imagePreview: q,
|
|
104
|
+
...A
|
|
105
|
+
} = e, u = W(e.limit) ? { hideOnExceedLimit: !0, maxCount: e.limit } : { hideOnExceedLimit: !0, ...e.limit }, L = u.maxCount && u.maxCount <= d.length, P = "disabled" in e ? e.disabled : !u.hideOnExceedLimit && L, $ = /* @__PURE__ */ m(
|
|
106
106
|
"div",
|
|
107
107
|
{
|
|
108
|
-
...
|
|
108
|
+
...V(A, [
|
|
109
109
|
"disabled",
|
|
110
110
|
"directory",
|
|
111
111
|
"onReupload",
|
|
@@ -137,27 +137,27 @@ const h = function(f) {
|
|
|
137
137
|
"onDragOver",
|
|
138
138
|
"onDragLeave"
|
|
139
139
|
]),
|
|
140
|
-
className:
|
|
140
|
+
className: Q(
|
|
141
141
|
r,
|
|
142
142
|
{
|
|
143
143
|
[`${r}-type-${l}`]: l,
|
|
144
144
|
[`${r}-drag`]: e.drag,
|
|
145
|
-
[`${r}-disabled`]:
|
|
146
|
-
[`${r}-hide`]: u.hideOnExceedLimit &&
|
|
147
|
-
[`${r}-rtl`]:
|
|
145
|
+
[`${r}-disabled`]: P,
|
|
146
|
+
[`${r}-hide`]: u.hideOnExceedLimit && L,
|
|
147
|
+
[`${r}-rtl`]: h
|
|
148
148
|
},
|
|
149
|
-
|
|
149
|
+
O
|
|
150
150
|
),
|
|
151
|
-
style:
|
|
151
|
+
style: S,
|
|
152
152
|
ref: x,
|
|
153
153
|
children: /* @__PURE__ */ m(
|
|
154
|
-
|
|
154
|
+
Y,
|
|
155
155
|
{
|
|
156
156
|
ref: s,
|
|
157
157
|
...e,
|
|
158
158
|
limit: u.maxCount,
|
|
159
|
-
hide: u.hideOnExceedLimit &&
|
|
160
|
-
disabled:
|
|
159
|
+
hide: u.hideOnExceedLimit && L,
|
|
160
|
+
disabled: P,
|
|
161
161
|
prefixCls: r,
|
|
162
162
|
fileList: d,
|
|
163
163
|
onProgress: (t, i) => {
|
|
@@ -173,20 +173,20 @@ const h = function(f) {
|
|
|
173
173
|
);
|
|
174
174
|
return /* @__PURE__ */ M(B, { children: [
|
|
175
175
|
l !== "picture-card" && $,
|
|
176
|
-
|
|
177
|
-
|
|
176
|
+
C && /* @__PURE__ */ m(
|
|
177
|
+
X,
|
|
178
178
|
{
|
|
179
|
-
imagePreview:
|
|
180
|
-
progressProps:
|
|
181
|
-
showUploadList:
|
|
179
|
+
imagePreview: q,
|
|
180
|
+
progressProps: j,
|
|
181
|
+
showUploadList: C,
|
|
182
182
|
disabled: e.disabled,
|
|
183
183
|
listType: l,
|
|
184
184
|
fileList: d,
|
|
185
|
-
renderUploadItem:
|
|
186
|
-
renderUploadList:
|
|
185
|
+
renderUploadItem: I,
|
|
186
|
+
renderUploadList: T,
|
|
187
187
|
onUpload: F,
|
|
188
|
-
onAbort:
|
|
189
|
-
onRemove:
|
|
188
|
+
onAbort: w,
|
|
189
|
+
onRemove: E,
|
|
190
190
|
onReupload: R,
|
|
191
191
|
onPreview: e.onPreview,
|
|
192
192
|
prefixCls: r
|
|
@@ -195,12 +195,11 @@ const h = function(f) {
|
|
|
195
195
|
l === "picture-card" && $,
|
|
196
196
|
e.tip && l === "picture-card" && /* @__PURE__ */ m("div", { className: `${r}-trigger-tip`, children: e.tip })
|
|
197
197
|
] });
|
|
198
|
-
}, te =
|
|
198
|
+
}, te = k(
|
|
199
199
|
ee
|
|
200
200
|
);
|
|
201
201
|
te.displayName = "Upload";
|
|
202
202
|
export {
|
|
203
|
-
|
|
204
|
-
V as UploadList,
|
|
203
|
+
X as UploadList,
|
|
205
204
|
te as default
|
|
206
205
|
};
|
package/upload/Uploader.js
CHANGED
|
@@ -6,7 +6,7 @@ import W from "lodash/isPlainObject";
|
|
|
6
6
|
import X, { useRef as Y, useState as Z, useImperativeHandle as _ } from "react";
|
|
7
7
|
import { PqbCSSTransition as tt } from "../components/common/utils/PqbCSSTransition.js";
|
|
8
8
|
import et from "./TriggerNode.js";
|
|
9
|
-
import { STATUS as c } from "./
|
|
9
|
+
import { STATUS as c } from "./constant.js";
|
|
10
10
|
import it from "./request.js";
|
|
11
11
|
import { isAcceptFile as nt } from "./util.js";
|
|
12
12
|
function ot(i, E) {
|
package/upload/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import r from "./Upload.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { STATUS as e } from "./constant.js";
|
|
3
|
+
import { FileList as f } from "./list/index.js";
|
|
4
4
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
e as UPLOAD_STATUS,
|
|
6
|
+
f as UploadList,
|
|
7
7
|
r as default
|
|
8
8
|
};
|
package/upload/interface.js
CHANGED
|
@@ -7,7 +7,7 @@ import { fileToURL as x } from "@unicom-cloud/utils/file";
|
|
|
7
7
|
import C from "lodash/isFunction";
|
|
8
8
|
import { forwardRef as N, useState as y, useEffect as I } from "react";
|
|
9
9
|
import E from "../../components/common/hooks/useKeyboardEvent.js";
|
|
10
|
-
import { STATUS as d } from "../
|
|
10
|
+
import { STATUS as d } from "../constant.js";
|
|
11
11
|
import "../../components/common/utils/is.js";
|
|
12
12
|
import F from "./UploadProgress.js";
|
|
13
13
|
import { isPlainObject as k } from "@unicom-cloud/utils/is";
|
package/upload/list/TextItem.js
CHANGED
|
@@ -12,7 +12,7 @@ import { forwardRef as P, useState as j, useEffect as U, isValidElement as w } f
|
|
|
12
12
|
import L from "../../components/common/hooks/useKeyboardEvent.js";
|
|
13
13
|
import k from "../../icon-hover/index.js";
|
|
14
14
|
import A from "../../tooltip/index.js";
|
|
15
|
-
import { STATUS as g } from "../
|
|
15
|
+
import { STATUS as g } from "../constant.js";
|
|
16
16
|
import "../../components/common/utils/is.js";
|
|
17
17
|
import S from "./UploadProgress.js";
|
|
18
18
|
import { isPlainObject as N } from "@unicom-cloud/utils/is";
|
|
@@ -9,7 +9,7 @@ import "../../config-provider/ConfigProvider.js";
|
|
|
9
9
|
import R from "../../components/common/hooks/useKeyboardEvent.js";
|
|
10
10
|
import v from "../../progress/index.js";
|
|
11
11
|
import g from "../../tooltip/index.js";
|
|
12
|
-
import { STATUS as o } from "../
|
|
12
|
+
import { STATUS as o } from "../constant.js";
|
|
13
13
|
import F from "../../config-provider/context.js";
|
|
14
14
|
const O = (n) => {
|
|
15
15
|
var f, I, U, h, b, x;
|