@astral/ui 4.55.4 → 4.57.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 (278) hide show
  1. package/components/BottomDrawer/styles.js +1 -1
  2. package/components/CardGridInfinite/Footer/styles.js +1 -1
  3. package/components/CheckableTag/styles.js +1 -1
  4. package/components/Checkbox/styles.js +4 -2
  5. package/components/Chip/styles.js +1 -1
  6. package/components/CodeField/styles.js +1 -1
  7. package/components/ComplianceStatus/styles.js +1 -1
  8. package/components/ContentState/ContentState.d.ts +1 -1
  9. package/components/ContentState/ContentState.js +2 -2
  10. package/components/ContentState/types.d.ts +4 -0
  11. package/components/DashboardLayout/DashboardWrapper/styles.js +1 -1
  12. package/components/DashboardLayout/Header/styles.js +4 -4
  13. package/components/DashboardLayoutSkeleton/styles.js +1 -1
  14. package/components/DashboardSidebar/styles.js +2 -2
  15. package/components/DashboardSidebarSkeleton/styles.js +1 -1
  16. package/components/DataGrid/Body/Body.d.ts +1 -1
  17. package/components/DataGrid/Body/Body.js +14 -7
  18. package/components/DataGrid/Body/constants.d.ts +4 -0
  19. package/components/DataGrid/Body/constants.js +5 -0
  20. package/components/DataGrid/Body/styles.d.ts +0 -3
  21. package/components/DataGrid/Body/styles.js +14 -1
  22. package/components/DataGrid/Body/useLogic/index.d.ts +1 -0
  23. package/components/DataGrid/Body/useLogic/index.js +1 -0
  24. package/components/DataGrid/Body/useLogic/useLogic.d.ts +9 -0
  25. package/components/DataGrid/Body/useLogic/useLogic.js +15 -0
  26. package/components/DataGrid/Cell/Cell.js +20 -4
  27. package/components/DataGrid/Cell/constants.d.ts +7 -0
  28. package/components/DataGrid/Cell/constants.js +8 -0
  29. package/components/DataGrid/Cell/styles.d.ts +14 -0
  30. package/components/DataGrid/Cell/styles.js +47 -0
  31. package/components/DataGrid/Cell/useLogic/useLogic.d.ts +2 -0
  32. package/components/DataGrid/Cell/useLogic/useLogic.js +3 -2
  33. package/components/DataGrid/DataGrid.js +42 -8
  34. package/components/DataGrid/Head/Head.js +1 -1
  35. package/components/DataGrid/Head/styles.js +5 -1
  36. package/components/DataGrid/Loader/styles.js +4 -0
  37. package/components/DataGrid/MobileSkeleton/MobileSkeleton.d.ts +6 -0
  38. package/components/DataGrid/MobileSkeleton/MobileSkeleton.js +10 -0
  39. package/components/DataGrid/MobileSkeleton/index.d.ts +1 -0
  40. package/components/DataGrid/MobileSkeleton/index.js +1 -0
  41. package/components/DataGrid/MobileSkeleton/styles.d.ts +17 -0
  42. package/components/DataGrid/MobileSkeleton/styles.js +37 -0
  43. package/components/DataGrid/PinnedSections/Section/styles.js +2 -2
  44. package/components/DataGrid/Row/NestedChildren/styles.js +8 -3
  45. package/components/DataGrid/Row/Row.js +25 -8
  46. package/components/DataGrid/Row/constants.d.ts +8 -0
  47. package/components/DataGrid/Row/constants.js +8 -0
  48. package/components/DataGrid/Row/styles.d.ts +4 -9
  49. package/components/DataGrid/Row/styles.js +69 -17
  50. package/components/DataGrid/Row/types.d.ts +5 -1
  51. package/components/DataGrid/Row/useLogic/hooks/index.d.ts +1 -0
  52. package/components/DataGrid/Row/useLogic/hooks/index.js +1 -0
  53. package/components/DataGrid/Row/useLogic/hooks/useMobileLogic.d.ts +5 -0
  54. package/components/DataGrid/Row/useLogic/hooks/useMobileLogic.js +15 -0
  55. package/components/DataGrid/Row/useLogic/useLogic.d.ts +868 -3
  56. package/components/DataGrid/Row/useLogic/useLogic.js +28 -13
  57. package/components/DataGrid/constants.d.ts +4 -0
  58. package/components/DataGrid/constants.js +4 -0
  59. package/components/DataGrid/index.d.ts +1 -0
  60. package/components/DataGrid/index.js +1 -0
  61. package/components/DataGrid/styles.d.ts +0 -9
  62. package/components/DataGrid/styles.js +43 -12
  63. package/components/DataGrid/types.d.ts +7 -0
  64. package/components/DataGrid/useLogic/hooks/index.d.ts +1 -1
  65. package/components/DataGrid/useLogic/hooks/index.js +1 -1
  66. package/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/index.d.ts +1 -0
  67. package/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/index.js +1 -0
  68. package/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.d.ts +16 -0
  69. package/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.js +32 -0
  70. package/components/DataGrid/useLogic/hooks/usePinnedColumns/usePinnedColumns.js +11 -3
  71. package/components/DataGrid/useLogic/useLogic.d.ts +10 -4
  72. package/components/DataGrid/useLogic/useLogic.js +17 -12
  73. package/components/DataGrid/useLogic/utils/getIsAllowHorizontalScroll/getIsAllowHorizontalScroll.js +1 -1
  74. package/components/DataGrid/utils/getDataGridCssVars/getDataGridCssVars.d.ts +2 -0
  75. package/components/DataGrid/utils/getDataGridCssVars/getDataGridCssVars.js +5 -0
  76. package/components/DataGrid/utils/getDataGridCssVars/index.d.ts +1 -0
  77. package/components/DataGrid/utils/getDataGridCssVars/index.js +1 -0
  78. package/components/DataGrid/utils/index.d.ts +1 -0
  79. package/components/DataGrid/utils/index.js +1 -0
  80. package/components/DataGridActionCell/DataGridSecondaryActions/DataGridSecondaryActions.js +1 -1
  81. package/components/DataGridInfinite/DataGridInfinite.js +5 -4
  82. package/components/DataGridInfinite/useLogic/useLogic.d.ts +7 -1
  83. package/components/DataGridInfinite/useLogic/useLogic.js +12 -2
  84. package/components/DateRangePicker/styles.js +1 -1
  85. package/components/Description/Name/styles.js +1 -1
  86. package/components/DescriptionCell/styles.js +12 -3
  87. package/components/DescriptionList/styles.js +4 -2
  88. package/components/ExpansionPanel/styles.js +1 -1
  89. package/components/InfiniteDataList/styles.js +1 -1
  90. package/components/InfiniteTreeList/TreeItem/styles.js +1 -1
  91. package/components/MenuOrganization/styles.js +2 -2
  92. package/components/NewStepper/Step/Description/styles.js +1 -1
  93. package/components/NewStepper/Step/styles.js +2 -2
  94. package/components/NewStepper/index.d.ts +1 -0
  95. package/components/NewStepper/index.js +1 -0
  96. package/components/NewStepper/public.d.ts +1 -0
  97. package/components/NewStepper/public.js +1 -0
  98. package/components/PageAside/styles.js +3 -3
  99. package/components/PageContent/PageContentHeader/styles.js +2 -2
  100. package/components/PageContent/styles.js +4 -2
  101. package/components/PageHeader/HeaderContent/styles.js +1 -1
  102. package/components/PageHeader/styles.js +2 -2
  103. package/components/PageLayoutLoader/styles.js +1 -1
  104. package/components/PageLayoutSection/PageLayoutSection.d.ts +4 -0
  105. package/components/PageLayoutSection/PageLayoutSection.js +13 -4
  106. package/components/PageLayoutSection/PageLayoutSectionContainer/styles.js +1 -1
  107. package/components/PageLayoutSection/constants.d.ts +5 -0
  108. package/components/PageLayoutSection/constants.js +6 -0
  109. package/components/PageLayoutSection/styles.d.ts +1 -1
  110. package/components/PageLayoutSection/styles.js +7 -2
  111. package/components/PagePinnableAside/styles.js +6 -6
  112. package/components/PdfViewer/PdfPage/styles.js +2 -2
  113. package/components/Radio/styles.js +4 -2
  114. package/components/RadioCard/styles.js +13 -5
  115. package/components/SideDialogActions/styles.js +1 -1
  116. package/components/SideDialogHeader/styles.js +1 -1
  117. package/components/SideDialogTitle/styles.js +1 -1
  118. package/components/Stepper/styles.js +2 -2
  119. package/components/Tag/styles.js +1 -1
  120. package/components/Tree/TreeItem/styles.js +3 -3
  121. package/components/fileUploading/FileUploaderDropzone/DropzoneWrapper/styles.js +1 -1
  122. package/components/fileUploading/FileUploaderFile/styles.js +1 -1
  123. package/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.d.ts +5 -1
  124. package/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.js +5 -4
  125. package/components/theme/components/MuiButton.js +1 -1
  126. package/components/theme/components/MuiDivider.d.ts +3 -0
  127. package/components/theme/components/MuiDivider.js +9 -0
  128. package/components/theme/components/MuiListItem.d.ts +3 -0
  129. package/components/theme/components/MuiListItem.js +9 -0
  130. package/components/theme/components/MuiOutlinedInput.js +2 -2
  131. package/components/theme/components/MuiPaper.js +1 -1
  132. package/components/theme/components/MuiStepConnector.js +4 -1
  133. package/components/theme/components/components.js +4 -0
  134. package/components/theme/palette/componentsColors/componentsColors.d.ts +3 -0
  135. package/components/theme/palette/componentsColors/componentsColors.js +3 -0
  136. package/node/components/BottomDrawer/styles.js +1 -1
  137. package/node/components/CardGridInfinite/Footer/styles.js +1 -1
  138. package/node/components/CheckableTag/styles.js +1 -1
  139. package/node/components/Checkbox/styles.js +4 -2
  140. package/node/components/Chip/styles.js +1 -1
  141. package/node/components/CodeField/styles.js +1 -1
  142. package/node/components/ComplianceStatus/styles.js +1 -1
  143. package/node/components/ContentState/ContentState.d.ts +1 -1
  144. package/node/components/ContentState/ContentState.js +2 -2
  145. package/node/components/ContentState/types.d.ts +4 -0
  146. package/node/components/DashboardLayout/DashboardWrapper/styles.js +1 -1
  147. package/node/components/DashboardLayout/Header/styles.js +4 -4
  148. package/node/components/DashboardLayoutSkeleton/styles.js +1 -1
  149. package/node/components/DashboardSidebar/styles.js +2 -2
  150. package/node/components/DashboardSidebarSkeleton/styles.js +1 -1
  151. package/node/components/DataGrid/Body/Body.d.ts +1 -1
  152. package/node/components/DataGrid/Body/Body.js +14 -7
  153. package/node/components/DataGrid/Body/constants.d.ts +4 -0
  154. package/node/components/DataGrid/Body/constants.js +8 -0
  155. package/node/components/DataGrid/Body/styles.d.ts +0 -3
  156. package/node/components/DataGrid/Body/styles.js +14 -1
  157. package/node/components/DataGrid/Body/useLogic/index.d.ts +1 -0
  158. package/node/components/DataGrid/{useLogic/hooks/useClassnames → Body/useLogic}/index.js +1 -1
  159. package/node/components/DataGrid/Body/useLogic/useLogic.d.ts +9 -0
  160. package/node/components/DataGrid/Body/useLogic/useLogic.js +19 -0
  161. package/node/components/DataGrid/Cell/Cell.js +18 -2
  162. package/node/components/DataGrid/Cell/constants.d.ts +7 -0
  163. package/node/components/DataGrid/Cell/constants.js +11 -0
  164. package/node/components/DataGrid/Cell/styles.d.ts +14 -0
  165. package/node/components/DataGrid/Cell/styles.js +48 -1
  166. package/node/components/DataGrid/Cell/useLogic/useLogic.d.ts +2 -0
  167. package/node/components/DataGrid/Cell/useLogic/useLogic.js +3 -2
  168. package/node/components/DataGrid/DataGrid.js +41 -7
  169. package/node/components/DataGrid/Head/Head.js +1 -1
  170. package/node/components/DataGrid/Head/styles.js +5 -1
  171. package/node/components/DataGrid/Loader/styles.js +4 -0
  172. package/node/components/DataGrid/MobileSkeleton/MobileSkeleton.d.ts +6 -0
  173. package/node/components/DataGrid/MobileSkeleton/MobileSkeleton.js +14 -0
  174. package/node/components/DataGrid/MobileSkeleton/index.d.ts +1 -0
  175. package/node/components/DataGrid/MobileSkeleton/index.js +17 -0
  176. package/node/components/DataGrid/MobileSkeleton/styles.d.ts +17 -0
  177. package/node/components/DataGrid/MobileSkeleton/styles.js +40 -0
  178. package/node/components/DataGrid/PinnedSections/Section/styles.js +2 -2
  179. package/node/components/DataGrid/Row/NestedChildren/styles.js +8 -3
  180. package/node/components/DataGrid/Row/Row.js +23 -6
  181. package/node/components/DataGrid/Row/constants.d.ts +8 -0
  182. package/node/components/DataGrid/Row/constants.js +9 -1
  183. package/node/components/DataGrid/Row/styles.d.ts +4 -9
  184. package/node/components/DataGrid/Row/styles.js +69 -17
  185. package/node/components/DataGrid/Row/types.d.ts +5 -1
  186. package/node/components/DataGrid/Row/useLogic/hooks/index.d.ts +1 -0
  187. package/node/components/DataGrid/Row/useLogic/hooks/index.js +17 -0
  188. package/node/components/DataGrid/Row/useLogic/hooks/useMobileLogic.d.ts +5 -0
  189. package/node/components/DataGrid/Row/useLogic/hooks/useMobileLogic.js +19 -0
  190. package/node/components/DataGrid/Row/useLogic/useLogic.d.ts +868 -3
  191. package/node/components/DataGrid/Row/useLogic/useLogic.js +28 -13
  192. package/node/components/DataGrid/constants.d.ts +4 -0
  193. package/node/components/DataGrid/constants.js +5 -1
  194. package/node/components/DataGrid/index.d.ts +1 -0
  195. package/node/components/DataGrid/index.js +3 -1
  196. package/node/components/DataGrid/styles.d.ts +0 -9
  197. package/node/components/DataGrid/styles.js +43 -12
  198. package/node/components/DataGrid/types.d.ts +7 -0
  199. package/node/components/DataGrid/useLogic/hooks/index.d.ts +1 -1
  200. package/node/components/DataGrid/useLogic/hooks/index.js +1 -1
  201. package/node/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/index.d.ts +1 -0
  202. package/node/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/index.js +17 -0
  203. package/node/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.d.ts +16 -0
  204. package/node/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.js +36 -0
  205. package/node/components/DataGrid/useLogic/hooks/usePinnedColumns/usePinnedColumns.js +11 -3
  206. package/node/components/DataGrid/useLogic/useLogic.d.ts +10 -4
  207. package/node/components/DataGrid/useLogic/useLogic.js +19 -14
  208. package/node/components/DataGrid/useLogic/utils/getIsAllowHorizontalScroll/getIsAllowHorizontalScroll.js +1 -1
  209. package/node/components/DataGrid/utils/getDataGridCssVars/getDataGridCssVars.d.ts +2 -0
  210. package/node/components/DataGrid/utils/getDataGridCssVars/getDataGridCssVars.js +9 -0
  211. package/node/components/DataGrid/utils/getDataGridCssVars/index.d.ts +1 -0
  212. package/node/components/DataGrid/utils/getDataGridCssVars/index.js +5 -0
  213. package/node/components/DataGrid/utils/index.d.ts +1 -0
  214. package/node/components/DataGrid/utils/index.js +3 -1
  215. package/node/components/DataGridActionCell/DataGridSecondaryActions/DataGridSecondaryActions.js +1 -1
  216. package/node/components/DataGridInfinite/DataGridInfinite.js +5 -4
  217. package/node/components/DataGridInfinite/useLogic/useLogic.d.ts +7 -1
  218. package/node/components/DataGridInfinite/useLogic/useLogic.js +11 -1
  219. package/node/components/DateRangePicker/styles.js +1 -1
  220. package/node/components/Description/Name/styles.js +1 -1
  221. package/node/components/DescriptionCell/styles.js +15 -6
  222. package/node/components/DescriptionList/styles.js +4 -2
  223. package/node/components/ExpansionPanel/styles.js +1 -1
  224. package/node/components/InfiniteDataList/styles.js +1 -1
  225. package/node/components/InfiniteTreeList/TreeItem/styles.js +1 -1
  226. package/node/components/MenuOrganization/styles.js +2 -2
  227. package/node/components/NewStepper/Step/Description/styles.js +1 -1
  228. package/node/components/NewStepper/Step/styles.js +2 -2
  229. package/node/components/NewStepper/index.d.ts +1 -0
  230. package/node/components/NewStepper/index.js +3 -1
  231. package/node/components/NewStepper/public.d.ts +1 -0
  232. package/node/components/NewStepper/public.js +3 -1
  233. package/node/components/PageAside/styles.js +3 -3
  234. package/node/components/PageContent/PageContentHeader/styles.js +2 -2
  235. package/node/components/PageContent/styles.js +4 -2
  236. package/node/components/PageHeader/HeaderContent/styles.js +1 -1
  237. package/node/components/PageHeader/styles.js +2 -2
  238. package/node/components/PageLayoutLoader/styles.js +1 -1
  239. package/node/components/PageLayoutSection/PageLayoutSection.d.ts +4 -0
  240. package/node/components/PageLayoutSection/PageLayoutSection.js +12 -3
  241. package/node/components/PageLayoutSection/PageLayoutSectionContainer/styles.js +1 -1
  242. package/node/components/PageLayoutSection/constants.d.ts +5 -0
  243. package/node/components/PageLayoutSection/constants.js +9 -0
  244. package/node/components/PageLayoutSection/styles.d.ts +1 -1
  245. package/node/components/PageLayoutSection/styles.js +8 -3
  246. package/node/components/PagePinnableAside/styles.js +6 -6
  247. package/node/components/PdfViewer/PdfPage/styles.js +2 -2
  248. package/node/components/Radio/styles.js +4 -2
  249. package/node/components/RadioCard/styles.js +13 -5
  250. package/node/components/SideDialogActions/styles.js +1 -1
  251. package/node/components/SideDialogHeader/styles.js +1 -1
  252. package/node/components/SideDialogTitle/styles.js +1 -1
  253. package/node/components/Stepper/styles.js +2 -2
  254. package/node/components/Tag/styles.js +1 -1
  255. package/node/components/Tree/TreeItem/styles.js +3 -3
  256. package/node/components/fileUploading/FileUploaderDropzone/DropzoneWrapper/styles.js +1 -1
  257. package/node/components/fileUploading/FileUploaderFile/styles.js +1 -1
  258. package/node/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.d.ts +5 -1
  259. package/node/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.js +5 -4
  260. package/node/components/theme/components/MuiButton.js +1 -1
  261. package/node/components/theme/components/MuiDivider.d.ts +3 -0
  262. package/node/components/theme/components/MuiDivider.js +12 -0
  263. package/node/components/theme/components/MuiListItem.d.ts +3 -0
  264. package/node/components/theme/components/MuiListItem.js +12 -0
  265. package/node/components/theme/components/MuiOutlinedInput.js +2 -2
  266. package/node/components/theme/components/MuiPaper.js +1 -1
  267. package/node/components/theme/components/MuiStepConnector.js +4 -1
  268. package/node/components/theme/components/components.js +4 -0
  269. package/node/components/theme/palette/componentsColors/componentsColors.d.ts +3 -0
  270. package/node/components/theme/palette/componentsColors/componentsColors.js +3 -0
  271. package/package.json +20 -1
  272. package/components/DataGrid/useLogic/hooks/useClassnames/index.d.ts +0 -1
  273. package/components/DataGrid/useLogic/hooks/useClassnames/index.js +0 -1
  274. package/components/DataGrid/useLogic/hooks/useClassnames/useClassnames.d.ts +0 -12
  275. package/components/DataGrid/useLogic/hooks/useClassnames/useClassnames.js +0 -14
  276. package/node/components/DataGrid/useLogic/hooks/useClassnames/index.d.ts +0 -1
  277. package/node/components/DataGrid/useLogic/hooks/useClassnames/useClassnames.d.ts +0 -12
  278. package/node/components/DataGrid/useLogic/hooks/useClassnames/useClassnames.js +0 -18
