@taiga-ui/cdk 2.24.0 → 2.27.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 (483) hide show
  1. package/abstract/control.d.ts +1 -1
  2. package/abstract/dialog.directive.d.ts +12 -0
  3. package/abstract/index.d.ts +1 -0
  4. package/abstract/interactive.d.ts +4 -4
  5. package/abstract/taiga-ui-cdk-abstract.metadata.json +1 -1
  6. package/bundles/taiga-ui-cdk-abstract.umd.js +45 -7
  7. package/bundles/taiga-ui-cdk-abstract.umd.js.map +1 -1
  8. package/bundles/taiga-ui-cdk-abstract.umd.min.js +2 -2
  9. package/bundles/taiga-ui-cdk-abstract.umd.min.js.map +1 -1
  10. package/bundles/taiga-ui-cdk-components-dialog-host.umd.js.map +1 -1
  11. package/bundles/taiga-ui-cdk-components-dialog-host.umd.min.js.map +1 -1
  12. package/bundles/taiga-ui-cdk-components-portal-host.umd.js.map +1 -1
  13. package/bundles/taiga-ui-cdk-components-portal-host.umd.min.js.map +1 -1
  14. package/bundles/taiga-ui-cdk-constants.umd.js.map +1 -1
  15. package/bundles/taiga-ui-cdk-constants.umd.min.js.map +1 -1
  16. package/bundles/taiga-ui-cdk-date-time.umd.js +349 -349
  17. package/bundles/taiga-ui-cdk-date-time.umd.js.map +1 -1
  18. package/bundles/taiga-ui-cdk-date-time.umd.min.js +2 -2
  19. package/bundles/taiga-ui-cdk-date-time.umd.min.js.map +1 -1
  20. package/bundles/taiga-ui-cdk-directives-active-zone.umd.js.map +1 -1
  21. package/bundles/taiga-ui-cdk-directives-active-zone.umd.min.js.map +1 -1
  22. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js.map +1 -1
  23. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.min.js.map +1 -1
  24. package/bundles/taiga-ui-cdk-directives-autofilled.umd.js.map +1 -1
  25. package/bundles/taiga-ui-cdk-directives-autofilled.umd.min.js.map +1 -1
  26. package/bundles/taiga-ui-cdk-directives-checked.umd.js.map +1 -1
  27. package/bundles/taiga-ui-cdk-directives-checked.umd.min.js.map +1 -1
  28. package/bundles/taiga-ui-cdk-directives-copy-processor.umd.js +276 -0
  29. package/bundles/taiga-ui-cdk-directives-copy-processor.umd.js.map +1 -0
  30. package/bundles/taiga-ui-cdk-directives-copy-processor.umd.min.js +16 -0
  31. package/bundles/taiga-ui-cdk-directives-copy-processor.umd.min.js.map +1 -0
  32. package/bundles/taiga-ui-cdk-directives-drag.umd.js.map +1 -1
  33. package/bundles/taiga-ui-cdk-directives-drag.umd.min.js.map +1 -1
  34. package/bundles/taiga-ui-cdk-directives-droppable.umd.js.map +1 -1
  35. package/bundles/taiga-ui-cdk-directives-droppable.umd.min.js.map +1 -1
  36. package/bundles/taiga-ui-cdk-directives-element.umd.js.map +1 -1
  37. package/bundles/taiga-ui-cdk-directives-element.umd.min.js.map +1 -1
  38. package/bundles/taiga-ui-cdk-directives-focus-trap.umd.js.map +1 -1
  39. package/bundles/taiga-ui-cdk-directives-focus-trap.umd.min.js.map +1 -1
  40. package/bundles/taiga-ui-cdk-directives-focus-visible.umd.js.map +1 -1
  41. package/bundles/taiga-ui-cdk-directives-focus-visible.umd.min.js.map +1 -1
  42. package/bundles/taiga-ui-cdk-directives-focusable.umd.js.map +1 -1
  43. package/bundles/taiga-ui-cdk-directives-focusable.umd.min.js.map +1 -1
  44. package/bundles/taiga-ui-cdk-directives-focused.umd.js.map +1 -1
  45. package/bundles/taiga-ui-cdk-directives-focused.umd.min.js.map +1 -1
  46. package/bundles/taiga-ui-cdk-directives-for.umd.js.map +1 -1
  47. package/bundles/taiga-ui-cdk-directives-for.umd.min.js.map +1 -1
  48. package/bundles/taiga-ui-cdk-directives-high-dpi.umd.js.map +1 -1
  49. package/bundles/taiga-ui-cdk-directives-high-dpi.umd.min.js.map +1 -1
  50. package/bundles/taiga-ui-cdk-directives-hovered.umd.js.map +1 -1
  51. package/bundles/taiga-ui-cdk-directives-hovered.umd.min.js.map +1 -1
  52. package/bundles/taiga-ui-cdk-directives-input-mode.umd.js.map +1 -1
  53. package/bundles/taiga-ui-cdk-directives-input-mode.umd.min.js.map +1 -1
  54. package/bundles/taiga-ui-cdk-directives-item.umd.js +259 -0
  55. package/bundles/taiga-ui-cdk-directives-item.umd.js.map +1 -0
  56. package/bundles/taiga-ui-cdk-directives-item.umd.min.js +16 -0
  57. package/bundles/taiga-ui-cdk-directives-item.umd.min.js.map +1 -0
  58. package/bundles/taiga-ui-cdk-directives-let.umd.js.map +1 -1
  59. package/bundles/taiga-ui-cdk-directives-let.umd.min.js.map +1 -1
  60. package/bundles/taiga-ui-cdk-directives-media.umd.js +1 -1
  61. package/bundles/taiga-ui-cdk-directives-media.umd.js.map +1 -1
  62. package/bundles/taiga-ui-cdk-directives-media.umd.min.js +1 -1
  63. package/bundles/taiga-ui-cdk-directives-media.umd.min.js.map +1 -1
  64. package/bundles/taiga-ui-cdk-directives-obscured.umd.js.map +1 -1
  65. package/bundles/taiga-ui-cdk-directives-obscured.umd.min.js.map +1 -1
  66. package/bundles/taiga-ui-cdk-directives-overscroll.umd.js.map +1 -1
  67. package/bundles/taiga-ui-cdk-directives-overscroll.umd.min.js.map +1 -1
  68. package/bundles/taiga-ui-cdk-directives-pan.umd.js +5 -5
  69. package/bundles/taiga-ui-cdk-directives-pan.umd.js.map +1 -1
  70. package/bundles/taiga-ui-cdk-directives-pan.umd.min.js +2 -2
  71. package/bundles/taiga-ui-cdk-directives-pan.umd.min.js.map +1 -1
  72. package/bundles/taiga-ui-cdk-directives-pressed.umd.js.map +1 -1
  73. package/bundles/taiga-ui-cdk-directives-pressed.umd.min.js.map +1 -1
  74. package/bundles/taiga-ui-cdk-directives-prevent-default.umd.js.map +1 -1
  75. package/bundles/taiga-ui-cdk-directives-prevent-default.umd.min.js.map +1 -1
  76. package/bundles/taiga-ui-cdk-directives-repeat-times.umd.js.map +1 -1
  77. package/bundles/taiga-ui-cdk-directives-repeat-times.umd.min.js.map +1 -1
  78. package/bundles/taiga-ui-cdk-directives-resize.umd.js.map +1 -1
  79. package/bundles/taiga-ui-cdk-directives-resize.umd.min.js.map +1 -1
  80. package/bundles/taiga-ui-cdk-directives-swipe.umd.js +5 -5
  81. package/bundles/taiga-ui-cdk-directives-swipe.umd.js.map +1 -1
  82. package/bundles/taiga-ui-cdk-directives-swipe.umd.min.js +2 -2
  83. package/bundles/taiga-ui-cdk-directives-swipe.umd.min.js.map +1 -1
  84. package/bundles/taiga-ui-cdk-directives-validator.umd.js.map +1 -1
  85. package/bundles/taiga-ui-cdk-directives-validator.umd.min.js.map +1 -1
  86. package/bundles/taiga-ui-cdk-directives-zoom.umd.js +5 -5
  87. package/bundles/taiga-ui-cdk-directives-zoom.umd.js.map +1 -1
  88. package/bundles/taiga-ui-cdk-directives-zoom.umd.min.js +2 -2
  89. package/bundles/taiga-ui-cdk-directives-zoom.umd.min.js.map +1 -1
  90. package/bundles/taiga-ui-cdk-directives.umd.js +26 -18
  91. package/bundles/taiga-ui-cdk-directives.umd.js.map +1 -1
  92. package/bundles/taiga-ui-cdk-directives.umd.min.js +1 -1
  93. package/bundles/taiga-ui-cdk-enums.umd.js +11 -11
  94. package/bundles/taiga-ui-cdk-enums.umd.js.map +1 -1
  95. package/bundles/taiga-ui-cdk-enums.umd.min.js +1 -1
  96. package/bundles/taiga-ui-cdk-enums.umd.min.js.map +1 -1
  97. package/bundles/taiga-ui-cdk-observables.umd.js.map +1 -1
  98. package/bundles/taiga-ui-cdk-observables.umd.min.js.map +1 -1
  99. package/bundles/taiga-ui-cdk-pipes-filter.umd.js.map +1 -1
  100. package/bundles/taiga-ui-cdk-pipes-filter.umd.min.js.map +1 -1
  101. package/bundles/taiga-ui-cdk-pipes-mapper.umd.js.map +1 -1
  102. package/bundles/taiga-ui-cdk-pipes-mapper.umd.min.js.map +1 -1
  103. package/bundles/taiga-ui-cdk-services.umd.js +38 -38
  104. package/bundles/taiga-ui-cdk-services.umd.js.map +1 -1
  105. package/bundles/taiga-ui-cdk-services.umd.min.js +1 -1
  106. package/bundles/taiga-ui-cdk-services.umd.min.js.map +1 -1
  107. package/bundles/taiga-ui-cdk-tokens.umd.js +7 -7
  108. package/bundles/taiga-ui-cdk-tokens.umd.js.map +1 -1
  109. package/bundles/taiga-ui-cdk-tokens.umd.min.js +1 -1
  110. package/bundles/taiga-ui-cdk-tokens.umd.min.js.map +1 -1
  111. package/bundles/taiga-ui-cdk-utils-dom.umd.js +7 -7
  112. package/bundles/taiga-ui-cdk-utils-dom.umd.js.map +1 -1
  113. package/bundles/taiga-ui-cdk-utils-dom.umd.min.js.map +1 -1
  114. package/bundles/taiga-ui-cdk-utils-focus.umd.js.map +1 -1
  115. package/bundles/taiga-ui-cdk-utils-focus.umd.min.js.map +1 -1
  116. package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js +14 -14
  117. package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js.map +1 -1
  118. package/components/dialog-host/taiga-ui-cdk-components-dialog-host.metadata.json +1 -1
  119. package/components/portal-host/taiga-ui-cdk-components-portal-host.metadata.json +1 -1
  120. package/constants/taiga-ui-cdk-constants.metadata.json +1 -1
  121. package/date-time/day-range.d.ts +14 -14
  122. package/date-time/day.d.ts +57 -57
  123. package/date-time/index.d.ts +4 -4
  124. package/date-time/month-range.d.ts +1 -1
  125. package/date-time/month.d.ts +26 -26
  126. package/date-time/taiga-ui-cdk-date-time.metadata.json +1 -1
  127. package/date-time/time.d.ts +12 -12
  128. package/date-time/year.d.ts +27 -27
  129. package/directives/active-zone/taiga-ui-cdk-directives-active-zone.metadata.json +1 -1
  130. package/directives/auto-focus/taiga-ui-cdk-directives-auto-focus.metadata.json +1 -1
  131. package/directives/autofilled/taiga-ui-cdk-directives-autofilled.metadata.json +1 -1
  132. package/directives/checked/taiga-ui-cdk-directives-checked.metadata.json +1 -1
  133. package/directives/copy-processor/copy-processor.directive.d.ts +7 -0
  134. package/directives/copy-processor/copy-processor.module.d.ts +2 -0
  135. package/directives/copy-processor/index.d.ts +2 -0
  136. package/directives/copy-processor/package.json +13 -0
  137. package/directives/copy-processor/taiga-ui-cdk-directives-copy-processor.d.ts +4 -0
  138. package/directives/copy-processor/taiga-ui-cdk-directives-copy-processor.metadata.json +1 -0
  139. package/directives/drag/taiga-ui-cdk-directives-drag.metadata.json +1 -1
  140. package/directives/droppable/taiga-ui-cdk-directives-droppable.metadata.json +1 -1
  141. package/directives/element/taiga-ui-cdk-directives-element.metadata.json +1 -1
  142. package/directives/focus-trap/taiga-ui-cdk-directives-focus-trap.metadata.json +1 -1
  143. package/directives/focus-visible/taiga-ui-cdk-directives-focus-visible.metadata.json +1 -1
  144. package/directives/focusable/taiga-ui-cdk-directives-focusable.metadata.json +1 -1
  145. package/directives/focused/taiga-ui-cdk-directives-focused.metadata.json +1 -1
  146. package/directives/for/for.directive.d.ts +1 -1
  147. package/directives/for/taiga-ui-cdk-directives-for.metadata.json +1 -1
  148. package/directives/high-dpi/taiga-ui-cdk-directives-high-dpi.metadata.json +1 -1
  149. package/directives/hovered/taiga-ui-cdk-directives-hovered.metadata.json +1 -1
  150. package/directives/index.d.ts +5 -4
  151. package/directives/input-mode/taiga-ui-cdk-directives-input-mode.metadata.json +1 -1
  152. package/directives/item/index.d.ts +2 -0
  153. package/directives/item/item.directive.d.ts +6 -0
  154. package/directives/item/item.module.d.ts +2 -0
  155. package/directives/item/package.json +13 -0
  156. package/directives/item/taiga-ui-cdk-directives-item.d.ts +4 -0
  157. package/directives/item/taiga-ui-cdk-directives-item.metadata.json +1 -0
  158. package/directives/let/taiga-ui-cdk-directives-let.metadata.json +1 -1
  159. package/directives/media/media.directive.d.ts +1 -1
  160. package/directives/media/taiga-ui-cdk-directives-media.metadata.json +1 -1
  161. package/directives/obscured/taiga-ui-cdk-directives-obscured.metadata.json +1 -1
  162. package/directives/overscroll/taiga-ui-cdk-directives-overscroll.metadata.json +1 -1
  163. package/directives/pan/pan.directive.d.ts +3 -3
  164. package/directives/pan/taiga-ui-cdk-directives-pan.metadata.json +1 -1
  165. package/directives/pressed/taiga-ui-cdk-directives-pressed.metadata.json +1 -1
  166. package/directives/prevent-default/taiga-ui-cdk-directives-prevent-default.metadata.json +1 -1
  167. package/directives/repeat-times/taiga-ui-cdk-directives-repeat-times.metadata.json +1 -1
  168. package/directives/resize/taiga-ui-cdk-directives-resize.metadata.json +1 -1
  169. package/directives/swipe/swipe.directive.d.ts +4 -3
  170. package/directives/swipe/taiga-ui-cdk-directives-swipe.metadata.json +1 -1
  171. package/directives/taiga-ui-cdk-directives.metadata.json +1 -1
  172. package/directives/validator/taiga-ui-cdk-directives-validator.metadata.json +1 -1
  173. package/directives/zoom/taiga-ui-cdk-directives-zoom.metadata.json +1 -1
  174. package/directives/zoom/zoom.directive.d.ts +4 -3
  175. package/enums/index.d.ts +1 -1
  176. package/enums/taiga-ui-cdk-enums.metadata.json +1 -1
  177. package/esm2015/abstract/control.js +1 -1
  178. package/esm2015/abstract/dialog.directive.js +35 -0
  179. package/esm2015/abstract/index.js +2 -1
  180. package/esm2015/abstract/interactive.js +4 -4
  181. package/esm2015/abstract/multiple-control.js +1 -1
  182. package/esm2015/abstract/nullable-control.js +1 -1
  183. package/esm2015/components/dialog-host/dialog-host.component.js +2 -2
  184. package/esm2015/components/dialog-host/dialog-host.module.js +1 -1
  185. package/esm2015/components/portal-host/portal-host.component.js +1 -1
  186. package/esm2015/components/portal-host/portal-host.module.js +1 -1
  187. package/esm2015/components/portal-host/portal.service.js +1 -1
  188. package/esm2015/constants/matcher.js +1 -1
  189. package/esm2015/date-time/date-fillers.js +1 -1
  190. package/esm2015/date-time/day-range.js +26 -26
  191. package/esm2015/date-time/day.js +120 -120
  192. package/esm2015/date-time/index.js +5 -5
  193. package/esm2015/date-time/month-range.js +6 -6
  194. package/esm2015/date-time/month.js +56 -56
  195. package/esm2015/date-time/time.js +40 -40
  196. package/esm2015/date-time/year.js +49 -49
  197. package/esm2015/directives/active-zone/active-zone.module.js +1 -1
  198. package/esm2015/directives/auto-focus/autofocus.module.js +1 -1
  199. package/esm2015/directives/autofilled/autofilled.module.js +1 -1
  200. package/esm2015/directives/checked/checked.module.js +1 -1
  201. package/esm2015/directives/copy-processor/copy-processor.directive.js +37 -0
  202. package/esm2015/directives/copy-processor/copy-processor.module.js +13 -0
  203. package/esm2015/directives/copy-processor/index.js +3 -0
  204. package/esm2015/directives/copy-processor/taiga-ui-cdk-directives-copy-processor.js +5 -0
  205. package/esm2015/directives/drag/drag.module.js +1 -1
  206. package/esm2015/directives/droppable/droppable.module.js +1 -1
  207. package/esm2015/directives/element/element.module.js +1 -1
  208. package/esm2015/directives/focus-trap/focus-trap.module.js +1 -1
  209. package/esm2015/directives/focus-visible/focus-visible.module.js +1 -1
  210. package/esm2015/directives/focusable/focusable.module.js +1 -1
  211. package/esm2015/directives/focused/focused.module.js +1 -1
  212. package/esm2015/directives/for/for.directive.js +1 -1
  213. package/esm2015/directives/for/for.module.js +1 -1
  214. package/esm2015/directives/high-dpi/high-dpi.module.js +1 -1
  215. package/esm2015/directives/hovered/hovered.module.js +1 -1
  216. package/esm2015/directives/index.js +6 -5
  217. package/esm2015/directives/input-mode/input-mode.module.js +1 -1
  218. package/esm2015/directives/item/index.js +3 -0
  219. package/esm2015/directives/item/item.directive.js +15 -0
  220. package/esm2015/directives/item/item.module.js +13 -0
  221. package/esm2015/directives/item/taiga-ui-cdk-directives-item.js +5 -0
  222. package/esm2015/directives/let/let.directive.js +1 -1
  223. package/esm2015/directives/let/let.module.js +1 -1
  224. package/esm2015/directives/media/media.directive.js +2 -2
  225. package/esm2015/directives/media/media.module.js +1 -1
  226. package/esm2015/directives/obscured/obscured.module.js +1 -1
  227. package/esm2015/directives/overscroll/overscroll.module.js +1 -1
  228. package/esm2015/directives/pan/pan.directive.js +3 -2
  229. package/esm2015/directives/pan/pan.module.js +1 -1
  230. package/esm2015/directives/pressed/pressed.module.js +1 -1
  231. package/esm2015/directives/prevent-default/prevent-default.module.js +1 -1
  232. package/esm2015/directives/repeat-times/repeat-times.module.js +1 -1
  233. package/esm2015/directives/resize/resize.module.js +1 -1
  234. package/esm2015/directives/swipe/swipe.directive.js +3 -2
  235. package/esm2015/directives/swipe/swipe.module.js +1 -1
  236. package/esm2015/directives/validator/validator.module.js +1 -1
  237. package/esm2015/directives/zoom/zoom.directive.js +3 -2
  238. package/esm2015/directives/zoom/zoom.module.js +1 -1
  239. package/esm2015/enums/index.js +2 -2
  240. package/esm2015/interfaces/base-dialog-context.js +1 -1
  241. package/esm2015/interfaces/base-dialog.js +1 -1
  242. package/esm2015/interfaces/focusable-element-accessor.js +1 -1
  243. package/esm2015/interfaces/index.js +1 -1
  244. package/esm2015/observables/drag-and-drop-from.js +1 -1
  245. package/esm2015/observables/focus-visible-observable.js +1 -1
  246. package/esm2015/observables/mouse-drag-finish-from.js +1 -1
  247. package/esm2015/observables/pressed-observable.js +1 -1
  248. package/esm2015/pipes/filter/filter.module.js +1 -1
  249. package/esm2015/pipes/mapper/mapper.module.js +1 -1
  250. package/esm2015/services/focus-visible.service.js +1 -1
  251. package/esm2015/services/index.js +2 -2
  252. package/esm2015/services/obscured.service.js +1 -1
  253. package/esm2015/services/pan.service.js +3 -3
  254. package/esm2015/services/resize.service.js +1 -1
  255. package/esm2015/services/static-request.service.js +1 -1
  256. package/esm2015/tokens/active-element.js +1 -1
  257. package/esm2015/tokens/index.js +3 -3
  258. package/esm2015/tokens/is-android.js +1 -1
  259. package/esm2015/types/index.js +1 -1
  260. package/esm2015/utils/dom/get-element-obscurers.js +1 -1
  261. package/esm2015/utils/dom/index.js +2 -2
  262. package/esm2015/utils/focus/get-closest-keyboard-focusable.js +1 -1
  263. package/esm2015/utils/miscellaneous/index.js +3 -3
  264. package/esm5/abstract/control.js +1 -1
  265. package/esm5/abstract/dialog.directive.js +44 -0
  266. package/esm5/abstract/index.js +2 -1
  267. package/esm5/abstract/interactive.js +4 -4
  268. package/esm5/abstract/multiple-control.js +1 -1
  269. package/esm5/abstract/nullable-control.js +1 -1
  270. package/esm5/components/dialog-host/dialog-host.component.js +2 -2
  271. package/esm5/components/dialog-host/dialog-host.module.js +1 -1
  272. package/esm5/components/portal-host/portal-host.component.js +1 -1
  273. package/esm5/components/portal-host/portal-host.module.js +1 -1
  274. package/esm5/components/portal-host/portal.service.js +1 -1
  275. package/esm5/constants/matcher.js +1 -1
  276. package/esm5/date-time/date-fillers.js +1 -1
  277. package/esm5/date-time/day-range.js +26 -26
  278. package/esm5/date-time/day.js +120 -120
  279. package/esm5/date-time/index.js +5 -5
  280. package/esm5/date-time/month-range.js +6 -6
  281. package/esm5/date-time/month.js +56 -56
  282. package/esm5/date-time/time.js +41 -41
  283. package/esm5/date-time/year.js +49 -49
  284. package/esm5/directives/active-zone/active-zone.module.js +1 -1
  285. package/esm5/directives/auto-focus/autofocus.module.js +1 -1
  286. package/esm5/directives/autofilled/autofilled.module.js +1 -1
  287. package/esm5/directives/checked/checked.module.js +1 -1
  288. package/esm5/directives/copy-processor/copy-processor.directive.js +38 -0
  289. package/esm5/directives/copy-processor/copy-processor.module.js +16 -0
  290. package/esm5/directives/copy-processor/index.js +3 -0
  291. package/esm5/directives/copy-processor/taiga-ui-cdk-directives-copy-processor.js +5 -0
  292. package/esm5/directives/drag/drag.module.js +1 -1
  293. package/esm5/directives/droppable/droppable.module.js +1 -1
  294. package/esm5/directives/element/element.module.js +1 -1
  295. package/esm5/directives/focus-trap/focus-trap.module.js +1 -1
  296. package/esm5/directives/focus-visible/focus-visible.module.js +1 -1
  297. package/esm5/directives/focusable/focusable.module.js +1 -1
  298. package/esm5/directives/focused/focused.module.js +1 -1
  299. package/esm5/directives/for/for.directive.js +1 -1
  300. package/esm5/directives/for/for.module.js +1 -1
  301. package/esm5/directives/high-dpi/high-dpi.module.js +1 -1
  302. package/esm5/directives/hovered/hovered.module.js +1 -1
  303. package/esm5/directives/index.js +6 -5
  304. package/esm5/directives/input-mode/input-mode.module.js +1 -1
  305. package/esm5/directives/item/index.js +3 -0
  306. package/esm5/directives/item/item.directive.js +18 -0
  307. package/esm5/directives/item/item.module.js +16 -0
  308. package/esm5/directives/item/taiga-ui-cdk-directives-item.js +5 -0
  309. package/esm5/directives/let/let.directive.js +1 -1
  310. package/esm5/directives/let/let.module.js +1 -1
  311. package/esm5/directives/media/media.directive.js +2 -2
  312. package/esm5/directives/media/media.module.js +1 -1
  313. package/esm5/directives/obscured/obscured.module.js +1 -1
  314. package/esm5/directives/overscroll/overscroll.module.js +1 -1
  315. package/esm5/directives/pan/pan.directive.js +3 -2
  316. package/esm5/directives/pan/pan.module.js +1 -1
  317. package/esm5/directives/pressed/pressed.module.js +1 -1
  318. package/esm5/directives/prevent-default/prevent-default.module.js +1 -1
  319. package/esm5/directives/repeat-times/repeat-times.module.js +1 -1
  320. package/esm5/directives/resize/resize.module.js +1 -1
  321. package/esm5/directives/swipe/swipe.directive.js +3 -2
  322. package/esm5/directives/swipe/swipe.module.js +1 -1
  323. package/esm5/directives/validator/validator.module.js +1 -1
  324. package/esm5/directives/zoom/zoom.directive.js +3 -2
  325. package/esm5/directives/zoom/zoom.module.js +1 -1
  326. package/esm5/enums/index.js +2 -2
  327. package/esm5/interfaces/base-dialog-context.js +1 -1
  328. package/esm5/interfaces/base-dialog.js +1 -1
  329. package/esm5/interfaces/focusable-element-accessor.js +1 -1
  330. package/esm5/interfaces/index.js +1 -1
  331. package/esm5/observables/drag-and-drop-from.js +1 -1
  332. package/esm5/observables/focus-visible-observable.js +1 -1
  333. package/esm5/observables/mouse-drag-finish-from.js +1 -1
  334. package/esm5/observables/pressed-observable.js +1 -1
  335. package/esm5/pipes/filter/filter.module.js +1 -1
  336. package/esm5/pipes/mapper/mapper.module.js +1 -1
  337. package/esm5/services/focus-visible.service.js +1 -1
  338. package/esm5/services/index.js +2 -2
  339. package/esm5/services/obscured.service.js +1 -1
  340. package/esm5/services/pan.service.js +3 -3
  341. package/esm5/services/resize.service.js +1 -1
  342. package/esm5/services/static-request.service.js +1 -1
  343. package/esm5/tokens/active-element.js +1 -1
  344. package/esm5/tokens/index.js +3 -3
  345. package/esm5/tokens/is-android.js +1 -1
  346. package/esm5/types/index.js +1 -1
  347. package/esm5/utils/dom/get-element-obscurers.js +1 -1
  348. package/esm5/utils/dom/index.js +2 -2
  349. package/esm5/utils/focus/get-closest-keyboard-focusable.js +1 -1
  350. package/esm5/utils/miscellaneous/index.js +3 -3
  351. package/fesm2015/taiga-ui-cdk-abstract.js +36 -7
  352. package/fesm2015/taiga-ui-cdk-abstract.js.map +1 -1
  353. package/fesm2015/taiga-ui-cdk-components-dialog-host.js.map +1 -1
  354. package/fesm2015/taiga-ui-cdk-components-portal-host.js.map +1 -1
  355. package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
  356. package/fesm2015/taiga-ui-cdk-date-time.js +343 -343
  357. package/fesm2015/taiga-ui-cdk-date-time.js.map +1 -1
  358. package/fesm2015/taiga-ui-cdk-directives-active-zone.js.map +1 -1
  359. package/fesm2015/taiga-ui-cdk-directives-auto-focus.js.map +1 -1
  360. package/fesm2015/taiga-ui-cdk-directives-autofilled.js.map +1 -1
  361. package/fesm2015/taiga-ui-cdk-directives-checked.js.map +1 -1
  362. package/fesm2015/taiga-ui-cdk-directives-copy-processor.js +52 -0
  363. package/fesm2015/taiga-ui-cdk-directives-copy-processor.js.map +1 -0
  364. package/fesm2015/taiga-ui-cdk-directives-drag.js.map +1 -1
  365. package/fesm2015/taiga-ui-cdk-directives-droppable.js.map +1 -1
  366. package/fesm2015/taiga-ui-cdk-directives-element.js.map +1 -1
  367. package/fesm2015/taiga-ui-cdk-directives-focus-trap.js.map +1 -1
  368. package/fesm2015/taiga-ui-cdk-directives-focus-visible.js.map +1 -1
  369. package/fesm2015/taiga-ui-cdk-directives-focusable.js.map +1 -1
  370. package/fesm2015/taiga-ui-cdk-directives-focused.js.map +1 -1
  371. package/fesm2015/taiga-ui-cdk-directives-for.js.map +1 -1
  372. package/fesm2015/taiga-ui-cdk-directives-high-dpi.js.map +1 -1
  373. package/fesm2015/taiga-ui-cdk-directives-hovered.js.map +1 -1
  374. package/fesm2015/taiga-ui-cdk-directives-input-mode.js.map +1 -1
  375. package/fesm2015/taiga-ui-cdk-directives-item.js +30 -0
  376. package/fesm2015/taiga-ui-cdk-directives-item.js.map +1 -0
  377. package/fesm2015/taiga-ui-cdk-directives-let.js.map +1 -1
  378. package/fesm2015/taiga-ui-cdk-directives-media.js +1 -1
  379. package/fesm2015/taiga-ui-cdk-directives-media.js.map +1 -1
  380. package/fesm2015/taiga-ui-cdk-directives-obscured.js.map +1 -1
  381. package/fesm2015/taiga-ui-cdk-directives-overscroll.js.map +1 -1
  382. package/fesm2015/taiga-ui-cdk-directives-pan.js +2 -1
  383. package/fesm2015/taiga-ui-cdk-directives-pan.js.map +1 -1
  384. package/fesm2015/taiga-ui-cdk-directives-pressed.js.map +1 -1
  385. package/fesm2015/taiga-ui-cdk-directives-prevent-default.js.map +1 -1
  386. package/fesm2015/taiga-ui-cdk-directives-repeat-times.js.map +1 -1
  387. package/fesm2015/taiga-ui-cdk-directives-resize.js.map +1 -1
  388. package/fesm2015/taiga-ui-cdk-directives-swipe.js +2 -1
  389. package/fesm2015/taiga-ui-cdk-directives-swipe.js.map +1 -1
  390. package/fesm2015/taiga-ui-cdk-directives-validator.js.map +1 -1
  391. package/fesm2015/taiga-ui-cdk-directives-zoom.js +2 -1
  392. package/fesm2015/taiga-ui-cdk-directives-zoom.js.map +1 -1
  393. package/fesm2015/taiga-ui-cdk-directives.js +5 -4
  394. package/fesm2015/taiga-ui-cdk-directives.js.map +1 -1
  395. package/fesm2015/taiga-ui-cdk-enums.js +11 -11
  396. package/fesm2015/taiga-ui-cdk-enums.js.map +1 -1
  397. package/fesm2015/taiga-ui-cdk-observables.js.map +1 -1
  398. package/fesm2015/taiga-ui-cdk-pipes-filter.js.map +1 -1
  399. package/fesm2015/taiga-ui-cdk-pipes-mapper.js.map +1 -1
  400. package/fesm2015/taiga-ui-cdk-services.js +29 -29
  401. package/fesm2015/taiga-ui-cdk-services.js.map +1 -1
  402. package/fesm2015/taiga-ui-cdk-tokens.js +7 -7
  403. package/fesm2015/taiga-ui-cdk-tokens.js.map +1 -1
  404. package/fesm2015/taiga-ui-cdk-utils-dom.js +7 -7
  405. package/fesm2015/taiga-ui-cdk-utils-dom.js.map +1 -1
  406. package/fesm2015/taiga-ui-cdk-utils-focus.js.map +1 -1
  407. package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js +13 -13
  408. package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js.map +1 -1
  409. package/fesm5/taiga-ui-cdk-abstract.js +45 -7
  410. package/fesm5/taiga-ui-cdk-abstract.js.map +1 -1
  411. package/fesm5/taiga-ui-cdk-components-dialog-host.js.map +1 -1
  412. package/fesm5/taiga-ui-cdk-components-portal-host.js.map +1 -1
  413. package/fesm5/taiga-ui-cdk-constants.js.map +1 -1
  414. package/fesm5/taiga-ui-cdk-date-time.js +343 -343
  415. package/fesm5/taiga-ui-cdk-date-time.js.map +1 -1
  416. package/fesm5/taiga-ui-cdk-directives-active-zone.js.map +1 -1
  417. package/fesm5/taiga-ui-cdk-directives-auto-focus.js.map +1 -1
  418. package/fesm5/taiga-ui-cdk-directives-autofilled.js.map +1 -1
  419. package/fesm5/taiga-ui-cdk-directives-checked.js.map +1 -1
  420. package/fesm5/taiga-ui-cdk-directives-copy-processor.js +56 -0
  421. package/fesm5/taiga-ui-cdk-directives-copy-processor.js.map +1 -0
  422. package/fesm5/taiga-ui-cdk-directives-drag.js.map +1 -1
  423. package/fesm5/taiga-ui-cdk-directives-droppable.js.map +1 -1
  424. package/fesm5/taiga-ui-cdk-directives-element.js.map +1 -1
  425. package/fesm5/taiga-ui-cdk-directives-focus-trap.js.map +1 -1
  426. package/fesm5/taiga-ui-cdk-directives-focus-visible.js.map +1 -1
  427. package/fesm5/taiga-ui-cdk-directives-focusable.js.map +1 -1
  428. package/fesm5/taiga-ui-cdk-directives-focused.js.map +1 -1
  429. package/fesm5/taiga-ui-cdk-directives-for.js.map +1 -1
  430. package/fesm5/taiga-ui-cdk-directives-high-dpi.js.map +1 -1
  431. package/fesm5/taiga-ui-cdk-directives-hovered.js.map +1 -1
  432. package/fesm5/taiga-ui-cdk-directives-input-mode.js.map +1 -1
  433. package/fesm5/taiga-ui-cdk-directives-item.js +36 -0
  434. package/fesm5/taiga-ui-cdk-directives-item.js.map +1 -0
  435. package/fesm5/taiga-ui-cdk-directives-let.js.map +1 -1
  436. package/fesm5/taiga-ui-cdk-directives-media.js +1 -1
  437. package/fesm5/taiga-ui-cdk-directives-media.js.map +1 -1
  438. package/fesm5/taiga-ui-cdk-directives-obscured.js.map +1 -1
  439. package/fesm5/taiga-ui-cdk-directives-overscroll.js.map +1 -1
  440. package/fesm5/taiga-ui-cdk-directives-pan.js +2 -1
  441. package/fesm5/taiga-ui-cdk-directives-pan.js.map +1 -1
  442. package/fesm5/taiga-ui-cdk-directives-pressed.js.map +1 -1
  443. package/fesm5/taiga-ui-cdk-directives-prevent-default.js.map +1 -1
  444. package/fesm5/taiga-ui-cdk-directives-repeat-times.js.map +1 -1
  445. package/fesm5/taiga-ui-cdk-directives-resize.js.map +1 -1
  446. package/fesm5/taiga-ui-cdk-directives-swipe.js +2 -1
  447. package/fesm5/taiga-ui-cdk-directives-swipe.js.map +1 -1
  448. package/fesm5/taiga-ui-cdk-directives-validator.js.map +1 -1
  449. package/fesm5/taiga-ui-cdk-directives-zoom.js +2 -1
  450. package/fesm5/taiga-ui-cdk-directives-zoom.js.map +1 -1
  451. package/fesm5/taiga-ui-cdk-directives.js +5 -4
  452. package/fesm5/taiga-ui-cdk-directives.js.map +1 -1
  453. package/fesm5/taiga-ui-cdk-enums.js +11 -11
  454. package/fesm5/taiga-ui-cdk-enums.js.map +1 -1
  455. package/fesm5/taiga-ui-cdk-observables.js.map +1 -1
  456. package/fesm5/taiga-ui-cdk-pipes-filter.js.map +1 -1
  457. package/fesm5/taiga-ui-cdk-pipes-mapper.js.map +1 -1
  458. package/fesm5/taiga-ui-cdk-services.js +39 -39
  459. package/fesm5/taiga-ui-cdk-services.js.map +1 -1
  460. package/fesm5/taiga-ui-cdk-tokens.js +7 -7
  461. package/fesm5/taiga-ui-cdk-tokens.js.map +1 -1
  462. package/fesm5/taiga-ui-cdk-utils-dom.js +7 -7
  463. package/fesm5/taiga-ui-cdk-utils-dom.js.map +1 -1
  464. package/fesm5/taiga-ui-cdk-utils-focus.js.map +1 -1
  465. package/fesm5/taiga-ui-cdk-utils-miscellaneous.js +14 -14
  466. package/fesm5/taiga-ui-cdk-utils-miscellaneous.js.map +1 -1
  467. package/interfaces/focusable-element-accessor.d.ts +2 -0
  468. package/interfaces/index.d.ts +1 -1
  469. package/interfaces/taiga-ui-cdk-interfaces.metadata.json +1 -1
  470. package/observables/taiga-ui-cdk-observables.metadata.json +1 -1
  471. package/package.json +2 -2
  472. package/pipes/filter/taiga-ui-cdk-pipes-filter.metadata.json +1 -1
  473. package/pipes/mapper/taiga-ui-cdk-pipes-mapper.metadata.json +1 -1
  474. package/services/index.d.ts +1 -1
  475. package/services/taiga-ui-cdk-services.metadata.json +1 -1
  476. package/tokens/index.d.ts +2 -2
  477. package/tokens/taiga-ui-cdk-tokens.metadata.json +1 -1
  478. package/types/index.d.ts +1 -1
  479. package/types/taiga-ui-cdk-types.metadata.json +1 -1
  480. package/utils/dom/index.d.ts +1 -1
  481. package/utils/dom/taiga-ui-cdk-utils-dom.metadata.json +1 -1
  482. package/utils/miscellaneous/index.d.ts +2 -2
  483. package/utils/miscellaneous/taiga-ui-cdk-utils-miscellaneous.metadata.json +1 -1
