@astral/ui 4.113.3 → 4.115.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 (293) hide show
  1. package/components/ActionGroup/ActionGroup.js +2 -2
  2. package/components/ActionGroup/SecondaryActions/SecondaryActions.d.ts +1 -1
  3. package/components/ActionGroup/SecondaryActions/SecondaryActions.js +2 -2
  4. package/components/ActionGroup/types.d.ts +9 -0
  5. package/components/DataGrid/Body/Body.d.ts +1 -1
  6. package/components/DataGrid/Body/Body.js +7 -3
  7. package/components/DataGrid/Body/types.d.ts +11 -3
  8. package/components/DataGrid/DataGrid.js +13 -6
  9. package/components/DataGrid/DataGridContext/DataGridProvider/DataGridProvider.d.ts +3 -2
  10. package/components/DataGrid/DataGridContext/DataGridProvider/DataGridProvider.js +3 -2
  11. package/components/DataGrid/DataGridSelectionContext/DataGridSelectionContext.d.ts +25 -0
  12. package/components/DataGrid/DataGridSelectionContext/DataGridSelectionContext.js +13 -0
  13. package/components/DataGrid/DataGridSelectionContext/DataGridSelectionProvider/DataGridSelectionProvider.d.ts +7 -0
  14. package/components/DataGrid/DataGridSelectionContext/DataGridSelectionProvider/DataGridSelectionProvider.js +8 -0
  15. package/components/DataGrid/DataGridSelectionContext/DataGridSelectionProvider/index.d.ts +1 -0
  16. package/components/DataGrid/DataGridSelectionContext/DataGridSelectionProvider/index.js +1 -0
  17. package/components/DataGrid/DataGridSelectionContext/index.d.ts +2 -0
  18. package/components/DataGrid/DataGridSelectionContext/index.js +2 -0
  19. package/components/DataGrid/PinnedSections/PinnedSections.js +2 -2
  20. package/components/DataGrid/PinnedSections/useLogic/useLogic.d.ts +1 -0
  21. package/components/DataGrid/PinnedSections/useLogic/useLogic.js +4 -3
  22. package/components/DataGrid/Row/Row.js +13 -9
  23. package/components/DataGrid/Row/RowContext/RowContext.d.ts +15 -4
  24. package/components/DataGrid/Row/RowContext/RowContext.js +3 -3
  25. package/components/DataGrid/Row/RowContext/RowProvider/RowProvider.d.ts +10 -1
  26. package/components/DataGrid/Row/RowContext/RowProvider/RowProvider.js +23 -17
  27. package/components/DataGrid/Row/types.d.ts +7 -3
  28. package/components/DataGrid/Row/useLogic/useLogic.d.ts +6 -4
  29. package/components/DataGrid/Row/useLogic/useLogic.js +21 -12
  30. package/components/DataGrid/RowBase/RowBase.js +5 -2
  31. package/components/DataGrid/RowBase/types.d.ts +9 -5
  32. package/components/DataGrid/RowBase/useLogic/useLogic.d.ts +5 -4
  33. package/components/DataGrid/RowBase/useLogic/useLogic.js +16 -10
  34. package/components/DataGrid/RowCheckbox/RowCheckbox.d.ts +5 -0
  35. package/components/DataGrid/RowCheckbox/RowCheckbox.js +13 -0
  36. package/components/DataGrid/RowCheckbox/constants.d.ts +4 -0
  37. package/components/DataGrid/RowCheckbox/constants.js +4 -0
  38. package/components/DataGrid/RowCheckbox/index.d.ts +1 -0
  39. package/components/DataGrid/RowCheckbox/index.js +1 -0
  40. package/components/DataGrid/RowCheckbox/types.d.ts +7 -0
  41. package/components/DataGrid/RowCheckbox/types.js +1 -0
  42. package/components/DataGrid/constants.d.ts +2 -0
  43. package/components/DataGrid/constants.js +2 -0
  44. package/components/DataGrid/hooks/index.d.ts +1 -0
  45. package/components/DataGrid/hooks/index.js +1 -0
  46. package/components/DataGrid/hooks/useWarnRowsWithoutDisabledReason/index.d.ts +1 -0
  47. package/components/DataGrid/hooks/useWarnRowsWithoutDisabledReason/index.js +1 -0
  48. package/components/DataGrid/hooks/useWarnRowsWithoutDisabledReason/useWarnRowsWithoutDisabledReason.d.ts +5 -0
  49. package/components/DataGrid/hooks/useWarnRowsWithoutDisabledReason/useWarnRowsWithoutDisabledReason.js +17 -0
  50. package/components/DataGrid/index.d.ts +1 -1
  51. package/components/DataGrid/public.d.ts +1 -1
  52. package/components/DataGrid/styles.d.ts +4 -0
  53. package/components/DataGrid/styles.js +26 -0
  54. package/components/DataGrid/tests/performance/testDataGridPerformance.d.ts +3 -1
  55. package/components/DataGrid/tests/performance/testDataGridPerformance.js +234 -2
  56. package/components/DataGrid/tests/selection/testDataGridSelection.d.ts +14 -0
  57. package/components/DataGrid/tests/selection/testDataGridSelection.js +562 -0
  58. package/components/DataGrid/types.d.ts +41 -1
  59. package/components/DataGrid/useLogic/useLogic.d.ts +8 -3
  60. package/components/DataGrid/useLogic/useLogic.js +23 -10
  61. package/components/DataGrid/utils/checkIsMassActionsOpen/checkIsMassActionsOpen.d.ts +10 -0
  62. package/components/DataGrid/utils/checkIsMassActionsOpen/checkIsMassActionsOpen.js +4 -0
  63. package/components/DataGrid/utils/checkIsMassActionsOpen/index.d.ts +1 -0
  64. package/components/DataGrid/utils/checkIsMassActionsOpen/index.js +1 -0
  65. package/components/DataGrid/utils/getRowDisabledState/getRowDisabledState.d.ts +31 -0
  66. package/components/DataGrid/utils/getRowDisabledState/getRowDisabledState.js +20 -0
  67. package/components/DataGrid/utils/getRowDisabledState/index.d.ts +1 -0
  68. package/components/DataGrid/utils/getRowDisabledState/index.js +1 -0
  69. package/components/DataGrid/utils/index.d.ts +4 -0
  70. package/components/DataGrid/utils/index.js +4 -0
  71. package/components/DataGrid/utils/resolveRowDisabled/index.d.ts +1 -0
  72. package/components/DataGrid/utils/resolveRowDisabled/index.js +1 -0
  73. package/components/DataGrid/utils/resolveRowDisabled/resolveRowDisabled.d.ts +5 -0
  74. package/components/DataGrid/utils/resolveRowDisabled/resolveRowDisabled.js +17 -0
  75. package/components/DataGrid/utils/resolveRowsDisabled/index.d.ts +1 -0
  76. package/components/DataGrid/utils/resolveRowsDisabled/index.js +1 -0
  77. package/components/DataGrid/utils/resolveRowsDisabled/resolveRowsDisabled.d.ts +16 -0
  78. package/components/DataGrid/utils/resolveRowsDisabled/resolveRowsDisabled.js +17 -0
  79. package/components/DataGridActionCell/hooks/useBlockingActions/useBlockingActions.js +3 -3
  80. package/components/DataGridCollapsibleRow/useLogic/useLogic.d.ts +3 -2
  81. package/components/DataGridCollapsibleRow/useLogic/useLogic.js +4 -3
  82. package/components/DataGridInfinite/DataGridInfinite.js +18 -14
  83. package/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContext.d.ts +1 -1
  84. package/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContext.js +1 -1
  85. package/components/DataGridInfinite/Footer/Footer.d.ts +6 -0
  86. package/components/DataGridInfinite/Footer/Footer.js +25 -0
  87. package/components/DataGridInfinite/Footer/index.d.ts +2 -0
  88. package/components/DataGridInfinite/Footer/index.js +1 -0
  89. package/components/DataGridInfinite/Footer/types.d.ts +26 -0
  90. package/components/DataGridInfinite/Footer/types.js +1 -0
  91. package/components/DataGridInfinite/Row/Row.js +2 -2
  92. package/components/DataGridInfinite/Row/index.d.ts +1 -0
  93. package/components/DataGridInfinite/Row/types.d.ts +17 -2
  94. package/components/DataGridInfinite/Row/useLogic/useLogic.d.ts +4 -2
  95. package/components/DataGridInfinite/Row/useLogic/useLogic.js +12 -4
  96. package/components/DataGridInfinite/constants.d.ts +3 -0
  97. package/components/DataGridInfinite/constants.js +3 -0
  98. package/components/DataGridInfinite/faker.d.ts +1 -5
  99. package/components/DataGridInfinite/faker.js +1 -2
  100. package/components/DataGridInfinite/styles.d.ts +4 -0
  101. package/components/DataGridInfinite/styles.js +24 -0
  102. package/components/DataGridInfinite/useLogic/useLogic.d.ts +7 -3
  103. package/components/DataGridInfinite/useLogic/useLogic.js +52 -16
  104. package/components/DataGridMassActions/DataGridMassActions.d.ts +15 -0
  105. package/components/DataGridMassActions/DataGridMassActions.js +32 -0
  106. package/components/DataGridMassActions/constants.d.ts +4 -0
  107. package/components/DataGridMassActions/constants.js +5 -0
  108. package/components/DataGridMassActions/index.d.ts +2 -0
  109. package/components/DataGridMassActions/index.js +1 -0
  110. package/components/DataGridMassActions/public.d.ts +2 -0
  111. package/components/DataGridMassActions/public.js +1 -0
  112. package/components/DataGridMassActions/styles.d.ts +8 -0
  113. package/components/DataGridMassActions/styles.js +49 -0
  114. package/components/DataGridMassActions/tests/testDataGridMassActions.d.ts +23 -0
  115. package/components/DataGridMassActions/tests/testDataGridMassActions.js +77 -0
  116. package/components/DataGridMassActions/types.d.ts +2 -0
  117. package/components/DataGridMassActions/types.js +1 -0
  118. package/components/DataGridMassActions/useLogic/index.d.ts +1 -0
  119. package/components/DataGridMassActions/useLogic/index.js +1 -0
  120. package/components/DataGridMassActions/useLogic/useLogic.d.ts +6 -0
  121. package/components/DataGridMassActions/useLogic/useLogic.js +21 -0
  122. package/components/IconDropdownButton/IconDropdownButton.d.ts +5 -0
  123. package/components/IconDropdownButton/IconDropdownButton.js +2 -2
  124. package/components/MassActions/MassActions.d.ts +5 -0
  125. package/components/MassActions/MassActions.js +17 -0
  126. package/components/MassActions/constants.d.ts +6 -0
  127. package/components/MassActions/constants.js +12 -0
  128. package/components/MassActions/index.d.ts +2 -0
  129. package/components/MassActions/index.js +1 -0
  130. package/components/MassActions/styles.d.ts +34 -0
  131. package/components/MassActions/styles.js +43 -0
  132. package/components/MassActions/types.d.ts +20 -0
  133. package/components/MassActions/types.js +1 -0
  134. package/components/MassActions/useLogic/index.d.ts +1 -0
  135. package/components/MassActions/useLogic/index.js +1 -0
  136. package/components/MassActions/useLogic/useLogic.d.ts +7 -0
  137. package/components/MassActions/useLogic/useLogic.js +9 -0
  138. package/components/PageHeader/PageActions/SecondaryActions/styles.d.ts +1 -1
  139. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/index.d.ts +0 -1
  140. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/index.js +0 -1
  141. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/useLogic.js +2 -1
  142. package/components/index.d.ts +1 -1
  143. package/node/components/ActionGroup/ActionGroup.js +2 -2
  144. package/node/components/ActionGroup/SecondaryActions/SecondaryActions.d.ts +1 -1
  145. package/node/components/ActionGroup/SecondaryActions/SecondaryActions.js +2 -2
  146. package/node/components/ActionGroup/types.d.ts +9 -0
  147. package/node/components/DataGrid/Body/Body.d.ts +1 -1
  148. package/node/components/DataGrid/Body/Body.js +7 -3
  149. package/node/components/DataGrid/Body/types.d.ts +11 -3
  150. package/node/components/DataGrid/DataGrid.js +12 -5
  151. package/node/components/DataGrid/DataGridContext/DataGridProvider/DataGridProvider.d.ts +3 -2
  152. package/node/components/DataGrid/DataGridContext/DataGridProvider/DataGridProvider.js +3 -2
  153. package/node/components/DataGrid/DataGridSelectionContext/DataGridSelectionContext.d.ts +25 -0
  154. package/node/components/DataGrid/DataGridSelectionContext/DataGridSelectionContext.js +16 -0
  155. package/node/components/DataGrid/DataGridSelectionContext/DataGridSelectionProvider/DataGridSelectionProvider.d.ts +7 -0
  156. package/node/components/DataGrid/DataGridSelectionContext/DataGridSelectionProvider/DataGridSelectionProvider.js +12 -0
  157. package/node/components/DataGrid/DataGridSelectionContext/DataGridSelectionProvider/index.d.ts +1 -0
  158. package/node/components/DataGrid/DataGridSelectionContext/DataGridSelectionProvider/index.js +17 -0
  159. package/node/components/DataGrid/DataGridSelectionContext/index.d.ts +2 -0
  160. package/node/components/DataGrid/DataGridSelectionContext/index.js +18 -0
  161. package/node/components/DataGrid/PinnedSections/PinnedSections.js +2 -2
  162. package/node/components/DataGrid/PinnedSections/useLogic/useLogic.d.ts +1 -0
  163. package/node/components/DataGrid/PinnedSections/useLogic/useLogic.js +4 -3
  164. package/node/components/DataGrid/Row/Row.js +13 -9
  165. package/node/components/DataGrid/Row/RowContext/RowContext.d.ts +15 -4
  166. package/node/components/DataGrid/Row/RowContext/RowContext.js +3 -3
  167. package/node/components/DataGrid/Row/RowContext/RowProvider/RowProvider.d.ts +10 -1
  168. package/node/components/DataGrid/Row/RowContext/RowProvider/RowProvider.js +23 -17
  169. package/node/components/DataGrid/Row/types.d.ts +7 -3
  170. package/node/components/DataGrid/Row/useLogic/useLogic.d.ts +6 -4
  171. package/node/components/DataGrid/Row/useLogic/useLogic.js +23 -14
  172. package/node/components/DataGrid/RowBase/RowBase.js +5 -2
  173. package/node/components/DataGrid/RowBase/types.d.ts +9 -5
  174. package/node/components/DataGrid/RowBase/useLogic/useLogic.d.ts +5 -4
  175. package/node/components/DataGrid/RowBase/useLogic/useLogic.js +16 -10
  176. package/node/components/DataGrid/RowCheckbox/RowCheckbox.d.ts +5 -0
  177. package/node/components/DataGrid/RowCheckbox/RowCheckbox.js +17 -0
  178. package/node/components/DataGrid/RowCheckbox/constants.d.ts +4 -0
  179. package/node/components/DataGrid/RowCheckbox/constants.js +7 -0
  180. package/node/components/DataGrid/RowCheckbox/index.d.ts +1 -0
  181. package/node/components/DataGrid/RowCheckbox/index.js +17 -0
  182. package/node/components/DataGrid/RowCheckbox/types.d.ts +7 -0
  183. package/node/components/DataGrid/RowCheckbox/types.js +2 -0
  184. package/node/components/DataGrid/constants.d.ts +2 -0
  185. package/node/components/DataGrid/constants.js +2 -0
  186. package/node/components/DataGrid/hooks/index.d.ts +1 -0
  187. package/node/components/DataGrid/hooks/index.js +1 -0
  188. package/node/components/DataGrid/hooks/useWarnRowsWithoutDisabledReason/index.d.ts +1 -0
  189. package/node/components/DataGrid/hooks/useWarnRowsWithoutDisabledReason/index.js +17 -0
  190. package/node/components/DataGrid/hooks/useWarnRowsWithoutDisabledReason/useWarnRowsWithoutDisabledReason.d.ts +5 -0
  191. package/node/components/DataGrid/hooks/useWarnRowsWithoutDisabledReason/useWarnRowsWithoutDisabledReason.js +21 -0
  192. package/node/components/DataGrid/index.d.ts +1 -1
  193. package/node/components/DataGrid/public.d.ts +1 -1
  194. package/node/components/DataGrid/styles.d.ts +4 -0
  195. package/node/components/DataGrid/styles.js +27 -1
  196. package/node/components/DataGrid/tests/performance/testDataGridPerformance.d.ts +3 -1
  197. package/node/components/DataGrid/tests/performance/testDataGridPerformance.js +232 -0
  198. package/node/components/DataGrid/tests/selection/testDataGridSelection.d.ts +14 -0
  199. package/node/components/DataGrid/tests/selection/testDataGridSelection.js +566 -0
  200. package/node/components/DataGrid/types.d.ts +41 -1
  201. package/node/components/DataGrid/useLogic/useLogic.d.ts +8 -3
  202. package/node/components/DataGrid/useLogic/useLogic.js +25 -12
  203. package/node/components/DataGrid/utils/checkIsMassActionsOpen/checkIsMassActionsOpen.d.ts +10 -0
  204. package/node/components/DataGrid/utils/checkIsMassActionsOpen/checkIsMassActionsOpen.js +8 -0
  205. package/node/components/DataGrid/utils/checkIsMassActionsOpen/index.d.ts +1 -0
  206. package/node/components/DataGrid/utils/checkIsMassActionsOpen/index.js +5 -0
  207. package/node/components/DataGrid/utils/getRowDisabledState/getRowDisabledState.d.ts +31 -0
  208. package/node/components/DataGrid/utils/getRowDisabledState/getRowDisabledState.js +24 -0
  209. package/node/components/DataGrid/utils/getRowDisabledState/index.d.ts +1 -0
  210. package/node/components/DataGrid/utils/getRowDisabledState/index.js +5 -0
  211. package/node/components/DataGrid/utils/index.d.ts +4 -0
  212. package/node/components/DataGrid/utils/index.js +9 -1
  213. package/node/components/DataGrid/utils/resolveRowDisabled/index.d.ts +1 -0
  214. package/node/components/DataGrid/utils/resolveRowDisabled/index.js +5 -0
  215. package/node/components/DataGrid/utils/resolveRowDisabled/resolveRowDisabled.d.ts +5 -0
  216. package/node/components/DataGrid/utils/resolveRowDisabled/resolveRowDisabled.js +21 -0
  217. package/node/components/DataGrid/utils/resolveRowsDisabled/index.d.ts +1 -0
  218. package/node/components/DataGrid/utils/resolveRowsDisabled/index.js +5 -0
  219. package/node/components/DataGrid/utils/resolveRowsDisabled/resolveRowsDisabled.d.ts +16 -0
  220. package/node/components/DataGrid/utils/resolveRowsDisabled/resolveRowsDisabled.js +21 -0
  221. package/node/components/DataGridActionCell/hooks/useBlockingActions/useBlockingActions.js +3 -3
  222. package/node/components/DataGridCollapsibleRow/useLogic/useLogic.d.ts +3 -2
  223. package/node/components/DataGridCollapsibleRow/useLogic/useLogic.js +4 -3
  224. package/node/components/DataGridInfinite/DataGridInfinite.js +19 -15
  225. package/node/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContext.d.ts +1 -1
  226. package/node/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContext.js +1 -1
  227. package/node/components/DataGridInfinite/Footer/Footer.d.ts +6 -0
  228. package/node/components/DataGridInfinite/Footer/Footer.js +29 -0
  229. package/node/components/DataGridInfinite/Footer/index.d.ts +2 -0
  230. package/node/components/DataGridInfinite/Footer/index.js +17 -0
  231. package/node/components/DataGridInfinite/Footer/types.d.ts +26 -0
  232. package/node/components/DataGridInfinite/Footer/types.js +2 -0
  233. package/node/components/DataGridInfinite/Row/Row.js +2 -2
  234. package/node/components/DataGridInfinite/Row/index.d.ts +1 -0
  235. package/node/components/DataGridInfinite/Row/types.d.ts +17 -2
  236. package/node/components/DataGridInfinite/Row/useLogic/useLogic.d.ts +4 -2
  237. package/node/components/DataGridInfinite/Row/useLogic/useLogic.js +12 -4
  238. package/node/components/DataGridInfinite/constants.d.ts +3 -0
  239. package/node/components/DataGridInfinite/constants.js +3 -0
  240. package/node/components/DataGridInfinite/faker.d.ts +1 -5
  241. package/node/components/DataGridInfinite/faker.js +1 -2
  242. package/node/components/DataGridInfinite/styles.d.ts +4 -0
  243. package/node/components/DataGridInfinite/styles.js +27 -3
  244. package/node/components/DataGridInfinite/useLogic/useLogic.d.ts +7 -3
  245. package/node/components/DataGridInfinite/useLogic/useLogic.js +52 -16
  246. package/node/components/DataGridMassActions/DataGridMassActions.d.ts +15 -0
  247. package/node/components/DataGridMassActions/DataGridMassActions.js +36 -0
  248. package/node/components/DataGridMassActions/constants.d.ts +4 -0
  249. package/node/components/DataGridMassActions/constants.js +8 -0
  250. package/node/components/DataGridMassActions/index.d.ts +2 -0
  251. package/node/components/DataGridMassActions/index.js +5 -0
  252. package/node/components/DataGridMassActions/public.d.ts +2 -0
  253. package/node/components/DataGridMassActions/public.js +5 -0
  254. package/node/components/DataGridMassActions/styles.d.ts +8 -0
  255. package/node/components/DataGridMassActions/styles.js +52 -0
  256. package/node/components/DataGridMassActions/tests/testDataGridMassActions.d.ts +23 -0
  257. package/node/components/DataGridMassActions/tests/testDataGridMassActions.js +81 -0
  258. package/node/components/DataGridMassActions/types.d.ts +2 -0
  259. package/node/components/DataGridMassActions/types.js +2 -0
  260. package/node/components/DataGridMassActions/useLogic/index.d.ts +1 -0
  261. package/node/components/DataGridMassActions/useLogic/index.js +17 -0
  262. package/node/components/DataGridMassActions/useLogic/useLogic.d.ts +6 -0
  263. package/node/components/DataGridMassActions/useLogic/useLogic.js +25 -0
  264. package/node/components/IconDropdownButton/IconDropdownButton.d.ts +5 -0
  265. package/node/components/IconDropdownButton/IconDropdownButton.js +2 -2
  266. package/node/components/MassActions/MassActions.d.ts +5 -0
  267. package/node/components/MassActions/MassActions.js +21 -0
  268. package/node/components/MassActions/constants.d.ts +6 -0
  269. package/node/components/MassActions/constants.js +15 -0
  270. package/node/components/MassActions/index.d.ts +2 -0
  271. package/node/components/MassActions/index.js +5 -0
  272. package/node/components/MassActions/styles.d.ts +34 -0
  273. package/node/components/MassActions/styles.js +46 -0
  274. package/node/components/MassActions/types.d.ts +20 -0
  275. package/node/components/MassActions/types.js +2 -0
  276. package/node/components/MassActions/useLogic/index.d.ts +1 -0
  277. package/node/components/MassActions/useLogic/index.js +17 -0
  278. package/node/components/MassActions/useLogic/useLogic.d.ts +7 -0
  279. package/node/components/MassActions/useLogic/useLogic.js +13 -0
  280. package/node/components/PageHeader/PageActions/SecondaryActions/styles.d.ts +1 -1
  281. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/index.d.ts +0 -1
  282. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/index.js +0 -1
  283. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/useLogic.js +2 -1
  284. package/node/components/index.d.ts +1 -1
  285. package/package.json +1 -1
  286. /package/components/{Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount → useDelayedUnmount}/index.d.ts +0 -0
  287. /package/components/{Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount → useDelayedUnmount}/index.js +0 -0
  288. /package/components/{Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount → useDelayedUnmount}/useDelayedUnmount.d.ts +0 -0
  289. /package/components/{Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount → useDelayedUnmount}/useDelayedUnmount.js +0 -0
  290. /package/node/components/{Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount → useDelayedUnmount}/index.d.ts +0 -0
  291. /package/node/components/{Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount → useDelayedUnmount}/index.js +0 -0
  292. /package/node/components/{Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount → useDelayedUnmount}/useDelayedUnmount.d.ts +0 -0
  293. /package/node/components/{Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount → useDelayedUnmount}/useDelayedUnmount.js +0 -0
