@sebgroup/green-angular 5.1.2 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (434) hide show
  1. package/esm2022/src/v-angular/account-number/account-number.module.mjs +18 -0
  2. package/esm2022/src/v-angular/account-number/account-number.pipe.mjs +54 -0
  3. package/esm2022/src/v-angular/account-number/index.mjs +3 -0
  4. package/esm2022/src/v-angular/account-number/sebgroup-green-angular-src-v-angular-account-number.mjs +5 -0
  5. package/esm2022/src/v-angular/alert/alert.component.mjs +47 -0
  6. package/esm2022/src/v-angular/alert/alert.models.mjs +8 -0
  7. package/esm2022/src/v-angular/alert/alert.module.mjs +18 -0
  8. package/esm2022/src/v-angular/alert/index.mjs +4 -0
  9. package/esm2022/src/v-angular/alert/sebgroup-green-angular-src-v-angular-alert.mjs +5 -0
  10. package/esm2022/src/v-angular/base-control-value-accessor/base-control-value-accessor.component.mjs +16 -6
  11. package/esm2022/src/v-angular/base-control-value-accessor/base-control-value-accessor.module.mjs +9 -9
  12. package/esm2022/src/v-angular/breadcrumbs/breadcrumbs.component.mjs +5 -5
  13. package/esm2022/src/v-angular/breadcrumbs/breadcrumbs.module.mjs +11 -11
  14. package/esm2022/src/v-angular/button/button.component.mjs +9 -9
  15. package/esm2022/src/v-angular/button/button.module.mjs +11 -11
  16. package/esm2022/src/v-angular/card/card.component.mjs +6 -6
  17. package/esm2022/src/v-angular/card/card.module.mjs +9 -9
  18. package/esm2022/src/v-angular/character-countdown/character-countdown.module.mjs +6 -6
  19. package/esm2022/src/v-angular/checkbox/checkbox.component.mjs +9 -7
  20. package/esm2022/src/v-angular/checkbox/checkbox.module.mjs +14 -12
  21. package/esm2022/src/v-angular/core/core.utils.mjs +35 -1
  22. package/esm2022/src/v-angular/datepicker/components/calendar/calendar.component.mjs +200 -0
  23. package/esm2022/src/v-angular/datepicker/components/calendar-control/calendar-control.component.mjs +115 -0
  24. package/esm2022/src/v-angular/datepicker/components/date-input/date-input.component.mjs +203 -0
  25. package/esm2022/src/v-angular/datepicker/components/datepicker/datepicker.component.mjs +135 -0
  26. package/esm2022/src/v-angular/datepicker/date-control-value-accessor/date-control-value-accessor.component.mjs +408 -0
  27. package/esm2022/src/v-angular/datepicker/datepicker.globals.mjs +20 -0
  28. package/esm2022/src/v-angular/datepicker/datepicker.models.mjs +56 -0
  29. package/esm2022/src/v-angular/datepicker/datepicker.module.mjs +63 -0
  30. package/esm2022/src/v-angular/datepicker/datepicker.utils.mjs +196 -0
  31. package/esm2022/src/v-angular/datepicker/directives/calendar-date.directive.mjs +47 -0
  32. package/esm2022/src/v-angular/datepicker/index.mjs +17 -0
  33. package/esm2022/src/v-angular/datepicker/models/dates.mjs +291 -0
  34. package/esm2022/src/v-angular/datepicker/pipes/date-thook.pipe.mjs +30 -0
  35. package/esm2022/src/v-angular/datepicker/pipes/is-disabled.pipe.mjs +37 -0
  36. package/esm2022/src/v-angular/datepicker/pipes/matches.pipe.mjs +17 -0
  37. package/esm2022/src/v-angular/datepicker/sebgroup-green-angular-src-v-angular-datepicker.mjs +5 -0
  38. package/esm2022/src/v-angular/drag-drop/drag-drop.component.mjs +497 -0
  39. package/esm2022/src/v-angular/drag-drop/drag-drop.models.mjs +2 -0
  40. package/esm2022/src/v-angular/drag-drop/drag-drop.module.mjs +49 -0
  41. package/esm2022/src/v-angular/drag-drop/drag-drop.pipes.mjs +70 -0
  42. package/esm2022/src/v-angular/drag-drop/drag-drop.utils.mjs +76 -0
  43. package/esm2022/src/v-angular/drag-drop/index.mjs +5 -0
  44. package/esm2022/src/v-angular/drag-drop/sebgroup-green-angular-src-v-angular-drag-drop.mjs +5 -0
  45. package/esm2022/src/v-angular/dropdown/dropdown-list/dropdown-list.component.mjs +24 -9
  46. package/esm2022/src/v-angular/dropdown/dropdown.component.mjs +16 -9
  47. package/esm2022/src/v-angular/dropdown/dropdown.module.mjs +31 -15
  48. package/esm2022/src/v-angular/dropdown/typeahead/typeahead-dropdown-list/typeahead-dropdown-list.component.mjs +8 -8
  49. package/esm2022/src/v-angular/dropdown/typeahead/typeahead-highlight/typeahead-highlight.component.mjs +5 -5
  50. package/esm2022/src/v-angular/dropdown/typeahead/typeahead-input/typeahead-input.component.mjs +17 -10
  51. package/esm2022/src/v-angular/dropdown/typeahead/typeahead.directive.mjs +27 -20
  52. package/esm2022/src/v-angular/dropdown/typeahead/typeahead.module.mjs +21 -21
  53. package/esm2022/src/v-angular/external-link/external-link.directive.mjs +5 -5
  54. package/esm2022/src/v-angular/external-link/external-link.module.mjs +9 -9
  55. package/esm2022/src/v-angular/i18n/i18n.module.mjs +12 -12
  56. package/esm2022/src/v-angular/i18n/i18n.test.module.mjs +6 -6
  57. package/esm2022/src/v-angular/info-circle/info-circle.component.mjs +6 -6
  58. package/esm2022/src/v-angular/info-circle/info-circle.module.mjs +11 -11
  59. package/esm2022/src/v-angular/input/input.component.mjs +11 -15
  60. package/esm2022/src/v-angular/input/input.module.mjs +27 -22
  61. package/esm2022/src/v-angular/input-mask/input-mask.directive.mjs +6 -6
  62. package/esm2022/src/v-angular/input-mask/input-mask.module.mjs +10 -10
  63. package/esm2022/src/v-angular/modal/dialog/dialog.component.mjs +53 -31
  64. package/esm2022/src/v-angular/modal/fold-out/fold-out.component.mjs +116 -16
  65. package/esm2022/src/v-angular/modal/fold-out/fold-out.directive.mjs +5 -5
  66. package/esm2022/src/v-angular/modal/fold-out/keyboard-key.enum.mjs +9 -0
  67. package/esm2022/src/v-angular/modal/modal.module.mjs +38 -27
  68. package/esm2022/src/v-angular/modal/slide-out/slide-out.component.mjs +35 -12
  69. package/esm2022/src/v-angular/pagination/index.mjs +3 -0
  70. package/esm2022/src/v-angular/pagination/pagination.component.mjs +144 -0
  71. package/esm2022/src/v-angular/pagination/pagination.module.mjs +37 -0
  72. package/esm2022/src/v-angular/pagination/sebgroup-green-angular-src-v-angular-pagination.mjs +5 -0
  73. package/esm2022/src/v-angular/radio/radio.component.mjs +14 -12
  74. package/esm2022/src/v-angular/radio/radio.module.mjs +12 -11
  75. package/esm2022/src/v-angular/slug/slug.module.mjs +6 -6
  76. package/esm2022/src/v-angular/table/index.mjs +9 -0
  77. package/esm2022/src/v-angular/table/sebgroup-green-angular-src-v-angular-table.mjs +5 -0
  78. package/esm2022/src/v-angular/table/table.component.mjs +387 -0
  79. package/esm2022/src/v-angular/table/table.directive.mjs +110 -0
  80. package/esm2022/src/v-angular/table/table.models.mjs +2 -0
  81. package/esm2022/src/v-angular/table/table.module.mjs +40 -0
  82. package/esm2022/src/v-angular/table/table.tools.mjs +29 -0
  83. package/esm2022/src/v-angular/table/tr-thook.pipe.mjs +22 -0
  84. package/esm2022/src/v-angular/tabs/index.mjs +8 -0
  85. package/esm2022/src/v-angular/tabs/sebgroup-green-angular-src-v-angular-tabs.mjs +5 -0
  86. package/esm2022/src/v-angular/tabs/tab.directive.mjs +81 -0
  87. package/esm2022/src/v-angular/tabs/tabs.component.mjs +262 -0
  88. package/esm2022/src/v-angular/tabs/tabs.models.mjs +2 -0
  89. package/esm2022/src/v-angular/tabs/tabs.module.mjs +21 -0
  90. package/esm2022/src/v-angular/textarea/textarea.component.mjs +9 -7
  91. package/esm2022/src/v-angular/textarea/textarea.module.mjs +27 -13
  92. package/esm2022/src/v-angular/toast/index.mjs +8 -0
  93. package/esm2022/src/v-angular/toast/sebgroup-green-angular-src-v-angular-toast.mjs +5 -0
  94. package/esm2022/src/v-angular/toast/toast-message.service.mjs +63 -0
  95. package/esm2022/src/v-angular/toast/toast.component.mjs +70 -0
  96. package/esm2022/src/v-angular/toast/toast.models.mjs +8 -0
  97. package/esm2022/src/v-angular/toast/toast.module.mjs +21 -0
  98. package/esm2022/src/v-angular/tooltip/tooltip.directive.mjs +35 -15
  99. package/esm2022/src/v-angular/tooltip/tooltip.module.mjs +11 -11
  100. package/esm2022/src/v-angular/tooltip/tooltip.styles.mjs +60 -0
  101. package/esm2022/v-angular/alert/alert.component.mjs +47 -0
  102. package/esm2022/v-angular/alert/alert.models.mjs +8 -0
  103. package/esm2022/v-angular/alert/alert.module.mjs +18 -0
  104. package/esm2022/v-angular/alert/index.mjs +4 -0
  105. package/esm2022/v-angular/base-control-value-accessor/base-control-value-accessor.component.mjs +16 -6
  106. package/esm2022/v-angular/base-control-value-accessor/base-control-value-accessor.module.mjs +9 -9
  107. package/esm2022/v-angular/breadcrumbs/breadcrumbs.component.mjs +5 -5
  108. package/esm2022/v-angular/breadcrumbs/breadcrumbs.module.mjs +11 -11
  109. package/esm2022/v-angular/button/button.component.mjs +9 -9
  110. package/esm2022/v-angular/button/button.module.mjs +11 -11
  111. package/esm2022/v-angular/card/card.component.mjs +6 -6
  112. package/esm2022/v-angular/card/card.module.mjs +9 -9
  113. package/esm2022/v-angular/character-countdown/character-countdown.module.mjs +6 -6
  114. package/esm2022/v-angular/checkbox/checkbox.component.mjs +9 -7
  115. package/esm2022/v-angular/checkbox/checkbox.module.mjs +14 -12
  116. package/esm2022/v-angular/datepicker/components/calendar/calendar.component.mjs +200 -0
  117. package/esm2022/v-angular/datepicker/components/calendar-control/calendar-control.component.mjs +115 -0
  118. package/esm2022/v-angular/datepicker/components/date-input/date-input.component.mjs +203 -0
  119. package/esm2022/v-angular/datepicker/components/datepicker/datepicker.component.mjs +135 -0
  120. package/esm2022/v-angular/datepicker/date-control-value-accessor/date-control-value-accessor.component.mjs +408 -0
  121. package/esm2022/v-angular/datepicker/datepicker.globals.mjs +20 -0
  122. package/esm2022/v-angular/datepicker/datepicker.models.mjs +56 -0
  123. package/esm2022/v-angular/datepicker/datepicker.module.mjs +63 -0
  124. package/esm2022/v-angular/datepicker/datepicker.utils.mjs +196 -0
  125. package/esm2022/v-angular/datepicker/directives/calendar-date.directive.mjs +47 -0
  126. package/esm2022/v-angular/datepicker/index.mjs +17 -0
  127. package/esm2022/v-angular/datepicker/models/dates.mjs +291 -0
  128. package/esm2022/v-angular/datepicker/pipes/date-thook.pipe.mjs +30 -0
  129. package/esm2022/v-angular/datepicker/pipes/is-disabled.pipe.mjs +37 -0
  130. package/esm2022/v-angular/datepicker/pipes/matches.pipe.mjs +17 -0
  131. package/esm2022/v-angular/drag-drop/drag-drop.component.mjs +497 -0
  132. package/esm2022/v-angular/drag-drop/drag-drop.models.mjs +2 -0
  133. package/esm2022/v-angular/drag-drop/drag-drop.module.mjs +49 -0
  134. package/esm2022/v-angular/drag-drop/drag-drop.pipes.mjs +70 -0
  135. package/esm2022/v-angular/drag-drop/drag-drop.utils.mjs +76 -0
  136. package/esm2022/v-angular/drag-drop/index.mjs +5 -0
  137. package/esm2022/v-angular/dropdown/dropdown-list/dropdown-list.component.mjs +24 -9
  138. package/esm2022/v-angular/dropdown/dropdown.component.mjs +16 -9
  139. package/esm2022/v-angular/dropdown/dropdown.module.mjs +31 -15
  140. package/esm2022/v-angular/dropdown/typeahead/typeahead-dropdown-list/typeahead-dropdown-list.component.mjs +8 -8
  141. package/esm2022/v-angular/dropdown/typeahead/typeahead-highlight/typeahead-highlight.component.mjs +5 -5
  142. package/esm2022/v-angular/dropdown/typeahead/typeahead-input/typeahead-input.component.mjs +17 -10
  143. package/esm2022/v-angular/dropdown/typeahead/typeahead.directive.mjs +27 -20
  144. package/esm2022/v-angular/dropdown/typeahead/typeahead.module.mjs +21 -21
  145. package/esm2022/v-angular/external-link/external-link.directive.mjs +37 -0
  146. package/esm2022/v-angular/external-link/external-link.module.mjs +18 -0
  147. package/esm2022/v-angular/external-link/index.mjs +3 -0
  148. package/esm2022/v-angular/i18n/i18n.module.mjs +12 -12
  149. package/esm2022/v-angular/i18n/i18n.test.module.mjs +6 -6
  150. package/esm2022/v-angular/index.mjs +10 -1
  151. package/esm2022/v-angular/info-circle/info-circle.component.mjs +6 -6
  152. package/esm2022/v-angular/info-circle/info-circle.module.mjs +11 -11
  153. package/esm2022/v-angular/input/input.component.mjs +11 -15
  154. package/esm2022/v-angular/input/input.module.mjs +27 -22
  155. package/esm2022/v-angular/input-mask/input-mask.directive.mjs +6 -6
  156. package/esm2022/v-angular/input-mask/input-mask.module.mjs +10 -10
  157. package/esm2022/v-angular/modal/dialog/dialog.component.mjs +53 -31
  158. package/esm2022/v-angular/modal/fold-out/fold-out.component.mjs +116 -16
  159. package/esm2022/v-angular/modal/fold-out/fold-out.directive.mjs +5 -5
  160. package/esm2022/v-angular/modal/fold-out/keyboard-key.enum.mjs +9 -0
  161. package/esm2022/v-angular/modal/modal.module.mjs +38 -27
  162. package/esm2022/v-angular/modal/slide-out/slide-out.component.mjs +35 -12
  163. package/esm2022/v-angular/pagination/index.mjs +3 -0
  164. package/esm2022/v-angular/pagination/pagination.component.mjs +144 -0
  165. package/esm2022/v-angular/pagination/pagination.module.mjs +37 -0
  166. package/esm2022/v-angular/radio/radio.component.mjs +14 -12
  167. package/esm2022/v-angular/radio/radio.module.mjs +12 -11
  168. package/esm2022/v-angular/slug/index.mjs +3 -0
  169. package/esm2022/v-angular/slug/slug.module.mjs +18 -0
  170. package/esm2022/v-angular/slug/slug.pipe.mjs +27 -0
  171. package/esm2022/v-angular/table/index.mjs +9 -0
  172. package/esm2022/v-angular/table/table.component.mjs +387 -0
  173. package/esm2022/v-angular/table/table.directive.mjs +110 -0
  174. package/esm2022/v-angular/table/table.models.mjs +2 -0
  175. package/esm2022/v-angular/table/table.module.mjs +40 -0
  176. package/esm2022/v-angular/table/table.tools.mjs +29 -0
  177. package/esm2022/v-angular/table/tr-thook.pipe.mjs +22 -0
  178. package/esm2022/v-angular/tabs/index.mjs +8 -0
  179. package/esm2022/v-angular/tabs/tab.directive.mjs +81 -0
  180. package/esm2022/v-angular/tabs/tabs.component.mjs +262 -0
  181. package/esm2022/v-angular/tabs/tabs.models.mjs +2 -0
  182. package/esm2022/v-angular/tabs/tabs.module.mjs +21 -0
  183. package/esm2022/v-angular/textarea/textarea.component.mjs +9 -7
  184. package/esm2022/v-angular/textarea/textarea.module.mjs +27 -13
  185. package/esm2022/v-angular/toast/index.mjs +8 -0
  186. package/esm2022/v-angular/toast/toast-message.service.mjs +63 -0
  187. package/esm2022/v-angular/toast/toast.component.mjs +70 -0
  188. package/esm2022/v-angular/toast/toast.models.mjs +8 -0
  189. package/esm2022/v-angular/toast/toast.module.mjs +21 -0
  190. package/esm2022/v-angular/tooltip/tooltip.directive.mjs +35 -15
  191. package/esm2022/v-angular/tooltip/tooltip.module.mjs +11 -11
  192. package/esm2022/v-angular/tooltip/tooltip.styles.mjs +60 -0
  193. package/esm2022/v-angular/v-angular.module.mjs +104 -68
  194. package/fesm2022/sebgroup-green-angular-src-v-angular-account-number.mjs +76 -0
  195. package/fesm2022/sebgroup-green-angular-src-v-angular-account-number.mjs.map +1 -0
  196. package/fesm2022/sebgroup-green-angular-src-v-angular-alert.mjs +76 -0
  197. package/fesm2022/sebgroup-green-angular-src-v-angular-alert.mjs.map +1 -0
  198. package/fesm2022/sebgroup-green-angular-src-v-angular-base-control-value-accessor.mjs +23 -13
  199. package/fesm2022/sebgroup-green-angular-src-v-angular-base-control-value-accessor.mjs.map +1 -1
  200. package/fesm2022/sebgroup-green-angular-src-v-angular-breadcrumbs.mjs +14 -14
  201. package/fesm2022/sebgroup-green-angular-src-v-angular-breadcrumbs.mjs.map +1 -1
  202. package/fesm2022/sebgroup-green-angular-src-v-angular-button.mjs +18 -18
  203. package/fesm2022/sebgroup-green-angular-src-v-angular-button.mjs.map +1 -1
  204. package/fesm2022/sebgroup-green-angular-src-v-angular-card.mjs +13 -13
  205. package/fesm2022/sebgroup-green-angular-src-v-angular-card.mjs.map +1 -1
  206. package/fesm2022/sebgroup-green-angular-src-v-angular-character-countdown.mjs +6 -6
  207. package/fesm2022/sebgroup-green-angular-src-v-angular-character-countdown.mjs.map +1 -1
  208. package/fesm2022/sebgroup-green-angular-src-v-angular-checkbox.mjs +21 -17
  209. package/fesm2022/sebgroup-green-angular-src-v-angular-checkbox.mjs.map +1 -1
  210. package/fesm2022/sebgroup-green-angular-src-v-angular-core.mjs +34 -0
  211. package/fesm2022/sebgroup-green-angular-src-v-angular-core.mjs.map +1 -1
  212. package/fesm2022/sebgroup-green-angular-src-v-angular-datepicker.mjs +1759 -0
  213. package/fesm2022/sebgroup-green-angular-src-v-angular-datepicker.mjs.map +1 -0
  214. package/fesm2022/sebgroup-green-angular-src-v-angular-drag-drop.mjs +687 -0
  215. package/fesm2022/sebgroup-green-angular-src-v-angular-drag-drop.mjs.map +1 -0
  216. package/fesm2022/sebgroup-green-angular-src-v-angular-dropdown.mjs +126 -74
  217. package/fesm2022/sebgroup-green-angular-src-v-angular-dropdown.mjs.map +1 -1
  218. package/fesm2022/sebgroup-green-angular-src-v-angular-external-link.mjs +12 -12
  219. package/fesm2022/sebgroup-green-angular-src-v-angular-external-link.mjs.map +1 -1
  220. package/fesm2022/sebgroup-green-angular-src-v-angular-i18n.mjs +17 -17
  221. package/fesm2022/sebgroup-green-angular-src-v-angular-i18n.mjs.map +1 -1
  222. package/fesm2022/sebgroup-green-angular-src-v-angular-info-circle.mjs +15 -15
  223. package/fesm2022/sebgroup-green-angular-src-v-angular-info-circle.mjs.map +1 -1
  224. package/fesm2022/sebgroup-green-angular-src-v-angular-input-mask.mjs +14 -14
  225. package/fesm2022/sebgroup-green-angular-src-v-angular-input-mask.mjs.map +1 -1
  226. package/fesm2022/sebgroup-green-angular-src-v-angular-input.mjs +36 -35
  227. package/fesm2022/sebgroup-green-angular-src-v-angular-input.mjs.map +1 -1
  228. package/fesm2022/sebgroup-green-angular-src-v-angular-modal.mjs +246 -81
  229. package/fesm2022/sebgroup-green-angular-src-v-angular-modal.mjs.map +1 -1
  230. package/fesm2022/sebgroup-green-angular-src-v-angular-pagination.mjs +185 -0
  231. package/fesm2022/sebgroup-green-angular-src-v-angular-pagination.mjs.map +1 -0
  232. package/fesm2022/sebgroup-green-angular-src-v-angular-radio.mjs +24 -21
  233. package/fesm2022/sebgroup-green-angular-src-v-angular-radio.mjs.map +1 -1
  234. package/fesm2022/sebgroup-green-angular-src-v-angular-slug.mjs +6 -6
  235. package/fesm2022/sebgroup-green-angular-src-v-angular-slug.mjs.map +1 -1
  236. package/fesm2022/sebgroup-green-angular-src-v-angular-table.mjs +585 -0
  237. package/fesm2022/sebgroup-green-angular-src-v-angular-table.mjs.map +1 -0
  238. package/fesm2022/sebgroup-green-angular-src-v-angular-tabs.mjs +367 -0
  239. package/fesm2022/sebgroup-green-angular-src-v-angular-tabs.mjs.map +1 -0
  240. package/fesm2022/sebgroup-green-angular-src-v-angular-textarea.mjs +33 -18
  241. package/fesm2022/sebgroup-green-angular-src-v-angular-textarea.mjs.map +1 -1
  242. package/fesm2022/sebgroup-green-angular-src-v-angular-toast.mjs +166 -0
  243. package/fesm2022/sebgroup-green-angular-src-v-angular-toast.mjs.map +1 -0
  244. package/fesm2022/sebgroup-green-angular-src-v-angular-tooltip.mjs +103 -24
  245. package/fesm2022/sebgroup-green-angular-src-v-angular-tooltip.mjs.map +1 -1
  246. package/fesm2022/sebgroup-green-angular-v-angular.mjs +6295 -2165
  247. package/fesm2022/sebgroup-green-angular-v-angular.mjs.map +1 -1
  248. package/package.json +51 -3
  249. package/src/v-angular/account-number/README.md +70 -0
  250. package/src/v-angular/account-number/account-number.module.d.ts +8 -0
  251. package/src/v-angular/account-number/account-number.pipe.d.ts +32 -0
  252. package/src/v-angular/account-number/index.d.ts +2 -0
  253. package/src/v-angular/alert/alert.component.d.ts +19 -0
  254. package/src/v-angular/alert/alert.models.d.ts +13 -0
  255. package/src/v-angular/alert/alert.module.d.ts +8 -0
  256. package/src/v-angular/alert/index.d.ts +3 -0
  257. package/src/v-angular/base-control-value-accessor/base-control-value-accessor.component.d.ts +10 -4
  258. package/src/v-angular/base-control-value-accessor/base-control-value-accessor.module.d.ts +4 -4
  259. package/src/v-angular/breadcrumbs/breadcrumbs.component.d.ts +4 -4
  260. package/src/v-angular/breadcrumbs/breadcrumbs.module.d.ts +4 -4
  261. package/src/v-angular/button/button.component.d.ts +5 -5
  262. package/src/v-angular/button/button.module.d.ts +4 -4
  263. package/src/v-angular/card/card.component.d.ts +3 -3
  264. package/src/v-angular/card/card.module.d.ts +4 -4
  265. package/src/v-angular/character-countdown/character-countdown.module.d.ts +4 -4
  266. package/src/v-angular/checkbox/checkbox.component.d.ts +6 -5
  267. package/src/v-angular/checkbox/checkbox.module.d.ts +5 -4
  268. package/src/v-angular/core/core.utils.d.ts +1 -0
  269. package/src/v-angular/datepicker/components/calendar/calendar.component.d.ts +36 -0
  270. package/src/v-angular/datepicker/components/calendar-control/calendar-control.component.d.ts +30 -0
  271. package/src/v-angular/datepicker/components/date-input/date-input.component.d.ts +102 -0
  272. package/src/v-angular/datepicker/components/datepicker/datepicker.component.d.ts +62 -0
  273. package/src/v-angular/datepicker/date-control-value-accessor/date-control-value-accessor.component.d.ts +165 -0
  274. package/src/v-angular/datepicker/datepicker.globals.d.ts +13 -0
  275. package/src/v-angular/datepicker/datepicker.models.d.ts +50 -0
  276. package/src/v-angular/datepicker/datepicker.module.d.ts +19 -0
  277. package/src/v-angular/datepicker/datepicker.utils.d.ts +39 -0
  278. package/src/v-angular/datepicker/directives/calendar-date.directive.d.ts +21 -0
  279. package/src/v-angular/datepicker/index.d.ts +13 -0
  280. package/src/v-angular/datepicker/models/dates.d.ts +15 -0
  281. package/src/v-angular/datepicker/pipes/date-thook.pipe.d.ts +8 -0
  282. package/src/v-angular/datepicker/pipes/is-disabled.pipe.d.ts +8 -0
  283. package/src/v-angular/datepicker/pipes/matches.pipe.d.ts +7 -0
  284. package/src/v-angular/drag-drop/drag-drop.component.d.ts +131 -0
  285. package/src/v-angular/drag-drop/drag-drop.models.d.ts +49 -0
  286. package/src/v-angular/drag-drop/drag-drop.module.d.ts +13 -0
  287. package/src/v-angular/drag-drop/drag-drop.pipes.d.ts +40 -0
  288. package/src/v-angular/drag-drop/drag-drop.utils.d.ts +33 -0
  289. package/src/v-angular/drag-drop/index.d.ts +4 -0
  290. package/src/v-angular/dropdown/dropdown-list/dropdown-list.component.d.ts +11 -4
  291. package/src/v-angular/dropdown/dropdown.component.d.ts +10 -6
  292. package/src/v-angular/dropdown/dropdown.module.d.ts +8 -7
  293. package/src/v-angular/dropdown/typeahead/typeahead-dropdown-list/typeahead-dropdown-list.component.d.ts +6 -6
  294. package/src/v-angular/dropdown/typeahead/typeahead-highlight/typeahead-highlight.component.d.ts +3 -3
  295. package/src/v-angular/dropdown/typeahead/typeahead-input/typeahead-input.component.d.ts +8 -6
  296. package/src/v-angular/dropdown/typeahead/typeahead.directive.d.ts +14 -12
  297. package/src/v-angular/dropdown/typeahead/typeahead.module.d.ts +4 -4
  298. package/src/v-angular/external-link/external-link.directive.d.ts +3 -3
  299. package/src/v-angular/external-link/external-link.module.d.ts +4 -4
  300. package/src/v-angular/i18n/i18n.module.d.ts +7 -7
  301. package/src/v-angular/i18n/i18n.test.module.d.ts +4 -4
  302. package/src/v-angular/info-circle/info-circle.component.d.ts +4 -4
  303. package/src/v-angular/info-circle/info-circle.module.d.ts +4 -4
  304. package/src/v-angular/input/input.component.d.ts +5 -10
  305. package/src/v-angular/input/input.module.d.ts +5 -4
  306. package/src/v-angular/input-mask/input-mask.directive.d.ts +3 -3
  307. package/src/v-angular/input-mask/input-mask.module.d.ts +5 -5
  308. package/src/v-angular/modal/dialog/dialog.component.d.ts +16 -7
  309. package/src/v-angular/modal/fold-out/fold-out.component.d.ts +34 -11
  310. package/src/v-angular/modal/fold-out/fold-out.directive.d.ts +3 -3
  311. package/src/v-angular/modal/fold-out/keyboard-key.enum.d.ts +7 -0
  312. package/src/v-angular/modal/modal.module.d.ts +4 -4
  313. package/src/v-angular/modal/slide-out/slide-out.component.d.ts +13 -6
  314. package/src/v-angular/pagination/index.d.ts +2 -0
  315. package/src/v-angular/pagination/pagination.component.d.ts +64 -0
  316. package/src/v-angular/pagination/pagination.module.d.ts +12 -0
  317. package/src/v-angular/radio/radio.component.d.ts +14 -13
  318. package/src/v-angular/radio/radio.module.d.ts +5 -4
  319. package/src/v-angular/slug/slug.module.d.ts +4 -4
  320. package/src/v-angular/table/index.d.ts +5 -0
  321. package/src/v-angular/table/table.component.d.ts +229 -0
  322. package/src/v-angular/table/table.directive.d.ts +36 -0
  323. package/src/v-angular/table/table.models.d.ts +62 -0
  324. package/src/v-angular/table/table.module.d.ts +12 -0
  325. package/src/v-angular/table/table.tools.d.ts +5 -0
  326. package/src/v-angular/table/tr-thook.pipe.d.ts +7 -0
  327. package/src/v-angular/tabs/index.d.ts +4 -0
  328. package/src/v-angular/tabs/tab.directive.d.ts +37 -0
  329. package/src/v-angular/tabs/tabs.component.d.ts +65 -0
  330. package/src/v-angular/tabs/tabs.models.d.ts +25 -0
  331. package/src/v-angular/tabs/tabs.module.d.ts +11 -0
  332. package/src/v-angular/textarea/textarea.component.d.ts +6 -5
  333. package/src/v-angular/textarea/textarea.module.d.ts +6 -4
  334. package/src/v-angular/toast/index.d.ts +4 -0
  335. package/src/v-angular/toast/toast-message.service.d.ts +17 -0
  336. package/src/v-angular/toast/toast.component.d.ts +22 -0
  337. package/src/v-angular/toast/toast.models.d.ts +15 -0
  338. package/src/v-angular/toast/toast.module.d.ts +10 -0
  339. package/src/v-angular/tooltip/tooltip.directive.d.ts +5 -3
  340. package/src/v-angular/tooltip/tooltip.module.d.ts +4 -4
  341. package/src/v-angular/tooltip/tooltip.styles.d.ts +11 -0
  342. package/v-angular/alert/alert.component.d.ts +19 -0
  343. package/v-angular/alert/alert.models.d.ts +13 -0
  344. package/v-angular/alert/alert.module.d.ts +8 -0
  345. package/v-angular/alert/index.d.ts +3 -0
  346. package/v-angular/base-control-value-accessor/base-control-value-accessor.component.d.ts +10 -4
  347. package/v-angular/base-control-value-accessor/base-control-value-accessor.module.d.ts +4 -4
  348. package/v-angular/breadcrumbs/breadcrumbs.component.d.ts +4 -4
  349. package/v-angular/breadcrumbs/breadcrumbs.module.d.ts +4 -4
  350. package/v-angular/button/button.component.d.ts +5 -5
  351. package/v-angular/button/button.module.d.ts +4 -4
  352. package/v-angular/card/card.component.d.ts +3 -3
  353. package/v-angular/card/card.module.d.ts +4 -4
  354. package/v-angular/character-countdown/character-countdown.module.d.ts +4 -4
  355. package/v-angular/checkbox/checkbox.component.d.ts +6 -5
  356. package/v-angular/checkbox/checkbox.module.d.ts +5 -4
  357. package/v-angular/datepicker/components/calendar/calendar.component.d.ts +36 -0
  358. package/v-angular/datepicker/components/calendar-control/calendar-control.component.d.ts +30 -0
  359. package/v-angular/datepicker/components/date-input/date-input.component.d.ts +102 -0
  360. package/v-angular/datepicker/components/datepicker/datepicker.component.d.ts +62 -0
  361. package/v-angular/datepicker/date-control-value-accessor/date-control-value-accessor.component.d.ts +165 -0
  362. package/v-angular/datepicker/datepicker.globals.d.ts +13 -0
  363. package/v-angular/datepicker/datepicker.models.d.ts +50 -0
  364. package/v-angular/datepicker/datepicker.module.d.ts +19 -0
  365. package/v-angular/datepicker/datepicker.utils.d.ts +39 -0
  366. package/v-angular/datepicker/directives/calendar-date.directive.d.ts +21 -0
  367. package/v-angular/datepicker/index.d.ts +13 -0
  368. package/v-angular/datepicker/models/dates.d.ts +15 -0
  369. package/v-angular/datepicker/pipes/date-thook.pipe.d.ts +8 -0
  370. package/v-angular/datepicker/pipes/is-disabled.pipe.d.ts +8 -0
  371. package/v-angular/datepicker/pipes/matches.pipe.d.ts +7 -0
  372. package/v-angular/drag-drop/drag-drop.component.d.ts +131 -0
  373. package/v-angular/drag-drop/drag-drop.models.d.ts +49 -0
  374. package/v-angular/drag-drop/drag-drop.module.d.ts +13 -0
  375. package/v-angular/drag-drop/drag-drop.pipes.d.ts +40 -0
  376. package/v-angular/drag-drop/drag-drop.utils.d.ts +33 -0
  377. package/v-angular/drag-drop/index.d.ts +4 -0
  378. package/v-angular/dropdown/dropdown-list/dropdown-list.component.d.ts +11 -4
  379. package/v-angular/dropdown/dropdown.component.d.ts +10 -6
  380. package/v-angular/dropdown/dropdown.module.d.ts +8 -7
  381. package/v-angular/dropdown/typeahead/typeahead-dropdown-list/typeahead-dropdown-list.component.d.ts +6 -6
  382. package/v-angular/dropdown/typeahead/typeahead-highlight/typeahead-highlight.component.d.ts +3 -3
  383. package/v-angular/dropdown/typeahead/typeahead-input/typeahead-input.component.d.ts +8 -6
  384. package/v-angular/dropdown/typeahead/typeahead.directive.d.ts +14 -12
  385. package/v-angular/dropdown/typeahead/typeahead.module.d.ts +4 -4
  386. package/v-angular/external-link/external-link.directive.d.ts +17 -0
  387. package/v-angular/external-link/external-link.module.d.ts +8 -0
  388. package/v-angular/external-link/index.d.ts +2 -0
  389. package/v-angular/i18n/i18n.module.d.ts +7 -7
  390. package/v-angular/i18n/i18n.test.module.d.ts +4 -4
  391. package/v-angular/index.d.ts +9 -0
  392. package/v-angular/info-circle/info-circle.component.d.ts +4 -4
  393. package/v-angular/info-circle/info-circle.module.d.ts +4 -4
  394. package/v-angular/input/input.component.d.ts +5 -10
  395. package/v-angular/input/input.module.d.ts +5 -4
  396. package/v-angular/input-mask/input-mask.directive.d.ts +3 -3
  397. package/v-angular/input-mask/input-mask.module.d.ts +5 -5
  398. package/v-angular/modal/dialog/dialog.component.d.ts +16 -7
  399. package/v-angular/modal/fold-out/fold-out.component.d.ts +34 -11
  400. package/v-angular/modal/fold-out/fold-out.directive.d.ts +3 -3
  401. package/v-angular/modal/fold-out/keyboard-key.enum.d.ts +7 -0
  402. package/v-angular/modal/modal.module.d.ts +4 -4
  403. package/v-angular/modal/slide-out/slide-out.component.d.ts +13 -6
  404. package/v-angular/pagination/index.d.ts +2 -0
  405. package/v-angular/pagination/pagination.component.d.ts +64 -0
  406. package/v-angular/pagination/pagination.module.d.ts +12 -0
  407. package/v-angular/radio/radio.component.d.ts +14 -13
  408. package/v-angular/radio/radio.module.d.ts +5 -4
  409. package/v-angular/slug/index.d.ts +2 -0
  410. package/v-angular/slug/slug.module.d.ts +8 -0
  411. package/v-angular/slug/slug.pipe.d.ts +12 -0
  412. package/v-angular/table/index.d.ts +5 -0
  413. package/v-angular/table/table.component.d.ts +229 -0
  414. package/v-angular/table/table.directive.d.ts +36 -0
  415. package/v-angular/table/table.models.d.ts +62 -0
  416. package/v-angular/table/table.module.d.ts +12 -0
  417. package/v-angular/table/table.tools.d.ts +5 -0
  418. package/v-angular/table/tr-thook.pipe.d.ts +7 -0
  419. package/v-angular/tabs/index.d.ts +4 -0
  420. package/v-angular/tabs/tab.directive.d.ts +37 -0
  421. package/v-angular/tabs/tabs.component.d.ts +65 -0
  422. package/v-angular/tabs/tabs.models.d.ts +25 -0
  423. package/v-angular/tabs/tabs.module.d.ts +11 -0
  424. package/v-angular/textarea/textarea.component.d.ts +6 -5
  425. package/v-angular/textarea/textarea.module.d.ts +6 -4
  426. package/v-angular/toast/index.d.ts +4 -0
  427. package/v-angular/toast/toast-message.service.d.ts +17 -0
  428. package/v-angular/toast/toast.component.d.ts +22 -0
  429. package/v-angular/toast/toast.models.d.ts +15 -0
  430. package/v-angular/toast/toast.module.d.ts +10 -0
  431. package/v-angular/tooltip/tooltip.directive.d.ts +5 -3
  432. package/v-angular/tooltip/tooltip.module.d.ts +4 -4
  433. package/v-angular/tooltip/tooltip.styles.d.ts +11 -0
  434. package/v-angular/v-angular.module.d.ts +27 -18
