@astral/ui 4.76.3 → 4.77.1

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 (67) hide show
  1. package/components/Avatar/styles.js +5 -1
  2. package/components/DataGrid/Cell/Cell.d.ts +1 -41
  3. package/components/DataGrid/Cell/Cell.js +7 -26
  4. package/components/DataGrid/Cell/CellInner/CellInner.d.ts +2 -0
  5. package/components/DataGrid/Cell/CellInner/CellInner.js +31 -0
  6. package/components/DataGrid/Cell/CellInner/index.d.ts +2 -0
  7. package/components/DataGrid/Cell/CellInner/index.js +1 -0
  8. package/components/DataGrid/Cell/CellInner/styles.d.ts +20 -0
  9. package/components/DataGrid/Cell/CellInner/styles.js +49 -0
  10. package/components/DataGrid/Cell/CellInner/types.d.ts +48 -0
  11. package/components/DataGrid/Cell/CellInner/types.js +1 -0
  12. package/components/DataGrid/Cell/constants.d.ts +1 -0
  13. package/components/DataGrid/Cell/constants.js +1 -0
  14. package/components/DataGrid/Cell/index.d.ts +1 -0
  15. package/components/DataGrid/Cell/styles.d.ts +0 -15
  16. package/components/DataGrid/Cell/styles.js +0 -32
  17. package/components/DataGrid/Cell/types.d.ts +49 -0
  18. package/components/DataGrid/Cell/types.js +1 -0
  19. package/components/DataGrid/Cell/useLogic/useLogic.d.ts +3 -2
  20. package/components/DataGrid/Cell/useLogic/useLogic.js +8 -1
  21. package/components/DataGrid/Row/Row.js +3 -3
  22. package/components/DataGrid/Row/useLogic/useLogic.d.ts +1 -1
  23. package/components/DataGrid/Row/useLogic/useLogic.js +1 -5
  24. package/components/DataGrid/RowBase/GroupCell/GroupCell.d.ts +1 -1
  25. package/components/DataGrid/RowBase/GroupCell/GroupCell.js +2 -2
  26. package/components/DataGrid/RowBase/GroupCell/types.d.ts +3 -1
  27. package/components/DataGrid/RowBase/RowBase.js +3 -3
  28. package/components/DataGrid/RowBase/useLogic/useLogic.d.ts +2 -0
  29. package/components/DataGrid/RowBase/useLogic/useLogic.js +2 -0
  30. package/components/DataGrid/types.d.ts +2 -3
  31. package/components/DataGridCollapsibleRow/useLogic/useLogic.js +1 -0
  32. package/components/utils/redirectToLink/redirectToLink.d.ts +2 -2
  33. package/hook-form/FormPageLayoutBase/styles.js +6 -2
  34. package/node/components/Avatar/styles.js +27 -3
  35. package/node/components/DataGrid/Cell/Cell.d.ts +1 -41
  36. package/node/components/DataGrid/Cell/Cell.js +5 -24
  37. package/node/components/DataGrid/Cell/CellInner/CellInner.d.ts +2 -0
  38. package/node/components/DataGrid/Cell/CellInner/CellInner.js +35 -0
  39. package/node/components/DataGrid/Cell/CellInner/index.d.ts +2 -0
  40. package/node/components/DataGrid/Cell/CellInner/index.js +5 -0
  41. package/node/components/DataGrid/Cell/CellInner/styles.d.ts +20 -0
  42. package/node/components/DataGrid/Cell/CellInner/styles.js +52 -0
  43. package/node/components/DataGrid/Cell/CellInner/types.d.ts +48 -0
  44. package/node/components/DataGrid/Cell/CellInner/types.js +2 -0
  45. package/node/components/DataGrid/Cell/constants.d.ts +1 -0
  46. package/node/components/DataGrid/Cell/constants.js +1 -0
  47. package/node/components/DataGrid/Cell/index.d.ts +1 -0
  48. package/node/components/DataGrid/Cell/styles.d.ts +0 -15
  49. package/node/components/DataGrid/Cell/styles.js +1 -33
  50. package/node/components/DataGrid/Cell/types.d.ts +49 -0
  51. package/node/components/DataGrid/Cell/types.js +2 -0
  52. package/node/components/DataGrid/Cell/useLogic/useLogic.d.ts +3 -2
  53. package/node/components/DataGrid/Cell/useLogic/useLogic.js +8 -1
  54. package/node/components/DataGrid/Row/Row.js +3 -3
  55. package/node/components/DataGrid/Row/useLogic/useLogic.d.ts +1 -1
  56. package/node/components/DataGrid/Row/useLogic/useLogic.js +1 -5
  57. package/node/components/DataGrid/RowBase/GroupCell/GroupCell.d.ts +1 -1
  58. package/node/components/DataGrid/RowBase/GroupCell/GroupCell.js +2 -2
  59. package/node/components/DataGrid/RowBase/GroupCell/types.d.ts +3 -1
  60. package/node/components/DataGrid/RowBase/RowBase.js +3 -3
  61. package/node/components/DataGrid/RowBase/useLogic/useLogic.d.ts +2 -0
  62. package/node/components/DataGrid/RowBase/useLogic/useLogic.js +2 -0
  63. package/node/components/DataGrid/types.d.ts +2 -3
  64. package/node/components/DataGridCollapsibleRow/useLogic/useLogic.js +1 -0
  65. package/node/components/utils/redirectToLink/redirectToLink.d.ts +2 -2
  66. package/node/hook-form/FormPageLayoutBase/styles.js +6 -2
  67. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- export type Target = '_blank' | '_self' | '_parent' | '_top';
