Compare commits

2 Commits

Author SHA1 Message Date
cbf01acb99 providers continue partie2 2025-11-27 14:19:35 +01:00
043899db3f providers start 2025-11-20 17:52:40 +01:00
8 changed files with 65 additions and 17 deletions

View File

@@ -0,0 +1,3 @@
.ant-modal-content {
background: #272727;
}

View File

@@ -1,11 +1,55 @@
import { Component } from '@angular/core';
import {NzModalComponent, NzModalModule} from "ng-zorro-antd/modal";
import {NzButtonComponent, NzButtonModule} from "ng-zorro-antd/button";
import {NzMessageService} from "ng-zorro-antd/message";
@Component({
selector: 'app-providers-card-form',
imports: [],
templateUrl: './providers-card-form.html',
imports: [NzButtonModule, NzModalModule],
template: `
<button nz-button nzType="primary" (click)="showModal()">
<span>+</span>
</button>
<nz-modal
[(nzVisible)]="isVisible"
[nzTitle]="modalTitle"
[nzContent]="modalContent"
[nzFooter]="modalFooter"
(nzOnCancel)="handleCancel()"
>
<ng-template #modalTitle style="text-align: center">Création de prestataires</ng-template>
<ng-template #modalContent>
<app-providers-add-form></app-providers-add-form>
</ng-template>
<ng-template #modalFooter>
<button nz-button nzType="default" (click)="handleCancel()">Annuler</button>
<button nz-button nzType="primary" (click)="handleOk()" [nzLoading]="isConfirmLoading">Confirmer</button>
</ng-template>
</nz-modal>
`,
styleUrl: './providers-card-form.css',
})
export class ProvidersCardForm {
constructor(private message: NzMessageService) {}
isVisible = false;
isConfirmLoading = false;
showModal(): void {
this.isVisible = true;
}
handleOk(): void {
this.isConfirmLoading = true;
this.message.success('Prestataire créé !');
setTimeout(() => {
this.isVisible = false;
this.isConfirmLoading = false;
}, 1000);
}
handleCancel(): void {
this.isVisible = false;
}
}

View File

@@ -1 +1 @@
<p>providers-card works!</p>
<app-providers-card-form/>

View File

@@ -1,8 +1,9 @@
import { Component } from '@angular/core';
import {ProvidersCardForm} from "../providers-card-form/providers-card-form";
@Component({
selector: 'app-providers-card',
imports: [],
imports: [ProvidersCardForm],
templateUrl: './providers-card.html',
styleUrl: './providers-card.css',
})

View File

@@ -6,4 +6,4 @@
// Override less variables to here
// View all variables: https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/components/style/themes/default.less
@primary-color: #1c1c1c;
// @primary-color: #1890ff;