@exhaustive-ui/mcp 22.4.0 → 22.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/README.md +13 -1
  2. package/data/cards/accordion.md +91 -0
  3. package/data/cards/animateonscroll.md +155 -0
  4. package/data/cards/autocomplete.md +109 -0
  5. package/data/cards/autofocus.md +36 -0
  6. package/data/cards/avatar.md +45 -0
  7. package/data/cards/badge.md +44 -0
  8. package/data/cards/blockui.md +51 -0
  9. package/data/cards/breadcrumb.md +56 -0
  10. package/data/cards/button.md +83 -0
  11. package/data/cards/card.md +49 -0
  12. package/data/cards/carousel.md +101 -0
  13. package/data/cards/cascadeselect.md +77 -0
  14. package/data/cards/chart.md +105 -0
  15. package/data/cards/checkbox.md +59 -0
  16. package/data/cards/chip.md +50 -0
  17. package/data/cards/classnames.md +91 -0
  18. package/data/cards/colorpicker.md +52 -0
  19. package/data/cards/confirmdialog.md +119 -0
  20. package/data/cards/confirmpopup.md +96 -0
  21. package/data/cards/contextmenu.md +60 -0
  22. package/data/cards/dataview.md +134 -0
  23. package/data/cards/datepicker.md +103 -0
  24. package/data/cards/dialog.md +89 -0
  25. package/data/cards/divider.md +55 -0
  26. package/data/cards/dock.md +106 -0
  27. package/data/cards/dragdrop.md +106 -0
  28. package/data/cards/drawer.md +62 -0
  29. package/data/cards/dynamicdialog.md +103 -0
  30. package/data/cards/editor.md +55 -0
  31. package/data/cards/fieldset.md +54 -0
  32. package/data/cards/fileinput.md +72 -0
  33. package/data/cards/fileupload.md +88 -0
  34. package/data/cards/floatlabel.md +41 -0
  35. package/data/cards/fluid.md +49 -0
  36. package/data/cards/focustrap.md +64 -0
  37. package/data/cards/galleria.md +94 -0
  38. package/data/cards/iconfield.md +45 -0
  39. package/data/cards/iftalabel.md +38 -0
  40. package/data/cards/image.md +58 -0
  41. package/data/cards/imagecompare.md +45 -0
  42. package/data/cards/inplace.md +56 -0
  43. package/data/cards/inputgroup.md +77 -0
  44. package/data/cards/inputmask.md +71 -0
  45. package/data/cards/inputnumber.md +78 -0
  46. package/data/cards/inputotp.md +60 -0
  47. package/data/cards/inputtext.md +41 -0
  48. package/data/cards/keyfilter.md +49 -0
  49. package/data/cards/knob.md +55 -0
  50. package/data/cards/listbox.md +105 -0
  51. package/data/cards/megamenu.md +96 -0
  52. package/data/cards/menu.md +64 -0
  53. package/data/cards/menubar.md +102 -0
  54. package/data/cards/message.md +51 -0
  55. package/data/cards/metergroup.md +53 -0
  56. package/data/cards/multiselect.md +115 -0
  57. package/data/cards/orderlist.md +96 -0
  58. package/data/cards/organizationchart.md +84 -0
  59. package/data/cards/overlay.md +63 -0
  60. package/data/cards/paginator.md +62 -0
  61. package/data/cards/panel.md +57 -0
  62. package/data/cards/panelmenu.md +94 -0
  63. package/data/cards/password.md +81 -0
  64. package/data/cards/picklist.md +106 -0
  65. package/data/cards/popover.md +53 -0
  66. package/data/cards/progressbar.md +42 -0
  67. package/data/cards/progressspinner.md +38 -0
  68. package/data/cards/radiobutton.md +52 -0
  69. package/data/cards/rating.md +56 -0
  70. package/data/cards/ripple.md +37 -0
  71. package/data/cards/scroller.md +32 -0
  72. package/data/cards/scrollpanel.md +50 -0
  73. package/data/cards/scrolltop.md +48 -0
  74. package/data/cards/select.md +108 -0
  75. package/data/cards/selectbutton.md +64 -0
  76. package/data/cards/skeleton.md +54 -0
  77. package/data/cards/slider.md +52 -0
  78. package/data/cards/speeddial.md +102 -0
  79. package/data/cards/splitbutton.md +96 -0
  80. package/data/cards/splitter.md +52 -0
  81. package/data/cards/stepper.md +125 -0
  82. package/data/cards/styleclass.md +46 -0
  83. package/data/cards/table.md +305 -0
  84. package/data/cards/tabs.md +97 -0
  85. package/data/cards/tag.md +41 -0
  86. package/data/cards/terminal.md +76 -0
  87. package/data/cards/textarea.md +45 -0
  88. package/data/cards/tieredmenu.md +121 -0
  89. package/data/cards/timeline.md +58 -0
  90. package/data/cards/toast.md +58 -0
  91. package/data/cards/togglebutton.md +59 -0
  92. package/data/cards/toggleswitch.md +52 -0
  93. package/data/cards/toolbar.md +74 -0
  94. package/data/cards/tooltip.md +43 -0
  95. package/data/cards/tree.md +93 -0
  96. package/data/cards/treeselect.md +98 -0
  97. package/data/cards/treetable.md +231 -0
  98. package/data/components/accordion.md +31 -23
  99. package/data/components/animateonscroll.md +18 -15
  100. package/data/components/autocomplete.md +162 -93
  101. package/data/components/autofocus.md +9 -7
  102. package/data/components/avatar.md +56 -43
  103. package/data/components/badge.md +27 -18
  104. package/data/components/blockui.md +15 -8
  105. package/data/components/breadcrumb.md +20 -14
  106. package/data/components/button.md +121 -94
  107. package/data/components/card.md +12 -10
  108. package/data/components/carousel.md +75 -53
  109. package/data/components/cascadeselect.md +271 -238
  110. package/data/components/chart.md +88 -74
  111. package/data/components/checkbox.md +107 -97
  112. package/data/components/chip.md +20 -16
  113. package/data/components/classnames.md +22 -4
  114. package/data/components/colorpicker.md +54 -36
  115. package/data/components/confirmdialog.md +146 -43
  116. package/data/components/confirmpopup.md +95 -22
  117. package/data/components/contextmenu.md +110 -39
  118. package/data/components/dataview.md +176 -83
  119. package/data/components/datepicker.md +171 -141
  120. package/data/components/dialog.md +80 -68
  121. package/data/components/divider.md +17 -12
  122. package/data/components/dock.md +65 -29
  123. package/data/components/dragdrop.md +26 -12
  124. package/data/components/drawer.md +67 -48
  125. package/data/components/dynamicdialog.md +22 -13
  126. package/data/components/editor.md +42 -33
  127. package/data/components/fieldset.md +20 -17
  128. package/data/components/fileinput.md +92 -35
  129. package/data/components/fileupload.md +101 -61
  130. package/data/components/floatlabel.md +20 -11
  131. package/data/components/fluid.md +11 -9
  132. package/data/components/focustrap.md +11 -7
  133. package/data/components/galleria.md +231 -90
  134. package/data/components/iconfield.md +23 -15
  135. package/data/components/iftalabel.md +15 -9
  136. package/data/components/image.md +31 -26
  137. package/data/components/imagecompare.md +8 -6
  138. package/data/components/inplace.md +27 -22
  139. package/data/components/inputgroup.md +53 -29
  140. package/data/components/inputmask.md +107 -85
  141. package/data/components/inputnumber.md +128 -90
  142. package/data/components/inputotp.md +55 -42
  143. package/data/components/inputtext.md +72 -50
  144. package/data/components/keyfilter.md +6 -3
  145. package/data/components/knob.md +70 -58
  146. package/data/components/listbox.md +171 -141
  147. package/data/components/llms.md +4 -0
  148. package/data/components/megamenu.md +24 -23
  149. package/data/components/menu.md +37 -34
  150. package/data/components/menubar.md +27 -22
  151. package/data/components/message.md +44 -32
  152. package/data/components/metergroup.md +48 -17
  153. package/data/components/multiselect.md +232 -168
  154. package/data/components/orderlist.md +55 -48
  155. package/data/components/organizationchart.md +182 -13
  156. package/data/components/overlay.md +31 -26
  157. package/data/components/paginator.md +49 -34
  158. package/data/components/panel.md +23 -19
  159. package/data/components/panelmenu.md +51 -25
  160. package/data/components/password.md +104 -91
  161. package/data/components/picklist.md +93 -71
  162. package/data/components/popover.md +68 -46
  163. package/data/components/progressbar.md +28 -22
  164. package/data/components/progressspinner.md +13 -11
  165. package/data/components/radiobutton.md +69 -35
  166. package/data/components/rating.md +48 -40
  167. package/data/components/ripple.md +8 -6
  168. package/data/components/scroller.md +29 -29
  169. package/data/components/scrollpanel.md +9 -7
  170. package/data/components/scrolltop.md +20 -18
  171. package/data/components/select.md +248 -169
  172. package/data/components/selectbutton.md +118 -56
  173. package/data/components/skeleton.md +22 -18
  174. package/data/components/slider.md +73 -49
  175. package/data/components/speeddial.md +77 -59
  176. package/data/components/splitbutton.md +354 -329
  177. package/data/components/splitter.md +22 -18
  178. package/data/components/stepper.md +38 -21
  179. package/data/components/styleclass.md +12 -6
  180. package/data/components/table.md +524 -315
  181. package/data/components/tabs.md +44 -26
  182. package/data/components/tag.md +18 -14
  183. package/data/components/terminal.md +38 -27
  184. package/data/components/textarea.md +82 -47
  185. package/data/components/tieredmenu.md +34 -29
  186. package/data/components/timeline.md +29 -28
  187. package/data/components/toast.md +115 -57
  188. package/data/components/togglebutton.md +53 -39
  189. package/data/components/toggleswitch.md +41 -28
  190. package/data/components/toolbar.md +19 -18
  191. package/data/components/tooltip.md +43 -32
  192. package/data/components/tree.md +114 -81
  193. package/data/components/treeselect.md +176 -174
  194. package/data/components/treetable.md +1250 -1045
  195. package/data/components.json +4134 -4088
  196. package/data/llms-full.txt +8979 -6437
  197. package/data/llms.txt +100 -96
  198. package/data/manifest.json +183 -15
  199. package/data/pages/llms.md +29 -0
  200. package/data/pages/tailwind.md +20 -10
  201. package/data/snapshot.json +2 -2
  202. package/dist/index.d.mts +37 -2
  203. package/dist/index.mjs +1395 -1079
  204. package/dist/index.mjs.map +1 -1
  205. package/package.json +1 -1