1
+ import { type HTMLAttributeAnchorTarget } from 'react';
2
2
  /**
3
3
  * Программно выполняет переход по ссылке, эмулируя клик по элементу <a>.
4
4
  * Можно указать цель перехода (target), например, открыть в новой вкладке.
@@ -10,4 +10,4 @@ export type Target = '_blank' | '_self' | '_parent' | '_top';
10
10
  * - `_parent` — в родительском фрейме,
11
11
  * - `_top` — в верхнем уровне окна.
12
12
  */
13
- export declare const redirectToLink: (href: string, target?: Target) => void;
13
+ export declare const redirectToLink: (href: string, target?: HTMLAttributeAnchorTarget) => void;
@@ -25,12 +25,16 @@ export const StyledPageContent = styled(PageContent) `
25
25
 
26
26
  border-top: 1px solid ${({ theme }) => theme.palette.grey[300]};
27
27
 
28
- .${pageContentClassnames.content} {
29
- ${({ theme }) => theme.breakpoints.up('sm')} {
28
+ ${({ theme }) => theme.breakpoints.up('sm')} {
29
+ .${pageContentClassnames.content} {
30
30
  overflow: unset;
31
31
 
32
32
  height: auto;
33
33
  padding: 0;
34
+
35
+ &.${pageContentClassnames.contentHasHeader}, &.${pageContentClassnames.hasAside} {
36
+ padding: 0;
37
+ }
34
38
  }
35
39
  }
36
40
 
@@ -1,10 +1,30 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
4
24
  };
5
25
  Object.defineProperty(exports, "__esModule", { value: true });
6
26
  exports.StyledAvatar = void 0;
7
- const Avatar_1 = __importDefault(require("@mui/material/Avatar"));
27
+ const Avatar_1 = __importStar(require("@mui/material/Avatar"));
8
28
  const styled_1 = require("../styled/styled");
9
29
  const getFont = (size) => {
10
30
  if (size === 'sm') {
@@ -20,4 +40,8 @@ exports.StyledAvatar = (0, styled_1.styled)(Avatar_1.default, {
20
40
  }) `
21
41
  font-size: ${({ theme, $size }) => theme.typography[getFont($size)].fontSize};
22
42
  font-weight: ${({ theme, $size }) => theme.typography[getFont($size)].fontWeight};
