@exhaustive-ui/mcp 22.5.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.
Files changed (199) hide show
  1. package/data/cards/accordion.md +5 -2
  2. package/data/cards/animateonscroll.md +8 -5
  3. package/data/cards/autocomplete.md +8 -3
  4. package/data/cards/autofocus.md +4 -2
  5. package/data/cards/avatar.md +4 -2
  6. package/data/cards/badge.md +2 -1
  7. package/data/cards/breadcrumb.md +3 -1
  8. package/data/cards/button.md +8 -2
  9. package/data/cards/card.md +2 -1
  10. package/data/cards/carousel.md +7 -5
  11. package/data/cards/cascadeselect.md +2 -6
  12. package/data/cards/chart.md +9 -7
  13. package/data/cards/checkbox.md +4 -3
  14. package/data/cards/chip.md +2 -1
  15. package/data/cards/classnames.md +21 -3
  16. package/data/cards/colorpicker.md +2 -1
  17. package/data/cards/confirmdialog.md +35 -5
  18. package/data/cards/confirmpopup.md +25 -3
  19. package/data/cards/contextmenu.md +1 -7
  20. package/data/cards/dataview.md +28 -9
  21. package/data/cards/datepicker.md +4 -3
  22. package/data/cards/dialog.md +3 -3
  23. package/data/cards/divider.md +2 -1
  24. package/data/cards/dock.md +24 -3
  25. package/data/cards/dragdrop.md +5 -1
  26. package/data/cards/drawer.md +3 -3
  27. package/data/cards/dynamicdialog.md +41 -14
  28. package/data/cards/editor.md +1 -1
  29. package/data/cards/fieldset.md +2 -1
  30. package/data/cards/fileinput.md +1 -1
  31. package/data/cards/fileupload.md +7 -8
  32. package/data/cards/floatlabel.md +1 -1
  33. package/data/cards/fluid.md +7 -5
  34. package/data/cards/focustrap.md +6 -2
  35. package/data/cards/galleria.md +18 -25
  36. package/data/cards/iconfield.md +3 -2
  37. package/data/cards/iftalabel.md +1 -1
  38. package/data/cards/image.md +4 -2
  39. package/data/cards/imagecompare.md +4 -3
  40. package/data/cards/inplace.md +2 -1
  41. package/data/cards/inputgroup.md +14 -3
  42. package/data/cards/inputmask.md +2 -2
  43. package/data/cards/inputnumber.md +4 -3
  44. package/data/cards/inputotp.md +2 -2
  45. package/data/cards/inputtext.md +2 -2
  46. package/data/cards/keyfilter.md +2 -1
  47. package/data/cards/knob.md +3 -2
  48. package/data/cards/listbox.md +5 -3
  49. package/data/cards/megamenu.md +7 -8
  50. package/data/cards/menu.md +3 -7
  51. package/data/cards/menubar.md +3 -7
  52. package/data/cards/message.md +2 -1
  53. package/data/cards/metergroup.md +3 -7
  54. package/data/cards/multiselect.md +5 -9
  55. package/data/cards/orderlist.md +6 -4
  56. package/data/cards/organizationchart.md +33 -6
  57. package/data/cards/overlay.md +2 -1
  58. package/data/cards/paginator.md +2 -1
  59. package/data/cards/panel.md +2 -1
  60. package/data/cards/panelmenu.md +4 -13
  61. package/data/cards/password.md +6 -3
  62. package/data/cards/picklist.md +9 -5
  63. package/data/cards/popover.md +6 -5
  64. package/data/cards/progressbar.md +4 -3
  65. package/data/cards/progressspinner.md +2 -1
  66. package/data/cards/radiobutton.md +4 -3
  67. package/data/cards/rating.md +1 -1
  68. package/data/cards/ripple.md +2 -1
  69. package/data/cards/scrollpanel.md +2 -1
  70. package/data/cards/scrolltop.md +5 -3
  71. package/data/cards/select.md +2 -1
  72. package/data/cards/selectbutton.md +6 -2
  73. package/data/cards/skeleton.md +2 -1
  74. package/data/cards/slider.md +4 -3
  75. package/data/cards/speeddial.md +7 -4
  76. package/data/cards/splitbutton.md +21 -18
  77. package/data/cards/splitter.md +2 -1
  78. package/data/cards/stepper.md +8 -3
  79. package/data/cards/styleclass.md +4 -2
  80. package/data/cards/table.md +46 -11
  81. package/data/cards/tabs.md +2 -1
  82. package/data/cards/tag.md +2 -1
  83. package/data/cards/terminal.md +31 -22
  84. package/data/cards/textarea.md +3 -2
  85. package/data/cards/tieredmenu.md +1 -6
  86. package/data/cards/timeline.md +5 -5
  87. package/data/cards/toast.md +7 -8
  88. package/data/cards/togglebutton.md +1 -1
  89. package/data/cards/toggleswitch.md +4 -3
  90. package/data/cards/toolbar.md +8 -8
  91. package/data/cards/tooltip.md +2 -1
  92. package/data/cards/tree.md +3 -6
  93. package/data/cards/treeselect.md +6 -7
  94. package/data/cards/treetable.md +52 -31
  95. package/data/components/accordion.md +31 -23
  96. package/data/components/animateonscroll.md +18 -15
  97. package/data/components/autocomplete.md +162 -93
  98. package/data/components/autofocus.md +9 -7
  99. package/data/components/avatar.md +56 -43
  100. package/data/components/badge.md +27 -18
  101. package/data/components/blockui.md +15 -8
  102. package/data/components/breadcrumb.md +20 -14
  103. package/data/components/button.md +121 -94
  104. package/data/components/card.md +12 -10
  105. package/data/components/carousel.md +75 -53
  106. package/data/components/cascadeselect.md +271 -238
  107. package/data/components/chart.md +88 -74
  108. package/data/components/checkbox.md +107 -73
  109. package/data/components/chip.md +20 -16
  110. package/data/components/classnames.md +22 -4
  111. package/data/components/colorpicker.md +54 -36
  112. package/data/components/confirmdialog.md +146 -43
  113. package/data/components/confirmpopup.md +95 -22
  114. package/data/components/contextmenu.md +110 -39
  115. package/data/components/dataview.md +176 -83
  116. package/data/components/datepicker.md +171 -141
  117. package/data/components/dialog.md +80 -68
  118. package/data/components/divider.md +17 -12
  119. package/data/components/dock.md +63 -27
  120. package/data/components/dragdrop.md +26 -12
  121. package/data/components/drawer.md +67 -48
  122. package/data/components/dynamicdialog.md +22 -13
  123. package/data/components/editor.md +42 -33
  124. package/data/components/fieldset.md +20 -17
  125. package/data/components/fileinput.md +92 -35
  126. package/data/components/fileupload.md +101 -61
  127. package/data/components/floatlabel.md +20 -11
  128. package/data/components/fluid.md +11 -9
  129. package/data/components/focustrap.md +11 -7
  130. package/data/components/galleria.md +224 -83
  131. package/data/components/iconfield.md +23 -15
  132. package/data/components/iftalabel.md +15 -9
  133. package/data/components/image.md +31 -26
  134. package/data/components/imagecompare.md +8 -6
  135. package/data/components/inplace.md +27 -22
  136. package/data/components/inputgroup.md +53 -29
  137. package/data/components/inputmask.md +107 -85
  138. package/data/components/inputnumber.md +127 -89
  139. package/data/components/inputotp.md +55 -42
  140. package/data/components/inputtext.md +72 -50
  141. package/data/components/keyfilter.md +6 -3
  142. package/data/components/knob.md +70 -58
  143. package/data/components/listbox.md +171 -141
  144. package/data/components/megamenu.md +24 -23
  145. package/data/components/menu.md +37 -34
  146. package/data/components/menubar.md +27 -22
  147. package/data/components/message.md +44 -32
  148. package/data/components/metergroup.md +48 -17
  149. package/data/components/multiselect.md +232 -168
  150. package/data/components/orderlist.md +55 -48
  151. package/data/components/organizationchart.md +182 -13
  152. package/data/components/overlay.md +31 -26
  153. package/data/components/paginator.md +49 -34
  154. package/data/components/panel.md +23 -19
  155. package/data/components/panelmenu.md +51 -25
  156. package/data/components/password.md +104 -91
  157. package/data/components/picklist.md +92 -70
  158. package/data/components/popover.md +68 -46
  159. package/data/components/progressbar.md +28 -22
  160. package/data/components/progressspinner.md +13 -11
  161. package/data/components/radiobutton.md +69 -35
  162. package/data/components/rating.md +48 -40
  163. package/data/components/ripple.md +8 -6
  164. package/data/components/scroller.md +29 -29
  165. package/data/components/scrollpanel.md +9 -7
  166. package/data/components/scrolltop.md +20 -18
  167. package/data/components/select.md +248 -169
  168. package/data/components/selectbutton.md +118 -56
  169. package/data/components/skeleton.md +22 -18
  170. package/data/components/slider.md +73 -49
  171. package/data/components/speeddial.md +77 -59
  172. package/data/components/splitbutton.md +354 -329
  173. package/data/components/splitter.md +22 -18
  174. package/data/components/stepper.md +38 -21
  175. package/data/components/styleclass.md +12 -6
  176. package/data/components/table.md +523 -314
  177. package/data/components/tabs.md +44 -26
  178. package/data/components/tag.md +18 -14
  179. package/data/components/terminal.md +38 -27
  180. package/data/components/textarea.md +82 -47
  181. package/data/components/tieredmenu.md +34 -29
  182. package/data/components/timeline.md +29 -28
  183. package/data/components/toast.md +115 -57
  184. package/data/components/togglebutton.md +53 -39
  185. package/data/components/toggleswitch.md +41 -28
  186. package/data/components/toolbar.md +19 -18
  187. package/data/components/tooltip.md +43 -32
  188. package/data/components/tree.md +114 -81
  189. package/data/components/treeselect.md +176 -174
  190. package/data/components/treetable.md +1250 -1045
  191. package/data/components.json +4122 -4080
  192. package/data/llms-full.txt +8784 -6249
  193. package/data/manifest.json +154 -15
  194. package/data/pages/tailwind.md +20 -10
  195. package/data/snapshot.json +2 -2
  196. package/dist/index.d.mts +2 -0
  197. package/dist/index.mjs +3 -3
  198. package/dist/index.mjs.map +1 -1
  199. 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 { Component, OnInit, inject, signal } from '@angular/core';
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: [ButtonModule, DataViewModule, TagModule],
66
+ imports: [CommonModule, DataViewModule, ButtonModule, TagModule],
66
67
  providers: [ProductService]
