@exhaustive-ui/mcp 22.0.0-rc.2 → 22.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/components/accordion.md +1 -0
- package/data/components/autocomplete.md +59 -0
- package/data/components/cascadeselect.md +136 -0
- package/data/components/checkbox.md +56 -0
- package/data/components/colorpicker.md +49 -0
- package/data/components/confirmpopup.md +0 -7
- package/data/components/dataview.md +0 -2
- package/data/components/datepicker.md +52 -3
- package/data/components/drawer.md +1 -1
- package/data/components/editor.md +49 -0
- package/data/components/floatlabel.md +72 -0
- package/data/components/iftalabel.md +68 -0
- package/data/components/inputmask.md +54 -4
- package/data/components/inputnumber.md +52 -3
- package/data/components/inputotp.md +50 -0
- package/data/components/inputtext.md +63 -1
- package/data/components/knob.md +55 -0
- package/data/components/listbox.md +57 -2
- package/data/components/message.md +0 -1
- package/data/components/multiselect.md +59 -4
- package/data/components/orderlist.md +1 -3
- package/data/components/password.md +52 -3
- package/data/components/picklist.md +0 -3
- package/data/components/radiobutton.md +60 -0
- package/data/components/rating.md +49 -0
- package/data/components/select.md +58 -3
- package/data/components/selectbutton.md +50 -1
- package/data/components/slider.md +50 -0
- package/data/components/stepper.md +0 -1
- package/data/components/table.md +1 -1
- package/data/components/textarea.md +48 -0
- package/data/components/togglebutton.md +50 -0
- package/data/components/toggleswitch.md +49 -0
- package/data/components/tooltip.md +0 -1
- package/data/components/treeselect.md +61 -1
- package/data/components/treetable.md +1 -1
- package/data/components.json +774 -503
- package/data/llms-full.txt +3494 -819
- package/data/llms.txt +2 -1
- package/data/manifest.json +91 -476
- package/data/pages/accessibility.md +164 -6
- package/data/pages/animations.md +110 -5
- package/data/pages/configuration.md +107 -102
- package/data/pages/contribution.md +68 -7
- package/data/pages/customicons.md +8 -8
- package/data/pages/faq.md +103 -8
- package/data/pages/icons.md +24 -23
- package/data/pages/installation.md +77 -25
- package/data/pages/llms.md +71 -15
- package/data/pages/passthrough.md +96 -7
- package/data/pages/philosophy.md +80 -11
- package/data/pages/primeflex.md +41 -4
- package/data/pages/rtl.md +4 -1
- package/data/pages/styled.md +174 -66
- package/data/pages/tailwind.md +309 -218
- package/data/pages/unstyled.md +48 -7
- package/data/pages/update.md +42 -13
- package/data/pages/v22.md +218 -0
- package/data/snapshot.json +4 -4
- package/dist/index.mjs +72 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -60,6 +60,64 @@ export class IftalabelInvalidDemo {
|
|
|
60
60
|
}
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
+
## Sizes
|
|
64
|
+
|
|
65
|
+
The label follows the small and large sizes of the field it wraps: its inset, its font size and the vertical room left for it.
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
import { Component } from '@angular/core';
|
|
69
|
+
import { FormsModule } from '@angular/forms';
|
|
70
|
+
import { SelectModule } from '@exhaustive-ui/core/select';
|
|
71
|
+
import { IftaLabelModule } from '@exhaustive-ui/core/iftalabel';
|
|
72
|
+
import { InputTextModule } from '@exhaustive-ui/core/inputtext';
|
|
73
|
+
|
|
74
|
+
@Component({
|
|
75
|
+
template: `
|
|
76
|
+
<div class="card flex flex-col items-center gap-6">
|
|
77
|
+
<div class="flex flex-wrap justify-center items-end gap-4">
|
|
78
|
+
<p-iftalabel>
|
|
79
|
+
<input pInputText id="small_input" pSize="small" [(ngModel)]="value1" autocomplete="off" />
|
|
80
|
+
<label for="small_input">Small</label>
|
|
81
|
+
</p-iftalabel>
|
|
82
|
+
<p-iftalabel>
|
|
83
|
+
<input pInputText id="normal_input" [(ngModel)]="value2" autocomplete="off" />
|
|
84
|
+
<label for="normal_input">Normal</label>
|
|
85
|
+
</p-iftalabel>
|
|
86
|
+
<p-iftalabel>
|
|
87
|
+
<input pInputText id="large_input" pSize="large" [(ngModel)]="value3" autocomplete="off" />
|
|
88
|
+
<label for="large_input">Large</label>
|
|
89
|
+
</p-iftalabel>
|
|
90
|
+
</div>
|
|
91
|
+
<div class="flex flex-wrap justify-center items-end gap-4">
|
|
92
|
+
<p-iftalabel>
|
|
93
|
+
<p-select [(ngModel)]="city1" inputId="small_select" [options]="cities" size="small" class="w-56" />
|
|
94
|
+
<label for="small_select">Small</label>
|
|
95
|
+
</p-iftalabel>
|
|
96
|
+
<p-iftalabel>
|
|
97
|
+
<p-select [(ngModel)]="city2" inputId="normal_select" [options]="cities" class="w-56" />
|
|
98
|
+
<label for="normal_select">Normal</label>
|
|
99
|
+
</p-iftalabel>
|
|
100
|
+
<p-iftalabel>
|
|
101
|
+
<p-select [(ngModel)]="city3" inputId="large_select" [options]="cities" size="large" class="w-56" />
|
|
102
|
+
<label for="large_select">Large</label>
|
|
103
|
+
</p-iftalabel>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
`,
|
|
107
|
+
standalone: true,
|
|
108
|
+
imports: [SelectModule, IftaLabelModule, InputTextModule, FormsModule]
|
|
109
|
+
})
|
|
110
|
+
export class IftalabelSizesDemo {
|
|
111
|
+
value1: string | undefined;
|
|
112
|
+
value2: string | undefined;
|
|
113
|
+
value3: string | undefined;
|
|
114
|
+
city1: string | undefined;
|
|
115
|
+
city2: string | undefined;
|
|
116
|
+
city3: string | undefined;
|
|
117
|
+
cities: any[] = ['New York', 'Rome', 'London', 'Istanbul', 'Paris'];
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
63
121
|
## Ifta Label
|
|
64
122
|
|
|
65
123
|
IftaLabel is used to create infield top aligned labels.
|
|
@@ -100,6 +158,16 @@ IftaLabel is used to create infield top aligned labels.
|
|
|
100
158
|
| iftalabel.top | --p-iftalabel-top | Top of root |
|
|
101
159
|
| iftalabel.font.size | --p-iftalabel-font-size | Font size of root |
|
|
102
160
|
| iftalabel.font.weight | --p-iftalabel-font-weight | Font weight of root |
|
|
161
|
+
| iftalabel.sm.position.x | --p-iftalabel-sm-position-x | Sm position x of root |
|
|
162
|
+
| iftalabel.sm.top | --p-iftalabel-sm-top | Sm top of root |
|
|
163
|
+
| iftalabel.sm.font.size | --p-iftalabel-sm-font-size | Sm font size of root |
|
|
164
|
+
| iftalabel.lg.position.x | --p-iftalabel-lg-position-x | Lg position x of root |
|
|
165
|
+
| iftalabel.lg.top | --p-iftalabel-lg-top | Lg top of root |
|
|
166
|
+
| iftalabel.lg.font.size | --p-iftalabel-lg-font-size | Lg font size of root |
|
|
103
167
|
| iftalabel.input.padding.top | --p-iftalabel-input-padding-top | Padding top of input |
|
|
104
168
|
| iftalabel.input.padding.bottom | --p-iftalabel-input-padding-bottom | Padding bottom of input |
|
|
169
|
+
| iftalabel.input.sm.padding.top | --p-iftalabel-input-sm-padding-top | Sm padding top of input |
|
|
170
|
+
| iftalabel.input.sm.padding.bottom | --p-iftalabel-input-sm-padding-bottom | Sm padding bottom of input |
|
|
171
|
+
| iftalabel.input.lg.padding.top | --p-iftalabel-input-lg-padding-top | Lg padding top of input |
|
|
172
|
+
| iftalabel.input.lg.padding.bottom | --p-iftalabel-input-lg-padding-bottom | Lg padding bottom of input |
|
|
105
173
|
|
|
@@ -338,6 +338,56 @@ export class InputmaskReactiveformsDemo {
|
|
|
338
338
|
}
|
|
339
339
|
```
|
|
340
340
|
|
|
341
|
+
## Signal Forms
|
|
342
|
+
|
|
343
|
+
InputMask can also be used with Angular Signal Forms , the @angular/forms/signals API of Angular 21 and newer. The form model is a signal, form() declares its validators and the [formField] directive binds the component to a field. The field also sets the invalid state of the component, so the component is styled as invalid before any interaction, while the messages below appear once the field is touched or the form is submitted.
|
|
344
|
+
|
|
345
|
+
```typescript
|
|
346
|
+
import { Component, inject, signal } from '@angular/core';
|
|
347
|
+
import { form, FormField, required, submit } from '@angular/forms/signals';
|
|
348
|
+
import { MessageModule } from '@exhaustive-ui/core/message';
|
|
349
|
+
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
350
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
351
|
+
import { InputTextModule } from '@exhaustive-ui/core/inputtext';
|
|
352
|
+
import { InputMaskModule } from '@exhaustive-ui/core/inputmask';
|
|
353
|
+
import { MessageService } from '@exhaustive-ui/core/api';
|
|
354
|
+
|
|
355
|
+
@Component({
|
|
356
|
+
template: `
|
|
357
|
+
<p-toast />
|
|
358
|
+
<div class="card flex justify-center">
|
|
359
|
+
<form novalidate (submit)="onSubmit($event)" class="flex flex-col gap-4 sm:w-56">
|
|
360
|
+
<div class="flex flex-col gap-1">
|
|
361
|
+
<input pInputText pInputMask="99-999999" [formField]="exampleForm.value" placeholder="99-999999" fluid />
|
|
362
|
+
@let value = exampleForm.value();
|
|
363
|
+
@if (value.invalid() && value.touched()) {
|
|
364
|
+
<p-message severity="error" size="small" variant="simple">Serial number is required.</p-message>
|
|
365
|
+
}
|
|
366
|
+
</div>
|
|
367
|
+
<button pButton severity="secondary" type="submit"><span pButtonLabel>Submit</span></button>
|
|
368
|
+
</form>
|
|
369
|
+
</div>
|
|
370
|
+
`,
|
|
371
|
+
standalone: true,
|
|
372
|
+
imports: [MessageModule, ToastModule, ButtonModule, InputTextModule, InputMaskModule, FormField]
|
|
373
|
+
})
|
|
374
|
+
export class InputmaskSignalformsDemo {
|
|
375
|
+
messageService = inject(MessageService);
|
|
376
|
+
model = signal({ value: '' });
|
|
377
|
+
exampleForm = form(this.model, (f) => {
|
|
378
|
+
required(f.value);
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
onSubmit(event: Event) {
|
|
382
|
+
event.preventDefault();
|
|
383
|
+
submit(this.exampleForm, async () => {
|
|
384
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Form is submitted', life: 3000 });
|
|
385
|
+
this.exampleForm().reset({ value: '' });
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
```
|
|
390
|
+
|
|
341
391
|
## Sizes
|
|
342
392
|
|
|
343
393
|
InputMask provides small and large sizes as alternatives to the base.
|
|
@@ -454,9 +504,9 @@ InputMask component is used to enter input in a certain format such as numeric,
|
|
|
454
504
|
| variant | InputSignal<"outlined" \| "filled"> | 'outlined' | Specifies the input variant of the component. |
|
|
455
505
|
| size | InputSignal<"small" \| "large"> | undefined | Specifies the size of the component. |
|
|
456
506
|
| inputSize | InputSignal<number> | undefined | Specifies the visible width of the input element in characters. |
|
|
457
|
-
| pattern |
|
|
458
|
-
| min |
|
|
459
|
-
| max |
|
|
507
|
+
| pattern | InputSignalWithTransform<string, string \| readonly RegExp[]> | undefined | Specifies the value must match the pattern. |
|
|
508
|
+
| min | InputSignalWithTransform<number, unknown> | undefined | The value must be greater than or equal to the value. |
|
|
509
|
+
| max | InputSignalWithTransform<number, unknown> | undefined | The value must be less than or equal to the value. |
|
|
460
510
|
| step | InputSignal<number> | undefined | Unless the step is set to the any literal, the value must be min + an integral multiple of the step. |
|
|
461
511
|
| minlength | InputSignal<number> | undefined | The number of characters (code points) must not be less than the value of the attribute, if non-empty. |
|
|
462
512
|
| maxlength | InputSignal<number> | undefined | The number of characters (code points) must not exceed the value of the attribute. |
|
|
@@ -479,7 +529,7 @@ InputMask component is used to enter input in a certain format such as numeric,
|
|
|
479
529
|
| autofocus | InputSignalWithTransform<boolean, unknown> | ... | When present, the input gets a focus automatically on load. |
|
|
480
530
|
| autocomplete | InputSignal<string> | ... | Used to define a string that autocomplete attribute the current element. |
|
|
481
531
|
| keepBuffer | InputSignalWithTransform<boolean, unknown> | ... | When present, it specifies that whether to clean buffer value from model. |
|
|
482
|
-
| mask | InputSignal<string> | ... | Mask pattern. |
|
|
532
|
+
| mask | InputSignal<string> | ... | Mask pattern. A backslash makes the next character a literal, e.g. mask="+\9 999" for a fixed '+9' prefix. |
|
|
483
533
|
|
|
484
534
|
### Emits
|
|
485
535
|
|
|
@@ -452,6 +452,55 @@ export class InputnumberReactiveformsDemo {
|
|
|
452
452
|
}
|
|
453
453
|
```
|
|
454
454
|
|
|
455
|
+
## Signal Forms
|
|
456
|
+
|
|
457
|
+
InputNumber can also be used with Angular Signal Forms , the @angular/forms/signals API of Angular 21 and newer. The form model is a signal, form() declares its validators and the [formField] directive binds the component to a field. The field also sets the invalid state of the component, so the component is styled as invalid before any interaction, while the messages below appear once the field is touched or the form is submitted.
|
|
458
|
+
|
|
459
|
+
```typescript
|
|
460
|
+
import { Component, inject, signal } from '@angular/core';
|
|
461
|
+
import { form, FormField, required, submit } from '@angular/forms/signals';
|
|
462
|
+
import { InputNumberModule } from '@exhaustive-ui/core/inputnumber';
|
|
463
|
+
import { MessageModule } from '@exhaustive-ui/core/message';
|
|
464
|
+
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
465
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
466
|
+
import { MessageService } from '@exhaustive-ui/core/api';
|
|
467
|
+
|
|
468
|
+
@Component({
|
|
469
|
+
template: `
|
|
470
|
+
<p-toast />
|
|
471
|
+
<div class="card flex justify-center">
|
|
472
|
+
<form novalidate (submit)="onSubmit($event)" class="flex flex-col gap-4">
|
|
473
|
+
<div class="flex flex-col gap-1">
|
|
474
|
+
<p-inputnumber inputId="integeronly" [formField]="exampleForm.value" />
|
|
475
|
+
@let value = exampleForm.value();
|
|
476
|
+
@if (value.invalid() && value.touched()) {
|
|
477
|
+
<p-message severity="error" size="small" variant="simple">Number is required.</p-message>
|
|
478
|
+
}
|
|
479
|
+
</div>
|
|
480
|
+
<button pButton severity="secondary" type="submit"><span pButtonLabel>Submit</span></button>
|
|
481
|
+
</form>
|
|
482
|
+
</div>
|
|
483
|
+
`,
|
|
484
|
+
standalone: true,
|
|
485
|
+
imports: [InputNumberModule, MessageModule, ToastModule, ButtonModule, FormField]
|
|
486
|
+
})
|
|
487
|
+
export class InputnumberSignalformsDemo {
|
|
488
|
+
messageService = inject(MessageService);
|
|
489
|
+
model = signal<{ value: number | null }>({ value: null });
|
|
490
|
+
exampleForm = form(this.model, (f) => {
|
|
491
|
+
required(f.value);
|
|
492
|
+
});
|
|
493
|
+
|
|
494
|
+
onSubmit(event: Event) {
|
|
495
|
+
event.preventDefault();
|
|
496
|
+
submit(this.exampleForm, async () => {
|
|
497
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Form Submitted', life: 3000 });
|
|
498
|
+
this.exampleForm().reset({ value: null });
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
```
|
|
503
|
+
|
|
455
504
|
## Sizes
|
|
456
505
|
|
|
457
506
|
InputNumber provides small and large sizes as alternatives to the base.
|
|
@@ -571,9 +620,9 @@ InputNumber is an input component to provide numerical input.
|
|
|
571
620
|
| variant | InputSignal<"outlined" \| "filled"> | 'outlined' | Specifies the input variant of the component. |
|
|
572
621
|
| size | InputSignal<"small" \| "large"> | undefined | Specifies the size of the component. |
|
|
573
622
|
| inputSize | InputSignal<number> | undefined | Specifies the visible width of the input element in characters. |
|
|
574
|
-
| pattern |
|
|
575
|
-
| min |
|
|
576
|
-
| max |
|
|
623
|
+
| pattern | InputSignalWithTransform<string, string \| readonly RegExp[]> | undefined | Specifies the value must match the pattern. |
|
|
624
|
+
| min | InputSignalWithTransform<number, unknown> | undefined | The value must be greater than or equal to the value. |
|
|
625
|
+
| max | InputSignalWithTransform<number, unknown> | undefined | The value must be less than or equal to the value. |
|
|
577
626
|
| 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
627
|
| minlength | InputSignal<number> | undefined | The number of characters (code points) must not be less than the value of the attribute, if non-empty. |
|
|
579
628
|
| maxlength | InputSignal<number> | undefined | The number of characters (code points) must not exceed the value of the attribute. |
|
|
@@ -172,6 +172,56 @@ export class InputotpSampleDemo {
|
|
|
172
172
|
}
|
|
173
173
|
```
|
|
174
174
|
|
|
175
|
+
## Signal Forms
|
|
176
|
+
|
|
177
|
+
InputOtp can also be used with Angular Signal Forms , the @angular/forms/signals API of Angular 21 and newer. The form model is a signal, form() declares its validators and the [formField] directive binds the component to a field. The field also sets the invalid state of the component, so the component is styled as invalid before any interaction, while the messages below appear once the field is touched or the form is submitted.
|
|
178
|
+
|
|
179
|
+
```typescript
|
|
180
|
+
import { Component, inject, signal } from '@angular/core';
|
|
181
|
+
import { form, FormField, minLength, required, submit } from '@angular/forms/signals';
|
|
182
|
+
import { InputOtpModule } from '@exhaustive-ui/core/inputotp';
|
|
183
|
+
import { MessageModule } from '@exhaustive-ui/core/message';
|
|
184
|
+
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
185
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
186
|
+
import { MessageService } from '@exhaustive-ui/core/api';
|
|
187
|
+
|
|
188
|
+
@Component({
|
|
189
|
+
template: `
|
|
190
|
+
<p-toast />
|
|
191
|
+
<div class="card flex justify-center">
|
|
192
|
+
<form novalidate (submit)="onSubmit($event)" class="flex flex-col gap-4">
|
|
193
|
+
<div class="flex flex-col gap-1">
|
|
194
|
+
<p-inputotp [formField]="exampleForm.value" />
|
|
195
|
+
@let value = exampleForm.value();
|
|
196
|
+
@if (value.invalid() && value.touched()) {
|
|
197
|
+
<p-message severity="error" size="small" variant="simple">Passcode is required.</p-message>
|
|
198
|
+
}
|
|
199
|
+
</div>
|
|
200
|
+
<button pButton severity="secondary" type="submit"><span pButtonLabel>Submit</span></button>
|
|
201
|
+
</form>
|
|
202
|
+
</div>
|
|
203
|
+
`,
|
|
204
|
+
standalone: true,
|
|
205
|
+
imports: [InputOtpModule, MessageModule, ToastModule, ButtonModule, FormField]
|
|
206
|
+
})
|
|
207
|
+
export class InputotpSignalformsDemo {
|
|
208
|
+
messageService = inject(MessageService);
|
|
209
|
+
model = signal({ value: '' });
|
|
210
|
+
exampleForm = form(this.model, (f) => {
|
|
211
|
+
required(f.value);
|
|
212
|
+
minLength(f.value, 4);
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
onSubmit(event: Event) {
|
|
216
|
+
event.preventDefault();
|
|
217
|
+
submit(this.exampleForm, async () => {
|
|
218
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Form is submitted', life: 3000 });
|
|
219
|
+
this.exampleForm().reset({ value: '' });
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
175
225
|
## Sizes
|
|
176
226
|
|
|
177
227
|
InputOtp provides small and large sizes as alternatives to the base.
|
|
@@ -336,6 +336,69 @@ export class InputtextReactiveformsDemo {
|
|
|
336
336
|
}
|
|
337
337
|
```
|
|
338
338
|
|
|
339
|
+
## Signal Forms
|
|
340
|
+
|
|
341
|
+
InputText can also be used with Angular Signal Forms , the @angular/forms/signals API of Angular 21 and newer. The form model is a signal, form() declares its validators and the [formField] directive binds the component to a field. The field also sets the invalid state of the component, so the component is styled as invalid before any interaction, while the messages below appear once the field is touched or the form is submitted.
|
|
342
|
+
|
|
343
|
+
```typescript
|
|
344
|
+
import { Component, inject, signal } from '@angular/core';
|
|
345
|
+
import { email, form, FormField, required, submit } from '@angular/forms/signals';
|
|
346
|
+
import { MessageModule } from '@exhaustive-ui/core/message';
|
|
347
|
+
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
348
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
349
|
+
import { InputTextModule } from '@exhaustive-ui/core/inputtext';
|
|
350
|
+
import { MessageService } from '@exhaustive-ui/core/api';
|
|
351
|
+
|
|
352
|
+
@Component({
|
|
353
|
+
template: `
|
|
354
|
+
<p-toast />
|
|
355
|
+
<div class="card flex justify-center">
|
|
356
|
+
<form novalidate (submit)="onSubmit($event)" class="flex flex-col gap-4 w-full sm:w-56">
|
|
357
|
+
<div class="flex flex-col gap-1">
|
|
358
|
+
<input pInputText type="text" id="username" placeholder="Username" [formField]="exampleForm.username" />
|
|
359
|
+
@let username = exampleForm.username();
|
|
360
|
+
@if (username.invalid() && username.touched()) {
|
|
361
|
+
<p-message severity="error" size="small" variant="simple">Username is required.</p-message>
|
|
362
|
+
}
|
|
363
|
+
</div>
|
|
364
|
+
<div class="flex flex-col gap-1">
|
|
365
|
+
<input pInputText type="email" id="email" placeholder="Email" [formField]="exampleForm.email" />
|
|
366
|
+
@let email = exampleForm.email();
|
|
367
|
+
@if (email.invalid() && email.touched()) {
|
|
368
|
+
@if (email.getError('required')) {
|
|
369
|
+
<p-message severity="error" size="small" variant="simple">Email is required.</p-message>
|
|
370
|
+
}
|
|
371
|
+
@if (email.getError('email')) {
|
|
372
|
+
<p-message severity="error" size="small" variant="simple">Please enter a valid email.</p-message>
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
</div>
|
|
376
|
+
<button pButton severity="secondary" type="submit"><span pButtonLabel>Submit</span></button>
|
|
377
|
+
</form>
|
|
378
|
+
</div>
|
|
379
|
+
`,
|
|
380
|
+
standalone: true,
|
|
381
|
+
imports: [MessageModule, ToastModule, ButtonModule, InputTextModule, FormField]
|
|
382
|
+
})
|
|
383
|
+
export class InputtextSignalformsDemo {
|
|
384
|
+
messageService = inject(MessageService);
|
|
385
|
+
model = signal({ username: '', email: '' });
|
|
386
|
+
exampleForm = form(this.model, (f) => {
|
|
387
|
+
required(f.username);
|
|
388
|
+
required(f.email);
|
|
389
|
+
email(f.email);
|
|
390
|
+
});
|
|
391
|
+
|
|
392
|
+
onSubmit(event: Event) {
|
|
393
|
+
event.preventDefault();
|
|
394
|
+
submit(this.exampleForm, async () => {
|
|
395
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Form Submitted', life: 3000 });
|
|
396
|
+
this.exampleForm().reset({ username: '', email: '' });
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
```
|
|
401
|
+
|
|
339
402
|
## Sizes
|
|
340
403
|
|
|
341
404
|
InputText provides small and large sizes as alternatives to the standard.
|
|
@@ -430,7 +493,6 @@ InputText directive is an extension to standard input element with theming.
|
|
|
430
493
|
| unstyled | InputSignal<boolean> | undefined | Indicates whether the component should be rendered without styles. |
|
|
431
494
|
| pt | InputSignal<InputTextPassThrough> | undefined | Used to pass attributes to DOM elements inside the component. |
|
|
432
495
|
| ptOptions | InputSignal<PassThroughOptions> | undefined | Used to configure passthrough(pt) options of the component. |
|
|
433
|
-
| ptInputText | InputSignal<InputTextPassThrough> | undefined | Used to pass attributes to DOM elements inside the InputText component. **(Deprecated)** |
|
|
434
496
|
| pInputTextPT | InputSignal<InputTextPassThrough> | undefined | Used to pass attributes to DOM elements inside the InputText component. |
|
|
435
497
|
| pInputTextUnstyled | InputSignal<boolean> | undefined | Indicates whether the component should be rendered without styles. |
|
|
436
498
|
| pSize | InputSignal<"small" \| "large"> | ... | Defines the size of the component. |
|
package/data/components/knob.md
CHANGED
|
@@ -227,6 +227,61 @@ export class KnobReadonlyDemo {
|
|
|
227
227
|
}
|
|
228
228
|
```
|
|
229
229
|
|
|
230
|
+
## Signal Forms
|
|
231
|
+
|
|
232
|
+
Knob can also be used with Angular Signal Forms , the @angular/forms/signals API of Angular 21 and newer. The form model is a signal, form() declares its validators and the [formField] directive binds the component to a field. The field also sets the invalid state of the component, so the component is styled as invalid before any interaction, while the messages below appear once the field is touched or the form is submitted.
|
|
233
|
+
|
|
234
|
+
```typescript
|
|
235
|
+
import { Component, inject, signal } from '@angular/core';
|
|
236
|
+
import { form, FormField, submit, validate } from '@angular/forms/signals';
|
|
237
|
+
import { KnobModule } from '@exhaustive-ui/core/knob';
|
|
238
|
+
import { MessageModule } from '@exhaustive-ui/core/message';
|
|
239
|
+
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
240
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
241
|
+
import { MessageService } from '@exhaustive-ui/core/api';
|
|
242
|
+
|
|
243
|
+
@Component({
|
|
244
|
+
template: `
|
|
245
|
+
<p-toast />
|
|
246
|
+
<div class="card flex justify-center">
|
|
247
|
+
<form novalidate (submit)="onSubmit($event)" class="flex flex-col items-center gap-4">
|
|
248
|
+
<div class="flex flex-col items-center gap-1">
|
|
249
|
+
<p-knob [formField]="exampleForm.value" />
|
|
250
|
+
@let value = exampleForm.value();
|
|
251
|
+
@if (value.invalid() && (value.dirty() || value.touched())) {
|
|
252
|
+
@if (value.getError('min')) {
|
|
253
|
+
<p-message severity="error" size="small" variant="simple">Value must be greater than 25.</p-message>
|
|
254
|
+
}
|
|
255
|
+
@if (value.getError('max')) {
|
|
256
|
+
<p-message severity="error" size="small" variant="simple">Must be less than 75.</p-message>
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
</div>
|
|
260
|
+
<button pButton severity="secondary" type="submit"><span pButtonLabel>Submit</span></button>
|
|
261
|
+
</form>
|
|
262
|
+
</div>
|
|
263
|
+
`,
|
|
264
|
+
standalone: true,
|
|
265
|
+
imports: [KnobModule, MessageModule, ToastModule, ButtonModule, FormField]
|
|
266
|
+
})
|
|
267
|
+
export class KnobSignalformsDemo {
|
|
268
|
+
messageService = inject(MessageService);
|
|
269
|
+
model = signal({ value: 15 });
|
|
270
|
+
exampleForm = form(this.model, (f) => {
|
|
271
|
+
// min() and max() would also set the range of the knob, so the bounds are checked by a validator
|
|
272
|
+
validate(f.value, ({ value }) => (value() < 25 ? { kind: 'min' } : value() > 75 ? { kind: 'max' } : null));
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
onSubmit(event: Event) {
|
|
276
|
+
event.preventDefault();
|
|
277
|
+
submit(this.exampleForm, async () => {
|
|
278
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Form is submitted', life: 3000 });
|
|
279
|
+
this.exampleForm().reset({ value: 15 });
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
```
|
|
284
|
+
|
|
230
285
|
## Size
|
|
231
286
|
|
|
232
287
|
Diameter of the knob is defined in pixels using the size property.
|
|
@@ -457,6 +457,61 @@ export class ListboxReactiveformsDemo {
|
|
|
457
457
|
}
|
|
458
458
|
```
|
|
459
459
|
|
|
460
|
+
## Signal Forms
|
|
461
|
+
|
|
462
|
+
Listbox can also be used with Angular Signal Forms , the @angular/forms/signals API of Angular 21 and newer. The form model is a signal, form() declares its validators and the [formField] directive binds the component to a field. The field also sets the invalid state of the component, so the component is styled as invalid before any interaction, while the messages below appear once the field is touched or the form is submitted.
|
|
463
|
+
|
|
464
|
+
```typescript
|
|
465
|
+
import { Component, inject, signal } from '@angular/core';
|
|
466
|
+
import { form, FormField, required, submit } from '@angular/forms/signals';
|
|
467
|
+
import { ListboxModule } from '@exhaustive-ui/core/listbox';
|
|
468
|
+
import { MessageModule } from '@exhaustive-ui/core/message';
|
|
469
|
+
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
470
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
471
|
+
import { MessageService } from '@exhaustive-ui/core/api';
|
|
472
|
+
|
|
473
|
+
interface City {
|
|
474
|
+
name: string;
|
|
475
|
+
code: string;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
@Component({
|
|
479
|
+
template: `
|
|
480
|
+
<p-toast />
|
|
481
|
+
<div class="card flex justify-center">
|
|
482
|
+
<form novalidate (submit)="onSubmit($event)" class="flex flex-col gap-4 sm:w-56">
|
|
483
|
+
<div class="flex flex-col gap-1">
|
|
484
|
+
<p-listbox [options]="cities" [formField]="exampleForm.selectedCity" optionLabel="name" class="w-full md:w-56" />
|
|
485
|
+
@let selectedCity = exampleForm.selectedCity();
|
|
486
|
+
@if (selectedCity.invalid() && selectedCity.touched()) {
|
|
487
|
+
<p-message severity="error" size="small" variant="simple">City is required.</p-message>
|
|
488
|
+
}
|
|
489
|
+
</div>
|
|
490
|
+
<button pButton severity="secondary" type="submit"><span pButtonLabel>Submit</span></button>
|
|
491
|
+
</form>
|
|
492
|
+
</div>
|
|
493
|
+
`,
|
|
494
|
+
standalone: true,
|
|
495
|
+
imports: [ListboxModule, MessageModule, ToastModule, ButtonModule, FormField]
|
|
496
|
+
})
|
|
497
|
+
export class ListboxSignalformsDemo {
|
|
498
|
+
messageService = inject(MessageService);
|
|
499
|
+
cities: City[];
|
|
500
|
+
model = signal<{ selectedCity: City | null }>({ selectedCity: null });
|
|
501
|
+
exampleForm = form(this.model, (f) => {
|
|
502
|
+
required(f.selectedCity);
|
|
503
|
+
});
|
|
504
|
+
|
|
505
|
+
onSubmit(event: Event) {
|
|
506
|
+
event.preventDefault();
|
|
507
|
+
submit(this.exampleForm, async () => {
|
|
508
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Form is submitted', life: 3000 });
|
|
509
|
+
this.exampleForm().reset({ selectedCity: null });
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
```
|
|
514
|
+
|
|
460
515
|
## Template
|
|
461
516
|
|
|
462
517
|
For custom content support define a template named item where the default local template variable refers to an option.
|
|
@@ -640,8 +695,8 @@ ListBox is used to select one or more values from a list of items.
|
|
|
640
695
|
| selectionMessage | InputSignal<string> | '{0} items selected' | Text to be displayed in hidden accessible field when options are selected. Defaults to global value in i18n translation configuration. |
|
|
641
696
|
| autoOptionFocus | InputSignalWithTransform<boolean, unknown> | ... | Whether to focus on the first visible or selected element when the overlay panel is shown. |
|
|
642
697
|
| ariaLabel | InputSignal<string> | ... | Defines a string that labels the input for accessibility. |
|
|
698
|
+
| ariaLabelledBy | InputSignal<string> | ... | Establishes relationships between the component and label(s) where its value should be one or more element IDs. |
|
|
643
699
|
| selectOnFocus | InputSignalWithTransform<boolean, unknown> | ... | When enabled, the focused option is selected. |
|
|
644
|
-
| searchLocale | InputSignalWithTransform<boolean, unknown> | ... | Locale to use in searching. The default locale is the host environment's current locale. |
|
|
645
700
|
| focusOnHover | InputSignalWithTransform<boolean, unknown> | ... | When enabled, the hovered option will be focused. |
|
|
646
701
|
| filterMessage | InputSignal<string> | ... | Text to display when filtering. |
|
|
647
702
|
| filterFields | InputSignal<any[]> | ... | Fields used when filtering the options, defaults to optionLabel. |
|
|
@@ -669,7 +724,7 @@ ListBox is used to select one or more values from a list of items.
|
|
|
669
724
|
| optionGroupLabel | InputSignal<string> | ... | Name of the label field of an option group. |
|
|
670
725
|
| optionDisabled | InputSignal<string \| ((item: any) => boolean)> | ... | Name of the disabled field of an option or function to determine disabled state. |
|
|
671
726
|
| ariaFilterLabel | InputSignal<string> | ... | Defines a string that labels the filter input. |
|
|
672
|
-
|
|
|
727
|
+
| filterPlaceholder | InputSignal<string> | ... | Defines placeholder of the filter input. |
|
|
673
728
|
| emptyFilterMessage | InputSignal<string> | ... | Text to display when filtering does not return any results. |
|
|
674
729
|
| emptyMessage | InputSignal<string> | ... | Text to display when there is no data. Defaults to global value in i18n translation configuration. |
|
|
675
730
|
| group | InputSignalWithTransform<boolean, unknown> | ... | Whether to display options as grouped when nested options are provided. |
|
|
@@ -302,7 +302,6 @@ Message groups a collection of contents in tabs.
|
|
|
302
302
|
| severity | InputSignal<MessageSeverity> | 'info' | Severity level of the message. |
|
|
303
303
|
| text | InputSignal<string> | ... | Text content. **(Deprecated)** |
|
|
304
304
|
| escape | InputSignalWithTransform<boolean, unknown> | ... | Whether displaying messages would be escaped or not. **(Deprecated)** |
|
|
305
|
-
| style | InputSignal<{ [klass: string]: any }> | ... | Inline style of the component. |
|
|
306
305
|
| closable | InputSignalWithTransform<boolean, unknown> | false | Whether the message can be closed manually using the close icon. |
|
|
307
306
|
| icon | InputSignal<string> | undefined | Icon to display in the message. |
|
|
308
307
|
| closeIcon | InputSignal<string> | undefined | Icon to display in the message close button. |
|
|
@@ -585,6 +585,62 @@ export class MultiselectReactiveformsDemo {
|
|
|
585
585
|
}
|
|
586
586
|
```
|
|
587
587
|
|
|
588
|
+
## Signal Forms
|
|
589
|
+
|
|
590
|
+
MultiSelect can also be used with Angular Signal Forms , the @angular/forms/signals API of Angular 21 and newer. The form model is a signal, form() declares its validators and the [formField] directive binds the component to a field. The field also sets the invalid state of the component, so the component is styled as invalid before any interaction, while the messages below appear once the field is touched or the form is submitted.
|
|
591
|
+
|
|
592
|
+
```typescript
|
|
593
|
+
import { Component, inject, signal } from '@angular/core';
|
|
594
|
+
import { form, FormField, minLength, submit } from '@angular/forms/signals';
|
|
595
|
+
import { MessageModule } from '@exhaustive-ui/core/message';
|
|
596
|
+
import { MultiSelectModule } from '@exhaustive-ui/core/multiselect';
|
|
597
|
+
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
598
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
599
|
+
import { MessageService } from '@exhaustive-ui/core/api';
|
|
600
|
+
|
|
601
|
+
interface City {
|
|
602
|
+
name: string;
|
|
603
|
+
code: string;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
@Component({
|
|
607
|
+
template: `
|
|
608
|
+
<p-toast />
|
|
609
|
+
<div class="card flex justify-center">
|
|
610
|
+
<form novalidate (submit)="onSubmit($event)" class="flex justify-center flex-col gap-4 w-full md:w-80">
|
|
611
|
+
<div class="flex flex-col gap-1">
|
|
612
|
+
<p-multiselect [options]="cities" [formField]="exampleForm.city" optionLabel="name" placeholder="Select Cities" [maxSelectedLabels]="3" [fluid]="true" />
|
|
613
|
+
@let city = exampleForm.city();
|
|
614
|
+
@if (city.invalid() && city.touched()) {
|
|
615
|
+
<p-message severity="error" size="small" variant="simple">City is required.</p-message>
|
|
616
|
+
}
|
|
617
|
+
</div>
|
|
618
|
+
<button pButton severity="secondary" type="submit"><span pButtonLabel>Submit</span></button>
|
|
619
|
+
</form>
|
|
620
|
+
</div>
|
|
621
|
+
`,
|
|
622
|
+
standalone: true,
|
|
623
|
+
imports: [MessageModule, MultiSelectModule, ToastModule, ButtonModule, FormField]
|
|
624
|
+
})
|
|
625
|
+
export class MultiselectSignalformsDemo {
|
|
626
|
+
messageService = inject(MessageService);
|
|
627
|
+
cities: City[];
|
|
628
|
+
model = signal<{ city: City[] }>({ city: [] });
|
|
629
|
+
exampleForm = form(this.model, (f) => {
|
|
630
|
+
// required() accepts an empty array, minLength() asks for one city at least
|
|
631
|
+
minLength(f.city, 1);
|
|
632
|
+
});
|
|
633
|
+
|
|
634
|
+
onSubmit(event: Event) {
|
|
635
|
+
event.preventDefault();
|
|
636
|
+
submit(this.exampleForm, async () => {
|
|
637
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Form Submitted', life: 3000 });
|
|
638
|
+
this.exampleForm().reset({ city: [] });
|
|
639
|
+
});
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
```
|
|
643
|
+
|
|
588
644
|
## Sizes
|
|
589
645
|
|
|
590
646
|
MultiSelect provides small and large sizes as alternatives to the base.
|
|
@@ -829,7 +885,7 @@ MultiSelect is used to select multiple items from a collection.
|
|
|
829
885
|
| readonly | InputSignalWithTransform<boolean, unknown> | ... | When present, it specifies that the component cannot be edited. |
|
|
830
886
|
| group | InputSignalWithTransform<boolean, unknown> | ... | Whether to display options as grouped when nested options are provided. |
|
|
831
887
|
| filter | InputSignalWithTransform<boolean, unknown> | ... | When specified, displays an input field to filter the items on keyup. |
|
|
832
|
-
|
|
|
888
|
+
| filterPlaceholder | InputSignal<string> | ... | Defines placeholder of the filter input. |
|
|
833
889
|
| filterLocale | InputSignal<string> | ... | Locale to use in filtering. The default locale is the host environment's current locale. |
|
|
834
890
|
| overlayVisible | InputSignalWithTransform<boolean, unknown> | ... | Specifies the visibility of the options panel. |
|
|
835
891
|
| tabindex | InputSignalWithTransform<number, unknown> | ... | Index of the element in tabbing order. |
|
|
@@ -895,8 +951,8 @@ MultiSelect is used to select multiple items from a collection.
|
|
|
895
951
|
| onBlur | event: MultiSelectBlurEvent | Callback to invoke when multiselect loses focus. |
|
|
896
952
|
| onClick | event: Event | Callback to invoke when component is clicked. |
|
|
897
953
|
| onClear | value: void | Callback to invoke when input field is cleared. |
|
|
898
|
-
|
|
|
899
|
-
|
|
|
954
|
+
| onShow | event: AnimationEvent | Callback to invoke when overlay panel becomes visible. |
|
|
955
|
+
| onHide | event: AnimationEvent | Callback to invoke when overlay panel becomes hidden. |
|
|
900
956
|
| onLazyLoad | event: MultiSelectLazyLoadEvent | Callback to invoke in lazy mode to load new data. |
|
|
901
957
|
| onRemove | event: MultiSelectRemoveEvent | Callback to invoke in lazy mode to load new data. |
|
|
902
958
|
| onSelectAllChange | event: MultiSelectSelectAllChangeEvent | Callback to invoke when all data is selected. |
|
|
@@ -916,7 +972,6 @@ MultiSelect is used to select multiple items from a collection.
|
|
|
916
972
|
| selecteditems | TemplateRef<MultiSelectSelectedItemsTemplateContext<any>> | Custom selected items template. |
|
|
917
973
|
| loadingicon | TemplateRef<void> | Custom loading icon template. |
|
|
918
974
|
| filtericon | TemplateRef<void> | Custom filter icon template. |
|
|
919
|
-
| removetokenicon | TemplateRef<MultiSelectChipIconTemplateContext> | Custom remove token icon template. |
|
|
920
975
|
| chipicon | TemplateRef<MultiSelectChipIconTemplateContext> | Custom chip icon template. |
|
|
921
976
|
| clearicon | TemplateRef<void> | Custom clear icon template. |
|
|
922
977
|
| dropdownicon | TemplateRef<MultiSelectDropdownIconTemplateContext> | Custom dropdown icon template. |
|
|
@@ -251,7 +251,6 @@ OrderList is used to manage the order of a collection.
|
|
|
251
251
|
| unstyled | InputSignal<boolean> | undefined | Indicates whether the component should be rendered without styles. |
|
|
252
252
|
| pt | InputSignal<OrderListPassThrough> | undefined | Used to pass attributes to DOM elements inside the component. |
|
|
253
253
|
| ptOptions | InputSignal<PassThroughOptions> | undefined | Used to configure passthrough(pt) options of the component. |
|
|
254
|
-
| header | InputSignal<string> | ... | Text for the caption. |
|
|
255
254
|
| tabindex | InputSignalWithTransform<number, unknown> | ... | Index of the element in tabbing order. |
|
|
256
255
|
| ariaLabel | InputSignal<string> | ... | Defines a string that labels the input for accessibility. |
|
|
257
256
|
| ariaLabelledBy | InputSignal<string> | ... | Specifies one or more IDs in the DOM that labels the input field. |
|
|
@@ -268,7 +267,6 @@ OrderList is used to manage the order of a collection.
|
|
|
268
267
|
| breakpoint | InputSignal<string> | ... | Indicates the width of the screen at which the component should change its behavior. |
|
|
269
268
|
| stripedRows | InputSignalWithTransform<boolean, unknown> | ... | Whether to displays rows with alternating colors. |
|
|
270
269
|
| disabled | InputSignalWithTransform<boolean, unknown> | ... | When present, it specifies that the component should be disabled. |
|
|
271
|
-
| trackBy | InputSignal<Function> | ... | Function to optimize the dom operations by delegating to ngForTrackBy, default algorithm checks for object identity. |
|
|
272
270
|
| scrollHeight | InputSignal<string> | ... | Height of the viewport, a scrollbar is defined if height of list exceeds this value. |
|
|
273
271
|
| autoOptionFocus | InputSignalWithTransform<boolean, unknown> | ... | Whether to focus on the first visible or selected element. |
|
|
274
272
|
| focusOnHover | InputSignalWithTransform<boolean, unknown> | ... | When enabled, the hovered option will be focused. |
|
|
@@ -288,7 +286,7 @@ OrderList is used to manage the order of a collection.
|
|
|
288
286
|
|------|------------|-------------|
|
|
289
287
|
| onReorder | value: any | Callback to invoke when list is reordered. |
|
|
290
288
|
| onSelectionChange | event: OrderListSelectionChangeEvent | Callback to invoke when selection changes. |
|
|
291
|
-
|
|
|
289
|
+
| onFilter | event: OrderListFilterEvent | Callback to invoke when filtering occurs. |
|
|
292
290
|
| onFocus | event: Event | Callback to invoke when the list is focused |
|
|
293
291
|
| onBlur | event: Event | Callback to invoke when the list is blurred |
|
|
294
292
|
|