@leaflink/stash 44.3.1 → 44.5.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.
@@ -3,219 +3,142 @@ import { ComponentCustomProps } from 'vue';
3
3
  import { ComponentOptionsMixin } from 'vue';
4
4
  import { DefineComponent } from 'vue';
5
5
  import { ExtractPropTypes } from 'vue';
6
+ import { PropType } from 'vue';
6
7
  import { VNodeProps } from 'vue';
7
8
 
8
- declare const _default: DefineComponent<{
9
- files: {
10
- type: ArrayConstructor;
11
- default: () => never[];
12
- };
13
- /**
14
- * The file types accepted by the input
15
- */
16
- fileTypes: {
17
- type: ArrayConstructor;
18
- default: () => string[];
19
- };
20
- /**
21
- * Shows only an upload button
22
- */
23
- buttonOnly: {
24
- type: BooleanConstructor;
25
- default: boolean;
26
- };
27
- /**
28
- * Disables the upload button
29
- */
30
- disabled: {
31
- type: BooleanConstructor;
32
- default: boolean;
33
- };
34
- /**
35
- * When using the drag and drop feature, hide the icon
36
- * and display everything on one line.
37
- */
38
- size: {
39
- type: StringConstructor;
40
- default: string;
41
- validator: (value: unknown) => boolean;
42
- };
43
- }, {
44
- Sizes: Readonly<{
45
- Dense: "dense";
46
- Standard: "standard";
47
- }>;
48
- }, {
49
- isDraggingOver: boolean;
50
- removeText: any;
51
- fileUploadUploadFileText: any;
52
- fileUploadDragDropFileHereText: any;
53
- fileUploadOrText: any;
54
- }, {
55
- inputAttrs(): {
56
- [x: string]: unknown;
57
- };
58
- /**
59
- * @returns {Array} A list of accepted file types
60
- */
61
- acceptedMimeTypes(): any[];
62
- /**
63
- * @returns {Array} A list of accepted file types
64
- */
65
- acceptedFileExtensions(): any[];
66
- fileMeta(): Readonly<{
67
- CSV: {
68
- ACCEPTS: string[];
69
- EXTENSION: string[];
70
- MIME_TYPES: string[];
71
- ILLUSTRATION: string;
72
- };
73
- PDF: {
74
- ACCEPTS: string[];
75
- EXTENSION: string[];
76
- MIME_TYPES: string[];
77
- ILLUSTRATION: string;
78
- };
79
- PNG: {
80
- ACCEPTS: string[];
81
- EXTENSION: string[];
82
- MIME_TYPES: string[];
83
- ILLUSTRATION: string;
84
- };
85
- JPEG: {
86
- ACCEPTS: string[];
87
- EXTENSION: string[];
88
- MIME_TYPES: string[];
89
- ILLUSTRATION: string;
90
- };
91
- DOC: {
92
- ACCEPTS: string[];
93
- EXTENSION: string[];
94
- MIME_TYPES: string[];
95
- ILLUSTRATION: string;
96
- };
97
- XLS: {
98
- ACCEPTS: string[];
99
- EXTENSION: string[];
100
- MIME_TYPES: string[];
101
- ILLUSTRATION: string;
102
- };
103
- }>;
104
- illustrationPath(): string;
105
- }, {
106
- openFileDialog(): void;
107
- /**
108
- * Sets file(s) to selected file(s) from dialogue
109
- * @param {Object} event - file select event that contains file(s)
110
- * @returns {Array} An array of files
111
- */
112
- handleFileInput(event: any): any[];
113
- handleDragEnter(): void;
114
- handleDragLeave(): void;
115
- /**
116
- * Sets file to dropped file if it is proper file type
117
- * @param {Object} event - file select event that contains file
118
- */
119
- handleDropFile(event: any): Promise<void>;
120
- handleFileError(error: any): never;
121
- handleFileDelete(file: any): void;
122
- /**
123
- * Check for the mime type on the uploaded File object
124
- * Otherwise load the file and attempt to read it
125
- * @param file The Uploaded File object
126
- */
127
- readMimeType(file: any): Promise<any>;
128
- flattenArray(a: any, b: any): any;
129
- }, ComponentOptionsMixin, ComponentOptionsMixin, ("file-select" | "file-delete" | "file-error")[], "file-select" | "file-delete" | "file-error", VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
130
- files: {
131
- type: ArrayConstructor;
132
- default: () => never[];
133
- };
134
- /**
135
- * The file types accepted by the input
136
- */
137
- fileTypes: {
138
- type: ArrayConstructor;
139
- default: () => string[];
140
- };
141
- /**
142
- * Shows only an upload button
143
- */
144
- buttonOnly: {
145
- type: BooleanConstructor;
146
- default: boolean;
147
- };
148
- /**
149
- * Disables the upload button
150
- */
151
- disabled: {
152
- type: BooleanConstructor;
153
- default: boolean;
154
- };
155
- /**
156
- * When using the drag and drop feature, hide the icon
157
- * and display everything on one line.
158
- */
159
- size: {
160
- type: StringConstructor;
161
- default: string;
162
- validator: (value: unknown) => boolean;
9
+ declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
10
+
11
+ declare type __VLS_Prettify<T> = {
12
+ [K in keyof T]: T[K];
13
+ } & {};
14
+
15
+ declare type __VLS_TypePropsToRuntimeProps<T> = {
16
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
17
+ type: PropType<__VLS_NonUndefinedable<T[K]>>;
18
+ } : {
19
+ type: PropType<T[K]>;
20
+ required: true;
21
+ };
22
+ };
23
+
24
+ declare type __VLS_WithDefaults<P, D> = {
25
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
26
+ default: D[K];
27
+ }> : P[K];
28
+ };
29
+
30
+ declare type __VLS_WithTemplateSlots<T, S> = T & {
31
+ new (): {
32
+ $slots: S;
163
33
  };
164
- }>> & {
165
- "onFile-select"?: ((...args: any[]) => any) | undefined;
166
- "onFile-delete"?: ((...args: any[]) => any) | undefined;
167
- "onFile-error"?: ((...args: any[]) => any) | undefined;
168
- }, {
34
+ };
35
+
36
+ declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FileUploadProps>, {
37
+ files: () => never[];
38
+ fileTypes: () => string[];
39
+ buttonOnly: boolean;
40
+ disabled: boolean;
41
+ multiple: boolean;
169
42
  size: string;
43
+ }>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
44
+ "file-select": (args_0: {
45
+ files: FileUploadProps['files'];
46
+ }) => void;
47
+ "file-delete": (file: File) => void;
48
+ "file-error": (message: string) => void;
49
+ }, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FileUploadProps>, {
50
+ files: () => never[];
51
+ fileTypes: () => string[];
52
+ buttonOnly: boolean;
170
53
  disabled: boolean;
171
- files: unknown[];
172
- fileTypes: unknown[];
54
+ multiple: boolean;
55
+ size: string;
56
+ }>>> & {
57
+ "onFile-select"?: ((args_0: {
58
+ files: FileUploadProps['files'];
59
+ }) => any) | undefined;
60
+ "onFile-delete"?: ((file: File) => any) | undefined;
61
+ "onFile-error"?: ((message: string) => any) | undefined;
62
+ }, {
63
+ size: "standard" | "dense";
64
+ disabled: boolean;
65
+ files: File[];
66
+ multiple: boolean;
67
+ fileTypes: FileType[];
173
68
  buttonOnly: boolean;
174
- }, {}>;
69
+ }, {}>, {
70
+ submitText?(_: {}): any;
71
+ hint?(_: {}): any;
72
+ }>;
175
73
  export default _default;
