Files
psp_panel/src/app/shared/components/table-action-row.component.ts
T
2026-05-04 21:30:05 +03:30

28 lines
852 B
TypeScript

import { CommonModule } from '@angular/common';
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { Button } from 'primeng/button';
@Component({
selector: '[table-action-row]',
standalone: true,
imports: [CommonModule, Button],
templateUrl: './table-action-row.component.html',
})
export class TableActionRowComponent {
@Input() showEdit = false;
@Input() showDelete = false;
@Input() showDetails = false;
@Input() showDetailsText: string = 'جزییات';
@Output() edit = new EventEmitter<void>();
@Output() delete = new EventEmitter<void>();
@Output() details = new EventEmitter<void>();
get widthStyle(): string {
const count = [this.showEdit, this.showDelete, this.showDetails].filter(Boolean).length;
return `${count * 2.5 + count - 1 * 0.25}rem`;
}
widthClass: string = '';
}