@rt-tools/ui-kit-v2 0.23.3 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (354) hide show
  1. package/fesm2022/rt-tools-ui-kit-v2-accordion.mjs +142 -71
  2. package/fesm2022/rt-tools-ui-kit-v2-accordion.mjs.map +1 -1
  3. package/fesm2022/rt-tools-ui-kit-v2-action-bar.mjs +467 -231
  4. package/fesm2022/rt-tools-ui-kit-v2-action-bar.mjs.map +1 -1
  5. package/fesm2022/rt-tools-ui-kit-v2-ai-run-status.mjs +260 -91
  6. package/fesm2022/rt-tools-ui-kit-v2-ai-run-status.mjs.map +1 -1
  7. package/fesm2022/rt-tools-ui-kit-v2-aside-section.mjs +80 -46
  8. package/fesm2022/rt-tools-ui-kit-v2-aside-section.mjs.map +1 -1
  9. package/fesm2022/rt-tools-ui-kit-v2-aside.mjs +984 -697
  10. package/fesm2022/rt-tools-ui-kit-v2-aside.mjs.map +1 -1
  11. package/fesm2022/rt-tools-ui-kit-v2-autocomplete.mjs +452 -210
  12. package/fesm2022/rt-tools-ui-kit-v2-autocomplete.mjs.map +1 -1
  13. package/fesm2022/rt-tools-ui-kit-v2-bar-list.mjs +143 -52
  14. package/fesm2022/rt-tools-ui-kit-v2-bar-list.mjs.map +1 -1
  15. package/fesm2022/rt-tools-ui-kit-v2-bottom-sheet.mjs +158 -83
  16. package/fesm2022/rt-tools-ui-kit-v2-bottom-sheet.mjs.map +1 -1
  17. package/fesm2022/rt-tools-ui-kit-v2-breadcrumbs.mjs +335 -0
  18. package/fesm2022/rt-tools-ui-kit-v2-breadcrumbs.mjs.map +1 -0
  19. package/fesm2022/rt-tools-ui-kit-v2-button.mjs +437 -363
  20. package/fesm2022/rt-tools-ui-kit-v2-button.mjs.map +1 -1
  21. package/fesm2022/rt-tools-ui-kit-v2-calendar.mjs +430 -149
  22. package/fesm2022/rt-tools-ui-kit-v2-calendar.mjs.map +1 -1
  23. package/fesm2022/rt-tools-ui-kit-v2-card.mjs +155 -71
  24. package/fesm2022/rt-tools-ui-kit-v2-card.mjs.map +1 -1
  25. package/fesm2022/rt-tools-ui-kit-v2-carousel.mjs +155 -0
  26. package/fesm2022/rt-tools-ui-kit-v2-carousel.mjs.map +1 -0
  27. package/fesm2022/rt-tools-ui-kit-v2-checkbox.mjs +215 -110
  28. package/fesm2022/rt-tools-ui-kit-v2-checkbox.mjs.map +1 -1
  29. package/fesm2022/rt-tools-ui-kit-v2-collapsible-text.mjs +158 -75
  30. package/fesm2022/rt-tools-ui-kit-v2-collapsible-text.mjs.map +1 -1
  31. package/fesm2022/rt-tools-ui-kit-v2-color-palette.mjs +769 -0
  32. package/fesm2022/rt-tools-ui-kit-v2-color-palette.mjs.map +1 -0
  33. package/fesm2022/rt-tools-ui-kit-v2-confirm-popover.mjs +462 -253
  34. package/fesm2022/rt-tools-ui-kit-v2-confirm-popover.mjs.map +1 -1
  35. package/fesm2022/rt-tools-ui-kit-v2-container.mjs +1276 -1316
  36. package/fesm2022/rt-tools-ui-kit-v2-container.mjs.map +1 -1
  37. package/fesm2022/rt-tools-ui-kit-v2-copy-value.mjs +185 -80
  38. package/fesm2022/rt-tools-ui-kit-v2-copy-value.mjs.map +1 -1
  39. package/fesm2022/rt-tools-ui-kit-v2-core.mjs +2321 -2619
  40. package/fesm2022/rt-tools-ui-kit-v2-core.mjs.map +1 -1
  41. package/fesm2022/rt-tools-ui-kit-v2-counter-row.mjs +100 -44
  42. package/fesm2022/rt-tools-ui-kit-v2-counter-row.mjs.map +1 -1
  43. package/fesm2022/rt-tools-ui-kit-v2-counter.mjs +290 -155
  44. package/fesm2022/rt-tools-ui-kit-v2-counter.mjs.map +1 -1
  45. package/fesm2022/rt-tools-ui-kit-v2-data-list.mjs +2097 -858
  46. package/fesm2022/rt-tools-ui-kit-v2-data-list.mjs.map +1 -1
  47. package/fesm2022/rt-tools-ui-kit-v2-data-table.mjs +2247 -1176
  48. package/fesm2022/rt-tools-ui-kit-v2-data-table.mjs.map +1 -1
  49. package/fesm2022/rt-tools-ui-kit-v2-date-picker.mjs +1043 -705
  50. package/fesm2022/rt-tools-ui-kit-v2-date-picker.mjs.map +1 -1
  51. package/fesm2022/rt-tools-ui-kit-v2-date-range.mjs +810 -525
  52. package/fesm2022/rt-tools-ui-kit-v2-date-range.mjs.map +1 -1
  53. package/fesm2022/rt-tools-ui-kit-v2-delta-view.mjs +158 -138
  54. package/fesm2022/rt-tools-ui-kit-v2-delta-view.mjs.map +1 -1
  55. package/fesm2022/rt-tools-ui-kit-v2-detail-list.mjs +177 -67
  56. package/fesm2022/rt-tools-ui-kit-v2-detail-list.mjs.map +1 -1
  57. package/fesm2022/rt-tools-ui-kit-v2-dialog.mjs +550 -477
  58. package/fesm2022/rt-tools-ui-kit-v2-dialog.mjs.map +1 -1
  59. package/fesm2022/rt-tools-ui-kit-v2-dot-field.mjs +185 -168
  60. package/fesm2022/rt-tools-ui-kit-v2-dot-field.mjs.map +1 -1
  61. package/fesm2022/rt-tools-ui-kit-v2-download-link.mjs +116 -43
  62. package/fesm2022/rt-tools-ui-kit-v2-download-link.mjs.map +1 -1
  63. package/fesm2022/rt-tools-ui-kit-v2-draggable-tree.mjs +585 -0
  64. package/fesm2022/rt-tools-ui-kit-v2-draggable-tree.mjs.map +1 -0
  65. package/fesm2022/rt-tools-ui-kit-v2-dynamic-list.mjs +755 -259
  66. package/fesm2022/rt-tools-ui-kit-v2-dynamic-list.mjs.map +1 -1
  67. package/fesm2022/rt-tools-ui-kit-v2-dynamic-selector.mjs +3266 -1115
  68. package/fesm2022/rt-tools-ui-kit-v2-dynamic-selector.mjs.map +1 -1
  69. package/fesm2022/rt-tools-ui-kit-v2-empty-state.mjs +190 -55
  70. package/fesm2022/rt-tools-ui-kit-v2-empty-state.mjs.map +1 -1
  71. package/fesm2022/rt-tools-ui-kit-v2-expansion-panel.mjs +283 -103
  72. package/fesm2022/rt-tools-ui-kit-v2-expansion-panel.mjs.map +1 -1
  73. package/fesm2022/rt-tools-ui-kit-v2-field.mjs +393 -177
  74. package/fesm2022/rt-tools-ui-kit-v2-field.mjs.map +1 -1
  75. package/fesm2022/rt-tools-ui-kit-v2-file-card.mjs +399 -207
  76. package/fesm2022/rt-tools-ui-kit-v2-file-card.mjs.map +1 -1
  77. package/fesm2022/rt-tools-ui-kit-v2-file-drop.mjs +288 -212
  78. package/fesm2022/rt-tools-ui-kit-v2-file-drop.mjs.map +1 -1
  79. package/fesm2022/rt-tools-ui-kit-v2-file-input.mjs +262 -116
  80. package/fesm2022/rt-tools-ui-kit-v2-file-input.mjs.map +1 -1
  81. package/fesm2022/rt-tools-ui-kit-v2-file-list.mjs +57 -31
  82. package/fesm2022/rt-tools-ui-kit-v2-file-list.mjs.map +1 -1
  83. package/fesm2022/rt-tools-ui-kit-v2-filter-control.mjs +258 -90
  84. package/fesm2022/rt-tools-ui-kit-v2-filter-control.mjs.map +1 -1
  85. package/fesm2022/rt-tools-ui-kit-v2-form-control.mjs +249 -215
  86. package/fesm2022/rt-tools-ui-kit-v2-form-control.mjs.map +1 -1
  87. package/fesm2022/rt-tools-ui-kit-v2-header.mjs +199 -71
  88. package/fesm2022/rt-tools-ui-kit-v2-header.mjs.map +1 -1
  89. package/fesm2022/rt-tools-ui-kit-v2-hybrid-tree-selector.mjs +231 -0
  90. package/fesm2022/rt-tools-ui-kit-v2-hybrid-tree-selector.mjs.map +1 -0
  91. package/fesm2022/rt-tools-ui-kit-v2-hybrid-tree.mjs +336 -0
  92. package/fesm2022/rt-tools-ui-kit-v2-hybrid-tree.mjs.map +1 -0
  93. package/fesm2022/rt-tools-ui-kit-v2-icon-button.mjs +451 -162
  94. package/fesm2022/rt-tools-ui-kit-v2-icon-button.mjs.map +1 -1
  95. package/fesm2022/rt-tools-ui-kit-v2-icon.mjs +931 -686
  96. package/fesm2022/rt-tools-ui-kit-v2-icon.mjs.map +1 -1
  97. package/fesm2022/rt-tools-ui-kit-v2-image-cropper.mjs +664 -491
  98. package/fesm2022/rt-tools-ui-kit-v2-image-cropper.mjs.map +1 -1
  99. package/fesm2022/rt-tools-ui-kit-v2-image-upload.mjs +574 -222
  100. package/fesm2022/rt-tools-ui-kit-v2-image-upload.mjs.map +1 -1
  101. package/fesm2022/rt-tools-ui-kit-v2-info-item.mjs +150 -36
  102. package/fesm2022/rt-tools-ui-kit-v2-info-item.mjs.map +1 -1
  103. package/fesm2022/rt-tools-ui-kit-v2-inline-edit.mjs +606 -0
  104. package/fesm2022/rt-tools-ui-kit-v2-inline-edit.mjs.map +1 -0
  105. package/fesm2022/rt-tools-ui-kit-v2-input-number.mjs +461 -355
  106. package/fesm2022/rt-tools-ui-kit-v2-input-number.mjs.map +1 -1
  107. package/fesm2022/rt-tools-ui-kit-v2-input.mjs +338 -143
  108. package/fesm2022/rt-tools-ui-kit-v2-input.mjs.map +1 -1
  109. package/fesm2022/rt-tools-ui-kit-v2-live-badge.mjs +135 -48
  110. package/fesm2022/rt-tools-ui-kit-v2-live-badge.mjs.map +1 -1
  111. package/fesm2022/rt-tools-ui-kit-v2-logo.mjs +166 -92
  112. package/fesm2022/rt-tools-ui-kit-v2-logo.mjs.map +1 -1
  113. package/fesm2022/rt-tools-ui-kit-v2-markdown-text.mjs +118 -56
  114. package/fesm2022/rt-tools-ui-kit-v2-markdown-text.mjs.map +1 -1
  115. package/fesm2022/rt-tools-ui-kit-v2-menu.mjs +1054 -527
  116. package/fesm2022/rt-tools-ui-kit-v2-menu.mjs.map +1 -1
  117. package/fesm2022/rt-tools-ui-kit-v2-message.mjs +230 -104
  118. package/fesm2022/rt-tools-ui-kit-v2-message.mjs.map +1 -1
  119. package/fesm2022/rt-tools-ui-kit-v2-money-list.mjs +210 -70
  120. package/fesm2022/rt-tools-ui-kit-v2-money-list.mjs.map +1 -1
  121. package/fesm2022/rt-tools-ui-kit-v2-multiselect.mjs +532 -311
  122. package/fesm2022/rt-tools-ui-kit-v2-multiselect.mjs.map +1 -1
  123. package/fesm2022/rt-tools-ui-kit-v2-night-grid.mjs +125 -50
  124. package/fesm2022/rt-tools-ui-kit-v2-night-grid.mjs.map +1 -1
  125. package/fesm2022/rt-tools-ui-kit-v2-note.mjs +73 -43
  126. package/fesm2022/rt-tools-ui-kit-v2-note.mjs.map +1 -1
  127. package/fesm2022/rt-tools-ui-kit-v2-notifications-bell.mjs +161 -53
  128. package/fesm2022/rt-tools-ui-kit-v2-notifications-bell.mjs.map +1 -1
  129. package/fesm2022/rt-tools-ui-kit-v2-page-header.mjs +491 -310
  130. package/fesm2022/rt-tools-ui-kit-v2-page-header.mjs.map +1 -1
  131. package/fesm2022/rt-tools-ui-kit-v2-pagination.mjs +374 -174
  132. package/fesm2022/rt-tools-ui-kit-v2-pagination.mjs.map +1 -1
  133. package/fesm2022/rt-tools-ui-kit-v2-photo-viewer.mjs +202 -159
  134. package/fesm2022/rt-tools-ui-kit-v2-photo-viewer.mjs.map +1 -1
  135. package/fesm2022/rt-tools-ui-kit-v2-popover.mjs +438 -309
  136. package/fesm2022/rt-tools-ui-kit-v2-popover.mjs.map +1 -1
  137. package/fesm2022/rt-tools-ui-kit-v2-profile-menu.mjs +295 -0
  138. package/fesm2022/rt-tools-ui-kit-v2-profile-menu.mjs.map +1 -0
  139. package/fesm2022/rt-tools-ui-kit-v2-prompt-suggestion.mjs +135 -45
  140. package/fesm2022/rt-tools-ui-kit-v2-prompt-suggestion.mjs.map +1 -1
  141. package/fesm2022/rt-tools-ui-kit-v2-radio-button.mjs +293 -171
  142. package/fesm2022/rt-tools-ui-kit-v2-radio-button.mjs.map +1 -1
  143. package/fesm2022/rt-tools-ui-kit-v2-radius.mjs +62 -55
  144. package/fesm2022/rt-tools-ui-kit-v2-radius.mjs.map +1 -1
  145. package/fesm2022/rt-tools-ui-kit-v2-rich-editor.mjs +3379 -1466
  146. package/fesm2022/rt-tools-ui-kit-v2-rich-editor.mjs.map +1 -1
  147. package/fesm2022/rt-tools-ui-kit-v2-ripple.mjs +114 -116
  148. package/fesm2022/rt-tools-ui-kit-v2-ripple.mjs.map +1 -1
  149. package/fesm2022/rt-tools-ui-kit-v2-scroll-area.mjs +406 -299
  150. package/fesm2022/rt-tools-ui-kit-v2-scroll-area.mjs.map +1 -1
  151. package/fesm2022/rt-tools-ui-kit-v2-section-nav.mjs +137 -36
  152. package/fesm2022/rt-tools-ui-kit-v2-section-nav.mjs.map +1 -1
  153. package/fesm2022/rt-tools-ui-kit-v2-select.mjs +687 -468
  154. package/fesm2022/rt-tools-ui-kit-v2-select.mjs.map +1 -1
  155. package/fesm2022/rt-tools-ui-kit-v2-side-menu.mjs +2195 -1569
  156. package/fesm2022/rt-tools-ui-kit-v2-side-menu.mjs.map +1 -1
  157. package/fesm2022/rt-tools-ui-kit-v2-skeleton-wrapper.mjs +187 -48
  158. package/fesm2022/rt-tools-ui-kit-v2-skeleton-wrapper.mjs.map +1 -1
  159. package/fesm2022/rt-tools-ui-kit-v2-skeleton.mjs +242 -122
  160. package/fesm2022/rt-tools-ui-kit-v2-skeleton.mjs.map +1 -1
  161. package/fesm2022/rt-tools-ui-kit-v2-speed-menu.mjs +439 -0
  162. package/fesm2022/rt-tools-ui-kit-v2-speed-menu.mjs.map +1 -0
  163. package/fesm2022/rt-tools-ui-kit-v2-spinner.mjs +218 -69
  164. package/fesm2022/rt-tools-ui-kit-v2-spinner.mjs.map +1 -1
  165. package/fesm2022/rt-tools-ui-kit-v2-split-button.mjs +292 -91
  166. package/fesm2022/rt-tools-ui-kit-v2-split-button.mjs.map +1 -1
  167. package/fesm2022/rt-tools-ui-kit-v2-stat-tile.mjs +225 -138
  168. package/fesm2022/rt-tools-ui-kit-v2-stat-tile.mjs.map +1 -1
  169. package/fesm2022/rt-tools-ui-kit-v2-stepper.mjs +150 -116
  170. package/fesm2022/rt-tools-ui-kit-v2-stepper.mjs.map +1 -1
  171. package/fesm2022/rt-tools-ui-kit-v2-table.mjs +2462 -1583
  172. package/fesm2022/rt-tools-ui-kit-v2-table.mjs.map +1 -1
  173. package/fesm2022/rt-tools-ui-kit-v2-tabs.mjs +647 -346
  174. package/fesm2022/rt-tools-ui-kit-v2-tabs.mjs.map +1 -1
  175. package/fesm2022/rt-tools-ui-kit-v2-tag.mjs +335 -121
  176. package/fesm2022/rt-tools-ui-kit-v2-tag.mjs.map +1 -1
  177. package/fesm2022/rt-tools-ui-kit-v2-textarea.mjs +217 -84
  178. package/fesm2022/rt-tools-ui-kit-v2-textarea.mjs.map +1 -1
  179. package/fesm2022/rt-tools-ui-kit-v2-theme-toggle.mjs +151 -72
  180. package/fesm2022/rt-tools-ui-kit-v2-theme-toggle.mjs.map +1 -1
  181. package/fesm2022/rt-tools-ui-kit-v2-thread-list.mjs +697 -226
  182. package/fesm2022/rt-tools-ui-kit-v2-thread-list.mjs.map +1 -1
  183. package/fesm2022/rt-tools-ui-kit-v2-timeline.mjs +92 -38
  184. package/fesm2022/rt-tools-ui-kit-v2-timeline.mjs.map +1 -1
  185. package/fesm2022/rt-tools-ui-kit-v2-toast.mjs +752 -338
  186. package/fesm2022/rt-tools-ui-kit-v2-toast.mjs.map +1 -1
  187. package/fesm2022/rt-tools-ui-kit-v2-toggle-button-group.mjs +310 -129
  188. package/fesm2022/rt-tools-ui-kit-v2-toggle-button-group.mjs.map +1 -1
  189. package/fesm2022/rt-tools-ui-kit-v2-toggle-switch.mjs +286 -158
  190. package/fesm2022/rt-tools-ui-kit-v2-toggle-switch.mjs.map +1 -1
  191. package/fesm2022/rt-tools-ui-kit-v2-toolbar.mjs +270 -134
  192. package/fesm2022/rt-tools-ui-kit-v2-toolbar.mjs.map +1 -1
  193. package/fesm2022/rt-tools-ui-kit-v2-tooltip.mjs +322 -202
  194. package/fesm2022/rt-tools-ui-kit-v2-tooltip.mjs.map +1 -1
  195. package/fesm2022/rt-tools-ui-kit-v2-tree-selector.mjs +908 -0
  196. package/fesm2022/rt-tools-ui-kit-v2-tree-selector.mjs.map +1 -0
  197. package/fesm2022/rt-tools-ui-kit-v2-tree.mjs +785 -0
  198. package/fesm2022/rt-tools-ui-kit-v2-tree.mjs.map +1 -0
  199. package/fesm2022/rt-tools-ui-kit-v2-welcome-dialog.mjs +118 -63
  200. package/fesm2022/rt-tools-ui-kit-v2-welcome-dialog.mjs.map +1 -1
  201. package/fesm2022/rt-tools-ui-kit-v2-workspace-details.mjs +783 -262
  202. package/fesm2022/rt-tools-ui-kit-v2-workspace-details.mjs.map +1 -1
  203. package/fesm2022/rt-tools-ui-kit-v2-workspace.mjs +633 -294
  204. package/fesm2022/rt-tools-ui-kit-v2-workspace.mjs.map +1 -1
  205. package/fesm2022/rt-tools-ui-kit-v2.mjs +100 -103
  206. package/package.json +45 -1
  207. package/src/assets/icons/collapse-all.svg +9 -0
  208. package/src/assets/icons/expand-all.svg +9 -0
  209. package/src/assets/icons-material/collapse-all.fill.svg +5 -0
  210. package/src/assets/icons-material/collapse-all.svg +5 -0
  211. package/src/assets/icons-material/expand-all.fill.svg +5 -0
  212. package/src/assets/icons-material/expand-all.svg +5 -0
  213. package/src/assets/icons-material/undo.fill.svg +5 -0
  214. package/src/assets/icons-material/undo.svg +5 -0
  215. package/src/lib/components/bottom-sheet/CONTEXT.md +20 -2
  216. package/src/lib/components/bottom-sheet/rt-bottom-sheet.component.scss +36 -1
  217. package/src/lib/components/breadcrumbs/CONTEXT.md +37 -0
  218. package/src/lib/components/breadcrumbs/rt-breadcrumbs.component.scss +205 -0
  219. package/src/lib/components/carousel/CONTEXT.md +42 -0
  220. package/src/lib/components/carousel/rt-carousel.component.scss +117 -0
  221. package/src/lib/components/checkbox/CONTEXT.md +3 -0
  222. package/src/lib/components/checkbox/rt-checkbox.component.scss +9 -3
  223. package/src/lib/components/color-palette/CONTEXT.md +49 -0
  224. package/src/lib/components/color-palette/picker/rt-color-picker.component.scss +161 -0
  225. package/src/lib/components/color-palette/rt-color-palette.component.scss +132 -0
  226. package/src/lib/components/draggable-tree/CONTEXT.md +54 -0
  227. package/src/lib/components/draggable-tree/rt-draggable-tree.component.scss +219 -0
  228. package/src/lib/components/hybrid-tree/CONTEXT.md +31 -0
  229. package/src/lib/components/hybrid-tree-selector/CONTEXT.md +25 -0
  230. package/src/lib/components/icon-button/CONTEXT.md +3 -0
  231. package/src/lib/components/inline-edit/CONTEXT.md +41 -0
  232. package/src/lib/components/inline-edit/rt-inline-edit.component.scss +274 -0
  233. package/src/lib/components/popover/CONTEXT.md +3 -0
  234. package/src/lib/components/profile-menu/CONTEXT.md +32 -0
  235. package/src/lib/components/profile-menu/rt-profile-menu.component.scss +104 -0
  236. package/src/lib/components/speed-menu/CONTEXT.md +34 -0
  237. package/src/lib/components/speed-menu/rt-speed-menu.component.scss +118 -0
  238. package/src/lib/components/tag/rt-tag.component.scss +12 -0
  239. package/src/lib/components/thread-list/CONTEXT.md +1 -0
  240. package/src/lib/components/thread-list/rt-thread-list.component.scss +2 -1
  241. package/src/lib/components/toolbar/CONTEXT.md +9 -4
  242. package/src/lib/components/toolbar/rt-toolbar.component.scss +10 -2
  243. package/src/lib/components/tooltip/CONTEXT.md +8 -1
  244. package/src/lib/components/tree/CONTEXT.md +66 -0
  245. package/src/lib/components/tree/rt-tree.component.scss +313 -0
  246. package/src/lib/components/tree-selector/CONTEXT.md +47 -0
  247. package/src/lib/components/tree-selector/rt-tree-selector.component.scss +121 -0
  248. package/src/styles/_primitives.scss +4 -0
  249. package/src/styles/_semantic.scss +5 -0
  250. package/styles/tokens.css +43 -0
  251. package/types/rt-tools-ui-kit-v2-accordion.d.ts +31 -24
  252. package/types/rt-tools-ui-kit-v2-action-bar.d.ts +112 -91
  253. package/types/rt-tools-ui-kit-v2-ai-run-status.d.ts +64 -40
  254. package/types/rt-tools-ui-kit-v2-aside-section.d.ts +13 -10
  255. package/types/rt-tools-ui-kit-v2-aside.d.ts +268 -206
  256. package/types/rt-tools-ui-kit-v2-autocomplete.d.ts +102 -61
  257. package/types/rt-tools-ui-kit-v2-bar-list.d.ts +39 -27
  258. package/types/rt-tools-ui-kit-v2-bottom-sheet.d.ts +31 -20
  259. package/types/rt-tools-ui-kit-v2-breadcrumbs.d.ts +89 -0
  260. package/types/rt-tools-ui-kit-v2-button.d.ts +119 -59
  261. package/types/rt-tools-ui-kit-v2-calendar.d.ts +151 -86
  262. package/types/rt-tools-ui-kit-v2-card.d.ts +42 -21
  263. package/types/rt-tools-ui-kit-v2-carousel.d.ts +76 -0
  264. package/types/rt-tools-ui-kit-v2-checkbox.d.ts +48 -24
  265. package/types/rt-tools-ui-kit-v2-collapsible-text.d.ts +28 -20
  266. package/types/rt-tools-ui-kit-v2-color-palette.d.ts +208 -0
  267. package/types/rt-tools-ui-kit-v2-confirm-popover.d.ts +104 -47
  268. package/types/rt-tools-ui-kit-v2-container.d.ts +278 -221
  269. package/types/rt-tools-ui-kit-v2-copy-value.d.ts +39 -24
  270. package/types/rt-tools-ui-kit-v2-core.d.ts +862 -865
  271. package/types/rt-tools-ui-kit-v2-counter-row.d.ts +20 -12
  272. package/types/rt-tools-ui-kit-v2-counter.d.ts +70 -38
  273. package/types/rt-tools-ui-kit-v2-data-list.d.ts +429 -264
  274. package/types/rt-tools-ui-kit-v2-data-table.d.ts +500 -351
  275. package/types/rt-tools-ui-kit-v2-date-picker.d.ts +164 -138
  276. package/types/rt-tools-ui-kit-v2-date-range.d.ts +102 -84
  277. package/types/rt-tools-ui-kit-v2-delta-view.d.ts +16 -13
  278. package/types/rt-tools-ui-kit-v2-detail-list.d.ts +23 -16
  279. package/types/rt-tools-ui-kit-v2-dialog.d.ts +130 -101
  280. package/types/rt-tools-ui-kit-v2-dot-field.d.ts +10 -13
  281. package/types/rt-tools-ui-kit-v2-download-link.d.ts +22 -17
  282. package/types/rt-tools-ui-kit-v2-draggable-tree.d.ts +132 -0
  283. package/types/rt-tools-ui-kit-v2-dynamic-list.d.ts +185 -96
  284. package/types/rt-tools-ui-kit-v2-dynamic-selector.d.ts +904 -404
  285. package/types/rt-tools-ui-kit-v2-empty-state.d.ts +48 -19
  286. package/types/rt-tools-ui-kit-v2-expansion-panel.d.ts +67 -39
  287. package/types/rt-tools-ui-kit-v2-field.d.ts +90 -49
  288. package/types/rt-tools-ui-kit-v2-file-card.d.ts +115 -75
  289. package/types/rt-tools-ui-kit-v2-file-drop.d.ts +75 -48
  290. package/types/rt-tools-ui-kit-v2-file-input.d.ts +53 -36
  291. package/types/rt-tools-ui-kit-v2-file-list.d.ts +5 -8
  292. package/types/rt-tools-ui-kit-v2-filter-control.d.ts +83 -49
  293. package/types/rt-tools-ui-kit-v2-form-control.d.ts +102 -74
  294. package/types/rt-tools-ui-kit-v2-header.d.ts +40 -22
  295. package/types/rt-tools-ui-kit-v2-hybrid-tree-selector.d.ts +14 -0
  296. package/types/rt-tools-ui-kit-v2-hybrid-tree.d.ts +72 -0
  297. package/types/rt-tools-ui-kit-v2-icon-button.d.ts +190 -90
  298. package/types/rt-tools-ui-kit-v2-icon.d.ts +160 -129
  299. package/types/rt-tools-ui-kit-v2-image-cropper.d.ts +151 -111
  300. package/types/rt-tools-ui-kit-v2-image-upload.d.ts +159 -85
  301. package/types/rt-tools-ui-kit-v2-info-item.d.ts +26 -13
  302. package/types/rt-tools-ui-kit-v2-inline-edit.d.ts +194 -0
  303. package/types/rt-tools-ui-kit-v2-input-number.d.ts +102 -53
  304. package/types/rt-tools-ui-kit-v2-input.d.ts +82 -43
  305. package/types/rt-tools-ui-kit-v2-live-badge.d.ts +30 -17
  306. package/types/rt-tools-ui-kit-v2-logo.d.ts +49 -32
  307. package/types/rt-tools-ui-kit-v2-markdown-text.d.ts +26 -17
  308. package/types/rt-tools-ui-kit-v2-menu.d.ts +272 -155
  309. package/types/rt-tools-ui-kit-v2-message.d.ts +59 -33
  310. package/types/rt-tools-ui-kit-v2-money-list.d.ts +36 -18
  311. package/types/rt-tools-ui-kit-v2-multiselect.d.ts +114 -80
  312. package/types/rt-tools-ui-kit-v2-night-grid.d.ts +34 -25
  313. package/types/rt-tools-ui-kit-v2-note.d.ts +12 -9
  314. package/types/rt-tools-ui-kit-v2-notifications-bell.d.ts +37 -16
  315. package/types/rt-tools-ui-kit-v2-page-header.d.ts +218 -150
  316. package/types/rt-tools-ui-kit-v2-pagination.d.ts +99 -63
  317. package/types/rt-tools-ui-kit-v2-photo-viewer.d.ts +61 -66
  318. package/types/rt-tools-ui-kit-v2-popover.d.ts +116 -55
  319. package/types/rt-tools-ui-kit-v2-profile-menu.d.ts +103 -0
  320. package/types/rt-tools-ui-kit-v2-prompt-suggestion.d.ts +26 -16
  321. package/types/rt-tools-ui-kit-v2-radio-button.d.ts +85 -43
  322. package/types/rt-tools-ui-kit-v2-radius.d.ts +18 -15
  323. package/types/rt-tools-ui-kit-v2-rich-editor.d.ts +931 -590
  324. package/types/rt-tools-ui-kit-v2-ripple.d.ts +28 -25
  325. package/types/rt-tools-ui-kit-v2-scroll-area.d.ts +60 -58
  326. package/types/rt-tools-ui-kit-v2-section-nav.d.ts +32 -22
  327. package/types/rt-tools-ui-kit-v2-select.d.ts +182 -139
  328. package/types/rt-tools-ui-kit-v2-side-menu.d.ts +452 -349
  329. package/types/rt-tools-ui-kit-v2-skeleton-wrapper.d.ts +53 -20
  330. package/types/rt-tools-ui-kit-v2-skeleton.d.ts +55 -26
  331. package/types/rt-tools-ui-kit-v2-speed-menu.d.ts +131 -0
  332. package/types/rt-tools-ui-kit-v2-spinner.d.ts +56 -28
  333. package/types/rt-tools-ui-kit-v2-split-button.d.ts +96 -55
  334. package/types/rt-tools-ui-kit-v2-stat-tile.d.ts +88 -60
  335. package/types/rt-tools-ui-kit-v2-stepper.d.ts +50 -37
  336. package/types/rt-tools-ui-kit-v2-table.d.ts +631 -480
  337. package/types/rt-tools-ui-kit-v2-tabs.d.ts +198 -113
  338. package/types/rt-tools-ui-kit-v2-tag.d.ts +106 -53
  339. package/types/rt-tools-ui-kit-v2-textarea.d.ts +48 -25
  340. package/types/rt-tools-ui-kit-v2-theme-toggle.d.ts +28 -26
  341. package/types/rt-tools-ui-kit-v2-thread-list.d.ts +154 -94
  342. package/types/rt-tools-ui-kit-v2-timeline.d.ts +30 -28
  343. package/types/rt-tools-ui-kit-v2-toast.d.ts +174 -98
  344. package/types/rt-tools-ui-kit-v2-toggle-button-group.d.ts +132 -86
  345. package/types/rt-tools-ui-kit-v2-toggle-switch.d.ts +88 -50
  346. package/types/rt-tools-ui-kit-v2-toolbar.d.ts +30 -27
  347. package/types/rt-tools-ui-kit-v2-tooltip.d.ts +65 -41
  348. package/types/rt-tools-ui-kit-v2-tree-selector.d.ts +257 -0
  349. package/types/rt-tools-ui-kit-v2-tree.d.ts +282 -0
  350. package/types/rt-tools-ui-kit-v2-welcome-dialog.d.ts +21 -24
  351. package/types/rt-tools-ui-kit-v2-workspace-details.d.ts +195 -124
  352. package/types/rt-tools-ui-kit-v2-workspace.d.ts +122 -79
  353. package/types/rt-tools-ui-kit-v2.d.ts +100 -90
  354. package/fesm2022/rt-tools-ui-kit-v2.mjs.map +0 -1
