@praxisui/files-upload 0.0.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/index.d.ts ADDED
@@ -0,0 +1,629 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, OnDestroy, NgZone, OnInit, AfterViewInit, EventEmitter, ViewContainerRef, ChangeDetectorRef, DestroyRef, Provider } from '@angular/core';
3
+ import { FormControl, ValidatorFn, FormGroup, FormBuilder } from '@angular/forms';
4
+ import { ConfigStorage, ComponentDocMeta } from '@praxisui/core';
5
+ import { SettingsPanelService, SettingsValueProvider } from '@praxisui/settings-panel';
6
+ import { HttpClient, HttpEvent, HttpHeaders } from '@angular/common/http';
7
+ import { Observable, BehaviorSubject } from 'rxjs';
8
+ import { Overlay } from '@angular/cdk/overlay';
9
+ import { SimpleBaseInputComponent } from '@praxisui/dynamic-fields';
10
+ import { MatSnackBar } from '@angular/material/snack-bar';
11
+
12
+ interface FilesUploadConfig {
13
+ strategy?: 'direct' | 'presign' | 'auto';
14
+ ui?: {
15
+ showDropzone?: boolean;
16
+ accept?: string[];
17
+ dense?: boolean;
18
+ showConflictPolicySelector?: boolean;
19
+ showMetadataForm?: boolean;
20
+ showProgress?: boolean;
21
+ manualUpload?: boolean;
22
+ dropzone?: {
23
+ /** Expande a dropzone ao aproximar arquivo durante drag (desktop). */
24
+ expandOnDragProximity?: boolean;
25
+ /** Raio de proximidade, em pixels, ao redor do campo. */
26
+ proximityPx?: number;
27
+ /** Modo de expansão da zona: overlay (preferido) ou inline. */
28
+ expandMode?: 'overlay' | 'inline';
29
+ /** Altura do overlay expandido (px). */
30
+ expandHeight?: number;
31
+ /** Debounce para eventos de drag (ms). */
32
+ expandDebounceMs?: number;
33
+ };
34
+ list?: {
35
+ /** Número de itens visíveis antes de colapsar. */
36
+ collapseAfter?: number;
37
+ /** Modo de apresentação do card de detalhes. */
38
+ detailsMode?: 'card' | 'sidesheet' | 'auto';
39
+ /** Largura máxima do card (px). */
40
+ detailsMaxWidth?: number;
41
+ /** Exibir seção técnica (HTTP/logs) por padrão. */
42
+ detailsShowTechnical?: boolean;
43
+ /** Whitelist de campos de metadados a exibir (vazio = todos). */
44
+ detailsFields?: string[];
45
+ /** Âncora do overlay de detalhes. */
46
+ detailsAnchor?: 'item' | 'field';
47
+ };
48
+ };
49
+ limits?: {
50
+ maxFileSizeBytes?: number;
51
+ maxFilesPerBulk?: number;
52
+ maxBulkSizeBytes?: number;
53
+ defaultConflictPolicy?: 'ERROR' | 'SKIP' | 'OVERWRITE' | 'MAKE_UNIQUE' | 'RENAME';
54
+ failFast?: boolean;
55
+ strictValidation?: boolean;
56
+ maxUploadSizeMb?: number;
57
+ };
58
+ options?: {
59
+ allowedExtensions?: string[];
60
+ acceptMimeTypes?: string[];
61
+ targetDirectory?: string;
62
+ enableVirusScanning?: boolean;
63
+ };
64
+ bulk?: {
65
+ parallelUploads?: number;
66
+ retryCount?: number;
67
+ retryBackoffMs?: number;
68
+ };
69
+ quotas?: {
70
+ showQuotaWarnings?: boolean;
71
+ blockOnExceed?: boolean;
72
+ };
73
+ rateLimit?: {
74
+ autoRetryOn429?: boolean;
75
+ showBannerOn429?: boolean;
76
+ maxAutoRetry?: number;
77
+ baseBackoffMs?: number;
78
+ };
79
+ headers?: {
80
+ tenantHeader?: string;
81
+ userHeader?: string;
82
+ };
83
+ messages?: {
84
+ successSingle?: string;
85
+ successBulk?: string;
86
+ errors?: Record<string, string>;
87
+ };
88
+ }
89
+
90
+ /** Standard error response shape. */
91
+ interface ErrorResponse {
92
+ /** Machine-readable error code (backend-defined). */
93
+ code: string;
94
+ /** Human-readable error message. */
95
+ message: string;
96
+ /** Optional details useful for debugging. */
97
+ details?: unknown;
98
+ /** Correlation identifier for tracing. */
99
+ traceId?: string;
100
+ }
101
+
102
+ declare enum ScanStatus {
103
+ PENDING = "PENDING",
104
+ SCANNING = "SCANNING",
105
+ CLEAN = "CLEAN",
106
+ INFECTED = "INFECTED",
107
+ FAILED = "FAILED"
108
+ }
109
+
110
+ /** Metadata describing an uploaded file. */
111
+ interface FileMetadata {
112
+ /** Server-generated identifier. */
113
+ id: string;
114
+ /** Original filename. */
115
+ fileName: string;
116
+ /** MIME type as reported or detected. */
117
+ contentType: string;
118
+ /** Size of the file in bytes. */
119
+ fileSize: number;
120
+ /** Upload timestamp in ISO 8601 format. */
121
+ uploadedAt: string;
122
+ /** Tenant responsible for the upload. */
123
+ tenantId: string;
124
+ /** Result of antivirus scan. */
125
+ scanStatus: ScanStatus;
126
+ /** Additional metadata provided during upload. */
127
+ metadata?: Record<string, unknown>;
128
+ }
129
+
130
+ /** Result status for each file in a bulk upload operation. */
131
+ declare enum BulkUploadResultStatus {
132
+ SUCCESS = "SUCCESS",
133
+ FAILED = "FAILED"
134
+ }
135
+
136
+ /** Response returned after successful single file upload. */
137
+ interface UploadResponse {
138
+ file: FileMetadata;
139
+ }
140
+ /** Result for a single file in the bulk upload response. */
141
+ interface BulkUploadFileResult {
142
+ /** Original filename. */
143
+ fileName: string;
144
+ /** Resulting status for this file. */
145
+ status: BulkUploadResultStatus;
146
+ /** Metadata returned when the file succeeds. */
147
+ file?: FileMetadata;
148
+ /** Error information when the file fails. */
149
+ error?: ErrorResponse;
150
+ }
151
+ /** Response payload for bulk upload. */
152
+ interface BulkUploadResponse {
153
+ results: BulkUploadFileResult[];
154
+ stats: {
155
+ total: number;
156
+ succeeded: number;
157
+ failed: number;
158
+ };
159
+ }
160
+
161
+ declare enum ErrorCode {
162
+ INVALID_FILE_TYPE = "INVALID_FILE_TYPE",
163
+ FILE_TOO_LARGE = "FILE_TOO_LARGE",
164
+ NOT_FOUND = "NOT_FOUND",
165
+ UNAUTHORIZED = "UNAUTHORIZED",
166
+ RATE_LIMIT_EXCEEDED = "RATE_LIMIT_EXCEEDED",
167
+ INTERNAL_ERROR = "INTERNAL_ERROR",
168
+ QUOTA_EXCEEDED = "QUOTA_EXCEEDED",
169
+ SEC_VIRUS_DETECTED = "SEC_VIRUS_DETECTED",
170
+ SEC_MALICIOUS_CONTENT = "SEC_MALICIOUS_CONTENT",
171
+ SEC_DANGEROUS_TYPE = "SEC_DANGEROUS_TYPE",
172
+ FMT_MAGIC_MISMATCH = "FMT_MAGIC_MISMATCH",
173
+ FMT_CORRUPTED = "FMT_CORRUPTED",
174
+ FMT_UNSUPPORTED = "FMT_UNSUPPORTED",
175
+ SYS_STORAGE_ERROR = "SYS_STORAGE_ERROR",
176
+ SYS_SERVICE_DOWN = "SYS_SERVICE_DOWN",
177
+ SYS_RATE_LIMIT = "SYS_RATE_LIMIT"
178
+ }
179
+
180
+ /** Options governing server-side upload behavior. */
181
+ interface FileUploadOptions {
182
+ nameConflictPolicy: string;
183
+ strictValidation: boolean;
184
+ maxUploadSizeMb: number;
185
+ allowedExtensions: string[];
186
+ acceptMimeTypes: string[];
187
+ targetDirectory?: string | null;
188
+ enableVirusScanning: boolean;
189
+ customMetadata?: Record<string, unknown>;
190
+ failFastMode: boolean;
191
+ }
192
+ /** Configuration for bulk uploads. */
193
+ interface BulkConfig {
194
+ failFastModeDefault: boolean;
195
+ maxFilesPerBatch: number;
196
+ maxConcurrentUploads: number;
197
+ }
198
+ /** Rate limiting rules. */
199
+ interface RateLimitConfig {
200
+ enabled: boolean;
201
+ perMinute?: number;
202
+ perHour?: number;
203
+ }
204
+ /** Quota enforcement configuration. */
205
+ interface QuotasConfig {
206
+ enabled: boolean;
207
+ tenantMaxPerDay?: number;
208
+ userMaxPerDay?: number;
209
+ }
210
+ /** Map of server-provided message codes to friendly messages. */
211
+ type ServerMessages = Record<string, string>;
212
+ /** Additional metadata returned by the server. */
213
+ interface Metadata {
214
+ version: string;
215
+ locale: string;
216
+ }
217
+ /** Effective upload configuration provided by the backend. */
218
+ interface EffectiveUploadConfig {
219
+ options: FileUploadOptions;
220
+ bulk: BulkConfig;
221
+ rateLimit: RateLimitConfig;
222
+ quotas: QuotasConfig;
223
+ messages: ServerMessages;
224
+ metadata: Metadata;
225
+ }
226
+
227
+ interface PresignResponse {
228
+ uploadUrl: string;
229
+ headers?: Record<string, string>;
230
+ fields?: Record<string, string>;
231
+ }
232
+ /**
233
+ * Options for a single file upload.
234
+ */
235
+ interface UploadOptions {
236
+ /** Backend options JSON (FileUploadOptionsRecord), enviado no campo 'options'. */
237
+ optionsJson?: string;
238
+ /** Metadados por arquivo (serializado em 'metadata'). */
239
+ metadata?: Record<string, unknown>;
240
+ /** Política de conflito (serializada em 'conflictPolicy'). */
241
+ conflictPolicy?: string;
242
+ /** Número de tentativas de retry. */
243
+ retryCount?: number;
244
+ }
245
+ /**
246
+ * Represents a file for bulk uploads.
247
+ */
248
+ interface BulkUploadFile {
249
+ file: File;
250
+ metadata?: Record<string, unknown>;
251
+ conflictPolicy?: string;
252
+ }
253
+ /**
254
+ * Options applied to a bulk upload request.
255
+ */
256
+ interface BulkUploadOptions {
257
+ /** Backend options JSON (FileUploadOptionsRecord), enviado no campo 'options'. */
258
+ optionsJson?: string;
259
+ /** failFast (alias de failFastMode) conforme backend. */
260
+ failFast?: boolean;
261
+ /** failFastMode legado. */
262
+ failFastMode?: boolean;
263
+ /** Número de tentativas de retry. */
264
+ retryCount?: number;
265
+ }
266
+ declare class FilesApiClient {
267
+ private readonly http;
268
+ constructor(http: HttpClient);
269
+ /**
270
+ * Upload a single file com metadata/conflictPolicy (compat) e/ou options JSON.
271
+ */
272
+ upload(baseUrl: string, file: File, options?: UploadOptions): Observable<HttpEvent<unknown>>;
273
+ /**
274
+ * Upload múltiplo com arrays de metadata/conflictPolicy (compat) e/ou options JSON.
275
+ */
276
+ bulkUpload(baseUrl: string, files: BulkUploadFile[], options?: BulkUploadOptions): Observable<HttpEvent<unknown>>;
277
+ presign(baseUrl: string, fileName: string): Observable<PresignResponse>;
278
+ static ɵfac: i0.ɵɵFactoryDeclaration<FilesApiClient, never>;
279
+ static ɵprov: i0.ɵɵInjectableDeclaration<FilesApiClient>;
280
+ }
281
+
282
+ declare class PresignedUploaderService {
283
+ private readonly http;
284
+ constructor(http: HttpClient);
285
+ /**
286
+ * Uploads a file to a presigned URL and retries when configured.
287
+ */
288
+ upload(target: PresignResponse, file: File, retryCount?: number): Observable<HttpEvent<unknown>>;
289
+ static ɵfac: i0.ɵɵFactoryDeclaration<PresignedUploaderService, never>;
290
+ static ɵprov: i0.ɵɵInjectableDeclaration<PresignedUploaderService>;
291
+ }
292
+
293
+ interface RateLimitInfo {
294
+ limit: number;
295
+ remaining: number;
296
+ resetEpochSeconds: number;
297
+ }
298
+ interface MappedError {
299
+ message: string;
300
+ rateLimit?: RateLimitInfo;
301
+ title?: string;
302
+ severity?: 'info' | 'warn' | 'error';
303
+ category?: string;
304
+ phase?: string;
305
+ userAction?: string;
306
+ }
307
+ interface TranslateLike {
308
+ instant(key: string): string;
309
+ }
310
+ declare const TRANSLATE_LIKE: InjectionToken<TranslateLike>;
311
+ declare const FILES_UPLOAD_ERROR_MESSAGES: InjectionToken<Partial<Record<string, string>>>;
312
+ declare class ErrorMapperService {
313
+ private readonly customMessages?;
314
+ private readonly translate?;
315
+ constructor(customMessages?: Partial<Record<string, string>> | undefined, translate?: TranslateLike | undefined);
316
+ map(error: ErrorResponse, headers?: HttpHeaders): MappedError;
317
+ static ɵfac: i0.ɵɵFactoryDeclaration<ErrorMapperService, [{ optional: true; }, { optional: true; }]>;
318
+ static ɵprov: i0.ɵɵInjectableDeclaration<ErrorMapperService>;
319
+ }
320
+
321
+ interface FilesUploadTexts {
322
+ settingsAriaLabel: string;
323
+ dropzoneLabel: string;
324
+ dropzoneButton: string;
325
+ conflictPolicyLabel: string;
326
+ metadataLabel: string;
327
+ progressAriaLabel: string;
328
+ rateLimitBanner: string;
329
+ }
330
+ declare const FILES_UPLOAD_TEXTS: InjectionToken<FilesUploadTexts>;
331
+
332
+ interface DragPointer {
333
+ x: number;
334
+ y: number;
335
+ }
336
+ declare class DragProximityService implements OnDestroy {
337
+ private zone;
338
+ private draggingWithFiles$;
339
+ private pointer$;
340
+ private dragCounter;
341
+ constructor(zone: NgZone);
342
+ ngOnDestroy(): void;
343
+ isDraggingWithFiles(): Observable<boolean>;
344
+ pointer(): Observable<DragPointer>;
345
+ withinProximity(rect: DOMRect, proximityPx: number, pt?: DragPointer | null): boolean;
346
+ private onDragEnter;
347
+ private onDragLeave;
348
+ private onDragOver;
349
+ private onDrop;
350
+ static ɵfac: i0.ɵɵFactoryDeclaration<DragProximityService, never>;
351
+ static ɵprov: i0.ɵɵInjectableDeclaration<DragProximityService>;
352
+ }
353
+
354
+ declare class PraxisFilesUpload implements OnInit, AfterViewInit, OnDestroy {
355
+ private settingsPanel;
356
+ private dragProx;
357
+ private defaultTexts;
358
+ private overlay;
359
+ private viewContainerRef;
360
+ private cdr;
361
+ private api?;
362
+ private presign?;
363
+ private errors?;
364
+ private translate?;
365
+ private configStorage?;
366
+ config: FilesUploadConfig | null;
367
+ componentId: string;
368
+ baseUrl?: string;
369
+ displayMode: 'full' | 'compact';
370
+ uploadSuccess: EventEmitter<{
371
+ file: FileMetadata;
372
+ }>;
373
+ bulkComplete: EventEmitter<BulkUploadResponse>;
374
+ error: EventEmitter<ErrorResponse>;
375
+ rateLimited: EventEmitter<RateLimitInfo>;
376
+ retry: EventEmitter<BulkUploadFileResult>;
377
+ download: EventEmitter<BulkUploadFileResult>;
378
+ copyLink: EventEmitter<BulkUploadFileResult>;
379
+ detailsOpened: EventEmitter<BulkUploadFileResult>;
380
+ detailsClosed: EventEmitter<BulkUploadFileResult>;
381
+ pendingFilesChange: EventEmitter<File[]>;
382
+ proximityChange: EventEmitter<boolean>;
383
+ private fileInput?;
384
+ private hostRef?;
385
+ private overlayTmpl?;
386
+ private selectedOverlayTmpl?;
387
+ conflictPolicies: Array<'ERROR' | 'SKIP' | 'OVERWRITE' | 'MAKE_UNIQUE' | 'RENAME'>;
388
+ conflictPolicy: FormControl<string | null>;
389
+ uploadProgress: number;
390
+ allowMultiple: boolean;
391
+ rateLimit: RateLimitInfo | null;
392
+ quotaExceeded: boolean;
393
+ errorMessage: string;
394
+ acceptString: string;
395
+ metadata: FormControl<string | null>;
396
+ uploadedFiles: Array<{
397
+ fileName: string;
398
+ success: boolean;
399
+ }>;
400
+ texts: FilesUploadTexts;
401
+ lastResults: BulkUploadFileResult[] | null;
402
+ lastStats: {
403
+ total: number;
404
+ succeeded: number;
405
+ failed: number;
406
+ } | null;
407
+ BulkUploadResultStatus: typeof BulkUploadResultStatus;
408
+ private uploading;
409
+ isDragging: boolean;
410
+ private currentFiles;
411
+ private serverEffective?;
412
+ showProximityOverlay: boolean;
413
+ private proxSub?;
414
+ private proxPtrSub?;
415
+ private hostRect?;
416
+ private draggingFiles;
417
+ private overlayRef?;
418
+ private escListener;
419
+ private windowDropListener;
420
+ private windowDragEndListener;
421
+ private selectedOverlayRef?;
422
+ showAllResults: boolean;
423
+ constructor(settingsPanel: SettingsPanelService, dragProx: DragProximityService, defaultTexts: FilesUploadTexts, overlay: Overlay, viewContainerRef: ViewContainerRef, cdr: ChangeDetectorRef, api?: FilesApiClient | undefined, presign?: PresignedUploaderService | undefined, errors?: ErrorMapperService | undefined, translate?: TranslateLike | undefined, configStorage?: ConfigStorage | undefined);
424
+ get showProgress(): boolean;
425
+ get isUploading(): boolean;
426
+ get hasUploadedFiles(): boolean;
427
+ get pendingFiles(): File[];
428
+ get pendingCount(): number;
429
+ get hasLastResults(): boolean;
430
+ openFile(input: HTMLInputElement): void;
431
+ triggerSelect(): void;
432
+ displayFileName(f: any): string;
433
+ formatBytes(bytes: number | undefined | null): string;
434
+ mapErrorFull(err: unknown): any;
435
+ get metadataError(): string | null;
436
+ ngOnInit(): void;
437
+ ngAfterViewInit(): void;
438
+ ngOnDestroy(): void;
439
+ private updateHostRect;
440
+ private evalProximity;
441
+ private manageOverlay;
442
+ private ensureOverlay;
443
+ private syncOverlayGeometry;
444
+ private disposeOverlay;
445
+ private manageSelectedOverlay;
446
+ private ensureSelectedOverlay;
447
+ private syncSelectedOverlayGeometry;
448
+ private hideSelectedOverlay;
449
+ private disposeSelectedOverlay;
450
+ private hideProximityOverlay;
451
+ private resolveTexts;
452
+ t(key: string, fallback: string): string;
453
+ openSettings(): void;
454
+ private applyConfig;
455
+ private loadLocalConfig;
456
+ private saveLocalConfig;
457
+ onDragOver(evt: DragEvent): void;
458
+ onDragLeave(_evt: DragEvent): void;
459
+ onDrop(evt: DragEvent): void;
460
+ onFilesSelected(evt: Event): void;
461
+ triggerUpload(): void;
462
+ clearSelection(): void;
463
+ removePendingFile(file: File): void;
464
+ private startUpload;
465
+ private directUpload;
466
+ private buildOptionsJson;
467
+ private handleProgress;
468
+ private handleError;
469
+ private finishUpload;
470
+ get visibleResults(): BulkUploadFileResult[];
471
+ private fileToBulkUploadFileResult;
472
+ onRetry(file: File | BulkUploadFileResult): void;
473
+ onDownload(file: File | BulkUploadFileResult): void;
474
+ onCopyLink(file: File | BulkUploadFileResult): void;
475
+ removeResult(item: BulkUploadFileResult): void;
476
+ toggleDetailsFor(item: BulkUploadFileResult): void;
477
+ onDetailsToggle(ev: Event, item: BulkUploadFileResult): void;
478
+ private validateFiles;
479
+ get policiesSummary(): string;
480
+ static ɵfac: i0.ɵɵFactoryDeclaration<PraxisFilesUpload, [null, null, null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>;
481
+ static ɵcmp: i0.ɵɵComponentDeclaration<PraxisFilesUpload, "praxis-files-upload", never, { "config": { "alias": "config"; "required": false; }; "componentId": { "alias": "componentId"; "required": false; }; "baseUrl": { "alias": "baseUrl"; "required": false; }; "displayMode": { "alias": "displayMode"; "required": false; }; }, { "uploadSuccess": "uploadSuccess"; "bulkComplete": "bulkComplete"; "error": "error"; "rateLimited": "rateLimited"; "retry": "retry"; "download": "download"; "copyLink": "copyLink"; "detailsOpened": "detailsOpened"; "detailsClosed": "detailsClosed"; "pendingFilesChange": "pendingFilesChange"; "proximityChange": "proximityChange"; }, never, ["*"], true, never>;
482
+ }
483
+
484
+ declare class PdxFilesUploadFieldComponent extends SimpleBaseInputComponent {
485
+ config: FilesUploadConfig | null;
486
+ valueMode: 'metadata' | 'id';
487
+ baseUrl?: string;
488
+ uploadError: string | null;
489
+ private uploader?;
490
+ pendingFiles: File[];
491
+ onTriggerUpload(): void;
492
+ onClearSelection(): void;
493
+ handlePendingFiles(files: File[]): void;
494
+ lastFileName: string | null;
495
+ batchCount: number;
496
+ isProximityActive: boolean;
497
+ private readonly errors;
498
+ private readonly translate;
499
+ get showUploadError(): boolean;
500
+ t(key: string, fallback: string): string;
501
+ onUploadSuccess(event: {
502
+ file: FileMetadata;
503
+ }): void;
504
+ onBulkComplete(resp: BulkUploadResponse): void;
505
+ onUploadError(event: unknown): void;
506
+ isShellDisabled(): boolean;
507
+ onProximityChange(isActive: boolean): void;
508
+ openFromShell(): void;
509
+ onOpenInfo(): void;
510
+ onOpenMenu(): void;
511
+ onClear(): void;
512
+ get policySummary(): string;
513
+ onRemovePendingFile(file: File, event: MouseEvent): void;
514
+ formatBytes(bytes: number): string;
515
+ static ɵfac: i0.ɵɵFactoryDeclaration<PdxFilesUploadFieldComponent, never>;
516
+ static ɵcmp: i0.ɵɵComponentDeclaration<PdxFilesUploadFieldComponent, "pdx-material-files-upload", never, { "config": { "alias": "config"; "required": false; }; "valueMode": { "alias": "valueMode"; "required": false; }; "baseUrl": { "alias": "baseUrl"; "required": false; }; }, {}, never, never, true, never>;
517
+ }
518
+
519
+ declare function acceptValidator(allowed: string[]): ValidatorFn;
520
+ declare function maxFileSizeValidator(maxBytes: number): ValidatorFn;
521
+ declare function maxFilesPerBulkValidator(maxFiles: number): ValidatorFn;
522
+ declare function maxBulkSizeValidator(maxBytes: number): ValidatorFn;
523
+
524
+ declare class PraxisFilesUploadConfigEditor implements OnInit, SettingsValueProvider {
525
+ private fb;
526
+ private panelData;
527
+ private snackBar;
528
+ private destroyRef;
529
+ form: FormGroup;
530
+ baseUrl?: string;
531
+ private state;
532
+ serverLoading: () => boolean;
533
+ serverData: () => EffectiveUploadConfig | undefined;
534
+ serverError: () => unknown;
535
+ get uiGroup(): FormGroup;
536
+ get dropzoneGroup(): FormGroup;
537
+ get listGroup(): FormGroup;
538
+ get limitsGroup(): FormGroup;
539
+ get optionsGroup(): FormGroup;
540
+ get quotasGroup(): FormGroup;
541
+ get rateLimitGroup(): FormGroup;
542
+ get bulkGroup(): FormGroup;
543
+ get messagesGroup(): FormGroup;
544
+ get headersGroup(): FormGroup;
545
+ get errorsGroup(): FormGroup;
546
+ errorCodes: ErrorCode[];
547
+ errorEntries: Array<{
548
+ code: string;
549
+ label: string;
550
+ }>;
551
+ isDirty$: BehaviorSubject<boolean>;
552
+ isValid$: Observable<boolean>;
553
+ isBusy$: BehaviorSubject<boolean>;
554
+ jsonError: string | null;
555
+ constructor(fb: FormBuilder, panelData: any, snackBar: MatSnackBar, destroyRef: DestroyRef);
556
+ ngOnInit(): void;
557
+ private applyServerConfig;
558
+ getSettingsValue(): FilesUploadConfig;
559
+ copyServerConfig(): void;
560
+ onJsonChange(json: string): void;
561
+ private getHeadersForFetch;
562
+ refetchServerConfig(): void;
563
+ static ɵfac: i0.ɵɵFactoryDeclaration<PraxisFilesUploadConfigEditor, never>;
564
+ static ɵcmp: i0.ɵɵComponentDeclaration<PraxisFilesUploadConfigEditor, "praxis-files-upload-config-editor", never, {}, {}, never, never, true, never>;
565
+ }
566
+
567
+ declare const FILES_UPLOAD_PT_BR: {
568
+ 'praxis.filesUpload.settingsAriaLabel': string;
569
+ 'praxis.filesUpload.dropzoneLabel': string;
570
+ 'praxis.filesUpload.dropzoneButton': string;
571
+ 'praxis.filesUpload.conflictPolicyLabel': string;
572
+ 'praxis.filesUpload.metadataLabel': string;
573
+ 'praxis.filesUpload.progressAriaLabel': string;
574
+ 'praxis.filesUpload.rateLimitBanner': string;
575
+ 'praxis.filesUpload.settingsTitle': string;
576
+ 'praxis.filesUpload.statusSuccess': string;
577
+ 'praxis.filesUpload.statusError': string;
578
+ 'praxis.filesUpload.invalidMetadata': string;
579
+ 'praxis.filesUpload.genericUploadError': string;
580
+ 'praxis.filesUpload.acceptError': string;
581
+ 'praxis.filesUpload.maxFileSizeError': string;
582
+ 'praxis.filesUpload.maxFilesPerBulkError': string;
583
+ 'praxis.filesUpload.maxBulkSizeError': string;
584
+ 'praxis.filesUpload.errors.INVALID_FILE_TYPE': string;
585
+ 'praxis.filesUpload.errors.FILE_TOO_LARGE': string;
586
+ 'praxis.filesUpload.errors.NOT_FOUND': string;
587
+ 'praxis.filesUpload.errors.UNAUTHORIZED': string;
588
+ 'praxis.filesUpload.errors.RATE_LIMIT_EXCEEDED': string;
589
+ 'praxis.filesUpload.errors.INTERNAL_ERROR': string;
590
+ 'praxis.filesUpload.errors.QUOTA_EXCEEDED': string;
591
+ 'praxis.filesUpload.errors.SEC_VIRUS_DETECTED': string;
592
+ 'praxis.filesUpload.errors.SEC_MALICIOUS_CONTENT': string;
593
+ 'praxis.filesUpload.errors.SEC_DANGEROUS_TYPE': string;
594
+ 'praxis.filesUpload.errors.FMT_MAGIC_MISMATCH': string;
595
+ 'praxis.filesUpload.errors.FMT_CORRUPTED': string;
596
+ 'praxis.filesUpload.errors.FMT_UNSUPPORTED': string;
597
+ 'praxis.filesUpload.errors.SYS_STORAGE_ERROR': string;
598
+ 'praxis.filesUpload.errors.SYS_SERVICE_DOWN': string;
599
+ 'praxis.filesUpload.errors.SYS_RATE_LIMIT': string;
600
+ 'praxis.filesUpload.errors.ARQUIVO_MUITO_GRANDE': string;
601
+ 'praxis.filesUpload.errors.TIPO_ARQUIVO_INVALIDO': string;
602
+ 'praxis.filesUpload.errors.TIPO_MIDIA_NAO_SUPORTADO': string;
603
+ 'praxis.filesUpload.errors.CAMPO_OBRIGATORIO_AUSENTE': string;
604
+ 'praxis.filesUpload.errors.OPCOES_JSON_INVALIDAS': string;
605
+ 'praxis.filesUpload.errors.ARGUMENTO_INVALIDO': string;
606
+ 'praxis.filesUpload.errors.NAO_AUTORIZADO': string;
607
+ 'praxis.filesUpload.errors.ERRO_INTERNO': string;
608
+ 'praxis.filesUpload.errors.LIMITE_TAXA_EXCEDIDO': string;
609
+ 'praxis.filesUpload.errors.COTA_EXCEDIDA': string;
610
+ 'praxis.filesUpload.errors.ARQUIVO_JA_EXISTE': string;
611
+ 'praxis.filesUpload.errors.INVALID_JSON_OPTIONS': string;
612
+ 'praxis.filesUpload.errors.EMPTY_FILENAME': string;
613
+ 'praxis.filesUpload.errors.FILE_EXISTS': string;
614
+ 'praxis.filesUpload.errors.PATH_TRAVERSAL': string;
615
+ 'praxis.filesUpload.errors.INSUFFICIENT_STORAGE': string;
616
+ 'praxis.filesUpload.errors.UPLOAD_TIMEOUT': string;
617
+ 'praxis.filesUpload.errors.BULK_UPLOAD_TIMEOUT': string;
618
+ 'praxis.filesUpload.errors.BULK_UPLOAD_CANCELLED': string;
619
+ 'praxis.filesUpload.errors.USER_CANCELLED': string;
620
+ 'praxis.filesUpload.errors.UNKNOWN_ERROR': string;
621
+ };
622
+
623
+ /** Metadata for PraxisFilesUpload component */
624
+ declare const PRAXIS_FILES_UPLOAD_COMPONENT_METADATA: ComponentDocMeta;
625
+ /** Provider para auto-registrar metadados do componente Files Upload. */
626
+ declare function providePraxisFilesUploadMetadata(): Provider;
627
+
628
+ export { BulkUploadResultStatus, ErrorCode, ErrorMapperService, FILES_UPLOAD_ERROR_MESSAGES, FILES_UPLOAD_PT_BR, FILES_UPLOAD_TEXTS, FilesApiClient, PRAXIS_FILES_UPLOAD_COMPONENT_METADATA, PdxFilesUploadFieldComponent, PraxisFilesUpload, PraxisFilesUploadConfigEditor, PresignedUploaderService, ScanStatus, TRANSLATE_LIKE, acceptValidator, maxBulkSizeValidator, maxFileSizeValidator, maxFilesPerBulkValidator, providePraxisFilesUploadMetadata };
629
+ export type { BulkConfig, BulkUploadFile, BulkUploadFileResult, BulkUploadOptions, BulkUploadResponse, EffectiveUploadConfig, ErrorResponse, FileMetadata, FileUploadOptions, FilesUploadConfig, FilesUploadTexts, MappedError, Metadata, PresignResponse, QuotasConfig, RateLimitConfig, RateLimitInfo, ServerMessages, TranslateLike, UploadOptions, UploadResponse };
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@praxisui/files-upload",
3
+ "version": "0.0.1",
4
+ "peerDependencies": {
5
+ "@angular/common": "^20.0.0",
6
+ "@angular/core": "^20.0.0",
7
+ "@angular/material": "^20.0.0",
8
+ "@ngx-translate/core": "^17.0.0",
9
+ "@praxisui/settings-panel": "^0.0.1"
10
+ },
11
+ "dependencies": {
12
+ "tslib": "^2.3.0"
13
+ },
14
+ "license": "Apache-2.0",
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "https://github.com/codexrodrigues/praxis"
21
+ },
22
+ "homepage": "https://github.com/codexrodrigues/praxis#readme",
23
+ "bugs": {
24
+ "url": "https://github.com/codexrodrigues/praxis/issues"
25
+ },
26
+ "sideEffects": false,
27
+ "module": "fesm2022/praxisui-files-upload.mjs",
28
+ "typings": "index.d.ts",
29
+ "exports": {
30
+ "./package.json": {
31
+ "default": "./package.json"
32
+ },
33
+ ".": {
34
+ "types": "./index.d.ts",
35
+ "default": "./fesm2022/praxisui-files-upload.mjs"
36
+ }
37
+ }
38
+ }