@ptsecurity/mosaic 15.6.0 → 16.0.0

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 (750) hide show
  1. package/_theming.scss +19 -0
  2. package/_visual.scss +2 -0
  3. package/autocomplete/autocomplete-trigger.directive.d.ts +6 -16
  4. package/autocomplete/autocomplete.component.d.ts +1 -1
  5. package/button/button.component.d.ts +1 -1
  6. package/button-toggle/button-toggle.component.d.ts +3 -3
  7. package/card/card.component.d.ts +1 -1
  8. package/checkbox/_checkbox-theme.scss +4 -0
  9. package/checkbox/checkbox-config.d.ts +1 -1
  10. package/checkbox/checkbox.d.ts +1 -1
  11. package/code-block/actionbar.component.d.ts +1 -1
  12. package/code-block/code-block.component.d.ts +1 -1
  13. package/core/common-behaviors/color.d.ts +1 -1
  14. package/core/common-behaviors/constructor.d.ts +2 -2
  15. package/core/common-behaviors/disabled.d.ts +1 -1
  16. package/core/common-behaviors/error-state.d.ts +1 -1
  17. package/core/common-behaviors/tabindex.d.ts +1 -1
  18. package/core/datetime/date-formats.d.ts +1 -1
  19. package/core/formatters/index.d.ts +1 -1
  20. package/core/formatters/number/formatter.d.ts +55 -0
  21. package/core/label/label-options.d.ts +1 -1
  22. package/core/locales/en-US.d.ts +13 -2
  23. package/core/locales/es-LA.d.ts +21 -0
  24. package/core/locales/fa-IR.d.ts +22 -0
  25. package/core/locales/locale-service.d.ts +111 -5
  26. package/core/locales/pt-BR.d.ts +21 -0
  27. package/core/locales/ru-RU.d.ts +13 -2
  28. package/core/locales/zh-CN.d.ts +20 -0
  29. package/core/option/action.d.ts +1 -1
  30. package/core/option/optgroup.d.ts +1 -1
  31. package/core/option/option.d.ts +37 -8
  32. package/core/overlay/overlay-position-map.d.ts +7 -1
  33. package/core/selection/pseudo-checkbox/pseudo-checkbox.d.ts +2 -2
  34. package/core/styles/_variables.scss +1 -0
  35. package/core/styles/theming/_theming.scss +1 -0
  36. package/datepicker/calendar-body.component.d.ts +2 -2
  37. package/datepicker/calendar-header.component.d.ts +9 -3
  38. package/datepicker/calendar.component.d.ts +4 -5
  39. package/datepicker/datepicker-input.directive.d.ts +1 -1
  40. package/datepicker/datepicker-toggle.component.d.ts +1 -1
  41. package/datepicker/datepicker.component.d.ts +1 -1
  42. package/datepicker/month-view.component.d.ts +4 -5
  43. package/divider/divider.component.d.ts +1 -1
  44. package/dl/dl.component.d.ts +1 -1
  45. package/dropdown/dropdown-item.component.d.ts +1 -1
  46. package/dropdown/dropdown-trigger.directive.d.ts +1 -1
  47. package/dropdown/dropdown.component.d.ts +1 -1
  48. package/dropdown/dropdown.types.d.ts +3 -3
  49. package/ellipsis-center/ellipsis-center.directive.d.ts +1 -1
  50. package/{esm2020 → esm2022}/autocomplete/autocomplete-origin.directive.mjs +4 -4
  51. package/esm2022/autocomplete/autocomplete-trigger.directive.mjs +555 -0
  52. package/{esm2020 → esm2022}/autocomplete/autocomplete.component.mjs +26 -26
  53. package/{esm2020 → esm2022}/autocomplete/autocomplete.module.mjs +10 -10
  54. package/esm2022/button/button.component.mjs +148 -0
  55. package/{esm2020 → esm2022}/button/button.module.mjs +13 -13
  56. package/esm2022/button-toggle/button-toggle.component.mjs +381 -0
  57. package/{esm2020 → esm2022}/button-toggle/button-toggle.module.mjs +5 -5
  58. package/esm2022/card/card.component.mjs +80 -0
  59. package/{esm2020 → esm2022}/card/card.module.mjs +9 -9
  60. package/{esm2020 → esm2022}/checkbox/checkbox-module.mjs +5 -5
  61. package/{esm2020 → esm2022}/checkbox/checkbox-required-validator.mjs +4 -4
  62. package/esm2022/checkbox/checkbox.mjs +300 -0
  63. package/{esm2020 → esm2022}/code-block/actionbar.component.mjs +4 -4
  64. package/esm2022/code-block/code-block.component.mjs +157 -0
  65. package/esm2022/code-block/code-block.module.mjs +60 -0
  66. package/esm2022/core/common-behaviors/color.mjs +33 -0
  67. package/{esm2020 → esm2022}/core/common-behaviors/common-module.mjs +5 -5
  68. package/{esm2020 → esm2022}/core/common-behaviors/disabled.mjs +6 -6
  69. package/{esm2020 → esm2022}/core/common-behaviors/tabindex.mjs +6 -6
  70. package/{esm2020 → esm2022}/core/error/error-options.mjs +7 -7
  71. package/{esm2020 → esm2022}/core/formatters/date/formatter.mjs +4 -4
  72. package/{esm2020 → esm2022}/core/formatters/date/formatter.pipe.mjs +40 -40
  73. package/esm2022/core/formatters/index.mjs +86 -0
  74. package/esm2022/core/formatters/number/formatter.mjs +350 -0
  75. package/{esm2020 → esm2022}/core/forms/forms-module.mjs +7 -7
  76. package/{esm2020 → esm2022}/core/forms/forms.directive.mjs +7 -7
  77. package/{esm2020 → esm2022}/core/highlight/highlight.pipe.mjs +4 -4
  78. package/{esm2020 → esm2022}/core/highlight/index.mjs +5 -5
  79. package/{esm2020 → esm2022}/core/line/line.mjs +8 -8
  80. package/esm2022/core/locales/en-US.mjs +21 -0
  81. package/esm2022/core/locales/es-LA.mjs +27 -0
  82. package/esm2022/core/locales/fa-IR.mjs +28 -0
  83. package/{esm2020 → esm2022}/core/locales/locale-service.mjs +7 -7
  84. package/{esm2020 → esm2022}/core/locales/locale-service.module.mjs +7 -7
  85. package/esm2022/core/locales/pt-BR.mjs +27 -0
  86. package/esm2022/core/locales/ru-RU.mjs +21 -0
  87. package/esm2022/core/locales/zh-CN.mjs +26 -0
  88. package/{esm2020 → esm2022}/core/option/action.mjs +9 -9
  89. package/{esm2020 → esm2022}/core/option/optgroup.mjs +4 -4
  90. package/{esm2020 → esm2022}/core/option/option-module.mjs +5 -5
  91. package/esm2022/core/option/option.mjs +298 -0
  92. package/esm2022/core/overlay/overlay-position-map.mjs +251 -0
  93. package/{esm2020 → esm2022}/core/pop-up/pop-up-trigger.mjs +4 -4
  94. package/{esm2020 → esm2022}/core/pop-up/pop-up.mjs +4 -4
  95. package/{esm2020 → esm2022}/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +4 -4
  96. package/{esm2020 → esm2022}/core/selection/pseudo-checkbox/pseudo-checkbox.module.mjs +5 -5
  97. package/esm2022/core/services/measure-scrollbar.service.mjs +48 -0
  98. package/{esm2020 → esm2022}/core/utils/data-size/data-size.pipe.mjs +8 -8
  99. package/{esm2020 → esm2022}/core/version.mjs +2 -2
  100. package/{esm2020 → esm2022}/datepicker/calendar-body.component.mjs +4 -4
  101. package/esm2022/datepicker/calendar-header.component.mjs +135 -0
  102. package/esm2022/datepicker/calendar.component.mjs +166 -0
  103. package/esm2022/datepicker/datepicker-input.directive.mjs +955 -0
  104. package/{esm2020 → esm2022}/datepicker/datepicker-intl.mjs +4 -4
  105. package/{esm2020 → esm2022}/datepicker/datepicker-module.mjs +38 -38
  106. package/esm2022/datepicker/datepicker-toggle.component.mjs +86 -0
  107. package/esm2022/datepicker/datepicker.component.mjs +393 -0
  108. package/esm2022/datepicker/month-view.component.mjs +149 -0
  109. package/{esm2020 → esm2022}/divider/divider.component.mjs +4 -4
  110. package/{esm2020 → esm2022}/divider/divider.module.mjs +5 -5
  111. package/{esm2020 → esm2022}/dl/dl.component.mjs +10 -10
  112. package/{esm2020 → esm2022}/dl/dl.module.mjs +13 -13
  113. package/{esm2020 → esm2022}/dropdown/dropdown-content.directive.mjs +4 -4
  114. package/{esm2020 → esm2022}/dropdown/dropdown-item.component.mjs +6 -6
  115. package/esm2022/dropdown/dropdown-trigger.directive.mjs +489 -0
  116. package/esm2022/dropdown/dropdown.component.mjs +292 -0
  117. package/{esm2020 → esm2022}/dropdown/dropdown.module.mjs +15 -15
  118. package/esm2022/ellipsis-center/ellipsis-center.directive.mjs +106 -0
  119. package/{esm2020 → esm2022}/file-upload/file-drop.mjs +4 -4
  120. package/{esm2020 → esm2022}/file-upload/file-upload.module.mjs +25 -25
  121. package/esm2022/file-upload/multiple-file-upload.component.mjs +165 -0
  122. package/esm2022/file-upload/single-file-upload.component.mjs +134 -0
  123. package/{esm2020 → esm2022}/form-field/cleaner.mjs +4 -4
  124. package/esm2022/form-field/form-field.mjs +267 -0
  125. package/{esm2020 → esm2022}/form-field/form-field.module.mjs +23 -23
  126. package/{esm2020 → esm2022}/form-field/hint.mjs +4 -4
  127. package/{esm2020 → esm2022}/form-field/password-hint.mjs +9 -9
  128. package/{esm2020 → esm2022}/form-field/prefix.mjs +4 -4
  129. package/{esm2020 → esm2022}/form-field/stepper.mjs +6 -6
  130. package/{esm2020 → esm2022}/form-field/suffix.mjs +4 -4
  131. package/esm2022/form-field/validate.directive.mjs +158 -0
  132. package/{esm2020 → esm2022}/icon/icon.component.mjs +7 -7
  133. package/{esm2020 → esm2022}/icon/icon.module.mjs +11 -11
  134. package/{esm2020 → esm2022}/input/input-number-validators.mjs +7 -7
  135. package/esm2022/input/input-number.mjs +168 -0
  136. package/esm2022/input/input-password.mjs +343 -0
  137. package/esm2022/input/input.mjs +297 -0
  138. package/{esm2020 → esm2022}/input/input.module.mjs +23 -23
  139. package/esm2022/link/link.component.mjs +122 -0
  140. package/{esm2020 → esm2022}/link/link.module.mjs +7 -7
  141. package/esm2022/list/list-selection.component.mjs +705 -0
  142. package/{esm2020 → esm2022}/list/list.component.mjs +7 -7
  143. package/{esm2020 → esm2022}/list/list.module.mjs +20 -20
  144. package/esm2022/loader-overlay/loader-overlay.component.mjs +103 -0
  145. package/{esm2020 → esm2022}/loader-overlay/loader-overlay.module.mjs +17 -17
  146. package/{esm2020 → esm2022}/markdown/markdown.component.mjs +13 -13
  147. package/{esm2020 → esm2022}/markdown/markdown.module.mjs +5 -5
  148. package/{esm2020 → esm2022}/markdown/markdown.service.mjs +4 -4
  149. package/{esm2020 → esm2022}/modal/css-unit.pipe.mjs +4 -4
  150. package/esm2022/modal/modal-control.service.mjs +85 -0
  151. package/esm2022/modal/modal.component.mjs +520 -0
  152. package/{esm2020 → esm2022}/modal/modal.directive.mjs +13 -13
  153. package/esm2022/modal/modal.module.mjs +75 -0
  154. package/{esm2020 → esm2022}/modal/modal.service.mjs +8 -8
  155. package/esm2022/navbar/navbar-item.component.mjs +606 -0
  156. package/esm2022/navbar/navbar.component.mjs +248 -0
  157. package/{esm2020 → esm2022}/navbar/navbar.module.mjs +37 -37
  158. package/{esm2020 → esm2022}/navbar/vertical-navbar.component.mjs +20 -17
  159. package/esm2022/popover/popover-confirm.component.mjs +108 -0
  160. package/esm2022/popover/popover.component.mjs +266 -0
  161. package/{esm2020 → esm2022}/popover/popover.module.mjs +8 -8
  162. package/{esm2020 → esm2022}/progress-bar/progress-bar.component.mjs +4 -4
  163. package/{esm2020 → esm2022}/progress-bar/progress-bar.module.mjs +7 -7
  164. package/{esm2020 → esm2022}/progress-spinner/progress-spinner.component.mjs +12 -12
  165. package/{esm2020 → esm2022}/progress-spinner/progress-spinner.module.mjs +7 -7
  166. package/esm2022/radio/radio.component.mjs +457 -0
  167. package/{esm2020 → esm2022}/radio/radio.module.mjs +5 -5
  168. package/esm2022/select/select-option.directive.mjs +65 -0
  169. package/esm2022/select/select.component.mjs +1160 -0
  170. package/{esm2020 → esm2022}/select/select.module.mjs +32 -32
  171. package/esm2022/sidebar/sidebar.component.mjs +146 -0
  172. package/{esm2020 → esm2022}/sidebar/sidebar.module.mjs +9 -9
  173. package/esm2022/sidepanel/sidepanel-container.component.mjs +110 -0
  174. package/{esm2020 → esm2022}/sidepanel/sidepanel-directives.mjs +18 -18
  175. package/{esm2020 → esm2022}/sidepanel/sidepanel.module.mjs +32 -32
  176. package/{esm2020 → esm2022}/sidepanel/sidepanel.service.mjs +10 -10
  177. package/esm2022/splitter/splitter.component.mjs +482 -0
  178. package/{esm2020 → esm2022}/splitter/splitter.module.mjs +12 -12
  179. package/{esm2020 → esm2022}/table/table.component.mjs +4 -4
  180. package/{esm2020 → esm2022}/table/table.module.mjs +9 -9
  181. package/esm2022/tabs/paginated-tab-header.mjs +488 -0
  182. package/esm2022/tabs/tab-body.component.mjs +179 -0
  183. package/{esm2020 → esm2022}/tabs/tab-content.directive.mjs +4 -4
  184. package/esm2022/tabs/tab-group.component.mjs +349 -0
  185. package/{esm2020 → esm2022}/tabs/tab-header.component.mjs +4 -4
  186. package/{esm2020 → esm2022}/tabs/tab-label-wrapper.directive.mjs +4 -4
  187. package/{esm2020 → esm2022}/tabs/tab-label.directive.mjs +4 -4
  188. package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +111 -0
  189. package/{esm2020 → esm2022}/tabs/tab.component.mjs +43 -34
  190. package/{esm2020 → esm2022}/tabs/tabs.module.mjs +42 -42
  191. package/esm2022/tags/tag-input.mjs +250 -0
  192. package/esm2022/tags/tag-list.component.mjs +718 -0
  193. package/esm2022/tags/tag.component.mjs +381 -0
  194. package/esm2022/tags/tag.module.mjs +56 -0
  195. package/esm2022/textarea/textarea.component.mjs +254 -0
  196. package/{esm2020 → esm2022}/textarea/textarea.module.mjs +5 -5
  197. package/esm2022/timepicker/timepicker.directive.mjs +647 -0
  198. package/{esm2020 → esm2022}/timepicker/timepicker.module.mjs +11 -11
  199. package/{esm2020 → esm2022}/timezone/cities-by-filter.pipe.mjs +4 -4
  200. package/esm2022/timezone/timezone-option.component.mjs +48 -0
  201. package/{esm2020 → esm2022}/timezone/timezone-option.directive.mjs +4 -4
  202. package/{esm2020 → esm2022}/timezone/timezone-select.component.mjs +11 -11
  203. package/{esm2020 → esm2022}/timezone/timezone.module.mjs +29 -29
  204. package/{esm2020 → esm2022}/timezone/utc-offset.pipe.mjs +4 -4
  205. package/esm2022/title/title.directive.mjs +107 -0
  206. package/{esm2020 → esm2022}/title/title.module.mjs +5 -5
  207. package/{esm2020 → esm2022}/toast/toast-container.component.mjs +4 -4
  208. package/esm2022/toast/toast.component.mjs +92 -0
  209. package/esm2022/toast/toast.module.mjs +48 -0
  210. package/esm2022/toast/toast.service.mjs +188 -0
  211. package/esm2022/toggle/toggle.component.mjs +156 -0
  212. package/{esm2020 → esm2022}/toggle/toggle.module.mjs +5 -5
  213. package/esm2022/tooltip/tooltip.component.mjs +299 -0
  214. package/{esm2020 → esm2022}/tooltip/tooltip.module.mjs +14 -14
  215. package/esm2022/tree/data-source/flat-data-source.mjs +162 -0
  216. package/{esm2020 → esm2022}/tree/node.mjs +4 -4
  217. package/{esm2020 → esm2022}/tree/outlet.mjs +4 -4
  218. package/esm2022/tree/padding.directive.mjs +113 -0
  219. package/esm2022/tree/toggle.mjs +81 -0
  220. package/esm2022/tree/tree-base.mjs +243 -0
  221. package/esm2022/tree/tree-option.component.mjs +303 -0
  222. package/esm2022/tree/tree-selection.component.mjs +558 -0
  223. package/{esm2020 → esm2022}/tree/tree.mjs +4 -4
  224. package/{esm2020 → esm2022}/tree/tree.module.mjs +21 -21
  225. package/esm2022/tree-select/tree-select.component.mjs +936 -0
  226. package/{esm2020 → esm2022}/tree-select/tree-select.module.mjs +17 -17
  227. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-autocomplete.mjs +80 -77
  228. package/fesm2022/ptsecurity-mosaic-autocomplete.mjs.map +1 -0
  229. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-button-toggle.mjs +47 -47
  230. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-button-toggle.mjs.map +1 -1
  231. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-button.mjs +25 -25
  232. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-button.mjs.map +1 -1
  233. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-card.mjs +17 -17
  234. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-card.mjs.map +1 -1
  235. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-checkbox.mjs +39 -39
  236. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-checkbox.mjs.map +1 -1
  237. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-code-block.mjs +34 -34
  238. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-code-block.mjs.map +1 -1
  239. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-core.mjs +598 -222
  240. package/fesm2022/ptsecurity-mosaic-core.mjs.map +1 -0
  241. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-datepicker.mjs +335 -351
  242. package/fesm2022/ptsecurity-mosaic-datepicker.mjs.map +1 -0
  243. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-divider.mjs +7 -7
  244. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-divider.mjs.map +1 -1
  245. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-dl.mjs +21 -21
  246. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-dl.mjs.map +1 -1
  247. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-dropdown.mjs +89 -89
  248. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-dropdown.mjs.map +1 -1
  249. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-ellipsis-center.mjs +11 -11
  250. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-ellipsis-center.mjs.map +1 -1
  251. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-file-upload.mjs +55 -47
  252. package/fesm2022/ptsecurity-mosaic-file-upload.mjs.map +1 -0
  253. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-form-field.mjs +80 -80
  254. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-form-field.mjs.map +1 -1
  255. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-icon.mjs +16 -16
  256. package/fesm2022/ptsecurity-mosaic-icon.mjs.map +1 -0
  257. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-input.mjs +128 -128
  258. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-input.mjs.map +1 -1
  259. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-link.mjs +22 -22
  260. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-link.mjs.map +1 -1
  261. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-list.mjs +86 -86
  262. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-list.mjs.map +1 -1
  263. package/fesm2022/ptsecurity-mosaic-loader-overlay.mjs +155 -0
  264. package/{fesm2015 → fesm2022}/ptsecurity-mosaic-loader-overlay.mjs.map +1 -1
  265. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-markdown.mjs +19 -19
  266. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-markdown.mjs.map +1 -1
  267. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-modal.mjs +157 -144
  268. package/fesm2022/ptsecurity-mosaic-modal.mjs.map +1 -0
  269. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-navbar.mjs +184 -176
  270. package/fesm2022/ptsecurity-mosaic-navbar.mjs.map +1 -0
  271. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-popover.mjs +37 -37
  272. package/{fesm2015 → fesm2022}/ptsecurity-mosaic-popover.mjs.map +1 -1
  273. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-progress-bar.mjs +9 -9
  274. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-progress-bar.mjs.map +1 -1
  275. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-progress-spinner.mjs +18 -18
  276. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-progress-spinner.mjs.map +1 -1
  277. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-radio.mjs +78 -78
  278. package/{fesm2015 → fesm2022}/ptsecurity-mosaic-radio.mjs.map +1 -1
  279. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-select.mjs +188 -174
  280. package/fesm2022/ptsecurity-mosaic-select.mjs.map +1 -0
  281. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-sidebar.mjs +29 -29
  282. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-sidebar.mjs.map +1 -1
  283. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-sidepanel.mjs +63 -63
  284. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-sidepanel.mjs.map +1 -1
  285. package/{fesm2015 → fesm2022}/ptsecurity-mosaic-splitter.mjs +55 -55
  286. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-splitter.mjs.map +1 -1
  287. package/fesm2022/ptsecurity-mosaic-table.mjs +45 -0
  288. package/fesm2022/ptsecurity-mosaic-table.mjs.map +1 -0
  289. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-tabs.mjs +188 -179
  290. package/fesm2022/ptsecurity-mosaic-tabs.mjs.map +1 -0
  291. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-tags.mjs +131 -131
  292. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-tags.mjs.map +1 -1
  293. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-textarea.mjs +41 -41
  294. package/{fesm2015 → fesm2022}/ptsecurity-mosaic-textarea.mjs.map +1 -1
  295. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-timepicker.mjs +95 -95
  296. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-timepicker.mjs.map +1 -1
  297. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-timezone.mjs +53 -53
  298. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-timezone.mjs.map +1 -1
  299. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-title.mjs +18 -18
  300. package/fesm2022/ptsecurity-mosaic-title.mjs.map +1 -0
  301. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-toast.mjs +47 -41
  302. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-toast.mjs.map +1 -1
  303. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-toggle.mjs +35 -35
  304. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-toggle.mjs.map +1 -1
  305. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-tooltip.mjs +47 -47
  306. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-tooltip.mjs.map +1 -1
  307. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-tree-select.mjs +122 -122
  308. package/fesm2022/ptsecurity-mosaic-tree-select.mjs.map +1 -0
  309. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-tree.mjs +202 -198
  310. package/fesm2022/ptsecurity-mosaic-tree.mjs.map +1 -0
  311. package/file-upload/file-upload.d.ts +1 -1
  312. package/file-upload/multiple-file-upload.component.d.ts +5 -4
  313. package/file-upload/single-file-upload.component.d.ts +5 -4
  314. package/form-field/_form-field-theme.scss +4 -0
  315. package/form-field/form-field.d.ts +1 -1
  316. package/form-field/hint.d.ts +1 -1
  317. package/form-field/password-hint.d.ts +1 -1
  318. package/icon/icon.component.d.ts +1 -1
  319. package/input/input-number-validators.d.ts +2 -2
  320. package/input/input-number.d.ts +1 -1
  321. package/input/input-password.d.ts +2 -2
  322. package/input/input.d.ts +1 -1
  323. package/link/link.component.d.ts +1 -1
  324. package/list/list-selection.component.d.ts +2 -2
  325. package/loader-overlay/loader-overlay.component.d.ts +1 -1
  326. package/loader-overlay/loader-overlay.scss +3 -0
  327. package/markdown/markdown.component.d.ts +1 -1
  328. package/modal/modal.component.d.ts +5 -2
  329. package/modal/modal.module.d.ts +2 -1
  330. package/modal/modal.scss +14 -2
  331. package/modal/modal.type.d.ts +3 -3
  332. package/navbar/navbar-item.component.d.ts +3 -3
  333. package/navbar/navbar.component.d.ts +7 -4
  334. package/navbar/vertical-navbar.component.d.ts +5 -3
  335. package/package.json +149 -239
  336. package/popover/popover-confirm.component.d.ts +1 -1
  337. package/popover/popover.component.d.ts +1 -1
  338. package/prebuilt-themes/dark-theme.css +1 -1
  339. package/prebuilt-themes/default-theme.css +1 -1
  340. package/prebuilt-visual/default-visual.css +1 -1
  341. package/progress-bar/progress-bar.component.d.ts +2 -2
  342. package/progress-spinner/progress-spinner.component.d.ts +3 -3
  343. package/radio/_radio-theme.scss +4 -0
  344. package/radio/radio.component.d.ts +2 -2
  345. package/select/select.component.d.ts +12 -9
  346. package/select/select.scss +1 -1
  347. package/sidebar/sidebar.component.d.ts +3 -3
  348. package/sidepanel/sidepanel-directives.d.ts +2 -2
  349. package/splitter/splitter.component.d.ts +3 -3
  350. package/tabs/paginated-tab-header.d.ts +3 -3
  351. package/tabs/tab-body.component.d.ts +3 -3
  352. package/tabs/tab-group.component.d.ts +2 -2
  353. package/tabs/tab-header.component.d.ts +2 -2
  354. package/tabs/tab-label-wrapper.directive.d.ts +1 -1
  355. package/tabs/tab-nav-bar/tab-nav-bar.d.ts +1 -1
  356. package/tabs/tab.component.d.ts +1 -1
  357. package/tags/tag-input.d.ts +1 -1
  358. package/tags/tag-list.component.d.ts +1 -1
  359. package/tags/tag.component.d.ts +1 -1
  360. package/textarea/textarea.component.d.ts +1 -1
  361. package/timepicker/timepicker.directive.d.ts +1 -1
  362. package/timezone/timezone-option.component.d.ts +1 -1
  363. package/toast/toast.type.d.ts +1 -1
  364. package/toggle/toggle.component.d.ts +2 -2
  365. package/tooltip/tooltip.component.d.ts +3 -3
  366. package/tree/node.d.ts +1 -1
  367. package/tree/padding.directive.d.ts +1 -1
  368. package/tree/toggle.d.ts +2 -2
  369. package/tree/tree-base.d.ts +1 -1
  370. package/tree/tree-option.component.d.ts +1 -1
  371. package/tree/tree-option.scss +4 -2
  372. package/tree/tree-selection.component.d.ts +1 -1
  373. package/tree-select/tree-select.component.d.ts +1 -1
  374. package/esm2020/autocomplete/autocomplete-trigger.directive.mjs +0 -552
  375. package/esm2020/button/button.component.mjs +0 -148
  376. package/esm2020/button-toggle/button-toggle.component.mjs +0 -381
  377. package/esm2020/card/card.component.mjs +0 -80
  378. package/esm2020/checkbox/checkbox.mjs +0 -300
  379. package/esm2020/code-block/code-block.component.mjs +0 -157
  380. package/esm2020/code-block/code-block.module.mjs +0 -60
  381. package/esm2020/core/common-behaviors/color.mjs +0 -33
  382. package/esm2020/core/formatters/index.mjs +0 -78
  383. package/esm2020/core/formatters/number/formatter.mjs +0 -129
  384. package/esm2020/core/locales/en-US.mjs +0 -10
  385. package/esm2020/core/locales/es-LA.mjs +0 -6
  386. package/esm2020/core/locales/fa-IR.mjs +0 -6
  387. package/esm2020/core/locales/pt-BR.mjs +0 -6
  388. package/esm2020/core/locales/ru-RU.mjs +0 -10
  389. package/esm2020/core/locales/zh-CN.mjs +0 -6
  390. package/esm2020/core/option/option.mjs +0 -262
  391. package/esm2020/core/overlay/overlay-position-map.mjs +0 -245
  392. package/esm2020/core/services/measure-scrollbar.service.mjs +0 -48
  393. package/esm2020/datepicker/calendar-header.component.mjs +0 -134
  394. package/esm2020/datepicker/calendar.component.mjs +0 -175
  395. package/esm2020/datepicker/datepicker-input.directive.mjs +0 -954
  396. package/esm2020/datepicker/datepicker-toggle.component.mjs +0 -86
  397. package/esm2020/datepicker/datepicker.component.mjs +0 -393
  398. package/esm2020/datepicker/month-view.component.mjs +0 -158
  399. package/esm2020/dropdown/dropdown-trigger.directive.mjs +0 -489
  400. package/esm2020/dropdown/dropdown.component.mjs +0 -292
  401. package/esm2020/ellipsis-center/ellipsis-center.directive.mjs +0 -106
  402. package/esm2020/file-upload/multiple-file-upload.component.mjs +0 -161
  403. package/esm2020/file-upload/single-file-upload.component.mjs +0 -130
  404. package/esm2020/form-field/form-field.mjs +0 -267
  405. package/esm2020/form-field/validate.directive.mjs +0 -158
  406. package/esm2020/input/input-number.mjs +0 -168
  407. package/esm2020/input/input-password.mjs +0 -343
  408. package/esm2020/input/input.mjs +0 -297
  409. package/esm2020/link/link.component.mjs +0 -122
  410. package/esm2020/list/list-selection.component.mjs +0 -705
  411. package/esm2020/loader-overlay/loader-overlay.component.mjs +0 -103
  412. package/esm2020/modal/modal-control.service.mjs +0 -85
  413. package/esm2020/modal/modal.component.mjs +0 -510
  414. package/esm2020/modal/modal.module.mjs +0 -71
  415. package/esm2020/navbar/navbar-item.component.mjs +0 -606
  416. package/esm2020/navbar/navbar.component.mjs +0 -239
  417. package/esm2020/popover/popover-confirm.component.mjs +0 -108
  418. package/esm2020/popover/popover.component.mjs +0 -266
  419. package/esm2020/radio/radio.component.mjs +0 -457
  420. package/esm2020/select/select-option.directive.mjs +0 -65
  421. package/esm2020/select/select.component.mjs +0 -1146
  422. package/esm2020/sidebar/sidebar.component.mjs +0 -146
  423. package/esm2020/sidepanel/sidepanel-container.component.mjs +0 -110
  424. package/esm2020/splitter/splitter.component.mjs +0 -482
  425. package/esm2020/tabs/paginated-tab-header.mjs +0 -488
  426. package/esm2020/tabs/tab-body.component.mjs +0 -179
  427. package/esm2020/tabs/tab-group.component.mjs +0 -349
  428. package/esm2020/tabs/tab-nav-bar/tab-nav-bar.mjs +0 -111
  429. package/esm2020/tags/tag-input.mjs +0 -250
  430. package/esm2020/tags/tag-list.component.mjs +0 -718
  431. package/esm2020/tags/tag.component.mjs +0 -381
  432. package/esm2020/tags/tag.module.mjs +0 -56
  433. package/esm2020/textarea/textarea.component.mjs +0 -254
  434. package/esm2020/timepicker/timepicker.directive.mjs +0 -647
  435. package/esm2020/timezone/timezone-option.component.mjs +0 -48
  436. package/esm2020/title/title.directive.mjs +0 -107
  437. package/esm2020/toast/toast.component.mjs +0 -92
  438. package/esm2020/toast/toast.module.mjs +0 -42
  439. package/esm2020/toast/toast.service.mjs +0 -188
  440. package/esm2020/toggle/toggle.component.mjs +0 -156
  441. package/esm2020/tooltip/tooltip.component.mjs +0 -299
  442. package/esm2020/tree/data-source/flat-data-source.mjs +0 -162
  443. package/esm2020/tree/padding.directive.mjs +0 -113
  444. package/esm2020/tree/toggle.mjs +0 -81
  445. package/esm2020/tree/tree-base.mjs +0 -243
  446. package/esm2020/tree/tree-option.component.mjs +0 -300
  447. package/esm2020/tree/tree-selection.component.mjs +0 -557
  448. package/esm2020/tree-select/tree-select.component.mjs +0 -936
  449. package/fesm2015/ptsecurity-mosaic-autocomplete.mjs +0 -753
  450. package/fesm2015/ptsecurity-mosaic-autocomplete.mjs.map +0 -1
  451. package/fesm2015/ptsecurity-mosaic-button-toggle.mjs +0 -405
  452. package/fesm2015/ptsecurity-mosaic-button-toggle.mjs.map +0 -1
  453. package/fesm2015/ptsecurity-mosaic-button.mjs +0 -193
  454. package/fesm2015/ptsecurity-mosaic-button.mjs.map +0 -1
  455. package/fesm2015/ptsecurity-mosaic-card.mjs +0 -111
  456. package/fesm2015/ptsecurity-mosaic-card.mjs.map +0 -1
  457. package/fesm2015/ptsecurity-mosaic-checkbox.mjs +0 -351
  458. package/fesm2015/ptsecurity-mosaic-checkbox.mjs.map +0 -1
  459. package/fesm2015/ptsecurity-mosaic-code-block.mjs +0 -280
  460. package/fesm2015/ptsecurity-mosaic-code-block.mjs.map +0 -1
  461. package/fesm2015/ptsecurity-mosaic-core.mjs +0 -2314
  462. package/fesm2015/ptsecurity-mosaic-core.mjs.map +0 -1
  463. package/fesm2015/ptsecurity-mosaic-datepicker.mjs +0 -2112
  464. package/fesm2015/ptsecurity-mosaic-datepicker.mjs.map +0 -1
  465. package/fesm2015/ptsecurity-mosaic-divider.mjs +0 -61
  466. package/fesm2015/ptsecurity-mosaic-divider.mjs.map +0 -1
  467. package/fesm2015/ptsecurity-mosaic-dl.mjs +0 -126
  468. package/fesm2015/ptsecurity-mosaic-dl.mjs.map +0 -1
  469. package/fesm2015/ptsecurity-mosaic-dropdown.mjs +0 -1115
  470. package/fesm2015/ptsecurity-mosaic-dropdown.mjs.map +0 -1
  471. package/fesm2015/ptsecurity-mosaic-ellipsis-center.mjs +0 -113
  472. package/fesm2015/ptsecurity-mosaic-ellipsis-center.mjs.map +0 -1
  473. package/fesm2015/ptsecurity-mosaic-file-upload.mjs +0 -392
  474. package/fesm2015/ptsecurity-mosaic-file-upload.mjs.map +0 -1
  475. package/fesm2015/ptsecurity-mosaic-form-field.mjs +0 -772
  476. package/fesm2015/ptsecurity-mosaic-form-field.mjs.map +0 -1
  477. package/fesm2015/ptsecurity-mosaic-icon.mjs +0 -86
  478. package/fesm2015/ptsecurity-mosaic-icon.mjs.map +0 -1
  479. package/fesm2015/ptsecurity-mosaic-input.mjs +0 -951
  480. package/fesm2015/ptsecurity-mosaic-input.mjs.map +0 -1
  481. package/fesm2015/ptsecurity-mosaic-link.mjs +0 -150
  482. package/fesm2015/ptsecurity-mosaic-link.mjs.map +0 -1
  483. package/fesm2015/ptsecurity-mosaic-list.mjs +0 -807
  484. package/fesm2015/ptsecurity-mosaic-list.mjs.map +0 -1
  485. package/fesm2015/ptsecurity-mosaic-loader-overlay.mjs +0 -157
  486. package/fesm2015/ptsecurity-mosaic-markdown.mjs +0 -128
  487. package/fesm2015/ptsecurity-mosaic-markdown.mjs.map +0 -1
  488. package/fesm2015/ptsecurity-mosaic-modal.mjs +0 -875
  489. package/fesm2015/ptsecurity-mosaic-modal.mjs.map +0 -1
  490. package/fesm2015/ptsecurity-mosaic-navbar.mjs +0 -1055
  491. package/fesm2015/ptsecurity-mosaic-navbar.mjs.map +0 -1
  492. package/fesm2015/ptsecurity-mosaic-popover.mjs +0 -411
  493. package/fesm2015/ptsecurity-mosaic-progress-bar.mjs +0 -74
  494. package/fesm2015/ptsecurity-mosaic-progress-bar.mjs.map +0 -1
  495. package/fesm2015/ptsecurity-mosaic-progress-spinner.mjs +0 -93
  496. package/fesm2015/ptsecurity-mosaic-progress-spinner.mjs.map +0 -1
  497. package/fesm2015/ptsecurity-mosaic-radio.mjs +0 -481
  498. package/fesm2015/ptsecurity-mosaic-select.mjs +0 -1286
  499. package/fesm2015/ptsecurity-mosaic-select.mjs.map +0 -1
  500. package/fesm2015/ptsecurity-mosaic-sidebar.mjs +0 -202
  501. package/fesm2015/ptsecurity-mosaic-sidebar.mjs.map +0 -1
  502. package/fesm2015/ptsecurity-mosaic-sidepanel.mjs +0 -622
  503. package/fesm2015/ptsecurity-mosaic-sidepanel.mjs.map +0 -1
  504. package/fesm2015/ptsecurity-mosaic-splitter.mjs.map +0 -1
  505. package/fesm2015/ptsecurity-mosaic-table.mjs +0 -45
  506. package/fesm2015/ptsecurity-mosaic-table.mjs.map +0 -1
  507. package/fesm2015/ptsecurity-mosaic-tabs.mjs +0 -1523
  508. package/fesm2015/ptsecurity-mosaic-tabs.mjs.map +0 -1
  509. package/fesm2015/ptsecurity-mosaic-tags.mjs +0 -1397
  510. package/fesm2015/ptsecurity-mosaic-tags.mjs.map +0 -1
  511. package/fesm2015/ptsecurity-mosaic-textarea.mjs +0 -280
  512. package/fesm2015/ptsecurity-mosaic-timepicker.mjs +0 -708
  513. package/fesm2015/ptsecurity-mosaic-timepicker.mjs.map +0 -1
  514. package/fesm2015/ptsecurity-mosaic-timezone.mjs +0 -316
  515. package/fesm2015/ptsecurity-mosaic-timezone.mjs.map +0 -1
  516. package/fesm2015/ptsecurity-mosaic-title.mjs +0 -128
  517. package/fesm2015/ptsecurity-mosaic-title.mjs.map +0 -1
  518. package/fesm2015/ptsecurity-mosaic-toast.mjs +0 -379
  519. package/fesm2015/ptsecurity-mosaic-toast.mjs.map +0 -1
  520. package/fesm2015/ptsecurity-mosaic-toggle.mjs +0 -178
  521. package/fesm2015/ptsecurity-mosaic-toggle.mjs.map +0 -1
  522. package/fesm2015/ptsecurity-mosaic-tooltip.mjs +0 -369
  523. package/fesm2015/ptsecurity-mosaic-tooltip.mjs.map +0 -1
  524. package/fesm2015/ptsecurity-mosaic-tree-select.mjs +0 -983
  525. package/fesm2015/ptsecurity-mosaic-tree-select.mjs.map +0 -1
  526. package/fesm2015/ptsecurity-mosaic-tree.mjs +0 -1816
  527. package/fesm2015/ptsecurity-mosaic-tree.mjs.map +0 -1
  528. package/fesm2020/ptsecurity-mosaic-autocomplete.mjs.map +0 -1
  529. package/fesm2020/ptsecurity-mosaic-core.mjs.map +0 -1
  530. package/fesm2020/ptsecurity-mosaic-datepicker.mjs.map +0 -1
  531. package/fesm2020/ptsecurity-mosaic-file-upload.mjs.map +0 -1
  532. package/fesm2020/ptsecurity-mosaic-icon.mjs.map +0 -1
  533. package/fesm2020/ptsecurity-mosaic-loader-overlay.mjs +0 -155
  534. package/fesm2020/ptsecurity-mosaic-loader-overlay.mjs.map +0 -1
  535. package/fesm2020/ptsecurity-mosaic-modal.mjs.map +0 -1
  536. package/fesm2020/ptsecurity-mosaic-navbar.mjs.map +0 -1
  537. package/fesm2020/ptsecurity-mosaic-popover.mjs.map +0 -1
  538. package/fesm2020/ptsecurity-mosaic-radio.mjs.map +0 -1
  539. package/fesm2020/ptsecurity-mosaic-select.mjs.map +0 -1
  540. package/fesm2020/ptsecurity-mosaic-splitter.mjs +0 -524
  541. package/fesm2020/ptsecurity-mosaic-table.mjs +0 -45
  542. package/fesm2020/ptsecurity-mosaic-table.mjs.map +0 -1
  543. package/fesm2020/ptsecurity-mosaic-tabs.mjs.map +0 -1
  544. package/fesm2020/ptsecurity-mosaic-textarea.mjs.map +0 -1
  545. package/fesm2020/ptsecurity-mosaic-title.mjs.map +0 -1
  546. package/fesm2020/ptsecurity-mosaic-tree-select.mjs.map +0 -1
  547. package/fesm2020/ptsecurity-mosaic-tree.mjs.map +0 -1
  548. package/fesm2020/ptsecurity-mosaic.mjs +0 -4
  549. package/fesm2020/ptsecurity-mosaic.mjs.map +0 -1
  550. /package/{esm2020 → esm2022}/autocomplete/index.mjs +0 -0
  551. /package/{esm2020 → esm2022}/autocomplete/ptsecurity-mosaic-autocomplete.mjs +0 -0
  552. /package/{esm2020 → esm2022}/autocomplete/public-api.mjs +0 -0
  553. /package/{esm2020 → esm2022}/button/index.mjs +0 -0
  554. /package/{esm2020 → esm2022}/button/ptsecurity-mosaic-button.mjs +0 -0
  555. /package/{esm2020 → esm2022}/button/public-api.mjs +0 -0
  556. /package/{esm2020 → esm2022}/button-toggle/index.mjs +0 -0
  557. /package/{esm2020 → esm2022}/button-toggle/ptsecurity-mosaic-button-toggle.mjs +0 -0
  558. /package/{esm2020 → esm2022}/button-toggle/public-api.mjs +0 -0
  559. /package/{esm2020 → esm2022}/card/index.mjs +0 -0
  560. /package/{esm2020 → esm2022}/card/ptsecurity-mosaic-card.mjs +0 -0
  561. /package/{esm2020 → esm2022}/card/public-api.mjs +0 -0
  562. /package/{esm2020 → esm2022}/checkbox/checkbox-config.mjs +0 -0
  563. /package/{esm2020 → esm2022}/checkbox/index.mjs +0 -0
  564. /package/{esm2020 → esm2022}/checkbox/ptsecurity-mosaic-checkbox.mjs +0 -0
  565. /package/{esm2020 → esm2022}/checkbox/public-api.mjs +0 -0
  566. /package/{esm2020 → esm2022}/code-block/code-block.types.mjs +0 -0
  567. /package/{esm2020 → esm2022}/code-block/index.mjs +0 -0
  568. /package/{esm2020 → esm2022}/code-block/ptsecurity-mosaic-code-block.mjs +0 -0
  569. /package/{esm2020 → esm2022}/code-block/public-api.mjs +0 -0
  570. /package/{esm2020 → esm2022}/core/animation/animation.mjs +0 -0
  571. /package/{esm2020 → esm2022}/core/animation/fade-animations.mjs +0 -0
  572. /package/{esm2020 → esm2022}/core/animation/index.mjs +0 -0
  573. /package/{esm2020 → esm2022}/core/animation/select-animations.mjs +0 -0
  574. /package/{esm2020 → esm2022}/core/common-behaviors/constructor.mjs +0 -0
  575. /package/{esm2020 → esm2022}/core/common-behaviors/error-state.mjs +0 -0
  576. /package/{esm2020 → esm2022}/core/common-behaviors/index.mjs +0 -0
  577. /package/{esm2020 → esm2022}/core/datetime/date-adapter.mjs +0 -0
  578. /package/{esm2020 → esm2022}/core/datetime/date-formats.mjs +0 -0
  579. /package/{esm2020 → esm2022}/core/datetime/index.mjs +0 -0
  580. /package/{esm2020 → esm2022}/core/forms/index.mjs +0 -0
  581. /package/{esm2020 → esm2022}/core/index.mjs +0 -0
  582. /package/{esm2020 → esm2022}/core/label/label-options.mjs +0 -0
  583. /package/{esm2020 → esm2022}/core/locales/index.mjs +0 -0
  584. /package/{esm2020 → esm2022}/core/option/index.mjs +0 -0
  585. /package/{esm2020 → esm2022}/core/pop-up/constants.mjs +0 -0
  586. /package/{esm2020 → esm2022}/core/pop-up/index.mjs +0 -0
  587. /package/{esm2020 → esm2022}/core/ptsecurity-mosaic-core.mjs +0 -0
  588. /package/{esm2020 → esm2022}/core/public-api.mjs +0 -0
  589. /package/{esm2020 → esm2022}/core/select/constants.mjs +0 -0
  590. /package/{esm2020 → esm2022}/core/select/errors.mjs +0 -0
  591. /package/{esm2020 → esm2022}/core/select/events.mjs +0 -0
  592. /package/{esm2020 → esm2022}/core/select/index.mjs +0 -0
  593. /package/{esm2020 → esm2022}/core/selection/constants.mjs +0 -0
  594. /package/{esm2020 → esm2022}/core/selection/index.mjs +0 -0
  595. /package/{esm2020 → esm2022}/core/title/index.mjs +0 -0
  596. /package/{esm2020 → esm2022}/core/title/title-text-ref.mjs +0 -0
  597. /package/{esm2020 → esm2022}/core/utils/data-size/config.mjs +0 -0
  598. /package/{esm2020 → esm2022}/core/utils/data-size/index.mjs +0 -0
  599. /package/{esm2020 → esm2022}/core/utils/data-size/size.mjs +0 -0
  600. /package/{esm2020 → esm2022}/core/utils/index.mjs +0 -0
  601. /package/{esm2020 → esm2022}/core/utils/public-api.mjs +0 -0
  602. /package/{esm2020 → esm2022}/core/utils/utils.mjs +0 -0
  603. /package/{esm2020 → esm2022}/core/validation/index.mjs +0 -0
  604. /package/{esm2020 → esm2022}/core/validation/validation.mjs +0 -0
  605. /package/{esm2020 → esm2022}/datepicker/datepicker-animations.mjs +0 -0
  606. /package/{esm2020 → esm2022}/datepicker/datepicker-errors.mjs +0 -0
  607. /package/{esm2020 → esm2022}/datepicker/index.mjs +0 -0
  608. /package/{esm2020 → esm2022}/datepicker/ptsecurity-mosaic-datepicker.mjs +0 -0
  609. /package/{esm2020 → esm2022}/datepicker/public-api.mjs +0 -0
  610. /package/{esm2020 → esm2022}/divider/index.mjs +0 -0
  611. /package/{esm2020 → esm2022}/divider/ptsecurity-mosaic-divider.mjs +0 -0
  612. /package/{esm2020 → esm2022}/divider/public-api.mjs +0 -0
  613. /package/{esm2020 → esm2022}/dl/index.mjs +0 -0
  614. /package/{esm2020 → esm2022}/dl/ptsecurity-mosaic-dl.mjs +0 -0
  615. /package/{esm2020 → esm2022}/dl/public-api.mjs +0 -0
  616. /package/{esm2020 → esm2022}/dropdown/dropdown-animations.mjs +0 -0
  617. /package/{esm2020 → esm2022}/dropdown/dropdown-errors.mjs +0 -0
  618. /package/{esm2020 → esm2022}/dropdown/dropdown.types.mjs +0 -0
  619. /package/{esm2020 → esm2022}/dropdown/index.mjs +0 -0
  620. /package/{esm2020 → esm2022}/dropdown/ptsecurity-mosaic-dropdown.mjs +0 -0
  621. /package/{esm2020 → esm2022}/dropdown/public-api.mjs +0 -0
  622. /package/{esm2020 → esm2022}/ellipsis-center/index.mjs +0 -0
  623. /package/{esm2020 → esm2022}/ellipsis-center/ptsecurity-mosaic-ellipsis-center.mjs +0 -0
  624. /package/{esm2020 → esm2022}/ellipsis-center/public-api.mjs +0 -0
  625. /package/{esm2020 → esm2022}/file-upload/file-upload.mjs +0 -0
  626. /package/{esm2020 → esm2022}/file-upload/index.mjs +0 -0
  627. /package/{esm2020 → esm2022}/file-upload/ptsecurity-mosaic-file-upload.mjs +0 -0
  628. /package/{esm2020 → esm2022}/file-upload/public-api.mjs +0 -0
  629. /package/{esm2020 → esm2022}/form-field/form-field-control.mjs +0 -0
  630. /package/{esm2020 → esm2022}/form-field/form-field-errors.mjs +0 -0
  631. /package/{esm2020 → esm2022}/form-field/index.mjs +0 -0
  632. /package/{esm2020 → esm2022}/form-field/ptsecurity-mosaic-form-field.mjs +0 -0
  633. /package/{esm2020 → esm2022}/form-field/public-api.mjs +0 -0
  634. /package/{esm2020 → esm2022}/icon/index.mjs +0 -0
  635. /package/{esm2020 → esm2022}/icon/ptsecurity-mosaic-icon.mjs +0 -0
  636. /package/{esm2020 → esm2022}/icon/public-api.mjs +0 -0
  637. /package/{esm2020 → esm2022}/index.mjs +0 -0
  638. /package/{esm2020 → esm2022}/input/index.mjs +0 -0
  639. /package/{esm2020 → esm2022}/input/input-errors.mjs +0 -0
  640. /package/{esm2020 → esm2022}/input/input-value-accessor.mjs +0 -0
  641. /package/{esm2020 → esm2022}/input/ptsecurity-mosaic-input.mjs +0 -0
  642. /package/{esm2020 → esm2022}/input/public-api.mjs +0 -0
  643. /package/{esm2020 → esm2022}/link/index.mjs +0 -0
  644. /package/{esm2020 → esm2022}/link/ptsecurity-mosaic-link.mjs +0 -0
  645. /package/{esm2020 → esm2022}/link/public-api.mjs +0 -0
  646. /package/{esm2020 → esm2022}/list/index.mjs +0 -0
  647. /package/{esm2020 → esm2022}/list/ptsecurity-mosaic-list.mjs +0 -0
  648. /package/{esm2020 → esm2022}/list/public-api.mjs +0 -0
  649. /package/{esm2020 → esm2022}/loader-overlay/index.mjs +0 -0
  650. /package/{esm2020 → esm2022}/loader-overlay/ptsecurity-mosaic-loader-overlay.mjs +0 -0
  651. /package/{esm2020 → esm2022}/loader-overlay/public-api.mjs +0 -0
  652. /package/{esm2020 → esm2022}/markdown/index.mjs +0 -0
  653. /package/{esm2020 → esm2022}/markdown/markdown.values.mjs +0 -0
  654. /package/{esm2020 → esm2022}/markdown/ptsecurity-mosaic-markdown.mjs +0 -0
  655. /package/{esm2020 → esm2022}/markdown/public-api.mjs +0 -0
  656. /package/{esm2020 → esm2022}/modal/index.mjs +0 -0
  657. /package/{esm2020 → esm2022}/modal/modal-ref.class.mjs +0 -0
  658. /package/{esm2020 → esm2022}/modal/modal-util.mjs +0 -0
  659. /package/{esm2020 → esm2022}/modal/modal.type.mjs +0 -0
  660. /package/{esm2020 → esm2022}/modal/ptsecurity-mosaic-modal.mjs +0 -0
  661. /package/{esm2020 → esm2022}/modal/public-api.mjs +0 -0
  662. /package/{esm2020 → esm2022}/navbar/index.mjs +0 -0
  663. /package/{esm2020 → esm2022}/navbar/ptsecurity-mosaic-navbar.mjs +0 -0
  664. /package/{esm2020 → esm2022}/navbar/public-api.mjs +0 -0
  665. /package/{esm2020 → esm2022}/navbar/vertical-navbar.animation.mjs +0 -0
  666. /package/{esm2020 → esm2022}/popover/index.mjs +0 -0
  667. /package/{esm2020 → esm2022}/popover/popover-animations.mjs +0 -0
  668. /package/{esm2020 → esm2022}/popover/ptsecurity-mosaic-popover.mjs +0 -0
  669. /package/{esm2020 → esm2022}/popover/public-api.mjs +0 -0
  670. /package/{esm2020 → esm2022}/progress-bar/index.mjs +0 -0
  671. /package/{esm2020 → esm2022}/progress-bar/ptsecurity-mosaic-progress-bar.mjs +0 -0
  672. /package/{esm2020 → esm2022}/progress-bar/public-api.mjs +0 -0
  673. /package/{esm2020 → esm2022}/progress-spinner/index.mjs +0 -0
  674. /package/{esm2020 → esm2022}/progress-spinner/ptsecurity-mosaic-progress-spinner.mjs +0 -0
  675. /package/{esm2020 → esm2022}/progress-spinner/public-api.mjs +0 -0
  676. /package/{esm2020 → esm2022}/ptsecurity-mosaic.mjs +0 -0
  677. /package/{esm2020 → esm2022}/public-api.mjs +0 -0
  678. /package/{esm2020 → esm2022}/radio/index.mjs +0 -0
  679. /package/{esm2020 → esm2022}/radio/ptsecurity-mosaic-radio.mjs +0 -0
  680. /package/{esm2020 → esm2022}/radio/public-api.mjs +0 -0
  681. /package/{esm2020 → esm2022}/select/index.mjs +0 -0
  682. /package/{esm2020 → esm2022}/select/ptsecurity-mosaic-select.mjs +0 -0
  683. /package/{esm2020 → esm2022}/select/public-api.mjs +0 -0
  684. /package/{esm2020 → esm2022}/sidebar/index.mjs +0 -0
  685. /package/{esm2020 → esm2022}/sidebar/ptsecurity-mosaic-sidebar.mjs +0 -0
  686. /package/{esm2020 → esm2022}/sidebar/public-api.mjs +0 -0
  687. /package/{esm2020 → esm2022}/sidebar/sidebar-animations.mjs +0 -0
  688. /package/{esm2020 → esm2022}/sidepanel/index.mjs +0 -0
  689. /package/{esm2020 → esm2022}/sidepanel/ptsecurity-mosaic-sidepanel.mjs +0 -0
  690. /package/{esm2020 → esm2022}/sidepanel/public-api.mjs +0 -0
  691. /package/{esm2020 → esm2022}/sidepanel/sidepanel-animations.mjs +0 -0
  692. /package/{esm2020 → esm2022}/sidepanel/sidepanel-config.mjs +0 -0
  693. /package/{esm2020 → esm2022}/sidepanel/sidepanel-ref.mjs +0 -0
  694. /package/{esm2020 → esm2022}/splitter/index.mjs +0 -0
  695. /package/{esm2020 → esm2022}/splitter/ptsecurity-mosaic-splitter.mjs +0 -0
  696. /package/{esm2020 → esm2022}/splitter/public-api.mjs +0 -0
  697. /package/{esm2020 → esm2022}/table/index.mjs +0 -0
  698. /package/{esm2020 → esm2022}/table/ptsecurity-mosaic-table.mjs +0 -0
  699. /package/{esm2020 → esm2022}/table/public-api.mjs +0 -0
  700. /package/{esm2020 → esm2022}/tabs/index.mjs +0 -0
  701. /package/{esm2020 → esm2022}/tabs/ptsecurity-mosaic-tabs.mjs +0 -0
  702. /package/{esm2020 → esm2022}/tabs/public-api.mjs +0 -0
  703. /package/{esm2020 → esm2022}/tabs/tab-nav-bar/index.mjs +0 -0
  704. /package/{esm2020 → esm2022}/tabs/tabs-animations.mjs +0 -0
  705. /package/{esm2020 → esm2022}/tags/index.mjs +0 -0
  706. /package/{esm2020 → esm2022}/tags/ptsecurity-mosaic-tags.mjs +0 -0
  707. /package/{esm2020 → esm2022}/tags/public-api.mjs +0 -0
  708. /package/{esm2020 → esm2022}/tags/tag-default-options.mjs +0 -0
  709. /package/{esm2020 → esm2022}/tags/tag-text-control.mjs +0 -0
  710. /package/{esm2020 → esm2022}/textarea/index.mjs +0 -0
  711. /package/{esm2020 → esm2022}/textarea/ptsecurity-mosaic-textarea.mjs +0 -0
  712. /package/{esm2020 → esm2022}/textarea/public-api.mjs +0 -0
  713. /package/{esm2020 → esm2022}/timepicker/index.mjs +0 -0
  714. /package/{esm2020 → esm2022}/timepicker/ptsecurity-mosaic-timepicker.mjs +0 -0
  715. /package/{esm2020 → esm2022}/timepicker/public-api.mjs +0 -0
  716. /package/{esm2020 → esm2022}/timepicker/timepicker.constants.mjs +0 -0
  717. /package/{esm2020 → esm2022}/timezone/index.mjs +0 -0
  718. /package/{esm2020 → esm2022}/timezone/ptsecurity-mosaic-timezone.mjs +0 -0
  719. /package/{esm2020 → esm2022}/timezone/public-api.mjs +0 -0
  720. /package/{esm2020 → esm2022}/timezone/timezone.models.mjs +0 -0
  721. /package/{esm2020 → esm2022}/timezone/timezone.utils.mjs +0 -0
  722. /package/{esm2020 → esm2022}/title/index.mjs +0 -0
  723. /package/{esm2020 → esm2022}/title/ptsecurity-mosaic-title.mjs +0 -0
  724. /package/{esm2020 → esm2022}/title/public-api.mjs +0 -0
  725. /package/{esm2020 → esm2022}/toast/index.mjs +0 -0
  726. /package/{esm2020 → esm2022}/toast/ptsecurity-mosaic-toast.mjs +0 -0
  727. /package/{esm2020 → esm2022}/toast/public-api.mjs +0 -0
  728. /package/{esm2020 → esm2022}/toast/toast-animations.mjs +0 -0
  729. /package/{esm2020 → esm2022}/toast/toast.type.mjs +0 -0
  730. /package/{esm2020 → esm2022}/toggle/index.mjs +0 -0
  731. /package/{esm2020 → esm2022}/toggle/ptsecurity-mosaic-toggle.mjs +0 -0
  732. /package/{esm2020 → esm2022}/toggle/public-api.mjs +0 -0
  733. /package/{esm2020 → esm2022}/tooltip/index.mjs +0 -0
  734. /package/{esm2020 → esm2022}/tooltip/ptsecurity-mosaic-tooltip.mjs +0 -0
  735. /package/{esm2020 → esm2022}/tooltip/public-api.mjs +0 -0
  736. /package/{esm2020 → esm2022}/tooltip/tooltip.animations.mjs +0 -0
  737. /package/{esm2020 → esm2022}/tree/control/base-tree-control.mjs +0 -0
  738. /package/{esm2020 → esm2022}/tree/control/flat-tree-control.mjs +0 -0
  739. /package/{esm2020 → esm2022}/tree/control/nested-tree-control.mjs +0 -0
  740. /package/{esm2020 → esm2022}/tree/control/tree-control.mjs +0 -0
  741. /package/{esm2020 → esm2022}/tree/data-source/nested-data-source.mjs +0 -0
  742. /package/{esm2020 → esm2022}/tree/index.mjs +0 -0
  743. /package/{esm2020 → esm2022}/tree/ptsecurity-mosaic-tree.mjs +0 -0
  744. /package/{esm2020 → esm2022}/tree/public-api.mjs +0 -0
  745. /package/{esm2020 → esm2022}/tree/tree-errors.mjs +0 -0
  746. /package/{esm2020 → esm2022}/tree-select/index.mjs +0 -0
  747. /package/{esm2020 → esm2022}/tree-select/ptsecurity-mosaic-tree-select.mjs +0 -0
  748. /package/{esm2020 → esm2022}/tree-select/public-api.mjs +0 -0
  749. /package/{fesm2015 → fesm2022}/ptsecurity-mosaic.mjs +0 -0
  750. /package/{fesm2015 → fesm2022}/ptsecurity-mosaic.mjs.map +0 -0
