@praxisui/files-upload 8.0.0-beta.20 → 8.0.0-beta.21
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/fesm2022/praxisui-files-upload.mjs +118 -2
- package/index.d.ts +35 -2
- package/package.json +5 -5
|
@@ -32,7 +32,7 @@ import { MatTooltipModule } from '@angular/material/tooltip';
|
|
|
32
32
|
import * as i2 from '@angular/material/snack-bar';
|
|
33
33
|
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
|
34
34
|
import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
35
|
-
import { of, throwError, BehaviorSubject, map as map$1, startWith, retry, debounceTime, from } from 'rxjs';
|
|
35
|
+
import { of, throwError, BehaviorSubject, map as map$1, startWith, retry, debounceTime, from, Subscription } from 'rxjs';
|
|
36
36
|
import * as i1$3 from '@praxisui/settings-panel';
|
|
37
37
|
import { SETTINGS_PANEL_DATA } from '@praxisui/settings-panel';
|
|
38
38
|
import { map, catchError, take, concatMap, toArray, tap, filter, defaultIfEmpty } from 'rxjs/operators';
|
|
@@ -6232,6 +6232,114 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImpo
|
|
|
6232
6232
|
args: ['pendingPanel']
|
|
6233
6233
|
}] } });
|
|
6234
6234
|
|
|
6235
|
+
class PraxisFilesUploadWidgetConfigEditor {
|
|
6236
|
+
inputs = null;
|
|
6237
|
+
widgetKey;
|
|
6238
|
+
uploadEditor;
|
|
6239
|
+
isDirty$ = new BehaviorSubject(false);
|
|
6240
|
+
isValid$ = new BehaviorSubject(true);
|
|
6241
|
+
isBusy$ = new BehaviorSubject(false);
|
|
6242
|
+
subscription = new Subscription();
|
|
6243
|
+
ngAfterViewInit() {
|
|
6244
|
+
if (!this.uploadEditor) {
|
|
6245
|
+
return;
|
|
6246
|
+
}
|
|
6247
|
+
this.initializeChildEditor();
|
|
6248
|
+
this.subscription.add(this.uploadEditor.isDirty$.subscribe((value) => this.isDirty$.next(value)));
|
|
6249
|
+
this.subscription.add(this.uploadEditor.isValid$.subscribe((value) => this.isValid$.next(value)));
|
|
6250
|
+
this.subscription.add(this.uploadEditor.isBusy$.subscribe((value) => this.isBusy$.next(value)));
|
|
6251
|
+
}
|
|
6252
|
+
ngOnDestroy() {
|
|
6253
|
+
this.subscription.unsubscribe();
|
|
6254
|
+
}
|
|
6255
|
+
getSettingsValue() {
|
|
6256
|
+
return this.buildValue(this.uploadEditor?.getSettingsValue());
|
|
6257
|
+
}
|
|
6258
|
+
onSave() {
|
|
6259
|
+
return this.buildValue(this.uploadEditor?.getSettingsValue() ?? this.inputs?.config);
|
|
6260
|
+
}
|
|
6261
|
+
reset() {
|
|
6262
|
+
this.initializeChildEditor();
|
|
6263
|
+
}
|
|
6264
|
+
initializeChildEditor() {
|
|
6265
|
+
const config = this.normalizeEditorPatch(this.inputs?.config ?? {});
|
|
6266
|
+
this.uploadEditor?.form.patchValue(config, { emitEvent: false });
|
|
6267
|
+
this.uploadEditor?.isDirty$.next(false);
|
|
6268
|
+
}
|
|
6269
|
+
buildValue(rawConfig) {
|
|
6270
|
+
return {
|
|
6271
|
+
inputs: {
|
|
6272
|
+
...(this.inputs ?? {}),
|
|
6273
|
+
config: (rawConfig ?? {}),
|
|
6274
|
+
filesUploadId: this.inputs?.filesUploadId ?? this.widgetKey,
|
|
6275
|
+
componentInstanceId: this.inputs?.componentInstanceId ?? this.widgetKey,
|
|
6276
|
+
baseUrl: this.inputs?.baseUrl,
|
|
6277
|
+
displayMode: this.inputs?.displayMode ?? 'full',
|
|
6278
|
+
context: this.inputs?.context ?? null,
|
|
6279
|
+
enableCustomization: this.inputs?.enableCustomization ?? false,
|
|
6280
|
+
},
|
|
6281
|
+
};
|
|
6282
|
+
}
|
|
6283
|
+
normalizeEditorPatch(config) {
|
|
6284
|
+
const patch = structuredClone(config ?? {});
|
|
6285
|
+
if (Array.isArray(patch.ui?.accept)) {
|
|
6286
|
+
patch.ui = {
|
|
6287
|
+
...patch.ui,
|
|
6288
|
+
accept: patch.ui.accept.join(','),
|
|
6289
|
+
};
|
|
6290
|
+
}
|
|
6291
|
+
if (Array.isArray(patch.ui?.list?.detailsFields)) {
|
|
6292
|
+
patch.ui = {
|
|
6293
|
+
...patch.ui,
|
|
6294
|
+
list: {
|
|
6295
|
+
...patch.ui.list,
|
|
6296
|
+
detailsFields: patch.ui.list.detailsFields.join(','),
|
|
6297
|
+
},
|
|
6298
|
+
};
|
|
6299
|
+
}
|
|
6300
|
+
if (Array.isArray(patch.options?.allowedExtensions)) {
|
|
6301
|
+
patch.options = {
|
|
6302
|
+
...patch.options,
|
|
6303
|
+
allowedExtensions: patch.options.allowedExtensions.join(','),
|
|
6304
|
+
};
|
|
6305
|
+
}
|
|
6306
|
+
if (Array.isArray(patch.options?.acceptMimeTypes)) {
|
|
6307
|
+
patch.options = {
|
|
6308
|
+
...patch.options,
|
|
6309
|
+
acceptMimeTypes: patch.options.acceptMimeTypes.join(','),
|
|
6310
|
+
};
|
|
6311
|
+
}
|
|
6312
|
+
return patch;
|
|
6313
|
+
}
|
|
6314
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: PraxisFilesUploadWidgetConfigEditor, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6315
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.17", type: PraxisFilesUploadWidgetConfigEditor, isStandalone: true, selector: "praxis-files-upload-widget-config-editor", inputs: { inputs: "inputs", widgetKey: "widgetKey" }, viewQueries: [{ propertyName: "uploadEditor", first: true, predicate: ["uploadEditor"], descendants: true }], ngImport: i0, template: `
|
|
6316
|
+
<section data-testid="files-upload-widget-config-editor">
|
|
6317
|
+
<praxis-files-upload-config-editor #uploadEditor />
|
|
6318
|
+
</section>
|
|
6319
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: PraxisFilesUploadConfigEditor, selector: "praxis-files-upload-config-editor" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6320
|
+
}
|
|
6321
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: PraxisFilesUploadWidgetConfigEditor, decorators: [{
|
|
6322
|
+
type: Component,
|
|
6323
|
+
args: [{
|
|
6324
|
+
selector: 'praxis-files-upload-widget-config-editor',
|
|
6325
|
+
standalone: true,
|
|
6326
|
+
imports: [CommonModule, PraxisFilesUploadConfigEditor],
|
|
6327
|
+
template: `
|
|
6328
|
+
<section data-testid="files-upload-widget-config-editor">
|
|
6329
|
+
<praxis-files-upload-config-editor #uploadEditor />
|
|
6330
|
+
</section>
|
|
6331
|
+
`,
|
|
6332
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
6333
|
+
}]
|
|
6334
|
+
}], propDecorators: { inputs: [{
|
|
6335
|
+
type: Input
|
|
6336
|
+
}], widgetKey: [{
|
|
6337
|
+
type: Input
|
|
6338
|
+
}], uploadEditor: [{
|
|
6339
|
+
type: ViewChild,
|
|
6340
|
+
args: ['uploadEditor']
|
|
6341
|
+
}] } });
|
|
6342
|
+
|
|
6235
6343
|
const PRAXIS_FILES_UPLOAD_COMPONENT_METADATA = {
|
|
6236
6344
|
id: 'praxis-files-upload',
|
|
6237
6345
|
selector: 'praxis-files-upload',
|
|
@@ -6239,6 +6347,14 @@ const PRAXIS_FILES_UPLOAD_COMPONENT_METADATA = {
|
|
|
6239
6347
|
friendlyName: 'Praxis Files Upload',
|
|
6240
6348
|
description: 'Componente para upload de arquivos com suporte a configuracao dinamica, eventos e integracao com backend.',
|
|
6241
6349
|
icon: 'upload_file',
|
|
6350
|
+
authoringManifestRef: {
|
|
6351
|
+
componentId: 'praxis-files-upload',
|
|
6352
|
+
source: 'PRAXIS_FILES_UPLOAD_AUTHORING_MANIFEST',
|
|
6353
|
+
},
|
|
6354
|
+
configEditor: {
|
|
6355
|
+
component: PraxisFilesUploadWidgetConfigEditor,
|
|
6356
|
+
title: 'Configurar upload de arquivos',
|
|
6357
|
+
},
|
|
6242
6358
|
inputs: [
|
|
6243
6359
|
{
|
|
6244
6360
|
name: 'config',
|
|
@@ -6896,4 +7012,4 @@ const PRAXIS_FILES_UPLOAD_AUTHORING_MANIFEST = {
|
|
|
6896
7012
|
* Generated bundle index. Do not edit.
|
|
6897
7013
|
*/
|
|
6898
7014
|
|
|
6899
|
-
export { BulkUploadResultStatus, ErrorCode, ErrorMapperService, FILES_UPLOAD_AI_CAPABILITIES, FILES_UPLOAD_EN_US, FILES_UPLOAD_ERROR_MESSAGES, FILES_UPLOAD_PT_BR, FILES_UPLOAD_TEXTS, FilesApiClient, PRAXIS_FILES_UPLOAD_AUTHORING_MANIFEST, PRAXIS_FILES_UPLOAD_COMPONENT_METADATA, PdxFilesUploadFieldComponent, PraxisFilesUpload, PraxisFilesUploadConfigEditor, PresignedUploaderService, ScanStatus, TRANSLATE_LIKE, acceptValidator, createPraxisFilesUploadI18nConfig, getPrimaryErrorItem, isErrorEnvelope, maxBulkSizeValidator, maxFileSizeValidator, maxFilesPerBulkValidator, providePraxisFilesUploadI18n, providePraxisFilesUploadMetadata, resolvePraxisFilesUploadText };
|
|
7015
|
+
export { BulkUploadResultStatus, ErrorCode, ErrorMapperService, FILES_UPLOAD_AI_CAPABILITIES, FILES_UPLOAD_EN_US, FILES_UPLOAD_ERROR_MESSAGES, FILES_UPLOAD_PT_BR, FILES_UPLOAD_TEXTS, FilesApiClient, PRAXIS_FILES_UPLOAD_AUTHORING_MANIFEST, PRAXIS_FILES_UPLOAD_COMPONENT_METADATA, PdxFilesUploadFieldComponent, PraxisFilesUpload, PraxisFilesUploadConfigEditor, PraxisFilesUploadWidgetConfigEditor, PresignedUploaderService, ScanStatus, TRANSLATE_LIKE, acceptValidator, createPraxisFilesUploadI18nConfig, getPrimaryErrorItem, isErrorEnvelope, maxBulkSizeValidator, maxFileSizeValidator, maxFilesPerBulkValidator, providePraxisFilesUploadI18n, providePraxisFilesUploadMetadata, resolvePraxisFilesUploadText };
|
package/index.d.ts
CHANGED
|
@@ -802,6 +802,39 @@ declare class PraxisFilesUploadConfigEditor implements OnInit, SettingsValueProv
|
|
|
802
802
|
static ɵcmp: i0.ɵɵComponentDeclaration<PraxisFilesUploadConfigEditor, "praxis-files-upload-config-editor", never, {}, {}, never, never, true, never>;
|
|
803
803
|
}
|
|
804
804
|
|
|
805
|
+
interface PraxisFilesUploadWidgetEditorInputs {
|
|
806
|
+
config?: FilesUploadConfig | null;
|
|
807
|
+
filesUploadId?: string;
|
|
808
|
+
componentInstanceId?: string;
|
|
809
|
+
baseUrl?: string;
|
|
810
|
+
displayMode?: 'full' | 'compact';
|
|
811
|
+
context?: Record<string, unknown> | null;
|
|
812
|
+
enableCustomization?: boolean;
|
|
813
|
+
[key: string]: unknown;
|
|
814
|
+
}
|
|
815
|
+
interface PraxisFilesUploadWidgetEditorValue {
|
|
816
|
+
inputs: PraxisFilesUploadWidgetEditorInputs;
|
|
817
|
+
}
|
|
818
|
+
declare class PraxisFilesUploadWidgetConfigEditor implements SettingsValueProvider, AfterViewInit, OnDestroy {
|
|
819
|
+
inputs: PraxisFilesUploadWidgetEditorInputs | null;
|
|
820
|
+
widgetKey?: string;
|
|
821
|
+
uploadEditor?: PraxisFilesUploadConfigEditor;
|
|
822
|
+
readonly isDirty$: BehaviorSubject<boolean>;
|
|
823
|
+
readonly isValid$: BehaviorSubject<boolean>;
|
|
824
|
+
readonly isBusy$: BehaviorSubject<boolean>;
|
|
825
|
+
private readonly subscription;
|
|
826
|
+
ngAfterViewInit(): void;
|
|
827
|
+
ngOnDestroy(): void;
|
|
828
|
+
getSettingsValue(): PraxisFilesUploadWidgetEditorValue;
|
|
829
|
+
onSave(): PraxisFilesUploadWidgetEditorValue;
|
|
830
|
+
reset(): void;
|
|
831
|
+
private initializeChildEditor;
|
|
832
|
+
private buildValue;
|
|
833
|
+
private normalizeEditorPatch;
|
|
834
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PraxisFilesUploadWidgetConfigEditor, never>;
|
|
835
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PraxisFilesUploadWidgetConfigEditor, "praxis-files-upload-widget-config-editor", never, { "inputs": { "alias": "inputs"; "required": false; }; "widgetKey": { "alias": "widgetKey"; "required": false; }; }, {}, never, never, true, never>;
|
|
836
|
+
}
|
|
837
|
+
|
|
805
838
|
declare const FILES_UPLOAD_EN_US: {
|
|
806
839
|
'praxis.filesUpload.editor.summary.ariaLabel': string;
|
|
807
840
|
'praxis.filesUpload.editor.summary.title': string;
|
|
@@ -1467,5 +1500,5 @@ declare const FILES_UPLOAD_AI_CAPABILITIES: CapabilityCatalog;
|
|
|
1467
1500
|
|
|
1468
1501
|
declare const PRAXIS_FILES_UPLOAD_AUTHORING_MANIFEST: ComponentAuthoringManifest;
|
|
1469
1502
|
|
|
1470
|
-
export { BulkUploadResultStatus, ErrorCode, ErrorMapperService, FILES_UPLOAD_AI_CAPABILITIES, FILES_UPLOAD_EN_US, FILES_UPLOAD_ERROR_MESSAGES, FILES_UPLOAD_PT_BR, FILES_UPLOAD_TEXTS, FilesApiClient, PRAXIS_FILES_UPLOAD_AUTHORING_MANIFEST, PRAXIS_FILES_UPLOAD_COMPONENT_METADATA, PdxFilesUploadFieldComponent, PraxisFilesUpload, PraxisFilesUploadConfigEditor, PresignedUploaderService, ScanStatus, TRANSLATE_LIKE, acceptValidator, createPraxisFilesUploadI18nConfig, getPrimaryErrorItem, isErrorEnvelope, maxBulkSizeValidator, maxFileSizeValidator, maxFilesPerBulkValidator, providePraxisFilesUploadI18n, providePraxisFilesUploadMetadata, resolvePraxisFilesUploadText };
|
|
1471
|
-
export type { ApiErrorEnvelope, ApiErrorItem, ApiResponseStatus, ApiSuccessEnvelope, BulkConfig, BulkUploadFile, BulkUploadFileResult, BulkUploadOptions, BulkUploadResponse, BulkUploadResponseData, Capability, CapabilityCatalog, CapabilityCategory, EffectiveUploadConfig, ErrorLike, ErrorResponse, FileMetadata, FileUploadOptions, FilesUploadBackendOptionsConfig, FilesUploadConfig, FilesUploadExecutionConfig, FilesUploadHeadersConfig, FilesUploadMessagesConfig, FilesUploadQuotaFeedbackConfig, FilesUploadRateLimitFeedbackConfig, FilesUploadReadinessEvent, FilesUploadReadySource, FilesUploadReadyState, FilesUploadStrategy, FilesUploadTexts, FilesUploadValidationConfig, FilesUploadVisualConfig, MappedError, Metadata, PendingFilesState, PraxisFilesUploadI18nOptions, PresignResponse, QuotasConfig, RateLimitConfig, RateLimitInfo, ServerMessages, TranslateLike, UploadOptions, UploadProgressEvent, UploadResponse, UploadResponseData, UploadStartEvent, ValueKind };
|
|
1503
|
+
export { BulkUploadResultStatus, ErrorCode, ErrorMapperService, FILES_UPLOAD_AI_CAPABILITIES, FILES_UPLOAD_EN_US, FILES_UPLOAD_ERROR_MESSAGES, FILES_UPLOAD_PT_BR, FILES_UPLOAD_TEXTS, FilesApiClient, PRAXIS_FILES_UPLOAD_AUTHORING_MANIFEST, PRAXIS_FILES_UPLOAD_COMPONENT_METADATA, PdxFilesUploadFieldComponent, PraxisFilesUpload, PraxisFilesUploadConfigEditor, PraxisFilesUploadWidgetConfigEditor, PresignedUploaderService, ScanStatus, TRANSLATE_LIKE, acceptValidator, createPraxisFilesUploadI18nConfig, getPrimaryErrorItem, isErrorEnvelope, maxBulkSizeValidator, maxFileSizeValidator, maxFilesPerBulkValidator, providePraxisFilesUploadI18n, providePraxisFilesUploadMetadata, resolvePraxisFilesUploadText };
|
|
1504
|
+
export type { ApiErrorEnvelope, ApiErrorItem, ApiResponseStatus, ApiSuccessEnvelope, BulkConfig, BulkUploadFile, BulkUploadFileResult, BulkUploadOptions, BulkUploadResponse, BulkUploadResponseData, Capability, CapabilityCatalog, CapabilityCategory, EffectiveUploadConfig, ErrorLike, ErrorResponse, FileMetadata, FileUploadOptions, FilesUploadBackendOptionsConfig, FilesUploadConfig, FilesUploadExecutionConfig, FilesUploadHeadersConfig, FilesUploadMessagesConfig, FilesUploadQuotaFeedbackConfig, FilesUploadRateLimitFeedbackConfig, FilesUploadReadinessEvent, FilesUploadReadySource, FilesUploadReadyState, FilesUploadStrategy, FilesUploadTexts, FilesUploadValidationConfig, FilesUploadVisualConfig, MappedError, Metadata, PendingFilesState, PraxisFilesUploadI18nOptions, PraxisFilesUploadWidgetEditorInputs, PraxisFilesUploadWidgetEditorValue, PresignResponse, QuotasConfig, RateLimitConfig, RateLimitInfo, ServerMessages, TranslateLike, UploadOptions, UploadProgressEvent, UploadResponse, UploadResponseData, UploadStartEvent, ValueKind };
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisui/files-upload",
|
|
3
|
-
"version": "8.0.0-beta.
|
|
3
|
+
"version": "8.0.0-beta.21",
|
|
4
4
|
"description": "File upload components and services for Praxis UI with presigned and direct strategies, quotas and rate-limit handling.",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": "^20.0.0",
|
|
7
7
|
"@angular/cdk": "^20.0.0",
|
|
8
8
|
"@angular/core": "^20.0.0",
|
|
9
9
|
"@angular/material": "^20.0.0",
|
|
10
|
-
"@praxisui/core": "^8.0.0-beta.
|
|
11
|
-
"@praxisui/dynamic-fields": "^8.0.0-beta.
|
|
12
|
-
"@praxisui/settings-panel": "^8.0.0-beta.
|
|
10
|
+
"@praxisui/core": "^8.0.0-beta.21",
|
|
11
|
+
"@praxisui/dynamic-fields": "^8.0.0-beta.21",
|
|
12
|
+
"@praxisui/settings-panel": "^8.0.0-beta.21",
|
|
13
13
|
"@angular/forms": "^20.0.0",
|
|
14
14
|
"@angular/router": "^20.0.0",
|
|
15
|
-
"@praxisui/ai": "^8.0.0-beta.
|
|
15
|
+
"@praxisui/ai": "^8.0.0-beta.21",
|
|
16
16
|
"rxjs": "~7.8.0"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|