added search component from all pages

This commit is contained in:
2025-11-16 12:06:54 +01:00
parent 3ba843af6a
commit 19afeb6369
17 changed files with 172 additions and 22 deletions

View File

@@ -0,0 +1,36 @@
/* From Uiverse.io by LightAndy1 */
.group {
box-shadow: 0 1px 2px 1px #001529;
border-radius: 15px;
padding: 0.1rem 0.5rem 0.1rem 1rem;
display: flex;
line-height: 28px;
align-items: center;
position: relative;
max-width: 400px;
}
.input {
width: 100%;
height: 32px;
line-height: 28px;
padding: 0 1rem;
border: 2px solid transparent;
border-radius: 8px;
outline: none;
background-color: #f3f3f4;
color: #0d0c22;
transition: 0.3s ease;
}
.input::placeholder {
color: #9e9ea7;
}
.input:focus,
input:hover {
outline: none;
border-color: #40A9FF;
background-color: #fff;
box-shadow: 0 0 0 4px rgba(199, 199, 197, 0.1);
}

View File

@@ -0,0 +1,10 @@
<form nz-form nzLayout="horizontal" [formGroup]="searchForm" (ngSubmit)="submitForm()">
<nz-form-item nz-flex>
<nz-form-control nzSpan="12">
<div class="group">
<nz-icon nzType="search" nzTheme="outline" class="mr-2 text-xl"></nz-icon>
<input class="input" placeholder="Rechercher" formControlName="searchValue"/>
</div>
</nz-form-control>
</nz-form-item>
</form>

View File

@@ -0,0 +1,37 @@
import { Component } from '@angular/core';
import {NzIconDirective} from "ng-zorro-antd/icon";
import {NzColDirective} from "ng-zorro-antd/grid";
import {NzFlexDirective} from "ng-zorro-antd/flex";
import {NzFormControlComponent, NzFormDirective, NzFormItemComponent} from "ng-zorro-antd/form";
import {FormControl, FormGroup, ReactiveFormsModule} from "@angular/forms";
@Component({
selector: 'app-search',
imports: [
NzIconDirective,
NzColDirective,
NzFlexDirective,
NzFormControlComponent,
NzFormDirective,
NzFormItemComponent,
ReactiveFormsModule
],
templateUrl: './search.html',
styleUrl: './search.css',
})
export class Search {
searchForm: FormGroup = new FormGroup({
searchValue: new FormControl<string>(null)
})
submitForm() {
// Pour annuler si le formulaire est invalide
if (this.searchForm.invalid) return;
// Pour obtenir la valeur du formulaire
console.log(this.searchForm.getRawValue())
// Pour vider le formulaire
this.searchForm.reset()
}
}

View File

@@ -1,7 +1,13 @@
<app-modal-button type="primary" name="Ajouter un transporteur">
<div class="flex mt-2">
<app-modal-button type="primary" name="Ajouter un transporteur">
<app-deliverer-form></app-deliverer-form>
</app-modal-button>
</app-modal-button>
<div class="mt-4">
<div class="ml-95 w-150">
<app-search class="w-full"></app-search>
</div>
</div>
<div class="mt-1">
<app-deliverer-table></app-deliverer-table>
</div>

View File

