@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,509 +1,728 @@
1
- import { DOCUMENT, NgTemplateOutlet } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { inject, afterRenderEffect, TemplateRef, Directive, computed, viewChild, signal, contentChild, input, booleanAttribute, output, forwardRef, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
4
- import * as i2 from '@angular/forms';
5
- import { FormsModule } from '@angular/forms';
6
- import { BlockDirective, ElemDirective, ModDirective } from '@rt-tools/core';
7
- import { rtKitLabel, RT_KIT_LABELS } from '@rt-tools/ui-kit-v2/core';
8
- import { RtFormControlBase } from '@rt-tools/ui-kit-v2/form-control';
9
- import { RtIconComponent } from '@rt-tools/ui-kit-v2/icon';
10
- import { RtIconButtonComponent } from '@rt-tools/ui-kit-v2/icon-button';
11
- import { RtInputComponent } from '@rt-tools/ui-kit-v2/input';
12
- import { RtPopoverDirective } from '@rt-tools/ui-kit-v2/popover';
13
- import * as i1 from '@rt-tools/ui-kit-v2/radius';
14
- import { RtRadiusDirective } from '@rt-tools/ui-kit-v2/radius';
15
-
16
- /**
17
- * Держит подсвеченную клавишами опцию в видимой части панели.
18
- *
19
- * Панель списка ограничена по высоте, и длинный список прокручивается внутри неё. Клавиши двигают
20
- * подсветку, но фокус остаётся на поле: браузер сам панель не прокручивает, и подсветка уходила
21
- * за нижний край — человек выбирал Enter'ом то, чего не видел. После каждой отрисовки, в которой
22
- * сменилась подсвеченная опция, она прокручивается ровно настолько, чтобы встать в панель.
23
- *
24
- * Панель рисуется в наложении, вне поддерева семьи, поэтому опция ищется в документе по своему
25
- * идентификатору — тому же, что стоит в `aria-activedescendant`. На сервере отрисовки нет, и
26
- * эффект не выполняется; среда без `scrollIntoView` пропускается.
27
- *
28
- * Зовётся в контексте внедрения — полем или конструктором семьи.
29
- *
30
- * @param activeOptionId идентификатор подсвеченной опции; `null` — подсветки нет или панель закрыта
31
- */
1
+ import { DOCUMENT, NgTemplateOutlet } from "@angular/common";
2
+ import * as i0 from "@angular/core";
3
+ import { ChangeDetectionStrategy, Component, Directive, TemplateRef, ViewEncapsulation, afterRenderEffect, booleanAttribute, computed, contentChild, forwardRef, inject, input, output, signal, viewChild } from "@angular/core";
4
+ import * as i2 from "@angular/forms";
5
+ import { FormsModule } from "@angular/forms";
6
+ import { BlockDirective, ElemDirective, ModDirective } from "@rt-tools/core";
7
+ import { RT_KIT_LABELS, rtKitLabel } from "@rt-tools/ui-kit-v2/core";
8
+ import { RtFormControlBase } from "@rt-tools/ui-kit-v2/form-control";
9
+ import { RtIconComponent } from "@rt-tools/ui-kit-v2/icon";
10
+ import { RtIconButtonComponent } from "@rt-tools/ui-kit-v2/icon-button";
11
+ import { RtInputComponent } from "@rt-tools/ui-kit-v2/input";
12
+ import { RtPopoverDirective } from "@rt-tools/ui-kit-v2/popover";
13
+ import * as i1 from "@rt-tools/ui-kit-v2/radius";
14
+ import { RtRadiusDirective } from "@rt-tools/ui-kit-v2/radius";
32
15
  function rtScrollActiveOptionIntoView(activeOptionId) {
33
- const document = inject(DOCUMENT);
34
- afterRenderEffect(() => {
35
- const id = activeOptionId();
36
- const option = id ? document.getElementById(id) : null;
37
- if (typeof option?.scrollIntoView === 'function') {
38
- option.scrollIntoView({ block: 'nearest' });
39
- }
40
- });
16
+ const document = inject(DOCUMENT);
17
+ afterRenderEffect(() => {
18
+ const id = activeOptionId();
19
+ const option = id ? document.getElementById(id) : null;
20
+ if (typeof option?.scrollIntoView === "function") option.scrollIntoView({ block: "nearest" });
21
+ });
41
22
  }
42
-
43
23
  function childrenOf(option) {
44
- return option.children ?? [];
24
+ return option.children ?? [];
45
25
  }
46
26
  function isBranch(option) {
47
- return childrenOf(option).length > 0;
27
+ return childrenOf(option).length > 0;
48
28
  }
49
- /** Список — дерево, если хоть у одной опции есть дети. Плоский список рисуется как прежде. */
50
29
  function rtTreeIsTree(options) {
51
- return options.some((option) => isBranch(option));
30
+ return options.some((option) => isBranch(option));
52
31
  }
53
- /** Опция по значению на любой глубине. */
54
32
  function rtTreeFind(options, value) {
55
- for (const option of options) {
56
- if (option.value === value) {
57
- return option;
58
- }
59
- const found = rtTreeFind(childrenOf(option), value);
60
- if (found) {
61
- return found;
62
- }
63
- }
64
- return undefined;
33
+ for (const option of options) {
34
+ if (option.value === value) return option;
35
+ const found = rtTreeFind(childrenOf(option), value);
36
+ if (found) return found;
37
+ }
65
38
  }
66
- /**
67
- * Включённые листья под опцией; у самого листа — он сам. Отключённая ветка не отдаёт никого: её
68
- * листья выбрать нельзя, как и её саму.
69
- */
70
39
  function rtTreeLeaves(option) {
71
- if (option.disabled) {
72
- return [];
73
- }
74
- if (!isBranch(option)) {
75
- return [option.value];
76
- }
77
- return childrenOf(option).flatMap((child) => rtTreeLeaves(child));
40
+ if (option.disabled) return [];
41
+ if (!isBranch(option)) return [option.value];
42
+ return childrenOf(option).flatMap((child) => rtTreeLeaves(child));
78
43
  }
79
- /** Сколько включённых листьев ветки выбрано. Флажок ветки выводится из этого, а не хранится. */
80
44
  function rtTreeBranchState(option, chosen) {
81
- const leaves = rtTreeLeaves(option);
82
- const count = leaves.filter((leaf) => chosen.includes(leaf)).length;
83
- if (count === 0) {
84
- return 'none';
85
- }
86
- return count === leaves.length ? 'all' : 'some';
45
+ const leaves = rtTreeLeaves(option);
46
+ const count = leaves.filter((leaf) => chosen.includes(leaf)).length;
47
+ if (count === 0) return "none";
48
+ return count === leaves.length ? "all" : "some";
87
49
  }
88
50
  function holdsChosen(option, chosen) {
89
- return childrenOf(option).some((child) => chosen.includes(child.value) || holdsChosen(child, chosen));
51
+ return childrenOf(option).some((child) => chosen.includes(child.value) || holdsChosen(child, chosen));
90
52
  }
91
53
  function collectOpen(list, chosen, open) {
92
- for (const option of list) {
93
- if (holdsChosen(option, chosen)) {
94
- open.add(option.value);
95
- collectOpen(childrenOf(option), chosen, open);
96
- }
97
- }
54
+ for (const option of list) if (holdsChosen(option, chosen)) {
55
+ open.add(option.value);
56
+ collectOpen(childrenOf(option), chosen, open);
57
+ }
98
58
  }
99
- /** Ветки, под которыми лежит выбранное значение: они раскрыты, когда список открывается. */
100
59
  function rtTreeOpenFor(options, chosen) {
101
- const open = new Set();
102
- collectOpen(options, chosen, open);
103
- return open;
60
+ const open = /* @__PURE__ */ new Set();
61
+ collectOpen(options, chosen, open);
62
+ return open;
104
63
  }
105
64
  function matches(option, term) {
106
- return option.label.toLowerCase().includes(term);
65
+ return option.label.toLowerCase().includes(term);
107
66
  }
108
67
  function descendantMatches(option, term) {
109
- return childrenOf(option).some((child) => matches(child, term) || descendantMatches(child, term));
68
+ return childrenOf(option).some((child) => matches(child, term) || descendantMatches(child, term));
110
69
  }
111
- /**
112
- * Раскладка одной опции: кладёт её строку и отвечает, где раскладывать её детей, или `null`, если
113
- * их не видно. `filtered` — действует ли поисковое слово на уровень: под веткой, совпавшей самой и
114
- * раскрытой, дети идут все, как без поиска.
115
- */
116
70
  function placeOption(walk, option, place) {
117
- const self = !place.filtered || matches(option, walk.term);
118
- const below = place.filtered && descendantMatches(option, walk.term);
119
- if (!self && !below) {
120
- return null;
121
- }
122
- const branch = isBranch(option);
123
- const openBySet = self && walk.open.has(option.value);
124
- const open = branch && (openBySet || below);
125
- walk.rows.push({ option, branch, open, level: place.level, parent: place.parent });
126
- return open ? { level: place.level + 1, parent: option.value, filtered: place.filtered && !openBySet } : null;
71
+ const self = !place.filtered || matches(option, walk.term);
72
+ const below = place.filtered && descendantMatches(option, walk.term);
73
+ if (!self && !below) return null;
74
+ const branch = isBranch(option);
75
+ const openBySet = self && walk.open.has(option.value);
76
+ const open = branch && (openBySet || below);
77
+ walk.rows.push({
78
+ option,
79
+ branch,
80
+ open,
81
+ level: place.level,
82
+ parent: place.parent
83
+ });
84
+ return open ? {
85
+ level: place.level + 1,
86
+ parent: option.value,
87
+ filtered: place.filtered && !openBySet
88
+ } : null;
127
89
  }
128
90
  function walkRows(walk, list, place) {
129
- for (const option of list) {
130
- const childPlace = placeOption(walk, option, place);
131
- if (childPlace) {
132
- walkRows(walk, childrenOf(option), childPlace);
133
- }
134
- }
91
+ for (const option of list) {
92
+ const childPlace = placeOption(walk, option, place);
93
+ if (childPlace) walkRows(walk, childrenOf(option), childPlace);
94
+ }
135
95
  }
136
- /**
137
- * Видимые строки по уровням. Без поискового слова раскрыты ветки из `open`. Со словом строка
138
- * остаётся, если совпала она сама или кто-то под ней, и путь к совпадению показан раскрытым.
139
- * Ветка, совпавшая сама, держит детей такими, какими они были.
140
- */
141
- function rtTreeRows(options, open, rawTerm = '') {
142
- const term = rawTerm.toLowerCase().trim();
143
- const walk = { open, term, rows: [] };
144
- walkRows(walk, options, { level: 0, parent: null, filtered: term.length > 0 });
145
- return walk.rows;
96
+ function rtTreeRows(options, open, rawTerm = "") {
97
+ const term = rawTerm.toLowerCase().trim();
98
+ const walk = {
99
+ open,
100
+ term,
101
+ rows: []
102
+ };
103
+ walkRows(walk, options, {
104
+ level: 0,
105
+ parent: null,
106
+ filtered: term.length > 0
107
+ });
108
+ return walk.rows;
146
109
  }
147
110
  function sideRight(rows, row, index) {
148
- if (row.branch && !row.open) {
149
- return { toggle: row.option.value, index };
150
- }
151
- const firstChild = row.branch && rows[index + 1]?.parent === row.option.value;
152
- return { toggle: null, index: firstChild ? index + 1 : index };
111
+ if (row.branch && !row.open) return {
112
+ toggle: row.option.value,
113
+ index
114
+ };
115
+ return {
116
+ toggle: null,
117
+ index: row.branch && rows[index + 1]?.parent === row.option.value ? index + 1 : index
118
+ };
153
119
  }
154
120
  function sideLeft(rows, row, index) {
155
- if (row.branch && row.open) {
156
- return { toggle: row.option.value, index };
157
- }
158
- const parentIndex = rows.findIndex((candidate) => candidate.option.value === row.parent);
159
- return { toggle: null, index: parentIndex >= 0 ? parentIndex : index };
121
+ if (row.branch && row.open) return {
122
+ toggle: row.option.value,
123
+ index
124
+ };
125
+ const parentIndex = rows.findIndex((candidate) => candidate.option.value === row.parent);
126
+ return {
127
+ toggle: null,
128
+ index: parentIndex >= 0 ? parentIndex : index
129
+ };
160
130
  }
161
- /**
162
- * Ответ на боковую стрелку. Вправо: свёрнутая ветка раскрывается, раскрытая уводит подсветку на
163
- * первого ребёнка. Влево: раскрытая ветка сворачивается, иначе подсветка уходит на родителя.
164
- */
165
131
  function rtTreeSideKey(rows, index, key) {
166
- const row = rows[index];
167
- if (row && key === 'ArrowRight') {
168
- return sideRight(rows, row, index);
169
- }
170
- if (row && key === 'ArrowLeft') {
171
- return sideLeft(rows, row, index);
172
- }
173
- return { toggle: null, index };
132
+ const row = rows[index];
133
+ if (row && key === "ArrowRight") return sideRight(rows, row, index);
134
+ if (row && key === "ArrowLeft") return sideLeft(rows, row, index);
135
+ return {
136
+ toggle: null,
137
+ index
138
+ };
174
139
  }
175
- /** Набор раскрытых веток с переключённой одной. */
176
140
  function rtTreeToggle(open, value) {
177
- const next = new Set(open);
178
- if (next.has(value)) {
179
- next.delete(value);
180
- }
181
- else {
182
- next.add(value);
183
- }
184
- return next;
141
+ const next = new Set(open);
142
+ if (next.has(value)) next.delete(value);
143
+ else next.add(value);
144
+ return next;
185
145
  }
186
-
187
- /**
188
- * Маркер своей разметки указателя — того, что человек нажимает, чтобы открыть список.
189
- *
190
- * Поведение указателя остаётся киту: открытие панели, её ширина, приметы доступности,
191
- * отключённость, клавиши и закрытие висят на кнопке. Потребитель даёт только то, что рисуется
192
- * внутри неё, и получает три значения обстановки: открыт ли список, что выбрано, отключён ли выбор.
193
- *
194
- * Один маркер на обе семьи выбора: они отличаются только разметкой внутри кнопки, и два маркера
195
- * разошлись бы на первой же правке.
196
- *
197
- * @example
198
- * ```html
199
- * <rt-select [options]="options">
200
- * <ng-template rtSelectTrigger let-state>
201
- * <rt-tag [value]="state.label" [icon]="state.isOpen ? 'chevron-up' : 'chevron-down'" />
202
- * </ng-template>
203
- * </rt-select>
204
- * ```
205
- */
206
- class RtSelectTriggerDirective {
207
- constructor() {
208
- this.templateRef = inject(TemplateRef);
209
- }
210
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtSelectTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
211
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.6", type: RtSelectTriggerDirective, isStandalone: true, selector: "[rtSelectTrigger]", ngImport: i0 }); }
212
- }
213
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtSelectTriggerDirective, decorators: [{
214
- type: Directive,
215
- args: [{
216
- selector: '[rtSelectTrigger]',
217
- }]
218
- }] });
219
-
220
- const BEM_BLOCK = 'rt-select';
221
- /** Клавиши, открывающие закрытый dropdown с фокуса на trigger'е. */
222
- const OPEN_KEYS = new Set(['ArrowDown', 'ArrowUp', 'Enter', ' ']);
146
+ var RtSelectTriggerDirective = class RtSelectTriggerDirective {
147
+ constructor() {
148
+ this.templateRef = inject(TemplateRef);
149
+ }
150
+ static {
151
+ this.ɵfac = i0.ɵɵngDeclareFactory({
152
+ minVersion: "12.0.0",
153
+ version: "22.2.2",
154
+ ngImport: i0,
155
+ type: RtSelectTriggerDirective,
156
+ deps: [],
157
+ target: i0.ɵɵFactoryTarget.Directive
158
+ });
159
+ }
160
+ static {
161
+ this.ɵdir = i0.ɵɵngDeclareDirective({
162
+ minVersion: "14.0.0",
163
+ version: "22.2.2",
164
+ type: RtSelectTriggerDirective,
165
+ isStandalone: true,
166
+ selector: "[rtSelectTrigger]",
167
+ ngImport: i0
168
+ });
169
+ }
170
+ };
171
+ i0.ɵɵngDeclareClassMetadata({
172
+ minVersion: "12.0.0",
173
+ version: "22.2.2",
174
+ ngImport: i0,
175
+ type: RtSelectTriggerDirective,
176
+ decorators: [{
177
+ type: Directive,
178
+ args: [{ selector: "[rtSelectTrigger]" }]
179
+ }]
180
+ });
181
+ const BEM_BLOCK = "rt-select";
182
+ const OPEN_KEYS = /* @__PURE__ */ new Set([
183
+ "ArrowDown",
184
+ "ArrowUp",
185
+ "Enter",
186
+ " "
187
+ ]);
223
188
  let panelIdSeed = 0;
