@seniorsistemas/angular-components 18.1.0 → 18.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/checkbox/lib/checkbox/checkbox.component.d.ts +13 -3
- package/esm2022/checkbox/lib/checkbox/checkbox.component.mjs +21 -12
- package/esm2022/file-upload/lib/file-upload/file-upload.component.mjs +4 -4
- package/esm2022/file-upload/lib/file-upload/file-upload.module.mjs +13 -30
- package/esm2022/select/lib/select/components/select-option/select-option.component.mjs +1 -1
- package/esm2022/select/lib/select/select.component.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-checkbox.mjs +20 -11
- package/fesm2022/seniorsistemas-angular-components-checkbox.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-file-upload.mjs +7 -24
- package/fesm2022/seniorsistemas-angular-components-file-upload.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-select.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-select.mjs.map +1 -1
- package/file-upload/lib/file-upload/file-upload.module.d.ts +1 -1
- package/package.json +7 -7
|
@@ -13,8 +13,8 @@ import * as i5 from '@seniorsistemas/angular-components/button';
|
|
|
13
13
|
import { ButtonModule } from '@seniorsistemas/angular-components/button';
|
|
14
14
|
import * as i6 from 'primeng/tooltip';
|
|
15
15
|
import { TooltipModule } from 'primeng/tooltip';
|
|
16
|
-
import * as i7 from '
|
|
17
|
-
import { ProgressBarModule } from '
|
|
16
|
+
import * as i7 from '@seniorsistemas/angular-components/progressbar';
|
|
17
|
+
import { ProgressBarModule } from '@seniorsistemas/angular-components/progressbar';
|
|
18
18
|
import { LocaleModule } from '@seniorsistemas/angular-components/locale';
|
|
19
19
|
|
|
20
20
|
const ALL_PERMISSIONS = ['add', 'read', 'remove'];
|
|
@@ -246,11 +246,11 @@ class FileUploadComponent {
|
|
|
246
246
|
});
|
|
247
247
|
}
|
|
248
248
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FileUploadComponent, deps: [{ token: i1.DomSanitizer }, { token: FileUploadService }, { token: i3.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
249
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: FileUploadComponent, selector: "s-file-upload", inputs: { id: "id", chooseLabel: "chooseLabel", removeLabel: "removeLabel", cancelLabel: "cancelLabel", successTooltip: "successTooltip", multiple: "multiple", accept: "accept", supportedExtensions: "supportedExtensions", ariaLabelFileName: "ariaLabelFileName", maxFileSize: "maxFileSize", maxCombinedFileSize: "maxCombinedFileSize", fileLimit: "fileLimit", ariaLabelProgress: "ariaLabelProgress", ariaLabelSuccess: "ariaLabelSuccess", ariaLabelError: "ariaLabelError", ariaLabelRemove: "ariaLabelRemove", formGroup: "formGroup", disabled: "disabled", showFileUploadDate: "showFileUploadDate", permissions: "permissions", files: "files" }, outputs: { uploadHandler: "uploadHandler", removeFile: "removeFile", cancelUpload: "cancelUpload", downloadFile: "downloadFile", validateErrors: "validateErrors" }, host: { listeners: { "window:resize": "onResize()" } }, viewQueries: [{ propertyName: "inputUpload", first: true, predicate: ["inputUpload"], descendants: true }, { propertyName: "anchor", first: true, predicate: ["anchor"], descendants: true }], ngImport: i0, template: "<div\n [id]=\"id\"\n class=\"s-fileupload\"\n>\n <div class=\"s-fileupload-choose\">\n <input\n #inputUpload\n [id]=\"id + 'input-upload'\"\n type=\"file\"\n name=\"file\"\n [accept]=\"accept\"\n [multiple]=\"multiple\"\n (change)=\"_onInputFileSelect($event)\"\n />\n <s-button\n *ngIf=\"permissions.includes(ADD_PERMISSION)\"\n [id]=\"id + 'upload-button'\"\n [label]=\"chooseLabel || 'platform.angular_components.attach_files' | translate\"\n (clicked)=\"inputUpload.click()\"\n priority=\"primary\"\n [disabled]=\"disabled || !!formGroup?.disabled || fileLimit === files.length\"\n [auxiliary]=\"false\"\n >\n </s-button>\n </div>\n\n <section\n *ngIf=\"files.length\"\n [id]=\"id + 'fileupload-list'\"\n class=\"s-fileupload-list\"\n role=\"grid\"\n >\n <ng-container *ngFor=\"let file of files; let i = index\">\n <div\n class=\"s-fileupload-list-file\"\n role=\"row\"\n >\n <div\n [id]=\"id + '-file-' + i + '-name'\"\n class=\"flex flex-grow items-center justify-between overflow-hidden text-ellipsis text-nowrap\"\n role=\"gridcell\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (permissions.includes(READ_PERMISSION) && file.savedFile) || file.progress === 100\n ? descriptionUrl\n : description;\n context: {\n $implicit: file,\n index: i,\n }\n \"\n >\n </ng-container>\n\n <span>{{ formatFileSize(file.size) }}</span>\n\n <span\n *ngIf=\"modifiedDate\"\n class=\"s-fileupload-list-file-name-date\"\n >{{ modifiedDate }}</span\n >\n </div>\n <div\n class=\"s-fileupload-list-file-status\"\n role=\"gridcell\"\n >\n <p-progressBar\n *ngIf=\"file.isUploading && !isSmallDevice\"\n [style]=\"{\n width: '250px',\n 'background-color': '#d8d8d8',\n 'border-radius': '0px',\n height: '14px',\n }\"\n [value]=\"file.progress\"\n [showValue]=\"false\"\n role=\"alert\"\n [attr.aria-label]=\"ariaLabelProgress || 'platform.angular_components.loading_file' | translate\"\n >\n </p-progressBar>\n <span\n *ngIf=\"file.isUploading && isSmallDevice\"\n [id]=\"id + '-file-' + i + '-spin'\"\n class=\"fas fa-circle-notch fa-spin\"\n [attr.aria-label]=\"ariaLabelProgress || 'platform.angular_components.loading_file' | translate\"\n >\n </span>\n\n <span\n *ngIf=\"!file.isUploading && !file.error && file.progress === 100\"\n [id]=\"id + '-file-' + i + '-check'\"\n class=\"fas fa-check\"\n role=\"alert\"\n [attr.aria-label]=\"\n ariaLabelSuccess ||\n successTooltip ||\n 'platform.angular_components.file_attached_successfully' | translate\n \"\n [pTooltip]=\"\n successTooltip || 'platform.angular_components.file_attached_successfully' | translate\n \"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [appendTo]=\"'body'\"\n >\n </span>\n <span\n *ngIf=\"file.error?.message\"\n [id]=\"id + '-file-' + i + '-error'\"\n class=\"fas fa-times\"\n role=\"alert\"\n [pTooltip]=\"file.error?.message\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [appendTo]=\"'body'\"\n >\n </span>\n </div>\n <div\n class=\"s-fileupload-list-file-actions\"\n role=\"gridcell\"\n >\n <a\n *ngIf=\"file.isUploading\"\n [id]=\"id + '-file-' + i + '-cancel'\"\n class=\"s-fileupload-list-file-actions-action\"\n (click)=\"onCancelUpload(i)\"\n >\n {{ cancelLabel || 'platform.angular_components.cancel' | translate }}\n </a>\n <a\n *ngIf=\"\n permissions.includes(REMOVE_PERMISSION) &&\n !file.isUploading &&\n !(disabled || !!formGroup?.disabled)\n \"\n role=\"button\"\n tabindex=\"0\"\n [id]=\"id + '-file-' + i + '-remove'\"\n class=\"s-fileupload-list-file-actions-action\"\n (click)=\"onRemoveFile(file)\"\n [attr.aria-label]=\"\n ariaLabelRemove || removeLabel || 'platform.angular_components.remove' | translate\n \"\n >\n {{ removeLabel || 'platform.angular_components.remove' | translate }}\n </a>\n </div>\n </div>\n </ng-container>\n </section>\n</div>\n\n<ng-template\n #descriptionUrl\n let-file\n let-i=\"index\"\n>\n <div class=\"flex justify-between\">\n <div>\n <a\n [id]=\"id + '-file-' + i + '-name-link'\"\n tabindex=\"0\"\n (click)=\"onDowloadFile(i)\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\"\n class=\"break-words\"\n >{{ file.name }}\n </a>\n <a\n style=\"display: none\"\n [href]=\"file.objectURL\"\n target=\"_blank\"\n download\n #anchor\n >\n </a>\n </div>\n </div>\n</ng-template>\n\n<ng-template\n #description\n let-file\n>\n <div class=\"flex justify-between\">\n <span\n tabindex=\"0\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\"\n >\n {{ file.name }}\n </span>\n </div>\n</ng-template>\n\n", styles: [".s-fileupload .s-fileupload-choose{position:relative;margin:15px 0;width:max-content}.s-fileupload input[type=file]{display:none}.s-fileupload-list{border:1px solid #ccc}.s-fileupload-list-file:not(:first-child){border-top:1px solid #ccc}.s-fileupload-list .s-fileupload-list-file{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;padding:15px}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name{display:flex;flex-direction:column;align-self:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name .s-fileupload-list-file-name-date{font-size:.75rem;color:#999}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name>a{cursor:pointer;text-decoration:none}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-status{align-self:center}.s-fileupload-list .s-fileupload-list-file .fas.fa-circle-notch{color:#d8d8d8;font-size:12px}.s-fileupload-list .s-fileupload-list-file .fas.fa-check{color:#0c9348;font-size:12px}.s-fileupload-list .s-fileupload-list-file .fas.fa-times{color:#c13018;font-size:12px}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions{margin-top:15px;align-self:center;width:100%}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action{text-decoration:none;color:#428bca}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action:hover,.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action :focus,.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action :visited{text-decoration:none}@media (min-width: 768px){.s-fileupload-list .s-fileupload-list-file{flex-wrap:nowrap}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name{width:auto;flex-grow:2}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-status{margin:0 15px}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions{margin:0;width:auto}}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i5.ButtonComponent, selector: "s-button", inputs: ["id", "label", "tooltip", "tooltipPosition", "iconClass", "rightIconClass", "caret", "styleClass", "baseZIndex", "disabled", "auxiliary", "type", "priority", "menuOptions", "size", "slide", "animation", "badge", "iconColor"], outputs: ["clicked"] }, { kind: "directive", type: i6.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "component", type: i7.ProgressBar, selector: "p-progressBar, p-progressbar, p-progress-bar", inputs: ["value", "showValue", "styleClass", "valueStyleClass", "style", "unit", "mode", "color"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }] });
|
|
249
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: FileUploadComponent, selector: "s-file-upload", inputs: { id: "id", chooseLabel: "chooseLabel", removeLabel: "removeLabel", cancelLabel: "cancelLabel", successTooltip: "successTooltip", multiple: "multiple", accept: "accept", supportedExtensions: "supportedExtensions", ariaLabelFileName: "ariaLabelFileName", maxFileSize: "maxFileSize", maxCombinedFileSize: "maxCombinedFileSize", fileLimit: "fileLimit", ariaLabelProgress: "ariaLabelProgress", ariaLabelSuccess: "ariaLabelSuccess", ariaLabelError: "ariaLabelError", ariaLabelRemove: "ariaLabelRemove", formGroup: "formGroup", disabled: "disabled", showFileUploadDate: "showFileUploadDate", permissions: "permissions", files: "files" }, outputs: { uploadHandler: "uploadHandler", removeFile: "removeFile", cancelUpload: "cancelUpload", downloadFile: "downloadFile", validateErrors: "validateErrors" }, host: { listeners: { "window:resize": "onResize()" } }, viewQueries: [{ propertyName: "inputUpload", first: true, predicate: ["inputUpload"], descendants: true }, { propertyName: "anchor", first: true, predicate: ["anchor"], descendants: true }], ngImport: i0, template: "<div\n [id]=\"id\"\n class=\"s-fileupload\"\n>\n <div class=\"s-fileupload-choose\">\n <input\n #inputUpload\n [id]=\"id + 'input-upload'\"\n type=\"file\"\n name=\"file\"\n [accept]=\"accept\"\n [multiple]=\"multiple\"\n (change)=\"_onInputFileSelect($event)\"\n />\n @if (permissions.includes(ADD_PERMISSION)) {\n <s-button\n [id]=\"id + 'upload-button'\"\n [label]=\"chooseLabel || 'platform.angular_components.attach_files' | translate\"\n (clicked)=\"inputUpload.click()\"\n priority=\"primary\"\n [disabled]=\"disabled || !!formGroup?.disabled || fileLimit === files.length\"\n [auxiliary]=\"false\"\n >\n </s-button>\n }\n </div>\n\n @if (files.length) {\n <section\n [id]=\"id + 'fileupload-list'\"\n class=\"s-fileupload-list\"\n role=\"grid\"\n >\n @for (file of files; track file; let i = $index) {\n <div\n class=\"s-fileupload-list-file\"\n role=\"row\"\n >\n <div\n [id]=\"id + '-file-' + i + '-name'\"\n class=\"flex flex-grow items-center justify-between overflow-hidden text-ellipsis text-nowrap\"\n role=\"gridcell\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (permissions.includes(READ_PERMISSION) && file.savedFile) || file.progress === 100\n ? descriptionUrl\n : description;\n context: {\n $implicit: file,\n index: i,\n }\n \"\n >\n </ng-container>\n\n <span>{{ formatFileSize(file.size) }}</span>\n\n @if (modifiedDate) {\n <span class=\"s-fileupload-list-file-name-date\">{{ modifiedDate }}</span>\n }\n </div>\n <div\n class=\"s-fileupload-list-file-status\"\n role=\"gridcell\"\n >\n @if (file.isUploading && !isSmallDevice) {\n <div class=\"w-64\">\n <s-progressbar\n [value]=\"file.progress ?? 0\"\n [showValue]=\"false\"\n activeColor=\"blue\"\n ></s-progressbar>\n </div>\n }\n\n @if (file.isUploading && isSmallDevice) {\n <span\n [id]=\"id + '-file-' + i + '-spin'\"\n class=\"fas fa-circle-notch fa-spin\"\n [attr.aria-label]=\"\n ariaLabelProgress || 'platform.angular_components.loading_file' | translate\n \"\n >\n </span>\n }\n\n @if (!file.isUploading && !file.error && file.progress === 100) {\n <span\n [id]=\"id + '-file-' + i + '-check'\"\n class=\"fas fa-check\"\n role=\"alert\"\n [attr.aria-label]=\"\n ariaLabelSuccess ||\n successTooltip ||\n 'platform.angular_components.file_attached_successfully' | translate\n \"\n [pTooltip]=\"\n successTooltip || 'platform.angular_components.file_attached_successfully'\n | translate\n \"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [appendTo]=\"'body'\"\n >\n </span>\n }\n\n @if (file.error?.message) {\n <span\n [id]=\"id + '-file-' + i + '-error'\"\n class=\"fas fa-times\"\n role=\"alert\"\n [pTooltip]=\"file.error?.message\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [appendTo]=\"'body'\"\n >\n </span>\n }\n </div>\n <div\n class=\"s-fileupload-list-file-actions\"\n role=\"gridcell\"\n >\n @if (file.isUploading) {\n <a\n [id]=\"id + '-file-' + i + '-cancel'\"\n class=\"s-fileupload-list-file-actions-action\"\n (click)=\"onCancelUpload(i)\"\n >\n {{ cancelLabel || 'platform.angular_components.cancel' | translate }}\n </a>\n }\n\n @if (\n permissions.includes(REMOVE_PERMISSION) &&\n !file.isUploading &&\n !(disabled || !!formGroup?.disabled)\n ) {\n <a\n role=\"button\"\n tabindex=\"0\"\n [id]=\"id + '-file-' + i + '-remove'\"\n class=\"s-fileupload-list-file-actions-action\"\n (click)=\"onRemoveFile(file)\"\n [attr.aria-label]=\"\n ariaLabelRemove || removeLabel || 'platform.angular_components.remove' | translate\n \"\n >\n {{ removeLabel || 'platform.angular_components.remove' | translate }}\n </a>\n }\n </div>\n </div>\n }\n </section>\n }\n</div>\n\n<ng-template\n #descriptionUrl\n let-file\n let-i=\"index\"\n>\n <div class=\"flex justify-between\">\n <div>\n <a\n [id]=\"id + '-file-' + i + '-name-link'\"\n tabindex=\"0\"\n (click)=\"onDowloadFile(i)\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\"\n class=\"break-words\"\n >{{ file.name }}\n </a>\n <a\n style=\"display: none\"\n [href]=\"file.objectURL\"\n target=\"_blank\"\n download\n #anchor\n >\n </a>\n </div>\n </div>\n</ng-template>\n\n<ng-template\n #description\n let-file\n>\n <div class=\"flex justify-between\">\n <span\n tabindex=\"0\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\"\n >\n {{ file.name }}\n </span>\n </div>\n</ng-template>\n\n", styles: [".s-fileupload .s-fileupload-choose{position:relative;margin:15px 0;width:max-content}.s-fileupload input[type=file]{display:none}.s-fileupload-list{border:1px solid #ccc}.s-fileupload-list-file:not(:first-child){border-top:1px solid #ccc}.s-fileupload-list .s-fileupload-list-file{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;padding:15px}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name{display:flex;flex-direction:column;align-self:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name .s-fileupload-list-file-name-date{font-size:.75rem;color:#999}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name>a{cursor:pointer;text-decoration:none}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-status{align-self:center}.s-fileupload-list .s-fileupload-list-file .fas.fa-circle-notch{color:#d8d8d8;font-size:12px}.s-fileupload-list .s-fileupload-list-file .fas.fa-check{color:#0c9348;font-size:12px}.s-fileupload-list .s-fileupload-list-file .fas.fa-times{color:#c13018;font-size:12px}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions{margin-top:15px;align-self:center;width:100%}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action{text-decoration:none;color:#428bca}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action:hover,.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action :focus,.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action :visited{text-decoration:none}@media (min-width: 768px){.s-fileupload-list .s-fileupload-list-file{flex-wrap:nowrap}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name{width:auto;flex-grow:2}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-status{margin:0 15px}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions{margin:0;width:auto}}\n"], dependencies: [{ kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i5.ButtonComponent, selector: "s-button", inputs: ["id", "label", "tooltip", "tooltipPosition", "iconClass", "rightIconClass", "caret", "styleClass", "baseZIndex", "disabled", "auxiliary", "type", "priority", "menuOptions", "size", "slide", "animation", "badge", "iconColor"], outputs: ["clicked"] }, { kind: "directive", type: i6.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "component", type: i7.ProgressBarComponent, selector: "s-progressbar", inputs: ["value", "activeColor", "numberFormatOptions", "targetValue", "label", "targetLabel", "showValue", "mode"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }] });
|
|
250
250
|
}
|
|
251
251
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FileUploadComponent, decorators: [{
|
|
252
252
|
type: Component,
|
|
253
|
-
args: [{ selector: 's-file-upload', template: "<div\n [id]=\"id\"\n class=\"s-fileupload\"\n>\n <div class=\"s-fileupload-choose\">\n <input\n #inputUpload\n [id]=\"id + 'input-upload'\"\n type=\"file\"\n name=\"file\"\n [accept]=\"accept\"\n [multiple]=\"multiple\"\n (change)=\"_onInputFileSelect($event)\"\n />\n <s-button\n *ngIf=\"permissions.includes(ADD_PERMISSION)\"\n [id]=\"id + 'upload-button'\"\n [label]=\"chooseLabel || 'platform.angular_components.attach_files' | translate\"\n (clicked)=\"inputUpload.click()\"\n priority=\"primary\"\n [disabled]=\"disabled || !!formGroup?.disabled || fileLimit === files.length\"\n [auxiliary]=\"false\"\n >\n </s-button>\n </div>\n\n <section\n *ngIf=\"files.length\"\n [id]=\"id + 'fileupload-list'\"\n class=\"s-fileupload-list\"\n role=\"grid\"\n >\n <ng-container *ngFor=\"let file of files; let i = index\">\n <div\n class=\"s-fileupload-list-file\"\n role=\"row\"\n >\n <div\n [id]=\"id + '-file-' + i + '-name'\"\n class=\"flex flex-grow items-center justify-between overflow-hidden text-ellipsis text-nowrap\"\n role=\"gridcell\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (permissions.includes(READ_PERMISSION) && file.savedFile) || file.progress === 100\n ? descriptionUrl\n : description;\n context: {\n $implicit: file,\n index: i,\n }\n \"\n >\n </ng-container>\n\n <span>{{ formatFileSize(file.size) }}</span>\n\n <span\n *ngIf=\"modifiedDate\"\n class=\"s-fileupload-list-file-name-date\"\n >{{ modifiedDate }}</span\n >\n </div>\n <div\n class=\"s-fileupload-list-file-status\"\n role=\"gridcell\"\n >\n <p-progressBar\n *ngIf=\"file.isUploading && !isSmallDevice\"\n [style]=\"{\n width: '250px',\n 'background-color': '#d8d8d8',\n 'border-radius': '0px',\n height: '14px',\n }\"\n [value]=\"file.progress\"\n [showValue]=\"false\"\n role=\"alert\"\n [attr.aria-label]=\"ariaLabelProgress || 'platform.angular_components.loading_file' | translate\"\n >\n </p-progressBar>\n <span\n *ngIf=\"file.isUploading && isSmallDevice\"\n [id]=\"id + '-file-' + i + '-spin'\"\n class=\"fas fa-circle-notch fa-spin\"\n [attr.aria-label]=\"ariaLabelProgress || 'platform.angular_components.loading_file' | translate\"\n >\n </span>\n\n <span\n *ngIf=\"!file.isUploading && !file.error && file.progress === 100\"\n [id]=\"id + '-file-' + i + '-check'\"\n class=\"fas fa-check\"\n role=\"alert\"\n [attr.aria-label]=\"\n ariaLabelSuccess ||\n successTooltip ||\n 'platform.angular_components.file_attached_successfully' | translate\n \"\n [pTooltip]=\"\n successTooltip || 'platform.angular_components.file_attached_successfully' | translate\n \"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [appendTo]=\"'body'\"\n >\n </span>\n <span\n *ngIf=\"file.error?.message\"\n [id]=\"id + '-file-' + i + '-error'\"\n class=\"fas fa-times\"\n role=\"alert\"\n [pTooltip]=\"file.error?.message\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [appendTo]=\"'body'\"\n >\n </span>\n </div>\n <div\n class=\"s-fileupload-list-file-actions\"\n role=\"gridcell\"\n >\n <a\n *ngIf=\"file.isUploading\"\n [id]=\"id + '-file-' + i + '-cancel'\"\n class=\"s-fileupload-list-file-actions-action\"\n (click)=\"onCancelUpload(i)\"\n >\n {{ cancelLabel || 'platform.angular_components.cancel' | translate }}\n </a>\n <a\n *ngIf=\"\n permissions.includes(REMOVE_PERMISSION) &&\n !file.isUploading &&\n !(disabled || !!formGroup?.disabled)\n \"\n role=\"button\"\n tabindex=\"0\"\n [id]=\"id + '-file-' + i + '-remove'\"\n class=\"s-fileupload-list-file-actions-action\"\n (click)=\"onRemoveFile(file)\"\n [attr.aria-label]=\"\n ariaLabelRemove || removeLabel || 'platform.angular_components.remove' | translate\n \"\n >\n {{ removeLabel || 'platform.angular_components.remove' | translate }}\n </a>\n </div>\n </div>\n </ng-container>\n </section>\n</div>\n\n<ng-template\n #descriptionUrl\n let-file\n let-i=\"index\"\n>\n <div class=\"flex justify-between\">\n <div>\n <a\n [id]=\"id + '-file-' + i + '-name-link'\"\n tabindex=\"0\"\n (click)=\"onDowloadFile(i)\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\"\n class=\"break-words\"\n >{{ file.name }}\n </a>\n <a\n style=\"display: none\"\n [href]=\"file.objectURL\"\n target=\"_blank\"\n download\n #anchor\n >\n </a>\n </div>\n </div>\n</ng-template>\n\n<ng-template\n #description\n let-file\n>\n <div class=\"flex justify-between\">\n <span\n tabindex=\"0\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\"\n >\n {{ file.name }}\n </span>\n </div>\n</ng-template>\n\n", styles: [".s-fileupload .s-fileupload-choose{position:relative;margin:15px 0;width:max-content}.s-fileupload input[type=file]{display:none}.s-fileupload-list{border:1px solid #ccc}.s-fileupload-list-file:not(:first-child){border-top:1px solid #ccc}.s-fileupload-list .s-fileupload-list-file{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;padding:15px}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name{display:flex;flex-direction:column;align-self:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name .s-fileupload-list-file-name-date{font-size:.75rem;color:#999}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name>a{cursor:pointer;text-decoration:none}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-status{align-self:center}.s-fileupload-list .s-fileupload-list-file .fas.fa-circle-notch{color:#d8d8d8;font-size:12px}.s-fileupload-list .s-fileupload-list-file .fas.fa-check{color:#0c9348;font-size:12px}.s-fileupload-list .s-fileupload-list-file .fas.fa-times{color:#c13018;font-size:12px}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions{margin-top:15px;align-self:center;width:100%}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action{text-decoration:none;color:#428bca}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action:hover,.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action :focus,.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action :visited{text-decoration:none}@media (min-width: 768px){.s-fileupload-list .s-fileupload-list-file{flex-wrap:nowrap}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name{width:auto;flex-grow:2}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-status{margin:0 15px}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions{margin:0;width:auto}}\n"] }]
|
|
253
|
+
args: [{ selector: 's-file-upload', template: "<div\n [id]=\"id\"\n class=\"s-fileupload\"\n>\n <div class=\"s-fileupload-choose\">\n <input\n #inputUpload\n [id]=\"id + 'input-upload'\"\n type=\"file\"\n name=\"file\"\n [accept]=\"accept\"\n [multiple]=\"multiple\"\n (change)=\"_onInputFileSelect($event)\"\n />\n @if (permissions.includes(ADD_PERMISSION)) {\n <s-button\n [id]=\"id + 'upload-button'\"\n [label]=\"chooseLabel || 'platform.angular_components.attach_files' | translate\"\n (clicked)=\"inputUpload.click()\"\n priority=\"primary\"\n [disabled]=\"disabled || !!formGroup?.disabled || fileLimit === files.length\"\n [auxiliary]=\"false\"\n >\n </s-button>\n }\n </div>\n\n @if (files.length) {\n <section\n [id]=\"id + 'fileupload-list'\"\n class=\"s-fileupload-list\"\n role=\"grid\"\n >\n @for (file of files; track file; let i = $index) {\n <div\n class=\"s-fileupload-list-file\"\n role=\"row\"\n >\n <div\n [id]=\"id + '-file-' + i + '-name'\"\n class=\"flex flex-grow items-center justify-between overflow-hidden text-ellipsis text-nowrap\"\n role=\"gridcell\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (permissions.includes(READ_PERMISSION) && file.savedFile) || file.progress === 100\n ? descriptionUrl\n : description;\n context: {\n $implicit: file,\n index: i,\n }\n \"\n >\n </ng-container>\n\n <span>{{ formatFileSize(file.size) }}</span>\n\n @if (modifiedDate) {\n <span class=\"s-fileupload-list-file-name-date\">{{ modifiedDate }}</span>\n }\n </div>\n <div\n class=\"s-fileupload-list-file-status\"\n role=\"gridcell\"\n >\n @if (file.isUploading && !isSmallDevice) {\n <div class=\"w-64\">\n <s-progressbar\n [value]=\"file.progress ?? 0\"\n [showValue]=\"false\"\n activeColor=\"blue\"\n ></s-progressbar>\n </div>\n }\n\n @if (file.isUploading && isSmallDevice) {\n <span\n [id]=\"id + '-file-' + i + '-spin'\"\n class=\"fas fa-circle-notch fa-spin\"\n [attr.aria-label]=\"\n ariaLabelProgress || 'platform.angular_components.loading_file' | translate\n \"\n >\n </span>\n }\n\n @if (!file.isUploading && !file.error && file.progress === 100) {\n <span\n [id]=\"id + '-file-' + i + '-check'\"\n class=\"fas fa-check\"\n role=\"alert\"\n [attr.aria-label]=\"\n ariaLabelSuccess ||\n successTooltip ||\n 'platform.angular_components.file_attached_successfully' | translate\n \"\n [pTooltip]=\"\n successTooltip || 'platform.angular_components.file_attached_successfully'\n | translate\n \"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [appendTo]=\"'body'\"\n >\n </span>\n }\n\n @if (file.error?.message) {\n <span\n [id]=\"id + '-file-' + i + '-error'\"\n class=\"fas fa-times\"\n role=\"alert\"\n [pTooltip]=\"file.error?.message\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [appendTo]=\"'body'\"\n >\n </span>\n }\n </div>\n <div\n class=\"s-fileupload-list-file-actions\"\n role=\"gridcell\"\n >\n @if (file.isUploading) {\n <a\n [id]=\"id + '-file-' + i + '-cancel'\"\n class=\"s-fileupload-list-file-actions-action\"\n (click)=\"onCancelUpload(i)\"\n >\n {{ cancelLabel || 'platform.angular_components.cancel' | translate }}\n </a>\n }\n\n @if (\n permissions.includes(REMOVE_PERMISSION) &&\n !file.isUploading &&\n !(disabled || !!formGroup?.disabled)\n ) {\n <a\n role=\"button\"\n tabindex=\"0\"\n [id]=\"id + '-file-' + i + '-remove'\"\n class=\"s-fileupload-list-file-actions-action\"\n (click)=\"onRemoveFile(file)\"\n [attr.aria-label]=\"\n ariaLabelRemove || removeLabel || 'platform.angular_components.remove' | translate\n \"\n >\n {{ removeLabel || 'platform.angular_components.remove' | translate }}\n </a>\n }\n </div>\n </div>\n }\n </section>\n }\n</div>\n\n<ng-template\n #descriptionUrl\n let-file\n let-i=\"index\"\n>\n <div class=\"flex justify-between\">\n <div>\n <a\n [id]=\"id + '-file-' + i + '-name-link'\"\n tabindex=\"0\"\n (click)=\"onDowloadFile(i)\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\"\n class=\"break-words\"\n >{{ file.name }}\n </a>\n <a\n style=\"display: none\"\n [href]=\"file.objectURL\"\n target=\"_blank\"\n download\n #anchor\n >\n </a>\n </div>\n </div>\n</ng-template>\n\n<ng-template\n #description\n let-file\n>\n <div class=\"flex justify-between\">\n <span\n tabindex=\"0\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\"\n >\n {{ file.name }}\n </span>\n </div>\n</ng-template>\n\n", styles: [".s-fileupload .s-fileupload-choose{position:relative;margin:15px 0;width:max-content}.s-fileupload input[type=file]{display:none}.s-fileupload-list{border:1px solid #ccc}.s-fileupload-list-file:not(:first-child){border-top:1px solid #ccc}.s-fileupload-list .s-fileupload-list-file{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;padding:15px}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name{display:flex;flex-direction:column;align-self:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name .s-fileupload-list-file-name-date{font-size:.75rem;color:#999}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name>a{cursor:pointer;text-decoration:none}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-status{align-self:center}.s-fileupload-list .s-fileupload-list-file .fas.fa-circle-notch{color:#d8d8d8;font-size:12px}.s-fileupload-list .s-fileupload-list-file .fas.fa-check{color:#0c9348;font-size:12px}.s-fileupload-list .s-fileupload-list-file .fas.fa-times{color:#c13018;font-size:12px}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions{margin-top:15px;align-self:center;width:100%}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action{text-decoration:none;color:#428bca}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action:hover,.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action :focus,.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action :visited{text-decoration:none}@media (min-width: 768px){.s-fileupload-list .s-fileupload-list-file{flex-wrap:nowrap}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name{width:auto;flex-grow:2}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-status{margin:0 15px}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions{margin:0;width:auto}}\n"] }]
|
|
254
254
|
}], ctorParameters: () => [{ type: i1.DomSanitizer }, { type: FileUploadService }, { type: i3.TranslateService }], propDecorators: { inputUpload: [{
|
|
255
255
|
type: ViewChild,
|
|
256
256
|
args: ['inputUpload', { static: false }]
|
|
@@ -316,31 +316,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
316
316
|
|
|
317
317
|
class FileUploadModule {
|
|
318
318
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FileUploadModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
319
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: FileUploadModule, declarations: [FileUploadComponent], imports: [CommonModule,
|
|
320
|
-
|
|
321
|
-
TooltipModule,
|
|
322
|
-
ProgressBarModule,
|
|
323
|
-
TranslateModule,
|
|
324
|
-
LocaleModule], exports: [FileUploadComponent] });
|
|
325
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FileUploadModule, providers: [FileUploadService], imports: [CommonModule,
|
|
326
|
-
ButtonModule,
|
|
327
|
-
TooltipModule,
|
|
328
|
-
ProgressBarModule,
|
|
329
|
-
TranslateModule,
|
|
330
|
-
LocaleModule] });
|
|
319
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: FileUploadModule, declarations: [FileUploadComponent], imports: [CommonModule, ButtonModule, TooltipModule, ProgressBarModule, TranslateModule, LocaleModule], exports: [FileUploadComponent] });
|
|
320
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FileUploadModule, providers: [FileUploadService], imports: [CommonModule, ButtonModule, TooltipModule, ProgressBarModule, TranslateModule, LocaleModule] });
|
|
331
321
|
}
|
|
332
322
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FileUploadModule, decorators: [{
|
|
333
323
|
type: NgModule,
|
|
334
324
|
args: [{
|
|
335
325
|
declarations: [FileUploadComponent],
|
|
336
|
-
imports: [
|
|
337
|
-
CommonModule,
|
|
338
|
-
ButtonModule,
|
|
339
|
-
TooltipModule,
|
|
340
|
-
ProgressBarModule,
|
|
341
|
-
TranslateModule,
|
|
342
|
-
LocaleModule,
|
|
343
|
-
],
|
|
326
|
+
imports: [CommonModule, ButtonModule, TooltipModule, ProgressBarModule, TranslateModule, LocaleModule],
|
|
344
327
|
providers: [FileUploadService],
|
|
345
328
|
exports: [FileUploadComponent],
|
|
346
329
|
}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seniorsistemas-angular-components-file-upload.mjs","sources":["../../projects/angular-components/file-upload/src/lib/file-upload/models/file-upload-permissions.ts","../../projects/angular-components/file-upload/src/lib/file-upload/file-upload.service.ts","../../projects/angular-components/file-upload/src/lib/file-upload/file-upload.component.ts","../../projects/angular-components/file-upload/src/lib/file-upload/file-upload.component.html","../../projects/angular-components/file-upload/src/lib/file-upload/file-upload.module.ts","../../projects/angular-components/file-upload/src/seniorsistemas-angular-components-file-upload.ts"],"sourcesContent":["export type FileUploadPermissions = 'add' | 'read' | 'remove';\n\nexport const ALL_PERMISSIONS: FileUploadPermissions[] = ['add', 'read', 'remove'];\n","import { Injectable } from '@angular/core';\nimport { ListBlobMetadataRequest, ListBlobMetadataResponse } from './models/list-blob-metadata';\nimport { CustomHttpClient } from '@seniorsistemas/angular-components/common';\n\n@Injectable()\nexport class FileUploadService {\n private BASE_URL_FIELD_CUSTOMIZATION = 'platform/field_customization';\n private TOKEN = new AbortController();\n\n public async getMetadataCustomField<T>(request: ListBlobMetadataRequest): Promise<ListBlobMetadataResponse> {\n return CustomHttpClient.post(`${this.BASE_URL_FIELD_CUSTOMIZATION}/queries/getFileMetadata`, request, {\n signal: this.TOKEN.signal,\n });\n }\n}\n","import {\n AfterContentInit,\n Component,\n ElementRef,\n EventEmitter,\n HostListener,\n Input,\n OnDestroy,\n OnInit,\n Output,\n ViewChild,\n} from '@angular/core';\nimport { FormControl } from '@angular/forms';\nimport { DomSanitizer } from '@angular/platform-browser';\n\nimport { TranslateService } from '@ngx-translate/core';\nimport { Subject } from 'rxjs';\nimport moment from 'moment';\nimport { FileUploadService } from './file-upload.service';\nimport { ListBlobMetadataResponse } from './models/list-blob-metadata';\nimport { FileDto } from './models/file-dto';\nimport { UploadError } from './models/uploadError';\nimport { FileUploadPermissions, ALL_PERMISSIONS } from './models/file-upload-permissions';\nimport { Breakpoints, isNullOrUndefined } from '@seniorsistemas/angular-components/utils';\n\n@Component({\n selector: 's-file-upload',\n templateUrl: './file-upload.component.html',\n styleUrls: ['./file-upload.component.scss'],\n})\nexport class FileUploadComponent implements OnInit, OnDestroy, AfterContentInit {\n public static nextId = 0;\n\n public ADD_PERMISSION: FileUploadPermissions = 'add';\n public READ_PERMISSION: FileUploadPermissions = 'read';\n public REMOVE_PERMISSION: FileUploadPermissions = 'remove';\n\n @ViewChild('inputUpload', { static: false })\n private readonly inputUpload: ElementRef | null = null;\n\n @ViewChild('anchor', { static: false })\n private readonly anchor: ElementRef | null = null;\n\n @Input()\n public id = `s-file-upload-${FileUploadComponent.nextId++}`;\n\n @Input()\n public chooseLabel?: string;\n\n @Input()\n public removeLabel?: string;\n\n @Input()\n public cancelLabel?: string;\n\n @Input()\n public successTooltip?: string;\n\n @Input()\n public multiple?: boolean;\n\n @Input()\n public accept?: string;\n\n @Input()\n public supportedExtensions: string[] = [];\n\n @Input()\n public ariaLabelFileName?: string;\n\n @Input()\n public maxFileSize?: number;\n\n @Input()\n public maxCombinedFileSize?: number;\n\n @Input()\n public fileLimit?: number;\n\n @Input()\n public ariaLabelProgress?: string;\n\n @Input()\n public ariaLabelSuccess?: string;\n\n @Input()\n public ariaLabelError?: string;\n\n @Input()\n public ariaLabelRemove?: string;\n\n @Input()\n public formGroup?: FormControl;\n\n @Input()\n public disabled = false;\n\n @Input()\n public showFileUploadDate: boolean = false;\n\n @Input()\n public permissions: FileUploadPermissions[] = ALL_PERMISSIONS;\n\n @Input()\n public set files(files: FileDto[]) {\n if (this.showFileUploadDate && files[0]?.objectId) {\n this.getUploadDate(files);\n }\n this._files = files.map((file) => {\n file.objectURL = this.sanitizer.bypassSecurityTrustUrl(window.URL.createObjectURL(file));\n return file;\n });\n }\n\n @Output()\n public uploadHandler: EventEmitter<{ files: FileDto[] }> = new EventEmitter();\n\n @Output()\n public removeFile: EventEmitter<{ file: File }> = new EventEmitter();\n\n @Output()\n public cancelUpload: EventEmitter<number> = new EventEmitter();\n\n @Output()\n public downloadFile: EventEmitter<{ index: number; anchor: ElementRef }> = new EventEmitter();\n\n @Output()\n public validateErrors: EventEmitter<UploadError> = new EventEmitter();\n\n private _files: FileDto[] = [];\n private readonly ngUsubscribe: Subject<void> = new Subject();\n public isSmallDevice = false;\n public inputValue = '';\n public modifiedDate?: string;\n\n constructor(\n private readonly sanitizer: DomSanitizer,\n private readonly fileUploadService: FileUploadService,\n private readonly translate: TranslateService,\n ) {}\n\n public ngOnInit(): void {\n this.supportedExtensions = this.supportedExtensions.map((extension) =>\n extension.replace('.', '').toLowerCase(),\n );\n }\n\n public ngOnDestroy() {\n this.ngUsubscribe.next();\n this.ngUsubscribe.complete();\n }\n\n public ngAfterContentInit() {\n this.update();\n }\n\n @HostListener('window:resize')\n public onResize() {\n this.update();\n }\n\n public _onInputFileSelect($event: Event): void {\n const eventTargetFiles = ($event.target as HTMLInputElement)?.files as FileList;\n const dataTransferFiles = ($event as DragEvent).dataTransfer?.files as FileList;\n const files: FileDto[] = Array.from(dataTransferFiles ? dataTransferFiles : eventTargetFiles);\n this.onFileSelect(files);\n }\n\n public onFileSelect(files: FileDto[]): void {\n const newFiles: FileDto[] = [];\n\n if (!this.multiple) {\n this.files = [];\n }\n\n if (this.isFileLimitExceeded(files)) {\n this.validateErrors.emit({\n files,\n validation: 'maxFileLimit',\n });\n this.clearFileInput();\n return;\n }\n\n if (this.isFileCombinedSizeExceeded(files)) {\n this.validateErrors.emit({\n files: files,\n validation: 'maxCombinedFileSize',\n });\n this.clearFileInput();\n return;\n }\n\n for (const file of files) {\n if (this.isUnsupportedFileExtension(file)) {\n this.validateErrors.emit({\n files: [file],\n validation: 'unsupportedExtension',\n });\n continue;\n }\n\n if (this.isFileSizeExceeded(file)) {\n this.validateErrors.emit({\n files: [file],\n validation: 'maxFileSize',\n });\n continue;\n }\n\n newFiles.push(file);\n }\n\n if (newFiles.length) {\n this.files = this.files.concat(newFiles);\n this.uploadHandler.emit({\n files: newFiles,\n });\n }\n\n this.clearFileInput();\n }\n\n public onRemoveFile(file: FileDto): void {\n const fileIndex = this.files.indexOf(file);\n const removedFiles = this.files.splice(fileIndex, 1);\n\n if (removedFiles.length) {\n this.removeFile.emit({ file });\n }\n }\n\n public onCancelUpload(index: number) {\n const removedFiles = this.files.splice(index, 1);\n\n if (removedFiles.length) {\n this.cancelUpload.emit(index);\n }\n\n this.clearFileInput();\n }\n\n public onDowloadFile(index: number) {\n if (isNullOrUndefined(this.anchor)) return;\n\n this.downloadFile.emit({\n index,\n anchor: this.anchor,\n });\n }\n\n public get files(): FileDto[] {\n return this._files;\n }\n\n public formatFileSize(size: number): string {\n if (size === 0) {\n return '0 Bytes';\n }\n const k = 1024;\n const sizes = ['bytes', 'KB', 'MB', 'GB', 'TB'];\n const i = Math.floor(Math.log(size) / Math.log(k));\n return parseFloat((size / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];\n }\n\n private update() {\n const windowWidth = window.innerWidth;\n this.isSmallDevice = windowWidth <= Breakpoints.SM_MAX;\n }\n\n private isFileLimitExceeded(files: FileDto[]) {\n if (!this.fileLimit) {\n return false;\n }\n return this.files.length + files.length > this.fileLimit;\n }\n\n private isFileCombinedSizeExceeded(files: File[]): boolean {\n if (!this.maxCombinedFileSize) {\n return false;\n }\n\n const filesList = [...files, ...this.files];\n\n const combinedSize = filesList.reduce((combinedSize, file) => combinedSize + file.size, 0);\n\n return combinedSize > this.maxCombinedFileSize;\n }\n\n private isFileSizeExceeded(file: File): boolean {\n if (!this.maxFileSize) {\n return false;\n }\n return file.size > this.maxFileSize;\n }\n\n private isUnsupportedFileExtension(file: File) {\n if (this.supportedExtensions?.length) {\n const extension = file.name.split('.').pop()?.toLowerCase() ?? '';\n\n return !this.supportedExtensions.includes(extension);\n }\n return false;\n }\n\n private clearFileInput() {\n if (isNullOrUndefined(this.inputUpload?.nativeElement)) return;\n\n this.inputUpload.nativeElement.value = null;\n }\n\n private getUploadDate(blobFile: FileDto[]): void {\n if (!blobFile) {\n return;\n }\n\n this.fileUploadService\n .getMetadataCustomField({ objectId: blobFile[0].objectId ?? '' })\n .then((metadata) => this.setModifiedDate(metadata));\n }\n\n private setModifiedDate(metadata: ListBlobMetadataResponse): void {\n const hour = moment(metadata.modified).format('HH');\n const minutes = moment(metadata.modified).format('mm');\n const day = moment(metadata.modified).format('DD');\n const month = moment(metadata.modified).format('MM');\n const fullYear = moment(metadata.modified).format('YYYY');\n\n this.modifiedDate = this.translate.instant('platform.angular_components.date_modified_custom_blob', {\n hour,\n minutes,\n day,\n month,\n fullYear,\n });\n }\n}\n\n","<div\n [id]=\"id\"\n class=\"s-fileupload\"\n>\n <div class=\"s-fileupload-choose\">\n <input\n #inputUpload\n [id]=\"id + 'input-upload'\"\n type=\"file\"\n name=\"file\"\n [accept]=\"accept\"\n [multiple]=\"multiple\"\n (change)=\"_onInputFileSelect($event)\"\n />\n <s-button\n *ngIf=\"permissions.includes(ADD_PERMISSION)\"\n [id]=\"id + 'upload-button'\"\n [label]=\"chooseLabel || 'platform.angular_components.attach_files' | translate\"\n (clicked)=\"inputUpload.click()\"\n priority=\"primary\"\n [disabled]=\"disabled || !!formGroup?.disabled || fileLimit === files.length\"\n [auxiliary]=\"false\"\n >\n </s-button>\n </div>\n\n <section\n *ngIf=\"files.length\"\n [id]=\"id + 'fileupload-list'\"\n class=\"s-fileupload-list\"\n role=\"grid\"\n >\n <ng-container *ngFor=\"let file of files; let i = index\">\n <div\n class=\"s-fileupload-list-file\"\n role=\"row\"\n >\n <div\n [id]=\"id + '-file-' + i + '-name'\"\n class=\"flex flex-grow items-center justify-between overflow-hidden text-ellipsis text-nowrap\"\n role=\"gridcell\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (permissions.includes(READ_PERMISSION) && file.savedFile) || file.progress === 100\n ? descriptionUrl\n : description;\n context: {\n $implicit: file,\n index: i,\n }\n \"\n >\n </ng-container>\n\n <span>{{ formatFileSize(file.size) }}</span>\n\n <span\n *ngIf=\"modifiedDate\"\n class=\"s-fileupload-list-file-name-date\"\n >{{ modifiedDate }}</span\n >\n </div>\n <div\n class=\"s-fileupload-list-file-status\"\n role=\"gridcell\"\n >\n <p-progressBar\n *ngIf=\"file.isUploading && !isSmallDevice\"\n [style]=\"{\n width: '250px',\n 'background-color': '#d8d8d8',\n 'border-radius': '0px',\n height: '14px',\n }\"\n [value]=\"file.progress\"\n [showValue]=\"false\"\n role=\"alert\"\n [attr.aria-label]=\"ariaLabelProgress || 'platform.angular_components.loading_file' | translate\"\n >\n </p-progressBar>\n <span\n *ngIf=\"file.isUploading && isSmallDevice\"\n [id]=\"id + '-file-' + i + '-spin'\"\n class=\"fas fa-circle-notch fa-spin\"\n [attr.aria-label]=\"ariaLabelProgress || 'platform.angular_components.loading_file' | translate\"\n >\n </span>\n\n <span\n *ngIf=\"!file.isUploading && !file.error && file.progress === 100\"\n [id]=\"id + '-file-' + i + '-check'\"\n class=\"fas fa-check\"\n role=\"alert\"\n [attr.aria-label]=\"\n ariaLabelSuccess ||\n successTooltip ||\n 'platform.angular_components.file_attached_successfully' | translate\n \"\n [pTooltip]=\"\n successTooltip || 'platform.angular_components.file_attached_successfully' | translate\n \"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [appendTo]=\"'body'\"\n >\n </span>\n <span\n *ngIf=\"file.error?.message\"\n [id]=\"id + '-file-' + i + '-error'\"\n class=\"fas fa-times\"\n role=\"alert\"\n [pTooltip]=\"file.error?.message\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [appendTo]=\"'body'\"\n >\n </span>\n </div>\n <div\n class=\"s-fileupload-list-file-actions\"\n role=\"gridcell\"\n >\n <a\n *ngIf=\"file.isUploading\"\n [id]=\"id + '-file-' + i + '-cancel'\"\n class=\"s-fileupload-list-file-actions-action\"\n (click)=\"onCancelUpload(i)\"\n >\n {{ cancelLabel || 'platform.angular_components.cancel' | translate }}\n </a>\n <a\n *ngIf=\"\n permissions.includes(REMOVE_PERMISSION) &&\n !file.isUploading &&\n !(disabled || !!formGroup?.disabled)\n \"\n role=\"button\"\n tabindex=\"0\"\n [id]=\"id + '-file-' + i + '-remove'\"\n class=\"s-fileupload-list-file-actions-action\"\n (click)=\"onRemoveFile(file)\"\n [attr.aria-label]=\"\n ariaLabelRemove || removeLabel || 'platform.angular_components.remove' | translate\n \"\n >\n {{ removeLabel || 'platform.angular_components.remove' | translate }}\n </a>\n </div>\n </div>\n </ng-container>\n </section>\n</div>\n\n<ng-template\n #descriptionUrl\n let-file\n let-i=\"index\"\n>\n <div class=\"flex justify-between\">\n <div>\n <a\n [id]=\"id + '-file-' + i + '-name-link'\"\n tabindex=\"0\"\n (click)=\"onDowloadFile(i)\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\"\n class=\"break-words\"\n >{{ file.name }}\n </a>\n <a\n style=\"display: none\"\n [href]=\"file.objectURL\"\n target=\"_blank\"\n download\n #anchor\n >\n </a>\n </div>\n </div>\n</ng-template>\n\n<ng-template\n #description\n let-file\n>\n <div class=\"flex justify-between\">\n <span\n tabindex=\"0\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\"\n >\n {{ file.name }}\n </span>\n </div>\n</ng-template>\n\n","import { CommonModule } from \"@angular/common\";\nimport { NgModule } from \"@angular/core\";\n\nimport { TranslateModule } from \"@ngx-translate/core\";\nimport { ProgressBarModule } from \"primeng/progressbar\";\nimport { TooltipModule } from \"primeng/tooltip\";\n\nimport { FileUploadService } from \"./file-upload.service\";\nimport { FileUploadComponent } from \"./file-upload.component\";\nimport { ButtonModule } from \"@seniorsistemas/angular-components/button\";\nimport { LocaleModule } from \"@seniorsistemas/angular-components/locale\";\n\n@NgModule({\n declarations: [FileUploadComponent],\n imports: [\n CommonModule,\n ButtonModule,\n TooltipModule,\n ProgressBarModule,\n TranslateModule,\n LocaleModule,\n ],\n providers: [FileUploadService],\n exports: [FileUploadComponent],\n})\nexport class FileUploadModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i2.FileUploadService"],"mappings":";;;;;;;;;;;;;;;;;;;AAEO,MAAM,eAAe,GAA4B,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC;;MCGpE,iBAAiB,CAAA;IAClB,4BAA4B,GAAG,8BAA8B,CAAC;AAC9D,IAAA,KAAK,GAAG,IAAI,eAAe,EAAE,CAAC;IAE/B,MAAM,sBAAsB,CAA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AgB,EAAA,YAAA,EAAA,CAZV,mBAAmB,CAAA,EAAA,OAAA,EAAA,CAE9B,YAAY;YACZ,YAAY;YACZ,aAAa;YACb,iBAAiB;YACjB,eAAe;AACf,YAAA,YAAY,aAGN,mBAAmB,CAAA,EAAA,CAAA,CAAA;AAEpB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,EAHd,SAAA,EAAA,CAAC,iBAAiB,CAAC,YAP1B,YAAY;YACZ,YAAY;YACZ,aAAa;YACb,iBAAiB;YACjB,eAAe;YACf,YAAY,CAAA,EAAA,CAAA,CAAA;;4FAKP,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAb5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,YAAY,EAAE,CAAC,mBAAmB,CAAC;AACnC,oBAAA,OAAO,EAAE;wBACL,YAAY;wBACZ,YAAY;wBACZ,aAAa;wBACb,iBAAiB;wBACjB,eAAe;wBACf,YAAY;AACf,qBAAA;oBACD,SAAS,EAAE,CAAC,iBAAiB,CAAC;oBAC9B,OAAO,EAAE,CAAC,mBAAmB,CAAC;AACjC,iBAAA,CAAA;;;ACxBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"seniorsistemas-angular-components-file-upload.mjs","sources":["../../projects/angular-components/file-upload/src/lib/file-upload/models/file-upload-permissions.ts","../../projects/angular-components/file-upload/src/lib/file-upload/file-upload.service.ts","../../projects/angular-components/file-upload/src/lib/file-upload/file-upload.component.ts","../../projects/angular-components/file-upload/src/lib/file-upload/file-upload.component.html","../../projects/angular-components/file-upload/src/lib/file-upload/file-upload.module.ts","../../projects/angular-components/file-upload/src/seniorsistemas-angular-components-file-upload.ts"],"sourcesContent":["export type FileUploadPermissions = 'add' | 'read' | 'remove';\n\nexport const ALL_PERMISSIONS: FileUploadPermissions[] = ['add', 'read', 'remove'];\n","import { Injectable } from '@angular/core';\nimport { ListBlobMetadataRequest, ListBlobMetadataResponse } from './models/list-blob-metadata';\nimport { CustomHttpClient } from '@seniorsistemas/angular-components/common';\n\n@Injectable()\nexport class FileUploadService {\n private BASE_URL_FIELD_CUSTOMIZATION = 'platform/field_customization';\n private TOKEN = new AbortController();\n\n public async getMetadataCustomField<T>(request: ListBlobMetadataRequest): Promise<ListBlobMetadataResponse> {\n return CustomHttpClient.post(`${this.BASE_URL_FIELD_CUSTOMIZATION}/queries/getFileMetadata`, request, {\n signal: this.TOKEN.signal,\n });\n }\n}\n","import {\n AfterContentInit,\n Component,\n ElementRef,\n EventEmitter,\n HostListener,\n Input,\n OnDestroy,\n OnInit,\n Output,\n ViewChild,\n} from '@angular/core';\nimport { FormControl } from '@angular/forms';\nimport { DomSanitizer } from '@angular/platform-browser';\n\nimport { TranslateService } from '@ngx-translate/core';\nimport { Subject } from 'rxjs';\nimport moment from 'moment';\nimport { FileUploadService } from './file-upload.service';\nimport { ListBlobMetadataResponse } from './models/list-blob-metadata';\nimport { FileDto } from './models/file-dto';\nimport { UploadError } from './models/uploadError';\nimport { FileUploadPermissions, ALL_PERMISSIONS } from './models/file-upload-permissions';\nimport { Breakpoints, isNullOrUndefined } from '@seniorsistemas/angular-components/utils';\n\n@Component({\n selector: 's-file-upload',\n templateUrl: './file-upload.component.html',\n styleUrls: ['./file-upload.component.scss'],\n})\nexport class FileUploadComponent implements OnInit, OnDestroy, AfterContentInit {\n public static nextId = 0;\n\n public ADD_PERMISSION: FileUploadPermissions = 'add';\n public READ_PERMISSION: FileUploadPermissions = 'read';\n public REMOVE_PERMISSION: FileUploadPermissions = 'remove';\n\n @ViewChild('inputUpload', { static: false })\n private readonly inputUpload: ElementRef | null = null;\n\n @ViewChild('anchor', { static: false })\n private readonly anchor: ElementRef | null = null;\n\n @Input()\n public id = `s-file-upload-${FileUploadComponent.nextId++}`;\n\n @Input()\n public chooseLabel?: string;\n\n @Input()\n public removeLabel?: string;\n\n @Input()\n public cancelLabel?: string;\n\n @Input()\n public successTooltip?: string;\n\n @Input()\n public multiple?: boolean;\n\n @Input()\n public accept?: string;\n\n @Input()\n public supportedExtensions: string[] = [];\n\n @Input()\n public ariaLabelFileName?: string;\n\n @Input()\n public maxFileSize?: number;\n\n @Input()\n public maxCombinedFileSize?: number;\n\n @Input()\n public fileLimit?: number;\n\n @Input()\n public ariaLabelProgress?: string;\n\n @Input()\n public ariaLabelSuccess?: string;\n\n @Input()\n public ariaLabelError?: string;\n\n @Input()\n public ariaLabelRemove?: string;\n\n @Input()\n public formGroup?: FormControl;\n\n @Input()\n public disabled = false;\n\n @Input()\n public showFileUploadDate: boolean = false;\n\n @Input()\n public permissions: FileUploadPermissions[] = ALL_PERMISSIONS;\n\n @Input()\n public set files(files: FileDto[]) {\n if (this.showFileUploadDate && files[0]?.objectId) {\n this.getUploadDate(files);\n }\n this._files = files.map((file) => {\n file.objectURL = this.sanitizer.bypassSecurityTrustUrl(window.URL.createObjectURL(file));\n return file;\n });\n }\n\n @Output()\n public uploadHandler: EventEmitter<{ files: FileDto[] }> = new EventEmitter();\n\n @Output()\n public removeFile: EventEmitter<{ file: File }> = new EventEmitter();\n\n @Output()\n public cancelUpload: EventEmitter<number> = new EventEmitter();\n\n @Output()\n public downloadFile: EventEmitter<{ index: number; anchor: ElementRef }> = new EventEmitter();\n\n @Output()\n public validateErrors: EventEmitter<UploadError> = new EventEmitter();\n\n private _files: FileDto[] = [];\n private readonly ngUsubscribe: Subject<void> = new Subject();\n public isSmallDevice = false;\n public inputValue = '';\n public modifiedDate?: string;\n\n constructor(\n private readonly sanitizer: DomSanitizer,\n private readonly fileUploadService: FileUploadService,\n private readonly translate: TranslateService,\n ) {}\n\n public ngOnInit(): void {\n this.supportedExtensions = this.supportedExtensions.map((extension) =>\n extension.replace('.', '').toLowerCase(),\n );\n }\n\n public ngOnDestroy() {\n this.ngUsubscribe.next();\n this.ngUsubscribe.complete();\n }\n\n public ngAfterContentInit() {\n this.update();\n }\n\n @HostListener('window:resize')\n public onResize() {\n this.update();\n }\n\n public _onInputFileSelect($event: Event): void {\n const eventTargetFiles = ($event.target as HTMLInputElement)?.files as FileList;\n const dataTransferFiles = ($event as DragEvent).dataTransfer?.files as FileList;\n const files: FileDto[] = Array.from(dataTransferFiles ? dataTransferFiles : eventTargetFiles);\n this.onFileSelect(files);\n }\n\n public onFileSelect(files: FileDto[]): void {\n const newFiles: FileDto[] = [];\n\n if (!this.multiple) {\n this.files = [];\n }\n\n if (this.isFileLimitExceeded(files)) {\n this.validateErrors.emit({\n files,\n validation: 'maxFileLimit',\n });\n this.clearFileInput();\n return;\n }\n\n if (this.isFileCombinedSizeExceeded(files)) {\n this.validateErrors.emit({\n files: files,\n validation: 'maxCombinedFileSize',\n });\n this.clearFileInput();\n return;\n }\n\n for (const file of files) {\n if (this.isUnsupportedFileExtension(file)) {\n this.validateErrors.emit({\n files: [file],\n validation: 'unsupportedExtension',\n });\n continue;\n }\n\n if (this.isFileSizeExceeded(file)) {\n this.validateErrors.emit({\n files: [file],\n validation: 'maxFileSize',\n });\n continue;\n }\n\n newFiles.push(file);\n }\n\n if (newFiles.length) {\n this.files = this.files.concat(newFiles);\n this.uploadHandler.emit({\n files: newFiles,\n });\n }\n\n this.clearFileInput();\n }\n\n public onRemoveFile(file: FileDto): void {\n const fileIndex = this.files.indexOf(file);\n const removedFiles = this.files.splice(fileIndex, 1);\n\n if (removedFiles.length) {\n this.removeFile.emit({ file });\n }\n }\n\n public onCancelUpload(index: number) {\n const removedFiles = this.files.splice(index, 1);\n\n if (removedFiles.length) {\n this.cancelUpload.emit(index);\n }\n\n this.clearFileInput();\n }\n\n public onDowloadFile(index: number) {\n if (isNullOrUndefined(this.anchor)) return;\n\n this.downloadFile.emit({\n index,\n anchor: this.anchor,\n });\n }\n\n public get files(): FileDto[] {\n return this._files;\n }\n\n public formatFileSize(size: number): string {\n if (size === 0) {\n return '0 Bytes';\n }\n const k = 1024;\n const sizes = ['bytes', 'KB', 'MB', 'GB', 'TB'];\n const i = Math.floor(Math.log(size) / Math.log(k));\n return parseFloat((size / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];\n }\n\n private update() {\n const windowWidth = window.innerWidth;\n this.isSmallDevice = windowWidth <= Breakpoints.SM_MAX;\n }\n\n private isFileLimitExceeded(files: FileDto[]) {\n if (!this.fileLimit) {\n return false;\n }\n return this.files.length + files.length > this.fileLimit;\n }\n\n private isFileCombinedSizeExceeded(files: File[]): boolean {\n if (!this.maxCombinedFileSize) {\n return false;\n }\n\n const filesList = [...files, ...this.files];\n\n const combinedSize = filesList.reduce((combinedSize, file) => combinedSize + file.size, 0);\n\n return combinedSize > this.maxCombinedFileSize;\n }\n\n private isFileSizeExceeded(file: File): boolean {\n if (!this.maxFileSize) {\n return false;\n }\n return file.size > this.maxFileSize;\n }\n\n private isUnsupportedFileExtension(file: File) {\n if (this.supportedExtensions?.length) {\n const extension = file.name.split('.').pop()?.toLowerCase() ?? '';\n\n return !this.supportedExtensions.includes(extension);\n }\n return false;\n }\n\n private clearFileInput() {\n if (isNullOrUndefined(this.inputUpload?.nativeElement)) return;\n\n this.inputUpload.nativeElement.value = null;\n }\n\n private getUploadDate(blobFile: FileDto[]): void {\n if (!blobFile) {\n return;\n }\n\n this.fileUploadService\n .getMetadataCustomField({ objectId: blobFile[0].objectId ?? '' })\n .then((metadata) => this.setModifiedDate(metadata));\n }\n\n private setModifiedDate(metadata: ListBlobMetadataResponse): void {\n const hour = moment(metadata.modified).format('HH');\n const minutes = moment(metadata.modified).format('mm');\n const day = moment(metadata.modified).format('DD');\n const month = moment(metadata.modified).format('MM');\n const fullYear = moment(metadata.modified).format('YYYY');\n\n this.modifiedDate = this.translate.instant('platform.angular_components.date_modified_custom_blob', {\n hour,\n minutes,\n day,\n month,\n fullYear,\n });\n }\n}\n\n","<div\n [id]=\"id\"\n class=\"s-fileupload\"\n>\n <div class=\"s-fileupload-choose\">\n <input\n #inputUpload\n [id]=\"id + 'input-upload'\"\n type=\"file\"\n name=\"file\"\n [accept]=\"accept\"\n [multiple]=\"multiple\"\n (change)=\"_onInputFileSelect($event)\"\n />\n @if (permissions.includes(ADD_PERMISSION)) {\n <s-button\n [id]=\"id + 'upload-button'\"\n [label]=\"chooseLabel || 'platform.angular_components.attach_files' | translate\"\n (clicked)=\"inputUpload.click()\"\n priority=\"primary\"\n [disabled]=\"disabled || !!formGroup?.disabled || fileLimit === files.length\"\n [auxiliary]=\"false\"\n >\n </s-button>\n }\n </div>\n\n @if (files.length) {\n <section\n [id]=\"id + 'fileupload-list'\"\n class=\"s-fileupload-list\"\n role=\"grid\"\n >\n @for (file of files; track file; let i = $index) {\n <div\n class=\"s-fileupload-list-file\"\n role=\"row\"\n >\n <div\n [id]=\"id + '-file-' + i + '-name'\"\n class=\"flex flex-grow items-center justify-between overflow-hidden text-ellipsis text-nowrap\"\n role=\"gridcell\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (permissions.includes(READ_PERMISSION) && file.savedFile) || file.progress === 100\n ? descriptionUrl\n : description;\n context: {\n $implicit: file,\n index: i,\n }\n \"\n >\n </ng-container>\n\n <span>{{ formatFileSize(file.size) }}</span>\n\n @if (modifiedDate) {\n <span class=\"s-fileupload-list-file-name-date\">{{ modifiedDate }}</span>\n }\n </div>\n <div\n class=\"s-fileupload-list-file-status\"\n role=\"gridcell\"\n >\n @if (file.isUploading && !isSmallDevice) {\n <div class=\"w-64\">\n <s-progressbar\n [value]=\"file.progress ?? 0\"\n [showValue]=\"false\"\n activeColor=\"blue\"\n ></s-progressbar>\n </div>\n }\n\n @if (file.isUploading && isSmallDevice) {\n <span\n [id]=\"id + '-file-' + i + '-spin'\"\n class=\"fas fa-circle-notch fa-spin\"\n [attr.aria-label]=\"\n ariaLabelProgress || 'platform.angular_components.loading_file' | translate\n \"\n >\n </span>\n }\n\n @if (!file.isUploading && !file.error && file.progress === 100) {\n <span\n [id]=\"id + '-file-' + i + '-check'\"\n class=\"fas fa-check\"\n role=\"alert\"\n [attr.aria-label]=\"\n ariaLabelSuccess ||\n successTooltip ||\n 'platform.angular_components.file_attached_successfully' | translate\n \"\n [pTooltip]=\"\n successTooltip || 'platform.angular_components.file_attached_successfully'\n | translate\n \"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [appendTo]=\"'body'\"\n >\n </span>\n }\n\n @if (file.error?.message) {\n <span\n [id]=\"id + '-file-' + i + '-error'\"\n class=\"fas fa-times\"\n role=\"alert\"\n [pTooltip]=\"file.error?.message\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [appendTo]=\"'body'\"\n >\n </span>\n }\n </div>\n <div\n class=\"s-fileupload-list-file-actions\"\n role=\"gridcell\"\n >\n @if (file.isUploading) {\n <a\n [id]=\"id + '-file-' + i + '-cancel'\"\n class=\"s-fileupload-list-file-actions-action\"\n (click)=\"onCancelUpload(i)\"\n >\n {{ cancelLabel || 'platform.angular_components.cancel' | translate }}\n </a>\n }\n\n @if (\n permissions.includes(REMOVE_PERMISSION) &&\n !file.isUploading &&\n !(disabled || !!formGroup?.disabled)\n ) {\n <a\n role=\"button\"\n tabindex=\"0\"\n [id]=\"id + '-file-' + i + '-remove'\"\n class=\"s-fileupload-list-file-actions-action\"\n (click)=\"onRemoveFile(file)\"\n [attr.aria-label]=\"\n ariaLabelRemove || removeLabel || 'platform.angular_components.remove' | translate\n \"\n >\n {{ removeLabel || 'platform.angular_components.remove' | translate }}\n </a>\n }\n </div>\n </div>\n }\n </section>\n }\n</div>\n\n<ng-template\n #descriptionUrl\n let-file\n let-i=\"index\"\n>\n <div class=\"flex justify-between\">\n <div>\n <a\n [id]=\"id + '-file-' + i + '-name-link'\"\n tabindex=\"0\"\n (click)=\"onDowloadFile(i)\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\"\n class=\"break-words\"\n >{{ file.name }}\n </a>\n <a\n style=\"display: none\"\n [href]=\"file.objectURL\"\n target=\"_blank\"\n download\n #anchor\n >\n </a>\n </div>\n </div>\n</ng-template>\n\n<ng-template\n #description\n let-file\n>\n <div class=\"flex justify-between\">\n <span\n tabindex=\"0\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\"\n >\n {{ file.name }}\n </span>\n </div>\n</ng-template>\n\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { TranslateModule } from '@ngx-translate/core';\nimport { ButtonModule } from '@seniorsistemas/angular-components/button';\nimport { LocaleModule } from '@seniorsistemas/angular-components/locale';\nimport { ProgressBarModule } from '@seniorsistemas/angular-components/progressbar';\nimport { TooltipModule } from 'primeng/tooltip';\n\nimport { FileUploadComponent } from './file-upload.component';\nimport { FileUploadService } from './file-upload.service';\n\n@NgModule({\n declarations: [FileUploadComponent],\n imports: [CommonModule, ButtonModule, TooltipModule, ProgressBarModule, TranslateModule, LocaleModule],\n providers: [FileUploadService],\n exports: [FileUploadComponent],\n})\nexport class FileUploadModule {}\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i2.FileUploadService"],"mappings":";;;;;;;;;;;;;;;;;;;AAEO,MAAM,eAAe,GAA4B,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC;;MCGpE,iBAAiB,CAAA;IAClB,4BAA4B,GAAG,8BAA8B,CAAC;AAC9D,IAAA,KAAK,GAAG,IAAI,eAAe,EAAE,CAAC;IAE/B,MAAM,sBAAsB,CAAI,OAAgC,EAAA;QACnE,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAA,EAAG,IAAI,CAAC,4BAA4B,CAAA,wBAAA,CAA0B,EAAE,OAAO,EAAE;AAClG,YAAA,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM;AAC5B,SAAA,CAAC,CAAC;KACN;wGARQ,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;4GAAjB,iBAAiB,EAAA,CAAA,CAAA;;4FAAjB,iBAAiB,EAA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AAA,CAAA;oBACN,YAAY,EAAE,CAAC,mBAAmB,CAAC;AACnC,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,eAAe,EAAE,YAAY,CAAC;oBACtG,SAAS,EAAE,CAAC,iBAAiB,CAAC;oBAC9B,OAAO,EAAE,CAAC,mBAAmB,CAAC;AACjC,iBAAA,CAAA;;;ACjBD;;AAEG;;;;"}
|
|
@@ -30,7 +30,7 @@ class SelectOptionComponent {
|
|
|
30
30
|
this.selected.emit();
|
|
31
31
|
}
|
|
32
32
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SelectOptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
33
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: SelectOptionComponent, isStandalone: true, selector: "s-select-option", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: true, transformFunction: null }, checkmark: { classPropertyName: "checkmark", publicName: "checkmark", isSignal: true, isRequired: true, transformFunction: null }, isGrouper: { classPropertyName: "isGrouper", publicName: "isGrouper", isSignal: true, isRequired: true, transformFunction: null }, isFocused: { classPropertyName: "isFocused", publicName: "isFocused", isSignal: true, isRequired: true, transformFunction: null }, isSelected: { classPropertyName: "isSelected", publicName: "isSelected", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { isSelected: "isSelectedChange", selected: "selected" }, ngImport: i0, template: "<li\n [attr.id]=\"id()\"\n class=\"flex select-none items-center gap-3 px-3 py-2\"\n [class.hover:bg-grayscale-10]=\"!isGrouper()\"\n [class.bg-grayscale-10]=\"!isGrouper() && isFocused()\"\n (click)=\"onClick()\"\n>\n @if (!isGrouper() && checkmark() && !multiple() && isSelected()) {\n <i class=\"far fa-check text-grayscale-60\"></i>\n }\n\n @if (!isGrouper() && multiple()) {\n <s-checkbox [checked]=\"isSelected()\"></s-checkbox>\n }\n <span\n class=\"text-grayscale-90\"\n [class.font-bold]=\"isGrouper()\"\n >\n {{ label() }}\n </span>\n</li>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: CheckboxComponent, selector: "s-checkbox", inputs: ["disabled", "checked", "indeterminate", "label"], outputs: ["disabledChange", "checkedChange"
|
|
33
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: SelectOptionComponent, isStandalone: true, selector: "s-select-option", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: true, transformFunction: null }, checkmark: { classPropertyName: "checkmark", publicName: "checkmark", isSignal: true, isRequired: true, transformFunction: null }, isGrouper: { classPropertyName: "isGrouper", publicName: "isGrouper", isSignal: true, isRequired: true, transformFunction: null }, isFocused: { classPropertyName: "isFocused", publicName: "isFocused", isSignal: true, isRequired: true, transformFunction: null }, isSelected: { classPropertyName: "isSelected", publicName: "isSelected", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { isSelected: "isSelectedChange", selected: "selected" }, ngImport: i0, template: "<li\n [attr.id]=\"id()\"\n class=\"flex select-none items-center gap-3 px-3 py-2\"\n [class.hover:bg-grayscale-10]=\"!isGrouper()\"\n [class.bg-grayscale-10]=\"!isGrouper() && isFocused()\"\n (click)=\"onClick()\"\n>\n @if (!isGrouper() && checkmark() && !multiple() && isSelected()) {\n <i class=\"far fa-check text-grayscale-60\"></i>\n }\n\n @if (!isGrouper() && multiple()) {\n <s-checkbox [checked]=\"isSelected()\"></s-checkbox>\n }\n <span\n class=\"text-grayscale-90\"\n [class.font-bold]=\"isGrouper()\"\n >\n {{ label() }}\n </span>\n</li>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: CheckboxComponent, selector: "s-checkbox", inputs: ["disabled", "checked", "indeterminate", "label"], outputs: ["disabledChange", "checkedChange"] }] });
|
|
34
34
|
}
|
|
35
35
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SelectOptionComponent, decorators: [{
|
|
36
36
|
type: Component,
|
|
@@ -601,7 +601,7 @@ class SelectComponent {
|
|
|
601
601
|
useExisting: forwardRef(() => SelectComponent),
|
|
602
602
|
multi: true,
|
|
603
603
|
},
|
|
604
|
-
], viewQueries: [{ propertyName: "_containerDiv", first: true, predicate: ["containerDiv"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n #containerDiv\n cdkOverlayOrigin\n #trigger=\"cdkOverlayOrigin\"\n class=\"select-container group flex h-[35px] w-full overflow-hidden rounded-[3px] border outline-1 outline-primary focus:outline\"\n [ngClass]=\"{\n 'pointer-events-none border-grayscale-20 bg-grayscale-5': disabled(),\n 'pointer-events-auto border-grayscale-30 bg-grayscale-0': !disabled(),\n }\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-expanded]=\"showOptions()\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-owns]=\"'dropdown-container-' + componentId\"\n [attr.aria-labelledby]=\"componentId + '-label'\"\n role=\"combobox\"\n (click)=\"onContainerDivClick()\"\n (keydown)=\"onKeyDown($event)\"\n tabindex=\"0\"\n>\n <span\n class=\"flex flex-grow select-none px-3 py-[7px]\"\n [ngClass]=\"{\n 'text-grayscale-90': !disabled() && !isClean(),\n 'text-grayscale-60': !disabled() && isClean(),\n 'text-grayscale-30': disabled(),\n }\"\n >\n {{ print() || placeholder() }}\n </span>\n\n @if (!disabled() && showClear() && !isClean()) {\n <button\n class=\"mx-3\"\n (click)=\"clear($event)\"\n >\n <i class=\"fas fa-times flex items-center\"></i>\n </button>\n }\n\n <div\n class=\"dropdown-container flex items-center border-l px-3 group-hover:bg-grayscale-10 group-focus:border-primary\"\n [ngClass]=\"{ 'border-grayscale-20': disabled(), 'border-grayscale-30': !disabled() }\"\n >\n <i\n class=\"fas\"\n [ngClass]=\"{\n 'text-grayscale-30': disabled(),\n 'text-grayscale-90': !disabled(),\n 'fa-caret-down': !showOptions(),\n 'fa-caret-up': showOptions(),\n }\"\n ></i>\n </div>\n</div>\n\n<ng-template\n #dropdownTemplate\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"showOptions()\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n (backdropClick)=\"showOptions.set(false)\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n (detach)=\"showOptions.set(false)\"\n>\n <div\n [id]=\"'dropdown-container-' + componentId\"\n class=\"dropdown-body-class z-[1000] rounded-[3px] bg-grayscale-0 py-1 shadow-md\"\n (click)=\"$event.stopPropagation()\"\n [style.width.px]=\"containerDiv.offsetWidth\"\n >\n @if (filter()) {\n <div class=\"flex w-full items-center gap-3 px-3 py-1.5\">\n @if (multiple()) {\n <s-checkbox\n #selectAllCheckbox\n [checked]=\"allSelected()\"\n [indeterminate]=\"selectAllIsIndeterminate()\"\n (checkedChange)=\"toggleSelectAll()\"\n ></s-checkbox>\n }\n\n <div class=\"relative flex h-[35px] grow\">\n <form\n class=\"flex grow\"\n [formGroup]=\"filterForm\"\n >\n <input\n class=\"w-full grow rounded-[3px] border border-grayscale-30 pl-2.5 pr-7 outline-1 outline-primary\"\n type=\"text\"\n formControlName=\"filter\"\n (click)=\"$event.stopPropagation()\"\n />\n </form>\n <i class=\"fas fa-search absolute right-2.5 top-2.5 text-grayscale-90\"></i>\n </div>\n <button (click)=\"clearFilter()\">\n <i class=\"fas fa-times flex items-center\"></i>\n </button>\n </div>\n }\n\n <!-- Virtual scroll -->\n @if (virtualScroll() && filteredOptions().length > 10) {\n <cdk-virtual-scroll-viewport\n [itemSize]=\"virtualScrollItemSize()\"\n class=\"h-52 overflow-auto\"\n >\n <ng-container *cdkVirtualFor=\"let option of filteredOptions(); trackBy: trackById\">\n <s-select-option\n [id]=\"option.id\"\n [label]=\"getOptionLabel(option.data)\"\n [multiple]=\"multiple()\"\n [checkmark]=\"checkmark()\"\n [isSelected]=\"isOptionSelected(option)\"\n (selected)=\"selectItem(option)\"\n [isGrouper]=\"option.grouper\"\n [isFocused]=\"option.data === focusedItem()\"\n ></s-select-option>\n </ng-container>\n </cdk-virtual-scroll-viewport>\n }\n\n <!-- Normal list -->\n @if (!virtualScroll() || filteredOptions().length <= 10) {\n <ul class=\"max-h-52 overflow-auto\">\n @for (option of filteredOptions(); track option.id) {\n <s-select-option\n [id]=\"option.id\"\n [label]=\"getOptionLabel(option.data)\"\n [multiple]=\"multiple()\"\n [checkmark]=\"checkmark()\"\n [isSelected]=\"isOptionSelected(option)\"\n (selected)=\"selectItem(option)\"\n [isGrouper]=\"option.grouper ?? false\"\n [isFocused]=\"option.data === focusedItem()\"\n ></s-select-option>\n }\n </ul>\n }\n\n @if (filteredOptions().length === 0) {\n <span class=\"m-3 text-grayscale-60\">{{\n emptyMessage() ?? 'platform.angular_components.no_records_found' | translate\n }}</span>\n }\n </div>\n</ng-template>\n", styles: [":host.ng-dirty.ng-invalid{.dropdown-container,.select-container{border-color:#c13018;outline:none}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i3.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i3.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i3.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "component", type: SelectOptionComponent, selector: "s-select-option", inputs: ["id", "label", "multiple", "checkmark", "isGrouper", "isFocused", "isSelected"], outputs: ["isSelectedChange", "selected"] }, { kind: "component", type: CheckboxComponent, selector: "s-checkbox", inputs: ["disabled", "checked", "indeterminate", "label"], outputs: ["disabledChange", "checkedChange"
|
|
604
|
+
], viewQueries: [{ propertyName: "_containerDiv", first: true, predicate: ["containerDiv"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n #containerDiv\n cdkOverlayOrigin\n #trigger=\"cdkOverlayOrigin\"\n class=\"select-container group flex h-[35px] w-full overflow-hidden rounded-[3px] border outline-1 outline-primary focus:outline\"\n [ngClass]=\"{\n 'pointer-events-none border-grayscale-20 bg-grayscale-5': disabled(),\n 'pointer-events-auto border-grayscale-30 bg-grayscale-0': !disabled(),\n }\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-expanded]=\"showOptions()\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-owns]=\"'dropdown-container-' + componentId\"\n [attr.aria-labelledby]=\"componentId + '-label'\"\n role=\"combobox\"\n (click)=\"onContainerDivClick()\"\n (keydown)=\"onKeyDown($event)\"\n tabindex=\"0\"\n>\n <span\n class=\"flex flex-grow select-none px-3 py-[7px]\"\n [ngClass]=\"{\n 'text-grayscale-90': !disabled() && !isClean(),\n 'text-grayscale-60': !disabled() && isClean(),\n 'text-grayscale-30': disabled(),\n }\"\n >\n {{ print() || placeholder() }}\n </span>\n\n @if (!disabled() && showClear() && !isClean()) {\n <button\n class=\"mx-3\"\n (click)=\"clear($event)\"\n >\n <i class=\"fas fa-times flex items-center\"></i>\n </button>\n }\n\n <div\n class=\"dropdown-container flex items-center border-l px-3 group-hover:bg-grayscale-10 group-focus:border-primary\"\n [ngClass]=\"{ 'border-grayscale-20': disabled(), 'border-grayscale-30': !disabled() }\"\n >\n <i\n class=\"fas\"\n [ngClass]=\"{\n 'text-grayscale-30': disabled(),\n 'text-grayscale-90': !disabled(),\n 'fa-caret-down': !showOptions(),\n 'fa-caret-up': showOptions(),\n }\"\n ></i>\n </div>\n</div>\n\n<ng-template\n #dropdownTemplate\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"showOptions()\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n (backdropClick)=\"showOptions.set(false)\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n (detach)=\"showOptions.set(false)\"\n>\n <div\n [id]=\"'dropdown-container-' + componentId\"\n class=\"dropdown-body-class z-[1000] rounded-[3px] bg-grayscale-0 py-1 shadow-md\"\n (click)=\"$event.stopPropagation()\"\n [style.width.px]=\"containerDiv.offsetWidth\"\n >\n @if (filter()) {\n <div class=\"flex w-full items-center gap-3 px-3 py-1.5\">\n @if (multiple()) {\n <s-checkbox\n #selectAllCheckbox\n [checked]=\"allSelected()\"\n [indeterminate]=\"selectAllIsIndeterminate()\"\n (checkedChange)=\"toggleSelectAll()\"\n ></s-checkbox>\n }\n\n <div class=\"relative flex h-[35px] grow\">\n <form\n class=\"flex grow\"\n [formGroup]=\"filterForm\"\n >\n <input\n class=\"w-full grow rounded-[3px] border border-grayscale-30 pl-2.5 pr-7 outline-1 outline-primary\"\n type=\"text\"\n formControlName=\"filter\"\n (click)=\"$event.stopPropagation()\"\n />\n </form>\n <i class=\"fas fa-search absolute right-2.5 top-2.5 text-grayscale-90\"></i>\n </div>\n <button (click)=\"clearFilter()\">\n <i class=\"fas fa-times flex items-center\"></i>\n </button>\n </div>\n }\n\n <!-- Virtual scroll -->\n @if (virtualScroll() && filteredOptions().length > 10) {\n <cdk-virtual-scroll-viewport\n [itemSize]=\"virtualScrollItemSize()\"\n class=\"h-52 overflow-auto\"\n >\n <ng-container *cdkVirtualFor=\"let option of filteredOptions(); trackBy: trackById\">\n <s-select-option\n [id]=\"option.id\"\n [label]=\"getOptionLabel(option.data)\"\n [multiple]=\"multiple()\"\n [checkmark]=\"checkmark()\"\n [isSelected]=\"isOptionSelected(option)\"\n (selected)=\"selectItem(option)\"\n [isGrouper]=\"option.grouper\"\n [isFocused]=\"option.data === focusedItem()\"\n ></s-select-option>\n </ng-container>\n </cdk-virtual-scroll-viewport>\n }\n\n <!-- Normal list -->\n @if (!virtualScroll() || filteredOptions().length <= 10) {\n <ul class=\"max-h-52 overflow-auto\">\n @for (option of filteredOptions(); track option.id) {\n <s-select-option\n [id]=\"option.id\"\n [label]=\"getOptionLabel(option.data)\"\n [multiple]=\"multiple()\"\n [checkmark]=\"checkmark()\"\n [isSelected]=\"isOptionSelected(option)\"\n (selected)=\"selectItem(option)\"\n [isGrouper]=\"option.grouper ?? false\"\n [isFocused]=\"option.data === focusedItem()\"\n ></s-select-option>\n }\n </ul>\n }\n\n @if (filteredOptions().length === 0) {\n <span class=\"m-3 text-grayscale-60\">{{\n emptyMessage() ?? 'platform.angular_components.no_records_found' | translate\n }}</span>\n }\n </div>\n</ng-template>\n", styles: [":host.ng-dirty.ng-invalid{.dropdown-container,.select-container{border-color:#c13018;outline:none}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i3.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i3.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i3.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "component", type: SelectOptionComponent, selector: "s-select-option", inputs: ["id", "label", "multiple", "checkmark", "isGrouper", "isFocused", "isSelected"], outputs: ["isSelectedChange", "selected"] }, { kind: "component", type: CheckboxComponent, selector: "s-checkbox", inputs: ["disabled", "checked", "indeterminate", "label"], outputs: ["disabledChange", "checkedChange"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i5.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i5.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }] });
|
|
605
605
|
}
|
|
606
606
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SelectComponent, decorators: [{
|
|
607
607
|
type: Component,
|