@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,34 +11,36 @@ Screen Reader Default role of the table is table . Header, body and footer eleme
11
11
  TreeTable requires a collection of TreeNode instances as a value components as children for the representation.
12
12
 
13
13
  ```typescript
14
- import { Component, OnInit, inject } from '@angular/core';
14
+ import { Component, inject, OnInit } from '@angular/core';
15
+ import { TreeNode } from '@exhaustive-ui/core/api';
15
16
  import { TreeTableModule } from '@exhaustive-ui/core/treetable';
16
17
  import { NodeService } from '@/service/nodeservice';
17
- import { TreeNode } from '@exhaustive-ui/core/api';
18
18
 
19
19
  @Component({
20
20
  template: `
21
- <p-tree-table [value]="files" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
22
- <ng-template #header>
23
- <tr>
24
- <th>Name</th>
25
- <th>Size</th>
26
- <th>Type</th>
27
- </tr>
28
- </ng-template>
29
- <ng-template #body let-rowNode let-rowData="rowData">
30
- <tr [ttRow]="rowNode">
31
- <td>
32
- <div class="flex items-center gap-2">
33
- <p-tree-table-toggler [rowNode]="rowNode" />
34
- <span>{{ rowData.name }}</span>
35
- </div>
36
- </td>
37
- <td>{{ rowData.size }}</td>
38
- <td>{{ rowData.type }}</td>
39
- </tr>
40
- </ng-template>
41
- </p-tree-table>
21
+ <div class="card">
22
+ <p-tree-table [value]="files" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
23
+ <ng-template #header>
24
+ <tr>
25
+ <th>Name</th>
26
+ <th>Size</th>
27
+ <th>Type</th>
28
+ </tr>
29
+ </ng-template>
30
+ <ng-template #body let-rowNode let-rowData="rowData">
31
+ <tr [ttRow]="rowNode">
32
+ <td>
33
+ <div class="flex items-center gap-2">
34
+ <p-tree-table-toggler [rowNode]="rowNode" />
35
+ <span>{{ rowData.name }}</span>
36
+ </div>
37
+ </td>
38
+ <td>{{ rowData.size }}</td>
39
+ <td>{{ rowData.type }}</td>
40
+ </tr>
41
+ </ng-template>
42
+ </p-tree-table>
43
+ </div>
42
44
  `,
43
45
  standalone: true,
44
46
  imports: [TreeTableModule],
@@ -46,6 +48,7 @@ import { TreeNode } from '@exhaustive-ui/core/api';
46
48
  })
47
49
  export class TreetableBasicDemo implements OnInit {
48
50
  private nodeService = inject(NodeService);
51
+
49
52
  files!: TreeNode[];
50
53
 
51
54
  ngOnInit() {
@@ -58,51 +61,52 @@ export class TreetableBasicDemo implements OnInit {
58
61
 
59
62
  ```typescript
60
63
  import { Component, OnInit } from '@angular/core';
61
- import { TreeTableModule } from '@exhaustive-ui/core/treetable';
62
64
  import { TreeNode } from '@exhaustive-ui/core/api';
63
- import { Product } from '@/domain/product';
65
+ import { TreeTableModule } from '@exhaustive-ui/core/treetable';
64
66
 