@@ -1,779 +1,1117 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, computed, viewChildren, signal, linkedSignal, input, numberAttribute, booleanAttribute, output, afterRenderEffect, ViewEncapsulation, ChangeDetectionStrategy, Component, viewChild, forwardRef } from '@angular/core';
3
- import { BlockDirective, ElemDirective, ModDirective } from '@rt-tools/core';
4
- import { RT_KIT_LOCALE, RT_KIT_LABELS, BreakpointsService } from '@rt-tools/ui-kit-v2/core';
5
- import { RtBottomSheetComponent } from '@rt-tools/ui-kit-v2/bottom-sheet';
6
- import { RtFormControlBase } from '@rt-tools/ui-kit-v2/form-control';
7
- import { RtIconButtonComponent } from '@rt-tools/ui-kit-v2/icon-button';
8
- import { RtPopoverDirective } from '@rt-tools/ui-kit-v2/popover';
9
- import * as i1 from '@rt-tools/ui-kit-v2/radius';
10
- import { RtRadiusDirective } from '@rt-tools/ui-kit-v2/radius';
11
- import { RtButtonDirective } from '@rt-tools/ui-kit-v2/button';
12
- import { ERtCalendarDayState, RtCalendarComponent } from '@rt-tools/ui-kit-v2/calendar';
13
- import { RtToggleButtonGroupComponent } from '@rt-tools/ui-kit-v2/toggle-button-group';
14
-
15
- /**
16
- * Чистая логика панели rt-date-picker: чтение и запись значения, месяц, границы, колонки времени
17
- * и клавиши сетки. Текущий момент приходит параметром — компонент читает часы на своей границе.
18
- *
19
- * Значения — строки формы нативного input'а: `YYYY-MM-DD`, `HH:mm`, `YYYY-MM-DDTHH:mm`. Строки
20
- * одной формы сравниваются как текст, поэтому границы сравниваются обрезанными до длины значения.
21
- */
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, ViewEncapsulation, afterRenderEffect, booleanAttribute, computed, forwardRef, inject, input, linkedSignal, numberAttribute, output, signal, viewChild, viewChildren } from "@angular/core";
3
+ import { BlockDirective, ElemDirective, ModDirective } from "@rt-tools/core";
4
+ import { BreakpointsService, RT_KIT_LABELS, RT_KIT_LOCALE } from "@rt-tools/ui-kit-v2/core";
5
+ import { RtBottomSheetComponent } from "@rt-tools/ui-kit-v2/bottom-sheet";
6
+ import { RtFormControlBase } from "@rt-tools/ui-kit-v2/form-control";
7
+ import { RtIconButtonComponent } from "@rt-tools/ui-kit-v2/icon-button";
8
+ import { RtPopoverDirective } from "@rt-tools/ui-kit-v2/popover";
9
+ import * as i1 from "@rt-tools/ui-kit-v2/radius";
10
+ import { RtRadiusDirective } from "@rt-tools/ui-kit-v2/radius";
11
+ import { RtButtonDirective } from "@rt-tools/ui-kit-v2/button";
12
+ import { ERtCalendarDayState, RtCalendarComponent } from "@rt-tools/ui-kit-v2/calendar";
13
+ import { RtToggleButtonGroupComponent } from "@rt-tools/ui-kit-v2/toggle-button-group";
22
14
  const DAY_RE = /^(\d{4})-(\d{2})-(\d{2})$/;
23
15
  const TIME_RE = /^(\d{2}):(\d{2})$/;
24
- const DAY_LENGTH_MS = 86_400_000;
16
+ const DAY_LENGTH_MS = 864e5;
25
17
  const WEEK = 7;
26
18
  const DAY_LEN = 10;
27
19
  const MONTH_LEN$1 = 7;
28
20
  const TIME_LEN = 5;
29
- /** Числа строки даты или времени: `2026-09-29` → `[2026, 9, 29]`. */
30
21
  function nums(text) {
31
- return text.split(/\D/).map(Number);
22
+ return text.split(/\D/).map(Number);
32
23
  }
33
- /**
34
- * Строка формы значения как число: `2026-09-29T10:05` → `202609291005`. Строки одной формы
35
- * сравниваются по этому числу так же, как по порядку дат.
36
- */
37
24
  function rank(text) {
38
- return Number(text.replace(/\D/g, ''));
25
+ return Number(text.replace(/\D/g, ""));
39
26
  }
40
27
  function pad(value) {
41
- return String(value).padStart(2, '0');
28
+ return String(value).padStart(2, "0");
42
29
  }
43
30
  function dayToMs(day) {
44
- const [y, m, d] = nums(day);
45
- return Date.UTC(y, m - 1, d);
31
+ const [y, m, d] = nums(day);
32
+ return Date.UTC(y, m - 1, d);
46
33
  }
47
34
  function msToDay(ms) {
48
- const date = new Date(ms);
49
- return `${date.getUTCFullYear()}-${pad(date.getUTCMonth() + 1)}-${pad(date.getUTCDate())}`;
35
+ const date = new Date(ms);
36
+ return `${date.getUTCFullYear()}-${pad(date.getUTCMonth() + 1)}-${pad(date.getUTCDate())}`;
50
37
  }
51
38
  function daysInMonth(year, month) {
52
- return new Date(Date.UTC(year, month, 0)).getUTCDate();
39
+ return new Date(Date.UTC(year, month, 0)).getUTCDate();
53
40
  }
54
41
  function isDay(text) {
55
- const match = DAY_RE.exec(text);
56
- if (match === null) {
57
- return false;
58
- }
59
- const month = Number(match[2]);
60
- const day = Number(match[3]);
61
- return month >= 1 && month <= 12 && day >= 1 && day <= daysInMonth(Number(match[1]), month);
42
+ const match = DAY_RE.exec(text);
43
+ if (match === null) return false;
44
+ const month = Number(match[2]);
45
+ const day = Number(match[3]);
46
+ return month >= 1 && month <= 12 && day >= 1 && day <= daysInMonth(Number(match[1]), month);
62
47
  }
63
48
  function isTime(text) {
64
- const match = TIME_RE.exec(text);
65
- return match !== null && Number(match[1]) < 24 && Number(match[2]) < 60;
49
+ const match = TIME_RE.exec(text);
50
+ return match !== null && Number(match[1]) < 24 && Number(match[2]) < 60;
66
51
  }
67
- /** Время `HH:mm` из часа и минуты. */
68
52
  function rtDateTime(hour, minute) {
69
- return `${pad(hour)}:${pad(minute)}`;
53
+ return `${pad(hour)}:${pad(minute)}`;
70
54
  }
71
- /** Первый день недели локали: 1 — понедельник … 7 — воскресенье. */
72
55
  function rtDateFirstDay(locale) {
73
- const info = new Intl.Locale(locale);
74
- return (info.getWeekInfo?.() ?? info.weekInfo)?.firstDay ?? 1;
56
+ const info = new Intl.Locale(locale);
57
+ return (info.getWeekInfo?.() ?? info.weekInfo)?.firstDay ?? 1;
75
58
  }
76
- /** Читает текст формы значения; `null` — текст не значение этого типа. */
77
59
  function rtDateRead(text, type) {
78
- const value = text.trim();
79
- if (type === 'date') {
80
- return isDay(value) ? value : null;
81
- }
82
- if (type === 'time') {
83
- return isTime(value) ? value : null;
84
- }
85
- const parts = value.split('T');
86
- return parts.length === 2 && isDay(parts[0]) && isTime(parts[1]) ? value : null;
87
- }
88
- /** Собирает значение типа из дня и времени; без нужной части — пустая строка. */
60
+ const value = text.trim();
61
+ if (type === "date") return isDay(value) ? value : null;
62
+ if (type === "time") return isTime(value) ? value : null;
63
+ const parts = value.split("T");
64
+ return parts.length === 2 && isDay(parts[0]) && isTime(parts[1]) ? value : null;
65
+ }
89
66
  function rtDateWrite(type, day, time) {
90
- if (type === 'date') {
91
- return day ?? '';
92
- }
93
- if (type === 'time') {
94
- return time ?? '';
95
- }
96
- return day !== null && time !== null ? `${day}T${time}` : '';
97
- }
98
- /** Разбирает значение на день и время; недостающая часть — `null`. */
67
+ if (type === "date") return day ?? "";
68
+ if (type === "time") return time ?? "";
69
+ return day !== null && time !== null ? `${day}T${time}` : "";
70
+ }
99
71
  function rtDateSplit(value, type) {
100
- if (value === '') {
101
- return { day: null, time: null };
102
- }
103
- if (type === 'time') {
104
- return { day: null, time: value };
105
- }
106
- return { day: value.slice(0, DAY_LEN), time: type === 'date' ? null : value.slice(DAY_LEN + 1) };
107
- }
108
- /** Лежит ли значение в границах; граница обрезается до длины значения, `null` — открыта. */
72
+ if (value === "") return {
73
+ day: null,
74
+ time: null
75
+ };
76
+ if (type === "time") return {
77
+ day: null,
78
+ time: value
79
+ };
80
+ return {
81
+ day: value.slice(0, DAY_LEN),
82
+ time: type === "date" ? null : value.slice(11)
83
+ };
84
+ }
109
85
  function rtDateInBounds(value, min, max) {
110
- const low = min === null ? null : min.slice(0, value.length);
111
- const high = max === null ? null : max.slice(0, value.length);
112
- return (low === null || rank(value) >= rank(low)) && (high === null || rank(value) <= rank(high));
86
+ const low = min === null ? null : min.slice(0, value.length);
87
+ const high = max === null ? null : max.slice(0, value.length);
88
+ return (low === null || rank(value) >= rank(low)) && (high === null || rank(value) <= rank(high));
113
89
  }
114
- /** Текущий момент: день и время, округлённое вниз до шага минут. */
115
90
  function rtDateNow(now, step) {
116
- const minute = Math.floor(now.getMinutes() / step) * step;
117
- return {
118
- day: `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}`,
119
- time: `${pad(now.getHours())}:${pad(minute)}`,
120
- };
91
+ const minute = Math.floor(now.getMinutes() / step) * step;
92
+ return {
93
+ day: `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}`,
94
+ time: `${pad(now.getHours())}:${pad(minute)}`
95
+ };
121
96
  }
122
- /** Сдвигает месяц `YYYY-MM` на `delta` месяцев. */
123
97
  function rtDateAddMonths(month, delta) {
124
- const [y, m] = nums(month);
125
- const date = new Date(Date.UTC(y, m - 1 + delta, 1));
126
- return `${date.getUTCFullYear()}-${pad(date.getUTCMonth() + 1)}`;
98
+ const [y, m] = nums(month);
99
+ const date = new Date(Date.UTC(y, m - 1 + delta, 1));
100
+ return `${date.getUTCFullYear()}-${pad(date.getUTCMonth() + 1)}`;
127
101
  }
128
- /** Можно ли листать от месяца на `delta`: соседний месяц не лежит за границей. */
129
102
  function rtDateCanPage(month, delta, min, max) {
130
- return rtDateInBounds(rtDateAddMonths(month, delta), min, max);
103
+ return rtDateInBounds(rtDateAddMonths(month, delta), min, max);
131
104
  }
132
105
  function monthTitle(month, locale) {
133
- const [y, m] = nums(month);
134
- const name = new Intl.DateTimeFormat(locale, { month: 'long', timeZone: 'UTC' }).format(Date.UTC(y, m - 1, 1));
135
- return `${name.charAt(0).toLocaleUpperCase(locale)}${name.slice(1)} ${y}`;
106
+ const [y, m] = nums(month);
107
+ const name = new Intl.DateTimeFormat(locale, {
108
+ month: "long",
109
+ timeZone: "UTC"
110
+ }).format(Date.UTC(y, m - 1, 1));
111
+ return `${name.charAt(0).toLocaleUpperCase(locale)}${name.slice(1)} ${y}`;
136
112
  }
