@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,1229 +1,2300 @@
1
- import { isString, isNumber, areArraysEqual, isEmpty, EListSortOrder, EFilterOperatorType, FILTER_OPERATORS, transformArrayInput } from '@rt-tools/utils';
2
- import { iconMaterialMap, RtIconComponent } from '@rt-tools/ui-kit-v2/icon';
3
- import * as i0 from '@angular/core';
4
- import { inject, DestroyRef, signal, Injectable, TemplateRef, Directive, InjectionToken, ElementRef, input, booleanAttribute, computed, ViewEncapsulation, ChangeDetectionStrategy, Component, output, linkedSignal, viewChild, contentChild, forwardRef, Injector, effect, untracked } from '@angular/core';
5
- import { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';
6
- import { Subject } from 'rxjs';
7
- import { switchMap, take, takeUntil, map, concatMap, filter } from 'rxjs/operators';
8
- import { IDBStorageService, PlatformService, BlockDirective, ElemDirective, ModDirective, EmptyToDashPipe, ConcatClassesPipe } from '@rt-tools/core';
9
- import { Clipboard } from '@angular/cdk/clipboard';
10
- import { NgTemplateOutlet, TitleCasePipe } from '@angular/common';
11
- import { DomSanitizer } from '@angular/platform-browser';
12
- import { BreakpointsService, rtKitLabel, RT_KIT_TRANSLATOR, ERtDataTableFilterType, rtKitDefault, ERtDataTableColumnType, RT_DATA_TABLE_PRESET_FROM_HOST, RT_PRESET_MATERIAL_CLASS } from '@rt-tools/ui-kit-v2/core';
13
- import { RtIconButtonComponent } from '@rt-tools/ui-kit-v2/icon-button';
14
- import { RtTooltipDirective } from '@rt-tools/ui-kit-v2/tooltip';
15
- import * as i1 from '@angular/forms';
16
- import { FormsModule } from '@angular/forms';
17
- import { RtDatePickerComponent } from '@rt-tools/ui-kit-v2/date-picker';
18
- import { RtInputNumberComponent } from '@rt-tools/ui-kit-v2/input-number';
19
- import { RtInputComponent } from '@rt-tools/ui-kit-v2/input';
20
- import { RtMenuComponent, RtMenuItemComponent } from '@rt-tools/ui-kit-v2/menu';
21
- import { RtSelectComponent } from '@rt-tools/ui-kit-v2/select';
22
- import { RtCheckboxComponent } from '@rt-tools/ui-kit-v2/checkbox';
23
- import { RtRadioButtonComponent } from '@rt-tools/ui-kit-v2/radio-button';
24
-
25
- /** Значение ячейки: как его отдала запись или как его переделала колонка. */
1
+ import { EFilterOperatorType, EListSortOrder, FILTER_OPERATORS, areArraysEqual, isEmpty, isNumber, isString, transformArrayInput } from "@rt-tools/utils";
2
+ import { RtIconComponent, iconMaterialMap } from "@rt-tools/ui-kit-v2/icon";
3
+ import * as i0 from "@angular/core";
4
+ import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, Injectable, InjectionToken, Injector, TemplateRef, ViewEncapsulation, booleanAttribute, computed, contentChild, effect, forwardRef, inject, input, linkedSignal, output, signal, untracked, viewChild } from "@angular/core";
5
+ import { takeUntilDestroyed, toObservable } from "@angular/core/rxjs-interop";
6
+ import { Subject } from "rxjs";
7
+ import { concatMap, filter, map, switchMap, take, takeUntil } from "rxjs/operators";
8
+ import { BlockDirective, ConcatClassesPipe, ElemDirective, EmptyToDashPipe, IDBStorageService, ModDirective, PlatformService } from "@rt-tools/core";
9
+ import { Clipboard } from "@angular/cdk/clipboard";
10
+ import { NgTemplateOutlet, TitleCasePipe } from "@angular/common";
11
+ import { DomSanitizer } from "@angular/platform-browser";
12
+ import { BreakpointsService, ERtDataTableColumnType, ERtDataTableFilterType, RT_DATA_TABLE_PRESET_FROM_HOST, RT_KIT_TRANSLATOR, RT_PRESET_MATERIAL_CLASS, rtKitDefault, rtKitLabel } from "@rt-tools/ui-kit-v2/core";
13
+ import { RtIconButtonComponent } from "@rt-tools/ui-kit-v2/icon-button";
14
+ import { RtTooltipDirective } from "@rt-tools/ui-kit-v2/tooltip";
15
+ import * as i1 from "@angular/forms";
16
+ import { FormsModule } from "@angular/forms";
17
+ import { RtDatePickerComponent } from "@rt-tools/ui-kit-v2/date-picker";
18
+ import { RtInputNumberComponent } from "@rt-tools/ui-kit-v2/input-number";
19
+ import { RtInputComponent } from "@rt-tools/ui-kit-v2/input";
20
+ import { RtMenuComponent, RtMenuItemComponent } from "@rt-tools/ui-kit-v2/menu";
21
+ import { RtSelectComponent } from "@rt-tools/ui-kit-v2/select";
22
+ import { RtCheckboxComponent } from "@rt-tools/ui-kit-v2/checkbox";
23
+ import { RtRadioButtonComponent } from "@rt-tools/ui-kit-v2/radio-button";
26
24
  function dataTableCellValue(row, column) {
27
- const transform = column.transform;
28
- const raw = row[column.propName];
29
- return transform ? transform(raw) : raw;
25
+ const transform = column.transform;
26
+ const raw = row[column.propName];
27
+ return transform ? transform(raw) : raw;
30
28
  }
31
- /** Текст значения для подсказки и буфера — так же, как первый кит: строка, число, иначе JSON. */
32
29
  function dataTableCellText(value) {
33
- if (isString(value)) {
34
- return value;
35
- }
36
- if (isNumber(value)) {
37
- return value.toString();
38
- }
39
- return JSON.stringify(value);
30
+ if (isString(value)) return value;
31
+ if (isNumber(value)) return value.toString();
32
+ return JSON.stringify(value);
40
33
  }
41
- /**
42
- * Сторона кнопки копирования: заданная колонкой, иначе противоположная выравниванию значения —
43
- * справа выровненное значение копируется кнопкой слева.
44
- */
45
34
  function dataTableCopyButtonSide(column) {
46
- return column.copyBtnAlign ?? (column.align === 'right' ? 'left' : 'right');
35
+ return column.copyBtnAlign ?? (column.align === "right" ? "left" : "right");
47
36
  }
48
- /**
49
- * Значок набора кита для имени первого кита, либо `null`, если пары нет.
50
- *
51
- * Идёт через перечень соответствий кита, а не своим списком: второй список разошёлся бы с
52
- * перечнем молча, и одно имя рисовалось бы в двух местах двумя рисунками.
53
- */
54
37
  function dataTableIconName(glyph) {
55
- return iconMaterialMap.find((entry) => entry.from === glyph)?.to ?? null;
38
+ return iconMaterialMap.find((entry) => entry.from === glyph)?.to ?? null;
56
39
  }
57
-
58
- /**
59
- * Порядок имён колонок для сверки двух наборов.
60
- *
61
- * Какой именно порядок, значения не имеет: оба набора выстраиваются одним и тем же и сравниваются
62
- * на равенство. Важно лишь, чтобы порядок был один и не зависел от вида значения, — умолчание
63
- * `sort()` приводит элементы к строке по-своему и на числовых ключах даёт лексикографический.
64
- */
65
40
  function comparePropNames(a, b) {
66
- return String(a).localeCompare(String(b));
67
- }
68
- /**
69
- * Настройки таблицы в хранилище браузера: порядок и видимость столбцов, полосы прокрутки.
70
- *
71
- * Перенесено из первого кита как есть: ключ — тот, что дало приложение, форма записи — та же.
72
- * Поэтому настройки, сохранённые таблицей первого кита, читаются здесь без переделки.
73
- */
74
- class RtDataTableConfigService {
75
- #destroyRef;
76
- #iDBStorageService;
77
- /** Просьбы прочитать сохранённую настройку. */
78
- #readSource;
79
- /** Настройку поменяли здесь: чтение, начатое раньше, отвечать уже не должно. */
80
- #updatedSource;
81
- /** Просьбы записать и снять настройку — один источник на оба действия. */
82
- #writeSource;
83
- #tableConfig;
84
- /**
85
- * Потоки чтения и записи объявлены один раз, а методы только толкают в них просьбы.
86
- *
87
- * Чтение — `switchMap`: отвечает последний вызов, потому что настройка, прочитанная под
88
- * прежний состав столбцов, к нынешнему уже не относится. Чтение, ещё не вернувшееся к
89
- * `updateConfig`, гасится им: иначе прочитанное позже затёрло бы то, что поменяли после.
90
- * Запись и снятие — один поток и `concatMap`: разведённые по двум, они теряют порядок между
91
- * собой, и снятие, обогнавшее запись, оставляет в хранилище снятое.
92
- */
93
- constructor() {
94
- this.#destroyRef = inject(DestroyRef);
95
- this.#iDBStorageService = inject(IDBStorageService);
96
- /** Просьбы прочитать сохранённую настройку. */
97
- this.#readSource = new Subject();
98
- /** Настройку поменяли здесь: чтение, начатое раньше, отвечать уже не должно. */
99
- this.#updatedSource = new Subject();
100
- /** Просьбы записать и снять настройку — один источник на оба действия. */
101
- this.#writeSource = new Subject();
102
- this.#tableConfig = signal({
103
- isVerticalScrollbarShown: false,
104
- isHorizontalScrollbarShown: false,
105
- columns: [],
106
- }, /* @ts-ignore */
107
- ...(ngDevMode ? [{ debugName: "#tableConfig" }] : /* istanbul ignore next */ []));
108
- this.tableConfig = this.#tableConfig.asReadonly();
109
- this.#readSource
110
- .pipe(switchMap((read) => this.#iDBStorageService.get(read.storageKey).pipe(take(1), takeUntil(this.#updatedSource), map((savedConfig) => this.#configOf(read.config, savedConfig)))), takeUntilDestroyed(this.#destroyRef))
111
- .subscribe((config) => {
112
- this.#tableConfig.set(config);
113
- });
114
- this.#writeSource
115
- .pipe(concatMap((write) => this.#writeOf(write).pipe(take(1))), takeUntilDestroyed(this.#destroyRef))
116
- .subscribe();
117
- }
118
- initConfig(storageKey, config) {
119
- this.#readSource.next({ storageKey, config });
120
- }
121
- updateConfig(storageKey, config) {
122
- this.#updatedSource.next();
123
- this.#writeSource.next({ kind: 'set', storageKey, config });
124
- this.#tableConfig.set(config);
125
- }
126
- deleteConfig(storageKey) {
127
- this.#writeSource.next({ kind: 'remove', storageKey });
128
- }
129
- /** Обращение к хранилищу под просьбу записи или снятия. */
130
- #writeOf(write) {
131
- if (write.kind === 'remove') {
132
- return this.#iDBStorageService.remove(write.storageKey);
133
- }
134
- const storedColumns = write.config.columns.map((el) => ({
135
- displayName: el.header.label ?? el.propName.toString(),
136
- propName: el.propName,
137
- width: el?.width ?? 'auto',
138
- orderIndex: el?.orderIndex ?? 0,
139
- hidden: !!el?.hidden,
140
- fixed: !!el?.fixed,
141
- }));
142
- return this.#iDBStorageService.set(write.storageKey, { ...write.config, columns: storedColumns });
143
- }
144
- /**
145
- * Настройка, которую показывает таблица: сохранённая, если она сходится с нынешним составом
146
- * столбцов, иначе — собранная из самого состава.
147
- */
148
- #configOf(config, savedConfig) {
149
- if (!savedConfig?.columns || !this.#isSavedConfigConsistent(config, savedConfig.columns)) {
150
- return {
151
- isVerticalScrollbarShown: false,
152
- isHorizontalScrollbarShown: true,
153
- columns: config.map((el, index) => ({
154
- ...el,
155
- orderIndex: index,
156
- displayName: el?.header?.label?.length ? el.header.label : el.propName.toString(),
157
- })),
158
- };
159
- }
160
- const updatedColumns = savedConfig.columns.map((el) => {
161
- const declared = config.find((item) => el.propName === item.propName);
162
- return {
163
- // Сверка составов выше гарантирует, что столбец с этим именем объявлен.
164
- ...declared,
165
- displayName: declared?.header?.label?.length ? declared.header.label : el?.propName?.toString(),
166
- propName: el.propName,
167
- width: el?.width ?? 'auto',
168
- orderIndex: el?.orderIndex ?? 0,
169
- hidden: !!el?.hidden,
170
- fixed: !!el?.fixed,
171
- };
172
- });
173
- return {
174
- isVerticalScrollbarShown: !!savedConfig?.isVerticalScrollbarShown,
175
- isHorizontalScrollbarShown: !!savedConfig?.isHorizontalScrollbarShown,
176
- columns: updatedColumns,
177
- };
178
- }
179
- #isSavedConfigConsistent(declared, saved) {
180
- return (!!declared?.length &&
181
- !!saved?.length &&
182
- declared.length === saved.length &&
183
- areArraysEqual(declared.map((el) => el.propName).toSorted(comparePropNames), saved.map((el) => el.propName).toSorted(comparePropNames)));
184
- }
185
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDataTableConfigService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
186
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDataTableConfigService }); }
187
- }
188
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDataTableConfigService, decorators: [{
189
- type: Injectable
190
- }], ctorParameters: () => [] });
191
-
192
- /**
193
- * Шаблон значка, который приложение отдаёт таблице.
194
- *
195
- * Когда он дан, значки шапки и ячеек, названные в описании колонок, рисует он, а перечень
196
- * соответствий кита не спрашивается. Это выход для имени, которому в наборе кита нет пары.
197
- *
198
- * ```html
199
- * <rt-data-table ...>
200
- * <ng-template rtDataTableIcon let-name let-row="row">
201
- * <rt-icon [name]="iconOf(name)" />
202
- * </ng-template>
203
- * </rt-data-table>
204
- * ```
205
- */
206
- class RtDataTableIconDirective {
207
- constructor() {
208
- this.template = inject(TemplateRef);
209
- }
210
- static ngTemplateContextGuard(_directive,
211
- // eslint-disable-next-line @typescript-eslint/no-unused-vars -- второй довод стража контекста шаблона стоит только в типе-предикате; убрать его нечем, подпись задаёт каркас
212
- context) {
213
- return true;
214
- }
215
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDataTableIconDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
216
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.6", type: RtDataTableIconDirective, isStandalone: true, selector: "ng-template[rtDataTableIcon]", exportAs: ["rtDataTableIcon"], ngImport: i0 }); }
41
+ return String(a).localeCompare(String(b));
217
42
  }
218
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDataTableIconDirective, decorators: [{
219
- type: Directive,
220
- args: [{
221
- selector: 'ng-template[rtDataTableIcon]',
222
- exportAs: 'rtDataTableIcon',
223
- }]
224
- }] });
225
-
226
- /** Атрибут части строки, нажатие на которую до строки не доходит. */
227
- const RT_DATA_TABLE_STOP_ROW_CLICK_ATTRIBUTE = 'rt-data-table-stop-row-click';
228
- const RT_DATA_TABLE_ROW_HOST = new InjectionToken('RtDataTableRowHost');
229
- /** Попало ли нажатие в часть строки, помеченную как не доходящую до строки. */
43
+ var RtDataTableConfigService = class RtDataTableConfigService {
44
+ #destroyRef;
45
+ #iDBStorageService;
46
+ #readSource;
47
+ #updatedSource;
48
+ #writeSource;
49
+ #tableConfig;
50
+ constructor() {
51
+ this.#destroyRef = inject(DestroyRef);
52
+ this.#iDBStorageService = inject(IDBStorageService);
53
+ this.#readSource = new Subject();
54
+ this.#updatedSource = new Subject();
55
+ this.#writeSource = new Subject();
56
+ this.#tableConfig = signal({
57
+ isVerticalScrollbarShown: false,
58
+ isHorizontalScrollbarShown: false,
59
+ columns: []
60
+ }, ...ngDevMode ? [{ debugName: "#tableConfig" }] : /* istanbul ignore next */ []);
61
+ this.tableConfig = this.#tableConfig.asReadonly();
62
+ this.#readSource.pipe(switchMap((read) => this.#iDBStorageService.get(read.storageKey).pipe(take(1), takeUntil(this.#updatedSource), map((savedConfig) => this.#configOf(read.config, savedConfig)))), takeUntilDestroyed(this.#destroyRef)).subscribe((config) => {
63
+ this.#tableConfig.set(config);
64
+ });
65
+ this.#writeSource.pipe(concatMap((write) => this.#writeOf(write).pipe(take(1))), takeUntilDestroyed(this.#destroyRef)).subscribe();
66
+ }
67
+ initConfig(storageKey, config) {
68
+ this.#readSource.next({
69
+ storageKey,
70
+ config
71
+ });
72
+ }
73
+ updateConfig(storageKey, config) {
74
+ this.#updatedSource.next();
75
+ this.#writeSource.next({
76
+ kind: "set",
77
+ storageKey,
78
+ config
79
+ });
80
+ this.#tableConfig.set(config);
81
+ }
82
+ deleteConfig(storageKey) {
83
+ this.#writeSource.next({
84
+ kind: "remove",
85
+ storageKey
86
+ });
87
+ }
88
+ #writeOf(write) {
89
+ if (write.kind === "remove") return this.#iDBStorageService.remove(write.storageKey);
90
+ const storedColumns = write.config.columns.map((el) => ({
91
+ displayName: el.header.label ?? el.propName.toString(),
92
+ propName: el.propName,
93
+ width: el?.width ?? "auto",
94
+ orderIndex: el?.orderIndex ?? 0,
95
+ hidden: !!el?.hidden,
96
+ fixed: !!el?.fixed
97
+ }));
98
+ return this.#iDBStorageService.set(write.storageKey, {
99
+ ...write.config,
100
+ columns: storedColumns
101
+ });
102
+ }
103
+ #configOf(config, savedConfig) {
104
+ if (!savedConfig?.columns || !this.#isSavedConfigConsistent(config, savedConfig.columns)) return {
105
+ isVerticalScrollbarShown: false,
106
+ isHorizontalScrollbarShown: true,
107
+ columns: config.map((el, index) => ({
108
+ ...el,
109
+ orderIndex: index,
110
+ displayName: el?.header?.label?.length ? el.header.label : el.propName.toString()
111
+ }))
112
+ };
113
+ const updatedColumns = savedConfig.columns.map((el) => {
114
+ const declared = config.find((item) => el.propName === item.propName);
115
+ return {
116
+ ...declared,
117
+ displayName: declared?.header?.label?.length ? declared.header.label : el?.propName?.toString(),
118
+ propName: el.propName,
119
+ width: el?.width ?? "auto",
120
+ orderIndex: el?.orderIndex ?? 0,
121
+ hidden: !!el?.hidden,
122
+ fixed: !!el?.fixed
123
+ };
124
+ });
125
+ return {
126
+ isVerticalScrollbarShown: !!savedConfig?.isVerticalScrollbarShown,
127
+ isHorizontalScrollbarShown: !!savedConfig?.isHorizontalScrollbarShown,
128
+ columns: updatedColumns
129
+ };
130
+ }
131
+ #isSavedConfigConsistent(declared, saved) {
132
+ return !!declared?.length && !!saved?.length && declared.length === saved.length && areArraysEqual(declared.map((el) => el.propName).toSorted(comparePropNames), saved.map((el) => el.propName).toSorted(comparePropNames));
133
+ }
134
+ static {
135
+ this.ɵfac = i0.ɵɵngDeclareFactory({
136
+ minVersion: "12.0.0",
137
+ version: "22.2.2",
138
+ ngImport: i0,
139
+ type: RtDataTableConfigService,
140
+ deps: [],
141
+ target: i0.ɵɵFactoryTarget.Injectable
142
+ });
143
+ }
144
+ static {
145
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
146
+ minVersion: "12.0.0",
147
+ version: "22.2.2",
148
+ ngImport: i0,
149
+ type: RtDataTableConfigService
150
+ });
151
+ }
152
+ };
153
+ i0.ɵɵngDeclareClassMetadata({
154
+ minVersion: "12.0.0",
155
+ version: "22.2.2",
156
+ ngImport: i0,
157
+ type: RtDataTableConfigService,
158
+ decorators: [{ type: Injectable }],
159
+ ctorParameters: () => []
160
+ });
161
+ var RtDataTableIconDirective = class RtDataTableIconDirective {
162
+ constructor() {
163
+ this.template = inject(TemplateRef);
164
+ }
165
+ static ngTemplateContextGuard(_directive, context) {
166
+ return true;
167
+ }
168
+ static {
169
+ this.ɵfac = i0.ɵɵngDeclareFactory({
170
+ minVersion: "12.0.0",
171
+ version: "22.2.2",
172
+ ngImport: i0,
173
+ type: RtDataTableIconDirective,
174
+ deps: [],
175
+ target: i0.ɵɵFactoryTarget.Directive
176
+ });
177
+ }
178
+ static {
179
+ this.ɵdir = i0.ɵɵngDeclareDirective({
180
+ minVersion: "14.0.0",
181
+ version: "22.2.2",
182
+ type: RtDataTableIconDirective,
183
+ isStandalone: true,
184
+ selector: "ng-template[rtDataTableIcon]",
185
+ exportAs: ["rtDataTableIcon"],
186
+ ngImport: i0
187
+ });
188
+ }
189
+ };
190
+ i0.ɵɵngDeclareClassMetadata({
191
+ minVersion: "12.0.0",
192
+ version: "22.2.2",
193
+ ngImport: i0,
194
+ type: RtDataTableIconDirective,
195
+ decorators: [{
196
+ type: Directive,
197
+ args: [{
198
+ selector: "ng-template[rtDataTableIcon]",
199
+ exportAs: "rtDataTableIcon"
200
+ }]
201
+ }]
202
+ });
203
+ const RT_DATA_TABLE_STOP_ROW_CLICK_ATTRIBUTE = "rt-data-table-stop-row-click";
204
+ const RT_DATA_TABLE_ROW_HOST = new InjectionToken("RtDataTableRowHost");
230
205
  function isInsideStopNode(event) {
231
- return event.target instanceof Element && !!event.target.closest(`[${RT_DATA_TABLE_STOP_ROW_CLICK_ATTRIBUTE}]`);
232
- }
233
- /**
234
- * Помечает часть строки, нажатие на которую до строки не доходит, — картинку, кнопку приложения,
235
- * блок текста в своей ячейке.
236
- */
237
- class RtDataTableStopRowClickDirective {
238
- #platformService = inject(PlatformService);
239
- #elementRef = inject((ElementRef));
240
- ngOnInit() {
241
- if (this.#platformService.isPlatformBrowser) {
242
- this.#elementRef.nativeElement.setAttribute(RT_DATA_TABLE_STOP_ROW_CLICK_ATTRIBUTE, '');
243
- }
244
- }
245
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDataTableStopRowClickDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
246
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.6", type: RtDataTableStopRowClickDirective, isStandalone: true, selector: "[rtDataTableStopRowClick]", ngImport: i0 }); }
247
- }
248
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDataTableStopRowClickDirective, decorators: [{
249
- type: Directive,
250
- args: [{
251
- selector: '[rtDataTableStopRowClick]',
252
- }]
253
- }] });
254
- /**
255
- * Нажатие и двойное нажатие строки — как в первом ките.
256
- *
257
- * О нажатии строка сообщает, когда кнопка опускается, а не когда отпускается, и любой кнопкой:
258
- * так было в первом ките, и так переносится. Двойное нажатие поэтому приходит после двух нажатий
259
- * строки.
260
- */
261
- class RtDataTableRowClickDirective {
262
- constructor() {
263
- this.#host = inject(RT_DATA_TABLE_ROW_HOST);
264
- /** Запись строки. */
265
- this.entity = input.required({ ...(ngDevMode ? { debugName: "entity" } : /* istanbul ignore next */ {}), alias: 'rtDataTableRowClick' });
266
- /** Строка сообщает о нажатиях. */
267
- this.isTableRowClickable = input(true, { ...(ngDevMode ? { debugName: "isTableRowClickable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
268
- }
269
- #host;
270
- onMouseDown(event) {
271
- if (!this.isTableRowClickable() || isInsideStopNode(event)) {
272
- event.stopPropagation();
273
- return;
274
- }
275
- this.#host.onRowClick(this.entity(), event);
276
- }
277
- onDoubleClick(event) {
278
- if (!this.isTableRowClickable() || isInsideStopNode(event)) {
279
- event.stopPropagation();
280
- return;
281
- }
282
- this.#host.onRowDoubleClick(this.entity());
283
- }
284
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDataTableRowClickDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
285
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.6", type: RtDataTableRowClickDirective, isStandalone: true, selector: "[rtDataTableRowClick]", inputs: { entity: { classPropertyName: "entity", publicName: "rtDataTableRowClick", isSignal: true, isRequired: true, transformFunction: null }, isTableRowClickable: { classPropertyName: "isTableRowClickable", publicName: "isTableRowClickable", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mousedown": "onMouseDown($event)", "dblclick": "onDoubleClick($event)" } }, ngImport: i0 }); }
206
+ return event.target instanceof Element && !!event.target.closest(`[rt-data-table-stop-row-click]`);
286
207
  }
