@anglr/datetime 2.0.0-beta.20220221103100 → 2.0.1

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 (456) hide show
  1. package/changelog.md +19 -0
  2. package/date-fns/package.json +7 -7
  3. package/date-fns/src/{date-fns.d.ts → index.d.ts} +4 -4
  4. package/date-fns/src/index.d.ts.map +1 -0
  5. package/date-fns/src/misc/tokens.d.ts +10 -10
  6. package/date-fns/src/services/dateFnsDateApi.service.d.ts +36 -33
  7. package/date-fns/src/services/dateFnsDateApi.service.d.ts.map +1 -1
  8. package/date-fns/src/services/dateFnsLocale.service.d.ts +10 -10
  9. package/es2015/date-fns/src/index.js +4 -0
  10. package/es2015/date-fns/src/index.js.map +1 -0
  11. package/es2015/date-fns/src/misc/tokens.js +20 -0
  12. package/es2015/date-fns/src/misc/tokens.js.map +1 -0
  13. package/es2015/date-fns/src/services/dateFnsDateApi.service.js +438 -0
  14. package/es2015/date-fns/src/services/dateFnsDateApi.service.js.map +1 -0
  15. package/es2015/date-fns/src/services/dateFnsLocale.service.js +2 -0
  16. package/es2015/date-fns/src/services/dateFnsLocale.service.js.map +1 -0
  17. package/es2015/karma.conf.js +57 -0
  18. package/es2015/karma.conf.js.map +1 -0
  19. package/{moment/src/moment.d.ts → es2015/moment/src/index.js} +3 -3
  20. package/es2015/moment/src/index.js.map +1 -0
  21. package/es2015/moment/src/misc/tokens.js +15 -0
  22. package/es2015/moment/src/misc/tokens.js.map +1 -0
  23. package/es2015/moment/src/services/momentDateApi.service.js +398 -0
  24. package/es2015/moment/src/services/momentDateApi.service.js.map +1 -0
  25. package/{src/datetime.d.ts → es2015/src/index.js} +19 -19
  26. package/es2015/src/index.js.map +1 -0
  27. package/es2015/src/misc/constants.js +33 -0
  28. package/es2015/src/misc/constants.js.map +1 -0
  29. package/es2015/src/misc/datetime.interface.js +2 -0
  30. package/es2015/src/misc/datetime.interface.js.map +1 -0
  31. package/es2015/src/misc/tokens.js +19 -0
  32. package/es2015/src/misc/tokens.js.map +1 -0
  33. package/es2015/src/misc/validators.js +58 -0
  34. package/es2015/src/misc/validators.js.map +1 -0
  35. package/es2015/src/modules/datePipes.module.js +33 -0
  36. package/es2015/src/modules/datePipes.module.js.map +1 -0
  37. package/es2015/src/picker/components/dayPicker/dayPicker.component.js +172 -0
  38. package/es2015/src/picker/components/dayPicker/dayPicker.component.js.map +1 -0
  39. package/es2015/src/picker/components/dayPicker/dayPicker.interfaces.js +2 -0
  40. package/es2015/src/picker/components/dayPicker/dayPicker.interfaces.js.map +1 -0
  41. package/es2015/src/picker/components/monthPicker/monthPicker.component.js +114 -0
  42. package/es2015/src/picker/components/monthPicker/monthPicker.component.js.map +1 -0
  43. package/es2015/src/picker/components/monthPicker/monthPicker.interfaces.js +2 -0
  44. package/es2015/src/picker/components/monthPicker/monthPicker.interfaces.js.map +1 -0
  45. package/es2015/src/picker/components/picker/picker.component.animations.js +71 -0
  46. package/es2015/src/picker/components/picker/picker.component.animations.js.map +1 -0
  47. package/es2015/src/picker/components/picker/picker.component.js +241 -0
  48. package/es2015/src/picker/components/picker/picker.component.js.map +1 -0
  49. package/es2015/src/picker/components/pickerBase.component.js +243 -0
  50. package/es2015/src/picker/components/pickerBase.component.js.map +1 -0
  51. package/es2015/src/picker/components/yearPicker/yearPicker.component.js +126 -0
  52. package/es2015/src/picker/components/yearPicker/yearPicker.component.js.map +1 -0
  53. package/es2015/src/picker/components/yearPicker/yearPicker.interfaces.js +2 -0
  54. package/es2015/src/picker/components/yearPicker/yearPicker.interfaces.js.map +1 -0
  55. package/es2015/src/picker/interfaces.js +5 -0
  56. package/es2015/src/picker/interfaces.js.map +1 -0
  57. package/es2015/src/picker/misc/datetimePicker.interface.js +2 -0
  58. package/es2015/src/picker/misc/datetimePicker.interface.js.map +1 -0
  59. package/es2015/src/picker/misc/tokens.js +6 -0
  60. package/es2015/src/picker/misc/tokens.js.map +1 -0
  61. package/es2015/src/picker/modules/picker.module.js +46 -0
  62. package/es2015/src/picker/modules/picker.module.js.map +1 -0
  63. package/es2015/src/picker/types.js +8 -0
  64. package/es2015/src/picker/types.js.map +1 -0
  65. package/es2015/src/pipes/asRequiredType.js +22 -0
  66. package/es2015/src/pipes/asRequiredType.js.map +1 -0
  67. package/es2015/src/pipes/dateConvert.pipe.js +35 -0
  68. package/es2015/src/pipes/dateConvert.pipe.js.map +1 -0
  69. package/es2015/src/pipes/dateFormat.pipe.js +45 -0
  70. package/es2015/src/pipes/dateFormat.pipe.js.map +1 -0
  71. package/es2015/src/selector/components/inputDateTime/inputDateTime.component.js +421 -0
  72. package/es2015/src/selector/components/inputDateTime/inputDateTime.component.js.map +1 -0
  73. package/es2015/src/selector/components/selector/selector.component.animations.js +15 -0
  74. package/es2015/src/selector/components/selector/selector.component.animations.js.map +1 -0
  75. package/es2015/src/selector/components/selector/selector.component.js +344 -0
  76. package/es2015/src/selector/components/selector/selector.component.js.map +1 -0
  77. package/es2015/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js +317 -0
  78. package/es2015/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js.map +1 -0
  79. package/es2015/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.js +51 -0
  80. package/es2015/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.js.map +1 -0
  81. package/es2015/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.js +51 -0
  82. package/es2015/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.js.map +1 -0
  83. package/es2015/src/selector/directives/datetimeValidator/datetimeValidator.directive.js +47 -0
  84. package/es2015/src/selector/directives/datetimeValidator/datetimeValidator.directive.js.map +1 -0
  85. package/es2015/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.js +119 -0
  86. package/es2015/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.js.map +1 -0
  87. package/es2015/src/selector/interfaces.js +2 -0
  88. package/es2015/src/selector/interfaces.js.map +1 -0
  89. package/es2015/src/selector/misc/datetimeSelector.interface.js +2 -0
  90. package/es2015/src/selector/misc/datetimeSelector.interface.js.map +1 -0
  91. package/es2015/src/selector/misc/tokens.js +6 -0
  92. package/es2015/src/selector/misc/tokens.js.map +1 -0
  93. package/es2015/src/selector/modules/basicSelector.module.js +20 -0
  94. package/es2015/src/selector/modules/basicSelector.module.js.map +1 -0
  95. package/es2015/src/selector/modules/selector.module.js +60 -0
  96. package/es2015/src/selector/modules/selector.module.js.map +1 -0
  97. package/es2015/src/selector/types.js +10 -0
  98. package/es2015/src/selector/types.js.map +1 -0
  99. package/es2015/src/services/dateApi.interface.js +2 -0
  100. package/es2015/src/services/dateApi.interface.js.map +1 -0
  101. package/es2015/src/services/datePositionParser.interface.js +2 -0
  102. package/es2015/src/services/datePositionParser.interface.js.map +1 -0
  103. package/es2015/src/services/datePositionParser.service.js +227 -0
  104. package/es2015/src/services/datePositionParser.service.js.map +1 -0
  105. package/es2015/src/services/dateTimeRelativeParser.service.js +66 -0
  106. package/es2015/src/services/dateTimeRelativeParser.service.js.map +1 -0
  107. package/es2015/src/services/dateValueProvider.service.js +58 -0
  108. package/es2015/src/services/dateValueProvider.service.js.map +1 -0
  109. package/es2015/src/services/formatProvider.interface.js +2 -0
  110. package/es2015/src/services/formatProvider.interface.js.map +1 -0
  111. package/es2015/src/services/index.js +4 -0
  112. package/es2015/src/services/index.js.map +1 -0
  113. package/es2020/date-fns/src/index.js +4 -0
  114. package/es2020/date-fns/src/index.js.map +1 -0
  115. package/es2020/date-fns/src/misc/tokens.js +20 -0
  116. package/es2020/date-fns/src/misc/tokens.js.map +1 -0
  117. package/es2020/date-fns/src/services/dateFnsDateApi.service.js +437 -0
  118. package/es2020/date-fns/src/services/dateFnsDateApi.service.js.map +1 -0
  119. package/es2020/date-fns/src/services/dateFnsLocale.service.js +2 -0
  120. package/es2020/date-fns/src/services/dateFnsLocale.service.js.map +1 -0
  121. package/es2020/karma.conf.js +57 -0
  122. package/es2020/karma.conf.js.map +1 -0
  123. package/es2020/moment/src/index.js +3 -0
  124. package/es2020/moment/src/index.js.map +1 -0
  125. package/es2020/moment/src/misc/tokens.js +15 -0
  126. package/es2020/moment/src/misc/tokens.js.map +1 -0
  127. package/es2020/moment/src/services/momentDateApi.service.js +398 -0
  128. package/es2020/moment/src/services/momentDateApi.service.js.map +1 -0
  129. package/es2020/src/index.js +19 -0
  130. package/es2020/src/index.js.map +1 -0
  131. package/es2020/src/misc/constants.js +33 -0
  132. package/es2020/src/misc/constants.js.map +1 -0
  133. package/es2020/src/misc/datetime.interface.js +2 -0
  134. package/es2020/src/misc/datetime.interface.js.map +1 -0
  135. package/es2020/src/misc/tokens.js +19 -0
  136. package/es2020/src/misc/tokens.js.map +1 -0
  137. package/es2020/src/misc/validators.js +58 -0
  138. package/es2020/src/misc/validators.js.map +1 -0
  139. package/es2020/src/modules/datePipes.module.js +33 -0
  140. package/es2020/src/modules/datePipes.module.js.map +1 -0
  141. package/es2020/src/picker/components/dayPicker/dayPicker.component.js +172 -0
  142. package/es2020/src/picker/components/dayPicker/dayPicker.component.js.map +1 -0
  143. package/es2020/src/picker/components/dayPicker/dayPicker.interfaces.js +2 -0
  144. package/es2020/src/picker/components/dayPicker/dayPicker.interfaces.js.map +1 -0
  145. package/es2020/src/picker/components/monthPicker/monthPicker.component.js +114 -0
  146. package/es2020/src/picker/components/monthPicker/monthPicker.component.js.map +1 -0
  147. package/es2020/src/picker/components/monthPicker/monthPicker.interfaces.js +2 -0
  148. package/es2020/src/picker/components/monthPicker/monthPicker.interfaces.js.map +1 -0
  149. package/es2020/src/picker/components/picker/picker.component.animations.js +71 -0
  150. package/es2020/src/picker/components/picker/picker.component.animations.js.map +1 -0
  151. package/es2020/src/picker/components/picker/picker.component.js +236 -0
  152. package/es2020/src/picker/components/picker/picker.component.js.map +1 -0
  153. package/es2020/src/picker/components/pickerBase.component.js +243 -0
  154. package/es2020/src/picker/components/pickerBase.component.js.map +1 -0
  155. package/es2020/src/picker/components/yearPicker/yearPicker.component.js +126 -0
  156. package/es2020/src/picker/components/yearPicker/yearPicker.component.js.map +1 -0
  157. package/es2020/src/picker/components/yearPicker/yearPicker.interfaces.js +2 -0
  158. package/es2020/src/picker/components/yearPicker/yearPicker.interfaces.js.map +1 -0
  159. package/es2020/src/picker/interfaces.js +5 -0
  160. package/es2020/src/picker/interfaces.js.map +1 -0
  161. package/es2020/src/picker/misc/datetimePicker.interface.js +2 -0
  162. package/es2020/src/picker/misc/datetimePicker.interface.js.map +1 -0
  163. package/es2020/src/picker/misc/tokens.js +6 -0
  164. package/es2020/src/picker/misc/tokens.js.map +1 -0
  165. package/es2020/src/picker/modules/picker.module.js +46 -0
  166. package/es2020/src/picker/modules/picker.module.js.map +1 -0
  167. package/es2020/src/picker/types.js +8 -0
  168. package/es2020/src/picker/types.js.map +1 -0
  169. package/es2020/src/pipes/asRequiredType.js +22 -0
  170. package/es2020/src/pipes/asRequiredType.js.map +1 -0
  171. package/es2020/src/pipes/dateConvert.pipe.js +35 -0
  172. package/es2020/src/pipes/dateConvert.pipe.js.map +1 -0
  173. package/es2020/src/pipes/dateFormat.pipe.js +45 -0
  174. package/es2020/src/pipes/dateFormat.pipe.js.map +1 -0
  175. package/es2020/src/selector/components/inputDateTime/inputDateTime.component.js +417 -0
  176. package/es2020/src/selector/components/inputDateTime/inputDateTime.component.js.map +1 -0
  177. package/es2020/src/selector/components/selector/selector.component.animations.js +15 -0
  178. package/es2020/src/selector/components/selector/selector.component.animations.js.map +1 -0
  179. package/es2020/src/selector/components/selector/selector.component.js +334 -0
  180. package/es2020/src/selector/components/selector/selector.component.js.map +1 -0
  181. package/es2020/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js +314 -0
  182. package/es2020/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js.map +1 -0
  183. package/es2020/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.js +51 -0
  184. package/es2020/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.js.map +1 -0
  185. package/es2020/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.js +51 -0
  186. package/es2020/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.js.map +1 -0
  187. package/es2020/src/selector/directives/datetimeValidator/datetimeValidator.directive.js +47 -0
  188. package/es2020/src/selector/directives/datetimeValidator/datetimeValidator.directive.js.map +1 -0
  189. package/es2020/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.js +118 -0
  190. package/es2020/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.js.map +1 -0
  191. package/es2020/src/selector/interfaces.js +2 -0
  192. package/es2020/src/selector/interfaces.js.map +1 -0
  193. package/es2020/src/selector/misc/datetimeSelector.interface.js +2 -0
  194. package/es2020/src/selector/misc/datetimeSelector.interface.js.map +1 -0
  195. package/es2020/src/selector/misc/tokens.js +6 -0
  196. package/es2020/src/selector/misc/tokens.js.map +1 -0
  197. package/es2020/src/selector/modules/basicSelector.module.js +20 -0
  198. package/es2020/src/selector/modules/basicSelector.module.js.map +1 -0
  199. package/es2020/src/selector/modules/selector.module.js +60 -0
  200. package/es2020/src/selector/modules/selector.module.js.map +1 -0
  201. package/es2020/src/selector/types.js +10 -0
  202. package/es2020/src/selector/types.js.map +1 -0
  203. package/es2020/src/services/dateApi.interface.js +2 -0
  204. package/es2020/src/services/dateApi.interface.js.map +1 -0
  205. package/es2020/src/services/datePositionParser.interface.js +2 -0
  206. package/es2020/src/services/datePositionParser.interface.js.map +1 -0
  207. package/es2020/src/services/datePositionParser.service.js +227 -0
  208. package/es2020/src/services/datePositionParser.service.js.map +1 -0
  209. package/es2020/src/services/dateTimeRelativeParser.service.js +65 -0
  210. package/es2020/src/services/dateTimeRelativeParser.service.js.map +1 -0
  211. package/es2020/src/services/dateValueProvider.service.js +58 -0
  212. package/es2020/src/services/dateValueProvider.service.js.map +1 -0
  213. package/es2020/src/services/formatProvider.interface.js +2 -0
  214. package/es2020/src/services/formatProvider.interface.js.map +1 -0
  215. package/es2020/src/services/index.js +4 -0
  216. package/es2020/src/services/index.js.map +1 -0
  217. package/karma.conf.d.ts +2 -0
  218. package/karma.conf.d.ts.map +1 -0
  219. package/moment/package.json +7 -7
  220. package/moment/src/index.d.ts +3 -0
  221. package/moment/src/index.d.ts.map +1 -0
  222. package/moment/src/misc/tokens.d.ts +5 -5
  223. package/moment/src/services/momentDateApi.service.d.ts +35 -32
  224. package/moment/src/services/momentDateApi.service.d.ts.map +1 -1
  225. package/package.json +100 -48
  226. package/src/index.d.ts +19 -0
  227. package/src/index.d.ts.map +1 -0
  228. package/src/misc/constants.d.ts +32 -32
  229. package/src/misc/datetime.interface.d.ts +34 -34
  230. package/src/misc/tokens.d.ts +10 -10
  231. package/src/misc/validators.d.ts +25 -25
  232. package/src/modules/datePipes.module.d.ts +12 -5
  233. package/src/modules/datePipes.module.d.ts.map +1 -1
  234. package/src/picker/components/dayPicker/dayPicker.component.d.ts +68 -65
  235. package/src/picker/components/dayPicker/dayPicker.component.d.ts.map +1 -1
  236. package/src/picker/components/dayPicker/dayPicker.component.html +7 -7
  237. package/src/picker/components/dayPicker/dayPicker.interfaces.d.ts +10 -10
  238. package/src/picker/components/monthPicker/monthPicker.component.d.ts +52 -49
  239. package/src/picker/components/monthPicker/monthPicker.component.d.ts.map +1 -1
  240. package/src/picker/components/monthPicker/monthPicker.component.html +6 -6
  241. package/src/picker/components/monthPicker/monthPicker.interfaces.d.ts +6 -6
  242. package/src/picker/components/picker/picker.component.animations.d.ts +4 -4
  243. package/src/picker/components/picker/picker.component.d.ts +104 -101
  244. package/src/picker/components/picker/picker.component.d.ts.map +1 -1
  245. package/src/picker/components/pickerBase.component.d.ts +169 -166
  246. package/src/picker/components/pickerBase.component.d.ts.map +1 -1
  247. package/src/picker/components/yearPicker/yearPicker.component.d.ts +57 -54
  248. package/src/picker/components/yearPicker/yearPicker.component.d.ts.map +1 -1
  249. package/src/picker/components/yearPicker/yearPicker.component.html +6 -6
  250. package/src/picker/components/yearPicker/yearPicker.interfaces.d.ts +6 -6
  251. package/src/picker/interfaces.d.ts +4 -4
  252. package/src/picker/misc/datetimePicker.interface.d.ts +188 -188
  253. package/src/picker/misc/tokens.d.ts +6 -6
  254. package/src/picker/modules/picker.module.d.ts +16 -5
  255. package/src/picker/modules/picker.module.d.ts.map +1 -1
  256. package/src/picker/types.d.ts +7 -7
  257. package/src/pipes/asRequiredType.d.ts +21 -0
  258. package/src/pipes/asRequiredType.d.ts.map +1 -0
  259. package/src/pipes/dateConvert.pipe.d.ts +18 -15
  260. package/src/pipes/dateConvert.pipe.d.ts.map +1 -1
  261. package/src/pipes/dateFormat.pipe.d.ts +20 -17
  262. package/src/pipes/dateFormat.pipe.d.ts.map +1 -1
  263. package/src/selector/components/inputDateTime/inputDateTime.component.d.ts +187 -184
  264. package/src/selector/components/inputDateTime/inputDateTime.component.d.ts.map +1 -1
  265. package/src/selector/components/selector/selector.component.animations.d.ts +4 -4
  266. package/src/selector/components/selector/selector.component.d.ts +155 -152
  267. package/src/selector/components/selector/selector.component.d.ts.map +1 -1
  268. package/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.d.ts +170 -167
  269. package/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.d.ts.map +1 -1
  270. package/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.d.ts +22 -19
  271. package/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.d.ts.map +1 -1
  272. package/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.d.ts +22 -19
  273. package/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.d.ts.map +1 -1
  274. package/src/selector/directives/datetimeValidator/datetimeValidator.directive.d.ts +21 -18
  275. package/src/selector/directives/datetimeValidator/datetimeValidator.directive.d.ts.map +1 -1
  276. package/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.d.ts +53 -50
  277. package/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.d.ts.map +1 -1
  278. package/src/selector/interfaces.d.ts +1 -1
  279. package/src/selector/misc/datetimeSelector.interface.d.ts +82 -82
  280. package/src/selector/misc/tokens.d.ts +6 -6
  281. package/src/selector/modules/basicSelector.module.d.ts +10 -5
  282. package/src/selector/modules/basicSelector.module.d.ts.map +1 -1
  283. package/src/selector/modules/selector.module.d.ts +18 -5
  284. package/src/selector/modules/selector.module.d.ts.map +1 -1
  285. package/src/selector/types.d.ts +9 -9
  286. package/src/services/dateApi.interface.d.ts +275 -275
  287. package/src/services/datePositionParser.interface.d.ts +40 -40
  288. package/src/services/datePositionParser.service.d.ts +60 -57
  289. package/src/services/datePositionParser.service.d.ts.map +1 -1
  290. package/src/services/dateTimeRelativeParser.service.d.ts +21 -18
  291. package/src/services/dateTimeRelativeParser.service.d.ts.map +1 -1
  292. package/src/services/dateValueProvider.service.d.ts +18 -15
  293. package/src/services/dateValueProvider.service.d.ts.map +1 -1
  294. package/src/services/formatProvider.interface.d.ts +17 -17
  295. package/src/services/index.d.ts +3 -3
  296. package/tsconfig.karma.json +5 -6
  297. package/version.bak +1 -1
  298. package/appveyor.yml +0 -70
  299. package/date-fns/dist/es2015/date-fns/index.js +0 -10
  300. package/date-fns/dist/es2015/date-fns/public_api.js +0 -7
  301. package/date-fns/dist/es2015/date-fns/src/date-fns.js +0 -9
  302. package/date-fns/dist/es2015/date-fns/src/misc/tokens.js +0 -32
  303. package/date-fns/dist/es2015/date-fns/src/services/dateFnsDateApi.service.js +0 -512
  304. package/date-fns/dist/es2015/date-fns/src/services/dateFnsLocale.service.js +0 -18
  305. package/date-fns/dist/es5/date-fns/index.js +0 -10
  306. package/date-fns/dist/es5/date-fns/public_api.js +0 -7
  307. package/date-fns/dist/es5/date-fns/src/date-fns.js +0 -9
  308. package/date-fns/dist/es5/date-fns/src/misc/tokens.js +0 -32
  309. package/date-fns/dist/es5/date-fns/src/services/dateFnsDateApi.service.js +0 -902
  310. package/date-fns/dist/es5/date-fns/src/services/dateFnsLocale.service.js +0 -18
  311. package/date-fns/index.d.ts +0 -5
  312. package/date-fns/index.d.ts.map +0 -1
  313. package/date-fns/index.metadata.json +0 -1
  314. package/date-fns/public_api.d.ts +0 -2
  315. package/date-fns/public_api.d.ts.map +0 -1
  316. package/date-fns/src/date-fns.d.ts.map +0 -1
  317. package/date-fns/src/services/dateFnsDateApi.service.ngfactory.d.ts.map +0 -1
  318. package/datetime.d.ts +0 -7
  319. package/datetime.d.ts.map +0 -1
  320. package/datetime.metadata.json +0 -1
  321. package/dist/es2015/datetime.js +0 -10
  322. package/dist/es2015/public_api.js +0 -7
  323. package/dist/es2015/src/datetime.js +0 -24
  324. package/dist/es2015/src/misc/constants.js +0 -46
  325. package/dist/es2015/src/misc/datetime.interface.js +0 -52
  326. package/dist/es2015/src/misc/tokens.js +0 -29
  327. package/dist/es2015/src/misc/validators.js +0 -80
  328. package/dist/es2015/src/modules/datePipes.module.js +0 -26
  329. package/dist/es2015/src/picker/components/dayPicker/dayPicker.component.js +0 -215
  330. package/dist/es2015/src/picker/components/dayPicker/dayPicker.interfaces.js +0 -18
  331. package/dist/es2015/src/picker/components/monthPicker/monthPicker.component.js +0 -138
  332. package/dist/es2015/src/picker/components/monthPicker/monthPicker.interfaces.js +0 -11
  333. package/dist/es2015/src/picker/components/picker/picker.component.animations.js +0 -77
  334. package/dist/es2015/src/picker/components/picker/picker.component.js +0 -386
  335. package/dist/es2015/src/picker/components/pickerBase.component.js +0 -406
  336. package/dist/es2015/src/picker/components/yearPicker/yearPicker.component.js +0 -158
  337. package/dist/es2015/src/picker/components/yearPicker/yearPicker.interfaces.js +0 -11
  338. package/dist/es2015/src/picker/interfaces.js +0 -10
  339. package/dist/es2015/src/picker/misc/datetimePicker.interface.js +0 -245
  340. package/dist/es2015/src/picker/misc/tokens.js +0 -12
  341. package/dist/es2015/src/picker/modules/picker.module.js +0 -35
  342. package/dist/es2015/src/picker/types.js +0 -13
  343. package/dist/es2015/src/pipes/dateConvert.pipe.js +0 -50
  344. package/dist/es2015/src/pipes/dateFormat.pipe.js +0 -64
  345. package/dist/es2015/src/selector/components/inputDateTime/inputDateTime.component.js +0 -588
  346. package/dist/es2015/src/selector/components/selector/selector.component.animations.js +0 -21
  347. package/dist/es2015/src/selector/components/selector/selector.component.js +0 -514
  348. package/dist/es2015/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js +0 -456
  349. package/dist/es2015/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.js +0 -73
  350. package/dist/es2015/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.js +0 -73
  351. package/dist/es2015/src/selector/directives/datetimeValidator/datetimeValidator.directive.js +0 -70
  352. package/dist/es2015/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.js +0 -171
  353. package/dist/es2015/src/selector/interfaces.js +0 -7
  354. package/dist/es2015/src/selector/misc/datetimeSelector.interface.js +0 -106
  355. package/dist/es2015/src/selector/misc/tokens.js +0 -12
  356. package/dist/es2015/src/selector/modules/basicSelector.module.js +0 -20
  357. package/dist/es2015/src/selector/modules/selector.module.js +0 -45
  358. package/dist/es2015/src/selector/types.js +0 -15
  359. package/dist/es2015/src/services/dateApi.interface.js +0 -316
  360. package/dist/es2015/src/services/datePositionParser.interface.js +0 -56
  361. package/dist/es2015/src/services/datePositionParser.service.js +0 -297
  362. package/dist/es2015/src/services/dateTimeRelativeParser.service.js +0 -97
  363. package/dist/es2015/src/services/dateValueProvider.service.js +0 -79
  364. package/dist/es2015/src/services/formatProvider.interface.js +0 -28
  365. package/dist/es2015/src/services/index.js +0 -9
  366. package/dist/es5/datetime.js +0 -10
  367. package/dist/es5/public_api.js +0 -7
  368. package/dist/es5/src/datetime.js +0 -24
  369. package/dist/es5/src/misc/constants.js +0 -46
  370. package/dist/es5/src/misc/datetime.interface.js +0 -52
  371. package/dist/es5/src/misc/tokens.js +0 -29
  372. package/dist/es5/src/misc/validators.js +0 -124
  373. package/dist/es5/src/modules/datePipes.module.js +0 -30
  374. package/dist/es5/src/picker/components/dayPicker/dayPicker.component.js +0 -323
  375. package/dist/es5/src/picker/components/dayPicker/dayPicker.interfaces.js +0 -18
  376. package/dist/es5/src/picker/components/monthPicker/monthPicker.component.js +0 -233
  377. package/dist/es5/src/picker/components/monthPicker/monthPicker.interfaces.js +0 -11
  378. package/dist/es5/src/picker/components/picker/picker.component.animations.js +0 -77
  379. package/dist/es5/src/picker/components/picker/picker.component.js +0 -460
  380. package/dist/es5/src/picker/components/pickerBase.component.js +0 -561
  381. package/dist/es5/src/picker/components/yearPicker/yearPicker.component.js +0 -253
  382. package/dist/es5/src/picker/components/yearPicker/yearPicker.interfaces.js +0 -11
  383. package/dist/es5/src/picker/interfaces.js +0 -10
  384. package/dist/es5/src/picker/misc/datetimePicker.interface.js +0 -245
  385. package/dist/es5/src/picker/misc/tokens.js +0 -12
  386. package/dist/es5/src/picker/modules/picker.module.js +0 -39
  387. package/dist/es5/src/picker/types.js +0 -13
  388. package/dist/es5/src/pipes/dateConvert.pipe.js +0 -63
  389. package/dist/es5/src/pipes/dateFormat.pipe.js +0 -79
  390. package/dist/es5/src/selector/components/inputDateTime/inputDateTime.component.js +0 -808
  391. package/dist/es5/src/selector/components/selector/selector.component.animations.js +0 -21
  392. package/dist/es5/src/selector/components/selector/selector.component.js +0 -653
  393. package/dist/es5/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js +0 -656
  394. package/dist/es5/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.js +0 -84
  395. package/dist/es5/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.js +0 -84
  396. package/dist/es5/src/selector/directives/datetimeValidator/datetimeValidator.directive.js +0 -82
  397. package/dist/es5/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.js +0 -230
  398. package/dist/es5/src/selector/interfaces.js +0 -7
  399. package/dist/es5/src/selector/misc/datetimeSelector.interface.js +0 -106
  400. package/dist/es5/src/selector/misc/tokens.js +0 -12
  401. package/dist/es5/src/selector/modules/basicSelector.module.js +0 -24
  402. package/dist/es5/src/selector/modules/selector.module.js +0 -49
  403. package/dist/es5/src/selector/types.js +0 -15
  404. package/dist/es5/src/services/dateApi.interface.js +0 -316
  405. package/dist/es5/src/services/datePositionParser.interface.js +0 -56
  406. package/dist/es5/src/services/datePositionParser.service.js +0 -366
  407. package/dist/es5/src/services/dateTimeRelativeParser.service.js +0 -108
  408. package/dist/es5/src/services/dateValueProvider.service.js +0 -92
  409. package/dist/es5/src/services/formatProvider.interface.js +0 -28
  410. package/dist/es5/src/services/index.js +0 -9
  411. package/moment/dist/es2015/moment/index.js +0 -10
  412. package/moment/dist/es2015/moment/public_api.js +0 -7
  413. package/moment/dist/es2015/moment/src/misc/tokens.js +0 -26
  414. package/moment/dist/es2015/moment/src/moment.js +0 -8
  415. package/moment/dist/es2015/moment/src/services/momentDateApi.service.js +0 -466
  416. package/moment/dist/es5/moment/index.js +0 -10
  417. package/moment/dist/es5/moment/public_api.js +0 -7
  418. package/moment/dist/es5/moment/src/misc/tokens.js +0 -26
  419. package/moment/dist/es5/moment/src/moment.js +0 -8
  420. package/moment/dist/es5/moment/src/services/momentDateApi.service.js +0 -858
  421. package/moment/index.d.ts +0 -5
  422. package/moment/index.d.ts.map +0 -1
  423. package/moment/index.metadata.json +0 -1
  424. package/moment/public_api.d.ts +0 -2
  425. package/moment/public_api.d.ts.map +0 -1
  426. package/moment/src/moment.d.ts.map +0 -1
  427. package/moment/src/services/momentDateApi.service.ngfactory.d.ts.map +0 -1
  428. package/public_api.d.ts +0 -2
  429. package/public_api.d.ts.map +0 -1
  430. package/src/datetime.d.ts.map +0 -1
  431. package/src/modules/datePipes.module.ngfactory.d.ts.map +0 -1
  432. package/src/picker/components/dayPicker/dayPicker.component.css.shim.ngstyle.d.ts.map +0 -1
  433. package/src/picker/components/dayPicker/dayPicker.component.ngfactory.d.ts.map +0 -1
  434. package/src/picker/components/monthPicker/monthPicker.component.css.shim.ngstyle.d.ts.map +0 -1
  435. package/src/picker/components/monthPicker/monthPicker.component.ngfactory.d.ts.map +0 -1
  436. package/src/picker/components/picker/picker.component.ngfactory.d.ts.map +0 -1
  437. package/src/picker/components/yearPicker/yearPicker.component.css.shim.ngstyle.d.ts.map +0 -1
  438. package/src/picker/components/yearPicker/yearPicker.component.ngfactory.d.ts.map +0 -1
  439. package/src/picker/modules/picker.module.ngfactory.d.ts.map +0 -1
  440. package/src/pipes/dateConvert.pipe.ngfactory.d.ts.map +0 -1
  441. package/src/pipes/dateFormat.pipe.ngfactory.d.ts.map +0 -1
  442. package/src/selector/components/inputDateTime/inputDateTime.component.css.shim.ngstyle.d.ts.map +0 -1
  443. package/src/selector/components/inputDateTime/inputDateTime.component.ngfactory.d.ts.map +0 -1
  444. package/src/selector/components/selector/selector.component.css.shim.ngstyle.d.ts.map +0 -1
  445. package/src/selector/components/selector/selector.component.ngfactory.d.ts.map +0 -1
  446. package/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.css.shim.ngstyle.d.ts.map +0 -1
  447. package/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.ngfactory.d.ts.map +0 -1
  448. package/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.ngfactory.d.ts.map +0 -1
  449. package/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.ngfactory.d.ts.map +0 -1
  450. package/src/selector/directives/datetimeValidator/datetimeValidator.directive.ngfactory.d.ts.map +0 -1
  451. package/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.ngfactory.d.ts.map +0 -1
  452. package/src/selector/modules/basicSelector.module.ngfactory.d.ts.map +0 -1
  453. package/src/selector/modules/selector.module.ngfactory.d.ts.map +0 -1
  454. package/src/services/datePositionParser.service.ngfactory.d.ts.map +0 -1
  455. package/src/services/dateTimeRelativeParser.service.ngfactory.d.ts.map +0 -1
  456. package/src/services/dateValueProvider.service.ngfactory.d.ts.map +0 -1
