@bento-core/table 1.0.1-icdc.1 → 1.0.1-icdc.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/dist/ExtendedView.js
CHANGED
|
@@ -28,11 +28,13 @@ const ExtendedView = _ref => {
|
|
|
28
28
|
server
|
|
29
29
|
} = _ref;
|
|
30
30
|
const {
|
|
31
|
-
extendedViewConfig
|
|
31
|
+
extendedViewConfig,
|
|
32
|
+
rowsPerPageOptions
|
|
32
33
|
} = table;
|
|
33
34
|
if (!extendedViewConfig) {
|
|
34
35
|
return null;
|
|
35
36
|
}
|
|
37
|
+
console.log('rowsPerPageOptions', rowsPerPageOptions);
|
|
36
38
|
const {
|
|
37
39
|
download = false,
|
|
38
40
|
manageViewColumns = false,
|
|
@@ -57,7 +59,7 @@ const ExtendedView = _ref => {
|
|
|
57
59
|
onColumnViewChange: onColumnViewChange
|
|
58
60
|
})), pagination && /*#__PURE__*/_react.default.createElement(_CustomPagination.default, {
|
|
59
61
|
customTheme: customTheme.tblTopPgn,
|
|
60
|
-
rowsPerPageOptions: [10, 25, 50, 100],
|
|
62
|
+
rowsPerPageOptions: rowsPerPageOptions || [10, 25, 50, 100],
|
|
61
63
|
component: "div",
|
|
62
64
|
count: table.totalRowCount || 0,
|
|
63
65
|
rowsPerPage: table.rowsPerPage || 10,
|
package/dist/TableView.js
CHANGED
|
@@ -68,7 +68,9 @@ const TableView = _ref => {
|
|
|
68
68
|
customTheme: themeConfig.toolbar
|
|
69
69
|
}), /*#__PURE__*/_react.default.createElement(CustomTableContainer, {
|
|
70
70
|
customTheme: themeConfig.tblContainer || {}
|
|
71
|
-
}, /*#__PURE__*/_react.default.createElement(_core.
|
|
71
|
+
}, /*#__PURE__*/_react.default.createElement(_core.TableContainer, {
|
|
72
|
+
component: _core.Paper
|
|
73
|
+
}, /*#__PURE__*/_react.default.createElement(_core.Table, table.tblAttr, /*#__PURE__*/_react.default.createElement(_CustomTblHeader.default, {
|
|
72
74
|
customTheme: themeConfig.tblHeader,
|
|
73
75
|
table: table,
|
|
74
76
|
rows: tableRows,
|
|
@@ -82,12 +84,12 @@ const TableView = _ref => {
|
|
|
82
84
|
table: table,
|
|
83
85
|
onRowSelectChange: onRowSelectChange,
|
|
84
86
|
onDeleteRow: onDeleteRow
|
|
85
|
-
}))), tableRows.length === 0 && /*#__PURE__*/_react.default.createElement(_DisplayErrMsg.default, {
|
|
87
|
+
})))), tableRows.length === 0 && /*#__PURE__*/_react.default.createElement(_DisplayErrMsg.default, {
|
|
86
88
|
customTheme: themeConfig.displayErr,
|
|
87
89
|
table: table
|
|
88
90
|
}), /*#__PURE__*/_react.default.createElement(_CustomPagination.default, {
|
|
89
91
|
customTheme: themeConfig.tblPgn,
|
|
90
|
-
rowsPerPageOptions: [10, 25, 50, 100],
|
|
92
|
+
rowsPerPageOptions: table.rowsPerPageOptions || [10, 25, 50, 100],
|
|
91
93
|
component: "div",
|
|
92
94
|
count: table.totalRowCount || 0,
|
|
93
95
|
rowsPerPage: table.rowsPerPage || 10,
|
|
@@ -53,11 +53,14 @@ const DownloadButton = _ref => {
|
|
|
53
53
|
(0, _downloadTable.downloadJson)(result, table, downloadFileName);
|
|
54
54
|
}
|
|
55
55
|
const downloadTableCSV = (0, _react.useCallback)(() => {
|
|
56
|
+
// custom download from bento app
|
|
56
57
|
if (downloadTable) {
|
|
57
|
-
downloadTable();
|
|
58
|
+
downloadTable(queryVariables);
|
|
58
59
|
} else if (!downloadTable && !server) {
|
|
60
|
+
// download client table
|
|
59
61
|
(0, _downloadTable.downloadJson)(rows, table, downloadFileName);
|
|
60
62
|
} else {
|
|
63
|
+
// donwload server table
|
|
61
64
|
downloadSCSVFile();
|
|
62
65
|
}
|
|
63
66
|
}, [queryVariables]);
|
package/package.json
CHANGED
package/src/ExtendedView.js
CHANGED
|
@@ -19,11 +19,11 @@ const ExtendedView = ({
|
|
|
19
19
|
queryVariables,
|
|
20
20
|
server,
|
|
21
21
|
}) => {
|
|
22
|
-
const { extendedViewConfig } = table;
|
|
22
|
+
const { extendedViewConfig, rowsPerPageOptions } = table;
|
|
23
23
|
if (!extendedViewConfig) {
|
|
24
24
|
return null;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
console.log('rowsPerPageOptions', rowsPerPageOptions);
|
|
27
27
|
const {
|
|
28
28
|
download = false,
|
|
29
29
|
manageViewColumns = false,
|
|
@@ -56,7 +56,7 @@ const ExtendedView = ({
|
|
|
56
56
|
(pagination) && (
|
|
57
57
|
<CustomPagination
|
|
58
58
|
customTheme={customTheme.tblTopPgn}
|
|
59
|
-
rowsPerPageOptions={[10, 25, 50, 100]}
|
|
59
|
+
rowsPerPageOptions={rowsPerPageOptions || [10, 25, 50, 100]}
|
|
60
60
|
component="div"
|
|
61
61
|
count={table.totalRowCount || 0}
|
|
62
62
|
rowsPerPage={table.rowsPerPage || 10}
|
package/src/TableView.js
CHANGED
|
@@ -63,24 +63,28 @@ const TableView = ({
|
|
|
63
63
|
<CustomTableContainer
|
|
64
64
|
customTheme={themeConfig.tblContainer || {}}
|
|
65
65
|
>
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
66
|
+
<TableContainer
|
|
67
|
+
component={Paper}
|
|
68
|
+
>
|
|
69
|
+
<Table {...table.tblAttr}>
|
|
70
|
+
<TableHeader
|
|
71
|
+
customTheme={themeConfig.tblHeader}
|
|
72
|
+
table={table}
|
|
73
|
+
rows={tableRows}
|
|
74
|
+
count={totalRowCount}
|
|
75
|
+
toggleSelectAll={onToggleSelectAll}
|
|
76
|
+
onDeleteAllFiles={onDeleteAllFiles}
|
|
77
|
+
sortByColumn={onSortByColumn}
|
|
78
|
+
/>
|
|
79
|
+
<CustomTableBody
|
|
80
|
+
customTheme={themeConfig.tblBody}
|
|
81
|
+
rows={tableRows}
|
|
82
|
+
table={table}
|
|
83
|
+
onRowSelectChange={onRowSelectChange}
|
|
84
|
+
onDeleteRow={onDeleteRow}
|
|
85
|
+
/>
|
|
86
|
+
</Table>
|
|
87
|
+
</TableContainer>
|
|
84
88
|
</CustomTableContainer>
|
|
85
89
|
{tableRows.length === 0 && (
|
|
86
90
|
<DisplayErrMsg
|
|
@@ -90,7 +94,7 @@ const TableView = ({
|
|
|
90
94
|
)}
|
|
91
95
|
<CustomPagination
|
|
92
96
|
customTheme={themeConfig.tblPgn}
|
|
93
|
-
rowsPerPageOptions={[10, 25, 50, 100]}
|
|
97
|
+
rowsPerPageOptions={table.rowsPerPageOptions || [10, 25, 50, 100]}
|
|
94
98
|
component="div"
|
|
95
99
|
count={table.totalRowCount || 0}
|
|
96
100
|
rowsPerPage={table.rowsPerPage || 10}
|
|
@@ -49,11 +49,14 @@ const DownloadButton = ({
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
const downloadTableCSV = useCallback(() => {
|
|
52
|
+
// custom download from bento app
|
|
52
53
|
if (downloadTable) {
|
|
53
|
-
downloadTable();
|
|
54
|
+
downloadTable(queryVariables);
|
|
54
55
|
} else if (!downloadTable && !server) {
|
|
56
|
+
// download client table
|
|
55
57
|
downloadJson(rows, table, downloadFileName);
|
|
56
58
|
} else {
|
|
59
|
+
// donwload server table
|
|
57
60
|
downloadSCSVFile();
|
|
58
61
|
}
|
|
59
62
|
}, [queryVariables]);
|