@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.
@@ -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\n cursor: ", ";\n padding: ", ";\n color: ", ";\n user-select: none;\n"], ["\n width: ", ";\n\n cursor: ", ";\n padding: ", ";\n color: ", ";\n user-select: none;\n"])), function (_a) {
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 { DataGridPaginationProps } from './types';
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
  };
@@ -1,2 +1 @@
1
1
  export * from './DataGridPagination';
2
- export * from './types';
@@ -15,4 +15,3 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./DataGridPagination"), exports);
18
- __exportStar(require("./types"), exports);
@@ -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\n cursor: ", ";\n padding: ", ";\n color: ", ";\n user-select: none;\n"], ["\n width: ", ";\n\n cursor: ", ";\n padding: ", ";\n color: ", ";\n user-select: none;\n"])), function (_a) {
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 { DataGridPaginationProps } from './types';
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
  };
@@ -1,2 +1 @@
1
1
  export * from './DataGridPagination';
2
- export * from './types';
@@ -1,2 +1 @@
1
1
  export * from './DataGridPagination';
2
- export * from './types';
@@ -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
  };
@@ -12,6 +12,7 @@ export var MuiTypography = {
12
12
  variantMapping: {
13
13
  link: 'a',
14
14
  code: 'code',
15
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
15
16
  },
16
17
  },
17
18
  };
@@ -1,2 +1,4 @@
1
1
  import { useTheme as useEmotionTheme } from '@emotion/react';
2
+ // any необходим для коннекта темы
3
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2
4
  export var useTheme = function () { return useEmotionTheme(); };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astral/ui",
3
- "version": "0.41.2",
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.2",
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",
@@ -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;
@@ -15,6 +15,7 @@ exports.MuiTypography = {
15
15
  variantMapping: {
16
16
  link: 'a',
17
17
  code: 'code',
18
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
19
  },
19
20
  },
20
21
  };
@@ -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,6 +0,0 @@
1
- import { PaginationProps } from '../Pagination';
2
- export declare type DataGridPaginationProps = Omit<PaginationProps, 'count'> & {
3
- totalCount: number;
4
- rowsPerPage?: number;
5
- page: number;
6
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +0,0 @@
1
- import { PaginationProps } from '../Pagination';
2
- export declare type DataGridPaginationProps = Omit<PaginationProps, 'count'> & {
3
- totalCount: number;
4
- rowsPerPage?: number;
5
- page: number;
6
- };
@@ -1 +0,0 @@
1
- export {};