yc-design-vue 2.0.6 → 2.0.7

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 (55) hide show
  1. package/dist/index.umd.js +1 -1
  2. package/dist/style.css +1 -1
  3. package/es/Input/InputSuffix.vue.js +1 -1
  4. package/es/Transfer/TransferPanel.vue.js +1 -1
  5. package/es/Upload/Upload.vue.d.ts +2 -0
  6. package/es/Upload/Upload.vue.js +13 -3
  7. package/es/Upload/UploadButton.vue.js +1 -1
  8. package/es/Upload/UploadFileList.vue.js +1 -1
  9. package/es/Upload/UploadFileList.vue2.js +4 -8
  10. package/es/Upload/UploadPictureCard.vue.js +1 -1
  11. package/es/Upload/UploadPictureCard.vue2.js +13 -17
  12. package/es/Upload/hooks/useContext.d.ts +5 -1
  13. package/es/Upload/hooks/useContext.js +18 -1
  14. package/es/Upload/hooks/useUpload.d.ts +6 -2
  15. package/es/Upload/hooks/useUpload.js +9 -4
  16. package/es/Upload/index.d.ts +6 -0
  17. package/es/Upload/type.d.ts +4 -0
  18. package/es/_shared/icons/IconDelete.vue.js +1 -19
  19. package/es/_shared/icons/IconDelete.vue2.js +19 -1
  20. package/es/_shared/icons/IconEyeClose.vue.js +1 -23
  21. package/es/_shared/icons/IconEyeClose.vue2.js +23 -1
  22. package/es/_shared/icons/IconFile.vue.js +1 -19
  23. package/es/_shared/icons/IconFile.vue2.js +19 -1
  24. package/es/_shared/icons/IconUpload.vue.js +1 -19
  25. package/es/_shared/icons/IconUpload.vue2.js +19 -1
  26. package/es/index.d.ts +2 -1
  27. package/es/index.js +1 -0
  28. package/es/style.css +1 -1
  29. package/lib/Input/InputSuffix.vue.js +1 -1
  30. package/lib/Transfer/TransferPanel.vue.js +1 -1
  31. package/lib/Upload/Upload.vue.d.ts +2 -0
  32. package/lib/Upload/Upload.vue.js +1 -1
  33. package/lib/Upload/UploadButton.vue.js +1 -1
  34. package/lib/Upload/UploadFileList.vue.js +1 -1
  35. package/lib/Upload/UploadFileList.vue2.js +1 -1
  36. package/lib/Upload/UploadPictureCard.vue.js +1 -1
  37. package/lib/Upload/UploadPictureCard.vue2.js +1 -1
  38. package/lib/Upload/hooks/useContext.d.ts +5 -1
  39. package/lib/Upload/hooks/useContext.js +1 -1
  40. package/lib/Upload/hooks/useUpload.d.ts +6 -2
  41. package/lib/Upload/hooks/useUpload.js +1 -1
  42. package/lib/Upload/index.d.ts +6 -0
  43. package/lib/Upload/type.d.ts +4 -0
  44. package/lib/_shared/icons/IconDelete.vue.js +1 -1
  45. package/lib/_shared/icons/IconDelete.vue2.js +1 -1
  46. package/lib/_shared/icons/IconEyeClose.vue.js +1 -1
  47. package/lib/_shared/icons/IconEyeClose.vue2.js +1 -1
  48. package/lib/_shared/icons/IconFile.vue.js +1 -1
  49. package/lib/_shared/icons/IconFile.vue2.js +1 -1
  50. package/lib/_shared/icons/IconUpload.vue.js +1 -1
  51. package/lib/_shared/icons/IconUpload.vue2.js +1 -1
  52. package/lib/index.d.ts +2 -1
  53. package/lib/index.js +1 -1
  54. package/lib/style.css +1 -1
  55. package/package.json +1 -1
@@ -5,7 +5,7 @@ import _sfc_main$1 from "../_shared/components/PreventFocus/index.vue.js";
5
5
  import "../_shared/utils/dom.js";
6
6
  /* empty css */
7
7
  /* empty css */
8
- import _sfc_main$4 from "../_shared/icons/IconEyeClose.vue.js";
8
+ import _sfc_main$4 from "../_shared/icons/IconEyeClose.vue2.js";
9
9
  import _sfc_main$3 from "../_shared/icons/IconEyeOpen.vue2.js";