@@ -5,7 +5,7 @@ import { SecondaryActions } from './SecondaryActions';
5
5
  import { SecondaryVisibleActions } from './SecondaryVisibleActions';
6
6
  import { Wrapper } from './styles';
7
7
  export const ActionGroup = (props) => {
8
- const { main, secondary, secondaryVisible, className, size = 'medium', } = props;
8
+ const { main, secondary, secondaryVisible, secondaryPopoverProps, className, size = 'medium', } = props;
9
9
  const { disabledAction } = useActionsState({ main, secondary });
10
- return (_jsxs(Wrapper, { className: className, children: [secondary && (_jsx(SecondaryActions, { isDisabled: disabledAction, actions: secondary, size: size })), secondaryVisible && (_jsx(SecondaryVisibleActions, { actions: secondaryVisible, size: size })), main && (_jsx(MainActions, { isDisabled: disabledAction, actions: main, size: size }))] }));
10
+ return (_jsxs(Wrapper, { className: className, children: [secondary && (_jsx(SecondaryActions, { isDisabled: disabledAction, actions: secondary, size: size, popoverProps: secondaryPopoverProps })), secondaryVisible && (_jsx(SecondaryVisibleActions, { actions: secondaryVisible, size: size })), main && (_jsx(MainActions, { isDisabled: disabledAction, actions: main, size: size }))] }));
11
11
  };