@@ -0,0 +1,314 @@
1
+ import { Component, ChangeDetectionStrategy, Inject, ChangeDetectorRef, ElementRef, ViewChild } from '@angular/core';
2
+ import { Subject } from 'rxjs';
3
+ import { DATE_API } from '../../../misc/tokens';
4
+ import { DateValueProvider } from '../../../services/dateValueProvider.service';
5
+ import * as i0 from "@angular/core";
6
+ import * as i1 from "../../../services/dateValueProvider.service";
7
+ /**
8
+ * Component used as datetime selector with simple input
9
+ */
10
+ export class SimpleInputDateTimeSelectorComponent {
11
+ //######################### constructor #########################
12
+ constructor(_dateApi, _valueProvider, _changeDetector) {
13
+ this._dateApi = _dateApi;
14
+ this._valueProvider = _valueProvider;
15
+ this._changeDetector = _changeDetector;
16
+ //######################### protected fields #########################
17
+ /**
18
+ * Occurs when value changes
19
+ */
20
+ this._valueChange = new Subject();
21
+ /**
22
+ * Occurs when selector is touched by user
23
+ */
24
+ this._touched = new Subject();
25
+ /**
26
+ * Occurs when selector requires picker to be displayed or hidden
27
+ */
28
+ this._pickerRequest = new Subject();
29
+ /**
30
+ * Currently used format for displaying data
31
+ */
32
+ this._format = '';
33
+ /**
34
+ * Current value representation as date api wrapper
35
+ */
36
+ this._dateApiValue = null;
37
+ /**
38
+ * Indication whether is current value valid value
39
+ */
40
+ this._isValid = true;
41
+ /**
42
+ * Minimal possible value that can be picked
43
+ */
44
+ this._minValue = null;
45
+ /**
46
+ * Maximal possible value that can be picked
47
+ */
48
+ this._maxValue = null;
49
+ //######################### public properties - template bindings #########################
50
+ /**
51
+ * Indication whether is input disabled
52
+ * @internal
53
+ */
54
+ this.disabled = false;
55
+ }
56
+ //######################### public properties - implementation of DateTimeSelector #########################
57
+ /**
58
+ * Gets or sets currently used format for displaying data
59
+ */
60
+ get format() {
61
+ return this._format;
62
+ }
63
+ set format(value) {
64
+ this._format = value;
65
+ }
66
+ /**
67
+ * Gets current value of datetime
68
+ */
69
+ get value() {
70
+ if (!this._dateApiValue || !this._isValid) {
71
+ return null;
72
+ }
73
+ return this._valueProvider.getValue(this._dateApiValue.value, this._format);
74
+ }
75
+ /**
76
+ * Gets formatted value
77
+ */
78
+ get formattedValue() {
79
+ if (!this._isValid) {
80
+ return null;
81
+ }
82
+ return this.currentValue;
83
+ }
84
+ /**
85
+ * Gets indication whether is current value valid
86
+ */
87
+ get valid() {
88
+ return this._isValid;
89
+ }
90
+ /**
91
+ * Occurs when value changes
92
+ */
93
+ get valueChange() {
94
+ return this._valueChange.asObservable();
95
+ }
96
+ /**
97
+ * Occurs when selector is touched by user
98
+ */
99
+ get touched() {
100
+ return this._touched.asObservable();
101
+ }
102
+ /**
103
+ * Occurs when selector requires picker to be displayed
104
+ */
105
+ get pickerRequest() {
106
+ return this._pickerRequest.asObservable();
107
+ }
108
+ //######################### protected properties #########################
109
+ /**
110
+ * Gets or sets string representation current of value
111
+ */
112
+ get currentValue() {
113
+ return this.input.value || null;
114
+ }
115
+ set currentValue(value) {
116
+ if (this.input) {
117
+ this.input.value = value ?? '';
118
+ }
119
+ }
120
+ /**
121
+ * Gets input element used for handling date time value
122
+ */
123
+ get input() {
124
+ return this.inputElement.nativeElement;
125
+ }
126
+ //######################### public methods - implementation of DateTimeSelector #########################
127
+ /**
128
+ * Sets minimal possible value for picker, that can be picked
129
+ * @param value - Minimal possible value that can be picked
130
+ */
131
+ setMinValue(value) {
132
+ this._minValue = value;
133
+ }
134
+ /**
135
+ * Sets maximal possible value for picker, that can be picked
136
+ * @param value - Maximal possible value that can be picked
137
+ */
138
+ setMaxValue(value) {
139
+ this._maxValue = value;
140
+ }
141
+ /**
142
+ * Sets value of datetime selector
143
+ * @param value - Value to be set to this selector
144
+ */
145
+ setValue(value) {
146
+ if (value?.from) {
147
+ this._dateApiValue = this._dateApi.getValue(value?.from, this._format);
148
+ this._isValid = this._dateApiValue.isValid();
149
+ this._show();
150
+ }
151
+ else {
152
+ this._clearValue();
153
+ }
154
+ }
155
+ /**
156
+ * Sets as 'control' disabled
157
+ * @param disabled - Indication whether sets value as disabled, if omitted it is same as disabled set to true
158
+ */
159
+ setDisabled(disabled = true) {
160
+ this.disabled = disabled;
161
+ }
162
+ /**
163
+ * Explicitly runs invalidation of content (change detection)
164
+ */
165
+ invalidateVisuals() {
166
+ this._changeDetector.detectChanges();
167
+ }
168
+ //######################### public methods - template bindings #########################
169
+ /**
170
+ * Handles gaining of focus
171
+ * @internal
172
+ */
173
+ handleFocus() {
174
+ this._pickerRequest.next(true);
175
+ //no value
176
+ if (!this._dateApiValue) {
177
+ this._dateApiValue = this._dateApi.now();
178
+ this._isValid = this._dateApiValue.isValid();
179
+ if (this._minMaxConstraintTest()) {
180
+ this._clearValue();
181
+ }
182
+ else {
183
+ this._valueChange.next();
184
+ }
185
+ }
186
+ if (!this._isValid) {
187
+ return;
188
+ }
189
+ this._show();
190
+ }
191
+ /**
192
+ * Handles blur on input
193
+ * @internal
194
+ */
195
+ handleBlur() {
196
+ this._pickerRequest.next(false);
197
+ }
198
+ /**
199
+ * Handles user input
200
+ * @internal
201
+ */
202
+ handleInput() {
203
+ //empty value
204
+ if (!this.currentValue) {
205
+ this._clearValue();
206
+ this._valueChange.next();
207
+ return;
208
+ }
209
+ this._dateApiValue = this._dateApi.getValue(this.currentValue, this._format);
210
+ this._isValid = this._dateApiValue.isValid();
211
+ this._valueChange.next();
212
+ }
213
+ /**
214
+ * Handles click event inside of input
215
+ * @internal
216
+ */
217
+ handleClick() {
218
+ this._pickerRequest.next(true);
219
+ }
220
+ /**
221
+ * Handles keyboard events
222
+ * @param event - Keyboard event that occured
223
+ * @param input - Html input element that holds current value and selection
224
+ * @internal
225
+ */
226
+ handleKeyboard(event) {
227
+ if (!this._dateApiValue?.isValid()) {
228
+ return;
229
+ }
230
+ switch (event.key) {
231
+ case 'ArrowRight':
232
+ case 'ArrowLeft':
233
+ {
234
+ event.preventDefault();
235
+ event.stopPropagation();
236
+ this._withMinMaxConstraint(() => event.key == 'ArrowLeft' ? this._dateApiValue.subtractDays(1) : this._dateApiValue.addDays(1));
237
+ this._show();
238
+ break;
239
+ }
240
+ case 'ArrowUp':
241
+ case 'ArrowDown':
242
+ {
243
+ event.preventDefault();
244
+ event.stopPropagation();
245
+ this._withMinMaxConstraint(() => event.key == 'ArrowUp' ? this._dateApiValue.subtractWeeks(1) : this._dateApiValue.addWeeks(1));
246
+ this._show();
247
+ break;
248
+ }
249
+ case 'Escape':
250
+ {
251
+ this._pickerRequest.next(false);
252
+ break;
253
+ }
254
+ case ' ':
255
+ {
256
+ if (event.ctrlKey) {
257
+ this._pickerRequest.next(true);
258
+ }
259
+ break;
260
+ }
261
+ }
262
+ }
263
+ //######################### protected methods #########################
264
+ /**
265
+ * Clears current value
266
+ */
267
+ _clearValue() {
268
+ this._dateApiValue = null;
269
+ this._isValid = true;
270
+ this.currentValue = null;
271
+ }
272
+ /**
273
+ * Tests whether are min or max constraint broken, returns true if constraint is broken
274
+ */
275
+ _minMaxConstraintTest() {
276
+ return (!!this._minValue && this._dateApiValue.isBefore(this._minValue)) ||
277
+ (!!this._maxValue && this._dateApiValue.isAfter(this._maxValue));
278
+ }
279
+ /**
280
+ * Runs code with check whether min max constrains was broken
281
+ * @param code - Code that should be executed which can change current value
282
+ */
283
+ _withMinMaxConstraint(code) {
284
+ this._dateApiValue.updateOriginal();
285
+ code();
286
+ //min value constraint failure
287
+ if (this._minMaxConstraintTest()) {
288
+ this._dateApiValue?.resetOriginal();
289
+ return;
290
+ }
291
+ this._valueChange.next();
292
+ }
293
+ /**
294
+ * Shows current value in input
295
+ */
296
+ _show() {
297
+ if (this._isValid) {
298
+ this.currentValue = this._dateApiValue?.format(this._format) ?? null;
299
+ }
300
+ }
301
+ }
302
+ SimpleInputDateTimeSelectorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SimpleInputDateTimeSelectorComponent, deps: [{ token: DATE_API }, { token: i1.DateValueProvider }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
303
+ SimpleInputDateTimeSelectorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: SimpleInputDateTimeSelectorComponent, selector: "simple-input-date-time-selector", viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["input"], descendants: true, static: true }], ngImport: i0, template: "<input type=\"text\"\r\n #input\r\n (focus)=\"handleFocus()\"\r\n (blur)=\"handleBlur()\"\r\n (input)=\"handleInput()\"\r\n (click)=\"handleClick()\"\r\n (keydown)=\"handleKeyboard($any($event))\"\r\n [disabled]=\"disabled\"\r\n [placeholder]=\"placeholder\">", styles: [":host\r\n{\r\n display: block;\r\n}\r\n\r\ninput\r\n{\r\n width: 100%;\r\n}"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
304
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SimpleInputDateTimeSelectorComponent, decorators: [{
305
+ type: Component,
306
+ args: [{ selector: 'simple-input-date-time-selector', changeDetection: ChangeDetectionStrategy.OnPush, template: "<input type=\"text\"\r\n #input\r\n (focus)=\"handleFocus()\"\r\n (blur)=\"handleBlur()\"\r\n (input)=\"handleInput()\"\r\n (click)=\"handleClick()\"\r\n (keydown)=\"handleKeyboard($any($event))\"\r\n [disabled]=\"disabled\"\r\n [placeholder]=\"placeholder\">", styles: [":host\r\n{\r\n display: block;\r\n}\r\n\r\ninput\r\n{\r\n width: 100%;\r\n}"] }]
307
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
308
+ type: Inject,
309
+ args: [DATE_API]
310
+ }] }, { type: i1.DateValueProvider }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { inputElement: [{
311
+ type: ViewChild,
312
+ args: ['input', { static: true }]
313
+ }] } });
314
+ //# sourceMappingURL=simpleInputDateTime.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simpleInputDateTime.component.js","sourceRoot":"","sources":["../../../../../src/selector/components/simpleInputDateTime/simpleInputDateTime.component.ts","../../../../../src/selector/components/simpleInputDateTime/simpleInputDateTime.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,MAAM,EAAE,iBAAiB,EA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G;IACO,KAAK;QAEX,IAAG,IAAI,CAAC,QAAQ,EAChB;YACI,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC;SACxE;IACL,CAAC;;iIApZQ,oCAAoC,kBAoKzB,QAAQ;qHApKnB,oCAAoC,4LCnBjD,qTAQmC;2FDWtB,oCAAoC;kBAPhD,SAAS;+BAEI,iCAAiC,mBAG1B,uBAAuB,CAAC,MAAM;;0BAsKlC,MAAM;2BAAC,QAAQ;4GA5BrB,YAAY;sBADlB,SAAS;uBAAC,OAAO,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC","sourcesContent":["import {Component, ChangeDetectionStrategy, Inject, ChangeDetectorRef, ElementRef, ViewChild} from '@angular/core';\nimport {Observable, Subject} from 'rxjs';\n\nimport {DateTimeValue} from '../../../misc/datetime.interface';\nimport {DATE_API} from '../../../misc/tokens';\nimport {DateApi, DateApiObject} from '../../../services';\nimport {DateValueProvider} from '../../../services/dateValueProvider.service';\nimport {DateTimeSelector} from '../../misc/datetimeSelector.interface';\n\n/**\n * Component used as datetime selector with simple input\n */\n@Component(\n{\n selector: 'simple-input-date-time-selector',\n templateUrl: 'simpleInputDateTime.component.html',\n styleUrls: ['simpleInputDateTime.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SimpleInputDateTimeSelectorComponent<TDate = any> implements DateTimeSelector<TDate>\n{\n //######################### protected fields #########################\n\n /**\n * Occurs when value changes\n */\n protected _valueChange: Subject<void> = new Subject<void>();\n\n /**\n * Occurs when selector is touched by user\n */\n protected _touched: Subject<void> = new Subject<void>();\n\n /**\n * Occurs when selector requires picker to be displayed or hidden\n */\n protected _pickerRequest: Subject<boolean> = new Subject<boolean>();\n\n /**\n * Currently used format for displaying data\n */\n protected _format: string = '';\n\n /**\n * Current value representation as date api wrapper\n */\n protected _dateApiValue: null|DateApiObject<TDate> = null;\n\n /**\n * Indication whether is current value valid value\n */\n protected _isValid: boolean = true;\n\n /**\n * Minimal possible value that can be picked\n */\n protected _minValue: TDate|null = null;\n\n /**\n * Maximal possible value that can be picked\n */\n protected _maxValue: TDate|null = null;\n\n //######################### public properties - implementation of DateTimeSelector #########################\n\n /**\n * Gets or sets currently used format for displaying data\n */\n public get format(): string\n {\n return this._format;\n }\n public set format(value: string)\n {\n this._format = value;\n }\n\n /**\n * Gets or sets placeholder that is displayed when there is no value selected\n */\n public placeholder: string|undefined;\n\n /**\n * Gets current value of datetime\n */\n public get value(): DateTimeValue<TDate>|null\n {\n if(!this._dateApiValue || !this._isValid)\n {\n return null;\n }\n\n return this._valueProvider.getValue(this._dateApiValue.value, this._format);\n }\n\n /**\n * Gets formatted value\n */\n public get formattedValue(): string|null\n {\n if(!this._isValid)\n {\n return null;\n }\n\n return this.currentValue;\n }\n\n /**\n * Gets indication whether is current value valid\n */\n public get valid(): boolean\n {\n return this._isValid;\n }\n\n /**\n * Occurs when value changes\n */\n public get valueChange(): Observable<void>\n {\n return this._valueChange.asObservable();\n }\n\n /**\n * Occurs when selector is touched by user\n */\n public get touched(): Observable<void>\n {\n return this._touched.asObservable();\n }\n\n /**\n * Occurs when selector requires picker to be displayed\n */\n public get pickerRequest(): Observable<boolean>\n {\n return this._pickerRequest.asObservable();\n }\n\n //######################### public properties - template bindings #########################\n\n /**\n * Indication whether is input disabled\n * @internal\n */\n public disabled: boolean = false;\n\n //######################### public properties - children #########################\n\n /**\n * Instance of html input element\n * @internal\n */\n @ViewChild('input', {static: true})\n public inputElement?: ElementRef<HTMLInputElement>;\n\n //######################### protected properties #########################\n\n /**\n * Gets or sets string representation current of value\n */\n protected get currentValue(): string|null\n {\n return this.input.value || null;\n }\n protected set currentValue(value: string|null)\n {\n if(this.input)\n {\n this.input.value = value ?? '';\n }\n }\n\n /**\n * Gets input element used for handling date time value\n */\n protected get input(): HTMLInputElement\n {\n return this.inputElement!.nativeElement;\n }\n\n //######################### constructor #########################\n constructor(@Inject(DATE_API) protected _dateApi: DateApi<TDate>,\n protected _valueProvider: DateValueProvider<TDate>,\n protected _changeDetector: ChangeDetectorRef)\n {\n }\n\n //######################### public methods - implementation of DateTimeSelector #########################\n\n /**\n * Sets minimal possible value for picker, that can be picked\n * @param value - Minimal possible value that can be picked\n */\n public setMinValue(value: TDate|null): void\n {\n this._minValue = value;\n }\n\n /**\n * Sets maximal possible value for picker, that can be picked\n * @param value - Maximal possible value that can be picked\n */\n public setMaxValue(value: TDate|null): void\n {\n this._maxValue = value;\n }\n\n /**\n * Sets value of datetime selector\n * @param value - Value to be set to this selector\n */\n public setValue(value: DateTimeValue<TDate>|null): void\n {\n if(value?.from)\n {\n this._dateApiValue = this._dateApi.getValue(value?.from, this._format);\n this._isValid = this._dateApiValue.isValid();\n\n this._show();\n }\n else\n {\n this._clearValue();\n }\n }\n\n /**\n * Sets as 'control' disabled\n * @param disabled - Indication whether sets value as disabled, if omitted it is same as disabled set to true\n */\n public setDisabled(disabled: boolean = true): void\n {\n this.disabled = disabled;\n }\n\n /**\n * Explicitly runs invalidation of content (change detection)\n */\n public invalidateVisuals(): void\n {\n this._changeDetector.detectChanges();\n }\n\n //######################### public methods - template bindings #########################\n\n /**\n * Handles gaining of focus\n * @internal\n */\n public handleFocus()\n {\n this._pickerRequest.next(true);\n\n //no value\n if(!this._dateApiValue)\n {\n this._dateApiValue = this._dateApi.now();\n this._isValid = this._dateApiValue.isValid();\n\n if(this._minMaxConstraintTest())\n {\n this._clearValue();\n }\n else\n {\n this._valueChange.next();\n }\n }\n\n if(!this._isValid)\n {\n return;\n }\n\n this._show();\n }\n\n /**\n * Handles blur on input\n * @internal\n */\n public handleBlur()\n {\n this._pickerRequest.next(false);\n }\n\n /**\n * Handles user input\n * @internal\n */\n public handleInput()\n {\n //empty value\n if(!this.currentValue)\n {\n this._clearValue();\n this._valueChange.next();\n\n return;\n }\n\n this._dateApiValue = this._dateApi.getValue(this.currentValue, this._format);\n this._isValid = this._dateApiValue.isValid();\n this._valueChange.next();\n }\n\n /**\n * Handles click event inside of input\n * @internal\n */\n public handleClick()\n {\n this._pickerRequest.next(true);\n }\n\n /**\n * Handles keyboard events\n * @param event - Keyboard event that occured\n * @param input - Html input element that holds current value and selection\n * @internal\n */\n public handleKeyboard(event: KeyboardEvent)\n {\n if(!this._dateApiValue?.isValid())\n {\n return;\n }\n\n switch(event.key)\n {\n case 'ArrowRight':\n case 'ArrowLeft':\n {\n event.preventDefault();\n event.stopPropagation();\n\n this._withMinMaxConstraint(() => event.key == 'ArrowLeft' ? this._dateApiValue!.subtractDays(1) : this._dateApiValue!.addDays(1));\n this._show();\n\n break;\n }\n case 'ArrowUp':\n case 'ArrowDown':\n {\n event.preventDefault();\n event.stopPropagation();\n\n this._withMinMaxConstraint(() => event.key == 'ArrowUp' ? this._dateApiValue!.subtractWeeks(1) : this._dateApiValue!.addWeeks(1));\n this._show();\n\n break;\n }\n case 'Escape':\n {\n this._pickerRequest.next(false);\n\n break;\n }\n case ' ':\n {\n if(event.ctrlKey)\n {\n this._pickerRequest.next(true);\n }\n\n break;\n }\n }\n }\n\n //######################### protected methods #########################\n\n /**\n * Clears current value\n */\n protected _clearValue()\n {\n this._dateApiValue = null;\n this._isValid = true;\n this.currentValue = null;\n }\n\n /**\n * Tests whether are min or max constraint broken, returns true if constraint is broken\n */\n protected _minMaxConstraintTest(): boolean\n {\n return (!!this._minValue && this._dateApiValue!.isBefore(this._minValue)) ||\n (!!this._maxValue && this._dateApiValue!.isAfter(this._maxValue));\n }\n\n /**\n * Runs code with check whether min max constrains was broken\n * @param code - Code that should be executed which can change current value\n */\n protected _withMinMaxConstraint(code: () => void)\n {\n this._dateApiValue!.updateOriginal();\n\n code();\n\n //min value constraint failure\n if(this._minMaxConstraintTest())\n {\n this._dateApiValue?.resetOriginal();\n\n return;\n }\n\n this._valueChange.next();\n }\n\n /**\n * Shows current value in input\n */\n protected _show()\n {\n if(this._isValid)\n {\n this.currentValue = this._dateApiValue?.format(this._format) ?? null;\n }\n }\n}","<input type=\"text\"\r\n #input\r\n (focus)=\"handleFocus()\"\r\n (blur)=\"handleBlur()\"\r\n (input)=\"handleInput()\"\r\n (click)=\"handleClick()\"\r\n (keydown)=\"handleKeyboard($any($event))\"\r\n [disabled]=\"disabled\"\r\n [placeholder]=\"placeholder\">"]}
@@ -0,0 +1,51 @@
1
+ import { forwardRef, Directive, Inject } from '@angular/core';
2
+ import { NG_VALIDATORS } from '@angular/forms';
3
+ import { Validators } from '../../../misc/validators';
4
+ import { DateTimeSelectorComponent } from '../../components/selector/selector.component';
5
+ import { DATE_API } from '../../../misc/tokens';
6
+ import * as i0 from "@angular/core";
7
+ import * as i1 from "../../components/selector/selector.component";
8
+ /**
9
+ * Validator that is injected with directive DatetimeMaxValidatorDirective
10
+ */
11
+ const DATETIME_MIN_VALIDATOR = {
12
+ provide: NG_VALIDATORS,
13
+ useExisting: forwardRef(() => DatetimeMaxValidatorDirective),
14
+ multi: true
15
+ };
16
+ /**
17
+ * Directive injecting datetime max validator, validating max datetime value
18
+ */
19
+ export class DatetimeMaxValidatorDirective {
20
+ //######################### constructor #########################
21
+ constructor(datetimeSelector, dateApi) {
22
+ //######################### private fields #########################
23
+ /**
24
+ * Function used for validations
25
+ */
26
+ this._validator = () => null;
27
+ this._validator = Validators.maxDatetime(datetimeSelector, dateApi);
28
+ }
29
+ //######################### public methods - implementation of Validator #########################
30
+ /**
31
+ * Validates input and returns validation result
32
+ * @param control - Control that is being validated
33
+ * @returns validation results
34
+ */
35
+ validate(control) {
36
+ return this._validator(control);
37
+ }
38
+ }
39
+ DatetimeMaxValidatorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DatetimeMaxValidatorDirective, deps: [{ token: i1.DateTimeSelectorComponent }, { token: DATE_API }], target: i0.ɵɵFactoryTarget.Directive });
40
+ DatetimeMaxValidatorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: DatetimeMaxValidatorDirective, selector: "date-time-selector[validate][maxValue][formControlName]:not([range]),date-time-selector[validate][maxValue][formControl]:not([range]),date-time-selector[validate][maxValue][ngModel]:not([range])", providers: [DATETIME_MIN_VALIDATOR], ngImport: i0 });
41
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DatetimeMaxValidatorDirective, decorators: [{
42
+ type: Directive,
43
+ args: [{
44
+ selector: 'date-time-selector[validate][maxValue][formControlName]:not([range]),date-time-selector[validate][maxValue][formControl]:not([range]),date-time-selector[validate][maxValue][ngModel]:not([range])',
45
+ providers: [DATETIME_MIN_VALIDATOR]
46
+ }]
47
+ }], ctorParameters: function () { return [{ type: i1.DateTimeSelectorComponent }, { type: undefined, decorators: [{
48
+ type: Inject,
49
+ args: [DATE_API]
50
+ }] }]; } });
51
+ //# sourceMappingURL=datetimeMaxValidator.directive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datetimeMaxValidator.directive.js","sourceRoot":"","sources":["../../../../../src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,UAAU,EAAE,SAAS,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAC,aAAa,EAA4D,MAAM,gBAAgB,CAAC;AAExG,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAC,yBAAyB,EAAC,MAAM,8CAA8C,CAAC;AAEvF,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;;;AAE9C;;GAEG;AACH,MAAM,sBAAsB,GAC5B;IACI,OAAO,EAAE,aAAa;IACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,6BAA6B,CAAC;IAC5D,KAAK,EAAE,IAAI;CACd,CAAC;AAEF;;GAEG;AAMH,MAAM,OAAO,6BAA6B;IAStC,iEAAiE;IACjE,YAAY,gBAAkD,EAChC,OAAuB;QATrD,oEAAoE;QAEpE;;WAEG;QACK,eAAU,GAAgB,GAAG,EAAE,CAAC,IAAI,CAAC;QAMzC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,WAAW,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IACxE,CAAC;IAED,kGAAkG;IAElG;;;;OAIG;IACI,QAAQ,CAAC,OAAwB;QAEpC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;;0HA1BQ,6BAA6B,2DAWlB,QAAQ;8GAXnB,6BAA6B,6NAF3B,CAAC,sBAAsB,CAAC;2FAE1B,6BAA6B;kBALzC,SAAS;mBACV;oBACI,QAAQ,EAAE,oMAAoM;oBAC9M,SAAS,EAAE,CAAC,sBAAsB,CAAC;iBACtC;;0BAYgB,MAAM;2BAAC,QAAQ","sourcesContent":["import {ExistingProvider, forwardRef, Directive, Inject} from '@angular/core';\nimport {NG_VALIDATORS, AbstractControl, Validator, ValidatorFn, ValidationErrors} from '@angular/forms';\n\nimport {Validators} from '../../../misc/validators';\nimport {DateTimeSelectorComponent} from '../../components/selector/selector.component';\nimport {DateApi} from '../../../services/dateApi.interface';\nimport {DATE_API} from '../../../misc/tokens';\n\n/**\n * Validator that is injected with directive DatetimeMaxValidatorDirective\n */\nconst DATETIME_MIN_VALIDATOR = <ExistingProvider>\n{\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => DatetimeMaxValidatorDirective),\n multi: true\n};\n\n/**\n * Directive injecting datetime max validator, validating max datetime value \n */\n@Directive(\n{\n selector: 'date-time-selector[validate][maxValue][formControlName]:not([range]),date-time-selector[validate][maxValue][formControl]:not([range]),date-time-selector[validate][maxValue][ngModel]:not([range])',\n providers: [DATETIME_MIN_VALIDATOR]\n})\nexport class DatetimeMaxValidatorDirective<TDate = any> implements Validator\n{\n //######################### private fields #########################\n\n /**\n * Function used for validations\n */\n private _validator: ValidatorFn = () => null;\n\n //######################### constructor #########################\n constructor(datetimeSelector: DateTimeSelectorComponent<TDate>,\n @Inject(DATE_API) dateApi: DateApi<TDate>)\n {\n this._validator = Validators.maxDatetime(datetimeSelector, dateApi);\n }\n\n //######################### public methods - implementation of Validator #########################\n\n /**\n * Validates input and returns validation result\n * @param control - Control that is being validated\n * @returns validation results\n */\n public validate(control: AbstractControl): ValidationErrors|null\n {\n return this._validator(control);\n }\n}"]}
@@ -0,0 +1,51 @@
1
+ import { forwardRef, Directive, Inject } from '@angular/core';
2
+ import { NG_VALIDATORS } from '@angular/forms';
3
+ import { Validators } from '../../../misc/validators';
4
+ import { DateTimeSelectorComponent } from '../../components/selector/selector.component';
5
+ import { DATE_API } from '../../../misc/tokens';
6
+ import * as i0 from "@angular/core";
7
+ import * as i1 from "../../components/selector/selector.component";
8
+ /**
9
+ * Validator that is injected with directive DatetimeMinValidatorDirective
10
+ */
11
+ const DATETIME_MIN_VALIDATOR = {
12
+ provide: NG_VALIDATORS,
13
+ useExisting: forwardRef(() => DatetimeMinValidatorDirective),
14
+ multi: true
15
+ };
16
+ /**
17
+ * Directive injecting datetime min validator, validating min datetime value
18
+ */
19
+ export class DatetimeMinValidatorDirective {
20
+ //######################### constructor #########################
21
+ constructor(datetimeSelector, dateApi) {
22
+ //######################### private fields #########################
23
+ /**
24
+ * Function used for validations
25
+ */
26
+ this._validator = () => null;
27
+ this._validator = Validators.minDatetime(datetimeSelector, dateApi);
28
+ }
29
+ //######################### public methods - implementation of Validator #########################
30
+ /**
31
+ * Validates input and returns validation result
32
+ * @param control - Control that is being validated
33
+ * @returns validation results
34
+ */
35
+ validate(control) {
36
+ return this._validator(control);
37
+ }
38
+ }
39
+ DatetimeMinValidatorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DatetimeMinValidatorDirective, deps: [{ token: i1.DateTimeSelectorComponent }, { token: DATE_API }], target: i0.ɵɵFactoryTarget.Directive });
40
+ DatetimeMinValidatorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: DatetimeMinValidatorDirective, selector: "date-time-selector[validate][minValue][formControlName]:not([range]),date-time-selector[validate][minValue][formControl]:not([range]),date-time-selector[validate][minValue][ngModel]:not([range])", providers: [DATETIME_MIN_VALIDATOR], ngImport: i0 });
41
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DatetimeMinValidatorDirective, decorators: [{
42
+ type: Directive,
43
+ args: [{
44
+ selector: 'date-time-selector[validate][minValue][formControlName]:not([range]),date-time-selector[validate][minValue][formControl]:not([range]),date-time-selector[validate][minValue][ngModel]:not([range])',
45
+ providers: [DATETIME_MIN_VALIDATOR]
46
+ }]
47
+ }], ctorParameters: function () { return [{ type: i1.DateTimeSelectorComponent }, { type: undefined, decorators: [{
48
+ type: Inject,
49
+ args: [DATE_API]
50
+ }] }]; } });
51
+ //# sourceMappingURL=datetimeMinValidator.directive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datetimeMinValidator.directive.js","sourceRoot":"","sources":["../../../../../src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,UAAU,EAAE,SAAS,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAC,aAAa,EAA4D,MAAM,gBAAgB,CAAC;AAExG,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAC,yBAAyB,EAAC,MAAM,8CAA8C,CAAC;AAEvF,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;;;AAE9C;;GAEG;AACH,MAAM,sBAAsB,GAC5B;IACI,OAAO,EAAE,aAAa;IACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,6BAA6B,CAAC;IAC5D,KAAK,EAAE,IAAI;CACd,CAAC;AAEF;;GAEG;AAMH,MAAM,OAAO,6BAA6B;IAStC,iEAAiE;IACjE,YAAY,gBAAkD,EAChC,OAAuB;QATrD,oEAAoE;QAEpE;;WAEG;QACK,eAAU,GAAgB,GAAG,EAAE,CAAC,IAAI,CAAC;QAMzC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,WAAW,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IACxE,CAAC;IAED,kGAAkG;IAElG;;;;OAIG;IACI,QAAQ,CAAC,OAAwB;QAEpC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;;0HA1BQ,6BAA6B,2DAWlB,QAAQ;8GAXnB,6BAA6B,6NAF3B,CAAC,sBAAsB,CAAC;2FAE1B,6BAA6B;kBALzC,SAAS;mBACV;oBACI,QAAQ,EAAE,oMAAoM;oBAC9M,SAAS,EAAE,CAAC,sBAAsB,CAAC;iBACtC;;0BAYgB,MAAM;2BAAC,QAAQ","sourcesContent":["import {ExistingProvider, forwardRef, Directive, Inject} from '@angular/core';\nimport {NG_VALIDATORS, AbstractControl, Validator, ValidatorFn, ValidationErrors} from '@angular/forms';\n\nimport {Validators} from '../../../misc/validators';\nimport {DateTimeSelectorComponent} from '../../components/selector/selector.component';\nimport {DateApi} from '../../../services/dateApi.interface';\nimport {DATE_API} from '../../../misc/tokens';\n\n/**\n * Validator that is injected with directive DatetimeMinValidatorDirective\n */\nconst DATETIME_MIN_VALIDATOR = <ExistingProvider>\n{\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => DatetimeMinValidatorDirective),\n multi: true\n};\n\n/**\n * Directive injecting datetime min validator, validating min datetime value \n */\n@Directive(\n{\n selector: 'date-time-selector[validate][minValue][formControlName]:not([range]),date-time-selector[validate][minValue][formControl]:not([range]),date-time-selector[validate][minValue][ngModel]:not([range])',\n providers: [DATETIME_MIN_VALIDATOR]\n})\nexport class DatetimeMinValidatorDirective<TDate = any> implements Validator\n{\n //######################### private fields #########################\n\n /**\n * Function used for validations\n */\n private _validator: ValidatorFn = () => null;\n\n //######################### constructor #########################\n constructor(datetimeSelector: DateTimeSelectorComponent<TDate>,\n @Inject(DATE_API) dateApi: DateApi<TDate>)\n {\n this._validator = Validators.minDatetime(datetimeSelector, dateApi);\n }\n\n //######################### public methods - implementation of Validator #########################\n\n /**\n * Validates input and returns validation result\n * @param control - Control that is being validated\n * @returns validation results\n */\n public validate(control: AbstractControl): ValidationErrors|null\n {\n return this._validator(control);\n }\n}"]}
@@ -0,0 +1,47 @@
1
+ import { forwardRef, Directive } from '@angular/core';
2
+ import { NG_VALIDATORS } from '@angular/forms';
3
+ import { Validators } from '../../../misc/validators';
4
+ import { DateTimeSelectorComponent } from '../../components/selector/selector.component';
5
+ import * as i0 from "@angular/core";
6
+ import * as i1 from "../../components/selector/selector.component";
7
+ /**
8
+ * Validator that is injected with directive DatetimeValidatorDirective
9
+ */
10
+ const DATETIME_VALIDATOR = {
11
+ provide: NG_VALIDATORS,
12
+ useExisting: forwardRef(() => DatetimeValidatorDirective),
13
+ multi: true
14
+ };
15
+ /**
16
+ * Directive injecting datetime validator, validating datetime
17
+ */
18
+ export class DatetimeValidatorDirective {
19
+ //######################### constructor #########################
20
+ constructor(datetimeSelector) {
21
+ //######################### private fields #########################
22
+ /**
23
+ * Function used for validations
24
+ */
25
+ this._validator = () => null;
26
+ this._validator = Validators.datetime(datetimeSelector);
27
+ }
28
+ //######################### public methods - implementation of Validator #########################
29
+ /**
30
+ * Validates input and returns validation result
31
+ * @param control - Control that is being validated
32
+ * @returns validation results
33
+ */
34
+ validate(control) {
35
+ return this._validator(control);
36
+ }
37
+ }
38
+ DatetimeValidatorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DatetimeValidatorDirective, deps: [{ token: i1.DateTimeSelectorComponent }], target: i0.ɵɵFactoryTarget.Directive });
39
+ DatetimeValidatorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: DatetimeValidatorDirective, selector: "date-time-selector[validate][formControlName]:not([range]),date-time-selector[validate][formControl]:not([range]),date-time-selector[validate][ngModel]:not([range])", providers: [DATETIME_VALIDATOR], ngImport: i0 });
40
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DatetimeValidatorDirective, decorators: [{
41
+ type: Directive,
42
+ args: [{
43
+ selector: 'date-time-selector[validate][formControlName]:not([range]),date-time-selector[validate][formControl]:not([range]),date-time-selector[validate][ngModel]:not([range])',
44
+ providers: [DATETIME_VALIDATOR]
45
+ }]
46
+ }], ctorParameters: function () { return [{ type: i1.DateTimeSelectorComponent }]; } });
47
+ //# sourceMappingURL=datetimeValidator.directive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datetimeValidator.directive.js","sourceRoot":"","sources":["../../../../../src/selector/directives/datetimeValidator/datetimeValidator.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,UAAU,EAAE,SAAS,EAAC,MAAM,eAAe,CAAC;AACtE,OAAO,EAAC,aAAa,EAA4D,MAAM,gBAAgB,CAAC;AAExG,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAC,yBAAyB,EAAC,MAAM,8CAA8C,CAAC;;;AAEvF;;GAEG;AACH,MAAM,kBAAkB,GACxB;IACI,OAAO,EAAE,aAAa;IACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,0BAA0B,CAAC;IACzD,KAAK,EAAE,IAAI;CACd,CAAC;AAEF;;GAEG;AAMH,MAAM,OAAO,0BAA0B;IASnC,iEAAiE;IACjE,YAAY,gBAAkD;QAR9D,oEAAoE;QAEpE;;WAEG;QACK,eAAU,GAAgB,GAAG,EAAE,CAAC,IAAI,CAAC;QAKzC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;IAC5D,CAAC;IAED,kGAAkG;IAElG;;;;OAIG;IACI,QAAQ,CAAC,OAAwB;QAEpC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;;uHAzBQ,0BAA0B;2GAA1B,0BAA0B,+LAFxB,CAAC,kBAAkB,CAAC;2FAEtB,0BAA0B;kBALtC,SAAS;mBACV;oBACI,QAAQ,EAAE,sKAAsK;oBAChL,SAAS,EAAE,CAAC,kBAAkB,CAAC;iBAClC","sourcesContent":["import {ExistingProvider, forwardRef, Directive} from '@angular/core';\nimport {NG_VALIDATORS, AbstractControl, Validator, ValidatorFn, ValidationErrors} from '@angular/forms';\n\nimport {Validators} from '../../../misc/validators';\nimport {DateTimeSelectorComponent} from '../../components/selector/selector.component';\n\n/**\n * Validator that is injected with directive DatetimeValidatorDirective\n */\nconst DATETIME_VALIDATOR = <ExistingProvider>\n{\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => DatetimeValidatorDirective),\n multi: true\n};\n\n/**\n * Directive injecting datetime validator, validating datetime\n */\n@Directive(\n{\n selector: 'date-time-selector[validate][formControlName]:not([range]),date-time-selector[validate][formControl]:not([range]),date-time-selector[validate][ngModel]:not([range])',\n providers: [DATETIME_VALIDATOR]\n})\nexport class DatetimeValidatorDirective<TDate = any> implements Validator\n{\n //######################### private fields #########################\n\n /**\n * Function used for validations\n */\n private _validator: ValidatorFn = () => null;\n\n //######################### constructor #########################\n constructor(datetimeSelector: DateTimeSelectorComponent<TDate>)\n {\n this._validator = Validators.datetime(datetimeSelector);\n }\n\n //######################### public methods - implementation of Validator #########################\n\n /**\n * Validates input and returns validation result\n * @param control - Control that is being validated\n * @returns validation results\n */\n public validate(control: AbstractControl): ValidationErrors|null\n {\n return this._validator(control);\n }\n}"]}
@@ -0,0 +1,118 @@
1
+ import { Directive, forwardRef, Input } from '@angular/core';
2
+ import { NG_VALUE_ACCESSOR } from '@angular/forms';
3
+ import { Subscription } from 'rxjs';
4
+ import { DateTimeSelectorComponent } from '../../components/selector/selector.component';
5
+ import * as i0 from "@angular/core";
6
+ import * as i1 from "../../components/selector/selector.component";
7
+ /**
8
+ * Value accessor provider for date time selector
9
+ */
10
+ const DATE_TIME_SELECTOR_VALUE_ACCESSOR = {
11
+ provide: NG_VALUE_ACCESSOR,
12
+ useExisting: forwardRef(() => DateTimeSelectorControlValueAccessor),
13
+ multi: true
14
+ };
15
+ /**
16
+ * Value accessor for getting and setting values for date time selector
17
+ */
18
+ export class DateTimeSelectorControlValueAccessor {
19
+ //######################### constructor #########################
20
+ constructor(_selector) {
21
+ this._selector = _selector;
22
+ //######################### protected fields #########################
23
+ /**
24
+ * Subscriptions that are destroyed on directive destruction
25
+ */
26
+ this._subscriptions = new Subscription();
27
+ //######################### public properties - inputs #########################
28
+ /**
29
+ * Indication whether value for selector is represented as range from, to
30
+ */
31
+ this.range = false;
32
+ /**
33
+ * Indication whether value for selector is represented as formatted string value, if both 'formatted' and 'range' are set, 'range' takes precedence
34
+ */
35
+ this.formatted = false;
36
+ }
37
+ //######################### public methods - implementation of OnDestroy #########################
38
+ /**
39
+ * Called when component is destroyed
40
+ */
41
+ ngOnDestroy() {
42
+ this._subscriptions?.unsubscribe();
43
+ }
44
+ //######################### public methods - implementation of ControlValueAccessor #########################
45
+ /**
46
+ * Sets value to datetime selector
47
+ */
48
+ writeValue(value) {
49
+ if (this.range) {
50
+ this._selector.value = value;
51
+ }
52
+ else if (this.formatted) {
53
+ this._selector.formattedValue = value;
54
+ }
55
+ else {
56
+ this._selector.value =
57
+ {
58
+ from: value,
59
+ to: value
60
+ };
61
+ }
62
+ }
63
+ /**
64
+ * Registers callback that is called when value of datetime selector value changes
65
+ */
66
+ registerOnChange(fn) {
67
+ this._subscriptions.add(this._selector.valueChange.subscribe(() => this._emitValue(fn)));
68
+ }
69
+ /**
70
+ * Registers callback that is called when datetime selector was touched by user
71
+ */
72
+ registerOnTouched(fn) {
73
+ this._subscriptions.add(this._selector.touched.subscribe(() => fn()));
74
+ }
75
+ /**
76
+ * Used for setting control as disabled
77
+ * @param isDisabled - disabled status to set on the element
78
+ */
79
+ setDisabledState(isDisabled) {
80
+ this._selector.setDisabled(isDisabled);
81
+ }
82
+ //######################### protected methods #########################
83
+ /**
84
+ * Used for emitting value that was changed
85
+ * @param fn - Function that is used for emitting changed value
86
+ */
87
+ _emitValue(fn) {
88
+ if (this.range) {
89
+ fn(this._selector.value);
90
+ }
91
+ else if (this.formatted) {
92
+ fn(this._selector.formattedValue);
93
+ }
94
+ else {
95
+ const value = this._selector.value;
96
+ if (!value) {
97
+ fn(null);
98
+ }
99
+ else {
100
+ fn(value.from);
101
+ }
102
+ }
103
+ }
104
+ }
105
+ DateTimeSelectorControlValueAccessor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DateTimeSelectorControlValueAccessor, deps: [{ token: i1.DateTimeSelectorComponent }], target: i0.ɵɵFactoryTarget.Directive });
106
+ DateTimeSelectorControlValueAccessor.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: DateTimeSelectorControlValueAccessor, selector: "date-time-selector[formControlName],date-time-selector[formControl],date-time-selector[ngModel]", inputs: { range: "range", formatted: "formatted" }, providers: [DATE_TIME_SELECTOR_VALUE_ACCESSOR], ngImport: i0 });
107
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DateTimeSelectorControlValueAccessor, decorators: [{
108
+ type: Directive,
109
+ args: [{
110
+ selector: 'date-time-selector[formControlName],date-time-selector[formControl],date-time-selector[ngModel]',
111
+ providers: [DATE_TIME_SELECTOR_VALUE_ACCESSOR]
112
+ }]
113
+ }], ctorParameters: function () { return [{ type: i1.DateTimeSelectorComponent }]; }, propDecorators: { range: [{
114
+ type: Input
115
+ }], formatted: [{
116
+ type: Input
117
+ }] } });
118
+ //# sourceMappingURL=selectorControlValueAccessor.directive.js.map