@bento-core/paginated-table 1.0.1-icdc.16 → 1.0.1-icdc.18
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/Add_ALL_Files__BLUE_ButtonREADME.md +22 -8
- package/Add_Selected_Files_Orange_button_README.md +23 -7
- package/README.md +10 -4
- package/dist/table/ClientController.js +1 -18
- package/dist/wrapper/components/TooltipView.js +3 -2
- package/package.json +2 -4
- package/src/table/ClientController.js +0 -19
- package/src/wrapper/components/TooltipView.js +2 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
### 1 Use bento-core/paginated-table package version publish by ICDC
|
|
2
|
+
### 1 Use latest or bento-core/paginated-table package version publish by ICDC
|
|
3
3
|
Alternative configuratoin for BLUE button
|
|
4
4
|
```
|
|
5
5
|
// 1.0.1-icdc.3
|
|
@@ -12,7 +12,7 @@ or in package.json
|
|
|
12
12
|
```
|
|
13
13
|
**NOTE: Create a new dashboard page using bento-core components before removing old dashboard page**
|
|
14
14
|
<br>
|
|
15
|
-
<span style="color:
|
|
15
|
+
<span style="color:yellow">
|
|
16
16
|
Assuming New Dashboard page have Filter component and table component from bento-core
|
|
17
17
|
</span>.
|
|
18
18
|
|
|
@@ -22,7 +22,7 @@ Assuming New Dashboard page have Filter component and table component from bento
|
|
|
22
22
|
|
|
23
23
|
```
|
|
24
24
|
import React, { useCallback } from 'react';
|
|
25
|
-
import { ButtonView, btnTypes } from '@bento-core/paginated-table';
|
|
25
|
+
import { ButtonView, btnTypes, TableContextProvider } from '@bento-core/paginated-table';
|
|
26
26
|
|
|
27
27
|
const AddAllBlueButton = useCallback(() => (
|
|
28
28
|
<ButtonView
|
|
@@ -78,9 +78,23 @@ const AddAllBlueButton = useCallback(() => (
|
|
|
78
78
|
};
|
|
79
79
|
|
|
80
80
|
const btnTheme = createTheme({ overrides: { ...customTheme } });
|
|
81
|
-
<
|
|
82
|
-
<
|
|
83
|
-
<
|
|
84
|
-
|
|
85
|
-
|
|
81
|
+
<TableContextProvider>
|
|
82
|
+
<ThemeProvider theme={btnTheme}>
|
|
83
|
+
<Container>
|
|
84
|
+
// add all button
|
|
85
|
+
<AddAllBlueButton /> // from step 2
|
|
86
|
+
// add selected file orange button
|
|
87
|
+
<AddSelectedFilesOrangeButton />
|
|
88
|
+
</Container>
|
|
89
|
+
</ThemeProvider>
|
|
90
|
+
|
|
91
|
+
// table view
|
|
92
|
+
<Grid container>
|
|
93
|
+
<Grid item xs={12} id={config.tableID}>
|
|
94
|
+
<TableView
|
|
95
|
+
...
|
|
96
|
+
/>
|
|
97
|
+
</Grid>
|
|
98
|
+
</Grid>
|
|
99
|
+
</TableContextProvider>
|
|
86
100
|
```
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
### 1 Use bento-core/paginated-table package version publish by ICDC
|
|
2
|
+
### 1 Use latest or bento-core/paginated-table package version publish by ICDC
|
|
3
3
|
Alternative configuration for ORANGE button
|
|
4
4
|
```
|
|
5
5
|
// 1.0.1-icdc.3
|
|
@@ -11,7 +11,7 @@ or in package.json
|
|
|
11
11
|
}
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
<span style="color:
|
|
14
|
+
<span style="color:yellow">
|
|
15
15
|
Assuming table component is imported from bento-core/paginated-table
|
|
16
16
|
</span>
|
|
17
17
|
|
|
@@ -55,6 +55,7 @@ const AddSelectedFilesOrangeButton = useCallback(() => (
|
|
|
55
55
|
| applyActiveFilter | FALSE | Only adds files of selected case or sample based on active filter | Bool |
|
|
56
56
|
|
|
57
57
|
|
|
58
|
+
|
|
58
59
|
### 3 Configure Add_All_Button Or BLUE Button in Dashboard
|
|
59
60
|
|
|
60
61
|
```
|
|
@@ -73,9 +74,24 @@ const AddSelectedFilesOrangeButton = useCallback(() => (
|
|
|
73
74
|
};
|
|
74
75
|
|
|
75
76
|
const btnTheme = createTheme({ overrides: { ...customTheme } });
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
<TableContextProvider>
|
|
78
|
+
// add all button
|
|
79
|
+
<ThemeProvider theme={btnTheme}>
|
|
80
|
+
<Container>
|
|
81
|
+
// add all button
|
|
82
|
+
<AddAllBlueButton />
|
|
83
|
+
// add selected file orange button
|
|
84
|
+
<AddSelectedFilesOrangeButton /> // step 2
|
|
85
|
+
</Container>
|
|
86
|
+
</ThemeProvider>
|
|
87
|
+
|
|
88
|
+
// table view
|
|
89
|
+
<Grid container>
|
|
90
|
+
<Grid item xs={12} id={config.tableID}>
|
|
91
|
+
<TableView
|
|
92
|
+
...
|
|
93
|
+
/>
|
|
94
|
+
</Grid>
|
|
95
|
+
</Grid>
|
|
96
|
+
</TableContextProvider>
|
|
81
97
|
```
|
package/README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# PAGINATED TABLE COMPONENT DESIGN
|
|
2
2
|
|
|
3
|
+
```diff
|
|
4
|
+
- After updating to latest version remove transform: 'rotateX(180deg)) in red
|
|
5
|
+
```
|
|
3
6
|
### Bento core paginated table design:
|
|
4
7
|
|
|
5
8
|
* Use of UseReducer to track table state and local state to display dialog component
|
|
@@ -228,6 +231,9 @@ TableContextProvider provides table state to Wrapper Component or it can be used
|
|
|
228
231
|
####
|
|
229
232
|
|
|
230
233
|
## 4 Wrapper Configuration:
|
|
234
|
+
|
|
235
|
+
**NOTE: Alternative option to configure Blue and Orange button refer to [ADD_ALL_FILES_BLUE_BUTTON_ReadME](Add_ALL_Files__BLUE_ButtonREADME.md) and [ADD_SELECTED_FILES_Orange_button_ReadMe](Add_Selected_Files_Orange_button_README.md). (Note: No Wrapper conponent required)**
|
|
236
|
+
|
|
231
237
|
Wrapper component around table compnent.
|
|
232
238
|
1. ADD ALL FILES button
|
|
233
239
|
2. ADD SELECTED ROWS button
|
|
@@ -319,8 +325,8 @@ headerConfig - upper component on the table
|
|
|
319
325
|
|
|
320
326
|
####
|
|
321
327
|
|
|
322
|
-
## 5 Pagination
|
|
323
|
-
|
|
328
|
+
## 5 Customize Pagination Action:
|
|
329
|
+
Customize paginated action is provided to add event in addition to update of the table state. It will override default paginated action.
|
|
324
330
|
```
|
|
325
331
|
import {
|
|
326
332
|
TableContext,
|
|
@@ -339,7 +345,7 @@ import {
|
|
|
339
345
|
const { context } = tableContext;
|
|
340
346
|
const { dispatch } = context;
|
|
341
347
|
|
|
342
|
-
const
|
|
348
|
+
const customPaginationOptions = {
|
|
343
349
|
customizeOnRowSelect: (event, row) => {
|
|
344
350
|
const payload = {
|
|
345
351
|
page: 2,
|
|
@@ -362,7 +368,7 @@ import {
|
|
|
362
368
|
queryVariables={activeFilters}
|
|
363
369
|
totalRowCount={dashboardStats[config.count]}
|
|
364
370
|
activeTab={activeTab}
|
|
365
|
-
paginationOptions={
|
|
371
|
+
paginationOptions={customPaginationOptions}
|
|
366
372
|
/>
|
|
367
373
|
```
|
|
368
374
|
|
|
@@ -44,28 +44,11 @@ const TableController = props => {
|
|
|
44
44
|
sensitivity: 'base'
|
|
45
45
|
});
|
|
46
46
|
|
|
47
|
-
/**
|
|
48
|
-
* client table array sorting for column table
|
|
49
|
-
* checks array length to sort
|
|
50
|
-
*/
|
|
51
|
-
const arraySort = (a, b) => {
|
|
52
|
-
// handles sort for csvDownload column
|
|
53
|
-
const aHasData = a.csvDataRow && a.csvDataRow.length > 0;
|
|
54
|
-
const bHasData = b.csvDataRow && b.csvDataRow.length > 0;
|
|
55
|
-
return aHasData === bHasData ? 0 : aHasData ? -1 : 1;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
47
|
/**
|
|
59
48
|
* sort base on table state
|
|
60
49
|
*/
|
|
61
50
|
const sortRows = (a, b) => {
|
|
62
|
-
|
|
63
|
-
if (areValuesArrays) {
|
|
64
|
-
if (sortOrder === 'asc') {
|
|
65
|
-
return arraySort(a, b);
|
|
66
|
-
}
|
|
67
|
-
return arraySort(b, a);
|
|
68
|
-
}
|
|
51
|
+
console.log("sort column ".concat(sortBy));
|
|
69
52
|
if (sortOrder === 'asc') {
|
|
70
53
|
return alphaNumericSort(a, b);
|
|
71
54
|
}
|
|
@@ -21,10 +21,11 @@ const ToolTipView = props => {
|
|
|
21
21
|
icon,
|
|
22
22
|
alt,
|
|
23
23
|
arrow = false,
|
|
24
|
-
clsName
|
|
24
|
+
clsName,
|
|
25
|
+
toolTipText
|
|
25
26
|
} = tooltipCofig;
|
|
26
27
|
return /*#__PURE__*/_react.default.createElement(_toolTip.default, {
|
|
27
|
-
title: tooltipCofig[section],
|
|
28
|
+
title: toolTipText || tooltipCofig[section],
|
|
28
29
|
arrow: arrow,
|
|
29
30
|
classes: {
|
|
30
31
|
tooltip: classes.customTooltip,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bento-core/paginated-table",
|
|
3
|
-
"version": "1.0.1-icdc.
|
|
3
|
+
"version": "1.0.1-icdc.18",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -12,8 +12,6 @@
|
|
|
12
12
|
"publishConfig": {
|
|
13
13
|
"access": "public"
|
|
14
14
|
},
|
|
15
|
-
"dependencies": {
|
|
16
|
-
},
|
|
17
15
|
"peerDependencies": {
|
|
18
16
|
"@apollo/client": "^3.6.9",
|
|
19
17
|
"@material-ui/core": "^4.12.4",
|
|
@@ -22,7 +20,7 @@
|
|
|
22
20
|
"react-dom": "^17.0.0",
|
|
23
21
|
"react-redux": "^7.2.1",
|
|
24
22
|
"@bento-core/cart": "^1.0.0",
|
|
25
|
-
"@bento-core/table": "
|
|
23
|
+
"@bento-core/table": "1.0.1-icdc.0",
|
|
26
24
|
"@bento-core/tool-tip": "^1.0.0",
|
|
27
25
|
"@bento-core/util": "^1.0.0"
|
|
28
26
|
},
|
|
@@ -38,29 +38,10 @@ const TableController = ((props) => {
|
|
|
38
38
|
},
|
|
39
39
|
);
|
|
40
40
|
|
|
41
|
-
/**
|
|
42
|
-
* client table array sorting for column table
|
|
43
|
-
* checks array length to sort
|
|
44
|
-
*/
|
|
45
|
-
const arraySort = (a, b) => {
|
|
46
|
-
// handles sort for csvDownload column
|
|
47
|
-
const aHasData = a.csvDataRow && a.csvDataRow.length > 0;
|
|
48
|
-
const bHasData = b.csvDataRow && b.csvDataRow.length > 0;
|
|
49
|
-
return aHasData === bHasData ? 0 : aHasData ? -1 : 1;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
41
|
/**
|
|
53
42
|
* sort base on table state
|
|
54
43
|
*/
|
|
55
44
|
const sortRows = (a, b) => {
|
|
56
|
-
const areValuesArrays = Array.isArray(a[sortBy]) && Array.isArray(b[sortBy]);
|
|
57
|
-
if (areValuesArrays) {
|
|
58
|
-
if (sortOrder === 'asc') {
|
|
59
|
-
return arraySort(a, b);
|
|
60
|
-
}
|
|
61
|
-
return arraySort(b, a);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
45
|
if (sortOrder === 'asc') {
|
|
65
46
|
return alphaNumericSort(a, b);
|
|
66
47
|
}
|
|
@@ -17,10 +17,11 @@ const ToolTipView = (props) => {
|
|
|
17
17
|
alt,
|
|
18
18
|
arrow = false,
|
|
19
19
|
clsName,
|
|
20
|
+
toolTipText,
|
|
20
21
|
} = tooltipCofig;
|
|
21
22
|
return (
|
|
22
23
|
<ToolTip
|
|
23
|
-
title={tooltipCofig[section]}
|
|
24
|
+
title={toolTipText || tooltipCofig[section]}
|
|
24
25
|
arrow={arrow}
|
|
25
26
|
classes={{
|
|
26
27
|
tooltip: classes.customTooltip,
|