@exhaustive-ui/mcp 22.4.0 → 22.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -1
- package/data/cards/accordion.md +91 -0
- package/data/cards/animateonscroll.md +155 -0
- package/data/cards/autocomplete.md +109 -0
- package/data/cards/autofocus.md +36 -0
- package/data/cards/avatar.md +45 -0
- package/data/cards/badge.md +44 -0
- package/data/cards/blockui.md +51 -0
- package/data/cards/breadcrumb.md +56 -0
- package/data/cards/button.md +83 -0
- package/data/cards/card.md +49 -0
- package/data/cards/carousel.md +101 -0
- package/data/cards/cascadeselect.md +77 -0
- package/data/cards/chart.md +105 -0
- package/data/cards/checkbox.md +59 -0
- package/data/cards/chip.md +50 -0
- package/data/cards/classnames.md +91 -0
- package/data/cards/colorpicker.md +52 -0
- package/data/cards/confirmdialog.md +119 -0
- package/data/cards/confirmpopup.md +96 -0
- package/data/cards/contextmenu.md +60 -0
- package/data/cards/dataview.md +134 -0
- package/data/cards/datepicker.md +103 -0
- package/data/cards/dialog.md +89 -0
- package/data/cards/divider.md +55 -0
- package/data/cards/dock.md +106 -0
- package/data/cards/dragdrop.md +106 -0
- package/data/cards/drawer.md +62 -0
- package/data/cards/dynamicdialog.md +103 -0
- package/data/cards/editor.md +55 -0
- package/data/cards/fieldset.md +54 -0
- package/data/cards/fileinput.md +72 -0
- package/data/cards/fileupload.md +88 -0
- package/data/cards/floatlabel.md +41 -0
- package/data/cards/fluid.md +49 -0
- package/data/cards/focustrap.md +64 -0
- package/data/cards/galleria.md +94 -0
- package/data/cards/iconfield.md +45 -0
- package/data/cards/iftalabel.md +38 -0
- package/data/cards/image.md +58 -0
- package/data/cards/imagecompare.md +45 -0
- package/data/cards/inplace.md +56 -0
- package/data/cards/inputgroup.md +77 -0
- package/data/cards/inputmask.md +71 -0
- package/data/cards/inputnumber.md +78 -0
- package/data/cards/inputotp.md +60 -0
- package/data/cards/inputtext.md +41 -0
- package/data/cards/keyfilter.md +49 -0
- package/data/cards/knob.md +55 -0
- package/data/cards/listbox.md +105 -0
- package/data/cards/megamenu.md +96 -0
- package/data/cards/menu.md +64 -0
- package/data/cards/menubar.md +102 -0
- package/data/cards/message.md +51 -0
- package/data/cards/metergroup.md +53 -0
- package/data/cards/multiselect.md +115 -0
- package/data/cards/orderlist.md +96 -0
- package/data/cards/organizationchart.md +84 -0
- package/data/cards/overlay.md +63 -0
- package/data/cards/paginator.md +62 -0
- package/data/cards/panel.md +57 -0
- package/data/cards/panelmenu.md +94 -0
- package/data/cards/password.md +81 -0
- package/data/cards/picklist.md +106 -0
- package/data/cards/popover.md +53 -0
- package/data/cards/progressbar.md +42 -0
- package/data/cards/progressspinner.md +38 -0
- package/data/cards/radiobutton.md +52 -0
- package/data/cards/rating.md +56 -0
- package/data/cards/ripple.md +37 -0
- package/data/cards/scroller.md +32 -0
- package/data/cards/scrollpanel.md +50 -0
- package/data/cards/scrolltop.md +48 -0
- package/data/cards/select.md +108 -0
- package/data/cards/selectbutton.md +64 -0
- package/data/cards/skeleton.md +54 -0
- package/data/cards/slider.md +52 -0
- package/data/cards/speeddial.md +102 -0
- package/data/cards/splitbutton.md +96 -0
- package/data/cards/splitter.md +52 -0
- package/data/cards/stepper.md +125 -0
- package/data/cards/styleclass.md +46 -0
- package/data/cards/table.md +305 -0
- package/data/cards/tabs.md +97 -0
- package/data/cards/tag.md +41 -0
- package/data/cards/terminal.md +76 -0
- package/data/cards/textarea.md +45 -0
- package/data/cards/tieredmenu.md +121 -0
- package/data/cards/timeline.md +58 -0
- package/data/cards/toast.md +58 -0
- package/data/cards/togglebutton.md +59 -0
- package/data/cards/toggleswitch.md +52 -0
- package/data/cards/toolbar.md +74 -0
- package/data/cards/tooltip.md +43 -0
- package/data/cards/tree.md +93 -0
- package/data/cards/treeselect.md +98 -0
- package/data/cards/treetable.md +231 -0
- package/data/components/accordion.md +31 -23
- package/data/components/animateonscroll.md +18 -15
- package/data/components/autocomplete.md +162 -93
- package/data/components/autofocus.md +9 -7
- package/data/components/avatar.md +56 -43
- package/data/components/badge.md +27 -18
- package/data/components/blockui.md +15 -8
- package/data/components/breadcrumb.md +20 -14
- package/data/components/button.md +121 -94
- package/data/components/card.md +12 -10
- package/data/components/carousel.md +75 -53
- package/data/components/cascadeselect.md +271 -238
- package/data/components/chart.md +88 -74
- package/data/components/checkbox.md +107 -97
- package/data/components/chip.md +20 -16
- package/data/components/classnames.md +22 -4
- package/data/components/colorpicker.md +54 -36
- package/data/components/confirmdialog.md +146 -43
- package/data/components/confirmpopup.md +95 -22
- package/data/components/contextmenu.md +110 -39
- package/data/components/dataview.md +176 -83
- package/data/components/datepicker.md +171 -141
- package/data/components/dialog.md +80 -68
- package/data/components/divider.md +17 -12
- package/data/components/dock.md +65 -29
- package/data/components/dragdrop.md +26 -12
- package/data/components/drawer.md +67 -48
- package/data/components/dynamicdialog.md +22 -13
- package/data/components/editor.md +42 -33
- package/data/components/fieldset.md +20 -17
- package/data/components/fileinput.md +92 -35
- package/data/components/fileupload.md +101 -61
- package/data/components/floatlabel.md +20 -11
- package/data/components/fluid.md +11 -9
- package/data/components/focustrap.md +11 -7
- package/data/components/galleria.md +231 -90
- package/data/components/iconfield.md +23 -15
- package/data/components/iftalabel.md +15 -9
- package/data/components/image.md +31 -26
- package/data/components/imagecompare.md +8 -6
- package/data/components/inplace.md +27 -22
- package/data/components/inputgroup.md +53 -29
- package/data/components/inputmask.md +107 -85
- package/data/components/inputnumber.md +128 -90
- package/data/components/inputotp.md +55 -42
- package/data/components/inputtext.md +72 -50
- package/data/components/keyfilter.md +6 -3
- package/data/components/knob.md +70 -58
- package/data/components/listbox.md +171 -141
- package/data/components/llms.md +4 -0
- package/data/components/megamenu.md +24 -23
- package/data/components/menu.md +37 -34
- package/data/components/menubar.md +27 -22
- package/data/components/message.md +44 -32
- package/data/components/metergroup.md +48 -17
- package/data/components/multiselect.md +232 -168
- package/data/components/orderlist.md +55 -48
- package/data/components/organizationchart.md +182 -13
- package/data/components/overlay.md +31 -26
- package/data/components/paginator.md +49 -34
- package/data/components/panel.md +23 -19
- package/data/components/panelmenu.md +51 -25
- package/data/components/password.md +104 -91
- package/data/components/picklist.md +93 -71
- package/data/components/popover.md +68 -46
- package/data/components/progressbar.md +28 -22
- package/data/components/progressspinner.md +13 -11
- package/data/components/radiobutton.md +69 -35
- package/data/components/rating.md +48 -40
- package/data/components/ripple.md +8 -6
- package/data/components/scroller.md +29 -29
- package/data/components/scrollpanel.md +9 -7
- package/data/components/scrolltop.md +20 -18
- package/data/components/select.md +248 -169
- package/data/components/selectbutton.md +118 -56
- package/data/components/skeleton.md +22 -18
- package/data/components/slider.md +73 -49
- package/data/components/speeddial.md +77 -59
- package/data/components/splitbutton.md +354 -329
- package/data/components/splitter.md +22 -18
- package/data/components/stepper.md +38 -21
- package/data/components/styleclass.md +12 -6
- package/data/components/table.md +524 -315
- package/data/components/tabs.md +44 -26
- package/data/components/tag.md +18 -14
- package/data/components/terminal.md +38 -27
- package/data/components/textarea.md +82 -47
- package/data/components/tieredmenu.md +34 -29
- package/data/components/timeline.md +29 -28
- package/data/components/toast.md +115 -57
- package/data/components/togglebutton.md +53 -39
- package/data/components/toggleswitch.md +41 -28
- package/data/components/toolbar.md +19 -18
- package/data/components/tooltip.md +43 -32
- package/data/components/tree.md +114 -81
- package/data/components/treeselect.md +176 -174
- package/data/components/treetable.md +1250 -1045
- package/data/components.json +4134 -4088
- package/data/llms-full.txt +8979 -6437
- package/data/llms.txt +100 -96
- package/data/manifest.json +183 -15
- package/data/pages/llms.md +29 -0
- package/data/pages/tailwind.md +20 -10
- package/data/snapshot.json +2 -2
- package/dist/index.d.mts +37 -2
- package/dist/index.mjs +1395 -1079
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -11,12 +11,13 @@ Screen Reader The container element that wraps the layout options buttons has a
|
|
|
11
11
|
DataView requires a value to display along with a list template that receives an object in the collection to return content.
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
|
-
import {
|
|
14
|
+
import { CommonModule } from '@angular/common';
|
|
15
|
+
import { Component, inject, signal } from '@angular/core';
|
|
15
16
|
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
16
17
|
import { DataViewModule } from '@exhaustive-ui/core/dataview';
|
|
17
18
|
import { TagModule } from '@exhaustive-ui/core/tag';
|
|
18
|
-
import { ProductService } from '@/service/productservice';
|
|
19
19
|
import { Product } from '@/domain/product';
|
|
20
|
+
import { ProductService } from '@/service/productservice';
|
|
20
21
|
|
|
21
22
|
@Component({
|
|
22
23
|
template: `
|
|
@@ -49,7 +50,7 @@ import { Product } from '@/domain/product';
|
|
|
49
50
|
<div class="flex flex-col md:items-end gap-8">
|
|
50
51
|
<span class="text-xl font-semibold text-surface-900 dark:text-surface-0">{{ '$' + item.price }}</span>
|
|
51
52
|
<div class="flex flex-row-reverse md:flex-row gap-2">
|
|
52
|
-
<p-button icon="pi pi-heart" [outlined]="true" />
|
|
53
|
+
<p-button icon="pi pi-heart" ariaLabel="Add to favorites" [outlined]="true" />
|
|
53
54
|
<p-button icon="pi pi-shopping-cart" class="flex-auto md:flex-initial whitespace-nowrap" label="Buy Now" [disabled]="item.inventoryStatus === 'OUTOFSTOCK'" />
|
|
54
55
|
</div>
|
|
55
56
|
</div>
|
|
@@ -62,36 +63,36 @@ import { Product } from '@/domain/product';
|
|
|
62
63
|
</div>
|
|
63
64
|
`,
|
|
64
65
|
standalone: true,
|
|
65
|
-
imports: [
|
|
66
|
+
imports: [CommonModule, DataViewModule, ButtonModule, TagModule],
|
|
66
67
|
providers: [ProductService]
|
|
67
68
|
})
|
|
68
|
-
export class DataviewBasicDemo
|
|
69
|
-
private productService = inject(ProductService);
|
|
69
|
+
export class DataviewBasicDemo {
|
|
70
70
|
products = signal<any>([]);
|
|
71
|
-
productService = inject(ProductService);
|
|
72
71
|
|
|
73
|
-
|
|
74
|
-
this.productService.getProducts().then((data) => {
|
|
75
|
-
const d = data.slice(0, 5);
|
|
76
|
-
this.products.set([...d]);
|
|
77
|
-
});
|
|
78
|
-
}
|
|
72
|
+
productService = inject(ProductService);
|
|
79
73
|
|
|
80
74
|
getSeverity(product: Product) {
|
|
81
75
|
switch (product.inventoryStatus) {
|
|
82
76
|
case 'INSTOCK':
|
|
83
77
|
return 'success';
|
|
84
|
-
|
|
78
|
+
|
|
85
79
|
case 'LOWSTOCK':
|
|
86
80
|
return 'warn';
|
|
87
|
-
|
|
81
|
+
|
|
88
82
|
case 'OUTOFSTOCK':
|
|
89
83
|
return 'danger';
|
|
90
|
-
|
|
84
|
+
|
|
91
85
|
default:
|
|
92
86
|
return null;
|
|
93
87
|
}
|
|
94
88
|
}
|
|
89
|
+
|
|
90
|
+
ngOnInit() {
|
|
91
|
+
this.productService.getProducts().then((data) => {
|
|
92
|
+
const d = data.slice(0, 5);
|
|
93
|
+
this.products.set([...d]);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
95
96
|
}
|
|
96
97
|
```
|
|
97
98
|
|
|
@@ -100,14 +101,15 @@ export class DataviewBasicDemo implements OnInit {
|
|
|
100
101
|
DataView supports list and grid display modes defined with the layout property. The grid mode is not built-in for flexibility purposes and requires a library with CSS grid features like Tailwind.
|
|
101
102
|
|
|
102
103
|
```typescript
|
|
103
|
-
import {
|
|
104
|
+
import { CommonModule } from '@angular/common';
|
|
105
|
+
import { Component, signal, inject } from '@angular/core';
|
|
104
106
|
import { FormsModule } from '@angular/forms';
|
|
107
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
105
108
|
import { DataViewModule } from '@exhaustive-ui/core/dataview';
|
|
106
109
|
import { SelectButtonModule } from '@exhaustive-ui/core/selectbutton';
|
|
107
110
|
import { TagModule } from '@exhaustive-ui/core/tag';
|
|
108
|
-
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
109
|
-
import { ProductService } from '@/service/productservice';
|
|
110
111
|
import { Product } from '@/domain/product';
|
|
112
|
+
import { ProductService } from '@/service/productservice';
|
|
111
113
|
|
|
112
114
|
@Component({
|
|
113
115
|
template: `
|
|
@@ -145,8 +147,13 @@ import { Product } from '@/domain/product';
|
|
|
145
147
|
<div class="flex flex-col md:items-end gap-8">
|
|
146
148
|
<span class="text-xl font-semibold">{{ item.price | currency: 'USD' }}</span>
|
|
147
149
|
<div class="flex flex-row-reverse md:flex-row gap-2">
|
|
148
|
-
<button pButton
|
|
149
|
-
|
|
150
|
+
<button pButton [outlined]="true" aria-label="Add to favorites">
|
|
151
|
+
<i class="pi pi-heart" pButtonIcon></i>
|
|
152
|
+
</button>
|
|
153
|
+
<button pButton [disabled]="item.inventoryStatus === 'OUTOFSTOCK'" class="flex-auto md:flex-initial whitespace-nowrap">
|
|
154
|
+
<i class="pi pi-shopping-cart" pButtonIcon></i>
|
|
155
|
+
<span pButtonLabel>Buy Now</span>
|
|
156
|
+
</button>
|
|
150
157
|
</div>
|
|
151
158
|
</div>
|
|
152
159
|
</div>
|
|
@@ -179,8 +186,13 @@ import { Product } from '@/domain/product';
|
|
|
179
186
|
<div class="flex flex-col gap-6 mt-6">
|
|
180
187
|
<span class="text-2xl font-semibold">{{ product.price | currency: 'USD' }}</span>
|
|
181
188
|
<div class="flex gap-2">
|
|
182
|
-
<button pButton
|
|
183
|
-
|
|
189
|
+
<button pButton [disabled]="product.inventoryStatus === 'OUTOFSTOCK'" class="flex-auto whitespace-nowrap">
|
|
190
|
+
<i class="pi pi-shopping-cart" pButtonIcon></i>
|
|
191
|
+
<span pButtonLabel>Buy Now</span>
|
|
192
|
+
</button>
|
|
193
|
+
<button pButton outlined aria-label="Add to favorites">
|
|
194
|
+
<i class="pi pi-heart" pButtonIcon></i>
|
|
195
|
+
</button>
|
|
184
196
|
</div>
|
|
185
197
|
</div>
|
|
186
198
|
</div>
|
|
@@ -192,13 +204,33 @@ import { Product } from '@/domain/product';
|
|
|
192
204
|
</div>
|
|
193
205
|
`,
|
|
194
206
|
standalone: true,
|
|
195
|
-
imports: [
|
|
207
|
+
imports: [CommonModule, FormsModule, DataViewModule, ButtonModule, TagModule, SelectButtonModule],
|
|
196
208
|
providers: [ProductService]
|
|
197
209
|
})
|
|
198
|
-
export class DataviewLayoutDemo
|
|
210
|
+
export class DataviewLayoutDemo {
|
|
199
211
|
private productService = inject(ProductService);
|
|
212
|
+
|
|
213
|
+
layout: 'grid' | 'list' = 'grid';
|
|
214
|
+
|
|
200
215
|
products = signal<any>([]);
|
|
201
|
-
|
|
216
|
+
|
|
217
|
+
options = ['list', 'grid'];
|
|
218
|
+
|
|
219
|
+
getSeverity(product: Product) {
|
|
220
|
+
switch (product.inventoryStatus) {
|
|
221
|
+
case 'INSTOCK':
|
|
222
|
+
return 'success';
|
|
223
|
+
|
|
224
|
+
case 'LOWSTOCK':
|
|
225
|
+
return 'warn';
|
|
226
|
+
|
|
227
|
+
case 'OUTOFSTOCK':
|
|
228
|
+
return 'danger';
|
|
229
|
+
|
|
230
|
+
default:
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
202
234
|
|
|
203
235
|
ngOnInit() {
|
|
204
236
|
this.productService.getProducts().then((data) => {
|
|
@@ -213,13 +245,15 @@ export class DataviewLayoutDemo implements OnInit {
|
|
|
213
245
|
While data is being loaded. Skeleton component may be used to indicate the busy state.
|
|
214
246
|
|
|
215
247
|
```typescript
|
|
216
|
-
import {
|
|
248
|
+
import { CommonModule } from '@angular/common';
|
|
249
|
+
import { Component, signal, inject } from '@angular/core';
|
|
217
250
|
import { FormsModule } from '@angular/forms';
|
|
251
|
+
import { RouterModule } from '@angular/router';
|
|
218
252
|
import { DataViewModule } from '@exhaustive-ui/core/dataview';
|
|
219
253
|
import { SelectButtonModule } from '@exhaustive-ui/core/selectbutton';
|
|
220
254
|
import { SkeletonModule } from '@exhaustive-ui/core/skeleton';
|
|
221
|
-
import { ProductService } from '@/service/productservice';
|
|
222
255
|
import { Product } from '@/domain/product';
|
|
256
|
+
import { ProductService } from '@/service/productservice';
|
|
223
257
|
|
|
224
258
|
@Component({
|
|
225
259
|
template: `
|
|
@@ -282,21 +316,41 @@ import { Product } from '@/domain/product';
|
|
|
282
316
|
</div>
|
|
283
317
|
`,
|
|
284
318
|
standalone: true,
|
|
285
|
-
imports: [
|
|
319
|
+
imports: [CommonModule, FormsModule, RouterModule, DataViewModule, SkeletonModule, SelectButtonModule],
|
|
286
320
|
providers: [ProductService]
|
|
287
321
|
})
|
|
288
|
-
export class DataviewLoadingDemo
|
|
322
|
+
export class DataviewLoadingDemo {
|
|
289
323
|
private productService = inject(ProductService);
|
|
324
|
+
|
|
325
|
+
layout: 'grid' | 'list' = 'grid';
|
|
326
|
+
|
|
290
327
|
products = signal<any>([]);
|
|
328
|
+
|
|
291
329
|
options: string[] = ['list', 'grid'];
|
|
292
330
|
|
|
293
|
-
|
|
294
|
-
|
|
331
|
+
getSeverity(product: Product) {
|
|
332
|
+
switch (product.inventoryStatus) {
|
|
333
|
+
case 'INSTOCK':
|
|
334
|
+
return 'success';
|
|
335
|
+
|
|
336
|
+
case 'LOWSTOCK':
|
|
337
|
+
return 'warning';
|
|
338
|
+
|
|
339
|
+
case 'OUTOFSTOCK':
|
|
340
|
+
return 'danger';
|
|
341
|
+
|
|
342
|
+
default:
|
|
343
|
+
return null;
|
|
344
|
+
}
|
|
295
345
|
}
|
|
296
346
|
|
|
297
347
|
counterArray(n: number): any[] {
|
|
298
348
|
return Array(n);
|
|
299
349
|
}
|
|
350
|
+
|
|
351
|
+
ngOnInit() {
|
|
352
|
+
this.productService.getProducts().then((data) => this.products.set([...data.slice(0, 12)]));
|
|
353
|
+
}
|
|
300
354
|
}
|
|
301
355
|
```
|
|
302
356
|
|
|
@@ -305,12 +359,14 @@ export class DataviewLoadingDemo implements OnInit {
|
|
|
305
359
|
Pagination is enabled with the paginator and rows properties. Refer to the Paginator for more information about customizing the paginator.
|
|
306
360
|
|
|
307
361
|
```typescript
|
|
308
|
-
import {
|
|
362
|
+
import { CommonModule } from '@angular/common';
|
|
363
|
+
import { Component, signal, inject } from '@angular/core';
|
|
364
|
+
import { RouterModule } from '@angular/router';
|
|
309
365
|
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
310
366
|
import { DataViewModule } from '@exhaustive-ui/core/dataview';
|
|
311
367
|
import { TagModule } from '@exhaustive-ui/core/tag';
|
|
312
|
-
import { ProductService } from '@/service/productservice';
|
|
313
368
|
import { Product } from '@/domain/product';
|
|
369
|
+
import { ProductService } from '@/service/productservice';
|
|
314
370
|
|
|
315
371
|
@Component({
|
|
316
372
|
template: `
|
|
@@ -343,7 +399,7 @@ import { Product } from '@/domain/product';
|
|
|
343
399
|
<div class="flex flex-col md:items-end gap-8">
|
|
344
400
|
<span class="text-xl font-semibold text-surface-900 dark:text-surface-0">{{ '$' + item.price }}</span>
|
|
345
401
|
<div class="flex flex-row-reverse md:flex-row gap-2">
|
|
346
|
-
<p-button icon="pi pi-heart" [outlined]="true" />
|
|
402
|
+
<p-button icon="pi pi-heart" ariaLabel="Add to favorites" [outlined]="true" />
|
|
347
403
|
<p-button icon="pi pi-shopping-cart" class="flex-auto md:flex-initial whitespace-nowrap" label="Buy Now" [disabled]="item.inventoryStatus === 'OUTOFSTOCK'" />
|
|
348
404
|
</div>
|
|
349
405
|
</div>
|
|
@@ -356,13 +412,30 @@ import { Product } from '@/domain/product';
|
|
|
356
412
|
</div>
|
|
357
413
|
`,
|
|
358
414
|
standalone: true,
|
|
359
|
-
imports: [
|
|
415
|
+
imports: [CommonModule, RouterModule, DataViewModule, ButtonModule, TagModule],
|
|
360
416
|
providers: [ProductService]
|
|
361
417
|
})
|
|
362
|
-
export class DataviewPaginationDemo
|
|
418
|
+
export class DataviewPaginationDemo {
|
|
363
419
|
private productService = inject(ProductService);
|
|
420
|
+
|
|
364
421
|
products = signal<any>([]);
|
|
365
422
|
|
|
423
|
+
getSeverity(product: Product) {
|
|
424
|
+
switch (product.inventoryStatus) {
|
|
425
|
+
case 'INSTOCK':
|
|
426
|
+
return 'success';
|
|
427
|
+
|
|
428
|
+
case 'LOWSTOCK':
|
|
429
|
+
return 'warn';
|
|
430
|
+
|
|
431
|
+
case 'OUTOFSTOCK':
|
|
432
|
+
return 'danger';
|
|
433
|
+
|
|
434
|
+
default:
|
|
435
|
+
return null;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
|
|
366
439
|
ngOnInit() {
|
|
367
440
|
this.productService.getProducts().then((data) => {
|
|
368
441
|
this.products.set(data);
|
|
@@ -376,15 +449,16 @@ export class DataviewPaginationDemo implements OnInit {
|
|
|
376
449
|
Built-in sorting is controlled by bindings sortField and sortOrder properties from a custom UI.
|
|
377
450
|
|
|
378
451
|
```typescript
|
|
379
|
-
import {
|
|
452
|
+
import { CommonModule } from '@angular/common';
|
|
453
|
+
import { Component, signal, inject } from '@angular/core';
|
|
380
454
|
import { FormsModule } from '@angular/forms';
|
|
455
|
+
import { SelectItem } from '@exhaustive-ui/core/api';
|
|
381
456
|
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
382
457
|
import { DataViewModule } from '@exhaustive-ui/core/dataview';
|
|
383
458
|
import { SelectModule } from '@exhaustive-ui/core/select';
|
|
384
459
|
import { TagModule } from '@exhaustive-ui/core/tag';
|
|
385
|
-
import { ProductService } from '@/service/productservice';
|
|
386
|
-
import { SelectItem } from '@exhaustive-ui/core/api';
|
|
387
460
|
import { Product } from '@/domain/product';
|
|
461
|
+
import { ProductService } from '@/service/productservice';
|
|
388
462
|
|
|
389
463
|
@Component({
|
|
390
464
|
template: `
|
|
@@ -422,7 +496,7 @@ import { Product } from '@/domain/product';
|
|
|
422
496
|
<div class="flex flex-col md:items-end gap-8">
|
|
423
497
|
<span class="text-xl font-semibold text-surface-900 dark:text-surface-0">{{ '$' + item.price }}</span>
|
|
424
498
|
<div class="flex flex-row-reverse md:flex-row gap-2">
|
|
425
|
-
<p-button icon="pi pi-heart" [outlined]="true" />
|
|
499
|
+
<p-button icon="pi pi-heart" ariaLabel="Add to favorites" [outlined]="true" />
|
|
426
500
|
<p-button icon="pi pi-shopping-cart" class="flex-auto md:flex-initial whitespace-nowrap" label="Buy Now" [disabled]="item.inventoryStatus === 'OUTOFSTOCK'" />
|
|
427
501
|
</div>
|
|
428
502
|
</div>
|
|
@@ -435,39 +509,58 @@ import { Product } from '@/domain/product';
|
|
|
435
509
|
</div>
|
|
436
510
|
`,
|
|
437
511
|
standalone: true,
|
|
438
|
-
imports: [
|
|
512
|
+
imports: [CommonModule, FormsModule, DataViewModule, ButtonModule, TagModule, SelectModule],
|
|
439
513
|
providers: [ProductService]
|
|
440
514
|
})
|
|
441
|
-
export class DataviewSortingDemo
|
|
515
|
+
export class DataviewSortingDemo {
|
|
442
516
|
private productService = inject(ProductService);
|
|
517
|
+
|
|
443
518
|
sortOptions!: SelectItem[];
|
|
519
|
+
|
|
520
|
+
sortKey!: string;
|
|
521
|
+
|
|
444
522
|
sortOrder!: number;
|
|
523
|
+
|
|
445
524
|
sortField!: string;
|
|
525
|
+
|
|
446
526
|
products = signal<any>([]);
|
|
447
527
|
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
528
|
+
onSortChange(event: any) {
|
|
529
|
+
let value = event.value;
|
|
530
|
+
|
|
531
|
+
if (value.indexOf('!') === 0) {
|
|
532
|
+
this.sortOrder = -1;
|
|
533
|
+
this.sortField = value.substring(1, value.length);
|
|
534
|
+
} else {
|
|
535
|
+
this.sortOrder = 1;
|
|
536
|
+
this.sortField = value;
|
|
537
|
+
}
|
|
454
538
|
}
|
|
455
539
|
|
|
456
540
|
getSeverity(product: Product) {
|
|
457
541
|
switch (product.inventoryStatus) {
|
|
458
542
|
case 'INSTOCK':
|
|
459
543
|
return 'success';
|
|
460
|
-
|
|
544
|
+
|
|
461
545
|
case 'LOWSTOCK':
|
|
462
546
|
return 'warn';
|
|
463
|
-
|
|
547
|
+
|
|
464
548
|
case 'OUTOFSTOCK':
|
|
465
549
|
return 'danger';
|
|
466
|
-
|
|
550
|
+
|
|
467
551
|
default:
|
|
468
552
|
return null;
|
|
469
553
|
}
|
|
470
554
|
}
|
|
555
|
+
|
|
556
|
+
ngOnInit() {
|
|
557
|
+
this.productService.getProducts().then((data) => this.products.set(data.slice(0, 5)));
|
|
558
|
+
|
|
559
|
+
this.sortOptions = [
|
|
560
|
+
{ label: 'Price High to Low', value: '!price' },
|
|
561
|
+
{ label: 'Price Low to High', value: 'price' }
|
|
562
|
+
];
|
|
563
|
+
}
|
|
471
564
|
}
|
|
472
565
|
```
|
|
473
566
|
|
|
@@ -479,37 +572,37 @@ DataView displays data in grid or list layout with pagination and sorting featur
|
|
|
479
572
|
|
|
480
573
|
| Name | Type | Default | Description |
|
|
481
574
|
|------|------|---------|-------------|
|
|
482
|
-
| dt |
|
|
483
|
-
| unstyled |
|
|
484
|
-
| pt |
|
|
485
|
-
| ptOptions |
|
|
486
|
-
| paginator |
|
|
487
|
-
| rows |
|
|
488
|
-
| totalRecords |
|
|
489
|
-
| pageLinks |
|
|
490
|
-
| rowsPerPageOptions |
|
|
491
|
-
| paginatorPosition |
|
|
492
|
-
| paginatorStyleClass |
|
|
493
|
-
| alwaysShowPaginator |
|
|
494
|
-
| paginatorDropdownAppendTo |
|
|
495
|
-
| paginatorDropdownScrollHeight |
|
|
496
|
-
| currentPageReportTemplate |
|
|
497
|
-
| showCurrentPageReport |
|
|
498
|
-
| showJumpToPageDropdown |
|
|
499
|
-
| showFirstLastIcon |
|
|
500
|
-
| showPageLinks |
|
|
501
|
-
| lazy |
|
|
502
|
-
| lazyLoadOnInit |
|
|
503
|
-
| emptyMessage |
|
|
504
|
-
| filterBy |
|
|
505
|
-
| filterLocale |
|
|
506
|
-
| loading |
|
|
507
|
-
| loadingIcon |
|
|
508
|
-
| first |
|
|
509
|
-
| sortField |
|
|
510
|
-
| sortOrder |
|
|
511
|
-
| value |
|
|
512
|
-
| layout |
|
|
575
|
+
| dt | Object | undefined | Defines scoped design tokens of the component. |
|
|
576
|
+
| unstyled | boolean | undefined | Indicates whether the component should be rendered without styles. |
|
|
577
|
+
| pt | DataViewPassThrough | undefined | Used to pass attributes to DOM elements inside the component. |
|
|
578
|
+
| ptOptions | PassThroughOptions | undefined | Used to configure passthrough(pt) options of the component. |
|
|
579
|
+
| paginator | boolean | - | When specified as true, enables the pagination. |
|
|
580
|
+
| rows | number | - | Number of rows to display per page. |
|
|
581
|
+
| totalRecords | number | - | Number of total records, defaults to length of value when not defined. |
|
|
582
|
+
| pageLinks | number | 5 | Number of page links to display in paginator. |
|
|
583
|
+
| rowsPerPageOptions | any[] \| number[] | - | Array of integer/object values to display inside rows per page dropdown of paginator |
|
|
584
|
+
| paginatorPosition | "top" \| "bottom" \| "both" | 'bottom' | Position of the paginator. |
|
|
585
|
+
| paginatorStyleClass | string | - | Custom style class for paginator |
|
|
586
|
+
| alwaysShowPaginator | boolean | true | Whether to show it even there is only one page. |
|
|
587
|
+
| paginatorDropdownAppendTo | any | - | Target element to attach the paginator dropdown overlay, valid values are "body" or a local ng-template variable of another element (note: use binding with brackets for template variables, e.g. [appendTo]="mydiv" for a div element having #mydiv as variable name). |
|
|
588
|
+
| paginatorDropdownScrollHeight | string | '200px' | Paginator dropdown height of the viewport in pixels, a scrollbar is defined if height of list exceeds this value. |
|
|
589
|
+
| currentPageReportTemplate | string | '{currentPage} of {totalPages}' | Template of the current page report element. Available placeholders are {currentPage},{totalPages},{rows},{first},{last} and {totalRecords} |
|
|
590
|
+
| showCurrentPageReport | boolean | - | Whether to display current page report. |
|
|
591
|
+
| showJumpToPageDropdown | boolean | - | Whether to display a dropdown to navigate to any page. |
|
|
592
|
+
| showFirstLastIcon | boolean | true | When enabled, icons are displayed on paginator to go first and last page. |
|
|
593
|
+
| showPageLinks | boolean | true | Whether to show page links. |
|
|
594
|
+
| lazy | boolean | - | Defines if data is loaded and interacted with in lazy manner. |
|
|
595
|
+
| lazyLoadOnInit | boolean | true | Whether to call lazy loading on initialization. |
|
|
596
|
+
| emptyMessage | string | '' | Text to display when there is no data. Defaults to global value in i18n translation configuration. |
|
|
597
|
+
| filterBy | string | - | Comma separated list of fields in the object graph to search against. |
|
|
598
|
+
| filterLocale | string | - | Locale to use in filtering. The default locale is the host environment's current locale. |
|
|
599
|
+
| loading | boolean | - | Displays a loader to indicate data load is in progress. |
|
|
600
|
+
| loadingIcon | string | - | The icon to show while indicating data load is in progress. |
|
|
601
|
+
| first | number | 0 | Index of the first row to be displayed. |
|
|
602
|
+
| sortField | string | - | Property name of data to use in sorting by default. |
|
|
603
|
+
| sortOrder | number | - | Order to sort the data by default. |
|
|
604
|
+
| value | any[] | - | An array of objects to display. |
|
|
605
|
+
| layout | "grid" \| "list" | 'list' | Defines the layout mode. |
|
|
513
606
|
|
|
514
607
|
### Emits
|
|
515
608
|
|