@astral/ui 4.91.2 → 4.92.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.
- package/components/Alert/Alert.js +2 -2
- package/components/Autocomplete/Autocomplete.js +2 -2
- package/components/Autocomplete/useLogic/useLogic.js +2 -2
- package/components/Badge/Badge.js +2 -2
- package/components/BulletList/BulletList.js +2 -2
- package/components/BulletListItem/BulletListItem.js +2 -2
- package/components/Button/useLogic/useLogic.js +2 -2
- package/components/Checkbox/Icon/Icon.js +2 -2
- package/components/Checkbox/useLogic/useLogic.js +2 -2
- package/components/Chip/ChipStatusIcon/ChipStatusIcon.js +2 -2
- package/components/Chip/useLogic/useLogic.js +2 -2
- package/components/ConfirmDialog/ConfirmDialog.js +2 -2
- package/components/CopyTypography/CopyTypography.js +3 -3
- package/components/DashboardAlert/DashboardAlert.js +2 -2
- package/components/DashboardLayout/DashboardSidebar/useLogic/useLogic.js +2 -2
- package/components/DashboardLayout/Header/styles.js +8 -0
- package/components/DashboardLayout/Main/styles.js +8 -0
- package/components/DashboardSidebarSkeleton/DashboardSidebarSkeleton.js +2 -2
- package/components/DataGrid/Body/Body.js +2 -2
- package/components/DataGrid/Cell/Cell.js +2 -2
- package/components/DataGrid/DataGrid.js +2 -2
- package/components/DataGrid/HeadCell/HeadCell.js +2 -2
- package/components/DataGrid/PinnedSections/Section/useLogic/useLogic.js +2 -2
- package/components/DataGrid/Row/Row.js +3 -3
- package/components/DataGrid/RowBase/RowBase.js +2 -2
- package/components/DataGridInfinite/DataGridInfinite.js +2 -2
- package/components/DataGridPaginationContainer/DataGridPaginationContainer.js +2 -2
- package/components/DescriptionCell/useLogic/useLogic.js +2 -2
- package/components/Dialog/Dialog.js +2 -2
- package/components/Dialog/useLogic/useLogic.js +2 -2
- package/components/DialogActions/DialogActions.js +2 -2
- package/components/DialogContent/DialogContent.js +2 -2
- package/components/DonutChart/DonutChart.js +2 -2
- package/components/EmailField/EmailField.js +2 -2
- package/components/EmailOrPhoneField/EmailOrPhoneField.js +2 -2
- package/components/Filename/Filename.js +2 -2
- package/components/GuidTypography/GuidTypography.js +5 -5
- package/components/HintPopover/HintPopover.js +2 -2
- package/components/IconButton/IconButton.js +2 -2
- package/components/Loader/Loader.js +2 -2
- package/components/MenuItem/MenuItem.js +2 -2
- package/components/MinimalisticPagination/MinimalisticPagination.js +2 -2
- package/components/NewPopover/NewPopover.js +2 -2
- package/components/NewStepper/NewStepper.js +2 -2
- package/components/NewStepper/Step/Step.js +3 -3
- package/components/Notification/NotificationStackContainer/NotificationStackContainer.js +3 -3
- package/components/PageAside/PageAside.js +2 -2
- package/components/PageAsideNavigation/PageAsideNavigation.js +2 -2
- package/components/PageContent/PageContent.js +2 -2
- package/components/PageContent/styles.js +1 -1
- package/components/PageHeader/HeaderContent/HeaderContent.js +2 -2
- package/components/PageHeader/HeaderContent/styles.js +12 -0
- package/components/PageHeader/PageActions/useLogic/useLogic.js +3 -3
- package/components/PageHeader/PageHeader.js +3 -3
- package/components/PageHeader/styles.js +16 -4
- package/components/PageLayout/PageLayout.js +2 -2
- package/components/PageLayout/styles.js +14 -2
- package/components/PageLayoutContainer/PageLayoutContainer.js +2 -2
- package/components/PageLayoutSection/PageLayoutSection.js +2 -2
- package/components/PageLayoutSection/PageLayoutSectionContainer/PageLayoutSectionContainer.js +2 -2
- package/components/PagePinnableAside/PagePinnableAside.js +2 -2
- package/components/PasswordField/PasswordField.js +2 -2
- package/components/PdfViewer/PdfDocument/PdfDocument.js +2 -2
- package/components/PinButton/PinButton.js +2 -2
- package/components/Radio/useLogic/useLogic.js +2 -2
- package/components/RadioCard/RadioCard.js +2 -2
- package/components/SearchField/SearchField.js +2 -2
- package/components/StaticCalendar/StaticDaysCalendar/StaticDaysCalendar.js +2 -2
- package/components/SvgIcon/SvgIcon.js +2 -2
- package/components/Tabs/Tabs.js +2 -2
- package/components/Tag/useLogic/useLogic.js +2 -2
- package/components/TagBadge/TagBadge.js +2 -2
- package/components/TextField/TextField.js +2 -2
- package/components/Tooltip/Tooltip.js +2 -2
- package/components/Tooltip/useLogic/useLogic.js +2 -2
- package/components/Tree/TreeList/TreeList.js +2 -2
- package/components/TreeLikeList/TreeLikeList.js +2 -2
- package/components/Typography/Typography.js +2 -2
- package/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.js +4 -4
- package/components/utils/classNames/classNames.d.ts +1 -1
- package/components/utils/classNames/classNames.js +1 -1
- package/components/utils/cn/cn.d.ts +1 -0
- package/components/utils/cn/cn.js +1 -0
- package/components/utils/cn/index.d.ts +1 -0
- package/components/utils/cn/index.js +1 -0
- package/components/utils/cn/public.d.ts +1 -0
- package/components/utils/cn/public.js +1 -0
- package/hook-form/EditableText/EditableText.js +2 -2
- package/hook-form/FormFilters/AllFiltersButton/useLogic/useLogic.js +2 -2
- package/hook-form/FormMobilePhoneField/FormMobilePhoneField.js +2 -2
- package/hook-form/FormPageLayout/FormPageLayout.js +2 -2
- package/hook-form/FormPageLayoutBase/FormPageLayoutBase.js +2 -2
- package/hook-form/FormWizardPageLayout/FormWizardPageLayout.js +2 -2
- package/node/components/Alert/Alert.js +2 -2
- package/node/components/Autocomplete/Autocomplete.js +2 -2
- package/node/components/Autocomplete/useLogic/useLogic.js +2 -2
- package/node/components/Badge/Badge.js +2 -2
- package/node/components/BulletList/BulletList.js +2 -2
- package/node/components/BulletListItem/BulletListItem.js +2 -2
- package/node/components/Button/useLogic/useLogic.js +2 -2
- package/node/components/Checkbox/Icon/Icon.js +2 -2
- package/node/components/Checkbox/useLogic/useLogic.js +2 -2
- package/node/components/Chip/ChipStatusIcon/ChipStatusIcon.js +2 -2
- package/node/components/Chip/useLogic/useLogic.js +2 -2
- package/node/components/ConfirmDialog/ConfirmDialog.js +2 -2
- package/node/components/CopyTypography/CopyTypography.js +3 -3
- package/node/components/DashboardAlert/DashboardAlert.js +2 -2
- package/node/components/DashboardLayout/DashboardSidebar/useLogic/useLogic.js +2 -2
- package/node/components/DashboardLayout/Header/styles.js +8 -0
- package/node/components/DashboardLayout/Main/styles.js +8 -0
- package/node/components/DashboardSidebarSkeleton/DashboardSidebarSkeleton.js +2 -2
- package/node/components/DataGrid/Body/Body.js +2 -2
- package/node/components/DataGrid/Cell/Cell.js +2 -2
- package/node/components/DataGrid/DataGrid.js +2 -2
- package/node/components/DataGrid/HeadCell/HeadCell.js +2 -2
- package/node/components/DataGrid/PinnedSections/Section/useLogic/useLogic.js +2 -2
- package/node/components/DataGrid/Row/Row.js +3 -3
- package/node/components/DataGrid/RowBase/RowBase.js +2 -2
- package/node/components/DataGridInfinite/DataGridInfinite.js +2 -2
- package/node/components/DataGridPaginationContainer/DataGridPaginationContainer.js +2 -2
- package/node/components/DescriptionCell/useLogic/useLogic.js +2 -2
- package/node/components/Dialog/Dialog.js +2 -2
- package/node/components/Dialog/useLogic/useLogic.js +2 -2
- package/node/components/DialogActions/DialogActions.js +2 -2
- package/node/components/DialogContent/DialogContent.js +2 -2
- package/node/components/DonutChart/DonutChart.js +2 -2
- package/node/components/EmailField/EmailField.js +2 -2
- package/node/components/EmailOrPhoneField/EmailOrPhoneField.js +2 -2
- package/node/components/Filename/Filename.js +2 -2
- package/node/components/GuidTypography/GuidTypography.js +5 -5
- package/node/components/HintPopover/HintPopover.js +2 -2
- package/node/components/IconButton/IconButton.js +2 -2
- package/node/components/Loader/Loader.js +2 -2
- package/node/components/MenuItem/MenuItem.js +2 -2
- package/node/components/MinimalisticPagination/MinimalisticPagination.js +2 -2
- package/node/components/NewPopover/NewPopover.js +2 -2
- package/node/components/NewStepper/NewStepper.js +2 -2
- package/node/components/NewStepper/Step/Step.js +3 -3
- package/node/components/Notification/NotificationStackContainer/NotificationStackContainer.js +3 -3
- package/node/components/PageAside/PageAside.js +2 -2
- package/node/components/PageAsideNavigation/PageAsideNavigation.js +2 -2
- package/node/components/PageContent/PageContent.js +2 -2
- package/node/components/PageContent/styles.js +11 -11
- package/node/components/PageHeader/HeaderContent/HeaderContent.js +2 -2
- package/node/components/PageHeader/HeaderContent/styles.js +12 -0
- package/node/components/PageHeader/PageActions/useLogic/useLogic.js +3 -3
- package/node/components/PageHeader/PageHeader.js +3 -3
- package/node/components/PageHeader/styles.js +16 -4
- package/node/components/PageLayout/PageLayout.js +2 -2
- package/node/components/PageLayout/styles.js +14 -2
- package/node/components/PageLayoutContainer/PageLayoutContainer.js +2 -2
- package/node/components/PageLayoutSection/PageLayoutSection.js +2 -2
- package/node/components/PageLayoutSection/PageLayoutSectionContainer/PageLayoutSectionContainer.js +2 -2
- package/node/components/PagePinnableAside/PagePinnableAside.js +2 -2
- package/node/components/PasswordField/PasswordField.js +2 -2
- package/node/components/PdfViewer/PdfDocument/PdfDocument.js +2 -2
- package/node/components/PinButton/PinButton.js +2 -2
- package/node/components/Radio/useLogic/useLogic.js +2 -2
- package/node/components/RadioCard/RadioCard.js +2 -2
- package/node/components/SearchField/SearchField.js +2 -2
- package/node/components/StaticCalendar/StaticDaysCalendar/StaticDaysCalendar.js +2 -2
- package/node/components/SvgIcon/SvgIcon.js +2 -2
- package/node/components/Tabs/Tabs.js +2 -2
- package/node/components/Tag/useLogic/useLogic.js +2 -2
- package/node/components/TagBadge/TagBadge.js +2 -2
- package/node/components/TextField/TextField.js +2 -2
- package/node/components/Tooltip/Tooltip.js +2 -2
- package/node/components/Tooltip/useLogic/useLogic.js +2 -2
- package/node/components/Tree/TreeList/TreeList.js +2 -2
- package/node/components/TreeLikeList/TreeLikeList.js +2 -2
- package/node/components/Typography/Typography.js +2 -2
- package/node/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.js +4 -4
- package/node/components/utils/classNames/classNames.d.ts +1 -1
- package/node/components/utils/classNames/classNames.js +2 -2
- package/node/components/utils/cn/cn.d.ts +1 -0
- package/node/components/utils/cn/cn.js +8 -0
- package/node/components/utils/cn/index.d.ts +1 -0
- package/node/components/utils/cn/index.js +17 -0
- package/node/components/utils/cn/public.d.ts +1 -0
- package/node/components/utils/cn/public.js +17 -0
- package/node/hook-form/EditableText/EditableText.js +2 -2
- package/node/hook-form/FormFilters/AllFiltersButton/useLogic/useLogic.js +2 -2
- package/node/hook-form/FormMobilePhoneField/FormMobilePhoneField.js +2 -2
- package/node/hook-form/FormPageLayout/FormPageLayout.js +2 -2
- package/node/hook-form/FormPageLayoutBase/FormPageLayoutBase.js +2 -2
- package/node/hook-form/FormWizardPageLayout/FormWizardPageLayout.js +2 -2
- package/package.json +2 -2
|
@@ -6,7 +6,7 @@ import { InfoFillMd } from '../../icons/InfoFillMd';
|
|
|
6
6
|
import { SuccessFillMd } from '../../icons/SuccessFillMd';
|
|
7
7
|
import { WarningFillMd } from '../../icons/WarningFillMd';
|
|
8
8
|
import { Collapse } from '../Collapse';
|
|
9
|
-
import {
|
|
9
|
+
import { cn } from '../utils/cn';
|
|
10
10
|
import { cva } from '../utils/cva';
|
|
11
11
|
import { alertClassnames } from './constants';
|
|
12
12
|
import { BodyWrapper, IconWrapper, StyledGrid, StyledIconButton, StyledTypography, Title, Wrapper, } from './styles';
|
|
@@ -48,7 +48,7 @@ export const Alert = forwardRef(({ children, title, closeText = 'Скрыть',
|
|
|
48
48
|
};
|
|
49
49
|
return (_jsx(IconWrapper, { className: alertClassnames.iconWrapper, children: icon ?? iconMapping[severity] }));
|
|
50
50
|
};
|
|
51
|
-
return (_jsx(Collapse, { in: isVisible, unmountOnExit: unmountOnExit, children: _jsxs(Wrapper, { style: style, className:
|
|
51
|
+
return (_jsx(Collapse, { in: isVisible, unmountOnExit: unmountOnExit, children: _jsxs(Wrapper, { style: style, className: cn(alertClassnames.contentWrapper, alertCva({
|
|
52
52
|
hasTitle: Boolean(title),
|
|
53
53
|
hasCloseButton: Boolean(onClose),
|
|
54
54
|
hasActions: Boolean(actions),
|
|
@@ -10,7 +10,7 @@ import { Loader } from '../Loader';
|
|
|
10
10
|
import { OverflowTypography } from '../OverflowTypography';
|
|
11
11
|
import { TagsList } from '../TagsList';
|
|
12
12
|
import { TextField } from '../TextField';
|
|
13
|
-
import {
|
|
13
|
+
import { cn } from '../utils/cn';
|
|
14
14
|
import { DEFAULT_AUTOCOMPLETE_ELEMENT_ROWS_COUNT, DEFAULT_PLACEHOLDER, INPUT_MIN_WIDTH, } from './constants';
|
|
15
15
|
import { StyledAutocomplete, StyledMenuItem } from './styles';
|
|
16
16
|
import { useLogic } from './useLogic';
|
|
@@ -42,7 +42,7 @@ const AutocompleteInner = (props, ref) => {
|
|
|
42
42
|
...inputParams,
|
|
43
43
|
inputProps: {
|
|
44
44
|
...inputParams.inputProps,
|
|
45
|
-
className:
|
|
45
|
+
className: cn(inputParams?.inputProps?.className, inputProps?.className),
|
|
46
46
|
},
|
|
47
47
|
InputProps: {
|
|
48
48
|
...inputParams.InputProps,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback, useMemo, useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from '../../utils/cn';
|
|
3
3
|
import { autocompleteClassnames } from '../constants';
|
|
4
4
|
import { checkIsInputEmpty } from './utils';
|
|
5
5
|
export const useLogic = ({ value, isOptionEqualToValue: externalOptionEqualToValue, autoHighlight = true, freeSolo, options, multiple, className, loading, isLoadedDataError, loadedDataError = 'Ошибка загрузки данных', noOptionsText = 'Нет данных', onInputChange, }) => {
|
|
@@ -24,7 +24,7 @@ export const useLogic = ({ value, isOptionEqualToValue: externalOptionEqualToVal
|
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
const classnames = useMemo(() => {
|
|
27
|
-
return
|
|
27
|
+
return cn(className, autocompleteClassnames.root, {
|
|
28
28
|
[autocompleteClassnames.multiple]: multiple,
|
|
29
29
|
[autocompleteClassnames.emptyValue]: isValueEmpty,
|
|
30
30
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from '../utils/cn';
|
|
3
3
|
import { badgeClassnames } from './constants';
|
|
4
4
|
import { StyledBadge } from './styles';
|
|
5
5
|
import { useLogic } from './useLogic';
|
|
6
6
|
export const Badge = ({ children, color, max = 99, withBorder = true, variantColor = 'contained', classes, className, ...props }) => {
|
|
7
7
|
const { badgeClasses } = useLogic({ classes });
|
|
8
|
-
return (_jsx(StyledBadge, { "$customColor": color, max: max, "$withBorder": withBorder, "$variantColor": variantColor, classes: badgeClasses, className:
|
|
8
|
+
return (_jsx(StyledBadge, { "$customColor": color, max: max, "$withBorder": withBorder, "$variantColor": variantColor, classes: badgeClasses, className: cn(badgeClassnames.root, className), ...props, children: children }));
|
|
9
9
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from '../utils/cn';
|
|
4
4
|
import { bulletListClassnames } from './constants';
|
|
5
5
|
import { List, Wrapper } from './styles';
|
|
6
6
|
/**
|
|
@@ -8,7 +8,7 @@ import { List, Wrapper } from './styles';
|
|
|
8
8
|
*/
|
|
9
9
|
export const BulletList = (props) => {
|
|
10
10
|
const { children, hideFirstBullet, className } = props;
|
|
11
|
-
const classnames = useMemo(() =>
|
|
11
|
+
const classnames = useMemo(() => cn(className, bulletListClassnames.root, {
|
|
12
12
|
[bulletListClassnames.hideFirstBullet]: hideFirstBullet,
|
|
13
13
|
}), [hideFirstBullet]);
|
|
14
14
|
return (_jsx(Wrapper, { children: _jsx(List, { className: classnames, children: children }) }));
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { Typography } from '../Typography';
|
|
4
|
-
import {
|
|
4
|
+
import { cn } from '../utils/cn';
|
|
5
5
|
import { Icon, Wrapper } from './styles';
|
|
6
6
|
/**
|
|
7
7
|
* Элемент с маркерами
|
|
8
8
|
*/
|
|
9
9
|
export const BulletListItem = forwardRef((props, ref) => {
|
|
10
10
|
const { children, className, ...restProps } = props;
|
|
11
|
-
return (_jsxs(Wrapper, { ref: ref, className:
|
|
11
|
+
return (_jsxs(Wrapper, { ref: ref, className: cn(className), children: [_jsx(Icon, {}), _jsx(Typography, { component: "span", ...restProps, children: children })] }));
|
|
12
12
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from '../../utils/cn';
|
|
3
3
|
import { buttonClassnames, buttonColorClassnames } from '../constants';
|
|
4
4
|
import { ButtonColors, ButtonVariants } from '../enums';
|
|
5
5
|
export const useLogic = ({ loading, selected, variant = ButtonVariants.Contained, color = variant === ButtonVariants.Text
|
|
@@ -11,7 +11,7 @@ export const useLogic = ({ loading, selected, variant = ButtonVariants.Contained
|
|
|
11
11
|
}
|
|
12
12
|
return 'inverted';
|
|
13
13
|
}, [variant]);
|
|
14
|
-
const classnames = useMemo(() =>
|
|
14
|
+
const classnames = useMemo(() => cn(buttonClassnames.root, buttonColorClassnames[color], className, {
|
|
15
15
|
[buttonClassnames.loading]: loading,
|
|
16
16
|
[buttonClassnames.disabled]: disabled,
|
|
17
17
|
[buttonClassnames.selected]: selected,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { SvgIcon } from '../../SvgIcon';
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from '../../utils/cn';
|
|
4
4
|
import { checkboxClassnames } from '../constants';
|
|
5
|
-
export const Icon = ({ ...props }) => (_jsxs(SvgIcon, { size: "sm", viewBox: "0 0 16 16", ...props, children: [_jsx("rect", { className: checkboxClassnames.outline, x: "0.5", y: "0.5", width: "15", height: "15", rx: "3.5" }), _jsx("path", { className:
|
|
5
|
+
export const Icon = ({ ...props }) => (_jsxs(SvgIcon, { size: "sm", viewBox: "0 0 16 16", ...props, children: [_jsx("rect", { className: checkboxClassnames.outline, x: "0.5", y: "0.5", width: "15", height: "15", rx: "3.5" }), _jsx("path", { className: cn(checkboxClassnames.symbol, checkboxClassnames.iconChecked), d: "M3.892 8.64a.75.75 0 0 1 1.003-1.112l.058.052 1.97 1.97 4.469-4.47.056-.052a.75.75 0 0 1 1.056 1.056l-.051.056-5 5a.75.75 0 0 1-1.061 0l-2.5-2.5Z" }), _jsx("path", { className: cn(checkboxClassnames.symbol, checkboxClassnames.iconIndeterminate), d: "M12 7.25a.75.75 0 0 1 0 1.5H4a.75.75 0 0 1 0-1.5h8Z" })] }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMemo, useState } from 'react';
|
|
2
2
|
import { useUpdateEffect } from '../../useUpdateEffect';
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from '../../utils/cn';
|
|
4
4
|
import { checkboxClassnames } from '../constants';
|
|
5
5
|
export const useLogic = ({ checked = false, indeterminate = false, disabled = false, isError = false, defaultChecked = false, onChange: propsOnChange, className: propClassNames, role, style, name, inputRef, value, id, ...restProps }) => {
|
|
6
6
|
const [isChecked, setIsChecked] = useState(defaultChecked || checked);
|
|
@@ -23,7 +23,7 @@ export const useLogic = ({ checked = false, indeterminate = false, disabled = fa
|
|
|
23
23
|
}
|
|
24
24
|
return 'inherit';
|
|
25
25
|
}, [disabled, isError, isChecked, indeterminate]);
|
|
26
|
-
const className = useMemo(() =>
|
|
26
|
+
const className = useMemo(() => cn(checkboxClassnames.root, isChecked ? checkboxClassnames.checked : '', disabled ? checkboxClassnames.disabled : '', indeterminate ? checkboxClassnames.indeterminate : '', propClassNames), [isChecked, indeterminate, disabled, propClassNames]);
|
|
27
27
|
return {
|
|
28
28
|
onChange,
|
|
29
29
|
color,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from '../../utils/cn';
|
|
4
4
|
import { chipStatusIconClassnames } from './constants';
|
|
5
5
|
import { StatusIcon } from './styled';
|
|
6
6
|
export const ChipStatusIcon = ({ status }) => {
|
|
7
7
|
const classnames = useMemo(() => {
|
|
8
|
-
return
|
|
8
|
+
return cn(chipStatusIconClassnames.root, {
|
|
9
9
|
[chipStatusIconClassnames.success]: status === 'success',
|
|
10
10
|
[chipStatusIconClassnames.warning]: status === 'warning',
|
|
11
11
|
[chipStatusIconClassnames.error]: status === 'error',
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useContext, useMemo } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from '../../utils/cn';
|
|
3
3
|
import { ChipContext } from '../ChipProvider';
|
|
4
4
|
import { chipClassnames } from '../constants';
|
|
5
5
|
export const useLogic = ({ className, isDisabled, isSelected, onChange, size = 'medium', label, status, icon, counter, endAdornment, maxCount, name: nameProp, value: valueProp, }) => {
|
|
6
6
|
const { mode, name: contextName } = useContext(ChipContext);
|
|
7
7
|
const isMultiple = mode === 'multiple';
|
|
8
8
|
const inputName = nameProp ?? contextName;
|
|
9
|
-
const classnames = useMemo(() =>
|
|
9
|
+
const classnames = useMemo(() => cn(className, chipClassnames.root, {
|
|
10
10
|
[chipClassnames.disabled]: isDisabled,
|
|
11
11
|
[chipClassnames.selected]: isSelected,
|
|
12
12
|
[chipClassnames.sizeSmall]: size === 'small',
|
|
@@ -4,7 +4,7 @@ import { Dialog } from '../Dialog';
|
|
|
4
4
|
import { DialogActions } from '../DialogActions';
|
|
5
5
|
import { DialogContent } from '../DialogContent';
|
|
6
6
|
import { DialogContentText } from '../DialogContentText';
|
|
7
|
-
import {
|
|
7
|
+
import { cn } from '../utils/cn';
|
|
8
8
|
import { confirmDialogClassnames } from './constants';
|
|
9
9
|
import { CancelButton } from './styles';
|
|
10
10
|
import { useLogic } from './useLogic';
|
|
@@ -13,5 +13,5 @@ export const ConfirmDialog = (props) => {
|
|
|
13
13
|
const { open, title, description, actions, onClose, size = 'sm', ...restProps } = props;
|
|
14
14
|
const { text: confirmText, ...confirmButtonProps } = actions.confirm;
|
|
15
15
|
const { text: cancelText, variant, onClick, ...restCancelProps } = actions.cancel || {};
|
|
16
|
-
return (_jsxs(Dialog, { size: size, title: title, open: open, onClose: onClose, ...restProps, children: [description && (_jsx(DialogContent, { children: typeof description === 'string' ? (_jsx(DialogContentText, { children: description })) : (description) })), _jsxs(DialogActions, { children: [isShowCancelButton && (_jsx(CancelButton, { ...restCancelProps, ...cancelButtonProps, className:
|
|
16
|
+
return (_jsxs(Dialog, { size: size, title: title, open: open, onClose: onClose, ...restProps, children: [description && (_jsx(DialogContent, { children: typeof description === 'string' ? (_jsx(DialogContentText, { children: description })) : (description) })), _jsxs(DialogActions, { children: [isShowCancelButton && (_jsx(CancelButton, { ...restCancelProps, ...cancelButtonProps, className: cn(actions.cancel?.className, confirmDialogClassnames.cancelButton), children: cancelText })), _jsx(Button, { ...confirmButtonProps, className: cn(confirmButtonProps.className, confirmDialogClassnames.confirmButton), children: confirmText })] })] }));
|
|
17
17
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Tooltip } from '../Tooltip';
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from '../utils/cn';
|
|
4
4
|
import { copyTypographyClassnames } from './constants';
|
|
5
5
|
import { StyledCopyIcon, TypographyWrapper, Wrapper } from './styles';
|
|
6
6
|
import { useLogic } from './useLogic';
|
|
7
7
|
export const CopyTypography = (props) => {
|
|
8
8
|
const { handleMouseLeave, handleClick, tooltipTitle, isIconOnLeft, isIconOnRight, restProps, copyPosition, color, showCopyIcon, isOverflow, children, tooltipProps, } = useLogic(props);
|
|
9
|
-
const renderIcon = () => (_jsx(StyledCopyIcon, { size: "sm", "$copyPosition": copyPosition, color: color, className:
|
|
9
|
+
const renderIcon = () => (_jsx(StyledCopyIcon, { size: "sm", "$copyPosition": copyPosition, color: color, className: cn({
|
|
10
10
|
[copyTypographyClassnames.showIconOnHover]: showCopyIcon === 'onHover',
|
|
11
11
|
}) }));
|
|
12
|
-
return (_jsx(Tooltip, { title: tooltipTitle, disableInteractive: true, placement: "bottom", ...tooltipProps, children: _jsxs(Wrapper, { onMouseLeave: handleMouseLeave, onClick: handleClick, component: "div", color: color, ...restProps, children: [isIconOnLeft && renderIcon(), _jsx(TypographyWrapper, { className:
|
|
12
|
+
return (_jsx(Tooltip, { title: tooltipTitle, disableInteractive: true, placement: "bottom", ...tooltipProps, children: _jsxs(Wrapper, { onMouseLeave: handleMouseLeave, onClick: handleClick, component: "div", color: color, ...restProps, children: [isIconOnLeft && renderIcon(), _jsx(TypographyWrapper, { className: cn({
|
|
13
13
|
[copyTypographyClassnames.overflow]: isOverflow,
|
|
14
14
|
}), children: children }), isIconOnRight && renderIcon()] }) }));
|
|
15
15
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Typography } from '../Typography';
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from '../utils/cn';
|
|
4
4
|
import { dashboardAlertClassnames } from './constants';
|
|
5
5
|
import { StyledAlert, StyledButton } from './styles';
|
|
6
6
|
/**
|
|
@@ -13,5 +13,5 @@ import { StyledAlert, StyledButton } from './styles';
|
|
|
13
13
|
export const DashboardAlert = (props) => {
|
|
14
14
|
const { linkButtonProps, children, isShow, className, ...restProps } = props;
|
|
15
15
|
const { name, color: linkButtonColor, ...restButtonProps } = linkButtonProps || {};
|
|
16
|
-
return (_jsx(StyledAlert, { className:
|
|
16
|
+
return (_jsx(StyledAlert, { className: cn(dashboardAlertClassnames.root, className), isShow: isShow, ...restProps, children: _jsxs(Typography, { variant: "body1", children: [children, "\u00A0", linkButtonProps && (_jsx(StyledButton, { variant: "link", ...restButtonProps, children: name }))] }) }));
|
|
17
17
|
};
|
|
@@ -3,7 +3,7 @@ import { DashboardContext } from '../../../DashboardContext';
|
|
|
3
3
|
import { DashboardSidebarContext } from '../../../DashboardSidebarProvider';
|
|
4
4
|
import { useTheme } from '../../../theme/hooks/useTheme';
|
|
5
5
|
import { useViewportType } from '../../../useViewportType';
|
|
6
|
-
import {
|
|
6
|
+
import { cn } from '../../../utils/cn';
|
|
7
7
|
import { dashboardLayoutHeaderClassnames } from '../../Header';
|
|
8
8
|
import { dashboardLayoutMainClassnames } from '../../Main';
|
|
9
9
|
import { dashboardSidebarClassnames } from '../constants';
|
|
@@ -82,7 +82,7 @@ export const useLogic = (props) => {
|
|
|
82
82
|
}
|
|
83
83
|
};
|
|
84
84
|
}, [collapsedIn, isPinned]);
|
|
85
|
-
const classnames =
|
|
85
|
+
const classnames = cn(className, dashboardSidebarClassnames.root);
|
|
86
86
|
return {
|
|
87
87
|
isPinned,
|
|
88
88
|
isMobile,
|
|
@@ -95,6 +95,10 @@ export const HeaderContentSection = styled(HeaderSection) `
|
|
|
95
95
|
}
|
|
96
96
|
`;
|
|
97
97
|
export const ProductSwitcherWrapper = styled.div `
|
|
98
|
+
&:empty {
|
|
99
|
+
display: none;
|
|
100
|
+
}
|
|
101
|
+
|
|
98
102
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
99
103
|
display: none;
|
|
100
104
|
}
|
|
@@ -131,6 +135,10 @@ export const HeaderContent = styled.div `
|
|
|
131
135
|
* Обертка для элементов которые должны быть в мобильном хедере или помещены в sidebar.
|
|
132
136
|
*/
|
|
133
137
|
export const PriorityFeatureWrapper = styled.div `
|
|
138
|
+
&&:empty {
|
|
139
|
+
display: none;
|
|
140
|
+
}
|
|
141
|
+
|
|
134
142
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
135
143
|
display: flex;
|
|
136
144
|
justify-content: flex-end;
|
|
@@ -21,8 +21,16 @@ export const AlertWrapper = styled.div `
|
|
|
21
21
|
}
|
|
22
22
|
`;
|
|
23
23
|
export const AlertContainer = styled.div `
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
gap: ${({ theme }) => theme.spacing(2)};
|
|
27
|
+
|
|
24
28
|
margin-bottom: ${({ theme }) => theme.spacing(4)};
|
|
25
29
|
|
|
30
|
+
&:empty {
|
|
31
|
+
display: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
26
34
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
27
35
|
margin: ${({ theme }) => theme.spacing(3, 4, 1)};
|
|
28
36
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { dashboardSidebarClassnames } from '../DashboardLayout/DashboardSidebar/constants';
|
|
3
3
|
import { Skeleton } from '../Skeleton';
|
|
4
|
-
import {
|
|
4
|
+
import { cn } from '../utils/cn';
|
|
5
5
|
import { ItemWrapper, ListWrapper, SkeletonDescription, Wrapper, } from './styles';
|
|
6
6
|
import { useLogic } from './useLogic';
|
|
7
7
|
export const DashboardSidebarSkeleton = () => {
|
|
8
8
|
const { isPinned } = useLogic();
|
|
9
|
-
return (_jsxs(Wrapper, { "$isPinned": isPinned, className:
|
|
9
|
+
return (_jsxs(Wrapper, { "$isPinned": isPinned, className: cn(dashboardSidebarClassnames.root), children: [_jsx(Skeleton, { shapeSize: isPinned ? 'medium' : 'small', height: 40, variant: "rounded" }), _jsxs(ListWrapper, { "$isPinned": isPinned, children: [_jsxs(ItemWrapper, { children: [_jsx(Skeleton, { height: 20, width: 20, variant: "rounded", shapeSize: "small" }), _jsx(SkeletonDescription, { height: 14, width: 174, variant: "rounded", "$isPinned": isPinned })] }), _jsxs(ItemWrapper, { children: [_jsx(Skeleton, { height: 20, width: 20, variant: "rounded", shapeSize: "small" }), _jsx(SkeletonDescription, { height: 14, width: 174, variant: "rounded", "$isPinned": isPinned })] }), _jsxs(ItemWrapper, { children: [_jsx(Skeleton, { height: 20, width: 20, variant: "rounded", shapeSize: "small" }), _jsx(SkeletonDescription, { height: 14, width: 174, variant: "rounded", "$isPinned": isPinned })] }), isPinned && (_jsxs(ItemWrapper, { children: [_jsx(Skeleton, { height: 20, width: 20, variant: "rounded", shapeSize: "small" }), _jsx(SkeletonDescription, { height: 14, width: 174, variant: "rounded", "$isPinned": isPinned })] }))] })] }));
|
|
10
10
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from '../../utils/cn';
|
|
3
3
|
import { cva } from '../../utils/cva';
|
|
4
4
|
import { CustomRowWrapper } from '../CustomRowWrapper';
|
|
5
5
|
import { Row } from '../Row';
|
|
@@ -23,5 +23,5 @@ export const Body = ({ rows, selectedRows = [], minDisplayRows, keyId, noDataPla
|
|
|
23
23
|
const { children, options } = row;
|
|
24
24
|
return (_jsx(RowContextProvider, { row: row, onSelectRow: onSelectRow, onRowEnter: onRowEnter, onRowLeave: onRowLeave, registerRowElement: registerRowElement, unregisterRowElement: unregisterRowElement, isSelectable: isSelectable, isSelected: isSelected, children: renderRow ? (_jsx(CustomRowWrapper, { index: index, renderRow: renderRow, row: row })) : (_jsx(Row, { row: row, options: options, keyId: keyId, level: INITIAL_LEVEL, nestedChildren: children, isSelected: isSelected, columns: columns, isSelectable: isSelectable, onSelectRow: onSelectRow, onRowEnter: onRowEnter, onRowLeave: onRowLeave, registerRowElement: registerRowElement, unregisterRowElement: unregisterRowElement, ...rowProps }, rowId)) }, rowId));
|
|
25
25
|
});
|
|
26
|
-
return (_jsx(Wrapper, { className:
|
|
26
|
+
return (_jsx(Wrapper, { className: cn(className, bodyCva({ disableMinHeight })), style: bodyCssVars, children: rows.length ? renderedRows : noDataPlaceholder }));
|
|
27
27
|
};
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
3
|
import { useHidePersonalData } from '../../personalDataSecurity';
|
|
4
4
|
import { useViewportType } from '../../useViewportType';
|
|
5
|
-
import {
|
|
5
|
+
import { cn } from '../../utils/cn';
|
|
6
6
|
import { cva } from '../../utils/cva';
|
|
7
7
|
import { getInertProps } from '../../utils/getInertProps';
|
|
8
8
|
import { CellInner } from './CellInner';
|
|
@@ -38,7 +38,7 @@ export const Cell = (props) => {
|
|
|
38
38
|
const hidePersonalDataClassname = useHidePersonalData({
|
|
39
39
|
isEnabled: isHidePersonalData === true,
|
|
40
40
|
});
|
|
41
|
-
const cellNode = (_jsx(Wrapper, { className:
|
|
41
|
+
const cellNode = (_jsx(Wrapper, { className: cn(className, hidePersonalDataClassname, cellCva({
|
|
42
42
|
isHideOnMobile: cell.isHideOnMobile || isHideOnMobile,
|
|
43
43
|
isDisabled,
|
|
44
44
|
withStartAdornment: hasStartAdornment,
|
|
@@ -3,7 +3,7 @@ import { useCallback, useContext } from 'react';
|
|
|
3
3
|
import { ConfigContext } from '../ConfigProvider';
|
|
4
4
|
import { ContentState } from '../ContentState';
|
|
5
5
|
import { selfContainedClassname } from '../constants';
|
|
6
|
-
import {
|
|
6
|
+
import { cn } from '../utils/cn';
|
|
7
7
|
import { cva } from '../utils/cva';
|
|
8
8
|
import { getInertProps } from '../utils/getInertProps';
|
|
9
9
|
import { Body } from './Body';
|
|
@@ -98,7 +98,7 @@ export const DataGrid = (props) => {
|
|
|
98
98
|
isDisabled: isDataGridDisabled,
|
|
99
99
|
}), isDisabled: isDataGridDisabled, headProps: headProps, gridColumns: gridColumns, bodyProps: commonBodyProps, isNoData: isNoData }) }));
|
|
100
100
|
};
|
|
101
|
-
return (_jsx(DataGridContextProvider, { isLoading: isLoading, isTabularNums: isTabularNums, gridColumns: gridColumns, emptyCellValue: emptyCellValue, activeRowId: activeRowId, keyId: keyId, columns: columns, onRowClick: onRowClick, mobileDisplayVariant: mobileDisplayVariant, children: _jsxs(Container, { ref: containerRef, style: containerCssVars, className:
|
|
101
|
+
return (_jsx(DataGridContextProvider, { isLoading: isLoading, isTabularNums: isTabularNums, gridColumns: gridColumns, emptyCellValue: emptyCellValue, activeRowId: activeRowId, keyId: keyId, columns: columns, onRowClick: onRowClick, mobileDisplayVariant: mobileDisplayVariant, children: _jsxs(Container, { ref: containerRef, style: containerCssVars, className: cn(dataGridClassName, dataGridCva({
|
|
102
102
|
isAllowHorizontalScroll,
|
|
103
103
|
hasPinnedColumns,
|
|
104
104
|
gridViewMode,
|
|
@@ -4,7 +4,7 @@ import { SortDownFillSm } from '../../../icons/SortDownFillSm';
|
|
|
4
4
|
import { SortFillSm } from '../../../icons/SortFillSm';
|
|
5
5
|
import { SortUpFillSm } from '../../../icons/SortUpFillSm';
|
|
6
6
|
import { OverflowTypography } from '../../OverflowTypography';
|
|
7
|
-
import {
|
|
7
|
+
import { cn } from '../../utils/cn';
|
|
8
8
|
import { cva } from '../../utils/cva';
|
|
9
9
|
import { headCellClassnames } from './constants';
|
|
10
10
|
import { Wrapper } from './styles';
|
|
@@ -43,5 +43,5 @@ export const HeadCell = (props) => {
|
|
|
43
43
|
return _jsx(SortFillSm, {});
|
|
44
44
|
}
|
|
45
45
|
}, [sorting, isSortable, field]);
|
|
46
|
-
return (_jsxs(Wrapper, { onClick: handleSortClick, className:
|
|
46
|
+
return (_jsxs(Wrapper, { onClick: handleSortClick, className: cn(className, headCellCva({ isSortable, align, hasStartAdornment })), style: headCellCssVars, children: [startAdornment && startAdornment, _jsx(OverflowTypography, { rowsCount: 2, variant: "pointer", component: "p", children: label }), sortIcon] }));
|
|
47
47
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from '../../../../utils/cn';
|
|
3
3
|
import { dataGridClassnames } from '../../../constants';
|
|
4
4
|
import { getFlattenColumns, getGridTemplateColumns } from '../../../utils';
|
|
5
5
|
export const useLogic = ({ position, isNoData, columns, }) => {
|
|
6
|
-
const classnames = useMemo(() =>
|
|
6
|
+
const classnames = useMemo(() => cn({
|
|
7
7
|
[dataGridClassnames.leftPinnedSection]: position === 'left',
|
|
8
8
|
[dataGridClassnames.rightPinnedSection]: position === 'right',
|
|
9
9
|
[dataGridClassnames.pinnedSectionNoData]: isNoData && position === 'center',
|
|
@@ -3,7 +3,7 @@ import { Fragment, memo, useCallback } from 'react';
|
|
|
3
3
|
import { BottomDrawer } from '../../BottomDrawer';
|
|
4
4
|
import { Checkbox } from '../../Checkbox';
|
|
5
5
|
import { Tooltip } from '../../Tooltip';
|
|
6
|
-
import {
|
|
6
|
+
import { cn } from '../../utils/cn';
|
|
7
7
|
import { cva } from '../../utils/cva';
|
|
8
8
|
import { getInertProps } from '../../utils/getInertProps';
|
|
9
9
|
import { dataGridCellClassnames } from '../Cell';
|
|
@@ -86,7 +86,7 @@ const RowInner = (props) => {
|
|
|
86
86
|
}), children: label }), children.map((child, childIndex) => {
|
|
87
87
|
const childCellId = `${cellId}-${childIndex}`;
|
|
88
88
|
const shouldRenderStartAdornment = isFirstCell && childIndex === 0;
|
|
89
|
-
return (_jsx(CellStyled, { row: row, cell: child, isHideOnMobile: isHideOnMobile, emptyCellValue: emptyCellValue, isDisabled: isDisabledCell, startAdornment: shouldRenderStartAdornment && renderStartAdornment(), isHidePersonalData: child.isHidePersonalData, hasNestedChildren: Boolean(nestedChildren?.length), className:
|
|
89
|
+
return (_jsx(CellStyled, { row: row, cell: child, isHideOnMobile: isHideOnMobile, emptyCellValue: emptyCellValue, isDisabled: isDisabledCell, startAdornment: shouldRenderStartAdornment && renderStartAdornment(), isHidePersonalData: child.isHidePersonalData, hasNestedChildren: Boolean(nestedChildren?.length), className: cn(dataGridCellClassnames.grouped), rootRowElement: rootRowElement, href: href, target: target }, childCellId));
|
|
90
90
|
})] }, cellId));
|
|
91
91
|
}
|
|
92
92
|
return (_jsx(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));
|
|
@@ -121,7 +121,7 @@ const RowInner = (props) => {
|
|
|
121
121
|
onRowEnter,
|
|
122
122
|
onRowLeave,
|
|
123
123
|
]);
|
|
124
|
-
return (_jsxs(Wrapper, { className:
|
|
124
|
+
return (_jsxs(Wrapper, { className: cn(className, rootCva({
|
|
125
125
|
isShowConnector,
|
|
126
126
|
mobileDisplayVariant,
|
|
127
127
|
hasNestedChildren: Boolean(nestedChildren?.length),
|
|
@@ -3,7 +3,7 @@ import { memo, useCallback } from 'react';
|
|
|
3
3
|
import { BottomDrawer } from '../../BottomDrawer';
|
|
4
4
|
import { Checkbox } from '../../Checkbox';
|
|
5
5
|
import { Tooltip } from '../../Tooltip';
|
|
6
|
-
import {
|
|
6
|
+
import { cn } from '../../utils/cn';
|
|
7
7
|
import { cva } from '../../utils/cva';
|
|
8
8
|
import { getInertProps } from '../../utils/getInertProps';
|
|
9
9
|
import { Cell } from '../Cell';
|
|
@@ -65,5 +65,5 @@ export const RowBase = memo((props) => {
|
|
|
65
65
|
renderStartAdornment,
|
|
66
66
|
checkboxProps.checked,
|
|
67
67
|
]);
|
|
68
|
-
return (_jsxs(Wrapper, { className:
|
|
68
|
+
return (_jsxs(Wrapper, { className: cn(className, rootCva({ mobileDisplayVariant })), style: rowBaseVars, ...dataGridInfiniteItemProps, children: [_jsx(Tooltip, { ...tooltipProps, children: _jsx(ContentWrapper, { ref: rowRef, onPointerEnter: () => onRowEnter?.(rowId), onPointerLeave: (event) => onRowLeave?.(rowId, event.nativeEvent), className: contentWrapperCva({ isHovered, isActive }), [DISABLE_ROW_ATTR]: isDisabled, onClick: handleRowClick, children: renderCells() }) }), customContent, _jsx(BottomDrawer, { ...drawerProps, children: _jsx(BottomDrawerContent, { children: drawerContent }) })] }, `row-base-${rowId}`));
|
|
69
69
|
});
|
|
@@ -10,7 +10,7 @@ import { DataGridContextProvider } from '../DataGrid/DataGridContext';
|
|
|
10
10
|
import { Variant } from '../DataGrid/enums';
|
|
11
11
|
import { Head } from '../DataGrid/Head';
|
|
12
12
|
import { Loader } from '../Loader';
|
|
13
|
-
import {
|
|
13
|
+
import { cn } from '../utils/cn';
|
|
14
14
|
import { cva } from '../utils/cva';
|
|
15
15
|
import { getInertProps } from '../utils/getInertProps';
|
|
16
16
|
import { dataGridInfiniteClassnames, OVERSCAN_COUNT } from './constants';
|
|
@@ -48,7 +48,7 @@ export const DataGridInfinite = (props) => {
|
|
|
48
48
|
const { isInitialExpanded = false, expandedLevel = EXPANDED_LEVEL_BY_DEFAULT, initialVisibleChildrenCount = INITIAL_OPENED_NESTED_CHILDREN_COUNT_BY_DEFAULT, } = treeRenderConfig || {};
|
|
49
49
|
const { isSelectable } = rowProps;
|
|
50
50
|
const TableContainer = isDisabled ? DisabledDataGridWrapper : DataGridWrapper;
|
|
51
|
-
return (_jsx(DataGridInfiniteContextProvider, { renderRow: renderRow, onSelectRow: handleSelectRow, variant: variant, isInitialExpanded: isInitialExpanded, expandedLevel: expandedLevel, initialVisibleChildrenCount: initialVisibleChildrenCount, isSelectable: isSelectable, selectedRows: selectedRows, moreButtonColumnPosition: moreButtonColumnPosition, isVisibleCollapseButton: isVisibleCollapseButton, children: _jsx(DataGridContextProvider, { gridColumns: gridColumns, emptyCellValue: emptyCellValue, activeRowId: activeRowId, columns: columns, keyId: keyId, isTabularNums: isTabularNums, onRowClick: onRowClick, mobileDisplayVariant: mobileDisplayVariant, children: _jsxs(StyledContainer, { style: containerCssVars, className:
|
|
51
|
+
return (_jsx(DataGridInfiniteContextProvider, { renderRow: renderRow, onSelectRow: handleSelectRow, variant: variant, isInitialExpanded: isInitialExpanded, expandedLevel: expandedLevel, initialVisibleChildrenCount: initialVisibleChildrenCount, isSelectable: isSelectable, selectedRows: selectedRows, moreButtonColumnPosition: moreButtonColumnPosition, isVisibleCollapseButton: isVisibleCollapseButton, children: _jsx(DataGridContextProvider, { gridColumns: gridColumns, emptyCellValue: emptyCellValue, activeRowId: activeRowId, columns: columns, keyId: keyId, isTabularNums: isTabularNums, onRowClick: onRowClick, mobileDisplayVariant: mobileDisplayVariant, children: _jsxs(StyledContainer, { style: containerCssVars, className: cn(dataGridInfiniteCva({
|
|
52
52
|
hasGroupedColumns,
|
|
53
53
|
gridViewMode,
|
|
54
54
|
mobileDisplayVariant,
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { MenuItem } from '../MenuItem';
|
|
3
3
|
import { Select } from '../Select';
|
|
4
4
|
import { Typography } from '../Typography';
|
|
5
|
-
import {
|
|
5
|
+
import { cn } from '../utils/cn';
|
|
6
6
|
import { cva } from '../utils/cva';
|
|
7
7
|
import { DEFAULT_ROWS_PER_PAGE, DEFAULT_ROWS_PER_PAGE_OPTION, paginationClassnames, } from './constants';
|
|
8
8
|
import { PaginationWrapper, Range, RangeWrapper } from './styles';
|
|
@@ -16,7 +16,7 @@ const rootCva = cva(paginationClassnames.root, {
|
|
|
16
16
|
});
|
|
17
17
|
export const DataGridPaginationContainer = ({ pagination, className, formattedRange, rowsPerPageOptions = DEFAULT_ROWS_PER_PAGE_OPTION, onSetCountPerPage, rowsPerPage = DEFAULT_ROWS_PER_PAGE, isDisabled, }) => {
|
|
18
18
|
const { handleChangeRowsPerPage } = useLogic({ onSetCountPerPage });
|
|
19
|
-
return (_jsxs(PaginationWrapper, { className:
|
|
19
|
+
return (_jsxs(PaginationWrapper, { className: cn(className, rootCva({
|
|
20
20
|
leadingContent: Boolean(onSetCountPerPage || formattedRange),
|
|
21
21
|
})), children: [(onSetCountPerPage || formattedRange) && (_jsxs(RangeWrapper, { children: [onSetCountPerPage && (_jsxs(_Fragment, { children: [_jsx(Typography, { variant: "body1", children: "\u0421\u0442\u0440\u043E\u043A \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0435:" }), _jsx(Select, { size: "small", value: rowsPerPage, disabled: isDisabled, isShowClearButton: false, onChange: handleChangeRowsPerPage, children: rowsPerPageOptions.map((option) => (_jsx(MenuItem, { value: option, children: option }, option))) })] })), formattedRange && _jsx(Range, { variant: "body1", children: formattedRange() })] })), pagination && pagination] }));
|
|
22
22
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from '../../utils/cn';
|
|
3
3
|
import { descriptionCellClassnames } from '../constants';
|
|
4
4
|
export const useLogic = ({ icon, iconPosition = 'left' }) => {
|
|
5
|
-
const classnames = useMemo(() =>
|
|
5
|
+
const classnames = useMemo(() => cn(descriptionCellClassnames.root, {
|
|
6
6
|
[descriptionCellClassnames.hasIcon]: Boolean(icon),
|
|
7
7
|
[descriptionCellClassnames.iconRight]: Boolean(icon) && iconPosition === 'right',
|
|
8
8
|
}), [icon, iconPosition]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { BottomDrawer } from '../BottomDrawer';
|
|
3
3
|
import { DialogTitle } from '../DialogTitle';
|
|
4
|
-
import {
|
|
4
|
+
import { cn } from '../utils/cn';
|
|
5
5
|
import { cva } from '../utils/cva';
|
|
6
6
|
import { dialogClassnames } from './constants';
|
|
7
7
|
import { StyledDialog } from './styles';
|
|
@@ -22,5 +22,5 @@ export const Dialog = ({ children, title, disableBackdropClick, onClose, size =
|
|
|
22
22
|
if (isMobile) {
|
|
23
23
|
return (_jsx(BottomDrawer, { onClose: handleClose, title: title, headerContent: headerContent, ...props, children: children }));
|
|
24
24
|
}
|
|
25
|
-
return (_jsxs(StyledDialog, { "$size": size, onClose: handleClose, className:
|
|
25
|
+
return (_jsxs(StyledDialog, { "$size": size, onClose: handleClose, className: cn(dialogCva({ withoutTitle: !title }), className), classes: dialogClasses, ...props, children: [title && (_jsx(DialogTitle, { onClose: onClose, headerContent: headerContent, children: title })), children] }));
|
|
26
26
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useViewportType } from '../../useViewportType';
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from '../../utils/cn';
|
|
3
3
|
import { dialogClassnames } from '../constants';
|
|
4
4
|
export const useLogic = ({ onClose, disableBackdropClick, classes, }) => {
|
|
5
5
|
const { isMobile } = useViewportType();
|
|
@@ -12,7 +12,7 @@ export const useLogic = ({ onClose, disableBackdropClick, classes, }) => {
|
|
|
12
12
|
});
|
|
13
13
|
const { paper, ...restClasses } = classes || {};
|
|
14
14
|
const dialogClasses = {
|
|
15
|
-
paper:
|
|
15
|
+
paper: cn(dialogClassnames.paper, paper),
|
|
16
16
|
...restClasses,
|
|
17
17
|
};
|
|
18
18
|
return { handleClose, isMobile, dialogClasses };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from '../utils/cn';
|
|
3
3
|
import { dialogActionsClassnames } from './constants';
|
|
4
4
|
import { StyledDialogActions, StyledGrid } from './styles';
|
|
5
5
|
export const DialogActions = ({ children, className, disableSpacing, ...props }) => {
|
|
6
|
-
return (_jsx(StyledDialogActions, { className:
|
|
6
|
+
return (_jsx(StyledDialogActions, { className: cn(className, dialogActionsClassnames.root), ...props, children: _jsx(StyledGrid, { spacing: disableSpacing ? 0 : 3, children: children }) }));
|
|
7
7
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from '../utils/cn';
|
|
3
3
|
import { dialogContentClassnames } from './constants';
|
|
4
4
|
import { StyledDialogContent } from './styles';
|
|
5
|
-
export const DialogContent = ({ className, ...restProps }) => (_jsx(StyledDialogContent, { className:
|
|
5
|
+
export const DialogContent = ({ className, ...restProps }) => (_jsx(StyledDialogContent, { className: cn(className, dialogContentClassnames.root), ...restProps }));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from '../utils/cn';
|
|
3
3
|
import { donutChartClassnames } from './constants';
|
|
4
4
|
import { Content, ProgressArc, Svg, TrackArc, Wrapper } from './styles';
|
|
5
5
|
import { useLogic } from './useLogic';
|
|
6
6
|
export const DonutChart = ({ value, maxValue, children, color = 'primary', colorIntensity = '700', className, style, }) => {
|
|
7
7
|
const { rootRef, svgViewBox, arcCx, arcCy, donutParams, meterAriaValue } = useLogic({ value, maxValue, color, colorIntensity });
|
|
8
|
-
return (_jsxs(Wrapper, { ref: rootRef, className:
|
|
8
|
+
return (_jsxs(Wrapper, { ref: rootRef, className: cn(donutChartClassnames.root, className), role: "meter", "aria-label": meterAriaValue.label, "aria-valuemin": meterAriaValue.min, "aria-valuemax": meterAriaValue.max, "aria-valuenow": meterAriaValue.now, style: { ...donutParams?.cssVars, ...style }, children: [donutParams && (_jsxs(Svg, { className: donutChartClassnames.svg, viewBox: svgViewBox, "aria-hidden": true, children: [_jsx(TrackArc, { className: donutChartClassnames.track, cx: arcCx, cy: arcCy, r: donutParams.arcR }), _jsx(ProgressArc, { className: donutChartClassnames.progress, d: donutParams.arcPath, pathLength: 1, strokeDasharray: 1, strokeDashoffset: donutParams.progressOffset })] })), children && (_jsx(Content, { className: donutChartClassnames.content, children: children }))] }));
|
|
9
9
|
};
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { useHidePersonalData } from '../personalDataSecurity';
|
|
4
4
|
import { TextField } from '../TextField';
|
|
5
|
-
import {
|
|
5
|
+
import { cn } from '../utils/cn';
|
|
6
6
|
export const EmailField = forwardRef(({ isHidePersonalData, inputProps, ...props }, ref) => {
|
|
7
7
|
const hidePersonalDataClassname = useHidePersonalData({
|
|
8
8
|
isEnabled: isHidePersonalData,
|
|
@@ -10,6 +10,6 @@ export const EmailField = forwardRef(({ isHidePersonalData, inputProps, ...props
|
|
|
10
10
|
});
|
|
11
11
|
return (_jsx(TextField, { ref: ref, type: "email", inputProps: {
|
|
12
12
|
...inputProps,
|
|
13
|
-
className:
|
|
13
|
+
className: cn(inputProps?.className, hidePersonalDataClassname),
|
|
14
14
|
}, ...props }));
|
|
15
15
|
});
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { useHidePersonalData } from '../personalDataSecurity';
|
|
4
4
|
import { TextField } from '../TextField';
|
|
5
|
-
import {
|
|
5
|
+
import { cn } from '../utils/cn';
|
|
6
6
|
import { useLogic } from './useLogic';
|
|
7
7
|
/**
|
|
8
8
|
* Поле для ввода email или мобильного номера телефона
|
|
@@ -19,6 +19,6 @@ export const EmailOrPhoneField = forwardRef((props, ref) => {
|
|
|
19
19
|
});
|
|
20
20
|
return (_jsx(TextField, { ref: ref, type: "text", onBlur: onBlur, value: inputValue, onChange: onChange, inputProps: {
|
|
21
21
|
...inputProps,
|
|
22
|
-
className:
|
|
22
|
+
className: cn(inputProps?.className, hidePersonalDataClassname),
|
|
23
23
|
}, ...restProps }));
|
|
24
24
|
});
|