@@ -1,3 +1,3 @@
1
1
  import { type ElementType } from 'react';
2
2
  import type { SecondaryActionProps } from '../types';
3
- export declare const SecondaryActions: <TSecondaryActionComponent extends ElementType = ElementType>({ actions, isDisabled, className, size, }: SecondaryActionProps<TSecondaryActionComponent>) => import("react/jsx-runtime").JSX.Element | null;
3
+ export declare const SecondaryActions: <TSecondaryActionComponent extends ElementType = ElementType>({ actions, isDisabled, className, size, popoverProps, }: SecondaryActionProps<TSecondaryActionComponent>) => import("react/jsx-runtime").JSX.Element | null;
@@ -5,10 +5,10 @@ import { IconDropdownButton } from '../../IconDropdownButton';
5
5
  import { ListItemButton } from '../../ListItemButton';
6
6
  import { ListItemText } from '../../ListItemText';
7
7
  const TOOLTIP_PLACEMENT = 'right';
8
- export const SecondaryActions = ({ actions, isDisabled, className, size, }) => {
8
+ export const SecondaryActions = ({ actions, isDisabled, className, size, popoverProps, }) => {
9
9
  if (!actions.length) {
10
10
  return null;
11
11
  }
12
- return (_jsx(IconDropdownButton, { disabled: isDisabled, icon: _jsx(DotsOutlineMd, {}), variant: "outlined", color: "grey", size: size, className: className, children: actions.map(({ text, ...secondaryProps }) => (_createElement(ListItemButton, { tooltipPlacement: TOOLTIP_PLACEMENT, ...secondaryProps, key: text },
12
+ return (_jsx(IconDropdownButton, { disabled: isDisabled, icon: _jsx(DotsOutlineMd, {}), variant: "outlined", color: "grey", size: size, className: className, popoverProps: popoverProps, children: actions.map(({ text, ...secondaryProps }) => (_createElement(ListItemButton, { tooltipPlacement: TOOLTIP_PLACEMENT, ...secondaryProps, key: text },
13
13
  _jsx(ListItemText, { primary: text })))) }));
14
14
  };
@@ -1,6 +1,7 @@
1
1
  import type { ComponentProps, ElementType, ReactElement, ReactNode } from 'react';
2
2
  import type { ButtonProps, ButtonSize } from '../Button';
3
3
  import type { DropdownButtonProps } from '../DropdownButton';
4
+ import type { IconDropdownButtonProps } from '../IconDropdownButton';
4
5
  import type { ListItemButtonProps } from '../ListItemButton';
5
6
  import type { MenuItemProps } from '../MenuItem';
6
7
  import type { TooltipProps } from '../Tooltip';
@@ -143,6 +144,10 @@ export type SecondaryActionProps<TSecondaryActionComponent extends ElementType>
143
144
  */
144
145
  className?: string;
145
146
  size?: ButtonSize;
147
+ /**
148
+ * Пропсы Popover меню второстепенных действий
149
+ */
150
+ popoverProps?: IconDropdownButtonProps['popoverProps'];
146
151
  };
147
152
  /** Модель второстепенного видимого экшена */
148
153
  export type SecondaryVisibleAction = Omit<ButtonProps, 'children'> & {
@@ -177,6 +182,10 @@ export type ActionGroupProps<TMainActionComponent extends ElementType = ElementT
177
182
  * Второстепенные действия, спрятанные за троеточием
178
183
  */
179
184
  secondary?: SecondaryAction<TSecondaryActionComponent>[];
185
+ /**
186
+ * Пропсы Popover меню второстепенных действий
187
+ */
188
+ secondaryPopoverProps?: IconDropdownButtonProps['popoverProps'];
180
189
  /**
181
190
  * Видимые второстепенные действия
182
191
  */
@@ -1,2 +1,2 @@
1
1
  import type { BodyProps } from './types';
2
- export declare const Body: <TData extends Record<string, unknown>>({ rows, selectedRows, minDisplayRows, keyId, noDataPlaceholder, className, renderRow, columns, isSelectable, onSelectRow, onRowEnter, onRowLeave, registerRowElement, unregisterRowElement, ...rowProps }: BodyProps<TData>) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const Body: <TData extends Record<string, unknown>>({ rows, selectedIds, rowsDisabled, getRowDisabled, minDisplayRows, keyId, noDataPlaceholder, className, renderRow, columns, isSelectable, onSelectRow, onRowEnter, onRowLeave, registerRowElement, unregisterRowElement, ...rowProps }: BodyProps<TData>) => import("react/jsx-runtime").JSX.Element;
@@ -15,13 +15,17 @@ const bodyCva = cva(bodyClassnames.root, {
15
15
  },
16
16
  },
17
17
  });
18
- export const Body = ({ rows, selectedRows = [], minDisplayRows, keyId, noDataPlaceholder, className, renderRow, columns, isSelectable, onSelectRow, onRowEnter, onRowLeave, registerRowElement, unregisterRowElement, ...rowProps }) => {
18
+ export const Body = ({ rows, selectedIds, rowsDisabled, getRowDisabled, minDisplayRows, keyId, noDataPlaceholder, className, renderRow, columns, isSelectable, onSelectRow, onRowEnter, onRowLeave, registerRowElement, unregisterRowElement, ...rowProps }) => {
19
19
  const { disableMinHeight, bodyCssVars } = useLogic({ minDisplayRows });
20
20
  const renderedRows = rows.map((row, index) => {
21
21
  const rowId = row[keyId];
22
- const isSelected = Boolean(selectedRows?.find((selectedRow) => selectedRow[keyId] === rowId));
22
+ const isSelected = selectedIds.has(rowId);
23
+ const rowDisabled = rowsDisabled.get(rowId);
23
24
  const { children, options } = row;
24
- return (_jsx(RowContextProvider, { row: row, onSelectRow: onSelectRow, onRowEnter: onRowEnter, onRowLeave: onRowLeave, registerRowElement: registerRowElement, unregisterRowElement: unregisterRowElement, isSelectable: isSelectable, isSelected: isSelected, children: renderRow ? (_jsx(CustomRowWrapper, { index: index, renderRow: renderRow, row: row })) : (_jsx(Row, { row: row, options: options, keyId: keyId, level: INITIAL_LEVEL, nestedChildren: children, isSelected: isSelected, columns: columns, isSelectable: isSelectable, onSelectRow: onSelectRow, onRowEnter: onRowEnter, onRowLeave: onRowLeave, registerRowElement: registerRowElement, unregisterRowElement: unregisterRowElement, ...rowProps }, rowId)) }, rowId));
25
+ const hasNestedChildren = Array.isArray(children) && children.length > 0;
26
+ return (_jsx(RowContextProvider, { row: row, onSelectRow: onSelectRow, onRowEnter: onRowEnter, onRowLeave: onRowLeave, registerRowElement: registerRowElement, unregisterRowElement: unregisterRowElement, isSelectable: isSelectable, isSelected: isSelected, disabledMode: rowDisabled?.mode, disabledReason: rowDisabled?.reason, children: renderRow ? (_jsx(CustomRowWrapper, { index: index, renderRow: renderRow, row: row })) : (_jsx(Row, { row: row, options: options, keyId: keyId, level: INITIAL_LEVEL, nestedChildren: children, isSelected: isSelected,
27
+ // Функция нужна только для расчёта блокировки вложенных строк, остальным не передаём, чтобы не сбрасывать memo
28
+ getRowDisabled: hasNestedChildren ? getRowDisabled : undefined, columns: columns, isSelectable: isSelectable, onSelectRow: onSelectRow, onRowEnter: onRowEnter, onRowLeave: onRowLeave, registerRowElement: registerRowElement, unregisterRowElement: unregisterRowElement, ...rowProps }, rowId)) }, rowId));
25
29
  });
26
30
  return (_jsx(Wrapper, { className: cn(className, bodyCva({ disableMinHeight })), style: bodyCssVars, children: rows.length ? renderedRows : noDataPlaceholder }));
27
31
  };
@@ -1,6 +1,6 @@
1
1
  import { type ChangeEvent, type ReactNode } from 'react';
2
2
  import { type Variant } from '../enums';
3
- import { type CellValue, type DataGridColumns, type DataGridRowOptions } from '../types';
3
+ import { type CellValue, type DataGridColumns, type DataGridProps, type DataGridRowDisabled, type DataGridRowOptions } from '../types';
4
4
  export type BodyProps<TData extends Record<string, CellValue>> = {
5
5
  /**
6
6
  * Конфигурация колонок для таблицы
@@ -46,9 +46,17 @@ export type BodyProps<TData extends Record<string, CellValue>> = {
46
46
  */
47
47
  isSelectable?: boolean;
48
48
  /**
49
- * Массив выбранных строк
49
+ * Идентификаторы выбранных строк
50
50
  */
51
- selectedRows?: TData[];
51
+ selectedIds: Set<unknown>;
52
+ /**
53
+ * Блокировки строк по идентификатору
54
+ */
55
+ rowsDisabled: Map<unknown, DataGridRowDisabled | undefined>;
56
+ /**
57
+ * Функция блокировки для вложенных строк
58
+ */
59
+ getRowDisabled?: DataGridProps<TData>['getRowDisabled'];
52
60
  /**
53
61
  * Массив данных для отображения
54
62
  */
@@ -15,7 +15,7 @@ import { Loader } from './Loader';
15
15
  import { MobileSkeleton } from './MobileSkeleton';
16
16
  import { NoData } from './NoData';
17
17
  import { PinnedSections } from './PinnedSections';
18
- import { Container, DataGridWrapper, DisabledDataGridWrapper } from './styles';
18
+ import { Container, DataGridWrapper, DisabledDataGridWrapper, MassActionsAnchor, } from './styles';
19
19
  import { useLogic } from './useLogic';
20
20
  const pinnedSectionsCva = cva(dataGridClassnames.pinnedSections, {
21
21
  variants: {
@@ -26,6 +26,12 @@ const pinnedSectionsCva = cva(dataGridClassnames.pinnedSections, {
26
26
  });
27
27
  const dataGridCva = cva(dataGridClassnames.root, {
28
28
  variants: {
29
+ hasMassActions: {
30
+ true: dataGridClassnames.hasMassActions,
31
+ },
32
+ isMassActionsOpen: {
33
+ true: dataGridClassnames.massActionsOpen,
34
+ },
29
35
  hasPinnedColumns: {
30
36
  true: dataGridClassnames.hasPinnedSections,
31
37
  },
@@ -56,9 +62,9 @@ const bodyCva = cva(dataGridClassnames.body, {
56
62
  },
57
63
  });
58
64
  export const DataGrid = (props) => {
59
- const { dataGridClassName, isDataGridDisabled, treeRenderConfig, headColumns, headProps, bodyProps, gridColumns, loaderProps, renderRows, isAllowHorizontalScroll, isHideHead, hasPinnedColumns, contentStateProps, rowHoverProps, containerRef, sections, isNoData, isMobile, mobileSkeletonProps, isLoading, containerCssVars, hasGroupedColumns, gridViewMode, mobileDisplayVariant, isSelfContained, } = useLogic(props);
65
+ const { dataGridClassName, isDataGridDisabled, treeRenderConfig, headColumns, headProps, bodyProps, gridColumns, loaderProps, renderRows, isAllowHorizontalScroll, isHideHead, hasPinnedColumns, contentStateProps, rowHoverProps, containerRef, sections, isNoData, isMobile, mobileSkeletonProps, isLoading, containerCssVars, hasGroupedColumns, gridViewMode, mobileDisplayVariant, isSelfContained, isMassActionsOpen, hasMassActions, } = useLogic(props);
60
66
  const { emptySymbol } = useContext(ConfigContext);
61
- const { columns, selectedRows = [], minDisplayRows = MIN_DISPLAY_ROWS_BY_DEFAULT, variant = Variant.Tree, footer, noDataPlaceholder, subrows, keyId, activeRowId, emptyCellValue = emptySymbol, onRowClick, noDataOptions, headPreAddon, isTabularNums, renderRow, renderLink, } = props;
67
+ const { columns, selectedRows = [], onSelectRow, minDisplayRows = MIN_DISPLAY_ROWS_BY_DEFAULT, variant = Variant.Tree, footer, massActions, noDataPlaceholder, subrows, keyId, activeRowId, emptyCellValue = emptySymbol, onRowClick, noDataOptions, headPreAddon, isTabularNums, renderRow, renderLink, } = props;
62
68
  const { moreButtonColumnPosition = 1, isVisibleCollapseButton = true } = subrows || {};
63
69
  const { isInitialExpanded = false, expandedLevel = EXPANDED_LEVEL_BY_DEFAULT, initialVisibleChildrenCount = INITIAL_OPENED_NESTED_CHILDREN_COUNT_BY_DEFAULT, } = treeRenderConfig || {};
64
70
  const Wrapper = isDataGridDisabled
@@ -73,7 +79,6 @@ export const DataGrid = (props) => {
73
79
  const commonBodyProps = {
74
80
  ...bodyProps,
75
81
  keyId,
76
- selectedRows,
77
82
  minDisplayRows,
78
83
  rows: renderRows,
79
84
  variant,
@@ -98,12 +103,14 @@ export const DataGrid = (props) => {
98
103
  isDisabled: isDataGridDisabled,
99
104
  }), isDisabled: isDataGridDisabled, headProps: headProps, gridColumns: gridColumns, bodyProps: commonBodyProps, isNoData: isNoData }) }));
100
105
  };
101
- return (_jsx(DataGridContextProvider, { isLoading: isLoading, isTabularNums: isTabularNums, gridColumns: gridColumns, emptyCellValue: emptyCellValue, activeRowId: activeRowId, keyId: keyId, columns: columns, onRowClick: onRowClick, mobileDisplayVariant: mobileDisplayVariant, renderLink: renderLink, children: _jsxs(Container, { ref: containerRef, style: containerCssVars, className: cn(dataGridClassName, dataGridCva({
106
+ return (_jsx(DataGridContextProvider, { isLoading: isLoading, isTabularNums: isTabularNums, gridColumns: gridColumns, emptyCellValue: emptyCellValue, activeRowId: activeRowId, keyId: keyId, columns: columns, onRowClick: onRowClick, mobileDisplayVariant: mobileDisplayVariant, renderLink: renderLink, selectedRows: selectedRows, onSelectRow: onSelectRow, isMassActionsOpen: isMassActionsOpen, children: _jsxs(Container, { ref: containerRef, style: containerCssVars, className: cn(dataGridClassName, dataGridCva({
102
107
  isAllowHorizontalScroll,
103
108
  hasPinnedColumns,
104
109
  gridViewMode,
105
110
  hasGroupedColumns,
106
111
  mobileDisplayVariant,
107
112
  isSelfContained,
108
- })), children: [renderTableContent(), _jsx(Loader, { ...loaderProps }), footer && footer] }) }));
113
+ hasMassActions,
114
+ isMassActionsOpen,
115
+ })), children: [renderTableContent(), _jsx(Loader, { ...loaderProps }), massActions && _jsx(MassActionsAnchor, { children: massActions }), footer && footer] }) }));
109
116
  };
@@ -1,7 +1,8 @@
1
1
  import { type ReactNode } from 'react';
2
+ import { type DataGridSelectionContextProps } from '../../DataGridSelectionContext';
2
3
  import { type DataGridContextProps } from '../DataGridContext';
3
- type DataGridContextProviderProps = Pick<DataGridContextProps, 'isLoading' | 'isTabularNums' | 'gridColumns' | 'emptyCellValue' | 'activeRowId' | 'keyId' | 'columns' | 'onRowClick' | 'mobileDisplayVariant' | 'renderLink'> & {
4
+ type DataGridContextProviderProps = Pick<DataGridContextProps, 'isLoading' | 'isTabularNums' | 'gridColumns' | 'emptyCellValue' | 'activeRowId' | 'keyId' | 'columns' | 'onRowClick' | 'mobileDisplayVariant' | 'renderLink'> & Partial<DataGridSelectionContextProps> & {
4
5
  children: ReactNode;
5
6
  };
6
- export declare const DataGridContextProvider: ({ isLoading, isTabularNums, gridColumns, emptyCellValue, activeRowId, children, keyId, columns, onRowClick, mobileDisplayVariant, renderLink, }: DataGridContextProviderProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const DataGridContextProvider: ({ isLoading, isTabularNums, gridColumns, emptyCellValue, activeRowId, children, keyId, columns, onRowClick, mobileDisplayVariant, renderLink, selectedRows, onSelectRow, isMassActionsOpen, }: DataGridContextProviderProps) => import("react/jsx-runtime").JSX.Element;
7
8
  export {};
@@ -1,8 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useMemo } from 'react';
3
+ import { DataGridSelectionProvider, } from '../../DataGridSelectionContext';
3
4
  import { DataGridStorageProvider } from '../../DataGridStorageContext';
4
5
  import { DataGridContext } from '../DataGridContext';
5
- export const DataGridContextProvider = ({ isLoading, isTabularNums, gridColumns, emptyCellValue, activeRowId, children, keyId, columns, onRowClick, mobileDisplayVariant, renderLink, }) => {
6
+ export const DataGridContextProvider = ({ isLoading, isTabularNums, gridColumns, emptyCellValue, activeRowId, children, keyId, columns, onRowClick, mobileDisplayVariant, renderLink, selectedRows, onSelectRow, isMassActionsOpen, }) => {
6
7
  const contextValue = useMemo(() => ({
7
8
  isLoading,
8
9
  isTabularNums,
@@ -26,5 +27,5 @@ export const DataGridContextProvider = ({ isLoading, isTabularNums, gridColumns,
26
27
  mobileDisplayVariant,
27
28
  renderLink,
28
29
  ]);
29
- return (_jsx(DataGridContext.Provider, { value: contextValue, children: _jsx(DataGridStorageProvider, { children: children }) }));
30
+ return (_jsx(DataGridContext.Provider, { value: contextValue, children: _jsx(DataGridSelectionProvider, { selectedRows: selectedRows, onSelectRow: onSelectRow, isMassActionsOpen: isMassActionsOpen, children: _jsx(DataGridStorageProvider, { children: children }) }) }));
30
31
  };
@@ -0,0 +1,25 @@
1
+ /// <reference types="react" />
2
+ import { type ContextOnChangeSelectedRows, type ContextSelectedRows } from '../types';
3
+ export type DataGridSelectionContextProps = {
4
+ /**
5
+ * Выбранные строки таблицы
6
+ */
7
+ selectedRows: ContextSelectedRows;
8
+ /**
9
+ * Обработчик изменения выбора, переданный в таблицу.
10
+ */
11
+ onSelectRow?: ContextOnChangeSelectedRows;
12
+ /**
13
+ * Флаг отображения панели массовых действий
14
+ */
15
+ isMassActionsOpen: boolean;
16
+ };
17
+ /**
18
+ * Контекст выбранных строк таблицы для панели массовых действий.
19
+ *
20
+ * Вынесен из `DataGridContext`, чтобы изменение выбора не вызывало ре-рендер всех строк и ячеек:
21
+ * контекст читает только панель массовых действий.
22
+ *
23
+ * Провайдер подключается внутри `DataGridContextProvider`.
24
+ */
25
+ export declare const DataGridSelectionContext: import("react").Context<DataGridSelectionContextProps>;
@@ -0,0 +1,13 @@
1
+ import { createContext } from 'react';
2
+ /**
3
+ * Контекст выбранных строк таблицы для панели массовых действий.
4
+ *
5
+ * Вынесен из `DataGridContext`, чтобы изменение выбора не вызывало ре-рендер всех строк и ячеек:
6
+ * контекст читает только панель массовых действий.
7
+ *
8
+ * Провайдер подключается внутри `DataGridContextProvider`.
9
+ */
10
+ export const DataGridSelectionContext = createContext({
11
+ selectedRows: [],
12
+ isMassActionsOpen: false,
13
+ });
@@ -0,0 +1,7 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type DataGridSelectionContextProps } from '../DataGridSelectionContext';
3
+ type DataGridSelectionProviderProps = Partial<DataGridSelectionContextProps> & {
4
+ children: ReactNode;
5
+ };
6
+ export declare const DataGridSelectionProvider: ({ selectedRows, onSelectRow, isMassActionsOpen, children, }: DataGridSelectionProviderProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import { DataGridSelectionContext, } from '../DataGridSelectionContext';
4
+ const EMPTY_SELECTED_ROWS = [];
5
+ export const DataGridSelectionProvider = ({ selectedRows = EMPTY_SELECTED_ROWS, onSelectRow, isMassActionsOpen = false, children, }) => {
6
+ const contextValue = useMemo(() => ({ selectedRows, onSelectRow, isMassActionsOpen }), [selectedRows, onSelectRow, isMassActionsOpen]);
7
+ return (_jsx(DataGridSelectionContext.Provider, { value: contextValue, children: children }));
8
+ };
@@ -0,0 +1 @@
1
+ export * from './DataGridSelectionProvider';
@@ -0,0 +1 @@
1
+ export * from './DataGridSelectionProvider';
@@ -0,0 +1,2 @@
1
+ export * from './DataGridSelectionContext';
2
+ export * from './DataGridSelectionProvider';
@@ -0,0 +1,2 @@
1
+ export * from './DataGridSelectionContext';
2
+ export * from './DataGridSelectionProvider';
@@ -4,8 +4,8 @@ import { Section } from './Section';
4
4
  import { PinnedColumnsContainer } from './styles';
5
5
  import { useLogic } from './useLogic';
6
6
  export const PinnedSections = ({ gridColumns, className, isDisabled, headProps, bodyProps, sections, isNoData, }) => {
7
- const { pinnedContainerStyles, sectionOffsets } = useLogic({ sections });
7
+ const { pinnedContainerStyles, sectionOffsets, totalColumnsCount } = useLogic({ sections });
8
8
  return (_jsx(PinnedColumnsContainer, { "$gridColumns": gridColumns, className: className, ...getInertProps(isDisabled), style: pinnedContainerStyles, children: sections.map(({ columns, position }) => {
9
- return (_jsx(Section, { columns: columns, position: position, sectionOffset: sectionOffsets[position], bodyProps: bodyProps, headProps: headProps, isNoData: isNoData }, position));
9
+ return (_jsx(Section, { columns: columns, position: position, sectionOffset: sectionOffsets[position], bodyProps: { ...bodyProps, totalColumnsCount }, headProps: headProps, isNoData: isNoData }, position));
10
10
  }) }));
11
11
  };
@@ -5,5 +5,6 @@ type UseLogicParams<TData extends Record<string, CellValue> = DataGridRow> = Pic
5
5
  export declare const useLogic: <TData extends Record<string, unknown> = DataGridRow>({ sections, }: UseLogicParams<TData>) => {
6
6
  pinnedContainerStyles: CSSProperties;
7
7
  sectionOffsets: Record<string, number>;
8
+ totalColumnsCount: number;
8
9
  };
9
10
  export {};
@@ -11,14 +11,15 @@ export const useLogic = ({ sections, }) => {
11
11
  ? getFlattenColumns(rightColumns).length
12
12
  : 0,
13
13
  };
14
- const sectionOffsets = useMemo(() => {
14
+ // Строка в секции видит только свои колонки, поэтому для поиска последней ячейки таблицы ей передаётся общее число колонок всех секций
15
+ const { sectionOffsets, totalColumnsCount } = useMemo(() => {
15
16
  const offsets = {};
16
17
  let currentOffset = 0;
17
18
  sections.forEach((section) => {
18
19
  offsets[section.position] = currentOffset;
19
20
  currentOffset += getFlattenColumns(section.columns).length;
20
21
  });
21
- return offsets;
22
+ return { sectionOffsets: offsets, totalColumnsCount: currentOffset };
22
23
  }, [sections]);
23
- return { pinnedContainerStyles, sectionOffsets };
24
+ return { pinnedContainerStyles, sectionOffsets, totalColumnsCount };
24
25
  };
@@ -1,12 +1,12 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Fragment, memo, useCallback } from 'react';
3
3
  import { BottomDrawer } from '../../BottomDrawer';
4
- import { Checkbox } from '../../Checkbox';
5
4
  import { Tooltip } from '../../Tooltip';
6
5
  import { cn } from '../../utils/cn';
7
6
  import { cva } from '../../utils/cva';
8
7
  import { getInertProps } from '../../utils/getInertProps';
9
8
  import { dataGridCellClassnames } from '../Cell';
9
+ import { RowCheckbox } from '../RowCheckbox';
10
10
  import { isGroupColumns } from '../utils';
11
11
  import { DISABLE_ROW_ATTR, dataGridGroupedColumnLabelClassnames, dataGridRowCellClassnames, dataGridRowClassnames, dataGridRowContentClassnames, } from './constants';
12
12
  import { NestedChildren } from './NestedChildren';
@@ -57,17 +57,17 @@ const singleCellCva = cva(dataGridRowCellClassnames.single, {
57
57
  * который позволяет полностью контролировать рендер каждой строки.
58
58
  */
59
59
  const RowInner = (props) => {
60
- const { isOpen, isShowConnector, childrenColumns, rowId, handleToggle, checkboxProps, rowProps, isHovered, tooltipProps, nestedChildrenProps, disabled, isRenderCollapseButton, rowRef, rowStyles, drawerProps, disabledReasonText, isActive, isSelectable, mobileDisplayVariant, rootRowElement, rootRowRef, } = useLogic(props);
61
- const { className, row, options, variant, gridColumns, isInitialExpanded, expandedLevel, level, nestedChildren, initialVisibleChildrenCount, moreButtonColumnPosition, isVisibleCollapseButton, columns, emptyCellValue, activeRowId, keyId, onSelectRow, onRowClick, sectionOffset, totalColumnsCount, registerRowElement, unregisterRowElement, onRowEnter, onRowLeave, style,
60
+ const { isOpen, isShowConnector, childrenColumns, rowId, handleToggle, checkboxProps, rowProps, isHovered, tooltipProps, nestedChildrenProps, isDisabled, isDisabledLastCell, isRenderCollapseButton, rowRef, rowStyles, drawerProps, disabledReason, isActive, isSelectable, mobileDisplayVariant, rootRowElement, rootRowRef, } = useLogic(props);
61
+ const { className, row, options, variant, gridColumns, isInitialExpanded, expandedLevel, level, nestedChildren, initialVisibleChildrenCount, moreButtonColumnPosition, isVisibleCollapseButton, columns, emptyCellValue, activeRowId, keyId, onSelectRow, onRowClick, sectionOffset, totalColumnsCount, registerRowElement, unregisterRowElement, onRowEnter, onRowLeave, style, getRowDisabled, isNested,
62
62
  // В этот rest-оператор попадают специфичные пропсы (атрибуты) virtuoso
63
63
  // Необходимы для DataGridInfinite
64
64
  ...selfProps } = props;
65
- const { isDisabledLastCell = true, isNotSelectable, href, target, } = options || {};
65
+ const { isNotSelectable, href, target } = options || {};
66
66
  const renderStartAdornment = () => {
67
67
  if (!isRenderCollapseButton && (!isSelectable || isNotSelectable)) {
68
68
  return null;
69
69
  }
70
- return (_jsxs(_Fragment, { children: [isRenderCollapseButton && (_jsx(CollapseCell, { children: _jsx(CollapseButton, { variant: "text", onClick: handleToggle, children: _jsx(ChevronIcon, { "$isActive": isOpen }) }) })), isSelectable && !isNotSelectable && (_jsx(CheckboxCell, { ...getInertProps(disabled), onClick: (event) => event.stopPropagation(), className: dataGridRowClassnames.checkbox, children: _jsx(Checkbox, { ...checkboxProps }) }))] }));
70
+ return (_jsxs(_Fragment, { children: [isRenderCollapseButton && (_jsx(CollapseCell, { children: _jsx(CollapseButton, { variant: "text", onClick: handleToggle, children: _jsx(ChevronIcon, { "$isActive": isOpen }) }) })), isSelectable && !isNotSelectable && (_jsx(CheckboxCell, { ...getInertProps(isDisabled), onClick: (event) => event.stopPropagation(), className: dataGridRowClassnames.checkbox, children: _jsx(RowCheckbox, { ...checkboxProps }) }))] }));
71
71
  };
72
72
  const renderCells = useCallback(() => {
73
73
  const lastCellGlobalIndex = (totalColumnsCount ?? columns.length) - 1;
@@ -77,7 +77,7 @@ const RowInner = (props) => {
77
77
  return columns?.map((cell, index) => {
78
78
  const cellId = `${rowId}-${index}`;
79
79
  const globalIndex = (sectionOffset ?? 0) + index;
80
- const isDisabledCell = checkIsDisabled(disabled, availableCellsByIndex, globalIndex);
80
+ const isDisabledCell = checkIsDisabled(isDisabled, availableCellsByIndex, globalIndex);
81
81
  const isFirstCell = globalIndex === 0;
82
82
  if (isGroupColumns(cell)) {
83
83
  const { label, children, hideTitleOnMobile, isHideOnMobile } = cell;
@@ -95,13 +95,16 @@ const RowInner = (props) => {
95
95
  row,
96
96
  isOpen,
97
97
  columns,
98
- disabled,
98
+ isDisabled,
99
+ isDisabledLastCell,
99
100
  checkboxProps.checked,
101
+ checkboxProps.disabled,
102
+ checkboxProps.disabledReason,
100
103
  totalColumnsCount,
101
104
  sectionOffset,
102
105
  rootRowElement,
103
106
  ]);
104
- const renderRow = useCallback(({ key, ...nestedRowProps }) => (_jsx(RowInner, { keyId: keyId, ...nestedRowProps, variant: variant, isSelectable: isSelectable, gridColumns: gridColumns, isInitialExpanded: isInitialExpanded, expandedLevel: expandedLevel, initialVisibleChildrenCount: initialVisibleChildrenCount, moreButtonColumnPosition: moreButtonColumnPosition, isVisibleCollapseButton: isVisibleCollapseButton, activeRowId: activeRowId, columns: childrenColumns, onSelectRow: onSelectRow, onRowClick: onRowClick, totalColumnsCount: totalColumnsCount, registerRowElement: registerRowElement, unregisterRowElement: unregisterRowElement, onRowEnter: onRowEnter, onRowLeave: onRowLeave, sectionOffset: sectionOffset }, key)), [
107
+ const renderRow = useCallback(({ key, ...nestedRowProps }) => (_jsx(RowInner, { keyId: keyId, ...nestedRowProps, variant: variant, isSelectable: isSelectable, gridColumns: gridColumns, isInitialExpanded: isInitialExpanded, expandedLevel: expandedLevel, initialVisibleChildrenCount: initialVisibleChildrenCount, moreButtonColumnPosition: moreButtonColumnPosition, isVisibleCollapseButton: isVisibleCollapseButton, activeRowId: activeRowId, columns: childrenColumns, onSelectRow: onSelectRow, onRowClick: onRowClick, totalColumnsCount: totalColumnsCount, registerRowElement: registerRowElement, unregisterRowElement: unregisterRowElement, onRowEnter: onRowEnter, onRowLeave: onRowLeave, sectionOffset: sectionOffset, getRowDisabled: getRowDisabled, isNested: true }, key)), [
105
108
  keyId,
106
109
  variant,
107
110
  isSelectable,
@@ -120,11 +123,12 @@ const RowInner = (props) => {
120
123
  unregisterRowElement,
121
124
  onRowEnter,
122
125
  onRowLeave,
126
+ getRowDisabled,
123
127
  ]);
124
128
  return (_jsxs(Wrapper, { className: cn(className, rootCva({
125
129
  isShowConnector,
126
130
  mobileDisplayVariant,
127
131
  hasNestedChildren: Boolean(nestedChildren?.length),
128
- })), style: rowStyles, ...selfProps, ref: rootRowRef, children: [_jsx(Tooltip, { followCursor: true, arrow: false, ...tooltipProps, children: _jsx(ContentWrapper, { "data-row-id": rowId, ref: rowRef, onPointerEnter: () => onRowEnter?.(rowId), onPointerLeave: (event) => onRowLeave?.(rowId, event.nativeEvent), className: rowContentCva({ isHovered, isActive }), "$gridColumns": gridColumns, [DISABLE_ROW_ATTR]: disabled, ...rowProps, children: renderCells() }) }), _jsx(NestedChildren, { ...nestedChildrenProps, data: nestedChildren, keyId: keyId, level: level, variant: variant, gridColumns: gridColumns, initialVisibleChildrenCount: initialVisibleChildrenCount, moreButtonColumnPosition: moreButtonColumnPosition, renderRow: renderRow }), _jsx(BottomDrawer, { ...drawerProps, children: _jsx(BottomDrawerContent, { children: disabledReasonText }) })] }, `row-${rowId}`));
132
+ })), style: rowStyles, ...selfProps, ref: rootRowRef, children: [_jsx(Tooltip, { followCursor: true, arrow: false, ...tooltipProps, children: _jsx(ContentWrapper, { "data-row-id": rowId, ref: rowRef, onPointerEnter: () => onRowEnter?.(rowId), onPointerLeave: (event) => onRowLeave?.(rowId, event.nativeEvent), className: rowContentCva({ isHovered, isActive }), "$gridColumns": gridColumns, [DISABLE_ROW_ATTR]: isDisabled, ...rowProps, children: renderCells() }) }), _jsx(NestedChildren, { ...nestedChildrenProps, data: nestedChildren, keyId: keyId, level: level, variant: variant, gridColumns: gridColumns, initialVisibleChildrenCount: initialVisibleChildrenCount, moreButtonColumnPosition: moreButtonColumnPosition, renderRow: renderRow }), _jsx(BottomDrawer, { ...drawerProps, children: _jsx(BottomDrawerContent, { children: disabledReason }) })] }, `row-${rowId}`));
129
133
  };
130
134
  export const Row = memo(RowInner);
@@ -1,10 +1,17 @@
1
1
  import { type ChangeEvent } from 'react';
2
+ import { type DataGridRowDisabled } from '../../types';
2
3
  export type RowContextProps = {
3
- isDisabled: boolean;
4
+ /**
5
+ * Если true, в строке выполняется блокирующее действие DataGridActionCell
6
+ */
7
+ hasBlockingAction: boolean;
8
+ /**
9
+ * Причина блокировки от блокирующего действия
10
+ */
11
+ blockingActionReason?: string;
12
+ addBlockingAction: (reason?: string) => void;
13
+ removeBlockingAction: () => void;
4
14
  isSelectable?: boolean;
5
- disabledReason?: string;
6
- addDisabledRow: (disabledReason?: string) => void;
7
- removeDisabledRow: () => void;
8
15
  row: Record<string, unknown>;
9
16
  onSelectRow: (row: Record<string, unknown>) => (event: ChangeEvent<HTMLInputElement>) => void;
10
17
  onRowEnter?: (rowId: string) => void;
@@ -13,5 +20,9 @@ export type RowContextProps = {
13
20
  unregisterRowElement?: (rowId: string, el: HTMLElement) => void;
14
21
  itemProps?: object;
15
22
  isSelected?: boolean;
23
+ /**
24
+ * Итоговая блокировка строки, рассчитанная resolveRowDisabled
25
+ */
26
+ rowDisabled?: DataGridRowDisabled;
16
27
  };
17
28
  export declare const RowContext: import("react").Context<RowContextProps>;
@@ -1,9 +1,9 @@
1
1
  import { createContext } from 'react';
2
2
  export const RowContext = createContext({
3
- isDisabled: false,
3
+ hasBlockingAction: false,
4
4
  isSelectable: false,
5
- addDisabledRow: () => undefined,
6
- removeDisabledRow: () => undefined,
5
+ addBlockingAction: () => undefined,
6
+ removeBlockingAction: () => undefined,
7
7
  row: {},
8
8
  onSelectRow: () => () => undefined,
9
9
  onRowEnter: () => undefined,
@@ -1,7 +1,16 @@
1
1
  import { type ReactNode } from 'react';
2
+ import { type DataGridRowDisabled } from '../../../types';
2
3
  import { type RowContextProps } from '../RowContext';
3
4
  type RowContextProviderProps = Pick<RowContextProps, 'row' | 'itemProps' | 'onSelectRow' | 'onRowEnter' | 'onRowLeave' | 'registerRowElement' | 'unregisterRowElement' | 'isSelectable' | 'isSelected'> & {
5
+ /**
6
+ * Режим блокировки строки
7
+ */
8
+ disabledMode?: DataGridRowDisabled['mode'];
9
+ /**
10
+ * Причина блокировки строки
11
+ */
12
+ disabledReason?: string;
4
13
  children: ReactNode;
5
14
  };
6
- export declare const RowContextProvider: ({ row, itemProps, onSelectRow, onRowEnter, onRowLeave, registerRowElement, unregisterRowElement, children, isSelectable, isSelected, }: RowContextProviderProps) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const RowContextProvider: ({ row, itemProps, onSelectRow, onRowEnter, onRowLeave, registerRowElement, unregisterRowElement, children, isSelectable, isSelected, disabledMode, disabledReason, }: RowContextProviderProps) => import("react/jsx-runtime").JSX.Element;
7
16
  export {};
@@ -1,23 +1,27 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useCallback, useMemo, useState } from 'react';
3
3
  import { RowContext } from '../RowContext';
4
- export const RowContextProvider = ({ row, itemProps, onSelectRow, onRowEnter, onRowLeave, registerRowElement, unregisterRowElement, children, isSelectable, isSelected, }) => {
5
- const [isDisabled, setDisabled] = useState(false);
6
- const [disabledReason, setDisabledReason] = useState();
7
- const addDisabledRow = useCallback((reason) => {
8
- setDisabled(true);
9
- setDisabledReason(reason);
4
+ export const RowContextProvider = ({ row, itemProps, onSelectRow, onRowEnter, onRowLeave, registerRowElement, unregisterRowElement, children, isSelectable, isSelected, disabledMode, disabledReason, }) => {
5
+ const [hasBlockingAction, setHasBlockingAction] = useState(false);
6
+ const [blockingActionReason, setBlockingActionReason] = useState();
7
+ const addBlockingAction = useCallback((reason) => {
8
+ setHasBlockingAction(true);
9
+ setBlockingActionReason(reason);
10
10
  }, []);
11
- const removeDisabledRow = useCallback(() => {
12
- setDisabled(false);
13
- setDisabledReason(undefined);
11
+ const removeBlockingAction = useCallback(() => {
12
+ setHasBlockingAction(false);
13
+ setBlockingActionReason(undefined);
14
14
  }, []);
15
+ // Блокировка приходит примитивами, чтобы новый объект с тем же содержимым не обновлял контекст
16
+ const rowDisabled = useMemo(() => disabledMode
17
+ ? { mode: disabledMode, reason: disabledReason ?? '' }
18
+ : undefined, [disabledMode, disabledReason]);
15
19
  const contextValue = useMemo(() => ({
16
- isDisabled,
20
+ hasBlockingAction,
21
+ blockingActionReason,
22
+ addBlockingAction,
23
+ removeBlockingAction,
17
24
  isSelectable,
18
- disabledReason,
19
- addDisabledRow,
20
- removeDisabledRow,
21
25
  row,
22
26
  itemProps,
23
27
  onSelectRow,
@@ -26,12 +30,13 @@ export const RowContextProvider = ({ row, itemProps, onSelectRow, onRowEnter, on
26
30
  registerRowElement,
27
31
  unregisterRowElement,
28
32
  isSelected,
33
+ rowDisabled,
29
34
  }), [
30
- isDisabled,
35
+ hasBlockingAction,
36
+ blockingActionReason,
37
+ addBlockingAction,
38
+ removeBlockingAction,
31
39
  isSelectable,
32
- disabledReason,
33
- addDisabledRow,
34
- removeDisabledRow,
35
40
  row,
36
41
  itemProps,
37
42
  onSelectRow,
@@ -40,6 +45,7 @@ export const RowContextProvider = ({ row, itemProps, onSelectRow, onRowEnter, on
40
45
  registerRowElement,
41
46
  unregisterRowElement,
42
47
  isSelected,
48
+ rowDisabled,
43
49
  ]);
44
50
  return (_jsx(RowContext.Provider, { value: contextValue, children: children }));
45
51
  };
@@ -1,6 +1,6 @@
1
1
  import { type ChangeEvent, type CSSProperties, type ReactNode } from 'react';
2
2
  import { type Variant } from '../enums';
3
- import { type CellValue, type DataGridColumns, type DataGridRowOptions } from '../types';
3
+ import { type CellValue, type DataGridColumns, type DataGridProps, type DataGridRowOptions } from '../types';
4
4
  export type RowProps<TData extends Record<string, CellValue>> = {
5
5
  /**
6
6
  * Название класса, применяется к корневому компоненту
@@ -71,9 +71,13 @@ export type RowProps<TData extends Record<string, CellValue>> = {
71
71
  */
72
72
  isSelected?: boolean;
73
73
  /**
74
- * Массив выбранных строк
74
+ * Если true, строка вложенная и сама вычисляет блокировку
75
75
  */
76
- selectedRows?: TData[];
76
+ isNested?: boolean;
77
+ /**
78
+ * Функция блокировки для вложенных строк. Передаётся только строкам с дочерними элементами
79
+ */
80
+ getRowDisabled?: DataGridProps<TData>['getRowDisabled'];
77
81
  /**
78
82
  * Заглушка для пустых ячеек (если отсутствует field и filter и renderCell)
79
83
  * @default '-'
@@ -2,8 +2,8 @@ import { type MouseEvent, type SyntheticEvent } from 'react';
2
2
  import type { CellValue } from '../../types';
3
3
  import type { RowProps } from '../types';
4
4
  type UseLogicParams<TData extends Record<string, CellValue>> = RowProps<TData>;
5
- export declare const useLogic: <TData extends Record<string, unknown>>({ keyId, columns, row, nestedChildren, level, variant, options, isInitialExpanded, expandedLevel, isSelectable, isSelected, onSelectRow, onRowClick, isVisibleCollapseButton, registerRowElement, unregisterRowElement, style, activeRowId, }: UseLogicParams<TData>) => {
6
- disabledReasonText: string | undefined;
5
+ export declare const useLogic: <TData extends Record<string, unknown>>({ keyId, columns, row, nestedChildren, level, variant, options, isInitialExpanded, expandedLevel, isSelectable, isSelected, getRowDisabled, isNested, onSelectRow, onRowClick, isVisibleCollapseButton, registerRowElement, unregisterRowElement, style, activeRowId, }: UseLogicParams<TData>) => {
6
+ disabledReason: string | undefined;
7
7
  rowStyles: {
8
8
  accentColor?: import("csstype").Property.AccentColor | undefined;
9
9
  alignContent?: import("csstype").Property.AlignContent | undefined;
@@ -869,7 +869,8 @@ export declare const useLogic: <TData extends Record<string, unknown>>({ keyId,
869
869
  childrenColumns: any[];
870
870
  rowId: string;
871
871
  rowRef: (element: HTMLElement | null) => void;
872
- disabled: boolean | undefined;
872
+ isDisabled: boolean;
873
+ isDisabledLastCell: boolean;
873
874
  isSelectable: boolean | undefined;
874
875
  isRenderCollapseButton: boolean;
875
876
  handleToggle: (event: MouseEvent<HTMLButtonElement>) => void;
@@ -895,7 +896,8 @@ export declare const useLogic: <TData extends Record<string, unknown>>({ keyId,
895
896
  };
896
897
  checkboxProps: {
897
898
  checked: boolean | undefined;
898
- disabled: boolean | undefined;
899
+ disabled: boolean;
900
+ disabledReason: string | undefined;
899
901
  onChange: (event: import("react").ChangeEvent<HTMLInputElement, Element>) => void;
900
902
  };
901
903
  nestedChildrenProps: {