@pushwoosh/dumb-components 1.1.4 → 1.1.6

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.
@@ -14,6 +14,8 @@ export function DataTable(props) {
14
14
  const {
15
15
  columns,
16
16
  width,
17
+ isBordered = true,
18
+ paginationPadding,
17
19
  context,
18
20
  renderTableTop,
19
21
  renderAfter,
@@ -28,11 +30,13 @@ export function DataTable(props) {
28
30
  value: context
29
31
  }, React.createElement(Table, {
30
32
  columns: columns,
31
- width: width
33
+ width: width,
34
+ isBordered: isBordered
32
35
  }, renderTableTop === null || renderTableTop === void 0 ? void 0 : renderTableTop(context), 'renderHead' in props && props.renderHead(), 'renderList' in props ? props.renderList(context) : React.createElement(DataTableList, {
33
36
  renderItem: props.renderItem
34
37
  }), !hidePagination && React.createElement(DataTablePagination, {
35
- allLimits: [10, 20, 50, 100]
38
+ allLimits: [10, 20, 50, 100],
39
+ padding: paginationPadding
36
40
  }, data.loading && React.createElement(Horizontal, {
37
41
  "$gap": Spacing.S1,
38
42
  "$alignItems": "center"
@@ -3,8 +3,10 @@ import type { DataTableParams, DataTableContextType } from '../../types';
3
3
  export type DataTableListProps<I, P extends DataTableParams> = {
4
4
  columns: string;
5
5
  width?: string | number;
6
+ isBordered?: boolean;
6
7
  context: DataTableContextType<I, P>;
7
8
  hidePagination?: boolean;
9
+ paginationPadding?: string;
8
10
  renderTableTop?: (ctxValue: DataTableContextType<I, P>) => ReactNode;
9
11
  renderList: (ctxValue: DataTableContextType<I, P>) => ReactNode;
10
12
  renderAfter?: (ctxValue: DataTableContextType<I, P>) => ReactNode;
@@ -12,8 +14,10 @@ export type DataTableListProps<I, P extends DataTableParams> = {
12
14
  export type DataTableItemProps<I, P extends DataTableParams> = {
13
15
  columns: string;
14
16
  width?: string | number;
17
+ isBordered?: boolean;
15
18
  context: DataTableContextType<I, P>;
16
19
  hidePagination?: boolean;
20
+ paginationPadding?: string;
17
21
  renderTableTop?: (ctxValue: DataTableContextType<I, P>) => ReactNode;
18
22
  renderHead: () => ReactNode;
19
23
  renderItem: (item: I) => 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, children }: DataTablePaginationProps): ReactElement;
3
+ export declare function DataTablePagination({ allLimits, padding, children }: DataTablePaginationProps): ReactElement;
@@ -3,6 +3,7 @@ import { DataTableContext } from '../../context';
3
3
  import { TablePagination } from '../TablePagination';
4
4
  export function DataTablePagination({
5
5
  allLimits,
6
+ padding,
6
7
  children
7
8
  }) {
8
9
  var _data$value;
@@ -22,6 +23,7 @@ export function DataTablePagination({
22
23
  page
23
24
  });
24
25
  },
26
+ padding: padding,
25
27
  onChangeLimit: perPage => {
26
28
  onChangeParams({
27
29
  ...params,
@@ -1,4 +1,5 @@
1
1
  import type { PropsWithChildren } from 'react';
2
2
  export type DataTablePaginationProps = PropsWithChildren<{
3
3
  allLimits: number[];
4
+ padding?: string;
4
5
  }>;
package/Table/styles.d.ts CHANGED
@@ -2,6 +2,7 @@ import { FontSize, FontWeight } from '@pushwoosh/kit-constants';
2
2
  export type TableProps = {
3
3
  columns: string;
4
4
  width?: string | number;
5
+ isBordered?: boolean;
5
6
  };
6
7
  export declare const Table: import("styled-components").StyledComponent<"div", any, {
7
8
  $alignContent?: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch" | undefined;
package/Table/styles.js CHANGED
@@ -4,9 +4,11 @@ import { GridContainer, Horizontal, Vertical, toCssValue } from '@pushwoosh/kit-
4
4
  export const Table = styled(Vertical).withConfig({
5
5
  displayName: "Table",
6
6
  componentId: "sc-1kwcslm-0"
7
- })(["--table-columns:", ";border:1px solid ", ";border-radius:", ";background-color:", ";", " & > *:not(:last-child){border-bottom:1px solid ", ";}"], ({
7
+ })(["--table-columns:", ";border:", ";border-radius:", ";background-color:", ";", " & > *:not(:last-child){border-bottom:1px solid ", ";}"], ({
8
8
  columns
9
- }) => columns, Color.DIVIDER, ShapeRadius.SECTION, Color.CLEAR, ({
9
+ }) => columns, ({
10
+ isBordered
11
+ }) => isBordered ? `1px solid ${Color.DIVIDER}` : 'none', ShapeRadius.SECTION, Color.CLEAR, ({
10
12
  width
11
13
  }) => width ? `width: ${toCssValue(width)};` : '', Color.DIVIDER);
12
14
  export const Td = styled(GridContainer).attrs({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/dumb-components",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",