43
+
44
+ & .${Avatar_1.avatarClasses.img} {
45
+ background-color: ${({ theme }) => theme.palette.grey[200]};
46
+ }
23
47
  `;
@@ -1,42 +1,2 @@
1
- import { type ReactNode } from 'react';
2
- import type { CellValue, DataGridSingleColumn } from '../types';
3
- export type CellProps<TData extends Record<string, CellValue>> = {
4
- /**
5
- * Название класса, применяется к корневому компоненту
6
- */
7
- className?: string;
8
- /**
9
- * Данные строки для отображения
10
- */
11
- row: TData;
12
- cell: DataGridSingleColumn<TData>;
13
- /**
14
- * Дополнительное содержимое ячейки, которое будет распложено справа
15
- */
16
- startAdornment?: ReactNode;
17
- /**
18
- * Заглушка для пустых ячеек (если отсутствует field и filter и renderCell)
19
- */
20
- emptyCellValue?: ReactNode;
21
- /**
22
- * Если true, ячейка будет недоступна для взаимодействия
23
- */
24
- isDisabled?: boolean;
25
- /**
26
- * Скрытие персональных данных от инструментов мониторинга
27
- */
28
- isHidePersonalData?: boolean;
29
- /**
30
- * Скрытие ячейки на мобильных устройствах
31
- */
32
- isHideOnMobile?: boolean;
33
- /**
34
- * Флаг наличия вложенных элементов в строке
35
- */
36
- hasNestedChildren?: boolean;
37
- /**
38
- * Ссылка на корневой элемент строки
39
- */
40
- rootRowElement?: HTMLLIElement | null;
41
- };
1
+ import type { CellProps } from './types';
42
2
  export declare const Cell: <TData extends Record<string, unknown>>(props: CellProps<TData>) => import("react/jsx-runtime").JSX.Element | null;
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Cell = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_dom_1 = require("react-dom");
6
- const OverflowTypography_1 = require("../../OverflowTypography");
7
6
  const personalDataSecurity_1 = require("../../personalDataSecurity");
8
7
  const useViewportType_1 = require("../../useViewportType");
9
8
  const classNames_1 = require("../../utils/classNames");
10
9
  const cva_1 = require("../../utils/cva");
11
10
  const getInertProps_1 = require("../../utils/getInertProps");
11
+ const CellInner_1 = require("./CellInner");
12
12
  const constants_1 = require("./constants");
13
13
  const styles_1 = require("./styles");
14
14
  const useLogic_1 = require("./useLogic");
@@ -33,40 +33,21 @@ const cellCva = (0, cva_1.cva)(constants_1.dataGridCellClassnames.root, {
33
33
  },
34
34
  },
35
35
  });
36
- const cellContentCva = (0, cva_1.cva)(constants_1.dataGridCellClassnames.cellContent, {
37
- variants: {
38
- isActionColumn: {
39
- true: constants_1.dataGridCellClassnames.actionColumn,
40
- },
41
- isTabularNums: {
42
- true: constants_1.dataGridCellClassnames.tabularNums,
43
- },
44
- },
45
- });
46
- const columnLabelCva = (0, cva_1.cva)(constants_1.dataGridCellClassnames.columnLabel, {
47
- variants: {
48
- hidden: {
49
- true: constants_1.dataGridCellClassnames.columnLabelHidden,
50
- },
51
- },
52
- });
53
36
  const Cell = (props) => {
54
- const { formattedValue, hasStartAdornment, isActionColumn, label, hideTitleOnMobile, isTabularNums, } = (0, useLogic_1.useLogic)(props);
55
- const { className, startAdornment, row, cell, isDisabled, isHidePersonalData, isHideOnMobile, hasNestedChildren, rootRowElement, } = props;
37
+ const { formattedValue, hasStartAdornment, isActionColumn, label, hideTitleOnMobile, isTabularNums, onCellClick, } = (0, useLogic_1.useLogic)(props);
38
+ const { className, startAdornment, row, cell, isDisabled, isHidePersonalData, isHideOnMobile, hasNestedChildren, rootRowElement, href, target, } = props;
56
39
  const { renderCell, align = 'left' } = cell;
57
40
  const { isMobile } = (0, useViewportType_1.useViewportType)();
58
41
  const hidePersonalDataClassname = (0, personalDataSecurity_1.useHidePersonalData)({
59
42
  isEnabled: isHidePersonalData === true,
60
43
  });
61
- const cellNode = ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { className: (0, classNames_1.classNames)(className, hidePersonalDataClassname, cellCva({
44
+ const cellNode = ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { className: (0, classNames_1.classNames)(className, hidePersonalDataClassname, cellCva({
62
45
  isHideOnMobile: cell.isHideOnMobile || isHideOnMobile,
63
46
  isDisabled,
64
47
  withStartAdornment: hasStartAdornment,
65
48
  align,
66
49
  isActionColumn,
67
- })), ...(0, getInertProps_1.getInertProps)(isDisabled), children: [startAdornment && startAdornment, (0, jsx_runtime_1.jsxs)(styles_1.CellContent, { className: cellContentCva({ isActionColumn, isTabularNums }), children: [(0, jsx_runtime_1.jsx)(styles_1.ColumnLabel, { variant: "caption", color: "textSecondary", className: columnLabelCva({
68
- hidden: hideTitleOnMobile || isActionColumn,
69
- }), children: label }), renderCell?.(row), !renderCell && ((0, jsx_runtime_1.jsx)(OverflowTypography_1.OverflowTypography, { rowsCount: 2, tooltipProps: { className: hidePersonalDataClassname }, children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: formattedValue }) }))] })] }));
50
+ })), ...(0, getInertProps_1.getInertProps)(isDisabled), onClick: onCellClick, children: (0, jsx_runtime_1.jsx)(CellInner_1.CellInner, { row: row, label: label, hideTitleOnMobile: hideTitleOnMobile, isActionColumn: isActionColumn, isTabularNums: isTabularNums, startAdornment: startAdornment, renderCell: renderCell, formattedValue: formattedValue, hidePersonalDataClassname: hidePersonalDataClassname, href: href, target: target }) }));
70
51
  if (isActionColumn && isMobile && hasNestedChildren) {
71
52
  if (!rootRowElement) {
72
53
  return null;
@@ -0,0 +1,2 @@
1
+ import { type CellInnerProps } from './types';
2
+ export declare const CellInner: ({ row, label, hideTitleOnMobile, isActionColumn, isTabularNums, startAdornment, renderCell, formattedValue, hidePersonalDataClassname, href, target, }: CellInnerProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CellInner = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const OverflowTypography_1 = require("../../../OverflowTypography");
6
+ const cva_1 = require("../../../utils/cva");
7
+ const constants_1 = require("../constants");
8
+ const styles_1 = require("./styles");
9
+ const cellContentCva = (0, cva_1.cva)(constants_1.dataGridCellClassnames.cellContent, {
10
+ variants: {
11
+ isActionColumn: {
12
+ true: constants_1.dataGridCellClassnames.actionColumn,
13
+ },
14
+ isTabularNums: {
15
+ true: constants_1.dataGridCellClassnames.tabularNums,
16
+ },
17
+ },
18
+ });
19
+ const columnLabelCva = (0, cva_1.cva)(constants_1.dataGridCellClassnames.columnLabel, {
20
+ variants: {
21
+ hidden: {
22
+ true: constants_1.dataGridCellClassnames.columnLabelHidden,
23
+ },
24
+ },
25
+ });
26
+ const CellInner = ({ row, label, hideTitleOnMobile, isActionColumn, isTabularNums, startAdornment, renderCell, formattedValue, hidePersonalDataClassname, href, target, }) => {
27
+ const content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [startAdornment, (0, jsx_runtime_1.jsxs)(styles_1.CellContent, { className: cellContentCva({ isActionColumn, isTabularNums }), children: [(0, jsx_runtime_1.jsx)(styles_1.ColumnLabel, { variant: "caption", color: "textSecondary", className: columnLabelCva({
28
+ hidden: hideTitleOnMobile || isActionColumn,
29
+ }), children: label }), renderCell?.(row), !renderCell && ((0, jsx_runtime_1.jsx)(OverflowTypography_1.OverflowTypography, { rowsCount: 2, tooltipProps: { className: hidePersonalDataClassname }, children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: formattedValue }) }))] })] }));
30
+ if (href && !isActionColumn) {
31
+ return ((0, jsx_runtime_1.jsx)(styles_1.Anchor, { href: href, target: target, rel: "noopener noreferrer", children: content }));
32
+ }
33
+ return content;
34
+ };
35
+ exports.CellInner = CellInner;
@@ -0,0 +1,2 @@
1
+ export { CellInner } from './CellInner';
2
+ export type { CellInnerProps } from './types';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CellInner = void 0;
4
+ var CellInner_1 = require("./CellInner");
5
+ Object.defineProperty(exports, "CellInner", { enumerable: true, get: function () { return CellInner_1.CellInner; } });
@@ -0,0 +1,20 @@
1
+ /// <reference types="react" />
2
+ export declare const ColumnLabel: import("@emotion/styled/dist/declarations/src/types").StyledComponent<import("../../../Typography/types").TypographyPropsBase & {
3
+ color?: import("../../../Typography").TypographyColor | undefined;
4
+ variant?: import("../../../Typography").TypographyVariant | undefined;
5
+ colorIntensity?: import("../../../Typography").Intensity | undefined;
6
+ component?: import("../../../Typography/types").ComponentProp | undefined;
7
+ isUpperCase?: boolean | undefined;
8
+ withoutCalt?: boolean | undefined;
9
+ isTabularNums?: boolean | undefined;
10
+ } & import("react").HTMLAttributes<HTMLParagraphElement> & import("react").RefAttributes<HTMLSpanElement> & {
11
+ theme?: import("@emotion/react").Theme | undefined;
12
+ }, {}, {}>;
13
+ export declare const CellContent: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
14
+ theme?: import("@emotion/react").Theme | undefined;
15
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
16
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
17
+ export declare const Anchor: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
18
+ theme?: import("@emotion/react").Theme | undefined;
19
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
20
+ }, import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, {}>;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Anchor = exports.CellContent = exports.ColumnLabel = void 0;
4
+ const styled_1 = require("../../../styled");
5
+ const Typography_1 = require("../../../Typography");
6
+ const constants_1 = require("../constants");
7
+ exports.ColumnLabel = (0, styled_1.styled)(Typography_1.Typography) `
8
+ display: none;
9
+
10
+ ${({ theme }) => theme.breakpoints.down('sm')} {
11
+ display: block;
12
+
13
+ &.${constants_1.dataGridCellClassnames.columnLabelHidden} {
14
+ display: none;
15
+ }
16
+ }
17
+ `;
18
+ exports.CellContent = styled_1.styled.div `
19
+ min-width: 0;
20
+
21
+ &.${constants_1.dataGridCellClassnames.tabularNums} {
22
+ font-feature-settings: "tnum" 1;
23
+ }
24
+
25
+ ${({ theme }) => theme.breakpoints.down('sm')} {
26
+ display: flex;
27
+ flex-direction: column;
28
+ gap: ${({ theme }) => theme.spacing(1)};
29
+ align-items: flex-start;
30
+
31
+ width: 100%;
32
+
33
+ &.${constants_1.dataGridCellClassnames.actionColumn} {
34
+ align-items: flex-end;
35
+ }
36
+ }
37
+ `;
38
+ exports.Anchor = styled_1.styled.a `
39
+ display: flex;
40
+ align-items: inherit;
41
+ justify-content: inherit;
42
+
43
+ width: 100%;
44
+ height: 100%;
45
+
46
+ color: inherit;
47
+ text-decoration: none;
48
+
49
+ &:focus-visible {
50
+ outline: none;
51
+ }
52
+ `;
@@ -0,0 +1,48 @@
1
+ import { type HTMLAttributeAnchorTarget, type ReactNode } from 'react';
2
+ import { type RenderCell } from '../../types';
3
+ export type CellInnerProps = {
4
+ /**
5
+ * Данные строки для отображения
6
+ */
7
+ row: Record<string, unknown>;
8
+ /**
9
+ * Название колонки
10
+ */
11
+ label?: string;
12
+ /**
13
+ * Скрытие заголовка колонки на мобильных устройствах
14
+ */
15
+ hideTitleOnMobile?: boolean;
16
+ /**
17
+ * Флаг колонки с действиями
18
+ */
19
+ isActionColumn?: boolean;
20
+ /**
21
+ * Моноширинный шрифт для чисел
22
+ */
23
+ isTabularNums?: boolean;
24
+ /**
25
+ * Дополнительное содержимое ячейки слева
26
+ */
27
+ startAdornment?: ReactNode;
28
+ /**
29
+ * Кастомное отображение ячейки
30
+ */
31
+ renderCell?: RenderCell<Record<string, unknown>>;
32
+ /**
33
+ * Отформатированное значение ячейки
34
+ */
35
+ formattedValue?: unknown;
36
+ /**
37
+ * Класс для скрытия персональных данных
38
+ */
39
+ hidePersonalDataClassname?: string;
40
+ /**
41
+ * URL ссылки. Если задан, содержимое оборачивается в ссылку
42
+ */
43
+ href?: string;
44
+ /**
45
+ * Целевая область для ссылки
46
+ */
47
+ target?: HTMLAttributeAnchorTarget;
48
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -12,4 +12,5 @@ export declare const dataGridCellClassnames: {
12
12
  alignRight: string;
13
13
  grouped: string;
14
14
  tabularNums: string;
15
+ anchorCell: string;
15
16
  };
@@ -16,4 +16,5 @@ exports.dataGridCellClassnames = {
16
16
  alignRight: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__cell_align-right'),
17
17
  grouped: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__cell_grouped'),
18
18
  tabularNums: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__cell_tabular-nums'),
19
+ anchorCell: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__cell_anchor-cell'),
19
20
  };
@@ -1,2 +1,3 @@
1
1
  export * from './Cell';
2
2
  export { dataGridCellClassnames } from './constants';
3
+ export type { CellProps } from './types';
@@ -3,18 +3,3 @@ export declare const Wrapper: import("@emotion/styled/dist/declarations/src/type
3
3
  theme?: import("@emotion/react").Theme | undefined;
4
4
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
5
5
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
- export declare const ColumnLabel: import("@emotion/styled/dist/declarations/src/types").StyledComponent<import("../../Typography/types").TypographyPropsBase & {
7
- color?: import("../../Typography").TypographyColor | undefined;
8
- variant?: import("../../Typography").TypographyVariant | undefined;
9
- colorIntensity?: import("../../Typography").Intensity | undefined;
10
- component?: import("../../Typography/types").ComponentProp | undefined;
11
- isUpperCase?: boolean | undefined;
12
- withoutCalt?: boolean | undefined;
13
- isTabularNums?: boolean | undefined;
14
- } & import("react").HTMLAttributes<HTMLParagraphElement> & import("react").RefAttributes<HTMLSpanElement> & {
15
- theme?: import("@emotion/react").Theme | undefined;
16
- }, {}, {}>;
17
- export declare const CellContent: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
18
- theme?: import("@emotion/react").Theme | undefined;
19
- as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
20
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CellContent = exports.ColumnLabel = exports.Wrapper = void 0;
3
+ exports.Wrapper = void 0;
4
4
  const styled_1 = require("../../styled");
5
- const Typography_1 = require("../../Typography");
6
5
  const constants_1 = require("../constants");
7
6
  const constants_2 = require("../Row/constants");
8
7
  const constants_3 = require("./constants");
@@ -72,34 +71,3 @@ exports.Wrapper = styled_1.styled.div `
72
71
  }
