@progress/kendo-angular-dateinputs 6.0.3 → 7.0.0-dev.202204191043

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