@astral/ui 4.56.0 → 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 (174) hide show
  1. package/components/ContentState/ContentState.d.ts +1 -1
  2. package/components/ContentState/ContentState.js +2 -2
  3. package/components/ContentState/types.d.ts +4 -0
  4. package/components/DataGrid/Body/Body.d.ts +1 -1
  5. package/components/DataGrid/Body/Body.js +14 -7
  6. package/components/DataGrid/Body/constants.d.ts +4 -0
  7. package/components/DataGrid/Body/constants.js +5 -0
  8. package/components/DataGrid/Body/styles.d.ts +0 -3
  9. package/components/DataGrid/Body/styles.js +14 -1
  10. package/components/DataGrid/Body/useLogic/index.d.ts +1 -0
  11. package/components/DataGrid/Body/useLogic/index.js +1 -0
  12. package/components/DataGrid/Body/useLogic/useLogic.d.ts +9 -0
  13. package/components/DataGrid/Body/useLogic/useLogic.js +15 -0
  14. package/components/DataGrid/Cell/Cell.js +20 -4
  15. package/components/DataGrid/Cell/constants.d.ts +7 -0
  16. package/components/DataGrid/Cell/constants.js +8 -0
  17. package/components/DataGrid/Cell/styles.d.ts +14 -0
  18. package/components/DataGrid/Cell/styles.js +47 -0
  19. package/components/DataGrid/Cell/useLogic/useLogic.d.ts +2 -0
  20. package/components/DataGrid/Cell/useLogic/useLogic.js +3 -2
  21. package/components/DataGrid/DataGrid.js +42 -8
  22. package/components/DataGrid/Head/Head.js +1 -1
  23. package/components/DataGrid/Head/styles.js +4 -0
  24. package/components/DataGrid/Loader/styles.js +4 -0
  25. package/components/DataGrid/MobileSkeleton/MobileSkeleton.d.ts +6 -0
  26. package/components/DataGrid/MobileSkeleton/MobileSkeleton.js +10 -0
  27. package/components/DataGrid/MobileSkeleton/index.d.ts +1 -0
  28. package/components/DataGrid/MobileSkeleton/index.js +1 -0
  29. package/components/DataGrid/MobileSkeleton/styles.d.ts +17 -0
  30. package/components/DataGrid/MobileSkeleton/styles.js +37 -0
  31. package/components/DataGrid/Row/NestedChildren/styles.js +5 -0
  32. package/components/DataGrid/Row/Row.js +25 -8
  33. package/components/DataGrid/Row/constants.d.ts +8 -0
  34. package/components/DataGrid/Row/constants.js +8 -0
  35. package/components/DataGrid/Row/styles.d.ts +4 -9
  36. package/components/DataGrid/Row/styles.js +66 -14
  37. package/components/DataGrid/Row/types.d.ts +5 -1
  38. package/components/DataGrid/Row/useLogic/hooks/index.d.ts +1 -0
  39. package/components/DataGrid/Row/useLogic/hooks/index.js +1 -0
  40. package/components/DataGrid/Row/useLogic/hooks/useMobileLogic.d.ts +5 -0
  41. package/components/DataGrid/Row/useLogic/hooks/useMobileLogic.js +15 -0
  42. package/components/DataGrid/Row/useLogic/useLogic.d.ts +868 -3
  43. package/components/DataGrid/Row/useLogic/useLogic.js +28 -13
  44. package/components/DataGrid/constants.d.ts +4 -0
  45. package/components/DataGrid/constants.js +4 -0
  46. package/components/DataGrid/index.d.ts +1 -0
  47. package/components/DataGrid/index.js +1 -0
  48. package/components/DataGrid/styles.d.ts +0 -9
  49. package/components/DataGrid/styles.js +43 -12
  50. package/components/DataGrid/types.d.ts +7 -0
  51. package/components/DataGrid/useLogic/hooks/index.d.ts +1 -1
  52. package/components/DataGrid/useLogic/hooks/index.js +1 -1
  53. package/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/index.d.ts +1 -0
  54. package/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/index.js +1 -0
  55. package/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.d.ts +16 -0
  56. package/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.js +32 -0
  57. package/components/DataGrid/useLogic/hooks/usePinnedColumns/usePinnedColumns.js +11 -3
  58. package/components/DataGrid/useLogic/useLogic.d.ts +10 -4
  59. package/components/DataGrid/useLogic/useLogic.js +17 -12
  60. package/components/DataGrid/useLogic/utils/getIsAllowHorizontalScroll/getIsAllowHorizontalScroll.js +1 -1
  61. package/components/DataGrid/utils/getDataGridCssVars/getDataGridCssVars.d.ts +2 -0
  62. package/components/DataGrid/utils/getDataGridCssVars/getDataGridCssVars.js +5 -0
  63. package/components/DataGrid/utils/getDataGridCssVars/index.d.ts +1 -0
  64. package/components/DataGrid/utils/getDataGridCssVars/index.js +1 -0
  65. package/components/DataGrid/utils/index.d.ts +1 -0
  66. package/components/DataGrid/utils/index.js +1 -0
  67. package/components/DataGridActionCell/DataGridSecondaryActions/DataGridSecondaryActions.js +1 -1
  68. package/components/DataGridInfinite/DataGridInfinite.js +5 -4
  69. package/components/DataGridInfinite/useLogic/useLogic.d.ts +7 -1
  70. package/components/DataGridInfinite/useLogic/useLogic.js +12 -2
  71. package/components/DescriptionCell/styles.js +12 -3
  72. package/components/NewStepper/index.d.ts +1 -0
  73. package/components/NewStepper/index.js +1 -0
  74. package/components/NewStepper/public.d.ts +1 -0
  75. package/components/NewStepper/public.js +1 -0
  76. package/components/PageLayoutSection/PageLayoutSection.d.ts +4 -0
  77. package/components/PageLayoutSection/PageLayoutSection.js +13 -4
  78. package/components/PageLayoutSection/constants.d.ts +5 -0
  79. package/components/PageLayoutSection/constants.js +6 -0
  80. package/components/PageLayoutSection/styles.d.ts +1 -1
  81. package/components/PageLayoutSection/styles.js +6 -1
  82. package/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.d.ts +5 -1
  83. package/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.js +5 -4
  84. package/node/components/ContentState/ContentState.d.ts +1 -1
  85. package/node/components/ContentState/ContentState.js +2 -2
  86. package/node/components/ContentState/types.d.ts +4 -0
  87. package/node/components/DataGrid/Body/Body.d.ts +1 -1
  88. package/node/components/DataGrid/Body/Body.js +14 -7
  89. package/node/components/DataGrid/Body/constants.d.ts +4 -0
  90. package/node/components/DataGrid/Body/constants.js +8 -0
  91. package/node/components/DataGrid/Body/styles.d.ts +0 -3
  92. package/node/components/DataGrid/Body/styles.js +14 -1
  93. package/node/components/DataGrid/Body/useLogic/index.d.ts +1 -0
  94. package/node/components/DataGrid/{useLogic/hooks/useClassnames → Body/useLogic}/index.js +1 -1
  95. package/node/components/DataGrid/Body/useLogic/useLogic.d.ts +9 -0
  96. package/node/components/DataGrid/Body/useLogic/useLogic.js +19 -0
  97. package/node/components/DataGrid/Cell/Cell.js +18 -2
  98. package/node/components/DataGrid/Cell/constants.d.ts +7 -0
  99. package/node/components/DataGrid/Cell/constants.js +11 -0
  100. package/node/components/DataGrid/Cell/styles.d.ts +14 -0
  101. package/node/components/DataGrid/Cell/styles.js +48 -1
  102. package/node/components/DataGrid/Cell/useLogic/useLogic.d.ts +2 -0
  103. package/node/components/DataGrid/Cell/useLogic/useLogic.js +3 -2
  104. package/node/components/DataGrid/DataGrid.js +41 -7
  105. package/node/components/DataGrid/Head/Head.js +1 -1
  106. package/node/components/DataGrid/Head/styles.js +4 -0
  107. package/node/components/DataGrid/Loader/styles.js +4 -0
  108. package/node/components/DataGrid/MobileSkeleton/MobileSkeleton.d.ts +6 -0
  109. package/node/components/DataGrid/MobileSkeleton/MobileSkeleton.js +14 -0
  110. package/node/components/DataGrid/MobileSkeleton/index.d.ts +1 -0
  111. package/node/components/DataGrid/MobileSkeleton/index.js +17 -0
  112. package/node/components/DataGrid/MobileSkeleton/styles.d.ts +17 -0
  113. package/node/components/DataGrid/MobileSkeleton/styles.js +40 -0
  114. package/node/components/DataGrid/Row/NestedChildren/styles.js +5 -0
  115. package/node/components/DataGrid/Row/Row.js +23 -6
  116. package/node/components/DataGrid/Row/constants.d.ts +8 -0
  117. package/node/components/DataGrid/Row/constants.js +9 -1
  118. package/node/components/DataGrid/Row/styles.d.ts +4 -9
  119. package/node/components/DataGrid/Row/styles.js +66 -14
  120. package/node/components/DataGrid/Row/types.d.ts +5 -1
  121. package/node/components/DataGrid/Row/useLogic/hooks/index.d.ts +1 -0
  122. package/node/components/DataGrid/Row/useLogic/hooks/index.js +17 -0
  123. package/node/components/DataGrid/Row/useLogic/hooks/useMobileLogic.d.ts +5 -0
  124. package/node/components/DataGrid/Row/useLogic/hooks/useMobileLogic.js +19 -0
  125. package/node/components/DataGrid/Row/useLogic/useLogic.d.ts +868 -3
  126. package/node/components/DataGrid/Row/useLogic/useLogic.js +28 -13
  127. package/node/components/DataGrid/constants.d.ts +4 -0
  128. package/node/components/DataGrid/constants.js +5 -1
  129. package/node/components/DataGrid/index.d.ts +1 -0
  130. package/node/components/DataGrid/index.js +3 -1
  131. package/node/components/DataGrid/styles.d.ts +0 -9
  132. package/node/components/DataGrid/styles.js +43 -12
  133. package/node/components/DataGrid/types.d.ts +7 -0
  134. package/node/components/DataGrid/useLogic/hooks/index.d.ts +1 -1
  135. package/node/components/DataGrid/useLogic/hooks/index.js +1 -1
  136. package/node/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/index.d.ts +1 -0
  137. package/node/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/index.js +17 -0
  138. package/node/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.d.ts +16 -0
  139. package/node/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.js +36 -0
  140. package/node/components/DataGrid/useLogic/hooks/usePinnedColumns/usePinnedColumns.js +11 -3
  141. package/node/components/DataGrid/useLogic/useLogic.d.ts +10 -4
  142. package/node/components/DataGrid/useLogic/useLogic.js +19 -14
  143. package/node/components/DataGrid/useLogic/utils/getIsAllowHorizontalScroll/getIsAllowHorizontalScroll.js +1 -1
  144. package/node/components/DataGrid/utils/getDataGridCssVars/getDataGridCssVars.d.ts +2 -0
  145. package/node/components/DataGrid/utils/getDataGridCssVars/getDataGridCssVars.js +9 -0
  146. package/node/components/DataGrid/utils/getDataGridCssVars/index.d.ts +1 -0
  147. package/node/components/DataGrid/utils/getDataGridCssVars/index.js +5 -0
  148. package/node/components/DataGrid/utils/index.d.ts +1 -0
  149. package/node/components/DataGrid/utils/index.js +3 -1
  150. package/node/components/DataGridActionCell/DataGridSecondaryActions/DataGridSecondaryActions.js +1 -1
  151. package/node/components/DataGridInfinite/DataGridInfinite.js +5 -4
  152. package/node/components/DataGridInfinite/useLogic/useLogic.d.ts +7 -1
  153. package/node/components/DataGridInfinite/useLogic/useLogic.js +11 -1
  154. package/node/components/DescriptionCell/styles.js +15 -6
  155. package/node/components/NewStepper/index.d.ts +1 -0
  156. package/node/components/NewStepper/index.js +3 -1
  157. package/node/components/NewStepper/public.d.ts +1 -0
  158. package/node/components/NewStepper/public.js +3 -1
  159. package/node/components/PageLayoutSection/PageLayoutSection.d.ts +4 -0
  160. package/node/components/PageLayoutSection/PageLayoutSection.js +12 -3
  161. package/node/components/PageLayoutSection/constants.d.ts +5 -0
  162. package/node/components/PageLayoutSection/constants.js +9 -0
  163. package/node/components/PageLayoutSection/styles.d.ts +1 -1
  164. package/node/components/PageLayoutSection/styles.js +7 -2
  165. package/node/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.d.ts +5 -1
  166. package/node/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.js +5 -4
  167. package/package.json +1 -1
  168. package/components/DataGrid/useLogic/hooks/useClassnames/index.d.ts +0 -1
  169. package/components/DataGrid/useLogic/hooks/useClassnames/index.js +0 -1
  170. package/components/DataGrid/useLogic/hooks/useClassnames/useClassnames.d.ts +0 -12
  171. package/components/DataGrid/useLogic/hooks/useClassnames/useClassnames.js +0 -14
  172. package/node/components/DataGrid/useLogic/hooks/useClassnames/index.d.ts +0 -1
  173. package/node/components/DataGrid/useLogic/hooks/useClassnames/useClassnames.d.ts +0 -12
  174. package/node/components/DataGrid/useLogic/hooks/useClassnames/useClassnames.js +0 -18