@@ -4,7 +4,7 @@ Fieldset is a grouping component with a content toggle feature.
4
4
 
5
5
  ## Accessibility
6
6
 
7
- Screen Reader Fieldset component uses the semantic fieldset element. When toggleable option is enabled, a clickable element with button role is included inside the legend element, this button has aria-controls to define the id of the content section along with aria-expanded for the visibility state. The value to read the button defaults to the value of the legend property and can be customized by defining an aria-label or aria-labelledby via the toggleButtonProps property. The content uses region , defines an id that matches the aria-controls of the content toggle button and aria-labelledby referring to the id of the header. Content Toggle Button Keyboard Support Key Function tab Moves focus to the next the focusable element in the page tab sequence. shift + tab Moves focus to the previous the focusable element in the page tab sequence. enter Toggles the visibility of the content. space Toggles the visibility of the content.
7
+ Screen Reader Fieldset component uses the semantic fieldset element. When toggleable option is enabled, a clickable element with button role is included inside the legend element, this button has aria-controls to define the id of the content section along with aria-expanded for the visibility state. The aria-label of the button is the value of the legend property. The content uses region , defines an id that matches the aria-controls of the content toggle button and aria-labelledby referring to the id of the header. Content Toggle Button Keyboard Support Key Function tab Moves focus to the next the focusable element in the page tab sequence. shift + tab Moves focus to the previous the focusable element in the page tab sequence. enter Toggles the visibility of the content. space Toggles the visibility of the content.
8
8
 
