@corp-products/ui-components 4.3.1 → 4.3.3
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.
|
@@ -757,11 +757,11 @@ class FileManagementComponent extends BaseInputComponent {
|
|
|
757
757
|
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
|
|
758
758
|
}
|
|
759
759
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: FileManagementComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
760
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: FileManagementComponent, isStandalone: true, selector: "app-file-management", inputs: { existingFiles: { classPropertyName: "existingFiles", publicName: "existingFiles", isSignal: true, isRequired: false, transformFunction: null }, acceptedTypes: { classPropertyName: "acceptedTypes", publicName: "acceptedTypes", isSignal: true, isRequired: false, transformFunction: null }, maxFileSize: { classPropertyName: "maxFileSize", publicName: "maxFileSize", isSignal: true, isRequired: false, transformFunction: null }, maxConcurrentUploads: { classPropertyName: "maxConcurrentUploads", publicName: "maxConcurrentUploads", isSignal: true, isRequired: false, transformFunction: null }, showTable: { classPropertyName: "showTable", publicName: "showTable", isSignal: true, isRequired: false, transformFunction: null }, showDropZone: { classPropertyName: "showDropZone", publicName: "showDropZone", isSignal: true, isRequired: false, transformFunction: null }, allowPreview: { classPropertyName: "allowPreview", publicName: "allowPreview", isSignal: true, isRequired: false, transformFunction: null }, permissonKey: { classPropertyName: "permissonKey", publicName: "permissonKey", isSignal: true, isRequired: false, transformFunction: null }, allowedActions: { classPropertyName: "allowedActions", publicName: "allowedActions", isSignal: true, isRequired: false, transformFunction: null }, uploadFn: { classPropertyName: "uploadFn", publicName: "uploadFn", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filesUploaded: "filesUploaded", fileDeleted: "fileDeleted", filePreview: "filePreview", fileDownload: "fileDownload", uploadError: "uploadError", newFilesChange: "newFilesChange", uploadStateChange: "uploadStateChange" }, viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"file-management\">\r\n @if (showDropZone()) {\r\n <div\r\n class=\"drop-zone upload-container\"\r\n [class.drag-over]=\"isDragOver()\"\r\n (dragover)=\"onDragOver($event)\"\r\n (dragleave)=\"onDragLeave($event)\"\r\n (drop)=\"onDrop($event)\"\r\n >\r\n <div class=\"drop-zone-content\">\r\n <p class=\"drop-text\">{{ 'file.drag_drop_files' | translate }}</p>\r\n <p-button\r\n [label]=\"'file.browse' | translate\"\r\n severity=\"danger\"\r\n [outlined]=\"true\"\r\n (onClick)=\"onBrowseClick()\"\r\n />\r\n <p class=\"drop-hint text-xs text-gray-500 mt-2\">\r\n {{ 'file.max_size_hint' | translate }}: {{ maxFileSize() | fileSize: 2 : 'MB' }}\r\n </p>\r\n @if (formattedAcceptedTypes()) {\r\n <p class=\"accepted-types text-xs text-gray-400\">\r\n {{ 'file.accepted_types' | translate }}: {{ formattedAcceptedTypes() }}\r\n </p>\r\n }\r\n </div>\r\n </div>\r\n }\r\n\r\n <input\r\n #fileInput\r\n type=\"file\"\r\n [accept]=\"acceptedTypes()\"\r\n [multiple]=\"!uploadFn()\"\r\n hidden\r\n (change)=\"onFileInputChange($event)\"\r\n />\r\n\r\n @for (file of newFiles(); track file.id) {\r\n <div class=\"uploaded-files\">\r\n <div class=\"file-details\">\r\n <p class=\"file-name\">{{ file.fileName }}</p>\r\n @if (file.status === UploadStatus.UPLOADING) {\r\n <span class=\"upload-percentage\">{{ file.progress ?? 0 }}%</span>\r\n } @else if (file.status === UploadStatus.SUCCESS) {\r\n <i class=\"pi pi-check-circle success-icon\"></i>\r\n } @else if (file.status === UploadStatus.FAILED) {\r\n <span class=\"upload-error-text\">{{ file.error }}</span>\r\n }\r\n </div>\r\n <i\r\n class=\"pi pi-trash delete-icon\"\r\n [class.disabled]=\"file.status === UploadStatus.UPLOADING\"\r\n (click)=\"file.status !== UploadStatus.UPLOADING && onDeleteFile(file)\"\r\n ></i>\r\n </div>\r\n }\r\n\r\n @if (!uploadFn() && uploadedFile().length) {\r\n @for (file of uploadedFile(); track file.name) {\r\n <div class=\"uploaded-files\">\r\n <p>{{ file.name }}</p>\r\n <i class=\"pi pi-trash delete-icon\" (click)=\"deleteFile()\"></i>\r\n </div>\r\n }\r\n }\r\n\r\n @if (uploadErrorMessage) {\r\n <div class=\"upload-error\">\r\n <i class=\"pi pi-exclamation-circle\"></i>\r\n <span>{{ uploadErrorMessage }}</span>\r\n </div>\r\n }\r\n</div>\r\n", styles: [".file-management{width:100%}.drop-zone{@apply cursor-pointer rounded-l border-2 border-dashed border-gray-300 p-8 bg-purple-light3 text-center transition-all duration-200 ease-in-out;}.drop-zone.drag-over{@apply border-purple-200 bg-purple-light;}.drop-zone-content{@apply flex flex-col items-center gap-2;}.drop-icon{font-size:3rem;color:var(--gray-400, #9ca3af);margin-bottom:.5rem}.drop-text{font-size:1rem;color:var(--gray-700, #374151);margin:0}.drop-or{font-size:.875rem;color:var(--gray-500, #6b7280);margin:.25rem 0}.drop-hint{margin-top:.75rem}.files-table{border:1px solid var(--gray-200, #e5e7eb);border-radius:8px;overflow:hidden}:host-context([dir=rtl]) .drop-zone-content{direction:rtl}.upload-container{background-color:#f3f3f7;padding:15px;border:1px dashed #DFE0E6;margin-bottom:15px;display:flex;justify-content:center;align-items:center;border-radius:2px}.upload-container .drop-zone-content{display:flex;align-items:center;flex-direction:column}.upload-container .drop-zone-content .drop-text{margin-bottom:10px}.uploaded-files{background-color:#f3f3f7;border:1px solid #DFE0E6;display:flex;justify-content:space-between;align-items:center;padding:15px;margin-bottom:10px}.uploaded-files .file-details{display:flex;flex-direction:column;gap:.25rem;flex:1;min-width:0}.uploaded-files .file-name{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.uploaded-files .upload-percentage{font-size:.875rem;font-weight:500;color:var(--primary-color, #3b82f6)}.uploaded-files .success-icon{color:#22c55e;font-size:1.25rem}.uploaded-files .upload-error-text{color:#ef4444;font-size:.875rem}.uploaded-files .delete-icon{cursor:pointer;font-size:1.5rem;color:red;flex-shrink:0}.uploaded-files .delete-icon.disabled{opacity:.5;cursor:not-allowed}.upload-error{display:flex;align-items:center;gap:.5rem;color:#ef4444;font-size:.875rem;margin-top:.5rem}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i1.Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "pipe", type: FileSizePipe, name: "fileSize" }] });
|
|
760
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: FileManagementComponent, isStandalone: true, selector: "app-file-management", inputs: { existingFiles: { classPropertyName: "existingFiles", publicName: "existingFiles", isSignal: true, isRequired: false, transformFunction: null }, acceptedTypes: { classPropertyName: "acceptedTypes", publicName: "acceptedTypes", isSignal: true, isRequired: false, transformFunction: null }, maxFileSize: { classPropertyName: "maxFileSize", publicName: "maxFileSize", isSignal: true, isRequired: false, transformFunction: null }, maxConcurrentUploads: { classPropertyName: "maxConcurrentUploads", publicName: "maxConcurrentUploads", isSignal: true, isRequired: false, transformFunction: null }, showTable: { classPropertyName: "showTable", publicName: "showTable", isSignal: true, isRequired: false, transformFunction: null }, showDropZone: { classPropertyName: "showDropZone", publicName: "showDropZone", isSignal: true, isRequired: false, transformFunction: null }, allowPreview: { classPropertyName: "allowPreview", publicName: "allowPreview", isSignal: true, isRequired: false, transformFunction: null }, permissonKey: { classPropertyName: "permissonKey", publicName: "permissonKey", isSignal: true, isRequired: false, transformFunction: null }, allowedActions: { classPropertyName: "allowedActions", publicName: "allowedActions", isSignal: true, isRequired: false, transformFunction: null }, uploadFn: { classPropertyName: "uploadFn", publicName: "uploadFn", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filesUploaded: "filesUploaded", fileDeleted: "fileDeleted", filePreview: "filePreview", fileDownload: "fileDownload", uploadError: "uploadError", newFilesChange: "newFilesChange", uploadStateChange: "uploadStateChange" }, viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"file-management\">\r\n @if (showDropZone()) {\r\n <div\r\n class=\"drop-zone upload-container\"\r\n [class.drag-over]=\"isDragOver()\"\r\n (dragover)=\"onDragOver($event)\"\r\n (dragleave)=\"onDragLeave($event)\"\r\n (drop)=\"onDrop($event)\"\r\n >\r\n <div class=\"drop-zone-content\">\r\n <p class=\"drop-text\">{{ 'file.drag_drop_files' | translate }}</p>\r\n <p-button\r\n [label]=\"'file.browse' | translate\"\r\n severity=\"danger\"\r\n [outlined]=\"true\"\r\n (onClick)=\"onBrowseClick()\"\r\n />\r\n <p class=\"drop-hint text-xs text-gray-500 mt-2\">\r\n {{ 'file.max_size_hint' | translate }}: {{ maxFileSize() | fileSize: 2 : 'MB' }}\r\n </p>\r\n @if (formattedAcceptedTypes()) {\r\n <p class=\"accepted-types text-xs text-gray-400\">\r\n {{ 'file.accepted_types' | translate }}: {{ formattedAcceptedTypes() }}\r\n </p>\r\n }\r\n </div>\r\n </div>\r\n }\r\n\r\n <input\r\n #fileInput\r\n type=\"file\"\r\n [accept]=\"acceptedTypes()\"\r\n [multiple]=\"!uploadFn()\"\r\n hidden\r\n (change)=\"onFileInputChange($event)\"\r\n />\r\n\r\n @for (file of newFiles(); track file.id) {\r\n <div class=\"uploaded-files\">\r\n <div class=\"file-details\">\r\n <p class=\"file-name\">{{ file.fileName }}</p>\r\n <span class=\"file-size\">{{ file.size | fileSize: 2 : 'MB' }}</span>\r\n @if (file.status === UploadStatus.UPLOADING) {\r\n <div class=\"upload-status uploading\">\r\n <span class=\"upload-status-text\">{{ 'file.uploading' | translate }}</span>\r\n <span class=\"upload-percentage\">{{ file.progress ?? 0 }}%</span>\r\n </div>\r\n } @else if (file.status === UploadStatus.SUCCESS) {\r\n <div class=\"upload-status success\">\r\n <span class=\"upload-status-text\">{{ 'file.uploaded' | translate }}</span>\r\n <i class=\"pi pi-check-circle success-icon\"></i>\r\n </div>\r\n } @else if (file.status === UploadStatus.FAILED) {\r\n <span class=\"upload-error-text\">{{ file.error }}</span>\r\n }\r\n </div>\r\n <i\r\n class=\"pi pi-trash delete-icon\"\r\n [class.disabled]=\"file.status === UploadStatus.UPLOADING\"\r\n (click)=\"file.status !== UploadStatus.UPLOADING && onDeleteFile(file)\"\r\n ></i>\r\n </div>\r\n }\r\n\r\n @if (!uploadFn() && uploadedFile().length) {\r\n @for (file of uploadedFile(); track file.name) {\r\n <div class=\"uploaded-files\">\r\n <div class=\"file-details\">\r\n <p class=\"file-name\">{{ file.name }}</p>\r\n <span class=\"file-size\">{{ file.size | fileSize: 2 : 'MB' }}</span>\r\n </div>\r\n <i class=\"pi pi-trash delete-icon\" (click)=\"deleteFile()\"></i>\r\n </div>\r\n }\r\n }\r\n\r\n @if (uploadErrorMessage) {\r\n <div class=\"upload-error\">\r\n <i class=\"pi pi-exclamation-circle\"></i>\r\n <span>{{ uploadErrorMessage }}</span>\r\n </div>\r\n }\r\n</div>\r\n", styles: [".file-management{width:100%}.drop-zone{@apply cursor-pointer rounded-l border-2 border-dashed border-gray-300 p-8 bg-purple-light3 text-center transition-all duration-200 ease-in-out;}.drop-zone.drag-over{@apply border-purple-200 bg-purple-light;}.drop-zone-content{@apply flex flex-col items-center gap-2;}.drop-icon{font-size:3rem;color:var(--gray-400, #9ca3af);margin-bottom:.5rem}.drop-text{font-size:1rem;color:var(--gray-700, #374151);margin:0}.drop-or{font-size:.875rem;color:var(--gray-500, #6b7280);margin:.25rem 0}.drop-hint{margin-top:.75rem}.files-table{border:1px solid var(--gray-200, #e5e7eb);border-radius:8px;overflow:hidden}:host-context([dir=rtl]) .drop-zone-content{direction:rtl}.upload-container{background-color:#f3f3f7;padding:15px;border:1px dashed #DFE0E6;margin-bottom:15px;display:flex;justify-content:center;align-items:center;border-radius:2px}.upload-container .drop-zone-content{display:flex;align-items:center;flex-direction:column}.upload-container .drop-zone-content .drop-text{margin-bottom:10px}.uploaded-files{background-color:#f3f3f7;border:1px solid #DFE0E6;display:flex;justify-content:space-between;align-items:center;padding:15px;margin-bottom:10px}.uploaded-files .file-details{display:flex;flex-direction:column;gap:.25rem;flex:1;min-width:0}.uploaded-files .file-name{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.uploaded-files .file-size{font-size:.75rem;color:#6b7280}.uploaded-files .upload-status{display:flex;align-items:center;gap:.5rem;font-size:.875rem;font-weight:500}.uploaded-files .upload-status.uploading{color:var(--p-orange-500, #f59e0b)}.uploaded-files .upload-status.uploading .upload-percentage{color:inherit}.uploaded-files .upload-status.success{color:#16a34a}.uploaded-files .upload-status.success .success-icon{color:inherit;font-size:1rem}.uploaded-files .upload-percentage{font-size:.875rem;font-weight:500;color:var(--primary-color, #3b82f6)}.uploaded-files .success-icon{color:#22c55e;font-size:1.25rem}.uploaded-files .upload-error-text{color:#ef4444;font-size:.875rem}.uploaded-files .delete-icon{cursor:pointer;font-size:1.5rem;color:red;flex-shrink:0}.uploaded-files .delete-icon.disabled{opacity:.5;cursor:not-allowed}.upload-error{display:flex;align-items:center;gap:.5rem;color:#ef4444;font-size:.875rem;margin-top:.5rem}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i1.Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "pipe", type: FileSizePipe, name: "fileSize" }] });
|
|
761
761
|
}
|
|
762
762
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: FileManagementComponent, decorators: [{
|
|
763
763
|
type: Component,
|
|
764
|
-
args: [{ selector: 'app-file-management', imports: [CommonModule, TranslatePipe, ButtonModule, TooltipModule, FileSizePipe], template: "<div class=\"file-management\">\r\n @if (showDropZone()) {\r\n <div\r\n class=\"drop-zone upload-container\"\r\n [class.drag-over]=\"isDragOver()\"\r\n (dragover)=\"onDragOver($event)\"\r\n (dragleave)=\"onDragLeave($event)\"\r\n (drop)=\"onDrop($event)\"\r\n >\r\n <div class=\"drop-zone-content\">\r\n <p class=\"drop-text\">{{ 'file.drag_drop_files' | translate }}</p>\r\n <p-button\r\n [label]=\"'file.browse' | translate\"\r\n severity=\"danger\"\r\n [outlined]=\"true\"\r\n (onClick)=\"onBrowseClick()\"\r\n />\r\n <p class=\"drop-hint text-xs text-gray-500 mt-2\">\r\n {{ 'file.max_size_hint' | translate }}: {{ maxFileSize() | fileSize: 2 : 'MB' }}\r\n </p>\r\n @if (formattedAcceptedTypes()) {\r\n <p class=\"accepted-types text-xs text-gray-400\">\r\n {{ 'file.accepted_types' | translate }}: {{ formattedAcceptedTypes() }}\r\n </p>\r\n }\r\n </div>\r\n </div>\r\n }\r\n\r\n <input\r\n #fileInput\r\n type=\"file\"\r\n [accept]=\"acceptedTypes()\"\r\n [multiple]=\"!uploadFn()\"\r\n hidden\r\n (change)=\"onFileInputChange($event)\"\r\n />\r\n\r\n @for (file of newFiles(); track file.id) {\r\n <div class=\"uploaded-files\">\r\n <div class=\"file-details\">\r\n <p class=\"file-name\">{{ file.fileName }}</p>\r\n @if (file.status === UploadStatus.UPLOADING) {\r\n <span class=\"upload-percentage\">{{ file.progress ?? 0 }}%</span>\r\n } @else if (file.status === UploadStatus.SUCCESS) {\r\n <i class=\"pi pi-check-circle success-icon\"></i>\r\n } @else if (file.status === UploadStatus.FAILED) {\r\n <span class=\"upload-error-text\">{{ file.error }}</span>\r\n }\r\n </div>\r\n <i\r\n class=\"pi pi-trash delete-icon\"\r\n [class.disabled]=\"file.status === UploadStatus.UPLOADING\"\r\n (click)=\"file.status !== UploadStatus.UPLOADING && onDeleteFile(file)\"\r\n ></i>\r\n </div>\r\n }\r\n\r\n @if (!uploadFn() && uploadedFile().length) {\r\n @for (file of uploadedFile(); track file.name) {\r\n <div class=\"uploaded-files\">\r\n <p>{{ file.name }}</p>\r\n <i class=\"pi pi-trash delete-icon\" (click)=\"deleteFile()\"></i>\r\n </div>\r\n }\r\n }\r\n\r\n @if (uploadErrorMessage) {\r\n <div class=\"upload-error\">\r\n <i class=\"pi pi-exclamation-circle\"></i>\r\n <span>{{ uploadErrorMessage }}</span>\r\n </div>\r\n }\r\n</div>\r\n", styles: [".file-management{width:100%}.drop-zone{@apply cursor-pointer rounded-l border-2 border-dashed border-gray-300 p-8 bg-purple-light3 text-center transition-all duration-200 ease-in-out;}.drop-zone.drag-over{@apply border-purple-200 bg-purple-light;}.drop-zone-content{@apply flex flex-col items-center gap-2;}.drop-icon{font-size:3rem;color:var(--gray-400, #9ca3af);margin-bottom:.5rem}.drop-text{font-size:1rem;color:var(--gray-700, #374151);margin:0}.drop-or{font-size:.875rem;color:var(--gray-500, #6b7280);margin:.25rem 0}.drop-hint{margin-top:.75rem}.files-table{border:1px solid var(--gray-200, #e5e7eb);border-radius:8px;overflow:hidden}:host-context([dir=rtl]) .drop-zone-content{direction:rtl}.upload-container{background-color:#f3f3f7;padding:15px;border:1px dashed #DFE0E6;margin-bottom:15px;display:flex;justify-content:center;align-items:center;border-radius:2px}.upload-container .drop-zone-content{display:flex;align-items:center;flex-direction:column}.upload-container .drop-zone-content .drop-text{margin-bottom:10px}.uploaded-files{background-color:#f3f3f7;border:1px solid #DFE0E6;display:flex;justify-content:space-between;align-items:center;padding:15px;margin-bottom:10px}.uploaded-files .file-details{display:flex;flex-direction:column;gap:.25rem;flex:1;min-width:0}.uploaded-files .file-name{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.uploaded-files .upload-percentage{font-size:.875rem;font-weight:500;color:var(--primary-color, #3b82f6)}.uploaded-files .success-icon{color:#22c55e;font-size:1.25rem}.uploaded-files .upload-error-text{color:#ef4444;font-size:.875rem}.uploaded-files .delete-icon{cursor:pointer;font-size:1.5rem;color:red;flex-shrink:0}.uploaded-files .delete-icon.disabled{opacity:.5;cursor:not-allowed}.upload-error{display:flex;align-items:center;gap:.5rem;color:#ef4444;font-size:.875rem;margin-top:.5rem}\n"] }]
|
|
764
|
+
args: [{ selector: 'app-file-management', imports: [CommonModule, TranslatePipe, ButtonModule, TooltipModule, FileSizePipe], template: "<div class=\"file-management\">\r\n @if (showDropZone()) {\r\n <div\r\n class=\"drop-zone upload-container\"\r\n [class.drag-over]=\"isDragOver()\"\r\n (dragover)=\"onDragOver($event)\"\r\n (dragleave)=\"onDragLeave($event)\"\r\n (drop)=\"onDrop($event)\"\r\n >\r\n <div class=\"drop-zone-content\">\r\n <p class=\"drop-text\">{{ 'file.drag_drop_files' | translate }}</p>\r\n <p-button\r\n [label]=\"'file.browse' | translate\"\r\n severity=\"danger\"\r\n [outlined]=\"true\"\r\n (onClick)=\"onBrowseClick()\"\r\n />\r\n <p class=\"drop-hint text-xs text-gray-500 mt-2\">\r\n {{ 'file.max_size_hint' | translate }}: {{ maxFileSize() | fileSize: 2 : 'MB' }}\r\n </p>\r\n @if (formattedAcceptedTypes()) {\r\n <p class=\"accepted-types text-xs text-gray-400\">\r\n {{ 'file.accepted_types' | translate }}: {{ formattedAcceptedTypes() }}\r\n </p>\r\n }\r\n </div>\r\n </div>\r\n }\r\n\r\n <input\r\n #fileInput\r\n type=\"file\"\r\n [accept]=\"acceptedTypes()\"\r\n [multiple]=\"!uploadFn()\"\r\n hidden\r\n (change)=\"onFileInputChange($event)\"\r\n />\r\n\r\n @for (file of newFiles(); track file.id) {\r\n <div class=\"uploaded-files\">\r\n <div class=\"file-details\">\r\n <p class=\"file-name\">{{ file.fileName }}</p>\r\n <span class=\"file-size\">{{ file.size | fileSize: 2 : 'MB' }}</span>\r\n @if (file.status === UploadStatus.UPLOADING) {\r\n <div class=\"upload-status uploading\">\r\n <span class=\"upload-status-text\">{{ 'file.uploading' | translate }}</span>\r\n <span class=\"upload-percentage\">{{ file.progress ?? 0 }}%</span>\r\n </div>\r\n } @else if (file.status === UploadStatus.SUCCESS) {\r\n <div class=\"upload-status success\">\r\n <span class=\"upload-status-text\">{{ 'file.uploaded' | translate }}</span>\r\n <i class=\"pi pi-check-circle success-icon\"></i>\r\n </div>\r\n } @else if (file.status === UploadStatus.FAILED) {\r\n <span class=\"upload-error-text\">{{ file.error }}</span>\r\n }\r\n </div>\r\n <i\r\n class=\"pi pi-trash delete-icon\"\r\n [class.disabled]=\"file.status === UploadStatus.UPLOADING\"\r\n (click)=\"file.status !== UploadStatus.UPLOADING && onDeleteFile(file)\"\r\n ></i>\r\n </div>\r\n }\r\n\r\n @if (!uploadFn() && uploadedFile().length) {\r\n @for (file of uploadedFile(); track file.name) {\r\n <div class=\"uploaded-files\">\r\n <div class=\"file-details\">\r\n <p class=\"file-name\">{{ file.name }}</p>\r\n <span class=\"file-size\">{{ file.size | fileSize: 2 : 'MB' }}</span>\r\n </div>\r\n <i class=\"pi pi-trash delete-icon\" (click)=\"deleteFile()\"></i>\r\n </div>\r\n }\r\n }\r\n\r\n @if (uploadErrorMessage) {\r\n <div class=\"upload-error\">\r\n <i class=\"pi pi-exclamation-circle\"></i>\r\n <span>{{ uploadErrorMessage }}</span>\r\n </div>\r\n }\r\n</div>\r\n", styles: [".file-management{width:100%}.drop-zone{@apply cursor-pointer rounded-l border-2 border-dashed border-gray-300 p-8 bg-purple-light3 text-center transition-all duration-200 ease-in-out;}.drop-zone.drag-over{@apply border-purple-200 bg-purple-light;}.drop-zone-content{@apply flex flex-col items-center gap-2;}.drop-icon{font-size:3rem;color:var(--gray-400, #9ca3af);margin-bottom:.5rem}.drop-text{font-size:1rem;color:var(--gray-700, #374151);margin:0}.drop-or{font-size:.875rem;color:var(--gray-500, #6b7280);margin:.25rem 0}.drop-hint{margin-top:.75rem}.files-table{border:1px solid var(--gray-200, #e5e7eb);border-radius:8px;overflow:hidden}:host-context([dir=rtl]) .drop-zone-content{direction:rtl}.upload-container{background-color:#f3f3f7;padding:15px;border:1px dashed #DFE0E6;margin-bottom:15px;display:flex;justify-content:center;align-items:center;border-radius:2px}.upload-container .drop-zone-content{display:flex;align-items:center;flex-direction:column}.upload-container .drop-zone-content .drop-text{margin-bottom:10px}.uploaded-files{background-color:#f3f3f7;border:1px solid #DFE0E6;display:flex;justify-content:space-between;align-items:center;padding:15px;margin-bottom:10px}.uploaded-files .file-details{display:flex;flex-direction:column;gap:.25rem;flex:1;min-width:0}.uploaded-files .file-name{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.uploaded-files .file-size{font-size:.75rem;color:#6b7280}.uploaded-files .upload-status{display:flex;align-items:center;gap:.5rem;font-size:.875rem;font-weight:500}.uploaded-files .upload-status.uploading{color:var(--p-orange-500, #f59e0b)}.uploaded-files .upload-status.uploading .upload-percentage{color:inherit}.uploaded-files .upload-status.success{color:#16a34a}.uploaded-files .upload-status.success .success-icon{color:inherit;font-size:1rem}.uploaded-files .upload-percentage{font-size:.875rem;font-weight:500;color:var(--primary-color, #3b82f6)}.uploaded-files .success-icon{color:#22c55e;font-size:1.25rem}.uploaded-files .upload-error-text{color:#ef4444;font-size:.875rem}.uploaded-files .delete-icon{cursor:pointer;font-size:1.5rem;color:red;flex-shrink:0}.uploaded-files .delete-icon.disabled{opacity:.5;cursor:not-allowed}.upload-error{display:flex;align-items:center;gap:.5rem;color:#ef4444;font-size:.875rem;margin-top:.5rem}\n"] }]
|
|
765
765
|
}], propDecorators: { existingFiles: [{ type: i0.Input, args: [{ isSignal: true, alias: "existingFiles", required: false }] }], acceptedTypes: [{ type: i0.Input, args: [{ isSignal: true, alias: "acceptedTypes", required: false }] }], maxFileSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxFileSize", required: false }] }], maxConcurrentUploads: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxConcurrentUploads", required: false }] }], showTable: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTable", required: false }] }], showDropZone: [{ type: i0.Input, args: [{ isSignal: true, alias: "showDropZone", required: false }] }], allowPreview: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowPreview", required: false }] }], permissonKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "permissonKey", required: false }] }], allowedActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowedActions", required: false }] }], uploadFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploadFn", required: false }] }], filesUploaded: [{
|
|
766
766
|
type: Output
|
|
767
767
|
}], fileDeleted: [{
|
|
@@ -1550,7 +1550,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
1550
1550
|
|
|
1551
1551
|
const WEEKDAYS = {
|
|
1552
1552
|
ar: ['ن', 'ث', 'ر', 'خ', 'ج', 'س', 'ح'],
|
|
1553
|
-
en: ['
|
|
1553
|
+
en: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
|
|
1554
1554
|
};
|
|
1555
1555
|
const MONTHS_GREGORIAN = {
|
|
1556
1556
|
ar: [
|
|
@@ -2056,11 +2056,12 @@ class DualCalendarComponent {
|
|
|
2056
2056
|
mode = 'gregorian';
|
|
2057
2057
|
gregorianModel;
|
|
2058
2058
|
hijriModel;
|
|
2059
|
-
|
|
2060
|
-
disabledDays = [];
|
|
2059
|
+
lang = undefined;
|
|
2060
|
+
disabledDays = [];
|
|
2061
2061
|
disabledDates = [];
|
|
2062
2062
|
gregorianUTC = new EventEmitter();
|
|
2063
2063
|
onClose = new EventEmitter();
|
|
2064
|
+
currentLang = signal('ar', ...(ngDevMode ? [{ debugName: "currentLang" }] : []));
|
|
2064
2065
|
gregorianUTCValue = '';
|
|
2065
2066
|
isShown = false;
|
|
2066
2067
|
appedToBody = false;
|
|
@@ -2068,13 +2069,18 @@ class DualCalendarComponent {
|
|
|
2068
2069
|
hijriCal = new NgbCalendarIslamicUmalqura();
|
|
2069
2070
|
renderer = inject(Renderer2);
|
|
2070
2071
|
hostEl = inject(ElementRef);
|
|
2072
|
+
translateService = inject(TranslateService);
|
|
2073
|
+
langSubscription;
|
|
2071
2074
|
constructor() {
|
|
2072
2075
|
effect(() => {
|
|
2073
|
-
this.currentLang();
|
|
2076
|
+
this.currentLang();
|
|
2074
2077
|
this.setDate(this.gregorianUTCValue);
|
|
2075
2078
|
});
|
|
2076
2079
|
}
|
|
2077
2080
|
ngOnChanges(changes) {
|
|
2081
|
+
if (changes['lang']?.currentValue) {
|
|
2082
|
+
this.currentLang.set(changes['lang'].currentValue);
|
|
2083
|
+
}
|
|
2078
2084
|
if (changes['isShown']?.currentValue) {
|
|
2079
2085
|
this.wrapperVisible();
|
|
2080
2086
|
setTimeout(() => this.positionCalendar());
|
|
@@ -2084,6 +2090,20 @@ class DualCalendarComponent {
|
|
|
2084
2090
|
}
|
|
2085
2091
|
}
|
|
2086
2092
|
ngOnInit() {
|
|
2093
|
+
if (this.lang) {
|
|
2094
|
+
this.currentLang.set(this.lang);
|
|
2095
|
+
}
|
|
2096
|
+
else {
|
|
2097
|
+
const initialLang = this.translateService.getCurrentLang() || this.translateService.getFallbackLang();
|
|
2098
|
+
if (initialLang === 'en' || initialLang === 'ar') {
|
|
2099
|
+
this.currentLang.set(initialLang);
|
|
2100
|
+
}
|
|
2101
|
+
this.langSubscription = this.translateService.onLangChange.subscribe(({ lang }) => {
|
|
2102
|
+
if (!this.lang && (lang === 'en' || lang === 'ar')) {
|
|
2103
|
+
this.currentLang.set(lang);
|
|
2104
|
+
}
|
|
2105
|
+
});
|
|
2106
|
+
}
|
|
2087
2107
|
this.setDate(this.control?.value);
|
|
2088
2108
|
}
|
|
2089
2109
|
ngAfterViewInit() {
|
|
@@ -2226,12 +2246,13 @@ class DualCalendarComponent {
|
|
|
2226
2246
|
return `${gregorianDay} ${gregorianMonth} ${gregorianYear} - ${hijriDay} ${hijriMonth} ${hijriYear}`;
|
|
2227
2247
|
}
|
|
2228
2248
|
ngOnDestroy() {
|
|
2249
|
+
this.langSubscription?.unsubscribe();
|
|
2229
2250
|
if (this.appedToBody && this.calendarWrapper) {
|
|
2230
2251
|
this.renderer.removeChild(document.body, this.calendarWrapper.nativeElement);
|
|
2231
2252
|
}
|
|
2232
2253
|
}
|
|
2233
2254
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DualCalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2234
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: DualCalendarComponent, isStandalone: true, selector: "app-dual-calendar", inputs: { control: "control", label: "label", name: "name", withTime: "withTime", isDatePickerShow: "isDatePickerShow",
|
|
2255
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: DualCalendarComponent, isStandalone: true, selector: "app-dual-calendar", inputs: { control: "control", label: "label", name: "name", withTime: "withTime", isDatePickerShow: "isDatePickerShow", lang: "lang", disabledDays: "disabledDays", disabledDates: "disabledDates", isShown: "isShown", appedToBody: "appedToBody" }, outputs: { gregorianUTC: "gregorianUTC", onClose: "onClose" }, host: { listeners: { "document:click": "onDocumentClick($event)" } }, providers: [
|
|
2235
2256
|
{ provide: NgbCalendar, useClass: NgbCalendarIslamicUmalqura }
|
|
2236
2257
|
], viewQueries: [{ propertyName: "calendarWrapper", first: true, predicate: ["calendarWrapper"], descendants: true }, { propertyName: "calendarContainer", first: true, predicate: ["calendarContainer"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"calender-content\" #calendarContainer>\r\n @if(isDatePickerShow) {\r\n <stc-date-picker-switcher [variant]=\"'in'\" [label]=\"label\" id=\"dateId\" (openCalender)=\"showCalender($event)\"\r\n [control]=\"control\" [formattedDate]='selectedDate' >\r\n </stc-date-picker-switcher>\r\n }\r\n\r\n <!-- calender.html -->\r\n <div (click)=\"$event.stopPropagation()\" [dir]=\"currentLang() === 'ar' ? 'rtl' : 'ltr'\" class=\"p-2 calendar-wrapper \" [@slideDown]=\"isShown ? 'open' : 'closed'\" #calendarWrapper>\r\n <div class=\"header-tabs\">\r\n <div class=\"header-label\">{{'calender.calender_type' | translate}}</div>\r\n <div class=\"tabs\">\r\n <button class=\"tab-button\" [class.active]=\"mode === 'gregorian'\" type=\"button\" (click)=\" mode='gregorian'\">\r\n {{'calender.gregorian' | translate}}\r\n </button>\r\n <button class=\"tab-button\" [class.active]=\"mode === 'hijri'\" type=\"button\" (click)=\" mode='hijri'\">\r\n {{'calender.hijri' | translate}}\r\n </button>\r\n </div>\r\n </div>\r\n @if(mode === 'gregorian') {\r\n <app-gregorian-calendar [model]=\"gregorianModel\" [language]=\"currentLang()\"\r\n [disabledDays]=\"disabledDays\" [disabledDates]=\"disabledDates\" (dateSelected)=\"onSelectGregorian($event)\">\r\n </app-gregorian-calendar>\r\n }\r\n\r\n @if(mode === 'hijri') {\r\n <app-hijri-calendar [model]=\"hijriModel\" [language]=\"currentLang()\"\r\n [disabledDays]=\"disabledDays\" [disabledDates]=\"disabledDates\" (dateSelected)=\"onSelectHijri($event)\">\r\n </app-hijri-calendar>\r\n }\r\n </div>\r\n</div>\r\n", styles: [".calendar-wrapper{max-width:375px;padding:15px;position:fixed;z-index:9999;box-shadow:0 2px 8px #00000026;background-color:#fff;border-radius:4px;overflow:hidden}.calendar-wrapper .ngb-dp-header .ngb-dp-arrow.ngb-dp-arrow-next{margin:0 10px;max-width:20px}.calendar-wrapper .rtl .ngb-dp-header .ngb-dp-arrow.ngb-dp-arrow-next{inset-inline-end:-6px;transform:rotate(180deg);margin:0 10px;max-width:20px}.calendar-wrapper .rtl .ngb-dp-header .ngb-dp-arrow.ngb-dp-arrow-prev{inset-inline-end:22px;transform:rotate(180deg)}.calendar-wrapper .ltr .ngb-dp-header .ngb-dp-arrow.ngb-dp-arrow-next{inset-inline-end:-4px}.calendar-wrapper .ltr .ngb-dp-header .ngb-dp-arrow.ngb-dp-arrow-prev{inset-inline-end:11px}.header-tabs{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:10px}.tabs{background:#f0f0f5;padding:3px;border-radius:2px}.tab-button{flex:1;padding:6px 10px;font-size:14px;background:#f0f0f5;border:none;border-radius:6px;cursor:pointer;transition:.3s}.tab-button.active{background:#dcd6f8;color:#4a3fb4;font-weight:600}.custom-datepicker{width:100%;background:#fff;border:1px solid #e5e5e5;border-radius:8px;padding:12px}.custom-datepicker .ngb-dp-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;max-width:375px}.custom-datepicker .ngb-dp-arrow-btn{background:none;border:none;cursor:pointer;padding:4px}.custom-datepicker .ngb-dp-weekdays{margin-bottom:6px}.custom-datepicker .ngb-dp-weekday{color:#9b9b9b;font-weight:600;text-align:center}.custom-day.today{border:1px solid #6a41d8;width:100%;height:100%;border-radius:4px;margin:0}.custom-day.outside{opacity:.3}.custom-day.disabled{opacity:.2;pointer-events:none}.calender-content{position:relative}.ngb-datepicker{width:100%}.custom-day{display:inline-flex;justify-content:center;align-items:center;margin:2px;border-radius:50%;cursor:pointer;font-weight:500}.custom-day.today{color:#4f008d}.ngb-dp-day:has(.selected){background-color:#ede6f4!important;border:0!important;color:#4f008d!important;border-radius:2px}.custom-day.outside{color:#ccc!important}.custom-day.disabled{color:#aaa!important;pointer-events:none!important}.ngb-dp-day,.ngb-dp-weekday,.ngb-dp-week-number{width:32px!important;height:32px!important;display:flex;margin:5px;justify-content:center;align-items:center}.ngb-dp-month:first-child .ngb-dp-week{padding:0!important}.ngb-dp-month:last-child .ngb-dp-week{padding:0!important}.ngb-dp-arrow-btn{margin-inline-end:0!important;outline:0!important;padding:0!important;margin:0!important}.ngb-dp-header{position:relative}.ngb-dp-header .ngb-dp-arrow{position:absolute}.ngb-dp-header .ngb-dp-arrow.ngb-dp-arrow-prev{inset-inline-end:0}.ngb-dp-header .ngb-dp-arrow.ngb-dp-arrow-next{inset-inline-end:15px}.ngb-dp-header .ngb-dp-arrow:focus-visible,.ngb-dp-header .ngb-dp-arrow .btn:focus-visible{outline:0!important}.ngb-dp-header .visually-hidden{display:none}.ngb-dp-navigation-select{max-width:140px}.ngb-dp-navigation-select select{border:0}.ngb-dp-navigation-select select:focus-visible{outline:0}.ngb-datepicker-navigation-select>.form-select{font-size:14px;font-weight:700}.ngb-dp-navigation-select,.form-select:first-child{appearance:none!important;-webkit-appearance:none;-moz-appearance:none}.ngb-dp-navigation-chevron{font-size:18px;border-width:.1em .1em 0 0!important;border-color:#000}\n"], dependencies: [{ kind: "ngmodule", type: NgbDatepickerModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: DatePickerModule }, { kind: "ngmodule", type: FloatLabelModule }, { kind: "component", type: HijriCalendarComponent, selector: "app-hijri-calendar", inputs: ["model", "disabledDays", "disabledDates", "language"], outputs: ["dateSelected"] }, { kind: "component", type: DatePickerSwitcherComponent, selector: "stc-date-picker-switcher", inputs: ["type", "contentType", "size", "prefix", "rows", "cols", "autoResize", "basicInput", "noStyle", "hideOptionalLabel", "inputDirection", "variant", "defaultColor", "formattedDate"], outputs: ["openCalender"] }, { kind: "component", type: GregorianCalendarComponent, selector: "app-gregorian-calendar", inputs: ["model", "disabledDays", "disabledDates", "language"], outputs: ["dateSelected"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], animations: [
|
|
2237
2258
|
trigger('slideDown', [
|
|
@@ -2299,7 +2320,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
2299
2320
|
type: Input
|
|
2300
2321
|
}], isDatePickerShow: [{
|
|
2301
2322
|
type: Input
|
|
2302
|
-
}],
|
|
2323
|
+
}], lang: [{
|
|
2303
2324
|
type: Input
|
|
2304
2325
|
}], disabledDays: [{
|
|
2305
2326
|
type: Input
|
|
@@ -2392,7 +2413,7 @@ class DynamicFormComponent {
|
|
|
2392
2413
|
this.uploadStateChange.emit(state);
|
|
2393
2414
|
}
|
|
2394
2415
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2395
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: DynamicFormComponent, isStandalone: true, selector: "app-dynamic-form", inputs: { dynamicFormData: "dynamicFormData" }, outputs: { selectButtonChange: "selectButtonChange", selectChange: "selectChange", selectClicked: "selectClicked", switchChange: "switchChange", autoCompleteSearch: "autoCompleteSearch", autoCompleteSelect: "autoCompleteSelect", popUpFilesUploaded: "popUpFilesUploaded", fileDeleted: "fileDeleted", uploadStateChange: "uploadStateChange" }, usesOnChanges: true, ngImport: i0, template: "<form [formGroup]=\"formGroup\" class=\"dynamic-form\">\r\n <div class=\"dynamic-form__content\">\r\n @for (inputName of inputsNames; track $index) {\r\n <div [ngClass]=\"inputsMap[inputName].rowSize\">\r\n @switch (inputsMap[inputName].fieldType) {\r\n @case (fieldType.HIJRI_DATE_PICKER) {\r\n <app-dual-calendar [control]=\"getFormControl(inputName, formGroup)\"\r\n [disabledDates]=\"inputsMap[inputName].disabledDates || []\"\r\n [disabledDays]=\"inputsMap[inputName].disabledDays || []\"></app-dual-calendar>\r\n }\r\n\r\n @case (fieldType.DATE_PICKER) {\r\n <stc-date-picker [minDate]=\"inputsMap[inputName]?.dateRange?.min\" [maxDate]=\"inputsMap[inputName]?.dateRange?.max\"\r\n [disabledDates]=\"inputsMap[inputName].disabledDates || []\"\r\n [disabledDays]=\"inputsMap[inputName].disabledDays || []\"\r\n [id]=\"inputsMap[inputName].inputId\" [control]=\"getFormControl(inputName, formGroup)\" [name]=\"inputName\"\r\n [label]=\"inputsMap[inputName].label\" [placeholder]=\"inputsMap[inputName].placeholder || ''\"\r\n [hint]=\"inputsMap[inputName].hint\"\r\n [readonly]=\"inputsMap[inputName].readonly || dynamicFormData.isReadOnlyForm || false\"\r\n [disabled]=\"inputsMap[inputName].disabled || false\" [variant]=\"inputsMap[inputName].variant || 'over'\"\r\n [showIcon]=\"inputsMap[inputName].showIcon !== false\" [isTimeOnly]=\"inputsMap[inputName].isTimeOnly || false\"\r\n [withoutTime]=\"inputsMap[inputName].withoutTime || false\"\r\n [showClear]=\"inputsMap[inputName].showClear || true\" />\r\n }\r\n @case (fieldType.SELECT_BUTTON) {\r\n <stc-select-button [control]=\"getFormControl(inputName, formGroup)\" [id]=\"inputsMap[inputName].inputId\"\r\n [name]=\"inputName\" [label]=\"inputsMap[inputName].label\"\r\n [options]=\"inputsMap[inputName].selectButtonOptions || []\"\r\n (onChange)=\"selectButtonChange.emit({ name: inputName, value: $event })\" />\r\n }\r\n @case (fieldType.INPUT) {\r\n <stc-input [control]=\"getFormControl(inputName, formGroup)\" [id]=\"inputsMap[inputName].inputId\" [name]=\"inputName\"\r\n [label]=\"inputsMap[inputName].label\" [placeholder]=\"inputsMap[inputName].placeholder || ''\"\r\n [hint]=\"inputsMap[inputName].hint\"\r\n [readonly]=\"inputsMap[inputName].readonly || dynamicFormData.isReadOnlyForm || false\"\r\n [disabled]=\"inputsMap[inputName].disabled || false\" [type]=\"inputsMap[inputName].inputType || 'text'\"\r\n [contentType]=\"inputsMap[inputName].contentType || 'text'\" [rows]=\"inputsMap[inputName].rows || 2\"\r\n [cols]=\"inputsMap[inputName].cols || 20\" [autoResize]=\"inputsMap[inputName].autoResize ?? false\"\r\n [prefix]=\"inputsMap[inputName].prefix || ''\" [size]=\"inputsMap[inputName].size || 'small'\"\r\n [variant]=\"inputsMap[inputName].variant || 'over'\" [maxLength]=\"inputsMap[inputName].maxLength || null\">\r\n @if(inputsMap[inputName].maxLength){\r\n <span class=\"text-xs text-gray-700\">\r\n {{ (getFormControl(inputName, formGroup).value?.length || 0) }}\r\n <span> / {{ inputsMap[inputName].maxLength}}</span>\r\n </span>\r\n }\r\n </stc-input>\r\n }\r\n @case (fieldType.SELECT) {\r\n <ng-template #optionTpl let-item>\r\n @if (inputsMap[inputName].optionTemplate) {\r\n <div class=\"flex items-center gap-3\">\r\n @if (inputsMap[inputName].optionTemplate!.imageKey && item[inputsMap[inputName].optionTemplate!.imageKey!]) {\r\n <img [src]=\"item[inputsMap[inputName].optionTemplate!.imageKey!]\"\r\n [alt]=\"item[inputsMap[inputName].optionTemplate!.mainTextKey]\"\r\n class=\"w-8 h-8 rounded-full object-cover flex-shrink-0\" />\r\n }\r\n <div class=\"flex flex-col min-w-0\">\r\n <span class=\"font-medium truncate\">{{ item[inputsMap[inputName].optionTemplate!.mainTextKey] }}</span>\r\n @if (inputsMap[inputName].optionTemplate!.subTextKey &&\r\n item[inputsMap[inputName].optionTemplate!.subTextKey!]) {\r\n <span class=\"text-sm text-gray-500 truncate\">{{ item[inputsMap[inputName].optionTemplate!.subTextKey!]\r\n }}</span>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </ng-template>\r\n <ng-template #selectedTpl let-item>\r\n @if (inputsMap[inputName].optionTemplate) {\r\n <div class=\"flex items-center gap-2\">\r\n @if (inputsMap[inputName].optionTemplate!.imageKey && item[inputsMap[inputName].optionTemplate!.imageKey!]) {\r\n <img [src]=\"item[inputsMap[inputName].optionTemplate!.imageKey!]\"\r\n [alt]=\"item[inputsMap[inputName].optionTemplate!.mainTextKey]\"\r\n class=\"w-6 h-6 rounded-full object-cover flex-shrink-0\" />\r\n }\r\n <span class=\"truncate\">{{ item[inputsMap[inputName].optionTemplate!.mainTextKey] }}</span>\r\n </div>\r\n }\r\n </ng-template>\r\n <stc-select [control]=\"getFormControl(inputName, formGroup)\" [id]=\"inputsMap[inputName].inputId\"\r\n [name]=\"inputName\" [label]=\"inputsMap[inputName].label\" [placeholder]=\"inputsMap[inputName].placeholder || ''\"\r\n [hint]=\"inputsMap[inputName].hint\"\r\n [readonly]=\"inputsMap[inputName].readonly || dynamicFormData.isReadOnlyForm || false\"\r\n [disabled]=\"inputsMap[inputName].disabled || false\" [options]=\"inputsMap[inputName].selectOptions || []\"\r\n [optionLabel]=\"inputsMap[inputName]?.translatable\r\n ? ((inputsMap[inputName]?.optionLabel || 'label') | localizedLabel)\r\n : (inputsMap[inputName]?.optionLabel || 'label')\" [optionValue]=\"inputsMap[inputName]?.optionValue || ''\"\r\n [filter]=\"inputsMap[inputName].filter || false\" [multiple]=\"inputsMap[inputName].multiple || false\"\r\n [showClear]=\"inputsMap[inputName].showClear || false\" [checkmark]=\"inputsMap[inputName].checkmark ?? true\"\r\n [filterBy]=\"inputsMap[inputName].filterBy || ''\"\r\n [selectedItemsLabel]=\"inputsMap[inputName].selectedItemsLabel || ''\"\r\n [size]=\"inputsMap[inputName].size || 'small'\" [variant]=\"inputsMap[inputName].variant || 'over'\"\r\n [optionTemplate]=\"inputsMap[inputName].optionTemplate ? optionTpl : null\"\r\n [selectedItemTemplate]=\"inputsMap[inputName].optionTemplate ? selectedTpl : null\"\r\n (change)=\"selectChange.emit({ name: inputName, event: $event })\"\r\n (click)=\"selectClicked.emit({ name: inputName, event: $event })\" />\r\n }\r\n @case (fieldType.SWITCH) {\r\n <stc-switch [label]=\"inputsMap[inputName].label\" [key]=\"inputName\"\r\n [checked]=\"getFormControl(inputName, formGroup).value\"\r\n (onChange)=\"getFormControl(inputName, formGroup).setValue(typeof $event === 'string' ? ($event === 'true') : $event); switchChange.emit({ name: inputName, value: (typeof $event === 'string' ? ($event === 'true') : $event) })\" />\r\n }\r\n @case (fieldType.CHECKBOX) {\r\n <div class=\"flex items-center gap-2 my-3\">\r\n <p-checkbox [inputId]=\"inputsMap[inputName].inputId || inputName\" [binary]=\"true\"\r\n [formControl]=\"getFormControl(inputName, formGroup)\" [disabled]=\"inputsMap[inputName].disabled || false\" />\r\n <label [for]=\"inputsMap[inputName].inputId || inputName\">{{ inputsMap[inputName].label }}</label>\r\n </div>\r\n }\r\n @case (fieldType.AUTO_COMPLETE) {\r\n <stc-auto-complete [control]=\"getFormControl(inputName, formGroup)\" [id]=\"inputsMap[inputName].inputId\"\r\n [name]=\"inputName\" [label]=\"inputsMap[inputName].label\" [placeholder]=\"inputsMap[inputName].placeholder || ''\"\r\n [hint]=\"inputsMap[inputName].hint\"\r\n [readonly]=\"inputsMap[inputName].readonly || dynamicFormData.isReadOnlyForm || false\"\r\n [disabled]=\"inputsMap[inputName].disabled || false\" [items]=\"inputsMap[inputName].autoCompleteItems || []\"\r\n [minLengthToSearch]=\"inputsMap[inputName].minLengthToSearch || 2\" [delay]=\"inputsMap[inputName].delay || 300\"\r\n (onSearch)=\"autoCompleteSearch.emit({ name: inputName, query: $event })\"\r\n (selectOption)=\"autoCompleteSelect.emit({ name: inputName, event: $event })\"\r\n [variant]=\"inputsMap[inputName].variant || 'over'\" [allowedDomains]=\"inputsMap[inputName]?.allowedDomains\" />\r\n }\r\n @case(fieldType.UPLOAD_FILE) {\r\n <app-file-management #fileManager #groupFileManager\r\n [maxFileSize]=\"getMaxFileSize(getFileUploadConfig(inputName))\"\r\n [maxConcurrentUploads]=\"1\"\r\n [allowPreview]=\"true\"\r\n [acceptedTypes]=\"getAcceptedTypes(getFileUploadConfig(inputName))\"\r\n [uploadFn]=\"getFileUploadConfig(inputName)?.uploadFn\"\r\n (filesUploaded)=\"onFilesUploaded($event)\"\r\n (uploadStateChange)=\"onUploadStateChange($event)\"\r\n [control]=\"getFormControl(inputName, formGroup)\"\r\n (fileDeleted)=\"onFileDeleted($event)\" />\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n\r\n\r\n </div>\r\n <div class=\"col-span-12\">\r\n <small class=\"p-error text-red-700\">\r\n @for (error of formGroup.errors | validationErrors: dynamicFormData.formValidationErrorsKeys;\r\n track error) {\r\n {{ error }}\r\n }\r\n </small>\r\n </div>\r\n</form>", styles: [".dynamic-form__content>div{margin-bottom:15px}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: DatePickerComponent, selector: "stc-date-picker", inputs: ["showIcon", "showClear", "basicInput", "isTimeOnly", "minDate", "maxDate", "disabledDates", "disabledDays", "hourFormat", "appendTo", "selectionMode", "variant", "withoutTime"], outputs: ["onAfterClearDate"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: SelectButtonComponent, selector: "stc-select-button", inputs: ["options", "title"], outputs: ["onChange"] }, { kind: "component", type: DualCalendarComponent, selector: "app-dual-calendar", inputs: ["control", "label", "name", "withTime", "isDatePickerShow", "currentLang", "disabledDays", "disabledDates", "isShown", "appedToBody"], outputs: ["gregorianUTC", "onClose"] }, { kind: "component", type: InputComponent, selector: "stc-input", inputs: ["type", "contentType", "size", "prefix", "rows", "cols", "maxLength", "autoResize", "basicInput", "noStyle", "canClear", "hideOptionalLabel", "inputDirection", "variant", "defaultColor", "iconClass", "iconPosition"] }, { kind: "component", type: FileManagementComponent, selector: "app-file-management", inputs: ["existingFiles", "acceptedTypes", "maxFileSize", "maxConcurrentUploads", "showTable", "showDropZone", "allowPreview", "permissonKey", "allowedActions", "uploadFn"], outputs: ["filesUploaded", "fileDeleted", "filePreview", "fileDownload", "uploadError", "newFilesChange", "uploadStateChange"] }, { kind: "component", type: SelectComponent, selector: "stc-select", inputs: ["selectedItemTemplate", "optionTemplate", "options", "optionLabel", "optionValue", "emptyMessage", "checkmark", "showClear", "editable", "filter", "multiple", "filterBy", "selectAllLabel", "dataKey", "size", "appendTo", "selectedItemsLabel", "basicInput", "variant", "defaultColor"], outputs: ["change", "clicked"] }, { kind: "component", type: AutoCompleteComponent, selector: "stc-auto-complete", inputs: ["selectedItemTemplate", "items", "minLengthToSearch", "delay", "basicInput", "typeAhead", "variant", "allowedDomains"], outputs: ["onSearch", "selectOption"] }, { kind: "component", type: SwitchComponent, selector: "stc-switch", inputs: ["label", "key", "checked"], outputs: ["onChange"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i4.Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["hostName", "value", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "inputStyle", "styleClass", "inputClass", "indeterminate", "formControl", "checkboxIcon", "readonly", "autofocus", "trueValue", "falseValue", "variant", "size"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "pipe", type: ValidationErrorsPipe, name: "validationErrors" }, { kind: "pipe", type: LocalizedLabelPipe, name: "localizedLabel" }] });
|
|
2416
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: DynamicFormComponent, isStandalone: true, selector: "app-dynamic-form", inputs: { dynamicFormData: "dynamicFormData" }, outputs: { selectButtonChange: "selectButtonChange", selectChange: "selectChange", selectClicked: "selectClicked", switchChange: "switchChange", autoCompleteSearch: "autoCompleteSearch", autoCompleteSelect: "autoCompleteSelect", popUpFilesUploaded: "popUpFilesUploaded", fileDeleted: "fileDeleted", uploadStateChange: "uploadStateChange" }, usesOnChanges: true, ngImport: i0, template: "<form [formGroup]=\"formGroup\" class=\"dynamic-form\">\r\n <div class=\"dynamic-form__content\">\r\n @for (inputName of inputsNames; track $index) {\r\n <div [ngClass]=\"inputsMap[inputName].rowSize\">\r\n @switch (inputsMap[inputName].fieldType) {\r\n @case (fieldType.HIJRI_DATE_PICKER) {\r\n <app-dual-calendar [control]=\"getFormControl(inputName, formGroup)\"\r\n [disabledDates]=\"inputsMap[inputName].disabledDates || []\"\r\n [disabledDays]=\"inputsMap[inputName].disabledDays || []\"></app-dual-calendar>\r\n }\r\n\r\n @case (fieldType.DATE_PICKER) {\r\n <stc-date-picker [minDate]=\"inputsMap[inputName]?.dateRange?.min\" [maxDate]=\"inputsMap[inputName]?.dateRange?.max\"\r\n [disabledDates]=\"inputsMap[inputName].disabledDates || []\"\r\n [disabledDays]=\"inputsMap[inputName].disabledDays || []\"\r\n [id]=\"inputsMap[inputName].inputId\" [control]=\"getFormControl(inputName, formGroup)\" [name]=\"inputName\"\r\n [label]=\"inputsMap[inputName].label\" [placeholder]=\"inputsMap[inputName].placeholder || ''\"\r\n [hint]=\"inputsMap[inputName].hint\"\r\n [readonly]=\"inputsMap[inputName].readonly || dynamicFormData.isReadOnlyForm || false\"\r\n [disabled]=\"inputsMap[inputName].disabled || false\" [variant]=\"inputsMap[inputName].variant || 'over'\"\r\n [showIcon]=\"inputsMap[inputName].showIcon !== false\" [isTimeOnly]=\"inputsMap[inputName].isTimeOnly || false\"\r\n [withoutTime]=\"inputsMap[inputName].withoutTime || false\"\r\n [showClear]=\"inputsMap[inputName].showClear || true\" />\r\n }\r\n @case (fieldType.SELECT_BUTTON) {\r\n <stc-select-button [control]=\"getFormControl(inputName, formGroup)\" [id]=\"inputsMap[inputName].inputId\"\r\n [name]=\"inputName\" [label]=\"inputsMap[inputName].label\"\r\n [options]=\"inputsMap[inputName].selectButtonOptions || []\"\r\n (onChange)=\"selectButtonChange.emit({ name: inputName, value: $event })\" />\r\n }\r\n @case (fieldType.INPUT) {\r\n <stc-input [control]=\"getFormControl(inputName, formGroup)\" [id]=\"inputsMap[inputName].inputId\" [name]=\"inputName\"\r\n [label]=\"inputsMap[inputName].label\" [placeholder]=\"inputsMap[inputName].placeholder || ''\"\r\n [hint]=\"inputsMap[inputName].hint\"\r\n [readonly]=\"inputsMap[inputName].readonly || dynamicFormData.isReadOnlyForm || false\"\r\n [disabled]=\"inputsMap[inputName].disabled || false\" [type]=\"inputsMap[inputName].inputType || 'text'\"\r\n [contentType]=\"inputsMap[inputName].contentType || 'text'\" [rows]=\"inputsMap[inputName].rows || 2\"\r\n [cols]=\"inputsMap[inputName].cols || 20\" [autoResize]=\"inputsMap[inputName].autoResize ?? false\"\r\n [prefix]=\"inputsMap[inputName].prefix || ''\" [size]=\"inputsMap[inputName].size || 'small'\"\r\n [variant]=\"inputsMap[inputName].variant || 'over'\" [maxLength]=\"inputsMap[inputName].maxLength || null\">\r\n @if(inputsMap[inputName].maxLength){\r\n <span class=\"text-xs text-gray-700\">\r\n {{ (getFormControl(inputName, formGroup).value?.length || 0) }}\r\n <span> / {{ inputsMap[inputName].maxLength}}</span>\r\n </span>\r\n }\r\n </stc-input>\r\n }\r\n @case (fieldType.SELECT) {\r\n <ng-template #optionTpl let-item>\r\n @if (inputsMap[inputName].optionTemplate) {\r\n <div class=\"flex items-center gap-3\">\r\n @if (inputsMap[inputName].optionTemplate!.imageKey && item[inputsMap[inputName].optionTemplate!.imageKey!]) {\r\n <img [src]=\"item[inputsMap[inputName].optionTemplate!.imageKey!]\"\r\n [alt]=\"item[inputsMap[inputName].optionTemplate!.mainTextKey]\"\r\n class=\"w-8 h-8 rounded-full object-cover flex-shrink-0\" />\r\n }\r\n <div class=\"flex flex-col min-w-0\">\r\n <span class=\"font-medium truncate\">{{ item[inputsMap[inputName].optionTemplate!.mainTextKey] }}</span>\r\n @if (inputsMap[inputName].optionTemplate!.subTextKey &&\r\n item[inputsMap[inputName].optionTemplate!.subTextKey!]) {\r\n <span class=\"text-sm text-gray-500 truncate\">{{ item[inputsMap[inputName].optionTemplate!.subTextKey!]\r\n }}</span>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </ng-template>\r\n <ng-template #selectedTpl let-item>\r\n @if (inputsMap[inputName].optionTemplate) {\r\n <div class=\"flex items-center gap-2\">\r\n @if (inputsMap[inputName].optionTemplate!.imageKey && item[inputsMap[inputName].optionTemplate!.imageKey!]) {\r\n <img [src]=\"item[inputsMap[inputName].optionTemplate!.imageKey!]\"\r\n [alt]=\"item[inputsMap[inputName].optionTemplate!.mainTextKey]\"\r\n class=\"w-6 h-6 rounded-full object-cover flex-shrink-0\" />\r\n }\r\n <span class=\"truncate\">{{ item[inputsMap[inputName].optionTemplate!.mainTextKey] }}</span>\r\n </div>\r\n }\r\n </ng-template>\r\n <stc-select [control]=\"getFormControl(inputName, formGroup)\" [id]=\"inputsMap[inputName].inputId\"\r\n [name]=\"inputName\" [label]=\"inputsMap[inputName].label\" [placeholder]=\"inputsMap[inputName].placeholder || ''\"\r\n [hint]=\"inputsMap[inputName].hint\"\r\n [readonly]=\"inputsMap[inputName].readonly || dynamicFormData.isReadOnlyForm || false\"\r\n [disabled]=\"inputsMap[inputName].disabled || false\" [options]=\"inputsMap[inputName].selectOptions || []\"\r\n [optionLabel]=\"inputsMap[inputName]?.translatable\r\n ? ((inputsMap[inputName]?.optionLabel || 'label') | localizedLabel)\r\n : (inputsMap[inputName]?.optionLabel || 'label')\" [optionValue]=\"inputsMap[inputName]?.optionValue || ''\"\r\n [filter]=\"inputsMap[inputName].filter || false\" [multiple]=\"inputsMap[inputName].multiple || false\"\r\n [showClear]=\"inputsMap[inputName].showClear || false\" [checkmark]=\"inputsMap[inputName].checkmark ?? true\"\r\n [filterBy]=\"inputsMap[inputName].filterBy || ''\"\r\n [selectedItemsLabel]=\"inputsMap[inputName].selectedItemsLabel || ''\"\r\n [size]=\"inputsMap[inputName].size || 'small'\" [variant]=\"inputsMap[inputName].variant || 'over'\"\r\n [optionTemplate]=\"inputsMap[inputName].optionTemplate ? optionTpl : null\"\r\n [selectedItemTemplate]=\"inputsMap[inputName].optionTemplate ? selectedTpl : null\"\r\n (change)=\"selectChange.emit({ name: inputName, event: $event })\"\r\n (click)=\"selectClicked.emit({ name: inputName, event: $event })\" />\r\n }\r\n @case (fieldType.SWITCH) {\r\n <stc-switch [label]=\"inputsMap[inputName].label\" [key]=\"inputName\"\r\n [checked]=\"getFormControl(inputName, formGroup).value\"\r\n (onChange)=\"getFormControl(inputName, formGroup).setValue(typeof $event === 'string' ? ($event === 'true') : $event); switchChange.emit({ name: inputName, value: (typeof $event === 'string' ? ($event === 'true') : $event) })\" />\r\n }\r\n @case (fieldType.CHECKBOX) {\r\n <div class=\"flex items-center gap-2 my-3\">\r\n <p-checkbox [inputId]=\"inputsMap[inputName].inputId || inputName\" [binary]=\"true\"\r\n [formControl]=\"getFormControl(inputName, formGroup)\" [disabled]=\"inputsMap[inputName].disabled || false\" />\r\n <label [for]=\"inputsMap[inputName].inputId || inputName\">{{ inputsMap[inputName].label }}</label>\r\n </div>\r\n }\r\n @case (fieldType.AUTO_COMPLETE) {\r\n <stc-auto-complete [control]=\"getFormControl(inputName, formGroup)\" [id]=\"inputsMap[inputName].inputId\"\r\n [name]=\"inputName\" [label]=\"inputsMap[inputName].label\" [placeholder]=\"inputsMap[inputName].placeholder || ''\"\r\n [hint]=\"inputsMap[inputName].hint\"\r\n [readonly]=\"inputsMap[inputName].readonly || dynamicFormData.isReadOnlyForm || false\"\r\n [disabled]=\"inputsMap[inputName].disabled || false\" [items]=\"inputsMap[inputName].autoCompleteItems || []\"\r\n [minLengthToSearch]=\"inputsMap[inputName].minLengthToSearch || 2\" [delay]=\"inputsMap[inputName].delay || 300\"\r\n (onSearch)=\"autoCompleteSearch.emit({ name: inputName, query: $event })\"\r\n (selectOption)=\"autoCompleteSelect.emit({ name: inputName, event: $event })\"\r\n [variant]=\"inputsMap[inputName].variant || 'over'\" [allowedDomains]=\"inputsMap[inputName]?.allowedDomains\" />\r\n }\r\n @case(fieldType.UPLOAD_FILE) {\r\n <app-file-management #fileManager #groupFileManager\r\n [maxFileSize]=\"getMaxFileSize(getFileUploadConfig(inputName))\"\r\n [maxConcurrentUploads]=\"1\"\r\n [allowPreview]=\"true\"\r\n [acceptedTypes]=\"getAcceptedTypes(getFileUploadConfig(inputName))\"\r\n [uploadFn]=\"getFileUploadConfig(inputName)?.uploadFn\"\r\n (filesUploaded)=\"onFilesUploaded($event)\"\r\n (uploadStateChange)=\"onUploadStateChange($event)\"\r\n [control]=\"getFormControl(inputName, formGroup)\"\r\n (fileDeleted)=\"onFileDeleted($event)\" />\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n\r\n\r\n </div>\r\n <div class=\"col-span-12\">\r\n <small class=\"p-error text-red-700\">\r\n @for (error of formGroup.errors | validationErrors: dynamicFormData.formValidationErrorsKeys;\r\n track error) {\r\n {{ error }}\r\n }\r\n </small>\r\n </div>\r\n</form>", styles: [".dynamic-form__content>div{margin-bottom:15px}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: DatePickerComponent, selector: "stc-date-picker", inputs: ["showIcon", "showClear", "basicInput", "isTimeOnly", "minDate", "maxDate", "disabledDates", "disabledDays", "hourFormat", "appendTo", "selectionMode", "variant", "withoutTime"], outputs: ["onAfterClearDate"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: SelectButtonComponent, selector: "stc-select-button", inputs: ["options", "title"], outputs: ["onChange"] }, { kind: "component", type: DualCalendarComponent, selector: "app-dual-calendar", inputs: ["control", "label", "name", "withTime", "isDatePickerShow", "lang", "disabledDays", "disabledDates", "isShown", "appedToBody"], outputs: ["gregorianUTC", "onClose"] }, { kind: "component", type: InputComponent, selector: "stc-input", inputs: ["type", "contentType", "size", "prefix", "rows", "cols", "maxLength", "autoResize", "basicInput", "noStyle", "canClear", "hideOptionalLabel", "inputDirection", "variant", "defaultColor", "iconClass", "iconPosition"] }, { kind: "component", type: FileManagementComponent, selector: "app-file-management", inputs: ["existingFiles", "acceptedTypes", "maxFileSize", "maxConcurrentUploads", "showTable", "showDropZone", "allowPreview", "permissonKey", "allowedActions", "uploadFn"], outputs: ["filesUploaded", "fileDeleted", "filePreview", "fileDownload", "uploadError", "newFilesChange", "uploadStateChange"] }, { kind: "component", type: SelectComponent, selector: "stc-select", inputs: ["selectedItemTemplate", "optionTemplate", "options", "optionLabel", "optionValue", "emptyMessage", "checkmark", "showClear", "editable", "filter", "multiple", "filterBy", "selectAllLabel", "dataKey", "size", "appendTo", "selectedItemsLabel", "basicInput", "variant", "defaultColor"], outputs: ["change", "clicked"] }, { kind: "component", type: AutoCompleteComponent, selector: "stc-auto-complete", inputs: ["selectedItemTemplate", "items", "minLengthToSearch", "delay", "basicInput", "typeAhead", "variant", "allowedDomains"], outputs: ["onSearch", "selectOption"] }, { kind: "component", type: SwitchComponent, selector: "stc-switch", inputs: ["label", "key", "checked"], outputs: ["onChange"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i4.Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["hostName", "value", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "inputStyle", "styleClass", "inputClass", "indeterminate", "formControl", "checkboxIcon", "readonly", "autofocus", "trueValue", "falseValue", "variant", "size"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "pipe", type: ValidationErrorsPipe, name: "validationErrors" }, { kind: "pipe", type: LocalizedLabelPipe, name: "localizedLabel" }] });
|
|
2396
2417
|
}
|
|
2397
2418
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicFormComponent, decorators: [{
|
|
2398
2419
|
type: Component,
|
|
@@ -2516,7 +2537,7 @@ class ConfirmationDialogComponent extends DynamicDialogRef {
|
|
|
2516
2537
|
}
|
|
2517
2538
|
}
|
|
2518
2539
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ConfirmationDialogComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2519
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: ConfirmationDialogComponent, isStandalone: true, selector: "app-confirm-dialog", providers: [DialogService, DynamicDialogStyle], usesInheritance: true, ngImport: i0, template: "@if (dynamicDialogConfig.data) {\r\n<div class=\"confirmation-dialog\">\r\n <div class=\"dialog-wrapper\">\r\n @if (dynamicDialogConfig.data) {\r\n <div class=\"confirmation-dialog__content my-4\">\r\n @if (dynamicDialogConfig.data.dialogIcon) {\r\n <em [class]=\"dynamicDialogConfig.data.dialogIcon\"></em>\r\n }\r\n <p class=\"confirmation-dialog__message text-xl mb-2\">\r\n {{ dynamicDialogConfig.data.message }}\r\n </p>\r\n @if (dynamicDialogConfig.data.hint) {\r\n <p class=\"confirmation-dialog__hint font-normal text-base\">\r\n {{ dynamicDialogConfig.data.hint }}\r\n </p>\r\n }\r\n @if (dynamicDialogConfig.data.inputForm || hasFileUpload) {\r\n <app-dynamic-form [dynamicFormData]=\"dialogFormData\" (popUpFilesUploaded)=\"onPopFilesUploaded($event)\"\r\n (fileDeleted)=\"onFileDeleted()\" (uploadStateChange)=\"onUploadStateChange($event)\"></app-dynamic-form>\r\n }\r\n </div>\r\n }\r\n <div class=\"confirmation-dialog__actions flex gap-2 mt-4\">\r\n <app-button [title]=\"dynamicDialogConfig.data?.confirmLabel || ('actions.confirm' | translate)\"\r\n [disabled]=\"isConfirmDisabled\" [severity]=\"'primary'\"\r\n [id]=\"dynamicDialogConfig.data.confirmBtnId\" [icon]=\"dynamicDialogConfig.data.confirmBtnIcon || ''\"\r\n [label]=\"dynamicDialogConfig.data.confirmBtnLabel\"\r\n [iconPos]=\"dynamicDialogConfig.data.confirmBtnPosition || 'left'\" [styleClass]=\"'confirmation-btn'\"\r\n (click)=\"submit()\" />\r\n <app-button [title]=\"dynamicDialogConfig.data?.closeLabel || ('actions.cancel' | translate)\"\r\n [severity]=\"'primary'\" variant=\"outlined\" [label]=\"dynamicDialogConfig.data.cancelBtnLabel\"\r\n [id]=\"dynamicDialogConfig.data.cancelBtnId\" [styleClass]=\"'cancel-btn confirmation-btn cancel-btn'\"\r\n (click)=\"close()\" />\r\n </div>\r\n </div>\r\n\r\n</div>\r\n}\r\n", styles: [".confirmation-dialog .dialog-wrapper{padding:.5rem}.confirmation-dialog__content{text-align:
|
|
2540
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: ConfirmationDialogComponent, isStandalone: true, selector: "app-confirm-dialog", providers: [DialogService, DynamicDialogStyle], usesInheritance: true, ngImport: i0, template: "@if (dynamicDialogConfig.data) {\r\n<div class=\"confirmation-dialog\">\r\n <div class=\"dialog-wrapper\">\r\n @if (dynamicDialogConfig.data) {\r\n <div class=\"confirmation-dialog__content my-4\">\r\n @if (dynamicDialogConfig.data.dialogIcon) {\r\n <em [class]=\"dynamicDialogConfig.data.dialogIcon\"></em>\r\n }\r\n <p class=\"confirmation-dialog__message text-xl mb-2\">\r\n {{ dynamicDialogConfig.data.message }}\r\n </p>\r\n @if (dynamicDialogConfig.data.hint) {\r\n <p class=\"confirmation-dialog__hint font-normal text-base\">\r\n {{ dynamicDialogConfig.data.hint }}\r\n </p>\r\n }\r\n @if (dynamicDialogConfig.data.inputForm || hasFileUpload) {\r\n <app-dynamic-form [dynamicFormData]=\"dialogFormData\" (popUpFilesUploaded)=\"onPopFilesUploaded($event)\"\r\n (fileDeleted)=\"onFileDeleted()\" (uploadStateChange)=\"onUploadStateChange($event)\"></app-dynamic-form>\r\n }\r\n </div>\r\n }\r\n <div class=\"confirmation-dialog__actions flex gap-2 mt-4\">\r\n <app-button [title]=\"dynamicDialogConfig.data?.confirmLabel || ('actions.confirm' | translate)\"\r\n [disabled]=\"isConfirmDisabled\" [severity]=\"'primary'\"\r\n [id]=\"dynamicDialogConfig.data.confirmBtnId\" [icon]=\"dynamicDialogConfig.data.confirmBtnIcon || ''\"\r\n [label]=\"dynamicDialogConfig.data.confirmBtnLabel\"\r\n [iconPos]=\"dynamicDialogConfig.data.confirmBtnPosition || 'left'\" [styleClass]=\"'confirmation-btn'\"\r\n (click)=\"submit()\" />\r\n <app-button [title]=\"dynamicDialogConfig.data?.closeLabel || ('actions.cancel' | translate)\"\r\n [severity]=\"'primary'\" variant=\"outlined\" [label]=\"dynamicDialogConfig.data.cancelBtnLabel\"\r\n [id]=\"dynamicDialogConfig.data.cancelBtnId\" [styleClass]=\"'cancel-btn confirmation-btn cancel-btn'\"\r\n (click)=\"close()\" />\r\n </div>\r\n </div>\r\n\r\n</div>\r\n}\r\n", styles: [".confirmation-dialog-wrapper .p-dialog-header{justify-content:space-between}.confirmation-dialog-wrapper .p-dialog-title{text-align:start;flex:1}.confirmation-dialog .dialog-wrapper{padding:.5rem}.confirmation-dialog__content{text-align:start}.confirmation-dialog__message{font-weight:600}.confirmation-dialog__hint{color:#6b7280}.confirmation-dialog__actions{display:flex;justify-content:end;gap:.5rem}.confirmation-dialog .dynamic-form{text-align:start}\n"], dependencies: [{ kind: "component", type: AppButtonComponent, selector: "app-button" }, { kind: "ngmodule", type: AvatarModule }, { kind: "ngmodule", type: DynamicDialogModule }, { kind: "component", type: DynamicFormComponent, selector: "app-dynamic-form", inputs: ["dynamicFormData"], outputs: ["selectButtonChange", "selectChange", "selectClicked", "switchChange", "autoCompleteSearch", "autoCompleteSelect", "popUpFilesUploaded", "fileDeleted", "uploadStateChange"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
|
|
2520
2541
|
}
|
|
2521
2542
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ConfirmationDialogComponent, decorators: [{
|
|
2522
2543
|
type: Component,
|
|
@@ -2526,7 +2547,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
2526
2547
|
DynamicDialogModule,
|
|
2527
2548
|
DynamicFormComponent,
|
|
2528
2549
|
TranslatePipe,
|
|
2529
|
-
], providers: [DialogService, DynamicDialogStyle], template: "@if (dynamicDialogConfig.data) {\r\n<div class=\"confirmation-dialog\">\r\n <div class=\"dialog-wrapper\">\r\n @if (dynamicDialogConfig.data) {\r\n <div class=\"confirmation-dialog__content my-4\">\r\n @if (dynamicDialogConfig.data.dialogIcon) {\r\n <em [class]=\"dynamicDialogConfig.data.dialogIcon\"></em>\r\n }\r\n <p class=\"confirmation-dialog__message text-xl mb-2\">\r\n {{ dynamicDialogConfig.data.message }}\r\n </p>\r\n @if (dynamicDialogConfig.data.hint) {\r\n <p class=\"confirmation-dialog__hint font-normal text-base\">\r\n {{ dynamicDialogConfig.data.hint }}\r\n </p>\r\n }\r\n @if (dynamicDialogConfig.data.inputForm || hasFileUpload) {\r\n <app-dynamic-form [dynamicFormData]=\"dialogFormData\" (popUpFilesUploaded)=\"onPopFilesUploaded($event)\"\r\n (fileDeleted)=\"onFileDeleted()\" (uploadStateChange)=\"onUploadStateChange($event)\"></app-dynamic-form>\r\n }\r\n </div>\r\n }\r\n <div class=\"confirmation-dialog__actions flex gap-2 mt-4\">\r\n <app-button [title]=\"dynamicDialogConfig.data?.confirmLabel || ('actions.confirm' | translate)\"\r\n [disabled]=\"isConfirmDisabled\" [severity]=\"'primary'\"\r\n [id]=\"dynamicDialogConfig.data.confirmBtnId\" [icon]=\"dynamicDialogConfig.data.confirmBtnIcon || ''\"\r\n [label]=\"dynamicDialogConfig.data.confirmBtnLabel\"\r\n [iconPos]=\"dynamicDialogConfig.data.confirmBtnPosition || 'left'\" [styleClass]=\"'confirmation-btn'\"\r\n (click)=\"submit()\" />\r\n <app-button [title]=\"dynamicDialogConfig.data?.closeLabel || ('actions.cancel' | translate)\"\r\n [severity]=\"'primary'\" variant=\"outlined\" [label]=\"dynamicDialogConfig.data.cancelBtnLabel\"\r\n [id]=\"dynamicDialogConfig.data.cancelBtnId\" [styleClass]=\"'cancel-btn confirmation-btn cancel-btn'\"\r\n (click)=\"close()\" />\r\n </div>\r\n </div>\r\n\r\n</div>\r\n}\r\n", styles: [".confirmation-dialog .dialog-wrapper{padding:.5rem}.confirmation-dialog__content{text-align:
|
|
2550
|
+
], providers: [DialogService, DynamicDialogStyle], template: "@if (dynamicDialogConfig.data) {\r\n<div class=\"confirmation-dialog\">\r\n <div class=\"dialog-wrapper\">\r\n @if (dynamicDialogConfig.data) {\r\n <div class=\"confirmation-dialog__content my-4\">\r\n @if (dynamicDialogConfig.data.dialogIcon) {\r\n <em [class]=\"dynamicDialogConfig.data.dialogIcon\"></em>\r\n }\r\n <p class=\"confirmation-dialog__message text-xl mb-2\">\r\n {{ dynamicDialogConfig.data.message }}\r\n </p>\r\n @if (dynamicDialogConfig.data.hint) {\r\n <p class=\"confirmation-dialog__hint font-normal text-base\">\r\n {{ dynamicDialogConfig.data.hint }}\r\n </p>\r\n }\r\n @if (dynamicDialogConfig.data.inputForm || hasFileUpload) {\r\n <app-dynamic-form [dynamicFormData]=\"dialogFormData\" (popUpFilesUploaded)=\"onPopFilesUploaded($event)\"\r\n (fileDeleted)=\"onFileDeleted()\" (uploadStateChange)=\"onUploadStateChange($event)\"></app-dynamic-form>\r\n }\r\n </div>\r\n }\r\n <div class=\"confirmation-dialog__actions flex gap-2 mt-4\">\r\n <app-button [title]=\"dynamicDialogConfig.data?.confirmLabel || ('actions.confirm' | translate)\"\r\n [disabled]=\"isConfirmDisabled\" [severity]=\"'primary'\"\r\n [id]=\"dynamicDialogConfig.data.confirmBtnId\" [icon]=\"dynamicDialogConfig.data.confirmBtnIcon || ''\"\r\n [label]=\"dynamicDialogConfig.data.confirmBtnLabel\"\r\n [iconPos]=\"dynamicDialogConfig.data.confirmBtnPosition || 'left'\" [styleClass]=\"'confirmation-btn'\"\r\n (click)=\"submit()\" />\r\n <app-button [title]=\"dynamicDialogConfig.data?.closeLabel || ('actions.cancel' | translate)\"\r\n [severity]=\"'primary'\" variant=\"outlined\" [label]=\"dynamicDialogConfig.data.cancelBtnLabel\"\r\n [id]=\"dynamicDialogConfig.data.cancelBtnId\" [styleClass]=\"'cancel-btn confirmation-btn cancel-btn'\"\r\n (click)=\"close()\" />\r\n </div>\r\n </div>\r\n\r\n</div>\r\n}\r\n", styles: [".confirmation-dialog-wrapper .p-dialog-header{justify-content:space-between}.confirmation-dialog-wrapper .p-dialog-title{text-align:start;flex:1}.confirmation-dialog .dialog-wrapper{padding:.5rem}.confirmation-dialog__content{text-align:start}.confirmation-dialog__message{font-weight:600}.confirmation-dialog__hint{color:#6b7280}.confirmation-dialog__actions{display:flex;justify-content:end;gap:.5rem}.confirmation-dialog .dynamic-form{text-align:start}\n"] }]
|
|
2530
2551
|
}] });
|
|
2531
2552
|
|
|
2532
2553
|
class ReadMoreComponent {
|
|
@@ -3108,7 +3129,7 @@ class AlertDialogComponent extends DynamicDialogRef {
|
|
|
3108
3129
|
this._ref.close(false);
|
|
3109
3130
|
}
|
|
3110
3131
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AlertDialogComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3111
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: AlertDialogComponent, isStandalone: true, selector: "app-alert-dialog", providers: [DynamicDialogStyle], usesInheritance: true, ngImport: i0, template: "@if (dynamicDialogConfig.data) {\r\n <div class=\"alert-dialog\">\r\n <div class=\"dialog-wrapper\">\r\n @if (dynamicDialogConfig.data) {\r\n <div class=\"alert-dialog__content my-4\">\r\n @if (dynamicDialogConfig.data.dialogIcon) {\r\n <em [class]=\"dynamicDialogConfig.data.dialogIcon\"></em>\r\n }\r\n <p class=\"alert-dialog__message mb-2\">\r\n {{ dynamicDialogConfig.data.message }}\r\n </p>\r\n </div>\r\n }\r\n <div class=\"alert-dialog__actions flex gap-2 mt-4\">\r\n <app-button [severity]=\"'primary'\" variant=\"outlined\"\r\n [label]=\"dynamicDialogConfig.data.cancelBtnLabel??('actions.close' | translate)\"\r\n [id]=\"dynamicDialogConfig.data.cancelBtnId??'button_close_alert'\" [styleClass]=\"'cancel-btn alert-btn'\"\r\n (click)=\"close()\" />\r\n </div>\r\n </div>\r\n </div>\r\n}\r\n", styles: [""], dependencies: [{ kind: "component", type: AppButtonComponent, selector: "app-button" }, { kind: "ngmodule", type: AvatarModule }, { kind: "ngmodule", type: DynamicDialogModule }, { kind: "pipe", type: TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
|
|
3132
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: AlertDialogComponent, isStandalone: true, selector: "app-alert-dialog", providers: [DynamicDialogStyle], usesInheritance: true, ngImport: i0, template: "@if (dynamicDialogConfig.data) {\r\n <div class=\"alert-dialog\">\r\n <div class=\"dialog-wrapper\">\r\n @if (dynamicDialogConfig.data) {\r\n <div class=\"alert-dialog__content my-4\">\r\n @if (dynamicDialogConfig.data.dialogIcon) {\r\n <em [class]=\"dynamicDialogConfig.data.dialogIcon\"></em>\r\n }\r\n <p class=\"alert-dialog__message mb-2\">\r\n {{ dynamicDialogConfig.data.message }}\r\n </p>\r\n </div>\r\n }\r\n <div class=\"alert-dialog__actions flex gap-2 mt-4\">\r\n <app-button [severity]=\"'primary'\" variant=\"outlined\"\r\n [label]=\"dynamicDialogConfig.data.cancelBtnLabel??('actions.close' | translate)\"\r\n [id]=\"dynamicDialogConfig.data.cancelBtnId??'button_close_alert'\" [styleClass]=\"'cancel-btn alert-btn'\"\r\n (click)=\"close()\" />\r\n </div>\r\n </div>\r\n </div>\r\n}\r\n", styles: [".alert-dialog-wrapper .p-dialog-header{justify-content:space-between}.alert-dialog-wrapper .p-dialog-title{text-align:start;flex:1}.alert-dialog__content{text-align:start}.alert-dialog__message{font-weight:600}.alert-dialog__actions{display:flex;justify-content:end;gap:.5rem}\n"], dependencies: [{ kind: "component", type: AppButtonComponent, selector: "app-button" }, { kind: "ngmodule", type: AvatarModule }, { kind: "ngmodule", type: DynamicDialogModule }, { kind: "pipe", type: TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
|
|
3112
3133
|
}
|
|
3113
3134
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AlertDialogComponent, decorators: [{
|
|
3114
3135
|
type: Component,
|
|
@@ -3117,7 +3138,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
3117
3138
|
AvatarModule,
|
|
3118
3139
|
DynamicDialogModule,
|
|
3119
3140
|
TranslatePipe,
|
|
3120
|
-
], providers: [DynamicDialogStyle], template: "@if (dynamicDialogConfig.data) {\r\n <div class=\"alert-dialog\">\r\n <div class=\"dialog-wrapper\">\r\n @if (dynamicDialogConfig.data) {\r\n <div class=\"alert-dialog__content my-4\">\r\n @if (dynamicDialogConfig.data.dialogIcon) {\r\n <em [class]=\"dynamicDialogConfig.data.dialogIcon\"></em>\r\n }\r\n <p class=\"alert-dialog__message mb-2\">\r\n {{ dynamicDialogConfig.data.message }}\r\n </p>\r\n </div>\r\n }\r\n <div class=\"alert-dialog__actions flex gap-2 mt-4\">\r\n <app-button [severity]=\"'primary'\" variant=\"outlined\"\r\n [label]=\"dynamicDialogConfig.data.cancelBtnLabel??('actions.close' | translate)\"\r\n [id]=\"dynamicDialogConfig.data.cancelBtnId??'button_close_alert'\" [styleClass]=\"'cancel-btn alert-btn'\"\r\n (click)=\"close()\" />\r\n </div>\r\n </div>\r\n </div>\r\n}\r\n" }]
|
|
3141
|
+
], providers: [DynamicDialogStyle], template: "@if (dynamicDialogConfig.data) {\r\n <div class=\"alert-dialog\">\r\n <div class=\"dialog-wrapper\">\r\n @if (dynamicDialogConfig.data) {\r\n <div class=\"alert-dialog__content my-4\">\r\n @if (dynamicDialogConfig.data.dialogIcon) {\r\n <em [class]=\"dynamicDialogConfig.data.dialogIcon\"></em>\r\n }\r\n <p class=\"alert-dialog__message mb-2\">\r\n {{ dynamicDialogConfig.data.message }}\r\n </p>\r\n </div>\r\n }\r\n <div class=\"alert-dialog__actions flex gap-2 mt-4\">\r\n <app-button [severity]=\"'primary'\" variant=\"outlined\"\r\n [label]=\"dynamicDialogConfig.data.cancelBtnLabel??('actions.close' | translate)\"\r\n [id]=\"dynamicDialogConfig.data.cancelBtnId??'button_close_alert'\" [styleClass]=\"'cancel-btn alert-btn'\"\r\n (click)=\"close()\" />\r\n </div>\r\n </div>\r\n </div>\r\n}\r\n", styles: [".alert-dialog-wrapper .p-dialog-header{justify-content:space-between}.alert-dialog-wrapper .p-dialog-title{text-align:start;flex:1}.alert-dialog__content{text-align:start}.alert-dialog__message{font-weight:600}.alert-dialog__actions{display:flex;justify-content:end;gap:.5rem}\n"] }]
|
|
3121
3142
|
}] });
|
|
3122
3143
|
|
|
3123
3144
|
class AlertDialogService {
|