67
68
  })
68
- export class DataviewBasicDemo implements OnInit {
69
- private productService = inject(ProductService);
69
+ export class DataviewBasicDemo {
70
70
  products = signal<any>([]);
71
- productService = inject(ProductService);
72
71
 
73
- ngOnInit() {
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 { Component, OnInit, inject, signal } from '@angular/core';
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 icon="pi pi-heart" [outlined]="true"></button>
149
- <button pButton icon="pi pi-shopping-cart" label="Buy Now" [disabled]="item.inventoryStatus === 'OUTOFSTOCK'" class="flex-auto md:flex-initial whitespace-nowrap"></button>
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 icon="pi pi-shopping-cart" label="Buy Now" [disabled]="product.inventoryStatus === 'OUTOFSTOCK'" class="flex-auto whitespace-nowrap"></button>
183
- <button pButton icon="pi pi-heart" outlined></button>
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: [DataViewModule, SelectButtonModule, TagModule, ButtonModule, FormsModule],
207
+ imports: [CommonModule, FormsModule, DataViewModule, ButtonModule, TagModule, SelectButtonModule],
196
208
  providers: [ProductService]
197
209
  })
198
- export class DataviewLayoutDemo implements OnInit {
210
+ export class DataviewLayoutDemo {
199
211
  private productService = inject(ProductService);
212
+
213
+ layout: 'grid' | 'list' = 'grid';
214
+
200
215
  products = signal<any>([]);
201
- options: any[] = ['list', 'grid'];
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 { Component, OnInit, inject, signal } from '@angular/core';
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: [DataViewModule, SelectButtonModule, SkeletonModule, FormsModule],
319
+ imports: [CommonModule, FormsModule, RouterModule, DataViewModule, SkeletonModule, SelectButtonModule],
286
320
  providers: [ProductService]
287
321
  })
288
- export class DataviewLoadingDemo implements OnInit {
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
- ngOnInit() {
294
- this.productService.getProducts().then((data) => this.products.set([...data.slice(0, 12)]));
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 { Component, OnInit, inject, signal } from '@angular/core';
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: [ButtonModule, DataViewModule, TagModule],
415
+ imports: [CommonModule, RouterModule, DataViewModule, ButtonModule, TagModule],
360
416
  providers: [ProductService]
361
417
  })
362
- export class DataviewPaginationDemo implements OnInit {
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 { Component, OnInit, inject, signal } from '@angular/core';
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: [ButtonModule, DataViewModule, SelectModule, TagModule, FormsModule],
512
+ imports: [CommonModule, FormsModule, DataViewModule, ButtonModule, TagModule, SelectModule],
439
513
  providers: [ProductService]
440
514
  })
