@bento-core/table 1.0.1-ccdihub.61 → 1.0.1-ccdihub.62

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.
@@ -18,10 +18,11 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
18
18
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19
19
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
20
20
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
21
- const downloadButtonStyle = {
22
- color: '#d1d2d3',
23
- marginTop: '7px'
24
- };
21
+ // const downloadButtonStyle = {
22
+ // color: '#d1d2d3',
23
+ // marginTop: '7px',
24
+ // };
25
+
25
26
  const DownloadButton = _ref => {
26
27
  let {
27
28
  count,
@@ -47,12 +48,10 @@ const DownloadButton = _ref => {
47
48
  if (table.paginationAPIField === 'filesInList') {
48
49
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
49
50
  }
50
- if (count === 0) {
51
- return /*#__PURE__*/_react.default.createElement(_icons.CloudDownload, {
52
- className: "disableButton",
53
- style: downloadButtonStyle
54
- });
55
- }
51
+ // if (count === 0) {
52
+ // return <CloudDownload className="disableButton" style={downloadButtonStyle} />;
53
+ // }
54
+
56
55
  const client = (0, _client.useApolloClient)();
57
56
  async function downloadSCSVFile() {
58
57
  const {
@@ -148,6 +147,10 @@ const DownloadButton = _ref => {
148
147
  arrowdownIcon: {
149
148
  marginLeft: '5px',
150
149
  fill: '#606060'
150
+ },
151
+ arrowdownIconDisabled: {
152
+ marginLeft: '5px',
153
+ fill: '#00000042'
151
154
  }
152
155
  });
153
156
  const classes = useStyles();
@@ -155,10 +158,14 @@ const DownloadButton = _ref => {
155
158
  className: classes.dropdown
156
159
  }, /*#__PURE__*/_react.default.createElement(_core.Tooltip, {
157
160
  title: "Download filtered results"
158
- }, /*#__PURE__*/_react.default.createElement(_core.IconButton, {
161
+ }, count !== 0 ? /*#__PURE__*/_react.default.createElement(_core.IconButton, {
159
162
  onClick: handleClickButton
160
163
  }, /*#__PURE__*/_react.default.createElement(_icons.CloudDownload, null), /*#__PURE__*/_react.default.createElement(_KeyboardArrowDownOutlined.default, {
161
164
  className: classes.arrowdownIcon
165
+ })) : /*#__PURE__*/_react.default.createElement(_core.IconButton, {
166
+ disabled: true
167
+ }, /*#__PURE__*/_react.default.createElement(_icons.CloudDownload, null), /*#__PURE__*/_react.default.createElement(_KeyboardArrowDownOutlined.default, {
168
+ className: classes.arrowdownIconDisabled
162
169
  }))), /*#__PURE__*/_react.default.createElement("div", {
163
170
  className: classes.dropdownList,
164
171
  style: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bento-core/table",
3
- "version": "1.0.1-ccdihub.61",
3
+ "version": "1.0.1-ccdihub.62",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "build": "npm run lint && cross-env-shell rm -rf dist && NODE_ENV=production BABEL_ENV=es babel src --out-dir dist --copy-files",
@@ -14,10 +14,10 @@ import KeyboardArrowDownOutlinedIcon from '@material-ui/icons/KeyboardArrowDownO
14
14
  import { CloudDownload } from '@material-ui/icons';
15
15
  import { downloadCSV, downloadJson } from '../util/downloadTable';
16
16
 
17
- const downloadButtonStyle = {
18
- color: '#d1d2d3',
19
- marginTop: '7px',
20
- };
17
+ // const downloadButtonStyle = {
18
+ // color: '#d1d2d3',
19
+ // marginTop: '7px',
20
+ // };
21
21
 
22
22
  const DownloadButton = ({
23
23
  count,
@@ -44,9 +44,9 @@ const DownloadButton = ({
44
44
  if (table.paginationAPIField === 'filesInList') {
45
45
  return <></>;
46
46
  }
47
- if (count === 0) {
48
- return <CloudDownload className="disableButton" style={downloadButtonStyle} />;
49
- }
47
+ // if (count === 0) {
48
+ // return <CloudDownload className="disableButton" style={downloadButtonStyle} />;
49
+ // }
50
50
 
51
51
  const client = useApolloClient();
52
52
 
@@ -156,6 +156,10 @@ const DownloadButton = ({
156
156
  marginLeft: '5px',
157
157
  fill: '#606060',
158
158
  },
159
+ arrowdownIconDisabled: {
160
+ marginLeft: '5px',
161
+ fill: '#00000042',
162
+ },
159
163
  });
160
164
 
161
165
  const classes = useStyles();
@@ -163,12 +167,21 @@ const DownloadButton = ({
163
167
  return (
164
168
  <div className={classes.dropdown}>
165
169
  <Tooltip title="Download filtered results">
166
- <IconButton
167
- onClick={handleClickButton}
168
- >
169
- <CloudDownload />
170
- <KeyboardArrowDownOutlinedIcon className={classes.arrowdownIcon} />
171
- </IconButton>
170
+ {
171
+ count !== 0
172
+ ? (
173
+ <IconButton onClick={handleClickButton}>
174
+ <CloudDownload />
175
+ <KeyboardArrowDownOutlinedIcon className={classes.arrowdownIcon} />
176
+ </IconButton>
177
+ )
178
+ : (
179
+ <IconButton disabled>
180
+ <CloudDownload />
181
+ <KeyboardArrowDownOutlinedIcon className={classes.arrowdownIconDisabled} />
182
+ </IconButton>
183
+ )
184
+ }
172
185
  </Tooltip>
173
186
  <div className={classes.dropdownList} style={{ display: listDisplay }}>
174
187
  <div id="dropdownListItemCSV" className={classes.dropdownListItem} onClick={downloadTableCSV}>CSV</div>