287
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDataTableRowClickDirective, decorators: [{
288
- type: Directive,
289
- args: [{
290
- selector: '[rtDataTableRowClick]',
291
- host: {
292
- '(mousedown)': 'onMouseDown($event)',
293
- '(dblclick)': 'onDoubleClick($event)',
294
- },
295
- }]
296
- }], propDecorators: { entity: [{ type: i0.Input, args: [{ isSignal: true, alias: "rtDataTableRowClick", required: true }] }], isTableRowClickable: [{ type: i0.Input, args: [{ isSignal: true, alias: "isTableRowClickable", required: false }] }] } });
297
-
298
- const BEM_BLOCK$3 = 'rt-data-table-cell';
299
- /** Сколько держать «скопировано» перед возвратом кнопки — как в первом ките. */
300
- const COPIED_DELAY_MS = 2000;
301
- /**
302
- * Готовая ячейка `rt-data-table` — ячейка первого кита без Material.
303
- *
304
- * Значение рисуется как пришло или как его переделала колонка; пустое — прочерком. Длинное
305
- * обрезается в строку, и подсказка со значением целиком бывает только у обрезанного. Значок —
306
- * набором кита по имени первого кита либо шаблоном значка приложения. Кнопка копирования
307
- * проявляется при наведении и стоит на стороне, противоположной выравниванию значения.
308
- */
309
- class RtDataTableCellComponent {
310
- #breakpoints;
311
- #clipboard;
312
- #sanitizer;
313
- #host;
314
- #copiedTimer;
315
- #copyLabel;
316
- #copiedLabel;
317
- constructor() {
318
- this.#breakpoints = inject(BreakpointsService);
319
- this.#clipboard = inject(Clipboard);
320
- this.#sanitizer = inject(DomSanitizer);
321
- this.#host = inject(ElementRef);
322
- this.#copiedTimer = null;
323
- this.#copyLabel = rtKitLabel('dataTableCopy');
324
- this.#copiedLabel = rtKitLabel('dataTableCopied');
325
- /** Экран узкий: подсказки гаснут. Что кнопка копирования там видна всегда, решают стили. */
326
- this.narrow = this.#breakpoints.narrow;
327
- this.value = computed(() => dataTableCellValue(this.row(), this.column()), /* @ts-ignore */
328
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
329
- /**
330
- * Копировать нечего: значение пусто. Считается той же утилитой, что рисует прочерк вместо
331
- * значения, — второй ответ на этот вопрос разошёлся бы с прочерком молча.
332
- */
333
- this.empty = computed(() => isEmpty(this.value()), /* @ts-ignore */
334
- ...(ngDevMode ? [{ debugName: "empty" }] : /* istanbul ignore next */ []));
335
- this.copyable = computed(() => this.column().copyable && !this.empty(), /* @ts-ignore */
336
- ...(ngDevMode ? [{ debugName: "copyable" }] : /* istanbul ignore next */ []));
337
- /**
338
- * Значок колонки. Его видимость, цвет и подсказку ячейка не читает — как первый кит: поля
339
- * приняты ради переезда без правок и ничего не меняют.
340
- */
341
- this.icon = computed(() => this.column().icon ?? null, /* @ts-ignore */
342
- ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
343
- /** Значок набора кита для имени первого кита; без пары — ничего. */
344
- this.kitIcon = computed(() => {
345
- const icon = this.icon();
346
- return icon ? dataTableIconName(icon.glyph) : null;
347
- }, /* @ts-ignore */
348
- ...(ngDevMode ? [{ debugName: "kitIcon" }] : /* istanbul ignore next */ []));
349
- /**
350
- * Имя без пары в перечне соответствий: его ячейка рисует глифом шрифта Material Symbols, как
351
- * первый кит рисовал любой глиф. Шрифт кит не везёт — глиф виден там, где шрифт подключило
352
- * приложение, а без шрифта на месте значка стоит его имя.
353
- */
354
- this.glyph = computed(() => {
355
- const icon = this.icon();
356
- return icon && !this.kitIcon() ? icon.glyph : null;
357
- }, /* @ts-ignore */
358
- ...(ngDevMode ? [{ debugName: "glyph" }] : /* istanbul ignore next */ []));
359
- /** Залитый глиф — как залитый значок набора: контурным его делает `outlined` колонки. */
360
- this.glyphMods = computed(() => ({ filled: this.icon()?.outlined !== true }), /* @ts-ignore */
361
- ...(ngDevMode ? [{ debugName: "glyphMods" }] : /* istanbul ignore next */ []));
362
- this.iconContext = computed(() => {
363
- const icon = this.icon();
364
- return icon ? { $implicit: icon.glyph, column: this.column(), row: this.row() } : null;
365
- }, /* @ts-ignore */
366
- ...(ngDevMode ? [{ debugName: "iconContext" }] : /* istanbul ignore next */ []));
367
- /**
368
- * Стиль значка, посчитанный колонкой по значению строки, — строкой, как в первом ките.
369
- * Это одна из странностей первого кита, перенесённых как есть: такую строку не перекрашивает
370
- * ни набор, ни тёмная тема.
371
- */
372
- this.iconStyle = computed(() => {
373
- const transform = this.column().iconTransform;
374
- // eslint-disable-next-line sonarjs/no-angular-bypass-sanitization -- строка стиля собрана описанием колонок приложения, а не значением, введённым человеком
375
- return transform ? this.#sanitizer.bypassSecurityTrustStyle(transform(this.row()[this.column().propName])) : null;
376
- }, /* @ts-ignore */
377
- ...(ngDevMode ? [{ debugName: "iconStyle" }] : /* istanbul ignore next */ []));
378
- this.hovered = signal(false, /* @ts-ignore */
379
- ...(ngDevMode ? [{ debugName: "hovered" }] : /* istanbul ignore next */ []));
380
- this.copied = signal(false, /* @ts-ignore */
381
- ...(ngDevMode ? [{ debugName: "copied" }] : /* istanbul ignore next */ []));
382
- /** Подсказка: заданная колонкой, иначе значение целиком — и только у обрезанного. */
383
- this.hint = signal('', /* @ts-ignore */
384
- ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
385
- this.copyLabel = computed(() => (this.copied() ? this.#copiedLabel() : this.#copyLabel()), /* @ts-ignore */
386
- ...(ngDevMode ? [{ debugName: "copyLabel" }] : /* istanbul ignore next */ []));
387
- this.copyIcon = computed(() => (this.copied() ? 'check' : 'copy'), /* @ts-ignore */
388
- ...(ngDevMode ? [{ debugName: "copyIcon" }] : /* istanbul ignore next */ []));
389
- this.titleMods = computed(() => ({ align: this.column().align }), /* @ts-ignore */
390
- ...(ngDevMode ? [{ debugName: "titleMods" }] : /* istanbul ignore next */ []));
391
- this.copyMods = computed(() => ({
392
- position: dataTableCopyButtonSide(this.column()),
393
- complete: this.copied(),
394
- visible: this.hovered(),
395
- }), /* @ts-ignore */
396
- ...(ngDevMode ? [{ debugName: "copyMods" }] : /* istanbul ignore next */ []));
397
- this.row = input.required(/* @ts-ignore */
398
- ...(ngDevMode ? [{ debugName: "row" }] : /* istanbul ignore next */ []));
399
- this.column = input.required(/* @ts-ignore */
400
- ...(ngDevMode ? [{ debugName: "column" }] : /* istanbul ignore next */ []));
401
- /** Шаблон значка приложения; когда он дан, перечень кита не спрашивается. */
402
- this.iconTemplate = input(null, /* @ts-ignore */
403
- ...(ngDevMode ? [{ debugName: "iconTemplate" }] : /* istanbul ignore next */ []));
404
- inject(DestroyRef).onDestroy(() => this.#clearTimer());
405
- }
406
- /**
407
- * Наведение: проявить кнопку копирования и замерить обрезку.
408
- *
409
- * Ширина известна только отрисованному узлу, а меняется она и от переезда столбца, и от
410
- * ширины окна: посчитанная один раз, она соврала бы при первом же изменении.
411
- */
412
- onMouseEnter() {
413
- this.hovered.set(true);
414
- const text = this.#host.nativeElement.querySelector(`.${BEM_BLOCK$3}__text`);
415
- const cut = text !== null && text.scrollWidth > text.clientWidth;
416
- this.hint.set(!this.narrow() && cut ? (this.column().tooltip ?? dataTableCellText(this.value())) : '');
417
- }
418
- onCopy() {
419
- this.#clipboard.copy(dataTableCellText(this.value()));
420
- this.copied.set(true);
421
- this.#clearTimer();
422
- this.#copiedTimer = setTimeout(() => this.copied.set(false), COPIED_DELAY_MS);
423
- }
424
- #clearTimer() {
425
- if (this.#copiedTimer !== null) {
426
- clearTimeout(this.#copiedTimer);
427
- this.#copiedTimer = null;
428
- }
429
- }
430
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDataTableCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
431
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: RtDataTableCellComponent, isStandalone: true, selector: "rt-data-table-cell", inputs: { row: { classPropertyName: "row", publicName: "row", isSignal: true, isRequired: true, transformFunction: null }, column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: true, transformFunction: null }, iconTemplate: { classPropertyName: "iconTemplate", publicName: "iconTemplate", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "hovered.set(false)" }, properties: { "style.width": "column().width", "style.min-width": "column().minWidth" }, classAttribute: "rt-data-table-cell" }, ngImport: i0, template: "<ng-container rtBlock=\"rt-data-table-cell\">\n <ng-template #iconTpl>\n @if (iconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"iconContext()\" />\n } @else if (kitIcon(); as name) {\n <rt-icon size=\"lg\" [name]=\"name\" [fill]=\"icon()?.outlined !== true\" [style]=\"iconStyle()\" />\n } @else if (glyph(); as name) {\n <span rtElem=\"glyph\" aria-hidden=\"true\" qa-dataid=\"data-table-cell-glyph\" [rtMod]=\"glyphMods()\" [style]=\"iconStyle()\">\n {{ name }}\n </span>\n }\n </ng-template>\n\n @if (icon()?.placement === 'left') {\n <span rtElem=\"prefix\" qa-dataid=\"data-table-cell-prefix\"><ng-container [ngTemplateOutlet]=\"iconTpl\" /></span>\n }\n\n <div rtElem=\"title\" [rtMod]=\"titleMods()\">\n <div rtElem=\"text\" qa-dataid=\"data-table-cell-text\" [rtTooltip]=\"hint()\">{{ value() | emptyToDash }}</div>\n </div>\n\n @if (icon()?.placement === 'right') {\n <span rtElem=\"suffix\" qa-dataid=\"data-table-cell-suffix\"><ng-container [ngTemplateOutlet]=\"iconTpl\" /></span>\n }\n\n @if (copyable()) {\n <rt-icon-button\n rtElem=\"copy-button\"\n rtDataTableStopRowClick\n qa-dataid=\"data-table-cell-copy\"\n size=\"sm\"\n [rtMod]=\"copyMods()\"\n [icon]=\"copyIcon()\"\n [ariaLabel]=\"copyLabel()\"\n [tooltip]=\"narrow() ? '' : copyLabel()\"\n (clicked)=\"onCopy()\" />\n }\n</ng-container>\n", styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-data-table-cell{--rt-data-table-cell-transition-duration: var(--rt-duration-fast);--rt-data-table-cell-glyph-size: var(--rt-size-6);position:relative;display:flex;width:100%;height:100%;align-items:center;gap:var(--rt-space-sm)}.rt-data-table-cell__glyph{display:inline-block;overflow:hidden;width:var(--rt-data-table-cell-glyph-size);font-family:Material Symbols Outlined,sans-serif;font-feature-settings:\"liga\";font-size:var(--rt-data-table-cell-glyph-size);font-style:normal;font-weight:var(--rt-font-weight-regular);letter-spacing:normal;line-height:1;text-transform:none;white-space:nowrap}.rt-data-table-cell__glyph--filled{font-variation-settings:\"FILL\" 1}.rt-data-table-cell__prefix,.rt-data-table-cell__suffix{display:inline-flex;min-width:fit-content;flex:0 0 auto}.rt-data-table-cell__title{display:table;width:100%;table-layout:fixed}.rt-data-table-cell__title--align--left{text-align:left}.rt-data-table-cell__title--align--center{text-align:center}.rt-data-table-cell__title--align--right{text-align:right}.rt-data-table-cell__text{overflow:hidden;width:100%;padding:var(--rt-space-sm) var(--rt-space-sm) var(--rt-space-sm) 0;text-overflow:ellipsis;white-space:nowrap}.rt-data-table-cell__copy-button{position:absolute;transition:visibility var(--rt-data-table-cell-transition-duration) linear;visibility:hidden}@media(hover:none){.rt-data-table-cell__copy-button{visibility:visible}}.rt-data-table-cell__copy-button{--rt-icon-button-color: var(--rt-list-copy-button-color)}.rt-data-table-cell__copy-button .rt-icon-button{--rt-icon-button-size-step: var(--rt-list-copy-button-size);--rt-icon-button-radius: var(--rt-list-copy-button-radius);--rt-icon-button-color-hover: var(--rt-color-text-primary);--rt-icon-button-color-bg-hover: var(--rt-list-copy-button-bg-hover);background-color:var(--rt-list-copy-button-bg)}.rt-data-table-cell__copy-button--position--left{left:var(--rt-space-xs)}.rt-data-table-cell__copy-button--position--right{right:var(--rt-space-xs)}.rt-data-table-cell__copy-button--complete{cursor:not-allowed}.rt-data-table-cell__copy-button--visible{visibility:visible}}\n"], dependencies: [{ kind: "component", type:
432
- // components
433
- 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:
434
- // directives
435
- BlockDirective, selector: "[rtBlock]", inputs: ["rtMod"] }, { kind: "directive", type: ElemDirective, selector: "[rtElem]", inputs: ["rtMod"] }, { kind: "directive", type: ModDirective, selector: "[rtMod]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: RtDataTableStopRowClickDirective, selector: "[rtDataTableStopRowClick]" }, { kind: "directive", type: RtTooltipDirective, selector: "[rtTooltip]", inputs: ["rtTooltip", "rtTooltipPlacement", "rtTooltipWhenTruncated"], exportAs: ["rtTooltip"] }, { kind: "pipe", type:
436
- // pipes
437
- EmptyToDashPipe, name: "emptyToDash" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
438
- }
439
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDataTableCellComponent, decorators: [{
440
- type: Component,
441
- args: [{ selector: 'rt-data-table-cell', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
442
- // components
443
- RtIconButtonComponent,
444
- RtIconComponent,
445
- // directives
446
- BlockDirective,
447
- ElemDirective,
448
- ModDirective,
449
- NgTemplateOutlet,
450
- RtDataTableStopRowClickDirective,
451
- RtTooltipDirective,
452
- // pipes
453
- EmptyToDashPipe,
454
- ], host: {
455
- class: BEM_BLOCK$3,
456
- '[style.width]': 'column().width',
457
- '[style.min-width]': 'column().minWidth',
458
- '(mouseenter)': 'onMouseEnter()',
459
- '(mouseleave)': 'hovered.set(false)',
460
- }, template: "<ng-container rtBlock=\"rt-data-table-cell\">\n <ng-template #iconTpl>\n @if (iconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"iconContext()\" />\n } @else if (kitIcon(); as name) {\n <rt-icon size=\"lg\" [name]=\"name\" [fill]=\"icon()?.outlined !== true\" [style]=\"iconStyle()\" />\n } @else if (glyph(); as name) {\n <span rtElem=\"glyph\" aria-hidden=\"true\" qa-dataid=\"data-table-cell-glyph\" [rtMod]=\"glyphMods()\" [style]=\"iconStyle()\">\n {{ name }}\n </span>\n }\n </ng-template>\n\n @if (icon()?.placement === 'left') {\n <span rtElem=\"prefix\" qa-dataid=\"data-table-cell-prefix\"><ng-container [ngTemplateOutlet]=\"iconTpl\" /></span>\n }\n\n <div rtElem=\"title\" [rtMod]=\"titleMods()\">\n <div rtElem=\"text\" qa-dataid=\"data-table-cell-text\" [rtTooltip]=\"hint()\">{{ value() | emptyToDash }}</div>\n </div>\n\n @if (icon()?.placement === 'right') {\n <span rtElem=\"suffix\" qa-dataid=\"data-table-cell-suffix\"><ng-container [ngTemplateOutlet]=\"iconTpl\" /></span>\n }\n\n @if (copyable()) {\n <rt-icon-button\n rtElem=\"copy-button\"\n rtDataTableStopRowClick\n qa-dataid=\"data-table-cell-copy\"\n size=\"sm\"\n [rtMod]=\"copyMods()\"\n [icon]=\"copyIcon()\"\n [ariaLabel]=\"copyLabel()\"\n [tooltip]=\"narrow() ? '' : copyLabel()\"\n (clicked)=\"onCopy()\" />\n }\n</ng-container>\n", styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-data-table-cell{--rt-data-table-cell-transition-duration: var(--rt-duration-fast);--rt-data-table-cell-glyph-size: var(--rt-size-6);position:relative;display:flex;width:100%;height:100%;align-items:center;gap:var(--rt-space-sm)}.rt-data-table-cell__glyph{display:inline-block;overflow:hidden;width:var(--rt-data-table-cell-glyph-size);font-family:Material Symbols Outlined,sans-serif;font-feature-settings:\"liga\";font-size:var(--rt-data-table-cell-glyph-size);font-style:normal;font-weight:var(--rt-font-weight-regular);letter-spacing:normal;line-height:1;text-transform:none;white-space:nowrap}.rt-data-table-cell__glyph--filled{font-variation-settings:\"FILL\" 1}.rt-data-table-cell__prefix,.rt-data-table-cell__suffix{display:inline-flex;min-width:fit-content;flex:0 0 auto}.rt-data-table-cell__title{display:table;width:100%;table-layout:fixed}.rt-data-table-cell__title--align--left{text-align:left}.rt-data-table-cell__title--align--center{text-align:center}.rt-data-table-cell__title--align--right{text-align:right}.rt-data-table-cell__text{overflow:hidden;width:100%;padding:var(--rt-space-sm) var(--rt-space-sm) var(--rt-space-sm) 0;text-overflow:ellipsis;white-space:nowrap}.rt-data-table-cell__copy-button{position:absolute;transition:visibility var(--rt-data-table-cell-transition-duration) linear;visibility:hidden}@media(hover:none){.rt-data-table-cell__copy-button{visibility:visible}}.rt-data-table-cell__copy-button{--rt-icon-button-color: var(--rt-list-copy-button-color)}.rt-data-table-cell__copy-button .rt-icon-button{--rt-icon-button-size-step: var(--rt-list-copy-button-size);--rt-icon-button-radius: var(--rt-list-copy-button-radius);--rt-icon-button-color-hover: var(--rt-color-text-primary);--rt-icon-button-color-bg-hover: var(--rt-list-copy-button-bg-hover);background-color:var(--rt-list-copy-button-bg)}.rt-data-table-cell__copy-button--position--left{left:var(--rt-space-xs)}.rt-data-table-cell__copy-button--position--right{right:var(--rt-space-xs)}.rt-data-table-cell__copy-button--complete{cursor:not-allowed}.rt-data-table-cell__copy-button--visible{visibility:visible}}\n"] }]
461
- }], ctorParameters: () => [], propDecorators: { row: [{ type: i0.Input, args: [{ isSignal: true, alias: "row", required: true }] }], column: [{ type: i0.Input, args: [{ isSignal: true, alias: "column", required: true }] }], iconTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconTemplate", required: false }] }] } });
462
-
463
- /**
464
- * Какой порядок просит нажатие на шапку — как в первом ките: по возрастанию, а после возрастания
465
- * по убыванию. Снятия порядка нет: после убывания снова возрастание.
466
- */
208
+ var RtDataTableStopRowClickDirective = class RtDataTableStopRowClickDirective {
209
+ #platformService = inject(PlatformService);
210
+ #elementRef = inject(ElementRef);
211
+ ngOnInit() {
212
+ if (this.#platformService.isPlatformBrowser) this.#elementRef.nativeElement.setAttribute(RT_DATA_TABLE_STOP_ROW_CLICK_ATTRIBUTE, "");
213
+ }
214
+ static {
215
+ this.ɵfac = i0.ɵɵngDeclareFactory({
216
+ minVersion: "12.0.0",
217
+ version: "22.2.2",
218
+ ngImport: i0,
219
+ type: RtDataTableStopRowClickDirective,
220
+ deps: [],
221
+ target: i0.ɵɵFactoryTarget.Directive
222
+ });
223
+ }
224
+ static {
225
+ this.ɵdir = i0.ɵɵngDeclareDirective({
226
+ minVersion: "14.0.0",
227
+ version: "22.2.2",
228
+ type: RtDataTableStopRowClickDirective,
229
+ isStandalone: true,
230
+ selector: "[rtDataTableStopRowClick]",
231
+ ngImport: i0
232
+ });
233
+ }
234
+ };
235
+ i0.ɵɵngDeclareClassMetadata({
236
+ minVersion: "12.0.0",
237
+ version: "22.2.2",
238
+ ngImport: i0,
239
+ type: RtDataTableStopRowClickDirective,
240
+ decorators: [{
241
+ type: Directive,
242
+ args: [{ selector: "[rtDataTableStopRowClick]" }]
243
+ }]
244
+ });
245
+ var RtDataTableRowClickDirective = class RtDataTableRowClickDirective {
246
+ constructor() {
247
+ this.#host = inject(RT_DATA_TABLE_ROW_HOST);
248
+ this.entity = input.required({
249
+ ...ngDevMode ? { debugName: "entity" } : /* istanbul ignore next */ {},
250
+ alias: "rtDataTableRowClick"
251
+ });
252
+ this.isTableRowClickable = input(true, {
253
+ ...ngDevMode ? { debugName: "isTableRowClickable" } : /* istanbul ignore next */ {},
254
+ transform: booleanAttribute
255
+ });
256
+ }
257
+ #host;
258
+ onMouseDown(event) {
259
+ if (!this.isTableRowClickable() || isInsideStopNode(event)) {
260
+ event.stopPropagation();
261
+ return;
262
+ }
263
+ this.#host.onRowClick(this.entity(), event);
264
+ }
265
+ onDoubleClick(event) {
266
+ if (!this.isTableRowClickable() || isInsideStopNode(event)) {
267
+ event.stopPropagation();
268
+ return;
269
+ }
270
+ this.#host.onRowDoubleClick(this.entity());
271
+ }
272
+ static {
273
+ this.ɵfac = i0.ɵɵngDeclareFactory({
274
+ minVersion: "12.0.0",
275
+ version: "22.2.2",
276
+ ngImport: i0,
277
+ type: RtDataTableRowClickDirective,
278
+ deps: [],
279
+ target: i0.ɵɵFactoryTarget.Directive
280
+ });
281
+ }
282
+ static {
283
+ this.ɵdir = i0.ɵɵngDeclareDirective({
284
+ minVersion: "17.1.0",
285
+ version: "22.2.2",
286
+ type: RtDataTableRowClickDirective,
287
+ isStandalone: true,
288
+ selector: "[rtDataTableRowClick]",
289
+ inputs: {
290
+ entity: {
291
+ classPropertyName: "entity",
292
+ publicName: "rtDataTableRowClick",
293
+ isSignal: true,
294
+ isRequired: true,
295
+ transformFunction: null
296
+ },
297
+ isTableRowClickable: {
298
+ classPropertyName: "isTableRowClickable",
299
+ publicName: "isTableRowClickable",
300
+ isSignal: true,
301
+ isRequired: false,
302
+ transformFunction: null
303
+ }
304
+ },
305
+ host: { listeners: {
306
+ "mousedown": "onMouseDown($event)",
307
+ "dblclick": "onDoubleClick($event)"
308
+ } },
309
+ ngImport: i0
310
+ });
311
+ }
312
+ };
313
+ i0.ɵɵngDeclareClassMetadata({
314
+ minVersion: "12.0.0",
315
+ version: "22.2.2",
316
+ ngImport: i0,
317
+ type: RtDataTableRowClickDirective,
318
+ decorators: [{
319
+ type: Directive,
320
+ args: [{
321
+ selector: "[rtDataTableRowClick]",
322
+ host: {
323
+ "(mousedown)": "onMouseDown($event)",
324
+ "(dblclick)": "onDoubleClick($event)"
325
+ }
326
+ }]
327
+ }],
328
+ propDecorators: {
329
+ entity: [{
330
+ type: i0.Input,
331
+ args: [{
332
+ isSignal: true,
333
+ alias: "rtDataTableRowClick",
334
+ required: true
335
+ }]
336
+ }],
337
+ isTableRowClickable: [{
338
+ type: i0.Input,
339
+ args: [{
340
+ isSignal: true,
341
+ alias: "isTableRowClickable",
342
+ required: false
343
+ }]
344
+ }]
345
+ }
346
+ });
347
+ const BEM_BLOCK$3 = "rt-data-table-cell";
348
+ const COPIED_DELAY_MS = 2e3;
349
+ var RtDataTableCellComponent = class RtDataTableCellComponent {
350
+ #breakpoints;
351
+ #clipboard;
352
+ #sanitizer;
353
+ #host;
354
+ #copiedTimer;
355
+ #copyLabel;
356
+ #copiedLabel;
357
+ constructor() {
358
+ this.#breakpoints = inject(BreakpointsService);
359
+ this.#clipboard = inject(Clipboard);
360
+ this.#sanitizer = inject(DomSanitizer);
361
+ this.#host = inject(ElementRef);
362
+ this.#copiedTimer = null;
363
+ this.#copyLabel = rtKitLabel("dataTableCopy");
364
+ this.#copiedLabel = rtKitLabel("dataTableCopied");
365
+ this.narrow = this.#breakpoints.narrow;
366
+ this.value = computed(() => dataTableCellValue(this.row(), this.column()), ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
367
+ this.empty = computed(() => isEmpty(this.value()), ...ngDevMode ? [{ debugName: "empty" }] : /* istanbul ignore next */ []);
368
+ this.copyable = computed(() => this.column().copyable && !this.empty(), ...ngDevMode ? [{ debugName: "copyable" }] : /* istanbul ignore next */ []);
369
+ this.icon = computed(() => this.column().icon ?? null, ...ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []);
370
+ this.kitIcon = computed(() => {
371
+ const icon = this.icon();
372
+ return icon ? dataTableIconName(icon.glyph) : null;
373
+ }, ...ngDevMode ? [{ debugName: "kitIcon" }] : /* istanbul ignore next */ []);
374
+ this.glyph = computed(() => {
375
+ const icon = this.icon();
376
+ return icon && !this.kitIcon() ? icon.glyph : null;
377
+ }, ...ngDevMode ? [{ debugName: "glyph" }] : /* istanbul ignore next */ []);
378
+ this.glyphMods = computed(() => ({ filled: this.icon()?.outlined !== true }), ...ngDevMode ? [{ debugName: "glyphMods" }] : /* istanbul ignore next */ []);
379
+ this.iconContext = computed(() => {
380
+ const icon = this.icon();
381
+ return icon ? {
382
+ $implicit: icon.glyph,
383
+ column: this.column(),
384
+ row: this.row()
385
+ } : null;
386
+ }, ...ngDevMode ? [{ debugName: "iconContext" }] : /* istanbul ignore next */ []);
387
+ this.iconStyle = computed(() => {
388
+ const transform = this.column().iconTransform;
389
+ return transform ? this.#sanitizer.bypassSecurityTrustStyle(transform(this.row()[this.column().propName])) : null;
390
+ }, ...ngDevMode ? [{ debugName: "iconStyle" }] : /* istanbul ignore next */ []);
391
+ this.hovered = signal(false, ...ngDevMode ? [{ debugName: "hovered" }] : /* istanbul ignore next */ []);
392
+ this.copied = signal(false, ...ngDevMode ? [{ debugName: "copied" }] : /* istanbul ignore next */ []);
393
+ this.hint = signal("", ...ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []);
394
+ this.copyLabel = computed(() => this.copied() ? this.#copiedLabel() : this.#copyLabel(), ...ngDevMode ? [{ debugName: "copyLabel" }] : /* istanbul ignore next */ []);
395
+ this.copyIcon = computed(() => this.copied() ? "check" : "copy", ...ngDevMode ? [{ debugName: "copyIcon" }] : /* istanbul ignore next */ []);
396
+ this.titleMods = computed(() => ({ align: this.column().align }), ...ngDevMode ? [{ debugName: "titleMods" }] : /* istanbul ignore next */ []);
397
+ this.copyMods = computed(() => ({
398
+ position: dataTableCopyButtonSide(this.column()),
399
+ complete: this.copied(),
400
+ visible: this.hovered()
401
+ }), ...ngDevMode ? [{ debugName: "copyMods" }] : /* istanbul ignore next */ []);
402
+ this.row = input.required(...ngDevMode ? [{ debugName: "row" }] : /* istanbul ignore next */ []);
403
+ this.column = input.required(...ngDevMode ? [{ debugName: "column" }] : /* istanbul ignore next */ []);
404
+ this.iconTemplate = input(null, ...ngDevMode ? [{ debugName: "iconTemplate" }] : /* istanbul ignore next */ []);
405
+ inject(DestroyRef).onDestroy(() => this.#clearTimer());
406
+ }
407
+ onMouseEnter() {
408
+ this.hovered.set(true);
409
+ const text = this.#host.nativeElement.querySelector(`.${BEM_BLOCK$3}__text`);
410
+ const cut = text !== null && text.scrollWidth > text.clientWidth;
411
+ this.hint.set(!this.narrow() && cut ? this.column().tooltip ?? dataTableCellText(this.value()) : "");
412
+ }
413
+ onCopy() {
414
+ this.#clipboard.copy(dataTableCellText(this.value()));
415
+ this.copied.set(true);
416
+ this.#clearTimer();
417
+ this.#copiedTimer = setTimeout(() => this.copied.set(false), COPIED_DELAY_MS);
418
+ }
419
+ #clearTimer() {
420
+ if (this.#copiedTimer !== null) {
421
+ clearTimeout(this.#copiedTimer);
422
+ this.#copiedTimer = null;
423
+ }
424
+ }
425
+ static {
426
+ this.ɵfac = i0.ɵɵngDeclareFactory({
427
+ minVersion: "12.0.0",
428
+ version: "22.2.2",
429
+ ngImport: i0,
430
+ type: RtDataTableCellComponent,
431
+ deps: [],
432
+ target: i0.ɵɵFactoryTarget.Component
433
+ });
434
+ }
435
+ static {
436
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
437
+ minVersion: "17.0.0",
438
+ version: "22.2.2",
439
+ type: RtDataTableCellComponent,
440
+ isStandalone: true,
441
+ selector: "rt-data-table-cell",
442
+ inputs: {
443
+ row: {
444
+ classPropertyName: "row",
445
+ publicName: "row",
446
+ isSignal: true,
447
+ isRequired: true,
448
+ transformFunction: null
449
+ },
450
+ column: {
451
+ classPropertyName: "column",
452
+ publicName: "column",
453
+ isSignal: true,
454
+ isRequired: true,
455
+ transformFunction: null
456
+ },
457
+ iconTemplate: {
458
+ classPropertyName: "iconTemplate",
459
+ publicName: "iconTemplate",
460
+ isSignal: true,
461
+ isRequired: false,
462
+ transformFunction: null
463
+ }
464
+ },
465
+ host: {
466
+ listeners: {
467
+ "mouseenter": "onMouseEnter()",
468
+ "mouseleave": "hovered.set(false)"
469
+ },
470
+ properties: {
471
+ "style.width": "column().width",
472
+ "style.min-width": "column().minWidth"
473
+ },
474
+ classAttribute: "rt-data-table-cell"
475
+ },
476
+ ngImport: i0,
477
+ template: "<ng-container rtBlock=\"rt-data-table-cell\">\n <ng-template #iconTpl>\n @if (iconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"iconContext()\" />\n } @else if (kitIcon(); as name) {\n <rt-icon size=\"lg\" [name]=\"name\" [fill]=\"icon()?.outlined !== true\" [style]=\"iconStyle()\" />\n } @else if (glyph(); as name) {\n <span rtElem=\"glyph\" aria-hidden=\"true\" qa-dataid=\"data-table-cell-glyph\" [rtMod]=\"glyphMods()\" [style]=\"iconStyle()\">\n {{ name }}\n </span>\n }\n </ng-template>\n\n @if (icon()?.placement === 'left') {\n <span rtElem=\"prefix\" qa-dataid=\"data-table-cell-prefix\"><ng-container [ngTemplateOutlet]=\"iconTpl\" /></span>\n }\n\n <div rtElem=\"title\" [rtMod]=\"titleMods()\">\n <div rtElem=\"text\" qa-dataid=\"data-table-cell-text\" [rtTooltip]=\"hint()\">{{ value() | emptyToDash }}</div>\n </div>\n\n @if (icon()?.placement === 'right') {\n <span rtElem=\"suffix\" qa-dataid=\"data-table-cell-suffix\"><ng-container [ngTemplateOutlet]=\"iconTpl\" /></span>\n }\n\n @if (copyable()) {\n <rt-icon-button\n rtElem=\"copy-button\"\n rtDataTableStopRowClick\n qa-dataid=\"data-table-cell-copy\"\n size=\"sm\"\n [rtMod]=\"copyMods()\"\n [icon]=\"copyIcon()\"\n [ariaLabel]=\"copyLabel()\"\n [tooltip]=\"narrow() ? '' : copyLabel()\"\n (clicked)=\"onCopy()\" />\n }\n</ng-container>\n",
478
+ styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-data-table-cell{--rt-data-table-cell-transition-duration: var(--rt-duration-fast);--rt-data-table-cell-glyph-size: var(--rt-size-6);position:relative;display:flex;width:100%;height:100%;align-items:center;gap:var(--rt-space-sm)}.rt-data-table-cell__glyph{display:inline-block;overflow:hidden;width:var(--rt-data-table-cell-glyph-size);font-family:Material Symbols Outlined,sans-serif;font-feature-settings:\"liga\";font-size:var(--rt-data-table-cell-glyph-size);font-style:normal;font-weight:var(--rt-font-weight-regular);letter-spacing:normal;line-height:1;text-transform:none;white-space:nowrap}.rt-data-table-cell__glyph--filled{font-variation-settings:\"FILL\" 1}.rt-data-table-cell__prefix,.rt-data-table-cell__suffix{display:inline-flex;min-width:fit-content;flex:0 0 auto}.rt-data-table-cell__title{display:table;width:100%;table-layout:fixed}.rt-data-table-cell__title--align--left{text-align:left}.rt-data-table-cell__title--align--center{text-align:center}.rt-data-table-cell__title--align--right{text-align:right}.rt-data-table-cell__text{overflow:hidden;width:100%;padding:var(--rt-space-sm) var(--rt-space-sm) var(--rt-space-sm) 0;text-overflow:ellipsis;white-space:nowrap}.rt-data-table-cell__copy-button{position:absolute;transition:visibility var(--rt-data-table-cell-transition-duration) linear;visibility:hidden}@media(hover:none){.rt-data-table-cell__copy-button{visibility:visible}}.rt-data-table-cell__copy-button{--rt-icon-button-color: var(--rt-list-copy-button-color)}.rt-data-table-cell__copy-button .rt-icon-button{--rt-icon-button-size-step: var(--rt-list-copy-button-size);--rt-icon-button-radius: var(--rt-list-copy-button-radius);--rt-icon-button-color-hover: var(--rt-color-text-primary);--rt-icon-button-color-bg-hover: var(--rt-list-copy-button-bg-hover);background-color:var(--rt-list-copy-button-bg)}.rt-data-table-cell__copy-button--position--left{left:var(--rt-space-xs)}.rt-data-table-cell__copy-button--position--right{right:var(--rt-space-xs)}.rt-data-table-cell__copy-button--complete{cursor:not-allowed}.rt-data-table-cell__copy-button--visible{visibility:visible}}\n"],
479
+ dependencies: [
480
+ {
481
+ kind: "component",
482
+ type: RtIconButtonComponent,
483
+ selector: "rt-icon-button",
484
+ inputs: [
485
+ "icon",
486
+ "glyph",
487
+ "ariaLabel",
488
+ "variant",
489
+ "iconColor",
490
+ "iconFill",
491
+ "size",
492
+ "iconSize",
493
+ "type",
494
+ "tooltip",
495
+ "tooltipHideOnClick",
496
+ "tabIndex",
497
+ "loading",
498
+ "disabled",
499
+ "active",
500
+ "expanded",
501
+ "indicator"
502
+ ],
503
+ outputs: ["clicked"]
504
+ },
505
+ {
506
+ kind: "component",
507
+ type: RtIconComponent,
508
+ selector: "rt-icon",
509
+ inputs: [
510
+ "name",
511
+ "glyph",
512
+ "glyphStrategy",
513
+ "size",
514
+ "color",
515
+ "fill",
516
+ "spin",
517
+ "rotate"
518
+ ]
519
+ },
520
+ {
521
+ kind: "directive",
522
+ type: BlockDirective,
523
+ selector: "[rtBlock]",
524
+ inputs: ["rtMod"]
525
+ },
526
+ {
527
+ kind: "directive",
528
+ type: ElemDirective,
529
+ selector: "[rtElem]",
530
+ inputs: ["rtMod"]
531
+ },
532
+ {
533
+ kind: "directive",
534
+ type: ModDirective,
535
+ selector: "[rtMod]"
536
+ },
537
+ {
538
+ kind: "directive",
539
+ type: NgTemplateOutlet,
540
+ selector: "[ngTemplateOutlet]",
541
+ inputs: [
542
+ "ngTemplateOutletContext",
543
+ "ngTemplateOutlet",
544
+ "ngTemplateOutletInjector"
545
+ ]
546
+ },
547
+ {
548
+ kind: "directive",
549
+ type: RtDataTableStopRowClickDirective,
550
+ selector: "[rtDataTableStopRowClick]"
551
+ },
552
+ {
553
+ kind: "directive",
554
+ type: RtTooltipDirective,
555
+ selector: "[rtTooltip]",
556
+ inputs: [
557
+ "rtTooltip",
558
+ "rtTooltipPlacement",
559
+ "rtTooltipWhenTruncated",
560
+ "rtTooltipHideOnClick"
561
+ ],
562
+ exportAs: ["rtTooltip"]
563
+ },
564
+ {
565
+ kind: "pipe",
566
+ type: EmptyToDashPipe,
567
+ name: "emptyToDash"
568
+ }
569
+ ],
570
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
571
+ encapsulation: i0.ViewEncapsulation.None
572
+ });
573
+ }
574
+ };
575
+ i0.ɵɵngDeclareClassMetadata({
576
+ minVersion: "12.0.0",
577
+ version: "22.2.2",
578
+ ngImport: i0,
579
+ type: RtDataTableCellComponent,
580
+ decorators: [{
581
+ type: Component,
582
+ args: [{
583
+ selector: "rt-data-table-cell",
584
+ changeDetection: ChangeDetectionStrategy.OnPush,
585
+ encapsulation: ViewEncapsulation.None,
586
+ imports: [
587
+ RtIconButtonComponent,
588
+ RtIconComponent,
589
+ BlockDirective,
590
+ ElemDirective,
591
+ ModDirective,
592
+ NgTemplateOutlet,
593
+ RtDataTableStopRowClickDirective,
594
+ RtTooltipDirective,
595
+ EmptyToDashPipe
596
+ ],
597
+ host: {
598
+ class: BEM_BLOCK$3,
599
+ "[style.width]": "column().width",
600
+ "[style.min-width]": "column().minWidth",
601
+ "(mouseenter)": "onMouseEnter()",
602
+ "(mouseleave)": "hovered.set(false)"
603
+ },
604
+ template: "<ng-container rtBlock=\"rt-data-table-cell\">\n <ng-template #iconTpl>\n @if (iconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"iconContext()\" />\n } @else if (kitIcon(); as name) {\n <rt-icon size=\"lg\" [name]=\"name\" [fill]=\"icon()?.outlined !== true\" [style]=\"iconStyle()\" />\n } @else if (glyph(); as name) {\n <span rtElem=\"glyph\" aria-hidden=\"true\" qa-dataid=\"data-table-cell-glyph\" [rtMod]=\"glyphMods()\" [style]=\"iconStyle()\">\n {{ name }}\n </span>\n }\n </ng-template>\n\n @if (icon()?.placement === 'left') {\n <span rtElem=\"prefix\" qa-dataid=\"data-table-cell-prefix\"><ng-container [ngTemplateOutlet]=\"iconTpl\" /></span>\n }\n\n <div rtElem=\"title\" [rtMod]=\"titleMods()\">\n <div rtElem=\"text\" qa-dataid=\"data-table-cell-text\" [rtTooltip]=\"hint()\">{{ value() | emptyToDash }}</div>\n </div>\n\n @if (icon()?.placement === 'right') {\n <span rtElem=\"suffix\" qa-dataid=\"data-table-cell-suffix\"><ng-container [ngTemplateOutlet]=\"iconTpl\" /></span>\n }\n\n @if (copyable()) {\n <rt-icon-button\n rtElem=\"copy-button\"\n rtDataTableStopRowClick\n qa-dataid=\"data-table-cell-copy\"\n size=\"sm\"\n [rtMod]=\"copyMods()\"\n [icon]=\"copyIcon()\"\n [ariaLabel]=\"copyLabel()\"\n [tooltip]=\"narrow() ? '' : copyLabel()\"\n (clicked)=\"onCopy()\" />\n }\n</ng-container>\n",
605
+ styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-data-table-cell{--rt-data-table-cell-transition-duration: var(--rt-duration-fast);--rt-data-table-cell-glyph-size: var(--rt-size-6);position:relative;display:flex;width:100%;height:100%;align-items:center;gap:var(--rt-space-sm)}.rt-data-table-cell__glyph{display:inline-block;overflow:hidden;width:var(--rt-data-table-cell-glyph-size);font-family:Material Symbols Outlined,sans-serif;font-feature-settings:\"liga\";font-size:var(--rt-data-table-cell-glyph-size);font-style:normal;font-weight:var(--rt-font-weight-regular);letter-spacing:normal;line-height:1;text-transform:none;white-space:nowrap}.rt-data-table-cell__glyph--filled{font-variation-settings:\"FILL\" 1}.rt-data-table-cell__prefix,.rt-data-table-cell__suffix{display:inline-flex;min-width:fit-content;flex:0 0 auto}.rt-data-table-cell__title{display:table;width:100%;table-layout:fixed}.rt-data-table-cell__title--align--left{text-align:left}.rt-data-table-cell__title--align--center{text-align:center}.rt-data-table-cell__title--align--right{text-align:right}.rt-data-table-cell__text{overflow:hidden;width:100%;padding:var(--rt-space-sm) var(--rt-space-sm) var(--rt-space-sm) 0;text-overflow:ellipsis;white-space:nowrap}.rt-data-table-cell__copy-button{position:absolute;transition:visibility var(--rt-data-table-cell-transition-duration) linear;visibility:hidden}@media(hover:none){.rt-data-table-cell__copy-button{visibility:visible}}.rt-data-table-cell__copy-button{--rt-icon-button-color: var(--rt-list-copy-button-color)}.rt-data-table-cell__copy-button .rt-icon-button{--rt-icon-button-size-step: var(--rt-list-copy-button-size);--rt-icon-button-radius: var(--rt-list-copy-button-radius);--rt-icon-button-color-hover: var(--rt-color-text-primary);--rt-icon-button-color-bg-hover: var(--rt-list-copy-button-bg-hover);background-color:var(--rt-list-copy-button-bg)}.rt-data-table-cell__copy-button--position--left{left:var(--rt-space-xs)}.rt-data-table-cell__copy-button--position--right{right:var(--rt-space-xs)}.rt-data-table-cell__copy-button--complete{cursor:not-allowed}.rt-data-table-cell__copy-button--visible{visibility:visible}}\n"]
606
+ }]
607
+ }],
608
+ ctorParameters: () => [],
609
+ propDecorators: {
610
+ row: [{
611
+ type: i0.Input,
612
+ args: [{
613
+ isSignal: true,
614
+ alias: "row",
615
+ required: true
616
+ }]
617
+ }],
618
+ column: [{
619
+ type: i0.Input,
620
+ args: [{
621
+ isSignal: true,
622
+ alias: "column",
623
+ required: true
624
+ }]
625
+ }],
626
+ iconTemplate: [{
627
+ type: i0.Input,
628
+ args: [{
629
+ isSignal: true,
630
+ alias: "iconTemplate",
631
+ required: false
632
+ }]
633
+ }]
634
+ }
635
+ });
467
636
  function dataTableNextSortOrder(current) {
468
- return current?.sortDirection?.toLowerCase() === EListSortOrder.ASC ? EListSortOrder.DESC : EListSortOrder.ASC;
637
+ return current?.sortDirection?.toLowerCase() === EListSortOrder.ASC ? EListSortOrder.DESC : EListSortOrder.ASC;
469
638
  }
470
- /** Порядок таблицы сейчас стоит по этой колонке. */
471
639
  function dataTableSortActive(sort, current) {
472
- return !!current?.propertyName && !!sort?.propertyName && current.propertyName === sort.propertyName;
640
+ return !!current?.propertyName && !!sort?.propertyName && current.propertyName === sort.propertyName;
473
641
  }
474
- /**
475
- * `aria-sort` сортируемой колонки: порядок по ней, если он стоит по ней, иначе `none`. Колонке
476
- * без сортировки атрибут не положен вовсе — `null` снимает его.
477
- */
478
642
  function dataTableAriaSort(sort, current) {
479
- if (!sort?.propertyName) {
480
- return null;
481
- }
482
- if (!dataTableSortActive(sort, current)) {
483
- return 'none';
484
- }
485
- const direction = current?.sortDirection?.toLowerCase();
486
- if (direction === EListSortOrder.ASC) {
487
- return 'ascending';
488
- }
489
- return direction === EListSortOrder.DESC ? 'descending' : 'none';
490
- }
491
-
492
- const BEM_BLOCK$2 = 'rt-data-table-header-cell';
493
- /**
494
- * Ячейка шапки `rt-data-table` — шапка первого кита без Material.
495
- *
496
- * Нажатие на шапку сортируемой колонки просит порядок: по возрастанию, затем по убыванию, и так
497
- * по кругу — снятия порядка нет. С клавиатуры то же делают Enter и пробел. Стрелки порядка видны
498
- * при наведении, при фокусе и у колонки, по которой порядок стоит. Значок шапки — набором кита по имени первого кита либо шаблоном приложения.
499
- */
500
- class RtDataTableHeaderCellComponent {
501
- constructor() {
502
- /** Шапка сортируемой колонки нажимается и с клавиатуры: у неё фокус и роль кнопки. */
503
- this.sortable = computed(() => !!this.sortModel()?.propertyName, /* @ts-ignore */
504
- ...(ngDevMode ? [{ debugName: "sortable" }] : /* istanbul ignore next */ []));
505
- this.active = computed(() => dataTableSortActive(this.sortModel(), this.currentSortModel()), /* @ts-ignore */
506
- ...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
507
- this.labelMods = computed(() => ({ align: this.headerModel().align }), /* @ts-ignore */
508
- ...(ngDevMode ? [{ debugName: "labelMods" }] : /* istanbul ignore next */ []));
509
- this.arrowsMods = computed(() => ({ active: this.active() }), /* @ts-ignore */
510
- ...(ngDevMode ? [{ debugName: "arrowsMods" }] : /* istanbul ignore next */ []));
511
- this.descMods = computed(() => ({
512
- active: this.active() && this.currentSortModel()?.sortDirection?.toLowerCase() === EListSortOrder.DESC,
513
- first: true,
514
- }), /* @ts-ignore */
515
- ...(ngDevMode ? [{ debugName: "descMods" }] : /* istanbul ignore next */ []));
516
- this.ascMods = computed(() => ({
517
- active: this.active() && this.currentSortModel()?.sortDirection?.toLowerCase() === EListSortOrder.ASC,
518
- second: true,
519
- }), /* @ts-ignore */
520
- ...(ngDevMode ? [{ debugName: "ascMods" }] : /* istanbul ignore next */ []));
521
- /** Значок шапки; его цвет и видимость, как в первом ките, ничего не меняют. */
522
- this.icon = computed(() => this.headerModel().icon ?? null, /* @ts-ignore */
523
- ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
524
- this.kitIcon = computed(() => {
525
- const icon = this.icon();
526
- return icon ? dataTableIconName(icon.glyph) : null;
527
- }, /* @ts-ignore */
528
- ...(ngDevMode ? [{ debugName: "kitIcon" }] : /* istanbul ignore next */ []));
529
- /** Имя без пары в перечне шапка рисует глифом Material Symbols — так же, как ячейка. */
530
- this.glyph = computed(() => {
531
- const icon = this.icon();
532
- return icon && !this.kitIcon() ? icon.glyph : null;
533
- }, /* @ts-ignore */
534
- ...(ngDevMode ? [{ debugName: "glyph" }] : /* istanbul ignore next */ []));
535
- /** Залитый глиф — как залитый значок набора: контурным его делает `outlined` колонки. */
536
- this.glyphMods = computed(() => ({ filled: this.icon()?.outlined !== true }), /* @ts-ignore */
537
- ...(ngDevMode ? [{ debugName: "glyphMods" }] : /* istanbul ignore next */ []));
538
- this.iconContext = computed(() => {
539
- const icon = this.icon();
540
- const column = this.column();
541
- return icon && column ? { column, $implicit: icon.glyph, row: null } : null;
542
- }, /* @ts-ignore */
543
- ...(ngDevMode ? [{ debugName: "iconContext" }] : /* istanbul ignore next */ []));
544
- this.headerModel = input.required(/* @ts-ignore */
545
- ...(ngDevMode ? [{ debugName: "headerModel" }] : /* istanbul ignore next */ []));
546
- this.sortModel = input.required(/* @ts-ignore */
547
- ...(ngDevMode ? [{ debugName: "sortModel" }] : /* istanbul ignore next */ []));
548
- this.currentSortModel = input.required(/* @ts-ignore */
549
- ...(ngDevMode ? [{ debugName: "currentSortModel" }] : /* istanbul ignore next */ []));
550
- /** Колонка шапки — её получает шаблон значка приложения. */
551
- this.column = input(null, /* @ts-ignore */
552
- ...(ngDevMode ? [{ debugName: "column" }] : /* istanbul ignore next */ []));
553
- /** Шаблон значка приложения; когда он дан, перечень кита не спрашивается. */
554
- this.iconTemplate = input(null, /* @ts-ignore */
555
- ...(ngDevMode ? [{ debugName: "iconTemplate" }] : /* istanbul ignore next */ []));
556
- this.sortChange = output();
557
- }
558
- /** Enter и пробел просят порядок так же, как нажатие; пробел иначе прокрутил бы страницу. */
559
- onKey(event) {
560
- if (this.sortable()) {
561
- event.preventDefault();
562
- this.onClick();
563
- }
564
- }
565
- onClick() {
566
- const propertyName = this.sortModel()?.propertyName;
567
- if (propertyName) {
568
- this.sortChange.emit({ propertyName, sortDirection: dataTableNextSortOrder(this.currentSortModel()) });
569
- }
570
- }
571
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDataTableHeaderCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
572
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: RtDataTableHeaderCellComponent, isStandalone: true, selector: "rt-data-table-header-cell", inputs: { headerModel: { classPropertyName: "headerModel", publicName: "headerModel", isSignal: true, isRequired: true, transformFunction: null }, sortModel: { classPropertyName: "sortModel", publicName: "sortModel", isSignal: true, isRequired: true, transformFunction: null }, currentSortModel: { classPropertyName: "currentSortModel", publicName: "currentSortModel", isSignal: true, isRequired: true, transformFunction: null }, column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: false, transformFunction: null }, iconTemplate: { classPropertyName: "iconTemplate", publicName: "iconTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sortChange: "sortChange" }, host: { listeners: { "click": "onClick()", "keydown.enter": "onKey($event)", "keydown.space": "onKey($event)" }, properties: { "style.text-align": "headerModel().align", "attr.tabindex": "sortable() ? 0 : null", "attr.role": "sortable() ? \"button\" : null" }, classAttribute: "rt-data-table-header-cell" }, ngImport: i0, template: "<ng-container rtBlock=\"rt-data-table-header-cell\">\n <ng-template #iconTpl>\n @if (iconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"iconContext()\" />\n } @else if (kitIcon(); as name) {\n <rt-icon size=\"lg\" [name]=\"name\" [fill]=\"icon()?.outlined !== true\" />\n } @else if (glyph(); as name) {\n <span rtElem=\"glyph\" aria-hidden=\"true\" qa-dataid=\"data-table-header-glyph\" [rtMod]=\"glyphMods()\">{{ name }}</span>\n }\n </ng-template>\n\n <div rtElem=\"label\" [rtMod]=\"labelMods()\">\n @if (icon()?.placement === 'left') {\n <span rtElem=\"prefix\" qa-dataid=\"data-table-header-prefix\"><ng-container [ngTemplateOutlet]=\"iconTpl\" /></span>\n }\n\n <div\n rtElem=\"text\"\n qa-dataid=\"data-table-header-text\"\n [class]=\"[headerModel().className] | concatClasses\"\n [rtTooltip]=\"headerModel().tooltip ?? ''\">\n {{ headerModel().label }}\n </div>\n\n @if (icon()?.placement === 'right') {\n <span rtElem=\"suffix\" qa-dataid=\"data-table-header-suffix\"><ng-container [ngTemplateOutlet]=\"iconTpl\" /></span>\n }\n </div>\n\n @if (sortModel()) {\n <div rtElem=\"arrows\" qa-dataid=\"data-table-header-sort\" [rtMod]=\"arrowsMods()\">\n <div rtElem=\"arrow\" [rtMod]=\"descMods()\"></div>\n <div rtElem=\"arrow\" [rtMod]=\"ascMods()\"></div>\n </div>\n }\n</ng-container>\n", styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-data-table-header-cell{--rt-data-table-header-cell-arrow-side: var(--rt-border-width-thick);--rt-data-table-header-cell-arrow-height: var(--rt-size-1);--rt-data-table-header-cell-focus-shadow: var(--rt-shadow-focus-ring);display:flex;align-items:center;justify-content:space-between;cursor:pointer}.rt-data-table-header-cell:hover .rt-data-table-header-cell__arrows,.rt-data-table-header-cell:focus-visible .rt-data-table-header-cell__arrows{visibility:visible}.rt-data-table-header-cell:focus-visible{box-shadow:var(--rt-data-table-header-cell-focus-shadow);outline:none}.rt-data-table-header-cell__label{display:flex;flex-grow:1;align-items:center;gap:var(--rt-space-sm)}.rt-data-table-header-cell__label--align--left{justify-content:flex-start}.rt-data-table-header-cell__label--align--center{justify-content:center}.rt-data-table-header-cell__label--align--right{justify-content:flex-end}.rt-data-table-header-cell__prefix,.rt-data-table-header-cell__suffix{display:inline-flex;min-width:fit-content}.rt-data-table-header-cell__glyph{display:inline-block;overflow:hidden;width:var(--rt-size-6);font-family:Material Symbols Outlined,sans-serif;font-feature-settings:\"liga\";font-size:var(--rt-size-6);font-style:normal;font-weight:var(--rt-font-weight-regular);letter-spacing:normal;line-height:1;text-transform:none;white-space:nowrap}.rt-data-table-header-cell__glyph--filled{font-variation-settings:\"FILL\" 1}.rt-data-table-header-cell__text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rt-data-table-header-cell__arrows{display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:var(--rt-space-md);visibility:hidden}.rt-data-table-header-cell__arrows--active{visibility:visible}.rt-data-table-header-cell__arrow{width:0;height:0;border-right:var(--rt-data-table-header-cell-arrow-side) solid transparent;border-bottom:var(--rt-data-table-header-cell-arrow-height) solid var(--rt-color-text-muted);border-left:var(--rt-data-table-header-cell-arrow-side) solid transparent}.rt-data-table-header-cell__arrow--second{margin-top:var(--rt-space-2xs);transform:scaleY(-1)}.rt-data-table-header-cell__arrow--active{border-bottom-color:var(--rt-color-text-primary)}}\n"], dependencies: [{ kind: "component", type:
573
- // components
574
- RtIconComponent, selector: "rt-icon", inputs: ["name", "glyph", "glyphStrategy", "size", "color", "fill", "spin", "rotate"] }, { kind: "directive", type:
575
- // directives
576
- BlockDirective, selector: "[rtBlock]", inputs: ["rtMod"] }, { kind: "directive", type: ElemDirective, selector: "[rtElem]", inputs: ["rtMod"] }, { kind: "directive", type: ModDirective, selector: "[rtMod]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: RtTooltipDirective, selector: "[rtTooltip]", inputs: ["rtTooltip", "rtTooltipPlacement", "rtTooltipWhenTruncated"], exportAs: ["rtTooltip"] }, { kind: "pipe", type:
577
- // pipes
578
- ConcatClassesPipe, name: "concatClasses" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
643
+ if (!sort?.propertyName) return null;
644
+ if (!dataTableSortActive(sort, current)) return "none";
645
+ const direction = current?.sortDirection?.toLowerCase();
646
+ if (direction === EListSortOrder.ASC) return "ascending";
647
+ return direction === EListSortOrder.DESC ? "descending" : "none";
579
648
  }
580
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDataTableHeaderCellComponent, decorators: [{
581
- type: Component,
582
- args: [{ selector: 'rt-data-table-header-cell', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
583
- // components
584
- RtIconComponent,
585
- // directives
586
- BlockDirective,
587
- ElemDirective,
588
- ModDirective,
589
- NgTemplateOutlet,
590
- RtTooltipDirective,
591
- // pipes
592
- ConcatClassesPipe,
593
- ], host: {
594
- class: BEM_BLOCK$2,
595
- '[style.text-align]': 'headerModel().align',
596
- '[attr.tabindex]': 'sortable() ? 0 : null',
597
- '[attr.role]': 'sortable() ? "button" : null',
598
- '(click)': 'onClick()',
599
- '(keydown.enter)': 'onKey($event)',
600
- '(keydown.space)': 'onKey($event)',
601
- }, template: "<ng-container rtBlock=\"rt-data-table-header-cell\">\n <ng-template #iconTpl>\n @if (iconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"iconContext()\" />\n } @else if (kitIcon(); as name) {\n <rt-icon size=\"lg\" [name]=\"name\" [fill]=\"icon()?.outlined !== true\" />\n } @else if (glyph(); as name) {\n <span rtElem=\"glyph\" aria-hidden=\"true\" qa-dataid=\"data-table-header-glyph\" [rtMod]=\"glyphMods()\">{{ name }}</span>\n }\n </ng-template>\n\n <div rtElem=\"label\" [rtMod]=\"labelMods()\">\n @if (icon()?.placement === 'left') {\n <span rtElem=\"prefix\" qa-dataid=\"data-table-header-prefix\"><ng-container [ngTemplateOutlet]=\"iconTpl\" /></span>\n }\n\n <div\n rtElem=\"text\"\n qa-dataid=\"data-table-header-text\"\n [class]=\"[headerModel().className] | concatClasses\"\n [rtTooltip]=\"headerModel().tooltip ?? ''\">\n {{ headerModel().label }}\n </div>\n\n @if (icon()?.placement === 'right') {\n <span rtElem=\"suffix\" qa-dataid=\"data-table-header-suffix\"><ng-container [ngTemplateOutlet]=\"iconTpl\" /></span>\n }\n </div>\n\n @if (sortModel()) {\n <div rtElem=\"arrows\" qa-dataid=\"data-table-header-sort\" [rtMod]=\"arrowsMods()\">\n <div rtElem=\"arrow\" [rtMod]=\"descMods()\"></div>\n <div rtElem=\"arrow\" [rtMod]=\"ascMods()\"></div>\n </div>\n }\n</ng-container>\n", styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-data-table-header-cell{--rt-data-table-header-cell-arrow-side: var(--rt-border-width-thick);--rt-data-table-header-cell-arrow-height: var(--rt-size-1);--rt-data-table-header-cell-focus-shadow: var(--rt-shadow-focus-ring);display:flex;align-items:center;justify-content:space-between;cursor:pointer}.rt-data-table-header-cell:hover .rt-data-table-header-cell__arrows,.rt-data-table-header-cell:focus-visible .rt-data-table-header-cell__arrows{visibility:visible}.rt-data-table-header-cell:focus-visible{box-shadow:var(--rt-data-table-header-cell-focus-shadow);outline:none}.rt-data-table-header-cell__label{display:flex;flex-grow:1;align-items:center;gap:var(--rt-space-sm)}.rt-data-table-header-cell__label--align--left{justify-content:flex-start}.rt-data-table-header-cell__label--align--center{justify-content:center}.rt-data-table-header-cell__label--align--right{justify-content:flex-end}.rt-data-table-header-cell__prefix,.rt-data-table-header-cell__suffix{display:inline-flex;min-width:fit-content}.rt-data-table-header-cell__glyph{display:inline-block;overflow:hidden;width:var(--rt-size-6);font-family:Material Symbols Outlined,sans-serif;font-feature-settings:\"liga\";font-size:var(--rt-size-6);font-style:normal;font-weight:var(--rt-font-weight-regular);letter-spacing:normal;line-height:1;text-transform:none;white-space:nowrap}.rt-data-table-header-cell__glyph--filled{font-variation-settings:\"FILL\" 1}.rt-data-table-header-cell__text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rt-data-table-header-cell__arrows{display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:var(--rt-space-md);visibility:hidden}.rt-data-table-header-cell__arrows--active{visibility:visible}.rt-data-table-header-cell__arrow{width:0;height:0;border-right:var(--rt-data-table-header-cell-arrow-side) solid transparent;border-bottom:var(--rt-data-table-header-cell-arrow-height) solid var(--rt-color-text-muted);border-left:var(--rt-data-table-header-cell-arrow-side) solid transparent}.rt-data-table-header-cell__arrow--second{margin-top:var(--rt-space-2xs);transform:scaleY(-1)}.rt-data-table-header-cell__arrow--active{border-bottom-color:var(--rt-color-text-primary)}}\n"] }]
602
- }], propDecorators: { headerModel: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerModel", required: true }] }], sortModel: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortModel", required: true }] }], currentSortModel: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentSortModel", required: true }] }], column: [{ type: i0.Input, args: [{ isSignal: true, alias: "column", required: false }] }], iconTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconTemplate", required: false }] }], sortChange: [{ type: i0.Output, args: ["sortChange"] }] } });
603
-
604
- /**
605
- * Значок вида сравнения — имя первого кита; набор кита рисует его по перечню соответствий.
606
- * «Начинается с» и «заканчивается на» первый кит объявлял, но значка и пункта меню им не давал.
607
- */
649
+ const BEM_BLOCK$2 = "rt-data-table-header-cell";
650
+ var RtDataTableHeaderCellComponent = class RtDataTableHeaderCellComponent {
651
+ constructor() {
652
+ this.sortable = computed(() => !!this.sortModel()?.propertyName, ...ngDevMode ? [{ debugName: "sortable" }] : /* istanbul ignore next */ []);
653
+ this.active = computed(() => dataTableSortActive(this.sortModel(), this.currentSortModel()), ...ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []);
654
+ this.labelMods = computed(() => ({ align: this.headerModel().align }), ...ngDevMode ? [{ debugName: "labelMods" }] : /* istanbul ignore next */ []);
655
+ this.arrowsMods = computed(() => ({ active: this.active() }), ...ngDevMode ? [{ debugName: "arrowsMods" }] : /* istanbul ignore next */ []);
656
+ this.descMods = computed(() => ({
657
+ active: this.active() && this.currentSortModel()?.sortDirection?.toLowerCase() === EListSortOrder.DESC,
658
+ first: true
659
+ }), ...ngDevMode ? [{ debugName: "descMods" }] : /* istanbul ignore next */ []);
660
+ this.ascMods = computed(() => ({
661
+ active: this.active() && this.currentSortModel()?.sortDirection?.toLowerCase() === EListSortOrder.ASC,
662
+ second: true
663
+ }), ...ngDevMode ? [{ debugName: "ascMods" }] : /* istanbul ignore next */ []);
664
+ this.icon = computed(() => this.headerModel().icon ?? null, ...ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []);
665
+ this.kitIcon = computed(() => {
666
+ const icon = this.icon();
667
+ return icon ? dataTableIconName(icon.glyph) : null;
668
+ }, ...ngDevMode ? [{ debugName: "kitIcon" }] : /* istanbul ignore next */ []);
669
+ this.glyph = computed(() => {
670
+ const icon = this.icon();
671
+ return icon && !this.kitIcon() ? icon.glyph : null;
672
+ }, ...ngDevMode ? [{ debugName: "glyph" }] : /* istanbul ignore next */ []);
673
+ this.glyphMods = computed(() => ({ filled: this.icon()?.outlined !== true }), ...ngDevMode ? [{ debugName: "glyphMods" }] : /* istanbul ignore next */ []);
674
+ this.iconContext = computed(() => {
675
+ const icon = this.icon();
676
+ const column = this.column();
677
+ return icon && column ? {
678
+ column,
679
+ $implicit: icon.glyph,
680
+ row: null
681
+ } : null;
682
+ }, ...ngDevMode ? [{ debugName: "iconContext" }] : /* istanbul ignore next */ []);
683
+ this.headerModel = input.required(...ngDevMode ? [{ debugName: "headerModel" }] : /* istanbul ignore next */ []);
684
+ this.sortModel = input.required(...ngDevMode ? [{ debugName: "sortModel" }] : /* istanbul ignore next */ []);
685
+ this.currentSortModel = input.required(...ngDevMode ? [{ debugName: "currentSortModel" }] : /* istanbul ignore next */ []);
686
+ this.column = input(null, ...ngDevMode ? [{ debugName: "column" }] : /* istanbul ignore next */ []);
687
+ this.iconTemplate = input(null, ...ngDevMode ? [{ debugName: "iconTemplate" }] : /* istanbul ignore next */ []);
688
+ this.sortChange = output();
689
+ }
690
+ onKey(event) {
691
+ if (this.sortable()) {
692
+ event.preventDefault();
693
+ this.onClick();
694
+ }
695
+ }
696
+ onClick() {
697
+ const propertyName = this.sortModel()?.propertyName;
698
+ if (propertyName) this.sortChange.emit({
699
+ propertyName,
700
+ sortDirection: dataTableNextSortOrder(this.currentSortModel())
701
+ });
702
+ }
703
+ static {
704
+ this.ɵfac = i0.ɵɵngDeclareFactory({
705
+ minVersion: "12.0.0",
706
+ version: "22.2.2",
707
+ ngImport: i0,
708
+ type: RtDataTableHeaderCellComponent,
709
+ deps: [],
710
+ target: i0.ɵɵFactoryTarget.Component
711
+ });
712
+ }
713
+ static {
714
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
715
+ minVersion: "17.0.0",
716
+ version: "22.2.2",
717
+ type: RtDataTableHeaderCellComponent,
718
+ isStandalone: true,
719
+ selector: "rt-data-table-header-cell",
720
+ inputs: {
721
+ headerModel: {
722
+ classPropertyName: "headerModel",
723
+ publicName: "headerModel",
724
+ isSignal: true,
725
+ isRequired: true,
726
+ transformFunction: null
727
+ },
728
+ sortModel: {
729
+ classPropertyName: "sortModel",
730
+ publicName: "sortModel",
731
+ isSignal: true,
732
+ isRequired: true,
733
+ transformFunction: null
734
+ },
735
+ currentSortModel: {
736
+ classPropertyName: "currentSortModel",
737
+ publicName: "currentSortModel",
738
+ isSignal: true,
739
+ isRequired: true,
740
+ transformFunction: null
741
+ },
742
+ column: {
743
+ classPropertyName: "column",
744
+ publicName: "column",
745
+ isSignal: true,
746
+ isRequired: false,
747
+ transformFunction: null
748
+ },
749
+ iconTemplate: {
750
+ classPropertyName: "iconTemplate",
751
+ publicName: "iconTemplate",
752
+ isSignal: true,
753
+ isRequired: false,
754
+ transformFunction: null
755
+ }
756
+ },
757
+ outputs: { sortChange: "sortChange" },
758
+ host: {
759
+ listeners: {
760
+ "click": "onClick()",
761
+ "keydown.enter": "onKey($event)",
762
+ "keydown.space": "onKey($event)"
763
+ },
764
+ properties: {
765
+ "style.text-align": "headerModel().align",
766
+ "attr.tabindex": "sortable() ? 0 : null",
767
+ "attr.role": "sortable() ? \"button\" : null"
768
+ },
769
+ classAttribute: "rt-data-table-header-cell"
770
+ },
771
+ ngImport: i0,
772
+ template: "<ng-container rtBlock=\"rt-data-table-header-cell\">\n <ng-template #iconTpl>\n @if (iconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"iconContext()\" />\n } @else if (kitIcon(); as name) {\n <rt-icon size=\"lg\" [name]=\"name\" [fill]=\"icon()?.outlined !== true\" />\n } @else if (glyph(); as name) {\n <span rtElem=\"glyph\" aria-hidden=\"true\" qa-dataid=\"data-table-header-glyph\" [rtMod]=\"glyphMods()\">{{ name }}</span>\n }\n </ng-template>\n\n <div rtElem=\"label\" [rtMod]=\"labelMods()\">\n @if (icon()?.placement === 'left') {\n <span rtElem=\"prefix\" qa-dataid=\"data-table-header-prefix\"><ng-container [ngTemplateOutlet]=\"iconTpl\" /></span>\n }\n\n <div\n rtElem=\"text\"\n qa-dataid=\"data-table-header-text\"\n [class]=\"[headerModel().className] | concatClasses\"\n [rtTooltip]=\"headerModel().tooltip ?? ''\">\n {{ headerModel().label }}\n </div>\n\n @if (icon()?.placement === 'right') {\n <span rtElem=\"suffix\" qa-dataid=\"data-table-header-suffix\"><ng-container [ngTemplateOutlet]=\"iconTpl\" /></span>\n }\n </div>\n\n @if (sortModel()) {\n <div rtElem=\"arrows\" qa-dataid=\"data-table-header-sort\" [rtMod]=\"arrowsMods()\">\n <div rtElem=\"arrow\" [rtMod]=\"descMods()\"></div>\n <div rtElem=\"arrow\" [rtMod]=\"ascMods()\"></div>\n </div>\n }\n</ng-container>\n",
773
+ styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-data-table-header-cell{--rt-data-table-header-cell-arrow-side: var(--rt-border-width-thick);--rt-data-table-header-cell-arrow-height: var(--rt-size-1);--rt-data-table-header-cell-focus-shadow: var(--rt-shadow-focus-ring);display:flex;align-items:center;justify-content:space-between;cursor:pointer}.rt-data-table-header-cell:hover .rt-data-table-header-cell__arrows,.rt-data-table-header-cell:focus-visible .rt-data-table-header-cell__arrows{visibility:visible}.rt-data-table-header-cell:focus-visible{box-shadow:var(--rt-data-table-header-cell-focus-shadow);outline:none}.rt-data-table-header-cell__label{display:flex;flex-grow:1;align-items:center;gap:var(--rt-space-sm)}.rt-data-table-header-cell__label--align--left{justify-content:flex-start}.rt-data-table-header-cell__label--align--center{justify-content:center}.rt-data-table-header-cell__label--align--right{justify-content:flex-end}.rt-data-table-header-cell__prefix,.rt-data-table-header-cell__suffix{display:inline-flex;min-width:fit-content}.rt-data-table-header-cell__glyph{display:inline-block;overflow:hidden;width:var(--rt-size-6);font-family:Material Symbols Outlined,sans-serif;font-feature-settings:\"liga\";font-size:var(--rt-size-6);font-style:normal;font-weight:var(--rt-font-weight-regular);letter-spacing:normal;line-height:1;text-transform:none;white-space:nowrap}.rt-data-table-header-cell__glyph--filled{font-variation-settings:\"FILL\" 1}.rt-data-table-header-cell__text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rt-data-table-header-cell__arrows{display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:var(--rt-space-md);visibility:hidden}.rt-data-table-header-cell__arrows--active{visibility:visible}.rt-data-table-header-cell__arrow{width:0;height:0;border-right:var(--rt-data-table-header-cell-arrow-side) solid transparent;border-bottom:var(--rt-data-table-header-cell-arrow-height) solid var(--rt-color-text-muted);border-left:var(--rt-data-table-header-cell-arrow-side) solid transparent}.rt-data-table-header-cell__arrow--second{margin-top:var(--rt-space-2xs);transform:scaleY(-1)}.rt-data-table-header-cell__arrow--active{border-bottom-color:var(--rt-color-text-primary)}}\n"],
774
+ dependencies: [
775
+ {
776
+ kind: "component",
777
+ type: RtIconComponent,
778
+ selector: "rt-icon",
779
+ inputs: [
780
+ "name",
781
+ "glyph",
782
+ "glyphStrategy",
783
+ "size",
784
+ "color",
785
+ "fill",
786
+ "spin",
787
+ "rotate"
788
+ ]
789
+ },
790
+ {
791
+ kind: "directive",
792
+ type: BlockDirective,
793
+ selector: "[rtBlock]",
794
+ inputs: ["rtMod"]
795
+ },
796
+ {
797
+ kind: "directive",
798
+ type: ElemDirective,
799
+ selector: "[rtElem]",
800
+ inputs: ["rtMod"]
801
+ },
802
+ {
803
+ kind: "directive",
804
+ type: ModDirective,
805
+ selector: "[rtMod]"
806
+ },
807
+ {
808
+ kind: "directive",
809
+ type: NgTemplateOutlet,
810
+ selector: "[ngTemplateOutlet]",
811
+ inputs: [
812
+ "ngTemplateOutletContext",
813
+ "ngTemplateOutlet",
814
+ "ngTemplateOutletInjector"
815
+ ]
816
+ },
817
+ {
818
+ kind: "directive",
819
+ type: RtTooltipDirective,
820
+ selector: "[rtTooltip]",
821
+ inputs: [
822
+ "rtTooltip",
823
+ "rtTooltipPlacement",
824
+ "rtTooltipWhenTruncated",
825
+ "rtTooltipHideOnClick"
826
+ ],
827
+ exportAs: ["rtTooltip"]
828
+ },
829
+ {
830
+ kind: "pipe",
831
+ type: ConcatClassesPipe,
832
+ name: "concatClasses"
833
+ }
834
+ ],
835
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
836
+ encapsulation: i0.ViewEncapsulation.None
837
+ });
838
+ }
839
+ };
840
+ i0.ɵɵngDeclareClassMetadata({
841
+ minVersion: "12.0.0",
842
+ version: "22.2.2",
843
+ ngImport: i0,
844
+ type: RtDataTableHeaderCellComponent,
845
+ decorators: [{
846
+ type: Component,
847
+ args: [{
848
+ selector: "rt-data-table-header-cell",
849
+ changeDetection: ChangeDetectionStrategy.OnPush,
850
+ encapsulation: ViewEncapsulation.None,
851
+ imports: [
852
+ RtIconComponent,
853
+ BlockDirective,
854
+ ElemDirective,
855
+ ModDirective,
856
+ NgTemplateOutlet,
857
+ RtTooltipDirective,
858
+ ConcatClassesPipe
859
+ ],
860
+ host: {
861
+ class: BEM_BLOCK$2,
862
+ "[style.text-align]": "headerModel().align",
863
+ "[attr.tabindex]": "sortable() ? 0 : null",
864
+ "[attr.role]": "sortable() ? \"button\" : null",
865
+ "(click)": "onClick()",
866
+ "(keydown.enter)": "onKey($event)",
867
+ "(keydown.space)": "onKey($event)"
868
+ },
869
+ template: "<ng-container rtBlock=\"rt-data-table-header-cell\">\n <ng-template #iconTpl>\n @if (iconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"iconContext()\" />\n } @else if (kitIcon(); as name) {\n <rt-icon size=\"lg\" [name]=\"name\" [fill]=\"icon()?.outlined !== true\" />\n } @else if (glyph(); as name) {\n <span rtElem=\"glyph\" aria-hidden=\"true\" qa-dataid=\"data-table-header-glyph\" [rtMod]=\"glyphMods()\">{{ name }}</span>\n }\n </ng-template>\n\n <div rtElem=\"label\" [rtMod]=\"labelMods()\">\n @if (icon()?.placement === 'left') {\n <span rtElem=\"prefix\" qa-dataid=\"data-table-header-prefix\"><ng-container [ngTemplateOutlet]=\"iconTpl\" /></span>\n }\n\n <div\n rtElem=\"text\"\n qa-dataid=\"data-table-header-text\"\n [class]=\"[headerModel().className] | concatClasses\"\n [rtTooltip]=\"headerModel().tooltip ?? ''\">\n {{ headerModel().label }}\n </div>\n\n @if (icon()?.placement === 'right') {\n <span rtElem=\"suffix\" qa-dataid=\"data-table-header-suffix\"><ng-container [ngTemplateOutlet]=\"iconTpl\" /></span>\n }\n </div>\n\n @if (sortModel()) {\n <div rtElem=\"arrows\" qa-dataid=\"data-table-header-sort\" [rtMod]=\"arrowsMods()\">\n <div rtElem=\"arrow\" [rtMod]=\"descMods()\"></div>\n <div rtElem=\"arrow\" [rtMod]=\"ascMods()\"></div>\n </div>\n }\n</ng-container>\n",
870
+ styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-data-table-header-cell{--rt-data-table-header-cell-arrow-side: var(--rt-border-width-thick);--rt-data-table-header-cell-arrow-height: var(--rt-size-1);--rt-data-table-header-cell-focus-shadow: var(--rt-shadow-focus-ring);display:flex;align-items:center;justify-content:space-between;cursor:pointer}.rt-data-table-header-cell:hover .rt-data-table-header-cell__arrows,.rt-data-table-header-cell:focus-visible .rt-data-table-header-cell__arrows{visibility:visible}.rt-data-table-header-cell:focus-visible{box-shadow:var(--rt-data-table-header-cell-focus-shadow);outline:none}.rt-data-table-header-cell__label{display:flex;flex-grow:1;align-items:center;gap:var(--rt-space-sm)}.rt-data-table-header-cell__label--align--left{justify-content:flex-start}.rt-data-table-header-cell__label--align--center{justify-content:center}.rt-data-table-header-cell__label--align--right{justify-content:flex-end}.rt-data-table-header-cell__prefix,.rt-data-table-header-cell__suffix{display:inline-flex;min-width:fit-content}.rt-data-table-header-cell__glyph{display:inline-block;overflow:hidden;width:var(--rt-size-6);font-family:Material Symbols Outlined,sans-serif;font-feature-settings:\"liga\";font-size:var(--rt-size-6);font-style:normal;font-weight:var(--rt-font-weight-regular);letter-spacing:normal;line-height:1;text-transform:none;white-space:nowrap}.rt-data-table-header-cell__glyph--filled{font-variation-settings:\"FILL\" 1}.rt-data-table-header-cell__text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rt-data-table-header-cell__arrows{display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:var(--rt-space-md);visibility:hidden}.rt-data-table-header-cell__arrows--active{visibility:visible}.rt-data-table-header-cell__arrow{width:0;height:0;border-right:var(--rt-data-table-header-cell-arrow-side) solid transparent;border-bottom:var(--rt-data-table-header-cell-arrow-height) solid var(--rt-color-text-muted);border-left:var(--rt-data-table-header-cell-arrow-side) solid transparent}.rt-data-table-header-cell__arrow--second{margin-top:var(--rt-space-2xs);transform:scaleY(-1)}.rt-data-table-header-cell__arrow--active{border-bottom-color:var(--rt-color-text-primary)}}\n"]
871
+ }]
872
+ }],
873
+ propDecorators: {
874
+ headerModel: [{
875
+ type: i0.Input,
876
+ args: [{
877
+ isSignal: true,
878
+ alias: "headerModel",
879
+ required: true
880
+ }]
881
+ }],
882
+ sortModel: [{
883
+ type: i0.Input,
884
+ args: [{
885
+ isSignal: true,
886
+ alias: "sortModel",
887
+ required: true
888
+ }]
889
+ }],
890
+ currentSortModel: [{
891
+ type: i0.Input,
892
+ args: [{
893
+ isSignal: true,
894
+ alias: "currentSortModel",
895
+ required: true
896
+ }]
897
+ }],
898
+ column: [{
899
+ type: i0.Input,
900
+ args: [{
901
+ isSignal: true,
902
+ alias: "column",
903
+ required: false
904
+ }]
905
+ }],
906
+ iconTemplate: [{
907
+ type: i0.Input,
908
+ args: [{
909
+ isSignal: true,
910
+ alias: "iconTemplate",
911
+ required: false
912
+ }]
913
+ }],
914
+ sortChange: [{
915
+ type: i0.Output,
916
+ args: ["sortChange"]
917
+ }]
918
+ }
919
+ });
608
920
  const DATA_TABLE_FILTER_OPERATOR_GLYPHS = {
609
- [EFilterOperatorType.EQUALS]: 'drag_handle',
610
- [EFilterOperatorType.NOT_EQUALS]: 'block',
611
- [EFilterOperatorType.STARTS_WITH]: null,
612
- [EFilterOperatorType.ENDS_WITH]: null,
613
- [EFilterOperatorType.CONTAINS]: 'more_horiz',
614
- [EFilterOperatorType.GREATER_THAN]: 'chevron_right',
615
- [EFilterOperatorType.LESS_THAN]: 'chevron_left',
921
+ [EFilterOperatorType.EQUALS]: "drag_handle",
922
+ [EFilterOperatorType.NOT_EQUALS]: "block",
923
+ [EFilterOperatorType.STARTS_WITH]: null,
924
+ [EFilterOperatorType.ENDS_WITH]: null,
925
+ [EFilterOperatorType.CONTAINS]: "more_horiz",
926
+ [EFilterOperatorType.GREATER_THAN]: "chevron_right",
927
+ [EFilterOperatorType.LESS_THAN]: "chevron_left"
616
928
  };
