voiptime-components 1.12.22 → 1.12.24
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.cjs.js +39 -1
- package/dist/index.d.ts +56 -1
- package/dist/index.es.js +25566 -4579
- package/dist/index.umd.js +39 -1
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -864,6 +864,14 @@ export declare interface FieldValidation {
|
|
|
864
864
|
$validate(): Promise<boolean>;
|
|
865
865
|
}
|
|
866
866
|
|
|
867
|
+
export declare class FileParser {
|
|
868
|
+
static isDataFile(file: File): boolean;
|
|
869
|
+
static parseFile(file: File, maxRows?: number, returnData?: boolean): Promise<ParseResult>;
|
|
870
|
+
private static parseCSV;
|
|
871
|
+
private static parseCSVLine;
|
|
872
|
+
private static parseExcel;
|
|
873
|
+
}
|
|
874
|
+
|
|
867
875
|
export declare class FileValidator {
|
|
868
876
|
static validateSize(file: File, maxSize?: number): boolean;
|
|
869
877
|
static validateType(file: File, accept?: string): boolean;
|
|
@@ -1121,6 +1129,13 @@ export declare interface PaginationState {
|
|
|
1121
1129
|
toItem: number;
|
|
1122
1130
|
}
|
|
1123
1131
|
|
|
1132
|
+
export declare interface ParseResult {
|
|
1133
|
+
sheets: SheetParseResult[];
|
|
1134
|
+
rows: number;
|
|
1135
|
+
columns: string[];
|
|
1136
|
+
data?: any[];
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1124
1139
|
export declare const parseTimeString: (timeStr: string) => TimeObject | null;
|
|
1125
1140
|
|
|
1126
1141
|
export declare const phoneNumber: ValidatorFn;
|
|
@@ -1160,6 +1175,13 @@ export declare interface SelectionChangeEventData {
|
|
|
1160
1175
|
isAllSelected?: boolean;
|
|
1161
1176
|
}
|
|
1162
1177
|
|
|
1178
|
+
export declare interface SheetParseResult {
|
|
1179
|
+
name: string;
|
|
1180
|
+
rows: number;
|
|
1181
|
+
columns: string[];
|
|
1182
|
+
data?: any[];
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1163
1185
|
export declare interface SortChangeEventData {
|
|
1164
1186
|
column: VTableColumnProps;
|
|
1165
1187
|
direction: SortDirection | null;
|
|
@@ -1205,7 +1227,7 @@ export declare type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
|
1205
1227
|
export declare const uniqueAsync: (checkFn: (val: any) => Promise<boolean>, message?: string) => ValidatorFn;
|
|
1206
1228
|
|
|
1207
1229
|
export declare interface UploadError {
|
|
1208
|
-
type: 'size' | 'type' | 'count';
|
|
1230
|
+
type: 'size' | 'type' | 'count' | 'parse';
|
|
1209
1231
|
message: string;
|
|
1210
1232
|
file?: File;
|
|
1211
1233
|
}
|
|
@@ -2183,22 +2205,43 @@ export declare const VUpload: DefineComponent<VUploadProps, {}, {}, {}, {}, Comp
|
|
|
2183
2205
|
"update:modelValue": (files: UploadFile[]) => any;
|
|
2184
2206
|
remove: (file: UploadFile) => any;
|
|
2185
2207
|
exceed: (files: File[]) => any;
|
|
2208
|
+
parse: (result: {
|
|
2209
|
+
file: UploadFile;
|
|
2210
|
+
result: ParseResult;
|
|
2211
|
+
}) => any;
|
|
2212
|
+
rowsExceed: (data: {
|
|
2213
|
+
file: UploadFile;
|
|
2214
|
+
rows: number;
|
|
2215
|
+
maxRows: number;
|
|
2216
|
+
}) => any;
|
|
2186
2217
|
}, string, PublicProps, Readonly<VUploadProps> & Readonly<{
|
|
2187
2218
|
onChange?: ((files: UploadFile[]) => any) | undefined;
|
|
2188
2219
|
onError?: ((error: UploadError) => any) | undefined;
|
|
2189
2220
|
"onUpdate:modelValue"?: ((files: UploadFile[]) => any) | undefined;
|
|
2190
2221
|
onRemove?: ((file: UploadFile) => any) | undefined;
|
|
2191
2222
|
onExceed?: ((files: File[]) => any) | undefined;
|
|
2223
|
+
onParse?: ((result: {
|
|
2224
|
+
file: UploadFile;
|
|
2225
|
+
result: ParseResult;
|
|
2226
|
+
}) => any) | undefined;
|
|
2227
|
+
onRowsExceed?: ((data: {
|
|
2228
|
+
file: UploadFile;
|
|
2229
|
+
rows: number;
|
|
2230
|
+
maxRows: number;
|
|
2231
|
+
}) => any) | undefined;
|
|
2192
2232
|
}>, {
|
|
2193
2233
|
type: "drag" | "button";
|
|
2194
2234
|
disabled: boolean;
|
|
2195
2235
|
modelValue: UploadFile[];
|
|
2196
2236
|
placeholder: string;
|
|
2237
|
+
maxRows: number;
|
|
2197
2238
|
multiple: boolean;
|
|
2198
2239
|
accept: string;
|
|
2199
2240
|
maxSize: number;
|
|
2200
2241
|
maxFiles: number;
|
|
2201
2242
|
tip: string;
|
|
2243
|
+
parseFiles: boolean;
|
|
2244
|
+
returnData: boolean;
|
|
2202
2245
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
2203
2246
|
fileInputRef: HTMLInputElement;
|
|
2204
2247
|
}, HTMLDivElement>;
|
|
@@ -2209,6 +2252,15 @@ export declare interface VUploadEmits {
|
|
|
2209
2252
|
(e: 'remove', file: UploadFile): void;
|
|
2210
2253
|
(e: 'exceed', files: File[]): void;
|
|
2211
2254
|
(e: 'error', error: UploadError): void;
|
|
2255
|
+
(e: 'parse', result: {
|
|
2256
|
+
file: UploadFile;
|
|
2257
|
+
result: ParseResult;
|
|
2258
|
+
}): void;
|
|
2259
|
+
(e: 'rowsExceed', data: {
|
|
2260
|
+
file: UploadFile;
|
|
2261
|
+
rows: number;
|
|
2262
|
+
maxRows: number;
|
|
2263
|
+
}): void;
|
|
2212
2264
|
}
|
|
2213
2265
|
|
|
2214
2266
|
export declare interface VUploadProps {
|
|
@@ -2216,11 +2268,14 @@ export declare interface VUploadProps {
|
|
|
2216
2268
|
accept?: string;
|
|
2217
2269
|
maxSize?: number;
|
|
2218
2270
|
maxFiles?: number;
|
|
2271
|
+
maxRows?: number;
|
|
2219
2272
|
multiple?: boolean;
|
|
2220
2273
|
type?: 'drag' | 'button';
|
|
2221
2274
|
disabled?: boolean;
|
|
2222
2275
|
placeholder?: string;
|
|
2223
2276
|
tip?: string;
|
|
2277
|
+
parseFiles?: boolean;
|
|
2278
|
+
returnData?: boolean;
|
|
2224
2279
|
}
|
|
2225
2280
|
|
|
2226
2281
|
export declare const WEEKDAY_NAMES: string[];
|