9
9
  ## Basic
10
10
 
@@ -28,7 +28,8 @@ import { FieldsetModule } from '@exhaustive-ui/core/fieldset';
28
28
  standalone: true,
29
29
  imports: [FieldsetModule]
30
30
  })
31
- export class FieldsetBasicDemo {}
31
+ export class FieldsetBasicDemo {
32
+ }
32
33
  ```
33
34
 
34
35
  ## Template
@@ -37,8 +38,8 @@ Header section can also be defined with custom content instead of primitive valu
37
38
 
38
39
  ```typescript
39
40
  import { Component } from '@angular/core';
40
- import { AvatarModule } from '@exhaustive-ui/core/avatar';
41
41
  import { FieldsetModule } from '@exhaustive-ui/core/fieldset';
42
+ import { AvatarModule } from '@exhaustive-ui/core/avatar';
42
43
 
43
44
  @Component({
44
45
  template: `
@@ -46,7 +47,7 @@ import { FieldsetModule } from '@exhaustive-ui/core/fieldset';
46
47
  <p-fieldset>
47
48
  <ng-template #header>
48
49
  <div class="flex items-center gap-2 px-2">
49
- <p-avatar image="https://exhaustive-ui.com/demo/avatar/amyelsner.png" shape="circle" />
50
+ <p-avatar image="https://exhaustive-ui.com/demo/avatar/amyelsner.png" ariaLabel="Amy Elsner" shape="circle" />
50
51
  <span class="font-bold">Amy Elsner</span>
51
52
  </div>
52
53
  </ng-template>
@@ -58,9 +59,10 @@ import { FieldsetModule } from '@exhaustive-ui/core/fieldset';
58
59
  </div>
59
60
  `,
60
61
  standalone: true,
61
- imports: [AvatarModule, FieldsetModule]
62
+ imports: [FieldsetModule, AvatarModule]
62
63
  })