@@ -1,8 +1,8 @@
1
+ import { InjectionToken, inject } from '@angular/core';
2
+ import { CHAR_NO_BREAK_SPACE, CHAR_EN_DASH } from '@taiga-ui/cdk/constants';
1
3
  import { tuiAssert } from '@taiga-ui/cdk/classes';
2
4
  import { padStart } from '@taiga-ui/cdk/utils/format';
3
5
  import { inRange, normalizeToIntNumber } from '@taiga-ui/cdk/utils/math';
4
- import { CHAR_NO_BREAK_SPACE, CHAR_EN_DASH } from '@taiga-ui/cdk/constants';
5
- import { InjectionToken, inject } from '@angular/core';
6
6
 
7
7
  const DAYS_IN_WEEK = 7;
8
8
  const DAYS_IN_NORMAL_YEAR = 365;
@@ -22,6 +22,44 @@ const MILLISECONDS_IN_MINUTE = MILLISECONDS_IN_SECOND * SECONDS_IN_MINUTE;
22
22
  const MILLISECONDS_IN_HOUR = MILLISECONDS_IN_MINUTE * MINUTES_IN_HOUR;
23
23
  const MILLISECONDS_IN_DAY = MILLISECONDS_IN_HOUR * HOURS_IN_DAY;
24
24
 