617
- /** Пункты меню видов сравнения в порядке первого кита. */
618
929
  const DATA_TABLE_FILTER_MENU_OPERATORS = [
619
- EFilterOperatorType.EQUALS,
620
- EFilterOperatorType.NOT_EQUALS,
621
- EFilterOperatorType.CONTAINS,
622
- EFilterOperatorType.GREATER_THAN,
623
- EFilterOperatorType.LESS_THAN,
930
+ EFilterOperatorType.EQUALS,
931
+ EFilterOperatorType.NOT_EQUALS,
932
+ EFilterOperatorType.CONTAINS,
933
+ EFilterOperatorType.GREATER_THAN,
934
+ EFilterOperatorType.LESS_THAN
624
935
  ];
625
- /** Вид сравнения колонки по умолчанию: незнакомое и пустое значение дают «равно». */
626
936
  function dataTableDefaultOperator(operator) {
627
- return operator && FILTER_OPERATORS.includes(operator) ? operator : EFilterOperatorType.EQUALS;
937
+ return operator && FILTER_OPERATORS.includes(operator) ? operator : EFilterOperatorType.EQUALS;
628
938
  }
629
- /** Условие колонки из набора приложения, а без него — пустое условие с видом по умолчанию. */
630
939
  function dataTableColumnFilter(filters, propertyName, defaultOperator) {
631
- return (filters.find((filter) => filter.propertyName === propertyName) ?? {
632
- propertyName,
633
- operatorType: defaultOperator,
634
- value: '',
635
- });
940
+ return filters.find((filter) => filter.propertyName === propertyName) ?? {
941
+ propertyName,
942
+ operatorType: defaultOperator,
943
+ value: ""
944
+ };
636
945
  }