224
189
  function nextPanelId() {
225
- panelIdSeed += 1;
226
- return panelIdSeed;
190
+ panelIdSeed += 1;
191
+ return panelIdSeed;
227
192
  }
228
- /**
229
- * Single-select dropdown с опциональным filter input.
230
- *
231
- * Panel рендерится через CDK Overlay (директива `[rtPopover]` на trigger'е) —
232
- * не обрезается `overflow: hidden` предками (таблицы, aside, карточки) и
233
- * авто-flip'ается у края viewport. CVA через общий `RtFormControlBase`. Крестик
234
- * (`clearable`) слева от шеврона — виден при наличии значения, очищает выбор.
235
- *
236
- * Keyboard-nav (activedescendant): фокус на trigger'е, ArrowUp/Down двигают
237
- * виртуальный highlight (`aria-activedescendant`), Enter выбирает, Escape
238
- * закрывает. Home/End/typeahead — deferred.
239
- */
240
- class RtSelectComponent extends RtFormControlBase {
241
- #t_uiSearch;
242
- constructor() {
243
- super();
244
- this.#t_uiSearch = rtKitLabel('uiSearch');
245
- this.t = inject(RT_KIT_LABELS);
246
- this.panelId = `rt-select-panel-${nextPanelId()}`;
247
- this.filterPlaceholderText = computed(() => this.filterPlaceholder() || this.#t_uiSearch(), /* @ts-ignore */
248
- ...(ngDevMode ? [{ debugName: "filterPlaceholderText" }] : /* istanbul ignore next */ []));
249
- this.popover = viewChild.required(RtPopoverDirective, /* @ts-ignore */
250
- ...(ngDevMode ? [{ debugName: "popover" }] : /* istanbul ignore next */ []));
251
- this.triggerEl = viewChild('triggerEl', /* @ts-ignore */
252
- ...(ngDevMode ? [{ debugName: "triggerEl" }] : /* istanbul ignore next */ []));
253
- this.filterTerm = signal('', /* @ts-ignore */
254
- ...(ngDevMode ? [{ debugName: "filterTerm" }] : /* istanbul ignore next */ []));
255
- this.activeIndex = signal(-1, /* @ts-ignore */
256
- ...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
257
- /** Раскрытые ветки дерева. Живут, пока открыта панель: при открытии раскрыты ветки над выбранным. */
258
- this.openBranches = signal(new Set(), /* @ts-ignore */
259
- ...(ngDevMode ? [{ debugName: "openBranches" }] : /* istanbul ignore next */ []));
260
- this.isOpen = computed(() => this.popover().isOpen(), /* @ts-ignore */
261
- ...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
262
- /** Идентификатор подсвеченной опции — тот же, что уходит в `aria-activedescendant`. */
263
- this.activeOptionId = computed(() => this.isOpen() && this.activeIndex() >= 0 ? `${this.panelId}-opt-${this.activeIndex()}` : null, /* @ts-ignore */
264
- ...(ngDevMode ? [{ debugName: "activeOptionId" }] : /* istanbul ignore next */ []));
265
- /**
266
- * Своя разметка указателя, если потребитель её объявил. Не объявил — кит рисует свою, и ни один
267
- * нынешний потребитель не двигается.
268
- */
269
- this.triggerTpl = contentChild(RtSelectTriggerDirective, /* @ts-ignore */
270
- ...(ngDevMode ? [{ debugName: "triggerTpl" }] : /* istanbul ignore next */ []));
271
- this.hasValue = computed(() => this.value() !== null, /* @ts-ignore */
272
- ...(ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []));
273
- this.selectedLabel = computed(() => {
274
- const v = this.value();
275
- if (v === null) {
276
- return '';
277
- }
278
- return rtTreeFind(this.options(), v)?.label ?? '';
279
- }, /* @ts-ignore */
280
- ...(ngDevMode ? [{ debugName: "selectedLabel" }] : /* istanbul ignore next */ []));
281
- /** Дерево ли список: тогда у строк есть место под стрелку и отступ по уровню. */
282
- this.isTree = computed(() => rtTreeIsTree(this.options()), /* @ts-ignore */
283
- ...(ngDevMode ? [{ debugName: "isTree" }] : /* istanbul ignore next */ []));
284
- /** Видимые строки: плоский список — как прежде, дерево — по раскрытым веткам и поисковому слову. */
285
- this.rows = computed(() => rtTreeRows(this.options(), this.openBranches(), this.filterTerm()), /* @ts-ignore */
286
- ...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
287
- /** Три значения, которые кит отдаёт своей разметке указателя, и не больше. */
288
- this.triggerState = computed(() => ({
289
- isOpen: this.isOpen(),
290
- value: this.value(),
291
- label: this.selectedLabel(),
292
- isDisabled: this.isDisabled(),
293
- }), /* @ts-ignore */
294
- ...(ngDevMode ? [{ debugName: "triggerState" }] : /* istanbul ignore next */ []));
295
- /** Вид рамки: `outline` — рамка со всех сторон, `fill` — залитое поле с чертой снизу. */
296
- this.appearance = input('outline', /* @ts-ignore */
297
- ...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
298
- this.displayText = computed(() => this.selectedLabel(), /* @ts-ignore */
299
- ...(ngDevMode ? [{ debugName: "displayText" }] : /* istanbul ignore next */ []));
300
- this.options = input([], /* @ts-ignore */
301
- ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
302
- this.placeholder = input('', /* @ts-ignore */
303
- ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
304
- this.iconLeft = input(null, /* @ts-ignore */
305
- ...(ngDevMode ? [{ debugName: "iconLeft" }] : /* istanbul ignore next */ []));
306
- this.filter = input(false, { ...(ngDevMode ? { debugName: "filter" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
307
- /** Пусто — берётся переведённая подпись по умолчанию */
308
- this.filterPlaceholder = input('', /* @ts-ignore */
309
- ...(ngDevMode ? [{ debugName: "filterPlaceholder" }] : /* istanbul ignore next */ []));
310
- /**
311
- * Чем мерится панель. По умолчанию она не уже кнопки и дальше растёт по содержимому:
312
- * со своим указателем кнопка бывает узкой, и панель по её ширине давила бы содержимое.
313
- * `trigger` возвращает прежнее — ровно по кнопке, `auto` пускает панель по содержимому
314
- * целиком. Предел высоты назначается входом `panelMaxHeight`.
315
- */
316
- this.panelWidth = input('trigger-min', /* @ts-ignore */
317
- ...(ngDevMode ? [{ debugName: "panelWidth" }] : /* istanbul ignore next */ []));
318
- /**
319
- * Предел высоты панели — длина как в стилях, например `20rem`. Пусто — предел кита
320
- * `--rt-input-panel-max-height`, и длинный список прокручивается внутри панели: без предела
321
- * он уходил за нижний край экрана, и пункты за краем были недостижимы. `none` снимает предел —
322
- * для короткого списка, который должен открываться целиком, без прокрутки. Значение ставится
323
- * на саму панель: она рисуется в наложении, вне поддерева блока.
324
- */
325
- this.panelMaxHeight = input(null, /* @ts-ignore */
326
- ...(ngDevMode ? [{ debugName: "panelMaxHeight" }] : /* istanbul ignore next */ []));
327
- this.selectionChange = output();
328
- // Подсветка, сдвинутая клавишами, не уходит за край панели с пределом высоты.
329
- rtScrollActiveOptionIntoView(this.activeOptionId);
330
- }
331
- setDisabledState(disabled) {
332
- super.setDisabledState(disabled);
333
- if (disabled) {
334
- this.popover().close();
335
- }
336
- }
337
- getEmptyValue() {
338
- return null;
339
- }
340
- focusAfterClear() {
341
- this.triggerEl()?.nativeElement.focus();
342
- }
343
- clear(event) {
344
- if (this.isDisabled()) {
345
- return;
346
- }
347
- super.clear(event);
348
- this.selectionChange.emit(null);
349
- }
350
- /**
351
- * Открытый список встаёт подсветкой на выбранный пункт.
352
- *
353
- * Иначе стрелка вниз начинала с первого пункта, и человек с выбранным «20» из «10, 20, 40»
354
- * получал «10» вместо «40».
355
- */
356
- onOpened() {
357
- const v = this.value();
358
- this.openBranches.set(rtTreeOpenFor(this.options(), v === null ? [] : [v]));
359
- if (v !== null) {
360
- const chosen = this.rows().findIndex((row) => row.option.value === v);
361
- if (chosen >= 0) {
362
- this.activeIndex.set(chosen);
363
- }
364
- }
365
- }
366
- toggleBranch(event, value) {
367
- event.stopPropagation();
368
- this.openBranches.update((open) => rtTreeToggle(open, value));
369
- }
370
- onClosed() {
371
- // Закрытие (outside-click / Escape / выбор) = пользователь увёл фокус.
372
- this.filterTerm.set('');
373
- this.activeIndex.set(-1);
374
- this.markTouched();
375
- }
376
- select(opt) {
377
- if (opt.disabled) {
378
- return;
379
- }
380
- this.value.set(opt.value);
381
- this.emitChange(opt.value);
382
- this.selectionChange.emit(opt.value);
383
- this.popover().close();
384
- }
385
- setFilter(term) {
386
- this.filterTerm.set(term);
387
- this.activeIndex.set(-1);
388
- }
389
- onTriggerKeydown(event) {
390
- if (this.isDisabled()) {
391
- return;
392
- }
393
- if (!this.isOpen()) {
394
- if (OPEN_KEYS.has(event.key)) {
395
- event.preventDefault();
396
- this.popover().open();
397
- if (this.activeIndex() < 0) {
398
- this.#moveActive(1);
399
- }
400
- }
401
- return;
402
- }
403
- this.#handleOpenKeydown(event);
404
- }
405
- #handleOpenKeydown(event) {
406
- switch (event.key) {
407
- case 'ArrowDown':
408
- event.preventDefault();
409
- this.#moveActive(1);
410
- break;
411
- case 'ArrowUp':
412
- event.preventDefault();
413
- this.#moveActive(-1);
414
- break;
415
- case 'Enter':
416
- case ' ':
417
- event.preventDefault();
418
- this.#selectActive();
419
- break;
420
- case 'Escape':
421
- event.preventDefault();
422
- this.popover().close();
423
- break;
424
- case 'ArrowRight':
425
- case 'ArrowLeft':
426
- event.preventDefault();
427
- this.#sideKey(event.key);
428
- break;
429
- default:
430
- break;
431
- }
432
- }
433
- #sideKey(key) {
434
- const answer = rtTreeSideKey(this.rows(), this.activeIndex(), key);
435
- const toggle = answer.toggle;
436
- if (toggle !== null) {
437
- this.openBranches.update((open) => rtTreeToggle(open, toggle));
438
- }
439
- this.activeIndex.set(answer.index);
440
- }
441
- #moveActive(delta) {
442
- const opts = this.rows().map((row) => row.option);
443
- if (opts.length === 0) {
444
- this.activeIndex.set(-1);
445
- return;
446
- }
447
- let index = this.activeIndex();
448
- for (let step = 0; step < opts.length; step += 1) {
449
- index = (index + delta + opts.length) % opts.length;
450
- if (!opts[index].disabled) {
451
- this.activeIndex.set(index);
452
- return;
453
- }
454
- }
455
- }
456
- #selectActive() {
457
- const opts = this.rows().map((row) => row.option);
458
- const index = this.activeIndex();
459
- if (index >= 0 && index < opts.length) {
460
- this.select(opts[index]);
461
- }
462
- }
463
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
464
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: RtSelectComponent, isStandalone: true, selector: "rt-select", inputs: { appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, iconLeft: { classPropertyName: "iconLeft", publicName: "iconLeft", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, filterPlaceholder: { classPropertyName: "filterPlaceholder", publicName: "filterPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, panelWidth: { classPropertyName: "panelWidth", publicName: "panelWidth", isSignal: true, isRequired: false, transformFunction: null }, panelMaxHeight: { classPropertyName: "panelMaxHeight", publicName: "panelMaxHeight", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectionChange: "selectionChange" }, host: { properties: { "class.rt-select--open": "isOpen()", "class.rt-select--disabled": "isDisabled()", "class.rt-select--readonly": "isReadonly()", "class.rt-select--invalid": "isInvalid()", "class.rt-select--borderless": "!bordered()", "class.rt-select--appearance--fill": "appearance() === 'fill'", "class.rt-select--size--sm": "size() === 'sm'", "class.rt-select--size--lg": "size() === 'lg'", "class.rt-select--with-icon-left": "!!iconLeft()" }, classAttribute: "rt-select" }, providers: [
465
- // Алиас базового токена — для contentChild(RtFormControlBase) в rt-field.
466
- { provide: RtFormControlBase, useExisting: forwardRef(() => RtSelectComponent) },
467
- ], queries: [{ propertyName: "triggerTpl", first: true, predicate: RtSelectTriggerDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "popover", first: true, predicate: RtPopoverDirective, descendants: true, isSignal: true }, { propertyName: "triggerEl", first: true, predicate: ["triggerEl"], descendants: true, isSignal: true }], usesInheritance: true, hostDirectives: [{ directive: i1.RtRadiusDirective, inputs: ["radius", "radius"] }], ngImport: i0, template: "<ng-container rtBlock=\"rt-select\">\n @if (isReadonly()) {\n <span rtElem=\"readonly\" [rtMod]=\"{ empty: !displayText() }\">{{ displayText() || '\u2014' }}</span>\n }\n <button\n #triggerEl\n rtElem=\"trigger\"\n qa-dataid=\"select-trigger\"\n type=\"button\"\n [rtPopoverWidth]=\"panelWidth()\"\n [rtMod]=\"{ own: !!triggerTpl() }\"\n [rtPopover]=\"panelTpl\"\n [rtPopoverDisabled]=\"isDisabled()\"\n [attr.id]=\"effectiveControlId()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n [attr.aria-controls]=\"panelId\"\n [attr.aria-activedescendant]=\"activeOptionId()\"\n [disabled]=\"isDisabled()\"\n (keydown)=\"onTriggerKeydown($event)\"\n (rtPopoverOpened)=\"onOpened()\"\n (rtPopoverClosed)=\"onClosed()\">\n <!--\n \u0420\u0430\u0437\u043C\u0435\u0442\u043A\u0430 \u0443\u043A\u0430\u0437\u0430\u0442\u0435\u043B\u044F: \u0441\u0432\u043E\u044F, \u0435\u0441\u043B\u0438 \u043F\u043E\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043B\u044C \u0435\u0451 \u043E\u0431\u044A\u044F\u0432\u0438\u043B, \u0438\u043D\u0430\u0447\u0435 \u0437\u0430\u0448\u0438\u0442\u0430\u044F \u043A\u0438\u0442\u043E\u043C. \u041E\u043D\u0430 \u0432\u0441\u0442\u0430\u0451\u0442\n \u0432\u043D\u0443\u0442\u0440\u044C \u043A\u043D\u043E\u043F\u043A\u0438, \u0430 \u043D\u0435 \u0432\u043C\u0435\u0441\u0442\u043E \u043D\u0435\u0451: \u043F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u0435 \u2014 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0435 \u043F\u0430\u043D\u0435\u043B\u0438, \u043F\u0440\u0438\u043C\u0435\u0442\u044B \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E\u0441\u0442\u0438,\n \u043E\u0442\u043A\u043B\u044E\u0447\u0451\u043D\u043D\u043E\u0441\u0442\u044C, \u043A\u043B\u0430\u0432\u0438\u0448\u0438 \u0438 \u0437\u0430\u043A\u0440\u044B\u0442\u0438\u0435 \u2014 \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u043D\u0430 \u043A\u043D\u043E\u043F\u043A\u0435 \u043A\u0438\u0442\u0430.\n -->\n @if (triggerTpl(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: triggerState() }\" />\n } @else {\n @if (iconLeft(); as left) {\n <rt-icon rtElem=\"icon-left\" size=\"sm\" color=\"muted\" [name]=\"left\" />\n }\n <span rtElem=\"label\" [rtMod]=\"{ placeholder: !selectedLabel() }\">\n {{ selectedLabel() || placeholder() }}\n </span>\n @if (showClearButton()) {\n <rt-icon-button\n rtElem=\"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 rtElem=\"chevron\" name=\"chevron-down\" size=\"sm\" color=\"muted\" />\n }\n </button>\n\n <ng-template #panelTpl>\n <div rtElem=\"panel\" role=\"listbox\" [style.--rt-select-panel-max-height]=\"panelMaxHeight()\" [attr.aria-label]=\"ariaLabel()\">\n @if (filter()) {\n <div rtElem=\"filter\">\n <rt-input\n iconLeft=\"ico-search\"\n [placeholder]=\"filterPlaceholderText()\"\n [ngModel]=\"filterTerm()\"\n (ngModelChange)=\"setFilter($event)\" />\n </div>\n }\n <!--\n \u041E\u043F\u0446\u0438\u0438 listbox'\u0430 \u0432\u044B\u0431\u0438\u0440\u0430\u044E\u0442\u0441\u044F \u043C\u044B\u0448\u044C\u044E \u0447\u0435\u0440\u0435\u0437 (click); keyboard-nav \u2014\n \u043D\u0430 trigger'\u0435 (activedescendant: ArrowUp/Down/Enter), \u043E\u043F\u0446\u0438\u0438 \u043D\u0435\n focusable \u0438\u043D\u0434\u0438\u0432\u0438\u0434\u0443\u0430\u043B\u044C\u043D\u043E, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 a11y-\u043F\u0440\u0430\u0432\u0438\u043B\u0430 \u0437\u0434\u0435\u0441\u044C \u043D\u0435 \u043F\u0440\u0438\u043C\u0435\u043D\u0438\u043C\u044B.\n -->\n <!-- eslint-disable @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <ul rtElem=\"list\">\n @for (row of rows(); track row.option.value; let i = $index) {\n <li\n rtElem=\"option\"\n qa-dataid=\"select-option\"\n role=\"option\"\n [id]=\"panelId + '-opt-' + i\"\n [attr.data-value]=\"row.option.value\"\n [attr.aria-level]=\"isTree() ? row.level + 1 : null\"\n [style.--rt-select-tree-level]=\"row.level\"\n [rtMod]=\"{\n selected: row.option.value === value(),\n active: i === activeIndex(),\n disabled: !!row.option.disabled,\n }\"\n [attr.aria-selected]=\"row.option.value === value()\"\n [attr.aria-disabled]=\"!!row.option.disabled\"\n (click)=\"select(row.option)\">\n @if (isTree()) {\n @if (row.branch) {\n <button\n rtElem=\"toggle\"\n qa-dataid=\"select-option-toggle\"\n type=\"button\"\n tabindex=\"-1\"\n [attr.aria-label]=\"row.open ? t().uiCollapse : t().uiExpand\"\n [attr.aria-expanded]=\"row.open\"\n (click)=\"toggleBranch($event, row.option.value)\">\n <rt-icon size=\"sm\" color=\"muted\" [name]=\"row.open ? 'chevron-down' : 'chevron-right'\" />\n </button>\n } @else {\n <span rtElem=\"toggle-space\"></span>\n }\n }\n <span rtElem=\"option-label\">{{ row.option.label }}</span>\n @if (row.option.value === value()) {\n <rt-icon rtElem=\"check\" name=\"check\" size=\"sm\" aria-hidden=\"true\" />\n }\n </li>\n } @empty {\n <li rtElem=\"empty\">{{ t().uiNoOptions }}</li>\n }\n </ul>\n </div>\n </ng-template>\n</ng-container>\n", styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-select{--rt-select-radius: var(--rt-input-radius);--rt-select-fill-radius: var(--rt-radius-sm);--rt-select-caret-transition-duration: var(--rt-duration-fast);--rt-select-own-outline-width: var(--rt-border-width-medium);position:relative;display:block;width:100%}.rt-select--borderless .rt-select__trigger{border-color:transparent}.rt-select--appearance--fill .rt-select__trigger{border-color:transparent;border-radius:var(--rt-select-fill-radius) var(--rt-select-fill-radius) 0 0;border-bottom-color:var(--rt-color-field-fill-underline);background-color:var(--rt-color-bg-surface-subtle-2)}.rt-select__trigger{display: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-select-radius);background-color:var(--rt-input-color-bg);color:var(--rt-input-color-text);cursor:pointer;font-family:inherit;font-size:var(--rt-input-font-size);gap:var(--rt-space-sm);line-height:var(--rt-input-line-height);text-align:start;transition:var(--rt-input-transition)}.rt-select__trigger:focus{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-select__trigger:disabled{cursor:not-allowed}.rt-select__trigger--own{width:auto;min-height:0;padding:0;border-color:transparent;background-color:transparent;line-height:var(--rt-leading-none)}.rt-select__trigger--own:focus{border-color:transparent;box-shadow:none}.rt-select__trigger--own:focus-visible{outline:var(--rt-select-own-outline-width) solid var(--rt-input-color-border-focus);outline-offset:var(--rt-input-focus-outline-offset)}.rt-select--open .rt-select__trigger{border-color:var(--rt-input-color-border-focus)}.rt-select--open .rt-select__trigger--own{border-color:transparent}.rt-select--invalid .rt-select__trigger{border-color:var(--rt-input-color-border-error)}.rt-select--invalid .rt-select__trigger:focus{box-shadow:var(--rt-input-focus-shadow-error)}.rt-select--invalid .rt-select__trigger--own{border-color:transparent}.rt-select--invalid .rt-select__trigger--own:focus{box-shadow:none}.rt-select--disabled{opacity:var(--rt-input-disabled-opacity)}.rt-select--readonly .rt-select__trigger{display:none}.rt-select__readonly{display:inline-flex;min-height:var(--rt-input-height);align-items:center;color:var(--rt-field-value-color);font-size:var(--rt-field-value-font-size)}.rt-select__readonly--empty{color:var(--rt-field-value-empty-color)}.rt-select--size--sm .rt-select__trigger{min-height:var(--rt-input-height-sm)}.rt-select--size--lg .rt-select__trigger{min-height:var(--rt-input-height-lg)}.rt-select__label{overflow:hidden;min-width:0;flex:1 1 auto;text-overflow:ellipsis;white-space:nowrap}.rt-select__label--placeholder{color:var(--rt-input-color-text-placeholder)}.rt-select__icon-left,.rt-select__clear{flex-shrink:0}.rt-select__chevron{flex-shrink:0;transition:transform var(--rt-select-caret-transition-duration) ease}.rt-select--open .rt-select__chevron{transform:rotate(180deg)}:is(.rt-preset-material,[data-preset=material]) .rt-select__chevron{max-width:10px;max-height:5px;background-color:currentcolor;clip-path:polygon(0 0,100% 0,50% 100%);transform:none}:is(.rt-preset-material,[data-preset=material]) .rt-select__chevron svg{display:none}.rt-select__panel{--rt-select-panel-shadow: var(--rt-overlay-select-shadow);--rt-select-panel-radius: var(--rt-overlay-select-radius);--rt-select-option-font-size: var(--rt-overlay-select-option-font-size);--rt-select-selected-bg: var(--rt-overlay-select-selected-bg);--rt-select-selected-weight: var(--rt-overlay-select-selected-weight);--rt-select-check-display: var(--rt-overlay-select-check-display);--rt-select-option-min-height: var(--rt-overlay-select-option-min-height);--rt-select-panel-border-width: var(--rt-overlay-select-panel-border-width);--rt-select-tree-indent: var(--rt-space-lg);--rt-select-panel-max-height: var(--rt-input-panel-max-height);width:100%;max-height:var(--rt-select-panel-max-height);box-sizing:border-box;border:var(--rt-select-panel-border-width) solid var(--rt-color-border-subtle);border-radius:var(--rt-select-panel-radius);background-color:var(--rt-color-bg-surface);box-shadow:var(--rt-select-panel-shadow);overflow-y:auto}.rt-select__filter{padding:var(--rt-space-sm);border-block-end:var(--rt-input-border-width) solid var(--rt-color-border-subtle)}.rt-select__list{padding:var(--rt-space-2xs) 0;margin:0;list-style:none}.rt-select__option{--rt-select-tree-level: 0;display:flex;min-height:var(--rt-select-option-min-height);box-sizing:border-box;align-items:center;justify-content:space-between;padding:var(--rt-space-sm) var(--rt-space-md);color:var(--rt-color-text-primary);cursor:pointer;font-size:var(--rt-select-option-font-size);gap:var(--rt-space-sm);padding-inline-start:calc(var(--rt-space-md) + var(--rt-select-tree-indent) * var(--rt-select-tree-level))}.rt-select__option:hover,.rt-select__option--active{background-color:var(--rt-color-bg-hover)}.rt-select__option--selected{background-color:var(--rt-select-selected-bg);font-weight:var(--rt-select-selected-weight)}.rt-select__option--disabled{cursor:not-allowed;opacity:var(--rt-input-disabled-opacity)}.rt-select__option--disabled:hover{background-color:transparent}.rt-select__option-label{min-width:0;flex:1 1 auto}.rt-select__toggle,.rt-select__toggle-space{display:inline-flex;flex-shrink:0;block-size:var(--rt-input-icon-size);inline-size:var(--rt-input-icon-size)}.rt-select__toggle{align-items:center;justify-content:center;padding:0;border:0;background:transparent;cursor:pointer}.rt-select__check{display:var(--rt-select-check-display);flex-shrink:0}.rt-select__empty{padding:var(--rt-space-sm) var(--rt-space-md);color:var(--rt-input-color-text-placeholder);font-style:italic}.rt-select[data-rt-radius=none]{--rt-select-radius: var(--rt-radius-none)}.rt-select[data-rt-radius=xs]{--rt-select-radius: var(--rt-radius-xs)}.rt-select[data-rt-radius=sm]{--rt-select-radius: var(--rt-radius-sm)}.rt-select[data-rt-radius=ms]{--rt-select-radius: var(--rt-radius-ms)}.rt-select[data-rt-radius=md]{--rt-select-radius: var(--rt-radius-md)}.rt-select[data-rt-radius=lg]{--rt-select-radius: var(--rt-radius-lg)}.rt-select[data-rt-radius=xl]{--rt-select-radius: var(--rt-radius-xl)}.rt-select[data-rt-radius=\"2xl\"]{--rt-select-radius: var(--rt-radius-2xl)}.rt-select[data-rt-radius=full]{--rt-select-radius: var(--rt-radius-full)}}\n"], dependencies: [{ kind: "ngmodule", type:
468
- // Angular
469
- FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type:
470
- // standalone components / directives
471
- 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: RtIconComponent, selector: "rt-icon", inputs: ["name", "glyph", "glyphStrategy", "size", "color", "fill", "spin", "rotate"] }, { kind: "component", type: RtInputComponent, selector: "rt-input", inputs: ["appearance", "type", "placeholder", "iconLeft", "iconRight", "passwordToggle", "autocomplete"] }, { 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 }); }
472
- }
473
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtSelectComponent, decorators: [{
474
- type: Component,
475
- args: [{ selector: 'rt-select', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
476
- // Angular
477
- FormsModule,
478
- NgTemplateOutlet,
479
- // standalone components / directives
480
- RtIconButtonComponent,
481
- RtIconComponent,
482
- RtInputComponent,
483
- RtPopoverDirective,
484
- BlockDirective,
485
- ElemDirective,
486
- ModDirective,
487
- ], providers: [
488
- // Алиас базового токена — для contentChild(RtFormControlBase) в rt-field.
489
- { provide: RtFormControlBase, useExisting: forwardRef(() => RtSelectComponent) },
490
- ], hostDirectives: [{ directive: RtRadiusDirective, inputs: ['radius'] }], host: {
491
- class: BEM_BLOCK,
492
- '[class.rt-select--open]': 'isOpen()',
493
- '[class.rt-select--disabled]': 'isDisabled()',
494
- '[class.rt-select--readonly]': 'isReadonly()',
495
- '[class.rt-select--invalid]': 'isInvalid()',
496
- '[class.rt-select--borderless]': '!bordered()',
497
- '[class.rt-select--appearance--fill]': "appearance() === 'fill'",
498
- '[class.rt-select--size--sm]': "size() === 'sm'",
499
- '[class.rt-select--size--lg]': "size() === 'lg'",
500
- '[class.rt-select--with-icon-left]': '!!iconLeft()',
501
- }, template: "<ng-container rtBlock=\"rt-select\">\n @if (isReadonly()) {\n <span rtElem=\"readonly\" [rtMod]=\"{ empty: !displayText() }\">{{ displayText() || '\u2014' }}</span>\n }\n <button\n #triggerEl\n rtElem=\"trigger\"\n qa-dataid=\"select-trigger\"\n type=\"button\"\n [rtPopoverWidth]=\"panelWidth()\"\n [rtMod]=\"{ own: !!triggerTpl() }\"\n [rtPopover]=\"panelTpl\"\n [rtPopoverDisabled]=\"isDisabled()\"\n [attr.id]=\"effectiveControlId()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n [attr.aria-controls]=\"panelId\"\n [attr.aria-activedescendant]=\"activeOptionId()\"\n [disabled]=\"isDisabled()\"\n (keydown)=\"onTriggerKeydown($event)\"\n (rtPopoverOpened)=\"onOpened()\"\n (rtPopoverClosed)=\"onClosed()\">\n <!--\n \u0420\u0430\u0437\u043C\u0435\u0442\u043A\u0430 \u0443\u043A\u0430\u0437\u0430\u0442\u0435\u043B\u044F: \u0441\u0432\u043E\u044F, \u0435\u0441\u043B\u0438 \u043F\u043E\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043B\u044C \u0435\u0451 \u043E\u0431\u044A\u044F\u0432\u0438\u043B, \u0438\u043D\u0430\u0447\u0435 \u0437\u0430\u0448\u0438\u0442\u0430\u044F \u043A\u0438\u0442\u043E\u043C. \u041E\u043D\u0430 \u0432\u0441\u0442\u0430\u0451\u0442\n \u0432\u043D\u0443\u0442\u0440\u044C \u043A\u043D\u043E\u043F\u043A\u0438, \u0430 \u043D\u0435 \u0432\u043C\u0435\u0441\u0442\u043E \u043D\u0435\u0451: \u043F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u0435 \u2014 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0435 \u043F\u0430\u043D\u0435\u043B\u0438, \u043F\u0440\u0438\u043C\u0435\u0442\u044B \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E\u0441\u0442\u0438,\n \u043E\u0442\u043A\u043B\u044E\u0447\u0451\u043D\u043D\u043E\u0441\u0442\u044C, \u043A\u043B\u0430\u0432\u0438\u0448\u0438 \u0438 \u0437\u0430\u043A\u0440\u044B\u0442\u0438\u0435 \u2014 \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u043D\u0430 \u043A\u043D\u043E\u043F\u043A\u0435 \u043A\u0438\u0442\u0430.\n -->\n @if (triggerTpl(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: triggerState() }\" />\n } @else {\n @if (iconLeft(); as left) {\n <rt-icon rtElem=\"icon-left\" size=\"sm\" color=\"muted\" [name]=\"left\" />\n }\n <span rtElem=\"label\" [rtMod]=\"{ placeholder: !selectedLabel() }\">\n {{ selectedLabel() || placeholder() }}\n </span>\n @if (showClearButton()) {\n <rt-icon-button\n rtElem=\"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 rtElem=\"chevron\" name=\"chevron-down\" size=\"sm\" color=\"muted\" />\n }\n </button>\n\n <ng-template #panelTpl>\n <div rtElem=\"panel\" role=\"listbox\" [style.--rt-select-panel-max-height]=\"panelMaxHeight()\" [attr.aria-label]=\"ariaLabel()\">\n @if (filter()) {\n <div rtElem=\"filter\">\n <rt-input\n iconLeft=\"ico-search\"\n [placeholder]=\"filterPlaceholderText()\"\n [ngModel]=\"filterTerm()\"\n (ngModelChange)=\"setFilter($event)\" />\n </div>\n }\n <!--\n \u041E\u043F\u0446\u0438\u0438 listbox'\u0430 \u0432\u044B\u0431\u0438\u0440\u0430\u044E\u0442\u0441\u044F \u043C\u044B\u0448\u044C\u044E \u0447\u0435\u0440\u0435\u0437 (click); keyboard-nav \u2014\n \u043D\u0430 trigger'\u0435 (activedescendant: ArrowUp/Down/Enter), \u043E\u043F\u0446\u0438\u0438 \u043D\u0435\n focusable \u0438\u043D\u0434\u0438\u0432\u0438\u0434\u0443\u0430\u043B\u044C\u043D\u043E, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 a11y-\u043F\u0440\u0430\u0432\u0438\u043B\u0430 \u0437\u0434\u0435\u0441\u044C \u043D\u0435 \u043F\u0440\u0438\u043C\u0435\u043D\u0438\u043C\u044B.\n -->\n <!-- eslint-disable @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <ul rtElem=\"list\">\n @for (row of rows(); track row.option.value; let i = $index) {\n <li\n rtElem=\"option\"\n qa-dataid=\"select-option\"\n role=\"option\"\n [id]=\"panelId + '-opt-' + i\"\n [attr.data-value]=\"row.option.value\"\n [attr.aria-level]=\"isTree() ? row.level + 1 : null\"\n [style.--rt-select-tree-level]=\"row.level\"\n [rtMod]=\"{\n selected: row.option.value === value(),\n active: i === activeIndex(),\n disabled: !!row.option.disabled,\n }\"\n [attr.aria-selected]=\"row.option.value === value()\"\n [attr.aria-disabled]=\"!!row.option.disabled\"\n (click)=\"select(row.option)\">\n @if (isTree()) {\n @if (row.branch) {\n <button\n rtElem=\"toggle\"\n qa-dataid=\"select-option-toggle\"\n type=\"button\"\n tabindex=\"-1\"\n [attr.aria-label]=\"row.open ? t().uiCollapse : t().uiExpand\"\n [attr.aria-expanded]=\"row.open\"\n (click)=\"toggleBranch($event, row.option.value)\">\n <rt-icon size=\"sm\" color=\"muted\" [name]=\"row.open ? 'chevron-down' : 'chevron-right'\" />\n </button>\n } @else {\n <span rtElem=\"toggle-space\"></span>\n }\n }\n <span rtElem=\"option-label\">{{ row.option.label }}</span>\n @if (row.option.value === value()) {\n <rt-icon rtElem=\"check\" name=\"check\" size=\"sm\" aria-hidden=\"true\" />\n }\n </li>\n } @empty {\n <li rtElem=\"empty\">{{ t().uiNoOptions }}</li>\n }\n </ul>\n </div>\n </ng-template>\n</ng-container>\n", styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-select{--rt-select-radius: var(--rt-input-radius);--rt-select-fill-radius: var(--rt-radius-sm);--rt-select-caret-transition-duration: var(--rt-duration-fast);--rt-select-own-outline-width: var(--rt-border-width-medium);position:relative;display:block;width:100%}.rt-select--borderless .rt-select__trigger{border-color:transparent}.rt-select--appearance--fill .rt-select__trigger{border-color:transparent;border-radius:var(--rt-select-fill-radius) var(--rt-select-fill-radius) 0 0;border-bottom-color:var(--rt-color-field-fill-underline);background-color:var(--rt-color-bg-surface-subtle-2)}.rt-select__trigger{display: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-select-radius);background-color:var(--rt-input-color-bg);color:var(--rt-input-color-text);cursor:pointer;font-family:inherit;font-size:var(--rt-input-font-size);gap:var(--rt-space-sm);line-height:var(--rt-input-line-height);text-align:start;transition:var(--rt-input-transition)}.rt-select__trigger:focus{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-select__trigger:disabled{cursor:not-allowed}.rt-select__trigger--own{width:auto;min-height:0;padding:0;border-color:transparent;background-color:transparent;line-height:var(--rt-leading-none)}.rt-select__trigger--own:focus{border-color:transparent;box-shadow:none}.rt-select__trigger--own:focus-visible{outline:var(--rt-select-own-outline-width) solid var(--rt-input-color-border-focus);outline-offset:var(--rt-input-focus-outline-offset)}.rt-select--open .rt-select__trigger{border-color:var(--rt-input-color-border-focus)}.rt-select--open .rt-select__trigger--own{border-color:transparent}.rt-select--invalid .rt-select__trigger{border-color:var(--rt-input-color-border-error)}.rt-select--invalid .rt-select__trigger:focus{box-shadow:var(--rt-input-focus-shadow-error)}.rt-select--invalid .rt-select__trigger--own{border-color:transparent}.rt-select--invalid .rt-select__trigger--own:focus{box-shadow:none}.rt-select--disabled{opacity:var(--rt-input-disabled-opacity)}.rt-select--readonly .rt-select__trigger{display:none}.rt-select__readonly{display:inline-flex;min-height:var(--rt-input-height);align-items:center;color:var(--rt-field-value-color);font-size:var(--rt-field-value-font-size)}.rt-select__readonly--empty{color:var(--rt-field-value-empty-color)}.rt-select--size--sm .rt-select__trigger{min-height:var(--rt-input-height-sm)}.rt-select--size--lg .rt-select__trigger{min-height:var(--rt-input-height-lg)}.rt-select__label{overflow:hidden;min-width:0;flex:1 1 auto;text-overflow:ellipsis;white-space:nowrap}.rt-select__label--placeholder{color:var(--rt-input-color-text-placeholder)}.rt-select__icon-left,.rt-select__clear{flex-shrink:0}.rt-select__chevron{flex-shrink:0;transition:transform var(--rt-select-caret-transition-duration) ease}.rt-select--open .rt-select__chevron{transform:rotate(180deg)}:is(.rt-preset-material,[data-preset=material]) .rt-select__chevron{max-width:10px;max-height:5px;background-color:currentcolor;clip-path:polygon(0 0,100% 0,50% 100%);transform:none}:is(.rt-preset-material,[data-preset=material]) .rt-select__chevron svg{display:none}.rt-select__panel{--rt-select-panel-shadow: var(--rt-overlay-select-shadow);--rt-select-panel-radius: var(--rt-overlay-select-radius);--rt-select-option-font-size: var(--rt-overlay-select-option-font-size);--rt-select-selected-bg: var(--rt-overlay-select-selected-bg);--rt-select-selected-weight: var(--rt-overlay-select-selected-weight);--rt-select-check-display: var(--rt-overlay-select-check-display);--rt-select-option-min-height: var(--rt-overlay-select-option-min-height);--rt-select-panel-border-width: var(--rt-overlay-select-panel-border-width);--rt-select-tree-indent: var(--rt-space-lg);--rt-select-panel-max-height: var(--rt-input-panel-max-height);width:100%;max-height:var(--rt-select-panel-max-height);box-sizing:border-box;border:var(--rt-select-panel-border-width) solid var(--rt-color-border-subtle);border-radius:var(--rt-select-panel-radius);background-color:var(--rt-color-bg-surface);box-shadow:var(--rt-select-panel-shadow);overflow-y:auto}.rt-select__filter{padding:var(--rt-space-sm);border-block-end:var(--rt-input-border-width) solid var(--rt-color-border-subtle)}.rt-select__list{padding:var(--rt-space-2xs) 0;margin:0;list-style:none}.rt-select__option{--rt-select-tree-level: 0;display:flex;min-height:var(--rt-select-option-min-height);box-sizing:border-box;align-items:center;justify-content:space-between;padding:var(--rt-space-sm) var(--rt-space-md);color:var(--rt-color-text-primary);cursor:pointer;font-size:var(--rt-select-option-font-size);gap:var(--rt-space-sm);padding-inline-start:calc(var(--rt-space-md) + var(--rt-select-tree-indent) * var(--rt-select-tree-level))}.rt-select__option:hover,.rt-select__option--active{background-color:var(--rt-color-bg-hover)}.rt-select__option--selected{background-color:var(--rt-select-selected-bg);font-weight:var(--rt-select-selected-weight)}.rt-select__option--disabled{cursor:not-allowed;opacity:var(--rt-input-disabled-opacity)}.rt-select__option--disabled:hover{background-color:transparent}.rt-select__option-label{min-width:0;flex:1 1 auto}.rt-select__toggle,.rt-select__toggle-space{display:inline-flex;flex-shrink:0;block-size:var(--rt-input-icon-size);inline-size:var(--rt-input-icon-size)}.rt-select__toggle{align-items:center;justify-content:center;padding:0;border:0;background:transparent;cursor:pointer}.rt-select__check{display:var(--rt-select-check-display);flex-shrink:0}.rt-select__empty{padding:var(--rt-space-sm) var(--rt-space-md);color:var(--rt-input-color-text-placeholder);font-style:italic}.rt-select[data-rt-radius=none]{--rt-select-radius: var(--rt-radius-none)}.rt-select[data-rt-radius=xs]{--rt-select-radius: var(--rt-radius-xs)}.rt-select[data-rt-radius=sm]{--rt-select-radius: var(--rt-radius-sm)}.rt-select[data-rt-radius=ms]{--rt-select-radius: var(--rt-radius-ms)}.rt-select[data-rt-radius=md]{--rt-select-radius: var(--rt-radius-md)}.rt-select[data-rt-radius=lg]{--rt-select-radius: var(--rt-radius-lg)}.rt-select[data-rt-radius=xl]{--rt-select-radius: var(--rt-radius-xl)}.rt-select[data-rt-radius=\"2xl\"]{--rt-select-radius: var(--rt-radius-2xl)}.rt-select[data-rt-radius=full]{--rt-select-radius: var(--rt-radius-full)}}\n"] }]
502
- }], ctorParameters: () => [], propDecorators: { popover: [{ type: i0.ViewChild, args: [i0.forwardRef(() => RtPopoverDirective), { isSignal: true }] }], triggerEl: [{ type: i0.ViewChild, args: ['triggerEl', { isSignal: true }] }], triggerTpl: [{ type: i0.ContentChild, args: [i0.forwardRef(() => RtSelectTriggerDirective), { isSignal: true }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], iconLeft: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconLeft", required: false }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: false }] }], filterPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterPlaceholder", required: false }] }], panelWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelWidth", required: false }] }], panelMaxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelMaxHeight", required: false }] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }] } });
503
-
504
- /**
505
- * Generated bundle index. Do not edit.
506
- */
507
-
193
+ var RtSelectComponent = class RtSelectComponent extends RtFormControlBase {
194
+ #t_uiSearch;
195
+ constructor() {
196
+ super();
197
+ this.#t_uiSearch = rtKitLabel("uiSearch");
198
+ this.t = inject(RT_KIT_LABELS);
199
+ this.panelId = `rt-select-panel-${nextPanelId()}`;
200
+ this.filterPlaceholderText = computed(() => this.filterPlaceholder() || this.#t_uiSearch(), ...ngDevMode ? [{ debugName: "filterPlaceholderText" }] : /* istanbul ignore next */ []);
201
+ this.popover = viewChild.required(RtPopoverDirective, ...ngDevMode ? [{ debugName: "popover" }] : /* istanbul ignore next */ []);
202
+ this.triggerEl = viewChild("triggerEl", ...ngDevMode ? [{ debugName: "triggerEl" }] : /* istanbul ignore next */ []);
203
+ this.filterTerm = signal("", ...ngDevMode ? [{ debugName: "filterTerm" }] : /* istanbul ignore next */ []);
204
+ this.activeIndex = signal(-1, ...ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []);
205
+ this.openBranches = signal(/* @__PURE__ */ new Set(), ...ngDevMode ? [{ debugName: "openBranches" }] : /* istanbul ignore next */ []);
206
+ this.isOpen = computed(() => this.popover().isOpen(), ...ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []);
207
+ this.activeOptionId = computed(() => this.isOpen() && this.activeIndex() >= 0 ? `${this.panelId}-opt-${this.activeIndex()}` : null, ...ngDevMode ? [{ debugName: "activeOptionId" }] : /* istanbul ignore next */ []);
208
+ this.triggerTpl = contentChild(RtSelectTriggerDirective, ...ngDevMode ? [{ debugName: "triggerTpl" }] : /* istanbul ignore next */ []);
209
+ this.hasValue = computed(() => this.value() !== null, ...ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []);
210
+ this.selectedLabel = computed(() => {
211
+ const v = this.value();
212
+ if (v === null) return "";
213
+ return rtTreeFind(this.options(), v)?.label ?? "";
214
+ }, ...ngDevMode ? [{ debugName: "selectedLabel" }] : /* istanbul ignore next */ []);
215
+ this.isTree = computed(() => rtTreeIsTree(this.options()), ...ngDevMode ? [{ debugName: "isTree" }] : /* istanbul ignore next */ []);
216
+ this.rows = computed(() => rtTreeRows(this.options(), this.openBranches(), this.filterTerm()), ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
217
+ this.triggerState = computed(() => ({
218
+ isOpen: this.isOpen(),
219
+ value: this.value(),
220
+ label: this.selectedLabel(),
221
+ isDisabled: this.isDisabled()
222
+ }), ...ngDevMode ? [{ debugName: "triggerState" }] : /* istanbul ignore next */ []);
223
+ this.appearance = input("outline", ...ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []);
224
+ this.displayText = computed(() => this.selectedLabel(), ...ngDevMode ? [{ debugName: "displayText" }] : /* istanbul ignore next */ []);
225
+ this.options = input([], ...ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []);
226
+ this.placeholder = input("", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
227
+ this.iconLeft = input(null, ...ngDevMode ? [{ debugName: "iconLeft" }] : /* istanbul ignore next */ []);
228
+ this.filter = input(false, {
229
+ ...ngDevMode ? { debugName: "filter" } : /* istanbul ignore next */ {},
230
+ transform: booleanAttribute
231
+ });
232
+ this.filterPlaceholder = input("", ...ngDevMode ? [{ debugName: "filterPlaceholder" }] : /* istanbul ignore next */ []);
233
+ this.panelWidth = input("trigger-min", ...ngDevMode ? [{ debugName: "panelWidth" }] : /* istanbul ignore next */ []);
234
+ this.panelMaxHeight = input(null, ...ngDevMode ? [{ debugName: "panelMaxHeight" }] : /* istanbul ignore next */ []);
235
+ this.selectionChange = output();
236
+ rtScrollActiveOptionIntoView(this.activeOptionId);
237
+ }
238
+ setDisabledState(disabled) {
239
+ super.setDisabledState(disabled);
240
+ if (disabled) this.popover().close();
241
+ }
242
+ getEmptyValue() {
243
+ return null;
244
+ }
245
+ focusAfterClear() {
246
+ this.triggerEl()?.nativeElement.focus();
247
+ }
248
+ clear(event) {
249
+ if (this.isDisabled()) return;
250
+ super.clear(event);
251
+ this.selectionChange.emit(null);
252
+ }
253
+ onOpened() {
254
+ const v = this.value();
255
+ this.openBranches.set(rtTreeOpenFor(this.options(), v === null ? [] : [v]));
256
+ if (v !== null) {
257
+ const chosen = this.rows().findIndex((row) => row.option.value === v);
258
+ if (chosen >= 0) this.activeIndex.set(chosen);
259
+ }
260
+ }
261
+ toggleBranch(event, value) {
262
+ event.stopPropagation();
263
+ this.openBranches.update((open) => rtTreeToggle(open, value));
264
+ }
265
+ onClosed() {
266
+ this.filterTerm.set("");
267
+ this.activeIndex.set(-1);
268
+ this.markTouched();
269
+ }
270
+ select(opt) {
271
+ if (opt.disabled) return;
272
+ this.value.set(opt.value);
273
+ this.emitChange(opt.value);
274
+ this.selectionChange.emit(opt.value);
275
+ this.popover().close();
276
+ }
277
+ setFilter(term) {
278
+ this.filterTerm.set(term);
279
+ this.activeIndex.set(-1);
280
+ }
281
+ onTriggerKeydown(event) {
282
+ if (this.isDisabled()) return;
283
+ if (!this.isOpen()) {
284
+ if (OPEN_KEYS.has(event.key)) {
285
+ event.preventDefault();
286
+ this.popover().open();
287
+ if (this.activeIndex() < 0) this.#moveActive(1);
288
+ }
289
+ return;
290
+ }
291
+ this.#handleOpenKeydown(event);
292
+ }
293
+ #handleOpenKeydown(event) {
294
+ switch (event.key) {
295
+ case "ArrowDown":
296
+ event.preventDefault();
297
+ this.#moveActive(1);
298
+ break;
299
+ case "ArrowUp":
300
+ event.preventDefault();
301
+ this.#moveActive(-1);
302
+ break;
303
+ case "Enter":
304
+ case " ":
305
+ event.preventDefault();
306
+ this.#selectActive();
307
+ break;
308
+ case "Escape":
309
+ event.preventDefault();
310
+ this.popover().close();
311
+ break;
312
+ case "ArrowRight":
313
+ case "ArrowLeft":
314
+ event.preventDefault();
315
+ this.#sideKey(event.key);
316
+ }
317
+ }
318
+ #sideKey(key) {
319
+ const answer = rtTreeSideKey(this.rows(), this.activeIndex(), key);
320
+ const toggle = answer.toggle;
321
+ if (toggle !== null) this.openBranches.update((open) => rtTreeToggle(open, toggle));
322
+ this.activeIndex.set(answer.index);
323
+ }
324
+ #moveActive(delta) {
325
+ const opts = this.rows().map((row) => row.option);
326
+ if (opts.length === 0) {
327
+ this.activeIndex.set(-1);
328
+ return;
329
+ }
330
+ let index = this.activeIndex();
331
+ for (let step = 0; step < opts.length; step += 1) {
332
+ index = (index + delta + opts.length) % opts.length;
333
+ if (!opts[index].disabled) {
334
+ this.activeIndex.set(index);
335
+ return;
336
+ }
337
+ }
338
+ }
339
+ #selectActive() {
340
+ const opts = this.rows().map((row) => row.option);
341
+ const index = this.activeIndex();
342
+ if (index >= 0 && index < opts.length) this.select(opts[index]);
343
+ }
344
+ static {
345
+ this.ɵfac = i0.ɵɵngDeclareFactory({
346
+ minVersion: "12.0.0",
347
+ version: "22.2.2",
348
+ ngImport: i0,
349
+ type: RtSelectComponent,
350
+ deps: [],
351
+ target: i0.ɵɵFactoryTarget.Component
352
+ });
353
+ }
354
+ static {
355
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
356
+ minVersion: "17.0.0",
357
+ version: "22.2.2",
358
+ type: RtSelectComponent,
359
+ isStandalone: true,
360
+ selector: "rt-select",
361
+ inputs: {
362
+ appearance: {
363
+ classPropertyName: "appearance",
364
+ publicName: "appearance",
365
+ isSignal: true,
366
+ isRequired: false,
367
+ transformFunction: null
368
+ },
369
+ options: {
370
+ classPropertyName: "options",
371
+ publicName: "options",
372
+ isSignal: true,
373
+ isRequired: false,
374
+ transformFunction: null
375
+ },
376
+ placeholder: {
377
+ classPropertyName: "placeholder",
378
+ publicName: "placeholder",
379
+ isSignal: true,
380
+ isRequired: false,
381
+ transformFunction: null
382
+ },
383
+ iconLeft: {
384
+ classPropertyName: "iconLeft",
385
+ publicName: "iconLeft",
386
+ isSignal: true,
387
+ isRequired: false,
388
+ transformFunction: null
389
+ },
390
+ filter: {
391
+ classPropertyName: "filter",
392
+ publicName: "filter",
393
+ isSignal: true,
394
+ isRequired: false,
395
+ transformFunction: null
396
+ },
397
+ filterPlaceholder: {
398
+ classPropertyName: "filterPlaceholder",
399
+ publicName: "filterPlaceholder",
400
+ isSignal: true,
401
+ isRequired: false,
402
+ transformFunction: null
403
+ },
404
+ panelWidth: {
405
+ classPropertyName: "panelWidth",
406
+ publicName: "panelWidth",
407
+ isSignal: true,
408
+ isRequired: false,
409
+ transformFunction: null
410
+ },
411
+ panelMaxHeight: {
412
+ classPropertyName: "panelMaxHeight",
413
+ publicName: "panelMaxHeight",
414
+ isSignal: true,
415
+ isRequired: false,
416
+ transformFunction: null
417
+ }
418
+ },
419
+ outputs: { selectionChange: "selectionChange" },
420
+ host: {
421
+ properties: {
422
+ "class.rt-select--open": "isOpen()",
423
+ "class.rt-select--disabled": "isDisabled()",
424
+ "class.rt-select--readonly": "isReadonly()",
425
+ "class.rt-select--invalid": "isInvalid()",
426
+ "class.rt-select--borderless": "!bordered()",
427
+ "class.rt-select--appearance--fill": "appearance() === 'fill'",
428
+ "class.rt-select--size--sm": "size() === 'sm'",
429
+ "class.rt-select--size--lg": "size() === 'lg'",
430
+ "class.rt-select--with-icon-left": "!!iconLeft()"
431
+ },
432
+ classAttribute: "rt-select"
433
+ },
434
+ providers: [{
435
+ provide: RtFormControlBase,
436
+ useExisting: forwardRef(() => RtSelectComponent)
437
+ }],
438
+ queries: [{
439
+ propertyName: "triggerTpl",
440
+ first: true,
441
+ predicate: RtSelectTriggerDirective,
442
+ descendants: true,
443
+ isSignal: true
444
+ }],
445
+ viewQueries: [{
446
+ propertyName: "popover",
447
+ first: true,
448
+ predicate: RtPopoverDirective,
449
+ descendants: true,
450
+ isSignal: true
451
+ }, {
452
+ propertyName: "triggerEl",
453
+ first: true,
454
+ predicate: ["triggerEl"],
455
+ descendants: true,
456
+ isSignal: true
457
+ }],
458
+ usesInheritance: true,
459
+ hostDirectives: [{
460
+ directive: i1.RtRadiusDirective,
461
+ inputs: ["radius", "radius"]
462
+ }],
463
+ ngImport: i0,
464
+ template: "<ng-container rtBlock=\"rt-select\">\n @if (isReadonly()) {\n <span rtElem=\"readonly\" [rtMod]=\"{ empty: !displayText() }\">{{ displayText() || '—' }}</span>\n }\n <button\n #triggerEl\n rtElem=\"trigger\"\n qa-dataid=\"select-trigger\"\n type=\"button\"\n [rtPopoverWidth]=\"panelWidth()\"\n [rtMod]=\"{ own: !!triggerTpl() }\"\n [rtPopover]=\"panelTpl\"\n [rtPopoverDisabled]=\"isDisabled()\"\n [attr.id]=\"effectiveControlId()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n [attr.aria-controls]=\"panelId\"\n [attr.aria-activedescendant]=\"activeOptionId()\"\n [disabled]=\"isDisabled()\"\n (keydown)=\"onTriggerKeydown($event)\"\n (rtPopoverOpened)=\"onOpened()\"\n (rtPopoverClosed)=\"onClosed()\">\n <!--\n Разметка указателя: своя, если потребитель её объявил, иначе зашитая китом. Она встаёт\n внутрь кнопки, а не вместо неё: поведение — открытие панели, приметы доступности,\n отключённость, клавиши и закрытие — остаётся на кнопке кита.\n -->\n @if (triggerTpl(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: triggerState() }\" />\n } @else {\n @if (iconLeft(); as left) {\n <rt-icon rtElem=\"icon-left\" size=\"sm\" color=\"muted\" [name]=\"left\" />\n }\n <span rtElem=\"label\" [rtMod]=\"{ placeholder: !selectedLabel() }\">\n {{ selectedLabel() || placeholder() }}\n </span>\n @if (showClearButton()) {\n <rt-icon-button\n rtElem=\"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 rtElem=\"chevron\" name=\"chevron-down\" size=\"sm\" color=\"muted\" />\n }\n </button>\n\n <ng-template #panelTpl>\n <div rtElem=\"panel\" role=\"listbox\" [style.--rt-select-panel-max-height]=\"panelMaxHeight()\" [attr.aria-label]=\"ariaLabel()\">\n @if (filter()) {\n <div rtElem=\"filter\">\n <rt-input\n iconLeft=\"ico-search\"\n [placeholder]=\"filterPlaceholderText()\"\n [ngModel]=\"filterTerm()\"\n (ngModelChange)=\"setFilter($event)\" />\n </div>\n }\n <!--\n Опции listbox'а выбираются мышью через (click); keyboard-nav —\n на trigger'е (activedescendant: ArrowUp/Down/Enter), опции не\n focusable индивидуально, поэтому a11y-правила здесь не применимы.\n -->\n <!-- eslint-disable @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <ul rtElem=\"list\">\n @for (row of rows(); track row.option.value; let i = $index) {\n <li\n rtElem=\"option\"\n qa-dataid=\"select-option\"\n role=\"option\"\n [id]=\"panelId + '-opt-' + i\"\n [attr.data-value]=\"row.option.value\"\n [attr.aria-level]=\"isTree() ? row.level + 1 : null\"\n [style.--rt-select-tree-level]=\"row.level\"\n [rtMod]=\"{\n selected: row.option.value === value(),\n active: i === activeIndex(),\n disabled: !!row.option.disabled,\n }\"\n [attr.aria-selected]=\"row.option.value === value()\"\n [attr.aria-disabled]=\"!!row.option.disabled\"\n (click)=\"select(row.option)\">\n @if (isTree()) {\n @if (row.branch) {\n <button\n rtElem=\"toggle\"\n qa-dataid=\"select-option-toggle\"\n type=\"button\"\n tabindex=\"-1\"\n [attr.aria-label]=\"row.open ? t().uiCollapse : t().uiExpand\"\n [attr.aria-expanded]=\"row.open\"\n (click)=\"toggleBranch($event, row.option.value)\">\n <rt-icon size=\"sm\" color=\"muted\" [name]=\"row.open ? 'chevron-down' : 'chevron-right'\" />\n </button>\n } @else {\n <span rtElem=\"toggle-space\"></span>\n }\n }\n <span rtElem=\"option-label\">{{ row.option.label }}</span>\n @if (row.option.value === value()) {\n <rt-icon rtElem=\"check\" name=\"check\" size=\"sm\" aria-hidden=\"true\" />\n }\n </li>\n } @empty {\n <li rtElem=\"empty\">{{ t().uiNoOptions }}</li>\n }\n </ul>\n </div>\n </ng-template>\n</ng-container>\n",
465
+ styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-select{--rt-select-radius: var(--rt-input-radius);--rt-select-fill-radius: var(--rt-radius-sm);--rt-select-caret-transition-duration: var(--rt-duration-fast);--rt-select-own-outline-width: var(--rt-border-width-medium);position:relative;display:block;width:100%}.rt-select--borderless .rt-select__trigger{border-color:transparent}.rt-select--appearance--fill .rt-select__trigger{border-color:transparent;border-radius:var(--rt-select-fill-radius) var(--rt-select-fill-radius) 0 0;border-bottom-color:var(--rt-color-field-fill-underline);background-color:var(--rt-color-bg-surface-subtle-2)}.rt-select__trigger{display: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-select-radius);background-color:var(--rt-input-color-bg);color:var(--rt-input-color-text);cursor:pointer;font-family:inherit;font-size:var(--rt-input-font-size);gap:var(--rt-space-sm);line-height:var(--rt-input-line-height);text-align:start;transition:var(--rt-input-transition)}.rt-select__trigger:focus{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-select__trigger:disabled{cursor:not-allowed}.rt-select__trigger--own{width:auto;min-height:0;padding:0;border-color:transparent;background-color:transparent;line-height:var(--rt-leading-none)}.rt-select__trigger--own:focus{border-color:transparent;box-shadow:none}.rt-select__trigger--own:focus-visible{outline:var(--rt-select-own-outline-width) solid var(--rt-input-color-border-focus);outline-offset:var(--rt-input-focus-outline-offset)}.rt-select--open .rt-select__trigger{border-color:var(--rt-input-color-border-focus)}.rt-select--open .rt-select__trigger--own{border-color:transparent}.rt-select--invalid .rt-select__trigger{border-color:var(--rt-input-color-border-error)}.rt-select--invalid .rt-select__trigger:focus{box-shadow:var(--rt-input-focus-shadow-error)}.rt-select--invalid .rt-select__trigger--own{border-color:transparent}.rt-select--invalid .rt-select__trigger--own:focus{box-shadow:none}.rt-select--disabled{opacity:var(--rt-input-disabled-opacity)}.rt-select--readonly .rt-select__trigger{display:none}.rt-select__readonly{display:inline-flex;min-height:var(--rt-input-height);align-items:center;color:var(--rt-field-value-color);font-size:var(--rt-field-value-font-size)}.rt-select__readonly--empty{color:var(--rt-field-value-empty-color)}.rt-select--size--sm .rt-select__trigger{min-height:var(--rt-input-height-sm)}.rt-select--size--lg .rt-select__trigger{min-height:var(--rt-input-height-lg)}.rt-select__label{overflow:hidden;min-width:0;flex:1 1 auto;text-overflow:ellipsis;white-space:nowrap}.rt-select__label--placeholder{color:var(--rt-input-color-text-placeholder)}.rt-select__icon-left,.rt-select__clear{flex-shrink:0}.rt-select__chevron{flex-shrink:0;transition:transform var(--rt-select-caret-transition-duration) ease}.rt-select--open .rt-select__chevron{transform:rotate(180deg)}:is(.rt-preset-material,[data-preset=material]) .rt-select__chevron{max-width:10px;max-height:5px;background-color:currentcolor;clip-path:polygon(0 0,100% 0,50% 100%);transform:none}:is(.rt-preset-material,[data-preset=material]) .rt-select__chevron svg{display:none}.rt-select__panel{--rt-select-panel-shadow: var(--rt-overlay-select-shadow);--rt-select-panel-radius: var(--rt-overlay-select-radius);--rt-select-option-font-size: var(--rt-overlay-select-option-font-size);--rt-select-selected-bg: var(--rt-overlay-select-selected-bg);--rt-select-selected-weight: var(--rt-overlay-select-selected-weight);--rt-select-check-display: var(--rt-overlay-select-check-display);--rt-select-option-min-height: var(--rt-overlay-select-option-min-height);--rt-select-panel-border-width: var(--rt-overlay-select-panel-border-width);--rt-select-tree-indent: var(--rt-space-lg);--rt-select-panel-max-height: var(--rt-input-panel-max-height);width:100%;max-height:var(--rt-select-panel-max-height);box-sizing:border-box;border:var(--rt-select-panel-border-width) solid var(--rt-color-border-subtle);border-radius:var(--rt-select-panel-radius);background-color:var(--rt-color-bg-surface);box-shadow:var(--rt-select-panel-shadow);overflow-y:auto}.rt-select__filter{padding:var(--rt-space-sm);border-block-end:var(--rt-input-border-width) solid var(--rt-color-border-subtle)}.rt-select__list{padding:var(--rt-space-2xs) 0;margin:0;list-style:none}.rt-select__option{--rt-select-tree-level: 0;display:flex;min-height:var(--rt-select-option-min-height);box-sizing:border-box;align-items:center;justify-content:space-between;padding:var(--rt-space-sm) var(--rt-space-md);color:var(--rt-color-text-primary);cursor:pointer;font-size:var(--rt-select-option-font-size);gap:var(--rt-space-sm);padding-inline-start:calc(var(--rt-space-md) + var(--rt-select-tree-indent) * var(--rt-select-tree-level))}.rt-select__option:hover,.rt-select__option--active{background-color:var(--rt-color-bg-hover)}.rt-select__option--selected{background-color:var(--rt-select-selected-bg);font-weight:var(--rt-select-selected-weight)}.rt-select__option--disabled{cursor:not-allowed;opacity:var(--rt-input-disabled-opacity)}.rt-select__option--disabled:hover{background-color:transparent}.rt-select__option-label{min-width:0;flex:1 1 auto}.rt-select__toggle,.rt-select__toggle-space{display:inline-flex;flex-shrink:0;block-size:var(--rt-input-icon-size);inline-size:var(--rt-input-icon-size)}.rt-select__toggle{align-items:center;justify-content:center;padding:0;border:0;background:transparent;cursor:pointer}.rt-select__check{display:var(--rt-select-check-display);flex-shrink:0}.rt-select__empty{padding:var(--rt-space-sm) var(--rt-space-md);color:var(--rt-input-color-text-placeholder);font-style:italic}.rt-select[data-rt-radius=none]{--rt-select-radius: var(--rt-radius-none)}.rt-select[data-rt-radius=xs]{--rt-select-radius: var(--rt-radius-xs)}.rt-select[data-rt-radius=sm]{--rt-select-radius: var(--rt-radius-sm)}.rt-select[data-rt-radius=ms]{--rt-select-radius: var(--rt-radius-ms)}.rt-select[data-rt-radius=md]{--rt-select-radius: var(--rt-radius-md)}.rt-select[data-rt-radius=lg]{--rt-select-radius: var(--rt-radius-lg)}.rt-select[data-rt-radius=xl]{--rt-select-radius: var(--rt-radius-xl)}.rt-select[data-rt-radius=\"2xl\"]{--rt-select-radius: var(--rt-radius-2xl)}.rt-select[data-rt-radius=full]{--rt-select-radius: var(--rt-radius-full)}}\n"],
466
+ dependencies: [
467
+ {
468
+ kind: "ngmodule",
469
+ type: FormsModule
470
+ },
471
+ {
472
+ kind: "directive",
473
+ type: i2.NgControlStatus,
474
+ selector: "[formControlName],[ngModel],[formControl]"
475
+ },
476
+ {
477
+ kind: "directive",
478
+ type: i2.NgModel,
479
+ selector: "[ngModel]:not([formControlName]):not([formControl])",
480
+ inputs: [
481
+ "name",
482
+ "disabled",
483
+ "ngModel",
484
+ "ngModelOptions"
485
+ ],
486
+ outputs: ["ngModelChange"],
487
+ exportAs: ["ngModel"]
488
+ },
489
+ {
490
+ kind: "directive",
491
+ type: NgTemplateOutlet,
492
+ selector: "[ngTemplateOutlet]",
493
+ inputs: [
494
+ "ngTemplateOutletContext",
495
+ "ngTemplateOutlet",
496
+ "ngTemplateOutletInjector"
497
+ ]
498
+ },
499
+ {
500
+ kind: "component",
501
+ type: RtIconButtonComponent,
502
+ selector: "rt-icon-button",
503
+ inputs: [
504
+ "icon",
505
+ "glyph",
506
+ "ariaLabel",
507
+ "variant",
508
+ "iconColor",
509
+ "iconFill",
510
+ "size",
511
+ "iconSize",
512
+ "type",
513
+ "tooltip",
514
+ "tooltipHideOnClick",
515
+ "tabIndex",
516
+ "loading",
517
+ "disabled",
518
+ "active",
519
+ "expanded",
520
+ "indicator"
521
+ ],
522
+ outputs: ["clicked"]
523
+ },
524
+ {
525
+ kind: "component",
526
+ type: RtIconComponent,
527
+ selector: "rt-icon",
528
+ inputs: [
529
+ "name",
530
+ "glyph",
531
+ "glyphStrategy",
532
+ "size",
533
+ "color",
534
+ "fill",
535
+ "spin",
536
+ "rotate"
537
+ ]
538
+ },
539
+ {
540
+ kind: "component",
541
+ type: RtInputComponent,
542
+ selector: "rt-input",
543
+ inputs: [
544
+ "appearance",
545
+ "type",
546
+ "placeholder",
547
+ "iconLeft",
548
+ "iconRight",
549
+ "passwordToggle",
550
+ "autocomplete"
551
+ ]
552
+ },
553
+ {
554
+ kind: "directive",
555
+ type: RtPopoverDirective,
556
+ selector: "[rtPopover]",
557
+ inputs: [
558
+ "rtPopover",
559
+ "rtPopoverTrigger",
560
+ "rtPopoverWidth",
561
+ "rtPopoverAlign",
562
+ "rtPopoverFitViewport",
563
+ "rtPopoverContext",
564
+ "rtPopoverPanelClass",
565
+ "rtPopoverDisabled",
566
+ "rtPopoverOffsetY",
567
+ "rtPopoverOffsetX",
568
+ "rtPopoverPositions"
569
+ ],
570
+ outputs: ["rtPopoverOpened", "rtPopoverClosed"],
571
+ exportAs: ["rtPopover"]
572
+ },
573
+ {
574
+ kind: "directive",
575
+ type: BlockDirective,
576
+ selector: "[rtBlock]",
577
+ inputs: ["rtMod"]
578
+ },
579
+ {
580
+ kind: "directive",
581
+ type: ElemDirective,
582
+ selector: "[rtElem]",
583
+ inputs: ["rtMod"]
584
+ },
585
+ {
586
+ kind: "directive",
587
+ type: ModDirective,
588
+ selector: "[rtMod]"
589
+ }
590
+ ],
591
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
592
+ encapsulation: i0.ViewEncapsulation.None
593
+ });
594
+ }
595
+ };
596
+ i0.ɵɵngDeclareClassMetadata({
597
+ minVersion: "12.0.0",
598
+ version: "22.2.2",
599
+ ngImport: i0,
600
+ type: RtSelectComponent,
601
+ decorators: [{
602
+ type: Component,
603
+ args: [{
604
+ selector: "rt-select",
605
+ changeDetection: ChangeDetectionStrategy.OnPush,
606
+ encapsulation: ViewEncapsulation.None,
607
+ imports: [
608
+ FormsModule,
609
+ NgTemplateOutlet,
610
+ RtIconButtonComponent,
611
+ RtIconComponent,
612
+ RtInputComponent,
613
+ RtPopoverDirective,
614
+ BlockDirective,
615
+ ElemDirective,
616
+ ModDirective
617
+ ],
618
+ providers: [{
619
+ provide: RtFormControlBase,
620
+ useExisting: forwardRef(() => RtSelectComponent)
621
+ }],
622
+ hostDirectives: [{
623
+ directive: RtRadiusDirective,
624
+ inputs: ["radius"]
625
+ }],
626
+ host: {
627
+ class: BEM_BLOCK,
628
+ "[class.rt-select--open]": "isOpen()",
629
+ "[class.rt-select--disabled]": "isDisabled()",
630
+ "[class.rt-select--readonly]": "isReadonly()",
631
+ "[class.rt-select--invalid]": "isInvalid()",
632
+ "[class.rt-select--borderless]": "!bordered()",
633
+ "[class.rt-select--appearance--fill]": "appearance() === 'fill'",
634
+ "[class.rt-select--size--sm]": "size() === 'sm'",
635
+ "[class.rt-select--size--lg]": "size() === 'lg'",
636
+ "[class.rt-select--with-icon-left]": "!!iconLeft()"
637
+ },
638
+ template: "<ng-container rtBlock=\"rt-select\">\n @if (isReadonly()) {\n <span rtElem=\"readonly\" [rtMod]=\"{ empty: !displayText() }\">{{ displayText() || '—' }}</span>\n }\n <button\n #triggerEl\n rtElem=\"trigger\"\n qa-dataid=\"select-trigger\"\n type=\"button\"\n [rtPopoverWidth]=\"panelWidth()\"\n [rtMod]=\"{ own: !!triggerTpl() }\"\n [rtPopover]=\"panelTpl\"\n [rtPopoverDisabled]=\"isDisabled()\"\n [attr.id]=\"effectiveControlId()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n [attr.aria-controls]=\"panelId\"\n [attr.aria-activedescendant]=\"activeOptionId()\"\n [disabled]=\"isDisabled()\"\n (keydown)=\"onTriggerKeydown($event)\"\n (rtPopoverOpened)=\"onOpened()\"\n (rtPopoverClosed)=\"onClosed()\">\n <!--\n Разметка указателя: своя, если потребитель её объявил, иначе зашитая китом. Она встаёт\n внутрь кнопки, а не вместо неё: поведение — открытие панели, приметы доступности,\n отключённость, клавиши и закрытие — остаётся на кнопке кита.\n -->\n @if (triggerTpl(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: triggerState() }\" />\n } @else {\n @if (iconLeft(); as left) {\n <rt-icon rtElem=\"icon-left\" size=\"sm\" color=\"muted\" [name]=\"left\" />\n }\n <span rtElem=\"label\" [rtMod]=\"{ placeholder: !selectedLabel() }\">\n {{ selectedLabel() || placeholder() }}\n </span>\n @if (showClearButton()) {\n <rt-icon-button\n rtElem=\"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 rtElem=\"chevron\" name=\"chevron-down\" size=\"sm\" color=\"muted\" />\n }\n </button>\n\n <ng-template #panelTpl>\n <div rtElem=\"panel\" role=\"listbox\" [style.--rt-select-panel-max-height]=\"panelMaxHeight()\" [attr.aria-label]=\"ariaLabel()\">\n @if (filter()) {\n <div rtElem=\"filter\">\n <rt-input\n iconLeft=\"ico-search\"\n [placeholder]=\"filterPlaceholderText()\"\n [ngModel]=\"filterTerm()\"\n (ngModelChange)=\"setFilter($event)\" />\n </div>\n }\n <!--\n Опции listbox'а выбираются мышью через (click); keyboard-nav —\n на trigger'е (activedescendant: ArrowUp/Down/Enter), опции не\n focusable индивидуально, поэтому a11y-правила здесь не применимы.\n -->\n <!-- eslint-disable @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <ul rtElem=\"list\">\n @for (row of rows(); track row.option.value; let i = $index) {\n <li\n rtElem=\"option\"\n qa-dataid=\"select-option\"\n role=\"option\"\n [id]=\"panelId + '-opt-' + i\"\n [attr.data-value]=\"row.option.value\"\n [attr.aria-level]=\"isTree() ? row.level + 1 : null\"\n [style.--rt-select-tree-level]=\"row.level\"\n [rtMod]=\"{\n selected: row.option.value === value(),\n active: i === activeIndex(),\n disabled: !!row.option.disabled,\n }\"\n [attr.aria-selected]=\"row.option.value === value()\"\n [attr.aria-disabled]=\"!!row.option.disabled\"\n (click)=\"select(row.option)\">\n @if (isTree()) {\n @if (row.branch) {\n <button\n rtElem=\"toggle\"\n qa-dataid=\"select-option-toggle\"\n type=\"button\"\n tabindex=\"-1\"\n [attr.aria-label]=\"row.open ? t().uiCollapse : t().uiExpand\"\n [attr.aria-expanded]=\"row.open\"\n (click)=\"toggleBranch($event, row.option.value)\">\n <rt-icon size=\"sm\" color=\"muted\" [name]=\"row.open ? 'chevron-down' : 'chevron-right'\" />\n </button>\n } @else {\n <span rtElem=\"toggle-space\"></span>\n }\n }\n <span rtElem=\"option-label\">{{ row.option.label }}</span>\n @if (row.option.value === value()) {\n <rt-icon rtElem=\"check\" name=\"check\" size=\"sm\" aria-hidden=\"true\" />\n }\n </li>\n } @empty {\n <li rtElem=\"empty\">{{ t().uiNoOptions }}</li>\n }\n </ul>\n </div>\n </ng-template>\n</ng-container>\n",
639
+ styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-select{--rt-select-radius: var(--rt-input-radius);--rt-select-fill-radius: var(--rt-radius-sm);--rt-select-caret-transition-duration: var(--rt-duration-fast);--rt-select-own-outline-width: var(--rt-border-width-medium);position:relative;display:block;width:100%}.rt-select--borderless .rt-select__trigger{border-color:transparent}.rt-select--appearance--fill .rt-select__trigger{border-color:transparent;border-radius:var(--rt-select-fill-radius) var(--rt-select-fill-radius) 0 0;border-bottom-color:var(--rt-color-field-fill-underline);background-color:var(--rt-color-bg-surface-subtle-2)}.rt-select__trigger{display: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-select-radius);background-color:var(--rt-input-color-bg);color:var(--rt-input-color-text);cursor:pointer;font-family:inherit;font-size:var(--rt-input-font-size);gap:var(--rt-space-sm);line-height:var(--rt-input-line-height);text-align:start;transition:var(--rt-input-transition)}.rt-select__trigger:focus{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-select__trigger:disabled{cursor:not-allowed}.rt-select__trigger--own{width:auto;min-height:0;padding:0;border-color:transparent;background-color:transparent;line-height:var(--rt-leading-none)}.rt-select__trigger--own:focus{border-color:transparent;box-shadow:none}.rt-select__trigger--own:focus-visible{outline:var(--rt-select-own-outline-width) solid var(--rt-input-color-border-focus);outline-offset:var(--rt-input-focus-outline-offset)}.rt-select--open .rt-select__trigger{border-color:var(--rt-input-color-border-focus)}.rt-select--open .rt-select__trigger--own{border-color:transparent}.rt-select--invalid .rt-select__trigger{border-color:var(--rt-input-color-border-error)}.rt-select--invalid .rt-select__trigger:focus{box-shadow:var(--rt-input-focus-shadow-error)}.rt-select--invalid .rt-select__trigger--own{border-color:transparent}.rt-select--invalid .rt-select__trigger--own:focus{box-shadow:none}.rt-select--disabled{opacity:var(--rt-input-disabled-opacity)}.rt-select--readonly .rt-select__trigger{display:none}.rt-select__readonly{display:inline-flex;min-height:var(--rt-input-height);align-items:center;color:var(--rt-field-value-color);font-size:var(--rt-field-value-font-size)}.rt-select__readonly--empty{color:var(--rt-field-value-empty-color)}.rt-select--size--sm .rt-select__trigger{min-height:var(--rt-input-height-sm)}.rt-select--size--lg .rt-select__trigger{min-height:var(--rt-input-height-lg)}.rt-select__label{overflow:hidden;min-width:0;flex:1 1 auto;text-overflow:ellipsis;white-space:nowrap}.rt-select__label--placeholder{color:var(--rt-input-color-text-placeholder)}.rt-select__icon-left,.rt-select__clear{flex-shrink:0}.rt-select__chevron{flex-shrink:0;transition:transform var(--rt-select-caret-transition-duration) ease}.rt-select--open .rt-select__chevron{transform:rotate(180deg)}:is(.rt-preset-material,[data-preset=material]) .rt-select__chevron{max-width:10px;max-height:5px;background-color:currentcolor;clip-path:polygon(0 0,100% 0,50% 100%);transform:none}:is(.rt-preset-material,[data-preset=material]) .rt-select__chevron svg{display:none}.rt-select__panel{--rt-select-panel-shadow: var(--rt-overlay-select-shadow);--rt-select-panel-radius: var(--rt-overlay-select-radius);--rt-select-option-font-size: var(--rt-overlay-select-option-font-size);--rt-select-selected-bg: var(--rt-overlay-select-selected-bg);--rt-select-selected-weight: var(--rt-overlay-select-selected-weight);--rt-select-check-display: var(--rt-overlay-select-check-display);--rt-select-option-min-height: var(--rt-overlay-select-option-min-height);--rt-select-panel-border-width: var(--rt-overlay-select-panel-border-width);--rt-select-tree-indent: var(--rt-space-lg);--rt-select-panel-max-height: var(--rt-input-panel-max-height);width:100%;max-height:var(--rt-select-panel-max-height);box-sizing:border-box;border:var(--rt-select-panel-border-width) solid var(--rt-color-border-subtle);border-radius:var(--rt-select-panel-radius);background-color:var(--rt-color-bg-surface);box-shadow:var(--rt-select-panel-shadow);overflow-y:auto}.rt-select__filter{padding:var(--rt-space-sm);border-block-end:var(--rt-input-border-width) solid var(--rt-color-border-subtle)}.rt-select__list{padding:var(--rt-space-2xs) 0;margin:0;list-style:none}.rt-select__option{--rt-select-tree-level: 0;display:flex;min-height:var(--rt-select-option-min-height);box-sizing:border-box;align-items:center;justify-content:space-between;padding:var(--rt-space-sm) var(--rt-space-md);color:var(--rt-color-text-primary);cursor:pointer;font-size:var(--rt-select-option-font-size);gap:var(--rt-space-sm);padding-inline-start:calc(var(--rt-space-md) + var(--rt-select-tree-indent) * var(--rt-select-tree-level))}.rt-select__option:hover,.rt-select__option--active{background-color:var(--rt-color-bg-hover)}.rt-select__option--selected{background-color:var(--rt-select-selected-bg);font-weight:var(--rt-select-selected-weight)}.rt-select__option--disabled{cursor:not-allowed;opacity:var(--rt-input-disabled-opacity)}.rt-select__option--disabled:hover{background-color:transparent}.rt-select__option-label{min-width:0;flex:1 1 auto}.rt-select__toggle,.rt-select__toggle-space{display:inline-flex;flex-shrink:0;block-size:var(--rt-input-icon-size);inline-size:var(--rt-input-icon-size)}.rt-select__toggle{align-items:center;justify-content:center;padding:0;border:0;background:transparent;cursor:pointer}.rt-select__check{display:var(--rt-select-check-display);flex-shrink:0}.rt-select__empty{padding:var(--rt-space-sm) var(--rt-space-md);color:var(--rt-input-color-text-placeholder);font-style:italic}.rt-select[data-rt-radius=none]{--rt-select-radius: var(--rt-radius-none)}.rt-select[data-rt-radius=xs]{--rt-select-radius: var(--rt-radius-xs)}.rt-select[data-rt-radius=sm]{--rt-select-radius: var(--rt-radius-sm)}.rt-select[data-rt-radius=ms]{--rt-select-radius: var(--rt-radius-ms)}.rt-select[data-rt-radius=md]{--rt-select-radius: var(--rt-radius-md)}.rt-select[data-rt-radius=lg]{--rt-select-radius: var(--rt-radius-lg)}.rt-select[data-rt-radius=xl]{--rt-select-radius: var(--rt-radius-xl)}.rt-select[data-rt-radius=\"2xl\"]{--rt-select-radius: var(--rt-radius-2xl)}.rt-select[data-rt-radius=full]{--rt-select-radius: var(--rt-radius-full)}}\n"]
640
+ }]
641
+ }],
642
+ ctorParameters: () => [],
643
+ propDecorators: {
644
+ popover: [{
645
+ type: i0.ViewChild,
646
+ args: [i0.forwardRef(() => RtPopoverDirective), { isSignal: true }]
647
+ }],
648
+ triggerEl: [{
649
+ type: i0.ViewChild,
650
+ args: ["triggerEl", { isSignal: true }]
651
+ }],
652
+ triggerTpl: [{
653
+ type: i0.ContentChild,
654
+ args: [i0.forwardRef(() => RtSelectTriggerDirective), { isSignal: true }]
655
+ }],
656
+ appearance: [{
657
+ type: i0.Input,
658
+ args: [{
659
+ isSignal: true,
660
+ alias: "appearance",
661
+ required: false
662
+ }]
663
+ }],
664
+ options: [{
665
+ type: i0.Input,
666
+ args: [{
667
+ isSignal: true,
668
+ alias: "options",
669
+ required: false
670
+ }]
671
+ }],
672
+ placeholder: [{
673
+ type: i0.Input,
674
+ args: [{
675
+ isSignal: true,
676
+ alias: "placeholder",
677
+ required: false
678
+ }]
679
+ }],
680
+ iconLeft: [{
681
+ type: i0.Input,
682
+ args: [{
683
+ isSignal: true,
684
+ alias: "iconLeft",
685
+ required: false
686
+ }]
687
+ }],
688
+ filter: [{
689
+ type: i0.Input,
690
+ args: [{
691
+ isSignal: true,
692
+ alias: "filter",
693
+ required: false
694
+ }]
695
+ }],
696
+ filterPlaceholder: [{
697
+ type: i0.Input,
698
+ args: [{
699
+ isSignal: true,
700
+ alias: "filterPlaceholder",
701
+ required: false
702
+ }]
703
+ }],
704
+ panelWidth: [{
705
+ type: i0.Input,
706
+ args: [{
707
+ isSignal: true,
708
+ alias: "panelWidth",
709
+ required: false
710
+ }]
711
+ }],
712
+ panelMaxHeight: [{
713
+ type: i0.Input,
714
+ args: [{
715
+ isSignal: true,
716
+ alias: "panelMaxHeight",
717
+ required: false
718
+ }]
719
+ }],
720
+ selectionChange: [{
721
+ type: i0.Output,
722
+ args: ["selectionChange"]
723
+ }]
724
+ }
725
+ });
508
726
  export { RtSelectComponent, RtSelectTriggerDirective, rtScrollActiveOptionIntoView, rtTreeBranchState, rtTreeFind, rtTreeIsTree, rtTreeLeaves, rtTreeOpenFor, rtTreeRows, rtTreeSideKey, rtTreeToggle };
509
- //# sourceMappingURL=rt-tools-ui-kit-v2-select.mjs.map
727
+
728
+ //# sourceMappingURL=rt-tools-ui-kit-v2-select.mjs.map