@astral/ui 4.62.2 → 4.64.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/ConfirmDialog/ConfirmDialog.js +2 -2
- package/components/ConfirmDialog/types.d.ts +2 -2
- package/components/DataGrid/Body/styles.js +4 -0
- package/components/DataGrid/Cell/Cell.d.ts +6 -2
- package/components/DataGrid/Cell/Cell.js +18 -2
- package/components/DataGrid/Cell/constants.d.ts +6 -0
- package/components/DataGrid/Cell/constants.js +6 -0
- package/components/DataGrid/Cell/index.d.ts +1 -0
- package/components/DataGrid/Cell/index.js +1 -0
- package/components/DataGrid/Cell/styles.d.ts +1 -8
- package/components/DataGrid/Cell/styles.js +43 -8
- package/components/DataGrid/DataGrid.js +11 -2
- package/components/DataGrid/Head/Head.js +14 -30
- package/components/DataGrid/Head/HeadColumns/GroupColumns/GroupColumns.d.ts +14 -0
- package/components/DataGrid/Head/HeadColumns/GroupColumns/GroupColumns.js +4 -0
- package/components/DataGrid/Head/HeadColumns/GroupColumns/index.d.ts +1 -0
- package/components/DataGrid/Head/HeadColumns/GroupColumns/index.js +1 -0
- package/components/DataGrid/Head/HeadColumns/HeadCellStartAdornment/HeadCellStartAdornment.d.ts +9 -0
- package/components/DataGrid/Head/HeadColumns/HeadCellStartAdornment/HeadCellStartAdornment.js +9 -0
- package/components/DataGrid/Head/HeadColumns/HeadCellStartAdornment/index.d.ts +1 -0
- package/components/DataGrid/Head/HeadColumns/HeadCellStartAdornment/index.js +1 -0
- package/components/DataGrid/Head/HeadColumns/HeadCellStartAdornment/styles.d.ts +5 -0
- package/components/DataGrid/Head/HeadColumns/HeadCellStartAdornment/styles.js +9 -0
- package/components/DataGrid/Head/HeadColumns/HeadColumns.d.ts +41 -0
- package/components/DataGrid/Head/HeadColumns/HeadColumns.js +26 -0
- package/components/DataGrid/Head/HeadColumns/SingleColumn/SingleColumn.d.ts +13 -0
- package/components/DataGrid/Head/HeadColumns/SingleColumn/SingleColumn.js +3 -0
- package/components/DataGrid/Head/HeadColumns/SingleColumn/index.d.ts +1 -0
- package/components/DataGrid/Head/HeadColumns/SingleColumn/index.js +1 -0
- package/components/DataGrid/Head/HeadColumns/index.d.ts +1 -0
- package/components/DataGrid/Head/HeadColumns/index.js +1 -0
- package/components/DataGrid/Head/HeadColumns/styles.d.ts +5 -0
- package/components/DataGrid/Head/HeadColumns/styles.js +9 -0
- package/components/DataGrid/Head/HeadColumns/useLogic/useLogic.d.ts +12 -0
- package/components/DataGrid/Head/HeadColumns/useLogic/useLogic.js +46 -0
- package/components/DataGrid/Head/HeadColumns/useLogic/utils/getGridPositions/getGridPositions.d.ts +6 -0
- package/components/DataGrid/Head/HeadColumns/useLogic/utils/getGridPositions/getGridPositions.js +19 -0
- package/components/DataGrid/Head/HeadColumns/useLogic/utils/getGridPositions/index.d.ts +1 -0
- package/components/DataGrid/Head/HeadColumns/useLogic/utils/getGridPositions/index.js +1 -0
- package/components/DataGrid/Head/HeadColumns/useLogic/utils/index.d.ts +1 -0
- package/components/DataGrid/Head/HeadColumns/useLogic/utils/index.js +1 -0
- package/components/DataGrid/Head/HeadColumns/utils/getHeadCellProps.d.ts +18 -0
- package/components/DataGrid/Head/HeadColumns/utils/getHeadCellProps.js +17 -0
- package/components/DataGrid/Head/HeadColumns/utils/index.d.ts +1 -0
- package/components/DataGrid/Head/HeadColumns/utils/index.js +1 -0
- package/components/DataGrid/Head/styles.d.ts +0 -4
- package/components/DataGrid/Head/styles.js +2 -8
- package/components/DataGrid/HeadCell/HeadCell.d.ts +11 -0
- package/components/DataGrid/HeadCell/HeadCell.js +21 -3
- package/components/DataGrid/HeadCell/constants.d.ts +11 -0
- package/components/DataGrid/HeadCell/constants.js +12 -0
- package/components/DataGrid/HeadCell/index.d.ts +1 -0
- package/components/DataGrid/HeadCell/index.js +1 -0
- package/components/DataGrid/HeadCell/styles.d.ts +1 -8
- package/components/DataGrid/HeadCell/styles.js +24 -7
- package/components/DataGrid/HeadCell/useLogic/useLogic.d.ts +5 -5
- package/components/DataGrid/HeadCell/useLogic/useLogic.js +8 -5
- package/components/DataGrid/PinnedSections/Section/styles.js +4 -0
- package/components/DataGrid/PinnedSections/Section/useLogic/useLogic.js +2 -2
- package/components/DataGrid/PinnedSections/styles.js +8 -4
- package/components/DataGrid/PinnedSections/useLogic/useLogic.js +10 -5
- package/components/DataGrid/Row/Row.js +22 -3
- package/components/DataGrid/Row/constants.d.ts +8 -0
- package/components/DataGrid/Row/constants.js +8 -0
- package/components/DataGrid/Row/styles.d.ts +10 -0
- package/components/DataGrid/Row/styles.js +15 -2
- package/components/DataGrid/constants.d.ts +4 -1
- package/components/DataGrid/constants.js +4 -1
- package/components/DataGrid/faker.js +13 -9
- package/components/DataGrid/index.d.ts +1 -1
- package/components/DataGrid/styles.js +84 -2
- package/components/DataGrid/types.d.ts +38 -1
- package/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.d.ts +2 -2
- package/components/DataGrid/useLogic/useLogic.d.ts +3 -1
- package/components/DataGrid/useLogic/useLogic.js +10 -6
- package/components/DataGrid/useLogic/utils/getColumnSections/getColumnSections.d.ts +1 -1
- package/components/DataGrid/useLogic/utils/getColumnSections/getColumnSections.js +17 -10
- package/components/DataGrid/utils/getFlattenColumns/getFlattenColumns.d.ts +2 -0
- package/components/DataGrid/utils/getFlattenColumns/getFlattenColumns.js +13 -0
- package/components/DataGrid/utils/getFlattenColumns/index.d.ts +1 -0
- package/components/DataGrid/utils/getFlattenColumns/index.js +1 -0
- package/components/DataGrid/utils/index.d.ts +2 -1
- package/components/DataGrid/utils/index.js +2 -1
- package/components/DataGrid/utils/isGroupColumns/index.d.ts +1 -0
- package/components/DataGrid/utils/isGroupColumns/index.js +1 -0
- package/components/DataGrid/utils/isGroupColumns/isGroupColumns.d.ts +2 -0
- package/components/DataGrid/utils/isGroupColumns/isGroupColumns.js +3 -0
- package/components/DataGridInfinite/DataGridInfinite.js +15 -3
- package/components/DataGridInfinite/useLogic/useLogic.d.ts +4 -1
- package/components/DataGridInfinite/useLogic/useLogic.js +10 -4
- package/components/Dialog/Dialog.d.ts +2 -24
- package/components/Dialog/Dialog.js +18 -11
- package/components/Dialog/constants.d.ts +5 -0
- package/components/Dialog/constants.js +6 -0
- package/components/Dialog/index.d.ts +2 -1
- package/components/Dialog/index.js +1 -1
- package/components/Dialog/public.d.ts +2 -1
- package/components/Dialog/public.js +1 -1
- package/components/Dialog/styles.js +11 -4
- package/components/Dialog/types.d.ts +23 -0
- package/components/Dialog/types.js +1 -0
- package/components/Dialog/useLogic/index.js +1 -0
- package/components/Dialog/useLogic/useLogic.d.ts +25 -0
- package/components/Dialog/useLogic/useLogic.js +19 -0
- package/components/PageLayoutContainer/PageLayoutContainer.js +2 -2
- package/components/PageLayoutContainer/styles.d.ts +1 -1
- package/components/PageLayoutContainer/styles.js +1 -1
- package/components/ResizingDataGrid/hooks/useComputedColumns/useComputedColumns.d.ts +1 -1
- package/components/ResizingDataGrid/hooks/useComputedColumns/utils/createComputedColumns/createComputedColumns.d.ts +2 -2
- package/components/ResizingDataGrid/types.d.ts +2 -2
- package/node/components/ConfirmDialog/ConfirmDialog.js +2 -2
- package/node/components/ConfirmDialog/types.d.ts +2 -2
- package/node/components/DataGrid/Body/styles.js +4 -0
- package/node/components/DataGrid/Cell/Cell.d.ts +6 -2
- package/node/components/DataGrid/Cell/Cell.js +18 -2
- package/node/components/DataGrid/Cell/constants.d.ts +6 -0
- package/node/components/DataGrid/Cell/constants.js +6 -0
- package/node/components/DataGrid/Cell/index.d.ts +1 -0
- package/node/components/DataGrid/Cell/index.js +3 -0
- package/node/components/DataGrid/Cell/styles.d.ts +1 -8
- package/node/components/DataGrid/Cell/styles.js +43 -8
- package/node/components/DataGrid/DataGrid.js +11 -2
- package/node/components/DataGrid/Head/Head.js +12 -28
- package/node/components/DataGrid/Head/HeadColumns/GroupColumns/GroupColumns.d.ts +14 -0
- package/node/components/DataGrid/Head/HeadColumns/GroupColumns/GroupColumns.js +8 -0
- package/node/components/DataGrid/Head/HeadColumns/GroupColumns/index.d.ts +1 -0
- package/node/components/DataGrid/{utils/alignToJustifyContent → Head/HeadColumns/GroupColumns}/index.js +1 -1
- package/node/components/DataGrid/Head/HeadColumns/HeadCellStartAdornment/HeadCellStartAdornment.d.ts +9 -0
- package/node/components/DataGrid/Head/HeadColumns/HeadCellStartAdornment/HeadCellStartAdornment.js +13 -0
- package/node/components/DataGrid/Head/HeadColumns/HeadCellStartAdornment/index.d.ts +1 -0
- package/node/components/DataGrid/Head/HeadColumns/HeadCellStartAdornment/index.js +17 -0
- package/node/components/DataGrid/Head/HeadColumns/HeadCellStartAdornment/styles.d.ts +5 -0
- package/node/components/DataGrid/Head/HeadColumns/HeadCellStartAdornment/styles.js +12 -0
- package/node/components/DataGrid/Head/HeadColumns/HeadColumns.d.ts +41 -0
- package/node/components/DataGrid/Head/HeadColumns/HeadColumns.js +30 -0
- package/node/components/DataGrid/Head/HeadColumns/SingleColumn/SingleColumn.d.ts +13 -0
- package/node/components/DataGrid/Head/HeadColumns/SingleColumn/SingleColumn.js +7 -0
- package/node/components/DataGrid/Head/HeadColumns/SingleColumn/index.d.ts +1 -0
- package/node/components/DataGrid/Head/HeadColumns/SingleColumn/index.js +17 -0
- package/node/components/DataGrid/Head/HeadColumns/index.d.ts +1 -0
- package/node/components/DataGrid/Head/HeadColumns/index.js +17 -0
- package/node/components/DataGrid/Head/HeadColumns/styles.d.ts +5 -0
- package/node/components/DataGrid/Head/HeadColumns/styles.js +12 -0
- package/node/components/DataGrid/Head/HeadColumns/useLogic/index.d.ts +1 -0
- package/node/components/DataGrid/Head/HeadColumns/useLogic/useLogic.d.ts +12 -0
- package/node/components/DataGrid/Head/{useLogic → HeadColumns/useLogic}/useLogic.js +25 -9
- package/node/components/DataGrid/Head/HeadColumns/useLogic/utils/getGridPositions/getGridPositions.d.ts +6 -0
- package/node/components/DataGrid/Head/HeadColumns/useLogic/utils/getGridPositions/getGridPositions.js +23 -0
- package/node/components/DataGrid/Head/HeadColumns/useLogic/utils/getGridPositions/index.d.ts +1 -0
- package/node/components/DataGrid/Head/HeadColumns/useLogic/utils/getGridPositions/index.js +17 -0
- package/node/components/DataGrid/Head/HeadColumns/useLogic/utils/index.d.ts +1 -0
- package/node/components/DataGrid/Head/HeadColumns/useLogic/utils/index.js +17 -0
- package/node/components/DataGrid/Head/HeadColumns/utils/getHeadCellProps.d.ts +18 -0
- package/node/components/DataGrid/Head/HeadColumns/utils/getHeadCellProps.js +21 -0
- package/node/components/DataGrid/Head/HeadColumns/utils/index.d.ts +1 -0
- package/node/components/DataGrid/Head/HeadColumns/utils/index.js +17 -0
- package/node/components/DataGrid/Head/styles.d.ts +0 -4
- package/node/components/DataGrid/Head/styles.js +3 -9
- package/node/components/DataGrid/HeadCell/HeadCell.d.ts +11 -0
- package/node/components/DataGrid/HeadCell/HeadCell.js +21 -3
- package/node/components/DataGrid/HeadCell/constants.d.ts +11 -0
- package/node/components/DataGrid/HeadCell/constants.js +15 -0
- package/node/components/DataGrid/HeadCell/index.d.ts +1 -0
- package/node/components/DataGrid/HeadCell/index.js +3 -0
- package/node/components/DataGrid/HeadCell/styles.d.ts +1 -8
- package/node/components/DataGrid/HeadCell/styles.js +24 -7
- package/node/components/DataGrid/HeadCell/useLogic/useLogic.d.ts +5 -5
- package/node/components/DataGrid/HeadCell/useLogic/useLogic.js +8 -5
- package/node/components/DataGrid/PinnedSections/Section/styles.js +4 -0
- package/node/components/DataGrid/PinnedSections/Section/useLogic/useLogic.js +1 -1
- package/node/components/DataGrid/PinnedSections/styles.js +8 -4
- package/node/components/DataGrid/PinnedSections/useLogic/useLogic.js +10 -5
- package/node/components/DataGrid/Row/Row.js +21 -2
- 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 +10 -0
- package/node/components/DataGrid/Row/styles.js +15 -2
- package/node/components/DataGrid/constants.d.ts +4 -1
- package/node/components/DataGrid/constants.js +4 -1
- package/node/components/DataGrid/faker.js +13 -9
- package/node/components/DataGrid/index.d.ts +1 -1
- package/node/components/DataGrid/styles.js +93 -11
- package/node/components/DataGrid/types.d.ts +38 -1
- package/node/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.d.ts +2 -2
- package/node/components/DataGrid/useLogic/useLogic.d.ts +3 -1
- package/node/components/DataGrid/useLogic/useLogic.js +9 -5
- package/node/components/DataGrid/useLogic/utils/getColumnSections/getColumnSections.d.ts +1 -1
- package/node/components/DataGrid/useLogic/utils/getColumnSections/getColumnSections.js +17 -10
- package/node/components/DataGrid/utils/getFlattenColumns/getFlattenColumns.d.ts +2 -0
- package/node/components/DataGrid/utils/getFlattenColumns/getFlattenColumns.js +17 -0
- package/node/components/DataGrid/utils/getFlattenColumns/index.d.ts +1 -0
- package/node/components/DataGrid/utils/getFlattenColumns/index.js +5 -0
- package/node/components/DataGrid/utils/index.d.ts +2 -1
- package/node/components/DataGrid/utils/index.js +5 -3
- package/node/components/DataGrid/utils/isGroupColumns/index.d.ts +1 -0
- package/node/components/DataGrid/utils/isGroupColumns/index.js +17 -0
- package/node/components/DataGrid/utils/isGroupColumns/isGroupColumns.d.ts +2 -0
- package/node/components/DataGrid/utils/isGroupColumns/isGroupColumns.js +7 -0
- package/node/components/DataGridInfinite/DataGridInfinite.js +15 -3
- package/node/components/DataGridInfinite/useLogic/useLogic.d.ts +4 -1
- package/node/components/DataGridInfinite/useLogic/useLogic.js +9 -3
- package/node/components/Dialog/Dialog.d.ts +2 -24
- package/node/components/Dialog/Dialog.js +18 -11
- package/node/components/Dialog/constants.d.ts +5 -0
- package/node/components/Dialog/constants.js +7 -1
- package/node/components/Dialog/index.d.ts +2 -1
- package/node/components/Dialog/index.js +2 -1
- package/node/components/Dialog/public.d.ts +2 -1
- package/node/components/Dialog/public.js +2 -1
- package/node/components/Dialog/styles.js +12 -25
- package/node/components/Dialog/types.d.ts +23 -0
- package/node/components/Dialog/types.js +2 -0
- package/node/components/Dialog/useLogic/index.d.ts +1 -0
- package/node/components/Dialog/useLogic/index.js +17 -0
- package/node/components/Dialog/useLogic/useLogic.d.ts +25 -0
- package/node/components/Dialog/useLogic/useLogic.js +23 -0
- package/node/components/PageLayoutContainer/PageLayoutContainer.js +1 -1
- package/node/components/PageLayoutContainer/styles.d.ts +1 -1
- package/node/components/PageLayoutContainer/styles.js +2 -2
- package/node/components/ResizingDataGrid/hooks/useComputedColumns/useComputedColumns.d.ts +1 -1
- package/node/components/ResizingDataGrid/hooks/useComputedColumns/utils/createComputedColumns/createComputedColumns.d.ts +2 -2
- package/node/components/ResizingDataGrid/types.d.ts +2 -2
- package/package.json +1 -1
- package/components/DataGrid/Head/useLogic/useLogic.d.ts +0 -12
- package/components/DataGrid/Head/useLogic/useLogic.js +0 -30
- package/components/DataGrid/utils/alignToJustifyContent/alignToJustifyContent.d.ts +0 -5
- package/components/DataGrid/utils/alignToJustifyContent/alignToJustifyContent.js +0 -7
- package/components/DataGrid/utils/alignToJustifyContent/constants.d.ts +0 -6
- package/components/DataGrid/utils/alignToJustifyContent/constants.js +0 -6
- package/components/DataGrid/utils/alignToJustifyContent/index.d.ts +0 -1
- package/components/DataGrid/utils/alignToJustifyContent/index.js +0 -1
- package/node/components/DataGrid/Head/useLogic/useLogic.d.ts +0 -12
- package/node/components/DataGrid/utils/alignToJustifyContent/alignToJustifyContent.d.ts +0 -5
- package/node/components/DataGrid/utils/alignToJustifyContent/alignToJustifyContent.js +0 -11
- package/node/components/DataGrid/utils/alignToJustifyContent/constants.d.ts +0 -6
- package/node/components/DataGrid/utils/alignToJustifyContent/constants.js +0 -9
- package/node/components/DataGrid/utils/alignToJustifyContent/index.d.ts +0 -1
- /package/components/DataGrid/Head/{useLogic → HeadColumns/useLogic}/index.d.ts +0 -0
- /package/components/DataGrid/Head/{useLogic → HeadColumns/useLogic}/index.js +0 -0
- /package/{node/components/DataGrid/Head → components/Dialog}/useLogic/index.d.ts +0 -0
- /package/node/components/DataGrid/Head/{useLogic → HeadColumns/useLogic}/index.js +0 -0
|
@@ -1,25 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getColumnSections = exports.validatePinnedColumns = void 0;
|
|
4
|
+
const ErrorService_1 = require("../../../../services/ErrorService");
|
|
5
|
+
const utils_1 = require("../../../utils");
|
|
4
6
|
/**
|
|
5
7
|
* Валидирует корректность комбинаций закрепления колонок.
|
|
6
8
|
* Выбрасывает ошибку, если колонки с pinned="right" не идут непрерывным блоком в конце
|
|
7
9
|
* или колонки с pinned="left" не идут непрерывным блоком в начале.
|
|
8
10
|
*/
|
|
9
|
-
const validatePinnedColumns = (
|
|
11
|
+
const validatePinnedColumns = (columns) => {
|
|
12
|
+
const errorService = ErrorService_1.ErrorService.getInstance();
|
|
13
|
+
const positions = columns.map((c) => c.pinned ?? 'center');
|
|
10
14
|
const firstRight = positions.indexOf('right');
|
|
11
15
|
if (firstRight !== -1 &&
|
|
12
16
|
positions.slice(firstRight).some((p) => p !== 'right')) {
|
|
13
|
-
|
|
14
|
-
console.error('DataGrid: Колонки с pinned="right" должны идти непрерывным блоком в конце');
|
|
17
|
+
errorService.logError('DataGrid', 'Колонки с pinned="right" должны идти непрерывным блоком в конце');
|
|
15
18
|
}
|
|
16
19
|
// left: должны быть в начале
|
|
17
20
|
const lastLeft = positions.lastIndexOf('left');
|
|
18
21
|
if (lastLeft !== -1 &&
|
|
19
22
|
positions.slice(0, lastLeft + 1).some((p) => p !== 'left')) {
|
|
20
|
-
|
|
21
|
-
console.error('DataGrid: Колонки с pinned="left" должны идти непрерывным блоком в начале');
|
|
23
|
+
errorService.logError('DataGrid', 'Колонки с pinned="left" должны идти непрерывным блоком в начале');
|
|
22
24
|
}
|
|
25
|
+
columns.forEach((column) => {
|
|
26
|
+
if ((0, utils_1.isGroupColumns)(column) &&
|
|
27
|
+
column.children.some((child) => child.pinned)) {
|
|
28
|
+
errorService.logError('DataGrid', 'pinned должен быть указан у родительской колонки, а не у дочерних элементов');
|
|
29
|
+
}
|
|
30
|
+
});
|
|
23
31
|
};
|
|
24
32
|
exports.validatePinnedColumns = validatePinnedColumns;
|
|
25
33
|
/**
|
|
@@ -29,6 +37,7 @@ exports.validatePinnedColumns = validatePinnedColumns;
|
|
|
29
37
|
* - right (закреплены справа)
|
|
30
38
|
*/
|
|
31
39
|
const getColumnSections = (columns) => {
|
|
40
|
+
(0, exports.validatePinnedColumns)(columns);
|
|
32
41
|
const groups = columns.reduce((acc, col) => {
|
|
33
42
|
const position = col.pinned ?? 'center';
|
|
34
43
|
if (!acc[position]) {
|
|
@@ -37,13 +46,11 @@ const getColumnSections = (columns) => {
|
|
|
37
46
|
acc[position].push(col);
|
|
38
47
|
return acc;
|
|
39
48
|
}, {});
|
|
40
|
-
const positions = columns.map((c) => c.pinned ?? 'center');
|
|
41
|
-
(0, exports.validatePinnedColumns)(positions);
|
|
42
49
|
return {
|
|
43
50
|
sections: [
|
|
44
|
-
{ position: 'left', columns: groups.left },
|
|
45
|
-
{ position: 'center', columns: groups.center },
|
|
46
|
-
{ position: 'right', columns: groups.right },
|
|
51
|
+
{ position: 'left', columns: groups.left || [] },
|
|
52
|
+
{ position: 'center', columns: groups.center || [] },
|
|
53
|
+
{ position: 'right', columns: groups.right || [] },
|
|
47
54
|
],
|
|
48
55
|
};
|
|
49
56
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFlattenColumns = void 0;
|
|
4
|
+
const isGroupColumns_1 = require("../isGroupColumns");
|
|
5
|
+
const getFlattenColumns = (columns, pinned) => {
|
|
6
|
+
return columns.flatMap((column) => {
|
|
7
|
+
const currentPinned = column.pinned ?? pinned;
|
|
8
|
+
if ((0, isGroupColumns_1.isGroupColumns)(column)) {
|
|
9
|
+
return (0, exports.getFlattenColumns)(column.children, currentPinned);
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
...column,
|
|
13
|
+
pinned: currentPinned,
|
|
14
|
+
};
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
exports.getFlattenColumns = getFlattenColumns;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getFlattenColumns } from './getFlattenColumns';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFlattenColumns = void 0;
|
|
4
|
+
var getFlattenColumns_1 = require("./getFlattenColumns");
|
|
5
|
+
Object.defineProperty(exports, "getFlattenColumns", { enumerable: true, get: function () { return getFlattenColumns_1.getFlattenColumns; } });
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export { alignToJustifyContent } from './alignToJustifyContent';
|
|
2
1
|
export { getDataGridCssVars } from './getDataGridCssVars';
|
|
3
2
|
export { getGridTemplateColumns } from './getGridTemplateColumns';
|
|
3
|
+
export { isGroupColumns } from './isGroupColumns';
|
|
4
|
+
export { getFlattenColumns } from './getFlattenColumns';
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var alignToJustifyContent_1 = require("./alignToJustifyContent");
|
|
5
|
-
Object.defineProperty(exports, "alignToJustifyContent", { enumerable: true, get: function () { return alignToJustifyContent_1.alignToJustifyContent; } });
|
|
3
|
+
exports.getFlattenColumns = exports.isGroupColumns = exports.getGridTemplateColumns = exports.getDataGridCssVars = void 0;
|
|
6
4
|
var getDataGridCssVars_1 = require("./getDataGridCssVars");
|
|
7
5
|
Object.defineProperty(exports, "getDataGridCssVars", { enumerable: true, get: function () { return getDataGridCssVars_1.getDataGridCssVars; } });
|
|
8
6
|
var getGridTemplateColumns_1 = require("./getGridTemplateColumns");
|
|
9
7
|
Object.defineProperty(exports, "getGridTemplateColumns", { enumerable: true, get: function () { return getGridTemplateColumns_1.getGridTemplateColumns; } });
|
|
8
|
+
var isGroupColumns_1 = require("./isGroupColumns");
|
|
9
|
+
Object.defineProperty(exports, "isGroupColumns", { enumerable: true, get: function () { return isGroupColumns_1.isGroupColumns; } });
|
|
10
|
+
var getFlattenColumns_1 = require("./getFlattenColumns");
|
|
11
|
+
Object.defineProperty(exports, "getFlattenColumns", { enumerable: true, get: function () { return getFlattenColumns_1.getFlattenColumns; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './isGroupColumns';
|
|
@@ -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("./isGroupColumns"), exports);
|
|
@@ -16,6 +16,7 @@ const styles_1 = require("../DataGrid/styles");
|
|
|
16
16
|
const Loader_1 = require("../Loader");
|
|
17
17
|
const ScrollToTopButton_1 = require("../ScrollToTopButton");
|
|
18
18
|
const classNames_1 = require("../utils/classNames");
|
|
19
|
+
const cva_1 = require("../utils/cva");
|
|
19
20
|
const getInertProps_1 = require("../utils/getInertProps");
|
|
20
21
|
const constants_2 = require("./constants");
|
|
21
22
|
const EndData_1 = require("./EndData");
|
|
@@ -25,14 +26,25 @@ const NoData_1 = require("./NoData");
|
|
|
25
26
|
const styles_2 = require("./styles");
|
|
26
27
|
const useLogic_1 = require("./useLogic");
|
|
27
28
|
const INITIAL_LEVEL = 0;
|
|
29
|
+
const dataGridInfiniteCva = (0, cva_1.cva)(constants_1.dataGridClassnames.root, {
|
|
30
|
+
variants: {
|
|
31
|
+
hasGroupedColumns: {
|
|
32
|
+
true: constants_1.dataGridClassnames.hasGroupedColumns,
|
|
33
|
+
},
|
|
34
|
+
gridViewMode: {
|
|
35
|
+
full: constants_1.dataGridClassnames.gridViewFull,
|
|
36
|
+
standard: constants_1.dataGridClassnames.gridViewStandard,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
});
|
|
28
40
|
const DataGridInfinite = (props) => {
|
|
29
41
|
const { imagesMap, emptySymbol } = (0, react_1.useContext)(ConfigProvider_1.ConfigContext);
|
|
30
|
-
const { isNoData, isDataGridDisabled, isStickyButtonActive, treeRenderConfig, virtuosoProps, headProps, rowProps, scrollToTopButtonProps, isEndReached, isHideHead, containerCssVars, isMobile, mobileSkeletonProps, } = (0, useLogic_1.useLogic)(props);
|
|
42
|
+
const { isNoData, isDataGridDisabled, isStickyButtonActive, treeRenderConfig, virtuosoProps, headProps, rowProps, scrollToTopButtonProps, isEndReached, isHideHead, containerCssVars, isMobile, mobileSkeletonProps, flattenColumns, hasGroupedColumns, gridViewMode, } = (0, useLogic_1.useLogic)(props);
|
|
31
43
|
const { columns, rows = [], selectedRows = [], sorting, isLoading, isDisabled, keyId, emptyCellValue = emptySymbol, variant = enums_1.Variant.Tree, subrows, className, isError, endOfScrollMsg, errorMsg, noDataPlaceholder, onRowClick, onSort, onRetry, headPreAddon, } = props;
|
|
32
44
|
const { moreButtonColumnPosition = 1, isVisibleCollapseButton = true } = subrows || {};
|
|
33
45
|
const { isInitialExpanded = false, expandedLevel = constants_1.EXPANDED_LEVEL_BY_DEFAULT, initialVisibleChildrenCount = constants_1.INITIAL_OPENED_NESTED_CHILDREN_COUNT_BY_DEFAULT, } = treeRenderConfig || {};
|
|
34
46
|
const TableContainer = isDisabled ? styles_2.DisabledDataGridWrapper : styles_2.DataGridWrapper;
|
|
35
|
-
return ((0, jsx_runtime_1.jsx)(DataGridContext_1.DataGridContextProvider, { children: (0, jsx_runtime_1.jsxs)(styles_1.Container, { style: containerCssVars, className: (0, classNames_1.classNames)(
|
|
47
|
+
return ((0, jsx_runtime_1.jsx)(DataGridContext_1.DataGridContextProvider, { children: (0, jsx_runtime_1.jsxs)(styles_1.Container, { style: containerCssVars, className: (0, classNames_1.classNames)(dataGridInfiniteCva({ hasGroupedColumns, gridViewMode }), className), children: [headPreAddon, (0, jsx_runtime_1.jsxs)(TableContainer, { ...(0, getInertProps_1.getInertProps)(isDataGridDisabled), children: [!isHideHead && ((0, jsx_runtime_1.jsx)(Head_1.Head, { ...headProps, onSort: onSort, sorting: sorting, columns: columns })), (0, jsx_runtime_1.jsx)(ContentState_1.ContentState, { isLoading: isLoading && !isNoData, loadingTitle: "\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0434\u0430\u043D\u043D\u044B\u0445", isError: isError && !isNoData, loadingContent: isMobile && (0, jsx_runtime_1.jsx)(DataGrid_1.MobileSkeleton, { ...mobileSkeletonProps }), errorState: {
|
|
36
48
|
imgAlt: 'Что-то пошло не так',
|
|
37
49
|
errorList: [errorMsg || ''],
|
|
38
50
|
imgSrc: imagesMap.defaultErrorImgSrc,
|
|
@@ -43,7 +55,7 @@ const DataGridInfinite = (props) => {
|
|
|
43
55
|
List: List_1.List,
|
|
44
56
|
Item: ({ children, item, ...itemProps }) => {
|
|
45
57
|
const { children: nestedChildren, options, ...row } = item;
|
|
46
|
-
return ((0, jsx_runtime_1.jsx)(Row_1.RowContextProvider, { children: (0, jsx_runtime_1.jsx)(Row_1.Row, { ...rowProps, ...itemProps, row: row, columns:
|
|
58
|
+
return ((0, jsx_runtime_1.jsx)(Row_1.RowContextProvider, { children: (0, jsx_runtime_1.jsx)(Row_1.Row, { ...rowProps, ...itemProps, row: row, columns: flattenColumns, selectedRows: selectedRows, options: options, keyId: keyId, variant: variant, level: INITIAL_LEVEL, nestedChildren: nestedChildren, isInitialExpanded: isInitialExpanded, expandedLevel: expandedLevel, initialVisibleChildrenCount: initialVisibleChildrenCount, moreButtonColumnPosition: moreButtonColumnPosition, isVisibleCollapseButton: isVisibleCollapseButton, emptyCellValue: emptyCellValue, onRowClick: onRowClick }) }));
|
|
47
59
|
},
|
|
48
60
|
EmptyPlaceholder: () => (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: noDataPlaceholder || (0, jsx_runtime_1.jsx)(NoData_1.NoData, {}) }),
|
|
49
61
|
Footer: () => {
|
|
@@ -4,12 +4,13 @@ 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, maxHeight, 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, gridViewMode: gridViewModeProp, }: UseLogicParams<TData, TSortField>) => {
|
|
8
8
|
containerCssVars: import("react").CSSProperties;
|
|
9
9
|
mobileSkeletonProps: {
|
|
10
10
|
cellsCount: number;
|
|
11
11
|
rowsCount: number;
|
|
12
12
|
};
|
|
13
|
+
flattenColumns: import("../../DataGrid").DataGridSingleColumn<TData>[];
|
|
13
14
|
isNoData: boolean;
|
|
14
15
|
isMobile: boolean;
|
|
15
16
|
isDataGridDisabled: boolean | undefined;
|
|
@@ -21,6 +22,8 @@ export declare const useLogic: <TData extends Record<string, unknown> = DataGrid
|
|
|
21
22
|
} | undefined;
|
|
22
23
|
isEndReached: boolean | undefined;
|
|
23
24
|
isHideHead: boolean;
|
|
25
|
+
hasGroupedColumns: boolean;
|
|
26
|
+
gridViewMode: "standard" | "full";
|
|
24
27
|
virtuosoProps: {
|
|
25
28
|
id: string;
|
|
26
29
|
ref: import("react").RefObject<VirtuosoHandle | null>;
|
|
@@ -10,7 +10,7 @@ const useViewportType_1 = require("../../useViewportType");
|
|
|
10
10
|
const prop_1 = require("../../utils/prop");
|
|
11
11
|
const uniqueBy_1 = require("../../utils/uniqueBy");
|
|
12
12
|
const constants_1 = require("../constants");
|
|
13
|
-
const useLogic = ({ keyId, columns, rows, variant, tree, subrows, selectedRows = [], maxHeight, 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, gridViewMode: gridViewModeProp = 'standard', }) => {
|
|
14
14
|
const virtuoso = (0, react_1.useRef)(null);
|
|
15
15
|
const { isMobile } = (0, useViewportType_1.useViewportType)();
|
|
16
16
|
const [hasVerticalScroll, setHasVerticalScroll] = (0, react_1.useState)(false);
|
|
@@ -22,7 +22,10 @@ const useLogic = ({ keyId, columns, rows, variant, tree, subrows, selectedRows =
|
|
|
22
22
|
? { ...subrows, isInitialExpanded: true }
|
|
23
23
|
: tree;
|
|
24
24
|
const availableRows = rows.filter((row) => !(row.options?.isDisabled || row.options?.isNotSelectable));
|
|
25
|
-
const
|
|
25
|
+
const flattenColumns = (0, react_1.useMemo)(() => (0, utils_1.getFlattenColumns)(columns), [columns]);
|
|
26
|
+
const hasGroupedColumns = columns.some(utils_1.isGroupColumns);
|
|
27
|
+
const gridViewMode = hasGroupedColumns ? 'full' : gridViewModeProp;
|
|
28
|
+
const gridColumns = (0, utils_1.getGridTemplateColumns)(flattenColumns);
|
|
26
29
|
const handleEndReach = (0, react_1.useCallback)(() => {
|
|
27
30
|
if (!isEndReached && onEndReached) {
|
|
28
31
|
onEndReached();
|
|
@@ -66,12 +69,13 @@ const useLogic = ({ keyId, columns, rows, variant, tree, subrows, selectedRows =
|
|
|
66
69
|
};
|
|
67
70
|
const isHideHead = isHideHeaderIfNoData && rows.length === 0;
|
|
68
71
|
const { mobileSkeletonProps } = (0, hooks_1.useDataGridMobileLogic)({
|
|
69
|
-
columns,
|
|
72
|
+
columns: flattenColumns,
|
|
70
73
|
});
|
|
71
74
|
const containerCssVars = (0, utils_1.getDataGridCssVars)(maxHeight);
|
|
72
75
|
return {
|
|
73
76
|
containerCssVars,
|
|
74
77
|
mobileSkeletonProps,
|
|
78
|
+
flattenColumns,
|
|
75
79
|
isNoData,
|
|
76
80
|
isMobile,
|
|
77
81
|
isDataGridDisabled,
|
|
@@ -79,6 +83,8 @@ const useLogic = ({ keyId, columns, rows, variant, tree, subrows, selectedRows =
|
|
|
79
83
|
treeRenderConfig,
|
|
80
84
|
isEndReached: isEndReached && hasVerticalScroll,
|
|
81
85
|
isHideHead,
|
|
86
|
+
hasGroupedColumns,
|
|
87
|
+
gridViewMode,
|
|
82
88
|
virtuosoProps: {
|
|
83
89
|
id: constants_1.VIRTUOSO_CONTAINER_ID,
|
|
84
90
|
ref: virtuoso,
|
|
@@ -1,24 +1,2 @@
|
|
|
1
|
-
import type { DialogProps
|
|
2
|
-
|
|
3
|
-
import type { WithoutEmotionSpecific } from '../types/WithoutEmotionSpecific';
|
|
4
|
-
export type DialogSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
5
|
-
export type DialogProps = WithoutEmotionSpecific<Omit<MuiDialogProps, 'title' | 'maxWidth'>> & {
|
|
6
|
-
/**
|
|
7
|
-
* Заголовок
|
|
8
|
-
*/
|
|
9
|
-
title?: ReactElement | ReactElement[] | string;
|
|
10
|
-
/**
|
|
11
|
-
* Отключить кликабельность фонового компонента
|
|
12
|
-
*/
|
|
13
|
-
disableBackdropClick?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Размер Dialog
|
|
16
|
-
* @default md
|
|
17
|
-
*/
|
|
18
|
-
size?: DialogSize;
|
|
19
|
-
/**
|
|
20
|
-
* Дополнительный контент хедера
|
|
21
|
-
*/
|
|
22
|
-
headerContent?: ReactNode;
|
|
23
|
-
};
|
|
24
|
-
export declare const Dialog: ({ children, title, disableBackdropClick, onClose, size, headerContent, ...props }: DialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import type { DialogProps } from './types';
|
|
2
|
+
export declare const Dialog: ({ children, title, disableBackdropClick, onClose, size, headerContent, className, classes, ...props }: DialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,20 +4,27 @@ exports.Dialog = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const BottomDrawer_1 = require("../BottomDrawer");
|
|
6
6
|
const DialogTitle_1 = require("../DialogTitle");
|
|
7
|
-
const
|
|
7
|
+
const classNames_1 = require("../utils/classNames");
|
|
8
|
+
const cva_1 = require("../utils/cva");
|
|
9
|
+
const constants_1 = require("./constants");
|
|
8
10
|
const styles_1 = require("./styles");
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
const useLogic_1 = require("./useLogic");
|
|
12
|
+
const dialogCva = (0, cva_1.cva)(constants_1.dialogClassnames.root, {
|
|
13
|
+
variants: {
|
|
14
|
+
withoutTitle: {
|
|
15
|
+
true: constants_1.dialogClassnames.withoutTitle,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
const Dialog = ({ children, title, disableBackdropClick, onClose, size = 'md', headerContent, className, classes, ...props }) => {
|
|
20
|
+
const { handleClose, isMobile, dialogClasses } = (0, useLogic_1.useLogic)({
|
|
21
|
+
onClose,
|
|
22
|
+
disableBackdropClick,
|
|
23
|
+
classes,
|
|
24
|
+
});
|
|
18
25
|
if (isMobile) {
|
|
19
26
|
return ((0, jsx_runtime_1.jsx)(BottomDrawer_1.BottomDrawer, { onClose: handleClose, title: title, headerContent: headerContent, ...props, children: children }));
|
|
20
27
|
}
|
|
21
|
-
return ((0, jsx_runtime_1.jsxs)(styles_1.StyledDialog, { "$size": size, onClose: handleClose, ...props, children: [title && ((0, jsx_runtime_1.jsx)(DialogTitle_1.DialogTitle, { onClose: onClose, headerContent: headerContent, children: title })), children] }));
|
|
28
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.StyledDialog, { "$size": size, onClose: handleClose, className: (0, classNames_1.classNames)(dialogCva({ withoutTitle: !title }), className), classes: dialogClasses, ...props, children: [title && ((0, jsx_runtime_1.jsx)(DialogTitle_1.DialogTitle, { onClose: onClose, headerContent: headerContent, children: title })), children] }));
|
|
22
29
|
};
|
|
23
30
|
exports.Dialog = Dialog;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DIALOG_SIZES = void 0;
|
|
3
|
+
exports.dialogClassnames = exports.DIALOG_SIZES = void 0;
|
|
4
|
+
const createUIKitClassname_1 = require("../utils/createUIKitClassname");
|
|
4
5
|
exports.DIALOG_SIZES = {
|
|
5
6
|
xs: { minWidth: '300px', maxWidth: '399px' },
|
|
6
7
|
sm: { minWidth: '400px', maxWidth: '499px' },
|
|
@@ -8,3 +9,8 @@ exports.DIALOG_SIZES = {
|
|
|
8
9
|
lg: { minWidth: '600px', maxWidth: '699px' },
|
|
9
10
|
xl: { minWidth: '700px', maxWidth: '980px' },
|
|
10
11
|
};
|
|
12
|
+
exports.dialogClassnames = {
|
|
13
|
+
root: (0, createUIKitClassname_1.createUIKitClassname)('dialog'),
|
|
14
|
+
withoutTitle: (0, createUIKitClassname_1.createUIKitClassname)('dialog_without-title'),
|
|
15
|
+
paper: (0, createUIKitClassname_1.createUIKitClassname)('dialog__paper'),
|
|
16
|
+
};
|
|
@@ -14,7 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.DIALOG_SIZES = void 0;
|
|
17
|
+
exports.dialogClassnames = exports.DIALOG_SIZES = void 0;
|
|
18
18
|
__exportStar(require("./Dialog"), exports);
|
|
19
19
|
var constants_1 = require("./constants");
|
|
20
20
|
Object.defineProperty(exports, "DIALOG_SIZES", { enumerable: true, get: function () { return constants_1.DIALOG_SIZES; } });
|
|
21
|
+
Object.defineProperty(exports, "dialogClassnames", { enumerable: true, get: function () { return constants_1.dialogClassnames; } });
|
|
@@ -14,7 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.DIALOG_SIZES = void 0;
|
|
17
|
+
exports.dialogClassnames = exports.DIALOG_SIZES = void 0;
|
|
18
18
|
var constants_1 = require("./constants");
|
|
19
19
|
Object.defineProperty(exports, "DIALOG_SIZES", { enumerable: true, get: function () { return constants_1.DIALOG_SIZES; } });
|
|
20
|
+
Object.defineProperty(exports, "dialogClassnames", { enumerable: true, get: function () { return constants_1.dialogClassnames; } });
|
|
20
21
|
__exportStar(require("./Dialog"), exports);
|
|
@@ -1,31 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
4
|
};
|
|
25
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
6
|
exports.StyledDialog = void 0;
|
|
27
7
|
const Backdrop_1 = require("@mui/material/Backdrop");
|
|
28
|
-
const Dialog_1 =
|
|
8
|
+
const Dialog_1 = __importDefault(require("@mui/material/Dialog"));
|
|
29
9
|
const DialogActions_1 = require("../DialogActions");
|
|
30
10
|
const DialogContent_1 = require("../DialogContent");
|
|
31
11
|
const styled_1 = require("../styled");
|
|
@@ -36,10 +16,17 @@ const getSize = (size) => {
|
|
|
36
16
|
exports.StyledDialog = (0, styled_1.styled)(Dialog_1.default, {
|
|
37
17
|
shouldForwardProp: (prop) => !['$size'].includes(prop),
|
|
38
18
|
}) `
|
|
39
|
-
&.${
|
|
19
|
+
&.${constants_1.dialogClassnames.root} .${Backdrop_1.backdropClasses.root} {
|
|
40
20
|
background-color: ${({ theme }) => theme.palette.background.modalShadow};
|
|
41
21
|
}
|
|
42
|
-
|
|
22
|
+
|
|
23
|
+
&.${constants_1.dialogClassnames.withoutTitle} {
|
|
24
|
+
& .${DialogContent_1.dialogContentClassnames.root} {
|
|
25
|
+
padding-top: ${({ theme }) => theme.spacing(6)};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.${constants_1.dialogClassnames.paper} {
|
|
43
30
|
min-width: ${({ $size }) => getSize($size).minWidth};
|
|
44
31
|
max-width: ${({ $size }) => getSize($size).maxWidth};
|
|
45
32
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { DialogProps as MuiDialogProps } from '@mui/material/Dialog';
|
|
2
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
3
|
+
import { type WithoutEmotionSpecific } from '../types/WithoutEmotionSpecific';
|
|
4
|
+
export type DialogSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
5
|
+
export type DialogProps = WithoutEmotionSpecific<Omit<MuiDialogProps, 'title' | 'maxWidth'>> & {
|
|
6
|
+
/**
|
|
7
|
+
* Заголовок
|
|
8
|
+
*/
|
|
9
|
+
title?: ReactElement | ReactElement[] | string;
|
|
10
|
+
/**
|
|
11
|
+
* Отключить кликабельность фонового компонента
|
|
12
|
+
*/
|
|
13
|
+
disableBackdropClick?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Размер Dialog
|
|
16
|
+
* @default md
|
|
17
|
+
*/
|
|
18
|
+
size?: DialogSize;
|
|
19
|
+
/**
|
|
20
|
+
* Дополнительный контент хедера
|
|
21
|
+
*/
|
|
22
|
+
headerContent?: ReactNode;
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useLogic';
|
|
@@ -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("./useLogic"), exports);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type MouseEvent } from 'react';
|
|
2
|
+
import { type DialogProps } from '../types';
|
|
3
|
+
type UseLogicParams = Pick<DialogProps, 'onClose' | 'disableBackdropClick' | 'classes'>;
|
|
4
|
+
export declare const useLogic: ({ onClose, disableBackdropClick, classes, }: UseLogicParams) => {
|
|
5
|
+
handleClose: ((event: MouseEvent<HTMLButtonElement>, reason: 'backdropClick' | 'escapeKeyDown') => void) | undefined;
|
|
6
|
+
isMobile: boolean;
|
|
7
|
+
dialogClasses: {
|
|
8
|
+
root?: string | undefined;
|
|
9
|
+
scrollPaper?: string | undefined;
|
|
10
|
+
scrollBody?: string | undefined;
|
|
11
|
+
container?: string | undefined;
|
|
12
|
+
paperScrollPaper?: string | undefined;
|
|
13
|
+
paperScrollBody?: string | undefined;
|
|
14
|
+
paperWidthFalse?: string | undefined;
|
|
15
|
+
paperWidthXs?: string | undefined;
|
|
16
|
+
paperWidthSm?: string | undefined;
|
|
17
|
+
paperWidthMd?: string | undefined;
|
|
18
|
+
paperWidthLg?: string | undefined;
|
|
19
|
+
paperWidthXl?: string | undefined;
|
|
20
|
+
paperFullWidth?: string | undefined;
|
|
21
|
+
paperFullScreen?: string | undefined;
|
|
22
|
+
paper: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useLogic = void 0;
|
|
4
|
+
const useViewportType_1 = require("../../useViewportType");
|
|
5
|
+
const classNames_1 = require("../../utils/classNames");
|
|
6
|
+
const constants_1 = require("../constants");
|
|
7
|
+
const useLogic = ({ onClose, disableBackdropClick, classes, }) => {
|
|
8
|
+
const { isMobile } = (0, useViewportType_1.useViewportType)();
|
|
9
|
+
const handleClose = onClose &&
|
|
10
|
+
((event, reason) => {
|
|
11
|
+
if (disableBackdropClick && reason === 'backdropClick') {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
onClose(event, reason);
|
|
15
|
+
});
|
|
16
|
+
const { paper, ...restClasses } = classes || {};
|
|
17
|
+
const dialogClasses = {
|
|
18
|
+
paper: (0, classNames_1.classNames)(constants_1.dialogClassnames.paper, paper),
|
|
19
|
+
...restClasses,
|
|
20
|
+
};
|
|
21
|
+
return { handleClose, isMobile, dialogClasses };
|
|
22
|
+
};
|
|
23
|
+
exports.useLogic = useLogic;
|
|
@@ -7,5 +7,5 @@ const classNames_1 = require("../utils/classNames");
|
|
|
7
7
|
const constants_1 = require("./constants");
|
|
8
8
|
const styles_1 = require("./styles");
|
|
9
9
|
exports.PageLayoutContainer = (0, react_1.forwardRef)(({ children, className }, forwardedRef) => {
|
|
10
|
-
return ((0, jsx_runtime_1.jsx)(styles_1.
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.StyledPaper, { variant: "outlined", children: (0, jsx_runtime_1.jsx)(styles_1.Wrapper, { className: (0, classNames_1.classNames)(className, constants_1.pageLayoutClassnames.root), ref: forwardedRef, children: children }) }));
|
|
11
11
|
});
|
|
@@ -3,6 +3,6 @@ export declare const Wrapper: 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<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const StyledPaper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../Paper").PaperProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
|
|
7
7
|
theme?: import("@emotion/react").Theme | undefined;
|
|
8
8
|
}, {}, {}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.StyledPaper = exports.Wrapper = void 0;
|
|
4
4
|
const Paper_1 = require("../Paper");
|
|
5
5
|
const styled_1 = require("../styled");
|
|
6
6
|
const constants_1 = require("./constants");
|
|
@@ -38,7 +38,7 @@ exports.Wrapper = styled_1.styled.div `
|
|
|
38
38
|
border: unset;
|
|
39
39
|
}
|
|
40
40
|
`;
|
|
41
|
-
exports.
|
|
41
|
+
exports.StyledPaper = (0, styled_1.styled)(Paper_1.Paper) `
|
|
42
42
|
height: 100%;
|
|
43
43
|
|
|
44
44
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
@@ -7,6 +7,6 @@ import type { ResizingColumns } from '../../types';
|
|
|
7
7
|
export declare const useComputedColumns: <TData extends DataGridRow = DataGridRow>(columns: ResizingColumns<TData>, storage?: Storage) => {
|
|
8
8
|
columnsWidths: any[];
|
|
9
9
|
setColumnsWidths: import("react").Dispatch<import("react").SetStateAction<any[]>>;
|
|
10
|
-
computedColumns: import("../../../DataGrid").
|
|
10
|
+
computedColumns: import("../../../DataGrid").DataGridSingleColumn<TData>[];
|
|
11
11
|
actionsColumnWidth: string | undefined;
|
|
12
12
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type DataGridRow, type DataGridSingleColumn } from '../../../../../DataGrid';
|
|
2
2
|
import { type ResizingColumns } from '../../../../types';
|
|
3
3
|
type CreateComputedColumnsResult<TData extends DataGridRow = DataGridRow> = {
|
|
4
|
-
computedColumns:
|
|
4
|
+
computedColumns: DataGridSingleColumn<TData>[];
|
|
5
5
|
actionsColumnWidth?: string;
|
|
6
6
|
};
|
|
7
7
|
/**
|