cmat 0.0.111 → 0.0.112

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 (256) hide show
  1. package/fesm2022/cmat-components-adapter.mjs +531 -536
  2. package/fesm2022/cmat-components-adapter.mjs.map +1 -1
  3. package/fesm2022/cmat-components-breadcrumb.mjs +521 -356
  4. package/fesm2022/cmat-components-breadcrumb.mjs.map +1 -1
  5. package/fesm2022/cmat-components-card.mjs +150 -42
  6. package/fesm2022/cmat-components-card.mjs.map +1 -1
  7. package/fesm2022/cmat-components-carousel.mjs +1120 -629
  8. package/fesm2022/cmat-components-carousel.mjs.map +1 -1
  9. package/fesm2022/cmat-components-cascade.mjs +861 -441
  10. package/fesm2022/cmat-components-cascade.mjs.map +1 -1
  11. package/fesm2022/cmat-components-chip-input.mjs +580 -335
  12. package/fesm2022/cmat-components-chip-input.mjs.map +1 -1
  13. package/fesm2022/cmat-components-code-editor.mjs +197 -105
  14. package/fesm2022/cmat-components-code-editor.mjs.map +1 -1
  15. package/fesm2022/cmat-components-color-picker.mjs +1762 -825
  16. package/fesm2022/cmat-components-color-picker.mjs.map +1 -1
  17. package/fesm2022/cmat-components-custom-formly.mjs +5196 -2531
  18. package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
  19. package/fesm2022/cmat-components-data-picker.mjs +1901 -1073
  20. package/fesm2022/cmat-components-data-picker.mjs.map +1 -1
  21. package/fesm2022/cmat-components-date-range.mjs +701 -456
  22. package/fesm2022/cmat-components-date-range.mjs.map +1 -1
  23. package/fesm2022/cmat-components-date-time-display.mjs +137 -30
  24. package/fesm2022/cmat-components-date-time-display.mjs.map +1 -1
  25. package/fesm2022/cmat-components-drawer.mjs +410 -258
  26. package/fesm2022/cmat-components-drawer.mjs.map +1 -1
  27. package/fesm2022/cmat-components-empty-state.mjs +201 -41
  28. package/fesm2022/cmat-components-empty-state.mjs.map +1 -1
  29. package/fesm2022/cmat-components-file-preview.mjs +198 -35
  30. package/fesm2022/cmat-components-file-preview.mjs.map +1 -1
  31. package/fesm2022/cmat-components-filter-toolbar.mjs +320 -72
  32. package/fesm2022/cmat-components-filter-toolbar.mjs.map +1 -1
  33. package/fesm2022/cmat-components-form-actions.mjs +102 -26
  34. package/fesm2022/cmat-components-form-actions.mjs.map +1 -1
  35. package/fesm2022/cmat-components-fullscreen.mjs +167 -47
  36. package/fesm2022/cmat-components-fullscreen.mjs.map +1 -1
  37. package/fesm2022/cmat-components-highlight.mjs +203 -112
  38. package/fesm2022/cmat-components-highlight.mjs.map +1 -1
  39. package/fesm2022/cmat-components-image-viewer.mjs +489 -215
  40. package/fesm2022/cmat-components-image-viewer.mjs.map +1 -1
  41. package/fesm2022/cmat-components-inline-loading.mjs +117 -27
  42. package/fesm2022/cmat-components-inline-loading.mjs.map +1 -1
  43. package/fesm2022/cmat-components-json-editor.mjs +276 -230
  44. package/fesm2022/cmat-components-json-editor.mjs.map +1 -1
  45. package/fesm2022/cmat-components-knob-input.mjs +615 -420
  46. package/fesm2022/cmat-components-knob-input.mjs.map +1 -1
  47. package/fesm2022/cmat-components-loading-overlay.mjs +53 -25
  48. package/fesm2022/cmat-components-loading-overlay.mjs.map +1 -1
  49. package/fesm2022/cmat-components-masonry.mjs +120 -40
  50. package/fesm2022/cmat-components-masonry.mjs.map +1 -1
  51. package/fesm2022/cmat-components-material-color-picker.mjs +332 -155
  52. package/fesm2022/cmat-components-material-color-picker.mjs.map +1 -1
  53. package/fesm2022/cmat-components-material-datetimepicker.mjs +4283 -2504
  54. package/fesm2022/cmat-components-material-datetimepicker.mjs.map +1 -1
  55. package/fesm2022/cmat-components-navigation.mjs +3080 -1404
  56. package/fesm2022/cmat-components-navigation.mjs.map +1 -1
  57. package/fesm2022/cmat-components-opt-input.mjs +540 -466
  58. package/fesm2022/cmat-components-opt-input.mjs.map +1 -1
  59. package/fesm2022/cmat-components-org-chart.mjs +528 -125
  60. package/fesm2022/cmat-components-org-chart.mjs.map +1 -1
  61. package/fesm2022/cmat-components-page-header.mjs +141 -32
  62. package/fesm2022/cmat-components-page-header.mjs.map +1 -1
  63. package/fesm2022/cmat-components-pagination.mjs +866 -534
  64. package/fesm2022/cmat-components-pagination.mjs.map +1 -1
  65. package/fesm2022/cmat-components-password-strength.mjs +873 -434
  66. package/fesm2022/cmat-components-password-strength.mjs.map +1 -1
  67. package/fesm2022/cmat-components-popover.mjs +1012 -731
  68. package/fesm2022/cmat-components-popover.mjs.map +1 -1
  69. package/fesm2022/cmat-components-progress-bar.mjs +98 -35
  70. package/fesm2022/cmat-components-progress-bar.mjs.map +1 -1
  71. package/fesm2022/cmat-components-qrcode.mjs +463 -287
  72. package/fesm2022/cmat-components-qrcode.mjs.map +1 -1
  73. package/fesm2022/cmat-components-rating.mjs +377 -203
  74. package/fesm2022/cmat-components-rating.mjs.map +1 -1
  75. package/fesm2022/cmat-components-rich-text-editor.mjs +153 -39
  76. package/fesm2022/cmat-components-rich-text-editor.mjs.map +1 -1
  77. package/fesm2022/cmat-components-select-search.mjs +926 -496
  78. package/fesm2022/cmat-components-select-search.mjs.map +1 -1
  79. package/fesm2022/cmat-components-select-table.mjs +1280 -842
  80. package/fesm2022/cmat-components-select-table.mjs.map +1 -1
  81. package/fesm2022/cmat-components-select-tree.mjs +998 -690
  82. package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
  83. package/fesm2022/cmat-components-skeleton.mjs +143 -57
  84. package/fesm2022/cmat-components-skeleton.mjs.map +1 -1
  85. package/fesm2022/cmat-components-speed-dial.mjs +457 -303
  86. package/fesm2022/cmat-components-speed-dial.mjs.map +1 -1
  87. package/fesm2022/cmat-components-status-tag.mjs +136 -44
  88. package/fesm2022/cmat-components-status-tag.mjs.map +1 -1
  89. package/fesm2022/cmat-components-table-toolbar.mjs +120 -28
  90. package/fesm2022/cmat-components-table-toolbar.mjs.map +1 -1
  91. package/fesm2022/cmat-components-timeline.mjs +464 -168
  92. package/fesm2022/cmat-components-timeline.mjs.map +1 -1
  93. package/fesm2022/cmat-components-toast.mjs +346 -262
  94. package/fesm2022/cmat-components-toast.mjs.map +1 -1
  95. package/fesm2022/cmat-components-transfer-picker.mjs +1427 -593
  96. package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
  97. package/fesm2022/cmat-components-treetable.mjs +372 -112
  98. package/fesm2022/cmat-components-treetable.mjs.map +1 -1
  99. package/fesm2022/cmat-components-upload.mjs +904 -410
  100. package/fesm2022/cmat-components-upload.mjs.map +1 -1
  101. package/fesm2022/cmat-components-x6-angular-shape.mjs +153 -170
  102. package/fesm2022/cmat-components-x6-angular-shape.mjs.map +1 -1
  103. package/fesm2022/cmat-directives-animate-on-scroll.mjs +220 -138
  104. package/fesm2022/cmat-directives-animate-on-scroll.mjs.map +1 -1
  105. package/fesm2022/cmat-directives-arrow-cursor.mjs +246 -193
  106. package/fesm2022/cmat-directives-arrow-cursor.mjs.map +1 -1
  107. package/fesm2022/cmat-directives-autofocus.mjs +43 -25
  108. package/fesm2022/cmat-directives-autofocus.mjs.map +1 -1
  109. package/fesm2022/cmat-directives-data-exporter.mjs +537 -338
  110. package/fesm2022/cmat-directives-data-exporter.mjs.map +1 -1
  111. package/fesm2022/cmat-directives-debounce.mjs +162 -76
  112. package/fesm2022/cmat-directives-debounce.mjs.map +1 -1
  113. package/fesm2022/cmat-directives-digit-only.mjs +457 -356
  114. package/fesm2022/cmat-directives-digit-only.mjs.map +1 -1
  115. package/fesm2022/cmat-directives-equal-validator.mjs +70 -53
  116. package/fesm2022/cmat-directives-equal-validator.mjs.map +1 -1
  117. package/fesm2022/cmat-directives-seamless-auto-scroll.mjs +180 -132
  118. package/fesm2022/cmat-directives-seamless-auto-scroll.mjs.map +1 -1
  119. package/fesm2022/cmat-lib-mock-api.mjs +207 -195
  120. package/fesm2022/cmat-lib-mock-api.mjs.map +1 -1
  121. package/fesm2022/cmat-pipes-bytes.mjs +50 -30
  122. package/fesm2022/cmat-pipes-bytes.mjs.map +1 -1
  123. package/fesm2022/cmat-pipes-date-format.mjs +41 -25
  124. package/fesm2022/cmat-pipes-date-format.mjs.map +1 -1
  125. package/fesm2022/cmat-pipes-find-by-key.mjs +44 -26
  126. package/fesm2022/cmat-pipes-find-by-key.mjs.map +1 -1
  127. package/fesm2022/cmat-pipes-group-by.mjs +50 -38
  128. package/fesm2022/cmat-pipes-group-by.mjs.map +1 -1
  129. package/fesm2022/cmat-pipes-keys.mjs +44 -31
  130. package/fesm2022/cmat-pipes-keys.mjs.map +1 -1
  131. package/fesm2022/cmat-pipes-secure.mjs +60 -49
  132. package/fesm2022/cmat-pipes-secure.mjs.map +1 -1
  133. package/fesm2022/cmat-pipes-uppercase.mjs +39 -22
  134. package/fesm2022/cmat-pipes-uppercase.mjs.map +1 -1
  135. package/fesm2022/cmat-reports.mjs +2751 -0
  136. package/fesm2022/cmat-reports.mjs.map +1 -0
  137. package/fesm2022/cmat-services-alert.mjs +249 -277
  138. package/fesm2022/cmat-services-alert.mjs.map +1 -1
  139. package/fesm2022/cmat-services-config.mjs +110 -81
  140. package/fesm2022/cmat-services-config.mjs.map +1 -1
  141. package/fesm2022/cmat-services-confirmation.mjs +184 -73
  142. package/fesm2022/cmat-services-confirmation.mjs.map +1 -1
  143. package/fesm2022/cmat-services-data.mjs +136 -125
  144. package/fesm2022/cmat-services-data.mjs.map +1 -1
  145. package/fesm2022/cmat-services-export-as.mjs +165 -183
  146. package/fesm2022/cmat-services-export-as.mjs.map +1 -1
  147. package/fesm2022/cmat-services-loading.mjs +116 -95
  148. package/fesm2022/cmat-services-loading.mjs.map +1 -1
  149. package/fesm2022/cmat-services-local-storage.mjs +75 -66
  150. package/fesm2022/cmat-services-local-storage.mjs.map +1 -1
  151. package/fesm2022/cmat-services-media-watcher.mjs +69 -64
  152. package/fesm2022/cmat-services-media-watcher.mjs.map +1 -1
  153. package/fesm2022/cmat-services-platform.mjs +48 -45
  154. package/fesm2022/cmat-services-platform.mjs.map +1 -1
  155. package/fesm2022/cmat-services-print.mjs +984 -1109
  156. package/fesm2022/cmat-services-print.mjs.map +1 -1
  157. package/fesm2022/cmat-services-splash-screen.mjs +53 -38
  158. package/fesm2022/cmat-services-splash-screen.mjs.map +1 -1
  159. package/fesm2022/cmat-services-title.mjs +57 -47
  160. package/fesm2022/cmat-services-title.mjs.map +1 -1
  161. package/fesm2022/cmat-services-translation.mjs +79 -68
  162. package/fesm2022/cmat-services-translation.mjs.map +1 -1
  163. package/fesm2022/cmat-services-utils.mjs +424 -517
  164. package/fesm2022/cmat-services-utils.mjs.map +1 -1
  165. package/fesm2022/cmat-validators.mjs +23 -33
  166. package/fesm2022/cmat-validators.mjs.map +1 -1
  167. package/fesm2022/cmat-version.mjs +12 -16
  168. package/fesm2022/cmat-version.mjs.map +1 -1
  169. package/fesm2022/cmat.mjs +39805 -22511
  170. package/fesm2022/cmat.mjs.map +1 -1
  171. package/package.json +5 -1
  172. package/types/cmat-components-adapter.d.ts +145 -156
  173. package/types/cmat-components-breadcrumb.d.ts +108 -86
  174. package/types/cmat-components-card.d.ts +34 -18
  175. package/types/cmat-components-carousel.d.ts +251 -134
  176. package/types/cmat-components-cascade.d.ts +158 -117
  177. package/types/cmat-components-chip-input.d.ts +105 -71
  178. package/types/cmat-components-code-editor.d.ts +59 -34
  179. package/types/cmat-components-color-picker.d.ts +378 -236
  180. package/types/cmat-components-custom-formly.d.ts +776 -814
  181. package/types/cmat-components-data-picker.d.ts +502 -360
  182. package/types/cmat-components-date-range.d.ts +106 -77
  183. package/types/cmat-components-date-time-display.d.ts +36 -13
  184. package/types/cmat-components-drawer.d.ts +91 -61
  185. package/types/cmat-components-empty-state.d.ts +47 -17
  186. package/types/cmat-components-file-preview.d.ts +42 -14
  187. package/types/cmat-components-filter-toolbar.d.ts +57 -25
  188. package/types/cmat-components-form-actions.d.ts +18 -10
  189. package/types/cmat-components-fullscreen.d.ts +21 -13
  190. package/types/cmat-components-highlight.d.ts +33 -26
  191. package/types/cmat-components-image-viewer.d.ts +119 -58
  192. package/types/cmat-components-inline-loading.d.ts +24 -11
  193. package/types/cmat-components-json-editor.d.ts +39 -28
  194. package/types/cmat-components-knob-input.d.ts +172 -101
  195. package/types/cmat-components-loading-overlay.d.ts +8 -11
  196. package/types/cmat-components-masonry.d.ts +27 -14
  197. package/types/cmat-components-material-color-picker.d.ts +56 -42
  198. package/types/cmat-components-material-datetimepicker.d.ts +817 -454
  199. package/types/cmat-components-navigation.d.ts +295 -221
  200. package/types/cmat-components-opt-input.d.ts +111 -90
  201. package/types/cmat-components-org-chart.d.ts +53 -35
  202. package/types/cmat-components-page-header.d.ts +37 -14
  203. package/types/cmat-components-pagination.d.ts +144 -107
  204. package/types/cmat-components-password-strength.d.ts +197 -86
  205. package/types/cmat-components-popover.d.ts +264 -166
  206. package/types/cmat-components-progress-bar.d.ts +17 -14
  207. package/types/cmat-components-qrcode.d.ts +111 -42
  208. package/types/cmat-components-rating.d.ts +105 -59
  209. package/types/cmat-components-rich-text-editor.d.ts +39 -16
  210. package/types/cmat-components-select-search.d.ts +195 -99
  211. package/types/cmat-components-select-table.d.ts +241 -142
  212. package/types/cmat-components-select-tree.d.ts +185 -118
  213. package/types/cmat-components-skeleton.d.ts +55 -32
  214. package/types/cmat-components-speed-dial.d.ts +86 -61
  215. package/types/cmat-components-status-tag.d.ts +42 -24
  216. package/types/cmat-components-table-toolbar.d.ts +30 -12
  217. package/types/cmat-components-timeline.d.ts +83 -51
  218. package/types/cmat-components-toast.d.ts +84 -85
  219. package/types/cmat-components-transfer-picker.d.ts +228 -181
  220. package/types/cmat-components-treetable.d.ts +63 -39
  221. package/types/cmat-components-upload.d.ts +205 -106
  222. package/types/cmat-components-x6-angular-shape.d.ts +29 -37
  223. package/types/cmat-directives-animate-on-scroll.d.ts +48 -30
  224. package/types/cmat-directives-arrow-cursor.d.ts +55 -35
  225. package/types/cmat-directives-autofocus.d.ts +8 -11
  226. package/types/cmat-directives-data-exporter.d.ts +71 -40
  227. package/types/cmat-directives-debounce.d.ts +31 -28
  228. package/types/cmat-directives-digit-only.d.ts +90 -53
  229. package/types/cmat-directives-equal-validator.d.ts +11 -14
  230. package/types/cmat-directives-seamless-auto-scroll.d.ts +42 -29
  231. package/types/cmat-lib-mock-api.d.ts +46 -55
  232. package/types/cmat-pipes-bytes.d.ts +7 -10
  233. package/types/cmat-pipes-date-format.d.ts +7 -10
  234. package/types/cmat-pipes-find-by-key.d.ts +8 -12
  235. package/types/cmat-pipes-group-by.d.ts +11 -15
  236. package/types/cmat-pipes-keys.d.ts +10 -13
  237. package/types/cmat-pipes-secure.d.ts +14 -17
  238. package/types/cmat-pipes-uppercase.d.ts +7 -10
  239. package/types/cmat-reports.d.ts +1131 -0
  240. package/types/cmat-services-alert.d.ts +80 -87
  241. package/types/cmat-services-config.d.ts +37 -43
  242. package/types/cmat-services-confirmation.d.ts +31 -37
  243. package/types/cmat-services-data.d.ts +18 -21
  244. package/types/cmat-services-export-as.d.ts +28 -33
  245. package/types/cmat-services-loading.d.ts +27 -31
  246. package/types/cmat-services-local-storage.d.ts +17 -21
  247. package/types/cmat-services-media-watcher.d.ts +14 -18
  248. package/types/cmat-services-platform.d.ts +8 -11
  249. package/types/cmat-services-print.d.ts +97 -102
  250. package/types/cmat-services-splash-screen.d.ts +11 -14
  251. package/types/cmat-services-title.d.ts +9 -12
  252. package/types/cmat-services-translation.d.ts +19 -22
  253. package/types/cmat-services-utils.d.ts +76 -80
  254. package/types/cmat-validators.d.ts +5 -8
  255. package/types/cmat-version.d.ts +8 -10
  256. package/types/cmat.d.ts +7551 -5204
