@tilde-nlp/ngx-common 8.1.14 → 8.1.15

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.
@@ -3047,8 +3047,9 @@ class ExtensionDialogModule {
3047
3047
  const FILE_UPLOAD_ICON = `<svg width="23" height="22" viewBox="0 0 23 22" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M19.4999 15V19H3.49992V15H0.833252V19C0.833252 20.4666 2.03325 21.6666 3.49992 21.6666H19.4999C20.9666 21.6666 22.1666 20.4666 22.1666 19V15H19.4999ZM4.83325 6.99998L6.71325 8.87998L10.1666 5.43998V16.3333H12.8333V5.43998L16.2866 8.87998L18.1666 6.99998L11.4999 0.333313L4.83325 6.99998Z" fill="black"/></svg>`;
3048
3048
 
3049
3049
  const _c0$b = ["fileInput"];
3050
- const _c1$5 = ["*"];
3051
- const _c2$3 = a0 => ({ maxSize: a0 });
3050
+ const _c1$5 = ["*", [["", "customLimits", ""]]];
3051
+ const _c2$3 = ["*", "[customLimits]"];
3052
+ const _c3$1 = a0 => ({ maxSize: a0 });
3052
3053
  function FileUploadComponent_mat_progress_bar_1_Template(rf, ctx) { if (rf & 1) {
3053
3054
  i0.ɵɵelement(0, "mat-progress-bar", 7);
3054
3055
  } if (rf & 2) {
@@ -3096,12 +3097,12 @@ function FileUploadComponent_ng_template_3_span_9_Template(rf, ctx) { if (rf & 1
3096
3097
  i0.ɵɵpipe(1, "translate");
3097
3098
  } if (rf & 2) {
3098
3099
  const ctx_r1 = i0.ɵɵnextContext(2);
3099
- i0.ɵɵproperty("innerHTML", i0.ɵɵpipeBind2(1, 1, "FILE_UPLOAD.LIMITS_MB", i0.ɵɵpureFunction1(4, _c2$3, ctx_r1.maxSizeLabel)), i0.ɵɵsanitizeHtml);
3100
+ i0.ɵɵproperty("innerHTML", i0.ɵɵpipeBind2(1, 1, "FILE_UPLOAD.LIMITS_MB", i0.ɵɵpureFunction1(4, _c3$1, ctx_r1.maxSizeLabel)), i0.ɵɵsanitizeHtml);
3100
3101
  } }
3101
- function FileUploadComponent_ng_template_3_Conditional_11_Template(rf, ctx) { if (rf & 1) {
3102
+ function FileUploadComponent_ng_template_3_Conditional_12_Template(rf, ctx) { if (rf & 1) {
3102
3103
  const _r8 = i0.ɵɵgetCurrentView();
3103
3104
  i0.ɵɵelementStart(0, "a", 20);
3104
- i0.ɵɵlistener("click", function FileUploadComponent_ng_template_3_Conditional_11_Template_a_click_0_listener() { i0.ɵɵrestoreView(_r8); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.openSupportedFormatModal()); });
3105
+ i0.ɵɵlistener("click", function FileUploadComponent_ng_template_3_Conditional_12_Template_a_click_0_listener() { i0.ɵɵrestoreView(_r8); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.openSupportedFormatModal()); });
3105
3106
  i0.ɵɵtext(1);
3106
3107
  i0.ɵɵelementEnd();
3107
3108
  } if (rf & 2) {
@@ -3124,7 +3125,8 @@ function FileUploadComponent_ng_template_3_Template(rf, ctx) { if (rf & 1) {
3124
3125
  i0.ɵɵtemplate(8, FileUploadComponent_ng_template_3_span_8_Template, 2, 2, "span", 16)(9, FileUploadComponent_ng_template_3_span_9_Template, 2, 6, "span", 17);
3125
3126
  i0.ɵɵtext(10, ") ");
3126
3127
  i0.ɵɵelementEnd();
3127
- i0.ɵɵconditionalCreate(11, FileUploadComponent_ng_template_3_Conditional_11_Template, 2, 1, "a", 18);
3128
+ i0.ɵɵprojection(11, 1);
3129
+ i0.ɵɵconditionalCreate(12, FileUploadComponent_ng_template_3_Conditional_12_Template, 2, 1, "a", 18);
3128
3130
  i0.ɵɵelementEnd()();
3129
3131
  } if (rf & 2) {
3130
3132
  const ctx_r1 = i0.ɵɵnextContext();
@@ -3136,9 +3138,9 @@ function FileUploadComponent_ng_template_3_Template(rf, ctx) { if (rf & 1) {
3136
3138
  i0.ɵɵadvance(3);
3137
3139
  i0.ɵɵproperty("ngForOf", ctx_r1.accept);
3138
3140
  i0.ɵɵadvance();
3139
- i0.ɵɵproperty("ngIf", ctx_r1.maxSize);
3140
- i0.ɵɵadvance(2);
3141
- i0.ɵɵconditional(ctx_r1.accept.length > ctx_r1.minSupportedFormatCount ? 11 : -1);
3141
+ i0.ɵɵproperty("ngIf", ctx_r1.maxSize && !ctx_r1.hideDefaultLimitsLabel);
3142
+ i0.ɵɵadvance(3);
3143
+ i0.ɵɵconditional(ctx_r1.accept.length > ctx_r1.minSupportedFormatCount ? 12 : -1);
3142
3144
  } }
3143
3145
  class FileUploadComponent {
3144
3146
  set accept(val) {
@@ -3155,6 +3157,7 @@ class FileUploadComponent {
3155
3157
  this.useCompactUpload = true;
3156
3158
  this.multiple = false;
3157
3159
  this.minSupportedFormatCount = 9;
3160
+ this.hideDefaultLimitsLabel = false;
3158
3161
  this.#dialog = inject(MatDialog);
3159
3162
  this.#icon = inject(IconService);
3160
3163
  this.#icon.registerIcons({ FILE_UPLOAD_ICON });
@@ -3226,11 +3229,11 @@ class FileUploadComponent {
3226
3229
  } if (rf & 2) {
3227
3230
  let _t;
3228
3231
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.fileInput = _t.first);
3229
- } }, inputs: { accept: "accept", useCompactUpload: "useCompactUpload", maxSize: "maxSize", multiple: "multiple", filePreviewProgress: "filePreviewProgress", allowEmpty: "allowEmpty", disabled: "disabled", dragZoneLabel: "dragZoneLabel", uploadIconName: "uploadIconName", uploadButtonLabel: "uploadButtonLabel", openExtensionPopupLabel: "openExtensionPopupLabel", minSupportedFormatCount: "minSupportedFormatCount", extendedAcceptList: "extendedAcceptList" }, outputs: { fileChange: "fileChange", errorEvent: "errorEvent" }, standalone: false, ngContentSelectors: _c1$5, decls: 7, vars: 9, consts: [["regularUpload", ""], ["fileInput", ""], ["inputButton", ""], [1, "file-upload", 3, "ngClass.lt-sm"], ["color", "primary", "class", "tld-file-upload-progress", 3, "value", 4, "ngIf"], [4, "ngIf", "ngIfElse"], ["type", "file", "name", "files", 1, "native-file-input", 3, "change", "accept", "multiple", "disabled"], ["color", "primary", 1, "tld-file-upload-progress", 3, "value"], ["tldDragAndDrop", "", "mat-button", "", "type", "button", 1, "upload-button", "text-l", 3, "fileDropped", "click", "disabled"], [4, "ngIf"], ["tldDragAndDrop", "", 1, "upload-zone", 3, "fileDropped"], ["svgIcon", "file_upload_icon"], [1, "upload-zone-labels"], ["color", "accent", 1, "file-upload--btn", 3, "click"], ["fxHide.lt-sm", "", 1, "upload-label", 3, "innerHTML"], [1, "upload-zone-formats"], [4, "ngFor", "ngForOf"], [3, "innerHTML", 4, "ngIf"], [1, "supported-formats-btn"], [3, "innerHTML"], [1, "supported-formats-btn", 3, "click"]], template: function FileUploadComponent_Template(rf, ctx) { if (rf & 1) {
3232
+ } }, inputs: { accept: "accept", useCompactUpload: "useCompactUpload", maxSize: "maxSize", multiple: "multiple", filePreviewProgress: "filePreviewProgress", allowEmpty: "allowEmpty", disabled: "disabled", dragZoneLabel: "dragZoneLabel", uploadIconName: "uploadIconName", uploadButtonLabel: "uploadButtonLabel", openExtensionPopupLabel: "openExtensionPopupLabel", minSupportedFormatCount: "minSupportedFormatCount", hideDefaultLimitsLabel: "hideDefaultLimitsLabel", extendedAcceptList: "extendedAcceptList" }, outputs: { fileChange: "fileChange", errorEvent: "errorEvent" }, standalone: false, ngContentSelectors: _c2$3, decls: 7, vars: 9, consts: [["regularUpload", ""], ["fileInput", ""], ["inputButton", ""], [1, "file-upload", 3, "ngClass.lt-sm"], ["color", "primary", "class", "tld-file-upload-progress", 3, "value", 4, "ngIf"], [4, "ngIf", "ngIfElse"], ["type", "file", "name", "files", 1, "native-file-input", 3, "change", "accept", "multiple", "disabled"], ["color", "primary", 1, "tld-file-upload-progress", 3, "value"], ["tldDragAndDrop", "", "mat-button", "", "type", "button", 1, "upload-button", "text-l", 3, "fileDropped", "click", "disabled"], [4, "ngIf"], ["tldDragAndDrop", "", 1, "upload-zone", 3, "fileDropped"], ["svgIcon", "file_upload_icon"], [1, "upload-zone-labels"], ["color", "accent", 1, "file-upload--btn", 3, "click"], ["fxHide.lt-sm", "", 1, "upload-label", 3, "innerHTML"], [1, "upload-zone-formats"], [4, "ngFor", "ngForOf"], [3, "innerHTML", 4, "ngIf"], [1, "supported-formats-btn"], [3, "innerHTML"], [1, "supported-formats-btn", 3, "click"]], template: function FileUploadComponent_Template(rf, ctx) { if (rf & 1) {
3230
3233
  const _r1 = i0.ɵɵgetCurrentView();
3231
- i0.ɵɵprojectionDef();
3234
+ i0.ɵɵprojectionDef(_c1$5);
3232
3235
  i0.ɵɵelementStart(0, "div", 3);
3233
- i0.ɵɵtemplate(1, FileUploadComponent_mat_progress_bar_1_Template, 1, 1, "mat-progress-bar", 4)(2, FileUploadComponent_ng_container_2_Template, 5, 2, "ng-container", 5)(3, FileUploadComponent_ng_template_3_Template, 12, 7, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
3236
+ i0.ɵɵtemplate(1, FileUploadComponent_mat_progress_bar_1_Template, 1, 1, "mat-progress-bar", 4)(2, FileUploadComponent_ng_container_2_Template, 5, 2, "ng-container", 5)(3, FileUploadComponent_ng_template_3_Template, 13, 7, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
3234
3237
  i0.ɵɵelementStart(5, "input", 6, 1);
3235
3238
  i0.ɵɵlistener("change", function FileUploadComponent_Template_input_change_5_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.handleFileInput($event)); });
3236
3239
  i0.ɵɵelementEnd()();
@@ -3248,7 +3251,7 @@ class FileUploadComponent {
3248
3251
  }
3249
3252
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FileUploadComponent, [{
3250
3253
  type: Component,
3251
- args: [{ selector: 'lib-file-upload', standalone: false, template: "<div class=\"file-upload\" [ngClass.lt-sm]=\"'file-upload-mobile'\" [class.disabled]=\"disabled\">\r\n <mat-progress-bar \r\n *ngIf=\"filePreviewProgress\"\r\n color=\"primary\" \r\n class=\"tld-file-upload-progress\" \r\n [value]=\"filePreviewProgress\"\r\n >\r\n </mat-progress-bar>\r\n\r\n <ng-container *ngIf=\"useCompactUpload; else regularUpload\">\r\n <button tldDragAndDrop #inputButton mat-button (fileDropped)=\"onFileDrop($event)\" [disabled]=\"disabled\" type=\"button\"\r\n (click)=\"fileInput.click()\" class=\"upload-button text-l\"\r\n >\r\n <mat-icon *ngIf=\"uploadIconName\">{{uploadIconName}}</mat-icon>\r\n <ng-content></ng-content>\r\n </button>\r\n </ng-container>\r\n\r\n <ng-template #regularUpload>\r\n <div class=\"upload-zone\" tldDragAndDrop (fileDropped)=\"onFileDrop($event)\" [class.disabled-upload-zone]=\"disabled\">\r\n <mat-icon svgIcon=\"file_upload_icon\"></mat-icon>\r\n\r\n \r\n <div class=\"upload-zone-labels\">\r\n <a color=\"accent\" class=\"file-upload--btn\" (click)=\"fileInput.click()\">{{ uploadButtonLabel }}</a>\r\n \r\n <span fxHide.lt-sm class=\"upload-label\" [innerHTML]=\"dragZoneLabel\"></span>\r\n \r\n <p class=\"upload-zone-formats\">\r\n (<span *ngFor=\"let format of accept; let i = index\"\r\n >{{ format\r\n }}{{ accept.length - 1 === i ? \".\" : \", \" }}</span\r\n >\r\n\r\n <span *ngIf=\"maxSize\" [innerHTML]=\"'FILE_UPLOAD.LIMITS_MB' | translate: { maxSize: maxSizeLabel }\"></span>)\r\n </p>\r\n \r\n @if (accept.length > minSupportedFormatCount) {\r\n <a class=\"supported-formats-btn\" (click)=\"openSupportedFormatModal()\">{{openExtensionPopupLabel}}</a>\r\n }\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n<input \r\n #fileInput \r\n type=\"file\" \r\n name=\"files\" \r\n class=\"native-file-input\"\r\n [accept]=\"allowedExtensions\" \r\n [multiple]=\"multiple\" \r\n [disabled]=\"disabled\"\r\n (change)=\"handleFileInput($event)\" \r\n/>\r\n", styles: [":host{width:100%}.file-upload{display:flex;flex-direction:column;justify-content:center;text-align:center}.file-upload .upload-button,.file-upload .upload-zone{display:flex;border-radius:16px;border:1px dashed var(--base-65)}.file-upload .upload-button{justify-content:start;min-height:52px;overflow:hidden;padding:16px!important}.file-upload .upload-zone{flex-direction:column;justify-content:center;align-items:center;width:100%;padding:42px 0}.file-upload .upload-zone-labels{margin-top:10px;font-size:1rem;font-weight:600;line-height:24px;text-align:center}.file-upload .upload-zone-labels .upload-zone-formats{font-weight:400}.file-upload .supported-formats-btn{cursor:pointer;color:var(--accent);font-weight:400}.file-upload .disabled-upload-zone{cursor:not-allowed}.file-upload .file-upload--btn,.file-upload .upload-label:not(.file-upload-mobile){margin-top:10px}.file-upload .file-upload--btn{cursor:pointer;align-self:center;max-width:fit-content;color:var(--accent)}.file-upload .file-upload--btn:hover{text-decoration:underline}.file-upload .upload-zone-formats{margin:10px 0 4px;color:var(--base-40)}.disabled .file-upload--btn{pointer-events:none!important;text-decoration:none!important;color:var(--base-40)}.native-file-input{display:none}\n"] }]
3254
+ args: [{ selector: 'lib-file-upload', standalone: false, template: "<div class=\"file-upload\" [ngClass.lt-sm]=\"'file-upload-mobile'\" [class.disabled]=\"disabled\">\r\n <mat-progress-bar \r\n *ngIf=\"filePreviewProgress\"\r\n color=\"primary\" \r\n class=\"tld-file-upload-progress\" \r\n [value]=\"filePreviewProgress\"\r\n >\r\n </mat-progress-bar>\r\n\r\n <ng-container *ngIf=\"useCompactUpload; else regularUpload\">\r\n <button tldDragAndDrop #inputButton mat-button (fileDropped)=\"onFileDrop($event)\" [disabled]=\"disabled\" type=\"button\"\r\n (click)=\"fileInput.click()\" class=\"upload-button text-l\"\r\n >\r\n <mat-icon *ngIf=\"uploadIconName\">{{uploadIconName}}</mat-icon>\r\n <ng-content></ng-content>\r\n </button>\r\n </ng-container>\r\n\r\n <ng-template #regularUpload>\r\n <div class=\"upload-zone\" tldDragAndDrop (fileDropped)=\"onFileDrop($event)\" [class.disabled-upload-zone]=\"disabled\">\r\n <mat-icon svgIcon=\"file_upload_icon\"></mat-icon>\r\n\r\n \r\n <div class=\"upload-zone-labels\">\r\n <a color=\"accent\" class=\"file-upload--btn\" (click)=\"fileInput.click()\">{{ uploadButtonLabel }}</a>\r\n \r\n <span fxHide.lt-sm class=\"upload-label\" [innerHTML]=\"dragZoneLabel\"></span>\r\n \r\n <p class=\"upload-zone-formats\">\r\n (<span *ngFor=\"let format of accept; let i = index\"\r\n >{{ format\r\n }}{{ accept.length - 1 === i ? \".\" : \", \" }}</span\r\n >\r\n\r\n <span *ngIf=\"maxSize && !hideDefaultLimitsLabel\" [innerHTML]=\"'FILE_UPLOAD.LIMITS_MB' | translate: { maxSize: maxSizeLabel }\"></span>)\r\n </p>\r\n\r\n <ng-content select=\"[customLimits]\"></ng-content>\r\n \r\n @if (accept.length > minSupportedFormatCount) {\r\n <a class=\"supported-formats-btn\" (click)=\"openSupportedFormatModal()\">{{openExtensionPopupLabel}}</a>\r\n }\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n<input \r\n #fileInput \r\n type=\"file\" \r\n name=\"files\" \r\n class=\"native-file-input\"\r\n [accept]=\"allowedExtensions\" \r\n [multiple]=\"multiple\" \r\n [disabled]=\"disabled\"\r\n (change)=\"handleFileInput($event)\" \r\n/>\r\n", styles: [":host{width:100%}.file-upload{display:flex;flex-direction:column;justify-content:center;text-align:center}.file-upload .upload-button,.file-upload .upload-zone{display:flex;border-radius:16px;border:1px dashed var(--base-65)}.file-upload .upload-button{justify-content:start;min-height:52px;overflow:hidden;padding:16px!important}.file-upload .upload-zone{flex-direction:column;justify-content:center;align-items:center;width:100%;padding:42px 0}.file-upload .upload-zone-labels{margin-top:10px;font-size:1rem;font-weight:600;line-height:24px;text-align:center}.file-upload .upload-zone-labels .upload-zone-formats{font-weight:400}.file-upload .supported-formats-btn{cursor:pointer;color:var(--accent);font-weight:400}.file-upload .disabled-upload-zone{cursor:not-allowed}.file-upload .file-upload--btn,.file-upload .upload-label:not(.file-upload-mobile){margin-top:10px}.file-upload .file-upload--btn{cursor:pointer;align-self:center;max-width:fit-content;color:var(--accent)}.file-upload .file-upload--btn:hover{text-decoration:underline}.file-upload .upload-zone-formats{margin:10px 0 4px;color:var(--base-40)}.disabled .file-upload--btn{pointer-events:none!important;text-decoration:none!important;color:var(--base-40)}.native-file-input{display:none}\n"] }]
3252
3255
  }], () => [], { fileInput: [{
3253
3256
  type: ViewChild,
3254
3257
  args: ['fileInput']
@@ -3280,6 +3283,8 @@ class FileUploadComponent {
3280
3283
  type: Input
3281
3284
  }], minSupportedFormatCount: [{
3282
3285
  type: Input
3286
+ }], hideDefaultLimitsLabel: [{
3287
+ type: Input
3283
3288
  }], extendedAcceptList: [{
3284
3289
  type: Input
3285
3290
  }] }); })();