@teselagen/ui 0.3.25 → 0.3.27
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 +26 -24
- package/index.es.js +26 -24
- package/package.json +1 -1
- package/src/DataTable/index.js +15 -4
- package/src/FormComponents/Uploader.js +19 -7
package/index.cjs.js
CHANGED
|
@@ -18183,25 +18183,16 @@ var toString$6 = {}.toString;
|
|
|
18183
18183
|
var _cof = /* @__PURE__ */ __name(function(it) {
|
|
18184
18184
|
return toString$6.call(it).slice(8, -1);
|
|
18185
18185
|
}, "_cof");
|
|
18186
|
-
var
|
|
18187
|
-
var
|
|
18188
|
-
|
|
18189
|
-
|
|
18190
|
-
return _iobject;
|
|
18191
|
-
hasRequired_iobject = 1;
|
|
18192
|
-
var cof2 = _cof;
|
|
18193
|
-
_iobject = Object("z").propertyIsEnumerable(0) ? Object : function(it) {
|
|
18194
|
-
return cof2(it) == "String" ? it.split("") : Object(it);
|
|
18195
|
-
};
|
|
18196
|
-
return _iobject;
|
|
18197
|
-
}
|
|
18198
|
-
__name(require_iobject, "require_iobject");
|
|
18186
|
+
var cof$2 = _cof;
|
|
18187
|
+
var _iobject = Object("z").propertyIsEnumerable(0) ? Object : function(it) {
|
|
18188
|
+
return cof$2(it) == "String" ? it.split("") : Object(it);
|
|
18189
|
+
};
|
|
18199
18190
|
var _defined = /* @__PURE__ */ __name(function(it) {
|
|
18200
18191
|
if (it == void 0)
|
|
18201
18192
|
throw TypeError("Can't call method on " + it);
|
|
18202
18193
|
return it;
|
|
18203
18194
|
}, "_defined");
|
|
18204
|
-
var IObject =
|
|
18195
|
+
var IObject = _iobject;
|
|
18205
18196
|
var defined$2 = _defined;
|
|
18206
18197
|
var _toIobject = /* @__PURE__ */ __name(function(it) {
|
|
18207
18198
|
return IObject(defined$2(it));
|
|
@@ -18322,7 +18313,7 @@ function require_objectAssign() {
|
|
|
18322
18313
|
var gOPS2 = _objectGops;
|
|
18323
18314
|
var pIE2 = require_objectPie();
|
|
18324
18315
|
var toObject2 = _toObject;
|
|
18325
|
-
var IObject2 =
|
|
18316
|
+
var IObject2 = _iobject;
|
|
18326
18317
|
var $assign = Object.assign;
|
|
18327
18318
|
_objectAssign = !$assign || _fails(function() {
|
|
18328
18319
|
var A2 = {};
|
|
@@ -58688,12 +58679,13 @@ const _DataTable = class _DataTable extends React$1.Component {
|
|
|
58688
58679
|
tabIndex: -1,
|
|
58689
58680
|
onKeyDown: (e2) => {
|
|
58690
58681
|
var _a2, _b, _c, _d, _e, _f;
|
|
58691
|
-
const
|
|
58692
|
-
|
|
58682
|
+
const isTabKey = e2.keyCode === 9;
|
|
58683
|
+
const isArrowKey = e2.keyCode >= 37 && e2.keyCode <= 40;
|
|
58684
|
+
if (isArrowKey && ((_a2 = e2.target) == null ? void 0 : _a2.tagName) !== "INPUT" || isTabKey) {
|
|
58693
58685
|
const { schema: schema2, entities: entities2 } = computePresets(this.props);
|
|
58694
58686
|
const left2 = e2.keyCode === 37;
|
|
58695
58687
|
const up = e2.keyCode === 38;
|
|
58696
|
-
const down = e2.keyCode === 40;
|
|
58688
|
+
const down = e2.keyCode === 40 || e2.keyCode === 13;
|
|
58697
58689
|
let cellIdToUse = this.getPrimarySelectedCellId();
|
|
58698
58690
|
const pathToIndex = getFieldPathToIndex(schema2);
|
|
58699
58691
|
const entityMap = getEntityIdToEntity(entities2);
|
|
@@ -71832,9 +71824,7 @@ function UploaderInner({
|
|
|
71832
71824
|
if (!acceptedFiles.length)
|
|
71833
71825
|
return;
|
|
71834
71826
|
setLoading(true);
|
|
71835
|
-
|
|
71836
|
-
acceptedFiles = acceptedFiles.slice(0, fileLimit);
|
|
71837
|
-
}
|
|
71827
|
+
acceptedFiles = trimFiles(acceptedFiles, fileLimit);
|
|
71838
71828
|
acceptedFiles.forEach((file) => {
|
|
71839
71829
|
file.preview = URL.createObjectURL(file);
|
|
71840
71830
|
file.loading = true;
|
|
@@ -72020,9 +72010,9 @@ function UploaderInner({
|
|
|
72020
72010
|
`It looks like there wasn't any data in your file. Please add some data and try again`
|
|
72021
72011
|
);
|
|
72022
72012
|
}
|
|
72023
|
-
const cleanedFileList =
|
|
72024
|
-
|
|
72025
|
-
fileLimit
|
|
72013
|
+
const cleanedFileList = trimFiles(
|
|
72014
|
+
[...toKeep, ...fileListToUse],
|
|
72015
|
+
fileLimit
|
|
72026
72016
|
);
|
|
72027
72017
|
handleSecondHalfOfUpload({ acceptedFiles, cleanedFileList });
|
|
72028
72018
|
})
|
|
@@ -72270,6 +72260,18 @@ function stripId(ents = []) {
|
|
|
72270
72260
|
__name(stripId, "stripId");
|
|
72271
72261
|
const manualEnterMessage = "Build CSV File";
|
|
72272
72262
|
const manualEnterSubMessage = "Paste or type data to build a CSV file";
|
|
72263
|
+
function trimFiles(incomingFiles, fileLimit) {
|
|
72264
|
+
if (fileLimit) {
|
|
72265
|
+
if (fileLimit && incomingFiles.length > fileLimit) {
|
|
72266
|
+
window.toastr && window.toastr.warning(
|
|
72267
|
+
`Detected additional files in your upload that we are ignoring. You can only upload ${fileLimit} file${fileLimit > 1 ? "s" : ""} at a time.`
|
|
72268
|
+
);
|
|
72269
|
+
}
|
|
72270
|
+
return incomingFiles.slice(0, fileLimit);
|
|
72271
|
+
}
|
|
72272
|
+
return incomingFiles;
|
|
72273
|
+
}
|
|
72274
|
+
__name(trimFiles, "trimFiles");
|
|
72273
72275
|
const style$7 = "";
|
|
72274
72276
|
function DNALoader({ style: style2, className }) {
|
|
72275
72277
|
return /* @__PURE__ */ React$1.createElement("div", { className: classNames("dna-loader", className), style: style2 }, /* @__PURE__ */ React$1.createElement("div", { className: "nucleobase" }), /* @__PURE__ */ React$1.createElement("div", { className: "nucleobase" }), /* @__PURE__ */ React$1.createElement("div", { className: "nucleobase" }), /* @__PURE__ */ React$1.createElement("div", { className: "nucleobase" }), /* @__PURE__ */ React$1.createElement("div", { className: "nucleobase" }), /* @__PURE__ */ React$1.createElement("div", { className: "nucleobase" }), /* @__PURE__ */ React$1.createElement("div", { className: "nucleobase" }), /* @__PURE__ */ React$1.createElement("div", { className: "nucleobase" }), /* @__PURE__ */ React$1.createElement("div", { className: "nucleobase" }), /* @__PURE__ */ React$1.createElement("div", { className: "nucleobase" }));
|
package/index.es.js
CHANGED
|
@@ -18165,25 +18165,16 @@ var toString$6 = {}.toString;
|
|
|
18165
18165
|
var _cof = /* @__PURE__ */ __name(function(it) {
|
|
18166
18166
|
return toString$6.call(it).slice(8, -1);
|
|
18167
18167
|
}, "_cof");
|
|
18168
|
-
var
|
|
18169
|
-
var
|
|
18170
|
-
|
|
18171
|
-
|
|
18172
|
-
return _iobject;
|
|
18173
|
-
hasRequired_iobject = 1;
|
|
18174
|
-
var cof2 = _cof;
|
|
18175
|
-
_iobject = Object("z").propertyIsEnumerable(0) ? Object : function(it) {
|
|
18176
|
-
return cof2(it) == "String" ? it.split("") : Object(it);
|
|
18177
|
-
};
|
|
18178
|
-
return _iobject;
|
|
18179
|
-
}
|
|
18180
|
-
__name(require_iobject, "require_iobject");
|
|
18168
|
+
var cof$2 = _cof;
|
|
18169
|
+
var _iobject = Object("z").propertyIsEnumerable(0) ? Object : function(it) {
|
|
18170
|
+
return cof$2(it) == "String" ? it.split("") : Object(it);
|
|
18171
|
+
};
|
|
18181
18172
|
var _defined = /* @__PURE__ */ __name(function(it) {
|
|
18182
18173
|
if (it == void 0)
|
|
18183
18174
|
throw TypeError("Can't call method on " + it);
|
|
18184
18175
|
return it;
|
|
18185
18176
|
}, "_defined");
|
|
18186
|
-
var IObject =
|
|
18177
|
+
var IObject = _iobject;
|
|
18187
18178
|
var defined$2 = _defined;
|
|
18188
18179
|
var _toIobject = /* @__PURE__ */ __name(function(it) {
|
|
18189
18180
|
return IObject(defined$2(it));
|
|
@@ -18304,7 +18295,7 @@ function require_objectAssign() {
|
|
|
18304
18295
|
var gOPS2 = _objectGops;
|
|
18305
18296
|
var pIE2 = require_objectPie();
|
|
18306
18297
|
var toObject2 = _toObject;
|
|
18307
|
-
var IObject2 =
|
|
18298
|
+
var IObject2 = _iobject;
|
|
18308
18299
|
var $assign = Object.assign;
|
|
18309
18300
|
_objectAssign = !$assign || _fails(function() {
|
|
18310
18301
|
var A2 = {};
|
|
@@ -58670,12 +58661,13 @@ const _DataTable = class _DataTable extends React__default.Component {
|
|
|
58670
58661
|
tabIndex: -1,
|
|
58671
58662
|
onKeyDown: (e2) => {
|
|
58672
58663
|
var _a2, _b, _c, _d, _e, _f;
|
|
58673
|
-
const
|
|
58674
|
-
|
|
58664
|
+
const isTabKey = e2.keyCode === 9;
|
|
58665
|
+
const isArrowKey = e2.keyCode >= 37 && e2.keyCode <= 40;
|
|
58666
|
+
if (isArrowKey && ((_a2 = e2.target) == null ? void 0 : _a2.tagName) !== "INPUT" || isTabKey) {
|
|
58675
58667
|
const { schema: schema2, entities: entities2 } = computePresets(this.props);
|
|
58676
58668
|
const left2 = e2.keyCode === 37;
|
|
58677
58669
|
const up = e2.keyCode === 38;
|
|
58678
|
-
const down = e2.keyCode === 40;
|
|
58670
|
+
const down = e2.keyCode === 40 || e2.keyCode === 13;
|
|
58679
58671
|
let cellIdToUse = this.getPrimarySelectedCellId();
|
|
58680
58672
|
const pathToIndex = getFieldPathToIndex(schema2);
|
|
58681
58673
|
const entityMap = getEntityIdToEntity(entities2);
|
|
@@ -71814,9 +71806,7 @@ function UploaderInner({
|
|
|
71814
71806
|
if (!acceptedFiles.length)
|
|
71815
71807
|
return;
|
|
71816
71808
|
setLoading(true);
|
|
71817
|
-
|
|
71818
|
-
acceptedFiles = acceptedFiles.slice(0, fileLimit);
|
|
71819
|
-
}
|
|
71809
|
+
acceptedFiles = trimFiles(acceptedFiles, fileLimit);
|
|
71820
71810
|
acceptedFiles.forEach((file) => {
|
|
71821
71811
|
file.preview = URL.createObjectURL(file);
|
|
71822
71812
|
file.loading = true;
|
|
@@ -72002,9 +71992,9 @@ function UploaderInner({
|
|
|
72002
71992
|
`It looks like there wasn't any data in your file. Please add some data and try again`
|
|
72003
71993
|
);
|
|
72004
71994
|
}
|
|
72005
|
-
const cleanedFileList =
|
|
72006
|
-
|
|
72007
|
-
fileLimit
|
|
71995
|
+
const cleanedFileList = trimFiles(
|
|
71996
|
+
[...toKeep, ...fileListToUse],
|
|
71997
|
+
fileLimit
|
|
72008
71998
|
);
|
|
72009
71999
|
handleSecondHalfOfUpload({ acceptedFiles, cleanedFileList });
|
|
72010
72000
|
})
|
|
@@ -72252,6 +72242,18 @@ function stripId(ents = []) {
|
|
|
72252
72242
|
__name(stripId, "stripId");
|
|
72253
72243
|
const manualEnterMessage = "Build CSV File";
|
|
72254
72244
|
const manualEnterSubMessage = "Paste or type data to build a CSV file";
|
|
72245
|
+
function trimFiles(incomingFiles, fileLimit) {
|
|
72246
|
+
if (fileLimit) {
|
|
72247
|
+
if (fileLimit && incomingFiles.length > fileLimit) {
|
|
72248
|
+
window.toastr && window.toastr.warning(
|
|
72249
|
+
`Detected additional files in your upload that we are ignoring. You can only upload ${fileLimit} file${fileLimit > 1 ? "s" : ""} at a time.`
|
|
72250
|
+
);
|
|
72251
|
+
}
|
|
72252
|
+
return incomingFiles.slice(0, fileLimit);
|
|
72253
|
+
}
|
|
72254
|
+
return incomingFiles;
|
|
72255
|
+
}
|
|
72256
|
+
__name(trimFiles, "trimFiles");
|
|
72255
72257
|
const style$7 = "";
|
|
72256
72258
|
function DNALoader({ style: style2, className }) {
|
|
72257
72259
|
return /* @__PURE__ */ React__default.createElement("div", { className: classNames("dna-loader", className), style: style2 }, /* @__PURE__ */ React__default.createElement("div", { className: "nucleobase" }), /* @__PURE__ */ React__default.createElement("div", { className: "nucleobase" }), /* @__PURE__ */ React__default.createElement("div", { className: "nucleobase" }), /* @__PURE__ */ React__default.createElement("div", { className: "nucleobase" }), /* @__PURE__ */ React__default.createElement("div", { className: "nucleobase" }), /* @__PURE__ */ React__default.createElement("div", { className: "nucleobase" }), /* @__PURE__ */ React__default.createElement("div", { className: "nucleobase" }), /* @__PURE__ */ React__default.createElement("div", { className: "nucleobase" }), /* @__PURE__ */ React__default.createElement("div", { className: "nucleobase" }), /* @__PURE__ */ React__default.createElement("div", { className: "nucleobase" }));
|
package/package.json
CHANGED
package/src/DataTable/index.js
CHANGED
|
@@ -1382,13 +1382,24 @@ class DataTable extends React.Component {
|
|
|
1382
1382
|
{...(isCellEditable && {
|
|
1383
1383
|
tabIndex: -1,
|
|
1384
1384
|
onKeyDown: e => {
|
|
1385
|
-
const isArrowKey =
|
|
1386
|
-
|
|
1387
|
-
if (isArrowKey && e.target?.tagName !== "INPUT") {
|
|
1385
|
+
// const isArrowKey =
|
|
1386
|
+
// (e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode === 9;
|
|
1387
|
+
// if (isArrowKey && e.target?.tagName !== "INPUT") {
|
|
1388
|
+
const isTabKey = e.keyCode === 9;
|
|
1389
|
+
// const isEnter = e.keyCode === 13;
|
|
1390
|
+
// console.log(`onKeydown datatable inner`);
|
|
1391
|
+
// console.log(`isEnter:`, isEnter)
|
|
1392
|
+
const isArrowKey = e.keyCode >= 37 && e.keyCode <= 40;
|
|
1393
|
+
// console.log(`e.target?.tagName:`,e.target?.tagName)
|
|
1394
|
+
if (
|
|
1395
|
+
(isArrowKey && e.target?.tagName !== "INPUT") ||
|
|
1396
|
+
isTabKey
|
|
1397
|
+
// || (isEnter && e.target?.tagName === "INPUT")
|
|
1398
|
+
) {
|
|
1388
1399
|
const { schema, entities } = computePresets(this.props);
|
|
1389
1400
|
const left = e.keyCode === 37;
|
|
1390
1401
|
const up = e.keyCode === 38;
|
|
1391
|
-
const down = e.keyCode === 40;
|
|
1402
|
+
const down = e.keyCode === 40 || e.keyCode === 13;
|
|
1392
1403
|
let cellIdToUse = this.getPrimarySelectedCellId();
|
|
1393
1404
|
const pathToIndex = getFieldPathToIndex(schema);
|
|
1394
1405
|
const entityMap = getEntityIdToEntity(entities);
|
|
@@ -663,9 +663,7 @@ function UploaderInner({
|
|
|
663
663
|
}
|
|
664
664
|
if (!acceptedFiles.length) return;
|
|
665
665
|
setLoading(true);
|
|
666
|
-
|
|
667
|
-
acceptedFiles = acceptedFiles.slice(0, fileLimit);
|
|
668
|
-
}
|
|
666
|
+
acceptedFiles = trimFiles(acceptedFiles, fileLimit);
|
|
669
667
|
|
|
670
668
|
acceptedFiles.forEach(file => {
|
|
671
669
|
file.preview = URL.createObjectURL(file);
|
|
@@ -899,11 +897,10 @@ function UploaderInner({
|
|
|
899
897
|
`It looks like there wasn't any data in your file. Please add some data and try again`
|
|
900
898
|
);
|
|
901
899
|
}
|
|
902
|
-
const cleanedFileList =
|
|
903
|
-
|
|
904
|
-
fileLimit
|
|
900
|
+
const cleanedFileList = trimFiles(
|
|
901
|
+
[...toKeep, ...fileListToUse],
|
|
902
|
+
fileLimit
|
|
905
903
|
);
|
|
906
|
-
|
|
907
904
|
handleSecondHalfOfUpload({ acceptedFiles, cleanedFileList });
|
|
908
905
|
}
|
|
909
906
|
}}
|
|
@@ -1203,3 +1200,18 @@ function stripId(ents = []) {
|
|
|
1203
1200
|
|
|
1204
1201
|
const manualEnterMessage = "Build CSV File";
|
|
1205
1202
|
const manualEnterSubMessage = "Paste or type data to build a CSV file";
|
|
1203
|
+
|
|
1204
|
+
function trimFiles(incomingFiles, fileLimit) {
|
|
1205
|
+
if (fileLimit) {
|
|
1206
|
+
if (fileLimit && incomingFiles.length > fileLimit) {
|
|
1207
|
+
window.toastr &&
|
|
1208
|
+
window.toastr.warning(
|
|
1209
|
+
`Detected additional files in your upload that we are ignoring. You can only upload ${fileLimit} file${
|
|
1210
|
+
fileLimit > 1 ? "s" : ""
|
|
1211
|
+
} at a time.`
|
|
1212
|
+
);
|
|
1213
|
+
}
|
|
1214
|
+
return incomingFiles.slice(0, fileLimit);
|
|
1215
|
+
}
|
|
1216
|
+
return incomingFiles;
|
|
1217
|
+
}
|