@@ -5,6 +5,8 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const ConfigProvider_1 = require("../ConfigProvider");
7
7
  const ContentState_1 = require("../ContentState");
8
+ const classNames_1 = require("../utils/classNames");
9
+ const cva_1 = require("../utils/cva");
8
10
  const getInertProps_1 = require("../utils/getInertProps");
9
11
  const Body_1 = require("./Body");
10
12
  const constants_1 = require("./constants");
@@ -12,17 +14,42 @@ const DataGridContext_1 = require("./DataGridContext");
12
14
  const enums_1 = require("./enums");
13
15
  const Head_1 = require("./Head");
14
16
  const Loader_1 = require("./Loader");
17
+ const MobileSkeleton_1 = require("./MobileSkeleton");
15
18
  const NoData_1 = require("./NoData");
16
19
  const PinnedSections_1 = require("./PinnedSections");
17
20
  const styles_1 = require("./styles");
18
21
  const useLogic_1 = require("./useLogic");
22
+ const pinnedSectionsCva = (0, cva_1.cva)(constants_1.dataGridClassnames.pinnedSections, {
23
+ variants: {
24
+ isDisabled: {
25
+ true: constants_1.dataGridClassnames.disabled,
26
+ },
27
+ },
28
+ });
29
+ const dataGridCva = (0, cva_1.cva)(constants_1.dataGridClassnames.root, {
30
+ variants: {
31
+ hasPinnedColumns: {
32
+ true: constants_1.dataGridClassnames.dataGridHasPinnedSections,
33
+ },
34
+ isAllowHorizontalScroll: {
35
+ true: constants_1.dataGridClassnames.isAllowHorizontalScroll,
36
+ },
37
+ },
38
+ });
39
+ const bodyCva = (0, cva_1.cva)(constants_1.dataGridClassnames.body, {
40
+ variants: {
41
+ isNoData: {
42
+ true: constants_1.dataGridClassnames.bodyEmpty,
43
+ },
44
+ },
45
+ });
19
46
  const DataGrid = (props) => {
20
- const { isDataGridDisabled, treeRenderConfig, headColumns, headProps, bodyProps, gridColumns, loaderProps, renderRows, isAllowHorizontalScroll, isHideHead, hasPinnedColumns, pinnedSectionsClassname, dataGridClassname, contentStateProps, rowHoverProps, containerRef, sections, isNoData, bodyClassName, } = (0, useLogic_1.useLogic)(props);
47
+ const { dataGridClassName, isDataGridDisabled, treeRenderConfig, headColumns, headProps, bodyProps, gridColumns, loaderProps, renderRows, isAllowHorizontalScroll, isHideHead, hasPinnedColumns, contentStateProps, rowHoverProps, containerRef, sections, isNoData, isMobile, mobileSkeletonProps, isLoading, containerCssVars, } = (0, useLogic_1.useLogic)(props);
21
48
  const { emptySymbol } = (0, react_1.useContext)(ConfigProvider_1.ConfigContext);
22
- const { columns, selectedRows = [], maxHeight, minDisplayRows = constants_1.MIN_DISPLAY_ROWS_BY_DEFAULT, variant = enums_1.Variant.Tree, footer, noDataPlaceholder, isLoading, subrows, keyId, activeRowId, emptyCellValue = emptySymbol, onRowClick, noDataOptions, headPreAddon, } = props;
49
+ const { columns, selectedRows = [], minDisplayRows = constants_1.MIN_DISPLAY_ROWS_BY_DEFAULT, variant = enums_1.Variant.Tree, footer, noDataPlaceholder, subrows, keyId, activeRowId, emptyCellValue = emptySymbol, onRowClick, noDataOptions, headPreAddon, } = props;
23
50
  const { moreButtonColumnPosition = 1, isVisibleCollapseButton = true } = subrows || {};
24
51
  const { isInitialExpanded = false, expandedLevel = constants_1.EXPANDED_LEVEL_BY_DEFAULT, initialVisibleChildrenCount = constants_1.INITIAL_OPENED_NESTED_CHILDREN_COUNT_BY_DEFAULT, } = treeRenderConfig || {};
25
- const TableContainer = isDataGridDisabled
52
+ const Wrapper = isDataGridDisabled
26
53
  ? styles_1.DisabledDataGridWrapper
27
54
  : styles_1.DataGridWrapper;
28
55
  const renderedPlaceholder = (0, react_1.useCallback)(() => {
@@ -50,11 +77,18 @@ const DataGrid = (props) => {
50
77
  ...rowHoverProps,
51
78
  };
52
79
  const renderTableContent = () => {
53
- if (!hasPinnedColumns) {
54
- return ((0, jsx_runtime_1.jsxs)(TableContainer, { "$isAllowHorizontalScroll": isAllowHorizontalScroll, ...(0, getInertProps_1.getInertProps)(isDataGridDisabled), children: [headPreAddon, !isHideHead && ((0, jsx_runtime_1.jsx)(Head_1.Head, { ...headProps, columns: headColumns, gridColumns: gridColumns })), (0, jsx_runtime_1.jsx)(ContentState_1.ContentState, { ...contentStateProps, children: (0, jsx_runtime_1.jsx)(Body_1.Body, { ...commonBodyProps, columns: columns, gridColumns: gridColumns, className: bodyClassName }) })] }));
80
+ if (!hasPinnedColumns || isMobile) {
81
+ return ((0, jsx_runtime_1.jsxs)(Wrapper, { ...(0, getInertProps_1.getInertProps)(isDataGridDisabled), className: constants_1.dataGridClassnames.wrapper, children: [headPreAddon, !isHideHead && ((0, jsx_runtime_1.jsx)(Head_1.Head, { ...headProps, columns: headColumns, gridColumns: gridColumns })), (0, jsx_runtime_1.jsx)(ContentState_1.ContentState, { ...contentStateProps, loadingContent: isMobile && (0, jsx_runtime_1.jsx)(MobileSkeleton_1.MobileSkeleton, { ...mobileSkeletonProps }), children: (0, jsx_runtime_1.jsx)(Body_1.Body, { ...commonBodyProps, columns: columns, gridColumns: gridColumns, className: bodyCva({
82
+ isNoData,
83
+ }) }) })] }));
55
84
  }
56
- return ((0, jsx_runtime_1.jsx)(ContentState_1.ContentState, { ...contentStateProps, children: (0, jsx_runtime_1.jsx)(PinnedSections_1.PinnedSections, { sections: sections, className: pinnedSectionsClassname, isDisabled: isDataGridDisabled, headProps: headProps, gridColumns: gridColumns, bodyProps: commonBodyProps, isNoData: isNoData }) }));
85
+ return ((0, jsx_runtime_1.jsx)(ContentState_1.ContentState, { ...contentStateProps, children: (0, jsx_runtime_1.jsx)(PinnedSections_1.PinnedSections, { sections: sections, className: pinnedSectionsCva({
86
+ isDisabled: isDataGridDisabled,
87
+ }), isDisabled: isDataGridDisabled, headProps: headProps, gridColumns: gridColumns, bodyProps: commonBodyProps, isNoData: isNoData }) }));
57
88
  };
58
- return ((0, jsx_runtime_1.jsx)(DataGridContext_1.DataGridContextProvider, { isLoading: isLoading, children: (0, jsx_runtime_1.jsxs)(styles_1.Container, { ref: containerRef, "$maxHeight": maxHeight, "$isAllowHorizontalScroll": isAllowHorizontalScroll, className: dataGridClassname, children: [renderTableContent(), (0, jsx_runtime_1.jsx)(Loader_1.Loader, { ...loaderProps }), footer && footer] }) }));
89
+ return ((0, jsx_runtime_1.jsx)(DataGridContext_1.DataGridContextProvider, { isLoading: isLoading, children: (0, jsx_runtime_1.jsxs)(styles_1.Container, { ref: containerRef, style: containerCssVars, className: (0, classNames_1.classNames)(dataGridClassName, dataGridCva({
90
+ isAllowHorizontalScroll,
91
+ hasPinnedColumns,
92
+ })), children: [renderTableContent(), (0, jsx_runtime_1.jsx)(Loader_1.Loader, { ...loaderProps }), footer && footer] }) }));
59
93
  };
60
94
  exports.DataGrid = DataGrid;
@@ -32,6 +32,6 @@ const Head = (props) => {
32
32
  onSelectAllRows,
33
33
  handleSort,
34
34
  ]);
35
- return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { className: constants_1.dataGridClassnames.header, "$gridColumns": gridColumns, children: renderColumns }));
35
+ return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { role: "heading", className: constants_1.dataGridClassnames.header, "$gridColumns": gridColumns, children: renderColumns }));
36
36
  };
