@progress/kendo-angular-dateinputs 6.0.4-dev.202203211102 → 7.0.0-next.202204010857

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 (555) hide show
  1. package/bundles/kendo-angular-dateinputs.umd.js +5 -0
  2. package/calendar/calendar-common.module.d.ts +24 -0
  3. package/{dist/es2015/calendar → calendar}/calendar.component.d.ts +40 -21
  4. package/{dist/es2015/calendar → calendar}/calendar.module.d.ts +16 -0
  5. package/{dist/es2015/calendar → calendar}/calendars.module.d.ts +6 -0
  6. package/{dist/es2015/calendar → calendar}/for.directive.d.ts +8 -5
  7. package/{dist/es2015/calendar → calendar}/header.component.d.ts +3 -0
  8. package/{dist/es2015/calendar → calendar}/horizontal-view-list.component.d.ts +9 -5
  9. package/{dist/es2015/calendar → calendar}/localization/calendar-custom-messages.component.d.ts +4 -1
  10. package/{dist/es2015/calendar → calendar}/localization/calendar-localized-messages.directive.d.ts +3 -0
  11. package/{dist/es2015/calendar → calendar}/localization/calendar-messages.d.ts +3 -0
  12. package/{dist/es2015/calendar → calendar}/localization/multiview-calendar-custom-messages.component.d.ts +4 -1
  13. package/{dist/es2015/calendar → calendar}/localization/multiview-calendar-localized-messages.directive.d.ts +3 -0
  14. package/{dist/es2015/calendar → calendar}/localization/multiview-calendar-messages.d.ts +3 -0
  15. package/{dist/es2015/calendar → calendar}/models/cell-context.interface.d.ts +0 -0
  16. package/{dist/es2015/calendar → calendar}/models/keydown.interface.d.ts +0 -0
  17. package/{dist/es2015/calendar → calendar}/models/navigation-action.enum.d.ts +0 -0
  18. package/{dist/es2015/calendar → calendar}/models/row-length-options.interface.d.ts +0 -0
  19. package/{dist/es2015/calendar → calendar}/models/scrollable.interface.d.ts +0 -0
  20. package/{dist/es2015/calendar → calendar}/models/selection-range-end.type.d.ts +0 -0
  21. package/{dist/es2015/calendar → calendar}/models/selection-range.interface.d.ts +0 -0
  22. package/{dist/es2015/calendar → calendar}/models/selection.d.ts +0 -0
  23. package/{dist/es2015/calendar → calendar}/models/type.d.ts +0 -0
  24. package/{dist/es2015/calendar → calendar}/models/view-service.interface.d.ts +0 -0
  25. package/{dist/es2015/calendar → calendar}/models/view.enum.d.ts +0 -0
  26. package/{dist/es2015/calendar → calendar}/models/view.type.d.ts +0 -0
  27. package/{dist/es2015/calendar → calendar}/multiview-calendar.component.d.ts +38 -24
  28. package/{dist/es2015/calendar → calendar}/multiview-calendar.module.d.ts +14 -0
  29. package/{dist/es2015/calendar → calendar}/navigation.component.d.ts +4 -1
  30. package/{dist/es2015/calendar → calendar}/services/bus-view.service.d.ts +3 -0
  31. package/{dist/es2015/calendar → calendar}/services/century-view.service.d.ts +3 -0
  32. package/{dist/es2015/calendar → calendar}/services/decade-view.service.d.ts +3 -0
  33. package/{dist/es2015/calendar → calendar}/services/disabled-dates.service.d.ts +3 -0
  34. package/{dist/es2015/calendar → calendar}/services/dom.service.d.ts +3 -0
  35. package/{dist/es2015/calendar → calendar}/services/month-view.service.d.ts +3 -0
  36. package/{dist/es2015/calendar → calendar}/services/navigation.service.d.ts +3 -0
  37. package/{dist/es2015/calendar → calendar}/services/scroll-sync.service.d.ts +3 -0
  38. package/{dist/es2015/calendar → calendar}/services/selection.service.d.ts +3 -0
  39. package/{dist/es2015/calendar → calendar}/services/weeknames.service.d.ts +3 -0
  40. package/{dist/es2015/calendar → calendar}/services/year-view.service.d.ts +3 -0
  41. package/{dist/es2015/calendar → calendar}/templates/cell-template.directive.d.ts +3 -0
  42. package/{dist/es2015/calendar → calendar}/templates/century-cell-template.directive.d.ts +3 -0
  43. package/{dist/es2015/calendar → calendar}/templates/decade-cell-template.directive.d.ts +3 -0
  44. package/{dist/es2015/calendar → calendar}/templates/header-title-template.directive.d.ts +3 -0
  45. package/{dist/es2015/calendar → calendar}/templates/month-cell-template.directive.d.ts +3 -0
  46. package/{dist/es2015/calendar → calendar}/templates/navigation-item-template.directive.d.ts +3 -0
  47. package/{dist/es2015/calendar → calendar}/templates/weeknumber-cell-template.directive.d.ts +3 -0
  48. package/{dist/es2015/calendar → calendar}/templates/year-cell-template.directive.d.ts +3 -0
  49. package/calendar/templates.module.d.ts +33 -0
  50. package/{dist/es2015/calendar → calendar}/view-list.component.d.ts +9 -5
  51. package/{dist/es2015/calendar → calendar}/view.component.d.ts +5 -1
  52. package/{dist/es2015/common → common}/dom-queries.d.ts +0 -0
  53. package/{dist/es2015/common → common}/models/fillmode.d.ts +0 -0
  54. package/{dist/es2015/common → common}/models/rounded.d.ts +0 -0
  55. package/{dist/es2015/common → common}/models/size.d.ts +0 -0
  56. package/{dist/es2015/common → common}/picker.service.d.ts +0 -0
  57. package/{dist/es2015/common → common}/utils.d.ts +0 -0
  58. package/{dist/es2015/dateinput → dateinput}/arrow.enum.d.ts +0 -0
  59. package/{dist/es2015/dateinput → dateinput}/dateinput.component.d.ts +21 -12
  60. package/dateinput/dateinput.module.d.ts +20 -0
  61. package/{dist/es2015/dateinput → dateinput}/localization/dateinput-custom-messages.component.d.ts +4 -1
  62. package/{dist/es2015/dateinput → dateinput}/localization/dateinput-localized-messages.directive.d.ts +3 -0
  63. package/{dist/es2015/dateinput → dateinput}/localization/messages.d.ts +3 -0
  64. package/{dist/es2015/dateinput → dateinput}/models/format-placeholder.model.d.ts +0 -0
  65. package/{dist/es2015/dateinput → dateinput}/models/format-settings.model.d.ts +0 -0
  66. package/{dist/es2015/dateinput → dateinput}/models/incremental-steps.model.d.ts +0 -0
  67. package/{dist/es2015/dateinputs.module.d.ts → dateinputs.module.d.ts} +10 -0
  68. package/{dist/es2015/datepicker → datepicker}/datepicker.component.d.ts +36 -24
  69. package/datepicker/datepicker.module.d.ts +24 -0
  70. package/{dist/es2015/datepicker → datepicker}/localization/datepicker-custom-messages.component.d.ts +4 -1
  71. package/{dist/es2015/datepicker → datepicker}/localization/datepicker-localized-messages.directive.d.ts +3 -0
  72. package/{dist/es2015/datepicker → datepicker}/localization/messages.d.ts +3 -0
  73. package/{dist/es2015/daterange → daterange}/auto-correct-on.type.d.ts +0 -0
  74. package/{dist/es2015/daterange → daterange}/date-range-end-input.directive.d.ts +5 -1
  75. package/{dist/es2015/daterange → daterange}/date-range-input.d.ts +5 -3
  76. package/{dist/es2015/daterange → daterange}/date-range-popup-template.directive.d.ts +3 -0
  77. package/{dist/es2015/daterange → daterange}/date-range-popup.component.d.ts +12 -5
  78. package/daterange/date-range-popup.service.d.ts +52 -0
  79. package/{dist/es2015/daterange → daterange}/date-range-selection.directive.d.ts +8 -3
  80. package/{dist/es2015/daterange → daterange}/date-range-start-input.directive.d.ts +5 -1
  81. package/{dist/es2015/daterange → daterange}/date-range.component.d.ts +4 -1
  82. package/{dist/es2015/daterange → daterange}/date-range.module.d.ts +15 -1
  83. package/{dist/es2015/daterange → daterange}/date-range.service.d.ts +8 -38
  84. package/{dist/es2015/datetimepicker → datetimepicker}/datetimepicker.component.d.ts +38 -23
  85. package/datetimepicker/datetimepicker.module.d.ts +25 -0
  86. package/{dist/es2015/datetimepicker → datetimepicker}/localization/datetimepicker-custom-messages.component.d.ts +4 -1
  87. package/{dist/es2015/datetimepicker → datetimepicker}/localization/localized-messages.directive.d.ts +3 -0
  88. package/{dist/es2015/datetimepicker → datetimepicker}/localization/messages.d.ts +3 -0
  89. package/{dist/es2015/datetimepicker → datetimepicker}/models/active-tab.type.d.ts +0 -0
  90. package/{dist/es2015/defaults.d.ts → defaults.d.ts} +0 -0
  91. package/esm2015/calendar/calendar-common.module.js +45 -0
  92. package/{dist/es2015 → esm2015}/calendar/calendar.component.js +277 -246
  93. package/{dist/es2015 → esm2015}/calendar/calendar.module.js +71 -34
  94. package/{dist/es2015 → esm2015}/calendar/calendars.module.js +23 -14
  95. package/{dist/es2015 → esm2015}/calendar/for.directive.js +16 -25
  96. package/{dist/es2015 → esm2015}/calendar/header.component.js +97 -73
  97. package/{dist/es2015 → esm2015}/calendar/horizontal-view-list.component.js +155 -130
  98. package/esm2015/calendar/localization/calendar-custom-messages.component.js +40 -0
  99. package/esm2015/calendar/localization/calendar-localized-messages.directive.js +36 -0
  100. package/esm2015/calendar/localization/calendar-messages.js +26 -0
  101. package/esm2015/calendar/localization/multiview-calendar-custom-messages.component.js +40 -0
  102. package/esm2015/calendar/localization/multiview-calendar-localized-messages.directive.js +36 -0
  103. package/esm2015/calendar/localization/multiview-calendar-messages.js +26 -0
  104. package/{dist/es → esm2015}/calendar/models/cell-context.interface.js +1 -0
  105. package/{dist/es2015 → esm2015}/calendar/models/keydown.interface.js +1 -0
  106. package/{dist/es → esm2015}/calendar/models/navigation-action.enum.js +0 -0
  107. package/{dist/es2015 → esm2015}/calendar/models/row-length-options.interface.js +1 -0
  108. package/{dist/es/virtualization → esm2015/calendar}/models/scrollable.interface.js +1 -0
  109. package/{dist/es → esm2015}/calendar/models/selection-range-end.type.js +1 -0
  110. package/{dist/es2015 → esm2015}/calendar/models/selection-range.interface.js +0 -0
  111. package/{dist/es → esm2015}/calendar/models/selection.js +1 -0
  112. package/{dist/es → esm2015}/calendar/models/type.js +1 -0
  113. package/{dist/es → esm2015}/calendar/models/view-service.interface.js +1 -0
  114. package/{dist/es → esm2015}/calendar/models/view.enum.js +0 -0
  115. package/{dist/es → esm2015}/calendar/models/view.type.js +1 -0
  116. package/{dist/es2015 → esm2015}/calendar/multiview-calendar.component.js +246 -298
  117. package/{dist/es2015 → esm2015}/calendar/multiview-calendar.module.js +63 -32
  118. package/{dist/es2015 → esm2015}/calendar/navigation.component.js +71 -62
  119. package/{dist/es2015 → esm2015}/calendar/services/bus-view.service.js +9 -11
  120. package/{dist/es2015 → esm2015}/calendar/services/century-view.service.js +8 -11
  121. package/{dist/es2015 → esm2015}/calendar/services/decade-view.service.js +8 -11
  122. package/{dist/es2015 → esm2015}/calendar/services/disabled-dates.service.js +8 -12
  123. package/{dist/es2015 → esm2015}/calendar/services/dom.service.js +10 -26
  124. package/{dist/es2015 → esm2015}/calendar/services/month-view.service.js +9 -10
  125. package/{dist/es2015 → esm2015}/calendar/services/navigation.service.js +9 -9
  126. package/{dist/es2015 → esm2015}/calendar/services/scroll-sync.service.js +10 -13
  127. package/{dist/es2015 → esm2015}/calendar/services/selection.service.js +9 -9
  128. package/{dist/es2015 → esm2015}/calendar/services/weeknames.service.js +9 -9
  129. package/{dist/es2015 → esm2015}/calendar/services/year-view.service.js +9 -13
  130. package/{dist/es2015 → esm2015}/calendar/templates/cell-template.directive.js +12 -11
  131. package/{dist/es2015 → esm2015}/calendar/templates/century-cell-template.directive.js +12 -11
  132. package/{dist/es2015 → esm2015}/calendar/templates/decade-cell-template.directive.js +12 -11
  133. package/{dist/es2015 → esm2015}/calendar/templates/header-title-template.directive.js +12 -11
  134. package/{dist/es2015 → esm2015}/calendar/templates/month-cell-template.directive.js +12 -11
  135. package/{dist/es2015 → esm2015}/calendar/templates/navigation-item-template.directive.js +12 -11
  136. package/{dist/es2015 → esm2015}/calendar/templates/weeknumber-cell-template.directive.js +12 -11
  137. package/{dist/es2015 → esm2015}/calendar/templates/year-cell-template.directive.js +12 -11
  138. package/esm2015/calendar/templates.module.js +73 -0
  139. package/{dist/es2015 → esm2015}/calendar/view-list.component.js +135 -120
  140. package/{dist/es2015 → esm2015}/calendar/view.component.js +104 -98
  141. package/{dist/es2015 → esm2015}/common/dom-queries.js +0 -0
  142. package/{dist/es → esm2015}/common/models/fillmode.js +1 -0
  143. package/{dist/es → esm2015}/common/models/rounded.js +1 -0
  144. package/{dist/es → esm2015}/common/models/size.js +1 -0
  145. package/{dist/es2015 → esm2015}/common/picker.service.js +0 -0
  146. package/{dist/es2015 → esm2015}/common/utils.js +0 -0
  147. package/{dist/es → esm2015}/dateinput/arrow.enum.js +0 -0
  148. package/{dist/es2015 → esm2015}/dateinput/dateinput.component.js +179 -183
  149. package/esm2015/dateinput/dateinput.module.js +41 -0
  150. package/esm2015/dateinput/localization/dateinput-custom-messages.component.js +40 -0
  151. package/esm2015/dateinput/localization/dateinput-localized-messages.directive.js +36 -0
  152. package/esm2015/dateinput/localization/messages.js +24 -0
  153. package/{dist/es → esm2015}/dateinput/models/format-placeholder.model.js +1 -0
  154. package/{dist/es → esm2015}/dateinput/models/format-settings.model.js +1 -0
  155. package/{dist/es → esm2015}/dateinput/models/incremental-steps.model.js +1 -0
  156. package/{dist/es2015 → esm2015}/dateinputs.module.js +28 -10
  157. package/{dist/es2015 → esm2015}/datepicker/datepicker.component.js +285 -285
  158. package/esm2015/datepicker/datepicker.module.js +72 -0
  159. package/esm2015/datepicker/localization/datepicker-custom-messages.component.js +40 -0
  160. package/esm2015/datepicker/localization/datepicker-localized-messages.directive.js +36 -0
  161. package/esm2015/datepicker/localization/messages.js +28 -0
  162. package/{dist/es → esm2015}/daterange/auto-correct-on.type.js +1 -0
  163. package/{dist/es2015 → esm2015}/daterange/date-range-end-input.directive.js +21 -27
  164. package/{dist/es2015 → esm2015}/daterange/date-range-input.js +11 -8
  165. package/esm2015/daterange/date-range-popup-template.directive.js +23 -0
  166. package/{dist/es2015 → esm2015}/daterange/date-range-popup.component.js +75 -91
  167. package/esm2015/daterange/date-range-popup.service.js +87 -0
  168. package/{dist/es2015 → esm2015}/daterange/date-range-selection.directive.js +26 -39
  169. package/{dist/es2015 → esm2015}/daterange/date-range-start-input.directive.js +21 -27
  170. package/esm2015/daterange/date-range.component.js +74 -0
  171. package/{dist/es2015 → esm2015}/daterange/date-range.module.js +27 -12
  172. package/{dist/es2015 → esm2015}/daterange/date-range.service.js +8 -75
  173. package/{dist/es2015 → esm2015}/datetimepicker/datetimepicker.component.js +398 -227
  174. package/esm2015/datetimepicker/datetimepicker.module.js +80 -0
  175. package/esm2015/datetimepicker/localization/datetimepicker-custom-messages.component.js +40 -0
  176. package/esm2015/datetimepicker/localization/localized-messages.directive.js +36 -0
  177. package/esm2015/datetimepicker/localization/messages.js +48 -0
  178. package/{dist/es → esm2015}/datetimepicker/models/active-tab.type.js +1 -0
  179. package/{dist/es2015 → esm2015}/defaults.js +0 -0
  180. package/esm2015/kendo-angular-dateinputs.js +8 -0
  181. package/{dist/es → esm2015}/main.js +25 -0
  182. package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
  183. package/{dist/es → esm2015}/popup-settings.model.js +1 -0
  184. package/{dist/es2015 → esm2015}/preventable-event.js +0 -0
  185. package/esm2015/timepicker/localization/messages.js +34 -0
  186. package/esm2015/timepicker/localization/timepicker-custom-messages.component.js +40 -0
  187. package/esm2015/timepicker/localization/timepicker-localized-messages.directive.js +36 -0
  188. package/esm2015/timepicker/localization/timeselector-custom-messages.component.js +42 -0
  189. package/esm2015/timepicker/localization/timeselector-localized-messages.directive.js +36 -0
  190. package/{dist/es → esm2015}/timepicker/models/incremental-steps.model.js +1 -0
  191. package/{dist/es → esm2015}/timepicker/models/list-item.interface.js +1 -0
  192. package/{dist/es → esm2015}/timepicker/models/list-service-settings.js +1 -0
  193. package/{dist/es → esm2015}/timepicker/models/list-service.interface.js +1 -0
  194. package/{dist/es2015 → esm2015}/timepicker/models/time-part.default.js +0 -0
  195. package/{dist/es2015 → esm2015}/timepicker/services/dayperiod.service.js +9 -15
  196. package/{dist/es2015 → esm2015}/timepicker/services/dom.service.js +8 -13
  197. package/{dist/es2015 → esm2015}/timepicker/services/hours.service.js +9 -14
  198. package/{dist/es2015 → esm2015}/timepicker/services/milliseconds.service.js +9 -14
  199. package/{dist/es2015 → esm2015}/timepicker/services/minutes.service.js +9 -14
  200. package/{dist/es2015 → esm2015}/timepicker/services/seconds.service.js +9 -14
  201. package/{dist/es2015 → esm2015}/timepicker/timelist.component.js +66 -61
  202. package/{dist/es2015 → esm2015}/timepicker/timepicker.component.js +219 -179
  203. package/{dist/es2015 → esm2015}/timepicker/timepicker.module.js +32 -15
  204. package/{dist/es2015 → esm2015}/timepicker/timeselector.component.js +181 -104
  205. package/{dist/es2015 → esm2015}/timepicker/util.js +8 -20
  206. package/{dist/es2015 → esm2015}/touch-enabled.js +0 -0
  207. package/{dist/es2015 → esm2015}/util.js +1 -6
  208. package/{dist/es2015 → esm2015}/validators/disabled-date.validator.js +0 -0
  209. package/{dist/es2015 → esm2015}/validators/disabled-dates-range.validator.js +0 -2
  210. package/{dist/es2015 → esm2015}/validators/incomplete-date.validator.js +0 -0
  211. package/{dist/es2015 → esm2015}/validators/max.validator.js +0 -0
  212. package/{dist/es2015 → esm2015}/validators/min.validator.js +0 -0
  213. package/{dist/es2015 → esm2015}/validators/time-range.validator.js +0 -0
  214. package/{dist/es2015/calendar → esm2015/virtualization}/models/scrollable.interface.js +1 -0
  215. package/{dist/es2015 → esm2015}/virtualization/services/row-height.service.js +1 -3
  216. package/{dist/es2015 → esm2015}/virtualization/services/scroller.service.js +0 -2
  217. package/{dist/es2015 → esm2015}/virtualization/virtualization.component.js +75 -90
  218. package/esm2015/virtualization/virtualization.module.js +30 -0
  219. package/{dist/fesm2015/index.js → fesm2015/kendo-angular-dateinputs.js} +9630 -9048
  220. package/{dist/es/calendar/models/selection-range.interface.js → kendo-angular-dateinputs.d.ts} +3 -2
  221. package/{dist/es2015/main.d.ts → main.d.ts} +25 -0
  222. package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
  223. package/package.json +45 -118
  224. package/{dist/es2015/popup-settings.model.d.ts → popup-settings.model.d.ts} +0 -0
  225. package/{dist/es2015/preventable-event.d.ts → preventable-event.d.ts} +0 -0
  226. package/schematics/ngAdd/index.js +5 -2
  227. package/schematics/ngAdd/index.js.map +1 -1
  228. package/{dist/es2015/timepicker → timepicker}/localization/messages.d.ts +3 -0
  229. package/{dist/es2015/timepicker → timepicker}/localization/timepicker-custom-messages.component.d.ts +4 -1
  230. package/{dist/es2015/timepicker → timepicker}/localization/timepicker-localized-messages.directive.d.ts +3 -0
  231. package/{dist/es2015/timepicker → timepicker}/localization/timeselector-custom-messages.component.d.ts +4 -1
  232. package/{dist/es2015/timepicker → timepicker}/localization/timeselector-localized-messages.directive.d.ts +3 -0
  233. package/{dist/es2015/timepicker → timepicker}/models/incremental-steps.model.d.ts +0 -0
  234. package/{dist/es2015/timepicker → timepicker}/models/list-item.interface.d.ts +0 -0
  235. package/{dist/es2015/timepicker → timepicker}/models/list-service-settings.d.ts +0 -0
  236. package/{dist/es2015/timepicker → timepicker}/models/list-service.interface.d.ts +0 -0
  237. package/{dist/es2015/timepicker → timepicker}/models/time-part.default.d.ts +0 -0
  238. package/{dist/es2015/timepicker → timepicker}/services/dayperiod.service.d.ts +3 -0
  239. package/{dist/es2015/timepicker → timepicker}/services/dom.service.d.ts +3 -0
  240. package/{dist/es2015/timepicker → timepicker}/services/hours.service.d.ts +3 -0
  241. package/{dist/es2015/timepicker → timepicker}/services/milliseconds.service.d.ts +3 -0
  242. package/{dist/es2015/timepicker → timepicker}/services/minutes.service.d.ts +3 -0
  243. package/{dist/es2015/timepicker → timepicker}/services/seconds.service.d.ts +3 -0
  244. package/{dist/es2015/timepicker → timepicker}/timelist.component.d.ts +4 -1
  245. package/{dist/es2015/timepicker → timepicker}/timepicker.component.d.ts +32 -18
  246. package/timepicker/timepicker.module.d.ts +27 -0
  247. package/{dist/es2015/timepicker → timepicker}/timeselector.component.d.ts +10 -4
  248. package/{dist/es2015/timepicker → timepicker}/util.d.ts +0 -0
  249. package/{dist/es2015/touch-enabled.d.ts → touch-enabled.d.ts} +0 -0
  250. package/{dist/es2015/util.d.ts → util.d.ts} +0 -0
  251. package/{dist/es2015/validators → validators}/disabled-date.validator.d.ts +0 -0
  252. package/{dist/es2015/validators → validators}/disabled-dates-range.validator.d.ts +0 -0
  253. package/{dist/es2015/validators → validators}/incomplete-date.validator.d.ts +0 -0
  254. package/{dist/es2015/validators → validators}/max.validator.d.ts +0 -0
  255. package/{dist/es2015/validators → validators}/min.validator.d.ts +0 -0
  256. package/{dist/es2015/validators → validators}/time-range.validator.d.ts +0 -0
  257. package/{dist/es2015/virtualization → virtualization}/models/scrollable.interface.d.ts +0 -0
  258. package/{dist/es2015/virtualization → virtualization}/services/row-height.service.d.ts +0 -0
  259. package/{dist/es2015/virtualization → virtualization}/services/scroller.service.d.ts +0 -0
  260. package/{dist/es2015/virtualization → virtualization}/virtualization.component.d.ts +8 -5
  261. package/{dist/es2015/virtualization → virtualization}/virtualization.module.d.ts +6 -0
  262. package/dist/cdn/js/kendo-angular-dateinputs.js +0 -20
  263. package/dist/cdn/main.js +0 -5
  264. package/dist/es/calendar/calendar-common.module.js +0 -41
  265. package/dist/es/calendar/calendar.component.js +0 -1189
  266. package/dist/es/calendar/calendar.module.js +0 -108
  267. package/dist/es/calendar/calendars.module.js +0 -60
  268. package/dist/es/calendar/for.directive.js +0 -135
  269. package/dist/es/calendar/header.component.js +0 -170
  270. package/dist/es/calendar/horizontal-view-list.component.js +0 -363
  271. package/dist/es/calendar/localization/calendar-custom-messages.component.js +0 -43
  272. package/dist/es/calendar/localization/calendar-localized-messages.directive.js +0 -35
  273. package/dist/es/calendar/localization/calendar-messages.js +0 -30
  274. package/dist/es/calendar/localization/multiview-calendar-custom-messages.component.js +0 -43
  275. package/dist/es/calendar/localization/multiview-calendar-localized-messages.directive.js +0 -35
  276. package/dist/es/calendar/localization/multiview-calendar-messages.js +0 -30
  277. package/dist/es/calendar/models/keydown.interface.js +0 -4
  278. package/dist/es/calendar/models/row-length-options.interface.js +0 -4
  279. package/dist/es/calendar/models/scrollable.interface.js +0 -4
  280. package/dist/es/calendar/multiview-calendar.component.js +0 -1122
  281. package/dist/es/calendar/multiview-calendar.module.js +0 -97
  282. package/dist/es/calendar/navigation.component.js +0 -173
  283. package/dist/es/calendar/services/bus-view.service.js +0 -83
  284. package/dist/es/calendar/services/century-view.service.js +0 -180
  285. package/dist/es/calendar/services/decade-view.service.js +0 -179
  286. package/dist/es/calendar/services/disabled-dates.service.js +0 -70
  287. package/dist/es/calendar/services/dom.service.js +0 -195
  288. package/dist/es/calendar/services/month-view.service.js +0 -203
  289. package/dist/es/calendar/services/navigation.service.js +0 -53
  290. package/dist/es/calendar/services/scroll-sync.service.js +0 -85
  291. package/dist/es/calendar/services/selection.service.js +0 -55
  292. package/dist/es/calendar/services/weeknames.service.js +0 -27
  293. package/dist/es/calendar/services/year-view.service.js +0 -204
  294. package/dist/es/calendar/templates/cell-template.directive.js +0 -46
  295. package/dist/es/calendar/templates/century-cell-template.directive.js +0 -45
  296. package/dist/es/calendar/templates/decade-cell-template.directive.js +0 -45
  297. package/dist/es/calendar/templates/header-title-template.directive.js +0 -44
  298. package/dist/es/calendar/templates/month-cell-template.directive.js +0 -43
  299. package/dist/es/calendar/templates/navigation-item-template.directive.js +0 -44
  300. package/dist/es/calendar/templates/weeknumber-cell-template.directive.js +0 -43
  301. package/dist/es/calendar/templates/year-cell-template.directive.js +0 -46
  302. package/dist/es/calendar/templates.module.js +0 -59
  303. package/dist/es/calendar/view-list.component.js +0 -301
  304. package/dist/es/calendar/view.component.js +0 -318
  305. package/dist/es/common/dom-queries.js +0 -24
  306. package/dist/es/common/picker.service.js +0 -18
  307. package/dist/es/common/utils.js +0 -35
  308. package/dist/es/dateinput/dateinput.component.js +0 -1617
  309. package/dist/es/dateinput/dateinput.module.js +0 -37
  310. package/dist/es/dateinput/localization/dateinput-custom-messages.component.js +0 -43
  311. package/dist/es/dateinput/localization/dateinput-localized-messages.directive.js +0 -35
  312. package/dist/es/dateinput/localization/messages.js +0 -26
  313. package/dist/es/dateinputs.module.js +0 -63
  314. package/dist/es/datepicker/datepicker.component.js +0 -1256
  315. package/dist/es/datepicker/datepicker.module.js +0 -55
  316. package/dist/es/datepicker/localization/datepicker-custom-messages.component.js +0 -43
  317. package/dist/es/datepicker/localization/datepicker-localized-messages.directive.js +0 -35
  318. package/dist/es/datepicker/localization/messages.js +0 -34
  319. package/dist/es/daterange/date-range-end-input.directive.js +0 -97
  320. package/dist/es/daterange/date-range-input.js +0 -131
  321. package/dist/es/daterange/date-range-popup-template.directive.js +0 -23
  322. package/dist/es/daterange/date-range-popup.component.js +0 -403
  323. package/dist/es/daterange/date-range-selection.directive.js +0 -230
  324. package/dist/es/daterange/date-range-start-input.directive.js +0 -97
  325. package/dist/es/daterange/date-range.component.js +0 -71
  326. package/dist/es/daterange/date-range.module.js +0 -83
  327. package/dist/es/daterange/date-range.service.js +0 -208
  328. package/dist/es/datetimepicker/datetimepicker.component.js +0 -1309
  329. package/dist/es/datetimepicker/datetimepicker.module.js +0 -57
  330. package/dist/es/datetimepicker/localization/datetimepicker-custom-messages.component.js +0 -43
  331. package/dist/es/datetimepicker/localization/localized-messages.directive.js +0 -35
  332. package/dist/es/datetimepicker/localization/messages.js +0 -74
  333. package/dist/es/defaults.js +0 -24
  334. package/dist/es/index.js +0 -63
  335. package/dist/es/package-metadata.js +0 -15
  336. package/dist/es/preventable-event.js +0 -29
  337. package/dist/es/timepicker/localization/messages.js +0 -46
  338. package/dist/es/timepicker/localization/timepicker-custom-messages.component.js +0 -43
  339. package/dist/es/timepicker/localization/timepicker-localized-messages.directive.js +0 -35
  340. package/dist/es/timepicker/localization/timeselector-custom-messages.component.js +0 -45
  341. package/dist/es/timepicker/localization/timeselector-localized-messages.directive.js +0 -35
  342. package/dist/es/timepicker/models/time-part.default.js +0 -14
  343. package/dist/es/timepicker/services/dayperiod.service.js +0 -130
  344. package/dist/es/timepicker/services/dom.service.js +0 -64
  345. package/dist/es/timepicker/services/hours.service.js +0 -129
  346. package/dist/es/timepicker/services/milliseconds.service.js +0 -130
  347. package/dist/es/timepicker/services/minutes.service.js +0 -127
  348. package/dist/es/timepicker/services/seconds.service.js +0 -127
  349. package/dist/es/timepicker/timelist.component.js +0 -297
  350. package/dist/es/timepicker/timepicker.component.js +0 -1044
  351. package/dist/es/timepicker/timepicker.module.js +0 -75
  352. package/dist/es/timepicker/timeselector.component.js +0 -486
  353. package/dist/es/timepicker/util.js +0 -82
  354. package/dist/es/touch-enabled.js +0 -9
  355. package/dist/es/util.js +0 -395
  356. package/dist/es/validators/disabled-date.validator.js +0 -18
  357. package/dist/es/validators/disabled-dates-range.validator.js +0 -28
  358. package/dist/es/validators/incomplete-date.validator.js +0 -18
  359. package/dist/es/validators/max.validator.js +0 -21
  360. package/dist/es/validators/min.validator.js +0 -21
  361. package/dist/es/validators/time-range.validator.js +0 -23
  362. package/dist/es/virtualization/services/row-height.service.js +0 -72
  363. package/dist/es/virtualization/services/scroller.service.js +0 -111
  364. package/dist/es/virtualization/virtualization.component.js +0 -343
  365. package/dist/es/virtualization/virtualization.module.js +0 -30
  366. package/dist/es2015/calendar/calendar-common.module.d.ts +0 -15
  367. package/dist/es2015/calendar/calendar-common.module.js +0 -38
  368. package/dist/es2015/calendar/localization/calendar-custom-messages.component.js +0 -35
  369. package/dist/es2015/calendar/localization/calendar-localized-messages.directive.js +0 -31
  370. package/dist/es2015/calendar/localization/calendar-messages.js +0 -24
  371. package/dist/es2015/calendar/localization/multiview-calendar-custom-messages.component.js +0 -35
  372. package/dist/es2015/calendar/localization/multiview-calendar-localized-messages.directive.js +0 -31
  373. package/dist/es2015/calendar/localization/multiview-calendar-messages.js +0 -24
  374. package/dist/es2015/calendar/models/cell-context.interface.js +0 -4
  375. package/dist/es2015/calendar/models/navigation-action.enum.js +0 -20
  376. package/dist/es2015/calendar/models/selection-range-end.type.js +0 -4
  377. package/dist/es2015/calendar/models/selection.js +0 -4
  378. package/dist/es2015/calendar/models/type.js +0 -4
  379. package/dist/es2015/calendar/models/view-service.interface.js +0 -4
  380. package/dist/es2015/calendar/models/view.enum.js +0 -16
  381. package/dist/es2015/calendar/models/view.type.js +0 -4
  382. package/dist/es2015/calendar/templates.module.d.ts +0 -21
  383. package/dist/es2015/calendar/templates.module.js +0 -56
  384. package/dist/es2015/common/models/fillmode.js +0 -4
  385. package/dist/es2015/common/models/rounded.js +0 -4
  386. package/dist/es2015/common/models/size.js +0 -4
  387. package/dist/es2015/dateinput/arrow.enum.js +0 -13
  388. package/dist/es2015/dateinput/dateinput.module.d.ts +0 -10
  389. package/dist/es2015/dateinput/dateinput.module.js +0 -34
  390. package/dist/es2015/dateinput/localization/dateinput-custom-messages.component.js +0 -35
  391. package/dist/es2015/dateinput/localization/dateinput-localized-messages.directive.js +0 -31
  392. package/dist/es2015/dateinput/localization/messages.js +0 -20
  393. package/dist/es2015/dateinput/models/format-placeholder.model.js +0 -4
  394. package/dist/es2015/dateinput/models/format-settings.model.js +0 -4
  395. package/dist/es2015/dateinput/models/incremental-steps.model.js +0 -4
  396. package/dist/es2015/datepicker/datepicker.module.d.ts +0 -10
  397. package/dist/es2015/datepicker/datepicker.module.js +0 -52
  398. package/dist/es2015/datepicker/localization/datepicker-custom-messages.component.js +0 -35
  399. package/dist/es2015/datepicker/localization/datepicker-localized-messages.directive.js +0 -31
  400. package/dist/es2015/datepicker/localization/messages.js +0 -28
  401. package/dist/es2015/daterange/auto-correct-on.type.js +0 -4
  402. package/dist/es2015/daterange/date-range-popup-template.directive.js +0 -22
  403. package/dist/es2015/daterange/date-range.component.js +0 -68
  404. package/dist/es2015/datetimepicker/datetimepicker.module.d.ts +0 -10
  405. package/dist/es2015/datetimepicker/datetimepicker.module.js +0 -57
  406. package/dist/es2015/datetimepicker/localization/datetimepicker-custom-messages.component.js +0 -35
  407. package/dist/es2015/datetimepicker/localization/localized-messages.directive.js +0 -31
  408. package/dist/es2015/datetimepicker/localization/messages.js +0 -68
  409. package/dist/es2015/datetimepicker/models/active-tab.type.js +0 -4
  410. package/dist/es2015/index.d.ts +0 -63
  411. package/dist/es2015/index.js +0 -63
  412. package/dist/es2015/index.metadata.json +0 -1
  413. package/dist/es2015/main.js +0 -35
  414. package/dist/es2015/popup-settings.model.js +0 -4
  415. package/dist/es2015/timepicker/localization/messages.js +0 -40
  416. package/dist/es2015/timepicker/localization/timepicker-custom-messages.component.js +0 -35
  417. package/dist/es2015/timepicker/localization/timepicker-localized-messages.directive.js +0 -31
  418. package/dist/es2015/timepicker/localization/timeselector-custom-messages.component.js +0 -37
  419. package/dist/es2015/timepicker/localization/timeselector-localized-messages.directive.js +0 -31
  420. package/dist/es2015/timepicker/models/incremental-steps.model.js +0 -4
  421. package/dist/es2015/timepicker/models/list-item.interface.js +0 -4
  422. package/dist/es2015/timepicker/models/list-service-settings.js +0 -4
  423. package/dist/es2015/timepicker/models/list-service.interface.js +0 -4
  424. package/dist/es2015/timepicker/timepicker.module.d.ts +0 -10
  425. package/dist/es2015/virtualization/models/scrollable.interface.js +0 -4
  426. package/dist/es2015/virtualization/virtualization.module.js +0 -27
  427. package/dist/fesm5/index.js +0 -15216
  428. package/dist/npm/calendar/calendar-common.module.js +0 -43
  429. package/dist/npm/calendar/calendar.component.js +0 -1191
  430. package/dist/npm/calendar/calendar.module.js +0 -110
  431. package/dist/npm/calendar/calendars.module.js +0 -62
  432. package/dist/npm/calendar/for.directive.js +0 -138
  433. package/dist/npm/calendar/header.component.js +0 -172
  434. package/dist/npm/calendar/horizontal-view-list.component.js +0 -365
  435. package/dist/npm/calendar/localization/calendar-custom-messages.component.js +0 -45
  436. package/dist/npm/calendar/localization/calendar-localized-messages.directive.js +0 -37
  437. package/dist/npm/calendar/localization/calendar-messages.js +0 -32
  438. package/dist/npm/calendar/localization/multiview-calendar-custom-messages.component.js +0 -45
  439. package/dist/npm/calendar/localization/multiview-calendar-localized-messages.directive.js +0 -37
  440. package/dist/npm/calendar/localization/multiview-calendar-messages.js +0 -32
  441. package/dist/npm/calendar/models/cell-context.interface.js +0 -6
  442. package/dist/npm/calendar/models/keydown.interface.js +0 -6
  443. package/dist/npm/calendar/models/navigation-action.enum.js +0 -22
  444. package/dist/npm/calendar/models/row-length-options.interface.js +0 -6
  445. package/dist/npm/calendar/models/scrollable.interface.js +0 -6
  446. package/dist/npm/calendar/models/selection-range-end.type.js +0 -6
  447. package/dist/npm/calendar/models/selection-range.interface.js +0 -10
  448. package/dist/npm/calendar/models/selection.js +0 -6
  449. package/dist/npm/calendar/models/type.js +0 -6
  450. package/dist/npm/calendar/models/view-service.interface.js +0 -6
  451. package/dist/npm/calendar/models/view.enum.js +0 -18
  452. package/dist/npm/calendar/models/view.type.js +0 -6
  453. package/dist/npm/calendar/multiview-calendar.component.js +0 -1124
  454. package/dist/npm/calendar/multiview-calendar.module.js +0 -99
  455. package/dist/npm/calendar/navigation.component.js +0 -175
  456. package/dist/npm/calendar/services/bus-view.service.js +0 -85
  457. package/dist/npm/calendar/services/century-view.service.js +0 -182
  458. package/dist/npm/calendar/services/decade-view.service.js +0 -181
  459. package/dist/npm/calendar/services/disabled-dates.service.js +0 -72
  460. package/dist/npm/calendar/services/dom.service.js +0 -212
  461. package/dist/npm/calendar/services/month-view.service.js +0 -205
  462. package/dist/npm/calendar/services/navigation.service.js +0 -55
  463. package/dist/npm/calendar/services/scroll-sync.service.js +0 -88
  464. package/dist/npm/calendar/services/selection.service.js +0 -57
  465. package/dist/npm/calendar/services/weeknames.service.js +0 -29
  466. package/dist/npm/calendar/services/year-view.service.js +0 -207
  467. package/dist/npm/calendar/templates/cell-template.directive.js +0 -48
  468. package/dist/npm/calendar/templates/century-cell-template.directive.js +0 -47
  469. package/dist/npm/calendar/templates/decade-cell-template.directive.js +0 -47
  470. package/dist/npm/calendar/templates/header-title-template.directive.js +0 -46
  471. package/dist/npm/calendar/templates/month-cell-template.directive.js +0 -45
  472. package/dist/npm/calendar/templates/navigation-item-template.directive.js +0 -46
  473. package/dist/npm/calendar/templates/weeknumber-cell-template.directive.js +0 -45
  474. package/dist/npm/calendar/templates/year-cell-template.directive.js +0 -48
  475. package/dist/npm/calendar/templates.module.js +0 -61
  476. package/dist/npm/calendar/view-list.component.js +0 -303
  477. package/dist/npm/calendar/view.component.js +0 -320
  478. package/dist/npm/common/dom-queries.js +0 -26
  479. package/dist/npm/common/models/fillmode.js +0 -6
  480. package/dist/npm/common/models/rounded.js +0 -6
  481. package/dist/npm/common/models/size.js +0 -6
  482. package/dist/npm/common/picker.service.js +0 -20
  483. package/dist/npm/common/utils.js +0 -37
  484. package/dist/npm/dateinput/arrow.enum.js +0 -15
  485. package/dist/npm/dateinput/dateinput.component.js +0 -1620
  486. package/dist/npm/dateinput/dateinput.module.js +0 -39
  487. package/dist/npm/dateinput/localization/dateinput-custom-messages.component.js +0 -45
  488. package/dist/npm/dateinput/localization/dateinput-localized-messages.directive.js +0 -37
  489. package/dist/npm/dateinput/localization/messages.js +0 -28
  490. package/dist/npm/dateinput/models/format-placeholder.model.js +0 -6
  491. package/dist/npm/dateinput/models/format-settings.model.js +0 -6
  492. package/dist/npm/dateinput/models/incremental-steps.model.js +0 -6
  493. package/dist/npm/dateinputs.module.js +0 -65
  494. package/dist/npm/datepicker/datepicker.component.js +0 -1258
  495. package/dist/npm/datepicker/datepicker.module.js +0 -57
  496. package/dist/npm/datepicker/localization/datepicker-custom-messages.component.js +0 -45
  497. package/dist/npm/datepicker/localization/datepicker-localized-messages.directive.js +0 -37
  498. package/dist/npm/datepicker/localization/messages.js +0 -36
  499. package/dist/npm/daterange/auto-correct-on.type.js +0 -6
  500. package/dist/npm/daterange/date-range-end-input.directive.js +0 -99
  501. package/dist/npm/daterange/date-range-input.js +0 -133
  502. package/dist/npm/daterange/date-range-popup-template.directive.js +0 -25
  503. package/dist/npm/daterange/date-range-popup.component.js +0 -405
  504. package/dist/npm/daterange/date-range-selection.directive.js +0 -232
  505. package/dist/npm/daterange/date-range-start-input.directive.js +0 -99
  506. package/dist/npm/daterange/date-range.component.js +0 -73
  507. package/dist/npm/daterange/date-range.module.js +0 -85
  508. package/dist/npm/daterange/date-range.service.js +0 -211
  509. package/dist/npm/datetimepicker/datetimepicker.component.js +0 -1311
  510. package/dist/npm/datetimepicker/datetimepicker.module.js +0 -59
  511. package/dist/npm/datetimepicker/localization/datetimepicker-custom-messages.component.js +0 -45
  512. package/dist/npm/datetimepicker/localization/localized-messages.directive.js +0 -37
  513. package/dist/npm/datetimepicker/localization/messages.js +0 -76
  514. package/dist/npm/datetimepicker/models/active-tab.type.js +0 -6
  515. package/dist/npm/defaults.js +0 -26
  516. package/dist/npm/index.js +0 -127
  517. package/dist/npm/main.js +0 -68
  518. package/dist/npm/package-metadata.js +0 -17
  519. package/dist/npm/popup-settings.model.js +0 -6
  520. package/dist/npm/preventable-event.js +0 -31
  521. package/dist/npm/timepicker/localization/messages.js +0 -48
  522. package/dist/npm/timepicker/localization/timepicker-custom-messages.component.js +0 -45
  523. package/dist/npm/timepicker/localization/timepicker-localized-messages.directive.js +0 -37
  524. package/dist/npm/timepicker/localization/timeselector-custom-messages.component.js +0 -47
  525. package/dist/npm/timepicker/localization/timeselector-localized-messages.directive.js +0 -37
  526. package/dist/npm/timepicker/models/incremental-steps.model.js +0 -6
  527. package/dist/npm/timepicker/models/list-item.interface.js +0 -6
  528. package/dist/npm/timepicker/models/list-service-settings.js +0 -6
  529. package/dist/npm/timepicker/models/list-service.interface.js +0 -6
  530. package/dist/npm/timepicker/models/time-part.default.js +0 -16
  531. package/dist/npm/timepicker/services/dayperiod.service.js +0 -136
  532. package/dist/npm/timepicker/services/dom.service.js +0 -70
  533. package/dist/npm/timepicker/services/hours.service.js +0 -134
  534. package/dist/npm/timepicker/services/milliseconds.service.js +0 -135
  535. package/dist/npm/timepicker/services/minutes.service.js +0 -132
  536. package/dist/npm/timepicker/services/seconds.service.js +0 -132
  537. package/dist/npm/timepicker/timelist.component.js +0 -299
  538. package/dist/npm/timepicker/timepicker.component.js +0 -1046
  539. package/dist/npm/timepicker/timepicker.module.js +0 -77
  540. package/dist/npm/timepicker/timeselector.component.js +0 -488
  541. package/dist/npm/timepicker/util.js +0 -101
  542. package/dist/npm/touch-enabled.js +0 -11
  543. package/dist/npm/util.js +0 -399
  544. package/dist/npm/validators/disabled-date.validator.js +0 -20
  545. package/dist/npm/validators/disabled-dates-range.validator.js +0 -30
  546. package/dist/npm/validators/incomplete-date.validator.js +0 -20
  547. package/dist/npm/validators/max.validator.js +0 -23
  548. package/dist/npm/validators/min.validator.js +0 -23
  549. package/dist/npm/validators/time-range.validator.js +0 -25
  550. package/dist/npm/virtualization/models/scrollable.interface.js +0 -6
  551. package/dist/npm/virtualization/services/row-height.service.js +0 -74
  552. package/dist/npm/virtualization/services/scroller.service.js +0 -113
  553. package/dist/npm/virtualization/virtualization.component.js +0 -346
  554. package/dist/npm/virtualization/virtualization.module.js +0 -32
  555. package/dist/systemjs/kendo-angular-dateinputs.js +0 -5
