@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.
Files changed (57) hide show
  1. package/Upload.js +4 -4
  2. package/color-picker/Mode.js +6 -7
  3. package/index.js +171 -171
  4. package/package.json +1 -1
  5. package/tree/Node.js +72 -72
  6. package/tree/Tree.js +332 -332
  7. package/types/common/empty/index.d.ts +1 -1
  8. package/types/common/icons/file/index.d.ts +1 -1
  9. package/types/common/space/index.d.ts +1 -1
  10. package/types/pc/anchor/context.d.ts +1 -1
  11. package/types/pc/color-picker/InputHex.d.ts +1 -1
  12. package/types/pc/color-picker/InputRgb.d.ts +1 -1
  13. package/types/pc/color-picker/Mode.d.ts +1 -1
  14. package/types/pc/color-picker/Palette.d.ts +1 -1
  15. package/types/pc/color-picker/utils.d.ts +1 -1
  16. package/types/pc/config-provider/context.d.ts +1 -1
  17. package/types/pc/date-picker/Picker.d.ts +1 -1
  18. package/types/pc/date-picker/RangePicker.d.ts +1 -1
  19. package/types/pc/grid/context.d.ts +1 -1
  20. package/types/pc/grid/util.d.ts +1 -1
  21. package/types/pc/hooks/use-watermark/index.d.ts +1 -1
  22. package/types/pc/icons/file/index.d.ts +1 -1
  23. package/types/pc/input/index.d.ts +1 -1
  24. package/types/pc/message/index.d.ts +1 -2
  25. package/types/pc/message/useMessage.d.ts +1 -1
  26. package/types/pc/notification/useNotification.d.ts +1 -1
  27. package/types/pc/space/index.d.ts +1 -1
  28. package/types/pc/table/ColGroup.d.ts +1 -1
  29. package/types/pc/table/constant.d.ts +1 -1
  30. package/types/pc/tree/Context.d.ts +1 -2
  31. package/types/pc/tree/index.d.ts +1 -1
  32. package/types/pc/tree/interface.d.ts +5 -1
  33. package/types/pc/trigger/getPopupStyle.d.ts +1 -1
  34. package/types/pc/typography/EditContent.d.ts +1 -1
  35. package/types/pc/typography/Ellipsis.d.ts +1 -1
  36. package/types/pc/typography/Paragraph.d.ts +1 -1
  37. package/types/pc/typography/Title.d.ts +1 -1
  38. package/types/pc/upload/Upload.d.ts +2 -2
  39. package/types/pc/upload/constant.d.ts +4 -0
  40. package/types/pc/upload/index.d.ts +2 -0
  41. package/types/pc/upload/interface.d.ts +0 -3
  42. package/types/pc/upload/request.d.ts +1 -1
  43. package/types/pc/upload/util.d.ts +1 -1
  44. package/types/pc/verification-code/VerificationCode.d.ts +1 -1
  45. package/types/pc/verification-code/index.d.ts +1 -1
  46. package/types/pc/watermark/Watermark.d.ts +1 -1
  47. package/types/pc/watermark/index.d.ts +1 -1
  48. package/upload/Upload.js +52 -53
  49. package/upload/Uploader.js +1 -1
  50. package/upload/constant.js +9 -0
  51. package/upload/index.js +4 -4
  52. package/upload/interface.js +1 -9
  53. package/upload/list/PictureItem.js +1 -1
  54. package/upload/list/TextItem.js +1 -1
  55. package/upload/list/UploadProgress.js +1 -1
  56. package/upload/list/index.js +1 -1
  57. 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,5 +1,5 @@
1
1
  import React from 'react';
2
- import { AnchorProps } from './interface';
2
+ import type { AnchorProps } from './interface';
3
3
  interface AnchorContext {
4
4
  currentLink: string;
5
5
  onLinkClick: (e: React.MouseEvent<HTMLAnchorElement, MouseEvent>, href: string) => void;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Color, HSV } from './interface';
