Skip to content
Snippets Groups Projects
Commit 5b844087 authored by rhenck's avatar rhenck
Browse files

[editor] Add SizeInputPanel parameter for disabled

parent e4736adb
No related branches found
No related tags found
No related merge requests found
Pipeline #60035 failed
......@@ -188,7 +188,6 @@ export const myCustomTooltipDefaults: MatTooltipDefaultOptions = {
GetAnchorIdsPipe,
GetStateVariablePipe,
ScrollPageIndexPipe,
SizeInputPanelComponent,
ComboButtonComponent,
DeleteReferenceDialogComponent,
VisibilityRuleEditorComponent,
......
......@@ -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 } {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment