diff --git a/apps/red-ui/src/app/modules/dossier-overview/components/file-attribute/file-attribute.component.html b/apps/red-ui/src/app/modules/dossier-overview/components/file-attribute/file-attribute.component.html index f7609306c..1393e2e0f 100644 --- a/apps/red-ui/src/app/modules/dossier-overview/components/file-attribute/file-attribute.component.html +++ b/apps/red-ui/src/app/modules/dossier-overview/components/file-attribute/file-attribute.component.html @@ -9,7 +9,7 @@ @@ -56,13 +56,12 @@ class="edit-input" iqserStopPropagation > -
+ = 1800 ? 0.85 : 0.7; isInEditMode = false; closedDatepicker = true; @Input({ required: true }) fileAttribute!: IFileAttributeConfig; @@ -66,7 +65,10 @@ export class FileAttributeComponent extends BaseFormComponent implements OnDestr @Input({ required: true }) dossier!: Dossier; @Input() fileNameColumn = false; readonlyAttrs: string[] = []; - @Input() width?: number; + readonly width = input(); + readonly inputFormWidth = computed(() => (this.width() ? this.width() + 'px' : 'unset')); + readonly inputFieldWidth = computed(() => (this.width() ? this.width() - 50 + 'px' : 'unset')); + readonly attributeValueWidth = computed(() => (this.width() ? `${this.width() * 0.9}px` : 'unset')); constructor( router: Router, @@ -99,14 +101,6 @@ export class FileAttributeComponent extends BaseFormComponent implements OnDestr ); } - get editFieldWidth(): string { - return this.width ? `${this.width * this.#widthFactor}px` : 'unset'; - } - - get attributeValueWidth(): string { - return this.width ? `${this.width * 0.9}px` : 'unset'; - } - get isDate(): boolean { return this.fileAttribute.type === FileAttributeConfigTypes.DATE; } @@ -123,15 +117,6 @@ export class FileAttributeComponent extends BaseFormComponent implements OnDestr return this.file.fileAttributes.attributeIdToValue[this.fileAttribute.id]; } - @HostListener('window:resize') - onResize() { - if (window.innerWidth >= 1800) { - this.#widthFactor = 0.85; - } else { - this.#widthFactor = 0.7; - } - } - @Debounce(60) @HostListener('document:click', ['$event']) clickOutside($event: MouseEvent) {