2
+ import type { Color, HSV } from './interface';
3
3
  interface InputHexProps {
4
4
  color: Color;
5
5
  alpha: number;
@@ -1,4 +1,4 @@
1
- import { Color, HSV } from './interface';
1
+ import type { Color, HSV } from './interface';
2
2
  interface InputRgbProps {
3
3
  color: Color;
4
4
  alpha: number;
@@ -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 { Color } from './interface';
1
+ import type { Color } from './interface';
2
2
  interface PaletteProps {
3
3
  color: Color;
4
4
  onChange: (s: number, v: number) => void;
@@ -1,4 +1,4 @@
1
- import { GradientColor, HSV, InternalGradientColor, RGB } from './interface';
1
+ import type { GradientColor, HSV, InternalGradientColor, RGB } from './interface';
2
2
  interface RGBA extends RGB {
3
3
  a: number | undefined;
4
4
  }
@@ -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;
@@ -1,4 +1,4 @@
1
- import { GridItemData } from './interface';
1
+ import type { GridItemData } from './interface';
2
2
  type RowContextType = {
3
3
  gutter?: [number, number];
4
4
  div?: boolean;
@@ -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,3 +1,3 @@
1
- import { WatermarkOptions, WatermarkReturnType } from './interface';
1
+ import type { WatermarkOptions, WatermarkReturnType } from './interface';
2
2
  export declare function useWatermark(params: WatermarkOptions): WatermarkReturnType;
3
3
  export default useWatermark;
@@ -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,5 +1,5 @@
1
1
  import React from 'react';
2
- import { InternalColumnProps } from './interface';
2
+ import type { InternalColumnProps } from './interface';
3
3
  type ColGroupType = {
4
4
  prefixCls?: string;
5
5
  columns?: InternalColumnProps[];
@@ -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
  }>;
@@ -1,4 +1,4 @@
1
- import { NodeProps, TreeDataType, TreeProps } from './interface';
1
+ import type { NodeProps, TreeDataType, TreeProps } from './interface';
2
2
  export type key2nodePropsType = {
3
3
  [key: string]: TreeDataType;
4
4
  };
@@ -221,7 +221,7 @@ export interface TreeProps {
221
221
  /**
222
222
  * @zh 点击树节点的回调
223
223
  */
224
- onNodeClick?: (key: string, data: unknown, extra: unknown) => void;
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,3 +1,3 @@
1
- import { EditContentProps } from './interface';
1
+ import type { EditContentProps } from './interface';
2
2
  declare const _default: import("react").ForwardRefExoticComponent<EditContentProps & import("react").RefAttributes<HTMLDivElement>>;
3
3
  export default _default;
@@ -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,3 +1,3 @@
1
- import { TypographyTitleProps } from './interface';
1
+ import type { TypographyTitleProps } from './interface';
2
2
  declare const Title: import("react").ForwardRefExoticComponent<TypographyTitleProps & import("react").RefAttributes<unknown>>;
3
3
  export default Title;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { STATUS, type UploadInstance, type UploadItem, type UploadProps } from './interface';
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 { STATUS as UPLOAD_STATUS, UploadList };
12
+ export { UploadList };
13
13
  export default UploadRef;
14
14
  export { UploadItem, UploadProps };
@@ -0,0 +1,4 @@
1
+ import { UploadStatus } from './interface';
2
+ export declare const STATUS: {
3
+ [key: string]: UploadStatus;
4
+ };
@@ -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,3 +1,3 @@
1
- import { UploadRequest } from './interface';
1
+ import type { UploadRequest } from './interface';
2
2
  declare const uploadRequest: UploadRequest;
3
3
  export default uploadRequest;
@@ -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 { VerificationCodeProps } from './interface';
1
+ import type { VerificationCodeProps } from './interface';
2
2
  import VerificationCode from './VerificationCode';
3
3
  export type { VerificationCodeProps };
4
4
  export default VerificationCode;
@@ -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;
@@ -1,4 +1,4 @@
1
- import { WatermarkProps } from './interface';
1
+ import type { WatermarkProps } from './interface';
2
2
  import Watermark from './Watermark';
3
3
  export { type WatermarkProps };
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 _, useContext as k, useRef as S, useState as z, useImperativeHandle as G } from "react";
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 J from "../components/common/hooks/useMergeProps.js";
7
- import K from "@unicom-cloud/utils/class-name";
8
- import { omit as Q } from "../components/common/utils/omit.js";
9
- import { warning as D } from "../components/common/utils/warning.js";
10
- import { STATUS as g } from "./interface.js";
11
- import { FileList as V } from "./list/index.js";
12
- import X from "./Uploader.js";
13
- import Y from "../config-provider/context.js";
14
- const h = function(f) {
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, L) => {
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
- D(e !== -1, "[Upload]: duplicate uid");
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
- D(!0, "[Upload]: uid is required");
30
- const e = `${String(+/* @__PURE__ */ new Date())}${L}`;
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
- }, Z = {
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: L } = k(Y), e = J(
47
+ const { getPrefixCls: a, componentConfig: n, rtl: h } = z(Z), e = K(
48
48
  f,
49
- Z,
49
+ _,
50
50
  n == null ? void 0 : n.Upload
51
- ), r = a == null ? void 0 : a("upload"), s = S(), x = S(), [N, b] = z(() => "fileList" in e ? h(e.fileList) : "defaultFileList" in e ? h(e.defaultFileList) : []), d = "fileList" in e ? h(e.fileList) : N, v = (t, i) => {
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
- }, O = (t) => {
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
- }, P = (t) => {
75
+ }, w = (t) => {
76
76
  t && s.current && s.current.abort(t);
77
77
  };
78
- G(c, () => ({
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
- P(t);
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: y,
98
- style: E,
99
- renderUploadItem: T,
100
- showUploadList: w,
101
- renderUploadList: I,
102
- progressProps: A,
103
- imagePreview: j,
104
- ...q
105
- } = e, u = W(e.limit) ? { hideOnExceedLimit: !0, maxCount: e.limit } : { hideOnExceedLimit: !0, ...e.limit }, U = u.maxCount && u.maxCount <= d.length, C = "disabled" in e ? e.disabled : !u.hideOnExceedLimit && U, $ = /* @__PURE__ */ m(
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
- ...Q(q, [
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: K(
140
+ className: Q(
141
141
  r,
142
142
  {
143
143
  [`${r}-type-${l}`]: l,
144
144
  [`${r}-drag`]: e.drag,
145
- [`${r}-disabled`]: C,
146
- [`${r}-hide`]: u.hideOnExceedLimit && U,
147
- [`${r}-rtl`]: L
145
+ [`${r}-disabled`]: P,
146
+ [`${r}-hide`]: u.hideOnExceedLimit && L,
147
+ [`${r}-rtl`]: h
148
148
  },
149
- y
149
+ O
150
150
  ),
151
- style: E,
151
+ style: S,
152
152
  ref: x,
153
153
  children: /* @__PURE__ */ m(
154
- X,
154
+ Y,
155
155
  {
156
156
  ref: s,
157
157
  ...e,
158
158
  limit: u.maxCount,
159
- hide: u.hideOnExceedLimit && U,
160
- disabled: C,
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
- w && /* @__PURE__ */ m(
177
- V,
176
+ C && /* @__PURE__ */ m(
177
+ X,
178
178
  {
179
- imagePreview: j,
180
- progressProps: A,
181
- showUploadList: w,
179
+ imagePreview: q,
180
+ progressProps: j,
181
+ showUploadList: C,
182
182
  disabled: e.disabled,
183
183
  listType: l,
184
184
  fileList: d,
185
- renderUploadItem: T,
186
- renderUploadList: I,
185
+ renderUploadItem: I,
186
+ renderUploadList: T,
187
187
  onUpload: F,
188
- onAbort: P,
189
- onRemove: O,
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
- g as UPLOAD_STATUS,
204
- V as UploadList,
203
+ X as UploadList,
205
204
  te as default
206
205
  };
@@ -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 "./interface.js";
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) {
@@ -0,0 +1,9 @@
1
+ const i = {
2
+ init: "init",
3
+ uploading: "uploading",
4
+ success: "done",
5
+ fail: "error"
6
+ };
7
+ export {
8
+ i as STATUS
9
+ };
package/upload/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import r from "./Upload.js";
2
- import { FileList as e } from "./list/index.js";
3
- import { STATUS as f } from "./interface.js";
2
+ import { STATUS as e } from "./constant.js";
3
+ import { FileList as f } from "./list/index.js";
4
4
  export {
5
- f as UPLOAD_STATUS,
6
- e as UploadList,
5
+ e as UPLOAD_STATUS,
6
+ f as UploadList,
7
7
  r as default
8
8
  };
@@ -1,9 +1 @@
1
- const i = {
2
- init: "init",
3
- uploading: "uploading",
4
- success: "done",
5
- fail: "error"
6
- };
7
- export {
8
- i as STATUS
9
- };
1
+
@@ -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 "../interface.js";
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";
@@ -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 "../interface.js";
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 "../interface.js";
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;