137
113
  function dayCell(day, ctx) {
138
- return {
139
- key: day,
140
- dayOfMonth: Number(day.slice(8)),
141
- sublabel: '',
142
- state: day === ctx.chosen ? ERtCalendarDayState.Chosen : ERtCalendarDayState.Free,
143
- disabled: !rtDateInBounds(day, ctx.min, ctx.max),
144
- today: day === ctx.today,
145
- };
146
- }
147
- /** Месяц `YYYY-MM` для календаря: подпись по локали, пустые ячейки до первого дня, дни. */
114
+ return {
115
+ key: day,
116
+ dayOfMonth: Number(day.slice(8)),
117
+ sublabel: "",
118
+ state: day === ctx.chosen ? ERtCalendarDayState.Chosen : ERtCalendarDayState.Free,
119
+ disabled: !rtDateInBounds(day, ctx.min, ctx.max),
120
+ today: day === ctx.today
121
+ };
122
+ }
148
123
  function rtDateMonth(month, ctx) {
149
- const [y, m] = nums(month);
150
- const first = Date.UTC(y, m - 1, 1);
151
- const weekday = new Date(first).getUTCDay() || WEEK;
152
- const blanks = (weekday - rtDateFirstDay(ctx.locale) + WEEK) % WEEK;
153
- const days = Array.from({ length: daysInMonth(y, m) }, (_, i) => dayCell(msToDay(first + i * DAY_LENGTH_MS), ctx));
154
- const leadingBlanks = Array.from({ length: blanks }, (_, i) => i);
155
- return { key: month, label: monthTitle(month, ctx.locale), leadingBlanks, days };
156
- }
157
- /** Короткие имена дней недели по локали, начиная с её первого дня. */
124
+ const [y, m] = nums(month);
125
+ const first = Date.UTC(y, m - 1, 1);
126
+ const blanks = ((new Date(first).getUTCDay() || WEEK) - rtDateFirstDay(ctx.locale) + WEEK) % WEEK;
127
+ const days = Array.from({ length: daysInMonth(y, m) }, (_, i) => dayCell(msToDay(first + i * DAY_LENGTH_MS), ctx));
128
+ const leadingBlanks = Array.from({ length: blanks }, (_, i) => i);
129
+ return {
130
+ key: month,
131
+ label: monthTitle(month, ctx.locale),
132
+ leadingBlanks,
133
+ days
134
+ };
135
+ }
158
136
  function rtDateWeekdays(locale) {
159
- const format = new Intl.DateTimeFormat(locale, { weekday: 'short', timeZone: 'UTC' });
160
- // 2024-01-01 — понедельник.
161
- const monday = Date.UTC(2024, 0, 1);
162
- const shift = rtDateFirstDay(locale) - 1;
163
- return Array.from({ length: WEEK }, (_, i) => format.format(monday + ((i + shift) % WEEK) * DAY_LENGTH_MS));
137
+ const format = new Intl.DateTimeFormat(locale, {
138
+ weekday: "short",
139
+ timeZone: "UTC"
140
+ });
141
+ const monday = Date.UTC(2024, 0, 1);
142
+ const shift = rtDateFirstDay(locale) - 1;
143
+ return Array.from({ length: WEEK }, (_, i) => format.format(monday + (i + shift) % WEEK * DAY_LENGTH_MS));
164
144
  }
165
- /** Двенадцать месяцев года для выбора месяца; месяц за границей выключен. */
166
145
  function rtDateMonths(year, locale, min, max) {
167
- const format = new Intl.DateTimeFormat(locale, { month: 'short', timeZone: 'UTC' });
168
- return Array.from({ length: 12 }, (_, i) => {
169
- const key = `${year}-${pad(i + 1)}`;
170
- return { key, label: format.format(Date.UTC(year, i, 1)), disabled: !rtDateInBounds(key, min, max) };
171
- });
146
+ const format = new Intl.DateTimeFormat(locale, {
147
+ month: "short",
148
+ timeZone: "UTC"
149
+ });
150
+ return Array.from({ length: 12 }, (_, i) => {
151
+ const key = `${year}-${pad(i + 1)}`;
152
+ return {
153
+ key,
154
+ label: format.format(Date.UTC(year, i, 1)),
155
+ disabled: !rtDateInBounds(key, min, max)
156
+ };
157
+ });
172
158
  }
173
- /** Граница времени для дня: у даты со временем действует только в день самой границы. */
174
159
  function timeBound(bound, day) {
175
- if (bound === null || bound.length <= TIME_LEN) {
176
- return bound;
177
- }
178
- return day === bound.slice(0, DAY_LEN) ? bound.slice(DAY_LEN + 1) : null;
160
+ if (bound === null || bound.length <= TIME_LEN) return bound;
161
+ return day === bound.slice(0, DAY_LEN) ? bound.slice(11) : null;
179
162
  }
180
- /** Колонки часов и минут: минуты идут с шагом, время за границей выключено. */
181
163
  function rtDateTimeColumns(ctx) {
182
- const low = timeBound(ctx.min, ctx.day);
183
- const high = timeBound(ctx.max, ctx.day);
184
- const hours = Array.from({ length: 24 }, (_, h) => ({
185
- value: h,
186
- label: pad(h),
187
- disabled: (low !== null && rank(`${pad(h)}:59`) < rank(low)) || (high !== null && rank(`${pad(h)}:00`) > rank(high)),
188
- }));
189
- const step = Math.max(1, Math.floor(ctx.step));
190
- const minutes = Array.from({ length: Math.ceil(60 / step) }, (_, i) => {
191
- const minute = i * step;
192
- const time = `${pad(ctx.hour ?? 0)}:${pad(minute)}`;
193
- return { value: minute, label: pad(minute), disabled: ctx.hour !== null && !rtDateInBounds(time, low, high) };
194
- });
195
- return { hours, minutes };
164
+ const low = timeBound(ctx.min, ctx.day);
165
+ const high = timeBound(ctx.max, ctx.day);
166
+ const hours = Array.from({ length: 24 }, (_, h) => ({
167
+ value: h,
168
+ label: pad(h),
169
+ disabled: low !== null && rank(`${pad(h)}:59`) < rank(low) || high !== null && rank(`${pad(h)}:00`) > rank(high)
170
+ }));
171
+ const step = Math.max(1, Math.floor(ctx.step));
172
+ return {
173
+ hours,
174
+ minutes: Array.from({ length: Math.ceil(60 / step) }, (_, i) => {
175
+ const minute = i * step;
176
+ const time = `${pad(ctx.hour ?? 0)}:${pad(minute)}`;
177
+ return {
178
+ value: minute,
179
+ label: pad(minute),
180
+ disabled: ctx.hour !== null && !rtDateInBounds(time, low, high)
181
+ };
182
+ })
183
+ };
196
184
  }
197
185
  function shiftMonth(day, delta) {
198
- const target = rtDateAddMonths(day.slice(0, MONTH_LEN$1), delta);
199
- const [y, m] = nums(target);
200
- return `${target}-${pad(Math.min(Number(day.slice(8)), daysInMonth(y, m)))}`;
201
- }
202
- /** Клавиши, что двигают фокус на число дней. */
203
- const DAY_KEYS = { ArrowLeft: -1, ArrowRight: 1, ArrowUp: -WEEK, ArrowDown: WEEK };
204
- /** Клавиши, что двигают фокус на месяц. */
205
- const MONTH_KEYS = { PageUp: -1, PageDown: 1 };
186
+ const target = rtDateAddMonths(day.slice(0, MONTH_LEN$1), delta);
187
+ const [y, m] = nums(target);
188
+ return `${target}-${pad(Math.min(Number(day.slice(8)), daysInMonth(y, m)))}`;
189
+ }
190
+ const DAY_KEYS = {
191
+ ArrowLeft: -1,
192
+ ArrowRight: 1,
193
+ ArrowUp: -7,
194
+ ArrowDown: WEEK
195
+ };
196
+ const MONTH_KEYS = {
197
+ PageUp: -1,
198
+ PageDown: 1
199
+ };
206
200
  function keyTarget(key, day, firstDay) {
207
- const ms = dayToMs(day);
208
- if (key in DAY_KEYS) {
209
- return msToDay(ms + DAY_KEYS[key] * DAY_LENGTH_MS);
210
- }
211
- if (key in MONTH_KEYS) {
212
- return shiftMonth(day, MONTH_KEYS[key]);
213
- }
214
- const offset = ((new Date(ms).getUTCDay() || WEEK) - firstDay + WEEK) % WEEK;
215
- if (key === 'Home') {
216
- return msToDay(ms - offset * DAY_LENGTH_MS);
217
- }
218
- return key === 'End' ? msToDay(ms + (WEEK - 1 - offset) * DAY_LENGTH_MS) : null;
219
- }
220
- /**
221
- * Куда клавиша переводит фокус с дня; `null` — клавиша не сеточная. День за границей не
222
- * достаётся: фокус встаёт на ближний день в границах.
223
- */
201
+ const ms = dayToMs(day);
202
+ if (key in DAY_KEYS) return msToDay(ms + DAY_KEYS[key] * DAY_LENGTH_MS);
203
+ if (key in MONTH_KEYS) return shiftMonth(day, MONTH_KEYS[key]);
204
+ const offset = ((new Date(ms).getUTCDay() || WEEK) - firstDay + WEEK) % WEEK;
205
+ if (key === "Home") return msToDay(ms - offset * DAY_LENGTH_MS);
206
+ return key === "End" ? msToDay(ms + (6 - offset) * DAY_LENGTH_MS) : null;
207
+ }
224
208
  function rtDateGridKey(key, day, firstDay, min, max) {
225
- const target = keyTarget(key, day, firstDay);
226
- if (target === null) {
227
- return null;
228
- }
229
- const low = min === null ? null : min.slice(0, DAY_LEN);
230
- const high = max === null ? null : max.slice(0, DAY_LEN);
231
- if (low !== null && rank(target) < rank(low)) {
232
- return low;
233
- }
234
- return high !== null && rank(target) > rank(high) ? high : target;
209
+ const target = keyTarget(key, day, firstDay);
210
+ if (target === null) return null;
211
+ const low = min === null ? null : min.slice(0, DAY_LEN);
212
+ const high = max === null ? null : max.slice(0, DAY_LEN);
213
+ if (low !== null && rank(target) < rank(low)) return low;
214
+ return high !== null && rank(target) > rank(high) ? high : target;
235
215
  }
236
-
237
- const BEM_BLOCK$1 = 'rt-date-panel';
216
+ const BEM_BLOCK$1 = "rt-date-panel";
238
217
  const MONTH_LEN = 7;
239
218
  const YEAR_LEN$1 = 4;
