primeng 0.0.0-watch

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 (507) hide show
  1. package/LICENSE.md +77 -0
  2. package/README.md +11 -0
  3. package/accordion/index.d.ts +255 -0
  4. package/animateonscroll/index.d.ts +71 -0
  5. package/api/index.d.ts +1820 -0
  6. package/autocomplete/index.d.ts +925 -0
  7. package/autofocus/index.d.ts +31 -0
  8. package/avatar/index.d.ts +115 -0
  9. package/avatargroup/index.d.ts +60 -0
  10. package/badge/index.d.ts +156 -0
  11. package/base/index.d.ts +63 -0
  12. package/basecomponent/index.d.ts +54 -0
  13. package/baseeditableholder/index.d.ts +45 -0
  14. package/baseinput/index.d.ts +73 -0
  15. package/basemodelholder/index.d.ts +12 -0
  16. package/blockui/index.d.ts +114 -0
  17. package/breadcrumb/index.d.ts +179 -0
  18. package/button/index.d.ts +478 -0
  19. package/buttongroup/index.d.ts +43 -0
  20. package/card/index.d.ts +154 -0
  21. package/carousel/index.d.ts +443 -0
  22. package/cascadeselect/index.d.ts +729 -0
  23. package/chart/index.d.ts +128 -0
  24. package/checkbox/index.d.ts +248 -0
  25. package/chip/index.d.ts +165 -0
  26. package/colorpicker/index.d.ts +329 -0
  27. package/config/index.d.ts +89 -0
  28. package/confirmdialog/index.d.ts +358 -0
  29. package/confirmpopup/index.d.ts +218 -0
  30. package/contextmenu/index.d.ts +356 -0
  31. package/dataview/index.d.ts +539 -0
  32. package/datepicker/index.d.ts +1191 -0
  33. package/dialog/index.d.ts +531 -0
  34. package/divider/index.d.ts +114 -0
  35. package/dock/index.d.ts +201 -0
  36. package/dom/index.d.ts +109 -0
  37. package/dragdrop/index.d.ts +121 -0
  38. package/drawer/index.d.ts +309 -0
  39. package/dynamicdialog/index.d.ts +544 -0
  40. package/editor/index.d.ts +306 -0
  41. package/fesm2022/primeng-accordion.mjs +593 -0
  42. package/fesm2022/primeng-accordion.mjs.map +1 -0
  43. package/fesm2022/primeng-animateonscroll.mjs +178 -0
  44. package/fesm2022/primeng-animateonscroll.mjs.map +1 -0
  45. package/fesm2022/primeng-api.mjs +836 -0
  46. package/fesm2022/primeng-api.mjs.map +1 -0
  47. package/fesm2022/primeng-autocomplete.mjs +2073 -0
  48. package/fesm2022/primeng-autocomplete.mjs.map +1 -0
  49. package/fesm2022/primeng-autofocus.mjs +83 -0
  50. package/fesm2022/primeng-autofocus.mjs.map +1 -0
  51. package/fesm2022/primeng-avatar.mjs +181 -0
  52. package/fesm2022/primeng-avatar.mjs.map +1 -0
  53. package/fesm2022/primeng-avatargroup.mjs +103 -0
  54. package/fesm2022/primeng-avatargroup.mjs.map +1 -0
  55. package/fesm2022/primeng-badge.mjs +366 -0
  56. package/fesm2022/primeng-badge.mjs.map +1 -0
  57. package/fesm2022/primeng-base.mjs +127 -0
  58. package/fesm2022/primeng-base.mjs.map +1 -0
  59. package/fesm2022/primeng-basecomponent.mjs +173 -0
  60. package/fesm2022/primeng-basecomponent.mjs.map +1 -0
  61. package/fesm2022/primeng-baseeditableholder.mjs +67 -0
  62. package/fesm2022/primeng-baseeditableholder.mjs.map +1 -0
  63. package/fesm2022/primeng-baseinput.mjs +85 -0
  64. package/fesm2022/primeng-baseinput.mjs.map +1 -0
  65. package/fesm2022/primeng-basemodelholder.mjs +25 -0
  66. package/fesm2022/primeng-basemodelholder.mjs.map +1 -0
  67. package/fesm2022/primeng-blockui.mjs +237 -0
  68. package/fesm2022/primeng-blockui.mjs.map +1 -0
  69. package/fesm2022/primeng-breadcrumb.mjs +457 -0
  70. package/fesm2022/primeng-breadcrumb.mjs.map +1 -0
  71. package/fesm2022/primeng-button.mjs +864 -0
  72. package/fesm2022/primeng-button.mjs.map +1 -0
  73. package/fesm2022/primeng-buttongroup.mjs +109 -0
  74. package/fesm2022/primeng-buttongroup.mjs.map +1 -0
  75. package/fesm2022/primeng-card.mjs +271 -0
  76. package/fesm2022/primeng-card.mjs.map +1 -0
  77. package/fesm2022/primeng-carousel.mjs +1101 -0
  78. package/fesm2022/primeng-carousel.mjs.map +1 -0
  79. package/fesm2022/primeng-cascadeselect.mjs +1778 -0
  80. package/fesm2022/primeng-cascadeselect.mjs.map +1 -0
  81. package/fesm2022/primeng-chart.mjs +246 -0
  82. package/fesm2022/primeng-chart.mjs.map +1 -0
  83. package/fesm2022/primeng-checkbox.mjs +441 -0
  84. package/fesm2022/primeng-checkbox.mjs.map +1 -0
  85. package/fesm2022/primeng-chip.mjs +323 -0
  86. package/fesm2022/primeng-chip.mjs.map +1 -0
  87. package/fesm2022/primeng-colorpicker.mjs +865 -0
  88. package/fesm2022/primeng-colorpicker.mjs.map +1 -0
  89. package/fesm2022/primeng-config.mjs +289 -0
  90. package/fesm2022/primeng-config.mjs.map +1 -0
  91. package/fesm2022/primeng-confirmdialog.mjs +823 -0
  92. package/fesm2022/primeng-confirmdialog.mjs.map +1 -0
  93. package/fesm2022/primeng-confirmpopup.mjs +630 -0
  94. package/fesm2022/primeng-confirmpopup.mjs.map +1 -0
  95. package/fesm2022/primeng-contextmenu.mjs +1410 -0
  96. package/fesm2022/primeng-contextmenu.mjs.map +1 -0
  97. package/fesm2022/primeng-dataview.mjs +812 -0
  98. package/fesm2022/primeng-dataview.mjs.map +1 -0
  99. package/fesm2022/primeng-datepicker.mjs +4373 -0
  100. package/fesm2022/primeng-datepicker.mjs.map +1 -0
  101. package/fesm2022/primeng-dialog.mjs +1278 -0
  102. package/fesm2022/primeng-dialog.mjs.map +1 -0
  103. package/fesm2022/primeng-divider.mjs +145 -0
  104. package/fesm2022/primeng-divider.mjs.map +1 -0
  105. package/fesm2022/primeng-dock.mjs +540 -0
  106. package/fesm2022/primeng-dock.mjs.map +1 -0
  107. package/fesm2022/primeng-dom.mjs +775 -0
  108. package/fesm2022/primeng-dom.mjs.map +1 -0
  109. package/fesm2022/primeng-dragdrop.mjs +336 -0
  110. package/fesm2022/primeng-dragdrop.mjs.map +1 -0
  111. package/fesm2022/primeng-drawer.mjs +738 -0
  112. package/fesm2022/primeng-drawer.mjs.map +1 -0
  113. package/fesm2022/primeng-dynamicdialog.mjs +1242 -0
  114. package/fesm2022/primeng-dynamicdialog.mjs.map +1 -0
  115. package/fesm2022/primeng-editor.mjs +511 -0
  116. package/fesm2022/primeng-editor.mjs.map +1 -0
  117. package/fesm2022/primeng-fieldset.mjs +417 -0
  118. package/fesm2022/primeng-fieldset.mjs.map +1 -0
  119. package/fesm2022/primeng-fileupload.mjs +1561 -0
  120. package/fesm2022/primeng-fileupload.mjs.map +1 -0
  121. package/fesm2022/primeng-floatlabel.mjs +103 -0
  122. package/fesm2022/primeng-floatlabel.mjs.map +1 -0
  123. package/fesm2022/primeng-fluid.mjs +80 -0
  124. package/fesm2022/primeng-fluid.mjs.map +1 -0
  125. package/fesm2022/primeng-focustrap.mjs +110 -0
  126. package/fesm2022/primeng-focustrap.mjs.map +1 -0
  127. package/fesm2022/primeng-galleria.mjs +1874 -0
  128. package/fesm2022/primeng-galleria.mjs.map +1 -0
  129. package/fesm2022/primeng-iconfield.mjs +101 -0
  130. package/fesm2022/primeng-iconfield.mjs.map +1 -0
  131. package/fesm2022/primeng-icons-angledoubledown.mjs +37 -0
  132. package/fesm2022/primeng-icons-angledoubledown.mjs.map +1 -0
  133. package/fesm2022/primeng-icons-angledoubleleft.mjs +37 -0
  134. package/fesm2022/primeng-icons-angledoubleleft.mjs.map +1 -0
  135. package/fesm2022/primeng-icons-angledoubleright.mjs +37 -0
  136. package/fesm2022/primeng-icons-angledoubleright.mjs.map +1 -0
  137. package/fesm2022/primeng-icons-angledoubleup.mjs +37 -0
  138. package/fesm2022/primeng-icons-angledoubleup.mjs.map +1 -0
  139. package/fesm2022/primeng-icons-angledown.mjs +33 -0
  140. package/fesm2022/primeng-icons-angledown.mjs.map +1 -0
  141. package/fesm2022/primeng-icons-angleleft.mjs +33 -0
  142. package/fesm2022/primeng-icons-angleleft.mjs.map +1 -0
  143. package/fesm2022/primeng-icons-angleright.mjs +33 -0
  144. package/fesm2022/primeng-icons-angleright.mjs.map +1 -0
  145. package/fesm2022/primeng-icons-angleup.mjs +33 -0
  146. package/fesm2022/primeng-icons-angleup.mjs.map +1 -0
  147. package/fesm2022/primeng-icons-arrowdown.mjs +57 -0
  148. package/fesm2022/primeng-icons-arrowdown.mjs.map +1 -0
  149. package/fesm2022/primeng-icons-arrowdownleft.mjs +33 -0
  150. package/fesm2022/primeng-icons-arrowdownleft.mjs.map +1 -0
  151. package/fesm2022/primeng-icons-arrowdownright.mjs +33 -0
  152. package/fesm2022/primeng-icons-arrowdownright.mjs.map +1 -0
  153. package/fesm2022/primeng-icons-arrowleft.mjs +57 -0
  154. package/fesm2022/primeng-icons-arrowleft.mjs.map +1 -0
  155. package/fesm2022/primeng-icons-arrowright.mjs +37 -0
  156. package/fesm2022/primeng-icons-arrowright.mjs.map +1 -0
  157. package/fesm2022/primeng-icons-arrowup.mjs +57 -0
  158. package/fesm2022/primeng-icons-arrowup.mjs.map +1 -0
  159. package/fesm2022/primeng-icons-ban.mjs +53 -0
  160. package/fesm2022/primeng-icons-ban.mjs.map +1 -0
  161. package/fesm2022/primeng-icons-bars.mjs +37 -0
  162. package/fesm2022/primeng-icons-bars.mjs.map +1 -0
  163. package/fesm2022/primeng-icons-baseicon.mjs +102 -0
  164. package/fesm2022/primeng-icons-baseicon.mjs.map +1 -0
  165. package/fesm2022/primeng-icons-blank.mjs +23 -0
  166. package/fesm2022/primeng-icons-blank.mjs.map +1 -0
  167. package/fesm2022/primeng-icons-calendar.mjs +33 -0
  168. package/fesm2022/primeng-icons-calendar.mjs.map +1 -0
  169. package/fesm2022/primeng-icons-caretleft.mjs +33 -0
  170. package/fesm2022/primeng-icons-caretleft.mjs.map +1 -0
  171. package/fesm2022/primeng-icons-caretright.mjs +33 -0
  172. package/fesm2022/primeng-icons-caretright.mjs.map +1 -0
  173. package/fesm2022/primeng-icons-check.mjs +33 -0
  174. package/fesm2022/primeng-icons-check.mjs.map +1 -0
  175. package/fesm2022/primeng-icons-chevrondown.mjs +33 -0
  176. package/fesm2022/primeng-icons-chevrondown.mjs.map +1 -0
  177. package/fesm2022/primeng-icons-chevronleft.mjs +33 -0
  178. package/fesm2022/primeng-icons-chevronleft.mjs.map +1 -0
  179. package/fesm2022/primeng-icons-chevronright.mjs +33 -0
  180. package/fesm2022/primeng-icons-chevronright.mjs.map +1 -0
  181. package/fesm2022/primeng-icons-chevronup.mjs +33 -0
  182. package/fesm2022/primeng-icons-chevronup.mjs.map +1 -0
  183. package/fesm2022/primeng-icons-exclamationtriangle.mjs +69 -0
  184. package/fesm2022/primeng-icons-exclamationtriangle.mjs.map +1 -0
  185. package/fesm2022/primeng-icons-eye.mjs +37 -0
  186. package/fesm2022/primeng-icons-eye.mjs.map +1 -0
  187. package/fesm2022/primeng-icons-eyeslash.mjs +57 -0
  188. package/fesm2022/primeng-icons-eyeslash.mjs.map +1 -0
  189. package/fesm2022/primeng-icons-filter.mjs +53 -0
  190. package/fesm2022/primeng-icons-filter.mjs.map +1 -0
  191. package/fesm2022/primeng-icons-filterfill.mjs +33 -0
  192. package/fesm2022/primeng-icons-filterfill.mjs.map +1 -0
  193. package/fesm2022/primeng-icons-filterslash.mjs +57 -0
  194. package/fesm2022/primeng-icons-filterslash.mjs.map +1 -0
  195. package/fesm2022/primeng-icons-home.mjs +57 -0
  196. package/fesm2022/primeng-icons-home.mjs.map +1 -0
  197. package/fesm2022/primeng-icons-infocircle.mjs +57 -0
  198. package/fesm2022/primeng-icons-infocircle.mjs.map +1 -0
  199. package/fesm2022/primeng-icons-minus.mjs +33 -0
  200. package/fesm2022/primeng-icons-minus.mjs.map +1 -0
  201. package/fesm2022/primeng-icons-pencil.mjs +53 -0
  202. package/fesm2022/primeng-icons-pencil.mjs.map +1 -0
  203. package/fesm2022/primeng-icons-plus.mjs +53 -0
  204. package/fesm2022/primeng-icons-plus.mjs.map +1 -0
  205. package/fesm2022/primeng-icons-refresh.mjs +57 -0
  206. package/fesm2022/primeng-icons-refresh.mjs.map +1 -0
  207. package/fesm2022/primeng-icons-search.mjs +57 -0
  208. package/fesm2022/primeng-icons-search.mjs.map +1 -0
  209. package/fesm2022/primeng-icons-searchminus.mjs +57 -0
  210. package/fesm2022/primeng-icons-searchminus.mjs.map +1 -0
  211. package/fesm2022/primeng-icons-searchplus.mjs +57 -0
  212. package/fesm2022/primeng-icons-searchplus.mjs.map +1 -0
  213. package/fesm2022/primeng-icons-sortalt.mjs +65 -0
  214. package/fesm2022/primeng-icons-sortalt.mjs.map +1 -0
  215. package/fesm2022/primeng-icons-sortamountdown.mjs +53 -0
  216. package/fesm2022/primeng-icons-sortamountdown.mjs.map +1 -0
  217. package/fesm2022/primeng-icons-sortamountupalt.mjs +53 -0
  218. package/fesm2022/primeng-icons-sortamountupalt.mjs.map +1 -0
  219. package/fesm2022/primeng-icons-spinner.mjs +53 -0
  220. package/fesm2022/primeng-icons-spinner.mjs.map +1 -0
  221. package/fesm2022/primeng-icons-star.mjs +53 -0
  222. package/fesm2022/primeng-icons-star.mjs.map +1 -0
  223. package/fesm2022/primeng-icons-starfill.mjs +53 -0
  224. package/fesm2022/primeng-icons-starfill.mjs.map +1 -0
  225. package/fesm2022/primeng-icons-thlarge.mjs +57 -0
  226. package/fesm2022/primeng-icons-thlarge.mjs.map +1 -0
  227. package/fesm2022/primeng-icons-times.mjs +33 -0
  228. package/fesm2022/primeng-icons-times.mjs.map +1 -0
  229. package/fesm2022/primeng-icons-timescircle.mjs +57 -0
  230. package/fesm2022/primeng-icons-timescircle.mjs.map +1 -0
  231. package/fesm2022/primeng-icons-trash.mjs +57 -0
  232. package/fesm2022/primeng-icons-trash.mjs.map +1 -0
  233. package/fesm2022/primeng-icons-undo.mjs +57 -0
  234. package/fesm2022/primeng-icons-undo.mjs.map +1 -0
  235. package/fesm2022/primeng-icons-upload.mjs +57 -0
  236. package/fesm2022/primeng-icons-upload.mjs.map +1 -0
  237. package/fesm2022/primeng-icons-windowmaximize.mjs +57 -0
  238. package/fesm2022/primeng-icons-windowmaximize.mjs.map +1 -0
  239. package/fesm2022/primeng-icons-windowminimize.mjs +57 -0
  240. package/fesm2022/primeng-icons-windowminimize.mjs.map +1 -0
  241. package/fesm2022/primeng-icons.mjs +63 -0
  242. package/fesm2022/primeng-icons.mjs.map +1 -0
  243. package/fesm2022/primeng-iftalabel.mjs +89 -0
  244. package/fesm2022/primeng-iftalabel.mjs.map +1 -0
  245. package/fesm2022/primeng-image.mjs +705 -0
  246. package/fesm2022/primeng-image.mjs.map +1 -0
  247. package/fesm2022/primeng-imagecompare.mjs +192 -0
  248. package/fesm2022/primeng-imagecompare.mjs.map +1 -0
  249. package/fesm2022/primeng-inplace.mjs +319 -0
  250. package/fesm2022/primeng-inplace.mjs.map +1 -0
  251. package/fesm2022/primeng-inputgroup.mjs +128 -0
  252. package/fesm2022/primeng-inputgroup.mjs.map +1 -0
  253. package/fesm2022/primeng-inputgroupaddon.mjs +83 -0
  254. package/fesm2022/primeng-inputgroupaddon.mjs.map +1 -0
  255. package/fesm2022/primeng-inputicon.mjs +71 -0
  256. package/fesm2022/primeng-inputicon.mjs.map +1 -0
  257. package/fesm2022/primeng-inputmask.mjs +926 -0
  258. package/fesm2022/primeng-inputmask.mjs.map +1 -0
  259. package/fesm2022/primeng-inputnumber.mjs +1621 -0
  260. package/fesm2022/primeng-inputnumber.mjs.map +1 -0
  261. package/fesm2022/primeng-inputotp.mjs +443 -0
  262. package/fesm2022/primeng-inputotp.mjs.map +1 -0
  263. package/fesm2022/primeng-inputtext.mjs +145 -0
  264. package/fesm2022/primeng-inputtext.mjs.map +1 -0
  265. package/fesm2022/primeng-keyfilter.mjs +267 -0
  266. package/fesm2022/primeng-keyfilter.mjs.map +1 -0
  267. package/fesm2022/primeng-knob.mjs +491 -0
  268. package/fesm2022/primeng-knob.mjs.map +1 -0
  269. package/fesm2022/primeng-listbox.mjs +1925 -0
  270. package/fesm2022/primeng-listbox.mjs.map +1 -0
  271. package/fesm2022/primeng-megamenu.mjs +1493 -0
  272. package/fesm2022/primeng-megamenu.mjs.map +1 -0
  273. package/fesm2022/primeng-menu.mjs +1069 -0
  274. package/fesm2022/primeng-menu.mjs.map +1 -0
  275. package/fesm2022/primeng-menubar.mjs +1391 -0
  276. package/fesm2022/primeng-menubar.mjs.map +1 -0
  277. package/fesm2022/primeng-message.mjs +420 -0
  278. package/fesm2022/primeng-message.mjs.map +1 -0
  279. package/fesm2022/primeng-metergroup.mjs +393 -0
  280. package/fesm2022/primeng-metergroup.mjs.map +1 -0
  281. package/fesm2022/primeng-multiselect.mjs +2519 -0
  282. package/fesm2022/primeng-multiselect.mjs.map +1 -0
  283. package/fesm2022/primeng-orderlist.mjs +890 -0
  284. package/fesm2022/primeng-orderlist.mjs.map +1 -0
  285. package/fesm2022/primeng-organizationchart.mjs +520 -0
  286. package/fesm2022/primeng-organizationchart.mjs.map +1 -0
  287. package/fesm2022/primeng-overlay.mjs +776 -0
  288. package/fesm2022/primeng-overlay.mjs.map +1 -0
  289. package/fesm2022/primeng-overlaybadge.mjs +151 -0
  290. package/fesm2022/primeng-overlaybadge.mjs.map +1 -0
  291. package/fesm2022/primeng-paginator.mjs +802 -0
  292. package/fesm2022/primeng-paginator.mjs.map +1 -0
  293. package/fesm2022/primeng-panel.mjs +595 -0
  294. package/fesm2022/primeng-panel.mjs.map +1 -0
  295. package/fesm2022/primeng-panelmenu.mjs +1442 -0
  296. package/fesm2022/primeng-panelmenu.mjs.map +1 -0
  297. package/fesm2022/primeng-password.mjs +1156 -0
  298. package/fesm2022/primeng-password.mjs.map +1 -0
  299. package/fesm2022/primeng-picklist.mjs +2057 -0
  300. package/fesm2022/primeng-picklist.mjs.map +1 -0
  301. package/fesm2022/primeng-popover.mjs +611 -0
  302. package/fesm2022/primeng-popover.mjs.map +1 -0
  303. package/fesm2022/primeng-progressbar.mjs +196 -0
  304. package/fesm2022/primeng-progressbar.mjs.map +1 -0
  305. package/fesm2022/primeng-progressspinner.mjs +140 -0
  306. package/fesm2022/primeng-progressspinner.mjs.map +1 -0
  307. package/fesm2022/primeng-radiobutton.mjs +358 -0
  308. package/fesm2022/primeng-radiobutton.mjs.map +1 -0
  309. package/fesm2022/primeng-rating.mjs +388 -0
  310. package/fesm2022/primeng-rating.mjs.map +1 -0
  311. package/fesm2022/primeng-ripple.mjs +190 -0
  312. package/fesm2022/primeng-ripple.mjs.map +1 -0
  313. package/fesm2022/primeng-scroller.mjs +1306 -0
  314. package/fesm2022/primeng-scroller.mjs.map +1 -0
  315. package/fesm2022/primeng-scrollpanel.mjs +560 -0
  316. package/fesm2022/primeng-scrollpanel.mjs.map +1 -0
  317. package/fesm2022/primeng-scrolltop.mjs +339 -0
  318. package/fesm2022/primeng-scrolltop.mjs.map +1 -0
  319. package/fesm2022/primeng-select.mjs +2250 -0
  320. package/fesm2022/primeng-select.mjs.map +1 -0
  321. package/fesm2022/primeng-selectbutton.mjs +413 -0
  322. package/fesm2022/primeng-selectbutton.mjs.map +1 -0
  323. package/fesm2022/primeng-skeleton.mjs +154 -0
  324. package/fesm2022/primeng-skeleton.mjs.map +1 -0
  325. package/fesm2022/primeng-slider.mjs +843 -0
  326. package/fesm2022/primeng-slider.mjs.map +1 -0
  327. package/fesm2022/primeng-speeddial.mjs +901 -0
  328. package/fesm2022/primeng-speeddial.mjs.map +1 -0
  329. package/fesm2022/primeng-splitbutton.mjs +598 -0
  330. package/fesm2022/primeng-splitbutton.mjs.map +1 -0
  331. package/fesm2022/primeng-splitter.mjs +587 -0
  332. package/fesm2022/primeng-splitter.mjs.map +1 -0
  333. package/fesm2022/primeng-stepper.mjs +683 -0
  334. package/fesm2022/primeng-stepper.mjs.map +1 -0
  335. package/fesm2022/primeng-steps.mjs +424 -0
  336. package/fesm2022/primeng-steps.mjs.map +1 -0
  337. package/fesm2022/primeng-styleclass.mjs +354 -0
  338. package/fesm2022/primeng-styleclass.mjs.map +1 -0
  339. package/fesm2022/primeng-table.mjs +7540 -0
  340. package/fesm2022/primeng-table.mjs.map +1 -0
  341. package/fesm2022/primeng-tabs.mjs +794 -0
  342. package/fesm2022/primeng-tabs.mjs.map +1 -0
  343. package/fesm2022/primeng-tag.mjs +176 -0
  344. package/fesm2022/primeng-tag.mjs.map +1 -0
  345. package/fesm2022/primeng-terminal.mjs +254 -0
  346. package/fesm2022/primeng-terminal.mjs.map +1 -0
  347. package/fesm2022/primeng-textarea.mjs +197 -0
  348. package/fesm2022/primeng-textarea.mjs.map +1 -0
  349. package/fesm2022/primeng-tieredmenu.mjs +1457 -0
  350. package/fesm2022/primeng-tieredmenu.mjs.map +1 -0
  351. package/fesm2022/primeng-timeline.mjs +228 -0
  352. package/fesm2022/primeng-timeline.mjs.map +1 -0
  353. package/fesm2022/primeng-toast.mjs +751 -0
  354. package/fesm2022/primeng-toast.mjs.map +1 -0
  355. package/fesm2022/primeng-togglebutton.mjs +361 -0
  356. package/fesm2022/primeng-togglebutton.mjs.map +1 -0
  357. package/fesm2022/primeng-toggleswitch.mjs +330 -0
  358. package/fesm2022/primeng-toggleswitch.mjs.map +1 -0
  359. package/fesm2022/primeng-toolbar.mjs +189 -0
  360. package/fesm2022/primeng-toolbar.mjs.map +1 -0
  361. package/fesm2022/primeng-tooltip.mjs +757 -0
  362. package/fesm2022/primeng-tooltip.mjs.map +1 -0
  363. package/fesm2022/primeng-tree.mjs +2188 -0
  364. package/fesm2022/primeng-tree.mjs.map +1 -0
  365. package/fesm2022/primeng-treeselect.mjs +1328 -0
  366. package/fesm2022/primeng-treeselect.mjs.map +1 -0
  367. package/fesm2022/primeng-treetable.mjs +5080 -0
  368. package/fesm2022/primeng-treetable.mjs.map +1 -0
  369. package/fesm2022/primeng-ts-helpers.mjs +4 -0
  370. package/fesm2022/primeng-ts-helpers.mjs.map +1 -0
  371. package/fesm2022/primeng-usestyle.mjs +52 -0
  372. package/fesm2022/primeng-usestyle.mjs.map +1 -0
  373. package/fesm2022/primeng-utils.mjs +332 -0
  374. package/fesm2022/primeng-utils.mjs.map +1 -0
  375. package/fesm2022/primeng.mjs +6 -0
  376. package/fesm2022/primeng.mjs.map +1 -0
  377. package/fieldset/index.d.ts +217 -0
  378. package/fileupload/index.d.ts +786 -0
  379. package/floatlabel/index.d.ts +59 -0
  380. package/fluid/index.d.ts +48 -0
  381. package/focustrap/index.d.ts +36 -0
  382. package/galleria/index.d.ts +710 -0
  383. package/iconfield/index.d.ts +64 -0
  384. package/icons/angledoubledown/index.d.ts +9 -0
  385. package/icons/angledoubleleft/index.d.ts +9 -0
  386. package/icons/angledoubleright/index.d.ts +9 -0
  387. package/icons/angledoubleup/index.d.ts +9 -0
  388. package/icons/angledown/index.d.ts +9 -0
  389. package/icons/angleleft/index.d.ts +9 -0
  390. package/icons/angleright/index.d.ts +9 -0
  391. package/icons/angleup/index.d.ts +9 -0
  392. package/icons/arrowdown/index.d.ts +12 -0
  393. package/icons/arrowdownleft/index.d.ts +9 -0
  394. package/icons/arrowdownright/index.d.ts +9 -0
  395. package/icons/arrowleft/index.d.ts +11 -0
  396. package/icons/arrowright/index.d.ts +9 -0
  397. package/icons/arrowup/index.d.ts +11 -0
  398. package/icons/ban/index.d.ts +11 -0
  399. package/icons/bars/index.d.ts +9 -0
  400. package/icons/baseicon/index.d.ts +33 -0
  401. package/icons/blank/index.d.ts +9 -0
  402. package/icons/calendar/index.d.ts +9 -0
  403. package/icons/caretleft/index.d.ts +9 -0
  404. package/icons/caretright/index.d.ts +9 -0
  405. package/icons/check/index.d.ts +9 -0
  406. package/icons/chevrondown/index.d.ts +9 -0
  407. package/icons/chevronleft/index.d.ts +9 -0
  408. package/icons/chevronright/index.d.ts +9 -0
  409. package/icons/chevronup/index.d.ts +9 -0
  410. package/icons/exclamationtriangle/index.d.ts +12 -0
  411. package/icons/eye/index.d.ts +9 -0
  412. package/icons/eyeslash/index.d.ts +11 -0
  413. package/icons/filter/index.d.ts +11 -0
  414. package/icons/filterfill/index.d.ts +9 -0
  415. package/icons/filterslash/index.d.ts +11 -0
  416. package/icons/home/index.d.ts +11 -0
  417. package/icons/index.d.ts +53 -0
  418. package/icons/infocircle/index.d.ts +11 -0
  419. package/icons/minus/index.d.ts +9 -0
  420. package/icons/pencil/index.d.ts +11 -0
  421. package/icons/plus/index.d.ts +11 -0
  422. package/icons/refresh/index.d.ts +11 -0
  423. package/icons/search/index.d.ts +11 -0
  424. package/icons/searchminus/index.d.ts +11 -0
  425. package/icons/searchplus/index.d.ts +11 -0
  426. package/icons/sortalt/index.d.ts +11 -0
  427. package/icons/sortamountdown/index.d.ts +11 -0
  428. package/icons/sortamountupalt/index.d.ts +11 -0
  429. package/icons/spinner/index.d.ts +11 -0
  430. package/icons/star/index.d.ts +11 -0
  431. package/icons/starfill/index.d.ts +11 -0
  432. package/icons/thlarge/index.d.ts +11 -0
  433. package/icons/times/index.d.ts +9 -0
  434. package/icons/timescircle/index.d.ts +11 -0
  435. package/icons/trash/index.d.ts +11 -0
  436. package/icons/undo/index.d.ts +11 -0
  437. package/icons/upload/index.d.ts +11 -0
  438. package/icons/windowmaximize/index.d.ts +11 -0
  439. package/icons/windowminimize/index.d.ts +11 -0
  440. package/iftalabel/index.d.ts +50 -0
  441. package/image/index.d.ts +376 -0
  442. package/imagecompare/index.d.ts +93 -0
  443. package/index.d.ts +2 -0
  444. package/inplace/index.d.ts +183 -0
  445. package/inputgroup/index.d.ts +58 -0
  446. package/inputgroupaddon/index.d.ts +45 -0
  447. package/inputicon/index.d.ts +36 -0
  448. package/inputmask/index.d.ts +282 -0
  449. package/inputnumber/index.d.ts +466 -0
  450. package/inputotp/index.d.ts +209 -0
  451. package/inputtext/index.d.ts +89 -0
  452. package/keyfilter/index.d.ts +66 -0
  453. package/knob/index.d.ts +206 -0
  454. package/listbox/index.d.ts +802 -0
  455. package/megamenu/index.d.ts +408 -0
  456. package/menu/index.d.ts +341 -0
  457. package/menubar/index.d.ts +418 -0
  458. package/message/index.d.ts +195 -0
  459. package/metergroup/index.d.ts +291 -0
  460. package/multiselect/index.d.ts +1060 -0
  461. package/orderlist/index.d.ts +464 -0
  462. package/organizationchart/index.d.ts +285 -0
  463. package/overlay/index.d.ts +255 -0
  464. package/overlaybadge/index.d.ts +73 -0
  465. package/package.json +725 -0
  466. package/paginator/index.d.ts +393 -0
  467. package/panel/index.d.ts +266 -0
  468. package/panelmenu/index.d.ts +380 -0
  469. package/password/index.d.ts +436 -0
  470. package/picklist/index.d.ts +906 -0
  471. package/popover/index.d.ts +176 -0
  472. package/progressbar/index.d.ts +112 -0
  473. package/progressspinner/index.d.ts +85 -0
  474. package/radiobutton/index.d.ts +201 -0
  475. package/rating/index.d.ts +218 -0
  476. package/ripple/index.d.ts +62 -0
  477. package/scroller/index.d.ts +614 -0
  478. package/scrollpanel/index.d.ts +161 -0
  479. package/scrolltop/index.d.ts +158 -0
  480. package/select/index.d.ts +923 -0
  481. package/selectbutton/index.d.ts +221 -0
  482. package/skeleton/index.d.ts +96 -0
  483. package/slider/index.d.ts +255 -0
  484. package/speeddial/index.d.ts +454 -0
  485. package/splitbutton/index.d.ts +306 -0
  486. package/splitter/index.d.ts +239 -0
  487. package/stepper/index.d.ts +297 -0
  488. package/steps/index.d.ts +152 -0
  489. package/styleclass/index.d.ts +115 -0
  490. package/table/index.d.ts +2700 -0
  491. package/tabs/index.d.ts +321 -0
  492. package/tag/index.d.ts +114 -0
  493. package/terminal/index.d.ts +134 -0
  494. package/textarea/index.d.ts +108 -0
  495. package/tieredmenu/index.d.ts +430 -0
  496. package/timeline/index.d.ts +170 -0
  497. package/toast/index.d.ts +320 -0
  498. package/togglebutton/index.d.ts +243 -0
  499. package/toggleswitch/index.d.ts +188 -0
  500. package/toolbar/index.d.ts +118 -0
  501. package/tooltip/index.d.ts +247 -0
  502. package/tree/index.d.ts +847 -0
  503. package/treeselect/index.d.ts +655 -0
  504. package/treetable/index.d.ts +1727 -0
  505. package/ts-helpers/index.d.ts +6 -0
  506. package/usestyle/index.d.ts +15 -0
  507. package/utils/index.d.ts +43 -0