37
37
  exports.Head = Head;
@@ -12,7 +12,11 @@ exports.Wrapper = (0, styled_1.styled)('header', {
12
12
  width: fit-content;
13
13
  min-width: 100%;
14
14
 
15
- border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
15
+ border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
16
+
17
+ ${({ theme }) => theme.breakpoints.down('sm')} {
18
+ display: none;
19
+ }
16
20
  `;
17
21
  exports.CheckboxCell = styled_1.styled.div `
18
22
  display: flex;
@@ -44,6 +44,10 @@ exports.LoaderWrapper = styled_1.styled.div `
44
44
  position: sticky;
45
45
  z-index: ${({ theme }) => theme.zIndex.fab};
46
46
  left: 0;
47
+
48
+ ${({ theme }) => theme.breakpoints.down('sm')} {
49
+ display: none;
50
+ }
47
51
  `;
48
52
  exports.StyledLinearProgress = (0, styled_1.styled)(LinearProgress_1.default) `
49
53
  height: 2px;
@@ -0,0 +1,6 @@
1
+ type MobileSkeletonProps = {
2
+ cellsCount: number;
3
+ rowsCount: number;
4
+ };
5
+ export declare const MobileSkeleton: ({ cellsCount, rowsCount, }: MobileSkeletonProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MobileSkeleton = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const Skeleton_1 = require("../../Skeleton");
6
+ const styles_1 = require("./styles");
7
+ const MobileSkeleton = ({ cellsCount, rowsCount, }) => {
8
+ return ((0, jsx_runtime_1.jsx)(styles_1.Root, { children: Array.from({ length: rowsCount }, (_, rowIndex) => ((0, jsx_runtime_1.jsxs)(styles_1.RowWrapper
9
+ // biome-ignore lint/suspicious/noArrayIndexKey: Статичный скелетон
10
+ , { children: [Array.from({ length: cellsCount - 1 }, (_cell, cellIndex) => (
11
+ // biome-ignore lint/suspicious/noArrayIndexKey: Статичный скелетон
12
+ (0, jsx_runtime_1.jsxs)(styles_1.Cell, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.Skeleton, { variant: "rounded", height: 20 }), (0, jsx_runtime_1.jsx)(Skeleton_1.Skeleton, { variant: "rounded", height: 16, width: "50%" })] }, cellIndex))), (0, jsx_runtime_1.jsx)(styles_1.Actions, { children: (0, jsx_runtime_1.jsx)(Skeleton_1.Skeleton, { variant: "rounded", width: "100%", height: 40 }) })] }, rowIndex))) }));
13
+ };
14
+ exports.MobileSkeleton = MobileSkeleton;
@@ -0,0 +1 @@
1
+ export * from './MobileSkeleton';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./MobileSkeleton"), exports);
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ export declare const Root: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
+ export declare const RowWrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
7
+ theme?: import("@emotion/react").Theme | undefined;
8
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
9
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
10
+ export declare const Cell: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
11
+ theme?: import("@emotion/react").Theme | undefined;
12
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
13
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
14
+ export declare const Actions: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
15
+ theme?: import("@emotion/react").Theme | undefined;
16
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
17
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Actions = exports.Cell = exports.RowWrapper = exports.Root = void 0;
4
+ const styled_1 = require("../../styled");
5
+ exports.Root = styled_1.styled.div `
6
+ display: flex;
7
+ flex-direction: column;
8
+
9
+ width: 100%;
10
+ `;
11
+ exports.RowWrapper = styled_1.styled.div `
12
+ display: flex;
13
+ flex-direction: column;
14
+ gap: ${({ theme }) => theme.spacing(3)};
15
+
16
+ padding-top: ${({ theme }) => theme.spacing(1)};
17
+ padding-bottom: ${({ theme }) => theme.spacing(5)};
18
+
19
+ &:not(:last-of-type) {
20
+ border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
21
+ }
22
+
23
+ &:not(:first-of-type) {
24
+ padding-top: ${({ theme }) => theme.spacing(5)};
25
+ }
26
+
27
+ &:last-of-type {
28
+ padding-bottom: 0;
29
+ }
30
+ `;
31
+ exports.Cell = styled_1.styled.div `
32
+ display: flex;
33
+ flex-direction: column;
34
+ gap: ${({ theme }) => theme.spacing(1)};
35
+
36
+ width: 100%;
37
+ `;
38
+ exports.Actions = styled_1.styled.div `
39
+ padding-top: ${({ theme }) => theme.spacing(2)};
40
+ `;
@@ -43,7 +43,7 @@ exports.DataGridSection = styled_1.styled.div `
43
43
 
44
44
  height: 100%;
45
45
 
46
- border-right: 1px solid ${({ theme }) => theme.palette.grey[300]};
46
+ border-right: 1px solid ${({ theme }) => theme.palette.components.border.default};
47
47
  }
48
48
 
49
49
  & .${constants_1.dataGridClassnames.header} {
@@ -82,7 +82,7 @@ exports.DataGridSection = styled_1.styled.div `
82
82
 
83
83
  height: 100%;
84
84
 
85
- border-left: 1px solid ${({ theme }) => theme.palette.grey[300]};
85
+ border-left: 1px solid ${({ theme }) => theme.palette.components.border.default};
86
86
  }
87
87
 
88
88
  & .${constants_1.dataGridClassnames.header} {
@@ -27,7 +27,12 @@ exports.NestedRows = (0, styled_1.styled)('ul', {
27
27
  width: 0;
28
28
  height: 100%;
29
29
 
30
- border-left: 1px solid ${({ theme }) => theme.palette.grey[400]};
30
+ border-left: 1px solid ${({ theme }) => theme.palette.components.border.default};
31
+ }
32
+
33
+ /* TODO: Убрать после реализации задачи по адаптации вложенных строк https://track.astral.ru/soft/browse/UIKIT-2188 */
34
+ ${({ theme }) => theme.breakpoints.down('sm')} {
35
+ display: none;
31
36
  }
32
37
  `;
33
38
  exports.MoreButtonRow = (0, styled_1.styled)('li', {
@@ -53,8 +58,8 @@ exports.MoreButtonRow = (0, styled_1.styled)('li', {
53
58
  width: ${constants_1.TREE_LINE_WIDTH}px;
54
59
  height: 50%;
55
60
 
56
- border-bottom: 1px solid ${({ theme }) => theme.palette.grey[400]};
57
- border-left: 1px solid ${({ theme }) => theme.palette.grey[400]};
61
+ border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
62
+ border-left: 1px solid ${({ theme }) => theme.palette.components.border.default};
58
63
  border-radius: 0 0 0 ${({ theme }) => theme.shape.small};
59
64
  }
60
65
  `;
@@ -3,18 +3,35 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Row = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
+ const BottomDrawer_1 = require("../../BottomDrawer");
6
7
  const Checkbox_1 = require("../../Checkbox");
7
8
  const Tooltip_1 = require("../../Tooltip");
8
9
  const checkIsDeepEqual_1 = require("../../utils/checkIsDeepEqual");
10
+ const classNames_1 = require("../../utils/classNames");
11
+ const cva_1 = require("../../utils/cva");
9
12
  const getInertProps_1 = require("../../utils/getInertProps");
10
13
  const constants_1 = require("./constants");
11
14
  const NestedChildren_1 = require("./NestedChildren");
12
15
  const styles_1 = require("./styles");
13
16
  const useLogic_1 = require("./useLogic");
14
17
  const utils_1 = require("./utils");
18
+ const rootCva = (0, cva_1.cva)(constants_1.dataGridRowClassnames.root, {
19
+ variants: {
20
+ isShowConnector: {
21
+ true: constants_1.dataGridRowClassnames.showConnector,
22
+ },
23
+ },
24
+ });
25
+ const rowContentCva = (0, cva_1.cva)(constants_1.dataGridRowContentClassnames.root, {
26
+ variants: {
27
+ isHovered: {
28
+ true: constants_1.dataGridRowContentClassnames.hovered,
29
+ },
30
+ },
31
+ });
15
32
  const RowComponent = (props) => {
16
- const { isOpen, isShowConnector, childrenColumns, rowId, handleToggle, checkboxProps, rowProps, tooltipProps, nestedChildrenProps, disabled, isRenderCollapseButton, rowRef, } = (0, useLogic_1.useLogic)(props);
17
- const { className, row, options, variant, isSelectable, gridColumns, isInitialExpanded, expandedLevel, level, nestedChildren, initialVisibleChildrenCount, moreButtonColumnPosition, isVisibleCollapseButton, columns, emptyCellValue, selectedRows, activeRowId, keyId, onSelectRow, onRowClick, sectionOffset, totalColumnsCount, registerRowElement, unregisterRowElement, onRowEnter, onRowLeave,
33
+ const { isOpen, isShowConnector, childrenColumns, rowId, handleToggle, checkboxProps, rowProps, isHovered, tooltipProps, nestedChildrenProps, disabled, isRenderCollapseButton, rowRef, rowStyles, drawerProps, disabledReasonText, } = (0, useLogic_1.useLogic)(props);
34
+ const { className, row, options, variant, isSelectable, gridColumns, isInitialExpanded, expandedLevel, level, nestedChildren, initialVisibleChildrenCount, moreButtonColumnPosition, isVisibleCollapseButton, columns, emptyCellValue, selectedRows, activeRowId, keyId, onSelectRow, onRowClick, sectionOffset, totalColumnsCount, registerRowElement, unregisterRowElement, onRowEnter, onRowLeave, style,
18
35
  // В этот rest-оператор попадают специфичные пропсы (атрибуты) virtuoso
19
36
  // Необходимы для DataGridInfinite
20
37
  ...selfProps } = props;
@@ -23,7 +40,7 @@ const RowComponent = (props) => {
23
40
  if (!isRenderCollapseButton && (!isSelectable || isNotSelectable)) {
24
41
  return null;
25
42
  }
26
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isRenderCollapseButton && ((0, jsx_runtime_1.jsx)(styles_1.CollapseCell, { children: (0, jsx_runtime_1.jsx)(styles_1.CollapseButton, { variant: "text", onClick: handleToggle, children: (0, jsx_runtime_1.jsx)(styles_1.ChevronIcon, { "$isActive": isOpen }) }) })), isSelectable && !isNotSelectable && ((0, jsx_runtime_1.jsx)(styles_1.CheckboxCell, { ...(0, getInertProps_1.getInertProps)(disabled), onClick: (event) => event.stopPropagation(), children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { ...checkboxProps }) }))] }));
43
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isRenderCollapseButton && ((0, jsx_runtime_1.jsx)(styles_1.CollapseCell, { children: (0, jsx_runtime_1.jsx)(styles_1.CollapseButton, { variant: "text", onClick: handleToggle, children: (0, jsx_runtime_1.jsx)(styles_1.ChevronIcon, { "$isActive": isOpen }) }) })), isSelectable && !isNotSelectable && ((0, jsx_runtime_1.jsx)(styles_1.CheckboxCell, { ...(0, getInertProps_1.getInertProps)(disabled), onClick: (event) => event.stopPropagation(), className: constants_1.dataGridRowClassnames.checkbox, children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { ...checkboxProps }) }))] }));
27
44
  };
28
45
  const renderCells = (0, react_1.useCallback)(() => {
29
46
  const lastCellGlobalIndex = (totalColumnsCount ?? columns.length) - 1;
@@ -35,7 +52,7 @@ const RowComponent = (props) => {
35
52
  const globalIndex = (sectionOffset ?? 0) + index;
36
53
  const isDisabledCell = (0, utils_1.checkIsDisabled)(disabled, availableCellsByIndex, globalIndex);
37
54
  const isFirstCell = globalIndex === 0;
38
- return ((0, jsx_runtime_1.jsx)(styles_1.CellStyled, { "$level": isFirstCell ? level : 0, row: row, cell: cell, emptyCellValue: emptyCellValue, startAdornment: isFirstCell && renderStartAdornment(), isDisabled: isDisabledCell, isHidePersonalData: cell.isHidePersonalData }, cellId));
55
+ return ((0, jsx_runtime_1.jsx)(styles_1.CellStyled, { row: row, cell: cell, emptyCellValue: emptyCellValue, startAdornment: isFirstCell && renderStartAdornment(), isDisabled: isDisabledCell, isHidePersonalData: cell.isHidePersonalData }, cellId));
39
56
  });
40
57
  }, [
41
58
  isOpen,
@@ -66,10 +83,10 @@ const RowComponent = (props) => {
66
83
  onRowEnter,
67
84
  onRowLeave,
68
85
  ]);
69
- return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { "$level": level, "$isShowConnector": isShowConnector, className: className, ...selfProps, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { followCursor: true, arrow: false, ...tooltipProps, children: (0, jsx_runtime_1.jsx)(styles_1.ContentWrapper, { "$level": level, "data-row-id": rowId, ref: rowRef, onPointerEnter: () => onRowEnter?.(rowId), onPointerLeave: (event) => onRowLeave?.(rowId, event.nativeEvent), "$isShowConnector": isShowConnector, "$gridColumns": gridColumns, [constants_1.DISABLE_ROW_ATTR]: disabled, ...rowProps, children: renderCells() }) }), (0, jsx_runtime_1.jsx)(NestedChildren_1.NestedChildren, { ...nestedChildrenProps, data: nestedChildren, keyId: keyId, level: level, variant: variant, gridColumns: gridColumns, initialVisibleChildrenCount: initialVisibleChildrenCount, moreButtonColumnPosition: moreButtonColumnPosition,
86
+ return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { className: (0, classNames_1.classNames)(className, rootCva({ isShowConnector })), style: rowStyles, ...selfProps, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { followCursor: true, arrow: false, ...tooltipProps, children: (0, jsx_runtime_1.jsx)(styles_1.ContentWrapper, { "data-row-id": rowId, ref: rowRef, onPointerEnter: () => onRowEnter?.(rowId), onPointerLeave: (event) => onRowLeave?.(rowId, event.nativeEvent), className: rowContentCva({ isHovered }), "$gridColumns": gridColumns, [constants_1.DISABLE_ROW_ATTR]: disabled, ...rowProps, children: renderCells() }) }), (0, jsx_runtime_1.jsx)(NestedChildren_1.NestedChildren, { ...nestedChildrenProps, data: nestedChildren, keyId: keyId, level: level, variant: variant, gridColumns: gridColumns, initialVisibleChildrenCount: initialVisibleChildrenCount, moreButtonColumnPosition: moreButtonColumnPosition,
70
87
  // biome-ignore lint/suspicious/noTsIgnore: <>
71
88
  // @ts-ignore
72
- renderRow: renderRow })] }));
89
+ renderRow: renderRow }), (0, jsx_runtime_1.jsx)(BottomDrawer_1.BottomDrawer, { ...drawerProps, children: (0, jsx_runtime_1.jsx)(styles_1.BottomDrawerContent, { children: disabledReasonText }) })] }));
73
90
  };
74
91
  const arePropsEqual = (prevProps, nextProps) => {
75
92
  const deepEqualityProps = new Set(['row']);
@@ -1,6 +1,14 @@
1
1
  export declare const DISABLE_ROW_ATTR = "data-row-disable";
2
+ export declare const MOBILE_DRAWER_TITLE = "\u041F\u0440\u0438\u0447\u0438\u043D\u0430 ";
2
3
  export declare const dataGridRowClassnames: {
4
+ root: string;
5
+ showConnector: string;
3
6
  hidden: string;
4
7
  hover: string;
5
8
  hasPinnedColumns: string;
9
+ checkbox: string;
10
+ };
11
+ export declare const dataGridRowContentClassnames: {
12
+ root: string;
13
+ hovered: string;
6
14
  };
@@ -1,10 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dataGridRowClassnames = exports.DISABLE_ROW_ATTR = void 0;
3
+ exports.dataGridRowContentClassnames = exports.dataGridRowClassnames = exports.MOBILE_DRAWER_TITLE = exports.DISABLE_ROW_ATTR = void 0;
4
4
  const createUIKitClassname_1 = require("../../utils/createUIKitClassname");
5
5
  exports.DISABLE_ROW_ATTR = 'data-row-disable';
6
+ exports.MOBILE_DRAWER_TITLE = 'Причина ';
6
7
  exports.dataGridRowClassnames = {
8
+ root: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__row'),
9
+ showConnector: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__row_show-connector'),
7
10
  hidden: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__row_hidden'),
8
11
  hover: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__row_hover'),
9
12
  hasPinnedColumns: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__row_has-pinned-columns'),
13
+ checkbox: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__row-checkbox'),
14
+ };
15
+ exports.dataGridRowContentClassnames = {
16
+ root: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__row-content'),
17
+ hovered: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__row-content_hovered'),
10
18
  };
@@ -2,24 +2,15 @@
2
2
  export declare const Wrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
3
3
  theme?: import("@emotion/react").Theme | undefined;
4
4
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
5
- } & {
6
- $isShowConnector: boolean;
7
- $level: number;
8
5
  }, import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, {}>;
9
6
  export declare const ContentWrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
10
7
  theme?: import("@emotion/react").Theme | undefined;
11
8
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
12
9
  } & {
13
- $isShowConnector: boolean;
14
- $isHovered?: boolean | undefined;
15
- $isSelected?: boolean | undefined;
16
10
  $gridColumns: string;
17
- $level: number;
18
11
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
19
12
  export declare const CellStyled: import("@emotion/styled/dist/declarations/src/types").StyledComponent<import("../Cell").CellProps<Record<string, unknown>> & {
20
13
  theme?: import("@emotion/react").Theme | undefined;
21
- } & {
22
- $level: number;
23
14
  }, {}, {}>;
24
15
  export declare const CheckboxCell: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
25
16
  theme?: import("@emotion/react").Theme | undefined;
@@ -48,3 +39,7 @@ export declare const ChevronIcon: import("@emotion/styled/dist/declarations/src/
48
39
  } & {
49
40
  $isActive?: boolean | undefined;
50
41
  }, {}, {}>;
42
+ export declare const BottomDrawerContent: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
43
+ theme?: import("@emotion/react").Theme | undefined;
44
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
45
+ }, 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.ChevronIcon = exports.CollapseButton = exports.CollapseCell = exports.CheckboxCell = exports.CellStyled = exports.ContentWrapper = exports.Wrapper = void 0;
3
+ exports.BottomDrawerContent = exports.ChevronIcon = exports.CollapseButton = exports.CollapseCell = exports.CheckboxCell = exports.CellStyled = exports.ContentWrapper = exports.Wrapper = void 0;
4
4
  const ChevronROutlineMd_1 = require("../../../icons/ChevronROutlineMd");
5
5
  const IconButton_1 = require("../../IconButton");
6
6
  const styled_1 = require("../../styled");
@@ -8,6 +8,7 @@ const Cell_1 = require("../Cell");
8
8
  const constants_1 = require("../constants");
9
9
  const constants_2 = require("./constants");
10
10
  exports.Wrapper = styled_1.styled.li `
11
+ --level: 0;
11
12
  position: relative;
12
13
 
13
14
  &:not(:last-of-type)::before,
@@ -17,14 +18,35 @@ exports.Wrapper = styled_1.styled.li `
17
18
  position: absolute;
18
19
  z-index: 1;
19
20
  top: 0;
20
- transform: ${({ $level }) => `translateX(calc(${constants_1.ROOT_ACTION_CELL_WIDTH}px * ${$level} - ${constants_1.TREE_LINE_WIDTH}px))`};
21
+ transform: translateX(calc(${constants_1.ROOT_ACTION_CELL_WIDTH}px * var(--level) - ${constants_1.TREE_LINE_WIDTH}px));
21
22
 
22
- display: ${({ $isShowConnector }) => ($isShowConnector ? 'block' : 'none')};
23
+ display: none;
23
24
 
24
25
  width: 0;
25
26
  height: 100%;
26
27
 
27
- border-left: 1px solid ${({ theme }) => theme.palette.grey[400]};
28
+ border-left: 1px solid ${({ theme }) => theme.palette.components.border.default};
29
+ }
30
+
31
+ ${({ theme }) => theme.breakpoints.up('sm')} {
32
+ &.${constants_2.dataGridRowClassnames.showConnector}::before,
33
+ & .${constants_2.dataGridRowContentClassnames.root}::before {
34
+ display: block;
35
+ }
36
+ }
37
+
38
+ ${({ theme }) => theme.breakpoints.down('sm')} {
39
+ padding-bottom: ${({ theme }) => theme.spacing(3)};
40
+
41
+ border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
42
+
43
+ &:not(:first-of-type) {
44
+ padding-top: ${({ theme }) => theme.spacing(5)};
45
+ }
46
+
47
+ &:first-of-type {
48
+ padding-top: ${({ theme }) => theme.spacing(1)};
49
+ }
28
50
  }
29
51
  `;
30
52
  exports.ContentWrapper = styled_1.styled.div `
@@ -33,42 +55,63 @@ exports.ContentWrapper = styled_1.styled.div `
33
55
  display: grid;
34
56
  grid-template-columns: ${({ $gridColumns }) => $gridColumns};
35
57
 
36
- background-color: ${({ theme, $isSelected }) => $isSelected ? theme.palette.primary[100] : 'transparent'};
58
+ background-color: transparent;
37
59
 
38
60
  &::before {
39
61
  content: '';
40
62
 
41
63
  position: absolute;
42
64
  top: 0;
43
- transform: ${({ $level }) => `translateX(calc(${constants_1.ROOT_ACTION_CELL_WIDTH}px * ${$level} - ${constants_1.TREE_LINE_WIDTH}px))`};
44
-
45
- display: ${({ $isShowConnector }) => ($isShowConnector ? 'block' : 'none')};
65
+ transform: translateX(calc(${constants_1.ROOT_ACTION_CELL_WIDTH}px * var(--level) - ${constants_1.TREE_LINE_WIDTH}px));
46
66
 
47
67
  width: ${constants_1.TREE_LINE_WIDTH}px;
48
68
  height: 50%;
49
69
 
50
- border-bottom: 1px solid ${({ theme }) => theme.palette.grey[400]};
51
- border-left: 1px solid ${({ theme }) => theme.palette.grey[400]};
70
+ border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
71
+ border-left: 1px solid ${({ theme }) => theme.palette.components.border.default};
52
72
  border-radius: 0 0 0 ${({ theme }) => theme.shape.small};
73
+
74
+ ${({ theme }) => theme.breakpoints.down('sm')} {
75
+ display: none;
76
+ }
53
77
  }
54
78
 
55
79
  &:hover {
56
- cursor: ${({ $isHovered }) => ($isHovered ? 'pointer' : 'default')};
57
-
58
80
  background-color: ${({ theme }) => theme.palette.background.elementHover};
81
+ &.${constants_2.dataGridRowContentClassnames.hovered} {
82
+ cursor: pointer;
83
+ }
84
+
85
+ ${({ theme }) => theme.breakpoints.down('sm')} {
86
+ cursor: initial;
87
+
88
+ background-color: transparent;
89
+ }
59
90
  }
60
91
 
61
92
 
62
93
  &.${constants_2.dataGridRowClassnames.hover} {
63
- cursor: ${({ $isHovered }) => ($isHovered ? 'pointer' : 'default')};
94
+ background-color: ${({ theme }) => theme.palette.background.elementHover};
95
+ &.${constants_2.dataGridRowContentClassnames.hovered} {
96
+ cursor: pointer;
97
+ }
98
+
99
+ ${({ theme }) => theme.breakpoints.down('sm')} {
100
+ cursor: initial;
101
+
102
+ background-color: transparent;
103
+ }
104
+ }
64
105
 
65
- background-color: ${({ theme, $isSelected }) => $isSelected
66
- ? theme.palette.primary[100]
67
- : theme.palette.background.elementHover};
106
+ ${({ theme }) => theme.breakpoints.down('sm')} {
107
+ grid-template-columns: 1fr;
108
+ gap: ${({ theme }) => theme.spacing(3)};
68
109
  }
69
110
  `;
70
111
  exports.CellStyled = (0, styled_1.styled)(Cell_1.Cell) `
71
- margin-left: ${({ $level }) => `${$level * constants_1.ROOT_ACTION_CELL_WIDTH}px`};
112
+ &:first-of-type {
113
+ margin-left: calc(var(--level) * ${constants_1.ROOT_ACTION_CELL_WIDTH}px);
114
+ }
72
115
  `;
73
116
  exports.CheckboxCell = styled_1.styled.div `
74
117
  display: flex;
@@ -84,6 +127,10 @@ exports.CollapseCell = styled_1.styled.div `
84
127
  justify-content: center;
85
128
 
86
129
  width: ${constants_1.ROOT_ACTION_CELL_WIDTH}px;
130
+
131
+ ${({ theme }) => theme.breakpoints.down('sm')} {
132
+ display: none;
133
+ }
87
134
  `;
88
135
  exports.CollapseButton = (0, styled_1.styled)(IconButton_1.IconButton) `
89
136
  width: 24px;
@@ -105,3 +152,8 @@ exports.ChevronIcon = (0, styled_1.styled)(ChevronROutlineMd_1.ChevronROutlineMd
105
152
  duration: theme.transitions.duration.short,
106
153
  })};
107
154
  `;
155
+ exports.BottomDrawerContent = styled_1.styled.div `
156
+ ${({ theme }) => theme.breakpoints.down('sm')} {
157
+ padding: ${({ theme }) => theme.spacing(5, 4)};
158
+ }
159
+ `;
@@ -1,4 +1,4 @@
1
- import { type ChangeEvent, type ReactNode } from 'react';
1
+ import { type ChangeEvent, type CSSProperties, type ReactNode } from 'react';
2
2
  import { type Variant } from '../enums';
3
3
  import { type CellValue, type DataGridColumns, type DataGridRowOptions } from '../types';
4
4
  export type RowProps<TData extends Record<string, CellValue>> = {
@@ -115,4 +115,8 @@ export type RowProps<TData extends Record<string, CellValue>> = {
115
115
  * Обработчик выхода из строки
116
116
  */
117
117
  onRowLeave?: (rowId: string, event: PointerEvent) => void;
118
+ /**
119
+ * Стили для строки
120
+ */
121
+ style?: CSSProperties;
118
122
  };
@@ -0,0 +1 @@
1
+ export * from './useMobileLogic';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./useMobileLogic"), exports);
@@ -0,0 +1,5 @@
1
+ export declare const useMobileLogic: () => {
2
+ isDrawerOpen: boolean;
3
+ handleOpenDrawer: () => void;
4
+ handleCloseDrawer: () => void;
5
+ };
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useMobileLogic = void 0;
4
+ const react_1 = require("react");
5
+ const useViewportType_1 = require("../../../../useViewportType");
6
+ const useMobileLogic = () => {
7
+ const { isMobile } = (0, useViewportType_1.useViewportType)();
8
+ const [isDrawerOpen, setIsDrawerOpen] = (0, react_1.useState)(false);
9
+ const handleOpenDrawer = () => {
10
+ if (isMobile) {
11
+ setIsDrawerOpen(true);
12
+ }
13
+ };
14
+ const handleCloseDrawer = () => {
15
+ setIsDrawerOpen(false);
16
+ };
17
+ return { isDrawerOpen, handleOpenDrawer, handleCloseDrawer };
18
+ };
19
+ exports.useMobileLogic = useMobileLogic;