10
10
  const _hoisted_1 = {
11
11
  key: 0,
@@ -5,7 +5,7 @@ import "../_shared/utils/dom.js";
5
5
  /* empty css */
6
6
  /* empty css */
7
7
  import _sfc_main$4 from "../_shared/icons/IconClose.vue.js";
8
- import _sfc_main$2 from "../_shared/icons/IconDelete.vue.js";
8
+ import _sfc_main$2 from "../_shared/icons/IconDelete.vue2.js";
9
9
  import _sfc_main$3 from "../_shared/icons/IconSearch.vue2.js";
10
10
  import useTransferContext from "./hooks/useContext.js";
11
11
  import Checkbox from "../Checkbox/index.js";
@@ -41,6 +41,8 @@ declare const __VLS_component: import('vue').DefineComponent<UploadProps, {
41
41
  accept: string;
42
42
  showFileList: boolean;
43
43
  showUploadButton: boolean;
44
+ onBeforeUpload: import('./type').OnBeforeUpload;
45
+ onBeforeRemove: import('./type').OnBeforeRemove;
44
46
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
45
47
  uploadRef: HTMLDivElement;
46
48
  }, HTMLDivElement>;
@@ -31,7 +31,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
31
31
  imageLoading: { default: "lazy" },
32
32
  listType: { default: "text" },
33
33
  customIcon: { default: () => ({}) },
34
- imagePreview: { type: Boolean }
34
+ imagePreview: { type: Boolean },
35
+ onBeforeUpload: { type: Function, default: () => true },
36
+ onBeforeRemove: { type: Function, default: () => Promise.resolve(true) }
35
37
  },
36
38
  emits: ["update:fileList", "exceed-limit", "change", "preview"],
37
39
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -39,7 +41,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
39
41
  const props = __props;
40
42
  const emits = __emit;
41
43
  const uploadRef = ref();
