@jm-7c3/common-lib 22.1.0 → 22.3.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.
- package/README.md +30 -3
- package/fesm2022/jm-7c3-common-lib.mjs +241 -240
- package/fesm2022/jm-7c3-common-lib.mjs.map +1 -1
- package/jm-7c3-common-lib-22.3.0.tgz +0 -0
- package/package.json +9 -3
- package/styles.css +2 -0
- package/types/jm-7c3-common-lib.d.ts +50 -40
- package/jm-7c3-common-lib-22.1.0.tgz +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, signal, effect, ChangeDetectionStrategy, Component, Injectable, inject, Inject, ChangeDetectorRef, viewChild, ViewContainerRef, Service, Directive, output, InjectionToken,
|
|
2
|
+
import { input, signal, effect, ChangeDetectionStrategy, Component, Injectable, inject, Inject, ChangeDetectorRef, viewChild, ViewContainerRef, Service, Directive, contentChild, output, InjectionToken, computed, ViewEncapsulation, NgModule, model } from '@angular/core';
|
|
3
3
|
import * as i1 from 'primeng/button';
|
|
4
4
|
import { ButtonModule } from 'primeng/button';
|
|
5
5
|
import * as i2 from 'primeng/api';
|
|
@@ -26,6 +26,7 @@ import * as i1$6 from 'primeng/toast';
|
|
|
26
26
|
import { ToastModule } from 'primeng/toast';
|
|
27
27
|
import { cloneDeep } from 'lodash-es';
|
|
28
28
|
import { v4 } from 'uuid';
|
|
29
|
+
import { validate, form } from '@angular/forms/signals';
|
|
29
30
|
import * as i2$3 from '@angular/material/icon';
|
|
30
31
|
import { MatIconModule } from '@angular/material/icon';
|
|
31
32
|
|
|
@@ -65,10 +66,10 @@ class ButtonComponent {
|
|
|
65
66
|
}
|
|
66
67
|
});
|
|
67
68
|
}
|
|
68
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
69
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.
|
|
69
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
70
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.6", type: ButtonComponent, isStandalone: true, selector: "cl-button", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<button [class]=\"buttonClass()\" [disabled]=\"disabled()\" [icon]=\"icon()!\" [label]=\"label()!\" [loading]=\"loading()\" pButton\n [type]=\"type()\">\n</button>\n", styles: [".p-button-text.p-button-info{text-decoration:underline}.p-button-text.p-button-info:not(:disabled):hover{background:none!important}\n"], dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i1.ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
70
71
|
}
|
|
71
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
72
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
72
73
|
type: Component,
|
|
73
74
|
args: [{ selector: 'cl-button', imports: [
|
|
74
75
|
ButtonModule
|
|
@@ -88,10 +89,10 @@ class ClStateService {
|
|
|
88
89
|
updateStateMessage(stateMessage) {
|
|
89
90
|
patchState(this.state, { stateMessage });
|
|
90
91
|
}
|
|
91
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
92
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
92
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ClStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
93
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ClStateService, providedIn: 'root' });
|
|
93
94
|
}
|
|
94
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
95
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ClStateService, decorators: [{
|
|
95
96
|
type: Injectable,
|
|
96
97
|
args: [{
|
|
97
98
|
providedIn: 'root'
|
|
@@ -148,10 +149,10 @@ class ConfirmationComponent {
|
|
|
148
149
|
},
|
|
149
150
|
});
|
|
150
151
|
}
|
|
151
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
152
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.
|
|
152
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ConfirmationComponent, deps: [{ token: 'env' }], target: i0.ɵɵFactoryTarget.Component });
|
|
153
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: ConfirmationComponent, isStandalone: true, selector: "cl-confirmation", ngImport: i0, template: "<p-confirmDialog #general key=\"general\">\n <ng-template pTemplate=\"footer\">\n <cl-button class=\"mr-2\" (click)=\"general.onAccept()\" color=\"primary\" icon=\"pi pi-check\" [label]=\"acceptLabel()\" />\n <cl-button (click)=\"general.onReject()\" color=\"secondary\" icon=\"pi pi-times\" [label]=\"cancelLabel()\" />\n </ng-template>\n</p-confirmDialog>\n\n<p-confirmDialog icon=\"pi pi-exclamation-triangle\" key=\"general-warning\" #warning>\n <ng-template pTemplate=\"footer\">\n <cl-button class=\"mr-2\" (click)=\"warning.onAccept()\" color=\"primary\" icon=\"pi pi-check\" [label]=\"acceptLabel()\" />\n <cl-button (click)=\"warning.onReject()\" color=\"secondary\" icon=\"pi pi-times\" [label]=\"cancelLabel()\" />\n </ng-template>\n</p-confirmDialog>\n", styles: [""], dependencies: [{ kind: "component", type: ButtonComponent, selector: "cl-button", inputs: ["color", "disabled", "icon", "label", "loading", "type"] }, { kind: "ngmodule", type: ConfirmDialogModule }, { kind: "component", type: i1$1.ConfirmDialog, selector: "p-confirmDialog, p-confirmdialog, p-confirm-dialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "closeAriaLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "modal", "visible", "position", "draggable"], outputs: ["onHide"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
153
154
|
}
|
|
154
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
155
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ConfirmationComponent, decorators: [{
|
|
155
156
|
type: Component,
|
|
156
157
|
args: [{ selector: 'cl-confirmation', imports: [
|
|
157
158
|
ButtonComponent,
|
|
@@ -188,10 +189,10 @@ class ConfirmationService {
|
|
|
188
189
|
onCancel(key) {
|
|
189
190
|
return this.clStateService.onStateMessage('confirmation-cancel').pipe(filter(message => message?.key === key), map(() => null));
|
|
190
191
|
}
|
|
191
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
192
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
192
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ConfirmationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
193
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ConfirmationService, providedIn: 'root' });
|
|
193
194
|
}
|
|
194
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
195
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ConfirmationService, decorators: [{
|
|
195
196
|
type: Injectable,
|
|
196
197
|
args: [{
|
|
197
198
|
providedIn: 'root'
|
|
@@ -235,10 +236,10 @@ class ContentDialogComponent {
|
|
|
235
236
|
onClose() {
|
|
236
237
|
this.dialogRef.close();
|
|
237
238
|
}
|
|
238
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
239
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.
|
|
239
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContentDialogComponent, deps: [{ token: 'env' }], target: i0.ɵɵFactoryTarget.Component });
|
|
240
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: ContentDialogComponent, isStandalone: true, selector: "cl-content-dialog", ngImport: i0, template: "@if (component()) {\n <ng-container *ngComponentOutlet=\"component()\" />\n}\n\n<div class=\"text-right\">\n <cl-button (click)=\"onClose()\" color=\"secondary\" [label]=\"closeLabel()\" />\n</div>\n", styles: [""], dependencies: [{ kind: "component", type: ButtonComponent, selector: "cl-button", inputs: ["color", "disabled", "icon", "label", "loading", "type"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
240
241
|
}
|
|
241
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
242
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContentDialogComponent, decorators: [{
|
|
242
243
|
type: Component,
|
|
243
244
|
args: [{ selector: 'cl-content-dialog', imports: [
|
|
244
245
|
ButtonComponent,
|
|
@@ -272,10 +273,10 @@ class ContentDialogService {
|
|
|
272
273
|
});
|
|
273
274
|
});
|
|
274
275
|
}
|
|
275
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
276
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
276
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContentDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
277
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContentDialogService, providedIn: 'root' });
|
|
277
278
|
}
|
|
278
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
279
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContentDialogService, decorators: [{
|
|
279
280
|
type: Injectable,
|
|
280
281
|
args: [{
|
|
281
282
|
providedIn: 'root'
|
|
@@ -344,10 +345,10 @@ class FormDialogComponent {
|
|
|
344
345
|
this.dialogRef.close(this.form().value);
|
|
345
346
|
}
|
|
346
347
|
}
|
|
347
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
348
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.
|
|
348
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FormDialogComponent, deps: [{ token: 'env' }], target: i0.ɵɵFactoryTarget.Component });
|
|
349
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: FormDialogComponent, isStandalone: true, selector: "cl-form-dialog", viewQueries: [{ propertyName: "formContainer", first: true, predicate: ["formContainer"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: "<h2>{{ header() }}</h2>\n\n<div class=\"mb-2\">\n <ng-container #formContainer />\n</div>\n\n@if (form()) {\n <div class=\"text-right\">\n @if (!hideSubmitButton()) {\n <cl-button class=\"mr-2\" (click)=\"onSubmit()\" color=\"main\" [disabled]=\"form()!.invalid || form()!.pristine\"\n [label]=\"submitLabel()\" />\n }\n\n <cl-button (click)=\"onCancel()\" color=\"secondary\" [label]=\"cancelLabel()\" />\n </div>\n}\n", styles: [""], dependencies: [{ kind: "component", type: ButtonComponent, selector: "cl-button", inputs: ["color", "disabled", "icon", "label", "loading", "type"] }, { kind: "ngmodule", type: DynamicDialogModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
349
350
|
}
|
|
350
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
351
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FormDialogComponent, decorators: [{
|
|
351
352
|
type: Component,
|
|
352
353
|
args: [{ selector: 'cl-form-dialog', imports: [
|
|
353
354
|
ButtonComponent,
|
|
@@ -396,10 +397,10 @@ class FormDialogService {
|
|
|
396
397
|
}
|
|
397
398
|
});
|
|
398
399
|
}
|
|
399
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
400
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
400
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FormDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
401
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FormDialogService, providedIn: 'root' });
|
|
401
402
|
}
|
|
402
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
403
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FormDialogService, decorators: [{
|
|
403
404
|
type: Injectable,
|
|
404
405
|
args: [{
|
|
405
406
|
providedIn: 'root'
|
|
@@ -427,10 +428,10 @@ class IconButtonComponent {
|
|
|
427
428
|
updateClass(severity) {
|
|
428
429
|
this.class.update(value => value + ' p-button-' + severity);
|
|
429
430
|
}
|
|
430
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
431
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.
|
|
431
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: IconButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
432
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.6", type: IconButtonComponent, isStandalone: true, selector: "cl-icon-button", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: true, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, severity: { classPropertyName: "severity", publicName: "severity", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<button [class]=\"class()\" [disabled]=\"disabled()\" [icon]=\"icon()\" [loading]=\"loading()\" pButton [type]=\"type()\">\n</button>\n", styles: ["button{border-radius:25px}\n"], dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i1.ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
432
433
|
}
|
|
433
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
434
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: IconButtonComponent, decorators: [{
|
|
434
435
|
type: Component,
|
|
435
436
|
args: [{ selector: 'cl-icon-button', imports: [
|
|
436
437
|
ButtonModule,
|
|
@@ -439,7 +440,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
439
440
|
|
|
440
441
|
class MatConfirmationComponent {
|
|
441
442
|
data = inject(MAT_DIALOG_DATA);
|
|
442
|
-
contentHost = viewChild.required('contentHost', { read: ViewContainerRef });
|
|
443
|
+
contentHost = viewChild.required('contentHost', { ...(ngDevMode ? { debugName: "contentHost" } : /* istanbul ignore next */ {}), read: ViewContainerRef });
|
|
443
444
|
title = signal('', /* @ts-ignore */
|
|
444
445
|
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
445
446
|
message = signal(undefined, /* @ts-ignore */
|
|
@@ -462,10 +463,10 @@ class MatConfirmationComponent {
|
|
|
462
463
|
this.message.set(message);
|
|
463
464
|
}
|
|
464
465
|
}
|
|
465
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
466
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.
|
|
466
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MatConfirmationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
467
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: MatConfirmationComponent, isStandalone: true, selector: "cl-mat-confirmation", viewQueries: [{ propertyName: "contentHost", first: true, predicate: ["contentHost"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: "<h2 mat-dialog-title>{{ title() }}</h2>\n\n<mat-dialog-content>\n @if (message()) {\n <p>{{ message() }}</p>\n }\n <ng-template #contentHost />\n</mat-dialog-content>\n\n<mat-dialog-actions align=\"end\">\n <button mat-button [mat-dialog-close]=\"false\">\n {{ cancelButtonLabel() }}\n </button>\n <button mat-flat-button color=\"primary\" [mat-dialog-close]=\"true\">\n {{ acceptButtonLabel() }}\n </button>\n</mat-dialog-actions>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1$3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1$3.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$3.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1$3.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1$4.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }] });
|
|
467
468
|
}
|
|
468
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
469
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MatConfirmationComponent, decorators: [{
|
|
469
470
|
type: Component,
|
|
470
471
|
args: [{ selector: 'cl-mat-confirmation', standalone: true, imports: [CommonModule, MatDialogModule, MatButtonModule], template: "<h2 mat-dialog-title>{{ title() }}</h2>\n\n<mat-dialog-content>\n @if (message()) {\n <p>{{ message() }}</p>\n }\n <ng-template #contentHost />\n</mat-dialog-content>\n\n<mat-dialog-actions align=\"end\">\n <button mat-button [mat-dialog-close]=\"false\">\n {{ cancelButtonLabel() }}\n </button>\n <button mat-flat-button color=\"primary\" [mat-dialog-close]=\"true\">\n {{ acceptButtonLabel() }}\n </button>\n</mat-dialog-actions>" }]
|
|
471
472
|
}], propDecorators: { contentHost: [{ type: i0.ViewChild, args: ['contentHost', { ...{ read: ViewContainerRef }, isSignal: true }] }] } });
|
|
@@ -480,25 +481,25 @@ class MatConfirmationService {
|
|
|
480
481
|
});
|
|
481
482
|
return dialogRef.afterClosed().pipe(map((result) => result ?? false));
|
|
482
483
|
}
|
|
483
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
484
|
-
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.0.
|
|
484
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MatConfirmationService, deps: [], target: i0.ɵɵFactoryTarget.Service });
|
|
485
|
+
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.0.6", ngImport: i0, type: MatConfirmationService });
|
|
485
486
|
}
|
|
486
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
487
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MatConfirmationService, decorators: [{
|
|
487
488
|
type: Service
|
|
488
489
|
}] });
|
|
489
490
|
|
|
490
491
|
// eslint-disable-next-line @angular-eslint/directive-class-suffix
|
|
491
492
|
class MatFormHostableComponent {
|
|
492
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
493
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.
|
|
493
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MatFormHostableComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
494
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: MatFormHostableComponent, isStandalone: true, ngImport: i0 });
|
|
494
495
|
}
|
|
495
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
496
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MatFormHostableComponent, decorators: [{
|
|
496
497
|
type: Directive
|
|
497
498
|
}] });
|
|
498
499
|
class MatFormDialogComponent {
|
|
499
500
|
data = inject(MAT_DIALOG_DATA);
|
|
500
501
|
dialogRef = inject((MatDialogRef));
|
|
501
|
-
formHost = viewChild.required('formHost', { read: ViewContainerRef });
|
|
502
|
+
formHost = viewChild.required('formHost', { ...(ngDevMode ? { debugName: "formHost" } : /* istanbul ignore next */ {}), read: ViewContainerRef });
|
|
502
503
|
actionsAlign = signal('end', /* @ts-ignore */
|
|
503
504
|
...(ngDevMode ? [{ debugName: "actionsAlign" }] : /* istanbul ignore next */ []));
|
|
504
505
|
cancelButtonLabel = signal('Cancel', /* @ts-ignore */
|
|
@@ -536,10 +537,10 @@ class MatFormDialogComponent {
|
|
|
536
537
|
onSubmit() {
|
|
537
538
|
this.dialogRef.close(this.hostedComponentRef?.form.value);
|
|
538
539
|
}
|
|
539
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
540
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.
|
|
540
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MatFormDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
541
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.6", type: MatFormDialogComponent, isStandalone: true, selector: "cl-mat-form-dialog", viewQueries: [{ propertyName: "formHost", first: true, predicate: ["formHost"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: "<h2 mat-dialog-title>\n {{ title() }}\n</h2>\n\n<mat-dialog-content>\n <ng-template #formHost />\n</mat-dialog-content>\n\n<mat-dialog-actions align=\"end\">\n <button mat-button [mat-dialog-close]=\"undefined\" type=\"button\">\n {{ cancelButtonLabel() }}\n </button>\n <button mat-flat-button color=\"primary\" [disabled]=\"!isFormValid()\" (click)=\"onSubmit()\" type=\"button\">\n {{ submitButtonLabel() }}\n </button>\n</mat-dialog-actions>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1$4.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1$3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1$3.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$3.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1$3.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }] });
|
|
541
542
|
}
|
|
542
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
543
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MatFormDialogComponent, decorators: [{
|
|
543
544
|
type: Component,
|
|
544
545
|
args: [{ selector: 'cl-mat-form-dialog', imports: [
|
|
545
546
|
MatButtonModule,
|
|
@@ -561,13 +562,32 @@ class MatFormDialogService {
|
|
|
561
562
|
});
|
|
562
563
|
return dialogRef.afterClosed();
|
|
563
564
|
}
|
|
564
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
565
|
-
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.0.
|
|
565
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MatFormDialogService, deps: [], target: i0.ɵɵFactoryTarget.Service });
|
|
566
|
+
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.0.6", ngImport: i0, type: MatFormDialogService });
|
|
566
567
|
}
|
|
567
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
568
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MatFormDialogService, decorators: [{
|
|
568
569
|
type: Service
|
|
569
570
|
}] });
|
|
570
571
|
|
|
572
|
+
class PanelComponent {
|
|
573
|
+
contentTemplate = contentChild('contentTemplate', /* @ts-ignore */
|
|
574
|
+
...(ngDevMode ? [{ debugName: "contentTemplate" }] : /* istanbul ignore next */ []));
|
|
575
|
+
footerTemplate = contentChild('footerTemplate', /* @ts-ignore */
|
|
576
|
+
...(ngDevMode ? [{ debugName: "footerTemplate" }] : /* istanbul ignore next */ []));
|
|
577
|
+
headerTemplate = contentChild('headerTemplate', /* @ts-ignore */
|
|
578
|
+
...(ngDevMode ? [{ debugName: "headerTemplate" }] : /* istanbul ignore next */ []));
|
|
579
|
+
title = input('', /* @ts-ignore */
|
|
580
|
+
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
581
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
582
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: PanelComponent, isStandalone: true, selector: "cl-panel", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "contentTemplate", first: true, predicate: ["contentTemplate"], descendants: true, isSignal: true }, { propertyName: "footerTemplate", first: true, predicate: ["footerTemplate"], descendants: true, isSignal: true }, { propertyName: "headerTemplate", first: true, predicate: ["headerTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"border-1 border-gray-300 p-5 rounded-lg\">\n <!-- TODO - Use flex and gap instead of margins -->\n @if (headerTemplate() || title()) {\n <div>\n @if (title()) {\n <div class=\"font-medium mb-5 text-xl\">\n {{ title() }}\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"headerTemplate()\" />\n }\n </div>\n }\n <div>\n <ng-container [ngTemplateOutlet]=\"contentTemplate()\" />\n </div>\n @if (footerTemplate()) {\n <div class=\"mt-5\">\n <ng-container [ngTemplateOutlet]=\"footerTemplate()\" />\n </div>\n }\n</div>\n\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
583
|
+
}
|
|
584
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PanelComponent, decorators: [{
|
|
585
|
+
type: Component,
|
|
586
|
+
args: [{ selector: 'cl-panel', imports: [
|
|
587
|
+
CommonModule,
|
|
588
|
+
], template: "<div class=\"border-1 border-gray-300 p-5 rounded-lg\">\n <!-- TODO - Use flex and gap instead of margins -->\n @if (headerTemplate() || title()) {\n <div>\n @if (title()) {\n <div class=\"font-medium mb-5 text-xl\">\n {{ title() }}\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"headerTemplate()\" />\n }\n </div>\n }\n <div>\n <ng-container [ngTemplateOutlet]=\"contentTemplate()\" />\n </div>\n @if (footerTemplate()) {\n <div class=\"mt-5\">\n <ng-container [ngTemplateOutlet]=\"footerTemplate()\" />\n </div>\n }\n</div>\n\n" }]
|
|
589
|
+
}], propDecorators: { contentTemplate: [{ type: i0.ContentChild, args: ['contentTemplate', { isSignal: true }] }], footerTemplate: [{ type: i0.ContentChild, args: ['footerTemplate', { isSignal: true }] }], headerTemplate: [{ type: i0.ContentChild, args: ['headerTemplate', { isSignal: true }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }] } });
|
|
590
|
+
|
|
571
591
|
class ProgressBarDialogComponent {
|
|
572
592
|
cdRef = inject(ChangeDetectorRef);
|
|
573
593
|
clStateService = inject(ClStateService);
|
|
@@ -586,10 +606,10 @@ class ProgressBarDialogComponent {
|
|
|
586
606
|
}
|
|
587
607
|
});
|
|
588
608
|
}
|
|
589
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
590
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.
|
|
609
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ProgressBarDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
610
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: ProgressBarDialogComponent, isStandalone: true, selector: "cl-progress-bar-dialog", ngImport: i0, template: "<p-dialog [closable]=\"false\" [closeOnEscape]=\"false\" [draggable]=\"false\" [modal]=\"true\" [resizable]=\"false\"\n [showHeader]=\"true\" styleClass=\"w-4\" [(visible)]=\"visible\">\n <p-progressBar mode=\"indeterminate\" />\n</p-dialog>\n", styles: [":host ::ng-deep p-dialog .p-dialog-header{padding:1rem}\n"], dependencies: [{ kind: "ngmodule", type: DialogModule }, { kind: "component", type: i1$5.Dialog, selector: "p-dialog", inputs: ["hostName", "header", "draggable", "resizable", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "maskMotionOptions", "motionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "appendTo", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "ngmodule", type: ProgressBarModule }, { kind: "component", type: i2$1.ProgressBar, selector: "p-progressBar, p-progressbar, p-progress-bar", inputs: ["value", "showValue", "styleClass", "valueStyleClass", "unit", "mode", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
591
611
|
}
|
|
592
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
612
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ProgressBarDialogComponent, decorators: [{
|
|
593
613
|
type: Component,
|
|
594
614
|
args: [{ selector: 'cl-progress-bar-dialog', imports: [
|
|
595
615
|
DialogModule,
|
|
@@ -609,10 +629,10 @@ class ProgressBarDialogService {
|
|
|
609
629
|
type: 'progess-bar-dialog-open'
|
|
610
630
|
});
|
|
611
631
|
}
|
|
612
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
613
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
632
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ProgressBarDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
633
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ProgressBarDialogService, providedIn: 'root' });
|
|
614
634
|
}
|
|
615
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
635
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ProgressBarDialogService, decorators: [{
|
|
616
636
|
type: Injectable,
|
|
617
637
|
args: [{
|
|
618
638
|
providedIn: 'root'
|
|
@@ -624,10 +644,10 @@ class ReadonlyValueComponent {
|
|
|
624
644
|
...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
|
|
625
645
|
value = input(/* @ts-ignore */
|
|
626
646
|
...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
|
|
627
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
628
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.
|
|
647
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ReadonlyValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
648
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.6", type: ReadonlyValueComponent, isStandalone: true, selector: "cl-readonly-value", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div>\n <strong>{{ label() }}</strong>\n <div>{{ value() }}</div>\n</div>\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
629
649
|
}
|
|
630
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
650
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ReadonlyValueComponent, decorators: [{
|
|
631
651
|
type: Component,
|
|
632
652
|
args: [{ selector: 'cl-readonly-value', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div>\n <strong>{{ label() }}</strong>\n <div>{{ value() }}</div>\n</div>\n" }]
|
|
633
653
|
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }] } });
|
|
@@ -653,10 +673,10 @@ class ToastsComponent {
|
|
|
653
673
|
this.messageService.add(message);
|
|
654
674
|
});
|
|
655
675
|
}
|
|
656
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
657
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.
|
|
676
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ToastsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
677
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: ToastsComponent, isStandalone: true, selector: "cl-toasts", ngImport: i0, template: "<p-toast key=\"general\" position=\"bottom-center\" />\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ToastModule }, { kind: "component", type: i1$6.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "life", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "motionOptions", "breakpoints"], outputs: ["onClose"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
658
678
|
}
|
|
659
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
679
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ToastsComponent, decorators: [{
|
|
660
680
|
type: Component,
|
|
661
681
|
args: [{ selector: 'cl-toasts', imports: [
|
|
662
682
|
ToastModule,
|
|
@@ -695,10 +715,10 @@ class ToastsService {
|
|
|
695
715
|
type: 'toast'
|
|
696
716
|
});
|
|
697
717
|
}
|
|
698
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
699
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
718
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ToastsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
719
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ToastsService, providedIn: 'root' });
|
|
700
720
|
}
|
|
701
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
721
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ToastsService, decorators: [{
|
|
702
722
|
type: Injectable,
|
|
703
723
|
args: [{
|
|
704
724
|
providedIn: 'root'
|
|
@@ -765,10 +785,10 @@ class BaseFormComponent {
|
|
|
765
785
|
get formGroup() {
|
|
766
786
|
return this.control;
|
|
767
787
|
}
|
|
768
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
769
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.
|
|
788
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BaseFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
789
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: BaseFormComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: '', isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
770
790
|
}
|
|
771
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
791
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BaseFormComponent, decorators: [{
|
|
772
792
|
type: Component,
|
|
773
793
|
args: [{ imports: [], template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
774
794
|
}] });
|
|
@@ -901,8 +921,8 @@ class FileInputComponent {
|
|
|
901
921
|
this.onChange(value);
|
|
902
922
|
this.onTouched();
|
|
903
923
|
}
|
|
904
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
905
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.
|
|
924
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FileInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
925
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: FileInputComponent, isStandalone: true, selector: "cl-file-input", inputs: { directory: { classPropertyName: "directory", publicName: "directory", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onDownloadEmitter: "onDownload" }, providers: [
|
|
906
926
|
{
|
|
907
927
|
multi: true,
|
|
908
928
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -910,7 +930,7 @@ class FileInputComponent {
|
|
|
910
930
|
}
|
|
911
931
|
], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }], ngImport: i0, template: "<input type=\"hidden\" [value]=\"value()\" />\n<input (change)=\"onFileSelected($event)\" class=\"file-input\" #fileInput type=\"file\" />\n\n@if (isFileSelected()) {\n @if (readonly()) {\n <button class=\"link-button\" (click)=\"onDownload()\" type=\"button\">\n {{ fileName() }}\n </button>\n } @else {\n <div class=\"flex\">\n <cl-button class=\"mr-3\" [label]=\"fileName()\" />\n <button class=\"p-button-danger p-button-rounded p-button-text\" (click)=\"onDelete()\" [disabled]=\"isDisabled()\"\n icon=\"pi pi-trash\" pButton type=\"button\">\n </button>\n </div>\n }\n} @else {\n <cl-button (click)=\"onClick()\" [disabled]=\"isDisabled()\" [icon]=\"icon()\" [label]=\"label()\" />\n}\n\n", styles: [".file-input{display:none}.link-button{background:none!important;border:none;padding:0!important;color:#069;text-decoration:underline;cursor:pointer}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "cl-button", inputs: ["color", "disabled", "icon", "label", "loading", "type"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i1.ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }, { kind: "ngmodule", type: FormsModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
912
932
|
}
|
|
913
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
933
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FileInputComponent, decorators: [{
|
|
914
934
|
type: Component,
|
|
915
935
|
args: [{ selector: 'cl-file-input', imports: [
|
|
916
936
|
ButtonComponent,
|
|
@@ -992,8 +1012,8 @@ class FileInputsComponent extends BaseFormComponent {
|
|
|
992
1012
|
getForm() {
|
|
993
1013
|
return new FormArray([]);
|
|
994
1014
|
}
|
|
995
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
996
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.
|
|
1015
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FileInputsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1016
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: FileInputsComponent, isStandalone: true, selector: "cl-file-inputs", inputs: { directory: { classPropertyName: "directory", publicName: "directory", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onDownloadEmitter: "onDownload" }, providers: [
|
|
997
1017
|
{
|
|
998
1018
|
multi: true,
|
|
999
1019
|
provide: NG_VALIDATORS,
|
|
@@ -1006,7 +1026,7 @@ class FileInputsComponent extends BaseFormComponent {
|
|
|
1006
1026
|
}
|
|
1007
1027
|
], usesInheritance: true, ngImport: i0, template: "<ng-container [formGroup]=\"formGroup\">\n @for (item of formArray.value; track index; let index = $index) {\n <div class=\"flex mb-3\">\n <cl-file-input [formControlName]=\"index\" [directory]=\"directory()\" [icon]=\"icon()\" [label]=\"label()\"\n (onDownload)=\"onDownload($event)\" [readonly]=\"readonly()\" />\n @if (!readonly()) {\n @if (index === 0) {\n <button class=\"p-button-rounded p-button-text\" (click)=\"onAdd()\" [disabled]=\"formArray.length >= max()\"\n icon=\"pi pi-plus\" pButton type=\"button\">\n </button>\n } @else if (index > 0) {\n <button class=\"p-button-rounded p-button-text\" (click)=\"onDelete(index)\" icon=\"pi pi-minus\" pButton\n type=\"button\">\n </button>\n }\n }\n </div>\n }\n</ng-container>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i1.ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }, { kind: "component", type: FileInputComponent, selector: "cl-file-input", inputs: ["directory", "icon", "label", "readonly"], outputs: ["onDownload"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1008
1028
|
}
|
|
1009
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1029
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FileInputsComponent, decorators: [{
|
|
1010
1030
|
type: Component,
|
|
1011
1031
|
args: [{ selector: 'cl-file-inputs', imports: [
|
|
1012
1032
|
ButtonModule,
|
|
@@ -1029,12 +1049,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1029
1049
|
|
|
1030
1050
|
const ERROR_DIRECTIVE = new InjectionToken('ErrorDirective');
|
|
1031
1051
|
class ErrorDirective {
|
|
1032
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1033
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.
|
|
1052
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ErrorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1053
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: ErrorDirective, isStandalone: true, selector: "ff-error", providers: [
|
|
1034
1054
|
{ provide: ERROR_DIRECTIVE, useExisting: ErrorDirective }
|
|
1035
1055
|
], ngImport: i0 });
|
|
1036
1056
|
}
|
|
1037
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1057
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ErrorDirective, decorators: [{
|
|
1038
1058
|
type: Directive,
|
|
1039
1059
|
args: [{
|
|
1040
1060
|
selector: 'ff-error',
|
|
@@ -1051,12 +1071,12 @@ class FormFieldComponent {
|
|
|
1051
1071
|
...(ngDevMode ? [{ debugName: "control" }] : /* istanbul ignore next */ []));
|
|
1052
1072
|
isRequired = computed(() => this.control()?.control.hasValidator(Validators.required) ?? false, /* @ts-ignore */
|
|
1053
1073
|
...(ngDevMode ? [{ debugName: "isRequired" }] : /* istanbul ignore next */ []));
|
|
1054
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1055
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.
|
|
1074
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1075
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: FormFieldComponent, isStandalone: true, selector: "cl-form-field", providers: [
|
|
1056
1076
|
{ provide: FORM_FIELD, useExisting: FormFieldComponent }
|
|
1057
1077
|
], queries: [{ propertyName: "control", first: true, predicate: FormControlName, descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"field\">\n <label class=\"block\" [class.required]=\"isRequired()\">\n <ng-content select=\"ff-label\" />\n </label>\n <div>\n <ng-content />\n </div>\n @if ((control()?.dirty || control()?.touched) && control()?.errors) {\n <small class=\"p-block p-error\">\n <ng-content select=\"ff-error\" />\n </small>\n }\n</div>\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.Eager, encapsulation: i0.ViewEncapsulation.None });
|
|
1058
1078
|
}
|
|
1059
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1079
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FormFieldComponent, decorators: [{
|
|
1060
1080
|
type: Component,
|
|
1061
1081
|
args: [{ selector: 'cl-form-field', imports: [], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.Eager, providers: [
|
|
1062
1082
|
{ provide: FORM_FIELD, useExisting: FormFieldComponent }
|
|
@@ -1065,12 +1085,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1065
1085
|
|
|
1066
1086
|
const LABEL_DIRECTIVE = new InjectionToken('LabelDirective');
|
|
1067
1087
|
class LabelDirective {
|
|
1068
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1069
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.
|
|
1088
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1089
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: LabelDirective, isStandalone: true, selector: "ff-label", providers: [
|
|
1070
1090
|
{ provide: LABEL_DIRECTIVE, useExisting: LabelDirective }
|
|
1071
1091
|
], ngImport: i0 });
|
|
1072
1092
|
}
|
|
1073
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1093
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LabelDirective, decorators: [{
|
|
1074
1094
|
type: Directive,
|
|
1075
1095
|
args: [{
|
|
1076
1096
|
selector: 'ff-label',
|
|
@@ -1082,15 +1102,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1082
1102
|
}] });
|
|
1083
1103
|
|
|
1084
1104
|
class FormFieldModule {
|
|
1085
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1086
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.
|
|
1105
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FormFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1106
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.6", ngImport: i0, type: FormFieldModule, imports: [ErrorDirective,
|
|
1087
1107
|
FormFieldComponent,
|
|
1088
1108
|
LabelDirective], exports: [ErrorDirective,
|
|
1089
1109
|
FormFieldComponent,
|
|
1090
1110
|
LabelDirective] });
|
|
1091
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.
|
|
1111
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FormFieldModule });
|
|
1092
1112
|
}
|
|
1093
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1113
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FormFieldModule, decorators: [{
|
|
1094
1114
|
type: NgModule,
|
|
1095
1115
|
args: [{
|
|
1096
1116
|
exports: [
|
|
@@ -1106,62 +1126,61 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1106
1126
|
}]
|
|
1107
1127
|
}] });
|
|
1108
1128
|
|
|
1129
|
+
function matFileInputRequired(message = 'This field is required') {
|
|
1130
|
+
return (path) => {
|
|
1131
|
+
return validate(path, ({ value }) => {
|
|
1132
|
+
const firstValue = (value() || []).at(-1);
|
|
1133
|
+
if (!value() || (!firstValue?.isNew && firstValue?.toDelete)) {
|
|
1134
|
+
return {
|
|
1135
|
+
kind: 'mat-file-input-required',
|
|
1136
|
+
message,
|
|
1137
|
+
};
|
|
1138
|
+
}
|
|
1139
|
+
return null;
|
|
1140
|
+
});
|
|
1141
|
+
};
|
|
1142
|
+
}
|
|
1109
1143
|
class MatFileInputComponent {
|
|
1144
|
+
// #region Inputs, outputs and viewChild
|
|
1110
1145
|
directory = input('', /* @ts-ignore */
|
|
1111
1146
|
...(ngDevMode ? [{ debugName: "directory" }] : /* istanbul ignore next */ []));
|
|
1147
|
+
disabled = input(false, /* @ts-ignore */
|
|
1148
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
1112
1149
|
icon = input('add', /* @ts-ignore */
|
|
1113
1150
|
...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
1114
1151
|
label = input('Browse', /* @ts-ignore */
|
|
1115
1152
|
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
1116
1153
|
readonly = input(false, /* @ts-ignore */
|
|
1117
1154
|
...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
1118
|
-
onDownloadEmitter = output({
|
|
1155
|
+
onDownloadEmitter = output({
|
|
1156
|
+
alias: 'onDownload',
|
|
1157
|
+
});
|
|
1119
1158
|
fileInput = viewChild('fileInput', /* @ts-ignore */
|
|
1120
1159
|
...(ngDevMode ? [{ debugName: "fileInput" }] : /* istanbul ignore next */ []));
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
1125
|
-
isFileSelected = signal(false, /* @ts-ignore */
|
|
1126
|
-
...(ngDevMode ? [{ debugName: "isFileSelected" }] : /* istanbul ignore next */ []));
|
|
1127
|
-
value = signal(null, /* @ts-ignore */
|
|
1160
|
+
// #endregion
|
|
1161
|
+
// #region Properties
|
|
1162
|
+
value = model(null, /* @ts-ignore */
|
|
1128
1163
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
}
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
}
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
if (Array.isArray(value)) {
|
|
1144
|
-
newValue = cloneDeep(value);
|
|
1145
|
-
this.selectFile(newValue[0]);
|
|
1146
|
-
}
|
|
1147
|
-
else if (typeof value === 'string') {
|
|
1148
|
-
const hash = this.getHashFromFileName(value);
|
|
1149
|
-
const file = {
|
|
1150
|
-
isNew: !value,
|
|
1151
|
-
hash,
|
|
1152
|
-
name: value,
|
|
1153
|
-
path: this.directory(),
|
|
1154
|
-
toDelete: false,
|
|
1155
|
-
};
|
|
1156
|
-
newValue.push(file);
|
|
1157
|
-
this.selectFile(file);
|
|
1158
|
-
}
|
|
1159
|
-
this.setValue(newValue);
|
|
1164
|
+
form = form(this.value, (path) => {
|
|
1165
|
+
matFileInputRequired()(path);
|
|
1166
|
+
});
|
|
1167
|
+
// #endregion
|
|
1168
|
+
// #region Computed properties
|
|
1169
|
+
isFileSelected = computed(() => this.value()?.filter((file) => !file?.toDelete).length, /* @ts-ignore */
|
|
1170
|
+
...(ngDevMode ? [{ debugName: "isFileSelected" }] : /* istanbul ignore next */ []));
|
|
1171
|
+
fileName = computed(() => {
|
|
1172
|
+
const file = this.getLastFile(this.value());
|
|
1173
|
+
return this.getSafeFileName(file);
|
|
1174
|
+
}, /* @ts-ignore */
|
|
1175
|
+
...(ngDevMode ? [{ debugName: "fileName" }] : /* istanbul ignore next */ []));
|
|
1176
|
+
ngOnInit() {
|
|
1177
|
+
this.writeValue(this.value());
|
|
1160
1178
|
}
|
|
1161
|
-
//
|
|
1162
|
-
|
|
1179
|
+
// #endregion
|
|
1180
|
+
// #region Protected methods
|
|
1181
|
+
onClick(event) {
|
|
1182
|
+
event.preventDefault();
|
|
1163
1183
|
this.fileInput()?.nativeElement.click();
|
|
1164
|
-
this.onTouched();
|
|
1165
1184
|
}
|
|
1166
1185
|
onFileSelected(event) {
|
|
1167
1186
|
const file = event.target.files[0];
|
|
@@ -1178,8 +1197,7 @@ class MatFileInputComponent {
|
|
|
1178
1197
|
};
|
|
1179
1198
|
const newValue = [...(this.value() ?? [])];
|
|
1180
1199
|
newValue.push(newFile);
|
|
1181
|
-
this.
|
|
1182
|
-
this.setValue(newValue);
|
|
1200
|
+
this.value.set(newValue);
|
|
1183
1201
|
}
|
|
1184
1202
|
}
|
|
1185
1203
|
onDelete() {
|
|
@@ -1192,15 +1210,18 @@ class MatFileInputComponent {
|
|
|
1192
1210
|
else {
|
|
1193
1211
|
file.toDelete = true;
|
|
1194
1212
|
}
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1213
|
+
if (newValue.length === 0) {
|
|
1214
|
+
this.value.set(null);
|
|
1215
|
+
}
|
|
1216
|
+
else {
|
|
1217
|
+
this.value.set(newValue);
|
|
1218
|
+
}
|
|
1198
1219
|
}
|
|
1199
1220
|
}
|
|
1200
1221
|
onDownload() {
|
|
1201
1222
|
this.onDownloadEmitter.emit(this.value());
|
|
1202
1223
|
}
|
|
1203
|
-
//
|
|
1224
|
+
// #region Private methods
|
|
1204
1225
|
getFileNameParts(fileName) {
|
|
1205
1226
|
const lastDotIndex = fileName.lastIndexOf('.');
|
|
1206
1227
|
if (lastDotIndex === -1) {
|
|
@@ -1217,162 +1238,142 @@ class MatFileInputComponent {
|
|
|
1217
1238
|
return parts.length > 2 ? parts[parts.length - 2] : '';
|
|
1218
1239
|
}
|
|
1219
1240
|
getLastFile(value) {
|
|
1220
|
-
|
|
1241
|
+
const response = (value ?? []).at(-1);
|
|
1242
|
+
return response ?? null;
|
|
1221
1243
|
}
|
|
1222
1244
|
getSafeFileName(file) {
|
|
1245
|
+
if (!file) {
|
|
1246
|
+
return '';
|
|
1247
|
+
}
|
|
1223
1248
|
const { name, extension } = this.getFileNameParts(file.name);
|
|
1224
1249
|
const hash = this.getHashFromFileName(file.name);
|
|
1225
1250
|
const fileName = name.replace(`.${hash}`, '');
|
|
1226
1251
|
return `${decodeURIComponent(fileName)}.${extension}`;
|
|
1227
1252
|
}
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1253
|
+
writeValue(value = null) {
|
|
1254
|
+
if (Array.isArray(value)) {
|
|
1255
|
+
this.value.set(cloneDeep(value));
|
|
1256
|
+
}
|
|
1257
|
+
else if (typeof value === 'string') {
|
|
1258
|
+
const hash = this.getHashFromFileName(value);
|
|
1259
|
+
const file = {
|
|
1260
|
+
isNew: !value,
|
|
1261
|
+
hash,
|
|
1262
|
+
name: value,
|
|
1263
|
+
path: this.directory(),
|
|
1264
|
+
toDelete: false,
|
|
1265
|
+
};
|
|
1266
|
+
this.value.set([file]);
|
|
1267
|
+
}
|
|
1239
1268
|
}
|
|
1240
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1241
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.
|
|
1242
|
-
{
|
|
1243
|
-
multi: true,
|
|
1244
|
-
provide: NG_VALUE_ACCESSOR,
|
|
1245
|
-
useExisting: MatFileInputComponent,
|
|
1246
|
-
},
|
|
1247
|
-
], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"file-input-container\">\n <input\n #fileInput\n (change)=\"onFileSelected($event)\"\n [disabled]=\"isDisabled()\"\n class=\"file-input\"\n hidden\n type=\"file\"\n />\n\n @if (isFileSelected()) {\n <div class=\"file-details\">\n <span class=\"file-name\" (click)=\"onDownload()\">{{ fileName() }}</span>\n <button mat-icon-button (click)=\"onDelete()\" [disabled]=\"isDisabled() || readonly()\">\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n } @else {\n <button mat-raised-button (click)=\"onClick()\" [disabled]=\"isDisabled() || readonly()\">\n <mat-icon>{{ icon() }}</mat-icon>\n <span>{{ label() }}</span>\n </button>\n }\n</div>", styles: [":host .file-input-container{display:flex;align-items:center}:host .file-details{display:flex;align-items:center;gap:8px}:host .file-name{cursor:pointer;text-decoration:underline;color:#00f}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1$4.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i1$4.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
1269
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MatFileInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1270
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: MatFileInputComponent, isStandalone: true, selector: "cl-mat-file-input", inputs: { directory: { classPropertyName: "directory", publicName: "directory", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onDownloadEmitter: "onDownload", value: "valueChange" }, viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"file-input-container\">\n <input\n (change)=\"onFileSelected($event)\"\n class=\"file-input\"\n [disabled]=\"disabled()\"\n #fileInput\n hidden\n type=\"file\"\n />\n\n @if (isFileSelected()) {\n <div class=\"file-details\">\n <span class=\"file-name\" (click)=\"onDownload()\">{{ fileName() }}</span>\n @if (!readonly()) {\n <button\n (click)=\"onDelete()\"\n [disabled]=\"disabled()\"\n mat-icon-button\n type=\"button\"\n >\n <mat-icon>delete</mat-icon>\n </button>\n }\n </div>\n } @else {\n <button\n (click)=\"onClick($event)\"\n [disabled]=\"disabled() || readonly()\"\n mat-raised-button\n type=\"button\"\n >\n <mat-icon>{{ icon() }}</mat-icon>\n <span>{{ label() }}</span>\n </button>\n }\n</div>\n", styles: [":host .file-input-container{display:flex;align-items:center}:host .file-details{display:flex;align-items:center;gap:8px}:host .file-name{cursor:pointer;text-decoration:underline;color:#00f}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1$4.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i1$4.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
1248
1271
|
}
|
|
1249
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1272
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MatFileInputComponent, decorators: [{
|
|
1250
1273
|
type: Component,
|
|
1251
|
-
args: [{ selector: 'cl-mat-file-input', standalone: true, imports: [
|
|
1252
|
-
|
|
1253
|
-
multi: true,
|
|
1254
|
-
provide: NG_VALUE_ACCESSOR,
|
|
1255
|
-
useExisting: MatFileInputComponent,
|
|
1256
|
-
},
|
|
1257
|
-
], template: "<div class=\"file-input-container\">\n <input\n #fileInput\n (change)=\"onFileSelected($event)\"\n [disabled]=\"isDisabled()\"\n class=\"file-input\"\n hidden\n type=\"file\"\n />\n\n @if (isFileSelected()) {\n <div class=\"file-details\">\n <span class=\"file-name\" (click)=\"onDownload()\">{{ fileName() }}</span>\n <button mat-icon-button (click)=\"onDelete()\" [disabled]=\"isDisabled() || readonly()\">\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n } @else {\n <button mat-raised-button (click)=\"onClick()\" [disabled]=\"isDisabled() || readonly()\">\n <mat-icon>{{ icon() }}</mat-icon>\n <span>{{ label() }}</span>\n </button>\n }\n</div>", styles: [":host .file-input-container{display:flex;align-items:center}:host .file-details{display:flex;align-items:center;gap:8px}:host .file-name{cursor:pointer;text-decoration:underline;color:#00f}\n"] }]
|
|
1258
|
-
}], propDecorators: { directory: [{ type: i0.Input, args: [{ isSignal: true, alias: "directory", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], onDownloadEmitter: [{ type: i0.Output, args: ["onDownload"] }], fileInput: [{ type: i0.ViewChild, args: ['fileInput', { isSignal: true }] }] } });
|
|
1274
|
+
args: [{ selector: 'cl-mat-file-input', standalone: true, imports: [MatButtonModule, MatIconModule], template: "<div class=\"file-input-container\">\n <input\n (change)=\"onFileSelected($event)\"\n class=\"file-input\"\n [disabled]=\"disabled()\"\n #fileInput\n hidden\n type=\"file\"\n />\n\n @if (isFileSelected()) {\n <div class=\"file-details\">\n <span class=\"file-name\" (click)=\"onDownload()\">{{ fileName() }}</span>\n @if (!readonly()) {\n <button\n (click)=\"onDelete()\"\n [disabled]=\"disabled()\"\n mat-icon-button\n type=\"button\"\n >\n <mat-icon>delete</mat-icon>\n </button>\n }\n </div>\n } @else {\n <button\n (click)=\"onClick($event)\"\n [disabled]=\"disabled() || readonly()\"\n mat-raised-button\n type=\"button\"\n >\n <mat-icon>{{ icon() }}</mat-icon>\n <span>{{ label() }}</span>\n </button>\n }\n</div>\n", styles: [":host .file-input-container{display:flex;align-items:center}:host .file-details{display:flex;align-items:center;gap:8px}:host .file-name{cursor:pointer;text-decoration:underline;color:#00f}\n"] }]
|
|
1275
|
+
}], propDecorators: { directory: [{ type: i0.Input, args: [{ isSignal: true, alias: "directory", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], onDownloadEmitter: [{ type: i0.Output, args: ["onDownload"] }], fileInput: [{ type: i0.ViewChild, args: ['fileInput', { isSignal: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
1259
1276
|
|
|
1260
|
-
|
|
1261
|
-
|
|
1277
|
+
function matFileInputsRequired(message = 'This field is required') {
|
|
1278
|
+
return (path) => {
|
|
1279
|
+
return validate(path, ({ value }) => {
|
|
1280
|
+
if (value()?.some((file) => file === null || file.at(-1)?.toDelete)) {
|
|
1281
|
+
return {
|
|
1282
|
+
kind: 'mat-file-inputs-required',
|
|
1283
|
+
message,
|
|
1284
|
+
};
|
|
1285
|
+
}
|
|
1286
|
+
return null;
|
|
1287
|
+
});
|
|
1288
|
+
};
|
|
1289
|
+
}
|
|
1290
|
+
class MatFileInputsComponent {
|
|
1291
|
+
// #region Inputs and outputs
|
|
1262
1292
|
directory = input('', /* @ts-ignore */
|
|
1263
1293
|
...(ngDevMode ? [{ debugName: "directory" }] : /* istanbul ignore next */ []));
|
|
1294
|
+
disabled = input(false, /* @ts-ignore */
|
|
1295
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
1264
1296
|
icon = input('add', /* @ts-ignore */
|
|
1265
1297
|
...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
1266
1298
|
label = input('Browse', /* @ts-ignore */
|
|
1267
1299
|
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
1268
|
-
|
|
1269
|
-
...(ngDevMode ? [{ debugName: "
|
|
1300
|
+
maxFiles = input(5, /* @ts-ignore */
|
|
1301
|
+
...(ngDevMode ? [{ debugName: "maxFiles" }] : /* istanbul ignore next */ []));
|
|
1270
1302
|
readonly = input(false, /* @ts-ignore */
|
|
1271
1303
|
...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
1272
1304
|
onDownloadEmitter = output({ alias: 'onDownload' });
|
|
1305
|
+
// #endregion
|
|
1306
|
+
// #region Properties
|
|
1307
|
+
value = model(null, /* @ts-ignore */
|
|
1308
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1309
|
+
form = form(this.value);
|
|
1310
|
+
// #endregion
|
|
1311
|
+
// #region NG Hooks
|
|
1312
|
+
ngOnInit() {
|
|
1313
|
+
this.writeValue(this.value());
|
|
1314
|
+
}
|
|
1315
|
+
// #endregion
|
|
1316
|
+
// #region Protected methods
|
|
1273
1317
|
onAdd() {
|
|
1274
|
-
this.
|
|
1275
|
-
this.cdRef.markForCheck();
|
|
1318
|
+
this.value.update((value) => [...(value ?? []), null]);
|
|
1276
1319
|
}
|
|
1277
1320
|
onDelete(index) {
|
|
1278
|
-
this.
|
|
1279
|
-
|
|
1321
|
+
this.value.update((currentValue) => {
|
|
1322
|
+
if (!currentValue) {
|
|
1323
|
+
return null;
|
|
1324
|
+
}
|
|
1325
|
+
// Return a new array with the item removed
|
|
1326
|
+
return currentValue.filter((_, i) => i !== index);
|
|
1327
|
+
});
|
|
1280
1328
|
}
|
|
1281
1329
|
onDownload(file) {
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
setDisabledState(isDisabled) {
|
|
1285
|
-
for (const control of this.formArray.controls) {
|
|
1286
|
-
if (isDisabled) {
|
|
1287
|
-
control.disable();
|
|
1288
|
-
}
|
|
1289
|
-
else {
|
|
1290
|
-
control.enable();
|
|
1291
|
-
}
|
|
1330
|
+
if (!file) {
|
|
1331
|
+
return;
|
|
1292
1332
|
}
|
|
1333
|
+
this.onDownloadEmitter.emit(file);
|
|
1293
1334
|
}
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
const
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
required: true
|
|
1301
|
-
};
|
|
1302
|
-
}
|
|
1303
|
-
}
|
|
1304
|
-
return null;
|
|
1335
|
+
onValueChange(file, index) {
|
|
1336
|
+
this.value.update((value) => {
|
|
1337
|
+
const newValue = [...(value ?? [])];
|
|
1338
|
+
newValue[index] = file;
|
|
1339
|
+
return newValue;
|
|
1340
|
+
});
|
|
1305
1341
|
}
|
|
1342
|
+
// #region Private methods
|
|
1306
1343
|
writeValue(value) {
|
|
1307
1344
|
if (Array.isArray(value)) {
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
this.onAdd();
|
|
1315
|
-
}
|
|
1316
|
-
this.setValue(value);
|
|
1317
|
-
}
|
|
1318
|
-
});
|
|
1345
|
+
if (value.length === 0) {
|
|
1346
|
+
this.onAdd();
|
|
1347
|
+
}
|
|
1348
|
+
else {
|
|
1349
|
+
this.value.set(value);
|
|
1350
|
+
}
|
|
1319
1351
|
}
|
|
1320
1352
|
else if (!this.readonly()) {
|
|
1321
1353
|
this.onAdd();
|
|
1322
1354
|
}
|
|
1323
1355
|
}
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
}
|
|
1327
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: MatFileInputsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1328
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: MatFileInputsComponent, isStandalone: true, selector: "cl-mat-file-inputs", inputs: { directory: { classPropertyName: "directory", publicName: "directory", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onDownloadEmitter: "onDownload" }, providers: [
|
|
1329
|
-
{
|
|
1330
|
-
multi: true,
|
|
1331
|
-
provide: NG_VALIDATORS,
|
|
1332
|
-
useExisting: MatFileInputsComponent
|
|
1333
|
-
},
|
|
1334
|
-
{
|
|
1335
|
-
multi: true,
|
|
1336
|
-
provide: NG_VALUE_ACCESSOR,
|
|
1337
|
-
useExisting: MatFileInputsComponent
|
|
1338
|
-
}
|
|
1339
|
-
], usesInheritance: true, ngImport: i0, template: "<ng-container [formGroup]=\"formGroup\">\n @for (item of formArray.value; track index; let index = $index) {\n <div class=\"flex mb-3\">\n <cl-mat-file-input [formControlName]=\"index\" [directory]=\"directory()\" [icon]=\"icon()\" [label]=\"label()\"\n (onDownload)=\"onDownload($event)\" [readonly]=\"readonly()\" />\n @if (!readonly()) {\n @if (index === 0) {\n <button (click)=\"onAdd()\" [disabled]=\"formArray.length >= max()\" mat-icon-button type=\"button\">\n <mat-icon>{{ icon() }}</mat-icon>\n </button>\n } @else if (index > 0) {\n <button (click)=\"onDelete(index)\" mat-icon-button type=\"button\">\n <mat-icon>remove</mat-icon>\n </button>\n }\n }\n </div>\n }\n</ng-container>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1$4.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatFileInputComponent, selector: "cl-mat-file-input", inputs: ["directory", "icon", "label", "readonly"], outputs: ["onDownload"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
|
|
1356
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MatFileInputsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1357
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: MatFileInputsComponent, isStandalone: true, selector: "cl-mat-file-inputs", inputs: { directory: { classPropertyName: "directory", publicName: "directory", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, maxFiles: { classPropertyName: "maxFiles", publicName: "maxFiles", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onDownloadEmitter: "onDownload", value: "valueChange" }, ngImport: i0, template: "@for (item of value(); track index; let index = $index) {\n <div class=\"flex mb-3\">\n <cl-mat-file-input\n [directory]=\"directory()\"\n [icon]=\"icon()\"\n [label]=\"label()\"\n (onDownload)=\"onDownload($event)\"\n [value]=\"item\"\n (valueChange)=\"onValueChange($event, index)\"\n />\n @if (!readonly()) {\n @if (index === 0) {\n @let allowMoreFiles = (value()?.length ?? 0) < maxFiles();\n <button\n (click)=\"onAdd()\"\n [disabled]=\"disabled() || !allowMoreFiles\"\n mat-icon-button\n type=\"button\"\n >\n <mat-icon>{{ icon() }}</mat-icon>\n </button>\n } @else if (index > 0) {\n <button (click)=\"onDelete(index)\" mat-icon-button type=\"button\">\n <mat-icon>remove</mat-icon>\n </button>\n }\n }\n </div>\n}\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1$4.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatFileInputComponent, selector: "cl-mat-file-input", inputs: ["directory", "disabled", "icon", "label", "readonly", "value"], outputs: ["onDownload", "valueChange"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
1340
1358
|
}
|
|
1341
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1359
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MatFileInputsComponent, decorators: [{
|
|
1342
1360
|
type: Component,
|
|
1343
|
-
args: [{ selector: 'cl-mat-file-inputs', imports: [
|
|
1344
|
-
|
|
1345
|
-
MatFileInputComponent,
|
|
1346
|
-
MatIconModule,
|
|
1347
|
-
FormsModule,
|
|
1348
|
-
ReactiveFormsModule,
|
|
1349
|
-
], providers: [
|
|
1350
|
-
{
|
|
1351
|
-
multi: true,
|
|
1352
|
-
provide: NG_VALIDATORS,
|
|
1353
|
-
useExisting: MatFileInputsComponent
|
|
1354
|
-
},
|
|
1355
|
-
{
|
|
1356
|
-
multi: true,
|
|
1357
|
-
provide: NG_VALUE_ACCESSOR,
|
|
1358
|
-
useExisting: MatFileInputsComponent
|
|
1359
|
-
}
|
|
1360
|
-
], template: "<ng-container [formGroup]=\"formGroup\">\n @for (item of formArray.value; track index; let index = $index) {\n <div class=\"flex mb-3\">\n <cl-mat-file-input [formControlName]=\"index\" [directory]=\"directory()\" [icon]=\"icon()\" [label]=\"label()\"\n (onDownload)=\"onDownload($event)\" [readonly]=\"readonly()\" />\n @if (!readonly()) {\n @if (index === 0) {\n <button (click)=\"onAdd()\" [disabled]=\"formArray.length >= max()\" mat-icon-button type=\"button\">\n <mat-icon>{{ icon() }}</mat-icon>\n </button>\n } @else if (index > 0) {\n <button (click)=\"onDelete(index)\" mat-icon-button type=\"button\">\n <mat-icon>remove</mat-icon>\n </button>\n }\n }\n </div>\n }\n</ng-container>\n" }]
|
|
1361
|
-
}], propDecorators: { directory: [{ type: i0.Input, args: [{ isSignal: true, alias: "directory", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], onDownloadEmitter: [{ type: i0.Output, args: ["onDownload"] }] } });
|
|
1361
|
+
args: [{ selector: 'cl-mat-file-inputs', imports: [MatButtonModule, MatFileInputComponent, MatIconModule], template: "@for (item of value(); track index; let index = $index) {\n <div class=\"flex mb-3\">\n <cl-mat-file-input\n [directory]=\"directory()\"\n [icon]=\"icon()\"\n [label]=\"label()\"\n (onDownload)=\"onDownload($event)\"\n [value]=\"item\"\n (valueChange)=\"onValueChange($event, index)\"\n />\n @if (!readonly()) {\n @if (index === 0) {\n @let allowMoreFiles = (value()?.length ?? 0) < maxFiles();\n <button\n (click)=\"onAdd()\"\n [disabled]=\"disabled() || !allowMoreFiles\"\n mat-icon-button\n type=\"button\"\n >\n <mat-icon>{{ icon() }}</mat-icon>\n </button>\n } @else if (index > 0) {\n <button (click)=\"onDelete(index)\" mat-icon-button type=\"button\">\n <mat-icon>remove</mat-icon>\n </button>\n }\n }\n </div>\n}\n" }]
|
|
1362
|
+
}], propDecorators: { directory: [{ type: i0.Input, args: [{ isSignal: true, alias: "directory", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], maxFiles: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxFiles", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], onDownloadEmitter: [{ type: i0.Output, args: ["onDownload"] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
1362
1363
|
|
|
1363
1364
|
;
|
|
1364
1365
|
|
|
1365
1366
|
class CommonLibModule {
|
|
1366
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1367
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.
|
|
1368
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.
|
|
1367
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CommonLibModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1368
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.6", ngImport: i0, type: CommonLibModule });
|
|
1369
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CommonLibModule, providers: [
|
|
1369
1370
|
ConfirmationService$1,
|
|
1370
1371
|
DialogService,
|
|
1371
1372
|
DynamicDialogConfig,
|
|
1372
1373
|
MessageService,
|
|
1373
1374
|
] });
|
|
1374
1375
|
}
|
|
1375
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1376
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CommonLibModule, decorators: [{
|
|
1376
1377
|
type: NgModule,
|
|
1377
1378
|
args: [{
|
|
1378
1379
|
providers: [
|
|
@@ -1397,5 +1398,5 @@ function concatWithToArray(values) {
|
|
|
1397
1398
|
* Generated bundle index. Do not edit.
|
|
1398
1399
|
*/
|
|
1399
1400
|
|
|
1400
|
-
export { BaseFormComponent, ButtonComponent, ClStateService, CommonLibModule, ConfirmationComponent, ConfirmationService, ContentDialogComponent, ContentDialogService, ERROR_DIRECTIVE, ErrorDirective, FORM_FIELD, FileInputComponent, FileInputsComponent, FormDialogComponent, FormDialogService, FormFieldComponent, FormFieldModule, IconButtonComponent, LABEL_DIRECTIVE, LabelDirective, MatConfirmationComponent, MatConfirmationService, MatFileInputComponent, MatFileInputsComponent, MatFormDialogComponent, MatFormDialogService, MatFormHostableComponent, ProgressBarDialogComponent, ProgressBarDialogService, ReadonlyValueComponent, ToastsComponent, ToastsService, concatWithToArray };
|
|
1401
|
+
export { BaseFormComponent, ButtonComponent, ClStateService, CommonLibModule, ConfirmationComponent, ConfirmationService, ContentDialogComponent, ContentDialogService, ERROR_DIRECTIVE, ErrorDirective, FORM_FIELD, FileInputComponent, FileInputsComponent, FormDialogComponent, FormDialogService, FormFieldComponent, FormFieldModule, IconButtonComponent, LABEL_DIRECTIVE, LabelDirective, MatConfirmationComponent, MatConfirmationService, MatFileInputComponent, MatFileInputsComponent, MatFormDialogComponent, MatFormDialogService, MatFormHostableComponent, PanelComponent, ProgressBarDialogComponent, ProgressBarDialogService, ReadonlyValueComponent, ToastsComponent, ToastsService, concatWithToArray, matFileInputRequired, matFileInputsRequired };
|
|
1401
1402
|
//# sourceMappingURL=jm-7c3-common-lib.mjs.map
|