@@ -1,552 +1,547 @@
1
- import { DateAdapter, MAT_DATE_LOCALE } from '@angular/material/core';
2
- import * as i0 from '@angular/core';
3
- import { InjectionToken, inject, Injectable } from '@angular/core';
4
- import dayjs from 'dayjs';
5
- import localeData from 'dayjs/plugin/localeData';
6
- import customParseFormat from 'dayjs/plugin/customParseFormat';
7
- import LocalizedFormat from 'dayjs/plugin/localizedFormat';
8
- import utc from 'dayjs/plugin/utc';
9
-
10
- class DatetimeAdapter extends DateAdapter {
11
- constructor(_delegate) {
12
- super();
13
- this._delegate = _delegate;
14
- }
15
- getValidDateOrNull(obj) {
16
- return this.isDateInstance(obj) && this.isValid(obj) ? obj : null;
17
- }
18
- compareDatetime(first, second, respectMinutePart = true) {
19
- return this.compareDate(first, second) ||
20
- this.getHour(first) - this.getHour(second) ||
21
- (respectMinutePart && this.getMinute(first) - this.getMinute(second));
22
- }
23
- sameDatetime(first, second) {
24
- if (first && second) {
25
- const firstValid = this.isValid(first);
26
- const secondValid = this.isValid(second);
27
- if (firstValid && secondValid) {
28
- return !this.compareDatetime(first, second);
29
- }
30
- return firstValid === secondValid;
31
- }
32
- return first === second;
33
- }
34
- sameYear(first, second) {
35
- return first && second && this.getYear(first) === this.getYear(second);
36
- }
37
- sameDay(first, second) {
38
- return first && second && this.getDate(first) === this.getDate(second) && this.sameMonthAndYear(first, second);
39
- }
40
- sameHour(first, second) {
41
- return first && second && this.getHour(first) === this.getHour(second) && this.sameDay(first, second);
42
- }
43
- sameMinute(first, second) {
44
- return first && second && this.getMinute(first) === this.getMinute(second) && this.sameHour(first, second);
45
- }
46
- sameMonthAndYear(first, second) {
47
- if (first && second) {
48
- const firstValid = this.isValid(first);
49
- const secondValid = this.isValid(second);
50
- if (firstValid && secondValid) {
51
- return !(this.getYear(first) - this.getYear(second) ||
52
- this.getMonth(first) - this.getMonth(second));
53
- }
54
- return firstValid === secondValid;
55
- }
56
- return first === second;
57
- }
58
- clone(date) {
59
- return this._delegate.clone(date);
60
- }
61
- addCalendarYears(date, years) {
62
- return this._delegate.addCalendarYears(date, years);
63
- }
64
- addCalendarMonths(date, months) {
65
- return this._delegate.addCalendarMonths(date, months);
66
- }
67
- addCalendarDays(date, days) {
68
- return this._delegate.addCalendarDays(date, days);
69
- }
70
- getYear(date) {
71
- return this._delegate.getYear(date);
72
- }
73
- getMonth(date) {
74
- return this._delegate.getMonth(date);
75
- }
76
- getDate(date) {
77
- return this._delegate.getDate(date);
78
- }
79
- getDayOfWeek(date) {
80
- return this._delegate.getDayOfWeek(date);
81
- }
82
- getMonthNames(style) {
83
- return this._delegate.getMonthNames(style);
84
- }
85
- getDateNames() {
86
- return this._delegate.getDateNames();
87
- }
88
- getDayOfWeekNames(style) {
89
- return this._delegate.getDayOfWeekNames(style);
90
- }
91
- getYearName(date) {
92
- return this._delegate.getYearName(date);
93
- }
94
- getFirstDayOfWeek() {
95
- return this._delegate.getFirstDayOfWeek();
96
- }
97
- getNumDaysInMonth(date) {
98
- return this._delegate.getNumDaysInMonth(date);
99
- }
100
- createDate(year, month, date) {
101
- return this._delegate.createDate(year, month, date);
102
- }
103
- today() {
104
- return this._delegate.today();
105
- }
106
- parse(value, parseFormat) {
107
- return this._delegate.parse(value, parseFormat);
108
- }
109
- format(date, displayFormat) {
110
- return this._delegate.format(date, displayFormat);
111
- }
112
- toIso8601(date) {
113
- return this._delegate.toIso8601(date);
114
- }
115
- isDateInstance(obj) {
116
- return this._delegate.isDateInstance(obj);
117
- }
118
- isValid(date) {
119
- return this._delegate.isValid(date);
120
- }
121
- invalid() {
122
- return this._delegate.invalid();
123
- }
124
- clampDate(date, min, max) {
125
- if (min && this.compareDatetime(date, min) < 0) {
126
- return min;
127
- }
128
- if (max && this.compareDatetime(date, max) > 0) {
129
- return max;
130
- }
131
- return date;
132
- }
133
- }
134
-
135
- const CMAT_DATETIME_FORMATS = new InjectionToken('cmat-datetime-formats');
136
-
137
- const DEFAULT_HOUR_NAMES = range$2(24, i => String(i));
138
- const DEFAULT_MINUTE_NAMES = range$2(60, i => String(i));
1
+ import { DateAdapter, MAT_DATE_LOCALE } from "@angular/material/core";
2
+ import * as i0 from "@angular/core";
3
+ import { Injectable, InjectionToken, inject } from "@angular/core";
4
+ import dayjs from "dayjs";
5
+ import localeData from "dayjs/plugin/localeData";
6
+ import customParseFormat from "dayjs/plugin/customParseFormat";
7
+ import LocalizedFormat from "dayjs/plugin/localizedFormat";
8
+ import utc from "dayjs/plugin/utc";
9
+ var DatetimeAdapter = class extends DateAdapter {
10
+ constructor(_delegate) {
11
+ super();
12
+ this._delegate = _delegate;
13
+ }
14
+ getValidDateOrNull(obj) {
15
+ return this.isDateInstance(obj) && this.isValid(obj) ? obj : null;
16
+ }
17
+ compareDatetime(first, second, respectMinutePart = true) {
18
+ return this.compareDate(first, second) || this.getHour(first) - this.getHour(second) || respectMinutePart && this.getMinute(first) - this.getMinute(second);
19
+ }
20
+ sameDatetime(first, second) {
21
+ if (first && second) {
22
+ const firstValid = this.isValid(first);
23
+ const secondValid = this.isValid(second);
24
+ if (firstValid && secondValid) return !this.compareDatetime(first, second);
25
+ return firstValid === secondValid;
26
+ }
27
+ return first === second;
28
+ }
29
+ sameYear(first, second) {
30
+ return first && second && this.getYear(first) === this.getYear(second);
31
+ }
32
+ sameDay(first, second) {
33
+ return first && second && this.getDate(first) === this.getDate(second) && this.sameMonthAndYear(first, second);
34
+ }
35
+ sameHour(first, second) {
36
+ return first && second && this.getHour(first) === this.getHour(second) && this.sameDay(first, second);
37
+ }
38
+ sameMinute(first, second) {
39
+ return first && second && this.getMinute(first) === this.getMinute(second) && this.sameHour(first, second);
40
+ }
41
+ sameMonthAndYear(first, second) {
42
+ if (first && second) {
43
+ const firstValid = this.isValid(first);
44
+ const secondValid = this.isValid(second);
45
+ if (firstValid && secondValid) return !(this.getYear(first) - this.getYear(second) || this.getMonth(first) - this.getMonth(second));
46
+ return firstValid === secondValid;
47
+ }
48
+ return first === second;
49
+ }
50
+ clone(date) {
51
+ return this._delegate.clone(date);
52
+ }
53
+ addCalendarYears(date, years) {
54
+ return this._delegate.addCalendarYears(date, years);
55
+ }
56
+ addCalendarMonths(date, months) {
57
+ return this._delegate.addCalendarMonths(date, months);
58
+ }
59
+ addCalendarDays(date, days) {
60
+ return this._delegate.addCalendarDays(date, days);
61
+ }
62
+ getYear(date) {
63
+ return this._delegate.getYear(date);
64
+ }
65
+ getMonth(date) {
66
+ return this._delegate.getMonth(date);
67
+ }
68
+ getDate(date) {
69
+ return this._delegate.getDate(date);
70
+ }
71
+ getDayOfWeek(date) {
72
+ return this._delegate.getDayOfWeek(date);
73
+ }
74
+ getMonthNames(style) {
75
+ return this._delegate.getMonthNames(style);
76
+ }
77
+ getDateNames() {
78
+ return this._delegate.getDateNames();
79
+ }
80
+ getDayOfWeekNames(style) {
81
+ return this._delegate.getDayOfWeekNames(style);
82
+ }
83
+ getYearName(date) {
84
+ return this._delegate.getYearName(date);
85
+ }
86
+ getFirstDayOfWeek() {
87
+ return this._delegate.getFirstDayOfWeek();
88
+ }
89
+ getNumDaysInMonth(date) {
90
+ return this._delegate.getNumDaysInMonth(date);
91
+ }
92
+ createDate(year, month, date) {
93
+ return this._delegate.createDate(year, month, date);
94
+ }
95
+ today() {
96
+ return this._delegate.today();
97
+ }
98
+ parse(value, parseFormat) {
99
+ return this._delegate.parse(value, parseFormat);
100
+ }
101
+ format(date, displayFormat) {
102
+ return this._delegate.format(date, displayFormat);
103
+ }
104
+ toIso8601(date) {
105
+ return this._delegate.toIso8601(date);
106
+ }
107
+ isDateInstance(obj) {
108
+ return this._delegate.isDateInstance(obj);
109
+ }
110
+ isValid(date) {
111
+ return this._delegate.isValid(date);
112
+ }
113
+ invalid() {
114
+ return this._delegate.invalid();
115
+ }
116
+ clampDate(date, min, max) {
117
+ if (min && this.compareDatetime(date, min) < 0) return min;
118
+ if (max && this.compareDatetime(date, max) > 0) return max;
119
+ return date;
120
+ }
121
+ };
122
+ const CMAT_DATETIME_FORMATS = new InjectionToken("cmat-datetime-formats");
123
+ const DEFAULT_HOUR_NAMES = range$2(24, (i) => String(i));
124
+ const DEFAULT_MINUTE_NAMES = range$2(60, (i) => String(i));
139
125
  function range$2(length, valueFunction) {
140
- const valuesArray = new Array(length);
141
- for (let i = 0; i < length; i++) {
142
- valuesArray[i] = valueFunction(i);
143
- }
144
- return valuesArray;
145
- }
146
- class CNativeDatetimeAdapter extends DatetimeAdapter {
147
- constructor() {
148
- const matDateLocale = inject(MAT_DATE_LOCALE, { optional: true });
149
- const _delegate = inject(DateAdapter);
150
- super(_delegate);
151
- this.setLocale(matDateLocale);
152
- }
153
- clone(date) {
154
- return this.createDatetime(this.getYear(date), this.getMonth(date), this.getDate(date), this.getHour(date), this.getMinute(date));
155
- }
156
- getHour(date) {
157
- return date.getHours();
158
- }
159
- getMinute(date) {
160
- return date.getMinutes();
161
- }
162
- isInNextMonth(startDate, endDate) {
163
- const nextMonth = this._getDateInNextMonth(startDate);
164
- return this.sameMonthAndYear(nextMonth, endDate);
165
- }
166
- createDatetime(year, month, date, hour, minute) {
167
- if (month < 0 || month > 11) {
168
- throw Error(`Invalid month index "${month}". Month index has to be between 0 and 11.`);
169
- }
170
- if (date < 1) {
171
- throw Error(`Invalid date "${date}". Date has to be greater than 0.`);
172
- }
173
- if (hour < 0 || hour > 23) {
174
- throw Error(`Invalid hour "${hour}". Hour has to be between 0 and 23.`);
175
- }
176
- if (minute < 0 || minute > 59) {
177
- throw Error(`Invalid minute "${minute}". Minute has to be between 0 and 59.`);
178
- }
179
- const result = this._createDateWithOverflow(year, month, date, hour, minute);
180
- if (result.getMonth() !== month) {
181
- throw Error(`Invalid date "${date}" for month with index "${month}".`);
182
- }
183
- return result;
184
- }
185
- getFirstDateOfMonth(date) {
186
- const result = new Date();
187
- result.setFullYear(date.getFullYear(), date.getMonth(), 1);
188
- return result;
189
- }
190
- getHourNames() {
191
- return DEFAULT_HOUR_NAMES;
192
- }
193
- getMinuteNames() {
194
- return DEFAULT_MINUTE_NAMES;
195
- }
196
- addCalendarYears(date, years) {
197
- return this.addCalendarMonths(date, years * 12);
198
- }
199
- addCalendarMonths(date, months) {
200
- let newDate = this._createDateWithOverflow(this.getYear(date), this.getMonth(date) + months, this.getDate(date), this.getHour(date), this.getMinute(date));
201
- if (this.getMonth(newDate) !== ((this.getMonth(date) + months) % 12 + 12) % 12) {
202
- newDate = this._createDateWithOverflow(this.getYear(newDate), this.getMonth(newDate), 0, this.getHour(date), this.getMinute(date));
203
- }
204
- return newDate;
205
- }
206
- addCalendarDays(date, days) {
207
- return this._createDateWithOverflow(this.getYear(date), this.getMonth(date), this.getDate(date) + days, this.getHour(date), this.getMinute(date));
208
- }
209
- addCalendarHours(date, hours) {
210
- return this._createDateWithOverflow(this.getYear(date), this.getMonth(date), this.getDate(date), this.getHour(date) + hours, this.getMinute(date));
211
- }
212
- addCalendarMinutes(date, minutes) {
213
- return this._createDateWithOverflow(this.getYear(date), this.getMonth(date), this.getDate(date), this.getHour(date), this.getMinute(date) + minutes);
214
- }
215
- toIso8601(date) {
216
- return super.toIso8601(date) + 'T' + [
217
- this._2digit(date.getUTCHours()),
218
- this._2digit(date.getUTCMinutes())
219
- ].join(':');
220
- }
221
- _getDateInNextMonth(date) {
222
- return new Date(date.getFullYear(), date.getMonth() + 1, 1, date.getHours(), date.getMinutes());
223
- }
224
- _2digit(n) {
225
- return ('00' + n).slice(-2);
226
- }
227
- /* Creates a date but allows the month and date to overflow. */
228
- _createDateWithOverflow(year, month, date, hours, minutes) {
229
- const result = new Date(year, month, date, hours, minutes);
230
- if (year >= 0 && year < 100) {
231
- result.setFullYear(this.getYear(result) - 1900);
232
- }
233
- return result;
234
- }
235
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CNativeDatetimeAdapter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
236
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CNativeDatetimeAdapter }); }
126
+ const valuesArray = new Array(length);
127
+ for (let i = 0; i < length; i++) valuesArray[i] = valueFunction(i);
128
+ return valuesArray;
237
129
  }
