From 5a610a026f444f2286cc29df4057deef4a9627a9 Mon Sep 17 00:00:00 2001 From: KiriHoy Date: Wed, 2 Oct 2019 13:26:39 +1000 Subject: [PATCH 01/21] table footer component --- packages/table/src/js/react.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/table/src/js/react.js b/packages/table/src/js/react.js index 0efd28a6d..d900d22ad 100644 --- a/packages/table/src/js/react.js +++ b/packages/table/src/js/react.js @@ -255,5 +255,24 @@ AUtableResponsiveWrapper.propTypes = { children: PropTypes.node }; +/** + * Table footer + * + * @param {string} className - An additional class, optional + * @param {object} attributeOptions - Default HTML attributes + * @param {node} children + * + */ +export const AUtableFooter = ({ className, children, ...attributeOptions }) => ( + { children } +); + +AUtableFooter.propTypes = { + children: PropTypes.node +} + +AUtableFooter.defaultProps = { + className: '' +} export default AUtable; From 432922ff69c788a454af6917eaaf2a1305e67515 Mon Sep 17 00:00:00 2001 From: KiriHoy Date: Wed, 2 Oct 2019 13:29:45 +1000 Subject: [PATCH 02/21] add react param --- packages/table/src/js/react.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/table/src/js/react.js b/packages/table/src/js/react.js index d900d22ad..054e36cd2 100644 --- a/packages/table/src/js/react.js +++ b/packages/table/src/js/react.js @@ -16,6 +16,7 @@ import PropTypes from 'prop-types'; * @param {string} caption - The description or summary of the table. * @param {Object[]} headers - The column headings * @param {Object[]} data - The table data in the body + * @param {[]} footer - The footer cell, optional * @param {bool} striped - Colourise every other table row * @param {string} className - An additional class, optional * @param {bool} firstCellIsHeader - If first cell is a header cell or not From 711099a4e7c0bea4163db8f4ac21de921c7c0a78 Mon Sep 17 00:00:00 2001 From: KiriHoy Date: Wed, 2 Oct 2019 13:30:17 +1000 Subject: [PATCH 03/21] update tfoot react param --- packages/table/src/js/react.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/table/src/js/react.js b/packages/table/src/js/react.js index 054e36cd2..eb513ce7a 100644 --- a/packages/table/src/js/react.js +++ b/packages/table/src/js/react.js @@ -22,7 +22,7 @@ import PropTypes from 'prop-types'; * @param {bool} firstCellIsHeader - If first cell is a header cell or not * @param {object} attributeOptions - Default HTML attributes */ -const AUtable = ({ caption, headers, data, striped, className, firstCellIsHeader, ...attributeOptions }) => { +const AUtable = ({ caption, headers, data,footer, striped, className, firstCellIsHeader, ...attributeOptions }) => { return ( {caption && } From 2dd3635bfd40113f16cfd97fc25b5fdbd0417cae Mon Sep 17 00:00:00 2001 From: KiriHoy Date: Wed, 2 Oct 2019 13:36:43 +1000 Subject: [PATCH 04/21] add footer to table component --- packages/table/src/js/react.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/table/src/js/react.js b/packages/table/src/js/react.js index eb513ce7a..2eddba24d 100644 --- a/packages/table/src/js/react.js +++ b/packages/table/src/js/react.js @@ -62,6 +62,19 @@ const AUtable = ({ caption, headers, data,footer, striped, className, firstCellI ))} + { + + + + { + footer.map( ( data, footerIndex ) => ( + ) + ) + } + + + } +
) }; From ee3e28aed2ecd2b083568f7401580a9d965558dc Mon Sep 17 00:00:00 2001 From: KiriHoy Date: Wed, 2 Oct 2019 13:40:33 +1000 Subject: [PATCH 05/21] add footer --- packages/table/src/js/react.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/table/src/js/react.js b/packages/table/src/js/react.js index 2eddba24d..9704ec94b 100644 --- a/packages/table/src/js/react.js +++ b/packages/table/src/js/react.js @@ -62,13 +62,13 @@ const AUtable = ({ caption, headers, data,footer, striped, className, firstCellI ))} - { - + { + footer && { footer.map( ( data, footerIndex ) => ( - ) + ) ) } From 69b19762ea66e99e07a181dc57d09dda091d7a5b Mon Sep 17 00:00:00 2001 From: KiriHoy Date: Wed, 2 Oct 2019 14:46:23 +1000 Subject: [PATCH 06/21] removing row and col span attributes for now --- packages/table/src/js/react.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/packages/table/src/js/react.js b/packages/table/src/js/react.js index 9704ec94b..02a6608d8 100644 --- a/packages/table/src/js/react.js +++ b/packages/table/src/js/react.js @@ -16,13 +16,13 @@ import PropTypes from 'prop-types'; * @param {string} caption - The description or summary of the table. * @param {Object[]} headers - The column headings * @param {Object[]} data - The table data in the body - * @param {[]} footer - The footer cell, optional * @param {bool} striped - Colourise every other table row * @param {string} className - An additional class, optional - * @param {bool} firstCellIsHeader - If first cell is a header cell or not + * @param {bool} firstCellIsHeader - If first cell is a header cell or not + * @param {[]} footer - The footer cells * @param {object} attributeOptions - Default HTML attributes */ -const AUtable = ({ caption, headers, data,footer, striped, className, firstCellIsHeader, ...attributeOptions }) => { +const AUtable = ( { caption, headers, data, footer, striped, className, firstCellIsHeader, ...attributeOptions} ) => { return ( {caption && } @@ -62,19 +62,18 @@ const AUtable = ({ caption, headers, data,footer, striped, className, firstCellI ))} - { + { footer && { footer.map( ( data, footerIndex ) => ( - ) + ) ) } } -
) }; @@ -84,6 +83,7 @@ AUtable.propTypes = { headers: PropTypes.arrayOf( Object ).isRequired, data: PropTypes.arrayOf( Object ).isRequired, striped: PropTypes.bool, + footer: PropTypes.array, className: PropTypes.string }; @@ -153,7 +153,7 @@ AUtableHead.defaultProps = { * @param {string} className - An additional class, optional * @param {object} attributeOptions - Default HTML attributes */ -export const AUtableHeader = ({ title, type, width, scope, className, ...attributeOptions }) => { +export const AUtableHeader = ( { title, type, width, scope, className, ...attributeOptions } ) => { return { - return { + return { render ? render : data} @@ -269,6 +271,7 @@ AUtableResponsiveWrapper.propTypes = { children: PropTypes.node }; + /** * Table footer * @@ -289,4 +292,5 @@ AUtableFooter.defaultProps = { className: '' } + export default AUtable; From 11ef0451caab952ae9b68e2f634e589090b0131b Mon Sep 17 00:00:00 2001 From: KiriHoy Date: Tue, 15 Oct 2019 12:39:31 +1100 Subject: [PATCH 07/21] removing colspan and rowspan attributes for now --- packages/table/src/js/react.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/table/src/js/react.js b/packages/table/src/js/react.js index 02a6608d8..86ea0ff61 100644 --- a/packages/table/src/js/react.js +++ b/packages/table/src/js/react.js @@ -179,15 +179,13 @@ AUtableHeader.defaultProps = { /** * The data/cell component * @param {string} data - The cell data - * @param {number} colSpan - Number of columns a table cell should span, optional - * @param {number} rowSpan - Number of rows a table cell should span, optional * @param {string} type - Type of the data, can be either text or numeric for left or right alignment respectively. * @param {string} className - An additional class, optional * @param {object} render - The function for customised rendering on all cells in this column * @param {object} attributeOptions - Default HTML attributes * */ -export const AUtableCell = ( { data, colSpan, rowSpan, type, className, render,...attributeOptions } ) => { +export const AUtableCell = ( { data, type, className, render,...attributeOptions } ) => { return { render ? render : data} From 4604386bab1edf400bd4d16475a78ad638e25d51 Mon Sep 17 00:00:00 2001 From: KiriHoy Date: Tue, 15 Oct 2019 12:51:19 +1100 Subject: [PATCH 08/21] removing more rowspan and colspan --- packages/table/src/js/react.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/table/src/js/react.js b/packages/table/src/js/react.js index 86ea0ff61..9da28acd5 100644 --- a/packages/table/src/js/react.js +++ b/packages/table/src/js/react.js @@ -186,7 +186,7 @@ AUtableHeader.defaultProps = { * */ export const AUtableCell = ( { data, type, className, render,...attributeOptions } ) => { - return { render ? render : data} From 88af25150669208ce6bcd71ce59c8a8307fda302 Mon Sep 17 00:00:00 2001 From: KiriHoy Date: Tue, 15 Oct 2019 13:01:59 +1100 Subject: [PATCH 09/21] add footer styling --- packages/table/src/sass/_module.scss | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/table/src/sass/_module.scss b/packages/table/src/sass/_module.scss index fd72017f2..5cc2c9674 100644 --- a/packages/table/src/sass/_module.scss +++ b/packages/table/src/sass/_module.scss @@ -112,6 +112,15 @@ background-color: $AU-color-table-row; } } + + .au-table__footer { + background-color: $AU-color-table-row; + .au-table__cell { + font-weight: bold; + } + .au-table__footer--striped { + background-color: #ffff + } } .au-table__wrapper { From 20c3fac70f02d52e1d1f7943fcf9aa770ae79062 Mon Sep 17 00:00:00 2001 From: KiriHoy Date: Tue, 15 Oct 2019 13:24:06 +1100 Subject: [PATCH 10/21] add missed curly braced --- packages/table/src/sass/_module.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/table/src/sass/_module.scss b/packages/table/src/sass/_module.scss index 5cc2c9674..245d09d9d 100644 --- a/packages/table/src/sass/_module.scss +++ b/packages/table/src/sass/_module.scss @@ -123,6 +123,7 @@ } } +} .au-table__wrapper { overflow-x: auto; } From 570e72f46fb77da63d7e7e3538e8e5b244865b9c Mon Sep 17 00:00:00 2001 From: KiriHoy Date: Tue, 15 Oct 2019 13:49:34 +1100 Subject: [PATCH 11/21] simple footer data --- packages/table/tests/react/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/table/tests/react/index.js b/packages/table/tests/react/index.js index 16f81e265..b830b8af0 100644 --- a/packages/table/tests/react/index.js +++ b/packages/table/tests/react/index.js @@ -3,7 +3,7 @@ import ReactDOM from 'react-dom'; import AUtags from '../../../tags/src/js/react.js'; -import AUtable, {AUtableResponsiveWrapper, AUtableCaption, AUtableCell, AUtableHead, AUtableHeader, AUtableBody, AUtableRow} from './table.js'; +import AUtable, {AUtableResponsiveWrapper, AUtableCaption, AUtableCell, AUtableHead, AUtableHeader, AUtableBody, AUtableRow, AUtableFooter} from './table.js'; const renderVicTags = () => () const renderNSWTags = () => () @@ -15,6 +15,8 @@ const simpleData = [ {location: "Tasmania", population: "514,400"} ]; +const simpleFooter = ["Total", "13,667,110", "9.4%"]; + const simpleHeaders = [ {title: "Location", key: "location"}, {title: "Population", key: "population", type: 'numeric'} @@ -116,6 +118,7 @@ ReactDOM.render( caption="Population of Australian states and territories, December 2015" headers={simpleHeaders} data={simpleData} + footer={simpleFooter} firstCellIsHeader={true} /> From 0c8f966bf4cf297ca7b36e23b56d77228a2f113c Mon Sep 17 00:00:00 2001 From: KiriHoy Date: Tue, 15 Oct 2019 14:13:59 +1100 Subject: [PATCH 12/21] updating footer data and adding in react test site --- packages/table/src/js/react.js | 4 ++-- packages/table/tests/react/index.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/table/src/js/react.js b/packages/table/src/js/react.js index 9da28acd5..158f9ed32 100644 --- a/packages/table/src/js/react.js +++ b/packages/table/src/js/react.js @@ -18,7 +18,7 @@ import PropTypes from 'prop-types'; * @param {Object[]} data - The table data in the body * @param {bool} striped - Colourise every other table row * @param {string} className - An additional class, optional - * @param {bool} firstCellIsHeader - If first cell is a header cell or not + * @param {bool} firstCellIsHeader - If first cell is a header cell or not * @param {[]} footer - The footer cells * @param {object} attributeOptions - Default HTML attributes */ @@ -68,7 +68,7 @@ const AUtable = ( { caption, headers, data, footer, striped, className, firstCel { footer.map( ( data, footerIndex ) => ( - ) + ) ) } diff --git a/packages/table/tests/react/index.js b/packages/table/tests/react/index.js index b830b8af0..ba7310864 100644 --- a/packages/table/tests/react/index.js +++ b/packages/table/tests/react/index.js @@ -15,7 +15,7 @@ const simpleData = [ {location: "Tasmania", population: "514,400"} ]; -const simpleFooter = ["Total", "13,667,110", "9.4%"]; +const simpleFooter = ["Total", "13,667,110"]; const simpleHeaders = [ {title: "Location", key: "location"}, From 0ca2f18ba0ece3f9aedeb6007ab33b7d5bf45f47 Mon Sep 17 00:00:00 2001 From: KiriHoy Date: Tue, 15 Oct 2019 15:34:51 +1100 Subject: [PATCH 13/21] adding type prop to footer --- packages/table/src/js/react.js | 16 ++++++++++++---- packages/table/src/sass/_module.scss | 2 ++ packages/table/tests/react/index.js | 4 ++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/packages/table/src/js/react.js b/packages/table/src/js/react.js index 158f9ed32..721a8f68b 100644 --- a/packages/table/src/js/react.js +++ b/packages/table/src/js/react.js @@ -68,7 +68,7 @@ const AUtable = ( { caption, headers, data, footer, striped, className, firstCel { footer.map( ( data, footerIndex ) => ( - ) + ) ) } @@ -275,18 +275,26 @@ AUtableResponsiveWrapper.propTypes = { * * @param {string} className - An additional class, optional * @param {object} attributeOptions - Default HTML attributes + * @param {bool} stripedTableFooter - + * @param {string} type - Type of the data, can be either text or numeric for left or right alignment respectively. * @param {node} children * */ -export const AUtableFooter = ({ className, children, ...attributeOptions }) => ( - { children } +export const AUtableFooter = ({ stripedTableFooter , type, className, children, ...attributeOptions }) => ( + { children } ); AUtableFooter.propTypes = { - children: PropTypes.node + children: PropTypes.node, + type: PropTypes.oneOf(['text', 'numeric']).isRequired, + className: PropTypes.string, + stripedTableFooter: PropTypes.bool, } AUtableFooter.defaultProps = { + className: '', + stripedTableFooter: false, + type:'text', className: '' } diff --git a/packages/table/src/sass/_module.scss b/packages/table/src/sass/_module.scss index 245d09d9d..e8642991a 100644 --- a/packages/table/src/sass/_module.scss +++ b/packages/table/src/sass/_module.scss @@ -115,8 +115,10 @@ .au-table__footer { background-color: $AU-color-table-row; + .au-table__cell { font-weight: bold; + } .au-table__footer--striped { background-color: #ffff diff --git a/packages/table/tests/react/index.js b/packages/table/tests/react/index.js index ba7310864..81922516e 100644 --- a/packages/table/tests/react/index.js +++ b/packages/table/tests/react/index.js @@ -15,7 +15,7 @@ const simpleData = [ {location: "Tasmania", population: "514,400"} ]; -const simpleFooter = ["Total", "13,667,110"]; +const simpleFooter = ["Total", "14,181,500"]; const simpleHeaders = [ {title: "Location", key: "location"}, @@ -112,7 +112,7 @@ const headerUsingRecord = [ ReactDOM.render(
-

Simple Table, first cell is header

+

Simple Table, first cell is header, and with footer

Date: Wed, 16 Oct 2019 08:43:19 +1100 Subject: [PATCH 14/21] add striped table footer --- packages/table/src/js/react.js | 11 ++++++----- packages/table/tests/react/index.js | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/table/src/js/react.js b/packages/table/src/js/react.js index 721a8f68b..cca24093e 100644 --- a/packages/table/src/js/react.js +++ b/packages/table/src/js/react.js @@ -20,9 +20,10 @@ import PropTypes from 'prop-types'; * @param {string} className - An additional class, optional * @param {bool} firstCellIsHeader - If first cell is a header cell or not * @param {[]} footer - The footer cells + * @param {bool} stripedFooter - If the footer is for the striped table or not * @param {object} attributeOptions - Default HTML attributes */ -const AUtable = ( { caption, headers, data, footer, striped, className, firstCellIsHeader, ...attributeOptions} ) => { +const AUtable = ( { caption, headers, data, footer, stripedFooter, striped, className, firstCellIsHeader, ...attributeOptions} ) => { return ( {caption && } @@ -64,7 +65,7 @@ const AUtable = ( { caption, headers, data, footer, striped, className, firstCel { footer && - + stripedFooter && { footer.map( ( data, footerIndex ) => ( @@ -83,6 +84,7 @@ AUtable.propTypes = { headers: PropTypes.arrayOf( Object ).isRequired, data: PropTypes.arrayOf( Object ).isRequired, striped: PropTypes.bool, + stripedFooter: PropTypes.bool, footer: PropTypes.array, className: PropTypes.string }; @@ -275,12 +277,12 @@ AUtableResponsiveWrapper.propTypes = { * * @param {string} className - An additional class, optional * @param {object} attributeOptions - Default HTML attributes - * @param {bool} stripedTableFooter - + * @param {bool} stripedTableFooter - variatin of footer for striped table * @param {string} type - Type of the data, can be either text or numeric for left or right alignment respectively. * @param {node} children * */ -export const AUtableFooter = ({ stripedTableFooter , type, className, children, ...attributeOptions }) => ( +export const AUtableFooter = ({ type, className, stripedTableFooter, children, ...attributeOptions }) => ( { children } ); @@ -295,7 +297,6 @@ AUtableFooter.defaultProps = { className: '', stripedTableFooter: false, type:'text', - className: '' } diff --git a/packages/table/tests/react/index.js b/packages/table/tests/react/index.js index 81922516e..d0a96e161 100644 --- a/packages/table/tests/react/index.js +++ b/packages/table/tests/react/index.js @@ -119,6 +119,7 @@ ReactDOM.render( headers={simpleHeaders} data={simpleData} footer={simpleFooter} + stripedFooter={true} firstCellIsHeader={true} /> From 57a66b7e10c93a4e5cd68d55c2148b40e7b1562b Mon Sep 17 00:00:00 2001 From: KiriHoy Date: Wed, 16 Oct 2019 14:04:15 +1100 Subject: [PATCH 15/21] add complex footer on striped table example --- auds.json | 2 +- packages/table/src/js/react.js | 2 +- packages/table/src/sass/_module.scss | 9 ++++++--- packages/table/tests/react/index.js | 5 ++++- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/auds.json b/auds.json index 415c4cde1..1bf294d81 100644 --- a/auds.json +++ b/auds.json @@ -1 +1 @@ -{"@gov.au/core":{"name":"@gov.au/core","version":"3.4.2","peerDependencies":{},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true}}},"@gov.au/accordion":{"name":"@gov.au/accordion","version":"7.0.8","peerDependencies":{"@gov.au/animate":"^1.0.0","@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-js","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"js":{"path":"lib/js/module.js"},"react":{"path":"lib/js/react.js"}}},"@gov.au/animate":{"name":"@gov.au/animate","version":"1.0.13","peerDependencies":{},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-js","@gov.au/pancake-json"],"js":{"path":"lib/js/module.js"},"sass":{"path":false,"sass-versioning":true}}},"@gov.au/body":{"name":"@gov.au/body","version":"2.2.0","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true}}},"@gov.au/breadcrumbs":{"name":"@gov.au/breadcrumbs","version":"3.0.5","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/link-list":"^3.0.0","@gov.au/body":"^2.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/buttons":{"name":"@gov.au/buttons","version":"3.0.7","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/callout":{"name":"@gov.au/callout","version":"3.0.2","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/card":{"name":"@gov.au/card","version":"0.3.2","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/control-input":{"name":"@gov.au/control-input","version":"3.0.1","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/cta-link":{"name":"@gov.au/cta-link","version":"2.2.0","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/direction-links":{"name":"@gov.au/direction-links","version":"3.0.0","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/footer":{"name":"@gov.au/footer","version":"3.0.5","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/form":{"name":"@gov.au/form","version":"0.1.5","peerDependencies":{"@gov.au/core":"^3.4.1"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/grid-12":{"name":"@gov.au/grid-12","version":"2.1.0","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true}}},"@gov.au/header":{"name":"@gov.au/header","version":"4.1.12","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/headings":{"name":"@gov.au/headings","version":"2.0.11","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/inpage-nav":{"name":"@gov.au/inpage-nav","version":"3.0.6","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/link-list":"^3.0.0","@gov.au/body":"^2.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/keyword-list":{"name":"@gov.au/keyword-list","version":"3.0.5","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/link-list":"^3.0.0","@gov.au/body":"^2.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/link-list":{"name":"@gov.au/link-list","version":"3.0.8","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/body":"^2.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/main-nav":{"name":"@gov.au/main-nav","version":"1.0.8","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/animate":"^1.0.0","@gov.au/link-list":"^3.0.0","@gov.au/body":"^2.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-js","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"js":{"path":"lib/js/module.js"},"react":{"path":"lib/js/react.js"}}},"@gov.au/page-alerts":{"name":"@gov.au/page-alerts","version":"2.1.3","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/body":"^2.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/progress-indicator":{"name":"@gov.au/progress-indicator","version":"3.1.7","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/responsive-media":{"name":"@gov.au/responsive-media","version":"2.0.14","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true}}},"@gov.au/searchbox":{"name":"@gov.au/searchbox","version":"0.2.1","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/text-inputs":"^2.0.0","@gov.au/buttons":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/select":{"name":"@gov.au/select","version":"2.0.11","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/side-nav":{"name":"@gov.au/side-nav","version":"5.0.8","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/animate":"^1.0.0","@gov.au/accordion":"^7.0.0","@gov.au/link-list":"^3.0.0","@gov.au/body":"^2.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-js","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"js":{"path":"lib/js/module.js"},"react":{"path":"lib/js/react.js"}}},"@gov.au/skip-link":{"name":"@gov.au/skip-link","version":"2.0.16","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/table":{"name":"@gov.au/table","version":"0.2.0","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/tags":{"name":"@gov.au/tags","version":"4.0.0","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/text-inputs":{"name":"@gov.au/text-inputs","version":"2.1.2","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}}} \ No newline at end of file +{"@gov.au/core":{"name":"@gov.au/core","version":"3.4.2","peerDependencies":{},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true}}},"@gov.au/accordion":{"name":"@gov.au/accordion","version":"7.0.8","peerDependencies":{"@gov.au/animate":"^1.0.0","@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-js","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"js":{"path":"lib/js/module.js"},"react":{"path":"lib/js/react.js"}}},"@gov.au/animate":{"name":"@gov.au/animate","version":"1.0.13","peerDependencies":{},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-js","@gov.au/pancake-json"],"js":{"path":"lib/js/module.js"},"sass":{"path":false,"sass-versioning":true}}},"@gov.au/body":{"name":"@gov.au/body","version":"2.2.0","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true}}},"@gov.au/breadcrumbs":{"name":"@gov.au/breadcrumbs","version":"3.0.5","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/link-list":"^3.0.0","@gov.au/body":"^2.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/buttons":{"name":"@gov.au/buttons","version":"3.0.7","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/callout":{"name":"@gov.au/callout","version":"3.0.2","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/card":{"name":"@gov.au/card","version":"0.3.2","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/control-input":{"name":"@gov.au/control-input","version":"3.0.1","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/cta-link":{"name":"@gov.au/cta-link","version":"2.2.0","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/direction-links":{"name":"@gov.au/direction-links","version":"3.0.0","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/footer":{"name":"@gov.au/footer","version":"3.0.5","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/form":{"name":"@gov.au/form","version":"0.1.5","peerDependencies":{"@gov.au/core":"^3.4.1"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/grid-12":{"name":"@gov.au/grid-12","version":"2.1.0","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true}}},"@gov.au/header":{"name":"@gov.au/header","version":"4.1.12","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/headings":{"name":"@gov.au/headings","version":"2.0.11","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/inpage-nav":{"name":"@gov.au/inpage-nav","version":"3.0.6","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/link-list":"^3.0.0","@gov.au/body":"^2.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/keyword-list":{"name":"@gov.au/keyword-list","version":"3.0.5","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/link-list":"^3.0.0","@gov.au/body":"^2.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/link-list":{"name":"@gov.au/link-list","version":"3.0.8","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/body":"^2.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/main-nav":{"name":"@gov.au/main-nav","version":"1.0.8","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/animate":"^1.0.0","@gov.au/link-list":"^3.0.0","@gov.au/body":"^2.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-js","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"js":{"path":"lib/js/module.js"},"react":{"path":"lib/js/react.js"}}},"@gov.au/page-alerts":{"name":"@gov.au/page-alerts","version":"2.1.3","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/body":"^2.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/progress-indicator":{"name":"@gov.au/progress-indicator","version":"3.1.7","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/responsive-media":{"name":"@gov.au/responsive-media","version":"2.0.14","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true}}},"@gov.au/searchbox":{"name":"@gov.au/searchbox","version":"0.2.2","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/text-inputs":"^2.0.0","@gov.au/buttons":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/select":{"name":"@gov.au/select","version":"2.0.11","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/side-nav":{"name":"@gov.au/side-nav","version":"5.0.8","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/animate":"^1.0.0","@gov.au/accordion":"^7.0.0","@gov.au/link-list":"^3.0.0","@gov.au/body":"^2.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-js","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"js":{"path":"lib/js/module.js"},"react":{"path":"lib/js/react.js"}}},"@gov.au/skip-link":{"name":"@gov.au/skip-link","version":"2.0.16","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/table":{"name":"@gov.au/table","version":"0.2.0","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/tags":{"name":"@gov.au/tags","version":"4.0.0","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/text-inputs":{"name":"@gov.au/text-inputs","version":"2.1.2","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}}} \ No newline at end of file diff --git a/packages/table/src/js/react.js b/packages/table/src/js/react.js index cca24093e..b11242545 100644 --- a/packages/table/src/js/react.js +++ b/packages/table/src/js/react.js @@ -65,7 +65,7 @@ const AUtable = ( { caption, headers, data, footer, stripedFooter, striped, clas { footer && - stripedFooter && + { footer.map( ( data, footerIndex ) => ( diff --git a/packages/table/src/sass/_module.scss b/packages/table/src/sass/_module.scss index e8642991a..619a0021b 100644 --- a/packages/table/src/sass/_module.scss +++ b/packages/table/src/sass/_module.scss @@ -120,11 +120,14 @@ font-weight: bold; } - .au-table__footer--striped { - background-color: #ffff - } + + &.au-table__footer--striped { + background-color: #ffffff; + } } + + } .au-table__wrapper { overflow-x: auto; diff --git a/packages/table/tests/react/index.js b/packages/table/tests/react/index.js index d0a96e161..f2330efc7 100644 --- a/packages/table/tests/react/index.js +++ b/packages/table/tests/react/index.js @@ -17,6 +17,8 @@ const simpleData = [ const simpleFooter = ["Total", "14,181,500"]; +const complexFooter = ["Total", "23,583,700", "19.2%", "73.3%"]; + const simpleHeaders = [ {title: "Location", key: "location"}, {title: "Population", key: "population", type: 'numeric'} @@ -119,7 +121,6 @@ ReactDOM.render( headers={simpleHeaders} data={simpleData} footer={simpleFooter} - stripedFooter={true} firstCellIsHeader={true} /> @@ -147,6 +148,8 @@ ReactDOM.render( caption="Population of Australian states and territories, December 2015" striped={true} headers={complexHeaders} + footer={complexFooter} + stripedFooter={true} data={complexData} /> From 6d995e3780b905d65f7d5cecee11d05116dcce42 Mon Sep 17 00:00:00 2001 From: KiriHoy Date: Wed, 16 Oct 2019 14:31:27 +1100 Subject: [PATCH 16/21] update table data --- packages/table/tests/react/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/table/tests/react/index.js b/packages/table/tests/react/index.js index f2330efc7..8a1cd73dd 100644 --- a/packages/table/tests/react/index.js +++ b/packages/table/tests/react/index.js @@ -162,6 +162,7 @@ ReactDOM.render( caption="Population of Australian states and territories, December 2015" headers={headersRemoveButton} data={dataRemoveButton} + footer={simpleFooter} />
@@ -234,6 +235,13 @@ ReactDOM.render(
+ + + + + + +

From e2d9bcc2dc3c414d92bb4c288fe06821d82a1505 Mon Sep 17 00:00:00 2001 From: KiriHoy Date: Mon, 21 Oct 2019 08:46:30 +1100 Subject: [PATCH 17/21] add space --- packages/table/src/js/react.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/table/src/js/react.js b/packages/table/src/js/react.js index b11242545..46e978998 100644 --- a/packages/table/src/js/react.js +++ b/packages/table/src/js/react.js @@ -277,7 +277,7 @@ AUtableResponsiveWrapper.propTypes = { * * @param {string} className - An additional class, optional * @param {object} attributeOptions - Default HTML attributes - * @param {bool} stripedTableFooter - variatin of footer for striped table + * @param {bool} stripedTableFooter - variatin of footer for striped table * @param {string} type - Type of the data, can be either text or numeric for left or right alignment respectively. * @param {node} children * From e34ce828bb6486826cfca826c47274d8bab05e3d Mon Sep 17 00:00:00 2001 From: KiriHoy Date: Mon, 21 Oct 2019 09:50:23 +1100 Subject: [PATCH 18/21] adding colSpan poc --- packages/table/src/js/react.js | 12 +++++++----- packages/table/tests/react/index.js | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/table/src/js/react.js b/packages/table/src/js/react.js index 46e978998..9f7e66fd6 100644 --- a/packages/table/src/js/react.js +++ b/packages/table/src/js/react.js @@ -20,10 +20,11 @@ import PropTypes from 'prop-types'; * @param {string} className - An additional class, optional * @param {bool} firstCellIsHeader - If first cell is a header cell or not * @param {[]} footer - The footer cells - * @param {bool} stripedFooter - If the footer is for the striped table or not + * @param {bool} stripedFooter - If the footer is for the striped table or not + * @param {string} colSpanFooter - * @param {object} attributeOptions - Default HTML attributes */ -const AUtable = ( { caption, headers, data, footer, stripedFooter, striped, className, firstCellIsHeader, ...attributeOptions} ) => { +const AUtable = ( { caption, headers, data, footer, stripedFooter, colSpanFooter, striped, className, firstCellIsHeader, ...attributeOptions} ) => { return ( {caption && } @@ -69,7 +70,7 @@ const AUtable = ( { caption, headers, data, footer, stripedFooter, striped, clas { footer.map( ( data, footerIndex ) => ( - ) + ) ) } @@ -279,11 +280,12 @@ AUtableResponsiveWrapper.propTypes = { * @param {object} attributeOptions - Default HTML attributes * @param {bool} stripedTableFooter - variatin of footer for striped table * @param {string} type - Type of the data, can be either text or numeric for left or right alignment respectively. + * @param {string} colSpan - * @param {node} children * */ -export const AUtableFooter = ({ type, className, stripedTableFooter, children, ...attributeOptions }) => ( - { children } +export const AUtableFooter = ({ type, colSpan, className, stripedTableFooter, children, ...attributeOptions }) => ( + { children } ); AUtableFooter.propTypes = { diff --git a/packages/table/tests/react/index.js b/packages/table/tests/react/index.js index 8a1cd73dd..026ede594 100644 --- a/packages/table/tests/react/index.js +++ b/packages/table/tests/react/index.js @@ -163,6 +163,7 @@ ReactDOM.render( headers={headersRemoveButton} data={dataRemoveButton} footer={simpleFooter} + colSpan="2" />
From a7731df78afe4a7312655564c6abf9b54982f7b4 Mon Sep 17 00:00:00 2001 From: KiriHoy Date: Tue, 22 Oct 2019 13:27:37 +1100 Subject: [PATCH 19/21] trying colspan --- packages/table/src/js/react.js | 4 +- packages/table/tests/react/index.js | 2 +- packages/table/tests/site/index.html | 132 +++++++++++++++------------ 3 files changed, 76 insertions(+), 62 deletions(-) diff --git a/packages/table/src/js/react.js b/packages/table/src/js/react.js index 9f7e66fd6..44a1c9952 100644 --- a/packages/table/src/js/react.js +++ b/packages/table/src/js/react.js @@ -20,8 +20,8 @@ import PropTypes from 'prop-types'; * @param {string} className - An additional class, optional * @param {bool} firstCellIsHeader - If first cell is a header cell or not * @param {[]} footer - The footer cells - * @param {bool} stripedFooter - If the footer is for the striped table or not - * @param {string} colSpanFooter - + * @param {bool} stripedFooter - If the footer is for the striped table or not + * @param {string} colSpanFooter - * @param {object} attributeOptions - Default HTML attributes */ const AUtable = ( { caption, headers, data, footer, stripedFooter, colSpanFooter, striped, className, firstCellIsHeader, ...attributeOptions} ) => { diff --git a/packages/table/tests/react/index.js b/packages/table/tests/react/index.js index 026ede594..b9c012cb8 100644 --- a/packages/table/tests/react/index.js +++ b/packages/table/tests/react/index.js @@ -240,7 +240,7 @@ ReactDOM.render( - +
diff --git a/packages/table/tests/site/index.html b/packages/table/tests/site/index.html index 27968caf3..ce7b3bfcc 100644 --- a/packages/table/tests/site/index.html +++ b/packages/table/tests/site/index.html @@ -56,17 +56,23 @@

Simple Table

New South Wales - 7,670,700 + 7,670,700 Victoria - 5,996,400 + 5,996,400 Tasmania - 517,400 + 517,400 + + + Total + 23,937,000‬ + +

@@ -116,53 +122,61 @@

Striped complex data-table

New South Wales - 7,670,700 - 3.1% - 12.9% + 7,670,700 + 3.1% + 12.9% Victoria - 5,996,400 - 2.5% - 9.3% + 5,996,400 + 2.5% + 9.3% Queensland - 4,808,800 - 1.7% - 13.3% + 4,808,800 + 1.7% + 13.3% Western Australia - 2,603,900 - 2.3% - 11.6% + 2,603,900 + 2.3% + 11.6% South Australia - 1,702,800 - 2.0% - 6.8% + 1,702,800 + 2.0% + 6.8% Tasmania - 517,400 - 4% - 5.3% + 517,400 + 4% + 5.3% Northern Territory - 244,000 - 1.2% - 4.5% + 244,000 + 1.2% + 4.5% Australian Capital Territory - 393,000 - 2.4% - 9.6% + 393,000 + 2.4% + 9.6% + + + Total + 23,937,000‬ + 19.2%‬ + 73.3% + +

@@ -183,35 +197,35 @@

Table in md-6 Grid

New South Wales - 7,670,700 + 7,670,700 Victoria - 5,996,400 + 5,996,400 Queensland - 4,808,800 + 4,808,800 Western Australia - 2,603,900 + 2,603,900 South Australia - 1,702,800 + 1,702,800 Tasmania - 517,400 + 517,400 Northern Territory - 244,000 + 244,000 Australian Capital Territory - 393,000 + 393,000 @@ -237,51 +251,51 @@

Striped complex data-table in an md-8 grid

New South Wales - 7,670,700 - 3.1% - 12.9% + 7,670,700 + 3.1% + 12.9% Victoria - 5,996,400 - 2.5% - 9.3% + 5,996,400 + 2.5% + 9.3% Queensland - 4,808,800 - 1.7% - 13.3% + 4,808,800 + 1.7% + 13.3% Western Australia - 2,603,900 - 2.3% - 11.6% + 2,603,900 + 2.3% + 11.6% South Australia - 1,702,800 - 2.0% - 6.8% + 1,702,800 + 2.0% + 6.8% Tasmania - 517,400 - 4% - 5.3% + 517,400 + 4% + 5.3% Northern Territory - 244,000 - 1.2% - 4.5% + 244,000 + 1.2% + 4.5% Australian Capital Territory - 393,000 - 2.4% - 9.6% + 393,000 + 2.4% + 9.6% From 1feb819f4e99520af3cfff47616f47731317c535 Mon Sep 17 00:00:00 2001 From: KiriHoy <34221033+KiriHoy@users.noreply.github.com> Date: Mon, 11 Nov 2019 13:46:05 +1100 Subject: [PATCH 20/21] Update packages/table/src/js/react.js Co-Authored-By: Gordon Grace --- packages/table/src/js/react.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/table/src/js/react.js b/packages/table/src/js/react.js index 44a1c9952..17d522d60 100644 --- a/packages/table/src/js/react.js +++ b/packages/table/src/js/react.js @@ -278,7 +278,7 @@ AUtableResponsiveWrapper.propTypes = { * * @param {string} className - An additional class, optional * @param {object} attributeOptions - Default HTML attributes - * @param {bool} stripedTableFooter - variatin of footer for striped table + * @param {bool} stripedTableFooter - Variation of footer for striped table * @param {string} type - Type of the data, can be either text or numeric for left or right alignment respectively. * @param {string} colSpan - * @param {node} children From 5c60f8db63581068eaac2131a14500fd2910b4a6 Mon Sep 17 00:00:00 2001 From: KiriHoy Date: Wed, 13 Nov 2019 11:34:27 +1100 Subject: [PATCH 21/21] remove uneeded colspan --- packages/table/src/js/react.js | 20 +++++++++++--------- packages/table/tests/react/index.js | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/table/src/js/react.js b/packages/table/src/js/react.js index 17d522d60..b67740249 100644 --- a/packages/table/src/js/react.js +++ b/packages/table/src/js/react.js @@ -20,8 +20,8 @@ import PropTypes from 'prop-types'; * @param {string} className - An additional class, optional * @param {bool} firstCellIsHeader - If first cell is a header cell or not * @param {[]} footer - The footer cells - * @param {bool} stripedFooter - If the footer is for the striped table or not - * @param {string} colSpanFooter - + * @param {bool} stripedFooter - If the footer is for the striped table or not + * @param {string} colSpanFooter - value of colSpan attribute * @param {object} attributeOptions - Default HTML attributes */ const AUtable = ( { caption, headers, data, footer, stripedFooter, colSpanFooter, striped, className, firstCellIsHeader, ...attributeOptions} ) => { @@ -86,13 +86,15 @@ AUtable.propTypes = { data: PropTypes.arrayOf( Object ).isRequired, striped: PropTypes.bool, stripedFooter: PropTypes.bool, + colSpanFooter: PropTypes.number, footer: PropTypes.array, className: PropTypes.string }; AUtable.defaultProps = { striped: false, - className: '' + className: '', + colSpanFooter: 0 }; @@ -276,16 +278,16 @@ AUtableResponsiveWrapper.propTypes = { /** * Table footer * - * @param {string} className - An additional class, optional - * @param {object} attributeOptions - Default HTML attributes - * @param {bool} stripedTableFooter - Variation of footer for striped table - * @param {string} type - Type of the data, can be either text or numeric for left or right alignment respectively. - * @param {string} colSpan - + * @param {string} className - An additional class, optional + * @param {object} attributeOptions - Default HTML attributes + * @param {bool} stripedTableFooter - Variation of footer for striped table + * @param {string} type - Type of the data, can be either text or numeric for left or right alignment respectively. + * @param {string} colSpan - colSpan attribute * @param {node} children * */ export const AUtableFooter = ({ type, colSpan, className, stripedTableFooter, children, ...attributeOptions }) => ( - { children } + { children } ); AUtableFooter.propTypes = { diff --git a/packages/table/tests/react/index.js b/packages/table/tests/react/index.js index b9c012cb8..e0443c53d 100644 --- a/packages/table/tests/react/index.js +++ b/packages/table/tests/react/index.js @@ -240,7 +240,7 @@ ReactDOM.render( - +