@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
@@ -36,7 +36,7 @@ const rootCva = (0, cva_1.cva)(constants_2.dataGridRowBaseClassnames.root, {
36
36
  },
37
37
  });
38
38
  exports.RowBase = (0, react_1.memo)((props) => {
39
- const { className, tooltipProps, rowBaseVars, isHovered, isActive, drawerProps, emptyCellValue, rowRef, onRowEnter, onRowLeave, rowId, row, isDisabled, sectionOffset, customContent, isDisabledLastCell, renderStartAdornment, checkboxProps, isNotSelectable, isSelectable, columns, dataGridInfiniteItemProps, handleRowClick, drawerContent, mobileDisplayVariant, } = (0, useLogic_1.useLogic)(props);
39
+ const { className, tooltipProps, rowBaseVars, isHovered, isActive, drawerProps, emptyCellValue, rowRef, onRowEnter, onRowLeave, rowId, row, isDisabled, sectionOffset, customContent, isDisabledLastCell, renderStartAdornment, checkboxProps, href, target, isNotSelectable, isSelectable, columns, dataGridInfiniteItemProps, handleRowClick, drawerContent, mobileDisplayVariant, } = (0, useLogic_1.useLogic)(props);
40
40
  const renderStartAdornmentBase = () => {
41
41
  const adornment = renderStartAdornment?.(true);
42
42
  const shouldRenderCheckbox = isSelectable && !isNotSelectable;
@@ -56,9 +56,9 @@ exports.RowBase = (0, react_1.memo)((props) => {
56
56
  const isFirstCell = globalIndex === 0;
57
57
  const isDisabledCell = (0, utils_1.checkIsDisabled)(isDisabled, availableCellsByIndex, globalIndex);
58
58
  if ((0, utils_2.isGroupColumns)(cell)) {
59
- return ((0, jsx_runtime_1.jsx)(GroupCell_1.GroupCell, { cell: cell, cellId: cellId, isFirstCell: isFirstCell, row: row, emptyCellValue: emptyCellValue, isDisabled: isDisabledCell, startAdornment: isFirstCell && renderStartAdornmentBase() }, cellId));
59
+ return ((0, jsx_runtime_1.jsx)(GroupCell_1.GroupCell, { cell: cell, cellId: cellId, isFirstCell: isFirstCell, row: row, emptyCellValue: emptyCellValue, isDisabled: isDisabledCell, startAdornment: isFirstCell && renderStartAdornmentBase(), href: href, target: target }, cellId));
60
60
  }
61
- return ((0, jsx_runtime_1.jsx)(Cell_1.Cell, { row: row, cell: cell, emptyCellValue: emptyCellValue, startAdornment: isFirstCell && renderStartAdornmentBase(), isDisabled: isDisabledCell, isHidePersonalData: cell.isHidePersonalData }, cellId));
61
+ return ((0, jsx_runtime_1.jsx)(Cell_1.Cell, { row: row, cell: cell, emptyCellValue: emptyCellValue, startAdornment: isFirstCell && renderStartAdornmentBase(), isDisabled: isDisabledCell, isHidePersonalData: cell.isHidePersonalData, href: href, target: target }, cellId));
62
62
  });
63
63
  }, [
64
64
  row,
@@ -28,6 +28,8 @@ export declare const useLogic: ({ className, row, keyId, onRowClick, columns, se
28
28
  columns: import("../..").DataGridColumns<Record<string, unknown>>[];
29
29
  emptyCellValue: import("react").ReactNode;
30
30
  rowRef: (element: HTMLElement | null) => void;
31
+ href: string | undefined;
32
+ target: import("react").HTMLAttributeAnchorTarget | undefined;
31
33
  onRowEnter: ((rowId: string) => void) | undefined;
32
34
  onRowLeave: ((rowId: string, event: PointerEvent) => void) | undefined;
33
35
  rowId: string;
@@ -75,6 +75,8 @@ const useLogic = ({ className, row, keyId, onRowClick, columns, sectionOffset, c
75
75
  columns,
76
76
  emptyCellValue,
77
77
  rowRef,
78
+ href,
79
+ target,
78
80
  onRowEnter,
79
81
  onRowLeave,
80
82
  rowId,
@@ -1,5 +1,4 @@
1
- import { type CSSProperties, type ReactNode } from 'react';
2
- import { type Target } from '../utils/redirectToLink';
1
+ import { type CSSProperties, type HTMLAttributeAnchorTarget, type ReactNode } from 'react';
3
2
  import { type Variant } from './enums';
4
3
  import type { NoDataProps } from './NoData';
5
4
  export type AlignVariant = 'left' | 'center' | 'right';
@@ -338,7 +337,7 @@ export type DataGridRowOptions<TData extends Record<string, CellValue>> = {
338
337
  /**
339
338
  * Способ открытия ссылки
340
339
  */
341
- target?: Target;
340
+ target?: HTMLAttributeAnchorTarget;
342
341
  };
343
342
  export type DataGridRow = Record<string, CellValue>;
344
343
  export type DataGridRowWithOptions<TData extends DataGridRow> = TData & {
@@ -19,6 +19,7 @@ const useLogic = ({ initialOpen, onOpen, onClose }) => {
19
19
  const [isOpen, setIsOpen] = (0, react_1.useState)(storedValue !== undefined ? storedValue : initialOpen);
20
20
  const handleToggle = (0, react_1.useCallback)((event) => {
21
21
  event?.stopPropagation();
22
+ event?.preventDefault();
22
23
  if (isOpen) {
23
24
  setIsOpen(false);
24
25
  setItem(storageKey, false);
@@ -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;
@@ -28,12 +28,16 @@ exports.StyledPageContent = (0, styled_1.styled)(PageContent_1.PageContent) `
28
28
 
29
29
  border-top: 1px solid ${({ theme }) => theme.palette.grey[300]};
30
30
 
31
- .${PageContent_1.pageContentClassnames.content} {
32
- ${({ theme }) => theme.breakpoints.up('sm')} {
31
+ ${({ theme }) => theme.breakpoints.up('sm')} {
32
+ .${PageContent_1.pageContentClassnames.content} {
33
33
  overflow: unset;
34
34
 
35
35
  height: auto;
36
36
  padding: 0;
37
+
38
+ &.${PageContent_1.pageContentClassnames.contentHasHeader}, &.${PageContent_1.pageContentClassnames.hasAside} {
39
+ padding: 0;
40
+ }
37
41
  }
38
42
  }
39
43
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astral/ui",
3
- "version": "4.76.3",
3
+ "version": "4.77.1",
4
4
  "browser": "./index.js",
5
5
  "main": "./node/index.js",
6
6
  "dependencies": {