637
- /**
638
- * Набор условий после смены значения колонки; `null` — приложению сообщать нечего.
639
- * Пустое значение снимает условие колонки, значение на колонке без условия добавляет его.
640
- */
641
946
  function dataTableFiltersWithValue(filters, current, value) {
642
- const hasCondition = filters.some((filter) => filter.propertyName === current.propertyName);
643
- if (hasCondition) {
644
- return value
645
- ? filters.map((filter) => (filter.propertyName === current.propertyName ? { ...filter, value } : filter))
646
- : filters.filter((filter) => filter.propertyName !== current.propertyName);
647
- }
648
- return value ? [...filters, { propertyName: current.propertyName, operatorType: current.operatorType, value }] : null;
947
+ if (filters.some((filter) => filter.propertyName === current.propertyName)) return value ? filters.map((filter) => filter.propertyName === current.propertyName ? {
948
+ ...filter,
949
+ value
950
+ } : filter) : filters.filter((filter) => filter.propertyName !== current.propertyName);
951
+ return value ? [...filters, {
952
+ propertyName: current.propertyName,
953
+ operatorType: current.operatorType,
954
+ value
955
+ }] : null;
649
956
  }
650
- /** Набор условий после смены вида сравнения; `null` — ни условия, ни значения, спрашивать нечего. */
651
957
  function dataTableFiltersWithOperator(filters, current, operatorType) {
652
- const hasCondition = filters.some((filter) => filter.propertyName === current.propertyName);
653
- if (hasCondition) {
654
- return filters.map((filter) => filter.propertyName === current.propertyName ? { ...filter, operatorType } : filter);
655
- }
656
- return current.value ? [...filters, { operatorType, propertyName: current.propertyName, value: current.value }] : null;
958
+ if (filters.some((filter) => filter.propertyName === current.propertyName)) return filters.map((filter) => filter.propertyName === current.propertyName ? {
959
+ ...filter,
960
+ operatorType
961
+ } : filter);
962
+ return current.value ? [...filters, {
963
+ operatorType,
964
+ propertyName: current.propertyName,
965
+ value: current.value
966
+ }] : null;
657
967
  }
658
- /**
659
- * День поля даты кита (`2025-01-01`) — в момент ISO, как отдавал первый кит: полночь дня по
660
- * местному времени. Пустая строка остаётся пустой — она снимает условие.
661
- */
662
968
  function dataTableDayToIso(day) {
663
- const [year, month, date] = day.split('-').map(Number);
664
- const complete = [year, month, date].every((part) => !!part);
665
- return complete ? new Date(year, month - 1, date).toISOString() : '';
969
+ const [year, month, date] = day.split("-").map(Number);
970
+ return [
971
+ year,
972
+ month,
973
+ date
974
+ ].every((part) => !!part) ? new Date(year, month - 1, date).toISOString() : "";
666
975
  }
667
- /** Обратно: момент условия — в день поля даты по местному времени; нераспознанное даёт пустое. */
668
976
  function dataTableIsoToDay(value) {
669
- const moment = new Date(typeof value === 'string' ? value : '');
670
- if (Number.isNaN(moment.getTime())) {
671
- return '';
672
- }
673
- const month = String(moment.getMonth() + 1).padStart(2, '0');
674
- const date = String(moment.getDate()).padStart(2, '0');
675
- return `${moment.getFullYear()}-${month}-${date}`;
977
+ const moment = new Date(typeof value === "string" ? value : "");
978
+ if (Number.isNaN(moment.getTime())) return "";
979
+ const month = String(moment.getMonth() + 1).padStart(2, "0");
980
+ const date = String(moment.getDate()).padStart(2, "0");
981
+ return `${moment.getFullYear()}-${month}-${date}`;
676
982
  }
677
-
678
- const BEM_BLOCK$1 = 'rt-data-table-filter-cell';
679
- /** Значок кнопки вида сравнения, которому первый кит значка не дал. */
680
- const FALLBACK_OPERATOR_ICON = 'ellipsis-h';
983
+ const BEM_BLOCK$1 = "rt-data-table-filter-cell";
984
+ const FALLBACK_OPERATOR_ICON = "ellipsis-h";
681
985
  const OPERATOR_LABELS = {
682
- [EFilterOperatorType.EQUALS]: 'dataTableFilterOperatorEquals',
683
- [EFilterOperatorType.NOT_EQUALS]: 'dataTableFilterOperatorNotEquals',
684
- [EFilterOperatorType.CONTAINS]: 'dataTableFilterOperatorContains',
685
- [EFilterOperatorType.GREATER_THAN]: 'dataTableFilterOperatorGreaterThan',
686
- [EFilterOperatorType.LESS_THAN]: 'dataTableFilterOperatorLessThan',
986
+ [EFilterOperatorType.EQUALS]: "dataTableFilterOperatorEquals",
987
+ [EFilterOperatorType.NOT_EQUALS]: "dataTableFilterOperatorNotEquals",
988
+ [EFilterOperatorType.CONTAINS]: "dataTableFilterOperatorContains",
989
+ [EFilterOperatorType.GREATER_THAN]: "dataTableFilterOperatorGreaterThan",
990
+ [EFilterOperatorType.LESS_THAN]: "dataTableFilterOperatorLessThan"
687
991
  };
688
- /** Одно и то же условие: колонка, вид сравнения и значение совпадают. */
689
992
  function sameFilter(a, b) {
690
- return a.propertyName === b.propertyName && a.operatorType === b.operatorType && a.value === b.value;
691
- }
692
- /**
693
- * Ячейка строки отбора `rt-data-table` — ячейка отбора первого кита на полях кита.
694
- *
695
- * Своих условий у ячейки нет: она читает набор приложения и отдаёт ему новый при каждой смене.
696
- * Текст и число фиксируются по Enter и уходу с поля, дата — выбором дня, список — выбором пункта;
697
- * пустое значение снимает условие колонки. Кнопка вида сравнения предлагает остальные виды.
698
- */
699
- class RtDataTableFilterCellComponent {
700
- constructor() {
701
- this.#translate = inject(RT_KIT_TRANSLATOR);
702
- this.#host = inject(ElementRef);
703
- this.#titleCase = new TitleCasePipe();
704
- /** Набранное, но ещё не зафиксированное значение текстового и числового поля. */
705
- this.#draft = null;
706
- this.filterTypes = ERtDataTableFilterType;
707
- this.valuePlaceholder = rtKitLabel('dataTableFilterValuePlaceholder');
708
- this.selectPlaceholder = rtKitLabel('dataTableFilterSelectPlaceholder');
709
- this.clearLabel = rtKitLabel('dataTableFilterClear');
710
- /**
711
- * Условие своей колонки из набора приложения. Сверяется по содержимому: набор меняется целиком
712
- * и по чужой колонке, а своё условие при этом остаётся тем же — и выбранный здесь вид
713
- * сравнения пустой колонки сбрасывать нечем.
714
- */
715
- this.#ownFilter = computed(() => dataTableColumnFilter(this.filterModel(), this.filterProperty(), dataTableDefaultOperator(this.defaultFilterOperator())), { ...(ngDevMode ? { debugName: "#ownFilter" } : /* istanbul ignore next */ {}), equal: sameFilter });
716
- /** Условие колонки: из набора приложения, а вид сравнения без условия помнит сама ячейка. */
717
- this.currentFilter = linkedSignal(() => this.#ownFilter(), /* @ts-ignore */
718
- ...(ngDevMode ? [{ debugName: "currentFilter" }] : /* istanbul ignore next */ []));
719
- this.hasValue = computed(() => !!this.currentFilter().value, /* @ts-ignore */
720
- ...(ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []));
721
- this.day = computed(() => dataTableIsoToDay(this.currentFilter().value), /* @ts-ignore */
722
- ...(ngDevMode ? [{ debugName: "day" }] : /* istanbul ignore next */ []));
723
- this.number = computed(() => {
724
- const value = Number(this.currentFilter().value);
725
- return this.currentFilter().value === '' || Number.isNaN(value) ? null : value;
726
- }, /* @ts-ignore */
727
- ...(ngDevMode ? [{ debugName: "number" }] : /* istanbul ignore next */ []));
728
- this.operatorIcon = computed(() => this.#operatorIcon(this.currentFilter().operatorType), /* @ts-ignore */
729
- ...(ngDevMode ? [{ debugName: "operatorIcon" }] : /* istanbul ignore next */ []));
730
- this.operatorLabel = computed(() => this.#operatorLabel(this.#translate(), this.currentFilter().operatorType), /* @ts-ignore */
731
- ...(ngDevMode ? [{ debugName: "operatorLabel" }] : /* istanbul ignore next */ []));
732
- /**
733
- * Пункты меню — предложенные колонкой виды в порядке первого кита, кроме нынешнего: его первый кит
734
- * в меню не выводит, нынешний вид показывает кнопка.
735
- */
736
- this.operatorItems = computed(() => {
737
- const translate = this.#translate();
738
- const current = this.currentFilter().operatorType;
739
- return DATA_TABLE_FILTER_MENU_OPERATORS.filter((operator) => operator !== current && this.filterOperators().includes(operator)).map((operator) => ({
740
- operator,
741
- icon: this.#operatorIcon(operator),
742
- label: this.#operatorLabel(translate, operator),
743
- }));
744
- }, /* @ts-ignore */
745
- ...(ngDevMode ? [{ debugName: "operatorItems" }] : /* istanbul ignore next */ []));
746
- this.selectOptions = computed(() => this.filterSelectOptions().map((option) => ({ label: this.#titleCase.transform(option), value: option })), /* @ts-ignore */
747
- ...(ngDevMode ? [{ debugName: "selectOptions" }] : /* istanbul ignore next */ []));
748
- /** Колонка, по которой отбирает ячейка. */
749
- /** Вид полей отбора: `outline` — рамка со всех сторон, `fill` — залитое поле с чертой снизу. */
750
- this.appearance = input('outline', /* @ts-ignore */
751
- ...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
752
- this.filterProperty = input.required(/* @ts-ignore */
753
- ...(ngDevMode ? [{ debugName: "filterProperty" }] : /* istanbul ignore next */ []));
754
- this.filterType = input.required(/* @ts-ignore */
755
- ...(ngDevMode ? [{ debugName: "filterType" }] : /* istanbul ignore next */ []));
756
- /** Весь набор условий приложения. */
757
- this.filterModel = input([], { ...(ngDevMode ? { debugName: "filterModel" } : /* istanbul ignore next */ {}), transform: transformArrayInput });
758
- this.defaultFilterOperator = input(null, /* @ts-ignore */
759
- ...(ngDevMode ? [{ debugName: "defaultFilterOperator" }] : /* istanbul ignore next */ []));
760
- this.filterOperators = input([], { ...(ngDevMode ? { debugName: "filterOperators" } : /* istanbul ignore next */ {}), transform: transformArrayInput });
761
- this.filterSelectOptions = input([], { ...(ngDevMode ? { debugName: "filterSelectOptions" } : /* istanbul ignore next */ {}), transform: transformArrayInput });
762
- this.filterChange = output();
763
- }
764
- #translate;
765
- #host;
766
- #titleCase;
767
- /** Набранное, но ещё не зафиксированное значение текстового и числового поля. */
768
- #draft;
769
- /**
770
- * Условие своей колонки из набора приложения. Сверяется по содержимому: набор меняется целиком
771
- * и по чужой колонке, а своё условие при этом остаётся тем же — и выбранный здесь вид
772
- * сравнения пустой колонки сбрасывать нечем.
773
- */
774
- #ownFilter;
775
- /** Набор в поле: пустое поле — это очистка, она фиксируется сразу, как у первого кита. */
776
- onDraft(value) {
777
- this.#draft = value ?? '';
778
- if (this.#draft === '') {
779
- this.onCommit();
780
- }
781
- }
782
- /** Enter и уход с поля фиксируют набранное. */
783
- onCommit() {
784
- if (this.#draft !== null) {
785
- this.onValueChange(this.#draft);
786
- this.#draft = null;
787
- }
788
- }
789
- onNumberDraft(value) {
790
- this.onDraft(value === null ? '' : String(value));
791
- }
792
- onDayChange(day) {
793
- this.onValueChange(dataTableDayToIso(day ?? ''));
794
- }
795
- onValueChange(value) {
796
- const next = value ?? '';
797
- const current = this.currentFilter();
798
- if (next === current.value) {
799
- return;
800
- }
801
- const filters = dataTableFiltersWithValue(this.filterModel(), current, next);
802
- if (filters) {
803
- this.filterChange.emit(filters);
804
- }
805
- this.currentFilter.set({ ...current, value: next });
806
- }
807
- /**
808
- * Сброс крестиком переводит фокус в поле рядом.
809
- *
810
- * Без значения крестик выключается, и выключенная кнопка роняет фокус на `body`: человек с
811
- * клавиатуры оказывается в начале страницы.
812
- */
813
- onClear() {
814
- this.onValueChange('');
815
- this.#host.nativeElement.querySelector(`.${BEM_BLOCK$1}__field button, .${BEM_BLOCK$1}__field input`)?.focus();
816
- }
817
- onOperatorChange(operatorType) {
818
- const current = this.currentFilter();
819
- const filters = dataTableFiltersWithOperator(this.filterModel(), current, operatorType);
820
- if (filters) {
821
- this.filterChange.emit(filters);
822
- }
823
- this.currentFilter.set({ ...current, operatorType });
824
- }
825
- #operatorIcon(operator) {
826
- const glyph = DATA_TABLE_FILTER_OPERATOR_GLYPHS[operator];
827
- return (glyph && dataTableIconName(glyph)) || FALLBACK_OPERATOR_ICON;
828
- }
829
- #operatorLabel(translate, operator) {
830
- const key = OPERATOR_LABELS[operator];
831
- return key ? translate(key) : this.#titleCase.transform(operator);
832
- }
833
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDataTableFilterCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
834
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: RtDataTableFilterCellComponent, isStandalone: true, selector: "rt-data-table-filter-cell", inputs: { appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, filterProperty: { classPropertyName: "filterProperty", publicName: "filterProperty", isSignal: true, isRequired: true, transformFunction: null }, filterType: { classPropertyName: "filterType", publicName: "filterType", isSignal: true, isRequired: true, transformFunction: null }, filterModel: { classPropertyName: "filterModel", publicName: "filterModel", isSignal: true, isRequired: false, transformFunction: null }, defaultFilterOperator: { classPropertyName: "defaultFilterOperator", publicName: "defaultFilterOperator", isSignal: true, isRequired: false, transformFunction: null }, filterOperators: { classPropertyName: "filterOperators", publicName: "filterOperators", isSignal: true, isRequired: false, transformFunction: null }, filterSelectOptions: { classPropertyName: "filterSelectOptions", publicName: "filterSelectOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filterChange: "filterChange" }, host: { classAttribute: "rt-data-table-filter-cell" }, ngImport: i0, template: "<ng-container rtBlock=\"rt-data-table-filter-cell\">\n @if (filterOperators().length) {\n <rt-menu qa-dataid=\"data-table-filter-operator\" align=\"start\" [icon]=\"operatorIcon()\" [ariaLabel]=\"operatorLabel()\">\n @for (item of operatorItems(); track item.operator) {\n <rt-menu-item\n qa-dataid=\"data-table-filter-operator-item\"\n [icon]=\"item.icon\"\n [label]=\"item.label\"\n (selected)=\"onOperatorChange(item.operator)\" />\n }\n </rt-menu>\n }\n\n @switch (filterType()) {\n @case (filterTypes.TEXT) {\n <rt-input\n rtElem=\"field\"\n qa-dataid=\"data-table-filter-input\"\n size=\"sm\"\n [appearance]=\"appearance()\"\n [placeholder]=\"valuePlaceholder()\"\n [ngModel]=\"currentFilter().value\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"onDraft($event)\"\n (keydown.enter)=\"onCommit()\"\n (focusout)=\"onCommit()\" />\n }\n @case (filterTypes.NUMBER) {\n <rt-input-number\n rtElem=\"field\"\n qa-dataid=\"data-table-filter-number\"\n size=\"sm\"\n [appearance]=\"appearance()\"\n [placeholder]=\"valuePlaceholder()\"\n [ngModel]=\"number()\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"onNumberDraft($event)\"\n (keydown.enter)=\"onCommit()\"\n (focusout)=\"onCommit()\" />\n }\n @case (filterTypes.DATE) {\n <rt-icon-button\n qa-dataid=\"data-table-filter-clear\"\n icon=\"close\"\n [ariaLabel]=\"clearLabel()\"\n [tooltip]=\"clearLabel()\"\n [disabled]=\"!hasValue()\"\n (clicked)=\"onClear()\" />\n\n <rt-date-picker\n rtElem=\"field\"\n qa-dataid=\"data-table-filter-date\"\n size=\"sm\"\n [appearance]=\"appearance()\"\n [clearable]=\"false\"\n [ngModel]=\"day()\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"onDayChange($event)\" />\n }\n @case (filterTypes.SELECT) {\n <rt-icon-button\n qa-dataid=\"data-table-filter-clear\"\n icon=\"close\"\n [ariaLabel]=\"clearLabel()\"\n [tooltip]=\"clearLabel()\"\n [disabled]=\"!hasValue()\"\n (clicked)=\"onClear()\" />\n\n <rt-select\n rtElem=\"field\"\n qa-dataid=\"data-table-filter-select\"\n size=\"sm\"\n [appearance]=\"appearance()\"\n [clearable]=\"false\"\n [options]=\"selectOptions()\"\n [placeholder]=\"selectPlaceholder()\"\n [ngModel]=\"currentFilter().value || null\"\n [ngModelOptions]=\"{ standalone: true }\"\n (selectionChange)=\"onValueChange($event)\" />\n }\n }\n</ng-container>\n", styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-data-table-filter-cell{display:flex;width:100%;align-items:center;justify-content:flex-start;gap:var(--rt-space-sm)}.rt-data-table-filter-cell__field{--rt-input-height-sm: var(--rt-list-search-height);--rt-input-font-size: var(--rt-list-search-font-size);--rt-input-color-border: var(--rt-list-search-color-border);--rt-input-color-bg: var(--rt-list-search-color-bg);--rt-input-color-text-placeholder: var(--rt-list-search-color-placeholder);--rt-input-line-height: var(--rt-list-filter-line-height);min-width:0;flex-grow:1}.rt-data-table-filter-cell .rt-data-table-filter-cell__field{width:calc(180px + 2 * var(--rt-space-4))}.rt-data-table-filter-cell rt-icon-button{--rt-icon-button-color: var(--rt-list-table-icon-color)}.rt-data-table-filter-cell .rt-icon-button{--rt-icon-button-size-step: var(--rt-list-table-button-size);--rt-icon-button-radius: var(--rt-list-table-button-radius)}.rt-data-table-filter-cell .rt-icon-button__icon{min-width:var(--rt-list-table-icon-size);min-height:var(--rt-list-table-icon-size)}}\n"], dependencies: [{ kind: "component", type:
835
- // components
836
- 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: RtMenuComponent, selector: "rt-menu", inputs: ["icon", "ariaLabel", "align", "panelClass", "triggerSize", "size", "disabled"], outputs: ["openedChange"] }, { 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: "component", type: RtSelectComponent, selector: "rt-select", inputs: ["appearance", "options", "placeholder", "iconLeft", "filter", "filterPlaceholder", "panelWidth", "panelMaxHeight"], outputs: ["selectionChange"] }, { kind: "directive", type:
837
- // directives
838
- BlockDirective, selector: "[rtBlock]", inputs: ["rtMod"] }, { kind: "directive", type: ElemDirective, selector: "[rtElem]", inputs: ["rtMod"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
839
- }
840
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDataTableFilterCellComponent, decorators: [{
841
- type: Component,
842
- args: [{ selector: 'rt-data-table-filter-cell', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
843
- // components
844
- RtDatePickerComponent,
845
- RtIconButtonComponent,
846
- RtInputComponent,
847
- RtInputNumberComponent,
848
- RtMenuComponent,
849
- RtMenuItemComponent,
850
- RtSelectComponent,
851
- // directives
852
- BlockDirective,
853
- ElemDirective,
854
- FormsModule,
855
- ], host: { class: BEM_BLOCK$1 }, template: "<ng-container rtBlock=\"rt-data-table-filter-cell\">\n @if (filterOperators().length) {\n <rt-menu qa-dataid=\"data-table-filter-operator\" align=\"start\" [icon]=\"operatorIcon()\" [ariaLabel]=\"operatorLabel()\">\n @for (item of operatorItems(); track item.operator) {\n <rt-menu-item\n qa-dataid=\"data-table-filter-operator-item\"\n [icon]=\"item.icon\"\n [label]=\"item.label\"\n (selected)=\"onOperatorChange(item.operator)\" />\n }\n </rt-menu>\n }\n\n @switch (filterType()) {\n @case (filterTypes.TEXT) {\n <rt-input\n rtElem=\"field\"\n qa-dataid=\"data-table-filter-input\"\n size=\"sm\"\n [appearance]=\"appearance()\"\n [placeholder]=\"valuePlaceholder()\"\n [ngModel]=\"currentFilter().value\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"onDraft($event)\"\n (keydown.enter)=\"onCommit()\"\n (focusout)=\"onCommit()\" />\n }\n @case (filterTypes.NUMBER) {\n <rt-input-number\n rtElem=\"field\"\n qa-dataid=\"data-table-filter-number\"\n size=\"sm\"\n [appearance]=\"appearance()\"\n [placeholder]=\"valuePlaceholder()\"\n [ngModel]=\"number()\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"onNumberDraft($event)\"\n (keydown.enter)=\"onCommit()\"\n (focusout)=\"onCommit()\" />\n }\n @case (filterTypes.DATE) {\n <rt-icon-button\n qa-dataid=\"data-table-filter-clear\"\n icon=\"close\"\n [ariaLabel]=\"clearLabel()\"\n [tooltip]=\"clearLabel()\"\n [disabled]=\"!hasValue()\"\n (clicked)=\"onClear()\" />\n\n <rt-date-picker\n rtElem=\"field\"\n qa-dataid=\"data-table-filter-date\"\n size=\"sm\"\n [appearance]=\"appearance()\"\n [clearable]=\"false\"\n [ngModel]=\"day()\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"onDayChange($event)\" />\n }\n @case (filterTypes.SELECT) {\n <rt-icon-button\n qa-dataid=\"data-table-filter-clear\"\n icon=\"close\"\n [ariaLabel]=\"clearLabel()\"\n [tooltip]=\"clearLabel()\"\n [disabled]=\"!hasValue()\"\n (clicked)=\"onClear()\" />\n\n <rt-select\n rtElem=\"field\"\n qa-dataid=\"data-table-filter-select\"\n size=\"sm\"\n [appearance]=\"appearance()\"\n [clearable]=\"false\"\n [options]=\"selectOptions()\"\n [placeholder]=\"selectPlaceholder()\"\n [ngModel]=\"currentFilter().value || null\"\n [ngModelOptions]=\"{ standalone: true }\"\n (selectionChange)=\"onValueChange($event)\" />\n }\n }\n</ng-container>\n", styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-data-table-filter-cell{display:flex;width:100%;align-items:center;justify-content:flex-start;gap:var(--rt-space-sm)}.rt-data-table-filter-cell__field{--rt-input-height-sm: var(--rt-list-search-height);--rt-input-font-size: var(--rt-list-search-font-size);--rt-input-color-border: var(--rt-list-search-color-border);--rt-input-color-bg: var(--rt-list-search-color-bg);--rt-input-color-text-placeholder: var(--rt-list-search-color-placeholder);--rt-input-line-height: var(--rt-list-filter-line-height);min-width:0;flex-grow:1}.rt-data-table-filter-cell .rt-data-table-filter-cell__field{width:calc(180px + 2 * var(--rt-space-4))}.rt-data-table-filter-cell rt-icon-button{--rt-icon-button-color: var(--rt-list-table-icon-color)}.rt-data-table-filter-cell .rt-icon-button{--rt-icon-button-size-step: var(--rt-list-table-button-size);--rt-icon-button-radius: var(--rt-list-table-button-radius)}.rt-data-table-filter-cell .rt-icon-button__icon{min-width:var(--rt-list-table-icon-size);min-height:var(--rt-list-table-icon-size)}}\n"] }]
856
- }], propDecorators: { appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], filterProperty: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterProperty", required: true }] }], filterType: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterType", required: true }] }], filterModel: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterModel", required: false }] }], defaultFilterOperator: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultFilterOperator", required: false }] }], filterOperators: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterOperators", required: false }] }], filterSelectOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterSelectOptions", required: false }] }], filterChange: [{ type: i0.Output, args: ["filterChange"] }] } });
857
-
858
- /**
859
- * Шаблоны пользовательских ячеек: имя свойства колонки — шаблон её ячейки.
860
- *
861
- * Колонку типа «custom» таблица рисует этим шаблоном и готовой ячейки не берёт.
862
- */
863
- class RtDataTableCustomCellsDirective {
864
- constructor() {
865
- this.cellsTemplates = input.required({ ...(ngDevMode ? { debugName: "cellsTemplates" } : /* istanbul ignore next */ {}), alias: 'rtDataTableCustomCells' });
866
- }
867
- getTemplateByPropName(propName) {
868
- return this.cellsTemplates()[propName] ?? null;
869
- }
870
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDataTableCustomCellsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
871
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.6", type: RtDataTableCustomCellsDirective, isStandalone: true, selector: "[rtDataTableCustomCells]", inputs: { cellsTemplates: { classPropertyName: "cellsTemplates", publicName: "rtDataTableCustomCells", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
872
- }
873
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDataTableCustomCellsDirective, decorators: [{
874
- type: Directive,
875
- args: [{
876
- selector: '[rtDataTableCustomCells]',
877
- }]
878
- }], propDecorators: { cellsTemplates: [{ type: i0.Input, args: [{ isSignal: true, alias: "rtDataTableCustomCells", required: true }] }] } });
879
- /** Пункты меню строки: шаблон раскрывается в панели меню кита. */
880
- class RtDataTableRowActionsDirective {
881
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDataTableRowActionsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
882
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.6", type: RtDataTableRowActionsDirective, isStandalone: true, selector: "[rtDataTableRowActions]", ngImport: i0 }); }
993
+ return a.propertyName === b.propertyName && a.operatorType === b.operatorType && a.value === b.value;
883
994
  }