@@ -1,1620 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var tslib_1 = require("tslib");
8
- /* tslint:disable:max-line-length */
9
- var core_1 = require("@angular/core");
10
- var min_validator_1 = require("../validators/min.validator");
11
- var max_validator_1 = require("../validators/max.validator");
12
- var incomplete_date_validator_1 = require("../validators/incomplete-date.validator");
13
- var forms_1 = require("@angular/forms");
14
- var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
15
- var kendo_angular_intl_1 = require("@progress/kendo-angular-intl");
16
- var kendo_licensing_1 = require("@progress/kendo-licensing");
17
- var package_metadata_1 = require("../package-metadata");
18
- var kendo_date_math_1 = require("@progress/kendo-date-math");
19
- var kendo_angular_common_1 = require("@progress/kendo-angular-common");
20
- var arrow_enum_1 = require("./arrow.enum");
21
- var util_1 = require("../util");
22
- var picker_service_1 = require("../common/picker.service");
23
- var dom_queries_1 = require("../common/dom-queries");
24
- var utils_1 = require("../common/utils");
25
- var MIN_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/DateInputComponent/#toc-min';
26
- var MAX_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/DateInputComponent/#toc-max';
27
- var VALUE_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/dateinput/#toc-using-with-json';
28
- var DATE_PART_REGEXP = /year|month|<day>/;
29
- var TIME_PART_REGEXP = /hour|minute|second|millisecond/;
30
- var SHORT_PATTERN_LENGTH_REGEXP = /d|M|H|h|m|s/;
31
- var TWO_DIGIT_YEAR_MAX = 68;
32
- var PREVIOUS_CENTURY_BASE = 1900;
33
- var CURRENT_CENTURY_BASE = 2000;
34
- var DEFAULT_FORMAT = 'd';
35
- var padZero = function (length) { return new Array(Math.max(length, 0)).fill('0').join(''); };
36
- var ɵ0 = padZero;
37
- exports.ɵ0 = ɵ0;
38
- var unpadZero = function (value) { return value.replace(/^0*/, ''); };
39
- var ɵ1 = unpadZero;
40
- exports.ɵ1 = ɵ1;
41
- var Mask = /** @class */ (function () {
42
- function Mask() {
43
- this.symbols = "";
44
- }
45
- return Mask;
46
- }());
47
- var KendoDate = /** @class */ (function () {
48
- function KendoDate(intl, formatPlaceholder, format, value, twoDigitYearMax) {
49
- if (twoDigitYearMax === void 0) { twoDigitYearMax = TWO_DIGIT_YEAR_MAX; }
50
- this.intl = intl;
51
- this.formatPlaceholder = formatPlaceholder;
52
- this.format = format;
53
- this.twoDigitYearMax = twoDigitYearMax;
54
- this.year = true;
55
- this.month = true;
56
- this.date = true;
57
- this.hours = true;
58
- this.minutes = true;
59
- this.seconds = true;
60
- this.milliseconds = true;
61
- this.leadingZero = null;
62
- this.monthNames = null;
63
- this.typedMonthPart = "";
64
- this.value = kendo_date_math_1.getDate(new Date());
65
- this.knownParts = "adHhmMsSEy";
66
- this.symbols = {
67
- "E": "E",
68
- "H": "H",
69
- "M": "M",
70
- "a": "a",
71
- "d": "d",
72
- "h": "h",
73
- "m": "m",
74
- "s": "s",
75
- "S": "S",
76
- "y": "y"
77
- };
78
- kendo_licensing_1.validatePackage(package_metadata_1.packageMetadata);
79
- this.monthNames = this.allFormatedMonths();
80
- this.dayPeriods = this.allDayPeriods();
81
- if (!value) {
82
- this.value = kendo_date_math_1.getDate(new Date());
83
- var sampleFormat = this.dateFormatString(this.value, this.format).symbols;
84
- for (var i = 0; i < sampleFormat.length; i++) {
85
- this.setExisting(sampleFormat[i], false);
86
- }
87
- }
88
- else {
89
- this.value = kendo_date_math_1.cloneDate(value);
90
- }
91
- }
92
- KendoDate.prototype.hasValue = function () {
93
- var _this = this;
94
- var pred = function (a, p) { return a || p.type !== 'literal' && p.type !== 'dayperiod' && _this.getExisting(p.pattern[0]); };
95
- return this.intl.splitDateFormat(this.format).reduce(pred, false);
96
- };
97
- KendoDate.prototype.shouldNormalizeCentury = function () {
98
- return this.intl.splitDateFormat(this.format).some(function (part) { return part.pattern === 'yy'; });
99
- };
100
- KendoDate.prototype.getDateObject = function () {
101
- for (var i = 0; i < this.knownParts.length; i++) {
102
- if (!this.getExisting(this.knownParts[i])) {
103
- return null;
104
- }
105
- }
106
- return kendo_date_math_1.cloneDate(this.value);
107
- };
108
- KendoDate.prototype.getTextAndFormat = function (format) {
109
- return this.merge(this.intl.formatDate(this.value, format), this.dateFormatString(this.value, format));
110
- };
111
- KendoDate.prototype.getExisting = function (symbol) {
112
- switch (symbol) {
113
- case "y": return this.year;
114
- case "M":
115
- case "L": return this.month;
116
- case "d": return this.date;
117
- case "E": return this.date && this.month && this.year;
118
- case "h":
119
- case "H": return this.hours;
120
- case "m": return this.minutes;
121
- case "s": return this.seconds;
122
- case "S": return this.milliseconds;
123
- default: return true;
124
- }
125
- };
126
- KendoDate.prototype.setExisting = function (symbol, value) {
127
- switch (symbol) {
128
- case "y":
129
- this.year = value;
130
- if (value === false) {
131
- this.value.setFullYear(2000);
132
- }
133
- break; //allow 2/29 dates
134
- case "M":
135
- this.month = value;
136
- if (value === false) {
137
- this.value.setMonth(0);
138
- }
139
- break; //make sure you can type 31 at day part
140
- case "d":
141
- this.date = value;
142
- break;
143
- case "h":
144
- case "H":
145
- this.hours = value;
146
- break;
147
- case "m":
148
- this.minutes = value;
149
- break;
150
- case "s":
151
- this.seconds = value;
152
- break;
153
- case "S":
154
- this.milliseconds = value;
155
- break;
156
- default: return;
157
- }
158
- };
159
- KendoDate.prototype.modifyPart = function (symbol, offset) {
160
- var newValue = kendo_date_math_1.cloneDate(this.value);
161
- switch (symbol) {
162
- case "y":
163
- newValue.setFullYear(newValue.getFullYear() + offset);
164
- break;
165
- case "M":
166
- newValue = kendo_date_math_1.addMonths(this.value, offset);
167
- break;
168
- case "d":
169
- case "E":
170
- newValue.setDate(newValue.getDate() + offset);
171
- break;
172
- case "h":
173
- case "H":
174
- newValue.setHours(newValue.getHours() + offset);
175
- break;
176
- case "m":
177
- newValue.setMinutes(newValue.getMinutes() + offset);
178
- break;
179
- case "s":
180
- newValue.setSeconds(newValue.getSeconds() + offset);
181
- break;
182
- case "S":
183
- newValue.setMilliseconds(newValue.getMilliseconds() + offset);
184
- break;
185
- case "a":
186
- newValue.setHours(newValue.getHours() + (12 * offset));
187
- break;
188
- default: break;
189
- }
190
- if (this.shouldNormalizeCentury()) {
191
- newValue = this.normalizeCentury(newValue);
192
- }
193
- if (newValue.getFullYear() > 0) {
194
- this.setExisting(symbol, true);
195
- this.value = newValue;
196
- }
197
- };
198
- KendoDate.prototype.parsePart = function (symbol, currentChar, resetSegmentValue) {
199
- if (!currentChar) {
200
- this.resetLeadingZero();
201
- this.setExisting(symbol, false);
202
- return { value: null, switchToNext: false };
203
- }
204
- var baseDate = this.intl.formatDate(this.value, this.format);
205
- var dateParts = this.dateFormatString(this.value, this.format);
206
- var baseFormat = dateParts.symbols;
207
- var replaced = false;
208
- var prefix = "";
209
- var current = "";
210
- var suffix = "";
211
- for (var i = 0; i < baseDate.length; i++) {
212
- if (baseFormat[i] === symbol) {
213
- current += this.getExisting(symbol) ? baseDate[i] : "0";
214
- replaced = true;
215
- }
216
- else if (!replaced) {
217
- prefix += baseDate[i];
218
- }
219
- else {
220
- suffix += baseDate[i];
221
- }
222
- }
223
- var currentMaxLength = current.length - 3;
224
- var parsedDate = null;
225
- var month = this.matchMonth(currentChar);
226
- var dayPeriod = this.matchDayPeriod(currentChar, symbol);
227
- var isZeroCurrentChar = currentChar === '0';
228
- var leadingZero = (this.leadingZero || {})[symbol] || 0;
229
- if (isZeroCurrentChar) {
230
- var valueNumber = parseInt(resetSegmentValue ? currentChar : current + currentChar, 10);
231
- if (valueNumber === 0 && !this.isAbbrMonth(dateParts.partMap, symbol)) {
232
- this.incrementLeadingZero(symbol);
233
- }
234
- }
235
- else {
236
- this.resetLeadingZero();
237
- }
238
- for (var i = Math.max(0, currentMaxLength); i <= current.length; i++) {
239
- var middle = resetSegmentValue ? currentChar : (current.substring(i) + currentChar);
240
- if (symbol === "S" && resetSegmentValue) {
241
- // The "S" parser in intl parses "1" as 100ms in order to handle ISOString dates correctly, so to get 1ms, we need to pass "001"
242
- var padding = util_1.msPaddingFromFormat(baseFormat);
243
- middle = padding + middle;
244
- }
245
- var middleNumber = parseInt(middle, 10);
246
- parsedDate = this.intl.parseDate(prefix + middle + suffix, this.format);
247
- if (!parsedDate && !isNaN(middleNumber) && !isNaN(parseInt(currentChar, 10))) {
248
- if (symbol === 'M' && !month) {
249
- var monthNumber = middleNumber - 1;
250
- if (monthNumber > -1 && monthNumber < 12) {
251
- parsedDate = kendo_date_math_1.cloneDate(this.value);
252
- parsedDate.setMonth(monthNumber);
253
- if (parsedDate.getMonth() !== monthNumber) {
254
- parsedDate = kendo_date_math_1.lastDayOfMonth(kendo_date_math_1.addMonths(parsedDate, -1));
255
- }
256
- }
257
- }
258
- if (symbol === 'y') {
259
- parsedDate = kendo_date_math_1.createDate(parseInt(middle, 10), this.month ? this.value.getMonth() : 0, this.date ? this.value.getDate() : 1, this.hours ? this.value.getHours() : 0, this.minutes ? this.value.getMinutes() : 0, this.seconds ? this.value.getSeconds() : 0, this.milliseconds ? this.value.getMilliseconds() : 0);
260
- if (this.date && parsedDate.getDate() !== this.value.getDate()) {
261
- parsedDate = kendo_date_math_1.lastDayOfMonth(kendo_date_math_1.addMonths(parsedDate, -1));
262
- }
263
- }
264
- }
265
- if (parsedDate) {
266
- //move to next segment if the part will overflow with next char
267
- //when start from empty date (01, then 010), padded zeros should be trimmed
268
- var patternValue = this.partPattern(dateParts.partMap, symbol).pattern;
269
- var peekDate = this.intl.parseDate("" + prefix + this.peek(middle, patternValue) + suffix, this.format);
270
- var patternLength = this.patternLength(patternValue) || patternValue.length;
271
- var patternSatisfied = (leadingZero + (unpadZero(middle) || currentChar).length) >= patternLength;
272
- var switchToNext = peekDate === null || patternSatisfied;
273
- if (this.shouldNormalizeCentury()) {
274
- parsedDate = this.normalizeCentury(parsedDate);
275
- }
276
- this.value = parsedDate;
277
- this.setExisting(symbol, true);
278
- return { value: this.value, switchToNext: switchToNext };
279
- }
280
- }
281
- if (month) {
282
- parsedDate = this.intl.parseDate(prefix + month + suffix, this.format);
283
- if (parsedDate) {
284
- this.value = parsedDate;
285
- this.setExisting(symbol, true);
286
- return { value: this.value, switchToNext: false };
287
- }
288
- }
289
- if (dayPeriod) {
290
- parsedDate = this.intl.parseDate(prefix + dayPeriod + suffix, this.format);
291
- if (parsedDate) {
292
- this.value = parsedDate;
293
- return { value: this.value, switchToNext: true };
294
- }
295
- }
296
- if (isZeroCurrentChar) {
297
- this.setExisting(symbol, false);
298
- }
299
- return { value: null, switchToNext: false };
300
- };
301
- KendoDate.prototype.resetLeadingZero = function () {
302
- var hasLeadingZero = this.leadingZero !== null;
303
- this.setLeadingZero(null);
304
- return hasLeadingZero;
305
- };
306
- KendoDate.prototype.setLeadingZero = function (leadingZero) {
307
- this.leadingZero = leadingZero;
308
- };
309
- KendoDate.prototype.normalizeCentury = function (date) {
310
- if (!utils_1.isPresent(date)) {
311
- return date;
312
- }
313
- var twoDigitYear = util_1.cropTwoDigitYear(date);
314
- var centuryBase = this.getNormalizedCenturyBase(twoDigitYear);
315
- var normalizedDate = util_1.setYears(date, centuryBase + twoDigitYear);
316
- return normalizedDate;
317
- };
318
- KendoDate.prototype.incrementLeadingZero = function (symbol) {
319
- var leadingZero = this.leadingZero || {};
320
- leadingZero[symbol] = (leadingZero[symbol] || 0) + 1;
321
- this.leadingZero = leadingZero;
322
- };
323
- KendoDate.prototype.isAbbrMonth = function (parts, symbol) {
324
- var pattern = this.partPattern(parts, symbol);
325
- return pattern.type === 'month' && pattern.names;
326
- };
327
- KendoDate.prototype.partPattern = function (parts, symbol) {
328
- return parts.filter(function (part) { return part.pattern.indexOf(symbol) !== -1; })[0];
329
- };
330
- KendoDate.prototype.peek = function (value, pattern) {
331
- var peekValue = unpadZero(value) + '0';
332
- return padZero(pattern.length - peekValue.length) + peekValue;
333
- };
334
- KendoDate.prototype.matchMonth = function (typedChar) {
335
- this.typedMonthPart += typedChar.toLowerCase();
336
- if (!this.monthNames) {
337
- return "";
338
- }
339
- while (this.typedMonthPart.length > 0) {
340
- for (var i = 0; i < this.monthNames.length; i++) {
341
- if (this.monthNames[i].toLowerCase().indexOf(this.typedMonthPart) === 0) {
342
- return this.monthNames[i];
343
- }
344
- }
345
- var monthAsNum = parseInt(this.typedMonthPart, 10);
346
- if (monthAsNum >= 1 && monthAsNum <= 12 && monthAsNum.toString() === this.typedMonthPart /*ensure they exact match*/) {
347
- return this.monthNames[monthAsNum - 1];
348
- }
349
- this.typedMonthPart = this.typedMonthPart.substring(1, this.typedMonthPart.length);
350
- }
351
- return "";
352
- };
353
- KendoDate.prototype.matchDayPeriod = function (typedChar, symbol) {
354
- var lowerChart = String(typedChar).toLowerCase();
355
- if (symbol === 'a' && this.dayPeriods) {
356
- if (this.dayPeriods.am.toLowerCase().startsWith(lowerChart)) {
357
- return this.dayPeriods.am;
358
- }
359
- else if (this.dayPeriods.pm.toLowerCase().startsWith(lowerChart)) {
360
- return this.dayPeriods.pm;
361
- }
362
- }
363
- return '';
364
- };
365
- KendoDate.prototype.allFormatedMonths = function () {
366
- var dateFormatParts = this.intl.splitDateFormat(this.format);
367
- for (var i = 0; i < dateFormatParts.length; i++) {
368
- if (dateFormatParts[i].type === "month" && dateFormatParts[i].names) {
369
- return this.intl.dateFormatNames(dateFormatParts[i].names);
370
- }
371
- }
372
- return null;
373
- };
374
- KendoDate.prototype.allDayPeriods = function () {
375
- var dateFormatParts = this.intl.splitDateFormat(this.format);
376
- for (var i = 0; i < dateFormatParts.length; i++) {
377
- if (dateFormatParts[i].type === "dayperiod" && dateFormatParts[i].names) {
378
- return this.intl.dateFormatNames(dateFormatParts[i].names);
379
- }
380
- }
381
- return null;
382
- };
383
- KendoDate.prototype.patternLength = function (pattern) {
384
- if (pattern[0] === 'y') {
385
- return 4;
386
- }
387
- if (SHORT_PATTERN_LENGTH_REGEXP.test(pattern)) {
388
- return 2;
389
- }
390
- return 0;
391
- };
392
- //TODO: REMOVE!
393
- KendoDate.prototype.dateFormatString = function (date, format) {
394
- var dateFormatParts = this.intl.splitDateFormat(format);
395
- var parts = [];
396
- var partMap = [];
397
- for (var i = 0; i < dateFormatParts.length; i++) {
398
- var partLength = this.intl.formatDate(date, { pattern: dateFormatParts[i].pattern }).length;
399
- while (partLength > 0) {
400
- parts.push(this.symbols[dateFormatParts[i].pattern[0]] || "_");
401
- partMap.push(dateFormatParts[i]);
402
- partLength--;
403
- }
404
- }
405
- var returnValue = new Mask();
406
- returnValue.symbols = parts.join("");
407
- returnValue.partMap = partMap;
408
- return returnValue;
409
- };
410
- KendoDate.prototype.merge = function (text, mask) {
411
- // Important: right to left.
412
- var resultText = "";
413
- var resultFormat = "";
414
- var format = mask.symbols;
415
- for (var r = format.length - 1; r >= 0; r--) {
416
- if (this.knownParts.indexOf(format[r]) === -1 || this.getExisting(format[r])) {
417
- resultText = text[r] + resultText;
418
- resultFormat = format[r] + resultFormat;
419
- }
420
- else {
421
- var currentSymbol = format[r];
422
- while (r >= 0 && currentSymbol === format[r]) {
423
- r--;
424
- }
425
- r++;
426
- if (this.leadingZero && this.leadingZero[currentSymbol]) {
427
- resultText = '0' + resultText;
428
- }
429
- else {
430
- resultText = this.dateFieldName(mask.partMap[r]) + resultText;
431
- }
432
- while (resultFormat.length < resultText.length) {
433
- resultFormat = format[r] + resultFormat;
434
- }
435
- }
436
- }
437
- return [resultText, resultFormat];
438
- };
439
- KendoDate.prototype.dateFieldName = function (part) {
440
- var formatPlaceholder = this.formatPlaceholder || 'wide';
441
- if (formatPlaceholder[part.type]) {
442
- return formatPlaceholder[part.type];
443
- }
444
- if (formatPlaceholder === 'formatPattern') {
445
- return part.pattern;
446
- }
447
- return this.intl.dateFieldName(Object.assign(part, { nameType: formatPlaceholder }));
448
- };
449
- KendoDate.prototype.getNormalizedCenturyBase = function (twoDigitYear) {
450
- return twoDigitYear > this.twoDigitYearMax ?
451
- PREVIOUS_CENTURY_BASE :
452
- CURRENT_CENTURY_BASE;
453
- };
454
- return KendoDate;
455
- }());
456
- /**
457
- * Represents the [Kendo UI DateInput component for Angular]({% slug overview_dateinput %}#toc-basic-usage).
458
- */
459
- var DateInputComponent = /** @class */ (function () {
460
- function DateInputComponent(cdr, intl, renderer, wrapper, ngZone, injector, localization, pickerService) {
461
- this.cdr = cdr;
462
- this.intl = intl;
463
- this.renderer = renderer;
464
- this.wrapper = wrapper;
465
- this.ngZone = ngZone;
466
- this.injector = injector;
467
- this.localization = localization;
468
- this.pickerService = pickerService;
469
- /**
470
- * @hidden
471
- */
472
- this.focusableId = "k-" + kendo_angular_common_1.guid();
473
- /**
474
- * Sets or gets the `disabled` property of the DateInput and
475
- * determines whether the component is active
476
- * ([see example]({% slug disabled_dateinput %})).
477
- */
478
- this.disabled = false;
479
- /**
480
- * Sets or gets the read-only state of the DateInput
481
- * ([see example]({% slug readonly_dateinput %})).
482
- */
483
- this.readonly = false;
484
- /**
485
- * Sets the title of the input element of the DateInput.
486
- */
487
- this.title = "";
488
- /**
489
- * Sets or gets the `tabIndex` property of the DateInput.
490
- * .
491
- */
492
- this.tabindex = 0;
493
- /**
494
- * @hidden
495
- */
496
- this.role = 'spinbutton';
497
- /**
498
- * @hidden
499
- */
500
- this.ariaReadOnly = false;
501
- /**
502
- * Specifies the date format that is used to display the input value
503
- * ([see example]({% slug formats_dateinput %})).
504
- *
505
- * Format value options:
506
- * - `string` - Provide a `string` if a single format is going to be used regardless whether the input is focused or blurred.
507
- * - [`FormatSettings`]({% slug api_dateinputs_formatsettings %}) - To display different formats when the component is focused or blurred, provide a settings object with specified `inputFormat` and `displayFormat` values.
508
- */
509
- this.format = DEFAULT_FORMAT;
510
- /**
511
- * Specifies the hint the DateInput displays when its value is `null`.
512
- * For more information, refer to the article on
513
- * [placeholders]({% slug placeholders_dateinput %}).
514
- *
515
- * @example
516
- * ```ts
517
- * _@Component({
518
- * selector: 'my-app',
519
- * template: `
520
- * <kendo-dateinput placeholder="Enter birth date..."></kendo-dateinput>
521
- * `
522
- * })
523
- * export class AppComponent { }
524
- * ```
525
- */
526
- this.placeholder = null;
527
- /**
528
- * Configures the incremental steps of the DateInput.
529
- * For more information, refer to the article on
530
- * [incremental steps]({% slug incrementalsteps_dateinput %}).
531
- *
532
- * @example
533
- * ```ts
534
- * _@Component({
535
- * selector: 'my-app',
536
- * template: `
537
- * <kendo-dateinput [steps]="steps"></kendo-dateinput>
538
- * `
539
- * })
540
- * export class AppComponent {
541
- * public steps = { year: 10, month: 1, day: 5 };
542
- * }
543
- * ```
544
- */
545
- this.steps = {};
546
- /**
547
- * Determines whether the built-in min or max validators are to be enforced when a form is being validated.
548
- */
549
- this.rangeValidation = true;
550
- /**
551
- * @hidden
552
- * Based on the min and max values, specifies whether the value will be auto-corrected while typing.
553
- */
554
- this.autoCorrect = false;
555
- /**
556
- * Determines whether the built-in validation for incomplete dates is to be enforced when a form is being validated.
557
- */
558
- this.incompleteDateValidation = false;
559
- /**
560
- * The maximum year to assume to be from the current century when typing two-digit year value
561
- * ([see example]({% slug formats_dateinput %}#toc-two-digit-year-format)).
562
- *
563
- * The default value is 68, indicating that typing any value less than 69
564
- * will be assumed to be 20xx, while 69 and larger will be assumed to be 19xx.
565
- */
566
- this.twoDigitYearMax = TWO_DIGIT_YEAR_MAX;
567
- /**
568
- * Specifies whether the **Up** and **Down** spin buttons will be rendered.
569
- * For more information, refer to the article on
570
- * [spinner buttons]({% slug spinbuttons_dateinput %}).
571
- */
572
- this.spinners = false;
573
- /**
574
- * @hidden
575
- */
576
- this.isPopupOpen = false;
577
- /**
578
- * @hidden
579
- */
580
- this.hasPopup = false;
581
- /**
582
- * Fires each time the user selects a new value.
583
- * For more information, refer to the section on
584
- * [events]({% slug overview_dateinput %}#toc-events).
585
- */
586
- this.valueChange = new core_1.EventEmitter();
587
- /**
588
- * @hidden
589
- * Fires each time the user selects a new value.
590
- * For more information, refer to the section on
591
- * [events]({% slug overview_dateinput %}#toc-events).
592
- */
593
- this.valueUpdate = new core_1.EventEmitter();
594
- /**
595
- * Fires each time the user focuses the input element.
596
- * For more information, refer to the section on
597
- * [events]({% slug overview_dateinput %}#toc-events).
598
- *
599
- * > To wire the event programmatically, use the `onFocus` property.
600
- *
601
- * @example
602
- * ```ts
603
- * _@Component({
604
- * selector: 'my-app',
605
- * template: `
606
- * <kendo-dateinput (focus)="handleFocus()"></kendo-dateinput>
607
- * `
608
- * })
609
- * export class AppComponent {
610
- * public handleFocus(): void {
611
- * console.log("Component is focused");
612
- * }
613
- * }
614
- * ```
615
- *
616
- */
617
- this.onFocus = new core_1.EventEmitter(); //tslint:disable-line:no-output-rename
618
- /**
619
- * Fires each time the input element gets blurred.
620
- * For more information, refer to the section on
621
- * [events]({% slug overview_dateinput %}#toc-events).
622
- *
623
- * > To wire the event programmatically, use the `onBlur` property.
624
- *
625
- * @example
626
- * ```ts
627
- * _@Component({
628
- * selector: 'my-app',
629
- * template: `
630
- * <kendo-dateinput (blur)="handleBlur()"></kendo-dateinput>
631
- * `
632
- * })
633
- * export class AppComponent {
634
- * public handleBlur(): void {
635
- * console.log("Component is blurred");
636
- * }
637
- * }
638
- * ```
639
- *
640
- */
641
- this.onBlur = new core_1.EventEmitter(); //tslint:disable-line:no-output-rename
642
- this.arrow = arrow_enum_1.Arrow;
643
- this.arrowDirection = arrow_enum_1.Arrow.None;
644
- this.formatSections = { date: false, time: false };
645
- this.hasMousedown = false;
646
- this.focusedPriorToMousedown = false;
647
- /**
648
- * @hidden
649
- */
650
- this.isDateIncomplete = false;
651
- this.currentValue = "";
652
- this.currentFormat = "";
653
- this.backspace = false;
654
- this.resetSegmentValue = true;
655
- this.minValidator = util_1.noop;
656
- this.maxValidator = util_1.noop;
657
- this.incompleteValidator = util_1.noop;
658
- this._value = null;
659
- this._active = false;
660
- this.kendoDate = null;
661
- this.paste = false;
662
- this.domEvents = [];
663
- this.onControlChange = util_1.noop;
664
- this.onControlTouched = util_1.noop;
665
- this.onValidatorChange = util_1.noop;
666
- this._size = 'medium';
667
- this._rounded = 'medium';
668
- this._fillMode = 'solid';
669
- this.symbolsMap = this.dateSymbolMap();
670
- this.updateFormatSections();
671
- if (this.pickerService) {
672
- this.pickerService.input = this;
673
- }
674
- }
675
- DateInputComponent_1 = DateInputComponent;
676
- Object.defineProperty(DateInputComponent.prototype, "tabIndex", {
677
- get: function () {
678
- return this.tabindex;
679
- },
680
- /**
681
- * @hidden
682
- */
683
- set: function (tabIndex) {
684
- this.tabindex = tabIndex;
685
- },
686
- enumerable: true,
687
- configurable: true
688
- });
689
- Object.defineProperty(DateInputComponent.prototype, "value", {
690
- get: function () {
691
- return this._value;
692
- },
693
- /**
694
- * Specifies the value of the DateInput component.
695
- *
696
- * > The `value` has to be a valid [JavaScript `Date`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date) instance.
697
- */
698
- set: function (value) {
699
- this.verifyValue(value);
700
- if (this.autoCorrect && !util_1.isInRange(value, this.min, this.max)) {
701
- return;
702
- }
703
- this._value = kendo_date_math_1.cloneDate(value);
704
- this.valueUpdate.emit(kendo_date_math_1.cloneDate(value));
705
- },
706
- enumerable: true,
707
- configurable: true
708
- });
709
- Object.defineProperty(DateInputComponent.prototype, "size", {
710
- get: function () {
711
- return this._size;
712
- },
713
- /**
714
- * Sets the size of the component.
715
- *
716
- * The possible values are:
717
- * * `'small'`
718
- * * `'medium'` (Default)
719
- * * `'large'`
720
- * * `null`
721
- *
722
- */
723
- set: function (size) {
724
- this.renderer.removeClass(this.wrapper.nativeElement, util_1.getSizeClass('input', this.size));
725
- if (size) {
726
- this.renderer.addClass(this.wrapper.nativeElement, util_1.getSizeClass('input', size));
727
- }
728
- this._size = size;
729
- },
730
- enumerable: true,
731
- configurable: true
732
- });
733
- Object.defineProperty(DateInputComponent.prototype, "rounded", {
734
- get: function () {
735
- return this._rounded;
736
- },
737
- /**
738
- * Sets the border radius of the component.
739
- *
740
- * The possible values are:
741
- * * `'small'`
742
- * * `'medium'` (Default)
743
- * * `'large'`
744
- * * `'full'`
745
- * * `null`
746
- *
747
- */
748
- set: function (rounded) {
749
- this.renderer.removeClass(this.wrapper.nativeElement, util_1.getRoundedClass(this.rounded));
750
- if (rounded) {
751
- this.renderer.addClass(this.wrapper.nativeElement, util_1.getRoundedClass(rounded));
752
- }
753
- this._rounded = rounded;
754
- },
755
- enumerable: true,
756
- configurable: true
757
- });
758
- Object.defineProperty(DateInputComponent.prototype, "fillMode", {
759
- get: function () {
760
- return this._fillMode;
761
- },
762
- /**
763
- * Sets the fillMode of the component.
764
- *
765
- * The possible values are:
766
- * * `'solid'` (Default)
767
- * * `'flat'`
768
- * * `'outline'`
769
- * * `null`
770
- *
771
- */
772
- set: function (fillMode) {
773
- this.renderer.removeClass(this.wrapper.nativeElement, util_1.getFillModeClass('input', this.fillMode));
774
- if (fillMode) {
775
- this.renderer.addClass(this.wrapper.nativeElement, util_1.getFillModeClass('input', fillMode));
776
- if (this.spinners && this.spinup && this.spindown) {
777
- this.setSpinnerFill(this.spinup.nativeElement, fillMode, this.fillMode);
778
- this.setSpinnerFill(this.spindown.nativeElement, fillMode, this.fillMode);
779
- }
780
- }
781
- this._fillMode = fillMode;
782
- },
783
- enumerable: true,
784
- configurable: true
785
- });
786
- Object.defineProperty(DateInputComponent.prototype, "wrapperClass", {
787
- get: function () {
788
- return true;
789
- },
790
- enumerable: true,
791
- configurable: true
792
- });
793
- Object.defineProperty(DateInputComponent.prototype, "disabledClass", {
794
- get: function () {
795
- return this.disabled;
796
- },
797
- enumerable: true,
798
- configurable: true
799
- });
800
- Object.defineProperty(DateInputComponent.prototype, "inputElement", {
801
- get: function () {
802
- return this.dateInput ? this.dateInput.nativeElement : null;
803
- },
804
- enumerable: true,
805
- configurable: true
806
- });
807
- Object.defineProperty(DateInputComponent.prototype, "inputValue", {
808
- get: function () {
809
- return (this.inputElement || {}).value || '';
810
- },
811
- enumerable: true,
812
- configurable: true
813
- });
814
- Object.defineProperty(DateInputComponent.prototype, "isActive", {
815
- get: function () {
816
- return this._active;
817
- },
818
- set: function (value) {
819
- this._active = value;
820
- if (!this.wrapper) {
821
- return;
822
- }
823
- if (!utils_1.isPresent(this.pickerService)) {
824
- var element = this.wrapper.nativeElement;
825
- if (value) {
826
- this.renderer.addClass(element, 'k-focus');
827
- }
828
- else {
829
- this.renderer.removeClass(element, 'k-focus');
830
- }
831
- }
832
- },
833
- enumerable: true,
834
- configurable: true
835
- });
836
- Object.defineProperty(DateInputComponent.prototype, "inputFormat", {
837
- get: function () {
838
- if (!this.format) {
839
- return DEFAULT_FORMAT;
840
- }
841
- if (typeof this.format === 'string') {
842
- return this.format;
843
- }
844
- else {
845
- return this.format.inputFormat;
846
- }
847
- },
848
- enumerable: true,
849
- configurable: true
850
- });
851
- Object.defineProperty(DateInputComponent.prototype, "displayFormat", {
852
- get: function () {
853
- if (!this.format) {
854
- return DEFAULT_FORMAT;
855
- }
856
- if (typeof this.format === 'string') {
857
- return this.format;
858
- }
859
- else {
860
- return this.format.displayFormat;
861
- }
862
- },
863
- enumerable: true,
864
- configurable: true
865
- });
866
- /**
867
- * @hidden
868
- * Used by the TextBoxContainer to determine if the component is empty
869
- */
870
- DateInputComponent.prototype.isEmpty = function () {
871
- return !this.currentValue || !String(this.currentValue).trim();
872
- };
873
- /**
874
- * @hidden
875
- */
876
- DateInputComponent.prototype.containsElement = function (element) {
877
- var _this = this;
878
- return Boolean(dom_queries_1.closest(element, function (node) { return node === _this.wrapper.nativeElement; }));
879
- };
880
- /**
881
- * @hidden
882
- */
883
- DateInputComponent.prototype.ngOnChanges = function (changes) {
884
- this.verifyRange();
885
- if (changes.min || changes.max || changes.rangeValidation || changes.incompleteDateValidation) {
886
- this.minValidator = this.rangeValidation ? min_validator_1.minValidator(this.min) : util_1.noop;
887
- this.maxValidator = this.rangeValidation ? max_validator_1.maxValidator(this.max) : util_1.noop;
888
- this.incompleteValidator = this.incompleteDateValidation ? incomplete_date_validator_1.incompleteDateValidator() : util_1.noop;
889
- this.onValidatorChange();
890
- }
891
- if (changes.format) {
892
- this.symbolsMap = this.dateSymbolMap();
893
- this.updateFormatSections();
894
- }
895
- var isEqualToKendoDate = this.kendoDate && kendo_date_math_1.isEqual(this.value, this.kendoDate.getDateObject());
896
- if (changes.format || !isEqualToKendoDate || changes.placeholder) {
897
- this.kendoDate = this.getKendoDate(this.value);
898
- this.updateElementValue(this.isActive);
899
- }
900
- };
901
- DateInputComponent.prototype.ngOnDestroy = function () {
902
- if (this.intlSubscription) {
903
- this.intlSubscription.unsubscribe();
904
- }
905
- if (this.pickerService) {
906
- this.pickerService.input = null;
907
- }
908
- this.domEvents.forEach(function (unbindCallback) { return unbindCallback(); });
909
- };
910
- /**
911
- * @hidden
912
- */
913
- DateInputComponent.prototype.validate = function (control) {
914
- return this.minValidator(control) || this.maxValidator(control) || this.incompleteValidator(control, this.isDateIncomplete);
915
- };
916
- /**
917
- * @hidden
918
- */
919
- DateInputComponent.prototype.registerOnValidatorChange = function (fn) {
920
- this.onValidatorChange = fn;
921
- };
922
- /**
923
- * @hidden
924
- */
925
- DateInputComponent.prototype.ngOnInit = function () {
926
- var _this = this;
927
- this.kendoDate = this.getKendoDate(this.value);
928
- this.updateElementValue();
929
- this.intlSubscription = this.intl.changes.subscribe(this.intlChange.bind(this));
930
- this.ngControl = this.injector.get(forms_1.NgControl, null);
931
- if (this.wrapper) {
932
- this.renderer.removeAttribute(this.wrapper.nativeElement, 'tabindex');
933
- this.ngZone.runOutsideAngular(function () {
934
- _this.bindEvents();
935
- });
936
- }
937
- };
938
- DateInputComponent.prototype.ngAfterViewInit = function () {
939
- this.setComponentClasses();
940
- };
941
- /**
942
- * @hidden
943
- */
944
- DateInputComponent.prototype.setDisabledState = function (isDisabled) {
945
- this.disabled = isDisabled;
946
- this.cdr.markForCheck();
947
- };
948
- //ngModel binding
949
- /**
950
- * @hidden
951
- */
952
- DateInputComponent.prototype.writeValue = function (value) {
953
- this.verifyValue(value);
954
- this.kendoDate = this.getKendoDate(value);
955
- this.value = kendo_date_math_1.cloneDate(value);
956
- this.updateElementValue(this.isActive);
957
- };
958
- /**
959
- * @hidden
960
- */
961
- DateInputComponent.prototype.triggerChange = function () {
962
- var value = this.kendoDate.getDateObject();
963
- if (+value !== +this.value) {
964
- this.value = kendo_date_math_1.cloneDate(value);
965
- this.notify();
966
- }
967
- };
968
- /**
969
- * @hidden
970
- */
971
- DateInputComponent.prototype.notify = function () {
972
- var _this = this;
973
- this.ngZone.run(function () {
974
- _this.onControlChange(kendo_date_math_1.cloneDate(_this.value));
975
- _this.valueChange.emit(kendo_date_math_1.cloneDate(_this.value));
976
- });
977
- };
978
- /**
979
- * @hidden
980
- */
981
- DateInputComponent.prototype.registerOnChange = function (fn) {
982
- this.onControlChange = fn;
983
- };
984
- /**
985
- * @hidden
986
- */
987
- DateInputComponent.prototype.registerOnTouched = function (fn) {
988
- this.onControlTouched = fn;
989
- };
990
- /**
991
- * Focuses the DateInput component.
992
- *
993
- * @example
994
- * ```ts
995
- * _@Component({
996
- * selector: 'my-app',
997
- * template: `
998
- * <button (click)="dateinput.focus()">Focus date input</button>
999
- * <kendo-dateinput #dateinput></kendo-dateinput>
1000
- * `
1001
- * })
1002
- * export class AppComponent { }
1003
- * ```
1004
- */
1005
- DateInputComponent.prototype.focus = function () {
1006
- var input = this.inputElement;
1007
- if (input) {
1008
- input.focus();
1009
- this.selectDateSegment(this.currentFormat[0]);
1010
- }
1011
- };
1012
- /**
1013
- * Blurs the DateInput component.
1014
- */
1015
- DateInputComponent.prototype.blur = function () {
1016
- var input = this.inputElement;
1017
- if (input) {
1018
- input.blur();
1019
- }
1020
- };
1021
- /**
1022
- * @hidden
1023
- */
1024
- DateInputComponent.prototype.handleButtonClick = function (offset) {
1025
- this.arrowDirection = arrow_enum_1.Arrow.None;
1026
- this.modifyDateSegmentValue(offset);
1027
- };
1028
- /**
1029
- * @hidden
1030
- */
1031
- DateInputComponent.prototype.modifyDateSegmentValue = function (offset) {
1032
- var caret = this.caret();
1033
- var symbol = this.currentFormat[caret[0]];
1034
- var step = (this.steps || {})[this.symbolsMap[symbol]] || 1;
1035
- if (symbol === "S" && !this.steps.millisecond) {
1036
- var msDigits = util_1.millisecondDigitsInFormat(this.inputFormat);
1037
- step = util_1.millisecondStepFor(msDigits);
1038
- }
1039
- this.kendoDate.modifyPart(symbol, offset * step);
1040
- this.putDateInRange();
1041
- this.updateElementValue(this.isActive);
1042
- this.triggerChange();
1043
- this.selectDateSegment(symbol);
1044
- this.updateIncompleteValidationStatus();
1045
- };
1046
- /**
1047
- * @hidden
1048
- */
1049
- DateInputComponent.prototype.switchDateSegment = function (offset) {
1050
- var caret = this.caret();
1051
- if (this.kendoDate.resetLeadingZero()) {
1052
- this.updateElementValue(this.isActive);
1053
- }
1054
- if (caret[0] < caret[1] && this.currentFormat[caret[0]] !== this.currentFormat[caret[1] - 1]) {
1055
- this.selectNearestSegment(offset > 0 ? caret[0] : caret[1] - 1);
1056
- this.resetSegmentValue = true;
1057
- return true;
1058
- }
1059
- var previousFormatSymbol = this.currentFormat[caret[0]];
1060
- var a = caret[0] + offset;
1061
- while (a > 0 && a < this.currentFormat.length) {
1062
- if (this.currentFormat[a] !== previousFormatSymbol &&
1063
- this.currentFormat[a] !== "_") {
1064
- break;
1065
- }
1066
- a += offset;
1067
- }
1068
- if (this.currentFormat[a] === "_") {
1069
- //there is not known symbol found
1070
- return false;
1071
- }
1072
- var b = a;
1073
- while (b >= 0 && b < this.currentFormat.length) {
1074
- if (this.currentFormat[b] !== this.currentFormat[a]) {
1075
- break;
1076
- }
1077
- b += offset;
1078
- }
1079
- if (a > b && (b + 1 !== caret[0] || a + 1 !== caret[1])) {
1080
- this.caret(b + 1, a + 1);
1081
- this.resetSegmentValue = true;
1082
- return true;
1083
- }
1084
- else if (a < b && (a !== caret[0] || b !== caret[1])) {
1085
- this.caret(a, b);
1086
- this.resetSegmentValue = true;
1087
- return true;
1088
- }
1089
- return false;
1090
- };
1091
- /**
1092
- * @hidden
1093
- */
1094
- DateInputComponent.prototype.selectDateSegment = function (symbol) {
1095
- var begin = -1;
1096
- var end = 0;
1097
- for (var i = 0; i < this.currentFormat.length; i++) {
1098
- if (this.currentFormat[i] === symbol) {
1099
- end = i + 1;
1100
- if (begin === -1) {
1101
- begin = i;
1102
- }
1103
- }
1104
- }
1105
- if (begin < 0) {
1106
- begin = 0;
1107
- }
1108
- this.caret(0, 0);
1109
- this.caret(begin, end);
1110
- };
1111
- /**
1112
- * @hidden
1113
- */
1114
- DateInputComponent.prototype.handleClick = function () {
1115
- this.hasMousedown = false;
1116
- if (this.isActive) {
1117
- var selectionPresent = this.inputElement.selectionStart !== this.inputElement.selectionEnd;
1118
- var placeholderToggled = utils_1.isPresent(this.placeholder) && !this.kendoDate.hasValue() && !this.focusedPriorToMousedown;
1119
- // focus first segment if the user hasn't selected something during mousedown and if the placeholder was just toggled
1120
- var selectFirstSegment = !selectionPresent && placeholderToggled;
1121
- var index = selectFirstSegment ? 0 : this.caret()[0];
1122
- this.selectNearestSegment(index);
1123
- }
1124
- };
1125
- /**
1126
- * @hidden
1127
- */
1128
- DateInputComponent.prototype.handleDragAndDrop = function (args) {
1129
- args.preventDefault();
1130
- };
1131
- /**
1132
- * @hidden
1133
- */
1134
- DateInputComponent.prototype.handleMousedown = function () {
1135
- this.hasMousedown = true;
1136
- this.focusedPriorToMousedown = this.isActive;
1137
- };
1138
- /**
1139
- * @hidden
1140
- */
1141
- DateInputComponent.prototype.handleFocus = function (args) {
1142
- var _this = this;
1143
- this.isActive = true;
1144
- this.updateElementValue();
1145
- if (!this.hasMousedown) {
1146
- this.caret(0, this.inputValue.length);
1147
- }
1148
- this.hasMousedown = false;
1149
- if (kendo_angular_common_1.hasObservers(this.onFocus)) {
1150
- this.ngZone.run(function () {
1151
- _this.emitFocus(args);
1152
- });
1153
- }
1154
- else {
1155
- this.emitFocus(args);
1156
- }
1157
- };
1158
- /**
1159
- * @hidden
1160
- */
1161
- DateInputComponent.prototype.handleBlur = function (args) {
1162
- var _this = this;
1163
- this.isActive = false;
1164
- this.resetSegmentValue = true;
1165
- this.kendoDate.resetLeadingZero();
1166
- this.updateElementValue();
1167
- if (kendo_angular_common_1.hasObservers(this.onBlur) || utils_1.requiresZoneOnBlur(this.ngControl)) {
1168
- this.ngZone.run(function () {
1169
- _this.onControlTouched();
1170
- _this.emitBlur(args);
1171
- _this.cdr.markForCheck();
1172
- });
1173
- }
1174
- else {
1175
- this.emitBlur(args);
1176
- }
1177
- };
1178
- DateInputComponent.prototype.getKendoDate = function (value) {
1179
- var leadingZero = ((this.kendoDate || {}) || null).leadingZero;
1180
- var kendoDate = new KendoDate(this.intl, this.formatPlaceholder, this.inputFormat, value, this.twoDigitYearMax);
1181
- kendoDate.setLeadingZero(this.isActive ? leadingZero : null);
1182
- return kendoDate;
1183
- };
1184
- DateInputComponent.prototype.dateSymbolMap = function () {
1185
- var reducer = function (map, part) {
1186
- map[part.pattern[0]] = part.type;
1187
- return map;
1188
- };
1189
- return this.intl.splitDateFormat(this.inputFormat).reduce(reducer, {});
1190
- };
1191
- DateInputComponent.prototype.updateElementValue = function (isActive) {
1192
- var start = this.caret()[0]; //XXX: get caret position before input is updated
1193
- var format = this.isActive ? this.inputFormat : this.displayFormat;
1194
- var texts = this.kendoDate.getTextAndFormat(format);
1195
- var showPlaceholder = !this.isActive && utils_1.isPresent(this.placeholder) && !this.kendoDate.hasValue();
1196
- var input = this.inputElement;
1197
- this.currentFormat = texts[1];
1198
- this.currentValue = !showPlaceholder ? texts[0] : '';
1199
- this.renderer.setProperty(input, "value", this.currentValue);
1200
- if (input.placeholder !== this.placeholder) {
1201
- this.renderer.setProperty(input, "placeholder", this.placeholder);
1202
- }
1203
- if (isActive) {
1204
- this.selectNearestSegment(start);
1205
- }
1206
- };
1207
- DateInputComponent.prototype.caret = function (start, end) {
1208
- if (end === void 0) { end = start; }
1209
- var isPosition = start !== undefined;
1210
- var returnValue = [start, start];
1211
- var element = this.inputElement;
1212
- if (isPosition && (this.disabled || this.readonly)) {
1213
- return undefined;
1214
- }
1215
- try {
1216
- if (element.selectionStart !== undefined) {
1217
- if (isPosition) {
1218
- if (kendo_angular_common_1.isDocumentAvailable() && document.activeElement !== element) {
1219
- element.focus();
1220
- }
1221
- element.setSelectionRange(start, end);
1222
- }
1223
- returnValue = [element.selectionStart, element.selectionEnd];
1224
- }
1225
- }
1226
- catch (e) {
1227
- returnValue = [];
1228
- }
1229
- return returnValue;
1230
- };
1231
- DateInputComponent.prototype.selectNearestSegment = function (index) {
1232
- // Finds the nearest (in both directions) known part.
1233
- for (var i = index, j = index - 1; i < this.currentFormat.length || j >= 0; i++, j--) {
1234
- if (i < this.currentFormat.length && this.currentFormat[i] !== "_") {
1235
- this.selectDateSegment(this.currentFormat[i]);
1236
- return;
1237
- }
1238
- if (j >= 0 && this.currentFormat[j] !== "_") {
1239
- this.selectDateSegment(this.currentFormat[j]);
1240
- return;
1241
- }
1242
- }
1243
- };
1244
- DateInputComponent.prototype.verifyRange = function () {
1245
- if (!core_1.isDevMode()) {
1246
- return;
1247
- }
1248
- if (!util_1.isValidRange(this.min, this.max)) {
1249
- throw new Error("The max value should be bigger than the min. See " + MIN_DOC_LINK + " and " + MAX_DOC_LINK + ".");
1250
- }
1251
- };
1252
- DateInputComponent.prototype.verifyValue = function (value) {
1253
- if (!core_1.isDevMode()) {
1254
- return;
1255
- }
1256
- if (value && !(value instanceof Date)) {
1257
- throw new Error("The 'value' should be a valid JavaScript Date instance. Check " + VALUE_DOC_LINK + " for possible resolution.");
1258
- }
1259
- };
1260
- DateInputComponent.prototype.putDateInRange = function () {
1261
- var currentDate = this.kendoDate.getDateObject();
1262
- var candidate = util_1.dateInRange(currentDate, this.min, this.max);
1263
- if (this.autoCorrect && !kendo_date_math_1.isEqual(currentDate, candidate)) {
1264
- this.kendoDate = this.getKendoDate(candidate);
1265
- }
1266
- };
1267
- DateInputComponent.prototype.updateFormatSections = function () {
1268
- this.formatSections = this.intl.splitDateFormat(this.inputFormat)
1269
- .reduce(function (_a, p) {
1270
- var date = _a.date, time = _a.time;
1271
- return {
1272
- date: date || DATE_PART_REGEXP.test(p.type),
1273
- time: time || TIME_PART_REGEXP.test(p.type)
1274
- };
1275
- }, { date: false, time: false });
1276
- };
1277
- DateInputComponent.prototype.intlChange = function () {
1278
- this.updateFormatSections();
1279
- this.kendoDate = this.getKendoDate(this.value);
1280
- this.updateElementValue(this.isActive);
1281
- };
1282
- DateInputComponent.prototype.updateOnPaste = function () {
1283
- var value = this.intl.parseDate(this.inputValue, this.inputFormat) || this.value;
1284
- if (utils_1.isPresent(value) && this.kendoDate.shouldNormalizeCentury()) {
1285
- value = this.kendoDate.normalizeCentury(value);
1286
- }
1287
- var notify = +value !== +this.value;
1288
- this.writeValue(value);
1289
- if (notify) {
1290
- this.notify();
1291
- }
1292
- };
1293
- DateInputComponent.prototype.bindEvents = function () {
1294
- var element = this.wrapper.nativeElement;
1295
- var mousewheelHandler = this.handleMouseWheel.bind(this);
1296
- this.domEvents.push(this.renderer.listen(element, 'DOMMouseScroll', mousewheelHandler), this.renderer.listen(element, 'mousewheel', mousewheelHandler), this.renderer.listen(element, 'keydown', this.handleKeydown.bind(this)), this.renderer.listen(element, 'paste', this.handlePaste.bind(this)), this.renderer.listen(element, 'input', this.handleInput.bind(this)));
1297
- };
1298
- DateInputComponent.prototype.handleMouseWheel = function (event) {
1299
- if (this.disabled || this.readonly || !this.isActive) {
1300
- return;
1301
- }
1302
- /* tslint:disable-next-line:deprecation */
1303
- event = window.event || event;
1304
- if (event.shiftKey) {
1305
- this.switchDateSegment((event.wheelDelta || -event.detail) > 0 ? -1 : 1);
1306
- }
1307
- else {
1308
- this.modifyDateSegmentValue((event.wheelDelta || -event.detail) > 0 ? 1 : -1);
1309
- }
1310
- event.returnValue = false;
1311
- if (event.preventDefault) {
1312
- event.preventDefault();
1313
- }
1314
- if (event.stopPropagation) {
1315
- event.stopPropagation();
1316
- }
1317
- };
1318
- DateInputComponent.prototype.handlePaste = function () {
1319
- this.paste = true;
1320
- };
1321
- DateInputComponent.prototype.handleKeydown = function (event) {
1322
- if (this.disabled || this.readonly || event.altKey || event.ctrlKey || event.metaKey) {
1323
- return;
1324
- }
1325
- if (event.keyCode === kendo_angular_common_1.Keys.Tab) {
1326
- var moved = this.switchDateSegment(event.shiftKey ? -1 : 1);
1327
- if (moved) {
1328
- event.preventDefault();
1329
- }
1330
- return;
1331
- }
1332
- if (event.keyCode === kendo_angular_common_1.Keys.Backspace) {
1333
- this.backspace = true;
1334
- return;
1335
- }
1336
- switch (event.keyCode) {
1337
- case kendo_angular_common_1.Keys.ArrowDown:
1338
- this.modifyDateSegmentValue(-1);
1339
- break;
1340
- case kendo_angular_common_1.Keys.ArrowUp:
1341
- this.modifyDateSegmentValue(1);
1342
- break;
1343
- case kendo_angular_common_1.Keys.ArrowRight:
1344
- this.switchDateSegment(1);
1345
- break;
1346
- case kendo_angular_common_1.Keys.ArrowLeft:
1347
- this.switchDateSegment(-1);
1348
- break;
1349
- case kendo_angular_common_1.Keys.Home:
1350
- this.selectNearestSegment(0);
1351
- break;
1352
- case kendo_angular_common_1.Keys.End:
1353
- this.selectNearestSegment(this.inputValue.length);
1354
- break;
1355
- default:
1356
- return; //skip the preventDefault if we didn't handled the keyCode
1357
- }
1358
- event.preventDefault();
1359
- };
1360
- DateInputComponent.prototype.handleInput = function () {
1361
- if (this.disabled || this.readonly) {
1362
- return;
1363
- }
1364
- if (this.paste) {
1365
- this.updateOnPaste();
1366
- this.paste = false;
1367
- return;
1368
- }
1369
- var diff = util_1.approximateStringMatching(this.currentValue, this.currentFormat, this.inputValue, this.caret()[0]);
1370
- var navigationOnly = (diff.length === 1 && diff[0][1] === "_");
1371
- var switchPart = false;
1372
- if (!navigationOnly) {
1373
- var parsedPart = void 0;
1374
- for (var i = 0; i < diff.length; i++) {
1375
- parsedPart = this.kendoDate.parsePart(diff[i][0], diff[i][1], this.resetSegmentValue);
1376
- switchPart = parsedPart.switchToNext;
1377
- }
1378
- var candidate = this.kendoDate.getDateObject();
1379
- if (this.value && candidate && !this.formatSections.date) {
1380
- this.kendoDate = this.getKendoDate(util_1.setTime(this.value, candidate));
1381
- }
1382
- }
1383
- this.resetSegmentValue = false;
1384
- this.putDateInRange();
1385
- this.updateElementValue(this.isActive);
1386
- this.triggerChange();
1387
- this.updateIncompleteValidationStatus();
1388
- if (diff.length && diff[0][0] !== "_") {
1389
- this.selectDateSegment(diff[0][0]);
1390
- }
1391
- if (switchPart || navigationOnly) {
1392
- this.switchDateSegment(1);
1393
- }
1394
- if (this.backspace) {
1395
- this.switchDateSegment(-1);
1396
- }
1397
- this.backspace = false;
1398
- };
1399
- DateInputComponent.prototype.emitFocus = function (args) {
1400
- this.onFocus.emit();
1401
- if (this.pickerService) {
1402
- this.pickerService.onFocus.emit(args);
1403
- }
1404
- };
1405
- DateInputComponent.prototype.emitBlur = function (args) {
1406
- this.onBlur.emit();
1407
- if (this.pickerService) {
1408
- this.pickerService.onBlur.emit(args);
1409
- }
1410
- };
1411
- DateInputComponent.prototype.updateIncompleteValidationStatus = function () {
1412
- var _this = this;
1413
- var previousValue = this.isDateIncomplete;
1414
- this.isDateIncomplete = this.kendoDate.hasValue() && this.value === null;
1415
- if (previousValue === this.isDateIncomplete || !this.incompleteDateValidation) {
1416
- return;
1417
- }
1418
- if (utils_1.isPresent(this.ngControl) && !utils_1.isPresent(this.pickerService)) {
1419
- this.cdr.markForCheck();
1420
- this.ngZone.run(function () { return _this.onValidatorChange(); });
1421
- }
1422
- else if (utils_1.isPresent(this.pickerService)) {
1423
- this.pickerService.dateCompletenessChange.emit();
1424
- }
1425
- };
1426
- DateInputComponent.prototype.setSpinnerFill = function (spinner, fill, oldFill) {
1427
- if (oldFill) {
1428
- this.renderer.removeClass(spinner, "k-button-" + oldFill);
1429
- this.renderer.removeClass(spinner, "k-button-" + oldFill + "-base");
1430
- }
1431
- this.renderer.addClass(spinner, "k-button-" + fill);
1432
- this.renderer.addClass(spinner, "k-button-" + fill + "-base");
1433
- };
1434
- DateInputComponent.prototype.setComponentClasses = function () {
1435
- if (this.size) {
1436
- this.renderer.addClass(this.wrapper.nativeElement, util_1.getSizeClass('input', this.size));
1437
- }
1438
- if (this.rounded) {
1439
- this.renderer.addClass(this.wrapper.nativeElement, util_1.getRoundedClass(this.rounded));
1440
- }
1441
- if (this.fillMode) {
1442
- this.renderer.addClass(this.wrapper.nativeElement, util_1.getFillModeClass('input', this.fillMode));
1443
- }
1444
- if (this.spinners) {
1445
- this.setSpinnerFill(this.spinup.nativeElement, this.fillMode);
1446
- this.setSpinnerFill(this.spindown.nativeElement, this.fillMode);
1447
- }
1448
- };
1449
- var DateInputComponent_1;
1450
- tslib_1.__decorate([
1451
- core_1.Input(),
1452
- tslib_1.__metadata("design:type", String)
1453
- ], DateInputComponent.prototype, "focusableId", void 0);
1454
- tslib_1.__decorate([
1455
- core_1.Input(),
1456
- tslib_1.__metadata("design:type", Boolean)
1457
- ], DateInputComponent.prototype, "disabled", void 0);
1458
- tslib_1.__decorate([
1459
- core_1.Input(),
1460
- tslib_1.__metadata("design:type", Boolean)
1461
- ], DateInputComponent.prototype, "readonly", void 0);
1462
- tslib_1.__decorate([
1463
- core_1.Input(),
1464
- tslib_1.__metadata("design:type", String)
1465
- ], DateInputComponent.prototype, "title", void 0);
1466
- tslib_1.__decorate([
1467
- core_1.Input(),
1468
- tslib_1.__metadata("design:type", Number)
1469
- ], DateInputComponent.prototype, "tabindex", void 0);
1470
- tslib_1.__decorate([
1471
- core_1.Input(),
1472
- tslib_1.__metadata("design:type", String)
1473
- ], DateInputComponent.prototype, "role", void 0);
1474
- tslib_1.__decorate([
1475
- core_1.Input(),
1476
- tslib_1.__metadata("design:type", Boolean)
1477
- ], DateInputComponent.prototype, "ariaReadOnly", void 0);
1478
- tslib_1.__decorate([
1479
- core_1.Input(),
1480
- tslib_1.__metadata("design:type", Number),
1481
- tslib_1.__metadata("design:paramtypes", [Number])
1482
- ], DateInputComponent.prototype, "tabIndex", null);
1483
- tslib_1.__decorate([
1484
- core_1.Input(),
1485
- tslib_1.__metadata("design:type", Object)
1486
- ], DateInputComponent.prototype, "format", void 0);
1487
- tslib_1.__decorate([
1488
- core_1.Input(),
1489
- tslib_1.__metadata("design:type", Object)
1490
- ], DateInputComponent.prototype, "formatPlaceholder", void 0);
1491
- tslib_1.__decorate([
1492
- core_1.Input(),
1493
- tslib_1.__metadata("design:type", String)
1494
- ], DateInputComponent.prototype, "placeholder", void 0);
1495
- tslib_1.__decorate([
1496
- core_1.Input(),
1497
- tslib_1.__metadata("design:type", Object)
1498
- ], DateInputComponent.prototype, "steps", void 0);
1499
- tslib_1.__decorate([
1500
- core_1.Input(),
1501
- tslib_1.__metadata("design:type", Date)
1502
- ], DateInputComponent.prototype, "max", void 0);
1503
- tslib_1.__decorate([
1504
- core_1.Input(),
1505
- tslib_1.__metadata("design:type", Date)
1506
- ], DateInputComponent.prototype, "min", void 0);
1507
- tslib_1.__decorate([
1508
- core_1.Input(),
1509
- tslib_1.__metadata("design:type", Boolean)
1510
- ], DateInputComponent.prototype, "rangeValidation", void 0);
1511
- tslib_1.__decorate([
1512
- core_1.Input(),
1513
- tslib_1.__metadata("design:type", Boolean)
1514
- ], DateInputComponent.prototype, "autoCorrect", void 0);
1515
- tslib_1.__decorate([
1516
- core_1.Input(),
1517
- tslib_1.__metadata("design:type", Boolean)
1518
- ], DateInputComponent.prototype, "incompleteDateValidation", void 0);
1519
- tslib_1.__decorate([
1520
- core_1.Input(),
1521
- tslib_1.__metadata("design:type", Number)
1522
- ], DateInputComponent.prototype, "twoDigitYearMax", void 0);
1523
- tslib_1.__decorate([
1524
- core_1.Input(),
1525
- tslib_1.__metadata("design:type", Date),
1526
- tslib_1.__metadata("design:paramtypes", [Date])
1527
- ], DateInputComponent.prototype, "value", null);
1528
- tslib_1.__decorate([
1529
- core_1.Input(),
1530
- tslib_1.__metadata("design:type", Boolean)
1531
- ], DateInputComponent.prototype, "spinners", void 0);
1532
- tslib_1.__decorate([
1533
- core_1.Input(),
1534
- tslib_1.__metadata("design:type", Boolean)
1535
- ], DateInputComponent.prototype, "isPopupOpen", void 0);
1536
- tslib_1.__decorate([
1537
- core_1.Input(),
1538
- tslib_1.__metadata("design:type", Boolean)
1539
- ], DateInputComponent.prototype, "hasPopup", void 0);
1540
- tslib_1.__decorate([
1541
- core_1.Input(),
1542
- tslib_1.__metadata("design:type", String),
1543
- tslib_1.__metadata("design:paramtypes", [String])
1544
- ], DateInputComponent.prototype, "size", null);
1545
- tslib_1.__decorate([
1546
- core_1.Input(),
1547
- tslib_1.__metadata("design:type", String),
1548
- tslib_1.__metadata("design:paramtypes", [String])
1549
- ], DateInputComponent.prototype, "rounded", null);
1550
- tslib_1.__decorate([
1551
- core_1.Input(),
1552
- tslib_1.__metadata("design:type", String),
1553
- tslib_1.__metadata("design:paramtypes", [String])
1554
- ], DateInputComponent.prototype, "fillMode", null);
1555
- tslib_1.__decorate([
1556
- core_1.Output(),
1557
- tslib_1.__metadata("design:type", core_1.EventEmitter)
1558
- ], DateInputComponent.prototype, "valueChange", void 0);
1559
- tslib_1.__decorate([
1560
- core_1.Output(),
1561
- tslib_1.__metadata("design:type", core_1.EventEmitter)
1562
- ], DateInputComponent.prototype, "valueUpdate", void 0);
1563
- tslib_1.__decorate([
1564
- core_1.Output('focus'),
1565
- tslib_1.__metadata("design:type", core_1.EventEmitter)
1566
- ], DateInputComponent.prototype, "onFocus", void 0);
1567
- tslib_1.__decorate([
1568
- core_1.Output('blur'),
1569
- tslib_1.__metadata("design:type", core_1.EventEmitter)
1570
- ], DateInputComponent.prototype, "onBlur", void 0);
1571
- tslib_1.__decorate([
1572
- core_1.ViewChild('dateInput', { static: true }),
1573
- tslib_1.__metadata("design:type", core_1.ElementRef)
1574
- ], DateInputComponent.prototype, "dateInput", void 0);
1575
- tslib_1.__decorate([
1576
- core_1.HostBinding('class.k-input'),
1577
- core_1.HostBinding('class.k-dateinput'),
1578
- tslib_1.__metadata("design:type", Boolean),
1579
- tslib_1.__metadata("design:paramtypes", [])
1580
- ], DateInputComponent.prototype, "wrapperClass", null);
1581
- tslib_1.__decorate([
1582
- core_1.HostBinding('class.k-disabled'),
1583
- tslib_1.__metadata("design:type", Boolean),
1584
- tslib_1.__metadata("design:paramtypes", [])
1585
- ], DateInputComponent.prototype, "disabledClass", null);
1586
- tslib_1.__decorate([
1587
- core_1.ViewChild('spinup', { static: false }),
1588
- tslib_1.__metadata("design:type", core_1.ElementRef)
1589
- ], DateInputComponent.prototype, "spinup", void 0);
1590
- tslib_1.__decorate([
1591
- core_1.ViewChild('spindown', { static: false }),
1592
- tslib_1.__metadata("design:type", core_1.ElementRef)
1593
- ], DateInputComponent.prototype, "spindown", void 0);
1594
- DateInputComponent = DateInputComponent_1 = tslib_1.__decorate([
1595
- core_1.Component({
1596
- changeDetection: core_1.ChangeDetectionStrategy.OnPush,
1597
- exportAs: 'kendo-dateinput',
1598
- providers: [
1599
- { provide: forms_1.NG_VALUE_ACCESSOR, useExisting: core_1.forwardRef(function () { return DateInputComponent_1; }), multi: true },
1600
- { provide: forms_1.NG_VALIDATORS, useExisting: core_1.forwardRef(function () { return DateInputComponent_1; }), multi: true },
1601
- { provide: kendo_angular_l10n_1.L10N_PREFIX, useValue: 'kendo.dateinput' },
1602
- { provide: kendo_angular_common_1.KendoInput, useExisting: core_1.forwardRef(function () { return DateInputComponent_1; }) },
1603
- kendo_angular_l10n_1.LocalizationService
1604
- ],
1605
- selector: 'kendo-dateinput',
1606
- template: "\n <ng-container kendoDateInputLocalizedMessages\n i18n-increment=\"kendo.dateinput.increment|The label for the **Increment** button in the DateInput\"\n increment=\"Increase value\"\n\n i18n-decrement=\"kendo.dateinput.decrement|The label for the **Decrement** button in the DateInput\"\n decrement=\"Decrease value\"\n >\n </ng-container>\n <input\n #dateInput\n autocomplete=\"off\"\n autocorrect=\"off\"\n autocapitalize=\"off\"\n spellcheck=\"false\"\n class=\"k-input-inner\"\n [attr.role]=\"role\"\n [attr.aria-readonly]=\"ariaReadOnly\"\n [id]=\"focusableId\"\n [title]=\"title\"\n [tabindex]=\"tabindex\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [placeholder]=\"placeholder\"\n [attr.aria-expanded]=\"isPopupOpen\"\n [attr.aria-haspopup]=\"hasPopup\"\n [kendoEventsOutsideAngular]=\"{\n click: handleClick,\n focus: handleFocus,\n mousedown: handleMousedown,\n touchstart: handleMousedown,\n dragstart: handleDragAndDrop,\n drop: handleDragAndDrop,\n blur: handleBlur\n }\"\n [scope]=\"this\"\n />\n <span *ngIf=\"spinners\" class=\"k-input-spinner k-spin-button\" (mousedown)=\"$event.preventDefault()\">\n <button\n #spinup\n tabindex=\"-1\"\n class=\"k-spinner-increase k-button k-icon-button\"\n [class.k-active]=\"arrowDirection === arrow.Up\"\n (mousedown)=\"arrowDirection = arrow.Up\"\n (mouseleave)=\"arrowDirection = arrow.None\"\n (click)=\"handleButtonClick(1)\"\n [title]=\"localization.get('increment')\"\n [attr.aria-label]=\"localization.get('increment')\">\n <span class=\"k-button-icon k-icon k-i-arrow-n\"></span>\n </button>\n <button\n #spindown\n tabindex=\"-1\"\n class=\"k-spinner-decrease k-button k-icon-button\"\n (click)=\"handleButtonClick(-1)\"\n [class.k-active]=\"arrowDirection === arrow.Down\"\n (mousedown)=\"arrowDirection = arrow.Down\"\n (mouseleave)=\"arrowDirection = arrow.None\"\n [title]=\"localization.get('decrement')\"\n [attr.aria-label]=\"localization.get('decrement')\">\n <span class=\"k-button-icon k-icon k-i-arrow-s\"></span>\n </button>\n </span>\n "
1607
- }),
1608
- tslib_1.__param(7, core_1.Optional()),
1609
- tslib_1.__metadata("design:paramtypes", [core_1.ChangeDetectorRef,
1610
- kendo_angular_intl_1.IntlService,
1611
- core_1.Renderer2,
1612
- core_1.ElementRef,
1613
- core_1.NgZone,
1614
- core_1.Injector,
1615
- kendo_angular_l10n_1.LocalizationService,
1616
- picker_service_1.PickerService])
1617
- ], DateInputComponent);
1618
- return DateInputComponent;
1619
- }());
1620
- exports.DateInputComponent = DateInputComponent;