primevue 3.9.1 → 3.10.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.
Files changed (195) hide show
  1. package/accordion/Accordion.d.ts +74 -11
  2. package/accordiontab/AccordionTab.d.ts +37 -8
  3. package/api/Api.d.ts +292 -285
  4. package/autocomplete/AutoComplete.d.ts +279 -62
  5. package/avatar/Avatar.d.ts +57 -8
  6. package/avatargroup/AvatarGroup.d.ts +29 -3
  7. package/badge/Badge.d.ts +46 -5
  8. package/blockui/BlockUI.d.ts +52 -11
  9. package/breadcrumb/Breadcrumb.d.ts +49 -9
  10. package/button/Button.d.ts +68 -11
  11. package/calendar/Calendar.d.ts +322 -62
  12. package/calendar/Calendar.vue +48 -20
  13. package/calendar/calendar.cjs.js +120 -93
  14. package/calendar/calendar.cjs.min.js +1 -1
  15. package/calendar/calendar.esm.js +120 -92
  16. package/calendar/calendar.esm.min.js +1 -1
  17. package/calendar/calendar.js +122 -94
  18. package/calendar/calendar.min.js +1 -1
  19. package/card/Card.d.ts +43 -9
  20. package/carousel/Carousel.d.ts +121 -24
  21. package/cascadeselect/CascadeSelect.d.ts +164 -31
  22. package/chart/Chart.d.ts +104 -12
  23. package/chart/Chart.vue +9 -2
  24. package/chart/chart.cjs.js +9 -2
  25. package/chart/chart.cjs.min.js +1 -1
  26. package/chart/chart.esm.js +9 -2
  27. package/chart/chart.esm.min.js +1 -1
  28. package/chart/chart.js +9 -2
  29. package/chart/chart.min.js +1 -1
  30. package/checkbox/Checkbox.d.ts +65 -7
  31. package/chip/Chip.d.ts +50 -4
  32. package/chips/Chips.d.ts +88 -15
  33. package/colorpicker/ColorPicker.d.ts +105 -16
  34. package/column/Column.d.ts +448 -78
  35. package/columngroup/ColumnGroup.d.ts +30 -4
  36. package/confirmationoptions/ConfirmationOptions.d.ts +50 -0
  37. package/confirmationoptions/package.json +3 -0
  38. package/confirmationservice/ConfirmationService.d.ts +2 -1
  39. package/confirmdialog/ConfirmDialog.d.ts +57 -5
  40. package/confirmpopup/ConfirmPopup.d.ts +38 -7
  41. package/contextmenu/ContextMenu.d.ts +88 -16
  42. package/core/core.js +364 -268
  43. package/core/core.min.js +2 -2
  44. package/datatable/BodyCell.vue +26 -1
  45. package/datatable/DataTable.d.ts +1056 -131
  46. package/datatable/DataTable.vue +102 -81
  47. package/datatable/HeaderCheckbox.vue +4 -1
  48. package/datatable/TableBody.vue +53 -14
  49. package/datatable/datatable.cjs.js +414 -307
  50. package/datatable/datatable.cjs.min.js +1 -1
  51. package/datatable/datatable.esm.js +414 -308
  52. package/datatable/datatable.esm.min.js +1 -1
  53. package/datatable/datatable.js +415 -309
  54. package/datatable/datatable.min.js +1 -1
  55. package/dataview/DataView.d.ts +198 -32
  56. package/dataviewlayoutoptions/DataViewLayoutOptions.d.ts +34 -5
  57. package/deferredcontent/DeferredContent.d.ts +31 -6
  58. package/dialog/Dialog.d.ts +188 -35
  59. package/divider/Divider.d.ts +53 -8
  60. package/dock/Dock.d.ts +92 -15
  61. package/dropdown/Dropdown.d.ts +335 -76
  62. package/editor/Editor.d.ts +78 -11
  63. package/fieldset/Fieldset.d.ts +63 -11
  64. package/fileupload/FileUpload.d.ts +255 -37
  65. package/fullcalendar/FullCalendar.d.ts +29 -3
  66. package/galleria/Galleria.d.ts +196 -46
  67. package/image/Image.d.ts +51 -6
  68. package/inlinemessage/InlineMessage.d.ts +34 -6
  69. package/inplace/Inplace.d.ts +57 -12
  70. package/inputmask/InputMask.d.ts +75 -15
  71. package/inputnumber/InputNumber.d.ts +180 -30
  72. package/inputswitch/InputSwitch.d.ts +61 -9
  73. package/inputtext/InputText.d.ts +34 -5
  74. package/knob/Knob.d.ts +92 -18
  75. package/listbox/Listbox.d.ts +240 -55
  76. package/megamenu/MegaMenu.d.ts +60 -12
  77. package/menu/Menu.d.ts +84 -15
  78. package/menubar/Menubar.d.ts +52 -11
  79. package/menuitem/MenuItem.d.ts +80 -0
  80. package/menuitem/package.json +3 -0
  81. package/message/Message.d.ts +57 -11
  82. package/multiselect/MultiSelect.d.ts +363 -83
  83. package/orderlist/OrderList.d.ts +122 -19
  84. package/organizationchart/OrganizationChart.d.ts +137 -15
  85. package/overlaypanel/OverlayPanel.d.ts +107 -12
  86. package/package.json +1 -1
  87. package/paginator/Paginator.d.ts +129 -27
  88. package/panel/Panel.d.ts +64 -9
  89. package/panelmenu/PanelMenu.d.ts +59 -11
  90. package/panelmenu/PanelMenu.vue +2 -2
  91. package/panelmenu/panelmenu.cjs.js +4 -4
  92. package/panelmenu/panelmenu.cjs.min.js +1 -1
  93. package/panelmenu/panelmenu.esm.js +4 -4
  94. package/panelmenu/panelmenu.esm.min.js +1 -1
  95. package/panelmenu/panelmenu.js +4 -4
  96. package/panelmenu/panelmenu.min.js +1 -1
  97. package/password/Password.d.ts +115 -24
  98. package/picklist/PickList.d.ts +199 -32
  99. package/progressbar/ProgressBar.d.ts +43 -8
  100. package/progressspinner/ProgressSpinner.d.ts +39 -6
  101. package/radiobutton/RadioButton.d.ts +51 -6
  102. package/rating/Rating.d.ts +67 -10
  103. package/resources/themes/arya-blue/theme.css +5 -1
  104. package/resources/themes/arya-green/theme.css +5 -1
  105. package/resources/themes/arya-orange/theme.css +5 -1
  106. package/resources/themes/arya-purple/theme.css +5 -1
  107. package/resources/themes/bootstrap4-dark-blue/theme.css +5 -1
  108. package/resources/themes/bootstrap4-dark-purple/theme.css +5 -1
  109. package/resources/themes/bootstrap4-light-blue/theme.css +5 -1
  110. package/resources/themes/bootstrap4-light-purple/theme.css +5 -1
  111. package/resources/themes/fluent-light/theme.css +5 -1
  112. package/resources/themes/lara-dark-blue/theme.css +43 -39
  113. package/resources/themes/lara-dark-indigo/theme.css +43 -39
  114. package/resources/themes/lara-dark-purple/theme.css +43 -39
  115. package/resources/themes/lara-dark-teal/theme.css +43 -39
  116. package/resources/themes/lara-light-blue/theme.css +5 -1
  117. package/resources/themes/lara-light-indigo/theme.css +5 -1
  118. package/resources/themes/lara-light-purple/theme.css +5 -1
  119. package/resources/themes/lara-light-teal/theme.css +5 -1
  120. package/resources/themes/luna-amber/theme.css +5 -1
  121. package/resources/themes/luna-blue/theme.css +5 -1
  122. package/resources/themes/luna-green/theme.css +5 -1
  123. package/resources/themes/luna-pink/theme.css +5 -1
  124. package/resources/themes/md-dark-deeppurple/theme.css +5 -1
  125. package/resources/themes/md-dark-indigo/theme.css +5 -1
  126. package/resources/themes/md-light-deeppurple/theme.css +5 -1
  127. package/resources/themes/md-light-indigo/theme.css +5 -1
  128. package/resources/themes/mdc-dark-deeppurple/theme.css +5 -1
  129. package/resources/themes/mdc-dark-indigo/theme.css +5 -1
  130. package/resources/themes/mdc-light-deeppurple/theme.css +5 -1
  131. package/resources/themes/mdc-light-indigo/theme.css +5 -1
  132. package/resources/themes/nova/theme.css +5 -1
  133. package/resources/themes/nova-accent/theme.css +5 -1
  134. package/resources/themes/nova-alt/theme.css +5 -1
  135. package/resources/themes/nova-vue/theme.css +5 -1
  136. package/resources/themes/rhea/theme.css +5 -1
  137. package/resources/themes/saga-blue/theme.css +5 -1
  138. package/resources/themes/saga-green/theme.css +5 -1
  139. package/resources/themes/saga-orange/theme.css +5 -1
  140. package/resources/themes/saga-purple/theme.css +5 -1
  141. package/resources/themes/tailwind-light/theme.css +5 -1
  142. package/resources/themes/vela-blue/theme.css +5 -1
  143. package/resources/themes/vela-green/theme.css +5 -1
  144. package/resources/themes/vela-orange/theme.css +5 -1
  145. package/resources/themes/vela-purple/theme.css +5 -1
  146. package/row/Row.d.ts +25 -3
  147. package/scrollpanel/ScrollPanel.d.ts +27 -5
  148. package/scrolltop/ScrollTop.d.ts +47 -7
  149. package/selectbutton/SelectButton.d.ts +101 -17
  150. package/sidebar/Sidebar.d.ts +81 -16
  151. package/skeleton/Skeleton.d.ts +58 -9
  152. package/slider/Slider.d.ts +90 -14
  153. package/speeddial/SpeedDial.d.ts +166 -29
  154. package/splitbutton/SplitButton.d.ts +71 -11
  155. package/splitter/Splitter.d.ts +74 -7
  156. package/splitterpanel/SplitterPanel.d.ts +34 -7
  157. package/steps/Steps.d.ts +51 -11
  158. package/tabmenu/TabMenu.d.ts +63 -10
  159. package/tabpanel/TabPanel.d.ts +34 -7
  160. package/tabview/TabView.d.ts +73 -11
  161. package/tag/Tag.d.ts +44 -8
  162. package/terminal/Terminal.d.ts +36 -5
  163. package/terminalservice/TerminalService.d.ts +1 -1
  164. package/textarea/Textarea.d.ts +38 -6
  165. package/tieredmenu/TieredMenu.d.ts +89 -15
  166. package/timeline/Timeline.d.ts +94 -15
  167. package/toast/Toast.d.ts +110 -12
  168. package/toastservice/ToastService.d.ts +17 -5
  169. package/togglebutton/ToggleButton.d.ts +64 -11
  170. package/toolbar/Toolbar.d.ts +31 -6
  171. package/tree/Tree.d.ts +189 -26
  172. package/treeselect/TreeSelect.d.ts +201 -44
  173. package/treetable/TreeTable.d.ts +459 -63
  174. package/tristatecheckbox/TriStateCheckbox.d.ts +39 -5
  175. package/ts-helpers.d.ts +28 -0
  176. package/useconfirm/UseConfirm.d.ts +5 -19
  177. package/usetoast/UseToast.d.ts +3 -5
  178. package/utils/Utils.d.ts +3 -0
  179. package/utils/utils.cjs.js +39 -2
  180. package/utils/utils.cjs.min.js +1 -1
  181. package/utils/utils.esm.js +39 -2
  182. package/utils/utils.esm.min.js +1 -1
  183. package/utils/utils.js +39 -2
  184. package/utils/utils.min.js +1 -1
  185. package/vetur-attributes.json +57 -25
  186. package/vetur-tags.json +11 -3
  187. package/virtualscroller/VirtualScroller.d.ts +294 -53
  188. package/virtualscroller/VirtualScroller.vue +296 -255
  189. package/virtualscroller/virtualscroller.cjs.js +325 -266
  190. package/virtualscroller/virtualscroller.cjs.min.js +1 -1
  191. package/virtualscroller/virtualscroller.esm.js +325 -266
  192. package/virtualscroller/virtualscroller.esm.min.js +1 -1
  193. package/virtualscroller/virtualscroller.js +325 -266
  194. package/virtualscroller/virtualscroller.min.js +1 -1
  195. package/web-types.json +153 -28
