primevue 3.16.2 → 3.17.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 (797) hide show
  1. package/README.md +2 -1
  2. package/accordion/Accordion.d.ts +23 -5
  3. package/accordion/Accordion.vue +194 -77
  4. package/accordion/accordion.cjs.js +202 -96
  5. package/accordion/accordion.cjs.min.js +1 -1
  6. package/accordion/accordion.esm.js +200 -98
  7. package/accordion/accordion.esm.min.js +1 -1
  8. package/accordion/accordion.js +203 -98
  9. package/accordion/accordion.min.js +1 -1
  10. package/accordiontab/AccordionTab.d.ts +33 -5
  11. package/accordiontab/AccordionTab.vue +8 -1
  12. package/accordiontab/accordiontab.cjs.js +7 -0
  13. package/accordiontab/accordiontab.cjs.min.js +1 -1
  14. package/accordiontab/accordiontab.esm.js +7 -0
  15. package/accordiontab/accordiontab.esm.min.js +1 -1
  16. package/accordiontab/accordiontab.js +7 -0
  17. package/accordiontab/accordiontab.min.js +1 -1
  18. package/api/Api.d.ts +1 -1
  19. package/api/api.cjs.js +299 -313
  20. package/api/api.esm.js +299 -313
  21. package/api/api.js +299 -313
  22. package/autocomplete/AutoComplete.d.ts +22 -17
  23. package/autocomplete/AutoComplete.vue +239 -126
  24. package/autocomplete/autocomplete.cjs.js +145 -108
  25. package/autocomplete/autocomplete.cjs.min.js +1 -1
  26. package/autocomplete/autocomplete.esm.js +146 -109
  27. package/autocomplete/autocomplete.esm.min.js +1 -1
  28. package/autocomplete/autocomplete.js +145 -108
  29. package/autocomplete/autocomplete.min.js +1 -1
  30. package/avatar/Avatar.d.ts +4 -4
  31. package/avatar/Avatar.vue +15 -11
  32. package/avatar/avatar.cjs.js +11 -7
  33. package/avatar/avatar.cjs.min.js +1 -1
  34. package/avatar/avatar.esm.js +11 -7
  35. package/avatar/avatar.esm.min.js +1 -1
  36. package/avatar/avatar.js +11 -7
  37. package/avatar/avatar.min.js +1 -1
  38. package/avatargroup/AvatarGroup.d.ts +6 -9
  39. package/avatargroup/AvatarGroup.vue +1 -1
  40. package/badge/Badge.d.ts +4 -5
  41. package/badge/Badge.vue +16 -13
  42. package/badge/badge.cjs.js +14 -11
  43. package/badge/badge.esm.js +14 -11
  44. package/badge/badge.js +14 -11
  45. package/badgedirective/badgedirective.cjs.js +8 -10
  46. package/badgedirective/badgedirective.esm.js +8 -10
  47. package/badgedirective/badgedirective.js +8 -10
  48. package/blockui/BlockUI.d.ts +6 -6
  49. package/blockui/BlockUI.vue +13 -15
  50. package/blockui/blockui.cjs.js +11 -13
  51. package/blockui/blockui.cjs.min.js +1 -1
  52. package/blockui/blockui.esm.js +11 -13
  53. package/blockui/blockui.esm.min.js +1 -1
  54. package/blockui/blockui.js +11 -13
  55. package/blockui/blockui.min.js +1 -1
  56. package/breadcrumb/Breadcrumb.d.ts +5 -6
  57. package/breadcrumb/Breadcrumb.vue +2 -2
  58. package/breadcrumb/BreadcrumbItem.vue +18 -15
  59. package/breadcrumb/breadcrumb.cjs.js +15 -12
  60. package/breadcrumb/breadcrumb.esm.js +15 -12
  61. package/breadcrumb/breadcrumb.js +15 -12
  62. package/button/Button.d.ts +10 -7
  63. package/button/Button.vue +22 -14
  64. package/button/button.cjs.js +19 -11
  65. package/button/button.cjs.min.js +1 -1
  66. package/button/button.esm.js +19 -11
  67. package/button/button.esm.min.js +1 -1
  68. package/button/button.js +19 -11
  69. package/button/button.min.js +1 -1
  70. package/calendar/Calendar.d.ts +14 -14
  71. package/calendar/Calendar.vue +793 -583
  72. package/calendar/calendar.cjs.js +581 -526
  73. package/calendar/calendar.cjs.min.js +1 -1
  74. package/calendar/calendar.esm.js +581 -526
  75. package/calendar/calendar.esm.min.js +1 -1
  76. package/calendar/calendar.js +581 -526
  77. package/calendar/calendar.min.js +1 -1
  78. package/card/Card.d.ts +5 -7
  79. package/card/Card.vue +5 -5
  80. package/carousel/Carousel.d.ts +29 -19
  81. package/carousel/Carousel.vue +537 -528
  82. package/carousel/carousel.cjs.js +496 -493
  83. package/carousel/carousel.cjs.min.js +1 -1
  84. package/carousel/carousel.esm.js +496 -493
  85. package/carousel/carousel.esm.min.js +1 -1
  86. package/carousel/carousel.js +645 -642
  87. package/carousel/carousel.min.js +1 -1
  88. package/cascadeselect/CascadeSelect.d.ts +19 -14
  89. package/cascadeselect/CascadeSelect.vue +186 -100
  90. package/cascadeselect/CascadeSelectSub.vue +44 -14
  91. package/cascadeselect/cascadeselect.cjs.js +156 -95
  92. package/cascadeselect/cascadeselect.cjs.min.js +1 -1
  93. package/cascadeselect/cascadeselect.esm.js +157 -96
  94. package/cascadeselect/cascadeselect.esm.min.js +1 -1
  95. package/cascadeselect/cascadeselect.js +156 -95
  96. package/cascadeselect/cascadeselect.min.js +1 -1
  97. package/chart/Chart.d.ts +6 -7
  98. package/chart/Chart.vue +12 -12
  99. package/chart/chart.cjs.js +11 -11
  100. package/chart/chart.cjs.min.js +1 -1
  101. package/chart/chart.esm.js +11 -11
  102. package/chart/chart.esm.min.js +1 -1
  103. package/chart/chart.js +11 -11
  104. package/chart/chart.min.js +1 -1
  105. package/checkbox/Checkbox.d.ts +12 -12
  106. package/checkbox/Checkbox.vue +48 -20
  107. package/checkbox/checkbox.cjs.js +28 -17
  108. package/checkbox/checkbox.cjs.min.js +1 -1
  109. package/checkbox/checkbox.esm.js +28 -17
  110. package/checkbox/checkbox.esm.min.js +1 -1
  111. package/checkbox/checkbox.js +28 -17
  112. package/checkbox/checkbox.min.js +1 -1
  113. package/chip/Chip.d.ts +5 -5
  114. package/chip/Chip.vue +13 -11
  115. package/chip/chip.cjs.js +7 -4
  116. package/chip/chip.esm.js +7 -4
  117. package/chip/chip.js +7 -4
  118. package/chips/Chips.d.ts +9 -9
  119. package/chips/Chips.vue +89 -33
  120. package/chips/chips.cjs.js +48 -26
  121. package/chips/chips.cjs.min.js +1 -1
  122. package/chips/chips.esm.js +48 -26
  123. package/chips/chips.esm.min.js +1 -1
  124. package/chips/chips.js +48 -26
  125. package/chips/chips.min.js +1 -1
  126. package/colorpicker/ColorPicker.d.ts +11 -12
  127. package/colorpicker/ColorPicker.vue +146 -110
  128. package/colorpicker/colorpicker.cjs.js +113 -74
  129. package/colorpicker/colorpicker.cjs.min.js +1 -1
  130. package/colorpicker/colorpicker.esm.js +113 -74
  131. package/colorpicker/colorpicker.esm.min.js +1 -1
  132. package/colorpicker/colorpicker.js +113 -74
  133. package/colorpicker/colorpicker.min.js +1 -1
  134. package/column/Column.d.ts +5 -6
  135. package/column/Column.vue +1 -1
  136. package/columngroup/ColumnGroup.d.ts +5 -7
  137. package/columngroup/ColumnGroup.vue +1 -1
  138. package/config/PrimeVue.d.ts +4 -2
  139. package/config/config.cjs.js +14 -29
  140. package/config/config.cjs.min.js +1 -1
  141. package/config/config.esm.js +14 -29
  142. package/config/config.esm.min.js +1 -1
  143. package/config/config.js +14 -29
  144. package/config/config.min.js +1 -1
  145. package/confirmationoptions/ConfirmationOptions.d.ts +4 -0
  146. package/confirmationservice/confirmationservice.cjs.js +1 -0
  147. package/confirmationservice/confirmationservice.esm.js +1 -0
  148. package/confirmationservice/confirmationservice.js +1 -0
  149. package/confirmdialog/ConfirmDialog.d.ts +11 -5
  150. package/confirmdialog/ConfirmDialog.vue +25 -15
  151. package/confirmdialog/confirmdialog.cjs.js +34 -16
  152. package/confirmdialog/confirmdialog.cjs.min.js +1 -1
  153. package/confirmdialog/confirmdialog.esm.js +34 -16
  154. package/confirmdialog/confirmdialog.esm.min.js +1 -1
  155. package/confirmdialog/confirmdialog.js +35 -17
  156. package/confirmdialog/confirmdialog.min.js +1 -1
  157. package/confirmpopup/ConfirmPopup.d.ts +5 -8
  158. package/confirmpopup/ConfirmPopup.vue +44 -32
  159. package/confirmpopup/confirmpopup.cjs.js +24 -14
  160. package/confirmpopup/confirmpopup.cjs.min.js +1 -1
  161. package/confirmpopup/confirmpopup.esm.js +24 -14
  162. package/confirmpopup/confirmpopup.esm.min.js +1 -1
  163. package/confirmpopup/confirmpopup.js +24 -14
  164. package/confirmpopup/confirmpopup.min.js +1 -1
  165. package/contextmenu/ContextMenu.d.ts +4 -5
  166. package/contextmenu/ContextMenu.vue +23 -19
  167. package/contextmenu/ContextMenuSub.vue +54 -42
  168. package/contextmenu/contextmenu.cjs.js +52 -44
  169. package/contextmenu/contextmenu.cjs.min.js +1 -1
  170. package/contextmenu/contextmenu.esm.js +52 -44
  171. package/contextmenu/contextmenu.esm.min.js +1 -1
  172. package/contextmenu/contextmenu.js +52 -44
  173. package/contextmenu/contextmenu.min.js +1 -1
  174. package/core/core.js +1918 -1744
  175. package/core/core.min.js +14 -14
  176. package/datatable/BodyCell.vue +93 -75
  177. package/datatable/ColumnFilter.vue +137 -86
  178. package/datatable/DataTable.d.ts +24 -24
  179. package/datatable/DataTable.vue +470 -296
  180. package/datatable/FooterCell.vue +20 -13
  181. package/datatable/HeaderCell.vue +108 -51
  182. package/datatable/HeaderCheckbox.vue +12 -5
  183. package/datatable/RowCheckbox.vue +14 -6
  184. package/datatable/RowRadioButton.vue +4 -4
  185. package/datatable/TableBody.vue +135 -83
  186. package/datatable/TableFooter.vue +17 -20
  187. package/datatable/TableHeader.vue +132 -52
  188. package/datatable/TableLoadingBody.vue +3 -3
  189. package/datatable/datatable.cjs.js +696 -559
  190. package/datatable/datatable.cjs.min.js +1 -1
  191. package/datatable/datatable.esm.js +696 -559
  192. package/datatable/datatable.esm.min.js +1 -1
  193. package/datatable/datatable.js +696 -559
  194. package/datatable/datatable.min.js +1 -1
  195. package/dataview/DataView.d.ts +8 -8
  196. package/dataview/DataView.vue +80 -66
  197. package/dataview/dataview.cjs.js +31 -35
  198. package/dataview/dataview.cjs.min.js +1 -1
  199. package/dataview/dataview.esm.js +31 -35
  200. package/dataview/dataview.esm.min.js +1 -1
  201. package/dataview/dataview.js +31 -35
  202. package/dataview/dataview.min.js +1 -1
  203. package/dataviewlayoutoptions/DataViewLayoutOptions.d.ts +5 -6
  204. package/dataviewlayoutoptions/DataViewLayoutOptions.vue +28 -34
  205. package/dataviewlayoutoptions/dataviewlayoutoptions.cjs.js +19 -25
  206. package/dataviewlayoutoptions/dataviewlayoutoptions.cjs.min.js +1 -1
  207. package/dataviewlayoutoptions/dataviewlayoutoptions.esm.js +19 -25
  208. package/dataviewlayoutoptions/dataviewlayoutoptions.esm.min.js +1 -1
  209. package/dataviewlayoutoptions/dataviewlayoutoptions.js +46 -52
  210. package/dataviewlayoutoptions/dataviewlayoutoptions.min.js +1 -1
  211. package/deferredcontent/DeferredContent.d.ts +6 -7
  212. package/deferredcontent/DeferredContent.vue +6 -9
  213. package/deferredcontent/deferredcontent.cjs.js +5 -8
  214. package/deferredcontent/deferredcontent.esm.js +5 -8
  215. package/deferredcontent/deferredcontent.js +5 -8
  216. package/dialog/Dialog.d.ts +10 -10
  217. package/dialog/Dialog.vue +64 -60
  218. package/dialog/dialog.cjs.js +50 -46
  219. package/dialog/dialog.cjs.min.js +1 -1
  220. package/dialog/dialog.esm.js +50 -46
  221. package/dialog/dialog.esm.min.js +1 -1
  222. package/dialog/dialog.js +50 -46
  223. package/dialog/dialog.min.js +1 -1
  224. package/divider/Divider.d.ts +4 -5
  225. package/divider/Divider.vue +15 -12
  226. package/divider/divider.cjs.js +17 -12
  227. package/divider/divider.cjs.min.js +1 -1
  228. package/divider/divider.esm.js +17 -12
  229. package/divider/divider.esm.min.js +1 -1
  230. package/divider/divider.js +17 -12
  231. package/divider/divider.min.js +1 -1
  232. package/dock/Dock.d.ts +5 -6
  233. package/dock/Dock.vue +3 -3
  234. package/dock/DockSub.vue +46 -25
  235. package/dock/dock.cjs.js +30 -23
  236. package/dock/dock.cjs.min.js +1 -1
  237. package/dock/dock.esm.js +30 -23
  238. package/dock/dock.esm.min.js +1 -1
  239. package/dock/dock.js +30 -23
  240. package/dock/dock.min.js +1 -1
  241. package/dropdown/Dropdown.d.ts +31 -17
  242. package/dropdown/Dropdown.vue +255 -125
  243. package/dropdown/dropdown.cjs.js +177 -109
  244. package/dropdown/dropdown.cjs.min.js +1 -1
  245. package/dropdown/dropdown.esm.js +178 -110
  246. package/dropdown/dropdown.esm.min.js +1 -1
  247. package/dropdown/dropdown.js +177 -109
  248. package/dropdown/dropdown.min.js +1 -1
  249. package/dynamicdialog/DynamicDialog.d.ts +4 -4
  250. package/dynamicdialog/DynamicDialog.vue +10 -10
  251. package/dynamicdialog/dynamicdialog.cjs.js +11 -9
  252. package/dynamicdialog/dynamicdialog.cjs.min.js +1 -1
  253. package/dynamicdialog/dynamicdialog.esm.js +11 -9
  254. package/dynamicdialog/dynamicdialog.esm.min.js +1 -1
  255. package/dynamicdialog/dynamicdialog.js +11 -9
  256. package/dynamicdialog/dynamicdialog.min.js +1 -1
  257. package/editor/Editor.d.ts +20 -4
  258. package/editor/Editor.vue +506 -466
  259. package/editor/editor.cjs.js +99 -45
  260. package/editor/editor.cjs.min.js +1 -1
  261. package/editor/editor.esm.js +82 -42
  262. package/editor/editor.esm.min.js +1 -1
  263. package/editor/editor.js +83 -47
  264. package/editor/editor.min.js +1 -1
  265. package/fieldset/Fieldset.d.ts +9 -5
  266. package/fieldset/Fieldset.vue +28 -20
  267. package/fieldset/fieldset.cjs.js +31 -19
  268. package/fieldset/fieldset.cjs.min.js +1 -1
  269. package/fieldset/fieldset.esm.js +32 -20
  270. package/fieldset/fieldset.esm.min.js +1 -1
  271. package/fieldset/fieldset.js +31 -19
  272. package/fieldset/fieldset.min.js +1 -1
  273. package/fileupload/FileUpload.d.ts +11 -11
  274. package/fileupload/FileUpload.vue +75 -69
  275. package/fileupload/fileupload.cjs.js +56 -50
  276. package/fileupload/fileupload.cjs.min.js +1 -1
  277. package/fileupload/fileupload.esm.js +56 -50
  278. package/fileupload/fileupload.esm.min.js +1 -1
  279. package/fileupload/fileupload.js +56 -50
  280. package/fileupload/fileupload.min.js +1 -1
  281. package/fullcalendar/FullCalendar.d.ts +5 -7
  282. package/fullcalendar/FullCalendar.vue +6 -6
  283. package/fullcalendar/fullcalendar.cjs.js +3 -2
  284. package/fullcalendar/fullcalendar.esm.js +3 -2
  285. package/fullcalendar/fullcalendar.js +3 -2
  286. package/galleria/Galleria.d.ts +4 -4
  287. package/galleria/Galleria.vue +39 -34
  288. package/galleria/GalleriaContent.vue +58 -31
  289. package/galleria/GalleriaItem.vue +44 -36
  290. package/galleria/GalleriaItemSlot.vue +2 -1
  291. package/galleria/GalleriaThumbnails.vue +107 -91
  292. package/galleria/galleria.cjs.js +180 -152
  293. package/galleria/galleria.cjs.min.js +1 -1
  294. package/galleria/galleria.esm.js +180 -152
  295. package/galleria/galleria.esm.min.js +1 -1
  296. package/galleria/galleria.js +180 -152
  297. package/galleria/galleria.min.js +1 -1
  298. package/image/Image.d.ts +4 -5
  299. package/image/Image.vue +19 -15
  300. package/image/image.cjs.js +11 -7
  301. package/image/image.cjs.min.js +1 -1
  302. package/image/image.esm.js +11 -7
  303. package/image/image.esm.min.js +1 -1
  304. package/image/image.js +11 -7
  305. package/image/image.min.js +1 -1
  306. package/inlinemessage/InlineMessage.d.ts +4 -5
  307. package/inlinemessage/InlineMessage.vue +12 -9
  308. package/inlinemessage/inlinemessage.cjs.js +11 -8
  309. package/inlinemessage/inlinemessage.esm.js +11 -8
  310. package/inlinemessage/inlinemessage.js +11 -8
  311. package/inplace/Inplace.d.ts +6 -6
  312. package/inplace/Inplace.vue +11 -11
  313. package/inplace/inplace.cjs.js +9 -9
  314. package/inplace/inplace.cjs.min.js +1 -1
  315. package/inplace/inplace.esm.js +9 -9
  316. package/inplace/inplace.esm.min.js +1 -1
  317. package/inplace/inplace.js +9 -9
  318. package/inplace/inplace.min.js +1 -1
  319. package/inputmask/InputMask.d.ts +11 -12
  320. package/inputmask/InputMask.vue +119 -92
  321. package/inputmask/inputmask.cjs.js +116 -89
  322. package/inputmask/inputmask.cjs.min.js +1 -1
  323. package/inputmask/inputmask.esm.js +116 -89
  324. package/inputmask/inputmask.esm.min.js +1 -1
  325. package/inputmask/inputmask.js +116 -89
  326. package/inputmask/inputmask.min.js +1 -1
  327. package/inputnumber/InputNumber.d.ts +17 -17
  328. package/inputnumber/InputNumber.vue +237 -177
  329. package/inputnumber/inputnumber.cjs.js +208 -171
  330. package/inputnumber/inputnumber.cjs.min.js +1 -1
  331. package/inputnumber/inputnumber.esm.js +208 -171
  332. package/inputnumber/inputnumber.esm.min.js +1 -1
  333. package/inputnumber/inputnumber.js +208 -171
  334. package/inputnumber/inputnumber.min.js +1 -1
  335. package/inputswitch/InputSwitch.d.ts +10 -10
  336. package/inputswitch/InputSwitch.vue +39 -11
  337. package/inputswitch/inputswitch.cjs.js +23 -9
  338. package/inputswitch/inputswitch.cjs.min.js +1 -1
  339. package/inputswitch/inputswitch.esm.js +23 -9
  340. package/inputswitch/inputswitch.esm.min.js +1 -1
  341. package/inputswitch/inputswitch.js +23 -9
  342. package/inputswitch/inputswitch.min.js +1 -1
  343. package/inputtext/InputText.d.ts +5 -6
  344. package/inputtext/InputText.vue +3 -3
  345. package/inputtext/inputtext.cjs.js +2 -2
  346. package/inputtext/inputtext.esm.js +2 -2
  347. package/inputtext/inputtext.js +2 -2
  348. package/knob/Knob.d.ts +10 -11
  349. package/knob/Knob.vue +47 -29
  350. package/knob/knob.cjs.js +27 -25
  351. package/knob/knob.cjs.min.js +1 -1
  352. package/knob/knob.esm.js +27 -25
  353. package/knob/knob.esm.min.js +1 -1
  354. package/knob/knob.js +27 -25
  355. package/knob/knob.min.js +1 -1
  356. package/listbox/Listbox.d.ts +17 -13
  357. package/listbox/Listbox.vue +144 -97
  358. package/listbox/listbox.cjs.js +96 -86
  359. package/listbox/listbox.cjs.min.js +1 -1
  360. package/listbox/listbox.esm.js +97 -87
  361. package/listbox/listbox.esm.min.js +1 -1
  362. package/listbox/listbox.js +96 -86
  363. package/listbox/listbox.min.js +1 -1
  364. package/megamenu/MegaMenu.d.ts +5 -6
  365. package/megamenu/MegaMenu.vue +108 -94
  366. package/megamenu/megamenu.cjs.js +77 -72
  367. package/megamenu/megamenu.cjs.min.js +1 -1
  368. package/megamenu/megamenu.esm.js +77 -72
  369. package/megamenu/megamenu.esm.min.js +1 -1
  370. package/megamenu/megamenu.js +77 -72
  371. package/megamenu/megamenu.min.js +1 -1
  372. package/menu/Menu.d.ts +5 -8
  373. package/menu/Menu.vue +29 -23
  374. package/menu/Menuitem.vue +21 -18
  375. package/menu/menu.cjs.js +38 -29
  376. package/menu/menu.cjs.min.js +1 -1
  377. package/menu/menu.esm.js +38 -29
  378. package/menu/menu.esm.min.js +1 -1
  379. package/menu/menu.js +38 -29
  380. package/menu/menu.min.js +1 -1
  381. package/menubar/Menubar.d.ts +5 -6
  382. package/menubar/Menubar.vue +14 -15
  383. package/menubar/MenubarSub.vue +79 -62
  384. package/menubar/menubar.cjs.js +56 -58
  385. package/menubar/menubar.cjs.min.js +1 -1
  386. package/menubar/menubar.esm.js +56 -58
  387. package/menubar/menubar.esm.min.js +1 -1
  388. package/menubar/menubar.js +56 -58
  389. package/menubar/menubar.min.js +1 -1
  390. package/menuitem/MenuItem.d.ts +2 -2
  391. package/message/Message.d.ts +5 -5
  392. package/message/Message.vue +19 -14
  393. package/message/message.cjs.js +15 -10
  394. package/message/message.cjs.min.js +1 -1
  395. package/message/message.esm.js +15 -10
  396. package/message/message.esm.min.js +1 -1
  397. package/message/message.js +15 -10
  398. package/message/message.min.js +1 -1
  399. package/multiselect/MultiSelect.d.ts +21 -16
  400. package/multiselect/MultiSelect.vue +240 -150
  401. package/multiselect/multiselect.cjs.js +184 -133
  402. package/multiselect/multiselect.cjs.min.js +1 -1
  403. package/multiselect/multiselect.esm.js +185 -134
  404. package/multiselect/multiselect.esm.min.js +1 -1
  405. package/multiselect/multiselect.js +184 -133
  406. package/multiselect/multiselect.min.js +1 -1
  407. package/orderlist/OrderList.d.ts +5 -5
  408. package/orderlist/OrderList.vue +65 -60
  409. package/orderlist/orderlist.cjs.js +51 -53
  410. package/orderlist/orderlist.esm.js +51 -53
  411. package/orderlist/orderlist.js +51 -53
  412. package/organizationchart/OrganizationChart.d.ts +4 -4
  413. package/organizationchart/OrganizationChart.vue +13 -17
  414. package/organizationchart/OrganizationChartNode.vue +20 -12
  415. package/organizationchart/organizationchart.cjs.js +14 -16
  416. package/organizationchart/organizationchart.cjs.min.js +1 -1
  417. package/organizationchart/organizationchart.esm.js +14 -16
  418. package/organizationchart/organizationchart.esm.min.js +1 -1
  419. package/organizationchart/organizationchart.js +14 -16
  420. package/organizationchart/organizationchart.min.js +1 -1
  421. package/overlaypanel/OverlayPanel.d.ts +5 -5
  422. package/overlaypanel/OverlayPanel.vue +60 -50
  423. package/overlaypanel/overlaypanel.cjs.js +40 -32
  424. package/overlaypanel/overlaypanel.cjs.min.js +1 -1
  425. package/overlaypanel/overlaypanel.esm.js +40 -32
  426. package/overlaypanel/overlaypanel.esm.min.js +1 -1
  427. package/overlaypanel/overlaypanel.js +40 -32
  428. package/overlaypanel/overlaypanel.min.js +1 -1
  429. package/package.json +1 -1
  430. package/paginator/CurrentPageReport.vue +47 -47
  431. package/paginator/FirstPageLink.vue +11 -8
  432. package/paginator/JumpToPageDropdown.vue +7 -6
  433. package/paginator/JumpToPageInput.vue +3 -3
  434. package/paginator/LastPageLink.vue +11 -8
  435. package/paginator/NextPageLink.vue +11 -8
  436. package/paginator/PageLinks.vue +3 -4
  437. package/paginator/Paginator.d.ts +5 -5
  438. package/paginator/Paginator.vue +39 -39
  439. package/paginator/PrevPageLink.vue +11 -8
  440. package/paginator/RowsPerPageDropdown.vue +7 -6
  441. package/paginator/paginator.cjs.js +110 -91
  442. package/paginator/paginator.cjs.min.js +1 -1
  443. package/paginator/paginator.esm.js +110 -91
  444. package/paginator/paginator.esm.min.js +1 -1
  445. package/paginator/paginator.js +633 -614
  446. package/paginator/paginator.min.js +1 -1
  447. package/panel/Panel.d.ts +9 -5
  448. package/panel/Panel.vue +29 -11
  449. package/panel/panel.cjs.js +24 -14
  450. package/panel/panel.cjs.min.js +1 -1
  451. package/panel/panel.esm.js +24 -14
  452. package/panel/panel.esm.min.js +1 -1
  453. package/panel/panel.js +24 -14
  454. package/panel/panel.min.js +1 -1
  455. package/panelmenu/PanelMenu.d.ts +5 -5
  456. package/panelmenu/PanelMenu.vue +46 -38
  457. package/panelmenu/PanelMenuSub.vue +40 -29
  458. package/panelmenu/panelmenu.cjs.js +56 -52
  459. package/panelmenu/panelmenu.cjs.min.js +1 -1
  460. package/panelmenu/panelmenu.esm.js +56 -52
  461. package/panelmenu/panelmenu.esm.min.js +1 -1
  462. package/panelmenu/panelmenu.js +56 -52
  463. package/panelmenu/panelmenu.min.js +1 -1
  464. package/password/Password.d.ts +12 -7
  465. package/password/Password.vue +156 -79
  466. package/password/password.cjs.js +135 -74
  467. package/password/password.cjs.min.js +1 -1
  468. package/password/password.esm.js +135 -74
  469. package/password/password.esm.min.js +1 -1
  470. package/password/password.js +135 -74
  471. package/password/password.min.js +1 -1
  472. package/picklist/PickList.d.ts +9 -9
  473. package/picklist/PickList.vue +99 -78
  474. package/picklist/picklist.cjs.js +71 -66
  475. package/picklist/picklist.cjs.min.js +1 -1
  476. package/picklist/picklist.esm.js +71 -66
  477. package/picklist/picklist.esm.min.js +1 -1
  478. package/picklist/picklist.js +71 -66
  479. package/picklist/picklist.min.js +1 -1
  480. package/portal/Portal.d.ts +3 -3
  481. package/portal/Portal.vue +2 -2
  482. package/portal/portal.cjs.js +1 -1
  483. package/portal/portal.esm.js +1 -1
  484. package/portal/portal.js +1 -1
  485. package/progressbar/ProgressBar.d.ts +4 -5
  486. package/progressbar/ProgressBar.vue +63 -51
  487. package/progressbar/progressbar.cjs.js +2 -2
  488. package/progressbar/progressbar.cjs.min.js +1 -1
  489. package/progressbar/progressbar.esm.js +2 -2
  490. package/progressbar/progressbar.esm.min.js +1 -1
  491. package/progressbar/progressbar.js +2 -2
  492. package/progressbar/progressbar.min.js +1 -1
  493. package/progressspinner/ProgressSpinner.d.ts +5 -7
  494. package/progressspinner/ProgressSpinner.vue +1 -1
  495. package/radiobutton/RadioButton.d.ts +9 -9
  496. package/radiobutton/RadioButton.vue +41 -13
  497. package/radiobutton/radiobutton.cjs.js +24 -10
  498. package/radiobutton/radiobutton.cjs.min.js +1 -1
  499. package/radiobutton/radiobutton.esm.js +24 -10
  500. package/radiobutton/radiobutton.esm.min.js +1 -1
  501. package/radiobutton/radiobutton.js +24 -10
  502. package/radiobutton/radiobutton.min.js +1 -1
  503. package/rating/Rating.d.ts +54 -5
  504. package/rating/Rating.vue +88 -62
  505. package/rating/rating.cjs.js +105 -84
  506. package/rating/rating.cjs.min.js +1 -1
  507. package/rating/rating.esm.js +106 -85
  508. package/rating/rating.esm.min.js +1 -1
  509. package/rating/rating.js +106 -86
  510. package/rating/rating.min.js +1 -1
  511. package/resources/themes/arya-blue/theme.css +23 -12
  512. package/resources/themes/arya-green/theme.css +23 -12
  513. package/resources/themes/arya-orange/theme.css +23 -12
  514. package/resources/themes/arya-purple/theme.css +23 -12
  515. package/resources/themes/bootstrap4-dark-blue/theme.css +24 -13
  516. package/resources/themes/bootstrap4-dark-purple/theme.css +24 -13
  517. package/resources/themes/bootstrap4-light-blue/theme.css +24 -13
  518. package/resources/themes/bootstrap4-light-purple/theme.css +24 -13
  519. package/resources/themes/fluent-light/theme.css +23 -12
  520. package/resources/themes/lara-dark-blue/theme.css +23 -12
  521. package/resources/themes/lara-dark-indigo/theme.css +23 -12
  522. package/resources/themes/lara-dark-purple/theme.css +23 -12
  523. package/resources/themes/lara-dark-teal/theme.css +23 -12
  524. package/resources/themes/lara-light-blue/theme.css +23 -12
  525. package/resources/themes/lara-light-indigo/theme.css +23 -12
  526. package/resources/themes/lara-light-purple/theme.css +23 -12
  527. package/resources/themes/lara-light-teal/theme.css +23 -12
  528. package/resources/themes/luna-amber/theme.css +24 -13
  529. package/resources/themes/luna-blue/theme.css +24 -13
  530. package/resources/themes/luna-green/theme.css +24 -13
  531. package/resources/themes/luna-pink/theme.css +24 -13
  532. package/resources/themes/md-dark-deeppurple/theme.css +46 -20
  533. package/resources/themes/md-dark-indigo/theme.css +46 -20
  534. package/resources/themes/md-light-deeppurple/theme.css +46 -20
  535. package/resources/themes/md-light-indigo/theme.css +46 -20
  536. package/resources/themes/mdc-dark-deeppurple/theme.css +46 -20
  537. package/resources/themes/mdc-dark-indigo/theme.css +46 -20
  538. package/resources/themes/mdc-light-deeppurple/theme.css +46 -20
  539. package/resources/themes/mdc-light-indigo/theme.css +46 -20
  540. package/resources/themes/nova/theme.css +24 -13
  541. package/resources/themes/nova-accent/theme.css +23 -12
  542. package/resources/themes/nova-alt/theme.css +24 -13
  543. package/resources/themes/nova-vue/theme.css +24 -13
  544. package/resources/themes/rhea/theme.css +23 -12
  545. package/resources/themes/saga-blue/theme.css +23 -12
  546. package/resources/themes/saga-green/theme.css +23 -12
  547. package/resources/themes/saga-orange/theme.css +23 -12
  548. package/resources/themes/saga-purple/theme.css +23 -12
  549. package/resources/themes/tailwind-light/theme.css +23 -12
  550. package/resources/themes/vela-blue/theme.css +23 -12
  551. package/resources/themes/vela-green/theme.css +23 -12
  552. package/resources/themes/vela-orange/theme.css +23 -12
  553. package/resources/themes/vela-purple/theme.css +23 -12
  554. package/ripple/ripple.cjs.js +7 -1
  555. package/ripple/ripple.esm.js +7 -1
  556. package/ripple/ripple.js +7 -1
  557. package/row/Row.d.ts +6 -9
  558. package/row/Row.vue +1 -1
  559. package/scrollpanel/ScrollPanel.d.ts +9 -5
  560. package/scrollpanel/ScrollPanel.vue +194 -56
  561. package/scrollpanel/scrollpanel.cjs.js +180 -56
  562. package/scrollpanel/scrollpanel.cjs.min.js +1 -1
  563. package/scrollpanel/scrollpanel.esm.js +181 -57
  564. package/scrollpanel/scrollpanel.esm.min.js +1 -1
  565. package/scrollpanel/scrollpanel.js +180 -56
  566. package/scrollpanel/scrollpanel.min.js +1 -1
  567. package/scrolltop/ScrollTop.d.ts +5 -7
  568. package/scrolltop/ScrollTop.vue +18 -23
  569. package/scrolltop/scrolltop.cjs.js +14 -19
  570. package/scrolltop/scrolltop.cjs.min.js +1 -1
  571. package/scrolltop/scrolltop.esm.js +14 -19
  572. package/scrolltop/scrolltop.esm.min.js +1 -1
  573. package/scrolltop/scrolltop.js +14 -19
  574. package/scrolltop/scrolltop.min.js +1 -1
  575. package/selectbutton/SelectButton.d.ts +11 -11
  576. package/selectbutton/SelectButton.vue +50 -32
  577. package/selectbutton/selectbutton.cjs.js +30 -25
  578. package/selectbutton/selectbutton.esm.js +30 -25
  579. package/selectbutton/selectbutton.js +30 -25
  580. package/sidebar/Sidebar.d.ts +6 -6
  581. package/sidebar/Sidebar.vue +24 -14
  582. package/sidebar/sidebar.cjs.js +20 -10
  583. package/sidebar/sidebar.cjs.min.js +1 -1
  584. package/sidebar/sidebar.esm.js +20 -10
  585. package/sidebar/sidebar.esm.min.js +1 -1
  586. package/sidebar/sidebar.js +20 -10
  587. package/sidebar/sidebar.min.js +1 -1
  588. package/skeleton/Skeleton.d.ts +5 -7
  589. package/skeleton/Skeleton.vue +12 -11
  590. package/skeleton/skeleton.cjs.js +10 -9
  591. package/skeleton/skeleton.cjs.min.js +1 -1
  592. package/skeleton/skeleton.esm.js +10 -9
  593. package/skeleton/skeleton.esm.min.js +1 -1
  594. package/skeleton/skeleton.js +10 -9
  595. package/skeleton/skeleton.min.js +1 -1
  596. package/slider/Slider.d.ts +7 -8
  597. package/slider/Slider.vue +162 -141
  598. package/slider/slider.cjs.js +100 -127
  599. package/slider/slider.cjs.min.js +1 -1
  600. package/slider/slider.esm.js +100 -127
  601. package/slider/slider.esm.min.js +1 -1
  602. package/slider/slider.js +100 -127
  603. package/slider/slider.min.js +1 -1
  604. package/speeddial/SpeedDial.d.ts +8 -8
  605. package/speeddial/SpeedDial.vue +54 -39
  606. package/speeddial/speeddial.cjs.js +44 -36
  607. package/speeddial/speeddial.esm.js +44 -36
  608. package/speeddial/speeddial.js +44 -36
  609. package/splitbutton/SplitButton.d.ts +6 -6
  610. package/splitbutton/SplitButton.vue +9 -11
  611. package/splitbutton/splitbutton.cjs.js +7 -7
  612. package/splitbutton/splitbutton.cjs.min.js +1 -1
  613. package/splitbutton/splitbutton.esm.js +7 -7
  614. package/splitbutton/splitbutton.esm.min.js +1 -1
  615. package/splitbutton/splitbutton.js +7 -7
  616. package/splitbutton/splitbutton.min.js +1 -1
  617. package/splitter/Splitter.d.ts +10 -5
  618. package/splitter/Splitter.vue +158 -53
  619. package/splitter/splitter.cjs.js +156 -52
  620. package/splitter/splitter.cjs.min.js +1 -1
  621. package/splitter/splitter.esm.js +157 -53
  622. package/splitter/splitter.esm.min.js +1 -1
  623. package/splitter/splitter.js +156 -52
  624. package/splitter/splitter.min.js +1 -1
  625. package/splitterpanel/SplitterPanel.d.ts +4 -5
  626. package/splitterpanel/SplitterPanel.vue +3 -3
  627. package/splitterpanel/splitterpanel.cjs.js +2 -2
  628. package/splitterpanel/splitterpanel.esm.js +2 -2
  629. package/splitterpanel/splitterpanel.js +2 -2
  630. package/steps/Steps.d.ts +4 -5
  631. package/steps/Steps.vue +31 -23
  632. package/steps/steps.cjs.js +24 -16
  633. package/steps/steps.esm.js +24 -16
  634. package/steps/steps.js +24 -16
  635. package/styleclass/styleclass.cjs.js +19 -21
  636. package/styleclass/styleclass.esm.js +19 -21
  637. package/styleclass/styleclass.js +19 -21
  638. package/tabmenu/TabMenu.d.ts +4 -4
  639. package/tabmenu/TabMenu.vue +45 -34
  640. package/tabmenu/tabmenu.cjs.js +36 -25
  641. package/tabmenu/tabmenu.cjs.min.js +1 -1
  642. package/tabmenu/tabmenu.esm.js +36 -25
  643. package/tabmenu/tabmenu.esm.min.js +1 -1
  644. package/tabmenu/tabmenu.js +36 -25
  645. package/tabmenu/tabmenu.min.js +1 -1
  646. package/tabpanel/TabPanel.d.ts +33 -6
  647. package/tabpanel/TabPanel.vue +8 -1
  648. package/tabpanel/tabpanel.cjs.js +7 -0
  649. package/tabpanel/tabpanel.cjs.min.js +1 -1
  650. package/tabpanel/tabpanel.esm.js +7 -0
  651. package/tabpanel/tabpanel.esm.min.js +1 -1
  652. package/tabpanel/tabpanel.js +7 -0
  653. package/tabpanel/tabpanel.min.js +1 -1
  654. package/tabview/TabView.d.ts +22 -6
  655. package/tabview/TabView.vue +280 -96
  656. package/tabview/tabview.cjs.js +294 -131
  657. package/tabview/tabview.cjs.min.js +1 -1
  658. package/tabview/tabview.esm.js +296 -133
  659. package/tabview/tabview.esm.min.js +1 -1
  660. package/tabview/tabview.js +294 -131
  661. package/tabview/tabview.min.js +1 -1
  662. package/tag/Tag.d.ts +4 -5
  663. package/tag/Tag.vue +13 -10
  664. package/tag/tag.cjs.js +10 -7
  665. package/tag/tag.esm.js +10 -7
  666. package/tag/tag.js +10 -7
  667. package/terminal/Terminal.d.ts +5 -7
  668. package/terminal/Terminal.vue +10 -10
  669. package/terminal/terminal.cjs.js +3 -3
  670. package/terminal/terminal.cjs.min.js +1 -1
  671. package/terminal/terminal.esm.js +3 -3
  672. package/terminal/terminal.esm.min.js +1 -1
  673. package/terminal/terminal.js +3 -3
  674. package/terminal/terminal.min.js +1 -1
  675. package/textarea/Textarea.d.ts +5 -6
  676. package/textarea/Textarea.vue +7 -7
  677. package/textarea/textarea.cjs.js +6 -6
  678. package/textarea/textarea.esm.js +6 -6
  679. package/textarea/textarea.js +6 -6
  680. package/tieredmenu/TieredMenu.d.ts +4 -5
  681. package/tieredmenu/TieredMenu.vue +23 -15
  682. package/tieredmenu/TieredMenuSub.vue +62 -51
  683. package/tieredmenu/tieredmenu.cjs.js +60 -50
  684. package/tieredmenu/tieredmenu.cjs.min.js +1 -1
  685. package/tieredmenu/tieredmenu.esm.js +60 -50
  686. package/tieredmenu/tieredmenu.esm.min.js +1 -1
  687. package/tieredmenu/tieredmenu.js +60 -50
  688. package/tieredmenu/tieredmenu.min.js +1 -1
  689. package/timeline/Timeline.d.ts +4 -5
  690. package/timeline/Timeline.vue +6 -10
  691. package/timeline/timeline.cjs.js +3 -7
  692. package/timeline/timeline.cjs.min.js +1 -1
  693. package/timeline/timeline.esm.js +3 -7
  694. package/timeline/timeline.esm.min.js +1 -1
  695. package/timeline/timeline.js +3 -7
  696. package/timeline/timeline.min.js +1 -1
  697. package/toast/Toast.d.ts +10 -13
  698. package/toast/Toast.vue +36 -29
  699. package/toast/ToastMessage.vue +25 -18
  700. package/toast/toast.cjs.js +37 -23
  701. package/toast/toast.cjs.min.js +1 -1
  702. package/toast/toast.esm.js +37 -23
  703. package/toast/toast.esm.min.js +1 -1
  704. package/toast/toast.js +37 -23
  705. package/toast/toast.min.js +1 -1
  706. package/toastservice/toastservice.cjs.js +1 -0
  707. package/toastservice/toastservice.esm.js +1 -0
  708. package/toastservice/toastservice.js +1 -0
  709. package/togglebutton/ToggleButton.d.ts +10 -10
  710. package/togglebutton/ToggleButton.vue +42 -18
  711. package/togglebutton/togglebutton.cjs.js +25 -13
  712. package/togglebutton/togglebutton.cjs.min.js +1 -1
  713. package/togglebutton/togglebutton.esm.js +25 -13
  714. package/togglebutton/togglebutton.esm.min.js +1 -1
  715. package/togglebutton/togglebutton.js +25 -13
  716. package/togglebutton/togglebutton.min.js +1 -1
  717. package/toolbar/Toolbar.d.ts +8 -5
  718. package/toolbar/Toolbar.vue +9 -3
  719. package/toolbar/toolbar.cjs.js +14 -7
  720. package/toolbar/toolbar.cjs.min.js +1 -1
  721. package/toolbar/toolbar.esm.js +14 -7
  722. package/toolbar/toolbar.esm.min.js +1 -1
  723. package/toolbar/toolbar.js +14 -7
  724. package/toolbar/toolbar.min.js +1 -1
  725. package/tooltip/tooltip.cjs.js +36 -24
  726. package/tooltip/tooltip.cjs.min.js +1 -1
  727. package/tooltip/tooltip.esm.js +37 -25
  728. package/tooltip/tooltip.esm.min.js +1 -1
  729. package/tooltip/tooltip.js +36 -24
  730. package/tooltip/tooltip.min.js +1 -1
  731. package/tree/Tree.d.ts +7 -7
  732. package/tree/Tree.vue +66 -56
  733. package/tree/TreeNode.vue +70 -66
  734. package/tree/tree.cjs.js +99 -102
  735. package/tree/tree.cjs.min.js +1 -1
  736. package/tree/tree.esm.js +99 -102
  737. package/tree/tree.esm.min.js +1 -1
  738. package/tree/tree.js +99 -102
  739. package/tree/tree.min.js +1 -1
  740. package/treeselect/TreeSelect.d.ts +9 -9
  741. package/treeselect/TreeSelect.vue +130 -72
  742. package/treeselect/treeselect.cjs.js +89 -59
  743. package/treeselect/treeselect.cjs.min.js +1 -1
  744. package/treeselect/treeselect.esm.js +89 -59
  745. package/treeselect/treeselect.esm.min.js +1 -1
  746. package/treeselect/treeselect.js +89 -59
  747. package/treeselect/treeselect.min.js +1 -1
  748. package/treetable/BodyCell.vue +29 -19
  749. package/treetable/FooterCell.vue +19 -11
  750. package/treetable/HeaderCell.vue +44 -36
  751. package/treetable/TreeTable.d.ts +8 -8
  752. package/treetable/TreeTable.vue +229 -178
  753. package/treetable/TreeTableRow.vue +74 -58
  754. package/treetable/treetable.cjs.js +287 -253
  755. package/treetable/treetable.cjs.min.js +1 -1
  756. package/treetable/treetable.esm.js +287 -253
  757. package/treetable/treetable.esm.min.js +1 -1
  758. package/treetable/treetable.js +287 -253
  759. package/treetable/treetable.min.js +1 -1
  760. package/tristatecheckbox/TriStateCheckbox.d.ts +9 -9
  761. package/tristatecheckbox/TriStateCheckbox.vue +39 -18
  762. package/tristatecheckbox/tristatecheckbox.cjs.js +24 -15
  763. package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
  764. package/tristatecheckbox/tristatecheckbox.esm.js +24 -15
  765. package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
  766. package/tristatecheckbox/tristatecheckbox.js +24 -15
  767. package/tristatecheckbox/tristatecheckbox.min.js +1 -1
  768. package/ts-helpers.d.ts +16 -10
  769. package/useconfirm/UseConfirm.d.ts +1 -1
  770. package/useconfirm/useconfirm.cjs.js +2 -1
  771. package/useconfirm/useconfirm.esm.js +2 -1
  772. package/useconfirm/useconfirm.js +2 -1
  773. package/usedialog/UseDialog.d.ts +1 -1
  774. package/usedialog/usedialog.cjs.js +2 -1
  775. package/usedialog/usedialog.esm.js +2 -1
  776. package/usedialog/usedialog.js +2 -1
  777. package/usetoast/usetoast.cjs.js +2 -1
  778. package/usetoast/usetoast.esm.js +2 -1
  779. package/usetoast/usetoast.js +2 -1
  780. package/utils/Utils.d.ts +7 -5
  781. package/utils/utils.cjs.js +183 -156
  782. package/utils/utils.cjs.min.js +1 -1
  783. package/utils/utils.esm.js +183 -156
  784. package/utils/utils.esm.min.js +1 -1
  785. package/utils/utils.js +183 -156
  786. package/utils/utils.min.js +1 -1
  787. package/vetur-attributes.json +160 -0
  788. package/vetur-tags.json +58 -8
  789. package/virtualscroller/VirtualScroller.d.ts +9 -9
  790. package/virtualscroller/VirtualScroller.vue +108 -96
  791. package/virtualscroller/virtualscroller.cjs.js +87 -89
  792. package/virtualscroller/virtualscroller.cjs.min.js +1 -1
  793. package/virtualscroller/virtualscroller.esm.js +87 -89
  794. package/virtualscroller/virtualscroller.esm.min.js +1 -1
  795. package/virtualscroller/virtualscroller.js +87 -89
  796. package/virtualscroller/virtualscroller.min.js +1 -1
  797. package/web-types.json +488 -2