42
- const { computedFileList, limit, draggable, disabled, handleFiles, open } = useUpload(uploadRef, props, emits);
44
+ const {
45
+ computedFileList,
46
+ limit,
47
+ draggable,
48
+ disabled,
49
+ handleFiles,
50
+ handleUpload
51
+ } = useUpload(uploadRef, props, emits);
43
52
  __expose({
44
53
  updateFile(id, file) {
45
54
  const index = computedFileList.value.findIndex((item) => item.uid == id);
@@ -78,7 +87,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
78
87
  ]),
79
88
  ref_key: "uploadRef",
80
89
  ref: uploadRef,
81
- onClick: _cache[0] || (_cache[0] = ($event) => !unref(disabled) && unref(open)())
90
+ onClick: _cache[0] || (_cache[0] = //@ts-ignore
91
+ (...args) => unref(handleUpload) && unref(handleUpload)(...args))
82
92
  }, [
83
93
  unref(limit) <= 0 || unref(computedFileList).length < unref(limit) ? renderSlot(_ctx.$slots, "upload-button", { key: 0 }, () => [
84
94
  unref(draggable) ? (openBlock(), createBlock(_sfc_main$1, { key: 0 })) : (openBlock(), createBlock(_sfc_main$2, { key: 1 }))
@@ -4,7 +4,7 @@ import "../_shared/utils/dom.js";
4
4
  /* empty css */
5
5
  /* empty css */
6
6
  /* empty css */
7
- import _sfc_main$1 from "../_shared/icons/IconUpload.vue.js";
7
+ import _sfc_main$1 from "../_shared/icons/IconUpload.vue2.js";
8
8
  import Button from "../Button/index.js";
9
9
  const _hoisted_1 = { class: "yc-upload-button" };
10
10
  const _hoisted_2 = {
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./UploadFileList.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
4
- const UploadFileList = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-da3b0aaf"]]);
4
+ const UploadFileList = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2b2e07dc"]]);
5
5
  export {
6
6
  UploadFileList as default
7
7
  };
@@ -5,8 +5,8 @@ import _sfc_main$1 from "../_shared/components/IconButton/index.vue.js";
5
5
  import "../_shared/utils/dom.js";
6
6
  /* empty css */
7
7
  /* empty css */
8
- import _sfc_main$3 from "../_shared/icons/IconDelete.vue.js";
9
- import _sfc_main$2 from "../_shared/icons/IconFile.vue.js";
8
+ import _sfc_main$3 from "../_shared/icons/IconDelete.vue2.js";
9
+ import _sfc_main$2 from "../_shared/icons/IconFile.vue2.js";
10
10
  const _hoisted_1 = { class: "yc-upload-list-item-content" };
11
11
  const _hoisted_2 = {
12
12
  key: 0,
@@ -36,12 +36,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
36
36
  download,
37
37
  customIcon,
38
38
  slots,
39
- emits
39
+ handleDelFile
40
40
  } = useUploadContext().inject();
41
- const handleDel = (uid) => {
42
- computedFileList.value = computedFileList.value.filter((v) => v.uid != uid);
43
- emits("change", computedFileList.value, []);
44
- };
45
41
  const renderFileIcon = (fileItem) => {
46
42
  var _a, _b;
47
43
  if (slots["file-icon"]) {
@@ -106,7 +102,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
106
102
  ], true),
107
103
  _ctx.$slots["extra-button"] || unref(showRemoveButton) ? (openBlock(), createElementBlock("span", _hoisted_8, [
108
104
  createVNode(unref(_sfc_main$1), {
109
- onClick: ($event) => handleDel(item.uid)
105
+ onClick: ($event) => unref(handleDelFile)(item)
110
106
  }, {
111
107
  default: withCtx(() => [
112
108
  (openBlock(), createBlock(resolveDynamicComponent(renderDelIcon())))
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./UploadPictureCard.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
4
- const UploadPictureCard = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-499f701f"]]);
4
+ const UploadPictureCard = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2914d73a"]]);
5
5
  export {
6
6
  UploadPictureCard as default
7
7
  };
@@ -1,12 +1,12 @@
1
- import { defineComponent, ref, createElementBlock, openBlock, normalizeClass, unref, createVNode, createElementVNode, Fragment, renderList, createCommentVNode, createBlock, resolveDynamicComponent, toDisplayString } from "vue";
1
+ import { defineComponent, ref, createElementBlock, openBlock, normalizeClass, unref, createVNode, createCommentVNode, Fragment, renderList, createElementVNode, createBlock, resolveDynamicComponent, toDisplayString } from "vue";
2
+ import useUpload from "./hooks/useUpload.js";
2
3
  import "../_shared/utils/dom.js";
3
4
  /* empty css */
4
5
  /* empty css */
5
6
  /* empty css */
6
- import _sfc_main$3 from "../_shared/icons/IconDelete.vue.js";
7
- import _sfc_main$4 from "../_shared/icons/IconEyeClose.vue.js";
7
+ import _sfc_main$3 from "../_shared/icons/IconDelete.vue2.js";
8
+ import _sfc_main$4 from "../_shared/icons/IconEyeClose.vue2.js";
8
9
  import _sfc_main$2 from "../_shared/icons/IconPlus.vue.js";
9
- import useUpload from "./hooks/useUpload.js";
10
10
  import "../Image/index.js";
11
11
  import _sfc_main$1 from "../Image/ImagePreview.vue.js";
12
12
  /* empty css */
@@ -28,6 +28,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
28
28
  const url = ref("");
29
29
  const {
30
30
  computedFileList,
31
+ limit,
31
32
  tip,
32
33
  slots,
33
34
  customIcon,
@@ -36,7 +37,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
36
37
  showPreviewButton,
37
38
  showRemoveButton,
38
39
  listType,
39
- open,
40
+ handleUpload,
41
+ handleDelFile,
40
42
  emits
41
43
  } = useUpload(uploadRef);
42
44
  const renderDelIcon = () => {
@@ -45,20 +47,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
45
47
  const renderPreviewIcon = () => {
46
48
  return slots["preview-icon"] ?? (customIcon.value.previewIcon || _sfc_main$4);
47
49
  };
48
- const handleUpload = () => {
49
- if (disabled.value) return;
50
- open();
51
- };
52
50
  const handlePreview = (fileItem) => {
53
51
  url.value = fileItem.url;
54
52
  emits("preview", fileItem);
55
53
  if (!imagePreview.value) return;
56
54
  visible.value = true;
57
55
  };
58
- const handleDel = (uid) => {
59
- computedFileList.value = computedFileList.value.filter((v) => v.uid != uid);
60
- emits("change", computedFileList.value, []);
61
- };
62
56
  return (_ctx, _cache) => {
63
57
  return openBlock(), createElementBlock("div", {
64
58
  class: normalizeClass([
@@ -95,7 +89,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
95
89
  unref(showRemoveButton) ? (openBlock(), createElementBlock("span", {
96
90
  key: 1,
97
91
  class: normalizeClass(["yc-upload-icon", "yc-upload-icon-remove"]),
98
- onClick: ($event) => handleDel(item.uid)
92
+ onClick: ($event) => unref(handleDelFile)(item)
99
93
  }, [
100
94
  (openBlock(), createBlock(resolveDynamicComponent(renderDelIcon())))
101
95
  ], 8, _hoisted_5)) : createCommentVNode("", true)
@@ -103,11 +97,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
103
97
  ])
104
98
  ]);
105
99
  }), 128)),
106
- createElementVNode("span", {
100
+ unref(limit) <= 0 || unref(computedFileList).length < unref(limit) ? (openBlock(), createElementBlock("span", {
101
+ key: 0,
107
102
  class: "yc-upload",
108
103
  ref_key: "uploadRef",
109
104
  ref: uploadRef,
110
- onClick: handleUpload
105
+ onClick: _cache[1] || (_cache[1] = //@ts-ignore
106
+ (...args) => unref(handleUpload) && unref(handleUpload)(...args))
111
107
  }, [
112
108
  createElementVNode("div", {
113
109
  class: normalizeClass([
@@ -122,7 +118,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
122
118
  ]),
123
119
  unref(tip) ? (openBlock(), createElementBlock("div", _hoisted_7, toDisplayString(unref(tip)), 1)) : createCommentVNode("", true)
124
120
  ], 2)
125
- ], 512)
121
+ ], 512)) : createCommentVNode("", true)
126
122
  ], 2);
127
123
  };
128
124
  }
@@ -1,5 +1,5 @@
1
1
  import { Ref } from 'vue';
2
- import { UploadEmits, FileItem, FileListType, ImageLoading, UploadSlots, CustomIcon, FileName } from '../type';
2
+ import { UploadEmits, FileItem, FileListType, ImageLoading, UploadSlots, CustomIcon, FileName, OnBeforeUpload } from '../type';
3
3
  import { RecordType } from '../../_shared/type';
4
4
  type UploadContext = {
5
5
  computedFileList: Ref<FileItem[]>;
@@ -20,6 +20,8 @@ type UploadContext = {
20
20
  showPreviewButton: Ref<boolean>;
21
21
  imagePreview: Ref<boolean>;
22
22
  slots: UploadSlots;
23
+ onBeforeUpload: OnBeforeUpload;
24
+ handleDelFile: (fileItem: FileItem) => Promise<void>;
23
25
  emits: UploadEmits;
24
26
  };
25
27
  export default function useUploadContext(): {
@@ -42,6 +44,8 @@ export default function useUploadContext(): {
42
44
  showPreviewButton: Ref<boolean, boolean>;
43
45
  name: any;
44
46
  slots: UploadSlots;
47
+ onBeforeUpload: any;
48
+ handleDelFile: (fileItem: FileItem) => Promise<void>;
45
49
  emits: UploadEmits;
46
50
  };
47
51
  inject: () => UploadContext;
@@ -22,7 +22,7 @@ function useUploadContext() {
22
22
  showPreviewButton,
23
23
  accept: _accept
24
24
  } = toRefs(props);
25
- const { name } = props;
25
+ const { name, onBeforeUpload, onBeforeRemove } = props;
26
26
  const slots = useSlots();
27
27
  const computedFileList = useControlValue(
28
28
  fileList,
@@ -34,6 +34,19 @@ function useUploadContext() {
34
34
  const accept = computed(() => {
35
35
  return listType.value != "text" ? "image/*" : _accept.value;
36
36
  });
37
+ const handleDelFile = async (fileItem) => {
38
+ let isDel = true;
39
+ try {
40
+ isDel = await (onBeforeRemove == null ? void 0 : onBeforeRemove(fileItem));
41
+ } catch {
42
+ isDel = false;
43
+ }
44
+ if (!isDel) return;
45
+ computedFileList.value = computedFileList.value.filter(
46
+ (v) => v.uid != fileItem.uid
47
+ );
48
+ emits("change", computedFileList.value, []);
49
+ };
37
50
  const context = {
38
51
  computedFileList,
39
52
  accept,
@@ -53,6 +66,8 @@ function useUploadContext() {
53
66
  showPreviewButton,
54
67
  name,
55
68
  slots,
69
+ onBeforeUpload,
70
+ handleDelFile,
56
71
  emits
57
72
  };
58
73
  provide(UPLOAD_CONTEXT_KEY, context);
@@ -78,6 +93,8 @@ function useUploadContext() {
78
93
  showPreviewButton: ref(true),
79
94
  name: "",
80
95
  slots: {},
96
+ handleDelFile: () => Promise.resolve(),
97
+ onBeforeUpload: () => true,
81
98
  emits: () => {
82
99
  }
83
100
  });
@@ -1,7 +1,7 @@
1
1
  import { FileItem, UploadEmits, UploadProps } from '../type';
2
2
  import { Ref } from 'vue';
3
3
  export default function useUpload(uploadRef: Ref<HTMLDivElement | undefined>, _props?: UploadProps, _emits?: UploadEmits): {
4
- open: (localOptions?: Partial<import('@vueuse/core').UseFileDialogOptions>) => void;
4
+ handleUpload: () => void;
5
5
  handleFiles: (fileData: File[] | FileList | null) => void;
6
6
  computedFileList: Ref<FileItem[]>;
7
7
  disabled: Ref<boolean>;
@@ -21,9 +21,11 @@ export default function useUpload(uploadRef: Ref<HTMLDivElement | undefined>, _p
21
21
  showPreviewButton: Ref<boolean>;
22
22
  imagePreview: Ref<boolean>;
23
23
  slots: import('..').UploadSlots;
24
+ onBeforeUpload: import('..').OnBeforeUpload;
25
+ handleDelFile: (fileItem: FileItem) => Promise<void>;
24
26
  emits: UploadEmits;
25
27
  } | {
26
- open: (localOptions?: Partial<import('@vueuse/core').UseFileDialogOptions>) => void;
28
+ handleUpload: () => void;
27
29
  handleFiles: (fileData: File[] | FileList | null) => void;
28
30
  computedFileList: import('vue').WritableComputedRef<FileItem[], FileItem[]>;
29
31
  accept: import('vue').ComputedRef<string>;
@@ -43,5 +45,7 @@ export default function useUpload(uploadRef: Ref<HTMLDivElement | undefined>, _p
43
45
  showPreviewButton: Ref<boolean, boolean>;
44
46
  name: any;
45
47
  slots: import('..').UploadSlots;
48
+ onBeforeUpload: any;
49
+ handleDelFile: (fileItem: FileItem) => Promise<void>;
46
50
  emits: UploadEmits;
47
51
  };
@@ -18,6 +18,7 @@ function useUpload(uploadRef, _props, _emits) {
18
18
  directory,
19
19
  multiple,
20
20
  name,
21
+ onBeforeUpload,
21
22
  emits
22
23
  } = context;
23
24
  const { onChange, open } = useFileDialog({
@@ -43,8 +44,9 @@ function useUpload(uploadRef, _props, _emits) {
43
44
  return fileItem.name;
44
45
  };
45
46
  const handleFiles = (fileData) => {
46
- const files = [...fileData || []];
47
- if (!(files == null ? void 0 : files.length) || disabled.value || isOutOfLimit(files.length)) {
47
+ const files = [...fileData || []].filter((file) => onBeforeUpload(file));
48
+ console.log(files);
49
+ if (!files.length || disabled.value || isOutOfLimit(files.length)) {
48
50
  if (!isOutOfLimit(files == null ? void 0 : files.length)) return;
49
51
  emits("exceed-limit", computedFileList.value, files);
50
52
  return;
@@ -66,12 +68,15 @@ function useUpload(uploadRef, _props, _emits) {
66
68
  };
67
69
  })
68
70
  ];
69
- console.dir(computedFileList.value, "files");
70
71
  emits("change", computedFileList.value, [...files]);
71
72
  };
73
+ const handleUpload = () => {
74
+ if (disabled.value) return;
75
+ open();
76
+ };
72
77
  return {
73
78
  ...context,
74
- open,
79
+ handleUpload,
75
80
  handleFiles
76
81
  };
77
82
  }
@@ -36,6 +36,8 @@ declare const Upload: {
36
36
  accept: string;
37
37
  showFileList: boolean;
38
38
  showUploadButton: boolean;
39
+ onBeforeUpload: import('./type').OnBeforeUpload;
40
+ onBeforeRemove: import('./type').OnBeforeRemove;
39
41
  }, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
40
42
  uploadRef: HTMLDivElement;
41
43
  }, HTMLDivElement, import('vue').ComponentProvideOptions, {
@@ -73,6 +75,8 @@ declare const Upload: {
73
75
  accept: string;
74
76
  showFileList: boolean;
75
77
  showUploadButton: boolean;
78
+ onBeforeUpload: import('./type').OnBeforeUpload;
79
+ onBeforeRemove: import('./type').OnBeforeRemove;
76
80
  }>;
77
81
  __isFragment?: never;
78
82
  __isTeleport?: never;
@@ -110,6 +114,8 @@ declare const Upload: {
110
114
  accept: string;
111
115
  showFileList: boolean;
112
116
  showUploadButton: boolean;
117
+ onBeforeUpload: import('./type').OnBeforeUpload;
118
+ onBeforeRemove: import('./type').OnBeforeRemove;
113
119
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
114
120
  $slots: any;
115
121
  }) & {
@@ -20,6 +20,8 @@ export interface UploadProps {
20
20
  listType?: FileListType;
21
21
  customIcon?: CustomIcon;
22
22
  imagePreview?: boolean;
23
+ onBeforeUpload?: OnBeforeUpload;
24
+ onBeforeRemove?: OnBeforeRemove;
23
25
  }
24
26
  export interface UploadEmits {
25
27
  (e: 'update:fileList', value: FileItem[]): void;
@@ -56,6 +58,8 @@ export type FileStatus = 'init' | 'uploading' | 'done' | 'error' | 'removed';
56
58
  export type FileName = string | ((fileItem: FileItem) => string);
57
59
  export type FileListType = 'text' | 'picture' | 'picture-card';
58
60
  export type ImageLoading = 'eager' | 'lazy';
61
+ export type OnBeforeUpload = (file: File) => boolean;
62
+ export type OnBeforeRemove = (fileItem: FileItem) => Promise<boolean>;
59
63
  export type FileItem = {
60
64
  uid: string;
61
65
  name: string;
@@ -1,22 +1,4 @@
1
- import { defineComponent, createBlock, openBlock, unref, normalizeProps, guardReactiveProps, withCtx, createElementVNode } from "vue";
2
- import "../utils/dom.js";
3
- /* empty css */
4
- /* empty css */
5
- import _sfc_main$1 from "../components/Icon/index.vue3.js";
6
- /* empty css */
7
- const _sfc_main = /* @__PURE__ */ defineComponent({
8
- __name: "IconDelete",
9
- setup(__props) {
10
- return (_ctx, _cache) => {
11
- return openBlock(), createBlock(unref(_sfc_main$1), normalizeProps(guardReactiveProps(_ctx.$attrs)), {
12
- default: withCtx(() => [..._cache[0] || (_cache[0] = [
13
- createElementVNode("path", { d: "M5 11h5.5m0 0v29a1 1 0 0 0 1 1h25a1 1 0 0 0 1-1V11m-27 0H16m21.5 0H43m-5.5 0H32m-16 0V7h16v4m-16 0h16M20 18v15m8-15v15" }, null, -1)
14
- ])]),
15
- _: 1
16
- }, 16);
17
- };
18
- }
19
- });
1
+ import _sfc_main from "./IconDelete.vue2.js";
20
2
  export {
21
3
  _sfc_main as default
22
4
  };
@@ -1,4 +1,22 @@
1
- import _sfc_main from "./IconDelete.vue.js";
1
+ import { defineComponent, createBlock, openBlock, unref, normalizeProps, guardReactiveProps, withCtx, createElementVNode } from "vue";
2
+ import "../utils/dom.js";
3
+ /* empty css */
4
+ /* empty css */
5
+ import _sfc_main$1 from "../components/Icon/index.vue3.js";
6
+ /* empty css */
7
+ const _sfc_main = /* @__PURE__ */ defineComponent({
8
+ __name: "IconDelete",
9
+ setup(__props) {
10
+ return (_ctx, _cache) => {
11
+ return openBlock(), createBlock(unref(_sfc_main$1), normalizeProps(guardReactiveProps(_ctx.$attrs)), {
12
+ default: withCtx(() => [..._cache[0] || (_cache[0] = [
13
+ createElementVNode("path", { d: "M5 11h5.5m0 0v29a1 1 0 0 0 1 1h25a1 1 0 0 0 1-1V11m-27 0H16m21.5 0H43m-5.5 0H32m-16 0V7h16v4m-16 0h16M20 18v15m8-15v15" }, null, -1)
14
+ ])]),
15
+ _: 1
16
+ }, 16);
17
+ };
18
+ }
19
+ });
2
20
  export {
3
21
  _sfc_main as default
4
22
  };
@@ -1,26 +1,4 @@
1
- import { defineComponent, createBlock, openBlock, unref, normalizeProps, guardReactiveProps, withCtx, createElementVNode } from "vue";
2
- import "../utils/dom.js";
3
- /* empty css */
4
- /* empty css */
5
- import _sfc_main$1 from "../components/Icon/index.vue3.js";
6
- /* empty css */
7
- const _sfc_main = /* @__PURE__ */ defineComponent({
8
- __name: "IconEyeClose",
9
- setup(__props) {
10
- return (_ctx, _cache) => {
11
- return openBlock(), createBlock(unref(_sfc_main$1), normalizeProps(guardReactiveProps(_ctx.$attrs)), {
12
- default: withCtx(() => [..._cache[0] || (_cache[0] = [
13
- createElementVNode("path", {
14
- d: "M24 37c6.627 0 12.627-4.333 18-13-5.373-8.667-11.373-13-18-13-6.627 0-12.627 4.333-18 13 5.373 8.667 11.373 13 18 13Z",
15
- "clip-rule": "evenodd"
16
- }, null, -1),
17
- createElementVNode("path", { d: "M29 24a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z" }, null, -1)
18
- ])]),
19
- _: 1
20
- }, 16);
21
- };
22
- }
23
- });
1
+ import _sfc_main from "./IconEyeClose.vue2.js";
24
2
  export {
25
3
  _sfc_main as default
26
4
  };
@@ -1,4 +1,26 @@
1
- import _sfc_main from "./IconEyeClose.vue.js";
1
+ import { defineComponent, createBlock, openBlock, unref, normalizeProps, guardReactiveProps, withCtx, createElementVNode } from "vue";
2
+ import "../utils/dom.js";
3
+ /* empty css */
4
+ /* empty css */
5
+ import _sfc_main$1 from "../components/Icon/index.vue3.js";
6
+ /* empty css */
7
+ const _sfc_main = /* @__PURE__ */ defineComponent({
8
+ __name: "IconEyeClose",
9
+ setup(__props) {
10
+ return (_ctx, _cache) => {
11
+ return openBlock(), createBlock(unref(_sfc_main$1), normalizeProps(guardReactiveProps(_ctx.$attrs)), {
12
+ default: withCtx(() => [..._cache[0] || (_cache[0] = [
13
+ createElementVNode("path", {
14
+ d: "M24 37c6.627 0 12.627-4.333 18-13-5.373-8.667-11.373-13-18-13-6.627 0-12.627 4.333-18 13 5.373 8.667 11.373 13 18 13Z",
15
+ "clip-rule": "evenodd"
16
+ }, null, -1),
17
+ createElementVNode("path", { d: "M29 24a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z" }, null, -1)
18
+ ])]),
19
+ _: 1
20
+ }, 16);
21
+ };
22
+ }
23
+ });
2
24
  export {
3
25
  _sfc_main as default
4
26
  };
@@ -1,22 +1,4 @@
1
- import { defineComponent, createBlock, openBlock, unref, normalizeProps, guardReactiveProps, withCtx, createElementVNode } from "vue";
2
- import "../utils/dom.js";
3
- /* empty css */
4
- /* empty css */
5
- import _sfc_main$1 from "../components/Icon/index.vue3.js";
6
- /* empty css */
7
- const _sfc_main = /* @__PURE__ */ defineComponent({
8
- __name: "IconFile",
9
- setup(__props) {
10
- return (_ctx, _cache) => {
11
- return openBlock(), createBlock(unref(_sfc_main$1), normalizeProps(guardReactiveProps(_ctx.$attrs)), {
12
- default: withCtx(() => [..._cache[0] || (_cache[0] = [
13
- createElementVNode("path", { d: "M16 21h16m-16 8h10m11 13H11a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h21l7 7v27a2 2 0 0 1-2 2Z" }, null, -1)
14
- ])]),
15
- _: 1
16
- }, 16);
17
- };
18
- }
19
- });
1
+ import _sfc_main from "./IconFile.vue2.js";
20
2
  export {
21
3
  _sfc_main as default
22
4
  };
@@ -1,4 +1,22 @@
1
- import _sfc_main from "./IconFile.vue.js";
1
+ import { defineComponent, createBlock, openBlock, unref, normalizeProps, guardReactiveProps, withCtx, createElementVNode } from "vue";
2
+ import "../utils/dom.js";
3
+ /* empty css */
4
+ /* empty css */
5
+ import _sfc_main$1 from "../components/Icon/index.vue3.js";
6
+ /* empty css */
7
+ const _sfc_main = /* @__PURE__ */ defineComponent({
8
+ __name: "IconFile",
9
+ setup(__props) {
10
+ return (_ctx, _cache) => {
11
+ return openBlock(), createBlock(unref(_sfc_main$1), normalizeProps(guardReactiveProps(_ctx.$attrs)), {
12
+ default: withCtx(() => [..._cache[0] || (_cache[0] = [
13
+ createElementVNode("path", { d: "M16 21h16m-16 8h10m11 13H11a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h21l7 7v27a2 2 0 0 1-2 2Z" }, null, -1)
14
+ ])]),
15
+ _: 1
16
+ }, 16);
17
+ };
18
+ }
19
+ });
2
20
  export {
3
21
  _sfc_main as default
4
22
  };
@@ -1,22 +1,4 @@
1
- import { defineComponent, createBlock, openBlock, unref, normalizeProps, guardReactiveProps, withCtx, createElementVNode } from "vue";
2
- import "../utils/dom.js";
3
- /* empty css */
4
- /* empty css */
5
- import _sfc_main$1 from "../components/Icon/index.vue3.js";
6
- /* empty css */
7
- const _sfc_main = /* @__PURE__ */ defineComponent({
8
- __name: "IconUpload",
9
- setup(__props) {
10
- return (_ctx, _cache) => {
11
- return openBlock(), createBlock(unref(_sfc_main$1), normalizeProps(guardReactiveProps(_ctx.$attrs)), {
12
- default: withCtx(() => [..._cache[0] || (_cache[0] = [
13
- createElementVNode("path", { d: "M14.93 17.071 24.001 8l9.071 9.071m-9.07 16.071v-25M40 35v6H8v-6" }, null, -1)
14
- ])]),
15
- _: 1
16
- }, 16);
17
- };
18
- }
19
- });
1
+ import _sfc_main from "./IconUpload.vue2.js";
20
2
  export {
21
3
  _sfc_main as default
22
4
  };
@@ -1,4 +1,22 @@
1
- import _sfc_main from "./IconUpload.vue.js";
1
+ import { defineComponent, createBlock, openBlock, unref, normalizeProps, guardReactiveProps, withCtx, createElementVNode } from "vue";
2
+ import "../utils/dom.js";
3
+ /* empty css */
4
+ /* empty css */
5
+ import _sfc_main$1 from "../components/Icon/index.vue3.js";
6
+ /* empty css */
7
+ const _sfc_main = /* @__PURE__ */ defineComponent({
8
+ __name: "IconUpload",
9
+ setup(__props) {
10
+ return (_ctx, _cache) => {
11
+ return openBlock(), createBlock(unref(_sfc_main$1), normalizeProps(guardReactiveProps(_ctx.$attrs)), {
12
+ default: withCtx(() => [..._cache[0] || (_cache[0] = [
13
+ createElementVNode("path", { d: "M14.93 17.071 24.001 8l9.071 9.071m-9.07 16.071v-25M40 35v6H8v-6" }, null, -1)
14
+ ])]),
15
+ _: 1
16
+ }, 16);
17
+ };
18
+ }
19
+ });
2
20
  export {
3
21
  _sfc_main as default
4
22
  };
package/es/index.d.ts CHANGED
@@ -64,6 +64,7 @@ import { default as Transfer } from './Transfer';
64
64
  import { default as Trigger } from './Trigger';
65
65
  import { default as Typography } from './Typography';
66
66
  import { default as Tabs } from './Tabs';
67
+ import { default as Upload } from './Upload';
67
68
  import { default as VerificationCode } from './VerificationCode';
68
69
  import { default as Watermark } from './Watermark';
69
70
  export * from './_shared/type';
@@ -135,7 +136,7 @@ export * from './Tabs';
135
136
  export * from './Upload';
136
137
  export * from './VerificationCode';
137
138
  export * from './Watermark';
138
- export { Affix, Alert, Anchor, AutoComplete, Avatar, BackTop, Badge, Button, Breadcrumb, Card, Calendar, Carousel, Checkbox, Collapse, ColorPicker, Cascader, Comment, ConfigProvider, Descriptions, Divider, Drawer, Dropdown, Empty, Grid, Image, Input, InputNumber, InputTag, Layout, Link, List, Menu, Mention, Modal, Message, Notification, OverflowList, PageHeader, Pagination, Popconfirm, Popover, Progress, Radio, Rate, ResizeBox, Result, Scrollbar, Select, Skeleton, Slider, Space, Split, Statistic, Steps, Spin, Switch, Tag, Timeline, Textarea, TimePicker, Tooltip, Transfer, Trigger, Typography, Tabs, VerificationCode, Watermark, };
139
+ export { Affix, Alert, Anchor, AutoComplete, Avatar, BackTop, Badge, Button, Breadcrumb, Card, Calendar, Carousel, Checkbox, Collapse, ColorPicker, Cascader, Comment, ConfigProvider, Descriptions, Divider, Drawer, Dropdown, Empty, Grid, Image, Input, InputNumber, InputTag, Layout, Link, List, Menu, Mention, Modal, Message, Notification, OverflowList, PageHeader, Pagination, Popconfirm, Popover, Progress, Radio, Rate, ResizeBox, Result, Scrollbar, Select, Skeleton, Slider, Space, Split, Statistic, Steps, Spin, Switch, Tag, Timeline, Textarea, TimePicker, Tooltip, Transfer, Trigger, Typography, Tabs, Upload, VerificationCode, Watermark, };
139
140
  export declare const components: Record<string, Plugin>;
140
141
  declare const YcDesignVue: {
141
142
  AnchorLink: {
package/es/index.js CHANGED
@@ -368,6 +368,7 @@ export {
368
368
  _sfc_main as TypographyParagraph,
369
369
  _sfc_main$2 as TypographyText,
370
370
  _sfc_main$1 as TypographyTitle,
371
+ Upload,
371
372
  VerificationCode,
372
373
  Watermark,
373
374
  components,