@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
@@ -1,5 +1,5 @@
1
1
  export { DataGrid } from './DataGrid';
2
- export type { DataGridProps, DataGridRenderLink, DataGridRenderLinkParams, DataGridColumns, DataGridSingleColumn, DataGridRow, DataGridRowOptions, DataGridSort, DataGridRowWithOptions, DataGridRowOptionColumns, } from './types';
2
+ export type { DataGridProps, DataGridRenderLink, DataGridRenderLinkParams, DataGridColumns, DataGridSingleColumn, DataGridRow, DataGridRowOptions, DataGridRowDisabled, DataGridSort, DataGridRowWithOptions, DataGridRowOptionColumns, } from './types';
3
3
  export { dataGridClassnames } from './constants';
4
4
  export { MobileSkeleton } from './MobileSkeleton';
5
5
  export { RowBase, type RowBaseProps } from './RowBase';
@@ -1,3 +1,3 @@
1
1
  export { dataGridClassnames } from './constants';
2
2
  export { DataGrid } from './DataGrid';
3
- export type { DataGridColumns, DataGridProps, DataGridRenderLink, DataGridRenderLinkParams, DataGridRow, DataGridRowOptionColumns, DataGridRowOptions, DataGridRowWithOptions, DataGridSort, } from './types';
3
+ export type { DataGridColumns, DataGridProps, DataGridRenderLink, DataGridRenderLinkParams, DataGridRow, DataGridRowDisabled, DataGridRowOptionColumns, DataGridRowOptions, DataGridRowWithOptions, DataGridSort, } from './types';
@@ -13,3 +13,7 @@ export declare const DisabledDataGridWrapper: import("@emotion/styled/dist/decla
13
13
  } & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
14
14
  theme?: import("@emotion/react").Theme | undefined;
15
15
  }, {}, {}>;
16
+ export declare const MassActionsAnchor: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
17
+ theme?: import("@emotion/react").Theme | undefined;
18
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
19
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DisabledDataGridWrapper = exports.DataGridWrapper = exports.Container = void 0;
3
+ exports.MassActionsAnchor = exports.DisabledDataGridWrapper = exports.DataGridWrapper = exports.Container = void 0;
4
4
  const styled_1 = require("../styled");
5
5
  const constants_1 = require("./Body/constants");
6
6
  const constants_2 = require("./Cell/constants");
@@ -10,6 +10,9 @@ const constants_4 = require("./Row/constants");
10
10
  exports.Container = styled_1.styled.div `
11
11
  --max-height: initial;
12
12
 
13
+ /* Место под открытой панелью массовых действий: высота панели + отступ */
14
+ --mass-actions-reserved-space: 96px;
15
+
13
16
  position: relative;
14
17
 
15
18
  overflow: hidden;
@@ -155,6 +158,24 @@ exports.Container = styled_1.styled.div `
155
158
  }
156
159
  }
157
160
  }
161
+
162
+ &.${constants_3.dataGridClassnames.hasMassActions} {
163
+ /* Резерв места под панель массовых действий убирается одновременно с анимацией её скрытия, чтобы строки не прыгали */
164
+ & .${constants_3.dataGridClassnames.wrapper} .${constants_3.dataGridClassnames.body},
165
+ & .${constants_3.dataGridClassnames.pinnedSections} {
166
+ transition: padding-bottom
167
+ ${({ theme }) => theme.transitions.duration.leavingScreen}ms
168
+ ${({ theme }) => theme.transitions.easing.easeIn};
169
+ }
170
+
171
+ /* Пока панель массовых действий открыта, последние строки не должны перекрываться ею */
172
+ &.${constants_3.dataGridClassnames.massActionsOpen} {
173
+ & .${constants_3.dataGridClassnames.wrapper} .${constants_3.dataGridClassnames.body},
174
+ & .${constants_3.dataGridClassnames.pinnedSections} {
175
+ padding-bottom: var(--mass-actions-reserved-space);
176
+ }
177
+ }
178
+ }
158
179
  `;
159
180
  exports.DataGridWrapper = styled_1.styled.div `
160
181
  position: relative;