@@ -1,2112 +0,0 @@
1
- import { A11yModule } from '@angular/cdk/a11y';
2
- import * as i3$1 from '@angular/cdk/overlay';
3
- import { Overlay, OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
4
- import { ComponentPortal, PortalModule } from '@angular/cdk/portal';
5
- import * as i1 from '@angular/common';
6
- import { DOCUMENT, CommonModule } from '@angular/common';
7
- import * as i0 from '@angular/core';
8
- import { EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, Input, Output, Optional, Inject, ViewChild, Injectable, forwardRef, Directive, ContentChild, InjectionToken, NgModule } from '@angular/core';
9
- import * as i3 from '@ptsecurity/mosaic/button';
10
- import { McButtonModule } from '@ptsecurity/mosaic/button';
11
- import * as i6 from '@ptsecurity/mosaic/icon';
12
- import { McIconModule } from '@ptsecurity/mosaic/icon';
13
- import * as i5 from '@ptsecurity/mosaic/select';
14
- import { McSelectModule } from '@ptsecurity/mosaic/select';
15
- import * as i1$1 from '@ptsecurity/mosaic/core';
16
- import { MC_DATE_FORMATS, validationTooltipShowDelay, validationTooltipHideDelay, MC_LOCALE_SERVICE } from '@ptsecurity/mosaic/core';
17
- import * as i4 from '@ptsecurity/mosaic/form-field';
18
- import { McFormFieldControl } from '@ptsecurity/mosaic/form-field';
19
- import { Subject, Subscription, of, merge } from 'rxjs';
20
- import { coerceBooleanProperty } from '@angular/cdk/coercion';
21
- import { NG_VALUE_ACCESSOR, NG_VALIDATORS, Validators } from '@angular/forms';
22
- import { TAB, SPACE, UP_ARROW, DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW, HOME, PAGE_UP, END, PAGE_DOWN, ESCAPE, isLetterKey, hasModifierKey, isVerticalMovement, isHorizontalMovement, DELETE, BACKSPACE } from '@ptsecurity/cdk/keycodes';
23
- import { take } from 'rxjs/operators';
24
- import { trigger, state, style, transition, animate } from '@angular/animations';
25
- import * as i5$1 from '@angular/cdk/bidi';
26
-
27
- // tslint:disable:no-magic-numbers
28
- /**
29
- * An internal class that represents the data corresponding to a single calendar cell.
30
- * @docs-private
31
- */
32
- class McCalendarCell {
33
- constructor(value, displayValue, enabled, cssClasses) {
34
- this.value = value;
35
- this.displayValue = displayValue;
36
- this.enabled = enabled;
37
- this.cssClasses = cssClasses;
38
- }
39
- }
40
- /**
41
- * An internal component used to display calendar data in a table.
42
- * @docs-private
43
- */
44
- class McCalendarBody {
45
- constructor() {
46
- /** The number of columns in the table. */
47
- this.numCols = 7;
48
- /** The cell number of the active cell in the table. */
49
- this.activeCell = 0;
50
- /**
51
- * The aspect ratio (width / height) to use for the cells in the table. This aspect ratio will be
52
- * maintained even as the table resizes.
53
- */
54
- this.cellAspectRatio = 1;
55
- /** Emits when a new value is selected. */
56
- this.selectedValueChange = new EventEmitter();
57
- }
58
- cellClicked(cell) {
59
- if (cell.enabled) {
60
- this.selectedValueChange.emit(cell.value);
61
- }
62
- }
63
- ngOnChanges(changes) {
64
- const columnChanges = changes.numCols;
65
- // tslint:disable-next-line:no-this-assignment
66
- const { rows, numCols } = this;
67
- if (changes.rows || columnChanges) {
68
- this.firstRowOffset = rows && rows.length && rows[0].length ? numCols - rows[0].length : 0;
69
- }
70
- if (changes.cellAspectRatio || columnChanges || !this.cellPadding) {
71
- this.cellPadding = `${this.cellAspectRatio * 50 / numCols}%`;
72
- }
73
- if (columnChanges || !this.cellWidth) {
74
- this.cellWidth = `${100 / numCols}%`;
75
- }
76
- }
77
- isActiveCell(rowIndex, colIndex) {
78
- let cellNumber = rowIndex * this.numCols + colIndex;
79
- // Account for the fact that the first row may not have as many cells.
80
- if (rowIndex) {
81
- cellNumber -= this.firstRowOffset;
82
- }
83
- return cellNumber === this.activeCell;
84
- }
85
- }
86
- /** @nocollapse */ McCalendarBody.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McCalendarBody, deps: [], target: i0.ɵɵFactoryTarget.Component });
87
- /** @nocollapse */ McCalendarBody.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: McCalendarBody, selector: "[mc-calendar-body]", inputs: { rows: "rows", todayValue: "todayValue", selectedValue: "selectedValue", labelMinRequiredCells: "labelMinRequiredCells", numCols: "numCols", activeCell: "activeCell", cellAspectRatio: "cellAspectRatio" }, outputs: { selectedValueChange: "selectedValueChange" }, host: { classAttribute: "mc-calendar__body" }, exportAs: ["mcCalendarBody"], usesOnChanges: true, ngImport: i0, template: "<!-- Create the first row separately so we can include a special spacer cell. -->\n<tr *ngFor=\"let row of rows; let rowIndex = index\">\n <!--\n We mark this cell as aria-hidden so it doesn't get read out as one of the days in the week.\n The aspect ratio of the table cells is maintained by setting the top and bottom padding as a\n percentage of the width (a variant of the trick described here:\n https://www.w3schools.com/howto/howto_css_aspect_ratio.asp).\n -->\n <td *ngIf=\"rowIndex === 0 && firstRowOffset\"\n class=\"mc-calendar__body-label\"\n [attr.colspan]=\"firstRowOffset\">\n </td>\n\n <td *ngFor=\"let item of row; let colIndex = index\"\n class=\"mc-calendar__body-cell\"\n [ngClass]=\"item.cssClasses!\"\n [tabindex]=\"isActiveCell(rowIndex, colIndex) ? 0 : -1\"\n [class.mc-calendar__body_disabled]=\"!item.enabled\"\n [class.mc-calendar__body_active]=\"isActiveCell(rowIndex, colIndex)\"\n (click)=\"cellClicked(item)\"\n [style.width]=\"cellWidth\"\n [style.paddingTop]=\"cellPadding\"\n [style.paddingBottom]=\"cellPadding\">\n <div class=\"mc-calendar__body-cell-content\"\n [class.mc-selected]=\"selectedValue === item.value\"\n [class.mc-calendar__body-today]=\"todayValue === item.value\">\n {{ item.displayValue }}\n </div>\n </td>\n</tr>\n", styles: [".mc-calendar__body{min-width:calc(7 * var(--mc-datepicker-body-size-cell-min-size, 32px))}.mc-calendar__body-cell{position:relative;height:0;line-height:0;text-align:center;outline:none;cursor:pointer}.mc-calendar__body_disabled{cursor:default}.mc-calendar__body-cell-content{position:absolute;top:var(--mc-datepicker-body-size-cell-margin, 5%);left:var(--mc-datepicker-body-size-cell-margin, 5%);padding:var(--mc-datepicker-body-size-cell-padding, 8px);display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;line-height:1;border-width:var(--mc-datepicker-body-size-cell-border-width, 1px);border-radius:var(--mc-datepicker-body-size-cell-border-radius, 0);border-style:solid}mc-month-view .mc-calendar__body-cell-content{justify-content:flex-end}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
88
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McCalendarBody, decorators: [{
89
- type: Component,
90
- args: [{ selector: '[mc-calendar-body]', exportAs: 'mcCalendarBody', host: {
91
- class: 'mc-calendar__body'
92
- }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- Create the first row separately so we can include a special spacer cell. -->\n<tr *ngFor=\"let row of rows; let rowIndex = index\">\n <!--\n We mark this cell as aria-hidden so it doesn't get read out as one of the days in the week.\n The aspect ratio of the table cells is maintained by setting the top and bottom padding as a\n percentage of the width (a variant of the trick described here:\n https://www.w3schools.com/howto/howto_css_aspect_ratio.asp).\n -->\n <td *ngIf=\"rowIndex === 0 && firstRowOffset\"\n class=\"mc-calendar__body-label\"\n [attr.colspan]=\"firstRowOffset\">\n </td>\n\n <td *ngFor=\"let item of row; let colIndex = index\"\n class=\"mc-calendar__body-cell\"\n [ngClass]=\"item.cssClasses!\"\n [tabindex]=\"isActiveCell(rowIndex, colIndex) ? 0 : -1\"\n [class.mc-calendar__body_disabled]=\"!item.enabled\"\n [class.mc-calendar__body_active]=\"isActiveCell(rowIndex, colIndex)\"\n (click)=\"cellClicked(item)\"\n [style.width]=\"cellWidth\"\n [style.paddingTop]=\"cellPadding\"\n [style.paddingBottom]=\"cellPadding\">\n <div class=\"mc-calendar__body-cell-content\"\n [class.mc-selected]=\"selectedValue === item.value\"\n [class.mc-calendar__body-today]=\"todayValue === item.value\">\n {{ item.displayValue }}\n </div>\n </td>\n</tr>\n", styles: [".mc-calendar__body{min-width:calc(7 * var(--mc-datepicker-body-size-cell-min-size, 32px))}.mc-calendar__body-cell{position:relative;height:0;line-height:0;text-align:center;outline:none;cursor:pointer}.mc-calendar__body_disabled{cursor:default}.mc-calendar__body-cell-content{position:absolute;top:var(--mc-datepicker-body-size-cell-margin, 5%);left:var(--mc-datepicker-body-size-cell-margin, 5%);padding:var(--mc-datepicker-body-size-cell-padding, 8px);display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;line-height:1;border-width:var(--mc-datepicker-body-size-cell-border-width, 1px);border-radius:var(--mc-datepicker-body-size-cell-border-radius, 0);border-style:solid}mc-month-view .mc-calendar__body-cell-content{justify-content:flex-end}\n"] }]
93
- }], propDecorators: { rows: [{
94
- type: Input
95
- }], todayValue: [{
96
- type: Input
97
- }], selectedValue: [{
98
- type: Input
99
- }], labelMinRequiredCells: [{
100
- type: Input
101
- }], numCols: [{
102
- type: Input
103
- }], activeCell: [{
104
- type: Input
105
- }], cellAspectRatio: [{
106
- type: Input
107
- }], selectedValueChange: [{
108
- type: Output
109
- }] } });
110
-
111
- const defaultMinYear = 1900;
112
- const defaultMaxYear = 2099;
113
- /** Default header for McCalendar */
114
- class McCalendarHeader {
115
- constructor(adapter) {
116
- this.adapter = adapter;
117
- this.years = [];
118
- // tslint:disable-next-line:no-magic-numbers
119
- this._maxDate = this.adapter.createDate(defaultMaxYear, 11);
120
- this._minDate = this.adapter.createDate(defaultMinYear, 1);
121
- /** Emits when any date is activated. */
122
- this.activeDateChange = new EventEmitter();
123
- this.monthSelected = new EventEmitter();
124
- this.yearSelected = new EventEmitter();
125
- this.monthNames = this.adapter.getMonthNames('long')
126
- .map((name, i) => ({ name, value: i }));
127
- }
128
- get activeDate() {
129
- return this._activeDate;
130
- }
131
- set activeDate(value) {
132
- this._activeDate = value;
133
- this.updateSelectedValues();
134
- }
135
- get maxDate() {
136
- return this._maxDate;
137
- }
138
- set maxDate(value) {
139
- if (!value) {
140
- return;
141
- }
142
- this._maxDate = value;
143
- this.updateYearsArray();
144
- }
145
- get minDate() {
146
- return this._minDate;
147
- }
148
- set minDate(value) {
149
- if (!value) {
150
- return;
151
- }
152
- this._minDate = value;
153
- this.updateYearsArray();
154
- }
155
- get previousDisabled() {
156
- return this.compareDate(this.activeDate, this.minDate) < 0;
157
- }
158
- get nextDisabled() {
159
- return this.compareDate(this.activeDate, this.maxDate) >= 0;
160
- }
161
- ngAfterContentInit() {
162
- this.updateYearsArray();
163
- this.updateSelectedValues();
164
- }
165
- /** Handles when a new month is selected. */
166
- onMonthSelected(month) {
167
- const year = this.adapter.getYear(this.activeDate);
168
- const normalizedDate = this.adapter.createDate(year, month);
169
- const daysInMonth = this.adapter.getNumDaysInMonth(normalizedDate);
170
- this.activeDate = this.adapter.createDate(year, month, Math.min(this.adapter.getDate(this.activeDate), daysInMonth));
171
- this.monthSelected.emit(this.activeDate);
172
- this.activeDateChange.emit(this.activeDate);
173
- }
174
- /** Handles when a new year is selected. */
175
- onYearSelected(year) {
176
- const month = this.adapter.getMonth(this.activeDate);
177
- const daysInMonth = this.adapter.getNumDaysInMonth(this.adapter.createDate(year, month));
178
- this.activeDate = this.adapter.createDate(year, month, Math.min(this.adapter.getDate(this.activeDate), daysInMonth));
179
- this.yearSelected.emit(this.activeDate);
180
- this.activeDateChange.emit(this.activeDate);
181
- }
182
- selectCurrentDate() {
183
- this.activeDate = this.adapter.today();
184
- this.activeDateChange.emit(this.activeDate);
185
- }
186
- /** Handles user clicks on the previous button. */
187
- selectPreviousMonth() {
188
- this.activeDate = this.adapter.addCalendarMonths(this.activeDate, -1);
189
- this.activeDateChange.emit(this.activeDate);
190
- }
191
- /** Handles user clicks on the next button. */
192
- selectNextMonth() {
193
- this.activeDate = this.adapter.addCalendarMonths(this.activeDate, 1);
194
- this.activeDateChange.emit(this.activeDate);
195
- }
196
- compareDate(first, second) {
197
- const normalizedFirst = this.adapter.createDate(this.adapter.getYear(first), this.adapter.getMonth(first));
198
- const normalizedSecond = this.adapter.createDate(this.adapter.getYear(second), this.adapter.getMonth(second));
199
- return this.adapter.compareDate(normalizedFirst, normalizedSecond);
200
- }
201
- updateSelectedValues() {
202
- this.selectedMonth = this.monthNames[this.adapter.getMonth(this.activeDate)].value;
203
- const selectedYear = this.adapter.getYear(this.activeDate);
204
- this.selectedYear = this.years.includes(selectedYear) ? selectedYear : this.years[0];
205
- }
206
- updateYearsArray() {
207
- const minYear = this.adapter.getYear(this.minDate);
208
- const maxYear = this.adapter.getYear(this.maxDate);
209
- this.years = [];
210
- for (let i = minYear; i <= maxYear; i++) {
211
- this.years.push(i);
212
- }
213
- }
214
- }
215
- /** @nocollapse */ McCalendarHeader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McCalendarHeader, deps: [{ token: i1$1.DateAdapter }], target: i0.ɵɵFactoryTarget.Component });
216
- /** @nocollapse */ McCalendarHeader.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: McCalendarHeader, selector: "mc-calendar-header", inputs: { activeDate: "activeDate", maxDate: "maxDate", minDate: "minDate" }, outputs: { activeDateChange: "activeDateChange", monthSelected: "monthSelected", yearSelected: "yearSelected" }, host: { classAttribute: "mc-calendar-header" }, exportAs: ["mcCalendarHeader"], ngImport: i0, template: "<div class=\"mc-calendar-header__select-group\">\n <mc-select\n class=\"mc-calendar-header__select\"\n #monthSelect=\"mcSelect\"\n [value]=\"selectedMonth\"\n [panelClass]=\"'mc-calendar-select-panel'\"\n (selectionChange)=\"onMonthSelected($event.value)\">\n\n <button class=\"mc-button_transparent layout-padding-right-xs\"\n mc-button\n mc-select-matcher\n [class.mc-active]=\"monthSelect.panelOpen\"\n [tabindex]=\"-1\">\n {{ monthSelect.triggerValue }}\n\n <i class=\"layout-padding-left-3xs\" mc-icon=\"mc-angle-down-S_16\"></i>\n </button>\n\n <mc-option *ngFor=\"let month of monthNames\"\n [mcTooltipDisabled]=\"true\"\n [value]=\"month.value\">\n {{ month.name }}\n </mc-option>\n </mc-select>\n\n <mc-select\n #yearSelect=\"mcSelect\"\n [value]=\"selectedYear\"\n [panelClass]=\"'mc-calendar-select-panel'\"\n (selectionChange)=\"onYearSelected($event.value)\">\n <button class=\"mc-button_transparent layout-padding-right-xs\"\n mc-button\n mc-select-matcher\n [class.mc-active]=\"yearSelect.panelOpen\"\n [tabindex]=\"-1\">\n {{ yearSelect.triggerValue }}\n\n <i class=\"layout-padding-left-3xs\" mc-icon=\"mc-angle-down-S_16\"></i>\n </button>\n\n <mc-option *ngFor=\"let year of years\"\n [mcTooltipDisabled]=\"true\"\n [value]=\"year\">\n {{ year }}\n </mc-option>\n </mc-select>\n</div>\n\n<div class=\"mc-calendar-header__button-group\">\n <button mc-button\n class=\"mc-button_transparent mc-calendar-header__previous-button\"\n [tabindex]=\"-1\"\n [disabled]=\"previousDisabled\"\n (click)=\"selectPreviousMonth()\">\n\n <i mc-icon=\"mc-angle-left-L_16\"></i>\n </button>\n\n <button mc-button\n class=\"mc-button_transparent\"\n [tabindex]=\"-1\"\n (click)=\"selectCurrentDate()\">\n\n <i mc-icon=\"mc-circle-8_16\"></i>\n </button>\n\n <button mc-button\n class=\"mc-button_transparent mc-calendar-header__next-button\"\n [tabindex]=\"-1\"\n [disabled]=\"nextDisabled\"\n (click)=\"selectNextMonth()\">\n\n <i mc-icon=\"mc-angle-right-L_16\"></i>\n </button>\n</div>\n", styles: [".mc-calendar-header{display:flex;flex-direction:row;justify-content:space-between;padding:var(--mc-datepicker-calendar-size-padding-top, 16px) var(--mc-datepicker-calendar-size-padding-horizontal, 8px) var(--mc-datepicker-calendar-size-padding-blocks, 12px) var(--mc-datepicker-calendar-size-padding-horizontal, 8px)}.mc-calendar-header__previous-button:after{border-left-width:var(--mc-datepicker-calendar-size-icon-border-width, 2px);transform:var(--mc-datepicker-calendar-size-icon-prev-icon-transform, translateX(2px) rotate(-45deg))}.mc-calendar-header__next-button:after{border-right-width:var(--mc-datepicker-calendar-size-icon-border-width, 2px);transform:var(--mc-datepicker-calendar-size-icon-nex-icon-transform, translateX(-2px) rotate(45deg))}.mc-calendar-header__select{width:auto!important}.mc-calendar-header__button-group,.mc-calendar-header__select-group{display:flex;flex-direction:row}.mc-calendar-select-panel{margin-top:2px;min-width:98%!important}.mc-calendar-select-panel .mc-select__content{max-height:384px;overflow-x:hidden;scrollbar-gutter:stable}.mc-calendar-select-panel .mc-select__content .mc-option{min-width:65px}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i3.McButton, selector: "[mc-button]", inputs: ["color", "tabIndex", "disabled"] }, { kind: "directive", type: i3.McButtonCssStyler, selector: "[mc-button]" }, { kind: "directive", type: i4.McValidateDirective, selector: " input[mcInput], input[mcInputPassword], input[mcTimepicker], input[mcDatepicker], textarea[mcTextarea], mc-select, mc-tree-select, mc-tag-list ", exportAs: ["McValidate"] }, { kind: "component", type: i5.McSelect, selector: "mc-select", inputs: ["disabled", "tabIndex", "hiddenItemsText", "panelClass", "backdropClass", "errorStateMatcher", "sortComparator", "hasBackdrop", "placeholder", "required", "multiple", "compareWith", "value", "id", "hiddenItemsTextFormatter"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["mcSelect"] }, { kind: "directive", type: i5.McSelectMatcher, selector: "mc-select-matcher, [mc-select-matcher]" }, { kind: "directive", type: i5.McOptionTooltip, selector: "mc-option" }, { kind: "component", type: i1$1.McOption, selector: "mc-option", inputs: ["value", "showCheckbox", "disabled"], outputs: ["onSelectionChange"], exportAs: ["mcOption"] }, { kind: "component", type: i6.McIcon, selector: "[mc-icon]", inputs: ["color"] }, { kind: "directive", type: i6.McIconCSSStyler, selector: "[mc-icon]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
217
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McCalendarHeader, decorators: [{
218
- type: Component,
219
- args: [{ selector: 'mc-calendar-header', exportAs: 'mcCalendarHeader', host: {
220
- class: 'mc-calendar-header'
221
- }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"mc-calendar-header__select-group\">\n <mc-select\n class=\"mc-calendar-header__select\"\n #monthSelect=\"mcSelect\"\n [value]=\"selectedMonth\"\n [panelClass]=\"'mc-calendar-select-panel'\"\n (selectionChange)=\"onMonthSelected($event.value)\">\n\n <button class=\"mc-button_transparent layout-padding-right-xs\"\n mc-button\n mc-select-matcher\n [class.mc-active]=\"monthSelect.panelOpen\"\n [tabindex]=\"-1\">\n {{ monthSelect.triggerValue }}\n\n <i class=\"layout-padding-left-3xs\" mc-icon=\"mc-angle-down-S_16\"></i>\n </button>\n\n <mc-option *ngFor=\"let month of monthNames\"\n [mcTooltipDisabled]=\"true\"\n [value]=\"month.value\">\n {{ month.name }}\n </mc-option>\n </mc-select>\n\n <mc-select\n #yearSelect=\"mcSelect\"\n [value]=\"selectedYear\"\n [panelClass]=\"'mc-calendar-select-panel'\"\n (selectionChange)=\"onYearSelected($event.value)\">\n <button class=\"mc-button_transparent layout-padding-right-xs\"\n mc-button\n mc-select-matcher\n [class.mc-active]=\"yearSelect.panelOpen\"\n [tabindex]=\"-1\">\n {{ yearSelect.triggerValue }}\n\n <i class=\"layout-padding-left-3xs\" mc-icon=\"mc-angle-down-S_16\"></i>\n </button>\n\n <mc-option *ngFor=\"let year of years\"\n [mcTooltipDisabled]=\"true\"\n [value]=\"year\">\n {{ year }}\n </mc-option>\n </mc-select>\n</div>\n\n<div class=\"mc-calendar-header__button-group\">\n <button mc-button\n class=\"mc-button_transparent mc-calendar-header__previous-button\"\n [tabindex]=\"-1\"\n [disabled]=\"previousDisabled\"\n (click)=\"selectPreviousMonth()\">\n\n <i mc-icon=\"mc-angle-left-L_16\"></i>\n </button>\n\n <button mc-button\n class=\"mc-button_transparent\"\n [tabindex]=\"-1\"\n (click)=\"selectCurrentDate()\">\n\n <i mc-icon=\"mc-circle-8_16\"></i>\n </button>\n\n <button mc-button\n class=\"mc-button_transparent mc-calendar-header__next-button\"\n [tabindex]=\"-1\"\n [disabled]=\"nextDisabled\"\n (click)=\"selectNextMonth()\">\n\n <i mc-icon=\"mc-angle-right-L_16\"></i>\n </button>\n</div>\n", styles: [".mc-calendar-header{display:flex;flex-direction:row;justify-content:space-between;padding:var(--mc-datepicker-calendar-size-padding-top, 16px) var(--mc-datepicker-calendar-size-padding-horizontal, 8px) var(--mc-datepicker-calendar-size-padding-blocks, 12px) var(--mc-datepicker-calendar-size-padding-horizontal, 8px)}.mc-calendar-header__previous-button:after{border-left-width:var(--mc-datepicker-calendar-size-icon-border-width, 2px);transform:var(--mc-datepicker-calendar-size-icon-prev-icon-transform, translateX(2px) rotate(-45deg))}.mc-calendar-header__next-button:after{border-right-width:var(--mc-datepicker-calendar-size-icon-border-width, 2px);transform:var(--mc-datepicker-calendar-size-icon-nex-icon-transform, translateX(-2px) rotate(45deg))}.mc-calendar-header__select{width:auto!important}.mc-calendar-header__button-group,.mc-calendar-header__select-group{display:flex;flex-direction:row}.mc-calendar-select-panel{margin-top:2px;min-width:98%!important}.mc-calendar-select-panel .mc-select__content{max-height:384px;overflow-x:hidden;scrollbar-gutter:stable}.mc-calendar-select-panel .mc-select__content .mc-option{min-width:65px}\n"] }]
222
- }], ctorParameters: function () { return [{ type: i1$1.DateAdapter }]; }, propDecorators: { activeDate: [{
223
- type: Input
224
- }], maxDate: [{
225
- type: Input
226
- }], minDate: [{
227
- type: Input
228
- }], activeDateChange: [{
229
- type: Output
230
- }], monthSelected: [{
231
- type: Output
232
- }], yearSelected: [{
233
- type: Output
234
- }] } });
235
-
236
- /** @docs-private */
237
- function createMissingDateImplError(provider) {
238
- return Error(`McDatepicker: No provider found for ${provider}. You must import one of the existing ` +
239
- `modules at your application root or provide a custom implementation or use exists ones.`);
240
- }
241
-
242
- // tslint:disable:no-magic-numbers
243
- const DAYS_PER_WEEK = 7;
244
- /**
245
- * An internal component used to display a single month in the datepicker.
246
- * @docs-private
247
- */
248
- class McMonthView {
249
- constructor(changeDetectorRef, dateFormats, adapter) {
250
- this.changeDetectorRef = changeDetectorRef;
251
- this.dateFormats = dateFormats;
252
- this.adapter = adapter;
253
- /** Emits when a new date is selected. */
254
- this.selectedChange = new EventEmitter();
255
- /** Emits when any date is selected. */
256
- this.userSelection = new EventEmitter();
257
- /** Emits when any date is activated. */
258
- this.activeDateChange = new EventEmitter();
259
- if (!this.adapter) {
260
- throw createMissingDateImplError('DateAdapter');
261
- }
262
- if (!this.dateFormats) {
263
- throw createMissingDateImplError('MC_DATE_FORMATS');
264
- }
265
- const firstDayOfWeek = this.adapter.getFirstDayOfWeek();
266
- const narrowWeekdays = this.adapter.getDayOfWeekNames('short');
267
- const longWeekdays = this.adapter.getDayOfWeekNames('long');
268
- // Rotate the labels for days of the week based on the configured first day of the week.
269
- const weekdays = longWeekdays.map((long, i) => {
270
- return { long, narrow: narrowWeekdays[i] };
271
- });
272
- this.weekdays = weekdays
273
- .slice(firstDayOfWeek)
274
- .concat(weekdays.slice(0, firstDayOfWeek));
275
- this._activeDate = this.adapter.today();
276
- }
277
- /**
278
- * The date to display in this month view (everything other than the month and year is ignored).
279
- */
280
- get activeDate() {
281
- return this._activeDate;
282
- }
283
- set activeDate(value) {
284
- const oldValue = this._activeDate;
285
- this._activeDate = value;
286
- if (!this.hasSameMonthAndYear(oldValue, value)) {
287
- this.init();
288
- }
289
- }
290
- /** The currently selected date. */
291
- get selected() {
292
- return this._selected;
293
- }
294
- set selected(value) {
295
- this._selected = value;
296
- this.selectedDate = this.getDateInCurrentMonth(this._selected);
297
- }
298
- ngAfterContentInit() {
299
- this.init();
300
- }
301
- /** Handles when a new date is selected. */
302
- dateSelected(date) {
303
- if (this.selectedDate !== date) {
304
- const selectedYear = this.adapter.getYear(this.activeDate);
305
- const selectedMonth = this.adapter.getMonth(this.activeDate);
306
- const selectedDate = this.adapter.createDate(selectedYear, selectedMonth, date);
307
- this.selectedChange.emit(selectedDate);
308
- }
309
- this.userSelection.emit();
310
- }
311
- /** Initializes this month view. */
312
- init() {
313
- this.selectedDate = this.getDateInCurrentMonth(this.selected);
314
- this.todayDate = this.getDateInCurrentMonth(this.adapter.today());
315
- const firstOfMonth = this.adapter.createDate(this.adapter.getYear(this.activeDate), this.adapter.getMonth(this.activeDate));
316
- this.firstWeekOffset = (DAYS_PER_WEEK + this.adapter.getDayOfWeek(firstOfMonth) - this.adapter.getFirstDayOfWeek()) % DAYS_PER_WEEK;
317
- this.createWeekCells();
318
- this.changeDetectorRef.markForCheck();
319
- }
320
- /** Creates McCalendarCells for the dates in this month. */
321
- createWeekCells() {
322
- const daysInMonth = this.adapter.getNumDaysInMonth(this.activeDate);
323
- const dateNames = this.adapter.getDateNames();
324
- this.weeks = [[]];
325
- for (let i = 0, cell = this.firstWeekOffset; i < daysInMonth; i++, cell++) {
326
- if (cell === DAYS_PER_WEEK) {
327
- this.weeks.push([]);
328
- cell = 0;
329
- }
330
- const date = this.adapter.createDate(this.adapter.getYear(this.activeDate), this.adapter.getMonth(this.activeDate), i + 1);
331
- const enabled = this.shouldEnableDate(date);
332
- const cellClasses = this.dateClass ? this.dateClass(date) : undefined;
333
- this.weeks[this.weeks.length - 1]
334
- .push(new McCalendarCell(i + 1, dateNames[i], enabled, cellClasses));
335
- }
336
- }
337
- /** Date filter for the month */
338
- shouldEnableDate(date) {
339
- return !!date &&
340
- (!this.dateFilter || this.dateFilter(date)) &&
341
- (!this.minDate || this.adapter.compareDate(date, this.minDate) >= 0) &&
342
- (!this.maxDate || this.adapter.compareDate(date, this.maxDate) <= 0);
343
- }
344
- /**
345
- * Gets the date in this month that the given Date falls on.
346
- * Returns null if the given Date is in another month.
347
- */
348
- getDateInCurrentMonth(date) {
349
- return date && this.hasSameMonthAndYear(date, this.activeDate) ? this.adapter.getDate(date) : null;
350
- }
351
- /** Checks whether the 2 dates are non-null and fall within the same month of the same year. */
352
- hasSameMonthAndYear(d1, d2) {
353
- return !!(d1 && d2 && this.adapter.getMonth(d1) === this.adapter.getMonth(d2) &&
354
- this.adapter.getYear(d1) === this.adapter.getYear(d2));
355
- }
356
- }
357
- /** @nocollapse */ McMonthView.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McMonthView, deps: [{ token: i0.ChangeDetectorRef }, { token: MC_DATE_FORMATS, optional: true }, { token: i1$1.DateAdapter, optional: true }], target: i0.ɵɵFactoryTarget.Component });
358
- /** @nocollapse */ McMonthView.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: McMonthView, selector: "mc-month-view", inputs: { activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate", dateFilter: "dateFilter", dateClass: "dateClass" }, outputs: { selectedChange: "selectedChange", userSelection: "userSelection", activeDateChange: "activeDateChange" }, viewQueries: [{ propertyName: "mcCalendarBody", first: true, predicate: McCalendarBody, descendants: true }], exportAs: ["mcMonthView"], ngImport: i0, template: "<table class=\"mc-calendar__table\">\n <thead class=\"mc-calendar__table-header\">\n <tr>\n <th *ngFor=\"let day of weekdays\" [attr.aria-label]=\"day.long\">{{day.narrow}}</th>\n </tr>\n <tr>\n <th class=\"mc-calendar__table-header-divider\" colspan=\"7\"></th>\n </tr>\n </thead>\n <tbody mc-calendar-body\n [rows]=\"weeks\"\n [todayValue]=\"todayDate!\"\n [selectedValue]=\"selectedDate!\"\n [labelMinRequiredCells]=\"3\"\n [activeCell]=\"adapter.getDate(activeDate) - 1\"\n (selectedValueChange)=\"dateSelected($event)\">\n </tbody>\n</table>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: McCalendarBody, selector: "[mc-calendar-body]", inputs: ["rows", "todayValue", "selectedValue", "labelMinRequiredCells", "numCols", "activeCell", "cellAspectRatio"], outputs: ["selectedValueChange"], exportAs: ["mcCalendarBody"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
359
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McMonthView, decorators: [{
360
- type: Component,
361
- args: [{ selector: 'mc-month-view', exportAs: 'mcMonthView', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<table class=\"mc-calendar__table\">\n <thead class=\"mc-calendar__table-header\">\n <tr>\n <th *ngFor=\"let day of weekdays\" [attr.aria-label]=\"day.long\">{{day.narrow}}</th>\n </tr>\n <tr>\n <th class=\"mc-calendar__table-header-divider\" colspan=\"7\"></th>\n </tr>\n </thead>\n <tbody mc-calendar-body\n [rows]=\"weeks\"\n [todayValue]=\"todayDate!\"\n [selectedValue]=\"selectedDate!\"\n [labelMinRequiredCells]=\"3\"\n [activeCell]=\"adapter.getDate(activeDate) - 1\"\n (selectedValueChange)=\"dateSelected($event)\">\n </tbody>\n</table>\n" }]
362
- }], ctorParameters: function () {
363
- return [{ type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
364
- type: Optional
365
- }, {
366
- type: Inject,
367
- args: [MC_DATE_FORMATS]
368
- }] }, { type: i1$1.DateAdapter, decorators: [{
369
- type: Optional
370
- }] }];
371
- }, propDecorators: { activeDate: [{
372
- type: Input
373
- }], selected: [{
374
- type: Input
375
- }], minDate: [{
376
- type: Input
377
- }], maxDate: [{
378
- type: Input
379
- }], dateFilter: [{
380
- type: Input
381
- }], dateClass: [{
382
- type: Input
383
- }], selectedChange: [{
384
- type: Output
385
- }], userSelection: [{
386
- type: Output
387
- }], activeDateChange: [{
388
- type: Output
389
- }], mcCalendarBody: [{
390
- type: ViewChild,
391
- args: [McCalendarBody, { static: false }]
392
- }] } });
393
-
394
- /** Datepicker data that requires internationalization. */
395
- class McDatepickerIntl {
396
- constructor() {
397
- /**
398
- * Stream that emits whenever the labels here are changed. Use this to notify
399
- * components if the labels have changed after initialization.
400
- */
401
- this.changes = new Subject();
402
- /** A label for the calendar popup (used by screen readers). */
403
- this.calendarLabel = 'Calendar';
404
- /** A label for the button used to open the calendar popup (used by screen readers). */
405
- this.openCalendarLabel = 'Open calendar';
406
- /** A label for the previous month button (used by screen readers). */
407
- this.prevMonthLabel = 'Previous month';
408
- /** A label for the next month button (used by screen readers). */
409
- this.nextMonthLabel = 'Next month';
410
- /** A label for the previous year button (used by screen readers). */
411
- this.prevYearLabel = 'Previous year';
412
- /** A label for the next year button (used by screen readers). */
413
- this.nextYearLabel = 'Next year';
414
- /** A label for the previous multi-year button (used by screen readers). */
415
- this.prevMultiYearLabel = 'Previous 20 years';
416
- /** A label for the next multi-year button (used by screen readers). */
417
- this.nextMultiYearLabel = 'Next 20 years';
418
- /** A label for the 'switch to month view' button (used by screen readers). */
419
- this.switchToMonthViewLabel = 'Choose date';
420
- /** A label for the 'switch to year view' button (used by screen readers). */
421
- this.switchToMultiYearViewLabel = 'Choose month and year';
422
- }
423
- }
424
- /** @nocollapse */ McDatepickerIntl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McDatepickerIntl, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
425
- /** @nocollapse */ McDatepickerIntl.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McDatepickerIntl, providedIn: 'root' });
426
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McDatepickerIntl, decorators: [{
427
- type: Injectable,
428
- args: [{ providedIn: 'root' }]
429
- }] });
430
-
431
- /**
432
- * A calendar that is used as part of the datepicker.
433
- * @docs-private
434
- */
435
- class McCalendar {
436
- constructor(intl, adapter, dateFormats, changeDetectorRef) {
437
- this.adapter = adapter;
438
- this.dateFormats = dateFormats;
439
- this.changeDetectorRef = changeDetectorRef;
440
- /** Emits when the currently selected date changes. */
441
- this.selectedChange = new EventEmitter();
442
- /**
443
- * Emits the year chosen in multiyear view.
444
- * This doesn't imply a change on the selected date.
445
- */
446
- this.yearSelected = new EventEmitter();
447
- /**
448
- * Emits the month chosen in year view.
449
- * This doesn't imply a change on the selected date.
450
- */
451
- this.monthSelected = new EventEmitter();
452
- /** Emits when any date is selected. */
453
- this.userSelection = new EventEmitter();
454
- /**
455
- * Emits whenever there is a state change that the header may need to respond to.
456
- */
457
- this.stateChanges = new Subject();
458
- if (!this.adapter) {
459
- throw createMissingDateImplError('DateAdapter');
460
- }
461
- if (!this.dateFormats) {
462
- throw createMissingDateImplError('MC_DATE_FORMATS');
463
- }
464
- this.intlChanges = intl.changes.subscribe(() => {
465
- changeDetectorRef.markForCheck();
466
- this.stateChanges.next();
467
- });
468
- }
469
- /** A date representing the period (month or year) to start the calendar in. */
470
- get startAt() {
471
- return this._startAt;
472
- }
473
- set startAt(value) {
474
- const deserializedValue = this.getValidDateOrNull(this.adapter.deserialize(value));
475
- this._startAt = deserializedValue !== null ?
476
- this.adapter.clampDate(deserializedValue, this.minDate, this.maxDate) : null;
477
- }
478
- /** The currently selected date. */
479
- get selected() {
480
- return this._selected;
481
- }
482
- set selected(value) {
483
- this._selected = this.adapter.deserialize(value);
484
- }
485
- /** The minimum selectable date. */
486
- get minDate() {
487
- return this._minDate;
488
- }
489
- set minDate(value) {
490
- this._minDate = this.adapter.deserialize(value);
491
- this.startAt = this._startAt;
492
- }
493
- /** The maximum selectable date. */
494
- get maxDate() {
495
- return this._maxDate;
496
- }
497
- set maxDate(value) {
498
- this._maxDate = this.adapter.deserialize(value);
499
- this.startAt = this._startAt;
500
- }
501
- /**
502
- * The current active date. This determines which time period is shown and which date is
503
- * highlighted and used as the anchor on when using keyboard navigation.
504
- */
505
- get activeDate() {
506
- return this._activeDate;
507
- }
508
- set activeDate(value) {
509
- this._activeDate = this.adapter.clampDate(value || this.getActiveDateDefault(), this.minDate, this.maxDate);
510
- this.stateChanges.next();
511
- }
512
- ngAfterContentInit() {
513
- this.activeDate = this.getActiveDateDefault();
514
- }
515
- ngOnDestroy() {
516
- this.intlChanges.unsubscribe();
517
- this.stateChanges.complete();
518
- }
519
- ngOnChanges(changes) {
520
- const change = changes.minDate || changes.maxDate || changes.dateFilter;
521
- if (change && !change.firstChange) {
522
- if (this.monthView) {
523
- // We need to `detectChanges` manually here, because the `minDate`, `maxDate` etc. are
524
- // passed down to the view via data bindings which won't be up-to-date when we call `init`.
525
- this.changeDetectorRef.detectChanges();
526
- this.monthView.init();
527
- }
528
- }
529
- this.stateChanges.next();
530
- }
531
- /** Updates today's date after an update of the active date */
532
- updateTodaysDate() {
533
- this.monthView.ngAfterContentInit();
534
- }
535
- /** Handles date selection in the month view. */
536
- dateSelected(date) {
537
- if (!this.adapter.sameDate(date, this.selected)) {
538
- this.selectedChange.emit(date);
539
- }
540
- }
541
- userSelected() {
542
- this.userSelection.emit();
543
- }
544
- /**
545
- * @param obj The object to check.
546
- * @returns The given object if it is both a date instance and valid, otherwise null.
547
- */
548
- // todo выглядит как костыль от которого нужно избавиться
549
- getValidDateOrNull(obj) {
550
- return (this.adapter.isDateInstance(obj) && this.adapter.isValid(obj)) ? obj : null;
551
- }
552
- getActiveDateDefault() {
553
- return this.startAt || this.adapter.today();
554
- }
555
- }
556
- /** @nocollapse */ McCalendar.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McCalendar, deps: [{ token: McDatepickerIntl }, { token: i1$1.DateAdapter, optional: true }, { token: MC_DATE_FORMATS, optional: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
557
- /** @nocollapse */ McCalendar.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: McCalendar, selector: "mc-calendar", inputs: { startAt: "startAt", selected: "selected", minDate: "minDate", maxDate: "maxDate", dateFilter: "dateFilter", dateClass: "dateClass" }, outputs: { selectedChange: "selectedChange", yearSelected: "yearSelected", monthSelected: "monthSelected", userSelection: "userSelection" }, host: { classAttribute: "mc-calendar" }, viewQueries: [{ propertyName: "monthView", first: true, predicate: McMonthView, descendants: true }], exportAs: ["mcCalendar"], usesOnChanges: true, ngImport: i0, template: "<mc-calendar-header\n [(activeDate)]=\"activeDate\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n (monthSelected)=\"monthSelected.emit(activeDate)\"\n (yearSelected)=\"yearSelected.emit(activeDate)\">\n</mc-calendar-header>\n\n<div class=\"mc-calendar__content\">\n <mc-month-view\n [(activeDate)]=\"activeDate\"\n [selected]=\"selected\"\n [dateFilter]=\"dateFilter\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [dateClass]=\"dateClass\"\n (selectedChange)=\"dateSelected($event!)\"\n (userSelection)=\"userSelected()\">\n </mc-month-view>\n</div>\n", styles: [".mc-calendar{display:block}.mc-calendar__content{padding:0 var(--mc-datepicker-calendar-size-padding-horizontal, 8px) var(--mc-datepicker-calendar-size-padding-horizontal, 8px) var(--mc-datepicker-calendar-size-padding-horizontal, 8px);outline:none}.mc-calendar__table{border-spacing:0;border-collapse:collapse;width:100%}.mc-calendar__table-header th{text-align:center;height:30px}.mc-calendar__table-header th.mc-calendar__table-header-divider{position:relative;height:calc(var(--mc-datepicker-calendar-size-padding-blocks, 12px) - 2px)}.mc-calendar__table-header th.mc-calendar__table-header-divider:after{content:\"\";position:absolute;top:0;left:calc(-1 * var(--mc-datepicker-calendar-size-padding-horizontal, 8px));right:calc(-1 * var(--mc-datepicker-calendar-size-padding-horizontal, 8px));height:var(--mc-datepicker-calendar-size-divider-width, 1px)}\n"], dependencies: [{ kind: "component", type: McMonthView, selector: "mc-month-view", inputs: ["activeDate", "selected", "minDate", "maxDate", "dateFilter", "dateClass"], outputs: ["selectedChange", "userSelection", "activeDateChange"], exportAs: ["mcMonthView"] }, { kind: "component", type: McCalendarHeader, selector: "mc-calendar-header", inputs: ["activeDate", "maxDate", "minDate"], outputs: ["activeDateChange", "monthSelected", "yearSelected"], exportAs: ["mcCalendarHeader"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
558
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McCalendar, decorators: [{
559
- type: Component,
560
- args: [{ selector: 'mc-calendar', exportAs: 'mcCalendar', host: {
561
- class: 'mc-calendar'
562
- }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<mc-calendar-header\n [(activeDate)]=\"activeDate\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n (monthSelected)=\"monthSelected.emit(activeDate)\"\n (yearSelected)=\"yearSelected.emit(activeDate)\">\n</mc-calendar-header>\n\n<div class=\"mc-calendar__content\">\n <mc-month-view\n [(activeDate)]=\"activeDate\"\n [selected]=\"selected\"\n [dateFilter]=\"dateFilter\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [dateClass]=\"dateClass\"\n (selectedChange)=\"dateSelected($event!)\"\n (userSelection)=\"userSelected()\">\n </mc-month-view>\n</div>\n", styles: [".mc-calendar{display:block}.mc-calendar__content{padding:0 var(--mc-datepicker-calendar-size-padding-horizontal, 8px) var(--mc-datepicker-calendar-size-padding-horizontal, 8px) var(--mc-datepicker-calendar-size-padding-horizontal, 8px);outline:none}.mc-calendar__table{border-spacing:0;border-collapse:collapse;width:100%}.mc-calendar__table-header th{text-align:center;height:30px}.mc-calendar__table-header th.mc-calendar__table-header-divider{position:relative;height:calc(var(--mc-datepicker-calendar-size-padding-blocks, 12px) - 2px)}.mc-calendar__table-header th.mc-calendar__table-header-divider:after{content:\"\";position:absolute;top:0;left:calc(-1 * var(--mc-datepicker-calendar-size-padding-horizontal, 8px));right:calc(-1 * var(--mc-datepicker-calendar-size-padding-horizontal, 8px));height:var(--mc-datepicker-calendar-size-divider-width, 1px)}\n"] }]
563
- }], ctorParameters: function () {
564
- return [{ type: McDatepickerIntl }, { type: i1$1.DateAdapter, decorators: [{
565
- type: Optional
566
- }] }, { type: undefined, decorators: [{
567
- type: Optional
568
- }, {
569
- type: Inject,
570
- args: [MC_DATE_FORMATS]
571
- }] }, { type: i0.ChangeDetectorRef }];
572
- }, propDecorators: { startAt: [{
573
- type: Input
574
- }], selected: [{
575
- type: Input
576
- }], minDate: [{
577
- type: Input
578
- }], maxDate: [{
579
- type: Input
580
- }], dateFilter: [{
581
- type: Input
582
- }], dateClass: [{
583
- type: Input
584
- }], selectedChange: [{
585
- type: Output
586
- }], yearSelected: [{
587
- type: Output
588
- }], monthSelected: [{
589
- type: Output
590
- }], userSelection: [{
591
- type: Output
592
- }], monthView: [{
593
- type: ViewChild,
594
- args: [McMonthView, { static: false }]
595
- }] } });
596
-
597
- // tslint:disable:no-empty, deprecation
598
- // tslint:disable:naming-convention
599
- var DateParts;
600
- (function (DateParts) {
601
- DateParts["year"] = "y";
602
- DateParts["month"] = "m";
603
- DateParts["day"] = "d";
604
- })(DateParts || (DateParts = {}));
605
- const MAX_YEAR = 9999;
606
- const YEAR_LENGTH = 4;
607
- class DateDigit {
608
- constructor(value, start, length) {
609
- this.value = value;
610
- this.start = start;
611
- this.length = length;
612
- this.maxDays = 31;
613
- this.maxMonth = 12;
614
- if (value === DateParts.day) {
615
- this.parse = this.parseDay;
616
- }
617
- else if (value === DateParts.month) {
618
- this.parse = this.parseMonth;
619
- }
620
- else if (value === DateParts.year) {
621
- this.parse = this.parseYear;
622
- }
623
- }
624
- get end() {
625
- return this.start + this.length;
626
- }
627
- get isDay() {
628
- return this.value === DateParts.day;
629
- }
630
- get isMonth() {
631
- return this.value === DateParts.month;
632
- }
633
- get isYear() {
634
- return this.value === DateParts.year;
635
- }
636
- get fullName() {
637
- if (this.isDay) {
638
- return 'date';
639
- }
640
- if (this.isMonth) {
641
- return 'month';
642
- }
643
- if (this.isYear) {
644
- return 'year';
645
- }
646
- return '';
647
- }
648
- parseDay(value) {
649
- const parsedValue = parseInt(value);
650
- if (parsedValue === 0) {
651
- return 1;
652
- }
653
- if (parsedValue > this.maxDays) {
654
- return this.maxDays;
655
- }
656
- return parsedValue;
657
- }
658
- parseMonth(value) {
659
- const parsedValue = parseInt(value);
660
- if (parsedValue === 0) {
661
- return 1;
662
- }
663
- if (parsedValue > this.maxMonth) {
664
- return this.maxMonth;
665
- }
666
- return parsedValue;
667
- }
668
- parseYear(value) {
669
- const parsedValue = parseInt(value);
670
- if (parsedValue === 0) {
671
- return 1;
672
- }
673
- if (parsedValue > MAX_YEAR) {
674
- return parseInt(value.substring(0, YEAR_LENGTH));
675
- }
676
- return parsedValue;
677
- }
678
- }
679
- /** @docs-private */
680
- const MC_DATEPICKER_VALUE_ACCESSOR = {
681
- provide: NG_VALUE_ACCESSOR,
682
- useExisting: forwardRef(() => McDatepickerInput),
683
- multi: true
684
- };
685
- /** @docs-private */
686
- const MC_DATEPICKER_VALIDATORS = {
687
- provide: NG_VALIDATORS,
688
- useExisting: forwardRef(() => McDatepickerInput),
689
- multi: true
690
- };
691
- /**
692
- * An event used for datepicker input and change events. We don't always have access to a native
693
- * input or change event because the event may have been triggered by the user clicking on the
694
- * calendar popup. For consistency, we always use McDatepickerInputEvent instead.
695
- */
696
- class McDatepickerInputEvent {
697
- constructor(
698
- /** Reference to the datepicker input component that emitted the event. */
699
- target,
700
- /** Reference to the native input element associated with the datepicker input. */
701
- targetElement) {
702
- this.target = target;
703
- this.targetElement = targetElement;
704
- this.value = this.target.value;
705
- }
706
- }
707
- let uniqueComponentIdSuffix = 0;
708
- /** Directive used to connect an input to a McDatepicker. */
709
- class McDatepickerInput {
710
- constructor(elementRef, renderer, adapter, dateFormats, localeService) {
711
- this.elementRef = elementRef;
712
- this.renderer = renderer;
713
- this.adapter = adapter;
714
- this.dateFormats = dateFormats;
715
- this.localeService = localeService;
716
- this.stateChanges = new Subject();
717
- this.controlType = 'datepicker';
718
- this.focused = false;
719
- /** Emits when the value changes (either due to user input or programmatic change). */
720
- this.valueChange = new EventEmitter();
721
- /** Emits when the disabled state has changed */
722
- this.disabledChange = new EventEmitter();
723
- this._placeholder = '';
724
- this._disabled = false;
725
- this.incorrectInput = new EventEmitter();
726
- /** Emits when a `change` event is fired on this `<input>`. */
727
- this.dateChange = new EventEmitter();
728
- /** Emits when an `input` event is fired on this `<input>`. */
729
- this.dateInput = new EventEmitter();
730
- this.uid = `mc-datepicker-${uniqueComponentIdSuffix++}`;
731
- this.datepickerSubscription = Subscription.EMPTY;
732
- this.localeSubscription = Subscription.EMPTY;
733
- /** Whether the last value set on the input was valid. */
734
- this.lastValueValid = false;
735
- this.firstDigit = null;
736
- this.secondDigit = null;
737
- this.thirdDigit = null;
738
- this.usePlaceholderFromInput = false;
739
- // tslint:disable-next-line:no-empty
740
- this.onTouched = () => { };
741
- this.onInput = () => {
742
- this.correctCursorPosition();
743
- const formattedValue = this.replaceSymbols(this.viewValue);
744
- const newTimeObj = this.getDateFromString(formattedValue);
745
- this.lastValueValid = !!newTimeObj;
746
- if (!newTimeObj) {
747
- if (!this.viewValue) {
748
- this.lastValueValid = false;
749
- this.updateValue(newTimeObj);
750
- }
751
- else {
752
- this.control.updateValueAndValidity();
753
- }
754
- return;
755
- }
756
- this.setViewValue(this.getTimeStringFromDate(newTimeObj, this.dateInputFormat), true);
757
- this.selectNextDigitByCursor(this.selectionStart);
758
- this.updateValue(newTimeObj);
759
- };
760
- this.parseOnBlur = () => {
761
- if (!this.viewValue || !this.readyForParse) {
762
- return null;
763
- }
764
- const date = this.getDefaultValue();
765
- const viewDigits = this.viewValue
766
- .split(this.separator)
767
- .map((value) => value)
768
- .filter((value) => value);
769
- const [firsViewDigit, secondViewDigit, thirdViewDigit] = viewDigits;
770
- // tslint:disable-next-line:no-magic-numbers
771
- if (viewDigits.length !== 3) {
772
- this.lastValueValid = false;
773
- this._value = null;
774
- return setTimeout(() => this.control.updateValueAndValidity());
775
- }
776
- date[this.firstDigit.fullName] = this.firstDigit.parse(firsViewDigit);
777
- date[this.secondDigit.fullName] = this.secondDigit.parse(secondViewDigit);
778
- date[this.thirdDigit.fullName] = this.thirdDigit.parse(thirdViewDigit);
779
- const [digitWithYear, viewDigitWithYear] = [this.firstDigit, this.secondDigit, this.thirdDigit]
780
- .reduce((acc, digit, index) => digit.value === DateParts.year ? [digit, viewDigits[index]] : acc, []);
781
- // tslint:disable-next-line:no-magic-numbers
782
- if (viewDigitWithYear.length < 3) {
783
- // tslint:disable-next-line:no-magic-numbers
784
- date.year += date.year < 30 ? 2000 : 1900;
785
- }
786
- else if (viewDigitWithYear.length < digitWithYear.length) {
787
- this.lastValueValid = false;
788
- this._value = null;
789
- return setTimeout(() => this.control.updateValueAndValidity());
790
- }
791
- const newTimeObj = this.createDateTime(date);
792
- if (!newTimeObj) {
793
- this.lastValueValid = false;
794
- this._value = null;
795
- this.cvaOnChange(null);
796
- return setTimeout(() => this.control.updateValueAndValidity());
797
- }
798
- this.lastValueValid = !!newTimeObj;
799
- this.setViewValue(this.getTimeStringFromDate(newTimeObj, this.dateInputFormat), true);
800
- this.updateValue(newTimeObj);
801
- };
802
- this.updateLocaleParams = () => {
803
- this.setFormat(this.dateInputFormat);
804
- if (!this.usePlaceholderFromInput) {
805
- this._placeholder = this.localeService.getParams('datepicker').placeholder;
806
- }
807
- this.value = this.value;
808
- };
809
- // tslint:disable-next-line:no-empty
810
- this.cvaOnChange = () => { };
811
- // tslint:disable-next-line:no-empty
812
- this.validatorOnChange = () => { };
813
- /** The form control validator for whether the input parses. */
814
- this.parseValidator = () => {
815
- return this.focused ||
816
- this.empty ||
817
- this.lastValueValid ? null : { mcDatepickerParse: { text: this.elementRef.nativeElement.value } };
818
- };
819
- /** The form control validator for the min date. */
820
- this.minValidator = (control) => {
821
- const controlValue = this.adapter.deserialize(control.value);
822
- return !this.min || !controlValue || this.adapter.compareDateTime(this.min, controlValue) <= 0 ?
823
- null :
824
- { mcDatepickerMin: { min: this.min, actual: controlValue } };
825
- };
826
- /** The form control validator for the max date. */
827
- this.maxValidator = (control) => {
828
- const controlValue = this.adapter.deserialize(control.value);
829
- return !this.max || !controlValue || this.adapter.compareDateTime(this.max, controlValue) >= 0 ?
830
- null :
831
- { mcDatepickerMax: { max: this.max, actual: controlValue } };
832
- };
833
- /** The form control validator for the date filter. */
834
- this.filterValidator = (control) => {
835
- const controlValue = this.adapter.deserialize(control.value);
836
- return !this.dateFilter || !controlValue || this.dateFilter(controlValue) ?
837
- null : { mcDatepickerFilter: true };
838
- };
839
- this.validator = Validators.compose([
840
- this.parseValidator,
841
- this.minValidator,
842
- this.maxValidator,
843
- this.filterValidator
844
- ]);
845
- if (!this.adapter) {
846
- throw createMissingDateImplError('DateAdapter');
847
- }
848
- if (!this.dateFormats) {
849
- throw createMissingDateImplError('MC_DATE_FORMATS');
850
- }
851
- this.setFormat(this.dateInputFormat);
852
- this.localeSubscription = adapter.localeChanges
853
- .subscribe(this.updateLocaleParams);
854
- }
855
- get placeholder() {
856
- return this._placeholder;
857
- }
858
- set placeholder(value) {
859
- this._placeholder = value;
860
- this.usePlaceholderFromInput = true;
861
- }
862
- get required() {
863
- return this._required;
864
- }
865
- set required(value) {
866
- this._required = coerceBooleanProperty(value);
867
- }
868
- /** The datepicker that this input is associated with. */
869
- set mcDatepicker(value) {
870
- if (!value) {
871
- return;
872
- }
873
- this.datepicker = value;
874
- this.datepicker.registerInput(this);
875
- this.datepickerSubscription.unsubscribe();
876
- this.datepickerSubscription = this.datepicker.selectedChanged
877
- .subscribe((selected) => {
878
- const newValue = this.saveTimePart(selected);
879
- this.value = newValue;
880
- this.cvaOnChange(newValue);
881
- this.onTouched();
882
- this.dateChange.emit(new McDatepickerInputEvent(this, this.elementRef.nativeElement));
883
- });
884
- }
885
- /** Function that can be used to filter out dates within the datepicker. */
886
- set mcDatepickerFilter(value) {
887
- this.dateFilter = value;
888
- this.validatorOnChange();
889
- }
890
- /** The value of the input. */
891
- get value() {
892
- return this._value;
893
- }
894
- set value(value) {
895
- let newValue = this.adapter.deserialize(value);
896
- this.lastValueValid = !newValue || this.adapter.isValid(newValue);
897
- newValue = this.getValidDateOrNull(newValue);
898
- const oldDate = this.value;
899
- this._value = newValue;
900
- this.formatValue(newValue);
901
- if (!this.adapter.sameDate(oldDate, newValue)) {
902
- this.valueChange.emit(newValue);
903
- }
904
- }
905
- /** The minimum valid date. */
906
- get min() {
907
- return this._min;
908
- }
909
- set min(value) {
910
- this._min = this.adapter.deserialize(value);
911
- this.validatorOnChange();
912
- }
913
- /** The maximum valid date. */
914
- get max() {
915
- return this._max;
916
- }
917
- set max(value) {
918
- this._max = this.adapter.deserialize(value);
919
- this.validatorOnChange();
920
- }
921
- /** Whether the datepicker-input is disabled. */
922
- get disabled() {
923
- return this._disabled;
924
- }
925
- set disabled(value) {
926
- const newValue = coerceBooleanProperty(value);
927
- const element = this.elementRef.nativeElement;
928
- if (this._disabled !== newValue) {
929
- this._disabled = newValue;
930
- this.disabledChange.emit(newValue);
931
- }
932
- // We need to null check the `blur` method, because it's undefined during SSR.
933
- if (newValue && element.blur) {
934
- // Normally, native input elements automatically blur if they turn disabled. This behavior
935
- // is problematic, because it would mean that it triggers another change detection cycle,
936
- // which then causes a changed after checked error if the input element was focused before.
937
- element.blur();
938
- }
939
- }
940
- get id() {
941
- return this._id;
942
- }
943
- set id(value) {
944
- this._id = value || this.uid;
945
- }
946
- set mcValidationTooltip(tooltip) {
947
- if (!tooltip) {
948
- return;
949
- }
950
- tooltip.enterDelay = validationTooltipShowDelay;
951
- tooltip.trigger = 'manual';
952
- tooltip.initListeners();
953
- this.incorrectInput.subscribe(() => {
954
- if (tooltip.isOpen) {
955
- return;
956
- }
957
- tooltip.show();
958
- setTimeout(() => tooltip.hide(), validationTooltipHideDelay);
959
- });
960
- }
961
- get empty() {
962
- return !this.viewValue && !this.isBadInput();
963
- }
964
- get viewValue() {
965
- return this.elementRef.nativeElement.value;
966
- }
967
- get ngControl() {
968
- return this.control;
969
- }
970
- get isReadOnly() {
971
- return this.elementRef.nativeElement.readOnly;
972
- }
973
- get dateInputFormat() {
974
- var _a;
975
- return ((_a = this.localeService) === null || _a === void 0 ? void 0 : _a.getParams('datepicker').dateInput) || this.dateFormats.dateInput;
976
- }
977
- get readyForParse() {
978
- return !!(this.firstDigit && this.secondDigit && this.thirdDigit);
979
- }
980
- get selectionStart() {
981
- return this.elementRef.nativeElement.selectionStart;
982
- }
983
- set selectionStart(value) {
984
- this.elementRef.nativeElement.selectionStart = value;
985
- }
986
- get selectionEnd() {
987
- return this.elementRef.nativeElement.selectionEnd;
988
- }
989
- set selectionEnd(value) {
990
- this.elementRef.nativeElement.selectionEnd = value;
991
- }
992
- onContainerClick() {
993
- this.focus();
994
- }
995
- focus() {
996
- this.elementRef.nativeElement.focus();
997
- }
998
- focusChanged(isFocused) {
999
- if (isFocused !== this.focused) {
1000
- this.focused = isFocused;
1001
- this.onTouched();
1002
- this.stateChanges.next();
1003
- }
1004
- }
1005
- ngOnDestroy() {
1006
- this.datepickerSubscription.unsubscribe();
1007
- this.localeSubscription.unsubscribe();
1008
- this.valueChange.complete();
1009
- this.disabledChange.complete();
1010
- }
1011
- /** @docs-private */
1012
- registerOnValidatorChange(fn) {
1013
- this.validatorOnChange = fn;
1014
- }
1015
- /** @docs-private */
1016
- validate(control) {
1017
- this.setControl(control);
1018
- return this.validator ? this.validator(control) : null;
1019
- }
1020
- // Implemented as part of ControlValueAccessor.
1021
- writeValue(value) {
1022
- this.value = value;
1023
- }
1024
- // Implemented as part of ControlValueAccessor.
1025
- registerOnChange(fn) {
1026
- this.cvaOnChange = fn;
1027
- }
1028
- // Implemented as part of ControlValueAccessor.
1029
- registerOnTouched(fn) {
1030
- this.onTouched = fn;
1031
- }
1032
- // Implemented as part of ControlValueAccessor.
1033
- setDisabledState(isDisabled) {
1034
- this.disabled = isDisabled;
1035
- }
1036
- onKeyDown(event) {
1037
- var _a;
1038
- if (this.isReadOnly) {
1039
- return;
1040
- }
1041
- const keyCode = event.keyCode;
1042
- if (this.isLetterKey(event)) {
1043
- event.preventDefault();
1044
- this.incorrectInput.emit();
1045
- }
1046
- else if (this.isKeyForOpen(event)) {
1047
- event.preventDefault();
1048
- (_a = this.datepicker) === null || _a === void 0 ? void 0 : _a.open();
1049
- }
1050
- else if (this.isKeyForClose(event)) {
1051
- event.preventDefault();
1052
- this.datepicker.close();
1053
- }
1054
- else if (keyCode === TAB) {
1055
- this.datepicker.close(false);
1056
- }
1057
- else if (this.isKeyForByPass(event)) {
1058
- return;
1059
- }
1060
- else if (keyCode === SPACE) {
1061
- this.spaceKeyHandler(event);
1062
- }
1063
- else if ([UP_ARROW, DOWN_ARROW].includes(keyCode)) {
1064
- event.preventDefault();
1065
- this.verticalArrowKeyHandler(keyCode);
1066
- }
1067
- else if ([LEFT_ARROW, RIGHT_ARROW, HOME, PAGE_UP, END, PAGE_DOWN].includes(keyCode)) {
1068
- event.preventDefault();
1069
- this.changeCaretPosition(keyCode);
1070
- }
1071
- else if (/^\D$/.test(event.key)) {
1072
- event.preventDefault();
1073
- const newValue = this.getNewValue(event.key, this.selectionStart);
1074
- const formattedValue = this.replaceSymbols(newValue);
1075
- if (newValue !== formattedValue) {
1076
- this.setViewValue(formattedValue, true);
1077
- setTimeout(this.onInput);
1078
- }
1079
- else {
1080
- this.incorrectInput.emit();
1081
- }
1082
- }
1083
- else {
1084
- setTimeout(this.onInput);
1085
- }
1086
- }
1087
- onChange() {
1088
- setTimeout(() => {
1089
- this.dateChange.emit(new McDatepickerInputEvent(this, this.elementRef.nativeElement));
1090
- });
1091
- }
1092
- /** Handles blur events on the input. */
1093
- onBlur() {
1094
- // Reformat the input only if we have a valid value.
1095
- this.parseOnBlur();
1096
- this.focusChanged(false);
1097
- this.onInput();
1098
- }
1099
- onPaste($event) {
1100
- var _a, _b, _c;
1101
- $event.preventDefault();
1102
- let rawValue = $event.clipboardData.getData('text');
1103
- if (rawValue.match(/^\d\D/)) {
1104
- rawValue = `0${rawValue}`;
1105
- }
1106
- rawValue.replace(/[^A-Za-z0-9]+/g, this.separator);
1107
- if (/[a-z]/gi.test(rawValue)) {
1108
- this.incorrectInput.emit();
1109
- }
1110
- const match = rawValue.match(/^(?<first>\d+)\W(?<second>\d+)\W(?<third>\d+)$/);
1111
- if (!((_a = match === null || match === void 0 ? void 0 : match.groups) === null || _a === void 0 ? void 0 : _a.first) || !((_b = match === null || match === void 0 ? void 0 : match.groups) === null || _b === void 0 ? void 0 : _b.second) || !((_c = match === null || match === void 0 ? void 0 : match.groups) === null || _c === void 0 ? void 0 : _c.third)) {
1112
- this.setViewValue(rawValue);
1113
- return rawValue;
1114
- }
1115
- const value = [match.groups.first, match.groups.second, match.groups.third].join(this.separator);
1116
- const newTimeObj = this.getDateFromString(value);
1117
- if (!newTimeObj) {
1118
- this.setViewValue(value);
1119
- return value;
1120
- }
1121
- this.setViewValue(this.getTimeStringFromDate(newTimeObj, this.dateInputFormat));
1122
- this.updateValue(newTimeObj);
1123
- }
1124
- toISO8601(value) {
1125
- return this.adapter.toIso8601(value);
1126
- }
1127
- saveTimePart(selected) {
1128
- if (!this.value) {
1129
- return selected;
1130
- }
1131
- const years = this.adapter.getYear(selected);
1132
- const month = this.adapter.getMonth(selected);
1133
- const day = this.adapter.getDate(selected);
1134
- const hours = this.adapter.getHours(this.value);
1135
- const minutes = this.adapter.getMinutes(this.value);
1136
- const seconds = this.adapter.getSeconds(this.value);
1137
- const milliseconds = this.adapter.getMilliseconds(this.value);
1138
- return this.adapter.createDateTime(years, month, day, hours, minutes, seconds, milliseconds);
1139
- }
1140
- setFormat(format) {
1141
- // @ts-ignore
1142
- this.separator = format.match(/[aA-zZ]+(?<separator>\W|\D)[aA-zZ]+/).groups.separator;
1143
- this.separatorPositions = format
1144
- .split('')
1145
- .reduce((acc, item, index) => this.separator === item ? [...acc, index + 1] : acc, []);
1146
- this.getDigitPositions(format);
1147
- }
1148
- updateValue(newValue) {
1149
- var _a;
1150
- if (!this.adapter.sameDate(newValue, this.value)) {
1151
- this._value = newValue;
1152
- this.cvaOnChange(newValue);
1153
- this.valueChange.emit(newValue);
1154
- this.dateInput.emit(new McDatepickerInputEvent(this, this.elementRef.nativeElement));
1155
- }
1156
- (_a = this.control) === null || _a === void 0 ? void 0 : _a.updateValueAndValidity({ emitEvent: false });
1157
- }
1158
- isKeyForClose(event) {
1159
- return (event.altKey && event.keyCode === UP_ARROW) || event.keyCode === ESCAPE;
1160
- }
1161
- isKeyForOpen(event) {
1162
- return event.altKey && event.keyCode === DOWN_ARROW;
1163
- }
1164
- isLetterKey(event) {
1165
- return isLetterKey(event) && !event.ctrlKey && !event.metaKey;
1166
- }
1167
- isKeyForByPass(event) {
1168
- return (hasModifierKey(event) && (isVerticalMovement(event) || isHorizontalMovement(event))) ||
1169
- event.ctrlKey || event.metaKey ||
1170
- [DELETE, BACKSPACE, TAB].includes(event.keyCode);
1171
- }
1172
- spaceKeyHandler(event) {
1173
- event.preventDefault();
1174
- if (this.selectionStart === this.selectionEnd) {
1175
- const value = this.getNewValue(event.key, this.selectionStart);
1176
- this.setViewValue(value);
1177
- setTimeout(this.onInput);
1178
- }
1179
- else if (this.selectionStart !== this.selectionEnd) {
1180
- this.selectNextDigit(this.selectionStart, true);
1181
- }
1182
- }
1183
- getNewValue(key, position) {
1184
- return [this.viewValue.slice(0, position), key, this.viewValue.slice(position)].join('');
1185
- }
1186
- setViewValue(value, savePosition = false) {
1187
- if (savePosition) {
1188
- const selectionStart = this.selectionStart;
1189
- const selectionEnd = this.selectionEnd;
1190
- this.renderer.setProperty(this.elementRef.nativeElement, 'value', value);
1191
- this.selectionStart = selectionStart;
1192
- this.selectionEnd = selectionEnd;
1193
- }
1194
- else {
1195
- this.renderer.setProperty(this.elementRef.nativeElement, 'value', value);
1196
- }
1197
- }
1198
- replaceSymbols(value) {
1199
- return value
1200
- .split(this.separator)
1201
- .map((part) => part.replace(/^([0-9]+)\W$/, '0$1'))
1202
- .join(this.separator);
1203
- }
1204
- getDateFromString(timeString) {
1205
- if (!timeString || timeString.length < this.firstDigit.length) {
1206
- return null;
1207
- }
1208
- const date = this.getDefaultValue();
1209
- const viewDigits = timeString
1210
- .split(this.separator)
1211
- .map((value) => value);
1212
- const [firsViewDigit, secondViewDigit, thirdViewDigit] = viewDigits;
1213
- if (viewDigits.length === 1) {
1214
- if (/\D/.test(firsViewDigit) || firsViewDigit.length < this.firstDigit.length) {
1215
- return null;
1216
- }
1217
- date[this.firstDigit.fullName] = this.firstDigit.parse(firsViewDigit);
1218
- if (this.firstDigit.isDay) {
1219
- date.month = 1;
1220
- }
1221
- // tslint:disable-next-line:no-magic-numbers
1222
- }
1223
- else if (viewDigits.length === 2) {
1224
- if (firsViewDigit.length < this.firstDigit.length || secondViewDigit.length < this.secondDigit.length) {
1225
- return null;
1226
- }
1227
- date[this.firstDigit.fullName] = this.firstDigit.parse(firsViewDigit);
1228
- date[this.secondDigit.fullName] = this.secondDigit.parse(secondViewDigit);
1229
- // tslint:disable-next-line:no-magic-numbers
1230
- }
1231
- else if (viewDigits.length === 3) {
1232
- if (firsViewDigit.length < this.firstDigit.length ||
1233
- secondViewDigit.length < this.secondDigit.length ||
1234
- thirdViewDigit.length < this.thirdDigit.length) {
1235
- return null;
1236
- }
1237
- date[this.firstDigit.fullName] = this.firstDigit.parse(firsViewDigit);
1238
- date[this.secondDigit.fullName] = this.secondDigit.parse(secondViewDigit);
1239
- date[this.thirdDigit.fullName] = this.thirdDigit.parse(thirdViewDigit);
1240
- }
1241
- else {
1242
- return null;
1243
- }
1244
- return this.createDateTime(date);
1245
- }
1246
- getDefaultValue() {
1247
- const defaultValue = this.value || this.adapter.today();
1248
- return {
1249
- year: this.adapter.getYear(defaultValue),
1250
- month: this.adapter.getMonth(defaultValue),
1251
- date: this.adapter.getDate(defaultValue),
1252
- hours: this.adapter.getHours(defaultValue),
1253
- minutes: this.adapter.getMinutes(defaultValue),
1254
- seconds: this.adapter.getSeconds(defaultValue),
1255
- milliseconds: this.adapter.getMilliseconds(defaultValue)
1256
- };
1257
- }
1258
- getTimeStringFromDate(value, timeFormat) {
1259
- if (!value || !this.adapter.isValid(value)) {
1260
- return '';
1261
- }
1262
- return this.adapter.format(value, timeFormat);
1263
- }
1264
- getDateEditMetrics(cursorPosition) {
1265
- for (const digit of [this.firstDigit, this.secondDigit, this.thirdDigit]) {
1266
- if (cursorPosition >= digit.start && cursorPosition <= digit.end) {
1267
- return [digit.value, digit.start, digit.end];
1268
- }
1269
- }
1270
- return [this.thirdDigit.value, this.thirdDigit.start, this.thirdDigit.end];
1271
- }
1272
- incrementDate(dateVal, whatToIncrement) {
1273
- let year = this.adapter.getYear(dateVal);
1274
- let month = this.adapter.getMonth(dateVal);
1275
- let day = this.adapter.getDate(dateVal);
1276
- switch (whatToIncrement) {
1277
- case DateParts.day:
1278
- day++;
1279
- if (day > this.adapter.getNumDaysInMonth(dateVal)) {
1280
- day = 1;
1281
- }
1282
- break;
1283
- case DateParts.month:
1284
- month++;
1285
- // tslint:disable-next-line:no-magic-numbers
1286
- if (month > 11) {
1287
- month = 0;
1288
- }
1289
- const lastDay = this.getLastDayFor(year, month);
1290
- if (day > lastDay) {
1291
- day = lastDay;
1292
- }
1293
- break;
1294
- case DateParts.year:
1295
- year++;
1296
- if (year > MAX_YEAR) {
1297
- year = 1;
1298
- }
1299
- break;
1300
- default:
1301
- }
1302
- return this.createDate(year, month, day);
1303
- }
1304
- getLastDayFor(year, month) {
1305
- return this.adapter.getNumDaysInMonth(this.createDate(year, month, 1));
1306
- }
1307
- decrementDate(dateVal, whatToDecrement) {
1308
- let year = this.adapter.getYear(dateVal);
1309
- let month = this.adapter.getMonth(dateVal);
1310
- let day = this.adapter.getDate(dateVal);
1311
- switch (whatToDecrement) {
1312
- case DateParts.day:
1313
- day--;
1314
- if (day < 1) {
1315
- day = this.adapter.getNumDaysInMonth(dateVal);
1316
- }
1317
- break;
1318
- case DateParts.month:
1319
- month--;
1320
- if (month < 0) {
1321
- // tslint:disable-next-line:no-magic-numbers
1322
- month = 11;
1323
- }
1324
- const lastDay = this.getLastDayFor(year, month);
1325
- if (day > lastDay) {
1326
- day = lastDay;
1327
- }
1328
- break;
1329
- case DateParts.year:
1330
- year--;
1331
- if (year < 1) {
1332
- year = MAX_YEAR;
1333
- }
1334
- break;
1335
- default:
1336
- }
1337
- return this.createDate(year, month, day);
1338
- }
1339
- verticalArrowKeyHandler(keyCode) {
1340
- if (!this.value) {
1341
- return;
1342
- }
1343
- let changedTime;
1344
- const [modifiedTimePart, selectionStart, selectionEnd] = this.getDateEditMetrics(this.selectionStart);
1345
- if (keyCode === UP_ARROW) {
1346
- changedTime = this.incrementDate(this.value, modifiedTimePart);
1347
- }
1348
- if (keyCode === DOWN_ARROW) {
1349
- changedTime = this.decrementDate(this.value, modifiedTimePart);
1350
- }
1351
- this.value = changedTime;
1352
- this.selectionStart = selectionStart;
1353
- this.selectionEnd = selectionEnd;
1354
- this.cvaOnChange(changedTime);
1355
- this.onChange();
1356
- this.stateChanges.next();
1357
- }
1358
- changeCaretPosition(keyCode) {
1359
- if (!this.value) {
1360
- return;
1361
- }
1362
- let cursorPos = this.selectionStart;
1363
- if ([HOME, PAGE_UP].includes(keyCode)) {
1364
- cursorPos = 0;
1365
- }
1366
- else if ([END, PAGE_DOWN].includes(keyCode)) {
1367
- cursorPos = this.viewValue.length;
1368
- }
1369
- else if (keyCode === LEFT_ARROW) {
1370
- cursorPos = cursorPos === 0 ? this.viewValue.length : cursorPos - 1;
1371
- }
1372
- else if (keyCode === RIGHT_ARROW) {
1373
- const nextSeparatorPos = this.viewValue.indexOf(this.separator, cursorPos);
1374
- cursorPos = nextSeparatorPos ? nextSeparatorPos + 1 : 0;
1375
- }
1376
- this.selectDigitByCursor(cursorPos);
1377
- }
1378
- selectDigitByCursor(cursorPos) {
1379
- setTimeout(() => {
1380
- const [, selectionStart, selectionEnd] = this.getDateEditMetrics(cursorPos);
1381
- this.selectionStart = selectionStart;
1382
- this.selectionEnd = selectionEnd;
1383
- });
1384
- }
1385
- selectNextDigitByCursor(cursorPos) {
1386
- setTimeout(() => {
1387
- const [, , endPositionOfCurrentDigit] = this.getDateEditMetrics(cursorPos);
1388
- const [, selectionStart, selectionEnd] = this.getDateEditMetrics(endPositionOfCurrentDigit + 1);
1389
- this.selectionStart = selectionStart;
1390
- this.selectionEnd = selectionEnd;
1391
- });
1392
- }
1393
- selectNextDigit(cursorPos, cycle = false) {
1394
- setTimeout(() => {
1395
- const lastValue = cycle ? 0 : cursorPos;
1396
- const nextSeparatorPos = this.viewValue.indexOf(this.separator, cursorPos);
1397
- const newCursorPos = nextSeparatorPos > 0 ? nextSeparatorPos + 1 : lastValue;
1398
- const [, selectionStart, selectionEnd] = this.getDateEditMetrics(newCursorPos);
1399
- this.selectionStart = selectionStart;
1400
- this.selectionEnd = selectionEnd;
1401
- });
1402
- }
1403
- /** Checks whether the input is invalid based on the native validation. */
1404
- isBadInput() {
1405
- const validity = this.elementRef.nativeElement.validity;
1406
- return validity && validity.badInput;
1407
- }
1408
- /** Formats a value and sets it on the input element. */
1409
- formatValue(value) {
1410
- const formattedValue = value ? this.adapter.format(value, this.dateInputFormat) : '';
1411
- this.setViewValue(formattedValue);
1412
- }
1413
- setControl(control) {
1414
- if (this.control) {
1415
- return;
1416
- }
1417
- this.control = control;
1418
- this.control.valueChanges
1419
- .subscribe((value) => this._value = value);
1420
- }
1421
- /**
1422
- * @param obj The object to check.
1423
- * @returns The given object if it is both a date instance and valid, otherwise null.
1424
- */
1425
- getValidDateOrNull(obj) {
1426
- return (this.adapter.isDateInstance(obj) && this.adapter.isValid(obj)) ? obj : null;
1427
- }
1428
- getDigitPositions(format) {
1429
- this.firstDigit = this.secondDigit = this.thirdDigit = null;
1430
- const formatInLowerCase = format.toLowerCase();
1431
- formatInLowerCase
1432
- .split('')
1433
- .reduce(({ prev, length, start }, value, index, arr) => {
1434
- if (value === this.separator || (arr.length - 1) === index) {
1435
- if (!this.firstDigit) {
1436
- this.firstDigit = new DateDigit(prev, start, length);
1437
- }
1438
- else if (!this.secondDigit) {
1439
- this.secondDigit = new DateDigit(prev, start, length);
1440
- }
1441
- else if (!this.thirdDigit) {
1442
- this.thirdDigit = new DateDigit(prev, start, arr.length - start);
1443
- }
1444
- // tslint:disable:no-parameter-reassignment
1445
- length = 0;
1446
- start = index + 1;
1447
- }
1448
- else {
1449
- length++;
1450
- }
1451
- return { prev: value, length, start };
1452
- }, { length: 0, start: 0 });
1453
- if (!this.firstDigit || !this.secondDigit || !this.thirdDigit) {
1454
- Error(`Can' t use this format: ${format}`);
1455
- }
1456
- }
1457
- createDate(year, month, day) {
1458
- return this.adapter.createDateTime(year, month, day, this.adapter.getHours(this.value), this.adapter.getMinutes(this.value), this.adapter.getSeconds(this.value), this.adapter.getMilliseconds(this.value));
1459
- }
1460
- createDateTime(value) {
1461
- if (Object.values(value).some(isNaN)) {
1462
- return null;
1463
- }
1464
- return this.adapter.createDateTime(value.year, value.month - 1, value.date, value.hours, value.minutes, value.seconds, value.milliseconds);
1465
- }
1466
- correctCursorPosition() {
1467
- if (this.selectionStart && this.separatorPositions.includes(this.selectionStart)) {
1468
- this.selectionStart = this.selectionStart - 1;
1469
- }
1470
- }
1471
- }
1472
- /** @nocollapse */ McDatepickerInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McDatepickerInput, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1$1.DateAdapter, optional: true }, { token: MC_DATE_FORMATS, optional: true }, { token: MC_LOCALE_SERVICE, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
1473
- /** @nocollapse */ McDatepickerInput.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: McDatepickerInput, selector: "input[mcDatepicker]", inputs: { placeholder: "placeholder", required: "required", mcDatepicker: "mcDatepicker", mcDatepickerFilter: "mcDatepickerFilter", value: "value", min: "min", max: "max", disabled: "disabled", id: "id", mcValidationTooltip: "mcValidationTooltip" }, outputs: { incorrectInput: "incorrectInput", dateChange: "dateChange", dateInput: "dateInput" }, host: { listeners: { "paste": "onPaste($event)", "change": "onChange()", "focus": "focusChanged(true)", "blur": "onBlur()", "keydown": "onKeyDown($event)" }, properties: { "attr.placeholder": "placeholder", "attr.required": "required", "attr.disabled": "disabled || null", "attr.min": "min ? toISO8601(min) : null", "attr.max": "max ? toISO8601(max) : null", "attr.autocomplete": "\"off\"" }, classAttribute: "mc-input mc-datepicker" }, providers: [
1474
- MC_DATEPICKER_VALUE_ACCESSOR,
1475
- MC_DATEPICKER_VALIDATORS,
1476
- { provide: McFormFieldControl, useExisting: McDatepickerInput }
1477
- ], exportAs: ["mcDatepickerInput"], ngImport: i0 });
1478
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McDatepickerInput, decorators: [{
1479
- type: Directive,
1480
- args: [{
1481
- selector: 'input[mcDatepicker]',
1482
- exportAs: 'mcDatepickerInput',
1483
- providers: [
1484
- MC_DATEPICKER_VALUE_ACCESSOR,
1485
- MC_DATEPICKER_VALIDATORS,
1486
- { provide: McFormFieldControl, useExisting: McDatepickerInput }
1487
- ],
1488
- host: {
1489
- class: 'mc-input mc-datepicker',
1490
- '[attr.placeholder]': 'placeholder',
1491
- '[attr.required]': 'required',
1492
- '[attr.disabled]': 'disabled || null',
1493
- '[attr.min]': 'min ? toISO8601(min) : null',
1494
- '[attr.max]': 'max ? toISO8601(max) : null',
1495
- '[attr.autocomplete]': '"off"',
1496
- '(paste)': 'onPaste($event)',
1497
- '(change)': 'onChange()',
1498
- '(focus)': 'focusChanged(true)',
1499
- '(blur)': 'onBlur()',
1500
- '(keydown)': 'onKeyDown($event)'
1501
- }
1502
- }]
1503
- }], ctorParameters: function () {
1504
- return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1$1.DateAdapter, decorators: [{
1505
- type: Optional
1506
- }] }, { type: undefined, decorators: [{
1507
- type: Optional
1508
- }, {
1509
- type: Inject,
1510
- args: [MC_DATE_FORMATS]
1511
- }] }, { type: i1$1.McLocaleService, decorators: [{
1512
- type: Optional
1513
- }, {
1514
- type: Inject,
1515
- args: [MC_LOCALE_SERVICE]
1516
- }] }];
1517
- }, propDecorators: { placeholder: [{
1518
- type: Input
1519
- }], required: [{
1520
- type: Input
1521
- }], mcDatepicker: [{
1522
- type: Input
1523
- }], mcDatepickerFilter: [{
1524
- type: Input
1525
- }], value: [{
1526
- type: Input
1527
- }], min: [{
1528
- type: Input
1529
- }], max: [{
1530
- type: Input
1531
- }], disabled: [{
1532
- type: Input
1533
- }], id: [{
1534
- type: Input
1535
- }], mcValidationTooltip: [{
1536
- type: Input
1537
- }], incorrectInput: [{
1538
- type: Output
1539
- }], dateChange: [{
1540
- type: Output
1541
- }], dateInput: [{
1542
- type: Output
1543
- }] } });
1544
-
1545
- /** Can be used to override the icon of a `mcDatepickerToggle`. */
1546
- class McDatepickerToggleIcon {
1547
- }
1548
- /** @nocollapse */ McDatepickerToggleIcon.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McDatepickerToggleIcon, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1549
- /** @nocollapse */ McDatepickerToggleIcon.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: McDatepickerToggleIcon, selector: "[mcDatepickerToggleIcon]", ngImport: i0 });
1550
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McDatepickerToggleIcon, decorators: [{
1551
- type: Directive,
1552
- args: [{
1553
- selector: '[mcDatepickerToggleIcon]'
1554
- }]
1555
- }] });
1556
- class McDatepickerToggle {
1557
- constructor(intl, changeDetectorRef) {
1558
- this.intl = intl;
1559
- this.changeDetectorRef = changeDetectorRef;
1560
- this.stateChanges = Subscription.EMPTY;
1561
- }
1562
- /** Whether the toggle button is disabled. */
1563
- get disabled() {
1564
- return this._disabled === undefined ? this.datepicker.disabled : this._disabled;
1565
- }
1566
- set disabled(value) {
1567
- this._disabled = coerceBooleanProperty(value);
1568
- }
1569
- ngOnChanges(changes) {
1570
- if (changes.datepicker) {
1571
- this.watchStateChanges();
1572
- }
1573
- }
1574
- ngOnDestroy() {
1575
- this.stateChanges.unsubscribe();
1576
- }
1577
- ngAfterContentInit() {
1578
- this.watchStateChanges();
1579
- }
1580
- open(event) {
1581
- if (this.datepicker && !this.disabled) {
1582
- this.datepicker.open();
1583
- event.stopPropagation();
1584
- }
1585
- }
1586
- watchStateChanges() {
1587
- const datepickerDisabled = this.datepicker ? this.datepicker.disabledChange : of();
1588
- const inputDisabled = this.datepicker && this.datepicker.datepickerInput ?
1589
- this.datepicker.datepickerInput.disabledChange : of();
1590
- const datepickerToggled = this.datepicker ?
1591
- merge(this.datepicker.openedStream, this.datepicker.closedStream) :
1592
- of();
1593
- this.stateChanges.unsubscribe();
1594
- this.stateChanges = merge(this.intl.changes, datepickerDisabled, inputDisabled, datepickerToggled).subscribe(() => this.changeDetectorRef.markForCheck());
1595
- }
1596
- }
1597
- /** @nocollapse */ McDatepickerToggle.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McDatepickerToggle, deps: [{ token: McDatepickerIntl }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1598
- /** @nocollapse */ McDatepickerToggle.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: McDatepickerToggle, selector: "mc-datepicker-toggle", inputs: { disabled: "disabled", datepicker: ["for", "datepicker"], tabIndex: "tabIndex" }, host: { properties: { "class.mc-active": "datepicker && datepicker.opened" }, classAttribute: "mc-datepicker-toggle" }, queries: [{ propertyName: "customIcon", first: true, predicate: McDatepickerToggleIcon, descendants: true }], viewQueries: [{ propertyName: "button", first: true, predicate: ["button"], descendants: true }], exportAs: ["mcDatepickerToggle"], usesOnChanges: true, ngImport: i0, template: "<!--todo need simplify this-->\n<button\n #button\n mc-button\n type=\"button\"\n class=\"mc-datepicker-toggle__button\"\n aria-haspopup=\"true\"\n [attr.aria-label]=\"intl.openCalendarLabel\"\n [tabIndex]=\"tabIndex\"\n [disabled]=\"disabled\"\n (click)=\"open($event)\">\n\n <i *ngIf=\"!customIcon\" mc-icon=\"mc-calendar_16\" class=\"mc-datepicker-toggle__default-icon\"></i>\n\n <ng-content select=\"[mcDatepickerToggleIcon]\"></ng-content>\n</button>\n", styles: [".mc-datepicker-toggle:focus{outline:0}.mc-datepicker-toggle__button.mc-icon-button{width:var(--mc-datepicker-toggle-size-width, 30px);height:var(--mc-datepicker-toggle-size-height, 30px);margin-left:2px}.mc-form-field-appearance-legacy .mc-form-field-prefix .mc-datepicker-toggle__default-icon,.mc-form-field-appearance-legacy .mc-form-field-suffix .mc-datepicker-toggle__default-icon{width:1em}.mc-form-field:not(.mc-form-field-appearance-legacy) .mc-form-field-prefix .mc-datepicker-toggle__default-icon,.mc-form-field:not(.mc-form-field-appearance-legacy) .mc-form-field-suffix .mc-datepicker-toggle__default-icon{display:block;width:1.5em;height:1.5em}.mc-form-field:not(.mc-form-field-appearance-legacy) .mc-form-field-prefix .mc-icon-button .mc-datepicker-toggle__default-icon,.mc-form-field:not(.mc-form-field-appearance-legacy) .mc-form-field-suffix .mc-icon-button .mc-datepicker-toggle__default-icon{margin:auto}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.McButton, selector: "[mc-button]", inputs: ["color", "tabIndex", "disabled"] }, { kind: "directive", type: i3.McButtonCssStyler, selector: "[mc-button]" }, { kind: "component", type: i6.McIcon, selector: "[mc-icon]", inputs: ["color"] }, { kind: "directive", type: i6.McIconCSSStyler, selector: "[mc-icon]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1599
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McDatepickerToggle, decorators: [{
1600
- type: Component,
1601
- args: [{ selector: 'mc-datepicker-toggle', host: {
1602
- class: 'mc-datepicker-toggle',
1603
- '[class.mc-active]': 'datepicker && datepicker.opened'
1604
- }, exportAs: 'mcDatepickerToggle', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--todo need simplify this-->\n<button\n #button\n mc-button\n type=\"button\"\n class=\"mc-datepicker-toggle__button\"\n aria-haspopup=\"true\"\n [attr.aria-label]=\"intl.openCalendarLabel\"\n [tabIndex]=\"tabIndex\"\n [disabled]=\"disabled\"\n (click)=\"open($event)\">\n\n <i *ngIf=\"!customIcon\" mc-icon=\"mc-calendar_16\" class=\"mc-datepicker-toggle__default-icon\"></i>\n\n <ng-content select=\"[mcDatepickerToggleIcon]\"></ng-content>\n</button>\n", styles: [".mc-datepicker-toggle:focus{outline:0}.mc-datepicker-toggle__button.mc-icon-button{width:var(--mc-datepicker-toggle-size-width, 30px);height:var(--mc-datepicker-toggle-size-height, 30px);margin-left:2px}.mc-form-field-appearance-legacy .mc-form-field-prefix .mc-datepicker-toggle__default-icon,.mc-form-field-appearance-legacy .mc-form-field-suffix .mc-datepicker-toggle__default-icon{width:1em}.mc-form-field:not(.mc-form-field-appearance-legacy) .mc-form-field-prefix .mc-datepicker-toggle__default-icon,.mc-form-field:not(.mc-form-field-appearance-legacy) .mc-form-field-suffix .mc-datepicker-toggle__default-icon{display:block;width:1.5em;height:1.5em}.mc-form-field:not(.mc-form-field-appearance-legacy) .mc-form-field-prefix .mc-icon-button .mc-datepicker-toggle__default-icon,.mc-form-field:not(.mc-form-field-appearance-legacy) .mc-form-field-suffix .mc-icon-button .mc-datepicker-toggle__default-icon{margin:auto}\n"] }]
1605
- }], ctorParameters: function () { return [{ type: McDatepickerIntl }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { disabled: [{
1606
- type: Input
1607
- }], datepicker: [{
1608
- type: Input,
1609
- args: ['for']
1610
- }], tabIndex: [{
1611
- type: Input
1612
- }], customIcon: [{
1613
- type: ContentChild,
1614
- args: [McDatepickerToggleIcon, { static: false }]
1615
- }], button: [{
1616
- type: ViewChild,
1617
- args: ['button', { static: false }]
1618
- }] } });
1619
-
1620
- /**
1621
- * Animations used by the mosaic datepicker.
1622
- * @docs-private
1623
- */
1624
- const mcDatepickerAnimations = {
1625
- /** Transforms the height of the datepicker's calendar. */
1626
- transformPanel: trigger('transformPanel', [
1627
- state('void', style({
1628
- opacity: 0,
1629
- transform: 'scale(1, 0.8)'
1630
- })),
1631
- transition('void => enter', animate('120ms cubic-bezier(0, 0, 0.2, 1)', style({
1632
- opacity: 1,
1633
- transform: 'scale(1, 1)'
1634
- }))),
1635
- transition('* => void', animate('100ms linear', style({ opacity: 0 })))
1636
- ]),
1637
- /** Fades in the content of the calendar. */
1638
- fadeInCalendar: trigger('fadeInCalendar', [
1639
- state('void', style({ opacity: 0 })),
1640
- state('enter', style({ opacity: 1 })),
1641
- // need to keep it until #12440 gets in, otherwise the exit animation will look glitchy.
1642
- transition('void => *', animate('120ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)'))
1643
- ])
1644
- };
1645
- // todo should be put into polyfils
1646
- // https://github.com/angular/angular/issues/24769
1647
- if (!Element.prototype.matches) {
1648
- Element.prototype.matches = Element.prototype.msMatchesSelector;
1649
- }
1650
-
1651
- /** Used to generate a unique ID for each datepicker instance. */
1652
- let datepickerUid = 0;
1653
- /** Injection token that determines the scroll handling while the calendar is open. */
1654
- const MC_DATEPICKER_SCROLL_STRATEGY = new InjectionToken('mc-datepicker-scroll-strategy');
1655
- /** @docs-private */
1656
- // tslint:disable-next-line:naming-convention
1657
- function MC_DATEPICKER_SCROLL_STRATEGY_FACTORY(overlay) {
1658
- return () => overlay.scrollStrategies.reposition();
1659
- }
1660
- /** @docs-private */
1661
- const MC_DATEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER = {
1662
- provide: MC_DATEPICKER_SCROLL_STRATEGY,
1663
- deps: [Overlay],
1664
- useFactory: MC_DATEPICKER_SCROLL_STRATEGY_FACTORY
1665
- };
1666
- /**
1667
- * Component used as the content for the datepicker dialog and popup. We use this instead of using
1668
- * McCalendar directly as the content so we can control the initial focus. This also gives us a
1669
- * place to put additional features of the popup that are not part of the calendar itself in the
1670
- * future. (e.g. confirmation buttons).
1671
- * @docs-private
1672
- */
1673
- class McDatepickerContent {
1674
- constructor(changeDetectorRef) {
1675
- this.changeDetectorRef = changeDetectorRef;
1676
- /** Emits when an animation has finished. */
1677
- this.animationDone = new Subject();
1678
- this.subscriptions = new Subscription();
1679
- }
1680
- ngAfterViewInit() {
1681
- this.subscriptions.add(this.datepicker.stateChanges.subscribe(() => {
1682
- this.changeDetectorRef.markForCheck();
1683
- }));
1684
- }
1685
- ngOnDestroy() {
1686
- this.subscriptions.unsubscribe();
1687
- this.animationDone.complete();
1688
- }
1689
- startExitAnimation() {
1690
- this.animationState = 'void';
1691
- this.changeDetectorRef.markForCheck();
1692
- }
1693
- }
1694
- /** @nocollapse */ McDatepickerContent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McDatepickerContent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1695
- /** @nocollapse */ McDatepickerContent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: McDatepickerContent, selector: "mc-datepicker__content", host: { listeners: { "@transformPanel.done": "animationDone.next()" }, properties: { "@transformPanel": "animationState" }, classAttribute: "mc-datepicker__content" }, viewQueries: [{ propertyName: "calendar", first: true, predicate: McCalendar, descendants: true }], exportAs: ["mcDatepickerContent"], ngImport: i0, template: "<mc-calendar [id]=\"datepicker.id\"\n [@fadeInCalendar]=\"'enter'\"\n [ngClass]=\"datepicker.panelClass\"\n [dateClass]=\"datepicker.dateClass\"\n\n [startAt]=\"datepicker.startAt\"\n [minDate]=\"datepicker.minDate\"\n [maxDate]=\"datepicker.maxDate\"\n [dateFilter]=\"datepicker.dateFilter\"\n\n [selected]=\"datepicker.selected\"\n\n (selectedChange)=\"datepicker.select($event)\"\n (yearSelected)=\"datepicker.selectYear($event)\"\n (monthSelected)=\"datepicker.selectMonth($event)\"\n (userSelection)=\"datepicker.close()\">\n</mc-calendar>\n", styles: [".mc-datepicker__content{display:block;border-width:1px;border-style:solid;border-radius:var(--mc-datepicker-calendar-size-border-radius, 0)}.mc-datepicker__content .mc-calendar{width:296px;height:348px}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: McCalendar, selector: "mc-calendar", inputs: ["startAt", "selected", "minDate", "maxDate", "dateFilter", "dateClass"], outputs: ["selectedChange", "yearSelected", "monthSelected", "userSelection"], exportAs: ["mcCalendar"] }], animations: [
1696
- mcDatepickerAnimations.transformPanel,
1697
- mcDatepickerAnimations.fadeInCalendar
1698
- ], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1699
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McDatepickerContent, decorators: [{
1700
- type: Component,
1701
- args: [{ selector: 'mc-datepicker__content', exportAs: 'mcDatepickerContent', host: {
1702
- class: 'mc-datepicker__content',
1703
- '[@transformPanel]': 'animationState',
1704
- '(@transformPanel.done)': 'animationDone.next()'
1705
- }, animations: [
1706
- mcDatepickerAnimations.transformPanel,
1707
- mcDatepickerAnimations.fadeInCalendar
1708
- ], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<mc-calendar [id]=\"datepicker.id\"\n [@fadeInCalendar]=\"'enter'\"\n [ngClass]=\"datepicker.panelClass\"\n [dateClass]=\"datepicker.dateClass\"\n\n [startAt]=\"datepicker.startAt\"\n [minDate]=\"datepicker.minDate\"\n [maxDate]=\"datepicker.maxDate\"\n [dateFilter]=\"datepicker.dateFilter\"\n\n [selected]=\"datepicker.selected\"\n\n (selectedChange)=\"datepicker.select($event)\"\n (yearSelected)=\"datepicker.selectYear($event)\"\n (monthSelected)=\"datepicker.selectMonth($event)\"\n (userSelection)=\"datepicker.close()\">\n</mc-calendar>\n", styles: [".mc-datepicker__content{display:block;border-width:1px;border-style:solid;border-radius:var(--mc-datepicker-calendar-size-border-radius, 0)}.mc-datepicker__content .mc-calendar{width:296px;height:348px}\n"] }]
1709
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { calendar: [{
1710
- type: ViewChild,
1711
- args: [McCalendar]
1712
- }] } });
1713
- // TODO: We use a component instead of a directive here so the user can use implicit
1714
- // template reference variables (e.g. #d vs #d="mcDatepicker"). We can change this to a directive
1715
- // if angular adds support for `exportAs: '$implicit'` on directives.
1716
- /** Component responsible for managing the datepicker popup/dialog. */
1717
- class McDatepicker {
1718
- constructor(overlay, ngZone, viewContainerRef, scrollStrategy, dateAdapter, dir, document) {
1719
- this.overlay = overlay;
1720
- this.ngZone = ngZone;
1721
- this.viewContainerRef = viewContainerRef;
1722
- this.dateAdapter = dateAdapter;
1723
- this.dir = dir;
1724
- this.document = document;
1725
- this._hasBackdrop = false;
1726
- this._opened = false;
1727
- /**
1728
- * Emits selected year in multiyear view.
1729
- * This doesn't imply a change on the selected date.
1730
- */
1731
- this.yearSelected = new EventEmitter();
1732
- /**
1733
- * Emits selected month in year view.
1734
- * This doesn't imply a change on the selected date.
1735
- */
1736
- this.monthSelected = new EventEmitter();
1737
- this.backdropClass = 'cdk-overlay-transparent-backdrop';
1738
- /** Emits when the datepicker has been opened. */
1739
- this.openedStream = new EventEmitter();
1740
- /** Emits when the datepicker has been closed. */
1741
- this.closedStream = new EventEmitter();
1742
- this.stateChanges = new Subject();
1743
- /** Emits when the datepicker is disabled. */
1744
- this.disabledChange = new Subject();
1745
- /** Emits new selected date when selected date changes. */
1746
- this.selectedChanged = new Subject();
1747
- /** The id for the datepicker calendar. */
1748
- this.id = `mc-datepicker-${datepickerUid++}`;
1749
- this.validSelected = null;
1750
- /** The element that was focused before the datepicker was opened. */
1751
- this.focusedElementBeforeOpen = null;
1752
- /** Subscription to value changes in the associated input element. */
1753
- this.inputSubscription = Subscription.EMPTY;
1754
- this.closeSubscription = Subscription.EMPTY;
1755
- if (!this.dateAdapter) {
1756
- throw createMissingDateImplError('DateAdapter');
1757
- }
1758
- this.scrollStrategy = scrollStrategy;
1759
- }
1760
- get hasBackdrop() {
1761
- return this._hasBackdrop;
1762
- }
1763
- set hasBackdrop(value) {
1764
- this._hasBackdrop = coerceBooleanProperty(value);
1765
- }
1766
- /** The date to open the calendar to initially. */
1767
- get startAt() {
1768
- var _a;
1769
- // If an explicit startAt is set we start there, otherwise we start at whatever the currently
1770
- // selected value is.
1771
- return this._startAt || ((_a = this.datepickerInput) === null || _a === void 0 ? void 0 : _a.value);
1772
- }
1773
- set startAt(value) {
1774
- const deserializedValue = this.dateAdapter.deserialize(value);
1775
- this._startAt = deserializedValue !== null ?
1776
- this.dateAdapter.clampDate(deserializedValue, this.minDate, this.maxDate) : null;
1777
- }
1778
- /** Whether the datepicker pop-up should be disabled. */
1779
- get disabled() {
1780
- return this._disabled === undefined && this.datepickerInput ? this.datepickerInput.disabled : this._disabled;
1781
- }
1782
- set disabled(value) {
1783
- const newValue = coerceBooleanProperty(value);
1784
- if (newValue !== this._disabled) {
1785
- this._disabled = newValue;
1786
- this.disabledChange.next(newValue);
1787
- }
1788
- }
1789
- /** Whether the calendar is open. */
1790
- get opened() {
1791
- return this._opened;
1792
- }
1793
- set opened(value) {
1794
- coerceBooleanProperty(value) ? this.open() : this.close();
1795
- }
1796
- /** The currently selected date. */
1797
- get selected() {
1798
- return this.validSelected;
1799
- }
1800
- set selected(value) {
1801
- this.validSelected = value;
1802
- }
1803
- get dateFilter() {
1804
- return this.datepickerInput && this.datepickerInput.dateFilter;
1805
- }
1806
- get value() {
1807
- return this.selected;
1808
- }
1809
- ngOnDestroy() {
1810
- this.close();
1811
- this.inputSubscription.unsubscribe();
1812
- this.closeSubscription.unsubscribe();
1813
- this.disabledChange.complete();
1814
- this.destroyOverlay();
1815
- }
1816
- /** Selects the given date */
1817
- select(date) {
1818
- const oldValue = this.selected;
1819
- this.selected = date;
1820
- if (!this.dateAdapter.sameDate(oldValue, this.selected)) {
1821
- this.selectedChanged.next(date);
1822
- }
1823
- }
1824
- /** Emits the selected year in multiyear view */
1825
- selectYear(normalizedYear) {
1826
- this.yearSelected.emit(normalizedYear);
1827
- }
1828
- /** Emits selected month in year view */
1829
- selectMonth(normalizedMonth) {
1830
- this.monthSelected.emit(normalizedMonth);
1831
- }
1832
- /**
1833
- * Register an input with this datepicker.
1834
- * @param input The datepicker input to register with this datepicker.
1835
- */
1836
- registerInput(input) {
1837
- if (this.datepickerInput) {
1838
- throw Error('A McDatepicker can only be associated with a single input.');
1839
- }
1840
- this.datepickerInput = input;
1841
- this.inputSubscription = this.datepickerInput.valueChange
1842
- .subscribe((value) => {
1843
- var _a;
1844
- this.selected = value;
1845
- if (this.popupComponentRef) {
1846
- (_a = this.popupComponentRef.instance.calendar.monthView) === null || _a === void 0 ? void 0 : _a.init();
1847
- this.popupComponentRef.instance.calendar.activeDate = value;
1848
- }
1849
- });
1850
- }
1851
- /** Open the calendar. */
1852
- open() {
1853
- if (this._opened || this.disabled) {
1854
- return;
1855
- }
1856
- if (!this.datepickerInput) {
1857
- throw Error('Attempted to open an McDatepicker with no associated input.');
1858
- }
1859
- if (this.document) {
1860
- this.focusedElementBeforeOpen = this.document.activeElement;
1861
- }
1862
- this.openAsPopup();
1863
- this._opened = true;
1864
- this.openedStream.emit();
1865
- }
1866
- /** Close the calendar. */
1867
- close(restoreFocus = true) {
1868
- if (!this._opened) {
1869
- return;
1870
- }
1871
- if (this.popupComponentRef) {
1872
- const instance = this.popupComponentRef.instance;
1873
- instance.startExitAnimation();
1874
- instance.animationDone
1875
- .pipe(take(1))
1876
- .subscribe(() => this.destroyOverlay());
1877
- }
1878
- if (restoreFocus) {
1879
- this.focusedElementBeforeOpen.focus();
1880
- }
1881
- this._opened = false;
1882
- this.closedStream.emit();
1883
- this.focusedElementBeforeOpen = null;
1884
- }
1885
- toggle() {
1886
- if (this.datepickerInput.isReadOnly) {
1887
- return;
1888
- }
1889
- this._opened ? this.close() : this.open();
1890
- }
1891
- /** Destroys the current overlay. */
1892
- destroyOverlay() {
1893
- if (this.popupRef) {
1894
- this.popupRef.dispose();
1895
- this.popupRef = this.popupComponentRef = null;
1896
- }
1897
- }
1898
- /** Open the calendar as a popup. */
1899
- openAsPopup() {
1900
- if (!this.calendarPortal) {
1901
- this.calendarPortal = new ComponentPortal(McDatepickerContent, this.viewContainerRef);
1902
- }
1903
- if (!this.popupRef) {
1904
- this.createPopup();
1905
- }
1906
- if (!this.popupRef.hasAttached()) {
1907
- this.popupComponentRef = this.popupRef.attach(this.calendarPortal);
1908
- this.popupComponentRef.instance.datepicker = this;
1909
- // Update the position once the calendar has rendered.
1910
- this.ngZone.onStable.asObservable()
1911
- .pipe(take(1))
1912
- .subscribe(() => { var _a; return (_a = this.popupRef) === null || _a === void 0 ? void 0 : _a.updatePosition(); });
1913
- }
1914
- }
1915
- /** Create the popup. */
1916
- createPopup() {
1917
- const overlayConfig = new OverlayConfig({
1918
- positionStrategy: this.createPopupPositionStrategy(),
1919
- hasBackdrop: this.hasBackdrop,
1920
- backdropClass: this.backdropClass,
1921
- direction: this.dir,
1922
- scrollStrategy: this.scrollStrategy(),
1923
- panelClass: 'mc-datepicker__popup'
1924
- });
1925
- this.popupRef = this.overlay.create(overlayConfig);
1926
- this.closeSubscription = this.closingActions()
1927
- .subscribe(() => this.close(this.restoreFocus()));
1928
- }
1929
- restoreFocus() {
1930
- return this.document.activeElement === this.document.body;
1931
- }
1932
- closingActions() {
1933
- return merge(this.popupRef.backdropClick(), this.popupRef.outsidePointerEvents(), this.popupRef.detachments());
1934
- }
1935
- /** Create the popup PositionStrategy. */
1936
- createPopupPositionStrategy() {
1937
- return this.overlay.position()
1938
- .flexibleConnectedTo(this.datepickerInput.elementRef)
1939
- .withTransformOriginOn('.mc-datepicker__content')
1940
- .withFlexibleDimensions(false)
1941
- .withViewportMargin(8)
1942
- .withLockedPosition()
1943
- .withPositions([
1944
- {
1945
- originX: 'start',
1946
- originY: 'bottom',
1947
- overlayX: 'start',
1948
- overlayY: 'top'
1949
- },
1950
- {
1951
- originX: 'start',
1952
- originY: 'top',
1953
- overlayX: 'start',
1954
- overlayY: 'bottom'
1955
- },
1956
- {
1957
- originX: 'end',
1958
- originY: 'bottom',
1959
- overlayX: 'end',
1960
- overlayY: 'top'
1961
- },
1962
- {
1963
- originX: 'end',
1964
- originY: 'top',
1965
- overlayX: 'end',
1966
- overlayY: 'bottom'
1967
- }
1968
- ]);
1969
- }
1970
- }
1971
- /** @nocollapse */ McDatepicker.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McDatepicker, deps: [{ token: i3$1.Overlay }, { token: i0.NgZone }, { token: i0.ViewContainerRef }, { token: MC_DATEPICKER_SCROLL_STRATEGY }, { token: i1$1.DateAdapter, optional: true }, { token: i5$1.Directionality, optional: true }, { token: DOCUMENT, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1972
- /** @nocollapse */ McDatepicker.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: McDatepicker, selector: "mc-datepicker", inputs: { hasBackdrop: "hasBackdrop", startAt: "startAt", disabled: "disabled", opened: "opened", minDate: "minDate", maxDate: "maxDate", panelClass: "panelClass", dateClass: "dateClass", backdropClass: "backdropClass" }, outputs: { yearSelected: "yearSelected", monthSelected: "monthSelected", openedStream: "opened", closedStream: "closed" }, providers: [{ provide: McFormFieldControl, useExisting: McDatepicker }], exportAs: ["mcDatepicker"], ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1973
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McDatepicker, decorators: [{
1974
- type: Component,
1975
- args: [{
1976
- selector: 'mc-datepicker',
1977
- template: '',
1978
- exportAs: 'mcDatepicker',
1979
- changeDetection: ChangeDetectionStrategy.OnPush,
1980
- encapsulation: ViewEncapsulation.None,
1981
- providers: [{ provide: McFormFieldControl, useExisting: McDatepicker }]
1982
- }]
1983
- }], ctorParameters: function () {
1984
- return [{ type: i3$1.Overlay }, { type: i0.NgZone }, { type: i0.ViewContainerRef }, { type: undefined, decorators: [{
1985
- type: Inject,
1986
- args: [MC_DATEPICKER_SCROLL_STRATEGY]
1987
- }] }, { type: i1$1.DateAdapter, decorators: [{
1988
- type: Optional
1989
- }] }, { type: i5$1.Directionality, decorators: [{
1990
- type: Optional
1991
- }] }, { type: undefined, decorators: [{
1992
- type: Optional
1993
- }, {
1994
- type: Inject,
1995
- args: [DOCUMENT]
1996
- }] }];
1997
- }, propDecorators: { hasBackdrop: [{
1998
- type: Input
1999
- }], startAt: [{
2000
- type: Input
2001
- }], disabled: [{
2002
- type: Input
2003
- }], opened: [{
2004
- type: Input
2005
- }], minDate: [{
2006
- type: Input
2007
- }], maxDate: [{
2008
- type: Input
2009
- }], yearSelected: [{
2010
- type: Output
2011
- }], monthSelected: [{
2012
- type: Output
2013
- }], panelClass: [{
2014
- type: Input
2015
- }], dateClass: [{
2016
- type: Input
2017
- }], backdropClass: [{
2018
- type: Input
2019
- }], openedStream: [{
2020
- type: Output,
2021
- args: ['opened']
2022
- }], closedStream: [{
2023
- type: Output,
2024
- args: ['closed']
2025
- }] } });
2026
-
2027
- class McDatepickerModule {
2028
- }
2029
- /** @nocollapse */ McDatepickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McDatepickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2030
- /** @nocollapse */ McDatepickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: McDatepickerModule, declarations: [McCalendar,
2031
- McCalendarBody,
2032
- McDatepicker,
2033
- McDatepickerContent,
2034
- McDatepickerInput,
2035
- McDatepickerToggle,
2036
- McDatepickerToggleIcon,
2037
- McMonthView,
2038
- McCalendarHeader], imports: [CommonModule,
2039
- McButtonModule,
2040
- OverlayModule,
2041
- A11yModule,
2042
- PortalModule,
2043
- McButtonModule,
2044
- McSelectModule,
2045
- McIconModule], exports: [McCalendar,
2046
- McCalendarBody,
2047
- McDatepicker,
2048
- McDatepickerContent,
2049
- McDatepickerInput,
2050
- McDatepickerToggle,
2051
- McDatepickerToggleIcon,
2052
- McMonthView,
2053
- McCalendarHeader] });
2054
- /** @nocollapse */ McDatepickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McDatepickerModule, providers: [
2055
- McDatepickerIntl,
2056
- MC_DATEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER
2057
- ], imports: [CommonModule,
2058
- McButtonModule,
2059
- OverlayModule,
2060
- A11yModule,
2061
- PortalModule,
2062
- McButtonModule,
2063
- McSelectModule,
2064
- McIconModule] });
2065
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McDatepickerModule, decorators: [{
2066
- type: NgModule,
2067
- args: [{
2068
- imports: [
2069
- CommonModule,
2070
- McButtonModule,
2071
- OverlayModule,
2072
- A11yModule,
2073
- PortalModule,
2074
- McButtonModule,
2075
- McSelectModule,
2076
- McIconModule
2077
- ],
2078
- exports: [
2079
- McCalendar,
2080
- McCalendarBody,
2081
- McDatepicker,
2082
- McDatepickerContent,
2083
- McDatepickerInput,
2084
- McDatepickerToggle,
2085
- McDatepickerToggleIcon,
2086
- McMonthView,
2087
- McCalendarHeader
2088
- ],
2089
- declarations: [
2090
- McCalendar,
2091
- McCalendarBody,
2092
- McDatepicker,
2093
- McDatepickerContent,
2094
- McDatepickerInput,
2095
- McDatepickerToggle,
2096
- McDatepickerToggleIcon,
2097
- McMonthView,
2098
- McCalendarHeader
2099
- ],
2100
- providers: [
2101
- McDatepickerIntl,
2102
- MC_DATEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER
2103
- ]
2104
- }]
2105
- }] });
2106
-
2107
- /**
2108
- * Generated bundle index. Do not edit.
2109
- */
2110
-
2111
- export { MAX_YEAR, MC_DATEPICKER_SCROLL_STRATEGY, MC_DATEPICKER_SCROLL_STRATEGY_FACTORY, MC_DATEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER, MC_DATEPICKER_VALIDATORS, MC_DATEPICKER_VALUE_ACCESSOR, McCalendar, McCalendarBody, McCalendarCell, McCalendarHeader, McDatepicker, McDatepickerContent, McDatepickerInput, McDatepickerInputEvent, McDatepickerIntl, McDatepickerModule, McDatepickerToggle, McDatepickerToggleIcon, McMonthView, mcDatepickerAnimations };
2112
- //# sourceMappingURL=ptsecurity-mosaic-datepicker.mjs.map