25
+ /**
26
+ * @deprecated dont use it. See {@link TUI_DATE_FORMAT}
27
+ * TODO: get rid of this in v3.0
28
+ */
29
+ const TUI_DATE_FILLER = new InjectionToken('date filler for Taiga UI', {
30
+ factory: () => `dd.mm.yyyy`,
31
+ });
32
+ /**
33
+ * @deprecated dont use it
34
+ * TODO: get rid of this in v3.0
35
+ */
36
+ const TUI_DATE_RANGE_FILLER = new InjectionToken('date range filler for Taiga UI', {
37
+ factory: () => {
38
+ const dateFiller = inject(TUI_DATE_FILLER);
39
+ return `${dateFiller}${RANGE_SEPARATOR_CHAR}${dateFiller}`;
40
+ },
41
+ });
42
+ /**
43
+ * @internal 'dd.mm.yyyy'.length
44
+ * Used in:
45
+ * - {@link TuiInputDateComponent}
46
+ * - {@link TuiInputDateRangeComponent}
47
+ * - {@link TuiInputDateTimeComponent}
48
+ */
49
+ const DATE_FILLER_LENGTH = 10;
50
+ /**
51
+ * @internal
52
+ * Used in {@link TuiInputDateRangeComponent}
53
+ */
54
+ const DATE_RANGE_FILLER_LENGTH = 2 * DATE_FILLER_LENGTH + RANGE_SEPARATOR_CHAR.length;
55
+
56
+ /**
57
+ * TODO This token supports only DMY now. Add other {@link TuiDateMode} support
58
+ */
59
+ const TUI_DATE_FORMAT = new InjectionToken('Active date format for Taiga UI', {
60
+ factory: () => 'DMY',
61
+ });
62
+
25
63
  /**
26
64
  * Immutable year object
27
65
  * @nosideeffects
@@ -31,6 +69,54 @@ class TuiYear {
31
69
  this.year = year;
32
70
  tuiAssert.assert(TuiYear.isValidYear(year));
33
71
  }
72
+ /**
73
+ * Checks year for validity
74
+ */
75
+ static isValidYear(year) {
76
+ return Number.isInteger(year) && inRange(year, MIN_YEAR, MAX_YEAR + 1);
77
+ }
78
+ /**
79
+ * Check if passed year is a leap year
80
+ */
81
+ static isLeapYear(year) {
82
+ tuiAssert.assert(TuiYear.isValidYear(year));
83
+ return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0);
84
+ }
85
+ /**
86
+ * Returns amount of leap years from year 0 to the passed one
87
+ */
88
+ static getAbsoluteLeapYears(year) {
89
+ tuiAssert.assert(TuiYear.isValidYear(year));
90
+ return Math.ceil(year / 400) + (Math.ceil(year / 4) - Math.ceil(year / 100));
91
+ }
92
+ /**
93
+ * @deprecated DONT USE IT (will be deleted soon)
94
+ *
95
+ * Returns day of week offset of the beginning of the passed year
96
+ *
97
+ * @param year
98
+ * @param absoluteLeapYears amount of leap years prior to the passed one
99
+ * @return offset in days
100
+ */
101
+ static getYearStartDaysOffset(year, absoluteLeapYears) {
102
+ tuiAssert.assert(TuiYear.isValidYear(year));
103
+ tuiAssert.assert(Number.isInteger(absoluteLeapYears));
104
+ tuiAssert.assert(year >= absoluteLeapYears);
105
+ tuiAssert.assert(absoluteLeapYears >= 0);
106
+ return ((absoluteLeapYears * DAYS_IN_LEAP_YEAR +
107
+ (year - absoluteLeapYears) * DAYS_IN_NORMAL_YEAR +
108
+ 5) %
109
+ DAYS_IN_WEEK);
110
+ }
111
+ static lengthBetween(from, to) {
112
+ return to.year - from.year;
113
+ }
114
+ /**
115
+ * Normalizes year by clamping it between min and max years
116
+ */
117
+ static normalizeYearPart(year) {
118
+ return normalizeToIntNumber(year, MIN_YEAR, MAX_YEAR);
119
+ }
34
120
  get formattedYear() {
35
121
  return padStart(this.year.toString(), 4, '0');
36
122
  }
