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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +167 -2
  3. package/data/components/accordion.md +421 -0
  4. package/data/components/animateonscroll.md +163 -0
  5. package/data/components/autocomplete.md +1077 -0
  6. package/data/components/autofocus.md +38 -0
  7. package/data/components/avatar.md +417 -0
  8. package/data/components/badge.md +234 -0
  9. package/data/components/blockui.md +108 -0
  10. package/data/components/breadcrumb.md +178 -0
  11. package/data/components/button.md +774 -0
  12. package/data/components/card.md +138 -0
  13. package/data/components/carousel.md +440 -0
  14. package/data/components/cascadeselect.md +1387 -0
  15. package/data/components/chart.md +1178 -0
  16. package/data/components/checkbox.md +529 -0
  17. package/data/components/chip.md +180 -0
  18. package/data/components/colorpicker.md +301 -0
  19. package/data/components/confirmdialog.md +287 -0
  20. package/data/components/confirmpopup.md +417 -0
  21. package/data/components/contextmenu.md +491 -0
  22. package/data/components/dataview.md +600 -0
  23. package/data/components/datepicker.md +1262 -0
  24. package/data/components/dialog.md +622 -0
  25. package/data/components/divider.md +250 -0
  26. package/data/components/dock.md +500 -0
  27. package/data/components/dragdrop.md +285 -0
  28. package/data/components/drawer.md +510 -0
  29. package/data/components/dynamicdialog.md +109 -0
  30. package/data/components/editor.md +291 -0
  31. package/data/components/fieldset.md +182 -0
  32. package/data/components/fileupload.md +430 -0
  33. package/data/components/floatlabel.md +155 -0
  34. package/data/components/fluid.md +72 -0
  35. package/data/components/focustrap.md +65 -0
  36. package/data/components/galleria.md +627 -0
  37. package/data/components/iconfield.md +246 -0
  38. package/data/components/iftalabel.md +105 -0
  39. package/data/components/imagecompare.md +97 -0
  40. package/data/components/inplace.md +233 -0
  41. package/data/components/inputgroup.md +306 -0
  42. package/data/components/inputmask.md +518 -0
  43. package/data/components/inputnumber.md +675 -0
  44. package/data/components/inputotp.md +336 -0
  45. package/data/components/inputtext.md +488 -0
  46. package/data/components/keyfilter.md +85 -0
  47. package/data/components/knob.md +462 -0
  48. package/data/components/listbox.md +798 -0
  49. package/data/components/llms.md +28 -0
  50. package/data/components/megamenu.md +587 -0
  51. package/data/components/menu.md +483 -0
  52. package/data/components/menubar.md +462 -0
  53. package/data/components/message.md +449 -0
  54. package/data/components/metergroup.md +241 -0
  55. package/data/components/multiselect.md +1047 -0
  56. package/data/components/orderlist.md +342 -0
  57. package/data/components/organizationchart.md +197 -0
  58. package/data/components/overlay.md +217 -0
  59. package/data/components/paginator.md +314 -0
  60. package/data/components/panel.md +214 -0
  61. package/data/components/panelmenu.md +699 -0
  62. package/data/components/password.md +570 -0
  63. package/data/components/picklist.md +420 -0
  64. package/data/components/popover.md +378 -0
  65. package/data/components/progressbar.md +181 -0
  66. package/data/components/progressspinner.md +91 -0
  67. package/data/components/radiobutton.md +377 -0
  68. package/data/components/rating.md +312 -0
  69. package/data/components/ripple.md +89 -0
  70. package/data/components/scroller.md +122 -0
  71. package/data/components/scrollpanel.md +149 -0
  72. package/data/components/scrolltop.md +105 -0
  73. package/data/components/select.md +1206 -0
  74. package/data/components/selectbutton.md +356 -0
  75. package/data/components/skeleton.md +242 -0
  76. package/data/components/slider.md +337 -0
  77. package/data/components/speeddial.md +589 -0
  78. package/data/components/splitbutton.md +945 -0
  79. package/data/components/splitter.md +196 -0
  80. package/data/components/stepper.md +411 -0
  81. package/data/components/styleclass.md +126 -0
  82. package/data/components/table.md +4557 -0
  83. package/data/components/tabs.md +467 -0
  84. package/data/components/tag.md +200 -0
  85. package/data/components/terminal.md +118 -0
  86. package/data/components/textarea.md +416 -0
  87. package/data/components/tieredmenu.md +578 -0
  88. package/data/components/timeline.md +310 -0
  89. package/data/components/toast.md +596 -0
  90. package/data/components/togglebutton.md +356 -0
  91. package/data/components/toggleswitch.md +285 -0
  92. package/data/components/toolbar.md +182 -0
  93. package/data/components/tooltip.md +211 -0
  94. package/data/components/tree.md +746 -0
  95. package/data/components/treeselect.md +912 -0
  96. package/data/components/treetable.md +2814 -0
  97. package/data/components.json +43751 -0
  98. package/data/llms-full.txt +47433 -0
  99. package/data/llms.txt +121 -0
  100. package/data/manifest.json +46513 -0
  101. package/data/pages/accessibility.md +28 -0
  102. package/data/pages/animations.md +28 -0
  103. package/data/pages/configuration.md +210 -0
  104. package/data/pages/contribution.md +20 -0
  105. package/data/pages/customicons.md +20 -0
  106. package/data/pages/faq.md +20 -0
  107. package/data/pages/icons.md +66 -0
  108. package/data/pages/installation.md +71 -0
  109. package/data/pages/llms.md +61 -0
  110. package/data/pages/passthrough.md +32 -0
  111. package/data/pages/philosophy.md +28 -0
  112. package/data/pages/primeflex.md +20 -0
  113. package/data/pages/rtl.md +12 -0
  114. package/data/pages/styled.md +132 -0
  115. package/data/pages/tailwind.md +40 -0
  116. package/data/pages/unstyled.md +39 -0
  117. package/data/snapshot.json +9 -0
  118. package/dist/index.d.mts +448 -0
  119. package/dist/index.mjs +2501 -0
  120. package/dist/index.mjs.map +1 -0
  121. package/package.json +67 -3
