@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,1636 +1,2515 @@
1
- import { Clipboard } from '@angular/cdk/clipboard';
2
- import * as i0 from '@angular/core';
3
- import { inject, DestroyRef, ElementRef, signal, computed, input, booleanAttribute, ViewEncapsulation, ChangeDetectionStrategy, Component, linkedSignal, viewChild, output, effect, untracked, TemplateRef, Directive, Pipe, Injectable, contentChild, contentChildren, numberAttribute, forwardRef, ViewChild, model } from '@angular/core';
4
- import { BlockDirective, ElemDirective, ModDirective, IDBStorageService } from '@rt-tools/core';
5
- import { rtKitLabel, ERtStorageKeys, BreakpointsService, RT_KIT_LABELS } from '@rt-tools/ui-kit-v2/core';
6
- import { RtIconButtonComponent } from '@rt-tools/ui-kit-v2/icon-button';
7
- import { RtTooltipDirective } from '@rt-tools/ui-kit-v2/tooltip';
8
- import { NgTemplateOutlet } from '@angular/common';
9
- import { EListSortOrder, EFilterOperatorType } from '@rt-tools/utils';
10
- import { RtIconComponent } from '@rt-tools/ui-kit-v2/icon';
11
- import { CdkTable, CdkColumnDef, CdkCell, CdkCellDef, CdkHeaderCell, CdkHeaderCellDef, DataRowOutlet, FooterRowOutlet, HeaderRowOutlet, NoDataRowOutlet, CDK_TABLE } from '@angular/cdk/table';
12
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
13
- import { RtEmptyStateComponent } from '@rt-tools/ui-kit-v2/empty-state';
14
- import { RtMenuItemComponent, RtMenuComponent } from '@rt-tools/ui-kit-v2/menu';
15
- import * as i1$1 from '@rt-tools/ui-kit-v2/radius';
16
- import { RtRadiusDirective } from '@rt-tools/ui-kit-v2/radius';
17
- import { RtSkeletonComponent } from '@rt-tools/ui-kit-v2/skeleton';
18
- import { RtSpinnerComponent } from '@rt-tools/ui-kit-v2/spinner';
19
- import * as i1 from '@angular/forms';
20
- import { FormControl, ReactiveFormsModule } from '@angular/forms';
21
- import { RtDatePickerComponent } from '@rt-tools/ui-kit-v2/date-picker';
22
- import { RtInputNumberComponent } from '@rt-tools/ui-kit-v2/input-number';
23
- import { RtInputComponent } from '@rt-tools/ui-kit-v2/input';
24
- import { RtPopoverDirective } from '@rt-tools/ui-kit-v2/popover';
25
- import { RtSelectComponent } from '@rt-tools/ui-kit-v2/select';
26
- import { Subject, mergeMap, EMPTY, filter, of } from 'rxjs';
27
- import { RtAsideComponent, RtAsideFooterComponent, RtAsideHeaderComponent } from '@rt-tools/ui-kit-v2/aside';
28
- import { RtButtonDirective } from '@rt-tools/ui-kit-v2/button';
29
- import { RtRouteAsideComponent, RtContainerRightSidenavPanelDirective } from '@rt-tools/ui-kit-v2/container';
30
- import { moveItemInArray, CdkDrag, CdkDragHandle, CdkDropList } from '@angular/cdk/drag-drop';
31
-
32
- const BEM_BLOCK$5 = 'rt-copy-cell';
33
- /**
34
- * Ключи подписей действия в покое и после копирования (tooltip и aria-label).
35
- *
36
- * Здесь ключи, а не готовый текст: константа вычисляется при загрузке чанка,
37
- * когда язык страницы ещё не выбран, — переводит сам компонент.
38
- */
39
- const COPY_KEY = 'uiCopy';
40
- const COPIED_KEY = 'uiCopied';
41
- /** Сколько держать состояние «скопировано» перед сбросом иконки/подписи. */
42
- const RESET_DELAY_MS = 2000;
43
- /**
44
- * Ячейка с копированием в буфер — переиспользуемый примитив для `cdkCellDef`
45
- * (и не только). rt-table projection-driven: контент ячейки пишет
46
- * потребитель, поэтому копирование оформлено отдельным cell-level компонентом,
47
- * а не флагом на конфиге колонки.
48
- *
49
- * Потребитель проецирует отображаемый контент через `<ng-content>`. Что уйдёт в
50
- * буфер:
51
- * - если задан `[value]` — ровно он (нужно когда копируемое отличается от
52
- * отображаемого: для id-ячейки показываем `#123`, копируем `123`);
53
- * - если `[value]` не задан — берётся отображаемый текст (textContent
54
- * проецируемого контента, схлопнутые пробелы) — «копировать как показано»,
55
- * удобно для составных ячеек (`#7 — Имя`).
56
- *
57
- * По умолчанию кнопка скрыта и проявляется при наведении/фокусе (для плотных
58
- * таблиц). Вне таблиц (модалки, карточки) строки для hover нет — там
59
- * `revealOnHover="false"` держит кнопку всегда видимой. Палитра кнопки —
60
- * через `variant` (по умолчанию `ghost`). После клика на `RESET_DELAY_MS`
61
- * иконка меняется `copy`→`check`, подпись — на «Скопировано».
62
- */
63
- class RtCopyCellComponent {
64
- #clipboard;
65
- #destroyRef;
66
- #host;
67
- #resetTimer;
68
- #copyLabel;
69
- #copiedLabel;
70
- constructor() {
71
- this.#clipboard = inject(Clipboard);
72
- this.#destroyRef = inject(DestroyRef);
73
- this.#host = inject(ElementRef);
74
- this.#resetTimer = null;
75
- this.#copyLabel = rtKitLabel(COPY_KEY);
76
- this.#copiedLabel = rtKitLabel(COPIED_KEY);
77
- this.copied = signal(false, /* @ts-ignore */
78
- ...(ngDevMode ? [{ debugName: "copied" }] : /* istanbul ignore next */ []));
79
- /**
80
- * Подсказка со значением целиком — только у обрезанного.
81
- *
82
- * У помещающегося она повторяла бы то, что человек и так читает, и всплывала бы над каждой
83
- * ячейкой таблицы; пустая строка директиву подсказки выключает.
84
- */
85
- this.hint = signal('', /* @ts-ignore */
86
- ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
87
- this.iconName = computed(() => (this.copied() ? 'check' : 'copy'), /* @ts-ignore */
88
- ...(ngDevMode ? [{ debugName: "iconName" }] : /* istanbul ignore next */ []));
89
- this.actionLabel = computed(() => (this.copied() ? this.#copiedLabel() : this.#copyLabel()), /* @ts-ignore */
90
- ...(ngDevMode ? [{ debugName: "actionLabel" }] : /* istanbul ignore next */ []));
91
- /**
92
- * Строка для буфера. Если не задана — копируется отображаемый текст
93
- * (textContent проецируемого контента). Число приводится к строке.
94
- */
95
- this.value = input(null, /* @ts-ignore */
96
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
97
- /** Палитра кнопки копирования. В таблицах — `ghost`; вне таблиц удобнее `secondary`. */
98
- this.variant = input('ghost', /* @ts-ignore */
99
- ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
100
- /**
101
- * Прятать кнопку до наведения/фокуса (поведение плотных таблиц). `false` —
102
- * кнопка всегда видима: нужно вне таблиц (модалки/карточки), где нет строки
103
- * для hover.
104
- */
105
- this.revealOnHover = input(true, { ...(ngDevMode ? { debugName: "revealOnHover" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
106
- this.#destroyRef.onDestroy(() => this.#clearTimer());
107
- }
108
- /**
109
- * Замер обрезки в момент наведения.
110
- *
111
- * Ширина известна только отрисованному узлу, а меняется она и от переезда столбца, и от
112
- * ширины окна: посчитанная один раз при заведении, она соврала бы при первом же изменении.
113
- */
114
- measureTruncation() {
115
- const content = this.#host.nativeElement.querySelector(`.${BEM_BLOCK$5}__content`);
116
- const truncated = content !== null && content.scrollWidth > content.clientWidth;
117
- this.hint.set(truncated ? this.#displayedText() : '');
118
- }
119
- onCopy(event) {
120
- // Гасим всплытие, чтобы клик/Enter по кнопке не активировал кликабельную
121
- // строку (rtTableRow) и не дошёл до прочих row-level слушателей.
122
- event.stopPropagation();
123
- this.#clipboard.copy(this.#resolveText());
124
- this.copied.set(true);
125
- this.#clearTimer();
126
- this.#resetTimer = setTimeout(() => this.copied.set(false), RESET_DELAY_MS);
127
- }
128
- /** Явный `value` приоритетнее; иначе — отображаемый текст со схлопнутыми пробелами. */
129
- #resolveText() {
130
- const explicit = this.value();
131
- if (explicit !== null) {
132
- return String(explicit);
133
- }
134
- return this.#displayedText();
135
- }
136
- /** Отображаемый текст со схлопнутыми пробелами: он же уходит в подсказку обрезанного. */
137
- #displayedText() {
138
- const content = this.#host.nativeElement.querySelector(`.${BEM_BLOCK$5}__content`);
139
- return (content?.textContent ?? '').replace(/\s+/g, ' ').trim();
140
- }
141
- #clearTimer() {
142
- if (this.#resetTimer !== null) {
143
- clearTimeout(this.#resetTimer);
144
- this.#resetTimer = null;
145
- }
146
- }
147
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtCopyCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
148
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: RtCopyCellComponent, isStandalone: true, selector: "rt-copy-cell", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, revealOnHover: { classPropertyName: "revealOnHover", publicName: "revealOnHover", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mouseenter": "measureTruncation()", "focusin": "measureTruncation()" }, properties: { "class.rt-copy-cell--static": "!revealOnHover()" }, classAttribute: "rt-copy-cell" }, ngImport: i0, template: "<ng-container rtBlock=\"rt-copy-cell\">\n <span rtElem=\"content\" qa-dataid=\"copy-cell-content\" [rtTooltip]=\"hint()\"><ng-content /></span>\n <rt-icon-button\n rtElem=\"button\"\n qa-dataid=\"copy-cell-button\"\n size=\"sm\"\n [icon]=\"iconName()\"\n [variant]=\"variant()\"\n [ariaLabel]=\"actionLabel()\"\n [tooltip]=\"actionLabel()\"\n (clicked)=\"onCopy($event)\" />\n</ng-container>\n", styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-copy-cell{--rt-copy-cell-transition-duration: var(--rt-duration-fast);display:inline-flex;min-width:0;align-items:center;gap:var(--rt-space-xs)}.rt-copy-cell__content{overflow:hidden;min-width:0;text-overflow:ellipsis;white-space:nowrap}.rt-copy-cell__button{flex:0 0 auto;opacity:0;transition:opacity var(--rt-copy-cell-transition-duration) ease}.rt-copy-cell:hover .rt-copy-cell__button,.rt-copy-cell:focus-within .rt-copy-cell__button{opacity:1}.rt-copy-cell--static .rt-copy-cell__button{opacity:1}.rt-table tbody tr:hover .rt-copy-cell__button,.rt-table tbody tr:focus-within .rt-copy-cell__button{opacity:1}}\n"], dependencies: [{ kind: "component", type:
149
- // standalone components / directives
150
- RtIconButtonComponent, selector: "rt-icon-button", inputs: ["icon", "glyph", "ariaLabel", "variant", "iconColor", "iconFill", "size", "iconSize", "type", "tooltip", "tabIndex", "loading", "disabled", "active", "indicator"], outputs: ["clicked"] }, { kind: "directive", type: BlockDirective, selector: "[rtBlock]", inputs: ["rtMod"] }, { kind: "directive", type: ElemDirective, selector: "[rtElem]", inputs: ["rtMod"] }, { kind: "directive", type: RtTooltipDirective, selector: "[rtTooltip]", inputs: ["rtTooltip", "rtTooltipPlacement", "rtTooltipWhenTruncated"], exportAs: ["rtTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
151
- }
152
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtCopyCellComponent, decorators: [{
153
- type: Component,
154
- args: [{ selector: 'rt-copy-cell', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
155
- // standalone components / directives
156
- RtIconButtonComponent,
157
- BlockDirective,
158
- ElemDirective,
159
- RtTooltipDirective,
160
- ], host: {
161
- class: BEM_BLOCK$5,
162
- '[class.rt-copy-cell--static]': '!revealOnHover()',
163
- '(mouseenter)': 'measureTruncation()',
164
- '(focusin)': 'measureTruncation()',
165
- }, template: "<ng-container rtBlock=\"rt-copy-cell\">\n <span rtElem=\"content\" qa-dataid=\"copy-cell-content\" [rtTooltip]=\"hint()\"><ng-content /></span>\n <rt-icon-button\n rtElem=\"button\"\n qa-dataid=\"copy-cell-button\"\n size=\"sm\"\n [icon]=\"iconName()\"\n [variant]=\"variant()\"\n [ariaLabel]=\"actionLabel()\"\n [tooltip]=\"actionLabel()\"\n (clicked)=\"onCopy($event)\" />\n</ng-container>\n", styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-copy-cell{--rt-copy-cell-transition-duration: var(--rt-duration-fast);display:inline-flex;min-width:0;align-items:center;gap:var(--rt-space-xs)}.rt-copy-cell__content{overflow:hidden;min-width:0;text-overflow:ellipsis;white-space:nowrap}.rt-copy-cell__button{flex:0 0 auto;opacity:0;transition:opacity var(--rt-copy-cell-transition-duration) ease}.rt-copy-cell:hover .rt-copy-cell__button,.rt-copy-cell:focus-within .rt-copy-cell__button{opacity:1}.rt-copy-cell--static .rt-copy-cell__button{opacity:1}.rt-table tbody tr:hover .rt-copy-cell__button,.rt-table tbody tr:focus-within .rt-copy-cell__button{opacity:1}}\n"] }]
166
- }], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], revealOnHover: [{ type: i0.Input, args: [{ isSignal: true, alias: "revealOnHover", required: false }] }] } });
167
-
168
- /**
169
- * Следующее состояние сортировки при нажатии на заголовок колонки.
170
- *
171
- * Порядок кругов: по возрастанию → по убыванию → без сортировки. Третье состояние
172
- * нужно, чтобы пользователь мог вернуть исходный порядок, не перезагружая список.
173
- */
1
+ import { Clipboard } from "@angular/cdk/clipboard";
2
+ import * as i0 from "@angular/core";
3
+ import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, Injectable, Pipe, TemplateRef, ViewChild, ViewEncapsulation, booleanAttribute, computed, contentChild, contentChildren, effect, forwardRef, inject, input, linkedSignal, model, numberAttribute, output, signal, untracked, viewChild } from "@angular/core";
4
+ import { BlockDirective, ElemDirective, IDBStorageService, ModDirective } from "@rt-tools/core";
5
+ import { BreakpointsService, ERtStorageKeys, RT_KIT_LABELS, rtKitLabel } from "@rt-tools/ui-kit-v2/core";
6
+ import { RtIconButtonComponent } from "@rt-tools/ui-kit-v2/icon-button";
7
+ import { RtTooltipDirective } from "@rt-tools/ui-kit-v2/tooltip";
8
+ import { NgTemplateOutlet } from "@angular/common";
9
+ import { EFilterOperatorType, EListSortOrder } from "@rt-tools/utils";
10
+ import { RtIconComponent } from "@rt-tools/ui-kit-v2/icon";
11
+ import { CDK_TABLE, CdkCell, CdkCellDef, CdkColumnDef, CdkHeaderCell, CdkHeaderCellDef, CdkTable, DataRowOutlet, FooterRowOutlet, HeaderRowOutlet, NoDataRowOutlet } from "@angular/cdk/table";
12
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
13
+ import { RtEmptyStateComponent } from "@rt-tools/ui-kit-v2/empty-state";
14
+ import { RtMenuComponent, RtMenuItemComponent } from "@rt-tools/ui-kit-v2/menu";
15
+ import * as i1 from "@rt-tools/ui-kit-v2/radius";
16
+ import { RtRadiusDirective } from "@rt-tools/ui-kit-v2/radius";
17
+ import { RtSkeletonComponent } from "@rt-tools/ui-kit-v2/skeleton";
18
+ import { RtSpinnerComponent } from "@rt-tools/ui-kit-v2/spinner";
19
+ import * as i1$1 from "@angular/forms";
20
+ import { FormControl, ReactiveFormsModule } from "@angular/forms";
21
+ import { RtDatePickerComponent } from "@rt-tools/ui-kit-v2/date-picker";
22
+ import { RtInputNumberComponent } from "@rt-tools/ui-kit-v2/input-number";
23
+ import { RtInputComponent } from "@rt-tools/ui-kit-v2/input";
24
+ import { RtPopoverDirective } from "@rt-tools/ui-kit-v2/popover";
25
+ import { RtSelectComponent } from "@rt-tools/ui-kit-v2/select";
26
+ import { EMPTY, Subject, filter, mergeMap, of } from "rxjs";
27
+ import { RtAsideComponent, RtAsideFooterComponent, RtAsideHeaderComponent } from "@rt-tools/ui-kit-v2/aside";
28
+ import { RtButtonDirective } from "@rt-tools/ui-kit-v2/button";
29
+ import { RtContainerRightSidenavPanelDirective, RtRouteAsideComponent } from "@rt-tools/ui-kit-v2/container";
30
+ import { CdkDrag, CdkDragHandle, CdkDropList, moveItemInArray } from "@angular/cdk/drag-drop";
31
+ const BEM_BLOCK$5 = "rt-copy-cell";
32
+ const COPY_KEY = "uiCopy";
33
+ const COPIED_KEY = "uiCopied";
34
+ const RESET_DELAY_MS = 2e3;
35
+ var RtCopyCellComponent = class RtCopyCellComponent {
36
+ #clipboard;
37
+ #destroyRef;
38
+ #host;
39
+ #resetTimer;
40
+ #copyLabel;
41
+ #copiedLabel;
42
+ constructor() {
43
+ this.#clipboard = inject(Clipboard);
44
+ this.#destroyRef = inject(DestroyRef);
45
+ this.#host = inject(ElementRef);
46
+ this.#resetTimer = null;
47
+ this.#copyLabel = rtKitLabel(COPY_KEY);
48
+ this.#copiedLabel = rtKitLabel(COPIED_KEY);
49
+ this.copied = signal(false, ...ngDevMode ? [{ debugName: "copied" }] : /* istanbul ignore next */ []);
50
+ this.hint = signal("", ...ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []);
51
+ this.iconName = computed(() => this.copied() ? "check" : "copy", ...ngDevMode ? [{ debugName: "iconName" }] : /* istanbul ignore next */ []);
52
+ this.actionLabel = computed(() => this.copied() ? this.#copiedLabel() : this.#copyLabel(), ...ngDevMode ? [{ debugName: "actionLabel" }] : /* istanbul ignore next */ []);
53
+ this.value = input(null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
54
+ this.variant = input("ghost", ...ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []);
55
+ this.revealOnHover = input(true, {
56
+ ...ngDevMode ? { debugName: "revealOnHover" } : /* istanbul ignore next */ {},
57
+ transform: booleanAttribute
58
+ });
59
+ this.#destroyRef.onDestroy(() => this.#clearTimer());
60
+ }
61
+ measureTruncation() {
62
+ const content = this.#host.nativeElement.querySelector(`.${BEM_BLOCK$5}__content`);
63
+ const truncated = content !== null && content.scrollWidth > content.clientWidth;
64
+ this.hint.set(truncated ? this.#displayedText() : "");
65
+ }
66
+ onCopy(event) {
67
+ event.stopPropagation();
68
+ this.#clipboard.copy(this.#resolveText());
69
+ this.copied.set(true);
70
+ this.#clearTimer();
71
+ this.#resetTimer = setTimeout(() => this.copied.set(false), RESET_DELAY_MS);
72
+ }
73
+ #resolveText() {
74
+ const explicit = this.value();
75
+ if (explicit !== null) return String(explicit);
76
+ return this.#displayedText();
77
+ }
78
+ #displayedText() {
79
+ return (this.#host.nativeElement.querySelector(`.${BEM_BLOCK$5}__content`)?.textContent ?? "").replace(/\s+/g, " ").trim();
80
+ }
81
+ #clearTimer() {
82
+ if (this.#resetTimer !== null) {
83
+ clearTimeout(this.#resetTimer);
84
+ this.#resetTimer = null;
85
+ }
86
+ }
87
+ static {
88
+ this.ɵfac = i0.ɵɵngDeclareFactory({
89
+ minVersion: "12.0.0",
90
+ version: "22.2.2",
91
+ ngImport: i0,
92
+ type: RtCopyCellComponent,
93
+ deps: [],
94
+ target: i0.ɵɵFactoryTarget.Component
95
+ });
96
+ }
97
+ static {
98
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
99
+ minVersion: "17.1.0",
100
+ version: "22.2.2",
101
+ type: RtCopyCellComponent,
102
+ isStandalone: true,
103
+ selector: "rt-copy-cell",
104
+ inputs: {
105
+ value: {
106
+ classPropertyName: "value",
107
+ publicName: "value",
108
+ isSignal: true,
109
+ isRequired: false,
110
+ transformFunction: null
111
+ },
112
+ variant: {
113
+ classPropertyName: "variant",
114
+ publicName: "variant",
115
+ isSignal: true,
116
+ isRequired: false,
117
+ transformFunction: null
118
+ },
119
+ revealOnHover: {
120
+ classPropertyName: "revealOnHover",
121
+ publicName: "revealOnHover",
122
+ isSignal: true,
123
+ isRequired: false,
124
+ transformFunction: null
125
+ }
126
+ },
127
+ host: {
128
+ listeners: {
129
+ "mouseenter": "measureTruncation()",
130
+ "focusin": "measureTruncation()"
131
+ },
132
+ properties: { "class.rt-copy-cell--static": "!revealOnHover()" },
133
+ classAttribute: "rt-copy-cell"
134
+ },
135
+ ngImport: i0,
136
+ template: "<ng-container rtBlock=\"rt-copy-cell\">\n <span rtElem=\"content\" qa-dataid=\"copy-cell-content\" [rtTooltip]=\"hint()\"><ng-content /></span>\n <rt-icon-button\n rtElem=\"button\"\n qa-dataid=\"copy-cell-button\"\n size=\"sm\"\n [icon]=\"iconName()\"\n [variant]=\"variant()\"\n [ariaLabel]=\"actionLabel()\"\n [tooltip]=\"actionLabel()\"\n (clicked)=\"onCopy($event)\" />\n</ng-container>\n",
137
+ styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-copy-cell{--rt-copy-cell-transition-duration: var(--rt-duration-fast);display:inline-flex;min-width:0;align-items:center;gap:var(--rt-space-xs)}.rt-copy-cell__content{overflow:hidden;min-width:0;text-overflow:ellipsis;white-space:nowrap}.rt-copy-cell__button{flex:0 0 auto;opacity:0;transition:opacity var(--rt-copy-cell-transition-duration) ease}.rt-copy-cell:hover .rt-copy-cell__button,.rt-copy-cell:focus-within .rt-copy-cell__button{opacity:1}.rt-copy-cell--static .rt-copy-cell__button{opacity:1}.rt-table tbody tr:hover .rt-copy-cell__button,.rt-table tbody tr:focus-within .rt-copy-cell__button{opacity:1}}\n"],
138
+ dependencies: [
139
+ {
140
+ kind: "component",
141
+ type: RtIconButtonComponent,
142
+ selector: "rt-icon-button",
143
+ inputs: [
144
+ "icon",
145
+ "glyph",
146
+ "ariaLabel",
147
+ "variant",
148
+ "iconColor",
149
+ "iconFill",
150
+ "size",
151
+ "iconSize",
152
+ "type",
153
+ "tooltip",
154
+ "tooltipHideOnClick",
155
+ "tabIndex",
156
+ "loading",
157
+ "disabled",
158
+ "active",
159
+ "expanded",
160
+ "indicator"
161
+ ],
162
+ outputs: ["clicked"]
163
+ },
164
+ {
165
+ kind: "directive",
166
+ type: BlockDirective,
167
+ selector: "[rtBlock]",
168
+ inputs: ["rtMod"]
169
+ },
170
+ {
171
+ kind: "directive",
172
+ type: ElemDirective,
173
+ selector: "[rtElem]",
174
+ inputs: ["rtMod"]
175
+ },
176
+ {
177
+ kind: "directive",
178
+ type: RtTooltipDirective,
179
+ selector: "[rtTooltip]",
180
+ inputs: [
181
+ "rtTooltip",
182
+ "rtTooltipPlacement",
183
+ "rtTooltipWhenTruncated",
184
+ "rtTooltipHideOnClick"
185
+ ],
186
+ exportAs: ["rtTooltip"]
187
+ }
188
+ ],
189
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
190
+ encapsulation: i0.ViewEncapsulation.None
191
+ });
192
+ }
193
+ };
194
+ i0.ɵɵngDeclareClassMetadata({
195
+ minVersion: "12.0.0",
196
+ version: "22.2.2",
197
+ ngImport: i0,
198
+ type: RtCopyCellComponent,
199
+ decorators: [{
200
+ type: Component,
201
+ args: [{
202
+ selector: "rt-copy-cell",
203
+ changeDetection: ChangeDetectionStrategy.OnPush,
204
+ encapsulation: ViewEncapsulation.None,
205
+ imports: [
206
+ RtIconButtonComponent,
207
+ BlockDirective,
208
+ ElemDirective,
209
+ RtTooltipDirective
210
+ ],
211
+ host: {
212
+ class: BEM_BLOCK$5,
213
+ "[class.rt-copy-cell--static]": "!revealOnHover()",
214
+ "(mouseenter)": "measureTruncation()",
215
+ "(focusin)": "measureTruncation()"
216
+ },
217
+ template: "<ng-container rtBlock=\"rt-copy-cell\">\n <span rtElem=\"content\" qa-dataid=\"copy-cell-content\" [rtTooltip]=\"hint()\"><ng-content /></span>\n <rt-icon-button\n rtElem=\"button\"\n qa-dataid=\"copy-cell-button\"\n size=\"sm\"\n [icon]=\"iconName()\"\n [variant]=\"variant()\"\n [ariaLabel]=\"actionLabel()\"\n [tooltip]=\"actionLabel()\"\n (clicked)=\"onCopy($event)\" />\n</ng-container>\n",
218
+ styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-copy-cell{--rt-copy-cell-transition-duration: var(--rt-duration-fast);display:inline-flex;min-width:0;align-items:center;gap:var(--rt-space-xs)}.rt-copy-cell__content{overflow:hidden;min-width:0;text-overflow:ellipsis;white-space:nowrap}.rt-copy-cell__button{flex:0 0 auto;opacity:0;transition:opacity var(--rt-copy-cell-transition-duration) ease}.rt-copy-cell:hover .rt-copy-cell__button,.rt-copy-cell:focus-within .rt-copy-cell__button{opacity:1}.rt-copy-cell--static .rt-copy-cell__button{opacity:1}.rt-table tbody tr:hover .rt-copy-cell__button,.rt-table tbody tr:focus-within .rt-copy-cell__button{opacity:1}}\n"]
219
+ }]
220
+ }],
221
+ ctorParameters: () => [],
222
+ propDecorators: {
223
+ value: [{
224
+ type: i0.Input,
225
+ args: [{
226
+ isSignal: true,
227
+ alias: "value",
228
+ required: false
229
+ }]
230
+ }],
231
+ variant: [{
232
+ type: i0.Input,
233
+ args: [{
234
+ isSignal: true,
235
+ alias: "variant",
236
+ required: false
237
+ }]
238
+ }],
239
+ revealOnHover: [{
240
+ type: i0.Input,
241
+ args: [{
242
+ isSignal: true,
243
+ alias: "revealOnHover",
244
+ required: false
245
+ }]
246
+ }]
247
+ }
248
+ });
174
249
  function nextSort(current, propertyName) {
175
- if (current === null || current.propertyName !== propertyName) {
176
- return { propertyName, sortDirection: EListSortOrder.ASC };
177
- }
178
- if (current.sortDirection === EListSortOrder.ASC) {
179
- return { propertyName, sortDirection: EListSortOrder.DESC };
180
- }
181
- return null;
250
+ if (current === null || current.propertyName !== propertyName) return {
251
+ propertyName,
252
+ sortDirection: EListSortOrder.ASC
253
+ };
254
+ if (current.sortDirection === EListSortOrder.ASC) return {
255
+ propertyName,
256
+ sortDirection: EListSortOrder.DESC
257
+ };
258
+ return null;
182
259
  }
183
- /** Направление сортировки по этой колонке либо `null`, когда сортирует другая. */
184
260
  function sortDirectionOf(current, propertyName) {
185
- return current !== null && current.propertyName === propertyName ? current.sortDirection : null;
261
+ return current !== null && current.propertyName === propertyName ? current.sortDirection : null;
186
262
  }
187
- /** Значение `aria-sort` заголовка: направление читается скринридером с самой колонки. */
188
263
  function ariaSortOf(current, propertyName) {
189
- const direction = sortDirectionOf(current, propertyName);
190
- if (direction === null) {
191
- return 'none';
192
- }
193
- return direction === EListSortOrder.ASC ? 'ascending' : 'descending';
264
+ const direction = sortDirectionOf(current, propertyName);
265
+ if (direction === null) return "none";
266
+ return direction === EListSortOrder.ASC ? "ascending" : "descending";
194
267
  }
195
- /**
196
- * Сортируется ли колонка. Колонка, описанная в `columnsConfig`, сортируется только
197
- * по своему признаку; колонки, которой в конфиге нет, метаданных взять неоткуда —
198
- * объявлением служит сам заголовок.
199
- */
200
268
  function isColumnSortable(config, key) {
201
- const column = config.find((candidate) => candidate.key === key);
202
- return column === undefined ? true : column.sortable === true;
269
+ const column = config.find((candidate) => candidate.key === key);
270
+ return column === void 0 ? true : column.sortable === true;
203
271
  }
204
-
205
- /** Имя внутренней «…»-колонки действий, добавляемой при `[showRowActions]`. */
206
- const RT_TABLE_ROW_ACTIONS_COLUMN = 'rtRowActions';
207
- /**
208
- * Колонки конфига без применённых настроек пользователя — источник для кнопки
209
- * «Сбросить» в панели. Закрытая колонка видима всегда: скрыть её панель не даёт.
210
- */
272
+ const RT_TABLE_ROW_ACTIONS_COLUMN = "rtRowActions";
211
273
  function defaultColumnItems(config) {
212
- return config.map((column) => ({
213
- ...column,
214
- hidden: column.locked === true ? false : column.hidden === true,
215
- }));
274
+ return config.map((column) => ({
275
+ ...column,
276
+ hidden: column.locked === true ? false : column.hidden === true
277
+ }));
216
278
  }
217
- /**
218
- * Разрешённые колонки настраиваемой таблицы: конфиг в применённом порядке с текущим
219
- * признаком скрытия.
220
- *
221
- * Порядок берётся из сохранённых настроек, а колонки, появившиеся в конфиге после
222
- * сохранения, встают в конец: настройки, снятые с прежнего состава, иначе прятали бы
223
- * новую колонку молча. Настроек нет — порядок и скрытие берутся из самого конфига.
224
- */
225
279
  function resolveColumns(config, settings) {
226
- if (config.length === 0) {
227
- return [];
228
- }
229
- const byKey = new Map(config.map((column) => [column.key, column]));
230
- const orderedKeys = settings
231
- ? [
232
- ...settings.order.filter((key) => byKey.has(key)),
233
- ...config
234
- .filter((column) => !settings.order.includes(column.key))
235
- .map((column) => column.key),
236
- ]
237
- : config.map((column) => column.key);
238
- const hiddenKeys = new Set(settings
239
- ? settings.hidden
240
- : config
241
- .filter((column) => column.hidden === true)
242
- .map((column) => column.key));
243
- return orderedKeys
244
- .map((key) => byKey.get(key))
245
- .filter((column) => column !== undefined)
246
- .map((column) => ({
247
- ...column,
248
- hidden: column.locked === true ? false : hiddenKeys.has(column.key),
249
- }));
280
+ if (config.length === 0) return [];
281
+ const byKey = new Map(config.map((column) => [column.key, column]));
282
+ const orderedKeys = settings ? [...settings.order.filter((key) => byKey.has(key)), ...config.filter((column) => !settings.order.includes(column.key)).map((column) => column.key)] : config.map((column) => column.key);
283
+ const hiddenKeys = new Set(settings ? settings.hidden : config.filter((column) => column.hidden === true).map((column) => column.key));
284
+ return orderedKeys.map((key) => byKey.get(key)).filter((column) => column !== void 0).map((column) => ({
285
+ ...column,
286
+ hidden: column.locked === true ? false : hiddenKeys.has(column.key)
287
+ }));
250
288
  }
251
- /**
252
- * Имена колонок для строк CDK: у настраиваемой таблицы — видимые в применённом порядке,
253
- * у остальных — то, что назвал вход `[columns]`. Колонка действий встаёт последней, когда
254
- * действия строки включены.
255
- */
256
289
  function displayedColumnKeys(resolved, legacyColumns, configurable, showRowActions) {
257
- const base = configurable
258
- ? resolved
259
- .filter((column) => !column.hidden)
260
- .map((column) => column.key)
261
- : [...legacyColumns];
262
- return showRowActions ? [...base, RT_TABLE_ROW_ACTIONS_COLUMN] : [...base];
290
+ const base = configurable ? resolved.filter((column) => !column.hidden).map((column) => column.key) : [...legacyColumns];
291
+ return showRowActions ? [...base, RT_TABLE_ROW_ACTIONS_COLUMN] : [...base];
263
292
  }
264
- /**
265
- * Настройки панели, приведённые к конфигу: ключи закрытых колонок из списка скрытых
266
- * вычищаются. Панель их не предлагает, но настройки приезжают и из хранилища — снятые с
267
- * той поры, когда колонка закрытой ещё не была.
268
- */
269
293
  function withoutLockedHidden(config, settings) {
270
- const lockedKeys = new Set(config
271
- .filter((column) => column.locked === true)
272
- .map((column) => column.key));
273
- return {
274
- order: [...settings.order],
275
- hidden: settings.hidden.filter((key) => !lockedKeys.has(key)),
276
- };
294
+ const lockedKeys = new Set(config.filter((column) => column.locked === true).map((column) => column.key));
295
+ return {
296
+ order: [...settings.order],
297
+ hidden: settings.hidden.filter((key) => !lockedKeys.has(key))
298
+ };
277
299
  }
278
-
279
- /**
280
- * Значение в том виде, в каком оно хранится: дата — строкой.
281
- *
282
- * `Date` не равен строке никогда, и без приведения повторный выбор той же даты каждый раз
283
- * считался бы новым значением — а тогда статья «повтор того же значения не сообщает ничего»
284
- * не держалась бы именно там, где её проще всего нарушить.
285
- */
286
300
  function filterValueOf(value) {
287
- return value instanceof Date ? value.toISOString() : (value ?? '');
301
+ return value instanceof Date ? value.toISOString() : value ?? "";
288
302
  }
289
- /** Условие по этой колонке из набора либо `null`, когда колонка ничего не отбирает. */
290
303
  function filterOf(filters, propertyName) {
291
- return filters.find((filter) => filter.propertyName === propertyName) ?? null;
304
+ return filters.find((filter) => filter.propertyName === propertyName) ?? null;
292
305
  }
293
- /**
294
- * Набор условий после перемены значения по одной колонке.
295
- *
296
- * Пустое значение снимает колонку с отбора, а не уходит пустым условием: условие без значения
297
- * просит потребителя ответить «подходит всё», и потребитель, прочитавший его буквально, не
298
- * вернёт ни одной строки.
299
- *
300
- * Возвращает прежний набор тем же объектом, когда менять нечего: по этому признаку ячейка и
301
- * решает, сообщать ли наружу.
302
- */
303
306
  function filtersWithValue(filters, propertyName, operatorType, value) {
304
- const current = filterOf(filters, propertyName);
305
- if (value === '') {
306
- return current === null ? filters : filters.filter((filter) => filter !== current);
307
- }
308
- if (current === null) {
309
- return [...filters, { propertyName, operatorType, value }];
310
- }
311
- if (current.value === value) {
312
- return filters;
313
- }
314
- return filters.map((filter) => (filter === current ? { ...filter, value } : filter));
307
+ const current = filterOf(filters, propertyName);
308
+ if (value === "") return current === null ? filters : filters.filter((filter) => filter !== current);
309
+ if (current === null) return [...filters, {
310
+ propertyName,
311
+ operatorType,
312
+ value
313
+ }];
314
+ if (current.value === value) return filters;
315
+ return filters.map((filter) => filter === current ? {
316
+ ...filter,
317
+ value
318
+ } : filter);
315
319
  }
316
- /**
317
- * Набор условий после перемены вида сравнения по одной колонке.
318
- *
319
- * Пока значения нет, менять вид сравнения не у чего: отбирать нечего, и набор условий не
320
- * изменился — значит, наружу ничего не уходит.
321
- */
322
320
  function filtersWithOperator(filters, propertyName, operatorType) {
323
- const current = filterOf(filters, propertyName);
324
- if (current === null || current.operatorType === operatorType) {
325
- return filters;
326
- }
327
- return filters.map((filter) => (filter === current ? { ...filter, operatorType } : filter));
321
+ const current = filterOf(filters, propertyName);
322
+ if (current === null || current.operatorType === operatorType) return filters;
323
+ return filters.map((filter) => filter === current ? {
324
+ ...filter,
325
+ operatorType
326
+ } : filter);
328
327
  }
329
- /** Вид сравнения, с которого колонка начинает: свой, первый разрешённый либо равенство. */
330
328
  function startOperatorOf(allowed, start) {
331
- if (start !== undefined) {
332
- return start;
333
- }
334
- return allowed !== undefined && allowed.length > 0 ? allowed[0] : EFilterOperatorType.EQUALS;
329
+ if (start !== void 0) return start;
330
+ return allowed !== void 0 && allowed.length > 0 ? allowed[0] : EFilterOperatorType.EQUALS;
335
331
  }
336
- /**
337
- * Ячейки строки отбора: по ячейке на каждую показанную колонку, в том же порядке.
338
- *
339
- * У колонки без объявленного отбора ячейка пустая, и место своё она держит: убрать её значило бы
340
- * сдвинуть все следующие ячейки на одну колонку влево — поле города встало бы под шапкой цены.
341
- * Колонка действий строки приходит сюда тем же путём, последней, и отбора у неё нет никогда; её
342
- * ячейка помечена, чтобы строка отбора не дала ширины колонке, которая места не занимает.
343
- */
344
332
  function filterCellsOf(columns, config) {
345
- return columns.map((key) => {
346
- const column = config.find((item) => item.key === key);
347
- return { key, filter: column?.filter ?? null, actions: key === RT_TABLE_ROW_ACTIONS_COLUMN };
348
- });
333
+ return columns.map((key) => {
334
+ return {
335
+ key,
336
+ filter: config.find((item) => item.key === key)?.filter ?? null,
337
+ actions: key === RT_TABLE_ROW_ACTIONS_COLUMN
338
+ };
339
+ });
349
340
  }
350
-
351
- const BEM_BLOCK$4 = 'rt-table-filter-header';
352
- /** Ключ подписи для каждого вида сравнения: имена операторов даёт словарь кита, а не шаблон. */
341
+ const BEM_BLOCK$4 = "rt-table-filter-header";
353
342
  const OPERATOR_LABELS = Object.freeze({
354
- [EFilterOperatorType.EQUALS]: 'uiFilterEquals',
355
- [EFilterOperatorType.NOT_EQUALS]: 'uiFilterNotEquals',
356
- [EFilterOperatorType.CONTAINS]: 'uiFilterContains',
357
- [EFilterOperatorType.STARTS_WITH]: 'uiFilterStartsWith',
358
- [EFilterOperatorType.ENDS_WITH]: 'uiFilterEndsWith',
359
- [EFilterOperatorType.GREATER_THAN]: 'uiFilterGreaterThan',
360
- [EFilterOperatorType.LESS_THAN]: 'uiFilterLessThan',
343
+ [EFilterOperatorType.EQUALS]: "uiFilterEquals",
344
+ [EFilterOperatorType.NOT_EQUALS]: "uiFilterNotEquals",
345
+ [EFilterOperatorType.CONTAINS]: "uiFilterContains",
346
+ [EFilterOperatorType.STARTS_WITH]: "uiFilterStartsWith",
347
+ [EFilterOperatorType.ENDS_WITH]: "uiFilterEndsWith",
348
+ [EFilterOperatorType.GREATER_THAN]: "uiFilterGreaterThan",
349
+ [EFilterOperatorType.LESS_THAN]: "uiFilterLessThan"
361
350
  });
362
- /**
363
- * Виды, у которых недописанного состояния нет вовсе: выбор и дата готовы в ту же минуту, что и
364
- * сделаны, и ждать ухода из поля значило бы задержать ответ на ровном месте. Текст и число ждут:
365
- * набор условий, уходящий на каждый знак, спрашивает сервер по букве.
366
- */
367
- const INSTANT_KINDS = new Set(['select', 'date']);
368
- /** Одно и то же условие: колонка, вид сравнения и значение совпадают. */
351
+ const INSTANT_KINDS = /* @__PURE__ */ new Set(["select", "date"]);
369
352
  function sameFilter(a, b) {
370
- if (a === null || b === null) {
371
- return a === b;
372
- }
373
- return a.propertyName === b.propertyName && a.operatorType === b.operatorType && a.value === b.value;
353
+ if (a === null || b === null) return a === b;
354
+ return a.propertyName === b.propertyName && a.operatorType === b.operatorType && a.value === b.value;
374
355
  }
375
- /** Виды сравнения по порядку: колонка разрешает своё подмножество, порядок берётся отсюда. */
376
356
  const ALL_OPERATORS = Object.freeze([
377
- EFilterOperatorType.EQUALS,
378
- EFilterOperatorType.NOT_EQUALS,
379
- EFilterOperatorType.CONTAINS,
380
- EFilterOperatorType.STARTS_WITH,
381
- EFilterOperatorType.ENDS_WITH,
382
- EFilterOperatorType.GREATER_THAN,
383
- EFilterOperatorType.LESS_THAN,
357
+ EFilterOperatorType.EQUALS,
358
+ EFilterOperatorType.NOT_EQUALS,
359
+ EFilterOperatorType.CONTAINS,
360
+ EFilterOperatorType.STARTS_WITH,
361
+ EFilterOperatorType.ENDS_WITH,
362
+ EFilterOperatorType.GREATER_THAN,
363
+ EFilterOperatorType.LESS_THAN
384
364
  ]);
385
- /**
386
- * Отбор в шапке столбца таблицы.
387
- *
388
- * Стоит рядом с именем колонки: сужение, живущее в стороне от того, что сужает, не даёт увидеть,
389
- * какая колонка сузила список — человек читает короткий список и не узнаёт, почему он короткий.
390
- *
391
- * Своих полей не рисует ни одного: вид отбора решает, какую готовую часть кита позвать. Поля кита
392
- * ведутся формой, поэтому значение идёт через `FormControl`, а не входом со своим выходом.
393
- *
394
- * Наружу уходит весь набор условий, а не одно изменившееся: потребитель спрашивает сервер набором,
395
- * и, получив одно условие, держал бы вторую копию набора — две копии расходятся молча. Строк
396
- * семейство не отбирает: строки принадлежат тому, кто держит список.
397
- */
398
- class RtTableFilterHeaderComponent {
399
- #destroyRef;
400
- /**
401
- * Подпись каждого вида сравнения — своим сигналом словаря. Семь сигналов, а не один по
402
- * текущему виду: список показывает их все сразу, и подпись невыбранного вида нужна так же.
403
- */
404
- #operatorLabels;
405
- constructor() {
406
- this.#destroyRef = inject(DestroyRef);
407
- /**
408
- * Подпись каждого вида сравнения — своим сигналом словаря. Семь сигналов, а не один по
409
- * текущему виду: список показывает их все сразу, и подпись невыбранного вида нужна так же.
410
- */
411
- this.#operatorLabels = Object.freeze({
412
- [EFilterOperatorType.EQUALS]: rtKitLabel(OPERATOR_LABELS[EFilterOperatorType.EQUALS]),
413
- [EFilterOperatorType.NOT_EQUALS]: rtKitLabel(OPERATOR_LABELS[EFilterOperatorType.NOT_EQUALS]),
414
- [EFilterOperatorType.CONTAINS]: rtKitLabel(OPERATOR_LABELS[EFilterOperatorType.CONTAINS]),
415
- [EFilterOperatorType.STARTS_WITH]: rtKitLabel(OPERATOR_LABELS[EFilterOperatorType.STARTS_WITH]),
416
- [EFilterOperatorType.ENDS_WITH]: rtKitLabel(OPERATOR_LABELS[EFilterOperatorType.ENDS_WITH]),
417
- [EFilterOperatorType.GREATER_THAN]: rtKitLabel(OPERATOR_LABELS[EFilterOperatorType.GREATER_THAN]),
418
- [EFilterOperatorType.LESS_THAN]: rtKitLabel(OPERATOR_LABELS[EFilterOperatorType.LESS_THAN]),
419
- });
420
- /** Значение ведёт форма: поля кита берут его только так. */
421
- this.control = new FormControl('');
422
- /**
423
- * Условие по этой колонке либо `null`: по нему видно и значение, и вид сравнения. Сверяется по
424
- * содержимому, а не по ссылке: перемена соседней колонки приносит новый набор, и условие этой
425
- * колонки, пересобранное потребителем тем же, переменой не считается.
426
- */
427
- this.own = computed(() => filterOf(this.filters(), this.propertyName()), { ...(ngDevMode ? { debugName: "own" } : /* istanbul ignore next */ {}), equal: sameFilter });
428
- /**
429
- * Вид сравнения, выбранный здесь, пока значения нет: условия ещё нет, и хранить выбор, кроме
430
- * самой ячейки, негде. Без него выбор терялся бы, и введённое значение уходило бы с видом по
431
- * умолчанию. Условие этой колонки, пришедшее снаружи, выбор сбрасывает — вид берётся из него.
432
- */
433
- this.chosenOperator = linkedSignal({ ...(ngDevMode ? { debugName: "chosenOperator" } : /* istanbul ignore next */ {}), source: this.own, computation: () => null });
434
- this.value = computed(() => this.own()?.value ?? '', /* @ts-ignore */
435
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
436
- /** Очистка видна только там, где есть что очищать. */
437
- this.clearable = computed(() => this.value() !== '', /* @ts-ignore */
438
- ...(ngDevMode ? [{ debugName: "clearable" }] : /* istanbul ignore next */ []));
439
- this.operator = computed(() => {
440
- const chosen = this.chosenOperator();
441
- if (chosen !== null) {
442
- return chosen;
443
- }
444
- const own = this.own();
445
- return own !== null ? own.operatorType : startOperatorOf(this.filter()?.operators, this.filter()?.startOperator);
446
- }, /* @ts-ignore */
447
- ...(ngDevMode ? [{ debugName: "operator" }] : /* istanbul ignore next */ []));
448
- /** Виды сравнения, которые разрешила колонка; молчит колонка — разрешены все. */
449
- this.operators = computed(() => {
450
- const allowed = this.filter()?.operators;
451
- return allowed !== undefined && allowed.length > 0 ? allowed : ALL_OPERATORS;
452
- }, /* @ts-ignore */
453
- ...(ngDevMode ? [{ debugName: "operators" }] : /* istanbul ignore next */ []));
454
- this.chooseLabel = rtKitLabel('uiFilterChoose');
455
- this.valueLabel = rtKitLabel('uiFilterValue');
456
- this.clearLabel = rtKitLabel('uiClear');
457
- this.filtersLabel = rtKitLabel('uiFilters');
458
- /** Список видов сравнения открыт в слое; выбор пункта закрывает его отсюда — сам пункт не умеет. */
459
- this.operatorPopover = viewChild(RtPopoverDirective, /* @ts-ignore */
460
- ...(ngDevMode ? [{ debugName: "operatorPopover" }] : /* istanbul ignore next */ []));
461
- /** Список видов сравнения с подписями: шаблон читает готовое, а не зовёт словарь сам. */
462
- this.operatorViews = computed(() => this.operators().map((type) => ({ type, label: this.#operatorLabels[type]() })), /* @ts-ignore */
463
- ...(ngDevMode ? [{ debugName: "operatorViews" }] : /* istanbul ignore next */ []));
464
- /** Подпись текущего вида сравнения — её несёт кнопка, открывающая список. */
465
- this.operatorLabel = computed(() => this.#operatorLabels[this.operator()](), /* @ts-ignore */
466
- ...(ngDevMode ? [{ debugName: "operatorLabel" }] : /* istanbul ignore next */ []));
467
- /**
468
- * Имя кнопки для скринридера: что она открывает и какой вид стоит сейчас. Одно «Фильтры»
469
- * не отличало бы кнопку одной колонки от другой и не говорило бы, какой вид выбран.
470
- */
471
- this.operatorAriaLabel = computed(() => `${this.filtersLabel()}: ${this.operatorLabel()}`, /* @ts-ignore */
472
- ...(ngDevMode ? [{ debugName: "operatorAriaLabel" }] : /* istanbul ignore next */ []));
473
- /** Сообщает ли этот вид сразу: у выбора и даты недописанного состояния нет. */
474
- this.instant = computed(() => INSTANT_KINDS.has(this.filter()?.kind ?? 'text'), /* @ts-ignore */
475
- ...(ngDevMode ? [{ debugName: "instant" }] : /* istanbul ignore next */ []));
476
- this.options = computed(() => (this.filter()?.options ?? []).map((option) => ({
477
- value: option.value,
478
- label: option.label,
479
- })), /* @ts-ignore */
480
- ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
481
- /** Ключ колонки — тот же, что в `cdkColumnDef` и в `[columnsConfig]`. */
482
- this.propertyName = input.required(/* @ts-ignore */
483
- ...(ngDevMode ? [{ debugName: "propertyName" }] : /* istanbul ignore next */ []));
484
- /**
485
- * Чем колонка отбирает. Объявляет колонка, а не угадывает значение; колонка, которая молчит,
486
- * не отбирает вовсе — решает это сама ячейка, а не тот, кто её ставит: иначе обещание держал
487
- * бы каждый потребитель по-своему.
488
- */
489
- this.filter = input(null, /* @ts-ignore */
490
- ...(ngDevMode ? [{ debugName: "filter" }] : /* istanbul ignore next */ []));
491
- /** Текущий набор условий — весь, по всем колонкам сразу. */
492
- this.filters = input([], /* @ts-ignore */
493
- ...(ngDevMode ? [{ debugName: "filters" }] : /* istanbul ignore next */ []));
494
- this.filtersChange = output();
495
- this.control.valueChanges
496
- .pipe(takeUntilDestroyed(this.#destroyRef))
497
- .subscribe((value) => this.#onValue(value));
498
- // Набор условий меняется и снаружи — соседняя колонка, очистка всех сразу. Поле идёт
499
- // следом, и запись в него молчит: иначе она вернулась бы сюда же переменой значения.
500
- effect(() => {
501
- const value = this.value();
502
- untracked(() => {
503
- if (filterValueOf(this.control.value) !== value) {
504
- this.control.setValue(value, { emitEvent: false });
505
- }
506
- });
507
- });
508
- }
509
- onOperator(operatorType) {
510
- this.operatorPopover()?.close();
511
- this.chosenOperator.set(operatorType);
512
- this.#report(filtersWithOperator(this.filters(), this.propertyName(), operatorType));
513
- }
514
- onClear() {
515
- const instant = this.instant();
516
- this.control.setValue('');
517
- // У мгновенного вида о снятии сообщила сама перемена значения; у остальных — здесь:
518
- // очистку нажали, ждать ухода из поля нечего.
519
- if (!instant) {
520
- this.onCommit();
521
- }
522
- }
523
- /** Уход из поля и Enter: набранное значение уходит наружу разом, а не по знаку. */
524
- onCommit() {
525
- this.#commit(this.control.value);
526
- }
527
- #onValue(value) {
528
- if (this.instant()) {
529
- this.#commit(value);
530
- }
531
- }
532
- #commit(value) {
533
- this.#report(filtersWithValue(this.filters(), this.propertyName(), this.operator(), filterValueOf(value)));
534
- }
535
- /**
536
- * Наружу уходит только изменившийся набор. Прежний приходит тем же объектом, и по этому
537
- * признаку видно, что менять было нечего: повтор того же значения и смена вида сравнения
538
- * без значения не сообщают ничего.
539
- */
540
- #report(next) {
541
- if (next !== this.filters()) {
542
- this.filtersChange.emit(next);
543
- }
544
- }
545
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtTableFilterHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
546
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: RtTableFilterHeaderComponent, isStandalone: true, selector: "rt-table-filter-header", inputs: { propertyName: { classPropertyName: "propertyName", publicName: "propertyName", isSignal: true, isRequired: true, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filtersChange: "filtersChange" }, host: { classAttribute: "rt-table-filter-header" }, viewQueries: [{ propertyName: "operatorPopover", first: true, predicate: RtPopoverDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<ng-container rtBlock=\"rt-table-filter-header\">\n @if (filter(); as columnFilter) {\n <!--\n \u041A\u043D\u043E\u043F\u043A\u0430 \u0432\u0438\u0434\u0430 \u0441\u0440\u0430\u0432\u043D\u0435\u043D\u0438\u044F \u043E\u0442\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u0441\u043F\u0438\u0441\u043E\u043A \u0442\u0435\u0445 \u0432\u0438\u0434\u043E\u0432, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u043B\u0430 \u043A\u043E\u043B\u043E\u043D\u043A\u0430. \u0421\u043F\u0438\u0441\u043E\u043A\n \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D \u0432\u043D\u0443\u0442\u0440\u0438 \u0431\u043B\u043E\u043A\u0430 \u043D\u0430\u043C\u0435\u0440\u0435\u043D\u043D\u043E: `rtElem` \u0431\u0435\u0440\u0451\u0442 \u0438\u043C\u044F \u0431\u043B\u043E\u043A\u0430 \u0438\u043D\u044A\u0435\u043A\u0446\u0438\u0435\u0439 \u0443 \u0431\u043B\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043E \u043F\u0440\u0435\u0434\u043A\u0430\n \u0441 `rtBlock`, \u0430 \u0443 \u0448\u0430\u0431\u043B\u043E\u043D\u0430, \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D\u043D\u043E\u0433\u043E \u0441\u043D\u0430\u0440\u0443\u0436\u0438, \u0442\u0430\u043A\u043E\u0433\u043E \u043F\u0440\u0435\u0434\u043A\u0430 \u043D\u0435\u0442 \u0432\u043E\u0432\u0441\u0435.\n -->\n <button\n type=\"button\"\n rtElem=\"operator\"\n qa-dataid=\"table-filter-operator\"\n [attr.aria-label]=\"operatorAriaLabel()\"\n [rtMod]=\"{ set: clearable() }\"\n [rtPopover]=\"operatorsTpl\">\n {{ operatorLabel() }}\n </button>\n\n <!--\n \u041D\u0430\u0431\u0440\u0430\u043D\u043D\u043E\u0435 \u0443\u0445\u043E\u0434\u0438\u0442 \u043D\u0430\u0440\u0443\u0436\u0443 \u043F\u043E \u0443\u0445\u043E\u0434\u0443 \u0438\u0437 \u043F\u043E\u043B\u044F \u0438 \u043F\u043E Enter, \u0430 \u043D\u0435 \u043F\u043E \u043A\u0430\u0436\u0434\u043E\u043C\u0443 \u0437\u043D\u0430\u043A\u0443: \u043D\u0430\u0431\u043E\u0440 \u0443\u0441\u043B\u043E\u0432\u0438\u0439,\n \u0443\u0445\u043E\u0434\u044F\u0449\u0438\u0439 \u043D\u0430 \u0431\u0443\u043A\u0432\u0443, \u0441\u043F\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440 \u043F\u043E \u0431\u0443\u043A\u0432\u0435. \u0412\u044B\u0431\u043E\u0440 \u0438 \u0434\u0430\u0442\u0430 \u0441\u043E\u043E\u0431\u0449\u0430\u044E\u0442 \u0441\u0430\u043C\u0438 \u2014 \u0443 \u043D\u0438\u0445\n \u043D\u0435\u0434\u043E\u043F\u0438\u0441\u0430\u043D\u043D\u043E\u0433\u043E \u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u044F \u043D\u0435\u0442.\n -->\n <div rtElem=\"value\" qa-dataid=\"table-filter-value\">\n @switch (columnFilter.kind) {\n @case ('number') {\n <rt-input-number\n qa-dataid=\"table-filter-number\"\n size=\"sm\"\n [placeholder]=\"valueLabel()\"\n [clearable]=\"false\"\n [formControl]=\"control\"\n (focusout)=\"onCommit()\"\n (keydown.enter)=\"onCommit()\" />\n }\n\n @case ('select') {\n <rt-select\n qa-dataid=\"table-filter-select\"\n size=\"sm\"\n [placeholder]=\"chooseLabel()\"\n [clearable]=\"false\"\n [options]=\"options()\"\n [formControl]=\"control\" />\n }\n\n @case ('date') {\n <rt-date-picker qa-dataid=\"table-filter-date\" size=\"sm\" [clearable]=\"false\" [formControl]=\"control\" />\n }\n\n @default {\n <rt-input\n qa-dataid=\"table-filter-text\"\n size=\"sm\"\n [placeholder]=\"valueLabel()\"\n [clearable]=\"false\"\n [formControl]=\"control\"\n (focusout)=\"onCommit()\"\n (keydown.enter)=\"onCommit()\" />\n }\n }\n </div>\n\n <!-- \u041E\u0447\u0438\u0441\u0442\u043A\u0430 \u0441\u0442\u043E\u0438\u0442 \u0432 \u0440\u0430\u0437\u043C\u0435\u0442\u043A\u0435 \u0442\u043E\u043B\u044C\u043A\u043E \u0442\u0430\u043C, \u0433\u0434\u0435 \u0435\u0441\u0442\u044C \u0447\u0442\u043E \u043E\u0447\u0438\u0449\u0430\u0442\u044C. -->\n @if (clearable()) {\n <rt-icon-button\n rtElem=\"clear\"\n qa-dataid=\"table-filter-clear\"\n variant=\"ghost\"\n icon=\"ico-close\"\n size=\"sm\"\n [ariaLabel]=\"clearLabel()\"\n (clicked)=\"onClear()\" />\n }\n\n <ng-template #operatorsTpl>\n <div rtElem=\"operators\" qa-dataid=\"table-filter-operators\" role=\"menu\">\n @for (view of operatorViews(); track view.type) {\n <rt-menu-item qa-dataid=\"table-filter-operator-item\" [label]=\"view.label\" (selected)=\"onOperator(view.type)\" />\n }\n </div>\n </ng-template>\n }\n</ng-container>\n", styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-table-filter-header{--rt-table-filter-header-radius: var(--rt-radius-sm);--rt-table-filter-header-operator-color: var(--rt-color-text-muted);--rt-table-filter-header-operator-color-set: var(--rt-color-text-primary);--rt-table-filter-header-operator-bg-hover: var(--rt-color-bg-subtle);--rt-table-filter-header-operator-focus-shadow: var(--rt-shadow-focus-ring);display:flex;width:100%;min-width:0;align-items:center;gap:var(--rt-space-1)}.rt-table-filter-header__operator{padding:var(--rt-space-0-5) var(--rt-space-1);border:0;border-radius:var(--rt-table-filter-header-radius);background:transparent;color:var(--rt-table-filter-header-operator-color);cursor:pointer;font-family:inherit;font-size:var(--rt-text-xs);white-space:nowrap}.rt-table-filter-header__operator:hover{background:var(--rt-table-filter-header-operator-bg-hover)}.rt-table-filter-header__operator:focus-visible{box-shadow:var(--rt-table-filter-header-operator-focus-shadow);outline:none}.rt-table-filter-header__operator--set{color:var(--rt-table-filter-header-operator-color-set);font-weight:var(--rt-font-weight-medium)}.rt-table-filter-header__value{min-width:0;flex:1 1 auto}.rt-table-filter-header__clear{flex:none}.rt-table-filter-header__operators{--rt-table-filter-header-menu-radius: var(--rt-radius-md);--rt-table-filter-header-menu-shadow: var(--rt-shadow-card);display:flex;flex-direction:column;padding:var(--rt-space-1);border-radius:var(--rt-table-filter-header-menu-radius);background:var(--rt-color-bg-surface);box-shadow:var(--rt-table-filter-header-menu-shadow)}}\n"], dependencies: [{ kind: "ngmodule", type:
547
- // angular
548
- ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type:
549
- // rt-tools
550
- BlockDirective, selector: "[rtBlock]", inputs: ["rtMod"] }, { kind: "directive", type: ElemDirective, selector: "[rtElem]", inputs: ["rtMod"] }, { kind: "directive", type: ModDirective, selector: "[rtMod]" }, { kind: "component", type:
551
- // components
552
- RtDatePickerComponent, selector: "rt-date-picker", inputs: ["appearance", "type", "min", "max", "minuteStep"] }, { kind: "component", type: RtIconButtonComponent, selector: "rt-icon-button", inputs: ["icon", "glyph", "ariaLabel", "variant", "iconColor", "iconFill", "size", "iconSize", "type", "tooltip", "tabIndex", "loading", "disabled", "active", "indicator"], outputs: ["clicked"] }, { kind: "component", type: RtInputComponent, selector: "rt-input", inputs: ["appearance", "type", "placeholder", "iconLeft", "iconRight", "passwordToggle", "autocomplete"] }, { kind: "component", type: RtInputNumberComponent, selector: "rt-input-number", inputs: ["appearance", "iconLeft", "prefix", "placeholder", "min", "max", "minFractionDigits", "maxFractionDigits", "grouped"] }, { kind: "component", type: RtMenuItemComponent, selector: "rt-menu-item", inputs: ["icon", "label", "danger", "success", "glyph", "fill", "current", "disabled", "confirmMessage", "confirmTitle", "confirmLabel", "confirmCancelLabel", "confirmTone", "link"], outputs: ["selected"] }, { kind: "directive", type: RtPopoverDirective, selector: "[rtPopover]", inputs: ["rtPopover", "rtPopoverTrigger", "rtPopoverWidth", "rtPopoverAlign", "rtPopoverFitViewport", "rtPopoverContext", "rtPopoverPanelClass", "rtPopoverDisabled", "rtPopoverOffsetY", "rtPopoverOffsetX"], outputs: ["rtPopoverOpened", "rtPopoverClosed"], exportAs: ["rtPopover"] }, { kind: "component", type: RtSelectComponent, selector: "rt-select", inputs: ["appearance", "options", "placeholder", "iconLeft", "filter", "filterPlaceholder", "panelWidth", "panelMaxHeight"], outputs: ["selectionChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
553
- }
554
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtTableFilterHeaderComponent, decorators: [{
555
- type: Component,
556
- args: [{ selector: 'rt-table-filter-header', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
557
- // angular
558
- ReactiveFormsModule,
559
- // rt-tools
560
- BlockDirective,
561
- ElemDirective,
562
- ModDirective,
563
- // components
564
- RtDatePickerComponent,
565
- RtIconButtonComponent,
566
- RtInputComponent,
567
- RtInputNumberComponent,
568
- RtMenuItemComponent,
569
- RtPopoverDirective,
570
- RtSelectComponent,
571
- ], host: {
572
- class: BEM_BLOCK$4,
573
- }, template: "<ng-container rtBlock=\"rt-table-filter-header\">\n @if (filter(); as columnFilter) {\n <!--\n \u041A\u043D\u043E\u043F\u043A\u0430 \u0432\u0438\u0434\u0430 \u0441\u0440\u0430\u0432\u043D\u0435\u043D\u0438\u044F \u043E\u0442\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u0441\u043F\u0438\u0441\u043E\u043A \u0442\u0435\u0445 \u0432\u0438\u0434\u043E\u0432, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u043B\u0430 \u043A\u043E\u043B\u043E\u043D\u043A\u0430. \u0421\u043F\u0438\u0441\u043E\u043A\n \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D \u0432\u043D\u0443\u0442\u0440\u0438 \u0431\u043B\u043E\u043A\u0430 \u043D\u0430\u043C\u0435\u0440\u0435\u043D\u043D\u043E: `rtElem` \u0431\u0435\u0440\u0451\u0442 \u0438\u043C\u044F \u0431\u043B\u043E\u043A\u0430 \u0438\u043D\u044A\u0435\u043A\u0446\u0438\u0435\u0439 \u0443 \u0431\u043B\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043E \u043F\u0440\u0435\u0434\u043A\u0430\n \u0441 `rtBlock`, \u0430 \u0443 \u0448\u0430\u0431\u043B\u043E\u043D\u0430, \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D\u043D\u043E\u0433\u043E \u0441\u043D\u0430\u0440\u0443\u0436\u0438, \u0442\u0430\u043A\u043E\u0433\u043E \u043F\u0440\u0435\u0434\u043A\u0430 \u043D\u0435\u0442 \u0432\u043E\u0432\u0441\u0435.\n -->\n <button\n type=\"button\"\n rtElem=\"operator\"\n qa-dataid=\"table-filter-operator\"\n [attr.aria-label]=\"operatorAriaLabel()\"\n [rtMod]=\"{ set: clearable() }\"\n [rtPopover]=\"operatorsTpl\">\n {{ operatorLabel() }}\n </button>\n\n <!--\n \u041D\u0430\u0431\u0440\u0430\u043D\u043D\u043E\u0435 \u0443\u0445\u043E\u0434\u0438\u0442 \u043D\u0430\u0440\u0443\u0436\u0443 \u043F\u043E \u0443\u0445\u043E\u0434\u0443 \u0438\u0437 \u043F\u043E\u043B\u044F \u0438 \u043F\u043E Enter, \u0430 \u043D\u0435 \u043F\u043E \u043A\u0430\u0436\u0434\u043E\u043C\u0443 \u0437\u043D\u0430\u043A\u0443: \u043D\u0430\u0431\u043E\u0440 \u0443\u0441\u043B\u043E\u0432\u0438\u0439,\n \u0443\u0445\u043E\u0434\u044F\u0449\u0438\u0439 \u043D\u0430 \u0431\u0443\u043A\u0432\u0443, \u0441\u043F\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440 \u043F\u043E \u0431\u0443\u043A\u0432\u0435. \u0412\u044B\u0431\u043E\u0440 \u0438 \u0434\u0430\u0442\u0430 \u0441\u043E\u043E\u0431\u0449\u0430\u044E\u0442 \u0441\u0430\u043C\u0438 \u2014 \u0443 \u043D\u0438\u0445\n \u043D\u0435\u0434\u043E\u043F\u0438\u0441\u0430\u043D\u043D\u043E\u0433\u043E \u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u044F \u043D\u0435\u0442.\n -->\n <div rtElem=\"value\" qa-dataid=\"table-filter-value\">\n @switch (columnFilter.kind) {\n @case ('number') {\n <rt-input-number\n qa-dataid=\"table-filter-number\"\n size=\"sm\"\n [placeholder]=\"valueLabel()\"\n [clearable]=\"false\"\n [formControl]=\"control\"\n (focusout)=\"onCommit()\"\n (keydown.enter)=\"onCommit()\" />\n }\n\n @case ('select') {\n <rt-select\n qa-dataid=\"table-filter-select\"\n size=\"sm\"\n [placeholder]=\"chooseLabel()\"\n [clearable]=\"false\"\n [options]=\"options()\"\n [formControl]=\"control\" />\n }\n\n @case ('date') {\n <rt-date-picker qa-dataid=\"table-filter-date\" size=\"sm\" [clearable]=\"false\" [formControl]=\"control\" />\n }\n\n @default {\n <rt-input\n qa-dataid=\"table-filter-text\"\n size=\"sm\"\n [placeholder]=\"valueLabel()\"\n [clearable]=\"false\"\n [formControl]=\"control\"\n (focusout)=\"onCommit()\"\n (keydown.enter)=\"onCommit()\" />\n }\n }\n </div>\n\n <!-- \u041E\u0447\u0438\u0441\u0442\u043A\u0430 \u0441\u0442\u043E\u0438\u0442 \u0432 \u0440\u0430\u0437\u043C\u0435\u0442\u043A\u0435 \u0442\u043E\u043B\u044C\u043A\u043E \u0442\u0430\u043C, \u0433\u0434\u0435 \u0435\u0441\u0442\u044C \u0447\u0442\u043E \u043E\u0447\u0438\u0449\u0430\u0442\u044C. -->\n @if (clearable()) {\n <rt-icon-button\n rtElem=\"clear\"\n qa-dataid=\"table-filter-clear\"\n variant=\"ghost\"\n icon=\"ico-close\"\n size=\"sm\"\n [ariaLabel]=\"clearLabel()\"\n (clicked)=\"onClear()\" />\n }\n\n <ng-template #operatorsTpl>\n <div rtElem=\"operators\" qa-dataid=\"table-filter-operators\" role=\"menu\">\n @for (view of operatorViews(); track view.type) {\n <rt-menu-item qa-dataid=\"table-filter-operator-item\" [label]=\"view.label\" (selected)=\"onOperator(view.type)\" />\n }\n </div>\n </ng-template>\n }\n</ng-container>\n", styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-table-filter-header{--rt-table-filter-header-radius: var(--rt-radius-sm);--rt-table-filter-header-operator-color: var(--rt-color-text-muted);--rt-table-filter-header-operator-color-set: var(--rt-color-text-primary);--rt-table-filter-header-operator-bg-hover: var(--rt-color-bg-subtle);--rt-table-filter-header-operator-focus-shadow: var(--rt-shadow-focus-ring);display:flex;width:100%;min-width:0;align-items:center;gap:var(--rt-space-1)}.rt-table-filter-header__operator{padding:var(--rt-space-0-5) var(--rt-space-1);border:0;border-radius:var(--rt-table-filter-header-radius);background:transparent;color:var(--rt-table-filter-header-operator-color);cursor:pointer;font-family:inherit;font-size:var(--rt-text-xs);white-space:nowrap}.rt-table-filter-header__operator:hover{background:var(--rt-table-filter-header-operator-bg-hover)}.rt-table-filter-header__operator:focus-visible{box-shadow:var(--rt-table-filter-header-operator-focus-shadow);outline:none}.rt-table-filter-header__operator--set{color:var(--rt-table-filter-header-operator-color-set);font-weight:var(--rt-font-weight-medium)}.rt-table-filter-header__value{min-width:0;flex:1 1 auto}.rt-table-filter-header__clear{flex:none}.rt-table-filter-header__operators{--rt-table-filter-header-menu-radius: var(--rt-radius-md);--rt-table-filter-header-menu-shadow: var(--rt-shadow-card);display:flex;flex-direction:column;padding:var(--rt-space-1);border-radius:var(--rt-table-filter-header-menu-radius);background:var(--rt-color-bg-surface);box-shadow:var(--rt-table-filter-header-menu-shadow)}}\n"] }]
574
- }], ctorParameters: () => [], propDecorators: { operatorPopover: [{ type: i0.ViewChild, args: [i0.forwardRef(() => RtPopoverDirective), { isSignal: true }] }], propertyName: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertyName", required: true }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: false }] }], filters: [{ type: i0.Input, args: [{ isSignal: true, alias: "filters", required: false }] }], filtersChange: [{ type: i0.Output, args: ["filtersChange"] }] } });
575
-
576
- /**
577
- * Захватывает `<ng-template rtTableCard let-row>` — кастомную разметку карточки
578
- * строки для мобильного (узкого) режима `rt-table`. Когда задан, rt-table на
579
- * узком экране (≤1080px) рендерит эту разметку в `<article>` вместо
580
- * авто-карточки «label: value» по колонкам.
581
- *
582
- * Escape-hatch для страниц, которым нужна rich-карточка (составной primary-блок,
583
- * теги, произвольная раскладка), а не построчный список полей.
584
- *
585
- * @example
586
- * ```html
587
- * <rt-table #t="rtTable" [dataSource]="rows" ...>
588
- * ...колонки...
589
- * <ng-template rtTableCard [rtTableCardRowType]="rows" let-row>
590
- * <div class="my-card-head">{{ row.login }}</div>
591
- * </ng-template>
592
- * <tr cdk-row *cdkRowDef="let row; columns: t.displayedColumns()"></tr>
593
- * </rt-table>
594
- * ```
595
- */
596
- class RtTableCardDirective {
597
- constructor() {
598
- this.template = inject(TemplateRef);
599
- /**
600
- * Type-carrier для вывода `TRow`: биндят тот же массив, что в `dataSource`.
601
- * Значение в рантайме не читается — служит только подсказкой типизации для
602
- * `let-row` (через `ngTemplateContextGuard`).
603
- */
604
- this.rtTableCardRowType = input([], /* @ts-ignore */
605
- ...(ngDevMode ? [{ debugName: "rtTableCardRowType" }] : /* istanbul ignore next */ []));
606
- }
607
- /** Type-guard: сужает контекст шаблона до строки таблицы при проверке шаблонов. */
608
- static ngTemplateContextGuard(_directive,
609
- // eslint-disable-next-line @typescript-eslint/no-unused-vars -- второй довод стража контекста шаблона стоит только в типе-предикате; убрать его нечем, подпись задаёт каркас
610
- context) {
611
- return true;
612
- }
613
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtTableCardDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
614
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.6", type: RtTableCardDirective, isStandalone: true, selector: "ng-template[rtTableCard]", inputs: { rtTableCardRowType: { classPropertyName: "rtTableCardRowType", publicName: "rtTableCardRowType", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
615
- }
616
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtTableCardDirective, decorators: [{
617
- type: Directive,
618
- args: [{
619
- selector: 'ng-template[rtTableCard]',
620
- }]
621
- }], propDecorators: { rtTableCardRowType: [{ type: i0.Input, args: [{ isSignal: true, alias: "rtTableCardRowType", required: false }] }] } });
622
-
623
- /**
624
- * Строки, которые можно показать карточками. Источник данных таблицы бывает массивом,
625
- * потоком и своим объектом, а карточки строятся только по массиву: у остальных состав строк
626
- * известен лишь самой таблице, и брать его отсюда нечем.
627
- */
365
+ var RtTableFilterHeaderComponent = class RtTableFilterHeaderComponent {
366
+ #destroyRef;
367
+ #operatorLabels;
368
+ constructor() {
369
+ this.#destroyRef = inject(DestroyRef);
370
+ this.#operatorLabels = Object.freeze({
371
+ [EFilterOperatorType.EQUALS]: rtKitLabel(OPERATOR_LABELS[EFilterOperatorType.EQUALS]),
372
+ [EFilterOperatorType.NOT_EQUALS]: rtKitLabel(OPERATOR_LABELS[EFilterOperatorType.NOT_EQUALS]),
373
+ [EFilterOperatorType.CONTAINS]: rtKitLabel(OPERATOR_LABELS[EFilterOperatorType.CONTAINS]),
374
+ [EFilterOperatorType.STARTS_WITH]: rtKitLabel(OPERATOR_LABELS[EFilterOperatorType.STARTS_WITH]),
375
+ [EFilterOperatorType.ENDS_WITH]: rtKitLabel(OPERATOR_LABELS[EFilterOperatorType.ENDS_WITH]),
376
+ [EFilterOperatorType.GREATER_THAN]: rtKitLabel(OPERATOR_LABELS[EFilterOperatorType.GREATER_THAN]),
377
+ [EFilterOperatorType.LESS_THAN]: rtKitLabel(OPERATOR_LABELS[EFilterOperatorType.LESS_THAN])
378
+ });
379
+ this.control = new FormControl("");
380
+ this.own = computed(() => filterOf(this.filters(), this.propertyName()), {
381
+ ...ngDevMode ? { debugName: "own" } : /* istanbul ignore next */ {},
382
+ equal: sameFilter
383
+ });
384
+ this.chosenOperator = linkedSignal({
385
+ ...ngDevMode ? { debugName: "chosenOperator" } : /* istanbul ignore next */ {},
386
+ source: this.own,
387
+ computation: () => null
388
+ });
389
+ this.value = computed(() => this.own()?.value ?? "", ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
390
+ this.clearable = computed(() => this.value() !== "", ...ngDevMode ? [{ debugName: "clearable" }] : /* istanbul ignore next */ []);
391
+ this.operator = computed(() => {
392
+ const chosen = this.chosenOperator();
393
+ if (chosen !== null) return chosen;
394
+ const own = this.own();
395
+ return own !== null ? own.operatorType : startOperatorOf(this.filter()?.operators, this.filter()?.startOperator);
396
+ }, ...ngDevMode ? [{ debugName: "operator" }] : /* istanbul ignore next */ []);
397
+ this.operators = computed(() => {
398
+ const allowed = this.filter()?.operators;
399
+ return allowed !== void 0 && allowed.length > 0 ? allowed : ALL_OPERATORS;
400
+ }, ...ngDevMode ? [{ debugName: "operators" }] : /* istanbul ignore next */ []);
401
+ this.chooseLabel = rtKitLabel("uiFilterChoose");
402
+ this.valueLabel = rtKitLabel("uiFilterValue");
403
+ this.clearLabel = rtKitLabel("uiClear");
404
+ this.filtersLabel = rtKitLabel("uiFilters");
405
+ this.operatorPopover = viewChild(RtPopoverDirective, ...ngDevMode ? [{ debugName: "operatorPopover" }] : /* istanbul ignore next */ []);
406
+ this.operatorViews = computed(() => this.operators().map((type) => ({
407
+ type,
408
+ label: this.#operatorLabels[type]()
409
+ })), ...ngDevMode ? [{ debugName: "operatorViews" }] : /* istanbul ignore next */ []);
410
+ this.operatorLabel = computed(() => this.#operatorLabels[this.operator()](), ...ngDevMode ? [{ debugName: "operatorLabel" }] : /* istanbul ignore next */ []);
411
+ this.operatorAriaLabel = computed(() => `${this.filtersLabel()}: ${this.operatorLabel()}`, ...ngDevMode ? [{ debugName: "operatorAriaLabel" }] : /* istanbul ignore next */ []);
412
+ this.instant = computed(() => INSTANT_KINDS.has(this.filter()?.kind ?? "text"), ...ngDevMode ? [{ debugName: "instant" }] : /* istanbul ignore next */ []);
413
+ this.options = computed(() => (this.filter()?.options ?? []).map((option) => ({
414
+ value: option.value,
415
+ label: option.label
416
+ })), ...ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []);
417
+ this.propertyName = input.required(...ngDevMode ? [{ debugName: "propertyName" }] : /* istanbul ignore next */ []);
418
+ this.filter = input(null, ...ngDevMode ? [{ debugName: "filter" }] : /* istanbul ignore next */ []);
419
+ this.filters = input([], ...ngDevMode ? [{ debugName: "filters" }] : /* istanbul ignore next */ []);
420
+ this.filtersChange = output();
421
+ this.control.valueChanges.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((value) => this.#onValue(value));
422
+ effect(() => {
423
+ const value = this.value();
424
+ untracked(() => {
425
+ if (filterValueOf(this.control.value) !== value) this.control.setValue(value, { emitEvent: false });
426
+ });
427
+ });
428
+ }
429
+ onOperator(operatorType) {
430
+ this.operatorPopover()?.close();
431
+ this.chosenOperator.set(operatorType);
432
+ this.#report(filtersWithOperator(this.filters(), this.propertyName(), operatorType));
433
+ }
434
+ onClear() {
435
+ const instant = this.instant();
436
+ this.control.setValue("");
437
+ if (!instant) this.onCommit();
438
+ }
439
+ onCommit() {
440
+ this.#commit(this.control.value);
441
+ }
442
+ #onValue(value) {
443
+ if (this.instant()) this.#commit(value);
444
+ }
445
+ #commit(value) {
446
+ this.#report(filtersWithValue(this.filters(), this.propertyName(), this.operator(), filterValueOf(value)));
447
+ }
448
+ #report(next) {
449
+ if (next !== this.filters()) this.filtersChange.emit(next);
450
+ }
451
+ static {
452
+ this.ɵfac = i0.ɵɵngDeclareFactory({
453
+ minVersion: "12.0.0",
454
+ version: "22.2.2",
455
+ ngImport: i0,
456
+ type: RtTableFilterHeaderComponent,
457
+ deps: [],
458
+ target: i0.ɵɵFactoryTarget.Component
459
+ });
460
+ }
461
+ static {
462
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
463
+ minVersion: "17.0.0",
464
+ version: "22.2.2",
465
+ type: RtTableFilterHeaderComponent,
466
+ isStandalone: true,
467
+ selector: "rt-table-filter-header",
468
+ inputs: {
469
+ propertyName: {
470
+ classPropertyName: "propertyName",
471
+ publicName: "propertyName",
472
+ isSignal: true,
473
+ isRequired: true,
474
+ transformFunction: null
475
+ },
476
+ filter: {
477
+ classPropertyName: "filter",
478
+ publicName: "filter",
479
+ isSignal: true,
480
+ isRequired: false,
481
+ transformFunction: null
482
+ },
483
+ filters: {
484
+ classPropertyName: "filters",
485
+ publicName: "filters",
486
+ isSignal: true,
487
+ isRequired: false,
488
+ transformFunction: null
489
+ }
490
+ },
491
+ outputs: { filtersChange: "filtersChange" },
492
+ host: { classAttribute: "rt-table-filter-header" },
493
+ viewQueries: [{
494
+ propertyName: "operatorPopover",
495
+ first: true,
496
+ predicate: RtPopoverDirective,
497
+ descendants: true,
498
+ isSignal: true
499
+ }],
500
+ ngImport: i0,
501
+ template: "<ng-container rtBlock=\"rt-table-filter-header\">\n @if (filter(); as columnFilter) {\n <!--\n Кнопка вида сравнения открывает список тех видов, которые разрешила колонка. Список\n объявлен внутри блока намеренно: `rtElem` берёт имя блока инъекцией у ближайшего предка\n с `rtBlock`, а у шаблона, объявленного снаружи, такого предка нет вовсе.\n -->\n <button\n type=\"button\"\n rtElem=\"operator\"\n qa-dataid=\"table-filter-operator\"\n [attr.aria-label]=\"operatorAriaLabel()\"\n [rtMod]=\"{ set: clearable() }\"\n [rtPopover]=\"operatorsTpl\">\n {{ operatorLabel() }}\n </button>\n\n <!--\n Набранное уходит наружу по уходу из поля и по Enter, а не по каждому знаку: набор условий,\n уходящий на букву, спрашивает сервер по букве. Выбор и дата сообщают сами — у них\n недописанного состояния нет.\n -->\n <div rtElem=\"value\" qa-dataid=\"table-filter-value\">\n @switch (columnFilter.kind) {\n @case ('number') {\n <rt-input-number\n qa-dataid=\"table-filter-number\"\n size=\"sm\"\n [placeholder]=\"valueLabel()\"\n [clearable]=\"false\"\n [formControl]=\"control\"\n (focusout)=\"onCommit()\"\n (keydown.enter)=\"onCommit()\" />\n }\n\n @case ('select') {\n <rt-select\n qa-dataid=\"table-filter-select\"\n size=\"sm\"\n [placeholder]=\"chooseLabel()\"\n [clearable]=\"false\"\n [options]=\"options()\"\n [formControl]=\"control\" />\n }\n\n @case ('date') {\n <rt-date-picker qa-dataid=\"table-filter-date\" size=\"sm\" [clearable]=\"false\" [formControl]=\"control\" />\n }\n\n @default {\n <rt-input\n qa-dataid=\"table-filter-text\"\n size=\"sm\"\n [placeholder]=\"valueLabel()\"\n [clearable]=\"false\"\n [formControl]=\"control\"\n (focusout)=\"onCommit()\"\n (keydown.enter)=\"onCommit()\" />\n }\n }\n </div>\n\n <!-- Очистка стоит в разметке только там, где есть что очищать. -->\n @if (clearable()) {\n <rt-icon-button\n rtElem=\"clear\"\n qa-dataid=\"table-filter-clear\"\n variant=\"ghost\"\n icon=\"ico-close\"\n size=\"sm\"\n [ariaLabel]=\"clearLabel()\"\n (clicked)=\"onClear()\" />\n }\n\n <ng-template #operatorsTpl>\n <div rtElem=\"operators\" qa-dataid=\"table-filter-operators\" role=\"menu\">\n @for (view of operatorViews(); track view.type) {\n <rt-menu-item qa-dataid=\"table-filter-operator-item\" [label]=\"view.label\" (selected)=\"onOperator(view.type)\" />\n }\n </div>\n </ng-template>\n }\n</ng-container>\n",
502
+ styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-table-filter-header{--rt-table-filter-header-radius: var(--rt-radius-sm);--rt-table-filter-header-operator-color: var(--rt-color-text-muted);--rt-table-filter-header-operator-color-set: var(--rt-color-text-primary);--rt-table-filter-header-operator-bg-hover: var(--rt-color-bg-subtle);--rt-table-filter-header-operator-focus-shadow: var(--rt-shadow-focus-ring);display:flex;width:100%;min-width:0;align-items:center;gap:var(--rt-space-1)}.rt-table-filter-header__operator{padding:var(--rt-space-0-5) var(--rt-space-1);border:0;border-radius:var(--rt-table-filter-header-radius);background:transparent;color:var(--rt-table-filter-header-operator-color);cursor:pointer;font-family:inherit;font-size:var(--rt-text-xs);white-space:nowrap}.rt-table-filter-header__operator:hover{background:var(--rt-table-filter-header-operator-bg-hover)}.rt-table-filter-header__operator:focus-visible{box-shadow:var(--rt-table-filter-header-operator-focus-shadow);outline:none}.rt-table-filter-header__operator--set{color:var(--rt-table-filter-header-operator-color-set);font-weight:var(--rt-font-weight-medium)}.rt-table-filter-header__value{min-width:0;flex:1 1 auto}.rt-table-filter-header__clear{flex:none}.rt-table-filter-header__operators{--rt-table-filter-header-menu-radius: var(--rt-radius-md);--rt-table-filter-header-menu-shadow: var(--rt-shadow-card);display:flex;flex-direction:column;padding:var(--rt-space-1);border-radius:var(--rt-table-filter-header-menu-radius);background:var(--rt-color-bg-surface);box-shadow:var(--rt-table-filter-header-menu-shadow)}}\n"],
503
+ dependencies: [
504
+ {
505
+ kind: "ngmodule",
506
+ type: ReactiveFormsModule
507
+ },
508
+ {
509
+ kind: "directive",
510
+ type: i1$1.NgControlStatus,
511
+ selector: "[formControlName],[ngModel],[formControl]"
512
+ },
513
+ {
514
+ kind: "directive",
515
+ type: i1$1.FormControlDirective,
516
+ selector: "[formControl]",
517
+ inputs: [
518
+ "formControl",
519
+ "disabled",
520
+ "ngModel"
521
+ ],
522
+ outputs: ["ngModelChange"],
523
+ exportAs: ["ngForm"]
524
+ },
525
+ {
526
+ kind: "directive",
527
+ type: BlockDirective,
528
+ selector: "[rtBlock]",
529
+ inputs: ["rtMod"]
530
+ },
531
+ {
532
+ kind: "directive",
533
+ type: ElemDirective,
534
+ selector: "[rtElem]",
535
+ inputs: ["rtMod"]
536
+ },
537
+ {
538
+ kind: "directive",
539
+ type: ModDirective,
540
+ selector: "[rtMod]"
541
+ },
542
+ {
543
+ kind: "component",
544
+ type: RtDatePickerComponent,
545
+ selector: "rt-date-picker",
546
+ inputs: [
547
+ "appearance",
548
+ "type",
549
+ "min",
550
+ "max",
551
+ "minuteStep"
552
+ ]
553
+ },
554
+ {
555
+ kind: "component",
556
+ type: RtIconButtonComponent,
557
+ selector: "rt-icon-button",
558
+ inputs: [
559
+ "icon",
560
+ "glyph",
561
+ "ariaLabel",
562
+ "variant",
563
+ "iconColor",
564
+ "iconFill",
565
+ "size",
566
+ "iconSize",
567
+ "type",
568
+ "tooltip",
569
+ "tooltipHideOnClick",
570
+ "tabIndex",
571
+ "loading",
572
+ "disabled",
573
+ "active",
574
+ "expanded",
575
+ "indicator"
576
+ ],
577
+ outputs: ["clicked"]
578
+ },
579
+ {
580
+ kind: "component",
581
+ type: RtInputComponent,
582
+ selector: "rt-input",
583
+ inputs: [
584
+ "appearance",
585
+ "type",
586
+ "placeholder",
587
+ "iconLeft",
588
+ "iconRight",
589
+ "passwordToggle",
590
+ "autocomplete"
591
+ ]
592
+ },
593
+ {
594
+ kind: "component",
595
+ type: RtInputNumberComponent,
596
+ selector: "rt-input-number",
597
+ inputs: [
598
+ "appearance",
599
+ "iconLeft",
600
+ "prefix",
601
+ "placeholder",
602
+ "min",
603
+ "max",
604
+ "minFractionDigits",
605
+ "maxFractionDigits",
606
+ "grouped"
607
+ ]
608
+ },
609
+ {
610
+ kind: "component",
611
+ type: RtMenuItemComponent,
612
+ selector: "rt-menu-item",
613
+ inputs: [
614
+ "icon",
615
+ "label",
616
+ "danger",
617
+ "success",
618
+ "glyph",
619
+ "fill",
620
+ "current",
621
+ "disabled",
622
+ "confirmMessage",
623
+ "confirmTitle",
624
+ "confirmLabel",
625
+ "confirmCancelLabel",
626
+ "confirmTone",
627
+ "link"
628
+ ],
629
+ outputs: ["selected"]
630
+ },
631
+ {
632
+ kind: "directive",
633
+ type: RtPopoverDirective,
634
+ selector: "[rtPopover]",
635
+ inputs: [
636
+ "rtPopover",
637
+ "rtPopoverTrigger",
638
+ "rtPopoverWidth",
639
+ "rtPopoverAlign",
640
+ "rtPopoverFitViewport",
641
+ "rtPopoverContext",
642
+ "rtPopoverPanelClass",
643
+ "rtPopoverDisabled",
644
+ "rtPopoverOffsetY",
645
+ "rtPopoverOffsetX",
646
+ "rtPopoverPositions"
647
+ ],
648
+ outputs: ["rtPopoverOpened", "rtPopoverClosed"],
649
+ exportAs: ["rtPopover"]
650
+ },
651
+ {
652
+ kind: "component",
653
+ type: RtSelectComponent,
654
+ selector: "rt-select",
655
+ inputs: [
656
+ "appearance",
657
+ "options",
658
+ "placeholder",
659
+ "iconLeft",
660
+ "filter",
661
+ "filterPlaceholder",
662
+ "panelWidth",
663
+ "panelMaxHeight"
664
+ ],
665
+ outputs: ["selectionChange"]
666
+ }
667
+ ],
668
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
669
+ encapsulation: i0.ViewEncapsulation.None
670
+ });
671
+ }
672
+ };
673
+ i0.ɵɵngDeclareClassMetadata({
674
+ minVersion: "12.0.0",
675
+ version: "22.2.2",
676
+ ngImport: i0,
677
+ type: RtTableFilterHeaderComponent,
678
+ decorators: [{
679
+ type: Component,
680
+ args: [{
681
+ selector: "rt-table-filter-header",
682
+ changeDetection: ChangeDetectionStrategy.OnPush,
683
+ encapsulation: ViewEncapsulation.None,
684
+ imports: [
685
+ ReactiveFormsModule,
686
+ BlockDirective,
687
+ ElemDirective,
688
+ ModDirective,
689
+ RtDatePickerComponent,
690
+ RtIconButtonComponent,
691
+ RtInputComponent,
692
+ RtInputNumberComponent,
693
+ RtMenuItemComponent,
694
+ RtPopoverDirective,
695
+ RtSelectComponent
696
+ ],
697
+ host: { class: BEM_BLOCK$4 },
698
+ template: "<ng-container rtBlock=\"rt-table-filter-header\">\n @if (filter(); as columnFilter) {\n <!--\n Кнопка вида сравнения открывает список тех видов, которые разрешила колонка. Список\n объявлен внутри блока намеренно: `rtElem` берёт имя блока инъекцией у ближайшего предка\n с `rtBlock`, а у шаблона, объявленного снаружи, такого предка нет вовсе.\n -->\n <button\n type=\"button\"\n rtElem=\"operator\"\n qa-dataid=\"table-filter-operator\"\n [attr.aria-label]=\"operatorAriaLabel()\"\n [rtMod]=\"{ set: clearable() }\"\n [rtPopover]=\"operatorsTpl\">\n {{ operatorLabel() }}\n </button>\n\n <!--\n Набранное уходит наружу по уходу из поля и по Enter, а не по каждому знаку: набор условий,\n уходящий на букву, спрашивает сервер по букве. Выбор и дата сообщают сами — у них\n недописанного состояния нет.\n -->\n <div rtElem=\"value\" qa-dataid=\"table-filter-value\">\n @switch (columnFilter.kind) {\n @case ('number') {\n <rt-input-number\n qa-dataid=\"table-filter-number\"\n size=\"sm\"\n [placeholder]=\"valueLabel()\"\n [clearable]=\"false\"\n [formControl]=\"control\"\n (focusout)=\"onCommit()\"\n (keydown.enter)=\"onCommit()\" />\n }\n\n @case ('select') {\n <rt-select\n qa-dataid=\"table-filter-select\"\n size=\"sm\"\n [placeholder]=\"chooseLabel()\"\n [clearable]=\"false\"\n [options]=\"options()\"\n [formControl]=\"control\" />\n }\n\n @case ('date') {\n <rt-date-picker qa-dataid=\"table-filter-date\" size=\"sm\" [clearable]=\"false\" [formControl]=\"control\" />\n }\n\n @default {\n <rt-input\n qa-dataid=\"table-filter-text\"\n size=\"sm\"\n [placeholder]=\"valueLabel()\"\n [clearable]=\"false\"\n [formControl]=\"control\"\n (focusout)=\"onCommit()\"\n (keydown.enter)=\"onCommit()\" />\n }\n }\n </div>\n\n <!-- Очистка стоит в разметке только там, где есть что очищать. -->\n @if (clearable()) {\n <rt-icon-button\n rtElem=\"clear\"\n qa-dataid=\"table-filter-clear\"\n variant=\"ghost\"\n icon=\"ico-close\"\n size=\"sm\"\n [ariaLabel]=\"clearLabel()\"\n (clicked)=\"onClear()\" />\n }\n\n <ng-template #operatorsTpl>\n <div rtElem=\"operators\" qa-dataid=\"table-filter-operators\" role=\"menu\">\n @for (view of operatorViews(); track view.type) {\n <rt-menu-item qa-dataid=\"table-filter-operator-item\" [label]=\"view.label\" (selected)=\"onOperator(view.type)\" />\n }\n </div>\n </ng-template>\n }\n</ng-container>\n",
699
+ styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-table-filter-header{--rt-table-filter-header-radius: var(--rt-radius-sm);--rt-table-filter-header-operator-color: var(--rt-color-text-muted);--rt-table-filter-header-operator-color-set: var(--rt-color-text-primary);--rt-table-filter-header-operator-bg-hover: var(--rt-color-bg-subtle);--rt-table-filter-header-operator-focus-shadow: var(--rt-shadow-focus-ring);display:flex;width:100%;min-width:0;align-items:center;gap:var(--rt-space-1)}.rt-table-filter-header__operator{padding:var(--rt-space-0-5) var(--rt-space-1);border:0;border-radius:var(--rt-table-filter-header-radius);background:transparent;color:var(--rt-table-filter-header-operator-color);cursor:pointer;font-family:inherit;font-size:var(--rt-text-xs);white-space:nowrap}.rt-table-filter-header__operator:hover{background:var(--rt-table-filter-header-operator-bg-hover)}.rt-table-filter-header__operator:focus-visible{box-shadow:var(--rt-table-filter-header-operator-focus-shadow);outline:none}.rt-table-filter-header__operator--set{color:var(--rt-table-filter-header-operator-color-set);font-weight:var(--rt-font-weight-medium)}.rt-table-filter-header__value{min-width:0;flex:1 1 auto}.rt-table-filter-header__clear{flex:none}.rt-table-filter-header__operators{--rt-table-filter-header-menu-radius: var(--rt-radius-md);--rt-table-filter-header-menu-shadow: var(--rt-shadow-card);display:flex;flex-direction:column;padding:var(--rt-space-1);border-radius:var(--rt-table-filter-header-menu-radius);background:var(--rt-color-bg-surface);box-shadow:var(--rt-table-filter-header-menu-shadow)}}\n"]
700
+ }]
701
+ }],
702
+ ctorParameters: () => [],
703
+ propDecorators: {
704
+ operatorPopover: [{
705
+ type: i0.ViewChild,
706
+ args: [i0.forwardRef(() => RtPopoverDirective), { isSignal: true }]
707
+ }],
708
+ propertyName: [{
709
+ type: i0.Input,
710
+ args: [{
711
+ isSignal: true,
712
+ alias: "propertyName",
713
+ required: true
714
+ }]
715
+ }],
716
+ filter: [{
717
+ type: i0.Input,
718
+ args: [{
719
+ isSignal: true,
720
+ alias: "filter",
721
+ required: false
722
+ }]
723
+ }],
724
+ filters: [{
725
+ type: i0.Input,
726
+ args: [{
727
+ isSignal: true,
728
+ alias: "filters",
729
+ required: false
730
+ }]
731
+ }],
732
+ filtersChange: [{
733
+ type: i0.Output,
734
+ args: ["filtersChange"]
735
+ }]
736
+ }
737
+ });
738
+ var RtTableCardDirective = class RtTableCardDirective {
739
+ constructor() {
740
+ this.template = inject(TemplateRef);
741
+ this.rtTableCardRowType = input([], ...ngDevMode ? [{ debugName: "rtTableCardRowType" }] : /* istanbul ignore next */ []);
742
+ }
743
+ static ngTemplateContextGuard(_directive, context) {
744
+ return true;
745
+ }
746
+ static {
747
+ this.ɵfac = i0.ɵɵngDeclareFactory({
748
+ minVersion: "12.0.0",
749
+ version: "22.2.2",
750
+ ngImport: i0,
751
+ type: RtTableCardDirective,
752
+ deps: [],
753
+ target: i0.ɵɵFactoryTarget.Directive
754
+ });
755
+ }
756
+ static {
757
+ this.ɵdir = i0.ɵɵngDeclareDirective({
758
+ minVersion: "17.1.0",
759
+ version: "22.2.2",
760
+ type: RtTableCardDirective,
761
+ isStandalone: true,
762
+ selector: "ng-template[rtTableCard]",
763
+ inputs: { rtTableCardRowType: {
764
+ classPropertyName: "rtTableCardRowType",
765
+ publicName: "rtTableCardRowType",
766
+ isSignal: true,
767
+ isRequired: false,
768
+ transformFunction: null
769
+ } },
770
+ ngImport: i0
771
+ });
772
+ }
773
+ };
774
+ i0.ɵɵngDeclareClassMetadata({
775
+ minVersion: "12.0.0",
776
+ version: "22.2.2",
777
+ ngImport: i0,
778
+ type: RtTableCardDirective,
779
+ decorators: [{
780
+ type: Directive,
781
+ args: [{ selector: "ng-template[rtTableCard]" }]
782
+ }],
783
+ propDecorators: { rtTableCardRowType: [{
784
+ type: i0.Input,
785
+ args: [{
786
+ isSignal: true,
787
+ alias: "rtTableCardRowType",
788
+ required: false
789
+ }]
790
+ }] }
791
+ });
628
792
  function cardRowsOf(dataSource) {
629
- return Array.isArray(dataSource) ? dataSource : [];
793
+ return Array.isArray(dataSource) ? dataSource : [];
630
794
  }