63
- export class FieldsetTemplateDemo {}
64
+ export class FieldsetTemplateDemo {
65
+ }
64
66
  ```
65
67
 
66
68
  ## Toggleable
@@ -85,7 +87,8 @@ import { FieldsetModule } from '@exhaustive-ui/core/fieldset';
85
87
  standalone: true,
86
88
  imports: [FieldsetModule]
87
89
  })
88
- export class FieldsetToggleableDemo {}
90
+ export class FieldsetToggleableDemo {
91
+ }
89
92
  ```
90
93
 
91
94
  ## Fieldset
@@ -96,16 +99,16 @@ Fieldset is a grouping component with the optional content toggle feature.
96
99
 
97
100
  | Name | Type | Default | Description |
98
101
  |------|------|---------|-------------|
99
- | dt | InputSignal<Object> | undefined | Defines scoped design tokens of the component. |
100
- | unstyled | InputSignal<boolean> | undefined | Indicates whether the component should be rendered without styles. |
101
- | pt | InputSignal<FieldsetPassThrough> | undefined | Used to pass attributes to DOM elements inside the component. |
102
- | ptOptions | InputSignal<PassThroughOptions> | undefined | Used to configure passthrough(pt) options of the component. |
103
- | legend | InputSignal<string> | ... | Header text of the fieldset. |
104
- | toggleable | InputSignalWithTransform<boolean, unknown> | false | When specified, content can toggled by clicking the legend. |
105
- | style | InputSignal<{ [klass: string]: any }> | ... | Inline style of the component. |
106
- | styleClass | InputSignal<string> | ... | Style class of the component. |
107
- | motionOptions | InputSignal<MotionOptions> | ... | The motion options. |
108
- | collapsed | ModelSignal<boolean> | ... | Defines the initial state of content, supports one or two-way binding as well. Emits `collapsedChange` with the new value when the collapsed state changes. |
102
+ | dt | Object | undefined | Defines scoped design tokens of the component. |
103
+ | unstyled | boolean | undefined | Indicates whether the component should be rendered without styles. |
104
+ | pt | FieldsetPassThrough | undefined | Used to pass attributes to DOM elements inside the component. |
105
+ | ptOptions | PassThroughOptions | undefined | Used to configure passthrough(pt) options of the component. |
106
+ | legend | string | - | Header text of the fieldset. |
107
+ | toggleable | boolean | false | When specified, content can toggled by clicking the legend. |
108
+ | style | { [klass: string]: any } | - | Inline style of the component. |
109
+ | styleClass | string | - | Style class of the component. |
110
+ | motionOptions | MotionOptions | - | The motion options. |
111
+ | collapsed | boolean | - | Defines the initial state of content, supports one or two-way binding as well. Emits `collapsedChange` with the new value when the collapsed state changes. |
109
112
 
