@ptsecurity/mosaic 12.3.0 → 13.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (905) hide show
  1. package/_theming.scss +978 -781
  2. package/_visual.scss +848 -692
  3. package/autocomplete/README.md +0 -0
  4. package/autocomplete/package.json +5 -5
  5. package/button/README.md +0 -0
  6. package/button/button.component.d.ts +17 -14
  7. package/button/button.module.d.ts +1 -1
  8. package/button/package.json +5 -5
  9. package/button-toggle/README.md +0 -0
  10. package/button-toggle/package.json +5 -5
  11. package/card/README.md +0 -0
  12. package/card/package.json +5 -5
  13. package/checkbox/README.md +1 -0
  14. package/checkbox/package.json +5 -5
  15. package/core/formatters/date/formatter.d.ts +41 -17
  16. package/core/formatters/date/templates/en-US.d.ts +8 -8
  17. package/core/formatters/date/templates/ru-RU.d.ts +8 -8
  18. package/core/package.json +5 -5
  19. package/core/pop-up/pop-up.d.ts +1 -0
  20. package/core/public-api.d.ts +1 -0
  21. package/core/version.d.ts +2 -0
  22. package/datepicker/README.md +0 -0
  23. package/datepicker/package.json +5 -5
  24. package/design-tokens/{tokens → legacy-2017/tokens}/components/alert.json5 +0 -0
  25. package/design-tokens/{tokens → legacy-2017/tokens}/components/autocomplete.json5 +0 -0
  26. package/design-tokens/{tokens → legacy-2017/tokens}/components/badge.json5 +0 -0
  27. package/design-tokens/{tokens → legacy-2017/tokens}/components/button-toggle.json5 +0 -0
  28. package/design-tokens/{tokens → legacy-2017/tokens}/components/button.json5 +0 -0
  29. package/design-tokens/{tokens → legacy-2017/tokens}/components/card.json5 +0 -0
  30. package/design-tokens/legacy-2017/tokens/components/checkbox.json5 +39 -0
  31. package/design-tokens/{tokens → legacy-2017/tokens}/components/datepicker.json5 +0 -0
  32. package/design-tokens/{tokens → legacy-2017/tokens}/components/divider.json5 +0 -0
  33. package/design-tokens/{tokens → legacy-2017/tokens}/components/dropdown.json5 +0 -0
  34. package/design-tokens/{tokens → legacy-2017/tokens}/components/form-field.json5 +0 -0
  35. package/design-tokens/{tokens → legacy-2017/tokens}/components/forms.json5 +0 -0
  36. package/design-tokens/{tokens → legacy-2017/tokens}/components/input.json5 +0 -0
  37. package/design-tokens/{tokens → legacy-2017/tokens}/components/link.json5 +0 -0
  38. package/design-tokens/{tokens → legacy-2017/tokens}/components/list.json5 +0 -0
  39. package/design-tokens/legacy-2017/tokens/components/modal.json5 +79 -0
  40. package/design-tokens/legacy-2017/tokens/components/navbar.json5 +69 -0
  41. package/design-tokens/{tokens → legacy-2017/tokens}/components/optgroup.json5 +0 -0
  42. package/design-tokens/{tokens → legacy-2017/tokens}/components/option.json5 +0 -0
  43. package/design-tokens/{tokens → legacy-2017/tokens}/components/popover.json5 +0 -0
  44. package/design-tokens/{tokens → legacy-2017/tokens}/components/popup.json5 +0 -0
  45. package/design-tokens/{tokens → legacy-2017/tokens}/components/progress-bar.json5 +0 -0
  46. package/design-tokens/{tokens → legacy-2017/tokens}/components/progress-spinner.json5 +0 -0
  47. package/design-tokens/legacy-2017/tokens/components/radio.json5 +44 -0
  48. package/design-tokens/{tokens → legacy-2017/tokens}/components/select.json5 +0 -0
  49. package/design-tokens/{tokens → legacy-2017/tokens}/components/sidepanel.json5 +0 -0
  50. package/design-tokens/{tokens → legacy-2017/tokens}/components/table.json5 +0 -0
  51. package/design-tokens/{tokens → legacy-2017/tokens}/components/tabs.json5 +0 -0
  52. package/design-tokens/legacy-2017/tokens/components/tags.json5 +132 -0
  53. package/design-tokens/{tokens → legacy-2017/tokens}/components/textarea.json5 +0 -0
  54. package/design-tokens/{tokens → legacy-2017/tokens}/components/timepicker.json5 +0 -0
  55. package/design-tokens/legacy-2017/tokens/components/toggle.json5 +79 -0
  56. package/design-tokens/{tokens → legacy-2017/tokens}/components/tooltip.json5 +0 -0
  57. package/design-tokens/{tokens → legacy-2017/tokens}/components/tree.json5 +0 -0
  58. package/design-tokens/{tokens → legacy-2017/tokens}/properties/aliases.json5 +0 -0
  59. package/design-tokens/{tokens → legacy-2017/tokens}/properties/colors.json5 +0 -0
  60. package/design-tokens/{tokens → legacy-2017/tokens}/properties/font.json5 +0 -0
  61. package/design-tokens/{tokens → legacy-2017/tokens}/properties/globals.json5 +0 -0
  62. package/design-tokens/{tokens → legacy-2017/tokens}/properties/padding.json5 +0 -0
  63. package/design-tokens/{tokens → legacy-2017/tokens}/properties/palette.json5 +0 -0
  64. package/design-tokens/{tokens → legacy-2017/tokens}/properties/typography.json5 +0 -0
  65. package/design-tokens/legacy-2017/tokens.d.ts +7659 -0
  66. package/design-tokens/package.json +5 -5
  67. package/design-tokens/pt-2022/tokens/components/alert.json5 +83 -0
  68. package/design-tokens/pt-2022/tokens/components/autocomplete.json5 +11 -0
  69. package/design-tokens/pt-2022/tokens/components/badge.json5 +184 -0
  70. package/design-tokens/pt-2022/tokens/components/button-toggle.json5 +10 -0
  71. package/design-tokens/pt-2022/tokens/components/button.json5 +143 -0
  72. package/design-tokens/pt-2022/tokens/components/card.json5 +51 -0
  73. package/design-tokens/pt-2022/tokens/components/checkbox.json5 +39 -0
  74. package/design-tokens/pt-2022/tokens/components/datepicker.json5 +64 -0
  75. package/design-tokens/pt-2022/tokens/components/divider.json5 +8 -0
  76. package/design-tokens/pt-2022/tokens/components/dropdown.json5 +47 -0
  77. package/design-tokens/pt-2022/tokens/components/form-field.json5 +52 -0
  78. package/design-tokens/pt-2022/tokens/components/forms.json5 +52 -0
  79. package/design-tokens/pt-2022/tokens/components/input.json5 +13 -0
  80. package/design-tokens/pt-2022/tokens/components/link.json5 +56 -0
  81. package/design-tokens/pt-2022/tokens/components/list.json5 +15 -0
  82. package/design-tokens/pt-2022/tokens/components/modal.json5 +79 -0
  83. package/design-tokens/pt-2022/tokens/components/navbar.json5 +69 -0
  84. package/design-tokens/pt-2022/tokens/components/optgroup.json5 +10 -0
  85. package/design-tokens/pt-2022/tokens/components/option.json5 +12 -0
  86. package/design-tokens/pt-2022/tokens/components/popover.json5 +68 -0
  87. package/design-tokens/pt-2022/tokens/components/popup.json5 +18 -0
  88. package/design-tokens/pt-2022/tokens/components/progress-bar.json5 +13 -0
  89. package/design-tokens/pt-2022/tokens/components/progress-spinner.json5 +7 -0
  90. package/design-tokens/pt-2022/tokens/components/radio.json5 +44 -0
  91. package/design-tokens/pt-2022/tokens/components/select.json5 +25 -0
  92. package/design-tokens/pt-2022/tokens/components/sidepanel.json5 +30 -0
  93. package/design-tokens/pt-2022/tokens/components/table.json5 +15 -0
  94. package/design-tokens/pt-2022/tokens/components/tabs.json5 +25 -0
  95. package/design-tokens/pt-2022/tokens/components/tags.json5 +132 -0
  96. package/design-tokens/pt-2022/tokens/components/textarea.json5 +12 -0
  97. package/design-tokens/pt-2022/tokens/components/timepicker.json5 +7 -0
  98. package/design-tokens/pt-2022/tokens/components/toggle.json5 +79 -0
  99. package/design-tokens/pt-2022/tokens/components/tooltip.json5 +83 -0
  100. package/design-tokens/pt-2022/tokens/components/tree.json5 +12 -0
  101. package/design-tokens/pt-2022/tokens/properties/aliases.json5 +3 -0
  102. package/design-tokens/pt-2022/tokens/properties/colors.json5 +112 -0
  103. package/design-tokens/pt-2022/tokens/properties/font.json5 +15 -0
  104. package/design-tokens/pt-2022/tokens/properties/globals.json5 +30 -0
  105. package/design-tokens/pt-2022/tokens/properties/padding.json5 +3 -0
  106. package/design-tokens/pt-2022/tokens/properties/palette.json5 +226 -0
  107. package/design-tokens/pt-2022/tokens/properties/typography.json5 +140 -0
  108. package/design-tokens/pt-2022/tokens.d.ts +8696 -0
  109. package/design-tokens/public-api.d.ts +3 -1
  110. package/divider/README.md +0 -0
  111. package/divider/package.json +5 -5
  112. package/dropdown/package.json +5 -5
  113. package/esm2020/autocomplete/autocomplete-origin.directive.mjs +21 -0
  114. package/esm2020/autocomplete/autocomplete-trigger.directive.mjs +555 -0
  115. package/esm2020/autocomplete/autocomplete.component.mjs +154 -0
  116. package/esm2020/autocomplete/autocomplete.module.mjs +34 -0
  117. package/{esm2015/autocomplete/index.js → esm2020/autocomplete/index.mjs} +0 -0
  118. package/{esm2015/autocomplete/ptsecurity-mosaic-autocomplete.js → esm2020/autocomplete/ptsecurity-mosaic-autocomplete.mjs} +0 -0
  119. package/{esm2015/autocomplete/public-api.js → esm2020/autocomplete/public-api.mjs} +0 -0
  120. package/esm2020/button/button.component.mjs +129 -0
  121. package/esm2020/button/button.module.mjs +38 -0
  122. package/{esm2015/button/index.js → esm2020/button/index.mjs} +0 -0
  123. package/{esm2015/button/ptsecurity-mosaic-button.js → esm2020/button/ptsecurity-mosaic-button.mjs} +0 -0
  124. package/{esm2015/button/public-api.js → esm2020/button/public-api.mjs} +0 -0
  125. package/esm2020/button-toggle/button-toggle.component.mjs +362 -0
  126. package/esm2020/button-toggle/button-toggle.module.mjs +19 -0
  127. package/{esm2015/button-toggle/index.js → esm2020/button-toggle/index.mjs} +0 -0
  128. package/{esm2015/button-toggle/ptsecurity-mosaic-button-toggle.js → esm2020/button-toggle/ptsecurity-mosaic-button-toggle.mjs} +0 -0
  129. package/{esm2015/button-toggle/public-api.js → esm2020/button-toggle/public-api.mjs} +0 -0
  130. package/esm2020/card/card.component.mjs +80 -0
  131. package/esm2020/card/card.module.mjs +30 -0
  132. package/{esm2015/card/index.js → esm2020/card/index.mjs} +0 -0
  133. package/{esm2015/card/ptsecurity-mosaic-card.js → esm2020/card/ptsecurity-mosaic-card.mjs} +0 -0
  134. package/{esm2015/card/public-api.js → esm2020/card/public-api.mjs} +0 -0
  135. package/{esm2015/checkbox/checkbox-config.js → esm2020/checkbox/checkbox-config.mjs} +0 -0
  136. package/esm2020/checkbox/checkbox-module.mjs +19 -0
  137. package/esm2020/checkbox/checkbox-required-validator.mjs +27 -0
  138. package/esm2020/checkbox/checkbox.mjs +315 -0
  139. package/{esm2015/checkbox/index.js → esm2020/checkbox/index.mjs} +0 -0
  140. package/{esm2015/checkbox/ptsecurity-mosaic-checkbox.js → esm2020/checkbox/ptsecurity-mosaic-checkbox.mjs} +0 -0
  141. package/{esm2015/checkbox/public-api.js → esm2020/checkbox/public-api.mjs} +0 -0
  142. package/{esm2015/core/animation/animation.js → esm2020/core/animation/animation.mjs} +0 -0
  143. package/{esm2015/core/animation/fade-animations.js → esm2020/core/animation/fade-animations.mjs} +0 -0
  144. package/{esm2015/core/animation/index.js → esm2020/core/animation/index.mjs} +0 -0
  145. package/{esm2015/core/animation/select-animations.js → esm2020/core/animation/select-animations.mjs} +0 -0
  146. package/{esm2015/core/common-behaviors/color.js → esm2020/core/common-behaviors/color.mjs} +0 -0
  147. package/esm2020/core/common-behaviors/common-module.mjs +83 -0
  148. package/{esm2015/core/common-behaviors/constructor.js → esm2020/core/common-behaviors/constructor.mjs} +0 -0
  149. package/{esm2015/core/common-behaviors/disabled.js → esm2020/core/common-behaviors/disabled.mjs} +0 -0
  150. package/{esm2015/core/common-behaviors/error-state.js → esm2020/core/common-behaviors/error-state.mjs} +0 -0
  151. package/{esm2015/core/common-behaviors/index.js → esm2020/core/common-behaviors/index.mjs} +0 -0
  152. package/{esm2015/core/common-behaviors/tabindex.js → esm2020/core/common-behaviors/tabindex.mjs} +0 -0
  153. package/esm2020/core/error/error-options.mjs +26 -0
  154. package/esm2020/core/formatters/date/formatter.mjs +359 -0
  155. package/esm2020/core/formatters/date/templates/en-US.mjs +281 -0
  156. package/esm2020/core/formatters/date/templates/ru-RU.mjs +281 -0
  157. package/esm2020/core/formatters/index.mjs +20 -0
  158. package/esm2020/core/formatters/number/formatter.mjs +105 -0
  159. package/esm2020/core/forms/forms-module.mjs +24 -0
  160. package/esm2020/core/forms/forms.directive.mjs +66 -0
  161. package/{esm2015/core/forms/index.js → esm2020/core/forms/index.mjs} +0 -0
  162. package/esm2020/core/highlight/highlight.pipe.mjs +17 -0
  163. package/esm2020/core/highlight/index.mjs +19 -0
  164. package/{esm2015/core/index.js → esm2020/core/index.mjs} +0 -0
  165. package/{esm2015/core/label/label-options.js → esm2020/core/label/label-options.mjs} +0 -0
  166. package/esm2020/core/line/line.mjs +70 -0
  167. package/esm2020/core/option/action.mjs +121 -0
  168. package/{esm2015/core/option/index.js → esm2020/core/option/index.mjs} +0 -0
  169. package/esm2020/core/option/optgroup.mjs +31 -0
  170. package/esm2020/core/option/option-module.mjs +21 -0
  171. package/esm2020/core/option/option.mjs +254 -0
  172. package/{esm2015/core/overlay/overlay-position-map.js → esm2020/core/overlay/overlay-position-map.mjs} +0 -0
  173. package/{esm2015/core/pop-up/constants.js → esm2020/core/pop-up/constants.mjs} +0 -0
  174. package/{esm2015/core/pop-up/index.js → esm2020/core/pop-up/index.mjs} +0 -0
  175. package/esm2020/core/pop-up/pop-up-trigger.mjs +239 -0
  176. package/esm2020/core/pop-up/pop-up.mjs +94 -0
  177. package/{esm2015/core/ptsecurity-mosaic-core.js → esm2020/core/ptsecurity-mosaic-core.mjs} +0 -0
  178. package/esm2020/core/public-api.mjs +18 -0
  179. package/{esm2015/core/select/constants.js → esm2020/core/select/constants.mjs} +0 -0
  180. package/{esm2015/core/select/errors.js → esm2020/core/select/errors.mjs} +0 -0
  181. package/{esm2015/core/select/events.js → esm2020/core/select/events.mjs} +0 -0
  182. package/{esm2015/core/select/index.js → esm2020/core/select/index.mjs} +0 -0
  183. package/{esm2015/core/selection/constants.js → esm2020/core/selection/constants.mjs} +0 -0
  184. package/{esm2015/core/selection/index.js → esm2020/core/selection/index.mjs} +0 -0
  185. package/esm2020/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +37 -0
  186. package/esm2020/core/selection/pseudo-checkbox/pseudo-checkbox.module.mjs +18 -0
  187. package/esm2020/core/services/measure-scrollbar.service.mjs +48 -0
  188. package/{esm2015/core/utils/index.js → esm2020/core/utils/index.mjs} +0 -0
  189. package/{esm2015/core/utils/public-api.js → esm2020/core/utils/public-api.mjs} +0 -0
  190. package/{esm2015/core/utils/utils.js → esm2020/core/utils/utils.mjs} +0 -0
  191. package/{esm2015/core/validation/index.js → esm2020/core/validation/index.mjs} +0 -0
  192. package/{esm2015/core/validation/validation.js → esm2020/core/validation/validation.mjs} +0 -0
  193. package/esm2020/core/version.mjs +3 -0
  194. package/esm2020/datepicker/calendar-body.component.mjs +106 -0
  195. package/esm2020/datepicker/calendar.component.mjs +362 -0
  196. package/{esm2015/datepicker/datepicker-animations.js → esm2020/datepicker/datepicker-animations.mjs} +0 -0
  197. package/{esm2015/datepicker/datepicker-errors.js → esm2020/datepicker/datepicker-errors.mjs} +0 -0
  198. package/esm2020/datepicker/datepicker-input.directive.mjs +900 -0
  199. package/esm2020/datepicker/datepicker-intl.mjs +40 -0
  200. package/esm2020/datepicker/datepicker-module.mjs +107 -0
  201. package/esm2020/datepicker/datepicker-toggle.component.mjs +86 -0
  202. package/esm2020/datepicker/datepicker.component.mjs +408 -0
  203. package/{esm2015/datepicker/index.js → esm2020/datepicker/index.mjs} +0 -0
  204. package/esm2020/datepicker/month-view.component.mjs +257 -0
  205. package/esm2020/datepicker/multi-year-view.component.mjs +218 -0
  206. package/{esm2015/datepicker/ptsecurity-mosaic-datepicker.js → esm2020/datepicker/ptsecurity-mosaic-datepicker.mjs} +0 -0
  207. package/{esm2015/datepicker/public-api.js → esm2020/datepicker/public-api.mjs} +0 -0
  208. package/esm2020/datepicker/year-view.component.mjs +253 -0
  209. package/{esm2015/design-tokens/index.js → esm2020/design-tokens/index.mjs} +0 -0
  210. package/esm2020/design-tokens/legacy-2017/tokens.mjs +953 -0
  211. package/esm2020/design-tokens/pt-2022/tokens.mjs +1013 -0
  212. package/{esm2015/design-tokens/ptsecurity-mosaic-design-tokens.js → esm2020/design-tokens/ptsecurity-mosaic-design-tokens.mjs} +0 -0
  213. package/esm2020/design-tokens/public-api.mjs +4 -0
  214. package/esm2020/divider/divider.component.mjs +39 -0
  215. package/esm2020/divider/divider.module.mjs +18 -0
  216. package/{esm2015/divider/index.js → esm2020/divider/index.mjs} +0 -0
  217. package/{esm2015/divider/ptsecurity-mosaic-divider.js → esm2020/divider/ptsecurity-mosaic-divider.mjs} +0 -0
  218. package/{esm2015/divider/public-api.js → esm2020/divider/public-api.mjs} +0 -0
  219. package/{esm2015/dropdown/dropdown-animations.js → esm2020/dropdown/dropdown-animations.mjs} +0 -0
  220. package/esm2020/dropdown/dropdown-content.directive.mjs +64 -0
  221. package/{esm2015/dropdown/dropdown-errors.js → esm2020/dropdown/dropdown-errors.mjs} +0 -0
  222. package/esm2020/dropdown/dropdown-item.component.mjs +139 -0
  223. package/esm2020/dropdown/dropdown-trigger.directive.mjs +485 -0
  224. package/esm2020/dropdown/dropdown.component.mjs +292 -0
  225. package/esm2020/dropdown/dropdown.module.mjs +50 -0
  226. package/{esm2015/dropdown/dropdown.types.js → esm2020/dropdown/dropdown.types.mjs} +0 -0
  227. package/{esm2015/dropdown/index.js → esm2020/dropdown/index.mjs} +0 -0
  228. package/{esm2015/dropdown/ptsecurity-mosaic-dropdown.js → esm2020/dropdown/ptsecurity-mosaic-dropdown.mjs} +0 -0
  229. package/{esm2015/dropdown/public-api.js → esm2020/dropdown/public-api.mjs} +0 -0
  230. package/esm2020/form-field/cleaner.mjs +23 -0
  231. package/{esm2015/form-field/form-field-control.js → esm2020/form-field/form-field-control.mjs} +0 -0
  232. package/{esm2015/form-field/form-field-errors.js → esm2020/form-field/form-field-errors.mjs} +0 -0
  233. package/esm2020/form-field/form-field.mjs +205 -0
  234. package/esm2020/form-field/form-field.module.mjs +52 -0
  235. package/esm2020/form-field/hint.mjs +23 -0
  236. package/{esm2015/form-field/index.js → esm2020/form-field/index.mjs} +0 -0
  237. package/esm2020/form-field/prefix.mjs +13 -0
  238. package/{esm2015/form-field/ptsecurity-mosaic-form-field.js → esm2020/form-field/ptsecurity-mosaic-form-field.mjs} +0 -0
  239. package/{esm2015/form-field/public-api.js → esm2020/form-field/public-api.mjs} +0 -0
  240. package/esm2020/form-field/stepper.mjs +55 -0
  241. package/esm2020/form-field/suffix.mjs +13 -0
  242. package/esm2020/icon/icon.component.mjs +44 -0
  243. package/esm2020/icon/icon.module.mjs +38 -0
  244. package/{esm2015/icon/index.js → esm2020/icon/index.mjs} +0 -0
  245. package/{esm2015/icon/ptsecurity-mosaic-icon.js → esm2020/icon/ptsecurity-mosaic-icon.mjs} +0 -0
  246. package/{esm2015/icon/public-api.js → esm2020/icon/public-api.mjs} +0 -0
  247. package/{esm2015/index.js → esm2020/index.mjs} +0 -0
  248. package/{esm2015/input/index.js → esm2020/input/index.mjs} +0 -0
  249. package/{esm2015/input/input-errors.js → esm2020/input/input-errors.mjs} +0 -0
  250. package/esm2020/input/input-number-validators.mjs +92 -0
  251. package/esm2020/input/input-number.mjs +163 -0
  252. package/{esm2015/input/input-value-accessor.js → esm2020/input/input-value-accessor.mjs} +0 -0
  253. package/esm2020/input/input.mjs +333 -0
  254. package/esm2020/input/input.module.mjs +23 -0
  255. package/{esm2015/input/ptsecurity-mosaic-input.js → esm2020/input/ptsecurity-mosaic-input.mjs} +0 -0
  256. package/{esm2015/input/public-api.js → esm2020/input/public-api.mjs} +0 -0
  257. package/{esm2015/link/index.js → esm2020/link/index.mjs} +0 -0
  258. package/esm2020/link/link.component.mjs +107 -0
  259. package/esm2020/link/link.module.mjs +26 -0
  260. package/{esm2015/link/ptsecurity-mosaic-link.js → esm2020/link/ptsecurity-mosaic-link.mjs} +0 -0
  261. package/{esm2015/link/public-api.js → esm2020/link/public-api.mjs} +0 -0
  262. package/{esm2015/list/index.js → esm2020/list/index.mjs} +0 -0
  263. package/esm2020/list/list-selection.component.mjs +687 -0
  264. package/esm2020/list/list.component.mjs +44 -0
  265. package/esm2020/list/list.module.mjs +55 -0
  266. package/{esm2015/list/ptsecurity-mosaic-list.js → esm2020/list/ptsecurity-mosaic-list.mjs} +0 -0
  267. package/{esm2015/list/public-api.js → esm2020/list/public-api.mjs} +0 -0
  268. package/esm2020/modal/css-unit.pipe.mjs +17 -0
  269. package/{esm2015/modal/index.js → esm2020/modal/index.mjs} +0 -0
  270. package/esm2020/modal/modal-control.service.mjs +85 -0
  271. package/{esm2015/modal/modal-ref.class.js → esm2020/modal/modal-ref.class.mjs} +0 -0
  272. package/{esm2015/modal/modal-util.js → esm2020/modal/modal-util.mjs} +0 -0
  273. package/esm2020/modal/modal.component.mjs +501 -0
  274. package/esm2020/modal/modal.directive.mjs +52 -0
  275. package/esm2020/modal/modal.module.mjs +72 -0
  276. package/esm2020/modal/modal.service.mjs +124 -0
  277. package/{esm2015/modal/modal.type.js → esm2020/modal/modal.type.mjs} +0 -0
  278. package/{esm2015/modal/ptsecurity-mosaic-modal.js → esm2020/modal/ptsecurity-mosaic-modal.mjs} +0 -0
  279. package/{esm2015/modal/public-api.js → esm2020/modal/public-api.mjs} +0 -0
  280. package/{esm2015/navbar/index.js → esm2020/navbar/index.mjs} +0 -0
  281. package/esm2020/navbar/navbar-item.component.mjs +583 -0
  282. package/esm2020/navbar/navbar.component.mjs +237 -0
  283. package/esm2020/navbar/navbar.module.mjs +92 -0
  284. package/{esm2015/navbar/ptsecurity-mosaic-navbar.js → esm2020/navbar/ptsecurity-mosaic-navbar.mjs} +0 -0
  285. package/{esm2015/navbar/public-api.js → esm2020/navbar/public-api.mjs} +0 -0
  286. package/esm2020/navbar/vertical-navbar.animation.mjs +10 -0
  287. package/esm2020/navbar/vertical-navbar.component.mjs +114 -0
  288. package/{esm2015/popover/index.js → esm2020/popover/index.mjs} +0 -0
  289. package/{esm2015/popover/popover-animations.js → esm2020/popover/popover-animations.mjs} +0 -0
  290. package/esm2020/popover/popover-confirm.component.mjs +108 -0
  291. package/esm2020/popover/popover.component.mjs +253 -0
  292. package/esm2020/popover/popover.module.mjs +24 -0
  293. package/{esm2015/popover/ptsecurity-mosaic-popover.js → esm2020/popover/ptsecurity-mosaic-popover.mjs} +0 -0
  294. package/{esm2015/popover/public-api.js → esm2020/popover/public-api.mjs} +0 -0
  295. package/{esm2015/progress-bar/index.js → esm2020/progress-bar/index.mjs} +0 -0
  296. package/esm2020/progress-bar/progress-bar.component.mjs +42 -0
  297. package/esm2020/progress-bar/progress-bar.module.mjs +30 -0
  298. package/{esm2015/progress-bar/ptsecurity-mosaic-progress-bar.js → esm2020/progress-bar/ptsecurity-mosaic-progress-bar.mjs} +0 -0
  299. package/{esm2015/progress-bar/public-api.js → esm2020/progress-bar/public-api.mjs} +0 -0
  300. package/{esm2015/progress-spinner/index.js → esm2020/progress-spinner/index.mjs} +0 -0
  301. package/esm2020/progress-spinner/progress-spinner.component.mjs +46 -0
  302. package/esm2020/progress-spinner/progress-spinner.module.mjs +30 -0
  303. package/{esm2015/progress-spinner/ptsecurity-mosaic-progress-spinner.js → esm2020/progress-spinner/ptsecurity-mosaic-progress-spinner.mjs} +0 -0
  304. package/{esm2015/progress-spinner/public-api.js → esm2020/progress-spinner/public-api.mjs} +0 -0
  305. package/{esm2015/ptsecurity-mosaic.js → esm2020/ptsecurity-mosaic.mjs} +0 -0
  306. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  307. package/{esm2015/radio/index.js → esm2020/radio/index.mjs} +0 -0
  308. package/{esm2015/radio/ptsecurity-mosaic-radio.js → esm2020/radio/ptsecurity-mosaic-radio.mjs} +0 -0
  309. package/{esm2015/radio/public-api.js → esm2020/radio/public-api.mjs} +0 -0
  310. package/esm2020/radio/radio.component.mjs +458 -0
  311. package/esm2020/radio/radio.module.mjs +20 -0
  312. package/{esm2015/select/index.js → esm2020/select/index.mjs} +0 -0
  313. package/{esm2015/select/ptsecurity-mosaic-select.js → esm2020/select/ptsecurity-mosaic-select.mjs} +0 -0
  314. package/{esm2015/select/public-api.js → esm2020/select/public-api.mjs} +0 -0
  315. package/esm2020/select/select.component.mjs +1110 -0
  316. package/esm2020/select/select.module.mjs +64 -0
  317. package/{esm2015/sidebar/index.js → esm2020/sidebar/index.mjs} +0 -0
  318. package/{esm2015/sidebar/ptsecurity-mosaic-sidebar.js → esm2020/sidebar/ptsecurity-mosaic-sidebar.mjs} +0 -0
  319. package/{esm2015/sidebar/public-api.js → esm2020/sidebar/public-api.mjs} +0 -0
  320. package/{esm2015/sidebar/sidebar-animations.js → esm2020/sidebar/sidebar-animations.mjs} +0 -0
  321. package/esm2020/sidebar/sidebar.component.mjs +146 -0
  322. package/esm2020/sidebar/sidebar.module.mjs +30 -0
  323. package/{esm2015/sidepanel/index.js → esm2020/sidepanel/index.mjs} +0 -0
  324. package/{esm2015/sidepanel/ptsecurity-mosaic-sidepanel.js → esm2020/sidepanel/ptsecurity-mosaic-sidepanel.mjs} +0 -0
  325. package/{esm2015/sidepanel/public-api.js → esm2020/sidepanel/public-api.mjs} +0 -0
  326. package/{esm2015/sidepanel/sidepanel-animations.js → esm2020/sidepanel/sidepanel-animations.mjs} +0 -0
  327. package/{esm2015/sidepanel/sidepanel-config.js → esm2020/sidepanel/sidepanel-config.mjs} +0 -0
  328. package/esm2020/sidepanel/sidepanel-container.component.mjs +106 -0
  329. package/esm2020/sidepanel/sidepanel-directives.mjs +159 -0
  330. package/{esm2015/sidepanel/sidepanel-ref.js → esm2020/sidepanel/sidepanel-ref.mjs} +0 -0
  331. package/esm2020/sidepanel/sidepanel.module.mjs +74 -0
  332. package/esm2020/sidepanel/sidepanel.service.mjs +167 -0
  333. package/{esm2015/splitter/index.js → esm2020/splitter/index.mjs} +0 -0
  334. package/{esm2015/splitter/ptsecurity-mosaic-splitter.js → esm2020/splitter/ptsecurity-mosaic-splitter.mjs} +0 -0
  335. package/{esm2015/splitter/public-api.js → esm2020/splitter/public-api.mjs} +0 -0
  336. package/esm2020/splitter/splitter.component.mjs +482 -0
  337. package/esm2020/splitter/splitter.module.mjs +40 -0
  338. package/{esm2015/table/index.js → esm2020/table/index.mjs} +0 -0
  339. package/{esm2015/table/ptsecurity-mosaic-table.js → esm2020/table/ptsecurity-mosaic-table.mjs} +0 -0
  340. package/{esm2015/table/public-api.js → esm2020/table/public-api.mjs} +0 -0
  341. package/esm2020/table/table.component.mjs +16 -0
  342. package/esm2020/table/table.module.mjs +30 -0
  343. package/{esm2015/tabs/index.js → esm2020/tabs/index.mjs} +0 -0
  344. package/esm2020/tabs/paginated-tab-header.mjs +479 -0
  345. package/{esm2015/tabs/ptsecurity-mosaic-tabs.js → esm2020/tabs/ptsecurity-mosaic-tabs.mjs} +0 -0
  346. package/{esm2015/tabs/public-api.js → esm2020/tabs/public-api.mjs} +0 -0
  347. package/esm2020/tabs/tab-body.component.mjs +178 -0
  348. package/esm2020/tabs/tab-content.directive.mjs +15 -0
  349. package/esm2020/tabs/tab-group.component.mjs +350 -0
  350. package/esm2020/tabs/tab-header.component.mjs +67 -0
  351. package/esm2020/tabs/tab-label-wrapper.directive.mjs +78 -0
  352. package/esm2020/tabs/tab-label.directive.mjs +17 -0
  353. package/{esm2015/tabs/tab-nav-bar/index.js → esm2020/tabs/tab-nav-bar/index.mjs} +0 -0
  354. package/esm2020/tabs/tab-nav-bar/tab-nav-bar.mjs +110 -0
  355. package/esm2020/tabs/tab.component.mjs +133 -0
  356. package/{esm2015/tabs/tabs-animations.js → esm2020/tabs/tabs-animations.mjs} +0 -0
  357. package/esm2020/tabs/tabs.module.mjs +104 -0
  358. package/{esm2015/tags/index.js → esm2020/tags/index.mjs} +0 -0
  359. package/{esm2015/tags/ptsecurity-mosaic-tags.js → esm2020/tags/ptsecurity-mosaic-tags.mjs} +0 -0
  360. package/{esm2015/tags/public-api.js → esm2020/tags/public-api.mjs} +0 -0
  361. package/{esm2015/tags/tag-default-options.js → esm2020/tags/tag-default-options.mjs} +0 -0
  362. package/esm2020/tags/tag-input.mjs +229 -0
  363. package/esm2020/tags/tag-list.component.mjs +722 -0
  364. package/{esm2015/tags/tag-text-control.js → esm2020/tags/tag-text-control.mjs} +0 -0
  365. package/esm2020/tags/tag.component.mjs +377 -0
  366. package/esm2020/tags/tag.module.mjs +56 -0
  367. package/{esm2015/textarea/index.js → esm2020/textarea/index.mjs} +0 -0
  368. package/{esm2015/textarea/ptsecurity-mosaic-textarea.js → esm2020/textarea/ptsecurity-mosaic-textarea.mjs} +0 -0
  369. package/{esm2015/textarea/public-api.js → esm2020/textarea/public-api.mjs} +0 -0
  370. package/esm2020/textarea/textarea.component.mjs +268 -0
  371. package/esm2020/textarea/textarea.module.mjs +21 -0
  372. package/{esm2015/timepicker/index.js → esm2020/timepicker/index.mjs} +0 -0
  373. package/{esm2015/timepicker/ptsecurity-mosaic-timepicker.js → esm2020/timepicker/ptsecurity-mosaic-timepicker.mjs} +0 -0
  374. package/{esm2015/timepicker/public-api.js → esm2020/timepicker/public-api.mjs} +0 -0
  375. package/{esm2015/timepicker/timepicker.constants.js → esm2020/timepicker/timepicker.constants.mjs} +0 -0
  376. package/esm2020/timepicker/timepicker.directive.mjs +653 -0
  377. package/esm2020/timepicker/timepicker.module.mjs +34 -0
  378. package/{esm2015/toggle/index.js → esm2020/toggle/index.mjs} +0 -0
  379. package/{esm2015/toggle/ptsecurity-mosaic-toggle.js → esm2020/toggle/ptsecurity-mosaic-toggle.mjs} +0 -0
  380. package/{esm2015/toggle/public-api.js → esm2020/toggle/public-api.mjs} +0 -0
  381. package/esm2020/toggle/toggle.component.mjs +158 -0
  382. package/esm2020/toggle/toggle.module.mjs +20 -0
  383. package/{esm2015/tooltip/index.js → esm2020/tooltip/index.mjs} +0 -0
  384. package/{esm2015/tooltip/ptsecurity-mosaic-tooltip.js → esm2020/tooltip/ptsecurity-mosaic-tooltip.mjs} +0 -0
  385. package/{esm2015/tooltip/public-api.js → esm2020/tooltip/public-api.mjs} +0 -0
  386. package/{esm2015/tooltip/tooltip.animations.js → esm2020/tooltip/tooltip.animations.mjs} +0 -0
  387. package/esm2020/tooltip/tooltip.component.mjs +294 -0
  388. package/esm2020/tooltip/tooltip.module.mjs +43 -0
  389. package/{esm2015/tree/control/base-tree-control.js → esm2020/tree/control/base-tree-control.mjs} +0 -0
  390. package/{esm2015/tree/control/flat-tree-control.js → esm2020/tree/control/flat-tree-control.mjs} +0 -0
  391. package/{esm2015/tree/control/nested-tree-control.js → esm2020/tree/control/nested-tree-control.mjs} +0 -0
  392. package/{esm2015/tree/control/tree-control.js → esm2020/tree/control/tree-control.mjs} +0 -0
  393. package/esm2020/tree/data-source/flat-data-source.mjs +162 -0
  394. package/{esm2015/tree/data-source/nested-data-source.js → esm2020/tree/data-source/nested-data-source.mjs} +0 -0
  395. package/{esm2015/tree/index.js → esm2020/tree/index.mjs} +0 -0
  396. package/esm2020/tree/node.mjs +31 -0
  397. package/esm2020/tree/outlet.mjs +15 -0
  398. package/esm2020/tree/padding.directive.mjs +110 -0
  399. package/{esm2015/tree/ptsecurity-mosaic-tree.js → esm2020/tree/ptsecurity-mosaic-tree.mjs} +0 -0
  400. package/{esm2015/tree/public-api.js → esm2020/tree/public-api.mjs} +0 -0
  401. package/esm2020/tree/toggle.mjs +80 -0
  402. package/esm2020/tree/tree-base.mjs +243 -0
  403. package/{esm2015/tree/tree-errors.js → esm2020/tree/tree-errors.mjs} +0 -0
  404. package/esm2020/tree/tree-option.component.mjs +234 -0
  405. package/esm2020/tree/tree-selection.component.mjs +533 -0
  406. package/esm2020/tree/tree.mjs +15 -0
  407. package/esm2020/tree/tree.module.mjs +53 -0
  408. package/{esm2015/tree-select/index.js → esm2020/tree-select/index.mjs} +0 -0
  409. package/{esm2015/tree-select/ptsecurity-mosaic-tree-select.js → esm2020/tree-select/ptsecurity-mosaic-tree-select.mjs} +0 -0
  410. package/{esm2015/tree-select/public-api.js → esm2020/tree-select/public-api.mjs} +0 -0
  411. package/esm2020/tree-select/tree-select.component.mjs +925 -0
  412. package/esm2020/tree-select/tree-select.module.mjs +47 -0
  413. package/fesm2015/ptsecurity-mosaic-autocomplete.mjs +756 -0
  414. package/fesm2015/ptsecurity-mosaic-autocomplete.mjs.map +1 -0
  415. package/fesm2015/ptsecurity-mosaic-button-toggle.mjs +385 -0
  416. package/fesm2015/ptsecurity-mosaic-button-toggle.mjs.map +1 -0
  417. package/fesm2015/ptsecurity-mosaic-button.mjs +170 -0
  418. package/fesm2015/ptsecurity-mosaic-button.mjs.map +1 -0
  419. package/fesm2015/ptsecurity-mosaic-card.mjs +113 -0
  420. package/fesm2015/ptsecurity-mosaic-card.mjs.map +1 -0
  421. package/fesm2015/ptsecurity-mosaic-checkbox.mjs +366 -0
  422. package/fesm2015/ptsecurity-mosaic-checkbox.mjs.map +1 -0
  423. package/fesm2015/ptsecurity-mosaic-core.mjs +2704 -0
  424. package/fesm2015/ptsecurity-mosaic-core.mjs.map +1 -0
  425. package/fesm2015/ptsecurity-mosaic-datepicker.mjs +2700 -0
  426. package/fesm2015/ptsecurity-mosaic-datepicker.mjs.map +1 -0
  427. package/fesm2015/ptsecurity-mosaic-design-tokens.mjs +2925 -0
  428. package/fesm2015/ptsecurity-mosaic-design-tokens.mjs.map +1 -0
  429. package/fesm2015/ptsecurity-mosaic-divider.mjs +61 -0
  430. package/fesm2015/ptsecurity-mosaic-divider.mjs.map +1 -0
  431. package/fesm2015/ptsecurity-mosaic-dropdown.mjs +1106 -0
  432. package/fesm2015/ptsecurity-mosaic-dropdown.mjs.map +1 -0
  433. package/fesm2015/ptsecurity-mosaic-form-field.mjs +378 -0
  434. package/fesm2015/ptsecurity-mosaic-form-field.mjs.map +1 -0
  435. package/fesm2015/ptsecurity-mosaic-icon.mjs +88 -0
  436. package/fesm2015/ptsecurity-mosaic-icon.mjs.map +1 -0
  437. package/fesm2015/ptsecurity-mosaic-input.mjs +609 -0
  438. package/fesm2015/ptsecurity-mosaic-input.mjs.map +1 -0
  439. package/fesm2015/ptsecurity-mosaic-link.mjs +137 -0
  440. package/fesm2015/ptsecurity-mosaic-link.mjs.map +1 -0
  441. package/fesm2015/ptsecurity-mosaic-list.mjs +791 -0
  442. package/fesm2015/ptsecurity-mosaic-list.mjs.map +1 -0
  443. package/fesm2015/ptsecurity-mosaic-modal.mjs +864 -0
  444. package/fesm2015/ptsecurity-mosaic-modal.mjs.map +1 -0
  445. package/fesm2015/ptsecurity-mosaic-navbar.mjs +1031 -0
  446. package/fesm2015/ptsecurity-mosaic-navbar.mjs.map +1 -0
  447. package/fesm2015/ptsecurity-mosaic-popover.mjs +393 -0
  448. package/fesm2015/ptsecurity-mosaic-popover.mjs.map +1 -0
  449. package/fesm2015/ptsecurity-mosaic-progress-bar.mjs +76 -0
  450. package/fesm2015/ptsecurity-mosaic-progress-bar.mjs.map +1 -0
  451. package/fesm2015/ptsecurity-mosaic-progress-spinner.mjs +80 -0
  452. package/fesm2015/ptsecurity-mosaic-progress-spinner.mjs.map +1 -0
  453. package/fesm2015/ptsecurity-mosaic-radio.mjs +481 -0
  454. package/fesm2015/ptsecurity-mosaic-radio.mjs.map +1 -0
  455. package/fesm2015/ptsecurity-mosaic-select.mjs +1175 -0
  456. package/fesm2015/ptsecurity-mosaic-select.mjs.map +1 -0
  457. package/fesm2015/ptsecurity-mosaic-sidebar.mjs +202 -0
  458. package/fesm2015/ptsecurity-mosaic-sidebar.mjs.map +1 -0
  459. package/fesm2015/ptsecurity-mosaic-sidepanel.mjs +592 -0
  460. package/fesm2015/ptsecurity-mosaic-sidepanel.mjs.map +1 -0
  461. package/fesm2015/ptsecurity-mosaic-splitter.mjs +526 -0
  462. package/fesm2015/ptsecurity-mosaic-splitter.mjs.map +1 -0
  463. package/fesm2015/ptsecurity-mosaic-table.mjs +50 -0
  464. package/fesm2015/ptsecurity-mosaic-table.mjs.map +1 -0
  465. package/fesm2015/ptsecurity-mosaic-tabs.mjs +1511 -0
  466. package/fesm2015/ptsecurity-mosaic-tabs.mjs.map +1 -0
  467. package/fesm2015/ptsecurity-mosaic-tags.mjs +1377 -0
  468. package/fesm2015/ptsecurity-mosaic-tags.mjs.map +1 -0
  469. package/fesm2015/ptsecurity-mosaic-textarea.mjs +293 -0
  470. package/fesm2015/ptsecurity-mosaic-textarea.mjs.map +1 -0
  471. package/fesm2015/ptsecurity-mosaic-timepicker.mjs +715 -0
  472. package/fesm2015/ptsecurity-mosaic-timepicker.mjs.map +1 -0
  473. package/fesm2015/ptsecurity-mosaic-toggle.mjs +180 -0
  474. package/fesm2015/ptsecurity-mosaic-toggle.mjs.map +1 -0
  475. package/fesm2015/ptsecurity-mosaic-tooltip.mjs +365 -0
  476. package/fesm2015/ptsecurity-mosaic-tooltip.mjs.map +1 -0
  477. package/fesm2015/ptsecurity-mosaic-tree-select.mjs +972 -0
  478. package/fesm2015/ptsecurity-mosaic-tree-select.mjs.map +1 -0
  479. package/fesm2015/ptsecurity-mosaic-tree.mjs +1718 -0
  480. package/fesm2015/ptsecurity-mosaic-tree.mjs.map +1 -0
  481. package/fesm2015/ptsecurity-mosaic.mjs +4 -0
  482. package/fesm2015/ptsecurity-mosaic.mjs.map +1 -0
  483. package/fesm2020/ptsecurity-mosaic-autocomplete.mjs +752 -0
  484. package/fesm2020/ptsecurity-mosaic-autocomplete.mjs.map +1 -0
  485. package/fesm2020/ptsecurity-mosaic-button-toggle.mjs +383 -0
  486. package/fesm2020/ptsecurity-mosaic-button-toggle.mjs.map +1 -0
  487. package/fesm2020/ptsecurity-mosaic-button.mjs +170 -0
  488. package/fesm2020/ptsecurity-mosaic-button.mjs.map +1 -0
  489. package/fesm2020/ptsecurity-mosaic-card.mjs +113 -0
  490. package/fesm2020/ptsecurity-mosaic-card.mjs.map +1 -0
  491. package/fesm2020/ptsecurity-mosaic-checkbox.mjs +364 -0
  492. package/fesm2020/ptsecurity-mosaic-checkbox.mjs.map +1 -0
  493. package/fesm2020/ptsecurity-mosaic-core.mjs +2733 -0
  494. package/fesm2020/ptsecurity-mosaic-core.mjs.map +1 -0
  495. package/fesm2020/ptsecurity-mosaic-datepicker.mjs +2687 -0
  496. package/fesm2020/ptsecurity-mosaic-datepicker.mjs.map +1 -0
  497. package/fesm2020/ptsecurity-mosaic-design-tokens.mjs +2925 -0
  498. package/fesm2020/ptsecurity-mosaic-design-tokens.mjs.map +1 -0
  499. package/fesm2020/ptsecurity-mosaic-divider.mjs +61 -0
  500. package/fesm2020/ptsecurity-mosaic-divider.mjs.map +1 -0
  501. package/fesm2020/ptsecurity-mosaic-dropdown.mjs +1093 -0
  502. package/fesm2020/ptsecurity-mosaic-dropdown.mjs.map +1 -0
  503. package/fesm2020/ptsecurity-mosaic-form-field.mjs +377 -0
  504. package/fesm2020/ptsecurity-mosaic-form-field.mjs.map +1 -0
  505. package/fesm2020/ptsecurity-mosaic-icon.mjs +86 -0
  506. package/fesm2020/ptsecurity-mosaic-icon.mjs.map +1 -0
  507. package/fesm2020/ptsecurity-mosaic-input.mjs +605 -0
  508. package/fesm2020/ptsecurity-mosaic-input.mjs.map +1 -0
  509. package/fesm2020/ptsecurity-mosaic-link.mjs +136 -0
  510. package/fesm2020/ptsecurity-mosaic-link.mjs.map +1 -0
  511. package/fesm2020/ptsecurity-mosaic-list.mjs +784 -0
  512. package/fesm2020/ptsecurity-mosaic-list.mjs.map +1 -0
  513. package/fesm2020/ptsecurity-mosaic-modal.mjs +860 -0
  514. package/fesm2020/ptsecurity-mosaic-modal.mjs.map +1 -0
  515. package/fesm2020/ptsecurity-mosaic-navbar.mjs +1015 -0
  516. package/fesm2020/ptsecurity-mosaic-navbar.mjs.map +1 -0
  517. package/fesm2020/ptsecurity-mosaic-popover.mjs +389 -0
  518. package/fesm2020/ptsecurity-mosaic-popover.mjs.map +1 -0
  519. package/fesm2020/ptsecurity-mosaic-progress-bar.mjs +76 -0
  520. package/fesm2020/ptsecurity-mosaic-progress-bar.mjs.map +1 -0
  521. package/fesm2020/ptsecurity-mosaic-progress-spinner.mjs +80 -0
  522. package/fesm2020/ptsecurity-mosaic-progress-spinner.mjs.map +1 -0
  523. package/fesm2020/ptsecurity-mosaic-radio.mjs +479 -0
  524. package/fesm2020/ptsecurity-mosaic-radio.mjs.map +1 -0
  525. package/fesm2020/ptsecurity-mosaic-select.mjs +1173 -0
  526. package/fesm2020/ptsecurity-mosaic-select.mjs.map +1 -0
  527. package/fesm2020/ptsecurity-mosaic-sidebar.mjs +202 -0
  528. package/fesm2020/ptsecurity-mosaic-sidebar.mjs.map +1 -0
  529. package/fesm2020/ptsecurity-mosaic-sidepanel.mjs +589 -0
  530. package/fesm2020/ptsecurity-mosaic-sidepanel.mjs.map +1 -0
  531. package/fesm2020/ptsecurity-mosaic-splitter.mjs +526 -0
  532. package/fesm2020/ptsecurity-mosaic-splitter.mjs.map +1 -0
  533. package/fesm2020/ptsecurity-mosaic-table.mjs +50 -0
  534. package/fesm2020/ptsecurity-mosaic-table.mjs.map +1 -0
  535. package/fesm2020/ptsecurity-mosaic-tabs.mjs +1496 -0
  536. package/fesm2020/ptsecurity-mosaic-tabs.mjs.map +1 -0
  537. package/fesm2020/ptsecurity-mosaic-tags.mjs +1370 -0
  538. package/fesm2020/ptsecurity-mosaic-tags.mjs.map +1 -0
  539. package/fesm2020/ptsecurity-mosaic-textarea.mjs +291 -0
  540. package/fesm2020/ptsecurity-mosaic-textarea.mjs.map +1 -0
  541. package/fesm2020/ptsecurity-mosaic-timepicker.mjs +713 -0
  542. package/fesm2020/ptsecurity-mosaic-timepicker.mjs.map +1 -0
  543. package/fesm2020/ptsecurity-mosaic-toggle.mjs +180 -0
  544. package/fesm2020/ptsecurity-mosaic-toggle.mjs.map +1 -0
  545. package/fesm2020/ptsecurity-mosaic-tooltip.mjs +357 -0
  546. package/fesm2020/ptsecurity-mosaic-tooltip.mjs.map +1 -0
  547. package/fesm2020/ptsecurity-mosaic-tree-select.mjs +970 -0
  548. package/fesm2020/ptsecurity-mosaic-tree-select.mjs.map +1 -0
  549. package/fesm2020/ptsecurity-mosaic-tree.mjs +1705 -0
  550. package/fesm2020/ptsecurity-mosaic-tree.mjs.map +1 -0
  551. package/fesm2020/ptsecurity-mosaic.mjs +4 -0
  552. package/fesm2020/ptsecurity-mosaic.mjs.map +1 -0
  553. package/form-field/README.md +0 -0
  554. package/form-field/package.json +5 -5
  555. package/icon/README.md +0 -0
  556. package/icon/package.json +5 -5
  557. package/input/package.json +5 -5
  558. package/link/README.md +0 -0
  559. package/link/package.json +5 -5
  560. package/list/README.md +0 -0
  561. package/list/package.json +5 -5
  562. package/modal/README.md +34 -0
  563. package/modal/modal-control.service.d.ts +1 -0
  564. package/modal/package.json +5 -5
  565. package/navbar/README.md +41 -0
  566. package/navbar/navbar-item.component.d.ts +123 -34
  567. package/navbar/navbar.component.d.ts +37 -9
  568. package/navbar/navbar.module.d.ts +2 -1
  569. package/navbar/package.json +5 -5
  570. package/navbar/vertical-navbar.component.d.ts +15 -26
  571. package/package.json +299 -14
  572. package/popover/README.md +32 -0
  573. package/popover/package.json +5 -5
  574. package/prebuilt-themes/dark-theme.css +1 -1
  575. package/prebuilt-themes/default-theme.css +1 -1
  576. package/prebuilt-visual/default-visual.css +1 -1
  577. package/progress-bar/README.md +0 -0
  578. package/progress-bar/package.json +5 -5
  579. package/progress-spinner/README.md +0 -0
  580. package/progress-spinner/package.json +5 -5
  581. package/radio/package.json +5 -5
  582. package/schematics/README.md +35 -0
  583. package/schematics/ng-update/data/index.d.ts +1 -0
  584. package/schematics/ng-update/data/index.js +10 -9
  585. package/schematics/ng-update/data/index.js.map +1 -1
  586. package/schematics/ng-update/data/symbol-removal.d.ts +2 -0
  587. package/schematics/ng-update/data/symbol-removal.js +5 -0
  588. package/schematics/ng-update/data/symbol-removal.js.map +1 -0
  589. package/schematics/ng-update/index.js +3 -3
  590. package/schematics/ng-update/index.js.map +1 -1
  591. package/schematics/ng-update/update-9.0.0/secondary-entry-points-migration.js +1 -2
  592. package/schematics/ng-update/update-9.0.0/secondary-entry-points-migration.js.map +1 -1
  593. package/schematics/ng-update/upgrade-data.js +2 -1
  594. package/schematics/ng-update/upgrade-data.js.map +1 -1
  595. package/schematics/tsconfig.lib.json +2 -2
  596. package/select/README.md +0 -0
  597. package/select/package.json +5 -5
  598. package/sidebar/package.json +5 -5
  599. package/sidepanel/package.json +5 -5
  600. package/splitter/package.json +5 -5
  601. package/table/README.md +0 -0
  602. package/table/package.json +5 -5
  603. package/tabs/README.md +0 -0
  604. package/tabs/package.json +5 -5
  605. package/tags/README.md +0 -0
  606. package/tags/package.json +5 -5
  607. package/textarea/README.md +0 -0
  608. package/textarea/package.json +5 -5
  609. package/timepicker/README.md +0 -0
  610. package/timepicker/package.json +5 -5
  611. package/toggle/package.json +5 -5
  612. package/tooltip/package.json +5 -5
  613. package/tree/data-source/flat-data-source.d.ts +2 -2
  614. package/tree/package.json +5 -5
  615. package/tree/tree-option.component.d.ts +5 -3
  616. package/tree/tree-selection.component.d.ts +1 -0
  617. package/tree-select/README.md +0 -0
  618. package/tree-select/package.json +5 -5
  619. package/tree-select/tree-select.component.d.ts +9 -1
  620. package/tree-select/tree-select.module.d.ts +2 -1
  621. package/bundles/ptsecurity-mosaic-autocomplete.umd.js +0 -1160
  622. package/bundles/ptsecurity-mosaic-autocomplete.umd.js.map +0 -1
  623. package/bundles/ptsecurity-mosaic-button-toggle.umd.js +0 -755
  624. package/bundles/ptsecurity-mosaic-button-toggle.umd.js.map +0 -1
  625. package/bundles/ptsecurity-mosaic-button.umd.js +0 -533
  626. package/bundles/ptsecurity-mosaic-button.umd.js.map +0 -1
  627. package/bundles/ptsecurity-mosaic-card.umd.js +0 -479
  628. package/bundles/ptsecurity-mosaic-card.umd.js.map +0 -1
  629. package/bundles/ptsecurity-mosaic-checkbox.umd.js +0 -762
  630. package/bundles/ptsecurity-mosaic-checkbox.umd.js.map +0 -1
  631. package/bundles/ptsecurity-mosaic-core.umd.js +0 -2841
  632. package/bundles/ptsecurity-mosaic-core.umd.js.map +0 -1
  633. package/bundles/ptsecurity-mosaic-datepicker.umd.js +0 -3362
  634. package/bundles/ptsecurity-mosaic-datepicker.umd.js.map +0 -1
  635. package/bundles/ptsecurity-mosaic-design-tokens.umd.js +0 -1871
  636. package/bundles/ptsecurity-mosaic-design-tokens.umd.js.map +0 -1
  637. package/bundles/ptsecurity-mosaic-divider.umd.js +0 -106
  638. package/bundles/ptsecurity-mosaic-divider.umd.js.map +0 -1
  639. package/bundles/ptsecurity-mosaic-dropdown.umd.js +0 -1532
  640. package/bundles/ptsecurity-mosaic-dropdown.umd.js.map +0 -1
  641. package/bundles/ptsecurity-mosaic-form-field.umd.js +0 -788
  642. package/bundles/ptsecurity-mosaic-form-field.umd.js.map +0 -1
  643. package/bundles/ptsecurity-mosaic-icon.umd.js +0 -450
  644. package/bundles/ptsecurity-mosaic-icon.umd.js.map +0 -1
  645. package/bundles/ptsecurity-mosaic-input.umd.js +0 -1008
  646. package/bundles/ptsecurity-mosaic-input.umd.js.map +0 -1
  647. package/bundles/ptsecurity-mosaic-link.umd.js +0 -515
  648. package/bundles/ptsecurity-mosaic-link.umd.js.map +0 -1
  649. package/bundles/ptsecurity-mosaic-list.umd.js +0 -1251
  650. package/bundles/ptsecurity-mosaic-list.umd.js.map +0 -1
  651. package/bundles/ptsecurity-mosaic-modal.umd.js +0 -1312
  652. package/bundles/ptsecurity-mosaic-modal.umd.js.map +0 -1
  653. package/bundles/ptsecurity-mosaic-navbar.umd.js +0 -930
  654. package/bundles/ptsecurity-mosaic-navbar.umd.js.map +0 -1
  655. package/bundles/ptsecurity-mosaic-popover.umd.js +0 -836
  656. package/bundles/ptsecurity-mosaic-popover.umd.js.map +0 -1
  657. package/bundles/ptsecurity-mosaic-progress-bar.umd.js +0 -440
  658. package/bundles/ptsecurity-mosaic-progress-bar.umd.js.map +0 -1
  659. package/bundles/ptsecurity-mosaic-progress-spinner.umd.js +0 -448
  660. package/bundles/ptsecurity-mosaic-progress-spinner.umd.js.map +0 -1
  661. package/bundles/ptsecurity-mosaic-radio.umd.js +0 -901
  662. package/bundles/ptsecurity-mosaic-radio.umd.js.map +0 -1
  663. package/bundles/ptsecurity-mosaic-select.umd.js +0 -1606
  664. package/bundles/ptsecurity-mosaic-select.umd.js.map +0 -1
  665. package/bundles/ptsecurity-mosaic-sidebar.umd.js +0 -254
  666. package/bundles/ptsecurity-mosaic-sidebar.umd.js.map +0 -1
  667. package/bundles/ptsecurity-mosaic-sidepanel.umd.js +0 -954
  668. package/bundles/ptsecurity-mosaic-sidepanel.umd.js.map +0 -1
  669. package/bundles/ptsecurity-mosaic-splitter.umd.js +0 -635
  670. package/bundles/ptsecurity-mosaic-splitter.umd.js.map +0 -1
  671. package/bundles/ptsecurity-mosaic-table.umd.js +0 -81
  672. package/bundles/ptsecurity-mosaic-table.umd.js.map +0 -1
  673. package/bundles/ptsecurity-mosaic-tabs.umd.js +0 -2013
  674. package/bundles/ptsecurity-mosaic-tabs.umd.js.map +0 -1
  675. package/bundles/ptsecurity-mosaic-tags.umd.js +0 -1917
  676. package/bundles/ptsecurity-mosaic-tags.umd.js.map +0 -1
  677. package/bundles/ptsecurity-mosaic-textarea.umd.js +0 -664
  678. package/bundles/ptsecurity-mosaic-textarea.umd.js.map +0 -1
  679. package/bundles/ptsecurity-mosaic-timepicker.umd.js +0 -821
  680. package/bundles/ptsecurity-mosaic-timepicker.umd.js.map +0 -1
  681. package/bundles/ptsecurity-mosaic-toggle.umd.js +0 -557
  682. package/bundles/ptsecurity-mosaic-toggle.umd.js.map +0 -1
  683. package/bundles/ptsecurity-mosaic-tooltip.umd.js +0 -777
  684. package/bundles/ptsecurity-mosaic-tooltip.umd.js.map +0 -1
  685. package/bundles/ptsecurity-mosaic-tree-select.umd.js +0 -1369
  686. package/bundles/ptsecurity-mosaic-tree-select.umd.js.map +0 -1
  687. package/bundles/ptsecurity-mosaic-tree.umd.js +0 -2301
  688. package/bundles/ptsecurity-mosaic-tree.umd.js.map +0 -1
  689. package/bundles/ptsecurity-mosaic.umd.js +0 -11
  690. package/bundles/ptsecurity-mosaic.umd.js.map +0 -1
  691. package/design-tokens/tokens/components/checkbox.json5 +0 -39
  692. package/design-tokens/tokens/components/modal.json5 +0 -67
  693. package/design-tokens/tokens/components/navbar.json5 +0 -64
  694. package/design-tokens/tokens/components/radio.json5 +0 -45
  695. package/design-tokens/tokens/components/tags.json5 +0 -126
  696. package/design-tokens/tokens/components/toggle.json5 +0 -55
  697. package/design-tokens/tokens.d.ts +0 -7636
  698. package/esm2015/autocomplete/autocomplete-origin.directive.js +0 -21
  699. package/esm2015/autocomplete/autocomplete-trigger.directive.js +0 -555
  700. package/esm2015/autocomplete/autocomplete.component.js +0 -163
  701. package/esm2015/autocomplete/autocomplete.module.js +0 -34
  702. package/esm2015/button/button.component.js +0 -129
  703. package/esm2015/button/button.module.js +0 -42
  704. package/esm2015/button-toggle/button-toggle.component.js +0 -370
  705. package/esm2015/button-toggle/button-toggle.module.js +0 -19
  706. package/esm2015/card/card.component.js +0 -88
  707. package/esm2015/card/card.module.js +0 -30
  708. package/esm2015/checkbox/checkbox-module.js +0 -19
  709. package/esm2015/checkbox/checkbox-required-validator.js +0 -27
  710. package/esm2015/checkbox/checkbox.js +0 -325
  711. package/esm2015/core/common-behaviors/common-module.js +0 -83
  712. package/esm2015/core/error/error-options.js +0 -26
  713. package/esm2015/core/formatters/date/formatter.js +0 -288
  714. package/esm2015/core/formatters/date/templates/en-US.js +0 -280
  715. package/esm2015/core/formatters/date/templates/ru-RU.js +0 -280
  716. package/esm2015/core/formatters/index.js +0 -20
  717. package/esm2015/core/formatters/number/formatter.js +0 -99
  718. package/esm2015/core/forms/forms-module.js +0 -24
  719. package/esm2015/core/forms/forms.directive.js +0 -66
  720. package/esm2015/core/highlight/highlight.pipe.js +0 -17
  721. package/esm2015/core/highlight/index.js +0 -19
  722. package/esm2015/core/line/line.js +0 -70
  723. package/esm2015/core/option/action.js +0 -131
  724. package/esm2015/core/option/optgroup.js +0 -40
  725. package/esm2015/core/option/option-module.js +0 -21
  726. package/esm2015/core/option/option.js +0 -262
  727. package/esm2015/core/pop-up/pop-up-trigger.js +0 -239
  728. package/esm2015/core/pop-up/pop-up.js +0 -87
  729. package/esm2015/core/public-api.js +0 -17
  730. package/esm2015/core/selection/pseudo-checkbox/pseudo-checkbox.js +0 -45
  731. package/esm2015/core/selection/pseudo-checkbox/pseudo-checkbox.module.js +0 -18
  732. package/esm2015/core/services/measure-scrollbar.service.js +0 -48
  733. package/esm2015/datepicker/calendar-body.component.js +0 -114
  734. package/esm2015/datepicker/calendar.component.js +0 -377
  735. package/esm2015/datepicker/datepicker-input.directive.js +0 -892
  736. package/esm2015/datepicker/datepicker-intl.js +0 -40
  737. package/esm2015/datepicker/datepicker-module.js +0 -107
  738. package/esm2015/datepicker/datepicker-toggle.component.js +0 -94
  739. package/esm2015/datepicker/datepicker.component.js +0 -418
  740. package/esm2015/datepicker/month-view.component.js +0 -263
  741. package/esm2015/datepicker/multi-year-view.component.js +0 -224
  742. package/esm2015/datepicker/year-view.component.js +0 -259
  743. package/esm2015/design-tokens/public-api.js +0 -2
  744. package/esm2015/design-tokens/tokens.js +0 -930
  745. package/esm2015/divider/divider.component.js +0 -46
  746. package/esm2015/divider/divider.module.js +0 -18
  747. package/esm2015/dropdown/dropdown-content.directive.js +0 -66
  748. package/esm2015/dropdown/dropdown-item.component.js +0 -149
  749. package/esm2015/dropdown/dropdown-trigger.directive.js +0 -486
  750. package/esm2015/dropdown/dropdown.component.js +0 -302
  751. package/esm2015/dropdown/dropdown.module.js +0 -50
  752. package/esm2015/form-field/cleaner.js +0 -23
  753. package/esm2015/form-field/form-field.js +0 -224
  754. package/esm2015/form-field/form-field.module.js +0 -52
  755. package/esm2015/form-field/hint.js +0 -23
  756. package/esm2015/form-field/prefix.js +0 -13
  757. package/esm2015/form-field/stepper.js +0 -55
  758. package/esm2015/form-field/suffix.js +0 -13
  759. package/esm2015/icon/icon.component.js +0 -51
  760. package/esm2015/icon/icon.module.js +0 -38
  761. package/esm2015/input/input-number-validators.js +0 -92
  762. package/esm2015/input/input-number.js +0 -163
  763. package/esm2015/input/input.js +0 -333
  764. package/esm2015/input/input.module.js +0 -23
  765. package/esm2015/link/link.component.js +0 -108
  766. package/esm2015/link/link.module.js +0 -26
  767. package/esm2015/list/list-selection.component.js +0 -711
  768. package/esm2015/list/list.component.js +0 -58
  769. package/esm2015/list/list.module.js +0 -55
  770. package/esm2015/modal/css-unit.pipe.js +0 -17
  771. package/esm2015/modal/modal-control.service.js +0 -63
  772. package/esm2015/modal/modal.component.js +0 -508
  773. package/esm2015/modal/modal.directive.js +0 -52
  774. package/esm2015/modal/modal.module.js +0 -72
  775. package/esm2015/modal/modal.service.js +0 -124
  776. package/esm2015/navbar/navbar-item.component.js +0 -209
  777. package/esm2015/navbar/navbar.component.js +0 -118
  778. package/esm2015/navbar/navbar.module.js +0 -76
  779. package/esm2015/navbar/vertical-navbar.animation.js +0 -10
  780. package/esm2015/navbar/vertical-navbar.component.js +0 -140
  781. package/esm2015/popover/popover-confirm.component.js +0 -116
  782. package/esm2015/popover/popover.component.js +0 -262
  783. package/esm2015/popover/popover.module.js +0 -24
  784. package/esm2015/progress-bar/progress-bar.component.js +0 -50
  785. package/esm2015/progress-bar/progress-bar.module.js +0 -30
  786. package/esm2015/progress-spinner/progress-spinner.component.js +0 -54
  787. package/esm2015/progress-spinner/progress-spinner.module.js +0 -30
  788. package/esm2015/radio/radio.component.js +0 -467
  789. package/esm2015/radio/radio.module.js +0 -20
  790. package/esm2015/select/select.component.js +0 -1122
  791. package/esm2015/select/select.module.js +0 -64
  792. package/esm2015/sidebar/sidebar.component.js +0 -155
  793. package/esm2015/sidebar/sidebar.module.js +0 -30
  794. package/esm2015/sidepanel/sidepanel-container.component.js +0 -114
  795. package/esm2015/sidepanel/sidepanel-directives.js +0 -159
  796. package/esm2015/sidepanel/sidepanel.module.js +0 -74
  797. package/esm2015/sidepanel/sidepanel.service.js +0 -164
  798. package/esm2015/splitter/splitter.component.js +0 -489
  799. package/esm2015/splitter/splitter.module.js +0 -40
  800. package/esm2015/table/table.component.js +0 -16
  801. package/esm2015/table/table.module.js +0 -30
  802. package/esm2015/tabs/paginated-tab-header.js +0 -482
  803. package/esm2015/tabs/tab-body.component.js +0 -186
  804. package/esm2015/tabs/tab-content.directive.js +0 -15
  805. package/esm2015/tabs/tab-group.component.js +0 -359
  806. package/esm2015/tabs/tab-header.component.js +0 -76
  807. package/esm2015/tabs/tab-label-wrapper.directive.js +0 -78
  808. package/esm2015/tabs/tab-label.directive.js +0 -17
  809. package/esm2015/tabs/tab-nav-bar/tab-nav-bar.js +0 -118
  810. package/esm2015/tabs/tab.component.js +0 -133
  811. package/esm2015/tabs/tabs.module.js +0 -104
  812. package/esm2015/tags/tag-input.js +0 -229
  813. package/esm2015/tags/tag-list.component.js +0 -732
  814. package/esm2015/tags/tag.component.js +0 -386
  815. package/esm2015/tags/tag.module.js +0 -56
  816. package/esm2015/textarea/textarea.component.js +0 -268
  817. package/esm2015/textarea/textarea.module.js +0 -21
  818. package/esm2015/timepicker/timepicker.directive.js +0 -653
  819. package/esm2015/timepicker/timepicker.module.js +0 -34
  820. package/esm2015/toggle/toggle.component.js +0 -169
  821. package/esm2015/toggle/toggle.module.js +0 -20
  822. package/esm2015/tooltip/tooltip.component.js +0 -299
  823. package/esm2015/tooltip/tooltip.module.js +0 -43
  824. package/esm2015/tree/data-source/flat-data-source.js +0 -162
  825. package/esm2015/tree/node.js +0 -31
  826. package/esm2015/tree/outlet.js +0 -15
  827. package/esm2015/tree/padding.directive.js +0 -111
  828. package/esm2015/tree/toggle.js +0 -89
  829. package/esm2015/tree/tree-base.js +0 -243
  830. package/esm2015/tree/tree-option.component.js +0 -238
  831. package/esm2015/tree/tree-selection.component.js +0 -541
  832. package/esm2015/tree/tree.js +0 -23
  833. package/esm2015/tree/tree.module.js +0 -53
  834. package/esm2015/tree-select/tree-select.component.js +0 -901
  835. package/esm2015/tree-select/tree-select.module.js +0 -43
  836. package/fesm2015/ptsecurity-mosaic-autocomplete.js +0 -761
  837. package/fesm2015/ptsecurity-mosaic-autocomplete.js.map +0 -1
  838. package/fesm2015/ptsecurity-mosaic-button-toggle.js +0 -391
  839. package/fesm2015/ptsecurity-mosaic-button-toggle.js.map +0 -1
  840. package/fesm2015/ptsecurity-mosaic-button.js +0 -174
  841. package/fesm2015/ptsecurity-mosaic-button.js.map +0 -1
  842. package/fesm2015/ptsecurity-mosaic-card.js +0 -121
  843. package/fesm2015/ptsecurity-mosaic-card.js.map +0 -1
  844. package/fesm2015/ptsecurity-mosaic-checkbox.js +0 -374
  845. package/fesm2015/ptsecurity-mosaic-checkbox.js.map +0 -1
  846. package/fesm2015/ptsecurity-mosaic-core.js +0 -2680
  847. package/fesm2015/ptsecurity-mosaic-core.js.map +0 -1
  848. package/fesm2015/ptsecurity-mosaic-datepicker.js +0 -2738
  849. package/fesm2015/ptsecurity-mosaic-datepicker.js.map +0 -1
  850. package/fesm2015/ptsecurity-mosaic-design-tokens.js +0 -936
  851. package/fesm2015/ptsecurity-mosaic-design-tokens.js.map +0 -1
  852. package/fesm2015/ptsecurity-mosaic-divider.js +0 -68
  853. package/fesm2015/ptsecurity-mosaic-divider.js.map +0 -1
  854. package/fesm2015/ptsecurity-mosaic-dropdown.js +0 -1116
  855. package/fesm2015/ptsecurity-mosaic-dropdown.js.map +0 -1
  856. package/fesm2015/ptsecurity-mosaic-form-field.js +0 -396
  857. package/fesm2015/ptsecurity-mosaic-form-field.js.map +0 -1
  858. package/fesm2015/ptsecurity-mosaic-icon.js +0 -93
  859. package/fesm2015/ptsecurity-mosaic-icon.js.map +0 -1
  860. package/fesm2015/ptsecurity-mosaic-input.js +0 -605
  861. package/fesm2015/ptsecurity-mosaic-input.js.map +0 -1
  862. package/fesm2015/ptsecurity-mosaic-link.js +0 -137
  863. package/fesm2015/ptsecurity-mosaic-link.js.map +0 -1
  864. package/fesm2015/ptsecurity-mosaic-list.js +0 -822
  865. package/fesm2015/ptsecurity-mosaic-list.js.map +0 -1
  866. package/fesm2015/ptsecurity-mosaic-modal.js +0 -845
  867. package/fesm2015/ptsecurity-mosaic-modal.js.map +0 -1
  868. package/fesm2015/ptsecurity-mosaic-navbar.js +0 -539
  869. package/fesm2015/ptsecurity-mosaic-navbar.js.map +0 -1
  870. package/fesm2015/ptsecurity-mosaic-popover.js +0 -406
  871. package/fesm2015/ptsecurity-mosaic-popover.js.map +0 -1
  872. package/fesm2015/ptsecurity-mosaic-progress-bar.js +0 -84
  873. package/fesm2015/ptsecurity-mosaic-progress-bar.js.map +0 -1
  874. package/fesm2015/ptsecurity-mosaic-progress-spinner.js +0 -88
  875. package/fesm2015/ptsecurity-mosaic-progress-spinner.js.map +0 -1
  876. package/fesm2015/ptsecurity-mosaic-radio.js +0 -488
  877. package/fesm2015/ptsecurity-mosaic-radio.js.map +0 -1
  878. package/fesm2015/ptsecurity-mosaic-select.js +0 -1185
  879. package/fesm2015/ptsecurity-mosaic-select.js.map +0 -1
  880. package/fesm2015/ptsecurity-mosaic-sidebar.js +0 -211
  881. package/fesm2015/ptsecurity-mosaic-sidebar.js.map +0 -1
  882. package/fesm2015/ptsecurity-mosaic-sidepanel.js +0 -594
  883. package/fesm2015/ptsecurity-mosaic-sidepanel.js.map +0 -1
  884. package/fesm2015/ptsecurity-mosaic-splitter.js +0 -533
  885. package/fesm2015/ptsecurity-mosaic-splitter.js.map +0 -1
  886. package/fesm2015/ptsecurity-mosaic-table.js +0 -50
  887. package/fesm2015/ptsecurity-mosaic-table.js.map +0 -1
  888. package/fesm2015/ptsecurity-mosaic-tabs.js +0 -1533
  889. package/fesm2015/ptsecurity-mosaic-tabs.js.map +0 -1
  890. package/fesm2015/ptsecurity-mosaic-tags.js +0 -1389
  891. package/fesm2015/ptsecurity-mosaic-tags.js.map +0 -1
  892. package/fesm2015/ptsecurity-mosaic-textarea.js +0 -291
  893. package/fesm2015/ptsecurity-mosaic-textarea.js.map +0 -1
  894. package/fesm2015/ptsecurity-mosaic-timepicker.js +0 -713
  895. package/fesm2015/ptsecurity-mosaic-timepicker.js.map +0 -1
  896. package/fesm2015/ptsecurity-mosaic-toggle.js +0 -191
  897. package/fesm2015/ptsecurity-mosaic-toggle.js.map +0 -1
  898. package/fesm2015/ptsecurity-mosaic-tooltip.js +0 -362
  899. package/fesm2015/ptsecurity-mosaic-tooltip.js.map +0 -1
  900. package/fesm2015/ptsecurity-mosaic-tree-select.js +0 -943
  901. package/fesm2015/ptsecurity-mosaic-tree-select.js.map +0 -1
  902. package/fesm2015/ptsecurity-mosaic-tree.js +0 -1735
  903. package/fesm2015/ptsecurity-mosaic-tree.js.map +0 -1
  904. package/fesm2015/ptsecurity-mosaic.js +0 -4
  905. package/fesm2015/ptsecurity-mosaic.js.map +0 -1
