@ids-group-ltd/ids-design-system 0.11.4 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/CHANGELOG.md +373 -53
  2. package/components/README.md +86 -0
  3. package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs +85 -0
  4. package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs.map +1 -0
  5. package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs +70 -0
  6. package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs.map +1 -0
  7. package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs +573 -0
  8. package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs.map +1 -0
  9. package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs +86 -0
  10. package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs.map +1 -0
  11. package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs +615 -0
  12. package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs.map +1 -0
  13. package/fesm2022/ids-group-ltd-ids-design-system-components-avatar-group.mjs +30 -0
  14. package/fesm2022/ids-group-ltd-ids-design-system-components-avatar-group.mjs.map +1 -0
  15. package/fesm2022/ids-group-ltd-ids-design-system-components-avatar.mjs +188 -0
  16. package/fesm2022/ids-group-ltd-ids-design-system-components-avatar.mjs.map +1 -0
  17. package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs +59 -0
  18. package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs.map +1 -0
  19. package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs +92 -0
  20. package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs.map +1 -0
  21. package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs +204 -0
  22. package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs.map +1 -0
  23. package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs +100 -0
  24. package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs.map +1 -0
  25. package/fesm2022/ids-group-ltd-ids-design-system-components-button-group.mjs +23 -0
  26. package/fesm2022/ids-group-ltd-ids-design-system-components-button-group.mjs.map +1 -0
  27. package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +180 -0
  28. package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -0
  29. package/fesm2022/ids-group-ltd-ids-design-system-components-calendar-day.mjs +78 -0
  30. package/fesm2022/ids-group-ltd-ids-design-system-components-calendar-day.mjs.map +1 -0
  31. package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs +49 -0
  32. package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs.map +1 -0
  33. package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs +73 -0
  34. package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs.map +1 -0
  35. package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +397 -0
  36. package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs.map +1 -0
  37. package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +1231 -0
  38. package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -0
  39. package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs +51 -0
  40. package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs.map +1 -0
  41. package/fesm2022/ids-group-ltd-ids-design-system-components-divider.mjs +35 -0
  42. package/fesm2022/ids-group-ltd-ids-design-system-components-divider.mjs.map +1 -0
  43. package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs +109 -0
  44. package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs.map +1 -0
  45. package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs +111 -0
  46. package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs.map +1 -0
  47. package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs +52 -0
  48. package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs.map +1 -0
  49. package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs +92 -0
  50. package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs.map +1 -0
  51. package/fesm2022/ids-group-ltd-ids-design-system-components-field-message.mjs +62 -0
  52. package/fesm2022/ids-group-ltd-ids-design-system-components-field-message.mjs.map +1 -0
  53. package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs +164 -0
  54. package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs.map +1 -0
  55. package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs +85 -0
  56. package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs.map +1 -0
  57. package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs +223 -0
  58. package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs.map +1 -0
  59. package/fesm2022/ids-group-ltd-ids-design-system-components-layout.mjs +63 -0
  60. package/fesm2022/ids-group-ltd-ids-design-system-components-layout.mjs.map +1 -0
  61. package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs +53 -0
  62. package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs.map +1 -0
  63. package/fesm2022/ids-group-ltd-ids-design-system-components-loading-overlay.mjs +43 -0
  64. package/fesm2022/ids-group-ltd-ids-design-system-components-loading-overlay.mjs.map +1 -0
  65. package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs +293 -0
  66. package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs.map +1 -0
  67. package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +329 -0
  68. package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -0
  69. package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs +612 -0
  70. package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs.map +1 -0
  71. package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs +69 -0
  72. package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs.map +1 -0
  73. package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs +191 -0
  74. package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs.map +1 -0
  75. package/fesm2022/ids-group-ltd-ids-design-system-components-page-footer.mjs +23 -0
  76. package/fesm2022/ids-group-ltd-ids-design-system-components-page-footer.mjs.map +1 -0
  77. package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs +43 -0
  78. package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs.map +1 -0
  79. package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs +85 -0
  80. package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs.map +1 -0
  81. package/fesm2022/ids-group-ltd-ids-design-system-components-password-rules.mjs +95 -0
  82. package/fesm2022/ids-group-ltd-ids-design-system-components-password-rules.mjs.map +1 -0
  83. package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs +240 -0
  84. package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs.map +1 -0
  85. package/fesm2022/ids-group-ltd-ids-design-system-components-progress.mjs +41 -0
  86. package/fesm2022/ids-group-ltd-ids-design-system-components-progress.mjs.map +1 -0
  87. package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs +248 -0
  88. package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs.map +1 -0
  89. package/fesm2022/ids-group-ltd-ids-design-system-components-reserve-messages.mjs +62 -0
  90. package/fesm2022/ids-group-ltd-ids-design-system-components-reserve-messages.mjs.map +1 -0
  91. package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs +173 -0
  92. package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs.map +1 -0
  93. package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs +123 -0
  94. package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs.map +1 -0
  95. package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs +461 -0
  96. package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs.map +1 -0
  97. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs +107 -0
  98. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs.map +1 -0
  99. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs +185 -0
  100. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs.map +1 -0
  101. package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs +32 -0
  102. package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs.map +1 -0
  103. package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs +204 -0
  104. package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs.map +1 -0
  105. package/fesm2022/ids-group-ltd-ids-design-system-components-spinner.mjs +25 -0
  106. package/fesm2022/ids-group-ltd-ids-design-system-components-spinner.mjs.map +1 -0
  107. package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs +63 -0
  108. package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs.map +1 -0
  109. package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs +99 -0
  110. package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs.map +1 -0
  111. package/fesm2022/ids-group-ltd-ids-design-system-components-status-dot.mjs +26 -0
  112. package/fesm2022/ids-group-ltd-ids-design-system-components-status-dot.mjs.map +1 -0
  113. package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs +74 -0
  114. package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs.map +1 -0
  115. package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs +76 -0
  116. package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs.map +1 -0
  117. package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs +440 -0
  118. package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs.map +1 -0
  119. package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs +186 -0
  120. package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs.map +1 -0
  121. package/fesm2022/ids-group-ltd-ids-design-system-components-table-resize.mjs +227 -0
  122. package/fesm2022/ids-group-ltd-ids-design-system-components-table-resize.mjs.map +1 -0
  123. package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +1593 -0
  124. package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -0
  125. package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs +381 -0
  126. package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs.map +1 -0
  127. package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs +44 -0
  128. package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs.map +1 -0
  129. package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs +158 -0
  130. package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs.map +1 -0
  131. package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs +671 -0
  132. package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -0
  133. package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs +41 -0
  134. package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs.map +1 -0
  135. package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs +549 -0
  136. package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs.map +1 -0
  137. package/fesm2022/ids-group-ltd-ids-design-system-components-toggle-button.mjs +34 -0
  138. package/fesm2022/ids-group-ltd-ids-design-system-components-toggle-button.mjs.map +1 -0
  139. package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs +218 -0
  140. package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs.map +1 -0
  141. package/fesm2022/ids-group-ltd-ids-design-system-components-topbar.mjs +18 -0
  142. package/fesm2022/ids-group-ltd-ids-design-system-components-topbar.mjs.map +1 -0
  143. package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs +153 -0
  144. package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs.map +1 -0
  145. package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs +48 -0
  146. package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs.map +1 -0
  147. package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +1338 -0
  148. package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -0
  149. package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +333 -0
  150. package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -0
  151. package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs +65 -0
  152. package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs.map +1 -0
  153. package/fesm2022/ids-group-ltd-ids-design-system-overlay.mjs +56 -0
  154. package/fesm2022/ids-group-ltd-ids-design-system-overlay.mjs.map +1 -0
  155. package/fesm2022/ids-group-ltd-ids-design-system-theme.mjs +37 -0
  156. package/fesm2022/ids-group-ltd-ids-design-system-theme.mjs.map +1 -0
  157. package/fesm2022/ids-group-ltd-ids-design-system.mjs +75 -14267
  158. package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
  159. package/migrations/0.10.0.json +1 -1
  160. package/migrations/0.10.1.json +1 -1
  161. package/migrations/0.10.2.json +1 -30
  162. package/migrations/0.11.0.json +0 -2
  163. package/migrations/0.11.1.json +2 -24
  164. package/migrations/0.11.2.json +2 -1
  165. package/migrations/0.11.3.json +3 -2
  166. package/migrations/0.11.4.json +32 -6
  167. package/migrations/0.12.0.json +22 -0
  168. package/migrations/0.12.1.json +215 -0
  169. package/migrations/0.4.0.json +2 -1
  170. package/migrations/0.5.0.json +0 -54
  171. package/migrations/0.5.1.json +3 -1
  172. package/migrations/0.7.0.json +0 -11
  173. package/migrations/0.7.1.json +2 -1
  174. package/migrations/0.9.0.json +22 -3
  175. package/migrations/0.9.1.json +1 -1
  176. package/package.json +597 -1
  177. package/styles/_check-box.scss +84 -0
  178. package/styles/_check-mark.scss +59 -0
  179. package/styles/_dropdown-overlay.scss +12 -2
  180. package/styles/_field-group-segment.scss +4 -1
  181. package/styles/_focus.scss +103 -50
  182. package/styles/_link.scss +4 -2
  183. package/styles/_tokens.scss +20 -0
  184. package/styles/_typography.scss +6 -0
  185. package/themes/README.md +4 -4
  186. package/themes/_semantic.scss +7 -8
  187. package/types/ids-group-ltd-ids-design-system-components-accordion.d.ts +48 -0
  188. package/types/ids-group-ltd-ids-design-system-components-alert.d.ts +32 -0
  189. package/types/ids-group-ltd-ids-design-system-components-app-layout.d.ts +260 -0
  190. package/types/ids-group-ltd-ids-design-system-components-auth-layout.d.ts +75 -0
  191. package/types/ids-group-ltd-ids-design-system-components-autocomplete.d.ts +226 -0
  192. package/types/ids-group-ltd-ids-design-system-components-avatar-group.d.ts +13 -0
  193. package/types/ids-group-ltd-ids-design-system-components-avatar.d.ts +99 -0
  194. package/types/ids-group-ltd-ids-design-system-components-badge.d.ts +25 -0
  195. package/types/ids-group-ltd-ids-design-system-components-banner.d.ts +41 -0
  196. package/types/ids-group-ltd-ids-design-system-components-bottom-sheet.d.ts +61 -0
  197. package/types/ids-group-ltd-ids-design-system-components-breadcrumbs.d.ts +66 -0
  198. package/types/ids-group-ltd-ids-design-system-components-button-group.d.ts +10 -0
  199. package/types/ids-group-ltd-ids-design-system-components-button.d.ts +90 -0
  200. package/types/ids-group-ltd-ids-design-system-components-calendar-day.d.ts +41 -0
  201. package/types/ids-group-ltd-ids-design-system-components-card.d.ts +24 -0
  202. package/types/ids-group-ltd-ids-design-system-components-checkbox.d.ts +41 -0
  203. package/types/ids-group-ltd-ids-design-system-components-color-picker.d.ts +79 -0
  204. package/types/ids-group-ltd-ids-design-system-components-date-picker.d.ts +251 -0
  205. package/types/ids-group-ltd-ids-design-system-components-description-list.d.ts +25 -0
  206. package/types/ids-group-ltd-ids-design-system-components-divider.d.ts +22 -0
  207. package/types/ids-group-ltd-ids-design-system-components-drawer.d.ts +38 -0
  208. package/types/ids-group-ltd-ids-design-system-components-dropzone.d.ts +45 -0
  209. package/types/ids-group-ltd-ids-design-system-components-empty-state.d.ts +22 -0
  210. package/types/ids-group-ltd-ids-design-system-components-field-group.d.ts +73 -0
  211. package/types/ids-group-ltd-ids-design-system-components-field-message.d.ts +36 -0
  212. package/types/ids-group-ltd-ids-design-system-components-filter-bar.d.ts +83 -0
  213. package/types/ids-group-ltd-ids-design-system-components-icon-button.d.ts +56 -0
  214. package/types/ids-group-ltd-ids-design-system-components-input.d.ts +121 -0
  215. package/types/ids-group-ltd-ids-design-system-components-layout.d.ts +39 -0
  216. package/types/ids-group-ltd-ids-design-system-components-list.d.ts +29 -0
  217. package/types/ids-group-ltd-ids-design-system-components-loading-overlay.d.ts +31 -0
  218. package/types/ids-group-ltd-ids-design-system-components-menu.d.ts +85 -0
  219. package/types/ids-group-ltd-ids-design-system-components-modal.d.ts +124 -0
  220. package/types/ids-group-ltd-ids-design-system-components-multi-select.d.ts +213 -0
  221. package/types/ids-group-ltd-ids-design-system-components-number-stepper.d.ts +31 -0
  222. package/types/ids-group-ltd-ids-design-system-components-otp-input.d.ts +52 -0
  223. package/types/ids-group-ltd-ids-design-system-components-page-footer.d.ts +13 -0
  224. package/types/ids-group-ltd-ids-design-system-components-page-header.d.ts +21 -0
  225. package/types/ids-group-ltd-ids-design-system-components-pagination.d.ts +32 -0
  226. package/types/ids-group-ltd-ids-design-system-components-password-rules.d.ts +80 -0
  227. package/types/ids-group-ltd-ids-design-system-components-popover.d.ts +48 -0
  228. package/types/ids-group-ltd-ids-design-system-components-progress.d.ts +22 -0
  229. package/types/ids-group-ltd-ids-design-system-components-radio-group.d.ts +110 -0
  230. package/types/ids-group-ltd-ids-design-system-components-reserve-messages.d.ts +33 -0
  231. package/types/ids-group-ltd-ids-design-system-components-search.d.ts +82 -0
  232. package/types/ids-group-ltd-ids-design-system-components-segmented.d.ts +40 -0
  233. package/types/ids-group-ltd-ids-design-system-components-select.d.ts +152 -0
  234. package/types/ids-group-ltd-ids-design-system-components-sidenav-footer.d.ts +92 -0
  235. package/types/ids-group-ltd-ids-design-system-components-sidenav.d.ts +131 -0
  236. package/types/ids-group-ltd-ids-design-system-components-skeleton.d.ts +16 -0
  237. package/types/ids-group-ltd-ids-design-system-components-slider.d.ts +51 -0
  238. package/types/ids-group-ltd-ids-design-system-components-spinner.d.ts +11 -0
  239. package/types/ids-group-ltd-ids-design-system-components-split-button.d.ts +39 -0
  240. package/types/ids-group-ltd-ids-design-system-components-stat.d.ts +44 -0
  241. package/types/ids-group-ltd-ids-design-system-components-status-dot.d.ts +12 -0
  242. package/types/ids-group-ltd-ids-design-system-components-stepper.d.ts +32 -0
  243. package/types/ids-group-ltd-ids-design-system-components-switch.d.ts +40 -0
  244. package/types/ids-group-ltd-ids-design-system-components-table-columns.d.ts +43 -0
  245. package/types/ids-group-ltd-ids-design-system-components-table-export.d.ts +48 -0
  246. package/types/ids-group-ltd-ids-design-system-components-table-resize.d.ts +79 -0
  247. package/types/ids-group-ltd-ids-design-system-components-table.d.ts +815 -0
  248. package/types/ids-group-ltd-ids-design-system-components-tabs.d.ts +118 -0
  249. package/types/ids-group-ltd-ids-design-system-components-tag.d.ts +26 -0
  250. package/types/ids-group-ltd-ids-design-system-components-textarea.d.ts +85 -0
  251. package/types/ids-group-ltd-ids-design-system-components-time-picker.d.ts +188 -0
  252. package/types/ids-group-ltd-ids-design-system-components-timeline.d.ts +24 -0
  253. package/types/ids-group-ltd-ids-design-system-components-toast.d.ts +167 -0
  254. package/types/ids-group-ltd-ids-design-system-components-toggle-button.d.ts +18 -0
  255. package/types/ids-group-ltd-ids-design-system-components-tooltip.d.ts +66 -0
  256. package/types/ids-group-ltd-ids-design-system-components-topbar.d.ts +8 -0
  257. package/types/ids-group-ltd-ids-design-system-components-tree.d.ts +46 -0
  258. package/types/ids-group-ltd-ids-design-system-components-w3w.d.ts +18 -0
  259. package/types/ids-group-ltd-ids-design-system-components.d.ts +604 -0
  260. package/types/ids-group-ltd-ids-design-system-core.d.ts +436 -0
  261. package/types/ids-group-ltd-ids-design-system-icons.d.ts +52 -0
  262. package/types/ids-group-ltd-ids-design-system-overlay.d.ts +32 -0
  263. package/types/ids-group-ltd-ids-design-system-theme.d.ts +29 -0
  264. package/types/ids-group-ltd-ids-design-system.d.ts +75 -5594
  265. package/LICENSE +0 -21
  266. package/README.md +0 -73
