@bento-core/table 1.0.0-c3dc.0 → 1.0.0-c3dc.2
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
|
@@ -40,7 +40,8 @@ const ExtendedView = _ref => {
|
|
|
40
40
|
const {
|
|
41
41
|
download = false,
|
|
42
42
|
manageViewColumns = false,
|
|
43
|
-
pagination = false
|
|
43
|
+
pagination = false,
|
|
44
|
+
downloadButtonConfig
|
|
44
45
|
} = extendedViewConfig;
|
|
45
46
|
const themeConfig = (0, _core.createTheme)({
|
|
46
47
|
overrides: _objectSpread(_objectSpread({}, (0, _DefaultThemConfig.default)()), customTheme)
|
|
@@ -49,7 +50,12 @@ const ExtendedView = _ref => {
|
|
|
49
50
|
theme: themeConfig
|
|
50
51
|
}, numSelected === 0 && (download || manageViewColumns) && /*#__PURE__*/_react.default.createElement(_core.Toolbar, {
|
|
51
52
|
className: "downloadColumnView"
|
|
52
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
53
|
+
}, /*#__PURE__*/_react.default.createElement(_DownloadButtonView.default, {
|
|
54
|
+
count: table.totalRowCount || 0,
|
|
55
|
+
queryVariables: queryVariables,
|
|
56
|
+
table: table,
|
|
57
|
+
buttonConfig: downloadButtonConfig
|
|
58
|
+
}), /*#__PURE__*/_react.default.createElement(_ManageColumnView.default, {
|
|
53
59
|
table: table,
|
|
54
60
|
manageViewColumns: manageViewColumns,
|
|
55
61
|
onColumnViewChange: onColumnViewChange
|
|
@@ -67,10 +73,6 @@ const ExtendedView = _ref => {
|
|
|
67
73
|
onRowsPerPageChange: onRowsPerPageChange,
|
|
68
74
|
queryVariables: queryVariables,
|
|
69
75
|
table: table
|
|
70
|
-
}), /*#__PURE__*/_react.default.createElement(_DownloadButtonView.default, {
|
|
71
|
-
count: table.totalRowCount || 0,
|
|
72
|
-
queryVariables: queryVariables,
|
|
73
|
-
table: table
|
|
74
76
|
})));
|
|
75
77
|
};
|
|
76
78
|
var _default = ExtendedView;
|
|
@@ -20,11 +20,28 @@ const downloadButtonStyle = {
|
|
|
20
20
|
color: '#d1d2d3',
|
|
21
21
|
marginTop: '7px'
|
|
22
22
|
};
|
|
23
|
+
|
|
24
|
+
// Default style for Download Button with Text.
|
|
25
|
+
const DEFAULT_BUTTON_STYLE = {
|
|
26
|
+
width: '223px',
|
|
27
|
+
height: '41px',
|
|
28
|
+
borderRadius: '5px',
|
|
29
|
+
backgroundColor: '#2A6E93',
|
|
30
|
+
color: '#fff',
|
|
31
|
+
marginTop: '10px',
|
|
32
|
+
fontFamily: 'poppins',
|
|
33
|
+
'& #cloudIcon': {
|
|
34
|
+
margin: '10px',
|
|
35
|
+
marginTop: '6px'
|
|
36
|
+
}
|
|
37
|
+
};
|
|
23
38
|
const DownloadButton = _ref => {
|
|
24
39
|
let {
|
|
25
40
|
count,
|
|
26
41
|
queryVariables,
|
|
27
|
-
table
|
|
42
|
+
table,
|
|
43
|
+
buttonConfig = {},
|
|
44
|
+
isIcon = false
|
|
28
45
|
} = _ref;
|
|
29
46
|
if (table.paginationAPIField === 'filesInList') {
|
|
30
47
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
|
@@ -58,11 +75,24 @@ const DownloadButton = _ref => {
|
|
|
58
75
|
const downloadTableCSV = (0, _react.useCallback)(() => {
|
|
59
76
|
downloadSCSVFile();
|
|
60
77
|
}, [queryVariables]);
|
|
61
|
-
|
|
78
|
+
const {
|
|
79
|
+
buttonStyle,
|
|
80
|
+
title = 'DOWNLOAD CSV',
|
|
81
|
+
cloudIcon = false
|
|
82
|
+
} = buttonConfig;
|
|
83
|
+
return isIcon ? /*#__PURE__*/_react.default.createElement(_core.Tooltip, {
|
|
62
84
|
title: "Download filtered results as a CSV"
|
|
63
85
|
}, /*#__PURE__*/_react.default.createElement(_core.IconButton, {
|
|
64
86
|
onClick: downloadTableCSV
|
|
65
|
-
}, /*#__PURE__*/_react.default.createElement(_icons.CloudDownload, null)))
|
|
87
|
+
}, /*#__PURE__*/_react.default.createElement(_icons.CloudDownload, null))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_core.Button, {
|
|
88
|
+
onClick: downloadTableCSV,
|
|
89
|
+
style: buttonStyle || DEFAULT_BUTTON_STYLE,
|
|
90
|
+
disableRipple: true
|
|
91
|
+
}, title, ' ', cloudIcon ? /*#__PURE__*/_react.default.createElement(_icons.CloudDownload, {
|
|
92
|
+
style: {
|
|
93
|
+
margin: '6px 0px 10px 10px'
|
|
94
|
+
}
|
|
95
|
+
}) : ''));
|
|
66
96
|
};
|
|
67
97
|
var _default = DownloadButton;
|
|
68
98
|
exports.default = _default;
|
package/package.json
CHANGED