65
67
  @Component({
66
68
  template: `
67
- <p-tree-table [value]="sales" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
68
- <ng-template #header>
69
- <tr>
70
- <th rowspan="3">Brand</th>
71
- <th colspan="4">Sale Rate</th>
72
- </tr>
73
- <tr>
74
- <th colspan="2">Sales</th>
75
- <th colspan="2">Profits</th>
76
- </tr>
77
- <tr>
78
- <th>Last Year</th>
79
- <th>This Year</th>
80
- <th>Last Year</th>
81
- <th>This Year</th>
82
- </tr>
83
- </ng-template>
84
- <ng-template #body let-rowNode let-rowData="rowData">
85
- <tr [ttRow]="rowNode">
86
- <td>
87
- <div class="flex items-center gap-2">
88
- <p-tree-table-toggler [rowNode]="rowNode" />
89
- <span>{{ rowData.brand }}</span>
90
- </div>
91
- </td>
92
- <td>{{ rowData.lastYearSale }}</td>
93
- <td>{{ rowData.thisYearSale }}</td>
94
- <td>{{ rowData.lastYearProfit }}</td>
95
- <td>{{ rowData.thisYearProfit }}</td>
96
- </tr>
97
- </ng-template>
98
- <ng-template #footer>
99
- <tr>
100
- <td colspan="3">Totals</td>
101
- <td>$3,283,772</td>
102
- <td>$2,126,925</td>
103
- </tr>
104
- </ng-template>
105
- </p-tree-table>
69
+ <div class="card">
70
+ <p-tree-table [value]="sales" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
71
+ <ng-template #header>
72
+ <tr>
73
+ <th rowspan="3">Brand</th>
74
+ <th colspan="4">Sale Rate</th>
75
+ </tr>
76
+ <tr>
77
+ <th colspan="2">Sales</th>
78
+ <th colspan="2">Profits</th>
79
+ </tr>
80
+ <tr>
81
+ <th>Last Year</th>
82
+ <th>This Year</th>
83
+ <th>Last Year</th>
84
+ <th>This Year</th>
85
+ </tr>
86
+ </ng-template>
87
+ <ng-template #body let-rowNode let-rowData="rowData">
88
+ <tr [ttRow]="rowNode">
89
+ <td>
90
+ <div class="flex items-center gap-2">
91
+ <p-tree-table-toggler [rowNode]="rowNode" />
92
+ <span>{{ rowData.brand }}</span>
93
+ </div>
94
+ </td>
95
+ <td>{{ rowData.lastYearSale }}</td>
96
+ <td>{{ rowData.thisYearSale }}</td>
97
+ <td>{{ rowData.lastYearProfit }}</td>
98
+ <td>{{ rowData.thisYearProfit }}</td>
99
+ </tr>
100
+ </ng-template>
101
+ <ng-template #footer>
102
+ <tr>
103
+ <td colspan="3">Totals</td>
104
+ <td>$3,283,772</td>
105
+ <td>$2,126,925</td>
106
+ </tr>
107
+ </ng-template>
108
+ </p-tree-table>
109
+ </div>
106
110
  `,
107
111
  standalone: true,
108
112
  imports: [TreeTableModule]
@@ -372,10 +376,11 @@ export class TreetableColumngroupDemo implements OnInit {
372
376
  Setting columnResizeMode as expand changes the table width as well.
373
377
 
374
378
  ```typescript
375
- import { Component, OnInit, inject } from '@angular/core';
379
+ import { CommonModule } from '@angular/common';
380
+ import { Component, inject, OnInit } from '@angular/core';
381
+ import { TreeNode } from '@exhaustive-ui/core/api';
376
382
  import { TreeTableModule } from '@exhaustive-ui/core/treetable';
377
383
  import { NodeService } from '@/service/nodeservice';
378
- import { TreeNode } from '@exhaustive-ui/core/api';
379
384
 
380
385
  interface Column {
381
386
  field: string;
@@ -384,41 +389,45 @@ interface Column {
384
389
 
385
390
  @Component({
386
391
  template: `
387
- <p-tree-table [value]="files" [columns]="cols" [resizableColumns]="true" columnResizeMode="expand" showGridlines>
388
- <ng-template #header let-columns>
389
- <tr>
390
- @for (col of columns; track col) {
391
- <th ttResizableColumn>
392
- {{ col.header }}
393
- </th>
394
- }
395
- </tr>
396
- </ng-template>
397
- <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
398
- <tr [ttRow]="rowNode">
399
- @for (col of columns; let first = $first; track col) {
400
- <td>
401
- @if (first) {
402
- <div class="flex items-center gap-2">
403
- <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
404
- <span>{{ rowData[col.field] }}</span>
405
- </div>
406
- } @else {
407
- {{ rowData[col.field] }}
408
- }
409
- </td>
410
- }
411
- </tr>
412
- </ng-template>
413
- </p-tree-table>
392
+ <div class="card">
393
+ <p-tree-table [value]="files" [columns]="cols" [resizableColumns]="true" columnResizeMode="expand" showGridlines>
394
+ <ng-template #header let-columns>
395
+ <tr>
396
+ @for (col of columns; track col) {
397
+ <th ttResizableColumn>
398
+ {{ col.header }}
399
+ </th>
400
+ }
401
+ </tr>
402
+ </ng-template>
403
+ <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
404
+ <tr [ttRow]="rowNode">
405
+ @for (col of columns; let first = $first; track col) {
406
+ <td>
407
+ @if (first) {
408
+ <div class="flex items-center gap-2">
409
+ <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
410
+ <span>{{ rowData[col.field] }}</span>
411
+ </div>
412
+ } @else {
413
+ {{ rowData[col.field] }}
414
+ }
415
+ </td>
416
+ }
417
+ </tr>
418
+ </ng-template>
419
+ </p-tree-table>
420
+ </div>
414
421
  `,
415
422
  standalone: true,
416
- imports: [TreeTableModule],
423
+ imports: [CommonModule, TreeTableModule],
417
424
  providers: [NodeService]
418
425
  })
419
426
  export class TreetableColumnresizeexpandDemo implements OnInit {
420
427
  private nodeService = inject(NodeService);
428
+
421
429
  files!: TreeNode[];
430
+
422
431
  cols!: Column[];
423
432
 
424
433
  ngOnInit() {
@@ -437,10 +446,11 @@ export class TreetableColumnresizeexpandDemo implements OnInit {
437
446
  Columns can be resized with drag and drop when resizableColumns is enabled. Default resize mode is fit that does not change the overall table width.
438
447
 
439
448
  ```typescript
440
- import { Component, OnInit, inject } from '@angular/core';
449
+ import { CommonModule } from '@angular/common';
450
+ import { Component, inject, OnInit } from '@angular/core';
451
+ import { TreeNode } from '@exhaustive-ui/core/api';
441
452
  import { TreeTableModule } from '@exhaustive-ui/core/treetable';
442
453
  import { NodeService } from '@/service/nodeservice';
443
- import { TreeNode } from '@exhaustive-ui/core/api';
444
454
 
445
455
  interface Column {
446
456
  field: string;
@@ -449,41 +459,45 @@ interface Column {
449
459
 
450
460
  @Component({
451
461
  template: `
452
- <p-tree-table [value]="files" [columns]="cols" [resizableColumns]="true" [tableStyle]="{ 'min-width': '50rem' }" showGridlines>
453
- <ng-template #header let-columns>
454
- <tr>
455
- @for (col of columns; track col) {
456
- <th ttResizableColumn>
457
- {{ col.header }}
458
- </th>
459
- }
460
- </tr>
461
- </ng-template>
462
- <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
463
- <tr [ttRow]="rowNode">
464
- @for (col of columns; let first = $first; track col) {
465
- <td>
466
- @if (first) {
467
- <div class="flex items-center gap-2">
468
- <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
469
- <span>{{ rowData[col.field] }}</span>
470
- </div>
471
- } @else {
472
- {{ rowData[col.field] }}
473
- }
474
- </td>
475
- }
476
- </tr>
477
- </ng-template>
478
- </p-tree-table>
462
+ <div class="card">
463
+ <p-tree-table [value]="files" [columns]="cols" [resizableColumns]="true" [tableStyle]="{ 'min-width': '50rem' }" showGridlines>
464
+ <ng-template #header let-columns>
465
+ <tr>
466
+ @for (col of columns; track col) {
467
+ <th ttResizableColumn>
468
+ {{ col.header }}
469
+ </th>
470
+ }
471
+ </tr>
472
+ </ng-template>
473
+ <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
474
+ <tr [ttRow]="rowNode">
475
+ @for (col of columns; let first = $first; track col) {
476
+ <td>
477
+ @if (first) {
478
+ <div class="flex items-center gap-2">
479
+ <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
480
+ <span>{{ rowData[col.field] }}</span>
481
+ </div>
482
+ } @else {
483
+ {{ rowData[col.field] }}
484
+ }
485
+ </td>
486
+ }
487
+ </tr>
488
+ </ng-template>
489
+ </p-tree-table>
490
+ </div>
479
491
  `,
480
492
  standalone: true,
481
- imports: [TreeTableModule],
493
+ imports: [CommonModule, TreeTableModule],
482
494
  providers: [NodeService]
483
495
  })
484
496
  export class TreetableColumnresizefitDemo implements OnInit {
485
497
  private nodeService = inject(NodeService);
498
+
486
499
  files!: TreeNode[];
500
+
487
501
  cols!: Column[];
488
502
 
489
503
  ngOnInit() {
@@ -502,11 +516,11 @@ export class TreetableColumnresizefitDemo implements OnInit {
502
516
  To utilize the column resize modes with a scrollable TreeTable, a colgroup template must be defined. The default value of scrollHeight is "flex," it can also be set as a string value.
503
517
 
504
518
  ```typescript
505
- import { Component, OnInit, inject } from '@angular/core';
506
- import { TreeTable, TreeTableModule } from '@exhaustive-ui/core/treetable';
507
- import { NodeService } from '@/service/nodeservice';
519
+ import { CommonModule } from '@angular/common';
520
+ import { Component, inject, OnInit } from '@angular/core';
508
521
  import { TreeNode } from '@exhaustive-ui/core/api';
509
- import { TreeTable } from '@exhaustive-ui/core/treetable';
522
+ import { TreeTableModule } from '@exhaustive-ui/core/treetable';
523
+ import { NodeService } from '@/service/nodeservice';
510
524
 
511
525
  interface Column {
512
526
  field: string;
@@ -515,48 +529,52 @@ interface Column {
515
529
 
516
530
  @Component({
517
531
  template: `
518
- <p-tree-table [value]="files" [columns]="cols" [resizableColumns]="true" [scrollable]="true" scrollHeight="200px" [tableStyle]="{ 'min-width': '50rem' }" showGridlines>
519
- <ng-template #colgroup let-columns>
520
- <colgroup>
521
- @for (col of columns; track col) {
522
- <col />
523
- }
524
- </colgroup>
525
- </ng-template>
526
- <ng-template #header let-columns>
527
- <tr>
528
- @for (col of columns; track col) {
529
- <th ttResizableColumn>
530
- {{ col.header }}
531
- </th>
532
- }
533
- </tr>
534
- </ng-template>
535
- <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
536
- <tr [ttRow]="rowNode">
537
- @for (col of columns; let first = $first; track col) {
538
- <td>
539
- @if (first) {
540
- <div class="flex items-center gap-2">
541
- <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
542
- <span>{{ rowData[col.field] }}</span>
543
- </div>
544
- } @else {
545
- {{ rowData[col.field] }}
546
- }
547
- </td>
548
- }
549
- </tr>
550
- </ng-template>
551
- </p-tree-table>
532
+ <div class="card">
533
+ <p-tree-table [value]="files" [columns]="cols" [resizableColumns]="true" [scrollable]="true" scrollHeight="200px" [tableStyle]="{ 'min-width': '50rem' }" showGridlines>
534
+ <ng-template #colgroup let-columns>
535
+ <colgroup>
536
+ @for (col of columns; track col) {
537
+ <col />
538
+ }
539
+ </colgroup>
540
+ </ng-template>
541
+ <ng-template #header let-columns>
542
+ <tr>
543
+ @for (col of columns; track col) {
544
+ <th ttResizableColumn>
545
+ {{ col.header }}
546
+ </th>
547
+ }
548
+ </tr>
549
+ </ng-template>
550
+ <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
551
+ <tr [ttRow]="rowNode">
552
+ @for (col of columns; let first = $first; track col) {
553
+ <td>
554
+ @if (first) {
555
+ <div class="flex items-center gap-2">
556
+ <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
557
+ <span>{{ rowData[col.field] }}</span>
558
+ </div>
559
+ } @else {
560
+ {{ rowData[col.field] }}
561
+ }
562
+ </td>
563
+ }
564
+ </tr>
565
+ </ng-template>
566
+ </p-tree-table>
567
+ </div>
552
568
  `,
553
569
  standalone: true,
554
- imports: [TreeTableModule],
570
+ imports: [CommonModule, TreeTableModule],
555
571
  providers: [NodeService]
556
572
  })
557
573
  export class TreetableColumnresizescrollableDemo implements OnInit {
558
574
  private nodeService = inject(NodeService);
575
+
559
576
  files!: TreeNode[];
577
+
560
578
  cols!: Column[];
561
579
 
562
580
  ngOnInit() {
@@ -575,12 +593,13 @@ export class TreetableColumnresizescrollableDemo implements OnInit {
575
593
  Column visibility based on a condition can be implemented with dynamic columns, in this sample a MultiSelect is used to manage the visible columns.
576
594
 
577
595
  ```typescript
578
- import { Component, OnInit, inject } from '@angular/core';
596
+ import { CommonModule } from '@angular/common';
597
+ import { Component, inject, OnInit } from '@angular/core';
579
598
  import { FormsModule } from '@angular/forms';
599
+ import { TreeNode } from '@exhaustive-ui/core/api';
580
600
  import { MultiSelectModule } from '@exhaustive-ui/core/multiselect';
581
601
  import { TreeTableModule } from '@exhaustive-ui/core/treetable';
582
602
  import { NodeService } from '@/service/nodeservice';
583
- import { TreeNode } from '@exhaustive-ui/core/api';
584
603
 
585
604
  interface Column {
586
605
  field: string;
@@ -589,56 +608,63 @@ interface Column {
589
608
 
590
609
  @Component({
591
610
  template: `
592
- <p-tree-table [value]="files" [columns]="selectedColumns" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
593
- <ng-template #caption>
594
- <div style="text-align:left">
595
- <p-multi-select [options]="cols" [(ngModel)]="selectedColumns" optionLabel="header" selectedItemsLabel="{0} columns selected" [style]="{ width: '20em' }" placeholder="Choose Columns" display="chip" />
596
- </div>
597
- </ng-template>
598
- <ng-template #header let-columns>
599
- <tr>
600
- @for (col of columns; track col) {
601
- <th>
602
- {{ col.header }}
603
- </th>
604
- }
605
- </tr>
606
- </ng-template>
607
- <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
608
- <tr [ttRow]="rowNode">
609
- @for (col of columns; let first = $first; track col) {
610
- <td>
611
- @if (first) {
612
- <div class="flex items-center gap-2">
613
- <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
614
- <span>{{ rowData[col.field] }}</span>
615
- </div>
616
- } @else {
617
- {{ rowData[col.field] }}
618
- }
619
- </td>
620
- }
621
- </tr>
622
- </ng-template>
623
- </p-tree-table>
611
+ <div class="card">
612
+ <p-tree-table [value]="files" [columns]="selectedColumns" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
613
+ <ng-template #caption>
614
+ <div style="text-align:left">
615
+ <p-multi-select [options]="cols" [(ngModel)]="selectedColumns" optionLabel="header" selectedItemsLabel="{0} columns selected" [style]="{ width: '20em' }" placeholder="Choose Columns" display="chip" />
616
+ </div>
617
+ </ng-template>
618
+ <ng-template #header let-columns>
619
+ <tr>
620
+ @for (col of columns; track col) {
621
+ <th>
622
+ {{ col.header }}
623
+ </th>
624
+ }
625
+ </tr>
626
+ </ng-template>
627
+ <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
628
+ <tr [ttRow]="rowNode">
629
+ @for (col of columns; let first = $first; track col) {
630
+ <td>
631
+ @if (first) {
632
+ <div class="flex items-center gap-2">
633
+ <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
634
+ <span>{{ rowData[col.field] }}</span>
635
+ </div>
636
+ } @else {
637
+ {{ rowData[col.field] }}
638
+ }
639
+ </td>
640
+ }
641
+ </tr>
642
+ </ng-template>
643
+ </p-tree-table>
644
+ </div>
624
645
  `,
625
646
  standalone: true,
626
- imports: [MultiSelectModule, TreeTableModule, FormsModule],
647
+ imports: [CommonModule, FormsModule, TreeTableModule, MultiSelectModule],
627
648
  providers: [NodeService]
628
649
  })
629
650
  export class TreetableColumntoggleDemo implements OnInit {
630
651
  private nodeService = inject(NodeService);
652
+
631
653
  files!: TreeNode[];
654
+
632
655
  cols!: Column[];
656
+
633
657
  selectedColumns!: Column[];
634
658
 
635
659
  ngOnInit() {
636
660
  this.nodeService.getFilesystem().then((files) => (this.files = files));
661
+
637
662
  this.cols = [
638
663
  { field: 'name', header: 'Name' },
639
664
  { field: 'size', header: 'Size' },
640
665
  { field: 'type', header: 'Type' }
641
666
  ];
667
+
642
668
  this.selectedColumns = this.cols;
643
669
  }
644
670
  }
@@ -649,10 +675,11 @@ export class TreetableColumntoggleDemo implements OnInit {
649
675
  Particular rows and cells can be styled based on conditions. The ngClass receives a row data as a parameter to return a style class for a row whereas cells are customized using the body template.
650
676
 
651
677
  ```typescript
652
- import { Component, OnInit, inject } from '@angular/core';
678
+ import { CommonModule } from '@angular/common';
679
+ import { Component, inject, OnInit } from '@angular/core';
680
+ import { TreeNode } from '@exhaustive-ui/core/api';
653
681
  import { TreeTableModule } from '@exhaustive-ui/core/treetable';
654
682
  import { NodeService } from '@/service/nodeservice';
655
- import { TreeNode } from '@exhaustive-ui/core/api';
656
683
 
657
684
  interface Column {
658
685
  field: string;
@@ -661,44 +688,48 @@ interface Column {
661
688
 
662
689
  @Component({
663
690
  template: `
664
- <p-tree-table [value]="files" [columns]="cols" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
665
- <ng-template #header let-columns>
666
- <tr>
667
- @for (col of columns; track col) {
668
- <th>
669
- {{ col.header }}
670
- </th>
671
- }
672
- </tr>
673
- </ng-template>
674
- <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
675
- <tr [ttRow]="rowNode" [ngClass]="{ 'bg-surface-100! dark:bg-surface-800!': rowData.size.endsWith('kb') }">
676
- @for (col of columns; let first = $first; track col) {
677
- <td [class]="{ 'line-through': col.field === 'size' && rowData.size.endsWith('kb') }">
678
- @if (first) {
679
- <div class="flex items-center gap-2">
680
- <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
681
- <span>{{ rowData[col.field] }}</span>
682
- </div>
683
- } @else {
684
- {{ rowData[col.field] }}
685
- }
686
- </td>
687
- }
688
- </tr>
689
- </ng-template>
690
- </p-tree-table>
691
- `,
692
- standalone: true,
693
- imports: [TreeTableModule],
694
- providers: [NodeService]
695
- })
696
- export class TreetableConditionalstyleDemo implements OnInit {
697
- private nodeService = inject(NodeService);
698
- files!: TreeNode[];
699
- cols!: Column[];
700
-
701
- ngOnInit() {
691
+ <div class="card">
692
+ <p-tree-table [value]="files" [columns]="cols" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
693
+ <ng-template #header let-columns>
694
+ <tr>
695
+ @for (col of columns; track col) {
696
+ <th>
697
+ {{ col.header }}
698
+ </th>
699
+ }
700
+ </tr>
701
+ </ng-template>
702
+ <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
703
+ <tr [ttRow]="rowNode" [ngClass]="{ 'bg-surface-100! dark:bg-surface-800!': rowData.size.endsWith('kb') }">
704
+ @for (col of columns; let first = $first; track col) {
705
+ <td [class]="{ 'line-through': col.field === 'size' && rowData.size.endsWith('kb') }">
706
+ @if (first) {
707
+ <div class="flex items-center gap-2">
708
+ <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
709
+ <span>{{ rowData[col.field] }}</span>
710
+ </div>
711
+ } @else {
712
+ {{ rowData[col.field] }}
713
+ }
714
+ </td>
715
+ }
716
+ </tr>
717
+ </ng-template>
718
+ </p-tree-table>
719
+ </div>
720
+ `,
721
+ standalone: true,
722
+ imports: [CommonModule, TreeTableModule],
723
+ providers: [NodeService]
724
+ })
725
+ export class TreetableConditionalstyleDemo implements OnInit {
726
+ private nodeService = inject(NodeService);
727
+
728
+ files!: TreeNode[];
729
+
730
+ cols!: Column[];
731
+
732
+ ngOnInit() {
702
733
  this.nodeService.getFilesystem().then((files) => (this.files = files));
703
734
  this.cols = [
704
735
  { field: 'name', header: 'Name' },
@@ -714,11 +745,13 @@ export class TreetableConditionalstyleDemo implements OnInit {
714
745
  TreeTable has exclusive integration with contextmenu component. In order to attach a menu to a table, add ttContextMenuRow directive to the rows that can be selected with context menu, define a local template variable for the menu and bind it to the contextMenu property of the table. This enables displaying the menu whenever a row is right clicked. A separate contextMenuSelection property is used to get a hold of the right clicked row. For dynamic columns, setting ttContextMenuRowDisabled property as true disables context menu for that particular row.
715
746
 
716
747
  ```typescript
717
- import { Component, OnInit, inject } from '@angular/core';
718
- import { TreeTable, TreeTableModule } from '@exhaustive-ui/core/treetable';
748
+ import { CommonModule } from '@angular/common';
749
+ import { Component, inject, OnInit } from '@angular/core';
750
+ import { MenuItem, MessageService, TreeNode } from '@exhaustive-ui/core/api';
751
+ import { ContextMenuModule } from '@exhaustive-ui/core/contextmenu';
752
+ import { ToastModule } from '@exhaustive-ui/core/toast';
753
+ import { TreeTableModule } from '@exhaustive-ui/core/treetable';
719
754
  import { NodeService } from '@/service/nodeservice';
720
- import { TreeNode, MenuItem, MessageService } from '@exhaustive-ui/core/api';
721
- import { TreeTable } from '@exhaustive-ui/core/treetable';
722
755
 
723
756
  interface Column {
724
757
  field: string;
@@ -727,53 +760,63 @@ interface Column {
727
760
 
728
761
  @Component({
729
762
  template: `
730
- <p-tree-table [value]="files" [columns]="cols" dataKey="name" [(contextMenuSelection)]="selectedNode" [contextMenu]="cm" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
731
- <ng-template #header let-columns>
732
- <tr>
733
- @for (col of columns; track col) {
734
- <th>
735
- {{ col.header }}
736
- </th>
737
- }
738
- </tr>
739
- </ng-template>
740
- <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
741
- <tr [ttRow]="rowNode" [ttContextMenuRow]="rowNode">
742
- @for (col of columns; let first = $first; track col) {
743
- <td>
744
- @if (first) {
745
- <div class="flex items-center gap-2">
746
- <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
747
- <span>{{ rowData[col.field] }}</span>
748
- </div>
749
- } @else {
750
- {{ rowData[col.field] }}
751
- }
752
- </td>
753
- }
754
- </tr>
755
- </ng-template>
756
- </p-tree-table>
763
+ <div class="card">
764
+ <p-toast [style]="{ marginTop: '80px' }" />
765
+ <p-tree-table [value]="files" [columns]="cols" dataKey="name" [(contextMenuSelection)]="selectedNode" [contextMenu]="cm" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
766
+ <ng-template #header let-columns>
767
+ <tr>
768
+ @for (col of columns; track col) {
769
+ <th>
770
+ {{ col.header }}
771
+ </th>
772
+ }
773
+ </tr>
774
+ </ng-template>
775
+ <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
776
+ <tr [ttRow]="rowNode" [ttContextMenuRow]="rowNode">
777
+ @for (col of columns; let first = $first; track col) {
778
+ <td>
779
+ @if (first) {
780
+ <div class="flex items-center gap-2">
781
+ <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
782
+ <span>{{ rowData[col.field] }}</span>
783
+ </div>
784
+ } @else {
785
+ {{ rowData[col.field] }}
786
+ }
787
+ </td>
788
+ }
789
+ </tr>
790
+ </ng-template>
791
+ </p-tree-table>
792
+ <p-context-menu #cm [model]="items" />
793
+ </div>
757
794
  `,
758
795
  standalone: true,
759
- imports: [TreeTableModule],
760
- providers: [NodeService, MessageService]
796
+ imports: [CommonModule, TreeTableModule, ToastModule, ContextMenuModule],
797
+ providers: [MessageService, NodeService]
761
798
  })
762
799
  export class TreetableContextmenuDemo implements OnInit {
763
800
  private nodeService = inject(NodeService);
764
801
  private messageService = inject(MessageService);
802
+
765
803
  files!: TreeNode[];
804
+
766
805
  selectedNode!: TreeNode;
806
+
767
807
  cols!: Column[];
808
+
768
809
  items!: MenuItem[];
769
810
 
770
811
  ngOnInit() {
771
812
  this.nodeService.getFilesystem().then((files) => (this.files = files));
813
+
772
814
  this.cols = [
773
815
  { field: 'name', header: 'Name' },
774
816
  { field: 'size', header: 'Size' },
775
817
  { field: 'type', header: 'Type' }
776
818
  ];
819
+
777
820
  this.items = [
778
821
  { label: 'View', icon: 'pi pi-search', command: (event) => this.viewFile(this.selectedNode) },
779
822
  { label: 'Toggle', icon: 'pi pi-sort', command: (event) => this.toggleFile(this.selectedNode) }
@@ -793,44 +836,49 @@ export class TreetableContextmenuDemo implements OnInit {
793
836
 
794
837
  ## Controlled
795
838
 
796
- Expansion state is controlled with expandedKeys property.
839
+ Expansion state is controlled with the expanded property of the nodes.
797
840
 
798
841
  ```typescript
799
- import { Component, OnInit, inject } from '@angular/core';
842
+ import { Component, inject, OnInit } from '@angular/core';
843
+ import { TreeNode } from '@exhaustive-ui/core/api';
844
+ import { ButtonModule } from '@exhaustive-ui/core/button';
800
845
  import { TreeTableModule } from '@exhaustive-ui/core/treetable';
801
846
  import { NodeService } from '@/service/nodeservice';
802
- import { TreeNode } from '@exhaustive-ui/core/api';
803
847
 
804
848
  @Component({
805
849
  template: `
806
- <p-tree-table [value]="files" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
807
- <ng-template #header>
808
- <tr>
809
- <th>Name</th>
810
- <th>Size</th>
811
- <th>Type</th>
812
- </tr>
813
- </ng-template>
814
- <ng-template #body let-rowNode let-rowData="rowData">
815
- <tr [ttRow]="rowNode">
816
- <td>
817
- <div class="flex items-center gap-2">
818
- <p-tree-table-toggler [rowNode]="rowNode" />
819
- <span>{{ rowData.name }}</span>
820
- </div>
821
- </td>
822
- <td>{{ rowData.size }}</td>
823
- <td>{{ rowData.type }}</td>
824
- </tr>
825
- </ng-template>
826
- </p-tree-table>
850
+ <div class="card">
851
+ <p-button (click)="toggleApplications()" label="Toggle Applications" class="block mb-4" />
852
+ <p-tree-table [value]="files" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
853
+ <ng-template #header>
854
+ <tr>
855
+ <th>Name</th>
856
+ <th>Size</th>
857
+ <th>Type</th>
858
+ </tr>
859
+ </ng-template>
860
+ <ng-template #body let-rowNode let-rowData="rowData">
861
+ <tr [ttRow]="rowNode">
862
+ <td>
863
+ <div class="flex items-center gap-2">
864
+ <p-tree-table-toggler [rowNode]="rowNode" />
865
+ <span>{{ rowData.name }}</span>
866
+ </div>
867
+ </td>
868
+ <td>{{ rowData.size }}</td>
869
+ <td>{{ rowData.type }}</td>
870
+ </tr>
871
+ </ng-template>
872
+ </p-tree-table>
873
+ </div>
827
874
  `,
828
875
  standalone: true,
829
- imports: [TreeTableModule],
876
+ imports: [TreeTableModule, ButtonModule],
830
877
  providers: [NodeService]
831
878
  })
832
879
  export class TreetableControlledDemo implements OnInit {
833
880
  private nodeService = inject(NodeService);
881
+
834
882
  files!: TreeNode[];
835
883
 
836
884
  ngOnInit() {
@@ -854,10 +902,11 @@ export class TreetableControlledDemo implements OnInit {
854
902
  Columns can be created programmatically.
855
903
 
856
904
  ```typescript
857
- import { Component, OnInit, inject } from '@angular/core';
905
+ import { CommonModule } from '@angular/common';
906
+ import { Component, inject, OnInit } from '@angular/core';
907
+ import { TreeNode } from '@exhaustive-ui/core/api';
858
908
  import { TreeTableModule } from '@exhaustive-ui/core/treetable';
859
909
  import { NodeService } from '@/service/nodeservice';
860
- import { TreeNode } from '@exhaustive-ui/core/api';
861
910
 
862
911
  interface Column {
863
912
  field: string;
@@ -866,41 +915,45 @@ interface Column {
866
915
 
867
916
  @Component({
868
917
  template: `
869
- <p-tree-table [value]="files" [columns]="cols" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
870
- <ng-template #header let-columns>
871
- <tr>
872
- @for (col of columns; track col) {
873
- <th>
874
- {{ col.header }}
875
- </th>
876
- }
877
- </tr>
878
- </ng-template>
879
- <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
880
- <tr [ttRow]="rowNode">
881
- @for (col of columns; let first = $first; track col) {
882
- <td>
883
- @if (first) {
884
- <div class="flex items-center gap-2">
885
- <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
886
- <span>{{ rowData[col.field] }}</span>
887
- </div>
888
- } @else {
889
- {{ rowData[col.field] }}
890
- }
891
- </td>
892
- }
893
- </tr>
894
- </ng-template>
895
- </p-tree-table>
918
+ <div class="card">
919
+ <p-tree-table [value]="files" [columns]="cols" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
920
+ <ng-template #header let-columns>
921
+ <tr>
922
+ @for (col of columns; track col) {
923
+ <th>
924
+ {{ col.header }}
925
+ </th>
926
+ }
927
+ </tr>
928
+ </ng-template>
929
+ <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
930
+ <tr [ttRow]="rowNode">
931
+ @for (col of columns; let first = $first; track col) {
932
+ <td>
933
+ @if (first) {
934
+ <div class="flex items-center gap-2">
935
+ <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
936
+ <span>{{ rowData[col.field] }}</span>
937
+ </div>
938
+ } @else {
939
+ {{ rowData[col.field] }}
940
+ }
941
+ </td>
942
+ }
943
+ </tr>
944
+ </ng-template>
945
+ </p-tree-table>
946
+ </div>
896
947
  `,
897
948
  standalone: true,
898
- imports: [TreeTableModule],
949
+ imports: [CommonModule, TreeTableModule],
899
950
  providers: [NodeService]
900
951
  })
901
952
  export class TreetableDynamiccolumnsDemo implements OnInit {
902
953
  private nodeService = inject(NodeService);
954
+
903
955
  files!: TreeNode[];
956
+
904
957
  cols!: Column[];
905
958
 
906
959
  ngOnInit() {
@@ -916,15 +969,16 @@ export class TreetableDynamiccolumnsDemo implements OnInit {
916
969
 
917
970
  ## edit-doc
918
971
 
919
- Incell editing is enabled by defining input elements with treeTableCellEditor .
972
+ Incell editing is enabled by adding ttEditableColumn to a cell and defining input elements with p-tree-table-cell-editor .
920
973
 
921
974
  ```typescript
922
- import { Component, OnInit, inject } from '@angular/core';
975
+ import { CommonModule } from '@angular/common';
976
+ import { Component, inject, OnInit } from '@angular/core';
923
977
  import { FormsModule } from '@angular/forms';
924
978
  import { TreeTableModule } from '@exhaustive-ui/core/treetable';
925
979
  import { InputTextModule } from '@exhaustive-ui/core/inputtext';
926
- import { NodeService } from '@/service/nodeservice';
927
980
  import { TreeNode } from '@exhaustive-ui/core/api';
981
+ import { NodeService } from '@/service/nodeservice';
928
982
 
929
983
  interface Column {
930
984
  field: string;
@@ -933,36 +987,40 @@ interface Column {
933
987
 
934
988
  @Component({
935
989
  template: `
936
- <p-tree-table [value]="files" [columns]="cols" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
937
- <ng-template pTemplate="header" let-columns>
938
- <tr>
939
- <th *ngFor="let col of columns">
940
- {{ col.header }}
941
- </th>
942
- </tr>
943
- </ng-template>
944
- <ng-template pTemplate="body" let-rowNode let-rowData="rowData" let-columns="columns">
945
- <tr [ttRow]="rowNode">
946
- <td *ngFor="let col of columns; let i = index" ttEditableColumn [ttEditableColumnDisabled]="i == 0" [ngClass]="{ 'p-toggler-column': i === 0 }">
947
- <p-tree-table-toggler [rowNode]="rowNode" *ngIf="i === 0" />
948
- <p-tree-table-cell-editor>
949
- <ng-template pTemplate="input">
950
- <input pInputText type="text" [(ngModel)]="rowData[col.field]" />
951
- </ng-template>
952
- <ng-template pTemplate="output">{{ rowData[col.field] }}</ng-template>
953
- </p-tree-table-cell-editor>
954
- </td>
955
- </tr>
956
- </ng-template>
957
- </p-tree-table>
990
+ <div class="card">
991
+ <p-tree-table [value]="files" [columns]="cols" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
992
+ <ng-template #header let-columns>
993
+ <tr>
994
+ <th *ngFor="let col of columns">
995
+ {{ col.header }}
996
+ </th>
997
+ </tr>
998
+ </ng-template>
999
+ <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
1000
+ <tr [ttRow]="rowNode">
1001
+ <td *ngFor="let col of columns; let i = index" ttEditableColumn [ttEditableColumnDisabled]="i == 0" [ngClass]="{ 'p-toggler-column': i === 0 }">
1002
+ <p-tree-table-toggler [rowNode]="rowNode" *ngIf="i === 0" />
1003
+ <p-tree-table-cell-editor>
1004
+ <ng-template #input>
1005
+ <input pInputText type="text" [(ngModel)]="rowData[col.field]" />
1006
+ </ng-template>
1007
+ <ng-template #output>{{ rowData[col.field] }}</ng-template>
1008
+ </p-tree-table-cell-editor>
1009
+ </td>
1010
+ </tr>
1011
+ </ng-template>
1012
+ </p-tree-table>
1013
+ </div>
958
1014
  `,
959
1015
  standalone: true,
960
- imports: [TreeTableModule, InputTextModule, FormsModule],
1016
+ imports: [CommonModule, FormsModule, TreeTableModule, InputTextModule],
961
1017
  providers: [NodeService]
962
1018
  })
963
1019
  export class TreetableEditDemo implements OnInit {
964
1020
  private nodeService = inject(NodeService);
1021
+
965
1022
  files!: TreeNode[];
1023
+
966
1024
  cols!: Column[];
967
1025
 
968
1026
  ngOnInit() {
@@ -978,16 +1036,19 @@ export class TreetableEditDemo implements OnInit {
978
1036
 
979
1037
  ## Filter
980
1038
 
981
- The filterMode specifies the filtering strategy, in lenient mode when the query matches a node, children of the node are not searched further as all descendants of the node are included. On the other hand, in strict mode when the query matches a node, filtering continues on all descendants. A general filled called filterGlobal is also provided to search all columns that support filtering.
1039
+ The filterMode specifies the filtering strategy, in lenient mode when the query matches a node, children of the node are not searched further as all descendants of the node are included. On the other hand, in strict mode when the query matches a node, filtering continues on all descendants. A method called filterGlobal is also provided to search all columns that support filtering.
982
1040
 
983
1041
  ```typescript
984
- import { Component, OnInit, inject } from '@angular/core';
1042
+ import { CommonModule } from '@angular/common';
1043
+ import { Component, inject, OnInit } from '@angular/core';
1044
+ import { FormsModule } from '@angular/forms';
1045
+ import { TreeNode } from '@exhaustive-ui/core/api';
985
1046
  import { IconFieldModule } from '@exhaustive-ui/core/iconfield';
986
1047
  import { InputIconModule } from '@exhaustive-ui/core/inputicon';
987
- import { TreeTableModule } from '@exhaustive-ui/core/treetable';
988
1048
  import { InputTextModule } from '@exhaustive-ui/core/inputtext';
1049
+ import { SelectButtonModule } from '@exhaustive-ui/core/selectbutton';
1050
+ import { TreeTableModule } from '@exhaustive-ui/core/treetable';
989
1051
  import { NodeService } from '@/service/nodeservice';
990
- import { TreeNode } from '@exhaustive-ui/core/api';
991
1052
 
992
1053
  interface Column {
993
1054
  field: string;
@@ -996,63 +1057,75 @@ interface Column {
996
1057
 
997
1058
  @Component({
998
1059
  template: `
999
- <p-tree-table #tt [value]="files" [columns]="cols" [filterMode]="filterMode" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
1000
- <ng-template #caption>
1001
- <div class="flex justify-end items-center">
1002
- <p-icon-field>
1003
- <p-input-icon class="pi pi-search" />
1004
- <input type="text" pInputText placeholder="Global Search" (input)="tt.filterGlobal($event.target.value, 'contains')" />
1005
- </p-icon-field>
1006
- </div>
1007
- </ng-template>
1008
- <ng-template #header let-columns>
1009
- <tr>
1010
- @for (col of columns; track col) {
1011
- <th>
1012
- {{ col.header }}
1013
- </th>
1014
- }
1015
- </tr>
1016
- <tr>
1017
- @for (col of columns; track col) {
1018
- <th>
1019
- <input pInputText [placeholder]="'Filter by ' + col.field" type="text" (input)="tt.filter($event.target.value, col.field, col.filterMatchMode)" />
1020
- </th>
1021
- }
1022
- </tr>
1023
- </ng-template>
1024
- <ng-template #body let-rowNode let-rowData="rowData">
1025
- <tr [ttRow]="rowNode">
1026
- @for (col of cols; let first = $first; track col) {
1027
- <td>
1028
- @if (first) {
1029
- <div class="flex items-center gap-2">
1030
- <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
1031
- <span>{{ rowData[col.field] }}</span>
1032
- </div>
1033
- } @else {
1034
- {{ rowData[col.field] }}
1035
- }
1036
- </td>
1037
- }
1038
- </tr>
1039
- </ng-template>
1040
- <ng-template #emptymessage>
1041
- <tr>
1042
- <td [attr.colspan]="cols?.length">No data found.</td>
1043
- </tr>
1044
- </ng-template>
1045
- </p-tree-table>
1060
+ <div class="card">
1061
+ <div class="flex justify-center mb-6">
1062
+ <p-select-button [options]="filterModes" [(ngModel)]="filterMode" optionLabel="label" optionValue="value" />
1063
+ </div>
1064
+ <p-tree-table #tt [value]="files" [columns]="cols" [filterMode]="filterMode" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
1065
+ <ng-template #caption>
1066
+ <div class="flex justify-end items-center">
1067
+ <p-icon-field>
1068
+ <p-input-icon class="pi pi-search" />
1069
+ <input type="text" pInputText placeholder="Global Search" (input)="tt.filterGlobal($event.target.value, 'contains')" />
1070
+ </p-icon-field>
1071
+ </div>
1072
+ </ng-template>
1073
+ <ng-template #header let-columns>
1074
+ <tr>
1075
+ @for (col of columns; track col) {
1076
+ <th>
1077
+ {{ col.header }}
1078
+ </th>
1079
+ }
1080
+ </tr>
1081
+ <tr>
1082
+ @for (col of columns; track col) {
1083
+ <th>
1084
+ <input pInputText [placeholder]="'Filter by ' + col.field" type="text" (input)="tt.filter($event.target.value, col.field, col.filterMatchMode)" />
1085
+ </th>
1086
+ }
1087
+ </tr>
1088
+ </ng-template>
1089
+ <ng-template #body let-rowNode let-rowData="rowData">
1090
+ <tr [ttRow]="rowNode">
1091
+ @for (col of cols; let first = $first; track col) {
1092
+ <td>
1093
+ @if (first) {
1094
+ <div class="flex items-center gap-2">
1095
+ <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
1096
+ <span>{{ rowData[col.field] }}</span>
1097
+ </div>
1098
+ } @else {
1099
+ {{ rowData[col.field] }}
1100
+ }
1101
+ </td>
1102
+ }
1103
+ </tr>
1104
+ </ng-template>
1105
+ <ng-template #emptymessage>
1106
+ <tr>
1107
+ <td [attr.colspan]="cols?.length">No data found.</td>
1108
+ </tr>
1109
+ </ng-template>
1110
+ </p-tree-table>
1111
+ </div>
1046
1112
  `,
1047
1113
  standalone: true,
1048
- imports: [IconFieldModule, InputIconModule, TreeTableModule, InputTextModule],
1114
+ imports: [CommonModule, FormsModule, TreeTableModule, SelectButtonModule, InputTextModule, IconFieldModule, InputIconModule],
1049
1115
  providers: [NodeService]
1050
1116
  })
1051
1117
  export class TreetableFilterDemo implements OnInit {
1052
1118
  private nodeService = inject(NodeService);
1053
- filterMode: string = 'lenient';
1054
- filterModes: any[];
1119
+
1120
+ filterMode = 'lenient';
1121
+
1122
+ filterModes = [
1123
+ { label: 'Lenient', value: 'lenient' },
1124
+ { label: 'Strict', value: 'strict' }
1125
+ ];
1126
+
1055
1127
  files!: TreeNode[];
1128
+
1056
1129
  cols!: Column[];
1057
1130
 
1058
1131
  ngOnInit() {
@@ -1071,52 +1144,56 @@ export class TreetableFilterDemo implements OnInit {
1071
1144
  Flex scroll feature makes the scrollable viewport section dynamic instead of a fixed value so that it can grow or shrink relative to the parent size of the table. Click the button below to display a maximizable Dialog where data viewport adjusts itself according to the size changes.
1072
1145
 
1073
1146
  ```typescript
1074
- import { Component, OnInit, inject } from '@angular/core';
1147
+ import { Component, inject, OnInit } from '@angular/core';
1148
+ import { TreeNode } from '@exhaustive-ui/core/api';
1075
1149
  import { ButtonModule } from '@exhaustive-ui/core/button';
1076
- import { Dialog, DialogModule } from '@exhaustive-ui/core/dialog';
1150
+ import { DialogModule } from '@exhaustive-ui/core/dialog';
1077
1151
  import { TreeTableModule } from '@exhaustive-ui/core/treetable';
1078
1152
  import { NodeService } from '@/service/nodeservice';
1079
- import { TreeNode } from '@exhaustive-ui/core/api';
1080
1153
 
1081
1154
  @Component({
1082
1155
  template: `
1083
- <p-button label="Show" icon="pi pi-external-link" (onClick)="dialogVisible = true" />
1084
- <p-dialog [(visible)]="dialogVisible" header="Flex Scroll" [style]="{ width: '75vw' }" maximizable modal [contentStyle]="{ height: '300px' }">
1085
- <ng-template #content>
1086
- <p-tree-table [value]="files" [scrollable]="true" scrollHeight="flex" [tableStyle]="{ 'min-width': '50rem' }">
1087
- <ng-template #header>
1088
- <tr>
1089
- <th>Name</th>
1090
- <th>Size</th>
1091
- <th>Type</th>
1092
- </tr>
1093
- </ng-template>
1094
- <ng-template #body let-rowNode let-rowData="rowData">
1095
- <tr [ttRow]="rowNode">
1096
- <td>
1097
- <div class="flex items-center gap-2">
1098
- <p-tree-table-toggler [rowNode]="rowNode" />
1099
- <span>{{ rowData.name }}</span>
1100
- </div>
1101
- </td>
1102
- <td>{{ rowData.size }}</td>
1103
- <td>{{ rowData.type }}</td>
1104
- </tr>
1105
- </ng-template>
1106
- </p-tree-table>
1107
- </ng-template>
1108
- <ng-template #footer>
1109
- <p-button label="Ok" icon="pi pi-check" (onClick)="dialogVisible = false" />
1110
- </ng-template>
1111
- </p-dialog>
1156
+ <div class="card flex justify-center">
1157
+ <p-button label="Show" icon="pi pi-external-link" (onClick)="dialogVisible = true" />
1158
+ <p-dialog [(visible)]="dialogVisible" header="Flex Scroll" [style]="{ width: '75vw' }" maximizable modal [contentStyle]="{ height: '300px' }">
1159
+ <ng-template #content>
1160
+ <p-tree-table [value]="files" [scrollable]="true" scrollHeight="flex" [tableStyle]="{ 'min-width': '50rem' }">
1161
+ <ng-template #header>
1162
+ <tr>
1163
+ <th>Name</th>
1164
+ <th>Size</th>
1165
+ <th>Type</th>
1166
+ </tr>
1167
+ </ng-template>
1168
+ <ng-template #body let-rowNode let-rowData="rowData">
1169
+ <tr [ttRow]="rowNode">
1170
+ <td>
1171
+ <div class="flex items-center gap-2">
1172
+ <p-tree-table-toggler [rowNode]="rowNode" />
1173
+ <span>{{ rowData.name }}</span>
1174
+ </div>
1175
+ </td>
1176
+ <td>{{ rowData.size }}</td>
1177
+ <td>{{ rowData.type }}</td>
1178
+ </tr>
1179
+ </ng-template>
1180
+ </p-tree-table>
1181
+ </ng-template>
1182
+ <ng-template #footer>
1183
+ <p-button label="Ok" icon="pi pi-check" (onClick)="dialogVisible = false" />
1184
+ </ng-template>
1185
+ </p-dialog>
1186
+ </div>
1112
1187
  `,
1113
1188
  standalone: true,
1114
- imports: [ButtonModule, DialogModule, TreeTableModule],
1189
+ imports: [TreeTableModule, ButtonModule, DialogModule],
1115
1190
  providers: [NodeService]
1116
1191
  })
1117
1192
  export class TreetableFlexiblescrollDemo implements OnInit {
1118
1193
  private nodeService = inject(NodeService);
1194
+
1119
1195
  files!: TreeNode[];
1196
+
1120
1197
  dialogVisible: boolean = false;
1121
1198
 
1122
1199
  ngOnInit() {
@@ -1132,34 +1209,38 @@ export class TreetableFlexiblescrollDemo implements OnInit {
1132
1209
  Enabling showGridlines displays grid lines.
1133
1210
 
1134
1211
  ```typescript
1135
- import { Component, OnInit, inject } from '@angular/core';
1212
+ import { Component, inject, OnInit } from '@angular/core';
1213
+ import { TreeNode } from '@exhaustive-ui/core/api';
1136
1214
  import { TreeTableModule } from '@exhaustive-ui/core/treetable';
1137
1215
  import { NodeService } from '@/service/nodeservice';
1138
- import { TreeNode } from '@exhaustive-ui/core/api';
1139
1216
 
1140
1217
  @Component({
1141
1218
  template: `
1142
- <p-tree-table [value]="files" [scrollable]="true" showGridlines [tableStyle]="{ 'min-width': '50rem' }">
1143
- <ng-template #header>
1144
- <tr>
1145
- <th>Name</th>
1146
- <th>Size</th>
1147
- <th>Type</th>
1148
- </tr>
1149
- </ng-template>
1150
- <ng-template #body let-rowNode let-rowData="rowData">
1151
- <tr [ttRow]="rowNode">
1152
- <td>
1153
- <div class="flex items-center gap-2">
1154
- <p-tree-table-toggler [rowNode]="rowNode" />
1155
- <span>{{ rowData.name }}</span>
1156
- </div>
1157
- </td>
1158
- <td>{{ rowData.size }}</td>
1159
- <td>{{ rowData.type }}</td>
1160
- </tr>
1161
- </ng-template>
1162
- </p-tree-table>
1219
+ <section class="py-6">
1220
+ <div class="card">
1221
+ <p-tree-table [value]="files" [scrollable]="true" showGridlines [tableStyle]="{ 'min-width': '50rem' }">
1222
+ <ng-template #header>
1223
+ <tr>
1224
+ <th>Name</th>
1225
+ <th>Size</th>
1226
+ <th>Type</th>
1227
+ </tr>
1228
+ </ng-template>
1229
+ <ng-template #body let-rowNode let-rowData="rowData">
1230
+ <tr [ttRow]="rowNode">
1231
+ <td>
1232
+ <div class="flex items-center gap-2">
1233
+ <p-tree-table-toggler [rowNode]="rowNode" />
1234
+ <span>{{ rowData.name }}</span>
1235
+ </div>
1236
+ </td>
1237
+ <td>{{ rowData.size }}</td>
1238
+ <td>{{ rowData.type }}</td>
1239
+ </tr>
1240
+ </ng-template>
1241
+ </p-tree-table>
1242
+ </div>
1243
+ </section>
1163
1244
  `,
1164
1245
  standalone: true,
1165
1246
  imports: [TreeTableModule],
@@ -1167,6 +1248,7 @@ import { TreeNode } from '@exhaustive-ui/core/api';
1167
1248
  })
1168
1249
  export class TreetableGridlinesDemo implements OnInit {
1169
1250
  private nodeService = inject(NodeService);
1251
+
1170
1252
  files!: TreeNode[];
1171
1253
 
1172
1254
  ngOnInit() {
@@ -1180,10 +1262,10 @@ export class TreetableGridlinesDemo implements OnInit {
1180
1262
  Lazy mode is handy to deal with large datasets, instead of loading the entire data, small chunks of data is loaded by invoking corresponding callbacks everytime paging , sorting and filtering occurs. Sample below imitates lazy loading data from a remote datasource using an in-memory list and timeouts to mimic network connection. Enabling the lazy property and assigning the logical number of rows to totalRecords by doing a projection query are the key elements of the implementation so that paginator displays the UI assuming there are actually records of totalRecords size although in reality they are not present on page, only the records that are displayed on the current page exist. In addition, only the root elements should be loaded, children can be loaded on demand using onNodeExpand callback.
1181
1263
 
1182
1264
  ```typescript
1183
- import { Component, OnInit, inject } from '@angular/core';
1184
- import { TreeTableModule } from '@exhaustive-ui/core/treetable';
1185
- import { NodeService } from '@/service/nodeservice';
1265
+ import { CommonModule } from '@angular/common';
1266
+ import { Component, OnInit } from '@angular/core';
1186
1267
  import { TreeNode } from '@exhaustive-ui/core/api';
1268
+ import { TreeTableModule } from '@exhaustive-ui/core/treetable';
1187
1269
 
1188
1270
  interface Column {
1189
1271
  field: string;
@@ -1235,14 +1317,15 @@ interface Column {
1235
1317
  </div>
1236
1318
  `,
1237
1319
  standalone: true,
1238
- imports: [TreeTableModule],
1239
- providers: [NodeService]
1320
+ imports: [CommonModule, TreeTableModule]
1240
1321
  })
1241
1322
  export class TreetableLazyloadDemo implements OnInit {
1242
- private nodeService = inject(NodeService);
1243
1323
  files!: TreeNode[];
1324
+
1244
1325
  cols!: Column[];
1326
+
1245
1327
  totalRecords!: number;
1328
+
1246
1329
  loading: boolean = false;
1247
1330
 
1248
1331
  ngOnInit() {
@@ -1251,16 +1334,18 @@ export class TreetableLazyloadDemo implements OnInit {
1251
1334
  { field: 'size', header: 'Size' },
1252
1335
  { field: 'type', header: 'Type' }
1253
1336
  ];
1337
+
1254
1338
  this.totalRecords = 1000;
1339
+
1255
1340
  this.loading = true;
1256
1341
  }
1257
1342
 
1258
1343
  loadNodes(event: any) {
1259
1344
  this.loading = true;
1260
-
1345
+
1261
1346
  setTimeout(() => {
1262
1347
  this.files = [];
1263
-
1348
+
1264
1349
  for (let i = 0; i < event.rows; i++) {
1265
1350
  let node = {
1266
1351
  data: {
@@ -1270,21 +1355,20 @@ export class TreetableLazyloadDemo implements OnInit {
1270
1355
  },
1271
1356
  leaf: false
1272
1357
  };
1273
-
1358
+
1274
1359
  this.files.push(node);
1275
1360
  }
1276
1361
  this.loading = false;
1277
- this.cd.markForCheck();
1278
1362
  }, 1000);
1279
1363
  }
1280
1364
 
1281
1365
  onNodeExpand(event: any) {
1282
1366
  this.loading = true;
1283
-
1367
+
1284
1368
  setTimeout(() => {
1285
1369
  this.loading = false;
1286
1370
  const node = event.node;
1287
-
1371
+
1288
1372
  node.children = [
1289
1373
  {
1290
1374
  data: {
@@ -1301,9 +1385,8 @@ export class TreetableLazyloadDemo implements OnInit {
1301
1385
  }
1302
1386
  }
1303
1387
  ];
1304
-
1388
+
1305
1389
  this.files = [...this.files];
1306
- this.cd.markForCheck();
1307
1390
  }, 250);
1308
1391
  }
1309
1392
  }
@@ -1314,10 +1397,10 @@ export class TreetableLazyloadDemo implements OnInit {
1314
1397
  The loading property displays a mask layer to indicate busy state. Use the paginator to display the mask.
1315
1398
 
1316
1399
  ```typescript
1317
- import { Component, OnInit, inject } from '@angular/core';
1400
+ import { Component, inject, OnInit } from '@angular/core';
1401
+ import { TreeNode } from '@exhaustive-ui/core/api';
1318
1402
  import { TreeTableModule } from '@exhaustive-ui/core/treetable';
1319
1403
  import { NodeService } from '@/service/nodeservice';
1320
- import { TreeNode } from '@exhaustive-ui/core/api';
1321
1404
 
1322
1405
  @Component({
1323
1406
  template: `
@@ -1351,6 +1434,7 @@ import { TreeNode } from '@exhaustive-ui/core/api';
1351
1434
  })
1352
1435
  export class TreetableLoadingmaskDemo implements OnInit {
1353
1436
  private nodeService = inject(NodeService);
1437
+
1354
1438
  files!: TreeNode[];
1355
1439
 
1356
1440
  ngOnInit() {
@@ -1364,11 +1448,11 @@ export class TreetableLoadingmaskDemo implements OnInit {
1364
1448
  Skeleton component can be used as a placeholder during the loading process.
1365
1449
 
1366
1450
  ```typescript
1367
- import { Component, OnInit, inject, signal } from '@angular/core';
1451
+ import { Component, signal, inject, OnInit } from '@angular/core';
1452
+ import { TreeNode } from '@exhaustive-ui/core/api';
1368
1453
  import { SkeletonModule } from '@exhaustive-ui/core/skeleton';
1369
1454
  import { TreeTableModule } from '@exhaustive-ui/core/treetable';
1370
1455
  import { NodeService } from '@/service/nodeservice';
1371
- import { TreeNode } from '@exhaustive-ui/core/api';
1372
1456
 
1373
1457
  @Component({
1374
1458
  template: `
@@ -1392,11 +1476,12 @@ import { TreeNode } from '@exhaustive-ui/core/api';
1392
1476
  </div>
1393
1477
  `,
1394
1478
  standalone: true,
1395
- imports: [SkeletonModule, TreeTableModule],
1479
+ imports: [TreeTableModule, SkeletonModule],
1396
1480
  providers: [NodeService]
1397
1481
  })
1398
1482
  export class TreetableLoadingskeletonDemo implements OnInit {
1399
1483
  private nodeService = inject(NodeService);
1484
+
1400
1485
  files = signal<TreeNode[]>([]);
1401
1486
 
1402
1487
  ngOnInit() {
@@ -1410,9 +1495,10 @@ export class TreetableLoadingskeletonDemo implements OnInit {
1410
1495
  Pagination is enabled by adding paginator property and defining rows per page.
1411
1496
 
1412
1497
  ```typescript
1498
+ import { CommonModule } from '@angular/common';
1413
1499
  import { Component, OnInit } from '@angular/core';
1414
- import { TreeTableModule } from '@exhaustive-ui/core/treetable';
1415
1500
  import { TreeNode } from '@exhaustive-ui/core/api';
1501
+ import { TreeTableModule } from '@exhaustive-ui/core/treetable';
1416
1502
 
1417
1503
  interface Column {
1418
1504
  field: string;
@@ -1421,41 +1507,43 @@ interface Column {
1421
1507
 
1422
1508
  @Component({
1423
1509
  template: `
1424
- <p-tree-table [value]="files" [columns]="cols" [paginator]="true" [rows]="5" [rowsPerPageOptions]="[5, 10, 25]" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
1425
- <ng-template #header let-columns>
1426
- <tr>
1427
- @for (col of columns; track col) {
1428
- <th>
1429
- {{ col.header }}
1430
- </th>
1431
- }
1432
- </tr>
1433
- </ng-template>
1434
- <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
1435
- <tr [ttRow]="rowNode">
1436
- @for (col of columns; let first = $first; track col) {
1437
- <td>
1438
- @if (first) {
1439
- <div class="flex items-center gap-2">
1440
- <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
1441
- <span>{{ rowData[col.field] }}</span>
1442
- </div>
1443
- } @else {
1444
- {{ rowData[col.field] }}
1445
- }
1446
- </td>
1447
- }
1448
- </tr>
1449
- </ng-template>
1450
- </p-tree-table>
1510
+ <div class="card">
1511
+ <p-tree-table [value]="files" [columns]="cols" [paginator]="true" [rows]="5" [rowsPerPageOptions]="[5, 10, 25]" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
1512
+ <ng-template #header let-columns>
1513
+ <tr>
1514
+ @for (col of columns; track col) {
1515
+ <th>
1516
+ {{ col.header }}
1517
+ </th>
1518
+ }
1519
+ </tr>
1520
+ </ng-template>
1521
+ <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
1522
+ <tr [ttRow]="rowNode">
1523
+ @for (col of columns; let first = $first; track col) {
1524
+ <td>
1525
+ @if (first) {
1526
+ <div class="flex items-center gap-2">
1527
+ <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
1528
+ <span>{{ rowData[col.field] }}</span>
1529
+ </div>
1530
+ } @else {
1531
+ {{ rowData[col.field] }}
1532
+ }
1533
+ </td>
1534
+ }
1535
+ </tr>
1536
+ </ng-template>
1537
+ </p-tree-table>
1538
+ </div>
1451
1539
  `,
1452
1540
  standalone: true,
1453
- imports: [TreeTableModule]
1541
+ imports: [CommonModule, TreeTableModule]
1454
1542
  })
1455
1543
  export class TreetablePaginatorbasicDemo implements OnInit {
1456
1544
  files!: TreeNode[];
1457
- cols!: Column[];
1458
1545
 
1546
+ cols!: Column[];
1459
1547
  ngOnInit() {
1460
1548
  this.files = [];
1461
1549
  for (let i = 0; i < 50; i++) {
@@ -1475,8 +1563,10 @@ export class TreetablePaginatorbasicDemo implements OnInit {
1475
1563
  }
1476
1564
  ]
1477
1565
  };
1566
+
1478
1567
  this.files.push(node);
1479
1568
  }
1569
+
1480
1570
  this.cols = [
1481
1571
  { field: 'name', header: 'Name' },
1482
1572
  { field: 'size', header: 'Size' },
@@ -1491,11 +1581,12 @@ export class TreetablePaginatorbasicDemo implements OnInit {
1491
1581
  Paginator UI is customized using the paginatorleft and paginatorright property. Each element can also be customized further with your own UI to replace the default one, refer to the Paginator component for more information about the advanced customization options.
1492
1582
 
1493
1583
  ```typescript
1584
+ import { CommonModule } from '@angular/common';
1494
1585
  import { Component, OnInit } from '@angular/core';
1586
+ import { RouterModule } from '@angular/router';
1587
+ import { TreeNode } from '@exhaustive-ui/core/api';
1495
1588
  import { ButtonModule } from '@exhaustive-ui/core/button';
1496
1589
  import { TreeTableModule } from '@exhaustive-ui/core/treetable';
1497
- import { TreeNode } from '@exhaustive-ui/core/api';
1498
- import { Paginator } from '@exhaustive-ui/core/paginator';
1499
1590
 
1500
1591
  interface Column {
1501
1592
  field: string;
@@ -1504,45 +1595,48 @@ interface Column {
1504
1595
 
1505
1596
  @Component({
1506
1597
  template: `
1507
- <p-tree-table [value]="files" [columns]="cols" [paginator]="true" [rows]="10" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
1508
- <ng-template #header let-columns>
1509
- <tr>
1510
- @for (col of columns; track col) {
1511
- <th>
1512
- {{ col.header }}
1513
- </th>
1514
- }
1515
- </tr>
1516
- </ng-template>
1517
- <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
1518
- <tr [ttRow]="rowNode">
1519
- @for (col of columns; let first = $first; track col) {
1520
- <td>
1521
- @if (first) {
1522
- <div class="flex items-center gap-2">
1523
- <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
1524
- <span>{{ rowData[col.field] }}</span>
1525
- </div>
1526
- } @else {
1527
- {{ rowData[col.field] }}
1528
- }
1529
- </td>
1530
- }
1531
- </tr>
1532
- </ng-template>
1533
- <ng-template #paginatorleft>
1534
- <p-button icon="pi pi-refresh" text />
1535
- </ng-template>
1536
- <ng-template #paginatorright>
1537
- <p-button icon="pi pi-download" text />
1538
- </ng-template>
1539
- </p-tree-table>
1598
+ <div class="card">
1599
+ <p-tree-table [value]="files" [columns]="cols" [paginator]="true" [rows]="10" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
1600
+ <ng-template #header let-columns>
1601
+ <tr>
1602
+ @for (col of columns; track col) {
1603
+ <th>
1604
+ {{ col.header }}
1605
+ </th>
1606
+ }
1607
+ </tr>
1608
+ </ng-template>
1609
+ <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
1610
+ <tr [ttRow]="rowNode">
1611
+ @for (col of columns; let first = $first; track col) {
1612
+ <td>
1613
+ @if (first) {
1614
+ <div class="flex items-center gap-2">
1615
+ <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
1616
+ <span>{{ rowData[col.field] }}</span>
1617
+ </div>
1618
+ } @else {
1619
+ {{ rowData[col.field] }}
1620
+ }
1621
+ </td>
1622
+ }
1623
+ </tr>
1624
+ </ng-template>
1625
+ <ng-template #paginatorleft>
1626
+ <p-button icon="pi pi-refresh" text />
1627
+ </ng-template>
1628
+ <ng-template #paginatorright>
1629
+ <p-button icon="pi pi-download" text />
1630
+ </ng-template>
1631
+ </p-tree-table>
1632
+ </div>
1540
1633
  `,
1541
1634
  standalone: true,
1542
- imports: [ButtonModule, TreeTableModule]
1635
+ imports: [CommonModule, TreeTableModule, ButtonModule, RouterModule]
1543
1636
  })
1544
1637
  export class TreetablePaginatortemplateDemo implements OnInit {
1545
1638
  files!: TreeNode[];
1639
+
1546
1640
  cols!: Column[];
1547
1641
 
1548
1642
  ngOnInit() {
@@ -1564,8 +1658,10 @@ export class TreetablePaginatortemplateDemo implements OnInit {
1564
1658
  }
1565
1659
  ]
1566
1660
  };
1661
+
1567
1662
  this.files.push(node);
1568
1663
  }
1664
+
1569
1665
  this.cols = [
1570
1666
  { field: 'name', header: 'Name' },
1571
1667
  { field: 'size', header: 'Size' },
@@ -1580,10 +1676,11 @@ export class TreetablePaginatortemplateDemo implements OnInit {
1580
1676
  Order of the columns can be changed using drag and drop when reorderableColumns is present.
1581
1677
 
1582
1678
  ```typescript
1583
- import { Component, OnInit, inject } from '@angular/core';
1679
+ import { CommonModule } from '@angular/common';
1680
+ import { Component, inject, OnInit } from '@angular/core';
1681
+ import { TreeNode } from '@exhaustive-ui/core/api';
1584
1682
  import { TreeTableModule } from '@exhaustive-ui/core/treetable';
1585
1683
  import { NodeService } from '@/service/nodeservice';
1586
- import { TreeNode } from '@exhaustive-ui/core/api';
1587
1684
 
1588
1685
  interface Column {
1589
1686
  field: string;
@@ -1592,41 +1689,45 @@ interface Column {
1592
1689
 
1593
1690
  @Component({
1594
1691
  template: `
1595
- <p-tree-table [value]="files" [columns]="cols" [reorderableColumns]="true" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
1596
- <ng-template #header let-columns>
1597
- <tr>
1598
- @for (col of columns; track col) {
1599
- <th ttReorderableColumn>
1600
- {{ col.header }}
1601
- </th>
1602
- }
1603
- </tr>
1604
- </ng-template>
1605
- <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
1606
- <tr [ttRow]="rowNode">
1607
- @for (col of columns; let first = $first; track col) {
1608
- <td>
1609
- @if (first) {
1610
- <div class="flex items-center gap-2">
1611
- <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
1612
- <span>{{ rowData[col.field] }}</span>
1613
- </div>
1614
- } @else {
1615
- {{ rowData[col.field] }}
1616
- }
1617
- </td>
1618
- }
1619
- </tr>
1620
- </ng-template>
1621
- </p-tree-table>
1692
+ <div class="card">
1693
+ <p-tree-table [value]="files" [columns]="cols" [reorderableColumns]="true" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
1694
+ <ng-template #header let-columns>
1695
+ <tr>
1696
+ @for (col of columns; track col) {
1697
+ <th ttReorderableColumn>
1698
+ {{ col.header }}
1699
+ </th>
1700
+ }
1701
+ </tr>
1702
+ </ng-template>
1703
+ <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
1704
+ <tr [ttRow]="rowNode">
1705
+ @for (col of columns; let first = $first; track col) {
1706
+ <td>
1707
+ @if (first) {
1708
+ <div class="flex items-center gap-2">
1709
+ <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
1710
+ <span>{{ rowData[col.field] }}</span>
1711
+ </div>
1712
+ } @else {
1713
+ {{ rowData[col.field] }}
1714
+ }
1715
+ </td>
1716
+ }
1717
+ </tr>
1718
+ </ng-template>
1719
+ </p-tree-table>
1720
+ </div>
1622
1721
  `,
1623
1722
  standalone: true,
1624
- imports: [TreeTableModule],
1723
+ imports: [CommonModule, TreeTableModule],
1625
1724
  providers: [NodeService]
1626
1725
  })
1627
1726
  export class TreetableReorderDemo implements OnInit {
1628
1727
  private nodeService = inject(NodeService);
1728
+
1629
1729
  files!: TreeNode[];
1730
+
1630
1731
  cols!: Column[];
1631
1732
 
1632
1733
  ngOnInit() {
@@ -1645,10 +1746,11 @@ export class TreetableReorderDemo implements OnInit {
1645
1746
  A column can be fixed during horizontal scrolling by enabling the frozenColumns property.
1646
1747
 
1647
1748
  ```typescript
1648
- import { Component, OnInit, inject } from '@angular/core';
1749
+ import { CommonModule } from '@angular/common';
1750
+ import { Component, inject, OnInit } from '@angular/core';
1751
+ import { TreeNode } from '@exhaustive-ui/core/api';
1649
1752
  import { TreeTableModule } from '@exhaustive-ui/core/treetable';
1650
1753
  import { NodeService } from '@/service/nodeservice';
1651
- import { TreeNode } from '@exhaustive-ui/core/api';
1652
1754
 
1653
1755
  interface Column {
1654
1756
  field: string;
@@ -1657,53 +1759,59 @@ interface Column {
1657
1759
 
1658
1760
  @Component({
1659
1761
  template: `
1660
- <p-tree-table [value]="files" [columns]="scrollableCols" [frozenColumns]="frozenCols" [scrollable]="true" scrollHeight="250px" frozenWidth="200px" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
1661
- <ng-template #colgroup let-columns>
1662
- <colgroup>
1663
- @for (col of columns; track col) {
1664
- <col style="width:250px" />
1665
- }
1666
- </colgroup>
1667
- </ng-template>
1668
- <ng-template #header let-columns>
1669
- <tr>
1670
- @for (col of columns; track col) {
1671
- <th>
1672
- {{ col.header }}
1673
- </th>
1674
- }
1675
- </tr>
1676
- </ng-template>
1677
- <ng-template #body let-rowData="rowData" let-columns="columns">
1678
- <tr [ttRow]="rowNode" style="height: 57px">
1679
- @for (col of columns; track col) {
1762
+ <div class="card">
1763
+ <p-tree-table [value]="files" [columns]="scrollableCols" [frozenColumns]="frozenCols" [scrollable]="true" scrollHeight="250px" frozenWidth="200px" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
1764
+ <ng-template #colgroup let-columns>
1765
+ <colgroup>
1766
+ @for (col of columns; track col) {
1767
+ <col style="width:250px" />
1768
+ }
1769
+ </colgroup>
1770
+ </ng-template>
1771
+ <ng-template #header let-columns>
1772
+ <tr>
1773
+ @for (col of columns; track col) {
1774
+ <th>
1775
+ {{ col.header }}
1776
+ </th>
1777
+ }
1778
+ </tr>
1779
+ </ng-template>
1780
+ <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
1781
+ <tr [ttRow]="rowNode" style="height: 57px">
1782
+ @for (col of columns; track col) {
1783
+ <td>
1784
+ {{ rowData[col.field] }}
1785
+ </td>
1786
+ }
1787
+ </tr>
1788
+ </ng-template>
1789
+ <ng-template #frozenbody let-rowNode let-rowData="rowData">
1790
+ <tr [ttRow]="rowNode" style="height: 57px">
1680
1791
  <td>
1681
- {{ rowData[col.field] }}
1792
+ <div class="flex items-center gap-2">
1793
+ <p-tree-table-toggler [rowNode]="rowNode" />
1794
+ <span class="font-bold">{{ rowData.name }}</span>
1795
+ </div>
1682
1796
  </td>
1683
- }
1684
- </tr>
1685
- </ng-template>
1686
- <ng-template #frozenbody let-rowNode let-rowData="rowData">
1687
- <tr [ttRow]="rowNode" style="height: 57px">
1688
- <td>
1689
- <div class="flex items-center gap-2">
1690
- <p-tree-table-toggler [rowNode]="rowNode" />
1691
- <span class="font-bold">{{ rowData.name }}</span>
1692
- </div>
1693
- </td>
1694
- </tr>
1695
- </ng-template>
1696
- </p-tree-table>
1797
+ </tr>
1798
+ </ng-template>
1799
+ </p-tree-table>
1800
+ </div>
1697
1801
  `,
1698
1802
  standalone: true,
1699
- imports: [TreeTableModule],
1803
+ imports: [CommonModule, TreeTableModule],
1700
1804
  providers: [NodeService]
1701
1805
  })
1702
1806
  export class TreetableScrollfrozencolumnsDemo implements OnInit {
1703
1807
  private nodeService = inject(NodeService);
1808
+
1704
1809
  files!: TreeNode[];
1810
+
1705
1811
  cols!: Column[];
1812
+
1706
1813
  frozenCols!: Column[];
1814
+
1707
1815
  scrollableCols!: Column[];
1708
1816
 
1709
1817
  ngOnInit() {
@@ -1713,6 +1821,7 @@ export class TreetableScrollfrozencolumnsDemo implements OnInit {
1713
1821
  { field: 'size', header: 'Size' },
1714
1822
  { field: 'type', header: 'Type' }
1715
1823
  ];
1824
+
1716
1825
  this.scrollableCols = [
1717
1826
  { field: 'size', header: 'Size' },
1718
1827
  { field: 'type', header: 'Type' },
@@ -1721,6 +1830,7 @@ export class TreetableScrollfrozencolumnsDemo implements OnInit {
1721
1830
  { field: 'size', header: 'Size' },
1722
1831
  { field: 'type', header: 'Type' }
1723
1832
  ];
1833
+
1724
1834
  this.frozenCols = [{ field: 'name', header: 'Name' }];
1725
1835
  }
1726
1836
  }
@@ -1731,10 +1841,11 @@ export class TreetableScrollfrozencolumnsDemo implements OnInit {
1731
1841
  Horizontal scrolling is enabled when the total width of columns exceeds table width.
1732
1842
 
1733
1843
  ```typescript
1734
- import { Component, OnInit, inject } from '@angular/core';
1844
+ import { CommonModule } from '@angular/common';
1845
+ import { Component, inject, OnInit } from '@angular/core';
1846
+ import { TreeNode } from '@exhaustive-ui/core/api';
1735
1847
  import { TreeTableModule } from '@exhaustive-ui/core/treetable';
1736
1848
  import { NodeService } from '@/service/nodeservice';
1737
- import { TreeNode } from '@exhaustive-ui/core/api';
1738
1849
 
1739
1850
  interface Column {
1740
1851
  field: string;
@@ -1743,48 +1854,52 @@ interface Column {
1743
1854
 
1744
1855
  @Component({
1745
1856
  template: `
1746
- <p-tree-table [value]="files" [columns]="cols" [scrollable]="true" scrollHeight="250px" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
1747
- <ng-template #colgroup let-columns>
1748
- <colgroup>
1749
- @for (col of columns; track col) {
1750
- <col style="width:500px" />
1751
- }
1752
- </colgroup>
1753
- </ng-template>
1754
- <ng-template #header let-columns>
1755
- <tr>
1756
- @for (col of columns; track col) {
1757
- <th>
1758
- {{ col.header }}
1759
- </th>
1760
- }
1761
- </tr>
1762
- </ng-template>
1763
- <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
1764
- <tr [ttRow]="rowNode">
1765
- @for (col of columns; let first = $first; track col) {
1766
- <td>
1767
- @if (first) {
1768
- <div class="flex items-center gap-2">
1769
- <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
1770
- <span>{{ rowData[col.field] }}</span>
1771
- </div>
1772
- } @else {
1773
- {{ rowData[col.field] }}
1774
- }
1775
- </td>
1776
- }
1777
- </tr>
1778
- </ng-template>
1779
- </p-tree-table>
1857
+ <div class="card">
1858
+ <p-tree-table [value]="files" [columns]="cols" [scrollable]="true" scrollHeight="250px" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
1859
+ <ng-template #colgroup let-columns>
1860
+ <colgroup>
1861
+ @for (col of columns; track col) {
1862
+ <col style="width:500px" />
1863
+ }
1864
+ </colgroup>
1865
+ </ng-template>
1866
+ <ng-template #header let-columns>
1867
+ <tr>
1868
+ @for (col of columns; track col) {
1869
+ <th>
1870
+ {{ col.header }}
1871
+ </th>
1872
+ }
1873
+ </tr>
1874
+ </ng-template>
1875
+ <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
1876
+ <tr [ttRow]="rowNode">
1877
+ @for (col of columns; let first = $first; track col) {
1878
+ <td>
1879
+ @if (first) {
1880
+ <div class="flex items-center gap-2">
1881
+ <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
1882
+ <span>{{ rowData[col.field] }}</span>
1883
+ </div>
1884
+ } @else {
1885
+ {{ rowData[col.field] }}
1886
+ }
1887
+ </td>
1888
+ }
1889
+ </tr>
1890
+ </ng-template>
1891
+ </p-tree-table>
1892
+ </div>
1780
1893
  `,
1781
1894
  standalone: true,
1782
- imports: [TreeTableModule],
1895
+ imports: [CommonModule, TreeTableModule],
1783
1896
  providers: [NodeService]
1784
1897
  })
1785
1898
  export class TreetableScrollhorizontalDemo implements OnInit {
1786
1899
  private nodeService = inject(NodeService);
1900
+
1787
1901
  files!: TreeNode[];
1902
+
1788
1903
  cols!: Column[];
1789
1904
 
1790
1905
  ngOnInit() {
@@ -1803,10 +1918,11 @@ export class TreetableScrollhorizontalDemo implements OnInit {
1803
1918
  Adding scrollable property along with a scrollHeight for the data viewport enables vertical scrolling with fixed headers.
1804
1919
 
1805
1920
  ```typescript
1806
- import { Component, OnInit, inject } from '@angular/core';
1921
+ import { CommonModule } from '@angular/common';
1922
+ import { Component, inject, OnInit } from '@angular/core';
1923
+ import { TreeNode } from '@exhaustive-ui/core/api';
1807
1924
  import { TreeTableModule } from '@exhaustive-ui/core/treetable';
1808
1925
  import { NodeService } from '@/service/nodeservice';
1809
- import { TreeNode } from '@exhaustive-ui/core/api';
1810
1926
 
1811
1927
  interface Column {
1812
1928
  field: string;
@@ -1815,41 +1931,45 @@ interface Column {
1815
1931
 
1816
1932
  @Component({
1817
1933
  template: `
1818
- <p-tree-table [value]="files" [columns]="cols" [scrollable]="true" scrollHeight="200px" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
1819
- <ng-template #header let-columns>
1820
- <tr>
1821
- @for (col of columns; track col) {
1822
- <th>
1823
- {{ col.header }}
1824
- </th>
1825
- }
1826
- </tr>
1827
- </ng-template>
1828
- <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
1829
- <tr [ttRow]="rowNode">
1830
- @for (col of columns; let first = $first; track col) {
1831
- <td>
1832
- @if (first) {
1833
- <div class="flex items-center gap-2">
1834
- <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
1835
- <span>{{ rowData[col.field] }}</span>
1836
- </div>
1837
- } @else {
1838
- {{ rowData[col.field] }}
1839
- }
1840
- </td>
1841
- }
1842
- </tr>
1843
- </ng-template>
1844
- </p-tree-table>
1934
+ <div class="card">
1935
+ <p-tree-table [value]="files" [columns]="cols" [scrollable]="true" scrollHeight="200px" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
1936
+ <ng-template #header let-columns>
1937
+ <tr>
1938
+ @for (col of columns; track col) {
1939
+ <th>
1940
+ {{ col.header }}
1941
+ </th>
1942
+ }
1943
+ </tr>
1944
+ </ng-template>
1945
+ <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
1946
+ <tr [ttRow]="rowNode">
1947
+ @for (col of columns; let first = $first; track col) {
1948
+ <td>
1949
+ @if (first) {
1950
+ <div class="flex items-center gap-2">
1951
+ <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
1952
+ <span>{{ rowData[col.field] }}</span>
1953
+ </div>
1954
+ } @else {
1955
+ {{ rowData[col.field] }}
1956
+ }
1957
+ </td>
1958
+ }
1959
+ </tr>
1960
+ </ng-template>
1961
+ </p-tree-table>
1962
+ </div>
1845
1963
  `,
1846
1964
  standalone: true,
1847
- imports: [TreeTableModule],
1965
+ imports: [CommonModule, TreeTableModule],
1848
1966
  providers: [NodeService]
1849
1967
  })
1850
1968
  export class TreetableScrollverticalDemo implements OnInit {
1851
1969
  private nodeService = inject(NodeService);
1970
+
1852
1971
  files!: TreeNode[];
1972
+
1853
1973
  cols!: Column[];
1854
1974
 
1855
1975
  ngOnInit() {
@@ -1865,13 +1985,14 @@ export class TreetableScrollverticalDemo implements OnInit {
1865
1985
 
1866
1986
  ## selectioncheckbox-doc
1867
1987
 
1868
- Selection of multiple nodes via checkboxes is enabled by configuring selectionMode as checkbox . In checkbox selection mode, value binding should be a key-value pair where key (or the dataKey) is the node key and value is an object that has checked and partialChecked properties to represent the checked state of a node.
1988
+ Selection of multiple nodes via checkboxes is enabled by configuring selectionMode as checkbox . In checkbox selection mode, selectionKeys binding should be a key-value pair where key (or the dataKey) is the node key and value is an object that has checked and partialChecked properties to represent the checked state of a node.
1869
1989
 
1870
1990
  ```typescript
1871
- import { Component, OnInit, inject } from '@angular/core';
1991
+ import { CommonModule } from '@angular/common';
1992
+ import { Component, inject, OnInit } from '@angular/core';
1993
+ import { TreeNode } from '@exhaustive-ui/core/api';
1872
1994
  import { TreeTableModule } from '@exhaustive-ui/core/treetable';
1873
1995
  import { NodeService } from '@/service/nodeservice';
1874
- import { TreeNode } from '@exhaustive-ui/core/api';
1875
1996
 
1876
1997
  interface Column {
1877
1998
  field: string;
@@ -1880,54 +2001,61 @@ interface Column {
1880
2001
 
1881
2002
  @Component({
1882
2003
  template: `
1883
- <p-tree-table [value]="files" [columns]="cols" selectionMode="checkbox" [(selectionKeys)]="selectionKeys" dataKey="key" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
1884
- <ng-template #header let-columns>
1885
- <tr>
1886
- @for (col of columns; track col) {
1887
- <th>
1888
- {{ col.header }}
1889
- </th>
1890
- }
1891
- </tr>
1892
- </ng-template>
1893
- <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
1894
- <tr [ttRow]="rowNode" [ttSelectableRow]="rowNode">
1895
- @for (col of columns; let first = $first; track col) {
1896
- <td>
1897
- @if (first) {
1898
- <div class="flex items-center gap-2">
1899
- <p-tree-table-toggler [rowNode]="rowNode" />
1900
- <p-tree-table-checkbox [value]="rowNode" />
1901
- <span>{{ rowData[col.field] }}</span>
1902
- </div>
1903
- } @else {
1904
- {{ rowData[col.field] }}
1905
- }
1906
- </td>
1907
- }
1908
- </tr>
1909
- </ng-template>
1910
- </p-tree-table>
2004
+ <div class="card mt-4">
2005
+ <p-tree-table [value]="files" [columns]="cols" selectionMode="checkbox" [(selectionKeys)]="selectionKeys" dataKey="key" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
2006
+ <ng-template #header let-columns>
2007
+ <tr>
2008
+ @for (col of columns; track col) {
2009
+ <th>
2010
+ {{ col.header }}
2011
+ </th>
2012
+ }
2013
+ </tr>
2014
+ </ng-template>
2015
+ <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
2016
+ <tr [ttRow]="rowNode" [ttSelectableRow]="rowNode">
2017
+ @for (col of columns; let first = $first; track col) {
2018
+ <td>
2019
+ @if (first) {
2020
+ <div class="flex items-center gap-2">
2021
+ <p-tree-table-toggler [rowNode]="rowNode" />
2022
+ <p-tree-table-checkbox [value]="rowNode" />
2023
+ <span>{{ rowData[col.field] }}</span>
2024
+ </div>
2025
+ } @else {
2026
+ {{ rowData[col.field] }}
2027
+ }
2028
+ </td>
2029
+ }
2030
+ </tr>
2031
+ </ng-template>
2032
+ </p-tree-table>
2033
+ </div>
1911
2034
  `,
1912
2035
  standalone: true,
1913
- imports: [TreeTableModule],
2036
+ imports: [CommonModule, TreeTableModule],
1914
2037
  providers: [NodeService]
1915
2038
  })
1916
2039
  export class TreetableSelectioncheckboxDemo implements OnInit {
1917
2040
  private nodeService = inject(NodeService);
2041
+
1918
2042
  files!: TreeNode[];
1919
- selectionKeys: any = {};
2043
+
2044
+ selectionKeys = {};
2045
+
1920
2046
  cols!: Column[];
1921
2047
 
1922
2048
  ngOnInit() {
1923
2049
  this.nodeService.getTreeTableNodes().then((files) => {
1924
2050
  this.files = files;
1925
2051
  });
2052
+
1926
2053
  this.cols = [
1927
2054
  { field: 'name', header: 'Name' },
1928
2055
  { field: 'size', header: 'Size' },
1929
2056
  { field: 'type', header: 'Type' }
1930
2057
  ];
2058
+
1931
2059
  this.selectionKeys = {
1932
2060
  '0': {
1933
2061
  partialChecked: true
@@ -1955,10 +2083,12 @@ export class TreetableSelectioncheckboxDemo implements OnInit {
1955
2083
  TreeTable provides onNodeSelect and onNodeUnselect events to listen selection events.
1956
2084
 
1957
2085
  ```typescript
1958
- import { Component, OnInit, inject } from '@angular/core';
2086
+ import { CommonModule } from '@angular/common';
2087
+ import { Component, inject, OnInit } from '@angular/core';
2088
+ import { MessageService, TreeNode } from '@exhaustive-ui/core/api';
2089
+ import { ToastModule } from '@exhaustive-ui/core/toast';
1959
2090
  import { TreeTableModule } from '@exhaustive-ui/core/treetable';
1960
2091
  import { NodeService } from '@/service/nodeservice';
1961
- import { TreeNode, MessageService } from '@exhaustive-ui/core/api';
1962
2092
 
1963
2093
  interface Column {
1964
2094
  field: string;
@@ -1972,57 +2102,64 @@ interface NodeEvent {
1972
2102
 
1973
2103
  @Component({
1974
2104
  template: `
1975
- <p-tree-table
1976
- [value]="files"
1977
- [columns]="cols"
1978
- selectionMode="single"
1979
- [(selection)]="selectedNode"
1980
- dataKey="name"
1981
- (onNodeSelect)="nodeSelect($event)"
1982
- (onNodeUnselect)="nodeUnselect($event)"
1983
- [scrollable]="true"
1984
- [tableStyle]="{ 'min-width': '50rem' }"
1985
- >
1986
- <ng-template #header let-columns>
1987
- <tr>
1988
- @for (col of columns; track col) {
1989
- <th>
1990
- {{ col.header }}
1991
- </th>
1992
- }
1993
- </tr>
1994
- </ng-template>
1995
- <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
1996
- <tr [ttRow]="rowNode" [ttSelectableRow]="rowNode">
1997
- @for (col of columns; let first = $first; track col) {
1998
- <td>
1999
- @if (first) {
2000
- <div class="flex items-center gap-2">
2001
- <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
2002
- <span>{{ rowData[col.field] }}</span>
2003
- </div>
2004
- } @else {
2005
- {{ rowData[col.field] }}
2006
- }
2007
- </td>
2008
- }
2009
- </tr>
2010
- </ng-template>
2011
- </p-tree-table>
2105
+ <div class="card">
2106
+ <p-toast />
2107
+ <p-tree-table
2108
+ [value]="files"
2109
+ [columns]="cols"
2110
+ selectionMode="single"
2111
+ [(selection)]="selectedNode"
2112
+ dataKey="name"
2113
+ (onNodeSelect)="nodeSelect($event)"
2114
+ (onNodeUnselect)="nodeUnselect($event)"
2115
+ [scrollable]="true"
2116
+ [tableStyle]="{ 'min-width': '50rem' }"
2117
+ >
2118
+ <ng-template #header let-columns>
2119
+ <tr>
2120
+ @for (col of columns; track col) {
2121
+ <th>
2122
+ {{ col.header }}
2123
+ </th>
2124
+ }
2125
+ </tr>
2126
+ </ng-template>
2127
+ <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
2128
+ <tr [ttRow]="rowNode" [ttSelectableRow]="rowNode">
2129
+ @for (col of columns; let first = $first; track col) {
2130
+ <td>
2131
+ @if (first) {
2132
+ <div class="flex items-center gap-2">
2133
+ <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
2134
+ <span>{{ rowData[col.field] }}</span>
2135
+ </div>
2136
+ } @else {
2137
+ {{ rowData[col.field] }}
2138
+ }
2139
+ </td>
2140
+ }
2141
+ </tr>
2142
+ </ng-template>
2143
+ </p-tree-table>
2144
+ </div>
2012
2145
  `,
2013
2146
  standalone: true,
2014
- imports: [TreeTableModule],
2015
- providers: [NodeService, MessageService]
2147
+ imports: [CommonModule, TreeTableModule, ToastModule],
2148
+ providers: [MessageService, NodeService]
2016
2149
  })
2017
2150
  export class TreetableSelectioneventscDemo implements OnInit {
2018
2151
  private nodeService = inject(NodeService);
2019
2152
  private messageService = inject(MessageService);
2153
+
2020
2154
  files!: TreeNode[];
2155
+
2021
2156
  selectedNode!: TreeNode;
2157
+
2022
2158
  cols!: Column[];
2023
2159
 
2024
2160
  ngOnInit() {
2025
2161
  this.nodeService.getFilesystem().then((files) => (this.files = files));
2162
+
2026
2163
  this.cols = [
2027
2164
  { field: 'name', header: 'Name' },
2028
2165
  { field: 'size', header: 'Size' },
@@ -2045,11 +2182,13 @@ export class TreetableSelectioneventscDemo implements OnInit {
2045
2182
  More than one node is selectable by setting selectionMode to multiple . By default in multiple selection mode, metaKey press (e.g. ⌘ ) is necessary to add to existing selections however this can be configured with disabling the metaKeySelection property. Note that in touch enabled devices, TreeTable always ignores metaKey.
2046
2183
 
2047
2184
  ```typescript
2048
- import { Component, OnInit, inject } from '@angular/core';
2049
- import { TreeTable, TreeTableModule } from '@exhaustive-ui/core/treetable';
2050
- import { NodeService } from '@/service/nodeservice';
2185
+ import { CommonModule } from '@angular/common';
2186
+ import { Component, inject, OnInit } from '@angular/core';
2187
+ import { FormsModule } from '@angular/forms';
2051
2188
  import { TreeNode } from '@exhaustive-ui/core/api';
2052
- import { TreeTable } from '@exhaustive-ui/core/treetable';
2189
+ import { ToggleSwitchModule } from '@exhaustive-ui/core/toggleswitch';
2190
+ import { TreeTableModule } from '@exhaustive-ui/core/treetable';
2191
+ import { NodeService } from '@/service/nodeservice';
2053
2192
 
2054
2193
  interface Column {
2055
2194
  field: string;
@@ -2058,47 +2197,58 @@ interface Column {
2058
2197
 
2059
2198
  @Component({
2060
2199
  template: `
2061
- <p-tree-table [value]="files" [columns]="cols" selectionMode="multiple" [(selection)]="selectedNodes" dataKey="name" [metaKeySelection]="metaKeySelection" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
2062
- <ng-template #header let-columns>
2063
- <tr>
2064
- @for (col of columns; track col) {
2065
- <th>
2066
- {{ col.header }}
2067
- </th>
2068
- }
2069
- </tr>
2070
- </ng-template>
2071
- <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
2072
- <tr [ttRow]="rowNode" [ttSelectableRow]="rowNode">
2073
- @for (col of columns; let first = $first; track col) {
2074
- <td>
2075
- @if (first) {
2076
- <div class="flex items-center gap-2">
2077
- <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
2078
- <span>{{ rowData[col.field] }}</span>
2079
- </div>
2080
- } @else {
2081
- {{ rowData[col.field] }}
2082
- }
2083
- </td>
2084
- }
2085
- </tr>
2086
- </ng-template>
2087
- </p-tree-table>
2200
+ <div class="card">
2201
+ <div class="flex gap-4 items-center justify-center mb-6">
2202
+ <p-toggle-switch [(ngModel)]="metaKeySelection" inputId="metakey-multiple" />
2203
+ <label for="metakey-multiple">Metakey</label>
2204
+ </div>
2205
+ <p-tree-table [value]="files" [columns]="cols" selectionMode="multiple" [(selection)]="selectedNodes" dataKey="name" [metaKeySelection]="metaKeySelection" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
2206
+ <ng-template #header let-columns>
2207
+ <tr>
2208
+ @for (col of columns; track col) {
2209
+ <th>
2210
+ {{ col.header }}
2211
+ </th>
2212
+ }
2213
+ </tr>
2214
+ </ng-template>
2215
+ <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
2216
+ <tr [ttRow]="rowNode" [ttSelectableRow]="rowNode">
2217
+ @for (col of columns; let first = $first; track col) {
2218
+ <td>
2219
+ @if (first) {
2220
+ <div class="flex items-center gap-2">
2221
+ <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
2222
+ <span>{{ rowData[col.field] }}</span>
2223
+ </div>
2224
+ } @else {
2225
+ {{ rowData[col.field] }}
2226
+ }
2227
+ </td>
2228
+ }
2229
+ </tr>
2230
+ </ng-template>
2231
+ </p-tree-table>
2232
+ </div>
2088
2233
  `,
2089
2234
  standalone: true,
2090
- imports: [TreeTableModule],
2235
+ imports: [CommonModule, FormsModule, TreeTableModule, ToggleSwitchModule],
2091
2236
  providers: [NodeService]
2092
2237
  })
2093
2238
  export class TreetableSelectionmultipleDemo implements OnInit {
2094
2239
  private nodeService = inject(NodeService);
2240
+
2095
2241
  metaKeySelection: boolean = true;
2242
+
2096
2243
  files!: TreeNode[];
2244
+
2097
2245
  selectedNodes!: TreeNode[];
2246
+
2098
2247
  cols!: Column[];
2099
2248
 
2100
2249
  ngOnInit() {
2101
2250
  this.nodeService.getFilesystem().then((files) => (this.files = files));
2251
+
2102
2252
  this.cols = [
2103
2253
  { field: 'name', header: 'Name' },
2104
2254
  { field: 'size', header: 'Size' },
@@ -2113,10 +2263,13 @@ export class TreetableSelectionmultipleDemo implements OnInit {
2113
2263
  Single node selection is configured by setting selectionMode as single along with selection properties to manage the selection value binding. By default, metaKey press (e.g. ⌘ ) is necessary to unselect a node however this can be configured with disabling the metaKeySelection property. In touch enabled devices this option has no effect and behavior is same as setting it to false
2114
2264
 
2115
2265
  ```typescript
2116
- import { Component, OnInit, inject } from '@angular/core';
2266
+ import { CommonModule } from '@angular/common';
2267
+ import { Component, inject, OnInit } from '@angular/core';
2268
+ import { FormsModule } from '@angular/forms';
2269
+ import { TreeNode } from '@exhaustive-ui/core/api';
2270
+ import { ToggleSwitchModule } from '@exhaustive-ui/core/toggleswitch';
2117
2271
  import { TreeTableModule } from '@exhaustive-ui/core/treetable';
2118
2272
  import { NodeService } from '@/service/nodeservice';
2119
- import { TreeNode } from '@exhaustive-ui/core/api';
2120
2273
 
2121
2274
  interface Column {
2122
2275
  field: string;
@@ -2125,47 +2278,58 @@ interface Column {
2125
2278
 
2126
2279
  @Component({
2127
2280
  template: `
2128
- <p-tree-table [value]="files" [columns]="cols" selectionMode="single" [metaKeySelection]="metaKeySelection" [(selection)]="selectedNode" dataKey="name" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
2129
- <ng-template #header let-columns>
2130
- <tr>
2131
- @for (col of columns; track col) {
2132
- <th>
2133
- {{ col.header }}
2134
- </th>
2135
- }
2136
- </tr>
2137
- </ng-template>
2138
- <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
2139
- <tr [ttRow]="rowNode" [ttSelectableRow]="rowNode">
2140
- @for (col of columns; let first = $first; track col) {
2141
- <td>
2142
- @if (first) {
2143
- <div class="flex items-center gap-2">
2144
- <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
2145
- <span>{{ rowData[col.field] }}</span>
2146
- </div>
2147
- } @else {
2148
- {{ rowData[col.field] }}
2149
- }
2150
- </td>
2151
- }
2152
- </tr>
2153
- </ng-template>
2154
- </p-tree-table>
2281
+ <div class="card">
2282
+ <div class="flex gap-4 items-center justify-center mb-6">
2283
+ <p-toggle-switch [(ngModel)]="metaKeySelection" inputId="metakey-single" />
2284
+ <label for="metakey-single">Metakey</label>
2285
+ </div>
2286
+ <p-tree-table [value]="files" [columns]="cols" selectionMode="single" [metaKeySelection]="metaKeySelection" [(selection)]="selectedNode" dataKey="name" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
2287
+ <ng-template #header let-columns>
2288
+ <tr>
2289
+ @for (col of columns; track col) {
2290
+ <th>
2291
+ {{ col.header }}
2292
+ </th>
2293
+ }
2294
+ </tr>
2295
+ </ng-template>
2296
+ <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
2297
+ <tr [ttRow]="rowNode" [ttSelectableRow]="rowNode">
2298
+ @for (col of columns; let first = $first; track col) {
2299
+ <td>
2300
+ @if (first) {
2301
+ <div class="flex items-center gap-2">
2302
+ <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
2303
+ <span>{{ rowData[col.field] }}</span>
2304
+ </div>
2305
+ } @else {
2306
+ {{ rowData[col.field] }}
2307
+ }
2308
+ </td>
2309
+ }
2310
+ </tr>
2311
+ </ng-template>
2312
+ </p-tree-table>
2313
+ </div>
2155
2314
  `,
2156
2315
  standalone: true,
2157
- imports: [TreeTableModule],
2316
+ imports: [CommonModule, FormsModule, TreeTableModule, ToggleSwitchModule],
2158
2317
  providers: [NodeService]
2159
2318
  })
2160
2319
  export class TreetableSelectionsingleDemo implements OnInit {
2161
2320
  private nodeService = inject(NodeService);
2321
+
2162
2322
  metaKeySelection: boolean = true;
2323
+
2163
2324
  files!: TreeNode[];
2325
+
2164
2326
  selectedNode!: TreeNode;
2327
+
2165
2328
  cols!: Column[];
2166
2329
 
2167
2330
  ngOnInit() {
2168
2331
  this.nodeService.getFilesystem().then((files) => (this.files = files));
2332
+
2169
2333
  this.cols = [
2170
2334
  { field: 'name', header: 'Name' },
2171
2335
  { field: 'size', header: 'Size' },
@@ -2180,47 +2344,61 @@ export class TreetableSelectionsingleDemo implements OnInit {
2180
2344
  In addition to a regular treetable, alternatives with alternative sizes are available. Add p-treetable-sm class to reduce the size of treetable or p-treetable-lg to enlarge it.
2181
2345
 
2182
2346
  ```typescript
2183
- import { Component, OnInit, inject } from '@angular/core';
2347
+ import { CommonModule } from '@angular/common';
2348
+ import { Component, inject, OnInit } from '@angular/core';
2349
+ import { FormsModule } from '@angular/forms';
2350
+ import { TreeNode } from '@exhaustive-ui/core/api';
2351
+ import { SelectButtonModule } from '@exhaustive-ui/core/selectbutton';
2184
2352
  import { TreeTableModule } from '@exhaustive-ui/core/treetable';
2185
2353
  import { NodeService } from '@/service/nodeservice';
2186
- import { TreeNode } from '@exhaustive-ui/core/api';
2187
2354
 
2188
2355
  @Component({
2189
2356
  template: `
2190
- <p-tree-table [value]="files" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }" [class]="selectedSize">
2191
- <ng-template #header>
2192
- <tr>
2193
- <th>Name</th>
2194
- <th>Size</th>
2195
- <th>Type</th>
2196
- </tr>
2197
- </ng-template>
2198
- <ng-template #body let-rowNode let-rowData="rowData">
2199
- <tr [ttRow]="rowNode">
2200
- <td>
2201
- <div class="flex items-center gap-2">
2202
- <p-tree-table-toggler [rowNode]="rowNode" />
2203
- <span>{{ rowData.name }}</span>
2204
- </div>
2205
- </td>
2206
- <td>{{ rowData.size }}</td>
2207
- <td>{{ rowData.type }}</td>
2208
- </tr>
2209
- </ng-template>
2210
- </p-tree-table>
2357
+ <section class="py-6">
2358
+ <div class="card">
2359
+ <div class="flex justify-center mb-4">
2360
+ <p-select-button [options]="sizes" [(ngModel)]="selectedSize" [multiple]="false" optionLabel="name" optionValue="class" />
2361
+ </div>
2362
+ <p-tree-table [value]="files" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }" [class]="selectedSize">
2363
+ <ng-template #header>
2364
+ <tr>
2365
+ <th>Name</th>
2366
+ <th>Size</th>
2367
+ <th>Type</th>
2368
+ </tr>
2369
+ </ng-template>
2370
+ <ng-template #body let-rowNode let-rowData="rowData">
2371
+ <tr [ttRow]="rowNode">
2372
+ <td>
2373
+ <div class="flex items-center gap-2">
2374
+ <p-tree-table-toggler [rowNode]="rowNode" />
2375
+ <span>{{ rowData.name }}</span>
2376
+ </div>
2377
+ </td>
2378
+ <td>{{ rowData.size }}</td>
2379
+ <td>{{ rowData.type }}</td>
2380
+ </tr>
2381
+ </ng-template>
2382
+ </p-tree-table>
2383
+ </div>
2384
+ </section>
2211
2385
  `,
2212
2386
  standalone: true,
2213
- imports: [TreeTableModule],
2387
+ imports: [CommonModule, FormsModule, TreeTableModule, SelectButtonModule],
2214
2388
  providers: [NodeService]
2215
2389
  })
2216
2390
  export class TreetableSizeDemo implements OnInit {
2217
2391
  private nodeService = inject(NodeService);
2392
+
2218
2393
  files!: TreeNode[];
2394
+
2219
2395
  sizes!: any[];
2396
+
2220
2397
  selectedSize: any = '';
2221
2398
 
2222
2399
  ngOnInit() {
2223
2400
  this.nodeService.getFilesystem().then((files) => (this.files = files));
2401
+
2224
2402
  this.sizes = [
2225
2403
  { name: 'Small', class: 'p-treetable-sm' },
2226
2404
  { name: 'Normal', class: '' },
@@ -2235,10 +2413,11 @@ export class TreetableSizeDemo implements OnInit {
2235
2413
  Multiple columns can be sorted by defining sortMode as multiple . This mode requires metaKey (e.g. ⌘ ) to be pressed when clicking a header.
2236
2414
 
2237
2415
  ```typescript
2238
- import { Component, OnInit, inject } from '@angular/core';
2416
+ import { CommonModule } from '@angular/common';
2417
+ import { Component, inject, OnInit } from '@angular/core';
2418
+ import { TreeNode } from '@exhaustive-ui/core/api';
2239
2419
  import { TreeTableModule } from '@exhaustive-ui/core/treetable';
2240
2420
  import { NodeService } from '@/service/nodeservice';
2241
- import { TreeNode } from '@exhaustive-ui/core/api';
2242
2421
 
2243
2422
  interface Column {
2244
2423
  field: string;
@@ -2247,48 +2426,53 @@ interface Column {
2247
2426
 
2248
2427
  @Component({
2249
2428
  template: `
2250
- <p-tree-table [value]="files" [columns]="cols" sortMode="multiple" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
2251
- <ng-template #header let-columns>
2252
- <tr>
2253
- @for (col of columns; track col) {
2254
- <th [ttSortableColumn]="col.field">
2255
- <div class="flex items-center gap-2">
2256
- {{ col.header }}
2257
- <p-tree-table-sort-icon [field]="col.field" />
2258
- </div>
2259
- </th>
2260
- }
2261
- </tr>
2262
- </ng-template>
2263
- <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
2264
- <tr [ttRow]="rowNode">
2265
- @for (col of columns; let first = $first; track col) {
2266
- <td>
2267
- @if (first) {
2429
+ <div class="card">
2430
+ <p-tree-table [value]="files" [columns]="cols" sortMode="multiple" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
2431
+ <ng-template #header let-columns>
2432
+ <tr>
2433
+ @for (col of columns; track col) {
2434
+ <th [ttSortableColumn]="col.field">
2268
2435
  <div class="flex items-center gap-2">
2269
- <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
2270
- <span>{{ rowData[col.field] }}</span>
2436
+ {{ col.header }}
2437
+ <p-tree-table-sort-icon [field]="col.field" />
2271
2438
  </div>
2272
- } @else {
2273
- {{ rowData[col.field] }}
2274
- }
2275
- </td>
2276
- }
2277
- </tr>
2278
- </ng-template>
2279
- </p-tree-table>
2439
+ </th>
2440
+ }
2441
+ </tr>
2442
+ </ng-template>
2443
+ <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
2444
+ <tr [ttRow]="rowNode">
2445
+ @for (col of columns; let first = $first; track col) {
2446
+ <td>
2447
+ @if (first) {
2448
+ <div class="flex items-center gap-2">
2449
+ <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
2450
+ <span>{{ rowData[col.field] }}</span>
2451
+ </div>
2452
+ } @else {
2453
+ {{ rowData[col.field] }}
2454
+ }
2455
+ </td>
2456
+ }
2457
+ </tr>
2458
+ </ng-template>
2459
+ </p-tree-table>
2460
+ </div>
2280
2461
  `,
2281
2462
  standalone: true,
2282
- imports: [TreeTableModule],
2463
+ imports: [CommonModule, TreeTableModule],
2283
2464
  providers: [NodeService]
2284
2465
  })
2285
2466
  export class TreetableSortmultiplecolumnsDemo implements OnInit {
2286
2467
  private nodeService = inject(NodeService);
2468
+
2287
2469
  files!: TreeNode[];
2470
+
2288
2471
  cols!: Column[];
2289
2472
 
2290
2473
  ngOnInit() {
2291
2474
  this.nodeService.getFilesystem().then((files) => (this.files = files));
2475
+
2292
2476
  this.cols = [
2293
2477
  { field: 'name', header: 'Name' },
2294
2478
  { field: 'size', header: 'Size' },
@@ -2303,11 +2487,11 @@ export class TreetableSortmultiplecolumnsDemo implements OnInit {
2303
2487
  The removable sort can be implemented using the customSort property.
2304
2488
 
2305
2489
  ```typescript
2306
- import { Component, OnInit, inject } from '@angular/core';
2490
+ import { Component, ViewChild, inject, OnInit } from '@angular/core';
2491
+ import { CommonModule } from '@angular/common';
2492
+ import { SortEvent, TreeNode } from '@exhaustive-ui/core/api';
2307
2493
  import { TreeTable, TreeTableModule } from '@exhaustive-ui/core/treetable';
2308
2494
  import { NodeService } from '@/service/nodeservice';
2309
- import { TreeNode, SortEvent } from '@exhaustive-ui/core/api';
2310
- import { TreeTable } from '@exhaustive-ui/core/treetable';
2311
2495
 
2312
2496
  interface Column {
2313
2497
  field: string;
@@ -2316,48 +2500,58 @@ interface Column {
2316
2500
 
2317
2501
  @Component({
2318
2502
  template: `
2319
- <p-tree-table
2320
- #tt
2321
- [value]="files"
2322
- (sortFunction)="customSort($event)"
2323
- [customSort]="true"
2324
- [columns]="cols"
2325
- selectionMode="single"
2326
- [metaKeySelection]="metaKeySelection"
2327
- [(selection)]="selectedNode"
2328
- dataKey="name"
2329
- [scrollable]="true"
2330
- [tableStyle]="{ 'min-width': '50rem' }"
2331
- >
2332
- <ng-template pTemplate="header" let-columns>
2333
- <tr>
2334
- <th *ngFor="let col of columns" [ttSortableColumn]="col.field">
2335
- {{ col.header }}
2336
- <p-tree-table-sort-icon [field]="col.field" />
2337
- </th>
2338
- </tr>
2339
- </ng-template>
2340
- <ng-template pTemplate="body" let-rowNode let-rowData="rowData" let-columns="columns">
2341
- <tr [ttRow]="rowNode" [ttSelectableRow]="rowNode">
2342
- <td *ngFor="let col of columns; let i = index">
2343
- <p-tree-table-toggler [rowNode]="rowNode" *ngIf="i === 0" />
2344
- {{ rowData[col.field] }}
2345
- </td>
2346
- </tr>
2347
- </ng-template>
2348
- </p-tree-table>
2503
+ <div class="card">
2504
+ <p-tree-table
2505
+ #tt
2506
+ [value]="files"
2507
+ (sortFunction)="customSort($event)"
2508
+ [customSort]="true"
2509
+ [columns]="cols"
2510
+ selectionMode="single"
2511
+ [metaKeySelection]="metaKeySelection"
2512
+ [(selection)]="selectedNode"
2513
+ dataKey="name"
2514
+ [scrollable]="true"
2515
+ [tableStyle]="{ 'min-width': '50rem' }"
2516
+ >
2517
+ <ng-template #header let-columns>
2518
+ <tr>
2519
+ <th *ngFor="let col of columns" [ttSortableColumn]="col.field">
2520
+ {{ col.header }}
2521
+ <p-tree-table-sort-icon [field]="col.field" />
2522
+ </th>
2523
+ </tr>
2524
+ </ng-template>
2525
+ <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
2526
+ <tr [ttRow]="rowNode" [ttSelectableRow]="rowNode">
2527
+ <td *ngFor="let col of columns; let i = index">
2528
+ <p-tree-table-toggler [rowNode]="rowNode" *ngIf="i === 0" />
2529
+ {{ rowData[col.field] }}
2530
+ </td>
2531
+ </tr>
2532
+ </ng-template>
2533
+ </p-tree-table>
2534
+ </div>
2349
2535
  `,
2350
2536
  standalone: true,
2351
- imports: [TreeTableModule],
2537
+ imports: [CommonModule, TreeTableModule],
2352
2538
  providers: [NodeService]
2353
2539
  })
2354
2540
  export class TreetableSortremovableDemo implements OnInit {
2355
2541
  private nodeService = inject(NodeService);
2542
+
2543
+ @ViewChild('tt') tt: TreeTable;
2544
+
2356
2545
  metaKeySelection: boolean = true;
2546
+
2357
2547
  files!: TreeNode[];
2548
+
2358
2549
  initialValue: TreeNode[];
2550
+
2359
2551
  selectedNode!: TreeNode;
2552
+
2360
2553
  cols!: Column[];
2554
+
2361
2555
  isSorted: boolean = null;
2362
2556
 
2363
2557
  ngOnInit() {
@@ -2365,13 +2559,13 @@ export class TreetableSortremovableDemo implements OnInit {
2365
2559
  this.files = files;
2366
2560
  this.initialValue = [...files];
2367
2561
  });
2562
+
2368
2563
  this.cols = [
2369
2564
  { field: 'name', header: 'Name' },
2370
2565
  { field: 'size', header: 'Size' },
2371
2566
  { field: 'type', header: 'Type' }
2372
2567
  ];
2373
2568
  }
2374
-
2375
2569
  customSort(event: SortEvent) {
2376
2570
  if (this.isSorted == null || this.isSorted === undefined) {
2377
2571
  this.isSorted = true;
@@ -2396,7 +2590,7 @@ export class TreetableSortremovableDemo implements OnInit {
2396
2590
  else if (value1 == null && value2 == null) result = 0;
2397
2591
  else if (typeof value1 === 'string' && typeof value2 === 'string') result = value1.localeCompare(value2);
2398
2592
  else result = value1 < value2 ? -1 : value1 > value2 ? 1 : 0;
2399
-
2593
+
2400
2594
  return event.order * result;
2401
2595
  });
2402
2596
  }
@@ -2408,10 +2602,11 @@ export class TreetableSortremovableDemo implements OnInit {
2408
2602
  Sorting on a column is enabled by adding the ttSortableColumn property.
2409
2603
 
2410
2604
  ```typescript
2411
- import { Component, OnInit, inject } from '@angular/core';
2605
+ import { CommonModule } from '@angular/common';
2606
+ import { Component, inject, OnInit } from '@angular/core';
2607
+ import { TreeNode } from '@exhaustive-ui/core/api';
2412
2608
  import { TreeTableModule } from '@exhaustive-ui/core/treetable';
2413
2609
  import { NodeService } from '@/service/nodeservice';
2414
- import { TreeNode } from '@exhaustive-ui/core/api';
2415
2610
 
2416
2611
  interface Column {
2417
2612
  field: string;
@@ -2420,48 +2615,53 @@ interface Column {
2420
2615
 
2421
2616
  @Component({
2422
2617
  template: `
2423
- <p-tree-table [value]="files" [columns]="cols" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
2424
- <ng-template #header let-columns>
2425
- <tr>
2426
- @for (col of columns; track col) {
2427
- <th [ttSortableColumn]="col.field">
2428
- <div class="flex items-center gap-2">
2429
- {{ col.header }}
2430
- <p-tree-table-sort-icon [field]="col.field" />
2431
- </div>
2432
- </th>
2433
- }
2434
- </tr>
2435
- </ng-template>
2436
- <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
2437
- <tr [ttRow]="rowNode">
2438
- @for (col of columns; let first = $first; track col) {
2439
- <td>
2440
- @if (first) {
2618
+ <div class="card">
2619
+ <p-tree-table [value]="files" [columns]="cols" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
2620
+ <ng-template #header let-columns>
2621
+ <tr>
2622
+ @for (col of columns; track col) {
2623
+ <th [ttSortableColumn]="col.field">
2441
2624
  <div class="flex items-center gap-2">
2442
- <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
2443
- <span>{{ rowData[col.field] }}</span>
2625
+ {{ col.header }}
2626
+ <p-tree-table-sort-icon [field]="col.field" />
2444
2627
  </div>
2445
- } @else {
2446
- {{ rowData[col.field] }}
2447
- }
2448
- </td>
2449
- }
2450
- </tr>
2451
- </ng-template>
2452
- </p-tree-table>
2628
+ </th>
2629
+ }
2630
+ </tr>
2631
+ </ng-template>
2632
+ <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
2633
+ <tr [ttRow]="rowNode">
2634
+ @for (col of columns; let first = $first; track col) {
2635
+ <td>
2636
+ @if (first) {
2637
+ <div class="flex items-center gap-2">
2638
+ <p-tree-table-toggler [rowNode]="rowNode"></p-tree-table-toggler>
2639
+ <span>{{ rowData[col.field] }}</span>
2640
+ </div>
2641
+ } @else {
2642
+ {{ rowData[col.field] }}
2643
+ }
2644
+ </td>
2645
+ }
2646
+ </tr>
2647
+ </ng-template>
2648
+ </p-tree-table>
2649
+ </div>
2453
2650
  `,
2454
2651
  standalone: true,
2455
- imports: [TreeTableModule],
2652
+ imports: [CommonModule, TreeTableModule],
2456
2653
  providers: [NodeService]
2457
2654
  })
2458
2655
  export class TreetableSortsinglecolumnDemo implements OnInit {
2459
2656
  private nodeService = inject(NodeService);
2657
+
2460
2658
  files!: TreeNode[];
2659
+
2461
2660
  cols!: Column[];
2462
2661
 
2463
2662
  ngOnInit() {
2464
2663
  this.nodeService.getFilesystem().then((files) => (this.files = files));
2664
+
2465
2665
  this.cols = [
2466
2666
  { field: 'name', header: 'Name' },
2467
2667
  { field: 'size', header: 'Size' },
@@ -2476,11 +2676,12 @@ export class TreetableSortsinglecolumnDemo implements OnInit {
2476
2676
  Custom content at caption , header , body and summary sections are supported via templating.
2477
2677
 
2478
2678
  ```typescript
2479
- import { Component, OnInit, inject } from '@angular/core';
2679
+ import { CommonModule } from '@angular/common';
2680
+ import { Component, inject, OnInit } from '@angular/core';
2681
+ import { TreeNode } from '@exhaustive-ui/core/api';
2480
2682
  import { ButtonModule } from '@exhaustive-ui/core/button';
2481
2683
  import { TreeTableModule } from '@exhaustive-ui/core/treetable';
2482
2684
  import { NodeService } from '@/service/nodeservice';
2483
- import { TreeNode } from '@exhaustive-ui/core/api';
2484
2685
 
2485
2686
  interface Column {
2486
2687
  field: string;
@@ -2489,52 +2690,56 @@ interface Column {
2489
2690
 
2490
2691
  @Component({
2491
2692
  template: `
2492
- <p-tree-table [value]="files" [columns]="cols" [tableStyle]="{ 'min-width': '50rem' }">
2493
- <ng-template #caption><div class="text-xl font-bold">File Viewer</div> </ng-template>
2494
- <ng-template #header let-columns>
2495
- <tr>
2496
- @for (col of columns; let last = $last; track col) {
2497
- <th [class]="{ 'w-40': last }">
2498
- {{ col.header }}
2499
- </th>
2500
- }
2501
- </tr>
2502
- </ng-template>
2503
- <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
2504
- <tr [ttRow]="rowNode">
2505
- @for (col of columns; let first = $first; let last = $last; track col) {
2506
- <td>
2507
- @if (first) {
2508
- <div class="flex items-center gap-2">
2509
- <p-tree-table-toggler [rowNode]="rowNode" />
2693
+ <div class="card">
2694
+ <p-tree-table [value]="files" [columns]="cols" [tableStyle]="{ 'min-width': '50rem' }">
2695
+ <ng-template #caption><div class="text-xl font-bold">File Viewer</div> </ng-template>
2696
+ <ng-template #header let-columns>
2697
+ <tr>
2698
+ @for (col of columns; let last = $last; track col) {
2699
+ <th [class]="{ 'w-40': last }">
2700
+ {{ col.header }}
2701
+ </th>
2702
+ }
2703
+ </tr>
2704
+ </ng-template>
2705
+ <ng-template #body let-rowNode let-rowData="rowData" let-columns="columns">
2706
+ <tr [ttRow]="rowNode">
2707
+ @for (col of columns; let first = $first; let last = $last; track col) {
2708
+ <td>
2709
+ @if (first) {
2710
+ <div class="flex items-center gap-2">
2711
+ <p-tree-table-toggler [rowNode]="rowNode" />
2712
+ <span>{{ rowData[col.field] }}</span>
2713
+ </div>
2714
+ } @else if (last) {
2715
+ <div class="flex flex-wrap gap-2">
2716
+ <p-button icon="pi pi-search" rounded="true" severity="secondary" />
2717
+ <p-button icon="pi pi-pencil" rounded="true" severity="secondary" />
2718
+ </div>
2719
+ } @else {
2510
2720
  <span>{{ rowData[col.field] }}</span>
2511
- </div>
2512
- } @else if (last) {
2513
- <div class="flex flex-wrap gap-2">
2514
- <p-button icon="pi pi-search" rounded="true" severity="secondary" />
2515
- <p-button icon="pi pi-pencil" rounded="true" severity="secondary" />
2516
- </div>
2517
- } @else {
2518
- <span>{{ rowData[col.field] }}</span>
2519
- }
2520
- </td>
2521
- }
2522
- </tr>
2523
- </ng-template>
2524
- <ng-template #summary>
2525
- <div style="text-align:left">
2526
- <p-button icon="pi pi-refresh" label="Reload" severity="warn" />
2527
- </div>
2528
- </ng-template>
2529
- </p-tree-table>
2721
+ }
2722
+ </td>
2723
+ }
2724
+ </tr>
2725
+ </ng-template>
2726
+ <ng-template #summary>
2727
+ <div style="text-align:left">
2728
+ <p-button icon="pi pi-refresh" label="Reload" severity="warn" />
2729
+ </div>
2730
+ </ng-template>
2731
+ </p-tree-table>
2732
+ </div>
2530
2733
  `,
2531
2734
  standalone: true,
2532
- imports: [ButtonModule, TreeTableModule],
2735
+ imports: [CommonModule, TreeTableModule, ButtonModule],
2533
2736
  providers: [NodeService]
2534
2737
  })
2535
2738
  export class TreetableTemplateDemo implements OnInit {
2536
2739
  private nodeService = inject(NodeService);
2740
+
2537
2741
  files!: TreeNode[];
2742
+
2538
2743
  cols!: Column[];
2539
2744
 
2540
2745
  ngOnInit() {
@@ -2557,71 +2762,71 @@ TreeTable is used to display hierarchical data in tabular format.
2557
2762
 
2558
2763
  | Name | Type | Default | Description |
2559
2764
  |------|------|---------|-------------|
2560
- | dt | InputSignal<Object> | undefined | Defines scoped design tokens of the component. |
2561
- | unstyled | InputSignal<boolean> | undefined | Indicates whether the component should be rendered without styles. |
2562
- | pt | InputSignal<TreeTablePassThrough> | undefined | Used to pass attributes to DOM elements inside the component. |
2563
- | ptOptions | InputSignal<PassThroughOptions> | undefined | Used to configure passthrough(pt) options of the component. |
2564
- | columns | InputSignal<any[]> | ... | An array of objects to represent dynamic columns. |
2565
- | tableStyle | InputSignal<{ [klass: string]: any }> | ... | Inline style of the table. |
2566
- | tableStyleClass | InputSignal<string> | ... | Style class of the table. |
2567
- | autoLayout | InputSignalWithTransform<boolean, unknown> | ... | Whether the cell widths scale according to their content or not. |
2568
- | lazy | InputSignalWithTransform<boolean, unknown> | ... | Defines if data is loaded and interacted with in lazy manner. |
2569
- | lazyLoadOnInit | InputSignalWithTransform<boolean, unknown> | ... | Whether to call lazy loading on initialization. |
2570
- | paginator | InputSignalWithTransform<boolean, unknown> | ... | When specified as true, enables the pagination. |
2571
- | rows | ModelSignal<number> | ... | Number of rows to display per page, supports one or two-way binding. Emits `rowsChange` with the row count on rows change. |
2572
- | first | ModelSignal<number> | ... | Index of the first row to be displayed, supports one or two-way binding. Emits `firstChange` with the first element on pagination. |
2573
- | pageLinks | InputSignalWithTransform<number, unknown> | ... | Number of page links to display in paginator. |
2574
- | rowsPerPageOptions | InputSignal<any[]> | ... | Array of integer/object values to display inside rows per page dropdown of paginator |
2575
- | alwaysShowPaginator | InputSignalWithTransform<boolean, unknown> | ... | Whether to show it even there is only one page. |
2576
- | paginatorPosition | InputSignal<"top" \| "bottom" \| "both"> | ... | Position of the paginator. |
2577
- | paginatorStyleClass | InputSignal<string> | ... | Custom style class for paginator |
2578
- | 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). |
2579
- | currentPageReportTemplate | InputSignal<string> | ... | Template of the current page report element. Available placeholders are {currentPage},{totalPages},{rows},{first},{last} and {totalRecords} |
2580
- | showCurrentPageReport | InputSignalWithTransform<boolean, unknown> | ... | Whether to display current page report. |
2581
- | showJumpToPageDropdown | InputSignalWithTransform<boolean, unknown> | ... | Whether to display a dropdown to navigate to any page. |
2582
- | showFirstLastIcon | InputSignalWithTransform<boolean, unknown> | ... | When enabled, icons are displayed on paginator to go first and last page. |
2583
- | showPageLinks | InputSignalWithTransform<boolean, unknown> | ... | Whether to show page links. |
2584
- | defaultSortOrder | InputSignalWithTransform<number, unknown> | ... | Sort order to use when an unsorted column gets sorted by user interaction. |
2585
- | sortMode | InputSignal<"multiple" \| "single"> | ... | Defines whether sorting works on single column or on multiple columns. |
2586
- | resetPageOnSort | InputSignalWithTransform<boolean, unknown> | ... | When true, resets paginator to first page after sorting. |
2587
- | customSort | InputSignalWithTransform<boolean, unknown> | ... | Whether to use the default sorting or a custom one using sortFunction. |
2588
- | selectionMode | InputSignal<string> | ... | Specifies the selection mode, valid values are "single" and "multiple". |
2589
- | contextMenuSelection | ModelSignal<any> | ... | Selected row with a context menu, supports one or two-way binding. Emits `contextMenuSelectionChange` with the node instance on context menu selection change. |
2590
- | contextMenuSelectionMode | InputSignal<string> | ... | Mode of the contet menu selection. |
2591
- | dataKey | InputSignal<string> | ... | A property to uniquely identify a record in data. |
2592
- | metaKeySelection | InputSignalWithTransform<boolean, unknown> | ... | Defines whether metaKey is should be considered for the selection. On touch enabled devices, metaKeySelection is turned off automatically. |
2593
- | compareSelectionBy | InputSignal<string> | ... | Algorithm to define if a row is selected, valid values are "equals" that compares by reference and "deepEquals" that compares all fields. |
2594
- | rowHover | InputSignalWithTransform<boolean, unknown> | ... | Adds hover effect to rows without the need for selectionMode. |
2595
- | loading | InputSignalWithTransform<boolean, unknown> | ... | Displays a loader to indicate data load is in progress. |
2596
- | loadingIcon | InputSignal<string> | ... | The icon to show while indicating data load is in progress. |
2597
- | showLoader | InputSignalWithTransform<boolean, unknown> | ... | Whether to show the loading mask when loading property is true. |
2598
- | scrollable | InputSignalWithTransform<boolean, unknown> | ... | When specified, enables horizontal and/or vertical scrolling. |
2599
- | scrollHeight | InputSignal<string> | ... | Height of the scroll viewport in fixed pixels or the "flex" keyword for a dynamic size. |
2600
- | virtualScroll | InputSignalWithTransform<boolean, unknown> | ... | Whether the data should be loaded on demand during scroll. |
2601
- | virtualScrollItemSize | InputSignalWithTransform<number, unknown> | ... | Height of a row to use in calculations of virtual scrolling. |
2602
- | virtualScrollOptions | InputSignal<ScrollerOptions> | ... | Whether to use the scroller feature. The properties of scroller component can be used like an object in it. |
2603
- | virtualScrollDelay | InputSignalWithTransform<number, unknown> | ... | The delay (in milliseconds) before triggering the virtual scroll. This determines the time gap between the user's scroll action and the actual rendering of the next set of items in the virtual scroll. |
2604
- | frozenWidth | InputSignal<string> | ... | Width of the frozen columns container. |
2605
- | frozenColumns | InputSignal<{ [klass: string]: any }> | ... | An array of objects to represent dynamic columns that are frozen. |
2606
- | resizableColumns | InputSignalWithTransform<boolean, unknown> | ... | When enabled, columns can be resized using drag and drop. |
2607
- | columnResizeMode | InputSignal<string> | ... | Defines whether the overall table width should change on column resize, valid values are "fit" and "expand". |
2608
- | reorderableColumns | InputSignalWithTransform<boolean, unknown> | ... | When enabled, columns can be reordered using drag and drop. |
2609
- | contextMenu | InputSignal<any> | ... | Local ng-template varilable of a ContextMenu. |
2610
- | rowTrackBy | InputSignal<Function> | ... | Function to optimize the dom operations by delegating to ngForTrackBy, default algorithm checks for the identity of the row node. |
2611
- | filters | InputSignal<{ [s: string]: FilterMetadata }> | ... | An array of FilterMetadata objects to provide external filters. |
2612
- | globalFilterFields | InputSignal<string[]> | ... | An array of fields as string to use in global filtering. |
2613
- | filterDelay | InputSignalWithTransform<number, unknown> | ... | Delay in milliseconds before filtering the data. |
2614
- | filterMode | InputSignal<string> | ... | Mode for filtering valid values are "lenient" and "strict". Default is lenient. |
2615
- | filterLocale | InputSignal<string> | ... | Locale to use in filtering. The default locale is the host environment's current locale. |
2616
- | paginatorLocale | InputSignal<string> | ... | Locale to be used in paginator formatting. |
2617
- | totalRecords | InputSignal<number> | ... | Number of total records, defaults to length of value when not defined. |
2618
- | sortField | InputSignal<string> | ... | Name of the field to sort data by default. |
2619
- | sortOrder | InputSignal<number> | 1 | Order to sort when default sorting is enabled. |
2620
- | multiSortMeta | InputSignal<SortMeta[]> | null | An array of SortMeta objects to sort the data by default in multiple sort mode. |
2621
- | selection | ModelSignal<any> | null | Selected row in single mode or an array of values in multiple mode, supports one or two-way binding. Emits `selectionChange` with the node instance on selected node change. |
2622
- | value | InputSignal<TreeNode<any>[]> | null | An array of objects to display. |
2623
- | selectionKeys | InputSignal<any> | ... | A map of keys to control the selection state. |
2624
- | showGridlines | InputSignalWithTransform<boolean, unknown> | false | Whether to show grid lines between cells. |
2765
+ | dt | Object | undefined | Defines scoped design tokens of the component. |
2766
+ | unstyled | boolean | undefined | Indicates whether the component should be rendered without styles. |
2767
+ | pt | TreeTablePassThrough | undefined | Used to pass attributes to DOM elements inside the component. |
2768
+ | ptOptions | PassThroughOptions | undefined | Used to configure passthrough(pt) options of the component. |
2769
+ | columns | any[] | - | An array of objects to represent dynamic columns. |
2770
+ | tableStyle | { [klass: string]: any } | - | Inline style of the table. |
2771
+ | tableStyleClass | string | - | Style class of the table. |
2772
+ | autoLayout | boolean | - | Whether the cell widths scale according to their content or not. |
2773
+ | lazy | boolean | false | Defines if data is loaded and interacted with in lazy manner. |
2774
+ | lazyLoadOnInit | boolean | true | Whether to call lazy loading on initialization. |
2775
+ | paginator | boolean | - | When specified as true, enables the pagination. |
2776
+ | rows | number | - | Number of rows to display per page, supports one or two-way binding. Emits `rowsChange` with the row count on rows change. |
2777
+ | first | number | 0 | Index of the first row to be displayed, supports one or two-way binding. Emits `firstChange` with the first element on pagination. |
2778
+ | pageLinks | number | 5 | Number of page links to display in paginator. |
2779
+ | rowsPerPageOptions | any[] | - | Array of integer/object values to display inside rows per page dropdown of paginator |
2780
+ | alwaysShowPaginator | boolean | true | Whether to show it even there is only one page. |
2781
+ | paginatorPosition | "top" \| "bottom" \| "both" | 'bottom' | Position of the paginator. |
2782
+ | paginatorStyleClass | string | - | Custom style class for paginator |
2783
+ | 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). |
2784
+ | currentPageReportTemplate | string | '{currentPage} of {totalPages}' | Template of the current page report element. Available placeholders are {currentPage},{totalPages},{rows},{first},{last} and {totalRecords} |
2785
+ | showCurrentPageReport | boolean | - | Whether to display current page report. |
2786
+ | showJumpToPageDropdown | boolean | - | Whether to display a dropdown to navigate to any page. |
2787
+ | showFirstLastIcon | boolean | true | When enabled, icons are displayed on paginator to go first and last page. |
2788
+ | showPageLinks | boolean | true | Whether to show page links. |
2789
+ | defaultSortOrder | number | 1 | Sort order to use when an unsorted column gets sorted by user interaction. |
2790
+ | sortMode | "multiple" \| "single" | 'single' | Defines whether sorting works on single column or on multiple columns. |
2791
+ | resetPageOnSort | boolean | true | When true, resets paginator to first page after sorting. |
2792
+ | customSort | boolean | - | Whether to use the default sorting or a custom one using sortFunction. |
2793
+ | selectionMode | string | - | Specifies the selection mode, valid values are "single" and "multiple". |
2794
+ | contextMenuSelection | any | - | Selected row with a context menu, supports one or two-way binding. Emits `contextMenuSelectionChange` with the node instance on context menu selection change. |
2795
+ | contextMenuSelectionMode | string | 'separate' | Mode of the contet menu selection. |
2796
+ | dataKey | string | - | A property to uniquely identify a record in data. |
2797
+ | metaKeySelection | boolean | false | Defines whether metaKey is should be considered for the selection. On touch enabled devices, metaKeySelection is turned off automatically. |
2798
+ | compareSelectionBy | string | 'deepEquals' | Algorithm to define if a row is selected, valid values are "equals" that compares by reference and "deepEquals" that compares all fields. |
2799
+ | rowHover | boolean | - | Adds hover effect to rows without the need for selectionMode. |
2800
+ | loading | boolean | - | Displays a loader to indicate data load is in progress. |
2801
+ | loadingIcon | string | - | The icon to show while indicating data load is in progress. |
2802
+ | showLoader | boolean | true | Whether to show the loading mask when loading property is true. |
2803
+ | scrollable | boolean | - | When specified, enables horizontal and/or vertical scrolling. |
2804
+ | scrollHeight | string | - | Height of the scroll viewport in fixed pixels or the "flex" keyword for a dynamic size. |
2805
+ | virtualScroll | boolean | - | Whether the data should be loaded on demand during scroll. |
2806
+ | virtualScrollItemSize | number | - | Height of a row to use in calculations of virtual scrolling. |
2807
+ | virtualScrollOptions | ScrollerOptions | - | Whether to use the scroller feature. The properties of scroller component can be used like an object in it. |
2808
+ | virtualScrollDelay | number | 150 | The delay (in milliseconds) before triggering the virtual scroll. This determines the time gap between the user's scroll action and the actual rendering of the next set of items in the virtual scroll. |
2809
+ | frozenWidth | string | - | Width of the frozen columns container. |
2810
+ | frozenColumns | { [klass: string]: any } | - | An array of objects to represent dynamic columns that are frozen. |
2811
+ | resizableColumns | boolean | - | When enabled, columns can be resized using drag and drop. |
2812
+ | columnResizeMode | string | 'fit' | Defines whether the overall table width should change on column resize, valid values are "fit" and "expand". |
2813
+ | reorderableColumns | boolean | - | When enabled, columns can be reordered using drag and drop. |
2814
+ | contextMenu | any | - | Local ng-template varilable of a ContextMenu. |
2815
+ | rowTrackBy | Function | (index: number, item: any) => item?.node ?? item | Function to optimize the dom operations by delegating to ngForTrackBy, default algorithm checks for the identity of the row node. |
2816
+ | filters | { [s: string]: FilterMetadata } | {} | An array of FilterMetadata objects to provide external filters. |
2817
+ | globalFilterFields | string[] | - | An array of fields as string to use in global filtering. |
2818
+ | filterDelay | number | 300 | Delay in milliseconds before filtering the data. |
2819
+ | filterMode | string | 'lenient' | Mode for filtering valid values are "lenient" and "strict". Default is lenient. |
2820
+ | filterLocale | string | - | Locale to use in filtering. The default locale is the host environment's current locale. |
2821
+ | paginatorLocale | string | - | Locale to be used in paginator formatting. |
2822
+ | totalRecords | number | 0 | Number of total records, defaults to length of value when not defined. |
2823
+ | sortField | string | - | Name of the field to sort data by default. |
2824
+ | sortOrder | number | 1 | Order to sort when default sorting is enabled. |
2825
+ | multiSortMeta | SortMeta[] | null | An array of SortMeta objects to sort the data by default in multiple sort mode. |
2826
+ | selection | any | null | Selected row in single mode or an array of values in multiple mode, supports one or two-way binding. Emits `selectionChange` with the node instance on selected node change. |
2827
+ | value | TreeNode<any>[] | [] | An array of objects to display. |
2828
+ | selectionKeys | any | - | A map of keys to control the selection state. |
2829
+ | showGridlines | boolean | false | Whether to show grid lines between cells. |
2625
2830
 
2626
2831
  ### Emits
2627
2832