@anglr/datetime 1.0.0-beta.20210804101324 → 2.0.0-beta.20220221120606

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 (463) hide show
  1. package/changelog.md +13 -1
  2. package/date-fns/datetime-date-fns.d.ts +64 -0
  3. package/date-fns/datetime-date-fns.internal.d.ts +64 -0
  4. package/date-fns/package.json +7 -7
  5. package/date-fns/src/{date-fns.d.ts → index.d.ts} +4 -4
  6. package/date-fns/src/index.d.ts.map +1 -0
  7. package/date-fns/src/misc/tokens.d.ts +10 -10
  8. package/date-fns/src/services/dateFnsDateApi.service.d.ts +36 -33
  9. package/date-fns/src/services/dateFnsDateApi.service.d.ts.map +1 -1
  10. package/date-fns/src/services/dateFnsLocale.service.d.ts +10 -10
  11. package/date-fns/temp/datetime-date-fns.api.md +47 -0
  12. package/datetime.d.ts +1913 -5
  13. package/datetime.internal.d.ts +2090 -0
  14. package/es2015/date-fns/src/index.js +4 -0
  15. package/es2015/date-fns/src/index.js.map +1 -0
  16. package/es2015/date-fns/src/misc/tokens.js +20 -0
  17. package/es2015/date-fns/src/misc/tokens.js.map +1 -0
  18. package/es2015/date-fns/src/services/dateFnsDateApi.service.js +438 -0
  19. package/es2015/date-fns/src/services/dateFnsDateApi.service.js.map +1 -0
  20. package/es2015/date-fns/src/services/dateFnsLocale.service.js +2 -0
  21. package/es2015/date-fns/src/services/dateFnsLocale.service.js.map +1 -0
  22. package/es2015/karma.conf.js +57 -0
  23. package/es2015/karma.conf.js.map +1 -0
  24. package/{moment/src/moment.d.ts → es2015/moment/src/index.js} +3 -3
  25. package/es2015/moment/src/index.js.map +1 -0
  26. package/es2015/moment/src/misc/tokens.js +15 -0
  27. package/es2015/moment/src/misc/tokens.js.map +1 -0
  28. package/es2015/moment/src/services/momentDateApi.service.js +398 -0
  29. package/es2015/moment/src/services/momentDateApi.service.js.map +1 -0
  30. package/{src/datetime.d.ts → es2015/src/index.js} +19 -19
  31. package/es2015/src/index.js.map +1 -0
  32. package/es2015/src/misc/constants.js +33 -0
  33. package/es2015/src/misc/constants.js.map +1 -0
  34. package/es2015/src/misc/datetime.interface.js +2 -0
  35. package/es2015/src/misc/datetime.interface.js.map +1 -0
  36. package/es2015/src/misc/tokens.js +19 -0
  37. package/es2015/src/misc/tokens.js.map +1 -0
  38. package/es2015/src/misc/validators.js +58 -0
  39. package/es2015/src/misc/validators.js.map +1 -0
  40. package/es2015/src/modules/datePipes.module.js +33 -0
  41. package/es2015/src/modules/datePipes.module.js.map +1 -0
  42. package/es2015/src/picker/components/dayPicker/dayPicker.component.js +172 -0
  43. package/es2015/src/picker/components/dayPicker/dayPicker.component.js.map +1 -0
  44. package/es2015/src/picker/components/dayPicker/dayPicker.interfaces.js +2 -0
  45. package/es2015/src/picker/components/dayPicker/dayPicker.interfaces.js.map +1 -0
  46. package/es2015/src/picker/components/monthPicker/monthPicker.component.js +114 -0
  47. package/es2015/src/picker/components/monthPicker/monthPicker.component.js.map +1 -0
  48. package/es2015/src/picker/components/monthPicker/monthPicker.interfaces.js +2 -0
  49. package/es2015/src/picker/components/monthPicker/monthPicker.interfaces.js.map +1 -0
  50. package/es2015/src/picker/components/picker/picker.component.animations.js +71 -0
  51. package/es2015/src/picker/components/picker/picker.component.animations.js.map +1 -0
  52. package/es2015/src/picker/components/picker/picker.component.js +241 -0
  53. package/es2015/src/picker/components/picker/picker.component.js.map +1 -0
  54. package/es2015/src/picker/components/pickerBase.component.js +243 -0
  55. package/es2015/src/picker/components/pickerBase.component.js.map +1 -0
  56. package/es2015/src/picker/components/yearPicker/yearPicker.component.js +126 -0
  57. package/es2015/src/picker/components/yearPicker/yearPicker.component.js.map +1 -0
  58. package/es2015/src/picker/components/yearPicker/yearPicker.interfaces.js +2 -0
  59. package/es2015/src/picker/components/yearPicker/yearPicker.interfaces.js.map +1 -0
  60. package/es2015/src/picker/interfaces.js +5 -0
  61. package/es2015/src/picker/interfaces.js.map +1 -0
  62. package/es2015/src/picker/misc/datetimePicker.interface.js +2 -0
  63. package/es2015/src/picker/misc/datetimePicker.interface.js.map +1 -0
  64. package/es2015/src/picker/misc/tokens.js +6 -0
  65. package/es2015/src/picker/misc/tokens.js.map +1 -0
  66. package/es2015/src/picker/modules/picker.module.js +46 -0
  67. package/es2015/src/picker/modules/picker.module.js.map +1 -0
  68. package/es2015/src/picker/types.js +8 -0
  69. package/es2015/src/picker/types.js.map +1 -0
  70. package/es2015/src/pipes/asRequiredType.js +22 -0
  71. package/es2015/src/pipes/asRequiredType.js.map +1 -0
  72. package/es2015/src/pipes/dateConvert.pipe.js +35 -0
  73. package/es2015/src/pipes/dateConvert.pipe.js.map +1 -0
  74. package/es2015/src/pipes/dateFormat.pipe.js +45 -0
  75. package/es2015/src/pipes/dateFormat.pipe.js.map +1 -0
  76. package/es2015/src/selector/components/inputDateTime/inputDateTime.component.js +421 -0
  77. package/es2015/src/selector/components/inputDateTime/inputDateTime.component.js.map +1 -0
  78. package/es2015/src/selector/components/selector/selector.component.animations.js +15 -0
  79. package/es2015/src/selector/components/selector/selector.component.animations.js.map +1 -0
  80. package/es2015/src/selector/components/selector/selector.component.js +344 -0
  81. package/es2015/src/selector/components/selector/selector.component.js.map +1 -0
  82. package/es2015/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js +317 -0
  83. package/es2015/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js.map +1 -0
  84. package/es2015/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.js +51 -0
  85. package/es2015/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.js.map +1 -0
  86. package/es2015/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.js +51 -0
  87. package/es2015/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.js.map +1 -0
  88. package/es2015/src/selector/directives/datetimeValidator/datetimeValidator.directive.js +47 -0
  89. package/es2015/src/selector/directives/datetimeValidator/datetimeValidator.directive.js.map +1 -0
  90. package/es2015/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.js +119 -0
  91. package/es2015/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.js.map +1 -0
  92. package/es2015/src/selector/interfaces.js +2 -0
  93. package/es2015/src/selector/interfaces.js.map +1 -0
  94. package/es2015/src/selector/misc/datetimeSelector.interface.js +2 -0
  95. package/es2015/src/selector/misc/datetimeSelector.interface.js.map +1 -0
  96. package/es2015/src/selector/misc/tokens.js +6 -0
  97. package/es2015/src/selector/misc/tokens.js.map +1 -0
  98. package/es2015/src/selector/modules/basicSelector.module.js +20 -0
  99. package/es2015/src/selector/modules/basicSelector.module.js.map +1 -0
  100. package/es2015/src/selector/modules/selector.module.js +60 -0
  101. package/es2015/src/selector/modules/selector.module.js.map +1 -0
  102. package/es2015/src/selector/types.js +10 -0
  103. package/es2015/src/selector/types.js.map +1 -0
  104. package/es2015/src/services/dateApi.interface.js +2 -0
  105. package/es2015/src/services/dateApi.interface.js.map +1 -0
  106. package/es2015/src/services/datePositionParser.interface.js +2 -0
  107. package/es2015/src/services/datePositionParser.interface.js.map +1 -0
  108. package/es2015/src/services/datePositionParser.service.js +227 -0
  109. package/es2015/src/services/datePositionParser.service.js.map +1 -0
  110. package/es2015/src/services/dateTimeRelativeParser.service.js +66 -0
  111. package/es2015/src/services/dateTimeRelativeParser.service.js.map +1 -0
  112. package/es2015/src/services/dateValueProvider.service.js +58 -0
  113. package/es2015/src/services/dateValueProvider.service.js.map +1 -0
  114. package/es2015/src/services/formatProvider.interface.js +2 -0
  115. package/es2015/src/services/formatProvider.interface.js.map +1 -0
  116. package/es2015/src/services/index.js +4 -0
  117. package/es2015/src/services/index.js.map +1 -0
  118. package/es2020/date-fns/src/index.js +4 -0
  119. package/es2020/date-fns/src/index.js.map +1 -0
  120. package/es2020/date-fns/src/misc/tokens.js +20 -0
  121. package/es2020/date-fns/src/misc/tokens.js.map +1 -0
  122. package/es2020/date-fns/src/services/dateFnsDateApi.service.js +437 -0
  123. package/es2020/date-fns/src/services/dateFnsDateApi.service.js.map +1 -0
  124. package/es2020/date-fns/src/services/dateFnsLocale.service.js +2 -0
  125. package/es2020/date-fns/src/services/dateFnsLocale.service.js.map +1 -0
  126. package/es2020/karma.conf.js +57 -0
  127. package/es2020/karma.conf.js.map +1 -0
  128. package/es2020/moment/src/index.js +3 -0
  129. package/es2020/moment/src/index.js.map +1 -0
  130. package/es2020/moment/src/misc/tokens.js +15 -0
  131. package/es2020/moment/src/misc/tokens.js.map +1 -0
  132. package/es2020/moment/src/services/momentDateApi.service.js +398 -0
  133. package/es2020/moment/src/services/momentDateApi.service.js.map +1 -0
  134. package/es2020/src/index.js +19 -0
  135. package/es2020/src/index.js.map +1 -0
  136. package/es2020/src/misc/constants.js +33 -0
  137. package/es2020/src/misc/constants.js.map +1 -0
  138. package/es2020/src/misc/datetime.interface.js +2 -0
  139. package/es2020/src/misc/datetime.interface.js.map +1 -0
  140. package/es2020/src/misc/tokens.js +19 -0
  141. package/es2020/src/misc/tokens.js.map +1 -0
  142. package/es2020/src/misc/validators.js +58 -0
  143. package/es2020/src/misc/validators.js.map +1 -0
  144. package/es2020/src/modules/datePipes.module.js +33 -0
  145. package/es2020/src/modules/datePipes.module.js.map +1 -0
  146. package/es2020/src/picker/components/dayPicker/dayPicker.component.js +172 -0
  147. package/es2020/src/picker/components/dayPicker/dayPicker.component.js.map +1 -0
  148. package/es2020/src/picker/components/dayPicker/dayPicker.interfaces.js +2 -0
  149. package/es2020/src/picker/components/dayPicker/dayPicker.interfaces.js.map +1 -0
  150. package/es2020/src/picker/components/monthPicker/monthPicker.component.js +114 -0
  151. package/es2020/src/picker/components/monthPicker/monthPicker.component.js.map +1 -0
  152. package/es2020/src/picker/components/monthPicker/monthPicker.interfaces.js +2 -0
  153. package/es2020/src/picker/components/monthPicker/monthPicker.interfaces.js.map +1 -0
  154. package/es2020/src/picker/components/picker/picker.component.animations.js +71 -0
  155. package/es2020/src/picker/components/picker/picker.component.animations.js.map +1 -0
  156. package/es2020/src/picker/components/picker/picker.component.js +236 -0
  157. package/es2020/src/picker/components/picker/picker.component.js.map +1 -0
  158. package/es2020/src/picker/components/pickerBase.component.js +243 -0
  159. package/es2020/src/picker/components/pickerBase.component.js.map +1 -0
  160. package/es2020/src/picker/components/yearPicker/yearPicker.component.js +126 -0
  161. package/es2020/src/picker/components/yearPicker/yearPicker.component.js.map +1 -0
  162. package/es2020/src/picker/components/yearPicker/yearPicker.interfaces.js +2 -0
  163. package/es2020/src/picker/components/yearPicker/yearPicker.interfaces.js.map +1 -0
  164. package/es2020/src/picker/interfaces.js +5 -0
  165. package/es2020/src/picker/interfaces.js.map +1 -0
  166. package/es2020/src/picker/misc/datetimePicker.interface.js +2 -0
  167. package/es2020/src/picker/misc/datetimePicker.interface.js.map +1 -0
  168. package/es2020/src/picker/misc/tokens.js +6 -0
  169. package/es2020/src/picker/misc/tokens.js.map +1 -0
  170. package/es2020/src/picker/modules/picker.module.js +46 -0
  171. package/es2020/src/picker/modules/picker.module.js.map +1 -0
  172. package/es2020/src/picker/types.js +8 -0
  173. package/es2020/src/picker/types.js.map +1 -0
  174. package/es2020/src/pipes/asRequiredType.js +22 -0
  175. package/es2020/src/pipes/asRequiredType.js.map +1 -0
  176. package/es2020/src/pipes/dateConvert.pipe.js +35 -0
  177. package/es2020/src/pipes/dateConvert.pipe.js.map +1 -0
  178. package/es2020/src/pipes/dateFormat.pipe.js +45 -0
  179. package/es2020/src/pipes/dateFormat.pipe.js.map +1 -0
  180. package/es2020/src/selector/components/inputDateTime/inputDateTime.component.js +417 -0
  181. package/es2020/src/selector/components/inputDateTime/inputDateTime.component.js.map +1 -0
  182. package/es2020/src/selector/components/selector/selector.component.animations.js +15 -0
  183. package/es2020/src/selector/components/selector/selector.component.animations.js.map +1 -0
  184. package/es2020/src/selector/components/selector/selector.component.js +334 -0
  185. package/es2020/src/selector/components/selector/selector.component.js.map +1 -0
  186. package/es2020/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js +314 -0
  187. package/es2020/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js.map +1 -0
  188. package/es2020/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.js +51 -0
  189. package/es2020/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.js.map +1 -0
  190. package/es2020/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.js +51 -0
  191. package/es2020/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.js.map +1 -0
  192. package/es2020/src/selector/directives/datetimeValidator/datetimeValidator.directive.js +47 -0
  193. package/es2020/src/selector/directives/datetimeValidator/datetimeValidator.directive.js.map +1 -0
  194. package/es2020/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.js +118 -0
  195. package/es2020/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.js.map +1 -0
  196. package/es2020/src/selector/interfaces.js +2 -0
  197. package/es2020/src/selector/interfaces.js.map +1 -0
  198. package/es2020/src/selector/misc/datetimeSelector.interface.js +2 -0
  199. package/es2020/src/selector/misc/datetimeSelector.interface.js.map +1 -0
  200. package/es2020/src/selector/misc/tokens.js +6 -0
  201. package/es2020/src/selector/misc/tokens.js.map +1 -0
  202. package/es2020/src/selector/modules/basicSelector.module.js +20 -0
  203. package/es2020/src/selector/modules/basicSelector.module.js.map +1 -0
  204. package/es2020/src/selector/modules/selector.module.js +60 -0
  205. package/es2020/src/selector/modules/selector.module.js.map +1 -0
  206. package/es2020/src/selector/types.js +10 -0
  207. package/es2020/src/selector/types.js.map +1 -0
  208. package/es2020/src/services/dateApi.interface.js +2 -0
  209. package/es2020/src/services/dateApi.interface.js.map +1 -0
  210. package/es2020/src/services/datePositionParser.interface.js +2 -0
  211. package/es2020/src/services/datePositionParser.interface.js.map +1 -0
  212. package/es2020/src/services/datePositionParser.service.js +227 -0
  213. package/es2020/src/services/datePositionParser.service.js.map +1 -0
  214. package/es2020/src/services/dateTimeRelativeParser.service.js +65 -0
  215. package/es2020/src/services/dateTimeRelativeParser.service.js.map +1 -0
  216. package/es2020/src/services/dateValueProvider.service.js +58 -0
  217. package/es2020/src/services/dateValueProvider.service.js.map +1 -0
  218. package/es2020/src/services/formatProvider.interface.js +2 -0
  219. package/es2020/src/services/formatProvider.interface.js.map +1 -0
  220. package/es2020/src/services/index.js +4 -0
  221. package/es2020/src/services/index.js.map +1 -0
  222. package/karma.conf.d.ts +2 -0
  223. package/karma.conf.d.ts.map +1 -0
  224. package/moment/datetime-moment.d.ts +47 -0
  225. package/moment/datetime-moment.internal.d.ts +47 -0
  226. package/moment/package.json +7 -7
  227. package/moment/src/index.d.ts +3 -0
  228. package/moment/src/index.d.ts.map +1 -0
  229. package/moment/src/misc/tokens.d.ts +5 -5
  230. package/moment/src/services/momentDateApi.service.d.ts +35 -32
  231. package/moment/src/services/momentDateApi.service.d.ts.map +1 -1
  232. package/moment/temp/datetime-moment.api.md +36 -0
  233. package/package.json +91 -48
  234. package/src/index.d.ts +19 -0
  235. package/src/index.d.ts.map +1 -0
  236. package/src/misc/constants.d.ts +32 -32
  237. package/src/misc/datetime.interface.d.ts +34 -34
  238. package/src/misc/tokens.d.ts +10 -10
  239. package/src/misc/validators.d.ts +25 -25
  240. package/src/modules/datePipes.module.d.ts +12 -5
  241. package/src/modules/datePipes.module.d.ts.map +1 -1
  242. package/src/picker/components/dayPicker/dayPicker.component.d.ts +68 -65
  243. package/src/picker/components/dayPicker/dayPicker.component.d.ts.map +1 -1
  244. package/src/picker/components/dayPicker/dayPicker.component.html +7 -7
  245. package/src/picker/components/dayPicker/dayPicker.interfaces.d.ts +10 -10
  246. package/src/picker/components/monthPicker/monthPicker.component.d.ts +52 -49
  247. package/src/picker/components/monthPicker/monthPicker.component.d.ts.map +1 -1
  248. package/src/picker/components/monthPicker/monthPicker.component.html +6 -6
  249. package/src/picker/components/monthPicker/monthPicker.interfaces.d.ts +6 -6
  250. package/src/picker/components/picker/picker.component.animations.d.ts +4 -4
  251. package/src/picker/components/picker/picker.component.d.ts +104 -101
  252. package/src/picker/components/picker/picker.component.d.ts.map +1 -1
  253. package/src/picker/components/pickerBase.component.d.ts +169 -166
  254. package/src/picker/components/pickerBase.component.d.ts.map +1 -1
  255. package/src/picker/components/yearPicker/yearPicker.component.d.ts +57 -54
  256. package/src/picker/components/yearPicker/yearPicker.component.d.ts.map +1 -1
  257. package/src/picker/components/yearPicker/yearPicker.component.html +6 -6
  258. package/src/picker/components/yearPicker/yearPicker.interfaces.d.ts +6 -6
  259. package/src/picker/interfaces.d.ts +4 -4
  260. package/src/picker/misc/datetimePicker.interface.d.ts +188 -188
  261. package/src/picker/misc/tokens.d.ts +6 -6
  262. package/src/picker/modules/picker.module.d.ts +16 -5
  263. package/src/picker/modules/picker.module.d.ts.map +1 -1
  264. package/src/picker/types.d.ts +7 -7
  265. package/src/pipes/asRequiredType.d.ts +21 -0
  266. package/src/pipes/asRequiredType.d.ts.map +1 -0
  267. package/src/pipes/dateConvert.pipe.d.ts +18 -15
  268. package/src/pipes/dateConvert.pipe.d.ts.map +1 -1
  269. package/src/pipes/dateFormat.pipe.d.ts +20 -17
  270. package/src/pipes/dateFormat.pipe.d.ts.map +1 -1
  271. package/src/selector/components/inputDateTime/inputDateTime.component.d.ts +187 -184
  272. package/src/selector/components/inputDateTime/inputDateTime.component.d.ts.map +1 -1
  273. package/src/selector/components/selector/selector.component.animations.d.ts +4 -4
  274. package/src/selector/components/selector/selector.component.d.ts +155 -152
  275. package/src/selector/components/selector/selector.component.d.ts.map +1 -1
  276. package/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.d.ts +170 -167
  277. package/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.d.ts.map +1 -1
  278. package/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.d.ts +22 -19
  279. package/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.d.ts.map +1 -1
  280. package/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.d.ts +22 -19
  281. package/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.d.ts.map +1 -1
  282. package/src/selector/directives/datetimeValidator/datetimeValidator.directive.d.ts +21 -18
  283. package/src/selector/directives/datetimeValidator/datetimeValidator.directive.d.ts.map +1 -1
  284. package/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.d.ts +53 -50
  285. package/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.d.ts.map +1 -1
  286. package/src/selector/interfaces.d.ts +1 -1
  287. package/src/selector/misc/datetimeSelector.interface.d.ts +82 -82
  288. package/src/selector/misc/tokens.d.ts +6 -6
  289. package/src/selector/modules/basicSelector.module.d.ts +10 -5
  290. package/src/selector/modules/basicSelector.module.d.ts.map +1 -1
  291. package/src/selector/modules/selector.module.d.ts +18 -5
  292. package/src/selector/modules/selector.module.d.ts.map +1 -1
  293. package/src/selector/types.d.ts +9 -9
  294. package/src/services/dateApi.interface.d.ts +275 -275
  295. package/src/services/datePositionParser.interface.d.ts +40 -40
  296. package/src/services/datePositionParser.service.d.ts +60 -57
  297. package/src/services/datePositionParser.service.d.ts.map +1 -1
  298. package/src/services/dateTimeRelativeParser.service.d.ts +21 -18
  299. package/src/services/dateTimeRelativeParser.service.d.ts.map +1 -1
  300. package/src/services/dateValueProvider.service.d.ts +18 -15
  301. package/src/services/dateValueProvider.service.d.ts.map +1 -1
  302. package/src/services/formatProvider.interface.d.ts +17 -17
  303. package/src/services/index.d.ts +3 -3
  304. package/tsconfig.karma.json +5 -6
  305. package/version.bak +1 -1
  306. package/appveyor.yml +0 -70
  307. package/date-fns/dist/es2015/date-fns/index.js +0 -10
  308. package/date-fns/dist/es2015/date-fns/public_api.js +0 -7
  309. package/date-fns/dist/es2015/date-fns/src/date-fns.js +0 -9
  310. package/date-fns/dist/es2015/date-fns/src/misc/tokens.js +0 -32
  311. package/date-fns/dist/es2015/date-fns/src/services/dateFnsDateApi.service.js +0 -512
  312. package/date-fns/dist/es2015/date-fns/src/services/dateFnsLocale.service.js +0 -18
  313. package/date-fns/dist/es5/date-fns/index.js +0 -10
  314. package/date-fns/dist/es5/date-fns/public_api.js +0 -7
  315. package/date-fns/dist/es5/date-fns/src/date-fns.js +0 -9
  316. package/date-fns/dist/es5/date-fns/src/misc/tokens.js +0 -32
  317. package/date-fns/dist/es5/date-fns/src/services/dateFnsDateApi.service.js +0 -902
  318. package/date-fns/dist/es5/date-fns/src/services/dateFnsLocale.service.js +0 -18
  319. package/date-fns/index.d.ts +0 -5
  320. package/date-fns/index.d.ts.map +0 -1
  321. package/date-fns/index.metadata.json +0 -1
  322. package/date-fns/public_api.d.ts +0 -2
  323. package/date-fns/public_api.d.ts.map +0 -1
  324. package/date-fns/src/date-fns.d.ts.map +0 -1
  325. package/date-fns/src/services/dateFnsDateApi.service.ngfactory.d.ts.map +0 -1
  326. package/datetime.d.ts.map +0 -1
  327. package/datetime.metadata.json +0 -1
  328. package/dist/es2015/datetime.js +0 -10
  329. package/dist/es2015/public_api.js +0 -7
  330. package/dist/es2015/src/datetime.js +0 -24
  331. package/dist/es2015/src/misc/constants.js +0 -46
  332. package/dist/es2015/src/misc/datetime.interface.js +0 -52
  333. package/dist/es2015/src/misc/tokens.js +0 -29
  334. package/dist/es2015/src/misc/validators.js +0 -80
  335. package/dist/es2015/src/modules/datePipes.module.js +0 -26
  336. package/dist/es2015/src/picker/components/dayPicker/dayPicker.component.js +0 -215
  337. package/dist/es2015/src/picker/components/dayPicker/dayPicker.interfaces.js +0 -18
  338. package/dist/es2015/src/picker/components/monthPicker/monthPicker.component.js +0 -138
  339. package/dist/es2015/src/picker/components/monthPicker/monthPicker.interfaces.js +0 -11
  340. package/dist/es2015/src/picker/components/picker/picker.component.animations.js +0 -77
  341. package/dist/es2015/src/picker/components/picker/picker.component.js +0 -386
  342. package/dist/es2015/src/picker/components/pickerBase.component.js +0 -406
  343. package/dist/es2015/src/picker/components/yearPicker/yearPicker.component.js +0 -158
  344. package/dist/es2015/src/picker/components/yearPicker/yearPicker.interfaces.js +0 -11
  345. package/dist/es2015/src/picker/interfaces.js +0 -10
  346. package/dist/es2015/src/picker/misc/datetimePicker.interface.js +0 -245
  347. package/dist/es2015/src/picker/misc/tokens.js +0 -12
  348. package/dist/es2015/src/picker/modules/picker.module.js +0 -35
  349. package/dist/es2015/src/picker/types.js +0 -13
  350. package/dist/es2015/src/pipes/dateConvert.pipe.js +0 -50
  351. package/dist/es2015/src/pipes/dateFormat.pipe.js +0 -64
  352. package/dist/es2015/src/selector/components/inputDateTime/inputDateTime.component.js +0 -588
  353. package/dist/es2015/src/selector/components/selector/selector.component.animations.js +0 -21
  354. package/dist/es2015/src/selector/components/selector/selector.component.js +0 -514
  355. package/dist/es2015/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js +0 -456
  356. package/dist/es2015/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.js +0 -73
  357. package/dist/es2015/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.js +0 -73
  358. package/dist/es2015/src/selector/directives/datetimeValidator/datetimeValidator.directive.js +0 -70
  359. package/dist/es2015/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.js +0 -171
  360. package/dist/es2015/src/selector/interfaces.js +0 -7
  361. package/dist/es2015/src/selector/misc/datetimeSelector.interface.js +0 -106
  362. package/dist/es2015/src/selector/misc/tokens.js +0 -12
  363. package/dist/es2015/src/selector/modules/basicSelector.module.js +0 -20
  364. package/dist/es2015/src/selector/modules/selector.module.js +0 -45
  365. package/dist/es2015/src/selector/types.js +0 -15
  366. package/dist/es2015/src/services/dateApi.interface.js +0 -316
  367. package/dist/es2015/src/services/datePositionParser.interface.js +0 -56
  368. package/dist/es2015/src/services/datePositionParser.service.js +0 -297
  369. package/dist/es2015/src/services/dateTimeRelativeParser.service.js +0 -97
  370. package/dist/es2015/src/services/dateValueProvider.service.js +0 -79
  371. package/dist/es2015/src/services/formatProvider.interface.js +0 -28
  372. package/dist/es2015/src/services/index.js +0 -9
  373. package/dist/es5/datetime.js +0 -10
  374. package/dist/es5/public_api.js +0 -7
  375. package/dist/es5/src/datetime.js +0 -24
  376. package/dist/es5/src/misc/constants.js +0 -46
  377. package/dist/es5/src/misc/datetime.interface.js +0 -52
  378. package/dist/es5/src/misc/tokens.js +0 -29
  379. package/dist/es5/src/misc/validators.js +0 -124
  380. package/dist/es5/src/modules/datePipes.module.js +0 -30
  381. package/dist/es5/src/picker/components/dayPicker/dayPicker.component.js +0 -323
  382. package/dist/es5/src/picker/components/dayPicker/dayPicker.interfaces.js +0 -18
  383. package/dist/es5/src/picker/components/monthPicker/monthPicker.component.js +0 -233
  384. package/dist/es5/src/picker/components/monthPicker/monthPicker.interfaces.js +0 -11
  385. package/dist/es5/src/picker/components/picker/picker.component.animations.js +0 -77
  386. package/dist/es5/src/picker/components/picker/picker.component.js +0 -460
  387. package/dist/es5/src/picker/components/pickerBase.component.js +0 -561
  388. package/dist/es5/src/picker/components/yearPicker/yearPicker.component.js +0 -253
  389. package/dist/es5/src/picker/components/yearPicker/yearPicker.interfaces.js +0 -11
  390. package/dist/es5/src/picker/interfaces.js +0 -10
  391. package/dist/es5/src/picker/misc/datetimePicker.interface.js +0 -245
  392. package/dist/es5/src/picker/misc/tokens.js +0 -12
  393. package/dist/es5/src/picker/modules/picker.module.js +0 -39
  394. package/dist/es5/src/picker/types.js +0 -13
  395. package/dist/es5/src/pipes/dateConvert.pipe.js +0 -63
  396. package/dist/es5/src/pipes/dateFormat.pipe.js +0 -79
  397. package/dist/es5/src/selector/components/inputDateTime/inputDateTime.component.js +0 -808
  398. package/dist/es5/src/selector/components/selector/selector.component.animations.js +0 -21
  399. package/dist/es5/src/selector/components/selector/selector.component.js +0 -653
  400. package/dist/es5/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js +0 -656
  401. package/dist/es5/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.js +0 -84
  402. package/dist/es5/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.js +0 -84
  403. package/dist/es5/src/selector/directives/datetimeValidator/datetimeValidator.directive.js +0 -82
  404. package/dist/es5/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.js +0 -230
  405. package/dist/es5/src/selector/interfaces.js +0 -7
  406. package/dist/es5/src/selector/misc/datetimeSelector.interface.js +0 -106
  407. package/dist/es5/src/selector/misc/tokens.js +0 -12
  408. package/dist/es5/src/selector/modules/basicSelector.module.js +0 -24
  409. package/dist/es5/src/selector/modules/selector.module.js +0 -49
  410. package/dist/es5/src/selector/types.js +0 -15
  411. package/dist/es5/src/services/dateApi.interface.js +0 -316
  412. package/dist/es5/src/services/datePositionParser.interface.js +0 -56
  413. package/dist/es5/src/services/datePositionParser.service.js +0 -366
  414. package/dist/es5/src/services/dateTimeRelativeParser.service.js +0 -108
  415. package/dist/es5/src/services/dateValueProvider.service.js +0 -92
  416. package/dist/es5/src/services/formatProvider.interface.js +0 -28
  417. package/dist/es5/src/services/index.js +0 -9
  418. package/moment/dist/es2015/moment/index.js +0 -10
  419. package/moment/dist/es2015/moment/public_api.js +0 -7
  420. package/moment/dist/es2015/moment/src/misc/tokens.js +0 -26
  421. package/moment/dist/es2015/moment/src/moment.js +0 -8
  422. package/moment/dist/es2015/moment/src/services/momentDateApi.service.js +0 -466
  423. package/moment/dist/es5/moment/index.js +0 -10
  424. package/moment/dist/es5/moment/public_api.js +0 -7
  425. package/moment/dist/es5/moment/src/misc/tokens.js +0 -26
  426. package/moment/dist/es5/moment/src/moment.js +0 -8
  427. package/moment/dist/es5/moment/src/services/momentDateApi.service.js +0 -858
  428. package/moment/index.d.ts +0 -5
  429. package/moment/index.d.ts.map +0 -1
  430. package/moment/index.metadata.json +0 -1
  431. package/moment/public_api.d.ts +0 -2
  432. package/moment/public_api.d.ts.map +0 -1
  433. package/moment/src/moment.d.ts.map +0 -1
  434. package/moment/src/services/momentDateApi.service.ngfactory.d.ts.map +0 -1
  435. package/public_api.d.ts +0 -2
  436. package/public_api.d.ts.map +0 -1
  437. package/src/datetime.d.ts.map +0 -1
  438. package/src/modules/datePipes.module.ngfactory.d.ts.map +0 -1
  439. package/src/picker/components/dayPicker/dayPicker.component.css.shim.ngstyle.d.ts.map +0 -1
  440. package/src/picker/components/dayPicker/dayPicker.component.ngfactory.d.ts.map +0 -1
  441. package/src/picker/components/monthPicker/monthPicker.component.css.shim.ngstyle.d.ts.map +0 -1
  442. package/src/picker/components/monthPicker/monthPicker.component.ngfactory.d.ts.map +0 -1
  443. package/src/picker/components/picker/picker.component.ngfactory.d.ts.map +0 -1
  444. package/src/picker/components/yearPicker/yearPicker.component.css.shim.ngstyle.d.ts.map +0 -1
  445. package/src/picker/components/yearPicker/yearPicker.component.ngfactory.d.ts.map +0 -1
  446. package/src/picker/modules/picker.module.ngfactory.d.ts.map +0 -1
  447. package/src/pipes/dateConvert.pipe.ngfactory.d.ts.map +0 -1
  448. package/src/pipes/dateFormat.pipe.ngfactory.d.ts.map +0 -1
  449. package/src/selector/components/inputDateTime/inputDateTime.component.css.shim.ngstyle.d.ts.map +0 -1
  450. package/src/selector/components/inputDateTime/inputDateTime.component.ngfactory.d.ts.map +0 -1
  451. package/src/selector/components/selector/selector.component.css.shim.ngstyle.d.ts.map +0 -1
  452. package/src/selector/components/selector/selector.component.ngfactory.d.ts.map +0 -1
  453. package/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.css.shim.ngstyle.d.ts.map +0 -1
  454. package/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.ngfactory.d.ts.map +0 -1
  455. package/src/selector/directives/datetimeMaxValidator/datetimeMaxValidator.directive.ngfactory.d.ts.map +0 -1
  456. package/src/selector/directives/datetimeMinValidator/datetimeMinValidator.directive.ngfactory.d.ts.map +0 -1
  457. package/src/selector/directives/datetimeValidator/datetimeValidator.directive.ngfactory.d.ts.map +0 -1
  458. package/src/selector/directives/selectorControlValueAccessor/selectorControlValueAccessor.directive.ngfactory.d.ts.map +0 -1
  459. package/src/selector/modules/basicSelector.module.ngfactory.d.ts.map +0 -1
  460. package/src/selector/modules/selector.module.ngfactory.d.ts.map +0 -1
  461. package/src/services/datePositionParser.service.ngfactory.d.ts.map +0 -1
  462. package/src/services/dateTimeRelativeParser.service.ngfactory.d.ts.map +0 -1
  463. package/src/services/dateValueProvider.service.ngfactory.d.ts.map +0 -1
