Files
psp_panel/src/app/shared/components/table-action-row.component.ts
T

29 lines
904 B
TypeScript
Raw Normal View History

2025-12-04 21:07:18 +03:30
import { CommonModule } from '@angular/common';
2026-05-04 21:30:05 +03:30
import { Component, EventEmitter, Input, Output } from '@angular/core';
2025-12-04 21:07:18 +03:30
import { Button } from 'primeng/button';
import { Tooltip } from 'primeng/tooltip';
2025-12-04 21:07:18 +03:30
@Component({
selector: '[table-action-row]',
standalone: true,
imports: [CommonModule, Button, Tooltip],
2025-12-04 21:07:18 +03:30
templateUrl: './table-action-row.component.html',
})
export class TableActionRowComponent {
@Input() showEdit = false;
@Input() showDelete = false;
@Input() showDetails = false;
2026-05-04 21:30:05 +03:30
@Input() showDetailsText: string = 'جزییات';
2025-12-04 21:07:18 +03:30
@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 = '';
}