631
- /**
632
- * Есть ли строки в источнике данных. CdkTable принимает массив, поток и свой объект — точно
633
- * ответить можно только про массив. Для остальных ответ `true`: заглушку «пусто» и скелет там не
634
- * показываем, раз не можем знать наверняка.
635
- */
636
795
  function hasRowsIn(dataSource) {
637
- return Array.isArray(dataSource) ? dataSource.length > 0 : true;
796
+ return Array.isArray(dataSource) ? dataSource.length > 0 : true;
638
797
  }
639
- /**
640
- * Поля авто-карточки: видимые колонки, кроме колонки действий, с подписью из конфига и
641
- * шаблоном ячейки из объявления колонки. Колонка без шаблона ячейки пропускается — рисовать
642
- * её значение нечем.
643
- */
644
798
  function cardColumnsOf(displayedColumns, columnDefs, columnsConfig) {
645
- const defsByName = new Map(columnDefs.map((def) => [def.name, def]));
646
- const labelByKey = new Map(columnsConfig.map((column) => [column.key, column.label]));
647
- return displayedColumns
648
- .filter((key) => key !== RT_TABLE_ROW_ACTIONS_COLUMN)
649
- .map((key) => {
650
- const cell = defsByName.get(key)?.cell?.template;
651
- return cell === undefined ? null : { key, cell, label: labelByKey.get(key) ?? key };
652
- })
653
- .filter((column) => column !== null);
799
+ const defsByName = new Map(columnDefs.map((def) => [def.name, def]));
800
+ const labelByKey = new Map(columnsConfig.map((column) => [column.key, column.label]));
801
+ return displayedColumns.filter((key) => key !== RT_TABLE_ROW_ACTIONS_COLUMN).map((key) => {
802
+ const cell = defsByName.get(key)?.cell?.template;
803
+ return cell === void 0 ? null : {
804
+ key,
805
+ cell,
806
+ label: labelByKey.get(key) ?? key
807
+ };
808
+ }).filter((column) => column !== null);
654
809
  }