238
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CNativeDatetimeAdapter, decorators: [{
239
- type: Injectable
240
- }], ctorParameters: () => [] });
241
-
130
+ var CNativeDatetimeAdapter = class CNativeDatetimeAdapter extends DatetimeAdapter {
131
+ constructor() {
132
+ const matDateLocale = inject(MAT_DATE_LOCALE, { optional: true });
133
+ const _delegate = inject(DateAdapter);
134
+ super(_delegate);
135
+ this.setLocale(matDateLocale);
136
+ }
137
+ clone(date) {
138
+ return this.createDatetime(this.getYear(date), this.getMonth(date), this.getDate(date), this.getHour(date), this.getMinute(date));
139
+ }
140
+ getHour(date) {
141
+ return date.getHours();
142
+ }
143
+ getMinute(date) {
144
+ return date.getMinutes();
145
+ }
146
+ isInNextMonth(startDate, endDate) {
147
+ const nextMonth = this._getDateInNextMonth(startDate);
148
+ return this.sameMonthAndYear(nextMonth, endDate);
149
+ }
150
+ createDatetime(year, month, date, hour, minute) {
151
+ if (month < 0 || month > 11) throw Error(`Invalid month index "${month}". Month index has to be between 0 and 11.`);
152
+ if (date < 1) throw Error(`Invalid date "${date}". Date has to be greater than 0.`);
153
+ if (hour < 0 || hour > 23) throw Error(`Invalid hour "${hour}". Hour has to be between 0 and 23.`);
154
+ if (minute < 0 || minute > 59) throw Error(`Invalid minute "${minute}". Minute has to be between 0 and 59.`);
155
+ const result = this._createDateWithOverflow(year, month, date, hour, minute);
156
+ if (result.getMonth() !== month) throw Error(`Invalid date "${date}" for month with index "${month}".`);
157
+ return result;
158
+ }
159
+ getFirstDateOfMonth(date) {
160
+ const result = /* @__PURE__ */ new Date();
161
+ result.setFullYear(date.getFullYear(), date.getMonth(), 1);
162
+ return result;
163
+ }
164
+ getHourNames() {
165
+ return DEFAULT_HOUR_NAMES;
166
+ }
167
+ getMinuteNames() {
168
+ return DEFAULT_MINUTE_NAMES;
169
+ }
170
+ addCalendarYears(date, years) {
171
+ return this.addCalendarMonths(date, years * 12);
172
+ }
173
+ addCalendarMonths(date, months) {
174
+ let newDate = this._createDateWithOverflow(this.getYear(date), this.getMonth(date) + months, this.getDate(date), this.getHour(date), this.getMinute(date));
175
+ if (this.getMonth(newDate) !== ((this.getMonth(date) + months) % 12 + 12) % 12) newDate = this._createDateWithOverflow(this.getYear(newDate), this.getMonth(newDate), 0, this.getHour(date), this.getMinute(date));
176
+ return newDate;
177
+ }
178
+ addCalendarDays(date, days) {
179
+ return this._createDateWithOverflow(this.getYear(date), this.getMonth(date), this.getDate(date) + days, this.getHour(date), this.getMinute(date));
180
+ }
181
+ addCalendarHours(date, hours) {
182
+ return this._createDateWithOverflow(this.getYear(date), this.getMonth(date), this.getDate(date), this.getHour(date) + hours, this.getMinute(date));
183
+ }
184
+ addCalendarMinutes(date, minutes) {
185
+ return this._createDateWithOverflow(this.getYear(date), this.getMonth(date), this.getDate(date), this.getHour(date), this.getMinute(date) + minutes);
186
+ }
187
+ toIso8601(date) {
188
+ return super.toIso8601(date) + "T" + [this._2digit(date.getUTCHours()), this._2digit(date.getUTCMinutes())].join(":");
189
+ }
190
+ _getDateInNextMonth(date) {
191
+ return new Date(date.getFullYear(), date.getMonth() + 1, 1, date.getHours(), date.getMinutes());
192
+ }
193
+ _2digit(n) {
194
+ return ("00" + n).slice(-2);
195
+ }
196
+ _createDateWithOverflow(year, month, date, hours, minutes) {
197
+ const result = new Date(year, month, date, hours, minutes);
198
+ if (year >= 0 && year < 100) result.setFullYear(this.getYear(result) - 1900);
199
+ return result;
200
+ }
201
+ static {
202
+ this.ɵfac = i0.ɵɵngDeclareFactory({
203
+ minVersion: "12.0.0",
204
+ version: "22.2.3",
205
+ ngImport: i0,
206
+ type: CNativeDatetimeAdapter,
207
+ deps: [],
208
+ target: i0.ɵɵFactoryTarget.Injectable
209
+ });
210
+ }
211
+ static {
212
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
213
+ minVersion: "12.0.0",
214
+ version: "22.2.3",
215
+ ngImport: i0,
216
+ type: CNativeDatetimeAdapter
217
+ });
218
+ }
219
+ };
220
+ i0.ɵɵngDeclareClassMetadata({
221
+ minVersion: "12.0.0",
222
+ version: "22.2.3",
223
+ ngImport: i0,
224
+ type: CNativeDatetimeAdapter,
225
+ decorators: [{ type: Injectable }],
226
+ ctorParameters: () => []
227
+ });
242
228
  const CMAT_NATIVE_DATETIME_FORMATS = {
243
- parse: {},
244
- display: {
245
- dateInput: { year: 'numeric', month: '2-digit', day: '2-digit' },
246
- monthInput: { month: 'long' },
247
- datetimeInput: { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit' },
248
- timeInput: { hour: '2-digit', minute: '2-digit' },
249
- yearInput: { year: 'numeric' },
250
- monthYearLabel: { year: 'numeric', month: 'short' },
251
- dateA11yLabel: { year: 'numeric', month: 'long', day: 'numeric' },
252
- monthYearA11yLabel: 'MMMM yyyy',
253
- popupHeaderDateLabel: 'EEE, MMM dd'
254
- }
229
+ parse: {},
230
+ display: {
231
+ dateInput: {
232
+ year: "numeric",
233
+ month: "2-digit",
234
+ day: "2-digit"
235
+ },
236
+ monthInput: { month: "long" },
237
+ datetimeInput: {
238
+ year: "numeric",
239
+ month: "2-digit",
240
+ day: "2-digit",
241
+ hour: "2-digit",
242
+ minute: "2-digit"
243
+ },
244
+ timeInput: {
245
+ hour: "2-digit",
246
+ minute: "2-digit"
247
+ },
248
+ yearInput: { year: "numeric" },
249
+ monthYearLabel: {
250
+ year: "numeric",
251
+ month: "short"
252
+ },
253
+ dateA11yLabel: {
254
+ year: "numeric",
255
+ month: "long",
256
+ day: "numeric"
257
+ },
258
+ monthYearA11yLabel: "MMMM yyyy",
259
+ popupHeaderDateLabel: "EEE, MMM dd"
260
+ }
255
261
  };
256
-
257
262
  function range$1(length, valueFunction) {
258
- const valuesArray = new Array(length);
259
- for (let i = 0; i < length; i++) {
260
- valuesArray[i] = valueFunction(i);
261
- }
262
- return valuesArray;
263
- }
264
- class DayjsDatetimeAdapter extends DatetimeAdapter {
265
- constructor() {
266
- const matDateLocale = inject(MAT_DATE_LOCALE, { optional: true });
267
- const _delegate = inject(DateAdapter);
268
- const locale = typeof matDateLocale === 'string' ? matDateLocale : dayjs.locale();
269
- super(_delegate);
270
- this.setLocale(locale);
271
- dayjs.extend(localeData);
272
- }
273
- setLocale(locale) {
274
- super.setLocale(locale);
275
- const dayjsLocaleData = dayjs.localeData();
276
- this._localeData = {
277
- firstDayOfWeek: dayjsLocaleData.firstDayOfWeek(),
278
- longMonths: dayjsLocaleData.months(),
279
- shortMonths: dayjsLocaleData.monthsShort(),
280
- dates: range$1(31, i => super.createDate(2017, 0, i + 1).format('D')),
281
- hours: range$1(24, i => this.createDatetime(2017, 0, 1, i, 0).format('H')),
282
- minutes: range$1(60, i => this.createDatetime(2017, 0, 1, 1, i).format('m')),
283
- longDaysOfWeek: dayjsLocaleData.weekdays(),
284
- shortDaysOfWeek: dayjsLocaleData.weekdaysShort(),
285
- narrowDaysOfWeek: dayjsLocaleData.weekdaysMin()
286
- };
287
- }
288
- getHour(date) {
289
- return super.clone(date).hour();
290
- }
291
- getMinute(date) {
292
- return super.clone(date).minute();
293
- }
294
- isInNextMonth(startDate, endDate) {
295
- const nextMonth = this._getDateInNextMonth(startDate);
296
- return super.sameMonthAndYear(nextMonth, endDate);
297
- }
298
- createDatetime(year, month, date, hour, minute) {
299
- if (month < 0 || month > 11) {
300
- throw Error(`Invalid month index "${month}". Month index has to be between 0 and 11.`);
301
- }
302
- if (date < 1) {
303
- throw Error(`Invalid date "${date}". Date has to be greater than 0.`);
304
- }
305
- if (hour < 0 || hour > 23) {
306
- throw Error(`Invalid hour "${hour}". Hour has to be between 0 and 23.`);
307
- }
308
- if (minute < 0 || minute > 59) {
309
- throw Error(`Invalid minute "${minute}". Minute has to be between 0 and 59.`);
310
- }
311
- const result = dayjs(new Date(year, month, date, hour, minute));
312
- if (!result.isValid()) {
313
- throw Error(`Invalid date "${date}" for month with index "${month}".`);
314
- }
315
- return result;
316
- }
317
- getFirstDateOfMonth(date) {
318
- return super.clone(date).startOf('month');
319
- }
320
- getHourNames() {
321
- return this._localeData.hours;
322
- }
323
- getMinuteNames() {
324
- return this._localeData.minutes;
325
- }
326
- addCalendarHours(date, hours) {
327
- return super.clone(date).add(hours, 'hour');
328
- }
329
- addCalendarMinutes(date, minutes) {
330
- return super.clone(date).add(minutes, 'minute');
331
- }
332
- deserialize(value) {
333
- return this._delegate.deserialize(value);
334
- }
335
- _getDateInNextMonth(date) {
336
- return super.clone(date).date(1).add(1, 'month');
337
- }
338
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: DayjsDatetimeAdapter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
339
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: DayjsDatetimeAdapter }); }
263
+ const valuesArray = new Array(length);
264
+ for (let i = 0; i < length; i++) valuesArray[i] = valueFunction(i);
265
+ return valuesArray;
340
266
  }
