Merge remote-tracking branch 'origin/v19' into v19
# Conflicts: # src/views/uikit/chartdoc.ts
This commit is contained in:
@@ -11,10 +11,9 @@ import { ButtonModule } from 'primeng/button';
|
|||||||
import { Product, ProductService } from '@/src/service/product.service';
|
import { Product, ProductService } from '@/src/service/product.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
standalone:true,
|
standalone: true,
|
||||||
imports: [CommonModule, DataViewModule, FormsModule, SelectButtonModule, PickListModule, OrderListModule, TagModule, ButtonModule],
|
imports: [CommonModule, DataViewModule, FormsModule, SelectButtonModule, PickListModule, OrderListModule, TagModule, ButtonModule],
|
||||||
template: `
|
template: ` <div class="flex flex-col">
|
||||||
<div class="flex flex-col">
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="font-semibold text-xl">DataView</div>
|
<div class="font-semibold text-xl">DataView</div>
|
||||||
<p-dataview [value]="products" [layout]="layout">
|
<p-dataview [value]="products" [layout]="layout">
|
||||||
@@ -22,7 +21,7 @@ import { Product, ProductService } from '@/src/service/product.service';
|
|||||||
<div class="flex justify-end">
|
<div class="flex justify-end">
|
||||||
<p-select-button [(ngModel)]="layout" [options]="options" [allowEmpty]="false">
|
<p-select-button [(ngModel)]="layout" [options]="options" [allowEmpty]="false">
|
||||||
<ng-template #item let-option>
|
<ng-template #item let-option>
|
||||||
<i class="pi " [ngClass]="{'pi-bars': option === 'list', 'pi-table': option === 'grid'}"></i>
|
<i class="pi " [ngClass]="{ 'pi-bars': option === 'list', 'pi-table': option === 'grid' }"></i>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</p-select-button>
|
</p-select-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -31,20 +30,15 @@ import { Product, ProductService } from '@/src/service/product.service';
|
|||||||
<ng-template #list let-items>
|
<ng-template #list let-items>
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col">
|
||||||
<div *ngFor="let item of items; let i = index">
|
<div *ngFor="let item of items; let i = index">
|
||||||
<div class="flex flex-col sm:flex-row sm:items-center p-6 gap-4"
|
<div class="flex flex-col sm:flex-row sm:items-center p-6 gap-4" [ngClass]="{ 'border-t border-surface': i !== 0 }">
|
||||||
[ngClass]="{ 'border-t border-surface': i !== 0 }">
|
|
||||||
<div class="md:w-40 relative">
|
<div class="md:w-40 relative">
|
||||||
<img class="block xl:block mx-auto rounded w-full"
|
<img class="block xl:block mx-auto rounded w-full" src="https://primefaces.org/cdn/primevue/images/product/{{ item.image }}" [alt]="item.name" />
|
||||||
src="https://primefaces.org/cdn/primevue/images/product/{{item.image}}"
|
<p-tag [value]="item.inventoryStatus" [severity]="getSeverity(item)" class="absolute dark:!bg-surface-900" [style]="{ left: '4px', top: '4px' }"></p-tag>
|
||||||
[alt]="item.name" />
|
|
||||||
<p-tag [value]="item.inventoryStatus" [severity]="getSeverity(item)"
|
|
||||||
class="absolute dark:!bg-surface-900" [style]="{left: '4px', top: '4px'}"></p-tag>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col md:flex-row justify-between md:items-center flex-1 gap-6">
|
<div class="flex flex-col md:flex-row justify-between md:items-center flex-1 gap-6">
|
||||||
<div class="flex flex-row md:flex-col justify-between items-start gap-2">
|
<div class="flex flex-row md:flex-col justify-between items-start gap-2">
|
||||||
<div>
|
<div>
|
||||||
<span
|
<span class="font-medium text-surface-500 dark:text-surface-400 text-sm">{{ item.category }}</span>
|
||||||
class="font-medium text-surface-500 dark:text-surface-400 text-sm">{{ item.category }}</span>
|
|
||||||
<div class="text-lg font-medium mt-2">{{ item.name }}</div>
|
<div class="text-lg font-medium mt-2">{{ item.name }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="bg-surface-100 p-1" style="border-radius: 30px">
|
<div class="bg-surface-100 p-1" style="border-radius: 30px">
|
||||||
@@ -57,8 +51,7 @@ import { Product, ProductService } from '@/src/service/product.service';
|
|||||||
0px 1px 2px 0px rgba(0, 0, 0, 0.06);
|
0px 1px 2px 0px rgba(0, 0, 0, 0.06);
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<span
|
<span class="text-surface-900 font-medium text-sm">{{ item.rating }}</span>
|
||||||
class="text-surface-900 font-medium text-sm">{{ item.rating }}</span>
|
|
||||||
<i class="pi pi-star-fill text-yellow-500"></i>
|
<i class="pi pi-star-fill text-yellow-500"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -67,9 +60,7 @@ import { Product, ProductService } from '@/src/service/product.service';
|
|||||||
<span class="text-xl font-semibold">$ {{ item.price }}</span>
|
<span class="text-xl font-semibold">$ {{ item.price }}</span>
|
||||||
<div class="flex flex-row-reverse md:flex-row gap-2">
|
<div class="flex flex-row-reverse md:flex-row gap-2">
|
||||||
<p-button icon="pi pi-heart" styleClass="h-full" [outlined]="true"></p-button>
|
<p-button icon="pi pi-heart" styleClass="h-full" [outlined]="true"></p-button>
|
||||||
<p-button icon="pi pi-shopping-cart" label="Buy Now"
|
<p-button icon="pi pi-shopping-cart" label="Buy Now" [disabled]="item.inventoryStatus === 'OUTOFSTOCK'" styleClass="flex-auto md:flex-initial whitespace-nowrap"></p-button>
|
||||||
[disabled]="item.inventoryStatus === 'OUTOFSTOCK'"
|
|
||||||
styleClass="flex-auto md:flex-initial whitespace-nowrap"></p-button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -80,25 +71,18 @@ import { Product, ProductService } from '@/src/service/product.service';
|
|||||||
|
|
||||||
<ng-template #grid let-items>
|
<ng-template #grid let-items>
|
||||||
<div class="grid grid-cols-12 gap-4">
|
<div class="grid grid-cols-12 gap-4">
|
||||||
<div *ngFor="let item of items; let i = index">
|
<div *ngFor="let item of items; let i = index" class="col-span-12 sm:col-span-6 lg:col-span-4 p-2">
|
||||||
class="col-span-12 sm:col-span-6 lg:col-span-4 p-2">
|
<div class="p-6 border border-surface-200 dark:border-surface-700 bg-surface-0 dark:bg-surface-900 rounded flex flex-col">
|
||||||
<div
|
|
||||||
class="p-6 border border-surface-200 dark:border-surface-700 bg-surface-0 dark:bg-surface-900 rounded flex flex-col">
|
|
||||||
<div class="bg-surface-50 flex justify-center rounded p-6">
|
<div class="bg-surface-50 flex justify-center rounded p-6">
|
||||||
<div class="relative mx-auto">
|
<div class="relative mx-auto">
|
||||||
<img class="rounded w-full"
|
<img class="rounded w-full" src="https://primefaces.org/cdn/primevue/images/product/{{ item.image }}" [alt]="item.name" style="max-width: 300px" />
|
||||||
src="https://primefaces.org/cdn/primevue/images/product/{{item.image}}"
|
<p-tag [value]="item.inventoryStatus" [severity]="getSeverity(item)" class="absolute dark:!bg-surface-900" [style]="{ left: '4px', top: '4px' }"></p-tag>
|
||||||
[alt]="item.name" style="max-width: 300px" />
|
|
||||||
<p-tag [value]="item.inventoryStatus" [severity]="getSeverity(item)"
|
|
||||||
class="absolute dark:!bg-surface-900"
|
|
||||||
[style]="{left: '4px', top: '4px'}"></p-tag>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pt-12">
|
<div class="pt-12">
|
||||||
<div class="flex flex-row justify-between items-start gap-2">
|
<div class="flex flex-row justify-between items-start gap-2">
|
||||||
<div>
|
<div>
|
||||||
<span
|
<span class="font-medium text-surface-500 dark:text-surface-400 text-sm">{{ item.category }}</span>
|
||||||
class="font-medium text-surface-500 dark:text-surface-400 text-sm">{{ item.category }}</span>
|
|
||||||
<div class="text-lg font-medium mt-1">{{ item.name }}</div>
|
<div class="text-lg font-medium mt-1">{{ item.name }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="bg-surface-100 p-1" style="border-radius: 30px">
|
<div class="bg-surface-100 p-1" style="border-radius: 30px">
|
||||||
@@ -111,8 +95,7 @@ import { Product, ProductService } from '@/src/service/product.service';
|
|||||||
0px 1px 2px 0px rgba(0, 0, 0, 0.06);
|
0px 1px 2px 0px rgba(0, 0, 0, 0.06);
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<span
|
<span class="text-surface-900 font-medium text-sm">{{ item.rating }}</span>
|
||||||
class="text-surface-900 font-medium text-sm">{{ item.rating }}</span>
|
|
||||||
<i class="pi pi-star-fill text-yellow-500"></i>
|
<i class="pi pi-star-fill text-yellow-500"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -120,9 +103,7 @@ import { Product, ProductService } from '@/src/service/product.service';
|
|||||||
<div class="flex flex-col gap-6 mt-6">
|
<div class="flex flex-col gap-6 mt-6">
|
||||||
<span class="text-2xl font-semibold">$ {{ item.price }}</span>
|
<span class="text-2xl font-semibold">$ {{ item.price }}</span>
|
||||||
<div class="flex gap-2">
|
<div class="flex gap-2">
|
||||||
<p-button icon="pi pi-shopping-cart" label="Buy Now"
|
<p-button icon="pi pi-shopping-cart" label="Buy Now" [disabled]="item.inventoryStatus === 'OUTOFSTOCK'" class="flex-auto whitespace-nowrap" styleClass="w-full"></p-button>
|
||||||
[disabled]="item.inventoryStatus === 'OUTOFSTOCK'"
|
|
||||||
class="flex-auto whitespace-nowrap"></p-button>
|
|
||||||
<p-button icon="pi pi-heart" styleClass="h-full" [outlined]="true"></p-button>
|
<p-button icon="pi pi-heart" styleClass="h-full" [outlined]="true"></p-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -160,7 +141,7 @@ import { Product, ProductService } from '@/src/service/product.service';
|
|||||||
</div>`,
|
</div>`,
|
||||||
styles: `
|
styles: `
|
||||||
::ng-deep {
|
::ng-deep {
|
||||||
.p-orderlist-list-container{
|
.p-orderlist-list-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -168,7 +149,6 @@ import { Product, ProductService } from '@/src/service/product.service';
|
|||||||
providers: [ProductService]
|
providers: [ProductService]
|
||||||
})
|
})
|
||||||
export class ListDoc {
|
export class ListDoc {
|
||||||
|
|
||||||
layout: 'list' | 'grid' = 'list';
|
layout: 'list' | 'grid' = 'list';
|
||||||
|
|
||||||
options = ['list', 'grid'];
|
options = ['list', 'grid'];
|
||||||
@@ -181,10 +161,10 @@ export class ListDoc {
|
|||||||
|
|
||||||
orderCities: any[] = [];
|
orderCities: any[] = [];
|
||||||
|
|
||||||
constructor(private productService: ProductService) { }
|
constructor(private productService: ProductService) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.productService.getProducts().then(data => this.products = data);
|
this.productService.getProductsSmall().then((data) => (this.products = data.slice(0, 6)));
|
||||||
|
|
||||||
this.sourceCities = [
|
this.sourceCities = [
|
||||||
{ name: 'San Francisco', code: 'SF' },
|
{ name: 'San Francisco', code: 'SF' },
|
||||||
@@ -193,7 +173,8 @@ export class ListDoc {
|
|||||||
{ name: 'Istanbul', code: 'IST' },
|
{ name: 'Istanbul', code: 'IST' },
|
||||||
{ name: 'Berlin', code: 'BRL' },
|
{ name: 'Berlin', code: 'BRL' },
|
||||||
{ name: 'Barcelona', code: 'BRC' },
|
{ name: 'Barcelona', code: 'BRC' },
|
||||||
{ name: 'Rome', code: 'RM' }];
|
{ name: 'Rome', code: 'RM' }
|
||||||
|
];
|
||||||
|
|
||||||
this.targetCities = [];
|
this.targetCities = [];
|
||||||
|
|
||||||
@@ -204,11 +185,10 @@ export class ListDoc {
|
|||||||
{ name: 'Istanbul', code: 'IST' },
|
{ name: 'Istanbul', code: 'IST' },
|
||||||
{ name: 'Berlin', code: 'BRL' },
|
{ name: 'Berlin', code: 'BRL' },
|
||||||
{ name: 'Barcelona', code: 'BRC' },
|
{ name: 'Barcelona', code: 'BRC' },
|
||||||
{ name: 'Rome', code: 'RM' }];
|
{ name: 'Rome', code: 'RM' }
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
getSeverity(product) {
|
getSeverity(product) {
|
||||||
switch (product.inventoryStatus) {
|
switch (product.inventoryStatus) {
|
||||||
case 'INSTOCK':
|
case 'INSTOCK':
|
||||||
|
|||||||
Reference in New Issue
Block a user