655
-
656
- /**
657
- * Узлы, нажатие по которым — своё действие, а не открытие строки или карточки: кнопка, ссылка,
658
- * поле и узлы с ролью кнопки или переключателя.
659
- */
660
810
  const INTERACTIVE_SELECTOR = "button, a, input, select, textarea, label, [role='button'], [role='switch']";
661
- /**
662
- * Пришло ли событие из интерактивного узла внутри строки или карточки. Такое нажатие открытием
663
- * не считается — иначе вложенные действия спорили бы с переходом к записи.
664
- */
665
811
  function isFromInteractive(target) {
666
- return target instanceof Element && target.closest(INTERACTIVE_SELECTOR) !== null;
812
+ return target instanceof Element && target.closest(INTERACTIVE_SELECTOR) !== null;
667
813
  }
668
- /**
669
- * Строка таблицы, которую показывает карточка с этим номером. Карточки строятся из того же массива,
670
- * что и строки, и в том же порядке, поэтому номер карточки — номер строки. Строки вложенной
671
- * таблицы в счёт не идут: берутся только строки, чья ближайшая таблица — эта.
672
- */
673
814
  function cardRowOf(host, index) {
674
- const rows = Array.from(host.querySelectorAll('.cdk-row')).filter((row) => row.parentElement?.closest('rt-table, table[rt-table]') === host);
675
- return rows[index] ?? null;
676
- }
677
-
678
- /** Один обработчик на нажатие, Enter и пробел */
679
- const ACTIVATE = 'activate($event)';
680
- /**
681
- * Нажатие на карточку узкого экрана открывает запись так же, как нажатие на строку. Своего выхода у
682
- * карточки нет: нажатие, Enter и пробел уходят спрятанной строке с тем же номером, и срабатывает
683
- * тот же `(activated)`, что приложение вешает на строку через `rtTableRow`. Нажатие по кнопке,
684
- * ссылке или полю внутри карточки открытием не считается.
685
- *
686
- * Карточка отзывается и берёт фокус только при `clickable` таблицы — тот же вход включает вид
687
- * кликабельной строки.
688
- */
689
- class RtTableCardActivationDirective {
690
- constructor() {
691
- this.#card = inject(ElementRef).nativeElement;
692
- /** Номер карточки — он же номер строки, которую она показывает */
693
- this.rtTableCardActivation = input.required(/* @ts-ignore */
694
- ...(ngDevMode ? [{ debugName: "rtTableCardActivation" }] : /* istanbul ignore next */ []));
695
- /** Карточка отзывается на нажатие */
696
- this.rtTableCardActivationEnabled = input(false, { ...(ngDevMode ? { debugName: "rtTableCardActivationEnabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
697
- }
698
- #card;
699
- activate(event) {
700
- if (!this.rtTableCardActivationEnabled() || isFromInteractive(event.target)) {
701
- return;
702
- }
703
- if (event instanceof KeyboardEvent) {
704
- // Пробел иначе проскроллит страницу
705
- event.preventDefault();
706
- }
707
- const host = this.#card.closest('rt-table, table[rt-table]');
708
- if (host !== null) {
709
- cardRowOf(host, this.rtTableCardActivation())?.click();
710
- }
711
- }
712
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtTableCardActivationDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
713
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.6", type: RtTableCardActivationDirective, isStandalone: true, selector: "[rtTableCardActivation]", inputs: { rtTableCardActivation: { classPropertyName: "rtTableCardActivation", publicName: "rtTableCardActivation", isSignal: true, isRequired: true, transformFunction: null }, rtTableCardActivationEnabled: { classPropertyName: "rtTableCardActivationEnabled", publicName: "rtTableCardActivationEnabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "activate($event)", "keydown.enter": "activate($event)", "keydown.space": "activate($event)" }, properties: { "attr.tabindex": "rtTableCardActivationEnabled() ? 0 : null" } }, ngImport: i0 }); }
815
+ return Array.from(host.querySelectorAll(".cdk-row")).filter((row) => row.parentElement?.closest("rt-table, table[rt-table]") === host)[index] ?? null;
714
816
  }
715
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtTableCardActivationDirective, decorators: [{
716
- type: Directive,
717
- args: [{
718
- selector: '[rtTableCardActivation]',
719
- host: {
720
- '[attr.tabindex]': 'rtTableCardActivationEnabled() ? 0 : null',
721
- '(click)': ACTIVATE,
722
- '(keydown.enter)': ACTIVATE,
723
- '(keydown.space)': ACTIVATE,
724
- },
725
- }]
726
- }], propDecorators: { rtTableCardActivation: [{ type: i0.Input, args: [{ isSignal: true, alias: "rtTableCardActivation", required: true }] }], rtTableCardActivationEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "rtTableCardActivationEnabled", required: false }] }] } });
727
-
728
- /**
729
- * Захватывает `<ng-template rtTableRowActions let-row>` — содержимое «…»-меню
730
- * действий строки. `rt-table` (`[showRowActions]`) рендерит этот шаблон в конце
731
- * каждой строки внутри `rt-menu`, прокидывая строку через `$implicit`.
732
- *
733
- * Тип `let-row` выводится из `[rtTableRowActionsRowType]` (передаётся тот же
734
- * массив, что в `dataSource`) — type-carrier, как `*ngFor` выводит тип из
735
- * `ngForOf`. В рантайме значение не используется.
736
- *
737
- * @example
738
- * ```html
739
- * <rt-table #t="rtTable" [columns]="cols" [showRowActions]="true" [dataSource]="rows" ...>
740
- * ...колонки...
741
- * <ng-template rtTableRowActions [rtTableRowActionsRowType]="rows" let-row>
742
- * <rt-menu-item icon="ico-edit" label="Редактировать" (selected)="edit(row)" />
743
- * </ng-template>
744
- * <tr cdk-header-row *cdkHeaderRowDef="t.displayedColumns()"></tr>
745
- * <tr cdk-row *cdkRowDef="let row; columns: t.displayedColumns()"></tr>
746
- * </rt-table>
747
- * ```
748
- */
749
- class RtTableRowActionsDirective {
750
- constructor() {
751
- this.template = inject(TemplateRef);
752
- /**
753
- * Type-carrier для вывода `TRow`: биндят тот же массив, что в `dataSource`.
754
- * Значение в рантайме не читается — служит только подсказкой типизации для
755
- * `let-row` (через `ngTemplateContextGuard`). Имя совпадает с binding'ом —
756
- * без alias, чтобы не триггерить `no-input-rename`.
757
- */
758
- this.rtTableRowActionsRowType = input([], /* @ts-ignore */
759
- ...(ngDevMode ? [{ debugName: "rtTableRowActionsRowType" }] : /* istanbul ignore next */ []));
760
- }
761
- /** Type-guard: сужает контекст шаблона до строки таблицы при проверке шаблонов. */
762
- static ngTemplateContextGuard(_directive,
763
- // eslint-disable-next-line @typescript-eslint/no-unused-vars -- второй довод стража контекста шаблона стоит только в типе-предикате; убрать его нечем, подпись задаёт каркас
764
- context) {
765
- return true;
766
- }
767
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtTableRowActionsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
768
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.6", type: RtTableRowActionsDirective, isStandalone: true, selector: "ng-template[rtTableRowActions]", inputs: { rtTableRowActionsRowType: { classPropertyName: "rtTableRowActionsRowType", publicName: "rtTableRowActionsRowType", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
769
- }
770
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtTableRowActionsDirective, decorators: [{
771
- type: Directive,
772
- args: [{
773
- selector: 'ng-template[rtTableRowActions]',
774
- }]
775
- }], propDecorators: { rtTableRowActionsRowType: [{ type: i0.Input, args: [{ isSignal: true, alias: "rtTableRowActionsRowType", required: false }] }] } });
776
-
777
- /**
778
- * Есть ли у строки хотя бы одно доступное действие.
779
- *
780
- * Признак приходит предикатом от экрана, а не подсчётом отрисованных пунктов меню:
781
- * содержимое спроецированного шаблона известно только после отрисовки, и кнопка
782
- * успевала бы мигнуть на первом кадре.
783
- *
784
- * Предикат не задан — у строки есть действия: экран, который ничего не гейтит,
785
- * показывает кнопку меню, как и раньше.
786
- */
817
+ const ACTIVATE = "activate($event)";
818
+ var RtTableCardActivationDirective = class RtTableCardActivationDirective {
819
+ constructor() {
820
+ this.#card = inject(ElementRef).nativeElement;
821
+ this.rtTableCardActivation = input.required(...ngDevMode ? [{ debugName: "rtTableCardActivation" }] : /* istanbul ignore next */ []);
822
+ this.rtTableCardActivationEnabled = input(false, {
823
+ ...ngDevMode ? { debugName: "rtTableCardActivationEnabled" } : /* istanbul ignore next */ {},
824
+ transform: booleanAttribute
825
+ });
826
+ }
827
+ #card;
828
+ activate(event) {
829
+ if (!this.rtTableCardActivationEnabled() || isFromInteractive(event.target)) return;
830
+ if (event instanceof KeyboardEvent) event.preventDefault();
831
+ const host = this.#card.closest("rt-table, table[rt-table]");
832
+ if (host !== null) cardRowOf(host, this.rtTableCardActivation())?.click();
833
+ }
834
+ static {
835
+ this.ɵfac = i0.ɵɵngDeclareFactory({
836
+ minVersion: "12.0.0",
837
+ version: "22.2.2",
838
+ ngImport: i0,
839
+ type: RtTableCardActivationDirective,
840
+ deps: [],
841
+ target: i0.ɵɵFactoryTarget.Directive
842
+ });
843
+ }
844
+ static {
845
+ this.ɵdir = i0.ɵɵngDeclareDirective({
846
+ minVersion: "17.1.0",
847
+ version: "22.2.2",
848
+ type: RtTableCardActivationDirective,
849
+ isStandalone: true,
850
+ selector: "[rtTableCardActivation]",
851
+ inputs: {
852
+ rtTableCardActivation: {
853
+ classPropertyName: "rtTableCardActivation",
854
+ publicName: "rtTableCardActivation",
855
+ isSignal: true,
856
+ isRequired: true,
857
+ transformFunction: null
858
+ },
859
+ rtTableCardActivationEnabled: {
860
+ classPropertyName: "rtTableCardActivationEnabled",
861
+ publicName: "rtTableCardActivationEnabled",
862
+ isSignal: true,
863
+ isRequired: false,
864
+ transformFunction: null
865
+ }
866
+ },
867
+ host: {
868
+ listeners: {
869
+ "click": "activate($event)",
870
+ "keydown.enter": "activate($event)",
871
+ "keydown.space": "activate($event)"
872
+ },
873
+ properties: { "attr.tabindex": "rtTableCardActivationEnabled() ? 0 : null" }
874
+ },
875
+ ngImport: i0
876
+ });
877
+ }
878
+ };
879
+ i0.ɵɵngDeclareClassMetadata({
880
+ minVersion: "12.0.0",
881
+ version: "22.2.2",
882
+ ngImport: i0,
883
+ type: RtTableCardActivationDirective,
884
+ decorators: [{
885
+ type: Directive,
886
+ args: [{
887
+ selector: "[rtTableCardActivation]",
888
+ host: {
889
+ "[attr.tabindex]": "rtTableCardActivationEnabled() ? 0 : null",
890
+ "(click)": ACTIVATE,
891
+ "(keydown.enter)": ACTIVATE,
892
+ "(keydown.space)": ACTIVATE
893
+ }
894
+ }]
895
+ }],
896
+ propDecorators: {
897
+ rtTableCardActivation: [{
898
+ type: i0.Input,
899
+ args: [{
900
+ isSignal: true,
901
+ alias: "rtTableCardActivation",
902
+ required: true
903
+ }]
904
+ }],
905
+ rtTableCardActivationEnabled: [{
906
+ type: i0.Input,
907
+ args: [{
908
+ isSignal: true,
909
+ alias: "rtTableCardActivationEnabled",
910
+ required: false
911
+ }]
912
+ }]
913
+ }
914
+ });
915
+ var RtTableRowActionsDirective = class RtTableRowActionsDirective {
916
+ constructor() {
917
+ this.template = inject(TemplateRef);
918
+ this.rtTableRowActionsRowType = input([], ...ngDevMode ? [{ debugName: "rtTableRowActionsRowType" }] : /* istanbul ignore next */ []);
919
+ }
920
+ static ngTemplateContextGuard(_directive, context) {
921
+ return true;
922
+ }
923
+ static {
924
+ this.ɵfac = i0.ɵɵngDeclareFactory({
925
+ minVersion: "12.0.0",
926
+ version: "22.2.2",
927
+ ngImport: i0,
928
+ type: RtTableRowActionsDirective,
929
+ deps: [],
930
+ target: i0.ɵɵFactoryTarget.Directive
931
+ });
932
+ }
933
+ static {
934
+ this.ɵdir = i0.ɵɵngDeclareDirective({
935
+ minVersion: "17.1.0",
936
+ version: "22.2.2",
937
+ type: RtTableRowActionsDirective,
938
+ isStandalone: true,
939
+ selector: "ng-template[rtTableRowActions]",
940
+ inputs: { rtTableRowActionsRowType: {
941
+ classPropertyName: "rtTableRowActionsRowType",
942
+ publicName: "rtTableRowActionsRowType",
943
+ isSignal: true,
944
+ isRequired: false,
945
+ transformFunction: null
946
+ } },
947
+ ngImport: i0
948
+ });
949
+ }
950
+ };
951
+ i0.ɵɵngDeclareClassMetadata({
952
+ minVersion: "12.0.0",
953
+ version: "22.2.2",
954
+ ngImport: i0,
955
+ type: RtTableRowActionsDirective,
956
+ decorators: [{
957
+ type: Directive,
958
+ args: [{ selector: "ng-template[rtTableRowActions]" }]
959
+ }],
960
+ propDecorators: { rtTableRowActionsRowType: [{
961
+ type: i0.Input,
962
+ args: [{
963
+ isSignal: true,
964
+ alias: "rtTableRowActionsRowType",
965
+ required: false
966
+ }]
967
+ }] }
968
+ });
787
969
  function rowHasAvailableActions(row, hasActions) {
788
- return hasActions === null ? true : hasActions(row);
789
- }
790
-
791
- /**
792
- * Есть ли у строки доступные действия — гейт кнопки «…» в ячейке действий.
793
- *
794
- * Pure-pipe: пересчитывается только при смене строки или предиката, а не на каждом
795
- * цикле проверки. Значение приходит из контекста шаблона (строка таблицы), поэтому
796
- * `computed()` здесь неприменим.
797
- */
798
- class RtRowHasActionsPipe {
799
- transform(row, hasActions) {
800
- return rowHasAvailableActions(row, hasActions);
801
- }
802
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtRowHasActionsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
803
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.6", ngImport: i0, type: RtRowHasActionsPipe, isStandalone: true, name: "rtRowHasActions" }); }
970
+ return hasActions === null ? true : hasActions(row);
804
971
  }
