blob: ca1e3d7bf4db7365bb98fd770177d2ca2ef83c70 [file] [log] [blame]
<!-------------------------------------------------------------------------------
* Copyright (c) 2020 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
-------------------------------------------------------------------------------->
<div (click)="onClick()" *ngIf="!appEditable" class="editable-text">
{{!!appValue && appValue !== "" ? appValue : appPlaceholder}}
<mat-icon *ngIf="appType === 'input'" class="editable-text--icon">edit</mat-icon>
<mat-icon *ngIf="appType === 'select'" class="editable-text--icon">arrow_drop_down</mat-icon>
<mat-icon *ngIf="appType === 'date'" class="editable-text--icon">today</mat-icon>
</div>
<input #inputElement (focusout)="onFocusOut()" (input)="inputValue(inputElement.value)"
*ngIf="appType === 'input'" [class.hidden]="!appEditable"
value="{{appValue}}"/>
<app-date-control #dateElement (appValueChange)="inputValue($event)" *ngIf="appType === 'date'"
[appValue]="appValue" [class.hidden]="!appEditable"
class="openk-info"></app-date-control>
<app-select #selectElement (appValueChange)="inputValue($event)" *ngIf="appType === 'select'"
[appOptions]="appOptions | stringsToOptions" [appValue]="appValue"
[class.hidden]="!appEditable"></app-select>