@astral/ui 4.73.1 → 4.75.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 (475) hide show
  1. package/components/CardGridInfinite/CardGridInfinite.js +11 -2
  2. package/components/CardGridInfinite/styles.js +4 -0
  3. package/components/CardGridInfinite/useLogic/useLogic.d.ts +1 -1
  4. package/components/CardGridInfinite/useLogic/useLogic.js +3 -13
  5. package/components/Chevron/Chevron.d.ts +1 -1
  6. package/components/ConfirmAction/ConfirmAction.js +3 -3
  7. package/components/ConfirmAction/constants.d.ts +1 -0
  8. package/components/ConfirmAction/constants.js +1 -0
  9. package/components/ConfirmAction/styles.js +13 -0
  10. package/components/ConfirmAction/types.d.ts +1 -1
  11. package/components/DataGrid/Body/Body.d.ts +1 -1
  12. package/components/DataGrid/Body/Body.js +5 -3
  13. package/components/DataGrid/Body/types.d.ts +5 -0
  14. package/components/DataGrid/Cell/Cell.d.ts +9 -1
  15. package/components/DataGrid/Cell/Cell.js +16 -2
  16. package/components/DataGrid/CustomRowWrapper/CustomRowWrapper.d.ts +19 -0
  17. package/components/DataGrid/CustomRowWrapper/CustomRowWrapper.js +15 -0
  18. package/components/DataGrid/CustomRowWrapper/index.d.ts +1 -0
  19. package/components/DataGrid/CustomRowWrapper/index.js +1 -0
  20. package/components/DataGrid/DataGrid.js +14 -3
  21. package/components/DataGrid/DataGridContext/DataGridContext.d.ts +9 -5
  22. package/components/DataGrid/DataGridContext/DataGridContext.js +7 -4
  23. package/components/DataGrid/DataGridContext/DataGridProvider/DataGridProvider.d.ts +3 -4
  24. package/components/DataGrid/DataGridContext/DataGridProvider/DataGridProvider.js +18 -48
  25. package/components/DataGrid/DataGridStorageContext/DataGridStorageContext.d.ts +29 -0
  26. package/components/DataGrid/DataGridStorageContext/DataGridStorageContext.js +28 -0
  27. package/components/DataGrid/DataGridStorageContext/DataGridStorageProvider/DataGridStorageProvider.d.ts +6 -0
  28. package/components/DataGrid/DataGridStorageContext/DataGridStorageProvider/DataGridStorageProvider.js +12 -0
  29. package/components/DataGrid/DataGridStorageContext/DataGridStorageProvider/index.d.ts +1 -0
  30. package/components/DataGrid/DataGridStorageContext/DataGridStorageProvider/index.js +1 -0
  31. package/components/DataGrid/DataGridStorageContext/index.d.ts +2 -0
  32. package/components/DataGrid/DataGridStorageContext/index.js +2 -0
  33. package/components/DataGrid/MobileSkeleton/MobileSkeleton.d.ts +2 -1
  34. package/components/DataGrid/MobileSkeleton/MobileSkeleton.js +21 -3
  35. package/components/DataGrid/MobileSkeleton/styles.js +12 -0
  36. package/components/DataGrid/Row/NestedChildren/NestedChildren.d.ts +1 -5
  37. package/components/DataGrid/Row/NestedChildren/NestedChildren.js +17 -7
  38. package/components/DataGrid/Row/NestedChildren/constants.d.ts +6 -0
  39. package/components/DataGrid/Row/NestedChildren/constants.js +7 -0
  40. package/components/DataGrid/Row/NestedChildren/styles.js +42 -3
  41. package/components/DataGrid/Row/NestedChildren/useLogic/useLogic.d.ts +1 -1
  42. package/components/DataGrid/Row/NestedChildren/useLogic/useLogic.js +4 -6
  43. package/components/DataGrid/Row/Row.js +34 -37
  44. package/components/DataGrid/Row/RowContext/RowContext.d.ts +10 -1
  45. package/components/DataGrid/Row/RowContext/RowContext.js +9 -0
  46. package/components/DataGrid/Row/RowContext/RowProvider/RowProvider.d.ts +3 -2
  47. package/components/DataGrid/Row/RowContext/RowProvider/RowProvider.js +25 -2
  48. package/components/DataGrid/Row/constants.d.ts +6 -0
  49. package/components/DataGrid/Row/constants.js +6 -0
  50. package/components/DataGrid/Row/styles.js +102 -3
  51. package/components/DataGrid/Row/useLogic/hooks/useMobileLogic.d.ts +1 -0
  52. package/components/DataGrid/Row/useLogic/hooks/useMobileLogic.js +1 -1
  53. package/components/DataGrid/Row/useLogic/useLogic.d.ts +5 -2
  54. package/components/DataGrid/Row/useLogic/useLogic.js +21 -19
  55. package/components/DataGrid/RowBase/GroupCell/GroupCell.d.ts +2 -0
  56. package/components/DataGrid/RowBase/GroupCell/GroupCell.js +22 -0
  57. package/components/DataGrid/RowBase/GroupCell/constants.d.ts +4 -0
  58. package/components/DataGrid/RowBase/GroupCell/constants.js +5 -0
  59. package/components/DataGrid/RowBase/GroupCell/index.d.ts +1 -0
  60. package/components/DataGrid/RowBase/GroupCell/index.js +1 -0
  61. package/components/DataGrid/RowBase/GroupCell/styles.d.ts +12 -0
  62. package/components/DataGrid/RowBase/GroupCell/styles.js +16 -0
  63. package/components/DataGrid/RowBase/GroupCell/types.d.ts +11 -0
  64. package/components/DataGrid/RowBase/GroupCell/types.js +1 -0
  65. package/components/DataGrid/RowBase/RowBase.d.ts +3 -0
  66. package/components/DataGrid/RowBase/RowBase.js +69 -0
  67. package/components/DataGrid/RowBase/constants.d.ts +9 -0
  68. package/components/DataGrid/RowBase/constants.js +10 -0
  69. package/components/DataGrid/RowBase/index.d.ts +3 -0
  70. package/components/DataGrid/RowBase/index.js +2 -0
  71. package/components/DataGrid/RowBase/styles.d.ts +17 -0
  72. package/components/DataGrid/RowBase/styles.js +87 -0
  73. package/components/DataGrid/RowBase/types.d.ts +92 -0
  74. package/components/DataGrid/RowBase/types.js +1 -0
  75. package/components/DataGrid/RowBase/useLogic/useLogic.d.ts +46 -0
  76. package/components/DataGrid/RowBase/useLogic/useLogic.js +90 -0
  77. package/components/DataGrid/constants.d.ts +8 -0
  78. package/components/DataGrid/constants.js +8 -0
  79. package/components/DataGrid/index.d.ts +3 -0
  80. package/components/DataGrid/index.js +3 -0
  81. package/components/DataGrid/styles.js +14 -0
  82. package/components/DataGrid/tests/performance/testDataGridPerformance.d.ts +21 -0
  83. package/components/DataGrid/tests/performance/testDataGridPerformance.js +102 -0
  84. package/components/DataGrid/types.d.ts +11 -0
  85. package/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.d.ts +3 -1
  86. package/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.js +2 -1
  87. package/components/DataGrid/useLogic/useLogic.d.ts +4 -1
  88. package/components/DataGrid/useLogic/useLogic.js +20 -7
  89. package/components/DataGridActionCell/DataGridMainActions/Action/MainIconButton/MainIconButton.js +4 -2
  90. package/components/DataGridActionCell/DataGridMainActions/Action/MobileMainButton/MobileMainButton.js +4 -2
  91. package/components/DataGridActionCell/types.d.ts +4 -0
  92. package/components/DataGridCollapsibleRow/DataGridCollapsibleRow.d.ts +2 -0
  93. package/components/DataGridCollapsibleRow/DataGridCollapsibleRow.js +29 -0
  94. package/components/DataGridCollapsibleRow/constants.d.ts +11 -0
  95. package/components/DataGridCollapsibleRow/constants.js +12 -0
  96. package/components/DataGridCollapsibleRow/index.d.ts +2 -0
  97. package/components/DataGridCollapsibleRow/index.js +1 -0
  98. package/components/DataGridCollapsibleRow/public.d.ts +2 -0
  99. package/components/DataGridCollapsibleRow/public.js +1 -0
  100. package/components/DataGridCollapsibleRow/styles.d.ts +42 -0
  101. package/components/DataGridCollapsibleRow/styles.js +99 -0
  102. package/components/DataGridCollapsibleRow/types.d.ts +19 -0
  103. package/components/DataGridCollapsibleRow/types.js +1 -0
  104. package/components/DataGridCollapsibleRow/useLogic/index.js +1 -0
  105. package/components/DataGridCollapsibleRow/useLogic/useLogic.d.ts +29 -0
  106. package/components/DataGridCollapsibleRow/useLogic/useLogic.js +62 -0
  107. package/components/DataGridInfinite/DataGridInfinite.js +37 -27
  108. package/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContext.d.ts +23 -0
  109. package/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContext.js +21 -0
  110. package/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContextProvider/DataGridInfiniteContextProvider.d.ts +7 -0
  111. package/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContextProvider/DataGridInfiniteContextProvider.js +5 -0
  112. package/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContextProvider/index.d.ts +1 -0
  113. package/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContextProvider/index.js +1 -0
  114. package/components/DataGridInfinite/DataGridInfiniteContext/index.d.ts +2 -0
  115. package/components/DataGridInfinite/DataGridInfiniteContext/index.js +2 -0
  116. package/components/DataGridInfinite/List/List.js +2 -1
  117. package/components/DataGridInfinite/List/constants.d.ts +3 -0
  118. package/components/DataGridInfinite/List/constants.js +4 -0
  119. package/components/DataGridInfinite/List/index.d.ts +1 -0
  120. package/components/DataGridInfinite/List/index.js +1 -0
  121. package/components/DataGridInfinite/Row/Row.d.ts +2 -0
  122. package/components/DataGridInfinite/Row/Row.js +10 -0
  123. package/components/DataGridInfinite/Row/index.d.ts +1 -0
  124. package/components/DataGridInfinite/Row/index.js +1 -0
  125. package/components/DataGridInfinite/Row/types.d.ts +2 -0
  126. package/components/DataGridInfinite/Row/types.js +1 -0
  127. package/components/DataGridInfinite/Row/useLogic/index.d.ts +1 -0
  128. package/components/DataGridInfinite/Row/useLogic/index.js +1 -0
  129. package/components/DataGridInfinite/Row/useLogic/useLogic.d.ts +33 -0
  130. package/components/DataGridInfinite/Row/useLogic/useLogic.js +35 -0
  131. package/components/DataGridInfinite/faker.js +1 -1
  132. package/components/DataGridInfinite/styles.d.ts +6 -0
  133. package/components/DataGridInfinite/styles.js +11 -0
  134. package/components/DataGridInfinite/useLogic/useLogic.d.ts +6 -3
  135. package/components/DataGridInfinite/useLogic/useLogic.js +29 -10
  136. package/components/DialogActions/styles.js +2 -0
  137. package/components/DonutChart/DonutChart.d.ts +2 -0
  138. package/components/DonutChart/DonutChart.js +9 -0
  139. package/components/DonutChart/constants.d.ts +15 -0
  140. package/components/DonutChart/constants.js +16 -0
  141. package/components/DonutChart/index.d.ts +3 -0
  142. package/components/DonutChart/index.js +2 -0
  143. package/components/DonutChart/public.d.ts +3 -0
  144. package/components/DonutChart/public.js +2 -0
  145. package/components/DonutChart/styles.d.ts +21 -0
  146. package/components/DonutChart/styles.js +41 -0
  147. package/components/DonutChart/types.d.ts +27 -0
  148. package/components/DonutChart/types.js +1 -0
  149. package/components/DonutChart/useLogic/hooks/index.d.ts +1 -0
  150. package/components/DonutChart/useLogic/hooks/index.js +1 -0
  151. package/components/DonutChart/useLogic/hooks/useRenderWidth/index.d.ts +1 -0
  152. package/components/DonutChart/useLogic/hooks/useRenderWidth/index.js +1 -0
  153. package/components/DonutChart/useLogic/hooks/useRenderWidth/useRenderWidth.d.ts +9 -0
  154. package/components/DonutChart/useLogic/hooks/useRenderWidth/useRenderWidth.js +30 -0
  155. package/components/DonutChart/useLogic/index.d.ts +1 -0
  156. package/components/DonutChart/useLogic/index.js +1 -0
  157. package/components/DonutChart/useLogic/useLogic.d.ts +15 -0
  158. package/components/DonutChart/useLogic/useLogic.js +40 -0
  159. package/components/DonutChart/useLogic/utils/getDonutChartCssVars/getDonutChartCssVars.d.ts +16 -0
  160. package/components/DonutChart/useLogic/utils/getDonutChartCssVars/getDonutChartCssVars.js +10 -0
  161. package/components/DonutChart/useLogic/utils/getDonutChartCssVars/index.d.ts +1 -0
  162. package/components/DonutChart/useLogic/utils/getDonutChartCssVars/index.js +1 -0
  163. package/components/DonutChart/useLogic/utils/getGeometry/getGeometry.d.ts +10 -0
  164. package/components/DonutChart/useLogic/utils/getGeometry/getGeometry.js +13 -0
  165. package/components/DonutChart/useLogic/utils/getGeometry/index.d.ts +1 -0
  166. package/components/DonutChart/useLogic/utils/getGeometry/index.js +1 -0
  167. package/components/DonutChart/useLogic/utils/getMeterAriaValue/getMeterAriaValue.d.ts +13 -0
  168. package/components/DonutChart/useLogic/utils/getMeterAriaValue/getMeterAriaValue.js +22 -0
  169. package/components/DonutChart/useLogic/utils/getMeterAriaValue/index.d.ts +1 -0
  170. package/components/DonutChart/useLogic/utils/getMeterAriaValue/index.js +1 -0
  171. package/components/DonutChart/useLogic/utils/getProgressCirclePath/getProgressCirclePath.d.ts +9 -0
  172. package/components/DonutChart/useLogic/utils/getProgressCirclePath/getProgressCirclePath.js +29 -0
  173. package/components/DonutChart/useLogic/utils/getProgressCirclePath/index.d.ts +1 -0
  174. package/components/DonutChart/useLogic/utils/getProgressCirclePath/index.js +1 -0
  175. package/components/DonutChart/useLogic/utils/getProgressOffset/getProgressOffset.d.ts +8 -0
  176. package/components/DonutChart/useLogic/utils/getProgressOffset/getProgressOffset.js +21 -0
  177. package/components/DonutChart/useLogic/utils/getProgressOffset/index.d.ts +1 -0
  178. package/components/DonutChart/useLogic/utils/getProgressOffset/index.js +1 -0
  179. package/components/DonutChart/useLogic/utils/getProgressPercent/getProgressPercent.d.ts +8 -0
  180. package/components/DonutChart/useLogic/utils/getProgressPercent/getProgressPercent.js +16 -0
  181. package/components/DonutChart/useLogic/utils/getProgressPercent/index.d.ts +1 -0
  182. package/components/DonutChart/useLogic/utils/getProgressPercent/index.js +1 -0
  183. package/components/DonutChart/useLogic/utils/index.d.ts +6 -0
  184. package/components/DonutChart/useLogic/utils/index.js +6 -0
  185. package/components/ExpansionPanel/Summary/styles.d.ts +1 -1
  186. package/components/MenuOrganization/OrganizationButton/styles.d.ts +1 -1
  187. package/components/NewStepper/StepIcon/StepIcon.js +3 -1
  188. package/components/NewStepper/StepIcon/useLogic/index.d.ts +1 -0
  189. package/components/NewStepper/StepIcon/useLogic/index.js +1 -0
  190. package/components/NewStepper/StepIcon/useLogic/useLogic.d.ts +8 -0
  191. package/components/NewStepper/StepIcon/useLogic/useLogic.js +6 -0
  192. package/components/PageContent/PageContent.js +23 -5
  193. package/components/PageContent/constants.d.ts +2 -0
  194. package/components/PageContent/constants.js +2 -0
  195. package/components/PageContent/styles.d.ts +0 -2
  196. package/components/PageContent/styles.js +17 -11
  197. package/components/PageContent/types.d.ts +4 -0
  198. package/components/Profile/styles.d.ts +1 -1
  199. package/components/SearchField/types.d.ts +9 -0
  200. package/components/SearchField/useLogic/useLogic.d.ts +1 -1
  201. package/components/SearchField/useLogic/useLogic.js +28 -16
  202. package/components/constants/classnames.d.ts +1 -0
  203. package/components/constants/classnames.js +2 -0
  204. package/components/constants/index.d.ts +1 -0
  205. package/components/constants/index.js +1 -0
  206. package/components/fileUploading/FileUploaderDropzone/HintPlaceholder/HintPlaceholder.d.ts +2 -1
  207. package/components/fileUploading/FileUploaderDropzone/HintPlaceholder/HintPlaceholder.js +4 -1
  208. package/components/fileUploading/FileUploaderDropzone/HintPlaceholder/useLogic/useLogic.d.ts +5 -4
  209. package/components/fileUploading/PreviewFileUploaderDropZone/HintPlaceholder/HintPlaceholder.js +11 -2
  210. package/components/fileUploading/PreviewFileUploaderDropZone/HintPlaceholder/useLogic/useLogic.d.ts +5 -5
  211. package/components/fileUploading/hooks/useFileUploader/useFileUploader.d.ts +1 -1
  212. package/components/fileUploading/hooks/usePreviewFileUploader/usePreviewFileUploader.d.ts +1 -1
  213. package/components/fileUploading/types.d.ts +2 -2
  214. package/components/useProfiler/index.d.ts +1 -0
  215. package/components/useProfiler/index.js +1 -0
  216. package/components/useProfiler/useProfiler.d.ts +14 -0
  217. package/components/useProfiler/useProfiler.js +46 -0
  218. package/components/useProfiler/utils/index.d.ts +1 -0
  219. package/components/useProfiler/utils/index.js +1 -0
  220. package/components/useProfiler/utils/shallowEqual/index.d.ts +1 -0
  221. package/components/useProfiler/utils/shallowEqual/index.js +1 -0
  222. package/components/useProfiler/utils/shallowEqual/shallowEqual.d.ts +5 -0
  223. package/components/useProfiler/utils/shallowEqual/shallowEqual.js +26 -0
  224. package/hook-form/FormFilters/FormFilters.js +1 -1
  225. package/hook-form/FormFilters/FormFiltersSkeleton/FormFiltersSkeleton.d.ts +5 -1
  226. package/hook-form/FormFilters/FormFiltersSkeleton/FormFiltersSkeleton.js +4 -3
  227. package/hook-form/FormFilters/FormQuickFiltersSkeleton/FormQuickFiltersSkeleton.d.ts +1 -0
  228. package/hook-form/FormFilters/FormQuickFiltersSkeleton/FormQuickFiltersSkeleton.js +9 -0
  229. package/hook-form/FormFilters/FormQuickFiltersSkeleton/index.d.ts +1 -0
  230. package/hook-form/FormFilters/FormQuickFiltersSkeleton/index.js +1 -0
  231. package/hook-form/FormFilters/FormQuickFiltersSkeleton/styles.d.ts +5 -0
  232. package/hook-form/FormFilters/FormQuickFiltersSkeleton/styles.js +5 -0
  233. package/node/components/CardGridInfinite/CardGridInfinite.js +13 -4
  234. package/node/components/CardGridInfinite/styles.js +4 -0
  235. package/node/components/CardGridInfinite/useLogic/useLogic.d.ts +1 -1
  236. package/node/components/CardGridInfinite/useLogic/useLogic.js +1 -11
  237. package/node/components/Chevron/Chevron.d.ts +1 -1
  238. package/node/components/ConfirmAction/ConfirmAction.js +2 -2
  239. package/node/components/ConfirmAction/constants.d.ts +1 -0
  240. package/node/components/ConfirmAction/constants.js +2 -1
  241. package/node/components/ConfirmAction/styles.js +13 -0
  242. package/node/components/ConfirmAction/types.d.ts +1 -1
  243. package/node/components/DataGrid/Body/Body.d.ts +1 -1
  244. package/node/components/DataGrid/Body/Body.js +5 -3
  245. package/node/components/DataGrid/Body/types.d.ts +5 -0
  246. package/node/components/DataGrid/Cell/Cell.d.ts +9 -1
  247. package/node/components/DataGrid/Cell/Cell.js +16 -2
  248. package/node/components/DataGrid/CustomRowWrapper/CustomRowWrapper.d.ts +19 -0
  249. package/node/components/DataGrid/CustomRowWrapper/CustomRowWrapper.js +18 -0
  250. package/node/components/DataGrid/CustomRowWrapper/index.d.ts +1 -0
  251. package/node/components/DataGrid/CustomRowWrapper/index.js +5 -0
  252. package/node/components/DataGrid/DataGrid.js +27 -16
  253. package/node/components/DataGrid/DataGridContext/DataGridContext.d.ts +9 -5
  254. package/node/components/DataGrid/DataGridContext/DataGridContext.js +7 -4
  255. package/node/components/DataGrid/DataGridContext/DataGridProvider/DataGridProvider.d.ts +3 -4
  256. package/node/components/DataGrid/DataGridContext/DataGridProvider/DataGridProvider.js +17 -47
  257. package/node/components/DataGrid/DataGridStorageContext/DataGridStorageContext.d.ts +29 -0
  258. package/node/components/DataGrid/DataGridStorageContext/DataGridStorageContext.js +31 -0
  259. package/node/components/DataGrid/DataGridStorageContext/DataGridStorageProvider/DataGridStorageProvider.d.ts +6 -0
  260. package/node/components/DataGrid/DataGridStorageContext/DataGridStorageProvider/DataGridStorageProvider.js +16 -0
  261. package/node/components/DataGrid/DataGridStorageContext/DataGridStorageProvider/index.d.ts +1 -0
  262. package/node/components/DataGrid/DataGridStorageContext/DataGridStorageProvider/index.js +17 -0
  263. package/node/components/DataGrid/DataGridStorageContext/index.d.ts +2 -0
  264. package/node/components/DataGrid/DataGridStorageContext/index.js +18 -0
  265. package/node/components/DataGrid/MobileSkeleton/MobileSkeleton.d.ts +2 -1
  266. package/node/components/DataGrid/MobileSkeleton/MobileSkeleton.js +21 -3
  267. package/node/components/DataGrid/MobileSkeleton/styles.js +12 -0
  268. package/node/components/DataGrid/Row/NestedChildren/NestedChildren.d.ts +1 -5
  269. package/node/components/DataGrid/Row/NestedChildren/NestedChildren.js +18 -7
  270. package/node/components/DataGrid/Row/NestedChildren/constants.d.ts +6 -0
  271. package/node/components/DataGrid/Row/NestedChildren/constants.js +10 -0
  272. package/node/components/DataGrid/Row/NestedChildren/styles.js +41 -2
  273. package/node/components/DataGrid/Row/NestedChildren/useLogic/useLogic.d.ts +1 -1
  274. package/node/components/DataGrid/Row/NestedChildren/useLogic/useLogic.js +3 -5
  275. package/node/components/DataGrid/Row/Row.js +33 -36
  276. package/node/components/DataGrid/Row/RowContext/RowContext.d.ts +10 -1
  277. package/node/components/DataGrid/Row/RowContext/RowContext.js +9 -0
  278. package/node/components/DataGrid/Row/RowContext/RowProvider/RowProvider.d.ts +3 -2
  279. package/node/components/DataGrid/Row/RowContext/RowProvider/RowProvider.js +25 -2
  280. package/node/components/DataGrid/Row/constants.d.ts +6 -0
  281. package/node/components/DataGrid/Row/constants.js +6 -0
  282. package/node/components/DataGrid/Row/styles.js +99 -0
  283. package/node/components/DataGrid/Row/useLogic/hooks/useMobileLogic.d.ts +1 -0
  284. package/node/components/DataGrid/Row/useLogic/hooks/useMobileLogic.js +1 -1
  285. package/node/components/DataGrid/Row/useLogic/useLogic.d.ts +5 -2
  286. package/node/components/DataGrid/Row/useLogic/useLogic.js +20 -18
  287. package/node/components/DataGrid/RowBase/GroupCell/GroupCell.d.ts +2 -0
  288. package/node/components/DataGrid/RowBase/GroupCell/GroupCell.js +26 -0
  289. package/node/components/DataGrid/RowBase/GroupCell/constants.d.ts +4 -0
  290. package/node/components/DataGrid/RowBase/GroupCell/constants.js +8 -0
  291. package/node/components/DataGrid/RowBase/GroupCell/index.d.ts +1 -0
  292. package/node/components/DataGrid/RowBase/GroupCell/index.js +5 -0
  293. package/node/components/DataGrid/RowBase/GroupCell/styles.d.ts +12 -0
  294. package/node/components/DataGrid/RowBase/GroupCell/styles.js +19 -0
  295. package/node/components/DataGrid/RowBase/GroupCell/types.d.ts +11 -0
  296. package/node/components/DataGrid/RowBase/GroupCell/types.js +2 -0
  297. package/node/components/DataGrid/RowBase/RowBase.d.ts +3 -0
  298. package/node/components/DataGrid/RowBase/RowBase.js +72 -0
  299. package/node/components/DataGrid/RowBase/constants.d.ts +9 -0
  300. package/node/components/DataGrid/RowBase/constants.js +13 -0
  301. package/node/components/DataGrid/RowBase/index.d.ts +3 -0
  302. package/node/components/DataGrid/RowBase/index.js +7 -0
  303. package/node/components/DataGrid/RowBase/styles.d.ts +17 -0
  304. package/node/components/DataGrid/RowBase/styles.js +90 -0
  305. package/node/components/DataGrid/RowBase/types.d.ts +92 -0
  306. package/node/components/DataGrid/RowBase/types.js +2 -0
  307. package/node/components/DataGrid/RowBase/useLogic/index.d.ts +1 -0
  308. package/node/components/DataGrid/RowBase/useLogic/useLogic.d.ts +46 -0
  309. package/node/components/DataGrid/RowBase/useLogic/useLogic.js +94 -0
  310. package/node/components/DataGrid/constants.d.ts +8 -0
  311. package/node/components/DataGrid/constants.js +9 -1
  312. package/node/components/DataGrid/index.d.ts +3 -0
  313. package/node/components/DataGrid/index.js +7 -1
  314. package/node/components/DataGrid/styles.js +40 -26
  315. package/node/components/DataGrid/tests/performance/testDataGridPerformance.d.ts +21 -0
  316. package/node/components/DataGrid/tests/performance/testDataGridPerformance.js +106 -0
  317. package/node/components/DataGrid/types.d.ts +11 -0
  318. package/node/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.d.ts +3 -1
  319. package/node/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.js +2 -1
  320. package/node/components/DataGrid/useLogic/useLogic.d.ts +4 -1
  321. package/node/components/DataGrid/useLogic/useLogic.js +19 -6
  322. package/node/components/DataGridActionCell/DataGridMainActions/Action/MainIconButton/MainIconButton.js +4 -2
  323. package/node/components/DataGridActionCell/DataGridMainActions/Action/MobileMainButton/MobileMainButton.js +4 -2
  324. package/node/components/DataGridActionCell/types.d.ts +4 -0
  325. package/node/components/DataGridCollapsibleRow/DataGridCollapsibleRow.d.ts +2 -0
  326. package/node/components/DataGridCollapsibleRow/DataGridCollapsibleRow.js +33 -0
  327. package/node/components/DataGridCollapsibleRow/constants.d.ts +11 -0
  328. package/node/components/DataGridCollapsibleRow/constants.js +15 -0
  329. package/node/components/DataGridCollapsibleRow/index.d.ts +2 -0
  330. package/node/components/DataGridCollapsibleRow/index.js +5 -0
  331. package/node/components/DataGridCollapsibleRow/public.d.ts +2 -0
  332. package/node/components/DataGridCollapsibleRow/public.js +5 -0
  333. package/node/components/DataGridCollapsibleRow/styles.d.ts +42 -0
  334. package/node/components/DataGridCollapsibleRow/styles.js +102 -0
  335. package/node/components/DataGridCollapsibleRow/types.d.ts +19 -0
  336. package/node/components/DataGridCollapsibleRow/types.js +2 -0
  337. package/node/components/DataGridCollapsibleRow/useLogic/index.d.ts +1 -0
  338. package/node/components/DataGridCollapsibleRow/useLogic/index.js +17 -0
  339. package/node/components/DataGridCollapsibleRow/useLogic/useLogic.d.ts +29 -0
  340. package/node/components/DataGridCollapsibleRow/useLogic/useLogic.js +66 -0
  341. package/node/components/DataGridInfinite/DataGridInfinite.js +45 -35
  342. package/node/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContext.d.ts +23 -0
  343. package/node/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContext.js +24 -0
  344. package/node/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContextProvider/DataGridInfiniteContextProvider.d.ts +7 -0
  345. package/node/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContextProvider/DataGridInfiniteContextProvider.js +9 -0
  346. package/node/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContextProvider/index.d.ts +1 -0
  347. package/node/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContextProvider/index.js +17 -0
  348. package/node/components/DataGridInfinite/DataGridInfiniteContext/index.d.ts +2 -0
  349. package/node/components/DataGridInfinite/DataGridInfiniteContext/index.js +18 -0
  350. package/node/components/DataGridInfinite/List/List.js +2 -1
  351. package/node/components/DataGridInfinite/List/constants.d.ts +3 -0
  352. package/node/components/DataGridInfinite/List/constants.js +7 -0
  353. package/node/components/DataGridInfinite/List/index.d.ts +1 -0
  354. package/node/components/DataGridInfinite/List/index.js +3 -0
  355. package/node/components/DataGridInfinite/Row/Row.d.ts +2 -0
  356. package/node/components/DataGridInfinite/Row/Row.js +14 -0
  357. package/node/components/DataGridInfinite/Row/index.d.ts +1 -0
  358. package/node/components/DataGridInfinite/Row/index.js +17 -0
  359. package/node/components/DataGridInfinite/Row/types.d.ts +2 -0
  360. package/node/components/DataGridInfinite/Row/types.js +2 -0
  361. package/node/components/DataGridInfinite/Row/useLogic/index.d.ts +1 -0
  362. package/node/components/DataGridInfinite/Row/useLogic/index.js +17 -0
  363. package/node/components/DataGridInfinite/Row/useLogic/useLogic.d.ts +33 -0
  364. package/node/components/DataGridInfinite/Row/useLogic/useLogic.js +39 -0
  365. package/node/components/DataGridInfinite/faker.js +1 -1
  366. package/node/components/DataGridInfinite/styles.d.ts +6 -0
  367. package/node/components/DataGridInfinite/styles.js +12 -1
  368. package/node/components/DataGridInfinite/useLogic/useLogic.d.ts +6 -3
  369. package/node/components/DataGridInfinite/useLogic/useLogic.js +33 -14
  370. package/node/components/DialogActions/styles.js +2 -0
  371. package/node/components/DonutChart/DonutChart.d.ts +2 -0
  372. package/node/components/DonutChart/DonutChart.js +13 -0
  373. package/node/components/DonutChart/constants.d.ts +15 -0
  374. package/node/components/DonutChart/constants.js +19 -0
  375. package/node/components/DonutChart/index.d.ts +3 -0
  376. package/node/components/DonutChart/index.js +7 -0
  377. package/node/components/DonutChart/public.d.ts +3 -0
  378. package/node/components/DonutChart/public.js +7 -0
  379. package/node/components/DonutChart/styles.d.ts +21 -0
  380. package/node/components/DonutChart/styles.js +44 -0
  381. package/node/components/DonutChart/types.d.ts +27 -0
  382. package/node/components/DonutChart/types.js +2 -0
  383. package/node/components/DonutChart/useLogic/hooks/index.d.ts +1 -0
  384. package/node/components/DonutChart/useLogic/hooks/index.js +17 -0
  385. package/node/components/DonutChart/useLogic/hooks/useRenderWidth/index.d.ts +1 -0
  386. package/node/components/DonutChart/useLogic/hooks/useRenderWidth/index.js +17 -0
  387. package/node/components/DonutChart/useLogic/hooks/useRenderWidth/useRenderWidth.d.ts +9 -0
  388. package/node/components/DonutChart/useLogic/hooks/useRenderWidth/useRenderWidth.js +34 -0
  389. package/node/components/DonutChart/useLogic/index.d.ts +1 -0
  390. package/node/components/DonutChart/useLogic/index.js +17 -0
  391. package/node/components/DonutChart/useLogic/useLogic.d.ts +15 -0
  392. package/node/components/DonutChart/useLogic/useLogic.js +44 -0
  393. package/node/components/DonutChart/useLogic/utils/getDonutChartCssVars/getDonutChartCssVars.d.ts +16 -0
  394. package/node/components/DonutChart/useLogic/utils/getDonutChartCssVars/getDonutChartCssVars.js +14 -0
  395. package/node/components/DonutChart/useLogic/utils/getDonutChartCssVars/index.d.ts +1 -0
  396. package/node/components/DonutChart/useLogic/utils/getDonutChartCssVars/index.js +5 -0
  397. package/node/components/DonutChart/useLogic/utils/getGeometry/getGeometry.d.ts +10 -0
  398. package/node/components/DonutChart/useLogic/utils/getGeometry/getGeometry.js +17 -0
  399. package/node/components/DonutChart/useLogic/utils/getGeometry/index.d.ts +1 -0
  400. package/node/components/DonutChart/useLogic/utils/getGeometry/index.js +5 -0
  401. package/node/components/DonutChart/useLogic/utils/getMeterAriaValue/getMeterAriaValue.d.ts +13 -0
  402. package/node/components/DonutChart/useLogic/utils/getMeterAriaValue/getMeterAriaValue.js +26 -0
  403. package/node/components/DonutChart/useLogic/utils/getMeterAriaValue/index.d.ts +1 -0
  404. package/node/components/DonutChart/useLogic/utils/getMeterAriaValue/index.js +5 -0
  405. package/node/components/DonutChart/useLogic/utils/getProgressCirclePath/getProgressCirclePath.d.ts +9 -0
  406. package/node/components/DonutChart/useLogic/utils/getProgressCirclePath/getProgressCirclePath.js +33 -0
  407. package/node/components/DonutChart/useLogic/utils/getProgressCirclePath/index.d.ts +1 -0
  408. package/node/components/DonutChart/useLogic/utils/getProgressCirclePath/index.js +5 -0
  409. package/node/components/DonutChart/useLogic/utils/getProgressOffset/getProgressOffset.d.ts +8 -0
  410. package/node/components/DonutChart/useLogic/utils/getProgressOffset/getProgressOffset.js +25 -0
  411. package/node/components/DonutChart/useLogic/utils/getProgressOffset/index.d.ts +1 -0
  412. package/node/components/DonutChart/useLogic/utils/getProgressOffset/index.js +5 -0
  413. package/node/components/DonutChart/useLogic/utils/getProgressPercent/getProgressPercent.d.ts +8 -0
  414. package/node/components/DonutChart/useLogic/utils/getProgressPercent/getProgressPercent.js +20 -0
  415. package/node/components/DonutChart/useLogic/utils/getProgressPercent/index.d.ts +1 -0
  416. package/node/components/DonutChart/useLogic/utils/getProgressPercent/index.js +5 -0
  417. package/node/components/DonutChart/useLogic/utils/index.d.ts +6 -0
  418. package/node/components/DonutChart/useLogic/utils/index.js +15 -0
  419. package/node/components/ExpansionPanel/Summary/styles.d.ts +1 -1
  420. package/node/components/MenuOrganization/OrganizationButton/styles.d.ts +1 -1
  421. package/node/components/NewStepper/StepIcon/StepIcon.js +3 -1
  422. package/node/components/NewStepper/StepIcon/useLogic/index.d.ts +1 -0
  423. package/node/components/NewStepper/StepIcon/useLogic/index.js +17 -0
  424. package/node/components/NewStepper/StepIcon/useLogic/useLogic.d.ts +8 -0
  425. package/node/components/NewStepper/StepIcon/useLogic/useLogic.js +10 -0
  426. package/node/components/PageContent/PageContent.js +22 -4
  427. package/node/components/PageContent/constants.d.ts +2 -0
  428. package/node/components/PageContent/constants.js +2 -0
  429. package/node/components/PageContent/styles.d.ts +0 -2
  430. package/node/components/PageContent/styles.js +17 -11
  431. package/node/components/PageContent/types.d.ts +4 -0
  432. package/node/components/Profile/styles.d.ts +1 -1
  433. package/node/components/SearchField/types.d.ts +9 -0
  434. package/node/components/SearchField/useLogic/useLogic.d.ts +1 -1
  435. package/node/components/SearchField/useLogic/useLogic.js +27 -15
  436. package/node/components/constants/classnames.d.ts +1 -0
  437. package/node/components/constants/classnames.js +5 -0
  438. package/node/components/constants/index.d.ts +1 -0
  439. package/node/components/constants/index.js +1 -0
  440. package/node/components/fileUploading/FileUploaderDropzone/HintPlaceholder/HintPlaceholder.d.ts +2 -1
  441. package/node/components/fileUploading/FileUploaderDropzone/HintPlaceholder/HintPlaceholder.js +4 -1
  442. package/node/components/fileUploading/FileUploaderDropzone/HintPlaceholder/useLogic/useLogic.d.ts +5 -4
  443. package/node/components/fileUploading/PreviewFileUploaderDropZone/HintPlaceholder/HintPlaceholder.js +10 -1
  444. package/node/components/fileUploading/PreviewFileUploaderDropZone/HintPlaceholder/useLogic/useLogic.d.ts +5 -5
  445. package/node/components/fileUploading/hooks/useFileUploader/useFileUploader.d.ts +1 -1
  446. package/node/components/fileUploading/hooks/usePreviewFileUploader/usePreviewFileUploader.d.ts +1 -1
  447. package/node/components/fileUploading/types.d.ts +2 -2
  448. package/node/components/useProfiler/index.d.ts +1 -0
  449. package/node/components/useProfiler/index.js +5 -0
  450. package/node/components/useProfiler/useProfiler.d.ts +14 -0
  451. package/node/components/useProfiler/useProfiler.js +50 -0
  452. package/node/components/useProfiler/utils/index.d.ts +1 -0
  453. package/node/components/useProfiler/utils/index.js +17 -0
  454. package/node/components/useProfiler/utils/shallowEqual/index.d.ts +1 -0
  455. package/node/components/useProfiler/utils/shallowEqual/index.js +6 -0
  456. package/node/components/useProfiler/utils/shallowEqual/shallowEqual.d.ts +5 -0
  457. package/node/components/useProfiler/utils/shallowEqual/shallowEqual.js +31 -0
  458. package/node/hook-form/FormFilters/FormFilters.js +1 -1
  459. package/node/hook-form/FormFilters/FormFiltersSkeleton/FormFiltersSkeleton.d.ts +5 -1
  460. package/node/hook-form/FormFilters/FormFiltersSkeleton/FormFiltersSkeleton.js +3 -2
  461. package/node/hook-form/FormFilters/FormQuickFiltersSkeleton/FormQuickFiltersSkeleton.d.ts +1 -0
  462. package/node/hook-form/FormFilters/FormQuickFiltersSkeleton/FormQuickFiltersSkeleton.js +13 -0
  463. package/node/hook-form/FormFilters/FormQuickFiltersSkeleton/index.d.ts +1 -0
  464. package/node/hook-form/FormFilters/FormQuickFiltersSkeleton/index.js +17 -0
  465. package/node/hook-form/FormFilters/FormQuickFiltersSkeleton/styles.d.ts +5 -0
  466. package/node/hook-form/FormFilters/FormQuickFiltersSkeleton/styles.js +8 -0
  467. package/package.json +1 -1
  468. package/components/PageContent/useLogic/useLogic.d.ts +0 -7
  469. package/components/PageContent/useLogic/useLogic.js +0 -11
  470. package/node/components/PageContent/useLogic/useLogic.d.ts +0 -7
  471. package/node/components/PageContent/useLogic/useLogic.js +0 -15
  472. /package/components/{PageContent → DataGrid/RowBase}/useLogic/index.d.ts +0 -0
  473. /package/components/{PageContent → DataGrid/RowBase}/useLogic/index.js +0 -0
  474. /package/{node/components/PageContent → components/DataGridCollapsibleRow}/useLogic/index.d.ts +0 -0
  475. /package/node/components/{PageContent → DataGrid/RowBase}/useLogic/index.js +0 -0
