@bento-core/table 1.0.1-ccdihub.109 → 1.0.1-ccdihub.110
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.
|
@@ -261,25 +261,10 @@ const CPIModal = _ref => {
|
|
|
261
261
|
sortable: false
|
|
262
262
|
}];
|
|
263
263
|
const handleDownloadCSV = () => {
|
|
264
|
-
//
|
|
265
|
-
const csvColumnOrder =
|
|
266
|
-
dataField: 'repository_of_synonym_id',
|
|
267
|
-
header: 'repository_of_synonym_id'
|
|
268
|
-
}, {
|
|
269
|
-
dataField: 'associated_id',
|
|
270
|
-
header: 'associated_id'
|
|
271
|
-
}, {
|
|
272
|
-
dataField: 'domain_description',
|
|
273
|
-
header: 'domain_description'
|
|
274
|
-
}, {
|
|
275
|
-
dataField: 'domain_category',
|
|
276
|
-
header: 'domain_category'
|
|
277
|
-
}, {
|
|
278
|
-
dataField: 'data_location',
|
|
279
|
-
header: 'data_location'
|
|
280
|
-
}];
|
|
264
|
+
// Use the same column order and headers as the table display
|
|
265
|
+
const csvColumnOrder = displayColumns;
|
|
281
266
|
|
|
282
|
-
// Get the table data using
|
|
267
|
+
// Get the table data using the same column order as table
|
|
283
268
|
const csvData = data.map(dataRow => csvColumnOrder.map(column => {
|
|
284
269
|
const value = dataRow[column.dataField];
|
|
285
270
|
// Escape commas and quotes in CSV
|
|
@@ -289,7 +274,7 @@ const CPIModal = _ref => {
|
|
|
289
274
|
return value || '';
|
|
290
275
|
}));
|
|
291
276
|
|
|
292
|
-
// Create CSV headers using
|
|
277
|
+
// Create CSV headers using the same headers as table
|
|
293
278
|
const headers = csvColumnOrder.map(column => column.header).join(',');
|
|
294
279
|
|
|
295
280
|
// Create CSV content
|
|
@@ -308,21 +293,6 @@ const CPIModal = _ref => {
|
|
|
308
293
|
link.click();
|
|
309
294
|
document.body.removeChild(link);
|
|
310
295
|
};
|
|
311
|
-
|
|
312
|
-
// Close dropdown when clicking outside
|
|
313
|
-
(0, _react.useEffect)(() => {
|
|
314
|
-
const handleClickOutside = event => {
|
|
315
|
-
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
316
|
-
setDropdownOpen(false);
|
|
317
|
-
}
|
|
318
|
-
};
|
|
319
|
-
if (dropdownOpen) {
|
|
320
|
-
document.addEventListener('mousedown', handleClickOutside);
|
|
321
|
-
}
|
|
322
|
-
return () => {
|
|
323
|
-
document.removeEventListener('mousedown', handleClickOutside);
|
|
324
|
-
};
|
|
325
|
-
}, [dropdownOpen]);
|
|
326
296
|
const wrapperConfig = {
|
|
327
297
|
container: 'buttons',
|
|
328
298
|
size: 'xl',
|
|
@@ -678,7 +648,17 @@ const CPIModal = _ref => {
|
|
|
678
648
|
className: "".concat(classes.button, " ").concat(dropdownOpen ? classes.buttonOpen : ''),
|
|
679
649
|
onClick: handleDropdownToggle,
|
|
680
650
|
disableRipple: true
|
|
681
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, "ADD TO OR GO TO CART"), dropdownOpen ? /*#__PURE__*/_react.default.createElement(_ExpandLess.default, null) : /*#__PURE__*/_react.default.createElement(_ExpandMore.default, null)), dropdownOpen && /*#__PURE__*/_react.default.createElement("div", {
|
|
651
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, "ADD TO OR GO TO CART"), dropdownOpen ? /*#__PURE__*/_react.default.createElement(_ExpandLess.default, null) : /*#__PURE__*/_react.default.createElement(_ExpandMore.default, null)), dropdownOpen && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
652
|
+
style: {
|
|
653
|
+
position: 'fixed',
|
|
654
|
+
top: 0,
|
|
655
|
+
left: 0,
|
|
656
|
+
right: 0,
|
|
657
|
+
bottom: 0,
|
|
658
|
+
zIndex: 1
|
|
659
|
+
},
|
|
660
|
+
onClick: () => setDropdownOpen(false)
|
|
661
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
682
662
|
className: classes.dropdown
|
|
683
663
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
684
664
|
className: classes.dropdownList
|
|
@@ -698,11 +678,11 @@ const CPIModal = _ref => {
|
|
|
698
678
|
}, /*#__PURE__*/_react.default.createElement(_core.Button, {
|
|
699
679
|
style: goToCartButton,
|
|
700
680
|
onClick: () => {
|
|
701
|
-
window.location.href = '
|
|
681
|
+
window.location.href = '/fileCentricCart';
|
|
702
682
|
setDropdownOpen(false);
|
|
703
683
|
},
|
|
704
684
|
disableRipple: true
|
|
705
|
-
}, "GO TO CART")))))), /*#__PURE__*/_react.default.createElement("div", {
|
|
685
|
+
}, "GO TO CART"))))))), /*#__PURE__*/_react.default.createElement("div", {
|
|
706
686
|
className: "footer",
|
|
707
687
|
style: footer
|
|
708
688
|
}, /*#__PURE__*/_react.default.createElement("span", null, "For more information about CPI, click", ' ', /*#__PURE__*/_react.default.createElement("a", {
|
|
@@ -27,6 +27,9 @@ const SnackbarView = props => {
|
|
|
27
27
|
vertical: 'bottom',
|
|
28
28
|
horizontal: 'right'
|
|
29
29
|
},
|
|
30
|
+
style: {
|
|
31
|
+
bottom: '-45%'
|
|
32
|
+
},
|
|
30
33
|
message: /*#__PURE__*/_react.default.createElement("div", {
|
|
31
34
|
className: "snackBarMessage"
|
|
32
35
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bento-core/table",
|
|
3
|
-
"version": "1.0.1-ccdihub.
|
|
3
|
+
"version": "1.0.1-ccdihub.110",
|
|
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",
|
|
@@ -278,31 +278,10 @@ const CPIModal = ({
|
|
|
278
278
|
];
|
|
279
279
|
|
|
280
280
|
const handleDownloadCSV = () => {
|
|
281
|
-
//
|
|
282
|
-
const csvColumnOrder =
|
|
283
|
-
{
|
|
284
|
-
dataField: 'repository_of_synonym_id',
|
|
285
|
-
header: 'repository_of_synonym_id',
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
dataField: 'associated_id',
|
|
289
|
-
header: 'associated_id',
|
|
290
|
-
},
|
|
291
|
-
{
|
|
292
|
-
dataField: 'domain_description',
|
|
293
|
-
header: 'domain_description',
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
dataField: 'domain_category',
|
|
297
|
-
header: 'domain_category',
|
|
298
|
-
},
|
|
299
|
-
{
|
|
300
|
-
dataField: 'data_location',
|
|
301
|
-
header: 'data_location',
|
|
302
|
-
},
|
|
303
|
-
];
|
|
281
|
+
// Use the same column order and headers as the table display
|
|
282
|
+
const csvColumnOrder = displayColumns;
|
|
304
283
|
|
|
305
|
-
// Get the table data using
|
|
284
|
+
// Get the table data using the same column order as table
|
|
306
285
|
const csvData = data.map((dataRow) => csvColumnOrder.map((column) => {
|
|
307
286
|
const value = dataRow[column.dataField];
|
|
308
287
|
// Escape commas and quotes in CSV
|
|
@@ -312,7 +291,7 @@ const CPIModal = ({
|
|
|
312
291
|
return value || '';
|
|
313
292
|
}));
|
|
314
293
|
|
|
315
|
-
// Create CSV headers using
|
|
294
|
+
// Create CSV headers using the same headers as table
|
|
316
295
|
const headers = csvColumnOrder.map((column) => column.header).join(',');
|
|
317
296
|
|
|
318
297
|
// Create CSV content
|
|
@@ -333,23 +312,6 @@ const CPIModal = ({
|
|
|
333
312
|
document.body.removeChild(link);
|
|
334
313
|
};
|
|
335
314
|
|
|
336
|
-
// Close dropdown when clicking outside
|
|
337
|
-
useEffect(() => {
|
|
338
|
-
const handleClickOutside = (event) => {
|
|
339
|
-
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
340
|
-
setDropdownOpen(false);
|
|
341
|
-
}
|
|
342
|
-
};
|
|
343
|
-
|
|
344
|
-
if (dropdownOpen) {
|
|
345
|
-
document.addEventListener('mousedown', handleClickOutside);
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
return () => {
|
|
349
|
-
document.removeEventListener('mousedown', handleClickOutside);
|
|
350
|
-
};
|
|
351
|
-
}, [dropdownOpen]);
|
|
352
|
-
|
|
353
315
|
const wrapperConfig = {
|
|
354
316
|
container: 'buttons',
|
|
355
317
|
size: 'xl',
|
|
@@ -738,37 +700,50 @@ const CPIModal = ({
|
|
|
738
700
|
</Button>
|
|
739
701
|
|
|
740
702
|
{dropdownOpen && (
|
|
741
|
-
|
|
742
|
-
<div
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
703
|
+
<>
|
|
704
|
+
<div
|
|
705
|
+
style={{
|
|
706
|
+
position: 'fixed',
|
|
707
|
+
top: 0,
|
|
708
|
+
left: 0,
|
|
709
|
+
right: 0,
|
|
710
|
+
bottom: 0,
|
|
711
|
+
zIndex: 1,
|
|
712
|
+
}}
|
|
713
|
+
onClick={() => setDropdownOpen(false)}
|
|
714
|
+
/>
|
|
715
|
+
<div className={classes.dropdown}>
|
|
716
|
+
<div className={classes.dropdownList}>
|
|
717
|
+
<div className={classes.dropdownItem}>
|
|
718
|
+
<AddFileButtonView
|
|
719
|
+
{...wrapperConfig.items[0]}
|
|
720
|
+
buttonStyle={addAllFilesButton}
|
|
721
|
+
rowID={row.id}
|
|
722
|
+
/>
|
|
723
|
+
</div>
|
|
724
|
+
<div className={classes.dropdownItem}>
|
|
725
|
+
<AddFileButtonView
|
|
726
|
+
{...wrapperConfig.items[1]}
|
|
727
|
+
buttonStyle={addSelectedFilesButton}
|
|
728
|
+
rowID={row.id}
|
|
729
|
+
disabled={selectedIds.length === 0}
|
|
730
|
+
/>
|
|
731
|
+
</div>
|
|
732
|
+
<div className={classes.dropdownItem}>
|
|
733
|
+
<Button
|
|
734
|
+
style={goToCartButton}
|
|
735
|
+
onClick={() => {
|
|
736
|
+
window.location.href = '/fileCentricCart';
|
|
737
|
+
setDropdownOpen(false);
|
|
738
|
+
}}
|
|
739
|
+
disableRipple
|
|
740
|
+
>
|
|
741
|
+
GO TO CART
|
|
742
|
+
</Button>
|
|
743
|
+
</div>
|
|
769
744
|
</div>
|
|
770
745
|
</div>
|
|
771
|
-
|
|
746
|
+
</>
|
|
772
747
|
)}
|
|
773
748
|
</div>
|
|
774
749
|
</div>
|