Editable input updates
This commit is contained in:
parent
89376a6554
commit
0bb0e4454f
@ -1,10 +1,10 @@
|
||||
<div *ngIf="!editing">
|
||||
<div *ngIf="showPreview && !editing">
|
||||
{{ value }}
|
||||
</div>
|
||||
|
||||
<form (submit)="saveValue()" *ngIf="editing">
|
||||
<div [class]="'red-input-group ' + class">
|
||||
<input [(ngModel)]="newValue" name="name" />
|
||||
<input [(ngModel)]="newValue" [placeholder]="placeholder" name="name" />
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
@ -1,18 +1,21 @@
|
||||
import { Component, EventEmitter, HostBinding, Input, Output } from '@angular/core';
|
||||
import { ChangeDetectionStrategy, Component, EventEmitter, HostBinding, Input, Output } from '@angular/core';
|
||||
import { Required } from '../../utils/decorators/required.decorator';
|
||||
import { CircleButtonType } from '../../buttons/circle-button/circle-button.type';
|
||||
|
||||
@Component({
|
||||
selector: 'iqser-editable-input',
|
||||
templateUrl: './editable-input.component.html',
|
||||
styleUrls: ['./editable-input.component.scss']
|
||||
styleUrls: ['./editable-input.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
export class EditableInputComponent {
|
||||
@Input() @Required() value!: string;
|
||||
@Input() editTooltip?: string;
|
||||
@Input() saveTooltip?: string;
|
||||
@Input() cancelTooltip?: string;
|
||||
@Input() placeholder?: string;
|
||||
@Input() class?: string;
|
||||
@Input() showPreview = true;
|
||||
@Input() buttonsType?: CircleButtonType;
|
||||
@Output() save = new EventEmitter<string>();
|
||||
newValue = '';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user