341
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: DayjsDatetimeAdapter, decorators: [{
342
- type: Injectable
343
- }], ctorParameters: () => [] });
344
-
267
+ var DayjsDatetimeAdapter = class DayjsDatetimeAdapter extends DatetimeAdapter {
268
+ constructor() {
269
+ const matDateLocale = inject(MAT_DATE_LOCALE, { optional: true });
270
+ const _delegate = inject(DateAdapter);
271
+ const locale = typeof matDateLocale === "string" ? matDateLocale : dayjs.locale();
272
+ super(_delegate);
273
+ this.setLocale(locale);
274
+ dayjs.extend(localeData);
275
+ }
276
+ setLocale(locale) {
277
+ super.setLocale(locale);
278
+ const dayjsLocaleData = dayjs.localeData();
279
+ this._localeData = {
280
+ firstDayOfWeek: dayjsLocaleData.firstDayOfWeek(),
281
+ longMonths: dayjsLocaleData.months(),
282
+ shortMonths: dayjsLocaleData.monthsShort(),
283
+ dates: range$1(31, (i) => super.createDate(2017, 0, i + 1).format("D")),
284
+ hours: range$1(24, (i) => this.createDatetime(2017, 0, 1, i, 0).format("H")),
285
+ minutes: range$1(60, (i) => this.createDatetime(2017, 0, 1, 1, i).format("m")),
286
+ longDaysOfWeek: dayjsLocaleData.weekdays(),
287
+ shortDaysOfWeek: dayjsLocaleData.weekdaysShort(),
288
+ narrowDaysOfWeek: dayjsLocaleData.weekdaysMin()
289
+ };
290
+ }
291
+ getHour(date) {
292
+ return super.clone(date).hour();
293
+ }
294
+ getMinute(date) {
295
+ return super.clone(date).minute();
296
+ }
297
+ isInNextMonth(startDate, endDate) {
298
+ const nextMonth = this._getDateInNextMonth(startDate);
299
+ return super.sameMonthAndYear(nextMonth, endDate);
300
+ }
301
+ createDatetime(year, month, date, hour, minute) {
302
+ if (month < 0 || month > 11) throw Error(`Invalid month index "${month}". Month index has to be between 0 and 11.`);
303
+ if (date < 1) throw Error(`Invalid date "${date}". Date has to be greater than 0.`);
304
+ if (hour < 0 || hour > 23) throw Error(`Invalid hour "${hour}". Hour has to be between 0 and 23.`);
305
+ if (minute < 0 || minute > 59) throw Error(`Invalid minute "${minute}". Minute has to be between 0 and 59.`);
306
+ const result = dayjs(new Date(year, month, date, hour, minute));
307
+ if (!result.isValid()) throw Error(`Invalid date "${date}" for month with index "${month}".`);
308
+ return result;
309
+ }
310
+ getFirstDateOfMonth(date) {
311
+ return super.clone(date).startOf("month");
312
+ }
313
+ getHourNames() {
314
+ return this._localeData.hours;
315
+ }
316
+ getMinuteNames() {
317
+ return this._localeData.minutes;
318
+ }
319
+ addCalendarHours(date, hours) {
320
+ return super.clone(date).add(hours, "hour");
321
+ }
322
+ addCalendarMinutes(date, minutes) {
323
+ return super.clone(date).add(minutes, "minute");
324
+ }
325
+ deserialize(value) {
326
+ return this._delegate.deserialize(value);
327
+ }
328
+ _getDateInNextMonth(date) {
329
+ return super.clone(date).date(1).add(1, "month");
330
+ }
331
+ static {
332
+ this.ɵfac = i0.ɵɵngDeclareFactory({
333
+ minVersion: "12.0.0",
334
+ version: "22.2.3",
335
+ ngImport: i0,
336
+ type: DayjsDatetimeAdapter,
337
+ deps: [],
338
+ target: i0.ɵɵFactoryTarget.Injectable
339
+ });
340
+ }
341
+ static {
342
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
343
+ minVersion: "12.0.0",
344
+ version: "22.2.3",
345
+ ngImport: i0,
346
+ type: DayjsDatetimeAdapter
347
+ });
348
+ }
349
+ };
350
+ i0.ɵɵngDeclareClassMetadata({
351
+ minVersion: "12.0.0",
352
+ version: "22.2.3",
353
+ ngImport: i0,
354
+ type: DayjsDatetimeAdapter,
355
+ decorators: [{ type: Injectable }],
356
+ ctorParameters: () => []
357
+ });
345
358
  const CMAT_DAYJS_DATETIME_FORMATS = {
346
- parse: {
347
- dateInput: 'L',
348
- monthInput: 'MMMM',
349
- timeInput: 'LT',
350
- datetimeInput: 'L LT',
351
- yearInput: 'YYYY'
352
- },
353
- display: {
354
- dateInput: 'L',
355
- monthInput: 'MMMM',
356
- datetimeInput: 'L LT',
357
- timeInput: 'LT',
358
- yearInput: 'YYYY',
359
- monthYearLabel: 'MMM YYYY',
360
- dateA11yLabel: 'LL',
361
- monthYearA11yLabel: 'MMMM YYYY',
362
- popupHeaderDateLabel: 'MMM DD, ddd'
363
- }
359
+ parse: {
360
+ dateInput: "L",
361
+ monthInput: "MMMM",
362
+ timeInput: "LT",
363
+ datetimeInput: "L LT",
364
+ yearInput: "YYYY"
365
+ },
366
+ display: {
367
+ dateInput: "L",
368
+ monthInput: "MMMM",
369
+ datetimeInput: "L LT",
370
+ timeInput: "LT",
371
+ yearInput: "YYYY",
372
+ monthYearLabel: "MMM YYYY",
373
+ dateA11yLabel: "LL",
374
+ monthYearA11yLabel: "MMMM YYYY",
375
+ popupHeaderDateLabel: "MMM DD, ddd"
376
+ }
364
377
  };