110
113
  ### Emits
111
114
 
@@ -23,10 +23,11 @@ import { FileInputModule } from '@exhaustive-ui/core/fileinput';
23
23
  </div>
24
24
  `,
25
25
  standalone: true,
26
- imports: [FileInputModule, FormsModule]
26
+ imports: [FormsModule, FileInputModule]
27
27
  })
28
28
  export class FileinputAvatarDemo {
29
29
  photo: File | null = null;
30
+
30
31
  logo: File | null = null;
31
32
  }
32
33
  ```
@@ -47,7 +48,7 @@ import { FileInputModule } from '@exhaustive-ui/core/fileinput';
47
48
  </div>
48
49
  `,
49
50
  standalone: true,
50
- imports: [FileInputModule, FormsModule]
51
+ imports: [FormsModule, FileInputModule]
51
52
  })
52
53
  export class FileinputBasicDemo {
53
54
  files: File[] = [];
@@ -71,7 +72,8 @@ import { FileInputModule } from '@exhaustive-ui/core/fileinput';
71
72
  standalone: true,
72
73
  imports: [FileInputModule]
73
74
  })
74
- export class FileinputDisabledDemo {}
75
+ export class FileinputDisabledDemo {
76
+ }
75
77
  ```
76
78
 
77
79
  ## Existing Files
@@ -80,9 +82,9 @@ When a form edits a record, pass the files already stored on the server to exist
80
82
 
81
83
  ```typescript
82
84
  import { Component, inject } from '@angular/core';
83
- import { FileInputModule } from '@exhaustive-ui/core/fileinput';
84
- import { ToastModule } from '@exhaustive-ui/core/toast';
85
85
  import { MessageService } from '@exhaustive-ui/core/api';
86
+ import { FileInputExistingFile, FileInputModule, FileInputRemoveExistingEvent } from '@exhaustive-ui/core/fileinput';
87
+ import { ToastModule } from '@exhaustive-ui/core/toast';
86
88
 
87
89
  @Component({
88
90
  template: `
@@ -92,11 +94,16 @@ import { MessageService } from '@exhaustive-ui/core/api';
92
94
  </div>
93
95
  `,
94
96
  standalone: true,
95
- imports: [FileInputModule, ToastModule]
97
+ imports: [FileInputModule, ToastModule],
98
+ providers: [MessageService]
96
99
  })
97
100
  export class FileinputExistingDemo {
98
101
  messageService = inject(MessageService);
99
- attachments: FileInputExistingFile[];
102
+
103
+ attachments: FileInputExistingFile[] = [
104
+ { id: 1, name: 'signed-contract.pdf', size: 1240000, type: 'application/pdf' },
105
+ { id: 2, name: 'facade.jpg', size: 312000, type: 'image/jpeg', url: 'https://exhaustive-ui.com/demo/galleria/galleria1.jpg' }
106
+ ];
100
107
 
101
108
  onRemoveExisting(event: FileInputRemoveExistingEvent) {
102
109
  this.messageService.add({ severity: 'info', summary: 'Delete on the server', detail: event.file.name, life: 3000 });
@@ -111,7 +118,7 @@ The images variant shows the files as a grid of square thumbnails, for a gallery
111
118
  ```typescript