@@ -0,0 +1,92 @@
1
+ import { type ChangeEvent, type ReactNode } from 'react';
2
+ import type { DataGridColumns, DataGridRowWithOptions } from '../types';
3
+ export type RowBaseProps = {
4
+ /**
5
+ * Массив колонок
6
+ */
7
+ columns: DataGridColumns<Record<string, unknown>>[];
8
+ /**
9
+ * Данные строки для отображения
10
+ */
11
+ row: DataGridRowWithOptions<Record<string, unknown>>;
12
+ /**
13
+ * Функция для рендера стартового элемента
14
+ */
15
+ renderStartAdornment?: (isFirstCell: boolean) => ReactNode;
16
+ /**
17
+ * Смещение секции для правильного расчета глобального индекса
18
+ */
19
+ sectionOffset?: number;
20
+ /**
21
+ * Уникальный идентификатор строки
22
+ */
23
+ rowId: string;
24
+ /**
25
+ * Кастомный контент после ячеек
26
+ */
27
+ customContent?: ReactNode;
28
+ /**
29
+ * Является ли строка выбираемой
30
+ */
31
+ isSelectable?: boolean;
32
+ /**
33
+ * Уникальный идентификатор строки
34
+ */
35
+ keyId: unknown;
36
+ /**
37
+ * Обработчик клика строки таблицы
38
+ */
39
+ onRowClick?: (row: Record<string, unknown>) => void;
40
+ /**
41
+ * Является ли строка выбранной
42
+ */
43
+ isSelected?: boolean;
44
+ /**
45
+ * Заблокирована ли строка
46
+ */
47
+ isDisabled?: boolean;
48
+ /**
49
+ * Причина блокировки строки
50
+ */
51
+ disabledReason?: string;
52
+ /**
53
+ * Обработчик выбора строки
54
+ */
55
+ onSelectRow: (row: Record<string, unknown>) => (event: ChangeEvent<HTMLInputElement>) => void;
56
+ /**
57
+ * Обработчик наведения на строку
58
+ */
59
+ onRowEnter?: (rowId: string) => void;
60
+ /**
61
+ * Обработчик ухода со строки
62
+ */
63
+ onRowLeave?: (rowId: string, event: PointerEvent) => void;
64
+ /**
65
+ * Регистрация элемента строки
66
+ */
67
+ registerRowElement?: (rowId: string, el: HTMLElement) => void;
68
+ /**
69
+ * Удаление регистрации элемента строки
70
+ */
71
+ unregisterRowElement?: (rowId: string, el: HTMLElement) => void;
72
+ /**
73
+ * Шаблон колонок (CSS grid-template-columns)
74
+ */
75
+ gridColumns?: string;
76
+ /**
77
+ * ID активной строки
78
+ */
79
+ activeRowId?: string;
80
+ /**
81
+ * Значение для пустой ячейки
82
+ */
83
+ emptyCellValue?: ReactNode;
84
+ /**
85
+ * Вариант отображения на мобильных устройствах
86
+ */
87
+ mobileDisplayVariant?: 'cards' | 'list';
88
+ /**
89
+ * Класс применяемый для корневого элемента
90
+ */
91
+ className?: string;
92
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from './useLogic';
@@ -0,0 +1,46 @@
1
+ import { type CSSProperties, type SyntheticEvent } from 'react';
2
+ import type { RowBaseProps } from '../types';
3
+ type UseLogicParams = RowBaseProps;
4
+ export declare const useLogic: ({ className, row, keyId, onRowClick, columns, sectionOffset, customContent, renderStartAdornment, isSelected, isDisabled, disabledReason, onSelectRow, onRowEnter, onRowLeave, registerRowElement, unregisterRowElement, gridColumns, activeRowId, emptyCellValue, isSelectable, rowId, mobileDisplayVariant, ...dataGridInfiniteItemProps }: UseLogicParams) => {
5
+ handleRowClick: () => void;
6
+ tooltipProps: {
7
+ open: boolean;
8
+ title: string | undefined;
9
+ onOpen: (event: SyntheticEvent<Element, Event>) => void;
10
+ onClose: () => void;
11
+ followCursor: boolean;
12
+ arrow: boolean;
13
+ };
14
+ checkboxProps: {
15
+ checked: boolean | undefined;
16
+ disabled: boolean | undefined;
17
+ onChange: (event: import("react").ChangeEvent<HTMLInputElement, Element>) => void;
18
+ };
19
+ drawerProps: {
20
+ open: boolean;
21
+ onClose: () => void;
22
+ title: string;
23
+ };
24
+ drawerContent: string | undefined;
25
+ rowBaseVars: CSSProperties;
26
+ isHovered: boolean;
27
+ isActive: boolean;
28
+ columns: import("../..").DataGridColumns<Record<string, unknown>>[];
29
+ emptyCellValue: import("react").ReactNode;
30
+ rowRef: (element: HTMLElement | null) => void;
31
+ onRowEnter: ((rowId: string) => void) | undefined;
32
+ onRowLeave: ((rowId: string, event: PointerEvent) => void) | undefined;
33
+ rowId: string;
34
+ row: import("../..").DataGridRowWithOptions<Record<string, unknown>>;
35
+ isDisabled: boolean | undefined;
36
+ sectionOffset: number | undefined;
37
+ customContent: import("react").ReactNode;
38
+ isDisabledLastCell: boolean | undefined;
39
+ renderStartAdornment: ((isFirstCell: boolean) => import("react").ReactNode) | undefined;
40
+ isSelectable: boolean | undefined;
41
+ isNotSelectable: boolean | undefined;
42
+ dataGridInfiniteItemProps: {};
43
+ mobileDisplayVariant: "list" | "cards" | undefined;
44
+ className: string | undefined;
45
+ };
46
+ export {};
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useLogic = void 0;
4
+ const react_1 = require("react");
5
+ const redirectToLink_1 = require("../../../utils/redirectToLink");
6
+ const hooks_1 = require("../../Row/useLogic/hooks");
7
+ const constants_1 = require("../constants");
8
+ const useLogic = ({ className, row, keyId, onRowClick, columns, sectionOffset, customContent, renderStartAdornment, isSelected, isDisabled, disabledReason, onSelectRow, onRowEnter, onRowLeave, registerRowElement, unregisterRowElement, gridColumns, activeRowId, emptyCellValue, isSelectable, rowId, mobileDisplayVariant, ...dataGridInfiniteItemProps }) => {
9
+ const [isVisibleTooltip, setVisibleTooltip] = (0, react_1.useState)(false);
10
+ const savedElementRef = (0, react_1.useRef)(null);
11
+ const { isDrawerOpen, handleOpenDrawer, handleCloseDrawer } = (0, hooks_1.useMobileLogic)();
12
+ const { options } = row;
13
+ const { style: dataGridInfiniteItemStyle, ...restDataGridInfiniteItemProps } = dataGridInfiniteItemProps || {};
14
+ const { disabledReason: propsDisabledReason, isDisabled: propsIsDisabled, isDisabledLastCell, href, isNotSelectable, target, } = options || {};
15
+ const disabled = isDisabled || propsIsDisabled;
16
+ const disabledReasonText = propsDisabledReason || disabledReason;
17
+ const handleOpenTooltip = (event) => {
18
+ const element = event.target;
19
+ const isDisabledCell = element?.getAttribute(constants_1.DISABLE_ROW_ATTR) === 'true';
20
+ if (isDisabledCell) {
21
+ setVisibleTooltip(true);
22
+ }
23
+ };
24
+ const handleCloseTooltip = () => setVisibleTooltip(false);
25
+ const rowBaseVars = {
26
+ '--row-base-grid-columns': gridColumns,
27
+ ...(dataGridInfiniteItemStyle || {}),
28
+ };
29
+ const isHovered = Boolean(!disabled && (onRowClick || href));
30
+ const isActive = activeRowId === rowId;
31
+ const rowRef = (element) => {
32
+ if (element) {
33
+ savedElementRef.current = element;
34
+ registerRowElement?.(rowId, element);
35
+ }
36
+ else if (savedElementRef.current) {
37
+ unregisterRowElement?.(rowId, savedElementRef.current);
38
+ savedElementRef.current = null;
39
+ }
40
+ };
41
+ const handleRowClick = () => {
42
+ if (disabled) {
43
+ handleOpenDrawer();
44
+ return undefined;
45
+ }
46
+ if (href) {
47
+ return (0, redirectToLink_1.redirectToLink)(href, target);
48
+ }
49
+ onRowClick?.(row);
50
+ };
51
+ return {
52
+ handleRowClick,
53
+ tooltipProps: {
54
+ open: isVisibleTooltip,
55
+ title: disabled ? disabledReasonText : undefined,
56
+ onOpen: handleOpenTooltip,
57
+ onClose: handleCloseTooltip,
58
+ followCursor: true,
59
+ arrow: false,
60
+ },
61
+ checkboxProps: {
62
+ checked: isSelected,
63
+ disabled,
64
+ onChange: onSelectRow(row),
65
+ },
66
+ drawerProps: {
67
+ open: isDrawerOpen,
68
+ onClose: handleCloseDrawer,
69
+ title: 'Заблокировано',
70
+ },
71
+ drawerContent: disabledReasonText,
72
+ rowBaseVars,
73
+ isHovered,
74
+ isActive,
75
+ columns,
76
+ emptyCellValue,
77
+ rowRef,
78
+ onRowEnter,
79
+ onRowLeave,
80
+ rowId,
81
+ row,
82
+ isDisabled: disabled,
83
+ sectionOffset,
84
+ customContent,
85
+ isDisabledLastCell,
86
+ renderStartAdornment,
87
+ isSelectable,
88
+ isNotSelectable,
89
+ dataGridInfiniteItemProps: restDataGridInfiniteItemProps,
90
+ mobileDisplayVariant,
91
+ className,
92
+ };
93
+ };
94
+ exports.useLogic = useLogic;
@@ -2,9 +2,11 @@ export declare const MIN_ROW_HEIGHT = 44;
2
2
  export declare const ROOT_ACTION_CELL_WIDTH = 32;
3
3
  export declare const TREE_LINE_WIDTH: number;
4
4
  export declare const MIN_DISPLAY_ROWS_BY_DEFAULT = 10;
5
+ export declare const MOBILE_TREE_LINE_WIDTH = 12;
5
6
  export declare const DEFAULT_MOBILE_SKELETON_ROWS_COUNT = 5;
6
7
  export declare const EXPANDED_LEVEL_BY_DEFAULT = 1;
7
8
  export declare const INITIAL_OPENED_NESTED_CHILDREN_COUNT_BY_DEFAULT = 2;
9
+ export declare const INITIAL_OPENED_NESTED_CHILDREN_COUNT_ON_MOBILE_BY_DEFAULT = 1;
8
10
  export declare const dataGridClassnames: {
9
11
  loadingPlaceholder: string;
10
12
  header: string;
@@ -23,4 +25,10 @@ export declare const dataGridClassnames: {
23
25
  hasGroupedColumns: string;
24
26
  gridViewFull: string;
25
27
  gridViewStandard: string;
28
+ mobileVariantCards: string;
29
+ mobileVariantList: string;
30
+ };
31
+ export declare const dataGridSkeletonClassnames: {
32
+ list: string;
33
+ item: string;
26
34
  };
@@ -1,14 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dataGridClassnames = exports.INITIAL_OPENED_NESTED_CHILDREN_COUNT_BY_DEFAULT = exports.EXPANDED_LEVEL_BY_DEFAULT = exports.DEFAULT_MOBILE_SKELETON_ROWS_COUNT = exports.MIN_DISPLAY_ROWS_BY_DEFAULT = exports.TREE_LINE_WIDTH = exports.ROOT_ACTION_CELL_WIDTH = exports.MIN_ROW_HEIGHT = void 0;
3
+ exports.dataGridSkeletonClassnames = exports.dataGridClassnames = exports.INITIAL_OPENED_NESTED_CHILDREN_COUNT_ON_MOBILE_BY_DEFAULT = exports.INITIAL_OPENED_NESTED_CHILDREN_COUNT_BY_DEFAULT = exports.EXPANDED_LEVEL_BY_DEFAULT = exports.DEFAULT_MOBILE_SKELETON_ROWS_COUNT = exports.MOBILE_TREE_LINE_WIDTH = exports.MIN_DISPLAY_ROWS_BY_DEFAULT = exports.TREE_LINE_WIDTH = exports.ROOT_ACTION_CELL_WIDTH = exports.MIN_ROW_HEIGHT = void 0;
4
4
  const createUIKitClassname_1 = require("../utils/createUIKitClassname");
5
5
  exports.MIN_ROW_HEIGHT = 44;
6
6
  exports.ROOT_ACTION_CELL_WIDTH = 32;
7
7
  exports.TREE_LINE_WIDTH = exports.ROOT_ACTION_CELL_WIDTH / 2;
8
8
  exports.MIN_DISPLAY_ROWS_BY_DEFAULT = 10;
9
+ exports.MOBILE_TREE_LINE_WIDTH = 12;
9
10
  exports.DEFAULT_MOBILE_SKELETON_ROWS_COUNT = 5;
10
11
  exports.EXPANDED_LEVEL_BY_DEFAULT = 1;
11
12
  exports.INITIAL_OPENED_NESTED_CHILDREN_COUNT_BY_DEFAULT = 2;
13
+ exports.INITIAL_OPENED_NESTED_CHILDREN_COUNT_ON_MOBILE_BY_DEFAULT = 1;
12
14
  exports.dataGridClassnames = {
13
15
  loadingPlaceholder: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__loading-placeholder'),
14
16
  header: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__header'),
@@ -27,4 +29,10 @@ exports.dataGridClassnames = {
27
29
  hasGroupedColumns: (0, createUIKitClassname_1.createUIKitClassname)('data-grid_has-grouped-columns'),
28
30
  gridViewFull: (0, createUIKitClassname_1.createUIKitClassname)('data-grid_grid-view-full'),
29
31
  gridViewStandard: (0, createUIKitClassname_1.createUIKitClassname)('data-grid_grid-view-standard'),
32
+ mobileVariantCards: (0, createUIKitClassname_1.createUIKitClassname)('data-grid_mobile-variant-cards'),
33
+ mobileVariantList: (0, createUIKitClassname_1.createUIKitClassname)('data-grid_mobile-variant-list'),
34
+ };
35
+ exports.dataGridSkeletonClassnames = {
36
+ list: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__skeleton-list'),
37
+ item: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__skeleton-item'),
30
38
  };
@@ -2,3 +2,6 @@ export { DataGrid } from './DataGrid';
2
2
  export type { DataGridProps, DataGridColumns, DataGridSingleColumn, DataGridRow, DataGridRowOptions, DataGridSort, DataGridRowWithOptions, DataGridRowOptionColumns, } from './types';
3
3
  export { dataGridClassnames } from './constants';
4
4
  export { MobileSkeleton } from './MobileSkeleton';
5
+ export { RowBase, type RowBaseProps } from './RowBase';
6
+ export { DataGridContext } from './DataGridContext';
7
+ export { DataGridStorageContext } from './DataGridStorageContext';
@@ -1,9 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MobileSkeleton = exports.dataGridClassnames = exports.DataGrid = void 0;
3
+ exports.DataGridStorageContext = exports.DataGridContext = exports.RowBase = exports.MobileSkeleton = exports.dataGridClassnames = exports.DataGrid = void 0;
4
4
  var DataGrid_1 = require("./DataGrid");
5
5
  Object.defineProperty(exports, "DataGrid", { enumerable: true, get: function () { return DataGrid_1.DataGrid; } });
6
6
  var constants_1 = require("./constants");
7
7
  Object.defineProperty(exports, "dataGridClassnames", { enumerable: true, get: function () { return constants_1.dataGridClassnames; } });
8
8
  var MobileSkeleton_1 = require("./MobileSkeleton");
9
9
  Object.defineProperty(exports, "MobileSkeleton", { enumerable: true, get: function () { return MobileSkeleton_1.MobileSkeleton; } });
10
+ var RowBase_1 = require("./RowBase");
11
+ Object.defineProperty(exports, "RowBase", { enumerable: true, get: function () { return RowBase_1.RowBase; } });
12
+ var DataGridContext_1 = require("./DataGridContext");
13
+ Object.defineProperty(exports, "DataGridContext", { enumerable: true, get: function () { return DataGridContext_1.DataGridContext; } });
14
+ var DataGridStorageContext_1 = require("./DataGridStorageContext");
15
+ Object.defineProperty(exports, "DataGridStorageContext", { enumerable: true, get: function () { return DataGridStorageContext_1.DataGridStorageContext; } });
@@ -2,10 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DisabledDataGridWrapper = exports.DataGridWrapper = exports.Container = void 0;
4
4
  const styled_1 = require("../styled");
5
- const constants_1 = require("./Cell/constants");
6
- const constants_2 = require("./constants");
5
+ const constants_1 = require("./Body/constants");
6
+ const constants_2 = require("./Cell/constants");
7
+ const constants_3 = require("./constants");
7
8
  const HeadCell_1 = require("./HeadCell");
8
- const constants_3 = require("./Row/constants");
9
+ const constants_4 = require("./Row/constants");
9
10
  exports.Container = styled_1.styled.div `
10
11
  --max-height: initial;
11
12
 
@@ -19,20 +20,20 @@ exports.Container = styled_1.styled.div `
19
20
  height: 100%;
20
21
  max-height: var(--max-height);
21
22
 
22
- &.${constants_2.dataGridClassnames.isAllowHorizontalScroll} {
23
+ &.${constants_3.dataGridClassnames.isAllowHorizontalScroll} {
23
24
  overflow: auto hidden;
24
25
 
25
- & .${constants_2.dataGridClassnames.wrapper} {
26
+ & .${constants_3.dataGridClassnames.wrapper} {
26
27
  overflow: auto hidden;
27
28
  }
28
29
  }
29
30
 
30
- &.${constants_2.dataGridClassnames.hasPinnedSections} {
31
+ &.${constants_3.dataGridClassnames.hasPinnedSections} {
31
32
  overflow: hidden;
32
33
  }
33
34
 
34
- &.${constants_2.dataGridClassnames.hasGroupedColumns} {
35
- & .${constants_2.dataGridClassnames.header} {
35
+ &.${constants_3.dataGridClassnames.hasGroupedColumns} {
36
+ & .${constants_3.dataGridClassnames.header} {
36
37
  grid-template-rows: repeat(2, auto);
37
38
 
38
39
  & .${HeadCell_1.headCellClassnames.groupParent} {
@@ -55,25 +56,25 @@ exports.Container = styled_1.styled.div `
55
56
  }
56
57
 
57
58
  @supports not (container-type: scroll-state) {
58
- &.${constants_2.dataGridClassnames.overflowed} {
59
- & .${constants_2.dataGridClassnames.rightPinnedSection} {
59
+ &.${constants_3.dataGridClassnames.overflowed} {
60
+ & .${constants_3.dataGridClassnames.rightPinnedSection} {
60
61
  box-shadow: -3px 0 4px 0 #63636326;
61
62
  }
62
63
 
63
- & .${constants_2.dataGridClassnames.leftPinnedSection} {
64
+ & .${constants_3.dataGridClassnames.leftPinnedSection} {
64
65
  box-shadow: 3px 0 4px 0 #63636326;
65
66
  }
66
67
  }
67
68
  }
68
69
 
69
- &.${constants_2.dataGridClassnames.gridViewFull} {
70
- & .${constants_2.dataGridClassnames.header} {
70
+ &.${constants_3.dataGridClassnames.gridViewFull} {
71
+ & .${constants_3.dataGridClassnames.header} {
71
72
  background-color: ${({ theme }) => theme.palette.grey[100]};
72
73
  border-top-left-radius: ${({ theme }) => theme.shape.medium};
73
74
  border-top-right-radius: ${({ theme }) => theme.shape.medium};
74
75
  }
75
76
 
76
- & .${constants_1.dataGridCellClassnames.root},
77
+ & .${constants_2.dataGridCellClassnames.root},
77
78
  & .${HeadCell_1.headCellClassnames.root} {
78
79
  border-top: 1px solid ${({ theme }) => theme.palette.components.border.default};
79
80
  border-left: 1px solid ${({ theme }) => theme.palette.components.border.default};
@@ -89,12 +90,12 @@ exports.Container = styled_1.styled.div `
89
90
  border-top: none;
90
91
  }
91
92
 
92
- & .${constants_3.dataGridRowClassnames.root}:last-of-type .${constants_1.dataGridCellClassnames.root} {
93
+ & .${constants_4.dataGridRowClassnames.root}:last-of-type .${constants_2.dataGridCellClassnames.root} {
93
94
  border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
94
95
  }
95
96
 
96
- &:not(.${constants_2.dataGridClassnames.hasPinnedSections}) .${constants_2.dataGridClassnames.body},
97
- & .${constants_2.dataGridClassnames.pinnedSections} {
97
+ &:not(.${constants_3.dataGridClassnames.hasPinnedSections}) .${constants_3.dataGridClassnames.body},
98
+ & .${constants_3.dataGridClassnames.pinnedSections} {
98
99
  container-name: data-grid-scroll-container;
99
100
  container-type: scroll-state;
100
101
  }
@@ -102,12 +103,12 @@ exports.Container = styled_1.styled.div `
102
103
  /* Прогрессивное улучшение. Убираем нижнюю границу последней строки когда scrollbar находится в нижней точке. Для того что бы избежать двойного разделителя снизу */
103
104
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
104
105
  @container data-grid-scroll-container scroll-state((scrollable: y) and (not (scrollable: bottom))) {
105
- & .${constants_3.dataGridRowClassnames.root}:last-of-type .${constants_1.dataGridCellClassnames.root} {
106
+ & .${constants_4.dataGridRowClassnames.root}:last-of-type .${constants_2.dataGridCellClassnames.root} {
106
107
  border-bottom: none;
107
108
  }
108
109
  }
109
110
 
110
- & .${constants_3.dataGridRowClassnames.root}:first-of-type .${constants_1.dataGridCellClassnames.root} {
111
+ & .${constants_4.dataGridRowClassnames.root}:first-of-type .${constants_2.dataGridCellClassnames.root} {
111
112
  border-top: none;
112
113
  }
113
114
  }
@@ -115,31 +116,44 @@ exports.Container = styled_1.styled.div `
115
116
  ${({ theme }) => theme.breakpoints.down('sm')} {
116
117
  overflow: initial;
117
118
 
118
- & .${constants_2.dataGridClassnames.loadingPlaceholder} {
119
+ & .${constants_3.dataGridClassnames.loadingPlaceholder} {
119
120
  justify-content: flex-start;
120
121
  }
121
122
 
122
- &.${constants_2.dataGridClassnames.hasPinnedSections} {
123
+ &.${constants_3.dataGridClassnames.hasPinnedSections} {
123
124
  overflow: initial;
124
125
  }
125
126
 
126
- &.${constants_2.dataGridClassnames.isAllowHorizontalScroll} {
127
+ &.${constants_3.dataGridClassnames.isAllowHorizontalScroll} {
127
128
  overflow: initial;
128
129
 
129
- & .${constants_2.dataGridClassnames.wrapper} {
130
+ & .${constants_3.dataGridClassnames.wrapper} {
130
131
  overflow: initial;
131
132
  }
132
133
  }
133
134
 
134
- &.${constants_2.dataGridClassnames.gridViewFull} {
135
- & .${constants_1.dataGridCellClassnames.root}, & .${HeadCell_1.headCellClassnames.root} {
135
+ &.${constants_3.dataGridClassnames.gridViewFull} {
136
+ & .${constants_2.dataGridCellClassnames.root}, & .${HeadCell_1.headCellClassnames.root} {
136
137
  border: none;
137
138
  }
138
139
 
139
- & .${constants_3.dataGridRowClassnames.root}:last-of-type .${constants_1.dataGridCellClassnames.root} {
140
+ & .${constants_4.dataGridRowClassnames.root}:last-of-type .${constants_2.dataGridCellClassnames.root} {
140
141
  border-bottom: none;
141
142
  }
142
143
  }
144
+
145
+ &.${constants_3.dataGridClassnames.mobileVariantCards} {
146
+
147
+ & .${constants_3.dataGridClassnames.wrapper} {
148
+ margin: ${({ theme }) => theme.spacing(0, 4, 4)};
149
+ }
150
+
151
+ & .${constants_1.bodyClassnames.root} {
152
+ display: flex;
153
+ flex-direction: column;
154
+ gap: ${({ theme }) => theme.spacing(2)};
155
+ }
156
+ }
143
157
  }
144
158
  `;
145
159
  exports.DataGridWrapper = styled_1.styled.div `
@@ -0,0 +1,21 @@
1
+ import { type ReactElement, type ReactNode } from 'react';
2
+ import { type DataGridColumns, type DataGridRowWithOptions } from '../../types';
3
+ type RenderRow = (row: Record<string, unknown>, index: number) => ReactNode;
4
+ type GridRenderProps = {
5
+ rows: DataGridRowWithOptions<DataItem>[];
6
+ columns: DataGridColumns<DataItem>[];
7
+ selectedRows?: DataItem[];
8
+ onSelectRow?: (rows: DataItem[]) => void;
9
+ renderRow?: RenderRow;
10
+ onRetry: () => void;
11
+ };
12
+ type TestDataGridPerformanceParams = {
13
+ render: (ui: ReactElement) => void;
14
+ renderGrid: (props: GridRenderProps) => ReactNode;
15
+ };
16
+ type DataItem = {
17
+ id: string;
18
+ name: string;
19
+ };
20
+ export declare const testDataGridPerformance: ({ render, renderGrid, }: TestDataGridPerformanceParams) => void;
21
+ export {};
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.testDataGridPerformance = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const tests_1 = require("@ui/dev/tests");
6
+ const react_1 = require("react");
7
+ const vitest_1 = require("vitest");
8
+ const TEST_ROWS = [
9
+ { id: '1', name: 'Vasya' },
10
+ { id: '2', name: 'Petya' },
11
+ { id: '3', name: 'Ivan' },
12
+ ];
13
+ const testDataGridPerformance = ({ render, renderGrid, }) => {
14
+ const getRenderCountFor = (spy, id) => spy.mock.calls.filter(([row]) => row.id === id).length;
15
+ (0, vitest_1.it)('При клике на чекбокс перерендеривается только выбранная строка', async () => {
16
+ const renderCellSpy = vitest_1.vi.fn((row) => row.name);
17
+ const TestComponent = () => {
18
+ const [selectedRows, setSelectedRows] = (0, react_1.useState)([]);
19
+ const columns = (0, react_1.useMemo)(() => [
20
+ {
21
+ field: 'name',
22
+ label: 'Наименование',
23
+ renderCell: renderCellSpy,
24
+ },
25
+ ], []);
26
+ return renderGrid({
27
+ rows: TEST_ROWS,
28
+ columns,
29
+ selectedRows,
30
+ onSelectRow: setSelectedRows,
31
+ onRetry: () => { },
32
+ });
33
+ };
34
+ render((0, jsx_runtime_1.jsx)(TestComponent, {}));
35
+ renderCellSpy.mockClear();
36
+ const checkboxes = tests_1.screen.getAllByRole('checkbox');
37
+ const secondRowCheckbox = checkboxes[2];
38
+ await tests_1.userEvents.click(secondRowCheckbox);
39
+ (0, vitest_1.expect)(getRenderCountFor(renderCellSpy, '1')).toBe(0);
40
+ (0, vitest_1.expect)(getRenderCountFor(renderCellSpy, '2')).toBe(1);
41
+ (0, vitest_1.expect)(getRenderCountFor(renderCellSpy, '3')).toBe(0);
42
+ });
43
+ (0, vitest_1.it)('При изменении значений одного row перерендеривается только этот row', async () => {
44
+ const renderCellSpy = vitest_1.vi.fn((row) => row.name);
45
+ const TestComponent = () => {
46
+ const [rows, setRows] = (0, react_1.useState)(TEST_ROWS);
47
+ const columns = (0, react_1.useMemo)(() => [
48
+ {
49
+ field: 'name',
50
+ label: 'Наименование',
51
+ renderCell: renderCellSpy,
52
+ },
53
+ ], []);
54
+ const updateSecondRow = () => {
55
+ setRows((prevRows) => prevRows.map((row) => row.id === '2' ? { ...row, name: 'Petya Updated' } : row));
56
+ };
57
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("button", { onClick: updateSecondRow, children: "Update row 2" }), renderGrid({
58
+ rows,
59
+ columns,
60
+ onRetry: () => { },
61
+ selectedRows: [],
62
+ onSelectRow: () => { },
63
+ })] }));
64
+ };
65
+ render((0, jsx_runtime_1.jsx)(TestComponent, {}));
66
+ renderCellSpy.mockClear();
67
+ await tests_1.userEvents.click(tests_1.screen.getByText('Update row 2'));
68
+ (0, vitest_1.expect)(getRenderCountFor(renderCellSpy, '1')).toBe(0);
69
+ (0, vitest_1.expect)(getRenderCountFor(renderCellSpy, '2')).toBe(1);
70
+ (0, vitest_1.expect)(getRenderCountFor(renderCellSpy, '3')).toBe(0);
71
+ (0, vitest_1.expect)(tests_1.screen.getByText('Petya Updated')).toBeVisible();
72
+ });
73
+ (0, vitest_1.it)('При изменении параметра selectedRows изменяется только выбранные строки', async () => {
74
+ const renderCellSpy = vitest_1.vi.fn((row) => row.name);
75
+ const TestComponent = () => {
76
+ const [selectedRows, setSelectedRows] = (0, react_1.useState)([]);
77
+ const columns = (0, react_1.useMemo)(() => [
78
+ {
79
+ field: 'name',
80
+ label: 'Наименование',
81
+ renderCell: renderCellSpy,
82
+ },
83
+ ], []);
84
+ const selectRowsDirectly = () => {
85
+ setSelectedRows([
86
+ { id: '1', name: 'Vasya' },
87
+ { id: '3', name: 'Ivan' },
88
+ ]);
89
+ };
90
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("button", { onClick: selectRowsDirectly, children: "Select 1 and 3" }), renderGrid({
91
+ rows: TEST_ROWS,
92
+ columns,
93
+ selectedRows,
94
+ onSelectRow: setSelectedRows,
95
+ onRetry: () => { },
96
+ })] }));
97
+ };
98
+ render((0, jsx_runtime_1.jsx)(TestComponent, {}));
99
+ renderCellSpy.mockClear();
100
+ await tests_1.userEvents.click(tests_1.screen.getByText('Select 1 and 3'));
101
+ (0, vitest_1.expect)(getRenderCountFor(renderCellSpy, '1')).toBe(1);
102
+ (0, vitest_1.expect)(getRenderCountFor(renderCellSpy, '2')).toBe(0);
103
+ (0, vitest_1.expect)(getRenderCountFor(renderCellSpy, '3')).toBe(1);
104
+ });
105
+ };
106
+ exports.testDataGridPerformance = testDataGridPerformance;
@@ -181,6 +181,15 @@ export type DataGridProps<TData extends Record<string, CellValue> = DataGridRow,
181
181
  * Включает моноширинный шрифт для чисел в таблице
182
182
  */
183
183
  isTabularNums?: boolean;
184
+ /**
185
+ * Кастомный компонент для отображения строк таблицы
186
+ * @example <DataGrid renderRow={(row) => <DataGridCollapsibleRow><CustomContent row={row} /></DataGridCollapsibleRow>} />
187
+ */
188
+ renderRow?: (row: TData, index: number) => ReactNode;
189
+ /**
190
+ * Вариант отображения таблицы на мобильных устройствах
191
+ */
192
+ mobileDisplayVariant?: 'cards' | 'list';
184
193
  };
185
194
  export type DataGridSort<TSortField> = {
186
195
  /**
@@ -336,3 +345,5 @@ export type DataGridRowWithOptions<TData extends DataGridRow> = TData & {
336
345
  options?: DataGridRowOptions<TData>;
337
346
  children?: DataGridRowWithOptions<TData>[];
338
347
  };
348
+ export type ContextOnRowClick = (row: Record<string, unknown>) => void;
349
+ export type RenderRow = (row: Record<string, unknown>, index: number) => ReactNode;
@@ -6,12 +6,14 @@ type UseDataGridMobileLogicParams<TData extends Record<string, CellValue> = Data
6
6
  columns?: DataGridSingleColumn<TData>[];
7
7
  rows?: TData[];
8
8
  isNoScrollToTop?: boolean;
9
+ mobileDisplayVariant: 'cards' | 'list';
9
10
  };
10
- export declare const useDataGridMobileLogic: <TData extends Record<string, unknown> = DataGridRow>({ containerRef, isLoading, columns, rows, isNoScrollToTop, }: UseDataGridMobileLogicParams<TData>) => {
11
+ export declare const useDataGridMobileLogic: <TData extends Record<string, unknown> = DataGridRow>({ containerRef, isLoading, columns, rows, isNoScrollToTop, mobileDisplayVariant, }: UseDataGridMobileLogicParams<TData>) => {
11
12
  isMobile: boolean;
12
13
  mobileSkeletonProps: {
13
14
  cellsCount: number;
14
15
  rowsCount: number;
16
+ mobileDisplayVariant: "list" | "cards";
15
17
  };
16
18
  };
17
19
  export {};
@@ -5,7 +5,7 @@ const react_1 = require("react");
5
5
  const constants_1 = require("../../../../PageLayoutContainer/constants");
6
6
  const useViewportType_1 = require("../../../../useViewportType");
7
7
  const constants_2 = require("../../../constants");
8
- const useDataGridMobileLogic = ({ containerRef, isLoading, columns, rows, isNoScrollToTop = false, }) => {
8
+ const useDataGridMobileLogic = ({ containerRef, isLoading, columns, rows, isNoScrollToTop = false, mobileDisplayVariant, }) => {
9
9
  const { isMobile } = (0, useViewportType_1.useViewportType)();
10
10
  const firstLoadedRowsCountRef = (0, react_1.useRef)(null);
11
11
  const mobileSkeletonCellsCount = (0, react_1.useMemo)(() => columns?.filter((column) => !column.isHideOnMobile).length ?? 0, [columns]);
@@ -34,6 +34,7 @@ const useDataGridMobileLogic = ({ containerRef, isLoading, columns, rows, isNoSc
34
34
  const mobileSkeletonProps = {
35
35
  cellsCount: mobileSkeletonCellsCount,
36
36
  rowsCount: firstLoadedRowsCountRef.current ?? constants_2.DEFAULT_MOBILE_SKELETON_ROWS_COUNT,
37
+ mobileDisplayVariant,
37
38
  };
38
39
  return { isMobile, mobileSkeletonProps };
39
40
  };