@astral/ui 4.119.0 → 4.119.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.
@@ -4,14 +4,12 @@ type DataType = {
4
4
  documentName?: string;
5
5
  recipient?: string;
6
6
  createDate: string;
7
- actions?: object;
8
7
  };
9
8
  type TreeDataType = {
10
9
  id: string;
11
10
  documentName: string;
12
11
  recipient: string;
13
12
  createDate: string;
14
- actions?: object;
15
13
  };
16
14
  export declare const makeRandomDate: () => string;
17
15
  export declare const makeColumns: <T extends DataType>(columnsTemplate: DataGridColumns<T>[], mergedColumns?: DataGridColumns<T>[]) => DataGridColumns<T>[];
@@ -1,4 +1,5 @@
1
1
  import { type CSSProperties, type HTMLAttributeAnchorTarget, type HTMLAttributes, type ReactNode, type Ref } from 'react';
2
+ import type { ACTIONS_COLUMN_FIELD } from './constants';
2
3
  import { type Variant } from './enums';
3
4
  import type { NoDataProps } from './NoData';
4
5
  import type { DataGridResizePlugin } from './plugins/resize/types';
@@ -298,9 +299,9 @@ export type DataGridGroupColumn<TData extends Record<string, CellValue>> = {
298
299
  export type DataGridSingleColumn<TData extends Record<string, CellValue>> = {
299
300
  /**
300
301
  * @example {field: 'test'}
301
- * Значение ключа поля данных для колонки
302
+ * Значение ключа поля данных для колонки. `'actions'` — колонка действий
302
303
  */
303
- field?: keyof TData;
304
+ field?: keyof TData | typeof ACTIONS_COLUMN_FIELD;
304
305
  /**
305
306
  * Название колонки таблицы
306
307
  */
@@ -369,9 +370,9 @@ export type DataGridSingleColumn<TData extends Record<string, CellValue>> = {
369
370
  export type DataGridColumns<TData extends Record<string, CellValue>> = DataGridSingleColumn<TData> | DataGridGroupColumn<TData>;
370
371
  export type DataGridRowOptionColumns<TData extends Record<string, CellValue>> = {
371
372
  /**
372
- * Значение ключа поля данных для колонки
373
+ * Значение ключа поля данных для колонки. `'actions'` — колонка действий
373
374
  */
374
- field: keyof TData;
375
+ field: keyof TData | typeof ACTIONS_COLUMN_FIELD;
375
376
  /**
376
377
  * Кастомное отображение ячеек для колонки
377
378
  */
@@ -4,7 +4,6 @@ type DataType = {
4
4
  documentName: string;
5
5
  recipient: string;
6
6
  createDate: string;
7
- actions?: object;
8
7
  };
9
8
  export declare const makeRandomDate: () => string;
10
9
  export declare const makeDataList: (length?: number) => DataType[];
@@ -1,10 +1,17 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Tooltip } from '../../components/Tooltip';
3
- import { cn } from '../../components/utils/cn';
3
+ import { cva } from '../../components/utils/cva';
4
4
  import { editableTextClassnames } from './constants';
5
5
  import { EditingForm } from './EditingForm';
6
- import { DisplayValue, StyledEditIcon, StyledLoader, StyledPopover, } from './styles';
6
+ import { DisplayValue, StyledEditIcon, StyledLoader, StyledPopover, Wrapper, } from './styles';
7
7
  import { useLogic } from './useLogic';
8
+ const editIconCva = cva('', {
9
+ variants: {
10
+ isShowOnHover: {
11
+ true: editableTextClassnames.showIconOnHover,
12
+ },
13
+ },
14
+ });
8
15
  const getShowEditIconMode = ({ showEditIcon, isShowIcon = true, }) => {
9
16
  if (showEditIcon !== undefined) {
10
17
  return showEditIcon;
@@ -13,7 +20,7 @@ const getShowEditIconMode = ({ showEditIcon, isShowIcon = true, }) => {
13
20
  };
14
21
  // biome-ignore lint/complexity/noUselessTypeConstraint: Фикс типизации в тестах
15
22
  export const EditableText = (props) => {
16
- const { isIconOnLeft, onClose, displayValueProps, tooltipProps, popoverProps, } = useLogic(props);
23
+ const { isIconOnLeft, onClose, onWrapperClick, displayValueProps, tooltipProps, popoverProps, } = useLogic(props);
17
24
  const { className, children, isShowIcon = true, isLoading, showEditIcon, iconPosition = 'right', ...restProps } = props;
18
25
  const showEditIconMode = getShowEditIconMode({ showEditIcon, isShowIcon });
19
26
  const renderIcon = () => {
@@ -23,11 +30,11 @@ export const EditableText = (props) => {
23
30
  if (showEditIconMode === 'none') {
24
31
  return null;
25
32
  }
26
- return (_jsx(StyledEditIcon, { "$iconPosition": iconPosition, className: cn({
27
- [editableTextClassnames.showIconOnHover]: showEditIconMode === 'onHover',
33
+ return (_jsx(StyledEditIcon, { "$iconPosition": iconPosition, className: editIconCva({
34
+ isShowOnHover: showEditIconMode === 'onHover',
28
35
  }) }));
29
36
  };
30
- return (_jsxs(_Fragment, { children: [_jsx(Tooltip, { ...tooltipProps, placement: "bottom", children: _jsxs(DisplayValue, { "$isLoading": isLoading, className: className, variant: "inherit", ...displayValueProps, children: [isIconOnLeft && renderIcon(), children, !isIconOnLeft && renderIcon()] }) }), _jsx(StyledPopover, { anchorOrigin: {
37
+ return (_jsxs(Wrapper, { onClick: onWrapperClick, children: [_jsx(Tooltip, { ...tooltipProps, placement: "bottom", children: _jsxs(DisplayValue, { "$isLoading": isLoading, className: className, variant: "inherit", ...displayValueProps, children: [isIconOnLeft && renderIcon(), children, !isIconOnLeft && renderIcon()] }) }), _jsx(StyledPopover, { anchorOrigin: {
31
38
  vertical: 'bottom',
32
39
  horizontal: 'left',
33
40
  }, ...popoverProps, children: _jsx(EditingForm, { children: children, onClose: onClose, ...restProps }) })] }));
@@ -5,7 +5,7 @@ import { CrossOutlineMd } from '../../../icons/CrossOutlineMd';
5
5
  import { Form } from '../../Form';
6
6
  import { FormSubmitButton } from '../../FormSubmitButton';
7
7
  import { FormTextField } from '../../FormTextField';
8
- import { FIELD_NAME } from '../constants';
8
+ import { editableTextClassnames, FIELD_NAME } from '../constants';
9
9
  import { FormIconSubmitButton } from '../FormIconSubmitButton';
10
10
  import { Actions, Description, FieldContainer, FieldRow, FormFooter, Wrapper, } from './styles';
11
11
  import { useLogic } from './useLogic';
@@ -19,5 +19,5 @@ export const EditingForm = (props) => {
19
19
  fullWidth: true,
20
20
  autoFocus: true,
21
21
  };
22
- return (_jsx(Wrapper, { children: _jsxs(Form, { ...formProps, children: [_jsx(Description, { children: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043D\u043E\u0432\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0438 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u0435" }), _jsxs(FieldRow, { children: [_jsx(FieldContainer, { children: componentField(formFieldProps) }), !isMobile && (_jsxs(Actions, { children: [_jsx(FormIconSubmitButton, { variant: "outlined", size: "large", color: "success", "aria-label": "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C", children: _jsx(CheckOutlineMd, {}) }), _jsx(IconButton, { variant: "outlined", size: "large", color: "grey", "aria-label": "\u041E\u0442\u043C\u0435\u043D\u0430", onClick: onClose, children: _jsx(CrossOutlineMd, {}) })] }))] }), isMobile && (_jsx(FormFooter, { children: _jsx(FormSubmitButton, { children: "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C" }) }))] }) }));
22
+ return (_jsx(Wrapper, { children: _jsxs(Form, { ...formProps, children: [_jsx(Description, { children: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043D\u043E\u0432\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0438 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u0435" }), _jsxs(FieldRow, { children: [_jsx(FieldContainer, { children: componentField(formFieldProps) }), !isMobile && (_jsxs(Actions, { className: editableTextClassnames.actions, children: [_jsx(FormIconSubmitButton, { variant: "outlined", size: "large", color: "success", "aria-label": "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C", children: _jsx(CheckOutlineMd, {}) }), _jsx(IconButton, { variant: "outlined", size: "large", color: "grey", "aria-label": "\u041E\u0442\u043C\u0435\u043D\u0430", onClick: onClose, children: _jsx(CrossOutlineMd, {}) })] }))] }), isMobile && (_jsx(FormFooter, { children: _jsx(FormSubmitButton, { children: "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C" }) }))] }) }));
23
23
  };
@@ -1,6 +1,8 @@
1
+ import { formLabelClasses } from '@mui/material';
1
2
  import { buttonClasses } from '../../../components/Button';
2
3
  import { styled } from '../../../components/styled';
3
4
  import { Typography } from '../../../components/Typography';
5
+ import { editableTextClassnames } from '../constants';
4
6
  export const Wrapper = styled.div `
5
7
  width: 400px;
6
8
  padding: ${({ theme }) => theme.spacing(4)};
@@ -20,6 +22,12 @@ export const FieldRow = styled.div `
20
22
  display: flex;
21
23
  gap: ${({ theme }) => theme.spacing(5)};
22
24
  align-items: flex-start;
25
+
26
+ /* Причина игнора: Не критично для отображения */
27
+ /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
28
+ &:has(.${formLabelClasses.root}) .${editableTextClassnames.actions} {
29
+ margin-top: ${({ theme }) => theme.spacing(5)};
30
+ }
23
31
  `;
24
32
  export const FieldContainer = styled.div `
25
33
  flex: 1;
@@ -1,4 +1,5 @@
1
1
  export declare const FIELD_NAME = "editableField";
2
2
  export declare const editableTextClassnames: {
3
3
  showIconOnHover: string;
4
+ actions: string;
4
5
  };
@@ -2,4 +2,5 @@ import { createUIKitClassname } from '../../components/utils/createUIKitClassnam
2
2
  export const FIELD_NAME = 'editableField';
3
3
  export const editableTextClassnames = {
4
4
  showIconOnHover: createUIKitClassname('editable-text__edit-icon_show-on-hover'),
5
+ actions: createUIKitClassname('editable-text__actions'),
5
6
  };
@@ -33,3 +33,7 @@ export declare const StyledPopover: import("../../components/styled").StyledComp
33
33
  } & {
34
34
  theme?: import("@emotion/react").Theme | undefined;
35
35
  }, {}, {}>;
36
+ export declare const Wrapper: import("../../components/styled").StyledComponent<{
37
+ theme?: import("@emotion/react").Theme | undefined;
38
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
39
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -18,7 +18,8 @@ export const DisplayValue = styled(Typography, {
18
18
  }) `
19
19
  cursor: pointer;
20
20
 
21
- display: unset;
21
+ display: inline-flex;
22
+ align-items: center;
22
23
 
23
24
  background: ${({ theme, $isEdited, $isLoading }) => getBackgroundColor(theme, $isEdited, $isLoading)};
24
25
  border-radius: ${({ theme }) => theme.shape.small};
@@ -48,9 +49,6 @@ export const StyledEditIcon = styled(EditOutlineMd, {
48
49
  height: 1em;
49
50
  min-height: 16px;
50
51
  margin-right: ${({ $iconPosition, theme }) => $iconPosition === 'left' ? theme.spacing(1) : ''};
51
-
52
- /* Вертикальный отступ для визуального центрирования. Значение подобрано эмпирическим путем */
53
- margin-bottom: calc(-1em / 5);
54
52
  margin-left: ${({ $iconPosition, theme }) => $iconPosition === 'right' ? theme.spacing(1) : ''};
55
53
 
56
54
  font-size: inherit;
@@ -65,11 +63,6 @@ export const StyledLoader = styled(Loader, {
65
63
  width: 1em;
66
64
  height: 1em;
67
65
  margin-right: ${({ $iconPosition, theme }) => $iconPosition === 'left' ? theme.spacing(1) : ''};
68
-
69
- /* Задаем вертикальный отступ для визуального центрирования */
70
-
71
- /* Значение подобрано эмпирическим путем */
72
- margin-bottom: calc(-1em / 5);
73
66
  margin-left: ${({ $iconPosition, theme }) => $iconPosition === 'right' ? theme.spacing(1) : ''};
74
67
 
75
68
  font-size: inherit;
@@ -77,3 +70,6 @@ export const StyledLoader = styled(Loader, {
77
70
  export const StyledPopover = styled(Popover) `
78
71
  margin-top: ${({ theme }) => theme.spacing(2)};
79
72
  `;
73
+ export const Wrapper = styled.span `
74
+ display: contents;
75
+ `;
@@ -3,6 +3,7 @@ import { type EditableTextProps } from '../EditableText';
3
3
  export declare const useLogic: <TValue>({ isLoading, iconPosition, }: EditableTextProps<TValue>) => {
4
4
  isIconOnLeft: boolean;
5
5
  onClose: () => void;
6
+ onWrapperClick: (event: SyntheticEvent) => void;
6
7
  tooltipProps: {
7
8
  title: string | undefined;
8
9
  };
@@ -4,7 +4,11 @@ export const useLogic = ({ isLoading, iconPosition, }) => {
4
4
  const { isOpen, anchor, actions } = usePopover();
5
5
  const isIconOnLeft = iconPosition === 'left';
6
6
  const tooltipTitle = isLoading ? undefined : NOTE_TEXT;
7
+ const handleWrapperClick = (event) => {
8
+ event.stopPropagation();
9
+ };
7
10
  const handleOpen = (event) => {
11
+ event.preventDefault();
8
12
  if (isLoading) {
9
13
  return;
10
14
  }
@@ -13,6 +17,7 @@ export const useLogic = ({ isLoading, iconPosition, }) => {
13
17
  return {
14
18
  isIconOnLeft,
15
19
  onClose: actions.close,
20
+ onWrapperClick: handleWrapperClick,
16
21
  tooltipProps: {
17
22
  title: tooltipTitle,
18
23
  },
@@ -4,14 +4,12 @@ type DataType = {
4
4
  documentName?: string;
5
5
  recipient?: string;
6
6
  createDate: string;
7
- actions?: object;
8
7
  };
9
8
  type TreeDataType = {
10
9
  id: string;
11
10
  documentName: string;
12
11
  recipient: string;
13
12
  createDate: string;
14
- actions?: object;
15
13
  };
16
14
  export declare const makeRandomDate: () => string;
17
15
  export declare const makeColumns: <T extends DataType>(columnsTemplate: DataGridColumns<T>[], mergedColumns?: DataGridColumns<T>[]) => DataGridColumns<T>[];
@@ -1,4 +1,5 @@
1
1
  import { type CSSProperties, type HTMLAttributeAnchorTarget, type HTMLAttributes, type ReactNode, type Ref } from 'react';
2
+ import type { ACTIONS_COLUMN_FIELD } from './constants';
2
3
  import { type Variant } from './enums';
3
4
  import type { NoDataProps } from './NoData';
4
5
  import type { DataGridResizePlugin } from './plugins/resize/types';
@@ -298,9 +299,9 @@ export type DataGridGroupColumn<TData extends Record<string, CellValue>> = {
298
299
  export type DataGridSingleColumn<TData extends Record<string, CellValue>> = {
299
300
  /**
300
301
  * @example {field: 'test'}
301
- * Значение ключа поля данных для колонки
302
+ * Значение ключа поля данных для колонки. `'actions'` — колонка действий
302
303
  */
303
- field?: keyof TData;
304
+ field?: keyof TData | typeof ACTIONS_COLUMN_FIELD;
304
305
  /**
305
306
  * Название колонки таблицы
306
307
  */
@@ -369,9 +370,9 @@ export type DataGridSingleColumn<TData extends Record<string, CellValue>> = {
369
370
  export type DataGridColumns<TData extends Record<string, CellValue>> = DataGridSingleColumn<TData> | DataGridGroupColumn<TData>;
370
371
  export type DataGridRowOptionColumns<TData extends Record<string, CellValue>> = {
371
372
  /**
372
- * Значение ключа поля данных для колонки
373
+ * Значение ключа поля данных для колонки. `'actions'` — колонка действий
373
374
  */
374
- field: keyof TData;
375
+ field: keyof TData | typeof ACTIONS_COLUMN_FIELD;
375
376
  /**
376
377
  * Кастомное отображение ячеек для колонки
377
378
  */
@@ -4,7 +4,6 @@ type DataType = {
4
4
  documentName: string;
5
5
  recipient: string;
6
6
  createDate: string;
7
- actions?: object;
8
7
  };
9
8
  export declare const makeRandomDate: () => string;
10
9
  export declare const makeDataList: (length?: number) => DataType[];
@@ -3,11 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EditableText = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const Tooltip_1 = require("../../components/Tooltip");
6
- const cn_1 = require("../../components/utils/cn");
6
+ const cva_1 = require("../../components/utils/cva");
7
7
  const constants_1 = require("./constants");
8
8
  const EditingForm_1 = require("./EditingForm");
9
9
  const styles_1 = require("./styles");
10
10
  const useLogic_1 = require("./useLogic");
11
+ const editIconCva = (0, cva_1.cva)('', {
12
+ variants: {
13
+ isShowOnHover: {
14
+ true: constants_1.editableTextClassnames.showIconOnHover,
15
+ },
16
+ },
17
+ });
11
18
  const getShowEditIconMode = ({ showEditIcon, isShowIcon = true, }) => {
12
19
  if (showEditIcon !== undefined) {
13
20
  return showEditIcon;
@@ -16,7 +23,7 @@ const getShowEditIconMode = ({ showEditIcon, isShowIcon = true, }) => {
16
23
  };
17
24
  // biome-ignore lint/complexity/noUselessTypeConstraint: Фикс типизации в тестах
18
25
  const EditableText = (props) => {
19
- const { isIconOnLeft, onClose, displayValueProps, tooltipProps, popoverProps, } = (0, useLogic_1.useLogic)(props);
26
+ const { isIconOnLeft, onClose, onWrapperClick, displayValueProps, tooltipProps, popoverProps, } = (0, useLogic_1.useLogic)(props);
20
27
  const { className, children, isShowIcon = true, isLoading, showEditIcon, iconPosition = 'right', ...restProps } = props;
21
28
  const showEditIconMode = getShowEditIconMode({ showEditIcon, isShowIcon });
22
29
  const renderIcon = () => {
@@ -26,11 +33,11 @@ const EditableText = (props) => {
26
33
  if (showEditIconMode === 'none') {
27
34
  return null;
28
35
  }
29
- return ((0, jsx_runtime_1.jsx)(styles_1.StyledEditIcon, { "$iconPosition": iconPosition, className: (0, cn_1.cn)({
30
- [constants_1.editableTextClassnames.showIconOnHover]: showEditIconMode === 'onHover',
36
+ return ((0, jsx_runtime_1.jsx)(styles_1.StyledEditIcon, { "$iconPosition": iconPosition, className: editIconCva({
37
+ isShowOnHover: showEditIconMode === 'onHover',
31
38
  }) }));
32
39
  };
33
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { ...tooltipProps, placement: "bottom", children: (0, jsx_runtime_1.jsxs)(styles_1.DisplayValue, { "$isLoading": isLoading, className: className, variant: "inherit", ...displayValueProps, children: [isIconOnLeft && renderIcon(), children, !isIconOnLeft && renderIcon()] }) }), (0, jsx_runtime_1.jsx)(styles_1.StyledPopover, { anchorOrigin: {
40
+ return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { onClick: onWrapperClick, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { ...tooltipProps, placement: "bottom", children: (0, jsx_runtime_1.jsxs)(styles_1.DisplayValue, { "$isLoading": isLoading, className: className, variant: "inherit", ...displayValueProps, children: [isIconOnLeft && renderIcon(), children, !isIconOnLeft && renderIcon()] }) }), (0, jsx_runtime_1.jsx)(styles_1.StyledPopover, { anchorOrigin: {
34
41
  vertical: 'bottom',
35
42
  horizontal: 'left',
36
43
  }, ...popoverProps, children: (0, jsx_runtime_1.jsx)(EditingForm_1.EditingForm, { children: children, onClose: onClose, ...restProps }) })] }));
@@ -22,6 +22,6 @@ const EditingForm = (props) => {
22
22
  fullWidth: true,
23
23
  autoFocus: true,
24
24
  };
25
- return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { children: (0, jsx_runtime_1.jsxs)(Form_1.Form, { ...formProps, children: [(0, jsx_runtime_1.jsx)(styles_1.Description, { children: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043D\u043E\u0432\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0438 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u0435" }), (0, jsx_runtime_1.jsxs)(styles_1.FieldRow, { children: [(0, jsx_runtime_1.jsx)(styles_1.FieldContainer, { children: componentField(formFieldProps) }), !isMobile && ((0, jsx_runtime_1.jsxs)(styles_1.Actions, { children: [(0, jsx_runtime_1.jsx)(FormIconSubmitButton_1.FormIconSubmitButton, { variant: "outlined", size: "large", color: "success", "aria-label": "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C", children: (0, jsx_runtime_1.jsx)(CheckOutlineMd_1.CheckOutlineMd, {}) }), (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { variant: "outlined", size: "large", color: "grey", "aria-label": "\u041E\u0442\u043C\u0435\u043D\u0430", onClick: onClose, children: (0, jsx_runtime_1.jsx)(CrossOutlineMd_1.CrossOutlineMd, {}) })] }))] }), isMobile && ((0, jsx_runtime_1.jsx)(styles_1.FormFooter, { children: (0, jsx_runtime_1.jsx)(FormSubmitButton_1.FormSubmitButton, { children: "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C" }) }))] }) }));
25
+ return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { children: (0, jsx_runtime_1.jsxs)(Form_1.Form, { ...formProps, children: [(0, jsx_runtime_1.jsx)(styles_1.Description, { children: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043D\u043E\u0432\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0438 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u0435" }), (0, jsx_runtime_1.jsxs)(styles_1.FieldRow, { children: [(0, jsx_runtime_1.jsx)(styles_1.FieldContainer, { children: componentField(formFieldProps) }), !isMobile && ((0, jsx_runtime_1.jsxs)(styles_1.Actions, { className: constants_1.editableTextClassnames.actions, children: [(0, jsx_runtime_1.jsx)(FormIconSubmitButton_1.FormIconSubmitButton, { variant: "outlined", size: "large", color: "success", "aria-label": "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C", children: (0, jsx_runtime_1.jsx)(CheckOutlineMd_1.CheckOutlineMd, {}) }), (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { variant: "outlined", size: "large", color: "grey", "aria-label": "\u041E\u0442\u043C\u0435\u043D\u0430", onClick: onClose, children: (0, jsx_runtime_1.jsx)(CrossOutlineMd_1.CrossOutlineMd, {}) })] }))] }), isMobile && ((0, jsx_runtime_1.jsx)(styles_1.FormFooter, { children: (0, jsx_runtime_1.jsx)(FormSubmitButton_1.FormSubmitButton, { children: "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C" }) }))] }) }));
26
26
  };
27
27
  exports.EditingForm = EditingForm;
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FormFooter = exports.Actions = exports.FieldContainer = exports.FieldRow = exports.Description = exports.Wrapper = void 0;
4
+ const material_1 = require("@mui/material");
4
5
  const Button_1 = require("../../../components/Button");
5
6
  const styled_1 = require("../../../components/styled");
6
7
  const Typography_1 = require("../../../components/Typography");
8
+ const constants_1 = require("../constants");
7
9
  exports.Wrapper = styled_1.styled.div `
8
10
  width: 400px;
9
11
  padding: ${({ theme }) => theme.spacing(4)};
@@ -23,6 +25,12 @@ exports.FieldRow = styled_1.styled.div `
23
25
  display: flex;
24
26
  gap: ${({ theme }) => theme.spacing(5)};
25
27
  align-items: flex-start;
28
+
29
+ /* Причина игнора: Не критично для отображения */
30
+ /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
31
+ &:has(.${material_1.formLabelClasses.root}) .${constants_1.editableTextClassnames.actions} {
32
+ margin-top: ${({ theme }) => theme.spacing(5)};
33
+ }
26
34
  `;
27
35
  exports.FieldContainer = styled_1.styled.div `
28
36
  flex: 1;
@@ -1,4 +1,5 @@
1
1
  export declare const FIELD_NAME = "editableField";
2
2
  export declare const editableTextClassnames: {
3
3
  showIconOnHover: string;
4
+ actions: string;
4
5
  };
@@ -5,4 +5,5 @@ const createUIKitClassname_1 = require("../../components/utils/createUIKitClassn
5
5
  exports.FIELD_NAME = 'editableField';
6
6
  exports.editableTextClassnames = {
7
7
  showIconOnHover: (0, createUIKitClassname_1.createUIKitClassname)('editable-text__edit-icon_show-on-hover'),
8
+ actions: (0, createUIKitClassname_1.createUIKitClassname)('editable-text__actions'),
8
9
  };
@@ -33,3 +33,7 @@ export declare const StyledPopover: import("@emotion/styled/dist/declarations/sr
33
33
  } & {
34
34
  theme?: import("@emotion/react").Theme | undefined;
35
35
  }, {}, {}>;
36
+ export declare const Wrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
37
+ theme?: import("@emotion/react").Theme | undefined;
38
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
39
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StyledPopover = exports.StyledLoader = exports.StyledEditIcon = exports.DisplayValue = void 0;
3
+ exports.Wrapper = exports.StyledPopover = exports.StyledLoader = exports.StyledEditIcon = exports.DisplayValue = void 0;
4
4
  const Loader_1 = require("../../components/Loader");
5
5
  const Popover_1 = require("../../components/Popover");
6
6
  const styled_1 = require("../../components/styled");
@@ -21,7 +21,8 @@ exports.DisplayValue = (0, styled_1.styled)(Typography_1.Typography, {
21
21
  }) `
22
22
  cursor: pointer;
23
23
 
24
- display: unset;
24
+ display: inline-flex;
25
+ align-items: center;
25
26
 
26
27
  background: ${({ theme, $isEdited, $isLoading }) => getBackgroundColor(theme, $isEdited, $isLoading)};
27
28
  border-radius: ${({ theme }) => theme.shape.small};
@@ -51,9 +52,6 @@ exports.StyledEditIcon = (0, styled_1.styled)(EditOutlineMd_1.EditOutlineMd, {
51
52
  height: 1em;
52
53
  min-height: 16px;
53
54
  margin-right: ${({ $iconPosition, theme }) => $iconPosition === 'left' ? theme.spacing(1) : ''};
54
-
55
- /* Вертикальный отступ для визуального центрирования. Значение подобрано эмпирическим путем */
56
- margin-bottom: calc(-1em / 5);
57
55
  margin-left: ${({ $iconPosition, theme }) => $iconPosition === 'right' ? theme.spacing(1) : ''};
58
56
 
59
57
  font-size: inherit;
@@ -68,11 +66,6 @@ exports.StyledLoader = (0, styled_1.styled)(Loader_1.Loader, {
68
66
  width: 1em;
69
67
  height: 1em;
70
68
  margin-right: ${({ $iconPosition, theme }) => $iconPosition === 'left' ? theme.spacing(1) : ''};
71
-
72
- /* Задаем вертикальный отступ для визуального центрирования */
73
-
74
- /* Значение подобрано эмпирическим путем */
75
- margin-bottom: calc(-1em / 5);
76
69
  margin-left: ${({ $iconPosition, theme }) => $iconPosition === 'right' ? theme.spacing(1) : ''};
77
70
 
78
71
  font-size: inherit;
@@ -80,3 +73,6 @@ exports.StyledLoader = (0, styled_1.styled)(Loader_1.Loader, {
80
73
  exports.StyledPopover = (0, styled_1.styled)(Popover_1.Popover) `
81
74
  margin-top: ${({ theme }) => theme.spacing(2)};
82
75
  `;
76
+ exports.Wrapper = styled_1.styled.span `
77
+ display: contents;
78
+ `;
@@ -3,6 +3,7 @@ import { type EditableTextProps } from '../EditableText';
3
3
  export declare const useLogic: <TValue>({ isLoading, iconPosition, }: EditableTextProps<TValue>) => {
4
4
  isIconOnLeft: boolean;
5
5
  onClose: () => void;
6
+ onWrapperClick: (event: SyntheticEvent) => void;
6
7
  tooltipProps: {
7
8
  title: string | undefined;
8
9
  };
@@ -7,7 +7,11 @@ const useLogic = ({ isLoading, iconPosition, }) => {
7
7
  const { isOpen, anchor, actions } = (0, usePopover_1.usePopover)();
8
8
  const isIconOnLeft = iconPosition === 'left';
9
9
  const tooltipTitle = isLoading ? undefined : NOTE_TEXT;
10
+ const handleWrapperClick = (event) => {
11
+ event.stopPropagation();
12
+ };
10
13
  const handleOpen = (event) => {
14
+ event.preventDefault();
11
15
  if (isLoading) {
12
16
  return;
13
17
  }
@@ -16,6 +20,7 @@ const useLogic = ({ isLoading, iconPosition, }) => {
16
20
  return {
17
21
  isIconOnLeft,
18
22
  onClose: actions.close,
23
+ onWrapperClick: handleWrapperClick,
19
24
  tooltipProps: {
20
25
  title: tooltipTitle,
21
26
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astral/ui",
3
- "version": "4.119.0",
3
+ "version": "4.119.1",
4
4
  "browser": "./index.js",
5
5
  "main": "./node/index.js",
6
6
  "dependencies": {