805
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtRowHasActionsPipe, decorators: [{
806
- type: Pipe,
807
- args: [{ name: 'rtRowHasActions' }]
808
- }] });
809
-
810
- /** Ключ настроек одной таблицы в хранилище браузера. */
972
+ var RtRowHasActionsPipe = class RtRowHasActionsPipe {
973
+ transform(row, hasActions) {
974
+ return rowHasAvailableActions(row, hasActions);
975
+ }
976
+ static {
977
+ this.ɵfac = i0.ɵɵngDeclareFactory({
978
+ minVersion: "12.0.0",
979
+ version: "22.2.2",
980
+ ngImport: i0,
981
+ type: RtRowHasActionsPipe,
982
+ deps: [],
983
+ target: i0.ɵɵFactoryTarget.Pipe
984
+ });
985
+ }
986
+ static {
987
+ this.ɵpipe = i0.ɵɵngDeclarePipe({
988
+ minVersion: "14.0.0",
989
+ version: "22.2.2",
990
+ ngImport: i0,
991
+ type: RtRowHasActionsPipe,
992
+ isStandalone: true,
993
+ name: "rtRowHasActions"
994
+ });
995
+ }
996
+ };
997
+ i0.ɵɵngDeclareClassMetadata({
998
+ minVersion: "12.0.0",
999
+ version: "22.2.2",
1000
+ ngImport: i0,
1001
+ type: RtRowHasActionsPipe,
1002
+ decorators: [{
1003
+ type: Pipe,
1004
+ args: [{ name: "rtRowHasActions" }]
1005
+ }]
1006
+ });
811
1007
  function settingsKey(tableId) {
812
- return `${ERtStorageKeys.TableColumnsPrefix}${tableId}`;
1008
+ return `${ERtStorageKeys.TableColumnsPrefix}${tableId}`;
813
1009
  }
814
- /**
815
- * Хранение настроек колонок одной таблицы.
816
- *
817
- * Запись объявлена одним потоком, а не подпиской в методе: запросы приходят по одному на
818
- * каждое движение панели настроек, и каждый из них — своя независимая запись. Зависимости
819
- * приходят доводами, потому что заводится это в конструкторе компонента, где внедрение уже
820
- * доступно, а сам класс службой не объявлен — он живёт ровно столько, сколько таблица.
821
- */
822
- class RtTableSettingsPersistence {
823
- #storage;
824
- #requestsSource = new Subject();
825
- constructor(storage, destroyRef) {
826
- this.#storage = storage;
827
- this.#requestsSource
828
- .pipe(mergeMap((request) => this.#storage.set(settingsKey(request.tableId), request.settings)), takeUntilDestroyed(destroyRef))
829
- .subscribe();
830
- }
831
- /** Сохранённые настройки этой таблицы. Записи может не быть — тогда применять нечего. */
832
- load(tableId) {
833
- return this.#storage.get(settingsKey(tableId));
834
- }
835
- /** Кладёт настройки в очередь записи: сама запись идёт объявленным потоком. */
836
- save(tableId, settings) {
837
- this.#requestsSource.next({ tableId, settings });
838
- }
839
- }
840
-
841
- /**
842
- * Реестр настраиваемых таблиц — мост между `rt-table` (shared UI) и route-асайдом
843
- * настроек колонок, которые живут в разных ветках дерева и не видят друг друга
844
- * напрямую. `rt-table` регистрируется по `tableId` на init, снимается на destroy;
845
- * асайд читает регистрацию активной таблицы (`active()` выставляется при открытии).
846
- *
847
- * Реестр реактивный (`Map` живёт в сигнале): при F5 route-асайд инициализируется
848
- * раньше `rt-table`, и синхронный промах по пустому реестру не должен быть
849
- * финальным — асайд дожидается регистрации через `effect` (фикс F-16).
850
- */
851
- class RtTableSettingsRegistry {
852
- constructor() {
853
- this.#registrations = signal(new Map(), /* @ts-ignore */
854
- ...(ngDevMode ? [{ debugName: "#registrations" }] : /* istanbul ignore next */ []));
855
- this.#active = signal(null, /* @ts-ignore */
856
- ...(ngDevMode ? [{ debugName: "#active" }] : /* istanbul ignore next */ []));
857
- /** Id таблицы, чьи настройки сейчас открыты в асайде (или `null`). */
858
- this.active = this.#active.asReadonly();
859
- /**
860
- * Id единственной зарегистрированной таблицы (или `null`, если их 0 или >1).
861
- * Нужен асайду для восстановления `active` после F5: сервис пересоздан,
862
- * `setActive` никто не звал, но открытая страница регистрирует ровно
863
- * одну настраиваемую таблицу.
864
- */
865
- this.soleTableId = computed(() => {
866
- const registrations = this.#registrations();
867
- if (registrations.size !== 1) {
868
- return null;
869
- }
870
- const first = registrations.keys().next().value;
871
- return first ?? null;
872
- }, /* @ts-ignore */
873
- ...(ngDevMode ? [{ debugName: "soleTableId" }] : /* istanbul ignore next */ []));
874
- }
875
- #registrations;
876
- #active;
877
- register(tableId, registration) {
878
- this.#registrations.update((current) => {
879
- const next = new Map(current);
880
- next.set(tableId, registration);
881
- return next;
882
- });
883
- }
884
- unregister(tableId) {
885
- this.#registrations.update((current) => {
886
- const next = new Map(current);
887
- next.delete(tableId);
888
- return next;
889
- });
890
- if (this.#active() === tableId) {
891
- this.#active.set(null);
892
- }
893
- }
894
- /** Реактивная регистрация таблицы: `null`, пока таблица не зарегистрировалась. */
895
- get(tableId) {
896
- return computed(() => this.#registrations().get(tableId) ?? null);
897
- }
898
- setActive(tableId) {
899
- this.#active.set(tableId);
900
- }
901
- clearActive() {
902
- this.#active.set(null);
903
- }
904
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtTableSettingsRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
905
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtTableSettingsRegistry, providedIn: 'root' }); }
906
- }
907
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtTableSettingsRegistry, decorators: [{
908
- type: Injectable,
909
- args: [{ providedIn: 'root' }]
910
- }] });
911
-
912
- /**
913
- * Настройка колонок одной таблицы: применённые настройки, объявление реестру, загрузка и запись.
914
- *
915
- * Лежит отдельно от компонента: это целое со своим состоянием, а компонент только отдаёт ему свои
916
- * входы и зовёт на старте и в конце жизни. Входы приезжают функциями, а не сигналами: поле с
917
- * этим классом заводится раньше, чем поля входов компонента, и читать их можно только позже.
918
- * Внедрение зовётся в конструкторе — класс заводится полем компонента, где оно доступно.
919
- * Подписку на сохранённые настройки держит компонент: подписка в методе здесь запрещена.
920
- */
921
- class RtTableColumnSettings {
922
- #registry;
923
- #persistence;
924
- #config;
925
- #tableId;
926
- /** Настройки колонок, применённые поверх конфига; `null` — умолчания конфига. */
927
- #applied;
928
- /** Колонки конфига без настроек пользователя — с них панель начинает после сброса. */
929
- #defaults;
930
- /** Ключ записи настроек. `null` — таблица не настраиваемая: нет ключа или конфига. */
931
- #persistableTableId;
932
- constructor(config, tableId) {
933
- this.#registry = inject(RtTableSettingsRegistry);
934
- this.#persistence = new RtTableSettingsPersistence(inject(IDBStorageService), inject(DestroyRef));
935
- /** Настройки колонок, применённые поверх конфига; `null` — умолчания конфига. */
936
- this.#applied = signal(null, /* @ts-ignore */
937
- ...(ngDevMode ? [{ debugName: "#applied" }] : /* istanbul ignore next */ []));
938
- /** Колонки конфига без настроек пользователя — с них панель начинает после сброса. */
939
- this.#defaults = computed(() => defaultColumnItems(this.#config()), /* @ts-ignore */
940
- ...(ngDevMode ? [{ debugName: "#defaults" }] : /* istanbul ignore next */ []));
941
- /** Ключ записи настроек. `null` — таблица не настраиваемая: нет ключа или конфига. */
942
- this.#persistableTableId = computed(() => {
943
- const id = this.#tableId();
944
- return id !== null && this.#config().length > 0 ? id : null;
945
- }, /* @ts-ignore */
946
- ...(ngDevMode ? [{ debugName: "#persistableTableId" }] : /* istanbul ignore next */ []));
947
- /** Разрешённые колонки в применённом порядке, с текущим признаком скрытости. */
948
- this.resolved = computed(() => resolveColumns(this.#config(), this.#applied()), /* @ts-ignore */
949
- ...(ngDevMode ? [{ debugName: "resolved" }] : /* istanbul ignore next */ []));
950
- /** Таблица настраиваемая: есть и конфиг колонок, и ключ таблицы. */
951
- this.canConfigure = computed(() => this.#config().length > 0 && this.#tableId() !== null, /* @ts-ignore */
952
- ...(ngDevMode ? [{ debugName: "canConfigure" }] : /* istanbul ignore next */ []));
953
- this.#config = config;
954
- this.#tableId = tableId;
955
- }
956
- /** Объявить таблицу реестру: с этой минуты её настраивает панель. */
957
- start() {
958
- this.#register();
959
- }
960
- /**
961
- * Сохранённые настройки таблицы. У ненастраиваемой таблицы и у таблицы без записи поток пуст:
962
- * применять нечего. Подписывается компонент — на старте своей жизни.
963
- */
964
- saved() {
965
- const persistedTableId = this.#persistableTableId();
966
- if (persistedTableId === null) {
967
- return EMPTY;
968
- }
969
- return this.#persistence
970
- .load(persistedTableId)
971
- .pipe(filter((settings) => settings !== undefined));
972
- }
973
- /** Снять таблицу с реестра в конце её жизни. */
974
- stop() {
975
- const tableId = this.#tableId();
976
- if (tableId !== null) {
977
- this.#registry.unregister(tableId);
978
- }
979
- }
980
- /** Применить настройки: закреплённые колонки скрыть нельзя. */
981
- apply(settings) {
982
- this.#applied.set(withoutLockedHidden(this.#config(), settings));
983
- }
984
- /**
985
- * Объявляет таблицу реестру: её колонки, умолчания и приём применения настроек. Реестр —
986
- * мост к панели настроек, которую потребитель открывает переходом по адресу.
987
- */
988
- #register() {
989
- const tableId = this.#tableId();
990
- if (tableId === null || !this.canConfigure()) {
991
- return;
992
- }
993
- const registration = {
994
- columns: this.resolved,
995
- defaults: this.#defaults,
996
- apply: (settings) => {
997
- this.apply(settings);
998
- this.#persist(settings);
999
- },
1000
- };
1001
- this.#registry.register(tableId, registration);
1002
- }
1003
- /** Сохраняет настройки колонок у настраиваемой таблицы; у прочих сохранять нечего. */
1004
- #persist(settings) {
1005
- const tableId = this.#persistableTableId();
1006
- if (tableId !== null) {
1007
- this.#persistence.save(tableId, settings);
1008
- }
1009
- }
1010
- }
1011
-
1012
- const BEM_BLOCK$3 = 'rt-table';
1010
+ var RtTableSettingsPersistence = class {
1011
+ #storage;
1012
+ #requestsSource = new Subject();
1013
+ constructor(storage, destroyRef) {
1014
+ this.#storage = storage;
1015
+ this.#requestsSource.pipe(mergeMap((request) => this.#storage.set(settingsKey(request.tableId), request.settings)), takeUntilDestroyed(destroyRef)).subscribe();
1016
+ }
1017
+ load(tableId) {
1018
+ return this.#storage.get(settingsKey(tableId));
1019
+ }
1020
+ save(tableId, settings) {
1021
+ this.#requestsSource.next({
1022
+ tableId,
1023
+ settings
1024
+ });
1025
+ }
1026
+ };
1027
+ var RtTableSettingsRegistry = class RtTableSettingsRegistry {
1028
+ constructor() {
1029
+ this.#registrations = signal(/* @__PURE__ */ new Map(), ...ngDevMode ? [{ debugName: "#registrations" }] : /* istanbul ignore next */ []);
1030
+ this.#active = signal(null, ...ngDevMode ? [{ debugName: "#active" }] : /* istanbul ignore next */ []);
1031
+ this.active = this.#active.asReadonly();
1032
+ this.soleTableId = computed(() => {
1033
+ const registrations = this.#registrations();
1034
+ if (registrations.size !== 1) return null;
1035
+ return registrations.keys().next().value ?? null;
1036
+ }, ...ngDevMode ? [{ debugName: "soleTableId" }] : /* istanbul ignore next */ []);
1037
+ }
1038
+ #registrations;
1039
+ #active;
1040
+ register(tableId, registration) {
1041
+ this.#registrations.update((current) => {
1042
+ const next = new Map(current);
1043
+ next.set(tableId, registration);
1044
+ return next;
1045
+ });
1046
+ }
1047
+ unregister(tableId) {
1048
+ this.#registrations.update((current) => {
1049
+ const next = new Map(current);
1050
+ next.delete(tableId);
1051
+ return next;
1052
+ });
1053
+ if (this.#active() === tableId) this.#active.set(null);
1054
+ }
1055
+ get(tableId) {
1056
+ return computed(() => this.#registrations().get(tableId) ?? null);
1057
+ }
1058
+ setActive(tableId) {
1059
+ this.#active.set(tableId);
1060
+ }
1061
+ clearActive() {
1062
+ this.#active.set(null);
1063
+ }
1064
+ static {
1065
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1066
+ minVersion: "12.0.0",
1067
+ version: "22.2.2",
1068
+ ngImport: i0,
1069
+ type: RtTableSettingsRegistry,
1070
+ deps: [],
1071
+ target: i0.ɵɵFactoryTarget.Injectable
1072
+ });
1073
+ }
1074
+ static {
1075
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
1076
+ minVersion: "12.0.0",
1077
+ version: "22.2.2",
1078
+ ngImport: i0,
1079
+ type: RtTableSettingsRegistry,
1080
+ providedIn: "root"
1081
+ });
1082
+ }
1083
+ };
1084
+ i0.ɵɵngDeclareClassMetadata({
1085
+ minVersion: "12.0.0",
1086
+ version: "22.2.2",
1087
+ ngImport: i0,
1088
+ type: RtTableSettingsRegistry,
1089
+ decorators: [{
1090
+ type: Injectable,
1091
+ args: [{ providedIn: "root" }]
1092
+ }]
1093
+ });
1094
+ var RtTableColumnSettings = class {
1095
+ #registry;
1096
+ #persistence;
1097
+ #config;
1098
+ #tableId;
1099
+ #applied;
1100
+ #defaults;
1101
+ #persistableTableId;
1102
+ constructor(config, tableId) {
1103
+ this.#registry = inject(RtTableSettingsRegistry);
1104
+ this.#persistence = new RtTableSettingsPersistence(inject(IDBStorageService), inject(DestroyRef));
1105
+ this.#applied = signal(null, ...ngDevMode ? [{ debugName: "#applied" }] : /* istanbul ignore next */ []);
1106
+ this.#defaults = computed(() => defaultColumnItems(this.#config()), ...ngDevMode ? [{ debugName: "#defaults" }] : /* istanbul ignore next */ []);
1107
+ this.#persistableTableId = computed(() => {
1108
+ const id = this.#tableId();
1109
+ return id !== null && this.#config().length > 0 ? id : null;
1110
+ }, ...ngDevMode ? [{ debugName: "#persistableTableId" }] : /* istanbul ignore next */ []);
1111
+ this.resolved = computed(() => resolveColumns(this.#config(), this.#applied()), ...ngDevMode ? [{ debugName: "resolved" }] : /* istanbul ignore next */ []);
1112
+ this.canConfigure = computed(() => this.#config().length > 0 && this.#tableId() !== null, ...ngDevMode ? [{ debugName: "canConfigure" }] : /* istanbul ignore next */ []);
1113
+ this.#config = config;
1114
+ this.#tableId = tableId;
1115
+ }
1116
+ start() {
1117
+ this.#register();
1118
+ }
1119
+ saved() {
1120
+ const persistedTableId = this.#persistableTableId();
1121
+ if (persistedTableId === null) return EMPTY;
1122
+ return this.#persistence.load(persistedTableId).pipe(filter((settings) => settings !== void 0));
1123
+ }
1124
+ stop() {
1125
+ const tableId = this.#tableId();
1126
+ if (tableId !== null) this.#registry.unregister(tableId);
1127
+ }
1128
+ apply(settings) {
1129
+ this.#applied.set(withoutLockedHidden(this.#config(), settings));
1130
+ }
1131
+ #register() {
1132
+ const tableId = this.#tableId();
1133
+ if (tableId === null || !this.canConfigure()) return;
1134
+ const registration = {
1135
+ columns: this.resolved,
1136
+ defaults: this.#defaults,
1137
+ apply: (settings) => {
1138
+ this.apply(settings);
1139
+ this.#persist(settings);
1140
+ }
1141
+ };
1142
+ this.#registry.register(tableId, registration);
1143
+ }
1144
+ #persist(settings) {
1145
+ const tableId = this.#persistableTableId();
1146
+ if (tableId !== null) this.#persistence.save(tableId, settings);
1147
+ }
1148
+ };
1149
+ const BEM_BLOCK$3 = "rt-table";
1013
1150
  const DEFAULT_SKELETON_ROWS = 5;