@@ -1,66 +1,148 @@
1
1
  <template>
2
2
  <span ref="container" :id="id" :class="containerClass">
3
- <input :ref="inputRef" v-if="!inline" type="text" role="combobox" :id="inputId" :class="['p-inputtext p-component', inputClass]" :style="inputStyle" :placeholder="placeholder"
4
- aria-autocomplete="none" aria-haspopup="dialog" :aria-expanded="overlayVisible" :aria-controls="panelId" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel" inputmode="none"
5
- @input="onInput" @focus="onFocus" @blur="onBlur" @keydown="onKeyDown" :readonly="!manualInput" :tabindex="0" v-bind="inputProps">
6
- <CalendarButton v-if="showIcon" :icon="icon" class="p-datepicker-trigger" :disabled="disabled" @click="onButtonClick" type="button" :aria-label="$primevue.config.locale.chooseDate" aria-haspopup="dialog" :aria-expanded="overlayVisible" :aria-controls="panelId"/>
3
+ <input
4
+ v-if="!inline"
5
+ :ref="inputRef"
6
+ :id="inputId"
7
+ type="text"
8
+ role="combobox"
9
+ :class="['p-inputtext p-component', inputClass]"
10
+ :style="inputStyle"
11
+ :placeholder="placeholder"
12
+ aria-autocomplete="none"
13
+ aria-haspopup="dialog"
14
+ :aria-expanded="overlayVisible"
15
+ :aria-controls="panelId"
16
+ :aria-labelledby="ariaLabelledby"
17
+ :aria-label="ariaLabel"
18
+ inputmode="none"
19
+ :disabled="disabled"
20
+ :readonly="!manualInput"
21
+ :tabindex="0"
22
+ @input="onInput"
23
+ @focus="onFocus"
24
+ @blur="onBlur"
25
+ @keydown="onKeyDown"
26
+ v-bind="inputProps"
27
+ />
28
+ <CalendarButton
29
+ v-if="showIcon"
30
+ :icon="icon"
31
+ class="p-datepicker-trigger"
32
+ :disabled="disabled"
33
+ @click="onButtonClick"
34
+ type="button"
35
+ :aria-label="$primevue.config.locale.chooseDate"
36
+ aria-haspopup="dialog"
37
+ :aria-expanded="overlayVisible"
38
+ :aria-controls="panelId"
39
+ />
7
40
  <Portal :appendTo="appendTo" :disabled="inline">
