2026-05-08 18:08:57 +03:30
|
|
|
<div class="h-full overflow-auto border border-surface-border cardShadow">
|
2026-05-04 20:02:10 +03:30
|
|
|
<div
|
|
|
|
|
[ngClass]="{
|
2026-05-10 17:55:30 +03:30
|
|
|
'px-4': hasCaption,
|
2026-05-04 20:02:10 +03:30
|
|
|
'pb-4': true,
|
|
|
|
|
}"
|
|
|
|
|
>
|
2026-05-10 17:55:30 +03:30
|
|
|
@if (hasCaption && captionBox) {
|
2026-05-04 20:02:10 +03:30
|
|
|
<div class="pt-4">
|
|
|
|
|
<ng-container [ngTemplateOutlet]="captionBox"></ng-container>
|
|
|
|
|
</div>
|
|
|
|
|
<hr />
|
|
|
|
|
}
|
2026-05-10 17:55:30 +03:30
|
|
|
<div class="grid grid-cols-1 gap-3" [ngClass]="{ 'pt-4': hasCaption }">
|
2026-05-04 20:02:10 +03:30
|
|
|
@for (item of items; track `gridView_${$index}`) {
|
2026-05-08 18:08:57 +03:30
|
|
|
<div class="card border border-surface-border bg-surface-0! mb-0! rounded-2xl p-4!">
|
2026-05-04 20:02:10 +03:30
|
|
|
<div class="listKeyValue">
|
|
|
|
|
@for (col of columns; track `gridView_${col.field.toString()}_${$index}`) {
|
|
|
|
|
@if (col.type !== "index") {
|
2026-05-06 22:01:20 +03:30
|
|
|
<app-key-value [label]="col.header" [variant]="col.variant">
|
2026-05-10 17:55:30 +03:30
|
|
|
<app-page-data-value [item]="item" [column]="col" (thumbnailClick)="openThumbnailModal($event)" />
|
2026-05-04 20:02:10 +03:30
|
|
|
</app-key-value>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
@if (showEdit || showDelete || showDetails) {
|
2026-05-08 18:08:57 +03:30
|
|
|
<hr class="my-2" />
|
|
|
|
|
<div class="flex justify-center gap-2 mt-4">
|
2026-05-04 20:02:10 +03:30
|
|
|
@if (showEdit) {
|
2026-05-08 18:08:57 +03:30
|
|
|
<p-button
|
|
|
|
|
icon="pi pi-pencil"
|
|
|
|
|
label="ویرایش"
|
|
|
|
|
size="small"
|
|
|
|
|
outlined
|
|
|
|
|
severity="secondary"
|
|
|
|
|
(click)="edit(item)"
|
|
|
|
|
>
|
|
|
|
|
</p-button>
|
2026-05-04 20:02:10 +03:30
|
|
|
}
|
|
|
|
|
@if (showDelete) {
|
2026-05-08 18:08:57 +03:30
|
|
|
<p-button icon="pi pi-trash" label="حذف" size="small" outlined severity="danger" (click)="remove(item)">
|
|
|
|
|
</p-button>
|
2026-05-04 20:02:10 +03:30
|
|
|
}
|
|
|
|
|
@if (showDetails) {
|
2026-05-08 18:08:57 +03:30
|
|
|
<p-button
|
|
|
|
|
icon="pi pi-eye"
|
|
|
|
|
label="مشاهده"
|
|
|
|
|
size="small"
|
|
|
|
|
outlined
|
|
|
|
|
severity="primary"
|
|
|
|
|
(click)="details(item)"
|
|
|
|
|
>
|
|
|
|
|
</p-button>
|
2026-05-04 20:02:10 +03:30
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
@if (loading) {
|
|
|
|
|
@for (i of [1, 2, 3, 4]; track `grid_view_loading${$index}`) {
|
|
|
|
|
<div class="w-full h-40">
|
|
|
|
|
<p-skeleton height="100%"></p-skeleton>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@if (showPaginator) {
|
|
|
|
|
<ng-container [ngTemplateOutlet]="paginator"> </ng-container>
|
|
|
|
|
}
|
|
|
|
|
@if (items.length === 0 && !loading) {
|
|
|
|
|
<ng-container [ngTemplateOutlet]="emptyMessageCard"></ng-container>
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|