@dhis2-ui/table 9.11.0 → 9.11.1-beta.10
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-cell.test.js +7 -13
- package/build/cjs/data-table/__tests__/data-table-column-header/filter-handle.test.js +1 -8
- package/build/cjs/data-table/__tests__/data-table-column-header/sorter.test.js +1 -6
- package/build/cjs/data-table/__tests__/data-table-column-header.test.js +5 -12
- package/build/cjs/data-table/__tests__/data-table-row/expand-handle-cell.js +1 -6
- package/build/cjs/data-table/__tests__/data-table-row/expanded-row.test.js +3 -8
- package/build/cjs/data-table/__tests__/data-table-row.test.js +5 -13
- package/build/cjs/data-table/__tests__/data-table.test.js +1 -7
- package/build/cjs/data-table/data-table-body.js +0 -1
- package/build/cjs/data-table/data-table-cell.js +5 -24
- package/build/cjs/data-table/data-table-column-header/data-table-column-header.js +8 -27
- package/build/cjs/data-table/data-table-column-header/data-table-column-header.styles.js +4 -10
- package/build/cjs/data-table/data-table-column-header/filter-handle.js +1 -10
- package/build/cjs/data-table/data-table-column-header/sorter.js +6 -23
- package/build/cjs/data-table/data-table-foot.js +0 -1
- package/build/cjs/data-table/data-table-head.js +0 -1
- package/build/cjs/data-table/data-table-row/data-table-row.js +5 -27
- package/build/cjs/data-table/data-table-row/data-table-row.styles.js +4 -10
- package/build/cjs/data-table/data-table-row/drag-handle-cell.js +1 -7
- package/build/cjs/data-table/data-table-row/expand-handle-cell.js +1 -11
- package/build/cjs/data-table/data-table-row/expanded-row.js +4 -14
- package/build/cjs/data-table/data-table-toolbar.js +0 -1
- package/build/cjs/data-table/{data-table.stories.e2e.js → data-table.e2e.stories.js} +2 -14
- package/build/cjs/data-table/data-table.js +5 -20
- package/build/cjs/data-table/{data-table.stories.js → data-table.prod.stories.js} +39 -101
- package/build/cjs/data-table/features/can_scroll/index.js +0 -1
- package/build/cjs/data-table/index.js +0 -8
- package/build/cjs/data-table/table-elements/__tests__/table-body.test.js +1 -6
- package/build/cjs/data-table/table-elements/__tests__/table-data-cell.test.js +4 -9
- package/build/cjs/data-table/table-elements/__tests__/table-foot.test.js +1 -6
- package/build/cjs/data-table/table-elements/__tests__/table-head.test.js +1 -6
- package/build/cjs/data-table/table-elements/__tests__/table-header-cell-action.test.js +1 -6
- package/build/cjs/data-table/table-elements/__tests__/table-header-cell.test.js +5 -10
- package/build/cjs/data-table/table-elements/__tests__/table-row.test.js +1 -6
- package/build/cjs/data-table/table-elements/__tests__/table-scroll-box.test.js +1 -6
- package/build/cjs/data-table/table-elements/__tests__/table-toolbar.test.js +1 -6
- package/build/cjs/data-table/table-elements/__tests__/table.test.js +3 -8
- package/build/cjs/data-table/table-elements/features/can_scroll/index.js +0 -1
- package/build/cjs/data-table/table-elements/index.js +0 -10
- package/build/cjs/data-table/table-elements/table-body.js +6 -17
- package/build/cjs/data-table/table-elements/table-data-cell/table-data-cell.js +7 -27
- package/build/cjs/data-table/table-elements/table-data-cell/table-data-cell.styles.js +2 -5
- package/build/cjs/data-table/table-elements/table-foot.js +5 -13
- package/build/cjs/data-table/table-elements/table-head.js +5 -13
- package/build/cjs/data-table/table-elements/table-header-cell/table-header-cell.js +7 -27
- package/build/cjs/data-table/table-elements/table-header-cell/table-header-cell.styles.js +2 -5
- package/build/cjs/data-table/table-elements/table-header-cell-action.js +6 -16
- package/build/cjs/data-table/table-elements/table-row.js +5 -17
- package/build/cjs/data-table/table-elements/table-scroll-box.js +6 -16
- package/build/cjs/data-table/table-elements/table-toolbar.js +6 -17
- package/build/cjs/data-table/table-elements/{table.stories.e2e.js → table.e2e.stories.js} +2 -15
- package/build/cjs/data-table/table-elements/table.js +6 -20
- package/build/cjs/data-table/table-elements/table.stories.internal.js +41 -78
- package/build/cjs/index.js +0 -3
- package/build/cjs/locales/index.js +3 -33
- package/build/cjs/stacked-table/add-col-num-to-children.js +0 -3
- package/build/cjs/stacked-table/content-with-title.js +4 -13
- package/build/cjs/stacked-table/extract-header-labels.js +25 -28
- package/build/cjs/stacked-table/index.js +0 -8
- package/build/cjs/stacked-table/stacked-table-body.js +1 -7
- package/build/cjs/stacked-table/stacked-table-cell-head.js +2 -9
- package/build/cjs/stacked-table/stacked-table-cell.js +2 -10
- package/build/cjs/stacked-table/stacked-table-foot.js +1 -7
- package/build/cjs/stacked-table/stacked-table-head.js +1 -7
- package/build/cjs/stacked-table/stacked-table-row-head.js +1 -7
- package/build/cjs/stacked-table/stacked-table-row.js +2 -12
- package/build/cjs/stacked-table/stacked-table.js +1 -10
- package/build/cjs/stacked-table/{stacked-table.stories.js → stacked-table.prod.stories.js} +20 -40
- package/build/cjs/stacked-table/stacked-table.test.js +9 -19
- package/build/cjs/stacked-table/supply-header-labels-to-children.js +0 -3
- package/build/cjs/stacked-table/table-context.js +1 -4
- package/build/cjs/stacked-table/table.js +2 -9
- package/build/cjs/table/index.js +0 -8
- package/build/cjs/table/table-body.js +1 -6
- package/build/cjs/table/table-cell-head.js +2 -11
- package/build/cjs/table/table-cell.js +2 -11
- package/build/cjs/table/table-context.js +1 -4
- package/build/cjs/table/table-foot.js +1 -6
- package/build/cjs/table/table-head.js +1 -6
- package/build/cjs/table/table-row-head.js +1 -8
- package/build/cjs/table/table-row.js +5 -18
- package/build/cjs/table/table.js +2 -11
- package/build/cjs/table/{table.stories.js → table.prod.stories.js} +18 -30
- package/build/es/data-table/__tests__/data-table-cell.test.js +6 -6
- package/build/es/data-table/__tests__/data-table-column-header.test.js +4 -3
- package/build/es/data-table/__tests__/data-table-row/expanded-row.test.js +2 -2
- package/build/es/data-table/__tests__/data-table-row.test.js +4 -2
- package/build/es/data-table/data-table-cell.js +1 -11
- package/build/es/data-table/data-table-column-header/data-table-column-header.js +4 -9
- package/build/es/data-table/data-table-column-header/sorter.js +1 -1
- package/build/es/data-table/data-table-row/data-table-row.js +1 -7
- package/build/es/data-table/data-table-row/data-table-row.styles.js +1 -1
- package/build/es/data-table/data-table-row/expanded-row.js +3 -3
- package/build/es/data-table/data-table.js +1 -5
- package/build/es/data-table/{data-table.stories.js → data-table.prod.stories.js} +19 -44
- 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 +2 -4
- package/build/es/data-table/table-elements/table-data-cell/table-data-cell.js +3 -12
- 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 +1 -2
- package/build/es/data-table/table-elements/table-head.js +1 -2
- package/build/es/data-table/table-elements/table-header-cell/table-header-cell.js +3 -12
- 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 +2 -4
- package/build/es/data-table/table-elements/table-row.js +1 -5
- package/build/es/data-table/table-elements/table-scroll-box.js +2 -4
- package/build/es/data-table/table-elements/table-toolbar.js +2 -4
- package/build/es/data-table/table-elements/table.js +2 -7
- package/build/es/data-table/table-elements/table.stories.internal.js +23 -29
- package/build/es/stacked-table/content-with-title.js +1 -1
- package/build/es/stacked-table/extract-header-labels.js +24 -23
- package/build/es/stacked-table/stacked-table-cell-head.js +1 -1
- package/build/es/stacked-table/stacked-table-cell.js +1 -1
- package/build/es/stacked-table/stacked-table-row.js +1 -1
- package/build/es/stacked-table/stacked-table.js +0 -1
- package/build/es/stacked-table/{stacked-table.stories.js → stacked-table.prod.stories.js} +17 -2
- package/build/es/stacked-table/stacked-table.test.js +8 -9
- package/build/es/stacked-table/table.js +1 -1
- package/build/es/table/table-cell-head.js +1 -2
- package/build/es/table/table-cell.js +1 -2
- package/build/es/table/table-row-head.js +0 -1
- package/build/es/table/table-row.js +2 -5
- package/build/es/table/table.js +1 -2
- package/build/es/table/{table.stories.js → table.prod.stories.js} +15 -3
- package/package.json +6 -6
- /package/build/es/data-table/{data-table.stories.e2e.js → data-table.e2e.stories.js} +0 -0
- /package/build/es/data-table/table-elements/{table.stories.e2e.js → table.e2e.stories.js} +0 -0
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
2
|
-
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
2
|
import { Box } from '@dhis2-ui/box';
|
|
4
3
|
import { Checkbox } from '@dhis2-ui/checkbox';
|
|
5
4
|
import { Input } from '@dhis2-ui/input';
|
|
@@ -13,7 +12,22 @@ import { DataTableRow } from './data-table-row/data-table-row.js';
|
|
|
13
12
|
import { DataTableToolbar } from './data-table-toolbar.js';
|
|
14
13
|
import { DataTable } from './data-table.js';
|
|
15
14
|
const subtitle = 'Used to display information in a standard, effective way.';
|
|
16
|
-
const description =
|
|
15
|
+
const description = `
|
|
16
|
+
Should be used with multiple DataTable-related child components - see the datatable and examples below.
|
|
17
|
+
|
|
18
|
+
\`\`\`js
|
|
19
|
+
import {
|
|
20
|
+
DataTable,
|
|
21
|
+
DataTableToolbar,
|
|
22
|
+
DataTableHead,
|
|
23
|
+
DataTableBody,
|
|
24
|
+
DataTableFoot,
|
|
25
|
+
DataTableRow,
|
|
26
|
+
DataTableCell,
|
|
27
|
+
DataTableColumnHeader,
|
|
28
|
+
} from '@dhis2/ui'
|
|
29
|
+
\`\`\`
|
|
30
|
+
`;
|
|
17
31
|
export default {
|
|
18
32
|
title: 'DataTable',
|
|
19
33
|
component: DataTable,
|
|
@@ -60,7 +74,6 @@ export default {
|
|
|
60
74
|
}
|
|
61
75
|
}
|
|
62
76
|
};
|
|
63
|
-
|
|
64
77
|
const BasicTemplate = _ref => {
|
|
65
78
|
let {
|
|
66
79
|
bordered,
|
|
@@ -125,7 +138,6 @@ const BasicTemplate = _ref => {
|
|
|
125
138
|
colSpan: draggable ? '5' : '4'
|
|
126
139
|
}, "Footer content"))));
|
|
127
140
|
};
|
|
128
|
-
|
|
129
141
|
export const Default = BasicTemplate.bind({});
|
|
130
142
|
Default.args = {};
|
|
131
143
|
export const Loading = BasicTemplate.bind({});
|
|
@@ -146,7 +158,6 @@ export const DraggableRows = BasicTemplate.bind({});
|
|
|
146
158
|
DraggableRows.args = {
|
|
147
159
|
draggable: true
|
|
148
160
|
};
|
|
149
|
-
|
|
150
161
|
const IndividualCellTemplate = args => /*#__PURE__*/React.createElement(DataTable, args, /*#__PURE__*/React.createElement(DataTableHead, null, /*#__PURE__*/React.createElement(DataTableRow, null, /*#__PURE__*/React.createElement(DataTableColumnHeader, null, "Header"), /*#__PURE__*/React.createElement(DataTableColumnHeader, null, "Header"), /*#__PURE__*/React.createElement(DataTableColumnHeader, null, "Header"), /*#__PURE__*/React.createElement(DataTableColumnHeader, null, "Header"))), /*#__PURE__*/React.createElement(DataTableBody, null, /*#__PURE__*/React.createElement(DataTableRow, null, /*#__PURE__*/React.createElement(DataTableCell, {
|
|
151
162
|
tag: "th"
|
|
152
163
|
}, "Active Cells"), /*#__PURE__*/React.createElement(DataTableCell, null, "Inactive cell"), /*#__PURE__*/React.createElement(DataTableCell, {
|
|
@@ -187,22 +198,16 @@ const IndividualCellTemplate = args => /*#__PURE__*/React.createElement(DataTabl
|
|
|
187
198
|
}, "#eff"), /*#__PURE__*/React.createElement(DataTableCell, {
|
|
188
199
|
backgroundColor: "yellow"
|
|
189
200
|
}, "yellow"), /*#__PURE__*/React.createElement(DataTableCell, null, "None"))));
|
|
190
|
-
|
|
191
201
|
export const CellStyling = IndividualCellTemplate.bind({});
|
|
192
202
|
CellStyling.args = {};
|
|
193
|
-
|
|
194
203
|
const ToolbarsTemplate = args => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DataTableToolbar, null, /*#__PURE__*/React.createElement("p", null, "Content")), /*#__PURE__*/React.createElement(DataTable, args, /*#__PURE__*/React.createElement(DataTableHead, null, /*#__PURE__*/React.createElement(DataTableRow, null, /*#__PURE__*/React.createElement(DataTableColumnHeader, null, "First name"), /*#__PURE__*/React.createElement(DataTableColumnHeader, null, "Last name"), /*#__PURE__*/React.createElement(DataTableColumnHeader, null, "Incident date"), /*#__PURE__*/React.createElement(DataTableColumnHeader, null, "Last updated"))), /*#__PURE__*/React.createElement(DataTableBody, null, /*#__PURE__*/React.createElement(DataTableRow, null, /*#__PURE__*/React.createElement(DataTableCell, null, "Onyekachukwu"), /*#__PURE__*/React.createElement(DataTableCell, null, "Kariuki"), /*#__PURE__*/React.createElement(DataTableCell, null, "02/06/2007"), /*#__PURE__*/React.createElement(DataTableCell, null, "05/25/1972")), /*#__PURE__*/React.createElement(DataTableRow, null, /*#__PURE__*/React.createElement(DataTableCell, null, "Kwasi"), /*#__PURE__*/React.createElement(DataTableCell, null, "Okafor"), /*#__PURE__*/React.createElement(DataTableCell, null, "08/11/2010"), /*#__PURE__*/React.createElement(DataTableCell, null, "02/26/1991")), /*#__PURE__*/React.createElement(DataTableRow, null, /*#__PURE__*/React.createElement(DataTableCell, null, "Siyabonga"), /*#__PURE__*/React.createElement(DataTableCell, null, "Abiodun"), /*#__PURE__*/React.createElement(DataTableCell, null, "07/21/1981"), /*#__PURE__*/React.createElement(DataTableCell, null, "02/06/2007")))), /*#__PURE__*/React.createElement(DataTableToolbar, {
|
|
195
204
|
position: "bottom"
|
|
196
205
|
}, /*#__PURE__*/React.createElement("p", null, "Content (bottom)")));
|
|
197
|
-
|
|
198
206
|
export const Toolbars = ToolbarsTemplate.bind({});
|
|
199
207
|
Toolbars.args = {};
|
|
200
|
-
|
|
201
208
|
const ExpandableContentTemplate = args => {
|
|
202
209
|
const [openRowIndex, setOpenRowIndex] = useState(null);
|
|
203
|
-
|
|
204
210
|
const toggleOpenRow = index => setOpenRowIndex(openRowIndex === index ? null : index);
|
|
205
|
-
|
|
206
211
|
const style = {
|
|
207
212
|
margin: 8,
|
|
208
213
|
padding: 4,
|
|
@@ -228,25 +233,22 @@ const ExpandableContentTemplate = args => {
|
|
|
228
233
|
expandableContent: expandableContent
|
|
229
234
|
}, /*#__PURE__*/React.createElement(DataTableCell, null, "Siyabonga"), /*#__PURE__*/React.createElement(DataTableCell, null, "Abiodun"), /*#__PURE__*/React.createElement(DataTableCell, null, "07/21/1981"), /*#__PURE__*/React.createElement(DataTableCell, null, "02/06/2007"))));
|
|
230
235
|
};
|
|
231
|
-
|
|
232
236
|
export const ExpandableContent = ExpandableContentTemplate.bind({});
|
|
233
237
|
ExpandableContent.args = {};
|
|
234
|
-
|
|
235
238
|
const SelectableRowsTemplate = args => {
|
|
236
239
|
const [selected, setSelected] = useState({
|
|
237
240
|
id_2: true
|
|
238
241
|
});
|
|
239
|
-
|
|
240
242
|
const toggleSelected = _ref2 => {
|
|
241
243
|
let {
|
|
242
244
|
value,
|
|
243
245
|
checked
|
|
244
246
|
} = _ref2;
|
|
245
|
-
setSelected({
|
|
247
|
+
setSelected({
|
|
248
|
+
...selected,
|
|
246
249
|
[value]: checked
|
|
247
250
|
});
|
|
248
251
|
};
|
|
249
|
-
|
|
250
252
|
const toggleAll = _ref3 => {
|
|
251
253
|
let {
|
|
252
254
|
checked
|
|
@@ -257,9 +259,7 @@ const SelectableRowsTemplate = args => {
|
|
|
257
259
|
id_3: checked
|
|
258
260
|
});
|
|
259
261
|
};
|
|
260
|
-
|
|
261
262
|
const allSelected = () => Object.values(selected).filter(value => value).length === 3;
|
|
262
|
-
|
|
263
263
|
return /*#__PURE__*/React.createElement(DataTable, args, /*#__PURE__*/React.createElement(DataTableHead, null, /*#__PURE__*/React.createElement(DataTableRow, null, /*#__PURE__*/React.createElement(DataTableColumnHeader, {
|
|
264
264
|
width: "48px"
|
|
265
265
|
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
@@ -291,10 +291,8 @@ const SelectableRowsTemplate = args => {
|
|
|
291
291
|
onChange: toggleSelected
|
|
292
292
|
})), /*#__PURE__*/React.createElement(DataTableCell, null, "Siyabonga"), /*#__PURE__*/React.createElement(DataTableCell, null, "Abiodun"), /*#__PURE__*/React.createElement(DataTableCell, null, "07/21/1981"), /*#__PURE__*/React.createElement(DataTableCell, null, "02/06/2007"))));
|
|
293
293
|
};
|
|
294
|
-
|
|
295
294
|
export const SelectableRows = SelectableRowsTemplate.bind({});
|
|
296
295
|
SelectableRows.args = {};
|
|
297
|
-
|
|
298
296
|
const FixedHeaderTemplate = args => /*#__PURE__*/React.createElement(DataTable, args, /*#__PURE__*/React.createElement(DataTableHead, null, /*#__PURE__*/React.createElement(DataTableRow, null, /*#__PURE__*/React.createElement(DataTableColumnHeader, {
|
|
299
297
|
fixed: true,
|
|
300
298
|
top: "0"
|
|
@@ -320,12 +318,10 @@ const FixedHeaderTemplate = args => /*#__PURE__*/React.createElement(DataTable,
|
|
|
320
318
|
fixed: true,
|
|
321
319
|
top: "0"
|
|
322
320
|
}, "Status"))), /*#__PURE__*/React.createElement(DataTableBody, null, /*#__PURE__*/React.createElement(DataTableRow, null, /*#__PURE__*/React.createElement(DataTableCell, null, "Onyekachukwu"), /*#__PURE__*/React.createElement(DataTableCell, null, "Kariuki"), /*#__PURE__*/React.createElement(DataTableCell, null, "02/06/2007"), /*#__PURE__*/React.createElement(DataTableCell, null, "05/25/1972"), /*#__PURE__*/React.createElement(DataTableCell, null, "66"), /*#__PURE__*/React.createElement(DataTableCell, null, "Jawi"), /*#__PURE__*/React.createElement(DataTableCell, null, "Sofie Hubert"), /*#__PURE__*/React.createElement(DataTableCell, null, "Incomplete")), /*#__PURE__*/React.createElement(DataTableRow, null, /*#__PURE__*/React.createElement(DataTableCell, null, "Kwasi"), /*#__PURE__*/React.createElement(DataTableCell, null, "Okafor"), /*#__PURE__*/React.createElement(DataTableCell, null, "08/11/2010"), /*#__PURE__*/React.createElement(DataTableCell, null, "02/26/1991"), /*#__PURE__*/React.createElement(DataTableCell, null, "38"), /*#__PURE__*/React.createElement(DataTableCell, null, "Mokassie MCHP"), /*#__PURE__*/React.createElement(DataTableCell, null, "Dashonte Clarke"), /*#__PURE__*/React.createElement(DataTableCell, null, "Complete")), /*#__PURE__*/React.createElement(DataTableRow, null, /*#__PURE__*/React.createElement(DataTableCell, null, "Siyabonga"), /*#__PURE__*/React.createElement(DataTableCell, null, "Abiodun"), /*#__PURE__*/React.createElement(DataTableCell, null, "07/21/1981"), /*#__PURE__*/React.createElement(DataTableCell, null, "02/06/2007"), /*#__PURE__*/React.createElement(DataTableCell, null, "98"), /*#__PURE__*/React.createElement(DataTableCell, null, "Bathurst MCHP"), /*#__PURE__*/React.createElement(DataTableCell, null, "Unassigned"), /*#__PURE__*/React.createElement(DataTableCell, null, "Incomplete")), /*#__PURE__*/React.createElement(DataTableRow, null, /*#__PURE__*/React.createElement(DataTableCell, null, "Chiyembekezo"), /*#__PURE__*/React.createElement(DataTableCell, null, "Okeke"), /*#__PURE__*/React.createElement(DataTableCell, null, "01/23/1982"), /*#__PURE__*/React.createElement(DataTableCell, null, "07/15/2003"), /*#__PURE__*/React.createElement(DataTableCell, null, "2"), /*#__PURE__*/React.createElement(DataTableCell, null, "Mayolla MCHP"), /*#__PURE__*/React.createElement(DataTableCell, null, "Wan Gengxin"), /*#__PURE__*/React.createElement(DataTableCell, null, "Incomplete")), /*#__PURE__*/React.createElement(DataTableRow, null, /*#__PURE__*/React.createElement(DataTableCell, null, "Mtendere"), /*#__PURE__*/React.createElement(DataTableCell, null, "Afolayan"), /*#__PURE__*/React.createElement(DataTableCell, null, "08/12/1994"), /*#__PURE__*/React.createElement(DataTableCell, null, "05/12/1972"), /*#__PURE__*/React.createElement(DataTableCell, null, "37"), /*#__PURE__*/React.createElement(DataTableCell, null, "Gbangadu MCHP"), /*#__PURE__*/React.createElement(DataTableCell, null, "Gvozden Boskovsky"), /*#__PURE__*/React.createElement(DataTableCell, null, "Complete")), /*#__PURE__*/React.createElement(DataTableRow, null, /*#__PURE__*/React.createElement(DataTableCell, null, "Inyene"), /*#__PURE__*/React.createElement(DataTableCell, null, "Okonkwo"), /*#__PURE__*/React.createElement(DataTableCell, null, "04/01/1971"), /*#__PURE__*/React.createElement(DataTableCell, null, "03/16/2000"), /*#__PURE__*/React.createElement(DataTableCell, null, "70"), /*#__PURE__*/React.createElement(DataTableCell, null, "Kunike Barina"), /*#__PURE__*/React.createElement(DataTableCell, null, "Oscar de la Cavaller\xEDa"), /*#__PURE__*/React.createElement(DataTableCell, null, "Complete")), /*#__PURE__*/React.createElement(DataTableRow, null, /*#__PURE__*/React.createElement(DataTableCell, null, "Amaka"), /*#__PURE__*/React.createElement(DataTableCell, null, "Pretorius"), /*#__PURE__*/React.createElement(DataTableCell, null, "01/25/1996"), /*#__PURE__*/React.createElement(DataTableCell, null, "09/15/1986"), /*#__PURE__*/React.createElement(DataTableCell, null, "32"), /*#__PURE__*/React.createElement(DataTableCell, null, "Bargbo"), /*#__PURE__*/React.createElement(DataTableCell, null, "Alberto Raya"), /*#__PURE__*/React.createElement(DataTableCell, null, "Incomplete")), /*#__PURE__*/React.createElement(DataTableRow, null, /*#__PURE__*/React.createElement(DataTableCell, null, "Meti"), /*#__PURE__*/React.createElement(DataTableCell, null, "Abiodun"), /*#__PURE__*/React.createElement(DataTableCell, null, "10/24/2010"), /*#__PURE__*/React.createElement(DataTableCell, null, "07/26/1989"), /*#__PURE__*/React.createElement(DataTableCell, null, "8"), /*#__PURE__*/React.createElement(DataTableCell, null, "Majihun MCHP"), /*#__PURE__*/React.createElement(DataTableCell, null, "Unassigned"), /*#__PURE__*/React.createElement(DataTableCell, null, "Complete")), /*#__PURE__*/React.createElement(DataTableRow, null, /*#__PURE__*/React.createElement(DataTableCell, null, "Eshe"), /*#__PURE__*/React.createElement(DataTableCell, null, "Okeke"), /*#__PURE__*/React.createElement(DataTableCell, null, "01/31/1995"), /*#__PURE__*/React.createElement(DataTableCell, null, "01/31/1995"), /*#__PURE__*/React.createElement(DataTableCell, null, "63"), /*#__PURE__*/React.createElement(DataTableCell, null, "Mambiama CHP"), /*#__PURE__*/React.createElement(DataTableCell, null, "Shadrias Pearson"), /*#__PURE__*/React.createElement(DataTableCell, null, "Incomplete")), /*#__PURE__*/React.createElement(DataTableRow, null, /*#__PURE__*/React.createElement(DataTableCell, null, "Obi"), /*#__PURE__*/React.createElement(DataTableCell, null, "Okafor"), /*#__PURE__*/React.createElement(DataTableCell, null, "06/07/1990"), /*#__PURE__*/React.createElement(DataTableCell, null, "01/03/2006"), /*#__PURE__*/React.createElement(DataTableCell, null, "28"), /*#__PURE__*/React.createElement(DataTableCell, null, "Dalakuru CHP"), /*#__PURE__*/React.createElement(DataTableCell, null, "Anatoliy Shcherbatykh"), /*#__PURE__*/React.createElement(DataTableCell, null, "Incomplete"))));
|
|
323
|
-
|
|
324
321
|
export const FixedHeader = FixedHeaderTemplate.bind({});
|
|
325
322
|
FixedHeader.args = {
|
|
326
323
|
scrollHeight: '350px'
|
|
327
324
|
};
|
|
328
|
-
|
|
329
325
|
const FixedFirstColumnTemplate = args => /*#__PURE__*/React.createElement(DataTable, args, /*#__PURE__*/React.createElement(DataTableHead, null, /*#__PURE__*/React.createElement(DataTableRow, null, /*#__PURE__*/React.createElement(DataTableColumnHeader, {
|
|
330
326
|
fixed: true,
|
|
331
327
|
top: "0",
|
|
@@ -361,12 +357,10 @@ const FixedFirstColumnTemplate = args => /*#__PURE__*/React.createElement(DataTa
|
|
|
361
357
|
fixed: true,
|
|
362
358
|
left: "0"
|
|
363
359
|
}, "Obi"), /*#__PURE__*/React.createElement(DataTableCell, null, "Okafor"), /*#__PURE__*/React.createElement(DataTableCell, null, "06/07/1990"), /*#__PURE__*/React.createElement(DataTableCell, null, "01/03/2006"), /*#__PURE__*/React.createElement(DataTableCell, null, "28"), /*#__PURE__*/React.createElement(DataTableCell, null, "Dalakuru CHP"), /*#__PURE__*/React.createElement(DataTableCell, null, "Anatoliy Shcherbatykh"), /*#__PURE__*/React.createElement(DataTableCell, null, "Incomplete"))));
|
|
364
|
-
|
|
365
360
|
export const FixedFirstColumn = FixedFirstColumnTemplate.bind({});
|
|
366
361
|
FixedFirstColumn.args = {
|
|
367
362
|
scrollWidth: '500px'
|
|
368
363
|
};
|
|
369
|
-
|
|
370
364
|
const FixedHeaderAndTwoColumnsTemplate = args => /*#__PURE__*/React.createElement(DataTable, args, /*#__PURE__*/React.createElement(DataTableHead, null, /*#__PURE__*/React.createElement(DataTableRow, null, /*#__PURE__*/React.createElement(DataTableColumnHeader, {
|
|
371
365
|
fixed: true,
|
|
372
366
|
top: "0",
|
|
@@ -465,7 +459,6 @@ const FixedHeaderAndTwoColumnsTemplate = args => /*#__PURE__*/React.createElemen
|
|
|
465
459
|
fixed: true,
|
|
466
460
|
left: "120px"
|
|
467
461
|
}, "Okafor"), /*#__PURE__*/React.createElement(DataTableCell, null, "06/07/1990"), /*#__PURE__*/React.createElement(DataTableCell, null, "01/03/2006"), /*#__PURE__*/React.createElement(DataTableCell, null, "28"), /*#__PURE__*/React.createElement(DataTableCell, null, "Dalakuru CHP"), /*#__PURE__*/React.createElement(DataTableCell, null, "Anatoliy Shcherbatykh"), /*#__PURE__*/React.createElement(DataTableCell, null, "Incomplete"))));
|
|
468
|
-
|
|
469
462
|
export const FixedHeaderAndTwoColumns = FixedHeaderAndTwoColumnsTemplate.bind({});
|
|
470
463
|
FixedHeaderAndTwoColumns.args = {
|
|
471
464
|
layout: 'fixed',
|
|
@@ -473,7 +466,6 @@ FixedHeaderAndTwoColumns.args = {
|
|
|
473
466
|
scrollWidth: '500px',
|
|
474
467
|
scrollHeight: '400px'
|
|
475
468
|
};
|
|
476
|
-
|
|
477
469
|
const ScrollingDataTableWithToolbarsTemplate = args => /*#__PURE__*/React.createElement(Box, {
|
|
478
470
|
width: "500px"
|
|
479
471
|
}, /*#__PURE__*/React.createElement(DataTableToolbar, null, /*#__PURE__*/React.createElement("p", null, "Content")), /*#__PURE__*/React.createElement(DataTable, _extends({}, args, {
|
|
@@ -581,7 +573,6 @@ const ScrollingDataTableWithToolbarsTemplate = args => /*#__PURE__*/React.create
|
|
|
581
573
|
}, "Okafor"), /*#__PURE__*/React.createElement(DataTableCell, null, "06/07/1990"), /*#__PURE__*/React.createElement(DataTableCell, null, "01/03/2006"), /*#__PURE__*/React.createElement(DataTableCell, null, "28"), /*#__PURE__*/React.createElement(DataTableCell, null, "Dalakuru CHP"), /*#__PURE__*/React.createElement(DataTableCell, null, "Anatoliy Shcherbatykh"), /*#__PURE__*/React.createElement(DataTableCell, null, "Incomplete")))), /*#__PURE__*/React.createElement(DataTableToolbar, {
|
|
582
574
|
position: "bottom"
|
|
583
575
|
}, /*#__PURE__*/React.createElement("p", null, "Content (bottom)")));
|
|
584
|
-
|
|
585
576
|
export const ScrollingDataTableWithToolbars = ScrollingDataTableWithToolbarsTemplate.bind({});
|
|
586
577
|
ScrollingDataTableWithToolbars.args = {
|
|
587
578
|
layout: 'fixed',
|
|
@@ -589,7 +580,6 @@ ScrollingDataTableWithToolbars.args = {
|
|
|
589
580
|
scrollWidth: '500px',
|
|
590
581
|
scrollHeight: '400px'
|
|
591
582
|
};
|
|
592
|
-
|
|
593
583
|
const ColumnHeaderSortingTemplate = args => {
|
|
594
584
|
const rows = [{
|
|
595
585
|
firstName: 'Onyekachukwu',
|
|
@@ -608,9 +598,7 @@ const ColumnHeaderSortingTemplate = args => {
|
|
|
608
598
|
column: 'firstName',
|
|
609
599
|
direction: 'default'
|
|
610
600
|
});
|
|
611
|
-
|
|
612
601
|
const getSortDirection = columnName => columnName === column ? direction : 'default';
|
|
613
|
-
|
|
614
602
|
const onSortIconClick = _ref4 => {
|
|
615
603
|
let {
|
|
616
604
|
name,
|
|
@@ -621,7 +609,6 @@ const ColumnHeaderSortingTemplate = args => {
|
|
|
621
609
|
direction
|
|
622
610
|
});
|
|
623
611
|
};
|
|
624
|
-
|
|
625
612
|
return /*#__PURE__*/React.createElement(DataTable, args, /*#__PURE__*/React.createElement(DataTableHead, null, /*#__PURE__*/React.createElement(DataTableRow, null, /*#__PURE__*/React.createElement(DataTableColumnHeader, {
|
|
626
613
|
onSortIconClick: onSortIconClick,
|
|
627
614
|
sortDirection: getSortDirection('firstName'),
|
|
@@ -635,15 +622,12 @@ const ColumnHeaderSortingTemplate = args => {
|
|
|
635
622
|
}, "Last name"))), /*#__PURE__*/React.createElement(DataTableBody, null, rows.sort((a, b) => {
|
|
636
623
|
const strA = a[column];
|
|
637
624
|
const strB = b[column];
|
|
638
|
-
|
|
639
625
|
if (direction === 'asc' && strA < strB || direction === 'desc' && strA > strB) {
|
|
640
626
|
return -1;
|
|
641
627
|
}
|
|
642
|
-
|
|
643
628
|
if (direction === 'desc' && strA < strB || direction === 'asc' && strA > strB) {
|
|
644
629
|
return 1;
|
|
645
630
|
}
|
|
646
|
-
|
|
647
631
|
return 0;
|
|
648
632
|
}).map(_ref5 => {
|
|
649
633
|
let {
|
|
@@ -655,10 +639,8 @@ const ColumnHeaderSortingTemplate = args => {
|
|
|
655
639
|
}, /*#__PURE__*/React.createElement(DataTableCell, null, firstName), /*#__PURE__*/React.createElement(DataTableCell, null, lastName));
|
|
656
640
|
})));
|
|
657
641
|
};
|
|
658
|
-
|
|
659
642
|
export const ColumnHeaderSorting = ColumnHeaderSortingTemplate.bind({});
|
|
660
643
|
ColumnHeaderSorting.args = {};
|
|
661
|
-
|
|
662
644
|
const InlineFilteringTemplate = args => {
|
|
663
645
|
const rows = [{
|
|
664
646
|
firstName: 'Onyekachukwu',
|
|
@@ -677,7 +659,6 @@ const InlineFilteringTemplate = args => {
|
|
|
677
659
|
column: null,
|
|
678
660
|
value: ''
|
|
679
661
|
});
|
|
680
|
-
|
|
681
662
|
const onFilterIconClick = _ref6 => {
|
|
682
663
|
let {
|
|
683
664
|
name,
|
|
@@ -688,7 +669,6 @@ const InlineFilteringTemplate = args => {
|
|
|
688
669
|
value: ''
|
|
689
670
|
});
|
|
690
671
|
};
|
|
691
|
-
|
|
692
672
|
const onFilterInputChange = _ref7 => {
|
|
693
673
|
let {
|
|
694
674
|
value
|
|
@@ -698,7 +678,6 @@ const InlineFilteringTemplate = args => {
|
|
|
698
678
|
value
|
|
699
679
|
});
|
|
700
680
|
};
|
|
701
|
-
|
|
702
681
|
return /*#__PURE__*/React.createElement(DataTable, args, /*#__PURE__*/React.createElement(DataTableHead, null, /*#__PURE__*/React.createElement(DataTableRow, null, /*#__PURE__*/React.createElement(DataTableColumnHeader, {
|
|
703
682
|
onFilterIconClick: onFilterIconClick,
|
|
704
683
|
name: "firstName",
|
|
@@ -723,7 +702,6 @@ const InlineFilteringTemplate = args => {
|
|
|
723
702
|
if (!column || !value) {
|
|
724
703
|
return true;
|
|
725
704
|
}
|
|
726
|
-
|
|
727
705
|
return row[column].toUpperCase().includes(value.toUpperCase());
|
|
728
706
|
}).map(_ref8 => {
|
|
729
707
|
let {
|
|
@@ -735,12 +713,10 @@ const InlineFilteringTemplate = args => {
|
|
|
735
713
|
}, /*#__PURE__*/React.createElement(DataTableCell, null, firstName), /*#__PURE__*/React.createElement(DataTableCell, null, lastName));
|
|
736
714
|
})));
|
|
737
715
|
};
|
|
738
|
-
|
|
739
716
|
export const InlineFiltering = InlineFilteringTemplate.bind({});
|
|
740
717
|
InlineFiltering.args = {
|
|
741
718
|
layout: 'fixed'
|
|
742
719
|
};
|
|
743
|
-
|
|
744
720
|
const LongCellContentTemplate = _ref9 => {
|
|
745
721
|
let {
|
|
746
722
|
large
|
|
@@ -781,7 +757,6 @@ const LongCellContentTemplate = _ref9 => {
|
|
|
781
757
|
large: large
|
|
782
758
|
}, "Fourth - Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eligendi non quis exercitationem culpa nesciunt nihil aut nostrum explicabo reprehenderit optio amet ab temporibus asperiores quasi cupiditate. Voluptatum ducimus voluptates voluptas?"))));
|
|
783
759
|
};
|
|
784
|
-
|
|
785
760
|
export const LongCellContent = LongCellContentTemplate.bind({});
|
|
786
761
|
export const LongCellContentLargeCells = LongCellContentTemplate.bind({});
|
|
787
762
|
LongCellContentLargeCells.args = {
|
|
@@ -25,7 +25,7 @@ describe('<TableDataCell>', () => {
|
|
|
25
25
|
const wrapper = shallow( /*#__PURE__*/React.createElement(TableDataCell, {
|
|
26
26
|
align: align
|
|
27
27
|
}));
|
|
28
|
-
expect(wrapper.html()).toContain(
|
|
28
|
+
expect(wrapper.html()).toContain(`text-align: ${align};`);
|
|
29
29
|
});
|
|
30
30
|
it('accepts a bordered prop', () => {
|
|
31
31
|
const wrapper = shallow( /*#__PURE__*/React.createElement(TableDataCell, {
|
|
@@ -71,7 +71,7 @@ describe('<TableDataCell>', () => {
|
|
|
71
71
|
const wrapper = shallow( /*#__PURE__*/React.createElement(TableDataCell, {
|
|
72
72
|
left: left
|
|
73
73
|
}));
|
|
74
|
-
expect(wrapper.html()).toContain(
|
|
74
|
+
expect(wrapper.html()).toContain(`inset-inline-start: ${left};`);
|
|
75
75
|
});
|
|
76
76
|
it('accepts a muted prop', () => {
|
|
77
77
|
const wrapper = shallow( /*#__PURE__*/React.createElement(TableDataCell, {
|
|
@@ -117,7 +117,7 @@ describe('<TableDataCell>', () => {
|
|
|
117
117
|
const wrapper = shallow( /*#__PURE__*/React.createElement(TableDataCell, {
|
|
118
118
|
width: width
|
|
119
119
|
}));
|
|
120
|
-
expect(wrapper.html()).toContain(
|
|
120
|
+
expect(wrapper.html()).toContain(`width: ${width};`);
|
|
121
121
|
});
|
|
122
122
|
it('accepts an onClick prop', () => {
|
|
123
123
|
const onClick = jest.fn();
|
|
@@ -25,7 +25,7 @@ describe('<TableHeaderCell>', () => {
|
|
|
25
25
|
const wrapper = shallow( /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
26
26
|
align: align
|
|
27
27
|
}));
|
|
28
|
-
expect(wrapper.html()).toContain(
|
|
28
|
+
expect(wrapper.html()).toContain(`text-align: ${align};`);
|
|
29
29
|
});
|
|
30
30
|
it('accepts a bordered prop', () => {
|
|
31
31
|
const wrapper = shallow( /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
@@ -78,7 +78,7 @@ describe('<TableHeaderCell>', () => {
|
|
|
78
78
|
const wrapper = shallow( /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
79
79
|
left: left
|
|
80
80
|
}));
|
|
81
|
-
expect(wrapper.html()).toContain(
|
|
81
|
+
expect(wrapper.html()).toContain(`inset-inline-start: ${left};`);
|
|
82
82
|
});
|
|
83
83
|
it('accepts an muted prop', () => {
|
|
84
84
|
const wrapper = shallow( /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
@@ -112,7 +112,7 @@ describe('<TableHeaderCell>', () => {
|
|
|
112
112
|
const wrapper = shallow( /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
113
113
|
top: top
|
|
114
114
|
}));
|
|
115
|
-
expect(wrapper.html()).toContain(
|
|
115
|
+
expect(wrapper.html()).toContain(`top: ${top};`);
|
|
116
116
|
});
|
|
117
117
|
it('accepts a valid prop', () => {
|
|
118
118
|
const wrapper = shallow( /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
@@ -125,7 +125,7 @@ describe('<TableHeaderCell>', () => {
|
|
|
125
125
|
const wrapper = shallow( /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
126
126
|
width: width
|
|
127
127
|
}));
|
|
128
|
-
expect(wrapper.html()).toContain(
|
|
128
|
+
expect(wrapper.html()).toContain(`width: ${width};`);
|
|
129
129
|
});
|
|
130
130
|
it('accepts an onClick prop', () => {
|
|
131
131
|
const onClick = jest.fn();
|
|
@@ -39,7 +39,7 @@ describe('<Table>', () => {
|
|
|
39
39
|
const wrapper = shallow( /*#__PURE__*/React.createElement(Table, {
|
|
40
40
|
layout: layout
|
|
41
41
|
}));
|
|
42
|
-
expect(wrapper.html()).toContain(
|
|
42
|
+
expect(wrapper.html()).toContain(`table-layout: ${layout};`);
|
|
43
43
|
});
|
|
44
44
|
it('accepts a role prop', () => {
|
|
45
45
|
const role = 'test';
|
|
@@ -53,6 +53,6 @@ describe('<Table>', () => {
|
|
|
53
53
|
const wrapper = shallow( /*#__PURE__*/React.createElement(Table, {
|
|
54
54
|
width: width
|
|
55
55
|
}));
|
|
56
|
-
expect(wrapper.html()).toContain(
|
|
56
|
+
expect(wrapper.html()).toContain(`width: ${width};`);
|
|
57
57
|
});
|
|
58
58
|
});
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
|
-
|
|
3
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
-
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
5
3
|
import { colors } from '@dhis2/ui-constants';
|
|
6
4
|
import cx from 'classnames';
|
|
7
5
|
import PropTypes from 'prop-types';
|
|
@@ -25,7 +23,7 @@ export const TableBody = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
25
23
|
}), children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
26
24
|
id: "2478922139",
|
|
27
25
|
dynamic: [colors.blue600]
|
|
28
|
-
}, ["tbody.__jsx-style-dynamic-selector{position:relative;}", ".loading.__jsx-style-dynamic-selector:before{content:'';position:absolute;top:0;bottom:0;inset-inline-start:0;inset-inline-end:0;background-color:rgba(255,255,255,0.8);}",
|
|
26
|
+
}, ["tbody.__jsx-style-dynamic-selector{position:relative;}", ".loading.__jsx-style-dynamic-selector:before{content:'';position:absolute;top:0;bottom:0;inset-inline-start:0;inset-inline-end:0;background-color:rgba(255,255,255,0.8);}", `.loading.__jsx-style-dynamic-selector:after{content:'';position:absolute;top:calc(50% - 24px);inset-inline-start:calc(50% - 24px);width:48px;height:48px;border:6px solid rgba(110,122,138,0.15);border-bottom-color:${colors.blue600};border-radius:50%;-webkit-animation:rotation-__jsx-style-dynamic-selector 1s linear infinite;animation:rotation-__jsx-style-dynamic-selector 1s linear infinite;}`, "@-webkit-keyframes rotation-__jsx-style-dynamic-selector{0%{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);}100%{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}", "@keyframes rotation-__jsx-style-dynamic-selector{0%{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);}100%{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}"]));
|
|
29
27
|
});
|
|
30
28
|
TableBody.displayName = 'TableBody';
|
|
31
29
|
TableBody.defaultProps = {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
|
-
|
|
3
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
-
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
5
3
|
import { mutuallyExclusive, requiredIf } from '@dhis2/prop-types';
|
|
6
4
|
import { colors } from '@dhis2/ui-constants';
|
|
7
5
|
import cx from 'classnames';
|
|
@@ -15,7 +13,6 @@ const rtlCorrespondingAlignments = {
|
|
|
15
13
|
};
|
|
16
14
|
export const TableDataCell = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
17
15
|
var _rtlCorrespondingAlig;
|
|
18
|
-
|
|
19
16
|
let {
|
|
20
17
|
active,
|
|
21
18
|
align,
|
|
@@ -47,7 +44,7 @@ export const TableDataCell = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
47
44
|
"data-test": dataTest,
|
|
48
45
|
role: role,
|
|
49
46
|
scope: scope,
|
|
50
|
-
className:
|
|
47
|
+
className: `jsx-${styles.__hash}` + " " + _JSXStyle.dynamic([["836058623", [left, align, width, backgroundColor || colors.white, rtlAlign, backgroundColor || colors.teal100, backgroundColor || colors.grey100, backgroundColor || colors.grey200, backgroundColor || '#cdeae8']]]) + " " + (cx(className, {
|
|
51
48
|
active,
|
|
52
49
|
bordered,
|
|
53
50
|
error,
|
|
@@ -61,7 +58,7 @@ export const TableDataCell = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
61
58
|
}, styles), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
62
59
|
id: "836058623",
|
|
63
60
|
dynamic: [left, align, width, backgroundColor || colors.white, rtlAlign, backgroundColor || colors.teal100, backgroundColor || colors.grey100, backgroundColor || colors.grey200, backgroundColor || '#cdeae8']
|
|
64
|
-
}, [
|
|
61
|
+
}, [`td.__jsx-style-dynamic-selector{inset-inline-start:${left};text-align:${align};width:${width};background-color:${backgroundColor || colors.white};}`, `.__jsx-style-dynamic-selector:dir(rtl){text-align:${rtlAlign};}`, `tr.selected>td.__jsx-style-dynamic-selector{background-color:${backgroundColor || colors.teal100};}`, `tr:hover>td.__jsx-style-dynamic-selector:not(.staticStyle){background-color:${backgroundColor || colors.grey100};}`, `tr:active>td.__jsx-style-dynamic-selector:not(.staticStyle){background-color:${backgroundColor || colors.grey200};}`, `tr.selected:hover>td.__jsx-style-dynamic-selector:not(.staticStyle){background-color:${backgroundColor || '#cdeae8'};}`]));
|
|
65
62
|
});
|
|
66
63
|
TableDataCell.displayName = 'TableDataCell';
|
|
67
64
|
TableDataCell.defaultProps = {
|
|
@@ -75,7 +72,6 @@ TableDataCell.propTypes = {
|
|
|
75
72
|
/** To toggle border color, for example for editing */
|
|
76
73
|
active: PropTypes.bool,
|
|
77
74
|
align: PropTypes.oneOf(['left', 'center', 'right']),
|
|
78
|
-
|
|
79
75
|
/** Sets background color of the cell. Disables dynamic background colors from active, hover, and selected states */
|
|
80
76
|
backgroundColor: PropTypes.string,
|
|
81
77
|
bordered: PropTypes.bool,
|
|
@@ -83,23 +79,18 @@ TableDataCell.propTypes = {
|
|
|
83
79
|
className: PropTypes.string,
|
|
84
80
|
colSpan: PropTypes.string,
|
|
85
81
|
dataTest: PropTypes.string,
|
|
86
|
-
|
|
87
82
|
/** Mutually exclusive with muted and valid */
|
|
88
83
|
error: stylePropType,
|
|
89
84
|
large: PropTypes.bool,
|
|
90
|
-
|
|
91
85
|
/** Required when fixed */
|
|
92
86
|
left: requiredIf(props => props.fixed, PropTypes.string),
|
|
93
|
-
|
|
94
87
|
/** Mutually exclusive with error and valid */
|
|
95
88
|
muted: stylePropType,
|
|
96
89
|
role: PropTypes.string,
|
|
97
90
|
rowSpan: PropTypes.string,
|
|
98
91
|
scope: PropTypes.string,
|
|
99
|
-
|
|
100
92
|
/** Surpress hover and active event styles */
|
|
101
93
|
staticStyle: PropTypes.bool,
|
|
102
|
-
|
|
103
94
|
/** Mutually exclusive with error and muted */
|
|
104
95
|
valid: stylePropType,
|
|
105
96
|
width: PropTypes.string,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { colors } from '@dhis2/ui-constants';
|
|
2
|
-
const _defaultExport = [
|
|
2
|
+
const _defaultExport = [`td.jsx-533878895{padding:14px 12px;font-size:14px;border:1px solid transparant;border-bottom:1px solid ${colors.grey300};color:${colors.grey900};}`, `td.active.jsx-533878895{outline:2px solid ${colors.grey600};outline-offset:-2px;}`, `td.bordered.jsx-533878895{border-inline-end:1px solid ${colors.grey300};}`, "td.bordered.jsx-533878895:last-child{border-inline-end:1px solid transparent;}", `td.error.jsx-533878895{color:${colors.red700};}`, `td.muted.jsx-533878895{color:${colors.grey700};font-style:italic;}`, `td.valid.jsx-533878895{color:${colors.green700};}`, "td.large.jsx-533878895{padding:20px 12px;font-size:16px;}", "tr:last-child td.jsx-533878895{border-bottom:1px solid transparent;}", `tfoot tr:first-child td.jsx-533878895{border-top:1px solid ${colors.grey300};}`];
|
|
3
3
|
_defaultExport.__hash = "533878895";
|
|
4
4
|
export default _defaultExport;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
2
|
-
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
3
|
import React, { forwardRef } from 'react';
|
|
5
4
|
export const TableFoot = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
2
|
-
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
3
|
import React, { forwardRef } from 'react';
|
|
5
4
|
export const TableHead = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
|
-
|
|
3
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
-
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
5
3
|
import { mutuallyExclusive, requiredIf } from '@dhis2/prop-types';
|
|
6
4
|
import { colors } from '@dhis2/ui-constants';
|
|
7
5
|
import cx from 'classnames';
|
|
@@ -42,7 +40,7 @@ export const TableHeaderCell = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
42
40
|
"data-test": dataTest,
|
|
43
41
|
role: role,
|
|
44
42
|
scope: scope,
|
|
45
|
-
className:
|
|
43
|
+
className: `jsx-${styles.__hash}` + " " + _JSXStyle.dynamic([["2588011372", [left, top, align, width, backgroundColor || colors.grey200, backgroundColor || colors.grey300, backgroundColor || colors.grey300, backgroundColor || colors.grey200]]]) + " " + (cx(className, {
|
|
46
44
|
active,
|
|
47
45
|
bordered,
|
|
48
46
|
error,
|
|
@@ -58,7 +56,7 @@ export const TableHeaderCell = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
58
56
|
}, styles), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
59
57
|
id: "2588011372",
|
|
60
58
|
dynamic: [left, top, align, width, backgroundColor || colors.grey200, backgroundColor || colors.grey300, backgroundColor || colors.grey300, backgroundColor || colors.grey200]
|
|
61
|
-
}, [
|
|
59
|
+
}, [`th.__jsx-style-dynamic-selector{inset-inline-start:${left};top:${top};text-align:${align};width:${width};background-color:${backgroundColor || colors.grey200};}`, `thead th.fixedHorizontally.__jsx-style-dynamic-selector{background-color:${backgroundColor || colors.grey300};}`, `tbody>tr:hover>th.__jsx-style-dynamic-selector:not(.staticStyle),tfoot>tr:hover>th.__jsx-style-dynamic-selector:not(.staticStyle){background-color:${backgroundColor || colors.grey300};}`, `tbody>tr:active>th.__jsx-style-dynamic-selector:not(.staticStyle){background-color:${backgroundColor || colors.grey200};}`]));
|
|
62
60
|
});
|
|
63
61
|
TableHeaderCell.displayName = 'TableHeaderCell';
|
|
64
62
|
TableHeaderCell.defaultProps = {
|
|
@@ -73,7 +71,6 @@ TableHeaderCell.propTypes = {
|
|
|
73
71
|
/** To toggle border color, for example for editing */
|
|
74
72
|
active: PropTypes.bool,
|
|
75
73
|
align: PropTypes.oneOf(['left', 'center', 'right']),
|
|
76
|
-
|
|
77
74
|
/** Sets background color of the cell. Disables dynamic background colors from active, hover, and selected states */
|
|
78
75
|
backgroundColor: PropTypes.string,
|
|
79
76
|
bordered: PropTypes.bool,
|
|
@@ -81,27 +78,21 @@ TableHeaderCell.propTypes = {
|
|
|
81
78
|
className: PropTypes.string,
|
|
82
79
|
colSpan: PropTypes.string,
|
|
83
80
|
dataTest: PropTypes.string,
|
|
84
|
-
|
|
85
81
|
/** Mutually exclusive with muted and valid */
|
|
86
82
|
error: stylePropType,
|
|
87
83
|
fixed: PropTypes.bool,
|
|
88
84
|
large: PropTypes.bool,
|
|
89
|
-
|
|
90
85
|
/** Left or top required when fixed */
|
|
91
86
|
left: requiredIf(props => props.fixed && !props.top, PropTypes.string),
|
|
92
|
-
|
|
93
87
|
/** Mutually exclusive with error and valid */
|
|
94
88
|
muted: stylePropType,
|
|
95
89
|
role: PropTypes.string,
|
|
96
90
|
rowSpan: PropTypes.string,
|
|
97
91
|
scope: PropTypes.string,
|
|
98
|
-
|
|
99
92
|
/** Surpress hover and active event styles */
|
|
100
93
|
staticStyle: PropTypes.bool,
|
|
101
|
-
|
|
102
94
|
/** Left or top required when fixed */
|
|
103
95
|
top: requiredIf(props => props.fixed && !props.left, PropTypes.string),
|
|
104
|
-
|
|
105
96
|
/** Mutually exclusive with error and muted */
|
|
106
97
|
valid: stylePropType,
|
|
107
98
|
width: PropTypes.string,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { colors } from '@dhis2/ui-constants';
|
|
2
|
-
const _defaultExport = [
|
|
2
|
+
const _defaultExport = [`th.jsx-2895298632{padding:12px;border:1px solid transparant;border-bottom:1px solid ${colors.grey300};color:${colors.grey800};font-weight:normal;font-size:14px;vertical-align:top;}`, "thead th.jsx-2895298632{padding:8px 12px;font-size:13px;}", `th.jsx-2895298632:last-of-type{border-inline-end:1px solid ${colors.grey300};}`, `th.active.jsx-2895298632{outline:2px solid ${colors.grey600};outline-offset:-2px;}`, `th.bordered.jsx-2895298632{border-inline-end:1px solid ${colors.grey300};}`, "th.bordered.jsx-2895298632:last-child{border-inline-end:1px solid transparent;}", `th.error.jsx-2895298632{color:${colors.red700};}`, `th.muted.jsx-2895298632{color:${colors.grey700};font-style:italic;}`, `th.valid.jsx-2895298632{color:${colors.green700};}`, "th.large.jsx-2895298632{padding:14px 12px;font-size:16px;}", "thead th.large.jsx-2895298632{padding:13px 12px;font-size:15px;}", "th.fixed.jsx-2895298632{position:-webkit-sticky;position:sticky;z-index:1;}", "thead th.fixed.jsx-2895298632{position:-webkit-sticky;position:sticky;z-index:2;}", "thead th.fixedHorizontally.jsx-2895298632{z-index:3;}", "tr:last-child th.jsx-2895298632{border-bottom:1px solid transparent;}", `thead tr:last-child th.jsx-2895298632{border-bottom:1px solid ${colors.grey300};}`, `tfoot>tr:first-child th.jsx-2895298632{border-top:1px solid ${colors.grey300};}`];
|
|
3
3
|
_defaultExport.__hash = "2895298632";
|
|
4
4
|
export default _defaultExport;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
|
-
|
|
3
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
-
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
5
3
|
import { colors } from '@dhis2/ui-constants';
|
|
6
4
|
import PropTypes from 'prop-types';
|
|
7
5
|
import React, { forwardRef } from 'react';
|
|
@@ -23,7 +21,7 @@ export const TableHeaderCellAction = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
23
21
|
}), children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
24
22
|
id: "4225768774",
|
|
25
23
|
dynamic: [colors.grey400]
|
|
26
|
-
}, ["button.__jsx-style-dynamic-selector{border:none;padding:0;background:transparent;width:24px;height:24px;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;cursor:pointer;border-radius:4px;margin-inline-start:2px;}",
|
|
24
|
+
}, ["button.__jsx-style-dynamic-selector{border:none;padding:0;background:transparent;width:24px;height:24px;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;cursor:pointer;border-radius:4px;margin-inline-start:2px;}", `button.__jsx-style-dynamic-selector:hover,button.__jsx-style-dynamic-selector:focus-visible{background:${colors.grey400};}`, "button.__jsx-style-dynamic-selector:active,button.__jsx-style-dynamic-selector:focus{outline:none;}"]));
|
|
27
25
|
});
|
|
28
26
|
TableHeaderCellAction.displayName = 'TableHeaderCellAction';
|
|
29
27
|
TableHeaderCellAction.defaultProps = {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
|
-
|
|
3
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
-
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
5
3
|
import cx from 'classnames';
|
|
6
4
|
import PropTypes from 'prop-types';
|
|
7
5
|
import React, { forwardRef } from 'react';
|
|
@@ -36,11 +34,9 @@ TableRow.propTypes = {
|
|
|
36
34
|
children: PropTypes.node,
|
|
37
35
|
className: PropTypes.string,
|
|
38
36
|
dataTest: PropTypes.string,
|
|
39
|
-
|
|
40
37
|
/** Applies draggable cursor styles */
|
|
41
38
|
draggable: PropTypes.bool,
|
|
42
39
|
role: PropTypes.string,
|
|
43
|
-
|
|
44
40
|
/** Sets a selected (teal) background color */
|
|
45
41
|
selected: PropTypes.bool
|
|
46
42
|
};
|