112
119
  import { Component } from '@angular/core';
113
120
  import { FormsModule } from '@angular/forms';
114
- import { FileInputModule } from '@exhaustive-ui/core/fileinput';
121
+ import { FileInputModule, FileInputUploadHandler } from '@exhaustive-ui/core/fileinput';
115
122
 
116
123
  @Component({
117
124
  template: `
@@ -120,11 +127,24 @@ import { FileInputModule } from '@exhaustive-ui/core/fileinput';
120
127
  </div>
121
128
  `,
122
129
  standalone: true,
123
- imports: [FileInputModule, FormsModule]
130
+ imports: [FormsModule, FileInputModule]
124
131
  })
125
132
  export class FileinputImagesDemo {
126
133
  photos: File[] = [];
127
- upload: FileInputUploadHandler = (file, { signal, progress }) =>;
134
+
135
+ upload: FileInputUploadHandler = (file, { signal, progress }) =>
136
+ new Promise((resolve) => {
137
+ let percent = 0;
138
+ const timer = setInterval(() => {
139
+ percent += 8;
140
+ progress(percent);
141
+ if (percent >= 100) {
142
+ clearInterval(timer);
143
+ resolve({ name: file.name });
144
+ }
145
+ }, 120);
146
+ signal.addEventListener('abort', () => clearInterval(timer));
147
+ });
128
148
  }
129
149
  ```
130
150
 
@@ -156,7 +176,7 @@ Every text of the component, error messages and screen reader announcements incl
156
176
 
157
177
  ```typescript
158
178
  import { Component } from '@angular/core';
159
- import { FileInputModule } from '@exhaustive-ui/core/fileinput';
179
+ import { FileInputLabels, FileInputModule } from '@exhaustive-ui/core/fileinput';
160
180
 
