@exhaustive-ui/mcp 0.0.0-stage → 3.0.0-alpha.1

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 (121) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +167 -2
  3. package/data/components/accordion.md +421 -0
  4. package/data/components/animateonscroll.md +163 -0
  5. package/data/components/autocomplete.md +1077 -0
  6. package/data/components/autofocus.md +38 -0
  7. package/data/components/avatar.md +417 -0
  8. package/data/components/badge.md +234 -0
  9. package/data/components/blockui.md +108 -0
  10. package/data/components/breadcrumb.md +178 -0
  11. package/data/components/button.md +774 -0
  12. package/data/components/card.md +138 -0
  13. package/data/components/carousel.md +440 -0
  14. package/data/components/cascadeselect.md +1387 -0
  15. package/data/components/chart.md +1178 -0
  16. package/data/components/checkbox.md +529 -0
  17. package/data/components/chip.md +180 -0
  18. package/data/components/colorpicker.md +301 -0
  19. package/data/components/confirmdialog.md +287 -0
  20. package/data/components/confirmpopup.md +417 -0
  21. package/data/components/contextmenu.md +491 -0
  22. package/data/components/dataview.md +600 -0
  23. package/data/components/datepicker.md +1262 -0
  24. package/data/components/dialog.md +622 -0
  25. package/data/components/divider.md +250 -0
  26. package/data/components/dock.md +500 -0
  27. package/data/components/dragdrop.md +285 -0
  28. package/data/components/drawer.md +510 -0
  29. package/data/components/dynamicdialog.md +109 -0
  30. package/data/components/editor.md +291 -0
  31. package/data/components/fieldset.md +182 -0
  32. package/data/components/fileupload.md +430 -0
  33. package/data/components/floatlabel.md +155 -0
  34. package/data/components/fluid.md +72 -0
  35. package/data/components/focustrap.md +65 -0
  36. package/data/components/galleria.md +627 -0
  37. package/data/components/iconfield.md +246 -0
  38. package/data/components/iftalabel.md +105 -0
  39. package/data/components/imagecompare.md +97 -0
  40. package/data/components/inplace.md +233 -0
  41. package/data/components/inputgroup.md +306 -0
  42. package/data/components/inputmask.md +518 -0
  43. package/data/components/inputnumber.md +675 -0
  44. package/data/components/inputotp.md +336 -0
  45. package/data/components/inputtext.md +488 -0
  46. package/data/components/keyfilter.md +85 -0
  47. package/data/components/knob.md +462 -0
  48. package/data/components/listbox.md +798 -0
  49. package/data/components/llms.md +28 -0
  50. package/data/components/megamenu.md +587 -0
  51. package/data/components/menu.md +483 -0
  52. package/data/components/menubar.md +462 -0
  53. package/data/components/message.md +449 -0
  54. package/data/components/metergroup.md +241 -0
  55. package/data/components/multiselect.md +1047 -0
  56. package/data/components/orderlist.md +342 -0
  57. package/data/components/organizationchart.md +197 -0
  58. package/data/components/overlay.md +217 -0
  59. package/data/components/paginator.md +314 -0
  60. package/data/components/panel.md +214 -0
  61. package/data/components/panelmenu.md +699 -0
  62. package/data/components/password.md +570 -0
  63. package/data/components/picklist.md +420 -0
  64. package/data/components/popover.md +378 -0
  65. package/data/components/progressbar.md +181 -0
  66. package/data/components/progressspinner.md +91 -0
  67. package/data/components/radiobutton.md +377 -0
  68. package/data/components/rating.md +312 -0
  69. package/data/components/ripple.md +89 -0
  70. package/data/components/scroller.md +122 -0
  71. package/data/components/scrollpanel.md +149 -0
  72. package/data/components/scrolltop.md +105 -0
  73. package/data/components/select.md +1206 -0
  74. package/data/components/selectbutton.md +356 -0
  75. package/data/components/skeleton.md +242 -0
  76. package/data/components/slider.md +337 -0
  77. package/data/components/speeddial.md +589 -0
  78. package/data/components/splitbutton.md +945 -0
  79. package/data/components/splitter.md +196 -0
  80. package/data/components/stepper.md +411 -0
  81. package/data/components/styleclass.md +126 -0
  82. package/data/components/table.md +4557 -0
  83. package/data/components/tabs.md +467 -0
  84. package/data/components/tag.md +200 -0
  85. package/data/components/terminal.md +118 -0
  86. package/data/components/textarea.md +416 -0
  87. package/data/components/tieredmenu.md +578 -0
  88. package/data/components/timeline.md +310 -0
  89. package/data/components/toast.md +596 -0
  90. package/data/components/togglebutton.md +356 -0
  91. package/data/components/toggleswitch.md +285 -0
  92. package/data/components/toolbar.md +182 -0
  93. package/data/components/tooltip.md +211 -0
  94. package/data/components/tree.md +746 -0
  95. package/data/components/treeselect.md +912 -0
  96. package/data/components/treetable.md +2814 -0
  97. package/data/components.json +43751 -0
  98. package/data/llms-full.txt +47433 -0
  99. package/data/llms.txt +121 -0
  100. package/data/manifest.json +46513 -0
  101. package/data/pages/accessibility.md +28 -0
  102. package/data/pages/animations.md +28 -0
  103. package/data/pages/configuration.md +210 -0
  104. package/data/pages/contribution.md +20 -0
  105. package/data/pages/customicons.md +20 -0
  106. package/data/pages/faq.md +20 -0
  107. package/data/pages/icons.md +66 -0
  108. package/data/pages/installation.md +71 -0
  109. package/data/pages/llms.md +61 -0
  110. package/data/pages/passthrough.md +32 -0
  111. package/data/pages/philosophy.md +28 -0
  112. package/data/pages/primeflex.md +20 -0
  113. package/data/pages/rtl.md +12 -0
  114. package/data/pages/styled.md +132 -0
  115. package/data/pages/tailwind.md +40 -0
  116. package/data/pages/unstyled.md +39 -0
  117. package/data/snapshot.json +9 -0
  118. package/dist/index.d.mts +448 -0
  119. package/dist/index.mjs +2501 -0
  120. package/dist/index.mjs.map +1 -0
  121. package/package.json +67 -3