@@ -0,0 +1,4373 @@
1
+ import { trigger, state, transition, style as style$1, animate } from '@angular/animations';
2
+ import * as i2 from '@angular/common';
3
+ import { CommonModule } from '@angular/common';
4
+ import * as i0 from '@angular/core';
5
+ import { Injectable, forwardRef, input, EventEmitter, inject, computed, numberAttribute, booleanAttribute, ContentChildren, ContentChild, ViewChild, Output, Input, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
6
+ import { NG_VALUE_ACCESSOR } from '@angular/forms';
7
+ import { uuid, getOuterWidth, isDate, findSingle, getFocusableElements, hasClass, getIndex, find, isNotEmpty, addStyle, appendChild, absolutePosition, relativePosition, addClass, setAttribute, isTouchDevice } from '@primeuix/utils';
8
+ import * as i1 from 'primeng/api';
9
+ import { TranslationKeys, SharedModule, PrimeTemplate } from 'primeng/api';
10
+ import { AutoFocus } from 'primeng/autofocus';
11
+ import { BaseInput } from 'primeng/baseinput';
12
+ import { Button } from 'primeng/button';
13
+ import { blockBodyScroll, unblockBodyScroll, ConnectedOverlayScrollHandler } from 'primeng/dom';
14
+ import { ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronDownIcon, TimesIcon, CalendarIcon } from 'primeng/icons';
15
+ import { InputText } from 'primeng/inputtext';
16
+ import { Ripple } from 'primeng/ripple';
17
+ import { ZIndexUtils } from 'primeng/utils';
18
+ import { style } from '@primeuix/styles/datepicker';
19
+ import { BaseStyle } from 'primeng/base';
20
+
21
+ const theme = /*css*/ `
22
+ ${style}
23
+
24
+ /* For PrimeNG */
25
+ .p-datepicker.ng-invalid.ng-dirty .p-inputtext {
26
+ border-color: dt('inputtext.invalid.border.color');
27
+ }
28
+ `;
29
+ const inlineStyles = {
30
+ root: () => ({ position: 'relative' })
31
+ };
32
+ const classes = {
33
+ root: ({ instance }) => [
34
+ 'p-datepicker p-component p-inputwrapper',
35
+ {
36
+ 'p-invalid': instance.invalid(),
37
+ 'p-datepicker-fluid': instance.hasFluid,
38
+ 'p-inputwrapper-filled': instance.$filled(),
39
+ 'p-variant-filled': instance.$variant() === 'filled',
40
+ 'p-inputwrapper-focus': instance.focus || instance.overlayVisible,
41
+ 'p-focus': instance.focus || instance.overlayVisible
42
+ }
43
+ ],
44
+ pcInputText: 'p-datepicker-input',
45
+ dropdown: 'p-datepicker-dropdown',
46
+ inputIconContainer: 'p-datepicker-input-icon-container',
47
+ inputIcon: 'p-datepicker-input-icon',
48
+ panel: ({ instance }) => [
49
+ 'p-datepicker-panel p-component',
50
+ {
51
+ 'p-datepicker-panel p-component': true,
52
+ 'p-datepicker-panel-inline': instance.inline,
53
+ 'p-disabled': instance.$disabled(),
54
+ 'p-datepicker-timeonly': instance.timeOnly
55
+ }
56
+ ],
57
+ calendarContainer: 'p-datepicker-calendar-container',
58
+ calendar: 'p-datepicker-calendar',
59
+ header: 'p-datepicker-header',
60
+ pcPrevButton: 'p-datepicker-prev-button',
61
+ title: 'p-datepicker-title',
62
+ selectMonth: 'p-datepicker-select-month',
63
+ selectYear: 'p-datepicker-select-year',
64
+ decade: 'p-datepicker-decade',
65
+ pcNextButton: 'p-datepicker-next-button',
66
+ dayView: 'p-datepicker-day-view',
67
+ weekHeader: 'p-datepicker-weekheader p-disabled',
68
+ weekNumber: 'p-datepicker-weeknumber',
69
+ weekLabelContainer: 'p-datepicker-weeklabel-container p-disabled',
70
+ weekDayCell: 'p-datepicker-weekday-cell',
71
+ weekDay: 'p-datepicker-weekday',
72
+ dayCell: ({ date }) => [
73
+ 'p-datepicker-day-cell',
74
+ {
75
+ 'p-datepicker-other-month': date.otherMonth,
76
+ 'p-datepicker-today': date.today
77
+ }
78
+ ],
79
+ day: ({ instance, date }) => {
80
+ let selectedDayClass = '';
81
+ if (instance.isRangeSelection() && instance.isSelected(date) && date.selectable) {
82
+ const startDate = instance.value[0];
83
+ const endDate = instance.value[1];
84
+ const isStart = startDate && date.year === startDate.getFullYear() && date.month === startDate.getMonth() && date.day === startDate.getDate();
85
+ const isEnd = endDate && date.year === endDate.getFullYear() && date.month === endDate.getMonth() && date.day === endDate.getDate();
86
+ selectedDayClass = isStart || isEnd ? 'p-datepicker-day-selected' : 'p-datepicker-day-selected-range';
87
+ }
88
+ return {
89
+ 'p-datepicker-day': true,
90
+ 'p-datepicker-day-selected': !instance.isRangeSelection() && instance.isSelected(date) && date.selectable,
91
+ 'p-disabled': instance.$disabled() || !date.selectable,
92
+ [selectedDayClass]: true
93
+ };
94
+ },
95
+ monthView: 'p-datepicker-month-view',
96
+ month: ({ instance, index }) => [
97
+ 'p-datepicker-month',
98
+ {
99
+ 'p-datepicker-month-selected': instance.isMonthSelected(index),
100
+ 'p-disabled': instance.isMonthDisabled(index)
101
+ }
102
+ ],
103
+ yearView: 'p-datepicker-year-view',
104
+ year: ({ instance, year }) => [
105
+ 'p-datepicker-year',
106
+ {
107
+ 'p-datepicker-year-selected': instance.isYearSelected(year),
108
+ 'p-disabled': instance.isYearDisabled(year)
109
+ }
110
+ ],
111
+ timePicker: 'p-datepicker-time-picker',
112
+ hourPicker: 'p-datepicker-hour-picker',
113
+ pcIncrementButton: 'p-datepicker-increment-button',
114
+ pcDecrementButton: 'p-datepicker-decrement-button',
115
+ separator: 'p-datepicker-separator',
116
+ minutePicker: 'p-datepicker-minute-picker',
117
+ secondPicker: 'p-datepicker-second-picker',
118
+ ampmPicker: 'p-datepicker-ampm-picker',
119
+ buttonbar: 'p-datepicker-buttonbar',
120
+ pcTodayButton: 'p-datepicker-today-button',
121
+ pcClearButton: 'p-datepicker-clear-button',
122
+ clearIcon: 'p-datepicker-clear-icon'
123
+ };
124
+ class DatePickerStyle extends BaseStyle {
125
+ name = 'datepicker';
126
+ theme = theme;
127
+ classes = classes;
128
+ inlineStyles = inlineStyles;
129
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: DatePickerStyle, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
130
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: DatePickerStyle });
131
+ }
132
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: DatePickerStyle, decorators: [{
133
+ type: Injectable
134
+ }] });
135
+ /**
136
+ *
137
+ * DatePicker is a form component to work with dates.
138
+ *
139
+ * [Live Demo](https://www.primeng.org/datepicker/)
140
+ *
141
+ * @module datepickerstyle
142
+ *
143
+ */
144
+ var DatePickerClasses;
145
+ (function (DatePickerClasses) {
146
+ /**
147
+ * Class name of the root element
148
+ */
149
+ DatePickerClasses["root"] = "p-datepicker";
150
+ /**
151
+ * Class name of the input element
152
+ */
153
+ DatePickerClasses["pcInputText"] = "p-datepicker-input";
154
+ /**
155
+ * Class name of the dropdown element
156
+ */
157
+ DatePickerClasses["dropdown"] = "p-datepicker-dropdown";
158
+ /**
159
+ * Class name of the input icon container element
160
+ */
161
+ DatePickerClasses["inputIconContainer"] = "p-datepicker-input-icon-container";
162
+ /**
163
+ * Class name of the input icon element
164
+ */
165
+ DatePickerClasses["inputIcon"] = "p-datepicker-input-icon";
166
+ /**
167
+ * Class name of the panel element
168
+ */
169
+ DatePickerClasses["panel"] = "p-datepicker-panel";
170
+ /**
171
+ * Class name of the calendar container element
172
+ */
173
+ DatePickerClasses["calendarContainer"] = "p-datepicker-calendar-container";
174
+ /**
175
+ * Class name of the calendar element
176
+ */
177
+ DatePickerClasses["calendar"] = "p-datepicker-calendar";
178
+ /**
179
+ * Class name of the header element
180
+ */
181
+ DatePickerClasses["header"] = "p-datepicker-header";
182
+ /**
183
+ * Class name of the previous button element
184
+ */
185
+ DatePickerClasses["pcPrevButton"] = "p-datepicker-prev-button";
186
+ /**
187
+ * Class name of the title element
188
+ */
189
+ DatePickerClasses["title"] = "p-datepicker-title";
190
+ /**
191
+ * Class name of the select month element
192
+ */
193
+ DatePickerClasses["selectMonth"] = "p-datepicker-select-month";
194
+ /**
195
+ * Class name of the select year element
196
+ */
197
+ DatePickerClasses["selectYear"] = "p-datepicker-select-year";
198
+ /**
199
+ * Class name of the decade element
200
+ */
201
+ DatePickerClasses["decade"] = "p-datepicker-decade";
202
+ /**
203
+ * Class name of the next button element
204
+ */
205
+ DatePickerClasses["pcNextButton"] = "p-datepicker-next-button";
206
+ /**
207
+ * Class name of the day view element
208
+ */
209
+ DatePickerClasses["dayView"] = "p-datepicker-day-view";
210
+ /**
211
+ * Class name of the week header element
212
+ */
213
+ DatePickerClasses["weekHeader"] = "p-datepicker-weekheader";
214
+ /**
215
+ * Class name of the week number element
216
+ */
217
+ DatePickerClasses["weekNumber"] = "p-datepicker-weeknumber";
218
+ /**
219
+ * Class name of the week label container element
220
+ */
221
+ DatePickerClasses["weekLabelContainer"] = "p-datepicker-weeklabel-container";
222
+ /**
223
+ * Class name of the week day cell element
224
+ */
225
+ DatePickerClasses["weekDayCell"] = "p-datepicker-weekday-cell";
226
+ /**
227
+ * Class name of the week day element
228
+ */
229
+ DatePickerClasses["weekDay"] = "p-datepicker-weekday";
230
+ /**
231
+ * Class name of the day cell element
232
+ */
233
+ DatePickerClasses["dayCell"] = "p-datepicker-day-cell";
234
+ /**
235
+ * Class name of the day element
236
+ */
237
+ DatePickerClasses["day"] = "p-datepicker-day";
238
+ /**
239
+ * Class name of the month view element
240
+ */
241
+ DatePickerClasses["monthView"] = "p-datepicker-month-view";
242
+ /**
243
+ * Class name of the month element
244
+ */
245
+ DatePickerClasses["month"] = "p-datepicker-month";
246
+ /**
247
+ * Class name of the year view element
248
+ */
249
+ DatePickerClasses["yearView"] = "p-datepicker-year-view";
250
+ /**
251
+ * Class name of the year element
252
+ */
253
+ DatePickerClasses["year"] = "p-datepicker-year";
254
+ /**
255
+ * Class name of the time picker element
256
+ */
257
+ DatePickerClasses["timePicker"] = "p-datepicker-time-picker";
258
+ /**
259
+ * Class name of the hour picker element
260
+ */
261
+ DatePickerClasses["hourPicker"] = "p-datepicker-hour-picker";
262
+ /**
263
+ * Class name of the increment button element
264
+ */
265
+ DatePickerClasses["pcIncrementButton"] = "p-datepicker-increment-button";
266
+ /**
267
+ * Class name of the decrement button element
268
+ */
269
+ DatePickerClasses["pcDecrementButton"] = "p-datepicker-decrement-button";
270
+ /**
271
+ * Class name of the separator element
272
+ */
273
+ DatePickerClasses["separator"] = "p-datepicker-separator";
274
+ /**
275
+ * Class name of the minute picker element
276
+ */
277
+ DatePickerClasses["minutePicker"] = "p-datepicker-minute-picker";
278
+ /**
279
+ * Class name of the second picker element
280
+ */
281
+ DatePickerClasses["secondPicker"] = "p-datepicker-second-picker";
282
+ /**
283
+ * Class name of the ampm picker element
284
+ */
285
+ DatePickerClasses["ampmPicker"] = "p-datepicker-ampm-picker";
286
+ /**
287
+ * Class name of the buttonbar element
288
+ */
289
+ DatePickerClasses["buttonbar"] = "p-datepicker-buttonbar";
290
+ /**
291
+ * Class name of the today button element
292
+ */
293
+ DatePickerClasses["pcTodayButton"] = "p-datepicker-today-button";
294
+ /**
295
+ * Class name of the clear button element
296
+ */
297
+ DatePickerClasses["pcClearButton"] = "p-datepicker-clear-button";
298
+ /**
299
+ * Class name of the clear icon
300
+ */
301
+ DatePickerClasses["clearIcon"] = "p-datepicker-clear-icon";
302
+ })(DatePickerClasses || (DatePickerClasses = {}));
303
+
304
+ const DATEPICKER_VALUE_ACCESSOR = {
305
+ provide: NG_VALUE_ACCESSOR,
306
+ useExisting: forwardRef(() => DatePicker),
307
+ multi: true
308
+ };
309
+ /**
310
+ * DatePicker is a form component to work with dates.
311
+ * @group Components
312
+ */
313
+ class DatePicker extends BaseInput {
314
+ zone;
315
+ overlayService;
316
+ iconDisplay = 'button';
317
+ /**
318
+ * Style class of the component.
319
+ * @deprecated since v20.0.0, use `class` instead.
320
+ * @group Props
321
+ */
322
+ styleClass;
323
+ /**
324
+ * Inline style of the input field.
325
+ * @group Props
326
+ */
327
+ inputStyle;
328
+ /**
329
+ * Identifier of the focus input to match a label defined for the component.
330
+ * @group Props
331
+ */
332
+ inputId;
333
+ /**
334
+ * Style class of the input field.
335
+ * @group Props
336
+ */
337
+ inputStyleClass;
338
+ /**
339
+ * Placeholder text for the input.
340
+ * @group Props
341
+ */
342
+ placeholder;
343
+ /**
344
+ * Establishes relationships between the component and label(s) where its value should be one or more element IDs.
345
+ * @group Props
346
+ */
347
+ ariaLabelledBy;
348
+ /**
349
+ * Defines a string that labels the input for accessibility.
350
+ * @group Props
351
+ */
352
+ ariaLabel;
353
+ /**
354
+ * Defines a string that labels the icon button for accessibility.
355
+ * @group Props
356
+ */
357
+ iconAriaLabel;
358
+ /**
359
+ * Format of the date which can also be defined at locale settings.
360
+ * @group Props
361
+ */
362
+ get dateFormat() {
363
+ return this._dateFormat;
364
+ }
365
+ set dateFormat(value) {
366
+ this._dateFormat = value;
367
+ if (this.initialized) {
368
+ this.updateInputfield();
369
+ }
370
+ }
371
+ /**
372
+ * Separator for multiple selection mode.
373
+ * @group Props
374
+ */
375
+ multipleSeparator = ',';
376
+ /**
377
+ * Separator for joining start and end dates on range selection mode.
378
+ * @group Props
379
+ */
380
+ rangeSeparator = '-';
381
+ /**
382
+ * When enabled, displays the datepicker as inline. Default is false for popup mode.
383
+ * @group Props
384
+ */
385
+ inline = false;
386
+ /**
387
+ * Whether to display dates in other months (non-selectable) at the start or end of the current month. To make these days selectable use the selectOtherMonths option.
388
+ * @group Props
389
+ */
390
+ showOtherMonths = true;
391
+ /**
392
+ * Whether days in other months shown before or after the current month are selectable. This only applies if the showOtherMonths option is set to true.
393
+ * @group Props
394
+ */
395
+ selectOtherMonths;
396
+ /**
397
+ * When enabled, displays a button with icon next to input.
398
+ * @group Props
399
+ */
400
+ showIcon;
401
+ /**
402
+ * Icon of the datepicker button.
403
+ * @group Props
404
+ */
405
+ icon;
406
+ /**
407
+ * When specified, prevents entering the date manually with keyboard.
408
+ * @group Props
409
+ */
410
+ readonlyInput;
411
+ /**
412
+ * The cutoff year for determining the century for a date.
413
+ * @group Props
414
+ */
415
+ shortYearCutoff = '+10';
416
+ /**
417
+ * Specifies 12 or 24 hour format.
418
+ * @group Props
419
+ */
420
+ get hourFormat() {
421
+ return this._hourFormat;
422
+ }
423
+ set hourFormat(value) {
424
+ this._hourFormat = value;
425
+ if (this.initialized) {
426
+ this.updateInputfield();
427
+ }
428
+ }
429
+ /**
430
+ * Whether to display timepicker only.
431
+ * @group Props
432
+ */
433
+ timeOnly;
434
+ /**
435
+ * Hours to change per step.
436
+ * @group Props
437
+ */
438
+ stepHour = 1;
439
+ /**
440
+ * Minutes to change per step.
441
+ * @group Props
442
+ */
443
+ stepMinute = 1;
444
+ /**
445
+ * Seconds to change per step.
446
+ * @group Props
447
+ */
448
+ stepSecond = 1;
449
+ /**
450
+ * Whether to show the seconds in time picker.
451
+ * @group Props
452
+ */
453
+ showSeconds = false;
454
+ /**
455
+ * When disabled, datepicker will not be visible with input focus.
456
+ * @group Props
457
+ */
458
+ showOnFocus = true;
459
+ /**
460
+ * When enabled, datepicker will show week numbers.
461
+ * @group Props
462
+ */
463
+ showWeek = false;
464
+ /**
465
+ * When enabled, datepicker will start week numbers from first day of the year.
466
+ * @group Props
467
+ */
468
+ startWeekFromFirstDayOfYear = false;
469
+ /**
470
+ * When enabled, a clear icon is displayed to clear the value.
471
+ * @group Props
472
+ */
473
+ showClear = false;
474
+ /**
475
+ * Type of the value to write back to ngModel, default is date and alternative is string.
476
+ * @group Props
477
+ */
478
+ dataType = 'date';
479
+ /**
480
+ * Defines the quantity of the selection, valid values are "single", "multiple" and "range".
481
+ * @group Props
482
+ */
483
+ selectionMode = 'single';
484
+ /**
485
+ * Maximum number of selectable dates in multiple mode.
486
+ * @group Props
487
+ */
488
+ maxDateCount;
489
+ /**
490
+ * Whether to display today and clear buttons at the footer
491
+ * @group Props
492
+ */
493
+ showButtonBar;
494
+ /**
495
+ * Style class of the today button.
496
+ * @group Props
497
+ */
498
+ todayButtonStyleClass;
499
+ /**
500
+ * Style class of the clear button.
501
+ * @group Props
502
+ */
503
+ clearButtonStyleClass;
504
+ /**
505
+ * When present, it specifies that the component should automatically get focus on load.
506
+ * @group Props
507
+ */
508
+ autofocus;
509
+ /**
510
+ * Whether to automatically manage layering.
511
+ * @group Props
512
+ */
513
+ autoZIndex = true;
514
+ /**
515
+ * Base zIndex value to use in layering.
516
+ * @group Props
517
+ */
518
+ baseZIndex = 0;
519
+ /**
520
+ * Style class of the datetimepicker container element.
521
+ * @group Props
522
+ */
523
+ panelStyleClass;
524
+ /**
525
+ * Inline style of the datetimepicker container element.
526
+ * @group Props
527
+ */
528
+ panelStyle;
529
+ /**
530
+ * Keep invalid value when input blur.
531
+ * @group Props
532
+ */
533
+ keepInvalid = false;
534
+ /**
535
+ * Whether to hide the overlay on date selection.
536
+ * @group Props
537
+ */
538
+ hideOnDateTimeSelect = true;
539
+ /**
540
+ * When enabled, datepicker overlay is displayed as optimized for touch devices.
541
+ * @group Props
542
+ */
543
+ touchUI;
544
+ /**
545
+ * Separator of time selector.
546
+ * @group Props
547
+ */
548
+ timeSeparator = ':';
549
+ /**
550
+ * When enabled, can only focus on elements inside the datepicker.
551
+ * @group Props
552
+ */
553
+ focusTrap = true;
554
+ /**
555
+ * Transition options of the show animation.
556
+ * @group Props
557
+ */
558
+ showTransitionOptions = '.12s cubic-bezier(0, 0, 0.2, 1)';
559
+ /**
560
+ * Transition options of the hide animation.
561
+ * @group Props
562
+ */
563
+ hideTransitionOptions = '.1s linear';
564
+ /**
565
+ * Index of the element in tabbing order.
566
+ * @group Props
567
+ */
568
+ tabindex;
569
+ /**
570
+ * The minimum selectable date.
571
+ * @group Props
572
+ */
573
+ get minDate() {
574
+ return this._minDate;
575
+ }
576
+ set minDate(date) {
577
+ this._minDate = date;
578
+ if (this.currentMonth != undefined && this.currentMonth != null && this.currentYear) {
579
+ this.createMonths(this.currentMonth, this.currentYear);
580
+ }
581
+ }
582
+ /**
583
+ * The maximum selectable date.
584
+ * @group Props
585
+ */
586
+ get maxDate() {
587
+ return this._maxDate;
588
+ }
589
+ set maxDate(date) {
590
+ this._maxDate = date;
591
+ if (this.currentMonth != undefined && this.currentMonth != null && this.currentYear) {
592
+ this.createMonths(this.currentMonth, this.currentYear);
593
+ }
594
+ }
595
+ /**
596
+ * Array with dates that should be disabled (not selectable).
597
+ * @group Props
598
+ */
599
+ get disabledDates() {
600
+ return this._disabledDates;
601
+ }
602
+ set disabledDates(disabledDates) {
603
+ this._disabledDates = disabledDates;
604
+ if (this.currentMonth != undefined && this.currentMonth != null && this.currentYear) {
605
+ this.createMonths(this.currentMonth, this.currentYear);
606
+ }
607
+ }
608
+ /**
609
+ * Array with weekday numbers that should be disabled (not selectable).
610
+ * @group Props
611
+ */
612
+ get disabledDays() {
613
+ return this._disabledDays;
614
+ }
615
+ set disabledDays(disabledDays) {
616
+ this._disabledDays = disabledDays;
617
+ if (this.currentMonth != undefined && this.currentMonth != null && this.currentYear) {
618
+ this.createMonths(this.currentMonth, this.currentYear);
619
+ }
620
+ }
621
+ /**
622
+ * Whether to display timepicker.
623
+ * @group Props
624
+ */
625
+ get showTime() {
626
+ return this._showTime;
627
+ }
628
+ set showTime(showTime) {
629
+ this._showTime = showTime;
630
+ if (this.currentHour === undefined) {
631
+ this.initTime(this.value || new Date());
632
+ }
633
+ this.updateInputfield();
634
+ }
635
+ /**
636
+ * An array of options for responsive design.
637
+ * @group Props
638
+ */
639
+ get responsiveOptions() {
640
+ return this._responsiveOptions;
641
+ }
642
+ set responsiveOptions(responsiveOptions) {
643
+ this._responsiveOptions = responsiveOptions;
644
+ this.destroyResponsiveStyleElement();
645
+ this.createResponsiveStyle();
646
+ }
647
+ /**
648
+ * Number of months to display.
649
+ * @group Props
650
+ */
651
+ get numberOfMonths() {
652
+ return this._numberOfMonths;
653
+ }
654
+ set numberOfMonths(numberOfMonths) {
655
+ this._numberOfMonths = numberOfMonths;
656
+ this.destroyResponsiveStyleElement();
657
+ this.createResponsiveStyle();
658
+ }
659
+ /**
660
+ * Defines the first of the week for various date calculations.
661
+ * @group Props
662
+ */
663
+ get firstDayOfWeek() {
664
+ return this._firstDayOfWeek;
665
+ }
666
+ set firstDayOfWeek(firstDayOfWeek) {
667
+ this._firstDayOfWeek = firstDayOfWeek;
668
+ this.createWeekDays();
669
+ }
670
+ /**
671
+ * Type of view to display, valid values are "date" for datepicker and "month" for month picker.
672
+ * @group Props
673
+ */
674
+ get view() {
675
+ return this._view;
676
+ }
677
+ set view(view) {
678
+ this._view = view;
679
+ this.currentView = this._view;
680
+ }
681
+ /**
682
+ * Set the date to highlight on first opening if the field is blank.
683
+ * @group Props
684
+ */
685
+ get defaultDate() {
686
+ return this._defaultDate;
687
+ }
688
+ set defaultDate(defaultDate) {
689
+ this._defaultDate = defaultDate;
690
+ if (this.initialized) {
691
+ const date = defaultDate || new Date();
692
+ this.currentMonth = date.getMonth();
693
+ this.currentYear = date.getFullYear();
694
+ this.initTime(date);
695
+ this.createMonths(this.currentMonth, this.currentYear);
696
+ }
697
+ }
698
+ /**
699
+ * Target element to attach the overlay, valid values are "body" or a local ng-template variable of another element (note: use binding with brackets for template variables, e.g. [appendTo]="mydiv" for a div element having #mydiv as variable name).
700
+ * @defaultValue 'self'
701
+ * @group Props
702
+ */
703
+ appendTo = input(undefined, ...(ngDevMode ? [{ debugName: "appendTo" }] : []));
704
+ /**
705
+ * Callback to invoke on focus of input field.
706
+ * @param {Event} event - browser event.
707
+ * @group Emits
708
+ */
709
+ onFocus = new EventEmitter();
710
+ /**
711
+ * Callback to invoke on blur of input field.
712
+ * @param {Event} event - browser event.
713
+ * @group Emits
714
+ */
715
+ onBlur = new EventEmitter();
716
+ /**
717
+ * Callback to invoke when date panel closed.
718
+ * @param {Event} event - Mouse event
719
+ * @group Emits
720
+ */
721
+ onClose = new EventEmitter();
722
+ /**
723
+ * Callback to invoke on date select.
724
+ * @param {Date} date - date value.
725
+ * @group Emits
726
+ */
727
+ onSelect = new EventEmitter();
728
+ /**
729
+ * Callback to invoke when input field cleared.
730
+ * @group Emits
731
+ */
732
+ onClear = new EventEmitter();
733
+ /**
734
+ * Callback to invoke when input field is being typed.
735
+ * @param {Event} event - browser event
736
+ * @group Emits
737
+ */
738
+ onInput = new EventEmitter();
739
+ /**
740
+ * Callback to invoke when today button is clicked.
741
+ * @param {Date} date - today as a date instance.
742
+ * @group Emits
743
+ */
744
+ onTodayClick = new EventEmitter();
745
+ /**
746
+ * Callback to invoke when clear button is clicked.
747
+ * @param {Event} event - browser event.
748
+ * @group Emits
749
+ */
750
+ onClearClick = new EventEmitter();
751
+ /**
752
+ * Callback to invoke when a month is changed using the navigators.
753
+ * @param {DatePickerMonthChangeEvent} event - custom month change event.
754
+ * @group Emits
755
+ */
756
+ onMonthChange = new EventEmitter();
757
+ /**
758
+ * Callback to invoke when a year is changed using the navigators.
759
+ * @param {DatePickerYearChangeEvent} event - custom year change event.
760
+ * @group Emits
761
+ */
762
+ onYearChange = new EventEmitter();
763
+ /**
764
+ * Callback to invoke when clicked outside of the date panel.
765
+ * @group Emits
766
+ */
767
+ onClickOutside = new EventEmitter();
768
+ /**
769
+ * Callback to invoke when datepicker panel is shown.
770
+ * @group Emits
771
+ */
772
+ onShow = new EventEmitter();
773
+ inputfieldViewChild;
774
+ set content(content) {
775
+ this.contentViewChild = content;
776
+ if (this.contentViewChild) {
777
+ if (this.isMonthNavigate) {
778
+ Promise.resolve(null).then(() => this.updateFocus());
779
+ this.isMonthNavigate = false;
780
+ }
781
+ else {
782
+ if (!this.focus && !this.inline) {
783
+ this.initFocusableCell();
784
+ }
785
+ }
786
+ }
787
+ }
788
+ _componentStyle = inject(DatePickerStyle);
789
+ contentViewChild;
790
+ value;
791
+ dates;
792
+ months;
793
+ weekDays;
794
+ currentMonth;
795
+ currentYear;
796
+ currentHour;
797
+ currentMinute;
798
+ currentSecond;
799
+ p;
800
+ pm;
801
+ mask;
802
+ maskClickListener;
803
+ overlay;
804
+ responsiveStyleElement;
805
+ overlayVisible;
806
+ $appendTo = computed(() => this.appendTo() || this.config.overlayAppendTo(), ...(ngDevMode ? [{ debugName: "$appendTo" }] : []));
807
+ calendarElement;
808
+ timePickerTimer;
809
+ documentClickListener;
810
+ animationEndListener;
811
+ ticksTo1970;
812
+ yearOptions;
813
+ focus;
814
+ isKeydown;
815
+ _minDate;
816
+ _maxDate;
817
+ _dateFormat;
818
+ _hourFormat = '24';
819
+ _showTime;
820
+ _yearRange;
821
+ preventDocumentListener;
822
+ dayClass(date) {
823
+ return this._componentStyle.classes.day({ instance: this, date: date });
824
+ }
825
+ /**
826
+ * Custom template for date cells.
827
+ * @group Templates
828
+ */
829
+ dateTemplate;
830
+ /**
831
+ * Custom template for header section.
832
+ * @group Templates
833
+ */
834
+ headerTemplate;
835
+ /**
836
+ * Custom template for footer section.
837
+ * @group Templates
838
+ */
839
+ footerTemplate;
840
+ /**
841
+ * Custom template for disabled date cells.
842
+ * @group Templates
843
+ */
844
+ disabledDateTemplate;
845
+ /**
846
+ * Custom template for decade view.
847
+ * @group Templates
848
+ */
849
+ decadeTemplate;
850
+ /**
851
+ * Custom template for previous month icon.
852
+ * @group Templates
853
+ */
854
+ previousIconTemplate;
855
+ /**
856
+ * Custom template for next month icon.
857
+ * @group Templates
858
+ */
859
+ nextIconTemplate;
860
+ /**
861
+ * Custom template for trigger icon.
862
+ * @group Templates
863
+ */
864
+ triggerIconTemplate;
865
+ /**
866
+ * Custom template for clear icon.
867
+ * @group Templates
868
+ */
869
+ clearIconTemplate;
870
+ /**
871
+ * Custom template for decrement icon.
872
+ * @group Templates
873
+ */
874
+ decrementIconTemplate;
875
+ /**
876
+ * Custom template for increment icon.
877
+ * @group Templates
878
+ */
879
+ incrementIconTemplate;
880
+ /**
881
+ * Custom template for input icon.
882
+ * @group Templates
883
+ */
884
+ inputIconTemplate;
885
+ _dateTemplate;
886
+ _headerTemplate;
887
+ _footerTemplate;
888
+ _disabledDateTemplate;
889
+ _decadeTemplate;
890
+ _previousIconTemplate;
891
+ _nextIconTemplate;
892
+ _triggerIconTemplate;
893
+ _clearIconTemplate;
894
+ _decrementIconTemplate;
895
+ _incrementIconTemplate;
896
+ _inputIconTemplate;
897
+ _disabledDates;
898
+ _disabledDays;
899
+ selectElement;
900
+ todayElement;
901
+ focusElement;
902
+ scrollHandler;
903
+ documentResizeListener;
904
+ navigationState = null;
905
+ isMonthNavigate;
906
+ initialized;
907
+ translationSubscription;
908
+ _locale;
909
+ _responsiveOptions;
910
+ currentView;
911
+ attributeSelector;
912
+ panelId;
913
+ _numberOfMonths = 1;
914
+ _firstDayOfWeek;
915
+ _view = 'date';
916
+ preventFocus;
917
+ _defaultDate;
918
+ _focusKey = null;
919
+ window;
920
+ get locale() {
921
+ return this._locale;
922
+ }
923
+ get iconButtonAriaLabel() {
924
+ return this.iconAriaLabel ? this.iconAriaLabel : this.getTranslation('chooseDate');
925
+ }
926
+ get prevIconAriaLabel() {
927
+ return this.currentView === 'year' ? this.getTranslation('prevDecade') : this.currentView === 'month' ? this.getTranslation('prevYear') : this.getTranslation('prevMonth');
928
+ }
929
+ get nextIconAriaLabel() {
930
+ return this.currentView === 'year' ? this.getTranslation('nextDecade') : this.currentView === 'month' ? this.getTranslation('nextYear') : this.getTranslation('nextMonth');
931
+ }
932
+ constructor(zone, overlayService) {
933
+ super();
934
+ this.zone = zone;
935
+ this.overlayService = overlayService;
936
+ this.window = this.document.defaultView;
937
+ }
938
+ ngOnInit() {
939
+ super.ngOnInit();
940
+ this.attributeSelector = uuid('pn_id_');
941
+ this.panelId = this.attributeSelector + '_panel';
942
+ const date = this.defaultDate || new Date();
943
+ this.createResponsiveStyle();
944
+ this.currentMonth = date.getMonth();
945
+ this.currentYear = date.getFullYear();
946
+ this.yearOptions = [];
947
+ this.currentView = this.view;
948
+ if (this.view === 'date') {
949
+ this.createWeekDays();
950
+ this.initTime(date);
951
+ this.createMonths(this.currentMonth, this.currentYear);
952
+ this.ticksTo1970 = ((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000;
953
+ }
954
+ this.translationSubscription = this.config.translationObserver.subscribe(() => {
955
+ this.createWeekDays();
956
+ this.cd.markForCheck();
957
+ });
958
+ this.initialized = true;
959
+ }
960
+ ngAfterViewInit() {
961
+ super.ngAfterViewInit();
962
+ if (this.inline) {
963
+ this.contentViewChild && this.contentViewChild.nativeElement.setAttribute(this.attributeSelector, '');
964
+ if (!this.$disabled() && !this.inline) {
965
+ this.initFocusableCell();
966
+ if (this.numberOfMonths === 1) {
967
+ if (this.contentViewChild && this.contentViewChild.nativeElement) {
968
+ this.contentViewChild.nativeElement.style.width = getOuterWidth(this.el?.nativeElement) + 'px';
969
+ }
970
+ }
971
+ }
972
+ }
973
+ }
974
+ templates;
975
+ ngAfterContentInit() {
976
+ this.templates.forEach((item) => {
977
+ switch (item.getType()) {
978
+ case 'date':
979
+ this._dateTemplate = item.template;
980
+ break;
981
+ case 'decade':
982
+ this._decadeTemplate = item.template;
983
+ break;
984
+ case 'disabledDate':
985
+ this._disabledDateTemplate = item.template;
986
+ break;
987
+ case 'header':
988
+ this._headerTemplate = item.template;
989
+ break;
990
+ case 'inputicon':
991
+ this._inputIconTemplate = item.template;
992
+ break;
993
+ case 'previousicon':
994
+ this._previousIconTemplate = item.template;
995
+ break;
996
+ case 'nexticon':
997
+ this._nextIconTemplate = item.template;
998
+ break;
999
+ case 'triggericon':
1000
+ this._triggerIconTemplate = item.template;
1001
+ break;
1002
+ case 'clearicon':
1003
+ this._clearIconTemplate = item.template;
1004
+ break;
1005
+ case 'decrementicon':
1006
+ this._decrementIconTemplate = item.template;
1007
+ break;
1008
+ case 'incrementicon':
1009
+ this._incrementIconTemplate = item.template;
1010
+ break;
1011
+ case 'footer':
1012
+ this._footerTemplate = item.template;
1013
+ break;
1014
+ default:
1015
+ this._dateTemplate = item.template;
1016
+ break;
1017
+ }
1018
+ });
1019
+ }
1020
+ getTranslation(option) {
1021
+ return this.config.getTranslation(option);
1022
+ }
1023
+ populateYearOptions(start, end) {
1024
+ this.yearOptions = [];
1025
+ for (let i = start; i <= end; i++) {
1026
+ this.yearOptions.push(i);
1027
+ }
1028
+ }
1029
+ createWeekDays() {
1030
+ this.weekDays = [];
1031
+ let dayIndex = this.getFirstDateOfWeek();
1032
+ let dayLabels = this.getTranslation(TranslationKeys.DAY_NAMES_MIN);
1033
+ for (let i = 0; i < 7; i++) {
1034
+ this.weekDays.push(dayLabels[dayIndex]);
1035
+ dayIndex = dayIndex == 6 ? 0 : ++dayIndex;
1036
+ }
1037
+ }
1038
+ monthPickerValues() {
1039
+ let monthPickerValues = [];
1040
+ for (let i = 0; i <= 11; i++) {
1041
+ monthPickerValues.push(this.config.getTranslation('monthNamesShort')[i]);
1042
+ }
1043
+ return monthPickerValues;
1044
+ }
1045
+ yearPickerValues() {
1046
+ let yearPickerValues = [];
1047
+ let base = this.currentYear - (this.currentYear % 10);
1048
+ for (let i = 0; i < 10; i++) {
1049
+ yearPickerValues.push(base + i);
1050
+ }
1051
+ return yearPickerValues;
1052
+ }
1053
+ createMonths(month, year) {
1054
+ this.months = this.months = [];
1055
+ for (let i = 0; i < this.numberOfMonths; i++) {
1056
+ let m = month + i;
1057
+ let y = year;
1058
+ if (m > 11) {
1059
+ m = m % 12;
1060
+ y = year + Math.floor((month + i) / 12);
1061
+ }
1062
+ this.months.push(this.createMonth(m, y));
1063
+ }
1064
+ }
1065
+ getWeekNumber(date) {
1066
+ let checkDate = new Date(date.getTime());
1067
+ if (this.startWeekFromFirstDayOfYear) {
1068
+ let firstDayOfWeek = +this.getFirstDateOfWeek();
1069
+ checkDate.setDate(checkDate.getDate() + 6 + firstDayOfWeek - checkDate.getDay());
1070
+ }
1071
+ else {
1072
+ checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
1073
+ }
1074
+ let time = checkDate.getTime();
1075
+ checkDate.setMonth(0);
1076
+ checkDate.setDate(1);
1077
+ return Math.floor(Math.round((time - checkDate.getTime()) / 86400000) / 7) + 1;
1078
+ }
1079
+ createMonth(month, year) {
1080
+ let dates = [];
1081
+ let firstDay = this.getFirstDayOfMonthIndex(month, year);
1082
+ let daysLength = this.getDaysCountInMonth(month, year);
1083
+ let prevMonthDaysLength = this.getDaysCountInPrevMonth(month, year);
1084
+ let dayNo = 1;
1085
+ let today = new Date();
1086
+ let weekNumbers = [];
1087
+ let monthRows = Math.ceil((daysLength + firstDay) / 7);
1088
+ for (let i = 0; i < monthRows; i++) {
1089
+ let week = [];
1090
+ if (i == 0) {
1091
+ for (let j = prevMonthDaysLength - firstDay + 1; j <= prevMonthDaysLength; j++) {
1092
+ let prev = this.getPreviousMonthAndYear(month, year);
1093
+ week.push({
1094
+ day: j,
1095
+ month: prev.month,
1096
+ year: prev.year,
1097
+ otherMonth: true,
1098
+ today: this.isToday(today, j, prev.month, prev.year),
1099
+ selectable: this.isSelectable(j, prev.month, prev.year, true)
1100
+ });
1101
+ }
1102
+ let remainingDaysLength = 7 - week.length;
1103
+ for (let j = 0; j < remainingDaysLength; j++) {
1104
+ week.push({
1105
+ day: dayNo,
1106
+ month: month,
1107
+ year: year,
1108
+ today: this.isToday(today, dayNo, month, year),
1109
+ selectable: this.isSelectable(dayNo, month, year, false)
1110
+ });
1111
+ dayNo++;
1112
+ }
1113
+ }
1114
+ else {
1115
+ for (let j = 0; j < 7; j++) {
1116
+ if (dayNo > daysLength) {
1117
+ let next = this.getNextMonthAndYear(month, year);
1118
+ week.push({
1119
+ day: dayNo - daysLength,
1120
+ month: next.month,
1121
+ year: next.year,
1122
+ otherMonth: true,
1123
+ today: this.isToday(today, dayNo - daysLength, next.month, next.year),
1124
+ selectable: this.isSelectable(dayNo - daysLength, next.month, next.year, true)
1125
+ });
1126
+ }
1127
+ else {
1128
+ week.push({
1129
+ day: dayNo,
1130
+ month: month,
1131
+ year: year,
1132
+ today: this.isToday(today, dayNo, month, year),
1133
+ selectable: this.isSelectable(dayNo, month, year, false)
1134
+ });
1135
+ }
1136
+ dayNo++;
1137
+ }
1138
+ }
1139
+ if (this.showWeek) {
1140
+ weekNumbers.push(this.getWeekNumber(new Date(week[0].year, week[0].month, week[0].day)));
1141
+ }
1142
+ dates.push(week);
1143
+ }
1144
+ return {
1145
+ month: month,
1146
+ year: year,
1147
+ dates: dates,
1148
+ weekNumbers: weekNumbers
1149
+ };
1150
+ }
1151
+ initTime(date) {
1152
+ this.pm = date.getHours() > 11;
1153
+ if (this.showTime) {
1154
+ this.currentMinute = date.getMinutes();
1155
+ this.currentSecond = date.getSeconds();
1156
+ this.setCurrentHourPM(date.getHours());
1157
+ }
1158
+ else if (this.timeOnly) {
1159
+ this.currentMinute = 0;
1160
+ this.currentHour = 0;
1161
+ this.currentSecond = 0;
1162
+ }
1163
+ }
1164
+ navBackward(event) {
1165
+ if (this.$disabled()) {
1166
+ event.preventDefault();
1167
+ return;
1168
+ }
1169
+ this.isMonthNavigate = true;
1170
+ if (this.currentView === 'month') {
1171
+ this.decrementYear();
1172
+ setTimeout(() => {
1173
+ this.updateFocus();
1174
+ }, 1);
1175
+ }
1176
+ else if (this.currentView === 'year') {
1177
+ this.decrementDecade();
1178
+ setTimeout(() => {
1179
+ this.updateFocus();
1180
+ }, 1);
1181
+ }
1182
+ else {
1183
+ if (this.currentMonth === 0) {
1184
+ this.currentMonth = 11;
1185
+ this.decrementYear();
1186
+ }
1187
+ else {
1188
+ this.currentMonth--;
1189
+ }
1190
+ this.onMonthChange.emit({ month: this.currentMonth + 1, year: this.currentYear });
1191
+ this.createMonths(this.currentMonth, this.currentYear);
1192
+ }
1193
+ }
1194
+ navForward(event) {
1195
+ if (this.$disabled()) {
1196
+ event.preventDefault();
1197
+ return;
1198
+ }
1199
+ this.isMonthNavigate = true;
1200
+ if (this.currentView === 'month') {
1201
+ this.incrementYear();
1202
+ setTimeout(() => {
1203
+ this.updateFocus();
1204
+ }, 1);
1205
+ }
1206
+ else if (this.currentView === 'year') {
1207
+ this.incrementDecade();
1208
+ setTimeout(() => {
1209
+ this.updateFocus();
1210
+ }, 1);
1211
+ }
1212
+ else {
1213
+ if (this.currentMonth === 11) {
1214
+ this.currentMonth = 0;
1215
+ this.incrementYear();
1216
+ }
1217
+ else {
1218
+ this.currentMonth++;
1219
+ }
1220
+ this.onMonthChange.emit({ month: this.currentMonth + 1, year: this.currentYear });
1221
+ this.createMonths(this.currentMonth, this.currentYear);
1222
+ }
1223
+ }
1224
+ decrementYear() {
1225
+ this.currentYear--;
1226
+ let _yearOptions = this.yearOptions;
1227
+ if (this.currentYear < _yearOptions[0]) {
1228
+ let difference = _yearOptions[_yearOptions.length - 1] - _yearOptions[0];
1229
+ this.populateYearOptions(_yearOptions[0] - difference, _yearOptions[_yearOptions.length - 1] - difference);
1230
+ }
1231
+ }
1232
+ decrementDecade() {
1233
+ this.currentYear = this.currentYear - 10;
1234
+ }
1235
+ incrementDecade() {
1236
+ this.currentYear = this.currentYear + 10;
1237
+ }
1238
+ incrementYear() {
1239
+ this.currentYear++;
1240
+ let _yearOptions = this.yearOptions;
1241
+ if (this.currentYear > _yearOptions[_yearOptions.length - 1]) {
1242
+ let difference = _yearOptions[_yearOptions.length - 1] - _yearOptions[0];
1243
+ this.populateYearOptions(_yearOptions[0] + difference, _yearOptions[_yearOptions.length - 1] + difference);
1244
+ }
1245
+ }
1246
+ switchToMonthView(event) {
1247
+ this.setCurrentView('month');
1248
+ event.preventDefault();
1249
+ }
1250
+ switchToYearView(event) {
1251
+ this.setCurrentView('year');
1252
+ event.preventDefault();
1253
+ }
1254
+ onDateSelect(event, dateMeta) {
1255
+ if (this.$disabled() || !dateMeta.selectable) {
1256
+ event.preventDefault();
1257
+ return;
1258
+ }
1259
+ if (this.isMultipleSelection() && this.isSelected(dateMeta)) {
1260
+ this.value = this.value.filter((date, i) => {
1261
+ return !this.isDateEquals(date, dateMeta);
1262
+ });
1263
+ if (this.value.length === 0) {
1264
+ this.value = null;
1265
+ }
1266
+ this.updateModel(this.value);
1267
+ }
1268
+ else {
1269
+ if (this.shouldSelectDate(dateMeta)) {
1270
+ this.selectDate(dateMeta);
1271
+ }
1272
+ }
1273
+ if (this.hideOnDateTimeSelect && (this.isSingleSelection() || (this.isRangeSelection() && this.value[1]))) {
1274
+ setTimeout(() => {
1275
+ event.preventDefault();
1276
+ this.hideOverlay();
1277
+ if (this.mask) {
1278
+ this.disableModality();
1279
+ }
1280
+ this.cd.markForCheck();
1281
+ }, 150);
1282
+ }
1283
+ this.updateInputfield();
1284
+ event.preventDefault();
1285
+ }
1286
+ shouldSelectDate(dateMeta) {
1287
+ if (this.isMultipleSelection())
1288
+ return this.maxDateCount != null ? this.maxDateCount > (this.value ? this.value.length : 0) : true;
1289
+ else
1290
+ return true;
1291
+ }
1292
+ onMonthSelect(event, index) {
1293
+ if (this.view === 'month') {
1294
+ this.onDateSelect(event, { year: this.currentYear, month: index, day: 1, selectable: true });
1295
+ }
1296
+ else {
1297
+ this.currentMonth = index;
1298
+ this.createMonths(this.currentMonth, this.currentYear);
1299
+ this.setCurrentView('date');
1300
+ this.onMonthChange.emit({ month: this.currentMonth + 1, year: this.currentYear });
1301
+ }
1302
+ }
1303
+ onYearSelect(event, year) {
1304
+ if (this.view === 'year') {
1305
+ this.onDateSelect(event, { year: year, month: 0, day: 1, selectable: true });
1306
+ }
1307
+ else {
1308
+ this.currentYear = year;
1309
+ this.setCurrentView('month');
1310
+ this.onYearChange.emit({ month: this.currentMonth + 1, year: this.currentYear });
1311
+ }
1312
+ }
1313
+ updateInputfield() {
1314
+ let formattedValue = '';
1315
+ if (this.value) {
1316
+ if (this.isSingleSelection()) {
1317
+ formattedValue = this.formatDateTime(this.value);
1318
+ }
1319
+ else if (this.isMultipleSelection()) {
1320
+ for (let i = 0; i < this.value.length; i++) {
1321
+ let dateAsString = this.formatDateTime(this.value[i]);
1322
+ formattedValue += dateAsString;
1323
+ if (i !== this.value.length - 1) {
1324
+ formattedValue += this.multipleSeparator + ' ';
1325
+ }
1326
+ }
1327
+ }
1328
+ else if (this.isRangeSelection()) {
1329
+ if (this.value && this.value.length) {
1330
+ let startDate = this.value[0];
1331
+ let endDate = this.value[1];
1332
+ formattedValue = this.formatDateTime(startDate);
1333
+ if (endDate) {
1334
+ formattedValue += ' ' + this.rangeSeparator + ' ' + this.formatDateTime(endDate);
1335
+ }
1336
+ }
1337
+ }
1338
+ }
1339
+ this.writeModelValue(formattedValue);
1340
+ this.inputFieldValue = formattedValue;
1341
+ if (this.inputfieldViewChild && this.inputfieldViewChild.nativeElement) {
1342
+ this.inputfieldViewChild.nativeElement.value = this.inputFieldValue;
1343
+ }
1344
+ }
1345
+ inputFieldValue = null;
1346
+ formatDateTime(date) {
1347
+ let formattedValue = this.keepInvalid ? date : null;
1348
+ const isDateValid = this.isValidDateForTimeConstraints(date);
1349
+ if (this.isValidDate(date)) {
1350
+ if (this.timeOnly) {
1351
+ formattedValue = this.formatTime(date);
1352
+ }
1353
+ else {
1354
+ formattedValue = this.formatDate(date, this.getDateFormat());
1355
+ if (this.showTime) {
1356
+ formattedValue += ' ' + this.formatTime(date);
1357
+ }
1358
+ }
1359
+ }
1360
+ else if (this.dataType === 'string') {
1361
+ formattedValue = date;
1362
+ }
1363
+ formattedValue = isDateValid ? formattedValue : '';
1364
+ return formattedValue;
1365
+ }
1366
+ formatDateMetaToDate(dateMeta) {
1367
+ return new Date(dateMeta.year, dateMeta.month, dateMeta.day);
1368
+ }
1369
+ formatDateKey(date) {
1370
+ return `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;
1371
+ }
1372
+ setCurrentHourPM(hours) {
1373
+ if (this.hourFormat == '12') {
1374
+ this.pm = hours > 11;
1375
+ if (hours >= 12) {
1376
+ this.currentHour = hours == 12 ? 12 : hours - 12;
1377
+ }
1378
+ else {
1379
+ this.currentHour = hours == 0 ? 12 : hours;
1380
+ }
1381
+ }
1382
+ else {
1383
+ this.currentHour = hours;
1384
+ }
1385
+ }
1386
+ setCurrentView(currentView) {
1387
+ this.currentView = currentView;
1388
+ this.cd.detectChanges();
1389
+ this.alignOverlay();
1390
+ }
1391
+ selectDate(dateMeta) {
1392
+ let date = this.formatDateMetaToDate(dateMeta);
1393
+ if (this.showTime) {
1394
+ if (this.hourFormat == '12') {
1395
+ if (this.currentHour === 12)
1396
+ date.setHours(this.pm ? 12 : 0);
1397
+ else
1398
+ date.setHours(this.pm ? this.currentHour + 12 : this.currentHour);
1399
+ }
1400
+ else {
1401
+ date.setHours(this.currentHour);
1402
+ }
1403
+ date.setMinutes(this.currentMinute);
1404
+ date.setSeconds(this.currentSecond);
1405
+ }
1406
+ if (this.minDate && this.minDate > date) {
1407
+ date = this.minDate;
1408
+ this.setCurrentHourPM(date.getHours());
1409
+ this.currentMinute = date.getMinutes();
1410
+ this.currentSecond = date.getSeconds();
1411
+ }
1412
+ if (this.maxDate && this.maxDate < date) {
1413
+ date = this.maxDate;
1414
+ this.setCurrentHourPM(date.getHours());
1415
+ this.currentMinute = date.getMinutes();
1416
+ this.currentSecond = date.getSeconds();
1417
+ }
1418
+ if (this.isSingleSelection()) {
1419
+ this.updateModel(date);
1420
+ }
1421
+ else if (this.isMultipleSelection()) {
1422
+ this.updateModel(this.value ? [...this.value, date] : [date]);
1423
+ }
1424
+ else if (this.isRangeSelection()) {
1425
+ if (this.value && this.value.length) {
1426
+ let startDate = this.value[0];
1427
+ let endDate = this.value[1];
1428
+ if (!endDate && date.getTime() >= startDate.getTime()) {
1429
+ endDate = date;
1430
+ }
1431
+ else {
1432
+ startDate = date;
1433
+ endDate = null;
1434
+ }
1435
+ this.updateModel([startDate, endDate]);
1436
+ }
1437
+ else {
1438
+ this.updateModel([date, null]);
1439
+ }
1440
+ }
1441
+ this.onSelect.emit(date);
1442
+ }
1443
+ updateModel(value) {
1444
+ this.value = value;
1445
+ if (this.dataType == 'date') {
1446
+ this.writeModelValue(this.value);
1447
+ this.onModelChange(this.value);
1448
+ }
1449
+ else if (this.dataType == 'string') {
1450
+ if (this.isSingleSelection()) {
1451
+ this.onModelChange(this.formatDateTime(this.value));
1452
+ }
1453
+ else {
1454
+ let stringArrValue = null;
1455
+ if (Array.isArray(this.value)) {
1456
+ stringArrValue = this.value.map((date) => this.formatDateTime(date));
1457
+ }
1458
+ this.writeModelValue(stringArrValue);
1459
+ this.onModelChange(stringArrValue);
1460
+ }
1461
+ }
1462
+ }
1463
+ getFirstDayOfMonthIndex(month, year) {
1464
+ let day = new Date();
1465
+ day.setDate(1);
1466
+ day.setMonth(month);
1467
+ day.setFullYear(year);
1468
+ let dayIndex = day.getDay() + this.getSundayIndex();
1469
+ return dayIndex >= 7 ? dayIndex - 7 : dayIndex;
1470
+ }
1471
+ getDaysCountInMonth(month, year) {
1472
+ return 32 - this.daylightSavingAdjust(new Date(year, month, 32)).getDate();
1473
+ }
1474
+ getDaysCountInPrevMonth(month, year) {
1475
+ let prev = this.getPreviousMonthAndYear(month, year);
1476
+ return this.getDaysCountInMonth(prev.month, prev.year);
1477
+ }
1478
+ getPreviousMonthAndYear(month, year) {
1479
+ let m, y;
1480
+ if (month === 0) {
1481
+ m = 11;
1482
+ y = year - 1;
1483
+ }
1484
+ else {
1485
+ m = month - 1;
1486
+ y = year;
1487
+ }
1488
+ return { month: m, year: y };
1489
+ }
1490
+ getNextMonthAndYear(month, year) {
1491
+ let m, y;
1492
+ if (month === 11) {
1493
+ m = 0;
1494
+ y = year + 1;
1495
+ }
1496
+ else {
1497
+ m = month + 1;
1498
+ y = year;
1499
+ }
1500
+ return { month: m, year: y };
1501
+ }
1502
+ getSundayIndex() {
1503
+ let firstDayOfWeek = this.getFirstDateOfWeek();
1504
+ return firstDayOfWeek > 0 ? 7 - firstDayOfWeek : 0;
1505
+ }
1506
+ isSelected(dateMeta) {
1507
+ if (this.value) {
1508
+ if (this.isSingleSelection()) {
1509
+ return this.isDateEquals(this.value, dateMeta);
1510
+ }
1511
+ else if (this.isMultipleSelection()) {
1512
+ let selected = false;
1513
+ for (let date of this.value) {
1514
+ selected = this.isDateEquals(date, dateMeta);
1515
+ if (selected) {
1516
+ break;
1517
+ }
1518
+ }
1519
+ return selected;
1520
+ }
1521
+ else if (this.isRangeSelection()) {
1522
+ if (this.value[1])
1523
+ return this.isDateEquals(this.value[0], dateMeta) || this.isDateEquals(this.value[1], dateMeta) || this.isDateBetween(this.value[0], this.value[1], dateMeta);
1524
+ else
1525
+ return this.isDateEquals(this.value[0], dateMeta);
1526
+ }
1527
+ }
1528
+ else {
1529
+ return false;
1530
+ }
1531
+ }
1532
+ isComparable() {
1533
+ return this.value != null && typeof this.value !== 'string';
1534
+ }
1535
+ isMonthSelected(month) {
1536
+ if (!this.isComparable())
1537
+ return false;
1538
+ if (this.isMultipleSelection()) {
1539
+ return this.value.some((currentValue) => currentValue.getMonth() === month && currentValue.getFullYear() === this.currentYear);
1540
+ }
1541
+ else if (this.isRangeSelection()) {
1542
+ if (!this.value[1]) {
1543
+ return this.value[0]?.getFullYear() === this.currentYear && this.value[0]?.getMonth() === month;
1544
+ }
1545
+ else {
1546
+ const currentDate = new Date(this.currentYear, month, 1);
1547
+ const startDate = new Date(this.value[0].getFullYear(), this.value[0].getMonth(), 1);
1548
+ const endDate = new Date(this.value[1].getFullYear(), this.value[1].getMonth(), 1);
1549
+ return currentDate >= startDate && currentDate <= endDate;
1550
+ }
1551
+ }
1552
+ else {
1553
+ return this.value.getMonth() === month && this.value.getFullYear() === this.currentYear;
1554
+ }
1555
+ }
1556
+ isMonthDisabled(month, year) {
1557
+ const yearToCheck = year ?? this.currentYear;
1558
+ for (let day = 1; day < this.getDaysCountInMonth(month, yearToCheck) + 1; day++) {
1559
+ if (this.isSelectable(day, month, yearToCheck, false)) {
1560
+ return false;
1561
+ }
1562
+ }
1563
+ return true;
1564
+ }
1565
+ isYearDisabled(year) {
1566
+ return Array(12)
1567
+ .fill(0)
1568
+ .every((v, month) => this.isMonthDisabled(month, year));
1569
+ }
1570
+ isYearSelected(year) {
1571
+ if (this.isComparable()) {
1572
+ let value = this.isRangeSelection() ? this.value[0] : this.value;
1573
+ return !this.isMultipleSelection() ? value.getFullYear() === year : false;
1574
+ }
1575
+ return false;
1576
+ }
1577
+ isDateEquals(value, dateMeta) {
1578
+ if (value && isDate(value))
1579
+ return value.getDate() === dateMeta.day && value.getMonth() === dateMeta.month && value.getFullYear() === dateMeta.year;
1580
+ else
1581
+ return false;
1582
+ }
1583
+ isDateBetween(start, end, dateMeta) {
1584
+ let between = false;
1585
+ if (isDate(start) && isDate(end)) {
1586
+ let date = this.formatDateMetaToDate(dateMeta);
1587
+ return start.getTime() <= date.getTime() && end.getTime() >= date.getTime();
1588
+ }
1589
+ return between;
1590
+ }
1591
+ isSingleSelection() {
1592
+ return this.selectionMode === 'single';
1593
+ }
1594
+ isRangeSelection() {
1595
+ return this.selectionMode === 'range';
1596
+ }
1597
+ isMultipleSelection() {
1598
+ return this.selectionMode === 'multiple';
1599
+ }
1600
+ isToday(today, day, month, year) {
1601
+ return today.getDate() === day && today.getMonth() === month && today.getFullYear() === year;
1602
+ }
1603
+ isSelectable(day, month, year, otherMonth) {
1604
+ let validMin = true;
1605
+ let validMax = true;
1606
+ let validDate = true;
1607
+ let validDay = true;
1608
+ if (otherMonth && !this.selectOtherMonths) {
1609
+ return false;
1610
+ }
1611
+ if (this.minDate) {
1612
+ if (this.minDate.getFullYear() > year) {
1613
+ validMin = false;
1614
+ }
1615
+ else if (this.minDate.getFullYear() === year && this.currentView != 'year') {
1616
+ if (this.minDate.getMonth() > month) {
1617
+ validMin = false;
1618
+ }
1619
+ else if (this.minDate.getMonth() === month) {
1620
+ if (this.minDate.getDate() > day) {
1621
+ validMin = false;
1622
+ }
1623
+ }
1624
+ }
1625
+ }
1626
+ if (this.maxDate) {
1627
+ if (this.maxDate.getFullYear() < year) {
1628
+ validMax = false;
1629
+ }
1630
+ else if (this.maxDate.getFullYear() === year) {
1631
+ if (this.maxDate.getMonth() < month) {
1632
+ validMax = false;
1633
+ }
1634
+ else if (this.maxDate.getMonth() === month) {
1635
+ if (this.maxDate.getDate() < day) {
1636
+ validMax = false;
1637
+ }
1638
+ }
1639
+ }
1640
+ }
1641
+ if (this.disabledDates) {
1642
+ validDate = !this.isDateDisabled(day, month, year);
1643
+ }
1644
+ if (this.disabledDays) {
1645
+ validDay = !this.isDayDisabled(day, month, year);
1646
+ }
1647
+ return validMin && validMax && validDate && validDay;
1648
+ }
1649
+ isDateDisabled(day, month, year) {
1650
+ if (this.disabledDates) {
1651
+ for (let disabledDate of this.disabledDates) {
1652
+ if (disabledDate.getFullYear() === year && disabledDate.getMonth() === month && disabledDate.getDate() === day) {
1653
+ return true;
1654
+ }
1655
+ }
1656
+ }
1657
+ return false;
1658
+ }
1659
+ isDayDisabled(day, month, year) {
1660
+ if (this.disabledDays) {
1661
+ let weekday = new Date(year, month, day);
1662
+ let weekdayNumber = weekday.getDay();
1663
+ return this.disabledDays.indexOf(weekdayNumber) !== -1;
1664
+ }
1665
+ return false;
1666
+ }
1667
+ onInputFocus(event) {
1668
+ this.focus = true;
1669
+ if (this.showOnFocus) {
1670
+ this.showOverlay();
1671
+ }
1672
+ this.onFocus.emit(event);
1673
+ }
1674
+ onInputClick() {
1675
+ if (this.showOnFocus && !this.overlayVisible) {
1676
+ this.showOverlay();
1677
+ }
1678
+ }
1679
+ onInputBlur(event) {
1680
+ this.focus = false;
1681
+ this.onBlur.emit(event);
1682
+ if (!this.keepInvalid) {
1683
+ this.updateInputfield();
1684
+ }
1685
+ this.onModelTouched();
1686
+ }
1687
+ onButtonClick(event, inputfield = this.inputfieldViewChild?.nativeElement) {
1688
+ if (this.$disabled()) {
1689
+ return;
1690
+ }
1691
+ if (!this.overlayVisible) {
1692
+ inputfield.focus();
1693
+ this.showOverlay();
1694
+ }
1695
+ else {
1696
+ this.hideOverlay();
1697
+ }
1698
+ }
1699
+ clear() {
1700
+ this.value = null;
1701
+ this.inputFieldValue = null;
1702
+ this.writeModelValue(this.value);
1703
+ this.onModelChange(this.value);
1704
+ this.updateInputfield();
1705
+ this.onClear.emit();
1706
+ }
1707
+ onOverlayClick(event) {
1708
+ this.overlayService.add({
1709
+ originalEvent: event,
1710
+ target: this.el.nativeElement
1711
+ });
1712
+ }
1713
+ getMonthName(index) {
1714
+ return this.config.getTranslation('monthNames')[index];
1715
+ }
1716
+ getYear(month) {
1717
+ return this.currentView === 'month' ? this.currentYear : month.year;
1718
+ }
1719
+ switchViewButtonDisabled() {
1720
+ return this.numberOfMonths > 1 || this.$disabled();
1721
+ }
1722
+ onPrevButtonClick(event) {
1723
+ this.navigationState = { backward: true, button: true };
1724
+ this.navBackward(event);
1725
+ }
1726
+ onNextButtonClick(event) {
1727
+ this.navigationState = { backward: false, button: true };
1728
+ this.navForward(event);
1729
+ }
1730
+ onContainerButtonKeydown(event) {
1731
+ switch (event.which) {
1732
+ //tab
1733
+ case 9:
1734
+ if (!this.inline) {
1735
+ this.trapFocus(event);
1736
+ }
1737
+ if (this.inline) {
1738
+ const headerElements = findSingle(this.el?.nativeElement, '.p-datepicker-header');
1739
+ const element = event.target;
1740
+ if (this.timeOnly) {
1741
+ return;
1742
+ }
1743
+ else {
1744
+ if (element == headerElements.children[headerElements?.children?.length - 1]) {
1745
+ this.initFocusableCell();
1746
+ }
1747
+ }
1748
+ }
1749
+ break;
1750
+ //escape
1751
+ case 27:
1752
+ this.inputfieldViewChild?.nativeElement.focus();
1753
+ this.overlayVisible = false;
1754
+ event.preventDefault();
1755
+ break;
1756
+ default:
1757
+ //Noop
1758
+ break;
1759
+ }
1760
+ }
1761
+ onInputKeydown(event) {
1762
+ this.isKeydown = true;
1763
+ if (event.keyCode === 40 && this.contentViewChild) {
1764
+ this.trapFocus(event);
1765
+ }
1766
+ else if (event.keyCode === 27) {
1767
+ if (this.overlayVisible) {
1768
+ this.inputfieldViewChild?.nativeElement.focus();
1769
+ this.overlayVisible = false;
1770
+ event.preventDefault();
1771
+ }
1772
+ }
1773
+ else if (event.keyCode === 13) {
1774
+ if (this.overlayVisible) {
1775
+ this.overlayVisible = false;
1776
+ event.preventDefault();
1777
+ }
1778
+ }
1779
+ else if (event.keyCode === 9 && this.contentViewChild) {
1780
+ getFocusableElements(this.contentViewChild.nativeElement).forEach((el) => (el.tabIndex = '-1'));
1781
+ if (this.overlayVisible) {
1782
+ this.overlayVisible = false;
1783
+ }
1784
+ }
1785
+ }
1786
+ onDateCellKeydown(event, dateMeta, groupIndex) {
1787
+ const cellContent = event.currentTarget;
1788
+ const cell = cellContent.parentElement;
1789
+ const currentDate = this.formatDateMetaToDate(dateMeta);
1790
+ switch (event.which) {
1791
+ //down arrow
1792
+ case 40: {
1793
+ cellContent.tabIndex = '-1';
1794
+ let cellIndex = getIndex(cell);
1795
+ let nextRow = cell.parentElement.nextElementSibling;
1796
+ if (nextRow) {
1797
+ let focusCell = nextRow.children[cellIndex].children[0];
1798
+ if (hasClass(focusCell, 'p-disabled')) {
1799
+ this.navigationState = { backward: false };
1800
+ this.navForward(event);
1801
+ }
1802
+ else {
1803
+ nextRow.children[cellIndex].children[0].tabIndex = '0';
1804
+ nextRow.children[cellIndex].children[0].focus();
1805
+ }
1806
+ }
1807
+ else {
1808
+ this.navigationState = { backward: false };
1809
+ this.navForward(event);
1810
+ }
1811
+ event.preventDefault();
1812
+ break;
1813
+ }
1814
+ //up arrow
1815
+ case 38: {
1816
+ cellContent.tabIndex = '-1';
1817
+ let cellIndex = getIndex(cell);
1818
+ let prevRow = cell.parentElement.previousElementSibling;
1819
+ if (prevRow) {
1820
+ let focusCell = prevRow.children[cellIndex].children[0];
1821
+ if (hasClass(focusCell, 'p-disabled')) {
1822
+ this.navigationState = { backward: true };
1823
+ this.navBackward(event);
1824
+ }
1825
+ else {
1826
+ focusCell.tabIndex = '0';
1827
+ focusCell.focus();
1828
+ }
1829
+ }
1830
+ else {
1831
+ this.navigationState = { backward: true };
1832
+ this.navBackward(event);
1833
+ }
1834
+ event.preventDefault();
1835
+ break;
1836
+ }
1837
+ //left arrow
1838
+ case 37: {
1839
+ cellContent.tabIndex = '-1';
1840
+ let prevCell = cell.previousElementSibling;
1841
+ if (prevCell) {
1842
+ let focusCell = prevCell.children[0];
1843
+ if (hasClass(focusCell, 'p-disabled') || hasClass(focusCell.parentElement, 'p-datepicker-weeknumber')) {
1844
+ this.navigateToMonth(true, groupIndex);
1845
+ }
1846
+ else {
1847
+ focusCell.tabIndex = '0';
1848
+ focusCell.focus();
1849
+ }
1850
+ }
1851
+ else {
1852
+ this.navigateToMonth(true, groupIndex);
1853
+ }
1854
+ event.preventDefault();
1855
+ break;
1856
+ }
1857
+ //right arrow
1858
+ case 39: {
1859
+ cellContent.tabIndex = '-1';
1860
+ let nextCell = cell.nextElementSibling;
1861
+ if (nextCell) {
1862
+ let focusCell = nextCell.children[0];
1863
+ if (hasClass(focusCell, 'p-disabled')) {
1864
+ this.navigateToMonth(false, groupIndex);
1865
+ }
1866
+ else {
1867
+ focusCell.tabIndex = '0';
1868
+ focusCell.focus();
1869
+ }
1870
+ }
1871
+ else {
1872
+ this.navigateToMonth(false, groupIndex);
1873
+ }
1874
+ event.preventDefault();
1875
+ break;
1876
+ }
1877
+ //enter
1878
+ //space
1879
+ case 13:
1880
+ case 32: {
1881
+ this.onDateSelect(event, dateMeta);
1882
+ event.preventDefault();
1883
+ break;
1884
+ }
1885
+ //escape
1886
+ case 27: {
1887
+ this.inputfieldViewChild?.nativeElement.focus();
1888
+ this.overlayVisible = false;
1889
+ event.preventDefault();
1890
+ break;
1891
+ }
1892
+ //tab
1893
+ case 9: {
1894
+ if (!this.inline) {
1895
+ this.trapFocus(event);
1896
+ }
1897
+ break;
1898
+ }
1899
+ // page up
1900
+ case 33: {
1901
+ cellContent.tabIndex = '-1';
1902
+ const dateToFocus = new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, currentDate.getDate());
1903
+ const focusKey = this.formatDateKey(dateToFocus);
1904
+ this.navigateToMonth(true, groupIndex, `span[data-date='${focusKey}']:not(.p-disabled):not(.p-ink)`);
1905
+ event.preventDefault();
1906
+ break;
1907
+ }
1908
+ // page down
1909
+ case 34: {
1910
+ cellContent.tabIndex = '-1';
1911
+ const dateToFocus = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, currentDate.getDate());
1912
+ const focusKey = this.formatDateKey(dateToFocus);
1913
+ this.navigateToMonth(false, groupIndex, `span[data-date='${focusKey}']:not(.p-disabled):not(.p-ink)`);
1914
+ event.preventDefault();
1915
+ break;
1916
+ }
1917
+ //home
1918
+ case 36:
1919
+ cellContent.tabIndex = '-1';
1920
+ const firstDayDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1);
1921
+ const firstDayDateKey = this.formatDateKey(firstDayDate);
1922
+ const firstDayCell = findSingle(cellContent.offsetParent, `span[data-date='${firstDayDateKey}']:not(.p-disabled):not(.p-ink)`);
1923
+ if (firstDayCell) {
1924
+ firstDayCell.tabIndex = '0';
1925
+ firstDayCell.focus();
1926
+ }
1927
+ event.preventDefault();
1928
+ break;
1929
+ //end
1930
+ case 35:
1931
+ cellContent.tabIndex = '-1';
1932
+ const lastDayDate = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0);
1933
+ const lastDayDateKey = this.formatDateKey(lastDayDate);
1934
+ const lastDayCell = findSingle(cellContent.offsetParent, `span[data-date='${lastDayDateKey}']:not(.p-disabled):not(.p-ink)`);
1935
+ if (lastDayDate) {
1936
+ lastDayCell.tabIndex = '0';
1937
+ lastDayCell.focus();
1938
+ }
1939
+ event.preventDefault();
1940
+ break;
1941
+ default:
1942
+ //no op
1943
+ break;
1944
+ }
1945
+ }
1946
+ onMonthCellKeydown(event, index) {
1947
+ const cell = event.currentTarget;
1948
+ switch (event.which) {
1949
+ //arrows
1950
+ case 38:
1951
+ case 40: {
1952
+ cell.tabIndex = '-1';
1953
+ var cells = cell.parentElement.children;
1954
+ var cellIndex = getIndex(cell);
1955
+ let nextCell = cells[event.which === 40 ? cellIndex + 3 : cellIndex - 3];
1956
+ if (nextCell) {
1957
+ nextCell.tabIndex = '0';
1958
+ nextCell.focus();
1959
+ }
1960
+ event.preventDefault();
1961
+ break;
1962
+ }
1963
+ //left arrow
1964
+ case 37: {
1965
+ cell.tabIndex = '-1';
1966
+ let prevCell = cell.previousElementSibling;
1967
+ if (prevCell) {
1968
+ prevCell.tabIndex = '0';
1969
+ prevCell.focus();
1970
+ }
1971
+ else {
1972
+ this.navigationState = { backward: true };
1973
+ this.navBackward(event);
1974
+ }
1975
+ event.preventDefault();
1976
+ break;
1977
+ }
1978
+ //right arrow
1979
+ case 39: {
1980
+ cell.tabIndex = '-1';
1981
+ let nextCell = cell.nextElementSibling;
1982
+ if (nextCell) {
1983
+ nextCell.tabIndex = '0';
1984
+ nextCell.focus();
1985
+ }
1986
+ else {
1987
+ this.navigationState = { backward: false };
1988
+ this.navForward(event);
1989
+ }
1990
+ event.preventDefault();
1991
+ break;
1992
+ }
1993
+ //enter
1994
+ //space
1995
+ case 13:
1996
+ case 32: {
1997
+ this.onMonthSelect(event, index);
1998
+ event.preventDefault();
1999
+ break;
2000
+ }
2001
+ //escape
2002
+ case 27: {
2003
+ this.inputfieldViewChild?.nativeElement.focus();
2004
+ this.overlayVisible = false;
2005
+ event.preventDefault();
2006
+ break;
2007
+ }
2008
+ //tab
2009
+ case 9: {
2010
+ if (!this.inline) {
2011
+ this.trapFocus(event);
2012
+ }
2013
+ break;
2014
+ }
2015
+ default:
2016
+ //no op
2017
+ break;
2018
+ }
2019
+ }
2020
+ onYearCellKeydown(event, index) {
2021
+ const cell = event.currentTarget;
2022
+ switch (event.which) {
2023
+ //arrows
2024
+ case 38:
2025
+ case 40: {
2026
+ cell.tabIndex = '-1';
2027
+ var cells = cell.parentElement.children;
2028
+ var cellIndex = getIndex(cell);
2029
+ let nextCell = cells[event.which === 40 ? cellIndex + 2 : cellIndex - 2];
2030
+ if (nextCell) {
2031
+ nextCell.tabIndex = '0';
2032
+ nextCell.focus();
2033
+ }
2034
+ event.preventDefault();
2035
+ break;
2036
+ }
2037
+ //left arrow
2038
+ case 37: {
2039
+ cell.tabIndex = '-1';
2040
+ let prevCell = cell.previousElementSibling;
2041
+ if (prevCell) {
2042
+ prevCell.tabIndex = '0';
2043
+ prevCell.focus();
2044
+ }
2045
+ else {
2046
+ this.navigationState = { backward: true };
2047
+ this.navBackward(event);
2048
+ }
2049
+ event.preventDefault();
2050
+ break;
2051
+ }
2052
+ //right arrow
2053
+ case 39: {
2054
+ cell.tabIndex = '-1';
2055
+ let nextCell = cell.nextElementSibling;
2056
+ if (nextCell) {
2057
+ nextCell.tabIndex = '0';
2058
+ nextCell.focus();
2059
+ }
2060
+ else {
2061
+ this.navigationState = { backward: false };
2062
+ this.navForward(event);
2063
+ }
2064
+ event.preventDefault();
2065
+ break;
2066
+ }
2067
+ //enter
2068
+ //space
2069
+ case 13:
2070
+ case 32: {
2071
+ this.onYearSelect(event, index);
2072
+ event.preventDefault();
2073
+ break;
2074
+ }
2075
+ //escape
2076
+ case 27: {
2077
+ this.inputfieldViewChild?.nativeElement.focus();
2078
+ this.overlayVisible = false;
2079
+ event.preventDefault();
2080
+ break;
2081
+ }
2082
+ //tab
2083
+ case 9: {
2084
+ this.trapFocus(event);
2085
+ break;
2086
+ }
2087
+ default:
2088
+ //no op
2089
+ break;
2090
+ }
2091
+ }
2092
+ navigateToMonth(prev, groupIndex, focusKey) {
2093
+ if (prev) {
2094
+ if (this.numberOfMonths === 1 || groupIndex === 0) {
2095
+ this.navigationState = { backward: true };
2096
+ this._focusKey = focusKey;
2097
+ this.navBackward(event);
2098
+ }
2099
+ else {
2100
+ let prevMonthContainer = this.contentViewChild.nativeElement.children[groupIndex - 1];
2101
+ if (focusKey) {
2102
+ const firstDayCell = findSingle(prevMonthContainer, focusKey);
2103
+ firstDayCell.tabIndex = '0';
2104
+ firstDayCell.focus();
2105
+ }
2106
+ else {
2107
+ let cells = find(prevMonthContainer, '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');
2108
+ let focusCell = cells[cells.length - 1];
2109
+ focusCell.tabIndex = '0';
2110
+ focusCell.focus();
2111
+ }
2112
+ }
2113
+ }
2114
+ else {
2115
+ if (this.numberOfMonths === 1 || groupIndex === this.numberOfMonths - 1) {
2116
+ this.navigationState = { backward: false };
2117
+ this._focusKey = focusKey;
2118
+ this.navForward(event);
2119
+ }
2120
+ else {
2121
+ let nextMonthContainer = this.contentViewChild.nativeElement.children[groupIndex + 1];
2122
+ if (focusKey) {
2123
+ const firstDayCell = findSingle(nextMonthContainer, focusKey);
2124
+ firstDayCell.tabIndex = '0';
2125
+ firstDayCell.focus();
2126
+ }
2127
+ else {
2128
+ let focusCell = findSingle(nextMonthContainer, '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');
2129
+ focusCell.tabIndex = '0';
2130
+ focusCell.focus();
2131
+ }
2132
+ }
2133
+ }
2134
+ }
2135
+ updateFocus() {
2136
+ let cell;
2137
+ if (this.navigationState) {
2138
+ if (this.navigationState.button) {
2139
+ this.initFocusableCell();
2140
+ if (this.navigationState.backward)
2141
+ findSingle(this.contentViewChild.nativeElement, '.p-datepicker-prev-button').focus();
2142
+ else
2143
+ findSingle(this.contentViewChild.nativeElement, '.p-datepicker-next-button').focus();
2144
+ }
2145
+ else {
2146
+ if (this.navigationState.backward) {
2147
+ let cells;
2148
+ if (this.currentView === 'month') {
2149
+ cells = find(this.contentViewChild.nativeElement, '.p-datepicker-month-view .p-datepicker-month:not(.p-disabled)');
2150
+ }
2151
+ else if (this.currentView === 'year') {
2152
+ cells = find(this.contentViewChild.nativeElement, '.p-datepicker-year-view .p-datepicker-year:not(.p-disabled)');
2153
+ }
2154
+ else {
2155
+ cells = find(this.contentViewChild.nativeElement, this._focusKey || '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');
2156
+ }
2157
+ if (cells && cells.length > 0) {
2158
+ cell = cells[cells.length - 1];
2159
+ }
2160
+ }
2161
+ else {
2162
+ if (this.currentView === 'month') {
2163
+ cell = findSingle(this.contentViewChild.nativeElement, '.p-datepicker-month-view .p-datepicker-month:not(.p-disabled)');
2164
+ }
2165
+ else if (this.currentView === 'year') {
2166
+ cell = findSingle(this.contentViewChild.nativeElement, '.p-datepicker-year-view .p-datepicker-year:not(.p-disabled)');
2167
+ }
2168
+ else {
2169
+ cell = findSingle(this.contentViewChild.nativeElement, this._focusKey || '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');
2170
+ }
2171
+ }
2172
+ if (cell) {
2173
+ cell.tabIndex = '0';
2174
+ cell.focus();
2175
+ }
2176
+ }
2177
+ this.navigationState = null;
2178
+ this._focusKey = null;
2179
+ }
2180
+ else {
2181
+ this.initFocusableCell();
2182
+ }
2183
+ }
2184
+ initFocusableCell() {
2185
+ const contentEl = this.contentViewChild?.nativeElement;
2186
+ let cell;
2187
+ if (this.currentView === 'month') {
2188
+ let cells = find(contentEl, '.p-datepicker-month-view .p-datepicker-month:not(.p-disabled)');
2189
+ let selectedCell = findSingle(contentEl, '.p-datepicker-month-view .p-datepicker-month.p-highlight');
2190
+ cells.forEach((cell) => (cell.tabIndex = -1));
2191
+ cell = selectedCell || cells[0];
2192
+ if (cells.length === 0) {
2193
+ let disabledCells = find(contentEl, '.p-datepicker-month-view .p-datepicker-month.p-disabled[tabindex = "0"]');
2194
+ disabledCells.forEach((cell) => (cell.tabIndex = -1));
2195
+ }
2196
+ }
2197
+ else if (this.currentView === 'year') {
2198
+ let cells = find(contentEl, '.p-datepicker-year-view .p-datepicker-year:not(.p-disabled)');
2199
+ let selectedCell = findSingle(contentEl, '.p-datepicker-year-view .p-datepicker-year.p-highlight');
2200
+ cells.forEach((cell) => (cell.tabIndex = -1));
2201
+ cell = selectedCell || cells[0];
2202
+ if (cells.length === 0) {
2203
+ let disabledCells = find(contentEl, '.p-datepicker-year-view .p-datepicker-year.p-disabled[tabindex = "0"]');
2204
+ disabledCells.forEach((cell) => (cell.tabIndex = -1));
2205
+ }
2206
+ }
2207
+ else {
2208
+ cell = findSingle(contentEl, 'span.p-highlight');
2209
+ if (!cell) {
2210
+ let todayCell = findSingle(contentEl, 'td.p-datepicker-today span:not(.p-disabled):not(.p-ink)');
2211
+ if (todayCell)
2212
+ cell = todayCell;
2213
+ else
2214
+ cell = findSingle(contentEl, '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');
2215
+ }
2216
+ }
2217
+ if (cell) {
2218
+ cell.tabIndex = '0';
2219
+ if (!this.preventFocus && (!this.navigationState || !this.navigationState.button)) {
2220
+ setTimeout(() => {
2221
+ if (!this.$disabled()) {
2222
+ cell.focus();
2223
+ }
2224
+ }, 1);
2225
+ }
2226
+ this.preventFocus = false;
2227
+ }
2228
+ }
2229
+ trapFocus(event) {
2230
+ let focusableElements = getFocusableElements(this.contentViewChild.nativeElement);
2231
+ if (focusableElements && focusableElements.length > 0) {
2232
+ if (!focusableElements[0].ownerDocument.activeElement) {
2233
+ focusableElements[0].focus();
2234
+ }
2235
+ else {
2236
+ let focusedIndex = focusableElements.indexOf(focusableElements[0].ownerDocument.activeElement);
2237
+ if (event.shiftKey) {
2238
+ if (focusedIndex == -1 || focusedIndex === 0) {
2239
+ if (this.focusTrap) {
2240
+ focusableElements[focusableElements.length - 1].focus();
2241
+ }
2242
+ else {
2243
+ if (focusedIndex === -1)
2244
+ return this.hideOverlay();
2245
+ else if (focusedIndex === 0)
2246
+ return;
2247
+ }
2248
+ }
2249
+ else {
2250
+ focusableElements[focusedIndex - 1].focus();
2251
+ }
2252
+ }
2253
+ else {
2254
+ if (focusedIndex == -1) {
2255
+ if (this.timeOnly) {
2256
+ focusableElements[0].focus();
2257
+ }
2258
+ else {
2259
+ let spanIndex = 0;
2260
+ for (let i = 0; i < focusableElements.length; i++) {
2261
+ if (focusableElements[i].tagName === 'SPAN')
2262
+ spanIndex = i;
2263
+ }
2264
+ focusableElements[spanIndex].focus();
2265
+ }
2266
+ }
2267
+ else if (focusedIndex === focusableElements.length - 1) {
2268
+ if (!this.focusTrap && focusedIndex != -1)
2269
+ return this.hideOverlay();
2270
+ focusableElements[0].focus();
2271
+ }
2272
+ else {
2273
+ focusableElements[focusedIndex + 1].focus();
2274
+ }
2275
+ }
2276
+ }
2277
+ }
2278
+ event.preventDefault();
2279
+ }
2280
+ onMonthDropdownChange(m) {
2281
+ this.currentMonth = parseInt(m);
2282
+ this.onMonthChange.emit({ month: this.currentMonth + 1, year: this.currentYear });
2283
+ this.createMonths(this.currentMonth, this.currentYear);
2284
+ }
2285
+ onYearDropdownChange(y) {
2286
+ this.currentYear = parseInt(y);
2287
+ this.onYearChange.emit({ month: this.currentMonth + 1, year: this.currentYear });
2288
+ this.createMonths(this.currentMonth, this.currentYear);
2289
+ }
2290
+ convertTo24Hour(hours, pm) {
2291
+ //@ts-ignore
2292
+ if (this.hourFormat == '12') {
2293
+ if (hours === 12) {
2294
+ return pm ? 12 : 0;
2295
+ }
2296
+ else {
2297
+ return pm ? hours + 12 : hours;
2298
+ }
2299
+ }
2300
+ return hours;
2301
+ }
2302
+ constrainTime(hour, minute, second, pm) {
2303
+ let returnTimeTriple = [hour, minute, second];
2304
+ let minHoursExceeds12;
2305
+ let value = this.value;
2306
+ const convertedHour = this.convertTo24Hour(hour, pm);
2307
+ const isRange = this.isRangeSelection(), isMultiple = this.isMultipleSelection(), isMultiValue = isRange || isMultiple;
2308
+ if (isMultiValue) {
2309
+ if (!this.value) {
2310
+ this.value = [new Date(), new Date()];
2311
+ }
2312
+ if (isRange) {
2313
+ value = this.value[1] || this.value[0];
2314
+ }
2315
+ if (isMultiple) {
2316
+ value = this.value[this.value.length - 1];
2317
+ }
2318
+ }
2319
+ const valueDateString = value ? value.toDateString() : null;
2320
+ let isMinDate = this.minDate && valueDateString && this.minDate.toDateString() === valueDateString;
2321
+ let isMaxDate = this.maxDate && valueDateString && this.maxDate.toDateString() === valueDateString;
2322
+ if (isMinDate) {
2323
+ minHoursExceeds12 = this.minDate.getHours() >= 12;
2324
+ }
2325
+ switch (true // intentional fall through
2326
+ ) {
2327
+ case isMinDate && minHoursExceeds12 && this.minDate.getHours() === 12 && this.minDate.getHours() > convertedHour:
2328
+ returnTimeTriple[0] = 11;
2329
+ case isMinDate && this.minDate.getHours() === convertedHour && this.minDate.getMinutes() > minute:
2330
+ returnTimeTriple[1] = this.minDate.getMinutes();
2331
+ case isMinDate && this.minDate.getHours() === convertedHour && this.minDate.getMinutes() === minute && this.minDate.getSeconds() > second:
2332
+ returnTimeTriple[2] = this.minDate.getSeconds();
2333
+ break;
2334
+ case isMinDate && !minHoursExceeds12 && this.minDate.getHours() - 1 === convertedHour && this.minDate.getHours() > convertedHour:
2335
+ returnTimeTriple[0] = 11;
2336
+ this.pm = true;
2337
+ case isMinDate && this.minDate.getHours() === convertedHour && this.minDate.getMinutes() > minute:
2338
+ returnTimeTriple[1] = this.minDate.getMinutes();
2339
+ case isMinDate && this.minDate.getHours() === convertedHour && this.minDate.getMinutes() === minute && this.minDate.getSeconds() > second:
2340
+ returnTimeTriple[2] = this.minDate.getSeconds();
2341
+ break;
2342
+ case isMinDate && minHoursExceeds12 && this.minDate.getHours() > convertedHour && convertedHour !== 12:
2343
+ this.setCurrentHourPM(this.minDate.getHours());
2344
+ returnTimeTriple[0] = this.currentHour;
2345
+ case isMinDate && this.minDate.getHours() === convertedHour && this.minDate.getMinutes() > minute:
2346
+ returnTimeTriple[1] = this.minDate.getMinutes();
2347
+ case isMinDate && this.minDate.getHours() === convertedHour && this.minDate.getMinutes() === minute && this.minDate.getSeconds() > second:
2348
+ returnTimeTriple[2] = this.minDate.getSeconds();
2349
+ break;
2350
+ case isMinDate && this.minDate.getHours() > convertedHour:
2351
+ returnTimeTriple[0] = this.minDate.getHours();
2352
+ case isMinDate && this.minDate.getHours() === convertedHour && this.minDate.getMinutes() > minute:
2353
+ returnTimeTriple[1] = this.minDate.getMinutes();
2354
+ case isMinDate && this.minDate.getHours() === convertedHour && this.minDate.getMinutes() === minute && this.minDate.getSeconds() > second:
2355
+ returnTimeTriple[2] = this.minDate.getSeconds();
2356
+ break;
2357
+ case isMaxDate && this.maxDate.getHours() < convertedHour:
2358
+ returnTimeTriple[0] = this.maxDate.getHours();
2359
+ case isMaxDate && this.maxDate.getHours() === convertedHour && this.maxDate.getMinutes() < minute:
2360
+ returnTimeTriple[1] = this.maxDate.getMinutes();
2361
+ case isMaxDate && this.maxDate.getHours() === convertedHour && this.maxDate.getMinutes() === minute && this.maxDate.getSeconds() < second:
2362
+ returnTimeTriple[2] = this.maxDate.getSeconds();
2363
+ break;
2364
+ }
2365
+ return returnTimeTriple;
2366
+ }
2367
+ incrementHour(event) {
2368
+ const prevHour = this.currentHour ?? 0;
2369
+ let newHour = (this.currentHour ?? 0) + this.stepHour;
2370
+ let newPM = this.pm;
2371
+ if (this.hourFormat == '24')
2372
+ newHour = newHour >= 24 ? newHour - 24 : newHour;
2373
+ else if (this.hourFormat == '12') {
2374
+ // Before the AM/PM break, now after
2375
+ if (prevHour < 12 && newHour > 11) {
2376
+ newPM = !this.pm;
2377
+ }
2378
+ newHour = newHour >= 13 ? newHour - 12 : newHour;
2379
+ }
2380
+ this.toggleAMPMIfNotMinDate(newPM);
2381
+ [this.currentHour, this.currentMinute, this.currentSecond] = this.constrainTime(newHour, this.currentMinute, this.currentSecond, newPM);
2382
+ event.preventDefault();
2383
+ }
2384
+ toggleAMPMIfNotMinDate(newPM) {
2385
+ let value = this.value;
2386
+ const valueDateString = value ? value.toDateString() : null;
2387
+ let isMinDate = this.minDate && valueDateString && this.minDate.toDateString() === valueDateString;
2388
+ if (isMinDate && this.minDate.getHours() >= 12) {
2389
+ this.pm = true;
2390
+ }
2391
+ else {
2392
+ this.pm = newPM;
2393
+ }
2394
+ }
2395
+ onTimePickerElementMouseDown(event, type, direction) {
2396
+ if (!this.$disabled()) {
2397
+ this.repeat(event, null, type, direction);
2398
+ event.preventDefault();
2399
+ }
2400
+ }
2401
+ onTimePickerElementMouseUp(event) {
2402
+ if (!this.$disabled()) {
2403
+ this.clearTimePickerTimer();
2404
+ this.updateTime();
2405
+ }
2406
+ }
2407
+ onTimePickerElementMouseLeave() {
2408
+ if (!this.$disabled() && this.timePickerTimer) {
2409
+ this.clearTimePickerTimer();
2410
+ this.updateTime();
2411
+ }
2412
+ }
2413
+ repeat(event, interval, type, direction) {
2414
+ let i = interval || 500;
2415
+ this.clearTimePickerTimer();
2416
+ this.timePickerTimer = setTimeout(() => {
2417
+ this.repeat(event, 100, type, direction);
2418
+ this.cd.markForCheck();
2419
+ }, i);
2420
+ switch (type) {
2421
+ case 0:
2422
+ if (direction === 1)
2423
+ this.incrementHour(event);
2424
+ else
2425
+ this.decrementHour(event);
2426
+ break;
2427
+ case 1:
2428
+ if (direction === 1)
2429
+ this.incrementMinute(event);
2430
+ else
2431
+ this.decrementMinute(event);
2432
+ break;
2433
+ case 2:
2434
+ if (direction === 1)
2435
+ this.incrementSecond(event);
2436
+ else
2437
+ this.decrementSecond(event);
2438
+ break;
2439
+ }
2440
+ this.updateInputfield();
2441
+ }
2442
+ clearTimePickerTimer() {
2443
+ if (this.timePickerTimer) {
2444
+ clearTimeout(this.timePickerTimer);
2445
+ this.timePickerTimer = null;
2446
+ }
2447
+ }
2448
+ decrementHour(event) {
2449
+ let newHour = (this.currentHour ?? 0) - this.stepHour;
2450
+ let newPM = this.pm;
2451
+ if (this.hourFormat == '24')
2452
+ newHour = newHour < 0 ? 24 + newHour : newHour;
2453
+ else if (this.hourFormat == '12') {
2454
+ // If we were at noon/midnight, then switch
2455
+ if (this.currentHour === 12) {
2456
+ newPM = !this.pm;
2457
+ }
2458
+ newHour = newHour <= 0 ? 12 + newHour : newHour;
2459
+ }
2460
+ this.toggleAMPMIfNotMinDate(newPM);
2461
+ [this.currentHour, this.currentMinute, this.currentSecond] = this.constrainTime(newHour, this.currentMinute, this.currentSecond, newPM);
2462
+ event.preventDefault();
2463
+ }
2464
+ incrementMinute(event) {
2465
+ let newMinute = (this.currentMinute ?? 0) + this.stepMinute;
2466
+ newMinute = newMinute > 59 ? newMinute - 60 : newMinute;
2467
+ [this.currentHour, this.currentMinute, this.currentSecond] = this.constrainTime(this.currentHour, newMinute, this.currentSecond, this.pm);
2468
+ event.preventDefault();
2469
+ }
2470
+ decrementMinute(event) {
2471
+ let newMinute = (this.currentMinute ?? 0) - this.stepMinute;
2472
+ newMinute = newMinute < 0 ? 60 + newMinute : newMinute;
2473
+ [this.currentHour, this.currentMinute, this.currentSecond] = this.constrainTime(this.currentHour, newMinute, this.currentSecond, this.pm);
2474
+ event.preventDefault();
2475
+ }
2476
+ incrementSecond(event) {
2477
+ let newSecond = this.currentSecond + this.stepSecond;
2478
+ newSecond = newSecond > 59 ? newSecond - 60 : newSecond;
2479
+ [this.currentHour, this.currentMinute, this.currentSecond] = this.constrainTime(this.currentHour, this.currentMinute, newSecond, this.pm);
2480
+ event.preventDefault();
2481
+ }
2482
+ decrementSecond(event) {
2483
+ let newSecond = this.currentSecond - this.stepSecond;
2484
+ newSecond = newSecond < 0 ? 60 + newSecond : newSecond;
2485
+ [this.currentHour, this.currentMinute, this.currentSecond] = this.constrainTime(this.currentHour, this.currentMinute, newSecond, this.pm);
2486
+ event.preventDefault();
2487
+ }
2488
+ updateTime() {
2489
+ let value = this.value;
2490
+ if (this.isRangeSelection()) {
2491
+ value = this.value[1] || this.value[0];
2492
+ }
2493
+ if (this.isMultipleSelection()) {
2494
+ value = this.value[this.value.length - 1];
2495
+ }
2496
+ value = value ? new Date(value.getTime()) : new Date();
2497
+ if (this.hourFormat == '12') {
2498
+ if (this.currentHour === 12)
2499
+ value.setHours(this.pm ? 12 : 0);
2500
+ else
2501
+ value.setHours(this.pm ? this.currentHour + 12 : this.currentHour);
2502
+ }
2503
+ else {
2504
+ value.setHours(this.currentHour);
2505
+ }
2506
+ value.setMinutes(this.currentMinute);
2507
+ value.setSeconds(this.currentSecond);
2508
+ if (this.isRangeSelection()) {
2509
+ if (this.value[1])
2510
+ value = [this.value[0], value];
2511
+ else
2512
+ value = [value, null];
2513
+ }
2514
+ if (this.isMultipleSelection()) {
2515
+ value = [...this.value.slice(0, -1), value];
2516
+ }
2517
+ this.updateModel(value);
2518
+ this.onSelect.emit(value);
2519
+ this.updateInputfield();
2520
+ }
2521
+ toggleAMPM(event) {
2522
+ const newPM = !this.pm;
2523
+ this.pm = newPM;
2524
+ [this.currentHour, this.currentMinute, this.currentSecond] = this.constrainTime(this.currentHour, this.currentMinute, this.currentSecond, newPM);
2525
+ this.updateTime();
2526
+ event.preventDefault();
2527
+ }
2528
+ onUserInput(event) {
2529
+ // IE 11 Workaround for input placeholder : https://github.com/primefaces/primeng/issues/2026
2530
+ if (!this.isKeydown) {
2531
+ return;
2532
+ }
2533
+ this.isKeydown = false;
2534
+ let val = event.target.value;
2535
+ try {
2536
+ let value = this.parseValueFromString(val);
2537
+ if (this.isValidSelection(value)) {
2538
+ this.updateModel(value);
2539
+ this.updateUI();
2540
+ }
2541
+ else if (this.keepInvalid) {
2542
+ this.updateModel(value);
2543
+ }
2544
+ }
2545
+ catch (err) {
2546
+ //invalid date
2547
+ let value = this.keepInvalid ? val : null;
2548
+ this.updateModel(value);
2549
+ }
2550
+ this.onInput.emit(event);
2551
+ }
2552
+ isValidSelection(value) {
2553
+ if (this.isSingleSelection()) {
2554
+ return this.isSelectable(value.getDate(), value.getMonth(), value.getFullYear(), false);
2555
+ }
2556
+ let isValid = value.every((v) => this.isSelectable(v.getDate(), v.getMonth(), v.getFullYear(), false));
2557
+ if (isValid && this.isRangeSelection()) {
2558
+ isValid = value.length === 1 || (value.length > 1 && value[1] >= value[0]);
2559
+ }
2560
+ return isValid;
2561
+ }
2562
+ parseValueFromString(text) {
2563
+ if (!text || text.trim().length === 0) {
2564
+ return null;
2565
+ }
2566
+ let value;
2567
+ if (this.isSingleSelection()) {
2568
+ value = this.parseDateTime(text);
2569
+ }
2570
+ else if (this.isMultipleSelection()) {
2571
+ let tokens = text.split(this.multipleSeparator);
2572
+ value = [];
2573
+ for (let token of tokens) {
2574
+ value.push(this.parseDateTime(token.trim()));
2575
+ }
2576
+ }
2577
+ else if (this.isRangeSelection()) {
2578
+ let tokens = text.split(' ' + this.rangeSeparator + ' ');
2579
+ value = [];
2580
+ for (let i = 0; i < tokens.length; i++) {
2581
+ value[i] = this.parseDateTime(tokens[i].trim());
2582
+ }
2583
+ }
2584
+ return value;
2585
+ }
2586
+ parseDateTime(text) {
2587
+ let date;
2588
+ let parts = text.split(' ');
2589
+ if (this.timeOnly) {
2590
+ date = new Date();
2591
+ this.populateTime(date, parts[0], parts[1]);
2592
+ }
2593
+ else {
2594
+ const dateFormat = this.getDateFormat();
2595
+ if (this.showTime) {
2596
+ let ampm = this.hourFormat == '12' ? parts.pop() : null;
2597
+ let timeString = parts.pop();
2598
+ date = this.parseDate(parts.join(' '), dateFormat);
2599
+ this.populateTime(date, timeString, ampm);
2600
+ }
2601
+ else {
2602
+ date = this.parseDate(text, dateFormat);
2603
+ }
2604
+ }
2605
+ return date;
2606
+ }
2607
+ populateTime(value, timeString, ampm) {
2608
+ if (this.hourFormat == '12' && !ampm) {
2609
+ throw 'Invalid Time';
2610
+ }
2611
+ this.pm = ampm === 'PM' || ampm === 'pm';
2612
+ let time = this.parseTime(timeString);
2613
+ value.setHours(time.hour);
2614
+ value.setMinutes(time.minute);
2615
+ value.setSeconds(time.second);
2616
+ }
2617
+ isValidDate(date) {
2618
+ return isDate(date) && isNotEmpty(date);
2619
+ }
2620
+ updateUI() {
2621
+ let propValue = this.value;
2622
+ if (Array.isArray(propValue)) {
2623
+ propValue = propValue.length === 2 ? propValue[1] : propValue[0];
2624
+ }
2625
+ let val = this.defaultDate && this.isValidDate(this.defaultDate) && !this.value ? this.defaultDate : propValue && this.isValidDate(propValue) ? propValue : new Date();
2626
+ this.currentMonth = val.getMonth();
2627
+ this.currentYear = val.getFullYear();
2628
+ this.createMonths(this.currentMonth, this.currentYear);
2629
+ if (this.showTime || this.timeOnly) {
2630
+ this.setCurrentHourPM(val.getHours());
2631
+ this.currentMinute = val.getMinutes();
2632
+ this.currentSecond = val.getSeconds();
2633
+ }
2634
+ }
2635
+ showOverlay() {
2636
+ if (!this.overlayVisible) {
2637
+ this.updateUI();
2638
+ if (!this.touchUI) {
2639
+ this.preventFocus = true;
2640
+ }
2641
+ this.overlayVisible = true;
2642
+ }
2643
+ }
2644
+ hideOverlay() {
2645
+ this.inputfieldViewChild?.nativeElement.focus();
2646
+ this.overlayVisible = false;
2647
+ this.clearTimePickerTimer();
2648
+ if (this.touchUI) {
2649
+ this.disableModality();
2650
+ }
2651
+ this.cd.markForCheck();
2652
+ }
2653
+ toggle() {
2654
+ if (!this.inline) {
2655
+ if (!this.overlayVisible) {
2656
+ this.showOverlay();
2657
+ this.inputfieldViewChild?.nativeElement.focus();
2658
+ }
2659
+ else {
2660
+ this.hideOverlay();
2661
+ }
2662
+ }
2663
+ }
2664
+ onOverlayAnimationStart(event) {
2665
+ switch (event.toState) {
2666
+ case 'visible':
2667
+ case 'visibleTouchUI':
2668
+ if (!this.inline) {
2669
+ this.overlay = event.element;
2670
+ this.attrSelector && this.overlay.setAttribute(this.attrSelector, '');
2671
+ const styles = !this.inline ? { position: 'absolute', top: '0' } : undefined;
2672
+ addStyle(this.overlay, styles);
2673
+ this.appendOverlay();
2674
+ this.updateFocus();
2675
+ if (this.autoZIndex) {
2676
+ if (this.touchUI)
2677
+ ZIndexUtils.set('modal', this.overlay, this.baseZIndex || this.config.zIndex.modal);
2678
+ else
2679
+ ZIndexUtils.set('overlay', this.overlay, this.baseZIndex || this.config.zIndex.overlay);
2680
+ }
2681
+ this.alignOverlay();
2682
+ this.onShow.emit(event);
2683
+ }
2684
+ break;
2685
+ case 'void':
2686
+ this.onOverlayHide();
2687
+ this.onClose.emit(event);
2688
+ break;
2689
+ }
2690
+ }
2691
+ onOverlayAnimationDone(event) {
2692
+ switch (event.toState) {
2693
+ case 'visible':
2694
+ case 'visibleTouchUI':
2695
+ if (!this.inline) {
2696
+ this.bindDocumentClickListener();
2697
+ this.bindDocumentResizeListener();
2698
+ this.bindScrollListener();
2699
+ }
2700
+ break;
2701
+ case 'void':
2702
+ if (this.autoZIndex) {
2703
+ ZIndexUtils.clear(event.element);
2704
+ }
2705
+ break;
2706
+ }
2707
+ }
2708
+ appendOverlay() {
2709
+ if (this.$appendTo() && this.$appendTo() !== 'self') {
2710
+ if (this.$appendTo() === 'body')
2711
+ this.document.body.appendChild(this.overlay);
2712
+ else
2713
+ appendChild(this.$appendTo(), this.overlay);
2714
+ }
2715
+ }
2716
+ restoreOverlayAppend() {
2717
+ if (this.overlay && this.$appendTo() !== 'self') {
2718
+ this.el.nativeElement.appendChild(this.overlay);
2719
+ }
2720
+ }
2721
+ alignOverlay() {
2722
+ if (this.touchUI) {
2723
+ this.enableModality(this.overlay);
2724
+ }
2725
+ else if (this.overlay) {
2726
+ if (this.view === 'date') {
2727
+ if (!this.overlay.style.width) {
2728
+ this.overlay.style.width = getOuterWidth(this.overlay) + 'px';
2729
+ }
2730
+ if (!this.overlay.style.minWidth) {
2731
+ this.overlay.style.minWidth = getOuterWidth(this.inputfieldViewChild?.nativeElement) + 'px';
2732
+ }
2733
+ }
2734
+ else {
2735
+ if (!this.overlay.style.width) {
2736
+ this.overlay.style.width = getOuterWidth(this.inputfieldViewChild?.nativeElement) + 'px';
2737
+ }
2738
+ }
2739
+ if (this.$appendTo() && this.$appendTo() !== 'self') {
2740
+ absolutePosition(this.overlay, this.inputfieldViewChild?.nativeElement);
2741
+ }
2742
+ else {
2743
+ relativePosition(this.overlay, this.inputfieldViewChild?.nativeElement);
2744
+ }
2745
+ }
2746
+ }
2747
+ enableModality(element) {
2748
+ if (!this.mask && this.touchUI) {
2749
+ this.mask = this.renderer.createElement('div');
2750
+ this.renderer.setStyle(this.mask, 'zIndex', String(parseInt(element.style.zIndex) - 1));
2751
+ let maskStyleClass = 'p-overlay-mask p-datepicker-mask p-datepicker-mask-scrollblocker p-overlay-mask p-overlay-mask-enter';
2752
+ addClass(this.mask, maskStyleClass);
2753
+ this.maskClickListener = this.renderer.listen(this.mask, 'click', (event) => {
2754
+ this.disableModality();
2755
+ this.overlayVisible = false;
2756
+ });
2757
+ this.renderer.appendChild(this.document.body, this.mask);
2758
+ blockBodyScroll();
2759
+ }
2760
+ }
2761
+ disableModality() {
2762
+ if (this.mask) {
2763
+ addClass(this.mask, 'p-overlay-mask-leave');
2764
+ if (!this.animationEndListener) {
2765
+ this.animationEndListener = this.renderer.listen(this.mask, 'animationend', this.destroyMask.bind(this));
2766
+ }
2767
+ }
2768
+ }
2769
+ destroyMask() {
2770
+ if (!this.mask) {
2771
+ return;
2772
+ }
2773
+ this.renderer.removeChild(this.document.body, this.mask);
2774
+ let bodyChildren = this.document.body.children;
2775
+ let hasBlockerMasks;
2776
+ for (let i = 0; i < bodyChildren.length; i++) {
2777
+ let bodyChild = bodyChildren[i];
2778
+ if (hasClass(bodyChild, 'p-datepicker-mask-scrollblocker')) {
2779
+ hasBlockerMasks = true;
2780
+ break;
2781
+ }
2782
+ }
2783
+ if (!hasBlockerMasks) {
2784
+ unblockBodyScroll();
2785
+ }
2786
+ this.unbindAnimationEndListener();
2787
+ this.unbindMaskClickListener();
2788
+ this.mask = null;
2789
+ }
2790
+ unbindMaskClickListener() {
2791
+ if (this.maskClickListener) {
2792
+ this.maskClickListener();
2793
+ this.maskClickListener = null;
2794
+ }
2795
+ }
2796
+ unbindAnimationEndListener() {
2797
+ if (this.animationEndListener && this.mask) {
2798
+ this.animationEndListener();
2799
+ this.animationEndListener = null;
2800
+ }
2801
+ }
2802
+ getDateFormat() {
2803
+ return this.dateFormat || this.getTranslation('dateFormat');
2804
+ }
2805
+ getFirstDateOfWeek() {
2806
+ return this._firstDayOfWeek || this.getTranslation(TranslationKeys.FIRST_DAY_OF_WEEK);
2807
+ }
2808
+ // Ported from jquery-ui datepicker formatDate
2809
+ formatDate(date, format) {
2810
+ if (!date) {
2811
+ return '';
2812
+ }
2813
+ let iFormat;
2814
+ const lookAhead = (match) => {
2815
+ const matches = iFormat + 1 < format.length && format.charAt(iFormat + 1) === match;
2816
+ if (matches) {
2817
+ iFormat++;
2818
+ }
2819
+ return matches;
2820
+ }, formatNumber = (match, value, len) => {
2821
+ let num = '' + value;
2822
+ if (lookAhead(match)) {
2823
+ while (num.length < len) {
2824
+ num = '0' + num;
2825
+ }
2826
+ }
2827
+ return num;
2828
+ }, formatName = (match, value, shortNames, longNames) => {
2829
+ return lookAhead(match) ? longNames[value] : shortNames[value];
2830
+ };
2831
+ let output = '';
2832
+ let literal = false;
2833
+ if (date) {
2834
+ for (iFormat = 0; iFormat < format.length; iFormat++) {
2835
+ if (literal) {
2836
+ if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
2837
+ literal = false;
2838
+ }
2839
+ else {
2840
+ output += format.charAt(iFormat);
2841
+ }
2842
+ }
2843
+ else {
2844
+ switch (format.charAt(iFormat)) {
2845
+ case 'd':
2846
+ output += formatNumber('d', date.getDate(), 2);
2847
+ break;
2848
+ case 'D':
2849
+ output += formatName('D', date.getDay(), this.getTranslation(TranslationKeys.DAY_NAMES_SHORT), this.getTranslation(TranslationKeys.DAY_NAMES));
2850
+ break;
2851
+ case 'o':
2852
+ output += formatNumber('o', Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);
2853
+ break;
2854
+ case 'm':
2855
+ output += formatNumber('m', date.getMonth() + 1, 2);
2856
+ break;
2857
+ case 'M':
2858
+ output += formatName('M', date.getMonth(), this.getTranslation(TranslationKeys.MONTH_NAMES_SHORT), this.getTranslation(TranslationKeys.MONTH_NAMES));
2859
+ break;
2860
+ case 'y':
2861
+ output += lookAhead('y') ? date.getFullYear() : (date.getFullYear() % 100 < 10 ? '0' : '') + (date.getFullYear() % 100);
2862
+ break;
2863
+ case '@':
2864
+ output += date.getTime();
2865
+ break;
2866
+ case '!':
2867
+ output += date.getTime() * 10000 + this.ticksTo1970;
2868
+ break;
2869
+ case "'":
2870
+ if (lookAhead("'")) {
2871
+ output += "'";
2872
+ }
2873
+ else {
2874
+ literal = true;
2875
+ }
2876
+ break;
2877
+ default:
2878
+ output += format.charAt(iFormat);
2879
+ }
2880
+ }
2881
+ }
2882
+ }
2883
+ return output;
2884
+ }
2885
+ formatTime(date) {
2886
+ if (!date) {
2887
+ return '';
2888
+ }
2889
+ let output = '';
2890
+ let hours = date.getHours();
2891
+ let minutes = date.getMinutes();
2892
+ let seconds = date.getSeconds();
2893
+ if (this.hourFormat == '12' && hours > 11 && hours != 12) {
2894
+ hours -= 12;
2895
+ }
2896
+ if (this.hourFormat == '12') {
2897
+ output += hours === 0 ? 12 : hours < 10 ? '0' + hours : hours;
2898
+ }
2899
+ else {
2900
+ output += hours < 10 ? '0' + hours : hours;
2901
+ }
2902
+ output += ':';
2903
+ output += minutes < 10 ? '0' + minutes : minutes;
2904
+ if (this.showSeconds) {
2905
+ output += ':';
2906
+ output += seconds < 10 ? '0' + seconds : seconds;
2907
+ }
2908
+ if (this.hourFormat == '12') {
2909
+ output += date.getHours() > 11 ? ' PM' : ' AM';
2910
+ }
2911
+ return output;
2912
+ }
2913
+ parseTime(value) {
2914
+ let tokens = value.split(':');
2915
+ let validTokenLength = this.showSeconds ? 3 : 2;
2916
+ if (tokens.length !== validTokenLength) {
2917
+ throw 'Invalid time';
2918
+ }
2919
+ let h = parseInt(tokens[0]);
2920
+ let m = parseInt(tokens[1]);
2921
+ let s = this.showSeconds ? parseInt(tokens[2]) : null;
2922
+ if (isNaN(h) || isNaN(m) || h > 23 || m > 59 || (this.hourFormat == '12' && h > 12) || (this.showSeconds && (isNaN(s) || s > 59))) {
2923
+ throw 'Invalid time';
2924
+ }
2925
+ else {
2926
+ if (this.hourFormat == '12') {
2927
+ if (h !== 12 && this.pm) {
2928
+ h += 12;
2929
+ }
2930
+ else if (!this.pm && h === 12) {
2931
+ h -= 12;
2932
+ }
2933
+ }
2934
+ return { hour: h, minute: m, second: s };
2935
+ }
2936
+ }
2937
+ // Ported from jquery-ui datepicker parseDate
2938
+ parseDate(value, format) {
2939
+ if (format == null || value == null) {
2940
+ throw 'Invalid arguments';
2941
+ }
2942
+ value = typeof value === 'object' ? value.toString() : value + '';
2943
+ if (value === '') {
2944
+ return null;
2945
+ }
2946
+ let iFormat, dim, extra, iValue = 0, shortYearCutoff = typeof this.shortYearCutoff !== 'string' ? this.shortYearCutoff : (new Date().getFullYear() % 100) + parseInt(this.shortYearCutoff, 10), year = -1, month = -1, day = -1, doy = -1, literal = false, date, lookAhead = (match) => {
2947
+ let matches = iFormat + 1 < format.length && format.charAt(iFormat + 1) === match;
2948
+ if (matches) {
2949
+ iFormat++;
2950
+ }
2951
+ return matches;
2952
+ }, getNumber = (match) => {
2953
+ let isDoubled = lookAhead(match), size = match === '@' ? 14 : match === '!' ? 20 : match === 'y' && isDoubled ? 4 : match === 'o' ? 3 : 2, minSize = match === 'y' ? size : 1, digits = new RegExp('^\\d{' + minSize + ',' + size + '}'), num = value.substring(iValue).match(digits);
2954
+ if (!num) {
2955
+ throw 'Missing number at position ' + iValue;
2956
+ }
2957
+ iValue += num[0].length;
2958
+ return parseInt(num[0], 10);
2959
+ }, getName = (match, shortNames, longNames) => {
2960
+ let index = -1;
2961
+ let arr = lookAhead(match) ? longNames : shortNames;
2962
+ let names = [];
2963
+ for (let i = 0; i < arr.length; i++) {
2964
+ names.push([i, arr[i]]);
2965
+ }
2966
+ names.sort((a, b) => {
2967
+ return -(a[1].length - b[1].length);
2968
+ });
2969
+ for (let i = 0; i < names.length; i++) {
2970
+ let name = names[i][1];
2971
+ if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {
2972
+ index = names[i][0];
2973
+ iValue += name.length;
2974
+ break;
2975
+ }
2976
+ }
2977
+ if (index !== -1) {
2978
+ return index + 1;
2979
+ }
2980
+ else {
2981
+ throw 'Unknown name at position ' + iValue;
2982
+ }
2983
+ }, checkLiteral = () => {
2984
+ if (value.charAt(iValue) !== format.charAt(iFormat)) {
2985
+ throw 'Unexpected literal at position ' + iValue;
2986
+ }
2987
+ iValue++;
2988
+ };
2989
+ if (this.view === 'month') {
2990
+ day = 1;
2991
+ }
2992
+ for (iFormat = 0; iFormat < format.length; iFormat++) {
2993
+ if (literal) {
2994
+ if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
2995
+ literal = false;
2996
+ }
2997
+ else {
2998
+ checkLiteral();
2999
+ }
3000
+ }
3001
+ else {
3002
+ switch (format.charAt(iFormat)) {
3003
+ case 'd':
3004
+ day = getNumber('d');
3005
+ break;
3006
+ case 'D':
3007
+ getName('D', this.getTranslation(TranslationKeys.DAY_NAMES_SHORT), this.getTranslation(TranslationKeys.DAY_NAMES));
3008
+ break;
3009
+ case 'o':
3010
+ doy = getNumber('o');
3011
+ break;
3012
+ case 'm':
3013
+ month = getNumber('m');
3014
+ break;
3015
+ case 'M':
3016
+ month = getName('M', this.getTranslation(TranslationKeys.MONTH_NAMES_SHORT), this.getTranslation(TranslationKeys.MONTH_NAMES));
3017
+ break;
3018
+ case 'y':
3019
+ year = getNumber('y');
3020
+ break;
3021
+ case '@':
3022
+ date = new Date(getNumber('@'));
3023
+ year = date.getFullYear();
3024
+ month = date.getMonth() + 1;
3025
+ day = date.getDate();
3026
+ break;
3027
+ case '!':
3028
+ date = new Date((getNumber('!') - this.ticksTo1970) / 10000);
3029
+ year = date.getFullYear();
3030
+ month = date.getMonth() + 1;
3031
+ day = date.getDate();
3032
+ break;
3033
+ case "'":
3034
+ if (lookAhead("'")) {
3035
+ checkLiteral();
3036
+ }
3037
+ else {
3038
+ literal = true;
3039
+ }
3040
+ break;
3041
+ default:
3042
+ checkLiteral();
3043
+ }
3044
+ }
3045
+ }
3046
+ if (iValue < value.length) {
3047
+ extra = value.substr(iValue);
3048
+ if (!/^\s+/.test(extra)) {
3049
+ throw 'Extra/unparsed characters found in date: ' + extra;
3050
+ }
3051
+ }
3052
+ if (year === -1) {
3053
+ year = new Date().getFullYear();
3054
+ }
3055
+ else if (year < 100) {
3056
+ year += new Date().getFullYear() - (new Date().getFullYear() % 100) + (year <= shortYearCutoff ? 0 : -100);
3057
+ }
3058
+ if (doy > -1) {
3059
+ month = 1;
3060
+ day = doy;
3061
+ do {
3062
+ dim = this.getDaysCountInMonth(year, month - 1);
3063
+ if (day <= dim) {
3064
+ break;
3065
+ }
3066
+ month++;
3067
+ day -= dim;
3068
+ } while (true);
3069
+ }
3070
+ if (this.view === 'year') {
3071
+ month = month === -1 ? 1 : month;
3072
+ day = day === -1 ? 1 : day;
3073
+ }
3074
+ date = this.daylightSavingAdjust(new Date(year, month - 1, day));
3075
+ if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {
3076
+ throw 'Invalid date'; // E.g. 31/02/00
3077
+ }
3078
+ return date;
3079
+ }
3080
+ daylightSavingAdjust(date) {
3081
+ if (!date) {
3082
+ return null;
3083
+ }
3084
+ date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
3085
+ return date;
3086
+ }
3087
+ isValidDateForTimeConstraints(selectedDate) {
3088
+ if (this.keepInvalid) {
3089
+ return true; // If we are keeping invalid dates, we don't need to check for time constraints
3090
+ }
3091
+ return (!this.minDate || selectedDate >= this.minDate) && (!this.maxDate || selectedDate <= this.maxDate);
3092
+ }
3093
+ onTodayButtonClick(event) {
3094
+ const date = new Date();
3095
+ const dateMeta = {
3096
+ day: date.getDate(),
3097
+ month: date.getMonth(),
3098
+ year: date.getFullYear(),
3099
+ otherMonth: date.getMonth() !== this.currentMonth || date.getFullYear() !== this.currentYear,
3100
+ today: true,
3101
+ selectable: true
3102
+ };
3103
+ this.createMonths(date.getMonth(), date.getFullYear());
3104
+ this.onDateSelect(event, dateMeta);
3105
+ this.onTodayClick.emit(date);
3106
+ }
3107
+ onClearButtonClick(event) {
3108
+ this.updateModel(null);
3109
+ this.updateInputfield();
3110
+ this.hideOverlay();
3111
+ this.onClearClick.emit(event);
3112
+ }
3113
+ createResponsiveStyle() {
3114
+ if (this.numberOfMonths > 1 && this.responsiveOptions) {
3115
+ if (!this.responsiveStyleElement) {
3116
+ this.responsiveStyleElement = this.renderer.createElement('style');
3117
+ this.responsiveStyleElement.type = 'text/css';
3118
+ setAttribute(this.responsiveStyleElement, 'nonce', this.config?.csp()?.nonce);
3119
+ this.renderer.appendChild(this.document.body, this.responsiveStyleElement);
3120
+ }
3121
+ let innerHTML = '';
3122
+ if (this.responsiveOptions) {
3123
+ let responsiveOptions = [...this.responsiveOptions].filter((o) => !!(o.breakpoint && o.numMonths)).sort((o1, o2) => -1 * o1.breakpoint.localeCompare(o2.breakpoint, undefined, { numeric: true }));
3124
+ for (let i = 0; i < responsiveOptions.length; i++) {
3125
+ let { breakpoint, numMonths } = responsiveOptions[i];
3126
+ let styles = `
3127
+ .p-datepicker[${this.attributeSelector}] .p-datepicker-group:nth-child(${numMonths}) .p-datepicker-next {
3128
+ display: inline-flex !important;
3129
+ }
3130
+ `;
3131
+ for (let j = numMonths; j < this.numberOfMonths; j++) {
3132
+ styles += `
3133
+ .p-datepicker[${this.attributeSelector}] .p-datepicker-group:nth-child(${j + 1}) {
3134
+ display: none !important;
3135
+ }
3136
+ `;
3137
+ }
3138
+ innerHTML += `
3139
+ @media screen and (max-width: ${breakpoint}) {
3140
+ ${styles}
3141
+ }
3142
+ `;
3143
+ }
3144
+ }
3145
+ this.responsiveStyleElement.innerHTML = innerHTML;
3146
+ setAttribute(this.responsiveStyleElement, 'nonce', this.config?.csp()?.nonce);
3147
+ }
3148
+ }
3149
+ destroyResponsiveStyleElement() {
3150
+ if (this.responsiveStyleElement) {
3151
+ this.responsiveStyleElement.remove();
3152
+ this.responsiveStyleElement = null;
3153
+ }
3154
+ }
3155
+ bindDocumentClickListener() {
3156
+ if (!this.documentClickListener) {
3157
+ this.zone.runOutsideAngular(() => {
3158
+ const documentTarget = this.el ? this.el.nativeElement.ownerDocument : this.document;
3159
+ this.documentClickListener = this.renderer.listen(documentTarget, 'mousedown', (event) => {
3160
+ if (this.isOutsideClicked(event) && this.overlayVisible) {
3161
+ this.zone.run(() => {
3162
+ this.hideOverlay();
3163
+ this.onClickOutside.emit(event);
3164
+ this.cd.markForCheck();
3165
+ });
3166
+ }
3167
+ });
3168
+ });
3169
+ }
3170
+ }
3171
+ unbindDocumentClickListener() {
3172
+ if (this.documentClickListener) {
3173
+ this.documentClickListener();
3174
+ this.documentClickListener = null;
3175
+ }
3176
+ }
3177
+ bindDocumentResizeListener() {
3178
+ if (!this.documentResizeListener && !this.touchUI) {
3179
+ this.documentResizeListener = this.renderer.listen(this.window, 'resize', this.onWindowResize.bind(this));
3180
+ }
3181
+ }
3182
+ unbindDocumentResizeListener() {
3183
+ if (this.documentResizeListener) {
3184
+ this.documentResizeListener();
3185
+ this.documentResizeListener = null;
3186
+ }
3187
+ }
3188
+ bindScrollListener() {
3189
+ if (!this.scrollHandler) {
3190
+ this.scrollHandler = new ConnectedOverlayScrollHandler(this.el?.nativeElement, () => {
3191
+ if (this.overlayVisible) {
3192
+ this.hideOverlay();
3193
+ }
3194
+ });
3195
+ }
3196
+ this.scrollHandler.bindScrollListener();
3197
+ }
3198
+ unbindScrollListener() {
3199
+ if (this.scrollHandler) {
3200
+ this.scrollHandler.unbindScrollListener();
3201
+ }
3202
+ }
3203
+ isOutsideClicked(event) {
3204
+ return !(this.el.nativeElement.isSameNode(event.target) || this.isNavIconClicked(event) || this.el.nativeElement.contains(event.target) || (this.overlay && this.overlay.contains(event.target)));
3205
+ }
3206
+ isNavIconClicked(event) {
3207
+ return hasClass(event.target, 'p-datepicker-prev-button') || hasClass(event.target, 'p-datepicker-prev-icon') || hasClass(event.target, 'p-datepicker-next-button') || hasClass(event.target, 'p-datepicker-next-icon');
3208
+ }
3209
+ onWindowResize() {
3210
+ if (this.overlayVisible && !isTouchDevice()) {
3211
+ this.hideOverlay();
3212
+ }
3213
+ }
3214
+ onOverlayHide() {
3215
+ this.currentView = this.view;
3216
+ if (this.mask) {
3217
+ this.destroyMask();
3218
+ }
3219
+ this.unbindDocumentClickListener();
3220
+ this.unbindDocumentResizeListener();
3221
+ this.unbindScrollListener();
3222
+ this.overlay = null;
3223
+ }
3224
+ /**
3225
+ * @override
3226
+ *
3227
+ * @see {@link BaseEditableHolder.writeControlValue}
3228
+ * Writes the value to the control.
3229
+ */
3230
+ writeControlValue(value) {
3231
+ this.value = value;
3232
+ if (this.value && typeof this.value === 'string') {
3233
+ try {
3234
+ this.value = this.parseValueFromString(this.value);
3235
+ }
3236
+ catch {
3237
+ if (this.keepInvalid) {
3238
+ this.value = value;
3239
+ }
3240
+ }
3241
+ }
3242
+ this.updateInputfield();
3243
+ this.updateUI();
3244
+ this.cd.markForCheck();
3245
+ }
3246
+ ngOnDestroy() {
3247
+ if (this.scrollHandler) {
3248
+ this.scrollHandler.destroy();
3249
+ this.scrollHandler = null;
3250
+ }
3251
+ if (this.translationSubscription) {
3252
+ this.translationSubscription.unsubscribe();
3253
+ }
3254
+ if (this.overlay && this.autoZIndex) {
3255
+ ZIndexUtils.clear(this.overlay);
3256
+ }
3257
+ this.destroyResponsiveStyleElement();
3258
+ this.clearTimePickerTimer();
3259
+ this.restoreOverlayAppend();
3260
+ this.onOverlayHide();
3261
+ super.ngOnDestroy();
3262
+ }
3263
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: DatePicker, deps: [{ token: i0.NgZone }, { token: i1.OverlayService }], target: i0.ɵɵFactoryTarget.Component });
3264
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.4", type: DatePicker, isStandalone: true, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: { iconDisplay: { classPropertyName: "iconDisplay", publicName: "iconDisplay", isSignal: false, isRequired: false, transformFunction: null }, styleClass: { classPropertyName: "styleClass", publicName: "styleClass", isSignal: false, isRequired: false, transformFunction: null }, inputStyle: { classPropertyName: "inputStyle", publicName: "inputStyle", isSignal: false, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: false, isRequired: false, transformFunction: null }, inputStyleClass: { classPropertyName: "inputStyleClass", publicName: "inputStyleClass", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "ariaLabelledBy", isSignal: false, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: false, isRequired: false, transformFunction: null }, iconAriaLabel: { classPropertyName: "iconAriaLabel", publicName: "iconAriaLabel", isSignal: false, isRequired: false, transformFunction: null }, dateFormat: { classPropertyName: "dateFormat", publicName: "dateFormat", isSignal: false, isRequired: false, transformFunction: null }, multipleSeparator: { classPropertyName: "multipleSeparator", publicName: "multipleSeparator", isSignal: false, isRequired: false, transformFunction: null }, rangeSeparator: { classPropertyName: "rangeSeparator", publicName: "rangeSeparator", isSignal: false, isRequired: false, transformFunction: null }, inline: { classPropertyName: "inline", publicName: "inline", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, showOtherMonths: { classPropertyName: "showOtherMonths", publicName: "showOtherMonths", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, selectOtherMonths: { classPropertyName: "selectOtherMonths", publicName: "selectOtherMonths", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, showIcon: { classPropertyName: "showIcon", publicName: "showIcon", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: false, isRequired: false, transformFunction: null }, readonlyInput: { classPropertyName: "readonlyInput", publicName: "readonlyInput", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, shortYearCutoff: { classPropertyName: "shortYearCutoff", publicName: "shortYearCutoff", isSignal: false, isRequired: false, transformFunction: null }, hourFormat: { classPropertyName: "hourFormat", publicName: "hourFormat", isSignal: false, isRequired: false, transformFunction: null }, timeOnly: { classPropertyName: "timeOnly", publicName: "timeOnly", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, stepHour: { classPropertyName: "stepHour", publicName: "stepHour", isSignal: false, isRequired: false, transformFunction: numberAttribute }, stepMinute: { classPropertyName: "stepMinute", publicName: "stepMinute", isSignal: false, isRequired: false, transformFunction: numberAttribute }, stepSecond: { classPropertyName: "stepSecond", publicName: "stepSecond", isSignal: false, isRequired: false, transformFunction: numberAttribute }, showSeconds: { classPropertyName: "showSeconds", publicName: "showSeconds", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, showOnFocus: { classPropertyName: "showOnFocus", publicName: "showOnFocus", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, showWeek: { classPropertyName: "showWeek", publicName: "showWeek", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, startWeekFromFirstDayOfYear: { classPropertyName: "startWeekFromFirstDayOfYear", publicName: "startWeekFromFirstDayOfYear", isSignal: false, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, dataType: { classPropertyName: "dataType", publicName: "dataType", isSignal: false, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: false, isRequired: false, transformFunction: null }, maxDateCount: { classPropertyName: "maxDateCount", publicName: "maxDateCount", isSignal: false, isRequired: false, transformFunction: numberAttribute }, showButtonBar: { classPropertyName: "showButtonBar", publicName: "showButtonBar", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, todayButtonStyleClass: { classPropertyName: "todayButtonStyleClass", publicName: "todayButtonStyleClass", isSignal: false, isRequired: false, transformFunction: null }, clearButtonStyleClass: { classPropertyName: "clearButtonStyleClass", publicName: "clearButtonStyleClass", isSignal: false, isRequired: false, transformFunction: null }, autofocus: { classPropertyName: "autofocus", publicName: "autofocus", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, autoZIndex: { classPropertyName: "autoZIndex", publicName: "autoZIndex", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, baseZIndex: { classPropertyName: "baseZIndex", publicName: "baseZIndex", isSignal: false, isRequired: false, transformFunction: numberAttribute }, panelStyleClass: { classPropertyName: "panelStyleClass", publicName: "panelStyleClass", isSignal: false, isRequired: false, transformFunction: null }, panelStyle: { classPropertyName: "panelStyle", publicName: "panelStyle", isSignal: false, isRequired: false, transformFunction: null }, keepInvalid: { classPropertyName: "keepInvalid", publicName: "keepInvalid", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, hideOnDateTimeSelect: { classPropertyName: "hideOnDateTimeSelect", publicName: "hideOnDateTimeSelect", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, touchUI: { classPropertyName: "touchUI", publicName: "touchUI", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, timeSeparator: { classPropertyName: "timeSeparator", publicName: "timeSeparator", isSignal: false, isRequired: false, transformFunction: null }, focusTrap: { classPropertyName: "focusTrap", publicName: "focusTrap", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, showTransitionOptions: { classPropertyName: "showTransitionOptions", publicName: "showTransitionOptions", isSignal: false, isRequired: false, transformFunction: null }, hideTransitionOptions: { classPropertyName: "hideTransitionOptions", publicName: "hideTransitionOptions", isSignal: false, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: false, isRequired: false, transformFunction: numberAttribute }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: false, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: false, isRequired: false, transformFunction: null }, disabledDates: { classPropertyName: "disabledDates", publicName: "disabledDates", isSignal: false, isRequired: false, transformFunction: null }, disabledDays: { classPropertyName: "disabledDays", publicName: "disabledDays", isSignal: false, isRequired: false, transformFunction: null }, showTime: { classPropertyName: "showTime", publicName: "showTime", isSignal: false, isRequired: false, transformFunction: null }, responsiveOptions: { classPropertyName: "responsiveOptions", publicName: "responsiveOptions", isSignal: false, isRequired: false, transformFunction: null }, numberOfMonths: { classPropertyName: "numberOfMonths", publicName: "numberOfMonths", isSignal: false, isRequired: false, transformFunction: null }, firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: false, isRequired: false, transformFunction: null }, view: { classPropertyName: "view", publicName: "view", isSignal: false, isRequired: false, transformFunction: null }, defaultDate: { classPropertyName: "defaultDate", publicName: "defaultDate", isSignal: false, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onFocus: "onFocus", onBlur: "onBlur", onClose: "onClose", onSelect: "onSelect", onClear: "onClear", onInput: "onInput", onTodayClick: "onTodayClick", onClearClick: "onClearClick", onMonthChange: "onMonthChange", onYearChange: "onYearChange", onClickOutside: "onClickOutside", onShow: "onShow" }, host: { properties: { "class": "cn(cx('root'), styleClass)", "style": "sx('root')" } }, providers: [DATEPICKER_VALUE_ACCESSOR, DatePickerStyle], queries: [{ propertyName: "dateTemplate", first: true, predicate: ["date"] }, { propertyName: "headerTemplate", first: true, predicate: ["header"] }, { propertyName: "footerTemplate", first: true, predicate: ["footer"] }, { propertyName: "disabledDateTemplate", first: true, predicate: ["disabledDate"] }, { propertyName: "decadeTemplate", first: true, predicate: ["decade"] }, { propertyName: "previousIconTemplate", first: true, predicate: ["previousicon"] }, { propertyName: "nextIconTemplate", first: true, predicate: ["nexticon"] }, { propertyName: "triggerIconTemplate", first: true, predicate: ["triggericon"] }, { propertyName: "clearIconTemplate", first: true, predicate: ["clearicon"] }, { propertyName: "decrementIconTemplate", first: true, predicate: ["decrementicon"] }, { propertyName: "incrementIconTemplate", first: true, predicate: ["incrementicon"] }, { propertyName: "inputIconTemplate", first: true, predicate: ["inputicon"] }, { propertyName: "templates", predicate: PrimeTemplate }], viewQueries: [{ propertyName: "inputfieldViewChild", first: true, predicate: ["inputfield"], descendants: true }, { propertyName: "content", first: true, predicate: ["contentWrapper"], descendants: true }], usesInheritance: true, ngImport: i0, template: `
3265
+ <ng-template [ngIf]="!inline">
3266
+ <input
3267
+ #inputfield
3268
+ pInputText
3269
+ [pSize]="size()"
3270
+ [attr.size]="inputSize()"
3271
+ type="text"
3272
+ role="combobox"
3273
+ [attr.id]="inputId"
3274
+ [attr.name]="name()"
3275
+ [attr.aria-required]="required()"
3276
+ aria-autocomplete="none"
3277
+ aria-haspopup="dialog"
3278
+ [attr.aria-expanded]="overlayVisible ?? false"
3279
+ [attr.aria-controls]="overlayVisible ? panelId : null"
3280
+ [attr.aria-labelledby]="ariaLabelledBy"
3281
+ [attr.aria-label]="ariaLabel"
3282
+ [value]="inputFieldValue"
3283
+ (focus)="onInputFocus($event)"
3284
+ (keydown)="onInputKeydown($event)"
3285
+ (click)="onInputClick()"
3286
+ (blur)="onInputBlur($event)"
3287
+ [attr.required]="required() ? '' : undefined"
3288
+ [attr.readonly]="readonlyInput ? '' : undefined"
3289
+ [attr.disabled]="$disabled() ? '' : undefined"
3290
+ (input)="onUserInput($event)"
3291
+ [ngStyle]="inputStyle"
3292
+ [class]="cn(cx('pcInputText'), inputStyleClass)"
3293
+ [attr.placeholder]="placeholder"
3294
+ [attr.tabindex]="tabindex"
3295
+ [attr.inputmode]="touchUI ? 'off' : null"
3296
+ autocomplete="off"
3297
+ [pAutoFocus]="autofocus"
3298
+ [variant]="$variant()"
3299
+ [fluid]="hasFluid"
3300
+ [invalid]="invalid()"
3301
+ />
3302
+ <ng-container *ngIf="showClear && !$disabled() && value != null">
3303
+ <svg data-p-icon="times" *ngIf="!clearIconTemplate && !_clearIconTemplate" [class]="cx('clearIcon')" (click)="clear()" />
3304
+ <span *ngIf="clearIconTemplate || _clearIconTemplate" [class]="cx('clearIcon')" (click)="clear()">
3305
+ <ng-template *ngTemplateOutlet="clearIconTemplate || _clearIconTemplate"></ng-template>
3306
+ </span>
3307
+ </ng-container>
3308
+ <button
3309
+ type="button"
3310
+ [attr.aria-label]="iconButtonAriaLabel"
3311
+ aria-haspopup="dialog"
3312
+ [attr.aria-expanded]="overlayVisible ?? false"
3313
+ [attr.aria-controls]="overlayVisible ? panelId : null"
3314
+ *ngIf="showIcon && iconDisplay === 'button'"
3315
+ (click)="onButtonClick($event, inputfield)"
3316
+ [class]="cx('dropdown')"
3317
+ [disabled]="$disabled()"
3318
+ tabindex="0"
3319
+ >
3320
+ <span *ngIf="icon" [ngClass]="icon"></span>
3321
+ <ng-container *ngIf="!icon">
3322
+ <svg data-p-icon="calendar" *ngIf="!triggerIconTemplate && !_triggerIconTemplate" />
3323
+ <ng-template *ngTemplateOutlet="triggerIconTemplate || _triggerIconTemplate"></ng-template>
3324
+ </ng-container>
3325
+ </button>
3326
+ <ng-container *ngIf="iconDisplay === 'input' && showIcon">
3327
+ <span [class]="cx('inputIconContainer')">
3328
+ <svg data-p-icon="calendar" (click)="onButtonClick($event)" *ngIf="!inputIconTemplate && !_inputIconTemplate" [class]="cx('inputIcon')" />
3329
+
3330
+ <ng-container *ngTemplateOutlet="inputIconTemplate || _inputIconTemplate; context: { clickCallBack: onButtonClick.bind(this) }"></ng-container>
3331
+ </span>
3332
+ </ng-container>
3333
+ </ng-template>
3334
+ <div
3335
+ #contentWrapper
3336
+ [attr.id]="panelId"
3337
+ [ngStyle]="panelStyle"
3338
+ [class]="cn(cx('panel'), panelStyleClass)"
3339
+ [@overlayAnimation]="{
3340
+ value: 'visible',
3341
+ params: { showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions }
3342
+ }"
3343
+ [attr.aria-label]="getTranslation('chooseDate')"
3344
+ [attr.role]="inline ? null : 'dialog'"
3345
+ [attr.aria-modal]="inline ? null : 'true'"
3346
+ [@.disabled]="inline === true"
3347
+ (@overlayAnimation.start)="onOverlayAnimationStart($event)"
3348
+ (@overlayAnimation.done)="onOverlayAnimationDone($event)"
3349
+ (click)="onOverlayClick($event)"
3350
+ *ngIf="inline || overlayVisible"
3351
+ >
3352
+ <ng-content select="p-header"></ng-content>
3353
+ <ng-container *ngTemplateOutlet="headerTemplate || _headerTemplate"></ng-container>
3354
+ <ng-container *ngIf="!timeOnly">
3355
+ <div [class]="cx('calendarContainer')">
3356
+ <div [class]="cx('calendar')" *ngFor="let month of months; let i = index">
3357
+ <div [class]="cx('header')">
3358
+ <p-button
3359
+ rounded
3360
+ variant="text"
3361
+ severity="secondary"
3362
+ (keydown)="onContainerButtonKeydown($event)"
3363
+ [styleClass]="cx('pcPrevButton')"
3364
+ (onClick)="onPrevButtonClick($event)"
3365
+ [ngStyle]="{ visibility: i === 0 ? 'visible' : 'hidden' }"
3366
+ type="button"
3367
+ [ariaLabel]="prevIconAriaLabel"
3368
+ >
3369
+ <ng-template #icon>
3370
+ <svg data-p-icon="chevron-left" *ngIf="!previousIconTemplate && !_previousIconTemplate" />
3371
+ <span *ngIf="previousIconTemplate || _previousIconTemplate">
3372
+ <ng-template *ngTemplateOutlet="previousIconTemplate || _previousIconTemplate"></ng-template>
3373
+ </span>
3374
+ </ng-template>
3375
+ </p-button>
3376
+ <div [class]="cx('title')">
3377
+ <button
3378
+ *ngIf="currentView === 'date'"
3379
+ type="button"
3380
+ (click)="switchToMonthView($event)"
3381
+ (keydown)="onContainerButtonKeydown($event)"
3382
+ [class]="cx('selectMonth')"
3383
+ [attr.disabled]="switchViewButtonDisabled() ? '' : undefined"
3384
+ [attr.aria-label]="this.getTranslation('chooseMonth')"
3385
+ pRipple
3386
+ >
3387
+ {{ getMonthName(month.month) }}
3388
+ </button>
3389
+ <button
3390
+ *ngIf="currentView !== 'year'"
3391
+ type="button"
3392
+ (click)="switchToYearView($event)"
3393
+ (keydown)="onContainerButtonKeydown($event)"
3394
+ [class]="cx('selectYear')"
3395
+ [attr.disabled]="switchViewButtonDisabled() ? '' : undefined"
3396
+ [attr.aria-label]="getTranslation('chooseYear')"
3397
+ pRipple
3398
+ >
3399
+ {{ getYear(month) }}
3400
+ </button>
3401
+ <span [class]="cx('decade')" *ngIf="currentView === 'year'">
3402
+ <ng-container *ngIf="!decadeTemplate && !_decadeTemplate">{{ yearPickerValues()[0] }} - {{ yearPickerValues()[yearPickerValues().length - 1] }}</ng-container>
3403
+ <ng-container *ngTemplateOutlet="decadeTemplate || _decadeTemplate; context: { $implicit: yearPickerValues }"></ng-container>
3404
+ </span>
3405
+ </div>
3406
+ <p-button
3407
+ rounded
3408
+ variant="text"
3409
+ severity="secondary"
3410
+ (keydown)="onContainerButtonKeydown($event)"
3411
+ [styleClass]="cx('pcNextButton')"
3412
+ (onClick)="onNextButtonClick($event)"
3413
+ [ngStyle]="{ visibility: i === months.length - 1 ? 'visible' : 'hidden' }"
3414
+ [ariaLabel]="nextIconAriaLabel"
3415
+ >
3416
+ <ng-template #icon>
3417
+ <svg data-p-icon="chevron-right" *ngIf="!nextIconTemplate && !_nextIconTemplate" />
3418
+ <ng-container *ngIf="nextIconTemplate || _nextIconTemplate">
3419
+ <ng-template *ngTemplateOutlet="nextIconTemplate || _nextIconTemplate"></ng-template>
3420
+ </ng-container>
3421
+ </ng-template>
3422
+ </p-button>
3423
+ </div>
3424
+ <table [class]="cx('dayView')" role="grid" *ngIf="currentView === 'date'">
3425
+ <thead>
3426
+ <tr>
3427
+ <th *ngIf="showWeek" [class]="cx('weekHeader')">
3428
+ <span>{{ getTranslation('weekHeader') }}</span>
3429
+ </th>
3430
+ <th [class]="cx('weekDayCell')" scope="col" *ngFor="let weekDay of weekDays; let begin = first; let end = last">
3431
+ <span [class]="cx('weekDay')">{{ weekDay }}</span>
3432
+ </th>
3433
+ </tr>
3434
+ </thead>
3435
+ <tbody>
3436
+ <tr *ngFor="let week of month.dates; let j = index">
3437
+ <td *ngIf="showWeek" [class]="cx('weekNumber')">
3438
+ <span [class]="cx('weekLabelContainer')">
3439
+ {{ month.weekNumbers[j] }}
3440
+ </span>
3441
+ </td>
3442
+ <td *ngFor="let date of week" [attr.aria-label]="date.day" [class]="cx('dayCell', { date })">
3443
+ <ng-container *ngIf="date.otherMonth ? showOtherMonths : true">
3444
+ <span [ngClass]="dayClass(date)" (click)="onDateSelect($event, date)" draggable="false" [attr.data-date]="formatDateKey(formatDateMetaToDate(date))" (keydown)="onDateCellKeydown($event, date, i)" pRipple>
3445
+ <ng-container *ngIf="!dateTemplate && !_dateTemplate && (date.selectable || (!disabledDateTemplate && !_disabledDateTemplate))">{{ date.day }}</ng-container>
3446
+ <ng-container *ngIf="date.selectable || (!disabledDateTemplate && !_disabledDateTemplate)">
3447
+ <ng-container *ngTemplateOutlet="dateTemplate || _dateTemplate; context: { $implicit: date }"></ng-container>
3448
+ </ng-container>
3449
+ <ng-container *ngIf="!date.selectable">
3450
+ <ng-container *ngTemplateOutlet="disabledDateTemplate || _disabledDateTemplate; context: { $implicit: date }"></ng-container>
3451
+ </ng-container>
3452
+ </span>
3453
+ <div *ngIf="isSelected(date)" class="p-hidden-accessible" aria-live="polite">
3454
+ {{ date.day }}
3455
+ </div>
3456
+ </ng-container>
3457
+ </td>
3458
+ </tr>
3459
+ </tbody>
3460
+ </table>
3461
+ </div>
3462
+ </div>
3463
+ <div [class]="cx('monthView')" *ngIf="currentView === 'month'">
3464
+ <span *ngFor="let m of monthPickerValues(); let i = index" (click)="onMonthSelect($event, i)" (keydown)="onMonthCellKeydown($event, i)" [class]="cx('month', { month: m, index: i })" pRipple>
3465
+ {{ m }}
3466
+ <div *ngIf="isMonthSelected(i)" class="p-hidden-accessible" aria-live="polite">
3467
+ {{ m }}
3468
+ </div>
3469
+ </span>
3470
+ </div>
3471
+ <div [class]="cx('yearView')" *ngIf="currentView === 'year'">
3472
+ <span *ngFor="let y of yearPickerValues()" (click)="onYearSelect($event, y)" (keydown)="onYearCellKeydown($event, y)" [class]="cx('year', { year: y })" pRipple>
3473
+ {{ y }}
3474
+ <div *ngIf="isYearSelected(y)" class="p-hidden-accessible" aria-live="polite">
3475
+ {{ y }}
3476
+ </div>
3477
+ </span>
3478
+ </div>
3479
+ </ng-container>
3480
+ <div [class]="cx('timePicker')" *ngIf="(showTime || timeOnly) && currentView === 'date'">
3481
+ <div [class]="cx('hourPicker')">
3482
+ <p-button
3483
+ rounded
3484
+ variant="text"
3485
+ severity="secondary"
3486
+ [styleClass]="cx('pcIncrementButton')"
3487
+ (keydown)="onContainerButtonKeydown($event)"
3488
+ (keydown.enter)="incrementHour($event)"
3489
+ (keydown.space)="incrementHour($event)"
3490
+ (mousedown)="onTimePickerElementMouseDown($event, 0, 1)"
3491
+ (mouseup)="onTimePickerElementMouseUp($event)"
3492
+ (keyup.enter)="onTimePickerElementMouseUp($event)"
3493
+ (keyup.space)="onTimePickerElementMouseUp($event)"
3494
+ (mouseleave)="onTimePickerElementMouseLeave()"
3495
+ [attr.aria-label]="getTranslation('nextHour')"
3496
+ >
3497
+ <ng-template #icon>
3498
+ <svg data-p-icon="chevron-up" *ngIf="!incrementIconTemplate && !_incrementIconTemplate" />
3499
+ <ng-template *ngTemplateOutlet="incrementIconTemplate || _incrementIconTemplate"></ng-template>
3500
+ </ng-template>
3501
+ </p-button>
3502
+ <span><ng-container *ngIf="currentHour < 10">0</ng-container>{{ currentHour }}</span>
3503
+ <p-button
3504
+ rounded
3505
+ variant="text"
3506
+ severity="secondary"
3507
+ [styleClass]="cx('pcDecrementButton')"
3508
+ (keydown)="onContainerButtonKeydown($event)"
3509
+ (keydown.enter)="decrementHour($event)"
3510
+ (keydown.space)="decrementHour($event)"
3511
+ (mousedown)="onTimePickerElementMouseDown($event, 0, -1)"
3512
+ (mouseup)="onTimePickerElementMouseUp($event)"
3513
+ (keyup.enter)="onTimePickerElementMouseUp($event)"
3514
+ (keyup.space)="onTimePickerElementMouseUp($event)"
3515
+ (mouseleave)="onTimePickerElementMouseLeave()"
3516
+ [attr.aria-label]="getTranslation('prevHour')"
3517
+ >
3518
+ <ng-template #icon>
3519
+ <svg data-p-icon="chevron-down" *ngIf="!decrementIconTemplate && !_decrementIconTemplate" />
3520
+ <ng-template *ngTemplateOutlet="decrementIconTemplate || _decrementIconTemplate"></ng-template>
3521
+ </ng-template>
3522
+ </p-button>
3523
+ </div>
3524
+ <div class="p-datepicker-separator">
3525
+ <span>{{ timeSeparator }}</span>
3526
+ </div>
3527
+ <div [class]="cx('minutePicker')">
3528
+ <p-button
3529
+ rounded
3530
+ variant="text"
3531
+ severity="secondary"
3532
+ [styleClass]="cx('pcIncrementButton')"
3533
+ (keydown)="onContainerButtonKeydown($event)"
3534
+ (keydown.enter)="incrementMinute($event)"
3535
+ (keydown.space)="incrementMinute($event)"
3536
+ (mousedown)="onTimePickerElementMouseDown($event, 1, 1)"
3537
+ (mouseup)="onTimePickerElementMouseUp($event)"
3538
+ (keyup.enter)="onTimePickerElementMouseUp($event)"
3539
+ (keyup.space)="onTimePickerElementMouseUp($event)"
3540
+ (mouseleave)="onTimePickerElementMouseLeave()"
3541
+ [attr.aria-label]="getTranslation('nextMinute')"
3542
+ >
3543
+ <ng-template #icon>
3544
+ <svg data-p-icon="chevron-up" *ngIf="!incrementIconTemplate && !_incrementIconTemplate" />
3545
+ <ng-template *ngTemplateOutlet="incrementIconTemplate || _incrementIconTemplate"></ng-template>
3546
+ </ng-template>
3547
+ </p-button>
3548
+ <span><ng-container *ngIf="currentMinute < 10">0</ng-container>{{ currentMinute }}</span>
3549
+ <p-button
3550
+ rounded
3551
+ variant="text"
3552
+ severity="secondary"
3553
+ [styleClass]="cx('pcDecrementButton')"
3554
+ (keydown)="onContainerButtonKeydown($event)"
3555
+ (keydown.enter)="decrementMinute($event)"
3556
+ (keydown.space)="decrementMinute($event)"
3557
+ (mousedown)="onTimePickerElementMouseDown($event, 1, -1)"
3558
+ (mouseup)="onTimePickerElementMouseUp($event)"
3559
+ (keyup.enter)="onTimePickerElementMouseUp($event)"
3560
+ (keyup.space)="onTimePickerElementMouseUp($event)"
3561
+ (mouseleave)="onTimePickerElementMouseLeave()"
3562
+ [attr.aria-label]="getTranslation('prevMinute')"
3563
+ >
3564
+ <ng-template #icon>
3565
+ <svg data-p-icon="chevron-down" *ngIf="!decrementIconTemplate && !_decrementIconTemplate" />
3566
+ <ng-template *ngTemplateOutlet="decrementIconTemplate || _decrementIconTemplate"></ng-template>
3567
+ </ng-template>
3568
+ </p-button>
3569
+ </div>
3570
+ <div [class]="cx('separator')" *ngIf="showSeconds">
3571
+ <span>{{ timeSeparator }}</span>
3572
+ </div>
3573
+ <div [class]="cx('secondPicker')" *ngIf="showSeconds">
3574
+ <p-button
3575
+ rounded
3576
+ variant="text"
3577
+ severity="secondary"
3578
+ [styleClass]="cx('pcIncrementButton')"
3579
+ (keydown)="onContainerButtonKeydown($event)"
3580
+ (keydown.enter)="incrementSecond($event)"
3581
+ (keydown.space)="incrementSecond($event)"
3582
+ (mousedown)="onTimePickerElementMouseDown($event, 2, 1)"
3583
+ (mouseup)="onTimePickerElementMouseUp($event)"
3584
+ (keyup.enter)="onTimePickerElementMouseUp($event)"
3585
+ (keyup.space)="onTimePickerElementMouseUp($event)"
3586
+ (mouseleave)="onTimePickerElementMouseLeave()"
3587
+ [attr.aria-label]="getTranslation('nextSecond')"
3588
+ >
3589
+ <ng-template #icon>
3590
+ <svg data-p-icon="chevron-up" *ngIf="!incrementIconTemplate && !_incrementIconTemplate" />
3591
+ <ng-template *ngTemplateOutlet="incrementIconTemplate || _incrementIconTemplate"></ng-template>
3592
+ </ng-template>
3593
+ </p-button>
3594
+ <span><ng-container *ngIf="currentSecond < 10">0</ng-container>{{ currentSecond }}</span>
3595
+ <p-button
3596
+ rounded
3597
+ variant="text"
3598
+ severity="secondary"
3599
+ [styleClass]="cx('pcDecrementButton')"
3600
+ (keydown)="onContainerButtonKeydown($event)"
3601
+ (keydown.enter)="decrementSecond($event)"
3602
+ (keydown.space)="decrementSecond($event)"
3603
+ (mousedown)="onTimePickerElementMouseDown($event, 2, -1)"
3604
+ (mouseup)="onTimePickerElementMouseUp($event)"
3605
+ (keyup.enter)="onTimePickerElementMouseUp($event)"
3606
+ (keyup.space)="onTimePickerElementMouseUp($event)"
3607
+ (mouseleave)="onTimePickerElementMouseLeave()"
3608
+ [attr.aria-label]="getTranslation('prevSecond')"
3609
+ >
3610
+ <ng-template #icon>
3611
+ <svg data-p-icon="chevron-down" *ngIf="!decrementIconTemplate && !_decrementIconTemplate" />
3612
+ <ng-template *ngTemplateOutlet="decrementIconTemplate || _decrementIconTemplate"></ng-template>
3613
+ </ng-template>
3614
+ </p-button>
3615
+ </div>
3616
+ <div [class]="cx('separator')" *ngIf="hourFormat == '12'">
3617
+ <span>{{ timeSeparator }}</span>
3618
+ </div>
3619
+ <div [class]="cx('ampmPicker')" *ngIf="hourFormat == '12'">
3620
+ <p-button
3621
+ text
3622
+ rounded
3623
+ severity="secondary"
3624
+ [styleClass]="cx('pcIncrementButton')"
3625
+ (keydown)="onContainerButtonKeydown($event)"
3626
+ (onClick)="toggleAMPM($event)"
3627
+ (keydown.enter)="toggleAMPM($event)"
3628
+ [attr.aria-label]="getTranslation('am')"
3629
+ >
3630
+ <ng-template #icon>
3631
+ <svg data-p-icon="chevron-up" *ngIf="!incrementIconTemplate && !_incrementIconTemplate" />
3632
+ <ng-template *ngTemplateOutlet="incrementIconTemplate || _incrementIconTemplate"></ng-template>
3633
+ </ng-template>
3634
+ </p-button>
3635
+ <span>{{ pm ? 'PM' : 'AM' }}</span>
3636
+ <p-button
3637
+ text
3638
+ rounded
3639
+ severity="secondary"
3640
+ [styleClass]="cx('pcDecrementButton')"
3641
+ (keydown)="onContainerButtonKeydown($event)"
3642
+ (click)="toggleAMPM($event)"
3643
+ (keydown.enter)="toggleAMPM($event)"
3644
+ [attr.aria-label]="getTranslation('pm')"
3645
+ >
3646
+ <ng-template #icon>
3647
+ <svg data-p-icon="chevron-down" *ngIf="!decrementIconTemplate && !_decrementIconTemplate" />
3648
+ <ng-template *ngTemplateOutlet="decrementIconTemplate || _decrementIconTemplate"></ng-template>
3649
+ </ng-template>
3650
+ </p-button>
3651
+ </div>
3652
+ </div>
3653
+ <div [class]="cx('buttonbar')" *ngIf="showButtonBar">
3654
+ <p-button
3655
+ size="small"
3656
+ [styleClass]="cx('pcTodayButton')"
3657
+ [label]="getTranslation('today')"
3658
+ (keydown)="onContainerButtonKeydown($event)"
3659
+ (onClick)="onTodayButtonClick($event)"
3660
+ [ngClass]="todayButtonStyleClass"
3661
+ severity="secondary"
3662
+ variant="text"
3663
+ size="small"
3664
+ />
3665
+ <p-button
3666
+ size="small"
3667
+ [styleClass]="cx('pcClearButton')"
3668
+ [label]="getTranslation('clear')"
3669
+ (keydown)="onContainerButtonKeydown($event)"
3670
+ (onClick)="onClearButtonClick($event)"
3671
+ [ngClass]="clearButtonStyleClass"
3672
+ severity="secondary"
3673
+ variant="text"
3674
+ size="small"
3675
+ />
3676
+ </div>
3677
+ <ng-content select="p-footer"></ng-content>
3678
+ <ng-container *ngTemplateOutlet="footerTemplate || _footerTemplate"></ng-container>
3679
+ </div>
3680
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "buttonProps", "autofocus", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "directive", type: Ripple, selector: "[pRipple]" }, { kind: "component", type: ChevronLeftIcon, selector: "[data-p-icon=\"chevron-left\"]" }, { kind: "component", type: ChevronRightIcon, selector: "[data-p-icon=\"chevron-right\"]" }, { kind: "component", type: ChevronUpIcon, selector: "[data-p-icon=\"chevron-up\"]" }, { kind: "component", type: ChevronDownIcon, selector: "[data-p-icon=\"chevron-down\"]" }, { kind: "component", type: TimesIcon, selector: "[data-p-icon=\"times\"]" }, { kind: "component", type: CalendarIcon, selector: "[data-p-icon=\"calendar\"]" }, { kind: "directive", type: AutoFocus, selector: "[pAutoFocus]", inputs: ["pAutoFocus"] }, { kind: "directive", type: InputText, selector: "[pInputText]", inputs: ["pSize", "variant", "fluid", "invalid"] }, { kind: "ngmodule", type: SharedModule }], animations: [
3681
+ trigger('overlayAnimation', [
3682
+ state('visibleTouchUI', style$1({
3683
+ transform: 'translate(-50%,-50%)',
3684
+ opacity: 1
3685
+ })),
3686
+ transition('void => visible', [style$1({ opacity: 0, transform: 'scaleY(0.8)' }), animate('{{showTransitionParams}}', style$1({ opacity: 1, transform: '*' }))]),
3687
+ transition('visible => void', [animate('{{hideTransitionParams}}', style$1({ opacity: 0 }))]),
3688
+ transition('void => visibleTouchUI', [style$1({ opacity: 0, transform: 'translate3d(-50%, -40%, 0) scale(0.9)' }), animate('{{showTransitionParams}}')]),
3689
+ transition('visibleTouchUI => void', [
3690
+ animate('{{hideTransitionParams}}', style$1({
3691
+ opacity: 0,
3692
+ transform: 'translate3d(-50%, -40%, 0) scale(0.9)'
3693
+ }))
3694
+ ])
3695
+ ])
3696
+ ], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
3697
+ }
3698
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: DatePicker, decorators: [{
3699
+ type: Component,
3700
+ args: [{
3701
+ selector: 'p-datePicker, p-datepicker, p-date-picker',
3702
+ standalone: true,
3703
+ imports: [CommonModule, Button, Ripple, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronDownIcon, TimesIcon, CalendarIcon, AutoFocus, InputText, SharedModule],
3704
+ template: `
3705
+ <ng-template [ngIf]="!inline">
3706
+ <input
3707
+ #inputfield
3708
+ pInputText
3709
+ [pSize]="size()"
3710
+ [attr.size]="inputSize()"
3711
+ type="text"
3712
+ role="combobox"
3713
+ [attr.id]="inputId"
3714
+ [attr.name]="name()"
3715
+ [attr.aria-required]="required()"
3716
+ aria-autocomplete="none"
3717
+ aria-haspopup="dialog"
3718
+ [attr.aria-expanded]="overlayVisible ?? false"
3719
+ [attr.aria-controls]="overlayVisible ? panelId : null"
3720
+ [attr.aria-labelledby]="ariaLabelledBy"
3721
+ [attr.aria-label]="ariaLabel"
3722
+ [value]="inputFieldValue"
3723
+ (focus)="onInputFocus($event)"
3724
+ (keydown)="onInputKeydown($event)"
3725
+ (click)="onInputClick()"
3726
+ (blur)="onInputBlur($event)"
3727
+ [attr.required]="required() ? '' : undefined"
3728
+ [attr.readonly]="readonlyInput ? '' : undefined"
3729
+ [attr.disabled]="$disabled() ? '' : undefined"
3730
+ (input)="onUserInput($event)"
3731
+ [ngStyle]="inputStyle"
3732
+ [class]="cn(cx('pcInputText'), inputStyleClass)"
3733
+ [attr.placeholder]="placeholder"
3734
+ [attr.tabindex]="tabindex"
3735
+ [attr.inputmode]="touchUI ? 'off' : null"
3736
+ autocomplete="off"
3737
+ [pAutoFocus]="autofocus"
3738
+ [variant]="$variant()"
3739
+ [fluid]="hasFluid"
3740
+ [invalid]="invalid()"
3741
+ />
3742
+ <ng-container *ngIf="showClear && !$disabled() && value != null">
3743
+ <svg data-p-icon="times" *ngIf="!clearIconTemplate && !_clearIconTemplate" [class]="cx('clearIcon')" (click)="clear()" />
3744
+ <span *ngIf="clearIconTemplate || _clearIconTemplate" [class]="cx('clearIcon')" (click)="clear()">
3745
+ <ng-template *ngTemplateOutlet="clearIconTemplate || _clearIconTemplate"></ng-template>
3746
+ </span>
3747
+ </ng-container>
3748
+ <button
3749
+ type="button"
3750
+ [attr.aria-label]="iconButtonAriaLabel"
3751
+ aria-haspopup="dialog"
3752
+ [attr.aria-expanded]="overlayVisible ?? false"
3753
+ [attr.aria-controls]="overlayVisible ? panelId : null"
3754
+ *ngIf="showIcon && iconDisplay === 'button'"
3755
+ (click)="onButtonClick($event, inputfield)"
3756
+ [class]="cx('dropdown')"
3757
+ [disabled]="$disabled()"
3758
+ tabindex="0"
3759
+ >
3760
+ <span *ngIf="icon" [ngClass]="icon"></span>
3761
+ <ng-container *ngIf="!icon">
3762
+ <svg data-p-icon="calendar" *ngIf="!triggerIconTemplate && !_triggerIconTemplate" />
3763
+ <ng-template *ngTemplateOutlet="triggerIconTemplate || _triggerIconTemplate"></ng-template>
3764
+ </ng-container>
3765
+ </button>
3766
+ <ng-container *ngIf="iconDisplay === 'input' && showIcon">
3767
+ <span [class]="cx('inputIconContainer')">
3768
+ <svg data-p-icon="calendar" (click)="onButtonClick($event)" *ngIf="!inputIconTemplate && !_inputIconTemplate" [class]="cx('inputIcon')" />
3769
+
3770
+ <ng-container *ngTemplateOutlet="inputIconTemplate || _inputIconTemplate; context: { clickCallBack: onButtonClick.bind(this) }"></ng-container>
3771
+ </span>
3772
+ </ng-container>
3773
+ </ng-template>
3774
+ <div
3775
+ #contentWrapper
3776
+ [attr.id]="panelId"
3777
+ [ngStyle]="panelStyle"
3778
+ [class]="cn(cx('panel'), panelStyleClass)"
3779
+ [@overlayAnimation]="{
3780
+ value: 'visible',
3781
+ params: { showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions }
3782
+ }"
3783
+ [attr.aria-label]="getTranslation('chooseDate')"
3784
+ [attr.role]="inline ? null : 'dialog'"
3785
+ [attr.aria-modal]="inline ? null : 'true'"
3786
+ [@.disabled]="inline === true"
3787
+ (@overlayAnimation.start)="onOverlayAnimationStart($event)"
3788
+ (@overlayAnimation.done)="onOverlayAnimationDone($event)"
3789
+ (click)="onOverlayClick($event)"
3790
+ *ngIf="inline || overlayVisible"
3791
+ >
3792
+ <ng-content select="p-header"></ng-content>
3793
+ <ng-container *ngTemplateOutlet="headerTemplate || _headerTemplate"></ng-container>
3794
+ <ng-container *ngIf="!timeOnly">
3795
+ <div [class]="cx('calendarContainer')">
3796
+ <div [class]="cx('calendar')" *ngFor="let month of months; let i = index">
3797
+ <div [class]="cx('header')">
3798
+ <p-button
3799
+ rounded
3800
+ variant="text"
3801
+ severity="secondary"
3802
+ (keydown)="onContainerButtonKeydown($event)"
3803
+ [styleClass]="cx('pcPrevButton')"
3804
+ (onClick)="onPrevButtonClick($event)"
3805
+ [ngStyle]="{ visibility: i === 0 ? 'visible' : 'hidden' }"
3806
+ type="button"
3807
+ [ariaLabel]="prevIconAriaLabel"
3808
+ >
3809
+ <ng-template #icon>
3810
+ <svg data-p-icon="chevron-left" *ngIf="!previousIconTemplate && !_previousIconTemplate" />
3811
+ <span *ngIf="previousIconTemplate || _previousIconTemplate">
3812
+ <ng-template *ngTemplateOutlet="previousIconTemplate || _previousIconTemplate"></ng-template>
3813
+ </span>
3814
+ </ng-template>
3815
+ </p-button>
3816
+ <div [class]="cx('title')">
3817
+ <button
3818
+ *ngIf="currentView === 'date'"
3819
+ type="button"
3820
+ (click)="switchToMonthView($event)"
3821
+ (keydown)="onContainerButtonKeydown($event)"
3822
+ [class]="cx('selectMonth')"
3823
+ [attr.disabled]="switchViewButtonDisabled() ? '' : undefined"
3824
+ [attr.aria-label]="this.getTranslation('chooseMonth')"
3825
+ pRipple
3826
+ >
3827
+ {{ getMonthName(month.month) }}
3828
+ </button>
3829
+ <button
3830
+ *ngIf="currentView !== 'year'"
3831
+ type="button"
3832
+ (click)="switchToYearView($event)"
3833
+ (keydown)="onContainerButtonKeydown($event)"
3834
+ [class]="cx('selectYear')"
3835
+ [attr.disabled]="switchViewButtonDisabled() ? '' : undefined"
3836
+ [attr.aria-label]="getTranslation('chooseYear')"
3837
+ pRipple
3838
+ >
3839
+ {{ getYear(month) }}
3840
+ </button>
3841
+ <span [class]="cx('decade')" *ngIf="currentView === 'year'">
3842
+ <ng-container *ngIf="!decadeTemplate && !_decadeTemplate">{{ yearPickerValues()[0] }} - {{ yearPickerValues()[yearPickerValues().length - 1] }}</ng-container>
3843
+ <ng-container *ngTemplateOutlet="decadeTemplate || _decadeTemplate; context: { $implicit: yearPickerValues }"></ng-container>
3844
+ </span>
3845
+ </div>
3846
+ <p-button
3847
+ rounded
3848
+ variant="text"
3849
+ severity="secondary"
3850
+ (keydown)="onContainerButtonKeydown($event)"
3851
+ [styleClass]="cx('pcNextButton')"
3852
+ (onClick)="onNextButtonClick($event)"
3853
+ [ngStyle]="{ visibility: i === months.length - 1 ? 'visible' : 'hidden' }"
3854
+ [ariaLabel]="nextIconAriaLabel"
3855
+ >
3856
+ <ng-template #icon>
3857
+ <svg data-p-icon="chevron-right" *ngIf="!nextIconTemplate && !_nextIconTemplate" />
3858
+ <ng-container *ngIf="nextIconTemplate || _nextIconTemplate">
3859
+ <ng-template *ngTemplateOutlet="nextIconTemplate || _nextIconTemplate"></ng-template>
3860
+ </ng-container>
3861
+ </ng-template>
3862
+ </p-button>
3863
+ </div>
3864
+ <table [class]="cx('dayView')" role="grid" *ngIf="currentView === 'date'">
3865
+ <thead>
3866
+ <tr>
3867
+ <th *ngIf="showWeek" [class]="cx('weekHeader')">
3868
+ <span>{{ getTranslation('weekHeader') }}</span>
3869
+ </th>
3870
+ <th [class]="cx('weekDayCell')" scope="col" *ngFor="let weekDay of weekDays; let begin = first; let end = last">
3871
+ <span [class]="cx('weekDay')">{{ weekDay }}</span>
3872
+ </th>
3873
+ </tr>
3874
+ </thead>
3875
+ <tbody>
3876
+ <tr *ngFor="let week of month.dates; let j = index">
3877
+ <td *ngIf="showWeek" [class]="cx('weekNumber')">
3878
+ <span [class]="cx('weekLabelContainer')">
3879
+ {{ month.weekNumbers[j] }}
3880
+ </span>
3881
+ </td>
3882
+ <td *ngFor="let date of week" [attr.aria-label]="date.day" [class]="cx('dayCell', { date })">
3883
+ <ng-container *ngIf="date.otherMonth ? showOtherMonths : true">
3884
+ <span [ngClass]="dayClass(date)" (click)="onDateSelect($event, date)" draggable="false" [attr.data-date]="formatDateKey(formatDateMetaToDate(date))" (keydown)="onDateCellKeydown($event, date, i)" pRipple>
3885
+ <ng-container *ngIf="!dateTemplate && !_dateTemplate && (date.selectable || (!disabledDateTemplate && !_disabledDateTemplate))">{{ date.day }}</ng-container>
3886
+ <ng-container *ngIf="date.selectable || (!disabledDateTemplate && !_disabledDateTemplate)">
3887
+ <ng-container *ngTemplateOutlet="dateTemplate || _dateTemplate; context: { $implicit: date }"></ng-container>
3888
+ </ng-container>
3889
+ <ng-container *ngIf="!date.selectable">
3890
+ <ng-container *ngTemplateOutlet="disabledDateTemplate || _disabledDateTemplate; context: { $implicit: date }"></ng-container>
3891
+ </ng-container>
3892
+ </span>
3893
+ <div *ngIf="isSelected(date)" class="p-hidden-accessible" aria-live="polite">
3894
+ {{ date.day }}
3895
+ </div>
3896
+ </ng-container>
3897
+ </td>
3898
+ </tr>
3899
+ </tbody>
3900
+ </table>
3901
+ </div>
3902
+ </div>
3903
+ <div [class]="cx('monthView')" *ngIf="currentView === 'month'">
3904
+ <span *ngFor="let m of monthPickerValues(); let i = index" (click)="onMonthSelect($event, i)" (keydown)="onMonthCellKeydown($event, i)" [class]="cx('month', { month: m, index: i })" pRipple>
3905
+ {{ m }}
3906
+ <div *ngIf="isMonthSelected(i)" class="p-hidden-accessible" aria-live="polite">
3907
+ {{ m }}
3908
+ </div>
3909
+ </span>
3910
+ </div>
3911
+ <div [class]="cx('yearView')" *ngIf="currentView === 'year'">
3912
+ <span *ngFor="let y of yearPickerValues()" (click)="onYearSelect($event, y)" (keydown)="onYearCellKeydown($event, y)" [class]="cx('year', { year: y })" pRipple>
3913
+ {{ y }}
3914
+ <div *ngIf="isYearSelected(y)" class="p-hidden-accessible" aria-live="polite">
3915
+ {{ y }}
3916
+ </div>
3917
+ </span>
3918
+ </div>
3919
+ </ng-container>
3920
+ <div [class]="cx('timePicker')" *ngIf="(showTime || timeOnly) && currentView === 'date'">
3921
+ <div [class]="cx('hourPicker')">
3922
+ <p-button
3923
+ rounded
3924
+ variant="text"
3925
+ severity="secondary"
3926
+ [styleClass]="cx('pcIncrementButton')"
3927
+ (keydown)="onContainerButtonKeydown($event)"
3928
+ (keydown.enter)="incrementHour($event)"
3929
+ (keydown.space)="incrementHour($event)"
3930
+ (mousedown)="onTimePickerElementMouseDown($event, 0, 1)"
3931
+ (mouseup)="onTimePickerElementMouseUp($event)"
3932
+ (keyup.enter)="onTimePickerElementMouseUp($event)"
3933
+ (keyup.space)="onTimePickerElementMouseUp($event)"
3934
+ (mouseleave)="onTimePickerElementMouseLeave()"
3935
+ [attr.aria-label]="getTranslation('nextHour')"
3936
+ >
3937
+ <ng-template #icon>
3938
+ <svg data-p-icon="chevron-up" *ngIf="!incrementIconTemplate && !_incrementIconTemplate" />
3939
+ <ng-template *ngTemplateOutlet="incrementIconTemplate || _incrementIconTemplate"></ng-template>
3940
+ </ng-template>
3941
+ </p-button>
3942
+ <span><ng-container *ngIf="currentHour < 10">0</ng-container>{{ currentHour }}</span>
3943
+ <p-button
3944
+ rounded
3945
+ variant="text"
3946
+ severity="secondary"
3947
+ [styleClass]="cx('pcDecrementButton')"
3948
+ (keydown)="onContainerButtonKeydown($event)"
3949
+ (keydown.enter)="decrementHour($event)"
3950
+ (keydown.space)="decrementHour($event)"
3951
+ (mousedown)="onTimePickerElementMouseDown($event, 0, -1)"
3952
+ (mouseup)="onTimePickerElementMouseUp($event)"
3953
+ (keyup.enter)="onTimePickerElementMouseUp($event)"
3954
+ (keyup.space)="onTimePickerElementMouseUp($event)"
3955
+ (mouseleave)="onTimePickerElementMouseLeave()"
3956
+ [attr.aria-label]="getTranslation('prevHour')"
3957
+ >
3958
+ <ng-template #icon>
3959
+ <svg data-p-icon="chevron-down" *ngIf="!decrementIconTemplate && !_decrementIconTemplate" />
3960
+ <ng-template *ngTemplateOutlet="decrementIconTemplate || _decrementIconTemplate"></ng-template>
3961
+ </ng-template>
3962
+ </p-button>
3963
+ </div>
3964
+ <div class="p-datepicker-separator">
3965
+ <span>{{ timeSeparator }}</span>
3966
+ </div>
3967
+ <div [class]="cx('minutePicker')">
3968
+ <p-button
3969
+ rounded
3970
+ variant="text"
3971
+ severity="secondary"
3972
+ [styleClass]="cx('pcIncrementButton')"
3973
+ (keydown)="onContainerButtonKeydown($event)"
3974
+ (keydown.enter)="incrementMinute($event)"
3975
+ (keydown.space)="incrementMinute($event)"
3976
+ (mousedown)="onTimePickerElementMouseDown($event, 1, 1)"
3977
+ (mouseup)="onTimePickerElementMouseUp($event)"
3978
+ (keyup.enter)="onTimePickerElementMouseUp($event)"
3979
+ (keyup.space)="onTimePickerElementMouseUp($event)"
3980
+ (mouseleave)="onTimePickerElementMouseLeave()"
3981
+ [attr.aria-label]="getTranslation('nextMinute')"
3982
+ >
3983
+ <ng-template #icon>
3984
+ <svg data-p-icon="chevron-up" *ngIf="!incrementIconTemplate && !_incrementIconTemplate" />
3985
+ <ng-template *ngTemplateOutlet="incrementIconTemplate || _incrementIconTemplate"></ng-template>
3986
+ </ng-template>
3987
+ </p-button>
3988
+ <span><ng-container *ngIf="currentMinute < 10">0</ng-container>{{ currentMinute }}</span>
3989
+ <p-button
3990
+ rounded
3991
+ variant="text"
3992
+ severity="secondary"
3993
+ [styleClass]="cx('pcDecrementButton')"
3994
+ (keydown)="onContainerButtonKeydown($event)"
3995
+ (keydown.enter)="decrementMinute($event)"
3996
+ (keydown.space)="decrementMinute($event)"
3997
+ (mousedown)="onTimePickerElementMouseDown($event, 1, -1)"
3998
+ (mouseup)="onTimePickerElementMouseUp($event)"
3999
+ (keyup.enter)="onTimePickerElementMouseUp($event)"
4000
+ (keyup.space)="onTimePickerElementMouseUp($event)"
4001
+ (mouseleave)="onTimePickerElementMouseLeave()"
4002
+ [attr.aria-label]="getTranslation('prevMinute')"
4003
+ >
4004
+ <ng-template #icon>
4005
+ <svg data-p-icon="chevron-down" *ngIf="!decrementIconTemplate && !_decrementIconTemplate" />
4006
+ <ng-template *ngTemplateOutlet="decrementIconTemplate || _decrementIconTemplate"></ng-template>
4007
+ </ng-template>
4008
+ </p-button>
4009
+ </div>
4010
+ <div [class]="cx('separator')" *ngIf="showSeconds">
4011
+ <span>{{ timeSeparator }}</span>
4012
+ </div>
4013
+ <div [class]="cx('secondPicker')" *ngIf="showSeconds">
4014
+ <p-button
4015
+ rounded
4016
+ variant="text"
4017
+ severity="secondary"
4018
+ [styleClass]="cx('pcIncrementButton')"
4019
+ (keydown)="onContainerButtonKeydown($event)"
4020
+ (keydown.enter)="incrementSecond($event)"
4021
+ (keydown.space)="incrementSecond($event)"
4022
+ (mousedown)="onTimePickerElementMouseDown($event, 2, 1)"
4023
+ (mouseup)="onTimePickerElementMouseUp($event)"
4024
+ (keyup.enter)="onTimePickerElementMouseUp($event)"
4025
+ (keyup.space)="onTimePickerElementMouseUp($event)"
4026
+ (mouseleave)="onTimePickerElementMouseLeave()"
4027
+ [attr.aria-label]="getTranslation('nextSecond')"
4028
+ >
4029
+ <ng-template #icon>
4030
+ <svg data-p-icon="chevron-up" *ngIf="!incrementIconTemplate && !_incrementIconTemplate" />
4031
+ <ng-template *ngTemplateOutlet="incrementIconTemplate || _incrementIconTemplate"></ng-template>
4032
+ </ng-template>
4033
+ </p-button>
4034
+ <span><ng-container *ngIf="currentSecond < 10">0</ng-container>{{ currentSecond }}</span>
4035
+ <p-button
4036
+ rounded
4037
+ variant="text"
4038
+ severity="secondary"
4039
+ [styleClass]="cx('pcDecrementButton')"
4040
+ (keydown)="onContainerButtonKeydown($event)"
4041
+ (keydown.enter)="decrementSecond($event)"
4042
+ (keydown.space)="decrementSecond($event)"
4043
+ (mousedown)="onTimePickerElementMouseDown($event, 2, -1)"
4044
+ (mouseup)="onTimePickerElementMouseUp($event)"
4045
+ (keyup.enter)="onTimePickerElementMouseUp($event)"
4046
+ (keyup.space)="onTimePickerElementMouseUp($event)"
4047
+ (mouseleave)="onTimePickerElementMouseLeave()"
4048
+ [attr.aria-label]="getTranslation('prevSecond')"
4049
+ >
4050
+ <ng-template #icon>
4051
+ <svg data-p-icon="chevron-down" *ngIf="!decrementIconTemplate && !_decrementIconTemplate" />
4052
+ <ng-template *ngTemplateOutlet="decrementIconTemplate || _decrementIconTemplate"></ng-template>
4053
+ </ng-template>
4054
+ </p-button>
4055
+ </div>
4056
+ <div [class]="cx('separator')" *ngIf="hourFormat == '12'">
4057
+ <span>{{ timeSeparator }}</span>
4058
+ </div>
4059
+ <div [class]="cx('ampmPicker')" *ngIf="hourFormat == '12'">
4060
+ <p-button
4061
+ text
4062
+ rounded
4063
+ severity="secondary"
4064
+ [styleClass]="cx('pcIncrementButton')"
4065
+ (keydown)="onContainerButtonKeydown($event)"
4066
+ (onClick)="toggleAMPM($event)"
4067
+ (keydown.enter)="toggleAMPM($event)"
4068
+ [attr.aria-label]="getTranslation('am')"
4069
+ >
4070
+ <ng-template #icon>
4071
+ <svg data-p-icon="chevron-up" *ngIf="!incrementIconTemplate && !_incrementIconTemplate" />
4072
+ <ng-template *ngTemplateOutlet="incrementIconTemplate || _incrementIconTemplate"></ng-template>
4073
+ </ng-template>
4074
+ </p-button>
4075
+ <span>{{ pm ? 'PM' : 'AM' }}</span>
4076
+ <p-button
4077
+ text
4078
+ rounded
4079
+ severity="secondary"
4080
+ [styleClass]="cx('pcDecrementButton')"
4081
+ (keydown)="onContainerButtonKeydown($event)"
4082
+ (click)="toggleAMPM($event)"
4083
+ (keydown.enter)="toggleAMPM($event)"
4084
+ [attr.aria-label]="getTranslation('pm')"
4085
+ >
4086
+ <ng-template #icon>
4087
+ <svg data-p-icon="chevron-down" *ngIf="!decrementIconTemplate && !_decrementIconTemplate" />
4088
+ <ng-template *ngTemplateOutlet="decrementIconTemplate || _decrementIconTemplate"></ng-template>
4089
+ </ng-template>
4090
+ </p-button>
4091
+ </div>
4092
+ </div>
4093
+ <div [class]="cx('buttonbar')" *ngIf="showButtonBar">
4094
+ <p-button
4095
+ size="small"
4096
+ [styleClass]="cx('pcTodayButton')"
4097
+ [label]="getTranslation('today')"
4098
+ (keydown)="onContainerButtonKeydown($event)"
4099
+ (onClick)="onTodayButtonClick($event)"
4100
+ [ngClass]="todayButtonStyleClass"
4101
+ severity="secondary"
4102
+ variant="text"
4103
+ size="small"
4104
+ />
4105
+ <p-button
4106
+ size="small"
4107
+ [styleClass]="cx('pcClearButton')"
4108
+ [label]="getTranslation('clear')"
4109
+ (keydown)="onContainerButtonKeydown($event)"
4110
+ (onClick)="onClearButtonClick($event)"
4111
+ [ngClass]="clearButtonStyleClass"
4112
+ severity="secondary"
4113
+ variant="text"
4114
+ size="small"
4115
+ />
4116
+ </div>
4117
+ <ng-content select="p-footer"></ng-content>
4118
+ <ng-container *ngTemplateOutlet="footerTemplate || _footerTemplate"></ng-container>
4119
+ </div>
4120
+ `,
4121
+ animations: [
4122
+ trigger('overlayAnimation', [
4123
+ state('visibleTouchUI', style$1({
4124
+ transform: 'translate(-50%,-50%)',
4125
+ opacity: 1
4126
+ })),
4127
+ transition('void => visible', [style$1({ opacity: 0, transform: 'scaleY(0.8)' }), animate('{{showTransitionParams}}', style$1({ opacity: 1, transform: '*' }))]),
4128
+ transition('visible => void', [animate('{{hideTransitionParams}}', style$1({ opacity: 0 }))]),
4129
+ transition('void => visibleTouchUI', [style$1({ opacity: 0, transform: 'translate3d(-50%, -40%, 0) scale(0.9)' }), animate('{{showTransitionParams}}')]),
4130
+ transition('visibleTouchUI => void', [
4131
+ animate('{{hideTransitionParams}}', style$1({
4132
+ opacity: 0,
4133
+ transform: 'translate3d(-50%, -40%, 0) scale(0.9)'
4134
+ }))
4135
+ ])
4136
+ ])
4137
+ ],
4138
+ providers: [DATEPICKER_VALUE_ACCESSOR, DatePickerStyle],
4139
+ changeDetection: ChangeDetectionStrategy.OnPush,
4140
+ encapsulation: ViewEncapsulation.None,
4141
+ host: {
4142
+ '[class]': "cn(cx('root'), styleClass)",
4143
+ '[style]': "sx('root')"
4144
+ }
4145
+ }]
4146
+ }], ctorParameters: () => [{ type: i0.NgZone }, { type: i1.OverlayService }], propDecorators: { iconDisplay: [{
4147
+ type: Input
4148
+ }], styleClass: [{
4149
+ type: Input
4150
+ }], inputStyle: [{
4151
+ type: Input
4152
+ }], inputId: [{
4153
+ type: Input
4154
+ }], inputStyleClass: [{
4155
+ type: Input
4156
+ }], placeholder: [{
4157
+ type: Input
4158
+ }], ariaLabelledBy: [{
4159
+ type: Input
4160
+ }], ariaLabel: [{
4161
+ type: Input
4162
+ }], iconAriaLabel: [{
4163
+ type: Input
4164
+ }], dateFormat: [{
4165
+ type: Input
4166
+ }], multipleSeparator: [{
4167
+ type: Input
4168
+ }], rangeSeparator: [{
4169
+ type: Input
4170
+ }], inline: [{
4171
+ type: Input,
4172
+ args: [{ transform: booleanAttribute }]
4173
+ }], showOtherMonths: [{
4174
+ type: Input,
4175
+ args: [{ transform: booleanAttribute }]
4176
+ }], selectOtherMonths: [{
4177
+ type: Input,
4178
+ args: [{ transform: booleanAttribute }]
4179
+ }], showIcon: [{
4180
+ type: Input,
4181
+ args: [{ transform: booleanAttribute }]
4182
+ }], icon: [{
4183
+ type: Input
4184
+ }], readonlyInput: [{
4185
+ type: Input,
4186
+ args: [{ transform: booleanAttribute }]
4187
+ }], shortYearCutoff: [{
4188
+ type: Input
4189
+ }], hourFormat: [{
4190
+ type: Input
4191
+ }], timeOnly: [{
4192
+ type: Input,
4193
+ args: [{ transform: booleanAttribute }]
4194
+ }], stepHour: [{
4195
+ type: Input,
4196
+ args: [{ transform: numberAttribute }]
4197
+ }], stepMinute: [{
4198
+ type: Input,
4199
+ args: [{ transform: numberAttribute }]
4200
+ }], stepSecond: [{
4201
+ type: Input,
4202
+ args: [{ transform: numberAttribute }]
4203
+ }], showSeconds: [{
4204
+ type: Input,
4205
+ args: [{ transform: booleanAttribute }]
4206
+ }], showOnFocus: [{
4207
+ type: Input,
4208
+ args: [{ transform: booleanAttribute }]
4209
+ }], showWeek: [{
4210
+ type: Input,
4211
+ args: [{ transform: booleanAttribute }]
4212
+ }], startWeekFromFirstDayOfYear: [{
4213
+ type: Input
4214
+ }], showClear: [{
4215
+ type: Input,
4216
+ args: [{ transform: booleanAttribute }]
4217
+ }], dataType: [{
4218
+ type: Input
4219
+ }], selectionMode: [{
4220
+ type: Input
4221
+ }], maxDateCount: [{
4222
+ type: Input,
4223
+ args: [{ transform: numberAttribute }]
4224
+ }], showButtonBar: [{
4225
+ type: Input,
4226
+ args: [{ transform: booleanAttribute }]
4227
+ }], todayButtonStyleClass: [{
4228
+ type: Input
4229
+ }], clearButtonStyleClass: [{
4230
+ type: Input
4231
+ }], autofocus: [{
4232
+ type: Input,
4233
+ args: [{ transform: booleanAttribute }]
4234
+ }], autoZIndex: [{
4235
+ type: Input,
4236
+ args: [{ transform: booleanAttribute }]
4237
+ }], baseZIndex: [{
4238
+ type: Input,
4239
+ args: [{ transform: numberAttribute }]
4240
+ }], panelStyleClass: [{
4241
+ type: Input
4242
+ }], panelStyle: [{
4243
+ type: Input
4244
+ }], keepInvalid: [{
4245
+ type: Input,
4246
+ args: [{ transform: booleanAttribute }]
4247
+ }], hideOnDateTimeSelect: [{
4248
+ type: Input,
4249
+ args: [{ transform: booleanAttribute }]
4250
+ }], touchUI: [{
4251
+ type: Input,
4252
+ args: [{ transform: booleanAttribute }]
4253
+ }], timeSeparator: [{
4254
+ type: Input
4255
+ }], focusTrap: [{
4256
+ type: Input,
4257
+ args: [{ transform: booleanAttribute }]
4258
+ }], showTransitionOptions: [{
4259
+ type: Input
4260
+ }], hideTransitionOptions: [{
4261
+ type: Input
4262
+ }], tabindex: [{
4263
+ type: Input,
4264
+ args: [{ transform: numberAttribute }]
4265
+ }], minDate: [{
4266
+ type: Input
4267
+ }], maxDate: [{
4268
+ type: Input
4269
+ }], disabledDates: [{
4270
+ type: Input
4271
+ }], disabledDays: [{
4272
+ type: Input
4273
+ }], showTime: [{
4274
+ type: Input
4275
+ }], responsiveOptions: [{
4276
+ type: Input
4277
+ }], numberOfMonths: [{
4278
+ type: Input
4279
+ }], firstDayOfWeek: [{
4280
+ type: Input
4281
+ }], view: [{
4282
+ type: Input
4283
+ }], defaultDate: [{
4284
+ type: Input
4285
+ }], onFocus: [{
4286
+ type: Output
4287
+ }], onBlur: [{
4288
+ type: Output
4289
+ }], onClose: [{
4290
+ type: Output
4291
+ }], onSelect: [{
4292
+ type: Output
4293
+ }], onClear: [{
4294
+ type: Output
4295
+ }], onInput: [{
4296
+ type: Output
4297
+ }], onTodayClick: [{
4298
+ type: Output
4299
+ }], onClearClick: [{
4300
+ type: Output
4301
+ }], onMonthChange: [{
4302
+ type: Output
4303
+ }], onYearChange: [{
4304
+ type: Output
4305
+ }], onClickOutside: [{
4306
+ type: Output
4307
+ }], onShow: [{
4308
+ type: Output
4309
+ }], inputfieldViewChild: [{
4310
+ type: ViewChild,
4311
+ args: ['inputfield', { static: false }]
4312
+ }], content: [{
4313
+ type: ViewChild,
4314
+ args: ['contentWrapper', { static: false }]
4315
+ }], dateTemplate: [{
4316
+ type: ContentChild,
4317
+ args: ['date', { descendants: false }]
4318
+ }], headerTemplate: [{
4319
+ type: ContentChild,
4320
+ args: ['header', { descendants: false }]
4321
+ }], footerTemplate: [{
4322
+ type: ContentChild,
4323
+ args: ['footer', { descendants: false }]
4324
+ }], disabledDateTemplate: [{
4325
+ type: ContentChild,
4326
+ args: ['disabledDate', { descendants: false }]
4327
+ }], decadeTemplate: [{
4328
+ type: ContentChild,
4329
+ args: ['decade', { descendants: false }]
4330
+ }], previousIconTemplate: [{
4331
+ type: ContentChild,
4332
+ args: ['previousicon', { descendants: false }]
4333
+ }], nextIconTemplate: [{
4334
+ type: ContentChild,
4335
+ args: ['nexticon', { descendants: false }]
4336
+ }], triggerIconTemplate: [{
4337
+ type: ContentChild,
4338
+ args: ['triggericon', { descendants: false }]
4339
+ }], clearIconTemplate: [{
4340
+ type: ContentChild,
4341
+ args: ['clearicon', { descendants: false }]
4342
+ }], decrementIconTemplate: [{
4343
+ type: ContentChild,
4344
+ args: ['decrementicon', { descendants: false }]
4345
+ }], incrementIconTemplate: [{
4346
+ type: ContentChild,
4347
+ args: ['incrementicon', { descendants: false }]
4348
+ }], inputIconTemplate: [{
4349
+ type: ContentChild,
4350
+ args: ['inputicon', { descendants: false }]
4351
+ }], templates: [{
4352
+ type: ContentChildren,
4353
+ args: [PrimeTemplate]
4354
+ }] } });
4355
+ class DatePickerModule {
4356
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: DatePickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4357
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.4", ngImport: i0, type: DatePickerModule, imports: [DatePicker, SharedModule], exports: [DatePicker, SharedModule] });
4358
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: DatePickerModule, imports: [DatePicker, SharedModule, SharedModule] });
4359
+ }
4360
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: DatePickerModule, decorators: [{
4361
+ type: NgModule,
4362
+ args: [{
4363
+ imports: [DatePicker, SharedModule],
4364
+ exports: [DatePicker, SharedModule]
4365
+ }]
4366
+ }] });
4367
+
4368
+ /**
4369
+ * Generated bundle index. Do not edit.
4370
+ */
4371
+
4372
+ export { DATEPICKER_VALUE_ACCESSOR, DatePicker, DatePickerClasses, DatePickerModule, DatePickerStyle };
4373
+ //# sourceMappingURL=primeng-datepicker.mjs.map