@teselagen/ui 0.9.1 → 0.9.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/index.cjs.js +331 -320
- package/index.es.js +331 -320
- package/package.json +1 -3
- package/src/DataTable/index.js +12 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teselagen/ui",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -51,8 +51,6 @@
|
|
|
51
51
|
"url-join": "^4.0.1",
|
|
52
52
|
"use-deep-compare-effect": "^1.6.1",
|
|
53
53
|
"write-excel-file": "^1.4.25",
|
|
54
|
-
"cypress-real-events": "^1.13.0",
|
|
55
|
-
"chance": "^1.1.11",
|
|
56
54
|
"@dnd-kit/utilities": "3.2.2",
|
|
57
55
|
"@teselagen/file-utils": "0.3.20",
|
|
58
56
|
"@blueprintjs/icons": "3.33.0"
|
package/src/DataTable/index.js
CHANGED
|
@@ -27,7 +27,8 @@ import {
|
|
|
27
27
|
isFunction,
|
|
28
28
|
isEqual,
|
|
29
29
|
every,
|
|
30
|
-
some
|
|
30
|
+
some,
|
|
31
|
+
identity
|
|
31
32
|
} from "lodash-es";
|
|
32
33
|
import {
|
|
33
34
|
Button,
|
|
@@ -1241,16 +1242,16 @@ const DataTable = ({
|
|
|
1241
1242
|
|
|
1242
1243
|
//index 0 of the table is the column titles
|
|
1243
1244
|
//must add 1 to rowNum
|
|
1244
|
-
const rowNumbersToCopy =
|
|
1245
|
-
.map(rec => idToIndex[rec.id || rec.code] + 1)
|
|
1246
|
-
|
|
1245
|
+
const rowNumbersToCopy = Array.from(
|
|
1246
|
+
new Set(selectedRecords.map(rec => idToIndex[rec.id || rec.code] + 1))
|
|
1247
|
+
).sort();
|
|
1247
1248
|
|
|
1248
1249
|
if (!rowNumbersToCopy.length) return;
|
|
1249
1250
|
rowNumbersToCopy.unshift(0); //add in the header row
|
|
1250
1251
|
try {
|
|
1251
1252
|
const allRowEls = getAllRows(tableRef);
|
|
1252
1253
|
if (!allRowEls) return;
|
|
1253
|
-
const rowEls = rowNumbersToCopy.map(i => allRowEls[i]);
|
|
1254
|
+
const rowEls = rowNumbersToCopy.map(i => allRowEls[i]).filter(identity);
|
|
1254
1255
|
if (window.Cypress) window.Cypress.__copiedRowsLength = rowEls.length;
|
|
1255
1256
|
handleCopyRows(rowEls, {
|
|
1256
1257
|
onFinishMsg: "Selected rows copied"
|
|
@@ -2868,7 +2869,12 @@ const DataTable = ({
|
|
|
2868
2869
|
);
|
|
2869
2870
|
|
|
2870
2871
|
return (
|
|
2871
|
-
<div
|
|
2872
|
+
<div
|
|
2873
|
+
tabIndex="1"
|
|
2874
|
+
style={{ height: "100%" }}
|
|
2875
|
+
onKeyDown={handleKeyDown}
|
|
2876
|
+
onKeyUp={handleKeyUp}
|
|
2877
|
+
>
|
|
2872
2878
|
<div
|
|
2873
2879
|
className={classNames(
|
|
2874
2880
|
"data-table-container",
|