@@ -0,0 +1,1231 @@
1
+ import * as i0 from '@angular/core';
2
+ import { effect, inject, ViewContainerRef, Injector, ElementRef, input, booleanAttribute, model, computed, signal, afterNextRender, viewChild, forwardRef, ViewEncapsulation, Component } from '@angular/core';
3
+ import { NG_VALUE_ACCESSOR } from '@angular/forms';
4
+ import { Overlay } from '@angular/cdk/overlay';
5
+ import { TemplatePortal } from '@angular/cdk/portal';
6
+ import * as i1 from '@angular/cdk/a11y';
7
+ import { A11yModule } from '@angular/cdk/a11y';
8
+ import { DsControlValueAccessor, trimmedText, resolveFieldMessage, dropdownOverlay, prepareOverlayEnter, forwardOverlayTokens, closeOnOutsidePointer, closeOnScroll, focusIsInside, disposeWithLeave } from '@ids-group-ltd/ids-design-system/components';
9
+ import { IconComponent } from '@ids-group-ltd/ids-design-system/icons';
10
+ import { CalendarDayComponent } from '@ids-group-ltd/ids-design-system/components/calendar-day';
11
+ import { FieldMessageComponent } from '@ids-group-ltd/ids-design-system/components/field-message';
12
+ import { DS_CONFIG, resolveWithConfig } from '@ids-group-ltd/ids-design-system/core';
13
+ import { inFieldGroup } from '@ids-group-ltd/ids-design-system/components/field-group';
14
+
15
+ const SEGMENT_LENGTH = { D: 2, M: 2, Y: 4 };
16
+ const TOKEN = { D: 'DD', M: 'MM', Y: 'YYYY' };
17
+ // 2023-11-22: day, month and year are all distinct values.
18
+ const REFERENCE_DATE = new Date(2023, 10, 22);
19
+ function buildSpec(order, separator) {
20
+ return {
21
+ order,
22
+ separator,
23
+ mask: order.map((token) => TOKEN[token]).join(separator),
24
+ segments: order.map((token) => ({
25
+ type: token,
26
+ length: SEGMENT_LENGTH[token],
27
+ })),
28
+ };
29
+ }
30
+ function parseFormatTokens(format) {
31
+ const separatorMatch = format.match(/[^A-Za-z]/);
32
+ const separator = separatorMatch ? separatorMatch[0] : '/';
33
+ const order = [];
34
+ for (const character of format.toUpperCase()) {
35
+ if ((character === 'D' || character === 'M' || character === 'Y') &&
36
+ order[order.length - 1] !== character) {
37
+ order.push(character);
38
+ }
39
+ }
40
+ return buildSpec(order.length === 3 ? order : ['M', 'D', 'Y'], separator);
41
+ }
42
+ function resolveDateFormat(locale, explicit) {
43
+ if (explicit) {
44
+ return parseFormatTokens(explicit);
45
+ }
46
+ const parts = new Intl.DateTimeFormat(locale, {
47
+ day: '2-digit',
48
+ month: '2-digit',
49
+ year: 'numeric',
50
+ }).formatToParts(REFERENCE_DATE);
51
+ const order = [];
52
+ let separator = '/';
53
+ let sawSeparator = false;
54
+ for (const part of parts) {
55
+ if (part.type === 'day') {
56
+ order.push('D');
57
+ }
58
+ else if (part.type === 'month') {
59
+ order.push('M');
60
+ }
61
+ else if (part.type === 'year') {
62
+ order.push('Y');
63
+ }
64
+ else if (part.type === 'literal' && !sawSeparator && part.value.trim()) {
65
+ separator = part.value.trim().slice(0, 1);
66
+ sawSeparator = true;
67
+ }
68
+ }
69
+ if (order.length !== 3) {
70
+ return parseFormatTokens('MM/DD/YYYY');
71
+ }
72
+ return buildSpec(order, separator);
73
+ }
74
+ function formatDate(date, spec) {
75
+ if (!date) {
76
+ return '';
77
+ }
78
+ const values = {
79
+ D: String(date.getDate()).padStart(2, '0'),
80
+ M: String(date.getMonth() + 1).padStart(2, '0'),
81
+ Y: String(date.getFullYear()).padStart(4, '0'),
82
+ };
83
+ return spec.order.map((token) => values[token]).join(spec.separator);
84
+ }
85
+ /** Build a date from three per-slot digit strings; null if any slot isn't full-width or invalid. */
86
+ function parseSegments(segments, spec) {
87
+ const values = { D: 1, M: 1, Y: 2000 };
88
+ for (let index = 0; index < spec.segments.length; index++) {
89
+ const segment = spec.segments[index];
90
+ const digits = segments[index] ?? '';
91
+ if (digits.length !== segment.length) {
92
+ return null;
93
+ }
94
+ values[segment.type] = parseInt(digits, 10);
95
+ }
96
+ const { D: day, M: month, Y: year } = values;
97
+ if (month < 1 || month > 12 || day < 1 || day > 31) {
98
+ return null;
99
+ }
100
+ const date = new Date(year, month - 1, day);
101
+ if (date.getFullYear() !== year ||
102
+ date.getMonth() !== month - 1 ||
103
+ date.getDate() !== day) {
104
+ return null;
105
+ }
106
+ return date;
107
+ }
108
+ function parseDate(text, spec) {
109
+ return parseSegments(parseFieldText(text, singleFieldLayout(spec)), spec);
110
+ }
111
+ /** Separator between the two dates of a range, in the field and its placeholder. */
112
+ const RANGE_SEPARATOR = ' – ';
113
+ /** Combined placeholder/mask for a range field, e.g. "MM/DD/YYYY – MM/DD/YYYY". */
114
+ function rangeMask(spec) {
115
+ return `${spec.mask}${RANGE_SEPARATOR}${spec.mask}`;
116
+ }
117
+ /** Render a range value to the combined field string. */
118
+ function formatRange(range, spec) {
119
+ const [start, end] = range ?? [null, null];
120
+ if (!start && !end) {
121
+ return '';
122
+ }
123
+ const startText = formatDate(start, spec);
124
+ if (start && end) {
125
+ return `${startText}${RANGE_SEPARATOR}${formatDate(end, spec)}`;
126
+ }
127
+ return start ? `${startText}${RANGE_SEPARATOR}` : '';
128
+ }
129
+ /** Parse a combined range field string into [start, end] (either may be null). */
130
+ function parseDateRange(text, spec) {
131
+ const slots = parseFieldText(text, rangeFieldLayout(spec));
132
+ const perDate = spec.segments.length;
133
+ return [
134
+ parseSegments(slots.slice(0, perDate), spec),
135
+ parseSegments(slots.slice(perDate, perDate * 2), spec),
136
+ ];
137
+ }
138
+ function singleFieldLayout(spec) {
139
+ return {
140
+ slots: spec.segments.map((segment) => ({
141
+ type: segment.type,
142
+ maxLength: segment.length,
143
+ })),
144
+ literals: spec.segments.slice(1).map(() => spec.separator),
145
+ };
146
+ }
147
+ function rangeFieldLayout(spec) {
148
+ const single = singleFieldLayout(spec);
149
+ return {
150
+ slots: [...single.slots, ...single.slots],
151
+ literals: [...single.literals, RANGE_SEPARATOR, ...single.literals],
152
+ };
153
+ }
154
+ /** Split a fixed-width renderFieldValue output into per-slot digits, read at
155
+ * each slot's fixed position — every slot is maxLength wide and every literal
156
+ * always present, so a `_` pad or any stray char is simply dropped. */
157
+ function parseFieldText(text, layout) {
158
+ const segments = [];
159
+ let position = 0;
160
+ for (let index = 0; index < layout.slots.length; index++) {
161
+ const raw = text.slice(position, position + layout.slots[index].maxLength);
162
+ segments.push(raw.replace(/\D/g, ''));
163
+ position += layout.slots[index].maxLength;
164
+ if (index < layout.slots.length - 1) {
165
+ position += layout.literals[index].length;
166
+ }
167
+ }
168
+ return segments;
169
+ }
170
+ const PLACEHOLDER_CHAR = '_';
171
+ function slotPlaceholder(slot) {
172
+ return slot.type === 'Y' ? 'YYYY' : slot.type === 'M' ? 'MM' : 'DD';
173
+ }
174
+ /** Fixed-width input value: every slot padded to maxLength with `_`, all literals present. */
175
+ function renderFieldValue(segments, layout) {
176
+ let out = '';
177
+ for (let index = 0; index < layout.slots.length; index++) {
178
+ const slot = layout.slots[index];
179
+ out += segments[index].padEnd(slot.maxLength, PLACEHOLDER_CHAR);
180
+ if (index < layout.slots.length - 1) {
181
+ out += layout.literals[index];
182
+ }
183
+ }
184
+ return out;
185
+ }
186
+ /** Ordered runs for the overlay: digits (not muted), placeholders (muted), literals (not muted).
187
+ * Untouched slot → its format letters; partial slot → digits + `_` for the missing positions. */
188
+ function displayParts(segments, layout) {
189
+ const parts = [];
190
+ for (let index = 0; index < layout.slots.length; index++) {
191
+ const slot = layout.slots[index];
192
+ const digits = segments[index];
193
+ if (digits.length === 0) {
194
+ parts.push({ text: slotPlaceholder(slot), muted: true });
195
+ }
196
+ else {
197
+ parts.push({ text: digits, muted: false });
198
+ if (digits.length < slot.maxLength) {
199
+ parts.push({
200
+ text: PLACEHOLDER_CHAR.repeat(slot.maxLength - digits.length),
201
+ muted: true,
202
+ });
203
+ }
204
+ }
205
+ if (index < layout.slots.length - 1) {
206
+ parts.push({ text: layout.literals[index], muted: false });
207
+ }
208
+ }
209
+ return parts;
210
+ }
211
+ /** Char offset where slot `index` begins in the fixed-width value — every
212
+ * slot is maxLength wide and every literal always present. */
213
+ function slotStart(layout, index) {
214
+ let position = 0;
215
+ for (let slot = 0; slot < index; slot++) {
216
+ position += layout.slots[slot].maxLength + layout.literals[slot].length;
217
+ }
218
+ return position;
219
+ }
220
+ function slotToCaret(layout, slot, offset) {
221
+ return slotStart(layout, slot) + offset;
222
+ }
223
+ /** Map a caret char offset to its slot; a caret inside a literal snaps forward. */
224
+ function caretToSlot(layout, caret) {
225
+ let position = 0;
226
+ for (let index = 0; index < layout.slots.length; index++) {
227
+ const width = layout.slots[index].maxLength;
228
+ if (caret <= position + width) {
229
+ return { slot: index, offset: Math.max(0, caret - position) };
230
+ }
231
+ position += width;
232
+ const literalLength = index < layout.literals.length ? layout.literals[index].length : 0;
233
+ if (caret < position + literalLength) {
234
+ return { slot: index + 1, offset: 0 };
235
+ }
236
+ position += literalLength;
237
+ }
238
+ const last = layout.slots.length - 1;
239
+ return { slot: last, offset: layout.slots[last].maxLength };
240
+ }
241
+ /** After typing, hop to the next slot once the current one is full. */
242
+ function advanceAfterType(segments, layout, slot, offset) {
243
+ if (offset >= layout.slots[slot].maxLength &&
244
+ slot < layout.slots.length - 1) {
245
+ return { segments, slot: slot + 1, offset: 0 };
246
+ }
247
+ return { segments, slot, offset };
248
+ }
249
+ /** Type a digit into the caret's slot: overtype under the caret, else append;
250
+ * a full slot spills the digit into the next one instead of shifting. */
251
+ function editType(segments, layout, slot, offset, digit) {
252
+ const next = segments.slice();
253
+ const maxLength = layout.slots[slot].maxLength;
254
+ const current = next[slot];
255
+ if (offset < current.length) {
256
+ next[slot] = current.slice(0, offset) + digit + current.slice(offset + 1);
257
+ return advanceAfterType(next, layout, slot, offset + 1);
258
+ }
259
+ if (current.length < maxLength) {
260
+ next[slot] = current + digit;
261
+ return advanceAfterType(next, layout, slot, current.length + 1);
262
+ }
263
+ if (slot < layout.slots.length - 1) {
264
+ return editType(next, layout, slot + 1, 0, digit);
265
+ }
266
+ return { segments: next, slot, offset };
267
+ }
268
+ /** Backspace: drop the digit left of the caret within its slot, else the last
269
+ * digit of the nearest earlier non-empty slot. Null when nothing precedes it. */
270
+ function editBackspace(segments, layout, slot, offset) {
271
+ const next = segments.slice();
272
+ if (offset > 0) {
273
+ next[slot] = next[slot].slice(0, offset - 1) + next[slot].slice(offset);
274
+ return { segments: next, slot, offset: offset - 1 };
275
+ }
276
+ for (let index = slot - 1; index >= 0; index--) {
277
+ if (next[index].length > 0) {
278
+ next[index] = next[index].slice(0, -1);
279
+ return { segments: next, slot: index, offset: next[index].length };
280
+ }
281
+ }
282
+ return null;
283
+ }
284
+ /** Delete: drop the digit at the caret within its slot, else the first digit of
285
+ * the nearest later non-empty slot. Null when nothing follows it. */
286
+ function editDelete(segments, layout, slot, offset) {
287
+ const next = segments.slice();
288
+ if (offset < next[slot].length) {
289
+ next[slot] = next[slot].slice(0, offset) + next[slot].slice(offset + 1);
290
+ return { segments: next, slot, offset };
291
+ }
292
+ for (let index = slot + 1; index < next.length; index++) {
293
+ if (next[index].length > 0) {
294
+ next[index] = next[index].slice(1);
295
+ return { segments: next, slot, offset };
296
+ }
297
+ }
298
+ return null;
299
+ }
300
+ function weekdayLabels(locale, firstDayOfWeek, style = 'short') {
301
+ const formatter = new Intl.DateTimeFormat(locale, { weekday: style });
302
+ // 2023-01-01 is a Sunday (getDay() === 0).
303
+ const sunday = new Date(2023, 0, 1);
304
+ const labels = [];
305
+ for (let offset = 0; offset < 7; offset++) {
306
+ const dayIndex = (firstDayOfWeek + offset) % 7;
307
+ const day = new Date(sunday);
308
+ day.setDate(sunday.getDate() + dayIndex);
309
+ labels.push(formatter.format(day));
310
+ }
311
+ return labels;
312
+ }
313
+ function monthLabels(locale) {
314
+ const formatter = new Intl.DateTimeFormat(locale, { month: 'long' });
315
+ return Array.from({ length: 12 }, (_unused, month) => formatter.format(new Date(2023, month, 1)));
316
+ }
317
+ function fullDateLabel(date, locale) {
318
+ return date.toLocaleDateString(locale, {
319
+ weekday: 'long',
320
+ day: 'numeric',
321
+ month: 'long',
322
+ year: 'numeric',
323
+ });
324
+ }
325
+
326
+ let nextId = 0;
327
+ const YEAR_PAGE_SIZE = 12;
328
+ class DatePickerComponent extends DsControlValueAccessor {
329
+ /** Segment of a ds-field-group: the group owns the border, radius and focus
330
+ * ring, so .in-group strips this control back to its bare contents. */
331
+ inGroup = inFieldGroup();
332
+ constructor() {
333
+ super();
334
+ effect(() => {
335
+ const spec = this.formatSpec();
336
+ const value = this.value();
337
+ const layout = this.layout();
338
+ if (this.editing) {
339
+ return;
340
+ }
341
+ // Every typing path holds `editing` while it runs, so reaching here means the
342
+ // value did NOT come from the keyboard and a leftover typing error no longer
343
+ // describes what the field is about to show.
344
+ this.typedInvalid.set(false);
345
+ this.rangeInvalid.set(false);
346
+ if (this.mode() === 'single') {
347
+ const date = value;
348
+ this.inputText.set(date ? formatDate(date, spec) : '');
349
+ return;
350
+ }
351
+ const single = singleFieldLayout(spec);
352
+ const [start, end] = value ?? [null, null];
353
+ const startSegments = start
354
+ ? parseFieldText(formatDate(start, spec), single)
355
+ : single.slots.map(() => '');
356
+ const endSegments = end
357
+ ? parseFieldText(formatDate(end, spec), single)
358
+ : single.slots.map(() => '');
359
+ this.rangeText.set(this.toFieldText([...startSegments, ...endSegments], layout));
360
+ });
361
+ }
362
+ /** Field text for the DOM: fixed-width `_`-padded once any digit exists,
363
+ * else '' (so an untouched field is genuinely empty — no error on blur,
364
+ * nothing for AT to read out). */
365
+ toFieldText(segments, layout) {
366
+ return segments.some((segment) => segment.length > 0)
367
+ ? renderFieldValue(segments, layout)
368
+ : '';
369
+ }
370
+ overlay = inject(Overlay);
371
+ vcr = inject(ViewContainerRef);
372
+ injector = inject(Injector);
373
+ config = inject(DS_CONFIG);
374
+ host = inject((ElementRef));
375
+ /** Public panel tokens forwarded onto the portaled overlay pane on open so
376
+ * a consumer's `ds-date-picker { --ds-date-picker-panel-*: … }` reaches it. */
377
+ panelTokens = [
378
+ '--ds-date-picker-bg-color',
379
+ '--ds-date-picker-border',
380
+ '--ds-date-picker-shadow',
381
+ '--ds-date-picker-focus-shadow',
382
+ '--ds-date-picker-day-hover-bg-color',
383
+ '--ds-date-picker-day-today-label-color',
384
+ '--ds-date-picker-day-selected-bg-color',
385
+ '--ds-date-picker-day-selected-bg-color-hover',
386
+ '--ds-date-picker-day-selected-label-color',
387
+ '--ds-date-picker-day-range-bg-color',
388
+ '--ds-date-picker-day-range-label-color',
389
+ '--ds-date-picker-day-disabled-label-color',
390
+ '--ds-date-picker-day-label-color',
391
+ '--ds-date-picker-day-muted-label-color',
392
+ '--ds-date-picker-weekday-color',
393
+ '--ds-date-picker-header-label-color',
394
+ '--ds-date-picker-nav-icon-color',
395
+ '--ds-date-picker-width',
396
+ '--ds-date-picker-panel-radius',
397
+ ];
398
+ /** Selection mode — single date or start/end range. */
399
+ mode = input('single', ...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
400
+ /** Trigger height — sm/md/lg.
401
+ * Unset falls back to `DS_CONFIG.control.size`, then `'md'`. */
402
+ size = input(null, ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
403
+ sizeResolved = resolveWithConfig(this.size, (config) => config.control?.size, 'md');
404
+ /** Stretch the trigger to fill its container instead of hugging the mask
405
+ * width — opt in when the field shares a grid/flex track with inputs. */
406
+ fullWidth = input(false, { ...(ngDevMode ? { debugName: "fullWidth" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
407
+ /** Selected date (single) or `[start, end]` (range), two-way bound. */
408
+ value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
409
+ /** Accessible-name fallback only — the mask fills the visible placeholder, not this. */
410
+ placeholder = input('Select date', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
411
+ /** Field label shown above the trigger. */
412
+ label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
413
+ /** Marks the field required — shows an asterisk and sets `aria-required`. */
414
+ required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
415
+ /** Shows an "(optional)" marker beside the label — ignored when `required` is set. */
416
+ optional = input(false, { ...(ngDevMode ? { debugName: "optional" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
417
+ /** Disables the picker and blocks all interaction. */
418
+ disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
419
+ /** Confirmation text, shown when there is no error or warning — and it paints
420
+ * the field's success border. A string like `warning`: the text IS the state. */
421
+ success = input('', { ...(ngDevMode ? { debugName: "success" } : /* istanbul ignore next */ {}), transform: trimmedText });
422
+ /** Accessible name when no visible `label` is provided. */
423
+ ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
424
+ /** Lower bound for the year dropdown in the calendar header. */
425
+ minYear = input(new Date().getFullYear() - 100, ...(ngDevMode ? [{ debugName: "minYear" }] : /* istanbul ignore next */ []));
426
+ /** Upper bound for the year dropdown in the calendar header. */
427
+ maxYear = input(new Date().getFullYear() + 10, ...(ngDevMode ? [{ debugName: "maxYear" }] : /* istanbul ignore next */ []));
428
+ /** Earliest selectable date (inclusive). Days before this are disabled. */
429
+ minDate = input(null, ...(ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []));
430
+ /** Latest selectable date (inclusive). Days after this are disabled. */
431
+ maxDate = input(null, ...(ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []));
432
+ /** Predicate — return true to disable an individual day. */
433
+ disabledDate = input(null, ...(ngDevMode ? [{ debugName: "disabledDate" }] : /* istanbul ignore next */ []));
434
+ /** Quick-pick shortcuts shown as a button column inside the calendar panel. */
435
+ presets = input([], ...(ngDevMode ? [{ debugName: "presets" }] : /* istanbul ignore next */ []));
436
+ /** BCP-47 locale driving month/weekday names and the value format. */
437
+ locale = input(null, ...(ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []));
438
+ /** Explicit token format e.g. `'MM/DD/YYYY'`; default derived from `locale`. */
439
+ dateFormat = input(null, ...(ngDevMode ? [{ debugName: "dateFormat" }] : /* istanbul ignore next */ []));
440
+ /** First weekday column: 0=Sunday … 6=Saturday. Default 1 (Monday). */
441
+ firstDayOfWeek = input(null, ...(ngDevMode ? [{ debugName: "firstDayOfWeek" }] : /* istanbul ignore next */ []));
442
+ /** Date the calendar opens on when the value is empty (e.g. a Date Of Birth):
443
+ * the panel shows its month and grid focus lands on its exact day.
444
+ * Never written to `value` — selection stays with the user. */
445
+ defaultDate = input(null, ...(ngDevMode ? [{ debugName: "defaultDate" }] : /* istanbul ignore next */ []));
446
+ /** Allow masked manual typing. When false the field is read-only and a date can
447
+ * only be picked from the calendar. */
448
+ allowInput = input(true, { ...(ngDevMode ? { debugName: "allowInput" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
449
+ isDisabled = computed(() => this.disabled() || this.formDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
450
+ hintId = computed(() => this.message().text ? `${this.uid}-hint` : null, ...(ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []));
451
+ // An unparseable date is the picker's OWN error, so it enters the ladder at the
452
+ // error rung rather than replacing the hint. An explicit `error` still wins:
453
+ // the consumer knows something this component cannot.
454
+ localError = computed(() => {
455
+ const explicit = this.error().trim();
456
+ if (explicit) {
457
+ return explicit;
458
+ }
459
+ if (this.typedInvalid() || this.rangeInvalid()) {
460
+ const mask = this.mode() === 'single'
461
+ ? this.formatSpec().mask
462
+ : rangeMask(this.formatSpec());
463
+ return `Enter a valid date (${mask})`;
464
+ }
465
+ return '';
466
+ }, ...(ngDevMode ? [{ debugName: "localError" }] : /* istanbul ignore next */ []));
467
+ dateInvalid = computed(() => this.invalid() || this.typedInvalid() || this.rangeInvalid(), ...(ngDevMode ? [{ debugName: "dateInvalid" }] : /* istanbul ignore next */ []));
468
+ fieldMessage = resolveFieldMessage({
469
+ hint: this.hint,
470
+ warning: this.warning,
471
+ error: this.localError,
472
+ errors: this.errors,
473
+ invalid: this.dateInvalid,
474
+ success: this.success,
475
+ touchedSelf: this.touchedSelf,
476
+ touched: this.touched,
477
+ });
478
+ message = this.fieldMessage.message;
479
+ controlState = this.fieldMessage.controlState;
480
+ invalidResolved = this.fieldMessage.invalid;
481
+ resolvedLocale = computed(() => this.locale() ?? this.config.datePicker?.locale ?? 'en-US', ...(ngDevMode ? [{ debugName: "resolvedLocale" }] : /* istanbul ignore next */ []));
482
+ resolvedFirstDay = computed(() => this.firstDayOfWeek() ?? this.config.datePicker?.firstDayOfWeek ?? 1, ...(ngDevMode ? [{ debugName: "resolvedFirstDay" }] : /* istanbul ignore next */ []));
483
+ formatSpec = computed(() => resolveDateFormat(this.resolvedLocale(), this.dateFormat() ?? this.config.datePicker?.dateFormat), ...(ngDevMode ? [{ debugName: "formatSpec" }] : /* istanbul ignore next */ []));
484
+ layout = computed(() => this.mode() === 'range'
485
+ ? rangeFieldLayout(this.formatSpec())
486
+ : singleFieldLayout(this.formatSpec()), ...(ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []));
487
+ monthNames = computed(() => monthLabels(this.resolvedLocale()), ...(ngDevMode ? [{ debugName: "monthNames" }] : /* istanbul ignore next */ []));
488
+ weekdays = computed(() => weekdayLabels(this.resolvedLocale(), this.resolvedFirstDay()), ...(ngDevMode ? [{ debugName: "weekdays" }] : /* istanbul ignore next */ []));
489
+ weekdaysFull = computed(() => weekdayLabels(this.resolvedLocale(), this.resolvedFirstDay(), 'long'), ...(ngDevMode ? [{ debugName: "weekdaysFull" }] : /* istanbul ignore next */ []));
490
+ monthYearLabel = computed(() => `${this.monthNames()[this.viewMonthIndex()]} ${this.viewYear()}`, ...(ngDevMode ? [{ debugName: "monthYearLabel" }] : /* istanbul ignore next */ []));
491
+ uid = `ds-datepicker-${++nextId}`;
492
+ labelId = `${this.uid}-label`;
493
+ panelId = `${this.uid}-panel`;
494
+ captionId = `${this.uid}-caption`;
495
+ isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
496
+ /** The day that holds keyboard focus in the open grid (roving tabindex). */
497
+ gridFocus = signal(null, ...(ngDevMode ? [{ debugName: "gridFocus" }] : /* istanbul ignore next */ []));
498
+ inputText = signal('', ...(ngDevMode ? [{ debugName: "inputText" }] : /* istanbul ignore next */ []));
499
+ rangeText = signal('', ...(ngDevMode ? [{ debugName: "rangeText" }] : /* istanbul ignore next */ []));
500
+ typedInvalid = signal(false, ...(ngDevMode ? [{ debugName: "typedInvalid" }] : /* istanbul ignore next */ []));
501
+ rangeInvalid = signal(false, ...(ngDevMode ? [{ debugName: "rangeInvalid" }] : /* istanbul ignore next */ []));
502
+ // Guards the value→text sync from clobbering the field mid-keystroke.
503
+ editing = false;
504
+ resolvedAriaLabel = computed(() => this.label() ? null : this.ariaLabel() || this.placeholder() || null, ...(ngDevMode ? [{ debugName: "resolvedAriaLabel" }] : /* istanbul ignore next */ []));
505
+ dayKey(d) {
506
+ return `${d.getFullYear()}-${d.getMonth()}-${d.getDate()}`;
507
+ }
508
+ isFocusDay(cell) {
509
+ const f = this.gridFocus();
510
+ return !!f && this.dayKey(f) === this.dayKey(cell.date);
511
+ }
512
+ /** Arrow-key roving navigation across the calendar grid (APG date grid). */
513
+ onGridKeydown(event, cell) {
514
+ if (this.isDisabled()) {
515
+ return;
516
+ }
517
+ const f = this.gridFocus() ?? cell.date;
518
+ let next = null;
519
+ switch (event.key) {
520
+ case 'ArrowLeft':
521
+ next = this.addDays(f, -1);
522
+ break;
523
+ case 'ArrowRight':
524
+ next = this.addDays(f, 1);
525
+ break;
526
+ case 'ArrowUp':
527
+ next = this.addDays(f, -7);
528
+ break;
529
+ case 'ArrowDown':
530
+ next = this.addDays(f, 7);
531
+ break;
532
+ case 'Home':
533
+ next = this.addDays(f, -((f.getDay() - this.resolvedFirstDay() + 7) % 7));
534
+ break;
535
+ case 'End':
536
+ next = this.addDays(f, 6 - ((f.getDay() - this.resolvedFirstDay() + 7) % 7));
537
+ break;
538
+ case 'PageUp':
539
+ next = this.addMonths(f, -1);
540
+ break;
541
+ case 'PageDown':
542
+ next = this.addMonths(f, 1);
543
+ break;
544
+ case 'Enter':
545
+ case ' ':
546
+ event.preventDefault();
547
+ this.selectDay(cell);
548
+ return;
549
+ default:
550
+ return;
551
+ }
552
+ event.preventDefault();
553
+ this.gridFocus.set(next);
554
+ this.viewMonth.set(new Date(next.getFullYear(), next.getMonth(), 1));
555
+ afterNextRender(() => this.focusGridDay(), { injector: this.injector });
556
+ }
557
+ addDays(date, days) {
558
+ const d = new Date(date);
559
+ d.setDate(d.getDate() + days);
560
+ return d;
561
+ }
562
+ addMonths(date, months) {
563
+ const d = new Date(date);
564
+ d.setMonth(d.getMonth() + months);
565
+ return d;
566
+ }
567
+ clampToBounds(date) {
568
+ const min = this.minDate();
569
+ const max = this.maxDate();
570
+ if (min && date < min) {
571
+ return new Date(min);
572
+ }
573
+ if (max && date > max) {
574
+ return new Date(max);
575
+ }
576
+ return date;
577
+ }
578
+ focusGridDay() {
579
+ const f = this.gridFocus();
580
+ if (!f || !this.overlayRef) {
581
+ return;
582
+ }
583
+ const element = this.overlayRef.overlayElement.querySelector(`[data-day="${this.dayKey(f)}"]`);
584
+ element?.focus();
585
+ }
586
+ dayLabel(cell) {
587
+ return fullDateLabel(cell.date, this.resolvedLocale());
588
+ }
589
+ triggerClasses = computed(() => {
590
+ const parts = ['trigger'];
591
+ const size = this.sizeResolved();
592
+ if (size !== 'md') {
593
+ parts.push(size);
594
+ }
595
+ if (this.isDisabled()) {
596
+ parts.push('disabled');
597
+ }
598
+ if (this.invalidResolved()) {
599
+ parts.push('error');
600
+ }
601
+ // The indicator cannot be left to :focus-within: opening from the calendar
602
+ // glyph moves focus into the day grid, so the trigger would go dark while
603
+ // its OWN panel is open. A control stays visibly active for as long as it
604
+ // owns an open panel, wherever focus went.
605
+ if (this.isOpen()) {
606
+ parts.push('open');
607
+ }
608
+ return parts.join(' ');
609
+ }, ...(ngDevMode ? [{ debugName: "triggerClasses" }] : /* istanbul ignore next */ []));
610
+ viewMonth = signal(new Date(), ...(ngDevMode ? [{ debugName: "viewMonth" }] : /* istanbul ignore next */ []));
611
+ anchor = viewChild.required('anchor');
612
+ inputEl = viewChild.required('inputEl');
613
+ panelTpl = viewChild.required('panel');
614
+ overlayRef = null;
615
+ focusTrigger() {
616
+ this.inputEl().nativeElement.focus();
617
+ }
618
+ fieldText = computed(() => this.mode() === 'single' ? this.inputText() : this.rangeText(), ...(ngDevMode ? [{ debugName: "fieldText" }] : /* istanbul ignore next */ []));
619
+ fieldPlaceholder = computed(() => this.mode() === 'single'
620
+ ? this.formatSpec().mask
621
+ : rangeMask(this.formatSpec()), ...(ngDevMode ? [{ debugName: "fieldPlaceholder" }] : /* istanbul ignore next */ []));
622
+ /** `size` attribute so the field hugs its mask width instead of stretching.
623
+ * +1 covers `size` under-counting the mask's wide glyphs (M/D/Y), which
624
+ * otherwise clip the last chars of the longer range mask. The field's
625
+ * `font-family: var(--font-mono)` keeps every glyph equal width, so the
626
+ * width never shifts as you type. */
627
+ fieldSize = computed(() => this.fieldPlaceholder().length + 1, ...(ngDevMode ? [{ debugName: "fieldSize" }] : /* istanbul ignore next */ []));
628
+ displaySlots = computed(() => displayParts(parseFieldText(this.fieldText(), this.layout()), this.layout()), ...(ngDevMode ? [{ debugName: "displaySlots" }] : /* istanbul ignore next */ []));
629
+ monthMenuOpen = signal(false, ...(ngDevMode ? [{ debugName: "monthMenuOpen" }] : /* istanbul ignore next */ []));
630
+ yearMenuOpen = signal(false, ...(ngDevMode ? [{ debugName: "yearMenuOpen" }] : /* istanbul ignore next */ []));
631
+ viewMonthIndex = computed(() => this.viewMonth().getMonth(), ...(ngDevMode ? [{ debugName: "viewMonthIndex" }] : /* istanbul ignore next */ []));
632
+ viewYear = computed(() => this.viewMonth().getFullYear(), ...(ngDevMode ? [{ debugName: "viewYear" }] : /* istanbul ignore next */ []));
633
+ yearPageStart = signal(0, ...(ngDevMode ? [{ debugName: "yearPageStart" }] : /* istanbul ignore next */ []));
634
+ yearsOnPage = computed(() => {
635
+ const start = this.yearPageStart();
636
+ const max = this.maxYear();
637
+ const list = [];
638
+ for (let year = start; year < start + YEAR_PAGE_SIZE && year <= max; year++) {
639
+ list.push(year);
640
+ }
641
+ return list;
642
+ }, ...(ngDevMode ? [{ debugName: "yearsOnPage" }] : /* istanbul ignore next */ []));
643
+ yearRangeLabel = computed(() => {
644
+ const page = this.yearsOnPage();
645
+ return page.length ? `${page[0]} – ${page[page.length - 1]}` : '';
646
+ }, ...(ngDevMode ? [{ debugName: "yearRangeLabel" }] : /* istanbul ignore next */ []));
647
+ canPrevYearPage = computed(() => this.yearPageStart() > this.minYear(), ...(ngDevMode ? [{ debugName: "canPrevYearPage" }] : /* istanbul ignore next */ []));
648
+ canNextYearPage = computed(() => this.yearPageStart() + YEAR_PAGE_SIZE <= this.maxYear(), ...(ngDevMode ? [{ debugName: "canNextYearPage" }] : /* istanbul ignore next */ []));
649
+ /** Aligns the page so `year` lands on a stable grid boundary measured from minYear. */
650
+ yearPageStartFor(year) {
651
+ const min = this.minYear();
652
+ return min + Math.floor((year - min) / YEAR_PAGE_SIZE) * YEAR_PAGE_SIZE;
653
+ }
654
+ toggleMonthMenu(event) {
655
+ event.stopPropagation();
656
+ this.yearMenuOpen.set(false);
657
+ this.monthMenuOpen.update((open) => !open);
658
+ }
659
+ toggleYearMenu(event) {
660
+ event.stopPropagation();
661
+ this.monthMenuOpen.set(false);
662
+ this.yearMenuOpen.update((open) => !open);
663
+ if (this.yearMenuOpen()) {
664
+ this.yearPageStart.set(this.yearPageStartFor(this.viewYear()));
665
+ }
666
+ }
667
+ prevYearPage(event) {
668
+ event.stopPropagation();
669
+ this.yearPageStart.update((start) => Math.max(this.minYear(), start - YEAR_PAGE_SIZE));
670
+ }
671
+ nextYearPage(event) {
672
+ event.stopPropagation();
673
+ this.yearPageStart.update((start) => start + YEAR_PAGE_SIZE);
674
+ }
675
+ closeMenus() {
676
+ this.monthMenuOpen.set(false);
677
+ this.yearMenuOpen.set(false);
678
+ }
679
+ selectMonth(index, event) {
680
+ event.stopPropagation();
681
+ this.viewMonth.set(new Date(this.viewYear(), index, 1));
682
+ this.monthMenuOpen.set(false);
683
+ }
684
+ selectYear(year, event) {
685
+ event.stopPropagation();
686
+ this.viewMonth.set(new Date(year, this.viewMonthIndex(), 1));
687
+ this.yearMenuOpen.set(false);
688
+ }
689
+ isDayDisabled(date) {
690
+ const min = this.minDate();
691
+ const max = this.maxDate();
692
+ const predicate = this.disabledDate();
693
+ if (min) {
694
+ const minStart = new Date(min.getFullYear(), min.getMonth(), min.getDate());
695
+ if (date < minStart) {
696
+ return true;
697
+ }
698
+ }
699
+ if (max) {
700
+ const maxEnd = new Date(max.getFullYear(), max.getMonth(), max.getDate(), 23, 59, 59, 999);
701
+ if (date > maxEnd) {
702
+ return true;
703
+ }
704
+ }
705
+ if (predicate) {
706
+ return predicate(date);
707
+ }
708
+ return false;
709
+ }
710
+ daysGrid = computed(() => {
711
+ const view = this.viewMonth();
712
+ const year = view.getFullYear();
713
+ const month = view.getMonth();
714
+ const firstOfMonth = new Date(year, month, 1);
715
+ const gridStart = new Date(firstOfMonth);
716
+ const firstDay = this.resolvedFirstDay();
717
+ gridStart.setDate(gridStart.getDate() - ((gridStart.getDay() - firstDay + 7) % 7));
718
+ const cells = [];
719
+ const today = new Date();
720
+ const todayKey = today.toDateString();
721
+ // Six weeks of seven days, whatever the month: a fixed cell count keeps the
722
+ // panel from changing height as you page through the year.
723
+ for (let i = 0; i < 42; i++) {
724
+ const d = new Date(gridStart);
725
+ d.setDate(d.getDate() + i);
726
+ const inMonth = d.getMonth() === month;
727
+ const isToday = d.toDateString() === todayKey;
728
+ const range = this.getRangeContext(d);
729
+ cells.push({
730
+ date: d,
731
+ day: d.getDate(),
732
+ inMonth,
733
+ isToday,
734
+ inRange: range.inRange,
735
+ isRangeStart: range.isStart,
736
+ isRangeEnd: range.isEnd,
737
+ isSelected: range.isSelected,
738
+ isDisabled: this.isDayDisabled(d),
739
+ });
740
+ }
741
+ return cells;
742
+ }, ...(ngDevMode ? [{ debugName: "daysGrid" }] : /* istanbul ignore next */ []));
743
+ weeksGrid = computed(() => {
744
+ const cells = this.daysGrid();
745
+ const weeks = [];
746
+ for (let index = 0; index < cells.length; index += 7) {
747
+ weeks.push(cells.slice(index, index + 7));
748
+ }
749
+ return weeks;
750
+ }, ...(ngDevMode ? [{ debugName: "weeksGrid" }] : /* istanbul ignore next */ []));
751
+ getRangeContext(d) {
752
+ const value = this.value();
753
+ if (this.mode() === 'single') {
754
+ const sel = value;
755
+ return {
756
+ inRange: false,
757
+ isStart: false,
758
+ isEnd: false,
759
+ isSelected: !!sel && sel.toDateString() === d.toDateString(),
760
+ };
761
+ }
762
+ const r = value ?? [null, null];
763
+ const a = r[0];
764
+ const b = r[1];
765
+ if (!a) {
766
+ return {
767
+ inRange: false,
768
+ isStart: false,
769
+ isEnd: false,
770
+ isSelected: false,
771
+ };
772
+ }
773
+ if (!b) {
774
+ return {
775
+ inRange: false,
776
+ isStart: a.toDateString() === d.toDateString(),
777
+ isEnd: false,
778
+ isSelected: false,
779
+ };
780
+ }
781
+ const t = d.getTime();
782
+ const aT = a.getTime();
783
+ const bT = b.getTime();
784
+ return {
785
+ inRange: t > Math.min(aT, bT) && t < Math.max(aT, bT),
786
+ isStart: t === Math.min(aT, bT),
787
+ isEnd: t === Math.max(aT, bT),
788
+ isSelected: false,
789
+ };
790
+ }
791
+ open(moveFocusToGrid = true) {
792
+ if (this.isDisabled() || this.overlayRef) {
793
+ return;
794
+ }
795
+ const { positionStrategy, config } = dropdownOverlay(this.overlay, this.anchor().nativeElement, 'ds-overlay-pane');
796
+ this.overlayRef = this.overlay.create(config);
797
+ prepareOverlayEnter(this.overlayRef, this.host.nativeElement, positionStrategy);
798
+ forwardOverlayTokens(this.overlayRef, this.host.nativeElement, this.panelTokens);
799
+ // The anchor, not the host: a stretched host's empty width must dismiss.
800
+ closeOnOutsidePointer(this.overlayRef, (target) => this.anchor().nativeElement.contains(target), () => this.close('dismiss'));
801
+ const removeScrollClose = closeOnScroll(this.overlayRef, () => this.close('dismiss'));
802
+ // Sync state on EVERY detach, so a stray CDK detach cannot leave a stale
803
+ // `overlayRef` wedging this method's reopen guard.
804
+ this.overlayRef.detachments().subscribe(() => {
805
+ removeScrollClose();
806
+ this.overlayRef = null;
807
+ this.isOpen.set(false);
808
+ });
809
+ this.overlayRef.keydownEvents().subscribe((event) => {
810
+ if (event.key === 'Escape') {
811
+ event.preventDefault();
812
+ this.close('dismiss');
813
+ this.focusTrigger();
814
+ }
815
+ });
816
+ const portal = new TemplatePortal(this.panelTpl(), this.vcr);
817
+ this.overlayRef.attach(portal);
818
+ this.isOpen.set(true);
819
+ const selected = this.mode() === 'single'
820
+ ? this.value()
821
+ : (this.value()?.[0] ?? null);
822
+ const focus = this.clampToBounds(selected ?? this.defaultDate() ?? new Date());
823
+ this.gridFocus.set(focus);
824
+ this.viewMonth.set(new Date(focus.getFullYear(), focus.getMonth(), 1));
825
+ if (moveFocusToGrid) {
826
+ afterNextRender(() => this.focusGridDay(), { injector: this.injector });
827
+ }
828
+ }
829
+ close(cause = 'select') {
830
+ const focusWasInPanel = this.overlayRef
831
+ ? focusIsInside(this.overlayRef)
832
+ : false;
833
+ disposeWithLeave(this.overlayRef, cause);
834
+ this.overlayRef = null;
835
+ this.isOpen.set(false);
836
+ this.closeMenus();
837
+ this.markTouched();
838
+ // Refocusing the editable field on a coarse pointer would summon the soft
839
+ // keyboard mid-scroll; the readonly field (allowInput=false) never does.
840
+ if (focusWasInPanel &&
841
+ (!this.allowInput() || !window.matchMedia('(pointer: coarse)').matches)) {
842
+ this.inputEl().nativeElement.focus({ preventScroll: true });
843
+ }
844
+ }
845
+ ngOnDestroy() {
846
+ this.overlayRef?.dispose();
847
+ this.overlayRef = null;
848
+ }
849
+ /**
850
+ * Also the calendar glyph's handler. A POINTER open must not drag focus into
851
+ * the day grid: the reader did not ask to leave a field they may want to type
852
+ * in. So focus follows what the field IS — typeable, and the caret stays;
853
+ * read-only, and the grid is the only thing worth focusing. The keyboard path is
854
+ * unaffected: ArrowDown on the field calls `open(true)`.
855
+ */
856
+ onFieldClick() {
857
+ this.open(!this.allowInput());
858
+ if (this.allowInput()) {
859
+ this.inputEl().nativeElement.focus();
860
+ }
861
+ }
862
+ // Intended result of a `beforeinput` segment edit, re-asserted in onFieldInput
863
+ // when a native mutation slips past a non-cancelable beforeinput (Android).
864
+ mobileEdit = null;
865
+ onFieldInput(event) {
866
+ if (!this.allowInput()) {
867
+ return;
868
+ }
869
+ const element = event.target;
870
+ if (this.mobileEdit) {
871
+ const { value, caret } = this.mobileEdit;
872
+ this.mobileEdit = null;
873
+ this.writeBackText(element, value, caret);
874
+ return;
875
+ }
876
+ this.commitRaw(element, element.value);
877
+ }
878
+ /** Physical-keyboard editing (desktop): typed digits fill the caret's slot;
879
+ * Backspace/Delete never shift digits across a separator. */
880
+ onFieldKeydown(event) {
881
+ if (!this.allowInput()) {
882
+ return;
883
+ }
884
+ const key = event.key;
885
+ const plain = !event.ctrlKey && !event.metaKey && !event.altKey;
886
+ const isDigit = key.length === 1 && key >= '0' && key <= '9' && plain;
887
+ if (key.length === 1 && plain && !isDigit) {
888
+ event.preventDefault();
889
+ return;
890
+ }
891
+ if (!isDigit && key !== 'Backspace' && key !== 'Delete') {
892
+ return;
893
+ }
894
+ event.preventDefault();
895
+ this.runSegmentEdit(event.target, isDigit ? 'type' : key === 'Backspace' ? 'backspace' : 'delete', isDigit ? key : undefined);
896
+ }
897
+ /** Mobile keyboards don't fire a reliable `keydown` (Gboard reports keyCode 229 /
898
+ * "Unidentified"), so edits are routed here via `beforeinput`'s `inputType` instead.
899
+ * Android Chrome can also ignore `preventDefault()` here, so the intended result is
900
+ * stashed and re-asserted in `onFieldInput`; the microtask expires the stash once
901
+ * preventDefault worked (no following `input` in the same task). */
902
+ onFieldBeforeInput(event) {
903
+ if (!this.allowInput()) {
904
+ return;
905
+ }
906
+ const element = event.target;
907
+ const type = event.inputType;
908
+ let kind = null;
909
+ let digit;
910
+ if (type === 'insertText' && event.data && /^\d$/.test(event.data)) {
911
+ kind = 'type';
912
+ digit = event.data;
913
+ }
914
+ else if (type === 'deleteContentBackward') {
915
+ kind = 'backspace';
916
+ }
917
+ else if (type === 'deleteContentForward') {
918
+ kind = 'delete';
919
+ }
920
+ else {
921
+ return;
922
+ }
923
+ event.preventDefault();
924
+ // Gboard reports Backspace/Delete on mobile with a full-segment "selection" (its
925
+ // composing region), which would hit the selection-clear branch below and wipe
926
+ // the whole slot. Collapse to the caret edge so a mobile delete removes one digit.
927
+ const collapsed = kind === 'backspace'
928
+ ? element.selectionEnd
929
+ : kind === 'delete'
930
+ ? element.selectionStart
931
+ : undefined;
932
+ this.runSegmentEdit(element, kind, digit, collapsed);
933
+ this.mobileEdit = {
934
+ value: element.value,
935
+ caret: element.selectionStart ?? element.value.length,
936
+ };
937
+ queueMicrotask(() => (this.mobileEdit = null));
938
+ }
939
+ /** A selection is cleared through the model so `_` placeholders are never
940
+ * natively erased — only digits are editable. */
941
+ runSegmentEdit(element, kind, digit, caretOverride) {
942
+ const layout = this.layout();
943
+ const segments = parseFieldText(element.value, layout);
944
+ // A caretOverride collapses the range (caret === selectionEnd), forcing the
945
+ // single-character branch below — used by the mobile beforeinput path.
946
+ const caret = caretOverride ?? element.selectionStart ?? element.value.length;
947
+ const selectionEnd = caretOverride ?? element.selectionEnd ?? caret;
948
+ let edit;
949
+ if (selectionEnd !== caret) {
950
+ const firstSel = caretToSlot(layout, caret);
951
+ const lastSel = caretToSlot(layout, selectionEnd);
952
+ const cleared = segments.slice();
953
+ for (let index = firstSel.slot; index <= lastSel.slot; index++) {
954
+ cleared[index] = '';
955
+ }
956
+ edit =
957
+ kind === 'type'
958
+ ? editType(cleared, layout, firstSel.slot, 0, digit)
959
+ : { segments: cleared, slot: firstSel.slot, offset: 0 };
960
+ }
961
+ else {
962
+ const { slot, offset } = caretToSlot(layout, caret);
963
+ edit =
964
+ kind === 'type'
965
+ ? editType(segments, layout, slot, offset, digit)
966
+ : kind === 'backspace'
967
+ ? editBackspace(segments, layout, slot, offset)
968
+ : editDelete(segments, layout, slot, offset);
969
+ }
970
+ if (!edit) {
971
+ return;
972
+ }
973
+ const text = this.toFieldText(edit.segments, layout);
974
+ this.applyEditedText(element, text, text ? slotToCaret(layout, edit.slot, edit.offset) : 0);
975
+ }
976
+ /** Paste digits into the segment model at the caret slot — never a global
977
+ * flatten — so existing digits elsewhere in the field survive untouched. */
978
+ onFieldPaste(event) {
979
+ if (!this.allowInput()) {
980
+ return;
981
+ }
982
+ event.preventDefault();
983
+ const element = event.target;
984
+ const layout = this.layout();
985
+ const pasted = (event.clipboardData?.getData('text') ?? '').replace(/\D/g, '');
986
+ if (!pasted) {
987
+ return;
988
+ }
989
+ const segments = parseFieldText(element.value, layout);
990
+ const caret = element.selectionStart ?? element.value.length;
991
+ const start = caretToSlot(layout, caret);
992
+ let result = { segments, slot: start.slot, offset: start.offset };
993
+ for (const digit of pasted) {
994
+ result = editType(result.segments, layout, result.slot, result.offset, digit);
995
+ }
996
+ this.applyEditedText(element, this.toFieldText(result.segments, layout), slotToCaret(layout, result.slot, result.offset));
997
+ }
998
+ countDigits(text) {
999
+ return text.replace(/\D/g, '').length;
1000
+ }
1001
+ /** The fallback for any `input` event with no preceding handled `beforeinput`
1002
+ * (IME, autofill, a suggestion): `raw` is re-read as a flat digit stream and
1003
+ * redistributed over the slots, since its own layout cannot be trusted. */
1004
+ commitRaw(element, raw) {
1005
+ const layout = this.layout();
1006
+ const capacity = layout.slots.reduce((sum, slot) => sum + slot.maxLength, 0);
1007
+ const digits = raw.replace(/\D/g, '').slice(0, capacity);
1008
+ const segments = [];
1009
+ let index = 0;
1010
+ for (const slot of layout.slots) {
1011
+ segments.push(digits.slice(index, index + slot.maxLength));
1012
+ index += slot.maxLength;
1013
+ }
1014
+ const text = this.toFieldText(segments, layout);
1015
+ this.applyEditedText(element, text, this.caretAfterFill(segments, layout));
1016
+ }
1017
+ applyEditedText(element, text, caret) {
1018
+ this.editing = true;
1019
+ this.writeBackText(element, text, caret);
1020
+ const spec = this.formatSpec();
1021
+ if (this.mode() === 'range') {
1022
+ this.rangeText.set(text);
1023
+ this.applyRangeText(text, spec, false);
1024
+ return;
1025
+ }
1026
+ this.inputText.set(text);
1027
+ const parsed = parseDate(text, spec);
1028
+ if (!parsed) {
1029
+ // Incomplete input is not an error yet; a full-but-bad value is caught on blur.
1030
+ this.typedInvalid.set(false);
1031
+ return;
1032
+ }
1033
+ if (this.isDayDisabled(parsed)) {
1034
+ this.typedInvalid.set(true);
1035
+ return;
1036
+ }
1037
+ this.typedInvalid.set(false);
1038
+ this.value.set(parsed);
1039
+ this.viewMonth.set(new Date(parsed.getFullYear(), parsed.getMonth(), 1));
1040
+ }
1041
+ onFieldBlur() {
1042
+ this.markTouched();
1043
+ if (!this.allowInput()) {
1044
+ return;
1045
+ }
1046
+ this.editing = false;
1047
+ const spec = this.formatSpec();
1048
+ if (this.mode() === 'range') {
1049
+ this.applyRangeText(this.rangeText(), spec, true);
1050
+ return;
1051
+ }
1052
+ const text = this.inputText();
1053
+ if (this.countDigits(text) === 0) {
1054
+ this.typedInvalid.set(false);
1055
+ this.value.set(null);
1056
+ this.inputText.set('');
1057
+ return;
1058
+ }
1059
+ const parsed = parseDate(text, spec);
1060
+ if (parsed && !this.isDayDisabled(parsed)) {
1061
+ this.typedInvalid.set(false);
1062
+ this.value.set(parsed);
1063
+ this.inputText.set(formatDate(parsed, spec));
1064
+ }
1065
+ else {
1066
+ this.typedInvalid.set(true);
1067
+ }
1068
+ }
1069
+ /** Writing `value` parks the caret at the end, so the explicit range has to
1070
+ * follow it; the later `[value]` binding writes the same string, which leaves
1071
+ * the caret untouched. */
1072
+ writeBackText(element, text, caret) {
1073
+ if (element.value !== text) {
1074
+ element.value = text;
1075
+ }
1076
+ element.setSelectionRange(caret, caret);
1077
+ }
1078
+ /** Caret just past the last digit a flat digit stream filled — the first slot
1079
+ * short of its max length, or the very end once every slot is full. */
1080
+ caretAfterFill(segments, layout) {
1081
+ for (let slot = 0; slot < segments.length; slot++) {
1082
+ if (segments[slot].length < layout.slots[slot].maxLength) {
1083
+ return slotToCaret(layout, slot, segments[slot].length);
1084
+ }
1085
+ }
1086
+ const last = segments.length - 1;
1087
+ return slotToCaret(layout, last, layout.slots[last].maxLength);
1088
+ }
1089
+ /** `commit` is the blur pass: only then is the field text rewritten from the
1090
+ * parsed value, and a half-filled range written through to `value`. */
1091
+ applyRangeText(text, spec, commit) {
1092
+ if (this.countDigits(text) === 0) {
1093
+ this.rangeInvalid.set(false);
1094
+ this.value.set(null);
1095
+ if (commit) {
1096
+ this.rangeText.set('');
1097
+ }
1098
+ return;
1099
+ }
1100
+ const layout = rangeFieldLayout(spec);
1101
+ const slots = parseFieldText(text, layout);
1102
+ const perDate = spec.segments.length;
1103
+ const startFilled = slots
1104
+ .slice(0, perDate)
1105
+ .every((seg, i) => seg.length === spec.segments[i].length);
1106
+ const endFilled = slots
1107
+ .slice(perDate, perDate * 2)
1108
+ .every((seg, i) => seg.length === spec.segments[i].length);
1109
+ const [start, end] = parseDateRange(text, spec);
1110
+ const startBad = startFilled && (!start || this.isDayDisabled(start));
1111
+ const endBad = endFilled && (!end || this.isDayDisabled(end));
1112
+ this.rangeInvalid.set(startBad || endBad);
1113
+ if (start && end && !startBad && !endBad) {
1114
+ const ordered = start.getTime() <= end.getTime() ? [start, end] : [end, start];
1115
+ this.value.set(ordered);
1116
+ if (commit) {
1117
+ this.rangeText.set(formatRange(ordered, spec));
1118
+ }
1119
+ }
1120
+ else if (commit) {
1121
+ this.value.set([start ?? null, end ?? null]);
1122
+ }
1123
+ }
1124
+ prevMonth() {
1125
+ const m = new Date(this.viewMonth());
1126
+ m.setMonth(m.getMonth() - 1);
1127
+ this.viewMonth.set(m);
1128
+ }
1129
+ nextMonth() {
1130
+ const m = new Date(this.viewMonth());
1131
+ m.setMonth(m.getMonth() + 1);
1132
+ this.viewMonth.set(m);
1133
+ }
1134
+ selectDay(cell) {
1135
+ if (cell.isDisabled) {
1136
+ return;
1137
+ }
1138
+ this.editing = false;
1139
+ if (this.mode() === 'single') {
1140
+ this.value.set(new Date(cell.date));
1141
+ this.close();
1142
+ this.focusTrigger();
1143
+ return;
1144
+ }
1145
+ const r = this.value() ?? [null, null];
1146
+ const a = r[0];
1147
+ const b = r[1];
1148
+ if (!a || (a && b)) {
1149
+ this.value.set([new Date(cell.date), null]);
1150
+ this.gridFocus.set(new Date(cell.date));
1151
+ }
1152
+ else {
1153
+ const picked = new Date(cell.date);
1154
+ const range = a.getTime() <= picked.getTime() ? [a, picked] : [picked, a];
1155
+ this.value.set(range);
1156
+ this.close();
1157
+ this.focusTrigger();
1158
+ }
1159
+ }
1160
+ isPresetDisabled(preset) {
1161
+ const presetValue = preset.value;
1162
+ if (presetValue instanceof Date) {
1163
+ return this.isDayDisabled(presetValue);
1164
+ }
1165
+ const rangeValue = presetValue;
1166
+ const start = rangeValue[0];
1167
+ const end = rangeValue[1];
1168
+ if (start && this.isDayDisabled(start)) {
1169
+ return true;
1170
+ }
1171
+ if (end && this.isDayDisabled(end)) {
1172
+ return true;
1173
+ }
1174
+ return false;
1175
+ }
1176
+ applyPreset(preset) {
1177
+ if (this.isPresetDisabled(preset)) {
1178
+ return;
1179
+ }
1180
+ this.editing = false;
1181
+ this.typedInvalid.set(false);
1182
+ this.rangeInvalid.set(false);
1183
+ const presetValue = preset.value;
1184
+ if (presetValue instanceof Date) {
1185
+ this.value.set(new Date(presetValue));
1186
+ }
1187
+ else {
1188
+ const rangeValue = presetValue;
1189
+ this.value.set([
1190
+ rangeValue[0] ? new Date(rangeValue[0]) : null,
1191
+ rangeValue[1] ? new Date(rangeValue[1]) : null,
1192
+ ]);
1193
+ }
1194
+ this.close();
1195
+ this.focusTrigger();
1196
+ }
1197
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DatePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1198
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: DatePickerComponent, isStandalone: true, selector: "ds-date-picker", inputs: { mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, optional: { classPropertyName: "optional", publicName: "optional", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, success: { classPropertyName: "success", publicName: "success", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, minYear: { classPropertyName: "minYear", publicName: "minYear", isSignal: true, isRequired: false, transformFunction: null }, maxYear: { classPropertyName: "maxYear", publicName: "maxYear", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, disabledDate: { classPropertyName: "disabledDate", publicName: "disabledDate", isSignal: true, isRequired: false, transformFunction: null }, presets: { classPropertyName: "presets", publicName: "presets", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, dateFormat: { classPropertyName: "dateFormat", publicName: "dateFormat", isSignal: true, isRequired: false, transformFunction: null }, firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: true, isRequired: false, transformFunction: null }, defaultDate: { classPropertyName: "defaultDate", publicName: "defaultDate", isSignal: true, isRequired: false, transformFunction: null }, allowInput: { classPropertyName: "allowInput", publicName: "allowInput", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "attr.data-field-state": "controlState()", "class.in-group": "inGroup", "class.full-width": "fullWidth()" } }, providers: [
1199
+ {
1200
+ provide: NG_VALUE_ACCESSOR,
1201
+ useExisting: forwardRef(() => DatePickerComponent),
1202
+ multi: true,
1203
+ },
1204
+ ], viewQueries: [{ propertyName: "anchor", first: true, predicate: ["anchor"], descendants: true, isSignal: true }, { propertyName: "inputEl", first: true, predicate: ["inputEl"], descendants: true, isSignal: true }, { propertyName: "panelTpl", first: true, predicate: ["panel"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"field\">\n @if (label()) {\n <span\n class=\"label\"\n [id]=\"labelId\">\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\">\n *\n </span>\n } @else if (optional()) {\n <span\n class=\"optional-marker\"\n aria-hidden=\"true\">\n (optional)\n </span>\n }\n </span>\n }\n\n <!-- Whole-field click opens the panel; keyboard access is on the inner input\n (aria-haspopup + ArrowDown), so the wrapper needs no key handler of its own. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div\n #anchor\n [class]=\"triggerClasses()\"\n (click)=\"onFieldClick()\">\n <span class=\"input-wrap\">\n <input\n #inputEl\n type=\"text\"\n class=\"date-input\"\n inputmode=\"numeric\"\n autocomplete=\"off\"\n aria-haspopup=\"dialog\"\n [class.masked]=\"allowInput()\"\n [value]=\"fieldText()\"\n [attr.size]=\"fieldSize()\"\n [readOnly]=\"!allowInput()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"isOpen() ? panelId : null\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [attr.aria-placeholder]=\"fieldPlaceholder()\"\n (beforeinput)=\"onFieldBeforeInput($event)\"\n (input)=\"onFieldInput($event)\"\n (paste)=\"onFieldPaste($event)\"\n (blur)=\"onFieldBlur()\"\n (keydown)=\"onFieldKeydown($event)\"\n (keydown.arrowdown)=\"open(true); $event.preventDefault()\" />\n\n <!-- Per-slot overlay: the real input is transparent (see .masked in the\n SCSS), so this paints every glyph \u2014 digits at normal weight, unfilled\n positions muted. Monospace font keeps letters and digits equal\n width, so glyphs stay aligned 1:1 with the invisible input's caret. -->\n @if (allowInput()) {\n <!-- Whitespace-tight on purpose: the overlay paints with `white-space:\n pre`, so it must hug its tags or stray whitespace would render\n and shift later glyphs out of alignment. -->\n <!-- eslint-disable ds/template/element-content-newline -->\n <span\n class=\"mask-ghost\"\n aria-hidden=\"true\">\n @for (part of displaySlots(); track $index) {\n <span [class.muted]=\"part.muted\">{{ part.text }}</span>\n }\n </span>\n <!-- eslint-enable ds/template/element-content-newline -->\n }\n </span>\n\n <button\n type=\"button\"\n class=\"calendar-toggle\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [disabled]=\"isDisabled()\"\n (click)=\"onFieldClick(); $event.stopPropagation()\">\n <ds-icon\n name=\"calendar\"\n [size]=\"16\" />\n </button>\n </div>\n\n <ds-field-message\n [icon]=\"messageIcon()\"\n [text]=\"message().text\"\n [state]=\"message().state\"\n [messageId]=\"hintId()\"\n [reserve]=\"reserveMessageResolved()\" />\n</div>\n\n<ng-template #panel>\n <!-- Dialog-level click is a pointer-only light-dismiss that closes an open\n month/year popup; keyboard users dismiss it with Escape (bound on each popup). -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events -->\n <div\n class=\"calendar\"\n role=\"dialog\"\n aria-label=\"Choose date\"\n cdkTrapFocus\n [id]=\"panelId\"\n [class.has-presets]=\"presets().length > 0\"\n (click)=\"closeMenus()\">\n <span\n class=\"visually-hidden\"\n aria-live=\"polite\">\n {{ monthYearLabel() }}\n </span>\n\n <div class=\"calendar-body\">\n <div class=\"head\">\n <span\n class=\"period\"\n [id]=\"captionId\">\n <span class=\"period-item\">\n <button\n type=\"button\"\n class=\"period-trigger\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"monthMenuOpen()\"\n (click)=\"toggleMonthMenu($event)\">\n {{ monthNames()[viewMonthIndex()] }}\n <ds-icon\n name=\"chevronDown\"\n [size]=\"12\" />\n </button>\n\n @if (monthMenuOpen()) {\n <!-- Popup container, not a focusable widget: it wraps real <button>s\n and closes on Escape; the click only stops light-dismiss bubbling. -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"picker-menu\"\n (click)=\"$event.stopPropagation()\"\n (keydown.escape)=\"closeMenus()\">\n <div\n class=\"picker-grid\"\n role=\"group\"\n aria-label=\"Select month\">\n @for (name of monthNames(); track $index) {\n <button\n type=\"button\"\n class=\"picker-cell\"\n [class.selected]=\"$index === viewMonthIndex()\"\n [attr.aria-label]=\"name\"\n [attr.aria-current]=\"\n $index === viewMonthIndex() ? 'true' : null\n \"\n (click)=\"selectMonth($index, $event)\">\n {{ name.slice(0, 3) }}\n </button>\n }\n </div>\n </div>\n }\n </span>\n\n <span class=\"period-item\">\n <button\n type=\"button\"\n class=\"period-trigger\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"yearMenuOpen()\"\n (click)=\"toggleYearMenu($event)\">\n {{ viewYear() }}\n <ds-icon\n name=\"chevronDown\"\n [size]=\"12\" />\n </button>\n\n @if (yearMenuOpen()) {\n <!-- Popup container, not a focusable widget: it wraps real <button>s\n and closes on Escape; the click only stops light-dismiss bubbling. -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"picker-menu\"\n (click)=\"$event.stopPropagation()\"\n (keydown.escape)=\"closeMenus()\">\n <div class=\"picker-head\">\n <button\n type=\"button\"\n class=\"picker-nav\"\n aria-label=\"Previous years\"\n [disabled]=\"!canPrevYearPage()\"\n (click)=\"prevYearPage($event)\">\n <ds-icon\n name=\"chevronLeft\"\n [size]=\"14\" />\n </button>\n\n <span class=\"picker-range\">\n {{ yearRangeLabel() }}\n </span>\n\n <button\n type=\"button\"\n class=\"picker-nav\"\n aria-label=\"Next years\"\n [disabled]=\"!canNextYearPage()\"\n (click)=\"nextYearPage($event)\">\n <ds-icon\n name=\"chevronRight\"\n [size]=\"14\" />\n </button>\n </div>\n\n <div\n class=\"picker-grid\"\n role=\"group\"\n aria-label=\"Select year\">\n @for (year of yearsOnPage(); track year) {\n <button\n type=\"button\"\n class=\"picker-cell year-cell\"\n [class.selected]=\"year === viewYear()\"\n [attr.aria-current]=\"year === viewYear() ? 'true' : null\"\n (click)=\"selectYear(year, $event)\">\n {{ year }}\n </button>\n }\n </div>\n </div>\n }\n </span>\n </span>\n\n <span class=\"nav\">\n <button\n type=\"button\"\n (click)=\"prevMonth()\">\n <ds-icon\n name=\"chevronLeft\"\n [size]=\"14\">\n </ds-icon>\n </button>\n\n <button\n type=\"button\"\n (click)=\"nextMonth()\">\n <ds-icon\n name=\"chevronRight\"\n [size]=\"14\">\n </ds-icon>\n </button>\n </span>\n </div>\n\n <div\n class=\"grid\"\n role=\"grid\"\n [attr.aria-labelledby]=\"captionId\">\n <div\n class=\"dow-row\"\n role=\"row\">\n @for (dow of weekdays(); track $index) {\n <span\n class=\"dow\"\n role=\"columnheader\"\n [attr.aria-label]=\"weekdaysFull()[$index]\">\n {{ dow }}\n </span>\n }\n </div>\n\n @for (week of weeksGrid(); track $index) {\n <div\n class=\"week\"\n role=\"row\">\n @for (cell of week; track $index) {\n <ds-calendar-day\n [muted]=\"!cell.inMonth\"\n [today]=\"cell.isToday\"\n [selected]=\"cell.isSelected\"\n [inRange]=\"cell.inRange\"\n [rangeStart]=\"cell.isRangeStart\"\n [rangeEnd]=\"cell.isRangeEnd\"\n [disabled]=\"cell.isDisabled\"\n [dataDay]=\"dayKey(cell.date)\"\n [tabIndex]=\"isFocusDay(cell) ? 0 : -1\"\n [ariaLabel]=\"dayLabel(cell)\"\n (daySelected)=\"selectDay(cell)\"\n (dayKeydown)=\"onGridKeydown($event, cell)\">\n {{ cell.day }}\n </ds-calendar-day>\n }\n </div>\n }\n </div>\n </div>\n\n @if (presets().length > 0) {\n <div class=\"presets\">\n @for (preset of presets(); track $index) {\n <button\n type=\"button\"\n class=\"preset-btn\"\n [disabled]=\"isPresetDisabled(preset)\"\n (click)=\"applyPreset(preset); $event.stopPropagation()\">\n {{ preset.label }}\n </button>\n }\n </div>\n }\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_date-picker-focus-shadow: var(--ds-date-picker-focus-shadow, var(--ds-control-focus-shadow));--_date-picker-trigger-bg-color: var(--ds-date-picker-trigger-bg-color, var(--surface-default));--_date-picker-trigger-border-color: var(--ds-date-picker-trigger-border-color, var(--border-default));--_date-picker-trigger-label-color: var(--ds-date-picker-trigger-label-color, var(--text-primary));--_date-picker-required-color: var(--ds-date-picker-required-color, var(--error));--_date-picker-placeholder-color: var(--ds-date-picker-placeholder-color, var(--text-tertiary));--_date-picker-trigger-radius: var(--ds-date-picker-trigger-radius, var(--ds-radius-control));--_date-picker-trigger-pad-x: var(--ds-date-picker-trigger-pad-x, var(--field-pad-x));--_date-picker-value-font-family: var(--ds-date-picker-value-font-family, var(--font-mono));--_date-picker-value-font-size: var(--ds-date-picker-value-font-size, var(--font-size-s));--_date-picker-value-weight: var(--ds-date-picker-value-weight, var(--font-weight-regular));display:block;width:fit-content;max-width:100%}:host(.full-width){width:100%}:host(.full-width) .trigger{width:100%}:host(.full-width) .input-wrap{flex:1}:host(.full-width) .date-input{flex:1}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.field{display:flex;flex-direction:column;align-items:flex-start;gap:var(--field-label-gap);width:100%}.field .label{--_field-label-font-size: var(--ds-field-label-font-size, var(--font-size-xs));--_field-label-weight: var(--ds-field-label-weight, var(--font-weight-bold));--_field-label-color: var(--ds-field-label-color, var(--text-secondary));--_field-label-transform: var(--ds-field-label-transform, none);--_field-label-tracking: var(--ds-field-label-tracking, normal);display:flex;align-items:center;gap:var(--field-gap-req);font:var(--_field-label-weight) var(--_field-label-font-size)/var(--line-height-base) var(--font-sans);color:var(--_field-label-color);text-transform:var(--_field-label-transform);letter-spacing:var(--_field-label-tracking)}.field .label .req{color:var(--_date-picker-required-color);font-weight:var(--font-weight-semibold)}.field .label .optional-marker{color:var(--text-tertiary);font-weight:var(--font-weight-regular)}.trigger{display:inline-flex;align-items:center;gap:var(--space-1);background:var(--_date-picker-trigger-bg-color);border:var(--border-width-default) solid var(--_date-picker-trigger-border-color);border-radius:var(--_date-picker-trigger-radius);padding:0 var(--_date-picker-trigger-pad-x);--_field-box-height: var(--ds-field-height, var(--field-h-md));height:var(--_field-box-height);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--_date-picker-trigger-label-color);cursor:pointer;transition:border-color var(--duration-fast) var(--ease-standard)}.trigger:hover{border-color:var(--border-strong)}.trigger:focus-visible{box-shadow:none}@media not (forced-colors:active){.trigger .date-input:where(:focus-visible){outline:none}}@media not (forced-colors:active){.trigger .calendar-toggle:where(:focus-visible){outline:none}}@media not (forced-colors:active){.trigger:focus-within,.trigger.open{outline:none}}.trigger:focus-within,.trigger.open{box-shadow:var(--_date-picker-focus-shadow)}.trigger.sm{--_field-box-height: var(--ds-field-height, var(--field-h-sm));height:var(--_field-box-height);padding:0 var(--space-2);font-size:var(--font-size-xs)}.trigger.lg{--_field-box-height: var(--ds-field-height, var(--field-h-lg));height:var(--_field-box-height);padding:0 var(--space-4);font-size:var(--font-size-m)}.trigger.disabled,.trigger:disabled{background:var(--surface-disabled);border-color:var(--border-disabled);color:var(--text-disabled);cursor:not-allowed}.input-wrap{position:relative;display:inline-flex;align-items:center}.mask-ghost{display:flex;align-items:center;font:inherit;font-family:var(--_date-picker-value-font-family);font-size:var(--_date-picker-value-font-size);font-weight:var(--_date-picker-value-weight);font-variant-numeric:tabular-nums;white-space:pre;pointer-events:none;overflow:hidden}.mask-ghost .muted{color:var(--_date-picker-placeholder-color)}.date-input{width:auto;border:none;background:transparent;color:inherit;font:inherit;font-family:var(--_date-picker-value-font-family);font-size:var(--_date-picker-value-font-size);font-weight:var(--_date-picker-value-weight);font-variant-numeric:tabular-nums;padding:0}@media not (forced-colors:active){.date-input{outline:none}}.date-input.masked{position:absolute;inset:0;width:100%;color:transparent;caret-color:var(--_date-picker-trigger-label-color)}.date-input:read-only{cursor:pointer}.date-input:disabled{cursor:not-allowed}.calendar-toggle{display:inline-flex;align-items:center;border:none;background:transparent;color:var(--icon-default);padding:0;cursor:pointer}.calendar-toggle:disabled{cursor:not-allowed}.calendar{--_date-picker-bg-color: var(--ds-date-picker-bg-color, var(--surface-overlay));--_date-picker-border: var(--ds-date-picker-border, var(--border-default));--_date-picker-shadow: var(--ds-date-picker-shadow, var(--ds-elevation-overlay));--_date-picker-day-hover-bg-color: var(--ds-date-picker-day-hover-bg-color, var(--surface-secondary));--_date-picker-day-today-label-color: var(--ds-date-picker-day-today-label-color, var(--accent));--_date-picker-day-selected-bg-color: var(--ds-date-picker-day-selected-bg-color, var(--accent));--_date-picker-day-selected-bg-color-hover: var(--ds-date-picker-day-selected-bg-color-hover, var(--accent-hover));--_date-picker-day-selected-label-color: var(--ds-date-picker-day-selected-label-color, var(--accent-on));--_date-picker-day-range-bg-color: var(--ds-date-picker-day-range-bg-color, var(--accent-subtitle));--_date-picker-day-range-label-color: var(--ds-date-picker-day-range-label-color, var(--accent-strong));--_date-picker-day-disabled-label-color: var(--ds-date-picker-day-disabled-label-color, var(--text-disabled));--_date-picker-day-label-color: var(--ds-date-picker-day-label-color, var(--text-primary));--_date-picker-day-muted-label-color: var(--ds-date-picker-day-muted-label-color, var(--text-muted));--_date-picker-weekday-color: var(--ds-date-picker-weekday-color, var(--text-tertiary));--_date-picker-header-label-color: var(--ds-date-picker-header-label-color, var(--text-primary));--_date-picker-nav-icon-color: var(--ds-date-picker-nav-icon-color, var(--icon-default));--_date-picker-width: var(--ds-date-picker-width, var(--date-picker-w));--_date-picker-panel-radius: var(--ds-date-picker-panel-radius, var(--ds-radius-panel));--_date-picker-focus-shadow: var(--ds-date-picker-focus-shadow, var(--ds-control-focus-shadow));background-color:var(--_date-picker-bg-color);border:var(--border-width-default) solid var(--_date-picker-border);border-radius:var(--_date-picker-panel-radius);box-shadow:var(--_date-picker-shadow);padding:var(--space-3);width:var(--_date-picker-width)}.calendar .head{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--space-2)}.calendar .period{display:flex;gap:var(--space-1)}.calendar .period-item{position:relative}.calendar .period-trigger{display:inline-flex;align-items:center;gap:var(--space-1);border:0;background:transparent;padding:var(--space-1) var(--space-1-5);border-radius:var(--ds-radius-inner);font:var(--font-weight-bold) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--_date-picker-header-label-color);cursor:pointer}.calendar .period-trigger:hover{background-color:var(--_date-picker-day-hover-bg-color)}.calendar .period-trigger:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}.calendar .picker-menu{position:absolute;top:calc(100% + var(--space-1));left:0;z-index:1;padding:var(--space-2);width:max-content;min-width:100%;background-color:var(--_date-picker-bg-color);border:var(--border-width-default) solid var(--_date-picker-border);border-radius:var(--radius-md);box-shadow:var(--_date-picker-shadow)}.calendar .picker-head{display:flex;align-items:center;justify-content:space-between;gap:var(--space-2);margin-bottom:var(--space-2)}.calendar .picker-head .picker-nav{width:var(--date-picker-nav-size);height:var(--date-picker-nav-size);border:0;background:transparent;display:grid;place-items:center;color:var(--_date-picker-nav-icon-color);cursor:pointer;border-radius:var(--ds-radius-inner)}.calendar .picker-head .picker-nav:hover:not(:disabled){background-color:var(--_date-picker-day-hover-bg-color)}.calendar .picker-head .picker-nav:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.calendar .picker-head .picker-range{font:var(--font-weight-bold) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--_date-picker-header-label-color)}.calendar .picker-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--space-1)}.calendar .picker-cell{border:0;background:transparent;padding:var(--space-1-5) var(--space-2);border-radius:var(--ds-radius-inner);font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-primary);cursor:pointer;text-align:center;white-space:nowrap}.calendar .picker-cell:hover{background-color:var(--_date-picker-day-hover-bg-color)}.calendar .picker-cell:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}.calendar .picker-cell.selected{background-color:var(--_date-picker-day-selected-bg-color);color:var(--_date-picker-day-selected-label-color);font-weight:var(--font-weight-bold)}.calendar .nav{display:flex;gap:var(--space-1)}.calendar .nav button{width:var(--date-picker-nav-size);height:var(--date-picker-nav-size);border:0;background:transparent;display:grid;place-items:center;color:var(--_date-picker-nav-icon-color);cursor:pointer;border-radius:var(--ds-radius-inner)}.calendar .nav button:hover{background-color:var(--_date-picker-day-hover-bg-color)}.calendar .grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:var(--date-picker-cell-gap)}.calendar .dow-row,.calendar .week{display:contents}.calendar .dow{font:var(--font-weight-bold) var(--font-size-2xs)/var(--line-height-flat) var(--font-sans);text-align:center;padding:var(--space-1) 0;color:var(--_date-picker-weekday-color);text-transform:uppercase;letter-spacing:var(--letter-spacing-wider)}.calendar.has-presets{display:flex;flex-direction:row;gap:var(--space-3);width:auto}.calendar.has-presets .calendar-body{flex:0 0 var(--_date-picker-width);width:var(--_date-picker-width)}.calendar .calendar-body{display:flex;flex-direction:column}.calendar .presets{display:flex;flex-direction:column;gap:var(--space-1);border-left:var(--border-width-default) solid var(--_date-picker-border);padding-left:var(--space-3);min-width:8.5rem}.calendar .preset-btn{display:flex;align-items:center;width:100%;min-height:var(--hit-min);border:0;background:transparent;padding:var(--space-2) var(--space-3);border-radius:var(--ds-radius-inner);font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-primary);cursor:pointer;text-align:left;white-space:nowrap}.calendar .preset-btn:hover:not(:disabled){background-color:var(--_date-picker-day-hover-bg-color)}.calendar .preset-btn:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}.calendar .preset-btn:disabled{color:var(--_date-picker-day-disabled-label-color);cursor:not-allowed}@media(width<640px){.calendar{max-width:calc(100vw - var(--space-4))}.calendar.has-presets{flex-direction:column;width:100%}.calendar.has-presets .calendar-body{flex:1 1 auto;width:100%}.calendar .presets{border-left:0;padding-left:0;border-top:var(--border-width-default) solid var(--_date-picker-border);padding-top:var(--space-3);min-width:0;width:100%}}:host(.in-group){width:auto;display:flex}:host(.in-group) .label,:host(.in-group) ds-field-message{display:none}:host(.in-group) .trigger{border:0;border-radius:0;background:transparent;flex:1;height:auto}:host(.in-group) .trigger:hover,:host(.in-group) .trigger:focus,:host(.in-group) .trigger:focus-visible,:host(.in-group) .trigger:focus-within{border:0;box-shadow:none}@media not (forced-colors:active){:host(.in-group) .trigger:hover,:host(.in-group) .trigger:focus,:host(.in-group) .trigger:focus-visible,:host(.in-group) .trigger:focus-within{outline:none}}:host([data-field-state=error]:not(.in-group)) .trigger{border-color:var(--error);background-color:var(--error-subtitle)}:host([data-field-state=error]:not(.in-group)) .trigger:focus-within,:host([data-field-state=error]:not(.in-group)) .trigger:focus-visible{box-shadow:var(--ds-field-focus-shadow-error)}:host([data-field-state=warning]:not(.in-group)) .trigger{border-color:var(--warning-text)}:host([data-field-state=success]:not(.in-group)) .trigger{border-color:var(--success)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "component", type: CalendarDayComponent, selector: "ds-calendar-day", inputs: ["selected", "inRange", "rangeStart", "rangeEnd", "today", "muted", "disabled", "dataDay", "tabIndex", "ariaLabel"], outputs: ["daySelected", "dayKeydown"] }, { kind: "component", type: FieldMessageComponent, selector: "ds-field-message", inputs: ["text", "state", "messageId", "icon", "reserve"] }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }] });
1205
+ }
1206
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DatePickerComponent, decorators: [{
1207
+ type: Component,
1208
+ args: [{ selector: 'ds-date-picker', standalone: true, imports: [
1209
+ IconComponent,
1210
+ CalendarDayComponent,
1211
+ FieldMessageComponent,
1212
+ A11yModule,
1213
+ ], encapsulation: ViewEncapsulation.Emulated, providers: [
1214
+ {
1215
+ provide: NG_VALUE_ACCESSOR,
1216
+ useExisting: forwardRef(() => DatePickerComponent),
1217
+ multi: true,
1218
+ },
1219
+ ], host: {
1220
+ '[attr.data-field-state]': 'controlState()',
1221
+ '[class.in-group]': 'inGroup',
1222
+ '[class.full-width]': 'fullWidth()',
1223
+ }, template: "<div class=\"field\">\n @if (label()) {\n <span\n class=\"label\"\n [id]=\"labelId\">\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\">\n *\n </span>\n } @else if (optional()) {\n <span\n class=\"optional-marker\"\n aria-hidden=\"true\">\n (optional)\n </span>\n }\n </span>\n }\n\n <!-- Whole-field click opens the panel; keyboard access is on the inner input\n (aria-haspopup + ArrowDown), so the wrapper needs no key handler of its own. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div\n #anchor\n [class]=\"triggerClasses()\"\n (click)=\"onFieldClick()\">\n <span class=\"input-wrap\">\n <input\n #inputEl\n type=\"text\"\n class=\"date-input\"\n inputmode=\"numeric\"\n autocomplete=\"off\"\n aria-haspopup=\"dialog\"\n [class.masked]=\"allowInput()\"\n [value]=\"fieldText()\"\n [attr.size]=\"fieldSize()\"\n [readOnly]=\"!allowInput()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"isOpen() ? panelId : null\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [attr.aria-placeholder]=\"fieldPlaceholder()\"\n (beforeinput)=\"onFieldBeforeInput($event)\"\n (input)=\"onFieldInput($event)\"\n (paste)=\"onFieldPaste($event)\"\n (blur)=\"onFieldBlur()\"\n (keydown)=\"onFieldKeydown($event)\"\n (keydown.arrowdown)=\"open(true); $event.preventDefault()\" />\n\n <!-- Per-slot overlay: the real input is transparent (see .masked in the\n SCSS), so this paints every glyph \u2014 digits at normal weight, unfilled\n positions muted. Monospace font keeps letters and digits equal\n width, so glyphs stay aligned 1:1 with the invisible input's caret. -->\n @if (allowInput()) {\n <!-- Whitespace-tight on purpose: the overlay paints with `white-space:\n pre`, so it must hug its tags or stray whitespace would render\n and shift later glyphs out of alignment. -->\n <!-- eslint-disable ds/template/element-content-newline -->\n <span\n class=\"mask-ghost\"\n aria-hidden=\"true\">\n @for (part of displaySlots(); track $index) {\n <span [class.muted]=\"part.muted\">{{ part.text }}</span>\n }\n </span>\n <!-- eslint-enable ds/template/element-content-newline -->\n }\n </span>\n\n <button\n type=\"button\"\n class=\"calendar-toggle\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [disabled]=\"isDisabled()\"\n (click)=\"onFieldClick(); $event.stopPropagation()\">\n <ds-icon\n name=\"calendar\"\n [size]=\"16\" />\n </button>\n </div>\n\n <ds-field-message\n [icon]=\"messageIcon()\"\n [text]=\"message().text\"\n [state]=\"message().state\"\n [messageId]=\"hintId()\"\n [reserve]=\"reserveMessageResolved()\" />\n</div>\n\n<ng-template #panel>\n <!-- Dialog-level click is a pointer-only light-dismiss that closes an open\n month/year popup; keyboard users dismiss it with Escape (bound on each popup). -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events -->\n <div\n class=\"calendar\"\n role=\"dialog\"\n aria-label=\"Choose date\"\n cdkTrapFocus\n [id]=\"panelId\"\n [class.has-presets]=\"presets().length > 0\"\n (click)=\"closeMenus()\">\n <span\n class=\"visually-hidden\"\n aria-live=\"polite\">\n {{ monthYearLabel() }}\n </span>\n\n <div class=\"calendar-body\">\n <div class=\"head\">\n <span\n class=\"period\"\n [id]=\"captionId\">\n <span class=\"period-item\">\n <button\n type=\"button\"\n class=\"period-trigger\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"monthMenuOpen()\"\n (click)=\"toggleMonthMenu($event)\">\n {{ monthNames()[viewMonthIndex()] }}\n <ds-icon\n name=\"chevronDown\"\n [size]=\"12\" />\n </button>\n\n @if (monthMenuOpen()) {\n <!-- Popup container, not a focusable widget: it wraps real <button>s\n and closes on Escape; the click only stops light-dismiss bubbling. -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"picker-menu\"\n (click)=\"$event.stopPropagation()\"\n (keydown.escape)=\"closeMenus()\">\n <div\n class=\"picker-grid\"\n role=\"group\"\n aria-label=\"Select month\">\n @for (name of monthNames(); track $index) {\n <button\n type=\"button\"\n class=\"picker-cell\"\n [class.selected]=\"$index === viewMonthIndex()\"\n [attr.aria-label]=\"name\"\n [attr.aria-current]=\"\n $index === viewMonthIndex() ? 'true' : null\n \"\n (click)=\"selectMonth($index, $event)\">\n {{ name.slice(0, 3) }}\n </button>\n }\n </div>\n </div>\n }\n </span>\n\n <span class=\"period-item\">\n <button\n type=\"button\"\n class=\"period-trigger\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"yearMenuOpen()\"\n (click)=\"toggleYearMenu($event)\">\n {{ viewYear() }}\n <ds-icon\n name=\"chevronDown\"\n [size]=\"12\" />\n </button>\n\n @if (yearMenuOpen()) {\n <!-- Popup container, not a focusable widget: it wraps real <button>s\n and closes on Escape; the click only stops light-dismiss bubbling. -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"picker-menu\"\n (click)=\"$event.stopPropagation()\"\n (keydown.escape)=\"closeMenus()\">\n <div class=\"picker-head\">\n <button\n type=\"button\"\n class=\"picker-nav\"\n aria-label=\"Previous years\"\n [disabled]=\"!canPrevYearPage()\"\n (click)=\"prevYearPage($event)\">\n <ds-icon\n name=\"chevronLeft\"\n [size]=\"14\" />\n </button>\n\n <span class=\"picker-range\">\n {{ yearRangeLabel() }}\n </span>\n\n <button\n type=\"button\"\n class=\"picker-nav\"\n aria-label=\"Next years\"\n [disabled]=\"!canNextYearPage()\"\n (click)=\"nextYearPage($event)\">\n <ds-icon\n name=\"chevronRight\"\n [size]=\"14\" />\n </button>\n </div>\n\n <div\n class=\"picker-grid\"\n role=\"group\"\n aria-label=\"Select year\">\n @for (year of yearsOnPage(); track year) {\n <button\n type=\"button\"\n class=\"picker-cell year-cell\"\n [class.selected]=\"year === viewYear()\"\n [attr.aria-current]=\"year === viewYear() ? 'true' : null\"\n (click)=\"selectYear(year, $event)\">\n {{ year }}\n </button>\n }\n </div>\n </div>\n }\n </span>\n </span>\n\n <span class=\"nav\">\n <button\n type=\"button\"\n (click)=\"prevMonth()\">\n <ds-icon\n name=\"chevronLeft\"\n [size]=\"14\">\n </ds-icon>\n </button>\n\n <button\n type=\"button\"\n (click)=\"nextMonth()\">\n <ds-icon\n name=\"chevronRight\"\n [size]=\"14\">\n </ds-icon>\n </button>\n </span>\n </div>\n\n <div\n class=\"grid\"\n role=\"grid\"\n [attr.aria-labelledby]=\"captionId\">\n <div\n class=\"dow-row\"\n role=\"row\">\n @for (dow of weekdays(); track $index) {\n <span\n class=\"dow\"\n role=\"columnheader\"\n [attr.aria-label]=\"weekdaysFull()[$index]\">\n {{ dow }}\n </span>\n }\n </div>\n\n @for (week of weeksGrid(); track $index) {\n <div\n class=\"week\"\n role=\"row\">\n @for (cell of week; track $index) {\n <ds-calendar-day\n [muted]=\"!cell.inMonth\"\n [today]=\"cell.isToday\"\n [selected]=\"cell.isSelected\"\n [inRange]=\"cell.inRange\"\n [rangeStart]=\"cell.isRangeStart\"\n [rangeEnd]=\"cell.isRangeEnd\"\n [disabled]=\"cell.isDisabled\"\n [dataDay]=\"dayKey(cell.date)\"\n [tabIndex]=\"isFocusDay(cell) ? 0 : -1\"\n [ariaLabel]=\"dayLabel(cell)\"\n (daySelected)=\"selectDay(cell)\"\n (dayKeydown)=\"onGridKeydown($event, cell)\">\n {{ cell.day }}\n </ds-calendar-day>\n }\n </div>\n }\n </div>\n </div>\n\n @if (presets().length > 0) {\n <div class=\"presets\">\n @for (preset of presets(); track $index) {\n <button\n type=\"button\"\n class=\"preset-btn\"\n [disabled]=\"isPresetDisabled(preset)\"\n (click)=\"applyPreset(preset); $event.stopPropagation()\">\n {{ preset.label }}\n </button>\n }\n </div>\n }\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_date-picker-focus-shadow: var(--ds-date-picker-focus-shadow, var(--ds-control-focus-shadow));--_date-picker-trigger-bg-color: var(--ds-date-picker-trigger-bg-color, var(--surface-default));--_date-picker-trigger-border-color: var(--ds-date-picker-trigger-border-color, var(--border-default));--_date-picker-trigger-label-color: var(--ds-date-picker-trigger-label-color, var(--text-primary));--_date-picker-required-color: var(--ds-date-picker-required-color, var(--error));--_date-picker-placeholder-color: var(--ds-date-picker-placeholder-color, var(--text-tertiary));--_date-picker-trigger-radius: var(--ds-date-picker-trigger-radius, var(--ds-radius-control));--_date-picker-trigger-pad-x: var(--ds-date-picker-trigger-pad-x, var(--field-pad-x));--_date-picker-value-font-family: var(--ds-date-picker-value-font-family, var(--font-mono));--_date-picker-value-font-size: var(--ds-date-picker-value-font-size, var(--font-size-s));--_date-picker-value-weight: var(--ds-date-picker-value-weight, var(--font-weight-regular));display:block;width:fit-content;max-width:100%}:host(.full-width){width:100%}:host(.full-width) .trigger{width:100%}:host(.full-width) .input-wrap{flex:1}:host(.full-width) .date-input{flex:1}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.field{display:flex;flex-direction:column;align-items:flex-start;gap:var(--field-label-gap);width:100%}.field .label{--_field-label-font-size: var(--ds-field-label-font-size, var(--font-size-xs));--_field-label-weight: var(--ds-field-label-weight, var(--font-weight-bold));--_field-label-color: var(--ds-field-label-color, var(--text-secondary));--_field-label-transform: var(--ds-field-label-transform, none);--_field-label-tracking: var(--ds-field-label-tracking, normal);display:flex;align-items:center;gap:var(--field-gap-req);font:var(--_field-label-weight) var(--_field-label-font-size)/var(--line-height-base) var(--font-sans);color:var(--_field-label-color);text-transform:var(--_field-label-transform);letter-spacing:var(--_field-label-tracking)}.field .label .req{color:var(--_date-picker-required-color);font-weight:var(--font-weight-semibold)}.field .label .optional-marker{color:var(--text-tertiary);font-weight:var(--font-weight-regular)}.trigger{display:inline-flex;align-items:center;gap:var(--space-1);background:var(--_date-picker-trigger-bg-color);border:var(--border-width-default) solid var(--_date-picker-trigger-border-color);border-radius:var(--_date-picker-trigger-radius);padding:0 var(--_date-picker-trigger-pad-x);--_field-box-height: var(--ds-field-height, var(--field-h-md));height:var(--_field-box-height);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--_date-picker-trigger-label-color);cursor:pointer;transition:border-color var(--duration-fast) var(--ease-standard)}.trigger:hover{border-color:var(--border-strong)}.trigger:focus-visible{box-shadow:none}@media not (forced-colors:active){.trigger .date-input:where(:focus-visible){outline:none}}@media not (forced-colors:active){.trigger .calendar-toggle:where(:focus-visible){outline:none}}@media not (forced-colors:active){.trigger:focus-within,.trigger.open{outline:none}}.trigger:focus-within,.trigger.open{box-shadow:var(--_date-picker-focus-shadow)}.trigger.sm{--_field-box-height: var(--ds-field-height, var(--field-h-sm));height:var(--_field-box-height);padding:0 var(--space-2);font-size:var(--font-size-xs)}.trigger.lg{--_field-box-height: var(--ds-field-height, var(--field-h-lg));height:var(--_field-box-height);padding:0 var(--space-4);font-size:var(--font-size-m)}.trigger.disabled,.trigger:disabled{background:var(--surface-disabled);border-color:var(--border-disabled);color:var(--text-disabled);cursor:not-allowed}.input-wrap{position:relative;display:inline-flex;align-items:center}.mask-ghost{display:flex;align-items:center;font:inherit;font-family:var(--_date-picker-value-font-family);font-size:var(--_date-picker-value-font-size);font-weight:var(--_date-picker-value-weight);font-variant-numeric:tabular-nums;white-space:pre;pointer-events:none;overflow:hidden}.mask-ghost .muted{color:var(--_date-picker-placeholder-color)}.date-input{width:auto;border:none;background:transparent;color:inherit;font:inherit;font-family:var(--_date-picker-value-font-family);font-size:var(--_date-picker-value-font-size);font-weight:var(--_date-picker-value-weight);font-variant-numeric:tabular-nums;padding:0}@media not (forced-colors:active){.date-input{outline:none}}.date-input.masked{position:absolute;inset:0;width:100%;color:transparent;caret-color:var(--_date-picker-trigger-label-color)}.date-input:read-only{cursor:pointer}.date-input:disabled{cursor:not-allowed}.calendar-toggle{display:inline-flex;align-items:center;border:none;background:transparent;color:var(--icon-default);padding:0;cursor:pointer}.calendar-toggle:disabled{cursor:not-allowed}.calendar{--_date-picker-bg-color: var(--ds-date-picker-bg-color, var(--surface-overlay));--_date-picker-border: var(--ds-date-picker-border, var(--border-default));--_date-picker-shadow: var(--ds-date-picker-shadow, var(--ds-elevation-overlay));--_date-picker-day-hover-bg-color: var(--ds-date-picker-day-hover-bg-color, var(--surface-secondary));--_date-picker-day-today-label-color: var(--ds-date-picker-day-today-label-color, var(--accent));--_date-picker-day-selected-bg-color: var(--ds-date-picker-day-selected-bg-color, var(--accent));--_date-picker-day-selected-bg-color-hover: var(--ds-date-picker-day-selected-bg-color-hover, var(--accent-hover));--_date-picker-day-selected-label-color: var(--ds-date-picker-day-selected-label-color, var(--accent-on));--_date-picker-day-range-bg-color: var(--ds-date-picker-day-range-bg-color, var(--accent-subtitle));--_date-picker-day-range-label-color: var(--ds-date-picker-day-range-label-color, var(--accent-strong));--_date-picker-day-disabled-label-color: var(--ds-date-picker-day-disabled-label-color, var(--text-disabled));--_date-picker-day-label-color: var(--ds-date-picker-day-label-color, var(--text-primary));--_date-picker-day-muted-label-color: var(--ds-date-picker-day-muted-label-color, var(--text-muted));--_date-picker-weekday-color: var(--ds-date-picker-weekday-color, var(--text-tertiary));--_date-picker-header-label-color: var(--ds-date-picker-header-label-color, var(--text-primary));--_date-picker-nav-icon-color: var(--ds-date-picker-nav-icon-color, var(--icon-default));--_date-picker-width: var(--ds-date-picker-width, var(--date-picker-w));--_date-picker-panel-radius: var(--ds-date-picker-panel-radius, var(--ds-radius-panel));--_date-picker-focus-shadow: var(--ds-date-picker-focus-shadow, var(--ds-control-focus-shadow));background-color:var(--_date-picker-bg-color);border:var(--border-width-default) solid var(--_date-picker-border);border-radius:var(--_date-picker-panel-radius);box-shadow:var(--_date-picker-shadow);padding:var(--space-3);width:var(--_date-picker-width)}.calendar .head{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--space-2)}.calendar .period{display:flex;gap:var(--space-1)}.calendar .period-item{position:relative}.calendar .period-trigger{display:inline-flex;align-items:center;gap:var(--space-1);border:0;background:transparent;padding:var(--space-1) var(--space-1-5);border-radius:var(--ds-radius-inner);font:var(--font-weight-bold) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--_date-picker-header-label-color);cursor:pointer}.calendar .period-trigger:hover{background-color:var(--_date-picker-day-hover-bg-color)}.calendar .period-trigger:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}.calendar .picker-menu{position:absolute;top:calc(100% + var(--space-1));left:0;z-index:1;padding:var(--space-2);width:max-content;min-width:100%;background-color:var(--_date-picker-bg-color);border:var(--border-width-default) solid var(--_date-picker-border);border-radius:var(--radius-md);box-shadow:var(--_date-picker-shadow)}.calendar .picker-head{display:flex;align-items:center;justify-content:space-between;gap:var(--space-2);margin-bottom:var(--space-2)}.calendar .picker-head .picker-nav{width:var(--date-picker-nav-size);height:var(--date-picker-nav-size);border:0;background:transparent;display:grid;place-items:center;color:var(--_date-picker-nav-icon-color);cursor:pointer;border-radius:var(--ds-radius-inner)}.calendar .picker-head .picker-nav:hover:not(:disabled){background-color:var(--_date-picker-day-hover-bg-color)}.calendar .picker-head .picker-nav:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.calendar .picker-head .picker-range{font:var(--font-weight-bold) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--_date-picker-header-label-color)}.calendar .picker-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--space-1)}.calendar .picker-cell{border:0;background:transparent;padding:var(--space-1-5) var(--space-2);border-radius:var(--ds-radius-inner);font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-primary);cursor:pointer;text-align:center;white-space:nowrap}.calendar .picker-cell:hover{background-color:var(--_date-picker-day-hover-bg-color)}.calendar .picker-cell:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}.calendar .picker-cell.selected{background-color:var(--_date-picker-day-selected-bg-color);color:var(--_date-picker-day-selected-label-color);font-weight:var(--font-weight-bold)}.calendar .nav{display:flex;gap:var(--space-1)}.calendar .nav button{width:var(--date-picker-nav-size);height:var(--date-picker-nav-size);border:0;background:transparent;display:grid;place-items:center;color:var(--_date-picker-nav-icon-color);cursor:pointer;border-radius:var(--ds-radius-inner)}.calendar .nav button:hover{background-color:var(--_date-picker-day-hover-bg-color)}.calendar .grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:var(--date-picker-cell-gap)}.calendar .dow-row,.calendar .week{display:contents}.calendar .dow{font:var(--font-weight-bold) var(--font-size-2xs)/var(--line-height-flat) var(--font-sans);text-align:center;padding:var(--space-1) 0;color:var(--_date-picker-weekday-color);text-transform:uppercase;letter-spacing:var(--letter-spacing-wider)}.calendar.has-presets{display:flex;flex-direction:row;gap:var(--space-3);width:auto}.calendar.has-presets .calendar-body{flex:0 0 var(--_date-picker-width);width:var(--_date-picker-width)}.calendar .calendar-body{display:flex;flex-direction:column}.calendar .presets{display:flex;flex-direction:column;gap:var(--space-1);border-left:var(--border-width-default) solid var(--_date-picker-border);padding-left:var(--space-3);min-width:8.5rem}.calendar .preset-btn{display:flex;align-items:center;width:100%;min-height:var(--hit-min);border:0;background:transparent;padding:var(--space-2) var(--space-3);border-radius:var(--ds-radius-inner);font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-primary);cursor:pointer;text-align:left;white-space:nowrap}.calendar .preset-btn:hover:not(:disabled){background-color:var(--_date-picker-day-hover-bg-color)}.calendar .preset-btn:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}.calendar .preset-btn:disabled{color:var(--_date-picker-day-disabled-label-color);cursor:not-allowed}@media(width<640px){.calendar{max-width:calc(100vw - var(--space-4))}.calendar.has-presets{flex-direction:column;width:100%}.calendar.has-presets .calendar-body{flex:1 1 auto;width:100%}.calendar .presets{border-left:0;padding-left:0;border-top:var(--border-width-default) solid var(--_date-picker-border);padding-top:var(--space-3);min-width:0;width:100%}}:host(.in-group){width:auto;display:flex}:host(.in-group) .label,:host(.in-group) ds-field-message{display:none}:host(.in-group) .trigger{border:0;border-radius:0;background:transparent;flex:1;height:auto}:host(.in-group) .trigger:hover,:host(.in-group) .trigger:focus,:host(.in-group) .trigger:focus-visible,:host(.in-group) .trigger:focus-within{border:0;box-shadow:none}@media not (forced-colors:active){:host(.in-group) .trigger:hover,:host(.in-group) .trigger:focus,:host(.in-group) .trigger:focus-visible,:host(.in-group) .trigger:focus-within{outline:none}}:host([data-field-state=error]:not(.in-group)) .trigger{border-color:var(--error);background-color:var(--error-subtitle)}:host([data-field-state=error]:not(.in-group)) .trigger:focus-within,:host([data-field-state=error]:not(.in-group)) .trigger:focus-visible{box-shadow:var(--ds-field-focus-shadow-error)}:host([data-field-state=warning]:not(.in-group)) .trigger{border-color:var(--warning-text)}:host([data-field-state=success]:not(.in-group)) .trigger{border-color:var(--success)}\n"] }]
1224
+ }], ctorParameters: () => [], propDecorators: { mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], optional: [{ type: i0.Input, args: [{ isSignal: true, alias: "optional", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], success: [{ type: i0.Input, args: [{ isSignal: true, alias: "success", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], minYear: [{ type: i0.Input, args: [{ isSignal: true, alias: "minYear", required: false }] }], maxYear: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxYear", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], disabledDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDate", required: false }] }], presets: [{ type: i0.Input, args: [{ isSignal: true, alias: "presets", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], dateFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "dateFormat", required: false }] }], firstDayOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDayOfWeek", required: false }] }], defaultDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultDate", required: false }] }], allowInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowInput", required: false }] }], anchor: [{ type: i0.ViewChild, args: ['anchor', { isSignal: true }] }], inputEl: [{ type: i0.ViewChild, args: ['inputEl', { isSignal: true }] }], panelTpl: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }] } });
1225
+
1226
+ /**
1227
+ * Generated bundle index. Do not edit.
1228
+ */
1229
+
1230
+ export { DatePickerComponent };
1231
+ //# sourceMappingURL=ids-group-ltd-ids-design-system-components-date-picker.mjs.map