240
- /**
241
- * Панель rt-date-picker: месяц с листанием и выбором месяца и года, колонки часов и минут,
242
- * подвал с «Сегодня», «Сейчас», «Готово» или «Применить» — по типу значения.
243
- *
244
- * Панель не пишет в форму: готовое значение уходит событием `picked`, просьба закрыться —
245
- * `closed`. Черновик живёт, пока панель открыта; поле создаёт её заново на каждое открытие.
246
- * Вся арифметика дат — в `rt-date-panel.logic`.
247
- */
248
- class RtDatePanelComponent {
249
- /** Локаль кита: названия месяцев, дней недели и первый день недели идут по ней. */
250
- #locale;
251
- /** Минута открытия панели: от неё считается «сегодня», когда вход `now` не задан. */
252
- #openedAt;
253
- #firstDay;
254
- constructor() {
255
- /** Локаль кита: названия месяцев, дней недели и первый день недели идут по ней. */
256
- this.#locale = inject(RT_KIT_LOCALE);
257
- /** Минута открытия панели: от неё считается «сегодня», когда вход `now` не задан. */
258
- this.#openedAt = new Date();
259
- this.#firstDay = computed(() => rtDateFirstDay(this.#locale()), /* @ts-ignore */
260
- ...(ngDevMode ? [{ debugName: "#firstDay" }] : /* istanbul ignore next */ []));
261
- this.t = inject(RT_KIT_LABELS);
262
- this.weekdays = computed(() => rtDateWeekdays(this.#locale()), /* @ts-ignore */
263
- ...(ngDevMode ? [{ debugName: "weekdays" }] : /* istanbul ignore next */ []));
264
- this.timeCells = viewChildren('timeCell', /* @ts-ignore */
265
- ...(ngDevMode ? [{ debugName: "timeCells" }] : /* istanbul ignore next */ []));
266
- this.view = signal('days', /* @ts-ignore */
267
- ...(ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []));
268
- this.tab = signal('date', /* @ts-ignore */
269
- ...(ngDevMode ? [{ debugName: "tab" }] : /* istanbul ignore next */ []));
270
- this.activeKey = signal(null, /* @ts-ignore */
271
- ...(ngDevMode ? [{ debugName: "activeKey" }] : /* istanbul ignore next */ []));
272
- this.today = computed(() => rtDateNow(this.now() ?? this.#openedAt, 1).day, /* @ts-ignore */
273
- ...(ngDevMode ? [{ debugName: "today" }] : /* istanbul ignore next */ []));
274
- this.draftDay = linkedSignal(() => rtDateSplit(this.value(), this.type()).day, /* @ts-ignore */
275
- ...(ngDevMode ? [{ debugName: "draftDay" }] : /* istanbul ignore next */ []));
276
- this.draftTime = linkedSignal(() => rtDateSplit(this.value(), this.type()).time, /* @ts-ignore */
277
- ...(ngDevMode ? [{ debugName: "draftTime" }] : /* istanbul ignore next */ []));
278
- this.shownMonth = linkedSignal(() => (this.draftDay() ?? this.today()).slice(0, MONTH_LEN), /* @ts-ignore */
279
- ...(ngDevMode ? [{ debugName: "shownMonth" }] : /* istanbul ignore next */ []));
280
- this.year = linkedSignal(() => Number(this.shownMonth().slice(0, YEAR_LEN$1)), /* @ts-ignore */
281
- ...(ngDevMode ? [{ debugName: "year" }] : /* istanbul ignore next */ []));
282
- this.split = computed(() => this.sheet() && this.type() === 'datetime-local', /* @ts-ignore */
283
- ...(ngDevMode ? [{ debugName: "split" }] : /* istanbul ignore next */ []));
284
- this.showDate = computed(() => this.type() !== 'time' && !(this.split() && this.tab() === 'time'), /* @ts-ignore */
285
- ...(ngDevMode ? [{ debugName: "showDate" }] : /* istanbul ignore next */ []));
286
- this.showTime = computed(() => this.type() !== 'date' && !(this.split() && this.tab() === 'date'), /* @ts-ignore */
287
- ...(ngDevMode ? [{ debugName: "showTime" }] : /* istanbul ignore next */ []));
288
- this.months = computed(() => [
289
- rtDateMonth(this.shownMonth(), {
290
- locale: this.#locale(),
291
- today: this.today(),
292
- chosen: this.draftDay(),
293
- min: this.min(),
294
- max: this.max(),
295
- }),
296
- ], /* @ts-ignore */
297
- ...(ngDevMode ? [{ debugName: "months" }] : /* istanbul ignore next */ []));
298
- this.canPrev = computed(() => rtDateCanPage(this.shownMonth(), -1, this.min(), this.max()), /* @ts-ignore */
299
- ...(ngDevMode ? [{ debugName: "canPrev" }] : /* istanbul ignore next */ []));
300
- this.canNext = computed(() => rtDateCanPage(this.shownMonth(), 1, this.min(), this.max()), /* @ts-ignore */
301
- ...(ngDevMode ? [{ debugName: "canNext" }] : /* istanbul ignore next */ []));
302
- this.monthCells = computed(() => rtDateMonths(this.year(), this.#locale(), this.min(), this.max()), /* @ts-ignore */
303
- ...(ngDevMode ? [{ debugName: "monthCells" }] : /* istanbul ignore next */ []));
304
- this.canPrevYear = computed(() => rtDateInBounds(String(this.year() - 1), this.min(), this.max()), /* @ts-ignore */
305
- ...(ngDevMode ? [{ debugName: "canPrevYear" }] : /* istanbul ignore next */ []));
306
- this.canNextYear = computed(() => rtDateInBounds(String(this.year() + 1), this.min(), this.max()), /* @ts-ignore */
307
- ...(ngDevMode ? [{ debugName: "canNextYear" }] : /* istanbul ignore next */ []));
308
- this.draftHour = computed(() => this.#part(0), /* @ts-ignore */
309
- ...(ngDevMode ? [{ debugName: "draftHour" }] : /* istanbul ignore next */ []));
310
- this.draftMinute = computed(() => this.#part(1), /* @ts-ignore */
311
- ...(ngDevMode ? [{ debugName: "draftMinute" }] : /* istanbul ignore next */ []));
312
- this.columns = computed(() => rtDateTimeColumns({ step: this.minuteStep(), hour: this.draftHour(), day: this.draftDay(), min: this.min(), max: this.max() }), /* @ts-ignore */
313
- ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
314
- this.todayOff = computed(() => !rtDateInBounds(this.today(), this.min(), this.max()), /* @ts-ignore */
315
- ...(ngDevMode ? [{ debugName: "todayOff" }] : /* istanbul ignore next */ []));
316
- /** Черновик собирается в значение и лежит в границах. */
317
- this.canApply = computed(() => this.#draftValue() !== '', /* @ts-ignore */
318
- ...(ngDevMode ? [{ debugName: "canApply" }] : /* istanbul ignore next */ []));
319
- this.tabs = computed(() => [
320
- { value: 'date', label: this.t().uiDate },
321
- { value: 'time', label: this.t().uiTime },
322
- ], /* @ts-ignore */
323
- ...(ngDevMode ? [{ debugName: "tabs" }] : /* istanbul ignore next */ []));
324
- /** Тип значения: дата, время или дата со временем. */
325
- this.type = input.required(/* @ts-ignore */
326
- ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
327
- /** Значение поля в форме нативного input'а; пустая строка — пусто. */
328
- this.value = input('', /* @ts-ignore */
329
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
330
- this.min = input(null, /* @ts-ignore */
331
- ...(ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []));
332
- this.max = input(null, /* @ts-ignore */
333
- ...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
334
- /** Шаг колонки минут. */
335
- this.minuteStep = input(5, { ...(ngDevMode ? { debugName: "minuteStep" } : /* istanbul ignore next */ {}), transform: numberAttribute });
336
- /** Раскладка нижней шторки: дни под палец, у даты со временем — переключатель «Дата | Время». */
337
- this.sheet = input(false, { ...(ngDevMode ? { debugName: "sheet" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
338
- /**
339
- * Момент, от которого считаются «сегодня» и «Сейчас». Поле его не задаёт — панель читает часы
340
- * сама; задаёт витрина, чтобы кадр не менялся день ото дня.
341
- */
342
- this.now = input(null, /* @ts-ignore */
343
- ...(ngDevMode ? [{ debugName: "now" }] : /* istanbul ignore next */ []));
344
- /** Готовое значение: панель просит поле его записать. */
345
- this.picked = output();
346
- /** Панель просит закрыть себя. */
347
- this.closed = output();
348
- // Колонки времени прокручены так, что выбранный час и минута стоят посередине. Прокрутка
349
- // задаётся самой колонке: `scrollIntoView` двигал бы и страницу под поповером.
350
- afterRenderEffect(() => {
351
- for (const cell of this.timeCells()) {
352
- const node = cell.nativeElement;
353
- const column = node.parentElement;
354
- if (column !== null && node.getAttribute('aria-pressed') === 'true') {
355
- column.scrollTop = node.offsetTop - (column.clientHeight - node.offsetHeight) / 2;
356
- }
357
- }
358
- });
359
- }
360
- pickDay(day) {
361
- this.activeKey.set(day.key);
362
- if (this.type() === 'date') {
363
- this.#emit(day.key);
364
- return;
365
- }
366
- this.draftDay.set(day.key);
367
- }
368
- pickToday() {
369
- if (!this.todayOff()) {
370
- this.#emit(this.today());
371
- }
372
- }
373
- pickNow() {
374
- const now = rtDateNow(this.now() ?? new Date(), this.minuteStep());
375
- this.draftTime.set(now.time);
376
- if (this.type() === 'datetime-local') {
377
- this.draftDay.set(now.day);
378
- }
379
- }
380
- pickHour(hour) {
381
- this.draftTime.set(rtDateTime(hour, this.draftMinute() ?? 0));
382
- }
383
- pickMinute(minute) {
384
- this.draftTime.set(rtDateTime(this.draftHour() ?? 0, minute));
385
- }
386
- onGridKey(event) {
387
- const next = rtDateGridKey(event.key, event.day.key, this.#firstDay(), this.min(), this.max());
388
- if (next !== null) {
389
- this.shownMonth.set(next.slice(0, MONTH_LEN));
390
- this.activeKey.set(next);
391
- }
392
- }
393
- page(delta) {
394
- this.shownMonth.set(rtDateAddMonths(this.shownMonth(), delta));
395
- }
396
- openMonths() {
397
- this.year.set(Number(this.shownMonth().slice(0, YEAR_LEN$1)));
398
- this.view.set('months');
399
- }
400
- pageYear(delta) {
401
- this.year.update((year) => year + delta);
402
- }
403
- pickMonth(cell) {
404
- this.shownMonth.set(cell.key);
405
- this.view.set('days');
406
- }
407
- /** «Готово» и «Применить»: черновик уходит значением, панель закрывается. */
408
- apply() {
409
- const value = this.#draftValue();
410
- if (value !== '') {
411
- this.#emit(value);
412
- }
413
- }
414
- #emit(value) {
415
- this.picked.emit(value);
416
- this.closed.emit();
417
- }
418
- #draftValue() {
419
- const value = rtDateWrite(this.type(), this.draftDay(), this.draftTime());
420
- return value !== '' && rtDateInBounds(value, this.min(), this.max()) ? value : '';
421
- }
422
- #part(index) {
423
- const time = this.draftTime();
424
- return time === null ? null : Number(time.split(':')[index]);
425
- }
426
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDatePanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
427
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: RtDatePanelComponent, isStandalone: true, selector: "rt-date-panel", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, minuteStep: { classPropertyName: "minuteStep", publicName: "minuteStep", isSignal: true, isRequired: false, transformFunction: null }, sheet: { classPropertyName: "sheet", publicName: "sheet", isSignal: true, isRequired: false, transformFunction: null }, now: { classPropertyName: "now", publicName: "now", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { picked: "picked", closed: "closed" }, host: { listeners: { "keydown.escape": "closed.emit()" }, properties: { "class.rt-date-panel--sheet": "sheet()", "class.rt-date-panel--with-time": "type() !== 'date'" }, classAttribute: "rt-date-panel" }, viewQueries: [{ propertyName: "timeCells", predicate: ["timeCell"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-container rtBlock=\"rt-date-panel\">\n @if (split()) {\n <rt-toggle-button-group\n rtElem=\"tabs\"\n qa-dataid=\"date-panel-tabs\"\n fullWidth\n [ariaLabel]=\"t().uiDate + ' | ' + t().uiTime\"\n [options]=\"tabs()\"\n [value]=\"tab()\"\n (valueChange)=\"tab.set($event)\" />\n }\n\n <div rtElem=\"body\">\n @if (showDate()) {\n @if (view() === 'days') {\n <rt-calendar\n rtElem=\"calendar\"\n qa-dataid=\"date-panel-calendar\"\n grid\n titleAction\n headerTitle\n [months]=\"months()\"\n [weekdayLabels]=\"weekdays()\"\n [canPrev]=\"canPrev()\"\n [canNext]=\"canNext()\"\n [activeKey]=\"activeKey()\"\n [prevAriaLabel]=\"t().uiPrevMonth\"\n [nextAriaLabel]=\"t().uiNextMonth\"\n (prevMonth)=\"page(-1)\"\n (nextMonth)=\"page(1)\"\n (dayClick)=\"pickDay($event)\"\n (gridKey)=\"onGridKey($event)\"\n (titleClick)=\"openMonths()\" />\n } @else {\n <div rtElem=\"months\" qa-dataid=\"date-panel-months\" role=\"group\" [attr.aria-label]=\"t().uiChooseMonth\">\n <div rtElem=\"months-header\">\n <rt-icon-button\n qa-dataid=\"date-panel-prev-year\"\n icon=\"chevron-left\"\n variant=\"secondary\"\n radius=\"full\"\n [ariaLabel]=\"t().uiPrevYear\"\n [disabled]=\"!canPrevYear()\"\n (clicked)=\"pageYear(-1)\" />\n <span rtElem=\"year\" qa-dataid=\"date-panel-year\">{{ year() }}</span>\n <rt-icon-button\n qa-dataid=\"date-panel-next-year\"\n icon=\"chevron-right\"\n variant=\"secondary\"\n radius=\"full\"\n [ariaLabel]=\"t().uiNextYear\"\n [disabled]=\"!canNextYear()\"\n (clicked)=\"pageYear(1)\" />\n </div>\n <div rtElem=\"month-grid\">\n @for (cell of monthCells(); track cell.key) {\n <button\n rtElem=\"cell\"\n qa-dataid=\"date-panel-month\"\n type=\"button\"\n [attr.data-key]=\"cell.key\"\n [attr.aria-pressed]=\"cell.key === shownMonth()\"\n [disabled]=\"cell.disabled\"\n (click)=\"pickMonth(cell)\">\n {{ cell.label }}\n </button>\n }\n </div>\n </div>\n }\n }\n\n @if (showTime()) {\n <div rtElem=\"time\" qa-dataid=\"date-panel-time\">\n <div rtElem=\"column\" qa-dataid=\"date-panel-hours\" role=\"group\" [attr.aria-label]=\"t().uiHours\">\n @for (cell of columns().hours; track cell.value) {\n <button\n #timeCell\n rtElem=\"cell\"\n qa-dataid=\"date-panel-hour\"\n type=\"button\"\n [attr.aria-pressed]=\"cell.value === draftHour()\"\n [disabled]=\"cell.disabled\"\n (click)=\"pickHour(cell.value)\">\n {{ cell.label }}\n </button>\n }\n </div>\n <div rtElem=\"column\" qa-dataid=\"date-panel-minutes\" role=\"group\" [attr.aria-label]=\"t().uiMinutes\">\n @for (cell of columns().minutes; track cell.value) {\n <button\n #timeCell\n rtElem=\"cell\"\n qa-dataid=\"date-panel-minute\"\n type=\"button\"\n [attr.aria-pressed]=\"cell.value === draftMinute()\"\n [disabled]=\"cell.disabled\"\n (click)=\"pickMinute(cell.value)\">\n {{ cell.label }}\n </button>\n }\n </div>\n </div>\n }\n </div>\n\n <div rtElem=\"footer\">\n @switch (type()) {\n @case ('date') {\n <button\n rtButton\n qa-dataid=\"date-panel-today\"\n theme=\"secondary\"\n appearance=\"text\"\n size=\"sm\"\n type=\"button\"\n [label]=\"t().uiToday\"\n [attr.aria-label]=\"t().uiToday\"\n [disabled]=\"todayOff()\"\n (click)=\"pickToday()\"></button>\n }\n @case ('time') {\n <button\n rtButton\n qa-dataid=\"date-panel-now\"\n theme=\"secondary\"\n appearance=\"text\"\n size=\"sm\"\n type=\"button\"\n [label]=\"t().uiNow\"\n [attr.aria-label]=\"t().uiNow\"\n (click)=\"pickNow()\"></button>\n <button\n rtButton\n qa-dataid=\"date-panel-done\"\n size=\"sm\"\n type=\"button\"\n [label]=\"t().uiDone\"\n [attr.aria-label]=\"t().uiDone\"\n [disabled]=\"!canApply()\"\n (click)=\"apply()\"></button>\n }\n @default {\n <button\n rtButton\n qa-dataid=\"date-panel-apply\"\n size=\"sm\"\n type=\"button\"\n [label]=\"t().uiApply\"\n [attr.aria-label]=\"t().uiApply\"\n [disabled]=\"!canApply()\"\n (click)=\"apply()\"></button>\n }\n }\n </div>\n</ng-container>\n", styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-date-panel{--rt-date-panel-cell-size: var(--rt-control-height-sm);--rt-date-panel-cell-radius: var(--rt-radius-md);--rt-date-panel-divider-width: var(--rt-border-width-thin);--rt-date-panel-column-height: calc(var(--rt-date-panel-cell-size) * 7 + var(--rt-space-0-5) * 6);display:flex;flex-direction:column;padding:var(--rt-space-4);gap:var(--rt-space-4)}.rt-date-panel__body{display:flex;align-items:flex-start;gap:var(--rt-space-4)}.rt-date-panel .rt-date-panel__calendar{--rt-calendar-month-count: 1;--rt-calendar-day-justify: center}.rt-date-panel__calendar,.rt-date-panel__months{flex:1 1 auto;min-inline-size:calc(var(--rt-size-10) * 7)}.rt-date-panel__months-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--rt-space-4)}.rt-date-panel__year{color:var(--rt-color-text-primary);font-weight:var(--rt-font-weight-semibold)}.rt-date-panel__month-grid{display:grid;gap:var(--rt-space-1);grid-template-columns:repeat(3,1fr)}.rt-date-panel__time{display:flex;gap:var(--rt-space-1)}.rt-date-panel__column{position:relative;display:flex;flex-direction:column;gap:var(--rt-space-0-5);max-block-size:var(--rt-date-panel-column-height);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}.rt-date-panel__cell{flex:0 0 auto;padding:0 var(--rt-space-2);border:none;border-radius:var(--rt-date-panel-cell-radius);background:none;color:var(--rt-color-text-primary);cursor:pointer;font:inherit;font-size:var(--rt-text-sm);font-variant-numeric:tabular-nums;min-block-size:var(--rt-date-panel-cell-size);min-inline-size:var(--rt-control-height-md)}.rt-date-panel__cell:hover:not(:disabled,[aria-pressed=true]){background:var(--rt-color-bg-subtle)}.rt-date-panel__cell:focus-visible{outline:var(--rt-focus-ring-width) solid var(--rt-focus-ring-color);outline-offset:var(--rt-focus-ring-offset)}.rt-date-panel__cell[aria-pressed=true]{background:var(--rt-color-action-primary);color:var(--rt-color-action-on-primary)}.rt-date-panel__cell:disabled{color:var(--rt-color-text-muted);cursor:not-allowed;opacity:.45}.rt-date-panel__footer{display:flex;justify-content:flex-end;padding-top:var(--rt-space-2);border-top:var(--rt-date-panel-divider-width) solid var(--rt-color-border-subtle);gap:var(--rt-space-2)}.rt-date-panel:not(.rt-date-panel--with-time) .rt-date-panel__footer{justify-content:center}.rt-date-panel--sheet{--rt-date-panel-cell-size: calc(var(--rt-size-10) + var(--rt-size-1));padding-inline:0}.rt-date-panel--sheet .rt-date-panel__calendar{--rt-calendar-day-size: var(--rt-date-panel-cell-size)}.rt-date-panel--sheet .rt-date-panel__body{flex-direction:column;align-items:stretch}.rt-date-panel--sheet .rt-date-panel__calendar,.rt-date-panel--sheet .rt-date-panel__months{min-inline-size:0}.rt-date-panel--sheet .rt-date-panel__time{justify-content:center}.rt-date-panel--sheet .rt-date-panel__column{flex:1 1 0}}\n"], dependencies: [{ kind: "directive", type:
428
- // rt-tools
429
- BlockDirective, selector: "[rtBlock]", inputs: ["rtMod"] }, { kind: "directive", type: ElemDirective, selector: "[rtElem]", inputs: ["rtMod"] }, { kind: "directive", type:
430
- // components
431
- RtButtonDirective, selector: "button[rtButton], a[rtButton]", inputs: ["label", "icon", "iconPos", "theme", "appearance", "size", "loading", "loadingIcon", "loadingLabel", "pressed"] }, { kind: "component", type: RtCalendarComponent, selector: "rt-calendar", inputs: ["months", "weekdayLabels", "canPrev", "canNext", "prevAriaLabel", "nextAriaLabel", "sublabelsLoading", "grid", "activeKey", "titleAction", "headerTitle"], outputs: ["prevMonth", "nextMonth", "dayClick", "gridKey", "titleClick", "dayHover"] }, { kind: "component", type: RtIconButtonComponent, selector: "rt-icon-button", inputs: ["icon", "glyph", "ariaLabel", "variant", "iconColor", "iconFill", "size", "iconSize", "type", "tooltip", "tabIndex", "loading", "disabled", "active", "indicator"], outputs: ["clicked"] }, { kind: "component", type: RtToggleButtonGroupComponent, selector: "rt-toggle-button-group", inputs: ["options", "value", "multiple", "values", "ariaLabel", "size", "disabled", "fullWidth"], outputs: ["valueChange", "valuesChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
432
- }
433
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDatePanelComponent, decorators: [{
434
- type: Component,
435
- args: [{ selector: 'rt-date-panel', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
436
- // rt-tools
437
- BlockDirective,
438
- ElemDirective,
439
- // components
440
- RtButtonDirective,
441
- RtCalendarComponent,
442
- RtIconButtonComponent,
443
- RtToggleButtonGroupComponent,
444
- ], host: {
445
- class: BEM_BLOCK$1,
446
- '[class.rt-date-panel--sheet]': 'sheet()',
447
- '[class.rt-date-panel--with-time]': "type() !== 'date'",
448
- '(keydown.escape)': 'closed.emit()',
449
- }, template: "<ng-container rtBlock=\"rt-date-panel\">\n @if (split()) {\n <rt-toggle-button-group\n rtElem=\"tabs\"\n qa-dataid=\"date-panel-tabs\"\n fullWidth\n [ariaLabel]=\"t().uiDate + ' | ' + t().uiTime\"\n [options]=\"tabs()\"\n [value]=\"tab()\"\n (valueChange)=\"tab.set($event)\" />\n }\n\n <div rtElem=\"body\">\n @if (showDate()) {\n @if (view() === 'days') {\n <rt-calendar\n rtElem=\"calendar\"\n qa-dataid=\"date-panel-calendar\"\n grid\n titleAction\n headerTitle\n [months]=\"months()\"\n [weekdayLabels]=\"weekdays()\"\n [canPrev]=\"canPrev()\"\n [canNext]=\"canNext()\"\n [activeKey]=\"activeKey()\"\n [prevAriaLabel]=\"t().uiPrevMonth\"\n [nextAriaLabel]=\"t().uiNextMonth\"\n (prevMonth)=\"page(-1)\"\n (nextMonth)=\"page(1)\"\n (dayClick)=\"pickDay($event)\"\n (gridKey)=\"onGridKey($event)\"\n (titleClick)=\"openMonths()\" />\n } @else {\n <div rtElem=\"months\" qa-dataid=\"date-panel-months\" role=\"group\" [attr.aria-label]=\"t().uiChooseMonth\">\n <div rtElem=\"months-header\">\n <rt-icon-button\n qa-dataid=\"date-panel-prev-year\"\n icon=\"chevron-left\"\n variant=\"secondary\"\n radius=\"full\"\n [ariaLabel]=\"t().uiPrevYear\"\n [disabled]=\"!canPrevYear()\"\n (clicked)=\"pageYear(-1)\" />\n <span rtElem=\"year\" qa-dataid=\"date-panel-year\">{{ year() }}</span>\n <rt-icon-button\n qa-dataid=\"date-panel-next-year\"\n icon=\"chevron-right\"\n variant=\"secondary\"\n radius=\"full\"\n [ariaLabel]=\"t().uiNextYear\"\n [disabled]=\"!canNextYear()\"\n (clicked)=\"pageYear(1)\" />\n </div>\n <div rtElem=\"month-grid\">\n @for (cell of monthCells(); track cell.key) {\n <button\n rtElem=\"cell\"\n qa-dataid=\"date-panel-month\"\n type=\"button\"\n [attr.data-key]=\"cell.key\"\n [attr.aria-pressed]=\"cell.key === shownMonth()\"\n [disabled]=\"cell.disabled\"\n (click)=\"pickMonth(cell)\">\n {{ cell.label }}\n </button>\n }\n </div>\n </div>\n }\n }\n\n @if (showTime()) {\n <div rtElem=\"time\" qa-dataid=\"date-panel-time\">\n <div rtElem=\"column\" qa-dataid=\"date-panel-hours\" role=\"group\" [attr.aria-label]=\"t().uiHours\">\n @for (cell of columns().hours; track cell.value) {\n <button\n #timeCell\n rtElem=\"cell\"\n qa-dataid=\"date-panel-hour\"\n type=\"button\"\n [attr.aria-pressed]=\"cell.value === draftHour()\"\n [disabled]=\"cell.disabled\"\n (click)=\"pickHour(cell.value)\">\n {{ cell.label }}\n </button>\n }\n </div>\n <div rtElem=\"column\" qa-dataid=\"date-panel-minutes\" role=\"group\" [attr.aria-label]=\"t().uiMinutes\">\n @for (cell of columns().minutes; track cell.value) {\n <button\n #timeCell\n rtElem=\"cell\"\n qa-dataid=\"date-panel-minute\"\n type=\"button\"\n [attr.aria-pressed]=\"cell.value === draftMinute()\"\n [disabled]=\"cell.disabled\"\n (click)=\"pickMinute(cell.value)\">\n {{ cell.label }}\n </button>\n }\n </div>\n </div>\n }\n </div>\n\n <div rtElem=\"footer\">\n @switch (type()) {\n @case ('date') {\n <button\n rtButton\n qa-dataid=\"date-panel-today\"\n theme=\"secondary\"\n appearance=\"text\"\n size=\"sm\"\n type=\"button\"\n [label]=\"t().uiToday\"\n [attr.aria-label]=\"t().uiToday\"\n [disabled]=\"todayOff()\"\n (click)=\"pickToday()\"></button>\n }\n @case ('time') {\n <button\n rtButton\n qa-dataid=\"date-panel-now\"\n theme=\"secondary\"\n appearance=\"text\"\n size=\"sm\"\n type=\"button\"\n [label]=\"t().uiNow\"\n [attr.aria-label]=\"t().uiNow\"\n (click)=\"pickNow()\"></button>\n <button\n rtButton\n qa-dataid=\"date-panel-done\"\n size=\"sm\"\n type=\"button\"\n [label]=\"t().uiDone\"\n [attr.aria-label]=\"t().uiDone\"\n [disabled]=\"!canApply()\"\n (click)=\"apply()\"></button>\n }\n @default {\n <button\n rtButton\n qa-dataid=\"date-panel-apply\"\n size=\"sm\"\n type=\"button\"\n [label]=\"t().uiApply\"\n [attr.aria-label]=\"t().uiApply\"\n [disabled]=\"!canApply()\"\n (click)=\"apply()\"></button>\n }\n }\n </div>\n</ng-container>\n", styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-date-panel{--rt-date-panel-cell-size: var(--rt-control-height-sm);--rt-date-panel-cell-radius: var(--rt-radius-md);--rt-date-panel-divider-width: var(--rt-border-width-thin);--rt-date-panel-column-height: calc(var(--rt-date-panel-cell-size) * 7 + var(--rt-space-0-5) * 6);display:flex;flex-direction:column;padding:var(--rt-space-4);gap:var(--rt-space-4)}.rt-date-panel__body{display:flex;align-items:flex-start;gap:var(--rt-space-4)}.rt-date-panel .rt-date-panel__calendar{--rt-calendar-month-count: 1;--rt-calendar-day-justify: center}.rt-date-panel__calendar,.rt-date-panel__months{flex:1 1 auto;min-inline-size:calc(var(--rt-size-10) * 7)}.rt-date-panel__months-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--rt-space-4)}.rt-date-panel__year{color:var(--rt-color-text-primary);font-weight:var(--rt-font-weight-semibold)}.rt-date-panel__month-grid{display:grid;gap:var(--rt-space-1);grid-template-columns:repeat(3,1fr)}.rt-date-panel__time{display:flex;gap:var(--rt-space-1)}.rt-date-panel__column{position:relative;display:flex;flex-direction:column;gap:var(--rt-space-0-5);max-block-size:var(--rt-date-panel-column-height);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}.rt-date-panel__cell{flex:0 0 auto;padding:0 var(--rt-space-2);border:none;border-radius:var(--rt-date-panel-cell-radius);background:none;color:var(--rt-color-text-primary);cursor:pointer;font:inherit;font-size:var(--rt-text-sm);font-variant-numeric:tabular-nums;min-block-size:var(--rt-date-panel-cell-size);min-inline-size:var(--rt-control-height-md)}.rt-date-panel__cell:hover:not(:disabled,[aria-pressed=true]){background:var(--rt-color-bg-subtle)}.rt-date-panel__cell:focus-visible{outline:var(--rt-focus-ring-width) solid var(--rt-focus-ring-color);outline-offset:var(--rt-focus-ring-offset)}.rt-date-panel__cell[aria-pressed=true]{background:var(--rt-color-action-primary);color:var(--rt-color-action-on-primary)}.rt-date-panel__cell:disabled{color:var(--rt-color-text-muted);cursor:not-allowed;opacity:.45}.rt-date-panel__footer{display:flex;justify-content:flex-end;padding-top:var(--rt-space-2);border-top:var(--rt-date-panel-divider-width) solid var(--rt-color-border-subtle);gap:var(--rt-space-2)}.rt-date-panel:not(.rt-date-panel--with-time) .rt-date-panel__footer{justify-content:center}.rt-date-panel--sheet{--rt-date-panel-cell-size: calc(var(--rt-size-10) + var(--rt-size-1));padding-inline:0}.rt-date-panel--sheet .rt-date-panel__calendar{--rt-calendar-day-size: var(--rt-date-panel-cell-size)}.rt-date-panel--sheet .rt-date-panel__body{flex-direction:column;align-items:stretch}.rt-date-panel--sheet .rt-date-panel__calendar,.rt-date-panel--sheet .rt-date-panel__months{min-inline-size:0}.rt-date-panel--sheet .rt-date-panel__time{justify-content:center}.rt-date-panel--sheet .rt-date-panel__column{flex:1 1 0}}\n"] }]
450
- }], ctorParameters: () => [], propDecorators: { timeCells: [{ type: i0.ViewChildren, args: ['timeCell', { isSignal: true }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], minuteStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "minuteStep", required: false }] }], sheet: [{ type: i0.Input, args: [{ isSignal: true, alias: "sheet", required: false }] }], now: [{ type: i0.Input, args: [{ isSignal: true, alias: "now", required: false }] }], picked: [{ type: i0.Output, args: ["picked"] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
451
-
452
- /**
453
- * Чистая логика текста в поле даты: как значение пишется по локали и как набранный текст
454
- * читается обратно. Значение формы — строка ISO (`YYYY-MM-DD`, `HH:mm`, `YYYY-MM-DDTHH:mm`);
455
- * текст — дата в порядке языка интерфейса (`01.08.2026` под `ru`), время всегда `HH:mm`.
456
- */
457
- /** День, в котором день, месяц и год различимы: по нему `Intl` называет порядок частей. */
219
+ var RtDatePanelComponent = class RtDatePanelComponent {
220
+ #locale;
221
+ #openedAt;
222
+ #firstDay;
223
+ constructor() {
224
+ this.#locale = inject(RT_KIT_LOCALE);
225
+ this.#openedAt = /* @__PURE__ */ new Date();
226
+ this.#firstDay = computed(() => rtDateFirstDay(this.#locale()), ...ngDevMode ? [{ debugName: "#firstDay" }] : /* istanbul ignore next */ []);
227
+ this.t = inject(RT_KIT_LABELS);
228
+ this.weekdays = computed(() => rtDateWeekdays(this.#locale()), ...ngDevMode ? [{ debugName: "weekdays" }] : /* istanbul ignore next */ []);
229
+ this.timeCells = viewChildren("timeCell", ...ngDevMode ? [{ debugName: "timeCells" }] : /* istanbul ignore next */ []);
230
+ this.view = signal("days", ...ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []);
231
+ this.tab = signal("date", ...ngDevMode ? [{ debugName: "tab" }] : /* istanbul ignore next */ []);
232
+ this.activeKey = signal(null, ...ngDevMode ? [{ debugName: "activeKey" }] : /* istanbul ignore next */ []);
233
+ this.today = computed(() => rtDateNow(this.now() ?? this.#openedAt, 1).day, ...ngDevMode ? [{ debugName: "today" }] : /* istanbul ignore next */ []);
234
+ this.draftDay = linkedSignal(() => rtDateSplit(this.value(), this.type()).day, ...ngDevMode ? [{ debugName: "draftDay" }] : /* istanbul ignore next */ []);
235
+ this.draftTime = linkedSignal(() => rtDateSplit(this.value(), this.type()).time, ...ngDevMode ? [{ debugName: "draftTime" }] : /* istanbul ignore next */ []);
236
+ this.shownMonth = linkedSignal(() => (this.draftDay() ?? this.today()).slice(0, MONTH_LEN), ...ngDevMode ? [{ debugName: "shownMonth" }] : /* istanbul ignore next */ []);
237
+ this.year = linkedSignal(() => Number(this.shownMonth().slice(0, YEAR_LEN$1)), ...ngDevMode ? [{ debugName: "year" }] : /* istanbul ignore next */ []);
238
+ this.split = computed(() => this.sheet() && this.type() === "datetime-local", ...ngDevMode ? [{ debugName: "split" }] : /* istanbul ignore next */ []);
239
+ this.showDate = computed(() => this.type() !== "time" && !(this.split() && this.tab() === "time"), ...ngDevMode ? [{ debugName: "showDate" }] : /* istanbul ignore next */ []);
240
+ this.showTime = computed(() => this.type() !== "date" && !(this.split() && this.tab() === "date"), ...ngDevMode ? [{ debugName: "showTime" }] : /* istanbul ignore next */ []);
241
+ this.months = computed(() => [rtDateMonth(this.shownMonth(), {
242
+ locale: this.#locale(),
243
+ today: this.today(),
244
+ chosen: this.draftDay(),
245
+ min: this.min(),
246
+ max: this.max()
247
+ })], ...ngDevMode ? [{ debugName: "months" }] : /* istanbul ignore next */ []);
248
+ this.canPrev = computed(() => rtDateCanPage(this.shownMonth(), -1, this.min(), this.max()), ...ngDevMode ? [{ debugName: "canPrev" }] : /* istanbul ignore next */ []);
249
+ this.canNext = computed(() => rtDateCanPage(this.shownMonth(), 1, this.min(), this.max()), ...ngDevMode ? [{ debugName: "canNext" }] : /* istanbul ignore next */ []);
250
+ this.monthCells = computed(() => rtDateMonths(this.year(), this.#locale(), this.min(), this.max()), ...ngDevMode ? [{ debugName: "monthCells" }] : /* istanbul ignore next */ []);
251
+ this.canPrevYear = computed(() => rtDateInBounds(String(this.year() - 1), this.min(), this.max()), ...ngDevMode ? [{ debugName: "canPrevYear" }] : /* istanbul ignore next */ []);
252
+ this.canNextYear = computed(() => rtDateInBounds(String(this.year() + 1), this.min(), this.max()), ...ngDevMode ? [{ debugName: "canNextYear" }] : /* istanbul ignore next */ []);
253
+ this.draftHour = computed(() => this.#part(0), ...ngDevMode ? [{ debugName: "draftHour" }] : /* istanbul ignore next */ []);
254
+ this.draftMinute = computed(() => this.#part(1), ...ngDevMode ? [{ debugName: "draftMinute" }] : /* istanbul ignore next */ []);
255
+ this.columns = computed(() => rtDateTimeColumns({
256
+ step: this.minuteStep(),
257
+ hour: this.draftHour(),
258
+ day: this.draftDay(),
259
+ min: this.min(),
260
+ max: this.max()
261
+ }), ...ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []);
262
+ this.todayOff = computed(() => !rtDateInBounds(this.today(), this.min(), this.max()), ...ngDevMode ? [{ debugName: "todayOff" }] : /* istanbul ignore next */ []);
263
+ this.canApply = computed(() => this.#draftValue() !== "", ...ngDevMode ? [{ debugName: "canApply" }] : /* istanbul ignore next */ []);
264
+ this.tabs = computed(() => [{
265
+ value: "date",
266
+ label: this.t().uiDate
267
+ }, {
268
+ value: "time",
269
+ label: this.t().uiTime
270
+ }], ...ngDevMode ? [{ debugName: "tabs" }] : /* istanbul ignore next */ []);
271
+ this.type = input.required(...ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []);
272
+ this.value = input("", ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
273
+ this.min = input(null, ...ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []);
274
+ this.max = input(null, ...ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []);
275
+ this.minuteStep = input(5, {
276
+ ...ngDevMode ? { debugName: "minuteStep" } : /* istanbul ignore next */ {},
277
+ transform: numberAttribute
278
+ });
279
+ this.sheet = input(false, {
280
+ ...ngDevMode ? { debugName: "sheet" } : /* istanbul ignore next */ {},
281
+ transform: booleanAttribute
282
+ });
283
+ this.now = input(null, ...ngDevMode ? [{ debugName: "now" }] : /* istanbul ignore next */ []);
284
+ this.picked = output();
285
+ this.closed = output();
286
+ afterRenderEffect(() => {
287
+ for (const cell of this.timeCells()) {
288
+ const node = cell.nativeElement;
289
+ const column = node.parentElement;
290
+ if (column !== null && node.getAttribute("aria-pressed") === "true") column.scrollTop = node.offsetTop - (column.clientHeight - node.offsetHeight) / 2;
291
+ }
292
+ });
293
+ }
294
+ pickDay(day) {
295
+ this.activeKey.set(day.key);
296
+ if (this.type() === "date") {
297
+ this.#emit(day.key);
298
+ return;
299
+ }
300
+ this.draftDay.set(day.key);
301
+ }
302
+ pickToday() {
303
+ if (!this.todayOff()) this.#emit(this.today());
304
+ }
305
+ pickNow() {
306
+ const now = rtDateNow(this.now() ?? /* @__PURE__ */ new Date(), this.minuteStep());
307
+ this.draftTime.set(now.time);
308
+ if (this.type() === "datetime-local") this.draftDay.set(now.day);
309
+ }
310
+ pickHour(hour) {
311
+ this.draftTime.set(rtDateTime(hour, this.draftMinute() ?? 0));
312
+ }
313
+ pickMinute(minute) {
314
+ this.draftTime.set(rtDateTime(this.draftHour() ?? 0, minute));
315
+ }
316
+ onGridKey(event) {
317
+ const next = rtDateGridKey(event.key, event.day.key, this.#firstDay(), this.min(), this.max());
318
+ if (next !== null) {
319
+ this.shownMonth.set(next.slice(0, MONTH_LEN));
320
+ this.activeKey.set(next);
321
+ }
322
+ }
323
+ page(delta) {
324
+ this.shownMonth.set(rtDateAddMonths(this.shownMonth(), delta));
325
+ }
326
+ openMonths() {
327
+ this.year.set(Number(this.shownMonth().slice(0, YEAR_LEN$1)));
328
+ this.view.set("months");
329
+ }
330
+ pageYear(delta) {
331
+ this.year.update((year) => year + delta);
332
+ }
333
+ pickMonth(cell) {
334
+ this.shownMonth.set(cell.key);
335
+ this.view.set("days");
336
+ }
337
+ apply() {
338
+ const value = this.#draftValue();
339
+ if (value !== "") this.#emit(value);
340
+ }
341
+ #emit(value) {
342
+ this.picked.emit(value);
343
+ this.closed.emit();
344
+ }
345
+ #draftValue() {
346
+ const value = rtDateWrite(this.type(), this.draftDay(), this.draftTime());
347
+ return value !== "" && rtDateInBounds(value, this.min(), this.max()) ? value : "";
348
+ }
349
+ #part(index) {
350
+ const time = this.draftTime();
351
+ return time === null ? null : Number(time.split(":")[index]);
352
+ }
353
+ static {
354
+ this.ɵfac = i0.ɵɵngDeclareFactory({
355
+ minVersion: "12.0.0",
356
+ version: "22.2.2",
357
+ ngImport: i0,
358
+ type: RtDatePanelComponent,
359
+ deps: [],
360
+ target: i0.ɵɵFactoryTarget.Component
361
+ });
362
+ }
363
+ static {
364
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
365
+ minVersion: "17.0.0",
366
+ version: "22.2.2",
367
+ type: RtDatePanelComponent,
368
+ isStandalone: true,
369
+ selector: "rt-date-panel",
370
+ inputs: {
371
+ type: {
372
+ classPropertyName: "type",
373
+ publicName: "type",
374
+ isSignal: true,
375
+ isRequired: true,
376
+ transformFunction: null
377
+ },
378
+ value: {
379
+ classPropertyName: "value",
380
+ publicName: "value",
381
+ isSignal: true,
382
+ isRequired: false,
383
+ transformFunction: null
384
+ },
385
+ min: {
386
+ classPropertyName: "min",
387
+ publicName: "min",
388
+ isSignal: true,
389
+ isRequired: false,
390
+ transformFunction: null
391
+ },
392
+ max: {
393
+ classPropertyName: "max",
394
+ publicName: "max",
395
+ isSignal: true,
396
+ isRequired: false,
397
+ transformFunction: null
398
+ },
399
+ minuteStep: {
400
+ classPropertyName: "minuteStep",
401
+ publicName: "minuteStep",
402
+ isSignal: true,
403
+ isRequired: false,
404
+ transformFunction: null
405
+ },
406
+ sheet: {
407
+ classPropertyName: "sheet",
408
+ publicName: "sheet",
409
+ isSignal: true,
410
+ isRequired: false,
411
+ transformFunction: null
412
+ },
413
+ now: {
414
+ classPropertyName: "now",
415
+ publicName: "now",
416
+ isSignal: true,
417
+ isRequired: false,
418
+ transformFunction: null
419
+ }
420
+ },
421
+ outputs: {
422
+ picked: "picked",
423
+ closed: "closed"
424
+ },
425
+ host: {
426
+ listeners: { "keydown.escape": "closed.emit()" },
427
+ properties: {
428
+ "class.rt-date-panel--sheet": "sheet()",
429
+ "class.rt-date-panel--with-time": "type() !== 'date'"
430
+ },
431
+ classAttribute: "rt-date-panel"
432
+ },
433
+ viewQueries: [{
434
+ propertyName: "timeCells",
435
+ predicate: ["timeCell"],
436
+ descendants: true,
437
+ isSignal: true
438
+ }],
439
+ ngImport: i0,
440
+ template: "<ng-container rtBlock=\"rt-date-panel\">\n @if (split()) {\n <rt-toggle-button-group\n rtElem=\"tabs\"\n qa-dataid=\"date-panel-tabs\"\n fullWidth\n [ariaLabel]=\"t().uiDate + ' | ' + t().uiTime\"\n [options]=\"tabs()\"\n [value]=\"tab()\"\n (valueChange)=\"tab.set($event)\" />\n }\n\n <div rtElem=\"body\">\n @if (showDate()) {\n @if (view() === 'days') {\n <rt-calendar\n rtElem=\"calendar\"\n qa-dataid=\"date-panel-calendar\"\n grid\n titleAction\n headerTitle\n [months]=\"months()\"\n [weekdayLabels]=\"weekdays()\"\n [canPrev]=\"canPrev()\"\n [canNext]=\"canNext()\"\n [activeKey]=\"activeKey()\"\n [prevAriaLabel]=\"t().uiPrevMonth\"\n [nextAriaLabel]=\"t().uiNextMonth\"\n (prevMonth)=\"page(-1)\"\n (nextMonth)=\"page(1)\"\n (dayClick)=\"pickDay($event)\"\n (gridKey)=\"onGridKey($event)\"\n (titleClick)=\"openMonths()\" />\n } @else {\n <div rtElem=\"months\" qa-dataid=\"date-panel-months\" role=\"group\" [attr.aria-label]=\"t().uiChooseMonth\">\n <div rtElem=\"months-header\">\n <rt-icon-button\n qa-dataid=\"date-panel-prev-year\"\n icon=\"chevron-left\"\n variant=\"secondary\"\n radius=\"full\"\n [ariaLabel]=\"t().uiPrevYear\"\n [disabled]=\"!canPrevYear()\"\n (clicked)=\"pageYear(-1)\" />\n <span rtElem=\"year\" qa-dataid=\"date-panel-year\">{{ year() }}</span>\n <rt-icon-button\n qa-dataid=\"date-panel-next-year\"\n icon=\"chevron-right\"\n variant=\"secondary\"\n radius=\"full\"\n [ariaLabel]=\"t().uiNextYear\"\n [disabled]=\"!canNextYear()\"\n (clicked)=\"pageYear(1)\" />\n </div>\n <div rtElem=\"month-grid\">\n @for (cell of monthCells(); track cell.key) {\n <button\n rtElem=\"cell\"\n qa-dataid=\"date-panel-month\"\n type=\"button\"\n [attr.data-key]=\"cell.key\"\n [attr.aria-pressed]=\"cell.key === shownMonth()\"\n [disabled]=\"cell.disabled\"\n (click)=\"pickMonth(cell)\">\n {{ cell.label }}\n </button>\n }\n </div>\n </div>\n }\n }\n\n @if (showTime()) {\n <div rtElem=\"time\" qa-dataid=\"date-panel-time\">\n <div rtElem=\"column\" qa-dataid=\"date-panel-hours\" role=\"group\" [attr.aria-label]=\"t().uiHours\">\n @for (cell of columns().hours; track cell.value) {\n <button\n #timeCell\n rtElem=\"cell\"\n qa-dataid=\"date-panel-hour\"\n type=\"button\"\n [attr.aria-pressed]=\"cell.value === draftHour()\"\n [disabled]=\"cell.disabled\"\n (click)=\"pickHour(cell.value)\">\n {{ cell.label }}\n </button>\n }\n </div>\n <div rtElem=\"column\" qa-dataid=\"date-panel-minutes\" role=\"group\" [attr.aria-label]=\"t().uiMinutes\">\n @for (cell of columns().minutes; track cell.value) {\n <button\n #timeCell\n rtElem=\"cell\"\n qa-dataid=\"date-panel-minute\"\n type=\"button\"\n [attr.aria-pressed]=\"cell.value === draftMinute()\"\n [disabled]=\"cell.disabled\"\n (click)=\"pickMinute(cell.value)\">\n {{ cell.label }}\n </button>\n }\n </div>\n </div>\n }\n </div>\n\n <div rtElem=\"footer\">\n @switch (type()) {\n @case ('date') {\n <button\n rtButton\n qa-dataid=\"date-panel-today\"\n theme=\"secondary\"\n appearance=\"text\"\n size=\"sm\"\n type=\"button\"\n [label]=\"t().uiToday\"\n [attr.aria-label]=\"t().uiToday\"\n [disabled]=\"todayOff()\"\n (click)=\"pickToday()\"></button>\n }\n @case ('time') {\n <button\n rtButton\n qa-dataid=\"date-panel-now\"\n theme=\"secondary\"\n appearance=\"text\"\n size=\"sm\"\n type=\"button\"\n [label]=\"t().uiNow\"\n [attr.aria-label]=\"t().uiNow\"\n (click)=\"pickNow()\"></button>\n <button\n rtButton\n qa-dataid=\"date-panel-done\"\n size=\"sm\"\n type=\"button\"\n [label]=\"t().uiDone\"\n [attr.aria-label]=\"t().uiDone\"\n [disabled]=\"!canApply()\"\n (click)=\"apply()\"></button>\n }\n @default {\n <button\n rtButton\n qa-dataid=\"date-panel-apply\"\n size=\"sm\"\n type=\"button\"\n [label]=\"t().uiApply\"\n [attr.aria-label]=\"t().uiApply\"\n [disabled]=\"!canApply()\"\n (click)=\"apply()\"></button>\n }\n }\n </div>\n</ng-container>\n",
441
+ styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-date-panel{--rt-date-panel-cell-size: var(--rt-control-height-sm);--rt-date-panel-cell-radius: var(--rt-radius-md);--rt-date-panel-divider-width: var(--rt-border-width-thin);--rt-date-panel-column-height: calc(var(--rt-date-panel-cell-size) * 7 + var(--rt-space-0-5) * 6);display:flex;flex-direction:column;padding:var(--rt-space-4);gap:var(--rt-space-4)}.rt-date-panel__body{display:flex;align-items:flex-start;gap:var(--rt-space-4)}.rt-date-panel .rt-date-panel__calendar{--rt-calendar-month-count: 1;--rt-calendar-day-justify: center}.rt-date-panel__calendar,.rt-date-panel__months{flex:1 1 auto;min-inline-size:calc(var(--rt-size-10) * 7)}.rt-date-panel__months-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--rt-space-4)}.rt-date-panel__year{color:var(--rt-color-text-primary);font-weight:var(--rt-font-weight-semibold)}.rt-date-panel__month-grid{display:grid;gap:var(--rt-space-1);grid-template-columns:repeat(3,1fr)}.rt-date-panel__time{display:flex;gap:var(--rt-space-1)}.rt-date-panel__column{position:relative;display:flex;flex-direction:column;gap:var(--rt-space-0-5);max-block-size:var(--rt-date-panel-column-height);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}.rt-date-panel__cell{flex:0 0 auto;padding:0 var(--rt-space-2);border:none;border-radius:var(--rt-date-panel-cell-radius);background:none;color:var(--rt-color-text-primary);cursor:pointer;font:inherit;font-size:var(--rt-text-sm);font-variant-numeric:tabular-nums;min-block-size:var(--rt-date-panel-cell-size);min-inline-size:var(--rt-control-height-md)}.rt-date-panel__cell:hover:not(:disabled,[aria-pressed=true]){background:var(--rt-color-bg-subtle)}.rt-date-panel__cell:focus-visible{outline:var(--rt-focus-ring-width) solid var(--rt-focus-ring-color);outline-offset:var(--rt-focus-ring-offset)}.rt-date-panel__cell[aria-pressed=true]{background:var(--rt-color-action-primary);color:var(--rt-color-action-on-primary)}.rt-date-panel__cell:disabled{color:var(--rt-color-text-muted);cursor:not-allowed;opacity:.45}.rt-date-panel__footer{display:flex;justify-content:flex-end;padding-top:var(--rt-space-2);border-top:var(--rt-date-panel-divider-width) solid var(--rt-color-border-subtle);gap:var(--rt-space-2)}.rt-date-panel:not(.rt-date-panel--with-time) .rt-date-panel__footer{justify-content:center}.rt-date-panel--sheet{--rt-date-panel-cell-size: calc(var(--rt-size-10) + var(--rt-size-1));padding-inline:0}.rt-date-panel--sheet .rt-date-panel__calendar{--rt-calendar-day-size: var(--rt-date-panel-cell-size)}.rt-date-panel--sheet .rt-date-panel__body{flex-direction:column;align-items:stretch}.rt-date-panel--sheet .rt-date-panel__calendar,.rt-date-panel--sheet .rt-date-panel__months{min-inline-size:0}.rt-date-panel--sheet .rt-date-panel__time{justify-content:center}.rt-date-panel--sheet .rt-date-panel__column{flex:1 1 0}}\n"],
442
+ dependencies: [
443
+ {
444
+ kind: "directive",
445
+ type: BlockDirective,
446
+ selector: "[rtBlock]",
447
+ inputs: ["rtMod"]
448
+ },
449
+ {
450
+ kind: "directive",
451
+ type: ElemDirective,
452
+ selector: "[rtElem]",
453
+ inputs: ["rtMod"]
454
+ },
455
+ {
456
+ kind: "directive",
457
+ type: RtButtonDirective,
458
+ selector: "button[rtButton], a[rtButton]",
459
+ inputs: [
460
+ "label",
461
+ "icon",
462
+ "iconPos",
463
+ "theme",
464
+ "appearance",
465
+ "size",
466
+ "loading",
467
+ "loadingIcon",
468
+ "loadingLabel",
469
+ "pressed"
470
+ ]
471
+ },
472
+ {
473
+ kind: "component",
474
+ type: RtCalendarComponent,
475
+ selector: "rt-calendar",
476
+ inputs: [
477
+ "months",
478
+ "weekdayLabels",
479
+ "canPrev",
480
+ "canNext",
481
+ "prevAriaLabel",
482
+ "nextAriaLabel",
483
+ "sublabelsLoading",
484
+ "grid",
485
+ "activeKey",
486
+ "titleAction",
487
+ "headerTitle"
488
+ ],
489
+ outputs: [
490
+ "prevMonth",
491
+ "nextMonth",
492
+ "dayClick",
493
+ "gridKey",
494
+ "titleClick",
495
+ "dayHover"
496
+ ]
497
+ },
498
+ {
499
+ kind: "component",
500
+ type: RtIconButtonComponent,
501
+ selector: "rt-icon-button",
502
+ inputs: [
503
+ "icon",
504
+ "glyph",
505
+ "ariaLabel",
506
+ "variant",
507
+ "iconColor",
508
+ "iconFill",
509
+ "size",
510
+ "iconSize",
511
+ "type",
512
+ "tooltip",
513
+ "tooltipHideOnClick",
514
+ "tabIndex",
515
+ "loading",
516
+ "disabled",
517
+ "active",
518
+ "expanded",
519
+ "indicator"
520
+ ],
521
+ outputs: ["clicked"]
522
+ },
523
+ {
524
+ kind: "component",
525
+ type: RtToggleButtonGroupComponent,
526
+ selector: "rt-toggle-button-group",
527
+ inputs: [
528
+ "options",
529
+ "value",
530
+ "multiple",
531
+ "values",
532
+ "ariaLabel",
533
+ "size",
534
+ "disabled",
535
+ "fullWidth"
536
+ ],
537
+ outputs: ["valueChange", "valuesChange"]
538
+ }
539
+ ],
540
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
541
+ encapsulation: i0.ViewEncapsulation.None
542
+ });
543
+ }
544
+ };
545
+ i0.ɵɵngDeclareClassMetadata({
546
+ minVersion: "12.0.0",
547
+ version: "22.2.2",
548
+ ngImport: i0,
549
+ type: RtDatePanelComponent,
550
+ decorators: [{
551
+ type: Component,
552
+ args: [{
553
+ selector: "rt-date-panel",
554
+ changeDetection: ChangeDetectionStrategy.OnPush,
555
+ encapsulation: ViewEncapsulation.None,
556
+ imports: [
557
+ BlockDirective,
558
+ ElemDirective,
559
+ RtButtonDirective,
560
+ RtCalendarComponent,
561
+ RtIconButtonComponent,
562
+ RtToggleButtonGroupComponent
563
+ ],
564
+ host: {
565
+ class: BEM_BLOCK$1,
566
+ "[class.rt-date-panel--sheet]": "sheet()",
567
+ "[class.rt-date-panel--with-time]": "type() !== 'date'",
568
+ "(keydown.escape)": "closed.emit()"
569
+ },
570
+ template: "<ng-container rtBlock=\"rt-date-panel\">\n @if (split()) {\n <rt-toggle-button-group\n rtElem=\"tabs\"\n qa-dataid=\"date-panel-tabs\"\n fullWidth\n [ariaLabel]=\"t().uiDate + ' | ' + t().uiTime\"\n [options]=\"tabs()\"\n [value]=\"tab()\"\n (valueChange)=\"tab.set($event)\" />\n }\n\n <div rtElem=\"body\">\n @if (showDate()) {\n @if (view() === 'days') {\n <rt-calendar\n rtElem=\"calendar\"\n qa-dataid=\"date-panel-calendar\"\n grid\n titleAction\n headerTitle\n [months]=\"months()\"\n [weekdayLabels]=\"weekdays()\"\n [canPrev]=\"canPrev()\"\n [canNext]=\"canNext()\"\n [activeKey]=\"activeKey()\"\n [prevAriaLabel]=\"t().uiPrevMonth\"\n [nextAriaLabel]=\"t().uiNextMonth\"\n (prevMonth)=\"page(-1)\"\n (nextMonth)=\"page(1)\"\n (dayClick)=\"pickDay($event)\"\n (gridKey)=\"onGridKey($event)\"\n (titleClick)=\"openMonths()\" />\n } @else {\n <div rtElem=\"months\" qa-dataid=\"date-panel-months\" role=\"group\" [attr.aria-label]=\"t().uiChooseMonth\">\n <div rtElem=\"months-header\">\n <rt-icon-button\n qa-dataid=\"date-panel-prev-year\"\n icon=\"chevron-left\"\n variant=\"secondary\"\n radius=\"full\"\n [ariaLabel]=\"t().uiPrevYear\"\n [disabled]=\"!canPrevYear()\"\n (clicked)=\"pageYear(-1)\" />\n <span rtElem=\"year\" qa-dataid=\"date-panel-year\">{{ year() }}</span>\n <rt-icon-button\n qa-dataid=\"date-panel-next-year\"\n icon=\"chevron-right\"\n variant=\"secondary\"\n radius=\"full\"\n [ariaLabel]=\"t().uiNextYear\"\n [disabled]=\"!canNextYear()\"\n (clicked)=\"pageYear(1)\" />\n </div>\n <div rtElem=\"month-grid\">\n @for (cell of monthCells(); track cell.key) {\n <button\n rtElem=\"cell\"\n qa-dataid=\"date-panel-month\"\n type=\"button\"\n [attr.data-key]=\"cell.key\"\n [attr.aria-pressed]=\"cell.key === shownMonth()\"\n [disabled]=\"cell.disabled\"\n (click)=\"pickMonth(cell)\">\n {{ cell.label }}\n </button>\n }\n </div>\n </div>\n }\n }\n\n @if (showTime()) {\n <div rtElem=\"time\" qa-dataid=\"date-panel-time\">\n <div rtElem=\"column\" qa-dataid=\"date-panel-hours\" role=\"group\" [attr.aria-label]=\"t().uiHours\">\n @for (cell of columns().hours; track cell.value) {\n <button\n #timeCell\n rtElem=\"cell\"\n qa-dataid=\"date-panel-hour\"\n type=\"button\"\n [attr.aria-pressed]=\"cell.value === draftHour()\"\n [disabled]=\"cell.disabled\"\n (click)=\"pickHour(cell.value)\">\n {{ cell.label }}\n </button>\n }\n </div>\n <div rtElem=\"column\" qa-dataid=\"date-panel-minutes\" role=\"group\" [attr.aria-label]=\"t().uiMinutes\">\n @for (cell of columns().minutes; track cell.value) {\n <button\n #timeCell\n rtElem=\"cell\"\n qa-dataid=\"date-panel-minute\"\n type=\"button\"\n [attr.aria-pressed]=\"cell.value === draftMinute()\"\n [disabled]=\"cell.disabled\"\n (click)=\"pickMinute(cell.value)\">\n {{ cell.label }}\n </button>\n }\n </div>\n </div>\n }\n </div>\n\n <div rtElem=\"footer\">\n @switch (type()) {\n @case ('date') {\n <button\n rtButton\n qa-dataid=\"date-panel-today\"\n theme=\"secondary\"\n appearance=\"text\"\n size=\"sm\"\n type=\"button\"\n [label]=\"t().uiToday\"\n [attr.aria-label]=\"t().uiToday\"\n [disabled]=\"todayOff()\"\n (click)=\"pickToday()\"></button>\n }\n @case ('time') {\n <button\n rtButton\n qa-dataid=\"date-panel-now\"\n theme=\"secondary\"\n appearance=\"text\"\n size=\"sm\"\n type=\"button\"\n [label]=\"t().uiNow\"\n [attr.aria-label]=\"t().uiNow\"\n (click)=\"pickNow()\"></button>\n <button\n rtButton\n qa-dataid=\"date-panel-done\"\n size=\"sm\"\n type=\"button\"\n [label]=\"t().uiDone\"\n [attr.aria-label]=\"t().uiDone\"\n [disabled]=\"!canApply()\"\n (click)=\"apply()\"></button>\n }\n @default {\n <button\n rtButton\n qa-dataid=\"date-panel-apply\"\n size=\"sm\"\n type=\"button\"\n [label]=\"t().uiApply\"\n [attr.aria-label]=\"t().uiApply\"\n [disabled]=\"!canApply()\"\n (click)=\"apply()\"></button>\n }\n }\n </div>\n</ng-container>\n",
571
+ styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-date-panel{--rt-date-panel-cell-size: var(--rt-control-height-sm);--rt-date-panel-cell-radius: var(--rt-radius-md);--rt-date-panel-divider-width: var(--rt-border-width-thin);--rt-date-panel-column-height: calc(var(--rt-date-panel-cell-size) * 7 + var(--rt-space-0-5) * 6);display:flex;flex-direction:column;padding:var(--rt-space-4);gap:var(--rt-space-4)}.rt-date-panel__body{display:flex;align-items:flex-start;gap:var(--rt-space-4)}.rt-date-panel .rt-date-panel__calendar{--rt-calendar-month-count: 1;--rt-calendar-day-justify: center}.rt-date-panel__calendar,.rt-date-panel__months{flex:1 1 auto;min-inline-size:calc(var(--rt-size-10) * 7)}.rt-date-panel__months-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--rt-space-4)}.rt-date-panel__year{color:var(--rt-color-text-primary);font-weight:var(--rt-font-weight-semibold)}.rt-date-panel__month-grid{display:grid;gap:var(--rt-space-1);grid-template-columns:repeat(3,1fr)}.rt-date-panel__time{display:flex;gap:var(--rt-space-1)}.rt-date-panel__column{position:relative;display:flex;flex-direction:column;gap:var(--rt-space-0-5);max-block-size:var(--rt-date-panel-column-height);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}.rt-date-panel__cell{flex:0 0 auto;padding:0 var(--rt-space-2);border:none;border-radius:var(--rt-date-panel-cell-radius);background:none;color:var(--rt-color-text-primary);cursor:pointer;font:inherit;font-size:var(--rt-text-sm);font-variant-numeric:tabular-nums;min-block-size:var(--rt-date-panel-cell-size);min-inline-size:var(--rt-control-height-md)}.rt-date-panel__cell:hover:not(:disabled,[aria-pressed=true]){background:var(--rt-color-bg-subtle)}.rt-date-panel__cell:focus-visible{outline:var(--rt-focus-ring-width) solid var(--rt-focus-ring-color);outline-offset:var(--rt-focus-ring-offset)}.rt-date-panel__cell[aria-pressed=true]{background:var(--rt-color-action-primary);color:var(--rt-color-action-on-primary)}.rt-date-panel__cell:disabled{color:var(--rt-color-text-muted);cursor:not-allowed;opacity:.45}.rt-date-panel__footer{display:flex;justify-content:flex-end;padding-top:var(--rt-space-2);border-top:var(--rt-date-panel-divider-width) solid var(--rt-color-border-subtle);gap:var(--rt-space-2)}.rt-date-panel:not(.rt-date-panel--with-time) .rt-date-panel__footer{justify-content:center}.rt-date-panel--sheet{--rt-date-panel-cell-size: calc(var(--rt-size-10) + var(--rt-size-1));padding-inline:0}.rt-date-panel--sheet .rt-date-panel__calendar{--rt-calendar-day-size: var(--rt-date-panel-cell-size)}.rt-date-panel--sheet .rt-date-panel__body{flex-direction:column;align-items:stretch}.rt-date-panel--sheet .rt-date-panel__calendar,.rt-date-panel--sheet .rt-date-panel__months{min-inline-size:0}.rt-date-panel--sheet .rt-date-panel__time{justify-content:center}.rt-date-panel--sheet .rt-date-panel__column{flex:1 1 0}}\n"]
572
+ }]
573
+ }],
574
+ ctorParameters: () => [],
575
+ propDecorators: {
576
+ timeCells: [{
577
+ type: i0.ViewChildren,
578
+ args: ["timeCell", { isSignal: true }]
579
+ }],
580
+ type: [{
581
+ type: i0.Input,
582
+ args: [{
583
+ isSignal: true,
584
+ alias: "type",
585
+ required: true
586
+ }]
587
+ }],
588
+ value: [{
589
+ type: i0.Input,
590
+ args: [{
591
+ isSignal: true,
592
+ alias: "value",
593
+ required: false
594
+ }]
595
+ }],
596
+ min: [{
597
+ type: i0.Input,
598
+ args: [{
599
+ isSignal: true,
600
+ alias: "min",
601
+ required: false
602
+ }]
603
+ }],
604
+ max: [{
605
+ type: i0.Input,
606
+ args: [{
607
+ isSignal: true,
608
+ alias: "max",
609
+ required: false
610
+ }]
611
+ }],
612
+ minuteStep: [{
613
+ type: i0.Input,
614
+ args: [{
615
+ isSignal: true,
616
+ alias: "minuteStep",
617
+ required: false
618
+ }]
619
+ }],
620
+ sheet: [{
621
+ type: i0.Input,
622
+ args: [{
623
+ isSignal: true,
624
+ alias: "sheet",
625
+ required: false
626
+ }]
627
+ }],
628
+ now: [{
629
+ type: i0.Input,
630
+ args: [{
631
+ isSignal: true,
632
+ alias: "now",
633
+ required: false
634
+ }]
635
+ }],
636
+ picked: [{
637
+ type: i0.Output,
638
+ args: ["picked"]
639
+ }],
640
+ closed: [{
641
+ type: i0.Output,
642
+ args: ["closed"]
643
+ }]
644
+ }
645
+ });
458
646
  const SAMPLE_DAY = new Date(2026, 0, 31);
459
- const DEFAULT_LAYOUT = { order: ['day', 'month', 'year'], separator: '.' };
647
+ const DEFAULT_LAYOUT = {
648
+ order: [
649
+ "day",
650
+ "month",
651
+ "year"
652
+ ],
653
+ separator: "."
654
+ };
460
655
  const YEAR_LEN = 4;
461
656
  const PART_MAX_LEN = 2;
462
657
  const DAY_GROUPS = 3;
463
658
  const TIME_GROUPS = 2;
464
- /** Знаки, которые встречаются в тексте даты любой локали, кроме цифр. */
465
659
  const TEXT_RE = /^[\d\s.,/:\-T]+$/;
466
660
  function isDatePart(type) {
467
- return type === 'day' || type === 'month' || type === 'year';
661
+ return type === "day" || type === "month" || type === "year";
468
662
  }
469
663
  function dayText(day, layout) {
470
- const [year, month, date] = day.split('-');
471
- const parts = { day: date, month, year };
472
- return layout.order.map((part) => parts[part]).join(layout.separator);
664
+ const [year, month, date] = day.split("-");
665
+ const parts = {
666
+ day: date,
667
+ month,
668
+ year
669
+ };
670
+ return layout.order.map((part) => parts[part]).join(layout.separator);
473
671
  }
474
- /** День ISO из трёх групп цифр в порядке локали; `null` — группы не складываются в день. */
475
672
  function readDay(groups, layout) {
476
- const parts = {};
477
- layout.order.forEach((part, index) => {
478
- parts[part] = groups[index];
479
- });
480
- const { day, month, year } = parts;
481
- if (day === undefined || month === undefined || year?.length !== YEAR_LEN) {
482
- return null;
483
- }
484
- if (day.length > PART_MAX_LEN || month.length > PART_MAX_LEN) {
485
- return null;
486
- }
487
- return `${year}-${month.padStart(PART_MAX_LEN, '0')}-${day.padStart(PART_MAX_LEN, '0')}`;
488
- }
489
- /** Время ISO из двух групп цифр: часы в один или два знака, минуты — ровно два. */
673
+ const parts = {};
674
+ layout.order.forEach((part, index) => {
675
+ parts[part] = groups[index];
676
+ });
677
+ const { day, month, year } = parts;
678
+ if (day === void 0 || month === void 0 || year?.length !== YEAR_LEN) return null;
679
+ if (day.length > PART_MAX_LEN || month.length > PART_MAX_LEN) return null;
680
+ return `${year}-${month.padStart(PART_MAX_LEN, "0")}-${day.padStart(PART_MAX_LEN, "0")}`;
681
+ }
490
682
  function readTime(groups) {
491
- if (groups.length !== TIME_GROUPS) {
492
- return null;
493
- }
494
- const [hour, minute] = groups;
495
- if (minute.length !== PART_MAX_LEN || hour.length > PART_MAX_LEN) {
496
- return null;
497
- }
498
- return `${hour.padStart(PART_MAX_LEN, '0')}:${minute}`;
499
- }
500
- /** Значение типа из групп цифр текста; `null` — группы не складываются в значение. */
683
+ if (groups.length !== TIME_GROUPS) return null;
684
+ const [hour, minute] = groups;
685
+ if (minute.length !== PART_MAX_LEN || hour.length > PART_MAX_LEN) return null;
686
+ return `${hour.padStart(PART_MAX_LEN, "0")}:${minute}`;
687
+ }
501
688
  function readGroups(groups, type, layout) {
502
- if (type === 'time') {
503
- return readTime(groups);
504
- }
505
- if (type === 'date') {
506
- return groups.length === DAY_GROUPS ? readDay(groups, layout) : null;
507
- }
508
- if (groups.length !== DAY_GROUPS + TIME_GROUPS) {
509
- return null;
510
- }
511
- const day = readDay(groups.slice(0, DAY_GROUPS), layout);
512
- const time = readTime(groups.slice(DAY_GROUPS));
513
- return day === null || time === null ? null : `${day}T${time}`;
514
- }
515
- /** Порядок дня, месяца и года и знак между ними — по локали. */
689
+ if (type === "time") return readTime(groups);
690
+ if (type === "date") return groups.length === DAY_GROUPS ? readDay(groups, layout) : null;
691
+ if (groups.length !== 5) return null;
692
+ const day = readDay(groups.slice(0, DAY_GROUPS), layout);
693
+ const time = readTime(groups.slice(DAY_GROUPS));
694
+ return day === null || time === null ? null : `${day}T${time}`;
695
+ }
516
696
  function rtDateLayout(locale) {
517
- const parts = new Intl.DateTimeFormat(locale, {
518
- day: '2-digit',
519
- month: '2-digit',
520
- year: 'numeric',
521
- }).formatToParts(SAMPLE_DAY);
522
- const order = parts
523
- .map((part) => part.type)
524
- .filter((type) => isDatePart(type));
525
- const separator = parts.find((part) => part.type === 'literal')?.value.trim() ?? '';
526
- if (order.length !== DAY_GROUPS || separator === '') {
527
- return DEFAULT_LAYOUT;
528
- }
529
- return { order, separator };
530
- }
531
- /**
532
- * Текст поля для значения ISO; пустое значение — пустой текст. Строка, которая не читается как
533
- * значение этого типа, показывается как есть: она пришла из формы мимо поля и не должна пропасть.
534
- */
697
+ const parts = new Intl.DateTimeFormat(locale, {
698
+ day: "2-digit",
699
+ month: "2-digit",
700
+ year: "numeric"
701
+ }).formatToParts(SAMPLE_DAY);
702
+ const order = parts.map((part) => part.type).filter((type) => isDatePart(type));
703
+ const separator = parts.find((part) => part.type === "literal")?.value.trim() ?? "";
704
+ if (order.length !== DAY_GROUPS || separator === "") return DEFAULT_LAYOUT;
705
+ return {
706
+ order,
707
+ separator
708
+ };
709
+ }
535
710
  function rtDateText(value, type, layout) {
536
- if (type === 'time' || rtDateRead(value, type) === null) {
537
- return value;
538
- }
539
- if (type === 'date') {
540
- return dayText(value, layout);
541
- }
542
- const [day, time] = value.split('T');
543
- return `${dayText(day, layout)} ${time}`;
544
- }
545
- /** Подсказка формы текста в буквах кита: `дд.мм.гггг`, `чч:мм`, `дд.мм.гггг чч:мм`. */
711
+ if (type === "time" || rtDateRead(value, type) === null) return value;
712
+ if (type === "date") return dayText(value, layout);
713
+ const [day, time] = value.split("T");
714
+ return `${dayText(day, layout)} ${time}`;
715
+ }
546
716
  function rtDateShape(type, layout, letters) {
547
- const time = `${letters.hour}:${letters.minute}`;
548
- if (type === 'time') {
549
- return time;
550
- }
551
- const day = layout.order.map((part) => letters[part]).join(layout.separator);
552
- return type === 'date' ? day : `${day} ${time}`;
553
- }
554
- /**
555
- * Читает набранный текст в значение ISO; `null` — текст не значение этого типа. Читается и
556
- * порядок локали, и сама форма значения: вставленная `2026-08-01` тоже становится значением.
557
- */
717
+ const time = `${letters.hour}:${letters.minute}`;
718
+ if (type === "time") return time;
719
+ const day = layout.order.map((part) => letters[part]).join(layout.separator);
720
+ return type === "date" ? day : `${day} ${time}`;
721
+ }
558
722
  function rtDateParse(text, type, layout) {
559
- const iso = rtDateRead(text, type);
560
- if (iso !== null) {
561
- return iso;
562
- }
563
- const value = text.trim();
564
- if (!TEXT_RE.test(value)) {
565
- return null;
566
- }
567
- const candidate = readGroups(value.match(/\d+/g) ?? [], type, layout);
568
- // Кандидат проверяется той же формой значения: 31.02.2026 складывается в строку, но не в день.
569
- return candidate === null ? null : rtDateRead(candidate, type);
723
+ const iso = rtDateRead(text, type);
724
+ if (iso !== null) return iso;
725
+ const value = text.trim();
726
+ if (!TEXT_RE.test(value)) return null;
727
+ const candidate = readGroups(value.match(/\d+/g) ?? [], type, layout);
728
+ return candidate === null ? null : rtDateRead(candidate, type);
570
729
  }
571
-
572
- const BEM_BLOCK = 'rt-date-picker';
573
- /**
574
- * Поле даты, времени или даты со временем со своей панелью кита, визуально и по токенам
575
- * идентичное rt-input (host — box `--rt-input-*`, input — прозрачный `__field`). Кнопка в конце
576
- * поля открывает `rt-date-panel`: на широком экране в поповере, на узком — в нижней шторке.
577
- * CVA через общий `RtFormControlBase`: clearable, авто-подсветка invalid, read-only
578
- * представление (значение форматируется через Intl).
579
- *
580
- * `value` — строка формы нативного input'а (`YYYY-MM-DD`, `YYYY-MM-DDTHH:mm`, `HH:mm`). Текст в
581
- * поле — дата в порядке языка интерфейса (`01.08.2026` под `ru`), время `HH:mm`; набирается так же,
582
- * вставленная форма значения тоже читается. Нечитаемый или лежащий за границами текст оставляет
583
- * значение прежним и помечает поле ошибкой.
584
- */
585
- class RtDatePickerComponent extends RtFormControlBase {
586
- constructor() {
587
- super(...arguments);
588
- /** Локаль кита: приложение, меняющее язык на ходу, меняет её, и текст поля пересчитывается. */
589
- this.#locale = inject(RT_KIT_LOCALE);
590
- /** Порядок дня, месяца и года в тексте поля — по локали кита. */
591
- this.#layout = computed(() => rtDateLayout(this.#locale()), /* @ts-ignore */
592
- ...(ngDevMode ? [{ debugName: "#layout" }] : /* istanbul ignore next */ []));
593
- this.t = inject(RT_KIT_LABELS);
594
- /** Узкий экран: панель открывается в нижней шторке, а не в поповере. */
595
- this.narrow = inject(BreakpointsService).narrow;
596
- this.fieldEl = viewChild('fieldEl', /* @ts-ignore */
597
- ...(ngDevMode ? [{ debugName: "fieldEl" }] : /* istanbul ignore next */ []));
598
- this.popover = viewChild(RtPopoverDirective, /* @ts-ignore */
599
- ...(ngDevMode ? [{ debugName: "popover" }] : /* istanbul ignore next */ []));
600
- /** Набранный текст не читается как значение в границах: поле помечено ошибкой. */
601
- this.textInvalid = signal(false, /* @ts-ignore */
602
- ...(ngDevMode ? [{ debugName: "textInvalid" }] : /* istanbul ignore next */ []));
603
- this.sheetOpen = signal(false, /* @ts-ignore */
604
- ...(ngDevMode ? [{ debugName: "sheetOpen" }] : /* istanbul ignore next */ []));
605
- /** Подсказка формы текста буквами кита: `дд.мм.гггг` под русскими метками. */
606
- this.shape = computed(() => {
607
- const labels = this.t();
608
- return rtDateShape(this.type(), this.#layout(), {
609
- day: labels.uiShapeDay,
610
- month: labels.uiShapeMonth,
611
- year: labels.uiShapeYear,
612
- hour: labels.uiShapeHour,
613
- minute: labels.uiShapeMinute,
614
- });
615
- }, /* @ts-ignore */
616
- ...(ngDevMode ? [{ debugName: "shape" }] : /* istanbul ignore next */ []));
617
- /**
618
- * Текст в поле — значение в порядке языка интерфейса. Не строку форма кладёт мимо контракта
619
- * (например `Date`), и поле показывает её пустой, как показывало браузерное.
620
- */
621
- this.text = computed(() => this.#text(this.value()), /* @ts-ignore */
622
- ...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
623
- this.openIcon = computed(() => this.type() === 'time' ? 'ico-time' : 'ico-calendar', /* @ts-ignore */
624
- ...(ngDevMode ? [{ debugName: "openIcon" }] : /* istanbul ignore next */ []));
625
- this.hasValue = computed(() => this.value() !== '', /* @ts-ignore */
626
- ...(ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []));
627
- /**
628
- * Ширина поля в знаках — по длине формы значения. Без неё текстовое поле берёт от браузера
629
- * двадцать знаков и в строке отборов потребителя занимает место вдвое шире значения.
630
- */
631
- this.fieldSize = computed(() => this.shape().length, /* @ts-ignore */
632
- ...(ngDevMode ? [{ debugName: "fieldSize" }] : /* istanbul ignore next */ []));
633
- /** Подсказка обрезается многоточием в узком поле, поэтому шаблон целиком виден при наведении. */
634
- this.shapeTitle = computed(() => (this.hasValue() ? null : this.shape()), /* @ts-ignore */
635
- ...(ngDevMode ? [{ debugName: "shapeTitle" }] : /* istanbul ignore next */ []));
636
- /** Вид рамки: `outline` — рамка со всех сторон, `fill` — залитое поле с чертой снизу. */
637
- this.appearance = input('outline', /* @ts-ignore */
638
- ...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
639
- this.displayText = computed(() => this.#format(this.value(), this.type()), /* @ts-ignore */
640
- ...(ngDevMode ? [{ debugName: "displayText" }] : /* istanbul ignore next */ []));
641
- this.type = input('date', /* @ts-ignore */
642
- ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
643
- this.min = input(null, /* @ts-ignore */
644
- ...(ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []));
645
- this.max = input(null, /* @ts-ignore */
646
- ...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
647
- /** Шаг колонки минут в панели. */
648
- this.minuteStep = input(5, { ...(ngDevMode ? { debugName: "minuteStep" } : /* istanbul ignore next */ {}), transform: numberAttribute });
649
- }
650
- /** Локаль кита: приложение, меняющее язык на ходу, меняет её, и текст поля пересчитывается. */
651
- #locale;
652
- /** Порядок дня, месяца и года в тексте поля — по локали кита. */
653
- #layout;
654
- /** Значение из формы снимает ошибку набора: в поле теперь стоит оно. */
655
- writeValue(value) {
656
- super.writeValue(value);
657
- this.textInvalid.set(false);
658
- }
659
- getEmptyValue() {
660
- return '';
661
- }
662
- focusAfterClear() {
663
- this.fieldEl()?.nativeElement.focus();
664
- }
665
- clearValue() {
666
- super.clearValue();
667
- this.#accept('');
668
- }
669
- /** Набор текста: значение меняется, только когда текст читается как значение в границах. */
670
- onTyped(event) {
671
- const text = event.target.value;
672
- if (text.trim() === '') {
673
- this.#commit('');
674
- return;
675
- }
676
- const read = rtDateParse(text, this.type(), this.#layout());
677
- if (read === null || !rtDateInBounds(read, this.min(), this.max())) {
678
- this.textInvalid.set(true);
679
- return;
680
- }
681
- this.#commit(read);
682
- }
683
- /** Кнопка в конце поля: на узком экране открывает шторку, на широком поповер открывает сам. */
684
- openPanel() {
685
- if (this.narrow() && !this.isDisabled()) {
686
- this.sheetOpen.set(true);
687
- }
688
- }
689
- closePanel() {
690
- this.sheetOpen.set(false);
691
- this.popover()?.close();
692
- }
693
- onPicked(value) {
694
- this.#commit(value);
695
- this.markTouched();
696
- }
697
- onBlur() {
698
- this.markTouched();
699
- }
700
- #commit(value) {
701
- this.value.set(value);
702
- this.emitChange(value);
703
- this.#accept(value);
704
- }
705
- /** Текст в поле — принятое значение, ошибки набора нет. */
706
- #accept(value) {
707
- this.textInvalid.set(false);
708
- const node = this.fieldEl()?.nativeElement;
709
- if (node !== undefined) {
710
- node.value = this.#text(value);
711
- }
712
- }
713
- #text(value) {
714
- return typeof value === 'string' ? rtDateText(value, this.type(), this.#layout()) : '';
715
- }
716
- /**
717
- * Форматирует ISO-значение нативного input'а в локализованный текст для
718
- * read-only. Для `time` форматируем как сегодняшнюю дату с временем (нужен
719
- * валидный Date), показывая только часы/минуты.
720
- */
721
- #format(value, type) {
722
- if (value === '') {
723
- return '';
724
- }
725
- const parsed = Date.parse(type === 'time' ? `1970-01-01T${value}` : value);
726
- if (Number.isNaN(parsed)) {
727
- return value;
728
- }
729
- return new Intl.DateTimeFormat(this.#locale(), this.#formatOptions(type)).format(new Date(parsed));
730
- }
731
- #formatOptions(type) {
732
- if (type === 'time') {
733
- return { hour: '2-digit', minute: '2-digit' };
734
- }
735
- if (type === 'datetime-local') {
736
- return { dateStyle: 'medium', timeStyle: 'short' };
737
- }
738
- return { dateStyle: 'medium' };
739
- }
740
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDatePickerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
741
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: RtDatePickerComponent, isStandalone: true, selector: "rt-date-picker", inputs: { appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, minuteStep: { classPropertyName: "minuteStep", publicName: "minuteStep", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.rt-date-picker--disabled": "isDisabled()", "class.rt-date-picker--invalid": "isInvalid() || textInvalid()", "class.rt-date-picker--readonly": "isReadonly()", "class.rt-date-picker--borderless": "!bordered()", "class.rt-date-picker--appearance--fill": "appearance() === 'fill'", "class.rt-date-picker--size--sm": "size() === 'sm'", "class.rt-date-picker--size--lg": "size() === 'lg'" }, classAttribute: "rt-date-picker" }, providers: [
742
- // Алиас базового токена — для contentChild(RtFormControlBase) в rt-field.
743
- { provide: RtFormControlBase, useExisting: forwardRef(() => RtDatePickerComponent) },
744
- ], viewQueries: [{ propertyName: "fieldEl", first: true, predicate: ["fieldEl"], descendants: true, isSignal: true }, { propertyName: "popover", first: true, predicate: RtPopoverDirective, descendants: true, isSignal: true }], usesInheritance: true, hostDirectives: [{ directive: i1.RtRadiusDirective, inputs: ["radius", "radius"] }], ngImport: i0, template: "<ng-container rtBlock=\"rt-date-picker\">\n @if (isReadonly()) {\n <span rtElem=\"readonly\" qa-dataid=\"date-picker-readonly\" [rtMod]=\"{ empty: !displayText() }\">{{ displayText() || '\u2014' }}</span>\n } @else {\n <input\n #fieldEl\n rtElem=\"field\"\n qa-dataid=\"date-picker-control\"\n type=\"text\"\n inputmode=\"numeric\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [value]=\"text()\"\n [disabled]=\"isDisabled()\"\n [attr.placeholder]=\"shape()\"\n [attr.title]=\"shapeTitle()\"\n [attr.size]=\"fieldSize()\"\n [attr.id]=\"effectiveControlId()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-invalid]=\"isInvalid() || textInvalid() || null\"\n (input)=\"onTyped($event)\"\n (blur)=\"onBlur()\" />\n @if (showClearButton()) {\n <rt-icon-button\n rtElem=\"clear\"\n qa-dataid=\"date-picker-clear\"\n icon=\"ico-close\"\n size=\"sm\"\n variant=\"ghost\"\n iconColor=\"muted\"\n [ariaLabel]=\"t().uiClear\"\n [tabIndex]=\"-1\"\n (clicked)=\"clear($event)\" />\n }\n <rt-icon-button\n rtElem=\"open\"\n qa-dataid=\"date-picker-open\"\n size=\"sm\"\n variant=\"ghost\"\n iconColor=\"muted\"\n rtPopoverAlign=\"end\"\n [icon]=\"openIcon()\"\n [ariaLabel]=\"t().uiOpenCalendar\"\n [disabled]=\"isDisabled()\"\n [rtPopover]=\"panelTpl\"\n [rtPopoverDisabled]=\"narrow() || isDisabled()\"\n (clicked)=\"openPanel()\" />\n\n <ng-template #panelTpl>\n <div rtElem=\"popup\" qa-dataid=\"date-picker-popup\">\n <rt-date-panel\n [type]=\"type()\"\n [value]=\"value()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [minuteStep]=\"minuteStep()\"\n (picked)=\"onPicked($event)\"\n (closed)=\"closePanel()\" />\n </div>\n </ng-template>\n\n @if (narrow()) {\n <rt-bottom-sheet qa-dataid=\"date-picker-sheet\" [open]=\"sheetOpen()\" (openChange)=\"sheetOpen.set($event)\">\n @if (sheetOpen()) {\n <rt-date-panel\n sheet\n [type]=\"type()\"\n [value]=\"value()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [minuteStep]=\"minuteStep()\"\n (picked)=\"onPicked($event)\"\n (closed)=\"closePanel()\" />\n }\n </rt-bottom-sheet>\n }\n }\n</ng-container>\n", styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-date-picker{--rt-date-picker-radius: var(--rt-input-radius);--rt-date-picker-fill-radius: var(--rt-radius-sm);position:relative;display:inline-flex;width:100%;min-height:var(--rt-input-height);box-sizing:border-box;align-items:center;padding:var(--rt-input-padding-y) var(--rt-input-padding-x);border:var(--rt-input-border-width) solid var(--rt-input-color-border);border-radius:var(--rt-date-picker-radius);background-color:var(--rt-input-color-bg);color:var(--rt-input-color-text);cursor:text;font-size:var(--rt-input-font-size);gap:var(--rt-space-sm);line-height:var(--rt-input-line-height);transition:var(--rt-input-transition)}.rt-date-picker:focus-within{border-color:var(--rt-input-color-border-focus);box-shadow:var(--rt-input-focus-shadow);outline:2px solid transparent;outline-offset:var(--rt-input-focus-outline-offset)}.rt-date-picker--borderless{border-color:transparent}.rt-date-picker--appearance--fill{border-color:transparent;border-radius:var(--rt-date-picker-fill-radius) var(--rt-date-picker-fill-radius) 0 0;border-bottom-color:var(--rt-color-field-fill-underline);background-color:var(--rt-color-bg-surface-subtle-2)}.rt-date-picker--invalid{border-color:var(--rt-input-color-border-error)}.rt-date-picker--invalid:focus-within{box-shadow:var(--rt-input-focus-shadow-error)}.rt-date-picker--disabled{cursor:not-allowed;opacity:var(--rt-input-disabled-opacity)}.rt-date-picker--size--sm{min-height:var(--rt-input-height-sm)}.rt-date-picker--size--lg{min-height:var(--rt-input-height-lg)}.rt-date-picker--readonly{padding-right:0;padding-left:0;border-color:transparent;background-color:transparent;cursor:default}.rt-date-picker__readonly{color:var(--rt-field-value-color);font-size:var(--rt-field-value-font-size)}.rt-date-picker__readonly--empty{color:var(--rt-field-value-empty-color)}.rt-date-picker__field{min-width:0;flex:1 1 auto;padding:0;border:none;background:transparent;color:inherit;font:inherit;outline:none;text-overflow:ellipsis}.rt-date-picker__field:disabled{cursor:not-allowed}.rt-date-picker__clear,.rt-date-picker__open{flex-shrink:0}.rt-date-picker__popup{border:var(--rt-overlay-select-panel-border-width) solid var(--rt-color-border-subtle);border-radius:var(--rt-overlay-select-radius);background-color:var(--rt-color-bg-surface);box-shadow:var(--rt-overlay-select-shadow)}.rt-date-picker[data-rt-radius=none]{--rt-date-picker-radius: var(--rt-radius-none)}.rt-date-picker[data-rt-radius=xs]{--rt-date-picker-radius: var(--rt-radius-xs)}.rt-date-picker[data-rt-radius=sm]{--rt-date-picker-radius: var(--rt-radius-sm)}.rt-date-picker[data-rt-radius=ms]{--rt-date-picker-radius: var(--rt-radius-ms)}.rt-date-picker[data-rt-radius=md]{--rt-date-picker-radius: var(--rt-radius-md)}.rt-date-picker[data-rt-radius=lg]{--rt-date-picker-radius: var(--rt-radius-lg)}.rt-date-picker[data-rt-radius=xl]{--rt-date-picker-radius: var(--rt-radius-xl)}.rt-date-picker[data-rt-radius=\"2xl\"]{--rt-date-picker-radius: var(--rt-radius-2xl)}.rt-date-picker[data-rt-radius=full]{--rt-date-picker-radius: var(--rt-radius-full)}}\n"], dependencies: [{ kind: "component", type:
745
- // standalone components / directives
746
- RtBottomSheetComponent, selector: "rt-bottom-sheet", inputs: ["open"], outputs: ["openChange"] }, { kind: "component", type: RtDatePanelComponent, selector: "rt-date-panel", inputs: ["type", "value", "min", "max", "minuteStep", "sheet", "now"], outputs: ["picked", "closed"] }, { kind: "component", type: RtIconButtonComponent, selector: "rt-icon-button", inputs: ["icon", "glyph", "ariaLabel", "variant", "iconColor", "iconFill", "size", "iconSize", "type", "tooltip", "tabIndex", "loading", "disabled", "active", "indicator"], outputs: ["clicked"] }, { kind: "directive", type: RtPopoverDirective, selector: "[rtPopover]", inputs: ["rtPopover", "rtPopoverTrigger", "rtPopoverWidth", "rtPopoverAlign", "rtPopoverFitViewport", "rtPopoverContext", "rtPopoverPanelClass", "rtPopoverDisabled", "rtPopoverOffsetY", "rtPopoverOffsetX"], outputs: ["rtPopoverOpened", "rtPopoverClosed"], exportAs: ["rtPopover"] }, { kind: "directive", type: BlockDirective, selector: "[rtBlock]", inputs: ["rtMod"] }, { kind: "directive", type: ElemDirective, selector: "[rtElem]", inputs: ["rtMod"] }, { kind: "directive", type: ModDirective, selector: "[rtMod]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
747
- }
748
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDatePickerComponent, decorators: [{
749
- type: Component,
750
- args: [{ selector: 'rt-date-picker', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
751
- // standalone components / directives
752
- RtBottomSheetComponent,
753
- RtDatePanelComponent,
754
- RtIconButtonComponent,
755
- RtPopoverDirective,
756
- BlockDirective,
757
- ElemDirective,
758
- ModDirective,
759
- ], providers: [
760
- // Алиас базового токена — для contentChild(RtFormControlBase) в rt-field.
761
- { provide: RtFormControlBase, useExisting: forwardRef(() => RtDatePickerComponent) },
762
- ], hostDirectives: [{ directive: RtRadiusDirective, inputs: ['radius'] }], host: {
763
- class: BEM_BLOCK,
764
- '[class.rt-date-picker--disabled]': 'isDisabled()',
765
- '[class.rt-date-picker--invalid]': 'isInvalid() || textInvalid()',
766
- '[class.rt-date-picker--readonly]': 'isReadonly()',
767
- '[class.rt-date-picker--borderless]': '!bordered()',
768
- '[class.rt-date-picker--appearance--fill]': "appearance() === 'fill'",
769
- '[class.rt-date-picker--size--sm]': "size() === 'sm'",
770
- '[class.rt-date-picker--size--lg]': "size() === 'lg'",
771
- }, template: "<ng-container rtBlock=\"rt-date-picker\">\n @if (isReadonly()) {\n <span rtElem=\"readonly\" qa-dataid=\"date-picker-readonly\" [rtMod]=\"{ empty: !displayText() }\">{{ displayText() || '\u2014' }}</span>\n } @else {\n <input\n #fieldEl\n rtElem=\"field\"\n qa-dataid=\"date-picker-control\"\n type=\"text\"\n inputmode=\"numeric\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [value]=\"text()\"\n [disabled]=\"isDisabled()\"\n [attr.placeholder]=\"shape()\"\n [attr.title]=\"shapeTitle()\"\n [attr.size]=\"fieldSize()\"\n [attr.id]=\"effectiveControlId()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-invalid]=\"isInvalid() || textInvalid() || null\"\n (input)=\"onTyped($event)\"\n (blur)=\"onBlur()\" />\n @if (showClearButton()) {\n <rt-icon-button\n rtElem=\"clear\"\n qa-dataid=\"date-picker-clear\"\n icon=\"ico-close\"\n size=\"sm\"\n variant=\"ghost\"\n iconColor=\"muted\"\n [ariaLabel]=\"t().uiClear\"\n [tabIndex]=\"-1\"\n (clicked)=\"clear($event)\" />\n }\n <rt-icon-button\n rtElem=\"open\"\n qa-dataid=\"date-picker-open\"\n size=\"sm\"\n variant=\"ghost\"\n iconColor=\"muted\"\n rtPopoverAlign=\"end\"\n [icon]=\"openIcon()\"\n [ariaLabel]=\"t().uiOpenCalendar\"\n [disabled]=\"isDisabled()\"\n [rtPopover]=\"panelTpl\"\n [rtPopoverDisabled]=\"narrow() || isDisabled()\"\n (clicked)=\"openPanel()\" />\n\n <ng-template #panelTpl>\n <div rtElem=\"popup\" qa-dataid=\"date-picker-popup\">\n <rt-date-panel\n [type]=\"type()\"\n [value]=\"value()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [minuteStep]=\"minuteStep()\"\n (picked)=\"onPicked($event)\"\n (closed)=\"closePanel()\" />\n </div>\n </ng-template>\n\n @if (narrow()) {\n <rt-bottom-sheet qa-dataid=\"date-picker-sheet\" [open]=\"sheetOpen()\" (openChange)=\"sheetOpen.set($event)\">\n @if (sheetOpen()) {\n <rt-date-panel\n sheet\n [type]=\"type()\"\n [value]=\"value()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [minuteStep]=\"minuteStep()\"\n (picked)=\"onPicked($event)\"\n (closed)=\"closePanel()\" />\n }\n </rt-bottom-sheet>\n }\n }\n</ng-container>\n", styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-date-picker{--rt-date-picker-radius: var(--rt-input-radius);--rt-date-picker-fill-radius: var(--rt-radius-sm);position:relative;display:inline-flex;width:100%;min-height:var(--rt-input-height);box-sizing:border-box;align-items:center;padding:var(--rt-input-padding-y) var(--rt-input-padding-x);border:var(--rt-input-border-width) solid var(--rt-input-color-border);border-radius:var(--rt-date-picker-radius);background-color:var(--rt-input-color-bg);color:var(--rt-input-color-text);cursor:text;font-size:var(--rt-input-font-size);gap:var(--rt-space-sm);line-height:var(--rt-input-line-height);transition:var(--rt-input-transition)}.rt-date-picker:focus-within{border-color:var(--rt-input-color-border-focus);box-shadow:var(--rt-input-focus-shadow);outline:2px solid transparent;outline-offset:var(--rt-input-focus-outline-offset)}.rt-date-picker--borderless{border-color:transparent}.rt-date-picker--appearance--fill{border-color:transparent;border-radius:var(--rt-date-picker-fill-radius) var(--rt-date-picker-fill-radius) 0 0;border-bottom-color:var(--rt-color-field-fill-underline);background-color:var(--rt-color-bg-surface-subtle-2)}.rt-date-picker--invalid{border-color:var(--rt-input-color-border-error)}.rt-date-picker--invalid:focus-within{box-shadow:var(--rt-input-focus-shadow-error)}.rt-date-picker--disabled{cursor:not-allowed;opacity:var(--rt-input-disabled-opacity)}.rt-date-picker--size--sm{min-height:var(--rt-input-height-sm)}.rt-date-picker--size--lg{min-height:var(--rt-input-height-lg)}.rt-date-picker--readonly{padding-right:0;padding-left:0;border-color:transparent;background-color:transparent;cursor:default}.rt-date-picker__readonly{color:var(--rt-field-value-color);font-size:var(--rt-field-value-font-size)}.rt-date-picker__readonly--empty{color:var(--rt-field-value-empty-color)}.rt-date-picker__field{min-width:0;flex:1 1 auto;padding:0;border:none;background:transparent;color:inherit;font:inherit;outline:none;text-overflow:ellipsis}.rt-date-picker__field:disabled{cursor:not-allowed}.rt-date-picker__clear,.rt-date-picker__open{flex-shrink:0}.rt-date-picker__popup{border:var(--rt-overlay-select-panel-border-width) solid var(--rt-color-border-subtle);border-radius:var(--rt-overlay-select-radius);background-color:var(--rt-color-bg-surface);box-shadow:var(--rt-overlay-select-shadow)}.rt-date-picker[data-rt-radius=none]{--rt-date-picker-radius: var(--rt-radius-none)}.rt-date-picker[data-rt-radius=xs]{--rt-date-picker-radius: var(--rt-radius-xs)}.rt-date-picker[data-rt-radius=sm]{--rt-date-picker-radius: var(--rt-radius-sm)}.rt-date-picker[data-rt-radius=ms]{--rt-date-picker-radius: var(--rt-radius-ms)}.rt-date-picker[data-rt-radius=md]{--rt-date-picker-radius: var(--rt-radius-md)}.rt-date-picker[data-rt-radius=lg]{--rt-date-picker-radius: var(--rt-radius-lg)}.rt-date-picker[data-rt-radius=xl]{--rt-date-picker-radius: var(--rt-radius-xl)}.rt-date-picker[data-rt-radius=\"2xl\"]{--rt-date-picker-radius: var(--rt-radius-2xl)}.rt-date-picker[data-rt-radius=full]{--rt-date-picker-radius: var(--rt-radius-full)}}\n"] }]
772
- }], propDecorators: { fieldEl: [{ type: i0.ViewChild, args: ['fieldEl', { isSignal: true }] }], popover: [{ type: i0.ViewChild, args: [i0.forwardRef(() => RtPopoverDirective), { isSignal: true }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], minuteStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "minuteStep", required: false }] }] } });
773
-
774
- /**
775
- * Generated bundle index. Do not edit.
776
- */
777
-
730
+ const BEM_BLOCK = "rt-date-picker";
731
+ var RtDatePickerComponent = class RtDatePickerComponent extends RtFormControlBase {
732
+ constructor() {
733
+ super(...arguments);
734
+ this.#locale = inject(RT_KIT_LOCALE);
735
+ this.#layout = computed(() => rtDateLayout(this.#locale()), ...ngDevMode ? [{ debugName: "#layout" }] : /* istanbul ignore next */ []);
736
+ this.t = inject(RT_KIT_LABELS);
737
+ this.narrow = inject(BreakpointsService).narrow;
738
+ this.fieldEl = viewChild("fieldEl", ...ngDevMode ? [{ debugName: "fieldEl" }] : /* istanbul ignore next */ []);
739
+ this.popover = viewChild(RtPopoverDirective, ...ngDevMode ? [{ debugName: "popover" }] : /* istanbul ignore next */ []);
740
+ this.textInvalid = signal(false, ...ngDevMode ? [{ debugName: "textInvalid" }] : /* istanbul ignore next */ []);
741
+ this.sheetOpen = signal(false, ...ngDevMode ? [{ debugName: "sheetOpen" }] : /* istanbul ignore next */ []);
742
+ this.shape = computed(() => {
743
+ const labels = this.t();
744
+ return rtDateShape(this.type(), this.#layout(), {
745
+ day: labels.uiShapeDay,
746
+ month: labels.uiShapeMonth,
747
+ year: labels.uiShapeYear,
748
+ hour: labels.uiShapeHour,
749
+ minute: labels.uiShapeMinute
750
+ });
751
+ }, ...ngDevMode ? [{ debugName: "shape" }] : /* istanbul ignore next */ []);
752
+ this.text = computed(() => this.#text(this.value()), ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
753
+ this.openIcon = computed(() => this.type() === "time" ? "ico-time" : "ico-calendar", ...ngDevMode ? [{ debugName: "openIcon" }] : /* istanbul ignore next */ []);
754
+ this.hasValue = computed(() => this.value() !== "", ...ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []);
755
+ this.fieldSize = computed(() => this.shape().length, ...ngDevMode ? [{ debugName: "fieldSize" }] : /* istanbul ignore next */ []);
756
+ this.shapeTitle = computed(() => this.hasValue() ? null : this.shape(), ...ngDevMode ? [{ debugName: "shapeTitle" }] : /* istanbul ignore next */ []);
757
+ this.appearance = input("outline", ...ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []);
758
+ this.displayText = computed(() => this.#format(this.value(), this.type()), ...ngDevMode ? [{ debugName: "displayText" }] : /* istanbul ignore next */ []);
759
+ this.type = input("date", ...ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []);
760
+ this.min = input(null, ...ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []);
761
+ this.max = input(null, ...ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []);
762
+ this.minuteStep = input(5, {
763
+ ...ngDevMode ? { debugName: "minuteStep" } : /* istanbul ignore next */ {},
764
+ transform: numberAttribute
765
+ });
766
+ }
767
+ #locale;
768
+ #layout;
769
+ writeValue(value) {
770
+ super.writeValue(value);
771
+ this.textInvalid.set(false);
772
+ }
773
+ getEmptyValue() {
774
+ return "";
775
+ }
776
+ focusAfterClear() {
777
+ this.fieldEl()?.nativeElement.focus();
778
+ }
779
+ clearValue() {
780
+ super.clearValue();
781
+ this.#accept("");
782
+ }
783
+ onTyped(event) {
784
+ const text = event.target.value;
785
+ if (text.trim() === "") {
786
+ this.#commit("");
787
+ return;
788
+ }
789
+ const read = rtDateParse(text, this.type(), this.#layout());
790
+ if (read === null || !rtDateInBounds(read, this.min(), this.max())) {
791
+ this.textInvalid.set(true);
792
+ return;
793
+ }
794
+ this.#commit(read);
795
+ }
796
+ openPanel() {
797
+ if (this.narrow() && !this.isDisabled()) this.sheetOpen.set(true);
798
+ }
799
+ closePanel() {
800
+ this.sheetOpen.set(false);
801
+ this.popover()?.close();
802
+ }
803
+ onPicked(value) {
804
+ this.#commit(value);
805
+ this.markTouched();
806
+ }
807
+ onBlur() {
808
+ this.markTouched();
809
+ }
810
+ #commit(value) {
811
+ this.value.set(value);
812
+ this.emitChange(value);
813
+ this.#accept(value);
814
+ }
815
+ #accept(value) {
816
+ this.textInvalid.set(false);
817
+ const node = this.fieldEl()?.nativeElement;
818
+ if (node !== void 0) node.value = this.#text(value);
819
+ }
820
+ #text(value) {
821
+ return typeof value === "string" ? rtDateText(value, this.type(), this.#layout()) : "";
822
+ }
823
+ #format(value, type) {
824
+ if (value === "") return "";
825
+ const parsed = Date.parse(type === "time" ? `1970-01-01T${value}` : value);
826
+ if (Number.isNaN(parsed)) return value;
827
+ return new Intl.DateTimeFormat(this.#locale(), this.#formatOptions(type)).format(new Date(parsed));
828
+ }
829
+ #formatOptions(type) {
830
+ if (type === "time") return {
831
+ hour: "2-digit",
832
+ minute: "2-digit"
833
+ };
834
+ if (type === "datetime-local") return {
835
+ dateStyle: "medium",
836
+ timeStyle: "short"
837
+ };
838
+ return { dateStyle: "medium" };
839
+ }
840
+ static {
841
+ this.ɵfac = i0.ɵɵngDeclareFactory({
842
+ minVersion: "12.0.0",
843
+ version: "22.2.2",
844
+ ngImport: i0,
845
+ type: RtDatePickerComponent,
846
+ deps: null,
847
+ target: i0.ɵɵFactoryTarget.Component
848
+ });
849
+ }
850
+ static {
851
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
852
+ minVersion: "17.0.0",
853
+ version: "22.2.2",
854
+ type: RtDatePickerComponent,
855
+ isStandalone: true,
856
+ selector: "rt-date-picker",
857
+ inputs: {
858
+ appearance: {
859
+ classPropertyName: "appearance",
860
+ publicName: "appearance",
861
+ isSignal: true,
862
+ isRequired: false,
863
+ transformFunction: null
864
+ },
865
+ type: {
866
+ classPropertyName: "type",
867
+ publicName: "type",
868
+ isSignal: true,
869
+ isRequired: false,
870
+ transformFunction: null
871
+ },
872
+ min: {
873
+ classPropertyName: "min",
874
+ publicName: "min",
875
+ isSignal: true,
876
+ isRequired: false,
877
+ transformFunction: null
878
+ },
879
+ max: {
880
+ classPropertyName: "max",
881
+ publicName: "max",
882
+ isSignal: true,
883
+ isRequired: false,
884
+ transformFunction: null
885
+ },
886
+ minuteStep: {
887
+ classPropertyName: "minuteStep",
888
+ publicName: "minuteStep",
889
+ isSignal: true,
890
+ isRequired: false,
891
+ transformFunction: null
892
+ }
893
+ },
894
+ host: {
895
+ properties: {
896
+ "class.rt-date-picker--disabled": "isDisabled()",
897
+ "class.rt-date-picker--invalid": "isInvalid() || textInvalid()",
898
+ "class.rt-date-picker--readonly": "isReadonly()",
899
+ "class.rt-date-picker--borderless": "!bordered()",
900
+ "class.rt-date-picker--appearance--fill": "appearance() === 'fill'",
901
+ "class.rt-date-picker--size--sm": "size() === 'sm'",
902
+ "class.rt-date-picker--size--lg": "size() === 'lg'"
903
+ },
904
+ classAttribute: "rt-date-picker"
905
+ },
906
+ providers: [{
907
+ provide: RtFormControlBase,
908
+ useExisting: forwardRef(() => RtDatePickerComponent)
909
+ }],
910
+ viewQueries: [{
911
+ propertyName: "fieldEl",
912
+ first: true,
913
+ predicate: ["fieldEl"],
914
+ descendants: true,
915
+ isSignal: true
916
+ }, {
917
+ propertyName: "popover",
918
+ first: true,
919
+ predicate: RtPopoverDirective,
920
+ descendants: true,
921
+ isSignal: true
922
+ }],
923
+ usesInheritance: true,
924
+ hostDirectives: [{
925
+ directive: i1.RtRadiusDirective,
926
+ inputs: ["radius", "radius"]
927
+ }],
928
+ ngImport: i0,
929
+ template: "<ng-container rtBlock=\"rt-date-picker\">\n @if (isReadonly()) {\n <span rtElem=\"readonly\" qa-dataid=\"date-picker-readonly\" [rtMod]=\"{ empty: !displayText() }\">{{ displayText() || '—' }}</span>\n } @else {\n <input\n #fieldEl\n rtElem=\"field\"\n qa-dataid=\"date-picker-control\"\n type=\"text\"\n inputmode=\"numeric\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [value]=\"text()\"\n [disabled]=\"isDisabled()\"\n [attr.placeholder]=\"shape()\"\n [attr.title]=\"shapeTitle()\"\n [attr.size]=\"fieldSize()\"\n [attr.id]=\"effectiveControlId()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-invalid]=\"isInvalid() || textInvalid() || null\"\n (input)=\"onTyped($event)\"\n (blur)=\"onBlur()\" />\n @if (showClearButton()) {\n <rt-icon-button\n rtElem=\"clear\"\n qa-dataid=\"date-picker-clear\"\n icon=\"ico-close\"\n size=\"sm\"\n variant=\"ghost\"\n iconColor=\"muted\"\n [ariaLabel]=\"t().uiClear\"\n [tabIndex]=\"-1\"\n (clicked)=\"clear($event)\" />\n }\n <rt-icon-button\n rtElem=\"open\"\n qa-dataid=\"date-picker-open\"\n size=\"sm\"\n variant=\"ghost\"\n iconColor=\"muted\"\n rtPopoverAlign=\"end\"\n [icon]=\"openIcon()\"\n [ariaLabel]=\"t().uiOpenCalendar\"\n [disabled]=\"isDisabled()\"\n [rtPopover]=\"panelTpl\"\n [rtPopoverDisabled]=\"narrow() || isDisabled()\"\n (clicked)=\"openPanel()\" />\n\n <ng-template #panelTpl>\n <div rtElem=\"popup\" qa-dataid=\"date-picker-popup\">\n <rt-date-panel\n [type]=\"type()\"\n [value]=\"value()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [minuteStep]=\"minuteStep()\"\n (picked)=\"onPicked($event)\"\n (closed)=\"closePanel()\" />\n </div>\n </ng-template>\n\n @if (narrow()) {\n <rt-bottom-sheet qa-dataid=\"date-picker-sheet\" [open]=\"sheetOpen()\" (openChange)=\"sheetOpen.set($event)\">\n @if (sheetOpen()) {\n <rt-date-panel\n sheet\n [type]=\"type()\"\n [value]=\"value()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [minuteStep]=\"minuteStep()\"\n (picked)=\"onPicked($event)\"\n (closed)=\"closePanel()\" />\n }\n </rt-bottom-sheet>\n }\n }\n</ng-container>\n",
930
+ styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-date-picker{--rt-date-picker-radius: var(--rt-input-radius);--rt-date-picker-fill-radius: var(--rt-radius-sm);position:relative;display:inline-flex;width:100%;min-height:var(--rt-input-height);box-sizing:border-box;align-items:center;padding:var(--rt-input-padding-y) var(--rt-input-padding-x);border:var(--rt-input-border-width) solid var(--rt-input-color-border);border-radius:var(--rt-date-picker-radius);background-color:var(--rt-input-color-bg);color:var(--rt-input-color-text);cursor:text;font-size:var(--rt-input-font-size);gap:var(--rt-space-sm);line-height:var(--rt-input-line-height);transition:var(--rt-input-transition)}.rt-date-picker:focus-within{border-color:var(--rt-input-color-border-focus);box-shadow:var(--rt-input-focus-shadow);outline:2px solid transparent;outline-offset:var(--rt-input-focus-outline-offset)}.rt-date-picker--borderless{border-color:transparent}.rt-date-picker--appearance--fill{border-color:transparent;border-radius:var(--rt-date-picker-fill-radius) var(--rt-date-picker-fill-radius) 0 0;border-bottom-color:var(--rt-color-field-fill-underline);background-color:var(--rt-color-bg-surface-subtle-2)}.rt-date-picker--invalid{border-color:var(--rt-input-color-border-error)}.rt-date-picker--invalid:focus-within{box-shadow:var(--rt-input-focus-shadow-error)}.rt-date-picker--disabled{cursor:not-allowed;opacity:var(--rt-input-disabled-opacity)}.rt-date-picker--size--sm{min-height:var(--rt-input-height-sm)}.rt-date-picker--size--lg{min-height:var(--rt-input-height-lg)}.rt-date-picker--readonly{padding-right:0;padding-left:0;border-color:transparent;background-color:transparent;cursor:default}.rt-date-picker__readonly{color:var(--rt-field-value-color);font-size:var(--rt-field-value-font-size)}.rt-date-picker__readonly--empty{color:var(--rt-field-value-empty-color)}.rt-date-picker__field{min-width:0;flex:1 1 auto;padding:0;border:none;background:transparent;color:inherit;font:inherit;outline:none;text-overflow:ellipsis}.rt-date-picker__field:disabled{cursor:not-allowed}.rt-date-picker__clear,.rt-date-picker__open{flex-shrink:0}.rt-date-picker__popup{border:var(--rt-overlay-select-panel-border-width) solid var(--rt-color-border-subtle);border-radius:var(--rt-overlay-select-radius);background-color:var(--rt-color-bg-surface);box-shadow:var(--rt-overlay-select-shadow)}.rt-date-picker[data-rt-radius=none]{--rt-date-picker-radius: var(--rt-radius-none)}.rt-date-picker[data-rt-radius=xs]{--rt-date-picker-radius: var(--rt-radius-xs)}.rt-date-picker[data-rt-radius=sm]{--rt-date-picker-radius: var(--rt-radius-sm)}.rt-date-picker[data-rt-radius=ms]{--rt-date-picker-radius: var(--rt-radius-ms)}.rt-date-picker[data-rt-radius=md]{--rt-date-picker-radius: var(--rt-radius-md)}.rt-date-picker[data-rt-radius=lg]{--rt-date-picker-radius: var(--rt-radius-lg)}.rt-date-picker[data-rt-radius=xl]{--rt-date-picker-radius: var(--rt-radius-xl)}.rt-date-picker[data-rt-radius=\"2xl\"]{--rt-date-picker-radius: var(--rt-radius-2xl)}.rt-date-picker[data-rt-radius=full]{--rt-date-picker-radius: var(--rt-radius-full)}}\n"],
931
+ dependencies: [
932
+ {
933
+ kind: "component",
934
+ type: RtBottomSheetComponent,
935
+ selector: "rt-bottom-sheet",
936
+ inputs: ["open"],
937
+ outputs: ["openChange"]
938
+ },
939
+ {
940
+ kind: "component",
941
+ type: RtDatePanelComponent,
942
+ selector: "rt-date-panel",
943
+ inputs: [
944
+ "type",
945
+ "value",
946
+ "min",
947
+ "max",
948
+ "minuteStep",
949
+ "sheet",
950
+ "now"
951
+ ],
952
+ outputs: ["picked", "closed"]
953
+ },
954
+ {
955
+ kind: "component",
956
+ type: RtIconButtonComponent,
957
+ selector: "rt-icon-button",
958
+ inputs: [
959
+ "icon",
960
+ "glyph",
961
+ "ariaLabel",
962
+ "variant",
963
+ "iconColor",
964
+ "iconFill",
965
+ "size",
966
+ "iconSize",
967
+ "type",
968
+ "tooltip",
969
+ "tooltipHideOnClick",
970
+ "tabIndex",
971
+ "loading",
972
+ "disabled",
973
+ "active",
974
+ "expanded",
975
+ "indicator"
976
+ ],
977
+ outputs: ["clicked"]
978
+ },
979
+ {
980
+ kind: "directive",
981
+ type: RtPopoverDirective,
982
+ selector: "[rtPopover]",
983
+ inputs: [
984
+ "rtPopover",
985
+ "rtPopoverTrigger",
986
+ "rtPopoverWidth",
987
+ "rtPopoverAlign",
988
+ "rtPopoverFitViewport",
989
+ "rtPopoverContext",
990
+ "rtPopoverPanelClass",
991
+ "rtPopoverDisabled",
992
+ "rtPopoverOffsetY",
993
+ "rtPopoverOffsetX",
994
+ "rtPopoverPositions"
995
+ ],
996
+ outputs: ["rtPopoverOpened", "rtPopoverClosed"],
997
+ exportAs: ["rtPopover"]
998
+ },
999
+ {
1000
+ kind: "directive",
1001
+ type: BlockDirective,
1002
+ selector: "[rtBlock]",
1003
+ inputs: ["rtMod"]
1004
+ },
1005
+ {
1006
+ kind: "directive",
1007
+ type: ElemDirective,
1008
+ selector: "[rtElem]",
1009
+ inputs: ["rtMod"]
1010
+ },
1011
+ {
1012
+ kind: "directive",
1013
+ type: ModDirective,
1014
+ selector: "[rtMod]"
1015
+ }
1016
+ ],
1017
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
1018
+ encapsulation: i0.ViewEncapsulation.None
1019
+ });
1020
+ }
1021
+ };
1022
+ i0.ɵɵngDeclareClassMetadata({
1023
+ minVersion: "12.0.0",
1024
+ version: "22.2.2",
1025
+ ngImport: i0,
1026
+ type: RtDatePickerComponent,
1027
+ decorators: [{
1028
+ type: Component,
1029
+ args: [{
1030
+ selector: "rt-date-picker",
1031
+ changeDetection: ChangeDetectionStrategy.OnPush,
1032
+ encapsulation: ViewEncapsulation.None,
1033
+ imports: [
1034
+ RtBottomSheetComponent,
1035
+ RtDatePanelComponent,
1036
+ RtIconButtonComponent,
1037
+ RtPopoverDirective,
1038
+ BlockDirective,
1039
+ ElemDirective,
1040
+ ModDirective
1041
+ ],
1042
+ providers: [{
1043
+ provide: RtFormControlBase,
1044
+ useExisting: forwardRef(() => RtDatePickerComponent)
1045
+ }],
1046
+ hostDirectives: [{
1047
+ directive: RtRadiusDirective,
1048
+ inputs: ["radius"]
1049
+ }],
1050
+ host: {
1051
+ class: BEM_BLOCK,
1052
+ "[class.rt-date-picker--disabled]": "isDisabled()",
1053
+ "[class.rt-date-picker--invalid]": "isInvalid() || textInvalid()",
1054
+ "[class.rt-date-picker--readonly]": "isReadonly()",
1055
+ "[class.rt-date-picker--borderless]": "!bordered()",
1056
+ "[class.rt-date-picker--appearance--fill]": "appearance() === 'fill'",
1057
+ "[class.rt-date-picker--size--sm]": "size() === 'sm'",
1058
+ "[class.rt-date-picker--size--lg]": "size() === 'lg'"
1059
+ },
1060
+ template: "<ng-container rtBlock=\"rt-date-picker\">\n @if (isReadonly()) {\n <span rtElem=\"readonly\" qa-dataid=\"date-picker-readonly\" [rtMod]=\"{ empty: !displayText() }\">{{ displayText() || '—' }}</span>\n } @else {\n <input\n #fieldEl\n rtElem=\"field\"\n qa-dataid=\"date-picker-control\"\n type=\"text\"\n inputmode=\"numeric\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [value]=\"text()\"\n [disabled]=\"isDisabled()\"\n [attr.placeholder]=\"shape()\"\n [attr.title]=\"shapeTitle()\"\n [attr.size]=\"fieldSize()\"\n [attr.id]=\"effectiveControlId()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-invalid]=\"isInvalid() || textInvalid() || null\"\n (input)=\"onTyped($event)\"\n (blur)=\"onBlur()\" />\n @if (showClearButton()) {\n <rt-icon-button\n rtElem=\"clear\"\n qa-dataid=\"date-picker-clear\"\n icon=\"ico-close\"\n size=\"sm\"\n variant=\"ghost\"\n iconColor=\"muted\"\n [ariaLabel]=\"t().uiClear\"\n [tabIndex]=\"-1\"\n (clicked)=\"clear($event)\" />\n }\n <rt-icon-button\n rtElem=\"open\"\n qa-dataid=\"date-picker-open\"\n size=\"sm\"\n variant=\"ghost\"\n iconColor=\"muted\"\n rtPopoverAlign=\"end\"\n [icon]=\"openIcon()\"\n [ariaLabel]=\"t().uiOpenCalendar\"\n [disabled]=\"isDisabled()\"\n [rtPopover]=\"panelTpl\"\n [rtPopoverDisabled]=\"narrow() || isDisabled()\"\n (clicked)=\"openPanel()\" />\n\n <ng-template #panelTpl>\n <div rtElem=\"popup\" qa-dataid=\"date-picker-popup\">\n <rt-date-panel\n [type]=\"type()\"\n [value]=\"value()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [minuteStep]=\"minuteStep()\"\n (picked)=\"onPicked($event)\"\n (closed)=\"closePanel()\" />\n </div>\n </ng-template>\n\n @if (narrow()) {\n <rt-bottom-sheet qa-dataid=\"date-picker-sheet\" [open]=\"sheetOpen()\" (openChange)=\"sheetOpen.set($event)\">\n @if (sheetOpen()) {\n <rt-date-panel\n sheet\n [type]=\"type()\"\n [value]=\"value()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [minuteStep]=\"minuteStep()\"\n (picked)=\"onPicked($event)\"\n (closed)=\"closePanel()\" />\n }\n </rt-bottom-sheet>\n }\n }\n</ng-container>\n",
1061
+ styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-date-picker{--rt-date-picker-radius: var(--rt-input-radius);--rt-date-picker-fill-radius: var(--rt-radius-sm);position:relative;display:inline-flex;width:100%;min-height:var(--rt-input-height);box-sizing:border-box;align-items:center;padding:var(--rt-input-padding-y) var(--rt-input-padding-x);border:var(--rt-input-border-width) solid var(--rt-input-color-border);border-radius:var(--rt-date-picker-radius);background-color:var(--rt-input-color-bg);color:var(--rt-input-color-text);cursor:text;font-size:var(--rt-input-font-size);gap:var(--rt-space-sm);line-height:var(--rt-input-line-height);transition:var(--rt-input-transition)}.rt-date-picker:focus-within{border-color:var(--rt-input-color-border-focus);box-shadow:var(--rt-input-focus-shadow);outline:2px solid transparent;outline-offset:var(--rt-input-focus-outline-offset)}.rt-date-picker--borderless{border-color:transparent}.rt-date-picker--appearance--fill{border-color:transparent;border-radius:var(--rt-date-picker-fill-radius) var(--rt-date-picker-fill-radius) 0 0;border-bottom-color:var(--rt-color-field-fill-underline);background-color:var(--rt-color-bg-surface-subtle-2)}.rt-date-picker--invalid{border-color:var(--rt-input-color-border-error)}.rt-date-picker--invalid:focus-within{box-shadow:var(--rt-input-focus-shadow-error)}.rt-date-picker--disabled{cursor:not-allowed;opacity:var(--rt-input-disabled-opacity)}.rt-date-picker--size--sm{min-height:var(--rt-input-height-sm)}.rt-date-picker--size--lg{min-height:var(--rt-input-height-lg)}.rt-date-picker--readonly{padding-right:0;padding-left:0;border-color:transparent;background-color:transparent;cursor:default}.rt-date-picker__readonly{color:var(--rt-field-value-color);font-size:var(--rt-field-value-font-size)}.rt-date-picker__readonly--empty{color:var(--rt-field-value-empty-color)}.rt-date-picker__field{min-width:0;flex:1 1 auto;padding:0;border:none;background:transparent;color:inherit;font:inherit;outline:none;text-overflow:ellipsis}.rt-date-picker__field:disabled{cursor:not-allowed}.rt-date-picker__clear,.rt-date-picker__open{flex-shrink:0}.rt-date-picker__popup{border:var(--rt-overlay-select-panel-border-width) solid var(--rt-color-border-subtle);border-radius:var(--rt-overlay-select-radius);background-color:var(--rt-color-bg-surface);box-shadow:var(--rt-overlay-select-shadow)}.rt-date-picker[data-rt-radius=none]{--rt-date-picker-radius: var(--rt-radius-none)}.rt-date-picker[data-rt-radius=xs]{--rt-date-picker-radius: var(--rt-radius-xs)}.rt-date-picker[data-rt-radius=sm]{--rt-date-picker-radius: var(--rt-radius-sm)}.rt-date-picker[data-rt-radius=ms]{--rt-date-picker-radius: var(--rt-radius-ms)}.rt-date-picker[data-rt-radius=md]{--rt-date-picker-radius: var(--rt-radius-md)}.rt-date-picker[data-rt-radius=lg]{--rt-date-picker-radius: var(--rt-radius-lg)}.rt-date-picker[data-rt-radius=xl]{--rt-date-picker-radius: var(--rt-radius-xl)}.rt-date-picker[data-rt-radius=\"2xl\"]{--rt-date-picker-radius: var(--rt-radius-2xl)}.rt-date-picker[data-rt-radius=full]{--rt-date-picker-radius: var(--rt-radius-full)}}\n"]
1062
+ }]
1063
+ }],
1064
+ propDecorators: {
1065
+ fieldEl: [{
1066
+ type: i0.ViewChild,
1067
+ args: ["fieldEl", { isSignal: true }]
1068
+ }],
1069
+ popover: [{
1070
+ type: i0.ViewChild,
1071
+ args: [i0.forwardRef(() => RtPopoverDirective), { isSignal: true }]
1072
+ }],
1073
+ appearance: [{
1074
+ type: i0.Input,
1075
+ args: [{
1076
+ isSignal: true,
1077
+ alias: "appearance",
1078
+ required: false
1079
+ }]
1080
+ }],
1081
+ type: [{
1082
+ type: i0.Input,
1083
+ args: [{
1084
+ isSignal: true,
1085
+ alias: "type",
1086
+ required: false
1087
+ }]
1088
+ }],
1089
+ min: [{
1090
+ type: i0.Input,
1091
+ args: [{
1092
+ isSignal: true,
1093
+ alias: "min",
1094
+ required: false
1095
+ }]
1096
+ }],
1097
+ max: [{
1098
+ type: i0.Input,
1099
+ args: [{
1100
+ isSignal: true,
1101
+ alias: "max",
1102
+ required: false
1103
+ }]
1104
+ }],
1105
+ minuteStep: [{
1106
+ type: i0.Input,
1107
+ args: [{
1108
+ isSignal: true,
1109
+ alias: "minuteStep",
1110
+ required: false
1111
+ }]
1112
+ }]
1113
+ }
1114
+ });
778
1115
  export { RtDatePickerComponent, rtDateAddMonths, rtDateCanPage, rtDateFirstDay, rtDateGridKey, rtDateInBounds, rtDateLayout, rtDateMonth, rtDateMonths, rtDateNow, rtDateParse, rtDateRead, rtDateShape, rtDateSplit, rtDateText, rtDateTime, rtDateTimeColumns, rtDateWeekdays, rtDateWrite };
779
- //# sourceMappingURL=rt-tools-ui-kit-v2-date-picker.mjs.map
1116
+
1117
+ //# sourceMappingURL=rt-tools-ui-kit-v2-date-picker.mjs.map