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