diff --git a/projects/editor/src/app/app.module.ts b/projects/editor/src/app/app.module.ts index b09ef409586a6b3bdced7b2b57b570e4920ca210..6dafea30f7d281e19bc4a0542e82d749514f386f 100644 --- a/projects/editor/src/app/app.module.ts +++ b/projects/editor/src/app/app.module.ts @@ -40,8 +40,8 @@ import { StateVariableEditorComponent } from 'editor/src/app/components/dialogs/state-variables-dialog/state-variable-editor.component'; import { - ButtonActionParamStateVariableComponent -} from 'editor/src/app/components/properties-panel/model-properties-tab/input-groups/button-properties/button-action-param-state-variable.component'; + ActionParamStateVariableComponent +} from 'editor/src/app/components/properties-panel/model-properties-tab/input-groups/action-param-state-variable.component'; import { VisibilityRulesDialogComponent } from 'editor/src/app/components/dialogs/visibility-rules-dialog/visibility-rules-dialog.component'; @@ -199,7 +199,7 @@ import { StateVariablesDialogComponent, ShowStateVariablesButtonComponent, StateVariableEditorComponent, - ButtonActionParamStateVariableComponent, + ActionParamStateVariableComponent, GetStateVariableIdsPipe, VisibilityRulesDialogComponent, SanitizationDialogComponent, diff --git a/projects/editor/src/app/components/properties-panel/model-properties-tab/input-groups/action-param-state-variable.component.ts b/projects/editor/src/app/components/properties-panel/model-properties-tab/input-groups/action-param-state-variable.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..76fd79c851c7803ee224673e80ba32bd91b99787 --- /dev/null +++ b/projects/editor/src/app/components/properties-panel/model-properties-tab/input-groups/action-param-state-variable.component.ts @@ -0,0 +1,34 @@ +import { + Component, EventEmitter, Input, Output +} from '@angular/core'; +import { StateVariable } from 'common/models/state-variable'; + +@Component({ + selector: 'aspect-action-param-state-variable', + template: ` + <div class="fx-column-start-stretch"> + <mat-form-field> + <mat-label>{{'stateVariableId' | translate}}</mat-label> + <mat-select [(ngModel)]="stateVariable.id" + (ngModelChange)="stateVariableChange.emit(stateVariable)"> + <mat-option *ngFor="let id of stateVariableIds" + [value]="id"> + {{id}} + </mat-option> + </mat-select> + </mat-form-field> + + <mat-form-field> + <mat-label>{{'stateVariableValue' | translate}}</mat-label> + <input matInput + [(ngModel)]="stateVariable.value" + (ngModelChange)="stateVariableChange.emit(stateVariable)"> + </mat-form-field> + </div> + ` +}) +export class ActionParamStateVariableComponent { + @Input() stateVariable!: StateVariable; + @Input() stateVariableIds!: string[]; + @Output() stateVariableChange = new EventEmitter<StateVariable>(); +} diff --git a/projects/editor/src/app/components/properties-panel/model-properties-tab/input-groups/button-properties/button-action-param-state-variable.component.html b/projects/editor/src/app/components/properties-panel/model-properties-tab/input-groups/button-properties/button-action-param-state-variable.component.html deleted file mode 100644 index c92d6c2cb1d7f6a84f95d73882649e44ba7e2b5d..0000000000000000000000000000000000000000 --- a/projects/editor/src/app/components/properties-panel/model-properties-tab/input-groups/button-properties/button-action-param-state-variable.component.html +++ /dev/null @@ -1,20 +0,0 @@ -<div class="fx-column-start-stretch"> - <mat-form-field> - <mat-label>{{'stateVariableId' | translate}}</mat-label> - <mat-select [(ngModel)]="stateVariable.id" - (ngModelChange)="stateVariableChange.emit(stateVariable)"> - <mat-option *ngFor="let id of stateVariableIds" - [value]="id"> - {{id}} - </mat-option> - </mat-select> - </mat-form-field> - - <mat-form-field> - <mat-label>{{'stateVariableValue' | translate}}</mat-label> - <input matInput - [(ngModel)]="stateVariable.value" - (ngModelChange)="stateVariableChange.emit(stateVariable)"> - </mat-form-field> -</div> - diff --git a/projects/editor/src/app/components/properties-panel/model-properties-tab/input-groups/button-properties/button-action-param-state-variable.component.ts b/projects/editor/src/app/components/properties-panel/model-properties-tab/input-groups/button-properties/button-action-param-state-variable.component.ts deleted file mode 100644 index e755bd51ad496a3b05ab5e2fae8f6bb8fd6b0574..0000000000000000000000000000000000000000 --- a/projects/editor/src/app/components/properties-panel/model-properties-tab/input-groups/button-properties/button-action-param-state-variable.component.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { - Component, EventEmitter, Input, Output -} from '@angular/core'; -import { StateVariable } from 'common/models/state-variable'; - -@Component({ - selector: 'aspect-button-action-param-state-variable', - templateUrl: './button-action-param-state-variable.component.html' -}) -export class ButtonActionParamStateVariableComponent { - @Input() stateVariable!: StateVariable; - @Input() stateVariableIds!: string[]; - @Output() stateVariableChange = new EventEmitter<StateVariable>(); -} diff --git a/projects/editor/src/app/components/properties-panel/model-properties-tab/input-groups/button-properties/button-properties.component.ts b/projects/editor/src/app/components/properties-panel/model-properties-tab/input-groups/button-properties/button-properties.component.ts index 01b24cfec837049f5de7e029b5ffd8d51c7ce3af..8c170cff0aaddedbc51c986bc952cd145e7a9f96 100644 --- a/projects/editor/src/app/components/properties-panel/model-properties-tab/input-groups/button-properties/button-properties.component.ts +++ b/projects/editor/src/app/components/properties-panel/model-properties-tab/input-groups/button-properties/button-properties.component.ts @@ -108,14 +108,14 @@ import { SelectionService } from '../../../../../services/selection.service'; </mat-form-field> <ng-container *ngIf="combinedProperties.action === 'stateVariableChange'"> - <aspect-button-action-param-state-variable + <aspect-action-param-state-variable *ngIf="unitService.unit.stateVariables.length" [stateVariableIds]="unitService.unit.stateVariables | getStateVariableIds" [stateVariable]="combinedProperties.actionParam ? $any(combinedProperties.actionParam) : { id: unitService.unit.stateVariables[0].id, value: '' }" (stateVariableChange)="updateModel.emit({ property: 'actionParam', value: $event })"> - </aspect-button-action-param-state-variable> + </aspect-action-param-state-variable> <p *ngIf="!unitService.unit.stateVariables.length">{{'propertiesPanel.addStateVariables' | translate}}</p> </ng-container>