176
74
 
177
- export declare const FILE_TYPES: Readonly<{
75
+ export declare const FILE_TYPES: {
178
76
  CSV: {
179
- ACCEPTS: string[];
180
77
  EXTENSION: string[];
181
78
  MIME_TYPES: string[];
182
79
  ILLUSTRATION: string;
183
80
  };
184
81
  PDF: {
185
- ACCEPTS: string[];
186
82
  EXTENSION: string[];
187
83
  MIME_TYPES: string[];
188
84
  ILLUSTRATION: string;
189
85
  };
190
86
  PNG: {
191
- ACCEPTS: string[];
192
87
  EXTENSION: string[];
193
88
  MIME_TYPES: string[];
194
89
  ILLUSTRATION: string;
195
90
  };
196
91
  JPEG: {
197
- ACCEPTS: string[];
198
92
  EXTENSION: string[];
199
93
  MIME_TYPES: string[];
200
94
  ILLUSTRATION: string;
201
95
  };
202
96
  DOC: {
203
- ACCEPTS: string[];
204
97
  EXTENSION: string[];
205
98
  MIME_TYPES: string[];
206
99
  ILLUSTRATION: string;
207
100
  };
208
101
  XLS: {
209
- ACCEPTS: string[];
210
102
  EXTENSION: string[];
211
103
  MIME_TYPES: string[];
212
104
  ILLUSTRATION: string;
213
105
  };
214
- }>;
106
+ };
215
107
 
216
- export declare const Sizes: Readonly<{
217
- Dense: "dense";
218
- Standard: "standard";
219
- }>;
108
+ export declare type FileType = 'CSV' | 'PDF' | 'PNG' | 'JPEG' | 'DOC' | 'XLS';
109
+
110
+ export declare interface FileUploadProps {
111
+ /**
112
+ * Files to display in the component
113
+ */
114
+ files?: File[];
115
+ /**
116
+ * Accepted file types
117
+ */
118
+ fileTypes?: FileType[];
119
+ /**
120
+ * Should display only the button
121
+ */
122
+ buttonOnly?: boolean;
123
+ /**
124
+ * Allows upload of multiple files
125
+ */
126
+ multiple?: boolean;
127
+ /**
128
+ * Is the input disabled
129
+ */
130
+ disabled?: boolean;
131
+ /**
132
+ * Component size
133
+ */
134
+ size?: FileUploadSize;
135
+ }
136
+
137
+ export declare type FileUploadSize = `${FileUploadSizes}`;
138
+
139
+ export declare enum FileUploadSizes {
140
+ Dense = "dense",
141
+ Standard = "standard"
142
+ }
220
143
 
221
144
  export { }