@@ -0,0 +1,675 @@
1
+ # Angular InputNumber Component
2
+
3
+ InputNumber is an input component to provide numerical input.
4
+
5
+ ## Accessibility
6
+
7
+ Screen Reader Value to describe the component can either be provided via label tag combined with inputId prop or using ariaLabelledBy , ariaLabel , ariaDescribedBy props. The input element uses spinbutton role in addition to the aria-valuemin , aria-valuemax and aria-valuenow attributes.
8
+
9
+ ## Buttons
10
+
11
+ Spinner buttons are enabled using the showButtons options and layout is defined with the buttonLayout . Default value is "stacked" whereas "horizontal" and "stacked" are alternatives. Note that even there are no buttons, up and down arrow keys can be used to spin the values with keyboard.
12
+
13
+ ```typescript
14
+ import { Component } from '@angular/core';
15
+ import { FormsModule } from '@angular/forms';
16
+ import { InputNumberModule } from '@exhaustive-ui/core/inputnumber';
17
+
18
+ @Component({
19
+ template: `
20
+ <p-fluid class="card flex flex-wrap gap-4">
21
+ <div class="flex-auto">
22
+ <label class="mb-2 block font-bold" for="stacked">Stacked</label>
23
+ <p-inputnumber [(ngModel)]="value1" [showButtons]="true" inputId="stacked" mode="currency" currency="USD" />
24
+ </div>
25
+ <div class="flex-auto">
26
+ <label class="mb-2 block font-bold" for="minmax-buttons">Min-Max Boundaries</label>
27
+ <p-inputnumber [(ngModel)]="value2" mode="decimal" [showButtons]="true" inputId="minmax-buttons" [min]="0" [max]="100" />
28
+ </div>
29
+ <div class="flex-auto">
30
+ <label class="mb-2 block font-bold" for="horizontal">Horizontal with Step</label>
31
+ <p-inputnumber [(ngModel)]="value3" [showButtons]="true" buttonLayout="horizontal" inputId="horizontal" spinnerMode="horizontal" [step]="0.25" mode="currency" currency="EUR">
32
+ <ng-template #incrementbuttonicon>
33
+ <span class="pi pi-plus"></span>
34
+ </ng-template>
35
+ <ng-template #decrementbuttonicon>
36
+ <span class="pi pi-minus"></span>
37
+ </ng-template>
38
+ </p-inputnumber>
39
+ </div>
40
+ </p-fluid>
41
+ `,
42
+ standalone: true,
43
+ imports: [InputNumberModule, FormsModule]
44
+ })
45
+ export class InputnumberButtonsDemo {
46
+ value1: number = 20;
47
+ value2: number = 10.5;
48
+ value3: number = 25;
49
+ }
50
+ ```
51
+
52
+ ## Clear Icon
53
+
54
+ When showClear is enabled, a clear icon is displayed to clear the value.
55
+
56
+ ```typescript
57
+ import { Component } from '@angular/core';
58
+ import { FormsModule } from '@angular/forms';
59
+ import { InputNumberModule } from '@exhaustive-ui/core/inputnumber';
60
+
61
+ @Component({
62
+ template: `
63
+ <div class="card flex justify-center">
64
+ <p-inputnumber [(ngModel)]="value" inputId="price_input" mode="currency" currency="USD" locale="en-US" [showClear]="true" inputStyleClass="w-56" />
65
+ </div>
66
+ `,
67
+ standalone: true,
68
+ imports: [InputNumberModule, FormsModule]
69
+ })
70
+ export class InputnumberCleariconDemo {
71
+ value: number | undefined;
72
+ }
73
+ ```
74
+
75
+ ## Currency
76
+
77
+ Currency formatting is specified by setting the mode option to currency and currency property. In addition currencyDisplay option allows how the currency is displayed, valid values are "symbol" (default) or "code".
78
+
79
+ ```typescript
80
+ import { Component } from '@angular/core';
81
+ import { FormsModule } from '@angular/forms';
82
+ import { InputNumberModule } from '@exhaustive-ui/core/inputnumber';
83
+
84
+ @Component({
85
+ template: `
86
+ <p-fluid class="card flex flex-wrap gap-4">
87
+ <div class="flex-auto">
88
+ <label class="block font-bold mb-2" for="currency-us">United States</label>
89
+ <p-inputnumber [(ngModel)]="value1" inputId="currency-us" mode="currency" currency="USD" locale="en-US" />
90
+ </div>
91
+ <div class="flex-auto">
92
+ <label class="block font-bold mb-2" for="currency-germany">Germany</label>
93
+ <p-inputnumber [(ngModel)]="value2" mode="currency" inputId="currency-germany" currency="EUR" locale="de-DE" />
94
+ </div>
95
+ <div class="flex-auto">
96
+ <label class="block font-bold mb-2" for="currency-india">India</label>
97
+ <p-inputnumber [(ngModel)]="value3" mode="currency" inputId="currency-india" currency="INR" currencyDisplay="code" locale="en-IN" />
98
+ </div>
99
+ <div class="flex-auto">
100
+ <label class="block font-bold mb-2" for="currency-japan">Japan</label>
101
+ <p-inputnumber [(ngModel)]="value4" mode="currency" inputId="currency-japan" currency="JPY" locale="jp-JP" />
102
+ </div>
103
+ </p-fluid>
104
+ `,
105
+ standalone: true,
106
+ imports: [InputNumberModule, FormsModule]
107
+ })
108
+ export class InputnumberCurrencyDemo {
109
+ value1: number = 1500;
110
+ value2: number = 2500;
111
+ value3: number = 4250;
112
+ value4: number = 5002;
113
+ }
114
+ ```
115
+
116
+ ## Disabled
117
+
118
+ When disabled is present, the element cannot be edited and focused.
119
+
120
+ ```typescript
121
+ import { Component } from '@angular/core';
122
+ import { FormsModule } from '@angular/forms';
123
+ import { InputNumberModule } from '@exhaustive-ui/core/inputnumber';
124
+
125
+ @Component({
126
+ template: `
127
+ <div class="card flex justify-center">
128
+ <p-inputnumber inputId="integeronly" [disabled]="true" prefix="%" [(ngModel)]="value1" />
129
+ </div>
130
+ `,
131
+ standalone: true,
132
+ imports: [InputNumberModule, FormsModule]
133
+ })
134
+ export class InputnumberDisabledDemo {
135
+ value1: number = 50;
136
+ }
137
+ ```
138
+
139
+ ## Filled
140
+
141
+ Specify the variant property as filled to display the component with a higher visual emphasis than the default outlined style.
142
+
143
+ ```typescript
144
+ import { Component } from '@angular/core';
145
+ import { FormsModule } from '@angular/forms';
146
+ import { InputNumberModule } from '@exhaustive-ui/core/inputnumber';
147
+
148
+ @Component({
149
+ template: `
150
+ <div class="card flex justify-center">
151
+ <p-inputnumber variant="filled" [(ngModel)]="value1" />
152
+ </div>
153
+ `,
154
+ standalone: true,
155
+ imports: [InputNumberModule, FormsModule]
156
+ })
157
+ export class InputnumberFilledDemo {
158
+ value1!: number;
159
+ }
160
+ ```
161
+
162
+ ## Float Label
163
+
164
+ A floating label appears on top of the input field when focused. Visit FloatLabel documentation for more information.
165
+
166
+ ```typescript
167
+ import { Component } from '@angular/core';
168
+ import { FormsModule } from '@angular/forms';
169
+ import { FloatLabelModule } from '@exhaustive-ui/core/floatlabel';
170
+ import { InputNumberModule } from '@exhaustive-ui/core/inputnumber';
171
+
172
+ @Component({
173
+ template: `
174
+ <div class="card flex flex-wrap justify-center items-end gap-4">
175
+ <p-floatlabel>
176
+ <p-inputnumber [(ngModel)]="value1" inputId="over_label" mode="currency" currency="USD" locale="en-US" />
177
+ <label for="over_label">Over Label</label>
178
+ </p-floatlabel>
179
+ <p-floatlabel variant="in">
180
+ <p-inputnumber [(ngModel)]="value2" inputId="in_label" mode="currency" currency="USD" locale="en-US" />
181
+ <label for="in_label">In Label</label>
182
+ </p-floatlabel>
183
+ <p-floatlabel variant="on">
184
+ <p-inputnumber [(ngModel)]="value3" inputId="on_label" mode="currency" currency="USD" locale="en-US" />
185
+ <label for="on_label">On Label</label>
186
+ </p-floatlabel>
187
+ </div>
188
+ `,
189
+ standalone: true,
190
+ imports: [FloatLabelModule, InputNumberModule, FormsModule]
191
+ })
192
+ export class InputnumberFloatlabelDemo {
193
+ value1: number | undefined;
194
+ value2: number | undefined;
195
+ value3: number | undefined;
196
+ }
197
+ ```
198
+
199
+ ## Fluid
200
+
201
+ The fluid prop makes the component take up the full width of its container when set to true.
202
+
203
+ ```typescript
204
+ import { Component } from '@angular/core';
205
+ import { FormsModule } from '@angular/forms';
206
+ import { InputNumberModule } from '@exhaustive-ui/core/inputnumber';
207
+
208
+ @Component({
209
+ template: `
210
+ <div class="card">
211
+ <p-inputnumber [(ngModel)]="value" inputId="price_input" mode="currency" currency="USD" locale="en-US" fluid />
212
+ </div>
213
+ `,
214
+ standalone: true,
215
+ imports: [InputNumberModule, FormsModule]
216
+ })
217
+ export class InputnumberFluidDemo {
218
+ value: number | undefined;
219
+ }
220
+ ```
221
+
222
+ ## Ifta Label
223
+
224
+ IftaLabel is used to create infield top aligned labels. Visit IftaLabel documentation for more information.
225
+
226
+ ```typescript
227
+ import { Component } from '@angular/core';
228
+ import { FormsModule } from '@angular/forms';
229
+ import { IftaLabelModule } from '@exhaustive-ui/core/iftalabel';
230
+ import { InputNumberModule } from '@exhaustive-ui/core/inputnumber';
231
+
232
+ @Component({
233
+ template: `
234
+ <div class="card flex justify-center">
235
+ <p-iftalabel>
236
+ <p-inputnumber [(ngModel)]="value" inputId="price_input" mode="currency" currency="USD" locale="en-US" />
237
+ <label for="price_input">Price</label>
238
+ </p-iftalabel>
239
+ </div>
240
+ `,
241
+ standalone: true,
242
+ imports: [IftaLabelModule, InputNumberModule, FormsModule]
243
+ })
244
+ export class InputnumberIftalabelDemo {
245
+ value: number | undefined;
246
+ }
247
+ ```
248
+
249
+ ## Invalid
250
+
251
+ The invalid state is applied using the ⁠invalid property to indicate failed validation, which can be integrated with Angular Forms.
252
+
253
+ ```typescript
254
+ import { Component } from '@angular/core';
255
+ import { FormsModule } from '@angular/forms';
256
+ import { InputNumberModule } from '@exhaustive-ui/core/inputnumber';
257
+
258
+ @Component({
259
+ template: `
260
+ <div class="card flex flex-wrap justify-center gap-4">
261
+ <p-inputnumber [(ngModel)]="value1" [invalid]="value1 === undefined" mode="decimal" [minFractionDigits]="2" placeholder="Amount" />
262
+ <p-inputnumber [(ngModel)]="value2" [invalid]="value2 === undefined" mode="decimal" [minFractionDigits]="2" variant="filled" placeholder="Amount" />
263
+ </div>
264
+ `,
265
+ standalone: true,
266
+ imports: [InputNumberModule, FormsModule]
267
+ })
268
+ export class InputnumberInvalidDemo {
269
+ value1!: number;
270
+ value2!: number;
271
+ }
272
+ ```
273
+
274
+ ## Locale
275
+
276
+ Localization information such as grouping and decimal symbols are defined with the locale property which defaults to the user locale.
277
+
278
+ ```typescript
279
+ import { Component } from '@angular/core';
280
+ import { FormsModule } from '@angular/forms';
281
+ import { InputNumberModule } from '@exhaustive-ui/core/inputnumber';
282
+
283
+ @Component({
284
+ template: `
285
+ <p-fluid class="card flex flex-wrap gap-4">
286
+ <div class="flex-auto">
287
+ <label class="block font-bold mb-2" for="locale-user">User Locale</label>
288
+ <p-inputnumber [(ngModel)]="value1" inputId="locale-user" [minFractionDigits]="2" />
289
+ </div>
290
+ <div class="flex-auto">
291
+ <label class="block font-bold mb-2" for="locale-us">United States Locale</label>
292
+ <p-inputnumber [(ngModel)]="value2" inputId="locale-us" mode="decimal" locale="en-US" [minFractionDigits]="2" />
293
+ </div>
294
+ <div class="flex-auto">
295
+ <label class="block font-bold mb-2" for="locale-german">German Locale</label>
296
+ <p-inputnumber [(ngModel)]="value3" inputId="locale-german" mode="decimal" locale="de-DE" [minFractionDigits]="2" />
297
+ </div>
298
+ <div class="flex-auto">
299
+ <label class="block font-bold mb-2" for="locale-indian">Indian Locale</label>
300
+ <p-inputnumber [(ngModel)]="value4" inputId="locale-indian" mode="decimal" locale="en-IN" [minFractionDigits]="2" />
301
+ </div>
302
+ </p-fluid>
303
+ `,
304
+ standalone: true,
305
+ imports: [InputNumberModule, FormsModule]
306
+ })
307
+ export class InputnumberLocaleDemo {
308
+ value1: number = 151351;
309
+ value2: number = 115744;
310
+ value3: number = 635524;
311
+ value4: number = 732762;
312
+ }
313
+ ```
314
+
315
+ ## Numerals
316
+
317
+ InputNumber is used as a controlled input with ngModel property.
318
+
319
+ ```typescript
320
+ import { Component } from '@angular/core';
321
+ import { FormsModule } from '@angular/forms';
322
+ import { InputNumberModule } from '@exhaustive-ui/core/inputnumber';
323
+
324
+ @Component({
325
+ template: `
326
+ <p-fluid class="card flex flex-wrap gap-4">
327
+ <div class="flex-auto">
328
+ <label class="mb-2 font-bold block" for="integeronly">Integer Only</label>
329
+ <p-inputnumber inputId="integeronly" [(ngModel)]="value1" />
330
+ </div>
331
+ <div class="flex-auto">
332
+ <label class="mb-2 font-bold block" for="withoutgrouping">Without Grouping</label>
333
+ <p-inputnumber [(ngModel)]="value2" mode="decimal" inputId="withoutgrouping" [useGrouping]="false" />
334
+ </div>
335
+ <div class="flex-auto">
336
+ <label class="mb-2 font-bold block" for="minmaxfraction">Min-Max Fraction Digits</label>
337
+ <p-inputnumber [(ngModel)]="value3" inputId="minmaxfraction" mode="decimal" [minFractionDigits]="2" [maxFractionDigits]="5" />
338
+ </div>
339
+ <div class="flex-auto">
340
+ <label class="mb-2 font-bold block" for="minmax">Min-Max Boundaries</label>
341
+ <p-inputnumber [(ngModel)]="value4" inputId="minmax" mode="decimal" [min]="0" [max]="100" />
342
+ </div>
343
+ </p-fluid>
344
+ `,
345
+ standalone: true,
346
+ imports: [InputNumberModule, FormsModule]
347
+ })
348
+ export class InputnumberNumeralsDemo {
349
+ value1: number = 42723;
350
+ value2: number = 58151;
351
+ value3: number = 2351.35;
352
+ value4: number = 50;
353
+ }
354
+ ```
355
+
356
+ ## Prefix & Suffix
357
+
358
+ Custom texts e.g. units can be placed before or after the input section with the prefix and suffix properties.
359
+
360
+ ```typescript
361
+ import { Component } from '@angular/core';
362
+ import { FormsModule } from '@angular/forms';
363
+ import { InputNumberModule } from '@exhaustive-ui/core/inputnumber';
364
+
365
+ @Component({
366
+ template: `
367
+ <p-fluid class="card flex flex-wrap gap-4">
368
+ <div class="flex-auto">
369
+ <label class="font-bold block mb-2" for="mile">Mile</label>
370
+ <p-inputnumber [(ngModel)]="value1" inputId="mile" suffix=" mi" />
371
+ </div>
372
+ <div class="flex-auto">
373
+ <label class="font-bold block mb-2" for="percent">Percent</label>
374
+ <p-inputnumber [(ngModel)]="value2" inputId="percent" prefix="%" />
375
+ </div>
376
+ <div class="flex-auto">
377
+ <label class="font-bold block mb-2" for="expiry">Expiry</label>
378
+ <p-inputnumber [(ngModel)]="value3" inputId="expiry" prefix="Expires in " suffix=" days" />
379
+ </div>
380
+ <div class="flex-auto">
381
+ <label class="font-bold block mb-2" for="temperature">Temperature</label>
382
+ <p-inputnumber [(ngModel)]="value4" prefix="↑ " inputId="temperature" suffix="℃" [min]="0" [max]="40" />
383
+ </div>
384
+ </p-fluid>
385
+ `,
386
+ standalone: true,
387
+ imports: [InputNumberModule, FormsModule]
388
+ })
389
+ export class InputnumberPrefixsuffixDemo {
390
+ value1: number = 20;
391
+ value2: number = 50;
392
+ value3: number = 10;
393
+ value4: number = 20;
394
+ }
395
+ ```
396
+
397
+ ## reactiveforms-doc
398
+
399
+ InputNumber can also be used with reactive forms. In this case, the formControlName property is used to bind the component to a form control.
400
+
401
+ ```typescript
402
+ import { Component, inject } from '@angular/core';
403
+ import { ReactiveFormsModule } from '@angular/forms';
404
+ import { InputNumberModule } from '@exhaustive-ui/core/inputnumber';
405
+ import { MessageModule } from '@exhaustive-ui/core/message';
406
+ import { ToastModule } from '@exhaustive-ui/core/toast';
407
+ import { ButtonModule } from '@exhaustive-ui/core/button';
408
+ import { MessageService } from '@exhaustive-ui/core/api';
409
+
410
+ @Component({
411
+ template: `
412
+ <p-toast />
413
+ <div class="card flex justify-center">
414
+ <form [formGroup]="exampleForm" (ngSubmit)="onSubmit()" class="flex flex-col gap-4">
415
+ <div class="flex flex-col gap-1">
416
+ <p-inputnumber inputId="integeronly" formControlName="value" [invalid]="isInvalid('value')" />
417
+ @if (isInvalid('value')) {
418
+ <p-message severity="error" size="small" variant="simple">Number is required.</p-message>
419
+ }
420
+ </div>
421
+ <button pButton severity="secondary" type="submit"><span pButtonLabel>Submit</span></button>
422
+ </form>
423
+ </div>
424
+ `,
425
+ standalone: true,
426
+ imports: [InputNumberModule, MessageModule, ToastModule, ButtonModule, ReactiveFormsModule]
427
+ })
428
+ export class InputnumberReactiveformsDemo {
429
+ messageService = inject(MessageService);
430
+ exampleForm: FormGroup | undefined;
431
+ formSubmitted: boolean = false;
432
+
433
+ constructor() {
434
+ this.exampleForm = this.fb.group({
435
+ value: [undefined, Validators.required]
436
+ });
437
+ }
438
+
439
+ onSubmit() {
440
+ this.formSubmitted = true;
441
+ if (this.exampleForm.valid) {
442
+ this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Form Submitted', life: 3000 });
443
+ this.exampleForm.reset();
444
+ this.formSubmitted = false;
445
+ }
446
+ }
447
+
448
+ isInvalid(controlName: string) {
449
+ const control = this.exampleForm.get(controlName);
450
+ return control?.invalid && (control.touched || this.formSubmitted);
451
+ }
452
+ }
453
+ ```
454
+
455
+ ## Sizes
456
+
457
+ InputNumber provides small and large sizes as alternatives to the base.
458
+
459
+ ```typescript
460
+ import { Component } from '@angular/core';
461
+ import { FormsModule } from '@angular/forms';
462
+ import { InputNumberModule } from '@exhaustive-ui/core/inputnumber';
463
+
464
+ @Component({
465
+ template: `
466
+ <div class="card flex flex-col items-center gap-4">
467
+ <p-inputnumber [(ngModel)]="value1" size="small" placeholder="Small" mode="currency" currency="USD" locale="en-US" />
468
+ <p-inputnumber [(ngModel)]="value2" placeholder="Normal" mode="currency" currency="USD" locale="en-US" />
469
+ <p-inputnumber [(ngModel)]="value3" size="large" placeholder="Large" mode="currency" currency="USD" locale="en-US" />
470
+ </div>
471
+ `,
472
+ standalone: true,
473
+ imports: [InputNumberModule, FormsModule]
474
+ })
475
+ export class InputnumberSizesDemo {
476
+ value1!: number;
477
+ value2!: number;
478
+ value3!: number;
479
+ }
480
+ ```
481
+
482
+ ## templatedrivenforms-doc
483
+
484
+ ```typescript
485
+ import { Component, inject } from '@angular/core';
486
+ import { FormsModule } from '@angular/forms';
487
+ import { InputNumberModule } from '@exhaustive-ui/core/inputnumber';
488
+ import { MessageModule } from '@exhaustive-ui/core/message';
489
+ import { ToastModule } from '@exhaustive-ui/core/toast';
490
+ import { ButtonModule } from '@exhaustive-ui/core/button';
491
+ import { MessageService } from '@exhaustive-ui/core/api';
492
+
493
+ @Component({
494
+ template: `
495
+ <p-toast />
496
+ <div class="card flex justify-center">
497
+ <form #exampleForm="ngForm" (ngSubmit)="onSubmit(exampleForm)" class="flex flex-col gap-4">
498
+ <div class="flex flex-col gap-1">
499
+ <p-inputnumber inputId="integeronly" #inputValue="ngModel" name="inputValue" [(ngModel)]="value" [invalid]="inputValue.invalid && (inputValue.touched || exampleForm.submitted)" required />
500
+ @if (inputValue.invalid && (inputValue.touched || exampleForm.submitted)) {
501
+ <p-message severity="error" size="small" variant="simple">Number is required.</p-message>
502
+ }
503
+ </div>
504
+ <button pButton severity="secondary" type="submit"><span pButtonLabel>Submit</span></button>
505
+ </form>
506
+ </div>
507
+ `,
508
+ standalone: true,
509
+ imports: [InputNumberModule, MessageModule, ToastModule, ButtonModule, FormsModule]
510
+ })
511
+ export class InputnumberTemplatedrivenformsDemo {
512
+ messageService = inject(MessageService);
513
+ value: any;
514
+
515
+ onSubmit(form: any) {
516
+ if (form.valid) {
517
+ this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Form Submitted', life: 3000 });
518
+ form.resetForm();
519
+ }
520
+ }
521
+ }
522
+ ```
523
+
524
+ ## Vertical
525
+
526
+ Buttons can also placed vertically by setting buttonLayout as vertical .
527
+
528
+ ```typescript
529
+ import { Component } from '@angular/core';
530
+ import { FormsModule } from '@angular/forms';
531
+ import { InputNumberModule } from '@exhaustive-ui/core/inputnumber';
532
+
533
+ @Component({
534
+ template: `
535
+ <div class="card flex justify-center">
536
+ <p-inputnumber [(ngModel)]="value1" [showButtons]="true" buttonLayout="vertical" spinnerMode="vertical" inputId="vertical" [inputStyle]="{ width: '3rem' }">
537
+ <ng-template #incrementbuttonicon>
538
+ <span class="pi pi-plus"></span>
539
+ </ng-template>
540
+ <ng-template #decrementbuttonicon>
541
+ <span class="pi pi-minus"></span>
542
+ </ng-template>
543
+ </p-inputnumber>
544
+ </div>
545
+ `,
546
+ standalone: true,
547
+ imports: [InputNumberModule, FormsModule]
548
+ })
549
+ export class InputnumberVerticalDemo {
550
+ value1: number = 50;
551
+ }
552
+ ```
553
+
554
+ ## Input Number
555
+
556
+ InputNumber is an input component to provide numerical input.
557
+
558
+ ### Props
559
+
560
+ | Name | Type | Default | Description |
561
+ |------|------|---------|-------------|
562
+ | dt | InputSignal<Object> | undefined | Defines scoped design tokens of the component. |
563
+ | unstyled | InputSignal<boolean> | undefined | Indicates whether the component should be rendered without styles. |
564
+ | pt | InputSignal<InputNumberPassThrough> | undefined | Used to pass attributes to DOM elements inside the component. |
565
+ | ptOptions | InputSignal<PassThroughOptions> | undefined | Used to configure passthrough(pt) options of the component. |
566
+ | required | InputSignalWithTransform<boolean, unknown> | false | There must be a value (if set). |
567
+ | invalid | InputSignalWithTransform<boolean, unknown> | false | When present, it specifies that the component should have invalid state style. |
568
+ | disabled | InputSignalWithTransform<boolean, unknown> | false | When present, it specifies that the component should have disabled state style. |
569
+ | name | InputSignal<string> | undefined | When present, it specifies that the name of the input. |
570
+ | fluid | InputSignalWithTransform<boolean, unknown> | false | Spans 100% width of the container when enabled. |
571
+ | variant | InputSignal<"outlined" \| "filled"> | 'outlined' | Specifies the input variant of the component. |
572
+ | size | InputSignal<"small" \| "large"> | undefined | Specifies the size of the component. |
573
+ | inputSize | InputSignal<number> | undefined | Specifies the visible width of the input element in characters. |
574
+ | pattern | InputSignal<string> | undefined | Specifies the value must match the pattern. |
575
+ | min | InputSignal<number> | undefined | The value must be greater than or equal to the value. |
576
+ | max | InputSignal<number> | undefined | The value must be less than or equal to the value. |
577
+ | step | InputSignal<number> | undefined | Unless the step is set to the any literal, the value must be min + an integral multiple of the step. |
578
+ | minlength | InputSignal<number> | undefined | The number of characters (code points) must not be less than the value of the attribute, if non-empty. |
579
+ | maxlength | InputSignal<number> | undefined | The number of characters (code points) must not exceed the value of the attribute. |
580
+ | showButtons | InputSignalWithTransform<boolean, unknown> | ... | Displays spinner buttons. |
581
+ | format | InputSignalWithTransform<boolean, unknown> | ... | Whether to format the value. |
582
+ | buttonLayout | InputSignal<string> | ... | Layout of the buttons, valid values are "stacked" (default), "horizontal" and "vertical". |
583
+ | inputId | InputSignal<string> | ... | Identifier of the focus input to match a label defined for the component. |
584
+ | placeholder | InputSignal<string> | ... | Advisory information to display on input. |
585
+ | tabindex | InputSignalWithTransform<number, unknown> | ... | Specifies tab order of the element. |
586
+ | title | InputSignal<string> | ... | Title text of the input text. |
587
+ | ariaLabelledBy | InputSignal<string> | ... | Specifies one or more IDs in the DOM that labels the input field. |
588
+ | ariaDescribedBy | InputSignal<string> | ... | Specifies one or more IDs in the DOM that describes the input field. |
589
+ | ariaLabel | InputSignal<string> | ... | Used to define a string that labels the input element. |
590
+ | ariaRequired | InputSignalWithTransform<boolean, unknown> | ... | Used to indicate that user input is required on an element before a form can be submitted. |
591
+ | autocomplete | InputSignal<string> | ... | Used to define a string that autocomplete attribute the current element. |
592
+ | incrementButtonClass | InputSignal<string> | ... | Style class of the increment button. |
593
+ | decrementButtonClass | InputSignal<string> | ... | Style class of the decrement button. |
594
+ | incrementButtonIcon | InputSignal<string> | ... | Style class of the increment button. |
595
+ | decrementButtonIcon | InputSignal<string> | ... | Style class of the decrement button. |
596
+ | readonly | InputSignalWithTransform<boolean, unknown> | ... | When present, it specifies that an input field is read-only. |
597
+ | allowEmpty | InputSignalWithTransform<boolean, unknown> | ... | Determines whether the input field is empty. |
598
+ | locale | InputSignal<string> | ... | Locale to be used in formatting. |
599
+ | localeMatcher | InputSignal<any> | ... | The locale matching algorithm to use. Possible values are "lookup" and "best fit"; the default is "best fit". See Locale Negotiation for details. |
600
+ | mode | InputSignal<any> | ... | Defines the behavior of the component, valid values are "decimal" and "currency". |
601
+ | currency | InputSignal<string> | ... | The currency to use in currency formatting. Possible values are the ISO 4217 currency codes, such as "USD" for the US dollar, "EUR" for the euro, or "CNY" for the Chinese RMB. There is no default value; if the style is "currency", the currency property must be provided. |
602
+ | currencyDisplay | InputSignal<any> | ... | How to display the currency in currency formatting. Possible values are "symbol" to use a localized currency symbol such as €, ü"code" to use the ISO currency code, "name" to use a localized currency name such as "dollar"; the default is "symbol". |
603
+ | useGrouping | InputSignalWithTransform<boolean, unknown> | ... | Whether to use grouping separators, such as thousands separators or thousand/lakh/crore separators. |
604
+ | minFractionDigits | InputSignalWithTransform<number, unknown> | ... | The minimum number of fraction digits to use. Possible values are from 0 to 20; the default for plain number and percent formatting is 0; the default for currency formatting is the number of minor unit digits provided by the ISO 4217 currency code list (2 if the list doesn't provide that information). |
605
+ | maxFractionDigits | InputSignalWithTransform<number, unknown> | ... | The maximum number of fraction digits to use. Possible values are from 0 to 20; the default for plain number formatting is the larger of minimumFractionDigits and 3; the default for currency formatting is the larger of minimumFractionDigits and the number of minor unit digits provided by the ISO 4217 currency code list (2 if the list doesn't provide that information). |
606
+ | prefix | InputSignal<string> | ... | Text to display before the value. |
607
+ | suffix | InputSignal<string> | ... | Text to display after the value. |
608
+ | inputStyle | InputSignal<any> | ... | Inline style of the input field. |
609
+ | inputStyleClass | InputSignal<string> | ... | Style class of the input field. |
610
+ | showClear | InputSignalWithTransform<boolean, unknown> | ... | When enabled, a clear icon is displayed to clear the value. |
611
+ | autofocus | InputSignalWithTransform<boolean, unknown> | ... | When present, it specifies that the component should automatically get focus on load. |
612
+
613
+ ### Emits
614
+
615
+ | Name | Parameters | Description |
616
+ |------|------------|-------------|
617
+ | onInput | event: InputNumberInputEvent | Callback to invoke on input. |
618
+ | onFocus | event: Event | Callback to invoke when the component receives focus. |
619
+ | onBlur | event: Event | Callback to invoke when the component loses focus. |
620
+ | onKeyDown | event: KeyboardEvent | Callback to invoke on input key press. |
621
+ | onClear | value: void | Callback to invoke when clear token is clicked. |
622
+
623
+ ### Templates
624
+
625
+ | Name | Type | Description |
626
+ |------|------|-------------|
627
+ | clearicon | TemplateRef<void> | Custom clear icon template. |
628
+ | incrementbuttonicon | TemplateRef<void> | Custom increment button icon template. |
629
+ | decrementbuttonicon | TemplateRef<void> | Custom decrement button icon template. |
630
+
631
+ ## Pass Through Options
632
+
633
+ | Name | Type | Description |
634
+ |------|------|-------------|
635
+ | host | PassThroughOption<HTMLElement, I> | Used to pass attributes to the host's DOM element. |
636
+ | root | PassThroughOption<HTMLElement, I> | Used to pass attributes to the root's DOM element. |
637
+ | pcInputText | InputTextPassThrough | Used to pass attributes to the InputText component. |
638
+ | clearIcon | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the clear icon's DOM element. |
639
+ | buttonGroup | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the button group's DOM element. |
640
+ | incrementButton | PassThroughOption<HTMLButtonElement, I> | Used to pass attributes to the increment button's DOM element. |
641
+ | decrementButton | PassThroughOption<HTMLButtonElement, I> | Used to pass attributes to the decrement button's DOM element. |
642
+ | incrementButtonIcon | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the increment button icon's DOM element. |
643
+ | decrementButtonIcon | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the decrement button icon's DOM element. |
644
+
645
+ ## Theming
646
+
647
+ ### CSS Classes
648
+
649
+ | Class | Description |
650
+ |-------|-------------|
651
+ | p-inputnumber | Class name of the root element |
652
+ | p-inputnumber-input | Class name of the input element |
653
+ | p-inputnumber-button-group | Class name of the button group element |
654
+ | p-inputnumber-increment-button | Class name of the increment button element |
655
+ | p-inputnumber-decrement-button | Class name of the decrement button element |
656
+ | p-autocomplete-clear-icon | Class name of the clear icon |
657
+
658
+ ### Design Tokens
659
+
660
+ | Token | CSS Variable | Description |
661
+ |-------|--------------|-------------|
662
+ | inputnumber.transition.duration | --p-inputnumber-transition-duration | Transition duration of root |
663
+ | inputnumber.button.width | --p-inputnumber-button-width | Width of button |
664
+ | inputnumber.button.border.radius | --p-inputnumber-button-border-radius | Border radius of button |
665
+ | inputnumber.button.vertical.padding | --p-inputnumber-button-vertical-padding | Vertical padding of button |
666
+ | inputnumber.button.background | --p-inputnumber-button-background | Background of button |
667
+ | inputnumber.button.hover.background | --p-inputnumber-button-hover-background | Hover background of button |
668
+ | inputnumber.button.active.background | --p-inputnumber-button-active-background | Active background of button |
669
+ | inputnumber.button.border.color | --p-inputnumber-button-border-color | Border color of button |
670
+ | inputnumber.button.hover.border.color | --p-inputnumber-button-hover-border-color | Hover border color of button |
671
+ | inputnumber.button.active.border.color | --p-inputnumber-button-active-border-color | Active border color of button |
672
+ | inputnumber.button.color | --p-inputnumber-button-color | Color of button |
673
+ | inputnumber.button.hover.color | --p-inputnumber-button-hover-color | Hover color of button |
674
+ | inputnumber.button.active.color | --p-inputnumber-button-active-color | Active color of button |
675
+