@exhaustive-ui/mcp 0.0.0-stage → 22.0.0-alpha.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/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,570 @@
|
|
|
1
|
+
# Angular Password Component
|
|
2
|
+
|
|
3
|
+
Password displays strength indicator for password fields.
|
|
4
|
+
|
|
5
|
+
## Accessibility
|
|
6
|
+
|
|
7
|
+
Screen Reader Value to describe the component can either be provided via label tag combined with id prop or using ariaLabelledBy , ariaLabel props. Screen reader is notified about the changes to the strength of the password using a section that has aria-live while typing.
|
|
8
|
+
|
|
9
|
+
## Basic
|
|
10
|
+
|
|
11
|
+
Two-way value binding is defined using ngModel .
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { Component } from '@angular/core';
|
|
15
|
+
import { FormsModule } from '@angular/forms';
|
|
16
|
+
import { PasswordModule } from '@exhaustive-ui/core/password';
|
|
17
|
+
|
|
18
|
+
@Component({
|
|
19
|
+
template: `
|
|
20
|
+
<div class="card flex justify-center">
|
|
21
|
+
<p-password [(ngModel)]="value" [feedback]="false" autocomplete="off" />
|
|
22
|
+
</div>
|
|
23
|
+
`,
|
|
24
|
+
standalone: true,
|
|
25
|
+
imports: [PasswordModule, FormsModule]
|
|
26
|
+
})
|
|
27
|
+
export class PasswordBasicDemo {
|
|
28
|
+
value!: string;
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Clear Icon
|
|
33
|
+
|
|
34
|
+
When showClear is enabled, a clear icon is displayed to clear the value.
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
import { Component } from '@angular/core';
|
|
38
|
+
import { FormsModule } from '@angular/forms';
|
|
39
|
+
import { PasswordModule } from '@exhaustive-ui/core/password';
|
|
40
|
+
|
|
41
|
+
@Component({
|
|
42
|
+
template: `
|
|
43
|
+
<div class="card flex justify-center">
|
|
44
|
+
<p-password [(ngModel)]="value" [feedback]="false" autocomplete="off" [showClear]="true" inputStyleClass="w-56" />
|
|
45
|
+
</div>
|
|
46
|
+
`,
|
|
47
|
+
standalone: true,
|
|
48
|
+
imports: [PasswordModule, FormsModule]
|
|
49
|
+
})
|
|
50
|
+
export class PasswordCleariconDemo {
|
|
51
|
+
value!: string;
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Disabled
|
|
56
|
+
|
|
57
|
+
When disabled is present, the element cannot be edited and focused.
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
import { Component } from '@angular/core';
|
|
61
|
+
import { FormsModule } from '@angular/forms';
|
|
62
|
+
import { PasswordModule } from '@exhaustive-ui/core/password';
|
|
63
|
+
|
|
64
|
+
@Component({
|
|
65
|
+
template: `
|
|
66
|
+
<div class="card flex justify-center">
|
|
67
|
+
<p-password [(ngModel)]="value" [disabled]="true" placeholder="Disabled" autocomplete="off" />
|
|
68
|
+
</div>
|
|
69
|
+
`,
|
|
70
|
+
standalone: true,
|
|
71
|
+
imports: [PasswordModule, FormsModule]
|
|
72
|
+
})
|
|
73
|
+
export class PasswordDisabledDemo {
|
|
74
|
+
value!: string;
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Filled
|
|
79
|
+
|
|
80
|
+
Specify the variant property as filled to display the component with a higher visual emphasis than the default outlined style.
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
import { Component } from '@angular/core';
|
|
84
|
+
import { FormsModule } from '@angular/forms';
|
|
85
|
+
import { PasswordModule } from '@exhaustive-ui/core/password';
|
|
86
|
+
|
|
87
|
+
@Component({
|
|
88
|
+
template: `
|
|
89
|
+
<div class="card flex justify-center">
|
|
90
|
+
<p-password [(ngModel)]="value" [feedback]="false" variant="filled" autocomplete="off" />
|
|
91
|
+
</div>
|
|
92
|
+
`,
|
|
93
|
+
standalone: true,
|
|
94
|
+
imports: [PasswordModule, FormsModule]
|
|
95
|
+
})
|
|
96
|
+
export class PasswordFilledDemo {
|
|
97
|
+
value!: string;
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Float Label
|
|
102
|
+
|
|
103
|
+
A floating label appears on top of the input field when focused. Visit FloatLabel documentation for more information.
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
import { Component } from '@angular/core';
|
|
107
|
+
import { FormsModule } from '@angular/forms';
|
|
108
|
+
import { FloatLabelModule } from '@exhaustive-ui/core/floatlabel';
|
|
109
|
+
import { PasswordModule } from '@exhaustive-ui/core/password';
|
|
110
|
+
|
|
111
|
+
@Component({
|
|
112
|
+
template: `
|
|
113
|
+
<div class="card flex flex-wrap justify-center items-end gap-4">
|
|
114
|
+
<p-floatlabel>
|
|
115
|
+
<p-password [(ngModel)]="value1" inputId="over_label" autocomplete="off" />
|
|
116
|
+
<label for="over_label">Over Label</label>
|
|
117
|
+
</p-floatlabel>
|
|
118
|
+
<p-floatlabel variant="in">
|
|
119
|
+
<p-password [(ngModel)]="value2" inputId="in_label" autocomplete="off" />
|
|
120
|
+
<label for="in_label">In Label</label>
|
|
121
|
+
</p-floatlabel>
|
|
122
|
+
<p-floatlabel variant="on">
|
|
123
|
+
<p-password [(ngModel)]="value3" inputId="on_label" autocomplete="off" />
|
|
124
|
+
<label for="on_label">On Label</label>
|
|
125
|
+
</p-floatlabel>
|
|
126
|
+
</div>
|
|
127
|
+
`,
|
|
128
|
+
standalone: true,
|
|
129
|
+
imports: [FloatLabelModule, PasswordModule, FormsModule]
|
|
130
|
+
})
|
|
131
|
+
export class PasswordFloatlabelDemo {
|
|
132
|
+
value1!: string;
|
|
133
|
+
value2!: string;
|
|
134
|
+
value3!: string;
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Fluid
|
|
139
|
+
|
|
140
|
+
The fluid prop makes the component take up the full width of its container when set to true.
|
|
141
|
+
|
|
142
|
+
```typescript
|
|
143
|
+
import { Component } from '@angular/core';
|
|
144
|
+
import { FormsModule } from '@angular/forms';
|
|
145
|
+
import { PasswordModule } from '@exhaustive-ui/core/password';
|
|
146
|
+
|
|
147
|
+
@Component({
|
|
148
|
+
template: `
|
|
149
|
+
<div class="card">
|
|
150
|
+
<p-password [(ngModel)]="value" [feedback]="false" autocomplete="off" fluid />
|
|
151
|
+
</div>
|
|
152
|
+
`,
|
|
153
|
+
standalone: true,
|
|
154
|
+
imports: [PasswordModule, FormsModule]
|
|
155
|
+
})
|
|
156
|
+
export class PasswordFluidDemo {
|
|
157
|
+
value!: string;
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Ifta Label
|
|
162
|
+
|
|
163
|
+
IftaLabel is used to create infield top aligned labels. Visit IftaLabel documentation for more information.
|
|
164
|
+
|
|
165
|
+
```typescript
|
|
166
|
+
import { Component } from '@angular/core';
|
|
167
|
+
import { FormsModule } from '@angular/forms';
|
|
168
|
+
import { IftaLabelModule } from '@exhaustive-ui/core/iftalabel';
|
|
169
|
+
import { PasswordModule } from '@exhaustive-ui/core/password';
|
|
170
|
+
|
|
171
|
+
@Component({
|
|
172
|
+
template: `
|
|
173
|
+
<div class="card flex justify-center">
|
|
174
|
+
<p-iftalabel>
|
|
175
|
+
<p-password [(ngModel)]="value" inputId="password" autocomplete="off" />
|
|
176
|
+
<label for="password">Password</label>
|
|
177
|
+
</p-iftalabel>
|
|
178
|
+
</div>
|
|
179
|
+
`,
|
|
180
|
+
standalone: true,
|
|
181
|
+
imports: [IftaLabelModule, PasswordModule, FormsModule]
|
|
182
|
+
})
|
|
183
|
+
export class PasswordIftalabelDemo {
|
|
184
|
+
value!: string;
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Invalid
|
|
189
|
+
|
|
190
|
+
The invalid state is applied using the invalid property to indicate failed validation, which can be integrated with Angular Forms.
|
|
191
|
+
|
|
192
|
+
```typescript
|
|
193
|
+
import { Component } from '@angular/core';
|
|
194
|
+
import { FormsModule } from '@angular/forms';
|
|
195
|
+
import { PasswordModule } from '@exhaustive-ui/core/password';
|
|
196
|
+
|
|
197
|
+
@Component({
|
|
198
|
+
template: `
|
|
199
|
+
<div class="card flex flex-wrap justify-center gap-4">
|
|
200
|
+
<p-password [(ngModel)]="value1" [invalid]="!value1" placeholder="Password" />
|
|
201
|
+
<p-password [(ngModel)]="value2" [invalid]="!value2" variant="filled" placeholder="Password" />
|
|
202
|
+
</div>
|
|
203
|
+
`,
|
|
204
|
+
standalone: true,
|
|
205
|
+
imports: [PasswordModule, FormsModule]
|
|
206
|
+
})
|
|
207
|
+
export class PasswordInvalidDemo {
|
|
208
|
+
value1!: string;
|
|
209
|
+
value2!: string;
|
|
210
|
+
}
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## Locale
|
|
214
|
+
|
|
215
|
+
Labels are translated at component level by promptLabel , weakLabel , mediumLabel and strongLabel properties. In order to apply global translations for all Password components in the application, refer to the locale
|
|
216
|
+
|
|
217
|
+
```typescript
|
|
218
|
+
import { Component } from '@angular/core';
|
|
219
|
+
import { FormsModule } from '@angular/forms';
|
|
220
|
+
import { PasswordModule } from '@exhaustive-ui/core/password';
|
|
221
|
+
|
|
222
|
+
@Component({
|
|
223
|
+
template: `
|
|
224
|
+
<div class="card flex justify-center">
|
|
225
|
+
<p-password [(ngModel)]="value" promptLabel="Choose a password" weakLabel="Too simple" mediumLabel="Average complexity" strongLabel="Complex password" autocomplete="off" />
|
|
226
|
+
</div>
|
|
227
|
+
`,
|
|
228
|
+
standalone: true,
|
|
229
|
+
imports: [PasswordModule, FormsModule]
|
|
230
|
+
})
|
|
231
|
+
export class PasswordLocaleDemo {
|
|
232
|
+
value!: string;
|
|
233
|
+
}
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
## Meter
|
|
237
|
+
|
|
238
|
+
Strength meter is displayed as a popup while a value is being entered.
|
|
239
|
+
|
|
240
|
+
```typescript
|
|
241
|
+
import { Component } from '@angular/core';
|
|
242
|
+
import { FormsModule } from '@angular/forms';
|
|
243
|
+
import { PasswordModule } from '@exhaustive-ui/core/password';
|
|
244
|
+
|
|
245
|
+
@Component({
|
|
246
|
+
template: `
|
|
247
|
+
<div class="card flex justify-center">
|
|
248
|
+
<p-password [(ngModel)]="value" autocomplete="off" />
|
|
249
|
+
</div>
|
|
250
|
+
`,
|
|
251
|
+
standalone: true,
|
|
252
|
+
imports: [PasswordModule, FormsModule]
|
|
253
|
+
})
|
|
254
|
+
export class PasswordMeterDemo {
|
|
255
|
+
value!: string;
|
|
256
|
+
}
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
## reactiveforms-doc
|
|
260
|
+
|
|
261
|
+
Password can also be used with reactive forms. In this case, the formControlName property is used to bind the component to a form control.
|
|
262
|
+
|
|
263
|
+
```typescript
|
|
264
|
+
import { Component, inject } from '@angular/core';
|
|
265
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
266
|
+
import { MessageModule } from '@exhaustive-ui/core/message';
|
|
267
|
+
import { PasswordModule } from '@exhaustive-ui/core/password';
|
|
268
|
+
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
269
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
270
|
+
import { MessageService } from '@exhaustive-ui/core/api';
|
|
271
|
+
|
|
272
|
+
@Component({
|
|
273
|
+
template: `
|
|
274
|
+
<p-toast />
|
|
275
|
+
<div class="card flex justify-center">
|
|
276
|
+
<form [formGroup]="exampleForm" (ngSubmit)="onSubmit()" class="flex flex-col gap-4 sm:w-56">
|
|
277
|
+
<div class="flex flex-col gap-1">
|
|
278
|
+
<p-password formControlName="value" [invalid]="isInvalid('value')" [feedback]="false" autocomplete="off" fluid />
|
|
279
|
+
@if (isInvalid('value')) {
|
|
280
|
+
<p-message severity="error" size="small" variant="simple">Password is required.</p-message>
|
|
281
|
+
}
|
|
282
|
+
</div>
|
|
283
|
+
<button pButton severity="secondary" type="submit"><span pButtonLabel>Submit</span></button>
|
|
284
|
+
</form>
|
|
285
|
+
</div>
|
|
286
|
+
`,
|
|
287
|
+
standalone: true,
|
|
288
|
+
imports: [MessageModule, PasswordModule, ToastModule, ButtonModule, ReactiveFormsModule],
|
|
289
|
+
providers: [MessageService]
|
|
290
|
+
})
|
|
291
|
+
export class PasswordReactiveformsDemo {
|
|
292
|
+
private messageService = inject(MessageService);
|
|
293
|
+
messageService = inject(MessageService);
|
|
294
|
+
exampleForm: FormGroup | undefined;
|
|
295
|
+
formSubmitted: boolean = false;
|
|
296
|
+
|
|
297
|
+
constructor() {
|
|
298
|
+
this.exampleForm = this.fb.group({
|
|
299
|
+
value: ['', Validators.required]
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
onSubmit() {
|
|
304
|
+
this.formSubmitted = true;
|
|
305
|
+
if (this.exampleForm.valid) {
|
|
306
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Form is submitted', life: 3000 });
|
|
307
|
+
this.exampleForm.reset();
|
|
308
|
+
this.formSubmitted = false;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
isInvalid(controlName: string) {
|
|
313
|
+
const control = this.exampleForm.get(controlName);
|
|
314
|
+
return control?.invalid && (control.touched || this.formSubmitted);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
## Sizes
|
|
320
|
+
|
|
321
|
+
Password provides small and large sizes as alternatives to the base.
|
|
322
|
+
|
|
323
|
+
```typescript
|
|
324
|
+
import { Component } from '@angular/core';
|
|
325
|
+
import { FormsModule } from '@angular/forms';
|
|
326
|
+
import { PasswordModule } from '@exhaustive-ui/core/password';
|
|
327
|
+
|
|
328
|
+
@Component({
|
|
329
|
+
template: `
|
|
330
|
+
<div class="card flex flex-col items-center gap-4">
|
|
331
|
+
<p-password [(ngModel)]="value1" type="text" size="small" placeholder="Small" />
|
|
332
|
+
<p-password [(ngModel)]="value2" type="text" placeholder="Normal" />
|
|
333
|
+
<p-password [(ngModel)]="value3" type="text" size="large" placeholder="Large" />
|
|
334
|
+
</div>
|
|
335
|
+
`,
|
|
336
|
+
standalone: true,
|
|
337
|
+
imports: [PasswordModule, FormsModule]
|
|
338
|
+
})
|
|
339
|
+
export class PasswordSizesDemo {
|
|
340
|
+
value1: string;
|
|
341
|
+
value2: string;
|
|
342
|
+
value3: string;
|
|
343
|
+
}
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
## Template
|
|
347
|
+
|
|
348
|
+
3 templates are included to customize the overlay. These are header , content and footer . Note that content overrides the default meter.
|
|
349
|
+
|
|
350
|
+
```typescript
|
|
351
|
+
import { Component } from '@angular/core';
|
|
352
|
+
import { FormsModule } from '@angular/forms';
|
|
353
|
+
import { DividerModule } from '@exhaustive-ui/core/divider';
|
|
354
|
+
import { PasswordModule } from '@exhaustive-ui/core/password';
|
|
355
|
+
|
|
356
|
+
@Component({
|
|
357
|
+
template: `
|
|
358
|
+
<div class="card flex justify-center">
|
|
359
|
+
<p-password [(ngModel)]="value" autocomplete="off">
|
|
360
|
+
<ng-template #header>
|
|
361
|
+
<div class="font-semibold text-xm mb-4">Reset Password</div>
|
|
362
|
+
</ng-template>
|
|
363
|
+
<ng-template #footer>
|
|
364
|
+
<p-divider />
|
|
365
|
+
<ul class="pl-2 my-0 leading-normal text-sm">
|
|
366
|
+
<li>At least one lowercase</li>
|
|
367
|
+
<li>At least one uppercase</li>
|
|
368
|
+
<li>At least one numeric</li>
|
|
369
|
+
<li>Minimum 8 characters</li>
|
|
370
|
+
</ul>
|
|
371
|
+
</ng-template>
|
|
372
|
+
</p-password>
|
|
373
|
+
</div>
|
|
374
|
+
`,
|
|
375
|
+
standalone: true,
|
|
376
|
+
imports: [DividerModule, PasswordModule, FormsModule]
|
|
377
|
+
})
|
|
378
|
+
export class PasswordTemplateDemo {
|
|
379
|
+
value!: string;
|
|
380
|
+
}
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
## templatedrivenforms-doc
|
|
384
|
+
|
|
385
|
+
```typescript
|
|
386
|
+
import { Component, inject } from '@angular/core';
|
|
387
|
+
import { FormsModule } from '@angular/forms';
|
|
388
|
+
import { MessageModule } from '@exhaustive-ui/core/message';
|
|
389
|
+
import { PasswordModule } from '@exhaustive-ui/core/password';
|
|
390
|
+
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
391
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
392
|
+
import { MessageService } from '@exhaustive-ui/core/api';
|
|
393
|
+
|
|
394
|
+
@Component({
|
|
395
|
+
template: `
|
|
396
|
+
<p-toast />
|
|
397
|
+
<div class="card flex justify-center">
|
|
398
|
+
<form #exampleForm="ngForm" (ngSubmit)="onSubmit(exampleForm)" class="flex justify-center flex-col gap-4 md:w-56">
|
|
399
|
+
<div class="flex flex-col gap-1">
|
|
400
|
+
<p-password #model="ngModel" [(ngModel)]="value" [invalid]="model.invalid && (model.touched || exampleForm.submitted)" name="password" [feedback]="false" autocomplete="off" required fluid />
|
|
401
|
+
@if (model.invalid && (model.touched || exampleForm.submitted)) {
|
|
402
|
+
<p-message severity="error" size="small" variant="simple">Password is required.</p-message>
|
|
403
|
+
}
|
|
404
|
+
</div>
|
|
405
|
+
<button pButton severity="secondary" type="submit"><span pButtonLabel>Submit</span></button>
|
|
406
|
+
</form>
|
|
407
|
+
</div>
|
|
408
|
+
`,
|
|
409
|
+
standalone: true,
|
|
410
|
+
imports: [MessageModule, PasswordModule, ToastModule, ButtonModule, FormsModule],
|
|
411
|
+
providers: [MessageService]
|
|
412
|
+
})
|
|
413
|
+
export class PasswordTemplatedrivenformsDemo {
|
|
414
|
+
private messageService = inject(MessageService);
|
|
415
|
+
messageService = inject(MessageService);
|
|
416
|
+
value: any;
|
|
417
|
+
|
|
418
|
+
onSubmit(form: any) {
|
|
419
|
+
if (form.valid) {
|
|
420
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Form Submitted', life: 3000 });
|
|
421
|
+
form.resetForm();
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
## Toggle Mask
|
|
428
|
+
|
|
429
|
+
When toggleMask is present, an icon is displayed to show the value as plain text.
|
|
430
|
+
|
|
431
|
+
```typescript
|
|
432
|
+
import { Component } from '@angular/core';
|
|
433
|
+
import { FormsModule } from '@angular/forms';
|
|
434
|
+
import { PasswordModule } from '@exhaustive-ui/core/password';
|
|
435
|
+
|
|
436
|
+
@Component({
|
|
437
|
+
template: `
|
|
438
|
+
<div class="card flex justify-center">
|
|
439
|
+
<p-password [(ngModel)]="value" [toggleMask]="true" autocomplete="off" />
|
|
440
|
+
</div>
|
|
441
|
+
`,
|
|
442
|
+
standalone: true,
|
|
443
|
+
imports: [PasswordModule, FormsModule]
|
|
444
|
+
})
|
|
445
|
+
export class PasswordTogglemaskDemo {
|
|
446
|
+
value!: string;
|
|
447
|
+
}
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
## Password
|
|
451
|
+
|
|
452
|
+
Password displays strength indicator for password fields.
|
|
453
|
+
|
|
454
|
+
### Props
|
|
455
|
+
|
|
456
|
+
| Name | Type | Default | Description |
|
|
457
|
+
|------|------|---------|-------------|
|
|
458
|
+
| dt | InputSignal<Object> | undefined | Defines scoped design tokens of the component. |
|
|
459
|
+
| unstyled | InputSignal<boolean> | undefined | Indicates whether the component should be rendered without styles. |
|
|
460
|
+
| pt | InputSignal<PasswordPassThrough> | undefined | Used to pass attributes to DOM elements inside the component. |
|
|
461
|
+
| ptOptions | InputSignal<PassThroughOptions> | undefined | Used to configure passthrough(pt) options of the component. |
|
|
462
|
+
| required | InputSignalWithTransform<boolean, unknown> | false | There must be a value (if set). |
|
|
463
|
+
| invalid | InputSignalWithTransform<boolean, unknown> | false | When present, it specifies that the component should have invalid state style. |
|
|
464
|
+
| disabled | InputSignalWithTransform<boolean, unknown> | false | When present, it specifies that the component should have disabled state style. |
|
|
465
|
+
| name | InputSignal<string> | undefined | When present, it specifies that the name of the input. |
|
|
466
|
+
| fluid | InputSignalWithTransform<boolean, unknown> | false | Spans 100% width of the container when enabled. |
|
|
467
|
+
| variant | InputSignal<"outlined" \| "filled"> | 'outlined' | Specifies the input variant of the component. |
|
|
468
|
+
| size | InputSignal<"small" \| "large"> | undefined | Specifies the size of the component. |
|
|
469
|
+
| inputSize | InputSignal<number> | undefined | Specifies the visible width of the input element in characters. |
|
|
470
|
+
| pattern | InputSignal<string> | undefined | Specifies the value must match the pattern. |
|
|
471
|
+
| min | InputSignal<number> | undefined | The value must be greater than or equal to the value. |
|
|
472
|
+
| max | InputSignal<number> | undefined | The value must be less than or equal to the value. |
|
|
473
|
+
| step | InputSignal<number> | undefined | Unless the step is set to the any literal, the value must be min + an integral multiple of the step. |
|
|
474
|
+
| minlength | InputSignal<number> | undefined | The number of characters (code points) must not be less than the value of the attribute, if non-empty. |
|
|
475
|
+
| maxlength | InputSignal<number> | undefined | The number of characters (code points) must not exceed the value of the attribute. |
|
|
476
|
+
| ariaLabel | InputSignal<string> | ... | Defines a string that labels the input for accessibility. |
|
|
477
|
+
| ariaLabelledBy | InputSignal<string> | ... | Specifies one or more IDs in the DOM that labels the input field. |
|
|
478
|
+
| label | InputSignal<string> | ... | Label of the input for accessibility. |
|
|
479
|
+
| promptLabel | InputSignal<string> | ... | Text to prompt password entry. Defaults to Exhaustive I18N API configuration. |
|
|
480
|
+
| mediumRegex | InputSignal<string> | ... | Regex value for medium regex. |
|
|
481
|
+
| strongRegex | InputSignal<string> | ... | Regex value for strong regex. |
|
|
482
|
+
| weakLabel | InputSignal<string> | ... | Text for a weak password. Defaults to Exhaustive I18N API configuration. |
|
|
483
|
+
| mediumLabel | InputSignal<string> | ... | Text for a medium password. Defaults to Exhaustive I18N API configuration. |
|
|
484
|
+
| strongLabel | InputSignal<string> | ... | Text for a strong password. Defaults to Exhaustive I18N API configuration. |
|
|
485
|
+
| inputId | InputSignal<string> | ... | Identifier of the accessible input element. |
|
|
486
|
+
| feedback | InputSignalWithTransform<boolean, unknown> | ... | Whether to show the strength indicator or not. |
|
|
487
|
+
| toggleMask | InputSignalWithTransform<boolean, unknown> | ... | Whether to show an icon to display the password as plain text. |
|
|
488
|
+
| inputStyleClass | InputSignal<string> | ... | Style class of the input field. |
|
|
489
|
+
| inputStyle | InputSignal<{ [klass: string]: any }> | ... | Inline style of the input field. |
|
|
490
|
+
| autocomplete | InputSignal<string> | ... | Specify automated assistance in filling out password by browser. |
|
|
491
|
+
| placeholder | InputSignal<string> | ... | Advisory information to display on input. |
|
|
492
|
+
| showClear | InputSignalWithTransform<boolean, unknown> | ... | When enabled, a clear icon is displayed to clear the value. |
|
|
493
|
+
| autofocus | InputSignalWithTransform<boolean, unknown> | ... | When present, it specifies that the component should automatically get focus on load. |
|
|
494
|
+
| tabindex | InputSignalWithTransform<number, unknown> | ... | Index of the element in tabbing order. |
|
|
495
|
+
| appendTo | InputSignal<any> | 'self' | Target element to attach the overlay, valid values are "body" or a local ng-template variable of another element (note: use binding with brackets for template variables, e.g. [appendTo]="mydiv" for a div element having #mydiv as variable name). |
|
|
496
|
+
| motionOptions | InputSignal<MotionOptions> | ... | The motion options. |
|
|
497
|
+
| overlayOptions | InputSignal<OverlayOptions> | ... | Whether to use overlay API feature. The properties of overlay API can be used like an object in it. |
|
|
498
|
+
|
|
499
|
+
### Emits
|
|
500
|
+
|
|
501
|
+
| Name | Parameters | Description |
|
|
502
|
+
|------|------------|-------------|
|
|
503
|
+
| onFocus | event: Event | Callback to invoke when the component receives focus. |
|
|
504
|
+
| onBlur | event: Event | Callback to invoke when the component loses focus. |
|
|
505
|
+
| onClear | value: any | Callback to invoke when clear button is clicked. |
|
|
506
|
+
|
|
507
|
+
### Templates
|
|
508
|
+
|
|
509
|
+
| Name | Type | Description |
|
|
510
|
+
|------|------|-------------|
|
|
511
|
+
| content | TemplateRef<void> | Custom template of content. |
|
|
512
|
+
| footer | TemplateRef<void> | Custom template of footer. |
|
|
513
|
+
| header | TemplateRef<void> | Custom template of header. |
|
|
514
|
+
| clearicon | TemplateRef<void> | Custom template of clear icon. |
|
|
515
|
+
| hideicon | TemplateRef<PasswordIconTemplateContext> | Custom template of hide icon. |
|
|
516
|
+
| showicon | TemplateRef<PasswordIconTemplateContext> | Custom template of show icon. |
|
|
517
|
+
|
|
518
|
+
## Pass Through Options
|
|
519
|
+
|
|
520
|
+
| Name | Type | Description |
|
|
521
|
+
|------|------|-------------|
|
|
522
|
+
| host | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the host element. |
|
|
523
|
+
| root | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the root's DOM element. |
|
|
524
|
+
| pcInputText | InputTextPassThrough | Used to pass attributes to the InputText component. |
|
|
525
|
+
| clearIcon | PassThroughOption<HTMLElement, I> | Used to pass attributes to the clear icon's DOM element. |
|
|
526
|
+
| maskIcon | PassThroughOption<HTMLElement, I> | Used to pass attributes to the mask icon's DOM element. |
|
|
527
|
+
| unmaskIcon | PassThroughOption<HTMLElement, I> | Used to pass attributes to the unmask icon's DOM element. |
|
|
528
|
+
| pcOverlay | OverlayPassThrough | Used to pass attributes to the Overlay component. |
|
|
529
|
+
| overlay | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the overlay's DOM element. |
|
|
530
|
+
| content | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the content's DOM element. |
|
|
531
|
+
| meter | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the meter's DOM element. |
|
|
532
|
+
| meterLabel | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the meter label's DOM element. |
|
|
533
|
+
| meterText | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the meter text's DOM element. |
|
|
534
|
+
| motion | MotionOptions | Used to pass options to the motion component/directive. |
|
|
535
|
+
|
|
536
|
+
## Theming
|
|
537
|
+
|
|
538
|
+
### CSS Classes
|
|
539
|
+
|
|
540
|
+
| Class | Description |
|
|
541
|
+
|-------|-------------|
|
|
542
|
+
| p-password | Class name of the root element |
|
|
543
|
+
| p-password-input | Class name of the pt input element |
|
|
544
|
+
| p-password-mask-icon | Class name of the mask icon element |
|
|
545
|
+
| p-password-unmask-icon | Class name of the unmask icon element |
|
|
546
|
+
| p-password-overlay | Class name of the overlay element |
|
|
547
|
+
| p-password-meter | Class name of the meter element |
|
|
548
|
+
| p-password-meter-label | Class name of the meter label element |
|
|
549
|
+
| p-password-meter-text | Class name of the meter text element |
|
|
550
|
+
| p-password-clear-icon | Class name of the clear icon |
|
|
551
|
+
|
|
552
|
+
### Design Tokens
|
|
553
|
+
|
|
554
|
+
| Token | CSS Variable | Description |
|
|
555
|
+
|-------|--------------|-------------|
|
|
556
|
+
| password.meter.background | --p-password-meter-background | Background of meter |
|
|
557
|
+
| password.meter.border.radius | --p-password-meter-border-radius | Border radius of meter |
|
|
558
|
+
| password.meter.height | --p-password-meter-height | Height of meter |
|
|
559
|
+
| password.icon.color | --p-password-icon-color | Color of icon |
|
|
560
|
+
| password.overlay.background | --p-password-overlay-background | Background of overlay |
|
|
561
|
+
| password.overlay.border.color | --p-password-overlay-border-color | Border color of overlay |
|
|
562
|
+
| password.overlay.border.radius | --p-password-overlay-border-radius | Border radius of overlay |
|
|
563
|
+
| password.overlay.color | --p-password-overlay-color | Color of overlay |
|
|
564
|
+
| password.overlay.padding | --p-password-overlay-padding | Padding of overlay |
|
|
565
|
+
| password.overlay.shadow | --p-password-overlay-shadow | Shadow of overlay |
|
|
566
|
+
| password.content.gap | --p-password-content-gap | Gap of content |
|
|
567
|
+
| password.strength.weak.background | --p-password-strength-weak-background | Weak background of strength |
|
|
568
|
+
| password.strength.medium.background | --p-password-strength-medium-background | Medium background of strength |
|
|
569
|
+
| password.strength.strong.background | --p-password-strength-strong-background | Strong background of strength |
|
|
570
|
+
|