diff --git a/projects/editor/src/app/app.module.ts b/projects/editor/src/app/app.module.ts index bc0a3a3a66243c8b897af2edbdace2de5b8af709..9d769ff9a0c3ef3f8a5310d3b8c58ab06cb08441 100644 --- a/projects/editor/src/app/app.module.ts +++ b/projects/editor/src/app/app.module.ts @@ -188,7 +188,6 @@ export const myCustomTooltipDefaults: MatTooltipDefaultOptions = { GetAnchorIdsPipe, GetStateVariablePipe, ScrollPageIndexPipe, - SizeInputPanelComponent, ComboButtonComponent, DeleteReferenceDialogComponent, VisibilityRuleEditorComponent, diff --git a/projects/editor/src/app/components/util/size-input-panel.component.ts b/projects/editor/src/app/components/util/size-input-panel.component.ts index 549d233911c360dc8df70d4fe036f8f402a845cd..6856db88e9f26b265f54054c9ef68d6401b68e54 100644 --- a/projects/editor/src/app/components/util/size-input-panel.component.ts +++ b/projects/editor/src/app/components/util/size-input-panel.component.ts @@ -2,19 +2,35 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; import { Measurement } from 'common/models/elements/element'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { FormsModule } from '@angular/forms'; +import { MatSelectModule } from '@angular/material/select'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgIf } from '@angular/common'; @Component({ selector: 'aspect-size-input-panel', + standalone: true, + imports: [ + NgIf, + MatFormFieldModule, + MatInputModule, + FormsModule, + MatSelectModule, + TranslateModule + ], template: ` <mat-form-field [style.width.%]="40"> <mat-label>{{label}}</mat-label> - <input matInput type="number" + <input matInput type="number" [disabled]="disabled" [(ngModel)]="value" (change)="valueUpdated.emit(getCombinedString())"> </mat-form-field> <mat-form-field [style.width.%]="60"> <mat-label>Einheit</mat-label> - <mat-select [(ngModel)]="unit" + <mat-select [disabled]="disabled" + [(ngModel)]="unit" (selectionChange)="valueUpdated.emit(getCombinedString())"> <mat-option *ngIf="allowedUnits.includes('fr')" value="fr">{{'section-menu.fraction' | translate }}</mat-option> @@ -34,6 +50,7 @@ export class SizeInputPanelComponent { @Input() value!: number; @Input() unit!: string; @Input() allowedUnits!: string[]; + @Input() disabled!: boolean; @Output() valueUpdated = new EventEmitter<Measurement>(); getCombinedString(): { value: number; unit: string } {