365
-
366
- const CMAT_DAYJS_DATE_ADAPTER_OPTIONS = new InjectionToken('CMAT_DAYJS_DATE_ADAPTER_OPTIONS', {
367
- providedIn: 'root',
368
- factory: CMAT_DAYJS_DATE_ADAPTER_OPTIONS_FACTORY
378
+ const CMAT_DAYJS_DATE_ADAPTER_OPTIONS = new InjectionToken("CMAT_DAYJS_DATE_ADAPTER_OPTIONS", {
379
+ providedIn: "root",
380
+ factory: CMAT_DAYJS_DATE_ADAPTER_OPTIONS_FACTORY
369
381
  });
370
- // eslint-disable-next-line @typescript-eslint/naming-convention
371
382
  function CMAT_DAYJS_DATE_ADAPTER_OPTIONS_FACTORY() {
372
- return {
373
- useUtc: false
374
- };
383
+ return { useUtc: false };
375
384
  }
376
385
  function range(length, valueFunction) {
377
- const valuesArray = new Array(length);
378
- for (let i = 0; i < length; i++) {
379
- valuesArray[i] = valueFunction(i);
380
- }
381
- return valuesArray;
382
- }
383
- class DayjsDateAdapter extends DateAdapter {
384
- constructor() {
385
- super();
386
- this._options = inject(CMAT_DAYJS_DATE_ADAPTER_OPTIONS, { optional: true });
387
- const dateLocale = inject(MAT_DATE_LOCALE, { optional: true });
388
- this._initializeParser(dateLocale ?? undefined);
389
- }
390
- get _shouldUseUtc() {
391
- const { useUtc } = this._options ?? {};
392
- return !!useUtc;
393
- }
394
- setLocale(locale) {
395
- super.setLocale(locale);
396
- const dayJsLocaleData = this._dayJs().localeData();
397
- this._localeData = {
398
- firstDayOfWeek: dayJsLocaleData.firstDayOfWeek(),
399
- longMonths: dayJsLocaleData.months(),
400
- shortMonths: dayJsLocaleData.monthsShort(),
401
- dates: range(31, i => this.createDate(2017, 0, i + 1).format('D')),
402
- longDaysOfWeek: range(7, i => this._dayJs().set('day', i).format('dddd')),
403
- shortDaysOfWeek: dayJsLocaleData.weekdaysShort(),
404
- narrowDaysOfWeek: dayJsLocaleData.weekdaysMin(),
405
- };
406
- }
407
- getYear(date) {
408
- return this._dayJs(date).year();
409
- }
410
- getMonth(date) {
411
- return this._dayJs(date).month();
412
- }
413
- getDate(date) {
414
- return this._dayJs(date).date();
415
- }
416
- getDayOfWeek(date) {
417
- return this._dayJs(date).day();
418
- }
419
- getMonthNames(style) {
420
- return style === 'long' ? this._localeData.longMonths : this._localeData.shortMonths;
421
- }
422
- getDateNames() {
423
- return this._localeData.dates;
424
- }
425
- getDayOfWeekNames(style) {
426
- if (style === 'long') {
427
- return this._localeData.longDaysOfWeek;
428
- }
429
- if (style === 'short') {
430
- return this._localeData.shortDaysOfWeek;
431
- }
432
- return this._localeData.narrowDaysOfWeek;
433
- }
434
- getYearName(date) {
435
- return this._dayJs(date).format('YYYY');
436
- }
437
- getFirstDayOfWeek() {
438
- return this._localeData.firstDayOfWeek;
439
- }
440
- getNumDaysInMonth(date) {
441
- return this._dayJs(date).daysInMonth();
442
- }
443
- clone(date) {
444
- return date.clone();
445
- }
446
- createDate(year, month, date) {
447
- const returnDayjs = this._dayJs()
448
- .set('year', year)
449
- .set('month', month)
450
- .set('date', date);
451
- return returnDayjs;
452
- }
453
- today() {
454
- return this._dayJs();
455
- }
456
- parse(value, parseFormat) {
457
- const locale = this.locale;
458
- if (value && typeof value === 'string') {
459
- return this._dayJs(value, parseFormat, locale);
460
- }
461
- if (value instanceof Date || dayjs.isDayjs(value)) {
462
- return this._dayJs(value).locale(locale);
463
- }
464
- return null;
465
- }
466
- format(date, displayFormat) {
467
- if (!this.isValid(date)) {
468
- throw Error('DayjsDateAdapter: Cannot format invalid date.');
469
- }
470
- return date.locale(this.locale).format(displayFormat);
471
- }
472
- addCalendarYears(date, years) {
473
- return date.add(years, 'year');
474
- }
475
- addCalendarMonths(date, months) {
476
- return date.add(months, 'month');
477
- }
478
- addCalendarDays(date, days) {
479
- return date.add(days, 'day');
480
- }
481
- toIso8601(date) {
482
- return date.toISOString();
483
- }
484
- deserialize(value) {
485
- let date;
486
- if (value instanceof Date) {
487
- date = this._dayJs(value);
488
- }
489
- else if (this.isDateInstance(value)) {
490
- return this.clone(value);
491
- }
492
- if (typeof value === 'string') {
493
- if (!value) {
494
- return null;
495
- }
496
- date = this._dayJs(value);
497
- }
498
- if (date && this.isValid(date)) {
499
- return this._dayJs(date); // NOTE: Is this necessary since Dayjs is immutable and Moment was not?
500
- }
501
- return super.deserialize(value);
502
- }
503
- isDateInstance(obj) {
504
- return dayjs.isDayjs(obj);
505
- }
506
- isValid(date) {
507
- return this._dayJs(date).isValid();
508
- }
509
- invalid() {
510
- return this._dayJs(null);
511
- }
512
- _dayJs(input, format, locale) {
513
- if (!this._shouldUseUtc) {
514
- return dayjs(input, format, locale);
515
- }
516
- const utcDate = format ? dayjs.utc(input, format) : dayjs.utc(input);
517
- return locale ? utcDate.locale(locale) : utcDate;
518
- }
519
- _initializeParser(dateLocale) {
520
- if (this._shouldUseUtc) {
521
- dayjs.extend(utc);
522
- }
523
- dayjs.extend(LocalizedFormat);
524
- dayjs.extend(customParseFormat);
525
- dayjs.extend(localeData);
526
- this.setLocale(dateLocale ?? dayjs.locale());
527
- }
528
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: DayjsDateAdapter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
529
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: DayjsDateAdapter }); }
386
+ const valuesArray = new Array(length);
387
+ for (let i = 0; i < length; i++) valuesArray[i] = valueFunction(i);
388
+ return valuesArray;
530
389
  }
