@wisemen/vue-core-components 2.0.3 → 2.1.0
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/{AlertCircleIcon-bnMPtwKe.js → AlertCircleIcon-BNlb99bA.js} +1 -1
- package/dist/{AlertTriangleIcon-BhnkdsRk.js → AlertTriangleIcon-C8ySdPwX.js} +1 -1
- package/dist/{ArrowDownIcon-DowzouSz.js → ArrowDownIcon-Bk5-mygo.js} +1 -1
- package/dist/{ArrowLeftIcon-DDn-jL69.js → ArrowLeftIcon-DkUskVGf.js} +1 -1
- package/dist/{ArrowRightIcon-3CxAGQ9b.js → ArrowRightIcon-BKoWv_C7.js} +1 -1
- package/dist/{ArrowUpIcon-9DbNbCxo.js → ArrowUpIcon-VIrXOvRo.js} +1 -1
- package/dist/{CalendarIcon-DbO2vwHJ.js → CalendarIcon-hrRSt8sR.js} +1 -1
- package/dist/{CheckCircleIcon-0cLNJXFH.js → CheckCircleIcon-JiJI0Y6h.js} +1 -1
- package/dist/{CheckIcon-CdjyIp8J.js → CheckIcon-BZlF2Gfu.js} +1 -1
- package/dist/{ChevronLeftDoubleIcon-BI0P9H9B.js → ChevronLeftDoubleIcon-CuTTVdaF.js} +1 -1
- package/dist/{ChevronLeftIcon-Bl5Q68SO.js → ChevronLeftIcon-2WFk3CH5.js} +1 -1
- package/dist/{ChevronRightDoubleIcon-sY_dvZaP.js → ChevronRightDoubleIcon-Bx2oq63a.js} +1 -1
- package/dist/{ChevronRightIcon-BC7JDL0k.js → ChevronRightIcon-CQ3AyYja.js} +1 -1
- package/dist/{CloseIcon-tOlilWzf.js → CloseIcon-CRf6aKA7.js} +1 -1
- package/dist/{EyeIcon-Ii-hjrXi.js → EyeIcon-CCw-bgMC.js} +1 -1
- package/dist/{EyeOffIcon-QszF33Ta.js → EyeOffIcon-BIYZshmn.js} +1 -1
- package/dist/{InfoCircleIcon-DR9EQs91.js → InfoCircleIcon-DMVnLfJ6.js} +1 -1
- package/dist/{MinusIcon-BCjEjcgS.js → MinusIcon-C0kSWXOt.js} +1 -1
- package/dist/{PlusIcon-tiwHZAIS.js → PlusIcon-Dd5SmyG1.js} +1 -1
- package/dist/{SearchIcon-Bzx3TQQn.js → SearchIcon-GJ9pC2Wq.js} +1 -1
- package/dist/{SelectIconRight-hR-saADo.js → SelectIconRight-CRYH153e.js} +1 -1
- package/dist/{StarsIcon-Dk4hOWAk.js → StarsIcon-Cu5g6h49.js} +1 -1
- package/dist/{SwitchVerticalIcon-BSl6IBqG.js → SwitchVerticalIcon-DhS36uHo.js} +1 -1
- package/dist/{TranslateIcon-vjNfwEwX.js → TranslateIcon-C-dyeHrt.js} +1 -1
- package/dist/components/file-upload/fileUpload.context.d.ts +4 -3
- package/dist/components/file-upload/fileUpload.props.d.ts +9 -0
- package/dist/components/file-upload/fileUpload.type.d.ts +5 -0
- package/dist/components/file-upload/parts/FileUploadRoot.d.ts +1 -0
- package/dist/{index-CL76mh_B.js → index-4WMSU2a2.js} +2694 -2682
- package/dist/index.js +1 -1
- package/dist/index.umd +13 -13
- package/package.json +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ComputedRef } from 'vue';
|
|
2
2
|
import { FileUploadProps } from './fileUpload.props';
|
|
3
|
-
import { FileUploadItem } from './fileUpload.type';
|
|
3
|
+
import { FileUploadError, FileUploadItem } from './fileUpload.type';
|
|
4
4
|
import { PropsToComputed } from '../../utils/props.util';
|
|
5
|
-
interface FileUploadContext extends PropsToComputed<FileUploadProps
|
|
5
|
+
interface FileUploadContext extends PropsToComputed<Omit<FileUploadProps, 'preprocess'>> {
|
|
6
6
|
isMultiple: ComputedRef<boolean>;
|
|
7
|
-
|
|
7
|
+
preprocess: ((file: File) => Promise<File>) | null;
|
|
8
|
+
onError: (fileUploadItem: FileUploadItem, error: FileUploadError) => void;
|
|
8
9
|
onFilesSelected: (files: File[]) => void;
|
|
9
10
|
onRemoveFileUploadItem: (fileUploadItem: FileUploadItem) => void;
|
|
10
11
|
onReplaceFileUploadItem: (fileUploadItem: FileUploadItem, file: File) => void;
|
|
@@ -41,6 +41,15 @@ export interface FileUploadProps extends InteractableElement {
|
|
|
41
41
|
* @returns A promise that resolves to a `FileInfo` object containing upload metadata.
|
|
42
42
|
*/
|
|
43
43
|
getFileInfo: (name: string, mimeType: string) => Promise<FileUploadInfo>;
|
|
44
|
+
/**
|
|
45
|
+
* A preprocessing function that transforms a file before upload.
|
|
46
|
+
* This function is called before uploading a file and can be used for operations like
|
|
47
|
+
* image compression, format conversion, or metadata modification.
|
|
48
|
+
* @param file - The file to be preprocessed.
|
|
49
|
+
* @returns A promise that resolves to the transformed file.
|
|
50
|
+
* @default null - No preprocessing is performed.
|
|
51
|
+
*/
|
|
52
|
+
preprocess?: ((file: File) => Promise<File>) | null;
|
|
44
53
|
}
|
|
45
54
|
export interface FileUploadItemProps {
|
|
46
55
|
item: FileUploadItem;
|
|
@@ -24,6 +24,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
|
|
|
24
24
|
}>, {
|
|
25
25
|
isDisabled: boolean;
|
|
26
26
|
isValidFile: ((file: File) => boolean) | null;
|
|
27
|
+
preprocess: ((file: File) => Promise<File>) | null;
|
|
27
28
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
28
29
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
29
30
|
export default _default;
|