8
41
  <transition name="p-connected-overlay" @enter="onOverlayEnter($event)" @after-enter="onOverlayEnterComplete" @after-leave="onOverlayAfterLeave" @leave="onOverlayLeave">
9
- <div :ref="overlayRef" :id="panelId" :class="panelStyleClass" :style=panelStyle v-if="inline || overlayVisible" :role="inline ? null : 'dialog'" :aria-modal="inline ? null : 'true'" :aria-label="$primevue.config.locale.chooseDate"
10
- @click="onOverlayClick" @keydown="onOverlayKeyDown" @mouseup="onOverlayMouseUp" v-bind="panelProps">
42
+ <div
43
+ v-if="inline || overlayVisible"
44
+ :ref="overlayRef"
45
+ :id="panelId"
46
+ :class="panelStyleClass"
47
+ :style="panelStyle"
48
+ :role="inline ? null : 'dialog'"
49
+ :aria-modal="inline ? null : 'true'"
50
+ :aria-label="$primevue.config.locale.chooseDate"
51
+ @click="onOverlayClick"
52
+ @keydown="onOverlayKeyDown"
53
+ @mouseup="onOverlayMouseUp"
54
+ v-bind="panelProps"
55
+ >
11
56
  <template v-if="!timeOnly">
12
57
  <div class="p-datepicker-group-container">
13
- <div class="p-datepicker-group" v-for="(month,groupIndex) of months" :key="month.month + month.year">
58
+ <div v-for="(month, groupIndex) of months" :key="month.month + month.year" class="p-datepicker-group">
14
59
  <div class="p-datepicker-header">
15
60
  <slot name="header"></slot>
16
- <button class="p-datepicker-prev p-link" v-show="showOtherMonths ? groupIndex === 0 : false" @click="onPrevButtonClick" type="button" @keydown="onContainerButtonKeydown" v-ripple :disabled="disabled" :aria-label=" currentView === 'year' ? $primevue.config.locale.prevDecade: currentView === 'month' ? $primevue.config.locale.prevYear : $primevue.config.locale.prevMonth">
61
+ <button
62
+ v-show="showOtherMonths ? groupIndex === 0 : false"
63
+ v-ripple
64
+ class="p-datepicker-prev p-link"
65
+ @click="onPrevButtonClick"
66
+ type="button"
67
+ @keydown="onContainerButtonKeydown"
68
+ :disabled="disabled"
69
+ :aria-label="currentView === 'year' ? $primevue.config.locale.prevDecade : currentView === 'month' ? $primevue.config.locale.prevYear : $primevue.config.locale.prevMonth"
70
+ >
17
71
  <span class="p-datepicker-prev-icon pi pi-chevron-left"></span>
18
72
  </button>
19
73
  <div class="p-datepicker-title">
20
- <button type="button" @click="switchToMonthView" @keydown="onContainerButtonKeydown" v-if="currentView === 'date'" class="p-datepicker-month p-link" :disabled="switchViewButtonDisabled" :aria-label="$primevue.config.locale.chooseMonth">
21
- {{getMonthName(month.month)}}
74
+ <button
75
+ v-if="currentView === 'date'"
76
+ type="button"
77
+ @click="switchToMonthView"
78
+ @keydown="onContainerButtonKeydown"
79
+ class="p-datepicker-month p-link"
80
+ :disabled="switchViewButtonDisabled"
81
+ :aria-label="$primevue.config.locale.chooseMonth"
82
+ >
83
+ {{ getMonthName(month.month) }}
22
84
  </button>
23
- <button type="button" @click="switchToYearView" @keydown="onContainerButtonKeydown" v-if="currentView !== 'year'" class="p-datepicker-year p-link" :disabled="switchViewButtonDisabled" :aria-label="$primevue.config.locale.chooseYear">
24
- {{getYear(month)}}
85
+ <button
86
+ v-if="currentView !== 'year'"
87
+ type="button"
88
+ @click="switchToYearView"
89
+ @keydown="onContainerButtonKeydown"
90
+ class="p-datepicker-year p-link"
91
+ :disabled="switchViewButtonDisabled"
92
+ :aria-label="$primevue.config.locale.chooseYear"
93
+ >
94
+ {{ getYear(month) }}
25
95
  </button>
26
- <span class="p-datepicker-decade" v-if="currentView === 'year'">
27
- <slot name="decade" :years="yearPickerValues">
28
- {{yearPickerValues[0]}} - {{yearPickerValues[yearPickerValues.length - 1]}}
29
- </slot>
96
+ <span v-if="currentView === 'year'" class="p-datepicker-decade">
97
+ <slot name="decade" :years="yearPickerValues"> {{ yearPickerValues[0] }} - {{ yearPickerValues[yearPickerValues.length - 1] }} </slot>
30
98
  </span>
31
99
  </div>
32
- <button class="p-datepicker-next p-link" v-show="showOtherMonths ? numberOfMonths === 1 ? true : (groupIndex === numberOfMonths - 1) : false"
33
- @click="onNextButtonClick" type="button" @keydown="onContainerButtonKeydown" v-ripple :disabled="disabled" :aria-label=" currentView === 'year' ? $primevue.config.locale.nextDecade : currentView === 'month' ? $primevue.config.locale.nextYear : $primevue.config.locale.nextMonth">
100
+ <button
101
+ v-show="showOtherMonths ? (numberOfMonths === 1 ? true : groupIndex === numberOfMonths - 1) : false"
102
+ v-ripple
103
+ class="p-datepicker-next p-link"
104
+ @click="onNextButtonClick"
105
+ type="button"
106
+ @keydown="onContainerButtonKeydown"
107
+ :disabled="disabled"
108
+ :aria-label="currentView === 'year' ? $primevue.config.locale.nextDecade : currentView === 'month' ? $primevue.config.locale.nextYear : $primevue.config.locale.nextMonth"
109
+ >
34
110
  <span class="p-datepicker-next-icon pi pi-chevron-right"></span>
35
111
  </button>
36
112
  </div>
37
- <div class="p-datepicker-calendar-container" v-if="currentView ==='date'">
113
+ <div v-if="currentView === 'date'" class="p-datepicker-calendar-container">
38
114
  <table class="p-datepicker-calendar" role="grid">
39
115
  <thead>
40
116
  <tr>
41
- <th scope="col" v-if="showWeek" class="p-datepicker-weekheader p-disabled">
42
- <span>{{weekHeaderLabel}}</span>
117
+ <th v-if="showWeek" scope="col" class="p-datepicker-weekheader p-disabled">
118
+ <span>{{ weekHeaderLabel }}</span>
43
119
  </th>
44
- <th scope="col" v-for="weekDay of weekDays" :key="weekDay" :abbr="weekDay">
45
- <span>{{weekDay}}</span>
120
+ <th v-for="weekDay of weekDays" :key="weekDay" scope="col" :abbr="weekDay">
121
+ <span>{{ weekDay }}</span>
46
122
  </th>
47
123
  </tr>
48
124
  </thead>
49
125
  <tbody>
50
- <tr v-for="(week,i) of month.dates" :key="week[0].day + '' + week[0].month">
126
+ <tr v-for="(week, i) of month.dates" :key="week[0].day + '' + week[0].month">
51
127
  <td v-if="showWeek" class="p-datepicker-weeknumber">
52
128
  <span class="p-disabled">
53
- <span style="visibility:hidden" v-if="month.weekNumbers[i] < 10">0</span>
54
- {{month.weekNumbers[i]}}
129
+ <span v-if="month.weekNumbers[i] < 10" style="visibility: hidden">0</span>
130
+ {{ month.weekNumbers[i] }}
55
131
  </span>
56
132
  </td>
57
- <td v-for="date of week" :aria-label="date.day" :key="date.day + '' + date.month" :class="{'p-datepicker-other-month': date.otherMonth, 'p-datepicker-today': date.today}">
58
- <span :class="{'p-highlight': isSelected(date), 'p-disabled': !date.selectable}" @click="onDateSelect($event, date)"
59
- draggable="false" @keydown="onDateCellKeydown($event,date,groupIndex)" v-ripple :aria-selected="isSelected(date)">
60
- <slot name="date" :date="date">{{date.day}}</slot>
133
+ <td v-for="date of week" :key="date.day + '' + date.month" :aria-label="date.day" :class="{ 'p-datepicker-other-month': date.otherMonth, 'p-datepicker-today': date.today }">
134
+ <span
135
+ v-ripple
136
+ :class="{ 'p-highlight': isSelected(date), 'p-disabled': !date.selectable }"
137
+ @click="onDateSelect($event, date)"
138
+ draggable="false"
139
+ @keydown="onDateCellKeydown($event, date, groupIndex)"
140
+ :aria-selected="isSelected(date)"
141
+ >
142
+ <slot name="date" :date="date">{{ date.day }}</slot>
61
143
  </span>
62
144
  <div v-if="isSelected(date)" class="p-hidden-accessible" aria-live="polite">
63
- {{date.day}}
145
+ {{ date.day }}
64
146
  </div>
65
147
  </td>
66
148
  </tr>
@@ -69,81 +151,155 @@
69
151
  </div>
70
152
  </div>
71
153
  </div>
72
- <div class="p-monthpicker" v-if="currentView === 'month'">
73
- <span v-for="(m,i) of monthPickerValues" :key="m" @click="onMonthSelect($event, i)" @keydown="onMonthCellKeydown($event,i)"
74
- class="p-monthpicker-month" :class="{'p-highlight': isMonthSelected(i)}" v-ripple>
75
- {{m}}
154
+ <div v-if="currentView === 'month'" class="p-monthpicker">
155
+ <span v-for="(m, i) of monthPickerValues" :key="m" v-ripple @click="onMonthSelect($event, i)" @keydown="onMonthCellKeydown($event, i)" class="p-monthpicker-month" :class="{ 'p-highlight': isMonthSelected(i) }">
156
+ {{ m }}
76
157
  <div v-if="isMonthSelected(i)" class="p-hidden-accessible" aria-live="polite">
77
- {{m}}
158
+ {{ m }}
78
159
  </div>
79
160
  </span>
80
161
  </div>
81
- <div class="p-yearpicker" v-if="currentView === 'year'">
82
- <span v-for="y of yearPickerValues" :key="y" @click="onYearSelect($event, y)" @keydown="onYearCellKeydown($event,y)"
83
- class="p-yearpicker-year" :class="{'p-highlight': isYearSelected(y)}" v-ripple>
84
- {{y}}
162
+ <div v-if="currentView === 'year'" class="p-yearpicker">
163
+ <span v-for="y of yearPickerValues" :key="y" v-ripple @click="onYearSelect($event, y)" @keydown="onYearCellKeydown($event, y)" class="p-yearpicker-year" :class="{ 'p-highlight': isYearSelected(y) }">
164
+ {{ y }}
85
165
  <div v-if="isYearSelected(y)" class="p-hidden-accessible" aria-live="polite">
86
- {{y}}
166
+ {{ y }}
87
167
  </div>
88
168
  </span>
89
169
  </div>
90
170
  </template>
91
- <div class="p-timepicker" v-if="(showTime||timeOnly) && currentView === 'date'">
171
+ <div v-if="(showTime || timeOnly) && currentView === 'date'" class="p-timepicker">
92
172
  <div class="p-hour-picker">
93
- <button class="p-link" :aria-label="$primevue.config.locale.nextHour" @mousedown="onTimePickerElementMouseDown($event, 0, 1)" @mouseup="onTimePickerElementMouseUp($event)" @keydown="onContainerButtonKeydown" v-ripple
94
- @mouseleave="onTimePickerElementMouseLeave()" @keydown.enter="onTimePickerElementMouseDown($event, 0, 1)" @keydown.space="onTimePickerElementMouseDown($event, 0, 1)" @keyup.enter="onTimePickerElementMouseUp($event)" @keyup.space="onTimePickerElementMouseUp($event)" type="button">
173
+ <button
174
+ v-ripple
175
+ class="p-link"
176
+ :aria-label="$primevue.config.locale.nextHour"
177
+ @mousedown="onTimePickerElementMouseDown($event, 0, 1)"
178
+ @mouseup="onTimePickerElementMouseUp($event)"
179
+ @keydown="onContainerButtonKeydown"
180
+ @mouseleave="onTimePickerElementMouseLeave()"
181
+ @keydown.enter="onTimePickerElementMouseDown($event, 0, 1)"
182
+ @keydown.space="onTimePickerElementMouseDown($event, 0, 1)"
183
+ @keyup.enter="onTimePickerElementMouseUp($event)"
184
+ @keyup.space="onTimePickerElementMouseUp($event)"
185
+ type="button"
186
+ >
95
187
  <span class="pi pi-chevron-up"></span>
