@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
|
@@ -13,6 +13,10 @@ exports.Wrapper = (0, styled_1.styled)('header', {
|
|
|
13
13
|
min-width: 100%;
|
|
14
14
|
|
|
15
15
|
border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
|
|
16
|
+
|
|
17
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
18
|
+
display: none;
|
|
19
|
+
}
|
|
16
20
|
`;
|
|
17
21
|
exports.CheckboxCell = styled_1.styled.div `
|
|
18
22
|
display: flex;
|
|
@@ -44,6 +44,10 @@ exports.LoaderWrapper = styled_1.styled.div `
|
|
|
44
44
|
position: sticky;
|
|
45
45
|
z-index: ${({ theme }) => theme.zIndex.fab};
|
|
46
46
|
left: 0;
|
|
47
|
+
|
|
48
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
49
|
+
display: none;
|
|
50
|
+
}
|
|
47
51
|
`;
|
|
48
52
|
exports.StyledLinearProgress = (0, styled_1.styled)(LinearProgress_1.default) `
|
|
49
53
|
height: 2px;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MobileSkeleton = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const Skeleton_1 = require("../../Skeleton");
|
|
6
|
+
const styles_1 = require("./styles");
|
|
7
|
+
const MobileSkeleton = ({ cellsCount, rowsCount, }) => {
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.Root, { children: Array.from({ length: rowsCount }, (_, rowIndex) => ((0, jsx_runtime_1.jsxs)(styles_1.RowWrapper
|
|
9
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: Статичный скелетон
|
|
10
|
+
, { children: [Array.from({ length: cellsCount - 1 }, (_cell, cellIndex) => (
|
|
11
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: Статичный скелетон
|
|
12
|
+
(0, jsx_runtime_1.jsxs)(styles_1.Cell, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.Skeleton, { variant: "rounded", height: 20 }), (0, jsx_runtime_1.jsx)(Skeleton_1.Skeleton, { variant: "rounded", height: 16, width: "50%" })] }, cellIndex))), (0, jsx_runtime_1.jsx)(styles_1.Actions, { children: (0, jsx_runtime_1.jsx)(Skeleton_1.Skeleton, { variant: "rounded", width: "100%", height: 40 }) })] }, rowIndex))) }));
|
|
13
|
+
};
|
|
14
|
+
exports.MobileSkeleton = MobileSkeleton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MobileSkeleton';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./MobileSkeleton"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Root: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const RowWrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
7
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
9
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
10
|
+
export declare const Cell: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
11
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
12
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
13
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
14
|
+
export declare const Actions: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
15
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
16
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
17
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Actions = exports.Cell = exports.RowWrapper = exports.Root = void 0;
|
|
4
|
+
const styled_1 = require("../../styled");
|
|
5
|
+
exports.Root = styled_1.styled.div `
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
|
|
9
|
+
width: 100%;
|
|
10
|
+
`;
|
|
11
|
+
exports.RowWrapper = styled_1.styled.div `
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
gap: ${({ theme }) => theme.spacing(3)};
|
|
15
|
+
|
|
16
|
+
padding-top: ${({ theme }) => theme.spacing(1)};
|
|
17
|
+
padding-bottom: ${({ theme }) => theme.spacing(5)};
|
|
18
|
+
|
|
19
|
+
&:not(:last-of-type) {
|
|
20
|
+
border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&:not(:first-of-type) {
|
|
24
|
+
padding-top: ${({ theme }) => theme.spacing(5)};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&:last-of-type {
|
|
28
|
+
padding-bottom: 0;
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
exports.Cell = styled_1.styled.div `
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
gap: ${({ theme }) => theme.spacing(1)};
|
|
35
|
+
|
|
36
|
+
width: 100%;
|
|
37
|
+
`;
|
|
38
|
+
exports.Actions = styled_1.styled.div `
|
|
39
|
+
padding-top: ${({ theme }) => theme.spacing(2)};
|
|
40
|
+
`;
|
|
@@ -29,6 +29,11 @@ exports.NestedRows = (0, styled_1.styled)('ul', {
|
|
|
29
29
|
|
|
30
30
|
border-left: 1px solid ${({ theme }) => theme.palette.components.border.default};
|
|
31
31
|
}
|
|
32
|
+
|
|
33
|
+
/* TODO: Убрать после реализации задачи по адаптации вложенных строк https://track.astral.ru/soft/browse/UIKIT-2188 */
|
|
34
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
35
|
+
display: none;
|
|
36
|
+
}
|
|
32
37
|
`;
|
|
33
38
|
exports.MoreButtonRow = (0, styled_1.styled)('li', {
|
|
34
39
|
shouldForwardProp: (prop) => !['$level', '$isShowConnector', '$gridColumns'].includes(prop),
|
|
@@ -3,18 +3,35 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Row = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const BottomDrawer_1 = require("../../BottomDrawer");
|
|
6
7
|
const Checkbox_1 = require("../../Checkbox");
|
|
7
8
|
const Tooltip_1 = require("../../Tooltip");
|
|
8
9
|
const checkIsDeepEqual_1 = require("../../utils/checkIsDeepEqual");
|
|
10
|
+
const classNames_1 = require("../../utils/classNames");
|
|
11
|
+
const cva_1 = require("../../utils/cva");
|
|
9
12
|
const getInertProps_1 = require("../../utils/getInertProps");
|
|
10
13
|
const constants_1 = require("./constants");
|
|
11
14
|
const NestedChildren_1 = require("./NestedChildren");
|
|
12
15
|
const styles_1 = require("./styles");
|
|
13
16
|
const useLogic_1 = require("./useLogic");
|
|
14
17
|
const utils_1 = require("./utils");
|
|
18
|
+
const rootCva = (0, cva_1.cva)(constants_1.dataGridRowClassnames.root, {
|
|
19
|
+
variants: {
|
|
20
|
+
isShowConnector: {
|
|
21
|
+
true: constants_1.dataGridRowClassnames.showConnector,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
const rowContentCva = (0, cva_1.cva)(constants_1.dataGridRowContentClassnames.root, {
|
|
26
|
+
variants: {
|
|
27
|
+
isHovered: {
|
|
28
|
+
true: constants_1.dataGridRowContentClassnames.hovered,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
});
|
|
15
32
|
const RowComponent = (props) => {
|
|
16
|
-
const { isOpen, isShowConnector, childrenColumns, rowId, handleToggle, checkboxProps, rowProps, tooltipProps, nestedChildrenProps, disabled, isRenderCollapseButton, rowRef, } = (0, useLogic_1.useLogic)(props);
|
|
17
|
-
const { className, row, options, variant, isSelectable, gridColumns, isInitialExpanded, expandedLevel, level, nestedChildren, initialVisibleChildrenCount, moreButtonColumnPosition, isVisibleCollapseButton, columns, emptyCellValue, selectedRows, activeRowId, keyId, onSelectRow, onRowClick, sectionOffset, totalColumnsCount, registerRowElement, unregisterRowElement, onRowEnter, onRowLeave,
|
|
33
|
+
const { isOpen, isShowConnector, childrenColumns, rowId, handleToggle, checkboxProps, rowProps, isHovered, tooltipProps, nestedChildrenProps, disabled, isRenderCollapseButton, rowRef, rowStyles, drawerProps, disabledReasonText, } = (0, useLogic_1.useLogic)(props);
|
|
34
|
+
const { className, row, options, variant, isSelectable, gridColumns, isInitialExpanded, expandedLevel, level, nestedChildren, initialVisibleChildrenCount, moreButtonColumnPosition, isVisibleCollapseButton, columns, emptyCellValue, selectedRows, activeRowId, keyId, onSelectRow, onRowClick, sectionOffset, totalColumnsCount, registerRowElement, unregisterRowElement, onRowEnter, onRowLeave, style,
|
|
18
35
|
// В этот rest-оператор попадают специфичные пропсы (атрибуты) virtuoso
|
|
19
36
|
// Необходимы для DataGridInfinite
|
|
20
37
|
...selfProps } = props;
|
|
@@ -23,7 +40,7 @@ const RowComponent = (props) => {
|
|
|
23
40
|
if (!isRenderCollapseButton && (!isSelectable || isNotSelectable)) {
|
|
24
41
|
return null;
|
|
25
42
|
}
|
|
26
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isRenderCollapseButton && ((0, jsx_runtime_1.jsx)(styles_1.CollapseCell, { children: (0, jsx_runtime_1.jsx)(styles_1.CollapseButton, { variant: "text", onClick: handleToggle, children: (0, jsx_runtime_1.jsx)(styles_1.ChevronIcon, { "$isActive": isOpen }) }) })), isSelectable && !isNotSelectable && ((0, jsx_runtime_1.jsx)(styles_1.CheckboxCell, { ...(0, getInertProps_1.getInertProps)(disabled), onClick: (event) => event.stopPropagation(), children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { ...checkboxProps }) }))] }));
|
|
43
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isRenderCollapseButton && ((0, jsx_runtime_1.jsx)(styles_1.CollapseCell, { children: (0, jsx_runtime_1.jsx)(styles_1.CollapseButton, { variant: "text", onClick: handleToggle, children: (0, jsx_runtime_1.jsx)(styles_1.ChevronIcon, { "$isActive": isOpen }) }) })), isSelectable && !isNotSelectable && ((0, jsx_runtime_1.jsx)(styles_1.CheckboxCell, { ...(0, getInertProps_1.getInertProps)(disabled), onClick: (event) => event.stopPropagation(), className: constants_1.dataGridRowClassnames.checkbox, children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { ...checkboxProps }) }))] }));
|
|
27
44
|
};
|
|
28
45
|
const renderCells = (0, react_1.useCallback)(() => {
|
|
29
46
|
const lastCellGlobalIndex = (totalColumnsCount ?? columns.length) - 1;
|
|
@@ -35,7 +52,7 @@ const RowComponent = (props) => {
|
|
|
35
52
|
const globalIndex = (sectionOffset ?? 0) + index;
|
|
36
53
|
const isDisabledCell = (0, utils_1.checkIsDisabled)(disabled, availableCellsByIndex, globalIndex);
|
|
37
54
|
const isFirstCell = globalIndex === 0;
|
|
38
|
-
return ((0, jsx_runtime_1.jsx)(styles_1.CellStyled, {
|
|
55
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.CellStyled, { row: row, cell: cell, emptyCellValue: emptyCellValue, startAdornment: isFirstCell && renderStartAdornment(), isDisabled: isDisabledCell, isHidePersonalData: cell.isHidePersonalData }, cellId));
|
|
39
56
|
});
|
|
40
57
|
}, [
|
|
41
58
|
isOpen,
|
|
@@ -66,10 +83,10 @@ const RowComponent = (props) => {
|
|
|
66
83
|
onRowEnter,
|
|
67
84
|
onRowLeave,
|
|
68
85
|
]);
|
|
69
|
-
return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, {
|
|
86
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { className: (0, classNames_1.classNames)(className, rootCva({ isShowConnector })), style: rowStyles, ...selfProps, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { followCursor: true, arrow: false, ...tooltipProps, children: (0, jsx_runtime_1.jsx)(styles_1.ContentWrapper, { "data-row-id": rowId, ref: rowRef, onPointerEnter: () => onRowEnter?.(rowId), onPointerLeave: (event) => onRowLeave?.(rowId, event.nativeEvent), className: rowContentCva({ isHovered }), "$gridColumns": gridColumns, [constants_1.DISABLE_ROW_ATTR]: disabled, ...rowProps, children: renderCells() }) }), (0, jsx_runtime_1.jsx)(NestedChildren_1.NestedChildren, { ...nestedChildrenProps, data: nestedChildren, keyId: keyId, level: level, variant: variant, gridColumns: gridColumns, initialVisibleChildrenCount: initialVisibleChildrenCount, moreButtonColumnPosition: moreButtonColumnPosition,
|
|
70
87
|
// biome-ignore lint/suspicious/noTsIgnore: <>
|
|
71
88
|
// @ts-ignore
|
|
72
|
-
renderRow: renderRow })] }));
|
|
89
|
+
renderRow: renderRow }), (0, jsx_runtime_1.jsx)(BottomDrawer_1.BottomDrawer, { ...drawerProps, children: (0, jsx_runtime_1.jsx)(styles_1.BottomDrawerContent, { children: disabledReasonText }) })] }));
|
|
73
90
|
};
|
|
74
91
|
const arePropsEqual = (prevProps, nextProps) => {
|
|
75
92
|
const deepEqualityProps = new Set(['row']);
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
export declare const DISABLE_ROW_ATTR = "data-row-disable";
|
|
2
|
+
export declare const MOBILE_DRAWER_TITLE = "\u041F\u0440\u0438\u0447\u0438\u043D\u0430 ";
|
|
2
3
|
export declare const dataGridRowClassnames: {
|
|
4
|
+
root: string;
|
|
5
|
+
showConnector: string;
|
|
3
6
|
hidden: string;
|
|
4
7
|
hover: string;
|
|
5
8
|
hasPinnedColumns: string;
|
|
9
|
+
checkbox: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const dataGridRowContentClassnames: {
|
|
12
|
+
root: string;
|
|
13
|
+
hovered: string;
|
|
6
14
|
};
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.dataGridRowClassnames = exports.DISABLE_ROW_ATTR = void 0;
|
|
3
|
+
exports.dataGridRowContentClassnames = exports.dataGridRowClassnames = exports.MOBILE_DRAWER_TITLE = exports.DISABLE_ROW_ATTR = void 0;
|
|
4
4
|
const createUIKitClassname_1 = require("../../utils/createUIKitClassname");
|
|
5
5
|
exports.DISABLE_ROW_ATTR = 'data-row-disable';
|
|
6
|
+
exports.MOBILE_DRAWER_TITLE = 'Причина ';
|
|
6
7
|
exports.dataGridRowClassnames = {
|
|
8
|
+
root: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__row'),
|
|
9
|
+
showConnector: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__row_show-connector'),
|
|
7
10
|
hidden: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__row_hidden'),
|
|
8
11
|
hover: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__row_hover'),
|
|
9
12
|
hasPinnedColumns: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__row_has-pinned-columns'),
|
|
13
|
+
checkbox: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__row-checkbox'),
|
|
14
|
+
};
|
|
15
|
+
exports.dataGridRowContentClassnames = {
|
|
16
|
+
root: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__row-content'),
|
|
17
|
+
hovered: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__row-content_hovered'),
|
|
10
18
|
};
|
|
@@ -2,24 +2,15 @@
|
|
|
2
2
|
export declare const Wrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
4
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
|
-
} & {
|
|
6
|
-
$isShowConnector: boolean;
|
|
7
|
-
$level: number;
|
|
8
5
|
}, import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, {}>;
|
|
9
6
|
export declare const ContentWrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
10
7
|
theme?: import("@emotion/react").Theme | undefined;
|
|
11
8
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
12
9
|
} & {
|
|
13
|
-
$isShowConnector: boolean;
|
|
14
|
-
$isHovered?: boolean | undefined;
|
|
15
|
-
$isSelected?: boolean | undefined;
|
|
16
10
|
$gridColumns: string;
|
|
17
|
-
$level: number;
|
|
18
11
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
19
12
|
export declare const CellStyled: import("@emotion/styled/dist/declarations/src/types").StyledComponent<import("../Cell").CellProps<Record<string, unknown>> & {
|
|
20
13
|
theme?: import("@emotion/react").Theme | undefined;
|
|
21
|
-
} & {
|
|
22
|
-
$level: number;
|
|
23
14
|
}, {}, {}>;
|
|
24
15
|
export declare const CheckboxCell: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
25
16
|
theme?: import("@emotion/react").Theme | undefined;
|
|
@@ -48,3 +39,7 @@ export declare const ChevronIcon: import("@emotion/styled/dist/declarations/src/
|
|
|
48
39
|
} & {
|
|
49
40
|
$isActive?: boolean | undefined;
|
|
50
41
|
}, {}, {}>;
|
|
42
|
+
export declare const BottomDrawerContent: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
43
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
44
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
45
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ChevronIcon = exports.CollapseButton = exports.CollapseCell = exports.CheckboxCell = exports.CellStyled = exports.ContentWrapper = exports.Wrapper = void 0;
|
|
3
|
+
exports.BottomDrawerContent = exports.ChevronIcon = exports.CollapseButton = exports.CollapseCell = exports.CheckboxCell = exports.CellStyled = exports.ContentWrapper = exports.Wrapper = void 0;
|
|
4
4
|
const ChevronROutlineMd_1 = require("../../../icons/ChevronROutlineMd");
|
|
5
5
|
const IconButton_1 = require("../../IconButton");
|
|
6
6
|
const styled_1 = require("../../styled");
|
|
@@ -8,6 +8,7 @@ const Cell_1 = require("../Cell");
|
|
|
8
8
|
const constants_1 = require("../constants");
|
|
9
9
|
const constants_2 = require("./constants");
|
|
10
10
|
exports.Wrapper = styled_1.styled.li `
|
|
11
|
+
--level: 0;
|
|
11
12
|
position: relative;
|
|
12
13
|
|
|
13
14
|
&:not(:last-of-type)::before,
|
|
@@ -17,15 +18,36 @@ exports.Wrapper = styled_1.styled.li `
|
|
|
17
18
|
position: absolute;
|
|
18
19
|
z-index: 1;
|
|
19
20
|
top: 0;
|
|
20
|
-
transform:
|
|
21
|
+
transform: translateX(calc(${constants_1.ROOT_ACTION_CELL_WIDTH}px * var(--level) - ${constants_1.TREE_LINE_WIDTH}px));
|
|
21
22
|
|
|
22
|
-
display:
|
|
23
|
+
display: none;
|
|
23
24
|
|
|
24
25
|
width: 0;
|
|
25
26
|
height: 100%;
|
|
26
27
|
|
|
27
28
|
border-left: 1px solid ${({ theme }) => theme.palette.components.border.default};
|
|
28
29
|
}
|
|
30
|
+
|
|
31
|
+
${({ theme }) => theme.breakpoints.up('sm')} {
|
|
32
|
+
&.${constants_2.dataGridRowClassnames.showConnector}::before,
|
|
33
|
+
& .${constants_2.dataGridRowContentClassnames.root}::before {
|
|
34
|
+
display: block;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
39
|
+
padding-bottom: ${({ theme }) => theme.spacing(3)};
|
|
40
|
+
|
|
41
|
+
border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
42
|
+
|
|
43
|
+
&:not(:first-of-type) {
|
|
44
|
+
padding-top: ${({ theme }) => theme.spacing(5)};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&:first-of-type {
|
|
48
|
+
padding-top: ${({ theme }) => theme.spacing(1)};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
29
51
|
`;
|
|
30
52
|
exports.ContentWrapper = styled_1.styled.div `
|
|
31
53
|
position: relative;
|
|
@@ -33,16 +55,14 @@ exports.ContentWrapper = styled_1.styled.div `
|
|
|
33
55
|
display: grid;
|
|
34
56
|
grid-template-columns: ${({ $gridColumns }) => $gridColumns};
|
|
35
57
|
|
|
36
|
-
background-color:
|
|
58
|
+
background-color: transparent;
|
|
37
59
|
|
|
38
60
|
&::before {
|
|
39
61
|
content: '';
|
|
40
62
|
|
|
41
63
|
position: absolute;
|
|
42
64
|
top: 0;
|
|
43
|
-
transform:
|
|
44
|
-
|
|
45
|
-
display: ${({ $isShowConnector }) => ($isShowConnector ? 'block' : 'none')};
|
|
65
|
+
transform: translateX(calc(${constants_1.ROOT_ACTION_CELL_WIDTH}px * var(--level) - ${constants_1.TREE_LINE_WIDTH}px));
|
|
46
66
|
|
|
47
67
|
width: ${constants_1.TREE_LINE_WIDTH}px;
|
|
48
68
|
height: 50%;
|
|
@@ -50,25 +70,48 @@ exports.ContentWrapper = styled_1.styled.div `
|
|
|
50
70
|
border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
|
|
51
71
|
border-left: 1px solid ${({ theme }) => theme.palette.components.border.default};
|
|
52
72
|
border-radius: 0 0 0 ${({ theme }) => theme.shape.small};
|
|
73
|
+
|
|
74
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
75
|
+
display: none;
|
|
76
|
+
}
|
|
53
77
|
}
|
|
54
78
|
|
|
55
79
|
&:hover {
|
|
56
|
-
cursor: ${({ $isHovered }) => ($isHovered ? 'pointer' : 'default')};
|
|
57
|
-
|
|
58
80
|
background-color: ${({ theme }) => theme.palette.background.elementHover};
|
|
81
|
+
&.${constants_2.dataGridRowContentClassnames.hovered} {
|
|
82
|
+
cursor: pointer;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
86
|
+
cursor: initial;
|
|
87
|
+
|
|
88
|
+
background-color: transparent;
|
|
89
|
+
}
|
|
59
90
|
}
|
|
60
91
|
|
|
61
92
|
|
|
62
93
|
&.${constants_2.dataGridRowClassnames.hover} {
|
|
63
|
-
|
|
94
|
+
background-color: ${({ theme }) => theme.palette.background.elementHover};
|
|
95
|
+
&.${constants_2.dataGridRowContentClassnames.hovered} {
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
100
|
+
cursor: initial;
|
|
101
|
+
|
|
102
|
+
background-color: transparent;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
64
105
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
: theme.
|
|
106
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
107
|
+
grid-template-columns: 1fr;
|
|
108
|
+
gap: ${({ theme }) => theme.spacing(3)};
|
|
68
109
|
}
|
|
69
110
|
`;
|
|
70
111
|
exports.CellStyled = (0, styled_1.styled)(Cell_1.Cell) `
|
|
71
|
-
|
|
112
|
+
&:first-of-type {
|
|
113
|
+
margin-left: calc(var(--level) * ${constants_1.ROOT_ACTION_CELL_WIDTH}px);
|
|
114
|
+
}
|
|
72
115
|
`;
|
|
73
116
|
exports.CheckboxCell = styled_1.styled.div `
|
|
74
117
|
display: flex;
|
|
@@ -84,6 +127,10 @@ exports.CollapseCell = styled_1.styled.div `
|
|
|
84
127
|
justify-content: center;
|
|
85
128
|
|
|
86
129
|
width: ${constants_1.ROOT_ACTION_CELL_WIDTH}px;
|
|
130
|
+
|
|
131
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
132
|
+
display: none;
|
|
133
|
+
}
|
|
87
134
|
`;
|
|
88
135
|
exports.CollapseButton = (0, styled_1.styled)(IconButton_1.IconButton) `
|
|
89
136
|
width: 24px;
|
|
@@ -105,3 +152,8 @@ exports.ChevronIcon = (0, styled_1.styled)(ChevronROutlineMd_1.ChevronROutlineMd
|
|
|
105
152
|
duration: theme.transitions.duration.short,
|
|
106
153
|
})};
|
|
107
154
|
`;
|
|
155
|
+
exports.BottomDrawerContent = styled_1.styled.div `
|
|
156
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
157
|
+
padding: ${({ theme }) => theme.spacing(5, 4)};
|
|
158
|
+
}
|
|
159
|
+
`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ChangeEvent, type ReactNode } from 'react';
|
|
1
|
+
import { type ChangeEvent, type CSSProperties, type ReactNode } from 'react';
|
|
2
2
|
import { type Variant } from '../enums';
|
|
3
3
|
import { type CellValue, type DataGridColumns, type DataGridRowOptions } from '../types';
|
|
4
4
|
export type RowProps<TData extends Record<string, CellValue>> = {
|
|
@@ -115,4 +115,8 @@ export type RowProps<TData extends Record<string, CellValue>> = {
|
|
|
115
115
|
* Обработчик выхода из строки
|
|
116
116
|
*/
|
|
117
117
|
onRowLeave?: (rowId: string, event: PointerEvent) => void;
|
|
118
|
+
/**
|
|
119
|
+
* Стили для строки
|
|
120
|
+
*/
|
|
121
|
+
style?: CSSProperties;
|
|
118
122
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useMobileLogic';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./useMobileLogic"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useMobileLogic = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const useViewportType_1 = require("../../../../useViewportType");
|
|
6
|
+
const useMobileLogic = () => {
|
|
7
|
+
const { isMobile } = (0, useViewportType_1.useViewportType)();
|
|
8
|
+
const [isDrawerOpen, setIsDrawerOpen] = (0, react_1.useState)(false);
|
|
9
|
+
const handleOpenDrawer = () => {
|
|
10
|
+
if (isMobile) {
|
|
11
|
+
setIsDrawerOpen(true);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const handleCloseDrawer = () => {
|
|
15
|
+
setIsDrawerOpen(false);
|
|
16
|
+
};
|
|
17
|
+
return { isDrawerOpen, handleOpenDrawer, handleCloseDrawer };
|
|
18
|
+
};
|
|
19
|
+
exports.useMobileLogic = useMobileLogic;
|