translation-editor/lazy/manage-translation-cell-renderer/manage-translation-cell-renderer.component.ts
selector | c8y-manage-translation-cell-renderer |
standalone | true |
imports |
NgIf
C8yTranslatePipe
IconDirective
FormsModule
|
templateUrl | manage-translation-cell-renderer.component.html |
Properties |
Methods |
constructor(context: CellRendererContext, permissions: Permissions, grid: TranslationEditorComponent)
|
||||||||||||
Parameters :
|
cancel |
cancel()
|
Returns :
void
|
editCell |
editCell()
|
Returns :
void
|
ngOnInit |
ngOnInit()
|
Returns :
void
|
Async save |
save()
|
Returns :
Promise<void>
|
cellInput |
Type : ElementRef
|
Decorators :
@ViewChild('cellInput')
|
cellValue |
Type : string
|
Default value : ''
|
Public context |
Type : CellRendererContext
|
isCellEditable |
Default value : false
|
isCreateDisabled |
Default value : false
|
<div
class="text-truncate pointer d-flex"
title="{{ context.value }}"
data-cy="c8y-manage-translation-cell-renderer--edit"
(click)="!isCreateDisabled ? editCell() : ''"
*ngIf="!isCellEditable"
>
<span
class="text-truncate"
*ngIf="!isCellEditable && context.value !== ''"
>
{{ context.value }}
</span>
<span
class="text-truncate"
title="{{ 'Add translation' | translate }}"
*ngIf="!isCellEditable && context.value === ''"
>
<em class="text-muted">{{ 'Add translation' | translate }}</em>
</span>
<i
class="showOnHover text-primary m-l-4"
c8yIcon="pencil"
title="{{ 'Edit translation' | translate }}"
*ngIf="!isCreateDisabled"
></i>
</div>
<div
class="input-group input-group-sm"
*ngIf="isCellEditable && !isCreateDisabled"
>
<input
class="form-control"
placeholder="{{ 'Add translation' | translate }}"
type="text"
#cellInput
data-cy="c8y-manage-translation-cell-renderer--input"
[(ngModel)]="cellValue"
/>
<div class="input-group-btn">
<button
class="btn btn-clean"
title="{{ 'Cancel' | translate }}"
type="button"
(click)="cancel()"
data-cy="c8y-manage-translation-cell-renderer--cancel"
>
<i
class="text-danger"
c8yIcon="times"
></i>
</button>
<button
class="btn btn-clean"
title="{{ 'Save' | translate }}"
type="button"
(click)="save()"
data-cy="c8y-manage-translation-cell-renderer--save"
>
<i
class="text-primary"
c8yIcon="check"
></i>
</button>
</div>
</div>