73
72
  }
74
73
  `;
75
- exports.ColumnLabel = (0, styled_1.styled)(Typography_1.Typography) `
76
- display: none;
77
-
78
- ${({ theme }) => theme.breakpoints.down('sm')} {
79
- display: block;
80
-
81
- &.${constants_3.dataGridCellClassnames.columnLabelHidden} {
82
- display: none;
83
- }
84
- }
85
- `;
86
- exports.CellContent = styled_1.styled.div `
87
- min-width: 0;
88
-
89
- &.${constants_3.dataGridCellClassnames.tabularNums} {
90
- font-feature-settings: "tnum" 1;
91
- }
92
-
93
- ${({ theme }) => theme.breakpoints.down('sm')} {
94
- display: flex;
95
- flex-direction: column;
96
- gap: ${({ theme }) => theme.spacing(1)};
97
- align-items: flex-start;
98
-
99
- width: 100%;
100
-
101
- &.${constants_3.dataGridCellClassnames.actionColumn} {
102
- align-items: flex-end;
103
- }
104
- }
105
- `;
@@ -0,0 +1,49 @@
1
+ import { type HTMLAttributeAnchorTarget, type ReactNode } from 'react';
2
+ import { type CellValue, type DataGridSingleColumn } from '../types';
3
+ export type CellProps<TData extends Record<string, CellValue>> = {
4
+ /**
5
+ * Название класса, применяется к корневому компоненту
6
+ */
7
+ className?: string;
8
+ /**
9
+ * Данные строки для отображения
10
+ */
11
+ row: TData;
12
+ cell: DataGridSingleColumn<TData>;
13
+ /**
14
+ * Дополнительное содержимое ячейки, которое будет распложено справа
15
+ */
16
+ startAdornment?: ReactNode;
17
+ /**
18
+ * Заглушка для пустых ячеек (если отсутствует field и filter и renderCell)
19
+ */
20
+ emptyCellValue?: ReactNode;
21
+ /**
22
+ * Если true, ячейка будет недоступна для взаимодействия
23
+ */
24
+ isDisabled?: boolean;
25
+ /**
26
+ * Скрытие персональных данных от инструментов мониторинга
27
+ */
28
+ isHidePersonalData?: boolean;
29
+ /**
30
+ * Скрытие ячейки на мобильных устройствах
31
+ */
32
+ isHideOnMobile?: boolean;
33
+ /**
34
+ * Флаг наличия вложенных элементов в строке
35
+ */
36
+ hasNestedChildren?: boolean;
37
+ /**
38
+ * Ссылка на корневой элемент строки
39
+ */
40
+ rootRowElement?: HTMLLIElement | null;
41
+ /**
42
+ * URL ссылки
43
+ */
44
+ href?: string;
45
+ /**
46
+ * Целевая область для ссылки
47
+ */
48
+ target?: HTMLAttributeAnchorTarget;
49
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,12 +1,13 @@
1
1
  import type { CellValue } from '../../types';
2
- import type { CellProps } from '../Cell';
2
+ import type { CellProps } from '../types';
3
3
  type UseLogicParams<TData extends Record<string, CellValue>> = CellProps<TData>;
4
- export declare const useLogic: <TData extends Record<string, unknown>>({ row, cell, emptyCellValue, startAdornment, }: UseLogicParams<TData>) => {
4
+ export declare const useLogic: <TData extends Record<string, unknown>>({ row, href, target, cell, emptyCellValue, startAdornment, }: UseLogicParams<TData>) => {
5
5
  formattedValue: unknown;
6
6
  hasStartAdornment: boolean;
7
7
  isActionColumn: boolean;
8
8
  label: string | undefined;
9
9
  hideTitleOnMobile: boolean | undefined;
10
10
  isTabularNums: boolean | undefined;
11
+ onCellClick: () => void;
11
12
  };
12
13
  export {};
@@ -2,8 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useLogic = void 0;
4
4
  const react_1 = require("react");
5
+ const redirectToLink_1 = require("../../../utils/redirectToLink");
5
6
  const DataGridContext_1 = require("../../DataGridContext");
6
- const useLogic = ({ row, cell, emptyCellValue, startAdornment, }) => {
7
+ const useLogic = ({ row, href, target, cell, emptyCellValue, startAdornment, }) => {
7
8
  const { isTabularNums: contextIsTabularNums } = (0, react_1.useContext)(DataGridContext_1.DataGridContext);
8
9
  const { format, field, label, hideTitleOnMobile, isTabularNums: cellIsTabularNums, } = cell;
9
10
  const isTabularNums = cellIsTabularNums ?? contextIsTabularNums;
@@ -21,6 +22,11 @@ const useLogic = ({ row, cell, emptyCellValue, startAdornment, }) => {
21
22
  }, [field, format, row, emptyCellValue]);
22
23
  const hasStartAdornment = Boolean(startAdornment);
23
24
  const isActionColumn = cell.field === 'actions';
25
+ const onCellClick = () => {
26
+ if (isActionColumn && href) {
27
+ return (0, redirectToLink_1.redirectToLink)(href, target);
28
+ }
29
+ };
24
30
  return {
25
31
  formattedValue,
26
32
  hasStartAdornment,
@@ -28,6 +34,7 @@ const useLogic = ({ row, cell, emptyCellValue, startAdornment, }) => {
28
34
  label,
29
35
  hideTitleOnMobile,
30
36
  isTabularNums,
37
+ onCellClick,
31
38
  };
32
39
  };
33
40
  exports.useLogic = useLogic;
@@ -65,7 +65,7 @@ const RowInner = (props) => {
65
65
  // В этот rest-оператор попадают специфичные пропсы (атрибуты) virtuoso
66
66
  // Необходимы для DataGridInfinite
67
67
  ...selfProps } = props;
68
- const { isDisabledLastCell = true, isNotSelectable } = options || {};
68
+ const { isDisabledLastCell = true, isNotSelectable, href, target, } = options || {};
69
69
  const renderStartAdornment = () => {
70
70
  if (!isRenderCollapseButton && (!isSelectable || isNotSelectable)) {
71
71
  return null;
@@ -89,10 +89,10 @@ const RowInner = (props) => {
89
89
  }), children: label }), children.map((child, childIndex) => {
90
90
  const childCellId = `${cellId}-${childIndex}`;
91
91
  const shouldRenderStartAdornment = isFirstCell && childIndex === 0;
92
- return ((0, jsx_runtime_1.jsx)(styles_1.CellStyled, { row: row, cell: child, isHideOnMobile: isHideOnMobile, emptyCellValue: emptyCellValue, isDisabled: isDisabledCell, startAdornment: shouldRenderStartAdornment && renderStartAdornment(), isHidePersonalData: child.isHidePersonalData, hasNestedChildren: Boolean(nestedChildren?.length), className: (0, classNames_1.classNames)(Cell_1.dataGridCellClassnames.grouped), rootRowElement: rootRowElement }, childCellId));
92
+ return ((0, jsx_runtime_1.jsx)(styles_1.CellStyled, { row: row, cell: child, isHideOnMobile: isHideOnMobile, emptyCellValue: emptyCellValue, isDisabled: isDisabledCell, startAdornment: shouldRenderStartAdornment && renderStartAdornment(), isHidePersonalData: child.isHidePersonalData, hasNestedChildren: Boolean(nestedChildren?.length), className: (0, classNames_1.classNames)(Cell_1.dataGridCellClassnames.grouped), rootRowElement: rootRowElement, href: href, target: target }, childCellId));
93
93
  })] }, cellId));
94
94
  }
95
- return ((0, jsx_runtime_1.jsx)(styles_1.CellStyled, { className: singleCellCva({ isFirstCell }), row: row, cell: cell, emptyCellValue: emptyCellValue, startAdornment: isFirstCell && renderStartAdornment(), isDisabled: isDisabledCell, isHidePersonalData: cell.isHidePersonalData, hasNestedChildren: Boolean(nestedChildren?.length), rootRowElement: rootRowElement }, cellId));
95
+ return ((0, jsx_runtime_1.jsx)(styles_1.CellStyled, { className: singleCellCva({ isFirstCell }), row: row, cell: cell, emptyCellValue: emptyCellValue, startAdornment: isFirstCell && renderStartAdornment(), isDisabled: isDisabledCell, isHidePersonalData: cell.isHidePersonalData, hasNestedChildren: Boolean(nestedChildren?.length), rootRowElement: rootRowElement, href: href, target: target }, cellId));
96
96
  });
97
97
  }, [
98
98
  row,
@@ -879,7 +879,7 @@ export declare const useLogic: <TData extends Record<string, unknown>>({ keyId,
879
879
  isActive: boolean;
880
880
  mobileDisplayVariant: "list" | "cards" | undefined;
881
881
  rowProps: {
882
- onClick: () => void;
882
+ onClick: () => undefined;
883
883
  onMouseMove: (event: MouseEvent<HTMLElement>) => void;
884
884
  };
885
885
  drawerProps: {
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useLogic = void 0;
4
4
  const react_1 = require("react");
5
- const redirectToLink_1 = require("../../../utils/redirectToLink");
6
5
  const DataGridContext_1 = require("../../DataGridContext");
7
6
  const enums_1 = require("../../enums");
8
7
  const constants_1 = require("../constants");
@@ -34,16 +33,13 @@ const useLogic = ({ keyId, columns, row, nestedChildren, level, variant, options
34
33
  };
35
34
  const [isVisibleTooltip, setVisibleTooltip] = (0, react_1.useState)(false);
36
35
  const rowId = row[keyId];
37
- const { isDisabled: isExternalDisabled, disabledReason: externalDisabledReason, href, target, } = options || {};
36
+ const { isDisabled: isExternalDisabled, disabledReason: externalDisabledReason, href, } = options || {};
38
37
  const disabled = isDisabled || isExternalDisabled;
39
38
  const handleRowClick = () => {
40
39
  if (disabled) {
41
40
  handleOpenDrawer();
42
41
  return undefined;
43
42
  }
44
- if (href) {
45
- return (0, redirectToLink_1.redirectToLink)(href, target);
46
- }
47
43
  onRowClick?.(row);
48
44
  };
49
45
  const isShowConnector = Object.is(variant, enums_1.Variant.Tree);
@@ -1,2 +1,2 @@
1
1
  import { type GroupCellProps } from './types';
2
- export declare const GroupCell: ({ cell, cellId, isFirstCell, row, emptyCellValue, isDisabled, startAdornment, }: GroupCellProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const GroupCell: ({ cell, cellId, isFirstCell, row, emptyCellValue, isDisabled, startAdornment, href, target, }: GroupCellProps) => import("react/jsx-runtime").JSX.Element;
@@ -13,14 +13,14 @@ const groupedColumnLabelCva = (0, class_variance_authority_1.cva)(constants_1.da
13
13
  },
14
14
  },
15
15
  });
16
- const GroupCell = ({ cell, cellId, isFirstCell, row, emptyCellValue, isDisabled, startAdornment, }) => {
16
+ const GroupCell = ({ cell, cellId, isFirstCell, row, emptyCellValue, isDisabled, startAdornment, href, target, }) => {
17
17
  const { label, children, hideTitleOnMobile, isHideOnMobile } = cell;
18
18
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(styles_1.GroupedColumnLabel, { variant: "caption", color: "grey", colorIntensity: "700", className: groupedColumnLabelCva({
19
19
  hidden: hideTitleOnMobile || isHideOnMobile,
20
20
  }), children: label }), children.map((child, childIndex) => {
21
21
  const childCellId = `${cellId}-${childIndex}`;
22
22
  const shouldRenderStartAdornment = isFirstCell && childIndex === 0;
23
- return ((0, jsx_runtime_1.jsx)(Cell_1.Cell, { row: row, cell: child, isHideOnMobile: isHideOnMobile, emptyCellValue: emptyCellValue, isDisabled: isDisabled, startAdornment: shouldRenderStartAdornment && startAdornment, isHidePersonalData: child.isHidePersonalData, className: Cell_1.dataGridCellClassnames.grouped }, childCellId));
23
+ return ((0, jsx_runtime_1.jsx)(Cell_1.Cell, { row: row, cell: child, isHideOnMobile: isHideOnMobile, emptyCellValue: emptyCellValue, isDisabled: isDisabled, startAdornment: shouldRenderStartAdornment && startAdornment, isHidePersonalData: child.isHidePersonalData, className: Cell_1.dataGridCellClassnames.grouped, href: href, target: target }, childCellId));
24
24
  })] }));
25
25
  };
26
26
  exports.GroupCell = GroupCell;
@@ -1,4 +1,4 @@
1
- import { type ReactNode } from 'react';
1
+ import { type HTMLAttributeAnchorTarget, type ReactNode } from 'react';
2
2
  import { type DataGridGroupColumn, type DataGridRowWithOptions } from '../../types';
3
3
  export type GroupCellProps = {
4
4
  cell: DataGridGroupColumn<Record<string, unknown>>;
@@ -8,4 +8,6 @@ export type GroupCellProps = {
8
8
  emptyCellValue?: ReactNode;
9
9
  isDisabled?: boolean;
10
10
  startAdornment?: ReactNode;
11
+ href?: string;
12
+ target?: HTMLAttributeAnchorTarget;
11
13
  };