@@ -0,0 +1,1759 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, TemplateRef, ElementRef, Directive, Self, Optional, Inject, ContentChild, ViewChild, HostBinding, Input, Output, Pipe, Component, ViewChildren, HostListener, Injectable, NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
3
+ import * as i1 from '@angular/forms';
4
+ import { Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
5
+ import * as i2 from '@jsverse/transloco';
6
+ import { TRANSLOCO_SCOPE, TranslocoModule } from '@jsverse/transloco';
7
+ import { Subject, fromEvent } from 'rxjs';
8
+ import { takeUntil, debounceTime, map, distinctUntilChanged, startWith } from 'rxjs/operators';
9
+ import * as i4 from '@sebgroup/green-angular/src/v-angular/input-mask';
10
+ import { createMask, NggvInputMaskModule } from '@sebgroup/green-angular/src/v-angular/input-mask';
11
+ import * as i1$1 from '@angular/common';
12
+ import { WeekDay, formatDate, CommonModule } from '@angular/common';
13
+ import '@sebgroup/green-core/components/icon/icons/chevron-left.js';
14
+ import '@sebgroup/green-core/components/icon/icons/chevron-right.js';
15
+ import * as i3 from '@sebgroup/green-angular/src/lib/shared';
16
+ import { NggCoreWrapperModule } from '@sebgroup/green-angular/src/lib/shared';
17
+ import '@sebgroup/green-core/components/icon/icons/calendar.js';
18
+ import '@sebgroup/green-core/components/icon/icons/triangle-exclamation.js';
19
+
20
+ /**
21
+ * Helper function to generate InputmaskOptions by requested locale.
22
+ * @param locale - requested locale. If not given, it'll use the browsers locale
23
+ * @returns InputmaskOptions with date settings
24
+ */
25
+ const getLocaleDateMask = (dateCharacters, locale) => {
26
+ // If no locale has been passed, use browser language
27
+ if (!locale)
28
+ locale = navigator.language;
29
+ const format = getLocaleDateString(locale).toLowerCase();
30
+ return getFormatDateMask(format, dateCharacters);
31
+ };
32
+ const getLocaleDateString = (locale) => locale && dateFormats[locale] ? dateFormats[locale] : 'yyyy-MM-dd';
33
+ const dateFormats = {
34
+ 'af-ZA': 'yyyy/MM/dd',
35
+ 'am-ET': 'dd/MM/yyyy',
36
+ 'ar-AE': 'dd/MM/yyyy',
37
+ 'ar-BH': 'dd/MM/yyyy',
38
+ 'ar-DZ': 'dd-MM-yyyy',
39
+ 'ar-EG': 'dd/MM/yyyy',
40
+ 'ar-IQ': 'dd/MM/yyyy',
41
+ 'ar-JO': 'dd/MM/yyyy',
42
+ 'ar-KW': 'dd/MM/yyyy',
43
+ 'ar-LB': 'dd/MM/yyyy',
44
+ 'ar-LY': 'dd/MM/yyyy',
45
+ 'ar-MA': 'dd-MM-yyyy',
46
+ 'ar-OM': 'dd/MM/yyyy',
47
+ 'ar-QA': 'dd/MM/yyyy',
48
+ 'ar-SA': 'dd/MM/yyyy',
49
+ 'ar-SY': 'dd/MM/yyyy',
50
+ 'ar-TN': 'dd-MM-yyyy',
51
+ 'ar-YE': 'dd/MM/yyyy',
52
+ 'arn-CL': 'dd-MM-yyyy',
53
+ 'as-IN': 'dd-MM-yyyy',
54
+ 'az-Cyrl-AZ': 'dd.MM.yyyy',
55
+ 'az-Latn-AZ': 'dd.MM.yyyy',
56
+ 'ba-RU': 'dd.MM.yyyy',
57
+ 'be-BY': 'dd.MM.yyyy',
58
+ 'bg-BG': 'dd.MM.yyyy',
59
+ 'bn-BD': 'dd-MM-yyyy',
60
+ 'bn-IN': 'dd-MM-yyyy',
61
+ 'bo-CN': 'yyyy/MM/dd',
62
+ 'br-FR': 'dd/MM/yyyy',
63
+ 'bs-Cyrl-BA': 'dd.MM.yyyy',
64
+ 'bs-Latn-BA': 'dd.MM.yyyy',
65
+ 'ca-ES': 'dd/MM/yyyy',
66
+ 'co-FR': 'dd/MM/yyyy',
67
+ 'cs-CZ': 'dd.MM.yyyy',
68
+ 'cy-GB': 'dd/MM/yyyy',
69
+ 'da-DK': 'dd.MM.yyyy',
70
+ 'de-AT': 'dd.MM.yyyy',
71
+ 'de-CH': 'dd.MM.yyyy',
72
+ 'de-DE': 'dd.MM.yyyy',
73
+ 'de-LI': 'dd.MM.yyyy',
74
+ 'de-LU': 'dd.MM.yyyy',
75
+ 'dsb-DE': 'dd.MM.yyyy',
76
+ 'dv-MV': 'dd/MM/yyyy',
77
+ 'el-GR': 'dd/MM/yyyy',
78
+ en: 'MM/dd/yyyy',
79
+ 'en-029': 'MM/dd/yyyy',
80
+ 'en-AU': 'dd/MM/yyyy',
81
+ 'en-BZ': 'dd/MM/yyyy',
82
+ 'en-CA': 'dd/MM/yyyy',
83
+ 'en-GB': 'dd/MM/yyyy',
84
+ 'en-IE': 'dd/MM/yyyy',
85
+ 'en-IN': 'dd-MM-yyyy',
86
+ 'en-JM': 'dd/MM/yyyy',
87
+ 'en-MY': 'dd/MM/yyyy',
88
+ 'en-NZ': 'dd/MM/yyyy',
89
+ 'en-PH': 'MM/dd/yyyy',
90
+ 'en-SG': 'dd/MM/yyyy',
91
+ 'en-TT': 'dd/MM/yyyy',
92
+ 'en-US': 'MM/dd/yyyy',
93
+ 'en-ZA': 'yyyy/MM/dd',
94
+ 'en-ZW': 'MM/dd/yyyy',
95
+ 'es-AR': 'dd/MM/yyyy',
96
+ 'es-BO': 'dd/MM/yyyy',
97
+ 'es-CL': 'dd-MM-yyyy',
98
+ 'es-CO': 'dd/MM/yyyy',
99
+ 'es-CR': 'dd/MM/yyyy',
100
+ 'es-DO': 'dd/MM/yyyy',
101
+ 'es-EC': 'dd/MM/yyyy',
102
+ 'es-ES': 'dd/MM/yyyy',
103
+ 'es-GT': 'dd/MM/yyyy',
104
+ 'es-HN': 'dd/MM/yyyy',
105
+ 'es-MX': 'dd/MM/yyyy',
106
+ 'es-NI': 'dd/MM/yyyy',
107
+ 'es-PA': 'MM/dd/yyyy',
108
+ 'es-PE': 'dd/MM/yyyy',
109
+ 'es-PR': 'dd/MM/yyyy',
110
+ 'es-PY': 'dd/MM/yyyy',
111
+ 'es-SV': 'dd/MM/yyyy',
112
+ 'es-US': 'MM/dd/yyyy',
113
+ 'es-UY': 'dd/MM/yyyy',
114
+ 'es-VE': 'dd/MM/yyyy',
115
+ 'et-EE': 'dd.MM.yyyy',
116
+ 'eu-ES': 'yyyy/MM/dd',
117
+ 'fa-IR': 'MM/dd/yyyy',
118
+ 'fi-FI': 'dd.MM.yyyy',
119
+ 'fil-PH': 'MM/dd/yyyy',
120
+ 'fo-FO': 'dd-MM-yyyy',
121
+ 'fr-BE': 'dd/MM/yyyy',
122
+ 'fr-CA': 'yyyy-MM-dd',
123
+ 'fr-CH': 'dd.MM.yyyy',
124
+ 'fr-FR': 'dd/MM/yyyy',
125
+ 'fr-LU': 'dd/MM/yyyy',
126
+ 'fr-MC': 'dd/MM/yyyy',
127
+ 'fy-NL': 'dd-MM-yyyy',
128
+ 'ga-IE': 'dd/MM/yyyy',
129
+ 'gd-GB': 'dd/MM/yyyy',
130
+ 'gl-ES': 'dd/MM/yyyy',
131
+ 'gsw-FR': 'dd/MM/yyyy',
132
+ 'gu-IN': 'dd-MM-yyyy',
133
+ 'ha-Latn-NG': 'dd/MM/yyyy',
134
+ 'he-IL': 'dd/MM/yyyy',
135
+ 'hi-IN': 'dd-MM-yyyy',
136
+ 'hr-BA': 'dd.MM.yyyy.',
137
+ 'hr-HR': 'dd.MM.yyyy',
138
+ 'hsb-DE': 'dd.MM.yyyy',
139
+ 'hu-HU': 'yyyy.MM.dd.',
140
+ 'hy-AM': 'dd.MM.yyyy',
141
+ 'id-ID': 'dd/MM/yyyy',
142
+ 'ig-NG': 'dd/MM/yyyy',
143
+ 'ii-CN': 'yyyy/MM/dd',
144
+ 'is-IS': 'dd.MM.yyyy',
145
+ 'it-CH': 'dd.MM.yyyy',
146
+ 'it-IT': 'dd/MM/yyyy',
147
+ 'iu-Cans-CA': 'dd/MM/yyyy',
148
+ 'iu-Latn-CA': 'dd/MM/yyyy',
149
+ 'ja-JP': 'yyyy/MM/dd',
150
+ 'ka-GE': 'dd.MM.yyyy',
151
+ 'kk-KZ': 'dd.MM.yyyy',
152
+ 'kl-GL': 'dd-MM-yyyy',
153
+ 'km-KH': 'yyyy-MM-dd',
154
+ 'kn-IN': 'dd-MM-yyyy',
155
+ 'ko-KR': 'yyyy.MM.dd',
156
+ 'kok-IN': 'dd-MM-yyyy',
157
+ 'ky-KG': 'dd.MM.yyyy',
158
+ 'lb-LU': 'dd/MM/yyyy',
159
+ 'lo-LA': 'dd/MM/yyyy',
160
+ 'lt-LT': 'yyyy.MM.dd',
161
+ 'lv-LV': 'yyyy.MM.dd.',
162
+ 'mi-NZ': 'dd/MM/yyyy',
163
+ 'mk-MK': 'dd.MM.yyyy',
164
+ 'ml-IN': 'dd-MM-yyyy',
165
+ 'mn-MN': 'yyyy.MM.dd',
166
+ 'mn-Mong-CN': 'yyyy/MM/dd',
167
+ 'moh-CA': 'MM/dd/yyyy',
168
+ 'mr-IN': 'dd-MM-yyyy',
169
+ 'ms-BN': 'dd/MM/yyyy',
170
+ 'ms-MY': 'dd/MM/yyyy',
171
+ 'mt-MT': 'dd/MM/yyyy',
172
+ 'nb-NO': 'dd.MM.yyyy',
173
+ 'ne-NP': 'MM/dd/yyyy',
174
+ 'nl-BE': 'dd/MM/yyyy',
175
+ 'nl-NL': 'dd-MM-yyyy',
176
+ 'nn-NO': 'dd.MM.yyyy',
177
+ 'nso-ZA': 'yyyy/MM/dd',
178
+ 'oc-FR': 'dd/MM/yyyy',
179
+ 'or-IN': 'dd-MM-yyyy',
180
+ 'pa-IN': 'dd-MM-yyyy',
181
+ 'pl-PL': 'dd.MM.yyyy',
182
+ 'prs-AF': 'dd/MM/yyyy',
183
+ 'ps-AF': 'dd/MM/yyyy',
184
+ 'pt-BR': 'dd/MM/yyyy',
185
+ 'pt-PT': 'dd-MM-yyyy',
186
+ 'qut-GT': 'dd/MM/yyyy',
187
+ 'quz-BO': 'dd/MM/yyyy',
188
+ 'quz-EC': 'dd/MM/yyyy',
189
+ 'quz-PE': 'dd/MM/yyyy',
190
+ 'rm-CH': 'dd/MM/yyyy',
191
+ 'ro-RO': 'dd.MM.yyyy',
192
+ 'ru-RU': 'dd.MM.yyyy',
193
+ 'rw-RW': 'MM/dd/yyyy',
194
+ 'sa-IN': 'dd-MM-yyyy',
195
+ 'sah-RU': 'MM.dd.yyyy',
196
+ se: 'yyyy-MM-dd',
197
+ 'se-FI': 'dd.MM.yyyy',
198
+ 'se-NO': 'dd.MM.yyyy',
199
+ 'se-SE': 'yyyy-MM-dd',
200
+ 'si-LK': 'yyyy-MM-dd',
201
+ 'sk-SK': 'dd.MM.yyyy',
202
+ 'sl-SI': 'dd.MM.yyyy',
203
+ 'sma-NO': 'dd.MM.yyyy',
204
+ 'sma-SE': 'yyyy-MM-dd',
205
+ 'smj-NO': 'dd.MM.yyyy',
206
+ 'smj-SE': 'yyyy-MM-dd',
207
+ 'smn-FI': 'dd.MM.yyyy',
208
+ 'sms-FI': 'dd.MM.yyyy',
209
+ 'sq-AL': 'yyyy-MM-dd',
210
+ 'sr-Cyrl-BA': 'dd.MM.yyyy',
211
+ 'sr-Cyrl-CS': 'dd.MM.yyyy',
212
+ 'sr-Cyrl-ME': 'dd.MM.yyyy',
213
+ 'sr-Cyrl-RS': 'dd.MM.yyyy',
214
+ 'sr-Latn-BA': 'dd.MM.yyyy',
215
+ 'sr-Latn-CS': 'dd.MM.yyyy',
216
+ 'sr-Latn-ME': 'dd.MM.yyyy',
217
+ 'sr-Latn-RS': 'dd.MM.yyyy',
218
+ sv: 'yyyy-MM-dd',
219
+ 'sv-FI': 'dd.MM.yyyy',
220
+ 'sv-SE': 'yyyy-MM-dd',
221
+ 'sw-KE': 'MM/dd/yyyy',
222
+ 'syr-SY': 'dd/MM/yyyy',
223
+ 'ta-IN': 'dd-MM-yyyy',
224
+ 'te-IN': 'dd-MM-yyyy',
225
+ 'tg-Cyrl-TJ': 'dd.MM.yyyy',
226
+ 'th-TH': 'dd/MM/yyyy',
227
+ 'tk-TM': 'dd.MM.yyyy',
228
+ 'tn-ZA': 'yyyy/MM/dd',
229
+ 'tr-TR': 'dd.MM.yyyy',
230
+ 'tt-RU': 'dd.MM.yyyy',
231
+ 'tzm-Latn-DZ': 'dd-MM-yyyy',
232
+ 'ug-CN': 'yyyy-MM-dd',
233
+ 'uk-UA': 'dd.MM.yyyy',
234
+ 'ur-PK': 'dd/MM/yyyy',
235
+ 'uz-Cyrl-UZ': 'dd.MM.yyyy',
236
+ 'uz-Latn-UZ': 'dd/MM yyyy',
237
+ 'vi-VN': 'dd/MM/yyyy',
238
+ 'wo-SN': 'dd/MM/yyyy',
239
+ 'xh-ZA': 'yyyy/MM/dd',
240
+ 'yo-NG': 'dd/MM/yyyy',
241
+ 'zh-CN': 'yyyy/MM/dd',
242
+ 'zh-HK': 'dd/MM/yyyy',
243
+ 'zh-MO': 'dd/MM/yyyy',
244
+ 'zh-SG': 'dd/MM/yyyy',
245
+ 'zh-TW': 'yyyy/MM/dd',
246
+ 'zu-ZA': 'yyyy/MM/dd',
247
+ };
248
+ const getFormatDateMask = (format, dateCharacters) => {
249
+ const separators = [' ', '.', '-', '/'];
250
+ const separator = separators.find((operator) => format.indexOf(operator) > -1) ?? '-';
251
+ const dateObjects = format.split(separator);
252
+ const year = { key: 'year', index: 0 }, month = { key: 'month', index: 1 }, day = { key: 'day', index: 2 };
253
+ dateObjects.forEach((dateObject, index) => {
254
+ switch (dateObject[0]) {
255
+ case 'y':
256
+ year.index = index;
257
+ break;
258
+ case 'm':
259
+ month.index = index;
260
+ break;
261
+ case 'd':
262
+ day.index = index;
263
+ break;
264
+ }
265
+ });
266
+ const placeholder = setDateFormatCharacters(format, dateCharacters);
267
+ return createMask({
268
+ alias: 'datetime',
269
+ inputFormat: format,
270
+ placeholder,
271
+ parser: (value) => {
272
+ const values = value.split(separator);
273
+ const y = +values[year.index];
274
+ const m = +values[month.index] - 1;
275
+ const d = +values[day.index];
276
+ return new Date(y, m, d);
277
+ },
278
+ onBeforeMask(initialValue) {
279
+ if (!initialValue || typeof initialValue !== 'string')
280
+ return '';
281
+ // If initialValues is in dateTime format, remove seconds that present after the "T"
282
+ if (initialValue.includes('T'))
283
+ initialValue = initialValue.split('T')[0];
284
+ // initialValue should always be in yyyy-mm-dd no matter if set from control, via datepicker or manually with keyboard
285
+ const values = initialValue.split('-');
286
+ const datePartsInOrder = [year, month, day].sort((a, b) => a.index - b.index);
287
+ // "Insert" correct values for the year/month/day, then join to string with separator
288
+ return datePartsInOrder
289
+ .map(({ key }) => {
290
+ const [yearValue, monthValue, dateValue] = values;
291
+ if (key === 'year')
292
+ return yearValue;
293
+ if (key === 'month')
294
+ return monthValue;
295
+ return dateValue;
296
+ })
297
+ .join(separator);
298
+ },
299
+ });
300
+ };
301
+ const setDateFormatCharacters = (format, dateCharacters) => {
302
+ if (!dateCharacters)
303
+ return format;
304
+ format = format.replace(/y/g, dateCharacters.year);
305
+ format = format.replace(/m/g, dateCharacters.month);
306
+ format = format.replace(/d/g, dateCharacters.day);
307
+ return format;
308
+ };
309
+
310
+ // eslint-disable-next-line @angular-eslint/directive-class-suffix
311
+ class DateControlValueAccessorComponent {
312
+ /** Text shown before input has a written value. Default current date format by locale of transloco */
313
+ set placeholder(value) {
314
+ this._placeholder = value
315
+ ? setDateFormatCharacters(value, this.dateCharacters)
316
+ : value;
317
+ this.defaultPlaceholder = value
318
+ ? setDateFormatCharacters(value, this.dateCharacters)
319
+ : value;
320
+ }
321
+ get placeholder() {
322
+ return this._placeholder;
323
+ }
324
+ /**
325
+ * Settings for input mask for dates based on locale
326
+ * @see {@link getLocaleDateMask} use this tool to generate settings for `dateInputMask`
327
+ */
328
+ set dateInputMask(dateMask) {
329
+ // Hide input field
330
+ this.showInputDateSrc.next(false);
331
+ this.cdr.detectChanges();
332
+ this._dateInputMask = dateMask;
333
+ // Show input field to reload input-mask settings upon update
334
+ setTimeout(() => {
335
+ this.showInputDateSrc.next(true);
336
+ this.cdr.detectChanges();
337
+ }, 200);
338
+ }
339
+ get dateInputMask() {
340
+ return this._dateInputMask;
341
+ }
342
+ /** Hides the input borders and displays current value as a text. */
343
+ set locked(value) {
344
+ this._locked = value;
345
+ this.cdr.detectChanges();
346
+ }
347
+ get locked() {
348
+ return this._locked;
349
+ }
350
+ /** Override the required flag of the component. */
351
+ set required(value) {
352
+ this._required = value;
353
+ }
354
+ /** Child input element is considered required and changes default label template accordingly. */
355
+ get required() {
356
+ // if required is set => return required
357
+ if (this._required !== undefined)
358
+ return this._required;
359
+ // if required can be determined from the control => return control.required
360
+ if (this.ngControl?.control?.validator) {
361
+ const validator = this.ngControl?.control?.validator({});
362
+ return validator && validator.required;
363
+ }
364
+ return;
365
+ }
366
+ /** Override the invalid state of the component. */
367
+ set invalid(value) {
368
+ this._invalid = value;
369
+ }
370
+ /** The component has the invalid state, usually decorating the elements red and shows the first error. */
371
+ get invalid() {
372
+ if (this._invalid === true || this._invalid === false)
373
+ return this._invalid;
374
+ return (!!this.ngControl?.control?.invalid && this.ngControl?.control?.touched);
375
+ }
376
+ /** Override the valid state of the component. */
377
+ set valid(value) {
378
+ this._valid = value;
379
+ }
380
+ /** The component has the valid state, usually decorating the elements green. */
381
+ get valid() {
382
+ if (this._valid === true || this._valid === false)
383
+ return this._valid;
384
+ return !!this.ngControl?.control?.valid && this.ngControl?.control?.touched;
385
+ }
386
+ /**
387
+ * Creates a new BaseControlValueAccessorComponent.
388
+ * @param ngControl optional FormControl provided when component is used in a form, through dependency injection.
389
+ */
390
+ constructor(ngControl, translocoScope, elementRef, cdr, _transloco) {
391
+ this.ngControl = ngControl;
392
+ this.translocoScope = translocoScope;
393
+ this.elementRef = elementRef;
394
+ this.cdr = cdr;
395
+ this._transloco = _transloco;
396
+ /* ATTRIBUTES */
397
+ /** Id of the host element and is accessible by the children, automatically generated if not provided. */
398
+ this.id = window.ngv?.nextId('datepicker');
399
+ /** Adds an icon before each error message. */
400
+ this.withErrorIcon = false;
401
+ /** If set to true, the browser will try to automatically set focus to the child input element. */
402
+ this.autofocus = false;
403
+ this._locked = undefined;
404
+ /* STATES */
405
+ this._required = undefined;
406
+ this._invalid = undefined;
407
+ this._valid = undefined;
408
+ /** The component has the focused state, updated by the child input element's focus state. */
409
+ this.focused = false;
410
+ /** The component has the disabled state, usually muting the colors and removes interaction. */
411
+ this.disabled = false;
412
+ /** Toggler for showing or hiding the input field */
413
+ this.showInputDateSrc = new Subject();
414
+ /* TRIGGERS */
415
+ /** Emits focus events triggered by the child elements. */
416
+ this.ngvFocus = new EventEmitter();
417
+ /** Emits focus events triggered by the child elements. */
418
+ this.ngvBlur = new EventEmitter();
419
+ /* VALUE HANDLERS */
420
+ /** @internal */
421
+ this.onChange = (_) => { }; // eslint-disable-line @typescript-eslint/no-empty-function
422
+ /** @internal */
423
+ this.onTouched = () => { }; // eslint-disable-line @typescript-eslint/no-empty-function
424
+ /** @internal */
425
+ this.onValidatorChange = () => null;
426
+ this._state = null;
427
+ /** @internal */
428
+ // warningIcon = faTriangleExclamation;
429
+ /* LIFE CYCLE VARIABLES */
430
+ this._onDestroy$ = new Subject();
431
+ if (this.ngControl) {
432
+ // Note: we provide the value accessor through here, instead of
433
+ // the `providers` to avoid running into a circular import.
434
+ this.ngControl.valueAccessor = this;
435
+ }
436
+ if (this.translocoScope)
437
+ this.scope = this.translocoScope.toString();
438
+ }
439
+ static parseDateLike(value) {
440
+ try {
441
+ // if value is type of string,
442
+ if (value && typeof value === 'string')
443
+ value = new Date(value);
444
+ switch (true) {
445
+ // remove instances where the value will not correctly be parsed to a date string
446
+ case value == null:
447
+ case value?.toString() === 'Invalid Date':
448
+ return null;
449
+ // if value-as-date is a valid date object, parse the value to YYYY-MM-DD format
450
+ case typeof value?.getMonth === 'function':
451
+ return new Intl.DateTimeFormat('sv-SE').format(value);
452
+ default:
453
+ return value;
454
+ }
455
+ }
456
+ catch (_e) {
457
+ return;
458
+ }
459
+ }
460
+ // eslint-disable-next-line @angular-eslint/contextual-lifecycle
461
+ ngOnInit() {
462
+ if (this.ngControl && this.ngControl.control) {
463
+ this.ngControl.control.setValidators(Validators.compose([this.ngControl.control.validator, this.validate]));
464
+ }
465
+ this._transloco.langChanges$.pipe(takeUntil(this._onDestroy$)).subscribe({
466
+ next: () => {
467
+ if (!this.locale && !this.dateFormat) {
468
+ return this.updatePlaceholderAndMask();
469
+ }
470
+ },
471
+ });
472
+ // if reset observable has been passed, subscribe after updates
473
+ this.reset?.pipe(takeUntil(this._onDestroy$)).subscribe({
474
+ next: () => {
475
+ // reset value of controller
476
+ this.updateValue('');
477
+ },
478
+ });
479
+ }
480
+ // eslint-disable-next-line @angular-eslint/contextual-lifecycle
481
+ ngAfterViewInit() {
482
+ // if default value is set, then don't alter it. Otherwise, use
483
+ // current value of controller after initiation as default value
484
+ this.defaultValue = this.defaultValue ?? this.ngControl?.value;
485
+ }
486
+ ngOnChanges(changes) {
487
+ if (changes.defaultValue?.currentValue) {
488
+ this.updateValue(changes.defaultValue.currentValue);
489
+ }
490
+ if (changes.locale?.currentValue &&
491
+ !this.dateFormat &&
492
+ !changes.dateFormat?.currentValue) {
493
+ this.updatePlaceholderAndMask();
494
+ }
495
+ if (changes.dateFormat?.currentValue) {
496
+ this.updateFormat();
497
+ }
498
+ if (changes.dateCharacters?.currentValue) {
499
+ if (this.dateFormat) {
500
+ this.updateFormat();
501
+ }
502
+ else {
503
+ this.updatePlaceholderAndMask();
504
+ }
505
+ }
506
+ if (!!changes.dateLocale?.currentValue && !this.dateFormat) {
507
+ this.updatePlaceholderAndMask();
508
+ }
509
+ }
510
+ ngOnDestroy() {
511
+ this._onDestroy$.next(true);
512
+ this._onDestroy$.complete();
513
+ }
514
+ /** @internal */
515
+ onFocus(event) {
516
+ event.stopPropagation
517
+ ? event.stopPropagation()
518
+ : (event.cancelBubble = true);
519
+ this.focused = true;
520
+ this.ngvFocus.emit(event);
521
+ }
522
+ /** @internal */
523
+ onBlur(event) {
524
+ event.stopPropagation
525
+ ? event.stopPropagation()
526
+ : (event.cancelBubble = true);
527
+ this.onTouched();
528
+ this.focused = false;
529
+ this.ngvBlur.emit(event);
530
+ }
531
+ detectChanges() {
532
+ this.cdr.detectChanges();
533
+ }
534
+ /** Sets the focus on the actual input element. */
535
+ setFocus() {
536
+ if (this.inputRef)
537
+ this.inputRef.nativeElement.focus();
538
+ }
539
+ /**
540
+ * @internal
541
+ * Update placeholder and input mask to match locale.
542
+ * Order if choice for locale:
543
+ * 1. dateLocale - Used for specifying which locale to be used for formatting date
544
+ * 2. locale - Unless dateLocale is not provided, use locale form current translation
545
+ * 3. transloco.getActiveLang - as last resort, get active language form trnasloco
546
+ * If locale is undefined, transloco.activeLang will be used instead.
547
+ */
548
+ updatePlaceholderAndMask() {
549
+ const locale = this.dateLocale ?? this.locale ?? this._transloco.getActiveLang();
550
+ this._placeholder = this.defaultPlaceholder
551
+ ? setDateFormatCharacters(this.defaultPlaceholder, this.dateCharacters)
552
+ : setDateFormatCharacters(getLocaleDateString(locale).toLowerCase(), this.dateCharacters);
553
+ this.dateInputMask = getLocaleDateMask(this.dateCharacters, locale);
554
+ }
555
+ updateFormat() {
556
+ if (this.dateFormat) {
557
+ this._placeholder = this.defaultPlaceholder
558
+ ? setDateFormatCharacters(this.defaultPlaceholder, this.dateCharacters)
559
+ : setDateFormatCharacters(this.dateFormat.toLowerCase(), this.dateCharacters);
560
+ this.dateInputMask = getFormatDateMask(this.dateFormat, this.dateCharacters);
561
+ }
562
+ }
563
+ // ----------------------------------------------------------------------------
564
+ // CONTROL VALUE ACCESSOR
565
+ // ----------------------------------------------------------------------------
566
+ /** Internal state/value that the native input element has. */
567
+ get state() {
568
+ return this._state;
569
+ }
570
+ /**
571
+ * Internal state/value that the native input element has.
572
+ */
573
+ set state(value) {
574
+ this._state = value;
575
+ }
576
+ /** Writes a new value to the child input element. */
577
+ writeValue(value) {
578
+ this.state = value;
579
+ this.onChange(this.state);
580
+ }
581
+ /** Registers a callback function that is called when the child input element's value changes. */
582
+ registerOnChange(fn) {
583
+ this.onChange = (value) => {
584
+ // ensure emitted value is a string | null | undefined
585
+ const emitValue = DateControlValueAccessorComponent.parseDateLike(value);
586
+ fn(emitValue);
587
+ };
588
+ }
589
+ /** Registers a callback function that is called when the child input element triggers on blur. */
590
+ registerOnTouched(fn) {
591
+ this.onTouched = fn;
592
+ }
593
+ /** Function that is called by the forms API when the control status changes to or from 'DISABLED'. */
594
+ setDisabledState(isDisabled) {
595
+ this.disabled = isDisabled;
596
+ // if displayDisabledAsLocked is enabled - update locked state based on disabled state
597
+ if (this.displayDisabledAsLocked) {
598
+ this.locked = isDisabled;
599
+ }
600
+ }
601
+ // ----------------------------------------------------------------------------
602
+ // VALIDATORS
603
+ // ----------------------------------------------------------------------------
604
+ /** Method that performs synchronous validation against the provided control. Used for internal validation. */
605
+ validate(_control) {
606
+ return null;
607
+ }
608
+ /** Registers a callback function to call when the validator inputs change. */
609
+ registerOnValidatorChange(fn) {
610
+ this.onValidatorChange = fn;
611
+ }
612
+ // ----------------------------------------------------------------------------
613
+ // HELPERS
614
+ // ----------------------------------------------------------------------------
615
+ /** Returns the first entry in an error object. */
616
+ get firstError() {
617
+ const errors = this.ngControl.errors;
618
+ if (!errors)
619
+ return null;
620
+ const code = Object.keys(errors)[0];
621
+ return { code, params: errors[code] };
622
+ }
623
+ updateValue(value = this.defaultValue) {
624
+ this.state = value;
625
+ this.onChange(this.state);
626
+ this.cdr.detectChanges();
627
+ }
628
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DateControlValueAccessorComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: TRANSLOCO_SCOPE, optional: true }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i2.TranslocoService }], target: i0.ɵɵFactoryTarget.Directive }); }
629
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.12", type: DateControlValueAccessorComponent, inputs: { id: "id", name: "name", label: "label", placeholder: "placeholder", dateCharacters: "dateCharacters", role: "role", value: "value", error: "error", errorList: "errorList", withErrorIcon: "withErrorIcon", description: "description", autofocus: "autofocus", defaultValue: "defaultValue", reset: "reset", optional: "optional", dateInputMask: "dateInputMask", locked: "locked", displayDisabledAsLocked: "displayDisabledAsLocked", required: "required", invalid: "invalid", valid: "valid", focused: "focused", disabled: "disabled", locale: "locale", dateFormat: "dateFormat", dateLocale: "dateLocale" }, outputs: { ngvFocus: "ngvFocus", ngvBlur: "ngvBlur" }, host: { properties: { "attr.id": "this.id" } }, queries: [{ propertyName: "labelContentTpl", first: true, predicate: ["labelTpl"], descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["input"], descendants: true, read: ElementRef }], usesOnChanges: true, ngImport: i0 }); }
630
+ }
631
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DateControlValueAccessorComponent, decorators: [{
632
+ type: Directive
633
+ }], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
634
+ type: Self
635
+ }, {
636
+ type: Optional
637
+ }] }, { type: undefined, decorators: [{
638
+ type: Optional
639
+ }, {
640
+ type: Inject,
641
+ args: [TRANSLOCO_SCOPE]
642
+ }] }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i2.TranslocoService }], propDecorators: { labelContentTpl: [{
643
+ type: ContentChild,
644
+ args: ['labelTpl', { read: TemplateRef }]
645
+ }], inputRef: [{
646
+ type: ViewChild,
647
+ args: ['input', { read: ElementRef }]
648
+ }], id: [{
649
+ type: HostBinding,
650
+ args: ['attr.id']
651
+ }, {
652
+ type: Input
653
+ }], name: [{
654
+ type: Input
655
+ }], label: [{
656
+ type: Input
657
+ }], placeholder: [{
658
+ type: Input
659
+ }], dateCharacters: [{
660
+ type: Input
661
+ }], role: [{
662
+ type: Input
663
+ }], value: [{
664
+ type: Input
665
+ }], error: [{
666
+ type: Input
667
+ }], errorList: [{
668
+ type: Input
669
+ }], withErrorIcon: [{
670
+ type: Input
671
+ }], description: [{
672
+ type: Input
673
+ }], autofocus: [{
674
+ type: Input
675
+ }], defaultValue: [{
676
+ type: Input
677
+ }], reset: [{
678
+ type: Input
679
+ }], optional: [{
680
+ type: Input
681
+ }], dateInputMask: [{
682
+ type: Input
683
+ }], locked: [{
684
+ type: Input
685
+ }], displayDisabledAsLocked: [{
686
+ type: Input
687
+ }], required: [{
688
+ type: Input
689
+ }], invalid: [{
690
+ type: Input
691
+ }], valid: [{
692
+ type: Input
693
+ }], focused: [{
694
+ type: Input
695
+ }], disabled: [{
696
+ type: Input
697
+ }], locale: [{
698
+ type: Input
699
+ }], dateFormat: [{
700
+ type: Input
701
+ }], dateLocale: [{
702
+ type: Input
703
+ }], ngvFocus: [{
704
+ type: Output
705
+ }], ngvBlur: [{
706
+ type: Output
707
+ }] } });
708
+
709
+ const weekdays = [
710
+ WeekDay.Monday,
711
+ WeekDay.Tuesday,
712
+ WeekDay.Wednesday,
713
+ WeekDay.Thursday,
714
+ WeekDay.Friday,
715
+ WeekDay.Saturday,
716
+ WeekDay.Sunday,
717
+ ];
718
+ const sortWeekDays = (firstDayOfWeek) => {
719
+ const firstDayIndex = weekdays.indexOf(firstDayOfWeek);
720
+ const weekStart = weekdays.slice(firstDayIndex);
721
+ const weekEnd = weekdays.slice(0, firstDayIndex);
722
+ return weekStart.concat(weekEnd);
723
+ };
724
+ /** Sets labels and sort weekday arrays based off of first day of week. */
725
+ const getSortedWeekDays = (firstDayOfWeek, startDate) => {
726
+ if (startDate === undefined)
727
+ startDate = new Date();
728
+ // sort weekdays according to firstDayOfWeek
729
+ const sortedWeekdays = sortWeekDays(firstDayOfWeek);
730
+ // get the date object for the first day of week
731
+ const startDayIndex = sortedWeekdays.indexOf(startDate.getDay());
732
+ const firstOfWeek = new Date(startDate);
733
+ firstOfWeek.setDate(startDate.getDate() - startDayIndex);
734
+ // map each day in array to a date object
735
+ return sortedWeekdays.map((_, offset) => {
736
+ // set appropriate date
737
+ const weekdayDate = new Date(firstOfWeek);
738
+ weekdayDate.setDate(weekdayDate.getDate() + offset);
739
+ // and return value
740
+ return weekdayDate;
741
+ });
742
+ };
743
+ /** Generate a matrix of dates used to visualize a calendar month. */
744
+ const generateDateMatrix = (month, year, minWeeks = 5, firstDayOfWeek) => {
745
+ // generate a new matrix with 5 or 6 rows (depending on number of days in that month)
746
+ const matrix = new Array(minWeeks);
747
+ matrix.fill([]);
748
+ const monthStr = `${month + 1}`.padStart(2, '0');
749
+ const date = new Date(`${year}-${monthStr}-01`);
750
+ const firstDate = firstCalendarDate(date, firstDayOfWeek);
751
+ // for each week in that month
752
+ const dateMatrix = matrix.map((_, weekOffset) => {
753
+ const offset = weekOffset * 7;
754
+ // update the date with the offset for that week
755
+ const firstOfWeek = new Date(firstDate);
756
+ firstOfWeek.setDate(firstDate.getDate() + offset);
757
+ return getSortedWeekDays(firstDayOfWeek, firstOfWeek);
758
+ });
759
+ // check if another row needs to be added (if last dates of month are missing)
760
+ const lastAdded = dateMatrix.slice(-1)[0].slice(-1)[0];
761
+ const lastOfMonth = new Date(lastAdded);
762
+ lastOfMonth.setMonth(month + 1);
763
+ lastOfMonth.setDate(0);
764
+ if (isBefore(lastAdded, lastOfMonth)) {
765
+ // add another week row
766
+ const firstOfWeek = new Date(lastAdded);
767
+ firstOfWeek.setDate(lastAdded.getDate() + 1);
768
+ dateMatrix.push(getSortedWeekDays(firstDayOfWeek, firstOfWeek));
769
+ }
770
+ // return final datematrix
771
+ return dateMatrix;
772
+ };
773
+ /** Returns the first date used in the calendars first button. */
774
+ const firstCalendarDate = (date, firstDayOfWeek) => {
775
+ // sort weekdays according to firstDayOfWeek
776
+ const sortedWeekdays = sortWeekDays(firstDayOfWeek);
777
+ // set date to the first of month
778
+ const firstOfMonth = new Date(date);
779
+ firstOfMonth.setDate(1);
780
+ // get the offset
781
+ const offset = sortedWeekdays.indexOf(firstOfMonth.getDay());
782
+ const firstOfWeek = new Date(firstOfMonth);
783
+ // use offset to set date
784
+ firstOfWeek.setDate(1 - offset);
785
+ return firstOfWeek;
786
+ };
787
+ const getDayOffset = (from, to, firstDayOfWeek, direction) => {
788
+ const sortedWeekdays = sortWeekDays(firstDayOfWeek);
789
+ const fromIndex = sortedWeekdays.indexOf(from);
790
+ const toIndex = sortedWeekdays.indexOf(to);
791
+ const offset = toIndex - fromIndex;
792
+ if (direction === 'forward' && offset < 0)
793
+ return offset + 6;
794
+ if (direction === 'back' && offset > 0)
795
+ return offset - 6;
796
+ return offset;
797
+ };
798
+ /** Returns an array of Dates for each of month. */
799
+ const getMonthArray = () => {
800
+ const firstDayOfYear = new Date();
801
+ firstDayOfYear.setMonth(0);
802
+ firstDayOfYear.setDate(1);
803
+ // create a new array of length 12,
804
+ // and fill it with date objects of 1:st of january
805
+ const monthArray = new Array(12).fill(firstDayOfYear);
806
+ // map through the array,
807
+ // and create a new instance of the date,
808
+ // changing the month based on index (0 - 11)
809
+ return monthArray.map((d, index) => {
810
+ const date = new Date(d);
811
+ date.setMonth(index);
812
+ return date;
813
+ });
814
+ };
815
+ /** Returns an array of Dates for the current year and the next. */
816
+ const getYearArray = () => {
817
+ const currentYear = new Date();
818
+ currentYear.setMonth(0);
819
+ currentYear.setDate(1);
820
+ const nextYear = new Date(currentYear);
821
+ nextYear.setFullYear(currentYear.getFullYear() + 1);
822
+ return [currentYear, nextYear];
823
+ };
824
+ /** Returns true if the two dates have the same year, month and date values. */
825
+ const match = (a, b) => {
826
+ if (!a || !b)
827
+ return false;
828
+ if (a.getDate() !== b.getDate())
829
+ return false;
830
+ if (a.getMonth() !== b.getMonth())
831
+ return false;
832
+ if (a.getFullYear() !== b.getFullYear())
833
+ return false;
834
+ return true;
835
+ };
836
+ const afterClosingHours = (closingHours) => {
837
+ if (!closingHours)
838
+ return false;
839
+ return Date.now() >= closingHours.getTime();
840
+ };
841
+ /**
842
+ * Checks if a date is before control date, regardless of time.
843
+ *
844
+ * @param date - comparison date
845
+ * @param controlDate - date to compare against
846
+ * @returns - true if the comparison date is before the control date
847
+ */
848
+ const isBefore = (date, controlDate) => {
849
+ // if year values are dissimilar
850
+ if (date.getFullYear() !== controlDate.getFullYear()) {
851
+ return date.getFullYear() < controlDate.getFullYear();
852
+ }
853
+ // if month values are dissimilar
854
+ if (date.getMonth() !== controlDate.getMonth()) {
855
+ return date.getMonth() < controlDate.getMonth();
856
+ }
857
+ // if year and month are equal, check the date
858
+ return date.getDate() < controlDate.getDate();
859
+ };
860
+ /**
861
+ * Checks if a date is after control date, regardless of time.
862
+ *
863
+ * @param date - comparison date
864
+ * @param controlDate - date to compare against
865
+ * @returns - true if the comparison date is before the control date
866
+ */
867
+ const isAfter = (date, controlDate) => {
868
+ // if year values are dissimilar
869
+ if (date.getFullYear() !== controlDate.getFullYear()) {
870
+ return date.getFullYear() > controlDate.getFullYear();
871
+ }
872
+ // if month values are dissimilar
873
+ if (date.getMonth() !== controlDate.getMonth()) {
874
+ return date.getMonth() > controlDate.getMonth();
875
+ }
876
+ // if year and month are equal, check the date
877
+ return date.getDate() > controlDate.getDate();
878
+ };
879
+ /**
880
+ * Checks if a value can be used to initiate a new Date object.
881
+ *
882
+ * @param value any value
883
+ * @returns - true if value can be coersed to a Date.
884
+ */
885
+ const isValid = (value) => {
886
+ // if value is type of string and can be parsed to a Date
887
+ const date = value && typeof value === 'string' && !isNaN(Date.parse(value))
888
+ ? new Date(value)
889
+ : null;
890
+ switch (true) {
891
+ // if date or value is a valid date object - return valid
892
+ case typeof value?.getMonth === 'function':
893
+ case typeof date?.getMonth === 'function':
894
+ return true;
895
+ // if date or value is not a valid date object - return invalid
896
+ case value == null:
897
+ case date?.toString() === 'Invalid Date':
898
+ return false;
899
+ default:
900
+ return false;
901
+ }
902
+ };
903
+
904
+ class CalendarDateDirective {
905
+ get nativeElement() {
906
+ return this.elementRef.nativeElement;
907
+ }
908
+ constructor(elementRef) {
909
+ this.elementRef = elementRef;
910
+ this.isToday = false;
911
+ }
912
+ ngOnInit() {
913
+ this.isToday = match(new Date(), this.calendarDate);
914
+ }
915
+ ngOnChanges(changes) {
916
+ if (changes.disabled?.currentValue) {
917
+ ;
918
+ this.nativeElement.disabled = this.disabled;
919
+ }
920
+ }
921
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CalendarDateDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
922
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.12", type: CalendarDateDirective, selector: "[calendarDate]", inputs: { calendarDate: "calendarDate", selected: "selected", notWithinMonth: "notWithinMonth", disabled: "disabled" }, host: { properties: { "class.selected": "this.selected", "class.not-within-month": "this.notWithinMonth", "class.today": "this.isToday" } }, usesOnChanges: true, ngImport: i0 }); }
923
+ }
924
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CalendarDateDirective, decorators: [{
925
+ type: Directive,
926
+ args: [{
927
+ selector: '[calendarDate]', // eslint-disable-line @angular-eslint/directive-selector
928
+ }]
929
+ }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { calendarDate: [{
930
+ type: Input
931
+ }], selected: [{
932
+ type: HostBinding,
933
+ args: ['class.' + "selected" /* DateCss.selected */]
934
+ }, {
935
+ type: Input
936
+ }], notWithinMonth: [{
937
+ type: HostBinding,
938
+ args: ['class.' + "not-within-month" /* DateCss.notWithinMonth */]
939
+ }, {
940
+ type: Input
941
+ }], isToday: [{
942
+ type: HostBinding,
943
+ args: ['class.' + "today" /* DateCss.today */]
944
+ }], disabled: [{
945
+ type: Input
946
+ }] } });
947
+
948
+ const TODAY = new Date();
949
+ class IsDisabledPipe {
950
+ // transform(value: Date, firstValid: Date | undefined, lastValid: Date | undefined, excludeDates: Date[] | undefined, excludeDays: WeekDay[] | undefined): boolean {
951
+ transform(value, config = {}) {
952
+ const { fromDate, toDate, excludeDates, excludeDays, closingTime } = config;
953
+ // if closingHours was provided and the date matches today - check closingHours (including timezone)
954
+ if (closingTime && match(value, TODAY) && afterClosingHours(closingTime))
955
+ return true;
956
+ // if fromDate was provided and the date occurs before fromDate date
957
+ if (fromDate && !match(value, fromDate) && isBefore(value, fromDate))
958
+ return true;
959
+ // if toDate was provided and the date occurs after toDate date
960
+ if (toDate && !match(value, toDate) && isAfter(value, toDate))
961
+ return true;
962
+ // if a list of disallowed days is provided and value matches
963
+ if (excludeDays &&
964
+ excludeDays.length &&
965
+ excludeDays.indexOf(value.getDay()) !== -1)
966
+ return true;
967
+ // if a list of disallowed dates is provided
968
+ if (excludeDates && excludeDates.length) {
969
+ return !!excludeDates.find((d) => match(value, d));
970
+ }
971
+ // otherwise show date as not disabled
972
+ return false;
973
+ }
974
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: IsDisabledPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
975
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: IsDisabledPipe, name: "isDisabled" }); }
976
+ }
977
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: IsDisabledPipe, decorators: [{
978
+ type: Pipe,
979
+ args: [{ name: 'isDisabled' }]
980
+ }] });
981
+
982
+ class DateThookPipe {
983
+ get today() {
984
+ const tmp = new Date();
985
+ const today = new Date(tmp.setHours(0, 0, 0, 0));
986
+ return today;
987
+ }
988
+ transform(date, isDisabled) {
989
+ if (!!date && !isDisabled) {
990
+ // Reset time for target date
991
+ const dateTmp = new Date(date.setHours(0, 0, 0, 0));
992
+ // To calculate the time difference of two dates
993
+ const differenceInTime = dateTmp.getTime() - this.today.getTime();
994
+ // To calculate the no. of days between two dates
995
+ const differenceInDays = differenceInTime / (1000 * 3600 * 24);
996
+ const absoluteDifferenceInDays = Math.abs(differenceInDays);
997
+ const differentiator = differenceInDays < 0 ? '-' : differenceInDays === 0 ? '' : '+';
998
+ return `today${differentiator}${absoluteDifferenceInDays === 0 ? '' : absoluteDifferenceInDays}`;
999
+ }
1000
+ return 'disabled-date';
1001
+ }
1002
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DateThookPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1003
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: DateThookPipe, name: "dateThook" }); }
1004
+ }
1005
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DateThookPipe, decorators: [{
1006
+ type: Pipe,
1007
+ args: [{ name: 'dateThook' }]
1008
+ }] });
1009
+
1010
+ class MatchesPipe {
1011
+ transform(value, selected) {
1012
+ return match(value, selected);
1013
+ }
1014
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MatchesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1015
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: MatchesPipe, name: "matches" }); }
1016
+ }
1017
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MatchesPipe, decorators: [{
1018
+ type: Pipe,
1019
+ args: [{
1020
+ name: 'matches',
1021
+ }]
1022
+ }] });
1023
+
1024
+ class CalendarComponent {
1025
+ constructor() {
1026
+ this.dateClick = new EventEmitter();
1027
+ this.minCalendarRows = 5;
1028
+ this.firstDayOfWeek = WeekDay.Monday;
1029
+ this.type = 'normal';
1030
+ this.dateMatrix = [[]];
1031
+ this.disableDateConfig = {};
1032
+ this.lastDayOfWeek = WeekDay.Sunday;
1033
+ }
1034
+ // inputs that affects which dates in the calendar should be grayed out
1035
+ set disableDates(value) {
1036
+ this.updateDisableDateConfig({ excludeDates: value ?? [] });
1037
+ }
1038
+ set disableWeekDays(value) {
1039
+ this.updateDisableDateConfig({ excludeDays: value });
1040
+ }
1041
+ set firstValid(value) {
1042
+ this.updateDisableDateConfig({ fromDate: value });
1043
+ }
1044
+ set lastValid(value) {
1045
+ this.updateDisableDateConfig({ toDate: value });
1046
+ }
1047
+ set closingTime(value) {
1048
+ this.updateDisableDateConfig({ closingTime: value });
1049
+ }
1050
+ ngOnChanges(changes) {
1051
+ if (changes.selected?.currentValue) {
1052
+ this.selected = new Date(changes.selected.currentValue);
1053
+ }
1054
+ if (changes.firstDayOfWeek?.currentValue) {
1055
+ this.lastDayOfWeek = sortWeekDays(changes.firstDayOfWeek.currentValue).pop();
1056
+ }
1057
+ if ((changes.month?.currentValue !== undefined &&
1058
+ changes.month?.currentValue !== null) ||
1059
+ !!changes.year?.currentValue ||
1060
+ !!changes.firstDayOfWeek?.currentValue ||
1061
+ !!changes.minCalendarRows?.currentValue) {
1062
+ this.dateMatrix = generateDateMatrix(this.month, this.year, this.minCalendarRows, this.firstDayOfWeek);
1063
+ }
1064
+ }
1065
+ clickDate(date) {
1066
+ this.dateClick.emit(date);
1067
+ }
1068
+ keyNavigation(event) {
1069
+ let activeElement;
1070
+ if (event.key !== 'Tab')
1071
+ activeElement = document.activeElement;
1072
+ if (event.key === 'ArrowRight') {
1073
+ const nextFocusable = this.getNextFocusable(activeElement);
1074
+ if (nextFocusable)
1075
+ nextFocusable.focus();
1076
+ }
1077
+ if (event.key === 'ArrowLeft') {
1078
+ const nextFocusable = this.getPreviousFocusable(activeElement);
1079
+ if (nextFocusable)
1080
+ nextFocusable.focus();
1081
+ }
1082
+ if (event.key === 'ArrowUp') {
1083
+ event.preventDefault();
1084
+ const nextFocusable = this.getElementWithOffset(activeElement, -7);
1085
+ if (nextFocusable)
1086
+ nextFocusable.focus();
1087
+ }
1088
+ if (event.key === 'ArrowDown') {
1089
+ event.preventDefault();
1090
+ const nextFocusable = this.getElementWithOffset(activeElement, 7);
1091
+ if (nextFocusable)
1092
+ nextFocusable.focus();
1093
+ }
1094
+ if (event.key === 'Enter' || event.key === 'Space') {
1095
+ if (activeElement) {
1096
+ const dateRef = this.dateButtonRefs.find((ref) => ref.nativeElement === activeElement);
1097
+ if (!dateRef?.disabled) {
1098
+ this.dateClick.emit(dateRef?.calendarDate);
1099
+ }
1100
+ }
1101
+ }
1102
+ if (event.key === 'Home') {
1103
+ event.preventDefault();
1104
+ const nextFocusable = this.firstDayOfWeekElement();
1105
+ if (nextFocusable)
1106
+ nextFocusable.focus();
1107
+ }
1108
+ if (event.key === 'End') {
1109
+ event.preventDefault();
1110
+ const nextFocusable = this.lastDayOfWeekElement();
1111
+ if (nextFocusable)
1112
+ nextFocusable.focus();
1113
+ }
1114
+ }
1115
+ getElementWithOffset(fromElement, offsetDays, returnOnlyEnabled = true) {
1116
+ if (!fromElement)
1117
+ return;
1118
+ const fromIndex = this.dateButtonRefs
1119
+ .toArray()
1120
+ .map((ref) => ref.nativeElement)
1121
+ .indexOf(fromElement);
1122
+ const next = this.dateButtonRefs.get(fromIndex + offsetDays);
1123
+ if (!next)
1124
+ return;
1125
+ if (returnOnlyEnabled && next.disabled)
1126
+ return this.getElementWithOffset(next.nativeElement, offsetDays);
1127
+ return next.nativeElement;
1128
+ }
1129
+ getNextFocusable(fromElement) {
1130
+ if (!fromElement)
1131
+ return;
1132
+ return this.getElementWithOffset(fromElement, 1);
1133
+ }
1134
+ getPreviousFocusable(fromElement) {
1135
+ if (!fromElement)
1136
+ return;
1137
+ return this.getElementWithOffset(fromElement, -1);
1138
+ }
1139
+ firstDayOfWeekElement() {
1140
+ const activeElement = document.activeElement;
1141
+ if (!activeElement)
1142
+ return;
1143
+ const dateRef = this.dateButtonRefs.find((ref) => ref.nativeElement === activeElement);
1144
+ if (dateRef.calendarDate.getDay() === this.firstDayOfWeek)
1145
+ return;
1146
+ const offset = this.getDayOffset(dateRef.calendarDate.getDay(), this.firstDayOfWeek, 'back');
1147
+ const targetElement = this.getElementWithOffset(activeElement, offset, false);
1148
+ if (targetElement && targetElement.disabled)
1149
+ return this.getNextFocusable(targetElement);
1150
+ return targetElement;
1151
+ }
1152
+ lastDayOfWeekElement() {
1153
+ const activeElement = document.activeElement;
1154
+ if (!activeElement)
1155
+ return;
1156
+ const dateRef = this.dateButtonRefs.find((ref) => ref.nativeElement === activeElement);
1157
+ if (dateRef.calendarDate.getDay() === this.lastDayOfWeek)
1158
+ return;
1159
+ const offset = this.getDayOffset(dateRef.calendarDate.getDay(), this.lastDayOfWeek, 'forward');
1160
+ const targetElement = this.getElementWithOffset(activeElement, offset, false);
1161
+ if (targetElement && targetElement.disabled)
1162
+ return this.getPreviousFocusable(targetElement);
1163
+ return targetElement;
1164
+ }
1165
+ getDayOffset(from, to, direction) {
1166
+ return getDayOffset(from, to, this.firstDayOfWeek, direction);
1167
+ }
1168
+ updateDisableDateConfig(config) {
1169
+ this.disableDateConfig = {
1170
+ ...this.disableDateConfig,
1171
+ ...config,
1172
+ };
1173
+ }
1174
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1175
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: CalendarComponent, selector: "nggv-calendar", inputs: { year: "year", month: "month", selected: "selected", locale: "locale", minCalendarRows: "minCalendarRows", firstDayOfWeek: "firstDayOfWeek", type: "type", disableDates: "disableDates", disableWeekDays: "disableWeekDays", firstValid: "firstValid", lastValid: "lastValid", closingTime: "closingTime" }, outputs: { dateClick: "dateClick" }, host: { listeners: { "keydown": "keyNavigation($event)" } }, viewQueries: [{ propertyName: "dateButtonRefs", predicate: CalendarDateDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngFor=\"let weekRow of dateMatrix\">\n <div class=\"nggv-calendar-row\">\n <button\n *ngFor=\"let date of weekRow\"\n class=\"gds-button gds-button-alternative\"\n [attr.data-thook]=\"\n date | dateThook: (date | isDisabled: disableDateConfig)\n \"\n [attr.aria-label]=\"date\"\n [calendarDate]=\"date\"\n [notWithinMonth]=\"!(month === date?.getMonth())\"\n [selected]=\"date | matches: selected\"\n [disabled]=\"date | isDisabled: disableDateConfig\"\n (click)=\"clickDate(date)\"\n >\n {{ date | date: 'd' : undefined : locale }}\n </button>\n </div>\n</ng-container>\n", styles: [":host{--sg-border-color: transparent;--sg-border-width: 0;--sg-border-radius: 4px;border-top:1px solid #e9e9e9;border-bottom:1px solid #e9e9e9}:host .nggv-calendar-row{display:flex;padding:2px;gap:1px}:host .nggv-calendar-row>*{line-height:2.5rem;padding:0;display:block;flex-grow:1;text-align:center;width:20%;color:#333}:host .nggv-calendar-row>*:disabled{border:0 solid transparent}:host .nggv-calendar-row>button{padding:.75rem 1rem;border-radius:var(--sg-border-radius);border:solid var(--sg-border-width) var(--sg-border-color);font-weight:500;min-height:2.75rem;align-items:center;display:inline-flex;justify-content:center;width:15%;background:transparent;width:44px;height:44px;border-radius:4px;font-size:1rem;font-family:inherit}:host .nggv-calendar-row>button:focus:not(:focus-visible){box-shadow:none;outline:0}:host .nggv-calendar-row>button:focus,:host .nggv-calendar-row>button:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}@media (max-width: 35.98em){:host .nggv-calendar-row>button{min-width:100%}}@media screen and (-ms-high-contrast: active){:host .nggv-calendar-row>button{border:2px solid currentcolor}}:host .nggv-calendar-row>button.small{min-height:2rem;padding:.4375rem .75rem;line-height:1rem}:host .nggv-calendar-row>button.large{min-height:4rem;padding:1rem 1.5rem;font-size:1.5rem;line-height:2rem}:host .nggv-calendar-row>button:not([disabled]):hover{background-color:#e9e9e9}:host .nggv-calendar-row>button:not([disabled]):focus{z-index:1;outline-color:#1a1a1a;outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .nggv-calendar-row>button[disabled]{background-color:#eee;color:#adadad}:host .nggv-calendar-row>button.today{border:1px solid #333}:host .nggv-calendar-row>button.not-within-month:not([disabled]){color:#adadad;background-color:#f8f8f8}:host .nggv-calendar-row>button.not-within-month:not([disabled]):hover{background-color:#e9e9e9}:host .nggv-calendar-row>button.selected:not([disabled]){background-color:#1a1a1a;border-color:#1a1a1a;text-decoration:none;color:#fff}@media (max-width: 35.98em){:host .nggv-calendar-row>button{min-width:initial}}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: CalendarDateDirective, selector: "[calendarDate]", inputs: ["calendarDate", "selected", "notWithinMonth", "disabled"] }, { kind: "pipe", type: i1$1.DatePipe, name: "date" }, { kind: "pipe", type: IsDisabledPipe, name: "isDisabled" }, { kind: "pipe", type: DateThookPipe, name: "dateThook" }, { kind: "pipe", type: MatchesPipe, name: "matches" }] }); }
1176
+ }
1177
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CalendarComponent, decorators: [{
1178
+ type: Component,
1179
+ args: [{ selector: 'nggv-calendar', template: "<ng-container *ngFor=\"let weekRow of dateMatrix\">\n <div class=\"nggv-calendar-row\">\n <button\n *ngFor=\"let date of weekRow\"\n class=\"gds-button gds-button-alternative\"\n [attr.data-thook]=\"\n date | dateThook: (date | isDisabled: disableDateConfig)\n \"\n [attr.aria-label]=\"date\"\n [calendarDate]=\"date\"\n [notWithinMonth]=\"!(month === date?.getMonth())\"\n [selected]=\"date | matches: selected\"\n [disabled]=\"date | isDisabled: disableDateConfig\"\n (click)=\"clickDate(date)\"\n >\n {{ date | date: 'd' : undefined : locale }}\n </button>\n </div>\n</ng-container>\n", styles: [":host{--sg-border-color: transparent;--sg-border-width: 0;--sg-border-radius: 4px;border-top:1px solid #e9e9e9;border-bottom:1px solid #e9e9e9}:host .nggv-calendar-row{display:flex;padding:2px;gap:1px}:host .nggv-calendar-row>*{line-height:2.5rem;padding:0;display:block;flex-grow:1;text-align:center;width:20%;color:#333}:host .nggv-calendar-row>*:disabled{border:0 solid transparent}:host .nggv-calendar-row>button{padding:.75rem 1rem;border-radius:var(--sg-border-radius);border:solid var(--sg-border-width) var(--sg-border-color);font-weight:500;min-height:2.75rem;align-items:center;display:inline-flex;justify-content:center;width:15%;background:transparent;width:44px;height:44px;border-radius:4px;font-size:1rem;font-family:inherit}:host .nggv-calendar-row>button:focus:not(:focus-visible){box-shadow:none;outline:0}:host .nggv-calendar-row>button:focus,:host .nggv-calendar-row>button:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}@media (max-width: 35.98em){:host .nggv-calendar-row>button{min-width:100%}}@media screen and (-ms-high-contrast: active){:host .nggv-calendar-row>button{border:2px solid currentcolor}}:host .nggv-calendar-row>button.small{min-height:2rem;padding:.4375rem .75rem;line-height:1rem}:host .nggv-calendar-row>button.large{min-height:4rem;padding:1rem 1.5rem;font-size:1.5rem;line-height:2rem}:host .nggv-calendar-row>button:not([disabled]):hover{background-color:#e9e9e9}:host .nggv-calendar-row>button:not([disabled]):focus{z-index:1;outline-color:#1a1a1a;outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .nggv-calendar-row>button[disabled]{background-color:#eee;color:#adadad}:host .nggv-calendar-row>button.today{border:1px solid #333}:host .nggv-calendar-row>button.not-within-month:not([disabled]){color:#adadad;background-color:#f8f8f8}:host .nggv-calendar-row>button.not-within-month:not([disabled]):hover{background-color:#e9e9e9}:host .nggv-calendar-row>button.selected:not([disabled]){background-color:#1a1a1a;border-color:#1a1a1a;text-decoration:none;color:#fff}@media (max-width: 35.98em){:host .nggv-calendar-row>button{min-width:initial}}\n"] }]
1180
+ }], propDecorators: { dateClick: [{
1181
+ type: Output
1182
+ }], dateButtonRefs: [{
1183
+ type: ViewChildren,
1184
+ args: [CalendarDateDirective]
1185
+ }], year: [{
1186
+ type: Input
1187
+ }], month: [{
1188
+ type: Input
1189
+ }], selected: [{
1190
+ type: Input
1191
+ }], locale: [{
1192
+ type: Input
1193
+ }], minCalendarRows: [{
1194
+ type: Input
1195
+ }], firstDayOfWeek: [{
1196
+ type: Input
1197
+ }], type: [{
1198
+ type: Input
1199
+ }], disableDates: [{
1200
+ type: Input
1201
+ }], disableWeekDays: [{
1202
+ type: Input
1203
+ }], firstValid: [{
1204
+ type: Input
1205
+ }], lastValid: [{
1206
+ type: Input
1207
+ }], closingTime: [{
1208
+ type: Input
1209
+ }], keyNavigation: [{
1210
+ type: HostListener,
1211
+ args: ['keydown', ['$event']]
1212
+ }] } });
1213
+
1214
+ class CalendarMonth {
1215
+ constructor(date) {
1216
+ this._date = date ? new Date(date) : new Date();
1217
+ this._date.setDate(1);
1218
+ this._date.setHours(0, 0, 0, 0);
1219
+ this.year = this._date.getFullYear();
1220
+ this.month = this._date.getMonth();
1221
+ this.id = formatDate(this._date, 'yyyyMM', 'en');
1222
+ }
1223
+ /** Creates an instance based of input year and month. */
1224
+ static fromObject(obj) {
1225
+ const objectDate = new Date(obj.year, obj.month, 1);
1226
+ return new CalendarMonth(objectDate);
1227
+ }
1228
+ /** Returns a Date representation for the instance. */
1229
+ get date() {
1230
+ return new Date(this._date);
1231
+ }
1232
+ /** Returns the string id representing the instance in form of 'yyyyMM'. */
1233
+ valueOf() {
1234
+ return this.id;
1235
+ }
1236
+ /** Returns a new instance for next month. */
1237
+ nextMonth() {
1238
+ const next = this.date;
1239
+ next.setMonth(this.month + 1);
1240
+ return new CalendarMonth(next);
1241
+ }
1242
+ /** Returns a new instance for previous month. */
1243
+ previousMonth() {
1244
+ const previous = this.date;
1245
+ previous.setMonth(this.month - 1);
1246
+ return new CalendarMonth(previous);
1247
+ }
1248
+ /** Returns a new instance for next year. */
1249
+ nextYear() {
1250
+ const nextYear = this.date;
1251
+ nextYear.setFullYear(nextYear.getFullYear() + 1);
1252
+ return new CalendarMonth(nextYear);
1253
+ }
1254
+ /** Returns a new instance for previous year. */
1255
+ previousYear() {
1256
+ const previousYear = this.date;
1257
+ previousYear.setFullYear(previousYear.getFullYear() - 1);
1258
+ return new CalendarMonth(previousYear);
1259
+ }
1260
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CalendarMonth, deps: [{ token: Date }], target: i0.ɵɵFactoryTarget.Injectable }); }
1261
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CalendarMonth }); }
1262
+ }
1263
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CalendarMonth, decorators: [{
1264
+ type: Injectable
1265
+ }], ctorParameters: () => [{ type: Date }] });
1266
+
1267
+ class CalendarControlComponent {
1268
+ constructor(fb) {
1269
+ this.fb = fb;
1270
+ // nextIcon: IconDefinition = faChevronRight
1271
+ // previousIcon: IconDefinition = faChevronLeft
1272
+ this.calendarChange = new EventEmitter();
1273
+ this.type = 'normal';
1274
+ this.monthArray = []; // array used for month dropdown
1275
+ this.yearArray = []; // array used for year dropdown
1276
+ this.subs = [];
1277
+ // initiate form group for dropdown menus
1278
+ this.selectedCalendar = this.fb.group({
1279
+ year: [],
1280
+ month: [],
1281
+ });
1282
+ }
1283
+ ngOnChanges(changes) {
1284
+ if (changes.activeCalendar &&
1285
+ !changes.activeCalendar.isFirstChange() &&
1286
+ changes.activeCalendar.currentValue.valueOf() !==
1287
+ this.selectedCalendar.value.id) {
1288
+ this.selectedCalendar.patchValue(changes.activeCalendar.currentValue);
1289
+ }
1290
+ }
1291
+ ngOnInit() {
1292
+ // populate drowdowns and labels with data
1293
+ this.monthArray = getMonthArray();
1294
+ this.yearArray = getYearArray();
1295
+ // subscribe to year and month changes, and emit event to datepicker
1296
+ this.subscribeToFormChanges();
1297
+ // update control to initial value
1298
+ if (this.activeCalendar)
1299
+ this.selectedCalendar.patchValue(this.activeCalendar);
1300
+ }
1301
+ ngOnDestroy() {
1302
+ this.subs.forEach((sub) => sub.unsubscribe());
1303
+ }
1304
+ viewPreviousMonth() {
1305
+ const previousMonth = CalendarMonth.fromObject(this.selectedCalendar.value).previousMonth();
1306
+ this.selectedCalendar.patchValue(previousMonth);
1307
+ }
1308
+ viewNextMonth() {
1309
+ const nextMonth = CalendarMonth.fromObject(this.selectedCalendar.value).nextMonth();
1310
+ this.selectedCalendar.patchValue(nextMonth);
1311
+ }
1312
+ viewPreviousYear() {
1313
+ const previousYear = CalendarMonth.fromObject(this.selectedCalendar.value).previousYear();
1314
+ this.selectedCalendar.patchValue(previousYear);
1315
+ }
1316
+ viewNextYear() {
1317
+ const nextYear = CalendarMonth.fromObject(this.selectedCalendar.value).nextYear();
1318
+ this.selectedCalendar.patchValue(nextYear);
1319
+ }
1320
+ keyNavigation(event) {
1321
+ if (event.key !== 'PageUp' && event.key !== 'PageDown')
1322
+ return;
1323
+ event.preventDefault();
1324
+ if (event.shiftKey) {
1325
+ if (event.key === 'PageUp')
1326
+ return this.viewPreviousYear();
1327
+ if (event.key === 'PageDown')
1328
+ return this.viewNextYear();
1329
+ }
1330
+ if (event.key === 'PageUp')
1331
+ return this.viewPreviousMonth();
1332
+ if (event.key === 'PageDown')
1333
+ return this.viewNextMonth();
1334
+ }
1335
+ subscribeToFormChanges() {
1336
+ // used to quickly check if the yearsArray needs years appended to it
1337
+ let existingYears = this.yearArray.map((e) => e.getFullYear());
1338
+ const changes = this.selectedCalendar.valueChanges.pipe(debounceTime(1), // added due to this issue: https://github.com/angular/angular/issues/13129
1339
+ map((value) => CalendarMonth.fromObject(value)), distinctUntilChanged((prev, curr) => prev.valueOf() === curr.valueOf()));
1340
+ this.subs.push(changes.subscribe({
1341
+ next: (value) => {
1342
+ // if you need to append to year array
1343
+ if (existingYears.indexOf(value.year) === -1) {
1344
+ this.yearArray.push(value.date);
1345
+ this.yearArray.sort((a, b) => a.getFullYear() - b.getFullYear());
1346
+ existingYears = this.yearArray.map((e) => e.getFullYear());
1347
+ }
1348
+ this.calendarChange.emit(value);
1349
+ },
1350
+ }));
1351
+ }
1352
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CalendarControlComponent, deps: [{ token: i1.UntypedFormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
1353
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: CalendarControlComponent, selector: "nggv-calendar-control", inputs: { activeCalendar: "activeCalendar", locale: "locale", type: "type" }, outputs: { calendarChange: "calendarChange" }, host: { listeners: { "keydown": "keyNavigation($event)" } }, usesOnChanges: true, ngImport: i0, template: "<button\n *ngIf=\"type === 'normal'\"\n data-thook=\"previous-month\"\n class=\"nggv-prev-button\"\n (click)=\"viewPreviousMonth()\"\n>\n <gds-icon-chevron-left *nggCoreElement></gds-icon-chevron-left>\n</button>\n\n<ng-container [formGroup]=\"selectedCalendar\">\n <select\n class=\"nggv-calendar-select\"\n data-thook=\"select-month\"\n formControlName=\"month\"\n >\n <option\n *ngFor=\"let month of monthArray\"\n class=\"gds-field-dropdown__label\"\n tabindex=\"0\"\n [value]=\"month.getMonth()\"\n >\n {{ month | date: 'MMMM' : undefined : locale }}\n </option>\n </select>\n\n <select\n class=\"nggv-calendar-select\"\n data-thook=\"select-year\"\n formControlName=\"year\"\n >\n <option\n *ngFor=\"let year of yearArray\"\n class=\"gds-field-dropdown__label\"\n tabindex=\"0\"\n [value]=\"year.getFullYear()\"\n >\n {{ year | date: 'yyyy' : undefined : locale }}\n </option>\n </select>\n</ng-container>\n\n<button\n *ngIf=\"type === 'normal'\"\n data-thook=\"next-month\"\n class=\"nggv-next-button\"\n (click)=\"viewNextMonth()\"\n>\n <gds-icon-chevron-right *nggCoreElement></gds-icon-chevron-right>\n</button>\n", styles: [":host{display:flex;padding:.25rem;justify-content:space-between;align-items:center;gap:.25rem}:host .nggv-calendar-select{--sg-border-radius: 4px;--sg-border-width: 1px;--sg-border-color: #868686;padding:.75rem 3rem .75rem 1rem;border-radius:var(--sg-border-radius);border:solid var(--sg-border-width) var(--sg-border-color);--border-color: var(--sg-border-color);appearance:auto;background:#fff;color:#333;display:block;flex:1;font-family:inherit;font-size:.875rem;font-weight:400;line-height:2rem;max-height:2rem;max-width:100%;min-height:2rem;padding:0 .5em;text-overflow:ellipsis;white-space:nowrap;width:6rem}:host .nggv-calendar-select:focus:not(:focus-visible){box-shadow:none;outline:0}:host .nggv-calendar-select:focus,:host .nggv-calendar-select:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host button.nggv-prev-button,:host button.nggv-next-button{--sg-border-radius: 4px;--sg-border-width: 0;--sg-border-color: transparent;background-color:transparent;border:0;cursor:pointer;font-family:inherit;padding:0;padding:.75rem 1rem;border-radius:var(--sg-border-radius);border:solid var(--sg-border-width) var(--sg-border-color);font-weight:500;min-height:2.75rem;align-items:center;display:inline-flex;justify-content:center;border:none;height:2rem;width:2rem;padding:0 .75em}:host button.nggv-prev-button:focus:not(:focus-visible),:host button.nggv-next-button:focus:not(:focus-visible){box-shadow:none;outline:0}:host button.nggv-prev-button:focus,:host button.nggv-prev-button:focus-visible,:host button.nggv-next-button:focus,:host button.nggv-next-button:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}@media (max-width: 35.98em){:host button.nggv-prev-button,:host button.nggv-next-button{min-width:100%}}@media screen and (-ms-high-contrast: active){:host button.nggv-prev-button,:host button.nggv-next-button{border:2px solid currentcolor}}:host button.nggv-prev-button.small,:host button.nggv-next-button.small{min-height:2rem;padding:.4375rem .75rem;line-height:1rem}:host button.nggv-prev-button.large,:host button.nggv-next-button.large{min-height:4rem;padding:1rem 1.5rem;font-size:1.5rem;line-height:2rem}@media (max-width: 47.98em){:host button.nggv-prev-button,:host button.nggv-next-button{width:3em;height:3em}}:host button.nggv-prev-button:hover,:host button.nggv-next-button:hover{background-color:#e9e9e9}@media (max-width: 35.98em){:host button.nggv-prev-button,:host button.nggv-next-button{min-width:initial}}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3.NggCoreElementDirective, selector: "[nggCoreElement]" }, { kind: "pipe", type: i1$1.DatePipe, name: "date" }] }); }
1354
+ }
1355
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CalendarControlComponent, decorators: [{
1356
+ type: Component,
1357
+ args: [{ selector: 'nggv-calendar-control', template: "<button\n *ngIf=\"type === 'normal'\"\n data-thook=\"previous-month\"\n class=\"nggv-prev-button\"\n (click)=\"viewPreviousMonth()\"\n>\n <gds-icon-chevron-left *nggCoreElement></gds-icon-chevron-left>\n</button>\n\n<ng-container [formGroup]=\"selectedCalendar\">\n <select\n class=\"nggv-calendar-select\"\n data-thook=\"select-month\"\n formControlName=\"month\"\n >\n <option\n *ngFor=\"let month of monthArray\"\n class=\"gds-field-dropdown__label\"\n tabindex=\"0\"\n [value]=\"month.getMonth()\"\n >\n {{ month | date: 'MMMM' : undefined : locale }}\n </option>\n </select>\n\n <select\n class=\"nggv-calendar-select\"\n data-thook=\"select-year\"\n formControlName=\"year\"\n >\n <option\n *ngFor=\"let year of yearArray\"\n class=\"gds-field-dropdown__label\"\n tabindex=\"0\"\n [value]=\"year.getFullYear()\"\n >\n {{ year | date: 'yyyy' : undefined : locale }}\n </option>\n </select>\n</ng-container>\n\n<button\n *ngIf=\"type === 'normal'\"\n data-thook=\"next-month\"\n class=\"nggv-next-button\"\n (click)=\"viewNextMonth()\"\n>\n <gds-icon-chevron-right *nggCoreElement></gds-icon-chevron-right>\n</button>\n", styles: [":host{display:flex;padding:.25rem;justify-content:space-between;align-items:center;gap:.25rem}:host .nggv-calendar-select{--sg-border-radius: 4px;--sg-border-width: 1px;--sg-border-color: #868686;padding:.75rem 3rem .75rem 1rem;border-radius:var(--sg-border-radius);border:solid var(--sg-border-width) var(--sg-border-color);--border-color: var(--sg-border-color);appearance:auto;background:#fff;color:#333;display:block;flex:1;font-family:inherit;font-size:.875rem;font-weight:400;line-height:2rem;max-height:2rem;max-width:100%;min-height:2rem;padding:0 .5em;text-overflow:ellipsis;white-space:nowrap;width:6rem}:host .nggv-calendar-select:focus:not(:focus-visible){box-shadow:none;outline:0}:host .nggv-calendar-select:focus,:host .nggv-calendar-select:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host button.nggv-prev-button,:host button.nggv-next-button{--sg-border-radius: 4px;--sg-border-width: 0;--sg-border-color: transparent;background-color:transparent;border:0;cursor:pointer;font-family:inherit;padding:0;padding:.75rem 1rem;border-radius:var(--sg-border-radius);border:solid var(--sg-border-width) var(--sg-border-color);font-weight:500;min-height:2.75rem;align-items:center;display:inline-flex;justify-content:center;border:none;height:2rem;width:2rem;padding:0 .75em}:host button.nggv-prev-button:focus:not(:focus-visible),:host button.nggv-next-button:focus:not(:focus-visible){box-shadow:none;outline:0}:host button.nggv-prev-button:focus,:host button.nggv-prev-button:focus-visible,:host button.nggv-next-button:focus,:host button.nggv-next-button:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}@media (max-width: 35.98em){:host button.nggv-prev-button,:host button.nggv-next-button{min-width:100%}}@media screen and (-ms-high-contrast: active){:host button.nggv-prev-button,:host button.nggv-next-button{border:2px solid currentcolor}}:host button.nggv-prev-button.small,:host button.nggv-next-button.small{min-height:2rem;padding:.4375rem .75rem;line-height:1rem}:host button.nggv-prev-button.large,:host button.nggv-next-button.large{min-height:4rem;padding:1rem 1.5rem;font-size:1.5rem;line-height:2rem}@media (max-width: 47.98em){:host button.nggv-prev-button,:host button.nggv-next-button{width:3em;height:3em}}:host button.nggv-prev-button:hover,:host button.nggv-next-button:hover{background-color:#e9e9e9}@media (max-width: 35.98em){:host button.nggv-prev-button,:host button.nggv-next-button{min-width:initial}}\n"] }]
1358
+ }], ctorParameters: () => [{ type: i1.UntypedFormBuilder }], propDecorators: { calendarChange: [{
1359
+ type: Output
1360
+ }], activeCalendar: [{
1361
+ type: Input
1362
+ }], locale: [{
1363
+ type: Input
1364
+ }], type: [{
1365
+ type: Input
1366
+ }], keyNavigation: [{
1367
+ type: HostListener,
1368
+ args: ['keydown', ['$event']]
1369
+ }] } });
1370
+
1371
+ ;
1372
+ (() => {
1373
+ // Make sure there is an incremental ID each component can use
1374
+ if (typeof window !== 'undefined' && !window.ngv) {
1375
+ window.ngv = {
1376
+ ids: { default: -1 },
1377
+ nextId(namespace = 'default') {
1378
+ let id = this.ids[namespace] || 0;
1379
+ if (typeof this.ids[namespace] === 'number')
1380
+ id++;
1381
+ this.ids[namespace] = id;
1382
+ return namespace === 'default'
1383
+ ? `nggv-${id}`
1384
+ : `nggv-${namespace}-${id}`;
1385
+ },
1386
+ };
1387
+ }
1388
+ })();
1389
+
1390
+ class DatepickerComponent {
1391
+ constructor() {
1392
+ this.calendarTemplate = null;
1393
+ /** Emits a Date upon selection. */
1394
+ this.ngvDateChange = new EventEmitter();
1395
+ /** Sets first day of week in calendar. Defaults to Monday. */
1396
+ this.firstDayOfWeek = WeekDay.Monday;
1397
+ /** Bank holidays. */
1398
+ this.disableDates = [];
1399
+ /** Other non selectable dates. */
1400
+ this.disableWeekDays = [];
1401
+ /** Minimum number of calendar rows shown. */
1402
+ this.minCalendarRows = 5;
1403
+ /** Set locale for date format. */
1404
+ this.locale = 'en-US';
1405
+ /** Set type of calendar. */
1406
+ this.type = 'normal';
1407
+ /** @internal */
1408
+ /** @internal */
1409
+ this.weekdayArray = [];
1410
+ /** @internal */
1411
+ this.disabledDatesForActiveMonth = [];
1412
+ this.subs = [];
1413
+ }
1414
+ ngOnChanges(changes) {
1415
+ if (changes.selected &&
1416
+ !!changes.selected.currentValue &&
1417
+ !changes.selected.isFirstChange()) {
1418
+ // set active calendar to match selected date
1419
+ const activeCalendar = new CalendarMonth(new Date(changes.selected.currentValue));
1420
+ this.changeActiveCalendar(activeCalendar);
1421
+ }
1422
+ if (changes.disableDates && !changes.disableDates.isFirstChange()) {
1423
+ this.disabledDatesForActiveMonth = this.getDisabledDatesFor(this.activeCalendar, changes.disableDates.currentValue || []);
1424
+ }
1425
+ }
1426
+ ngOnInit() {
1427
+ // initiate week label row
1428
+ this.weekdayArray = getSortedWeekDays(this.firstDayOfWeek);
1429
+ // initiate calendar
1430
+ const initDate = !!this.selected && isValid(this.selected)
1431
+ ? new Date(this.selected)
1432
+ : new Date();
1433
+ this.activeCalendar = new CalendarMonth(initDate);
1434
+ }
1435
+ ngOnDestroy() {
1436
+ this.subs.forEach((sub) => sub.unsubscribe());
1437
+ }
1438
+ /**
1439
+ * @internal
1440
+ * Update local calendar variable and changes displayed calendar.
1441
+ */
1442
+ changeActiveCalendar(calendar) {
1443
+ this.activeCalendar = calendar;
1444
+ this.disabledDatesForActiveMonth = this.getDisabledDatesFor(calendar, this.disableDates);
1445
+ }
1446
+ /**
1447
+ * @internal
1448
+ * Returns a subset of all disabled dates.
1449
+ *
1450
+ * @param month current month to filter from
1451
+ * @param disableDates master list of all disabled dates
1452
+ * @returns a subset with current and adjacent months disabled dates
1453
+ */
1454
+ getDisabledDatesFor(calendar, disableDates) {
1455
+ if (!disableDates)
1456
+ disableDates = [];
1457
+ // sets month to target month
1458
+ const targetMonth = calendar.date;
1459
+ // gets previous month from target month
1460
+ const previousMonth = calendar.previousMonth().date;
1461
+ // gets next month from target month
1462
+ const nextMonth = calendar.nextMonth().date;
1463
+ // checks if two dates are within the same year and month
1464
+ const withinSameMonth = (a, b) => a.getMonth() === b.getMonth() && a.getFullYear() === b.getFullYear();
1465
+ // filter out disabled dates for current and adjacent months
1466
+ return disableDates
1467
+ .map((d) => new Date(d))
1468
+ .filter((d) => withinSameMonth(d, previousMonth) ||
1469
+ withinSameMonth(d, targetMonth) ||
1470
+ withinSameMonth(d, nextMonth));
1471
+ }
1472
+ /**
1473
+ * Handles date-clicks from calendar compoentn. Emits event or changes calendar.
1474
+ * @param date date clicked in calendar
1475
+ */
1476
+ dateClickHandler(date) {
1477
+ // if a date is clicked within the active month, emit date
1478
+ if (date.getMonth() === this.activeCalendar.month)
1479
+ return this.ngvDateChange.emit(date);
1480
+ // else, change active calendar to match the date clicked
1481
+ this.selected = date;
1482
+ this.changeActiveCalendar(new CalendarMonth(date));
1483
+ }
1484
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DatepickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1485
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: DatepickerComponent, selector: "nggv-datepicker", inputs: { firstDayOfWeek: "firstDayOfWeek", disableDates: "disableDates", disableWeekDays: "disableWeekDays", minCalendarRows: "minCalendarRows", selected: "selected", locale: "locale", type: "type", firstValid: "firstValid", lastValid: "lastValid", closingTime: "closingTime" }, outputs: { ngvDateChange: "ngvDateChange" }, viewQueries: [{ propertyName: "calendarTemplate", first: true, predicate: ["calendarTemplate"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<!-- control for changing displayed calendar -->\n<nggv-calendar-control\n [activeCalendar]=\"activeCalendar\"\n [locale]=\"locale\"\n [type]=\"type\"\n (calendarChange)=\"changeActiveCalendar($event)\"\n>\n</nggv-calendar-control>\n\n<!-- label row for week -->\n<div class=\"nggv-weekday-row\">\n <span *ngFor=\"let weekday of weekdayArray\">{{\n weekday | date: 'EEE' : undefined : locale\n }}</span>\n</div>\n\n<!-- outlet for active calendar -->\n<div class=\"nggv-calendar-view-container\">\n <ng-container\n *ngTemplateOutlet=\"\n calendarTemplate;\n context: {\n calendar: activeCalendar,\n disableDates: disabledDatesForActiveMonth,\n }\n \"\n >\n </ng-container>\n</div>\n\n<div *ngIf=\"type === 'extended'\" class=\"gds-datepicker__controls\">\n <ng-content></ng-content>\n</div>\n\n<ng-template\n #calendarTemplate\n let-calendar=\"calendar\"\n let-disableDates=\"disableDates\"\n>\n <nggv-calendar\n [year]=\"calendar.year\"\n [month]=\"calendar.month\"\n [type]=\"type\"\n [locale]=\"locale\"\n [disableDates]=\"disableDates\"\n [selected]=\"selected\"\n [lastValid]=\"lastValid\"\n [firstValid]=\"firstValid\"\n [closingTime]=\"closingTime\"\n [disableWeekDays]=\"disableWeekDays\"\n [minCalendarRows]=\"minCalendarRows\"\n [firstDayOfWeek]=\"firstDayOfWeek\"\n (dateClick)=\"dateClickHandler($event)\"\n >\n </nggv-calendar>\n</ng-template>\n", styles: [":host{border-radius:4px;border:1px solid #868686;overflow:hidden;z-index:1000;background-color:#fff;position:absolute;display:block;box-shadow:0 0 12px #0000001a}:host .nggv-calendar-view-container{border-top:1px solid #f8f8f8;border-bottom:1px solid #f8f8f8;padding:.125em;width:auto}:host .nggv-weekday-row{display:flex;font-family:SEBSansSerif,Arial,sans-serif;font-size:.875rem}:host .nggv-weekday-row:first-child{font-size:.7em;line-height:2.5rem}:host .nggv-weekday-row button,:host .nggv-weekday-row span{padding:0;display:block;flex-grow:1;text-align:center;width:20%;color:#333}:host .nggv-weekday-row button:disabled,:host .nggv-weekday-row span:disabled{border-radius:0;border:0px solid transparent}:host .nggv-extended-controls{display:flex;padding:.5rem}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: CalendarComponent, selector: "nggv-calendar", inputs: ["year", "month", "selected", "locale", "minCalendarRows", "firstDayOfWeek", "type", "disableDates", "disableWeekDays", "firstValid", "lastValid", "closingTime"], outputs: ["dateClick"] }, { kind: "component", type: CalendarControlComponent, selector: "nggv-calendar-control", inputs: ["activeCalendar", "locale", "type"], outputs: ["calendarChange"] }, { kind: "pipe", type: i1$1.DatePipe, name: "date" }] }); }
1486
+ }
1487
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DatepickerComponent, decorators: [{
1488
+ type: Component,
1489
+ args: [{ selector: 'nggv-datepicker', template: "<!-- control for changing displayed calendar -->\n<nggv-calendar-control\n [activeCalendar]=\"activeCalendar\"\n [locale]=\"locale\"\n [type]=\"type\"\n (calendarChange)=\"changeActiveCalendar($event)\"\n>\n</nggv-calendar-control>\n\n<!-- label row for week -->\n<div class=\"nggv-weekday-row\">\n <span *ngFor=\"let weekday of weekdayArray\">{{\n weekday | date: 'EEE' : undefined : locale\n }}</span>\n</div>\n\n<!-- outlet for active calendar -->\n<div class=\"nggv-calendar-view-container\">\n <ng-container\n *ngTemplateOutlet=\"\n calendarTemplate;\n context: {\n calendar: activeCalendar,\n disableDates: disabledDatesForActiveMonth,\n }\n \"\n >\n </ng-container>\n</div>\n\n<div *ngIf=\"type === 'extended'\" class=\"gds-datepicker__controls\">\n <ng-content></ng-content>\n</div>\n\n<ng-template\n #calendarTemplate\n let-calendar=\"calendar\"\n let-disableDates=\"disableDates\"\n>\n <nggv-calendar\n [year]=\"calendar.year\"\n [month]=\"calendar.month\"\n [type]=\"type\"\n [locale]=\"locale\"\n [disableDates]=\"disableDates\"\n [selected]=\"selected\"\n [lastValid]=\"lastValid\"\n [firstValid]=\"firstValid\"\n [closingTime]=\"closingTime\"\n [disableWeekDays]=\"disableWeekDays\"\n [minCalendarRows]=\"minCalendarRows\"\n [firstDayOfWeek]=\"firstDayOfWeek\"\n (dateClick)=\"dateClickHandler($event)\"\n >\n </nggv-calendar>\n</ng-template>\n", styles: [":host{border-radius:4px;border:1px solid #868686;overflow:hidden;z-index:1000;background-color:#fff;position:absolute;display:block;box-shadow:0 0 12px #0000001a}:host .nggv-calendar-view-container{border-top:1px solid #f8f8f8;border-bottom:1px solid #f8f8f8;padding:.125em;width:auto}:host .nggv-weekday-row{display:flex;font-family:SEBSansSerif,Arial,sans-serif;font-size:.875rem}:host .nggv-weekday-row:first-child{font-size:.7em;line-height:2.5rem}:host .nggv-weekday-row button,:host .nggv-weekday-row span{padding:0;display:block;flex-grow:1;text-align:center;width:20%;color:#333}:host .nggv-weekday-row button:disabled,:host .nggv-weekday-row span:disabled{border-radius:0;border:0px solid transparent}:host .nggv-extended-controls{display:flex;padding:.5rem}\n"] }]
1490
+ }], propDecorators: { calendarTemplate: [{
1491
+ type: ViewChild,
1492
+ args: ['calendarTemplate']
1493
+ }], ngvDateChange: [{
1494
+ type: Output
1495
+ }], firstDayOfWeek: [{
1496
+ type: Input
1497
+ }], disableDates: [{
1498
+ type: Input
1499
+ }], disableWeekDays: [{
1500
+ type: Input
1501
+ }], minCalendarRows: [{
1502
+ type: Input
1503
+ }], selected: [{
1504
+ type: Input
1505
+ }], locale: [{
1506
+ type: Input
1507
+ }], type: [{
1508
+ type: Input
1509
+ }], firstValid: [{
1510
+ type: Input
1511
+ }], lastValid: [{
1512
+ type: Input
1513
+ }], closingTime: [{
1514
+ type: Input
1515
+ }] } });
1516
+
1517
+ /**
1518
+ * Date pickers simplify the task of selecting a date in a visual representation of a calendar.
1519
+ * https://designlibrary.sebgroup.com/components/component-datepicker
1520
+ *
1521
+ * Selector: `nggv-dateinput`
1522
+ *
1523
+ * When focusing an date element, the calendar allows for navigation using both tab and arrow keys.
1524
+ * Pressing 'esc' will close the calendar.
1525
+ *
1526
+ * Requires TranslocoLocale, but in turn allows for setting locale dynamically:
1527
+ * https://jsverse.github.io/transloco/docs/plugins/locale/#manually-setting-locale
1528
+ *
1529
+ * To configure TranslocoLocale, follow this guide:
1530
+ * https://jsverse.github.io/transloco/docs/plugins/locale/#setup
1531
+ */
1532
+ class DateInputComponent extends DateControlValueAccessorComponent {
1533
+ constructor(ngControl, translocoScope, transloco, elementRef, cdr) {
1534
+ super(ngControl, translocoScope, elementRef, cdr, transloco);
1535
+ this.ngControl = ngControl;
1536
+ this.translocoScope = translocoScope;
1537
+ this.transloco = transloco;
1538
+ this.elementRef = elementRef;
1539
+ this.cdr = cdr;
1540
+ /** Special property used for selecting DOM elements during automated UI testing. */
1541
+ this.thook = 'date-input';
1542
+ /** Set type of calendar: either 'normal' or 'expanded'. Default is 'normal'. */
1543
+ this.type = 'normal';
1544
+ /** If set to true, the value will not be editable. */
1545
+ this.readonly = false;
1546
+ /**
1547
+ * An array of Dates or parsable strings that corresponds with dates that should not be selectable in the calendar.
1548
+ * I.e. bank holidays.
1549
+ */
1550
+ this.disableDates = [];
1551
+ /**
1552
+ * An array of weekdays that should not be selectable in the calendar.
1553
+ * Can be used together with or instead of @Input() disableDates.
1554
+ */
1555
+ this.disableWeekDays = [];
1556
+ /** Mininum number of rows shown in the calendar. */
1557
+ this.minRows = 5;
1558
+ /** Sets first day of week in calendar. Defaults to Monday. */
1559
+ this.firstDayOfWeek = WeekDay.Monday;
1560
+ /** If set to true, it will allow to close the calendar on escape button click. */
1561
+ this.closeCalendarOnEscape = true;
1562
+ /** @internal */
1563
+ // calendarIcon: IconDefinition = faCalendarDays;
1564
+ /** @internal */
1565
+ this.shown = false;
1566
+ /** @internal */
1567
+ this.showInput$ = this.showInputDateSrc.asObservable().pipe(startWith(true));
1568
+ /** Observable for listening to clicks outside of the datepicker. */
1569
+ this.documentClick$ = fromEvent(document, 'click');
1570
+ /** Subject used for unsubscribe pattern on above observable. */
1571
+ this.datepickerClosed$ = new Subject();
1572
+ // this.showInput$ = this.showInputDateSrc.asObservable()
1573
+ }
1574
+ ngOnDestroy() {
1575
+ this.datepickerClosed$.next(true);
1576
+ this.datepickerClosed$.complete();
1577
+ }
1578
+ /**
1579
+ * @internal
1580
+ * Called from the datepicker-component when a date button is clicked in the calendar.
1581
+ *
1582
+ * @param date date object emitted when selecting a date in the datepicker.
1583
+ */
1584
+ onDateChange(date) {
1585
+ // control value accessor will ensure correct formatting of state
1586
+ this.state = DateControlValueAccessorComponent.parseDateLike(date);
1587
+ // emit state
1588
+ this.onChange(this.state);
1589
+ // close datepicker and move focus to datepicker button
1590
+ this.setShown(false);
1591
+ setTimeout(() => this.toggleButtonRef?.nativeElement.focus(), 1);
1592
+ }
1593
+ /**
1594
+ * @internal
1595
+ * Called when entering date manually in input field.
1596
+ */
1597
+ onValueChange(eventTarget) {
1598
+ // Will be in the format selected in inputMask
1599
+ const value = `${eventTarget.inputmask.undoValue}` ?? '';
1600
+ // Use parserfunction from inputMask to parse to a date object since value can be in multiple formats
1601
+ // Then ontrol value accessor will ensure correct formatting of state
1602
+ const parsedDate = DateControlValueAccessorComponent.parseDateLike(this.dateInputMask.parser(value));
1603
+ this.state = parsedDate;
1604
+ // emit parsed date
1605
+ this.onChange(parsedDate);
1606
+ this.onTouched();
1607
+ }
1608
+ /**
1609
+ * @internal
1610
+ * Listen to 'esc' keypress and closes datepicker if open.
1611
+ */
1612
+ keyListener(event) {
1613
+ if (this.closeCalendarOnEscape && event.key === 'Escape')
1614
+ this.setShown(false);
1615
+ }
1616
+ /** @internal */
1617
+ toggleDatepicker() {
1618
+ this.setShown(!this.shown);
1619
+ }
1620
+ /** To externally trigger the datepicker to close. */
1621
+ close() {
1622
+ this.setShown(false);
1623
+ }
1624
+ /**
1625
+ * Set the shown state of the datepicker popup. If true the popup will be visible.
1626
+ * If the state is set to false, call onTouched to notify any state listeners
1627
+ * @param state the shown state which to set.
1628
+ */
1629
+ setShown(state = true) {
1630
+ this.shown = state;
1631
+ if (!this.shown) {
1632
+ // if shown is set to false, stop listening to clicks
1633
+ this.datepickerClosed$.next(true);
1634
+ return this.onTouched();
1635
+ }
1636
+ // if shown is set to true, reset unsubscribe variable
1637
+ this.datepickerClosed$.next(false);
1638
+ // start listening for clicks outside the component
1639
+ this.documentClick$.pipe(takeUntil(this.datepickerClosed$)).subscribe({
1640
+ next: (event) => {
1641
+ // clicking on a gray date causes the datepicker to reload the calendar dates,
1642
+ // and the button element clicked will no longer be considered as a child of the datepicker.
1643
+ // but the event target path will still contain the parent element
1644
+ // if target has datepicker parent, keep listening
1645
+ const eventPath = event.composedPath();
1646
+ const hasDatepickerParent = !!eventPath.find((e) => e === this.elementRef.nativeElement);
1647
+ if (hasDatepickerParent)
1648
+ return;
1649
+ // else the click is considered to be outside, close datepicker
1650
+ return this.setShown(false);
1651
+ },
1652
+ });
1653
+ }
1654
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DateInputComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: TRANSLOCO_SCOPE, optional: true }, { token: i2.TranslocoService }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
1655
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: DateInputComponent, selector: "nggv-dateinput,nggv-input[type=date]", inputs: { thook: "thook", type: "type", readonly: "readonly", disableDates: "disableDates", disableWeekDays: "disableWeekDays", minRows: "minRows", firstValid: "firstValid", lastValid: "lastValid", closingTime: "closingTime", firstDayOfWeek: "firstDayOfWeek", closeCalendarOnEscape: "closeCalendarOnEscape" }, host: { listeners: { "keydown": "keyListener($event)" }, properties: { "attr.data-thook": "this.thook" } }, viewQueries: [{ propertyName: "toggleButtonRef", first: true, predicate: ["toggleCalendarButton"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<!-- LABEL -->\n<ng-container *transloco=\"let t; read: scope\">\n <label\n [id]=\"id + '-label'\"\n class=\"gds-field-label hide-if-empty\"\n [attr.for]=\"id + '-input'\"\n >\n <ng-template\n *ngTemplateOutlet=\"labelContentTpl || basicLabelContentTpl\"\n ></ng-template>\n <ng-template #basicLabelContentTpl>\n <!-- to trigger css:empty if no label was added -->\n <ng-container *ngIf=\"label\">\n {{ label }}\n <span\n *ngIf=\"optional === true || (required !== true && optional !== false)\"\n class=\"gds-field-label--optional\"\n >\n ({{ t('label.optional') }})\n </span>\n </ng-container>\n </ng-template>\n </label>\n\n <!-- DESCRIPTION -->\n <div class=\"gds-field-label--small description hide-if-empty\">\n {{ description }}\n </div>\n\n <!-- LOCKED INPUT -->\n <ng-container *ngIf=\"locked\">\n <div\n [id]=\"id + '-input'\"\n class=\"nggv-field--locked\"\n [attr.name]=\"name\"\n [attr.value]=\"state\"\n [attr.role]=\"role\"\n >\n <span *ngIf=\"!state\" class=\"unset-state\">-</span>\n <ng-container *ngIf=\"state\">\n {{ state | nggvInputMaskFormat: dateInputMask }}\n </ng-container>\n </div>\n </ng-container>\n\n <!-- INPUT WRAPPER -->\n <ng-container *ngIf=\"!locked\">\n <div\n class=\"field-wrap\"\n [class.nggv-field--error]=\"invalid\"\n *ngIf=\"showInput$ | async\"\n >\n <!-- INPUT FIELD -->\n <input\n #input\n [id]=\"id + '-input'\"\n class=\"nggv-field-date\"\n type=\"text\"\n autocomplete=\"off\"\n [attr.name]=\"name\"\n [attr.required]=\"required\"\n [disabled]=\"disabled\"\n [readOnly]=\"readonly\"\n [attr.role]=\"role\"\n [attr.placeholder]=\"placeholder\"\n [attr.aria-label]=\"description\"\n [nggvInputMask]=\"dateInputMask\"\n [value]=\"state\"\n title=\"\"\n (change)=\"onValueChange($event.target)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n />\n\n <button\n aria-label=\"toggle calendar\"\n #toggleCalendarButton\n class=\"nggv-button-date\"\n type=\"button\"\n data-thook=\"toggle-calendar-button\"\n (click)=\"toggleDatepicker()\"\n [disabled]=\"disabled\"\n >\n <gds-icon-calendar\n *nggCoreElement\n width=\"20\"\n height=\"20\"\n ></gds-icon-calendar>\n </button>\n </div>\n\n <!-- DATEPICKER -->\n <div class=\"nggv-datepicker\" *ngIf=\"shown\">\n <nggv-datepicker\n #input\n [type]=\"type\"\n [disableDates]=\"disableDates\"\n [disableWeekDays]=\"disableWeekDays\"\n [selected]=\"state\"\n [locale]=\"locale\"\n [minCalendarRows]=\"minRows\"\n [firstDayOfWeek]=\"firstDayOfWeek\"\n [firstValid]=\"firstValid\"\n [lastValid]=\"lastValid\"\n [closingTime]=\"closingTime\"\n (ngvDateChange)=\"onDateChange($event)\"\n >\n <ng-content></ng-content>\n </nggv-datepicker>\n </div>\n\n <!-- ERRORS -->\n <ng-container\n *ngIf=\"\n invalid &&\n (error || ngControl?.invalid) &&\n (!errorList || !errorList.length)\n \"\n >\n <label\n class=\"gds-field-notice gds-field-notice--error\"\n [attr.for]=\"id + '-input'\"\n >\n <span class=\"error-item\">\n <span class=\"error-item--icon\">\n <gds-icon-triangle-exclamation\n *nggCoreElement\n [solid]=\"true\"\n width=\"16\"\n height=\"16\"\n ></gds-icon-triangle-exclamation>\n </span>\n <span\n *ngIf=\"error; else errorsRef\"\n class=\"error-item--text\"\n [attr.data-thook]=\"thook + '-errorlabel'\"\n >{{ error }}</span\n >\n <ng-template #errorsRef>\n <span\n *ngIf=\"firstError as error\"\n class=\"error-item--text\"\n [attr.data-thook]=\"thook + '-errorlabel'\"\n >\n {{ t('error.field' + error?.code, error?.params) }}\n </span>\n </ng-template>\n </span>\n </label>\n </ng-container>\n\n <ng-container *ngFor=\"let error of errorList ?? []\">\n <label\n class=\"gds-field-notice gds-field-notice--error\"\n [attr.for]=\"id + '-input'\"\n *ngIf=\"invalid && error\"\n >\n <span class=\"error-item\">\n <span class=\"error-item--icon\">\n <gds-icon-triangle-exclamation\n *nggCoreElement\n [solid]=\"true\"\n width=\"16\"\n height=\"16\"\n ></gds-icon-triangle-exclamation>\n </span>\n <span\n class=\"error-item--text\"\n [attr.data-thook]=\"thook + '-errorlabel'\"\n >{{ error }}</span\n >\n </span>\n </label>\n </ng-container>\n </ng-container>\n</ng-container>\n", styles: [":host{display:block;position:relative}@media (max-width: 47.98em){:host{min-width:100%}}:host .hide-if-empty:empty{display:none}:host .unset-state{padding-left:.5rem}:host .gds-field-label{display:block}:host .gds-field-label:is(label){margin-bottom:0}:host .gds-field-label.form-control{width:fit-content}@supports (-moz-appearance: none){:host .gds-field-label.form-control:focus:not(:focus-visible){box-shadow:none;outline:0}:host .gds-field-label.form-control:focus,:host .gds-field-label.form-control:focus-within{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}}:host .gds-field-label:not(.form-control){font-weight:500;width:100%;line-height:1.25rem}:host .gds-field-label+input,:host .gds-field-label+textarea,fieldset :host .gds-field-label+div,:host .gds-field-label+button,:host .gds-field-label+.group-stepper,:host .gds-field-label+.stepper-wrapper,:host .gds-field-label+.group{margin-top:.5rem}:host .gds-field-label+.form-info{margin-bottom:.5rem}:host .gds-field-label:is(label){margin-bottom:.5rem}:host .gds-field-label--optional{margin-bottom:.5rem}:host .gds-field-label--optional:is(label){margin-bottom:0}:host .gds-field-label--optional.form-control{width:fit-content}@supports (-moz-appearance: none){:host .gds-field-label--optional.form-control:focus:not(:focus-visible){box-shadow:none;outline:0}:host .gds-field-label--optional.form-control:focus,:host .gds-field-label--optional.form-control:focus-within{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}}:host .gds-field-label--optional:not(.form-control){font-weight:500;width:100%;line-height:1.25rem}:host .gds-field-label--optional+input,:host .gds-field-label--optional+textarea,fieldset :host .gds-field-label--optional+div,:host .gds-field-label--optional+button,:host .gds-field-label--optional+.group-stepper,:host .gds-field-label--optional+.stepper-wrapper,:host .gds-field-label--optional+.group{margin-top:.5rem}:host .gds-field-label--optional+.form-info{margin-bottom:.5rem}:host .nggv-datepicker{margin-top:.25rem;position:absolute}:host .nggv-field--error{border-bottom:.125rem solid #9f000a!important}:host .nggv-field--error:focus,:host .nggv-field--error:active,:host .nggv-field--error:hover{border-bottom:.125rem solid #9f000a!important}:host .error-item{display:flex;gap:.5rem;color:#9f000a}:host .gds-field-notice{margin-top:.5rem;display:block;font-size:.875rem;line-height:1;font-weight:500}:host .field-wrap{border:1px solid #868686;border-radius:4px;outline:none;box-sizing:border-box;min-height:2.75rem;line-height:1.5;font-size:1rem;font-family:inherit;height:2.625rem;display:flex}:host .field-wrap *,:host .field-wrap *:before,:host .field-wrap *:after{box-sizing:border-box}:host .field-wrap .nggv-button-date{--text-disabled-color: #adadad;padding:.75rem 1rem;border-radius:var(--sg-border-radius);border:solid var(--sg-border-width) var(--sg-border-color);font-weight:500;min-height:2.75rem;align-items:center;display:inline-flex;justify-content:center;transition:all .3s cubic-bezier(.23,1,.32,1),outline-offset 0s,outline-width 0s;border-color:#333;color:#333;--color: rgb(51, 51, 51);background-color:transparent;min-height:2.5rem;border:none;border-radius:3px;width:2.625rem;height:2.625rem;min-width:2.625rem;border-top-left-radius:0!important;border-bottom-left-radius:0!important;text-align:right}:host .field-wrap .nggv-button-date:focus:not(:focus-visible){box-shadow:none;outline:0}:host .field-wrap .nggv-button-date:focus,:host .field-wrap .nggv-button-date:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}@media (max-width: 35.98em){:host .field-wrap .nggv-button-date{min-width:100%}}@media screen and (-ms-high-contrast: active){:host .field-wrap .nggv-button-date{border:2px solid currentcolor}}:host .field-wrap .nggv-button-date.small{min-height:2rem;padding:.4375rem .75rem;line-height:1rem}:host .field-wrap .nggv-button-date.large{min-height:4rem;padding:1rem 1.5rem;font-size:1.5rem;line-height:2rem}:host .field-wrap .nggv-button-date:not(:disabled,.disabled,[aria-disabled]):hover{background-color:#333;color:#fff;--background: rgb(51, 51, 51);--color: rgb(255, 255, 255);border-color:#333}:host .field-wrap .nggv-button-date[aria-selected=true],:host .field-wrap .nggv-button-date:active,:host .field-wrap .nggv-button-date.active,:host .field-wrap .nggv-button-date.active:hover,:host .field-wrap .nggv-button-date:active:hover{background-color:#333;color:#fff;--background: rgb(51, 51, 51);--color: rgb(255, 255, 255);border-color:#333}:host .field-wrap .nggv-button-date[aria-selected]:hover,:host .field-wrap .nggv-button-date.active:hover,:host .field-wrap .nggv-button-date:active:hover{opacity:.9}:host .field-wrap .nggv-button-date:focus-visible{background-color:#333;color:#fff;--background: rgb(51, 51, 51);--color: rgb(255, 255, 255);border-color:#333!important}:host .field-wrap .nggv-button-date:disabled,:host .field-wrap .nggv-button-date.disabled,:host .field-wrap .nggv-button-date[aria-disabled=true]{color:var(--text-disabled-color)!important;border-color:var(--border-disabled-color)!important;cursor:not-allowed}:host .field-wrap .nggv-button-date:disabled::placeholder,:host .field-wrap .nggv-button-date.disabled::placeholder,:host .field-wrap .nggv-button-date[aria-disabled=true]::placeholder{color:var(--text-disabled-color)}@media (max-width: 47.98em){:host .field-wrap .nggv-button-date{width:2.625rem;height:2.625rem}}:host .field-wrap .nggv-button-date:focus{outline-color:#1a1a1a;outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .field-wrap .nggv-button-date[disabled]{background-color:#f8f8f8!important;color:#adadad}@media (max-width: 35.98em){:host .field-wrap .nggv-button-date{min-width:initial}}:host .field-wrap input[type=text]::-webkit-inner-spin-button,:host .field-wrap input[type=text]::-webkit-calendar-picker-indicator{display:none;-webkit-appearance:none;font-size:1rem;font-family:inherit}:host .field-wrap .nggv-field-date{border:1px solid #cecece;border-radius:4px 0 0 4px;outline:none;box-sizing:border-box;min-height:2.75rem;line-height:1.5;font-size:1rem;font-family:inherit;border:none;min-height:2.375rem;width:100%;padding-left:1rem}:host .field-wrap .nggv-field-date *,:host .field-wrap .nggv-field-date *:before,:host .field-wrap .nggv-field-date *:after{box-sizing:border-box}:host .field-wrap .nggv-field-date:hover{border-color:#41b0ee}:host .field-wrap .nggv-field-date:focus{outline-color:#1a1a1a;outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .field-wrap .nggv-field-date:active{border-color:#cecece}:host .field-wrap .nggv-field-date[disabled]{background-color:#f8f8f8;border-color:#cecece}:host .field-wrap .nggv-field-date[disabled]::placeholder{color:#cecece}:host .field-wrap .nggv-field-date:not(:focus){border-right:none;padding-right:0}:host .field-wrap .nggv-field-date:focus{padding-right:0}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "directive", type: i4.NggvInputMaskDirective, selector: "[nggvInputMask]", inputs: ["nggvInputMask"] }, { kind: "directive", type: i3.NggCoreElementDirective, selector: "[nggCoreElement]" }, { kind: "component", type: DatepickerComponent, selector: "nggv-datepicker", inputs: ["firstDayOfWeek", "disableDates", "disableWeekDays", "minCalendarRows", "selected", "locale", "type", "firstValid", "lastValid", "closingTime"], outputs: ["ngvDateChange"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.InputMaskFormatPipe, name: "nggvInputMaskFormat" }] }); }
1656
+ }
1657
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DateInputComponent, decorators: [{
1658
+ type: Component,
1659
+ args: [{ selector: 'nggv-dateinput,nggv-input[type=date]', template: "<!-- LABEL -->\n<ng-container *transloco=\"let t; read: scope\">\n <label\n [id]=\"id + '-label'\"\n class=\"gds-field-label hide-if-empty\"\n [attr.for]=\"id + '-input'\"\n >\n <ng-template\n *ngTemplateOutlet=\"labelContentTpl || basicLabelContentTpl\"\n ></ng-template>\n <ng-template #basicLabelContentTpl>\n <!-- to trigger css:empty if no label was added -->\n <ng-container *ngIf=\"label\">\n {{ label }}\n <span\n *ngIf=\"optional === true || (required !== true && optional !== false)\"\n class=\"gds-field-label--optional\"\n >\n ({{ t('label.optional') }})\n </span>\n </ng-container>\n </ng-template>\n </label>\n\n <!-- DESCRIPTION -->\n <div class=\"gds-field-label--small description hide-if-empty\">\n {{ description }}\n </div>\n\n <!-- LOCKED INPUT -->\n <ng-container *ngIf=\"locked\">\n <div\n [id]=\"id + '-input'\"\n class=\"nggv-field--locked\"\n [attr.name]=\"name\"\n [attr.value]=\"state\"\n [attr.role]=\"role\"\n >\n <span *ngIf=\"!state\" class=\"unset-state\">-</span>\n <ng-container *ngIf=\"state\">\n {{ state | nggvInputMaskFormat: dateInputMask }}\n </ng-container>\n </div>\n </ng-container>\n\n <!-- INPUT WRAPPER -->\n <ng-container *ngIf=\"!locked\">\n <div\n class=\"field-wrap\"\n [class.nggv-field--error]=\"invalid\"\n *ngIf=\"showInput$ | async\"\n >\n <!-- INPUT FIELD -->\n <input\n #input\n [id]=\"id + '-input'\"\n class=\"nggv-field-date\"\n type=\"text\"\n autocomplete=\"off\"\n [attr.name]=\"name\"\n [attr.required]=\"required\"\n [disabled]=\"disabled\"\n [readOnly]=\"readonly\"\n [attr.role]=\"role\"\n [attr.placeholder]=\"placeholder\"\n [attr.aria-label]=\"description\"\n [nggvInputMask]=\"dateInputMask\"\n [value]=\"state\"\n title=\"\"\n (change)=\"onValueChange($event.target)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n />\n\n <button\n aria-label=\"toggle calendar\"\n #toggleCalendarButton\n class=\"nggv-button-date\"\n type=\"button\"\n data-thook=\"toggle-calendar-button\"\n (click)=\"toggleDatepicker()\"\n [disabled]=\"disabled\"\n >\n <gds-icon-calendar\n *nggCoreElement\n width=\"20\"\n height=\"20\"\n ></gds-icon-calendar>\n </button>\n </div>\n\n <!-- DATEPICKER -->\n <div class=\"nggv-datepicker\" *ngIf=\"shown\">\n <nggv-datepicker\n #input\n [type]=\"type\"\n [disableDates]=\"disableDates\"\n [disableWeekDays]=\"disableWeekDays\"\n [selected]=\"state\"\n [locale]=\"locale\"\n [minCalendarRows]=\"minRows\"\n [firstDayOfWeek]=\"firstDayOfWeek\"\n [firstValid]=\"firstValid\"\n [lastValid]=\"lastValid\"\n [closingTime]=\"closingTime\"\n (ngvDateChange)=\"onDateChange($event)\"\n >\n <ng-content></ng-content>\n </nggv-datepicker>\n </div>\n\n <!-- ERRORS -->\n <ng-container\n *ngIf=\"\n invalid &&\n (error || ngControl?.invalid) &&\n (!errorList || !errorList.length)\n \"\n >\n <label\n class=\"gds-field-notice gds-field-notice--error\"\n [attr.for]=\"id + '-input'\"\n >\n <span class=\"error-item\">\n <span class=\"error-item--icon\">\n <gds-icon-triangle-exclamation\n *nggCoreElement\n [solid]=\"true\"\n width=\"16\"\n height=\"16\"\n ></gds-icon-triangle-exclamation>\n </span>\n <span\n *ngIf=\"error; else errorsRef\"\n class=\"error-item--text\"\n [attr.data-thook]=\"thook + '-errorlabel'\"\n >{{ error }}</span\n >\n <ng-template #errorsRef>\n <span\n *ngIf=\"firstError as error\"\n class=\"error-item--text\"\n [attr.data-thook]=\"thook + '-errorlabel'\"\n >\n {{ t('error.field' + error?.code, error?.params) }}\n </span>\n </ng-template>\n </span>\n </label>\n </ng-container>\n\n <ng-container *ngFor=\"let error of errorList ?? []\">\n <label\n class=\"gds-field-notice gds-field-notice--error\"\n [attr.for]=\"id + '-input'\"\n *ngIf=\"invalid && error\"\n >\n <span class=\"error-item\">\n <span class=\"error-item--icon\">\n <gds-icon-triangle-exclamation\n *nggCoreElement\n [solid]=\"true\"\n width=\"16\"\n height=\"16\"\n ></gds-icon-triangle-exclamation>\n </span>\n <span\n class=\"error-item--text\"\n [attr.data-thook]=\"thook + '-errorlabel'\"\n >{{ error }}</span\n >\n </span>\n </label>\n </ng-container>\n </ng-container>\n</ng-container>\n", styles: [":host{display:block;position:relative}@media (max-width: 47.98em){:host{min-width:100%}}:host .hide-if-empty:empty{display:none}:host .unset-state{padding-left:.5rem}:host .gds-field-label{display:block}:host .gds-field-label:is(label){margin-bottom:0}:host .gds-field-label.form-control{width:fit-content}@supports (-moz-appearance: none){:host .gds-field-label.form-control:focus:not(:focus-visible){box-shadow:none;outline:0}:host .gds-field-label.form-control:focus,:host .gds-field-label.form-control:focus-within{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}}:host .gds-field-label:not(.form-control){font-weight:500;width:100%;line-height:1.25rem}:host .gds-field-label+input,:host .gds-field-label+textarea,fieldset :host .gds-field-label+div,:host .gds-field-label+button,:host .gds-field-label+.group-stepper,:host .gds-field-label+.stepper-wrapper,:host .gds-field-label+.group{margin-top:.5rem}:host .gds-field-label+.form-info{margin-bottom:.5rem}:host .gds-field-label:is(label){margin-bottom:.5rem}:host .gds-field-label--optional{margin-bottom:.5rem}:host .gds-field-label--optional:is(label){margin-bottom:0}:host .gds-field-label--optional.form-control{width:fit-content}@supports (-moz-appearance: none){:host .gds-field-label--optional.form-control:focus:not(:focus-visible){box-shadow:none;outline:0}:host .gds-field-label--optional.form-control:focus,:host .gds-field-label--optional.form-control:focus-within{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}}:host .gds-field-label--optional:not(.form-control){font-weight:500;width:100%;line-height:1.25rem}:host .gds-field-label--optional+input,:host .gds-field-label--optional+textarea,fieldset :host .gds-field-label--optional+div,:host .gds-field-label--optional+button,:host .gds-field-label--optional+.group-stepper,:host .gds-field-label--optional+.stepper-wrapper,:host .gds-field-label--optional+.group{margin-top:.5rem}:host .gds-field-label--optional+.form-info{margin-bottom:.5rem}:host .nggv-datepicker{margin-top:.25rem;position:absolute}:host .nggv-field--error{border-bottom:.125rem solid #9f000a!important}:host .nggv-field--error:focus,:host .nggv-field--error:active,:host .nggv-field--error:hover{border-bottom:.125rem solid #9f000a!important}:host .error-item{display:flex;gap:.5rem;color:#9f000a}:host .gds-field-notice{margin-top:.5rem;display:block;font-size:.875rem;line-height:1;font-weight:500}:host .field-wrap{border:1px solid #868686;border-radius:4px;outline:none;box-sizing:border-box;min-height:2.75rem;line-height:1.5;font-size:1rem;font-family:inherit;height:2.625rem;display:flex}:host .field-wrap *,:host .field-wrap *:before,:host .field-wrap *:after{box-sizing:border-box}:host .field-wrap .nggv-button-date{--text-disabled-color: #adadad;padding:.75rem 1rem;border-radius:var(--sg-border-radius);border:solid var(--sg-border-width) var(--sg-border-color);font-weight:500;min-height:2.75rem;align-items:center;display:inline-flex;justify-content:center;transition:all .3s cubic-bezier(.23,1,.32,1),outline-offset 0s,outline-width 0s;border-color:#333;color:#333;--color: rgb(51, 51, 51);background-color:transparent;min-height:2.5rem;border:none;border-radius:3px;width:2.625rem;height:2.625rem;min-width:2.625rem;border-top-left-radius:0!important;border-bottom-left-radius:0!important;text-align:right}:host .field-wrap .nggv-button-date:focus:not(:focus-visible){box-shadow:none;outline:0}:host .field-wrap .nggv-button-date:focus,:host .field-wrap .nggv-button-date:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}@media (max-width: 35.98em){:host .field-wrap .nggv-button-date{min-width:100%}}@media screen and (-ms-high-contrast: active){:host .field-wrap .nggv-button-date{border:2px solid currentcolor}}:host .field-wrap .nggv-button-date.small{min-height:2rem;padding:.4375rem .75rem;line-height:1rem}:host .field-wrap .nggv-button-date.large{min-height:4rem;padding:1rem 1.5rem;font-size:1.5rem;line-height:2rem}:host .field-wrap .nggv-button-date:not(:disabled,.disabled,[aria-disabled]):hover{background-color:#333;color:#fff;--background: rgb(51, 51, 51);--color: rgb(255, 255, 255);border-color:#333}:host .field-wrap .nggv-button-date[aria-selected=true],:host .field-wrap .nggv-button-date:active,:host .field-wrap .nggv-button-date.active,:host .field-wrap .nggv-button-date.active:hover,:host .field-wrap .nggv-button-date:active:hover{background-color:#333;color:#fff;--background: rgb(51, 51, 51);--color: rgb(255, 255, 255);border-color:#333}:host .field-wrap .nggv-button-date[aria-selected]:hover,:host .field-wrap .nggv-button-date.active:hover,:host .field-wrap .nggv-button-date:active:hover{opacity:.9}:host .field-wrap .nggv-button-date:focus-visible{background-color:#333;color:#fff;--background: rgb(51, 51, 51);--color: rgb(255, 255, 255);border-color:#333!important}:host .field-wrap .nggv-button-date:disabled,:host .field-wrap .nggv-button-date.disabled,:host .field-wrap .nggv-button-date[aria-disabled=true]{color:var(--text-disabled-color)!important;border-color:var(--border-disabled-color)!important;cursor:not-allowed}:host .field-wrap .nggv-button-date:disabled::placeholder,:host .field-wrap .nggv-button-date.disabled::placeholder,:host .field-wrap .nggv-button-date[aria-disabled=true]::placeholder{color:var(--text-disabled-color)}@media (max-width: 47.98em){:host .field-wrap .nggv-button-date{width:2.625rem;height:2.625rem}}:host .field-wrap .nggv-button-date:focus{outline-color:#1a1a1a;outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .field-wrap .nggv-button-date[disabled]{background-color:#f8f8f8!important;color:#adadad}@media (max-width: 35.98em){:host .field-wrap .nggv-button-date{min-width:initial}}:host .field-wrap input[type=text]::-webkit-inner-spin-button,:host .field-wrap input[type=text]::-webkit-calendar-picker-indicator{display:none;-webkit-appearance:none;font-size:1rem;font-family:inherit}:host .field-wrap .nggv-field-date{border:1px solid #cecece;border-radius:4px 0 0 4px;outline:none;box-sizing:border-box;min-height:2.75rem;line-height:1.5;font-size:1rem;font-family:inherit;border:none;min-height:2.375rem;width:100%;padding-left:1rem}:host .field-wrap .nggv-field-date *,:host .field-wrap .nggv-field-date *:before,:host .field-wrap .nggv-field-date *:after{box-sizing:border-box}:host .field-wrap .nggv-field-date:hover{border-color:#41b0ee}:host .field-wrap .nggv-field-date:focus{outline-color:#1a1a1a;outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .field-wrap .nggv-field-date:active{border-color:#cecece}:host .field-wrap .nggv-field-date[disabled]{background-color:#f8f8f8;border-color:#cecece}:host .field-wrap .nggv-field-date[disabled]::placeholder{color:#cecece}:host .field-wrap .nggv-field-date:not(:focus){border-right:none;padding-right:0}:host .field-wrap .nggv-field-date:focus{padding-right:0}\n"] }]
1660
+ }], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
1661
+ type: Self
1662
+ }, {
1663
+ type: Optional
1664
+ }] }, { type: undefined, decorators: [{
1665
+ type: Optional
1666
+ }, {
1667
+ type: Inject,
1668
+ args: [TRANSLOCO_SCOPE]
1669
+ }] }, { type: i2.TranslocoService }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }], propDecorators: { toggleButtonRef: [{
1670
+ type: ViewChild,
1671
+ args: ['toggleCalendarButton']
1672
+ }], thook: [{
1673
+ type: HostBinding,
1674
+ args: ['attr.data-thook']
1675
+ }, {
1676
+ type: Input
1677
+ }], type: [{
1678
+ type: Input
1679
+ }], readonly: [{
1680
+ type: Input
1681
+ }], disableDates: [{
1682
+ type: Input
1683
+ }], disableWeekDays: [{
1684
+ type: Input
1685
+ }], minRows: [{
1686
+ type: Input
1687
+ }], firstValid: [{
1688
+ type: Input
1689
+ }], lastValid: [{
1690
+ type: Input
1691
+ }], closingTime: [{
1692
+ type: Input
1693
+ }], firstDayOfWeek: [{
1694
+ type: Input
1695
+ }], closeCalendarOnEscape: [{
1696
+ type: Input
1697
+ }], keyListener: [{
1698
+ type: HostListener,
1699
+ args: ['keydown', ['$event']]
1700
+ }] } });
1701
+
1702
+ class NggvDatepickerModule {
1703
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NggvDatepickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1704
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: NggvDatepickerModule, declarations: [CalendarComponent,
1705
+ CalendarDateDirective,
1706
+ IsDisabledPipe,
1707
+ DateThookPipe,
1708
+ CalendarControlComponent,
1709
+ DatepickerComponent,
1710
+ DateInputComponent,
1711
+ MatchesPipe], imports: [CommonModule,
1712
+ FormsModule,
1713
+ ReactiveFormsModule,
1714
+ TranslocoModule,
1715
+ NggvInputMaskModule,
1716
+ NggCoreWrapperModule], exports: [DateInputComponent, DatepickerComponent] }); }
1717
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NggvDatepickerModule, imports: [CommonModule,
1718
+ FormsModule,
1719
+ ReactiveFormsModule,
1720
+ TranslocoModule,
1721
+ NggvInputMaskModule,
1722
+ NggCoreWrapperModule] }); }
1723
+ }
1724
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NggvDatepickerModule, decorators: [{
1725
+ type: NgModule,
1726
+ args: [{
1727
+ declarations: [
1728
+ CalendarComponent,
1729
+ CalendarDateDirective,
1730
+ IsDisabledPipe,
1731
+ DateThookPipe,
1732
+ CalendarControlComponent,
1733
+ DatepickerComponent,
1734
+ DateInputComponent,
1735
+ MatchesPipe,
1736
+ ],
1737
+ imports: [
1738
+ CommonModule,
1739
+ FormsModule,
1740
+ ReactiveFormsModule,
1741
+ TranslocoModule,
1742
+ NggvInputMaskModule,
1743
+ NggCoreWrapperModule,
1744
+ ],
1745
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
1746
+ exports: [DateInputComponent, DatepickerComponent],
1747
+ }]
1748
+ }] });
1749
+
1750
+ /*
1751
+ * Public API Surface of date-picker
1752
+ */
1753
+
1754
+ /**
1755
+ * Generated bundle index. Do not edit.
1756
+ */
1757
+
1758
+ export { CalendarComponent, CalendarControlComponent, CalendarDateDirective, CalendarMonth, DateControlValueAccessorComponent, DateInputComponent, DatepickerComponent, IsDisabledPipe, MatchesPipe, NggvDatepickerModule, afterClosingHours, firstCalendarDate, generateDateMatrix, getDayOffset, getFormatDateMask, getLocaleDateMask, getLocaleDateString, getMonthArray, getSortedWeekDays, getYearArray, isAfter, isBefore, isValid, match, setDateFormatCharacters, sortWeekDays };
1759
+ //# sourceMappingURL=sebgroup-green-angular-src-v-angular-datepicker.mjs.map