diff --git a/.postcssrc.json b/.postcssrc.json new file mode 100644 index 0000000..72f908d --- /dev/null +++ b/.postcssrc.json @@ -0,0 +1,5 @@ +{ + "plugins": { + "@tailwindcss/postcss": {} + } +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 8f157ec..eb02be1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,8 +14,10 @@ "@angular/forms": "^20.3.0", "@angular/platform-browser": "^20.3.0", "@angular/router": "^20.3.0", + "@tailwindcss/postcss": "^4.1.17", "@tailwindcss/vite": "^4.1.17", "ng-zorro-antd": "^20.4.0", + "postcss": "^8.5.6", "rxjs": "~7.8.0", "tailwindcss": "^4.1.17", "tslib": "^2.3.0", @@ -238,6 +240,18 @@ "node": ">= 14.0.0" } }, + "node_modules/@alloc/quick-lru": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", + "integrity": "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@ampproject/remapping": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", @@ -3680,6 +3694,19 @@ "node": ">= 10" } }, + "node_modules/@tailwindcss/postcss": { + "version": "4.1.17", + "resolved": "https://registry.npmjs.org/@tailwindcss/postcss/-/postcss-4.1.17.tgz", + "integrity": "sha512-+nKl9N9mN5uJ+M7dBOOCzINw94MPstNR/GtIhz1fpZysxL/4a+No64jCBD6CPN+bIHWFx3KWuu8XJRrj/572Dw==", + "license": "MIT", + "dependencies": { + "@alloc/quick-lru": "^5.2.0", + "@tailwindcss/node": "4.1.17", + "@tailwindcss/oxide": "4.1.17", + "postcss": "^8.4.41", + "tailwindcss": "4.1.17" + } + }, "node_modules/@tailwindcss/vite": { "version": "4.1.17", "resolved": "https://registry.npmjs.org/@tailwindcss/vite/-/vite-4.1.17.tgz", diff --git a/package.json b/package.json index 4ec4df3..e5a9ff1 100644 --- a/package.json +++ b/package.json @@ -27,8 +27,10 @@ "@angular/forms": "^20.3.0", "@angular/platform-browser": "^20.3.0", "@angular/router": "^20.3.0", + "@tailwindcss/postcss": "^4.1.17", "@tailwindcss/vite": "^4.1.17", "ng-zorro-antd": "^20.4.0", + "postcss": "^8.5.6", "rxjs": "~7.8.0", "tailwindcss": "^4.1.17", "tslib": "^2.3.0", diff --git a/src/app/app.html b/src/app/app.html index 2136269..3ddb212 100644 --- a/src/app/app.html +++ b/src/app/app.html @@ -5,11 +5,11 @@ @@ -70,14 +70,16 @@
- + + +
-
+
diff --git a/src/app/app.ts b/src/app/app.ts index a71301c..311370e 100644 --- a/src/app/app.ts +++ b/src/app/app.ts @@ -4,10 +4,11 @@ import { NzLayoutModule } from 'ng-zorro-antd/layout'; import { NzMenuModule } from 'ng-zorro-antd/menu'; import {NzIconDirective} from "ng-zorro-antd/icon"; import {ModalNav} from "./components/modal-nav/modal-nav"; +import {Profil} from "./components/profil/profil"; @Component({ selector: 'app-root', - imports: [RouterOutlet, NzLayoutModule, NzMenuModule, NzIconDirective, RouterLinkActive, RouterLink, ModalNav], + imports: [RouterOutlet, NzLayoutModule, NzMenuModule, NzIconDirective, RouterLinkActive, RouterLink, ModalNav, Profil], templateUrl: './app.html', styleUrl: './app.css' }) diff --git a/src/app/components/profil-form/profil-form.css b/src/app/components/profil-form/profil-form.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/components/profil-form/profil-form.html b/src/app/components/profil-form/profil-form.html new file mode 100644 index 0000000..434fe71 --- /dev/null +++ b/src/app/components/profil-form/profil-form.html @@ -0,0 +1,38 @@ +
+ + + Prénom + + + + + + + + + Email + + + + + + + + + Fonction + + + + + + + + + Mot de passe + + + + + + +
\ No newline at end of file diff --git a/src/app/components/profil-form/profil-form.ts b/src/app/components/profil-form/profil-form.ts new file mode 100644 index 0000000..c6abd55 --- /dev/null +++ b/src/app/components/profil-form/profil-form.ts @@ -0,0 +1,42 @@ +import { Component } from '@angular/core'; +import {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from "@angular/forms"; +import {NzColDirective} from "ng-zorro-antd/grid"; +import {NzFlexDirective} from "ng-zorro-antd/flex"; +import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; +import {NzInputDirective} from "ng-zorro-antd/input"; + +@Component({ + selector: 'app-profil-form', + imports: [ + FormsModule, + NzColDirective, + NzFlexDirective, + NzFormControlComponent, + NzFormDirective, + NzFormItemComponent, + NzFormLabelComponent, + NzInputDirective, + ReactiveFormsModule + ], + templateUrl: './profil-form.html', + styleUrl: './profil-form.css', +}) +export class ProfilForm { + profilForm: FormGroup = new FormGroup({ + newName: new FormControl(null, [Validators.required]), + newEmail: new FormControl(null, [Validators.required]), + newFonction: new FormControl(null, [Validators.required]), + newPassword: new FormControl(null, [Validators.required]) + }) + + submitForm() { + // Pour annuler si le formulaire est invalide + if (this.profilForm.invalid) return; + + // Pour obtenir la valeur du formulaire + console.log(this.profilForm.getRawValue()) + + // Pour vider le formulaire + this.profilForm.reset() + } +} diff --git a/src/app/components/profil/profil.css b/src/app/components/profil/profil.css new file mode 100644 index 0000000..a9e8416 --- /dev/null +++ b/src/app/components/profil/profil.css @@ -0,0 +1,13 @@ +.festive { + font-family: "Comic Sans MS", cursive; + text-shadow: 2px 2px #8C731A, -2px -2px #8C731A; + color: #fff; + font-weight: bold; +} + +.festive2 { + font-family: "Comic Sans MS", cursive; + color: #001529; + font-weight: bold; +} + diff --git a/src/app/components/profil/profil.html b/src/app/components/profil/profil.html new file mode 100644 index 0000000..c15b623 --- /dev/null +++ b/src/app/components/profil/profil.html @@ -0,0 +1,15 @@ +
+ + + +
+ +
+ {{ getInitial(data.name) }} +
+ +
+

{{data.name}}

+

{{data.email}}

+

{{data.fonction}}

+
diff --git a/src/app/components/profil/profil.ts b/src/app/components/profil/profil.ts new file mode 100644 index 0000000..f1f3e31 --- /dev/null +++ b/src/app/components/profil/profil.ts @@ -0,0 +1,27 @@ +import { Component } from '@angular/core'; +import {UserInfo} from "../../interfaces/user.interface"; +import {ProfilForm} from "../profil-form/profil-form"; +import {ModalNav} from "../modal-nav/modal-nav"; + +@Component({ + selector: 'app-profil', + imports: [ + ProfilForm, + ModalNav + ], + templateUrl: './profil.html', + styleUrl: './profil.css', +}) +export class Profil { + data: UserInfo = + { + name: 'Mathys Sanchez Vendé', + email: 'mathys.sanchez@vende.fr', + fonction: 'admin', + }; + + getInitial(name: string): string { + if (!name || name.trim() === '') return '?'; + return name[0].toUpperCase(); + } +} diff --git a/src/app/components/stock-table/stock-table.html b/src/app/components/stock-table/stock-table.html index 2cf3c02..6b41a86 100644 --- a/src/app/components/stock-table/stock-table.html +++ b/src/app/components/stock-table/stock-table.html @@ -1,13 +1,13 @@ - + Nom - Duration - Caliber - quantity - Weight Nec - MinimalQuantity + Calibre + Poid + Durée + Quantité + Limite Action @@ -15,19 +15,19 @@ @for (data of basicTable.data; track data) { {{data.name}} - {{data.duration}} - {{data.caliber}} - {{data.quantity}} - {{data.weight}} {{data.nec}} + {{data.caliber}} + {{data.weight}} + {{data.duration}} + {{data.quantity}} {{data.minimalQuantity}}
- +
- +
diff --git a/src/app/components/stock-table/stock-table.ts b/src/app/components/stock-table/stock-table.ts index ee6c0f6..8df7f6f 100644 --- a/src/app/components/stock-table/stock-table.ts +++ b/src/app/components/stock-table/stock-table.ts @@ -18,25 +18,38 @@ import {StockForm} from "../stock-form/stock-form"; }) export class StockTable { listOfData: StockInfo[] = [ - { - name: 'Stock 1', - duration: '10 days', - caliber: '100g', - quantity: 100, - weight: 1000, - nec: '5kg', - minimalQuantity: 5 - }, - { - name: 'Stock 2', - duration: '20 days', - caliber: '200g', - quantity: 200, - weight: 2000, - nec: '10kg', - minimalQuantity: 10 - } + { name: 'Stock 1', duration: '10 days', caliber: '100g', quantity: 100, weight: 1000, nec: '5kg', minimalQuantity: 5 }, + { name: 'Stock 2', duration: '20 days', caliber: '200g', quantity: 200, weight: 2000, nec: '10kg', minimalQuantity: 10 }, + { name: 'Stock 3', duration: '15 days', caliber: '150g', quantity: 150, weight: 1500, nec: '7.5kg', minimalQuantity: 7 }, + { name: 'Stock 4', duration: '12 days', caliber: '120g', quantity: 120, weight: 1200, nec: '6kg', minimalQuantity: 6 }, + { name: 'Stock 5', duration: '18 days', caliber: '180g', quantity: 180, weight: 1800, nec: '9kg', minimalQuantity: 9 }, + { name: 'Stock 6', duration: '22 days', caliber: '220g', quantity: 220, weight: 2200, nec: '11kg', minimalQuantity: 11 }, + { name: 'Stock 7', duration: '8 days', caliber: '80g', quantity: 80, weight: 800, nec: '4kg', minimalQuantity: 4 }, + { name: 'Stock 8', duration: '25 days', caliber: '250g', quantity: 250, weight: 2500, nec: '12.5kg', minimalQuantity: 12 }, + { name: 'Stock 9', duration: '14 days', caliber: '140g', quantity: 140, weight: 1400, nec: '7kg', minimalQuantity: 7 }, + { name: 'Stock 10', duration: '16 days', caliber: '160g', quantity: 160, weight: 1600, nec: '8kg', minimalQuantity: 8 }, + { name: 'Stock 11', duration: '11 days', caliber: '110g', quantity: 110, weight: 1100, nec: '5.5kg', minimalQuantity: 5 }, + { name: 'Stock 12', duration: '19 days', caliber: '190g', quantity: 190, weight: 1900, nec: '9.5kg', minimalQuantity: 9 }, + { name: 'Stock 13', duration: '13 days', caliber: '130g', quantity: 130, weight: 1300, nec: '6.5kg', minimalQuantity: 6 }, + { name: 'Stock 14', duration: '17 days', caliber: '170g', quantity: 170, weight: 1700, nec: '8.5kg', minimalQuantity: 8 }, + { name: 'Stock 15', duration: '21 days', caliber: '210g', quantity: 210, weight: 2100, nec: '10.5kg', minimalQuantity: 10 }, + { name: 'Stock 16', duration: '9 days', caliber: '90g', quantity: 90, weight: 900, nec: '4.5kg', minimalQuantity: 4 }, + { name: 'Stock 17', duration: '23 days', caliber: '230g', quantity: 230, weight: 2300, nec: '11.5kg', minimalQuantity: 11 }, + { name: 'Stock 18', duration: '7 days', caliber: '70g', quantity: 70, weight: 700, nec: '3.5kg', minimalQuantity: 3 }, + { name: 'Stock 19', duration: '24 days', caliber: '240g', quantity: 240, weight: 2400, nec: '12kg', minimalQuantity: 12 }, + { name: 'Stock 20', duration: '6 days', caliber: '60g', quantity: 60, weight: 600, nec: '3kg', minimalQuantity: 3 }, + { name: 'Stock 21', duration: '26 days', caliber: '260g', quantity: 260, weight: 2600, nec: '13kg', minimalQuantity: 13 }, + { name: 'Stock 22', duration: '5 days', caliber: '50g', quantity: 50, weight: 500, nec: '2.5kg', minimalQuantity: 2 }, + { name: 'Stock 23', duration: '27 days', caliber: '270g', quantity: 270, weight: 2700, nec: '13.5kg', minimalQuantity: 13 }, + { name: 'Stock 24', duration: '4 days', caliber: '40g', quantity: 40, weight: 400, nec: '2kg', minimalQuantity: 2 }, + { name: 'Stock 25', duration: '28 days', caliber: '280g', quantity: 280, weight: 2800, nec: '14kg', minimalQuantity: 14 }, + { name: 'Stock 26', duration: '3 days', caliber: '30g', quantity: 30, weight: 300, nec: '1.5kg', minimalQuantity: 1 }, + { name: 'Stock 27', duration: '29 days', caliber: '290g', quantity: 290, weight: 2900, nec: '14.5kg', minimalQuantity: 14 }, + { name: 'Stock 28', duration: '2 days', caliber: '20g', quantity: 20, weight: 200, nec: '1kg', minimalQuantity: 1 }, + { name: 'Stock 29', duration: '30 days', caliber: '300g', quantity: 300, weight: 3000, nec: '15kg', minimalQuantity: 15 }, + { name: 'Stock 30', duration: '1 day', caliber: '10g', quantity: 10, weight: 100, nec: '0.5kg', minimalQuantity: 1 }, ]; + delete(){ return } diff --git a/src/app/interfaces/stock.interface.ts b/src/app/interfaces/stock.interface.ts index 0a187e6..3e067fb 100644 --- a/src/app/interfaces/stock.interface.ts +++ b/src/app/interfaces/stock.interface.ts @@ -1,9 +1,9 @@ export interface StockInfo { name: string; - duration: string; - caliber: string; - quantity: number; - weight: number; nec: string; + caliber: string; + weight: number; + duration: string; + quantity: number; minimalQuantity: number; } \ No newline at end of file diff --git a/src/app/interfaces/user.interface.ts b/src/app/interfaces/user.interface.ts new file mode 100644 index 0000000..b7feffe --- /dev/null +++ b/src/app/interfaces/user.interface.ts @@ -0,0 +1,5 @@ +export interface UserInfo { + name: string; + email: string; + fonction: string; +} \ No newline at end of file