@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.
- package/LICENSE +23 -0
- package/README.md +167 -2
- package/data/components/accordion.md +421 -0
- package/data/components/animateonscroll.md +163 -0
- package/data/components/autocomplete.md +1077 -0
- package/data/components/autofocus.md +38 -0
- package/data/components/avatar.md +417 -0
- package/data/components/badge.md +234 -0
- package/data/components/blockui.md +108 -0
- package/data/components/breadcrumb.md +178 -0
- package/data/components/button.md +774 -0
- package/data/components/card.md +138 -0
- package/data/components/carousel.md +440 -0
- package/data/components/cascadeselect.md +1387 -0
- package/data/components/chart.md +1178 -0
- package/data/components/checkbox.md +529 -0
- package/data/components/chip.md +180 -0
- package/data/components/colorpicker.md +301 -0
- package/data/components/confirmdialog.md +287 -0
- package/data/components/confirmpopup.md +417 -0
- package/data/components/contextmenu.md +491 -0
- package/data/components/dataview.md +600 -0
- package/data/components/datepicker.md +1262 -0
- package/data/components/dialog.md +622 -0
- package/data/components/divider.md +250 -0
- package/data/components/dock.md +500 -0
- package/data/components/dragdrop.md +285 -0
- package/data/components/drawer.md +510 -0
- package/data/components/dynamicdialog.md +109 -0
- package/data/components/editor.md +291 -0
- package/data/components/fieldset.md +182 -0
- package/data/components/fileupload.md +430 -0
- package/data/components/floatlabel.md +155 -0
- package/data/components/fluid.md +72 -0
- package/data/components/focustrap.md +65 -0
- package/data/components/galleria.md +627 -0
- package/data/components/iconfield.md +246 -0
- package/data/components/iftalabel.md +105 -0
- package/data/components/imagecompare.md +97 -0
- package/data/components/inplace.md +233 -0
- package/data/components/inputgroup.md +306 -0
- package/data/components/inputmask.md +518 -0
- package/data/components/inputnumber.md +675 -0
- package/data/components/inputotp.md +336 -0
- package/data/components/inputtext.md +488 -0
- package/data/components/keyfilter.md +85 -0
- package/data/components/knob.md +462 -0
- package/data/components/listbox.md +798 -0
- package/data/components/llms.md +28 -0
- package/data/components/megamenu.md +587 -0
- package/data/components/menu.md +483 -0
- package/data/components/menubar.md +462 -0
- package/data/components/message.md +449 -0
- package/data/components/metergroup.md +241 -0
- package/data/components/multiselect.md +1047 -0
- package/data/components/orderlist.md +342 -0
- package/data/components/organizationchart.md +197 -0
- package/data/components/overlay.md +217 -0
- package/data/components/paginator.md +314 -0
- package/data/components/panel.md +214 -0
- package/data/components/panelmenu.md +699 -0
- package/data/components/password.md +570 -0
- package/data/components/picklist.md +420 -0
- package/data/components/popover.md +378 -0
- package/data/components/progressbar.md +181 -0
- package/data/components/progressspinner.md +91 -0
- package/data/components/radiobutton.md +377 -0
- package/data/components/rating.md +312 -0
- package/data/components/ripple.md +89 -0
- package/data/components/scroller.md +122 -0
- package/data/components/scrollpanel.md +149 -0
- package/data/components/scrolltop.md +105 -0
- package/data/components/select.md +1206 -0
- package/data/components/selectbutton.md +356 -0
- package/data/components/skeleton.md +242 -0
- package/data/components/slider.md +337 -0
- package/data/components/speeddial.md +589 -0
- package/data/components/splitbutton.md +945 -0
- package/data/components/splitter.md +196 -0
- package/data/components/stepper.md +411 -0
- package/data/components/styleclass.md +126 -0
- package/data/components/table.md +4557 -0
- package/data/components/tabs.md +467 -0
- package/data/components/tag.md +200 -0
- package/data/components/terminal.md +118 -0
- package/data/components/textarea.md +416 -0
- package/data/components/tieredmenu.md +578 -0
- package/data/components/timeline.md +310 -0
- package/data/components/toast.md +596 -0
- package/data/components/togglebutton.md +356 -0
- package/data/components/toggleswitch.md +285 -0
- package/data/components/toolbar.md +182 -0
- package/data/components/tooltip.md +211 -0
- package/data/components/tree.md +746 -0
- package/data/components/treeselect.md +912 -0
- package/data/components/treetable.md +2814 -0
- package/data/components.json +43751 -0
- package/data/llms-full.txt +47433 -0
- package/data/llms.txt +121 -0
- package/data/manifest.json +46513 -0
- package/data/pages/accessibility.md +28 -0
- package/data/pages/animations.md +28 -0
- package/data/pages/configuration.md +210 -0
- package/data/pages/contribution.md +20 -0
- package/data/pages/customicons.md +20 -0
- package/data/pages/faq.md +20 -0
- package/data/pages/icons.md +66 -0
- package/data/pages/installation.md +71 -0
- package/data/pages/llms.md +61 -0
- package/data/pages/passthrough.md +32 -0
- package/data/pages/philosophy.md +28 -0
- package/data/pages/primeflex.md +20 -0
- package/data/pages/rtl.md +12 -0
- package/data/pages/styled.md +132 -0
- package/data/pages/tailwind.md +40 -0
- package/data/pages/unstyled.md +39 -0
- package/data/snapshot.json +9 -0
- package/dist/index.d.mts +448 -0
- package/dist/index.mjs +2501 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +67 -3
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
# Angular Otp Input Component
|
|
2
|
+
|
|
3
|
+
Input Otp is used to enter one time passwords.
|
|
4
|
+
|
|
5
|
+
## Accessibility
|
|
6
|
+
|
|
7
|
+
Screen Reader Input OTP uses a set of InputText components, refer to the InputText component for more information about the screen reader support.
|
|
8
|
+
|
|
9
|
+
## Basic
|
|
10
|
+
|
|
11
|
+
Two-way value binding is defined using ngModel . The number of characters is defined with the length property, which is set to 4 by default.
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { Component } from '@angular/core';
|
|
15
|
+
import { FormsModule } from '@angular/forms';
|
|
16
|
+
import { InputOtpModule } from '@exhaustive-ui/core/inputotp';
|
|
17
|
+
|
|
18
|
+
@Component({
|
|
19
|
+
template: `
|
|
20
|
+
<div class="card flex justify-center">
|
|
21
|
+
<p-inputotp [(ngModel)]="value" />
|
|
22
|
+
</div>
|
|
23
|
+
`,
|
|
24
|
+
standalone: true,
|
|
25
|
+
imports: [InputOtpModule, FormsModule]
|
|
26
|
+
})
|
|
27
|
+
export class InputotpBasicDemo {
|
|
28
|
+
value: any;
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Integer Only
|
|
33
|
+
|
|
34
|
+
When integerOnly is present, only integers can be accepted as input.
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
import { Component } from '@angular/core';
|
|
38
|
+
import { FormsModule } from '@angular/forms';
|
|
39
|
+
import { InputOtpModule } from '@exhaustive-ui/core/inputotp';
|
|
40
|
+
|
|
41
|
+
@Component({
|
|
42
|
+
template: `
|
|
43
|
+
<div class="card flex justify-center">
|
|
44
|
+
<p-inputotp [(ngModel)]="value" [integerOnly]="true" />
|
|
45
|
+
</div>
|
|
46
|
+
`,
|
|
47
|
+
standalone: true,
|
|
48
|
+
imports: [InputOtpModule, FormsModule]
|
|
49
|
+
})
|
|
50
|
+
export class InputotpIntegeronlyDemo {
|
|
51
|
+
value: any;
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Mask
|
|
56
|
+
|
|
57
|
+
Enable the mask option to hide the values in the input fields.
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
import { Component } from '@angular/core';
|
|
61
|
+
import { FormsModule } from '@angular/forms';
|
|
62
|
+
import { InputOtpModule } from '@exhaustive-ui/core/inputotp';
|
|
63
|
+
|
|
64
|
+
@Component({
|
|
65
|
+
template: `
|
|
66
|
+
<div class="card flex justify-center">
|
|
67
|
+
<p-inputotp [(ngModel)]="value" [mask]="true" />
|
|
68
|
+
</div>
|
|
69
|
+
`,
|
|
70
|
+
standalone: true,
|
|
71
|
+
imports: [InputOtpModule, FormsModule]
|
|
72
|
+
})
|
|
73
|
+
export class InputotpMaskDemo {
|
|
74
|
+
value: any;
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## reactiveforms-doc
|
|
79
|
+
|
|
80
|
+
InputOtp can also be used with reactive forms. In this case, the formControlName property is used to bind the component to a form control.
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
import { Component, inject } from '@angular/core';
|
|
84
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
85
|
+
import { InputOtpModule } from '@exhaustive-ui/core/inputotp';
|
|
86
|
+
import { MessageModule } from '@exhaustive-ui/core/message';
|
|
87
|
+
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
88
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
89
|
+
import { MessageService } from '@exhaustive-ui/core/api';
|
|
90
|
+
|
|
91
|
+
@Component({
|
|
92
|
+
template: `
|
|
93
|
+
<p-toast />
|
|
94
|
+
<div class="card flex justify-center">
|
|
95
|
+
<form [formGroup]="exampleForm" (ngSubmit)="onSubmit()" class="flex flex-col gap-4">
|
|
96
|
+
<div class="flex flex-col gap-1">
|
|
97
|
+
<p-inputotp formControlName="value" [invalid]="isInvalid('value')" />
|
|
98
|
+
@if (isInvalid('value')) {
|
|
99
|
+
<p-message severity="error" size="small" variant="simple">Passcode is required.</p-message>
|
|
100
|
+
}
|
|
101
|
+
</div>
|
|
102
|
+
<button pButton severity="secondary" type="submit"><span pButtonLabel>Submit</span></button>
|
|
103
|
+
</form>
|
|
104
|
+
</div>
|
|
105
|
+
`,
|
|
106
|
+
standalone: true,
|
|
107
|
+
imports: [InputOtpModule, MessageModule, ToastModule, ButtonModule, ReactiveFormsModule]
|
|
108
|
+
})
|
|
109
|
+
export class InputotpReactiveformsDemo {
|
|
110
|
+
messageService = inject(MessageService);
|
|
111
|
+
exampleForm: FormGroup | undefined;
|
|
112
|
+
formSubmitted: boolean = false;
|
|
113
|
+
|
|
114
|
+
constructor() {
|
|
115
|
+
this.exampleForm = this.fb.group({
|
|
116
|
+
value: ['', [Validators.required, Validators.minLength(4)]]
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
onSubmit() {
|
|
121
|
+
this.formSubmitted = true;
|
|
122
|
+
if (this.exampleForm.valid) {
|
|
123
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Form is submitted', life: 3000 });
|
|
124
|
+
this.exampleForm.reset();
|
|
125
|
+
this.formSubmitted = false;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
isInvalid(controlName: string) {
|
|
130
|
+
const control = this.exampleForm.get(controlName);
|
|
131
|
+
return control?.invalid && (control.touched || this.formSubmitted);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Sample
|
|
137
|
+
|
|
138
|
+
A sample UI implementation with templating and additional elements.
|
|
139
|
+
|
|
140
|
+
```typescript
|
|
141
|
+
import { Component } from '@angular/core';
|
|
142
|
+
import { FormsModule } from '@angular/forms';
|
|
143
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
144
|
+
import { InputOtpModule } from '@exhaustive-ui/core/inputotp';
|
|
145
|
+
|
|
146
|
+
@Component({
|
|
147
|
+
template: `
|
|
148
|
+
<div class="card flex justify-center">
|
|
149
|
+
<div class="flex flex-col items-center">
|
|
150
|
+
<div class="font-bold text-xl mb-2">Authenticate Your Account</div>
|
|
151
|
+
<p class="text-muted-color block mb-8">Please enter the code sent to your phone.</p>
|
|
152
|
+
<p-inputotp [(ngModel)]="value" [length]="6">
|
|
153
|
+
<ng-template #input let-token let-events="events" let-index="index">
|
|
154
|
+
<input type="text" [maxLength]="1" (input)="events.input($event)" (keydown)="events.keydown($event)" [attr.value]="token" class="custom-otp-input" />
|
|
155
|
+
<div *ngIf="index === 3" class="px-4">
|
|
156
|
+
<i class="pi pi-minus"></i>
|
|
157
|
+
</div>
|
|
158
|
+
</ng-template>
|
|
159
|
+
</p-inputotp>
|
|
160
|
+
<div class="flex justify-between mt-8 self-stretch">
|
|
161
|
+
<p-button label="Resend Code" [link]="true" class="p-0" />
|
|
162
|
+
<p-button label="Submit Code" />
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
`,
|
|
167
|
+
standalone: true,
|
|
168
|
+
imports: [ButtonModule, InputOtpModule, FormsModule]
|
|
169
|
+
})
|
|
170
|
+
export class InputotpSampleDemo {
|
|
171
|
+
value: any;
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Sizes
|
|
176
|
+
|
|
177
|
+
InputOtp provides small and large sizes as alternatives to the base.
|
|
178
|
+
|
|
179
|
+
```typescript
|
|
180
|
+
import { Component } from '@angular/core';
|
|
181
|
+
import { FormsModule } from '@angular/forms';
|
|
182
|
+
import { InputOtpModule } from '@exhaustive-ui/core/inputotp';
|
|
183
|
+
|
|
184
|
+
@Component({
|
|
185
|
+
template: `
|
|
186
|
+
<div class="card flex flex-col items-center gap-4">
|
|
187
|
+
<p-inputotp [(ngModel)]="value1" size="small" />
|
|
188
|
+
<p-inputotp [(ngModel)]="value2" />
|
|
189
|
+
<p-inputotp [(ngModel)]="value3" size="large" />
|
|
190
|
+
</div>
|
|
191
|
+
`,
|
|
192
|
+
standalone: true,
|
|
193
|
+
imports: [InputOtpModule, FormsModule]
|
|
194
|
+
})
|
|
195
|
+
export class InputotpSizesDemo {
|
|
196
|
+
value1: any;
|
|
197
|
+
value2: any;
|
|
198
|
+
value3: any;
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Template
|
|
203
|
+
|
|
204
|
+
Define a template with your own UI elements with bindings to the provided events and attributes to replace the default design.
|
|
205
|
+
|
|
206
|
+
```typescript
|
|
207
|
+
import { Component } from '@angular/core';
|
|
208
|
+
import { FormsModule } from '@angular/forms';
|
|
209
|
+
import { InputOtpModule } from '@exhaustive-ui/core/inputotp';
|
|
210
|
+
|
|
211
|
+
@Component({
|
|
212
|
+
template: `
|
|
213
|
+
<div class="card flex justify-center">
|
|
214
|
+
<p-inputotp [(ngModel)]="value">
|
|
215
|
+
<ng-template #input let-token let-events="events">
|
|
216
|
+
<input class="custom-otp-input" (keydown)="events.keydown($event)" (input)="events.input($event)" type="text" [attr.value]="token" [maxLength]="1" />
|
|
217
|
+
</ng-template>
|
|
218
|
+
</p-inputotp>
|
|
219
|
+
</div>
|
|
220
|
+
`,
|
|
221
|
+
standalone: true,
|
|
222
|
+
imports: [InputOtpModule, FormsModule]
|
|
223
|
+
})
|
|
224
|
+
export class InputotpTemplateDemo {
|
|
225
|
+
value: any;
|
|
226
|
+
}
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## templatedrivenforms-doc
|
|
230
|
+
|
|
231
|
+
```typescript
|
|
232
|
+
import { Component, inject } from '@angular/core';
|
|
233
|
+
import { FormsModule } from '@angular/forms';
|
|
234
|
+
import { InputOtpModule } from '@exhaustive-ui/core/inputotp';
|
|
235
|
+
import { MessageModule } from '@exhaustive-ui/core/message';
|
|
236
|
+
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
237
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
238
|
+
import { MessageService } from '@exhaustive-ui/core/api';
|
|
239
|
+
|
|
240
|
+
@Component({
|
|
241
|
+
template: `
|
|
242
|
+
<p-toast />
|
|
243
|
+
<div class="card flex justify-center">
|
|
244
|
+
<form #exampleForm="ngForm" (ngSubmit)="onSubmit(exampleForm)" class="flex flex-col gap-4">
|
|
245
|
+
<div class="flex flex-col gap-1">
|
|
246
|
+
<p-inputotp #otpModel="ngModel" [(ngModel)]="value" [invalid]="otpModel.invalid && (otpModel.touched || exampleForm.submitted)" name="value" required [minlength]="4" />
|
|
247
|
+
@if (otpModel.invalid && (otpModel.touched || exampleForm.submitted)) {
|
|
248
|
+
<p-message severity="error" size="small" variant="simple">Passcode is required.</p-message>
|
|
249
|
+
}
|
|
250
|
+
</div>
|
|
251
|
+
<button pButton severity="secondary" type="submit"><span pButtonLabel>Submit</span></button>
|
|
252
|
+
</form>
|
|
253
|
+
</div>
|
|
254
|
+
`,
|
|
255
|
+
standalone: true,
|
|
256
|
+
imports: [InputOtpModule, MessageModule, ToastModule, ButtonModule, FormsModule]
|
|
257
|
+
})
|
|
258
|
+
export class InputotpTemplatedrivenformsDemo {
|
|
259
|
+
messageService = inject(MessageService);
|
|
260
|
+
value: any;
|
|
261
|
+
|
|
262
|
+
onSubmit(form: any) {
|
|
263
|
+
if (form.valid) {
|
|
264
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Form Submitted', life: 3000 });
|
|
265
|
+
form.resetForm();
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
## Input Otp
|
|
272
|
+
|
|
273
|
+
Input Otp is used to enter one time passwords.
|
|
274
|
+
|
|
275
|
+
### Props
|
|
276
|
+
|
|
277
|
+
| Name | Type | Default | Description |
|
|
278
|
+
|------|------|---------|-------------|
|
|
279
|
+
| dt | InputSignal<Object> | undefined | Defines scoped design tokens of the component. |
|
|
280
|
+
| unstyled | InputSignal<boolean> | undefined | Indicates whether the component should be rendered without styles. |
|
|
281
|
+
| pt | InputSignal<InputOtpPassThrough> | undefined | Used to pass attributes to DOM elements inside the component. |
|
|
282
|
+
| ptOptions | InputSignal<PassThroughOptions> | undefined | Used to configure passthrough(pt) options of the component. |
|
|
283
|
+
| required | InputSignalWithTransform<boolean, unknown> | false | There must be a value (if set). |
|
|
284
|
+
| invalid | InputSignalWithTransform<boolean, unknown> | false | When present, it specifies that the component should have invalid state style. |
|
|
285
|
+
| disabled | InputSignalWithTransform<boolean, unknown> | false | When present, it specifies that the component should have disabled state style. |
|
|
286
|
+
| name | InputSignal<string> | undefined | When present, it specifies that the name of the input. |
|
|
287
|
+
| readonly | InputSignalWithTransform<boolean, unknown> | ... | When present, it specifies that an input field is read-only. |
|
|
288
|
+
| tabindex | InputSignal<number> | ... | Index of the element in tabbing order. |
|
|
289
|
+
| length | InputSignal<number> | ... | Number of characters to initiate. |
|
|
290
|
+
| styleClass | InputSignal<string> | ... | Style class of the input element. |
|
|
291
|
+
| mask | InputSignal<boolean> | ... | Mask pattern. |
|
|
292
|
+
| integerOnly | InputSignal<boolean> | ... | When present, it specifies that an input field is integer-only. |
|
|
293
|
+
| autofocus | InputSignalWithTransform<boolean, unknown> | ... | When present, it specifies that the component should automatically get focus on load. |
|
|
294
|
+
| variant | InputSignal<"outlined" \| "filled"> | undefined | Specifies the input variant of the component. |
|
|
295
|
+
| size | InputSignal<"small" \| "large"> | undefined | Specifies the size of the component. |
|
|
296
|
+
|
|
297
|
+
### Emits
|
|
298
|
+
|
|
299
|
+
| Name | Parameters | Description |
|
|
300
|
+
|------|------------|-------------|
|
|
301
|
+
| onChange | event: InputOtpChangeEvent | Callback to invoke on value change. |
|
|
302
|
+
| onFocus | event: Event | Callback to invoke when the component receives focus. |
|
|
303
|
+
| onBlur | event: Event | Callback to invoke when the component loses focus. |
|
|
304
|
+
|
|
305
|
+
### Templates
|
|
306
|
+
|
|
307
|
+
| Name | Type | Description |
|
|
308
|
+
|------|------|-------------|
|
|
309
|
+
| input | TemplateRef<InputOtpInputTemplateContext> | Custom input template. |
|
|
310
|
+
|
|
311
|
+
## Pass Through Options
|
|
312
|
+
|
|
313
|
+
| Name | Type | Description |
|
|
314
|
+
|------|------|-------------|
|
|
315
|
+
| host | PassThroughOption<HTMLElement, I> | Used to pass attributes to the host's DOM element. |
|
|
316
|
+
| root | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the root's DOM element. |
|
|
317
|
+
| pcInputText | InputTextPassThrough | Used to pass attributes to the InputText component. |
|
|
318
|
+
|
|
319
|
+
## Theming
|
|
320
|
+
|
|
321
|
+
### CSS Classes
|
|
322
|
+
|
|
323
|
+
| Class | Description |
|
|
324
|
+
|-------|-------------|
|
|
325
|
+
| p-inputotp | Class name of the root element |
|
|
326
|
+
| p-inputotp-input | Class name of the input element |
|
|
327
|
+
|
|
328
|
+
### Design Tokens
|
|
329
|
+
|
|
330
|
+
| Token | CSS Variable | Description |
|
|
331
|
+
|-------|--------------|-------------|
|
|
332
|
+
| inputotp.gap | --p-inputotp-gap | Gap of root |
|
|
333
|
+
| inputotp.input.width | --p-inputotp-input-width | Width of input |
|
|
334
|
+
| inputotp.input.sm.width | --p-inputotp-input-sm-width | Width of input in small screens |
|
|
335
|
+
| inputotp.input.lg.width | --p-inputotp-input-lg-width | Width of input in large screens |
|
|
336
|
+
|