@@ -1,3362 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/a11y'), require('@angular/cdk/overlay'), require('@angular/cdk/portal'), require('@angular/common'), require('@angular/core'), require('@ptsecurity/mosaic/button'), require('@ptsecurity/mosaic/icon'), require('rxjs/operators'), require('@ptsecurity/cdk/datetime'), require('rxjs'), require('@ptsecurity/cdk/keycodes'), require('@angular/cdk/bidi'), require('@angular/cdk/coercion'), require('@angular/forms'), require('@ptsecurity/mosaic/core'), require('@ptsecurity/mosaic/form-field'), require('@angular/animations')) :
3
- typeof define === 'function' && define.amd ? define('@ptsecurity/mosaic/datepicker', ['exports', '@angular/cdk/a11y', '@angular/cdk/overlay', '@angular/cdk/portal', '@angular/common', '@angular/core', '@ptsecurity/mosaic/button', '@ptsecurity/mosaic/icon', 'rxjs/operators', '@ptsecurity/cdk/datetime', 'rxjs', '@ptsecurity/cdk/keycodes', '@angular/cdk/bidi', '@angular/cdk/coercion', '@angular/forms', '@ptsecurity/mosaic/core', '@ptsecurity/mosaic/form-field', '@angular/animations'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.ptsecurity = global.ptsecurity || {}, global.ptsecurity.mosaic = global.ptsecurity.mosaic || {}, global.ptsecurity.mosaic.datepicker = {}), global.ng.cdk.a11y, global.ng.cdk.overlay, global.ng.cdk.portal, global.ng.common, global.ng.core, global.ptsecurity.mosaic.button, global.ptsecurity.mosaic.icon, global.rxjs.operators, global.mc.cdk.datetime, global.rxjs, global.mc.cdk.keycodes, global.ng.cdk.bidi, global.ng.cdk.coercion, global.ng.forms, global.ptsecurity.mosaic.core, global.ptsecurity.mosaic["form-field"], global.ng.animations));
5
- })(this, (function (exports, a11y, i3$1, i8, i1, i0, i3, i4, operators, i1$1, rxjs, keycodes, i2, coercion, forms, core, formField, animations) { 'use strict';
6
-
7
- function _interopNamespace(e) {
8
- if (e && e.__esModule) return e;
9
- var n = Object.create(null);
10
- if (e) {
11
- Object.keys(e).forEach(function (k) {
12
- if (k !== 'default') {
13
- var d = Object.getOwnPropertyDescriptor(e, k);
14
- Object.defineProperty(n, k, d.get ? d : {
15
- enumerable: true,
16
- get: function () { return e[k]; }
17
- });
18
- }
19
- });
20
- }
21
- n["default"] = e;
22
- return Object.freeze(n);
23
- }
24
-
25
- var i3__namespace$1 = /*#__PURE__*/_interopNamespace(i3$1);
26
- var i8__namespace = /*#__PURE__*/_interopNamespace(i8);
27
- var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
28
- var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
29
- var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
30
- var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
31
- var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
32
- var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
33
-
34
- // tslint:disable:no-magic-numbers
35
- /**
36
- * An internal class that represents the data corresponding to a single calendar cell.
37
- * @docs-private
38
- */
39
- var McCalendarCell = /** @class */ (function () {
40
- function McCalendarCell(value, displayValue, ariaLabel, enabled, cssClasses) {
41
- this.value = value;
42
- this.displayValue = displayValue;
43
- this.ariaLabel = ariaLabel;
44
- this.enabled = enabled;
45
- this.cssClasses = cssClasses;
46
- }
47
- return McCalendarCell;
48
- }());
49
- /**
50
- * An internal component used to display calendar data in a table.
51
- * @docs-private
52
- */
53
- var McCalendarBody = /** @class */ (function () {
54
- function McCalendarBody(elementRef, ngZone) {
55
- this.elementRef = elementRef;
56
- this.ngZone = ngZone;
57
- /** The number of columns in the table. */
58
- this.numCols = 7;
59
- /** The cell number of the active cell in the table. */
60
- this.activeCell = 0;
61
- /**
62
- * The aspect ratio (width / height) to use for the cells in the table. This aspect ratio will be
63
- * maintained even as the table resizes.
64
- */
65
- this.cellAspectRatio = 1;
66
- /** Emits when a new value is selected. */
67
- this.selectedValueChange = new i0.EventEmitter();
68
- }
69
- McCalendarBody.prototype.cellClicked = function (cell) {
70
- if (cell.enabled) {
71
- this.selectedValueChange.emit(cell.value);
72
- }
73
- };
74
- McCalendarBody.prototype.ngOnChanges = function (changes) {
75
- var columnChanges = changes.numCols;
76
- // tslint:disable-next-line:no-this-assignment
77
- var _a = this, rows = _a.rows, numCols = _a.numCols;
78
- if (changes.rows || columnChanges) {
79
- this.firstRowOffset = rows && rows.length && rows[0].length ? numCols - rows[0].length : 0;
80
- }
81
- if (changes.cellAspectRatio || columnChanges || !this.cellPadding) {
82
- this.cellPadding = this.cellAspectRatio * 50 / numCols + "%";
83
- }
84
- if (columnChanges || !this.cellWidth) {
85
- this.cellWidth = 100 / numCols + "%";
86
- }
87
- };
88
- McCalendarBody.prototype.isActiveCell = function (rowIndex, colIndex) {
89
- var cellNumber = rowIndex * this.numCols + colIndex;
90
- // Account for the fact that the first row may not have as many cells.
91
- if (rowIndex) {
92
- cellNumber -= this.firstRowOffset;
93
- }
94
- return cellNumber === this.activeCell;
95
- };
96
- /** Focuses the active cell after the microtask queue is empty. */
97
- McCalendarBody.prototype.focusActiveCell = function () {
98
- var _this = this;
99
- this.ngZone.runOutsideAngular(function () {
100
- _this.ngZone.onStable.asObservable().pipe(operators.take(1)).subscribe(function () {
101
- var activeCell = _this.elementRef.nativeElement.querySelector('.mc-calendar__body_active');
102
- if (activeCell) {
103
- activeCell.focus();
104
- }
105
- });
106
- });
107
- };
108
- return McCalendarBody;
109
- }());
110
- /** @nocollapse */ McCalendarBody.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McCalendarBody, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Component });
111
- /** @nocollapse */ McCalendarBody.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: McCalendarBody, selector: "[mc-calendar-body]", inputs: { label: "label", rows: "rows", todayValue: "todayValue", selectedValue: "selectedValue", labelMinRequiredCells: "labelMinRequiredCells", numCols: "numCols", activeCell: "activeCell", cellAspectRatio: "cellAspectRatio" }, outputs: { selectedValueChange: "selectedValueChange" }, host: { attributes: { "role": "grid", "aria-readonly": "true" }, classAttribute: "mc-calendar__body" }, exportAs: ["mcCalendarBody"], usesOnChanges: true, ngImport: i0__namespace, template: "<!--\n If there's not enough space in the first row, create a separate label row. We mark this row as\n aria-hidden because we don't want it to be read out as one of the weeks in the month.\n-->\n<tr *ngIf=\"firstRowOffset < labelMinRequiredCells\">\n <td class=\"mc-calendar__body-label\" [attr.colspan]=\"numCols\">\n {{ label }}\n </td>\n</tr>\n\n<!-- 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 {{ firstRowOffset >= labelMinRequiredCells ? label : '' }}\n </td>\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 * 32px);min-width:calc(7 * var(--mc-datepicker-body-size-cell-min-size, 32px))}.mc-calendar__body-label{text-align:left;padding:8px 28px 12px 12px;padding:var(--mc-datepicker-body-size-label-paddings, 8px 28px 12px 12px)}.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:5%;top:var(--mc-datepicker-body-size-cell-margin, 5%);left:5%;left:var(--mc-datepicker-body-size-cell-margin, 5%);padding:8px;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:1px;border-width:var(--mc-datepicker-body-size-cell-border-width, 1px);border-style:solid}.cdk-high-contrast-active .mc-calendar__body-cell-content{border:none}.cdk-high-contrast-active :host .mc-calendar__body-cell-content{border:none}mc-month-view .mc-calendar__body-cell-content{justify-content:flex-end}mc-multi-year-view .mc-calendar__body-cell-content,mc-year-view .mc-calendar__body-cell-content{justify-content:center}.cdk-high-contrast-active .mc-datepicker__popup:not(:empty),.cdk-high-contrast-active .mc-selected{outline:solid 1px}.cdk-high-contrast-active .mc-calendar__body-today{outline:dotted 1px}.cdk-high-contrast-active :host .mc-datepicker__popup:not(:empty),.cdk-high-contrast-active :host .mc-selected{outline:solid 1px}.cdk-high-contrast-active :host .mc-calendar__body-today{outline:dotted 1px}[dir=rtl] .mc-calendar__body-label{text-align:right}\n"], directives: [{ type: i1__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
112
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McCalendarBody, decorators: [{
113
- type: i0.Component,
114
- args: [{
115
- selector: '[mc-calendar-body]',
116
- exportAs: 'mcCalendarBody',
117
- templateUrl: 'calendar-body.html',
118
- styleUrls: ['calendar-body.scss'],
119
- host: {
120
- class: 'mc-calendar__body',
121
- role: 'grid',
122
- 'aria-readonly': 'true'
123
- },
124
- encapsulation: i0.ViewEncapsulation.None,
125
- changeDetection: i0.ChangeDetectionStrategy.OnPush
126
- }]
127
- }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.NgZone }]; }, propDecorators: { label: [{
128
- type: i0.Input
129
- }], rows: [{
130
- type: i0.Input
131
- }], todayValue: [{
132
- type: i0.Input
133
- }], selectedValue: [{
134
- type: i0.Input
135
- }], labelMinRequiredCells: [{
136
- type: i0.Input
137
- }], numCols: [{
138
- type: i0.Input
139
- }], activeCell: [{
140
- type: i0.Input
141
- }], cellAspectRatio: [{
142
- type: i0.Input
143
- }], selectedValueChange: [{
144
- type: i0.Output
145
- }] } });
146
-
147
- /** @docs-private */
148
- function createMissingDateImplError(provider) {
149
- return Error("McDatepicker: No provider found for " + provider + ". You must import one of the existing " +
150
- "modules at your application root or provide a custom implementation or use exists ones.");
151
- }
152
-
153
- var DAYS_PER_WEEK = 7;
154
- /**
155
- * An internal component used to display a single month in the datepicker.
156
- * @docs-private
157
- */
158
- var McMonthView = /** @class */ (function () {
159
- function McMonthView(changeDetectorRef, dateFormats, dateAdapter, dir) {
160
- this.changeDetectorRef = changeDetectorRef;
161
- this.dateFormats = dateFormats;
162
- this.dateAdapter = dateAdapter;
163
- this.dir = dir;
164
- /** Emits when a new date is selected. */
165
- this.selectedChange = new i0.EventEmitter();
166
- /** Emits when any date is selected. */
167
- this.userSelection = new i0.EventEmitter();
168
- /** Emits when any date is activated. */
169
- this.activeDateChange = new i0.EventEmitter();
170
- if (!this.dateAdapter) {
171
- throw createMissingDateImplError('DateAdapter');
172
- }
173
- if (!this.dateFormats) {
174
- throw createMissingDateImplError('MC_DATE_FORMATS');
175
- }
176
- var firstDayOfWeek = this.dateAdapter.getFirstDayOfWeek();
177
- var narrowWeekdays = this.dateAdapter.getDayOfWeekNames('short');
178
- var longWeekdays = this.dateAdapter.getDayOfWeekNames('long');
179
- // Rotate the labels for days of the week based on the configured first day of the week.
180
- var weekdays = longWeekdays.map(function (long, i) {
181
- return { long: long, narrow: narrowWeekdays[i] };
182
- });
183
- this.weekdays = weekdays
184
- .slice(firstDayOfWeek)
185
- .concat(weekdays.slice(0, firstDayOfWeek));
186
- this._activeDate = this.dateAdapter.today();
187
- }
188
- Object.defineProperty(McMonthView.prototype, "activeDate", {
189
- /**
190
- * The date to display in this month view (everything other than the month and year is ignored).
191
- */
192
- get: function () {
193
- return this._activeDate;
194
- },
195
- set: function (value) {
196
- var oldActiveDate = this._activeDate;
197
- var validDate = this.getValidDateOrNull(this.dateAdapter.deserialize(value)) || this.dateAdapter.today();
198
- this._activeDate = this.dateAdapter.clampDate(validDate, this.minDate, this.maxDate);
199
- if (!this.hasSameMonthAndYear(oldActiveDate, this._activeDate)) {
200
- this.init();
201
- }
202
- },
203
- enumerable: false,
204
- configurable: true
205
- });
206
- Object.defineProperty(McMonthView.prototype, "selected", {
207
- /** The currently selected date. */
208
- get: function () {
209
- return this._selected;
210
- },
211
- set: function (value) {
212
- this._selected = this.getValidDateOrNull(this.dateAdapter.deserialize(value));
213
- this.selectedDate = this.getDateInCurrentMonth(this._selected);
214
- },
215
- enumerable: false,
216
- configurable: true
217
- });
218
- Object.defineProperty(McMonthView.prototype, "minDate", {
219
- /** The minimum selectable date. */
220
- get: function () {
221
- return this._minDate;
222
- },
223
- set: function (value) {
224
- this._minDate = this.getValidDateOrNull(this.dateAdapter.deserialize(value));
225
- },
226
- enumerable: false,
227
- configurable: true
228
- });
229
- Object.defineProperty(McMonthView.prototype, "maxDate", {
230
- /** The maximum selectable date. */
231
- get: function () {
232
- return this._maxDate;
233
- },
234
- set: function (value) {
235
- this._maxDate = this.getValidDateOrNull(this.dateAdapter.deserialize(value));
236
- },
237
- enumerable: false,
238
- configurable: true
239
- });
240
- McMonthView.prototype.ngAfterContentInit = function () {
241
- this.init();
242
- };
243
- /** Handles when a new date is selected. */
244
- McMonthView.prototype.dateSelected = function (date) {
245
- if (this.selectedDate !== date) {
246
- var selectedYear = this.dateAdapter.getYear(this.activeDate);
247
- var selectedMonth = this.dateAdapter.getMonth(this.activeDate);
248
- var selectedDate = this.dateAdapter.createDate(selectedYear, selectedMonth, date);
249
- this.selectedChange.emit(selectedDate);
250
- }
251
- this.userSelection.emit();
252
- };
253
- /** Handles keydown events on the calendar body when calendar is in month view. */
254
- McMonthView.prototype.handleCalendarBodyKeydown = function (event) {
255
- // TODO(mmalerba): We currently allow keyboard navigation to disabled dates, but just prevent
256
- // disabled ones from being selected. This may not be ideal, we should look into whether
257
- // navigation should skip over disabled dates, and if so, how to implement that efficiently.
258
- var oldActiveDate = this._activeDate;
259
- var isRtl = this.isRtl();
260
- // tslint:disable-next-line:deprecation
261
- switch (event.keyCode) {
262
- case keycodes.LEFT_ARROW:
263
- this.activeDate = this.dateAdapter.addCalendarDays(this._activeDate, isRtl ? 1 : -1);
264
- break;
265
- case keycodes.RIGHT_ARROW:
266
- this.activeDate = this.dateAdapter.addCalendarDays(this._activeDate, isRtl ? -1 : 1);
267
- break;
268
- case keycodes.UP_ARROW:
269
- this.activeDate = this.dateAdapter.addCalendarDays(this._activeDate, -7);
270
- break;
271
- case keycodes.DOWN_ARROW:
272
- this.activeDate = this.dateAdapter.addCalendarDays(this._activeDate, 7);
273
- break;
274
- case keycodes.HOME:
275
- this.activeDate = this.dateAdapter.addCalendarDays(this._activeDate, 1 - this.dateAdapter.getDate(this._activeDate));
276
- break;
277
- case keycodes.END:
278
- this.activeDate = this.dateAdapter.addCalendarDays(this._activeDate, (this.dateAdapter.getNumDaysInMonth(this._activeDate) - this.dateAdapter.getDate(this._activeDate)));
279
- break;
280
- case keycodes.PAGE_UP:
281
- this.activeDate = event.altKey ?
282
- this.dateAdapter.addCalendarYears(this._activeDate, -1) :
283
- this.dateAdapter.addCalendarMonths(this._activeDate, -1);
284
- break;
285
- case keycodes.PAGE_DOWN:
286
- this.activeDate = event.altKey ?
287
- this.dateAdapter.addCalendarYears(this._activeDate, 1) :
288
- this.dateAdapter.addCalendarMonths(this._activeDate, 1);
289
- break;
290
- case keycodes.ENTER:
291
- case keycodes.SPACE:
292
- if (!this.dateFilter || this.dateFilter(this._activeDate)) {
293
- this.dateSelected(this.dateAdapter.getDate(this._activeDate));
294
- this.userSelection.emit();
295
- // Prevent unexpected default actions such as form submission.
296
- event.preventDefault();
297
- }
298
- return;
299
- default:
300
- // Don't prevent default or focus active cell on keys that we don't explicitly handle.
301
- return;
302
- }
303
- if (this.dateAdapter.compareDate(oldActiveDate, this.activeDate)) {
304
- this.activeDateChange.emit(this.activeDate);
305
- }
306
- this.focusActiveCell();
307
- // Prevent unexpected default actions such as form submission.
308
- event.preventDefault();
309
- };
310
- /** Initializes this month view. */
311
- McMonthView.prototype.init = function () {
312
- this.selectedDate = this.getDateInCurrentMonth(this.selected);
313
- this.todayDate = this.getDateInCurrentMonth(this.dateAdapter.today());
314
- this.monthLabel = this.dateAdapter.getMonthNames('short')[this.dateAdapter.getMonth(this.activeDate)];
315
- this.monthLabel = this.monthLabel[0].toLocaleUpperCase() + this.monthLabel.substr(1);
316
- var firstOfMonth = this.dateAdapter.createDate(this.dateAdapter.getYear(this.activeDate), this.dateAdapter.getMonth(this.activeDate));
317
- this.firstWeekOffset =
318
- (DAYS_PER_WEEK + this.dateAdapter.getDayOfWeek(firstOfMonth) -
319
- this.dateAdapter.getFirstDayOfWeek()) % DAYS_PER_WEEK;
320
- this.createWeekCells();
321
- this.changeDetectorRef.markForCheck();
322
- };
323
- /** Focuses the active cell after the microtask queue is empty. */
324
- McMonthView.prototype.focusActiveCell = function () {
325
- this.mcCalendarBody.focusActiveCell();
326
- };
327
- /** Creates McCalendarCells for the dates in this month. */
328
- McMonthView.prototype.createWeekCells = function () {
329
- var daysInMonth = this.dateAdapter.getNumDaysInMonth(this.activeDate);
330
- var dateNames = this.dateAdapter.getDateNames();
331
- this.weeks = [[]];
332
- for (var i = 0, cell = this.firstWeekOffset; i < daysInMonth; i++, cell++) {
333
- if (cell === DAYS_PER_WEEK) {
334
- this.weeks.push([]);
335
- cell = 0;
336
- }
337
- var date = this.dateAdapter.createDate(this.dateAdapter.getYear(this.activeDate), this.dateAdapter.getMonth(this.activeDate), i + 1);
338
- var enabled = this.shouldEnableDate(date);
339
- var ariaLabel = this.dateAdapter.format(date, this.dateFormats.dateA11yLabel);
340
- var cellClasses = this.dateClass ? this.dateClass(date) : undefined;
341
- this.weeks[this.weeks.length - 1]
342
- .push(new McCalendarCell(i + 1, dateNames[i], ariaLabel, enabled, cellClasses));
343
- }
344
- };
345
- /** Date filter for the month */
346
- McMonthView.prototype.shouldEnableDate = function (date) {
347
- return !!date &&
348
- (!this.dateFilter || this.dateFilter(date)) &&
349
- (!this.minDate || this.dateAdapter.compareDate(date, this.minDate) >= 0) &&
350
- (!this.maxDate || this.dateAdapter.compareDate(date, this.maxDate) <= 0);
351
- };
352
- /**
353
- * Gets the date in this month that the given Date falls on.
354
- * Returns null if the given Date is in another month.
355
- */
356
- McMonthView.prototype.getDateInCurrentMonth = function (date) {
357
- return date && this.hasSameMonthAndYear(date, this.activeDate) ?
358
- this.dateAdapter.getDate(date) : null;
359
- };
360
- /** Checks whether the 2 dates are non-null and fall within the same month of the same year. */
361
- McMonthView.prototype.hasSameMonthAndYear = function (d1, d2) {
362
- return !!(d1 && d2 && this.dateAdapter.getMonth(d1) === this.dateAdapter.getMonth(d2) &&
363
- this.dateAdapter.getYear(d1) === this.dateAdapter.getYear(d2));
364
- };
365
- /**
366
- * @param obj The object to check.
367
- * @returns The given object if it is both a date instance and valid, otherwise null.
368
- */
369
- McMonthView.prototype.getValidDateOrNull = function (obj) {
370
- return (this.dateAdapter.isDateInstance(obj) && this.dateAdapter.isValid(obj)) ? obj : null;
371
- };
372
- /** Determines whether the user has the RTL layout direction. */
373
- McMonthView.prototype.isRtl = function () {
374
- return this.dir && this.dir.value === 'rtl';
375
- };
376
- return McMonthView;
377
- }());
378
- /** @nocollapse */ McMonthView.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McMonthView, deps: [{ token: i0__namespace.ChangeDetectorRef }, { token: i1$1.MC_DATE_FORMATS, optional: true }, { token: i1__namespace$1.DateAdapter, optional: true }, { token: i2__namespace.Directionality, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Component });
379
- /** @nocollapse */ McMonthView.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", 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__namespace, 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 [label]=\"monthLabel\"\n [rows]=\"weeks\"\n [todayValue]=\"todayDate!\"\n [selectedValue]=\"selectedDate!\"\n [labelMinRequiredCells]=\"3\"\n [activeCell]=\"dateAdapter.getDate(activeDate) - 1\"\n (selectedValueChange)=\"dateSelected($event)\"\n (keydown)=\"handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n", components: [{ type: McCalendarBody, selector: "[mc-calendar-body]", inputs: ["label", "rows", "todayValue", "selectedValue", "labelMinRequiredCells", "numCols", "activeCell", "cellAspectRatio"], outputs: ["selectedValueChange"], exportAs: ["mcCalendarBody"] }], directives: [{ type: i1__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
380
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McMonthView, decorators: [{
381
- type: i0.Component,
382
- args: [{
383
- selector: 'mc-month-view',
384
- exportAs: 'mcMonthView',
385
- templateUrl: 'month-view.html',
386
- encapsulation: i0.ViewEncapsulation.None,
387
- changeDetection: i0.ChangeDetectionStrategy.OnPush
388
- }]
389
- }], ctorParameters: function () {
390
- return [{ type: i0__namespace.ChangeDetectorRef }, { type: undefined, decorators: [{
391
- type: i0.Optional
392
- }, {
393
- type: i0.Inject,
394
- args: [i1$1.MC_DATE_FORMATS]
395
- }] }, { type: i1__namespace$1.DateAdapter, decorators: [{
396
- type: i0.Optional
397
- }] }, { type: i2__namespace.Directionality, decorators: [{
398
- type: i0.Optional
399
- }] }];
400
- }, propDecorators: { activeDate: [{
401
- type: i0.Input
402
- }], selected: [{
403
- type: i0.Input
404
- }], minDate: [{
405
- type: i0.Input
406
- }], maxDate: [{
407
- type: i0.Input
408
- }], dateFilter: [{
409
- type: i0.Input
410
- }], dateClass: [{
411
- type: i0.Input
412
- }], selectedChange: [{
413
- type: i0.Output
414
- }], userSelection: [{
415
- type: i0.Output
416
- }], activeDateChange: [{
417
- type: i0.Output
418
- }], mcCalendarBody: [{
419
- type: i0.ViewChild,
420
- args: [McCalendarBody, { static: false }]
421
- }] } });
422
-
423
- var yearsPerPage = 24;
424
- var yearsPerRow = 4;
425
- /**
426
- * An internal component used to display a year selector in the datepicker.
427
- * @docs-private
428
- */
429
- var McMultiYearView = /** @class */ (function () {
430
- function McMultiYearView(changeDetectorRef, dateAdapter, dir) {
431
- this.changeDetectorRef = changeDetectorRef;
432
- this.dateAdapter = dateAdapter;
433
- this.dir = dir;
434
- /** Emits when a new year is selected. */
435
- this.selectedChange = new i0.EventEmitter();
436
- /** Emits the selected year. This doesn't imply a change on the selected date */
437
- this.yearSelected = new i0.EventEmitter();
438
- /** Emits when any date is activated. */
439
- this.activeDateChange = new i0.EventEmitter();
440
- if (!this.dateAdapter) {
441
- throw createMissingDateImplError('DateAdapter');
442
- }
443
- this._activeDate = this.dateAdapter.today();
444
- }
445
- Object.defineProperty(McMultiYearView.prototype, "activeDate", {
446
- /** The date to display in this multi-year view (everything other than the year is ignored). */
447
- get: function () {
448
- return this._activeDate;
449
- },
450
- set: function (value) {
451
- var oldActiveDate = this._activeDate;
452
- var validDate = this.getValidDateOrNull(this.dateAdapter.deserialize(value)) || this.dateAdapter.today();
453
- this._activeDate = this.dateAdapter.clampDate(validDate, this.minDate, this.maxDate);
454
- if (Math.floor(this.dateAdapter.getYear(oldActiveDate) / yearsPerPage) !==
455
- Math.floor(this.dateAdapter.getYear(this._activeDate) / yearsPerPage)) {
456
- this.init();
457
- }
458
- },
459
- enumerable: false,
460
- configurable: true
461
- });
462
- Object.defineProperty(McMultiYearView.prototype, "selected", {
463
- /** The currently selected date. */
464
- get: function () {
465
- return this._selected;
466
- },
467
- set: function (value) {
468
- this._selected = this.getValidDateOrNull(this.dateAdapter.deserialize(value));
469
- this.selectedYear = this._selected && this.dateAdapter.getYear(this._selected);
470
- },
471
- enumerable: false,
472
- configurable: true
473
- });
474
- Object.defineProperty(McMultiYearView.prototype, "minDate", {
475
- /** The minimum selectable date. */
476
- get: function () {
477
- return this._minDate;
478
- },
479
- set: function (value) {
480
- this._minDate = this.getValidDateOrNull(this.dateAdapter.deserialize(value));
481
- },
482
- enumerable: false,
483
- configurable: true
484
- });
485
- Object.defineProperty(McMultiYearView.prototype, "maxDate", {
486
- /** The maximum selectable date. */
487
- get: function () {
488
- return this._maxDate;
489
- },
490
- set: function (value) {
491
- this._maxDate = this.getValidDateOrNull(this.dateAdapter.deserialize(value));
492
- },
493
- enumerable: false,
494
- configurable: true
495
- });
496
- McMultiYearView.prototype.ngAfterContentInit = function () {
497
- this.init();
498
- };
499
- /** Initializes this multi-year view. */
500
- McMultiYearView.prototype.init = function () {
501
- var _this = this;
502
- this.todayYear = this.dateAdapter.getYear(this.dateAdapter.today());
503
- var activeYear = this.dateAdapter.getYear(this._activeDate);
504
- var activeOffset = activeYear % yearsPerPage;
505
- this.years = [];
506
- for (var i = 0, row = []; i < yearsPerPage; i++) {
507
- row.push(activeYear - activeOffset + i);
508
- if (row.length === yearsPerRow) {
509
- this.years.push(row.map(function (year) { return _this.createCellForYear(year); }));
510
- row = [];
511
- }
512
- }
513
- this.changeDetectorRef.markForCheck();
514
- };
515
- /** Handles when a new year is selected. */
516
- McMultiYearView.prototype.onYearSelected = function (year) {
517
- this.yearSelected.emit(this.dateAdapter.createDate(year));
518
- var month = this.dateAdapter.getMonth(this.activeDate);
519
- var daysInMonth = this.dateAdapter.getNumDaysInMonth(this.dateAdapter.createDate(year, month));
520
- this.selectedChange.emit(this.dateAdapter.createDate(year, month, Math.min(this.dateAdapter.getDate(this.activeDate), daysInMonth)));
521
- };
522
- /** Handles keydown events on the calendar body when calendar is in multi-year view. */
523
- McMultiYearView.prototype.handleCalendarBodyKeydown = function (event) {
524
- // TODO(mmalerba): We currently allow keyboard navigation to disabled dates, but just prevent
525
- // disabled ones from being selected. This may not be ideal, we should look into whether
526
- // navigation should skip over disabled dates, and if so, how to implement that efficiently.
527
- var oldActiveDate = this._activeDate;
528
- var isRtl = this.isRtl();
529
- // tslint:disable-next-line:deprecation
530
- switch (event.keyCode) {
531
- case keycodes.LEFT_ARROW:
532
- this.activeDate = this.dateAdapter.addCalendarYears(this._activeDate, isRtl ? 1 : -1);
533
- break;
534
- case keycodes.RIGHT_ARROW:
535
- this.activeDate = this.dateAdapter.addCalendarYears(this._activeDate, isRtl ? -1 : 1);
536
- break;
537
- case keycodes.UP_ARROW:
538
- this.activeDate = this.dateAdapter.addCalendarYears(this._activeDate, -yearsPerRow);
539
- break;
540
- case keycodes.DOWN_ARROW:
541
- this.activeDate = this.dateAdapter.addCalendarYears(this._activeDate, yearsPerRow);
542
- break;
543
- case keycodes.HOME:
544
- this.activeDate = this.dateAdapter.addCalendarYears(this._activeDate, -this.dateAdapter.getYear(this._activeDate) % yearsPerPage);
545
- break;
546
- case keycodes.END:
547
- this.activeDate = this.dateAdapter.addCalendarYears(this._activeDate, yearsPerPage - this.dateAdapter.getYear(this._activeDate) % yearsPerPage - 1);
548
- break;
549
- case keycodes.PAGE_UP:
550
- this.activeDate =
551
- this.dateAdapter.addCalendarYears(this._activeDate, event.altKey ? -yearsPerPage * 10 : -yearsPerPage);
552
- break;
553
- case keycodes.PAGE_DOWN:
554
- this.activeDate =
555
- this.dateAdapter.addCalendarYears(this._activeDate, event.altKey ? yearsPerPage * 10 : yearsPerPage);
556
- break;
557
- case keycodes.ENTER:
558
- case keycodes.SPACE:
559
- this.onYearSelected(this.dateAdapter.getYear(this._activeDate));
560
- break;
561
- default:
562
- // Don't prevent default or focus active cell on keys that we don't explicitly handle.
563
- return;
564
- }
565
- if (this.dateAdapter.compareDate(oldActiveDate, this.activeDate)) {
566
- this.activeDateChange.emit(this.activeDate);
567
- }
568
- this.focusActiveCell();
569
- // Prevent unexpected default actions such as form submission.
570
- event.preventDefault();
571
- };
572
- McMultiYearView.prototype.getActiveCell = function () {
573
- return this.dateAdapter.getYear(this.activeDate) % yearsPerPage;
574
- };
575
- /** Focuses the active cell after the microtask queue is empty. */
576
- McMultiYearView.prototype.focusActiveCell = function () {
577
- this.mcCalendarBody.focusActiveCell();
578
- };
579
- /** Creates an McCalendarCell for the given year. */
580
- McMultiYearView.prototype.createCellForYear = function (year) {
581
- var yearName = this.dateAdapter.getYearName(this.dateAdapter.createDate(year));
582
- return new McCalendarCell(year, yearName, yearName, this.shouldEnableYear(year));
583
- };
584
- /** Whether the given year is enabled. */
585
- McMultiYearView.prototype.shouldEnableYear = function (year) {
586
- // disable if the year is greater than maxDate lower than minDate
587
- if (year === undefined || year === null ||
588
- (this.maxDate && year > this.dateAdapter.getYear(this.maxDate)) ||
589
- (this.minDate && year < this.dateAdapter.getYear(this.minDate))) {
590
- return false;
591
- }
592
- // enable if it reaches here and there's no filter defined
593
- if (!this.dateFilter) {
594
- return true;
595
- }
596
- var firstOfYear = this.dateAdapter.createDate(year);
597
- // If any date in the year is enabled count the year as enabled.
598
- for (var date = firstOfYear; this.dateAdapter.getYear(date) === year; date = this.dateAdapter.addCalendarDays(date, 1)) {
599
- if (this.dateFilter(date)) {
600
- return true;
601
- }
602
- }
603
- return false;
604
- };
605
- /**
606
- * @param obj The object to check.
607
- * @returns The given object if it is both a date instance and valid, otherwise null.
608
- */
609
- McMultiYearView.prototype.getValidDateOrNull = function (obj) {
610
- return (this.dateAdapter.isDateInstance(obj) && this.dateAdapter.isValid(obj)) ? obj : null;
611
- };
612
- /** Determines whether the user has the RTL layout direction. */
613
- McMultiYearView.prototype.isRtl = function () {
614
- return this.dir && this.dir.value === 'rtl';
615
- };
616
- return McMultiYearView;
617
- }());
618
- /** @nocollapse */ McMultiYearView.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McMultiYearView, deps: [{ token: i0__namespace.ChangeDetectorRef }, { token: i1__namespace$1.DateAdapter, optional: true }, { token: i2__namespace.Directionality, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Component });
619
- /** @nocollapse */ McMultiYearView.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: McMultiYearView, selector: "mc-multi-year-view", inputs: { activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate", dateFilter: "dateFilter" }, outputs: { selectedChange: "selectedChange", yearSelected: "yearSelected", activeDateChange: "activeDateChange" }, viewQueries: [{ propertyName: "mcCalendarBody", first: true, predicate: McCalendarBody, descendants: true }], exportAs: ["mcMultiYearView"], ngImport: i0__namespace, template: "<table class=\"mc-calendar__table\">\n <thead class=\"mc-calendar__table-header\">\n <tr>\n <th class=\"mc-calendar__table-header-divider\" colspan=\"4\"></th>\n </tr>\n </thead>\n <tbody mc-calendar-body\n [rows]=\"years\"\n [todayValue]=\"todayYear\"\n [selectedValue]=\"selectedYear!\"\n [numCols]=\"4\"\n [cellAspectRatio]=\"4 / 7\"\n [activeCell]=\"getActiveCell()\"\n (selectedValueChange)=\"onYearSelected($event)\"\n (keydown)=\"handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n", components: [{ type: McCalendarBody, selector: "[mc-calendar-body]", inputs: ["label", "rows", "todayValue", "selectedValue", "labelMinRequiredCells", "numCols", "activeCell", "cellAspectRatio"], outputs: ["selectedValueChange"], exportAs: ["mcCalendarBody"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
620
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McMultiYearView, decorators: [{
621
- type: i0.Component,
622
- args: [{
623
- selector: 'mc-multi-year-view',
624
- exportAs: 'mcMultiYearView',
625
- templateUrl: 'multi-year-view.html',
626
- encapsulation: i0.ViewEncapsulation.None,
627
- changeDetection: i0.ChangeDetectionStrategy.OnPush
628
- }]
629
- }], ctorParameters: function () {
630
- return [{ type: i0__namespace.ChangeDetectorRef }, { type: i1__namespace$1.DateAdapter, decorators: [{
631
- type: i0.Optional
632
- }] }, { type: i2__namespace.Directionality, decorators: [{
633
- type: i0.Optional
634
- }] }];
635
- }, propDecorators: { activeDate: [{
636
- type: i0.Input
637
- }], selected: [{
638
- type: i0.Input
639
- }], minDate: [{
640
- type: i0.Input
641
- }], maxDate: [{
642
- type: i0.Input
643
- }], dateFilter: [{
644
- type: i0.Input
645
- }], selectedChange: [{
646
- type: i0.Output
647
- }], yearSelected: [{
648
- type: i0.Output
649
- }], activeDateChange: [{
650
- type: i0.Output
651
- }], mcCalendarBody: [{
652
- type: i0.ViewChild,
653
- args: [McCalendarBody, { static: false }]
654
- }] } });
655
-
656
- /**
657
- * An internal component used to display a single year in the datepicker.
658
- * @docs-private
659
- */
660
- var McYearView = /** @class */ (function () {
661
- function McYearView(changeDetectorRef, dateFormats, dateAdapter, dir) {
662
- this.changeDetectorRef = changeDetectorRef;
663
- this.dateFormats = dateFormats;
664
- this.dateAdapter = dateAdapter;
665
- this.dir = dir;
666
- /** Emits when a new month is selected. */
667
- this.selectedChange = new i0.EventEmitter();
668
- /** Emits the selected month. This doesn't imply a change on the selected date */
669
- this.monthSelected = new i0.EventEmitter();
670
- /** Emits when any date is activated. */
671
- this.activeDateChange = new i0.EventEmitter();
672
- if (!this.dateAdapter) {
673
- throw createMissingDateImplError('DateAdapter');
674
- }
675
- if (!this.dateFormats) {
676
- throw createMissingDateImplError('MC_DATE_FORMATS');
677
- }
678
- this._activeDate = this.dateAdapter.today();
679
- }
680
- Object.defineProperty(McYearView.prototype, "activeDate", {
681
- /** The date to display in this year view (everything other than the year is ignored). */
682
- get: function () {
683
- return this._activeDate;
684
- },
685
- set: function (value) {
686
- var oldActiveDate = this._activeDate;
687
- var validDate = this.getValidDateOrNull(this.dateAdapter.deserialize(value)) || this.dateAdapter.today();
688
- this._activeDate = this.dateAdapter.clampDate(validDate, this.minDate, this.maxDate);
689
- if (this.dateAdapter.getYear(oldActiveDate) !== this.dateAdapter.getYear(this._activeDate)) {
690
- this.init();
691
- }
692
- },
693
- enumerable: false,
694
- configurable: true
695
- });
696
- Object.defineProperty(McYearView.prototype, "selected", {
697
- /** The currently selected date. */
698
- get: function () {
699
- return this._selected;
700
- },
701
- set: function (value) {
702
- this._selected = this.getValidDateOrNull(this.dateAdapter.deserialize(value));
703
- this.selectedMonth = this.getMonthInCurrentYear(this._selected);
704
- },
705
- enumerable: false,
706
- configurable: true
707
- });
708
- Object.defineProperty(McYearView.prototype, "minDate", {
709
- /** The minimum selectable date. */
710
- get: function () {
711
- return this._minDate;
712
- },
713
- set: function (value) {
714
- this._minDate = this.getValidDateOrNull(this.dateAdapter.deserialize(value));
715
- },
716
- enumerable: false,
717
- configurable: true
718
- });
719
- Object.defineProperty(McYearView.prototype, "maxDate", {
720
- /** The maximum selectable date. */
721
- get: function () {
722
- return this._maxDate;
723
- },
724
- set: function (value) {
725
- this._maxDate = this.getValidDateOrNull(this.dateAdapter.deserialize(value));
726
- },
727
- enumerable: false,
728
- configurable: true
729
- });
730
- McYearView.prototype.ngAfterContentInit = function () {
731
- this.init();
732
- };
733
- /** Handles when a new month is selected. */
734
- McYearView.prototype.onMonthSelected = function (month) {
735
- var year = this.dateAdapter.getYear(this.activeDate);
736
- var normalizedDate = this.dateAdapter.createDate(year, month);
737
- this.monthSelected.emit(normalizedDate);
738
- var daysInMonth = this.dateAdapter.getNumDaysInMonth(normalizedDate);
739
- this.selectedChange.emit(this.dateAdapter.createDate(year, month, Math.min(this.dateAdapter.getDate(this.activeDate), daysInMonth)));
740
- };
741
- /** Handles keydown events on the calendar body when calendar is in year view. */
742
- McYearView.prototype.handleCalendarBodyKeydown = function (event) {
743
- // TODO(mmalerba): We currently allow keyboard navigation to disabled dates, but just prevent
744
- // disabled ones from being selected. This may not be ideal, we should look into whether
745
- // navigation should skip over disabled dates, and if so, how to implement that efficiently.
746
- var oldActiveDate = this._activeDate;
747
- var isRtl = this.isRtl();
748
- var VERTICAL_SHIFT = 4;
749
- var PAGE_SHIFT = 10;
750
- var MAX_MONTH_INDEX = 11;
751
- // tslint:disable-next-line:deprecation
752
- switch (event.keyCode) {
753
- case keycodes.LEFT_ARROW:
754
- this.activeDate = this.dateAdapter.addCalendarMonths(this._activeDate, isRtl ? 1 : -1);
755
- break;
756
- case keycodes.RIGHT_ARROW:
757
- this.activeDate = this.dateAdapter.addCalendarMonths(this._activeDate, isRtl ? -1 : 1);
758
- break;
759
- case keycodes.UP_ARROW:
760
- this.activeDate = this.dateAdapter.addCalendarMonths(this._activeDate, -VERTICAL_SHIFT);
761
- break;
762
- case keycodes.DOWN_ARROW:
763
- this.activeDate = this.dateAdapter.addCalendarMonths(this._activeDate, VERTICAL_SHIFT);
764
- break;
765
- case keycodes.HOME:
766
- this.activeDate = this.dateAdapter.addCalendarMonths(this._activeDate, -this.dateAdapter.getMonth(this._activeDate));
767
- break;
768
- case keycodes.END:
769
- this.activeDate = this.dateAdapter.addCalendarMonths(this._activeDate, MAX_MONTH_INDEX - this.dateAdapter.getMonth(this._activeDate));
770
- break;
771
- case keycodes.PAGE_UP:
772
- this.activeDate =
773
- this.dateAdapter.addCalendarYears(this._activeDate, event.altKey ? -PAGE_SHIFT : -1);
774
- break;
775
- case keycodes.PAGE_DOWN:
776
- this.activeDate =
777
- this.dateAdapter.addCalendarYears(this._activeDate, event.altKey ? PAGE_SHIFT : 1);
778
- break;
779
- case keycodes.ENTER:
780
- case keycodes.SPACE:
781
- this.onMonthSelected(this.dateAdapter.getMonth(this._activeDate));
782
- break;
783
- default:
784
- // Don't prevent default or focus active cell on keys that we don't explicitly handle.
785
- return;
786
- }
787
- if (this.dateAdapter.compareDate(oldActiveDate, this.activeDate)) {
788
- this.activeDateChange.emit(this.activeDate);
789
- }
790
- this.focusActiveCell();
791
- // Prevent unexpected default actions such as form submission.
792
- event.preventDefault();
793
- };
794
- /** Initializes this year view. */
795
- McYearView.prototype.init = function () {
796
- var _this = this;
797
- this.selectedMonth = this.getMonthInCurrentYear(this.selected);
798
- this.todayMonth = this.getMonthInCurrentYear(this.dateAdapter.today());
799
- this.yearLabel = this.dateAdapter.getYearName(this.activeDate);
800
- var monthNames = this.dateAdapter.getMonthNames('short');
801
- // First row of months only contains 5 elements so we can fit the year label on the same row.
802
- // tslint:disable-next-line:no-magic-numbers
803
- this.months = [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11]]
804
- .map(function (row) { return row.map(function (month) { return _this.createCellForMonth(month, monthNames[month]); }); });
805
- this.changeDetectorRef.markForCheck();
806
- };
807
- /** Focuses the active cell after the microtask queue is empty. */
808
- McYearView.prototype.focusActiveCell = function () {
809
- this.mcCalendarBody.focusActiveCell();
810
- };
811
- /**
812
- * Gets the month in this year that the given Date falls on.
813
- * Returns null if the given Date is in another year.
814
- */
815
- McYearView.prototype.getMonthInCurrentYear = function (date) {
816
- return date && this.dateAdapter.getYear(date) === this.dateAdapter.getYear(this.activeDate) ?
817
- this.dateAdapter.getMonth(date) : null;
818
- };
819
- /** Creates an McCalendarCell for the given month. */
820
- McYearView.prototype.createCellForMonth = function (month, monthName) {
821
- var ariaLabel = this.dateAdapter.format(this.dateAdapter.createDate(this.dateAdapter.getYear(this.activeDate), month), this.dateFormats.monthYearA11yLabel);
822
- var newMonthName = monthName[0].toLocaleUpperCase() + monthName.substr(1);
823
- return new McCalendarCell(month, newMonthName, ariaLabel, this.shouldEnableMonth(month));
824
- };
825
- /** Whether the given month is enabled. */
826
- McYearView.prototype.shouldEnableMonth = function (month) {
827
- var activeYear = this.dateAdapter.getYear(this.activeDate);
828
- if (month === undefined || month === null ||
829
- this.isYearAndMonthAfterMaxDate(activeYear, month) ||
830
- this.isYearAndMonthBeforeMinDate(activeYear, month)) {
831
- return false;
832
- }
833
- if (!this.dateFilter) {
834
- return true;
835
- }
836
- var firstOfMonth = this.dateAdapter.createDate(activeYear, month);
837
- // If any date in the month is enabled count the month as enabled.
838
- for (var date = firstOfMonth; this.dateAdapter.getMonth(date) === month; date = this.dateAdapter.addCalendarDays(date, 1)) {
839
- if (this.dateFilter(date)) {
840
- return true;
841
- }
842
- }
843
- return false;
844
- };
845
- /**
846
- * Tests whether the combination month/year is after this.maxDate, considering
847
- * just the month and year of this.maxDate
848
- */
849
- McYearView.prototype.isYearAndMonthAfterMaxDate = function (year, month) {
850
- if (this.maxDate) {
851
- var maxYear = this.dateAdapter.getYear(this.maxDate);
852
- var maxMonth = this.dateAdapter.getMonth(this.maxDate);
853
- return year > maxYear || (year === maxYear && month > maxMonth);
854
- }
855
- return false;
856
- };
857
- /**
858
- * Tests whether the combination month/year is before this.minDate, considering
859
- * just the month and year of this.minDate
860
- */
861
- McYearView.prototype.isYearAndMonthBeforeMinDate = function (year, month) {
862
- if (this.minDate) {
863
- var minYear = this.dateAdapter.getYear(this.minDate);
864
- var minMonth = this.dateAdapter.getMonth(this.minDate);
865
- return year < minYear || (year === minYear && month < minMonth);
866
- }
867
- return false;
868
- };
869
- /**
870
- * @param obj The object to check.
871
- * @returns The given object if it is both a date instance and valid, otherwise null.
872
- */
873
- McYearView.prototype.getValidDateOrNull = function (obj) {
874
- return (this.dateAdapter.isDateInstance(obj) && this.dateAdapter.isValid(obj)) ? obj : null;
875
- };
876
- /** Determines whether the user has the RTL layout direction. */
877
- McYearView.prototype.isRtl = function () {
878
- return this.dir && this.dir.value === 'rtl';
879
- };
880
- return McYearView;
881
- }());
882
- /** @nocollapse */ McYearView.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McYearView, deps: [{ token: i0__namespace.ChangeDetectorRef }, { token: i1$1.MC_DATE_FORMATS, optional: true }, { token: i1__namespace$1.DateAdapter, optional: true }, { token: i2__namespace.Directionality, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Component });
883
- /** @nocollapse */ McYearView.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: McYearView, selector: "mc-year-view", inputs: { activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate", dateFilter: "dateFilter" }, outputs: { selectedChange: "selectedChange", monthSelected: "monthSelected", activeDateChange: "activeDateChange" }, viewQueries: [{ propertyName: "mcCalendarBody", first: true, predicate: McCalendarBody, descendants: true }], exportAs: ["mcYearView"], ngImport: i0__namespace, template: "<table class=\"mc-calendar__table\">\n <thead class=\"mc-calendar__table-header\">\n <tr>\n <th class=\"mc-calendar__table-header-divider\" colspan=\"4\"></th>\n </tr>\n </thead>\n <tbody mc-calendar-body\n [label]=\"yearLabel\"\n [rows]=\"months\"\n [todayValue]=\"todayMonth!\"\n [selectedValue]=\"selectedMonth!\"\n [labelMinRequiredCells]=\"2\"\n [numCols]=\"4\"\n [cellAspectRatio]=\"4 / 7\"\n [activeCell]=\"dateAdapter.getMonth(activeDate)\"\n (selectedValueChange)=\"onMonthSelected($event)\"\n (keydown)=\"handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n", components: [{ type: McCalendarBody, selector: "[mc-calendar-body]", inputs: ["label", "rows", "todayValue", "selectedValue", "labelMinRequiredCells", "numCols", "activeCell", "cellAspectRatio"], outputs: ["selectedValueChange"], exportAs: ["mcCalendarBody"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
884
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McYearView, decorators: [{
885
- type: i0.Component,
886
- args: [{
887
- selector: 'mc-year-view',
888
- exportAs: 'mcYearView',
889
- templateUrl: 'year-view.html',
890
- encapsulation: i0.ViewEncapsulation.None,
891
- changeDetection: i0.ChangeDetectionStrategy.OnPush
892
- }]
893
- }], ctorParameters: function () {
894
- return [{ type: i0__namespace.ChangeDetectorRef }, { type: undefined, decorators: [{
895
- type: i0.Optional
896
- }, {
897
- type: i0.Inject,
898
- args: [i1$1.MC_DATE_FORMATS]
899
- }] }, { type: i1__namespace$1.DateAdapter, decorators: [{
900
- type: i0.Optional
901
- }] }, { type: i2__namespace.Directionality, decorators: [{
902
- type: i0.Optional
903
- }] }];
904
- }, propDecorators: { activeDate: [{
905
- type: i0.Input
906
- }], selected: [{
907
- type: i0.Input
908
- }], minDate: [{
909
- type: i0.Input
910
- }], maxDate: [{
911
- type: i0.Input
912
- }], dateFilter: [{
913
- type: i0.Input
914
- }], selectedChange: [{
915
- type: i0.Output
916
- }], monthSelected: [{
917
- type: i0.Output
918
- }], activeDateChange: [{
919
- type: i0.Output
920
- }], mcCalendarBody: [{
921
- type: i0.ViewChild,
922
- args: [McCalendarBody, { static: false }]
923
- }] } });
924
-
925
- /** Datepicker data that requires internationalization. */
926
- var McDatepickerIntl = /** @class */ (function () {
927
- function McDatepickerIntl() {
928
- /**
929
- * Stream that emits whenever the labels here are changed. Use this to notify
930
- * components if the labels have changed after initialization.
931
- */
932
- this.changes = new rxjs.Subject();
933
- /** A label for the calendar popup (used by screen readers). */
934
- this.calendarLabel = 'Calendar';
935
- /** A label for the button used to open the calendar popup (used by screen readers). */
936
- this.openCalendarLabel = 'Open calendar';
937
- /** A label for the previous month button (used by screen readers). */
938
- this.prevMonthLabel = 'Previous month';
939
- /** A label for the next month button (used by screen readers). */
940
- this.nextMonthLabel = 'Next month';
941
- /** A label for the previous year button (used by screen readers). */
942
- this.prevYearLabel = 'Previous year';
943
- /** A label for the next year button (used by screen readers). */
944
- this.nextYearLabel = 'Next year';
945
- /** A label for the previous multi-year button (used by screen readers). */
946
- this.prevMultiYearLabel = 'Previous 20 years';
947
- /** A label for the next multi-year button (used by screen readers). */
948
- this.nextMultiYearLabel = 'Next 20 years';
949
- /** A label for the 'switch to month view' button (used by screen readers). */
950
- this.switchToMonthViewLabel = 'Choose date';
951
- /** A label for the 'switch to year view' button (used by screen readers). */
952
- this.switchToMultiYearViewLabel = 'Choose month and year';
953
- }
954
- return McDatepickerIntl;
955
- }());
956
- /** @nocollapse */ McDatepickerIntl.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McDatepickerIntl, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
957
- /** @nocollapse */ McDatepickerIntl.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McDatepickerIntl, providedIn: 'root' });
958
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McDatepickerIntl, decorators: [{
959
- type: i0.Injectable,
960
- args: [{ providedIn: 'root' }]
961
- }] });
962
-
963
- /**
964
- * Possible views for the calendar.
965
- * @docs-private
966
- */
967
- exports.McCalendarView = void 0;
968
- (function (McCalendarView) {
969
- McCalendarView["Month"] = "month";
970
- McCalendarView["Year"] = "year";
971
- McCalendarView["MultiYear"] = "multi-year";
972
- })(exports.McCalendarView || (exports.McCalendarView = {}));
973
- /** Default header for McCalendar */
974
- var McCalendarHeader = /** @class */ (function () {
975
- function McCalendarHeader(intl, calendar, dateAdapter, dateFormats, changeDetectorRef) {
976
- this.intl = intl;
977
- this.calendar = calendar;
978
- this.dateAdapter = dateAdapter;
979
- this.dateFormats = dateFormats;
980
- this.calendar.stateChanges.subscribe(function () { return changeDetectorRef.markForCheck(); });
981
- }
982
- Object.defineProperty(McCalendarHeader.prototype, "periodButtonText", {
983
- /** The label for the current calendar view. */
984
- get: function () {
985
- if (this.calendar.currentView === exports.McCalendarView.Month) {
986
- var label = this.dateAdapter.format(this.calendar.activeDate, this.dateFormats.monthYearLabel);
987
- return (label[0].toLocaleUpperCase() + label.substr(1)).replace('.', '');
988
- }
989
- if (this.calendar.currentView === exports.McCalendarView.Year) {
990
- return this.dateAdapter.getYearName(this.calendar.activeDate);
991
- }
992
- var activeYear = this.dateAdapter.getYear(this.calendar.activeDate);
993
- var firstYearInView = this.dateAdapter.getYearName(
994
- // tslint:disable-next-line:no-magic-numbers
995
- this.dateAdapter.createDate(activeYear - activeYear % 24));
996
- var lastYearInView = this.dateAdapter.getYearName(
997
- // tslint:disable-next-line:no-magic-numbers
998
- this.dateAdapter.createDate(activeYear + yearsPerPage - 1 - activeYear % 24));
999
- return firstYearInView + " \u2013 " + lastYearInView;
1000
- },
1001
- enumerable: false,
1002
- configurable: true
1003
- });
1004
- Object.defineProperty(McCalendarHeader.prototype, "periodButtonLabel", {
1005
- get: function () {
1006
- return this.calendar.currentView === exports.McCalendarView.Month ?
1007
- this.intl.switchToMultiYearViewLabel : this.intl.switchToMonthViewLabel;
1008
- },
1009
- enumerable: false,
1010
- configurable: true
1011
- });
1012
- Object.defineProperty(McCalendarHeader.prototype, "prevButtonLabel", {
1013
- /** The label for the previous button. */
1014
- get: function () {
1015
- var _a;
1016
- return (_a = {},
1017
- _a[exports.McCalendarView.Month] = this.intl.prevMonthLabel,
1018
- _a[exports.McCalendarView.Year] = this.intl.prevYearLabel,
1019
- _a[exports.McCalendarView.MultiYear] = this.intl.prevMultiYearLabel,
1020
- _a)[this.calendar.currentView];
1021
- },
1022
- enumerable: false,
1023
- configurable: true
1024
- });
1025
- Object.defineProperty(McCalendarHeader.prototype, "nextButtonLabel", {
1026
- /** The label for the next button. */
1027
- get: function () {
1028
- var _a;
1029
- return (_a = {},
1030
- _a[exports.McCalendarView.Month] = this.intl.nextMonthLabel,
1031
- _a[exports.McCalendarView.Year] = this.intl.nextYearLabel,
1032
- _a[exports.McCalendarView.MultiYear] = this.intl.nextMultiYearLabel,
1033
- _a)[this.calendar.currentView];
1034
- },
1035
- enumerable: false,
1036
- configurable: true
1037
- });
1038
- /** Handles user clicks on the period label. */
1039
- McCalendarHeader.prototype.currentPeriodClicked = function () {
1040
- if ([exports.McCalendarView.Month, exports.McCalendarView.MultiYear].includes(this.calendar.currentView)) {
1041
- this.calendar.currentView = exports.McCalendarView.Year;
1042
- }
1043
- else if (this.calendar.currentView === exports.McCalendarView.Year) {
1044
- this.calendar.currentView = exports.McCalendarView.Month;
1045
- }
1046
- };
1047
- /** Handles user clicks on the previous button. */
1048
- McCalendarHeader.prototype.previousClicked = function () {
1049
- if (this.calendar.currentView === exports.McCalendarView.Month) {
1050
- this.calendar.activeDate = this.dateAdapter.addCalendarMonths(this.calendar.activeDate, -1);
1051
- }
1052
- else {
1053
- this.calendar.activeDate = this.dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView === exports.McCalendarView.Year ? -1 : -yearsPerPage);
1054
- }
1055
- };
1056
- /** Handles user clicks on the next button. */
1057
- McCalendarHeader.prototype.nextClicked = function () {
1058
- if (this.calendar.currentView === exports.McCalendarView.Month) {
1059
- this.calendar.activeDate = this.dateAdapter.addCalendarMonths(this.calendar.activeDate, 1);
1060
- }
1061
- else {
1062
- this.calendar.activeDate = this.dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView === exports.McCalendarView.Year ? 1 : yearsPerPage);
1063
- }
1064
- };
1065
- /** Whether the previous period button is enabled. */
1066
- McCalendarHeader.prototype.previousEnabled = function () {
1067
- if (!this.calendar.minDate) {
1068
- return true;
1069
- }
1070
- return !this.calendar.minDate || !this.isSameView(this.calendar.activeDate, this.calendar.minDate);
1071
- };
1072
- /** Whether the next period button is enabled. */
1073
- McCalendarHeader.prototype.nextEnabled = function () {
1074
- return !this.calendar.maxDate || !this.isSameView(this.calendar.activeDate, this.calendar.maxDate);
1075
- };
1076
- /** Whether the two dates represent the same view in the current view mode (month or year). */
1077
- McCalendarHeader.prototype.isSameView = function (firstDate, secondDate) {
1078
- var firstYear = this.dateAdapter.getYear(firstDate);
1079
- var secondYear = this.dateAdapter.getYear(secondDate);
1080
- var firstMonth = this.dateAdapter.getMonth(firstDate);
1081
- var secondMonth = this.dateAdapter.getMonth(secondDate);
1082
- if (this.calendar.currentView === exports.McCalendarView.Month) {
1083
- return firstYear === secondYear && firstMonth === secondMonth;
1084
- }
1085
- if (this.calendar.currentView === exports.McCalendarView.Year) {
1086
- return firstYear === secondYear;
1087
- }
1088
- // Otherwise we are in 'multi-year' view.
1089
- return Math.floor(firstYear / yearsPerPage) === Math.floor(secondYear / yearsPerPage);
1090
- };
1091
- return McCalendarHeader;
1092
- }());
1093
- /** @nocollapse */ McCalendarHeader.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McCalendarHeader, deps: [{ token: McDatepickerIntl }, { token: i0.forwardRef(function () { return McCalendar; }) }, { token: i1__namespace$1.DateAdapter, optional: true }, { token: i1$1.MC_DATE_FORMATS, optional: true }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
1094
- /** @nocollapse */ McCalendarHeader.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: McCalendarHeader, selector: "mc-calendar-header", host: { classAttribute: "mc-calendar-header" }, exportAs: ["mcCalendarHeader"], ngImport: i0__namespace, template: "<button mc-button\n [tabindex]=\"'-1'\"\n class=\"mc-button_transparent mc-calendar__period-button\"\n (click)=\"currentPeriodClicked()\">\n {{ periodButtonText }}\n\n <i class=\"mc mc-icon\"\n [class.mc-angle-up-M_16]=\"calendar.currentView !== 'month'\"\n [class.mc-angle-down-M_16]=\"calendar.currentView === 'month'\">\n </i>\n</button>\n\n<div class=\"mc-calendar-spacer\"></div>\n\n<button mc-button\n [tabindex]=\"'-1'\"\n class=\"mc-button_transparent mc-calendar__previous-button\"\n [disabled]=\"!previousEnabled()\"\n (click)=\"previousClicked()\">\n\n <i mc-icon=\"mc-angle-left-L_16\"></i>\n</button>\n\n<button mc-button\n [tabindex]=\"'-1'\"\n class=\"mc-button_transparent mc-calendar__next-button\"\n [disabled]=\"!nextEnabled()\"\n (click)=\"nextClicked()\">\n\n <i mc-icon=\"mc-angle-right-L_16\"></i>\n</button>\n", components: [{ type: i3__namespace.McButton, selector: "button[mc-button]", inputs: ["disabled", "color"] }, { type: i4__namespace.McIcon, selector: "[mc-icon]", inputs: ["color"] }], directives: [{ type: i3__namespace.McButtonCssStyler, selector: "button[mc-button], a[mc-button]" }, { type: i4__namespace.McIconCSSStyler, selector: "[mc-icon]" }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
1095
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McCalendarHeader, decorators: [{
1096
- type: i0.Component,
1097
- args: [{
1098
- selector: 'mc-calendar-header',
1099
- templateUrl: 'calendar-header.html',
1100
- exportAs: 'mcCalendarHeader',
1101
- host: {
1102
- class: 'mc-calendar-header'
1103
- },
1104
- encapsulation: i0.ViewEncapsulation.None,
1105
- changeDetection: i0.ChangeDetectionStrategy.OnPush
1106
- }]
1107
- }], ctorParameters: function () {
1108
- return [{ type: McDatepickerIntl }, { type: McCalendar, decorators: [{
1109
- type: i0.Inject,
1110
- args: [i0.forwardRef(function () { return McCalendar; })]
1111
- }] }, { type: i1__namespace$1.DateAdapter, decorators: [{
1112
- type: i0.Optional
1113
- }] }, { type: undefined, decorators: [{
1114
- type: i0.Optional
1115
- }, {
1116
- type: i0.Inject,
1117
- args: [i1$1.MC_DATE_FORMATS]
1118
- }] }, { type: i0__namespace.ChangeDetectorRef }];
1119
- } });
1120
- /**
1121
- * A calendar that is used as part of the datepicker.
1122
- * @docs-private
1123
- */
1124
- var McCalendar = /** @class */ (function () {
1125
- function McCalendar(intl, dateAdapter, dateFormats, changeDetectorRef) {
1126
- var _this = this;
1127
- this.dateAdapter = dateAdapter;
1128
- this.dateFormats = dateFormats;
1129
- this.changeDetectorRef = changeDetectorRef;
1130
- /** Whether the calendar should be started in month or year view. */
1131
- this.startView = exports.McCalendarView.Month;
1132
- /** Emits when the currently selected date changes. */
1133
- this.selectedChange = new i0.EventEmitter();
1134
- /**
1135
- * Emits the year chosen in multiyear view.
1136
- * This doesn't imply a change on the selected date.
1137
- */
1138
- this.yearSelected = new i0.EventEmitter();
1139
- /**
1140
- * Emits the month chosen in year view.
1141
- * This doesn't imply a change on the selected date.
1142
- */
1143
- this.monthSelected = new i0.EventEmitter();
1144
- /** Emits when any date is selected. */
1145
- this.userSelection = new i0.EventEmitter();
1146
- /**
1147
- * Emits whenever there is a state change that the header may need to respond to.
1148
- */
1149
- this.stateChanges = new rxjs.Subject();
1150
- /**
1151
- * Used for scheduling that focus should be moved to the active cell on the next tick.
1152
- * We need to schedule it, rather than do it immediately, because we have to wait
1153
- * for Angular to re-evaluate the view children.
1154
- */
1155
- this.moveFocusOnNextTick = false;
1156
- if (!this.dateAdapter) {
1157
- throw createMissingDateImplError('DateAdapter');
1158
- }
1159
- if (!this.dateFormats) {
1160
- throw createMissingDateImplError('MC_DATE_FORMATS');
1161
- }
1162
- this.intlChanges = intl.changes.subscribe(function () {
1163
- changeDetectorRef.markForCheck();
1164
- _this.stateChanges.next();
1165
- });
1166
- }
1167
- Object.defineProperty(McCalendar.prototype, "startAt", {
1168
- /** A date representing the period (month or year) to start the calendar in. */
1169
- get: function () {
1170
- return this._startAt;
1171
- },
1172
- set: function (value) {
1173
- this._startAt = this.getValidDateOrNull(this.dateAdapter.deserialize(value));
1174
- },
1175
- enumerable: false,
1176
- configurable: true
1177
- });
1178
- Object.defineProperty(McCalendar.prototype, "selected", {
1179
- /** The currently selected date. */
1180
- get: function () {
1181
- return this._selected;
1182
- },
1183
- set: function (value) {
1184
- this._selected = this.getValidDateOrNull(this.dateAdapter.deserialize(value));
1185
- },
1186
- enumerable: false,
1187
- configurable: true
1188
- });
1189
- Object.defineProperty(McCalendar.prototype, "minDate", {
1190
- /** The minimum selectable date. */
1191
- get: function () {
1192
- return this._minDate;
1193
- },
1194
- set: function (value) {
1195
- this._minDate = this.getValidDateOrNull(this.dateAdapter.deserialize(value));
1196
- },
1197
- enumerable: false,
1198
- configurable: true
1199
- });
1200
- Object.defineProperty(McCalendar.prototype, "maxDate", {
1201
- /** The maximum selectable date. */
1202
- get: function () {
1203
- return this._maxDate;
1204
- },
1205
- set: function (value) {
1206
- this._maxDate = this.getValidDateOrNull(this.dateAdapter.deserialize(value));
1207
- },
1208
- enumerable: false,
1209
- configurable: true
1210
- });
1211
- Object.defineProperty(McCalendar.prototype, "activeDate", {
1212
- /**
1213
- * The current active date. This determines which time period is shown and which date is
1214
- * highlighted when using keyboard navigation.
1215
- */
1216
- get: function () {
1217
- return this.clampedActiveDate;
1218
- },
1219
- set: function (value) {
1220
- this.clampedActiveDate = this.dateAdapter.clampDate(value, this.minDate, this.maxDate);
1221
- this.stateChanges.next();
1222
- },
1223
- enumerable: false,
1224
- configurable: true
1225
- });
1226
- Object.defineProperty(McCalendar.prototype, "currentView", {
1227
- /** Whether the calendar is in month view. */
1228
- get: function () {
1229
- return this._currentView;
1230
- },
1231
- set: function (value) {
1232
- this._currentView = value;
1233
- this.moveFocusOnNextTick = true;
1234
- },
1235
- enumerable: false,
1236
- configurable: true
1237
- });
1238
- McCalendar.prototype.ngAfterContentInit = function () {
1239
- this.calendarHeaderPortal = new i8.ComponentPortal(this.headerComponent || McCalendarHeader);
1240
- this.activeDate = this.startAt || this.dateAdapter.today();
1241
- // Assign to the private property since we don't want to move focus on init.
1242
- this._currentView = this.startView;
1243
- };
1244
- McCalendar.prototype.ngAfterViewChecked = function () {
1245
- if (this.moveFocusOnNextTick) {
1246
- this.moveFocusOnNextTick = false;
1247
- this.focusActiveCell();
1248
- }
1249
- };
1250
- McCalendar.prototype.ngOnDestroy = function () {
1251
- this.intlChanges.unsubscribe();
1252
- this.stateChanges.complete();
1253
- };
1254
- McCalendar.prototype.ngOnChanges = function (changes) {
1255
- var change = changes.minDate || changes.maxDate || changes.dateFilter;
1256
- if (change && !change.firstChange) {
1257
- var view = this.getCurrentViewComponent();
1258
- if (view) {
1259
- // We need to `detectChanges` manually here, because the `minDate`, `maxDate` etc. are
1260
- // passed down to the view via data bindings which won't be up-to-date when we call `init`.
1261
- this.changeDetectorRef.detectChanges();
1262
- view.init();
1263
- }
1264
- }
1265
- this.stateChanges.next();
1266
- };
1267
- McCalendar.prototype.focusActiveCell = function () {
1268
- this.getCurrentViewComponent().focusActiveCell();
1269
- };
1270
- /** Updates today's date after an update of the active date */
1271
- McCalendar.prototype.updateTodaysDate = function () {
1272
- var view = this.currentView === exports.McCalendarView.Month ? this.monthView :
1273
- (this.currentView === exports.McCalendarView.Year ? this.yearView : this.multiYearView);
1274
- view.ngAfterContentInit();
1275
- };
1276
- /** Handles date selection in the month view. */
1277
- McCalendar.prototype.dateSelected = function (date) {
1278
- if (!this.dateAdapter.sameDate(date, this.selected)) {
1279
- this.selectedChange.emit(date);
1280
- }
1281
- };
1282
- /** Handles year selection in the multiyear view. */
1283
- McCalendar.prototype.yearSelectedInMultiYearView = function (normalizedYear) {
1284
- this.yearSelected.emit(normalizedYear);
1285
- };
1286
- /** Handles month selection in the year view. */
1287
- McCalendar.prototype.monthSelectedInYearView = function (normalizedMonth) {
1288
- this.monthSelected.emit(normalizedMonth);
1289
- };
1290
- McCalendar.prototype.userSelected = function () {
1291
- this.userSelection.emit();
1292
- };
1293
- /** Handles year/month selection in the multi-year/year views. */
1294
- McCalendar.prototype.goToDateInView = function (date, view) {
1295
- this.activeDate = date;
1296
- this.currentView = view;
1297
- };
1298
- /**
1299
- * @param obj The object to check.
1300
- * @returns The given object if it is both a date instance and valid, otherwise null.
1301
- */
1302
- McCalendar.prototype.getValidDateOrNull = function (obj) {
1303
- return (this.dateAdapter.isDateInstance(obj) && this.dateAdapter.isValid(obj)) ? obj : null;
1304
- };
1305
- /** Returns the component instance that corresponds to the current calendar view. */
1306
- McCalendar.prototype.getCurrentViewComponent = function () {
1307
- return this.monthView || this.yearView || this.multiYearView;
1308
- };
1309
- return McCalendar;
1310
- }());
1311
- /** @nocollapse */ McCalendar.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McCalendar, deps: [{ token: McDatepickerIntl }, { token: i1__namespace$1.DateAdapter, optional: true }, { token: i1$1.MC_DATE_FORMATS, optional: true }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
1312
- /** @nocollapse */ McCalendar.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: McCalendar, selector: "mc-calendar", inputs: { startAt: "startAt", selected: "selected", minDate: "minDate", maxDate: "maxDate", headerComponent: "headerComponent", startView: "startView", 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 }, { propertyName: "yearView", first: true, predicate: McYearView, descendants: true }, { propertyName: "multiYearView", first: true, predicate: McMultiYearView, descendants: true }], exportAs: ["mcCalendar"], usesOnChanges: true, ngImport: i0__namespace, template: "<ng-template [cdkPortalOutlet]=\"calendarHeaderPortal\"></ng-template>\n\n<div class=\"mc-calendar__content\" [ngSwitch]=\"currentView\">\n <mc-month-view\n *ngSwitchCase=\"'month'\"\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\n <mc-year-view\n *ngSwitchCase=\"'year'\"\n [(activeDate)]=\"activeDate\"\n [selected]=\"selected\"\n [dateFilter]=\"dateFilter\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n (monthSelected)=\"monthSelectedInYearView($event)\"\n (selectedChange)=\"goToDateInView($event, 'multi-year')\">\n </mc-year-view>\n\n <mc-multi-year-view\n *ngSwitchCase=\"'multi-year'\"\n [(activeDate)]=\"activeDate\"\n [selected]=\"selected\"\n [dateFilter]=\"dateFilter\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n (yearSelected)=\"yearSelectedInMultiYearView($event)\"\n (selectedChange)=\"goToDateInView($event, 'month')\">\n </mc-multi-year-view>\n</div>\n", styles: [".mc-calendar{display:block}.mc-calendar-header{display:flex;padding:16px 8px 12px;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__content{padding:0 8px 8px;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-spacer{flex:1 1 auto}.mc-calendar__period-button{min-width:0}.mc-calendar__period-button .mc-icon{vertical-align:baseline}.mc-calendar__previous-button:after{border-left-width:2px;border-left-width:var(--mc-datepicker-calendar-size-icon-border-width, 2px);transform:translate(2px) rotate(-45deg);transform:var(--mc-datepicker-calendar-size-icon-prev-icon-transform, translateX(2px) rotate(-45deg))}.mc-calendar__next-button:after{border-right-width:2px;border-right-width:var(--mc-datepicker-calendar-size-icon-border-width, 2px);transform:translate(-2px) rotate(45deg);transform:var(--mc-datepicker-calendar-size-icon-nex-icon-transform, translateX(-2px) rotate(45deg))}.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(12px - 2px);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 * 8px);left:calc(-1 * var(--mc-datepicker-calendar-size-padding-horizontal, 8px));right:calc(-1 * 8px);right:calc(-1 * var(--mc-datepicker-calendar-size-padding-horizontal, 8px));height:1px;height:var(--mc-datepicker-calendar-size-divider-width, 1px)}\n"], components: [{ type: McMonthView, selector: "mc-month-view", inputs: ["activeDate", "selected", "minDate", "maxDate", "dateFilter", "dateClass"], outputs: ["selectedChange", "userSelection", "activeDateChange"], exportAs: ["mcMonthView"] }, { type: McYearView, selector: "mc-year-view", inputs: ["activeDate", "selected", "minDate", "maxDate", "dateFilter"], outputs: ["selectedChange", "monthSelected", "activeDateChange"], exportAs: ["mcYearView"] }, { type: McMultiYearView, selector: "mc-multi-year-view", inputs: ["activeDate", "selected", "minDate", "maxDate", "dateFilter"], outputs: ["selectedChange", "yearSelected", "activeDateChange"], exportAs: ["mcMultiYearView"] }], directives: [{ type: i8__namespace.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { type: i1__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i1__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
1313
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McCalendar, decorators: [{
1314
- type: i0.Component,
1315
- args: [{
1316
- selector: 'mc-calendar',
1317
- exportAs: 'mcCalendar',
1318
- templateUrl: 'calendar.html',
1319
- styleUrls: ['calendar.scss'],
1320
- host: {
1321
- class: 'mc-calendar'
1322
- },
1323
- encapsulation: i0.ViewEncapsulation.None,
1324
- changeDetection: i0.ChangeDetectionStrategy.OnPush
1325
- }]
1326
- }], ctorParameters: function () {
1327
- return [{ type: McDatepickerIntl }, { type: i1__namespace$1.DateAdapter, decorators: [{
1328
- type: i0.Optional
1329
- }] }, { type: undefined, decorators: [{
1330
- type: i0.Optional
1331
- }, {
1332
- type: i0.Inject,
1333
- args: [i1$1.MC_DATE_FORMATS]
1334
- }] }, { type: i0__namespace.ChangeDetectorRef }];
1335
- }, propDecorators: { startAt: [{
1336
- type: i0.Input
1337
- }], selected: [{
1338
- type: i0.Input
1339
- }], minDate: [{
1340
- type: i0.Input
1341
- }], maxDate: [{
1342
- type: i0.Input
1343
- }], headerComponent: [{
1344
- type: i0.Input
1345
- }], startView: [{
1346
- type: i0.Input
1347
- }], dateFilter: [{
1348
- type: i0.Input
1349
- }], dateClass: [{
1350
- type: i0.Input
1351
- }], selectedChange: [{
1352
- type: i0.Output
1353
- }], yearSelected: [{
1354
- type: i0.Output
1355
- }], monthSelected: [{
1356
- type: i0.Output
1357
- }], userSelection: [{
1358
- type: i0.Output
1359
- }], monthView: [{
1360
- type: i0.ViewChild,
1361
- args: [McMonthView, { static: false }]
1362
- }], yearView: [{
1363
- type: i0.ViewChild,
1364
- args: [McYearView, { static: false }]
1365
- }], multiYearView: [{
1366
- type: i0.ViewChild,
1367
- args: [McMultiYearView, { static: false }]
1368
- }] } });
1369
-
1370
- /*! *****************************************************************************
1371
- Copyright (c) Microsoft Corporation.
1372
-
1373
- Permission to use, copy, modify, and/or distribute this software for any
1374
- purpose with or without fee is hereby granted.
1375
-
1376
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1377
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1378
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1379
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1380
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1381
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1382
- PERFORMANCE OF THIS SOFTWARE.
1383
- ***************************************************************************** */
1384
- /* global Reflect, Promise */
1385
- var extendStatics = function (d, b) {
1386
- extendStatics = Object.setPrototypeOf ||
1387
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
1388
- function (d, b) { for (var p in b)
1389
- if (Object.prototype.hasOwnProperty.call(b, p))
1390
- d[p] = b[p]; };
1391
- return extendStatics(d, b);
1392
- };
1393
- function __extends(d, b) {
1394
- if (typeof b !== "function" && b !== null)
1395
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
1396
- extendStatics(d, b);
1397
- function __() { this.constructor = d; }
1398
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1399
- }
1400
- var __assign = function () {
1401
- __assign = Object.assign || function __assign(t) {
1402
- for (var s, i = 1, n = arguments.length; i < n; i++) {
1403
- s = arguments[i];
1404
- for (var p in s)
1405
- if (Object.prototype.hasOwnProperty.call(s, p))
1406
- t[p] = s[p];
1407
- }
1408
- return t;
1409
- };
1410
- return __assign.apply(this, arguments);
1411
- };
1412
- function __rest(s, e) {
1413
- var t = {};
1414
- for (var p in s)
1415
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1416
- t[p] = s[p];
1417
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
1418
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1419
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1420
- t[p[i]] = s[p[i]];
1421
- }
1422
- return t;
1423
- }
1424
- function __decorate(decorators, target, key, desc) {
1425
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1426
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1427
- r = Reflect.decorate(decorators, target, key, desc);
1428
- else
1429
- for (var i = decorators.length - 1; i >= 0; i--)
1430
- if (d = decorators[i])
1431
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1432
- return c > 3 && r && Object.defineProperty(target, key, r), r;
1433
- }
1434
- function __param(paramIndex, decorator) {
1435
- return function (target, key) { decorator(target, key, paramIndex); };
1436
- }
1437
- function __metadata(metadataKey, metadataValue) {
1438
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
1439
- return Reflect.metadata(metadataKey, metadataValue);
1440
- }
1441
- function __awaiter(thisArg, _arguments, P, generator) {
1442
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1443
- return new (P || (P = Promise))(function (resolve, reject) {
1444
- function fulfilled(value) { try {
1445
- step(generator.next(value));
1446
- }
1447
- catch (e) {
1448
- reject(e);
1449
- } }
1450
- function rejected(value) { try {
1451
- step(generator["throw"](value));
1452
- }
1453
- catch (e) {
1454
- reject(e);
1455
- } }
1456
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1457
- step((generator = generator.apply(thisArg, _arguments || [])).next());
1458
- });
1459
- }
1460
- function __generator(thisArg, body) {
1461
- var _ = { label: 0, sent: function () { if (t[0] & 1)
1462
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
1463
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
1464
- function verb(n) { return function (v) { return step([n, v]); }; }
1465
- function step(op) {
1466
- if (f)
1467
- throw new TypeError("Generator is already executing.");
1468
- while (_)
1469
- try {
1470
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
1471
- return t;
1472
- if (y = 0, t)
1473
- op = [op[0] & 2, t.value];
1474
- switch (op[0]) {
1475
- case 0:
1476
- case 1:
1477
- t = op;
1478
- break;
1479
- case 4:
1480
- _.label++;
1481
- return { value: op[1], done: false };
1482
- case 5:
1483
- _.label++;
1484
- y = op[1];
1485
- op = [0];
1486
- continue;
1487
- case 7:
1488
- op = _.ops.pop();
1489
- _.trys.pop();
1490
- continue;
1491
- default:
1492
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
1493
- _ = 0;
1494
- continue;
1495
- }
1496
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
1497
- _.label = op[1];
1498
- break;
1499
- }
1500
- if (op[0] === 6 && _.label < t[1]) {
1501
- _.label = t[1];
1502
- t = op;
1503
- break;
1504
- }
1505
- if (t && _.label < t[2]) {
1506
- _.label = t[2];
1507
- _.ops.push(op);
1508
- break;
1509
- }
1510
- if (t[2])
1511
- _.ops.pop();
1512
- _.trys.pop();
1513
- continue;
1514
- }
1515
- op = body.call(thisArg, _);
1516
- }
1517
- catch (e) {
1518
- op = [6, e];
1519
- y = 0;
1520
- }
1521
- finally {
1522
- f = t = 0;
1523
- }
1524
- if (op[0] & 5)
1525
- throw op[1];
1526
- return { value: op[0] ? op[1] : void 0, done: true };
1527
- }
1528
- }
1529
- var __createBinding = Object.create ? (function (o, m, k, k2) {
1530
- if (k2 === undefined)
1531
- k2 = k;
1532
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
1533
- }) : (function (o, m, k, k2) {
1534
- if (k2 === undefined)
1535
- k2 = k;
1536
- o[k2] = m[k];
1537
- });
1538
- function __exportStar(m, o) {
1539
- for (var p in m)
1540
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
1541
- __createBinding(o, m, p);
1542
- }
1543
- function __values(o) {
1544
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
1545
- if (m)
1546
- return m.call(o);
1547
- if (o && typeof o.length === "number")
1548
- return {
1549
- next: function () {
1550
- if (o && i >= o.length)
1551
- o = void 0;
1552
- return { value: o && o[i++], done: !o };
1553
- }
1554
- };
1555
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
1556
- }
1557
- function __read(o, n) {
1558
- var m = typeof Symbol === "function" && o[Symbol.iterator];
1559
- if (!m)
1560
- return o;
1561
- var i = m.call(o), r, ar = [], e;
1562
- try {
1563
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
1564
- ar.push(r.value);
1565
- }
1566
- catch (error) {
1567
- e = { error: error };
1568
- }
1569
- finally {
1570
- try {
1571
- if (r && !r.done && (m = i["return"]))
1572
- m.call(i);
1573
- }
1574
- finally {
1575
- if (e)
1576
- throw e.error;
1577
- }
1578
- }
1579
- return ar;
1580
- }
1581
- /** @deprecated */
1582
- function __spread() {
1583
- for (var ar = [], i = 0; i < arguments.length; i++)
1584
- ar = ar.concat(__read(arguments[i]));
1585
- return ar;
1586
- }
1587
- /** @deprecated */
1588
- function __spreadArrays() {
1589
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
1590
- s += arguments[i].length;
1591
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
1592
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
1593
- r[k] = a[j];
1594
- return r;
1595
- }
1596
- function __spreadArray(to, from, pack) {
1597
- if (pack || arguments.length === 2)
1598
- for (var i = 0, l = from.length, ar; i < l; i++) {
1599
- if (ar || !(i in from)) {
1600
- if (!ar)
1601
- ar = Array.prototype.slice.call(from, 0, i);
1602
- ar[i] = from[i];
1603
- }
1604
- }
1605
- return to.concat(ar || Array.prototype.slice.call(from));
1606
- }
1607
- function __await(v) {
1608
- return this instanceof __await ? (this.v = v, this) : new __await(v);
1609
- }
1610
- function __asyncGenerator(thisArg, _arguments, generator) {
1611
- if (!Symbol.asyncIterator)
1612
- throw new TypeError("Symbol.asyncIterator is not defined.");
1613
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
1614
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
1615
- function verb(n) { if (g[n])
1616
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
1617
- function resume(n, v) { try {
1618
- step(g[n](v));
1619
- }
1620
- catch (e) {
1621
- settle(q[0][3], e);
1622
- } }
1623
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
1624
- function fulfill(value) { resume("next", value); }
1625
- function reject(value) { resume("throw", value); }
1626
- function settle(f, v) { if (f(v), q.shift(), q.length)
1627
- resume(q[0][0], q[0][1]); }
1628
- }
1629
- function __asyncDelegator(o) {
1630
- var i, p;
1631
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
1632
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
1633
- }
1634
- function __asyncValues(o) {
1635
- if (!Symbol.asyncIterator)
1636
- throw new TypeError("Symbol.asyncIterator is not defined.");
1637
- var m = o[Symbol.asyncIterator], i;
1638
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
1639
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
1640
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
1641
- }
1642
- function __makeTemplateObject(cooked, raw) {
1643
- if (Object.defineProperty) {
1644
- Object.defineProperty(cooked, "raw", { value: raw });
1645
- }
1646
- else {
1647
- cooked.raw = raw;
1648
- }
1649
- return cooked;
1650
- }
1651
- ;
1652
- var __setModuleDefault = Object.create ? (function (o, v) {
1653
- Object.defineProperty(o, "default", { enumerable: true, value: v });
1654
- }) : function (o, v) {
1655
- o["default"] = v;
1656
- };
1657
- function __importStar(mod) {
1658
- if (mod && mod.__esModule)
1659
- return mod;
1660
- var result = {};
1661
- if (mod != null)
1662
- for (var k in mod)
1663
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
1664
- __createBinding(result, mod, k);
1665
- __setModuleDefault(result, mod);
1666
- return result;
1667
- }
1668
- function __importDefault(mod) {
1669
- return (mod && mod.__esModule) ? mod : { default: mod };
1670
- }
1671
- function __classPrivateFieldGet(receiver, state, kind, f) {
1672
- if (kind === "a" && !f)
1673
- throw new TypeError("Private accessor was defined without a getter");
1674
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
1675
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
1676
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
1677
- }
1678
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
1679
- if (kind === "m")
1680
- throw new TypeError("Private method is not writable");
1681
- if (kind === "a" && !f)
1682
- throw new TypeError("Private accessor was defined without a setter");
1683
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
1684
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
1685
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
1686
- }
1687
-
1688
- // tslint:disable:naming-convention
1689
- var DateParts;
1690
- (function (DateParts) {
1691
- DateParts["year"] = "y";
1692
- DateParts["month"] = "m";
1693
- DateParts["day"] = "d";
1694
- })(DateParts || (DateParts = {}));
1695
- var MAX_YEAR = 9999;
1696
- var YEAR_LENGTH = 4;
1697
- var DateDigit = /** @class */ (function () {
1698
- function DateDigit(value, start, length) {
1699
- this.value = value;
1700
- this.start = start;
1701
- this.length = length;
1702
- this.maxDays = 31;
1703
- this.maxMonth = 12;
1704
- if (value === DateParts.day) {
1705
- this.parse = this.parseDay;
1706
- }
1707
- else if (value === DateParts.month) {
1708
- this.parse = this.parseMonth;
1709
- }
1710
- else if (value === DateParts.year) {
1711
- this.parse = this.parseYear;
1712
- }
1713
- }
1714
- Object.defineProperty(DateDigit.prototype, "end", {
1715
- get: function () {
1716
- return this.start + this.length;
1717
- },
1718
- enumerable: false,
1719
- configurable: true
1720
- });
1721
- Object.defineProperty(DateDigit.prototype, "isDay", {
1722
- get: function () {
1723
- return this.value === DateParts.day;
1724
- },
1725
- enumerable: false,
1726
- configurable: true
1727
- });
1728
- Object.defineProperty(DateDigit.prototype, "isMonth", {
1729
- get: function () {
1730
- return this.value === DateParts.month;
1731
- },
1732
- enumerable: false,
1733
- configurable: true
1734
- });
1735
- Object.defineProperty(DateDigit.prototype, "isYear", {
1736
- get: function () {
1737
- return this.value === DateParts.year;
1738
- },
1739
- enumerable: false,
1740
- configurable: true
1741
- });
1742
- Object.defineProperty(DateDigit.prototype, "fullName", {
1743
- get: function () {
1744
- if (this.isDay) {
1745
- return 'date';
1746
- }
1747
- if (this.isMonth) {
1748
- return 'month';
1749
- }
1750
- if (this.isYear) {
1751
- return 'year';
1752
- }
1753
- },
1754
- enumerable: false,
1755
- configurable: true
1756
- });
1757
- DateDigit.prototype.parseDay = function (value) {
1758
- var parsedValue = parseInt(value);
1759
- if (parsedValue === 0) {
1760
- return 1;
1761
- }
1762
- if (parsedValue > this.maxDays) {
1763
- return this.maxDays;
1764
- }
1765
- return parsedValue;
1766
- };
1767
- DateDigit.prototype.parseMonth = function (value) {
1768
- var parsedValue = parseInt(value);
1769
- if (parsedValue === 0) {
1770
- return 1;
1771
- }
1772
- if (parsedValue > this.maxMonth) {
1773
- return this.maxMonth;
1774
- }
1775
- return parsedValue;
1776
- };
1777
- DateDigit.prototype.parseYear = function (value) {
1778
- var parsedValue = parseInt(value);
1779
- if (parsedValue === 0) {
1780
- return 1;
1781
- }
1782
- if (parsedValue > MAX_YEAR) {
1783
- return parseInt(value.substring(0, YEAR_LENGTH));
1784
- }
1785
- return parsedValue;
1786
- };
1787
- return DateDigit;
1788
- }());
1789
- /** @docs-private */
1790
- var MC_DATEPICKER_VALUE_ACCESSOR = {
1791
- provide: forms.NG_VALUE_ACCESSOR,
1792
- useExisting: i0.forwardRef(function () { return McDatepickerInput; }),
1793
- multi: true
1794
- };
1795
- /** @docs-private */
1796
- var MC_DATEPICKER_VALIDATORS = {
1797
- provide: forms.NG_VALIDATORS,
1798
- useExisting: i0.forwardRef(function () { return McDatepickerInput; }),
1799
- multi: true
1800
- };
1801
- /**
1802
- * An event used for datepicker input and change events. We don't always have access to a native
1803
- * input or change event because the event may have been triggered by the user clicking on the
1804
- * calendar popup. For consistency, we always use McDatepickerInputEvent instead.
1805
- */
1806
- var McDatepickerInputEvent = /** @class */ (function () {
1807
- function McDatepickerInputEvent(
1808
- /** Reference to the datepicker input component that emitted the event. */
1809
- target,
1810
- /** Reference to the native input element associated with the datepicker input. */
1811
- targetElement) {
1812
- this.target = target;
1813
- this.targetElement = targetElement;
1814
- this.value = this.target.value;
1815
- }
1816
- return McDatepickerInputEvent;
1817
- }());
1818
- var uniqueComponentIdSuffix = 0;
1819
- /** Directive used to connect an input to a McDatepicker. */
1820
- var McDatepickerInput = /** @class */ (function () {
1821
- function McDatepickerInput(elementRef, renderer, dateAdapter, dateFormats) {
1822
- var _this = this;
1823
- this.elementRef = elementRef;
1824
- this.renderer = renderer;
1825
- this.dateAdapter = dateAdapter;
1826
- this.dateFormats = dateFormats;
1827
- this.stateChanges = new rxjs.Subject();
1828
- this.controlType = 'datepicker';
1829
- this.focused = false;
1830
- /** Emits when the value changes (either due to user input or programmatic change). */
1831
- this.valueChange = new i0.EventEmitter();
1832
- /** Emits when the disabled state has changed */
1833
- this.disabledChange = new i0.EventEmitter();
1834
- this._disabled = false;
1835
- this.incorrectInput = new i0.EventEmitter();
1836
- /** Emits when a `change` event is fired on this `<input>`. */
1837
- this.dateChange = new i0.EventEmitter();
1838
- /** Emits when an `input` event is fired on this `<input>`. */
1839
- this.dateInput = new i0.EventEmitter();
1840
- this.uid = "mc-datepicker-" + uniqueComponentIdSuffix++;
1841
- this.datepickerSubscription = rxjs.Subscription.EMPTY;
1842
- this.localeSubscription = rxjs.Subscription.EMPTY;
1843
- /** Whether the last value set on the input was valid. */
1844
- this.lastValueValid = false;
1845
- this.onTouched = function () { };
1846
- this.onInput = function () {
1847
- _this.correctCursorPosition();
1848
- var formattedValue = _this.replaceSymbols(_this.viewValue);
1849
- var newTimeObj = _this.getDateFromString(formattedValue);
1850
- _this.lastValueValid = !!newTimeObj;
1851
- if (!newTimeObj) {
1852
- if (!_this.viewValue) {
1853
- _this._value = null;
1854
- _this.cvaOnChange(null);
1855
- }
1856
- _this.control.updateValueAndValidity({ emitEvent: false });
1857
- return;
1858
- }
1859
- _this.setViewValue(_this.getTimeStringFromDate(newTimeObj, _this.dateFormats.dateInput), true);
1860
- _this.selectNextDigitByCursor(_this.selectionStart);
1861
- _this.updateValue(newTimeObj);
1862
- };
1863
- this.parseOnBlur = function () {
1864
- if (!_this.viewValue) {
1865
- return null;
1866
- }
1867
- var date = _this.getDefaultValue();
1868
- var viewDigits = _this.viewValue
1869
- .split(_this.separator)
1870
- .map(function (value) { return value; })
1871
- .filter(function (value) { return value; });
1872
- var _d = __read(viewDigits, 3), firsViewDigit = _d[0], secondViewDigit = _d[1], thirdViewDigit = _d[2];
1873
- // tslint:disable-next-line:no-magic-numbers
1874
- if (viewDigits.length !== 3) {
1875
- _this.lastValueValid = false;
1876
- _this._value = null;
1877
- return setTimeout(function () { return _this.control.updateValueAndValidity(); });
1878
- }
1879
- date[_this.firstDigit.fullName] = _this.firstDigit.parse(firsViewDigit);
1880
- date[_this.secondDigit.fullName] = _this.secondDigit.parse(secondViewDigit);
1881
- date[_this.thirdDigit.fullName] = _this.thirdDigit.parse(thirdViewDigit);
1882
- var _e = __read([_this.firstDigit, _this.secondDigit, _this.thirdDigit]
1883
- .reduce(function (acc, digit, index) { return digit.value === DateParts.year ? [digit, viewDigits[index]] : acc; }, []), 2), digitWithYear = _e[0], viewDigitWithYear = _e[1];
1884
- // tslint:disable-next-line:no-magic-numbers
1885
- if (viewDigitWithYear.length < 3) {
1886
- // tslint:disable-next-line:no-magic-numbers
1887
- date.year += date.year < 30 ? 2000 : 1900;
1888
- }
1889
- else if (viewDigitWithYear.length < digitWithYear.length) {
1890
- _this.lastValueValid = false;
1891
- _this._value = null;
1892
- return setTimeout(function () { return _this.control.updateValueAndValidity(); });
1893
- }
1894
- var newTimeObj = _this.getValidDateOrNull(_this.dateAdapter.createDateTime(date.year, date.month - 1, date.date, date.hours, date.minutes, date.seconds, date.milliseconds));
1895
- if (!newTimeObj) {
1896
- _this.lastValueValid = false;
1897
- _this._value = null;
1898
- _this.cvaOnChange(null);
1899
- return setTimeout(function () { return _this.control.updateValueAndValidity(); });
1900
- }
1901
- _this.lastValueValid = !!newTimeObj;
1902
- _this.setViewValue(_this.getTimeStringFromDate(newTimeObj, _this.dateFormats.dateInput), true);
1903
- _this.updateValue(newTimeObj);
1904
- };
1905
- this.updateLocaleParams = function () {
1906
- _this.setFormat(_this.dateFormats.dateInput);
1907
- _this.value = _this.value;
1908
- };
1909
- this.cvaOnChange = function () { };
1910
- this.validatorOnChange = function () { };
1911
- /** The form control validator for whether the input parses. */
1912
- this.parseValidator = function () {
1913
- return _this.focused ||
1914
- _this.empty ||
1915
- _this.lastValueValid ? null : { mcDatepickerParse: { text: _this.elementRef.nativeElement.value } };
1916
- };
1917
- /** The form control validator for the min date. */
1918
- this.minValidator = function (control) {
1919
- var controlValue = _this.getValidDateOrNull(_this.dateAdapter.deserialize(control.value));
1920
- return (!_this.min || !controlValue ||
1921
- _this.dateAdapter.compareDate(_this.min, controlValue) <= 0) ?
1922
- null : { mcDatepickerMin: { min: _this.min, actual: controlValue } };
1923
- };
1924
- /** The form control validator for the max date. */
1925
- this.maxValidator = function (control) {
1926
- var controlValue = _this.getValidDateOrNull(_this.dateAdapter.deserialize(control.value));
1927
- return (!_this.max || !controlValue ||
1928
- _this.dateAdapter.compareDate(_this.max, controlValue) >= 0) ?
1929
- null : { mcDatepickerMax: { max: _this.max, actual: controlValue } };
1930
- };
1931
- /** The form control validator for the date filter. */
1932
- this.filterValidator = function (control) {
1933
- var controlValue = _this.getValidDateOrNull(_this.dateAdapter.deserialize(control.value));
1934
- return !_this.dateFilter || !controlValue || _this.dateFilter(controlValue) ?
1935
- null : { mcDatepickerFilter: true };
1936
- };
1937
- this.validator = forms.Validators.compose([
1938
- this.parseValidator,
1939
- this.minValidator,
1940
- this.maxValidator,
1941
- this.filterValidator
1942
- ]);
1943
- if (!this.dateAdapter) {
1944
- throw createMissingDateImplError('DateAdapter');
1945
- }
1946
- if (!this.dateFormats) {
1947
- throw createMissingDateImplError('MC_DATE_FORMATS');
1948
- }
1949
- this.setFormat(dateFormats.dateInput);
1950
- this.localeSubscription = dateAdapter.localeChanges
1951
- .subscribe(this.updateLocaleParams);
1952
- }
1953
- Object.defineProperty(McDatepickerInput.prototype, "required", {
1954
- get: function () {
1955
- return this._required;
1956
- },
1957
- set: function (value) {
1958
- this._required = coercion.coerceBooleanProperty(value);
1959
- },
1960
- enumerable: false,
1961
- configurable: true
1962
- });
1963
- Object.defineProperty(McDatepickerInput.prototype, "mcDatepicker", {
1964
- /** The datepicker that this input is associated with. */
1965
- set: function (value) {
1966
- var _this = this;
1967
- if (!value) {
1968
- return;
1969
- }
1970
- this.datepicker = value;
1971
- this.datepicker.registerInput(this);
1972
- this.datepickerSubscription.unsubscribe();
1973
- this.datepickerSubscription = this.datepicker.selectedChanged
1974
- .subscribe(function (selected) {
1975
- _this.value = selected;
1976
- _this.cvaOnChange(selected);
1977
- _this.onTouched();
1978
- _this.dateChange.emit(new McDatepickerInputEvent(_this, _this.elementRef.nativeElement));
1979
- });
1980
- },
1981
- enumerable: false,
1982
- configurable: true
1983
- });
1984
- Object.defineProperty(McDatepickerInput.prototype, "mcDatepickerFilter", {
1985
- /** Function that can be used to filter out dates within the datepicker. */
1986
- set: function (value) {
1987
- this.dateFilter = value;
1988
- this.validatorOnChange();
1989
- },
1990
- enumerable: false,
1991
- configurable: true
1992
- });
1993
- Object.defineProperty(McDatepickerInput.prototype, "value", {
1994
- /** The value of the input. */
1995
- get: function () {
1996
- return this._value;
1997
- },
1998
- set: function (value) {
1999
- var newValue = this.dateAdapter.deserialize(value);
2000
- this.lastValueValid = !newValue || this.dateAdapter.isValid(newValue);
2001
- newValue = this.getValidDateOrNull(newValue);
2002
- var oldDate = this.value;
2003
- this._value = newValue;
2004
- this.formatValue(newValue);
2005
- if (!this.dateAdapter.sameDate(oldDate, newValue)) {
2006
- this.valueChange.emit(newValue);
2007
- }
2008
- },
2009
- enumerable: false,
2010
- configurable: true
2011
- });
2012
- Object.defineProperty(McDatepickerInput.prototype, "min", {
2013
- /** The minimum valid date. */
2014
- get: function () {
2015
- return this._min;
2016
- },
2017
- set: function (value) {
2018
- this._min = this.getValidDateOrNull(this.dateAdapter.deserialize(value));
2019
- this.validatorOnChange();
2020
- },
2021
- enumerable: false,
2022
- configurable: true
2023
- });
2024
- Object.defineProperty(McDatepickerInput.prototype, "max", {
2025
- /** The maximum valid date. */
2026
- get: function () {
2027
- return this._max;
2028
- },
2029
- set: function (value) {
2030
- this._max = this.getValidDateOrNull(this.dateAdapter.deserialize(value));
2031
- this.validatorOnChange();
2032
- },
2033
- enumerable: false,
2034
- configurable: true
2035
- });
2036
- Object.defineProperty(McDatepickerInput.prototype, "disabled", {
2037
- /** Whether the datepicker-input is disabled. */
2038
- get: function () {
2039
- return this._disabled;
2040
- },
2041
- set: function (value) {
2042
- var newValue = coercion.coerceBooleanProperty(value);
2043
- var element = this.elementRef.nativeElement;
2044
- if (this._disabled !== newValue) {
2045
- this._disabled = newValue;
2046
- this.disabledChange.emit(newValue);
2047
- }
2048
- // We need to null check the `blur` method, because it's undefined during SSR.
2049
- if (newValue && element.blur) {
2050
- // Normally, native input elements automatically blur if they turn disabled. This behavior
2051
- // is problematic, because it would mean that it triggers another change detection cycle,
2052
- // which then causes a changed after checked error if the input element was focused before.
2053
- element.blur();
2054
- }
2055
- },
2056
- enumerable: false,
2057
- configurable: true
2058
- });
2059
- Object.defineProperty(McDatepickerInput.prototype, "id", {
2060
- get: function () {
2061
- return this._id;
2062
- },
2063
- set: function (value) {
2064
- this._id = value || this.uid;
2065
- },
2066
- enumerable: false,
2067
- configurable: true
2068
- });
2069
- Object.defineProperty(McDatepickerInput.prototype, "mcValidationTooltip", {
2070
- set: function (tooltip) {
2071
- if (!tooltip) {
2072
- return;
2073
- }
2074
- tooltip.enterDelay = core.validationTooltipShowDelay;
2075
- tooltip.trigger = 'manual';
2076
- tooltip.initListeners();
2077
- this.incorrectInput.subscribe(function () {
2078
- if (tooltip.isOpen) {
2079
- return;
2080
- }
2081
- tooltip.show();
2082
- setTimeout(function () { return tooltip.hide(); }, core.validationTooltipHideDelay);
2083
- });
2084
- },
2085
- enumerable: false,
2086
- configurable: true
2087
- });
2088
- Object.defineProperty(McDatepickerInput.prototype, "empty", {
2089
- get: function () {
2090
- return !this.viewValue && !this.isBadInput();
2091
- },
2092
- enumerable: false,
2093
- configurable: true
2094
- });
2095
- Object.defineProperty(McDatepickerInput.prototype, "viewValue", {
2096
- get: function () {
2097
- return this.elementRef.nativeElement.value;
2098
- },
2099
- enumerable: false,
2100
- configurable: true
2101
- });
2102
- Object.defineProperty(McDatepickerInput.prototype, "ngControl", {
2103
- get: function () {
2104
- return this.control;
2105
- },
2106
- enumerable: false,
2107
- configurable: true
2108
- });
2109
- Object.defineProperty(McDatepickerInput.prototype, "isReadOnly", {
2110
- get: function () {
2111
- return this.elementRef.nativeElement.readOnly;
2112
- },
2113
- enumerable: false,
2114
- configurable: true
2115
- });
2116
- Object.defineProperty(McDatepickerInput.prototype, "selectionStart", {
2117
- get: function () {
2118
- return this.elementRef.nativeElement.selectionStart;
2119
- },
2120
- set: function (value) {
2121
- this.elementRef.nativeElement.selectionStart = value;
2122
- },
2123
- enumerable: false,
2124
- configurable: true
2125
- });
2126
- Object.defineProperty(McDatepickerInput.prototype, "selectionEnd", {
2127
- get: function () {
2128
- return this.elementRef.nativeElement.selectionEnd;
2129
- },
2130
- set: function (value) {
2131
- this.elementRef.nativeElement.selectionEnd = value;
2132
- },
2133
- enumerable: false,
2134
- configurable: true
2135
- });
2136
- McDatepickerInput.prototype.onContainerClick = function () {
2137
- this.focus();
2138
- };
2139
- McDatepickerInput.prototype.focus = function () {
2140
- this.elementRef.nativeElement.focus();
2141
- };
2142
- McDatepickerInput.prototype.focusChanged = function (isFocused) {
2143
- if (isFocused !== this.focused) {
2144
- this.focused = isFocused;
2145
- this.onTouched();
2146
- this.stateChanges.next();
2147
- }
2148
- };
2149
- McDatepickerInput.prototype.ngOnDestroy = function () {
2150
- this.datepickerSubscription.unsubscribe();
2151
- this.localeSubscription.unsubscribe();
2152
- this.valueChange.complete();
2153
- this.disabledChange.complete();
2154
- };
2155
- /** @docs-private */
2156
- McDatepickerInput.prototype.registerOnValidatorChange = function (fn) {
2157
- this.validatorOnChange = fn;
2158
- };
2159
- /** @docs-private */
2160
- McDatepickerInput.prototype.validate = function (control) {
2161
- this.setControl(control);
2162
- return this.validator ? this.validator(control) : null;
2163
- };
2164
- // Implemented as part of ControlValueAccessor.
2165
- McDatepickerInput.prototype.writeValue = function (value) {
2166
- this.value = value;
2167
- };
2168
- // Implemented as part of ControlValueAccessor.
2169
- McDatepickerInput.prototype.registerOnChange = function (fn) {
2170
- this.cvaOnChange = fn;
2171
- };
2172
- // Implemented as part of ControlValueAccessor.
2173
- McDatepickerInput.prototype.registerOnTouched = function (fn) {
2174
- this.onTouched = fn;
2175
- };
2176
- // Implemented as part of ControlValueAccessor.
2177
- McDatepickerInput.prototype.setDisabledState = function (isDisabled) {
2178
- this.disabled = isDisabled;
2179
- };
2180
- McDatepickerInput.prototype.onKeyDown = function (event) {
2181
- var _a;
2182
- if (this.isReadOnly) {
2183
- return;
2184
- }
2185
- // tslint:disable-next-line: deprecation
2186
- var keyCode = event.keyCode;
2187
- if (this.isLetterKey(event)) {
2188
- event.preventDefault();
2189
- this.incorrectInput.emit();
2190
- }
2191
- else if (this.isKeyForOpen(event)) {
2192
- event.preventDefault();
2193
- (_a = this.datepicker) === null || _a === void 0 ? void 0 : _a.open();
2194
- }
2195
- else if (this.isKeyForClose(event)) {
2196
- event.preventDefault();
2197
- this.datepicker.close();
2198
- }
2199
- else if (keyCode === keycodes.TAB) {
2200
- this.datepicker.close(false);
2201
- }
2202
- else if (this.isKeyForByPass(event)) {
2203
- return;
2204
- }
2205
- else if (keyCode === keycodes.SPACE) {
2206
- this.spaceKeyHandler(event);
2207
- }
2208
- else if ([keycodes.UP_ARROW, keycodes.DOWN_ARROW].includes(keyCode)) {
2209
- event.preventDefault();
2210
- this.verticalArrowKeyHandler(keyCode);
2211
- }
2212
- else if ([keycodes.LEFT_ARROW, keycodes.RIGHT_ARROW, keycodes.HOME, keycodes.PAGE_UP, keycodes.END, keycodes.PAGE_DOWN].includes(keyCode)) {
2213
- event.preventDefault();
2214
- this.changeCaretPosition(keyCode);
2215
- }
2216
- else if (/^\D$/.test(event.key)) {
2217
- event.preventDefault();
2218
- var newValue = this.getNewValue(event.key, this.selectionStart);
2219
- var formattedValue = this.replaceSymbols(newValue);
2220
- if (newValue !== formattedValue) {
2221
- this.setViewValue(formattedValue, true);
2222
- setTimeout(this.onInput);
2223
- }
2224
- else {
2225
- this.incorrectInput.emit();
2226
- }
2227
- }
2228
- else {
2229
- setTimeout(this.onInput);
2230
- }
2231
- };
2232
- McDatepickerInput.prototype.onChange = function () {
2233
- this.dateChange.emit(new McDatepickerInputEvent(this, this.elementRef.nativeElement));
2234
- };
2235
- /** Handles blur events on the input. */
2236
- McDatepickerInput.prototype.onBlur = function () {
2237
- // Reformat the input only if we have a valid value.
2238
- this.parseOnBlur();
2239
- this.focusChanged(false);
2240
- };
2241
- McDatepickerInput.prototype.onPaste = function ($event) {
2242
- var _a, _b, _c;
2243
- $event.preventDefault();
2244
- var rawValue = $event.clipboardData.getData('text');
2245
- var match = rawValue.match(/^(?<first>\d+)\W(?<second>\d+)\W(?<third>\d+)$/);
2246
- 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)) {
2247
- this.setViewValue(rawValue);
2248
- return rawValue;
2249
- }
2250
- var value = [match.groups.first, match.groups.second, match.groups.third].join(this.separator);
2251
- var newTimeObj = this.getDateFromString(value);
2252
- if (!newTimeObj) {
2253
- this.setViewValue(value);
2254
- return value;
2255
- }
2256
- this.setViewValue(this.getTimeStringFromDate(newTimeObj, this.dateFormats.dateInput));
2257
- this.updateValue(newTimeObj);
2258
- };
2259
- McDatepickerInput.prototype.toISO8601 = function (value) {
2260
- return this.dateAdapter.toIso8601(value);
2261
- };
2262
- McDatepickerInput.prototype.setFormat = function (format) {
2263
- var _this = this;
2264
- this.separator = format.match(/[aA-zZ]+(?<separator>\W|\D)[aA-zZ]+/).groups.separator;
2265
- this.separatorPositions = format
2266
- .split('')
2267
- .reduce(function (acc, item, index) { return _this.separator === item ? __spreadArray(__spreadArray([], __read(acc)), [index + 1]) : acc; }, []);
2268
- this.getDigitPositions(format);
2269
- };
2270
- McDatepickerInput.prototype.updateValue = function (newValue) {
2271
- if (!this.dateAdapter.sameDate(newValue, this.value)) {
2272
- this._value = newValue;
2273
- this.cvaOnChange(newValue);
2274
- this.valueChange.emit(newValue);
2275
- this.dateInput.emit(new McDatepickerInputEvent(this, this.elementRef.nativeElement));
2276
- }
2277
- this.control.updateValueAndValidity({ emitEvent: false });
2278
- };
2279
- McDatepickerInput.prototype.isKeyForClose = function (event) {
2280
- // tslint:disable-next-line: deprecation
2281
- return (event.altKey && event.keyCode === keycodes.UP_ARROW) || event.keyCode === keycodes.ESCAPE;
2282
- };
2283
- McDatepickerInput.prototype.isKeyForOpen = function (event) {
2284
- // tslint:disable-next-line: deprecation
2285
- return event.altKey && event.keyCode === keycodes.DOWN_ARROW;
2286
- };
2287
- McDatepickerInput.prototype.isLetterKey = function (event) {
2288
- return keycodes.isLetterKey(event) && !event.ctrlKey && !event.metaKey;
2289
- };
2290
- McDatepickerInput.prototype.isKeyForByPass = function (event) {
2291
- // tslint:disable-next-line: deprecation
2292
- return (keycodes.hasModifierKey(event) && (keycodes.isVerticalMovement(event.keyCode) || keycodes.isHorizontalMovement(event.keyCode))) ||
2293
- event.ctrlKey ||
2294
- event.metaKey;
2295
- };
2296
- McDatepickerInput.prototype.spaceKeyHandler = function (event) {
2297
- event.preventDefault();
2298
- if (this.selectionStart === this.selectionEnd) {
2299
- var value = this.getNewValue(event.key, this.selectionStart);
2300
- this.setViewValue(value);
2301
- setTimeout(this.onInput);
2302
- }
2303
- else if (this.selectionStart !== this.selectionEnd) {
2304
- this.selectNextDigit(this.selectionStart, true);
2305
- }
2306
- };
2307
- McDatepickerInput.prototype.getNewValue = function (key, position) {
2308
- return [this.viewValue.slice(0, position), key, this.viewValue.slice(position)].join('');
2309
- };
2310
- McDatepickerInput.prototype.setViewValue = function (value, savePosition) {
2311
- if (savePosition === void 0) { savePosition = false; }
2312
- if (savePosition) {
2313
- var selectionStart = this.selectionStart;
2314
- var selectionEnd = this.selectionEnd;
2315
- this.renderer.setProperty(this.elementRef.nativeElement, 'value', value);
2316
- this.selectionStart = selectionStart;
2317
- this.selectionEnd = selectionEnd;
2318
- }
2319
- else {
2320
- this.renderer.setProperty(this.elementRef.nativeElement, 'value', value);
2321
- }
2322
- };
2323
- McDatepickerInput.prototype.replaceSymbols = function (value) {
2324
- return value
2325
- .split(this.separator)
2326
- .map(function (part) { return part.replace(/^([0-9]+)\W$/, '0$1'); })
2327
- .join(this.separator);
2328
- };
2329
- McDatepickerInput.prototype.getDateFromString = function (timeString) {
2330
- if (!timeString || timeString.length < this.firstDigit.length) {
2331
- return null;
2332
- }
2333
- var date = this.getDefaultValue();
2334
- var viewDigits = timeString
2335
- .split(this.separator)
2336
- .map(function (value) { return value; });
2337
- var _d = __read(viewDigits, 3), firsViewDigit = _d[0], secondViewDigit = _d[1], thirdViewDigit = _d[2];
2338
- if (viewDigits.length === 1) {
2339
- if (firsViewDigit.length < this.firstDigit.length) {
2340
- return null;
2341
- }
2342
- date[this.firstDigit.fullName] = this.firstDigit.parse(firsViewDigit);
2343
- date.month = 1;
2344
- // tslint:disable-next-line:no-magic-numbers
2345
- }
2346
- else if (viewDigits.length === 2) {
2347
- if (firsViewDigit.length < this.firstDigit.length || secondViewDigit.length < this.secondDigit.length) {
2348
- return null;
2349
- }
2350
- date[this.firstDigit.fullName] = this.firstDigit.parse(firsViewDigit);
2351
- date[this.secondDigit.fullName] = this.secondDigit.parse(secondViewDigit);
2352
- // tslint:disable-next-line:no-magic-numbers
2353
- }
2354
- else if (viewDigits.length === 3) {
2355
- if (firsViewDigit.length < this.firstDigit.length ||
2356
- secondViewDigit.length < this.secondDigit.length ||
2357
- thirdViewDigit.length < this.thirdDigit.length) {
2358
- return null;
2359
- }
2360
- date[this.firstDigit.fullName] = this.firstDigit.parse(firsViewDigit);
2361
- date[this.secondDigit.fullName] = this.secondDigit.parse(secondViewDigit);
2362
- date[this.thirdDigit.fullName] = this.thirdDigit.parse(thirdViewDigit);
2363
- }
2364
- else {
2365
- return null;
2366
- }
2367
- return this.getValidDateOrNull(this.dateAdapter.createDateTime(date.year, date.month - 1, date.date, date.hours, date.minutes, date.seconds, date.milliseconds));
2368
- };
2369
- McDatepickerInput.prototype.getDefaultValue = function () {
2370
- var defaultValue = this.value || this.dateAdapter.today();
2371
- return {
2372
- year: this.dateAdapter.getYear(defaultValue),
2373
- month: this.dateAdapter.getMonth(defaultValue),
2374
- date: this.dateAdapter.getDate(defaultValue),
2375
- hours: this.dateAdapter.getHours(defaultValue),
2376
- minutes: this.dateAdapter.getMinutes(defaultValue),
2377
- seconds: this.dateAdapter.getSeconds(defaultValue),
2378
- milliseconds: this.dateAdapter.getMilliseconds(defaultValue)
2379
- };
2380
- };
2381
- McDatepickerInput.prototype.getTimeStringFromDate = function (value, timeFormat) {
2382
- if (!value || !this.dateAdapter.isValid(value)) {
2383
- return '';
2384
- }
2385
- return this.dateAdapter.format(value, timeFormat);
2386
- };
2387
- McDatepickerInput.prototype.getDateEditMetrics = function (cursorPosition) {
2388
- var e_1, _d;
2389
- try {
2390
- for (var _e = __values([this.firstDigit, this.secondDigit, this.thirdDigit]), _f = _e.next(); !_f.done; _f = _e.next()) {
2391
- var digit = _f.value;
2392
- if (cursorPosition >= digit.start && cursorPosition <= digit.end) {
2393
- return [digit.value, digit.start, digit.end];
2394
- }
2395
- }
2396
- }
2397
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
2398
- finally {
2399
- try {
2400
- if (_f && !_f.done && (_d = _e.return)) _d.call(_e);
2401
- }
2402
- finally { if (e_1) throw e_1.error; }
2403
- }
2404
- return [this.thirdDigit.value, this.thirdDigit.start, this.thirdDigit.end];
2405
- };
2406
- McDatepickerInput.prototype.incrementDate = function (dateVal, whatToIncrement) {
2407
- var year = this.dateAdapter.getYear(dateVal);
2408
- var month = this.dateAdapter.getMonth(dateVal);
2409
- var day = this.dateAdapter.getDate(dateVal);
2410
- switch (whatToIncrement) {
2411
- case DateParts.day:
2412
- day++;
2413
- if (day > this.dateAdapter.getNumDaysInMonth(dateVal)) {
2414
- day = 1;
2415
- }
2416
- break;
2417
- case DateParts.month:
2418
- month++;
2419
- // tslint:disable-next-line:no-magic-numbers
2420
- if (month > 11) {
2421
- month = 0;
2422
- }
2423
- var lastDay = this.getLastDayFor(year, month);
2424
- if (day > lastDay) {
2425
- day = lastDay;
2426
- }
2427
- break;
2428
- case DateParts.year:
2429
- year++;
2430
- if (year > MAX_YEAR) {
2431
- year = 1;
2432
- }
2433
- break;
2434
- default:
2435
- }
2436
- return this.createDate(year, month, day);
2437
- };
2438
- McDatepickerInput.prototype.getLastDayFor = function (year, month) {
2439
- return this.dateAdapter.getNumDaysInMonth(this.createDate(year, month, 1));
2440
- };
2441
- McDatepickerInput.prototype.decrementDate = function (dateVal, whatToDecrement) {
2442
- var year = this.dateAdapter.getYear(dateVal);
2443
- var month = this.dateAdapter.getMonth(dateVal);
2444
- var day = this.dateAdapter.getDate(dateVal);
2445
- switch (whatToDecrement) {
2446
- case DateParts.day:
2447
- day--;
2448
- if (day < 1) {
2449
- day = this.dateAdapter.getNumDaysInMonth(dateVal);
2450
- }
2451
- break;
2452
- case DateParts.month:
2453
- month--;
2454
- if (month < 0) {
2455
- // tslint:disable-next-line:no-magic-numbers
2456
- month = 11;
2457
- }
2458
- var lastDay = this.getLastDayFor(year, month);
2459
- if (day > lastDay) {
2460
- day = lastDay;
2461
- }
2462
- break;
2463
- case DateParts.year:
2464
- year--;
2465
- if (year < 1) {
2466
- year = MAX_YEAR;
2467
- }
2468
- break;
2469
- default:
2470
- }
2471
- return this.createDate(year, month, day);
2472
- };
2473
- McDatepickerInput.prototype.verticalArrowKeyHandler = function (keyCode) {
2474
- if (!this.value) {
2475
- return;
2476
- }
2477
- var changedTime;
2478
- var _d = __read(this.getDateEditMetrics(this.selectionStart), 3), modifiedTimePart = _d[0], selectionStart = _d[1], selectionEnd = _d[2];
2479
- if (keyCode === keycodes.UP_ARROW) {
2480
- changedTime = this.incrementDate(this.value, modifiedTimePart);
2481
- }
2482
- if (keyCode === keycodes.DOWN_ARROW) {
2483
- changedTime = this.decrementDate(this.value, modifiedTimePart);
2484
- }
2485
- this.value = changedTime;
2486
- this.selectionStart = selectionStart;
2487
- this.selectionEnd = selectionEnd;
2488
- this.cvaOnChange(changedTime);
2489
- this.onChange();
2490
- this.stateChanges.next();
2491
- };
2492
- McDatepickerInput.prototype.changeCaretPosition = function (keyCode) {
2493
- if (!this.value) {
2494
- return;
2495
- }
2496
- var cursorPos = this.selectionStart;
2497
- if ([keycodes.HOME, keycodes.PAGE_UP].includes(keyCode)) {
2498
- cursorPos = 0;
2499
- }
2500
- else if ([keycodes.END, keycodes.PAGE_DOWN].includes(keyCode)) {
2501
- cursorPos = this.viewValue.length;
2502
- }
2503
- else if (keyCode === keycodes.LEFT_ARROW) {
2504
- cursorPos = cursorPos === 0 ? this.viewValue.length : cursorPos - 1;
2505
- }
2506
- else if (keyCode === keycodes.RIGHT_ARROW) {
2507
- var nextSeparatorPos = this.viewValue.indexOf(this.separator, cursorPos);
2508
- cursorPos = nextSeparatorPos ? nextSeparatorPos + 1 : 0;
2509
- }
2510
- this.selectDigitByCursor(cursorPos);
2511
- };
2512
- McDatepickerInput.prototype.selectDigitByCursor = function (cursorPos) {
2513
- var _this = this;
2514
- setTimeout(function () {
2515
- var _d = __read(_this.getDateEditMetrics(cursorPos), 3), selectionStart = _d[1], selectionEnd = _d[2];
2516
- _this.selectionStart = selectionStart;
2517
- _this.selectionEnd = selectionEnd;
2518
- });
2519
- };
2520
- McDatepickerInput.prototype.selectNextDigitByCursor = function (cursorPos) {
2521
- var _this = this;
2522
- setTimeout(function () {
2523
- var _d = __read(_this.getDateEditMetrics(cursorPos), 3), endPositionOfCurrentDigit = _d[2];
2524
- var _e = __read(_this.getDateEditMetrics(endPositionOfCurrentDigit + 1), 3), selectionStart = _e[1], selectionEnd = _e[2];
2525
- _this.selectionStart = selectionStart;
2526
- _this.selectionEnd = selectionEnd;
2527
- });
2528
- };
2529
- McDatepickerInput.prototype.selectNextDigit = function (cursorPos, cycle) {
2530
- var _this = this;
2531
- if (cycle === void 0) { cycle = false; }
2532
- setTimeout(function () {
2533
- var lastValue = cycle ? 0 : cursorPos;
2534
- var nextSeparatorPos = _this.viewValue.indexOf(_this.separator, cursorPos);
2535
- var newCursorPos = nextSeparatorPos > 0 ? nextSeparatorPos + 1 : lastValue;
2536
- var _d = __read(_this.getDateEditMetrics(newCursorPos), 3), selectionStart = _d[1], selectionEnd = _d[2];
2537
- _this.selectionStart = selectionStart;
2538
- _this.selectionEnd = selectionEnd;
2539
- });
2540
- };
2541
- /** Checks whether the input is invalid based on the native validation. */
2542
- McDatepickerInput.prototype.isBadInput = function () {
2543
- var validity = this.elementRef.nativeElement.validity;
2544
- return validity && validity.badInput;
2545
- };
2546
- /** Formats a value and sets it on the input element. */
2547
- McDatepickerInput.prototype.formatValue = function (value) {
2548
- var formattedValue = value ? this.dateAdapter.format(value, this.dateFormats.dateInput) : '';
2549
- this.setViewValue(formattedValue);
2550
- };
2551
- /**
2552
- * @param obj The object to check.
2553
- * @returns The given object if it is both a date instance and valid, otherwise null.
2554
- */
2555
- McDatepickerInput.prototype.getValidDateOrNull = function (obj) {
2556
- return (this.dateAdapter.isDateInstance(obj) && this.dateAdapter.isValid(obj)) ? obj : null;
2557
- };
2558
- McDatepickerInput.prototype.setControl = function (control) {
2559
- if (!this.control) {
2560
- this.control = control;
2561
- }
2562
- };
2563
- McDatepickerInput.prototype.getDigitPositions = function (format) {
2564
- var _this = this;
2565
- var formatInLowerCase = format.toLowerCase();
2566
- formatInLowerCase
2567
- .split('')
2568
- .reduce(function (_d, value, index, arr) {
2569
- var prev = _d.prev, length = _d.length, start = _d.start;
2570
- if (value === _this.separator || (arr.length - 1) === index) {
2571
- if (!_this.firstDigit) {
2572
- _this.firstDigit = new DateDigit(prev, start, length);
2573
- }
2574
- else if (!_this.secondDigit) {
2575
- _this.secondDigit = new DateDigit(prev, start, length);
2576
- }
2577
- else if (!_this.thirdDigit) {
2578
- _this.thirdDigit = new DateDigit(prev, start, arr.length - start);
2579
- }
2580
- // tslint:disable:no-parameter-reassignment
2581
- length = 0;
2582
- start = index + 1;
2583
- }
2584
- else {
2585
- length++;
2586
- }
2587
- return { prev: value, length: length, start: start };
2588
- }, { length: 0, start: 0 });
2589
- if (!this.firstDigit || !this.secondDigit || !this.thirdDigit) {
2590
- Error("Can' t use this format: " + format);
2591
- }
2592
- };
2593
- McDatepickerInput.prototype.createDate = function (year, month, day) {
2594
- return this.dateAdapter.createDateTime(year, month, day, this.dateAdapter.getHours(this.value), this.dateAdapter.getMinutes(this.value), this.dateAdapter.getSeconds(this.value), this.dateAdapter.getMilliseconds(this.value));
2595
- };
2596
- McDatepickerInput.prototype.correctCursorPosition = function () {
2597
- if (this.selectionStart && this.separatorPositions.includes(this.selectionStart)) {
2598
- this.selectionStart = this.selectionStart - 1;
2599
- }
2600
- };
2601
- return McDatepickerInput;
2602
- }());
2603
- /** @nocollapse */ McDatepickerInput.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McDatepickerInput, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.Renderer2 }, { token: i1__namespace$1.DateAdapter, optional: true }, { token: i1$1.MC_DATE_FORMATS, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Directive });
2604
- /** @nocollapse */ McDatepickerInput.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", 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: [
2605
- MC_DATEPICKER_VALUE_ACCESSOR,
2606
- MC_DATEPICKER_VALIDATORS,
2607
- { provide: formField.McFormFieldControl, useExisting: McDatepickerInput }
2608
- ], exportAs: ["mcDatepickerInput"], ngImport: i0__namespace });
2609
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McDatepickerInput, decorators: [{
2610
- type: i0.Directive,
2611
- args: [{
2612
- selector: 'input[mcDatepicker]',
2613
- exportAs: 'mcDatepickerInput',
2614
- providers: [
2615
- MC_DATEPICKER_VALUE_ACCESSOR,
2616
- MC_DATEPICKER_VALIDATORS,
2617
- { provide: formField.McFormFieldControl, useExisting: McDatepickerInput }
2618
- ],
2619
- host: {
2620
- class: 'mc-input mc-datepicker',
2621
- '[attr.placeholder]': 'placeholder',
2622
- '[attr.required]': 'required',
2623
- '[attr.disabled]': 'disabled || null',
2624
- '[attr.min]': 'min ? toISO8601(min) : null',
2625
- '[attr.max]': 'max ? toISO8601(max) : null',
2626
- '[attr.autocomplete]': '"off"',
2627
- '(paste)': 'onPaste($event)',
2628
- '(change)': 'onChange()',
2629
- '(focus)': 'focusChanged(true)',
2630
- '(blur)': 'onBlur()',
2631
- '(keydown)': 'onKeyDown($event)'
2632
- }
2633
- }]
2634
- }], ctorParameters: function () {
2635
- return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.Renderer2 }, { type: i1__namespace$1.DateAdapter, decorators: [{
2636
- type: i0.Optional
2637
- }] }, { type: undefined, decorators: [{
2638
- type: i0.Optional
2639
- }, {
2640
- type: i0.Inject,
2641
- args: [i1$1.MC_DATE_FORMATS]
2642
- }] }];
2643
- }, propDecorators: { placeholder: [{
2644
- type: i0.Input
2645
- }], required: [{
2646
- type: i0.Input
2647
- }], mcDatepicker: [{
2648
- type: i0.Input
2649
- }], mcDatepickerFilter: [{
2650
- type: i0.Input
2651
- }], value: [{
2652
- type: i0.Input
2653
- }], min: [{
2654
- type: i0.Input
2655
- }], max: [{
2656
- type: i0.Input
2657
- }], disabled: [{
2658
- type: i0.Input
2659
- }], id: [{
2660
- type: i0.Input
2661
- }], mcValidationTooltip: [{
2662
- type: i0.Input
2663
- }], incorrectInput: [{
2664
- type: i0.Output
2665
- }], dateChange: [{
2666
- type: i0.Output
2667
- }], dateInput: [{
2668
- type: i0.Output
2669
- }] } });
2670
-
2671
- /** Can be used to override the icon of a `mcDatepickerToggle`. */
2672
- var McDatepickerToggleIcon = /** @class */ (function () {
2673
- function McDatepickerToggleIcon() {
2674
- }
2675
- return McDatepickerToggleIcon;
2676
- }());
2677
- /** @nocollapse */ McDatepickerToggleIcon.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McDatepickerToggleIcon, deps: [], target: i0__namespace.ɵɵFactoryTarget.Directive });
2678
- /** @nocollapse */ McDatepickerToggleIcon.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: McDatepickerToggleIcon, selector: "[mcDatepickerToggleIcon]", ngImport: i0__namespace });
2679
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McDatepickerToggleIcon, decorators: [{
2680
- type: i0.Directive,
2681
- args: [{
2682
- selector: '[mcDatepickerToggleIcon]'
2683
- }]
2684
- }] });
2685
- var McDatepickerToggle = /** @class */ (function () {
2686
- function McDatepickerToggle(intl, changeDetectorRef) {
2687
- this.intl = intl;
2688
- this.changeDetectorRef = changeDetectorRef;
2689
- this.stateChanges = rxjs.Subscription.EMPTY;
2690
- }
2691
- Object.defineProperty(McDatepickerToggle.prototype, "disabled", {
2692
- /** Whether the toggle button is disabled. */
2693
- get: function () {
2694
- return this._disabled === undefined ? this.datepicker.disabled : this._disabled;
2695
- },
2696
- set: function (value) {
2697
- this._disabled = coercion.coerceBooleanProperty(value);
2698
- },
2699
- enumerable: false,
2700
- configurable: true
2701
- });
2702
- McDatepickerToggle.prototype.ngOnChanges = function (changes) {
2703
- if (changes.datepicker) {
2704
- this.watchStateChanges();
2705
- }
2706
- };
2707
- McDatepickerToggle.prototype.ngOnDestroy = function () {
2708
- this.stateChanges.unsubscribe();
2709
- };
2710
- McDatepickerToggle.prototype.ngAfterContentInit = function () {
2711
- this.watchStateChanges();
2712
- };
2713
- McDatepickerToggle.prototype.open = function (event) {
2714
- if (this.datepicker && !this.disabled) {
2715
- this.datepicker.open();
2716
- event.stopPropagation();
2717
- }
2718
- };
2719
- McDatepickerToggle.prototype.watchStateChanges = function () {
2720
- var _this = this;
2721
- var datepickerDisabled = this.datepicker ? this.datepicker.disabledChange : rxjs.of();
2722
- var inputDisabled = this.datepicker && this.datepicker.datepickerInput ?
2723
- this.datepicker.datepickerInput.disabledChange : rxjs.of();
2724
- var datepickerToggled = this.datepicker ?
2725
- rxjs.merge(this.datepicker.openedStream, this.datepicker.closedStream) :
2726
- rxjs.of();
2727
- this.stateChanges.unsubscribe();
2728
- this.stateChanges = rxjs.merge(this.intl.changes, datepickerDisabled, inputDisabled, datepickerToggled).subscribe(function () { return _this.changeDetectorRef.markForCheck(); });
2729
- };
2730
- return McDatepickerToggle;
2731
- }());
2732
- /** @nocollapse */ McDatepickerToggle.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McDatepickerToggle, deps: [{ token: McDatepickerIntl }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
2733
- /** @nocollapse */ McDatepickerToggle.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", 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__namespace, 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 [attr.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:30px;width:var(--mc-datepicker-toggle-size-width, 30px);height: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"], components: [{ type: i3__namespace.McButton, selector: "button[mc-button]", inputs: ["disabled", "color"] }, { type: i4__namespace.McIcon, selector: "[mc-icon]", inputs: ["color"] }], directives: [{ type: i3__namespace.McButtonCssStyler, selector: "button[mc-button], a[mc-button]" }, { type: i1__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4__namespace.McIconCSSStyler, selector: "[mc-icon]" }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
2734
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McDatepickerToggle, decorators: [{
2735
- type: i0.Component,
2736
- args: [{
2737
- selector: 'mc-datepicker-toggle',
2738
- templateUrl: 'datepicker-toggle.html',
2739
- styleUrls: ['datepicker-toggle.scss'],
2740
- host: {
2741
- class: 'mc-datepicker-toggle',
2742
- '[class.mc-active]': 'datepicker && datepicker.opened'
2743
- },
2744
- exportAs: 'mcDatepickerToggle',
2745
- encapsulation: i0.ViewEncapsulation.None,
2746
- changeDetection: i0.ChangeDetectionStrategy.OnPush
2747
- }]
2748
- }], ctorParameters: function () { return [{ type: McDatepickerIntl }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { disabled: [{
2749
- type: i0.Input
2750
- }], datepicker: [{
2751
- type: i0.Input,
2752
- args: ['for']
2753
- }], tabIndex: [{
2754
- type: i0.Input
2755
- }], customIcon: [{
2756
- type: i0.ContentChild,
2757
- args: [McDatepickerToggleIcon, { static: false }]
2758
- }], button: [{
2759
- type: i0.ViewChild,
2760
- args: ['button', { static: false }]
2761
- }] } });
2762
-
2763
- /**
2764
- * Animations used by the mosaic datepicker.
2765
- * @docs-private
2766
- */
2767
- var mcDatepickerAnimations = {
2768
- /** Transforms the height of the datepicker's calendar. */
2769
- transformPanel: animations.trigger('transformPanel', [
2770
- animations.state('void', animations.style({
2771
- opacity: 0,
2772
- transform: 'scale(1, 0.8)'
2773
- })),
2774
- animations.transition('void => enter', animations.animate('120ms cubic-bezier(0, 0, 0.2, 1)', animations.style({
2775
- opacity: 1,
2776
- transform: 'scale(1, 1)'
2777
- }))),
2778
- animations.transition('* => void', animations.animate('100ms linear', animations.style({ opacity: 0 })))
2779
- ]),
2780
- /** Fades in the content of the calendar. */
2781
- fadeInCalendar: animations.trigger('fadeInCalendar', [
2782
- animations.state('void', animations.style({ opacity: 0 })),
2783
- animations.state('enter', animations.style({ opacity: 1 })),
2784
- // need to keep it until #12440 gets in, otherwise the exit animation will look glitchy.
2785
- animations.transition('void => *', animations.animate('120ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)'))
2786
- ])
2787
- };
2788
- // todo should be put into polyfils
2789
- // https://github.com/angular/angular/issues/24769
2790
- if (!Element.prototype.matches) {
2791
- Element.prototype.matches = Element.prototype.msMatchesSelector;
2792
- }
2793
-
2794
- /** Used to generate a unique ID for each datepicker instance. */
2795
- var datepickerUid = 0;
2796
- /** Injection token that determines the scroll handling while the calendar is open. */
2797
- var MC_DATEPICKER_SCROLL_STRATEGY = new i0.InjectionToken('mc-datepicker-scroll-strategy');
2798
- /** @docs-private */
2799
- // tslint:disable-next-line:naming-convention
2800
- function MC_DATEPICKER_SCROLL_STRATEGY_FACTORY(overlay) {
2801
- return function () { return overlay.scrollStrategies.reposition(); };
2802
- }
2803
- /** @docs-private */
2804
- var MC_DATEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER = {
2805
- provide: MC_DATEPICKER_SCROLL_STRATEGY,
2806
- deps: [i3$1.Overlay],
2807
- useFactory: MC_DATEPICKER_SCROLL_STRATEGY_FACTORY
2808
- };
2809
- /**
2810
- * Component used as the content for the datepicker dialog and popup. We use this instead of using
2811
- * McCalendar directly as the content so we can control the initial focus. This also gives us a
2812
- * place to put additional features of the popup that are not part of the calendar itself in the
2813
- * future. (e.g. confirmation buttons).
2814
- * @docs-private
2815
- */
2816
- var McDatepickerContent = /** @class */ (function () {
2817
- function McDatepickerContent(changeDetectorRef) {
2818
- this.changeDetectorRef = changeDetectorRef;
2819
- /** Emits when an animation has finished. */
2820
- this.animationDone = new rxjs.Subject();
2821
- this.subscriptions = new rxjs.Subscription();
2822
- }
2823
- McDatepickerContent.prototype.ngAfterViewInit = function () {
2824
- var _this = this;
2825
- this.subscriptions.add(this.datepicker.stateChanges.subscribe(function () {
2826
- _this.changeDetectorRef.markForCheck();
2827
- }));
2828
- };
2829
- McDatepickerContent.prototype.ngOnDestroy = function () {
2830
- this.subscriptions.unsubscribe();
2831
- this.animationDone.complete();
2832
- };
2833
- McDatepickerContent.prototype.startExitAnimation = function () {
2834
- this.animationState = 'void';
2835
- this.changeDetectorRef.markForCheck();
2836
- };
2837
- return McDatepickerContent;
2838
- }());
2839
- /** @nocollapse */ McDatepickerContent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McDatepickerContent, deps: [{ token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
2840
- /** @nocollapse */ McDatepickerContent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", 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__namespace, template: "<mc-calendar [id]=\"datepicker.id\"\n [ngClass]=\"datepicker.panelClass\"\n [startAt]=\"datepicker.startAt\"\n [startView]=\"datepicker.startView\"\n [minDate]=\"datepicker.minDate\"\n [maxDate]=\"datepicker.maxDate\"\n [dateFilter]=\"datepicker.dateFilter\"\n [headerComponent]=\"datepicker.calendarHeaderComponent\"\n [selected]=\"datepicker.selected\"\n [dateClass]=\"datepicker.dateClass\"\n [@fadeInCalendar]=\"'enter'\"\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-calendar{display:block}.mc-calendar-header{display:flex;padding:16px 8px 12px;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__content{padding:0 8px 8px;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-spacer{flex:1 1 auto}.mc-calendar__period-button{min-width:0}.mc-calendar__period-button .mc-icon{vertical-align:baseline}.mc-calendar__previous-button:after{border-left-width:2px;border-left-width:var(--mc-datepicker-calendar-size-icon-border-width, 2px);transform:translate(2px) rotate(-45deg);transform:var(--mc-datepicker-calendar-size-icon-prev-icon-transform, translateX(2px) rotate(-45deg))}.mc-calendar__next-button:after{border-right-width:2px;border-right-width:var(--mc-datepicker-calendar-size-icon-border-width, 2px);transform:translate(-2px) rotate(45deg);transform:var(--mc-datepicker-calendar-size-icon-nex-icon-transform, translateX(-2px) rotate(45deg))}.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(12px - 2px);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 * 8px);left:calc(-1 * var(--mc-datepicker-calendar-size-padding-horizontal, 8px));right:calc(-1 * 8px);right:calc(-1 * var(--mc-datepicker-calendar-size-padding-horizontal, 8px));height:1px;height:var(--mc-datepicker-calendar-size-divider-width, 1px)}.mc-datepicker__content{display:block;border-width:1px;border-style:solid}.mc-datepicker__content .mc-calendar{width:296px;height:348px}.mc-datepicker__content .mc-calendar__next-button[disabled],.mc-datepicker__content .mc-calendar__previous-button[disabled]{border:0}\n"], components: [{ type: McCalendar, selector: "mc-calendar", inputs: ["startAt", "selected", "minDate", "maxDate", "headerComponent", "startView", "dateFilter", "dateClass"], outputs: ["selectedChange", "yearSelected", "monthSelected", "userSelection"], exportAs: ["mcCalendar"] }], directives: [{ type: i1__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], animations: [
2841
- mcDatepickerAnimations.transformPanel,
2842
- mcDatepickerAnimations.fadeInCalendar
2843
- ], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
2844
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McDatepickerContent, decorators: [{
2845
- type: i0.Component,
2846
- args: [{
2847
- selector: 'mc-datepicker__content',
2848
- exportAs: 'mcDatepickerContent',
2849
- templateUrl: 'datepicker-content.html',
2850
- styleUrls: ['datepicker-content.scss'],
2851
- host: {
2852
- class: 'mc-datepicker__content',
2853
- '[@transformPanel]': 'animationState',
2854
- '(@transformPanel.done)': 'animationDone.next()'
2855
- },
2856
- animations: [
2857
- mcDatepickerAnimations.transformPanel,
2858
- mcDatepickerAnimations.fadeInCalendar
2859
- ],
2860
- encapsulation: i0.ViewEncapsulation.None,
2861
- changeDetection: i0.ChangeDetectionStrategy.OnPush
2862
- }]
2863
- }], ctorParameters: function () { return [{ type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { calendar: [{
2864
- type: i0.ViewChild,
2865
- args: [McCalendar]
2866
- }] } });
2867
- // TODO: We use a component instead of a directive here so the user can use implicit
2868
- // template reference variables (e.g. #d vs #d="mcDatepicker"). We can change this to a directive
2869
- // if angular adds support for `exportAs: '$implicit'` on directives.
2870
- /** Component responsible for managing the datepicker popup/dialog. */
2871
- var McDatepicker = /** @class */ (function () {
2872
- function McDatepicker(overlay, ngZone, viewContainerRef, scrollStrategy, dateAdapter, dir, document) {
2873
- this.overlay = overlay;
2874
- this.ngZone = ngZone;
2875
- this.viewContainerRef = viewContainerRef;
2876
- this.dateAdapter = dateAdapter;
2877
- this.dir = dir;
2878
- this.document = document;
2879
- this._hasBackdrop = false;
2880
- this._opened = false;
2881
- /** The view that the calendar should start in. */
2882
- this.startView = exports.McCalendarView.Month;
2883
- /**
2884
- * Emits selected year in multiyear view.
2885
- * This doesn't imply a change on the selected date.
2886
- */
2887
- this.yearSelected = new i0.EventEmitter();
2888
- /**
2889
- * Emits selected month in year view.
2890
- * This doesn't imply a change on the selected date.
2891
- */
2892
- this.monthSelected = new i0.EventEmitter();
2893
- this.backdropClass = 'cdk-overlay-transparent-backdrop';
2894
- /** Emits when the datepicker has been opened. */
2895
- this.openedStream = new i0.EventEmitter();
2896
- /** Emits when the datepicker has been closed. */
2897
- this.closedStream = new i0.EventEmitter();
2898
- /** The id for the datepicker calendar. */
2899
- this.id = "mc-datepicker-" + datepickerUid++;
2900
- this.stateChanges = new rxjs.Subject();
2901
- /** Emits when the datepicker is disabled. */
2902
- this.disabledChange = new rxjs.Subject();
2903
- /** Emits new selected date when selected date changes. */
2904
- this.selectedChanged = new rxjs.Subject();
2905
- this.validSelected = null;
2906
- /** The element that was focused before the datepicker was opened. */
2907
- this.focusedElementBeforeOpen = null;
2908
- /** Subscription to value changes in the associated input element. */
2909
- this.inputSubscription = rxjs.Subscription.EMPTY;
2910
- this.closeSubscription = rxjs.Subscription.EMPTY;
2911
- if (!this.dateAdapter) {
2912
- throw createMissingDateImplError('DateAdapter');
2913
- }
2914
- this.scrollStrategy = scrollStrategy;
2915
- }
2916
- Object.defineProperty(McDatepicker.prototype, "hasBackdrop", {
2917
- get: function () {
2918
- return this._hasBackdrop;
2919
- },
2920
- set: function (value) {
2921
- this._hasBackdrop = coercion.coerceBooleanProperty(value);
2922
- },
2923
- enumerable: false,
2924
- configurable: true
2925
- });
2926
- Object.defineProperty(McDatepicker.prototype, "startAt", {
2927
- /** The date to open the calendar to initially. */
2928
- get: function () {
2929
- // If an explicit startAt is set we start there, otherwise we start at whatever the currently
2930
- // selected value is.
2931
- return this._startAt || (this.datepickerInput ? this.datepickerInput.value : null);
2932
- },
2933
- set: function (value) {
2934
- this._startAt = this.getValidDateOrNull(this.dateAdapter.deserialize(value));
2935
- },
2936
- enumerable: false,
2937
- configurable: true
2938
- });
2939
- Object.defineProperty(McDatepicker.prototype, "disabled", {
2940
- /** Whether the datepicker pop-up should be disabled. */
2941
- get: function () {
2942
- return this._disabled === undefined && this.datepickerInput ? this.datepickerInput.disabled : this._disabled;
2943
- },
2944
- set: function (value) {
2945
- var newValue = coercion.coerceBooleanProperty(value);
2946
- if (newValue !== this._disabled) {
2947
- this._disabled = newValue;
2948
- this.disabledChange.next(newValue);
2949
- }
2950
- },
2951
- enumerable: false,
2952
- configurable: true
2953
- });
2954
- Object.defineProperty(McDatepicker.prototype, "opened", {
2955
- /** Whether the calendar is open. */
2956
- get: function () {
2957
- return this._opened;
2958
- },
2959
- set: function (value) {
2960
- coercion.coerceBooleanProperty(value) ? this.open() : this.close();
2961
- },
2962
- enumerable: false,
2963
- configurable: true
2964
- });
2965
- Object.defineProperty(McDatepicker.prototype, "selected", {
2966
- /** The currently selected date. */
2967
- get: function () {
2968
- return this.validSelected;
2969
- },
2970
- set: function (value) {
2971
- this.validSelected = value;
2972
- },
2973
- enumerable: false,
2974
- configurable: true
2975
- });
2976
- Object.defineProperty(McDatepicker.prototype, "minDate", {
2977
- /** The minimum selectable date. */
2978
- get: function () {
2979
- return this.datepickerInput && this.datepickerInput.min;
2980
- },
2981
- enumerable: false,
2982
- configurable: true
2983
- });
2984
- Object.defineProperty(McDatepicker.prototype, "maxDate", {
2985
- /** The maximum selectable date. */
2986
- get: function () {
2987
- return this.datepickerInput && this.datepickerInput.max;
2988
- },
2989
- enumerable: false,
2990
- configurable: true
2991
- });
2992
- Object.defineProperty(McDatepicker.prototype, "dateFilter", {
2993
- get: function () {
2994
- return this.datepickerInput && this.datepickerInput.dateFilter;
2995
- },
2996
- enumerable: false,
2997
- configurable: true
2998
- });
2999
- Object.defineProperty(McDatepicker.prototype, "value", {
3000
- get: function () {
3001
- return this.selected;
3002
- },
3003
- enumerable: false,
3004
- configurable: true
3005
- });
3006
- McDatepicker.prototype.ngOnDestroy = function () {
3007
- this.close();
3008
- this.inputSubscription.unsubscribe();
3009
- this.closeSubscription.unsubscribe();
3010
- this.disabledChange.complete();
3011
- this.destroyOverlay();
3012
- };
3013
- /** Selects the given date */
3014
- McDatepicker.prototype.select = function (date) {
3015
- var oldValue = this.selected;
3016
- this.selected = date;
3017
- if (!this.dateAdapter.sameDate(oldValue, this.selected)) {
3018
- this.selectedChanged.next(date);
3019
- }
3020
- };
3021
- /** Emits the selected year in multiyear view */
3022
- McDatepicker.prototype.selectYear = function (normalizedYear) {
3023
- this.yearSelected.emit(normalizedYear);
3024
- };
3025
- /** Emits selected month in year view */
3026
- McDatepicker.prototype.selectMonth = function (normalizedMonth) {
3027
- this.monthSelected.emit(normalizedMonth);
3028
- };
3029
- /**
3030
- * Register an input with this datepicker.
3031
- * @param input The datepicker input to register with this datepicker.
3032
- */
3033
- McDatepicker.prototype.registerInput = function (input) {
3034
- var _this = this;
3035
- if (this.datepickerInput) {
3036
- throw Error('A McDatepicker can only be associated with a single input.');
3037
- }
3038
- this.datepickerInput = input;
3039
- this.inputSubscription = this.datepickerInput.valueChange
3040
- .subscribe(function (value) {
3041
- var _a;
3042
- _this.selected = value;
3043
- if (_this.popupComponentRef) {
3044
- (_a = _this.popupComponentRef.instance.calendar.monthView) === null || _a === void 0 ? void 0 : _a.init();
3045
- _this.popupComponentRef.instance.calendar.activeDate = value;
3046
- }
3047
- });
3048
- };
3049
- /** Open the calendar. */
3050
- McDatepicker.prototype.open = function () {
3051
- if (this._opened || this.disabled) {
3052
- return;
3053
- }
3054
- if (!this.datepickerInput) {
3055
- throw Error('Attempted to open an McDatepicker with no associated input.');
3056
- }
3057
- if (this.document) {
3058
- this.focusedElementBeforeOpen = this.document.activeElement;
3059
- }
3060
- this.openAsPopup();
3061
- this._opened = true;
3062
- this.openedStream.emit();
3063
- };
3064
- /** Close the calendar. */
3065
- McDatepicker.prototype.close = function (restoreFocus) {
3066
- var _this = this;
3067
- if (restoreFocus === void 0) { restoreFocus = true; }
3068
- if (!this._opened) {
3069
- return;
3070
- }
3071
- if (this.popupComponentRef) {
3072
- var instance = this.popupComponentRef.instance;
3073
- instance.startExitAnimation();
3074
- instance.animationDone
3075
- .pipe(operators.take(1))
3076
- .subscribe(function () { return _this.destroyOverlay(); });
3077
- }
3078
- if (restoreFocus) {
3079
- this.focusedElementBeforeOpen.focus();
3080
- }
3081
- this._opened = false;
3082
- this.closedStream.emit();
3083
- this.focusedElementBeforeOpen = null;
3084
- };
3085
- McDatepicker.prototype.toggle = function () {
3086
- if (this.datepickerInput.isReadOnly) {
3087
- return;
3088
- }
3089
- this._opened ? this.close() : this.open();
3090
- };
3091
- /** Destroys the current overlay. */
3092
- McDatepicker.prototype.destroyOverlay = function () {
3093
- if (this.popupRef) {
3094
- this.popupRef.dispose();
3095
- this.popupRef = this.popupComponentRef = null;
3096
- }
3097
- };
3098
- /** Open the calendar as a popup. */
3099
- McDatepicker.prototype.openAsPopup = function () {
3100
- var _this = this;
3101
- if (!this.calendarPortal) {
3102
- this.calendarPortal = new i8.ComponentPortal(McDatepickerContent, this.viewContainerRef);
3103
- }
3104
- if (!this.popupRef) {
3105
- this.createPopup();
3106
- }
3107
- if (!this.popupRef.hasAttached()) {
3108
- this.popupComponentRef = this.popupRef.attach(this.calendarPortal);
3109
- this.popupComponentRef.instance.datepicker = this;
3110
- // Update the position once the calendar has rendered.
3111
- this.ngZone.onStable.asObservable()
3112
- .pipe(operators.take(1))
3113
- .subscribe(function () { return _this.popupRef.updatePosition(); });
3114
- }
3115
- };
3116
- /** Create the popup. */
3117
- McDatepicker.prototype.createPopup = function () {
3118
- var _this = this;
3119
- var overlayConfig = new i3$1.OverlayConfig({
3120
- positionStrategy: this.createPopupPositionStrategy(),
3121
- hasBackdrop: this.hasBackdrop,
3122
- backdropClass: this.backdropClass,
3123
- direction: this.dir,
3124
- scrollStrategy: this.scrollStrategy(),
3125
- panelClass: 'mc-datepicker__popup'
3126
- });
3127
- this.popupRef = this.overlay.create(overlayConfig);
3128
- this.closeSubscription = this.closingActions()
3129
- .subscribe(function () { return _this.close(_this.restoreFocus()); });
3130
- };
3131
- McDatepicker.prototype.restoreFocus = function () {
3132
- return this.document.activeElement === this.document.body;
3133
- };
3134
- McDatepicker.prototype.closingActions = function () {
3135
- return rxjs.merge(this.popupRef.backdropClick(), this.popupRef.outsidePointerEvents(), this.popupRef.detachments());
3136
- };
3137
- /** Create the popup PositionStrategy. */
3138
- McDatepicker.prototype.createPopupPositionStrategy = function () {
3139
- return this.overlay.position()
3140
- .flexibleConnectedTo(this.datepickerInput.elementRef)
3141
- .withTransformOriginOn('.mc-datepicker__content')
3142
- .withFlexibleDimensions(false)
3143
- .withViewportMargin(8)
3144
- .withLockedPosition()
3145
- .withPositions([
3146
- {
3147
- originX: 'start',
3148
- originY: 'bottom',
3149
- overlayX: 'start',
3150
- overlayY: 'top'
3151
- },
3152
- {
3153
- originX: 'start',
3154
- originY: 'top',
3155
- overlayX: 'start',
3156
- overlayY: 'bottom'
3157
- },
3158
- {
3159
- originX: 'end',
3160
- originY: 'bottom',
3161
- overlayX: 'end',
3162
- overlayY: 'top'
3163
- },
3164
- {
3165
- originX: 'end',
3166
- originY: 'top',
3167
- overlayX: 'end',
3168
- overlayY: 'bottom'
3169
- }
3170
- ]);
3171
- };
3172
- /**
3173
- * @param obj The object to check.
3174
- * @returns The given object if it is both a date instance and valid, otherwise null.
3175
- */
3176
- McDatepicker.prototype.getValidDateOrNull = function (obj) {
3177
- return (this.dateAdapter.isDateInstance(obj) && this.dateAdapter.isValid(obj)) ? obj : null;
3178
- };
3179
- return McDatepicker;
3180
- }());
3181
- /** @nocollapse */ McDatepicker.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McDatepicker, deps: [{ token: i3__namespace$1.Overlay }, { token: i0__namespace.NgZone }, { token: i0__namespace.ViewContainerRef }, { token: MC_DATEPICKER_SCROLL_STRATEGY }, { token: i1__namespace$1.DateAdapter, optional: true }, { token: i2__namespace.Directionality, optional: true }, { token: i1.DOCUMENT, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Component });
3182
- /** @nocollapse */ McDatepicker.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: McDatepicker, selector: "mc-datepicker", inputs: { hasBackdrop: "hasBackdrop", startAt: "startAt", disabled: "disabled", opened: "opened", calendarHeaderComponent: "calendarHeaderComponent", startView: "startView", panelClass: "panelClass", dateClass: "dateClass", backdropClass: "backdropClass" }, outputs: { yearSelected: "yearSelected", monthSelected: "monthSelected", openedStream: "opened", closedStream: "closed" }, providers: [{ provide: formField.McFormFieldControl, useExisting: McDatepicker }], exportAs: ["mcDatepicker"], ngImport: i0__namespace, template: '', isInline: true, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
3183
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McDatepicker, decorators: [{
3184
- type: i0.Component,
3185
- args: [{
3186
- selector: 'mc-datepicker',
3187
- template: '',
3188
- exportAs: 'mcDatepicker',
3189
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
3190
- encapsulation: i0.ViewEncapsulation.None,
3191
- providers: [{ provide: formField.McFormFieldControl, useExisting: McDatepicker }]
3192
- }]
3193
- }], ctorParameters: function () {
3194
- return [{ type: i3__namespace$1.Overlay }, { type: i0__namespace.NgZone }, { type: i0__namespace.ViewContainerRef }, { type: undefined, decorators: [{
3195
- type: i0.Inject,
3196
- args: [MC_DATEPICKER_SCROLL_STRATEGY]
3197
- }] }, { type: i1__namespace$1.DateAdapter, decorators: [{
3198
- type: i0.Optional
3199
- }] }, { type: i2__namespace.Directionality, decorators: [{
3200
- type: i0.Optional
3201
- }] }, { type: undefined, decorators: [{
3202
- type: i0.Optional
3203
- }, {
3204
- type: i0.Inject,
3205
- args: [i1.DOCUMENT]
3206
- }] }];
3207
- }, propDecorators: { hasBackdrop: [{
3208
- type: i0.Input
3209
- }], startAt: [{
3210
- type: i0.Input
3211
- }], disabled: [{
3212
- type: i0.Input
3213
- }], opened: [{
3214
- type: i0.Input
3215
- }], calendarHeaderComponent: [{
3216
- type: i0.Input
3217
- }], startView: [{
3218
- type: i0.Input
3219
- }], yearSelected: [{
3220
- type: i0.Output
3221
- }], monthSelected: [{
3222
- type: i0.Output
3223
- }], panelClass: [{
3224
- type: i0.Input
3225
- }], dateClass: [{
3226
- type: i0.Input
3227
- }], backdropClass: [{
3228
- type: i0.Input
3229
- }], openedStream: [{
3230
- type: i0.Output,
3231
- args: ['opened']
3232
- }], closedStream: [{
3233
- type: i0.Output,
3234
- args: ['closed']
3235
- }] } });
3236
-
3237
- var McDatepickerModule = /** @class */ (function () {
3238
- function McDatepickerModule() {
3239
- }
3240
- return McDatepickerModule;
3241
- }());
3242
- /** @nocollapse */ McDatepickerModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McDatepickerModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
3243
- /** @nocollapse */ McDatepickerModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McDatepickerModule, declarations: [McCalendar,
3244
- McCalendarBody,
3245
- McDatepicker,
3246
- McDatepickerContent,
3247
- McDatepickerInput,
3248
- McDatepickerToggle,
3249
- McDatepickerToggleIcon,
3250
- McMonthView,
3251
- McYearView,
3252
- McMultiYearView,
3253
- McCalendarHeader], imports: [i1.CommonModule,
3254
- i3.McButtonModule,
3255
- i3$1.OverlayModule,
3256
- a11y.A11yModule,
3257
- i8.PortalModule,
3258
- i4.McIconModule], exports: [McCalendar,
3259
- McCalendarBody,
3260
- McDatepicker,
3261
- McDatepickerContent,
3262
- McDatepickerInput,
3263
- McDatepickerToggle,
3264
- McDatepickerToggleIcon,
3265
- McMonthView,
3266
- McYearView,
3267
- McMultiYearView,
3268
- McCalendarHeader,
3269
- i3.McButtonModule] });
3270
- /** @nocollapse */ McDatepickerModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McDatepickerModule, providers: [
3271
- McDatepickerIntl,
3272
- MC_DATEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER
3273
- ], imports: [[
3274
- i1.CommonModule,
3275
- i3.McButtonModule,
3276
- i3$1.OverlayModule,
3277
- a11y.A11yModule,
3278
- i8.PortalModule,
3279
- i4.McIconModule
3280
- ], i3.McButtonModule] });
3281
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McDatepickerModule, decorators: [{
3282
- type: i0.NgModule,
3283
- args: [{
3284
- imports: [
3285
- i1.CommonModule,
3286
- i3.McButtonModule,
3287
- i3$1.OverlayModule,
3288
- a11y.A11yModule,
3289
- i8.PortalModule,
3290
- i4.McIconModule
3291
- ],
3292
- exports: [
3293
- McCalendar,
3294
- McCalendarBody,
3295
- McDatepicker,
3296
- McDatepickerContent,
3297
- McDatepickerInput,
3298
- McDatepickerToggle,
3299
- McDatepickerToggleIcon,
3300
- McMonthView,
3301
- McYearView,
3302
- McMultiYearView,
3303
- McCalendarHeader,
3304
- i3.McButtonModule
3305
- ],
3306
- declarations: [
3307
- McCalendar,
3308
- McCalendarBody,
3309
- McDatepicker,
3310
- McDatepickerContent,
3311
- McDatepickerInput,
3312
- McDatepickerToggle,
3313
- McDatepickerToggleIcon,
3314
- McMonthView,
3315
- McYearView,
3316
- McMultiYearView,
3317
- McCalendarHeader
3318
- ],
3319
- providers: [
3320
- McDatepickerIntl,
3321
- MC_DATEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER
3322
- ],
3323
- entryComponents: [
3324
- McDatepickerContent,
3325
- McCalendarHeader
3326
- ]
3327
- }]
3328
- }] });
3329
-
3330
- /**
3331
- * Generated bundle index. Do not edit.
3332
- */
3333
-
3334
- exports.MAX_YEAR = MAX_YEAR;
3335
- exports.MC_DATEPICKER_SCROLL_STRATEGY = MC_DATEPICKER_SCROLL_STRATEGY;
3336
- exports.MC_DATEPICKER_SCROLL_STRATEGY_FACTORY = MC_DATEPICKER_SCROLL_STRATEGY_FACTORY;
3337
- exports.MC_DATEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER = MC_DATEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER;
3338
- exports.MC_DATEPICKER_VALIDATORS = MC_DATEPICKER_VALIDATORS;
3339
- exports.MC_DATEPICKER_VALUE_ACCESSOR = MC_DATEPICKER_VALUE_ACCESSOR;
3340
- exports.McCalendar = McCalendar;
3341
- exports.McCalendarBody = McCalendarBody;
3342
- exports.McCalendarCell = McCalendarCell;
3343
- exports.McCalendarHeader = McCalendarHeader;
3344
- exports.McDatepicker = McDatepicker;
3345
- exports.McDatepickerContent = McDatepickerContent;
3346
- exports.McDatepickerInput = McDatepickerInput;
3347
- exports.McDatepickerInputEvent = McDatepickerInputEvent;
3348
- exports.McDatepickerIntl = McDatepickerIntl;
3349
- exports.McDatepickerModule = McDatepickerModule;
3350
- exports.McDatepickerToggle = McDatepickerToggle;
3351
- exports.McDatepickerToggleIcon = McDatepickerToggleIcon;
3352
- exports.McMonthView = McMonthView;
3353
- exports.McMultiYearView = McMultiYearView;
3354
- exports.McYearView = McYearView;
3355
- exports.mcDatepickerAnimations = mcDatepickerAnimations;
3356
- exports.yearsPerPage = yearsPerPage;
3357
- exports.yearsPerRow = yearsPerRow;
3358
-
3359
- Object.defineProperty(exports, '__esModule', { value: true });
3360
-
3361
- }));
3362
- //# sourceMappingURL=ptsecurity-mosaic-datepicker.umd.js.map