@astral/ui 0.41.2 → 0.41.3
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/DataGrid/DataGridHeadColumn/styled.js +4 -4
- package/DataGridPagination/DataGridPagination.d.ts +15 -1
- package/DataGridPagination/DataGridPagination.js +2 -2
- package/DataGridPagination/index.d.ts +0 -1
- package/DataGridPagination/index.js +0 -1
- package/esm/DataGrid/DataGridHeadColumn/styled.js +4 -4
- package/esm/DataGridPagination/DataGridPagination.d.ts +15 -1
- package/esm/DataGridPagination/DataGridPagination.js +2 -2
- package/esm/DataGridPagination/index.d.ts +0 -1
- package/esm/DataGridPagination/index.js +0 -1
- package/esm/theme/baseTheme.js +1 -0
- package/esm/theme/components/MuiTypography.js +1 -0
- package/esm/theme/hooks/useTheme/index.js +2 -0
- package/package.json +2 -2
- package/theme/baseTheme.js +1 -0
- package/theme/components/MuiTypography.js +1 -0
- package/theme/hooks/useTheme/index.js +2 -0
- package/DataGridPagination/types.d.ts +0 -6
- package/DataGridPagination/types.js +0 -2
- package/esm/DataGridPagination/types.d.ts +0 -6
- package/esm/DataGridPagination/types.js +0 -1
|
@@ -13,17 +13,17 @@ exports.StyledTableSortLabel = (0, styles_1.styled)(Table_1.TableSortLabel)(temp
|
|
|
13
13
|
});
|
|
14
14
|
exports.StyledTableCell = (0, styles_1.styled)(Table_1.TableCell, {
|
|
15
15
|
shouldForwardProp: function (prop) { return prop !== 'width'; },
|
|
16
|
-
})(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: ", ";\n
|
|
16
|
+
})(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: ", ";\n padding: ", ";\n\n color: ", ";\n\n cursor: ", ";\n\n user-select: none;\n"], ["\n width: ", ";\n padding: ", ";\n\n color: ", ";\n\n cursor: ", ";\n\n user-select: none;\n"])), function (_a) {
|
|
17
17
|
var _b = _a.width, width = _b === void 0 ? 'auto' : _b;
|
|
18
18
|
return width;
|
|
19
|
-
}, function (_a) {
|
|
20
|
-
var sortable = _a.sortable;
|
|
21
|
-
return (sortable ? 'pointer' : 'initial');
|
|
22
19
|
}, function (_a) {
|
|
23
20
|
var theme = _a.theme;
|
|
24
21
|
return theme.spacing(3, 4);
|
|
25
22
|
}, function (_a) {
|
|
26
23
|
var theme = _a.theme;
|
|
27
24
|
return theme.palette.grey[700];
|
|
25
|
+
}, function (_a) {
|
|
26
|
+
var sortable = _a.sortable;
|
|
27
|
+
return (sortable ? 'pointer' : 'initial');
|
|
28
28
|
});
|
|
29
29
|
var templateObject_1, templateObject_2;
|
|
@@ -1,3 +1,17 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { PaginationProps } from '../Pagination';
|
|
3
|
+
export declare type DataGridPaginationProps = Omit<PaginationProps, 'count'> & {
|
|
4
|
+
/**
|
|
5
|
+
* Количество всех записей
|
|
6
|
+
*/
|
|
7
|
+
totalCount: number;
|
|
8
|
+
/**
|
|
9
|
+
* Количество записей на страницу
|
|
10
|
+
*/
|
|
11
|
+
rowsPerPage?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Текущая страница
|
|
14
|
+
*/
|
|
15
|
+
page: number;
|
|
16
|
+
};
|
|
3
17
|
export declare const DataGridPagination: ({ page, rowsPerPage, totalCount, className, ...props }: DataGridPaginationProps) => JSX.Element;
|
|
@@ -30,8 +30,8 @@ var styled_1 = require("./styled");
|
|
|
30
30
|
var DataGridPagination = function (_a) {
|
|
31
31
|
var page = _a.page, _b = _a.rowsPerPage, rowsPerPage = _b === void 0 ? 10 : _b, totalCount = _a.totalCount, className = _a.className, props = __rest(_a, ["page", "rowsPerPage", "totalCount", "className"]);
|
|
32
32
|
var count = Math.ceil(totalCount / rowsPerPage);
|
|
33
|
-
var rangeStart = (0, react_1.useMemo)(function () { return page * rowsPerPage; }, [page]);
|
|
34
|
-
var rangeEnd = (0, react_1.useMemo)(function () { return page * rowsPerPage + rowsPerPage; }, [page]);
|
|
33
|
+
var rangeStart = (0, react_1.useMemo)(function () { return (page - 1) * rowsPerPage + 1; }, [page, rowsPerPage]);
|
|
34
|
+
var rangeEnd = (0, react_1.useMemo)(function () { return (page - 1) * rowsPerPage + rowsPerPage; }, [page, rowsPerPage]);
|
|
35
35
|
var formattedRange = "".concat(rangeStart, " \u2014 ").concat(rangeEnd, " \u0438\u0437 ").concat(totalCount, " \u0437\u0430\u043F\u0438\u0441\u0435\u0439");
|
|
36
36
|
return ((0, jsx_runtime_1.jsxs)(styled_1.PaginationWrapper, __assign({ className: className }, { children: [(0, jsx_runtime_1.jsx)(styled_1.Range, __assign({ variant: "h6" }, { children: formattedRange })), (0, jsx_runtime_1.jsx)(Pagination_1.Pagination, __assign({ count: count }, props))] })));
|
|
37
37
|
};
|
|
@@ -10,17 +10,17 @@ export var StyledTableSortLabel = styled(TableSortLabel)(templateObject_1 || (te
|
|
|
10
10
|
});
|
|
11
11
|
export var StyledTableCell = styled(TableCell, {
|
|
12
12
|
shouldForwardProp: function (prop) { return prop !== 'width'; },
|
|
13
|
-
})(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: ", ";\n
|
|
13
|
+
})(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: ", ";\n padding: ", ";\n\n color: ", ";\n\n cursor: ", ";\n\n user-select: none;\n"], ["\n width: ", ";\n padding: ", ";\n\n color: ", ";\n\n cursor: ", ";\n\n user-select: none;\n"])), function (_a) {
|
|
14
14
|
var _b = _a.width, width = _b === void 0 ? 'auto' : _b;
|
|
15
15
|
return width;
|
|
16
|
-
}, function (_a) {
|
|
17
|
-
var sortable = _a.sortable;
|
|
18
|
-
return (sortable ? 'pointer' : 'initial');
|
|
19
16
|
}, function (_a) {
|
|
20
17
|
var theme = _a.theme;
|
|
21
18
|
return theme.spacing(3, 4);
|
|
22
19
|
}, function (_a) {
|
|
23
20
|
var theme = _a.theme;
|
|
24
21
|
return theme.palette.grey[700];
|
|
22
|
+
}, function (_a) {
|
|
23
|
+
var sortable = _a.sortable;
|
|
24
|
+
return (sortable ? 'pointer' : 'initial');
|
|
25
25
|
});
|
|
26
26
|
var templateObject_1, templateObject_2;
|
|
@@ -1,3 +1,17 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { PaginationProps } from '../Pagination';
|
|
3
|
+
export declare type DataGridPaginationProps = Omit<PaginationProps, 'count'> & {
|
|
4
|
+
/**
|
|
5
|
+
* Количество всех записей
|
|
6
|
+
*/
|
|
7
|
+
totalCount: number;
|
|
8
|
+
/**
|
|
9
|
+
* Количество записей на страницу
|
|
10
|
+
*/
|
|
11
|
+
rowsPerPage?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Текущая страница
|
|
14
|
+
*/
|
|
15
|
+
page: number;
|
|
16
|
+
};
|
|
3
17
|
export declare const DataGridPagination: ({ page, rowsPerPage, totalCount, className, ...props }: DataGridPaginationProps) => JSX.Element;
|
|
@@ -27,8 +27,8 @@ import { PaginationWrapper, Range } from './styled';
|
|
|
27
27
|
export var DataGridPagination = function (_a) {
|
|
28
28
|
var page = _a.page, _b = _a.rowsPerPage, rowsPerPage = _b === void 0 ? 10 : _b, totalCount = _a.totalCount, className = _a.className, props = __rest(_a, ["page", "rowsPerPage", "totalCount", "className"]);
|
|
29
29
|
var count = Math.ceil(totalCount / rowsPerPage);
|
|
30
|
-
var rangeStart = useMemo(function () { return page * rowsPerPage; }, [page]);
|
|
31
|
-
var rangeEnd = useMemo(function () { return page * rowsPerPage + rowsPerPage; }, [page]);
|
|
30
|
+
var rangeStart = useMemo(function () { return (page - 1) * rowsPerPage + 1; }, [page, rowsPerPage]);
|
|
31
|
+
var rangeEnd = useMemo(function () { return (page - 1) * rowsPerPage + rowsPerPage; }, [page, rowsPerPage]);
|
|
32
32
|
var formattedRange = "".concat(rangeStart, " \u2014 ").concat(rangeEnd, " \u0438\u0437 ").concat(totalCount, " \u0437\u0430\u043F\u0438\u0441\u0435\u0439");
|
|
33
33
|
return (_jsxs(PaginationWrapper, __assign({ className: className }, { children: [_jsx(Range, __assign({ variant: "h6" }, { children: formattedRange })), _jsx(Pagination, __assign({ count: count }, props))] })));
|
|
34
34
|
};
|
package/esm/theme/baseTheme.js
CHANGED
|
@@ -17,5 +17,6 @@ export var createTheme = function (params) {
|
|
|
17
17
|
components: getComponents(fontsUrls),
|
|
18
18
|
};
|
|
19
19
|
var muiTheme = createMuiTheme(merge({}, themeOptions, options));
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
21
|
return merge(muiTheme, { elevation: elevation, shape: shape });
|
|
21
22
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astral/ui",
|
|
3
|
-
"version": "0.41.
|
|
3
|
+
"version": "0.41.3",
|
|
4
4
|
"browser": "./src/index.ts",
|
|
5
5
|
"jest": {
|
|
6
6
|
"moduleNameMapper": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
}
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@astral/icons": "^0.41.
|
|
11
|
+
"@astral/icons": "^0.41.3",
|
|
12
12
|
"@emotion/cache": "11.7.1",
|
|
13
13
|
"@emotion/react": "11.9.0",
|
|
14
14
|
"@emotion/server": "11.4.0",
|
package/theme/baseTheme.js
CHANGED
|
@@ -20,6 +20,7 @@ var createTheme = function (params) {
|
|
|
20
20
|
components: (0, components_1.getComponents)(fontsUrls),
|
|
21
21
|
};
|
|
22
22
|
var muiTheme = (0, styles_1.createTheme)((0, lodash_es_1.merge)({}, themeOptions, options));
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
24
|
return (0, lodash_es_1.merge)(muiTheme, { elevation: elevation_1.elevation, shape: shape_1.shape });
|
|
24
25
|
};
|
|
25
26
|
exports.createTheme = createTheme;
|
|
@@ -2,5 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useTheme = void 0;
|
|
4
4
|
var react_1 = require("@emotion/react");
|
|
5
|
+
// any необходим для коннекта темы
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
7
|
var useTheme = function () { return (0, react_1.useTheme)(); };
|
|
6
8
|
exports.useTheme = useTheme;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|