From ff0ca6609e203f2c70e5acef9a7ac5f259e2df5c Mon Sep 17 00:00:00 2001 From: Avtandil Date: Mon, 22 Jan 2024 16:57:19 +0100 Subject: [PATCH 01/15] Update Table.tsx There is no children in TableProps, but in the code you use Children... --- src/Table.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Table.tsx b/src/Table.tsx index bb3c04b..698114f 100644 --- a/src/Table.tsx +++ b/src/Table.tsx @@ -34,6 +34,8 @@ export interface TableProps extends ZebraProps { * Otherwise assumed to be false. */ isNested?: boolean; + + children?: React.ReactNode } export class Table extends React.PureComponent { From 8bef88c02bdf6888de1a7a2b7243b478560e8f1e Mon Sep 17 00:00:00 2001 From: Avtandil Date: Mon, 22 Jan 2024 17:02:01 +0100 Subject: [PATCH 02/15] Update Table.d.ts --- lib/Table.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Table.d.ts b/lib/Table.d.ts index ee66f5b..607a08a 100644 --- a/lib/Table.d.ts +++ b/lib/Table.d.ts @@ -7,6 +7,7 @@ export interface ZebraProps { export interface TableProps extends ZebraProps { data?: any[]; isNested?: boolean; + children?: React.ReactNode; } export declare class Table extends React.PureComponent { render(): JSX.Element; From 7c904258c47a2511a34123a1928e1ed7a14cb228 Mon Sep 17 00:00:00 2001 From: Avtandil Date: Tue, 23 Jan 2024 10:14:38 +0100 Subject: [PATCH 03/15] Update TableCell.d.ts --- lib/TableCell.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/TableCell.d.ts b/lib/TableCell.d.ts index 84b90e2..ecc5db9 100644 --- a/lib/TableCell.d.ts +++ b/lib/TableCell.d.ts @@ -12,6 +12,7 @@ export interface TableCellProps extends TableBorder { textAlign?: "left" | "center" | "right"; isHeader?: boolean; fontSize?: number | string; + children?: React.ReactNode } export declare class TableCell extends React.PureComponent { render(): JSX.Element; From 1177c1c8eb02e3dc5eec2ad33616c83ffd8d4b6a Mon Sep 17 00:00:00 2001 From: Avtandil Date: Tue, 23 Jan 2024 10:15:32 +0100 Subject: [PATCH 04/15] Update TableRow.d.ts --- lib/TableRow.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/TableRow.d.ts b/lib/TableRow.d.ts index 878c814..c9e1d74 100644 --- a/lib/TableRow.d.ts +++ b/lib/TableRow.d.ts @@ -9,6 +9,7 @@ export interface TableRowProps extends TableBorder { even?: boolean; evenRowColor?: string; oddRowColor?: string; + children?: React.ReactNode } export declare class TableRow extends React.PureComponent> { render(): JSX.Element; From 834538b9521557a366cbd8cf4a15912a9b25558d Mon Sep 17 00:00:00 2001 From: Avtandil Date: Tue, 23 Jan 2024 10:42:42 +0100 Subject: [PATCH 05/15] Update package.json --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c5f236c..7297e9f 100644 --- a/package.json +++ b/package.json @@ -15,9 +15,9 @@ "author": "David Kucsai", "license": "MIT", "peerDependencies": { - "@react-pdf/renderer": "^1.6.8", - "react": "^16.8.6", - "react-dom": "^16.8.6" + "@react-pdf/renderer": "^3.3.1", + "react": "^18.2.0", + "react-dom": "^18.2.0" }, "devDependencies": { "@react-pdf/renderer": "^1.6.8", From 79d5f770abdd82fd15e6f1591c379551e54459a6 Mon Sep 17 00:00:00 2001 From: Avtandil Date: Tue, 23 Jan 2024 10:43:10 +0100 Subject: [PATCH 06/15] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7297e9f..6a68f2e 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "react-dom": "^18.2.0" }, "devDependencies": { - "@react-pdf/renderer": "^1.6.8", + "@react-pdf/renderer": "^3.3.1", "@storybook/addon-actions": "^6.4.19", "@storybook/addon-info": "^5.3.21", "@storybook/addon-knobs": "^5.3.7", From 12db88a4ca0862e6b5bda9e301c096731b237e07 Mon Sep 17 00:00:00 2001 From: Avtandil Date: Tue, 23 Jan 2024 10:43:25 +0100 Subject: [PATCH 07/15] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6a68f2e..2b0c97e 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "html-webpack-plugin": "^3.2.0", "jsdom": "^15.1.1", "mini-css-extract-plugin": "^0.7.0", - "react": "^16.8.6", + "react": "^18.2.0", "@storybook-addons/react-docgen-typescript-loader": "^3.8.0", "react-dom": "^16.8.6", "regenerator-runtime": "^0.13.2", From ca8a617ca8f151446b9aaffc20422d62d27cd456 Mon Sep 17 00:00:00 2001 From: Avtandil Date: Tue, 23 Jan 2024 10:43:38 +0100 Subject: [PATCH 08/15] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2b0c97e..885b5f1 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "mini-css-extract-plugin": "^0.7.0", "react": "^18.2.0", "@storybook-addons/react-docgen-typescript-loader": "^3.8.0", - "react-dom": "^16.8.6", + "react-dom": "^18.2.0", "regenerator-runtime": "^0.13.2", "sinon": "^7.3.2", "storybook": "^6.4.19", From f39fdb2df139c52d477176c851cb1f516eb73f0d Mon Sep 17 00:00:00 2001 From: Avtandil Date: Thu, 25 Jan 2024 10:37:26 +0100 Subject: [PATCH 09/15] Update TableCell.tsx --- src/TableCell.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/TableCell.tsx b/src/TableCell.tsx index 2bee8d7..86cde36 100644 --- a/src/TableCell.tsx +++ b/src/TableCell.tsx @@ -38,7 +38,7 @@ export interface TableCellProps extends TableBorder { /** * Extra styling to apply. These will override existing style with the same key. */ - style?: ReactPDF.Style | ReactPDF.Style[]; + style?: ReactPDF.Styles | ReactPDF.Styles[]; /** * How to align the text @@ -76,7 +76,7 @@ export class TableCell extends React.PureComponent { } const {includeRightBorder} = getDefaultBorderIncludes(this.props); - const defaultStyle: ReactPDF.Style = { + const defaultStyle: ReactPDF.Styles = { flex: this.props.weighting ?? 1, // @ts-ignore justifyContent: "stretch", @@ -87,7 +87,7 @@ export class TableCell extends React.PureComponent { whiteSpace: "pre-wrap" }; - const mergedStyles: ReactPDF.Style[] = [ + const mergedStyles: ReactPDF.Styles[] = [ defaultStyle, ...transformToArray(this.props.style) ]; From 8d262c0422465496ac7d0f2ed41a802d75e60a7f Mon Sep 17 00:00:00 2001 From: Avtandil Date: Thu, 25 Jan 2024 10:49:03 +0100 Subject: [PATCH 10/15] Update TableCell.tsx --- src/TableCell.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/TableCell.tsx b/src/TableCell.tsx index 86cde36..353c9dc 100644 --- a/src/TableCell.tsx +++ b/src/TableCell.tsx @@ -1,6 +1,7 @@ import * as React from "react"; import ReactPDF, {Text, View} from "@react-pdf/renderer"; import {getDefaultBorderIncludes, transformToArray} from "./Utils"; +import { Style } from '@react-pdf/types'; /** * Whether to include borders or not. @@ -38,7 +39,7 @@ export interface TableCellProps extends TableBorder { /** * Extra styling to apply. These will override existing style with the same key. */ - style?: ReactPDF.Styles | ReactPDF.Styles[]; + style?: Style | Style[]; /** * How to align the text @@ -76,7 +77,7 @@ export class TableCell extends React.PureComponent { } const {includeRightBorder} = getDefaultBorderIncludes(this.props); - const defaultStyle: ReactPDF.Styles = { + const defaultStyle: Style = { flex: this.props.weighting ?? 1, // @ts-ignore justifyContent: "stretch", @@ -87,7 +88,7 @@ export class TableCell extends React.PureComponent { whiteSpace: "pre-wrap" }; - const mergedStyles: ReactPDF.Styles[] = [ + const mergedStyles: Style[] = [ defaultStyle, ...transformToArray(this.props.style) ]; From 894f193d02f2631e3bdedf0ab5287f3c4d0998ea Mon Sep 17 00:00:00 2001 From: Avtandil Date: Thu, 25 Jan 2024 10:58:50 +0100 Subject: [PATCH 11/15] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 885b5f1..5e905cc 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "./lib/index.js", "scripts": { "generate-barrels": "barrelsby -d src --delete -e TableRow.tsx", - "build": "rm -rf ./lib/* && npm run generate-barrels && tsc && npm run build-storybook && npm run build-doco", + "build": "rm -rf ./lib/* && npm run generate-barrels && tsc", "recompile": "tsc", "prepublish": "npm run build", "storybook": "start-storybook -p 6006", From c1164c6e2134d3ed3024fb24dd8ca06ae973be06 Mon Sep 17 00:00:00 2001 From: Avtandil Date: Thu, 25 Jan 2024 11:17:06 +0100 Subject: [PATCH 12/15] Update TableBody.d.ts --- lib/TableBody.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/TableBody.d.ts b/lib/TableBody.d.ts index ec1ad14..ffcab1b 100644 --- a/lib/TableBody.d.ts +++ b/lib/TableBody.d.ts @@ -4,6 +4,7 @@ import { ZebraProps } from "./Table"; export interface TableBodyProps extends TableRowProps, Pick { data?: any[]; renderTopBorder?: boolean; + children?: React.ReactNode; } export declare class TableBody extends React.PureComponent { render(): JSX.Element[]; From 950e30489f1ebcd16bccd282bac393069d65fbd7 Mon Sep 17 00:00:00 2001 From: Avtandil Date: Thu, 25 Jan 2024 11:19:10 +0100 Subject: [PATCH 13/15] Update TableRow.tsx --- src/TableRow.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/TableRow.tsx b/src/TableRow.tsx index a6b35bc..07f1eb3 100644 --- a/src/TableRow.tsx +++ b/src/TableRow.tsx @@ -40,6 +40,8 @@ export interface TableRowProps extends TableBorder { * Specify the color of odd rows */ oddRowColor?: string; + + children?: React.ReactNode; } /** From 3071015e71da7ec8bcf2a2f4a4826a63a0ac49fb Mon Sep 17 00:00:00 2001 From: Avtandil Date: Thu, 25 Jan 2024 11:19:54 +0100 Subject: [PATCH 14/15] Update TableBody.tsx --- src/TableBody.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/TableBody.tsx b/src/TableBody.tsx index 7219a6f..e9a2099 100644 --- a/src/TableBody.tsx +++ b/src/TableBody.tsx @@ -13,7 +13,9 @@ export interface TableBodyProps extends TableRowProps, Pick * Allows control of the very top border of the TableBody to be toggled on and off * if there is no header. */ - renderTopBorder?: boolean + renderTopBorder?: boolean; + + children?: React.ReactNode; } /** From 0903d792894095ef3f96a34b171a1793a1c1cb66 Mon Sep 17 00:00:00 2001 From: Avtandil Date: Thu, 25 Jan 2024 11:24:04 +0100 Subject: [PATCH 15/15] Update TableCell.tsx --- src/TableCell.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/TableCell.tsx b/src/TableCell.tsx index 353c9dc..5bf9c18 100644 --- a/src/TableCell.tsx +++ b/src/TableCell.tsx @@ -55,6 +55,8 @@ export interface TableCellProps extends TableBorder { * The font-size to apply to the cell. */ fontSize?: number | string; + + children?: React.ReactNode; } /**