change icon from tables
This commit is contained in:
@@ -17,11 +17,18 @@
|
|||||||
<td>{{ data.date | date: 'dd/MM/yyyy' }}</td>
|
<td>{{ data.date | date: 'dd/MM/yyyy' }}</td>
|
||||||
<td>{{ data.plannedReturningDate | date: 'dd/MM/yyyy'}}</td>
|
<td>{{ data.plannedReturningDate | date: 'dd/MM/yyyy'}}</td>
|
||||||
<td>{{ data.effectiveReturningDate | date: 'dd/MM/yyyy'}}</td>
|
<td>{{ data.effectiveReturningDate | date: 'dd/MM/yyyy'}}</td>
|
||||||
<td>
|
<td style="justify-content: center; display: flex">
|
||||||
<app-modal [name]="'Modifier'">
|
<div class="cursor-pointer">
|
||||||
<app-update-loan></app-update-loan>
|
<app-modal-icon icon="edit" [name]="'Modifier'">
|
||||||
</app-modal>
|
<app-update-loan></app-update-loan>
|
||||||
<button nz-button nzType="primary" (click)="delete()" class="bg-red-600 border-red-600">Supprimer</button>
|
</app-modal-icon>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<nz-divider nzType="vertical"></nz-divider>
|
||||||
|
|
||||||
|
<div (click)="delete()" class="text-red-600 cursor-pointer">
|
||||||
|
<nz-icon nzTheme="outline" nzType="delete"></nz-icon>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,21 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import {DatePipe} from "@angular/common";
|
import {DatePipe} from "@angular/common";
|
||||||
import {Modal} from "../modal/modal";
|
|
||||||
import {NzButtonComponent} from "ng-zorro-antd/button";
|
|
||||||
import {NzTableComponent} from "ng-zorro-antd/table";
|
import {NzTableComponent} from "ng-zorro-antd/table";
|
||||||
import {UpdateLoan} from "../update-loan/update-loan";
|
import {UpdateLoan} from "../update-loan/update-loan";
|
||||||
import {LoanInfo} from "../../interfaces/loan.interfaces";
|
import {LoanInfo} from "../../interfaces/loan.interfaces";
|
||||||
|
import {ModalIcon} from "../modal-icon/modal-icon";
|
||||||
|
import {NzDividerComponent} from "ng-zorro-antd/divider";
|
||||||
|
import {NzIconDirective} from "ng-zorro-antd/icon";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-loan-table',
|
selector: 'app-loan-table',
|
||||||
imports: [
|
imports: [
|
||||||
DatePipe,
|
DatePipe,
|
||||||
Modal,
|
|
||||||
NzButtonComponent,
|
|
||||||
NzTableComponent,
|
NzTableComponent,
|
||||||
UpdateLoan
|
UpdateLoan,
|
||||||
|
ModalIcon,
|
||||||
|
NzDividerComponent,
|
||||||
|
NzIconDirective
|
||||||
],
|
],
|
||||||
templateUrl: './loan-table.html',
|
templateUrl: './loan-table.html',
|
||||||
styleUrl: './loan-table.css',
|
styleUrl: './loan-table.css',
|
||||||
|
|||||||
0
src/app/components/modal-icon/modal-icon.css
Normal file
0
src/app/components/modal-icon/modal-icon.css
Normal file
18
src/app/components/modal-icon/modal-icon.html
Normal file
18
src/app/components/modal-icon/modal-icon.html
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<div (click)="showModal()">
|
||||||
|
<nz-icon [nzType]="icon()" nzTheme="outline"></nz-icon>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ng-template #modalContent>
|
||||||
|
<ng-content></ng-content>
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
|
<nz-modal
|
||||||
|
[(nzVisible)]="isVisible"
|
||||||
|
[nzTitle]="name()"
|
||||||
|
(nzOnCancel)="handleCancel()"
|
||||||
|
(nzOnOk)="handleOk()"
|
||||||
|
[nzOkLoading]="isOkLoading"
|
||||||
|
[nzContent]="modalContent"
|
||||||
|
>
|
||||||
|
</nz-modal>
|
||||||
|
|
||||||
35
src/app/components/modal-icon/modal-icon.ts
Normal file
35
src/app/components/modal-icon/modal-icon.ts
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
import {Component, input} from '@angular/core';
|
||||||
|
import {NzModalComponent} from "ng-zorro-antd/modal";
|
||||||
|
import {NzIconDirective} from "ng-zorro-antd/icon";
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-modal-icon',
|
||||||
|
imports: [
|
||||||
|
NzModalComponent,
|
||||||
|
NzIconDirective
|
||||||
|
],
|
||||||
|
templateUrl: './modal-icon.html',
|
||||||
|
styleUrl: './modal-icon.css',
|
||||||
|
})
|
||||||
|
export class ModalIcon {
|
||||||
|
icon = input.required<string>()
|
||||||
|
name = input.required<string>();
|
||||||
|
isVisible = false;
|
||||||
|
isOkLoading = false;
|
||||||
|
|
||||||
|
showModal(): void {
|
||||||
|
this.isVisible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
handleOk(): void {
|
||||||
|
this.isOkLoading = true;
|
||||||
|
setTimeout(() => {
|
||||||
|
this.isVisible = false;
|
||||||
|
this.isOkLoading = false;
|
||||||
|
}, 1000); // 1 secondes
|
||||||
|
}
|
||||||
|
|
||||||
|
handleCancel(): void {
|
||||||
|
this.isVisible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
<td>{{ data.birthDate | date: 'dd/MM/yyyy'}}</td>
|
<td>{{ data.birthDate | date: 'dd/MM/yyyy'}}</td>
|
||||||
<td>
|
<td>
|
||||||
<app-modal type="link" [name]="'Voir les emprunts'">
|
<app-modal type="link" [name]="'Voir les emprunts'">
|
||||||
<nz-table #basicTable [nzData]="listOfData">
|
<nz-table [nzData]="listOfData">
|
||||||
<thead>
|
<thead>
|
||||||
<tr style="text-align: center">
|
<tr style="text-align: center">
|
||||||
<th>Livre</th>
|
<th>Livre</th>
|
||||||
@@ -38,11 +38,18 @@
|
|||||||
</nz-table>
|
</nz-table>
|
||||||
</app-modal>
|
</app-modal>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td style="justify-content: center; display: flex">
|
||||||
<app-modal [name]="'Modifier'">
|
<div class="cursor-pointer">
|
||||||
<app-update-user></app-update-user>
|
<app-modal-icon icon="edit" [name]="'Modifier'">
|
||||||
</app-modal>
|
<app-update-user></app-update-user>
|
||||||
<button nz-button nzType="primary" (click)="delete()" class="bg-red-600 border-red-600">Supprimer</button>
|
</app-modal-icon>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<nz-divider nzType="vertical"></nz-divider>
|
||||||
|
|
||||||
|
<div (click)="delete()" class="text-red-600 cursor-pointer">
|
||||||
|
<nz-icon nzType="delete" nzTheme="outline"></nz-icon>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,18 +2,22 @@ import { Component } from '@angular/core';
|
|||||||
import {NzTableComponent} from "ng-zorro-antd/table";
|
import {NzTableComponent} from "ng-zorro-antd/table";
|
||||||
import {Modal} from "../modal/modal";
|
import {Modal} from "../modal/modal";
|
||||||
import {DatePipe} from "@angular/common";
|
import {DatePipe} from "@angular/common";
|
||||||
import {NzButtonComponent} from "ng-zorro-antd/button";
|
|
||||||
import {UserInfo} from "../../interfaces/user.interfaces";
|
import {UserInfo} from "../../interfaces/user.interfaces";
|
||||||
import {UpdateUser} from "../update-user/update-user";
|
import {UpdateUser} from "../update-user/update-user";
|
||||||
|
import {ModalIcon} from "../modal-icon/modal-icon";
|
||||||
|
import {NzIconDirective} from "ng-zorro-antd/icon";
|
||||||
|
import {NzDividerComponent} from "ng-zorro-antd/divider";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-user-table',
|
selector: 'app-user-table',
|
||||||
imports: [
|
imports: [
|
||||||
DatePipe,
|
DatePipe,
|
||||||
Modal,
|
Modal,
|
||||||
NzButtonComponent,
|
|
||||||
NzTableComponent,
|
NzTableComponent,
|
||||||
UpdateUser,
|
UpdateUser,
|
||||||
|
ModalIcon,
|
||||||
|
NzIconDirective,
|
||||||
|
NzDividerComponent,
|
||||||
],
|
],
|
||||||
templateUrl: './user-table.html',
|
templateUrl: './user-table.html',
|
||||||
styleUrl: './user-table.css',
|
styleUrl: './user-table.css',
|
||||||
|
|||||||
Reference in New Issue
Block a user