@@ -0,0 +1,241 @@
1
+ import { Component, ChangeDetectionStrategy, Optional, Inject, Input, EventEmitter, Output, ChangeDetectorRef } from '@angular/core';
2
+ import { extend } from '@jscrpt/common';
3
+ import { Subscription } from 'rxjs';
4
+ import { DATE_API } from '../../../misc/tokens';
5
+ import { DATE_TIME_PICKER_CONFIGURATION } from '../../misc/tokens';
6
+ import { DateTimeDayPickerComponent } from '../dayPicker/dayPicker.component';
7
+ import { DateTimeMonthPickerComponent } from '../monthPicker/monthPicker.component';
8
+ import { DateTimeYearPickerComponent } from '../yearPicker/yearPicker.component';
9
+ import { scaleUpDownTrigger } from './picker.component.animations';
10
+ import * as i0 from "@angular/core";
11
+ import * as i1 from "@anglr/common";
12
+ //TODO - merge options
13
+ /**
14
+ * Default configuration for picker
15
+ */
16
+ const defaultConfiguration = {
17
+ defaultPeriod: 'day',
18
+ pickerPeriodsDefinition: {
19
+ 'day': DateTimeDayPickerComponent,
20
+ 'month': DateTimeMonthPickerComponent,
21
+ 'year': DateTimeYearPickerComponent
22
+ },
23
+ cssClasses: {}
24
+ };
25
+ /**
26
+ * Component used for displaying date time picker
27
+ */
28
+ export class DateTimePickerComponent {
29
+ //######################### constructor #########################
30
+ constructor(configuration, _dateApi, _changeDetector) {
31
+ this._dateApi = _dateApi;
32
+ this._changeDetector = _changeDetector;
33
+ /**
34
+ * Array of available picker names
35
+ */
36
+ this._pickerNames = [];
37
+ /**
38
+ * Current selected value
39
+ */
40
+ this._value = null;
41
+ /**
42
+ * All subscriptions for active picker
43
+ */
44
+ this._activePickerSubscriptions = new Subscription();
45
+ /**
46
+ * Minimal possible value that can be picked
47
+ */
48
+ this._minValue = null;
49
+ /**
50
+ * Maximal possible value that can be picked
51
+ */
52
+ this._maxValue = null;
53
+ /**
54
+ * Active picker index
55
+ * @internal
56
+ */
57
+ this.activePickerIndex = 0;
58
+ //######################### public properties - outputs #########################
59
+ /**
60
+ * Occurs when value changes
61
+ */
62
+ this.valueChange = new EventEmitter();
63
+ this._options = extend(true, {}, defaultConfiguration, configuration);
64
+ // without deep-copy for this attribute
65
+ if (configuration === null || configuration === void 0 ? void 0 : configuration.pickerPeriodsDefinition) {
66
+ this._options.pickerPeriodsDefinition = configuration.pickerPeriodsDefinition;
67
+ }
68
+ }
69
+ //######################### public properties - inputs #########################
70
+ /**
71
+ * Current options used by picker
72
+ */
73
+ get options() {
74
+ return this._options;
75
+ }
76
+ set options(value) {
77
+ this._options = extend(true, this._options, value);
78
+ // without deep-copy for this attribute
79
+ if (value === null || value === void 0 ? void 0 : value.pickerPeriodsDefinition) {
80
+ this._options.pickerPeriodsDefinition = value.pickerPeriodsDefinition;
81
+ }
82
+ }
83
+ /**
84
+ * Current selected value
85
+ */
86
+ get value() {
87
+ return this._value;
88
+ }
89
+ set value(value) {
90
+ var _a, _b;
91
+ this._value = value;
92
+ (_a = this._activePicker) === null || _a === void 0 ? void 0 : _a.setValue(value);
93
+ (_b = this._activePicker) === null || _b === void 0 ? void 0 : _b.invalidateVisuals();
94
+ }
95
+ /**
96
+ * Gets or sets minimal possible value for picker, that can be picked
97
+ */
98
+ get minValue() {
99
+ return this._minValue;
100
+ }
101
+ set minValue(value) {
102
+ var _a;
103
+ this._minValue = value;
104
+ (_a = this._activePicker) === null || _a === void 0 ? void 0 : _a.setMinValue(this._minValue);
105
+ }
106
+ /**
107
+ * Gets or sets maximal possible value for picker, that can be picked
108
+ */
109
+ get maxValue() {
110
+ return this._maxValue;
111
+ }
112
+ set maxValue(value) {
113
+ var _a;
114
+ this._maxValue = value;
115
+ (_a = this._activePicker) === null || _a === void 0 ? void 0 : _a.setMaxValue(this._maxValue);
116
+ }
117
+ //######################### public methods - implementation of OnInit #########################
118
+ /**
119
+ * Initialize component
120
+ */
121
+ ngOnInit() {
122
+ if (this._options.pickerPeriodsOrder) {
123
+ if (Array.isArray(this._options.pickerPeriodsOrder)) {
124
+ this._pickerNames = this._options.pickerPeriodsOrder;
125
+ }
126
+ else {
127
+ this._pickerNames = this._options.pickerPeriodsOrder.split(',')
128
+ .map(x => x.trim())
129
+ .filter(x => x);
130
+ }
131
+ }
132
+ if (this._pickerNames && this._pickerNames.length > 0) {
133
+ this._pickerNames.forEach(x => {
134
+ if (!this._options.pickerPeriodsDefinition[x]) {
135
+ throw new Error(`There is no period '${x}' in picker options`);
136
+ }
137
+ });
138
+ }
139
+ else {
140
+ this._pickerNames = Object.keys(this._options.pickerPeriodsDefinition);
141
+ }
142
+ if (this._pickerNames.findIndex(x => x == this._options.defaultPeriod) < 0) {
143
+ throw new Error(`There is no period '${this._options.defaultPeriod}' in picker options`);
144
+ }
145
+ this.activePickerComponent = this._options.pickerPeriodsDefinition[this._options.defaultPeriod];
146
+ this._activePickerName = this._options.defaultPeriod;
147
+ this.activePickerIndex = this._pickerNames.indexOf(this._activePickerName);
148
+ }
149
+ //######################### public methods - implementation of OnDestroy #########################
150
+ /**
151
+ * Called when component is destroyed
152
+ */
153
+ ngOnDestroy() {
154
+ this._display = undefined;
155
+ this._activePickerSubscriptions.unsubscribe();
156
+ }
157
+ //######################### public methods - template bindings #########################
158
+ /**
159
+ * Handles created or destroyed date time picker instance
160
+ * @param picker - Instance of picker or null
161
+ * @internal
162
+ */
163
+ pickerCreated(picker) {
164
+ var _a, _b;
165
+ if (picker == this._activePicker) {
166
+ return;
167
+ }
168
+ this._activePicker = picker;
169
+ this._activePickerSubscriptions.unsubscribe();
170
+ this._activePickerSubscriptions = new Subscription();
171
+ if (!this._activePicker) {
172
+ return;
173
+ }
174
+ this._activePickerSubscriptions.add(picker.valueChange.subscribe(() => {
175
+ this._value = picker.value;
176
+ this.valueChange.emit(this._value);
177
+ }));
178
+ this._activePickerSubscriptions.add(picker.scaleUp.subscribe(display => {
179
+ this._display = display;
180
+ const index = this._pickerNames.indexOf(this._activePickerName) + 1;
181
+ this._activePickerName = this._pickerNames[index];
182
+ this.activePickerIndex = this._pickerNames.indexOf(this._activePickerName);
183
+ this.activePickerComponent = this._options.pickerPeriodsDefinition[this._activePickerName];
184
+ }));
185
+ this._activePickerSubscriptions.add(picker.scaleDown.subscribe(display => {
186
+ this._display = display;
187
+ const index = this._pickerNames.indexOf(this._activePickerName) - 1;
188
+ this._activePickerName = this._pickerNames[index];
189
+ this.activePickerIndex = this._pickerNames.indexOf(this._activePickerName);
190
+ this.activePickerComponent = this._options.pickerPeriodsDefinition[this._activePickerName];
191
+ }));
192
+ picker.setCanGoDown(this._pickerNames.indexOf(this._activePickerName) > 0);
193
+ picker.setCanGoUp(this._pickerNames.indexOf(this._activePickerName) < this._pickerNames.length - 1);
194
+ this._setPickerCssClasses();
195
+ picker.setValue(this._value);
196
+ picker.setMinValue(this._minValue);
197
+ picker.setMaxValue(this._maxValue);
198
+ picker.display(this._display ? this._dateApi.getValue(this._display) : this._dateApi.getValue((_b = (_a = this._value) === null || _a === void 0 ? void 0 : _a.from) !== null && _b !== void 0 ? _b : this._dateApi.now().value));
199
+ picker.invalidateVisuals();
200
+ }
201
+ //######################### protected methods #########################
202
+ /**
203
+ * Sets picker css classes
204
+ */
205
+ _setPickerCssClasses() {
206
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
207
+ if (!this._activePicker) {
208
+ return;
209
+ }
210
+ //sets shared css
211
+ this._activePicker.setCssClasses((_c = (_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.cssClasses) === null || _b === void 0 ? void 0 : _b.pickerShared) !== null && _c !== void 0 ? _c : {});
212
+ if (((_e = (_d = this._options) === null || _d === void 0 ? void 0 : _d.cssClasses) === null || _e === void 0 ? void 0 : _e.pickerCustom) && ((_g = (_f = this._options) === null || _f === void 0 ? void 0 : _f.cssClasses) === null || _g === void 0 ? void 0 : _g.pickerCustom[this._activePickerName])) {
213
+ this._activePicker.setCssClasses((_j = (_h = this._options) === null || _h === void 0 ? void 0 : _h.cssClasses) === null || _j === void 0 ? void 0 : _j.pickerCustom[this._activePickerName]);
214
+ }
215
+ }
216
+ }
217
+ DateTimePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DateTimePickerComponent, deps: [{ token: DATE_TIME_PICKER_CONFIGURATION, optional: true }, { token: DATE_API }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
218
+ DateTimePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: DateTimePickerComponent, selector: "date-time-picker", inputs: { options: "options", value: "value", minValue: "minValue", maxValue: "maxValue" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "<div [@scaleUpDown]=\"activePickerIndex\">\r\n <ng-template [ngComponentOutletEx]=\"activePickerComponent\" (ngComponentOutletExCreated)=\"pickerCreated($event)\"></ng-template>\r\n</div>", directives: [{ type: i1.NgComponentOutletEx, selector: "[ngComponentOutletEx]", inputs: ["ngComponentOutletEx", "ngComponentOutletExInjector", "ngComponentOutletExContent"], outputs: ["ngComponentOutletExCreated"], exportAs: ["ngComponentOutletEx"] }], animations: [scaleUpDownTrigger], changeDetection: i0.ChangeDetectionStrategy.OnPush });
219
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DateTimePickerComponent, decorators: [{
220
+ type: Component,
221
+ args: [{ selector: 'date-time-picker', animations: [scaleUpDownTrigger], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [@scaleUpDown]=\"activePickerIndex\">\r\n <ng-template [ngComponentOutletEx]=\"activePickerComponent\" (ngComponentOutletExCreated)=\"pickerCreated($event)\"></ng-template>\r\n</div>" }]
222
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
223
+ type: Optional
224
+ }, {
225
+ type: Inject,
226
+ args: [DATE_TIME_PICKER_CONFIGURATION]
227
+ }] }, { type: undefined, decorators: [{
228
+ type: Inject,
229
+ args: [DATE_API]
230
+ }] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { options: [{
231
+ type: Input
232
+ }], value: [{
233
+ type: Input
234
+ }], minValue: [{
235
+ type: Input
236
+ }], maxValue: [{
237
+ type: Input
238
+ }], valueChange: [{
239
+ type: Output
240
+ }] } });
241
+ //# sourceMappingURL=picker.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"picker.component.js","sourceRoot":"","sources":["../../../../../src/picker/components/picker/picker.component.ts","../../../../../src/picker/components/picker/picker.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAgB,YAAY,EAAE,MAAM,EAAE,iBAAiB,EAAY,MAAM,eAAe,CAAC;AAC5J,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAC;AAGlC,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAG9C,OAAO,EAAC,8BAA8B,EAAC,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAC,0BAA0B,EAAC,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAC,4BAA4B,EAAC,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAC,2BAA2B,EAAC,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAC,kBAAkB,EAAC,MAAM,+BAA+B,CAAC;;;AAEjE,sBAAsB;AAEtB;;GAEG;AACH,MAAM,oBAAoB,GAC1B;IACI,aAAa,EAAE,KAAK;IACpB,uBAAuB,EACvB;QACI,KAAK,EAAE,0BAA0B;QACjC,OAAO,EAAE,4BAA4B;QACrC,MAAM,EAAE,2BAA2B;KACtC;IACD,UAAU,EACV,EACC;CACJ,CAAC;AAEF;;GAEG;AASH,MAAM,OAAO,uBAAuB;IAwIhC,iEAAiE;IACjE,YAAgE,aAA2D,EACnF,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;QACjB,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,MAAA,MAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,UAAU,0CAAE,YAAY,mCAAI,EAAE,CAAC,CAAC;QAEhF,IAAG,CAAA,MAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,UAAU,0CAAE,YAAY,MAAI,MAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,UAAU,0CAAE,YAAY,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA,EAC7G;YACI,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,MAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,UAAU,0CAAE,YAAY,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC;SACrG;IACL,CAAC;;oHA5RQ,uBAAuB,kBAyIA,8BAA8B,6BAC1C,QAAQ;wGA1InB,uBAAuB,6LC5CpC,gMAEM,2QDuCU,CAAC,kBAAkB,CAAC;2FAGvB,uBAAuB;kBARnC,SAAS;+BAEI,kBAAkB,cAGhB,CAAC,kBAAkB,CAAC,mBACf,uBAAuB,CAAC,MAAM;;0BA2IlC,QAAQ;;0BAAI,MAAM;2BAAC,8BAA8B;;0BACjD,MAAM;2BAAC,QAAQ;4EArEjB,OAAO;sBADjB,KAAK;gBAoBK,KAAK;sBADf,KAAK;gBAiBK,QAAQ;sBADlB,KAAK;gBAeK,QAAQ;sBADlB,KAAK;gBAiBC,WAAW;sBADjB,MAAM","sourcesContent":["import {Component, ChangeDetectionStrategy, Optional, Inject, Input, Type, OnInit, EventEmitter, Output, ChangeDetectorRef, OnDestroy} from '@angular/core';\nimport {extend} from '@jscrpt/common';\nimport {Subscription} from 'rxjs';\n\nimport {DateTimeValue} from '../../../misc/datetime.interface';\nimport {DATE_API} from '../../../misc/tokens';\nimport {DateApi} from '../../../services';\nimport {DateTimePicker, DateTimePickerOptions} from '../../misc/datetimePicker.interface';\nimport {DATE_TIME_PICKER_CONFIGURATION} from '../../misc/tokens';\nimport {DateTimeDayPickerComponent} from '../dayPicker/dayPicker.component';\nimport {DateTimeMonthPickerComponent} from '../monthPicker/monthPicker.component';\nimport {DateTimeYearPickerComponent} from '../yearPicker/yearPicker.component';\nimport {scaleUpDownTrigger} from './picker.component.animations';\n\n//TODO - merge options\n\n/**\n * Default configuration for picker\n */\nconst defaultConfiguration: DateTimePickerOptions<DateTimePicker> =\n{\n defaultPeriod: 'day',\n pickerPeriodsDefinition:\n {\n 'day': DateTimeDayPickerComponent,\n 'month': DateTimeMonthPickerComponent,\n 'year': DateTimeYearPickerComponent\n },\n cssClasses:\n {\n }\n};\n\n/**\n * Component used for displaying date time picker\n */\n@Component(\n{\n selector: 'date-time-picker',\n templateUrl: 'picker.component.html',\n // styleUrls: ['picker.component.scss'],\n animations: [scaleUpDownTrigger],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DateTimePickerComponent<TDate = any> implements OnInit, OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Instance of active date time picker\n */\n protected _activePicker?: DateTimePicker<TDate>;\n\n /**\n * Name, id of displayed picker\n */\n protected _activePickerName!: string;\n\n /**\n * Array of available picker names\n */\n protected _pickerNames: string[] = [];\n\n /**\n * Current selected value\n */\n protected _value: DateTimeValue<TDate>|null = null;\n\n /**\n * All subscriptions for active picker\n */\n protected _activePickerSubscriptions: Subscription = new Subscription();\n\n /**\n * Date that should be displayed in picker, used when moving up or down in periods\n */\n protected _display?: TDate;\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 /**\n * Current options used by picker\n */\n protected _options: DateTimePickerOptions<DateTimePicker<TDate>>;\n\n //######################### public properties - template bindings #########################\n\n /**\n * Currently active date time picker component type\n * @internal\n */\n public activePickerComponent?: Type<DateTimePicker<TDate>>;\n\n /**\n * Active picker index\n * @internal\n */\n public activePickerIndex: number = 0;\n\n //######################### public properties - inputs #########################\n\n /**\n * Current options used by picker\n */\n @Input()\n public get options(): DateTimePickerOptions<DateTimePicker<TDate>>\n {\n return this._options;\n }\n public set options(value: DateTimePickerOptions<DateTimePicker<TDate>>)\n {\n this._options = extend(true, this._options, value);\n\n // without deep-copy for this attribute\n if (value?.pickerPeriodsDefinition)\n {\n this._options.pickerPeriodsDefinition = value.pickerPeriodsDefinition;\n }\n }\n\n /**\n * Current selected value\n */\n @Input()\n public get value(): DateTimeValue<TDate>|null\n {\n return this._value;\n }\n public set value(value: DateTimeValue<TDate>|null)\n {\n this._value = value;\n\n this._activePicker?.setValue(value);\n this._activePicker?.invalidateVisuals();\n }\n\n /**\n * Gets or sets minimal possible value for picker, that can be picked\n */\n @Input()\n public get minValue(): TDate|null\n {\n return this._minValue;\n }\n public set minValue(value: TDate|null)\n {\n this._minValue = value;\n this._activePicker?.setMinValue(this._minValue);\n }\n\n /**\n * Gets or sets maximal possible value for picker, that can be picked\n */\n @Input()\n public get maxValue(): TDate|null\n {\n return this._maxValue;\n }\n public set maxValue(value: TDate|null)\n {\n this._maxValue = value;\n this._activePicker?.setMaxValue(this._maxValue);\n }\n\n //######################### public properties - outputs #########################\n\n /**\n * Occurs when value changes\n */\n @Output()\n public valueChange: EventEmitter<DateTimeValue<TDate>> = new EventEmitter<DateTimeValue<TDate>>();\n\n //######################### constructor #########################\n constructor(@Optional() @Inject(DATE_TIME_PICKER_CONFIGURATION) configuration: DateTimePickerOptions<DateTimePicker<TDate>>,\n @Inject(DATE_API) protected _dateApi: DateApi<TDate>,\n protected _changeDetector: ChangeDetectorRef)\n {\n this._options = extend(true, {}, defaultConfiguration, configuration);\n // without deep-copy for this attribute\n if (configuration?.pickerPeriodsDefinition)\n {\n this._options.pickerPeriodsDefinition = configuration.pickerPeriodsDefinition;\n }\n }\n\n //######################### public methods - implementation of OnInit #########################\n\n /**\n * Initialize component\n */\n public ngOnInit()\n {\n if (this._options.pickerPeriodsOrder)\n {\n if (Array.isArray(this._options.pickerPeriodsOrder))\n {\n this._pickerNames = this._options.pickerPeriodsOrder;\n }\n else\n {\n this._pickerNames = this._options.pickerPeriodsOrder.split(',')\n .map(x => x.trim())\n .filter(x => x);\n }\n }\n if (this._pickerNames && this._pickerNames.length > 0)\n {\n this._pickerNames.forEach(x => \n {\n if(!this._options.pickerPeriodsDefinition![x!])\n {\n throw new Error(`There is no period '${x}' in picker options`);\n }\n });\n }\n else\n {\n this._pickerNames = Object.keys(this._options.pickerPeriodsDefinition!);\n }\n\n if(this._pickerNames.findIndex(x => x == this._options.defaultPeriod) < 0)\n {\n throw new Error(`There is no period '${this._options.defaultPeriod}' in picker options`);\n }\n\n this.activePickerComponent = this._options.pickerPeriodsDefinition![this._options.defaultPeriod!];\n this._activePickerName = this._options.defaultPeriod!;\n this.activePickerIndex = this._pickerNames.indexOf(this._activePickerName);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * Called when component is destroyed\n */\n public ngOnDestroy()\n {\n this._display = undefined;\n this._activePickerSubscriptions.unsubscribe();\n }\n\n //######################### public methods - template bindings #########################\n\n /**\n * Handles created or destroyed date time picker instance\n * @param picker - Instance of picker or null\n * @internal\n */\n public pickerCreated(picker: DateTimePicker<TDate>)\n {\n if(picker == this._activePicker)\n {\n return;\n }\n\n this._activePicker = picker;\n\n this._activePickerSubscriptions.unsubscribe();\n this._activePickerSubscriptions = new Subscription();\n\n if(!this._activePicker)\n {\n return;\n }\n\n this._activePickerSubscriptions.add(picker.valueChange.subscribe(() =>\n {\n this._value = picker.value;\n this.valueChange.emit(this._value!);\n }));\n\n this._activePickerSubscriptions.add(picker.scaleUp.subscribe(display =>\n {\n this._display = display;\n const index = this._pickerNames.indexOf(this._activePickerName) + 1;\n this._activePickerName = this._pickerNames[index];\n this.activePickerIndex = this._pickerNames.indexOf(this._activePickerName);\n this.activePickerComponent = this._options.pickerPeriodsDefinition![this._activePickerName];\n }));\n\n this._activePickerSubscriptions.add(picker.scaleDown.subscribe(display =>\n {\n this._display = display;\n const index = this._pickerNames.indexOf(this._activePickerName) - 1;\n this._activePickerName = this._pickerNames[index];\n this.activePickerIndex = this._pickerNames.indexOf(this._activePickerName);\n this.activePickerComponent = this._options.pickerPeriodsDefinition![this._activePickerName];\n }));\n\n picker.setCanGoDown(this._pickerNames.indexOf(this._activePickerName) > 0);\n picker.setCanGoUp(this._pickerNames.indexOf(this._activePickerName) < this._pickerNames.length - 1);\n\n this._setPickerCssClasses();\n picker.setValue(this._value);\n picker.setMinValue(this._minValue);\n picker.setMaxValue(this._maxValue);\n picker.display(this._display ? this._dateApi.getValue(this._display) : this._dateApi.getValue(this._value?.from ?? this._dateApi.now().value));\n\n picker.invalidateVisuals();\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets picker css classes\n */\n protected _setPickerCssClasses()\n {\n if(!this._activePicker)\n {\n return;\n }\n\n //sets shared css\n this._activePicker.setCssClasses(this._options?.cssClasses?.pickerShared ?? {});\n\n if(this._options?.cssClasses?.pickerCustom && this._options?.cssClasses?.pickerCustom[this._activePickerName])\n {\n this._activePicker.setCssClasses(this._options?.cssClasses?.pickerCustom[this._activePickerName]);\n }\n }\n}\n","<div [@scaleUpDown]=\"activePickerIndex\">\r\n <ng-template [ngComponentOutletEx]=\"activePickerComponent\" (ngComponentOutletExCreated)=\"pickerCreated($event)\"></ng-template>\r\n</div>"]}
@@ -0,0 +1,243 @@
1
+ import { ChangeDetectorRef, Directive, HostListener, Inject } from '@angular/core';
2
+ import { extend } from '@jscrpt/common';
3
+ import { Subject } from 'rxjs';
4
+ import { DATE_API } from '../../misc/tokens';
5
+ import * as i0 from "@angular/core";
6
+ /**
7
+ * Base class used as base for picker
8
+ */
9
+ export class PickerBaseComponent {
10
+ //######################### constructor #########################
11
+ constructor(_dateApi, _changeDetector) {
12
+ this._dateApi = _dateApi;
13
+ this._changeDetector = _changeDetector;
14
+ //######################### protected fields #########################
15
+ /**
16
+ * Current value of datetime
17
+ */
18
+ this._value = null;
19
+ /**
20
+ * Occurs when value changes
21
+ */
22
+ this._valueChange = new Subject();
23
+ /**
24
+ * Occurs when user scales up
25
+ */
26
+ this._scaleUp = new Subject();
27
+ /**
28
+ * Occurs when user scales down
29
+ */
30
+ this._scaleDown = new Subject();
31
+ /**
32
+ * Minimal possible value that can be picked
33
+ */
34
+ this._minValue = null;
35
+ /**
36
+ * Maximal possible value that can be picked
37
+ */
38
+ this._maxValue = null;
39
+ //######################### public properties - template bindings #########################
40
+ /**
41
+ * Date api instance for displayed date
42
+ * @internal
43
+ */
44
+ this.displayDate = null;
45
+ /**
46
+ * Indication whether can go up in period
47
+ * @internal
48
+ */
49
+ this.canGoUp = false;
50
+ /**
51
+ * Indication whether can go down in period
52
+ * @internal
53
+ */
54
+ this.canGoDown = false;
55
+ /**
56
+ * Array of period data to be displayed
57
+ * @internal
58
+ */
59
+ this.periodData = [];
60
+ }
61
+ //######################### public properties - implementation of DateTimePicker #########################
62
+ /**
63
+ * Gets current value of datetime
64
+ */
65
+ get value() {
66
+ return this._value;
67
+ }
68
+ /**
69
+ * Occurs when value changes
70
+ */
71
+ get valueChange() {
72
+ return this._valueChange.asObservable();
73
+ }
74
+ /**
75
+ * Occurs when user scales up
76
+ */
77
+ get scaleUp() {
78
+ return this._scaleUp.asObservable();
79
+ }
80
+ /**
81
+ * Occurs when user scales down
82
+ */
83
+ get scaleDown() {
84
+ return this._scaleDown.asObservable();
85
+ }
86
+ //######################### public methods - template bindings #########################
87
+ /**
88
+ * Changes displayed period to "higher" period
89
+ * @param event - Event that occured
90
+ * @internal
91
+ */
92
+ goUp(event) {
93
+ event.preventDefault();
94
+ if (!this.canGoUp) {
95
+ return;
96
+ }
97
+ this._scaleUp.next(this.displayDate.value);
98
+ }
99
+ /**
100
+ * Selects period
101
+ * @param event - Event that occured
102
+ * @param period - Selected period
103
+ * @internal
104
+ */
105
+ select(event, period) {
106
+ event.preventDefault();
107
+ if (period.disabled) {
108
+ return;
109
+ }
110
+ //handle selection of value
111
+ if (!this.canGoDown) {
112
+ this._setPeriod(period);
113
+ this._value =
114
+ {
115
+ from: period.date,
116
+ to: this._endOfPeriod(period)
117
+ };
118
+ this._valueChange.next();
119
+ return;
120
+ }
121
+ this._scaleDown.next(period.date);
122
+ }
123
+ //######################### public methods - implementation of DateTimePicker #########################
124
+ /**
125
+ * Sets css classes for picker, allowing to override defaults
126
+ * @param cssClasses - Css classes to be set for picker
127
+ */
128
+ setCssClasses(cssClasses) {
129
+ this.cssClasses = extend(true, {}, this.cssClasses, cssClasses);
130
+ }
131
+ /**
132
+ * Sets minimal possible value for picker, that can be picked
133
+ * @param value - Minimal possible value that can be picked
134
+ */
135
+ setMinValue(value) {
136
+ this._minValue = value;
137
+ this._updateMinMax();
138
+ }
139
+ /**
140
+ * Sets maximal possible value for picker, that can be picked
141
+ * @param value - Maximal possible value that can be picked
142
+ */
143
+ setMaxValue(value) {
144
+ this._maxValue = value;
145
+ this._updateMinMax();
146
+ }
147
+ /**
148
+ * Sets value of datetime picker
149
+ * @param value - Value to be set to this picker
150
+ */
151
+ setValue(value) {
152
+ this._value = value;
153
+ //value is present
154
+ if (this._value && this.displayDate) {
155
+ const val = this._dateApi.getValue(this._value.from);
156
+ //change picker to value
157
+ if (!this._isSamePeriodAsDisplayed(val)) {
158
+ this.display(val);
159
+ return;
160
+ }
161
+ const period = this._getPeriodData(val);
162
+ //was initialized
163
+ if (period) {
164
+ this._setPeriod(period);
165
+ }
166
+ }
167
+ }
168
+ /**
169
+ * Sets indication whether can go down
170
+ * @param value - Indication whether can go down in period
171
+ */
172
+ setCanGoDown(value) {
173
+ this.canGoDown = value;
174
+ }
175
+ /**
176
+ * Sets indication whether can go up
177
+ * @param value - Indication whether can go up in period
178
+ */
179
+ setCanGoUp(value) {
180
+ this.canGoUp = value;
181
+ }
182
+ /**
183
+ * Explicitly runs invalidation of content (change detection)
184
+ */
185
+ invalidateVisuals() {
186
+ this._changeDetector.detectChanges();
187
+ }
188
+ //######################### public methods - host #########################
189
+ /**
190
+ * Handles click anyway in picker, that blocks blur
191
+ * @param event - Event that occured
192
+ * @internal
193
+ */
194
+ handleClick(event) {
195
+ event.preventDefault();
196
+ }
197
+ //######################### protected methods #########################
198
+ /**
199
+ * Sets period as active
200
+ * @param period - Period to be set as active
201
+ */
202
+ _setPeriod(period) {
203
+ this.periodData.forEach(itm => itm.active = false);
204
+ period.active = true;
205
+ }
206
+ /**
207
+ * Updates minimal and maximal value for picker
208
+ */
209
+ _updateMinMax() {
210
+ if (!this.periodData.length) {
211
+ return;
212
+ }
213
+ //no min, no max
214
+ if (!this._minValue && !this._maxValue) {
215
+ this.periodData.forEach(itm => itm.disabled = false);
216
+ return;
217
+ }
218
+ const minDateApi = this._minValue ? this._dateApi.getValue(this._minValue) : null;
219
+ const maxDateApi = this._maxValue ? this._dateApi.getValue(this._maxValue) : null;
220
+ let restAfter = false;
221
+ this.periodData.forEach(period => {
222
+ if (!!minDateApi && minDateApi.isAfter(period.date) && !this._isSamePeriod(minDateApi, period.date)) {
223
+ period.disabled = true;
224
+ }
225
+ if (restAfter || (!!maxDateApi && maxDateApi.isBefore(period.date) && !this._isSamePeriod(maxDateApi, period.date))) {
226
+ restAfter = true;
227
+ period.disabled = true;
228
+ }
229
+ });
230
+ }
231
+ }
232
+ PickerBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: PickerBaseComponent, deps: [{ token: DATE_API }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
233
+ PickerBaseComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: PickerBaseComponent, host: { listeners: { "mousedown": "handleClick($event)" } }, ngImport: i0 });
234
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: PickerBaseComponent, decorators: [{
235
+ type: Directive
236
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
237
+ type: Inject,
238
+ args: [DATE_API]
239
+ }] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { handleClick: [{
240
+ type: HostListener,
241
+ args: ['mousedown', ['$event']]
242
+ }] } });
243
+ //# sourceMappingURL=pickerBase.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pickerBase.component.js","sourceRoot":"","sources":["../../../../src/picker/components/pickerBase.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;AACjF,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAa,OAAO,EAAC,MAAM,MAAM,CAAC;AAGzC,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;;AAI3C;;GAEG;AAEH,MAAM,OAAgB,mBAAmB;IAoGrC,iEAAiE;IACjE,YAAwC,QAAwB,EAC1C,eAAkC;QADhB,aAAQ,GAAR,QAAQ,CAAgB;QAC1C,oBAAe,GAAf,eAAe,CAAmB;QApGxD,sEAAsE;QAEtE;;WAEG;QACO,WAAM,GAA8B,IAAI,CAAC;QAEnD;;WAEG;QACO,iBAAY,GAAkB,IAAI,OAAO,EAAQ,CAAC;QAE5D;;WAEG;QACO,aAAQ,GAAmB,IAAI,OAAO,EAAS,CAAC;QAE1D;;WAEG;QACO,eAAU,GAAmB,IAAI,OAAO,EAAS,CAAC;QAE5D;;WAEG;QACO,cAAS,GAAe,IAAI,CAAC;QAEvC;;WAEG;QACO,cAAS,GAAe,IAAI,CAAC;QAoCvC,2FAA2F;QAE3F;;;WAGG;QACI,gBAAW,GAA8B,IAAI,CAAC;QAErD;;;WAGG;QACI,YAAO,GAAY,KAAK,CAAC;QAEhC;;;WAGG;QACI,cAAS,GAAY,KAAK,CAAC;QAElC;;;WAGG;QACI,eAAU,GAAgB,EAAE,CAAC;IAYpC,CAAC;IAtED,0GAA0G;IAE1G;;OAEG;IACH,IAAW,KAAK;QAEZ,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IA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I,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,EAClH;gBACI,SAAS,GAAG,IAAI,CAAC;gBACjB,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC;aAC1B;QACL,CAAC,CAAC,CAAC;IACP,CAAC;;gHA1TiB,mBAAmB,kBAqGjB,QAAQ;oGArGV,mBAAmB;2FAAnB,mBAAmB;kBADxC,SAAS;;0BAsGO,MAAM;2BAAC,QAAQ;4EAgKrB,WAAW;sBADjB,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["import {ChangeDetectorRef, Directive, HostListener, Inject} from '@angular/core';\nimport {extend} from '@jscrpt/common';\nimport {Observable, Subject} from 'rxjs';\n\nimport {DateTimeValue} from '../../misc/datetime.interface';\nimport {DATE_API} from '../../misc/tokens';\nimport {DateApi, DateApiObject} from '../../services/dateApi.interface';\nimport {DateTimePicker, PeriodData} from '../misc/datetimePicker.interface';\n\n/**\n * Base class used as base for picker\n */\n@Directive()\nexport abstract class PickerBaseComponent<TDate = any, TDateData extends PeriodData<TDate> = any, TCssClasses = object> implements DateTimePicker<TDate, TCssClasses>\n{\n //######################### protected fields #########################\n\n /**\n * Current value of datetime\n */\n protected _value: DateTimeValue<TDate>|null = null;\n\n /**\n * Occurs when value changes\n */\n protected _valueChange: Subject<void> = new Subject<void>();\n \n /**\n * Occurs when user scales up\n */\n protected _scaleUp: Subject<TDate> = new Subject<TDate>();\n\n /**\n * Occurs when user scales down\n */\n protected _scaleDown: Subject<TDate> = new Subject<TDate>();\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 DateTimePicker #########################\n\n /**\n * Gets current value of datetime\n */\n public get value(): DateTimeValue<TDate>|null\n {\n return this._value;\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 user scales up\n */\n public get scaleUp(): Observable<TDate>\n {\n return this._scaleUp.asObservable();\n }\n\n /**\n * Occurs when user scales down\n */\n public get scaleDown(): Observable<TDate>\n {\n return this._scaleDown.asObservable();\n }\n\n //######################### public properties - template bindings #########################\n\n /**\n * Date api instance for displayed date\n * @internal\n */\n public displayDate: DateApiObject<TDate>|null = null;\n\n /**\n * Indication whether can go up in period\n * @internal\n */\n public canGoUp: boolean = false;\n\n /**\n * Indication whether can go down in period\n * @internal\n */\n public canGoDown: boolean = false;\n\n /**\n * Array of period data to be displayed\n * @internal\n */\n public periodData: TDateData[] = [];\n\n /**\n * Css classes that are used within picker\n * @internal\n */\n public cssClasses!: TCssClasses;\n\n //######################### constructor #########################\n constructor(@Inject(DATE_API) protected _dateApi: DateApi<TDate>,\n protected _changeDetector: ChangeDetectorRef)\n {\n }\n\n //######################### public methods - template bindings #########################\n\n /**\n * Changes displayed period to \"higher\" period\n * @param event - Event that occured\n * @internal\n */\n public goUp(event: Event)\n {\n event.preventDefault();\n\n if(!this.canGoUp)\n {\n return;\n }\n\n this._scaleUp.next(this.displayDate!.value);\n }\n\n /**\n * Selects period\n * @param event - Event that occured\n * @param period - Selected period\n * @internal\n */\n public select(event: Event, period: PeriodData<TDate>)\n {\n event.preventDefault();\n\n if(period.disabled)\n {\n return;\n }\n\n //handle selection of value\n if(!this.canGoDown)\n {\n this._setPeriod(period);\n\n this._value =\n {\n from: period.date,\n to: this._endOfPeriod(period)\n };\n\n this._valueChange.next();\n\n return;\n }\n\n this._scaleDown.next(period.date);\n }\n\n //######################### public methods - implementation of DateTimePicker #########################\n\n /**\n * Sets css classes for picker, allowing to override defaults\n * @param cssClasses - Css classes to be set for picker\n */\n public setCssClasses(cssClasses: TCssClasses): void\n {\n this.cssClasses = extend(true, {}, this.cssClasses, cssClasses);\n }\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 this._updateMinMax();\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 this._updateMinMax();\n }\n\n /**\n * Sets value of datetime picker\n * @param value - Value to be set to this picker\n */\n public setValue(value: DateTimeValue<TDate>|null): void\n {\n this._value = value;\n\n //value is present\n if(this._value && this.displayDate)\n {\n const val = this._dateApi.getValue(this._value.from);\n\n //change picker to value\n if(!this._isSamePeriodAsDisplayed(val))\n {\n this.display(val);\n\n return;\n }\n\n const period = this._getPeriodData(val);\n\n //was initialized\n if(period)\n {\n this._setPeriod(period);\n }\n }\n }\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 abstract display(value: DateApiObject<TDate>): void;\n\n /**\n * Sets indication whether can go down\n * @param value - Indication whether can go down in period\n */\n public setCanGoDown(value: boolean): void\n {\n this.canGoDown = value;\n }\n\n /**\n * Sets indication whether can go up\n * @param value - Indication whether can go up in period\n */\n public setCanGoUp(value: boolean): void\n {\n this.canGoUp = value;\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 - host #########################\n\n /**\n * Handles click anyway in picker, that blocks blur\n * @param event - Event that occured\n * @internal\n */\n @HostListener('mousedown', ['$event'])\n public handleClick(event: Event)\n {\n event.preventDefault();\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets period as active\n * @param period - Period to be set as active\n */\n protected _setPeriod(period: PeriodData<TDate>)\n {\n this.periodData.forEach(itm => itm.active = false);\n\n period.active = true;\n }\n\n /**\n * Updates minimal and maximal value for picker\n */\n protected _updateMinMax()\n {\n if(!this.periodData.length)\n {\n return;\n }\n\n //no min, no max\n if(!this._minValue && !this._maxValue)\n {\n this.periodData.forEach(itm => itm.disabled = false);\n\n return;\n }\n\n const minDateApi = this._minValue ? this._dateApi.getValue(this._minValue) : null;\n const maxDateApi = this._maxValue ? this._dateApi.getValue(this._maxValue) : null;\n let restAfter = false;\n\n this.periodData.forEach(period =>\n {\n if(!!minDateApi && minDateApi.isAfter(period.date) && !this._isSamePeriod(minDateApi, period.date))\n {\n period.disabled = true;\n }\n\n if(restAfter || (!!maxDateApi && maxDateApi.isBefore(period.date) && !this._isSamePeriod(maxDateApi, period.date)))\n {\n restAfter = true;\n period.disabled = true;\n }\n });\n }\n\n /**\n * Obtains end of period\n * @param period - Period for which should be end obtained\n */\n protected abstract _endOfPeriod(period: PeriodData<TDate>): TDate;\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 abstract _isSamePeriodAsDisplayed(val: DateApiObject<TDate>): boolean;\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 abstract _isSamePeriod(val: DateApiObject<TDate>, target: TDate): boolean;\n\n /**\n * Gets period data for specified value\n * @param val - Value for which is period data obtained\n */\n protected abstract _getPeriodData(val: DateApiObject<TDate>): PeriodData<TDate>;\n}"]}