@@ -100,68 +186,75 @@ class TuiYear {
100
186
  toJSON() {
101
187
  return this.formattedYear;
102
188
  }
189
+ }
190
+
191
+ /**
192
+ * Immutable object consisting of year and month
193
+ */
194
+ class TuiMonth extends TuiYear {
103
195
  /**
104
- * Checks year for validity
196
+ * @param year
197
+ * @param month (starting with 0)
105
198
  */
106
- static isValidYear(year) {
107
- return Number.isInteger(year) && inRange(year, MIN_YEAR, MAX_YEAR + 1);
199
+ constructor(year, month) {
200
+ super(year);
201
+ this.month = month;
202
+ tuiAssert.assert(TuiMonth.isValidMonth(year, month));
108
203
  }
109
204
  /**
110
- * Check if passed year is a leap year
205
+ * Tests month and year for validity
111
206
  */
112
- static isLeapYear(year) {
113
- tuiAssert.assert(TuiYear.isValidYear(year));
114
- return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0);
207
+ static isValidMonth(year, month) {
208
+ return TuiYear.isValidYear(year) && TuiMonth.isValidMonthPart(month);
115
209
  }
116
210
  /**
117
- * Returns amount of leap years from year 0 to the passed one
211
+ * Returns number of days in a month
118
212
  */
119
- static getAbsoluteLeapYears(year) {
120
- tuiAssert.assert(TuiYear.isValidYear(year));
121
- return Math.ceil(year / 400) + (Math.ceil(year / 4) - Math.ceil(year / 100));
213
+ static getMonthDaysCount(month, isLeapYear) {
214
+ tuiAssert.assert(TuiMonth.isValidMonthPart(month));
215
+ switch (month) {
216
+ case 1 /* February */:
217
+ return isLeapYear ? 29 : 28;
218
+ case 3 /* April */:
219
+ case 5 /* June */:
220
+ case 8 /* September */:
221
+ case 10 /* November */:
222
+ return 30;
223
+ default:
224
+ return 31;
225
+ }
122
226
  }
123
227
  /**
124
- * @deprecated DONT USE IT (will be deleted soon)
125
- *
126
- * Returns day of week offset of the beginning of the passed year
127
- *
128
- * @param year
129
- * @param absoluteLeapYears amount of leap years prior to the passed one
130
- * @return offset in days
228
+ * Returns current month and year based on local time zone
229
+ * @nosideeffects
131
230
  */
132
- static getYearStartDaysOffset(year, absoluteLeapYears) {
133
- tuiAssert.assert(TuiYear.isValidYear(year));
134
- tuiAssert.assert(Number.isInteger(absoluteLeapYears));
135
- tuiAssert.assert(year >= absoluteLeapYears);
136
- tuiAssert.assert(absoluteLeapYears >= 0);
137
- return ((absoluteLeapYears * DAYS_IN_LEAP_YEAR +
138
- (year - absoluteLeapYears) * DAYS_IN_NORMAL_YEAR +
139
- 5) %
140
- DAYS_IN_WEEK);
231
+ static currentLocal() {
232
+ const nativeDate = new Date();
233
+ return new TuiMonth(nativeDate.getFullYear(), nativeDate.getMonth());
234
+ }
235
+ /**
236
+ * Returns current month and year based on UTC
237
+ */
238
+ static currentUtc() {
239
+ const nativeDate = new Date();
240
+ return new TuiMonth(nativeDate.getUTCFullYear(), nativeDate.getUTCMonth());
141
241
  }
142
242
  static lengthBetween(from, to) {
143
- return to.year - from.year;
243
+ const absoluteFrom = from.month + from.year * 12;
244
+ const absoluteTo = to.month + to.year * 12;
245
+ return absoluteTo - absoluteFrom;
144
246
  }
145
247
  /**
146
- * Normalizes year by clamping it between min and max years
248
+ * Normalizes number by clamping it between min and max month
147
249
  */
148
- static normalizeYearPart(year) {
149
- return normalizeToIntNumber(year, MIN_YEAR, MAX_YEAR);
250
+ static normalizeMonthPart(month) {
251
+ return normalizeToIntNumber(month, MIN_MONTH, MAX_MONTH);
150
252
  }
151
- }
152
-
153
- /**
154
- * Immutable object consisting of year and month
155
- */
156
- class TuiMonth extends TuiYear {
157
253
  /**
158
- * @param year
159
- * @param month (starting with 0)
254
+ * Tests month for validity
160
255
  */
161
- constructor(year, month) {
162
- super(year);
163
- this.month = month;
164
- tuiAssert.assert(TuiMonth.isValidMonth(year, month));
256
+ static isValidMonthPart(month) {
257
+ return Number.isInteger(month) && inRange(month, MIN_MONTH, MAX_MONTH + 1);
165
258
  }
166
259
  get formattedMonthPart() {
167
260
  return padStart((this.month + 1).toString(), 2, '0');
@@ -266,61 +359,6 @@ class TuiMonth extends TuiYear {
266
359
  toUtcNativeDate() {
267
360
  return new Date(Date.UTC(this.year, this.month));
268
361
  }
269
- /**
270
- * Tests month and year for validity
271
- */
272
- static isValidMonth(year, month) {
273
- return TuiYear.isValidYear(year) && TuiMonth.isValidMonthPart(month);
274
- }
275
- /**
276
- * Returns number of days in a month
277
- */
278
- static getMonthDaysCount(month, isLeapYear) {
279
- tuiAssert.assert(TuiMonth.isValidMonthPart(month));
280
- switch (month) {
281
- case 1 /* February */:
282
- return isLeapYear ? 29 : 28;
283
- case 3 /* April */:
284
- case 5 /* June */:
285
- case 8 /* September */:
286
- case 10 /* November */:
287
- return 30;
288
- default:
289
- return 31;
290
- }
291
- }
292
- /**
293
- * Returns current month and year based on local time zone
294
- * @nosideeffects
295
- */
296
- static currentLocal() {
297
- const nativeDate = new Date();
298
- return new TuiMonth(nativeDate.getFullYear(), nativeDate.getMonth());
299
- }
300
- /**
301
- * Returns current month and year based on UTC
302
- */
303
- static currentUtc() {
304
- const nativeDate = new Date();
305
- return new TuiMonth(nativeDate.getUTCFullYear(), nativeDate.getUTCMonth());
306
- }
307
- static lengthBetween(from, to) {
308
- const absoluteFrom = from.month + from.year * 12;
309
- const absoluteTo = to.month + to.year * 12;
310
- return absoluteTo - absoluteFrom;
311
- }
312
- /**
313
- * Normalizes number by clamping it between min and max month
314
- */
315
- static normalizeMonthPart(month) {
316
- return normalizeToIntNumber(month, MIN_MONTH, MAX_MONTH);
317
- }
318
- /**
319
- * Tests month for validity
320
- */
321
- static isValidMonthPart(month) {
322
- return Number.isInteger(month) && inRange(month, MIN_MONTH, MAX_MONTH + 1);
323
- }
324
362
  }
325
363
 
326
364
  // TODO: Localized formatting
@@ -333,24 +371,143 @@ class TuiDay extends TuiMonth {
333
371
  this.day = day;
334
372
  tuiAssert.assert(TuiDay.isValidDay(year, month, day));
335
373
  }
336
- get formattedDayPart() {
337
- return padStart(this.day.toString(), 2, '0');
338
- }
339
374
  /**
340
- * Formatted whole date
375
+ * Creates {@link TuiDay} from native {@link Date} based on local time zone
341
376
  */
342
- get formattedDay() {
343
- return `${this.formattedDayPart}.${this.formattedMonth}`;
344
- }
345
- get isWeekend() {
346
- const dayOfWeek = this.dayOfWeek(false);
347
- return dayOfWeek === 6 /* Saturday */ || dayOfWeek === 0 /* Sunday */;
377
+ static fromLocalNativeDate(date) {
378
+ return new TuiDay(date.getFullYear(), date.getMonth(), date.getDate());
348
379
  }
349
380
  /**
350
- * Returns day of week
351
- *
352
- * @param startFromMonday whether week starts from Monday and not from Sunday
353
- * @return day of week (from 0 to 6)
381
+ * Creates {@link TuiDay} from native {@link Date} using UTC
382
+ */
383
+ static fromUtcNativeDate(date) {
384
+ return new TuiDay(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
385
+ }
386
+ /**
387
+ * Check validity of year, month and day
388
+ *
389
+ * @param year
390
+ * @param month
391
+ * @param day
392
+ * @return boolean validity
393
+ */
394
+ static isValidDay(year, month, day) {
395
+ return (TuiMonth.isValidMonth(year, month) &&
396
+ Number.isInteger(day) &&
397
+ inRange(day, MIN_DAY, TuiMonth.getMonthDaysCount(month, TuiYear.isLeapYear(year)) + 1));
398
+ }
399
+ /**
400
+ * @deprecated DONT USE IT (will be deleted soon)
401
+ *
402
+ * Calculated day on a calendar grid
403
+ *
404
+ * @param month
405
+ * @param row row in a calendar
406
+ * @param col column in a calendar
407
+ * @return resulting day on these coordinates (could exceed passed month)
408
+ */
409
+ static getDayFromMonthRowCol(month, row, col) {
410
+ tuiAssert.assert(Number.isInteger(row));
411
+ tuiAssert.assert(inRange(row, 0, 6));
412
+ tuiAssert.assert(Number.isInteger(col));
413
+ tuiAssert.assert(inRange(col, 0, DAYS_IN_WEEK));
414
+ let day = row * DAYS_IN_WEEK + col - month.monthStartDaysOffset + 1;
415
+ if (day > month.daysCount) {
416
+ day = day - month.daysCount;
417
+ month = month.append({ month: 1 });
418
+ }
419
+ if (day <= 0) {
420
+ month = month.append({ month: -1 });
421
+ day = month.daysCount + day;
422
+ }
423
+ return new TuiDay(month.year, month.month, day);
424
+ }
425
+ /**
426
+ * Current day based on local time zone
427
+ */
428
+ static currentLocal() {
429
+ const nativeDate = new Date();
430
+ const year = nativeDate.getFullYear();
431
+ const month = nativeDate.getMonth();
432
+ const day = nativeDate.getDate();
433
+ return new TuiDay(year, month, day);
434
+ }
435
+ /**
436
+ * Calculates {@link TuiDay} normalizing year, month and day. {@link NaN} is turned into minimal value.
437
+ *
438
+ * @param year any year value, including invalid
439
+ * @param month any month value, including invalid (months start with 0)
440
+ * @param day any day value, including invalid
441
+ * @return normalized date
442
+ */
443
+ static normalizeOf(year, month, day) {
444
+ const normalizedYear = TuiYear.normalizeYearPart(year);
445
+ const normalizedMonth = TuiMonth.normalizeMonthPart(month);
446
+ const normalizedDay = TuiDay.normalizeDayPart(day, normalizedMonth, normalizedYear);
447
+ return new TuiDay(normalizedYear, normalizedMonth, normalizedDay);
448
+ }
449
+ static lengthBetween(from, to) {
450
+ return Math.round((to.toLocalNativeDate().getTime() - from.toLocalNativeDate().getTime()) /
451
+ (1000 * 60 * 60 * 24));
452
+ }
453
+ // TODO: Move month and year related code corresponding classes
454
+ /**
455
+ * Parsing a string with date with normalization
456
+ *
457
+ * @param yearMonthDayString date string in format of DD.MM.Yyyy
458
+ * @return normalized date
459
+ */
460
+ static normalizeParse(yearMonthDayString) {
461
+ const day = parseInt(yearMonthDayString.slice(0, 2), 10);
462
+ const month = parseInt(yearMonthDayString.slice(3, 5), 10) - 1;
463
+ const year = parseInt(yearMonthDayString.slice(6, 10), 10);
464
+ return TuiDay.normalizeOf(year, month, day);
465
+ }
466
+ /**
467
+ * Parsing a date stringified in a toJSON format
468
+ * @param yearMonthDayString date string in format of YYYY-MM-DD
469
+ * @return date
470
+ * @throws exceptions if any part of the date is invalid
471
+ */
472
+ static jsonParse(yearMonthDayString) {
473
+ const day = parseInt(yearMonthDayString.slice(8, 10), 10);
474
+ const month = parseInt(yearMonthDayString.slice(5, 7), 10) - 1;
475
+ const year = parseInt(yearMonthDayString.slice(0, 4), 10);
476
+ if (!TuiYear.isValidYear(year)) {
477
+ throw new Error('Invalid year: ' + year);
478
+ }
479
+ if (!TuiMonth.isValidMonth(year, month)) {
480
+ throw new Error('Invalid month: ' + month);
481
+ }
482
+ if (!Number.isInteger(day) ||
483
+ !inRange(day, MIN_DAY, TuiMonth.getMonthDaysCount(month, TuiYear.isLeapYear(year)) + 1)) {
484
+ throw new Error('Invalid day: ' + day);
485
+ }
486
+ return new TuiDay(year, month, day);
487
+ }
488
+ static normalizeDayPart(day, month, year) {
489
+ tuiAssert.assert(TuiMonth.isValidMonth(year, month));
490
+ const monthDaysCount = TuiMonth.getMonthDaysCount(month, TuiYear.isLeapYear(year));
491
+ return normalizeToIntNumber(day, 1, monthDaysCount);
492
+ }
493
+ get formattedDayPart() {
494
+ return padStart(this.day.toString(), 2, '0');
495
+ }
496
+ /**
497
+ * Formatted whole date
498
+ */
499
+ get formattedDay() {
500
+ return `${this.formattedDayPart}.${this.formattedMonth}`;
501
+ }
502
+ get isWeekend() {
503
+ const dayOfWeek = this.dayOfWeek(false);
504
+ return dayOfWeek === 6 /* Saturday */ || dayOfWeek === 0 /* Sunday */;
505
+ }
506
+ /**
507
+ * Returns day of week
508
+ *
509
+ * @param startFromMonday whether week starts from Monday and not from Sunday
510
+ * @return day of week (from 0 to 6)
354
511
  */
355
512
  dayOfWeek(startFromMonday = true) {
356
513
  const dayOfWeek = startFromMonday
@@ -470,161 +627,8 @@ class TuiDay extends TuiMonth {
470
627
  toUtcNativeDate() {
471
628
  return new Date(Date.UTC(this.year, this.month, this.day));
472
629
  }
473
- /**
474
- * Creates {@link TuiDay} from native {@link Date} based on local time zone
475
- */
476
- static fromLocalNativeDate(date) {
477
- return new TuiDay(date.getFullYear(), date.getMonth(), date.getDate());
478
- }
479
- /**
480
- * Creates {@link TuiDay} from native {@link Date} using UTC
481
- */
482
- static fromUtcNativeDate(date) {
483
- return new TuiDay(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
484
- }
485
- /**
486
- * Check validity of year, month and day
487
- *
488
- * @param year
489
- * @param month
490
- * @param day
491
- * @return boolean validity
492
- */
493
- static isValidDay(year, month, day) {
494
- return (TuiMonth.isValidMonth(year, month) &&
495
- Number.isInteger(day) &&
496
- inRange(day, MIN_DAY, TuiMonth.getMonthDaysCount(month, TuiYear.isLeapYear(year)) + 1));
497
- }
498
- /**
499
- * @deprecated DONT USE IT (will be deleted soon)
500
- *
501
- * Calculated day on a calendar grid
502
- *
503
- * @param month
504
- * @param row row in a calendar
505
- * @param col column in a calendar
506
- * @return resulting day on these coordinates (could exceed passed month)
507
- */
508
- static getDayFromMonthRowCol(month, row, col) {
509
- tuiAssert.assert(Number.isInteger(row));
510
- tuiAssert.assert(inRange(row, 0, 6));
511
- tuiAssert.assert(Number.isInteger(col));
512
- tuiAssert.assert(inRange(col, 0, DAYS_IN_WEEK));
513
- let day = row * DAYS_IN_WEEK + col - month.monthStartDaysOffset + 1;
514
- if (day > month.daysCount) {
515
- day = day - month.daysCount;
516
- month = month.append({ month: 1 });
517
- }
518
- if (day <= 0) {
519
- month = month.append({ month: -1 });
520
- day = month.daysCount + day;
521
- }
522
- return new TuiDay(month.year, month.month, day);
523
- }
524
- /**
525
- * Current day based on local time zone
526
- */
527
- static currentLocal() {
528
- const nativeDate = new Date();
529
- const year = nativeDate.getFullYear();
530
- const month = nativeDate.getMonth();
531
- const day = nativeDate.getDate();
532
- return new TuiDay(year, month, day);
533
- }
534
- /**
535
- * Calculates {@link TuiDay} normalizing year, month and day. {@link NaN} is turned into minimal value.
536
- *
537
- * @param year any year value, including invalid
538
- * @param month any month value, including invalid (months start with 0)
539
- * @param day any day value, including invalid
540
- * @return normalized date
541
- */
542
- static normalizeOf(year, month, day) {
543
- const normalizedYear = TuiYear.normalizeYearPart(year);
544
- const normalizedMonth = TuiMonth.normalizeMonthPart(month);
545
- const normalizedDay = TuiDay.normalizeDayPart(day, normalizedMonth, normalizedYear);
546
- return new TuiDay(normalizedYear, normalizedMonth, normalizedDay);
547
- }
548
- static lengthBetween(from, to) {
549
- return Math.round((to.toLocalNativeDate().getTime() - from.toLocalNativeDate().getTime()) /
550
- (1000 * 60 * 60 * 24));
551
- }
552
- // TODO: Move month and year related code corresponding classes
553
- /**
554
- * Parsing a string with date with normalization
555
- *
556
- * @param yearMonthDayString date string in format of DD.MM.Yyyy
557
- * @return normalized date
558
- */
559
- static normalizeParse(yearMonthDayString) {
560
- const day = parseInt(yearMonthDayString.slice(0, 2), 10);
561
- const month = parseInt(yearMonthDayString.slice(3, 5), 10) - 1;
562
- const year = parseInt(yearMonthDayString.slice(6, 10), 10);
563
- return TuiDay.normalizeOf(year, month, day);
564
- }
565
- /**
566
- * Parsing a date stringified in a toJSON format
567
- * @param yearMonthDayString date string in format of YYYY-MM-DD
568
- * @return date
569
- * @throws exceptions if any part of the date is invalid
570
- */
571
- static jsonParse(yearMonthDayString) {
572
- const day = parseInt(yearMonthDayString.slice(8, 10), 10);
573
- const month = parseInt(yearMonthDayString.slice(5, 7), 10) - 1;
574
- const year = parseInt(yearMonthDayString.slice(0, 4), 10);
575
- if (!TuiYear.isValidYear(year)) {
576
- throw new Error('Invalid year: ' + year);
577
- }
578
- if (!TuiMonth.isValidMonth(year, month)) {
579
- throw new Error('Invalid month: ' + month);
580
- }
581
- if (!Number.isInteger(day) ||
582
- !inRange(day, MIN_DAY, TuiMonth.getMonthDaysCount(month, TuiYear.isLeapYear(year)) + 1)) {
583
- throw new Error('Invalid day: ' + day);
584
- }
585
- return new TuiDay(year, month, day);
586
- }
587
- static normalizeDayPart(day, month, year) {
588
- tuiAssert.assert(TuiMonth.isValidMonth(year, month));
589
- const monthDaysCount = TuiMonth.getMonthDaysCount(month, TuiYear.isLeapYear(year));
590
- return normalizeToIntNumber(day, 1, monthDaysCount);
591
- }
592
630
  }
593
631
 
594
- const TUI_FIRST_DAY = new TuiDay(MIN_YEAR, MIN_MONTH, MIN_DAY);
595
- const TUI_LAST_DAY = new TuiDay(MAX_YEAR, MAX_MONTH, 31);
596
-
597
- /**
598
- * @deprecated dont use it. See {@link TUI_DATE_FORMAT}
599
- * TODO: get rid of this in v3.0
600
- */
601
- const TUI_DATE_FILLER = new InjectionToken('date filler for Taiga UI', {
602
- factory: () => `dd.mm.yyyy`,
603
- });
604
- /**
605
- * @deprecated dont use it
606
- * TODO: get rid of this in v3.0
607
- */
608
- const TUI_DATE_RANGE_FILLER = new InjectionToken('date range filler for Taiga UI', {
609
- factory: () => {
610
- const dateFiller = inject(TUI_DATE_FILLER);
611
- return `${dateFiller}${RANGE_SEPARATOR_CHAR}${dateFiller}`;
612
- },
613
- });
614
- /**
615
- * @internal 'dd.mm.yyyy'.length
616
- * Used in:
617
- * - {@link TuiInputDateComponent}
618
- * - {@link TuiInputDateRangeComponent}
619
- * - {@link TuiInputDateTimeComponent}
620
- */
621
- const DATE_FILLER_LENGTH = 10;
622
- /**
623
- * @internal
624
- * Used in {@link TuiInputDateRangeComponent}
625
- */
626
- const DATE_RANGE_FILLER_LENGTH = 2 * DATE_FILLER_LENGTH + RANGE_SEPARATOR_CHAR.length;
627
-
628
632
  /**
629
633
  * An immutable range of two {@link TuiMonth} objects
630
634
  */
@@ -634,6 +638,11 @@ class TuiMonthRange {
634
638
  this.to = to;
635
639
  tuiAssert.assert(from.monthSameOrBefore(to));
636
640
  }
641
+ static sort(month1, month2) {
642
+ return month1.monthSameOrBefore(month2)
643
+ ? new TuiMonthRange(month1, month2)
644
+ : new TuiMonthRange(month2, month1);
645
+ }
637
646
  get isSingleMonth() {
638
647
  return this.from.monthSame(this.to);
639
648
  }
@@ -646,11 +655,6 @@ class TuiMonthRange {
646
655
  toString() {
647
656
  return `${this.from}${RANGE_SEPARATOR_CHAR}${this.to}`;
648
657
  }
649
- static sort(month1, month2) {
650
- return month1.monthSameOrBefore(month2)
651
- ? new TuiMonthRange(month1, month2)
652
- : new TuiMonthRange(month2, month1);
653
- }
654
658
  }
655
659
 
656
660
  /**
@@ -663,6 +667,31 @@ class TuiDayRange extends TuiMonthRange {
663
667
  this.to = to;
664
668
  tuiAssert.assert(from.daySameOrBefore(to));
665
669
  }
670
+ /**
671
+ * Creates range from two days after sorting them
672
+ *
673
+ * @param day1
674
+ * @param day2
675
+ * @return new range with sorted days
676
+ */
677
+ static sort(day1, day2) {
678
+ return day1.daySameOrBefore(day2)
679
+ ? new TuiDayRange(day1, day2)
680
+ : new TuiDayRange(day2, day1);
681
+ }
682
+ /**
683
+ * Parse and correct a day range in string format
684
+ *
685
+ * @param rangeString a string of dates in a format dd.mm.yyyy - dd.mm.yyyy
686
+ * @return normalized day range object
687
+ */
688
+ static normalizeParse(rangeString) {
689
+ const leftDay = TuiDay.normalizeParse(rangeString.slice(0, DATE_FILLER_LENGTH));
690
+ if (rangeString.length < DATE_RANGE_FILLER_LENGTH) {
691
+ return new TuiDayRange(leftDay, leftDay);
692
+ }
693
+ return TuiDayRange.sort(leftDay, TuiDay.normalizeParse(rangeString.slice(DATE_FILLER_LENGTH + RANGE_SEPARATOR_CHAR.length)));
694
+ }
666
695
  get isSingleDay() {
667
696
  return this.from.daySame(this.to);
668
697
  }
@@ -691,33 +720,11 @@ class TuiDayRange extends TuiMonthRange {
691
720
  dayLimit(min, max) {
692
721
  return new TuiDayRange(this.from.dayLimit(min, max), this.to.dayLimit(min, max));
693
722
  }
694
- /**
695
- * Creates range from two days after sorting them
696
- *
697
- * @param day1
698
- * @param day2
699
- * @return new range with sorted days
700
- */
701
- static sort(day1, day2) {
702
- return day1.daySameOrBefore(day2)
703
- ? new TuiDayRange(day1, day2)
704
- : new TuiDayRange(day2, day1);
705
- }
706
- /**
707
- * Parse and correct a day range in string format
708
- *
709
- * @param rangeString a string of dates in a format dd.mm.yyyy - dd.mm.yyyy
710
- * @return normalized day range object
711
- */
712
- static normalizeParse(rangeString) {
713
- const leftDay = TuiDay.normalizeParse(rangeString.slice(0, DATE_FILLER_LENGTH));
714
- if (rangeString.length < DATE_RANGE_FILLER_LENGTH) {
715
- return new TuiDayRange(leftDay, leftDay);
716
- }
717
- return TuiDayRange.sort(leftDay, TuiDay.normalizeParse(rangeString.slice(DATE_FILLER_LENGTH + RANGE_SEPARATOR_CHAR.length)));
718
- }
719
723
  }
720
724
 
725
+ const TUI_FIRST_DAY = new TuiDay(MIN_YEAR, MIN_MONTH, MIN_DAY);
726
+ const TUI_LAST_DAY = new TuiDay(MAX_YEAR, MAX_MONTH, 31);
727
+
721
728
  /**
722
729
  * Immutable time object with hours, minutes, seconds and ms
723
730
  */
@@ -729,45 +736,6 @@ class TuiTime {
729
736
  this.ms = ms;
730
737
  tuiAssert.assert(TuiTime.isValidTime(hours, minutes, seconds, ms), 'Time must be real, but got:', hours, minutes, seconds, ms);
731
738
  }
732
- /**
733
- * Shifts time by hours and minutes
734
- */
735
- shift({ hours = 0, minutes = 0, seconds = 0, ms = 0 }) {
736
- const newMs = (1000 + this.ms + (ms % 1000)) % 1000;
737
- const secondsInMs = ms < 0 ? Math.ceil(ms / 1000) : Math.floor(ms / 1000);
738
- const secondsToAdd = secondsInMs + seconds;
739
- const newSeconds = (60 + this.seconds + (secondsToAdd % 60)) % 60;
740
- const minutesInSeconds = secondsToAdd < 0
741
- ? Math.ceil(secondsToAdd / 60)
742
- : Math.floor(secondsToAdd / 60);
743
- const minutesToAdd = minutesInSeconds + minutes;
744
- const newMinutes = (60 + this.minutes + (minutesToAdd % 60)) % 60;
745
- const hoursInMinutes = minutesToAdd < 0
746
- ? Math.ceil(minutesToAdd / 60)
747
- : Math.floor(minutesToAdd / 60);
748
- const hoursToAdd = hoursInMinutes + hours;
749
- const newHours = (24 + this.hours + (hoursToAdd % 24)) % 24;
750
- return new TuiTime(newHours, newMinutes, newSeconds, newMs);
751
- }
752
- /**
753
- * Converts TuiTime to string
754
- */
755
- toString(mode) {
756
- const needAddMs = mode === 'HH:MM:SS.MSS' || (!mode && this.ms > 0);
757
- const needAddSeconds = needAddMs || mode === 'HH:MM:SS' || (!mode && this.seconds > 0);
758
- return (`${this.formatTime(this.hours)}:${this.formatTime(this.minutes)}` +
759
- `${needAddSeconds ? ':' + this.formatTime(this.seconds) : ''}` +
760
- `${needAddMs ? '.' + this.formatTime(this.ms, 3) : ''}`);
761
- }
762
- /**
763
- * Converts TuiTime to milliseconds
764
- */
765
- toAbsoluteMilliseconds() {
766
- return (this.hours * MILLISECONDS_IN_HOUR +
767
- this.minutes * MILLISECONDS_IN_MINUTE +
768
- this.seconds * 1000 +
769
- this.ms);
770
- }
771
739
  /**
772
740
  * Checks if time is valid
773
741
  */
@@ -824,18 +792,50 @@ class TuiTime {
824
792
  static fromLocalNativeDate(date) {
825
793
  return new TuiTime(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
826
794
  }
795
+ /**
796
+ * Shifts time by hours and minutes
797
+ */
798
+ shift({ hours = 0, minutes = 0, seconds = 0, ms = 0 }) {
799
+ const newMs = (1000 + this.ms + (ms % 1000)) % 1000;
800
+ const secondsInMs = ms < 0 ? Math.ceil(ms / 1000) : Math.floor(ms / 1000);
801
+ const secondsToAdd = secondsInMs + seconds;
802
+ const newSeconds = (60 + this.seconds + (secondsToAdd % 60)) % 60;
803
+ const minutesInSeconds = secondsToAdd < 0
804
+ ? Math.ceil(secondsToAdd / 60)
805
+ : Math.floor(secondsToAdd / 60);
806
+ const minutesToAdd = minutesInSeconds + minutes;
807
+ const newMinutes = (60 + this.minutes + (minutesToAdd % 60)) % 60;
808
+ const hoursInMinutes = minutesToAdd < 0
809
+ ? Math.ceil(minutesToAdd / 60)
810
+ : Math.floor(minutesToAdd / 60);
811
+ const hoursToAdd = hoursInMinutes + hours;
812
+ const newHours = (24 + this.hours + (hoursToAdd % 24)) % 24;
813
+ return new TuiTime(newHours, newMinutes, newSeconds, newMs);
814
+ }
815
+ /**
816
+ * Converts TuiTime to string
817
+ */
818
+ toString(mode) {
819
+ const needAddMs = mode === 'HH:MM:SS.MSS' || (!mode && this.ms > 0);
820
+ const needAddSeconds = needAddMs || mode === 'HH:MM:SS' || (!mode && this.seconds > 0);
821
+ return (`${this.formatTime(this.hours)}:${this.formatTime(this.minutes)}` +
822
+ `${needAddSeconds ? ':' + this.formatTime(this.seconds) : ''}` +
823
+ `${needAddMs ? '.' + this.formatTime(this.ms, 3) : ''}`);
824
+ }
825
+ /**
826
+ * Converts TuiTime to milliseconds
827
+ */
828
+ toAbsoluteMilliseconds() {
829
+ return (this.hours * MILLISECONDS_IN_HOUR +
830
+ this.minutes * MILLISECONDS_IN_MINUTE +
831
+ this.seconds * 1000 +
832
+ this.ms);
833
+ }
827
834
  formatTime(time, digits = 2) {
828
835
  return padStart(time.toString(), digits, '0');
829
836
  }
830
837
  }
831
838
 
832
- /**
833
- * TODO This token supports only DMY now. Add other {@link TuiDateMode} support
834
- */
835
- const TUI_DATE_FORMAT = new InjectionToken('Active date format for Taiga UI', {
836
- factory: () => 'DMY',
837
- });
838
-
839
839
  /**
840
840
  * Generated bundle index. Do not edit.
841
841
  */