@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
@@ -1,19 +1,19 @@
1
- export * from './misc/constants';
2
- export * from './misc/datetime.interface';
3
- export * from './misc/tokens';
4
- export * from './misc/validators';
5
- export * from './selector/interfaces';
6
- export * from './selector/types';
7
- export * from './selector/modules/basicSelector.module';
8
- export * from './selector/modules/selector.module';
9
- export * from './services';
10
- export * from './services/datePositionParser.service';
11
- export * from './services/dateTimeRelativeParser.service';
12
- export * from './services/dateValueProvider.service';
13
- export * from './picker/modules/picker.module';
14
- export * from './picker/interfaces';
15
- export * from './picker/types';
16
- export * from './pipes/dateConvert.pipe';
17
- export * from './pipes/dateFormat.pipe';
18
- export * from './modules/datePipes.module';
19
- //# sourceMappingURL=datetime.d.ts.map
1
+ export * from './misc/constants';
2
+ export * from './misc/datetime.interface';
3
+ export * from './misc/tokens';
4
+ export * from './misc/validators';
5
+ export * from './selector/interfaces';
6
+ export * from './selector/types';
7
+ export * from './selector/modules/basicSelector.module';
8
+ export * from './selector/modules/selector.module';
9
+ export * from './services';
10
+ export * from './services/datePositionParser.service';
11
+ export * from './services/dateTimeRelativeParser.service';
12
+ export * from './services/dateValueProvider.service';
13
+ export * from './picker/modules/picker.module';
14
+ export * from './picker/interfaces';
15
+ export * from './picker/types';
16
+ export * from './pipes/dateConvert.pipe';
17
+ export * from './pipes/dateFormat.pipe';
18
+ export * from './modules/datePipes.module';
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yCAAyC,CAAC;AACxD,cAAc,oCAAoC,CAAC;AACnD,cAAc,YAAY,CAAC;AAC3B,cAAc,uCAAuC,CAAC;AACtD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,sCAAsC,CAAC;AACrD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC","sourcesContent":["export * from './misc/constants';\nexport * from './misc/datetime.interface';\nexport * from './misc/tokens';\nexport * from './misc/validators';\nexport * from './selector/interfaces';\nexport * from './selector/types';\nexport * from './selector/modules/basicSelector.module';\nexport * from './selector/modules/selector.module';\nexport * from './services';\nexport * from './services/datePositionParser.service';\nexport * from './services/dateTimeRelativeParser.service';\nexport * from './services/dateValueProvider.service';\nexport * from './picker/modules/picker.module';\nexport * from './picker/interfaces';\nexport * from './picker/types';\nexport * from './pipes/dateConvert.pipe';\nexport * from './pipes/dateFormat.pipe';\nexport * from './modules/datePipes.module';"]}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Represents minute component of datetime
3
+ */
4
+ export const MINUTE = 'minute';
5
+ /**
6
+ * Represents hour component of datetime
7
+ */
8
+ export const HOUR = 'hour';
9
+ /**
10
+ * Represents day component of datetime
11
+ */
12
+ export const DAY = 'day';
13
+ /**
14
+ * Represents week component of datetime
15
+ */
16
+ export const WEEK = 'week';
17
+ /**
18
+ * Represents month component of datetime
19
+ */
20
+ export const MONTH = 'month';
21
+ /**
22
+ * Represents quarter component of datetime
23
+ */
24
+ export const QUARTER = 'quarter';
25
+ /**
26
+ * Represents year component of datetime
27
+ */
28
+ export const YEAR = 'year';
29
+ /**
30
+ * Represents decade component of datetime
31
+ */
32
+ export const DECADE = 'decade';
33
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/misc/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC;AAE/B;;GAEG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC;AAE3B;;GAEG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,KAAK,CAAC;AAEzB;;GAEG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC;AAE3B;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,OAAO,CAAC;AAE7B;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC;AAEjC;;GAEG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC;AAE3B;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC","sourcesContent":["/**\n * Represents minute component of datetime\n */\nexport const MINUTE = 'minute';\n\n/**\n * Represents hour component of datetime\n */\nexport const HOUR = 'hour';\n\n/**\n * Represents day component of datetime\n */\nexport const DAY = 'day';\n\n/**\n * Represents week component of datetime\n */\nexport const WEEK = 'week';\n\n/**\n * Represents month component of datetime\n */\nexport const MONTH = 'month';\n\n/**\n * Represents quarter component of datetime\n */\nexport const QUARTER = 'quarter';\n\n/**\n * Represents year component of datetime\n */\nexport const YEAR = 'year';\n\n/**\n * Represents decade component of datetime\n */\nexport const DECADE = 'decade';"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=datetime.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datetime.interface.js","sourceRoot":"","sources":["../../../src/misc/datetime.interface.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Represents datetime value as period\n */\nexport interface DateTimeValue<TDate = any>\n{\n /**\n * Starting date and time of period\n */\n from: TDate;\n\n /**\n * Ending date and time of period\n */\n to: TDate;\n}\n\n/**\n * Represents object that holds data for indentification of validity of date time\n */\nexport interface DateTimeValueObject<TDate = any>\n{\n /**\n * Current value of datetime\n */\n readonly value: DateTimeValue<TDate>|null;\n\n /**\n * Indicaiton whether is current value valid, empty value is valid\n */\n readonly valid: boolean;\n\n /**\n * Minimal possible value, that can be\n */\n readonly minValue: TDate|null;\n\n /**\n * Maximal possible value, that can be\n */\n readonly maxValue: TDate|null;\n}"]}
@@ -0,0 +1,19 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ /**
3
+ * Injection token used for obtaining DateApi implementation
4
+ */
5
+ export const DATE_API = new InjectionToken('DATE_API');
6
+ /**
7
+ * Injection token used for obtaining FormatProvider implementation
8
+ */
9
+ export const FORMAT_PROVIDER = new InjectionToken('FORMAT_PROVIDER', {
10
+ providedIn: 'root',
11
+ factory: () => {
12
+ return {
13
+ date: 'yyyy-MM-dd',
14
+ dateTime: 'yyyy-MM-dd HH:mm',
15
+ time: 'HH:mm'
16
+ };
17
+ }
18
+ });
19
+ //# sourceMappingURL=tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../src/misc/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;AAI7C;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAA4B,IAAI,cAAc,CAAU,UAAU,CAAC,CAAC;AAEzF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAmC,IAAI,cAAc,CAAiB,iBAAiB,EACjB;IACI,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,GAAG,EAAE;QAEV,OAAO;YACH,IAAI,EAAE,YAAY;YAClB,QAAQ,EAAE,kBAAkB;YAC5B,IAAI,EAAE,OAAO;SAChB,CAAC;IACN,CAAC;CACJ,CAAC,CAAC","sourcesContent":["import {InjectionToken} from '@angular/core';\n\nimport {DateApi, FormatProvider} from '../services';\n\n/**\n * Injection token used for obtaining DateApi implementation\n */\nexport const DATE_API: InjectionToken<DateApi> = new InjectionToken<DateApi>('DATE_API');\n\n/**\n * Injection token used for obtaining FormatProvider implementation\n */\nexport const FORMAT_PROVIDER: InjectionToken<FormatProvider> = new InjectionToken<FormatProvider>('FORMAT_PROVIDER',\n {\n providedIn: 'root',\n factory: () =>\n {\n return {\n date: 'yyyy-MM-dd',\n dateTime: 'yyyy-MM-dd HH:mm',\n time: 'HH:mm'\n };\n }\n });"]}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Validations functions for datetime
3
+ */
4
+ export class Validators {
5
+ /**
6
+ * Creates validator function that validates control if its value is valid datetime value
7
+ * @param datetime - Object storing information about datetime value
8
+ */
9
+ static datetime(datetime) {
10
+ return () => {
11
+ if (!datetime.valid) {
12
+ return {
13
+ 'datetime': true
14
+ };
15
+ }
16
+ return null;
17
+ };
18
+ }
19
+ /**
20
+ * Creates validator function that validates control if its value is withing range of minimal datetime value
21
+ * @param datetime - Object storing information about datetime value
22
+ * @param dateApi - Date api object
23
+ */
24
+ static minDatetime(datetime, dateApi) {
25
+ return (control) => {
26
+ if (!!control.value &&
27
+ datetime.valid &&
28
+ datetime.minValue &&
29
+ dateApi.getValue(control.value).isBefore(datetime.minValue)) {
30
+ return {
31
+ 'minDatetime': datetime.minValue,
32
+ 'actualValue': control.value
33
+ };
34
+ }
35
+ return null;
36
+ };
37
+ }
38
+ /**
39
+ * Creates validator function that validates control if its value is withing range of maximal datetime value
40
+ * @param datetime - Object storing information about datetime value
41
+ * @param dateApi - Date api object
42
+ */
43
+ static maxDatetime(datetime, dateApi) {
44
+ return (control) => {
45
+ if (!!control.value &&
46
+ datetime.valid &&
47
+ datetime.maxValue &&
48
+ dateApi.getValue(control.value).isAfter(datetime.maxValue)) {
49
+ return {
50
+ 'maxDatetime': datetime.maxValue,
51
+ 'actualValue': control.value
52
+ };
53
+ }
54
+ return null;
55
+ };
56
+ }
57
+ }
58
+ //# sourceMappingURL=validators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validators.js","sourceRoot":"","sources":["../../../src/misc/validators.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,OAAO,UAAU;IAEnB;;;OAGG;IACI,MAAM,CAAC,QAAQ,CAAc,QAAoC;QAEpE,OAAO,GAA0B,EAAE;YAE/B,IAAG,CAAC,QAAQ,CAAC,KAAK,EAClB;gBACI,OAAO;oBACH,UAAU,EAAE,IAAI;iBACnB,CAAC;aACL;YAED,OAAO,IAAI,CAAC;QAChB,CAAC,CAAC;IACN,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,WAAW,CAAc,QAAoC,EAAE,OAAuB;QAEhG,OAAO,CAAC,OAAwB,EAAyB,EAAE;YAEvD,IAAG,CAAC,CAAC,OAAO,CAAC,KAAK;gBACf,QAAQ,CAAC,KAAK;gBACd,QAAQ,CAAC,QAAQ;gBACjB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAC9D;gBACI,OAAO;oBACH,aAAa,EAAE,QAAQ,CAAC,QAAQ;oBAChC,aAAa,EAAE,OAAO,CAAC,KAAK;iBAC/B,CAAC;aACL;YAED,OAAO,IAAI,CAAC;QAChB,CAAC,CAAC;IACN,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,WAAW,CAAc,QAAoC,EAAE,OAAuB;QAEhG,OAAO,CAAC,OAAwB,EAAyB,EAAE;YAEvD,IAAG,CAAC,CAAC,OAAO,CAAC,KAAK;gBACf,QAAQ,CAAC,KAAK;gBACd,QAAQ,CAAC,QAAQ;gBACjB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAC7D;gBACI,OAAO;oBACH,aAAa,EAAE,QAAQ,CAAC,QAAQ;oBAChC,aAAa,EAAE,OAAO,CAAC,KAAK;iBAC/B,CAAC;aACL;YAED,OAAO,IAAI,CAAC;QAChB,CAAC,CAAC;IACN,CAAC;CACJ","sourcesContent":["import {AbstractControl, ValidationErrors, ValidatorFn} from '@angular/forms';\n\nimport {DateApi} from '../services';\nimport {DateTimeValueObject} from './datetime.interface';\n\n/**\n * Validations functions for datetime\n */\nexport class Validators\n{\n /**\n * Creates validator function that validates control if its value is valid datetime value\n * @param datetime - Object storing information about datetime value\n */\n public static datetime<TDate = any>(datetime: DateTimeValueObject<TDate>): ValidatorFn\n {\n return (): ValidationErrors|null =>\n {\n if(!datetime.valid)\n {\n return {\n 'datetime': true\n };\n }\n\n return null;\n };\n }\n\n /**\n * Creates validator function that validates control if its value is withing range of minimal datetime value\n * @param datetime - Object storing information about datetime value\n * @param dateApi - Date api object\n */\n public static minDatetime<TDate = any>(datetime: DateTimeValueObject<TDate>, dateApi: DateApi<TDate>): ValidatorFn\n {\n return (control: AbstractControl): ValidationErrors|null =>\n {\n if(!!control.value &&\n datetime.valid &&\n datetime.minValue &&\n dateApi.getValue(control.value).isBefore(datetime.minValue))\n {\n return {\n 'minDatetime': datetime.minValue,\n 'actualValue': control.value\n };\n }\n\n return null;\n };\n }\n\n /**\n * Creates validator function that validates control if its value is withing range of maximal datetime value\n * @param datetime - Object storing information about datetime value\n * @param dateApi - Date api object\n */\n public static maxDatetime<TDate = any>(datetime: DateTimeValueObject<TDate>, dateApi: DateApi<TDate>): ValidatorFn\n {\n return (control: AbstractControl): ValidationErrors|null =>\n {\n if(!!control.value &&\n datetime.valid &&\n datetime.maxValue &&\n dateApi.getValue(control.value).isAfter(datetime.maxValue))\n {\n return {\n 'maxDatetime': datetime.maxValue,\n 'actualValue': control.value\n };\n }\n\n return null;\n };\n }\n}"]}
@@ -0,0 +1,33 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { AsRequiredTypePipe } from '../pipes/asRequiredType';
3
+ import { DateConvertPipe } from '../pipes/dateConvert.pipe';
4
+ import { DateFormatPipe } from '../pipes/dateFormat.pipe';
5
+ import * as i0 from "@angular/core";
6
+ /**
7
+ * Module used for exporting date pipes
8
+ */
9
+ export class DatePipesModule {
10
+ }
11
+ DatePipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DatePipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
12
+ DatePipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DatePipesModule, declarations: [AsRequiredTypePipe,
13
+ DateFormatPipe,
14
+ DateConvertPipe], exports: [AsRequiredTypePipe,
15
+ DateFormatPipe,
16
+ DateConvertPipe] });
17
+ DatePipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DatePipesModule });
18
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DatePipesModule, decorators: [{
19
+ type: NgModule,
20
+ args: [{
21
+ declarations: [
22
+ AsRequiredTypePipe,
23
+ DateFormatPipe,
24
+ DateConvertPipe,
25
+ ],
26
+ exports: [
27
+ AsRequiredTypePipe,
28
+ DateFormatPipe,
29
+ DateConvertPipe,
30
+ ]
31
+ }]
32
+ }] });
33
+ //# sourceMappingURL=datePipes.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datePipes.module.js","sourceRoot":"","sources":["../../../src/modules/datePipes.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAC,kBAAkB,EAAC,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAC,cAAc,EAAC,MAAM,0BAA0B,CAAC;;AAExD;;GAEG;AAgBH,MAAM,OAAO,eAAe;;4GAAf,eAAe;6GAAf,eAAe,iBAXpB,kBAAkB;QAClB,cAAc;QACd,eAAe,aAIf,kBAAkB;QAClB,cAAc;QACd,eAAe;6GAGV,eAAe;2FAAf,eAAe;kBAf3B,QAAQ;mBACT;oBACI,YAAY,EACZ;wBACI,kBAAkB;wBAClB,cAAc;wBACd,eAAe;qBAClB;oBACD,OAAO,EACP;wBACI,kBAAkB;wBAClB,cAAc;wBACd,eAAe;qBAClB;iBACJ","sourcesContent":["import {NgModule} from '@angular/core';\n\nimport {AsRequiredTypePipe} from '../pipes/asRequiredType';\nimport {DateConvertPipe} from '../pipes/dateConvert.pipe';\nimport {DateFormatPipe} from '../pipes/dateFormat.pipe';\n\n/**\n * Module used for exporting date pipes\n */\n@NgModule(\n{\n declarations:\n [\n AsRequiredTypePipe,\n DateFormatPipe,\n DateConvertPipe,\n ],\n exports:\n [\n AsRequiredTypePipe,\n DateFormatPipe,\n DateConvertPipe,\n ]\n})\nexport class DatePipesModule\n{\n}"]}
@@ -0,0 +1,172 @@
1
+ import { Component, ChangeDetectionStrategy, Inject, ChangeDetectorRef } from '@angular/core';
2
+ import { extend } from '@jscrpt/common';
3
+ import { DATE_API } from '../../../misc/tokens';
4
+ import { PickerBaseComponent } from '../pickerBase.component';
5
+ import * as i0 from "@angular/core";
6
+ import * as i1 from "@angular/common";
7
+ import * as i2 from "../../../pipes/asRequiredType";
8
+ /**
9
+ * Default styles for picker
10
+ */
11
+ const defaultStyles = {
12
+ periodSelection: 'period',
13
+ previousPeriod: 'fas fa-angle-left clickable',
14
+ nextPeriod: 'fas fa-angle-right clickable',
15
+ periodValue: 'period-value',
16
+ periodData: 'period-data',
17
+ periodDatum: 'period-datum clickable',
18
+ weekdayName: 'weekday'
19
+ };
20
+ /**
21
+ * Component used for displaying day picker
22
+ */
23
+ export class DateTimeDayPickerComponent extends PickerBaseComponent {
24
+ //######################### constructor #########################
25
+ constructor(dateApi, changeDetector) {
26
+ super(dateApi, changeDetector);
27
+ //######################### protected fields #########################
28
+ /**
29
+ * Stored this picker month data
30
+ */
31
+ this._thisMonthData = [];
32
+ //######################### public properties - template bindings #########################
33
+ /**
34
+ * Names of days
35
+ * @internal
36
+ */
37
+ this.weekdays = [];
38
+ this.cssClasses = extend(true, {}, defaultStyles);
39
+ this.weekdays = this._dateApi.weekdaysShort();
40
+ }
41
+ //######################### public methods - template bindings #########################
42
+ /**
43
+ * Changes displayed month to next month
44
+ * @param event - Event that occured
45
+ * @internal
46
+ */
47
+ nextMonth(event) {
48
+ event.preventDefault();
49
+ this.displayDate.addMonths(1);
50
+ this.display(this.displayDate);
51
+ }
52
+ /**
53
+ * Changes displayed month to previous month
54
+ * @param event - Event that occured
55
+ * @internal
56
+ */
57
+ previousMonth(event) {
58
+ event.preventDefault();
59
+ this.displayDate.subtractMonths(1);
60
+ this.display(this.displayDate);
61
+ }
62
+ /**
63
+ * Selects day
64
+ * @param event - Event that occured
65
+ * @param day - Selects day
66
+ * @internal
67
+ */
68
+ select(event, day) {
69
+ event.preventDefault();
70
+ if (day.disabled) {
71
+ return;
72
+ }
73
+ //handle selection of value
74
+ if (!this.canGoDown) {
75
+ this._setPeriod(day);
76
+ this._value =
77
+ {
78
+ from: day.date,
79
+ to: this._endOfPeriod(day)
80
+ };
81
+ this._valueChange.next();
82
+ if (day.otherMonth) {
83
+ this.display(this._dateApi.getValue(day.date));
84
+ }
85
+ return;
86
+ }
87
+ this._scaleDown.next(day.date);
88
+ }
89
+ //######################### public methods - implementation of DateTimePicker #########################
90
+ /**
91
+ * Set displays date to be displayed
92
+ * @param value - Value that identifies period that is going to be displayed
93
+ */
94
+ display(value) {
95
+ this.displayDate = value;
96
+ this.periodData = [];
97
+ this._thisMonthData = [];
98
+ const currentMonthDate = this.displayDate.value;
99
+ const today = this._dateApi.now().value;
100
+ this.displayDate
101
+ .startOfMonth()
102
+ .updateOriginal()
103
+ .startOfWeek();
104
+ do {
105
+ for (let x = 0; x < 7; x++) {
106
+ const day = this.displayDate.dayOfMonth();
107
+ const otherMonth = !this.displayDate.isSameMonth(currentMonthDate);
108
+ const data = {
109
+ active: false,
110
+ disabled: false,
111
+ betweenActive: false,
112
+ date: this.displayDate.value,
113
+ otherMonth: otherMonth,
114
+ today: this.displayDate.isSameDay(today),
115
+ weekend: this.displayDate.isWeekend(),
116
+ day: day
117
+ };
118
+ this.periodData.push(data);
119
+ if (!otherMonth) {
120
+ this._thisMonthData.push(data);
121
+ }
122
+ this.displayDate.addDays(1);
123
+ }
124
+ } while (this.displayDate.isSameMonth(currentMonthDate));
125
+ this.displayDate.resetOriginal();
126
+ this._updateMinMax();
127
+ //set value if exists
128
+ if (this._value && (this.displayDate.isSameMonth(this._value.from) || this.displayDate.isSameMonth(this._value.to))) {
129
+ this.setValue(this._value);
130
+ }
131
+ }
132
+ //######################### protected methods #########################
133
+ /**
134
+ * Obtains end of period
135
+ * @param period - Period for which should be end obtained
136
+ */
137
+ _endOfPeriod(period) {
138
+ return this._dateApi.getValue(period.date).endOfDay().value;
139
+ }
140
+ /**
141
+ * Tests whether provided value is in same period as displayed picker
142
+ * @param val - Tested value for same period as displayed picker
143
+ */
144
+ _isSamePeriodAsDisplayed(val) {
145
+ return val.isSameMonth(this.displayDate.value);
146
+ }
147
+ /**
148
+ * Tests whether provided value is in same period target value
149
+ * @param val - Tested value
150
+ * @param target - Target value to be tested against
151
+ */
152
+ _isSamePeriod(val, target) {
153
+ return val.isSameDay(target);
154
+ }
155
+ /**
156
+ * Gets period data for specified value
157
+ * @param val - Value for which is period data obtained
158
+ */
159
+ _getPeriodData(val) {
160
+ return this._thisMonthData[val.dayOfMonth() - 1];
161
+ }
162
+ }
163
+ DateTimeDayPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DateTimeDayPickerComponent, deps: [{ token: DATE_API }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
164
+ DateTimeDayPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: DateTimeDayPickerComponent, selector: "date-time-day-picker", usesInheritance: true, ngImport: i0, template: "<div [ngClass]=\"cssClasses?.periodSelection | asRequiredType\">\r\n <div [ngClass]=\"cssClasses?.previousPeriod | asRequiredType\" (mousedown)=\"previousMonth($event)\"></div>\r\n <div [ngClass]=\"cssClasses?.periodValue | asRequiredType\" [class.clickable]=\"canGoUp\" (mousedown)=\"goUp($event)\">{{displayDate?.format('MMMM yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses?.nextPeriod | asRequiredType\" (mousedown)=\"nextMonth($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses?.periodData | asRequiredType\">\r\n <div [ngClass]=\"cssClasses?.weekdayName | asRequiredType\" *ngFor=\"let weekday of weekdays\">{{weekday}}</div>\r\n <div *ngFor=\"let day of periodData\"\r\n [ngClass]=\"cssClasses?.periodDatum | asRequiredType\"\r\n [class.other-month]=\"day.otherMonth\"\r\n [class.today]=\"day.today\"\r\n [class.weekend]=\"day.weekend\"\r\n [class.active]=\"day.active\"\r\n [class.disabled]=\"day.disabled\"\r\n (mousedown)=\"select($event, day)\">{{day.day}}</div>\r\n</div>", styles: [".period-data\r\n{\r\n grid-template-columns: repeat(7, 1fr);\r\n}\r\n\r\n.weekday\r\n{\r\n text-align: center;\r\n font-weight: bold;\r\n opacity: 0.7;\r\n margin-bottom: 6px;\r\n}\r\n\r\n.period-datum:not(.other-month)\r\n{\r\n font-weight: bold;\r\n}\r\n\r\n.other-month\r\n{\r\n opacity: 0.5;\r\n}"], directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "asRequiredType": i2.AsRequiredTypePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
165
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DateTimeDayPickerComponent, decorators: [{
166
+ type: Component,
167
+ args: [{ selector: 'date-time-day-picker', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [ngClass]=\"cssClasses?.periodSelection | asRequiredType\">\r\n <div [ngClass]=\"cssClasses?.previousPeriod | asRequiredType\" (mousedown)=\"previousMonth($event)\"></div>\r\n <div [ngClass]=\"cssClasses?.periodValue | asRequiredType\" [class.clickable]=\"canGoUp\" (mousedown)=\"goUp($event)\">{{displayDate?.format('MMMM yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses?.nextPeriod | asRequiredType\" (mousedown)=\"nextMonth($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses?.periodData | asRequiredType\">\r\n <div [ngClass]=\"cssClasses?.weekdayName | asRequiredType\" *ngFor=\"let weekday of weekdays\">{{weekday}}</div>\r\n <div *ngFor=\"let day of periodData\"\r\n [ngClass]=\"cssClasses?.periodDatum | asRequiredType\"\r\n [class.other-month]=\"day.otherMonth\"\r\n [class.today]=\"day.today\"\r\n [class.weekend]=\"day.weekend\"\r\n [class.active]=\"day.active\"\r\n [class.disabled]=\"day.disabled\"\r\n (mousedown)=\"select($event, day)\">{{day.day}}</div>\r\n</div>", styles: [".period-data\r\n{\r\n grid-template-columns: repeat(7, 1fr);\r\n}\r\n\r\n.weekday\r\n{\r\n text-align: center;\r\n font-weight: bold;\r\n opacity: 0.7;\r\n margin-bottom: 6px;\r\n}\r\n\r\n.period-datum:not(.other-month)\r\n{\r\n font-weight: bold;\r\n}\r\n\r\n.other-month\r\n{\r\n opacity: 0.5;\r\n}"] }]
168
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
169
+ type: Inject,
170
+ args: [DATE_API]
171
+ }] }, { type: i0.ChangeDetectorRef }]; } });
172
+ //# sourceMappingURL=dayPicker.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dayPicker.component.js","sourceRoot":"","sources":["../../../../../src/picker/components/dayPicker/dayPicker.component.ts","../../../../../src/picker/components/dayPicker/dayPicker.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,MAAM,EAAE,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAEtC,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAG9C,OAAO,EAAC,mBAAmB,EAAC,MAAM,yBAAyB,CAAC;;;;AAG5D;;GAEG;AACH,MAAM,aAAa,GACnB;IACI,eAAe,EAAE,QAAQ;IACzB,cAAc,EAAE,6BAA6B;IAC7C,UAAU,EAAE,8BAA8B;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AE5D,OAAO,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;IAED;;;OAGG;IACO,cAAc,CAAC,GAAyB;QAE9C,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC;IACrD,CAAC;;uHA9LQ,0BAA0B,kBAkBf,QAAQ;2GAlBnB,0BAA0B,mFCjCvC,yiCAgBM;2FDiBO,0BAA0B;kBAPtC,SAAS;+BAEI,sBAAsB,mBAGf,uBAAuB,CAAC,MAAM;;0BAoBlC,MAAM;2BAAC,QAAQ","sourcesContent":["import {Component, ChangeDetectionStrategy, Inject, ChangeDetectorRef} from '@angular/core';\nimport {extend} from '@jscrpt/common';\n\nimport {DATE_API} from '../../../misc/tokens';\nimport {DateApi, DateApiObject} from '../../../services/dateApi.interface';\nimport {DateTimePicker, DayData, PeriodData} from '../../misc/datetimePicker.interface';\nimport {PickerBaseComponent} from '../pickerBase.component';\nimport {DayPickerCssClasses} from './dayPicker.interfaces';\n\n/**\n * Default styles for picker\n */\nconst defaultStyles: DayPickerCssClasses =\n{\n periodSelection: 'period',\n previousPeriod: 'fas fa-angle-left clickable',\n nextPeriod: 'fas fa-angle-right clickable',\n periodValue: 'period-value',\n periodData: 'period-data',\n periodDatum: 'period-datum clickable',\n weekdayName: 'weekday'\n};\n\n/**\n * Component used for displaying day picker\n */\n@Component(\n{\n selector: 'date-time-day-picker',\n templateUrl: 'dayPicker.component.html',\n styleUrls: ['dayPicker.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DateTimeDayPickerComponent<TDate = any> extends PickerBaseComponent<TDate, DayData<TDate>, DayPickerCssClasses> implements DateTimePicker<TDate, DayPickerCssClasses>\n{\n //######################### protected fields #########################\n\n /**\n * Stored this picker month data\n */\n protected _thisMonthData: DayData<TDate>[] = [];\n\n //######################### public properties - template bindings #########################\n\n /**\n * Names of days\n * @internal\n */\n public weekdays: string[] = [];\n\n //######################### constructor #########################\n constructor(@Inject(DATE_API) dateApi: DateApi<TDate>,\n changeDetector: ChangeDetectorRef)\n {\n super(dateApi, changeDetector);\n\n this.cssClasses = extend(true, {}, defaultStyles);\n this.weekdays = this._dateApi.weekdaysShort();\n }\n\n //######################### public methods - template bindings #########################\n\n /**\n * Changes displayed month to next month\n * @param event - Event that occured\n * @internal\n */\n public nextMonth(event: Event)\n {\n event.preventDefault();\n this.displayDate!.addMonths(1);\n\n this.display(this.displayDate!);\n }\n\n /**\n * Changes displayed month to previous month\n * @param event - Event that occured\n * @internal\n */\n public previousMonth(event: Event)\n {\n event.preventDefault();\n this.displayDate!.subtractMonths(1);\n\n this.display(this.displayDate!);\n }\n\n /**\n * Selects day\n * @param event - Event that occured\n * @param day - Selects day \n * @internal\n */\n public override select(event: Event, day: DayData<TDate>)\n {\n event.preventDefault();\n\n if(day.disabled)\n {\n return;\n }\n\n //handle selection of value\n if(!this.canGoDown)\n {\n this._setPeriod(day);\n\n this._value =\n {\n from: day.date,\n to: this._endOfPeriod(day)\n };\n \n this._valueChange.next();\n\n if(day.otherMonth)\n {\n this.display(this._dateApi.getValue(day.date));\n }\n\n return;\n }\n\n this._scaleDown.next(day.date);\n }\n\n //######################### public methods - implementation of DateTimePicker #########################\n\n /**\n * Set displays date to be displayed\n * @param value - Value that identifies period that is going to be displayed\n */\n public display(value: DateApiObject<TDate>): void\n {\n this.displayDate = value;\n this.periodData = [];\n this._thisMonthData = [];\n const currentMonthDate = this.displayDate.value;\n const today = this._dateApi.now().value;\n\n this.displayDate\n .startOfMonth()\n .updateOriginal()\n .startOfWeek();\n\n do\n {\n for(let x = 0; x < 7; x++)\n {\n const day = this.displayDate.dayOfMonth();\n const otherMonth = !this.displayDate.isSameMonth(currentMonthDate);\n const data = \n {\n active: false,\n disabled: false,\n betweenActive: false,\n date: this.displayDate.value,\n otherMonth: otherMonth,\n today: this.displayDate.isSameDay(today),\n weekend: this.displayDate.isWeekend(),\n day: day\n };\n\n this.periodData.push(data);\n\n if(!otherMonth)\n {\n this._thisMonthData.push(data);\n }\n\n this.displayDate.addDays(1);\n }\n }\n while(this.displayDate.isSameMonth(currentMonthDate));\n\n this.displayDate.resetOriginal();\n this._updateMinMax();\n\n //set value if exists\n if(this._value && (this.displayDate.isSameMonth(this._value.from) || this.displayDate.isSameMonth(this._value.to)))\n {\n this.setValue(this._value);\n }\n }\n\n //######################### protected methods #########################\n\n /**\n * Obtains end of period\n * @param period - Period for which should be end obtained\n */\n protected _endOfPeriod(period: PeriodData<TDate>): TDate\n {\n return this._dateApi.getValue(period.date).endOfDay().value;\n }\n\n /**\n * Tests whether provided value is in same period as displayed picker\n * @param val - Tested value for same period as displayed picker\n */\n protected _isSamePeriodAsDisplayed(val: DateApiObject<TDate>): boolean\n {\n return val.isSameMonth(this.displayDate!.value);\n }\n\n /**\n * Tests whether provided value is in same period target value\n * @param val - Tested value\n * @param target - Target value to be tested against\n */\n protected _isSamePeriod(val: DateApiObject<TDate>, target: TDate): boolean\n {\n return val.isSameDay(target);\n }\n\n /**\n * Gets period data for specified value\n * @param val - Value for which is period data obtained\n */\n protected _getPeriodData(val: DateApiObject<TDate>): PeriodData<TDate>\n {\n return this._thisMonthData[val.dayOfMonth() - 1];\n }\n}","<div [ngClass]=\"cssClasses?.periodSelection | asRequiredType\">\r\n <div [ngClass]=\"cssClasses?.previousPeriod | asRequiredType\" (mousedown)=\"previousMonth($event)\"></div>\r\n <div [ngClass]=\"cssClasses?.periodValue | asRequiredType\" [class.clickable]=\"canGoUp\" (mousedown)=\"goUp($event)\">{{displayDate?.format('MMMM yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses?.nextPeriod | asRequiredType\" (mousedown)=\"nextMonth($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses?.periodData | asRequiredType\">\r\n <div [ngClass]=\"cssClasses?.weekdayName | asRequiredType\" *ngFor=\"let weekday of weekdays\">{{weekday}}</div>\r\n <div *ngFor=\"let day of periodData\"\r\n [ngClass]=\"cssClasses?.periodDatum | asRequiredType\"\r\n [class.other-month]=\"day.otherMonth\"\r\n [class.today]=\"day.today\"\r\n [class.weekend]=\"day.weekend\"\r\n [class.active]=\"day.active\"\r\n [class.disabled]=\"day.disabled\"\r\n (mousedown)=\"select($event, day)\">{{day.day}}</div>\r\n</div>"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=dayPicker.interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dayPicker.interfaces.js","sourceRoot":"","sources":["../../../../../src/picker/components/dayPicker/dayPicker.interfaces.ts"],"names":[],"mappings":"","sourcesContent":["import {CommonPickerCssClasses} from '../../misc/datetimePicker.interface';\n\n/**\n * Specific css classes for day picker\n */\nexport interface DayPickerCssClasses extends CommonPickerCssClasses\n{\n /**\n * Element displaying weekday name\n */\n weekdayName?: string;\n}"]}
@@ -0,0 +1,114 @@
1
+ import { Component, ChangeDetectionStrategy, Inject, ChangeDetectorRef } from '@angular/core';
2
+ import { extend } from '@jscrpt/common';
3
+ import { DATE_API } from '../../../misc/tokens';
4
+ import { PickerBaseComponent } from '../pickerBase.component';
5
+ import * as i0 from "@angular/core";
6
+ import * as i1 from "@angular/common";
7
+ import * as i2 from "../../../pipes/asRequiredType";
8
+ /**
9
+ * Default styles for picker
10
+ */
11
+ const defaultStyles = {
12
+ periodSelection: 'period',
13
+ previousPeriod: 'fas fa-angle-left clickable',
14
+ nextPeriod: 'fas fa-angle-right clickable',
15
+ periodValue: 'period-value',
16
+ periodData: 'period-data',
17
+ periodDatum: 'period-datum clickable'
18
+ };
19
+ /**
20
+ * Component used for displaying month picker
21
+ */
22
+ export class DateTimeMonthPickerComponent extends PickerBaseComponent {
23
+ //######################### constructor #########################
24
+ constructor(dateApi, changeDetector) {
25
+ super(dateApi, changeDetector);
26
+ this.cssClasses = extend(true, {}, defaultStyles);
27
+ }
28
+ //######################### public methods - template bindings #########################
29
+ /**
30
+ * Changes displayed year to next year
31
+ * @param event - Event that occured
32
+ * @internal
33
+ */
34
+ nextYear(event) {
35
+ event.preventDefault();
36
+ this.displayDate.addYears(1);
37
+ this.display(this.displayDate);
38
+ }
39
+ /**
40
+ * Changes displayed year to previous year
41
+ * @param event - Event that occured
42
+ * @internal
43
+ */
44
+ previousYear(event) {
45
+ event.preventDefault();
46
+ this.displayDate.subtractYears(1);
47
+ this.display(this.displayDate);
48
+ }
49
+ //######################### public methods - implementation of DateTimePicker #########################
50
+ /**
51
+ * Set displays date to be displayed
52
+ * @param value - Value that identifies period that is going to be displayed
53
+ */
54
+ display(value) {
55
+ this.displayDate = value;
56
+ const monthOfYear = this.displayDate.startOfYear().updateOriginal();
57
+ this.periodData = [];
58
+ for (let x = 0; x < 12; x++) {
59
+ this.periodData.push({
60
+ active: false,
61
+ disabled: false,
62
+ date: monthOfYear.value,
63
+ name: monthOfYear.format('MMM')
64
+ });
65
+ monthOfYear.addMonths(1);
66
+ }
67
+ this.displayDate.resetOriginal();
68
+ this._updateMinMax();
69
+ //set value if exists
70
+ if (this._value && (this.displayDate.isSameYear(this._value.from) || this.displayDate.isSameYear(this._value.to))) {
71
+ this.setValue(this._value);
72
+ }
73
+ }
74
+ //######################### protected methods #########################
75
+ /**
76
+ * Obtains end of period
77
+ * @param period - Period for which should be end obtained
78
+ */
79
+ _endOfPeriod(period) {
80
+ return this._dateApi.getValue(period.date).endOfMonth().value;
81
+ }
82
+ /**
83
+ * Tests whether provided value is in same period as displayed picker
84
+ * @param val - Tested value for same period as displayed picker
85
+ */
86
+ _isSamePeriodAsDisplayed(val) {
87
+ return val.isSameYear(this.displayDate.value);
88
+ }
89
+ /**
90
+ * Tests whether provided value is in same period target value
91
+ * @param val - Tested value
92
+ * @param target - Target value to be tested against
93
+ */
94
+ _isSamePeriod(val, target) {
95
+ return val.isSameMonth(target);
96
+ }
97
+ /**
98
+ * Gets period data for specified value
99
+ * @param val - Value for which is period data obtained
100
+ */
101
+ _getPeriodData(val) {
102
+ return this.periodData[val.month()];
103
+ }
104
+ }
105
+ DateTimeMonthPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DateTimeMonthPickerComponent, deps: [{ token: DATE_API }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
106
+ DateTimeMonthPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: DateTimeMonthPickerComponent, selector: "date-time-month-picker", usesInheritance: true, ngImport: i0, template: "<div [ngClass]=\"cssClasses?.periodSelection | asRequiredType\">\r\n <div [ngClass]=\"cssClasses?.previousPeriod | asRequiredType\" (mousedown)=\"previousYear($event)\"></div>\r\n <div [ngClass]=\"cssClasses?.periodValue | asRequiredType\" [class.clickable]=\"canGoUp\" (mousedown)=\"goUp($event)\">{{displayDate?.format('yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses?.nextPeriod | asRequiredType\" (mousedown)=\"nextYear($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses?.periodData | asRequiredType\">\r\n <div *ngFor=\"let month of periodData\"\r\n [ngClass]=\"cssClasses?.periodDatum | asRequiredType\"\r\n [class.active]=\"month.active\"\r\n [class.disabled]=\"month.disabled\"\r\n (mousedown)=\"select($event, month)\">{{month.name}}</div>\r\n</div>", styles: [".period-data\r\n{\r\n grid-template-columns: repeat(4, 1fr);\r\n}"], directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "asRequiredType": i2.AsRequiredTypePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
107
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DateTimeMonthPickerComponent, decorators: [{
108
+ type: Component,
109
+ args: [{ selector: 'date-time-month-picker', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [ngClass]=\"cssClasses?.periodSelection | asRequiredType\">\r\n <div [ngClass]=\"cssClasses?.previousPeriod | asRequiredType\" (mousedown)=\"previousYear($event)\"></div>\r\n <div [ngClass]=\"cssClasses?.periodValue | asRequiredType\" [class.clickable]=\"canGoUp\" (mousedown)=\"goUp($event)\">{{displayDate?.format('yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses?.nextPeriod | asRequiredType\" (mousedown)=\"nextYear($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses?.periodData | asRequiredType\">\r\n <div *ngFor=\"let month of periodData\"\r\n [ngClass]=\"cssClasses?.periodDatum | asRequiredType\"\r\n [class.active]=\"month.active\"\r\n [class.disabled]=\"month.disabled\"\r\n (mousedown)=\"select($event, month)\">{{month.name}}</div>\r\n</div>", styles: [".period-data\r\n{\r\n grid-template-columns: repeat(4, 1fr);\r\n}"] }]
110
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
111
+ type: Inject,
112
+ args: [DATE_API]
113
+ }] }, { type: i0.ChangeDetectorRef }]; } });
114
+ //# sourceMappingURL=monthPicker.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"monthPicker.component.js","sourceRoot":"","sources":["../../../../../src/picker/components/monthPicker/monthPicker.component.ts","../../../../../src/picker/components/monthPicker/monthPicker.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,MAAM,EAAE,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAEtC,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAG9C,OAAO,EAAC,mBAAmB,EAAC,MAAM,yBAAyB,CAAC;;;;AAG5D;;GAEG;AACH,MAAM,aAAa,GACnB;IACI,eAAe,EAAE,QAAQ;IACzB,cAAc,EAAE,6BAA6B;IAC7C,UAAU,EAAE,8BAA8B;IAC1C,WAAW,EAAE,cAAc;IAC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ular/core';\nimport {extend} from '@jscrpt/common';\n\nimport {DATE_API} from '../../../misc/tokens';\nimport {DateApi, DateApiObject} from '../../../services/dateApi.interface';\nimport {DateTimePicker, MonthData, PeriodData} from '../../misc/datetimePicker.interface';\nimport {PickerBaseComponent} from '../pickerBase.component';\nimport {MonthPickerCssClasses} from './monthPicker.interfaces';\n\n/**\n * Default styles for picker\n */\nconst defaultStyles: MonthPickerCssClasses =\n{\n periodSelection: 'period',\n previousPeriod: 'fas fa-angle-left clickable',\n nextPeriod: 'fas fa-angle-right clickable',\n periodValue: 'period-value',\n periodData: 'period-data',\n periodDatum: 'period-datum clickable'\n};\n\n/**\n * Component used for displaying month picker\n */\n@Component(\n{\n selector: 'date-time-month-picker',\n templateUrl: 'monthPicker.component.html',\n styleUrls: ['monthPicker.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DateTimeMonthPickerComponent<TDate = any> extends PickerBaseComponent<TDate, MonthData<TDate>, MonthPickerCssClasses> implements DateTimePicker<TDate, MonthPickerCssClasses>\n{\n //######################### constructor #########################\n constructor(@Inject(DATE_API) dateApi: DateApi<TDate>,\n changeDetector: ChangeDetectorRef)\n {\n super(dateApi, changeDetector);\n\n this.cssClasses = extend(true, {}, defaultStyles);\n }\n\n //######################### public methods - template bindings #########################\n\n /**\n * Changes displayed year to next year\n * @param event - Event that occured\n * @internal\n */\n public nextYear(event: Event)\n {\n event.preventDefault();\n this.displayDate!.addYears(1);\n\n this.display(this.displayDate!);\n }\n\n /**\n * Changes displayed year to previous year\n * @param event - Event that occured\n * @internal\n */\n public previousYear(event: Event)\n {\n event.preventDefault();\n this.displayDate!.subtractYears(1);\n\n this.display(this.displayDate!);\n }\n\n //######################### public methods - implementation of DateTimePicker #########################\n\n /**\n * Set displays date to be displayed\n * @param value - Value that identifies period that is going to be displayed\n */\n public display(value: DateApiObject<TDate>): void\n {\n this.displayDate = value;\n\n const monthOfYear = this.displayDate.startOfYear().updateOriginal();\n this.periodData = [];\n\n for(let x = 0; x < 12; x++)\n {\n this.periodData.push(\n {\n active: false,\n disabled: false,\n date: monthOfYear.value,\n name: monthOfYear.format('MMM')\n });\n\n monthOfYear.addMonths(1);\n }\n\n this.displayDate.resetOriginal();\n this._updateMinMax();\n\n //set value if exists\n if(this._value && (this.displayDate.isSameYear(this._value.from) || this.displayDate.isSameYear(this._value.to)))\n {\n this.setValue(this._value);\n }\n }\n\n //######################### protected methods #########################\n\n /**\n * Obtains end of period\n * @param period - Period for which should be end obtained\n */\n protected _endOfPeriod(period: PeriodData<TDate>): TDate\n {\n return this._dateApi.getValue(period.date).endOfMonth().value;\n }\n\n /**\n * Tests whether provided value is in same period as displayed picker\n * @param val - Tested value for same period as displayed picker\n */\n protected _isSamePeriodAsDisplayed(val: DateApiObject<TDate>): boolean\n {\n return val.isSameYear(this.displayDate!.value);\n }\n\n /**\n * Tests whether provided value is in same period target value\n * @param val - Tested value\n * @param target - Target value to be tested against\n */\n protected _isSamePeriod(val: DateApiObject<TDate>, target: TDate): boolean\n {\n return val.isSameMonth(target);\n }\n\n /**\n * Gets period data for specified value\n * @param val - Value for which is period data obtained\n */\n protected _getPeriodData(val: DateApiObject<TDate>): PeriodData<TDate>\n {\n return this.periodData[val.month()];\n }\n}","<div [ngClass]=\"cssClasses?.periodSelection | asRequiredType\">\r\n <div [ngClass]=\"cssClasses?.previousPeriod | asRequiredType\" (mousedown)=\"previousYear($event)\"></div>\r\n <div [ngClass]=\"cssClasses?.periodValue | asRequiredType\" [class.clickable]=\"canGoUp\" (mousedown)=\"goUp($event)\">{{displayDate?.format('yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses?.nextPeriod | asRequiredType\" (mousedown)=\"nextYear($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses?.periodData | asRequiredType\">\r\n <div *ngFor=\"let month of periodData\"\r\n [ngClass]=\"cssClasses?.periodDatum | asRequiredType\"\r\n [class.active]=\"month.active\"\r\n [class.disabled]=\"month.disabled\"\r\n (mousedown)=\"select($event, month)\">{{month.name}}</div>\r\n</div>"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=monthPicker.interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"monthPicker.interfaces.js","sourceRoot":"","sources":["../../../../../src/picker/components/monthPicker/monthPicker.interfaces.ts"],"names":[],"mappings":"","sourcesContent":["import {CommonPickerCssClasses} from '../../misc/datetimePicker.interface';\n\n/**\n * Specific css classes for month picker\n */\nexport interface MonthPickerCssClasses extends CommonPickerCssClasses\n{\n}"]}