@astral/ui 4.56.0 → 4.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ContentState/ContentState.d.ts +1 -1
- package/components/ContentState/ContentState.js +2 -2
- package/components/ContentState/types.d.ts +4 -0
- package/components/DataGrid/Body/Body.d.ts +1 -1
- package/components/DataGrid/Body/Body.js +14 -7
- package/components/DataGrid/Body/constants.d.ts +4 -0
- package/components/DataGrid/Body/constants.js +5 -0
- package/components/DataGrid/Body/styles.d.ts +0 -3
- package/components/DataGrid/Body/styles.js +14 -1
- package/components/DataGrid/Body/useLogic/index.d.ts +1 -0
- package/components/DataGrid/Body/useLogic/index.js +1 -0
- package/components/DataGrid/Body/useLogic/useLogic.d.ts +9 -0
- package/components/DataGrid/Body/useLogic/useLogic.js +15 -0
- package/components/DataGrid/Cell/Cell.js +20 -4
- package/components/DataGrid/Cell/constants.d.ts +7 -0
- package/components/DataGrid/Cell/constants.js +8 -0
- package/components/DataGrid/Cell/styles.d.ts +14 -0
- package/components/DataGrid/Cell/styles.js +47 -0
- package/components/DataGrid/Cell/useLogic/useLogic.d.ts +2 -0
- package/components/DataGrid/Cell/useLogic/useLogic.js +3 -2
- package/components/DataGrid/DataGrid.js +42 -8
- package/components/DataGrid/Head/Head.js +1 -1
- package/components/DataGrid/Head/styles.js +4 -0
- package/components/DataGrid/Loader/styles.js +4 -0
- package/components/DataGrid/MobileSkeleton/MobileSkeleton.d.ts +6 -0
- package/components/DataGrid/MobileSkeleton/MobileSkeleton.js +10 -0
- package/components/DataGrid/MobileSkeleton/index.d.ts +1 -0
- package/components/DataGrid/MobileSkeleton/index.js +1 -0
- package/components/DataGrid/MobileSkeleton/styles.d.ts +17 -0
- package/components/DataGrid/MobileSkeleton/styles.js +37 -0
- package/components/DataGrid/Row/NestedChildren/styles.js +5 -0
- package/components/DataGrid/Row/Row.js +25 -8
- package/components/DataGrid/Row/constants.d.ts +8 -0
- package/components/DataGrid/Row/constants.js +8 -0
- package/components/DataGrid/Row/styles.d.ts +4 -9
- package/components/DataGrid/Row/styles.js +66 -14
- package/components/DataGrid/Row/types.d.ts +5 -1
- package/components/DataGrid/Row/useLogic/hooks/index.d.ts +1 -0
- package/components/DataGrid/Row/useLogic/hooks/index.js +1 -0
- package/components/DataGrid/Row/useLogic/hooks/useMobileLogic.d.ts +5 -0
- package/components/DataGrid/Row/useLogic/hooks/useMobileLogic.js +15 -0
- package/components/DataGrid/Row/useLogic/useLogic.d.ts +868 -3
- package/components/DataGrid/Row/useLogic/useLogic.js +28 -13
- package/components/DataGrid/constants.d.ts +4 -0
- package/components/DataGrid/constants.js +4 -0
- package/components/DataGrid/index.d.ts +1 -0
- package/components/DataGrid/index.js +1 -0
- package/components/DataGrid/styles.d.ts +0 -9
- package/components/DataGrid/styles.js +43 -12
- package/components/DataGrid/types.d.ts +7 -0
- package/components/DataGrid/useLogic/hooks/index.d.ts +1 -1
- package/components/DataGrid/useLogic/hooks/index.js +1 -1
- package/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/index.d.ts +1 -0
- package/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/index.js +1 -0
- package/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.d.ts +16 -0
- package/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.js +32 -0
- package/components/DataGrid/useLogic/hooks/usePinnedColumns/usePinnedColumns.js +11 -3
- package/components/DataGrid/useLogic/useLogic.d.ts +10 -4
- package/components/DataGrid/useLogic/useLogic.js +17 -12
- package/components/DataGrid/useLogic/utils/getIsAllowHorizontalScroll/getIsAllowHorizontalScroll.js +1 -1
- package/components/DataGrid/utils/getDataGridCssVars/getDataGridCssVars.d.ts +2 -0
- package/components/DataGrid/utils/getDataGridCssVars/getDataGridCssVars.js +5 -0
- package/components/DataGrid/utils/getDataGridCssVars/index.d.ts +1 -0
- package/components/DataGrid/utils/getDataGridCssVars/index.js +1 -0
- package/components/DataGrid/utils/index.d.ts +1 -0
- package/components/DataGrid/utils/index.js +1 -0
- package/components/DataGridActionCell/DataGridSecondaryActions/DataGridSecondaryActions.js +1 -1
- package/components/DataGridInfinite/DataGridInfinite.js +5 -4
- package/components/DataGridInfinite/useLogic/useLogic.d.ts +7 -1
- package/components/DataGridInfinite/useLogic/useLogic.js +12 -2
- package/components/DescriptionCell/styles.js +12 -3
- package/components/NewStepper/index.d.ts +1 -0
- package/components/NewStepper/index.js +1 -0
- package/components/NewStepper/public.d.ts +1 -0
- package/components/NewStepper/public.js +1 -0
- package/components/PageLayoutSection/PageLayoutSection.d.ts +4 -0
- package/components/PageLayoutSection/PageLayoutSection.js +13 -4
- package/components/PageLayoutSection/constants.d.ts +5 -0
- package/components/PageLayoutSection/constants.js +6 -0
- package/components/PageLayoutSection/styles.d.ts +1 -1
- package/components/PageLayoutSection/styles.js +6 -1
- package/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.d.ts +5 -1
- package/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.js +5 -4
- package/node/components/ContentState/ContentState.d.ts +1 -1
- package/node/components/ContentState/ContentState.js +2 -2
- package/node/components/ContentState/types.d.ts +4 -0
- package/node/components/DataGrid/Body/Body.d.ts +1 -1
- package/node/components/DataGrid/Body/Body.js +14 -7
- package/node/components/DataGrid/Body/constants.d.ts +4 -0
- package/node/components/DataGrid/Body/constants.js +8 -0
- package/node/components/DataGrid/Body/styles.d.ts +0 -3
- package/node/components/DataGrid/Body/styles.js +14 -1
- package/node/components/DataGrid/Body/useLogic/index.d.ts +1 -0
- package/node/components/DataGrid/{useLogic/hooks/useClassnames → Body/useLogic}/index.js +1 -1
- package/node/components/DataGrid/Body/useLogic/useLogic.d.ts +9 -0
- package/node/components/DataGrid/Body/useLogic/useLogic.js +19 -0
- package/node/components/DataGrid/Cell/Cell.js +18 -2
- package/node/components/DataGrid/Cell/constants.d.ts +7 -0
- package/node/components/DataGrid/Cell/constants.js +11 -0
- package/node/components/DataGrid/Cell/styles.d.ts +14 -0
- package/node/components/DataGrid/Cell/styles.js +48 -1
- package/node/components/DataGrid/Cell/useLogic/useLogic.d.ts +2 -0
- package/node/components/DataGrid/Cell/useLogic/useLogic.js +3 -2
- package/node/components/DataGrid/DataGrid.js +41 -7
- package/node/components/DataGrid/Head/Head.js +1 -1
- package/node/components/DataGrid/Head/styles.js +4 -0
- package/node/components/DataGrid/Loader/styles.js +4 -0
- package/node/components/DataGrid/MobileSkeleton/MobileSkeleton.d.ts +6 -0
- package/node/components/DataGrid/MobileSkeleton/MobileSkeleton.js +14 -0
- package/node/components/DataGrid/MobileSkeleton/index.d.ts +1 -0
- package/node/components/DataGrid/MobileSkeleton/index.js +17 -0
- package/node/components/DataGrid/MobileSkeleton/styles.d.ts +17 -0
- package/node/components/DataGrid/MobileSkeleton/styles.js +40 -0
- package/node/components/DataGrid/Row/NestedChildren/styles.js +5 -0
- package/node/components/DataGrid/Row/Row.js +23 -6
- package/node/components/DataGrid/Row/constants.d.ts +8 -0
- package/node/components/DataGrid/Row/constants.js +9 -1
- package/node/components/DataGrid/Row/styles.d.ts +4 -9
- package/node/components/DataGrid/Row/styles.js +66 -14
- package/node/components/DataGrid/Row/types.d.ts +5 -1
- package/node/components/DataGrid/Row/useLogic/hooks/index.d.ts +1 -0
- package/node/components/DataGrid/Row/useLogic/hooks/index.js +17 -0
- package/node/components/DataGrid/Row/useLogic/hooks/useMobileLogic.d.ts +5 -0
- package/node/components/DataGrid/Row/useLogic/hooks/useMobileLogic.js +19 -0
- package/node/components/DataGrid/Row/useLogic/useLogic.d.ts +868 -3
- package/node/components/DataGrid/Row/useLogic/useLogic.js +28 -13
- package/node/components/DataGrid/constants.d.ts +4 -0
- package/node/components/DataGrid/constants.js +5 -1
- package/node/components/DataGrid/index.d.ts +1 -0
- package/node/components/DataGrid/index.js +3 -1
- package/node/components/DataGrid/styles.d.ts +0 -9
- package/node/components/DataGrid/styles.js +43 -12
- package/node/components/DataGrid/types.d.ts +7 -0
- package/node/components/DataGrid/useLogic/hooks/index.d.ts +1 -1
- package/node/components/DataGrid/useLogic/hooks/index.js +1 -1
- package/node/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/index.d.ts +1 -0
- package/node/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/index.js +17 -0
- package/node/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.d.ts +16 -0
- package/node/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.js +36 -0
- package/node/components/DataGrid/useLogic/hooks/usePinnedColumns/usePinnedColumns.js +11 -3
- package/node/components/DataGrid/useLogic/useLogic.d.ts +10 -4
- package/node/components/DataGrid/useLogic/useLogic.js +19 -14
- package/node/components/DataGrid/useLogic/utils/getIsAllowHorizontalScroll/getIsAllowHorizontalScroll.js +1 -1
- package/node/components/DataGrid/utils/getDataGridCssVars/getDataGridCssVars.d.ts +2 -0
- package/node/components/DataGrid/utils/getDataGridCssVars/getDataGridCssVars.js +9 -0
- package/node/components/DataGrid/utils/getDataGridCssVars/index.d.ts +1 -0
- package/node/components/DataGrid/utils/getDataGridCssVars/index.js +5 -0
- package/node/components/DataGrid/utils/index.d.ts +1 -0
- package/node/components/DataGrid/utils/index.js +3 -1
- package/node/components/DataGridActionCell/DataGridSecondaryActions/DataGridSecondaryActions.js +1 -1
- package/node/components/DataGridInfinite/DataGridInfinite.js +5 -4
- package/node/components/DataGridInfinite/useLogic/useLogic.d.ts +7 -1
- package/node/components/DataGridInfinite/useLogic/useLogic.js +11 -1
- package/node/components/DescriptionCell/styles.js +15 -6
- package/node/components/NewStepper/index.d.ts +1 -0
- package/node/components/NewStepper/index.js +3 -1
- package/node/components/NewStepper/public.d.ts +1 -0
- package/node/components/NewStepper/public.js +3 -1
- package/node/components/PageLayoutSection/PageLayoutSection.d.ts +4 -0
- package/node/components/PageLayoutSection/PageLayoutSection.js +12 -3
- package/node/components/PageLayoutSection/constants.d.ts +5 -0
- package/node/components/PageLayoutSection/constants.js +9 -0
- package/node/components/PageLayoutSection/styles.d.ts +1 -1
- package/node/components/PageLayoutSection/styles.js +7 -2
- package/node/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.d.ts +5 -1
- package/node/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.js +5 -4
- package/package.json +1 -1
- package/components/DataGrid/useLogic/hooks/useClassnames/index.d.ts +0 -1
- package/components/DataGrid/useLogic/hooks/useClassnames/index.js +0 -1
- package/components/DataGrid/useLogic/hooks/useClassnames/useClassnames.d.ts +0 -12
- package/components/DataGrid/useLogic/hooks/useClassnames/useClassnames.js +0 -14
- package/node/components/DataGrid/useLogic/hooks/useClassnames/index.d.ts +0 -1
- package/node/components/DataGrid/useLogic/hooks/useClassnames/useClassnames.d.ts +0 -12
- package/node/components/DataGrid/useLogic/hooks/useClassnames/useClassnames.js +0 -18
|
@@ -4,8 +4,14 @@ import { type DataGridRow } from '../../DataGrid';
|
|
|
4
4
|
import { type CellValue } from '../../DataGrid/types';
|
|
5
5
|
import { type DataGridInfiniteProps } from '../types';
|
|
6
6
|
type UseLogicParams<TData extends Record<string, CellValue> = DataGridRow, TSortField extends keyof TData = keyof TData> = DataGridInfiniteProps<TData, TSortField>;
|
|
7
|
-
export declare const useLogic: <TData extends Record<string, unknown> = DataGridRow, TSortField extends keyof TData = keyof TData>({ keyId, columns, rows, variant, tree, subrows, selectedRows, isLoading, isDisabled, isEndReached, onEndReached, onSelectRow, isHideSelectAll, isHideHeaderIfNoData, }: UseLogicParams<TData, TSortField>) => {
|
|
7
|
+
export declare const useLogic: <TData extends Record<string, unknown> = DataGridRow, TSortField extends keyof TData = keyof TData>({ keyId, columns, rows, variant, tree, subrows, selectedRows, maxHeight, isLoading, isDisabled, isEndReached, onEndReached, onSelectRow, isHideSelectAll, isHideHeaderIfNoData, }: UseLogicParams<TData, TSortField>) => {
|
|
8
|
+
containerCssVars: import("react").CSSProperties;
|
|
9
|
+
mobileSkeletonProps: {
|
|
10
|
+
cellsCount: number;
|
|
11
|
+
rowsCount: number;
|
|
12
|
+
};
|
|
8
13
|
isNoData: boolean;
|
|
14
|
+
isMobile: boolean;
|
|
9
15
|
isDataGridDisabled: boolean | undefined;
|
|
10
16
|
isStickyButtonActive: boolean;
|
|
11
17
|
treeRenderConfig: {
|
|
@@ -3,13 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useLogic = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const enums_1 = require("../../DataGrid/enums");
|
|
6
|
+
const hooks_1 = require("../../DataGrid/useLogic/hooks");
|
|
6
7
|
const utils_1 = require("../../DataGrid/utils");
|
|
7
8
|
const useToggle_1 = require("../../useToggle");
|
|
9
|
+
const useViewportType_1 = require("../../useViewportType");
|
|
8
10
|
const prop_1 = require("../../utils/prop");
|
|
9
11
|
const uniqueBy_1 = require("../../utils/uniqueBy");
|
|
10
12
|
const constants_1 = require("../constants");
|
|
11
|
-
const useLogic = ({ keyId, columns, rows, variant, tree, subrows, selectedRows = [], isLoading, isDisabled, isEndReached, onEndReached, onSelectRow, isHideSelectAll, isHideHeaderIfNoData = false, }) => {
|
|
13
|
+
const useLogic = ({ keyId, columns, rows, variant, tree, subrows, selectedRows = [], maxHeight, isLoading, isDisabled, isEndReached, onEndReached, onSelectRow, isHideSelectAll, isHideHeaderIfNoData = false, }) => {
|
|
12
14
|
const virtuoso = (0, react_1.useRef)(null);
|
|
15
|
+
const { isMobile } = (0, useViewportType_1.useViewportType)();
|
|
13
16
|
const [hasVerticalScroll, setHasVerticalScroll] = (0, react_1.useState)(false);
|
|
14
17
|
const [isStickyButtonActive, showStickyButton, hideStickyButton] = (0, useToggle_1.useToggle)();
|
|
15
18
|
const isNoData = Boolean(rows?.length);
|
|
@@ -62,8 +65,15 @@ const useLogic = ({ keyId, columns, rows, variant, tree, subrows, selectedRows =
|
|
|
62
65
|
}
|
|
63
66
|
};
|
|
64
67
|
const isHideHead = isHideHeaderIfNoData && rows.length === 0;
|
|
68
|
+
const { mobileSkeletonProps } = (0, hooks_1.useDataGridMobileLogic)({
|
|
69
|
+
columns,
|
|
70
|
+
});
|
|
71
|
+
const containerCssVars = (0, utils_1.getDataGridCssVars)(maxHeight);
|
|
65
72
|
return {
|
|
73
|
+
containerCssVars,
|
|
74
|
+
mobileSkeletonProps,
|
|
66
75
|
isNoData,
|
|
76
|
+
isMobile,
|
|
67
77
|
isDataGridDisabled,
|
|
68
78
|
isStickyButtonActive,
|
|
69
79
|
treeRenderConfig,
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ItemWrapper = exports.IconWrapper = exports.Wrapper = void 0;
|
|
4
|
-
const
|
|
4
|
+
const constants_1 = require("../Description/constants");
|
|
5
5
|
const styled_1 = require("../styled");
|
|
6
|
-
const
|
|
6
|
+
const constants_2 = require("../Typography/constants");
|
|
7
|
+
const constants_3 = require("./constants");
|
|
7
8
|
exports.Wrapper = styled_1.styled.div `
|
|
8
9
|
display: flex;
|
|
9
10
|
align-items: center;
|
|
10
11
|
|
|
11
|
-
&.${
|
|
12
|
+
&.${constants_3.descriptionCellClassnames.hasIcon} {
|
|
12
13
|
gap: ${({ theme }) => theme.spacing(2)};
|
|
13
14
|
}
|
|
14
15
|
|
|
15
|
-
&.${
|
|
16
|
+
&.${constants_3.descriptionCellClassnames.iconRight} {
|
|
16
17
|
flex-direction: row-reverse;
|
|
17
18
|
}
|
|
18
19
|
`;
|
|
@@ -23,15 +24,23 @@ exports.IconWrapper = styled_1.styled.div `
|
|
|
23
24
|
width: 24px;
|
|
24
25
|
height: 24px;
|
|
25
26
|
}
|
|
27
|
+
|
|
28
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
29
|
+
display: none;
|
|
30
|
+
}
|
|
26
31
|
`;
|
|
27
32
|
exports.ItemWrapper = styled_1.styled.div `
|
|
28
33
|
display: flex;
|
|
29
34
|
flex-direction: column;
|
|
30
35
|
|
|
31
|
-
|
|
32
|
-
.${
|
|
36
|
+
& .${constants_1.descriptionClassnames.root} {
|
|
37
|
+
& .${constants_2.typographyClassnames.root} {
|
|
33
38
|
font-size: unset;
|
|
34
39
|
color: unset;
|
|
35
40
|
}
|
|
36
41
|
}
|
|
42
|
+
|
|
43
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
44
|
+
gap: ${({ theme }) => theme.spacing(1)};
|
|
45
|
+
}
|
|
37
46
|
`;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.stepIconClassnames = exports.stepClassnames = exports.Step = exports.NewStepper = void 0;
|
|
3
|
+
exports.stepIconClassnames = exports.stepClassnames = exports.Step = exports.stepperClassnames = exports.NewStepper = void 0;
|
|
4
4
|
var NewStepper_1 = require("./NewStepper");
|
|
5
5
|
Object.defineProperty(exports, "NewStepper", { enumerable: true, get: function () { return NewStepper_1.NewStepper; } });
|
|
6
|
+
var constants_1 = require("./constants");
|
|
7
|
+
Object.defineProperty(exports, "stepperClassnames", { enumerable: true, get: function () { return constants_1.stepperClassnames; } });
|
|
6
8
|
var Step_1 = require("./Step");
|
|
7
9
|
Object.defineProperty(exports, "Step", { enumerable: true, get: function () { return Step_1.Step; } });
|
|
8
10
|
Object.defineProperty(exports, "stepClassnames", { enumerable: true, get: function () { return Step_1.stepClassnames; } });
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.stepIconClassnames = exports.stepClassnames = exports.Step = exports.NewStepper = void 0;
|
|
3
|
+
exports.stepIconClassnames = exports.stepClassnames = exports.Step = exports.NewStepper = exports.stepperClassnames = void 0;
|
|
4
|
+
var constants_1 = require("./constants");
|
|
5
|
+
Object.defineProperty(exports, "stepperClassnames", { enumerable: true, get: function () { return constants_1.stepperClassnames; } });
|
|
4
6
|
var NewStepper_1 = require("./NewStepper");
|
|
5
7
|
Object.defineProperty(exports, "NewStepper", { enumerable: true, get: function () { return NewStepper_1.NewStepper; } });
|
|
6
8
|
var Step_1 = require("./Step");
|
|
@@ -5,6 +5,10 @@ export type PageLayoutSectionProps = {
|
|
|
5
5
|
* Название класса, применяется к корневому компоненту
|
|
6
6
|
*/
|
|
7
7
|
className?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Отключает боковые отступы на мобильных разрешениях
|
|
10
|
+
*/
|
|
11
|
+
isNoMobileSidePadding?: boolean;
|
|
8
12
|
};
|
|
9
13
|
/**
|
|
10
14
|
* Секция страницы. На десктопе между секциями отображается разделитель или отступ. На мобильных разрешениях секции оформляются как карточки.
|
|
@@ -3,7 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PageLayoutSection = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const classNames_1 = require("../utils/classNames");
|
|
7
|
+
const cva_1 = require("../utils/cva");
|
|
8
|
+
const constants_1 = require("./constants");
|
|
6
9
|
const styles_1 = require("./styles");
|
|
10
|
+
const sectionWrapperCva = (0, cva_1.cva)(constants_1.pageLayoutSectionClassnames.wrapper, {
|
|
11
|
+
variants: {
|
|
12
|
+
isNoMobileSidePadding: {
|
|
13
|
+
true: constants_1.pageLayoutSectionClassnames.isNoMobileSidePadding,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
});
|
|
7
17
|
/**
|
|
8
18
|
* Секция страницы. На десктопе между секциями отображается разделитель или отступ. На мобильных разрешениях секции оформляются как карточки.
|
|
9
19
|
*
|
|
@@ -16,7 +26,6 @@ const styles_1 = require("./styles");
|
|
|
16
26
|
* </PageLayoutSectionContainer>
|
|
17
27
|
* } />
|
|
18
28
|
*/
|
|
19
|
-
exports.PageLayoutSection = (0, react_1.forwardRef)((
|
|
20
|
-
|
|
21
|
-
return ((0, jsx_runtime_1.jsx)(styles_1.Section, { className: className, ref: ref, children: (0, jsx_runtime_1.jsx)(styles_1.SectionInner, { children: children }) }));
|
|
29
|
+
exports.PageLayoutSection = (0, react_1.forwardRef)(({ children, className, isNoMobileSidePadding = false }, ref) => {
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.Section, { className: (0, classNames_1.classNames)(className, constants_1.pageLayoutSectionClassnames.root), ref: ref, children: (0, jsx_runtime_1.jsx)(styles_1.SectionWrapper, { className: sectionWrapperCva({ isNoMobileSidePadding }), children: children }) }));
|
|
22
31
|
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pageLayoutSectionClassnames = void 0;
|
|
4
|
+
const createUIKitClassname_1 = require("../utils/createUIKitClassname");
|
|
5
|
+
exports.pageLayoutSectionClassnames = {
|
|
6
|
+
root: (0, createUIKitClassname_1.createUIKitClassname)('page-layout__section'),
|
|
7
|
+
wrapper: (0, createUIKitClassname_1.createUIKitClassname)('page-layout__section-wrapper'),
|
|
8
|
+
isNoMobileSidePadding: (0, createUIKitClassname_1.createUIKitClassname)('page-layout__section-wrapper_no-mobile-side-padding'),
|
|
9
|
+
};
|
|
@@ -3,7 +3,7 @@ export declare const Section: 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<HTMLElement>, HTMLElement>, {}>;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const SectionWrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
7
7
|
theme?: import("@emotion/react").Theme | undefined;
|
|
8
8
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
9
9
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SectionWrapper = exports.Section = void 0;
|
|
4
4
|
const styled_1 = require("../styled");
|
|
5
|
+
const constants_1 = require("./constants");
|
|
5
6
|
exports.Section = styled_1.styled.section `
|
|
6
7
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
7
8
|
margin: ${({ theme }) => theme.spacing(0, 4)};
|
|
@@ -11,7 +12,7 @@ exports.Section = styled_1.styled.section `
|
|
|
11
12
|
border-radius: ${({ theme }) => theme.shape.medium};
|
|
12
13
|
}
|
|
13
14
|
`;
|
|
14
|
-
exports.
|
|
15
|
+
exports.SectionWrapper = styled_1.styled.div `
|
|
15
16
|
padding: ${({ theme }) => theme.spacing(0, 6)};
|
|
16
17
|
|
|
17
18
|
${({ theme }) => theme.breakpoints.down('laptop')} {
|
|
@@ -20,5 +21,9 @@ exports.SectionInner = styled_1.styled.div `
|
|
|
20
21
|
|
|
21
22
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
22
23
|
padding: ${({ theme }) => theme.spacing(4)};
|
|
24
|
+
|
|
25
|
+
&.${constants_1.pageLayoutSectionClassnames.isNoMobileSidePadding} {
|
|
26
|
+
padding: ${({ theme }) => theme.spacing(4, 0)};
|
|
27
|
+
}
|
|
23
28
|
}
|
|
24
29
|
`;
|
|
@@ -13,9 +13,13 @@ type Props = {
|
|
|
13
13
|
* Используется вместе с хуком `useLoadingState`
|
|
14
14
|
*/
|
|
15
15
|
isShowLoader?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Класс применяемый для корневого элемента
|
|
18
|
+
*/
|
|
19
|
+
className?: string;
|
|
16
20
|
};
|
|
17
21
|
/**
|
|
18
22
|
* Дефолтный лоадер загрузки
|
|
19
23
|
*/
|
|
20
|
-
export declare const LoadingPlaceholder: ({ title, content, isShowLoader, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare const LoadingPlaceholder: ({ title, content, isShowLoader, className, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
21
25
|
export {};
|
|
@@ -4,18 +4,19 @@ exports.LoadingPlaceholder = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const Loader_1 = require("../../Loader");
|
|
6
6
|
const Typography_1 = require("../../Typography");
|
|
7
|
+
const classNames_1 = require("../../utils/classNames");
|
|
7
8
|
const constants_1 = require("./constants");
|
|
8
9
|
const styles_1 = require("./styles");
|
|
9
10
|
/**
|
|
10
11
|
* Дефолтный лоадер загрузки
|
|
11
12
|
*/
|
|
12
|
-
const LoadingPlaceholder = ({ title, content, isShowLoader = true, }) => {
|
|
13
|
+
const LoadingPlaceholder = ({ title, content, isShowLoader = true, className, }) => {
|
|
13
14
|
if (!isShowLoader) {
|
|
14
|
-
return (0, jsx_runtime_1.jsx)(styles_1.LoadingContainer, { className: constants_1.loadingPlaceholderClassnames.root });
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.LoadingContainer, { className: (0, classNames_1.classNames)(constants_1.loadingPlaceholderClassnames.root, className) }));
|
|
15
16
|
}
|
|
16
17
|
if (content) {
|
|
17
|
-
return ((0, jsx_runtime_1.jsx)(styles_1.LoadingContainer, { className: constants_1.loadingPlaceholderClassnames.root, children: content }));
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.LoadingContainer, { className: (0, classNames_1.classNames)(constants_1.loadingPlaceholderClassnames.root, className), children: content }));
|
|
18
19
|
}
|
|
19
|
-
return ((0, jsx_runtime_1.jsxs)(styles_1.LoadingContainer, { className: constants_1.loadingPlaceholderClassnames.root, children: [(0, jsx_runtime_1.jsx)(Loader_1.Loader, {}), title && (0, jsx_runtime_1.jsx)(Typography_1.Typography, { variant: "h4", children: title })] }));
|
|
20
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.LoadingContainer, { className: (0, classNames_1.classNames)(constants_1.loadingPlaceholderClassnames.root, className), children: [(0, jsx_runtime_1.jsx)(Loader_1.Loader, {}), title && (0, jsx_runtime_1.jsx)(Typography_1.Typography, { variant: "h4", children: title })] }));
|
|
20
21
|
};
|
|
21
22
|
exports.LoadingPlaceholder = LoadingPlaceholder;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './useClassnames';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './useClassnames';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
type UseClassnamesParams = {
|
|
2
|
-
isDataGridDisabled?: boolean;
|
|
3
|
-
dataGridClassName?: string;
|
|
4
|
-
hasPinnedColumns?: boolean;
|
|
5
|
-
isNoData?: boolean;
|
|
6
|
-
};
|
|
7
|
-
export declare const useClassnames: ({ isDataGridDisabled, dataGridClassName, hasPinnedColumns, isNoData, }: UseClassnamesParams) => {
|
|
8
|
-
pinnedSectionsClassname: string;
|
|
9
|
-
dataGridClassname: string;
|
|
10
|
-
bodyClassName: string;
|
|
11
|
-
};
|
|
12
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { classNames } from '../../../../utils/classNames';
|
|
2
|
-
import { dataGridClassnames } from '../../../constants';
|
|
3
|
-
export const useClassnames = ({ isDataGridDisabled, dataGridClassName, hasPinnedColumns, isNoData, }) => {
|
|
4
|
-
const pinnedSectionsClassname = classNames(dataGridClassnames.pinnedSections, {
|
|
5
|
-
[dataGridClassnames.disabled]: isDataGridDisabled,
|
|
6
|
-
});
|
|
7
|
-
const dataGridClassname = classNames(dataGridClassnames.root, dataGridClassName, {
|
|
8
|
-
[dataGridClassnames.dataGridHasPinnedSections]: hasPinnedColumns,
|
|
9
|
-
});
|
|
10
|
-
const bodyClassName = classNames(dataGridClassnames.body, {
|
|
11
|
-
[dataGridClassnames.bodyEmpty]: isNoData,
|
|
12
|
-
});
|
|
13
|
-
return { pinnedSectionsClassname, dataGridClassname, bodyClassName };
|
|
14
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './useClassnames';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
type UseClassnamesParams = {
|
|
2
|
-
isDataGridDisabled?: boolean;
|
|
3
|
-
dataGridClassName?: string;
|
|
4
|
-
hasPinnedColumns?: boolean;
|
|
5
|
-
isNoData?: boolean;
|
|
6
|
-
};
|
|
7
|
-
export declare const useClassnames: ({ isDataGridDisabled, dataGridClassName, hasPinnedColumns, isNoData, }: UseClassnamesParams) => {
|
|
8
|
-
pinnedSectionsClassname: string;
|
|
9
|
-
dataGridClassname: string;
|
|
10
|
-
bodyClassName: string;
|
|
11
|
-
};
|
|
12
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useClassnames = void 0;
|
|
4
|
-
const classNames_1 = require("../../../../utils/classNames");
|
|
5
|
-
const constants_1 = require("../../../constants");
|
|
6
|
-
const useClassnames = ({ isDataGridDisabled, dataGridClassName, hasPinnedColumns, isNoData, }) => {
|
|
7
|
-
const pinnedSectionsClassname = (0, classNames_1.classNames)(constants_1.dataGridClassnames.pinnedSections, {
|
|
8
|
-
[constants_1.dataGridClassnames.disabled]: isDataGridDisabled,
|
|
9
|
-
});
|
|
10
|
-
const dataGridClassname = (0, classNames_1.classNames)(constants_1.dataGridClassnames.root, dataGridClassName, {
|
|
11
|
-
[constants_1.dataGridClassnames.dataGridHasPinnedSections]: hasPinnedColumns,
|
|
12
|
-
});
|
|
13
|
-
const bodyClassName = (0, classNames_1.classNames)(constants_1.dataGridClassnames.body, {
|
|
14
|
-
[constants_1.dataGridClassnames.bodyEmpty]: isNoData,
|
|
15
|
-
});
|
|
16
|
-
return { pinnedSectionsClassname, dataGridClassname, bodyClassName };
|
|
17
|
-
};
|
|
18
|
-
exports.useClassnames = useClassnames;
|