441
- export class DataviewSortingDemo implements OnInit {
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
- ngOnInit() {
449
- this.productService.getProducts().then((data) => this.products.set(data.slice(0, 5)));
450
- this.sortOptions = [
451
- { label: 'Price High to Low', value: '!price' },
452
- { label: 'Price Low to High', value: 'price' }
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 | InputSignal<Object> | undefined | Defines scoped design tokens of the component. |
483
- | unstyled | InputSignal<boolean> | undefined | Indicates whether the component should be rendered without styles. |
484
- | pt | InputSignal<DataViewPassThrough> | undefined | Used to pass attributes to DOM elements inside the component. |
485
- | ptOptions | InputSignal<PassThroughOptions> | undefined | Used to configure passthrough(pt) options of the component. |
486
- | paginator | InputSignalWithTransform<boolean, unknown> | ... | When specified as true, enables the pagination. |
487
- | rows | InputSignalWithTransform<number, unknown> | ... | Number of rows to display per page. |
488
- | totalRecords | InputSignalWithTransform<number, unknown> | ... | Number of total records, defaults to length of value when not defined. |
489
- | pageLinks | InputSignalWithTransform<number, unknown> | ... | Number of page links to display in paginator. |
490
- | rowsPerPageOptions | InputSignal<any[] \| number[]> | ... | Array of integer/object values to display inside rows per page dropdown of paginator |
491
- | paginatorPosition | InputSignal<"top" \| "bottom" \| "both"> | ... | Position of the paginator. |
492
- | paginatorStyleClass | InputSignal<string> | ... | Custom style class for paginator |
493
- | alwaysShowPaginator | InputSignalWithTransform<boolean, unknown> | ... | Whether to show it even there is only one page. |
494
- | paginatorDropdownAppendTo | InputSignal<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). |
495
- | paginatorDropdownScrollHeight | InputSignal<string> | ... | Paginator dropdown height of the viewport in pixels, a scrollbar is defined if height of list exceeds this value. |
496
- | currentPageReportTemplate | InputSignal<string> | ... | Template of the current page report element. Available placeholders are {currentPage},{totalPages},{rows},{first},{last} and {totalRecords} |
497
- | showCurrentPageReport | InputSignalWithTransform<boolean, unknown> | ... | Whether to display current page report. |
498
- | showJumpToPageDropdown | InputSignalWithTransform<boolean, unknown> | ... | Whether to display a dropdown to navigate to any page. |
499
- | showFirstLastIcon | InputSignalWithTransform<boolean, unknown> | ... | When enabled, icons are displayed on paginator to go first and last page. |
500
- | showPageLinks | InputSignalWithTransform<boolean, unknown> | ... | Whether to show page links. |
501
- | lazy | InputSignalWithTransform<boolean, unknown> | ... | Defines if data is loaded and interacted with in lazy manner. |
502
- | lazyLoadOnInit | InputSignalWithTransform<boolean, unknown> | ... | Whether to call lazy loading on initialization. |
503
- | emptyMessage | InputSignal<string> | ... | Text to display when there is no data. Defaults to global value in i18n translation configuration. |
504
- | filterBy | InputSignal<string> | ... | Comma separated list of fields in the object graph to search against. |
505
- | filterLocale | InputSignal<string> | ... | Locale to use in filtering. The default locale is the host environment's current locale. |
506
- | loading | InputSignalWithTransform<boolean, unknown> | ... | Displays a loader to indicate data load is in progress. |
507
- | loadingIcon | InputSignal<string> | ... | The icon to show while indicating data load is in progress. |
508
- | first | InputSignalWithTransform<number, unknown> | ... | Index of the first row to be displayed. |
509
- | sortField | InputSignal<string> | ... | Property name of data to use in sorting by default. |
510
- | sortOrder | InputSignalWithTransform<number, unknown> | ... | Order to sort the data by default. |
511
- | value | InputSignal<any[]> | ... | An array of objects to display. |
512
- | layout | InputSignal<"grid" \| "list"> | ... | Defines the layout mode. |
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