531
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: DayjsDateAdapter, decorators: [{
532
- type: Injectable
533
- }], ctorParameters: () => [] });
534
-
390
+ var DayjsDateAdapter = class DayjsDateAdapter extends DateAdapter {
391
+ constructor() {
392
+ super();
393
+ this._options = inject(CMAT_DAYJS_DATE_ADAPTER_OPTIONS, { optional: true });
394
+ const dateLocale = inject(MAT_DATE_LOCALE, { optional: true });
395
+ this._initializeParser(dateLocale ?? void 0);
396
+ }
397
+ get _shouldUseUtc() {
398
+ const { useUtc } = this._options ?? {};
399
+ return !!useUtc;
400
+ }
401
+ setLocale(locale) {
402
+ super.setLocale(locale);
403
+ const dayJsLocaleData = this._dayJs().localeData();
404
+ this._localeData = {
405
+ firstDayOfWeek: dayJsLocaleData.firstDayOfWeek(),
406
+ longMonths: dayJsLocaleData.months(),
407
+ shortMonths: dayJsLocaleData.monthsShort(),
408
+ dates: range(31, (i) => this.createDate(2017, 0, i + 1).format("D")),
409
+ longDaysOfWeek: range(7, (i) => this._dayJs().set("day", i).format("dddd")),
410
+ shortDaysOfWeek: dayJsLocaleData.weekdaysShort(),
411
+ narrowDaysOfWeek: dayJsLocaleData.weekdaysMin()
412
+ };
413
+ }
414
+ getYear(date) {
415
+ return this._dayJs(date).year();
416
+ }
417
+ getMonth(date) {
418
+ return this._dayJs(date).month();
419
+ }
420
+ getDate(date) {
421
+ return this._dayJs(date).date();
422
+ }
423
+ getDayOfWeek(date) {
424
+ return this._dayJs(date).day();
425
+ }
426
+ getMonthNames(style) {
427
+ return style === "long" ? this._localeData.longMonths : this._localeData.shortMonths;
428
+ }
429
+ getDateNames() {
430
+ return this._localeData.dates;
431
+ }
432
+ getDayOfWeekNames(style) {
433
+ if (style === "long") return this._localeData.longDaysOfWeek;
434
+ if (style === "short") return this._localeData.shortDaysOfWeek;
435
+ return this._localeData.narrowDaysOfWeek;
436
+ }
437
+ getYearName(date) {
438
+ return this._dayJs(date).format("YYYY");
439
+ }
440
+ getFirstDayOfWeek() {
441
+ return this._localeData.firstDayOfWeek;
442
+ }
443
+ getNumDaysInMonth(date) {
444
+ return this._dayJs(date).daysInMonth();
445
+ }
446
+ clone(date) {
447
+ return date.clone();
448
+ }
449
+ createDate(year, month, date) {
450
+ return this._dayJs().set("year", year).set("month", month).set("date", date);
451
+ }
452
+ today() {
453
+ return this._dayJs();
454
+ }
455
+ parse(value, parseFormat) {
456
+ const locale = this.locale;
457
+ if (value && typeof value === "string") return this._dayJs(value, parseFormat, locale);
458
+ if (value instanceof Date || dayjs.isDayjs(value)) return this._dayJs(value).locale(locale);
459
+ return null;
460
+ }
461
+ format(date, displayFormat) {
462
+ if (!this.isValid(date)) throw Error("DayjsDateAdapter: Cannot format invalid date.");
463
+ return date.locale(this.locale).format(displayFormat);
464
+ }
465
+ addCalendarYears(date, years) {
466
+ return date.add(years, "year");
467
+ }
468
+ addCalendarMonths(date, months) {
469
+ return date.add(months, "month");
470
+ }
471
+ addCalendarDays(date, days) {
472
+ return date.add(days, "day");
473
+ }
474
+ toIso8601(date) {
475
+ return date.toISOString();
476
+ }
477
+ deserialize(value) {
478
+ let date;
479
+ if (value instanceof Date) date = this._dayJs(value);
480
+ else if (this.isDateInstance(value)) return this.clone(value);
481
+ if (typeof value === "string") {
482
+ if (!value) return null;
483
+ date = this._dayJs(value);
484
+ }
485
+ if (date && this.isValid(date)) return this._dayJs(date);
486
+ return super.deserialize(value);
487
+ }
488
+ isDateInstance(obj) {
489
+ return dayjs.isDayjs(obj);
490
+ }
491
+ isValid(date) {
492
+ return this._dayJs(date).isValid();
493
+ }
494
+ invalid() {
495
+ return this._dayJs(null);
496
+ }
497
+ _dayJs(input, format, locale) {
498
+ if (!this._shouldUseUtc) return dayjs(input, format, locale);
499
+ const utcDate = format ? dayjs.utc(input, format) : dayjs.utc(input);
500
+ return locale ? utcDate.locale(locale) : utcDate;
501
+ }
502
+ _initializeParser(dateLocale) {
503
+ if (this._shouldUseUtc) dayjs.extend(utc);
504
+ dayjs.extend(LocalizedFormat);
505
+ dayjs.extend(customParseFormat);
506
+ dayjs.extend(localeData);
507
+ this.setLocale(dateLocale ?? dayjs.locale());
508
+ }
509
+ static {
510
+ this.ɵfac = i0.ɵɵngDeclareFactory({
511
+ minVersion: "12.0.0",
512
+ version: "22.2.3",
513
+ ngImport: i0,
514
+ type: DayjsDateAdapter,
515
+ deps: [],
516
+ target: i0.ɵɵFactoryTarget.Injectable
517
+ });
518
+ }
519
+ static {
520
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
521
+ minVersion: "12.0.0",
522
+ version: "22.2.3",
523
+ ngImport: i0,
524
+ type: DayjsDateAdapter
525
+ });
526
+ }
527
+ };
528
+ i0.ɵɵngDeclareClassMetadata({
529
+ minVersion: "12.0.0",
530
+ version: "22.2.3",
531
+ ngImport: i0,
532
+ type: DayjsDateAdapter,
533
+ decorators: [{ type: Injectable }],
534
+ ctorParameters: () => []
535
+ });
535
536
  const CMAT_DAYJS_DATE_FORMATS = {
536
- parse: {
537
- dateInput: 'YYYY/MM/DD',
538
- },
539
- display: {
540
- dateInput: 'YYYY/MM/DD',
541
- monthYearLabel: 'YYYY MMM',
542
- dateA11yLabel: 'LL',
543
- monthYearA11yLabel: 'YYYY MMMM',
544
- }
537
+ parse: { dateInput: "YYYY/MM/DD" },
538
+ display: {
539
+ dateInput: "YYYY/MM/DD",
540
+ monthYearLabel: "YYYY MMM",
541
+ dateA11yLabel: "LL",
542
+ monthYearA11yLabel: "YYYY MMMM"
543
+ }
545
544
  };
546
-
547
- /**
548
- * Generated bundle index. Do not edit.
549
- */
550
-
551
545
  export { CMAT_DATETIME_FORMATS, CMAT_DAYJS_DATETIME_FORMATS, CMAT_DAYJS_DATE_ADAPTER_OPTIONS, CMAT_DAYJS_DATE_ADAPTER_OPTIONS_FACTORY, CMAT_DAYJS_DATE_FORMATS, CMAT_NATIVE_DATETIME_FORMATS, CNativeDatetimeAdapter, DatetimeAdapter, DayjsDateAdapter, DayjsDatetimeAdapter };
552
- //# sourceMappingURL=cmat-components-adapter.mjs.map
546
+
547
+ //# sourceMappingURL=cmat-components-adapter.mjs.map