161
181
  @Component({
162
182
  template: `
@@ -168,7 +188,15 @@ import { FileInputModule } from '@exhaustive-ui/core/fileinput';
168
188
  imports: [FileInputModule]
169
189
  })
170
190
  export class FileinputLabelsDemo {
171
- labels: Partial<FileInputLabels>;
191
+ labels: Partial<FileInputLabels> = {
192
+ dropzone: 'Déposez vos fichiers ici ou',
193
+ browse: 'parcourez',
194
+ remove: 'Retirer',
195
+ maxFileSizeError: 'Trop lourd : {0}, maximum {1}',
196
+ addedMessage: '{0} fichier(s) ajouté(s)',
197
+ removedMessage: '{0} retiré',
198
+ listLabel: 'Fichiers sélectionnés'
199
+ };
172
200
  }
173
201
  ```
174
202
 
@@ -178,12 +206,12 @@ FileInput can also be used with reactive forms. In this case, the formControlNam
178
206
 
179
207
  ```typescript
180
208
  import { Component, inject } from '@angular/core';
181
- import { ReactiveFormsModule } from '@angular/forms';
209
+ import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
210
+ import { MessageService } from '@exhaustive-ui/core/api';
182
211
  import { FileInputModule } from '@exhaustive-ui/core/fileinput';
183
- import { MessageModule } from '@exhaustive-ui/core/message';
184
212
  import { ToastModule } from '@exhaustive-ui/core/toast';
213
+ import { MessageModule } from '@exhaustive-ui/core/message';
185
214
  import { ButtonModule } from '@exhaustive-ui/core/button';
186
- import { MessageService } from '@exhaustive-ui/core/api';
187
215
 
188
216
  @Component({
189
217
  template: `
@@ -202,17 +230,22 @@ import { MessageService } from '@exhaustive-ui/core/api';
202
230
  </div>
203
231
  `,
204
232
  standalone: true,
205
- imports: [FileInputModule, MessageModule, ToastModule, ButtonModule, ReactiveFormsModule]
233
+ imports: [ReactiveFormsModule, FileInputModule, ToastModule, MessageModule, ButtonModule],
234
+ providers: [MessageService]
206
235
  })
207
236
  export class FileinputReactiveformsDemo {
237
+ private fb = inject(FormBuilder);
238
+
208
239
  messageService = inject(MessageService);
240
+
209
241
  exampleForm: FormGroup;
242
+
210
243
  formSubmitted: boolean = false;
211
244
 
212
245
  constructor() {
213
246
  this.exampleForm = this.fb.group({
214
- documents: [[], Validators.required]
215
- });
247
+ documents: [[], Validators.required]
248
+ });
216
249
  }
217
250
 
218
251
  onSubmit() {
@@ -238,11 +271,11 @@ FileInput can also be used with Angular Signal Forms . The [formField] directive
238
271
  ```typescript
239
272
  import { Component, inject, signal } from '@angular/core';
240
273
  import { form, FormField, minLength, submit } from '@angular/forms/signals';
274
+ import { MessageService } from '@exhaustive-ui/core/api';
241
275
  import { FileInputModule } from '@exhaustive-ui/core/fileinput';
242
- import { MessageModule } from '@exhaustive-ui/core/message';
243
- import { ToastModule } from '@exhaustive-ui/core/toast';
244
276
  import { ButtonModule } from '@exhaustive-ui/core/button';
245
- import { MessageService } from '@exhaustive-ui/core/api';
277
+ import { ToastModule } from '@exhaustive-ui/core/toast';
278
+ import { MessageModule } from '@exhaustive-ui/core/message';
246
279
 
247
280
  @Component({
248
281
  template: `
@@ -262,11 +295,14 @@ import { MessageService } from '@exhaustive-ui/core/api';
262
295
  </div>
263
296
  `,
264
297
  standalone: true,
265
- imports: [FileInputModule, MessageModule, ToastModule, ButtonModule, FormField]
298
+ imports: [FormField, FileInputModule, ButtonModule, ToastModule, MessageModule],
299
+ providers: [MessageService]
266
300
  })
267
301
  export class FileinputSignalformsDemo {
268
302
  messageService = inject(MessageService);
303
+
269
304
  model = signal<{ photos: File[] }>({ photos: [] });
305
+
270
306
  listingForm = form(this.model, (f) => {
271
307
  minLength(f.photos, 1);
272
308
  });
@@ -300,7 +336,8 @@ import { FileInputModule } from '@exhaustive-ui/core/fileinput';
300
336
  standalone: true,
301
337
  imports: [FileInputModule]
302
338
  })
303
- export class FileinputSizesDemo {}
339
+ export class FileinputSizesDemo {
340
+ }
304
341
  ```
305
342
 
306
343
  ## Template
@@ -309,8 +346,8 @@ The dropzone template replaces the content of the dropzone and receives an open
309
346
 
310
347
  ```typescript
311
348
  import { Component } from '@angular/core';
312
- import { ButtonModule } from '@exhaustive-ui/core/button';
313
349
  import { FileInputModule } from '@exhaustive-ui/core/fileinput';
350
+ import { ButtonModule } from '@exhaustive-ui/core/button';
314
351
 
315
352
  @Component({
316
353
  template: `
@@ -330,9 +367,10 @@ import { FileInputModule } from '@exhaustive-ui/core/fileinput';
330
367
  </div>
331
368
  `,
332
369
  standalone: true,
333
- imports: [ButtonModule, FileInputModule]
370
+ imports: [FileInputModule, ButtonModule]
334
371
  })
335
- export class FileinputTemplateDemo {}
372
+ export class FileinputTemplateDemo {
373
+ }
336
374
  ```
337
375
 
338
376
  ## templatedrivenforms-doc
@@ -342,11 +380,11 @@ The value is an array of files, empty when nothing is selected, so required work
342
380
  ```typescript
343
381
  import { Component, inject } from '@angular/core';
344
382
  import { FormsModule } from '@angular/forms';
383
+ import { MessageService } from '@exhaustive-ui/core/api';
345
384
  import { FileInputModule } from '@exhaustive-ui/core/fileinput';
346
- import { MessageModule } from '@exhaustive-ui/core/message';
347
385
  import { ToastModule } from '@exhaustive-ui/core/toast';
386
+ import { MessageModule } from '@exhaustive-ui/core/message';
348
387
  import { ButtonModule } from '@exhaustive-ui/core/button';
349
- import { MessageService } from '@exhaustive-ui/core/api';
350
388
 
351
389
  @Component({
352
390
  template: `
@@ -365,10 +403,12 @@ import { MessageService } from '@exhaustive-ui/core/api';
365
403
  </div>
366
404
  `,
367
405
  standalone: true,
368
- imports: [FileInputModule, MessageModule, ToastModule, ButtonModule, FormsModule]
406
+ imports: [FormsModule, FileInputModule, ToastModule, MessageModule, ButtonModule],
407
+ providers: [MessageService]
369
408
  })
370
409
  export class FileinputTemplatedrivenformsDemo {
371
410
  messageService = inject(MessageService);
411
+
372
412
  receipts: File[] = [];
373
413
 
374
414
  onSubmit(form: any) {
@@ -386,9 +426,9 @@ Each file is uploaded in its own request, with its own progress bar, as soon as
386
426
 
387
427
  ```typescript
388
428
  import { Component, inject } from '@angular/core';
389
- import { FileInputModule } from '@exhaustive-ui/core/fileinput';
390
- import { ToastModule } from '@exhaustive-ui/core/toast';
391
429
  import { MessageService } from '@exhaustive-ui/core/api';
430
+ import { FileInputModule, FileInputUploadEvent, FileInputUploadHandler } from '@exhaustive-ui/core/fileinput';
431
+ import { ToastModule } from '@exhaustive-ui/core/toast';
392
432
 
393
433
  @Component({
394
434
  template: `
@@ -398,12 +438,28 @@ import { MessageService } from '@exhaustive-ui/core/api';
398
438
  </div>
399
439
  `,
400
440
  standalone: true,
401
- imports: [FileInputModule, ToastModule]
441
+ imports: [FileInputModule, ToastModule],
442
+ providers: [MessageService]
402
443
  })
403
444
  export class FileinputUploadDemo {
404
445
  messageService = inject(MessageService);
405
- upload: FileInputUploadHandler = (file, { signal, progress }) =>;
406
- urlCode: Code;
446
+
447
+ upload: FileInputUploadHandler = (file, { signal, progress }) =>
448
+ new Promise((resolve, reject) => {
449
+ let percent = 0;
450
+ const timer = setInterval(() => {
451
+ percent += 100000 / Math.max(file.size, 200000);
452
+ progress(percent);
453
+ if (file.name.includes('error') && percent > 50) {
454
+ clearInterval(timer);
455
+ reject(new Error('The server answered 500'));
456
+ } else if (percent >= 100) {
457
+ clearInterval(timer);
458
+ resolve({ name: file.name });
459
+ }
460
+ }, 150);
461
+ signal.addEventListener('abort', () => clearInterval(timer));
462
+ });
407
463
 
408
464
  onUpload(event: FileInputUploadEvent) {
409
465
  this.messageService.add({ severity: 'success', summary: 'Uploaded', detail: event.item.name, life: 2000 });
@@ -428,7 +484,8 @@ import { FileInputModule } from '@exhaustive-ui/core/fileinput';
428
484
  standalone: true,
429
485
  imports: [FileInputModule]
430
486
  })
431
- export class FileinputValidationDemo {}
487
+ export class FileinputValidationDemo {
488
+ }
432
489
  ```
433
490
 
434
491
  ## Pass Through Options