Browse Source

Merge pull request #13136 from vvlladd28/improvement/file-input/truncate

Add to file input truncate text with tooltip
pull/13138/head
Igor Kulikov 1 year ago
committed by GitHub
parent
commit
0286a74953
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 8
      ui-ngx/src/app/shared/components/file-input.component.html
  2. 4
      ui-ngx/src/app/shared/components/file-input.component.scss

8
ui-ngx/src/app/shared/components/file-input.component.html

@ -51,9 +51,9 @@
</div>
</ng-container>
<div class="tb-file-info-container">
<tb-error *ngIf="!fileName && required && requiredAsError" class="tb-file-name" error="{{ noFileText | translate }}"></tb-error>
<div *ngIf="!fileName && !requiredAsError" class="tb-file-name" translate>{{ noFileText }}</div>
<div *ngIf="fileName" class="tb-file-name" [title]="fileName">{{ fileName }}</div>
<div *ngIf="maxSizeByte && !disabled" class="tb-file-hint" translate [translateParams]="{ size: maxSizeByte | fileSize }">dashboard.maximum-upload-file-size</div>
<tb-error *ngIf="!fileName && required && requiredAsError" class="font-medium" error="{{ noFileText | translate }}"></tb-error>
<div *ngIf="!fileName && !requiredAsError" class="tb-file-name" tbTruncateWithTooltip translate>{{ noFileText }}</div>
<div *ngIf="fileName" class="tb-file-name" tbTruncateWithTooltip>{{ fileName }}</div>
<div *ngIf="maxSizeByte && !disabled" class="tb-file-hint" tbTruncateWithTooltip translate [translateParams]="{ size: maxSizeByte | fileSize }">dashboard.maximum-upload-file-size</div>
</div>
</div>

4
ui-ngx/src/app/shared/components/file-input.component.scss

@ -131,15 +131,11 @@ $previewSize: 100px !default;
.tb-file-name {
color: rgba(0, 0, 0, 0.54);
font-weight: 500;
overflow: hidden;
text-overflow: ellipsis;
}
.tb-file-hint {
color: rgba(0, 0, 0, 0.38);
font-weight: 400;
overflow: hidden;
text-overflow: ellipsis;
}
}

Loading…
Cancel
Save