884
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDataTableRowActionsDirective, decorators: [{
885
- type: Directive,
886
- args: [{
887
- selector: '[rtDataTableRowActions]',
888
- }]
889
- }] });
890
- /** Действия строки рядом с кнопкой меню: шаблон рисуется в полосе действий. */
891
- class RtDataTableAdditionalRowActionsDirective {
892
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDataTableAdditionalRowActionsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
893
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.6", type: RtDataTableAdditionalRowActionsDirective, isStandalone: true, selector: "[rtDataTableAdditionalRowActions]", ngImport: i0 }); }
894
- }
895
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDataTableAdditionalRowActionsDirective, decorators: [{
896
- type: Directive,
897
- args: [{
898
- selector: '[rtDataTableAdditionalRowActions]',
899
- }]
900
- }] });
901
-
902
- /** Ключи записей списка. */
995
+ var RtDataTableFilterCellComponent = class RtDataTableFilterCellComponent {
996
+ constructor() {
997
+ this.#translate = inject(RT_KIT_TRANSLATOR);
998
+ this.#host = inject(ElementRef);
999
+ this.#titleCase = new TitleCasePipe();
1000
+ this.#draft = null;
1001
+ this.filterTypes = ERtDataTableFilterType;
1002
+ this.valuePlaceholder = rtKitLabel("dataTableFilterValuePlaceholder");
1003
+ this.selectPlaceholder = rtKitLabel("dataTableFilterSelectPlaceholder");
1004
+ this.clearLabel = rtKitLabel("dataTableFilterClear");
1005
+ this.#ownFilter = computed(() => dataTableColumnFilter(this.filterModel(), this.filterProperty(), dataTableDefaultOperator(this.defaultFilterOperator())), {
1006
+ ...ngDevMode ? { debugName: "#ownFilter" } : /* istanbul ignore next */ {},
1007
+ equal: sameFilter
1008
+ });
1009
+ this.currentFilter = linkedSignal(() => this.#ownFilter(), ...ngDevMode ? [{ debugName: "currentFilter" }] : /* istanbul ignore next */ []);
1010
+ this.hasValue = computed(() => !!this.currentFilter().value, ...ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []);
1011
+ this.day = computed(() => dataTableIsoToDay(this.currentFilter().value), ...ngDevMode ? [{ debugName: "day" }] : /* istanbul ignore next */ []);
1012
+ this.number = computed(() => {
1013
+ const value = Number(this.currentFilter().value);
1014
+ return this.currentFilter().value === "" || Number.isNaN(value) ? null : value;
1015
+ }, ...ngDevMode ? [{ debugName: "number" }] : /* istanbul ignore next */ []);
1016
+ this.operatorIcon = computed(() => this.#operatorIcon(this.currentFilter().operatorType), ...ngDevMode ? [{ debugName: "operatorIcon" }] : /* istanbul ignore next */ []);
1017
+ this.operatorLabel = computed(() => this.#operatorLabel(this.#translate(), this.currentFilter().operatorType), ...ngDevMode ? [{ debugName: "operatorLabel" }] : /* istanbul ignore next */ []);
1018
+ this.operatorItems = computed(() => {
1019
+ const translate = this.#translate();
1020
+ const current = this.currentFilter().operatorType;
1021
+ return DATA_TABLE_FILTER_MENU_OPERATORS.filter((operator) => operator !== current && this.filterOperators().includes(operator)).map((operator) => ({
1022
+ operator,
1023
+ icon: this.#operatorIcon(operator),
1024
+ label: this.#operatorLabel(translate, operator)
1025
+ }));
1026
+ }, ...ngDevMode ? [{ debugName: "operatorItems" }] : /* istanbul ignore next */ []);
1027
+ this.selectOptions = computed(() => this.filterSelectOptions().map((option) => ({
1028
+ label: this.#titleCase.transform(option),
1029
+ value: option
1030
+ })), ...ngDevMode ? [{ debugName: "selectOptions" }] : /* istanbul ignore next */ []);
1031
+ this.appearance = input("outline", ...ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []);
1032
+ this.filterProperty = input.required(...ngDevMode ? [{ debugName: "filterProperty" }] : /* istanbul ignore next */ []);
1033
+ this.filterType = input.required(...ngDevMode ? [{ debugName: "filterType" }] : /* istanbul ignore next */ []);
1034
+ this.filterModel = input([], {
1035
+ ...ngDevMode ? { debugName: "filterModel" } : /* istanbul ignore next */ {},
1036
+ transform: transformArrayInput
1037
+ });
1038
+ this.defaultFilterOperator = input(null, ...ngDevMode ? [{ debugName: "defaultFilterOperator" }] : /* istanbul ignore next */ []);
1039
+ this.filterOperators = input([], {
1040
+ ...ngDevMode ? { debugName: "filterOperators" } : /* istanbul ignore next */ {},
1041
+ transform: transformArrayInput
1042
+ });
1043
+ this.filterSelectOptions = input([], {
1044
+ ...ngDevMode ? { debugName: "filterSelectOptions" } : /* istanbul ignore next */ {},
1045
+ transform: transformArrayInput
1046
+ });
1047
+ this.filterChange = output();
1048
+ }
1049
+ #translate;
1050
+ #host;
1051
+ #titleCase;
1052
+ #draft;
1053
+ #ownFilter;
1054
+ onDraft(value) {
1055
+ this.#draft = value ?? "";
1056
+ if (this.#draft === "") this.onCommit();
1057
+ }
1058
+ onCommit() {
1059
+ if (this.#draft !== null) {
1060
+ this.onValueChange(this.#draft);
1061
+ this.#draft = null;
1062
+ }
1063
+ }
1064
+ onNumberDraft(value) {
1065
+ this.onDraft(value === null ? "" : String(value));
1066
+ }
1067
+ onDayChange(day) {
1068
+ this.onValueChange(dataTableDayToIso(day ?? ""));
1069
+ }
1070
+ onValueChange(value) {
1071
+ const next = value ?? "";
1072
+ const current = this.currentFilter();
1073
+ if (next === current.value) return;
1074
+ const filters = dataTableFiltersWithValue(this.filterModel(), current, next);
1075
+ if (filters) this.filterChange.emit(filters);
1076
+ this.currentFilter.set({
1077
+ ...current,
1078
+ value: next
1079
+ });
1080
+ }
1081
+ onClear() {
1082
+ this.onValueChange("");
1083
+ this.#host.nativeElement.querySelector(`.${BEM_BLOCK$1}__field button, .${BEM_BLOCK$1}__field input`)?.focus();
1084
+ }
1085
+ onOperatorChange(operatorType) {
1086
+ const current = this.currentFilter();
1087
+ const filters = dataTableFiltersWithOperator(this.filterModel(), current, operatorType);
1088
+ if (filters) this.filterChange.emit(filters);
1089
+ this.currentFilter.set({
1090
+ ...current,
1091
+ operatorType
1092
+ });
1093
+ }
1094
+ #operatorIcon(operator) {
1095
+ const glyph = DATA_TABLE_FILTER_OPERATOR_GLYPHS[operator];
1096
+ return glyph && dataTableIconName(glyph) || FALLBACK_OPERATOR_ICON;
1097
+ }
1098
+ #operatorLabel(translate, operator) {
1099
+ const key = OPERATOR_LABELS[operator];
1100
+ return key ? translate(key) : this.#titleCase.transform(operator);
1101
+ }
1102
+ static {
1103
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1104
+ minVersion: "12.0.0",
1105
+ version: "22.2.2",
1106
+ ngImport: i0,
1107
+ type: RtDataTableFilterCellComponent,
1108
+ deps: [],
1109
+ target: i0.ɵɵFactoryTarget.Component
1110
+ });
1111
+ }
1112
+ static {
1113
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
1114
+ minVersion: "17.0.0",
1115
+ version: "22.2.2",
1116
+ type: RtDataTableFilterCellComponent,
1117
+ isStandalone: true,
1118
+ selector: "rt-data-table-filter-cell",
1119
+ inputs: {
1120
+ appearance: {
1121
+ classPropertyName: "appearance",
1122
+ publicName: "appearance",
1123
+ isSignal: true,
1124
+ isRequired: false,
1125
+ transformFunction: null
1126
+ },
1127
+ filterProperty: {
1128
+ classPropertyName: "filterProperty",
1129
+ publicName: "filterProperty",
1130
+ isSignal: true,
1131
+ isRequired: true,
1132
+ transformFunction: null
1133
+ },
1134
+ filterType: {
1135
+ classPropertyName: "filterType",
1136
+ publicName: "filterType",
1137
+ isSignal: true,
1138
+ isRequired: true,
1139
+ transformFunction: null
1140
+ },
1141
+ filterModel: {
1142
+ classPropertyName: "filterModel",
1143
+ publicName: "filterModel",
1144
+ isSignal: true,
1145
+ isRequired: false,
1146
+ transformFunction: null
1147
+ },
1148
+ defaultFilterOperator: {
1149
+ classPropertyName: "defaultFilterOperator",
1150
+ publicName: "defaultFilterOperator",
1151
+ isSignal: true,
1152
+ isRequired: false,
1153
+ transformFunction: null
1154
+ },
1155
+ filterOperators: {
1156
+ classPropertyName: "filterOperators",
1157
+ publicName: "filterOperators",
1158
+ isSignal: true,
1159
+ isRequired: false,
1160
+ transformFunction: null
1161
+ },
1162
+ filterSelectOptions: {
1163
+ classPropertyName: "filterSelectOptions",
1164
+ publicName: "filterSelectOptions",
1165
+ isSignal: true,
1166
+ isRequired: false,
1167
+ transformFunction: null
1168
+ }
1169
+ },
1170
+ outputs: { filterChange: "filterChange" },
1171
+ host: { classAttribute: "rt-data-table-filter-cell" },
1172
+ ngImport: i0,
1173
+ template: "<ng-container rtBlock=\"rt-data-table-filter-cell\">\n @if (filterOperators().length) {\n <rt-menu qa-dataid=\"data-table-filter-operator\" align=\"start\" [icon]=\"operatorIcon()\" [ariaLabel]=\"operatorLabel()\">\n @for (item of operatorItems(); track item.operator) {\n <rt-menu-item\n qa-dataid=\"data-table-filter-operator-item\"\n [icon]=\"item.icon\"\n [label]=\"item.label\"\n (selected)=\"onOperatorChange(item.operator)\" />\n }\n </rt-menu>\n }\n\n @switch (filterType()) {\n @case (filterTypes.TEXT) {\n <rt-input\n rtElem=\"field\"\n qa-dataid=\"data-table-filter-input\"\n size=\"sm\"\n [appearance]=\"appearance()\"\n [placeholder]=\"valuePlaceholder()\"\n [ngModel]=\"currentFilter().value\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"onDraft($event)\"\n (keydown.enter)=\"onCommit()\"\n (focusout)=\"onCommit()\" />\n }\n @case (filterTypes.NUMBER) {\n <rt-input-number\n rtElem=\"field\"\n qa-dataid=\"data-table-filter-number\"\n size=\"sm\"\n [appearance]=\"appearance()\"\n [placeholder]=\"valuePlaceholder()\"\n [ngModel]=\"number()\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"onNumberDraft($event)\"\n (keydown.enter)=\"onCommit()\"\n (focusout)=\"onCommit()\" />\n }\n @case (filterTypes.DATE) {\n <rt-icon-button\n qa-dataid=\"data-table-filter-clear\"\n icon=\"close\"\n [ariaLabel]=\"clearLabel()\"\n [tooltip]=\"clearLabel()\"\n [disabled]=\"!hasValue()\"\n (clicked)=\"onClear()\" />\n\n <rt-date-picker\n rtElem=\"field\"\n qa-dataid=\"data-table-filter-date\"\n size=\"sm\"\n [appearance]=\"appearance()\"\n [clearable]=\"false\"\n [ngModel]=\"day()\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"onDayChange($event)\" />\n }\n @case (filterTypes.SELECT) {\n <rt-icon-button\n qa-dataid=\"data-table-filter-clear\"\n icon=\"close\"\n [ariaLabel]=\"clearLabel()\"\n [tooltip]=\"clearLabel()\"\n [disabled]=\"!hasValue()\"\n (clicked)=\"onClear()\" />\n\n <rt-select\n rtElem=\"field\"\n qa-dataid=\"data-table-filter-select\"\n size=\"sm\"\n [appearance]=\"appearance()\"\n [clearable]=\"false\"\n [options]=\"selectOptions()\"\n [placeholder]=\"selectPlaceholder()\"\n [ngModel]=\"currentFilter().value || null\"\n [ngModelOptions]=\"{ standalone: true }\"\n (selectionChange)=\"onValueChange($event)\" />\n }\n }\n</ng-container>\n",
1174
+ styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-data-table-filter-cell{display:flex;width:100%;align-items:center;justify-content:flex-start;gap:var(--rt-space-sm)}.rt-data-table-filter-cell__field{--rt-input-height-sm: var(--rt-list-search-height);--rt-input-font-size: var(--rt-list-search-font-size);--rt-input-color-border: var(--rt-list-search-color-border);--rt-input-color-bg: var(--rt-list-search-color-bg);--rt-input-color-text-placeholder: var(--rt-list-search-color-placeholder);--rt-input-line-height: var(--rt-list-filter-line-height);min-width:0;flex-grow:1}.rt-data-table-filter-cell .rt-data-table-filter-cell__field{width:calc(180px + 2 * var(--rt-space-4))}.rt-data-table-filter-cell rt-icon-button{--rt-icon-button-color: var(--rt-list-table-icon-color)}.rt-data-table-filter-cell .rt-icon-button{--rt-icon-button-size-step: var(--rt-list-table-button-size);--rt-icon-button-radius: var(--rt-list-table-button-radius)}.rt-data-table-filter-cell .rt-icon-button__icon{min-width:var(--rt-list-table-icon-size);min-height:var(--rt-list-table-icon-size)}}\n"],
1175
+ dependencies: [
1176
+ {
1177
+ kind: "component",
1178
+ type: RtDatePickerComponent,
1179
+ selector: "rt-date-picker",
1180
+ inputs: [
1181
+ "appearance",
1182
+ "type",
1183
+ "min",
1184
+ "max",
1185
+ "minuteStep"
1186
+ ]
1187
+ },
1188
+ {
1189
+ kind: "component",
1190
+ type: RtIconButtonComponent,
1191
+ selector: "rt-icon-button",
1192
+ inputs: [
1193
+ "icon",
1194
+ "glyph",
1195
+ "ariaLabel",
1196
+ "variant",
1197
+ "iconColor",
1198
+ "iconFill",
1199
+ "size",
1200
+ "iconSize",
1201
+ "type",
1202
+ "tooltip",
1203
+ "tooltipHideOnClick",
1204
+ "tabIndex",
1205
+ "loading",
1206
+ "disabled",
1207
+ "active",
1208
+ "expanded",
1209
+ "indicator"
1210
+ ],
1211
+ outputs: ["clicked"]
1212
+ },
1213
+ {
1214
+ kind: "component",
1215
+ type: RtInputComponent,
1216
+ selector: "rt-input",
1217
+ inputs: [
1218
+ "appearance",
1219
+ "type",
1220
+ "placeholder",
1221
+ "iconLeft",
1222
+ "iconRight",
1223
+ "passwordToggle",
1224
+ "autocomplete"
1225
+ ]
1226
+ },
1227
+ {
1228
+ kind: "component",
1229
+ type: RtInputNumberComponent,
1230
+ selector: "rt-input-number",
1231
+ inputs: [
1232
+ "appearance",
1233
+ "iconLeft",
1234
+ "prefix",
1235
+ "placeholder",
1236
+ "min",
1237
+ "max",
1238
+ "minFractionDigits",
1239
+ "maxFractionDigits",
1240
+ "grouped"
1241
+ ]
1242
+ },
1243
+ {
1244
+ kind: "component",
1245
+ type: RtMenuComponent,
1246
+ selector: "rt-menu",
1247
+ inputs: [
1248
+ "icon",
1249
+ "ariaLabel",
1250
+ "align",
1251
+ "panelClass",
1252
+ "triggerSize",
1253
+ "size",
1254
+ "disabled"
1255
+ ],
1256
+ outputs: ["openedChange"]
1257
+ },
1258
+ {
1259
+ kind: "component",
1260
+ type: RtMenuItemComponent,
1261
+ selector: "rt-menu-item",
1262
+ inputs: [
1263
+ "icon",
1264
+ "label",
1265
+ "danger",
1266
+ "success",
1267
+ "glyph",
1268
+ "fill",
1269
+ "current",
1270
+ "disabled",
1271
+ "confirmMessage",
1272
+ "confirmTitle",
1273
+ "confirmLabel",
1274
+ "confirmCancelLabel",
1275
+ "confirmTone",
1276
+ "link"
1277
+ ],
1278
+ outputs: ["selected"]
1279
+ },
1280
+ {
1281
+ kind: "component",
1282
+ type: RtSelectComponent,
1283
+ selector: "rt-select",
1284
+ inputs: [
1285
+ "appearance",
1286
+ "options",
1287
+ "placeholder",
1288
+ "iconLeft",
1289
+ "filter",
1290
+ "filterPlaceholder",
1291
+ "panelWidth",
1292
+ "panelMaxHeight"
1293
+ ],
1294
+ outputs: ["selectionChange"]
1295
+ },
1296
+ {
1297
+ kind: "directive",
1298
+ type: BlockDirective,
1299
+ selector: "[rtBlock]",
1300
+ inputs: ["rtMod"]
1301
+ },
1302
+ {
1303
+ kind: "directive",
1304
+ type: ElemDirective,
1305
+ selector: "[rtElem]",
1306
+ inputs: ["rtMod"]
1307
+ },
1308
+ {
1309
+ kind: "ngmodule",
1310
+ type: FormsModule
1311
+ },
1312
+ {
1313
+ kind: "directive",
1314
+ type: i1.NgControlStatus,
1315
+ selector: "[formControlName],[ngModel],[formControl]"
1316
+ },
1317
+ {
1318
+ kind: "directive",
1319
+ type: i1.NgModel,
1320
+ selector: "[ngModel]:not([formControlName]):not([formControl])",
1321
+ inputs: [
1322
+ "name",
1323
+ "disabled",
1324
+ "ngModel",
1325
+ "ngModelOptions"
1326
+ ],
1327
+ outputs: ["ngModelChange"],
1328
+ exportAs: ["ngModel"]
1329
+ }
1330
+ ],
1331
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
1332
+ encapsulation: i0.ViewEncapsulation.None
1333
+ });
1334
+ }
1335
+ };
1336
+ i0.ɵɵngDeclareClassMetadata({
1337
+ minVersion: "12.0.0",
1338
+ version: "22.2.2",
1339
+ ngImport: i0,
1340
+ type: RtDataTableFilterCellComponent,
1341
+ decorators: [{
1342
+ type: Component,
1343
+ args: [{
1344
+ selector: "rt-data-table-filter-cell",
1345
+ changeDetection: ChangeDetectionStrategy.OnPush,
1346
+ encapsulation: ViewEncapsulation.None,
1347
+ imports: [
1348
+ RtDatePickerComponent,
1349
+ RtIconButtonComponent,
1350
+ RtInputComponent,
1351
+ RtInputNumberComponent,
1352
+ RtMenuComponent,
1353
+ RtMenuItemComponent,
1354
+ RtSelectComponent,
1355
+ BlockDirective,
1356
+ ElemDirective,
1357
+ FormsModule
1358
+ ],
1359
+ host: { class: BEM_BLOCK$1 },
1360
+ template: "<ng-container rtBlock=\"rt-data-table-filter-cell\">\n @if (filterOperators().length) {\n <rt-menu qa-dataid=\"data-table-filter-operator\" align=\"start\" [icon]=\"operatorIcon()\" [ariaLabel]=\"operatorLabel()\">\n @for (item of operatorItems(); track item.operator) {\n <rt-menu-item\n qa-dataid=\"data-table-filter-operator-item\"\n [icon]=\"item.icon\"\n [label]=\"item.label\"\n (selected)=\"onOperatorChange(item.operator)\" />\n }\n </rt-menu>\n }\n\n @switch (filterType()) {\n @case (filterTypes.TEXT) {\n <rt-input\n rtElem=\"field\"\n qa-dataid=\"data-table-filter-input\"\n size=\"sm\"\n [appearance]=\"appearance()\"\n [placeholder]=\"valuePlaceholder()\"\n [ngModel]=\"currentFilter().value\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"onDraft($event)\"\n (keydown.enter)=\"onCommit()\"\n (focusout)=\"onCommit()\" />\n }\n @case (filterTypes.NUMBER) {\n <rt-input-number\n rtElem=\"field\"\n qa-dataid=\"data-table-filter-number\"\n size=\"sm\"\n [appearance]=\"appearance()\"\n [placeholder]=\"valuePlaceholder()\"\n [ngModel]=\"number()\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"onNumberDraft($event)\"\n (keydown.enter)=\"onCommit()\"\n (focusout)=\"onCommit()\" />\n }\n @case (filterTypes.DATE) {\n <rt-icon-button\n qa-dataid=\"data-table-filter-clear\"\n icon=\"close\"\n [ariaLabel]=\"clearLabel()\"\n [tooltip]=\"clearLabel()\"\n [disabled]=\"!hasValue()\"\n (clicked)=\"onClear()\" />\n\n <rt-date-picker\n rtElem=\"field\"\n qa-dataid=\"data-table-filter-date\"\n size=\"sm\"\n [appearance]=\"appearance()\"\n [clearable]=\"false\"\n [ngModel]=\"day()\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"onDayChange($event)\" />\n }\n @case (filterTypes.SELECT) {\n <rt-icon-button\n qa-dataid=\"data-table-filter-clear\"\n icon=\"close\"\n [ariaLabel]=\"clearLabel()\"\n [tooltip]=\"clearLabel()\"\n [disabled]=\"!hasValue()\"\n (clicked)=\"onClear()\" />\n\n <rt-select\n rtElem=\"field\"\n qa-dataid=\"data-table-filter-select\"\n size=\"sm\"\n [appearance]=\"appearance()\"\n [clearable]=\"false\"\n [options]=\"selectOptions()\"\n [placeholder]=\"selectPlaceholder()\"\n [ngModel]=\"currentFilter().value || null\"\n [ngModelOptions]=\"{ standalone: true }\"\n (selectionChange)=\"onValueChange($event)\" />\n }\n }\n</ng-container>\n",
1361
+ styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-data-table-filter-cell{display:flex;width:100%;align-items:center;justify-content:flex-start;gap:var(--rt-space-sm)}.rt-data-table-filter-cell__field{--rt-input-height-sm: var(--rt-list-search-height);--rt-input-font-size: var(--rt-list-search-font-size);--rt-input-color-border: var(--rt-list-search-color-border);--rt-input-color-bg: var(--rt-list-search-color-bg);--rt-input-color-text-placeholder: var(--rt-list-search-color-placeholder);--rt-input-line-height: var(--rt-list-filter-line-height);min-width:0;flex-grow:1}.rt-data-table-filter-cell .rt-data-table-filter-cell__field{width:calc(180px + 2 * var(--rt-space-4))}.rt-data-table-filter-cell rt-icon-button{--rt-icon-button-color: var(--rt-list-table-icon-color)}.rt-data-table-filter-cell .rt-icon-button{--rt-icon-button-size-step: var(--rt-list-table-button-size);--rt-icon-button-radius: var(--rt-list-table-button-radius)}.rt-data-table-filter-cell .rt-icon-button__icon{min-width:var(--rt-list-table-icon-size);min-height:var(--rt-list-table-icon-size)}}\n"]
1362
+ }]
1363
+ }],
1364
+ propDecorators: {
1365
+ appearance: [{
1366
+ type: i0.Input,
1367
+ args: [{
1368
+ isSignal: true,
1369
+ alias: "appearance",
1370
+ required: false
1371
+ }]
1372
+ }],
1373
+ filterProperty: [{
1374
+ type: i0.Input,
1375
+ args: [{
1376
+ isSignal: true,
1377
+ alias: "filterProperty",
1378
+ required: true
1379
+ }]
1380
+ }],
1381
+ filterType: [{
1382
+ type: i0.Input,
1383
+ args: [{
1384
+ isSignal: true,
1385
+ alias: "filterType",
1386
+ required: true
1387
+ }]
1388
+ }],
1389
+ filterModel: [{
1390
+ type: i0.Input,
1391
+ args: [{
1392
+ isSignal: true,
1393
+ alias: "filterModel",
1394
+ required: false
1395
+ }]
1396
+ }],
1397
+ defaultFilterOperator: [{
1398
+ type: i0.Input,
1399
+ args: [{
1400
+ isSignal: true,
1401
+ alias: "defaultFilterOperator",
1402
+ required: false
1403
+ }]
1404
+ }],
1405
+ filterOperators: [{
1406
+ type: i0.Input,
1407
+ args: [{
1408
+ isSignal: true,
1409
+ alias: "filterOperators",
1410
+ required: false
1411
+ }]
1412
+ }],
1413
+ filterSelectOptions: [{
1414
+ type: i0.Input,
1415
+ args: [{
1416
+ isSignal: true,
1417
+ alias: "filterSelectOptions",
1418
+ required: false
1419
+ }]
1420
+ }],
1421
+ filterChange: [{
1422
+ type: i0.Output,
1423
+ args: ["filterChange"]
1424
+ }]
1425
+ }
1426
+ });
1427
+ var RtDataTableCustomCellsDirective = class RtDataTableCustomCellsDirective {
1428
+ constructor() {
1429
+ this.cellsTemplates = input.required({
1430
+ ...ngDevMode ? { debugName: "cellsTemplates" } : /* istanbul ignore next */ {},
1431
+ alias: "rtDataTableCustomCells"
1432
+ });
1433
+ }
1434
+ getTemplateByPropName(propName) {
1435
+ return this.cellsTemplates()[propName] ?? null;
1436
+ }
1437
+ static {
1438
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1439
+ minVersion: "12.0.0",
1440
+ version: "22.2.2",
1441
+ ngImport: i0,
1442
+ type: RtDataTableCustomCellsDirective,
1443
+ deps: [],
1444
+ target: i0.ɵɵFactoryTarget.Directive
1445
+ });
1446
+ }
1447
+ static {
1448
+ this.ɵdir = i0.ɵɵngDeclareDirective({
1449
+ minVersion: "17.1.0",
1450
+ version: "22.2.2",
1451
+ type: RtDataTableCustomCellsDirective,
1452
+ isStandalone: true,
1453
+ selector: "[rtDataTableCustomCells]",
1454
+ inputs: { cellsTemplates: {
1455
+ classPropertyName: "cellsTemplates",
1456
+ publicName: "rtDataTableCustomCells",
1457
+ isSignal: true,
1458
+ isRequired: true,
1459
+ transformFunction: null
1460
+ } },
1461
+ ngImport: i0
1462
+ });
1463
+ }
1464
+ };
1465
+ i0.ɵɵngDeclareClassMetadata({
1466
+ minVersion: "12.0.0",
1467
+ version: "22.2.2",
1468
+ ngImport: i0,
1469
+ type: RtDataTableCustomCellsDirective,
1470
+ decorators: [{
1471
+ type: Directive,
1472
+ args: [{ selector: "[rtDataTableCustomCells]" }]
1473
+ }],
1474
+ propDecorators: { cellsTemplates: [{
1475
+ type: i0.Input,
1476
+ args: [{
1477
+ isSignal: true,
1478
+ alias: "rtDataTableCustomCells",
1479
+ required: true
1480
+ }]
1481
+ }] }
1482
+ });
1483
+ var RtDataTableRowActionsDirective = class RtDataTableRowActionsDirective {
1484
+ static {
1485
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1486
+ minVersion: "12.0.0",
1487
+ version: "22.2.2",
1488
+ ngImport: i0,
1489
+ type: RtDataTableRowActionsDirective,
1490
+ deps: [],
1491
+ target: i0.ɵɵFactoryTarget.Directive
1492
+ });
1493
+ }
1494
+ static {
1495
+ this.ɵdir = i0.ɵɵngDeclareDirective({
1496
+ minVersion: "14.0.0",
1497
+ version: "22.2.2",
1498
+ type: RtDataTableRowActionsDirective,
1499
+ isStandalone: true,
1500
+ selector: "[rtDataTableRowActions]",
1501
+ ngImport: i0
1502
+ });
1503
+ }
1504
+ };
1505
+ i0.ɵɵngDeclareClassMetadata({
1506
+ minVersion: "12.0.0",
1507
+ version: "22.2.2",
1508
+ ngImport: i0,
1509
+ type: RtDataTableRowActionsDirective,
1510
+ decorators: [{
1511
+ type: Directive,
1512
+ args: [{ selector: "[rtDataTableRowActions]" }]
1513
+ }]
1514
+ });
1515
+ var RtDataTableAdditionalRowActionsDirective = class RtDataTableAdditionalRowActionsDirective {
1516
+ static {
1517
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1518
+ minVersion: "12.0.0",
1519
+ version: "22.2.2",
1520
+ ngImport: i0,
1521
+ type: RtDataTableAdditionalRowActionsDirective,
1522
+ deps: [],
1523
+ target: i0.ɵɵFactoryTarget.Directive
1524
+ });
1525
+ }
1526
+ static {
1527
+ this.ɵdir = i0.ɵɵngDeclareDirective({
1528
+ minVersion: "14.0.0",
1529
+ version: "22.2.2",
1530
+ type: RtDataTableAdditionalRowActionsDirective,
1531
+ isStandalone: true,
1532
+ selector: "[rtDataTableAdditionalRowActions]",
1533
+ ngImport: i0
1534
+ });
1535
+ }
1536
+ };
1537
+ i0.ɵɵngDeclareClassMetadata({
1538
+ minVersion: "12.0.0",
1539
+ version: "22.2.2",
1540
+ ngImport: i0,
1541
+ type: RtDataTableAdditionalRowActionsDirective,
1542
+ decorators: [{
1543
+ type: Directive,
1544
+ args: [{ selector: "[rtDataTableAdditionalRowActions]" }]
1545
+ }]
1546
+ });
903
1547
  function dataTableKeysOf(entities, keyExp) {
904
- return entities.map((entity) => entity[keyExp]);
1548
+ return entities.map((entity) => entity[keyExp]);
905
1549
  }
906
- /** Записи страницы, добавленные к отмеченным; повторов не будет. */
907
1550
  function dataTableWithPageEntities(selected, page, keyExp) {
908
- const keys = dataTableKeysOf(selected, keyExp);
909
- return [...selected, ...page.filter((entity) => !keys.includes(entity[keyExp]))];
1551
+ const keys = dataTableKeysOf(selected, keyExp);
1552
+ return [...selected, ...page.filter((entity) => !keys.includes(entity[keyExp]))];
910
1553
  }
911
- /** Отмеченные без записей страницы. */
912
1554
  function dataTableWithoutPageEntities(selected, page, keyExp) {
913
- const keys = dataTableKeysOf(page, keyExp);
914
- return selected.filter((entity) => !keys.includes(entity[keyExp]));
1555
+ const keys = dataTableKeysOf(page, keyExp);
1556
+ return selected.filter((entity) => !keys.includes(entity[keyExp]));
915
1557
  }
916
- /** Отмеченные после отметки или снятия одной записи. */
917
1558
  function dataTableWithEntity(selected, entity, checked, keyExp) {
918
- const without = selected.filter((el) => el[keyExp] !== entity[keyExp]);
919
- return checked ? [...without, entity] : without;
1559
+ const without = selected.filter((el) => el[keyExp] !== entity[keyExp]);
1560
+ return checked ? [...without, entity] : without;
920
1561
  }
921
- /** Хоть одна запись страницы отмечена. */
922
1562
  function dataTableAnyOnPage(page, selectedKeys, keyExp) {
923
- return page.some((entity) => selectedKeys.includes(entity[keyExp]));
1563
+ return page.some((entity) => selectedKeys.includes(entity[keyExp]));
924
1564
  }
925
- /** Отмечены все записи страницы; пустая страница у первого кита считается отмеченной целиком. */
926
1565
  function dataTableAllOnPage(page, selectedKeys, keyExp) {
927
- return page.every((entity) => selectedKeys.includes(entity[keyExp]));
1566
+ return page.every((entity) => selectedKeys.includes(entity[keyExp]));
928
1567
  }