@@ -2,13 +2,15 @@ import { Component } from '@angular/core';
import {ModalButton} from "../../components/modal-button/modal-button";
import {DelivererTable} from "../../components/deliverer-table/deliverer-table";
import {DelivererForm} from "../../components/deliverer-form/deliverer-form";
import {Search} from "../../components/search/search";
@Component({
selector: 'app-deliverer',
imports: [
ModalButton,
DelivererTable,
DelivererForm
DelivererForm,
Search
],
templateUrl: './deliverer.html',
styleUrl: './deliverer.css',

View File

@@ -1,6 +1,13 @@
<app-modal-button type="primary" name="Créer un bon de livraison">
<div class="flex mt-2">
<app-modal-button type="primary" name="Créer un bon de livraison">
<app-deliverery-note-form></app-deliverery-note-form>
</app-modal-button>
<div class="mt-4">
</app-modal-button>
<div class="ml-95 w-150">
<app-search></app-search>
</div>
</div>
<div class="mt-1">
<app-deliverery-note-table></app-deliverery-note-table>
</div>

View File

@@ -2,13 +2,15 @@ import { Component } from '@angular/core';
import {DelivereryNoteTable} from "../../components/deliverery-note-table/deliverery-note-table";
import {ModalButton} from "../../components/modal-button/modal-button";
import {DelivereryNoteForm} from "../../components/deliverery-note-form/deliverery-note-form";
import {Search} from "../../components/search/search";
@Component({
selector: 'app-delivery-note',
imports: [
DelivereryNoteTable,
ModalButton,
DelivereryNoteForm
DelivereryNoteForm,
Search
],
templateUrl: './delivery-note.html',
styleUrl: './delivery-note.css',

View File

@@ -1 +1,8 @@
<p>purchase-order works!</p>
<div class="flex mt-2">
<div class="ml-95 w-150">
<app-search></app-search>
</div>
</div>
<div class="mt-1">
<p>purchase-order works!</p>
</div>

View File

@@ -1,8 +1,13 @@
import { Component } from '@angular/core';
import {Search} from "../../components/search/search";
import {ModalButton} from "../../components/modal-button/modal-button";
@Component({
selector: 'app-purchase-order',
imports: [],
imports: [
Search,
ModalButton
],
templateUrl: './purchase-order.html',
styleUrl: './purchase-order.css',
})

View File

@@ -1 +1,9 @@
<p>quotation works!</p>
<div class="flex mt-2">
<div class="ml-95 w-150">
<app-search class="w-full"></app-search>
</div>
</div>
<div class="mt-1">
<p>quotation works!</p>
</div>

View File

@@ -1,8 +1,11 @@
import { Component } from '@angular/core';
import {Search} from "../../components/search/search";
@Component({
selector: 'app-quotation',
imports: [],
imports: [
Search
],
templateUrl: './quotation.html',
styleUrl: './quotation.css',
})

View File

@@ -1 +1,7 @@
<app-stock-table></app-stock-table>
<div class="ml-130 w-170 mt-2">
<app-search></app-search>
</div>
<div class="mt-1">
<app-stock-table></app-stock-table>
</div>

View File

@@ -1,10 +1,12 @@
import { Component } from '@angular/core';
import {StockTable} from "../../components/stock-table/stock-table";
import {Search} from "../../components/search/search";
@Component({
selector: 'app-stock',
imports: [
StockTable,
Search,
],
templateUrl: './stock.html',
styleUrl: './stock.css',

View File

@@ -1 +1,9 @@
<p>supplier works!</p>
<div class="flex mt-2">
<div class="ml-95 w-150">
<app-search></app-search>
</div>
</div>
<div class="mt-1">
<p>supplier works!</p>
</div>

View File

@@ -1,8 +1,11 @@
import { Component } from '@angular/core';
import {Search} from "../../components/search/search";
@Component({
selector: 'app-supplier',
imports: [],
imports: [
Search
],
templateUrl: './supplier.html',
styleUrl: './supplier.css',
})

View File

@@ -1,7 +1,13 @@
<app-modal-button type="primary" name="Ajouter un utilisateur">
<div class="flex mt-2">
<app-modal-button type="primary" name="Ajouter un utilisateur">
<app-profil-form></app-profil-form>
</app-modal-button>
</app-modal-button>
<div class="mt-4">
<div class="ml-95 w-150">
<app-search></app-search>
</div>
</div>
<div class="mt-1">
<app-user-table></app-user-table>
</div>

View File

@@ -2,13 +2,15 @@ import { Component } from '@angular/core';
import {UserTable} from "../../components/user-table/user-table";
import {ModalButton} from "../../components/modal-button/modal-button";
import {ProfilForm} from "../../components/profil-form/profil-form";
import {Search} from "../../components/search/search";
@Component({
selector: 'app-user',
imports: [
UserTable,
ModalButton,
ProfilForm
ProfilForm,
Search
],
templateUrl: './user.html',
styleUrl: './user.css',