@@ -1,17 +1,74 @@
1
- interface ButtonProps {
1
+ import { ButtonHTMLAttributes, VNode } from 'vue';
2
+ import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
3
+
4
+ type ButtonIconPosType = 'left' | 'right' | 'top' | 'bottom' | undefined;
5
+
6
+ export interface ButtonProps extends ButtonHTMLAttributes {
7
+ /**
8
+ * Inline style of the button.
9
+ */
2
10
  style?: any;
3
- class?: string;
4
- label?: string;
5
- icon?: string;
6
- iconPos?: string;
7
- badge?: string;
8
- badgeClass?: string;
9
- loading?: boolean;
10
- loadingIcon?: string;
11
+ /**
12
+ * Style class of the button.
13
+ */
14
+ class?: string | undefined;
15
+ /**
16
+ * Text of the button.
17
+ */
18
+ label?: string | undefined;
19
+ /**
20
+ * Name of the icon.
21
+ */
22
+ icon?: string | undefined;
23
+ /**
24
+ * Position of the icon, valid values are 'left', 'right', 'bottom' and 'top'.
25
+ * Default value is 'left'.
26
+ */
27
+ iconPos?: ButtonIconPosType;
28
+ /**
29
+ * Value of the badge.
30
+ */
31
+ badge?: string | undefined;
32
+ /**
33
+ * Style class of the badge.
34
+ */
35
+ badgeClass?: string | undefined;
36
+ /**
37
+ * Whether the button is in loading state.
38
+ */
39
+ loading?: boolean | undefined;
40
+ /**
41
+ * Icon to display in loading state.
42
+ * Default value is 'pi pi-spinner pi-spin'.
43
+ */
44
+ loadingIcon?: string | undefined;
45
+ }
46
+
47
+ export interface ButtonSlots {
48
+ /**
49
+ * Custom content such as icons, images and text can be placed inside the button via the default slot. Note that when slot is used, label, icon and badge properties are not included.
50
+ */
51
+ default: () => VNode[];
11
52
  }
12
53
 
13
- declare class Button {
14
- $props: ButtonProps;
54
+ export declare type ButtonEmits = {
55
+ }
56
+
57
+ declare class Button extends ClassComponent<ButtonProps, ButtonSlots, ButtonEmits> { }
58
+
59
+ declare module '@vue/runtime-core' {
60
+ interface GlobalComponents {
61
+ Button: GlobalComponentConstructor<Button>
62
+ }
15
63
  }
16
64
 
65
+ /**
66
+ *
67
+ * Button is an extension to standard button element with icons and theming.
68
+ *
69
+ * Demos:
70
+ *
71
+ * - [Button](https://www.primefaces.org/primevue/showcase/#/button)
72
+ *
73
+ */
17
74
  export default Button;
@@ -1,75 +1,335 @@
1
1
  import { VNode } from 'vue';
2
+ import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
2
3
 
3
- interface CalendarProps {
4
- modelValue?: Date | Date[];
5
- selectionMode?: string;
6
- dateFormat?: string;
7
- inline?: boolean;
8
- showOtherMonths?: boolean;
9
- selectOtherMonths?: boolean;
10
- showIcon?: boolean;
11
- icon?: string;
12
- numberOfMonths?: number;
13
- responsiveOptions?: any[];
14
- view?: string;
15
- touchUI?: boolean;
16
- monthNavigator?: boolean;
17
- yearNavigator?: boolean;
18
- yearRange?: string;
19
- panelClass?: string;
20
- minDate?: Date;
21
- maxDate?: Date;
22
- disabledDates?: Date[];
23
- disabledDays?: number[];
24
- maxDateCount?: number;
25
- showOnFocus?: boolean;
26
- autoZIndex?: boolean;
27
- baseZIndex?: number;
28
- showButtonBar?: boolean;
29
- shortYearCutoff?: string;
30
- showTime?: boolean;
31
- timeOnly?: boolean;
32
- hourFormat?: string;
33
- stepHour?: number;
34
- stepMinute?: number;
35
- stepSecond?: number;
36
- showSeconds?: boolean;
37
- hideOnDateTimeSelect?: boolean;
38
- timeSeparator?: string;
39
- showWeek?: boolean;
40
- manualInput?: boolean;
41
- appendTo?: string;
4
+ type CalendarValueType = Date | Date[] | undefined;
5
+
6
+ type CalendarSelectionModeType = 'single' | 'multiple' | 'range' | undefined;
7
+
8
+ type CalendarViewType = 'date' | 'month' | 'year' | undefined;
9
+
10
+ type CalendarHourFormatType = '12' | '24' | undefined;
11
+
12
+ type CalendarAppendToType = 'body' | 'self' | string | undefined;
13
+
14
+ export interface CalendarResponsiveOptions {
15
+ /**
16
+ * Breakpoint for responsive mode. Exp; @media screen and (max-width: ${breakpoint}) {...}
17
+ */
18
+ breakpoint: string;
19
+ /**
20
+ * The number of visible months on breakpoint.
21
+ */
22
+ numMonths: number;
23
+ }
24
+
25
+ export interface CalendarMonthChangeEvent {
26
+ /**
27
+ * New month.
28
+ */
29
+ month: number;
30
+ /**
31
+ * New year.
32
+ */
33
+ year: number;
34
+ }
35
+
36
+ export interface CalendarYearChangeEvent {
37
+ /**
38
+ * New month.
39
+ */
40
+ month: number;
41
+ /**
42
+ * New year.
43
+ */
44
+ year: number;
45
+ }
46
+
47
+ export interface CalendarProps {
48
+ /**
49
+ * Value of the component.
50
+ */
51
+ modelValue?: CalendarValueType;
52
+ /**
53
+ * Defines the quantity of the selection, valid values are 'single', 'multiple' and 'range'.
54
+ * @see CalendarSelectionModeType
55
+ * Default value is 'single'.
56
+ */
57
+ selectionMode?: CalendarSelectionModeType;
58
+ /**
59
+ * Format of the date. Defaults to PrimeVue Locale configuration.
60
+ */
61
+ dateFormat?: string | undefined;
62
+ /**
63
+ * When enabled, displays the calendar as inline instead of an overlay.
64
+ */
65
+ inline?: boolean | undefined;
66
+ /**
67
+ * 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.
68
+ * Default value is true.
69
+ */
70
+ showOtherMonths?: boolean | undefined;
71
+ /**
72
+ * 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.
73
+ */
74
+ selectOtherMonths?: boolean | undefined;
75
+ /**
76
+ * When enabled, displays a button with icon next to input.
77
+ */
78
+ showIcon?: boolean | undefined;
79
+ /**
80
+ * Icon of the calendar button.
81
+ * Default value is 'pi pi-calendar'.
82
+ */
83
+ icon?: string | undefined;
84
+ /**
85
+ * Number of months to display.
86
+ * Default value is 1.
87
+ */
88
+ numberOfMonths?: number | undefined;
89
+ /**
90
+ * An array of options for responsive design.
91
+ * @see CalendarResponsiveOptions
92
+ */
93
+ responsiveOptions?: CalendarResponsiveOptions[];
94
+ /**
95
+ * Type of view to display, valid values are 'date', 'month' and 'year'.
96
+ * @see CalendarViewType
97
+ * Default value is 'date'.
98
+ */
99
+ view?: CalendarViewType;
100
+ /**
101
+ * When enabled, calendar overlay is displayed as optimized for touch devices.
102
+ */
103
+ touchUI?: boolean | undefined;
104
+ /**
105
+ * Whether the month should be rendered as a dropdown instead of text.
106
+ *
107
+ * @deprecated since version 3.9.0, Navigator is always on.
108
+ */
109
+ monthNavigator?: boolean | undefined;
110
+ /**
111
+ * Whether the year should be rendered as a dropdown instead of text.
112
+ *
113
+ * @deprecated since version 3.9.0, Navigator is always on.
114
+ */
115
+ yearNavigator?: boolean | undefined;
116
+ /**
117
+ * The range of years displayed in the year drop-down in (nnnn:nnnn) format such as (2000:2020).
118
+ *
119
+ * @deprecated since version 3.9.0, Years are based on decades by default.
120
+ */
121
+ yearRange?: string | undefined;
122
+ /**
123
+ * Style class of the datetimepicker panel.
124
+ */
125
+ panelClass?: string | undefined;
126
+ /**
127
+ * The minimum selectable date.
128
+ */
129
+ minDate?: Date | undefined;
130
+ /**
131
+ * The maximum selectable date.
132
+ */
133
+ maxDate?: Date | undefined;
134
+ /**
135
+ * Array with dates to disable.
136
+ */
137
+ disabledDates?: Date[] | undefined;
138
+ /**
139
+ * Array with disabled weekday numbers.
140
+ */
141
+ disabledDays?: number[] | undefined;
142
+ /**
143
+ * Maximum number of selectable dates in multiple mode.
144
+ */
145
+ maxDateCount?: number | undefined;
146
+ /**
147
+ * When disabled, datepicker will not be visible with input focus.
148
+ * Default value is true.
149
+ */
150
+ showOnFocus?: boolean | undefined;
151
+ /**
152
+ * Whether to automatically manage layering.
153
+ * Default value is true.
154
+ */
155
+ autoZIndex?: boolean | undefined;
156
+ /**
157
+ * Base zIndex value to use in layering.
158
+ * Default value is 0.
159
+ */
160
+ baseZIndex?: number | undefined;
161
+ /**
162
+ * Whether to display today and clear buttons at the footer.
163
+ */
164
+ showButtonBar?: boolean | undefined;
165
+ /**
166
+ * The cutoff year for determining the century for a date.
167
+ * Default value is +10.
168
+ */
169
+ shortYearCutoff?: string | undefined;
170
+ /**
171
+ * Whether to display timepicker.
172
+ */
173
+ showTime?: boolean | undefined;
174
+ /**
175
+ * Whether to display timepicker only.
176
+ */
177
+ timeOnly?: boolean | undefined;
178
+ /**
179
+ * Specifies 12 or 24 hour format.
180
+ */
181
+ hourFormat?: CalendarHourFormatType;
182
+ /**
183
+ * Hours to change per step.
184
+ * Default value is 1.
185
+ */
186
+ stepHour?: number | undefined;
187
+ /**
188
+ * Minutes to change per step.
189
+ * Default value is 1.
190
+ */
191
+ stepMinute?: number | undefined;
192
+ /**
193
+ * Seconds to change per step.
194
+ * Default value is 1.
195
+ */
196
+ stepSecond?: number | undefined;
197
+ /**
198
+ * Whether to show the seconds in time picker.
199
+ */
200
+ showSeconds?: boolean | undefined;
201
+ /**
202
+ * Whether to hide the overlay on date selection when showTime is enabled.
203
+ */
204
+ hideOnDateTimeSelect?: boolean | undefined;
205
+ /**
206
+ * Separator of time selector.
207
+ * Default value is ':'.
208
+ */
209
+ timeSeparator?: string | undefined;
210
+ /**
211
+ * When enabled, calendar will show week numbers.
212
+ */
213
+ showWeek?: boolean | undefined;
214
+ /**
215
+ * Wheter to allow prevents entering the date manually via typing.
216
+ * Default value is true.
217
+ */
218
+ manualInput?: boolean | undefined;
219
+ /**
220
+ * A valid query selector or an HTMLElement to specify where the overlay gets attached. Special keywords are 'body' for document body and 'self' for the element itself.
221
+ * Default value is 'body'.
222
+ */
223
+ appendTo?: CalendarAppendToType;
224
+ /**
225
+ * Inline style of the input field.
226
+ */
42
227
  inputStyle?: any;
43
- inputClass?: string;
228
+ /**
229
+ * Style class of the input field.
230
+ */
231
+ inputClass?: string | undefined;
232
+ /**
233
+ * Inline style of the component.
234
+ */
44
235
  style?: any;
45
- class?: string;
46
- keepInvalid?: boolean;
236
+ /**
237
+ * Style class of the component.
238
+ */
239
+ class?: string | undefined;
240
+ /**
241
+ * Keep invalid value when input blur.
242
+ */
243
+ keepInvalid?: boolean | undefined;
47
244
  }
48
245
 
49
- interface CalendarDateSlotInterface {
50
- date: any;
246
+ export interface CalendarSlots {
247
+ /**
248
+ * Custom header template of panel.
249
+ */
250
+ header: () => VNode[];
251
+ /**
252
+ * Custom footer template of panel.
253
+ */
254
+ footer: () => VNode[];
255
+ /**
256
+ * Custom date template.
257
+ * @param {Object} scope - date slot's params.
258
+ */
259
+ date: (scope: {
260
+ /**
261
+ * Value of the component.
262
+ */
263
+ date: CalendarValueType;
264
+ }) => VNode[];
265
+ /**
266
+ * Custom decade template.
267
+ * @param {CalendarDecadeSlot} scope - decade slot's params.
268
+ */
269
+ decade: (scope: {
270
+ /**
271
+ * An array containing the start and and year of a decade to display at header of the year picker.
272
+ */
273
+ years: string[] | undefined;
274
+ }) => VNode[];
51
275
  }
52
276
 
53
- interface CalendarDecadeSlotInterface {
54
- years: any;
277
+ export declare type CalendarEmits = {
278
+ /**
279
+ * Emitted when the value changes.
280
+ * @param {CalendarValueType} value - New value.
281
+ */
282
+ 'update:modelValue': (value: CalendarValueType) => void;
283
+ /**
284
+ * Callback to invoke when a date is selected.
285
+ * @param {Date} value - Selected value.
286
+ */
287
+ 'date-select': (value: Date) => void;
288
+ /**
289
+ * Callback to invoke when datepicker panel is shown.
290
+ */
291
+ 'show': () => void;
292
+ /**
293
+ * Callback to invoke when datepicker panel is hidden.
294
+ */
295
+ 'hide': () => void;
296
+ /**
297
+ * Callback to invoke when today button is clicked.
298
+ * @param {Date} date - Today as a date instance.
299
+ */
300
+ 'today-click': (date: Date) => void;
301
+ /**
302
+ * Callback to invoke when clear button is clicked.
303
+ * @param {Event} event - Browser event.
304
+ */
305
+ 'clear-click': (event: Event) => void;
306
+ /**
307
+ * Callback to invoke when a month is changed using the navigators.
308
+ * @param {CalendarMonthChangeEvent} event - Custom month change event.
309
+ */
310
+ 'month-change': (event: CalendarMonthChangeEvent) => void;
311
+ /**
312
+ * Callback to invoke when a year is changed using the navigators.
313
+ * @param {CalendarYearChangeEvent} event - Custom year change event.
314
+ */
315
+ 'year-change': (event: CalendarYearChangeEvent) => void;
55
316
  }
56
317
 
57
- declare class Calendar {
58
- $props: CalendarProps;
59
- $emit(eventName: 'update:modelValue', value: Date | Date[]): this;
60
- $emit(eventName: 'show'): this;
61
- $emit(eventName: 'hide'): this;
62
- $emit(eventName: 'month-change', e: { month: number, year: number }): this;
63
- $emit(eventName: 'year-change', e: { month: number, year: number }): this;
64
- $emit(eventName: 'date-select', value: Date): this;
65
- $emit(eventName: 'today-click', value: Date): this;
66
- $emit(eventName: 'clear-click', event: Event): this;
67
- $slots: {
68
- header: VNode[];
69
- date: CalendarDateSlotInterface;
70
- footer: VNode[];
71
- decade: CalendarDecadeSlotInterface;
72
- };
318
+ declare class Calendar extends ClassComponent<CalendarProps, CalendarSlots, CalendarEmits> { }
319
+
320
+ declare module '@vue/runtime-core' {
321
+ interface GlobalComponents {
322
+ Calendar: GlobalComponentConstructor<Calendar>
323
+ }
73
324
  }
74
325
 
326
+ /**
327
+ *
328
+ * Calendar is an input component to select a date.
329
+ *
330
+ * Demos:
331
+ *
332
+ * - [Calendar](https://www.primefaces.org/primevue/showcase/#/calendar)
333
+ *
334
+ */
75
335
  export default Calendar;
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <span ref="container" :class="containerClass" :style="style">
3
- <CalendarInputText ref="input" v-if="!inline" type="text" v-bind="$attrs" :value="inputFieldValue" @input="onInput" @focus="onFocus" @blur="onBlur" @keydown="onKeyDown" :readonly="!manualInput" inputmode="none"
4
- :class="inputClass" :style="inputStyle" />
3
+ <input :ref="inputRef" v-if="!inline" type="text" :class="['p-inputtext p-component', inputClass]" :style="inputStyle" @input="onInput" v-bind="$attrs"
4
+ @focus="onFocus" @blur="onBlur" @keydown="onKeyDown" :readonly="!manualInput" inputmode="none">
5
5
  <CalendarButton v-if="showIcon" :icon="icon" tabindex="-1" class="p-datepicker-trigger" :disabled="$attrs.disabled" @click="onButtonClick" type="button" :aria-label="inputFieldValue"/>
6
6
  <Teleport :to="appendTarget" :disabled="appendDisabled">
7
7
  <transition name="p-connected-overlay" @enter="onOverlayEnter($event)" @after-enter="onOverlayEnterComplete" @after-leave="onOverlayAfterLeave" @leave="onOverlayLeave">
@@ -15,10 +15,10 @@
15
15
  <span class="p-datepicker-prev-icon pi pi-chevron-left"></span>
16
16
  </button>
17
17
  <div class="p-datepicker-title">
18
- <button type="button" @click="switchToMonthView" v-if="currentView === 'date'" class="p-datepicker-month p-link" :disabled="switchViewButtonDisabled">
18
+ <button type="button" @click="switchToMonthView" @keydown="onContainerButtonKeydown" v-if="currentView === 'date'" class="p-datepicker-month p-link" :disabled="switchViewButtonDisabled">
19
19
  {{getMonthName(month.month)}}
20
20
  </button>
21
- <button type="button" @click="switchToYearView" v-if="currentView !== 'year'" class="p-datepicker-year p-link" :disabled="switchViewButtonDisabled">
21
+ <button type="button" @click="switchToYearView" @keydown="onContainerButtonKeydown" v-if="currentView !== 'year'" class="p-datepicker-year p-link" :disabled="switchViewButtonDisabled">
22
22
  {{currentYear}}
23
23
  </button>
24
24
  <span class="p-datepicker-decade" v-if="currentView === 'year'">
@@ -144,7 +144,6 @@
144
144
  <script>
145
145
  import {ConnectedOverlayScrollHandler,DomHandler,ZIndexUtils,UniqueComponentId} from 'primevue/utils';
146
146
  import OverlayEventBus from 'primevue/overlayeventbus';
147
- import InputText from 'primevue/inputtext';
148
147
  import Button from 'primevue/button';
149
148
  import Ripple from 'primevue/ripple';
150
149
 
@@ -315,8 +314,11 @@ export default {
315
314
  maskClickListener: null,
316
315
  resizeListener: null,
317
316
  overlay: null,
317
+ input: null,
318
318
  mask: null,
319
319
  timePickerTimer: null,
320
+ preventFocus: false,
321
+ typeUpdate: false,
320
322
  created() {
321
323
  this.updateCurrentMetaData();
322
324
  },
@@ -334,15 +336,19 @@ export default {
334
336
  }
335
337
  }
336
338
  }
339
+ else {
340
+ this.input.value = this.formatValue(this.modelValue);
341
+ }
337
342
  },
338
343
  updated() {
339
344
  if (this.overlay) {
345
+ this.preventFocus = true;
340
346
  this.updateFocus();
341
347
  }
342
348
 
343
- if (this.$refs.input && this.selectionStart != null && this.selectionEnd != null) {
344
- this.$refs.input.$el.selectionStart = this.selectionStart;
345
- this.$refs.input.$el.selectionEnd = this.selectionEnd;
349
+ if (this.input && this.selectionStart != null && this.selectionEnd != null) {
350
+ this.input.selectionStart = this.selectionStart;
351
+ this.input.selectionEnd = this.selectionEnd;
346
352
  this.selectionStart = null;
347
353
  this.selectionEnd = null;
348
354
  }
@@ -384,15 +390,21 @@ export default {
384
390
  }
385
391
  },
386
392
  watch: {
387
- modelValue() {
393
+ modelValue(newValue) {
388
394
  this.updateCurrentMetaData();
395
+ if (!this.typeUpdate && !this.inline && this.input) {
396
+ this.input.value = this.formatValue(newValue);
397
+ }
398
+ this.typeUpdate = false;
389
399
  },
390
400
  showTime() {
391
401
  this.updateCurrentMetaData();
392
402
  },
393
403
  months() {
394
404
  if (this.overlay) {
395
- setTimeout(this.updateFocus, 0);
405
+ if (!this.focused) {
406
+ setTimeout(this.updateFocus, 0);
407
+ }
396
408
  }
397
409
  },
398
410
  numberOfMonths() {
@@ -441,10 +453,22 @@ export default {
441
453
  return false;
442
454
  },
443
455
  isMonthSelected(month) {
444
- return this.isComparable() ? (this.modelValue.getMonth() === month && this.modelValue.getFullYear() === this.currentYear) : false;
456
+ if (this.isComparable()) {
457
+ let value = this.isRangeSelection() ? this.modelValue[0] : this.modelValue;
458
+
459
+ return !this.isMultipleSelection() ? (value.getMonth() === month && value.getFullYear() === this.currentYear) : false;
460
+ }
461
+
462
+ return false;
445
463
  },
446
464
  isYearSelected(year) {
447
- return this.isComparable() ? (this.modelValue.getFullYear() === year) : false;
465
+ if (this.isComparable()) {
466
+ let value = this.isRangeSelection() ? this.modelValue[0] : this.modelValue;
467
+
468
+ return !this.isMultipleSelection() && this.isComparable() ? (value.getFullYear() === year) : false;
469
+ }
470
+
471
+ return false;
448
472
  },
449
473
  isDateEquals(value, dateMeta) {
450
474
  if (value)
@@ -788,7 +812,7 @@ export default {
788
812
  onButtonClick() {
789
813
  if (this.isEnabled()) {
790
814
  if (!this.overlayVisible) {
791
- this.$refs.input.$el.focus();
815
+ this.input.focus();
792
816
  this.overlayVisible = true;
793
817
  }
794
818
  else {
@@ -2086,9 +2110,11 @@ export default {
2086
2110
  if (cell) {
2087
2111
  cell.tabIndex = '0';
2088
2112
 
2089
- if ((!this.navigationState || !this.navigationState.button) && !this.timePickerChange) {
2113
+ if (!this.preventFocus && (!this.navigationState || !this.navigationState.button) && !this.timePickerChange) {
2090
2114
  cell.focus();
2091
2115
  }
2116
+
2117
+ this.preventFocus = false;
2092
2118
  }
2093
2119
  },
2094
2120
  trapFocus(event) {
@@ -2137,18 +2163,17 @@ export default {
2137
2163
  },
2138
2164
  onInput(event) {
2139
2165
  try {
2140
- this.selectionStart = this.$refs.input.$el.selectionStart;
2141
- this.selectionEnd = this.$refs.input.$el.selectionEnd;
2166
+ this.selectionStart = this.input.selectionStart;
2167
+ this.selectionEnd = this.input.selectionEnd;
2142
2168
 
2143
2169
  let value = this.parseValue(event.target.value);
2144
2170
  if (this.isValidSelection(value)) {
2171
+ this.typeUpdate = true;
2145
2172
  this.updateModel(value);
2146
2173
  }
2147
2174
  }
2148
2175
  catch(err) {
2149
- if (this.keepInvalid) {
2150
- this.updateModel(event.target.value);
2151
- }
2176
+ /* NoOp */
2152
2177
  }
2153
2178
  },
2154
2179
  onFocus() {
@@ -2159,6 +2184,7 @@ export default {
2159
2184
  },
2160
2185
  onBlur() {
2161
2186
  this.focused = false;
2187
+ this.input.value = this.formatValue(this.modelValue);
2162
2188
  },
2163
2189
  onKeyDown() {
2164
2190
  if (event.keyCode === 40 && this.overlay) {
@@ -2183,6 +2209,9 @@ export default {
2183
2209
  overlayRef(el) {
2184
2210
  this.overlay = el;
2185
2211
  },
2212
+ inputRef(el) {
2213
+ this.input = el;
2214
+ },
2186
2215
  getMonthName(index) {
2187
2216
  return this.$primevue.config.locale.monthNames[index];
2188
2217
  },
@@ -2459,7 +2488,6 @@ export default {
2459
2488
  }
2460
2489
  },
2461
2490
  components: {
2462
- 'CalendarInputText': InputText,
2463
2491
  'CalendarButton': Button
2464
2492
  },
2465
2493
  directives: {