@@ -13,6 +13,10 @@ exports.Wrapper = (0, styled_1.styled)('header', {
13
13
  min-width: 100%;
14
14
 
15
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
+ `;
@@ -29,6 +29,11 @@ exports.NestedRows = (0, styled_1.styled)('ul', {
29
29
 
30
30
  border-left: 1px solid ${({ theme }) => theme.palette.components.border.default};
31
31
  }
32
+
33
+ /* TODO: Убрать после реализации задачи по адаптации вложенных строк https://track.astral.ru/soft/browse/UIKIT-2188 */
34
+ ${({ theme }) => theme.breakpoints.down('sm')} {
35
+ display: none;
36
+ }
32
37
  `;
33
38
  exports.MoreButtonRow = (0, styled_1.styled)('li', {
34
39
  shouldForwardProp: (prop) => !['$level', '$isShowConnector', '$gridColumns'].includes(prop),
@@ -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,15 +18,36 @@ 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
28
  border-left: 1px solid ${({ theme }) => theme.palette.components.border.default};
28
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
+ }
50
+ }
29
51
  `;
30
52
  exports.ContentWrapper = styled_1.styled.div `
31
53
  position: relative;
@@ -33,16 +55,14 @@ 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%;
@@ -50,25 +70,48 @@ exports.ContentWrapper = styled_1.styled.div `
50
70
  border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
51
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;