1014
- /** Ключ подписи пустой таблицы: язык известен только после старта приложения */
1015
- const DEFAULT_EMPTY_KEY = 'uiNoRows';
1016
- /**
1017
- * Таблица — стилизованная обёртка над `cdk-table` (`@angular/cdk/table`).
1018
- *
1019
- * Селектор работает и как element (`<rt-table>`), и как attribute на native `<table rt-table>`.
1020
- * Native-вариант предпочтительнее — даёт правильную table-семантику для скрин-ридеров, но
1021
- * наложения загрузки, пустого места и заглушек требуют element-варианта: `<div>` не валиден как
1022
- * ребёнок `<table>`.
1023
- *
1024
- * Какие состояния таблица различает и чем рисует каждое — в заметке семьи рядом, `CONTEXT.md`.
1025
- */
1026
- class RtTableComponent extends CdkTable {
1027
- constructor() {
1028
- super(...arguments);
1029
- this.#t_uiNoRows = rtKitLabel(DEFAULT_EMPTY_KEY);
1030
- this.#destroyRef = inject(DestroyRef);
1031
- this.#breakpoints = inject(BreakpointsService);
1032
- this.#dataSourceVersion = signal(0, /* @ts-ignore */
1033
- ...(ngDevMode ? [{ debugName: "#dataSourceVersion" }] : /* istanbul ignore next */ []));
1034
- /**
1035
- * Выбранная сортировка. Заводится от входа `[sort]` и переключается заголовками:
1036
- * таблица показывает порядок и без потребителя, который его слушает.
1037
- */
1038
- this.#sort = linkedSignal(() => this.sort(), /* @ts-ignore */
1039
- ...(ngDevMode ? [{ debugName: "#sort" }] : /* istanbul ignore next */ []));
1040
- /** Настройка колонок: применённые настройки, реестр панели, загрузка и запись. */
1041
- this.#columnSettings = new RtTableColumnSettings(() => this.columnsConfig(), () => this.tableId());
1042
- /**
1043
- * Роль хоста: у native `<table rt-table>` она есть от самого тега, а элементному
1044
- * `<rt-table>` её ставим сами. Без неё скрин-ридер читает список строками текста: роли
1045
- * строк и ячеек CDK проставляет сам, а роли самой таблицы у него нет, и проставленные
1046
- * остаются висеть вне таблицы. Считается один раз — тег хоста по ходу жизни не меняется.
1047
- */
1048
- this.hostRole = inject(ElementRef).nativeElement.tagName === 'RT-TABLE' ? 'table' : null;
1049
- /** `true` когда initial-load в полёте и entities ещё нет — рендерим skeleton rows. */
1050
- this.isInitialLoading = computed(() => this.loading() && this.#hasData() === false, /* @ts-ignore */
1051
- ...(ngDevMode ? [{ debugName: "isInitialLoading" }] : /* istanbul ignore next */ []));
1052
- /** `true` когда загрузка завершена и entities пустые — рендерим empty placeholder. */
1053
- this.isEmpty = computed(() => !this.loading() && !this.fetching() && this.#hasData() === false, /* @ts-ignore */
1054
- ...(ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []));
1055
- /** Массив для `@for` — числа от 0 до skeletonRows-1, рендерим placeholder-rows. */
1056
- this.skeletonRowIndexes = computed(() => Array.from({ length: this.skeletonRows() }, (_, i) => i), /* @ts-ignore */
1057
- ...(ngDevMode ? [{ debugName: "skeletonRowIndexes" }] : /* istanbul ignore next */ []));
1058
- /** Шаблон содержимого «…»-меню действий строки (`<ng-template rtTableRowActions>`). */
1059
- this.rowActions = contentChild(RtTableRowActionsDirective, /* @ts-ignore */
1060
- ...(ngDevMode ? [{ debugName: "rowActions" }] : /* istanbul ignore next */ []));
1061
- /** Кастомный шаблон карточки мобильного режима (`<ng-template rtTableCard>`). Опционален. */
1062
- this.cardTemplate = contentChild(RtTableCardDirective, /* @ts-ignore */
1063
- ...(ngDevMode ? [{ debugName: "cardTemplate" }] : /* istanbul ignore next */ []));
1064
- /**
1065
- * Все проецируемые потребителем `cdkColumnDef` — источник cell-шаблонов для
1066
- * авто-карточек. «…»-колонка действий объявлена во view rt-table, поэтому в
1067
- * этот content-query не попадает.
1068
- */
1069
- this.columnDefs = contentChildren(CdkColumnDef, { ...(ngDevMode ? { debugName: "columnDefs" } : /* istanbul ignore next */ {}), descendants: true });
1070
- /** Узкий вьюпорт (≤1080px): таблица прячется, строки рендерятся карточками. */
1071
- this.isNarrow = this.#breakpoints.narrow;
1072
- /** Карточки показываются только когда card-режим включён (`[cards]`) и экран узкий. */
1073
- this.showCards = computed(() => this.cards() && this.isNarrow(), /* @ts-ignore */
1074
- ...(ngDevMode ? [{ debugName: "showCards" }] : /* istanbul ignore next */ []));
1075
- /**
1076
- * Строки для карточек узкого экрана. Признак `#dataSourceVersion` пересчитывает список
1077
- * при смене источника: CDK хранит его полем, а не сигналом.
1078
- */
1079
- this.cardRows = computed(() => {
1080
- this.#dataSourceVersion();
1081
- return cardRowsOf(this.dataSource);
1082
- }, /* @ts-ignore */
1083
- ...(ngDevMode ? [{ debugName: "cardRows" }] : /* istanbul ignore next */ []));
1084
- /** Поля авто-карточки узкого экрана: видимые колонки с подписью и шаблоном ячейки. */
1085
- this.cardColumns = computed(() => cardColumnsOf(this.displayedColumns(), this.columnDefs(), this.columnsConfig()), /* @ts-ignore */
1086
- ...(ngDevMode ? [{ debugName: "cardColumns" }] : /* istanbul ignore next */ []));
1087
- /** ContentChild template для кастом empty-placeholder'а. Опционален; fallback — emptyMessage. */
1088
- this.emptyTemplate = contentChild('rtTableEmpty', { ...(ngDevMode ? { debugName: "emptyTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
1089
- /** ARIA-label корневого `<table>` (или `<rt-table>` элемента). */
1090
- this.ariaLabel = input(null, /* @ts-ignore */
1091
- ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
1092
- /** Плотность: `"compact"` уменьшает padding и высоту ячеек. */
1093
- this.density = input('default', /* @ts-ignore */
1094
- ...(ngDevMode ? [{ debugName: "density" }] : /* istanbul ignore next */ []));
1095
- /**
1096
- * Мобильный card-режим на узком экране (≤1080px): таблица рендерится списком
1097
- * карточек «поле: значение». Включён по умолчанию для всех списков. Отключать
1098
- * (`[cards]="false"`) для не-списочных таблиц — например, key-value quote-таблицы
1099
- * внутри асайда, где карточки дублируют смысл.
1100
- */
1101
- this.cards = input(true, { ...(ngDevMode ? { debugName: "cards" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1102
- /**
1103
- * Строки кликабельны (открывают деталь/асайд). Включает визуальный аффорданс
1104
- * (cursor/focus-ring); саму активацию + a11y обеспечивает директива
1105
- * `rtTableRow` на `<tr cdk-row>`.
1106
- */
1107
- this.clickable = input(false, { ...(ngDevMode ? { debugName: "clickable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1108
- /** Initial-load в полёте. При `true` + пустых entities рендерит skeleton rows. */
1109
- this.loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1110
- /** Re-fetch в полёте. При `true` рисует sticky overlay c rt-spinner поверх существующих rows. */
1111
- this.fetching = input(false, { ...(ngDevMode ? { debugName: "fetching" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1112
- /** Имена колонок (тот же массив что в `*cdkRowDef columns: ...`). Нужен для skeleton row layout. */
1113
- this.columns = input([], /* @ts-ignore */
1114
- ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
1115
- /**
1116
- * Метаданные колонок для настраиваемой таблицы: `[{key,label,hidden?,locked?}]`.
1117
- * Когда задан — `displayedColumns()` вычисляется из него с учётом настроек
1118
- * (видимость + порядок), а таблица получает панель настроек (при заданном `[tableId]`).
1119
- * Пуст — таблица работает по legacy `[columns]` без панели.
1120
- */
1121
- this.columnsConfig = input([], /* @ts-ignore */
1122
- ...(ngDevMode ? [{ debugName: "columnsConfig" }] : /* istanbul ignore next */ []));
1123
- /**
1124
- * Идентификатор таблицы для персиста настроек колонок (ключ в IndexedDB).
1125
- * Без него панель настроек недоступна (`canConfigure()` = false).
1126
- */
1127
- this.tableId = input(null, /* @ts-ignore */
1128
- ...(ngDevMode ? [{ debugName: "tableId" }] : /* istanbul ignore next */ []));
1129
- /**
1130
- * Добавляет в конец строки «…»-колонку действий (`rt-menu`). Содержимое меню —
1131
- * через `<ng-template rtTableRowActions let-row>`; колонку нужно подключить
1132
- * в row-def'ах через `displayedColumns()`.
1133
- */
1134
- this.showRowActions = input(false, { ...(ngDevMode ? { debugName: "showRowActions" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1135
- /**
1136
- * Есть ли у строки доступные действия. Строка, которой нельзя сделать ничего,
1137
- * кнопки «…» не показывает вовсе. Экран заполняет тем же признаком, которым
1138
- * гейтит пункты меню; `null` — у всех строк действия есть.
1139
- */
1140
- this.rowHasActions = input(null, /* @ts-ignore */
1141
- ...(ngDevMode ? [{ debugName: "rowHasActions" }] : /* istanbul ignore next */ []));
1142
- /**
1143
- * Показывать ли строку отбора под шапкой. Таблица с отбором в настройке колонок не
1144
- * становится таблицей с полями над строками сама: вторая строка шапки стоит высоты
1145
- * экрана, и платить за неё решает потребитель.
1146
- */
1147
- this.showFilters = input(false, { ...(ngDevMode ? { debugName: "showFilters" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1148
- /** Набор условий, по которому нарисованы ячейки отбора. Держит его потребитель. */
1149
- this.filters = input([], /* @ts-ignore */
1150
- ...(ngDevMode ? [{ debugName: "filters" }] : /* istanbul ignore next */ []));
1151
- /** Набор условий изменился. Строки сужает потребитель — таблица только сообщает. */
1152
- this.filtersChange = output();
1153
- /** Выбранная сортировка: `null` — порядок задаёт источник данных. */
1154
- this.sort = input(null, /* @ts-ignore */
1155
- ...(ngDevMode ? [{ debugName: "sort" }] : /* istanbul ignore next */ []));
1156
- /** Пользователь переключил порядок заголовком. Саму выборку делает потребитель. */
1157
- this.sortChange = output();
1158
- /** Текущая сортировка — её читают заголовки колонок (`rtSortHeader`). */
1159
- this.currentSort = this.#sort.asReadonly();
1160
- /**
1161
- * Разрешённые колонки настраиваемой таблицы: `[columnsConfig]` в применённом
1162
- * порядке, с текущим флагом `hidden` (locked всегда видимы). Панель настроек
1163
- * читает этот список для отрисовки; из него же строится `displayedColumns()`.
1164
- * Пустой при отсутствии `[columnsConfig]` (legacy-режим).
1165
- */
1166
- this.resolvedColumns = computed(() => this.#columnSettings.resolved(), /* @ts-ignore */
1167
- ...(ngDevMode ? [{ debugName: "resolvedColumns" }] : /* istanbul ignore next */ []));
1168
- /**
1169
- * Колонки для `*cdkHeaderRowDef`/`*cdkRowDef`. При заданном `[columnsConfig]` —
1170
- * видимые колонки в применённом порядке; иначе — legacy `[columns]`. Плюс
1171
- * «…»-колонка действий в конце при `[showRowActions]`. Потребитель читает через
1172
- * template-ref: `<rt-table #t="rtTable" ...>` →
1173
- * `*cdkRowDef="let row; columns: t.displayedColumns()"`.
1174
- */
1175
- this.displayedColumns = computed(() => displayedColumnKeys(this.resolvedColumns(), this.columns(), this.columnsConfig().length > 0, this.showRowActions()), /* @ts-ignore */
1176
- ...(ngDevMode ? [{ debugName: "displayedColumns" }] : /* istanbul ignore next */ []));
1177
- /**
1178
- * Ячейки строки отбора: по ячейке на каждую показанную колонку, в том же порядке. У
1179
- * колонки без объявленного отбора ячейка пустая, но своё место держит — иначе ячейки
1180
- * съезжают на соседние колонки. Колонка действий строки попадает сюда тем же путём:
1181
- * `displayedColumns()` уже несёт её последней.
1182
- */
1183
- this.filterCells = computed(() => filterCellsOf(this.displayedColumns(), this.columnsConfig()), /* @ts-ignore */
1184
- ...(ngDevMode ? [{ debugName: "filterCells" }] : /* istanbul ignore next */ []));
1185
- /** `true` когда таблица настраиваемая: есть и `[columnsConfig]`, и `[tableId]`. */
1186
- this.canConfigure = this.#columnSettings.canConfigure;
1187
- /** Сколько skeleton-строк рендерить во время initial-load. Default 5. */
1188
- this.skeletonRows = input(DEFAULT_SKELETON_ROWS, { ...(ngDevMode ? { debugName: "skeletonRows" } : /* istanbul ignore next */ {}), transform: numberAttribute });
1189
- /** Подпись пустой таблицы; пусто — берётся переведённое умолчание. */
1190
- this.emptyMessage = input('', /* @ts-ignore */
1191
- ...(ngDevMode ? [{ debugName: "emptyMessage" }] : /* istanbul ignore next */ []));
1192
- /** Своя подпись пустой таблицы важнее умолчания */
1193
- this.emptyText = computed(() => this.emptyMessage() || this.#t_uiNoRows(), /* @ts-ignore */
1194
- ...(ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []));
1195
- /** Иконка дефолтного empty-placeholder'а (rt-empty-state). `null` — без иконки. */
1196
- this.emptyIcon = input('inbox', /* @ts-ignore */
1197
- ...(ngDevMode ? [{ debugName: "emptyIcon" }] : /* istanbul ignore next */ []));
1198
- /** Описание под заголовком дефолтного empty-placeholder'а. Опционально. */
1199
- this.emptyDescription = input(null, /* @ts-ignore */
1200
- ...(ngDevMode ? [{ debugName: "emptyDescription" }] : /* istanbul ignore next */ []));
1201
- }
1202
- #t_uiNoRows;
1203
- #destroyRef;
1204
- #breakpoints;
1205
- #dataSourceVersion;
1206
- /**
1207
- * Выбранная сортировка. Заводится от входа `[sort]` и переключается заголовками:
1208
- * таблица показывает порядок и без потребителя, который его слушает.
1209
- */
1210
- #sort;
1211
- /** Настройка колонок: применённые настройки, реестр панели, загрузка и запись. */
1212
- #columnSettings;
1213
- ngOnInit() {
1214
- super.ngOnInit();
1215
- // Регистрируем view-колонку действий до первого рендера строк, чтобы
1216
- // `displayedColumns()` мог на неё ссылаться без «column not found».
1217
- // Cell/header присваиваем вручную — их ContentChild ещё не отработал.
1218
- if (this.actionsColumnDef !== undefined && this.actionsCellDef !== undefined && this.actionsHeaderCellDef !== undefined) {
1219
- this.actionsColumnDef.cell = this.actionsCellDef;
1220
- this.actionsColumnDef.headerCell = this.actionsHeaderCellDef;
1221
- this.addColumnDef(this.actionsColumnDef);
1222
- }
1223
- this.#columnSettings.start();
1224
- this.#columnSettings
1225
- .saved()
1226
- .pipe(takeUntilDestroyed(this.#destroyRef))
1227
- .subscribe((settings) => this.applyColumnSettings(settings));
1228
- }
1229
- ngOnDestroy() {
1230
- if (this.actionsColumnDef !== undefined) {
1231
- this.removeColumnDef(this.actionsColumnDef);
1232
- }
1233
- this.#columnSettings.stop();
1234
- super.ngOnDestroy();
1235
- }
1236
- /**
1237
- * Переключает порядок по колонке: по возрастанию → по убыванию → без сортировки.
1238
- * Выбранное состояние уходит наружу — выборку делает потребитель.
1239
- */
1240
- toggleSort(propertyName) {
1241
- const selected = nextSort(this.#sort(), propertyName);
1242
- this.#sort.set(selected);
1243
- this.sortChange.emit(selected);
1244
- }
1245
- /** Ячейка отбора сообщила новый набор условий — таблица отдаёт его наружу целиком. */
1246
- reportFilters(filters) {
1247
- this.filtersChange.emit(filters);
1248
- }
1249
- applyColumnSettings(settings) {
1250
- this.#columnSettings.apply(settings);
1251
- }
1252
- /**
1253
- * Пробрасывает `dataSource` в CdkTable и отдельно инвалидирует signals,
1254
- * которые вычисляют loading/empty-состояния по plain CDK input.
1255
- */
1256
- set dataSource(dataSource) {
1257
- super.dataSource = dataSource;
1258
- this.#dataSourceVersion.update((version) => version + 1);
1259
- }
1260
- /** Возвращает текущий источник данных, сохранённый базовым CdkTable. */
1261
- get dataSource() {
1262
- return super.dataSource;
1263
- }
1264
- /** Есть ли строки в `dataSource`; признак версии пересчитывает ответ при смене источника. */
1265
- #hasData() {
1266
- this.#dataSourceVersion();
1267
- return hasRowsIn(this.dataSource);
1268
- }
1269
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtTableComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1270
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: RtTableComponent, isStandalone: true, selector: "rt-table, table[rt-table]", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, density: { classPropertyName: "density", publicName: "density", isSignal: true, isRequired: false, transformFunction: null }, cards: { classPropertyName: "cards", publicName: "cards", isSignal: true, isRequired: false, transformFunction: null }, clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, fetching: { classPropertyName: "fetching", publicName: "fetching", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, columnsConfig: { classPropertyName: "columnsConfig", publicName: "columnsConfig", isSignal: true, isRequired: false, transformFunction: null }, tableId: { classPropertyName: "tableId", publicName: "tableId", isSignal: true, isRequired: false, transformFunction: null }, showRowActions: { classPropertyName: "showRowActions", publicName: "showRowActions", isSignal: true, isRequired: false, transformFunction: null }, rowHasActions: { classPropertyName: "rowHasActions", publicName: "rowHasActions", isSignal: true, isRequired: false, transformFunction: null }, showFilters: { classPropertyName: "showFilters", publicName: "showFilters", isSignal: true, isRequired: false, transformFunction: null }, filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: false, transformFunction: null }, sort: { classPropertyName: "sort", publicName: "sort", isSignal: true, isRequired: false, transformFunction: null }, skeletonRows: { classPropertyName: "skeletonRows", publicName: "skeletonRows", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, emptyIcon: { classPropertyName: "emptyIcon", publicName: "emptyIcon", isSignal: true, isRequired: false, transformFunction: null }, emptyDescription: { classPropertyName: "emptyDescription", publicName: "emptyDescription", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filtersChange: "filtersChange", sortChange: "sortChange" }, host: { properties: { "class.rt-table--density--compact": "density() === 'compact'", "class.rt-table--clickable": "clickable()", "class.rt-table--loading": "isInitialLoading()", "class.rt-table--fetching": "fetching()", "class.rt-table--empty": "isEmpty()", "class.rt-table--cards": "showCards()", "attr.role": "hostRole", "attr.aria-label": "ariaLabel()", "attr.aria-busy": "isInitialLoading() || fetching() ? 'true' : null" }, classAttribute: "rt-table" }, providers: [
1271
- {
1272
- provide: CDK_TABLE,
1273
- useExisting: forwardRef(() => RtTableComponent),
1274
- },
1275
- ], queries: [{ propertyName: "rowActions", first: true, predicate: RtTableRowActionsDirective, descendants: true, isSignal: true }, { propertyName: "cardTemplate", first: true, predicate: RtTableCardDirective, descendants: true, isSignal: true }, { propertyName: "columnDefs", predicate: CdkColumnDef, descendants: true, isSignal: true }, { propertyName: "emptyTemplate", first: true, predicate: ["rtTableEmpty"], descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "actionsColumnDef", first: true, predicate: CdkColumnDef, descendants: true, static: true }, { propertyName: "actionsCellDef", first: true, predicate: CdkCellDef, descendants: true, static: true }, { propertyName: "actionsHeaderCellDef", first: true, predicate: CdkHeaderCellDef, descendants: true, static: true }], exportAs: ["rtTable"], usesInheritance: true, hostDirectives: [{ directive: i1$1.RtRadiusDirective, inputs: ["radius", "radius"] }], ngImport: i0, template: "<ng-container rtBlock=\"rt-table\">\n <ng-content select=\"caption\" />\n <ng-content select=\"colgroup, col\" />\n\n <ng-container cdkColumnDef=\"rtRowActions\">\n <th *cdkHeaderCellDef rtElem=\"actions-header\" cdk-header-cell aria-hidden=\"true\"></th>\n <td *cdkCellDef=\"let row\" rtElem=\"actions-cell\" qa-dataid=\"table-row-actions\" cdk-cell>\n @if (rowActions()?.template; as tpl) {\n @if (row | rtRowHasActions: rowHasActions()) {\n <div rtElem=\"actions-float\">\n <rt-menu>\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n </rt-menu>\n </div>\n }\n }\n </td>\n </ng-container>\n\n <ng-container headerRowOutlet />\n\n @if (showFilters()) {\n <tr rtElem=\"filter-row\" qa-dataid=\"table-filter-row\">\n @for (cell of filterCells(); track cell.key) {\n <th\n rtElem=\"filter-cell\"\n qa-dataid=\"table-filter-cell\"\n [rtMod]=\"{ actions: cell.actions }\"\n [attr.aria-hidden]=\"cell.actions || null\">\n @if (cell.filter) {\n <rt-table-filter-header\n [propertyName]=\"cell.key\"\n [filter]=\"cell.filter\"\n [filters]=\"filters()\"\n (filtersChange)=\"reportFilters($event)\" />\n }\n </th>\n }\n </tr>\n }\n\n @if (isInitialLoading()) {\n @for (i of skeletonRowIndexes(); track i) {\n <tr rtElem=\"skeleton-row\" qa-dataid=\"table-skeleton-row\">\n @for (col of displayedColumns(); track col) {\n <td rtElem=\"skeleton-cell\">\n <rt-skeleton rtElem=\"skeleton-bar\" />\n </td>\n }\n </tr>\n }\n }\n\n <ng-container rowOutlet />\n <ng-container noDataRowOutlet />\n <ng-container footerRowOutlet />\n\n @if (isEmpty()) {\n <tr rtElem=\"empty-row\" qa-dataid=\"table-empty-row\">\n <td rtElem=\"empty\" [attr.colspan]=\"displayedColumns().length || null\">\n @if (emptyTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <rt-empty-state\n rtElem=\"empty-message\"\n qa-dataid=\"table-empty\"\n [icon]=\"emptyIcon()\"\n [title]=\"emptyText()\"\n [description]=\"emptyDescription()\" />\n }\n </td>\n </tr>\n }\n\n @if (showCards()) {\n <div rtElem=\"cards\" qa-dataid=\"table-cards\" role=\"list\">\n @if (isInitialLoading()) {\n @for (i of skeletonRowIndexes(); track i) {\n <article rtElem=\"card\" qa-dataid=\"table-skeleton-card\" [rtMod]=\"{ skeleton: true }\">\n <rt-skeleton rtElem=\"card-skeleton-bar\" />\n <rt-skeleton rtElem=\"card-skeleton-bar\" />\n </article>\n }\n } @else if (isEmpty()) {\n @if (emptyTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <rt-empty-state\n rtElem=\"empty-message\"\n qa-dataid=\"table-empty\"\n [icon]=\"emptyIcon()\"\n [title]=\"emptyText()\"\n [description]=\"emptyDescription()\" />\n }\n } @else {\n @for (row of cardRows(); track row; let index = $index) {\n <article\n rtElem=\"card\"\n qa-dataid=\"table-card\"\n role=\"listitem\"\n [rtTableCardActivation]=\"index\"\n [rtTableCardActivationEnabled]=\"clickable()\">\n @if (cardTemplate()?.template; as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n } @else {\n @for (col of cardColumns(); track col.key) {\n <div rtElem=\"card-field\" qa-dataid=\"table-card-field\" [attr.data-key]=\"col.key\">\n <span rtElem=\"card-label\" qa-dataid=\"table-card-label\">{{ col.label }}</span>\n <div rtElem=\"card-value\" qa-dataid=\"table-card-value\">\n <ng-container [ngTemplateOutlet]=\"col.cell\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n </div>\n </div>\n }\n @if (rowActions()?.template; as tpl) {\n @if (row | rtRowHasActions: rowHasActions()) {\n <div rtElem=\"card-actions\" qa-dataid=\"table-card-actions\">\n <rt-menu>\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n </rt-menu>\n </div>\n }\n }\n }\n </article>\n }\n }\n </div>\n }\n</ng-container>\n", styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-table{--rt-table-border-width: var(--rt-border-width-thin);--rt-table-card-radius: var(--rt-radius-md);position:relative;display:table;width:100%;background:var(--rt-color-bg-surface);border-collapse:collapse;color:var(--rt-color-text-primary)}.rt-table .cdk-header-cell,.rt-table .cdk-cell,.rt-table__filter-cell,.rt-table__skeleton-cell{position:relative;height:50px;padding:var(--rt-space-2) var(--rt-space-5);border-bottom:var(--rt-table-border-width) solid var(--rt-color-border-subtle);border-left:var(--rt-table-border-width) solid var(--rt-color-border-subtle);font-size:var(--rt-text-sm);font-weight:var(--rt-font-weight-medium);text-align:start;vertical-align:middle}.rt-table .cdk-header-cell[data-align=right],.rt-table .cdk-cell[data-align=right],.rt-table__filter-cell[data-align=right],.rt-table__skeleton-cell[data-align=right],.rt-table .cdk-header-cell[data-align=right] input,.rt-table .cdk-cell[data-align=right] input,.rt-table__filter-cell[data-align=right] input,.rt-table__skeleton-cell[data-align=right] input{text-align:right}.rt-table .cdk-header-cell:first-child,.rt-table .cdk-cell:first-child,.rt-table__filter-cell:first-child,.rt-table__skeleton-cell:first-child{border-left:none}.rt-table .cdk-header-cell{border-top:var(--rt-table-border-width) solid var(--rt-color-border-subtle);background:var(--rt-color-bg-surface);color:var(--rt-color-text-muted)}.rt-table .cdk-cell{color:var(--rt-color-text-primary);overflow-wrap:anywhere}.rt-table__filter-row{display:table-row}.rt-table__filter-cell{height:auto;background:var(--rt-color-bg-surface);padding-block:var(--rt-space-1);vertical-align:middle}.rt-table__filter-cell--actions,.rt-table__actions-header.cdk-header-cell{width:0;padding:0;border:none}.rt-table__actions-cell.cdk-cell{position:sticky;z-index:1;right:0;width:0;padding:0;border:none;background:transparent}.rt-table__actions-float{position:absolute;display:flex;height:100%;align-items:center;padding:0 var(--rt-space-2) 0 var(--rt-space-8);background:linear-gradient(to right,transparent 0%,var(--rt-color-bg-hover) 45%);inset:0 0 0 auto;pointer-events:none}.rt-table__actions-float .rt-menu{pointer-events:auto}@media(hover:hover){.rt-table__actions-cell.cdk-cell{visibility:hidden}.cdk-row:hover .rt-table__actions-cell.cdk-cell,.cdk-row:focus-within .rt-table__actions-cell.cdk-cell,.rt-table__actions-cell.cdk-cell:has(.rt-menu--open){visibility:visible}}.rt-table .cdk-row:hover{background:var(--rt-color-bg-hover)}.rt-table .cdk-row.rt-table__row--danger,.rt-table .cdk-row.rt-table__row--danger:hover{background:var(--rt-color-state-danger-bg)}.rt-table--clickable .cdk-row,.rt-table--clickable .rt-table__card{cursor:pointer}.rt-table--clickable .cdk-row:focus-visible,.rt-table--clickable .rt-table__card:focus-visible{outline:2px solid var(--rt-color-action-primary);outline-offset:-2px}.rt-table a{text-decoration:none}.rt-table--density--compact .cdk-header-cell,.rt-table--density--compact .cdk-cell,.rt-table--density--compact .rt-table__skeleton-cell{height:36px;padding:var(--rt-space-xs) var(--rt-space-sm)}.rt-table__skeleton-bar{display:block;width:80%;height:14px}.rt-table__empty-row{display:table-row}.rt-table__empty{padding:var(--rt-space-6) var(--rt-space-5);border-bottom:var(--rt-table-border-width) solid var(--rt-color-border-subtle);background:var(--rt-color-bg-surface);color:var(--rt-color-text-muted);text-align:center}.rt-table__empty-message{margin:0;font-size:var(--rt-text-sm)}.rt-table__overlay{position:absolute;z-index:1;display:grid;min-height:100%;inset:0;place-items:center;pointer-events:none}.rt-table__overlay-backdrop{position:absolute;background:var(--rt-color-bg-surface);inset:0;opacity:.72}.rt-table__overlay-spinner{position:sticky;z-index:1;top:50%;display:flex;align-items:center;justify-content:center;transform:translateY(-50%)}.rt-table__cards{display:none}.rt-table--cards{display:block;min-width:0;max-width:100%}.rt-table--cards .cdk-header-row,.rt-table--cards .cdk-row,.rt-table--cards .rt-table__skeleton-row,.rt-table--cards .rt-table__empty-row,.rt-table--cards .rt-table__filter-row{display:none}.rt-table--cards .rt-table__cards{display:flex;flex-direction:column;gap:var(--rt-space-sm)}.rt-table--cards:not(.rt-table--empty){background:transparent}.rt-table__card{display:flex;flex-direction:column;padding:var(--rt-space-md);border:var(--rt-table-border-width) solid var(--rt-color-border-default);border-radius:var(--rt-table-card-radius);background:var(--rt-color-bg-surface);gap:var(--rt-space-xs)}.rt-table__card-field{display:flex;align-items:baseline;justify-content:space-between;gap:var(--rt-space-md)}.rt-table__card-label{flex:0 0 auto;color:var(--rt-color-text-muted);font-size:var(--rt-text-sm)}.rt-table__card-value{min-width:0;overflow-wrap:anywhere;text-align:right}.rt-table__card-value .cdk-cell{display:inline;height:auto;padding:0;border:none;font:inherit;min-inline-size:0;text-align:inherit}.rt-table__card-actions{display:flex;justify-content:flex-end}.rt-table__card-skeleton-bar{display:block;width:60%;height:14px}.rt-table__card-skeleton-bar:first-child{width:80%}.rt-table[data-rt-radius=none]{--rt-table-card-radius: var(--rt-radius-none)}.rt-table[data-rt-radius=xs]{--rt-table-card-radius: var(--rt-radius-xs)}.rt-table[data-rt-radius=sm]{--rt-table-card-radius: var(--rt-radius-sm)}.rt-table[data-rt-radius=ms]{--rt-table-card-radius: var(--rt-radius-ms)}.rt-table[data-rt-radius=md]{--rt-table-card-radius: var(--rt-radius-md)}.rt-table[data-rt-radius=lg]{--rt-table-card-radius: var(--rt-radius-lg)}.rt-table[data-rt-radius=xl]{--rt-table-card-radius: var(--rt-radius-xl)}.rt-table[data-rt-radius=\"2xl\"]{--rt-table-card-radius: var(--rt-radius-2xl)}.rt-table[data-rt-radius=full]{--rt-table-card-radius: var(--rt-radius-full)}:root[data-theme=dark] .rt-table,html.rt-theme-dark .rt-table{background:var(--rt-color-bg-page)}:root[data-theme=dark] .rt-table .cdk-header-cell,:root[data-theme=dark] .rt-table .rt-table__empty,:root[data-theme=dark] .rt-table .rt-table__overlay-backdrop,html.rt-theme-dark .rt-table .cdk-header-cell,html.rt-theme-dark .rt-table .rt-table__empty,html.rt-theme-dark .rt-table .rt-table__overlay-backdrop{background:var(--rt-color-bg-page)}}\n"], dependencies: [{ kind: "directive", type:
1276
- // @angular/cdk
1277
- CdkCell, selector: "cdk-cell, td[cdk-cell]" }, { kind: "directive", type: CdkCellDef, selector: "[cdkCellDef]" }, { kind: "directive", type: CdkColumnDef, selector: "[cdkColumnDef]", inputs: ["cdkColumnDef", "sticky", "stickyEnd"] }, { kind: "directive", type: CdkHeaderCell, selector: "cdk-header-cell, th[cdk-header-cell]" }, { kind: "directive", type: CdkHeaderCellDef, selector: "[cdkHeaderCellDef]" }, { kind: "directive", type: DataRowOutlet, selector: "[rowOutlet]" }, { kind: "directive", type: FooterRowOutlet, selector: "[footerRowOutlet]" }, { kind: "directive", type: HeaderRowOutlet, selector: "[headerRowOutlet]" }, { kind: "directive", type: NoDataRowOutlet, selector: "[noDataRowOutlet]" }, { kind: "directive", type:
1278
- // @angular/common
1279
- NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type:
1280
- // standalone components / directives
1281
- RtEmptyStateComponent, selector: "rt-empty-state", inputs: ["icon", "glyph", "title", "description", "framed"] }, { kind: "component", type: RtMenuComponent, selector: "rt-menu", inputs: ["icon", "ariaLabel", "align", "panelClass", "triggerSize", "size", "disabled"], outputs: ["openedChange"] }, { kind: "component", type: RtSkeletonComponent, selector: "rt-skeleton", inputs: ["shape", "size", "width", "height", "animation"] }, { kind: "component", type: RtTableFilterHeaderComponent, selector: "rt-table-filter-header", inputs: ["propertyName", "filter", "filters"], outputs: ["filtersChange"] }, { kind: "directive", type: RtTableCardActivationDirective, selector: "[rtTableCardActivation]", inputs: ["rtTableCardActivation", "rtTableCardActivationEnabled"] }, { kind: "directive", type: BlockDirective, selector: "[rtBlock]", inputs: ["rtMod"] }, { kind: "directive", type: ElemDirective, selector: "[rtElem]", inputs: ["rtMod"] }, { kind: "directive", type: ModDirective, selector: "[rtMod]" }, { kind: "pipe", type:
1282
- // pipes
1283
- RtRowHasActionsPipe, name: "rtRowHasActions" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1284
- }
1285
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtTableComponent, decorators: [{
1286
- type: Component,
1287
- args: [{ selector: 'rt-table, table[rt-table]', exportAs: 'rtTable', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
1288
- // @angular/cdk
1289
- CdkCell,
1290
- CdkCellDef,
1291
- CdkColumnDef,
1292
- CdkHeaderCell,
1293
- CdkHeaderCellDef,
1294
- DataRowOutlet,
1295
- FooterRowOutlet,
1296
- HeaderRowOutlet,
1297
- NoDataRowOutlet,
1298
- // @angular/common
1299
- NgTemplateOutlet,
1300
- // standalone components / directives
1301
- RtEmptyStateComponent,
1302
- RtMenuComponent,
1303
- RtSkeletonComponent,
1304
- RtSpinnerComponent,
1305
- RtTableFilterHeaderComponent,
1306
- RtTableCardActivationDirective,
1307
- BlockDirective,
1308
- ElemDirective,
1309
- ModDirective,
1310
- // pipes
1311
- RtRowHasActionsPipe,
1312
- ], hostDirectives: [{ directive: RtRadiusDirective, inputs: ['radius'] }], providers: [
1313
- {
1314
- provide: CDK_TABLE,
1315
- useExisting: forwardRef(() => RtTableComponent),
1316
- },
1317
- ], host: {
1318
- class: BEM_BLOCK$3,
1319
- '[class.rt-table--density--compact]': "density() === 'compact'",
1320
- '[class.rt-table--clickable]': 'clickable()',
1321
- '[class.rt-table--loading]': 'isInitialLoading()',
1322
- '[class.rt-table--fetching]': 'fetching()',
1323
- '[class.rt-table--empty]': 'isEmpty()',
1324
- '[class.rt-table--cards]': 'showCards()',
1325
- '[attr.role]': 'hostRole',
1326
- '[attr.aria-label]': 'ariaLabel()',
1327
- '[attr.aria-busy]': "isInitialLoading() || fetching() ? 'true' : null",
1328
- }, template: "<ng-container rtBlock=\"rt-table\">\n <ng-content select=\"caption\" />\n <ng-content select=\"colgroup, col\" />\n\n <ng-container cdkColumnDef=\"rtRowActions\">\n <th *cdkHeaderCellDef rtElem=\"actions-header\" cdk-header-cell aria-hidden=\"true\"></th>\n <td *cdkCellDef=\"let row\" rtElem=\"actions-cell\" qa-dataid=\"table-row-actions\" cdk-cell>\n @if (rowActions()?.template; as tpl) {\n @if (row | rtRowHasActions: rowHasActions()) {\n <div rtElem=\"actions-float\">\n <rt-menu>\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n </rt-menu>\n </div>\n }\n }\n </td>\n </ng-container>\n\n <ng-container headerRowOutlet />\n\n @if (showFilters()) {\n <tr rtElem=\"filter-row\" qa-dataid=\"table-filter-row\">\n @for (cell of filterCells(); track cell.key) {\n <th\n rtElem=\"filter-cell\"\n qa-dataid=\"table-filter-cell\"\n [rtMod]=\"{ actions: cell.actions }\"\n [attr.aria-hidden]=\"cell.actions || null\">\n @if (cell.filter) {\n <rt-table-filter-header\n [propertyName]=\"cell.key\"\n [filter]=\"cell.filter\"\n [filters]=\"filters()\"\n (filtersChange)=\"reportFilters($event)\" />\n }\n </th>\n }\n </tr>\n }\n\n @if (isInitialLoading()) {\n @for (i of skeletonRowIndexes(); track i) {\n <tr rtElem=\"skeleton-row\" qa-dataid=\"table-skeleton-row\">\n @for (col of displayedColumns(); track col) {\n <td rtElem=\"skeleton-cell\">\n <rt-skeleton rtElem=\"skeleton-bar\" />\n </td>\n }\n </tr>\n }\n }\n\n <ng-container rowOutlet />\n <ng-container noDataRowOutlet />\n <ng-container footerRowOutlet />\n\n @if (isEmpty()) {\n <tr rtElem=\"empty-row\" qa-dataid=\"table-empty-row\">\n <td rtElem=\"empty\" [attr.colspan]=\"displayedColumns().length || null\">\n @if (emptyTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <rt-empty-state\n rtElem=\"empty-message\"\n qa-dataid=\"table-empty\"\n [icon]=\"emptyIcon()\"\n [title]=\"emptyText()\"\n [description]=\"emptyDescription()\" />\n }\n </td>\n </tr>\n }\n\n @if (showCards()) {\n <div rtElem=\"cards\" qa-dataid=\"table-cards\" role=\"list\">\n @if (isInitialLoading()) {\n @for (i of skeletonRowIndexes(); track i) {\n <article rtElem=\"card\" qa-dataid=\"table-skeleton-card\" [rtMod]=\"{ skeleton: true }\">\n <rt-skeleton rtElem=\"card-skeleton-bar\" />\n <rt-skeleton rtElem=\"card-skeleton-bar\" />\n </article>\n }\n } @else if (isEmpty()) {\n @if (emptyTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <rt-empty-state\n rtElem=\"empty-message\"\n qa-dataid=\"table-empty\"\n [icon]=\"emptyIcon()\"\n [title]=\"emptyText()\"\n [description]=\"emptyDescription()\" />\n }\n } @else {\n @for (row of cardRows(); track row; let index = $index) {\n <article\n rtElem=\"card\"\n qa-dataid=\"table-card\"\n role=\"listitem\"\n [rtTableCardActivation]=\"index\"\n [rtTableCardActivationEnabled]=\"clickable()\">\n @if (cardTemplate()?.template; as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n } @else {\n @for (col of cardColumns(); track col.key) {\n <div rtElem=\"card-field\" qa-dataid=\"table-card-field\" [attr.data-key]=\"col.key\">\n <span rtElem=\"card-label\" qa-dataid=\"table-card-label\">{{ col.label }}</span>\n <div rtElem=\"card-value\" qa-dataid=\"table-card-value\">\n <ng-container [ngTemplateOutlet]=\"col.cell\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n </div>\n </div>\n }\n @if (rowActions()?.template; as tpl) {\n @if (row | rtRowHasActions: rowHasActions()) {\n <div rtElem=\"card-actions\" qa-dataid=\"table-card-actions\">\n <rt-menu>\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n </rt-menu>\n </div>\n }\n }\n }\n </article>\n }\n }\n </div>\n }\n</ng-container>\n", styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-table{--rt-table-border-width: var(--rt-border-width-thin);--rt-table-card-radius: var(--rt-radius-md);position:relative;display:table;width:100%;background:var(--rt-color-bg-surface);border-collapse:collapse;color:var(--rt-color-text-primary)}.rt-table .cdk-header-cell,.rt-table .cdk-cell,.rt-table__filter-cell,.rt-table__skeleton-cell{position:relative;height:50px;padding:var(--rt-space-2) var(--rt-space-5);border-bottom:var(--rt-table-border-width) solid var(--rt-color-border-subtle);border-left:var(--rt-table-border-width) solid var(--rt-color-border-subtle);font-size:var(--rt-text-sm);font-weight:var(--rt-font-weight-medium);text-align:start;vertical-align:middle}.rt-table .cdk-header-cell[data-align=right],.rt-table .cdk-cell[data-align=right],.rt-table__filter-cell[data-align=right],.rt-table__skeleton-cell[data-align=right],.rt-table .cdk-header-cell[data-align=right] input,.rt-table .cdk-cell[data-align=right] input,.rt-table__filter-cell[data-align=right] input,.rt-table__skeleton-cell[data-align=right] input{text-align:right}.rt-table .cdk-header-cell:first-child,.rt-table .cdk-cell:first-child,.rt-table__filter-cell:first-child,.rt-table__skeleton-cell:first-child{border-left:none}.rt-table .cdk-header-cell{border-top:var(--rt-table-border-width) solid var(--rt-color-border-subtle);background:var(--rt-color-bg-surface);color:var(--rt-color-text-muted)}.rt-table .cdk-cell{color:var(--rt-color-text-primary);overflow-wrap:anywhere}.rt-table__filter-row{display:table-row}.rt-table__filter-cell{height:auto;background:var(--rt-color-bg-surface);padding-block:var(--rt-space-1);vertical-align:middle}.rt-table__filter-cell--actions,.rt-table__actions-header.cdk-header-cell{width:0;padding:0;border:none}.rt-table__actions-cell.cdk-cell{position:sticky;z-index:1;right:0;width:0;padding:0;border:none;background:transparent}.rt-table__actions-float{position:absolute;display:flex;height:100%;align-items:center;padding:0 var(--rt-space-2) 0 var(--rt-space-8);background:linear-gradient(to right,transparent 0%,var(--rt-color-bg-hover) 45%);inset:0 0 0 auto;pointer-events:none}.rt-table__actions-float .rt-menu{pointer-events:auto}@media(hover:hover){.rt-table__actions-cell.cdk-cell{visibility:hidden}.cdk-row:hover .rt-table__actions-cell.cdk-cell,.cdk-row:focus-within .rt-table__actions-cell.cdk-cell,.rt-table__actions-cell.cdk-cell:has(.rt-menu--open){visibility:visible}}.rt-table .cdk-row:hover{background:var(--rt-color-bg-hover)}.rt-table .cdk-row.rt-table__row--danger,.rt-table .cdk-row.rt-table__row--danger:hover{background:var(--rt-color-state-danger-bg)}.rt-table--clickable .cdk-row,.rt-table--clickable .rt-table__card{cursor:pointer}.rt-table--clickable .cdk-row:focus-visible,.rt-table--clickable .rt-table__card:focus-visible{outline:2px solid var(--rt-color-action-primary);outline-offset:-2px}.rt-table a{text-decoration:none}.rt-table--density--compact .cdk-header-cell,.rt-table--density--compact .cdk-cell,.rt-table--density--compact .rt-table__skeleton-cell{height:36px;padding:var(--rt-space-xs) var(--rt-space-sm)}.rt-table__skeleton-bar{display:block;width:80%;height:14px}.rt-table__empty-row{display:table-row}.rt-table__empty{padding:var(--rt-space-6) var(--rt-space-5);border-bottom:var(--rt-table-border-width) solid var(--rt-color-border-subtle);background:var(--rt-color-bg-surface);color:var(--rt-color-text-muted);text-align:center}.rt-table__empty-message{margin:0;font-size:var(--rt-text-sm)}.rt-table__overlay{position:absolute;z-index:1;display:grid;min-height:100%;inset:0;place-items:center;pointer-events:none}.rt-table__overlay-backdrop{position:absolute;background:var(--rt-color-bg-surface);inset:0;opacity:.72}.rt-table__overlay-spinner{position:sticky;z-index:1;top:50%;display:flex;align-items:center;justify-content:center;transform:translateY(-50%)}.rt-table__cards{display:none}.rt-table--cards{display:block;min-width:0;max-width:100%}.rt-table--cards .cdk-header-row,.rt-table--cards .cdk-row,.rt-table--cards .rt-table__skeleton-row,.rt-table--cards .rt-table__empty-row,.rt-table--cards .rt-table__filter-row{display:none}.rt-table--cards .rt-table__cards{display:flex;flex-direction:column;gap:var(--rt-space-sm)}.rt-table--cards:not(.rt-table--empty){background:transparent}.rt-table__card{display:flex;flex-direction:column;padding:var(--rt-space-md);border:var(--rt-table-border-width) solid var(--rt-color-border-default);border-radius:var(--rt-table-card-radius);background:var(--rt-color-bg-surface);gap:var(--rt-space-xs)}.rt-table__card-field{display:flex;align-items:baseline;justify-content:space-between;gap:var(--rt-space-md)}.rt-table__card-label{flex:0 0 auto;color:var(--rt-color-text-muted);font-size:var(--rt-text-sm)}.rt-table__card-value{min-width:0;overflow-wrap:anywhere;text-align:right}.rt-table__card-value .cdk-cell{display:inline;height:auto;padding:0;border:none;font:inherit;min-inline-size:0;text-align:inherit}.rt-table__card-actions{display:flex;justify-content:flex-end}.rt-table__card-skeleton-bar{display:block;width:60%;height:14px}.rt-table__card-skeleton-bar:first-child{width:80%}.rt-table[data-rt-radius=none]{--rt-table-card-radius: var(--rt-radius-none)}.rt-table[data-rt-radius=xs]{--rt-table-card-radius: var(--rt-radius-xs)}.rt-table[data-rt-radius=sm]{--rt-table-card-radius: var(--rt-radius-sm)}.rt-table[data-rt-radius=ms]{--rt-table-card-radius: var(--rt-radius-ms)}.rt-table[data-rt-radius=md]{--rt-table-card-radius: var(--rt-radius-md)}.rt-table[data-rt-radius=lg]{--rt-table-card-radius: var(--rt-radius-lg)}.rt-table[data-rt-radius=xl]{--rt-table-card-radius: var(--rt-radius-xl)}.rt-table[data-rt-radius=\"2xl\"]{--rt-table-card-radius: var(--rt-radius-2xl)}.rt-table[data-rt-radius=full]{--rt-table-card-radius: var(--rt-radius-full)}:root[data-theme=dark] .rt-table,html.rt-theme-dark .rt-table{background:var(--rt-color-bg-page)}:root[data-theme=dark] .rt-table .cdk-header-cell,:root[data-theme=dark] .rt-table .rt-table__empty,:root[data-theme=dark] .rt-table .rt-table__overlay-backdrop,html.rt-theme-dark .rt-table .cdk-header-cell,html.rt-theme-dark .rt-table .rt-table__empty,html.rt-theme-dark .rt-table .rt-table__overlay-backdrop{background:var(--rt-color-bg-page)}}\n"] }]
1329
- }], propDecorators: { actionsColumnDef: [{
1330
- type: ViewChild,
1331
- args: [CdkColumnDef, { static: true }]
1332
- }], actionsCellDef: [{
1333
- type: ViewChild,
1334
- args: [CdkCellDef, { static: true }]
1335
- }], actionsHeaderCellDef: [{
1336
- type: ViewChild,
1337
- args: [CdkHeaderCellDef, { static: true }]
1338
- }], rowActions: [{ type: i0.ContentChild, args: [i0.forwardRef(() => RtTableRowActionsDirective), { isSignal: true }] }], cardTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => RtTableCardDirective), { isSignal: true }] }], columnDefs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => CdkColumnDef), { ...{ descendants: true }, isSignal: true }] }], emptyTemplate: [{ type: i0.ContentChild, args: ['rtTableEmpty', { ...{ read: TemplateRef }, isSignal: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], density: [{ type: i0.Input, args: [{ isSignal: true, alias: "density", required: false }] }], cards: [{ type: i0.Input, args: [{ isSignal: true, alias: "cards", required: false }] }], clickable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clickable", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], fetching: [{ type: i0.Input, args: [{ isSignal: true, alias: "fetching", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], columnsConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnsConfig", required: false }] }], tableId: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableId", required: false }] }], showRowActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "showRowActions", required: false }] }], rowHasActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowHasActions", required: false }] }], showFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFilters", required: false }] }], filters: [{ type: i0.Input, args: [{ isSignal: true, alias: "filters", required: false }] }], filtersChange: [{ type: i0.Output, args: ["filtersChange"] }], sort: [{ type: i0.Input, args: [{ isSignal: true, alias: "sort", required: false }] }], sortChange: [{ type: i0.Output, args: ["sortChange"] }], skeletonRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "skeletonRows", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], emptyIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyIcon", required: false }] }], emptyDescription: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyDescription", required: false }] }] } });
1339
-
1340
- const BEM_BLOCK$2 = 'rt-table-sort-header';
1341
- /** Иконка направления: без сортировки — обе стрелки, иначе стрелка выбранного порядка. */
1151
+ const DEFAULT_EMPTY_KEY = "uiNoRows";
1152
+ var RtTableComponent = class RtTableComponent extends CdkTable {
1153
+ constructor() {
1154
+ super(...arguments);
1155
+ this.#t_uiNoRows = rtKitLabel(DEFAULT_EMPTY_KEY);
1156
+ this.#destroyRef = inject(DestroyRef);
1157
+ this.#breakpoints = inject(BreakpointsService);
1158
+ this.#dataSourceVersion = signal(0, ...ngDevMode ? [{ debugName: "#dataSourceVersion" }] : /* istanbul ignore next */ []);
1159
+ this.#sort = linkedSignal(() => this.sort(), ...ngDevMode ? [{ debugName: "#sort" }] : /* istanbul ignore next */ []);
1160
+ this.#columnSettings = new RtTableColumnSettings(() => this.columnsConfig(), () => this.tableId());
1161
+ this.hostRole = inject(ElementRef).nativeElement.tagName === "RT-TABLE" ? "table" : null;
1162
+ this.isInitialLoading = computed(() => this.loading() && this.#hasData() === false, ...ngDevMode ? [{ debugName: "isInitialLoading" }] : /* istanbul ignore next */ []);
1163
+ this.isEmpty = computed(() => !this.loading() && !this.fetching() && this.#hasData() === false, ...ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []);
1164
+ this.skeletonRowIndexes = computed(() => Array.from({ length: this.skeletonRows() }, (_, i) => i), ...ngDevMode ? [{ debugName: "skeletonRowIndexes" }] : /* istanbul ignore next */ []);
1165
+ this.rowActions = contentChild(RtTableRowActionsDirective, ...ngDevMode ? [{ debugName: "rowActions" }] : /* istanbul ignore next */ []);
1166
+ this.cardTemplate = contentChild(RtTableCardDirective, ...ngDevMode ? [{ debugName: "cardTemplate" }] : /* istanbul ignore next */ []);
1167
+ this.columnDefs = contentChildren(CdkColumnDef, {
1168
+ ...ngDevMode ? { debugName: "columnDefs" } : /* istanbul ignore next */ {},
1169
+ descendants: true
1170
+ });
1171
+ this.isNarrow = this.#breakpoints.narrow;
1172
+ this.showCards = computed(() => this.cards() && this.isNarrow(), ...ngDevMode ? [{ debugName: "showCards" }] : /* istanbul ignore next */ []);
1173
+ this.cardRows = computed(() => {
1174
+ this.#dataSourceVersion();
1175
+ return cardRowsOf(this.dataSource);
1176
+ }, ...ngDevMode ? [{ debugName: "cardRows" }] : /* istanbul ignore next */ []);
1177
+ this.cardColumns = computed(() => cardColumnsOf(this.displayedColumns(), this.columnDefs(), this.columnsConfig()), ...ngDevMode ? [{ debugName: "cardColumns" }] : /* istanbul ignore next */ []);
1178
+ this.emptyTemplate = contentChild("rtTableEmpty", {
1179
+ ...ngDevMode ? { debugName: "emptyTemplate" } : /* istanbul ignore next */ {},
1180
+ read: TemplateRef
1181
+ });
1182
+ this.ariaLabel = input(null, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
1183
+ this.density = input("default", ...ngDevMode ? [{ debugName: "density" }] : /* istanbul ignore next */ []);
1184
+ this.cards = input(true, {
1185
+ ...ngDevMode ? { debugName: "cards" } : /* istanbul ignore next */ {},
1186
+ transform: booleanAttribute
1187
+ });
1188
+ this.clickable = input(false, {
1189
+ ...ngDevMode ? { debugName: "clickable" } : /* istanbul ignore next */ {},
1190
+ transform: booleanAttribute
1191
+ });
1192
+ this.loading = input(false, {
1193
+ ...ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {},
1194
+ transform: booleanAttribute
1195
+ });
1196
+ this.fetching = input(false, {
1197
+ ...ngDevMode ? { debugName: "fetching" } : /* istanbul ignore next */ {},
1198
+ transform: booleanAttribute
1199
+ });
1200
+ this.columns = input([], ...ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []);
1201
+ this.columnsConfig = input([], ...ngDevMode ? [{ debugName: "columnsConfig" }] : /* istanbul ignore next */ []);
1202
+ this.tableId = input(null, ...ngDevMode ? [{ debugName: "tableId" }] : /* istanbul ignore next */ []);
1203
+ this.showRowActions = input(false, {
1204
+ ...ngDevMode ? { debugName: "showRowActions" } : /* istanbul ignore next */ {},
1205
+ transform: booleanAttribute
1206
+ });
1207
+ this.rowHasActions = input(null, ...ngDevMode ? [{ debugName: "rowHasActions" }] : /* istanbul ignore next */ []);
1208
+ this.showFilters = input(false, {
1209
+ ...ngDevMode ? { debugName: "showFilters" } : /* istanbul ignore next */ {},
1210
+ transform: booleanAttribute
1211
+ });
1212
+ this.filters = input([], ...ngDevMode ? [{ debugName: "filters" }] : /* istanbul ignore next */ []);
1213
+ this.filtersChange = output();
1214
+ this.sort = input(null, ...ngDevMode ? [{ debugName: "sort" }] : /* istanbul ignore next */ []);
1215
+ this.sortChange = output();
1216
+ this.currentSort = this.#sort.asReadonly();
1217
+ this.resolvedColumns = computed(() => this.#columnSettings.resolved(), ...ngDevMode ? [{ debugName: "resolvedColumns" }] : /* istanbul ignore next */ []);
1218
+ this.displayedColumns = computed(() => displayedColumnKeys(this.resolvedColumns(), this.columns(), this.columnsConfig().length > 0, this.showRowActions()), ...ngDevMode ? [{ debugName: "displayedColumns" }] : /* istanbul ignore next */ []);
1219
+ this.filterCells = computed(() => filterCellsOf(this.displayedColumns(), this.columnsConfig()), ...ngDevMode ? [{ debugName: "filterCells" }] : /* istanbul ignore next */ []);
1220
+ this.canConfigure = this.#columnSettings.canConfigure;
1221
+ this.skeletonRows = input(DEFAULT_SKELETON_ROWS, {
1222
+ ...ngDevMode ? { debugName: "skeletonRows" } : /* istanbul ignore next */ {},
1223
+ transform: numberAttribute
1224
+ });
1225
+ this.emptyMessage = input("", ...ngDevMode ? [{ debugName: "emptyMessage" }] : /* istanbul ignore next */ []);
1226
+ this.emptyText = computed(() => this.emptyMessage() || this.#t_uiNoRows(), ...ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []);
1227
+ this.emptyIcon = input("inbox", ...ngDevMode ? [{ debugName: "emptyIcon" }] : /* istanbul ignore next */ []);
1228
+ this.emptyDescription = input(null, ...ngDevMode ? [{ debugName: "emptyDescription" }] : /* istanbul ignore next */ []);
1229
+ }
1230
+ #t_uiNoRows;
1231
+ #destroyRef;
1232
+ #breakpoints;
1233
+ #dataSourceVersion;
1234
+ #sort;
1235
+ #columnSettings;
1236
+ ngOnInit() {
1237
+ super.ngOnInit();
1238
+ if (this.actionsColumnDef !== void 0 && this.actionsCellDef !== void 0 && this.actionsHeaderCellDef !== void 0) {
1239
+ this.actionsColumnDef.cell = this.actionsCellDef;
1240
+ this.actionsColumnDef.headerCell = this.actionsHeaderCellDef;
1241
+ this.addColumnDef(this.actionsColumnDef);
1242
+ }
1243
+ this.#columnSettings.start();
1244
+ this.#columnSettings.saved().pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((settings) => this.applyColumnSettings(settings));
1245
+ }
1246
+ ngOnDestroy() {
1247
+ if (this.actionsColumnDef !== void 0) this.removeColumnDef(this.actionsColumnDef);
1248
+ this.#columnSettings.stop();
1249
+ super.ngOnDestroy();
1250
+ }
1251
+ toggleSort(propertyName) {
1252
+ const selected = nextSort(this.#sort(), propertyName);
1253
+ this.#sort.set(selected);
1254
+ this.sortChange.emit(selected);
1255
+ }
1256
+ reportFilters(filters) {
1257
+ this.filtersChange.emit(filters);
1258
+ }
1259
+ applyColumnSettings(settings) {
1260
+ this.#columnSettings.apply(settings);
1261
+ }
1262
+ set dataSource(dataSource) {
1263
+ super.dataSource = dataSource;
1264
+ this.#dataSourceVersion.update((version) => version + 1);
1265
+ }
1266
+ get dataSource() {
1267
+ return super.dataSource;
1268
+ }
1269
+ #hasData() {
1270
+ this.#dataSourceVersion();
1271
+ return hasRowsIn(this.dataSource);
1272
+ }
1273
+ static {
1274
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1275
+ minVersion: "12.0.0",
1276
+ version: "22.2.2",
1277
+ ngImport: i0,
1278
+ type: RtTableComponent,
1279
+ deps: null,
1280
+ target: i0.ɵɵFactoryTarget.Component
1281
+ });
1282
+ }
1283
+ static {
1284
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
1285
+ minVersion: "17.0.0",
1286
+ version: "22.2.2",
1287
+ type: RtTableComponent,
1288
+ isStandalone: true,
1289
+ selector: "rt-table, table[rt-table]",
1290
+ inputs: {
1291
+ ariaLabel: {
1292
+ classPropertyName: "ariaLabel",
1293
+ publicName: "ariaLabel",
1294
+ isSignal: true,
1295
+ isRequired: false,
1296
+ transformFunction: null
1297
+ },
1298
+ density: {
1299
+ classPropertyName: "density",
1300
+ publicName: "density",
1301
+ isSignal: true,
1302
+ isRequired: false,
1303
+ transformFunction: null
1304
+ },
1305
+ cards: {
1306
+ classPropertyName: "cards",
1307
+ publicName: "cards",
1308
+ isSignal: true,
1309
+ isRequired: false,
1310
+ transformFunction: null
1311
+ },
1312
+ clickable: {
1313
+ classPropertyName: "clickable",
1314
+ publicName: "clickable",
1315
+ isSignal: true,
1316
+ isRequired: false,
1317
+ transformFunction: null
1318
+ },
1319
+ loading: {
1320
+ classPropertyName: "loading",
1321
+ publicName: "loading",
1322
+ isSignal: true,
1323
+ isRequired: false,
1324
+ transformFunction: null
1325
+ },
1326
+ fetching: {
1327
+ classPropertyName: "fetching",
1328
+ publicName: "fetching",
1329
+ isSignal: true,
1330
+ isRequired: false,
1331
+ transformFunction: null
1332
+ },
1333
+ columns: {
1334
+ classPropertyName: "columns",
1335
+ publicName: "columns",
1336
+ isSignal: true,
1337
+ isRequired: false,
1338
+ transformFunction: null
1339
+ },
1340
+ columnsConfig: {
1341
+ classPropertyName: "columnsConfig",
1342
+ publicName: "columnsConfig",
1343
+ isSignal: true,
1344
+ isRequired: false,
1345
+ transformFunction: null
1346
+ },
1347
+ tableId: {
1348
+ classPropertyName: "tableId",
1349
+ publicName: "tableId",
1350
+ isSignal: true,
1351
+ isRequired: false,
1352
+ transformFunction: null
1353
+ },
1354
+ showRowActions: {
1355
+ classPropertyName: "showRowActions",
1356
+ publicName: "showRowActions",
1357
+ isSignal: true,
1358
+ isRequired: false,
1359
+ transformFunction: null
1360
+ },
1361
+ rowHasActions: {
1362
+ classPropertyName: "rowHasActions",
1363
+ publicName: "rowHasActions",
1364
+ isSignal: true,
1365
+ isRequired: false,
1366
+ transformFunction: null
1367
+ },
1368
+ showFilters: {
1369
+ classPropertyName: "showFilters",
1370
+ publicName: "showFilters",
1371
+ isSignal: true,
1372
+ isRequired: false,
1373
+ transformFunction: null
1374
+ },
1375
+ filters: {
1376
+ classPropertyName: "filters",
1377
+ publicName: "filters",
1378
+ isSignal: true,
1379
+ isRequired: false,
1380
+ transformFunction: null
1381
+ },
1382
+ sort: {
1383
+ classPropertyName: "sort",
1384
+ publicName: "sort",
1385
+ isSignal: true,
1386
+ isRequired: false,
1387
+ transformFunction: null
1388
+ },
1389
+ skeletonRows: {
1390
+ classPropertyName: "skeletonRows",
1391
+ publicName: "skeletonRows",
1392
+ isSignal: true,
1393
+ isRequired: false,
1394
+ transformFunction: null
1395
+ },
1396
+ emptyMessage: {
1397
+ classPropertyName: "emptyMessage",
1398
+ publicName: "emptyMessage",
1399
+ isSignal: true,
1400
+ isRequired: false,
1401
+ transformFunction: null
1402
+ },
1403
+ emptyIcon: {
1404
+ classPropertyName: "emptyIcon",
1405
+ publicName: "emptyIcon",
1406
+ isSignal: true,
1407
+ isRequired: false,
1408
+ transformFunction: null
1409
+ },
1410
+ emptyDescription: {
1411
+ classPropertyName: "emptyDescription",
1412
+ publicName: "emptyDescription",
1413
+ isSignal: true,
1414
+ isRequired: false,
1415
+ transformFunction: null
1416
+ }
1417
+ },
1418
+ outputs: {
1419
+ filtersChange: "filtersChange",
1420
+ sortChange: "sortChange"
1421
+ },
1422
+ host: {
1423
+ properties: {
1424
+ "class.rt-table--density--compact": "density() === 'compact'",
1425
+ "class.rt-table--clickable": "clickable()",
1426
+ "class.rt-table--loading": "isInitialLoading()",
1427
+ "class.rt-table--fetching": "fetching()",
1428
+ "class.rt-table--empty": "isEmpty()",
1429
+ "class.rt-table--cards": "showCards()",
1430
+ "attr.role": "hostRole",
1431
+ "attr.aria-label": "ariaLabel()",
1432
+ "attr.aria-busy": "isInitialLoading() || fetching() ? 'true' : null"
1433
+ },
1434
+ classAttribute: "rt-table"
1435
+ },
1436
+ providers: [{
1437
+ provide: CDK_TABLE,
1438
+ useExisting: forwardRef(() => RtTableComponent)
1439
+ }],
1440
+ queries: [
1441
+ {
1442
+ propertyName: "rowActions",
1443
+ first: true,
1444
+ predicate: RtTableRowActionsDirective,
1445
+ descendants: true,
1446
+ isSignal: true
1447
+ },
1448
+ {
1449
+ propertyName: "cardTemplate",
1450
+ first: true,
1451
+ predicate: RtTableCardDirective,
1452
+ descendants: true,
1453
+ isSignal: true
1454
+ },
1455
+ {
1456
+ propertyName: "columnDefs",
1457
+ predicate: CdkColumnDef,
1458
+ descendants: true,
1459
+ isSignal: true
1460
+ },
1461
+ {
1462
+ propertyName: "emptyTemplate",
1463
+ first: true,
1464
+ predicate: ["rtTableEmpty"],
1465
+ descendants: true,
1466
+ read: TemplateRef,
1467
+ isSignal: true
1468
+ }
1469
+ ],
1470
+ viewQueries: [
1471
+ {
1472
+ propertyName: "actionsColumnDef",
1473
+ first: true,
1474
+ predicate: CdkColumnDef,
1475
+ descendants: true,
1476
+ static: true
1477
+ },
1478
+ {
1479
+ propertyName: "actionsCellDef",
1480
+ first: true,
1481
+ predicate: CdkCellDef,
1482
+ descendants: true,
1483
+ static: true
1484
+ },
1485
+ {
1486
+ propertyName: "actionsHeaderCellDef",
1487
+ first: true,
1488
+ predicate: CdkHeaderCellDef,
1489
+ descendants: true,
1490
+ static: true
1491
+ }
1492
+ ],
1493
+ exportAs: ["rtTable"],
1494
+ usesInheritance: true,
1495
+ hostDirectives: [{
1496
+ directive: i1.RtRadiusDirective,
1497
+ inputs: ["radius", "radius"]
1498
+ }],
1499
+ ngImport: i0,
1500
+ template: "<ng-container rtBlock=\"rt-table\">\n <ng-content select=\"caption\" />\n <ng-content select=\"colgroup, col\" />\n\n <ng-container cdkColumnDef=\"rtRowActions\">\n <th *cdkHeaderCellDef rtElem=\"actions-header\" cdk-header-cell aria-hidden=\"true\"></th>\n <td *cdkCellDef=\"let row\" rtElem=\"actions-cell\" qa-dataid=\"table-row-actions\" cdk-cell>\n @if (rowActions()?.template; as tpl) {\n @if (row | rtRowHasActions: rowHasActions()) {\n <div rtElem=\"actions-float\">\n <rt-menu>\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n </rt-menu>\n </div>\n }\n }\n </td>\n </ng-container>\n\n <ng-container headerRowOutlet />\n\n @if (showFilters()) {\n <tr rtElem=\"filter-row\" qa-dataid=\"table-filter-row\">\n @for (cell of filterCells(); track cell.key) {\n <th\n rtElem=\"filter-cell\"\n qa-dataid=\"table-filter-cell\"\n [rtMod]=\"{ actions: cell.actions }\"\n [attr.aria-hidden]=\"cell.actions || null\">\n @if (cell.filter) {\n <rt-table-filter-header\n [propertyName]=\"cell.key\"\n [filter]=\"cell.filter\"\n [filters]=\"filters()\"\n (filtersChange)=\"reportFilters($event)\" />\n }\n </th>\n }\n </tr>\n }\n\n @if (isInitialLoading()) {\n @for (i of skeletonRowIndexes(); track i) {\n <tr rtElem=\"skeleton-row\" qa-dataid=\"table-skeleton-row\">\n @for (col of displayedColumns(); track col) {\n <td rtElem=\"skeleton-cell\">\n <rt-skeleton rtElem=\"skeleton-bar\" />\n </td>\n }\n </tr>\n }\n }\n\n <ng-container rowOutlet />\n <ng-container noDataRowOutlet />\n <ng-container footerRowOutlet />\n\n @if (isEmpty()) {\n <tr rtElem=\"empty-row\" qa-dataid=\"table-empty-row\">\n <td rtElem=\"empty\" [attr.colspan]=\"displayedColumns().length || null\">\n @if (emptyTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <rt-empty-state\n rtElem=\"empty-message\"\n qa-dataid=\"table-empty\"\n [icon]=\"emptyIcon()\"\n [title]=\"emptyText()\"\n [description]=\"emptyDescription()\" />\n }\n </td>\n </tr>\n }\n\n @if (showCards()) {\n <div rtElem=\"cards\" qa-dataid=\"table-cards\" role=\"list\">\n @if (isInitialLoading()) {\n @for (i of skeletonRowIndexes(); track i) {\n <article rtElem=\"card\" qa-dataid=\"table-skeleton-card\" [rtMod]=\"{ skeleton: true }\">\n <rt-skeleton rtElem=\"card-skeleton-bar\" />\n <rt-skeleton rtElem=\"card-skeleton-bar\" />\n </article>\n }\n } @else if (isEmpty()) {\n @if (emptyTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <rt-empty-state\n rtElem=\"empty-message\"\n qa-dataid=\"table-empty\"\n [icon]=\"emptyIcon()\"\n [title]=\"emptyText()\"\n [description]=\"emptyDescription()\" />\n }\n } @else {\n @for (row of cardRows(); track row; let index = $index) {\n <article\n rtElem=\"card\"\n qa-dataid=\"table-card\"\n role=\"listitem\"\n [rtTableCardActivation]=\"index\"\n [rtTableCardActivationEnabled]=\"clickable()\">\n @if (cardTemplate()?.template; as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n } @else {\n @for (col of cardColumns(); track col.key) {\n <div rtElem=\"card-field\" qa-dataid=\"table-card-field\" [attr.data-key]=\"col.key\">\n <span rtElem=\"card-label\" qa-dataid=\"table-card-label\">{{ col.label }}</span>\n <div rtElem=\"card-value\" qa-dataid=\"table-card-value\">\n <ng-container [ngTemplateOutlet]=\"col.cell\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n </div>\n </div>\n }\n @if (rowActions()?.template; as tpl) {\n @if (row | rtRowHasActions: rowHasActions()) {\n <div rtElem=\"card-actions\" qa-dataid=\"table-card-actions\">\n <rt-menu>\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n </rt-menu>\n </div>\n }\n }\n }\n </article>\n }\n }\n </div>\n }\n</ng-container>\n",
1501
+ styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-table{--rt-table-border-width: var(--rt-border-width-thin);--rt-table-card-radius: var(--rt-radius-md);position:relative;display:table;width:100%;background:var(--rt-color-bg-surface);border-collapse:collapse;color:var(--rt-color-text-primary)}.rt-table .cdk-header-cell,.rt-table .cdk-cell,.rt-table__filter-cell,.rt-table__skeleton-cell{position:relative;height:50px;padding:var(--rt-space-2) var(--rt-space-5);border-bottom:var(--rt-table-border-width) solid var(--rt-color-border-subtle);border-left:var(--rt-table-border-width) solid var(--rt-color-border-subtle);font-size:var(--rt-text-sm);font-weight:var(--rt-font-weight-medium);text-align:start;vertical-align:middle}.rt-table .cdk-header-cell[data-align=right],.rt-table .cdk-cell[data-align=right],.rt-table__filter-cell[data-align=right],.rt-table__skeleton-cell[data-align=right],.rt-table .cdk-header-cell[data-align=right] input,.rt-table .cdk-cell[data-align=right] input,.rt-table__filter-cell[data-align=right] input,.rt-table__skeleton-cell[data-align=right] input{text-align:right}.rt-table .cdk-header-cell:first-child,.rt-table .cdk-cell:first-child,.rt-table__filter-cell:first-child,.rt-table__skeleton-cell:first-child{border-left:none}.rt-table .cdk-header-cell{border-top:var(--rt-table-border-width) solid var(--rt-color-border-subtle);background:var(--rt-color-bg-surface);color:var(--rt-color-text-muted)}.rt-table .cdk-cell{color:var(--rt-color-text-primary);overflow-wrap:anywhere}.rt-table__filter-row{display:table-row}.rt-table__filter-cell{height:auto;background:var(--rt-color-bg-surface);padding-block:var(--rt-space-1);vertical-align:middle}.rt-table__filter-cell--actions,.rt-table__actions-header.cdk-header-cell{width:0;padding:0;border:none}.rt-table__actions-cell.cdk-cell{position:sticky;z-index:1;right:0;width:0;padding:0;border:none;background:transparent}.rt-table__actions-float{position:absolute;display:flex;height:100%;align-items:center;padding:0 var(--rt-space-2) 0 var(--rt-space-8);background:linear-gradient(to right,transparent 0%,var(--rt-color-bg-hover) 45%);inset:0 0 0 auto;pointer-events:none}.rt-table__actions-float .rt-menu{pointer-events:auto}@media(hover:hover){.rt-table__actions-cell.cdk-cell{visibility:hidden}.cdk-row:hover .rt-table__actions-cell.cdk-cell,.cdk-row:focus-within .rt-table__actions-cell.cdk-cell,.rt-table__actions-cell.cdk-cell:has(.rt-menu--open){visibility:visible}}.rt-table .cdk-row:hover{background:var(--rt-color-bg-hover)}.rt-table .cdk-row.rt-table__row--danger,.rt-table .cdk-row.rt-table__row--danger:hover{background:var(--rt-color-state-danger-bg)}.rt-table--clickable .cdk-row,.rt-table--clickable .rt-table__card{cursor:pointer}.rt-table--clickable .cdk-row:focus-visible,.rt-table--clickable .rt-table__card:focus-visible{outline:2px solid var(--rt-color-action-primary);outline-offset:-2px}.rt-table a{text-decoration:none}.rt-table--density--compact .cdk-header-cell,.rt-table--density--compact .cdk-cell,.rt-table--density--compact .rt-table__skeleton-cell{height:36px;padding:var(--rt-space-xs) var(--rt-space-sm)}.rt-table__skeleton-bar{display:block;width:80%;height:14px}.rt-table__empty-row{display:table-row}.rt-table__empty{padding:var(--rt-space-6) var(--rt-space-5);border-bottom:var(--rt-table-border-width) solid var(--rt-color-border-subtle);background:var(--rt-color-bg-surface);color:var(--rt-color-text-muted);text-align:center}.rt-table__empty-message{margin:0;font-size:var(--rt-text-sm)}.rt-table__overlay{position:absolute;z-index:1;display:grid;min-height:100%;inset:0;place-items:center;pointer-events:none}.rt-table__overlay-backdrop{position:absolute;background:var(--rt-color-bg-surface);inset:0;opacity:.72}.rt-table__overlay-spinner{position:sticky;z-index:1;top:50%;display:flex;align-items:center;justify-content:center;transform:translateY(-50%)}.rt-table__cards{display:none}.rt-table--cards{display:block;min-width:0;max-width:100%}.rt-table--cards .cdk-header-row,.rt-table--cards .cdk-row,.rt-table--cards .rt-table__skeleton-row,.rt-table--cards .rt-table__empty-row,.rt-table--cards .rt-table__filter-row{display:none}.rt-table--cards .rt-table__cards{display:flex;flex-direction:column;gap:var(--rt-space-sm)}.rt-table--cards:not(.rt-table--empty){background:transparent}.rt-table__card{display:flex;flex-direction:column;padding:var(--rt-space-md);border:var(--rt-table-border-width) solid var(--rt-color-border-default);border-radius:var(--rt-table-card-radius);background:var(--rt-color-bg-surface);gap:var(--rt-space-xs)}.rt-table__card-field{display:flex;align-items:baseline;justify-content:space-between;gap:var(--rt-space-md)}.rt-table__card-label{flex:0 0 auto;color:var(--rt-color-text-muted);font-size:var(--rt-text-sm)}.rt-table__card-value{min-width:0;overflow-wrap:anywhere;text-align:right}.rt-table__card-value .cdk-cell{display:inline;height:auto;padding:0;border:none;font:inherit;min-inline-size:0;text-align:inherit}.rt-table__card-actions{display:flex;justify-content:flex-end}.rt-table__card-skeleton-bar{display:block;width:60%;height:14px}.rt-table__card-skeleton-bar:first-child{width:80%}.rt-table[data-rt-radius=none]{--rt-table-card-radius: var(--rt-radius-none)}.rt-table[data-rt-radius=xs]{--rt-table-card-radius: var(--rt-radius-xs)}.rt-table[data-rt-radius=sm]{--rt-table-card-radius: var(--rt-radius-sm)}.rt-table[data-rt-radius=ms]{--rt-table-card-radius: var(--rt-radius-ms)}.rt-table[data-rt-radius=md]{--rt-table-card-radius: var(--rt-radius-md)}.rt-table[data-rt-radius=lg]{--rt-table-card-radius: var(--rt-radius-lg)}.rt-table[data-rt-radius=xl]{--rt-table-card-radius: var(--rt-radius-xl)}.rt-table[data-rt-radius=\"2xl\"]{--rt-table-card-radius: var(--rt-radius-2xl)}.rt-table[data-rt-radius=full]{--rt-table-card-radius: var(--rt-radius-full)}:root[data-theme=dark] .rt-table,html.rt-theme-dark .rt-table{background:var(--rt-color-bg-page)}:root[data-theme=dark] .rt-table .cdk-header-cell,:root[data-theme=dark] .rt-table .rt-table__empty,:root[data-theme=dark] .rt-table .rt-table__overlay-backdrop,html.rt-theme-dark .rt-table .cdk-header-cell,html.rt-theme-dark .rt-table .rt-table__empty,html.rt-theme-dark .rt-table .rt-table__overlay-backdrop{background:var(--rt-color-bg-page)}}\n"],
1502
+ dependencies: [
1503
+ {
1504
+ kind: "directive",
1505
+ type: CdkCell,
1506
+ selector: "cdk-cell, td[cdk-cell]"
1507
+ },
1508
+ {
1509
+ kind: "directive",
1510
+ type: CdkCellDef,
1511
+ selector: "[cdkCellDef]"
1512
+ },
1513
+ {
1514
+ kind: "directive",
1515
+ type: CdkColumnDef,
1516
+ selector: "[cdkColumnDef]",
1517
+ inputs: [
1518
+ "cdkColumnDef",
1519
+ "sticky",
1520
+ "stickyEnd"
1521
+ ]
1522
+ },
1523
+ {
1524
+ kind: "directive",
1525
+ type: CdkHeaderCell,
1526
+ selector: "cdk-header-cell, th[cdk-header-cell]"
1527
+ },
1528
+ {
1529
+ kind: "directive",
1530
+ type: CdkHeaderCellDef,
1531
+ selector: "[cdkHeaderCellDef]"
1532
+ },
1533
+ {
1534
+ kind: "directive",
1535
+ type: DataRowOutlet,
1536
+ selector: "[rowOutlet]"
1537
+ },
1538
+ {
1539
+ kind: "directive",
1540
+ type: FooterRowOutlet,
1541
+ selector: "[footerRowOutlet]"
1542
+ },
1543
+ {
1544
+ kind: "directive",
1545
+ type: HeaderRowOutlet,
1546
+ selector: "[headerRowOutlet]"
1547
+ },
1548
+ {
1549
+ kind: "directive",
1550
+ type: NoDataRowOutlet,
1551
+ selector: "[noDataRowOutlet]"
1552
+ },
1553
+ {
1554
+ kind: "directive",
1555
+ type: NgTemplateOutlet,
1556
+ selector: "[ngTemplateOutlet]",
1557
+ inputs: [
1558
+ "ngTemplateOutletContext",
1559
+ "ngTemplateOutlet",
1560
+ "ngTemplateOutletInjector"
1561
+ ]
1562
+ },
1563
+ {
1564
+ kind: "component",
1565
+ type: RtEmptyStateComponent,
1566
+ selector: "rt-empty-state",
1567
+ inputs: [
1568
+ "icon",
1569
+ "glyph",
1570
+ "title",
1571
+ "description",
1572
+ "framed"
1573
+ ]
1574
+ },
1575
+ {
1576
+ kind: "component",
1577
+ type: RtMenuComponent,
1578
+ selector: "rt-menu",
1579
+ inputs: [
1580
+ "icon",
1581
+ "ariaLabel",
1582
+ "align",
1583
+ "panelClass",
1584
+ "triggerSize",
1585
+ "size",
1586
+ "disabled"
1587
+ ],
1588
+ outputs: ["openedChange"]
1589
+ },
1590
+ {
1591
+ kind: "component",
1592
+ type: RtSkeletonComponent,
1593
+ selector: "rt-skeleton",
1594
+ inputs: [
1595
+ "shape",
1596
+ "size",
1597
+ "width",
1598
+ "height",
1599
+ "animation"
1600
+ ]
1601
+ },
1602
+ {
1603
+ kind: "component",
1604
+ type: RtTableFilterHeaderComponent,
1605
+ selector: "rt-table-filter-header",
1606
+ inputs: [
1607
+ "propertyName",
1608
+ "filter",
1609
+ "filters"
1610
+ ],
1611
+ outputs: ["filtersChange"]
1612
+ },
1613
+ {
1614
+ kind: "directive",
1615
+ type: RtTableCardActivationDirective,
1616
+ selector: "[rtTableCardActivation]",
1617
+ inputs: ["rtTableCardActivation", "rtTableCardActivationEnabled"]
1618
+ },
1619
+ {
1620
+ kind: "directive",
1621
+ type: BlockDirective,
1622
+ selector: "[rtBlock]",
1623
+ inputs: ["rtMod"]
1624
+ },
1625
+ {
1626
+ kind: "directive",
1627
+ type: ElemDirective,
1628
+ selector: "[rtElem]",
1629
+ inputs: ["rtMod"]
1630
+ },
1631
+ {
1632
+ kind: "directive",
1633
+ type: ModDirective,
1634
+ selector: "[rtMod]"
1635
+ },
1636
+ {
1637
+ kind: "pipe",
1638
+ type: RtRowHasActionsPipe,
1639
+ name: "rtRowHasActions"
1640
+ }
1641
+ ],
1642
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
1643
+ encapsulation: i0.ViewEncapsulation.None
1644
+ });
1645
+ }
1646
+ };
1647
+ i0.ɵɵngDeclareClassMetadata({
1648
+ minVersion: "12.0.0",
1649
+ version: "22.2.2",
1650
+ ngImport: i0,
1651
+ type: RtTableComponent,
1652
+ decorators: [{
1653
+ type: Component,
1654
+ args: [{
1655
+ selector: "rt-table, table[rt-table]",
1656
+ exportAs: "rtTable",
1657
+ changeDetection: ChangeDetectionStrategy.OnPush,
1658
+ encapsulation: ViewEncapsulation.None,
1659
+ imports: [
1660
+ CdkCell,
1661
+ CdkCellDef,
1662
+ CdkColumnDef,
1663
+ CdkHeaderCell,
1664
+ CdkHeaderCellDef,
1665
+ DataRowOutlet,
1666
+ FooterRowOutlet,
1667
+ HeaderRowOutlet,
1668
+ NoDataRowOutlet,
1669
+ NgTemplateOutlet,
1670
+ RtEmptyStateComponent,
1671
+ RtMenuComponent,
1672
+ RtSkeletonComponent,
1673
+ RtSpinnerComponent,
1674
+ RtTableFilterHeaderComponent,
1675
+ RtTableCardActivationDirective,
1676
+ BlockDirective,
1677
+ ElemDirective,
1678
+ ModDirective,
1679
+ RtRowHasActionsPipe
1680
+ ],
1681
+ hostDirectives: [{
1682
+ directive: RtRadiusDirective,
1683
+ inputs: ["radius"]
1684
+ }],
1685
+ providers: [{
1686
+ provide: CDK_TABLE,
1687
+ useExisting: forwardRef(() => RtTableComponent)
1688
+ }],
1689
+ host: {
1690
+ class: BEM_BLOCK$3,
1691
+ "[class.rt-table--density--compact]": "density() === 'compact'",
1692
+ "[class.rt-table--clickable]": "clickable()",
1693
+ "[class.rt-table--loading]": "isInitialLoading()",
1694
+ "[class.rt-table--fetching]": "fetching()",
1695
+ "[class.rt-table--empty]": "isEmpty()",
1696
+ "[class.rt-table--cards]": "showCards()",
1697
+ "[attr.role]": "hostRole",
1698
+ "[attr.aria-label]": "ariaLabel()",
1699
+ "[attr.aria-busy]": "isInitialLoading() || fetching() ? 'true' : null"
1700
+ },
1701
+ template: "<ng-container rtBlock=\"rt-table\">\n <ng-content select=\"caption\" />\n <ng-content select=\"colgroup, col\" />\n\n <ng-container cdkColumnDef=\"rtRowActions\">\n <th *cdkHeaderCellDef rtElem=\"actions-header\" cdk-header-cell aria-hidden=\"true\"></th>\n <td *cdkCellDef=\"let row\" rtElem=\"actions-cell\" qa-dataid=\"table-row-actions\" cdk-cell>\n @if (rowActions()?.template; as tpl) {\n @if (row | rtRowHasActions: rowHasActions()) {\n <div rtElem=\"actions-float\">\n <rt-menu>\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n </rt-menu>\n </div>\n }\n }\n </td>\n </ng-container>\n\n <ng-container headerRowOutlet />\n\n @if (showFilters()) {\n <tr rtElem=\"filter-row\" qa-dataid=\"table-filter-row\">\n @for (cell of filterCells(); track cell.key) {\n <th\n rtElem=\"filter-cell\"\n qa-dataid=\"table-filter-cell\"\n [rtMod]=\"{ actions: cell.actions }\"\n [attr.aria-hidden]=\"cell.actions || null\">\n @if (cell.filter) {\n <rt-table-filter-header\n [propertyName]=\"cell.key\"\n [filter]=\"cell.filter\"\n [filters]=\"filters()\"\n (filtersChange)=\"reportFilters($event)\" />\n }\n </th>\n }\n </tr>\n }\n\n @if (isInitialLoading()) {\n @for (i of skeletonRowIndexes(); track i) {\n <tr rtElem=\"skeleton-row\" qa-dataid=\"table-skeleton-row\">\n @for (col of displayedColumns(); track col) {\n <td rtElem=\"skeleton-cell\">\n <rt-skeleton rtElem=\"skeleton-bar\" />\n </td>\n }\n </tr>\n }\n }\n\n <ng-container rowOutlet />\n <ng-container noDataRowOutlet />\n <ng-container footerRowOutlet />\n\n @if (isEmpty()) {\n <tr rtElem=\"empty-row\" qa-dataid=\"table-empty-row\">\n <td rtElem=\"empty\" [attr.colspan]=\"displayedColumns().length || null\">\n @if (emptyTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <rt-empty-state\n rtElem=\"empty-message\"\n qa-dataid=\"table-empty\"\n [icon]=\"emptyIcon()\"\n [title]=\"emptyText()\"\n [description]=\"emptyDescription()\" />\n }\n </td>\n </tr>\n }\n\n @if (showCards()) {\n <div rtElem=\"cards\" qa-dataid=\"table-cards\" role=\"list\">\n @if (isInitialLoading()) {\n @for (i of skeletonRowIndexes(); track i) {\n <article rtElem=\"card\" qa-dataid=\"table-skeleton-card\" [rtMod]=\"{ skeleton: true }\">\n <rt-skeleton rtElem=\"card-skeleton-bar\" />\n <rt-skeleton rtElem=\"card-skeleton-bar\" />\n </article>\n }\n } @else if (isEmpty()) {\n @if (emptyTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <rt-empty-state\n rtElem=\"empty-message\"\n qa-dataid=\"table-empty\"\n [icon]=\"emptyIcon()\"\n [title]=\"emptyText()\"\n [description]=\"emptyDescription()\" />\n }\n } @else {\n @for (row of cardRows(); track row; let index = $index) {\n <article\n rtElem=\"card\"\n qa-dataid=\"table-card\"\n role=\"listitem\"\n [rtTableCardActivation]=\"index\"\n [rtTableCardActivationEnabled]=\"clickable()\">\n @if (cardTemplate()?.template; as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n } @else {\n @for (col of cardColumns(); track col.key) {\n <div rtElem=\"card-field\" qa-dataid=\"table-card-field\" [attr.data-key]=\"col.key\">\n <span rtElem=\"card-label\" qa-dataid=\"table-card-label\">{{ col.label }}</span>\n <div rtElem=\"card-value\" qa-dataid=\"table-card-value\">\n <ng-container [ngTemplateOutlet]=\"col.cell\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n </div>\n </div>\n }\n @if (rowActions()?.template; as tpl) {\n @if (row | rtRowHasActions: rowHasActions()) {\n <div rtElem=\"card-actions\" qa-dataid=\"table-card-actions\">\n <rt-menu>\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n </rt-menu>\n </div>\n }\n }\n }\n </article>\n }\n }\n </div>\n }\n</ng-container>\n",
1702
+ styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-table{--rt-table-border-width: var(--rt-border-width-thin);--rt-table-card-radius: var(--rt-radius-md);position:relative;display:table;width:100%;background:var(--rt-color-bg-surface);border-collapse:collapse;color:var(--rt-color-text-primary)}.rt-table .cdk-header-cell,.rt-table .cdk-cell,.rt-table__filter-cell,.rt-table__skeleton-cell{position:relative;height:50px;padding:var(--rt-space-2) var(--rt-space-5);border-bottom:var(--rt-table-border-width) solid var(--rt-color-border-subtle);border-left:var(--rt-table-border-width) solid var(--rt-color-border-subtle);font-size:var(--rt-text-sm);font-weight:var(--rt-font-weight-medium);text-align:start;vertical-align:middle}.rt-table .cdk-header-cell[data-align=right],.rt-table .cdk-cell[data-align=right],.rt-table__filter-cell[data-align=right],.rt-table__skeleton-cell[data-align=right],.rt-table .cdk-header-cell[data-align=right] input,.rt-table .cdk-cell[data-align=right] input,.rt-table__filter-cell[data-align=right] input,.rt-table__skeleton-cell[data-align=right] input{text-align:right}.rt-table .cdk-header-cell:first-child,.rt-table .cdk-cell:first-child,.rt-table__filter-cell:first-child,.rt-table__skeleton-cell:first-child{border-left:none}.rt-table .cdk-header-cell{border-top:var(--rt-table-border-width) solid var(--rt-color-border-subtle);background:var(--rt-color-bg-surface);color:var(--rt-color-text-muted)}.rt-table .cdk-cell{color:var(--rt-color-text-primary);overflow-wrap:anywhere}.rt-table__filter-row{display:table-row}.rt-table__filter-cell{height:auto;background:var(--rt-color-bg-surface);padding-block:var(--rt-space-1);vertical-align:middle}.rt-table__filter-cell--actions,.rt-table__actions-header.cdk-header-cell{width:0;padding:0;border:none}.rt-table__actions-cell.cdk-cell{position:sticky;z-index:1;right:0;width:0;padding:0;border:none;background:transparent}.rt-table__actions-float{position:absolute;display:flex;height:100%;align-items:center;padding:0 var(--rt-space-2) 0 var(--rt-space-8);background:linear-gradient(to right,transparent 0%,var(--rt-color-bg-hover) 45%);inset:0 0 0 auto;pointer-events:none}.rt-table__actions-float .rt-menu{pointer-events:auto}@media(hover:hover){.rt-table__actions-cell.cdk-cell{visibility:hidden}.cdk-row:hover .rt-table__actions-cell.cdk-cell,.cdk-row:focus-within .rt-table__actions-cell.cdk-cell,.rt-table__actions-cell.cdk-cell:has(.rt-menu--open){visibility:visible}}.rt-table .cdk-row:hover{background:var(--rt-color-bg-hover)}.rt-table .cdk-row.rt-table__row--danger,.rt-table .cdk-row.rt-table__row--danger:hover{background:var(--rt-color-state-danger-bg)}.rt-table--clickable .cdk-row,.rt-table--clickable .rt-table__card{cursor:pointer}.rt-table--clickable .cdk-row:focus-visible,.rt-table--clickable .rt-table__card:focus-visible{outline:2px solid var(--rt-color-action-primary);outline-offset:-2px}.rt-table a{text-decoration:none}.rt-table--density--compact .cdk-header-cell,.rt-table--density--compact .cdk-cell,.rt-table--density--compact .rt-table__skeleton-cell{height:36px;padding:var(--rt-space-xs) var(--rt-space-sm)}.rt-table__skeleton-bar{display:block;width:80%;height:14px}.rt-table__empty-row{display:table-row}.rt-table__empty{padding:var(--rt-space-6) var(--rt-space-5);border-bottom:var(--rt-table-border-width) solid var(--rt-color-border-subtle);background:var(--rt-color-bg-surface);color:var(--rt-color-text-muted);text-align:center}.rt-table__empty-message{margin:0;font-size:var(--rt-text-sm)}.rt-table__overlay{position:absolute;z-index:1;display:grid;min-height:100%;inset:0;place-items:center;pointer-events:none}.rt-table__overlay-backdrop{position:absolute;background:var(--rt-color-bg-surface);inset:0;opacity:.72}.rt-table__overlay-spinner{position:sticky;z-index:1;top:50%;display:flex;align-items:center;justify-content:center;transform:translateY(-50%)}.rt-table__cards{display:none}.rt-table--cards{display:block;min-width:0;max-width:100%}.rt-table--cards .cdk-header-row,.rt-table--cards .cdk-row,.rt-table--cards .rt-table__skeleton-row,.rt-table--cards .rt-table__empty-row,.rt-table--cards .rt-table__filter-row{display:none}.rt-table--cards .rt-table__cards{display:flex;flex-direction:column;gap:var(--rt-space-sm)}.rt-table--cards:not(.rt-table--empty){background:transparent}.rt-table__card{display:flex;flex-direction:column;padding:var(--rt-space-md);border:var(--rt-table-border-width) solid var(--rt-color-border-default);border-radius:var(--rt-table-card-radius);background:var(--rt-color-bg-surface);gap:var(--rt-space-xs)}.rt-table__card-field{display:flex;align-items:baseline;justify-content:space-between;gap:var(--rt-space-md)}.rt-table__card-label{flex:0 0 auto;color:var(--rt-color-text-muted);font-size:var(--rt-text-sm)}.rt-table__card-value{min-width:0;overflow-wrap:anywhere;text-align:right}.rt-table__card-value .cdk-cell{display:inline;height:auto;padding:0;border:none;font:inherit;min-inline-size:0;text-align:inherit}.rt-table__card-actions{display:flex;justify-content:flex-end}.rt-table__card-skeleton-bar{display:block;width:60%;height:14px}.rt-table__card-skeleton-bar:first-child{width:80%}.rt-table[data-rt-radius=none]{--rt-table-card-radius: var(--rt-radius-none)}.rt-table[data-rt-radius=xs]{--rt-table-card-radius: var(--rt-radius-xs)}.rt-table[data-rt-radius=sm]{--rt-table-card-radius: var(--rt-radius-sm)}.rt-table[data-rt-radius=ms]{--rt-table-card-radius: var(--rt-radius-ms)}.rt-table[data-rt-radius=md]{--rt-table-card-radius: var(--rt-radius-md)}.rt-table[data-rt-radius=lg]{--rt-table-card-radius: var(--rt-radius-lg)}.rt-table[data-rt-radius=xl]{--rt-table-card-radius: var(--rt-radius-xl)}.rt-table[data-rt-radius=\"2xl\"]{--rt-table-card-radius: var(--rt-radius-2xl)}.rt-table[data-rt-radius=full]{--rt-table-card-radius: var(--rt-radius-full)}:root[data-theme=dark] .rt-table,html.rt-theme-dark .rt-table{background:var(--rt-color-bg-page)}:root[data-theme=dark] .rt-table .cdk-header-cell,:root[data-theme=dark] .rt-table .rt-table__empty,:root[data-theme=dark] .rt-table .rt-table__overlay-backdrop,html.rt-theme-dark .rt-table .cdk-header-cell,html.rt-theme-dark .rt-table .rt-table__empty,html.rt-theme-dark .rt-table .rt-table__overlay-backdrop{background:var(--rt-color-bg-page)}}\n"]
1703
+ }]
1704
+ }],
1705
+ propDecorators: {
1706
+ actionsColumnDef: [{
1707
+ type: ViewChild,
1708
+ args: [CdkColumnDef, { static: true }]
1709
+ }],
1710
+ actionsCellDef: [{
1711
+ type: ViewChild,
1712
+ args: [CdkCellDef, { static: true }]
1713
+ }],
1714
+ actionsHeaderCellDef: [{
1715
+ type: ViewChild,
1716
+ args: [CdkHeaderCellDef, { static: true }]
1717
+ }],
1718
+ rowActions: [{
1719
+ type: i0.ContentChild,
1720
+ args: [i0.forwardRef(() => RtTableRowActionsDirective), { isSignal: true }]
1721
+ }],
1722
+ cardTemplate: [{
1723
+ type: i0.ContentChild,
1724
+ args: [i0.forwardRef(() => RtTableCardDirective), { isSignal: true }]
1725
+ }],
1726
+ columnDefs: [{
1727
+ type: i0.ContentChildren,
1728
+ args: [i0.forwardRef(() => CdkColumnDef), {
1729
+ descendants: true,
1730
+ isSignal: true
1731
+ }]
1732
+ }],
1733
+ emptyTemplate: [{
1734
+ type: i0.ContentChild,
1735
+ args: ["rtTableEmpty", {
1736
+ read: TemplateRef,
1737
+ isSignal: true
1738
+ }]
1739
+ }],
1740
+ ariaLabel: [{
1741
+ type: i0.Input,
1742
+ args: [{
1743
+ isSignal: true,
1744
+ alias: "ariaLabel",
1745
+ required: false
1746
+ }]
1747
+ }],
1748
+ density: [{
1749
+ type: i0.Input,
1750
+ args: [{
1751
+ isSignal: true,
1752
+ alias: "density",
1753
+ required: false
1754
+ }]
1755
+ }],
1756
+ cards: [{
1757
+ type: i0.Input,
1758
+ args: [{
1759
+ isSignal: true,
1760
+ alias: "cards",
1761
+ required: false
1762
+ }]
1763
+ }],
1764
+ clickable: [{
1765
+ type: i0.Input,
1766
+ args: [{
1767
+ isSignal: true,
1768
+ alias: "clickable",
1769
+ required: false
1770
+ }]
1771
+ }],
1772
+ loading: [{
1773
+ type: i0.Input,
1774
+ args: [{
1775
+ isSignal: true,
1776
+ alias: "loading",
1777
+ required: false
1778
+ }]
1779
+ }],
1780
+ fetching: [{
1781
+ type: i0.Input,
1782
+ args: [{
1783
+ isSignal: true,
1784
+ alias: "fetching",
1785
+ required: false
1786
+ }]
1787
+ }],
1788
+ columns: [{
1789
+ type: i0.Input,
1790
+ args: [{
1791
+ isSignal: true,
1792
+ alias: "columns",
1793
+ required: false
1794
+ }]
1795
+ }],
1796
+ columnsConfig: [{
1797
+ type: i0.Input,
1798
+ args: [{
1799
+ isSignal: true,
1800
+ alias: "columnsConfig",
1801
+ required: false
1802
+ }]
1803
+ }],
1804
+ tableId: [{
1805
+ type: i0.Input,
1806
+ args: [{
1807
+ isSignal: true,
1808
+ alias: "tableId",
1809
+ required: false
1810
+ }]
1811
+ }],
1812
+ showRowActions: [{
1813
+ type: i0.Input,
1814
+ args: [{
1815
+ isSignal: true,
1816
+ alias: "showRowActions",
1817
+ required: false
1818
+ }]
1819
+ }],
1820
+ rowHasActions: [{
1821
+ type: i0.Input,
1822
+ args: [{
1823
+ isSignal: true,
1824
+ alias: "rowHasActions",
1825
+ required: false
1826
+ }]
1827
+ }],
1828
+ showFilters: [{
1829
+ type: i0.Input,
1830
+ args: [{
1831
+ isSignal: true,
1832
+ alias: "showFilters",
1833
+ required: false
1834
+ }]
1835
+ }],
1836
+ filters: [{
1837
+ type: i0.Input,
1838
+ args: [{
1839
+ isSignal: true,
1840
+ alias: "filters",
1841
+ required: false
1842
+ }]
1843
+ }],
1844
+ filtersChange: [{
1845
+ type: i0.Output,
1846
+ args: ["filtersChange"]
1847
+ }],
1848
+ sort: [{
1849
+ type: i0.Input,
1850
+ args: [{
1851
+ isSignal: true,
1852
+ alias: "sort",
1853
+ required: false
1854
+ }]
1855
+ }],
1856
+ sortChange: [{
1857
+ type: i0.Output,
1858
+ args: ["sortChange"]
1859
+ }],
1860
+ skeletonRows: [{
1861
+ type: i0.Input,
1862
+ args: [{
1863
+ isSignal: true,
1864
+ alias: "skeletonRows",
1865
+ required: false
1866
+ }]
1867
+ }],
1868
+ emptyMessage: [{
1869
+ type: i0.Input,
1870
+ args: [{
1871
+ isSignal: true,
1872
+ alias: "emptyMessage",
1873
+ required: false
1874
+ }]
1875
+ }],
1876
+ emptyIcon: [{
1877
+ type: i0.Input,
1878
+ args: [{
1879
+ isSignal: true,
1880
+ alias: "emptyIcon",
1881
+ required: false
1882
+ }]
1883
+ }],
1884
+ emptyDescription: [{
1885
+ type: i0.Input,
1886
+ args: [{
1887
+ isSignal: true,
1888
+ alias: "emptyDescription",
1889
+ required: false
1890
+ }]
1891
+ }]
1892
+ }
1893
+ });
1894
+ const BEM_BLOCK$2 = "rt-table-sort-header";
1342
1895
  const ICONS = Object.freeze({
1343
- none: 'sort-alt',
1344
- [EListSortOrder.ASC]: 'arrow-up',
1345
- [EListSortOrder.DESC]: 'arrow-down',
1896
+ none: "sort-alt",
1897
+ [EListSortOrder.ASC]: "arrow-up",
1898
+ [EListSortOrder.DESC]: "arrow-down"
1899
+ });
1900
+ var RtTableSortHeaderComponent = class RtTableSortHeaderComponent {
1901
+ constructor() {
1902
+ this.#table = inject(RtTableComponent);
1903
+ this.direction = computed(() => sortDirectionOf(this.#table.currentSort(), this.rtSortHeader()), ...ngDevMode ? [{ debugName: "direction" }] : /* istanbul ignore next */ []);
1904
+ this.icon = computed(() => ICONS[this.direction() ?? "none"], ...ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []);
1905
+ this.sortable = computed(() => isColumnSortable(this.#table.columnsConfig(), this.rtSortHeader()), ...ngDevMode ? [{ debugName: "sortable" }] : /* istanbul ignore next */ []);
1906
+ this.rtSortHeader = input.required(...ngDevMode ? [{ debugName: "rtSortHeader" }] : /* istanbul ignore next */ []);
1907
+ this.ariaSort = computed(() => ariaSortOf(this.#table.currentSort(), this.rtSortHeader()), ...ngDevMode ? [{ debugName: "ariaSort" }] : /* istanbul ignore next */ []);
1908
+ }
1909
+ #table;
1910
+ onToggle() {
1911
+ this.#table.toggleSort(this.rtSortHeader());
1912
+ }
1913
+ static {
1914
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1915
+ minVersion: "12.0.0",
1916
+ version: "22.2.2",
1917
+ ngImport: i0,
1918
+ type: RtTableSortHeaderComponent,
1919
+ deps: [],
1920
+ target: i0.ɵɵFactoryTarget.Component
1921
+ });
1922
+ }
1923
+ static {
1924
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
1925
+ minVersion: "17.0.0",
1926
+ version: "22.2.2",
1927
+ type: RtTableSortHeaderComponent,
1928
+ isStandalone: true,
1929
+ selector: "rt-table-sort-header, th[rtSortHeader]",
1930
+ inputs: { rtSortHeader: {
1931
+ classPropertyName: "rtSortHeader",
1932
+ publicName: "rtSortHeader",
1933
+ isSignal: true,
1934
+ isRequired: true,
1935
+ transformFunction: null
1936
+ } },
1937
+ host: {
1938
+ properties: { "attr.aria-sort": "ariaSort()" },
1939
+ classAttribute: "rt-table-sort-header"
1940
+ },
1941
+ ngImport: i0,
1942
+ template: "<ng-template #label>\n <ng-content />\n</ng-template>\n\n<ng-container rtBlock=\"rt-table-sort-header\">\n @if (sortable()) {\n <button\n rtElem=\"button\"\n qa-dataid=\"table-sort-header\"\n type=\"button\"\n [attr.data-column]=\"rtSortHeader()\"\n [attr.data-direction]=\"direction()\"\n [rtMod]=\"{ active: direction() !== null }\"\n (click)=\"onToggle()\">\n <ng-container [ngTemplateOutlet]=\"label\" />\n <rt-icon rtElem=\"icon\" size=\"xs\" [name]=\"icon()\" />\n </button>\n } @else {\n <ng-container [ngTemplateOutlet]=\"label\" />\n }\n</ng-container>\n",
1943
+ styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-table-sort-header__button{display:inline-flex;align-items:center;padding:0;border:none;background:none;color:inherit;cursor:pointer;font:inherit;gap:var(--rt-space-xs);text-align:inherit}.rt-table-sort-header__button:hover{color:var(--rt-color-text-primary)}.rt-table-sort-header__button:focus-visible{outline:2px solid var(--rt-color-action-primary);outline-offset:2px}.rt-table-sort-header__icon{flex:0 0 auto;color:var(--rt-color-text-muted)}.rt-table-sort-header__button--active{color:var(--rt-color-text-primary)}.rt-table-sort-header__button--active .rt-table-sort-header__icon{color:var(--rt-color-action-primary)}}\n"],
1944
+ dependencies: [
1945
+ {
1946
+ kind: "directive",
1947
+ type: NgTemplateOutlet,
1948
+ selector: "[ngTemplateOutlet]",
1949
+ inputs: [
1950
+ "ngTemplateOutletContext",
1951
+ "ngTemplateOutlet",
1952
+ "ngTemplateOutletInjector"
1953
+ ]
1954
+ },
1955
+ {
1956
+ kind: "directive",
1957
+ type: BlockDirective,
1958
+ selector: "[rtBlock]",
1959
+ inputs: ["rtMod"]
1960
+ },
1961
+ {
1962
+ kind: "directive",
1963
+ type: ElemDirective,
1964
+ selector: "[rtElem]",
1965
+ inputs: ["rtMod"]
1966
+ },
1967
+ {
1968
+ kind: "directive",
1969
+ type: ModDirective,
1970
+ selector: "[rtMod]"
1971
+ },
1972
+ {
1973
+ kind: "component",
1974
+ type: RtIconComponent,
1975
+ selector: "rt-icon",
1976
+ inputs: [
1977
+ "name",
1978
+ "glyph",
1979
+ "glyphStrategy",
1980
+ "size",
1981
+ "color",
1982
+ "fill",
1983
+ "spin",
1984
+ "rotate"
1985
+ ]
1986
+ }
1987
+ ],
1988
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
1989
+ encapsulation: i0.ViewEncapsulation.None
1990
+ });
1991
+ }
1992
+ };
1993
+ i0.ɵɵngDeclareClassMetadata({
1994
+ minVersion: "12.0.0",
1995
+ version: "22.2.2",
1996
+ ngImport: i0,
1997
+ type: RtTableSortHeaderComponent,
1998
+ decorators: [{
1999
+ type: Component,
2000
+ args: [{
2001
+ selector: "rt-table-sort-header, th[rtSortHeader]",
2002
+ changeDetection: ChangeDetectionStrategy.OnPush,
2003
+ encapsulation: ViewEncapsulation.None,
2004
+ imports: [
2005
+ NgTemplateOutlet,
2006
+ BlockDirective,
2007
+ ElemDirective,
2008
+ ModDirective,
2009
+ RtIconComponent
2010
+ ],
2011
+ host: {
2012
+ class: BEM_BLOCK$2,
2013
+ "[attr.aria-sort]": "ariaSort()"
2014
+ },
2015
+ template: "<ng-template #label>\n <ng-content />\n</ng-template>\n\n<ng-container rtBlock=\"rt-table-sort-header\">\n @if (sortable()) {\n <button\n rtElem=\"button\"\n qa-dataid=\"table-sort-header\"\n type=\"button\"\n [attr.data-column]=\"rtSortHeader()\"\n [attr.data-direction]=\"direction()\"\n [rtMod]=\"{ active: direction() !== null }\"\n (click)=\"onToggle()\">\n <ng-container [ngTemplateOutlet]=\"label\" />\n <rt-icon rtElem=\"icon\" size=\"xs\" [name]=\"icon()\" />\n </button>\n } @else {\n <ng-container [ngTemplateOutlet]=\"label\" />\n }\n</ng-container>\n",
2016
+ styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-table-sort-header__button{display:inline-flex;align-items:center;padding:0;border:none;background:none;color:inherit;cursor:pointer;font:inherit;gap:var(--rt-space-xs);text-align:inherit}.rt-table-sort-header__button:hover{color:var(--rt-color-text-primary)}.rt-table-sort-header__button:focus-visible{outline:2px solid var(--rt-color-action-primary);outline-offset:2px}.rt-table-sort-header__icon{flex:0 0 auto;color:var(--rt-color-text-muted)}.rt-table-sort-header__button--active{color:var(--rt-color-text-primary)}.rt-table-sort-header__button--active .rt-table-sort-header__icon{color:var(--rt-color-action-primary)}}\n"]
2017
+ }]
2018
+ }],
2019
+ propDecorators: { rtSortHeader: [{
2020
+ type: i0.Input,
2021
+ args: [{
2022
+ isSignal: true,
2023
+ alias: "rtSortHeader",
2024
+ required: true
2025
+ }]
2026
+ }] }
2027
+ });
2028
+ var RtTableRowDirective = class RtTableRowDirective {
2029
+ constructor() {
2030
+ this.activated = output();
2031
+ }
2032
+ onClick(event) {
2033
+ if (isFromInteractive(event.target)) return;
2034
+ this.activated.emit();
2035
+ }
2036
+ onKey(event) {
2037
+ if (isFromInteractive(event.target)) return;
2038
+ event.preventDefault();
2039
+ this.activated.emit();
2040
+ }
2041
+ static {
2042
+ this.ɵfac = i0.ɵɵngDeclareFactory({
2043
+ minVersion: "12.0.0",
2044
+ version: "22.2.2",
2045
+ ngImport: i0,
2046
+ type: RtTableRowDirective,
2047
+ deps: [],
2048
+ target: i0.ɵɵFactoryTarget.Directive
2049
+ });
2050
+ }
2051
+ static {
2052
+ this.ɵdir = i0.ɵɵngDeclareDirective({
2053
+ minVersion: "14.0.0",
2054
+ version: "22.2.2",
2055
+ type: RtTableRowDirective,
2056
+ isStandalone: true,
2057
+ selector: "[rtTableRow]",
2058
+ outputs: { activated: "activated" },
2059
+ host: {
2060
+ attributes: { "tabindex": "0" },
2061
+ listeners: {
2062
+ "click": "onClick($event)",
2063
+ "keydown.enter": "onKey($event)",
2064
+ "keydown.space": "onKey($event)"
2065
+ }
2066
+ },
2067
+ ngImport: i0
2068
+ });
2069
+ }
2070
+ };
2071
+ i0.ɵɵngDeclareClassMetadata({
2072
+ minVersion: "12.0.0",
2073
+ version: "22.2.2",
2074
+ ngImport: i0,
2075
+ type: RtTableRowDirective,
2076
+ decorators: [{
2077
+ type: Directive,
2078
+ args: [{
2079
+ selector: "[rtTableRow]",
2080
+ host: {
2081
+ tabindex: "0",
2082
+ "(click)": "onClick($event)",
2083
+ "(keydown.enter)": "onKey($event)",
2084
+ "(keydown.space)": "onKey($event)"
2085
+ }
2086
+ }]
2087
+ }],
2088
+ propDecorators: { activated: [{
2089
+ type: i0.Output,
2090
+ args: ["activated"]
2091
+ }] }
2092
+ });
2093
+ const BEM_BLOCK$1 = "rt-table-settings-panel";
2094
+ var RtTableSettingsPanelComponent = class RtTableSettingsPanelComponent {
2095
+ constructor() {
2096
+ this.t = inject(RT_KIT_LABELS);
2097
+ this.items = model.required(...ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []);
2098
+ }
2099
+ onDrop(event) {
2100
+ if (event.previousIndex === event.currentIndex) return;
2101
+ const next = [...this.items()];
2102
+ moveItemInArray(next, event.previousIndex, event.currentIndex);
2103
+ this.items.set(next);
2104
+ }
2105
+ onToggleHidden(key) {
2106
+ this.items.update((items) => items.map((item) => item.key === key && item.locked !== true ? {
2107
+ ...item,
2108
+ hidden: !item.hidden
2109
+ } : item));
2110
+ }
2111
+ static {
2112
+ this.ɵfac = i0.ɵɵngDeclareFactory({
2113
+ minVersion: "12.0.0",
2114
+ version: "22.2.2",
2115
+ ngImport: i0,
2116
+ type: RtTableSettingsPanelComponent,
2117
+ deps: [],
2118
+ target: i0.ɵɵFactoryTarget.Component
2119
+ });
2120
+ }
2121
+ static {
2122
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
2123
+ minVersion: "17.0.0",
2124
+ version: "22.2.2",
2125
+ type: RtTableSettingsPanelComponent,
2126
+ isStandalone: true,
2127
+ selector: "rt-table-settings-panel",
2128
+ inputs: { items: {
2129
+ classPropertyName: "items",
2130
+ publicName: "items",
2131
+ isSignal: true,
2132
+ isRequired: true,
2133
+ transformFunction: null
2134
+ } },
2135
+ outputs: { items: "itemsChange" },
2136
+ host: { classAttribute: "rt-table-settings-panel" },
2137
+ ngImport: i0,
2138
+ template: "<ul rtBlock=\"rt-table-settings-panel\" rtElem=\"list\" qa-dataid=\"table-settings-list\" cdkDropList (cdkDropListDropped)=\"onDrop($event)\">\n @for (item of items(); track item.key) {\n <li\n rtElem=\"row\"\n qa-dataid=\"table-settings-row\"\n cdkDrag\n [attr.data-key]=\"item.key\"\n [rtMod]=\"{ locked: item.locked === true, hidden: item.hidden }\"\n [cdkDragDisabled]=\"item.locked === true\">\n @if (item.locked === true) {\n <span rtElem=\"handle\" rtMod=\"placeholder\" aria-hidden=\"true\"></span>\n } @else {\n <button rtElem=\"handle\" qa-dataid=\"table-settings-drag\" type=\"button\" cdkDragHandle [attr.aria-label]=\"t().uiDragColumn\">\n <rt-icon name=\"bars\" size=\"sm\" color=\"muted\" />\n </button>\n }\n\n <span rtElem=\"label\" qa-dataid=\"table-settings-label\">{{ item.label }}</span>\n\n <rt-icon-button\n rtElem=\"toggle\"\n qa-dataid=\"table-settings-toggle\"\n [icon]=\"item.hidden ? 'eye-slash' : 'eye'\"\n [ariaLabel]=\"item.hidden ? t().uiShowColumn : t().uiHideColumn\"\n [tooltip]=\"item.locked === true ? t().uiColumnLocked : item.hidden ? t().uiShow : t().uiHide\"\n [disabled]=\"item.locked === true\"\n (clicked)=\"onToggleHidden(item.key)\" />\n </li>\n }\n</ul>\n",
2139
+ styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-table-settings-panel{--rt-table-settings-panel-row-radius: var(--rt-radius-md);--rt-table-settings-panel-row-border-width: var(--rt-border-width-thin);--rt-table-settings-panel-row-shadow: var(--rt-shadow-card)}.rt-table-settings-panel__list{display:flex;min-width:320px;flex-direction:column;padding:0;margin:0;gap:var(--rt-space-2xs);list-style:none}.rt-table-settings-panel__row{--rt-table-settings-panel-drag-duration: var(--rt-duration-base);display:flex;align-items:center;padding:var(--rt-space-2xs) var(--rt-space-xs);border:var(--rt-table-settings-panel-row-border-width) solid var(--rt-color-border-default);border-radius:var(--rt-table-settings-panel-row-radius);background-color:var(--rt-color-bg-surface);gap:var(--rt-space-sm)}.rt-table-settings-panel__row--hidden{color:var(--rt-color-text-muted)}.rt-table-settings-panel__row.cdk-drag-preview{box-shadow:var(--rt-table-settings-panel-row-shadow)}.rt-table-settings-panel__row.cdk-drag-placeholder{opacity:.4}.rt-table-settings-panel__row.cdk-drag-animating{transition:transform var(--rt-table-settings-panel-drag-duration) cubic-bezier(0,0,.2,1)}.rt-table-settings-panel__handle{display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;padding:0;border:none;background:none;cursor:grab}.rt-table-settings-panel__handle:active{cursor:grabbing}.rt-table-settings-panel__handle--placeholder{cursor:default}.rt-table-settings-panel__label{overflow:hidden;min-width:0;flex:1;font-size:var(--rt-text-sm);text-overflow:ellipsis;white-space:nowrap}.rt-table-settings-panel__toggle{margin-left:auto}.cdk-drop-list-dragging .rt-table-settings-panel__row:not(.cdk-drag-placeholder){transition:transform var(--rt-table-settings-panel-drag-duration) cubic-bezier(0,0,.2,1)}}\n"],
2140
+ dependencies: [
2141
+ {
2142
+ kind: "directive",
2143
+ type: CdkDrag,
2144
+ selector: "[cdkDrag]",
2145
+ inputs: [
2146
+ "cdkDragData",
2147
+ "cdkDragLockAxis",
2148
+ "cdkDragRootElement",
2149
+ "cdkDragBoundary",
2150
+ "cdkDragStartDelay",
2151
+ "cdkDragFreeDragPosition",
2152
+ "cdkDragDisabled",
2153
+ "cdkDragConstrainPosition",
2154
+ "cdkDragPreviewClass",
2155
+ "cdkDragPreviewContainer",
2156
+ "cdkDragScale"
2157
+ ],
2158
+ outputs: [
2159
+ "cdkDragStarted",
2160
+ "cdkDragReleased",
2161
+ "cdkDragEnded",
2162
+ "cdkDragEntered",
2163
+ "cdkDragExited",
2164
+ "cdkDragDropped",
2165
+ "cdkDragMoved"
2166
+ ],
2167
+ exportAs: ["cdkDrag"]
2168
+ },
2169
+ {
2170
+ kind: "directive",
2171
+ type: CdkDragHandle,
2172
+ selector: "[cdkDragHandle]",
2173
+ inputs: ["cdkDragHandleDisabled"]
2174
+ },
2175
+ {
2176
+ kind: "directive",
2177
+ type: CdkDropList,
2178
+ selector: "[cdkDropList], cdk-drop-list",
2179
+ inputs: [
2180
+ "cdkDropListConnectedTo",
2181
+ "cdkDropListData",
2182
+ "cdkDropListOrientation",
2183
+ "id",
2184
+ "cdkDropListLockAxis",
2185
+ "cdkDropListDisabled",
2186
+ "cdkDropListSortingDisabled",
2187
+ "cdkDropListEnterPredicate",
2188
+ "cdkDropListSortPredicate",
2189
+ "cdkDropListAutoScrollDisabled",
2190
+ "cdkDropListAutoScrollStep",
2191
+ "cdkDropListElementContainer",
2192
+ "cdkDropListHasAnchor"
2193
+ ],
2194
+ outputs: [
2195
+ "cdkDropListDropped",
2196
+ "cdkDropListEntered",
2197
+ "cdkDropListExited",
2198
+ "cdkDropListSorted"
2199
+ ],
2200
+ exportAs: ["cdkDropList"]
2201
+ },
2202
+ {
2203
+ kind: "component",
2204
+ type: RtIconButtonComponent,
2205
+ selector: "rt-icon-button",
2206
+ inputs: [
2207
+ "icon",
2208
+ "glyph",
2209
+ "ariaLabel",
2210
+ "variant",
2211
+ "iconColor",
2212
+ "iconFill",
2213
+ "size",
2214
+ "iconSize",
2215
+ "type",
2216
+ "tooltip",
2217
+ "tooltipHideOnClick",
2218
+ "tabIndex",
2219
+ "loading",
2220
+ "disabled",
2221
+ "active",
2222
+ "expanded",
2223
+ "indicator"
2224
+ ],
2225
+ outputs: ["clicked"]
2226
+ },
2227
+ {
2228
+ kind: "component",
2229
+ type: RtIconComponent,
2230
+ selector: "rt-icon",
2231
+ inputs: [
2232
+ "name",
2233
+ "glyph",
2234
+ "glyphStrategy",
2235
+ "size",
2236
+ "color",
2237
+ "fill",
2238
+ "spin",
2239
+ "rotate"
2240
+ ]
2241
+ },
2242
+ {
2243
+ kind: "directive",
2244
+ type: BlockDirective,
2245
+ selector: "[rtBlock]",
2246
+ inputs: ["rtMod"]
2247
+ },
2248
+ {
2249
+ kind: "directive",
2250
+ type: ElemDirective,
2251
+ selector: "[rtElem]",
2252
+ inputs: ["rtMod"]
2253
+ },
2254
+ {
2255
+ kind: "directive",
2256
+ type: ModDirective,
2257
+ selector: "[rtMod]"
2258
+ }
2259
+ ],
2260
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
2261
+ encapsulation: i0.ViewEncapsulation.None
2262
+ });
2263
+ }
2264
+ };
2265
+ i0.ɵɵngDeclareClassMetadata({
2266
+ minVersion: "12.0.0",
2267
+ version: "22.2.2",
2268
+ ngImport: i0,
2269
+ type: RtTableSettingsPanelComponent,
2270
+ decorators: [{
2271
+ type: Component,
2272
+ args: [{
2273
+ selector: "rt-table-settings-panel",
2274
+ changeDetection: ChangeDetectionStrategy.OnPush,
2275
+ encapsulation: ViewEncapsulation.None,
2276
+ imports: [
2277
+ CdkDrag,
2278
+ CdkDragHandle,
2279
+ CdkDropList,
2280
+ RtIconButtonComponent,
2281
+ RtIconComponent,
2282
+ BlockDirective,
2283
+ ElemDirective,
2284
+ ModDirective
2285
+ ],
2286
+ host: { class: BEM_BLOCK$1 },
2287
+ template: "<ul rtBlock=\"rt-table-settings-panel\" rtElem=\"list\" qa-dataid=\"table-settings-list\" cdkDropList (cdkDropListDropped)=\"onDrop($event)\">\n @for (item of items(); track item.key) {\n <li\n rtElem=\"row\"\n qa-dataid=\"table-settings-row\"\n cdkDrag\n [attr.data-key]=\"item.key\"\n [rtMod]=\"{ locked: item.locked === true, hidden: item.hidden }\"\n [cdkDragDisabled]=\"item.locked === true\">\n @if (item.locked === true) {\n <span rtElem=\"handle\" rtMod=\"placeholder\" aria-hidden=\"true\"></span>\n } @else {\n <button rtElem=\"handle\" qa-dataid=\"table-settings-drag\" type=\"button\" cdkDragHandle [attr.aria-label]=\"t().uiDragColumn\">\n <rt-icon name=\"bars\" size=\"sm\" color=\"muted\" />\n </button>\n }\n\n <span rtElem=\"label\" qa-dataid=\"table-settings-label\">{{ item.label }}</span>\n\n <rt-icon-button\n rtElem=\"toggle\"\n qa-dataid=\"table-settings-toggle\"\n [icon]=\"item.hidden ? 'eye-slash' : 'eye'\"\n [ariaLabel]=\"item.hidden ? t().uiShowColumn : t().uiHideColumn\"\n [tooltip]=\"item.locked === true ? t().uiColumnLocked : item.hidden ? t().uiShow : t().uiHide\"\n [disabled]=\"item.locked === true\"\n (clicked)=\"onToggleHidden(item.key)\" />\n </li>\n }\n</ul>\n",
2288
+ styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-table-settings-panel{--rt-table-settings-panel-row-radius: var(--rt-radius-md);--rt-table-settings-panel-row-border-width: var(--rt-border-width-thin);--rt-table-settings-panel-row-shadow: var(--rt-shadow-card)}.rt-table-settings-panel__list{display:flex;min-width:320px;flex-direction:column;padding:0;margin:0;gap:var(--rt-space-2xs);list-style:none}.rt-table-settings-panel__row{--rt-table-settings-panel-drag-duration: var(--rt-duration-base);display:flex;align-items:center;padding:var(--rt-space-2xs) var(--rt-space-xs);border:var(--rt-table-settings-panel-row-border-width) solid var(--rt-color-border-default);border-radius:var(--rt-table-settings-panel-row-radius);background-color:var(--rt-color-bg-surface);gap:var(--rt-space-sm)}.rt-table-settings-panel__row--hidden{color:var(--rt-color-text-muted)}.rt-table-settings-panel__row.cdk-drag-preview{box-shadow:var(--rt-table-settings-panel-row-shadow)}.rt-table-settings-panel__row.cdk-drag-placeholder{opacity:.4}.rt-table-settings-panel__row.cdk-drag-animating{transition:transform var(--rt-table-settings-panel-drag-duration) cubic-bezier(0,0,.2,1)}.rt-table-settings-panel__handle{display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;padding:0;border:none;background:none;cursor:grab}.rt-table-settings-panel__handle:active{cursor:grabbing}.rt-table-settings-panel__handle--placeholder{cursor:default}.rt-table-settings-panel__label{overflow:hidden;min-width:0;flex:1;font-size:var(--rt-text-sm);text-overflow:ellipsis;white-space:nowrap}.rt-table-settings-panel__toggle{margin-left:auto}.cdk-drop-list-dragging .rt-table-settings-panel__row:not(.cdk-drag-placeholder){transition:transform var(--rt-table-settings-panel-drag-duration) cubic-bezier(0,0,.2,1)}}\n"]
2289
+ }]
2290
+ }],
2291
+ propDecorators: { items: [{
2292
+ type: i0.Input,
2293
+ args: [{
2294
+ isSignal: true,
2295
+ alias: "items",
2296
+ required: true
2297
+ }]
2298
+ }, {
2299
+ type: i0.Output,
2300
+ args: ["itemsChange"]
2301
+ }] }
2302
+ });
2303
+ const BEM_BLOCK = "rt-table-settings-aside";
2304
+ var RtTableSettingsAsideComponent = class RtTableSettingsAsideComponent extends RtRouteAsideComponent {
2305
+ #registry;
2306
+ #initialActive;
2307
+ #registration;
2308
+ #seeded;
2309
+ #adopted;
2310
+ constructor() {
2311
+ super();
2312
+ this.#registry = inject(RtTableSettingsRegistry);
2313
+ this.#initialActive = this.#registry.active();
2314
+ this.#registration = computed(() => {
2315
+ const tableId = this.#registry.active();
2316
+ return tableId !== null ? this.#registry.get(tableId)() : null;
2317
+ }, ...ngDevMode ? [{ debugName: "#registration" }] : /* istanbul ignore next */ []);
2318
+ this.t = inject(RT_KIT_LABELS);
2319
+ this.items = signal([], ...ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []);
2320
+ this.#seeded = false;
2321
+ this.#adopted = false;
2322
+ if (this.#initialActive === null) effect(() => {
2323
+ if (this.#adopted || this.#registry.active() !== null) return;
2324
+ const sole = this.#registry.soleTableId();
2325
+ if (sole !== null) {
2326
+ this.#adopted = true;
2327
+ this.#registry.setActive(sole);
2328
+ }
2329
+ });
2330
+ effect(() => {
2331
+ const registration = this.#registration();
2332
+ const panel = this.panel();
2333
+ if (panel === void 0 || !panel.ready()) return;
2334
+ if (registration === null) {
2335
+ if (this.#initialActive !== null || this.#adopted) this.onClose();
2336
+ return;
2337
+ }
2338
+ if (!this.#seeded) {
2339
+ this.#seeded = true;
2340
+ this.items.set(registration.columns().map((c) => ({ ...c })));
2341
+ }
2342
+ });
2343
+ }
2344
+ resolve() {
2345
+ return of(null);
2346
+ }
2347
+ onReset() {
2348
+ const registration = this.#registration();
2349
+ if (registration === null) return;
2350
+ this.items.set(registration.defaults().map((c) => ({ ...c })));
2351
+ }
2352
+ onSave() {
2353
+ const registration = this.#registration();
2354
+ if (registration !== null) {
2355
+ const items = this.items();
2356
+ registration.apply({
2357
+ order: items.map((item) => item.key),
2358
+ hidden: items.filter((item) => item.hidden).map((item) => item.key)
2359
+ });
2360
+ }
2361
+ this.#registry.clearActive();
2362
+ this.onClose();
2363
+ }
2364
+ static {
2365
+ this.ɵfac = i0.ɵɵngDeclareFactory({
2366
+ minVersion: "12.0.0",
2367
+ version: "22.2.2",
2368
+ ngImport: i0,
2369
+ type: RtTableSettingsAsideComponent,
2370
+ deps: [],
2371
+ target: i0.ɵɵFactoryTarget.Component
2372
+ });
2373
+ }
2374
+ static {
2375
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
2376
+ minVersion: "14.0.0",
2377
+ version: "22.2.2",
2378
+ type: RtTableSettingsAsideComponent,
2379
+ isStandalone: true,
2380
+ selector: "rt-table-settings-aside",
2381
+ host: { classAttribute: "rt-table-settings-aside" },
2382
+ usesInheritance: true,
2383
+ ngImport: i0,
2384
+ template: "<ng-container rtContainerRightSidenavPanel #panel=\"rtContainerRightPanel\" (cancelled)=\"onCancel()\" (closed)=\"onClosed()\" />\n\n<rt-aside [ariaLabel]=\"t().uiColumnSettings\">\n <rt-aside-header [title]=\"t().uiColumnSettingsTitle\" (dismiss)=\"onClose()\">\n <rt-icon-button\n asideActions\n qa-dataid=\"table-settings-reset\"\n icon=\"undo\"\n variant=\"ghost\"\n [tooltip]=\"t().uiResetDefaults\"\n [ariaLabel]=\"t().uiResetDefaults\"\n (clicked)=\"onReset()\" />\n </rt-aside-header>\n\n <rt-table-settings-panel [(items)]=\"items\" />\n\n <rt-aside-footer>\n <button\n rtButton\n asideDismiss\n qa-dataid=\"table-settings-close\"\n type=\"button\"\n appearance=\"text\"\n [label]=\"t().uiClose\"\n [attr.aria-label]=\"t().uiClose\"\n (click)=\"onClose()\"></button>\n <button\n rtButton\n asidePrimary\n qa-dataid=\"table-settings-save\"\n type=\"button\"\n [label]=\"t().uiSave\"\n [attr.aria-label]=\"t().uiSave\"\n (click)=\"onSave()\"></button>\n </rt-aside-footer>\n</rt-aside>\n",
2385
+ styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-table-settings-aside{display:contents}}\n"],
2386
+ dependencies: [
2387
+ {
2388
+ kind: "component",
2389
+ type: RtAsideComponent,
2390
+ selector: "rt-aside",
2391
+ inputs: [
2392
+ "size",
2393
+ "contentLayout",
2394
+ "width",
2395
+ "ariaLabel",
2396
+ "requestError",
2397
+ "trapFocus",
2398
+ "pending"
2399
+ ]
2400
+ },
2401
+ {
2402
+ kind: "component",
2403
+ type: RtAsideFooterComponent,
2404
+ selector: "rt-aside-footer"
2405
+ },
2406
+ {
2407
+ kind: "component",
2408
+ type: RtAsideHeaderComponent,
2409
+ selector: "rt-aside-header",
2410
+ inputs: [
2411
+ "title",
2412
+ "overline",
2413
+ "subtitle",
2414
+ "badges",
2415
+ "closable",
2416
+ "loading"
2417
+ ],
2418
+ outputs: ["dismiss"]
2419
+ },
2420
+ {
2421
+ kind: "directive",
2422
+ type: RtButtonDirective,
2423
+ selector: "button[rtButton], a[rtButton]",
2424
+ inputs: [
2425
+ "label",
2426
+ "icon",
2427
+ "iconPos",
2428
+ "theme",
2429
+ "appearance",
2430
+ "size",
2431
+ "loading",
2432
+ "loadingIcon",
2433
+ "loadingLabel",
2434
+ "pressed"
2435
+ ]
2436
+ },
2437
+ {
2438
+ kind: "directive",
2439
+ type: RtContainerRightSidenavPanelDirective,
2440
+ selector: "[rtContainerRightSidenavPanel]",
2441
+ outputs: [
2442
+ "opened",
2443
+ "closed",
2444
+ "cancelled"
2445
+ ],
2446
+ exportAs: ["rtContainerRightPanel"]
2447
+ },
2448
+ {
2449
+ kind: "component",
2450
+ type: RtIconButtonComponent,
2451
+ selector: "rt-icon-button",
2452
+ inputs: [
2453
+ "icon",
2454
+ "glyph",
2455
+ "ariaLabel",
2456
+ "variant",
2457
+ "iconColor",
2458
+ "iconFill",
2459
+ "size",
2460
+ "iconSize",
2461
+ "type",
2462
+ "tooltip",
2463
+ "tooltipHideOnClick",
2464
+ "tabIndex",
2465
+ "loading",
2466
+ "disabled",
2467
+ "active",
2468
+ "expanded",
2469
+ "indicator"
2470
+ ],
2471
+ outputs: ["clicked"]
2472
+ },
2473
+ {
2474
+ kind: "component",
2475
+ type: RtTableSettingsPanelComponent,
2476
+ selector: "rt-table-settings-panel",
2477
+ inputs: ["items"],
2478
+ outputs: ["itemsChange"]
2479
+ }
2480
+ ],
2481
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
2482
+ encapsulation: i0.ViewEncapsulation.None
2483
+ });
2484
+ }
2485
+ };
2486
+ i0.ɵɵngDeclareClassMetadata({
2487
+ minVersion: "12.0.0",
2488
+ version: "22.2.2",
2489
+ ngImport: i0,
2490
+ type: RtTableSettingsAsideComponent,
2491
+ decorators: [{
2492
+ type: Component,
2493
+ args: [{
2494
+ selector: "rt-table-settings-aside",
2495
+ changeDetection: ChangeDetectionStrategy.OnPush,
2496
+ encapsulation: ViewEncapsulation.None,
2497
+ imports: [
2498
+ RtAsideComponent,
2499
+ RtAsideFooterComponent,
2500
+ RtAsideHeaderComponent,
2501
+ RtButtonDirective,
2502
+ RtContainerRightSidenavPanelDirective,
2503
+ RtIconButtonComponent,
2504
+ RtTableSettingsPanelComponent
2505
+ ],
2506
+ host: { class: BEM_BLOCK },
2507
+ template: "<ng-container rtContainerRightSidenavPanel #panel=\"rtContainerRightPanel\" (cancelled)=\"onCancel()\" (closed)=\"onClosed()\" />\n\n<rt-aside [ariaLabel]=\"t().uiColumnSettings\">\n <rt-aside-header [title]=\"t().uiColumnSettingsTitle\" (dismiss)=\"onClose()\">\n <rt-icon-button\n asideActions\n qa-dataid=\"table-settings-reset\"\n icon=\"undo\"\n variant=\"ghost\"\n [tooltip]=\"t().uiResetDefaults\"\n [ariaLabel]=\"t().uiResetDefaults\"\n (clicked)=\"onReset()\" />\n </rt-aside-header>\n\n <rt-table-settings-panel [(items)]=\"items\" />\n\n <rt-aside-footer>\n <button\n rtButton\n asideDismiss\n qa-dataid=\"table-settings-close\"\n type=\"button\"\n appearance=\"text\"\n [label]=\"t().uiClose\"\n [attr.aria-label]=\"t().uiClose\"\n (click)=\"onClose()\"></button>\n <button\n rtButton\n asidePrimary\n qa-dataid=\"table-settings-save\"\n type=\"button\"\n [label]=\"t().uiSave\"\n [attr.aria-label]=\"t().uiSave\"\n (click)=\"onSave()\"></button>\n </rt-aside-footer>\n</rt-aside>\n",
2508
+ styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-table-settings-aside{display:contents}}\n"]
2509
+ }]
2510
+ }],
2511
+ ctorParameters: () => []
1346
2512
  });
1347
- /**
1348
- * Заголовок сортируемой колонки — атрибутом на ячейке шапки:
1349
- * `<th *cdkHeaderCellDef cdk-header-cell rtSortHeader="checkIn">Заезд</th>`.
1350
- *
1351
- * Подпись проецируется внутрь кнопки, и доступное имя кнопки берётся из неё — порядок
1352
- * меняется не только мышью. Текущее направление читается с самой колонки через
1353
- * `aria-sort`, а видно его по стрелке.
1354
- *
1355
- * Колонка сортируется, только когда помечена `sortable` в `[columnsConfig]` таблицы;
1356
- * иначе заголовок остаётся обычной подписью. Элементная форма селектора нужна правилу
1357
- * префиксов и в разметке не применяется: `aria-sort` принадлежит ячейке шапки.
1358
- */
1359
- class RtTableSortHeaderComponent {
1360
- constructor() {
1361
- this.#table = inject(RtTableComponent);
1362
- /** Направление сортировки по этой колонке; `null` — сортирует другая либо никакая. */
1363
- this.direction = computed(() => sortDirectionOf(this.#table.currentSort(), this.rtSortHeader()), /* @ts-ignore */
1364
- ...(ngDevMode ? [{ debugName: "direction" }] : /* istanbul ignore next */ []));
1365
- this.icon = computed(() => ICONS[this.direction() ?? 'none'], /* @ts-ignore */
1366
- ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
1367
- this.sortable = computed(() => isColumnSortable(this.#table.columnsConfig(), this.rtSortHeader()), /* @ts-ignore */
1368
- ...(ngDevMode ? [{ debugName: "sortable" }] : /* istanbul ignore next */ []));
1369
- /** Ключ колонки — тот же, что в `cdkColumnDef` и в `[columnsConfig]`. */
1370
- this.rtSortHeader = input.required(/* @ts-ignore */
1371
- ...(ngDevMode ? [{ debugName: "rtSortHeader" }] : /* istanbul ignore next */ []));
1372
- this.ariaSort = computed(() => ariaSortOf(this.#table.currentSort(), this.rtSortHeader()), /* @ts-ignore */
1373
- ...(ngDevMode ? [{ debugName: "ariaSort" }] : /* istanbul ignore next */ []));
1374
- }
1375
- #table;
1376
- onToggle() {
1377
- this.#table.toggleSort(this.rtSortHeader());
1378
- }
1379
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtTableSortHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1380
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: RtTableSortHeaderComponent, isStandalone: true, selector: "rt-table-sort-header, th[rtSortHeader]", inputs: { rtSortHeader: { classPropertyName: "rtSortHeader", publicName: "rtSortHeader", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "attr.aria-sort": "ariaSort()" }, classAttribute: "rt-table-sort-header" }, ngImport: i0, template: "<ng-template #label>\n <ng-content />\n</ng-template>\n\n<ng-container rtBlock=\"rt-table-sort-header\">\n @if (sortable()) {\n <button\n rtElem=\"button\"\n qa-dataid=\"table-sort-header\"\n type=\"button\"\n [attr.data-column]=\"rtSortHeader()\"\n [attr.data-direction]=\"direction()\"\n [rtMod]=\"{ active: direction() !== null }\"\n (click)=\"onToggle()\">\n <ng-container [ngTemplateOutlet]=\"label\" />\n <rt-icon rtElem=\"icon\" size=\"xs\" [name]=\"icon()\" />\n </button>\n } @else {\n <ng-container [ngTemplateOutlet]=\"label\" />\n }\n</ng-container>\n", styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-table-sort-header__button{display:inline-flex;align-items:center;padding:0;border:none;background:none;color:inherit;cursor:pointer;font:inherit;gap:var(--rt-space-xs);text-align:inherit}.rt-table-sort-header__button:hover{color:var(--rt-color-text-primary)}.rt-table-sort-header__button:focus-visible{outline:2px solid var(--rt-color-action-primary);outline-offset:2px}.rt-table-sort-header__icon{flex:0 0 auto;color:var(--rt-color-text-muted)}.rt-table-sort-header__button--active{color:var(--rt-color-text-primary)}.rt-table-sort-header__button--active .rt-table-sort-header__icon{color:var(--rt-color-action-primary)}}\n"], dependencies: [{ kind: "directive", type:
1381
- // angular
1382
- NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type:
1383
- // rt-tools
1384
- BlockDirective, selector: "[rtBlock]", inputs: ["rtMod"] }, { kind: "directive", type: ElemDirective, selector: "[rtElem]", inputs: ["rtMod"] }, { kind: "directive", type: ModDirective, selector: "[rtMod]" }, { kind: "component", type:
1385
- // components
1386
- RtIconComponent, selector: "rt-icon", inputs: ["name", "glyph", "glyphStrategy", "size", "color", "fill", "spin", "rotate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1387
- }
1388
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtTableSortHeaderComponent, decorators: [{
1389
- type: Component,
1390
- args: [{ selector: 'rt-table-sort-header, th[rtSortHeader]', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
1391
- // angular
1392
- NgTemplateOutlet,
1393
- // rt-tools
1394
- BlockDirective,
1395
- ElemDirective,
1396
- ModDirective,
1397
- // components
1398
- RtIconComponent,
1399
- ], host: {
1400
- class: BEM_BLOCK$2,
1401
- '[attr.aria-sort]': 'ariaSort()',
1402
- }, template: "<ng-template #label>\n <ng-content />\n</ng-template>\n\n<ng-container rtBlock=\"rt-table-sort-header\">\n @if (sortable()) {\n <button\n rtElem=\"button\"\n qa-dataid=\"table-sort-header\"\n type=\"button\"\n [attr.data-column]=\"rtSortHeader()\"\n [attr.data-direction]=\"direction()\"\n [rtMod]=\"{ active: direction() !== null }\"\n (click)=\"onToggle()\">\n <ng-container [ngTemplateOutlet]=\"label\" />\n <rt-icon rtElem=\"icon\" size=\"xs\" [name]=\"icon()\" />\n </button>\n } @else {\n <ng-container [ngTemplateOutlet]=\"label\" />\n }\n</ng-container>\n", styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-table-sort-header__button{display:inline-flex;align-items:center;padding:0;border:none;background:none;color:inherit;cursor:pointer;font:inherit;gap:var(--rt-space-xs);text-align:inherit}.rt-table-sort-header__button:hover{color:var(--rt-color-text-primary)}.rt-table-sort-header__button:focus-visible{outline:2px solid var(--rt-color-action-primary);outline-offset:2px}.rt-table-sort-header__icon{flex:0 0 auto;color:var(--rt-color-text-muted)}.rt-table-sort-header__button--active{color:var(--rt-color-text-primary)}.rt-table-sort-header__button--active .rt-table-sort-header__icon{color:var(--rt-color-action-primary)}}\n"] }]
1403
- }], propDecorators: { rtSortHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "rtSortHeader", required: true }] }] } });
1404
-
1405
- /**
1406
- * Делает строку таблицы (`<tr cdk-row>`) активируемой — общий паттерн «клик по
1407
- * строке открывает деталь/асайд». Инкапсулирует доступность: строка становится
1408
- * focusable, активируется кликом и Enter/Space, наружу отдаёт `(activated)`.
1409
- *
1410
- * Клик/клавиша по интерактивному потомку (кнопка/ссылка/контрол) активацией
1411
- * строки НЕ считается — иначе вложенные действия конфликтовали бы с переходом.
1412
- * Роль строки не переопределяется (table-семантика для скрин-ридеров сохраняется).
1413
- * Визуальный аффорданс (cursor/hover/focus-ring) включает `[clickable]` на rt-table.
1414
- */
1415
- class RtTableRowDirective {
1416
- constructor() {
1417
- this.activated = output();
1418
- }
1419
- onClick(event) {
1420
- if (isFromInteractive(event.target)) {
1421
- return;
1422
- }
1423
- this.activated.emit();
1424
- }
1425
- onKey(event) {
1426
- if (isFromInteractive(event.target)) {
1427
- return;
1428
- }
1429
- // Space иначе проскроллит страницу — гасим дефолт перед активацией.
1430
- event.preventDefault();
1431
- this.activated.emit();
1432
- }
1433
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtTableRowDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1434
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.6", type: RtTableRowDirective, isStandalone: true, selector: "[rtTableRow]", outputs: { activated: "activated" }, host: { attributes: { "tabindex": "0" }, listeners: { "click": "onClick($event)", "keydown.enter": "onKey($event)", "keydown.space": "onKey($event)" } }, ngImport: i0 }); }
1435
- }
1436
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtTableRowDirective, decorators: [{
1437
- type: Directive,
1438
- args: [{
1439
- selector: '[rtTableRow]',
1440
- host: {
1441
- tabindex: '0',
1442
- '(click)': 'onClick($event)',
1443
- '(keydown.enter)': 'onKey($event)',
1444
- '(keydown.space)': 'onKey($event)',
1445
- },
1446
- }]
1447
- }], propDecorators: { activated: [{ type: i0.Output, args: ["activated"] }] } });
1448
-
1449
- const BEM_BLOCK$1 = 'rt-table-settings-panel';
1450
- /**
1451
- * Презентационный редактор списка колонок таблицы: reorder (drag-drop) + видимость
1452
- * (глаз). Locked-колонки всегда видимы и не перетаскиваются. Двусторонний `items` —
1453
- * текущее состояние; контейнер (route-асайд настроек) владеет сигналом, читает его
1454
- * для «Сохранить»/«Сбросить» и передаёт сюда через `[(items)]`.
1455
- */
1456
- class RtTableSettingsPanelComponent {
1457
- constructor() {
1458
- this.t = inject(RT_KIT_LABELS);
1459
- this.items = model.required(/* @ts-ignore */
1460
- ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
1461
- }
1462
- /** Reorder через drag-drop. Locked-строки drag-disabled; индексы — по всему списку. */
1463
- onDrop(event) {
1464
- if (event.previousIndex === event.currentIndex) {
1465
- return;
1466
- }
1467
- const next = [...this.items()];
1468
- moveItemInArray(next, event.previousIndex, event.currentIndex);
1469
- this.items.set(next);
1470
- }
1471
- /** Переключить видимость колонки (locked — нельзя). */
1472
- onToggleHidden(key) {
1473
- this.items.update((items) => items.map((item) => item.key === key && item.locked !== true ? { ...item, hidden: !item.hidden } : item));
1474
- }
1475
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtTableSettingsPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1476
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: RtTableSettingsPanelComponent, isStandalone: true, selector: "rt-table-settings-panel", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { items: "itemsChange" }, host: { classAttribute: "rt-table-settings-panel" }, ngImport: i0, template: "<ul rtBlock=\"rt-table-settings-panel\" rtElem=\"list\" qa-dataid=\"table-settings-list\" cdkDropList (cdkDropListDropped)=\"onDrop($event)\">\n @for (item of items(); track item.key) {\n <li\n rtElem=\"row\"\n qa-dataid=\"table-settings-row\"\n cdkDrag\n [attr.data-key]=\"item.key\"\n [rtMod]=\"{ locked: item.locked === true, hidden: item.hidden }\"\n [cdkDragDisabled]=\"item.locked === true\">\n @if (item.locked === true) {\n <span rtElem=\"handle\" rtMod=\"placeholder\" aria-hidden=\"true\"></span>\n } @else {\n <button rtElem=\"handle\" qa-dataid=\"table-settings-drag\" type=\"button\" cdkDragHandle [attr.aria-label]=\"t().uiDragColumn\">\n <rt-icon name=\"bars\" size=\"sm\" color=\"muted\" />\n </button>\n }\n\n <span rtElem=\"label\" qa-dataid=\"table-settings-label\">{{ item.label }}</span>\n\n <rt-icon-button\n rtElem=\"toggle\"\n qa-dataid=\"table-settings-toggle\"\n [icon]=\"item.hidden ? 'eye-slash' : 'eye'\"\n [ariaLabel]=\"item.hidden ? t().uiShowColumn : t().uiHideColumn\"\n [tooltip]=\"item.locked === true ? t().uiColumnLocked : item.hidden ? t().uiShow : t().uiHide\"\n [disabled]=\"item.locked === true\"\n (clicked)=\"onToggleHidden(item.key)\" />\n </li>\n }\n</ul>\n", styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-table-settings-panel{--rt-table-settings-panel-row-radius: var(--rt-radius-md);--rt-table-settings-panel-row-border-width: var(--rt-border-width-thin);--rt-table-settings-panel-row-shadow: var(--rt-shadow-card)}.rt-table-settings-panel__list{display:flex;min-width:320px;flex-direction:column;padding:0;margin:0;gap:var(--rt-space-2xs);list-style:none}.rt-table-settings-panel__row{--rt-table-settings-panel-drag-duration: var(--rt-duration-base);display:flex;align-items:center;padding:var(--rt-space-2xs) var(--rt-space-xs);border:var(--rt-table-settings-panel-row-border-width) solid var(--rt-color-border-default);border-radius:var(--rt-table-settings-panel-row-radius);background-color:var(--rt-color-bg-surface);gap:var(--rt-space-sm)}.rt-table-settings-panel__row--hidden{color:var(--rt-color-text-muted)}.rt-table-settings-panel__row.cdk-drag-preview{box-shadow:var(--rt-table-settings-panel-row-shadow)}.rt-table-settings-panel__row.cdk-drag-placeholder{opacity:.4}.rt-table-settings-panel__row.cdk-drag-animating{transition:transform var(--rt-table-settings-panel-drag-duration) cubic-bezier(0,0,.2,1)}.rt-table-settings-panel__handle{display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;padding:0;border:none;background:none;cursor:grab}.rt-table-settings-panel__handle:active{cursor:grabbing}.rt-table-settings-panel__handle--placeholder{cursor:default}.rt-table-settings-panel__label{overflow:hidden;min-width:0;flex:1;font-size:var(--rt-text-sm);text-overflow:ellipsis;white-space:nowrap}.rt-table-settings-panel__toggle{margin-left:auto}.cdk-drop-list-dragging .rt-table-settings-panel__row:not(.cdk-drag-placeholder){transition:transform var(--rt-table-settings-panel-drag-duration) cubic-bezier(0,0,.2,1)}}\n"], dependencies: [{ kind: "directive", type:
1477
- // @angular/cdk
1478
- CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "component", type:
1479
- // standalone components / directives
1480
- 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: "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 }); }
1481
- }
1482
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtTableSettingsPanelComponent, decorators: [{
1483
- type: Component,
1484
- args: [{ selector: 'rt-table-settings-panel', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
1485
- // @angular/cdk
1486
- CdkDrag,
1487
- CdkDragHandle,
1488
- CdkDropList,
1489
- // standalone components / directives
1490
- RtIconButtonComponent,
1491
- RtIconComponent,
1492
- BlockDirective,
1493
- ElemDirective,
1494
- ModDirective,
1495
- ], host: {
1496
- class: BEM_BLOCK$1,
1497
- }, template: "<ul rtBlock=\"rt-table-settings-panel\" rtElem=\"list\" qa-dataid=\"table-settings-list\" cdkDropList (cdkDropListDropped)=\"onDrop($event)\">\n @for (item of items(); track item.key) {\n <li\n rtElem=\"row\"\n qa-dataid=\"table-settings-row\"\n cdkDrag\n [attr.data-key]=\"item.key\"\n [rtMod]=\"{ locked: item.locked === true, hidden: item.hidden }\"\n [cdkDragDisabled]=\"item.locked === true\">\n @if (item.locked === true) {\n <span rtElem=\"handle\" rtMod=\"placeholder\" aria-hidden=\"true\"></span>\n } @else {\n <button rtElem=\"handle\" qa-dataid=\"table-settings-drag\" type=\"button\" cdkDragHandle [attr.aria-label]=\"t().uiDragColumn\">\n <rt-icon name=\"bars\" size=\"sm\" color=\"muted\" />\n </button>\n }\n\n <span rtElem=\"label\" qa-dataid=\"table-settings-label\">{{ item.label }}</span>\n\n <rt-icon-button\n rtElem=\"toggle\"\n qa-dataid=\"table-settings-toggle\"\n [icon]=\"item.hidden ? 'eye-slash' : 'eye'\"\n [ariaLabel]=\"item.hidden ? t().uiShowColumn : t().uiHideColumn\"\n [tooltip]=\"item.locked === true ? t().uiColumnLocked : item.hidden ? t().uiShow : t().uiHide\"\n [disabled]=\"item.locked === true\"\n (clicked)=\"onToggleHidden(item.key)\" />\n </li>\n }\n</ul>\n", styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-table-settings-panel{--rt-table-settings-panel-row-radius: var(--rt-radius-md);--rt-table-settings-panel-row-border-width: var(--rt-border-width-thin);--rt-table-settings-panel-row-shadow: var(--rt-shadow-card)}.rt-table-settings-panel__list{display:flex;min-width:320px;flex-direction:column;padding:0;margin:0;gap:var(--rt-space-2xs);list-style:none}.rt-table-settings-panel__row{--rt-table-settings-panel-drag-duration: var(--rt-duration-base);display:flex;align-items:center;padding:var(--rt-space-2xs) var(--rt-space-xs);border:var(--rt-table-settings-panel-row-border-width) solid var(--rt-color-border-default);border-radius:var(--rt-table-settings-panel-row-radius);background-color:var(--rt-color-bg-surface);gap:var(--rt-space-sm)}.rt-table-settings-panel__row--hidden{color:var(--rt-color-text-muted)}.rt-table-settings-panel__row.cdk-drag-preview{box-shadow:var(--rt-table-settings-panel-row-shadow)}.rt-table-settings-panel__row.cdk-drag-placeholder{opacity:.4}.rt-table-settings-panel__row.cdk-drag-animating{transition:transform var(--rt-table-settings-panel-drag-duration) cubic-bezier(0,0,.2,1)}.rt-table-settings-panel__handle{display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;padding:0;border:none;background:none;cursor:grab}.rt-table-settings-panel__handle:active{cursor:grabbing}.rt-table-settings-panel__handle--placeholder{cursor:default}.rt-table-settings-panel__label{overflow:hidden;min-width:0;flex:1;font-size:var(--rt-text-sm);text-overflow:ellipsis;white-space:nowrap}.rt-table-settings-panel__toggle{margin-left:auto}.cdk-drop-list-dragging .rt-table-settings-panel__row:not(.cdk-drag-placeholder){transition:transform var(--rt-table-settings-panel-drag-duration) cubic-bezier(0,0,.2,1)}}\n"] }]
1498
- }], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }, { type: i0.Output, args: ["itemsChange"] }] } });
1499
-
1500
- const BEM_BLOCK = 'rt-table-settings-aside';
1501
- /**
1502
- * Общий route-driven side-sheet настроек колонок для любой `rt-table`. Открывается
1503
- * навигацией на `(ro:table-settings)`; какая таблица настраивается — берётся из
1504
- * `RtTableSettingsRegistry.active()` (потребитель выставляет `setActive(tableId)`
1505
- * перед навигацией). Create-mode: id в route нет (`tableId` — строка, числовой базой
1506
- * не резолвится).
1507
- *
1508
- * Тело списка (drag-reorder + видимость) — переиспользуемый `rt-table-settings-panel`;
1509
- * «Сохранить»/«Сбросить» живут в chrome асайда над локальным `items`, засеянным из
1510
- * активной регистрации. Регистрируется в `routes.ts` каждого shell под `outlet: "ro"`.
1511
- */
1512
- class RtTableSettingsAsideComponent extends RtRouteAsideComponent {
1513
- #registry;
1514
- /**
1515
- * `active` на момент создания асайда: `null` — восстановление после F5
1516
- * (`setActive` никто не звал), непустой id — штатное открытие потребителем.
1517
- */
1518
- #initialActive;
1519
- /** Регистрация активной таблицы (её колонки/дефолты/apply). Реактивна к реестру. */
1520
- #registration;
1521
- #seeded;
1522
- /** Асайд восстановил `active` сам (после F5) — дальше живёт по штатным правилам. */
1523
- #adopted;
1524
- constructor() {
1525
- super();
1526
- this.#registry = inject(RtTableSettingsRegistry);
1527
- /**
1528
- * `active` на момент создания асайда: `null` — восстановление после F5
1529
- * (`setActive` никто не звал), непустой id — штатное открытие потребителем.
1530
- */
1531
- this.#initialActive = this.#registry.active();
1532
- /** Регистрация активной таблицы (её колонки/дефолты/apply). Реактивна к реестру. */
1533
- this.#registration = computed(() => {
1534
- const tableId = this.#registry.active();
1535
- return tableId !== null ? this.#registry.get(tableId)() : null;
1536
- }, /* @ts-ignore */
1537
- ...(ngDevMode ? [{ debugName: "#registration" }] : /* istanbul ignore next */ []));
1538
- /** Рабочая копия списка колонок (сидится из регистрации, редактируется телом-панелью). */
1539
- this.t = inject(RT_KIT_LABELS);
1540
- this.items = signal([], /* @ts-ignore */
1541
- ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
1542
- this.#seeded = false;
1543
- /** Асайд восстановил `active` сам (после F5) — дальше живёт по штатным правилам. */
1544
- this.#adopted = false;
1545
- // Фикс F-16: после F5 асайд инициализируется раньше `rt-table`, реестр в
1546
- // этот момент пуст и `active` сброшен (root-сервис пересоздан). Вместо
1547
- // самозакрытия на первом промахе ждём регистрацию: страница регистрирует
1548
- // ровно одну настраиваемую таблицу — она и становится активной.
1549
- if (this.#initialActive === null) {
1550
- effect(() => {
1551
- // Усыновление одноразовое: после него асайд живёт по штатным
1552
- // правилам (уход со страницы = закрытие), а не перепрыгивает
1553
- // на таблицу следующей страницы.
1554
- if (this.#adopted || this.#registry.active() !== null) {
1555
- return;
1556
- }
1557
- const sole = this.#registry.soleTableId();
1558
- if (sole !== null) {
1559
- this.#adopted = true;
1560
- this.#registry.setActive(sole);
1561
- }
1562
- });
1563
- }
1564
- effect(() => {
1565
- const registration = this.#registration();
1566
- const panel = this.panel();
1567
- if (panel === undefined || !panel.ready()) {
1568
- return;
1569
- }
1570
- if (registration === null) {
1571
- // Штатно открытый (или уже усыновивший таблицу) асайд закрывается,
1572
- // когда регистрация исчезла — уход со страницы таблицы. Асайд,
1573
- // восстановленный после F5, регистрацию ещё ЖДЁТ — не закрываемся.
1574
- if (this.#initialActive !== null || this.#adopted) {
1575
- this.onClose();
1576
- }
1577
- return;
1578
- }
1579
- if (!this.#seeded) {
1580
- this.#seeded = true;
1581
- this.items.set(registration.columns().map((c) => ({
1582
- ...c,
1583
- })));
1584
- }
1585
- });
1586
- }
1587
- resolve() {
1588
- return of(null);
1589
- }
1590
- /** Сбросить рабочую копию к дефолтным колонкам из конфига. */
1591
- onReset() {
1592
- const registration = this.#registration();
1593
- if (registration === null) {
1594
- return;
1595
- }
1596
- this.items.set(registration.defaults().map((c) => ({ ...c })));
1597
- }
1598
- /** Применить настройки к таблице (через registry) и закрыть асайд. */
1599
- onSave() {
1600
- const registration = this.#registration();
1601
- if (registration !== null) {
1602
- const items = this.items();
1603
- registration.apply({
1604
- order: items.map((item) => item.key),
1605
- hidden: items
1606
- .filter((item) => item.hidden)
1607
- .map((item) => item.key),
1608
- });
1609
- }
1610
- this.#registry.clearActive();
1611
- this.onClose();
1612
- }
1613
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtTableSettingsAsideComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1614
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.6", type: RtTableSettingsAsideComponent, isStandalone: true, selector: "rt-table-settings-aside", host: { classAttribute: "rt-table-settings-aside" }, usesInheritance: true, ngImport: i0, template: "<ng-container rtContainerRightSidenavPanel #panel=\"rtContainerRightPanel\" (cancelled)=\"onCancel()\" (closed)=\"onClosed()\" />\n\n<rt-aside [ariaLabel]=\"t().uiColumnSettings\">\n <rt-aside-header [title]=\"t().uiColumnSettingsTitle\" (dismiss)=\"onClose()\">\n <rt-icon-button\n asideActions\n qa-dataid=\"table-settings-reset\"\n icon=\"undo\"\n variant=\"ghost\"\n [tooltip]=\"t().uiResetDefaults\"\n [ariaLabel]=\"t().uiResetDefaults\"\n (clicked)=\"onReset()\" />\n </rt-aside-header>\n\n <rt-table-settings-panel [(items)]=\"items\" />\n\n <rt-aside-footer>\n <button\n rtButton\n asideDismiss\n qa-dataid=\"table-settings-close\"\n type=\"button\"\n appearance=\"text\"\n [label]=\"t().uiClose\"\n [attr.aria-label]=\"t().uiClose\"\n (click)=\"onClose()\"></button>\n <button\n rtButton\n asidePrimary\n qa-dataid=\"table-settings-save\"\n type=\"button\"\n [label]=\"t().uiSave\"\n [attr.aria-label]=\"t().uiSave\"\n (click)=\"onSave()\"></button>\n </rt-aside-footer>\n</rt-aside>\n", styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-table-settings-aside{display:contents}}\n"], dependencies: [{ kind: "component", type: RtAsideComponent, selector: "rt-aside", inputs: ["size", "contentLayout", "width", "ariaLabel", "requestError", "trapFocus", "pending"] }, { kind: "component", type: RtAsideFooterComponent, selector: "rt-aside-footer" }, { kind: "component", type: RtAsideHeaderComponent, selector: "rt-aside-header", inputs: ["title", "overline", "subtitle", "badges", "closable", "loading"], outputs: ["dismiss"] }, { kind: "directive", type: RtButtonDirective, selector: "button[rtButton], a[rtButton]", inputs: ["label", "icon", "iconPos", "theme", "appearance", "size", "loading", "loadingIcon", "loadingLabel", "pressed"] }, { kind: "directive", type: RtContainerRightSidenavPanelDirective, selector: "[rtContainerRightSidenavPanel]", outputs: ["opened", "closed", "cancelled"], exportAs: ["rtContainerRightPanel"] }, { kind: "component", type: RtIconButtonComponent, selector: "rt-icon-button", inputs: ["icon", "glyph", "ariaLabel", "variant", "iconColor", "iconFill", "size", "iconSize", "type", "tooltip", "tabIndex", "loading", "disabled", "active", "indicator"], outputs: ["clicked"] }, { kind: "component", type: RtTableSettingsPanelComponent, selector: "rt-table-settings-panel", inputs: ["items"], outputs: ["itemsChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1615
- }
1616
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtTableSettingsAsideComponent, decorators: [{
1617
- type: Component,
1618
- args: [{ selector: 'rt-table-settings-aside', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
1619
- RtAsideComponent,
1620
- RtAsideFooterComponent,
1621
- RtAsideHeaderComponent,
1622
- RtButtonDirective,
1623
- RtContainerRightSidenavPanelDirective,
1624
- RtIconButtonComponent,
1625
- RtTableSettingsPanelComponent,
1626
- ], host: {
1627
- class: BEM_BLOCK,
1628
- }, template: "<ng-container rtContainerRightSidenavPanel #panel=\"rtContainerRightPanel\" (cancelled)=\"onCancel()\" (closed)=\"onClosed()\" />\n\n<rt-aside [ariaLabel]=\"t().uiColumnSettings\">\n <rt-aside-header [title]=\"t().uiColumnSettingsTitle\" (dismiss)=\"onClose()\">\n <rt-icon-button\n asideActions\n qa-dataid=\"table-settings-reset\"\n icon=\"undo\"\n variant=\"ghost\"\n [tooltip]=\"t().uiResetDefaults\"\n [ariaLabel]=\"t().uiResetDefaults\"\n (clicked)=\"onReset()\" />\n </rt-aside-header>\n\n <rt-table-settings-panel [(items)]=\"items\" />\n\n <rt-aside-footer>\n <button\n rtButton\n asideDismiss\n qa-dataid=\"table-settings-close\"\n type=\"button\"\n appearance=\"text\"\n [label]=\"t().uiClose\"\n [attr.aria-label]=\"t().uiClose\"\n (click)=\"onClose()\"></button>\n <button\n rtButton\n asidePrimary\n qa-dataid=\"table-settings-save\"\n type=\"button\"\n [label]=\"t().uiSave\"\n [attr.aria-label]=\"t().uiSave\"\n (click)=\"onSave()\"></button>\n </rt-aside-footer>\n</rt-aside>\n", styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-table-settings-aside{display:contents}}\n"] }]
1629
- }], ctorParameters: () => [] });
1630
-
1631
- /**
1632
- * Generated bundle index. Do not edit.
1633
- */
1634
-
1635
2513
  export { RT_TABLE_ROW_ACTIONS_COLUMN, RtCopyCellComponent, RtRowHasActionsPipe, RtTableCardDirective, RtTableComponent, RtTableFilterHeaderComponent, RtTableRowActionsDirective, RtTableRowDirective, RtTableSettingsAsideComponent, RtTableSettingsPanelComponent, RtTableSettingsRegistry, RtTableSortHeaderComponent, ariaSortOf, defaultColumnItems, displayedColumnKeys, filterCellsOf, filterOf, filterValueOf, filtersWithOperator, filtersWithValue, isColumnSortable, nextSort, resolveColumns, rowHasAvailableActions, sortDirectionOf, startOperatorOf, withoutLockedHidden };
1636
- //# sourceMappingURL=rt-tools-ui-kit-v2-table.mjs.map
2514
+
2515
+ //# sourceMappingURL=rt-tools-ui-kit-v2-table.mjs.map