voiptime-components 1.11.9 → 1.12.1

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/index.d.ts CHANGED
@@ -857,6 +857,13 @@ export declare interface FieldValidation {
857
857
  $validate(): Promise<boolean>;
858
858
  }
859
859
 
860
+ export declare class FileValidator {
861
+ static validateSize(file: File, maxSize?: number): boolean;
862
+ static validateType(file: File, accept?: string): boolean;
863
+ static formatFileSize(bytes: number): string;
864
+ static generateId(): string;
865
+ }
866
+
860
867
  export declare const FORMAT_TOKENS: Record<string, FormatToken>;
861
868
 
862
869
  export declare const formatTime: (hour: number, minute: number, second?: number, format?: string, use12Hours?: boolean) => string;
@@ -894,6 +901,7 @@ declare const icons: {
894
901
  readonly star: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, SVGSVGElement>;
895
902
  readonly statusChange2: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, SVGSVGElement>;
896
903
  readonly statusChange: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, SVGSVGElement>;
904
+ readonly uploadCloud: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, SVGSVGElement>;
897
905
  readonly usersGroup: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, SVGSVGElement>;
898
906
  readonly arrowDown: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, SVGSVGElement>;
899
907
  readonly arrowLeft: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, SVGSVGElement>;
@@ -1144,6 +1152,23 @@ export declare type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
1144
1152
 
1145
1153
  export declare const uniqueAsync: (checkFn: (val: any) => Promise<boolean>, message?: string) => ValidatorFn;
1146
1154
 
1155
+ export declare interface UploadError {
1156
+ type: 'size' | 'type' | 'count';
1157
+ message: string;
1158
+ file?: File;
1159
+ }
1160
+
1161
+ export declare interface UploadFile {
1162
+ id: string;
1163
+ file: File;
1164
+ name: string;
1165
+ size: number;
1166
+ type: string;
1167
+ status: 'pending' | 'uploading' | 'success' | 'error';
1168
+ progress?: number;
1169
+ error?: string;
1170
+ }
1171
+
1147
1172
  /**
1148
1173
  * Build validation tree recursively
1149
1174
  */
@@ -2108,6 +2133,52 @@ export declare interface VUIPluginOptions {
2108
2133
  message?: boolean;
2109
2134
  }
2110
2135
 
2136
+ export declare const VUpload: DefineComponent<VUploadProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
2137
+ change: (files: UploadFile[]) => any;
2138
+ error: (error: UploadError) => any;
2139
+ "update:modelValue": (files: UploadFile[]) => any;
2140
+ remove: (file: UploadFile) => any;
2141
+ exceed: (files: File[]) => any;
2142
+ }, string, PublicProps, Readonly<VUploadProps> & Readonly<{
2143
+ onChange?: ((files: UploadFile[]) => any) | undefined;
2144
+ onError?: ((error: UploadError) => any) | undefined;
2145
+ "onUpdate:modelValue"?: ((files: UploadFile[]) => any) | undefined;
2146
+ onRemove?: ((file: UploadFile) => any) | undefined;
2147
+ onExceed?: ((files: File[]) => any) | undefined;
2148
+ }>, {
2149
+ type: "drag" | "button";
2150
+ disabled: boolean;
2151
+ modelValue: UploadFile[];
2152
+ placeholder: string;
2153
+ multiple: boolean;
2154
+ accept: string;
2155
+ maxSize: number;
2156
+ maxFiles: number;
2157
+ tip: string;
2158
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {
2159
+ fileInputRef: HTMLInputElement;
2160
+ }, HTMLDivElement>;
2161
+
2162
+ export declare interface VUploadEmits {
2163
+ (e: 'update:modelValue', files: UploadFile[]): void;
2164
+ (e: 'change', files: UploadFile[]): void;
2165
+ (e: 'remove', file: UploadFile): void;
2166
+ (e: 'exceed', files: File[]): void;
2167
+ (e: 'error', error: UploadError): void;
2168
+ }
2169
+
2170
+ export declare interface VUploadProps {
2171
+ modelValue?: UploadFile[];
2172
+ accept?: string;
2173
+ maxSize?: number;
2174
+ maxFiles?: number;
2175
+ multiple?: boolean;
2176
+ type?: 'drag' | 'button';
2177
+ disabled?: boolean;
2178
+ placeholder?: string;
2179
+ tip?: string;
2180
+ }
2181
+
2111
2182
  export declare const WEEKDAY_NAMES: string[];
2112
2183
 
2113
2184
  export declare const WEEKDAY_NAMES_SHORT: string[];