@bento-core/table 1.0.1-ccdihub.57 → 1.0.1-ccdihub.59

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.
@@ -33,7 +33,7 @@ const DownloadButton = _ref => {
33
33
  const useOutsideAlerter = ref => {
34
34
  (0, _react.useEffect)(() => {
35
35
  function handleClickOutside(event) {
36
- if (!event.target.getAttribute('class').includes('dropdownListItem')) {
36
+ if (!(event.target.getAttribute('id') && event.target.getAttribute('id').includes('dropdownListItem'))) {
37
37
  setListDisplay('none');
38
38
  }
39
39
  }
@@ -98,11 +98,9 @@ const DownloadButton = _ref => {
98
98
  }
99
99
  const downloadTableCSV = (0, _react.useCallback)(() => {
100
100
  downloadSCSVFile();
101
- setListDisplay('none');
102
101
  }, [queryVariables, table]);
103
102
  const downloadTableJson = (0, _react.useCallback)(() => {
104
103
  downloadJsonFile();
105
- setListDisplay('none');
106
104
  }, [queryVariables, table]);
107
105
  const handleClickButton = () => {
108
106
  if (listDisplay === 'none') {
@@ -165,9 +163,11 @@ const DownloadButton = _ref => {
165
163
  display: listDisplay
166
164
  }
167
165
  }, /*#__PURE__*/_react.default.createElement("div", {
166
+ id: "dropdownListItemCSV",
168
167
  className: classes.dropdownListItem,
169
168
  onClick: downloadTableCSV
170
169
  }, "CSV"), /*#__PURE__*/_react.default.createElement("div", {
170
+ id: "dropdownListItemJSON",
171
171
  className: classes.dropdownListItem,
172
172
  onClick: downloadTableJson
173
173
  }, "JSON")));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bento-core/table",
3
- "version": "1.0.1-ccdihub.57",
3
+ "version": "1.0.1-ccdihub.59",
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",
@@ -29,7 +29,7 @@ const DownloadButton = ({
29
29
  const useOutsideAlerter = (ref) => {
30
30
  useEffect(() => {
31
31
  function handleClickOutside(event) {
32
- if (!event.target.getAttribute('class').includes('dropdownListItem')) {
32
+ if (!(event.target.getAttribute('id') && event.target.getAttribute('id').includes('dropdownListItem'))) {
33
33
  setListDisplay('none');
34
34
  }
35
35
  }
@@ -102,12 +102,10 @@ const DownloadButton = ({
102
102
 
103
103
  const downloadTableCSV = useCallback(() => {
104
104
  downloadSCSVFile();
105
- setListDisplay('none');
106
105
  }, [queryVariables, table]);
107
106
 
108
107
  const downloadTableJson = useCallback(() => {
109
108
  downloadJsonFile();
110
- setListDisplay('none');
111
109
  }, [queryVariables, table]);
112
110
 
113
111
  const handleClickButton = () => {
@@ -171,8 +169,8 @@ const DownloadButton = ({
171
169
  </IconButton>
172
170
  </Tooltip>
173
171
  <div className={classes.dropdownList} style={{ display: listDisplay }}>
174
- <div className={classes.dropdownListItem} onClick={downloadTableCSV}>CSV</div>
175
- <div className={classes.dropdownListItem} onClick={downloadTableJson}>JSON</div>
172
+ <div id="dropdownListItemCSV" className={classes.dropdownListItem} onClick={downloadTableCSV}>CSV</div>
173
+ <div id="dropdownListItemJSON" className={classes.dropdownListItem} onClick={downloadTableJson}>JSON</div>
176
174
  </div>
177
175
  </div>
178
176
  );