@dhis2-ui/table 8.2.0 → 8.2.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.
- package/build/cjs/data-table/__tests__/data-table-row/expanded-row.test.js +2 -2
- package/build/cjs/data-table/data-table-cell.js +23 -22
- package/build/cjs/data-table/data-table-column-header/data-table-column-header.js +60 -57
- package/build/cjs/data-table/data-table-column-header/data-table-column-header.styles.js +1 -1
- package/build/cjs/data-table/data-table-column-header/filter-handle.js +6 -5
- package/build/cjs/data-table/data-table-column-header/sorter.js +9 -8
- package/build/cjs/data-table/data-table-row/data-table-row.js +12 -11
- package/build/cjs/data-table/data-table-row/data-table-row.styles.js +1 -1
- package/build/cjs/data-table/data-table-row/expand-handle-cell.js +15 -12
- package/build/cjs/data-table/data-table-row/expanded-row.js +23 -20
- package/build/cjs/data-table/data-table.js +12 -11
- package/build/cjs/data-table/data-table.stories.e2e.js +1 -1
- package/build/cjs/data-table/data-table.stories.js +147 -145
- package/build/cjs/data-table/table-elements/__tests__/table-data-cell.test.js +3 -3
- package/build/cjs/data-table/table-elements/__tests__/table-header-cell.test.js +4 -4
- package/build/cjs/data-table/table-elements/__tests__/table.test.js +2 -2
- package/build/cjs/data-table/table-elements/index.js +8 -8
- package/build/cjs/data-table/table-elements/table-body.js +21 -18
- package/build/cjs/data-table/table-elements/table-data-cell/table-data-cell.js +40 -37
- package/build/cjs/data-table/table-elements/table-data-cell/table-data-cell.styles.js +1 -1
- package/build/cjs/data-table/table-elements/table-foot.js +15 -12
- package/build/cjs/data-table/table-elements/table-head.js +15 -12
- package/build/cjs/data-table/table-elements/table-header-cell/table-header-cell.js +43 -40
- package/build/cjs/data-table/table-elements/table-header-cell/table-header-cell.styles.js +1 -1
- package/build/cjs/data-table/table-elements/table-header-cell-action.js +20 -17
- package/build/cjs/data-table/table-elements/table-row.js +21 -18
- package/build/cjs/data-table/table-elements/table-scroll-box.js +18 -15
- package/build/cjs/data-table/table-elements/table-toolbar.js +17 -14
- package/build/cjs/data-table/table-elements/table.js +23 -20
- package/build/cjs/data-table/table-elements/table.stories.e2e.js +1 -1
- package/build/cjs/data-table/table-elements/table.stories.internal.js +119 -127
- package/build/cjs/index.js +42 -42
- package/build/cjs/stacked-table/content-with-title.js +14 -11
- package/build/cjs/stacked-table/index.js +10 -10
- package/build/cjs/stacked-table/stacked-table-body.js +13 -10
- package/build/cjs/stacked-table/stacked-table-cell-head.js +20 -17
- package/build/cjs/stacked-table/stacked-table-cell.js +13 -12
- package/build/cjs/stacked-table/stacked-table-foot.js +13 -10
- package/build/cjs/stacked-table/stacked-table-head.js +13 -10
- package/build/cjs/stacked-table/stacked-table-row-head.js +11 -8
- package/build/cjs/stacked-table/stacked-table-row.js +19 -13
- package/build/cjs/stacked-table/stacked-table.js +7 -6
- package/build/cjs/stacked-table/stacked-table.stories.js +3 -20
- package/build/cjs/stacked-table/stacked-table.test.js +24 -15
- package/build/cjs/stacked-table/table-context.js +1 -1
- package/build/cjs/stacked-table/table.js +14 -11
- package/build/cjs/table/index.js +10 -10
- package/build/cjs/table/table-body.js +13 -10
- package/build/cjs/table/table-cell-head.js +22 -19
- package/build/cjs/table/table-cell.js +22 -19
- package/build/cjs/table/table-context.js +1 -1
- package/build/cjs/table/table-foot.js +13 -10
- package/build/cjs/table/table-head.js +13 -10
- package/build/cjs/table/table-row-head.js +15 -12
- package/build/cjs/table/table-row.js +9 -8
- package/build/cjs/table/table.js +19 -16
- package/build/cjs/table/table.stories.js +3 -18
- package/build/es/data-table/__tests__/data-table-row/expanded-row.test.js +2 -2
- package/build/es/data-table/data-table-cell.js +23 -22
- package/build/es/data-table/data-table-column-header/data-table-column-header.js +60 -57
- package/build/es/data-table/data-table-column-header/filter-handle.js +6 -5
- package/build/es/data-table/data-table-column-header/sorter.js +8 -7
- package/build/es/data-table/data-table-row/data-table-row.js +12 -11
- package/build/es/data-table/data-table-row/data-table-row.styles.js +1 -1
- package/build/es/data-table/data-table-row/expand-handle-cell.js +15 -12
- package/build/es/data-table/data-table-row/expanded-row.js +23 -20
- package/build/es/data-table/data-table.js +12 -11
- package/build/es/data-table/data-table.stories.js +146 -144
- package/build/es/data-table/table-elements/__tests__/table-data-cell.test.js +3 -3
- package/build/es/data-table/table-elements/__tests__/table-header-cell.test.js +4 -4
- package/build/es/data-table/table-elements/__tests__/table.test.js +2 -2
- package/build/es/data-table/table-elements/table-body.js +21 -18
- package/build/es/data-table/table-elements/table-data-cell/table-data-cell.js +40 -37
- package/build/es/data-table/table-elements/table-data-cell/table-data-cell.styles.js +1 -1
- package/build/es/data-table/table-elements/table-foot.js +15 -12
- package/build/es/data-table/table-elements/table-head.js +15 -12
- package/build/es/data-table/table-elements/table-header-cell/table-header-cell.js +43 -40
- package/build/es/data-table/table-elements/table-header-cell/table-header-cell.styles.js +1 -1
- package/build/es/data-table/table-elements/table-header-cell-action.js +20 -17
- package/build/es/data-table/table-elements/table-row.js +21 -18
- package/build/es/data-table/table-elements/table-scroll-box.js +18 -15
- package/build/es/data-table/table-elements/table-toolbar.js +17 -14
- package/build/es/data-table/table-elements/table.js +23 -20
- package/build/es/data-table/table-elements/table.stories.internal.js +118 -126
- package/build/es/stacked-table/content-with-title.js +14 -11
- package/build/es/stacked-table/stacked-table-body.js +13 -10
- package/build/es/stacked-table/stacked-table-cell-head.js +20 -17
- package/build/es/stacked-table/stacked-table-cell.js +13 -12
- package/build/es/stacked-table/stacked-table-foot.js +13 -10
- package/build/es/stacked-table/stacked-table-head.js +13 -10
- package/build/es/stacked-table/stacked-table-row-head.js +11 -8
- package/build/es/stacked-table/stacked-table-row.js +19 -13
- package/build/es/stacked-table/stacked-table.js +7 -6
- package/build/es/stacked-table/stacked-table.stories.js +2 -19
- package/build/es/stacked-table/stacked-table.test.js +24 -15
- package/build/es/stacked-table/table.js +14 -11
- package/build/es/table/table-body.js +13 -10
- package/build/es/table/table-cell-head.js +22 -19
- package/build/es/table/table-cell.js +22 -19
- package/build/es/table/table-foot.js +13 -10
- package/build/es/table/table-head.js +13 -10
- package/build/es/table/table-row-head.js +15 -12
- package/build/es/table/table-row.js +9 -8
- package/build/es/table/table.js +19 -16
- package/build/es/table/table.stories.js +2 -17
- package/package.json +3 -3
|
@@ -8,29 +8,12 @@ import { StackedTableHead } from './stacked-table-head.js';
|
|
|
8
8
|
import { StackedTableRowHead } from './stacked-table-row-head.js';
|
|
9
9
|
import { StackedTableRow } from './stacked-table-row.js';
|
|
10
10
|
import { StackedTable } from './stacked-table.js';
|
|
11
|
-
const description =
|
|
12
|
-
Expresses tabular data such that each 'row' becomes a table section with the 'column' header in each cell. Multiple rows become multiple sections.
|
|
13
|
-
|
|
14
|
-
Compose with StackedTable child components, as seen in the examples.
|
|
15
|
-
|
|
16
|
-
\`\`\`js
|
|
17
|
-
import {
|
|
18
|
-
StackedTable,
|
|
19
|
-
StackedTableBody,
|
|
20
|
-
StackedTableCell,
|
|
21
|
-
StackedTableCellHead,
|
|
22
|
-
StackedTableFoot,
|
|
23
|
-
StackedTableHead,
|
|
24
|
-
StackedTableRow,
|
|
25
|
-
StackedTableRowHead,
|
|
26
|
-
} from 'dhis2/ui'
|
|
27
|
-
\`\`\`
|
|
28
|
-
`;
|
|
11
|
+
const description = "\nExpresses tabular data such that each 'row' becomes a table section with the 'column' header in each cell. Multiple rows become multiple sections.\n\nCompose with StackedTable child components, as seen in the examples.\n\n```js\nimport {\n StackedTable,\n StackedTableBody,\n StackedTableCell,\n StackedTableCellHead,\n StackedTableFoot,\n StackedTableHead,\n StackedTableRow,\n StackedTableRowHead,\n} from 'dhis2/ui'\n```\n";
|
|
29
12
|
|
|
30
13
|
const CustomCell = props => /*#__PURE__*/React.createElement("td", null, "Received props:", /*#__PURE__*/React.createElement("code", null, /*#__PURE__*/React.createElement("pre", null, JSON.stringify(props, null, 2))));
|
|
31
14
|
|
|
32
15
|
export default {
|
|
33
|
-
title: '
|
|
16
|
+
title: 'Stacked Table',
|
|
34
17
|
component: StackedTable,
|
|
35
18
|
parameters: {
|
|
36
19
|
docs: {
|
|
@@ -11,20 +11,29 @@ import { StackedTableRowHead } from './stacked-table-row-head.js';
|
|
|
11
11
|
import { StackedTableRow } from './stacked-table-row.js';
|
|
12
12
|
import { StackedTable } from './stacked-table.js';
|
|
13
13
|
|
|
14
|
-
const Table =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}),
|
|
14
|
+
const Table = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
headerLabels,
|
|
17
|
+
bodyLabels
|
|
18
|
+
} = _ref;
|
|
19
|
+
return /*#__PURE__*/React.createElement(StackedTable, null, /*#__PURE__*/React.createElement(StackedTableHead, null, /*#__PURE__*/React.createElement(StackedTableRowHead, null, headerLabels.map((_ref2, index) => {
|
|
20
|
+
let {
|
|
21
|
+
label,
|
|
22
|
+
...props
|
|
23
|
+
} = _ref2;
|
|
24
|
+
return /*#__PURE__*/React.createElement(StackedTableCellHead, _extends({}, props, {
|
|
25
|
+
key: label + index
|
|
26
|
+
}), label);
|
|
27
|
+
}))), /*#__PURE__*/React.createElement(StackedTableBody, null, /*#__PURE__*/React.createElement(StackedTableRow, null, bodyLabels.map(_ref3 => {
|
|
28
|
+
let {
|
|
29
|
+
label,
|
|
30
|
+
...props
|
|
31
|
+
} = _ref3;
|
|
32
|
+
return /*#__PURE__*/React.createElement(StackedTableCell, _extends({}, props, {
|
|
33
|
+
key: label
|
|
34
|
+
}), label);
|
|
35
|
+
}))));
|
|
36
|
+
};
|
|
28
37
|
|
|
29
38
|
describe('StackedTable', () => {
|
|
30
39
|
const headerLabels = [{
|
|
@@ -98,7 +107,7 @@ describe('StackedTable', () => {
|
|
|
98
107
|
const colSpan = 3;
|
|
99
108
|
const originalHeaderLabel = headerLabels[indexWithColspan];
|
|
100
109
|
const headerLabelsWithColspan = [...headerLabels.slice(0, indexWithColspan), { ...originalHeaderLabel,
|
|
101
|
-
colSpan:
|
|
110
|
+
colSpan: "".concat(colSpan)
|
|
102
111
|
}, ...headerLabels.slice(indexWithColspan + colSpan)];
|
|
103
112
|
const table = mount( /*#__PURE__*/React.createElement(Table, {
|
|
104
113
|
headerLabels: headerLabelsWithColspan,
|
|
@@ -2,17 +2,20 @@ import _JSXStyle from "styled-jsx/style";
|
|
|
2
2
|
import { colors } from '@dhis2/ui-constants';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import React from 'react';
|
|
5
|
-
export const Table =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
export const Table = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
children,
|
|
8
|
+
className,
|
|
9
|
+
dataTest
|
|
10
|
+
} = _ref;
|
|
11
|
+
return /*#__PURE__*/React.createElement("table", {
|
|
12
|
+
"data-test": dataTest,
|
|
13
|
+
className: _JSXStyle.dynamic([["4278890465", [colors.white, colors.grey900]]]) + " " + (className || "")
|
|
14
|
+
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
15
|
+
id: "4278890465",
|
|
16
|
+
dynamic: [colors.white, colors.grey900]
|
|
17
|
+
}, ["table.__jsx-style-dynamic-selector{display:block;border:0;background-color:".concat(colors.white, ";min-width:100%;text-align:left;border-collapse:collapse;vertical-align:top;color:").concat(colors.grey900, ";}")]));
|
|
18
|
+
};
|
|
16
19
|
Table.propTypes = {
|
|
17
20
|
children: PropTypes.node.isRequired,
|
|
18
21
|
className: PropTypes.string,
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export const TableBody =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
export const TableBody = _ref => {
|
|
4
|
+
let {
|
|
5
|
+
children,
|
|
6
|
+
className,
|
|
7
|
+
dataTest,
|
|
8
|
+
role
|
|
9
|
+
} = _ref;
|
|
10
|
+
return /*#__PURE__*/React.createElement("tbody", {
|
|
11
|
+
className: className,
|
|
12
|
+
"data-test": dataTest,
|
|
13
|
+
role: role
|
|
14
|
+
}, children);
|
|
15
|
+
};
|
|
13
16
|
TableBody.defaultProps = {
|
|
14
17
|
dataTest: 'dhis2-uicore-tablebody'
|
|
15
18
|
};
|
|
@@ -4,25 +4,28 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
const tableCellHeadStyles = ["th.jsx-1796049005{border-bottom:1px solid #e8edf2;font-size:14px;line-height:18px;padding:13px 12px;height:45px;}", ".dense.jsx-1796049005{padding:9px 12px;height:36px;}"];
|
|
6
6
|
tableCellHeadStyles.__hash = "1796049005";
|
|
7
|
-
export const TableCellHead =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
},
|
|
7
|
+
export const TableCellHead = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
role,
|
|
10
|
+
colSpan,
|
|
11
|
+
rowSpan,
|
|
12
|
+
dense,
|
|
13
|
+
children,
|
|
14
|
+
className,
|
|
15
|
+
dataTest
|
|
16
|
+
} = _ref;
|
|
17
|
+
return /*#__PURE__*/React.createElement("th", {
|
|
18
|
+
colSpan: colSpan,
|
|
19
|
+
rowSpan: rowSpan,
|
|
20
|
+
"data-test": dataTest,
|
|
21
|
+
role: role,
|
|
22
|
+
className: "jsx-".concat(tableCellHeadStyles.__hash) + " " + (cx({
|
|
23
|
+
dense
|
|
24
|
+
}, className) || "")
|
|
25
|
+
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
26
|
+
id: tableCellHeadStyles.__hash
|
|
27
|
+
}, tableCellHeadStyles));
|
|
28
|
+
};
|
|
26
29
|
TableCellHead.defaultProps = {
|
|
27
30
|
dataTest: 'dhis2-uicore-tablecellhead'
|
|
28
31
|
};
|
|
@@ -4,25 +4,28 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
const tableCellStyles = ["td.jsx-996330601{border-bottom:1px solid #e8edf2;font-size:14px;line-height:18px;padding:13px 12px;height:45px;}", ".dense.jsx-996330601{padding:9px 12px;height:36px;}"];
|
|
6
6
|
tableCellStyles.__hash = "996330601";
|
|
7
|
-
export const TableCell =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
},
|
|
7
|
+
export const TableCell = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
role,
|
|
10
|
+
className,
|
|
11
|
+
children,
|
|
12
|
+
colSpan,
|
|
13
|
+
rowSpan,
|
|
14
|
+
dense,
|
|
15
|
+
dataTest
|
|
16
|
+
} = _ref;
|
|
17
|
+
return /*#__PURE__*/React.createElement("td", {
|
|
18
|
+
colSpan: colSpan,
|
|
19
|
+
rowSpan: rowSpan,
|
|
20
|
+
"data-test": dataTest,
|
|
21
|
+
role: role,
|
|
22
|
+
className: "jsx-".concat(tableCellStyles.__hash) + " " + (cx({
|
|
23
|
+
dense
|
|
24
|
+
}, className) || "")
|
|
25
|
+
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
26
|
+
id: tableCellStyles.__hash
|
|
27
|
+
}, tableCellStyles));
|
|
28
|
+
};
|
|
26
29
|
TableCell.defaultProps = {
|
|
27
30
|
dataTest: 'dhis2-uicore-tablecell'
|
|
28
31
|
};
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export const TableFoot =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
export const TableFoot = _ref => {
|
|
4
|
+
let {
|
|
5
|
+
children,
|
|
6
|
+
className,
|
|
7
|
+
dataTest,
|
|
8
|
+
role
|
|
9
|
+
} = _ref;
|
|
10
|
+
return /*#__PURE__*/React.createElement("tfoot", {
|
|
11
|
+
className: className,
|
|
12
|
+
"data-test": dataTest,
|
|
13
|
+
role: role
|
|
14
|
+
}, children);
|
|
15
|
+
};
|
|
13
16
|
TableFoot.defaultProps = {
|
|
14
17
|
dataTest: 'dhis2-uicore-tablefoot'
|
|
15
18
|
};
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export const TableHead =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
export const TableHead = _ref => {
|
|
4
|
+
let {
|
|
5
|
+
children,
|
|
6
|
+
className,
|
|
7
|
+
dataTest,
|
|
8
|
+
role
|
|
9
|
+
} = _ref;
|
|
10
|
+
return /*#__PURE__*/React.createElement("thead", {
|
|
11
|
+
className: className,
|
|
12
|
+
"data-test": dataTest,
|
|
13
|
+
role: role
|
|
14
|
+
}, children);
|
|
15
|
+
};
|
|
13
16
|
TableHead.defaultProps = {
|
|
14
17
|
dataTest: 'dhis2-uicore-tablehead'
|
|
15
18
|
};
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { TableRow } from './table-row.js';
|
|
4
|
-
export const TableRowHead =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
export const TableRowHead = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
role,
|
|
7
|
+
children,
|
|
8
|
+
className,
|
|
9
|
+
dataTest,
|
|
10
|
+
suppressZebraStriping
|
|
11
|
+
} = _ref;
|
|
12
|
+
return /*#__PURE__*/React.createElement(TableRow, {
|
|
13
|
+
className: className,
|
|
14
|
+
dataTest: dataTest,
|
|
15
|
+
suppressZebraStriping: suppressZebraStriping,
|
|
16
|
+
role: role
|
|
17
|
+
}, children);
|
|
18
|
+
};
|
|
16
19
|
TableRowHead.defaultProps = {
|
|
17
20
|
dataTest: 'dhis2-uicore-tablerowhead'
|
|
18
21
|
};
|
|
@@ -5,13 +5,14 @@ import React, { useContext } from 'react';
|
|
|
5
5
|
import { TableContext } from './table-context.js';
|
|
6
6
|
const tableRowStyles = [".zebraStriping.jsx-3124144591:nth-child(even){background:#fbfcfd;}"];
|
|
7
7
|
tableRowStyles.__hash = "3124144591";
|
|
8
|
-
export const TableRow =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
export const TableRow = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
role,
|
|
11
|
+
children,
|
|
12
|
+
className,
|
|
13
|
+
dataTest,
|
|
14
|
+
suppressZebraStriping
|
|
15
|
+
} = _ref;
|
|
15
16
|
const {
|
|
16
17
|
suppressZebraStriping: suppressZebraStripingFromContext
|
|
17
18
|
} = useContext(TableContext);
|
|
@@ -19,7 +20,7 @@ export const TableRow = ({
|
|
|
19
20
|
return /*#__PURE__*/React.createElement("tr", {
|
|
20
21
|
"data-test": dataTest,
|
|
21
22
|
role: role,
|
|
22
|
-
className:
|
|
23
|
+
className: "jsx-".concat(tableRowStyles.__hash) + " " + (cx(className, {
|
|
23
24
|
zebraStriping
|
|
24
25
|
}) || "")
|
|
25
26
|
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
package/build/es/table/table.js
CHANGED
|
@@ -4,23 +4,26 @@ import React from 'react';
|
|
|
4
4
|
import { Provider } from './table-context.js';
|
|
5
5
|
const tableStyles = ["table.jsx-2430604489{border:1px solid #e8edf2;background-color:#ffffff;min-width:100%;text-align:left;border-collapse:collapse;vertical-align:top;}"];
|
|
6
6
|
tableStyles.__hash = "2430604489";
|
|
7
|
-
export const Table =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}) => /*#__PURE__*/React.createElement(Provider, {
|
|
14
|
-
value: {
|
|
7
|
+
export const Table = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
role,
|
|
10
|
+
children,
|
|
11
|
+
className,
|
|
12
|
+
dataTest,
|
|
15
13
|
suppressZebraStriping
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
} = _ref;
|
|
15
|
+
return /*#__PURE__*/React.createElement(Provider, {
|
|
16
|
+
value: {
|
|
17
|
+
suppressZebraStriping
|
|
18
|
+
}
|
|
19
|
+
}, /*#__PURE__*/React.createElement("table", {
|
|
20
|
+
"data-test": dataTest,
|
|
21
|
+
role: role,
|
|
22
|
+
className: "jsx-".concat(tableStyles.__hash) + " " + (className || "")
|
|
23
|
+
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
24
|
+
id: tableStyles.__hash
|
|
25
|
+
}, tableStyles)));
|
|
26
|
+
};
|
|
24
27
|
Table.defaultProps = {
|
|
25
28
|
dataTest: 'dhis2-uicore-table'
|
|
26
29
|
};
|
|
@@ -10,22 +10,7 @@ import { TableRowHead } from './table-row-head.js';
|
|
|
10
10
|
import { TableRow } from './table-row.js';
|
|
11
11
|
import { Table } from './table.js';
|
|
12
12
|
const subtitle = 'Used to display information in a standard, effective way.';
|
|
13
|
-
const description =
|
|
14
|
-
Should be used with multiple Table-related child components - see the table and examples below.
|
|
15
|
-
|
|
16
|
-
\`\`\`js
|
|
17
|
-
import {
|
|
18
|
-
Table,
|
|
19
|
-
TableBody,
|
|
20
|
-
TableCell,
|
|
21
|
-
TableCellHead,
|
|
22
|
-
TableFoot,
|
|
23
|
-
TableHead,
|
|
24
|
-
TableRow,
|
|
25
|
-
TableRowHead,
|
|
26
|
-
} from '@dhis2/ui'
|
|
27
|
-
\`\`\`
|
|
28
|
-
`;
|
|
13
|
+
const description = "\nShould be used with multiple Table-related child components - see the table and examples below.\n\n```js\nimport {\n Table,\n TableBody,\n TableCell,\n TableCellHead,\n TableFoot,\n TableHead,\n TableRow,\n TableRowHead,\n} from '@dhis2/ui'\n```\n";
|
|
29
14
|
|
|
30
15
|
const TableFooterButton = () => /*#__PURE__*/React.createElement("div", {
|
|
31
16
|
className: "jsx-3056176987"
|
|
@@ -40,7 +25,7 @@ const TableButton = () => /*#__PURE__*/React.createElement(Button, {
|
|
|
40
25
|
}, "Table button");
|
|
41
26
|
|
|
42
27
|
export default {
|
|
43
|
-
title: '
|
|
28
|
+
title: 'Table',
|
|
44
29
|
component: Table,
|
|
45
30
|
// Add subcomponents to the args table
|
|
46
31
|
subcomponents: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2-ui/table",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.3",
|
|
4
4
|
"description": "UI Table",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@dhis2/prop-types": "^3.0.0-beta.1",
|
|
36
|
-
"@dhis2/ui-constants": "8.2.
|
|
37
|
-
"@dhis2/ui-icons": "8.2.
|
|
36
|
+
"@dhis2/ui-constants": "8.2.3",
|
|
37
|
+
"@dhis2/ui-icons": "8.2.3",
|
|
38
38
|
"classnames": "^2.3.1",
|
|
39
39
|
"prop-types": "^15.7.2"
|
|
40
40
|
},
|