@@ -180,3 +201,8 @@ exports.DisabledDataGridWrapper = (0, styled_1.styled)(exports.DataGridWrapper)
180
201
  opacity: 0.7;
181
202
  }
182
203
  `;
204
+ exports.MassActionsAnchor = styled_1.styled.div `
205
+ position: relative;
206
+
207
+ height: 0;
208
+ `;
@@ -1,11 +1,13 @@
1
1
  import { type ReactElement, type ReactNode } from 'react';
2
- import { type DataGridColumns, type DataGridRowWithOptions } from '../../types';
2
+ import { type DataGridColumns, type DataGridProps, type DataGridRowDisabled, type DataGridRowWithOptions } from '../../types';
3
3
  type RenderRow = (row: Record<string, unknown>, index: number) => ReactNode;
4
4
  type GridRenderProps = {
5
5
  rows: DataGridRowWithOptions<DataItem>[];
6
6
  columns: DataGridColumns<DataItem>[];
7
7
  selectedRows?: DataItem[];
8
8
  onSelectRow?: (rows: DataItem[]) => void;
9
+ getRowDisabled?: (row: DataItem) => DataGridRowDisabled | undefined;
10
+ tree?: DataGridProps<DataItem>['tree'];
9
11
  renderRow?: RenderRow;
10
12
  onRetry: () => void;
11
13
  };
@@ -10,6 +10,22 @@ const TEST_ROWS = [
10
10
  { id: '2', name: 'Petya' },
11
11
  { id: '3', name: 'Ivan' },
12
12
  ];
13
+ const TEST_ROWS_WITH_CHILDREN = [
14
+ ...TEST_ROWS,
15
+ {
16
+ id: '4',
17
+ name: 'Package',
18
+ children: [{ id: '4-1', name: 'Nested' }],
19
+ },
20
+ ];
21
+ const SELECTION_DISABLED = {
22
+ mode: 'selection',
23
+ reason: 'Документ отправляется',
24
+ };
25
+ const ROW_DISABLED = {
26
+ mode: 'row',
27
+ reason: 'Документ отправляется',
28
+ };
13
29
  const testDataGridPerformance = ({ render, renderGrid, }) => {
14
30
  const getRenderCountFor = (spy, id) => spy.mock.calls.filter(([row]) => row.id === id).length;
15
31
  (0, vitest_1.it)('При клике на чекбокс перерендеривается только выбранная строка', async () => {
@@ -102,5 +118,221 @@ const testDataGridPerformance = ({ render, renderGrid, }) => {
102
118
  (0, vitest_1.expect)(getRenderCountFor(renderCellSpy, '2')).toBe(0);
103
119
  (0, vitest_1.expect)(getRenderCountFor(renderCellSpy, '3')).toBe(1);
104
120
  });
121
+ (0, vitest_1.describe)('getRowDisabled', () => {
122
+ const createColumns = (renderCell) => [
123
+ { field: 'name', label: 'Наименование', renderCell },
124
+ ];
125
+ const getRenderCounts = (spy, ids) => Object.fromEntries(ids.map((id) => [id, getRenderCountFor(spy, id)]));
126
+ const setupSelectableGrid = () => {
127
+ const renderCellSpy = vitest_1.vi.fn((row) => row.name);
128
+ const getRowDisabledSpy = vitest_1.vi.fn(() => undefined);
129
+ const TestComponent = () => {
130
+ const [selectedRows, setSelectedRows] = (0, react_1.useState)([]);
131
+ const columns = (0, react_1.useMemo)(() => createColumns(renderCellSpy), []);
132
+ return renderGrid({
133
+ rows: TEST_ROWS,
134
+ columns,
135
+ selectedRows,
136
+ onSelectRow: setSelectedRows,
137
+ getRowDisabled: getRowDisabledSpy,
138
+ onRetry: () => { },
139
+ });
140
+ };
141
+ render((0, jsx_runtime_1.jsx)(TestComponent, {}));
142
+ renderCellSpy.mockClear();
143
+ getRowDisabledSpy.mockClear();
144
+ return { renderCellSpy, getRowDisabledSpy };
145
+ };
146
+ const setupParentRerender = () => {
147
+ const renderCellSpy = vitest_1.vi.fn((row) => row.name);
148
+ const getRowDisabledSpy = vitest_1.vi.fn(() => undefined);
149
+ const TestComponent = () => {
150
+ const [, setCounter] = (0, react_1.useState)(0);
151
+ const columns = (0, react_1.useMemo)(() => createColumns(renderCellSpy), []);
152
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("button", { onClick: () => setCounter((value) => value + 1), children: "Rerender" }), renderGrid({
153
+ rows: TEST_ROWS,
154
+ columns,
155
+ selectedRows: [],
156
+ onSelectRow: () => { },
157
+ getRowDisabled: getRowDisabledSpy,
158
+ onRetry: () => { },
159
+ })] }));
160
+ };
161
+ render((0, jsx_runtime_1.jsx)(TestComponent, {}));
162
+ renderCellSpy.mockClear();
163
+ getRowDisabledSpy.mockClear();
164
+ return { renderCellSpy, getRowDisabledSpy };
165
+ };
166
+ const setupChangedResult = () => {
167
+ const renderCellSpy = vitest_1.vi.fn((row) => row.name);
168
+ const getRowDisabledSpy = vitest_1.vi.fn();
169
+ const TestComponent = () => {
170
+ const [lockedId, setLockedId] = (0, react_1.useState)();
171
+ const columns = (0, react_1.useMemo)(() => createColumns(renderCellSpy), []);
172
+ const getRowDisabled = (0, react_1.useCallback)((row) => {
173
+ getRowDisabledSpy(row);
174
+ return row.id === lockedId ? SELECTION_DISABLED : undefined;
175
+ }, [lockedId]);
176
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("button", { onClick: () => setLockedId('2'), children: "Lock row 2" }), renderGrid({
177
+ rows: TEST_ROWS,
178
+ columns,
179
+ selectedRows: [],
180
+ onSelectRow: () => { },
181
+ getRowDisabled,
182
+ onRetry: () => { },
183
+ })] }));
184
+ };
185
+ render((0, jsx_runtime_1.jsx)(TestComponent, {}));
186
+ renderCellSpy.mockClear();
187
+ getRowDisabledSpy.mockClear();
188
+ return { renderCellSpy, getRowDisabledSpy };
189
+ };
190
+ const setupSameResult = () => {
191
+ const renderCellSpy = vitest_1.vi.fn((row) => row.name);
192
+ const getRowDisabledSpy = vitest_1.vi.fn();
193
+ const TestComponent = () => {
194
+ const [counter, setCounter] = (0, react_1.useState)(0);
195
+ const columns = (0, react_1.useMemo)(() => createColumns(renderCellSpy), []);
196
+ const getRowDisabled = (0, react_1.useCallback)((row) => {
197
+ getRowDisabledSpy(row);
198
+ return undefined;
199
+ }, [counter]);
200
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("button", { onClick: () => setCounter((value) => value + 1), children: "New function" }), renderGrid({
201
+ rows: TEST_ROWS_WITH_CHILDREN,
202
+ columns,
203
+ selectedRows: [],
204
+ onSelectRow: () => { },
205
+ getRowDisabled,
206
+ tree: { isInitialExpanded: true },
207
+ onRetry: () => { },
208
+ })] }));
209
+ };
210
+ render((0, jsx_runtime_1.jsx)(TestComponent, {}));
211
+ renderCellSpy.mockClear();
212
+ getRowDisabledSpy.mockClear();
213
+ return { renderCellSpy, getRowDisabledSpy };
214
+ };
215
+ (0, vitest_1.describe)('Клик на чекбокс', () => {
216
+ (0, vitest_1.it)('Перерендеривается только выбранная строка', async () => {
217
+ const { renderCellSpy } = setupSelectableGrid();
218
+ // 0 - "Выбрать все", 1 - первая строка
219
+ await tests_1.userEvents.click(tests_1.screen.getAllByRole('checkbox')[2]);
220
+ (0, vitest_1.expect)(getRenderCounts(renderCellSpy, ['1', '2', '3'])).toEqual({
221
+ '1': 0,
222
+ '2': 1,
223
+ '3': 0,
224
+ });
225
+ });
226
+ (0, vitest_1.it)('getRowDisabled не вызывается', async () => {
227
+ const { getRowDisabledSpy } = setupSelectableGrid();
228
+ await tests_1.userEvents.click(tests_1.screen.getAllByRole('checkbox')[2]);
229
+ (0, vitest_1.expect)(getRowDisabledSpy).not.toHaveBeenCalled();
230
+ });
231
+ });
232
+ (0, vitest_1.it)('getRowDisabled не вызывается при «Выбрать все»', async () => {
233
+ const { getRowDisabledSpy } = setupSelectableGrid();
234
+ await tests_1.userEvents.click(tests_1.screen.getAllByRole('checkbox')[0]);
235
+ (0, vitest_1.expect)(getRowDisabledSpy).not.toHaveBeenCalled();
236
+ });
237
+ (0, vitest_1.describe)('Перерисовка родителя со стабильной функцией', () => {
238
+ (0, vitest_1.it)('Строки не перерисовываются', async () => {
239
+ const { renderCellSpy } = setupParentRerender();
240
+ await tests_1.userEvents.click(tests_1.screen.getByText('Rerender'));
241
+ (0, vitest_1.expect)(renderCellSpy).not.toHaveBeenCalled();
242
+ });
243
+ (0, vitest_1.it)('getRowDisabled не вызывается', async () => {
244
+ const { getRowDisabledSpy } = setupParentRerender();
245
+ await tests_1.userEvents.click(tests_1.screen.getByText('Rerender'));
246
+ (0, vitest_1.expect)(getRowDisabledSpy).not.toHaveBeenCalled();
247
+ });
248
+ });
249
+ (0, vitest_1.describe)('Новая функция с изменившимся результатом', () => {
250
+ (0, vitest_1.it)('Перерендеривается только строка с изменившимся результатом', async () => {
251
+ const { renderCellSpy } = setupChangedResult();
252
+ await tests_1.userEvents.click(tests_1.screen.getByText('Lock row 2'));
253
+ (0, vitest_1.expect)(getRenderCounts(renderCellSpy, ['1', '2', '3'])).toEqual({
254
+ '1': 0,
255
+ '2': 1,
256
+ '3': 0,
257
+ });
258
+ });
259
+ (0, vitest_1.it)('getRowDisabled вызывается один раз на строку', async () => {
260
+ const { getRowDisabledSpy } = setupChangedResult();
261
+ await tests_1.userEvents.click(tests_1.screen.getByText('Lock row 2'));
262
+ (0, vitest_1.expect)(getRowDisabledSpy).toHaveBeenCalledTimes(TEST_ROWS.length);
263
+ });
264
+ });
265
+ (0, vitest_1.describe)('Новая функция с тем же результатом', () => {
266
+ (0, vitest_1.it)('Перерисовываются только строки с дочерними элементами', async () => {
267
+ const { renderCellSpy } = setupSameResult();
268
+ await tests_1.userEvents.click(tests_1.screen.getByText('New function'));
269
+ (0, vitest_1.expect)(getRenderCounts(renderCellSpy, ['1', '2', '3', '4', '4-1'])).toEqual({ '1': 0, '2': 0, '3': 0, '4': 1, '4-1': 1 });
270
+ });
271
+ (0, vitest_1.it)('getRowDisabled вызывается один раз на строку, включая вложенную', async () => {
272
+ const { getRowDisabledSpy } = setupSameResult();
273
+ await tests_1.userEvents.click(tests_1.screen.getByText('New function'));
274
+ // 4 строки и 1 вложенная
275
+ (0, vitest_1.expect)(getRowDisabledSpy).toHaveBeenCalledTimes(5);
276
+ });
277
+ });
278
+ // Virtuoso отдаёт строкам новые данные на рендер позже родителя: состояние строки
279
+ // не должно приходить раньше данных и перерисовывать строку дважды
280
+ (0, vitest_1.describe)('Новые rows вместе с изменением состояния строки', () => {
281
+ const createVersionRows = (version) => TEST_ROWS.map((row) => ({ ...row, name: `${row.name} v${version}` }));
282
+ const setupRowsUpdate = () => {
283
+ const renderCellSpy = vitest_1.vi.fn((row) => row.name);
284
+ const TestComponent = () => {
285
+ const [version, setVersion] = (0, react_1.useState)(0);
286
+ const [isOptionsLocked, setOptionsLocked] = (0, react_1.useState)(false);
287
+ const [lockedId, setLockedId] = (0, react_1.useState)();
288
+ const [selectedRows, setSelectedRows] = (0, react_1.useState)([]);
289
+ const columns = (0, react_1.useMemo)(() => createColumns(renderCellSpy), []);
290
+ const versionRows = (0, react_1.useMemo)(() => createVersionRows(version), [version]);
291
+ // Заново создаётся только заблокированная строка, остальные сохраняют ссылки
292
+ const rows = (0, react_1.useMemo)(() => versionRows.map((row) => isOptionsLocked && row.id === '2'
293
+ ? { ...row, options: { isDisabled: true } }
294
+ : row), [versionRows, isOptionsLocked]);
295
+ const getRowDisabled = (0, react_1.useCallback)((row) => (row.id === lockedId ? ROW_DISABLED : undefined), [lockedId]);
296
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("button", { onClick: () => setOptionsLocked(true), children: "Lock via options" }), (0, jsx_runtime_1.jsx)("button", { onClick: () => {
297
+ setVersion(1);
298
+ setSelectedRows([TEST_ROWS[1]]);
299
+ }, children: "Refetch and select" }), (0, jsx_runtime_1.jsx)("button", { onClick: () => {
300
+ setVersion(1);
301
+ setLockedId('2');
302
+ }, children: "Refetch and lock" }), renderGrid({
303
+ rows,
304
+ columns,
305
+ selectedRows,
306
+ onSelectRow: setSelectedRows,
307
+ getRowDisabled,
308
+ onRetry: () => { },
309
+ })] }));
310
+ };
311
+ render((0, jsx_runtime_1.jsx)(TestComponent, {}));
312
+ renderCellSpy.mockClear();
313
+ return { renderCellSpy };
314
+ };
315
+ (0, vitest_1.it)('Строка перерисовывается один раз при блокировке через options', async () => {
316
+ const { renderCellSpy } = setupRowsUpdate();
317
+ await tests_1.userEvents.click(tests_1.screen.getByText('Lock via options'));
318
+ (0, vitest_1.expect)(getRenderCounts(renderCellSpy, ['1', '2', '3'])).toEqual({
319
+ '1': 0,
320
+ '2': 1,
321
+ '3': 0,
322
+ });
323
+ });
324
+ vitest_1.it.each([
325
+ { condition: 'изменении выбора', action: 'Refetch and select' },
326
+ {
327
+ condition: 'блокировке через getRowDisabled',
328
+ action: 'Refetch and lock',
329
+ },
330
+ ])('Строки перерисовываются один раз и сразу с новыми данными при $condition', async ({ action }) => {
331
+ const { renderCellSpy } = setupRowsUpdate();
332
+ await tests_1.userEvents.click(tests_1.screen.getByText(action));
333
+ (0, vitest_1.expect)(renderCellSpy.mock.calls.map(([row]) => row.name)).toEqual(['Vasya v1', 'Petya v1', 'Ivan v1']);
334
+ });
335
+ });
336
+ });
105
337
  };
106
338
  exports.testDataGridPerformance = testDataGridPerformance;
@@ -0,0 +1,14 @@
1
+ import { type RenderResult } from '@ui/dev/tests';
2
+ import { type ReactElement } from 'react';
3
+ import { type DataGridProps } from '../../types';
4
+ type DataItem = {
5
+ id: string | number;
6
+ name: string;
7
+ };
8
+ type GridRenderProps = Pick<DataGridProps<DataItem>, 'rows' | 'columns' | 'selectedRows' | 'onSelectRow' | 'getRowDisabled' | 'onRowClick' | 'variant' | 'tree' | 'onRetry'>;
9
+ type TestDataGridSelectionParams = {
10
+ render: (ui: ReactElement) => Pick<RenderResult, 'rerender'>;
11
+ renderGrid: (props: GridRenderProps) => ReactElement;
12
+ };
13
+ export declare const testDataGridSelection: ({ render, renderGrid, }: TestDataGridSelectionParams) => void;
14
+ export {};