929
- /** Записи первой страницы, чьи ключи названы приложением как отмеченные заранее. */
930
1568
  function dataTablePresetEntities(entities, keys, keyExp) {
931
- return entities.filter((entity) => keys.includes(entity[keyExp]));
932
- }
933
-
934
- const BEM_BLOCK = 'rt-data-table';
935
- /**
936
- * Таблица записей первого кита во втором — без Material.
937
- *
938
- * Колонки берутся у службы настроек, строки приходят входом. Таблица рисует шапку, строку
939
- * отбора, готовые или пользовательские ячейки, колонку выбора флажком либо радиокнопкой и полосу
940
- * действий в конце строки. Своего отбора и своего порядка она не ведёт: обо всём просит
941
- * приложение. Отметками строк занимается директива выбора — она ставит их сюда.
942
- */
943
- class RtDataTableComponent {
944
- constructor() {
945
- this.#configService = inject(RtDataTableConfigService);
946
- /* Вид считается из настроек при объявлении входа: вход в разметке по-прежнему перебивает всё. */
947
- this.#look = rtKitDefault('dataTable', (it) => it.look, 'material');
948
- /** Полоса действий и две ячейки, которым она отдаёт свою ширину, — приём первого кита. */
949
- this.rowActionsRef = viewChild('rowActions', /* @ts-ignore */
950
- ...(ngDevMode ? [{ debugName: "rowActionsRef" }] : /* istanbul ignore next */ []));
951
- this.headerSpacerRef = viewChild('headerSpacer', /* @ts-ignore */
952
- ...(ngDevMode ? [{ debugName: "headerSpacerRef" }] : /* istanbul ignore next */ []));
953
- this.rowSpacerRef = viewChild('rowSpacer', /* @ts-ignore */
954
- ...(ngDevMode ? [{ debugName: "rowSpacerRef" }] : /* istanbul ignore next */ []));
955
- this.columnTypes = ERtDataTableColumnType;
956
- /** Набор даёт узел вокруг — список; тогда класс набора на самой таблице не ставится. */
957
- this.presetFromHost = inject(RT_DATA_TABLE_PRESET_FROM_HOST, { optional: true }) ?? false;
958
- /** Классы меню строки: оно открывается поверх страницы и вид семьи получает от неё. */
959
- this.menuPanelClass = computed(() => (this.look() === 'material' ? [RT_PRESET_MATERIAL_CLASS] : []), /* @ts-ignore */
960
- ...(ngDevMode ? [{ debugName: "menuPanelClass" }] : /* istanbul ignore next */ []));
961
- this.actionsLabel = rtKitLabel('dataTableActions');
962
- this.selectRowLabel = rtKitLabel('dataTableSelectRow');
963
- this.selectPageLabel = rtKitLabel('dataTableSelectPage');
964
- /** Полоса действий рисуется, когда приложение дало меню строки или действия рядом с ним. */
965
- this.hasRowActions = computed(() => !!this.rowActionsTpl() || !!this.additionalRowActionsTpl(), /* @ts-ignore */
966
- ...(ngDevMode ? [{ debugName: "hasRowActions" }] : /* istanbul ignore next */ []));
967
- this.visibleColumns = computed(() => this.columns().filter((column) => !column.hidden), /* @ts-ignore */
968
- ...(ngDevMode ? [{ debugName: "visibleColumns" }] : /* istanbul ignore next */ []));
969
- /** `aria-sort` каждой показанной колонки по её имени: шаблон читает готовое, а не зовёт расчёт. */
970
- this.ariaSorts = computed(() => Object.fromEntries(this.visibleColumns().map((column) => [
971
- column.propName,
972
- dataTableAriaSort(column.sorting, this.currentSortModel()),
973
- ])), /* @ts-ignore */
974
- ...(ngDevMode ? [{ debugName: "ariaSorts" }] : /* istanbul ignore next */ []));
975
- /** Колонки — из службы настроек: их порядок и видимость помнит она. */
976
- /** Вид полей отбора: `outline` — рамка со всех сторон, `fill` — залитое поле с чертой снизу. */
977
- /**
978
- * Вид семьи. Материальный набор стоит на самом узле, а не на странице: семья выглядит как первый
979
- * кит, где бы её ни поставили, и соседи на странице своего вида не теряют.
980
- */
981
- this.look = input(this.#look, /* @ts-ignore */
982
- ...(ngDevMode ? [{ debugName: "look" }] : /* istanbul ignore next */ []));
983
- this.filterAppearance = input('outline', /* @ts-ignore */
984
- ...(ngDevMode ? [{ debugName: "filterAppearance" }] : /* istanbul ignore next */ []));
985
- this.columns = computed(() => this.#configService.tableConfig().columns, /* @ts-ignore */
986
- ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
987
- this.isTableRowsClickable = input(false, { ...(ngDevMode ? { debugName: "isTableRowsClickable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
988
- /** Свойство, которым записи отличаются друг от друга. */
989
- this.keyExp = input('id', /* @ts-ignore */
990
- ...(ngDevMode ? [{ debugName: "keyExp" }] : /* istanbul ignore next */ []));
991
- this.entities = input.required({ ...(ngDevMode ? { debugName: "entities" } : /* istanbul ignore next */ {}), transform: transformArrayInput });
992
- this.currentSortModel = input.required(/* @ts-ignore */
993
- ...(ngDevMode ? [{ debugName: "currentSortModel" }] : /* istanbul ignore next */ []));
994
- /**
995
- * Условия отбора. Их ключ — имя свойства колонки, а не ключ записи: отбирают по колонке, и
996
- * ключ записи здесь оказался бы уже нужного — строка отбора зовёт ячейку именем колонки.
997
- */
998
- this.filterModel = input([], { ...(ngDevMode ? { debugName: "filterModel" } : /* istanbul ignore next */ {}), transform: transformArrayInput });
999
- this.isFiltersShown = input(false, { ...(ngDevMode ? { debugName: "isFiltersShown" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1000
- this.rowClick = output();
1001
- this.rowDoubleClick = output();
1002
- this.sortChange = output();
1003
- this.filterChange = output();
1004
- this.customCellsTpl = contentChild(RtDataTableCustomCellsDirective, /* @ts-ignore */
1005
- ...(ngDevMode ? [{ debugName: "customCellsTpl" }] : /* istanbul ignore next */ []));
1006
- this.rowActionsTpl = contentChild(RtDataTableRowActionsDirective, { ...(ngDevMode ? { debugName: "rowActionsTpl" } : /* istanbul ignore next */ {}), read: TemplateRef });
1007
- this.additionalRowActionsTpl = contentChild(RtDataTableAdditionalRowActionsDirective, { ...(ngDevMode ? { debugName: "additionalRowActionsTpl" } : /* istanbul ignore next */ {}), read: TemplateRef });
1008
- /** Шаблон значка приложения: его получают и шапка, и готовая ячейка. */
1009
- this.iconTpl = contentChild(RtDataTableIconDirective, /* @ts-ignore */
1010
- ...(ngDevMode ? [{ debugName: "iconTpl" }] : /* istanbul ignore next */ []));
1011
- /** Ключи отмеченных записей; их ставит директива выбора. */
1012
- this.selectedEntitiesIds = signal([], /* @ts-ignore */
1013
- ...(ngDevMode ? [{ debugName: "selectedEntitiesIds" }] : /* istanbul ignore next */ []));
1014
- this.isPageEntitiesSelected = signal(false, /* @ts-ignore */
1015
- ...(ngDevMode ? [{ debugName: "isPageEntitiesSelected" }] : /* istanbul ignore next */ []));
1016
- this.isPageEntitiesIndeterminate = signal(false, /* @ts-ignore */
1017
- ...(ngDevMode ? [{ debugName: "isPageEntitiesIndeterminate" }] : /* istanbul ignore next */ []));
1018
- this.isMultiSelect = signal(true, /* @ts-ignore */
1019
- ...(ngDevMode ? [{ debugName: "isMultiSelect" }] : /* istanbul ignore next */ []));
1020
- this.isSelectorsColumnShown = signal(false, /* @ts-ignore */
1021
- ...(ngDevMode ? [{ debugName: "isSelectorsColumnShown" }] : /* istanbul ignore next */ []));
1022
- this.isSelectorsColumnDisabled = signal(false, /* @ts-ignore */
1023
- ...(ngDevMode ? [{ debugName: "isSelectorsColumnDisabled" }] : /* istanbul ignore next */ []));
1024
- /** Строка с открытым меню; у первого кита она подсвечена, пока меню открыто. */
1025
- this.activeRowIndex = signal(null, /* @ts-ignore */
1026
- ...(ngDevMode ? [{ debugName: "activeRowIndex" }] : /* istanbul ignore next */ []));
1027
- /** Отметить запись; метод ставит директива выбора, без неё колонки выбора нет вовсе. */
1028
- this.onToggleEntity = () => undefined;
1029
- /** Отметить все строки показанной страницы; метод ставит директива выбора. */
1030
- this.onTogglePageEntities = () => undefined;
1031
- }
1032
- #configService;
1033
- /* Вид считается из настроек при объявлении входа: вход в разметке по-прежнему перебивает всё. */
1034
- #look;
1035
- ngAfterViewChecked() {
1036
- this.#syncSpacerWidth();
1037
- }
1038
- /**
1039
- * Имя колонки приходит строкой, а наружу уходит ключом домена: приведение сверяется с тем же
1040
- * набором колонок, который рисует таблица. Несовпавшее не отдаётся вовсе — приём первого кита.
1041
- */
1042
- onSortChange(sortModel) {
1043
- const names = this.columns().map((column) => String(column.propName));
1044
- if (names.includes(sortModel.propertyName)) {
1045
- this.sortChange.emit({ ...sortModel, propertyName: sortModel.propertyName });
1046
- }
1047
- }
1048
- onFilterChange(filterModel) {
1049
- this.filterChange.emit(filterModel);
1050
- }
1051
- onRowClick(row, event) {
1052
- this.rowClick.emit({ row, event });
1053
- }
1054
- onRowDoubleClick(row) {
1055
- this.rowDoubleClick.emit(row);
1056
- }
1057
- onMenuOpenedChange(index, opened) {
1058
- this.activeRowIndex.set(opened ? index : null);
1059
- }
1060
- defaultOperator(column) {
1061
- return column.defaultFilterOperator ?? EFilterOperatorType.EQUALS;
1062
- }
1063
- /**
1064
- * Полоса действий висит над концом строки, и место под неё держат две пустые ячейки — в
1065
- * шапке и в строке. Ширину им таблица ставит по ширине самой полосы, как первый кит.
1066
- */
1067
- #syncSpacerWidth() {
1068
- const strip = this.rowActionsRef()?.nativeElement;
1069
- if (!strip) {
1070
- return;
1071
- }
1072
- const width = `${strip.offsetWidth}px`;
1073
- [this.headerSpacerRef()?.nativeElement, this.rowSpacerRef()?.nativeElement].forEach((spacer) => {
1074
- if (spacer && spacer.style.width !== width) {
1075
- spacer.style.width = width;
1076
- }
1077
- });
1078
- }
1079
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDataTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1080
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: RtDataTableComponent, isStandalone: true, selector: "rt-data-table", inputs: { look: { classPropertyName: "look", publicName: "look", isSignal: true, isRequired: false, transformFunction: null }, filterAppearance: { classPropertyName: "filterAppearance", publicName: "filterAppearance", isSignal: true, isRequired: false, transformFunction: null }, isTableRowsClickable: { classPropertyName: "isTableRowsClickable", publicName: "isTableRowsClickable", isSignal: true, isRequired: false, transformFunction: null }, keyExp: { classPropertyName: "keyExp", publicName: "keyExp", isSignal: true, isRequired: false, transformFunction: null }, entities: { classPropertyName: "entities", publicName: "entities", isSignal: true, isRequired: true, transformFunction: null }, currentSortModel: { classPropertyName: "currentSortModel", publicName: "currentSortModel", isSignal: true, isRequired: true, transformFunction: null }, filterModel: { classPropertyName: "filterModel", publicName: "filterModel", isSignal: true, isRequired: false, transformFunction: null }, isFiltersShown: { classPropertyName: "isFiltersShown", publicName: "isFiltersShown", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { rowClick: "rowClick", rowDoubleClick: "rowDoubleClick", sortChange: "sortChange", filterChange: "filterChange" }, host: { properties: { "class.rt-preset-material": "look() === 'material' && !presetFromHost" }, classAttribute: "rt-data-table" }, providers: [{ provide: RT_DATA_TABLE_ROW_HOST, useExisting: forwardRef(() => RtDataTableComponent) }], queries: [{ propertyName: "customCellsTpl", first: true, predicate: RtDataTableCustomCellsDirective, descendants: true, isSignal: true }, { propertyName: "rowActionsTpl", first: true, predicate: RtDataTableRowActionsDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "additionalRowActionsTpl", first: true, predicate: RtDataTableAdditionalRowActionsDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "iconTpl", first: true, predicate: RtDataTableIconDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "rowActionsRef", first: true, predicate: ["rowActions"], descendants: true, isSignal: true }, { propertyName: "headerSpacerRef", first: true, predicate: ["headerSpacer"], descendants: true, isSignal: true }, { propertyName: "rowSpacerRef", first: true, predicate: ["rowSpacer"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-container rtBlock=\"rt-data-table\">\n <table rtElem=\"table\">\n <thead rtElem=\"head\">\n <tr>\n @if (isSelectorsColumnShown()) {\n <th rtElem=\"cell\" [rtMod]=\"{ head: true, selectable: true }\">\n @if (isMultiSelect()) {\n <rt-checkbox\n qa-dataid=\"data-table-page-checkbox\"\n [ariaLabel]=\"selectPageLabel()\"\n [disabled]=\"isSelectorsColumnDisabled()\"\n [indeterminate]=\"isPageEntitiesIndeterminate() && !isPageEntitiesSelected()\"\n [ngModel]=\"isPageEntitiesSelected()\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"onTogglePageEntities($event)\" />\n }\n </th>\n }\n\n @for (column of visibleColumns(); track column.propName) {\n <th\n rtElem=\"cell\"\n qa-dataid=\"data-table-header-cell\"\n [attr.aria-sort]=\"ariaSorts()[column.propName]\"\n [rtMod]=\"{ head: true, sortable: !!column.sorting }\">\n <rt-data-table-header-cell\n [headerModel]=\"column.header\"\n [sortModel]=\"column.sorting\"\n [currentSortModel]=\"currentSortModel()\"\n [column]=\"column\"\n [iconTemplate]=\"iconTpl()?.template ?? null\"\n (sortChange)=\"onSortChange($event)\" />\n </th>\n }\n\n @if (hasRowActions()) {\n <th #headerSpacer rtElem=\"cell\" qa-dataid=\"data-table-actions-header\" [rtMod]=\"{ head: true }\">{{ actionsLabel() }}</th>\n }\n </tr>\n\n @if (isFiltersShown()) {\n <tr qa-dataid=\"data-table-filter-row\">\n @if (isSelectorsColumnShown()) {\n <th rtElem=\"cell\" [rtMod]=\"{ head: true, filterable: true, empty: true }\"></th>\n }\n\n @for (column of visibleColumns(); track column.propName) {\n <th rtElem=\"cell\" [rtMod]=\"{ head: true, filterable: true }\">\n @if (column.filterType; as filterType) {\n <rt-data-table-filter-cell\n [filterProperty]=\"column.propName\"\n [filterType]=\"filterType\"\n [filterModel]=\"filterModel()\"\n [defaultFilterOperator]=\"column.defaultFilterOperator\"\n [filterOperators]=\"column.filterOperators\"\n [filterSelectOptions]=\"column.filterSelectOptions\"\n [appearance]=\"filterAppearance()\"\n (filterChange)=\"onFilterChange($event)\" />\n }\n </th>\n }\n\n @if (hasRowActions()) {\n <th rtElem=\"cell\" [rtMod]=\"{ head: true, filterable: true }\"></th>\n }\n </tr>\n }\n </thead>\n\n <tbody>\n @for (row of entities(); track row[keyExp()]; let index = $index) {\n <tr\n rtElem=\"row\"\n qa-dataid=\"data-table-row\"\n [rtDataTableRowClick]=\"row\"\n [isTableRowClickable]=\"isTableRowsClickable()\"\n [rtMod]=\"{ clickable: isTableRowsClickable(), active: activeRowIndex() === index }\">\n @if (isSelectorsColumnShown()) {\n <td rtElem=\"cell\" [rtMod]=\"{ selectable: true }\" [attr.rt-data-table-stop-row-click]=\"''\">\n @if (isMultiSelect()) {\n <rt-checkbox\n qa-dataid=\"data-table-row-checkbox\"\n [ariaLabel]=\"selectRowLabel()\"\n [disabled]=\"isSelectorsColumnDisabled()\"\n [ngModel]=\"selectedEntitiesIds().includes(row[keyExp()])\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"onToggleEntity(row, $event)\" />\n } @else {\n <rt-radio-button\n qa-dataid=\"data-table-row-radio\"\n [value]=\"row[keyExp()]\"\n [ariaLabel]=\"selectRowLabel()\"\n [disabled]=\"isSelectorsColumnDisabled()\"\n [checked]=\"selectedEntitiesIds().includes(row[keyExp()])\"\n (checkedChange)=\"onToggleEntity(row, true)\" />\n }\n </td>\n }\n\n @for (column of visibleColumns(); track column.propName) {\n <td rtElem=\"cell\" qa-dataid=\"data-table-cell\" [rtMod]=\"{ copyable: !!column.copyable }\">\n @if (column.type === columnTypes.CUSTOM) {\n <ng-container\n [ngTemplateOutlet]=\"customCellsTpl()?.getTemplateByPropName(column.propName) ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n } @else {\n <rt-data-table-cell [row]=\"row\" [column]=\"column\" [iconTemplate]=\"iconTpl()?.template ?? null\" />\n }\n </td>\n }\n\n @if (hasRowActions()) {\n <td #rowSpacer rtElem=\"cell\" [rtMod]=\"{ spacer: true }\"></td>\n\n <div rtBlock=\"rt-data-table-actions\" [rtMod]=\"{ hidden: activeRowIndex() !== index }\">\n <div #rowActions rtElem=\"container\" qa-dataid=\"data-table-actions\">\n @if (additionalRowActionsTpl(); as additional) {\n <ng-container [ngTemplateOutlet]=\"additional\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n }\n\n @if (rowActionsTpl(); as actions) {\n <rt-menu\n rtElem=\"action\"\n qa-dataid=\"data-table-row-menu\"\n icon=\"ellipsis-v\"\n size=\"sm\"\n [panelClass]=\"menuPanelClass()\"\n [attr.rt-data-table-stop-row-click]=\"''\"\n [ariaLabel]=\"actionsLabel()\"\n (openedChange)=\"onMenuOpenedChange(index, $event)\">\n <ng-container [ngTemplateOutlet]=\"actions\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n </rt-menu>\n }\n </div>\n </div>\n }\n </tr>\n }\n </tbody>\n </table>\n</ng-container>\n", styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-data-table{--rt-data-table-row-height: var(--rt-control-height-lg);--rt-data-table-head-height: calc(var(--rt-control-height-lg) - var(--rt-space-1));--rt-data-table-border-width: var(--rt-border-width-thin);--rt-data-table-cell-padding: calc(var(--rt-space-2) + var(--rt-space-0-5));--rt-data-table-row-transition-duration: var(--rt-duration-base);--rt-data-table-padding-bottom: var(--rt-list-content-padding-bottom);--rt-data-table-head-color: var(--rt-color-text-primary);--rt-data-table-head-font-weight: var(--rt-font-weight-medium);--rt-data-table-filter-bg: color-mix(in srgb, var(--rt-color-table-head-bg), var(--rt-color-bg-surface) 50%);display:block;overflow:auto;width:100%;height:100%;box-sizing:border-box;padding-bottom:var(--rt-data-table-padding-bottom);scrollbar-color:var(--rt-data-table-scrollbar-color, transparent transparent);scrollbar-width:var(--rt-data-table-scrollbar-width, thin)}.rt-data-table::-webkit-scrollbar{width:var(--rt-data-table-scrollbar-vertical-width, var(--rt-size-3));height:var(--rt-data-table-scrollbar-horizontal-height, var(--rt-size-3))}.rt-data-table:hover,.rt-data-table:focus-within{scrollbar-color:var(--rt-data-table-scrollbar-color, var(--rt-color-border-default) transparent)}@media(hover:none){.rt-data-table{scrollbar-color:var(--rt-data-table-scrollbar-color, var(--rt-color-border-default) transparent)}}.rt-data-table__table{width:100%;border-collapse:collapse}.rt-data-table thead{position:sticky;z-index:var(--rt-z-sticky);top:0}.rt-data-table thead tr:first-child{height:var(--rt-data-table-head-height)}.rt-data-table thead tr:last-child{border-bottom:var(--rt-data-table-border-width) solid var(--rt-color-border-default)}.rt-data-table tbody{font-size:var(--rt-text-sm)}.rt-data-table__row{height:var(--rt-data-table-row-height);border-bottom:var(--rt-data-table-border-width) solid var(--rt-color-border-subtle);color:var(--rt-color-text-primary);transform:translate(0)}.rt-data-table__row:hover{border-bottom-color:var(--rt-color-state-info);transition:border-bottom-color var(--rt-data-table-row-transition-duration)}.rt-data-table__row:hover .rt-data-table-actions{visibility:visible}.rt-data-table__row--active{border-bottom-color:var(--rt-color-state-info)}.rt-data-table__row--clickable{cursor:pointer}.rt-data-table__cell{width:fit-content;height:100%;padding:var(--rt-data-table-cell-padding)}.rt-data-table__cell--head{position:relative;background-color:var(--rt-color-table-head-bg);color:var(--rt-data-table-head-color);font-size:var(--rt-text-md);font-weight:var(--rt-data-table-head-font-weight);line-height:var(--rt-leading-tight);pointer-events:none;text-align:start}.rt-data-table__cell--sortable,.rt-data-table__cell--selectable,.rt-data-table__cell--filterable{pointer-events:auto}.rt-data-table__cell--selectable>rt-checkbox,.rt-data-table__cell--selectable>rt-radio-button{display:flex}.rt-data-table__cell--filterable{padding:var(--rt-space-xs) var(--rt-space-sm);background-color:var(--rt-data-table-filter-bg)}:is(.rt-preset-material,[data-preset=material]) .rt-data-table__cell--filterable{--rt-input-radius: var(--rt-radius-sm)}.rt-data-table__cell--head:not(:last-child,.rt-data-table__cell--selectable,.rt-data-table__cell--empty):after{position:absolute;top:25%;right:0;height:50%;border-right:var(--rt-data-table-border-width) solid var(--rt-list-table-head-divider-color);content:\"\";pointer-events:none}.rt-data-table__cell--spacer{padding:0}.rt-data-table-actions{--rt-data-table-actions-bg: var(--rt-table-actions-bg, var(--rt-color-bg-surface));position:absolute;z-index:var(--rt-z-base);top:0;right:0;display:flex;width:100%;height:100%;align-items:center;justify-content:flex-end;pointer-events:none}.rt-data-table-actions__container{position:sticky;right:0;display:flex;overflow:hidden;width:fit-content;height:calc(100% - var(--rt-data-table-border-width) * 2);align-items:center;justify-content:flex-end;padding:0 var(--rt-space-xs) 0 var(--rt-space-5);background:linear-gradient(to right,transparent 0%,color-mix(in srgb,var(--rt-data-table-actions-bg) 30%,transparent) 10%,var(--rt-data-table-actions-bg) 20%,var(--rt-data-table-actions-bg) 100%);gap:var(--rt-space-xs);pointer-events:none}.rt-data-table-actions__container>*{pointer-events:auto}.rt-data-table-actions__action{position:sticky}.rt-data-table-actions rt-icon-button{--rt-icon-button-color: var(--rt-list-table-icon-color)}.rt-data-table-actions .rt-icon-button{--rt-icon-button-size-step: var(--rt-list-table-button-size);--rt-icon-button-radius: var(--rt-list-table-button-radius)}.rt-data-table-actions .rt-icon-button__icon{min-width:var(--rt-list-table-icon-size);min-height:var(--rt-list-table-icon-size)}@media(hover:hover){.rt-data-table-actions--hidden{opacity:0}.rt-data-table-actions--hidden .rt-data-table-actions__container>*{pointer-events:none}.rt-data-table__row:hover .rt-data-table-actions--hidden,.rt-data-table__row:has(:focus-visible) .rt-data-table-actions--hidden{opacity:1}.rt-data-table__row:hover .rt-data-table-actions--hidden .rt-data-table-actions__container>*,.rt-data-table__row:has(:focus-visible) .rt-data-table-actions--hidden .rt-data-table-actions__container>*{pointer-events:auto}}}\n"], dependencies: [{ kind: "component", type:
1081
- // components
1082
- RtCheckboxComponent, selector: "rt-checkbox", inputs: ["inputId", "ariaLabel", "disabled", "indeterminate"] }, { kind: "component", type: RtDataTableCellComponent, selector: "rt-data-table-cell", inputs: ["row", "column", "iconTemplate"] }, { kind: "component", type: RtDataTableFilterCellComponent, selector: "rt-data-table-filter-cell", inputs: ["appearance", "filterProperty", "filterType", "filterModel", "defaultFilterOperator", "filterOperators", "filterSelectOptions"], outputs: ["filterChange"] }, { kind: "component", type: RtDataTableHeaderCellComponent, selector: "rt-data-table-header-cell", inputs: ["headerModel", "sortModel", "currentSortModel", "column", "iconTemplate"], outputs: ["sortChange"] }, { kind: "component", type: RtMenuComponent, selector: "rt-menu", inputs: ["icon", "ariaLabel", "align", "panelClass", "triggerSize", "size", "disabled"], outputs: ["openedChange"] }, { kind: "component", type: RtRadioButtonComponent, selector: "rt-radio-button", inputs: ["value", "checked", "disabled", "card", "label", "description", "ariaLabel"], outputs: ["clickAction", "checkedChange"] }, { kind: "directive", type:
1083
- // directives
1084
- BlockDirective, selector: "[rtBlock]", inputs: ["rtMod"] }, { kind: "directive", type: ElemDirective, selector: "[rtElem]", inputs: ["rtMod"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: ModDirective, selector: "[rtMod]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: RtDataTableRowClickDirective, selector: "[rtDataTableRowClick]", inputs: ["rtDataTableRowClick", "isTableRowClickable"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1085
- }
1086
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDataTableComponent, decorators: [{
1087
- type: Component,
1088
- args: [{ selector: 'rt-data-table', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
1089
- // components
1090
- RtCheckboxComponent,
1091
- RtDataTableCellComponent,
1092
- RtDataTableFilterCellComponent,
1093
- RtDataTableHeaderCellComponent,
1094
- RtMenuComponent,
1095
- RtRadioButtonComponent,
1096
- // directives
1097
- BlockDirective,
1098
- ElemDirective,
1099
- FormsModule,
1100
- ModDirective,
1101
- NgTemplateOutlet,
1102
- RtDataTableRowClickDirective,
1103
- ], host: { class: BEM_BLOCK, '[class.rt-preset-material]': "look() === 'material' && !presetFromHost" }, providers: [{ provide: RT_DATA_TABLE_ROW_HOST, useExisting: forwardRef(() => RtDataTableComponent) }], template: "<ng-container rtBlock=\"rt-data-table\">\n <table rtElem=\"table\">\n <thead rtElem=\"head\">\n <tr>\n @if (isSelectorsColumnShown()) {\n <th rtElem=\"cell\" [rtMod]=\"{ head: true, selectable: true }\">\n @if (isMultiSelect()) {\n <rt-checkbox\n qa-dataid=\"data-table-page-checkbox\"\n [ariaLabel]=\"selectPageLabel()\"\n [disabled]=\"isSelectorsColumnDisabled()\"\n [indeterminate]=\"isPageEntitiesIndeterminate() && !isPageEntitiesSelected()\"\n [ngModel]=\"isPageEntitiesSelected()\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"onTogglePageEntities($event)\" />\n }\n </th>\n }\n\n @for (column of visibleColumns(); track column.propName) {\n <th\n rtElem=\"cell\"\n qa-dataid=\"data-table-header-cell\"\n [attr.aria-sort]=\"ariaSorts()[column.propName]\"\n [rtMod]=\"{ head: true, sortable: !!column.sorting }\">\n <rt-data-table-header-cell\n [headerModel]=\"column.header\"\n [sortModel]=\"column.sorting\"\n [currentSortModel]=\"currentSortModel()\"\n [column]=\"column\"\n [iconTemplate]=\"iconTpl()?.template ?? null\"\n (sortChange)=\"onSortChange($event)\" />\n </th>\n }\n\n @if (hasRowActions()) {\n <th #headerSpacer rtElem=\"cell\" qa-dataid=\"data-table-actions-header\" [rtMod]=\"{ head: true }\">{{ actionsLabel() }}</th>\n }\n </tr>\n\n @if (isFiltersShown()) {\n <tr qa-dataid=\"data-table-filter-row\">\n @if (isSelectorsColumnShown()) {\n <th rtElem=\"cell\" [rtMod]=\"{ head: true, filterable: true, empty: true }\"></th>\n }\n\n @for (column of visibleColumns(); track column.propName) {\n <th rtElem=\"cell\" [rtMod]=\"{ head: true, filterable: true }\">\n @if (column.filterType; as filterType) {\n <rt-data-table-filter-cell\n [filterProperty]=\"column.propName\"\n [filterType]=\"filterType\"\n [filterModel]=\"filterModel()\"\n [defaultFilterOperator]=\"column.defaultFilterOperator\"\n [filterOperators]=\"column.filterOperators\"\n [filterSelectOptions]=\"column.filterSelectOptions\"\n [appearance]=\"filterAppearance()\"\n (filterChange)=\"onFilterChange($event)\" />\n }\n </th>\n }\n\n @if (hasRowActions()) {\n <th rtElem=\"cell\" [rtMod]=\"{ head: true, filterable: true }\"></th>\n }\n </tr>\n }\n </thead>\n\n <tbody>\n @for (row of entities(); track row[keyExp()]; let index = $index) {\n <tr\n rtElem=\"row\"\n qa-dataid=\"data-table-row\"\n [rtDataTableRowClick]=\"row\"\n [isTableRowClickable]=\"isTableRowsClickable()\"\n [rtMod]=\"{ clickable: isTableRowsClickable(), active: activeRowIndex() === index }\">\n @if (isSelectorsColumnShown()) {\n <td rtElem=\"cell\" [rtMod]=\"{ selectable: true }\" [attr.rt-data-table-stop-row-click]=\"''\">\n @if (isMultiSelect()) {\n <rt-checkbox\n qa-dataid=\"data-table-row-checkbox\"\n [ariaLabel]=\"selectRowLabel()\"\n [disabled]=\"isSelectorsColumnDisabled()\"\n [ngModel]=\"selectedEntitiesIds().includes(row[keyExp()])\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"onToggleEntity(row, $event)\" />\n } @else {\n <rt-radio-button\n qa-dataid=\"data-table-row-radio\"\n [value]=\"row[keyExp()]\"\n [ariaLabel]=\"selectRowLabel()\"\n [disabled]=\"isSelectorsColumnDisabled()\"\n [checked]=\"selectedEntitiesIds().includes(row[keyExp()])\"\n (checkedChange)=\"onToggleEntity(row, true)\" />\n }\n </td>\n }\n\n @for (column of visibleColumns(); track column.propName) {\n <td rtElem=\"cell\" qa-dataid=\"data-table-cell\" [rtMod]=\"{ copyable: !!column.copyable }\">\n @if (column.type === columnTypes.CUSTOM) {\n <ng-container\n [ngTemplateOutlet]=\"customCellsTpl()?.getTemplateByPropName(column.propName) ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n } @else {\n <rt-data-table-cell [row]=\"row\" [column]=\"column\" [iconTemplate]=\"iconTpl()?.template ?? null\" />\n }\n </td>\n }\n\n @if (hasRowActions()) {\n <td #rowSpacer rtElem=\"cell\" [rtMod]=\"{ spacer: true }\"></td>\n\n <div rtBlock=\"rt-data-table-actions\" [rtMod]=\"{ hidden: activeRowIndex() !== index }\">\n <div #rowActions rtElem=\"container\" qa-dataid=\"data-table-actions\">\n @if (additionalRowActionsTpl(); as additional) {\n <ng-container [ngTemplateOutlet]=\"additional\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n }\n\n @if (rowActionsTpl(); as actions) {\n <rt-menu\n rtElem=\"action\"\n qa-dataid=\"data-table-row-menu\"\n icon=\"ellipsis-v\"\n size=\"sm\"\n [panelClass]=\"menuPanelClass()\"\n [attr.rt-data-table-stop-row-click]=\"''\"\n [ariaLabel]=\"actionsLabel()\"\n (openedChange)=\"onMenuOpenedChange(index, $event)\">\n <ng-container [ngTemplateOutlet]=\"actions\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n </rt-menu>\n }\n </div>\n </div>\n }\n </tr>\n }\n </tbody>\n </table>\n</ng-container>\n", styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-data-table{--rt-data-table-row-height: var(--rt-control-height-lg);--rt-data-table-head-height: calc(var(--rt-control-height-lg) - var(--rt-space-1));--rt-data-table-border-width: var(--rt-border-width-thin);--rt-data-table-cell-padding: calc(var(--rt-space-2) + var(--rt-space-0-5));--rt-data-table-row-transition-duration: var(--rt-duration-base);--rt-data-table-padding-bottom: var(--rt-list-content-padding-bottom);--rt-data-table-head-color: var(--rt-color-text-primary);--rt-data-table-head-font-weight: var(--rt-font-weight-medium);--rt-data-table-filter-bg: color-mix(in srgb, var(--rt-color-table-head-bg), var(--rt-color-bg-surface) 50%);display:block;overflow:auto;width:100%;height:100%;box-sizing:border-box;padding-bottom:var(--rt-data-table-padding-bottom);scrollbar-color:var(--rt-data-table-scrollbar-color, transparent transparent);scrollbar-width:var(--rt-data-table-scrollbar-width, thin)}.rt-data-table::-webkit-scrollbar{width:var(--rt-data-table-scrollbar-vertical-width, var(--rt-size-3));height:var(--rt-data-table-scrollbar-horizontal-height, var(--rt-size-3))}.rt-data-table:hover,.rt-data-table:focus-within{scrollbar-color:var(--rt-data-table-scrollbar-color, var(--rt-color-border-default) transparent)}@media(hover:none){.rt-data-table{scrollbar-color:var(--rt-data-table-scrollbar-color, var(--rt-color-border-default) transparent)}}.rt-data-table__table{width:100%;border-collapse:collapse}.rt-data-table thead{position:sticky;z-index:var(--rt-z-sticky);top:0}.rt-data-table thead tr:first-child{height:var(--rt-data-table-head-height)}.rt-data-table thead tr:last-child{border-bottom:var(--rt-data-table-border-width) solid var(--rt-color-border-default)}.rt-data-table tbody{font-size:var(--rt-text-sm)}.rt-data-table__row{height:var(--rt-data-table-row-height);border-bottom:var(--rt-data-table-border-width) solid var(--rt-color-border-subtle);color:var(--rt-color-text-primary);transform:translate(0)}.rt-data-table__row:hover{border-bottom-color:var(--rt-color-state-info);transition:border-bottom-color var(--rt-data-table-row-transition-duration)}.rt-data-table__row:hover .rt-data-table-actions{visibility:visible}.rt-data-table__row--active{border-bottom-color:var(--rt-color-state-info)}.rt-data-table__row--clickable{cursor:pointer}.rt-data-table__cell{width:fit-content;height:100%;padding:var(--rt-data-table-cell-padding)}.rt-data-table__cell--head{position:relative;background-color:var(--rt-color-table-head-bg);color:var(--rt-data-table-head-color);font-size:var(--rt-text-md);font-weight:var(--rt-data-table-head-font-weight);line-height:var(--rt-leading-tight);pointer-events:none;text-align:start}.rt-data-table__cell--sortable,.rt-data-table__cell--selectable,.rt-data-table__cell--filterable{pointer-events:auto}.rt-data-table__cell--selectable>rt-checkbox,.rt-data-table__cell--selectable>rt-radio-button{display:flex}.rt-data-table__cell--filterable{padding:var(--rt-space-xs) var(--rt-space-sm);background-color:var(--rt-data-table-filter-bg)}:is(.rt-preset-material,[data-preset=material]) .rt-data-table__cell--filterable{--rt-input-radius: var(--rt-radius-sm)}.rt-data-table__cell--head:not(:last-child,.rt-data-table__cell--selectable,.rt-data-table__cell--empty):after{position:absolute;top:25%;right:0;height:50%;border-right:var(--rt-data-table-border-width) solid var(--rt-list-table-head-divider-color);content:\"\";pointer-events:none}.rt-data-table__cell--spacer{padding:0}.rt-data-table-actions{--rt-data-table-actions-bg: var(--rt-table-actions-bg, var(--rt-color-bg-surface));position:absolute;z-index:var(--rt-z-base);top:0;right:0;display:flex;width:100%;height:100%;align-items:center;justify-content:flex-end;pointer-events:none}.rt-data-table-actions__container{position:sticky;right:0;display:flex;overflow:hidden;width:fit-content;height:calc(100% - var(--rt-data-table-border-width) * 2);align-items:center;justify-content:flex-end;padding:0 var(--rt-space-xs) 0 var(--rt-space-5);background:linear-gradient(to right,transparent 0%,color-mix(in srgb,var(--rt-data-table-actions-bg) 30%,transparent) 10%,var(--rt-data-table-actions-bg) 20%,var(--rt-data-table-actions-bg) 100%);gap:var(--rt-space-xs);pointer-events:none}.rt-data-table-actions__container>*{pointer-events:auto}.rt-data-table-actions__action{position:sticky}.rt-data-table-actions rt-icon-button{--rt-icon-button-color: var(--rt-list-table-icon-color)}.rt-data-table-actions .rt-icon-button{--rt-icon-button-size-step: var(--rt-list-table-button-size);--rt-icon-button-radius: var(--rt-list-table-button-radius)}.rt-data-table-actions .rt-icon-button__icon{min-width:var(--rt-list-table-icon-size);min-height:var(--rt-list-table-icon-size)}@media(hover:hover){.rt-data-table-actions--hidden{opacity:0}.rt-data-table-actions--hidden .rt-data-table-actions__container>*{pointer-events:none}.rt-data-table__row:hover .rt-data-table-actions--hidden,.rt-data-table__row:has(:focus-visible) .rt-data-table-actions--hidden{opacity:1}.rt-data-table__row:hover .rt-data-table-actions--hidden .rt-data-table-actions__container>*,.rt-data-table__row:has(:focus-visible) .rt-data-table-actions--hidden .rt-data-table-actions__container>*{pointer-events:auto}}}\n"] }]
1104
- }], propDecorators: { rowActionsRef: [{ type: i0.ViewChild, args: ['rowActions', { isSignal: true }] }], headerSpacerRef: [{ type: i0.ViewChild, args: ['headerSpacer', { isSignal: true }] }], rowSpacerRef: [{ type: i0.ViewChild, args: ['rowSpacer', { isSignal: true }] }], look: [{ type: i0.Input, args: [{ isSignal: true, alias: "look", required: false }] }], filterAppearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterAppearance", required: false }] }], isTableRowsClickable: [{ type: i0.Input, args: [{ isSignal: true, alias: "isTableRowsClickable", required: false }] }], keyExp: [{ type: i0.Input, args: [{ isSignal: true, alias: "keyExp", required: false }] }], entities: [{ type: i0.Input, args: [{ isSignal: true, alias: "entities", required: true }] }], currentSortModel: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentSortModel", required: true }] }], filterModel: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterModel", required: false }] }], isFiltersShown: [{ type: i0.Input, args: [{ isSignal: true, alias: "isFiltersShown", required: false }] }], rowClick: [{ type: i0.Output, args: ["rowClick"] }], rowDoubleClick: [{ type: i0.Output, args: ["rowDoubleClick"] }], sortChange: [{ type: i0.Output, args: ["sortChange"] }], filterChange: [{ type: i0.Output, args: ["filterChange"] }], customCellsTpl: [{ type: i0.ContentChild, args: [i0.forwardRef(() => RtDataTableCustomCellsDirective), { isSignal: true }] }], rowActionsTpl: [{ type: i0.ContentChild, args: [i0.forwardRef(() => RtDataTableRowActionsDirective), { ...{ read: TemplateRef }, isSignal: true }] }], additionalRowActionsTpl: [{ type: i0.ContentChild, args: [i0.forwardRef(() => RtDataTableAdditionalRowActionsDirective), { ...{ read: TemplateRef }, isSignal: true }] }], iconTpl: [{ type: i0.ContentChild, args: [i0.forwardRef(() => RtDataTableIconDirective), { isSignal: true }] }] } });
1105
-
1106
- /**
1107
- * Выбор строк таблицы `rt-data-table` — колонка выбора первого кита.
1108
- *
1109
- * Директива ведёт отметки и ставит таблице всё, что та рисует: ключи отмеченных, состояние
1110
- * флажка страницы и признаки колонки выбора. Приложение читает отмеченные записи целиком —
1111
- * запись, отмеченная на странице, которой уже нет на экране, остаётся отмеченной.
1112
- */
1113
- class RtDataTableSelectorsDirective {
1114
- #destroyRef;
1115
- #injector;
1116
- #table;
1117
- #selectedEntities;
1118
- #isPageEntitiesSelected;
1119
- #isPageEntitiesIndeterminate;
1120
- constructor() {
1121
- this.#destroyRef = inject(DestroyRef);
1122
- this.#injector = inject(Injector);
1123
- this.#table = inject(RtDataTableComponent);
1124
- this.#selectedEntities = signal([], /* @ts-ignore */
1125
- ...(ngDevMode ? [{ debugName: "#selectedEntities" }] : /* istanbul ignore next */ []));
1126
- this.#isPageEntitiesSelected = signal(false, /* @ts-ignore */
1127
- ...(ngDevMode ? [{ debugName: "#isPageEntitiesSelected" }] : /* istanbul ignore next */ []));
1128
- this.#isPageEntitiesIndeterminate = signal(false, /* @ts-ignore */
1129
- ...(ngDevMode ? [{ debugName: "#isPageEntitiesIndeterminate" }] : /* istanbul ignore next */ []));
1130
- this.isMultiSelect = input(true, { ...(ngDevMode ? { debugName: "isMultiSelect" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1131
- this.isSelectorColumnShown = input(false, { ...(ngDevMode ? { debugName: "isSelectorColumnShown" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1132
- this.isSelectorsColumnDisabled = input(false, { ...(ngDevMode ? { debugName: "isSelectorsColumnDisabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1133
- /** Ключи записей, отмеченных заранее; они применяются один раз — к первым пришедшим строкам. */
1134
- this.selectedEntitiesKeys = input([], { ...(ngDevMode ? { debugName: "selectedEntitiesKeys" } : /* istanbul ignore next */ {}), transform: transformArrayInput });
1135
- /** Отмеченные записи целиком. */
1136
- this.selectedEntities = this.#selectedEntities.asReadonly();
1137
- this.selectedEntitiesIds = computed(() => dataTableKeysOf(this.selectedEntities(), this.#keyExp()), /* @ts-ignore */
1138
- ...(ngDevMode ? [{ debugName: "selectedEntitiesIds" }] : /* istanbul ignore next */ []));
1139
- this.isPageEntitiesSelected = this.#isPageEntitiesSelected.asReadonly();
1140
- this.isPageEntitiesIndeterminate = this.#isPageEntitiesIndeterminate.asReadonly();
1141
- this.#table.onToggleEntity = (entity, checked) => this.toggleEntity(entity, checked);
1142
- this.#table.onTogglePageEntities = (checked) => this.togglePageEntities(checked);
1143
- /* Отметки ведёт директива, а рисует их таблица: каждое значение переливается в её поле.
1144
- Обратного хода нет — таблица сама их не меняет. */
1145
- effect(() => this.#table.selectedEntitiesIds.set(this.selectedEntitiesIds()));
1146
- effect(() => this.#table.isPageEntitiesSelected.set(this.isPageEntitiesSelected()));
1147
- effect(() => this.#table.isPageEntitiesIndeterminate.set(this.isPageEntitiesIndeterminate()));
1148
- effect(() => this.#table.isMultiSelect.set(this.isMultiSelect()));
1149
- effect(() => this.#table.isSelectorsColumnShown.set(this.isSelectorColumnShown()));
1150
- effect(() => this.#table.isSelectorsColumnDisabled.set(this.isSelectorsColumnDisabled()));
1151
- /* Новая страница — новый флажок страницы: он считается по её строкам, а не остаётся от
1152
- прежней. Отметки читаются без слежки — пересчёт идёт только на смену строк. */
1153
- effect(() => {
1154
- this.#table.entities();
1155
- untracked(() => this.setExistingEntitiesState());
1156
- });
1157
- }
1158
- ngOnInit() {
1159
- /** Отметки, названные заранее, ставятся один раз: к первым непустым строкам. */
1160
- toObservable(this.#table.entities, { injector: this.#injector })
1161
- .pipe(filter((entities) => !!entities.length), take(1), switchMap(() => toObservable(this.selectedEntitiesKeys, { injector: this.#injector }).pipe(filter((keys) => !!keys.length), take(1))), takeUntilDestroyed(this.#destroyRef))
1162
- .subscribe(() => {
1163
- this.#selectedEntities.set(dataTablePresetEntities(this.#table.entities(), this.selectedEntitiesKeys(), this.#keyExp()));
1164
- this.setExistingEntitiesState();
1165
- });
1166
- }
1167
- /** Отметить или снять все строки показанной страницы; других отметок это не трогает. */
1168
- togglePageEntities(checked) {
1169
- const page = this.#table.entities();
1170
- this.#isPageEntitiesSelected.set(checked);
1171
- this.#selectedEntities.update((selected) => checked
1172
- ? dataTableWithPageEntities(selected, page, this.#keyExp())
1173
- : dataTableWithoutPageEntities(selected, page, this.#keyExp()));
1174
- this.#isPageEntitiesIndeterminate.set(dataTableAnyOnPage(page, this.selectedEntitiesIds(), this.#keyExp()));
1175
- }
1176
- /** Отметить или снять одну запись; при выборе по одной прежняя отметка уходит. */
1177
- toggleEntity(entity, checked) {
1178
- if (!this.isMultiSelect()) {
1179
- this.#selectedEntities.set([entity]);
1180
- return;
1181
- }
1182
- this.#selectedEntities.update((selected) => dataTableWithEntity(selected, entity, checked, this.#keyExp()));
1183
- const page = this.#table.entities();
1184
- const keys = this.selectedEntitiesIds();
1185
- if (keys.length) {
1186
- this.#isPageEntitiesSelected.set(dataTableAllOnPage(page, keys, this.#keyExp()));
1187
- this.#isPageEntitiesIndeterminate.set(true);
1188
- }
1189
- else {
1190
- this.#isPageEntitiesSelected.set(false);
1191
- this.#isPageEntitiesIndeterminate.set(dataTableAnyOnPage(page, keys, this.#keyExp()));
1192
- }
1193
- }
1194
- /** Снять все отметки. */
1195
- clearSelectedList() {
1196
- this.#selectedEntities.set([]);
1197
- this.#isPageEntitiesSelected.set(false);
1198
- this.#isPageEntitiesIndeterminate.set(false);
1199
- }
1200
- /**
1201
- * Пересчитать флажок страницы по показанным строкам: отмечен, когда отмечены все строки
1202
- * страницы, промежуточен, когда отмечена часть. Отметки других страниц здесь не в счёт.
1203
- */
1204
- setExistingEntitiesState() {
1205
- const page = this.#table.entities();
1206
- const keys = this.selectedEntitiesIds();
1207
- const all = !!page.length && dataTableAllOnPage(page, keys, this.#keyExp());
1208
- this.#isPageEntitiesSelected.set(all);
1209
- this.#isPageEntitiesIndeterminate.set(!all && dataTableAnyOnPage(page, keys, this.#keyExp()));
1210
- }
1211
- #keyExp() {
1212
- return this.#table.keyExp();
1213
- }
1214
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDataTableSelectorsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1215
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.6", type: RtDataTableSelectorsDirective, isStandalone: true, selector: "rt-data-table[rtDataTableSelectors]", inputs: { isMultiSelect: { classPropertyName: "isMultiSelect", publicName: "isMultiSelect", isSignal: true, isRequired: false, transformFunction: null }, isSelectorColumnShown: { classPropertyName: "isSelectorColumnShown", publicName: "isSelectorColumnShown", isSignal: true, isRequired: false, transformFunction: null }, isSelectorsColumnDisabled: { classPropertyName: "isSelectorsColumnDisabled", publicName: "isSelectorsColumnDisabled", isSignal: true, isRequired: false, transformFunction: null }, selectedEntitiesKeys: { classPropertyName: "selectedEntitiesKeys", publicName: "selectedEntitiesKeys", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
1569
+ return entities.filter((entity) => keys.includes(entity[keyExp]));
1216
1570
  }
1217
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtDataTableSelectorsDirective, decorators: [{
1218
- type: Directive,
1219
- args: [{
1220
- selector: 'rt-data-table[rtDataTableSelectors]',
1221
- }]
1222
- }], ctorParameters: () => [], propDecorators: { isMultiSelect: [{ type: i0.Input, args: [{ isSignal: true, alias: "isMultiSelect", required: false }] }], isSelectorColumnShown: [{ type: i0.Input, args: [{ isSignal: true, alias: "isSelectorColumnShown", required: false }] }], isSelectorsColumnDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isSelectorsColumnDisabled", required: false }] }], selectedEntitiesKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedEntitiesKeys", required: false }] }] } });
1223
-
1224
- /**
1225
- * Generated bundle index. Do not edit.
1226
- */
1227
-
1571
+ const BEM_BLOCK = "rt-data-table";
1572
+ var RtDataTableComponent = class RtDataTableComponent {
1573
+ constructor() {
1574
+ this.#configService = inject(RtDataTableConfigService);
1575
+ this.#look = rtKitDefault("dataTable", (it) => it.look, "material");
1576
+ this.rowActionsRef = viewChild("rowActions", ...ngDevMode ? [{ debugName: "rowActionsRef" }] : /* istanbul ignore next */ []);
1577
+ this.headerSpacerRef = viewChild("headerSpacer", ...ngDevMode ? [{ debugName: "headerSpacerRef" }] : /* istanbul ignore next */ []);
1578
+ this.rowSpacerRef = viewChild("rowSpacer", ...ngDevMode ? [{ debugName: "rowSpacerRef" }] : /* istanbul ignore next */ []);
1579
+ this.columnTypes = ERtDataTableColumnType;
1580
+ this.presetFromHost = inject(RT_DATA_TABLE_PRESET_FROM_HOST, { optional: true }) ?? false;
1581
+ this.menuPanelClass = computed(() => this.look() === "material" ? [RT_PRESET_MATERIAL_CLASS] : [], ...ngDevMode ? [{ debugName: "menuPanelClass" }] : /* istanbul ignore next */ []);
1582
+ this.actionsLabel = rtKitLabel("dataTableActions");
1583
+ this.selectRowLabel = rtKitLabel("dataTableSelectRow");
1584
+ this.selectPageLabel = rtKitLabel("dataTableSelectPage");
1585
+ this.hasRowActions = computed(() => !!this.rowActionsTpl() || !!this.additionalRowActionsTpl(), ...ngDevMode ? [{ debugName: "hasRowActions" }] : /* istanbul ignore next */ []);
1586
+ this.visibleColumns = computed(() => this.columns().filter((column) => !column.hidden), ...ngDevMode ? [{ debugName: "visibleColumns" }] : /* istanbul ignore next */ []);
1587
+ this.ariaSorts = computed(() => Object.fromEntries(this.visibleColumns().map((column) => [column.propName, dataTableAriaSort(column.sorting, this.currentSortModel())])), ...ngDevMode ? [{ debugName: "ariaSorts" }] : /* istanbul ignore next */ []);
1588
+ this.look = input(this.#look, ...ngDevMode ? [{ debugName: "look" }] : /* istanbul ignore next */ []);
1589
+ this.filterAppearance = input("outline", ...ngDevMode ? [{ debugName: "filterAppearance" }] : /* istanbul ignore next */ []);
1590
+ this.columns = computed(() => this.#configService.tableConfig().columns, ...ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []);
1591
+ this.isTableRowsClickable = input(false, {
1592
+ ...ngDevMode ? { debugName: "isTableRowsClickable" } : /* istanbul ignore next */ {},
1593
+ transform: booleanAttribute
1594
+ });
1595
+ this.keyExp = input("id", ...ngDevMode ? [{ debugName: "keyExp" }] : /* istanbul ignore next */ []);
1596
+ this.entities = input.required({
1597
+ ...ngDevMode ? { debugName: "entities" } : /* istanbul ignore next */ {},
1598
+ transform: transformArrayInput
1599
+ });
1600
+ this.currentSortModel = input.required(...ngDevMode ? [{ debugName: "currentSortModel" }] : /* istanbul ignore next */ []);
1601
+ this.filterModel = input([], {
1602
+ ...ngDevMode ? { debugName: "filterModel" } : /* istanbul ignore next */ {},
1603
+ transform: transformArrayInput
1604
+ });
1605
+ this.isFiltersShown = input(false, {
1606
+ ...ngDevMode ? { debugName: "isFiltersShown" } : /* istanbul ignore next */ {},
1607
+ transform: booleanAttribute
1608
+ });
1609
+ this.rowClick = output();
1610
+ this.rowDoubleClick = output();
1611
+ this.sortChange = output();
1612
+ this.filterChange = output();
1613
+ this.customCellsTpl = contentChild(RtDataTableCustomCellsDirective, ...ngDevMode ? [{ debugName: "customCellsTpl" }] : /* istanbul ignore next */ []);
1614
+ this.rowActionsTpl = contentChild(RtDataTableRowActionsDirective, {
1615
+ ...ngDevMode ? { debugName: "rowActionsTpl" } : /* istanbul ignore next */ {},
1616
+ read: TemplateRef
1617
+ });
1618
+ this.additionalRowActionsTpl = contentChild(RtDataTableAdditionalRowActionsDirective, {
1619
+ ...ngDevMode ? { debugName: "additionalRowActionsTpl" } : /* istanbul ignore next */ {},
1620
+ read: TemplateRef
1621
+ });
1622
+ this.iconTpl = contentChild(RtDataTableIconDirective, ...ngDevMode ? [{ debugName: "iconTpl" }] : /* istanbul ignore next */ []);
1623
+ this.selectedEntitiesIds = signal([], ...ngDevMode ? [{ debugName: "selectedEntitiesIds" }] : /* istanbul ignore next */ []);
1624
+ this.isPageEntitiesSelected = signal(false, ...ngDevMode ? [{ debugName: "isPageEntitiesSelected" }] : /* istanbul ignore next */ []);
1625
+ this.isPageEntitiesIndeterminate = signal(false, ...ngDevMode ? [{ debugName: "isPageEntitiesIndeterminate" }] : /* istanbul ignore next */ []);
1626
+ this.isMultiSelect = signal(true, ...ngDevMode ? [{ debugName: "isMultiSelect" }] : /* istanbul ignore next */ []);
1627
+ this.isSelectorsColumnShown = signal(false, ...ngDevMode ? [{ debugName: "isSelectorsColumnShown" }] : /* istanbul ignore next */ []);
1628
+ this.isSelectorsColumnDisabled = signal(false, ...ngDevMode ? [{ debugName: "isSelectorsColumnDisabled" }] : /* istanbul ignore next */ []);
1629
+ this.activeRowIndex = signal(null, ...ngDevMode ? [{ debugName: "activeRowIndex" }] : /* istanbul ignore next */ []);
1630
+ this.onToggleEntity = () => void 0;
1631
+ this.onTogglePageEntities = () => void 0;
1632
+ }
1633
+ #configService;
1634
+ #look;
1635
+ ngAfterViewChecked() {
1636
+ this.#syncSpacerWidth();
1637
+ }
1638
+ onSortChange(sortModel) {
1639
+ if (this.columns().map((column) => String(column.propName)).includes(sortModel.propertyName)) this.sortChange.emit({
1640
+ ...sortModel,
1641
+ propertyName: sortModel.propertyName
1642
+ });
1643
+ }
1644
+ onFilterChange(filterModel) {
1645
+ this.filterChange.emit(filterModel);
1646
+ }
1647
+ onRowClick(row, event) {
1648
+ this.rowClick.emit({
1649
+ row,
1650
+ event
1651
+ });
1652
+ }
1653
+ onRowDoubleClick(row) {
1654
+ this.rowDoubleClick.emit(row);
1655
+ }
1656
+ onMenuOpenedChange(index, opened) {
1657
+ this.activeRowIndex.set(opened ? index : null);
1658
+ }
1659
+ defaultOperator(column) {
1660
+ return column.defaultFilterOperator ?? EFilterOperatorType.EQUALS;
1661
+ }
1662
+ #syncSpacerWidth() {
1663
+ const strip = this.rowActionsRef()?.nativeElement;
1664
+ if (!strip) return;
1665
+ const width = `${strip.offsetWidth}px`;
1666
+ [this.headerSpacerRef()?.nativeElement, this.rowSpacerRef()?.nativeElement].forEach((spacer) => {
1667
+ if (spacer && spacer.style.width !== width) spacer.style.width = width;
1668
+ });
1669
+ }
1670
+ static {
1671
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1672
+ minVersion: "12.0.0",
1673
+ version: "22.2.2",
1674
+ ngImport: i0,
1675
+ type: RtDataTableComponent,
1676
+ deps: [],
1677
+ target: i0.ɵɵFactoryTarget.Component
1678
+ });
1679
+ }
1680
+ static {
1681
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
1682
+ minVersion: "17.0.0",
1683
+ version: "22.2.2",
1684
+ type: RtDataTableComponent,
1685
+ isStandalone: true,
1686
+ selector: "rt-data-table",
1687
+ inputs: {
1688
+ look: {
1689
+ classPropertyName: "look",
1690
+ publicName: "look",
1691
+ isSignal: true,
1692
+ isRequired: false,
1693
+ transformFunction: null
1694
+ },
1695
+ filterAppearance: {
1696
+ classPropertyName: "filterAppearance",
1697
+ publicName: "filterAppearance",
1698
+ isSignal: true,
1699
+ isRequired: false,
1700
+ transformFunction: null
1701
+ },
1702
+ isTableRowsClickable: {
1703
+ classPropertyName: "isTableRowsClickable",
1704
+ publicName: "isTableRowsClickable",
1705
+ isSignal: true,
1706
+ isRequired: false,
1707
+ transformFunction: null
1708
+ },
1709
+ keyExp: {
1710
+ classPropertyName: "keyExp",
1711
+ publicName: "keyExp",
1712
+ isSignal: true,
1713
+ isRequired: false,
1714
+ transformFunction: null
1715
+ },
1716
+ entities: {
1717
+ classPropertyName: "entities",
1718
+ publicName: "entities",
1719
+ isSignal: true,
1720
+ isRequired: true,
1721
+ transformFunction: null
1722
+ },
1723
+ currentSortModel: {
1724
+ classPropertyName: "currentSortModel",
1725
+ publicName: "currentSortModel",
1726
+ isSignal: true,
1727
+ isRequired: true,
1728
+ transformFunction: null
1729
+ },
1730
+ filterModel: {
1731
+ classPropertyName: "filterModel",
1732
+ publicName: "filterModel",
1733
+ isSignal: true,
1734
+ isRequired: false,
1735
+ transformFunction: null
1736
+ },
1737
+ isFiltersShown: {
1738
+ classPropertyName: "isFiltersShown",
1739
+ publicName: "isFiltersShown",
1740
+ isSignal: true,
1741
+ isRequired: false,
1742
+ transformFunction: null
1743
+ }
1744
+ },
1745
+ outputs: {
1746
+ rowClick: "rowClick",
1747
+ rowDoubleClick: "rowDoubleClick",
1748
+ sortChange: "sortChange",
1749
+ filterChange: "filterChange"
1750
+ },
1751
+ host: {
1752
+ properties: { "class.rt-preset-material": "look() === 'material' && !presetFromHost" },
1753
+ classAttribute: "rt-data-table"
1754
+ },
1755
+ providers: [{
1756
+ provide: RT_DATA_TABLE_ROW_HOST,
1757
+ useExisting: forwardRef(() => RtDataTableComponent)
1758
+ }],
1759
+ queries: [
1760
+ {
1761
+ propertyName: "customCellsTpl",
1762
+ first: true,
1763
+ predicate: RtDataTableCustomCellsDirective,
1764
+ descendants: true,
1765
+ isSignal: true
1766
+ },
1767
+ {
1768
+ propertyName: "rowActionsTpl",
1769
+ first: true,
1770
+ predicate: RtDataTableRowActionsDirective,
1771
+ descendants: true,
1772
+ read: TemplateRef,
1773
+ isSignal: true
1774
+ },
1775
+ {
1776
+ propertyName: "additionalRowActionsTpl",
1777
+ first: true,
1778
+ predicate: RtDataTableAdditionalRowActionsDirective,
1779
+ descendants: true,
1780
+ read: TemplateRef,
1781
+ isSignal: true
1782
+ },
1783
+ {
1784
+ propertyName: "iconTpl",
1785
+ first: true,
1786
+ predicate: RtDataTableIconDirective,
1787
+ descendants: true,
1788
+ isSignal: true
1789
+ }
1790
+ ],
1791
+ viewQueries: [
1792
+ {
1793
+ propertyName: "rowActionsRef",
1794
+ first: true,
1795
+ predicate: ["rowActions"],
1796
+ descendants: true,
1797
+ isSignal: true
1798
+ },
1799
+ {
1800
+ propertyName: "headerSpacerRef",
1801
+ first: true,
1802
+ predicate: ["headerSpacer"],
1803
+ descendants: true,
1804
+ isSignal: true
1805
+ },
1806
+ {
1807
+ propertyName: "rowSpacerRef",
1808
+ first: true,
1809
+ predicate: ["rowSpacer"],
1810
+ descendants: true,
1811
+ isSignal: true
1812
+ }
1813
+ ],
1814
+ ngImport: i0,
1815
+ template: "<ng-container rtBlock=\"rt-data-table\">\n <table rtElem=\"table\">\n <thead rtElem=\"head\">\n <tr>\n @if (isSelectorsColumnShown()) {\n <th rtElem=\"cell\" [rtMod]=\"{ head: true, selectable: true }\">\n @if (isMultiSelect()) {\n <rt-checkbox\n qa-dataid=\"data-table-page-checkbox\"\n [ariaLabel]=\"selectPageLabel()\"\n [disabled]=\"isSelectorsColumnDisabled()\"\n [indeterminate]=\"isPageEntitiesIndeterminate() && !isPageEntitiesSelected()\"\n [ngModel]=\"isPageEntitiesSelected()\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"onTogglePageEntities($event)\" />\n }\n </th>\n }\n\n @for (column of visibleColumns(); track column.propName) {\n <th\n rtElem=\"cell\"\n qa-dataid=\"data-table-header-cell\"\n [attr.aria-sort]=\"ariaSorts()[column.propName]\"\n [rtMod]=\"{ head: true, sortable: !!column.sorting }\">\n <rt-data-table-header-cell\n [headerModel]=\"column.header\"\n [sortModel]=\"column.sorting\"\n [currentSortModel]=\"currentSortModel()\"\n [column]=\"column\"\n [iconTemplate]=\"iconTpl()?.template ?? null\"\n (sortChange)=\"onSortChange($event)\" />\n </th>\n }\n\n @if (hasRowActions()) {\n <th #headerSpacer rtElem=\"cell\" qa-dataid=\"data-table-actions-header\" [rtMod]=\"{ head: true }\">{{ actionsLabel() }}</th>\n }\n </tr>\n\n @if (isFiltersShown()) {\n <tr qa-dataid=\"data-table-filter-row\">\n @if (isSelectorsColumnShown()) {\n <th rtElem=\"cell\" [rtMod]=\"{ head: true, filterable: true, empty: true }\"></th>\n }\n\n @for (column of visibleColumns(); track column.propName) {\n <th rtElem=\"cell\" [rtMod]=\"{ head: true, filterable: true }\">\n @if (column.filterType; as filterType) {\n <rt-data-table-filter-cell\n [filterProperty]=\"column.propName\"\n [filterType]=\"filterType\"\n [filterModel]=\"filterModel()\"\n [defaultFilterOperator]=\"column.defaultFilterOperator\"\n [filterOperators]=\"column.filterOperators\"\n [filterSelectOptions]=\"column.filterSelectOptions\"\n [appearance]=\"filterAppearance()\"\n (filterChange)=\"onFilterChange($event)\" />\n }\n </th>\n }\n\n @if (hasRowActions()) {\n <th rtElem=\"cell\" [rtMod]=\"{ head: true, filterable: true }\"></th>\n }\n </tr>\n }\n </thead>\n\n <tbody>\n @for (row of entities(); track row[keyExp()]; let index = $index) {\n <tr\n rtElem=\"row\"\n qa-dataid=\"data-table-row\"\n [rtDataTableRowClick]=\"row\"\n [isTableRowClickable]=\"isTableRowsClickable()\"\n [rtMod]=\"{ clickable: isTableRowsClickable(), active: activeRowIndex() === index }\">\n @if (isSelectorsColumnShown()) {\n <td rtElem=\"cell\" [rtMod]=\"{ selectable: true }\" [attr.rt-data-table-stop-row-click]=\"''\">\n @if (isMultiSelect()) {\n <rt-checkbox\n qa-dataid=\"data-table-row-checkbox\"\n [ariaLabel]=\"selectRowLabel()\"\n [disabled]=\"isSelectorsColumnDisabled()\"\n [ngModel]=\"selectedEntitiesIds().includes(row[keyExp()])\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"onToggleEntity(row, $event)\" />\n } @else {\n <rt-radio-button\n qa-dataid=\"data-table-row-radio\"\n [value]=\"row[keyExp()]\"\n [ariaLabel]=\"selectRowLabel()\"\n [disabled]=\"isSelectorsColumnDisabled()\"\n [checked]=\"selectedEntitiesIds().includes(row[keyExp()])\"\n (checkedChange)=\"onToggleEntity(row, true)\" />\n }\n </td>\n }\n\n @for (column of visibleColumns(); track column.propName) {\n <td rtElem=\"cell\" qa-dataid=\"data-table-cell\" [rtMod]=\"{ copyable: !!column.copyable }\">\n @if (column.type === columnTypes.CUSTOM) {\n <ng-container\n [ngTemplateOutlet]=\"customCellsTpl()?.getTemplateByPropName(column.propName) ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n } @else {\n <rt-data-table-cell [row]=\"row\" [column]=\"column\" [iconTemplate]=\"iconTpl()?.template ?? null\" />\n }\n </td>\n }\n\n @if (hasRowActions()) {\n <td #rowSpacer rtElem=\"cell\" [rtMod]=\"{ spacer: true }\"></td>\n\n <div rtBlock=\"rt-data-table-actions\" [rtMod]=\"{ hidden: activeRowIndex() !== index }\">\n <div #rowActions rtElem=\"container\" qa-dataid=\"data-table-actions\">\n @if (additionalRowActionsTpl(); as additional) {\n <ng-container [ngTemplateOutlet]=\"additional\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n }\n\n @if (rowActionsTpl(); as actions) {\n <rt-menu\n rtElem=\"action\"\n qa-dataid=\"data-table-row-menu\"\n icon=\"ellipsis-v\"\n size=\"sm\"\n [panelClass]=\"menuPanelClass()\"\n [attr.rt-data-table-stop-row-click]=\"''\"\n [ariaLabel]=\"actionsLabel()\"\n (openedChange)=\"onMenuOpenedChange(index, $event)\">\n <ng-container [ngTemplateOutlet]=\"actions\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n </rt-menu>\n }\n </div>\n </div>\n }\n </tr>\n }\n </tbody>\n </table>\n</ng-container>\n",
1816
+ styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-data-table{--rt-data-table-row-height: var(--rt-control-height-lg);--rt-data-table-head-height: calc(var(--rt-control-height-lg) - var(--rt-space-1));--rt-data-table-border-width: var(--rt-border-width-thin);--rt-data-table-cell-padding: calc(var(--rt-space-2) + var(--rt-space-0-5));--rt-data-table-row-transition-duration: var(--rt-duration-base);--rt-data-table-padding-bottom: var(--rt-list-content-padding-bottom);--rt-data-table-head-color: var(--rt-color-text-primary);--rt-data-table-head-font-weight: var(--rt-font-weight-medium);--rt-data-table-filter-bg: color-mix(in srgb, var(--rt-color-table-head-bg), var(--rt-color-bg-surface) 50%);display:block;overflow:auto;width:100%;height:100%;box-sizing:border-box;padding-bottom:var(--rt-data-table-padding-bottom);scrollbar-color:var(--rt-data-table-scrollbar-color, transparent transparent);scrollbar-width:var(--rt-data-table-scrollbar-width, thin)}.rt-data-table::-webkit-scrollbar{width:var(--rt-data-table-scrollbar-vertical-width, var(--rt-size-3));height:var(--rt-data-table-scrollbar-horizontal-height, var(--rt-size-3))}.rt-data-table:hover,.rt-data-table:focus-within{scrollbar-color:var(--rt-data-table-scrollbar-color, var(--rt-color-border-default) transparent)}@media(hover:none){.rt-data-table{scrollbar-color:var(--rt-data-table-scrollbar-color, var(--rt-color-border-default) transparent)}}.rt-data-table__table{width:100%;border-collapse:collapse}.rt-data-table thead{position:sticky;z-index:var(--rt-z-sticky);top:0}.rt-data-table thead tr:first-child{height:var(--rt-data-table-head-height)}.rt-data-table thead tr:last-child{border-bottom:var(--rt-data-table-border-width) solid var(--rt-color-border-default)}.rt-data-table tbody{font-size:var(--rt-text-sm)}.rt-data-table__row{height:var(--rt-data-table-row-height);border-bottom:var(--rt-data-table-border-width) solid var(--rt-color-border-subtle);color:var(--rt-color-text-primary);transform:translate(0)}.rt-data-table__row:hover{border-bottom-color:var(--rt-color-state-info);transition:border-bottom-color var(--rt-data-table-row-transition-duration)}.rt-data-table__row:hover .rt-data-table-actions{visibility:visible}.rt-data-table__row--active{border-bottom-color:var(--rt-color-state-info)}.rt-data-table__row--clickable{cursor:pointer}.rt-data-table__cell{width:fit-content;height:100%;padding:var(--rt-data-table-cell-padding)}.rt-data-table__cell--head{position:relative;background-color:var(--rt-color-table-head-bg);color:var(--rt-data-table-head-color);font-size:var(--rt-text-md);font-weight:var(--rt-data-table-head-font-weight);line-height:var(--rt-leading-tight);pointer-events:none;text-align:start}.rt-data-table__cell--sortable,.rt-data-table__cell--selectable,.rt-data-table__cell--filterable{pointer-events:auto}.rt-data-table__cell--selectable>rt-checkbox,.rt-data-table__cell--selectable>rt-radio-button{display:flex}.rt-data-table__cell--filterable{padding:var(--rt-space-xs) var(--rt-space-sm);background-color:var(--rt-data-table-filter-bg)}:is(.rt-preset-material,[data-preset=material]) .rt-data-table__cell--filterable{--rt-input-radius: var(--rt-radius-sm)}.rt-data-table__cell--head:not(:last-child,.rt-data-table__cell--selectable,.rt-data-table__cell--empty):after{position:absolute;top:25%;right:0;height:50%;border-right:var(--rt-data-table-border-width) solid var(--rt-list-table-head-divider-color);content:\"\";pointer-events:none}.rt-data-table__cell--spacer{padding:0}.rt-data-table-actions{--rt-data-table-actions-bg: var(--rt-table-actions-bg, var(--rt-color-bg-surface));position:absolute;z-index:var(--rt-z-base);top:0;right:0;display:flex;width:100%;height:100%;align-items:center;justify-content:flex-end;pointer-events:none}.rt-data-table-actions__container{position:sticky;right:0;display:flex;overflow:hidden;width:fit-content;height:calc(100% - var(--rt-data-table-border-width) * 2);align-items:center;justify-content:flex-end;padding:0 var(--rt-space-xs) 0 var(--rt-space-5);background:linear-gradient(to right,transparent 0%,color-mix(in srgb,var(--rt-data-table-actions-bg) 30%,transparent) 10%,var(--rt-data-table-actions-bg) 20%,var(--rt-data-table-actions-bg) 100%);gap:var(--rt-space-xs);pointer-events:none}.rt-data-table-actions__container>*{pointer-events:auto}.rt-data-table-actions__action{position:sticky}.rt-data-table-actions rt-icon-button{--rt-icon-button-color: var(--rt-list-table-icon-color)}.rt-data-table-actions .rt-icon-button{--rt-icon-button-size-step: var(--rt-list-table-button-size);--rt-icon-button-radius: var(--rt-list-table-button-radius)}.rt-data-table-actions .rt-icon-button__icon{min-width:var(--rt-list-table-icon-size);min-height:var(--rt-list-table-icon-size)}@media(hover:hover){.rt-data-table-actions--hidden{opacity:0}.rt-data-table-actions--hidden .rt-data-table-actions__container>*{pointer-events:none}.rt-data-table__row:hover .rt-data-table-actions--hidden,.rt-data-table__row:has(:focus-visible) .rt-data-table-actions--hidden{opacity:1}.rt-data-table__row:hover .rt-data-table-actions--hidden .rt-data-table-actions__container>*,.rt-data-table__row:has(:focus-visible) .rt-data-table-actions--hidden .rt-data-table-actions__container>*{pointer-events:auto}}}\n"],
1817
+ dependencies: [
1818
+ {
1819
+ kind: "component",
1820
+ type: RtCheckboxComponent,
1821
+ selector: "rt-checkbox",
1822
+ inputs: [
1823
+ "inputId",
1824
+ "ariaLabel",
1825
+ "disabled",
1826
+ "indeterminate"
1827
+ ]
1828
+ },
1829
+ {
1830
+ kind: "component",
1831
+ type: RtDataTableCellComponent,
1832
+ selector: "rt-data-table-cell",
1833
+ inputs: [
1834
+ "row",
1835
+ "column",
1836
+ "iconTemplate"
1837
+ ]
1838
+ },
1839
+ {
1840
+ kind: "component",
1841
+ type: RtDataTableFilterCellComponent,
1842
+ selector: "rt-data-table-filter-cell",
1843
+ inputs: [
1844
+ "appearance",
1845
+ "filterProperty",
1846
+ "filterType",
1847
+ "filterModel",
1848
+ "defaultFilterOperator",
1849
+ "filterOperators",
1850
+ "filterSelectOptions"
1851
+ ],
1852
+ outputs: ["filterChange"]
1853
+ },
1854
+ {
1855
+ kind: "component",
1856
+ type: RtDataTableHeaderCellComponent,
1857
+ selector: "rt-data-table-header-cell",
1858
+ inputs: [
1859
+ "headerModel",
1860
+ "sortModel",
1861
+ "currentSortModel",
1862
+ "column",
1863
+ "iconTemplate"
1864
+ ],
1865
+ outputs: ["sortChange"]
1866
+ },
1867
+ {
1868
+ kind: "component",
1869
+ type: RtMenuComponent,
1870
+ selector: "rt-menu",
1871
+ inputs: [
1872
+ "icon",
1873
+ "ariaLabel",
1874
+ "align",
1875
+ "panelClass",
1876
+ "triggerSize",
1877
+ "size",
1878
+ "disabled"
1879
+ ],
1880
+ outputs: ["openedChange"]
1881
+ },
1882
+ {
1883
+ kind: "component",
1884
+ type: RtRadioButtonComponent,
1885
+ selector: "rt-radio-button",
1886
+ inputs: [
1887
+ "value",
1888
+ "checked",
1889
+ "disabled",
1890
+ "card",
1891
+ "label",
1892
+ "description",
1893
+ "ariaLabel"
1894
+ ],
1895
+ outputs: ["clickAction", "checkedChange"]
1896
+ },
1897
+ {
1898
+ kind: "directive",
1899
+ type: BlockDirective,
1900
+ selector: "[rtBlock]",
1901
+ inputs: ["rtMod"]
1902
+ },
1903
+ {
1904
+ kind: "directive",
1905
+ type: ElemDirective,
1906
+ selector: "[rtElem]",
1907
+ inputs: ["rtMod"]
1908
+ },
1909
+ {
1910
+ kind: "ngmodule",
1911
+ type: FormsModule
1912
+ },
1913
+ {
1914
+ kind: "directive",
1915
+ type: i1.NgControlStatus,
1916
+ selector: "[formControlName],[ngModel],[formControl]"
1917
+ },
1918
+ {
1919
+ kind: "directive",
1920
+ type: i1.NgModel,
1921
+ selector: "[ngModel]:not([formControlName]):not([formControl])",
1922
+ inputs: [
1923
+ "name",
1924
+ "disabled",
1925
+ "ngModel",
1926
+ "ngModelOptions"
1927
+ ],
1928
+ outputs: ["ngModelChange"],
1929
+ exportAs: ["ngModel"]
1930
+ },
1931
+ {
1932
+ kind: "directive",
1933
+ type: ModDirective,
1934
+ selector: "[rtMod]"
1935
+ },
1936
+ {
1937
+ kind: "directive",
1938
+ type: NgTemplateOutlet,
1939
+ selector: "[ngTemplateOutlet]",
1940
+ inputs: [
1941
+ "ngTemplateOutletContext",
1942
+ "ngTemplateOutlet",
1943
+ "ngTemplateOutletInjector"
1944
+ ]
1945
+ },
1946
+ {
1947
+ kind: "directive",
1948
+ type: RtDataTableRowClickDirective,
1949
+ selector: "[rtDataTableRowClick]",
1950
+ inputs: ["rtDataTableRowClick", "isTableRowClickable"]
1951
+ }
1952
+ ],
1953
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
1954
+ encapsulation: i0.ViewEncapsulation.None
1955
+ });
1956
+ }
1957
+ };
1958
+ i0.ɵɵngDeclareClassMetadata({
1959
+ minVersion: "12.0.0",
1960
+ version: "22.2.2",
1961
+ ngImport: i0,
1962
+ type: RtDataTableComponent,
1963
+ decorators: [{
1964
+ type: Component,
1965
+ args: [{
1966
+ selector: "rt-data-table",
1967
+ changeDetection: ChangeDetectionStrategy.OnPush,
1968
+ encapsulation: ViewEncapsulation.None,
1969
+ imports: [
1970
+ RtCheckboxComponent,
1971
+ RtDataTableCellComponent,
1972
+ RtDataTableFilterCellComponent,
1973
+ RtDataTableHeaderCellComponent,
1974
+ RtMenuComponent,
1975
+ RtRadioButtonComponent,
1976
+ BlockDirective,
1977
+ ElemDirective,
1978
+ FormsModule,
1979
+ ModDirective,
1980
+ NgTemplateOutlet,
1981
+ RtDataTableRowClickDirective
1982
+ ],
1983
+ host: {
1984
+ class: BEM_BLOCK,
1985
+ "[class.rt-preset-material]": "look() === 'material' && !presetFromHost"
1986
+ },
1987
+ providers: [{
1988
+ provide: RT_DATA_TABLE_ROW_HOST,
1989
+ useExisting: forwardRef(() => RtDataTableComponent)
1990
+ }],
1991
+ template: "<ng-container rtBlock=\"rt-data-table\">\n <table rtElem=\"table\">\n <thead rtElem=\"head\">\n <tr>\n @if (isSelectorsColumnShown()) {\n <th rtElem=\"cell\" [rtMod]=\"{ head: true, selectable: true }\">\n @if (isMultiSelect()) {\n <rt-checkbox\n qa-dataid=\"data-table-page-checkbox\"\n [ariaLabel]=\"selectPageLabel()\"\n [disabled]=\"isSelectorsColumnDisabled()\"\n [indeterminate]=\"isPageEntitiesIndeterminate() && !isPageEntitiesSelected()\"\n [ngModel]=\"isPageEntitiesSelected()\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"onTogglePageEntities($event)\" />\n }\n </th>\n }\n\n @for (column of visibleColumns(); track column.propName) {\n <th\n rtElem=\"cell\"\n qa-dataid=\"data-table-header-cell\"\n [attr.aria-sort]=\"ariaSorts()[column.propName]\"\n [rtMod]=\"{ head: true, sortable: !!column.sorting }\">\n <rt-data-table-header-cell\n [headerModel]=\"column.header\"\n [sortModel]=\"column.sorting\"\n [currentSortModel]=\"currentSortModel()\"\n [column]=\"column\"\n [iconTemplate]=\"iconTpl()?.template ?? null\"\n (sortChange)=\"onSortChange($event)\" />\n </th>\n }\n\n @if (hasRowActions()) {\n <th #headerSpacer rtElem=\"cell\" qa-dataid=\"data-table-actions-header\" [rtMod]=\"{ head: true }\">{{ actionsLabel() }}</th>\n }\n </tr>\n\n @if (isFiltersShown()) {\n <tr qa-dataid=\"data-table-filter-row\">\n @if (isSelectorsColumnShown()) {\n <th rtElem=\"cell\" [rtMod]=\"{ head: true, filterable: true, empty: true }\"></th>\n }\n\n @for (column of visibleColumns(); track column.propName) {\n <th rtElem=\"cell\" [rtMod]=\"{ head: true, filterable: true }\">\n @if (column.filterType; as filterType) {\n <rt-data-table-filter-cell\n [filterProperty]=\"column.propName\"\n [filterType]=\"filterType\"\n [filterModel]=\"filterModel()\"\n [defaultFilterOperator]=\"column.defaultFilterOperator\"\n [filterOperators]=\"column.filterOperators\"\n [filterSelectOptions]=\"column.filterSelectOptions\"\n [appearance]=\"filterAppearance()\"\n (filterChange)=\"onFilterChange($event)\" />\n }\n </th>\n }\n\n @if (hasRowActions()) {\n <th rtElem=\"cell\" [rtMod]=\"{ head: true, filterable: true }\"></th>\n }\n </tr>\n }\n </thead>\n\n <tbody>\n @for (row of entities(); track row[keyExp()]; let index = $index) {\n <tr\n rtElem=\"row\"\n qa-dataid=\"data-table-row\"\n [rtDataTableRowClick]=\"row\"\n [isTableRowClickable]=\"isTableRowsClickable()\"\n [rtMod]=\"{ clickable: isTableRowsClickable(), active: activeRowIndex() === index }\">\n @if (isSelectorsColumnShown()) {\n <td rtElem=\"cell\" [rtMod]=\"{ selectable: true }\" [attr.rt-data-table-stop-row-click]=\"''\">\n @if (isMultiSelect()) {\n <rt-checkbox\n qa-dataid=\"data-table-row-checkbox\"\n [ariaLabel]=\"selectRowLabel()\"\n [disabled]=\"isSelectorsColumnDisabled()\"\n [ngModel]=\"selectedEntitiesIds().includes(row[keyExp()])\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"onToggleEntity(row, $event)\" />\n } @else {\n <rt-radio-button\n qa-dataid=\"data-table-row-radio\"\n [value]=\"row[keyExp()]\"\n [ariaLabel]=\"selectRowLabel()\"\n [disabled]=\"isSelectorsColumnDisabled()\"\n [checked]=\"selectedEntitiesIds().includes(row[keyExp()])\"\n (checkedChange)=\"onToggleEntity(row, true)\" />\n }\n </td>\n }\n\n @for (column of visibleColumns(); track column.propName) {\n <td rtElem=\"cell\" qa-dataid=\"data-table-cell\" [rtMod]=\"{ copyable: !!column.copyable }\">\n @if (column.type === columnTypes.CUSTOM) {\n <ng-container\n [ngTemplateOutlet]=\"customCellsTpl()?.getTemplateByPropName(column.propName) ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n } @else {\n <rt-data-table-cell [row]=\"row\" [column]=\"column\" [iconTemplate]=\"iconTpl()?.template ?? null\" />\n }\n </td>\n }\n\n @if (hasRowActions()) {\n <td #rowSpacer rtElem=\"cell\" [rtMod]=\"{ spacer: true }\"></td>\n\n <div rtBlock=\"rt-data-table-actions\" [rtMod]=\"{ hidden: activeRowIndex() !== index }\">\n <div #rowActions rtElem=\"container\" qa-dataid=\"data-table-actions\">\n @if (additionalRowActionsTpl(); as additional) {\n <ng-container [ngTemplateOutlet]=\"additional\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n }\n\n @if (rowActionsTpl(); as actions) {\n <rt-menu\n rtElem=\"action\"\n qa-dataid=\"data-table-row-menu\"\n icon=\"ellipsis-v\"\n size=\"sm\"\n [panelClass]=\"menuPanelClass()\"\n [attr.rt-data-table-stop-row-click]=\"''\"\n [ariaLabel]=\"actionsLabel()\"\n (openedChange)=\"onMenuOpenedChange(index, $event)\">\n <ng-container [ngTemplateOutlet]=\"actions\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n </rt-menu>\n }\n </div>\n </div>\n }\n </tr>\n }\n </tbody>\n </table>\n</ng-container>\n",
1992
+ styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-data-table{--rt-data-table-row-height: var(--rt-control-height-lg);--rt-data-table-head-height: calc(var(--rt-control-height-lg) - var(--rt-space-1));--rt-data-table-border-width: var(--rt-border-width-thin);--rt-data-table-cell-padding: calc(var(--rt-space-2) + var(--rt-space-0-5));--rt-data-table-row-transition-duration: var(--rt-duration-base);--rt-data-table-padding-bottom: var(--rt-list-content-padding-bottom);--rt-data-table-head-color: var(--rt-color-text-primary);--rt-data-table-head-font-weight: var(--rt-font-weight-medium);--rt-data-table-filter-bg: color-mix(in srgb, var(--rt-color-table-head-bg), var(--rt-color-bg-surface) 50%);display:block;overflow:auto;width:100%;height:100%;box-sizing:border-box;padding-bottom:var(--rt-data-table-padding-bottom);scrollbar-color:var(--rt-data-table-scrollbar-color, transparent transparent);scrollbar-width:var(--rt-data-table-scrollbar-width, thin)}.rt-data-table::-webkit-scrollbar{width:var(--rt-data-table-scrollbar-vertical-width, var(--rt-size-3));height:var(--rt-data-table-scrollbar-horizontal-height, var(--rt-size-3))}.rt-data-table:hover,.rt-data-table:focus-within{scrollbar-color:var(--rt-data-table-scrollbar-color, var(--rt-color-border-default) transparent)}@media(hover:none){.rt-data-table{scrollbar-color:var(--rt-data-table-scrollbar-color, var(--rt-color-border-default) transparent)}}.rt-data-table__table{width:100%;border-collapse:collapse}.rt-data-table thead{position:sticky;z-index:var(--rt-z-sticky);top:0}.rt-data-table thead tr:first-child{height:var(--rt-data-table-head-height)}.rt-data-table thead tr:last-child{border-bottom:var(--rt-data-table-border-width) solid var(--rt-color-border-default)}.rt-data-table tbody{font-size:var(--rt-text-sm)}.rt-data-table__row{height:var(--rt-data-table-row-height);border-bottom:var(--rt-data-table-border-width) solid var(--rt-color-border-subtle);color:var(--rt-color-text-primary);transform:translate(0)}.rt-data-table__row:hover{border-bottom-color:var(--rt-color-state-info);transition:border-bottom-color var(--rt-data-table-row-transition-duration)}.rt-data-table__row:hover .rt-data-table-actions{visibility:visible}.rt-data-table__row--active{border-bottom-color:var(--rt-color-state-info)}.rt-data-table__row--clickable{cursor:pointer}.rt-data-table__cell{width:fit-content;height:100%;padding:var(--rt-data-table-cell-padding)}.rt-data-table__cell--head{position:relative;background-color:var(--rt-color-table-head-bg);color:var(--rt-data-table-head-color);font-size:var(--rt-text-md);font-weight:var(--rt-data-table-head-font-weight);line-height:var(--rt-leading-tight);pointer-events:none;text-align:start}.rt-data-table__cell--sortable,.rt-data-table__cell--selectable,.rt-data-table__cell--filterable{pointer-events:auto}.rt-data-table__cell--selectable>rt-checkbox,.rt-data-table__cell--selectable>rt-radio-button{display:flex}.rt-data-table__cell--filterable{padding:var(--rt-space-xs) var(--rt-space-sm);background-color:var(--rt-data-table-filter-bg)}:is(.rt-preset-material,[data-preset=material]) .rt-data-table__cell--filterable{--rt-input-radius: var(--rt-radius-sm)}.rt-data-table__cell--head:not(:last-child,.rt-data-table__cell--selectable,.rt-data-table__cell--empty):after{position:absolute;top:25%;right:0;height:50%;border-right:var(--rt-data-table-border-width) solid var(--rt-list-table-head-divider-color);content:\"\";pointer-events:none}.rt-data-table__cell--spacer{padding:0}.rt-data-table-actions{--rt-data-table-actions-bg: var(--rt-table-actions-bg, var(--rt-color-bg-surface));position:absolute;z-index:var(--rt-z-base);top:0;right:0;display:flex;width:100%;height:100%;align-items:center;justify-content:flex-end;pointer-events:none}.rt-data-table-actions__container{position:sticky;right:0;display:flex;overflow:hidden;width:fit-content;height:calc(100% - var(--rt-data-table-border-width) * 2);align-items:center;justify-content:flex-end;padding:0 var(--rt-space-xs) 0 var(--rt-space-5);background:linear-gradient(to right,transparent 0%,color-mix(in srgb,var(--rt-data-table-actions-bg) 30%,transparent) 10%,var(--rt-data-table-actions-bg) 20%,var(--rt-data-table-actions-bg) 100%);gap:var(--rt-space-xs);pointer-events:none}.rt-data-table-actions__container>*{pointer-events:auto}.rt-data-table-actions__action{position:sticky}.rt-data-table-actions rt-icon-button{--rt-icon-button-color: var(--rt-list-table-icon-color)}.rt-data-table-actions .rt-icon-button{--rt-icon-button-size-step: var(--rt-list-table-button-size);--rt-icon-button-radius: var(--rt-list-table-button-radius)}.rt-data-table-actions .rt-icon-button__icon{min-width:var(--rt-list-table-icon-size);min-height:var(--rt-list-table-icon-size)}@media(hover:hover){.rt-data-table-actions--hidden{opacity:0}.rt-data-table-actions--hidden .rt-data-table-actions__container>*{pointer-events:none}.rt-data-table__row:hover .rt-data-table-actions--hidden,.rt-data-table__row:has(:focus-visible) .rt-data-table-actions--hidden{opacity:1}.rt-data-table__row:hover .rt-data-table-actions--hidden .rt-data-table-actions__container>*,.rt-data-table__row:has(:focus-visible) .rt-data-table-actions--hidden .rt-data-table-actions__container>*{pointer-events:auto}}}\n"]
1993
+ }]
1994
+ }],
1995
+ propDecorators: {
1996
+ rowActionsRef: [{
1997
+ type: i0.ViewChild,
1998
+ args: ["rowActions", { isSignal: true }]
1999
+ }],
2000
+ headerSpacerRef: [{
2001
+ type: i0.ViewChild,
2002
+ args: ["headerSpacer", { isSignal: true }]
2003
+ }],
2004
+ rowSpacerRef: [{
2005
+ type: i0.ViewChild,
2006
+ args: ["rowSpacer", { isSignal: true }]
2007
+ }],
2008
+ look: [{
2009
+ type: i0.Input,
2010
+ args: [{
2011
+ isSignal: true,
2012
+ alias: "look",
2013
+ required: false
2014
+ }]
2015
+ }],
2016
+ filterAppearance: [{
2017
+ type: i0.Input,
2018
+ args: [{
2019
+ isSignal: true,
2020
+ alias: "filterAppearance",
2021
+ required: false
2022
+ }]
2023
+ }],
2024
+ isTableRowsClickable: [{
2025
+ type: i0.Input,
2026
+ args: [{
2027
+ isSignal: true,
2028
+ alias: "isTableRowsClickable",
2029
+ required: false
2030
+ }]
2031
+ }],
2032
+ keyExp: [{
2033
+ type: i0.Input,
2034
+ args: [{
2035
+ isSignal: true,
2036
+ alias: "keyExp",
2037
+ required: false
2038
+ }]
2039
+ }],
2040
+ entities: [{
2041
+ type: i0.Input,
2042
+ args: [{
2043
+ isSignal: true,
2044
+ alias: "entities",
2045
+ required: true
2046
+ }]
2047
+ }],
2048
+ currentSortModel: [{
2049
+ type: i0.Input,
2050
+ args: [{
2051
+ isSignal: true,
2052
+ alias: "currentSortModel",
2053
+ required: true
2054
+ }]
2055
+ }],
2056
+ filterModel: [{
2057
+ type: i0.Input,
2058
+ args: [{
2059
+ isSignal: true,
2060
+ alias: "filterModel",
2061
+ required: false
2062
+ }]
2063
+ }],
2064
+ isFiltersShown: [{
2065
+ type: i0.Input,
2066
+ args: [{
2067
+ isSignal: true,
2068
+ alias: "isFiltersShown",
2069
+ required: false
2070
+ }]
2071
+ }],
2072
+ rowClick: [{
2073
+ type: i0.Output,
2074
+ args: ["rowClick"]
2075
+ }],
2076
+ rowDoubleClick: [{
2077
+ type: i0.Output,
2078
+ args: ["rowDoubleClick"]
2079
+ }],
2080
+ sortChange: [{
2081
+ type: i0.Output,
2082
+ args: ["sortChange"]
2083
+ }],
2084
+ filterChange: [{
2085
+ type: i0.Output,
2086
+ args: ["filterChange"]
2087
+ }],
2088
+ customCellsTpl: [{
2089
+ type: i0.ContentChild,
2090
+ args: [i0.forwardRef(() => RtDataTableCustomCellsDirective), { isSignal: true }]
2091
+ }],
2092
+ rowActionsTpl: [{
2093
+ type: i0.ContentChild,
2094
+ args: [i0.forwardRef(() => RtDataTableRowActionsDirective), {
2095
+ read: TemplateRef,
2096
+ isSignal: true
2097
+ }]
2098
+ }],
2099
+ additionalRowActionsTpl: [{
2100
+ type: i0.ContentChild,
2101
+ args: [i0.forwardRef(() => RtDataTableAdditionalRowActionsDirective), {
2102
+ read: TemplateRef,
2103
+ isSignal: true
2104
+ }]
2105
+ }],
2106
+ iconTpl: [{
2107
+ type: i0.ContentChild,
2108
+ args: [i0.forwardRef(() => RtDataTableIconDirective), { isSignal: true }]
2109
+ }]
2110
+ }
2111
+ });
2112
+ var RtDataTableSelectorsDirective = class RtDataTableSelectorsDirective {
2113
+ #destroyRef;
2114
+ #injector;
2115
+ #table;
2116
+ #selectedEntities;
2117
+ #isPageEntitiesSelected;
2118
+ #isPageEntitiesIndeterminate;
2119
+ constructor() {
2120
+ this.#destroyRef = inject(DestroyRef);
2121
+ this.#injector = inject(Injector);
2122
+ this.#table = inject(RtDataTableComponent);
2123
+ this.#selectedEntities = signal([], ...ngDevMode ? [{ debugName: "#selectedEntities" }] : /* istanbul ignore next */ []);
2124
+ this.#isPageEntitiesSelected = signal(false, ...ngDevMode ? [{ debugName: "#isPageEntitiesSelected" }] : /* istanbul ignore next */ []);
2125
+ this.#isPageEntitiesIndeterminate = signal(false, ...ngDevMode ? [{ debugName: "#isPageEntitiesIndeterminate" }] : /* istanbul ignore next */ []);
2126
+ this.isMultiSelect = input(true, {
2127
+ ...ngDevMode ? { debugName: "isMultiSelect" } : /* istanbul ignore next */ {},
2128
+ transform: booleanAttribute
2129
+ });
2130
+ this.isSelectorColumnShown = input(false, {
2131
+ ...ngDevMode ? { debugName: "isSelectorColumnShown" } : /* istanbul ignore next */ {},
2132
+ transform: booleanAttribute
2133
+ });
2134
+ this.isSelectorsColumnDisabled = input(false, {
2135
+ ...ngDevMode ? { debugName: "isSelectorsColumnDisabled" } : /* istanbul ignore next */ {},
2136
+ transform: booleanAttribute
2137
+ });
2138
+ this.selectedEntitiesKeys = input([], {
2139
+ ...ngDevMode ? { debugName: "selectedEntitiesKeys" } : /* istanbul ignore next */ {},
2140
+ transform: transformArrayInput
2141
+ });
2142
+ this.selectedEntities = this.#selectedEntities.asReadonly();
2143
+ this.selectedEntitiesIds = computed(() => dataTableKeysOf(this.selectedEntities(), this.#keyExp()), ...ngDevMode ? [{ debugName: "selectedEntitiesIds" }] : /* istanbul ignore next */ []);
2144
+ this.isPageEntitiesSelected = this.#isPageEntitiesSelected.asReadonly();
2145
+ this.isPageEntitiesIndeterminate = this.#isPageEntitiesIndeterminate.asReadonly();
2146
+ this.#table.onToggleEntity = (entity, checked) => this.toggleEntity(entity, checked);
2147
+ this.#table.onTogglePageEntities = (checked) => this.togglePageEntities(checked);
2148
+ effect(() => this.#table.selectedEntitiesIds.set(this.selectedEntitiesIds()));
2149
+ effect(() => this.#table.isPageEntitiesSelected.set(this.isPageEntitiesSelected()));
2150
+ effect(() => this.#table.isPageEntitiesIndeterminate.set(this.isPageEntitiesIndeterminate()));
2151
+ effect(() => this.#table.isMultiSelect.set(this.isMultiSelect()));
2152
+ effect(() => this.#table.isSelectorsColumnShown.set(this.isSelectorColumnShown()));
2153
+ effect(() => this.#table.isSelectorsColumnDisabled.set(this.isSelectorsColumnDisabled()));
2154
+ effect(() => {
2155
+ this.#table.entities();
2156
+ untracked(() => this.setExistingEntitiesState());
2157
+ });
2158
+ }
2159
+ ngOnInit() {
2160
+ toObservable(this.#table.entities, { injector: this.#injector }).pipe(filter((entities) => !!entities.length), take(1), switchMap(() => toObservable(this.selectedEntitiesKeys, { injector: this.#injector }).pipe(filter((keys) => !!keys.length), take(1))), takeUntilDestroyed(this.#destroyRef)).subscribe(() => {
2161
+ this.#selectedEntities.set(dataTablePresetEntities(this.#table.entities(), this.selectedEntitiesKeys(), this.#keyExp()));
2162
+ this.setExistingEntitiesState();
2163
+ });
2164
+ }
2165
+ togglePageEntities(checked) {
2166
+ const page = this.#table.entities();
2167
+ this.#isPageEntitiesSelected.set(checked);
2168
+ this.#selectedEntities.update((selected) => checked ? dataTableWithPageEntities(selected, page, this.#keyExp()) : dataTableWithoutPageEntities(selected, page, this.#keyExp()));
2169
+ this.#isPageEntitiesIndeterminate.set(dataTableAnyOnPage(page, this.selectedEntitiesIds(), this.#keyExp()));
2170
+ }
2171
+ toggleEntity(entity, checked) {
2172
+ if (!this.isMultiSelect()) {
2173
+ this.#selectedEntities.set([entity]);
2174
+ return;
2175
+ }
2176
+ this.#selectedEntities.update((selected) => dataTableWithEntity(selected, entity, checked, this.#keyExp()));
2177
+ const page = this.#table.entities();
2178
+ const keys = this.selectedEntitiesIds();
2179
+ if (keys.length) {
2180
+ this.#isPageEntitiesSelected.set(dataTableAllOnPage(page, keys, this.#keyExp()));
2181
+ this.#isPageEntitiesIndeterminate.set(true);
2182
+ } else {
2183
+ this.#isPageEntitiesSelected.set(false);
2184
+ this.#isPageEntitiesIndeterminate.set(dataTableAnyOnPage(page, keys, this.#keyExp()));
2185
+ }
2186
+ }
2187
+ clearSelectedList() {
2188
+ this.#selectedEntities.set([]);
2189
+ this.#isPageEntitiesSelected.set(false);
2190
+ this.#isPageEntitiesIndeterminate.set(false);
2191
+ }
2192
+ setExistingEntitiesState() {
2193
+ const page = this.#table.entities();
2194
+ const keys = this.selectedEntitiesIds();
2195
+ const all = !!page.length && dataTableAllOnPage(page, keys, this.#keyExp());
2196
+ this.#isPageEntitiesSelected.set(all);
2197
+ this.#isPageEntitiesIndeterminate.set(!all && dataTableAnyOnPage(page, keys, this.#keyExp()));
2198
+ }
2199
+ #keyExp() {
2200
+ return this.#table.keyExp();
2201
+ }
2202
+ static {
2203
+ this.ɵfac = i0.ɵɵngDeclareFactory({
2204
+ minVersion: "12.0.0",
2205
+ version: "22.2.2",
2206
+ ngImport: i0,
2207
+ type: RtDataTableSelectorsDirective,
2208
+ deps: [],
2209
+ target: i0.ɵɵFactoryTarget.Directive
2210
+ });
2211
+ }
2212
+ static {
2213
+ this.ɵdir = i0.ɵɵngDeclareDirective({
2214
+ minVersion: "17.1.0",
2215
+ version: "22.2.2",
2216
+ type: RtDataTableSelectorsDirective,
2217
+ isStandalone: true,
2218
+ selector: "rt-data-table[rtDataTableSelectors]",
2219
+ inputs: {
2220
+ isMultiSelect: {
2221
+ classPropertyName: "isMultiSelect",
2222
+ publicName: "isMultiSelect",
2223
+ isSignal: true,
2224
+ isRequired: false,
2225
+ transformFunction: null
2226
+ },
2227
+ isSelectorColumnShown: {
2228
+ classPropertyName: "isSelectorColumnShown",
2229
+ publicName: "isSelectorColumnShown",
2230
+ isSignal: true,
2231
+ isRequired: false,
2232
+ transformFunction: null
2233
+ },
2234
+ isSelectorsColumnDisabled: {
2235
+ classPropertyName: "isSelectorsColumnDisabled",
2236
+ publicName: "isSelectorsColumnDisabled",
2237
+ isSignal: true,
2238
+ isRequired: false,
2239
+ transformFunction: null
2240
+ },
2241
+ selectedEntitiesKeys: {
2242
+ classPropertyName: "selectedEntitiesKeys",
2243
+ publicName: "selectedEntitiesKeys",
2244
+ isSignal: true,
2245
+ isRequired: false,
2246
+ transformFunction: null
2247
+ }
2248
+ },
2249
+ ngImport: i0
2250
+ });
2251
+ }
2252
+ };
2253
+ i0.ɵɵngDeclareClassMetadata({
2254
+ minVersion: "12.0.0",
2255
+ version: "22.2.2",
2256
+ ngImport: i0,
2257
+ type: RtDataTableSelectorsDirective,
2258
+ decorators: [{
2259
+ type: Directive,
2260
+ args: [{ selector: "rt-data-table[rtDataTableSelectors]" }]
2261
+ }],
2262
+ ctorParameters: () => [],
2263
+ propDecorators: {
2264
+ isMultiSelect: [{
2265
+ type: i0.Input,
2266
+ args: [{
2267
+ isSignal: true,
2268
+ alias: "isMultiSelect",
2269
+ required: false
2270
+ }]
2271
+ }],
2272
+ isSelectorColumnShown: [{
2273
+ type: i0.Input,
2274
+ args: [{
2275
+ isSignal: true,
2276
+ alias: "isSelectorColumnShown",
2277
+ required: false
2278
+ }]
2279
+ }],
2280
+ isSelectorsColumnDisabled: [{
2281
+ type: i0.Input,
2282
+ args: [{
2283
+ isSignal: true,
2284
+ alias: "isSelectorsColumnDisabled",
2285
+ required: false
2286
+ }]
2287
+ }],
2288
+ selectedEntitiesKeys: [{
2289
+ type: i0.Input,
2290
+ args: [{
2291
+ isSignal: true,
2292
+ alias: "selectedEntitiesKeys",
2293
+ required: false
2294
+ }]
2295
+ }]
2296
+ }
2297
+ });
1228
2298
  export { DATA_TABLE_FILTER_MENU_OPERATORS, DATA_TABLE_FILTER_OPERATOR_GLYPHS, RT_DATA_TABLE_ROW_HOST, RT_DATA_TABLE_STOP_ROW_CLICK_ATTRIBUTE, RtDataTableAdditionalRowActionsDirective, RtDataTableCellComponent, RtDataTableComponent, RtDataTableConfigService, RtDataTableCustomCellsDirective, RtDataTableFilterCellComponent, RtDataTableHeaderCellComponent, RtDataTableIconDirective, RtDataTableRowActionsDirective, RtDataTableRowClickDirective, RtDataTableSelectorsDirective, RtDataTableStopRowClickDirective, comparePropNames, dataTableAllOnPage, dataTableAnyOnPage, dataTableAriaSort, dataTableCellText, dataTableCellValue, dataTableColumnFilter, dataTableCopyButtonSide, dataTableDayToIso, dataTableDefaultOperator, dataTableFiltersWithOperator, dataTableFiltersWithValue, dataTableIconName, dataTableIsoToDay, dataTableKeysOf, dataTableNextSortOrder, dataTablePresetEntities, dataTableSortActive, dataTableWithEntity, dataTableWithPageEntities, dataTableWithoutPageEntities };
1229
- //# sourceMappingURL=rt-tools-ui-kit-v2-data-table.mjs.map
2299
+
2300
+ //# sourceMappingURL=rt-tools-ui-kit-v2-data-table.mjs.map