96
188
  </button>
97
- <span>{{formattedCurrentHour}}</span>
98
- <button class="p-link" :aria-label="$primevue.config.locale.prevHour" @mousedown="onTimePickerElementMouseDown($event, 0, -1)" @mouseup="onTimePickerElementMouseUp($event)" @keydown="onContainerButtonKeydown" v-ripple
99
- @mouseleave="onTimePickerElementMouseLeave()" @keydown.enter="onTimePickerElementMouseDown($event, 0, -1)" @keydown.space="onTimePickerElementMouseDown($event, 0, -1)" @keyup.enter="onTimePickerElementMouseUp($event)" @keyup.space="onTimePickerElementMouseUp($event)" type="button">
189
+ <span>{{ formattedCurrentHour }}</span>
190
+ <button
191
+ v-ripple
192
+ class="p-link"
193
+ :aria-label="$primevue.config.locale.prevHour"
194
+ @mousedown="onTimePickerElementMouseDown($event, 0, -1)"
195
+ @mouseup="onTimePickerElementMouseUp($event)"
196
+ @keydown="onContainerButtonKeydown"
197
+ @mouseleave="onTimePickerElementMouseLeave()"
198
+ @keydown.enter="onTimePickerElementMouseDown($event, 0, -1)"
199
+ @keydown.space="onTimePickerElementMouseDown($event, 0, -1)"
200
+ @keyup.enter="onTimePickerElementMouseUp($event)"
201
+ @keyup.space="onTimePickerElementMouseUp($event)"
202
+ type="button"
203
+ >
100
204
  <span class="pi pi-chevron-down"></span>
101
205
  </button>
102
206
  </div>
103
207
  <div class="p-separator">
104
- <span>{{timeSeparator}}</span>
208
+ <span>{{ timeSeparator }}</span>
105
209
  </div>
106
210
  <div class="p-minute-picker">
107
- <button class="p-link" :aria-label="$primevue.config.locale.nextMinute" @mousedown="onTimePickerElementMouseDown($event, 1, 1)" @mouseup="onTimePickerElementMouseUp($event)" @keydown="onContainerButtonKeydown" v-ripple :disabled="disabled"
108
- @mouseleave="onTimePickerElementMouseLeave()" @keydown.enter="onTimePickerElementMouseDown($event, 1, 1)" @keydown.space="onTimePickerElementMouseDown($event, 1, 1)" @keyup.enter="onTimePickerElementMouseUp($event)" @keyup.space="onTimePickerElementMouseUp($event)" type="button">
211
+ <button
212
+ v-ripple
213
+ class="p-link"
214
+ :aria-label="$primevue.config.locale.nextMinute"
215
+ @mousedown="onTimePickerElementMouseDown($event, 1, 1)"
216
+ @mouseup="onTimePickerElementMouseUp($event)"
217
+ @keydown="onContainerButtonKeydown"
218
+ :disabled="disabled"
219
+ @mouseleave="onTimePickerElementMouseLeave()"
220
+ @keydown.enter="onTimePickerElementMouseDown($event, 1, 1)"
221
+ @keydown.space="onTimePickerElementMouseDown($event, 1, 1)"
222
+ @keyup.enter="onTimePickerElementMouseUp($event)"
223
+ @keyup.space="onTimePickerElementMouseUp($event)"
224
+ type="button"
225
+ >
109
226
  <span class="pi pi-chevron-up"></span>
110
227
  </button>
111
- <span>{{formattedCurrentMinute}}</span>
112
- <button class="p-link" :aria-label="$primevue.config.locale.prevMinute" @mousedown="onTimePickerElementMouseDown($event, 1, -1)" @mouseup="onTimePickerElementMouseUp($event)" @keydown="onContainerButtonKeydown" v-ripple :disabled="disabled"
113
- @mouseleave="onTimePickerElementMouseLeave()" @keydown.enter="onTimePickerElementMouseDown($event, 1, -1)" @keydown.space="onTimePickerElementMouseDown($event, 1, -1)" @keyup.enter="onTimePickerElementMouseUp($event)" @keyup.space="onTimePickerElementMouseUp($event)" type="button">
228
+ <span>{{ formattedCurrentMinute }}</span>
229
+ <button
230
+ v-ripple
231
+ class="p-link"
232
+ :aria-label="$primevue.config.locale.prevMinute"
233
+ @mousedown="onTimePickerElementMouseDown($event, 1, -1)"
234
+ @mouseup="onTimePickerElementMouseUp($event)"
235
+ @keydown="onContainerButtonKeydown"
236
+ :disabled="disabled"
237
+ @mouseleave="onTimePickerElementMouseLeave()"
238
+ @keydown.enter="onTimePickerElementMouseDown($event, 1, -1)"
239
+ @keydown.space="onTimePickerElementMouseDown($event, 1, -1)"
240
+ @keyup.enter="onTimePickerElementMouseUp($event)"
241
+ @keyup.space="onTimePickerElementMouseUp($event)"
242
+ type="button"
243
+ >
114
244
  <span class="pi pi-chevron-down"></span>
115
245
  </button>
116
246
  </div>
117
- <div class="p-separator" v-if="showSeconds">
118
- <span>{{timeSeparator}}</span>
247
+ <div v-if="showSeconds" class="p-separator">
248
+ <span>{{ timeSeparator }}</span>
119
249
  </div>
120
- <div class="p-second-picker" v-if="showSeconds">
121
- <button class="p-link" :aria-label="$primevue.config.locale.nextSecond" @mousedown="onTimePickerElementMouseDown($event, 2, 1)" @mouseup="onTimePickerElementMouseUp($event)" @keydown="onContainerButtonKeydown" v-ripple :disabled="disabled"
122
- @mouseleave="onTimePickerElementMouseLeave()" @keydown.enter="onTimePickerElementMouseDown($event, 2, 1)" @keydown.space="onTimePickerElementMouseDown($event, 2, 1)" @keyup.enter="onTimePickerElementMouseUp($event)" @keyup.space="onTimePickerElementMouseUp($event)" type="button">
250
+ <div v-if="showSeconds" class="p-second-picker">
251
+ <button
252
+ v-ripple
253
+ class="p-link"
254
+ :aria-label="$primevue.config.locale.nextSecond"
255
+ @mousedown="onTimePickerElementMouseDown($event, 2, 1)"
256
+ @mouseup="onTimePickerElementMouseUp($event)"
257
+ @keydown="onContainerButtonKeydown"
258
+ :disabled="disabled"
259
+ @mouseleave="onTimePickerElementMouseLeave()"
260
+ @keydown.enter="onTimePickerElementMouseDown($event, 2, 1)"
261
+ @keydown.space="onTimePickerElementMouseDown($event, 2, 1)"
262
+ @keyup.enter="onTimePickerElementMouseUp($event)"
263
+ @keyup.space="onTimePickerElementMouseUp($event)"
264
+ type="button"
265
+ >
123
266
  <span class="pi pi-chevron-up"></span>
124
267
  </button>
125
- <span>{{formattedCurrentSecond}}</span>
126
- <button class="p-link" :aria-label="$primevue.config.locale.prevSecond" @mousedown="onTimePickerElementMouseDown($event, 2, -1)" @mouseup="onTimePickerElementMouseUp($event)" @keydown="onContainerButtonKeydown" v-ripple :disabled="disabled"
127
- @mouseleave="onTimePickerElementMouseLeave()" @keydown.enter="onTimePickerElementMouseDown($event, 2, -1)" @keydown.space="onTimePickerElementMouseDown($event, 2, -1)" @keyup.enter="onTimePickerElementMouseUp($event)" @keyup.space="onTimePickerElementMouseUp($event)" type="button">
268
+ <span>{{ formattedCurrentSecond }}</span>
269
+ <button
270
+ v-ripple
271
+ class="p-link"
272
+ :aria-label="$primevue.config.locale.prevSecond"
273
+ @mousedown="onTimePickerElementMouseDown($event, 2, -1)"
274
+ @mouseup="onTimePickerElementMouseUp($event)"
275
+ @keydown="onContainerButtonKeydown"
276
+ :disabled="disabled"
277
+ @mouseleave="onTimePickerElementMouseLeave()"
278
+ @keydown.enter="onTimePickerElementMouseDown($event, 2, -1)"
279
+ @keydown.space="onTimePickerElementMouseDown($event, 2, -1)"
280
+ @keyup.enter="onTimePickerElementMouseUp($event)"
281
+ @keyup.space="onTimePickerElementMouseUp($event)"
282
+ type="button"
283
+ >
128
284
  <span class="pi pi-chevron-down"></span>
129
285
  </button>
130
286
  </div>
131
- <div class="p-separator" v-if="hourFormat=='12'">
132
- <span>{{timeSeparator}}</span>
287
+ <div v-if="hourFormat == '12'" class="p-separator">
288
+ <span>{{ timeSeparator }}</span>
133
289
  </div>
134
- <div class="p-ampm-picker" v-if="hourFormat=='12'">
135
- <button class="p-link" :aria-label="$primevue.config.locale.am" @click="toggleAMPM($event)" type="button" v-ripple :disabled="disabled">
290
+ <div v-if="hourFormat == '12'" class="p-ampm-picker">
291
+ <button v-ripple class="p-link" :aria-label="$primevue.config.locale.am" @click="toggleAMPM($event)" type="button" :disabled="disabled">
136
292
  <span class="pi pi-chevron-up"></span>
137
293
  </button>
138
- <span>{{pm ? 'PM' : 'AM'}}</span>
139
- <button class="p-link" :aria-label="$primevue.config.locale.pm" @click="toggleAMPM($event)" type="button" v-ripple :disabled="disabled">
294
+ <span>{{ pm ? 'PM' : 'AM' }}</span>
295
+ <button v-ripple class="p-link" :aria-label="$primevue.config.locale.pm" @click="toggleAMPM($event)" type="button" :disabled="disabled">
140
296
  <span class="pi pi-chevron-down"></span>
141
297
  </button>
142
298
  </div>
143
299
  </div>
144
- <div class="p-datepicker-buttonbar" v-if="showButtonBar">
145
- <CalendarButton type="button" :label="todayLabel" @click="onTodayButtonClick($event)" class="p-button-text" @keydown="onContainerButtonKeydown"/>
146
- <CalendarButton type="button" :label="clearLabel" @click="onClearButtonClick($event)" class="p-button-text" @keydown="onContainerButtonKeydown"/>
300
+ <div v-if="showButtonBar" class="p-datepicker-buttonbar">
301
+ <CalendarButton type="button" :label="todayLabel" @click="onTodayButtonClick($event)" class="p-button-text" @keydown="onContainerButtonKeydown" />
302
+ <CalendarButton type="button" :label="clearLabel" @click="onClearButtonClick($event)" class="p-button-text" @keydown="onContainerButtonKeydown" />
147
303
  </div>
148
304
  <slot name="footer"></slot>
149
305
  </div>
@@ -153,7 +309,7 @@
153
309
  </template>
154
310
 
155
311
  <script>
156
- import {ConnectedOverlayScrollHandler,DomHandler,ZIndexUtils,UniqueComponentId} from 'primevue/utils';
312
+ import { ConnectedOverlayScrollHandler, DomHandler, ZIndexUtils, UniqueComponentId } from 'primevue/utils';
157
313
  import OverlayEventBus from 'primevue/overlayeventbus';
158
314
  import Button from 'primevue/button';
159
315
  import Ripple from 'primevue/ripple';
@@ -321,17 +477,41 @@ export default {
321
477
  type: String,
322
478
  default: null
323
479
  },
324
- id: null,
325
- inputId: null,
326
- inputClass: null,
327
- inputStyle: null,
328
- inputProps: null,
329
- panelClass: null,
330
- panelStyle: null,
331
- panelProps: null,
480
+ id: {
481
+ type: String,
482
+ default: null
483
+ },
484
+ inputId: {
485
+ type: String,
486
+ default: null
487
+ },
488
+ inputClass: {
489
+ type: String,
490
+ default: null
491
+ },
492
+ inputStyle: {
493
+ type: null,
494
+ default: null
495
+ },
496
+ inputProps: {
497
+ type: null,
498
+ default: null
499
+ },
500
+ panelClass: {
501
+ type: String,
502
+ default: null
503
+ },
504
+ panelStyle: {
505
+ type: null,
506
+ default: null
507
+ },
508
+ panelProps: {
509
+ type: null,
510
+ default: null
511
+ },
332
512
  'aria-labelledby': {
333
513
  type: String,
334
- default: null
514
+ default: null
335
515
  },
336
516
  'aria-label': {
337
517
  type: String,
@@ -350,6 +530,55 @@ export default {
350
530
  timePickerTimer: null,
351
531
  preventFocus: false,
352
532
  typeUpdate: false,
533
+ data() {
534
+ return {
535
+ currentMonth: null,
536
+ currentYear: null,
537
+ currentHour: null,
538
+ currentMinute: null,
539
+ currentSecond: null,
540
+ pm: null,
541
+ focused: false,
542
+ overlayVisible: false,
543
+ currentView: this.view
544
+ };
545
+ },
546
+ watch: {
547
+ modelValue(newValue) {
548
+ this.updateCurrentMetaData();
549
+
550
+ if (!this.typeUpdate && !this.inline && this.input) {
551
+ this.input.value = this.formatValue(newValue);
552
+ }
553
+
554
+ this.typeUpdate = false;
555
+ },
556
+ showTime() {
557
+ this.updateCurrentMetaData();
558
+ },
559
+ months() {
560
+ if (this.overlay) {
561
+ if (!this.focused) {
562
+ if (this.inline) {
563
+ this.preventFocus = true;
564
+ }
565
+
566
+ setTimeout(this.updateFocus, 0);
567
+ }
568
+ }
569
+ },
570
+ numberOfMonths() {
571
+ this.destroyResponsiveStyleElement();
572
+ this.createResponsiveStyle();
573
+ },
574
+ responsiveOptions() {
575
+ this.destroyResponsiveStyleElement();
576
+ this.createResponsiveStyle();
577
+ },
578
+ currentView() {
579
+ Promise.resolve(null).then(() => this.alignOverlay());
580
+ }
581
+ },
353
582
  created() {
354
583
  this.updateCurrentMetaData();
355
584
  },
@@ -367,8 +596,7 @@ export default {
367
596
  this.overlay.style.width = DomHandler.getOuterWidth(this.$el) + 'px';
368
597
  }
369
598
  }
370
- }
371
- else {
599
+ } else {
372
600
  this.input.value = this.formatValue(this.modelValue);
373
601
  }
374
602
  },
