@pushwoosh/smart-components-kit 1.0.43 → 1.0.45

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.
@@ -18,7 +18,8 @@ export function DataTable(props) {
18
18
  context,
19
19
  renderTableTop,
20
20
  renderAfter,
21
- hidePagination
21
+ hidePagination,
22
+ hidePageSizeSelector
22
23
  } = props;
23
24
  const {
24
25
  data,
@@ -35,7 +36,8 @@ export function DataTable(props) {
35
36
  renderItem: props.renderItem
36
37
  }), !hidePagination && React.createElement(DataTablePagination, {
37
38
  allLimits: [10, 20, 50, 100],
38
- padding: paginationPadding
39
+ padding: paginationPadding,
40
+ hidePageSizeSelector: hidePageSizeSelector
39
41
  }, data.loading && React.createElement(Horizontal, {
40
42
  "$alignItems": "center",
41
43
  "$gap": 4
@@ -6,6 +6,7 @@ export type DataTableListProps<I, P extends DataTableParams> = {
6
6
  isBordered?: boolean;
7
7
  context: DataTableContextType<I, P>;
8
8
  hidePagination?: boolean;
9
+ hidePageSizeSelector?: boolean;
9
10
  paginationPadding?: string;
10
11
  renderTableTop?: (ctxValue: DataTableContextType<I, P>) => ReactNode;
11
12
  renderList: (ctxValue: DataTableContextType<I, P>) => ReactNode;
@@ -17,6 +18,7 @@ export type DataTableItemProps<I, P extends DataTableParams> = {
17
18
  isBordered?: boolean;
18
19
  context: DataTableContextType<I, P>;
19
20
  hidePagination?: boolean;
21
+ hidePageSizeSelector?: boolean;
20
22
  paginationPadding?: string;
21
23
  renderTableTop?: (ctxValue: DataTableContextType<I, P>) => ReactNode;
22
24
  renderHead: () => ReactNode;
@@ -1,3 +1,3 @@
1
1
  import { type ReactElement } from 'react';
2
2
  import type { DataTablePaginationProps } from './types';
3
- export declare function DataTablePagination({ allLimits, padding, children }: DataTablePaginationProps): ReactElement;
3
+ export declare function DataTablePagination({ allLimits, padding, children, hidePageSizeSelector }: DataTablePaginationProps): ReactElement;
@@ -4,7 +4,8 @@ import { TablePagination } from '../TablePagination';
4
4
  export function DataTablePagination({
5
5
  allLimits,
6
6
  padding,
7
- children
7
+ children,
8
+ hidePageSizeSelector
8
9
  }) {
9
10
  var _data$value;
10
11
  const {
@@ -30,6 +31,7 @@ export function DataTablePagination({
30
31
  page: 1,
31
32
  perPage
32
33
  });
33
- }
34
+ },
35
+ hidePageSizeSelector: hidePageSizeSelector
34
36
  }, children);
35
37
  }
@@ -2,4 +2,5 @@ import type { PropsWithChildren } from 'react';
2
2
  export type DataTablePaginationProps = PropsWithChildren<{
3
3
  allLimits: number[];
4
4
  padding?: string;
5
+ hidePageSizeSelector?: boolean;
5
6
  }>;
@@ -1,3 +1,3 @@
1
1
  import { type ReactElement } from 'react';
2
2
  import type { TablePaginationProps } from './types';
3
- export declare function TablePagination({ activePage, totalPages, limit, allLimits, padding, onChangePage, onChangeLimit, children, }: TablePaginationProps): ReactElement;
3
+ export declare function TablePagination({ activePage, totalPages, limit, allLimits, padding, hidePageSizeSelector, onChangePage, onChangeLimit, children, }: TablePaginationProps): ReactElement;
@@ -7,6 +7,7 @@ export function TablePagination({
7
7
  limit,
8
8
  allLimits,
9
9
  padding = 24,
10
+ hidePageSizeSelector = false,
10
11
  onChangePage,
11
12
  onChangeLimit,
12
13
  children
@@ -22,7 +23,7 @@ export function TablePagination({
22
23
  activePage: activePage,
23
24
  totalPages: totalPages,
24
25
  onChangePage: onChangePage
25
- }), children), React.createElement(Horizontal, {
26
+ }), children), !hidePageSizeSelector && React.createElement(Horizontal, {
26
27
  "$gap": 8,
27
28
  "$alignItems": "center"
28
29
  }, React.createElement("span", null, "Show on page:"), React.createElement(NativeSelect, {
@@ -5,6 +5,7 @@ export type TablePaginationProps = PropsWithChildren<{
5
5
  limit: number;
6
6
  allLimits: number[];
7
7
  padding?: string | number;
8
+ hidePageSizeSelector?: boolean;
8
9
  onChangePage: (page: number) => void;
9
10
  onChangeLimit: (limit: number) => void;
10
11
  }>;
package/package.json CHANGED
@@ -21,7 +21,8 @@
21
21
  "@pushwoosh/kit-constants": "^1.6.9",
22
22
  "@pushwoosh/kit-helpers": "^4.8.1",
23
23
  "@pushwoosh/kit-icons": "^2.1.6",
24
- "@pushwoosh/kit-typography": "^1.7.3"
24
+ "@pushwoosh/kit-typography": "^1.7.3",
25
+ "react-router-dom": "^5.3.4"
25
26
  },
26
27
  "devDependencies": {
27
28
  "@pushwoosh/frontend-builder-engine": "^1.0.18",
@@ -35,7 +36,6 @@
35
36
  "pre-commit": "^1.2.2",
36
37
  "react": "^18.3.1",
37
38
  "react-dom": "^18.3.1",
38
- "react-router-dom": "^5.3.4",
39
39
  "styled-components": "^5.3.11"
40
40
  },
41
41
  "peerDependencies": {
@@ -49,5 +49,5 @@
49
49
  "engines": {
50
50
  "node": ">= 18"
51
51
  },
52
- "version": "1.0.43"
52
+ "version": "1.0.45"
53
53
  }