@@ -0,0 +1,1262 @@
1
+ # Angular DatePicker Component
2
+
3
+ DatePicker is an input component to select a date.
4
+
5
+ ## Accessibility
6
+
7
+ Screen Reader Value to describe the component can either be provided via label tag combined with inputId prop or using aria-labelledby , aria-label props. The input element has combobox role in addition to aria-autocomplete as "none", aria-haspopup as "dialog" and aria-expanded attributes. The relation between the input and the popup is created with aria-controls attribute that refers to the id of the popup. The optional DatePicker button requires includes aria-haspopup , aria-expanded for states along with aria-controls to define the relation between the popup and the button. The value to read is retrieved from the chooseDate key of the aria property from the locale API. This label is also used for the aria-label of the popup as well. When there is a value selected, it is formatted and appended to the label to be able to notify users about the current value. Popup has a dialog role along with aria-modal and aria-label . The navigation buttons at the header has an aria-label retrieved from the prevYear , nextYear , prevMonth , nextMonth , prevDecade and nextDecade keys of the locale aria API. Similarly month picker button uses the chooseMonth and year picker button uses the chooseYear keys. Main date table uses grid role that contains th elements with col as the scope along with abbr tag resolving to the full name of the month. Each date cell has an aria-label referring to the full date value. Buttons at the footer utilize their readable labels as aria-label as well. Selected date also receives the aria-selected attribute. Timepicker spinner buttons get their labels for aria-label from the aria locale API using the prevHour , nextHour , prevMinute , nextMinute , prevSecond , nextSecond , am and pm keys. DatePicker also includes a hidden section that is only available to screen readers with aria-live as "polite". This element is updated when the selected date changes to instruct the user about the current date selected.
8
+
9
+ ## Basic
10
+
11
+ Two-way value binding is defined using the standard ngModel directive referencing to a Date property.
12
+
13
+ ```typescript
14
+ import { Component } from '@angular/core';
15
+ import { FormsModule } from '@angular/forms';
16
+ import { DatePickerModule } from '@exhaustive-ui/core/datepicker';
17
+
18
+ @Component({
19
+ template: `
20
+ <div class="card flex justify-center">
21
+ <p-datepicker [(ngModel)]="date" />
22
+ </div>
23
+ `,
24
+ standalone: true,
25
+ imports: [DatePickerModule, FormsModule]
26
+ })
27
+ export class DatepickerBasicDemo {
28
+ date: Date | undefined;
29
+ }
30
+ ```
31
+
32
+ ## Button Bar
33
+
34
+ When showButtonBar is present, today and clear buttons are displayed at the footer. The content can be fully customized with the buttonbar template as well.
35
+
36
+ ```typescript
37
+ import { Component } from '@angular/core';
38
+ import { FormsModule } from '@angular/forms';
39
+ import { ButtonModule } from '@exhaustive-ui/core/button';
40
+ import { DatePickerModule } from '@exhaustive-ui/core/datepicker';
41
+
42
+ @Component({
43
+ template: `
44
+ <div class="card flex justify-center gap-4 flex-wrap">
45
+ <p-datepicker [(ngModel)]="date" [showButtonBar]="true" placeholder="Basic" />
46
+ <p-datepicker [(ngModel)]="dates" [showButtonBar]="true" placeholder="Customized" selectionMode="range" [readonlyInput]="true">
47
+ <ng-template #buttonbar let-todayCallback="todayCallback" let-clearCallback="clearCallback">
48
+ <div class="flex justify-between w-full">
49
+ <div class="flex gap-2">
50
+ <p-button size="small" label="Exact" severity="secondary" />
51
+ <p-button size="small" label="Flexible" severity="secondary" />
52
+ </div>
53
+ <div class="flex gap-2">
54
+ <p-button size="small" label="Today" (click)="todayCallback($event)" variant="outlined" />
55
+ <p-button size="small" icon="pi pi-times" severity="danger" variant="text" (click)="clearCallback($event)" />
56
+ </div>
57
+ </div>
58
+ </ng-template>
59
+ </p-datepicker>
60
+ </div>
61
+ `,
62
+ standalone: true,
63
+ imports: [ButtonModule, DatePickerModule, FormsModule]
64
+ })
65
+ export class DatepickerButtonbarDemo {
66
+ date: Date | undefined;
67
+ dates: Date[] | undefined;
68
+ }
69
+ ```
70
+
71
+ ## Clear Icon
72
+
73
+ When showClear is enabled, a clear icon is displayed to clear the value.
74
+
75
+ ```typescript
76
+ import { Component } from '@angular/core';
77
+ import { FormsModule } from '@angular/forms';
78
+ import { DatePickerModule } from '@exhaustive-ui/core/datepicker';
79
+
80
+ @Component({
81
+ template: `
82
+ <div class="card flex justify-center">
83
+ <p-datepicker [(ngModel)]="date" [showClear]="true" inputStyleClass="w-56" />
84
+ </div>
85
+ `,
86
+ standalone: true,
87
+ imports: [DatePickerModule, FormsModule]
88
+ })
89
+ export class DatepickerCleariconDemo {
90
+ date: Date | undefined;
91
+ }
92
+ ```
93
+
94
+ ## Date Template
95
+
96
+ Custom content can be placed inside date cells with the ng-template property that takes a Date as a parameter.
97
+
98
+ ```typescript
99
+ import { Component } from '@angular/core';
100
+ import { FormsModule } from '@angular/forms';
101
+ import { DatePickerModule } from '@exhaustive-ui/core/datepicker';
102
+
103
+ @Component({
104
+ template: `
105
+ <div class="card flex justify-center">
106
+ <p-datepicker [(ngModel)]="date">
107
+ <ng-template #date let-date>
108
+ <strong *ngIf="date.day > 10 && date.day < 15; else elseBlock" style="text-decoration: line-through">{{ date.day }}</strong>
109
+ <ng-template #elseBlock>{{ date.day }}</ng-template>
110
+ </ng-template>
111
+ </p-datepicker>
112
+ </div>
113
+ `,
114
+ standalone: true,
115
+ imports: [DatePickerModule, FormsModule]
116
+ })
117
+ export class DatepickerDatetemplateDemo {
118
+ date: Date[] | undefined;
119
+ }
120
+ ```
121
+
122
+ ## Disabled
123
+
124
+ When disabled is present, the element cannot be edited and focused.
125
+
126
+ ```typescript
127
+ import { Component } from '@angular/core';
128
+ import { FormsModule } from '@angular/forms';
129
+ import { DatePickerModule } from '@exhaustive-ui/core/datepicker';
130
+
131
+ @Component({
132
+ template: `
133
+ <div class="card flex justify-center">
134
+ <p-datepicker [(ngModel)]="date" [disabled]="true" />
135
+ </div>
136
+ `,
137
+ standalone: true,
138
+ imports: [DatePickerModule, FormsModule]
139
+ })
140
+ export class DatepickerDisabledDemo {
141
+ date: Date | undefined;
142
+ }
143
+ ```
144
+
145
+ ## events-doc
146
+
147
+ ```typescript
148
+ import { Component } from '@angular/core';
149
+
150
+ @Component({
151
+ template: `
152
+ <section class="py-6">
153
+ <div class="doc-tablewrapper">
154
+ <table class="doc-table">
155
+ <thead>
156
+ <tr>
157
+ <th>Name</th>
158
+ <th>Parameters</th>
159
+ <th>Description</th>
160
+ </tr>
161
+ </thead>
162
+ <tbody>
163
+ <tr>
164
+ <td>onSelect</td>
165
+ <td>value: Selected value</td>
166
+ <td>Callback to invoke when a date is selected. Note that this event is not called when the value is entered from the input manually.</td>
167
+ </tr>
168
+ <tr>
169
+ <td>onBlur</td>
170
+ <td>event: Blur event</td>
171
+ <td>Callback to invoke on blur of input field.</td>
172
+ </tr>
173
+ <tr>
174
+ <td>onFocus</td>
175
+ <td>event: Focus event</td>
176
+ <td>Callback to invoke on focus of input field.</td>
177
+ </tr>
178
+ <tr>
179
+ <td>onClose</td>
180
+ <td>event: Close event</td>
181
+ <td>Callback to invoke when datepicker panel is closed.</td>
182
+ </tr>
183
+ <tr>
184
+ <td>onShow</td>
185
+ <td>event: Animation event</td>
186
+ <td>Callback to invoke when datepicker panel is visible.</td>
187
+ </tr>
188
+ <tr>
189
+ <td>onClickOutside</td>
190
+ <td>event: Click event</td>
191
+ <td>Callback to invoke when click outside of datepicker panel.</td>
192
+ </tr>
193
+ <tr>
194
+ <td>onInput</td>
195
+ <td>event: Input event</td>
196
+ <td>Callback to invoke when input field is being typed.</td>
197
+ </tr>
198
+ <tr>
199
+ <td>onTodayClick</td>
200
+ <td>event: Click event</td>
201
+ <td>Callback to invoke when today button is clicked.</td>
202
+ </tr>
203
+ <tr>
204
+ <td>onClearClick</td>
205
+ <td>event: Click event</td>
206
+ <td>Callback to invoke when clear button is clicked.</td>
207
+ </tr>
208
+ <tr>
209
+ <td>onMonthChange</td>
210
+ <td>
211
+ event.month: New month <br />
212
+ event.year: New year
213
+ </td>
214
+ <td>Callback to invoke when a month is changed using the navigators.</td>
215
+ </tr>
216
+ <tr>
217
+ <td>onYearChange</td>
218
+ <td>
219
+ event.month: New month <br />
220
+ event.year: New year
221
+ </td>
222
+ <td>Callback to invoke when a year is changed using the navigators.</td>
223
+ </tr>
224
+ <tr>
225
+ <td>onClear</td>
226
+ <td>-</td>
227
+ <td>Callback to invoke when input field is cleared.</td>
228
+ </tr>
229
+ </tbody>
230
+ </table>
231
+ </div>
232
+ </section>
233
+ `,
234
+ standalone: true,
235
+ imports: []
236
+ })
237
+ export class DatepickerEventsDemo {}
238
+ ```
239
+
240
+ ## Filled
241
+
242
+ Specify the variant property as filled to display the component with a higher visual emphasis than the default outlined style.
243
+
244
+ ```typescript
245
+ import { Component } from '@angular/core';
246
+ import { FormsModule } from '@angular/forms';
247
+ import { DatePickerModule } from '@exhaustive-ui/core/datepicker';
248
+
249
+ @Component({
250
+ template: `
251
+ <div class="card flex justify-center">
252
+ <p-datepicker [(ngModel)]="date" variant="filled" />
253
+ </div>
254
+ `,
255
+ standalone: true,
256
+ imports: [DatePickerModule, FormsModule]
257
+ })
258
+ export class DatepickerFilledDemo {
259
+ date: Date[] | undefined;
260
+ }
261
+ ```
262
+
263
+ ## Float Label
264
+
265
+ A floating label appears on top of the input field when focused. Visit FloatLabel documentation for more information.
266
+
267
+ ```typescript
268
+ import { Component } from '@angular/core';
269
+ import { FormsModule } from '@angular/forms';
270
+ import { DatePickerModule } from '@exhaustive-ui/core/datepicker';
271
+ import { FloatLabelModule } from '@exhaustive-ui/core/floatlabel';
272
+
273
+ @Component({
274
+ template: `
275
+ <div class="card flex flex-wrap justify-center items-end gap-4">
276
+ <p-floatlabel>
277
+ <p-datepicker [(ngModel)]="value1" inputId="over_label" showIcon iconDisplay="input" />
278
+ <label for="over_label">Over Label</label>
279
+ </p-floatlabel>
280
+ <p-floatlabel variant="in">
281
+ <p-datepicker [(ngModel)]="value2" inputId="in_label" showIcon iconDisplay="input" />
282
+ <label for="in_label">In Label</label>
283
+ </p-floatlabel>
284
+ <p-floatlabel variant="on">
285
+ <p-datepicker [(ngModel)]="value3" inputId="on_label" showIcon iconDisplay="input" />
286
+ <label for="on_label">On Label</label>
287
+ </p-floatlabel>
288
+ </div>
289
+ `,
290
+ standalone: true,
291
+ imports: [DatePickerModule, FloatLabelModule, FormsModule]
292
+ })
293
+ export class DatepickerFloatlabelDemo {
294
+ value1: Date | undefined;
295
+ value2: Date | undefined;
296
+ value3: Date | undefined;
297
+ }
298
+ ```
299
+
300
+ ## Fluid
301
+
302
+ The fluid prop makes the component take up the full width of its container when set to true.
303
+
304
+ ```typescript
305
+ import { Component } from '@angular/core';
306
+ import { FormsModule } from '@angular/forms';
307
+ import { DatePickerModule } from '@exhaustive-ui/core/datepicker';
308
+
309
+ @Component({
310
+ template: `
311
+ <div class="card">
312
+ <p-datepicker [(ngModel)]="date" fluid />
313
+ </div>
314
+ `,
315
+ standalone: true,
316
+ imports: [DatePickerModule, FormsModule]
317
+ })
318
+ export class DatepickerFluidDemo {
319
+ date: Date | undefined;
320
+ }
321
+ ```
322
+
323
+ ## Format
324
+
325
+ Default date format is mm/dd/yy which can be customized using the dateFormat property. Following options can be a part of the format. d - day of month (no leading zero) dd - day of month (two digit) o - day of the year (no leading zeros) oo - day of the year (three digit) D - day name short DD - day name long m - month of year (no leading zero) mm - month of year (two digit) M - month name short MM - month name long y - year (two digit) yy - year (four digit) &#64; - Unix timestamp (ms since 01/01/1970) ! - Windows ticks (100ns since 01/01/0001) '...' - literal text '' - single quote anything else - literal text
326
+
327
+ ```typescript
328
+ import { Component } from '@angular/core';
329
+ import { FormsModule } from '@angular/forms';
330
+ import { DatePickerModule } from '@exhaustive-ui/core/datepicker';
331
+
332
+ @Component({
333
+ template: `
334
+ <div class="card flex justify-center">
335
+ <p-datepicker [(ngModel)]="date" dateFormat="dd.mm.yy" />
336
+ </div>
337
+ `,
338
+ standalone: true,
339
+ imports: [DatePickerModule, FormsModule]
340
+ })
341
+ export class DatepickerFormatDemo {
342
+ date: Date | undefined;
343
+ }
344
+ ```
345
+
346
+ ## Icon
347
+
348
+ An additional icon is displayed next to the input field when showIcon is present.
349
+
350
+ ```typescript
351
+ import { Component } from '@angular/core';
352
+ import { FormsModule } from '@angular/forms';
353
+ import { DatePickerModule } from '@exhaustive-ui/core/datepicker';
354
+
355
+ @Component({
356
+ template: `
357
+ <p-fluid class="card flex flex-wrap gap-4">
358
+ <div class="flex-auto">
359
+ <label for="buttondisplay" class="font-bold block mb-2"> Button </label>
360
+ <p-datepicker [(ngModel)]="date1" [showIcon]="true" inputId="buttondisplay" [showOnFocus]="false" />
361
+ </div>
362
+ <div class="flex-auto">
363
+ <label for="icondisplay" class="font-bold block mb-2"> Default Icon </label>
364
+ <p-datepicker [(ngModel)]="date2" [iconDisplay]="'input'" [showIcon]="true" inputId="icondisplay" />
365
+ </div>
366
+ <div class="flex-auto">
367
+ <label for="templatedisplay" class="font-bold block mb-2"> Custom Icon </label>
368
+ <p-datepicker [(ngModel)]="date3" [iconDisplay]="'input'" [showIcon]="true" [timeOnly]="true" inputId="templatedisplay">
369
+ <ng-template #inputicon let-clickCallBack="clickCallBack">
370
+ <i class="pi pi-clock" (click)="clickCallBack($event)"></i>
371
+ </ng-template>
372
+ </p-datepicker>
373
+ </div>
374
+ </p-fluid>
375
+ `,
376
+ standalone: true,
377
+ imports: [DatePickerModule, FormsModule]
378
+ })
379
+ export class DatepickerIconDemo {
380
+ date1: Date | undefined;
381
+ date2: Date | undefined;
382
+ date3: Date | undefined;
383
+ }
384
+ ```
385
+
386
+ ## Ifta Label
387
+
388
+ IftaLabel is used to create infield top aligned labels. Visit IftaLabel documentation for more information.
389
+
390
+ ```typescript
391
+ import { Component } from '@angular/core';
392
+ import { FormsModule } from '@angular/forms';
393
+ import { DatePickerModule } from '@exhaustive-ui/core/datepicker';
394
+ import { IftaLabelModule } from '@exhaustive-ui/core/iftalabel';
395
+
396
+ @Component({
397
+ template: `
398
+ <div class="card flex justify-center">
399
+ <p-iftalabel>
400
+ <p-datepicker [(ngModel)]="value" inputId="date" showIcon iconDisplay="input" />
401
+ <label for="date">Date</label>
402
+ </p-iftalabel>
403
+ </div>
404
+ `,
405
+ standalone: true,
406
+ imports: [DatePickerModule, IftaLabelModule, FormsModule]
407
+ })
408
+ export class DatepickerIftalabelDemo {
409
+ value: Date | undefined;
410
+ }
411
+ ```
412
+
413
+ ## Inline
414
+
415
+ DatePicker is displayed as a popup by default, add inline property to customize this behavior.
416
+
417
+ ```typescript
418
+ import { Component } from '@angular/core';
419
+ import { FormsModule } from '@angular/forms';
420
+ import { DatePickerModule } from '@exhaustive-ui/core/datepicker';
421
+
422
+ @Component({
423
+ template: `
424
+ <div class="card flex justify-center">
425
+ <p-datepicker class="max-w-full" [(ngModel)]="date" [inline]="true" [showWeek]="true" />
426
+ </div>
427
+ `,
428
+ standalone: true,
429
+ imports: [DatePickerModule, FormsModule]
430
+ })
431
+ export class DatepickerInlineDemo {
432
+ date: Date[] | undefined;
433
+ }
434
+ ```
435
+
436
+ ## Invalid
437
+
438
+ The invalid state is applied using the ⁠invalid property to indicate failed validation, which can be integrated with Angular Forms.
439
+
440
+ ```typescript
441
+ import { Component } from '@angular/core';
442
+ import { FormsModule } from '@angular/forms';
443
+ import { DatePickerModule } from '@exhaustive-ui/core/datepicker';
444
+
445
+ @Component({
446
+ template: `
447
+ <div class="card flex flex-wrap justify-center gap-4">
448
+ <p-datepicker [(ngModel)]="date1" [invalid]="!date1" placeholder="Date" />
449
+ <p-datepicker [(ngModel)]="date2" [invalid]="!date2" variant="filled" placeholder="Date" />
450
+ </div>
451
+ `,
452
+ standalone: true,
453
+ imports: [DatePickerModule, FormsModule]
454
+ })
455
+ export class DatepickerInvalidDemo {
456
+ date1: Date | undefined;
457
+ date2: Date | undefined;
458
+ }
459
+ ```
460
+
461
+ ## Locale
462
+
463
+ Locale for different languages and formats is defined globally, refer to the ExhaustiveUI Locale configuration for more information.
464
+
465
+ ## Mask
466
+
467
+ DatePicker can be used with the pInputMask directive to enforce a specific input format.
468
+
469
+ ```typescript
470
+ import { Component } from '@angular/core';
471
+ import { FormsModule } from '@angular/forms';
472
+ import { DatePickerModule } from '@exhaustive-ui/core/datepicker';
473
+ import { InputMaskModule } from '@exhaustive-ui/core/inputmask';
474
+
475
+ @Component({
476
+ template: `
477
+ <div class="card flex justify-center">
478
+ <p-datepicker [(ngModel)]="date" dateFormat="dd/mm/yy" placeholder="dd/mm/yyyy" pInputMask="99/99/9999" />
479
+ </div>
480
+ `,
481
+ standalone: true,
482
+ imports: [DatePickerModule, InputMaskModule, FormsModule]
483
+ })
484
+ export class DatepickerMaskDemo {
485
+ date: Date | undefined;
486
+ }
487
+ ```
488
+
489
+ ## methods-doc
490
+
491
+ ```typescript
492
+ import { Component } from '@angular/core';
493
+
494
+ @Component({
495
+ template: `
496
+ <section class="py-6">
497
+ <div class="doc-tablewrapper">
498
+ <table class="doc-table">
499
+ <thead>
500
+ <tr>
501
+ <th>Name</th>
502
+ <th>Parameters</th>
503
+ <th>Description</th>
504
+ </tr>
505
+ </thead>
506
+ <tbody>
507
+ <tr>
508
+ <td>toggle</td>
509
+ <td>-</td>
510
+ <td>Toggles the visibility of the calendar.</td>
511
+ </tr>
512
+ </tbody>
513
+ </table>
514
+ </div>
515
+ </section>
516
+ `,
517
+ standalone: true,
518
+ imports: []
519
+ })
520
+ export class DatepickerMethodsDemo {}
521
+ ```
522
+
523
+ ## Min / Max
524
+
525
+ Boundaries for the permitted dates that can be entered are defined with minDate and maxDate properties.
526
+
527
+ ```typescript
528
+ import { Component, OnInit } from '@angular/core';
529
+ import { FormsModule } from '@angular/forms';
530
+ import { DatePickerModule } from '@exhaustive-ui/core/datepicker';
531
+
532
+ @Component({
533
+ template: `
534
+ <div class="card flex justify-center">
535
+ <p-datepicker [(ngModel)]="date" [minDate]="minDate" [maxDate]="maxDate" [readonlyInput]="true" />
536
+ </div>
537
+ `,
538
+ standalone: true,
539
+ imports: [DatePickerModule, FormsModule]
540
+ })
541
+ export class DatepickerMinmaxDemo implements OnInit {
542
+ date: Date | undefined;
543
+ minDate: Date | undefined;
544
+ maxDate: Date | undefined;
545
+
546
+ ngOnInit() {
547
+ let today = new Date();
548
+ let month = today.getMonth();
549
+ let year = today.getFullYear();
550
+ let prevMonth = month === 0 ? 11 : month - 1;
551
+ let prevYear = prevMonth === 11 ? year - 1 : year;
552
+ let nextMonth = month === 11 ? 0 : month + 1;
553
+ let nextYear = nextMonth === 0 ? year + 1 : year;
554
+ this.minDate = new Date();
555
+ this.minDate.setMonth(prevMonth);
556
+ this.minDate.setFullYear(prevYear);
557
+ this.maxDate = new Date();
558
+ this.maxDate.setMonth(nextMonth);
559
+ this.maxDate.setFullYear(nextYear);
560
+ }
561
+ }
562
+ ```
563
+
564
+ ## month-doc
565
+
566
+ Month only picker is enabled by specifying view as month in addition to a suitable dateFormat .
567
+
568
+ ```typescript
569
+ import { Component } from '@angular/core';
570
+ import { FormsModule } from '@angular/forms';
571
+ import { DatePickerModule } from '@exhaustive-ui/core/datepicker';
572
+
573
+ @Component({
574
+ template: `
575
+ <div class="card flex justify-center">
576
+ <p-datepicker [(ngModel)]="date" view="month" dateFormat="mm/yy" [readonlyInput]="true" />
577
+ </div>
578
+ `,
579
+ standalone: true,
580
+ imports: [DatePickerModule, FormsModule]
581
+ })
582
+ export class DatepickerMonthDemo {
583
+ date: Date[] | undefined;
584
+ }
585
+ ```
586
+
587
+ ## Multiple
588
+
589
+ In order to choose multiple dates, set selectionMode as multiple . In this mode, the value binding should be an array.
590
+
591
+ ```typescript
592
+ import { Component } from '@angular/core';
593
+ import { FormsModule } from '@angular/forms';
594
+ import { DatePickerModule } from '@exhaustive-ui/core/datepicker';
595
+
596
+ @Component({
597
+ template: `
598
+ <div class="card flex justify-center">
599
+ <p-datepicker [(ngModel)]="dates" selectionMode="multiple" [readonlyInput]="true" />
600
+ </div>
601
+ `,
602
+ standalone: true,
603
+ imports: [DatePickerModule, FormsModule]
604
+ })
605
+ export class DatepickerMultipleDemo {
606
+ dates: Date[] | undefined;
607
+ }
608
+ ```
609
+
610
+ ## Multiple Months
611
+
612
+ Number of months to display is configured with the numberOfMonths property.
613
+
614
+ ```typescript
615
+ import { Component } from '@angular/core';
616
+ import { FormsModule } from '@angular/forms';
617
+ import { DatePickerModule } from '@exhaustive-ui/core/datepicker';
618
+
619
+ @Component({
620
+ template: `
621
+ <div class="card flex justify-center">
622
+ <p-datepicker [(ngModel)]="date" [numberOfMonths]="2" />
623
+ </div>
624
+ `,
625
+ standalone: true,
626
+ imports: [DatePickerModule, FormsModule]
627
+ })
628
+ export class DatepickerMultiplemonthsDemo {
629
+ date: Date[] | undefined;
630
+ }
631
+ ```
632
+
633
+ ## Range
634
+
635
+ A range of dates can be selected by defining selectionMode as range , in this case the bound value would be an array with two values where first date is the start of the range and second date is the end.
636
+
637
+ ```typescript
638
+ import { Component } from '@angular/core';
639
+ import { FormsModule } from '@angular/forms';
640
+ import { DatePickerModule } from '@exhaustive-ui/core/datepicker';
641
+
642
+ @Component({
643
+ template: `
644
+ <div class="card flex justify-center">
645
+ <p-datepicker [(ngModel)]="rangeDates" selectionMode="range" [readonlyInput]="true" />
646
+ </div>
647
+ `,
648
+ standalone: true,
649
+ imports: [DatePickerModule, FormsModule]
650
+ })
651
+ export class DatepickerRangeDemo {
652
+ rangeDates: Date[] | undefined;
653
+ }
654
+ ```
655
+
656
+ ## reactiveforms-doc
657
+
658
+ DatePicker can also be used with reactive forms. In this case, the formControlName property is used to bind the component to a form control.
659
+
660
+ ```typescript
661
+ import { Component, inject } from '@angular/core';
662
+ import { ReactiveFormsModule } from '@angular/forms';
663
+ import { DatePickerModule } from '@exhaustive-ui/core/datepicker';
664
+ import { MessageModule } from '@exhaustive-ui/core/message';
665
+ import { ToastModule } from '@exhaustive-ui/core/toast';
666
+ import { ButtonModule } from '@exhaustive-ui/core/button';
667
+ import { MessageService } from '@exhaustive-ui/core/api';
668
+
669
+ @Component({
670
+ template: `
671
+ <p-toast />
672
+ <div class="card flex justify-center">
673
+ <form [formGroup]="exampleForm" (ngSubmit)="onSubmit()" class="flex flex-col gap-4">
674
+ <div class="flex flex-col gap-1">
675
+ <p-datepicker formControlName="selectedDate" [invalid]="isInvalid('selectedDate')" />
676
+ @if (isInvalid('selectedDate')) {
677
+ <p-message severity="error" size="small" variant="simple">Date is required.</p-message>
678
+ }
679
+ </div>
680
+ <button pButton severity="secondary" type="submit"><span pButtonLabel>Submit</span></button>
681
+ </form>
682
+ </div>
683
+ `,
684
+ standalone: true,
685
+ imports: [DatePickerModule, MessageModule, ToastModule, ButtonModule, ReactiveFormsModule]
686
+ })
687
+ export class DatepickerReactiveformsDemo {
688
+ messageService = inject(MessageService);
689
+ exampleForm: FormGroup | undefined;
690
+ formSubmitted: boolean = false;
691
+
692
+ constructor() {
693
+ this.exampleForm = this.fb.group({
694
+ selectedDate: ['', Validators.required]
695
+ });
696
+ }
697
+
698
+ onSubmit() {
699
+ this.formSubmitted = true;
700
+ if (this.exampleForm.valid) {
701
+ this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Form is submitted', life: 3000 });
702
+ this.exampleForm.reset();
703
+ this.formSubmitted = false;
704
+ }
705
+ }
706
+
707
+ isInvalid(controlName: string) {
708
+ const control = this.exampleForm.get(controlName);
709
+ return control?.invalid && (control.touched || this.formSubmitted);
710
+ }
711
+ }
712
+ ```
713
+
714
+ ## Sizes
715
+
716
+ DatePicker provides small and large sizes as alternatives to the base.
717
+
718
+ ```typescript
719
+ import { Component } from '@angular/core';
720
+ import { FormsModule } from '@angular/forms';
721
+ import { DatePickerModule } from '@exhaustive-ui/core/datepicker';
722
+
723
+ @Component({
724
+ template: `
725
+ <div class="card flex flex-col items-center gap-4">
726
+ <p-datepicker [(ngModel)]="value1" size="small" placeholder="Small" showIcon iconDisplay="input" />
727
+ <p-datepicker [(ngModel)]="value2" placeholder="Normal" showIcon iconDisplay="input" />
728
+ <p-datepicker [(ngModel)]="value3" size="large" placeholder="Large" showIcon iconDisplay="input" />
729
+ </div>
730
+ `,
731
+ standalone: true,
732
+ imports: [DatePickerModule, FormsModule]
733
+ })
734
+ export class DatepickerSizesDemo {
735
+ value1: Date | undefined;
736
+ value2: Date | undefined;
737
+ value3: Date | undefined;
738
+ }
739
+ ```
740
+
741
+ ## template-doc
742
+
743
+ Calendar UI accepts custom content using header and footer templates.
744
+
745
+ ```typescript
746
+ import { Component } from '@angular/core';
747
+ import { FormsModule } from '@angular/forms';
748
+
749
+ @Component({
750
+ template: `
751
+ <div class="card flex justify-center">
752
+ <p-calendar [(ngModel)]="date">
753
+ <ng-template #header>Header</ng-template>
754
+ <ng-template #footer>Footer</ng-template>
755
+ </p-calendar>
756
+ </div>
757
+ `,
758
+ standalone: true,
759
+ imports: [FormsModule]
760
+ })
761
+ export class DatepickerTemplateDemo {
762
+ date: Date[] | undefined;
763
+ }
764
+ ```
765
+
766
+ ## templatedrivenforms-doc
767
+
768
+ ```typescript
769
+ import { Component, inject } from '@angular/core';
770
+ import { FormsModule } from '@angular/forms';
771
+ import { DatePickerModule } from '@exhaustive-ui/core/datepicker';
772
+ import { MessageModule } from '@exhaustive-ui/core/message';
773
+ import { ToastModule } from '@exhaustive-ui/core/toast';
774
+ import { ButtonModule } from '@exhaustive-ui/core/button';
775
+ import { MessageService } from '@exhaustive-ui/core/api';
776
+
777
+ @Component({
778
+ template: `
779
+ <p-toast />
780
+ <div class="card flex justify-center">
781
+ <form #exampleForm="ngForm" (ngSubmit)="onSubmit(exampleForm)" class="flex flex-col gap-4">
782
+ <div class="flex flex-col gap-1">
783
+ <p-datepicker name="date" [invalid]="dateModel.invalid && (dateModel.touched || exampleForm.submitted)" #dateModel="ngModel" [(ngModel)]="date" required />
784
+ @if (dateModel.invalid && (dateModel.touched || exampleForm.submitted)) {
785
+ <p-message severity="error" size="small" variant="simple">Date is required.</p-message>
786
+ }
787
+ </div>
788
+ <button pButton severity="secondary" type="submit"><span pButtonLabel>Submit</span></button>
789
+ </form>
790
+ </div>
791
+ `,
792
+ standalone: true,
793
+ imports: [DatePickerModule, MessageModule, ToastModule, ButtonModule, FormsModule]
794
+ })
795
+ export class DatepickerTemplatedrivenformsDemo {
796
+ messageService = inject(MessageService);
797
+ date: Date | undefined;
798
+
799
+ onSubmit(form: any) {
800
+ if (form.valid) {
801
+ this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Form is submitted', life: 3000 });
802
+ form.resetForm();
803
+ }
804
+ }
805
+ }
806
+ ```
807
+
808
+ ## templates-doc
809
+
810
+ ```typescript
811
+ import { Component } from '@angular/core';
812
+
813
+ @Component({
814
+ template: `
815
+ <div class="doc-tablewrapper">
816
+ <table class="doc-table">
817
+ <thead>
818
+ <tr>
819
+ <th>Name</th>
820
+ <th>Parameters</th>
821
+ </tr>
822
+ </thead>
823
+ <tbody>
824
+ <tr>
825
+ <td>header</td>
826
+ <td>-</td>
827
+ </tr>
828
+ <tr>
829
+ <td>footer</td>
830
+ <td>-</td>
831
+ </tr>
832
+ <tr>
833
+ <td>date</td>
834
+ <td>$implicit: Value of the component</td>
835
+ </tr>
836
+ <tr>
837
+ <td>decade</td>
838
+ <td>$implicit: An array containing the start and and year of a decade to display at header of the year picker.</td>
839
+ </tr>
840
+ <tr>
841
+ <td>previousicon</td>
842
+ <td>-</td>
843
+ </tr>
844
+ <tr>
845
+ <td>nexticon</td>
846
+ <td>-</td>
847
+ </tr>
848
+ <tr>
849
+ <td>triggericon</td>
850
+ <td>-</td>
851
+ </tr>
852
+ <tr>
853
+ <td>clearicon</td>
854
+ <td>-</td>
855
+ </tr>
856
+ <tr>
857
+ <td>incrementicon</td>
858
+ <td>-</td>
859
+ </tr>
860
+ <tr>
861
+ <td>decrementicon</td>
862
+ <td>-</td>
863
+ </tr>
864
+ </tbody>
865
+ </table>
866
+ </div>
867
+ `,
868
+ standalone: true,
869
+ imports: []
870
+ })
871
+ export class DatepickerTemplatesDemo {}
872
+ ```
873
+
874
+ ## Time
875
+
876
+ A time picker is displayed when showTime is enabled where 12/24 hour format is configured with hourFormat property. In case, only time needs to be selected, add timeOnly to hide the date section.
877
+
878
+ ```typescript
879
+ import { Component } from '@angular/core';
880
+ import { FormsModule } from '@angular/forms';
881
+ import { DatePickerModule } from '@exhaustive-ui/core/datepicker';
882
+
883
+ @Component({
884
+ template: `
885
+ <p-fluid class="card flex flex-wrap gap-4">
886
+ <div class="flex-auto">
887
+ <label for="calendar-12h" class="font-bold block mb-2"> 12h Format </label>
888
+ <p-datepicker inputId="calendar-12h" [(ngModel)]="datetime12h" [showTime]="true" [hourFormat]="12" />
889
+ </div>
890
+ <div class="flex-auto">
891
+ <label for="calendar-24h" class="font-bold block mb-2"> 24h Format </label>
892
+ <p-datepicker inputId="calendar-24h" [(ngModel)]="datetime24h" [showTime]="true" [hourFormat]="24" />
893
+ </div>
894
+ <div class="flex-auto">
895
+ <label for="calendar-timeonly" class="font-bold block mb-2"> Time Only </label>
896
+ <p-datepicker inputId="calendar-timeonly" [(ngModel)]="time" [timeOnly]="true" />
897
+ </div>
898
+ </p-fluid>
899
+ `,
900
+ standalone: true,
901
+ imports: [DatePickerModule, FormsModule]
902
+ })
903
+ export class DatepickerTimeDemo {
904
+ datetime12h: Date[] | undefined;
905
+ datetime24h: Date[] | undefined;
906
+ time: Date[] | undefined;
907
+ }
908
+ ```
909
+
910
+ ## touchui-doc
911
+
912
+ When touchUI is enabled, overlay is displayed as optimized for touch devices.
913
+
914
+ ```typescript
915
+ import { Component } from '@angular/core';
916
+ import { FormsModule } from '@angular/forms';
917
+ import { DatePickerModule } from '@exhaustive-ui/core/datepicker';
918
+
919
+ @Component({
920
+ template: `
921
+ <div class="card flex justify-center">
922
+ <p-datepicker [(ngModel)]="date" [touchUI]="true" [readonlyInput]="true" />
923
+ </div>
924
+ `,
925
+ standalone: true,
926
+ imports: [DatePickerModule, FormsModule]
927
+ })
928
+ export class DatepickerTouchuiDemo {
929
+ date: Date[] | undefined;
930
+ }
931
+ ```
932
+
933
+ ## year-doc
934
+
935
+ Specifying view as year in addition to a suitable dateFormat enables the year picker.
936
+
937
+ ```typescript
938
+ import { Component } from '@angular/core';
939
+ import { FormsModule } from '@angular/forms';
940
+ import { DatePickerModule } from '@exhaustive-ui/core/datepicker';
941
+
942
+ @Component({
943
+ template: `
944
+ <div class="card flex justify-center">
945
+ <p-datepicker [(ngModel)]="date" view="year" dateFormat="yy" />
946
+ </div>
947
+ `,
948
+ standalone: true,
949
+ imports: [DatePickerModule, FormsModule]
950
+ })
951
+ export class DatepickerYearDemo {
952
+ date: Date[] | undefined;
953
+ }
954
+ ```
955
+
956
+ ## Date Picker
957
+
958
+ DatePicker is a form component to work with dates.
959
+
960
+ ### Props
961
+
962
+ | Name | Type | Default | Description |
963
+ |------|------|---------|-------------|
964
+ | dt | InputSignal<Object> | undefined | Defines scoped design tokens of the component. |
965
+ | unstyled | InputSignal<boolean> | undefined | Indicates whether the component should be rendered without styles. |
966
+ | pt | InputSignal<DatePickerPassThrough> | undefined | Used to pass attributes to DOM elements inside the component. |
967
+ | ptOptions | InputSignal<PassThroughOptions> | undefined | Used to configure passthrough(pt) options of the component. |
968
+ | required | InputSignalWithTransform<boolean, unknown> | false | There must be a value (if set). |
969
+ | invalid | InputSignalWithTransform<boolean, unknown> | false | When present, it specifies that the component should have invalid state style. |
970
+ | disabled | InputSignalWithTransform<boolean, unknown> | false | When present, it specifies that the component should have disabled state style. |
971
+ | name | InputSignal<string> | undefined | When present, it specifies that the name of the input. |
972
+ | fluid | InputSignalWithTransform<boolean, unknown> | false | Spans 100% width of the container when enabled. |
973
+ | variant | InputSignal<"outlined" \| "filled"> | 'outlined' | Specifies the input variant of the component. |
974
+ | size | InputSignal<"small" \| "large"> | undefined | Specifies the size of the component. |
975
+ | inputSize | InputSignal<number> | undefined | Specifies the visible width of the input element in characters. |
976
+ | pattern | InputSignal<string> | undefined | Specifies the value must match the pattern. |
977
+ | min | InputSignal<number> | undefined | The value must be greater than or equal to the value. |
978
+ | max | InputSignal<number> | undefined | The value must be less than or equal to the value. |
979
+ | step | InputSignal<number> | undefined | Unless the step is set to the any literal, the value must be min + an integral multiple of the step. |
980
+ | minlength | InputSignal<number> | undefined | The number of characters (code points) must not be less than the value of the attribute, if non-empty. |
981
+ | maxlength | InputSignal<number> | undefined | The number of characters (code points) must not exceed the value of the attribute. |
982
+ | inputStyle | InputSignal<{ [klass: string]: any }> | ... | Inline style of the input field. |
983
+ | inputId | InputSignal<string> | ... | Identifier of the focus input to match a label defined for the component. |
984
+ | inputStyleClass | InputSignal<string> | ... | Style class of the input field. |
985
+ | placeholder | InputSignal<string> | ... | Placeholder text for the input. |
986
+ | ariaLabelledBy | InputSignal<string> | ... | Establishes relationships between the component and label(s) where its value should be one or more element IDs. |
987
+ | ariaLabel | InputSignal<string> | ... | Defines a string that labels the input for accessibility. |
988
+ | iconAriaLabel | InputSignal<string> | ... | Defines a string that labels the icon button for accessibility. |
989
+ | dateFormat | InputSignal<string> | ... | Format of the date which can also be defined at locale settings. |
990
+ | multipleSeparator | InputSignal<string> | ... | Separator for multiple selection mode. |
991
+ | rangeSeparator | InputSignal<string> | ... | Separator for joining start and end dates on range selection mode. |
992
+ | inline | InputSignalWithTransform<boolean, unknown> | ... | When enabled, displays the datepicker as inline. Default is false for popup mode. |
993
+ | showOtherMonths | InputSignalWithTransform<boolean, unknown> | ... | Whether to display dates in other months (non-selectable) at the start or end of the current month. To make these days selectable use the selectOtherMonths option. |
994
+ | selectOtherMonths | InputSignalWithTransform<boolean, unknown> | ... | Whether days in other months shown before or after the current month are selectable. This only applies if the showOtherMonths option is set to true. |
995
+ | showIcon | InputSignalWithTransform<boolean, unknown> | ... | When enabled, displays a button with icon next to input. |
996
+ | icon | InputSignal<string> | ... | Icon of the datepicker button. |
997
+ | readonlyInput | InputSignalWithTransform<boolean, unknown> | ... | When specified, prevents entering the date manually with keyboard. |
998
+ | shortYearCutoff | InputSignal<any> | ... | The cutoff year for determining the century for a date. |
999
+ | hourFormat | InputSignal<string> | ... | Specifies 12 or 24 hour format. |
1000
+ | timeOnly | InputSignalWithTransform<boolean, unknown> | ... | Whether to display timepicker only. |
1001
+ | stepHour | InputSignalWithTransform<number, unknown> | ... | Hours to change per step. |
1002
+ | stepMinute | InputSignalWithTransform<number, unknown> | ... | Minutes to change per step. |
1003
+ | stepSecond | InputSignalWithTransform<number, unknown> | ... | Seconds to change per step. |
1004
+ | showSeconds | InputSignalWithTransform<boolean, unknown> | ... | Whether to show the seconds in time picker. |
1005
+ | showOnFocus | InputSignalWithTransform<boolean, unknown> | ... | When disabled, datepicker will not be visible with input focus. |
1006
+ | showWeek | InputSignalWithTransform<boolean, unknown> | ... | When enabled, datepicker will show week numbers. |
1007
+ | startWeekFromFirstDayOfYear | InputSignal<boolean> | ... | When enabled, datepicker will start week numbers from first day of the year. |
1008
+ | showClear | InputSignalWithTransform<boolean, unknown> | ... | When enabled, a clear icon is displayed to clear the value. |
1009
+ | dataType | InputSignal<string> | ... | Type of the value to write back to ngModel, default is date and alternative is string. |
1010
+ | selectionMode | InputSignal<"multiple" \| "single" \| "range"> | ... | Defines the quantity of the selection, valid values are "single", "multiple" and "range". |
1011
+ | maxDateCount | InputSignalWithTransform<number, unknown> | ... | Maximum number of selectable dates in multiple mode. |
1012
+ | showButtonBar | InputSignalWithTransform<boolean, unknown> | ... | Whether to display today and clear buttons at the footer |
1013
+ | todayButtonStyleClass | InputSignal<string> | ... | Style class of the today button. |
1014
+ | clearButtonStyleClass | InputSignal<string> | ... | Style class of the clear button. |
1015
+ | autofocus | InputSignalWithTransform<boolean, unknown> | ... | When present, it specifies that the component should automatically get focus on load. |
1016
+ | autoZIndex | InputSignalWithTransform<boolean, unknown> | ... | Whether to automatically manage layering. |
1017
+ | baseZIndex | InputSignalWithTransform<number, unknown> | ... | Base zIndex value to use in layering. |
1018
+ | panelStyleClass | InputSignal<string> | ... | Style class of the datetimepicker container element. |
1019
+ | panelStyle | InputSignal<any> | ... | Inline style of the datetimepicker container element. |
1020
+ | keepInvalid | InputSignalWithTransform<boolean, unknown> | ... | Keep invalid value when input blur. |
1021
+ | hideOnDateTimeSelect | InputSignalWithTransform<boolean, unknown> | ... | Whether to hide the overlay on date selection. |
1022
+ | touchUI | InputSignalWithTransform<boolean, unknown> | ... | When enabled, datepicker overlay is displayed as optimized for touch devices. |
1023
+ | timeSeparator | InputSignal<string> | ... | Separator of time selector. |
1024
+ | focusTrap | InputSignalWithTransform<boolean, unknown> | ... | When enabled, can only focus on elements inside the datepicker. |
1025
+ | tabindex | InputSignalWithTransform<number, unknown> | ... | Index of the element in tabbing order. |
1026
+ | minDate | InputSignal<Date> | ... | The minimum selectable date. |
1027
+ | maxDate | InputSignal<Date> | ... | The maximum selectable date. |
1028
+ | disabledDates | InputSignal<Date[]> | ... | Array with dates that should be disabled (not selectable). |
1029
+ | disabledDays | InputSignal<number[]> | ... | Array with weekday numbers that should be disabled (not selectable). |
1030
+ | showTime | InputSignal<boolean> | ... | Whether to display timepicker. |
1031
+ | responsiveOptions | InputSignal<DatePickerResponsiveOptions[]> | ... | An array of options for responsive design. |
1032
+ | numberOfMonths | InputSignal<number> | ... | Number of months to display. |
1033
+ | firstDayOfWeek | InputSignal<number> | ... | Defines the first of the week for various date calculations. |
1034
+ | view | InputSignal<DatePickerTypeView> | ... | Type of view to display, valid values are "date" for datepicker and "month" for month picker. |
1035
+ | defaultDate | InputSignal<Date> | ... | Set the date to highlight on first opening if the field is blank. |
1036
+ | 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). |
1037
+ | motionOptions | InputSignal<MotionOptions> | ... | The motion options. |
1038
+
1039
+ ### Emits
1040
+
1041
+ | Name | Parameters | Description |
1042
+ |------|------------|-------------|
1043
+ | onFocus | event: Event | Callback to invoke on focus of input field. |
1044
+ | onBlur | event: Event | Callback to invoke on blur of input field. |
1045
+ | onClose | value: HTMLElement | Callback to invoke when date panel closed. |
1046
+ | onSelect | value: Date | Callback to invoke on date select. |
1047
+ | onClear | value: any | Callback to invoke when input field cleared. |
1048
+ | onInput | value: any | Callback to invoke when input field is being typed. |
1049
+ | onTodayClick | value: Date | Callback to invoke when today button is clicked. |
1050
+ | onClearClick | value: any | Callback to invoke when clear button is clicked. |
1051
+ | onMonthChange | event: DatePickerMonthChangeEvent | Callback to invoke when a month is changed using the navigators. |
1052
+ | onYearChange | event: DatePickerYearChangeEvent | Callback to invoke when a year is changed using the navigators. |
1053
+ | onClickOutside | value: any | Callback to invoke when clicked outside of the date panel. |
1054
+ | onShow | value: HTMLElement | Callback to invoke when datepicker panel is shown. |
1055
+
1056
+ ### Templates
1057
+
1058
+ | Name | Type | Description |
1059
+ |------|------|-------------|
1060
+ | date | TemplateRef<DatePickerDateTemplateContext> | Custom template for date cells. |
1061
+ | header | TemplateRef<void> | Custom template for header section. |
1062
+ | footer | TemplateRef<void> | Custom template for footer section. |
1063
+ | disableddate | TemplateRef<DatePickerDisabledDateTemplateContext> | Custom template for disabled date cells. |
1064
+ | decade | TemplateRef<DatePickerDecadeTemplateContext> | Custom template for decade view. |
1065
+ | previousicon | TemplateRef<void> | Custom template for previous month icon. |
1066
+ | nexticon | TemplateRef<void> | Custom template for next month icon. |
1067
+ | triggericon | TemplateRef<void> | Custom template for trigger icon. |
1068
+ | clearicon | TemplateRef<void> | Custom template for clear icon. |
1069
+ | decrementicon | TemplateRef<void> | Custom template for decrement icon. |
1070
+ | incrementicon | TemplateRef<void> | Custom template for increment icon. |
1071
+ | inputicon | TemplateRef<DatePickerInputIconTemplateContext> | Custom template for input icon. |
1072
+ | buttonbar | TemplateRef<DatePickerButtonBarTemplateContext> | Custom template for button bar. |
1073
+
1074
+ ## Pass Through Options
1075
+
1076
+ | Name | Type | Description |
1077
+ |------|------|-------------|
1078
+ | root | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the root's DOM element. |
1079
+ | pcInputText | InputTextPassThrough | Used to pass attributes to the InputText component. |
1080
+ | dropdown | PassThroughOption<HTMLButtonElement, I> | Used to pass attributes to the dropdown button's DOM element. |
1081
+ | dropdownIcon | PassThroughOption<SVGElement, I> | Used to pass attributes to the dropdown icon's DOM element. |
1082
+ | inputIconContainer | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the input icon container's DOM element. |
1083
+ | inputIcon | PassThroughOption<SVGElement, I> | Used to pass attributes to the input icon's DOM element. |
1084
+ | panel | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the panel's DOM element. |
1085
+ | calendarContainer | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the calendar container's DOM element. |
1086
+ | calendar | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the calendar's DOM element. |
1087
+ | header | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the header's DOM element. |
1088
+ | pcPrevButton | ButtonPassThrough | Used to pass attributes to the previous button component. |
1089
+ | title | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the title's DOM element. |
1090
+ | selectMonth | PassThroughOption<HTMLSelectElement, I> | Used to pass attributes to the select month's DOM element. |
1091
+ | selectYear | PassThroughOption<HTMLSelectElement, I> | Used to pass attributes to the select year's DOM element. |
1092
+ | decade | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the decade's DOM element. |
1093
+ | pcNextButton | ButtonPassThrough | Used to pass attributes to the next button component. |
1094
+ | dayView | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the day view's DOM element. |
1095
+ | table | PassThroughOption<HTMLTableElement, I> | Used to pass attributes to the table's DOM element. |
1096
+ | tableHeader | PassThroughOption<HTMLTableSectionElement, I> | Used to pass attributes to the table header's DOM element. |
1097
+ | tableHeaderRow | PassThroughOption<HTMLTableRowElement, I> | Used to pass attributes to the table header row's DOM element. |
1098
+ | weekHeader | PassThroughOption<HTMLTableCellElement, I> | Used to pass attributes to the week header's DOM element. |
1099
+ | weekHeaderLabel | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the week header label's DOM element. |
1100
+ | tableHeaderCell | PassThroughOption<HTMLTableCellElement, I> | Used to pass attributes to the table header cell's DOM element. |
1101
+ | weekDayCell | PassThroughOption<HTMLTableCellElement, I> | Used to pass attributes to the week day cell's DOM element. |
1102
+ | weekDay | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the week day's DOM element. |
1103
+ | tableBody | PassThroughOption<HTMLTableSectionElement, I> | Used to pass attributes to the table body's DOM element. |
1104
+ | tableBodyRow | PassThroughOption<HTMLTableRowElement, I> | Used to pass attributes to the table body row's DOM element. |
1105
+ | weekNumber | PassThroughOption<HTMLTableCellElement, I> | Used to pass attributes to the week number's DOM element. |
1106
+ | weekLabelContainer | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the week label container's DOM element. |
1107
+ | dayCell | PassThroughOption<HTMLTableCellElement, I> | Used to pass attributes to the day cell's DOM element. |
1108
+ | day | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the day's DOM element. |
1109
+ | monthView | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the month view's DOM element. |
1110
+ | month | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the month's DOM element. |
1111
+ | yearView | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the year view's DOM element. |
1112
+ | year | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the year's DOM element. |
1113
+ | timePicker | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the time picker's DOM element. |
1114
+ | hourPicker | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the hour picker's DOM element. |
1115
+ | hour | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the hour's DOM element. |
1116
+ | separatorContainer | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the separator container's DOM element. |
1117
+ | separator | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the separator's DOM element. |
1118
+ | minutePicker | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the minute picker's DOM element. |
1119
+ | minute | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the minute's DOM element. |
1120
+ | secondPicker | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the second picker's DOM element. |
1121
+ | second | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the second's DOM element. |
1122
+ | ampmPicker | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the ampm picker's DOM element. |
1123
+ | ampm | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the ampm's DOM element. |
1124
+ | buttonbar | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the buttonbar's DOM element. |
1125
+ | pcIncrementButton | ButtonPassThrough | Used to pass attributes to the increment button component. |
1126
+ | pcDecrementButton | ButtonPassThrough | Used to pass attributes to the decrement button component. |
1127
+ | pcTodayButton | ButtonPassThrough | Used to pass attributes to the today button component. |
1128
+ | pcClearButton | ButtonPassThrough | Used to pass attributes to the clear button component. |
1129
+ | hiddenSelectedDay | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the hidden selected day's DOM element. |
1130
+ | hiddenMonth | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the hidden month's DOM element. |
1131
+ | hiddenYear | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the hidden year's DOM element. |
1132
+ | motion | MotionOptions | Used to pass options to the motion component/directive. |
1133
+
1134
+ ## Theming
1135
+
1136
+ ### CSS Classes
1137
+
1138
+ | Class | Description |
1139
+ |-------|-------------|
1140
+ | p-datepicker | Class name of the root element |
1141
+ | p-datepicker-input | Class name of the input element |
1142
+ | p-datepicker-dropdown | Class name of the dropdown element |
1143
+ | p-datepicker-input-icon-container | Class name of the input icon container element |
1144
+ | p-datepicker-input-icon | Class name of the input icon element |
1145
+ | p-datepicker-panel | Class name of the panel element |
1146
+ | p-datepicker-calendar-container | Class name of the calendar container element |
1147
+ | p-datepicker-calendar | Class name of the calendar element |
1148
+ | p-datepicker-header | Class name of the header element |
1149
+ | p-datepicker-prev-button | Class name of the previous button element |
1150
+ | p-datepicker-title | Class name of the title element |
1151
+ | p-datepicker-select-month | Class name of the select month element |
1152
+ | p-datepicker-select-year | Class name of the select year element |
1153
+ | p-datepicker-decade | Class name of the decade element |
1154
+ | p-datepicker-next-button | Class name of the next button element |
1155
+ | p-datepicker-day-view | Class name of the day view element |
1156
+ | p-datepicker-weekheader | Class name of the week header element |
1157
+ | p-datepicker-weeknumber | Class name of the week number element |
1158
+ | p-datepicker-weeklabel-container | Class name of the week label container element |
1159
+ | p-datepicker-weekday-cell | Class name of the week day cell element |
1160
+ | p-datepicker-weekday | Class name of the week day element |
1161
+ | p-datepicker-day-cell | Class name of the day cell element |
1162
+ | p-datepicker-day | Class name of the day element |
1163
+ | p-datepicker-month-view | Class name of the month view element |
1164
+ | p-datepicker-month | Class name of the month element |
1165
+ | p-datepicker-year-view | Class name of the year view element |
1166
+ | p-datepicker-year | Class name of the year element |
1167
+ | p-datepicker-time-picker | Class name of the time picker element |
1168
+ | p-datepicker-hour-picker | Class name of the hour picker element |
1169
+ | p-datepicker-increment-button | Class name of the increment button element |
1170
+ | p-datepicker-decrement-button | Class name of the decrement button element |
1171
+ | p-datepicker-separator | Class name of the separator element |
1172
+ | p-datepicker-minute-picker | Class name of the minute picker element |
1173
+ | p-datepicker-second-picker | Class name of the second picker element |
1174
+ | p-datepicker-ampm-picker | Class name of the ampm picker element |
1175
+ | p-datepicker-buttonbar | Class name of the buttonbar element |
1176
+ | p-datepicker-today-button | Class name of the today button element |
1177
+ | p-datepicker-clear-button | Class name of the clear button element |
1178
+ | p-datepicker-clear-icon | Class name of the clear icon |
1179
+
1180
+ ### Design Tokens
1181
+
1182
+ | Token | CSS Variable | Description |
1183
+ |-------|--------------|-------------|
1184
+ | datepicker.transition.duration | --p-datepicker-transition-duration | Transition duration of root |
1185
+ | datepicker.panel.background | --p-datepicker-panel-background | Background of panel |
1186
+ | datepicker.panel.border.color | --p-datepicker-panel-border-color | Border color of panel |
1187
+ | datepicker.panel.color | --p-datepicker-panel-color | Color of panel |
1188
+ | datepicker.panel.border.radius | --p-datepicker-panel-border-radius | Border radius of panel |
1189
+ | datepicker.panel.shadow | --p-datepicker-panel-shadow | Shadow of panel |
1190
+ | datepicker.panel.padding | --p-datepicker-panel-padding | Padding of panel |
1191
+ | datepicker.header.background | --p-datepicker-header-background | Background of header |
1192
+ | datepicker.header.border.color | --p-datepicker-header-border-color | Border color of header |
1193
+ | datepicker.header.color | --p-datepicker-header-color | Color of header |
1194
+ | datepicker.header.padding | --p-datepicker-header-padding | Padding of header |
1195
+ | datepicker.title.gap | --p-datepicker-title-gap | Gap of title |
1196
+ | datepicker.title.font.weight | --p-datepicker-title-font-weight | Font weight of title |
1197
+ | datepicker.dropdown.width | --p-datepicker-dropdown-width | Width of dropdown |
1198
+ | datepicker.dropdown.sm.width | --p-datepicker-dropdown-sm-width | Sm width of dropdown |
1199
+ | datepicker.dropdown.lg.width | --p-datepicker-dropdown-lg-width | Lg width of dropdown |
1200
+ | datepicker.dropdown.border.color | --p-datepicker-dropdown-border-color | Border color of dropdown |
1201
+ | datepicker.dropdown.hover.border.color | --p-datepicker-dropdown-hover-border-color | Hover border color of dropdown |
1202
+ | datepicker.dropdown.active.border.color | --p-datepicker-dropdown-active-border-color | Active border color of dropdown |
1203
+ | datepicker.dropdown.border.radius | --p-datepicker-dropdown-border-radius | Border radius of dropdown |
1204
+ | datepicker.dropdown.focus.ring.width | --p-datepicker-dropdown-focus-ring-width | Focus ring width of dropdown |
1205
+ | datepicker.dropdown.focus.ring.style | --p-datepicker-dropdown-focus-ring-style | Focus ring style of dropdown |
1206
+ | datepicker.dropdown.focus.ring.color | --p-datepicker-dropdown-focus-ring-color | Focus ring color of dropdown |
1207
+ | datepicker.dropdown.focus.ring.offset | --p-datepicker-dropdown-focus-ring-offset | Focus ring offset of dropdown |
1208
+ | datepicker.dropdown.focus.ring.shadow | --p-datepicker-dropdown-focus-ring-shadow | Focus ring shadow of dropdown |
1209
+ | datepicker.dropdown.background | --p-datepicker-dropdown-background | Background of dropdown |
1210
+ | datepicker.dropdown.hover.background | --p-datepicker-dropdown-hover-background | Hover background of dropdown |
1211
+ | datepicker.dropdown.active.background | --p-datepicker-dropdown-active-background | Active background of dropdown |
1212
+ | datepicker.dropdown.color | --p-datepicker-dropdown-color | Color of dropdown |
1213
+ | datepicker.dropdown.hover.color | --p-datepicker-dropdown-hover-color | Hover color of dropdown |
1214
+ | datepicker.dropdown.active.color | --p-datepicker-dropdown-active-color | Active color of dropdown |
1215
+ | datepicker.input.icon.color | --p-datepicker-input-icon-color | Color of input icon |
1216
+ | datepicker.select.month.hover.background | --p-datepicker-select-month-hover-background | Hover background of select month |
1217
+ | datepicker.select.month.color | --p-datepicker-select-month-color | Color of select month |
1218
+ | datepicker.select.month.hover.color | --p-datepicker-select-month-hover-color | Hover color of select month |
1219
+ | datepicker.select.month.padding | --p-datepicker-select-month-padding | Padding of select month |
1220
+ | datepicker.select.month.border.radius | --p-datepicker-select-month-border-radius | Border radius of select month |
1221
+ | datepicker.select.year.hover.background | --p-datepicker-select-year-hover-background | Hover background of select year |
1222
+ | datepicker.select.year.color | --p-datepicker-select-year-color | Color of select year |
1223
+ | datepicker.select.year.hover.color | --p-datepicker-select-year-hover-color | Hover color of select year |
1224
+ | datepicker.select.year.padding | --p-datepicker-select-year-padding | Padding of select year |
1225
+ | datepicker.select.year.border.radius | --p-datepicker-select-year-border-radius | Border radius of select year |
1226
+ | datepicker.group.border.color | --p-datepicker-group-border-color | Border color of group |
1227
+ | datepicker.group.gap | --p-datepicker-group-gap | Gap of group |
1228
+ | datepicker.day.view.margin | --p-datepicker-day-view-margin | Margin of day view |
1229
+ | datepicker.week.day.padding | --p-datepicker-week-day-padding | Padding of week day |
1230
+ | datepicker.week.day.font.weight | --p-datepicker-week-day-font-weight | Font weight of week day |
1231
+ | datepicker.week.day.color | --p-datepicker-week-day-color | Color of week day |
1232
+ | datepicker.date.hover.background | --p-datepicker-date-hover-background | Hover background of date |
1233
+ | datepicker.date.selected.background | --p-datepicker-date-selected-background | Selected background of date |
1234
+ | datepicker.date.range.selected.background | --p-datepicker-date-range-selected-background | Range selected background of date |
1235
+ | datepicker.date.color | --p-datepicker-date-color | Color of date |
1236
+ | datepicker.date.hover.color | --p-datepicker-date-hover-color | Hover color of date |
1237
+ | datepicker.date.selected.color | --p-datepicker-date-selected-color | Selected color of date |
1238
+ | datepicker.date.range.selected.color | --p-datepicker-date-range-selected-color | Range selected color of date |
1239
+ | datepicker.date.width | --p-datepicker-date-width | Width of date |
1240
+ | datepicker.date.height | --p-datepicker-date-height | Height of date |
1241
+ | datepicker.date.border.radius | --p-datepicker-date-border-radius | Border radius of date |
1242
+ | datepicker.date.padding | --p-datepicker-date-padding | Padding of date |
1243
+ | datepicker.date.focus.ring.width | --p-datepicker-date-focus-ring-width | Focus ring width of date |
1244
+ | datepicker.date.focus.ring.style | --p-datepicker-date-focus-ring-style | Focus ring style of date |
1245
+ | datepicker.date.focus.ring.color | --p-datepicker-date-focus-ring-color | Focus ring color of date |
1246
+ | datepicker.date.focus.ring.offset | --p-datepicker-date-focus-ring-offset | Focus ring offset of date |
1247
+ | datepicker.date.focus.ring.shadow | --p-datepicker-date-focus-ring-shadow | Focus ring shadow of date |
1248
+ | datepicker.month.view.margin | --p-datepicker-month-view-margin | Margin of month view |
1249
+ | datepicker.month.padding | --p-datepicker-month-padding | Padding of month |
1250
+ | datepicker.month.border.radius | --p-datepicker-month-border-radius | Border radius of month |
1251
+ | datepicker.year.view.margin | --p-datepicker-year-view-margin | Margin of year view |
1252
+ | datepicker.year.padding | --p-datepicker-year-padding | Padding of year |
1253
+ | datepicker.year.border.radius | --p-datepicker-year-border-radius | Border radius of year |
1254
+ | datepicker.buttonbar.padding | --p-datepicker-buttonbar-padding | Padding of buttonbar |
1255
+ | datepicker.buttonbar.border.color | --p-datepicker-buttonbar-border-color | Border color of buttonbar |
1256
+ | datepicker.time.picker.padding | --p-datepicker-time-picker-padding | Padding of time picker |
1257
+ | datepicker.time.picker.border.color | --p-datepicker-time-picker-border-color | Border color of time picker |
1258
+ | datepicker.time.picker.gap | --p-datepicker-time-picker-gap | Gap of time picker |
1259
+ | datepicker.time.picker.button.gap | --p-datepicker-time-picker-button-gap | Button gap of time picker |
1260
+ | datepicker.today.background | --p-datepicker-today-background | Background of today |
1261
+ | datepicker.today.color | --p-datepicker-today-color | Color of today |
1262
+