@@ -393,6 +621,7 @@ export default {
393
621
  if (this.mask) {
394
622
  this.destroyMask();
395
623
  }
624
+
396
625
  this.destroyResponsiveStyleElement();
397
626
 
398
627
  this.unbindOutsideClickListener();
@@ -406,51 +635,9 @@ export default {
406
635
  if (this.overlay && this.autoZIndex) {
407
636
  ZIndexUtils.clear(this.overlay);
408
637
  }
638
+
409
639
  this.overlay = null;
410
640
  },
411
- data() {
412
- return {
413
- currentMonth: null,
414
- currentYear: null,
415
- currentHour: null,
416
- currentMinute: null,
417
- currentSecond: null,
418
- pm: null,
419
- focused: false,
420
- overlayVisible: false,
421
- currentView: this.view
422
- }
423
- },
424
- watch: {
425
- modelValue(newValue) {
426
- this.updateCurrentMetaData();
427
- if (!this.typeUpdate && !this.inline && this.input) {
428
- this.input.value = this.formatValue(newValue);
429
- }
430
- this.typeUpdate = false;
431
- },
432
- showTime() {
433
- this.updateCurrentMetaData();
434
- },
435
- months() {
436
- if (this.overlay) {
437
- if (!this.focused) {
438
- setTimeout(this.updateFocus, 0);
439
- }
440
- }
441
- },
442
- numberOfMonths() {
443
- this.destroyResponsiveStyleElement();
444
- this.createResponsiveStyle();
445
- },
446
- responsiveOptions() {
447
- this.destroyResponsiveStyleElement();
448
- this.createResponsiveStyle();
449
- },
450
- currentView() {
451
- Promise.resolve(null).then(() => this.alignOverlay());
452
- }
453
- },
454
641
  methods: {
455
642
  isComparable() {
456
643
  return this.modelValue != null && typeof this.modelValue !== 'string';
@@ -463,25 +650,23 @@ export default {
463
650
  if (this.modelValue) {
464
651
  if (this.isSingleSelection()) {
465
652
  return this.isDateEquals(this.modelValue, dateMeta);
466
- }
467
- else if (this.isMultipleSelection()) {
653
+ } else if (this.isMultipleSelection()) {
468
654
  let selected = false;
655
+
469
656
  for (let date of this.modelValue) {
470
657
  selected = this.isDateEquals(date, dateMeta);
658
+
471
659
  if (selected) {
472
660
  break;
473
661
  }
474
662
  }
475
663
 
476
664
  return selected;
477
- }
478
- else if (this.isRangeSelection()) {
479
- if (this.modelValue[1])
480
- return this.isDateEquals(this.modelValue[0], dateMeta) || this.isDateEquals(this.modelValue[1], dateMeta) || this.isDateBetween(this.modelValue[0], this.modelValue[1], dateMeta);
665
+ } else if (this.isRangeSelection()) {
666
+ if (this.modelValue[1]) return this.isDateEquals(this.modelValue[0], dateMeta) || this.isDateEquals(this.modelValue[1], dateMeta) || this.isDateBetween(this.modelValue[0], this.modelValue[1], dateMeta);
481
667
  else {
482
668
  return this.isDateEquals(this.modelValue[0], dateMeta);
483
669
  }
484
-
485
670
  }
486
671
  }
487
672
 
@@ -491,7 +676,7 @@ export default {
491
676
  if (this.isComparable()) {
492
677
  let value = this.isRangeSelection() ? this.modelValue[0] : this.modelValue;
493
678
 
494
- return !this.isMultipleSelection() ? (value.getMonth() === month && value.getFullYear() === this.currentYear) : false;
679
+ return !this.isMultipleSelection() ? value.getMonth() === month && value.getFullYear() === this.currentYear : false;
495
680
  }
496
681
 
497
682
  return false;
@@ -500,21 +685,21 @@ export default {
500
685
  if (this.isComparable()) {
501
686
  let value = this.isRangeSelection() ? this.modelValue[0] : this.modelValue;
502
687
 
503
- return !this.isMultipleSelection() && this.isComparable() ? (value.getFullYear() === year) : false;
688
+ return !this.isMultipleSelection() && this.isComparable() ? value.getFullYear() === year : false;
504
689
  }
505
690
 
506
691
  return false;
507
692
  },
508
693
  isDateEquals(value, dateMeta) {
509
- if (value)
510
- return value.getDate() === dateMeta.day && value.getMonth() === dateMeta.month && value.getFullYear() === dateMeta.year;
511
- else
512
- return false;
694
+ if (value) return value.getDate() === dateMeta.day && value.getMonth() === dateMeta.month && value.getFullYear() === dateMeta.year;
695
+ else return false;
513
696
  },
514
697
  isDateBetween(start, end, dateMeta) {
515
698
  let between = false;
699
+
516
700
  if (start && end) {
517
701
  let date = new Date(dateMeta.year, dateMeta.month, dateMeta.day);
702
+
518
703
  return start.getTime() <= date.getTime() && end.getTime() >= date.getTime();
519
704
  }
520
705
 
@@ -522,11 +707,13 @@ export default {
522
707
  },
523
708
  getFirstDayOfMonthIndex(month, year) {
524
709
  let day = new Date();
710
+
525
711
  day.setDate(1);
526
712
  day.setMonth(month);
527
713
  day.setFullYear(year);
528
714
 
529
715
  let dayIndex = day.getDay() + this.sundayIndex;
716
+
530
717
  return dayIndex >= 7 ? dayIndex - 7 : dayIndex;
531
718
  },
532
719
  getDaysCountInMonth(month, year) {
@@ -534,6 +721,7 @@ export default {
534
721
  },
535
722
  getDaysCountInPrevMonth(month, year) {
536
723
  let prev = this.getPreviousMonthAndYear(month, year);
724
+
537
725
  return this.getDaysCountInMonth(prev.month, prev.year);
538
726
  },
539
727
  getPreviousMonthAndYear(month, year) {
@@ -542,13 +730,12 @@ export default {
542
730
  if (month === 0) {
543
731
  m = 11;
544
732
  y = year - 1;
545
- }
546
- else {
733
+ } else {
547
734
  m = month - 1;
548
735
  y = year;
549
736
  }
550
737
 
551
- return {'month':m, 'year': y};
738
+ return { month: m, year: y };
552
739
  },
553
740
  getNextMonthAndYear(month, year) {
554
741
  let m, y;
@@ -556,13 +743,12 @@ export default {
556
743
  if (month === 11) {
557
744
  m = 0;
558
745
  y = year + 1;
559
- }
560
- else {
746
+ } else {
561
747
  m = month + 1;
562
748
  y = year;
563
749
  }
564
750
 
565
- return {'month':m,'year':y};
751
+ return { month: m, year: y };
566
752
  },
567
753
  daylightSavingAdjust(date) {
568
754
  if (!date) {
@@ -589,12 +775,10 @@ export default {
589
775
  if (this.minDate) {
590
776
  if (this.minDate.getFullYear() > year) {
591
777
  validMin = false;
592
- }
593
- else if (this.minDate.getFullYear() === year) {
778
+ } else if (this.minDate.getFullYear() === year) {
594
779
  if (this.minDate.getMonth() > month) {
595
780
  validMin = false;
596
- }
597
- else if (this.minDate.getMonth() === month) {
781
+ } else if (this.minDate.getMonth() === month) {
598
782
  if (this.minDate.getDate() > day) {
599
783
  validMin = false;
600
784
  }
@@ -605,12 +789,10 @@ export default {
605
789
  if (this.maxDate) {
606
790
  if (this.maxDate.getFullYear() < year) {
607
791
  validMax = false;
608
- }
609
- else if (this.maxDate.getFullYear() === year) {
792
+ } else if (this.maxDate.getFullYear() === year) {
610
793
  if (this.maxDate.getMonth() < month) {
611
794
  validMax = false;
612
- }
613
- else if (this.maxDate.getMonth() === month) {
795
+ } else if (this.maxDate.getMonth() === month) {
614
796
  if (this.maxDate.getDate() < day) {
615
797
  validMax = false;
616
798
  }
@@ -619,11 +801,11 @@ export default {
619
801
  }
620
802
 
621
803
  if (this.disabledDates) {
622
- validDate = !this.isDateDisabled(day,month,year);
804
+ validDate = !this.isDateDisabled(day, month, year);
623
805
  }
624
806
 
625
807
  if (this.disabledDays) {
626
- validDay = !this.isDayDisabled(day,month,year)
808
+ validDay = !this.isDayDisabled(day, month, year);
627
809
  }
628
810
 
629
811
  return validMin && validMax && validDate && validDay;
@@ -632,10 +814,8 @@ export default {
632
814
  el.setAttribute(this.attributeSelector, '');
633
815
 
634
816
  if (this.autoZIndex) {
635
- if (this.touchUI)
636
- ZIndexUtils.set('modal', el, this.baseZIndex || this.$primevue.config.zIndex.modal);
637
- else
638
- ZIndexUtils.set('overlay', el, this.baseZIndex || this.$primevue.config.zIndex.overlay);
817
+ if (this.touchUI) ZIndexUtils.set('modal', el, this.baseZIndex || this.$primevue.config.zIndex.modal);
818
+ else ZIndexUtils.set('overlay', el, this.baseZIndex || this.$primevue.config.zIndex.overlay);
639
819
  }
640
820
 
641
821
  this.alignOverlay();
@@ -665,14 +845,14 @@ export default {
665
845
  this.overlay = null;
666
846
  },
667
847
  onPrevButtonClick(event) {
668
- if(this.showOtherMonths) {
669
- this.navigationState = {backward: true, button: true};
848
+ if (this.showOtherMonths) {
849
+ this.navigationState = { backward: true, button: true };
670
850
  this.navBackward(event);
671
851
  }
672
852
  },
673
853
  onNextButtonClick(event) {
674
- if(this.showOtherMonths) {
675
- this.navigationState = {backward: false, button: true};
854
+ if (this.showOtherMonths) {
855
+ this.navigationState = { backward: false, button: true };
676
856
  this.navForward(event);
677
857
  }
678
858
  },
@@ -685,24 +865,20 @@ export default {
685
865
 
686
866
  if (this.currentView === 'month') {
687
867
  this.decrementYear();
688
- }
689
- else if (this.currentView === 'year') {
868
+ } else if (this.currentView === 'year') {
690
869
  this.decrementDecade();
691
- }
692
- else {
870
+ } else {
693
871
  if (event.shiftKey) {
694
872
  this.decrementYear();
695
- }
696
- else {
873
+ } else {
697
874
  if (this.currentMonth === 0) {
698
875
  this.currentMonth = 11;
699
876
  this.decrementYear();
700
- }
701
- else {
877
+ } else {
702
878
  this.currentMonth--;
703
879
  }
704
880
 
705
- this.$emit('month-change', {month: this.currentMonth + 1, year: this.currentYear});
881
+ this.$emit('month-change', { month: this.currentMonth + 1, year: this.currentYear });
706
882
  }
707
883
  }
708
884
  },
@@ -715,24 +891,20 @@ export default {
715
891
 
716
892
  if (this.currentView === 'month') {
717
893
  this.incrementYear();
718
- }
719
- else if (this.currentView === 'year') {
894
+ } else if (this.currentView === 'year') {
720
895
  this.incrementDecade();
721
- }
722
- else {
896
+ } else {
723
897
  if (event.shiftKey) {
724
898
  this.incrementYear();
725
- }
726
- else {
899
+ } else {
727
900
  if (this.currentMonth === 11) {
728
901
  this.currentMonth = 0;
729
902
  this.incrementYear();
730
- }
731
- else {
903
+ } else {
732
904
  this.currentMonth++;
733
905
  }
734
906
 
735
- this.$emit('month-change', {month: this.currentMonth + 1, year: this.currentYear});
907
+ this.$emit('month-change', { month: this.currentMonth + 1, year: this.currentYear });
736
908
  }
737
909
  }
738
910
  },
@@ -767,10 +939,8 @@ export default {
767
939
  if (this.hourFormat === '12') {
768
940
  this.pm = currentHour > 11;
769
941
 
770
- if (currentHour >= 12)
771
- currentHour = (currentHour == 12) ? 12 : currentHour - 12;
772
- else
773
- currentHour = (currentHour == 0) ? 12 : currentHour;
942
+ if (currentHour >= 12) currentHour = currentHour == 12 ? 12 : currentHour - 12;
943
+ else currentHour = currentHour == 0 ? 12 : currentHour;
774
944
  }
775
945
 
776
946
  this.currentHour = Math.floor(currentHour / this.stepHour) * this.stepHour;
@@ -784,6 +954,7 @@ export default {
784
954
  this.overlayVisible = false;
785
955
  }
786
956
  };
957
+
787
958
  document.addEventListener('mousedown', this.outsideClickListener);
788
959
  }
789
960
  },
@@ -816,6 +987,7 @@ export default {
816
987
  this.overlayVisible = false;
817
988
  }
818
989
  };
990
+
819
991
  window.addEventListener('resize', this.resizeListener);
820
992
  }
821
993
  },
@@ -826,27 +998,27 @@ export default {
826
998
  }
827
999
  },
828
1000
  isOutsideClicked(event) {
829
- return !(this.$el.isSameNode(event.target) || this.isNavIconClicked(event) ||
830
- this.$el.contains(event.target) || (this.overlay && this.overlay.contains(event.target)));
1001
+ return !(this.$el.isSameNode(event.target) || this.isNavIconClicked(event) || this.$el.contains(event.target) || (this.overlay && this.overlay.contains(event.target)));
831
1002
  },
832
1003
  isNavIconClicked(event) {
833
- return (DomHandler.hasClass(event.target, 'p-datepicker-prev') || DomHandler.hasClass(event.target, 'p-datepicker-prev-icon')
834
- || DomHandler.hasClass(event.target, 'p-datepicker-next') || DomHandler.hasClass(event.target, 'p-datepicker-next-icon'));
1004
+ return (
1005
+ DomHandler.hasClass(event.target, 'p-datepicker-prev') ||
1006
+ DomHandler.hasClass(event.target, 'p-datepicker-prev-icon') ||
1007
+ DomHandler.hasClass(event.target, 'p-datepicker-next') ||
1008
+ DomHandler.hasClass(event.target, 'p-datepicker-next-icon')
1009
+ );
835
1010
  },
836
1011
  alignOverlay() {
837
1012
  if (this.touchUI) {
838
1013
  this.enableModality();
839
- }
840
- else if (this.overlay) {
1014
+ } else if (this.overlay) {
841
1015
  if (this.appendTo === 'self' || this.inline) {
842
1016
  DomHandler.relativePosition(this.overlay, this.$el);
843
- }
844
- else {
1017
+ } else {
845
1018
  if (this.view === 'date') {
846
1019
  this.overlay.style.width = DomHandler.getOuterWidth(this.overlay) + 'px';
847
1020
  this.overlay.style.minWidth = DomHandler.getOuterWidth(this.$el) + 'px';
848
- }
849
- else {
1021
+ } else {
850
1022
  this.overlay.style.width = DomHandler.getOuterWidth(this.$el) + 'px';
851
1023
  }
852
1024
 
@@ -859,8 +1031,7 @@ export default {
859
1031
  if (!this.overlayVisible) {
860
1032
  this.input.focus();
861
1033
  this.overlayVisible = true;
862
- }
863
- else {
1034
+ } else {
864
1035
  this.overlayVisible = false;
865
1036
  }
866
1037
  }
@@ -880,41 +1051,42 @@ export default {
880
1051
  if (this.disabledDays) {
881
1052
  let weekday = new Date(year, month, day);
882
1053
  let weekdayNumber = weekday.getDay();
1054
+
883
1055
  return this.disabledDays.indexOf(weekdayNumber) !== -1;
884
1056
  }
1057
+
885
1058
  return false;
886
1059
  },
887
1060
  onMonthDropdownChange(value) {
888
1061
  this.currentMonth = parseInt(value);
889
- this.$emit('month-change', {month: this.currentMonth + 1, year: this.currentYear});
1062
+ this.$emit('month-change', { month: this.currentMonth + 1, year: this.currentYear });
890
1063
  },
891
1064
  onYearDropdownChange(value) {
892
1065
  this.currentYear = parseInt(value);
893
- this.$emit('year-change', {month: this.currentMonth + 1, year: this.currentYear});
1066
+ this.$emit('year-change', { month: this.currentMonth + 1, year: this.currentYear });
894
1067
  },
895
1068
  onDateSelect(event, dateMeta) {
896
1069
  if (this.disabled || !dateMeta.selectable) {
897
1070
  return;
898
1071
  }
899
1072
 
900
- DomHandler.find(this.overlay, '.p-datepicker-calendar td span:not(.p-disabled)').forEach(cell => cell.tabIndex = -1);
1073
+ DomHandler.find(this.overlay, '.p-datepicker-calendar td span:not(.p-disabled)').forEach((cell) => (cell.tabIndex = -1));
901
1074
 
902
1075
  if (event) {
903
1076
  event.currentTarget.focus();
904
1077
  }
905
1078
 
906
1079
  if (this.isMultipleSelection() && this.isSelected(dateMeta)) {
907
- let newValue = this.modelValue.filter(date => !this.isDateEquals(date, dateMeta));
1080
+ let newValue = this.modelValue.filter((date) => !this.isDateEquals(date, dateMeta));
1081
+
908
1082
  this.updateModel(newValue);
909
- }
910
- else {
1083
+ } else {
911
1084
  if (this.shouldSelectDate(dateMeta)) {
912
1085
  if (dateMeta.otherMonth) {
913
1086
  this.currentMonth = dateMeta.month;
914
1087
  this.currentYear = dateMeta.year;
915
1088
  this.selectDate(dateMeta);
916
- }
917
- else {
1089
+ } else {
918
1090
  this.selectDate(dateMeta);
919
1091
  }
920
1092
  }
@@ -931,10 +1103,8 @@ export default {
931
1103
  let date = new Date(dateMeta.year, dateMeta.month, dateMeta.day);
932
1104
 
933
1105
  if (this.showTime) {
934
- if (this.hourFormat === '12' && this.pm && this.currentHour != 12)
935
- date.setHours(this.currentHour + 12);
936
- else
937
- date.setHours(this.currentHour);
1106
+ if (this.hourFormat === '12' && this.pm && this.currentHour != 12) date.setHours(this.currentHour + 12);
1107
+ else date.setHours(this.currentHour);
938
1108
 
939
1109
  date.setMinutes(this.currentMinute);
940
1110
  date.setSeconds(this.currentSecond);
@@ -958,25 +1128,22 @@ export default {
958
1128
 
959
1129
  if (this.isSingleSelection()) {
960
1130
  modelVal = date;
961
- }
962
- else if (this.isMultipleSelection()) {
1131
+ } else if (this.isMultipleSelection()) {
963
1132
  modelVal = this.modelValue ? [...this.modelValue, date] : [date];
964
- }
965
- else if (this.isRangeSelection()) {
1133
+ } else if (this.isRangeSelection()) {
966
1134
  if (this.modelValue && this.modelValue.length) {
967
1135
  let startDate = this.modelValue[0];
968
1136
  let endDate = this.modelValue[1];
969
1137
 
970
1138
  if (!endDate && date.getTime() >= startDate.getTime()) {
971
1139
  endDate = date;
972
- }
973
- else {
1140
+ } else {
974
1141
  startDate = date;
975
1142
  endDate = null;
976
1143
  }
1144
+
977
1145
  modelVal = [startDate, endDate];
978
- }
979
- else {
1146
+ } else {
980
1147
  modelVal = [date, null];
981
1148
  }
982
1149
  }
@@ -990,16 +1157,15 @@ export default {
990
1157
  this.overlayVisible = false;
991
1158
  }, 150);
992
1159
  }
1160
+
993
1161
  this.$emit('date-select', date);
994
1162
  },
995
1163
  updateModel(value) {
996
1164
  this.$emit('update:modelValue', value);
997
1165
  },
998
1166
  shouldSelectDate() {
999
- if (this.isMultipleSelection())
1000
- return this.maxDateCount != null ? this.maxDateCount > (this.modelValue ? this.modelValue.length : 0) : true;
1001
- else
1002
- return true;
1167
+ if (this.isMultipleSelection()) return this.maxDateCount != null ? this.maxDateCount > (this.modelValue ? this.modelValue.length : 0) : true;
1168
+ else return true;
1003
1169
  },
1004
1170
  isSingleSelection() {
1005
1171
  return this.selectionMode === 'single';
@@ -1016,33 +1182,34 @@ export default {
1016
1182
  }
1017
1183
 
1018
1184
  let formattedValue = '';
1185
+
1019
1186
  if (value) {
1020
1187
  try {
1021
1188
  if (this.isSingleSelection()) {
1022
1189
  formattedValue = this.formatDateTime(value);
1023
- }
1024
- else if (this.isMultipleSelection()) {
1025
- for(let i = 0; i < value.length; i++) {
1190
+ } else if (this.isMultipleSelection()) {
1191
+ for (let i = 0; i < value.length; i++) {
1026
1192
  let dateAsString = this.formatDateTime(value[i]);
1193
+
1027
1194
  formattedValue += dateAsString;
1028
- if(i !== (value.length - 1)) {
1195
+
1196
+ if (i !== value.length - 1) {
1029
1197
  formattedValue += ', ';
1030
1198
  }
1031
1199
  }
1032
- }
1033
- else if (this.isRangeSelection()) {
1200
+ } else if (this.isRangeSelection()) {
1034
1201
  if (value && value.length) {
1035
1202
  let startDate = value[0];
1036
1203
  let endDate = value[1];
1037
1204
 
1038
1205
  formattedValue = this.formatDateTime(startDate);
1206
+
1039
1207
  if (endDate) {
1040
1208
  formattedValue += ' - ' + this.formatDateTime(endDate);
1041
1209
  }
1042
1210
  }
1043
1211
  }
1044
- }
1045
- catch(err) {
1212
+ } catch (err) {
1046
1213
  formattedValue = value;
1047
1214
  }
1048
1215
  }
@@ -1051,13 +1218,14 @@ export default {
1051
1218
  },
1052
1219
  formatDateTime(date) {
1053
1220
  let formattedValue = null;
1221
+
1054
1222
  if (date) {
1055
- if(this.timeOnly) {
1223
+ if (this.timeOnly) {
1056
1224
  formattedValue = this.formatTime(date);
1057
- }
1058
- else {
1225
+ } else {
1059
1226
  formattedValue = this.formatDate(date, this.datePattern);
1060
- if(this.showTime) {
1227
+
1228
+ if (this.showTime) {
1061
1229
  formattedValue += ' ' + this.formatTime(date);
1062
1230
  }
1063
1231
  }
@@ -1071,32 +1239,38 @@ export default {
1071
1239
  }
1072
1240
 
1073
1241
  let iFormat;
1242
+
1074
1243
  const lookAhead = (match) => {
1075
- const matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
1076
- if (matches) {
1077
- iFormat++;
1078
- }
1079
- return matches;
1080
- },
1244
+ const matches = iFormat + 1 < format.length && format.charAt(iFormat + 1) === match;
1245
+
1246
+ if (matches) {
1247
+ iFormat++;
1248
+ }
1249
+
1250
+ return matches;
1251
+ },
1081
1252
  formatNumber = (match, value, len) => {
1082
1253
  let num = '' + value;
1254
+
1083
1255
  if (lookAhead(match)) {
1084
1256
  while (num.length < len) {
1085
1257
  num = '0' + num;
1086
1258
  }
1087
1259
  }
1260
+
1088
1261
  return num;
1089
1262
  },
1090
1263
  formatName = (match, value, shortNames, longNames) => {
1091
- return (lookAhead(match) ? longNames[value] : shortNames[value]);
1264
+ return lookAhead(match) ? longNames[value] : shortNames[value];
1092
1265
  };
1266
+
1093
1267
  let output = '';
1094
1268
  let literal = false;
1095
1269
 
1096
1270
  if (date) {
1097
1271
  for (iFormat = 0; iFormat < format.length; iFormat++) {
1098
1272
  if (literal) {
1099
- if (format.charAt(iFormat) === '\'' && !lookAhead('\'')) {
1273
+ if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
1100
1274
  literal = false;
1101
1275
  } else {
1102
1276
  output += format.charAt(iFormat);
@@ -1110,16 +1284,13 @@ export default {
1110
1284
  output += formatName('D', date.getDay(), this.$primevue.config.locale.dayNamesShort, this.$primevue.config.locale.dayNames);
1111
1285
  break;
1112
1286
  case 'o':
1113
- output += formatNumber('o',
1114
- Math.round((
1115
- new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() -
1116
- new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);
1287
+ output += formatNumber('o', Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);
1117
1288
  break;
1118
1289
  case 'm':
1119
1290
  output += formatNumber('m', date.getMonth() + 1, 2);
1120
1291
  break;
1121
1292
  case 'M':
1122
- output += formatName('M',date.getMonth(), this.$primevue.config.locale.monthNamesShort, this.$primevue.config.locale.monthNames);
1293
+ output += formatName('M', date.getMonth(), this.$primevue.config.locale.monthNamesShort, this.$primevue.config.locale.monthNames);
1123
1294
  break;
1124
1295
  case 'y':
1125
1296
  output += lookAhead('y') ? date.getFullYear() : (date.getFullYear() % 100 < 10 ? '0' : '') + (date.getFullYear() % 100);
@@ -1130,12 +1301,13 @@ export default {
1130
1301
  case '!':
1131
1302
  output += date.getTime() * 10000 + this.ticksTo1970;
1132
1303
  break;
1133
- case '\'':
1134
- if (lookAhead('\'')) {
1135
- output += '\'';
1304
+ case "'":
1305
+ if (lookAhead("'")) {
1306
+ output += "'";
1136
1307
  } else {
1137
1308
  literal = true;
1138
1309
  }
1310
+
1139
1311
  break;
1140
1312
  default:
1141
1313
  output += format.charAt(iFormat);
@@ -1143,6 +1315,7 @@ export default {
1143
1315
  }
1144
1316
  }
1145
1317
  }
1318
+
1146
1319
  return output;
1147
1320
  },
1148
1321
  formatTime(date) {
@@ -1160,17 +1333,17 @@ export default {
1160
1333
  }
1161
1334
 
1162
1335
  if (this.hourFormat === '12') {
1163
- output += hours === 0 ? 12 : (hours < 10) ? '0' + hours : hours;
1164
- }
1165
- else {
1166
- output += (hours < 10) ? '0' + hours : hours;
1336
+ output += hours === 0 ? 12 : hours < 10 ? '0' + hours : hours;
1337
+ } else {
1338
+ output += hours < 10 ? '0' + hours : hours;
1167
1339
  }
1340
+
1168
1341
  output += ':';
1169
- output += (minutes < 10) ? '0' + minutes : minutes;
1342
+ output += minutes < 10 ? '0' + minutes : minutes;
1170
1343
 
1171
1344
  if (this.showSeconds) {
1172
1345
  output += ':';
1173
- output += (seconds < 10) ? '0' + seconds : seconds;
1346
+ output += seconds < 10 ? '0' + seconds : seconds;
1174
1347
  }
1175
1348
 
1176
1349
  if (this.hourFormat === '12') {
@@ -1217,44 +1390,39 @@ export default {
1217
1390
  this.clearTimePickerTimer();
1218
1391
  },
1219
1392
  repeat(event, interval, type, direction) {
1220
- let i = interval||500;
1393
+ let i = interval || 500;
1221
1394
 
1222
1395
  this.clearTimePickerTimer();
1223
1396
  this.timePickerTimer = setTimeout(() => {
1224
1397
  this.repeat(event, 100, type, direction);
1225
1398
  }, i);
1226
1399
 
1227
- switch(type) {
1400
+ switch (type) {
1228
1401
  case 0:
1229
- if (direction === 1)
1230
- this.incrementHour(event);
1231
- else
1232
- this.decrementHour(event);
1233
- break;
1402
+ if (direction === 1) this.incrementHour(event);
1403
+ else this.decrementHour(event);
1404
+ break;
1234
1405
 
1235
1406
  case 1:
1236
- if (direction === 1)
1237
- this.incrementMinute(event);
1238
- else
1239
- this.decrementMinute(event);
1240
- break;
1407
+ if (direction === 1) this.incrementMinute(event);
1408
+ else this.decrementMinute(event);
1409
+ break;
1241
1410
 
1242
1411
  case 2:
1243
- if (direction === 1)
1244
- this.incrementSecond(event);
1245
- else
1246
- this.decrementSecond(event);
1247
- break;
1412
+ if (direction === 1) this.incrementSecond(event);
1413
+ else this.decrementSecond(event);
1414
+ break;
1248
1415
  }
1249
1416
  },
1250
1417
  convertTo24Hour(hours, pm) {
1251
1418
  if (this.hourFormat == '12') {
1252
1419
  if (hours === 12) {
1253
- return (pm ? 12 : 0);
1420
+ return pm ? 12 : 0;
1254
1421
  } else {
1255
- return (pm ? hours + 12 : hours);
1422
+ return pm ? hours + 12 : hours;
1256
1423
  }
1257
1424
  }
1425
+
1258
1426
  return hours;
1259
1427
  },
1260
1428
  validateTime(hour, minute, second, pm) {
@@ -1264,18 +1432,23 @@ export default {
1264
1432
  if (this.isRangeSelection()) {
1265
1433
  value = this.modelValue[1] || this.modelValue[0];
1266
1434
  }
1435
+
1267
1436
  if (this.isMultipleSelection()) {
1268
1437
  value = this.modelValue[this.modelValue.length - 1];
1269
1438
  }
1439
+
1270
1440
  const valueDateString = value ? value.toDateString() : null;
1441
+
1271
1442
  if (this.minDate && valueDateString && this.minDate.toDateString() === valueDateString) {
1272
1443
  if (this.minDate.getHours() > convertedHour) {
1273
1444
  return false;
1274
1445
  }
1446
+
1275
1447
  if (this.minDate.getHours() === convertedHour) {
1276
1448
  if (this.minDate.getMinutes() > minute) {
1277
1449
  return false;
1278
1450
  }
1451
+
1279
1452
  if (this.minDate.getMinutes() === minute) {
1280
1453
  if (this.minDate.getSeconds() > second) {
1281
1454
  return false;
@@ -1288,10 +1461,12 @@ export default {
1288
1461
  if (this.maxDate.getHours() < convertedHour) {
1289
1462
  return false;
1290
1463
  }
1464
+
1291
1465
  if (this.maxDate.getHours() === convertedHour) {
1292
1466
  if (this.maxDate.getMinutes() < minute) {
1293
1467
  return false;
1294
1468
  }
1469
+
1295
1470
  if (this.maxDate.getMinutes() === minute) {
1296
1471
  if (this.maxDate.getSeconds() < second) {
1297
1472
  return false;
@@ -1299,6 +1474,7 @@ export default {
1299
1474
  }
1300
1475
  }
1301
1476
  }
1477
+
1302
1478
  return true;
1303
1479
  },
1304
1480
  incrementHour(event) {
@@ -1306,51 +1482,58 @@ export default {
1306
1482
  let newHour = this.currentHour + this.stepHour;
1307
1483
  let newPM = this.pm;
1308
1484
 
1309
- if (this.hourFormat == '24')
1310
- newHour = (newHour >= 24) ? (newHour - 24) : newHour;
1485
+ if (this.hourFormat == '24') newHour = newHour >= 24 ? newHour - 24 : newHour;
1311
1486
  else if (this.hourFormat == '12') {
1312
1487
  // Before the AM/PM break, now after
1313
1488
  if (prevHour < 12 && newHour > 11) {
1314
- newPM= !this.pm;
1489
+ newPM = !this.pm;
1315
1490
  }
1316
- newHour = (newHour >= 13) ? (newHour - 12) : newHour;
1491
+
1492
+ newHour = newHour >= 13 ? newHour - 12 : newHour;
1317
1493
  }
1318
1494
 
1319
1495
  if (this.validateTime(newHour, this.currentMinute, this.currentSecond, newPM)) {
1320
1496
  this.currentHour = newHour;
1321
1497
  this.pm = newPM;
1322
1498
  }
1499
+
1323
1500
  event.preventDefault();
1324
1501
  },
1325
1502
  decrementHour(event) {
1326
1503
  let newHour = this.currentHour - this.stepHour;
1327
1504
  let newPM = this.pm;
1328
1505
 
1329
- if (this.hourFormat == '24')
1330
- newHour = (newHour < 0) ? (24 + newHour) : newHour;
1506
+ if (this.hourFormat == '24') newHour = newHour < 0 ? 24 + newHour : newHour;
1331
1507
  else if (this.hourFormat == '12') {
1332
1508
  // If we were at noon/midnight, then switch
1333
1509
  if (this.currentHour === 12) {
1334
1510
  newPM = !this.pm;
1335
1511
  }
1336
- newHour = (newHour <= 0) ? (12 + newHour) : newHour;
1512
+
1513
+ newHour = newHour <= 0 ? 12 + newHour : newHour;
1337
1514
  }
1515
+
1338
1516
  if (this.validateTime(newHour, this.currentMinute, this.currentSecond, newPM)) {
1339
1517
  this.currentHour = newHour;
1340
1518
  this.pm = newPM;
1341
1519
  }
1520
+
1342
1521
  event.preventDefault();
1343
1522
  },
1344
1523
  incrementMinute(event) {
1345
1524
  let newMinute = this.currentMinute + this.stepMinute;
1525
+
1346
1526
  if (this.validateTime(this.currentHour, newMinute, this.currentSecond, true)) {
1347
- this.currentMinute = (newMinute > 59) ? newMinute - 60 : newMinute;
1527
+ this.currentMinute = newMinute > 59 ? newMinute - 60 : newMinute;
1348
1528
  }
1529
+
1349
1530
  event.preventDefault();
1350
1531
  },
1351
1532
  decrementMinute(event) {
1352
1533
  let newMinute = this.currentMinute - this.stepMinute;
1353
- newMinute = (newMinute < 0) ? 60 + newMinute : newMinute;
1534
+
1535
+ newMinute = newMinute < 0 ? 60 + newMinute : newMinute;
1536
+
1354
1537
  if (this.validateTime(this.currentHour, newMinute, this.currentSecond, true)) {
1355
1538
  this.currentMinute = newMinute;
1356
1539
  }
@@ -1359,15 +1542,18 @@ export default {
1359
1542
  },
1360
1543
  incrementSecond(event) {
1361
1544
  let newSecond = this.currentSecond + this.stepSecond;
1545
+
1362
1546
  if (this.validateTime(this.currentHour, this.currentMinute, newSecond, true)) {
1363
- this.currentSecond = (newSecond > 59) ? newSecond - 60 : newSecond;
1547
+ this.currentSecond = newSecond > 59 ? newSecond - 60 : newSecond;
1364
1548
  }
1365
1549
 
1366
1550
  event.preventDefault();
1367
1551
  },
1368
1552
  decrementSecond(event) {
1369
1553
  let newSecond = this.currentSecond - this.stepSecond;
1370
- newSecond = (newSecond < 0) ? 60 + newSecond : newSecond;
1554
+
1555
+ newSecond = newSecond < 0 ? 60 + newSecond : newSecond;
1556
+
1371
1557
  if (this.validateTime(this.currentHour, this.currentMinute, newSecond, true)) {
1372
1558
  this.currentSecond = newSecond;
1373
1559
  }
@@ -1381,18 +1567,17 @@ export default {
1381
1567
  if (this.isRangeSelection()) {
1382
1568
  value = this.modelValue[1] || this.modelValue[0];
1383
1569
  }
1570
+
1384
1571
  if (this.isMultipleSelection()) {
1385
1572
  value = this.modelValue[this.modelValue.length - 1];
1386
1573
  }
1574
+
1387
1575
  value = value ? new Date(value.getTime()) : new Date();
1388
1576
 
1389
1577
  if (this.hourFormat == '12') {
1390
- if (this.currentHour === 12)
1391
- value.setHours(this.pm ? 12 : 0);
1392
- else
1393
- value.setHours(this.pm ? this.currentHour + 12 : this.currentHour);
1394
- }
1395
- else {
1578
+ if (this.currentHour === 12) value.setHours(this.pm ? 12 : 0);
1579
+ else value.setHours(this.pm ? this.currentHour + 12 : this.currentHour);
1580
+ } else {
1396
1581
  value.setHours(this.currentHour);
1397
1582
  }
1398
1583
 
@@ -1400,19 +1585,17 @@ export default {
1400
1585
  value.setSeconds(this.currentSecond);
1401
1586
 
1402
1587
  if (this.isRangeSelection()) {
1403
- if (this.modelValue[1])
1404
- value = [this.modelValue[0], value];
1405
- else
1406
- value = [value, null];
1588
+ if (this.modelValue[1]) value = [this.modelValue[0], value];
1589
+ else value = [value, null];
1407
1590
  }
1408
1591
 
1409
- if (this.isMultipleSelection()){
1592
+ if (this.isMultipleSelection()) {
1410
1593
  value = [...this.modelValue.slice(0, -1), value];
1411
1594
  }
1412
1595
 
1413
1596
  this.updateModel(value);
1414
1597
  this.$emit('date-select', value);
1415
- setTimeout(() => this.timePickerChange = false, 0);
1598
+ setTimeout(() => (this.timePickerChange = false), 0);
1416
1599
  },
1417
1600
  toggleAMPM(event) {
1418
1601
  this.pm = !this.pm;
@@ -1426,24 +1609,22 @@ export default {
1426
1609
  },
1427
1610
  onMonthSelect(event, index) {
1428
1611
  if (this.view === 'month') {
1429
- this.onDateSelect(event, {year: this.currentYear, month: index, day: 1, selectable: true});
1430
- }
1431
- else {
1612
+ this.onDateSelect(event, { year: this.currentYear, month: index, day: 1, selectable: true });
1613
+ } else {
1432
1614
  this.currentMonth = index;
1433
1615
  this.currentView = 'date';
1434
- this.$emit('month-change', {month: this.currentMonth + 1, year: this.currentYear});
1616
+ this.$emit('month-change', { month: this.currentMonth + 1, year: this.currentYear });
1435
1617
  }
1436
1618
 
1437
1619
  setTimeout(this.updateFocus, 0);
1438
1620
  },
1439
1621
  onYearSelect(event, year) {
1440
1622
  if (this.view === 'year') {
1441
- this.onDateSelect(event, {year: year, month: 0, day: 1, selectable: true});
1442
- }
1443
- else {
1623
+ this.onDateSelect(event, { year: year, month: 0, day: 1, selectable: true });
1624
+ } else {
1444
1625
  this.currentYear = year;
1445
1626
  this.currentView = 'month';
1446
- this.$emit('year-change', {month: this.currentMonth + 1, year: this.currentYear});
1627
+ this.$emit('year-change', { month: this.currentMonth + 1, year: this.currentYear });
1447
1628
  }
1448
1629
 
1449
1630
  setTimeout(this.updateFocus, 0);
@@ -1457,6 +1638,7 @@ export default {
1457
1638
  this.maskClickListener = () => {
1458
1639
  this.overlayVisible = false;
1459
1640
  };
1641
+
1460
1642
  this.mask.addEventListener('click', this.maskClickListener);
1461
1643
 
1462
1644
  document.body.appendChild(this.mask);
@@ -1479,9 +1661,11 @@ export default {
1479
1661
 
1480
1662
  let bodyChildren = document.body.children;
1481
1663
  let hasBlockerMasks;
1664
+
1482
1665
  for (let i = 0; i < bodyChildren.length; i++) {
1483
1666
  let bodyChild = bodyChildren[i];
1484
- if(DomHandler.hasClass(bodyChild, 'p-datepicker-mask-scrollblocker')) {
1667
+
1668
+ if (DomHandler.hasClass(bodyChild, 'p-datepicker-mask-scrollblocker')) {
1485
1669
  hasBlockerMasks = true;
1486
1670
  break;
1487
1671
  }
@@ -1493,6 +1677,7 @@ export default {
1493
1677
  },
1494
1678
  updateCurrentMetaData() {
1495
1679
  const viewDate = this.viewDate;
1680
+
1496
1681
  this.currentMonth = viewDate.getMonth();
1497
1682
  this.currentYear = viewDate.getFullYear();
1498
1683
 
@@ -1506,15 +1691,17 @@ export default {
1506
1691
  }
1507
1692
 
1508
1693
  let isValid = true;
1694
+
1509
1695
  if (this.isSingleSelection()) {
1510
1696
  if (!this.isSelectable(value.getDate(), value.getMonth(), value.getFullYear(), false)) {
1511
1697
  isValid = false;
1512
1698
  }
1513
- } else if (value.every(v => this.isSelectable(v.getDate(), v.getMonth(), v.getFullYear(), false))) {
1699
+ } else if (value.every((v) => this.isSelectable(v.getDate(), v.getMonth(), v.getFullYear(), false))) {
1514
1700
  if (this.isRangeSelection()) {
1515
1701
  isValid = value.length > 1 && value[1] > value[0] ? true : false;
1516
1702
  }
1517
1703
  }
1704
+
1518
1705
  return isValid;
1519
1706
  },
1520
1707
  parseValue(text) {
@@ -1526,17 +1713,19 @@ export default {
1526
1713
 
1527
1714
  if (this.isSingleSelection()) {
1528
1715
  value = this.parseDateTime(text);
1529
- }
1530
- else if (this.isMultipleSelection()) {
1716
+ } else if (this.isMultipleSelection()) {
1531
1717
  let tokens = text.split(',');
1718
+
1532
1719
  value = [];
1720
+
1533
1721
  for (let token of tokens) {
1534
1722
  value.push(this.parseDateTime(token.trim()));
1535
1723
  }
1536
- }
1537
- else if (this.isRangeSelection()) {
1724
+ } else if (this.isRangeSelection()) {
1538
1725
  let tokens = text.split(' - ');
1726
+
1539
1727
  value = [];
1728
+
1540
1729
  for (let i = 0; i < tokens.length; i++) {
1541
1730
  value[i] = this.parseDateTime(tokens[i].trim());
1542
1731
  }
@@ -1551,14 +1740,13 @@ export default {
1551
1740
  if (this.timeOnly) {
1552
1741
  date = new Date();
1553
1742
  this.populateTime(date, parts[0], parts[1]);
1554
- }
1555
- else {
1743
+ } else {
1556
1744
  const dateFormat = this.datePattern;
1745
+
1557
1746
  if (this.showTime) {
1558
1747
  date = this.parseDate(parts[0], dateFormat);
1559
1748
  this.populateTime(date, parts[1], parts[2]);
1560
- }
1561
- else {
1749
+ } else {
1562
1750
  date = this.parseDate(text, dateFormat);
1563
1751
  }
1564
1752
  }
@@ -1570,8 +1758,9 @@ export default {
1570
1758
  throw 'Invalid Time';
1571
1759
  }
1572
1760
 
1573
- this.pm = (ampm === 'PM' || ampm === 'pm');
1761
+ this.pm = ampm === 'PM' || ampm === 'pm';
1574
1762
  let time = this.parseTime(timeString);
1763
+
1575
1764
  value.setHours(time.hour);
1576
1765
  value.setMinutes(time.minute);
1577
1766
  value.setSeconds(time.second);
@@ -1579,10 +1768,10 @@ export default {
1579
1768
  parseTime(value) {
1580
1769
  let tokens = value.split(':');
1581
1770
  let validTokenLength = this.showSeconds ? 3 : 2;
1582
- let regex = (/^[0-9][0-9]$/);
1771
+ let regex = /^[0-9][0-9]$/;
1583
1772
 
1584
1773
  if (tokens.length !== validTokenLength || !tokens[0].match(regex) || !tokens[1].match(regex) || (this.showSeconds && !tokens[2].match(regex))) {
1585
- throw "Invalid time";
1774
+ throw 'Invalid time';
1586
1775
  }
1587
1776
 
1588
1777
  let h = parseInt(tokens[0]);
@@ -1590,88 +1779,97 @@ export default {
1590
1779
  let s = this.showSeconds ? parseInt(tokens[2]) : null;
1591
1780
 
1592
1781
  if (isNaN(h) || isNaN(m) || h > 23 || m > 59 || (this.hourFormat == '12' && h > 12) || (this.showSeconds && (isNaN(s) || s > 59))) {
1593
- throw "Invalid time";
1594
- }
1595
- else {
1782
+ throw 'Invalid time';
1783
+ } else {
1596
1784
  if (this.hourFormat == '12' && h !== 12 && this.pm) {
1597
- h+= 12;
1785
+ h += 12;
1598
1786
  }
1599
1787
 
1600
- return {hour: h, minute: m, second: s};
1788
+ return { hour: h, minute: m, second: s };
1601
1789
  }
1602
1790
  },
1603
1791
  parseDate(value, format) {
1604
1792
  if (format == null || value == null) {
1605
- throw "Invalid arguments";
1793
+ throw 'Invalid arguments';
1606
1794
  }
1607
1795
 
1608
- value = (typeof value === "object" ? value.toString() : value + "");
1609
- if (value === "") {
1796
+ value = typeof value === 'object' ? value.toString() : value + '';
1797
+
1798
+ if (value === '') {
1610
1799
  return null;
1611
1800
  }
1612
1801
 
1613
- let iFormat, dim, extra,
1614
- iValue = 0,
1615
- shortYearCutoff = (typeof this.shortYearCutoff !== "string" ? this.shortYearCutoff : new Date().getFullYear() % 100 + parseInt(this.shortYearCutoff, 10)),
1616
- year = -1,
1617
- month = -1,
1618
- day = -1,
1619
- doy = -1,
1620
- literal = false,
1621
- date,
1622
- lookAhead = (match) => {
1623
- let matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
1624
- if (matches) {
1625
- iFormat++;
1626
- }
1627
- return matches;
1628
- },
1629
- getNumber = (match) => {
1630
- let isDoubled = lookAhead(match),
1631
- size = (match === "@" ? 14 : (match === "!" ? 20 :
1632
- (match === "y" && isDoubled ? 4 : (match === "o" ? 3 : 2)))),
1633
- minSize = (match === "y" ? size : 1),
1634
- digits = new RegExp("^\\d{" + minSize + "," + size + "}"),
1635
- num = value.substring(iValue).match(digits);
1636
- if (!num) {
1637
- throw "Missing number at position " + iValue;
1638
- }
1639
- iValue += num[ 0 ].length;
1640
- return parseInt(num[ 0 ], 10);
1641
- },
1642
- getName = (match, shortNames, longNames) => {
1643
- let index = -1;
1644
- let arr = lookAhead(match) ? longNames : shortNames;
1645
- let names = [];
1646
-
1647
- for (let i = 0; i < arr.length; i++) {
1648
- names.push([i,arr[i]]);
1649
- }
1650
- names.sort((a,b) => {
1651
- return -(a[ 1 ].length - b[ 1 ].length);
1652
- });
1802
+ let iFormat,
1803
+ dim,
1804
+ extra,
1805
+ iValue = 0,
1806
+ shortYearCutoff = typeof this.shortYearCutoff !== 'string' ? this.shortYearCutoff : (new Date().getFullYear() % 100) + parseInt(this.shortYearCutoff, 10),
1807
+ year = -1,
1808
+ month = -1,
1809
+ day = -1,
1810
+ doy = -1,
1811
+ literal = false,
1812
+ date,
1813
+ lookAhead = (match) => {
1814
+ let matches = iFormat + 1 < format.length && format.charAt(iFormat + 1) === match;
1653
1815
 
1654
- for (let i = 0; i < names.length; i++) {
1655
- let name = names[i][1];
1656
- if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {
1657
- index = names[i][0];
1658
- iValue += name.length;
1659
- break;
1816
+ if (matches) {
1817
+ iFormat++;
1660
1818
  }
1661
- }
1662
1819
 
1663
- if (index !== -1) {
1664
- return index + 1;
1665
- } else {
1666
- throw "Unknown name at position " + iValue;
1667
- }
1668
- },
1669
- checkLiteral = () => {
1670
- if (value.charAt(iValue) !== format.charAt(iFormat)) {
1671
- throw "Unexpected literal at position " + iValue;
1672
- }
1673
- iValue++;
1674
- };
1820
+ return matches;
1821
+ },
1822
+ getNumber = (match) => {
1823
+ let isDoubled = lookAhead(match),
1824
+ size = match === '@' ? 14 : match === '!' ? 20 : match === 'y' && isDoubled ? 4 : match === 'o' ? 3 : 2,
1825
+ minSize = match === 'y' ? size : 1,
1826
+ digits = new RegExp('^\\d{' + minSize + ',' + size + '}'),
1827
+ num = value.substring(iValue).match(digits);
1828
+
1829
+ if (!num) {
1830
+ throw 'Missing number at position ' + iValue;
1831
+ }
1832
+
1833
+ iValue += num[0].length;
1834
+
1835
+ return parseInt(num[0], 10);
1836
+ },
1837
+ getName = (match, shortNames, longNames) => {
1838
+ let index = -1;
1839
+ let arr = lookAhead(match) ? longNames : shortNames;
1840
+ let names = [];
1841
+
1842
+ for (let i = 0; i < arr.length; i++) {
1843
+ names.push([i, arr[i]]);
1844
+ }
1845
+
1846
+ names.sort((a, b) => {
1847
+ return -(a[1].length - b[1].length);
1848
+ });
1849
+
1850
+ for (let i = 0; i < names.length; i++) {
1851
+ let name = names[i][1];
1852
+
1853
+ if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {
1854
+ index = names[i][0];
1855
+ iValue += name.length;
1856
+ break;
1857
+ }
1858
+ }
1859
+
1860
+ if (index !== -1) {
1861
+ return index + 1;
1862
+ } else {
1863
+ throw 'Unknown name at position ' + iValue;
1864
+ }
1865
+ },
1866
+ checkLiteral = () => {
1867
+ if (value.charAt(iValue) !== format.charAt(iFormat)) {
1868
+ throw 'Unexpected literal at position ' + iValue;
1869
+ }
1870
+
1871
+ iValue++;
1872
+ };
1675
1873
 
1676
1874
  if (this.currentView === 'month') {
1677
1875
  day = 1;
@@ -1686,32 +1884,32 @@ export default {
1686
1884
  }
1687
1885
  } else {
1688
1886
  switch (format.charAt(iFormat)) {
1689
- case "d":
1690
- day = getNumber("d");
1887
+ case 'd':
1888
+ day = getNumber('d');
1691
1889
  break;
1692
- case "D":
1693
- getName("D", this.$primevue.config.locale.dayNamesShort, this.$primevue.config.locale.dayNames);
1890
+ case 'D':
1891
+ getName('D', this.$primevue.config.locale.dayNamesShort, this.$primevue.config.locale.dayNames);
1694
1892
  break;
1695
- case "o":
1696
- doy = getNumber("o");
1893
+ case 'o':
1894
+ doy = getNumber('o');
1697
1895
  break;
1698
- case "m":
1699
- month = getNumber("m");
1896
+ case 'm':
1897
+ month = getNumber('m');
1700
1898
  break;
1701
- case "M":
1702
- month = getName("M", this.$primevue.config.locale.monthNamesShort, this.$primevue.config.locale.monthNames);
1899
+ case 'M':
1900
+ month = getName('M', this.$primevue.config.locale.monthNamesShort, this.$primevue.config.locale.monthNames);
1703
1901
  break;
1704
- case "y":
1705
- year = getNumber("y");
1902
+ case 'y':
1903
+ year = getNumber('y');
1706
1904
  break;
1707
- case "@":
1708
- date = new Date(getNumber("@"));
1905
+ case '@':
1906
+ date = new Date(getNumber('@'));
1709
1907
  year = date.getFullYear();
1710
1908
  month = date.getMonth() + 1;
1711
1909
  day = date.getDate();
1712
1910
  break;
1713
- case "!":
1714
- date = new Date((getNumber("!") - this.ticksTo1970) / 10000);
1911
+ case '!':
1912
+ date = new Date((getNumber('!') - this.ticksTo1970) / 10000);
1715
1913
  year = date.getFullYear();
1716
1914
  month = date.getMonth() + 1;
1717
1915
  day = date.getDate();
@@ -1722,6 +1920,7 @@ export default {
1722
1920
  } else {
1723
1921
  literal = true;
1724
1922
  }
1923
+
1725
1924
  break;
1726
1925
  default:
1727
1926
  checkLiteral();
@@ -1731,47 +1930,53 @@ export default {
1731
1930
 
1732
1931
  if (iValue < value.length) {
1733
1932
  extra = value.substr(iValue);
1933
+
1734
1934
  if (!/^\s+/.test(extra)) {
1735
- throw "Extra/unparsed characters found in date: " + extra;
1935
+ throw 'Extra/unparsed characters found in date: ' + extra;
1736
1936
  }
1737
1937
  }
1738
1938
 
1739
1939
  if (year === -1) {
1740
1940
  year = new Date().getFullYear();
1741
1941
  } else if (year < 100) {
1742
- year += new Date().getFullYear() - new Date().getFullYear() % 100 +
1743
- (year <= shortYearCutoff ? 0 : -100);
1942
+ year += new Date().getFullYear() - (new Date().getFullYear() % 100) + (year <= shortYearCutoff ? 0 : -100);
1744
1943
  }
1745
1944
 
1746
1945
  if (doy > -1) {
1747
1946
  month = 1;
1748
1947
  day = doy;
1948
+
1749
1949
  do {
1750
1950
  dim = this.getDaysCountInMonth(year, month - 1);
1951
+
1751
1952
  if (day <= dim) {
1752
1953
  break;
1753
1954
  }
1955
+
1754
1956
  month++;
1755
1957
  day -= dim;
1756
- // eslint-disable-next-line
1958
+ // eslint-disable-next-line
1757
1959
  } while (true);
1758
1960
  }
1759
1961
 
1760
1962
  date = this.daylightSavingAdjust(new Date(year, month - 1, day));
1761
1963
 
1762
1964
  if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {
1763
- throw "Invalid date"; // E.g. 31/02/00
1965
+ throw 'Invalid date'; // E.g. 31/02/00
1764
1966
  }
1765
1967
 
1766
1968
  return date;
1767
1969
  },
1768
1970
  getWeekNumber(date) {
1769
1971
  let checkDate = new Date(date.getTime());
1770
- checkDate.setDate(checkDate.getDate() + 4 - ( checkDate.getDay() || 7 ));
1972
+
1973
+ checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
1771
1974
  let time = checkDate.getTime();
1772
- checkDate.setMonth( 0 );
1773
- checkDate.setDate( 1 );
1774
- return Math.floor( Math.round((time - checkDate.getTime()) / 86400000 ) / 7 ) + 1;
1975
+
1976
+ checkDate.setMonth(0);
1977
+ checkDate.setDate(1);
1978
+
1979
+ return Math.floor(Math.round((time - checkDate.getTime()) / 86400000) / 7) + 1;
1775
1980
  },
1776
1981
  onDateCellKeydown(event, date, groupIndex) {
1777
1982
  const cellContent = event.currentTarget;
@@ -1782,21 +1987,22 @@ export default {
1782
1987
  cellContent.tabIndex = '-1';
1783
1988
  let cellIndex = DomHandler.index(cell);
1784
1989
  let nextRow = cell.parentElement.nextElementSibling;
1990
+
1785
1991
  if (nextRow) {
1786
1992
  let focusCell = nextRow.children[cellIndex].children[0];
1993
+
1787
1994
  if (DomHandler.hasClass(focusCell, 'p-disabled')) {
1788
- this.navigationState = {backward: false};
1995
+ this.navigationState = { backward: false };
1789
1996
  this.navForward(event);
1790
- }
1791
- else {
1997
+ } else {
1792
1998
  nextRow.children[cellIndex].children[0].tabIndex = '0';
1793
1999
  nextRow.children[cellIndex].children[0].focus();
1794
2000
  }
1795
- }
1796
- else {
1797
- this.navigationState = {backward: false};
2001
+ } else {
2002
+ this.navigationState = { backward: false };
1798
2003
  this.navForward(event);
1799
2004
  }
2005
+
1800
2006
  event.preventDefault();
1801
2007
  break;
1802
2008
  }
@@ -1805,21 +2011,22 @@ export default {
1805
2011
  cellContent.tabIndex = '-1';
1806
2012
  let cellIndex = DomHandler.index(cell);
1807
2013
  let prevRow = cell.parentElement.previousElementSibling;
2014
+
1808
2015
  if (prevRow) {
1809
2016
  let focusCell = prevRow.children[cellIndex].children[0];
2017
+
1810
2018
  if (DomHandler.hasClass(focusCell, 'p-disabled')) {
1811
- this.navigationState = {backward: true};
2019
+ this.navigationState = { backward: true };
1812
2020
  this.navBackward(event);
1813
- }
1814
- else {
2021
+ } else {
1815
2022
  focusCell.tabIndex = '0';
1816
2023
  focusCell.focus();
1817
2024
  }
1818
- }
1819
- else {
1820
- this.navigationState = {backward: true};
2025
+ } else {
2026
+ this.navigationState = { backward: true };
1821
2027
  this.navBackward(event);
1822
2028
  }
2029
+
1823
2030
  event.preventDefault();
1824
2031
  break;
1825
2032
  }
@@ -1827,19 +2034,20 @@ export default {
1827
2034
  case 'ArrowLeft': {
1828
2035
  cellContent.tabIndex = '-1';
1829
2036
  let prevCell = cell.previousElementSibling;
2037
+
1830
2038
  if (prevCell) {
1831
2039
  let focusCell = prevCell.children[0];
2040
+
1832
2041
  if (DomHandler.hasClass(focusCell, 'p-disabled')) {
1833
2042
  this.navigateToMonth(event, true, groupIndex);
1834
- }
1835
- else {
2043
+ } else {
1836
2044
  focusCell.tabIndex = '0';
1837
2045
  focusCell.focus();
1838
2046
  }
1839
- }
1840
- else {
2047
+ } else {
1841
2048
  this.navigateToMonth(event, true, groupIndex);
1842
2049
  }
2050
+
1843
2051
  event.preventDefault();
1844
2052
  break;
1845
2053
  }
@@ -1847,24 +2055,26 @@ export default {
1847
2055
  case 'ArrowRight': {
1848
2056
  cellContent.tabIndex = '-1';
1849
2057
  let nextCell = cell.nextElementSibling;
2058
+
1850
2059
  if (nextCell) {
1851
2060
  let focusCell = nextCell.children[0];
2061
+
1852
2062
  if (DomHandler.hasClass(focusCell, 'p-disabled')) {
1853
2063
  this.navigateToMonth(event, false, groupIndex);
1854
- }
1855
- else {
2064
+ } else {
1856
2065
  focusCell.tabIndex = '0';
1857
2066
  focusCell.focus();
1858
2067
  }
1859
- }
1860
- else {
2068
+ } else {
1861
2069
  this.navigateToMonth(event, false, groupIndex);
1862
2070
  }
2071
+
1863
2072
  event.preventDefault();
1864
2073
  break;
1865
2074
  }
1866
2075
 
1867
2076
  case 'Enter':
2077
+
1868
2078
  case 'Space': {
1869
2079
  this.onDateSelect(event, date);
1870
2080
  event.preventDefault();
@@ -1881,6 +2091,7 @@ export default {
1881
2091
  if (!this.inline) {
1882
2092
  this.trapFocus(event);
1883
2093
  }
2094
+
1884
2095
  break;
1885
2096
  }
1886
2097
 
@@ -1888,10 +2099,10 @@ export default {
1888
2099
  cellContent.tabIndex = '-1';
1889
2100
  let currentRow = cell.parentElement;
1890
2101
  let focusCell = currentRow.children[0].children[0];
2102
+
1891
2103
  if (DomHandler.hasClass(focusCell, 'p-disabled')) {
1892
2104
  this.navigateToMonth(event, true, groupIndex);
1893
- }
1894
- else {
2105
+ } else {
1895
2106
  focusCell.tabIndex = '0';
1896
2107
  focusCell.focus();
1897
2108
  }
@@ -1903,11 +2114,11 @@ export default {
1903
2114
  case 'End': {
1904
2115
  cellContent.tabIndex = '-1';
1905
2116
  let currentRow = cell.parentElement;
1906
- let focusCell = currentRow.children[currentRow.children.length -1].children[0];
2117
+ let focusCell = currentRow.children[currentRow.children.length - 1].children[0];
2118
+
1907
2119
  if (DomHandler.hasClass(focusCell, 'p-disabled')) {
1908
2120
  this.navigateToMonth(event, false, groupIndex);
1909
- }
1910
- else {
2121
+ } else {
1911
2122
  focusCell.tabIndex = '0';
1912
2123
  focusCell.focus();
1913
2124
  }
@@ -1919,10 +2130,9 @@ export default {
1919
2130
  case 'PageUp': {
1920
2131
  cellContent.tabIndex = '-1';
1921
2132
  if (event.shiftKey) {
1922
- this.navigationState = {backward: true};
2133
+ this.navigationState = { backward: true };
1923
2134
  this.navBackward(event);
1924
- }
1925
- else this.navigateToMonth(event, true, groupIndex);
2135
+ } else this.navigateToMonth(event, true, groupIndex);
1926
2136
 
1927
2137
  event.preventDefault();
1928
2138
  break;
@@ -1931,10 +2141,9 @@ export default {
1931
2141
  case 'PageDown': {
1932
2142
  cellContent.tabIndex = '-1';
1933
2143
  if (event.shiftKey) {
1934
- this.navigationState = {backward: false};
2144
+ this.navigationState = { backward: false };
1935
2145
  this.navForward(event);
1936
- }
1937
- else this.navigateToMonth(event, false, groupIndex);
2146
+ } else this.navigateToMonth(event, false, groupIndex);
1938
2147
 
1939
2148
  event.preventDefault();
1940
2149
  break;
@@ -1942,31 +2151,30 @@ export default {
1942
2151
 
1943
2152
  default:
1944
2153
  //no op
1945
- break;
2154
+ break;
1946
2155
  }
1947
2156
  },
1948
2157
  navigateToMonth(event, prev, groupIndex) {
1949
2158
  if (prev) {
1950
- if (this.numberOfMonths === 1 || (groupIndex === 0)) {
1951
- this.navigationState = {backward: true};
2159
+ if (this.numberOfMonths === 1 || groupIndex === 0) {
2160
+ this.navigationState = { backward: true };
1952
2161
  this.navBackward(event);
1953
- }
1954
- else {
2162
+ } else {
1955
2163
  let prevMonthContainer = this.overlay.children[groupIndex - 1];
1956
2164
  let cells = DomHandler.find(prevMonthContainer, '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');
1957
2165
  let focusCell = cells[cells.length - 1];
2166
+
1958
2167
  focusCell.tabIndex = '0';
1959
2168
  focusCell.focus();
1960
2169
  }
1961
- }
1962
- else {
1963
- if (this.numberOfMonths === 1 || (groupIndex === this.numberOfMonths - 1)) {
1964
- this.navigationState = {backward: false};
2170
+ } else {
2171
+ if (this.numberOfMonths === 1 || groupIndex === this.numberOfMonths - 1) {
2172
+ this.navigationState = { backward: false };
1965
2173
  this.navForward(event);
1966
- }
1967
- else {
2174
+ } else {
1968
2175
  let nextMonthContainer = this.overlay.children[groupIndex + 1];
1969
2176
  let focusCell = DomHandler.findSingle(nextMonthContainer, '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');
2177
+
1970
2178
  focusCell.tabIndex = '0';
1971
2179
  focusCell.focus();
1972
2180
  }
@@ -1977,15 +2185,18 @@ export default {
1977
2185
 
1978
2186
  switch (event.code) {
1979
2187
  case 'ArrowUp':
2188
+
1980
2189
  case 'ArrowDown': {
1981
2190
  cell.tabIndex = '-1';
1982
2191
  var cells = cell.parentElement.children;
1983
2192
  var cellIndex = DomHandler.index(cell);
1984
- let nextCell = cells[event.code === 'ArrowDown' ? cellIndex + 3 : cellIndex -3];
2193
+ let nextCell = cells[event.code === 'ArrowDown' ? cellIndex + 3 : cellIndex - 3];
2194
+
1985
2195
  if (nextCell) {
1986
2196
  nextCell.tabIndex = '0';
1987
2197
  nextCell.focus();
1988
2198
  }
2199
+
1989
2200
  event.preventDefault();
1990
2201
  break;
1991
2202
  }
@@ -1993,14 +2204,15 @@ export default {
1993
2204
  case 'ArrowLeft': {
1994
2205
  cell.tabIndex = '-1';
1995
2206
  let prevCell = cell.previousElementSibling;
2207
+
1996
2208
  if (prevCell) {
1997
2209
  prevCell.tabIndex = '0';
1998
2210
  prevCell.focus();
1999
- }
2000
- else {
2001
- this.navigationState = {backward: true};
2211
+ } else {
2212
+ this.navigationState = { backward: true };
2002
2213
  this.navBackward(event);
2003
2214
  }
2215
+
2004
2216
  event.preventDefault();
2005
2217
  break;
2006
2218
  }
@@ -2008,21 +2220,22 @@ export default {
2008
2220
  case 'ArrowRight': {
2009
2221
  cell.tabIndex = '-1';
2010
2222
  let nextCell = cell.nextElementSibling;
2223
+
2011
2224
  if (nextCell) {
2012
2225
  nextCell.tabIndex = '0';
2013
2226
  nextCell.focus();
2014
- }
2015
- else {
2016
- this.navigationState = {backward: false};
2227
+ } else {
2228
+ this.navigationState = { backward: false };
2017
2229
  this.navForward(event);
2018
2230
  }
2231
+
2019
2232
  event.preventDefault();
2020
2233
  break;
2021
2234
  }
2022
2235
 
2023
2236
  case 'PageUp': {
2024
2237
  if (event.shiftKey) return;
2025
- this.navigationState = {backward: true};
2238
+ this.navigationState = { backward: true };
2026
2239
  this.navBackward(event);
2027
2240
 
2028
2241
  break;
@@ -2030,13 +2243,14 @@ export default {
2030
2243
 
2031
2244
  case 'PageDown': {
2032
2245
  if (event.shiftKey) return;
2033
- this.navigationState = {backward: false};
2246
+ this.navigationState = { backward: false };
2034
2247
  this.navForward(event);
2035
2248
 
2036
2249
  break;
2037
2250
  }
2038
2251
 
2039
2252
  case 'Enter':
2253
+
2040
2254
  case 'Space': {
2041
2255
  this.onMonthSelect(event, index);
2042
2256
  event.preventDefault();
@@ -2056,7 +2270,7 @@ export default {
2056
2270
 
2057
2271
  default:
2058
2272
  //no op
2059
- break;
2273
+ break;
2060
2274
  }
2061
2275
  },
2062
2276
  onYearCellKeydown(event, index) {
@@ -2064,15 +2278,18 @@ export default {
2064
2278
 
2065
2279
  switch (event.code) {
2066
2280
  case 'ArrowUp':
2067
- case 'ArrowDown': {
2281
+
2282
+ case 'ArrowDown': {
2068
2283
  cell.tabIndex = '-1';
2069
2284
  var cells = cell.parentElement.children;
2070
2285
  var cellIndex = DomHandler.index(cell);
2071
2286
  let nextCell = cells[event.code === 'ArrowDown' ? cellIndex + 2 : cellIndex - 2];
2287
+
2072
2288
  if (nextCell) {
2073
2289
  nextCell.tabIndex = '0';
2074
2290
  nextCell.focus();
2075
2291
  }
2292
+
2076
2293
  event.preventDefault();
2077
2294
  break;
2078
2295
  }
@@ -2080,14 +2297,15 @@ export default {
2080
2297
  case 'ArrowLeft': {
2081
2298
  cell.tabIndex = '-1';
2082
2299
  let prevCell = cell.previousElementSibling;
2300
+
2083
2301
  if (prevCell) {
2084
2302
  prevCell.tabIndex = '0';
2085
2303
  prevCell.focus();
2086
- }
2087
- else {
2088
- this.navigationState = {backward: true};
2304
+ } else {
2305
+ this.navigationState = { backward: true };
2089
2306
  this.navBackward(event);
2090
2307
  }
2308
+
2091
2309
  event.preventDefault();
2092
2310
  break;
2093
2311
  }
@@ -2095,21 +2313,22 @@ export default {
2095
2313
  case 'ArrowRight': {
2096
2314
  cell.tabIndex = '-1';
2097
2315
  let nextCell = cell.nextElementSibling;
2316
+
2098
2317
  if (nextCell) {
2099
2318
  nextCell.tabIndex = '0';
2100
2319
  nextCell.focus();
2101
- }
2102
- else {
2103
- this.navigationState = {backward: false};
2320
+ } else {
2321
+ this.navigationState = { backward: false };
2104
2322
  this.navForward(event);
2105
2323
  }
2324
+
2106
2325
  event.preventDefault();
2107
2326
  break;
2108
2327
  }
2109
2328
 
2110
2329
  case 'PageUp': {
2111
2330
  if (event.shiftKey) return;
2112
- this.navigationState = {backward: true};
2331
+ this.navigationState = { backward: true };
2113
2332
  this.navBackward(event);
2114
2333
 
2115
2334
  break;
@@ -2117,13 +2336,14 @@ export default {
2117
2336
 
2118
2337
  case 'PageDown': {
2119
2338
  if (event.shiftKey) return;
2120
- this.navigationState = {backward: false};
2339
+ this.navigationState = { backward: false };
2121
2340
  this.navForward(event);
2122
2341
 
2123
2342
  break;
2124
2343
  }
2125
2344
 
2126
2345
  case 'Enter':
2346
+
2127
2347
  case 'Space': {
2128
2348
  this.onYearSelect(event, index);
2129
2349
  event.preventDefault();
@@ -2143,7 +2363,7 @@ export default {
2143
2363
 
2144
2364
  default:
2145
2365
  //no op
2146
- break;
2366
+ break;
2147
2367
  }
2148
2368
  },
2149
2369
  updateFocus() {
@@ -2153,37 +2373,29 @@ export default {
2153
2373
  if (this.navigationState.button) {
2154
2374
  this.initFocusableCell();
2155
2375
 
2156
- if (this.navigationState.backward)
2157
- DomHandler.findSingle(this.overlay, '.p-datepicker-prev').focus();
2158
- else
2159
- DomHandler.findSingle(this.overlay, '.p-datepicker-next').focus();
2160
- }
2161
- else {
2376
+ if (this.navigationState.backward) DomHandler.findSingle(this.overlay, '.p-datepicker-prev').focus();
2377
+ else DomHandler.findSingle(this.overlay, '.p-datepicker-next').focus();
2378
+ } else {
2162
2379
  if (this.navigationState.backward) {
2163
2380
  let cells;
2164
2381
 
2165
2382
  if (this.currentView === 'month') {
2166
2383
  cells = DomHandler.find(this.overlay, '.p-monthpicker .p-monthpicker-month:not(.p-disabled)');
2167
- }
2168
- else if (this.currentView === 'year') {
2384
+ } else if (this.currentView === 'year') {
2169
2385
  cells = DomHandler.find(this.overlay, '.p-yearpicker .p-yearpicker-year:not(.p-disabled)');
2170
- }
2171
- else {
2386
+ } else {
2172
2387
  cells = DomHandler.find(this.overlay, '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');
2173
2388
  }
2174
2389
 
2175
2390
  if (cells && cells.length > 0) {
2176
2391
  cell = cells[cells.length - 1];
2177
2392
  }
2178
- }
2179
- else {
2393
+ } else {
2180
2394
  if (this.currentView === 'month') {
2181
2395
  cell = DomHandler.findSingle(this.overlay, '.p-monthpicker .p-monthpicker-month:not(.p-disabled)');
2182
- }
2183
- else if (this.currentView === 'year') {
2396
+ } else if (this.currentView === 'year') {
2184
2397
  cell = DomHandler.findSingle(this.overlay, '.p-yearpicker .p-yearpicker-year:not(.p-disabled)');
2185
- }
2186
- else {
2398
+ } else {
2187
2399
  cell = DomHandler.findSingle(this.overlay, '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');
2188
2400
  }
2189
2401
  }
@@ -2195,8 +2407,7 @@ export default {
2195
2407
  }
2196
2408
 
2197
2409
  this.navigationState = null;
2198
- }
2199
- else {
2410
+ } else {
2200
2411
  this.initFocusableCell();
2201
2412
  }
2202
2413
  },
@@ -2205,24 +2416,24 @@ export default {
2205
2416
 
2206
2417
  if (this.currentView === 'month') {
2207
2418
  let cells = DomHandler.find(this.overlay, '.p-monthpicker .p-monthpicker-month');
2208
- let selectedCell= DomHandler.findSingle(this.overlay, '.p-monthpicker .p-monthpicker-month.p-highlight');
2209
- cells.forEach(cell => cell.tabIndex = -1);
2419
+ let selectedCell = DomHandler.findSingle(this.overlay, '.p-monthpicker .p-monthpicker-month.p-highlight');
2420
+
2421
+ cells.forEach((cell) => (cell.tabIndex = -1));
2210
2422
  cell = selectedCell || cells[0];
2211
- }
2212
- else if (this.currentView === 'year') {
2423
+ } else if (this.currentView === 'year') {
2213
2424
  let cells = DomHandler.find(this.overlay, '.p-yearpicker .p-yearpicker-year');
2214
- let selectedCell= DomHandler.findSingle(this.overlay, '.p-yearpicker .p-yearpicker-year.p-highlight');
2215
- cells.forEach(cell => cell.tabIndex = -1);
2425
+ let selectedCell = DomHandler.findSingle(this.overlay, '.p-yearpicker .p-yearpicker-year.p-highlight');
2426
+
2427
+ cells.forEach((cell) => (cell.tabIndex = -1));
2216
2428
  cell = selectedCell || cells[0];
2217
- }
2218
- else {
2429
+ } else {
2219
2430
  cell = DomHandler.findSingle(this.overlay, 'span.p-highlight');
2431
+
2220
2432
  if (!cell) {
2221
2433
  let todayCell = DomHandler.findSingle(this.overlay, 'td.p-datepicker-today span:not(.p-disabled):not(.p-ink');
2222
- if (todayCell)
2223
- cell = todayCell;
2224
- else
2225
- cell = DomHandler.findSingle(this.overlay, '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink');
2434
+
2435
+ if (todayCell) cell = todayCell;
2436
+ else cell = DomHandler.findSingle(this.overlay, '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink');
2226
2437
  }
2227
2438
  }
2228
2439
 
@@ -2243,34 +2454,27 @@ export default {
2243
2454
  if (focusableElements && focusableElements.length > 0) {
2244
2455
  if (!document.activeElement) {
2245
2456
  focusableElements[0].focus();
2246
- }
2247
- else {
2457
+ } else {
2248
2458
  let focusedIndex = focusableElements.indexOf(document.activeElement);
2249
2459
 
2250
2460
  if (event.shiftKey) {
2251
- if (focusedIndex === -1 || focusedIndex === 0)
2252
- focusableElements[focusableElements.length - 1].focus();
2253
- else
2254
- focusableElements[focusedIndex - 1].focus();
2255
- }
2256
- else {
2461
+ if (focusedIndex === -1 || focusedIndex === 0) focusableElements[focusableElements.length - 1].focus();
2462
+ else focusableElements[focusedIndex - 1].focus();
2463
+ } else {
2257
2464
  if (focusedIndex === -1) {
2258
2465
  if (this.timeOnly) {
2259
2466
  focusableElements[0].focus();
2260
- }
2261
- else {
2467
+ } else {
2262
2468
  let spanIndex = null;
2263
- for (let i = 0; i < focusableElements.length; i++){
2264
- if (focusableElements[i].tagName === 'SPAN')
2265
- spanIndex = i;
2469
+
2470
+ for (let i = 0; i < focusableElements.length; i++) {
2471
+ if (focusableElements[i].tagName === 'SPAN') spanIndex = i;
2266
2472
  }
2473
+
2267
2474
  focusableElements[spanIndex].focus();
2268
2475
  }
2269
- }
2270
- else if (focusedIndex === (focusableElements.length - 1))
2271
- focusableElements[0].focus();
2272
- else
2273
- focusableElements[focusedIndex + 1].focus();
2476
+ } else if (focusedIndex === focusableElements.length - 1) focusableElements[0].focus();
2477
+ else focusableElements[focusedIndex + 1].focus();
2274
2478
  }
2275
2479
  }
2276
2480
  }
@@ -2279,16 +2483,16 @@ export default {
2279
2483
  switch (event.code) {
2280
2484
  case 'Tab':
2281
2485
  this.trapFocus(event);
2282
- break;
2486
+ break;
2283
2487
 
2284
2488
  case 'Escape':
2285
2489
  this.overlayVisible = false;
2286
2490
  event.preventDefault();
2287
- break;
2491
+ break;
2288
2492
 
2289
2493
  default:
2290
2494
  //Noop
2291
- break;
2495
+ break;
2292
2496
  }
2293
2497
 
2294
2498
  this.$emit('keydown', event);
@@ -2299,12 +2503,12 @@ export default {
2299
2503
  this.selectionEnd = this.input.selectionEnd;
2300
2504
 
2301
2505
  let value = this.parseValue(event.target.value);
2506
+
2302
2507
  if (this.isValidSelection(value)) {
2303
2508
  this.typeUpdate = true;
2304
2509
  this.updateModel(value);
2305
2510
  }
2306
- }
2307
- catch(err) {
2511
+ } catch (err) {
2308
2512
  /* NoOp */
2309
2513
  }
2310
2514
 
@@ -2314,11 +2518,12 @@ export default {
2314
2518
  if (this.showOnFocus && this.isEnabled()) {
2315
2519
  this.overlayVisible = true;
2316
2520
  }
2521
+
2317
2522
  this.focused = true;
2318
2523
  this.$emit('focus', event);
2319
2524
  },
2320
2525
  onBlur(event) {
2321
- this.$emit('blur', {originalEvent: event, value: event.target.value});
2526
+ this.$emit('blur', { originalEvent: event, value: event.target.value });
2322
2527
 
2323
2528
  this.focused = false;
2324
2529
  event.target.value = this.formatValue(this.modelValue);
@@ -2326,19 +2531,16 @@ export default {
2326
2531
  onKeyDown(event) {
2327
2532
  if (event.code === 'ArrowDown' && this.overlay) {
2328
2533
  this.trapFocus(event);
2329
- }
2330
- else if (event.code === 'ArrowDown' && !this.overlay) {
2534
+ } else if (event.code === 'ArrowDown' && !this.overlay) {
2331
2535
  this.overlayVisible = true;
2332
- }
2333
- else if (event.code === 'Escape') {
2536
+ } else if (event.code === 'Escape') {
2334
2537
  if (this.overlayVisible) {
2335
2538
  this.overlayVisible = false;
2336
2539
  event.preventDefault();
2337
2540
  }
2338
- }
2339
- else if (event.code === 'Tab') {
2541
+ } else if (event.code === 'Tab') {
2340
2542
  if (this.overlay) {
2341
- DomHandler.getFocusableElements(this.overlay).forEach(el => el.tabIndex = '-1');
2543
+ DomHandler.getFocusableElements(this.overlay).forEach((el) => (el.tabIndex = '-1'));
2342
2544
  }
2343
2545
 
2344
2546
  if (this.overlayVisible) {
@@ -2389,10 +2591,9 @@ export default {
2389
2591
  }
2390
2592
 
2391
2593
  let innerHTML = '';
2594
+
2392
2595
  if (this.responsiveOptions) {
2393
- let responsiveOptions = [...this.responsiveOptions]
2394
- .filter(o => !!(o.breakpoint && o.numMonths))
2395
- .sort((o1, o2) => -1 * o1.breakpoint.localeCompare(o2.breakpoint, undefined, { numeric: true }));
2596
+ let responsiveOptions = [...this.responsiveOptions].filter((o) => !!(o.breakpoint && o.numMonths)).sort((o1, o2) => -1 * o1.breakpoint.localeCompare(o2.breakpoint, undefined, { numeric: true }));
2396
2597
 
2397
2598
  for (let i = 0; i < responsiveOptions.length; i++) {
2398
2599
  let { breakpoint, numMonths } = responsiveOptions[i];
@@ -2407,20 +2608,20 @@ export default {
2407
2608
  .p-datepicker[${this.attributeSelector}] .p-datepicker-group:nth-child(${j + 1}) {
2408
2609
  display: none !important;
2409
2610
  }
2410
- `
2611
+ `;
2411
2612
  }
2412
2613
 
2413
2614
  innerHTML += `
2414
2615
  @media screen and (max-width: ${breakpoint}) {
2415
2616
  ${styles}
2416
2617
  }
2417
- `
2618
+ `;
2418
2619
  }
2419
2620
  }
2420
2621
 
2421
2622
  this.responsiveStyleElement.innerHTML = innerHTML;
2422
2623
  }
2423
- },
2624
+ },
2424
2625
  destroyResponsiveStyleElement() {
2425
2626
  if (this.responsiveStyleElement) {
2426
2627
  this.responsiveStyleElement.remove();
@@ -2431,19 +2632,18 @@ export default {
2431
2632
  computed: {
2432
2633
  viewDate() {
2433
2634
  let propValue = this.modelValue;
2635
+
2434
2636
  if (propValue && Array.isArray(propValue)) {
2435
2637
  if (this.isRangeSelection()) {
2436
2638
  propValue = propValue[1] || propValue[0];
2437
- }
2438
- else if (this.isMultipleSelection()) {
2639
+ } else if (this.isMultipleSelection()) {
2439
2640
  propValue = propValue[propValue.length - 1];
2440
2641
  }
2441
2642
  }
2442
2643
 
2443
2644
  if (propValue && typeof propValue !== 'string') {
2444
2645
  return propValue;
2445
- }
2446
- else {
2646
+ } else {
2447
2647
  let today = new Date();
2448
2648
 
2449
2649
  if (this.maxDate && this.maxDate < today) {
@@ -2473,25 +2673,31 @@ export default {
2473
2673
  ];
2474
2674
  },
2475
2675
  panelStyleClass() {
2476
- return ['p-datepicker p-component', this.panelClass, {
2477
- 'p-datepicker-inline': this.inline,
2478
- 'p-disabled': this.disabled,
2479
- 'p-datepicker-timeonly': this.timeOnly,
2480
- 'p-datepicker-multiple-month': this.numberOfMonths > 1,
2481
- 'p-datepicker-monthpicker': (this.currentView === 'month'),
2482
- 'p-datepicker-yearpicker': (this.currentView === 'year'),
2483
- 'p-datepicker-touch-ui': this.touchUI,
2484
- 'p-input-filled': this.$primevue.config.inputStyle === 'filled',
2485
- 'p-ripple-disabled': this.$primevue.config.ripple === false
2486
- }];
2676
+ return [
2677
+ 'p-datepicker p-component',
2678
+ this.panelClass,
2679
+ {
2680
+ 'p-datepicker-inline': this.inline,
2681
+ 'p-disabled': this.disabled,
2682
+ 'p-datepicker-timeonly': this.timeOnly,
2683
+ 'p-datepicker-multiple-month': this.numberOfMonths > 1,
2684
+ 'p-datepicker-monthpicker': this.currentView === 'month',
2685
+ 'p-datepicker-yearpicker': this.currentView === 'year',
2686
+ 'p-datepicker-touch-ui': this.touchUI,
2687
+ 'p-input-filled': this.$primevue.config.inputStyle === 'filled',
2688
+ 'p-ripple-disabled': this.$primevue.config.ripple === false
2689
+ }
2690
+ ];
2487
2691
  },
2488
2692
  months() {
2489
2693
  let months = [];
2490
- for (let i = 0 ; i < this.numberOfMonths; i++) {
2694
+
2695
+ for (let i = 0; i < this.numberOfMonths; i++) {
2491
2696
  let month = this.currentMonth + i;
2492
2697
  let year = this.currentYear;
2698
+
2493
2699
  if (month > 11) {
2494
- month = month % 11 - 1;
2700
+ month = (month % 11) - 1;
2495
2701
  year = year + 1;
2496
2702
  }
2497
2703
 
@@ -2508,30 +2714,33 @@ export default {
2508
2714
  let week = [];
2509
2715
 
2510
2716
  if (i == 0) {
2511
- for (let j = (prevMonthDaysLength - firstDay + 1); j <= prevMonthDaysLength; j++) {
2717
+ for (let j = prevMonthDaysLength - firstDay + 1; j <= prevMonthDaysLength; j++) {
2512
2718
  let prev = this.getPreviousMonthAndYear(month, year);
2513
- week.push({day: j, month: prev.month, year: prev.year, otherMonth: true,
2514
- today: this.isToday(today, j, prev.month, prev.year), selectable: this.isSelectable(j, prev.month, prev.year, true)});
2719
+
2720
+ week.push({ day: j, month: prev.month, year: prev.year, otherMonth: true, today: this.isToday(today, j, prev.month, prev.year), selectable: this.isSelectable(j, prev.month, prev.year, true) });
2515
2721
  }
2516
2722
 
2517
2723
  let remainingDaysLength = 7 - week.length;
2724
+
2518
2725
  for (let j = 0; j < remainingDaysLength; j++) {
2519
- week.push({day: dayNo, month: month, year: year, today: this.isToday(today, dayNo, month, year),
2520
- selectable: this.isSelectable(dayNo, month, year, false)});
2726
+ week.push({ day: dayNo, month: month, year: year, today: this.isToday(today, dayNo, month, year), selectable: this.isSelectable(dayNo, month, year, false) });
2521
2727
  dayNo++;
2522
2728
  }
2523
- }
2524
- else {
2729
+ } else {
2525
2730
  for (let j = 0; j < 7; j++) {
2526
2731
  if (dayNo > daysLength) {
2527
2732
  let next = this.getNextMonthAndYear(month, year);
2528
- week.push({day: dayNo - daysLength, month: next.month, year: next.year, otherMonth: true,
2529
- today: this.isToday(today, dayNo - daysLength, next.month, next.year),
2530
- selectable: this.isSelectable((dayNo - daysLength), next.month, next.year, true)});
2531
- }
2532
- else {
2533
- week.push({day: dayNo, month: month, year: year, today: this.isToday(today, dayNo, month, year),
2534
- selectable: this.isSelectable(dayNo, month, year, false)});
2733
+
2734
+ week.push({
2735
+ day: dayNo - daysLength,
2736
+ month: next.month,
2737
+ year: next.year,
2738
+ otherMonth: true,
2739
+ today: this.isToday(today, dayNo - daysLength, next.month, next.year),
2740
+ selectable: this.isSelectable(dayNo - daysLength, next.month, next.year, true)
2741
+ });
2742
+ } else {
2743
+ week.push({ day: dayNo, month: month, year: year, today: this.isToday(today, dayNo, month, year), selectable: this.isSelectable(dayNo, month, year, false) });
2535
2744
  }
2536
2745
 
2537
2746
  dayNo++;
@@ -2558,15 +2767,16 @@ export default {
2558
2767
  weekDays() {
2559
2768
  let weekDays = [];
2560
2769
  let dayIndex = this.$primevue.config.locale.firstDayOfWeek;
2770
+
2561
2771
  for (let i = 0; i < 7; i++) {
2562
2772
  weekDays.push(this.$primevue.config.locale.dayNamesMin[dayIndex]);
2563
- dayIndex = (dayIndex == 6) ? 0 : ++dayIndex;
2773
+ dayIndex = dayIndex == 6 ? 0 : ++dayIndex;
2564
2774
  }
2565
2775
 
2566
2776
  return weekDays;
2567
2777
  },
2568
2778
  ticksTo1970() {
2569
- return (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000);
2779
+ return ((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000;
2570
2780
  },
2571
2781
  sundayIndex() {
2572
2782
  return this.$primevue.config.locale.firstDayOfWeek > 0 ? 7 - this.$primevue.config.locale.firstDayOfWeek : 0;
@@ -2584,8 +2794,7 @@ export default {
2584
2794
 
2585
2795
  if (this.currentYear < yearStart) {
2586
2796
  $vm.currentYear = yearEnd;
2587
- }
2588
- else if (this.currentYear > yearEnd) {
2797
+ } else if (this.currentYear > yearEnd) {
2589
2798
  $vm.currentYear = yearStart;
2590
2799
  }
2591
2800
 
@@ -2594,13 +2803,13 @@ export default {
2594
2803
  }
2595
2804
 
2596
2805
  return yearOptions;
2597
- }
2598
- else {
2806
+ } else {
2599
2807
  return null;
2600
2808
  }
2601
2809
  },
2602
2810
  monthPickerValues() {
2603
2811
  let monthPickerValues = [];
2812
+
2604
2813
  for (let i = 0; i <= 11; i++) {
2605
2814
  monthPickerValues.push(this.$primevue.config.locale.monthNamesShort[i]);
2606
2815
  }
@@ -2609,7 +2818,8 @@ export default {
2609
2818
  },
2610
2819
  yearPickerValues() {
2611
2820
  let yearPickerValues = [];
2612
- let base = this.currentYear - (this.currentYear % 10);
2821
+ let base = this.currentYear - (this.currentYear % 10);
2822
+
2613
2823
  for (let i = 0; i < 10; i++) {
2614
2824
  yearPickerValues.push(base + i);
2615
2825
  }
@@ -2648,13 +2858,13 @@ export default {
2648
2858
  }
2649
2859
  },
2650
2860
  components: {
2651
- 'CalendarButton': Button,
2652
- 'Portal': Portal
2861
+ CalendarButton: Button,
2862
+ Portal: Portal
2653
2863
  },
2654
2864
  directives: {
2655
- 'ripple': Ripple
2865
+ ripple: Ripple
2656
2866
  }
2657
- }
2867
+ };
2658
2868
  </script>
2659
2869
 
2660
2870
  <style>
@@ -2694,7 +2904,7 @@ export default {
2694
2904
  }
2695
2905
 
2696
2906
  .p-datepicker {
2697
- width: auto;
2907
+ width: auto;
2698
2908
  position: absolute;
2699
2909
  top: 0;
2700
2910
  left: 0;
@@ -2738,8 +2948,8 @@ export default {
2738
2948
 
2739
2949
  /* DatePicker Table */
2740
2950
  .p-datepicker table {
2741
- width: 100%;
2742
- border-collapse: collapse;
2951
+ width: 100%;
2952
+ border-collapse: collapse;
2743
2953
  }
2744
2954
 
2745
2955
  .p-datepicker td > span {