@teselagen/ui 0.3.21 → 0.3.23
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 +109 -117
- package/index.es.js +109 -117
- package/package.json +1 -1
- package/src/DataTable/index.js +1 -1
- package/src/FormComponents/Uploader.js +35 -32
- package/src/FormComponents/tryToMatchSchemas.js +13 -0
- package/src/UploadCsvWizard.js +14 -2
package/index.cjs.js
CHANGED
|
@@ -30418,10 +30418,10 @@ var _propertyDesc = function (bitmap, value) {
|
|
|
30418
30418
|
};
|
|
30419
30419
|
};
|
|
30420
30420
|
|
|
30421
|
-
var dP$
|
|
30421
|
+
var dP$2 = require_objectDp();
|
|
30422
30422
|
var createDesc$3 = _propertyDesc;
|
|
30423
30423
|
var _hide = require_descriptors() ? function (object, key, value) {
|
|
30424
|
-
return dP$
|
|
30424
|
+
return dP$2.f(object, key, createDesc$3(1, value));
|
|
30425
30425
|
} : function (object, key, value) {
|
|
30426
30426
|
object[key] = value;
|
|
30427
30427
|
return object;
|
|
@@ -30437,7 +30437,7 @@ var core$3 = _coreExports;
|
|
|
30437
30437
|
var ctx$1 = _ctx;
|
|
30438
30438
|
var hide$2 = _hide;
|
|
30439
30439
|
var has$b = _has;
|
|
30440
|
-
var PROTOTYPE$
|
|
30440
|
+
var PROTOTYPE$2 = 'prototype';
|
|
30441
30441
|
|
|
30442
30442
|
var $export$8 = function (type, name, source) {
|
|
30443
30443
|
var IS_FORCED = type & $export$8.F;
|
|
@@ -30447,8 +30447,8 @@ var $export$8 = function (type, name, source) {
|
|
|
30447
30447
|
var IS_BIND = type & $export$8.B;
|
|
30448
30448
|
var IS_WRAP = type & $export$8.W;
|
|
30449
30449
|
var exports = IS_GLOBAL ? core$3 : core$3[name] || (core$3[name] = {});
|
|
30450
|
-
var expProto = exports[PROTOTYPE$
|
|
30451
|
-
var target = IS_GLOBAL ? global$4 : IS_STATIC ? global$4[name] : (global$4[name] || {})[PROTOTYPE$
|
|
30450
|
+
var expProto = exports[PROTOTYPE$2];
|
|
30451
|
+
var target = IS_GLOBAL ? global$4 : IS_STATIC ? global$4[name] : (global$4[name] || {})[PROTOTYPE$2];
|
|
30452
30452
|
var key, own, out;
|
|
30453
30453
|
if (IS_GLOBAL) source = name;
|
|
30454
30454
|
for (key in source) {
|
|
@@ -30472,7 +30472,7 @@ var $export$8 = function (type, name, source) {
|
|
|
30472
30472
|
} return new C(a, b, c);
|
|
30473
30473
|
} return C.apply(this, arguments);
|
|
30474
30474
|
};
|
|
30475
|
-
F[PROTOTYPE$
|
|
30475
|
+
F[PROTOTYPE$2] = C[PROTOTYPE$2];
|
|
30476
30476
|
return F;
|
|
30477
30477
|
// make static versions for prototype methods
|
|
30478
30478
|
})(out) : IS_PROTO && typeof out == 'function' ? ctx$1(Function.call, out) : out;
|
|
@@ -30609,14 +30609,14 @@ var _sharedKey = function (key) {
|
|
|
30609
30609
|
var has$a = _has;
|
|
30610
30610
|
var toIObject$4 = _toIobject;
|
|
30611
30611
|
var arrayIndexOf = _arrayIncludes(false);
|
|
30612
|
-
var IE_PROTO$
|
|
30612
|
+
var IE_PROTO$2 = _sharedKey('IE_PROTO');
|
|
30613
30613
|
|
|
30614
30614
|
var _objectKeysInternal = function (object, names) {
|
|
30615
30615
|
var O = toIObject$4(object);
|
|
30616
30616
|
var i = 0;
|
|
30617
30617
|
var result = [];
|
|
30618
30618
|
var key;
|
|
30619
|
-
for (key in O) if (key != IE_PROTO$
|
|
30619
|
+
for (key in O) if (key != IE_PROTO$2) has$a(O, key) && result.push(key);
|
|
30620
30620
|
// Don't enum bug & hidden keys
|
|
30621
30621
|
while (names.length > i) if (has$a(O, key = names[i++])) {
|
|
30622
30622
|
~arrayIndexOf(result, key) || result.push(key);
|
|
@@ -30631,10 +30631,10 @@ var _enumBugKeys = (
|
|
|
30631
30631
|
|
|
30632
30632
|
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
|
|
30633
30633
|
var $keys$3 = _objectKeysInternal;
|
|
30634
|
-
var enumBugKeys = _enumBugKeys;
|
|
30634
|
+
var enumBugKeys$1 = _enumBugKeys;
|
|
30635
30635
|
|
|
30636
30636
|
var _objectKeys = Object.keys || function keys(O) {
|
|
30637
|
-
return $keys$3(O, enumBugKeys);
|
|
30637
|
+
return $keys$3(O, enumBugKeys$1);
|
|
30638
30638
|
};
|
|
30639
30639
|
|
|
30640
30640
|
var _objectGops = {};
|
|
@@ -30741,27 +30741,19 @@ var _iterators = {};
|
|
|
30741
30741
|
|
|
30742
30742
|
var _redefine = _hide;
|
|
30743
30743
|
|
|
30744
|
-
var
|
|
30745
|
-
var
|
|
30746
|
-
|
|
30747
|
-
function require_objectDps () {
|
|
30748
|
-
if (hasRequired_objectDps) return _objectDps;
|
|
30749
|
-
hasRequired_objectDps = 1;
|
|
30750
|
-
var dP = require_objectDp();
|
|
30751
|
-
var anObject = _anObject;
|
|
30752
|
-
var getKeys = _objectKeys;
|
|
30744
|
+
var dP$1 = require_objectDp();
|
|
30745
|
+
var anObject$4 = _anObject;
|
|
30746
|
+
var getKeys$1 = _objectKeys;
|
|
30753
30747
|
|
|
30754
|
-
|
|
30755
|
-
|
|
30756
|
-
|
|
30757
|
-
|
|
30758
|
-
|
|
30759
|
-
|
|
30760
|
-
|
|
30761
|
-
|
|
30762
|
-
|
|
30763
|
-
return _objectDps;
|
|
30764
|
-
}
|
|
30748
|
+
var _objectDps = require_descriptors() ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
30749
|
+
anObject$4(O);
|
|
30750
|
+
var keys = getKeys$1(Properties);
|
|
30751
|
+
var length = keys.length;
|
|
30752
|
+
var i = 0;
|
|
30753
|
+
var P;
|
|
30754
|
+
while (length > i) dP$1.f(O, P = keys[i++], Properties[P]);
|
|
30755
|
+
return O;
|
|
30756
|
+
};
|
|
30765
30757
|
|
|
30766
30758
|
var _html;
|
|
30767
30759
|
var hasRequired_html;
|
|
@@ -30774,55 +30766,47 @@ function require_html () {
|
|
|
30774
30766
|
return _html;
|
|
30775
30767
|
}
|
|
30776
30768
|
|
|
30777
|
-
|
|
30778
|
-
var
|
|
30779
|
-
|
|
30780
|
-
|
|
30781
|
-
|
|
30782
|
-
|
|
30783
|
-
|
|
30784
|
-
var anObject = _anObject;
|
|
30785
|
-
var dPs = require_objectDps();
|
|
30786
|
-
var enumBugKeys = _enumBugKeys;
|
|
30787
|
-
var IE_PROTO = _sharedKey('IE_PROTO');
|
|
30788
|
-
var Empty = function () { /* empty */ };
|
|
30789
|
-
var PROTOTYPE = 'prototype';
|
|
30790
|
-
|
|
30791
|
-
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
|
30792
|
-
var createDict = function () {
|
|
30793
|
-
// Thrash, waste and sodomy: IE GC bug
|
|
30794
|
-
var iframe = require_domCreate()('iframe');
|
|
30795
|
-
var i = enumBugKeys.length;
|
|
30796
|
-
var lt = '<';
|
|
30797
|
-
var gt = '>';
|
|
30798
|
-
var iframeDocument;
|
|
30799
|
-
iframe.style.display = 'none';
|
|
30800
|
-
require_html().appendChild(iframe);
|
|
30801
|
-
iframe.src = 'javascript:'; // eslint-disable-line no-script-url
|
|
30802
|
-
// createDict = iframe.contentWindow.Object;
|
|
30803
|
-
// html.removeChild(iframe);
|
|
30804
|
-
iframeDocument = iframe.contentWindow.document;
|
|
30805
|
-
iframeDocument.open();
|
|
30806
|
-
iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
|
|
30807
|
-
iframeDocument.close();
|
|
30808
|
-
createDict = iframeDocument.F;
|
|
30809
|
-
while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
|
|
30810
|
-
return createDict();
|
|
30811
|
-
};
|
|
30769
|
+
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
|
|
30770
|
+
var anObject$3 = _anObject;
|
|
30771
|
+
var dPs = _objectDps;
|
|
30772
|
+
var enumBugKeys = _enumBugKeys;
|
|
30773
|
+
var IE_PROTO$1 = _sharedKey('IE_PROTO');
|
|
30774
|
+
var Empty = function () { /* empty */ };
|
|
30775
|
+
var PROTOTYPE$1 = 'prototype';
|
|
30812
30776
|
|
|
30813
|
-
|
|
30814
|
-
|
|
30815
|
-
|
|
30816
|
-
|
|
30817
|
-
|
|
30818
|
-
|
|
30819
|
-
|
|
30820
|
-
|
|
30821
|
-
|
|
30822
|
-
|
|
30823
|
-
|
|
30824
|
-
|
|
30825
|
-
|
|
30777
|
+
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
|
30778
|
+
var createDict = function () {
|
|
30779
|
+
// Thrash, waste and sodomy: IE GC bug
|
|
30780
|
+
var iframe = require_domCreate()('iframe');
|
|
30781
|
+
var i = enumBugKeys.length;
|
|
30782
|
+
var lt = '<';
|
|
30783
|
+
var gt = '>';
|
|
30784
|
+
var iframeDocument;
|
|
30785
|
+
iframe.style.display = 'none';
|
|
30786
|
+
require_html().appendChild(iframe);
|
|
30787
|
+
iframe.src = 'javascript:'; // eslint-disable-line no-script-url
|
|
30788
|
+
// createDict = iframe.contentWindow.Object;
|
|
30789
|
+
// html.removeChild(iframe);
|
|
30790
|
+
iframeDocument = iframe.contentWindow.document;
|
|
30791
|
+
iframeDocument.open();
|
|
30792
|
+
iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
|
|
30793
|
+
iframeDocument.close();
|
|
30794
|
+
createDict = iframeDocument.F;
|
|
30795
|
+
while (i--) delete createDict[PROTOTYPE$1][enumBugKeys[i]];
|
|
30796
|
+
return createDict();
|
|
30797
|
+
};
|
|
30798
|
+
|
|
30799
|
+
var _objectCreate = Object.create || function create(O, Properties) {
|
|
30800
|
+
var result;
|
|
30801
|
+
if (O !== null) {
|
|
30802
|
+
Empty[PROTOTYPE$1] = anObject$3(O);
|
|
30803
|
+
result = new Empty();
|
|
30804
|
+
Empty[PROTOTYPE$1] = null;
|
|
30805
|
+
// add "__proto__" for Object.getPrototypeOf polyfill
|
|
30806
|
+
result[IE_PROTO$1] = O;
|
|
30807
|
+
} else result = createDict();
|
|
30808
|
+
return Properties === undefined ? result : dPs(result, Properties);
|
|
30809
|
+
};
|
|
30826
30810
|
|
|
30827
30811
|
var _wks = {exports: {}};
|
|
30828
30812
|
|
|
@@ -30848,7 +30832,7 @@ var _setToStringTag = function (it, tag, stat) {
|
|
|
30848
30832
|
if (it && !has$9(it = stat ? it : it.prototype, TAG$1)) def(it, TAG$1, { configurable: true, value: tag });
|
|
30849
30833
|
};
|
|
30850
30834
|
|
|
30851
|
-
var create$3 =
|
|
30835
|
+
var create$3 = _objectCreate;
|
|
30852
30836
|
var descriptor = _propertyDesc;
|
|
30853
30837
|
var setToStringTag$2 = _setToStringTag;
|
|
30854
30838
|
var IteratorPrototype = {};
|
|
@@ -31491,7 +31475,7 @@ var toObject$1 = _toObject;
|
|
|
31491
31475
|
var toIObject = _toIobject;
|
|
31492
31476
|
var toPrimitive = _toPrimitive;
|
|
31493
31477
|
var createDesc = _propertyDesc;
|
|
31494
|
-
var _create$1 =
|
|
31478
|
+
var _create$1 = _objectCreate;
|
|
31495
31479
|
var gOPNExt = _objectGopnExt;
|
|
31496
31480
|
var $GOPD = _objectGopd;
|
|
31497
31481
|
var $GOPS = _objectGops;
|
|
@@ -31801,7 +31785,7 @@ var setPrototypeOf = { "default": setPrototypeOf$1, __esModule: true };
|
|
|
31801
31785
|
|
|
31802
31786
|
var $export = _export;
|
|
31803
31787
|
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
|
|
31804
|
-
$export($export.S, 'Object', { create:
|
|
31788
|
+
$export($export.S, 'Object', { create: _objectCreate });
|
|
31805
31789
|
|
|
31806
31790
|
var $Object$1 = _coreExports.Object;
|
|
31807
31791
|
var create$2 = function create(P, D) {
|
|
@@ -87586,7 +87570,7 @@ class DataTable extends React$1.Component {
|
|
|
87586
87570
|
tabIndex: -1,
|
|
87587
87571
|
onKeyDown: (e) => {
|
|
87588
87572
|
const isArrowKey = e.keyCode >= 37 && e.keyCode <= 40 || e.keyCode === 9;
|
|
87589
|
-
if (isArrowKey) {
|
|
87573
|
+
if (isArrowKey && e.target?.tagName !== "INPUT") {
|
|
87590
87574
|
const { schema: schema2, entities: entities2 } = computePresets(this.props);
|
|
87591
87575
|
const left = e.keyCode === 37;
|
|
87592
87576
|
const up = e.keyCode === 38;
|
|
@@ -91769,6 +91753,7 @@ async function tryToMatchSchemas({
|
|
|
91769
91753
|
incomingData,
|
|
91770
91754
|
validateAgainstSchema
|
|
91771
91755
|
}) {
|
|
91756
|
+
await resolveValidateAgainstSchema();
|
|
91772
91757
|
const userSchema = getSchema(incomingData);
|
|
91773
91758
|
const { searchResults, csvValidationIssue } = await matchSchemas({
|
|
91774
91759
|
userSchema,
|
|
@@ -91918,6 +91903,8 @@ const addSpecialPropToAsyncErrs = (res) => {
|
|
|
91918
91903
|
});
|
|
91919
91904
|
return res;
|
|
91920
91905
|
};
|
|
91906
|
+
async function resolveValidateAgainstSchema() {
|
|
91907
|
+
}
|
|
91921
91908
|
|
|
91922
91909
|
const getInitialSteps = (csvValidationIssue) => [
|
|
91923
91910
|
{ text: "Review Headers", active: csvValidationIssue },
|
|
@@ -92376,7 +92363,7 @@ const PreviewCsvData = observer(function(props) {
|
|
|
92376
92363
|
const SimpleInsertDataDialog = compose(
|
|
92377
92364
|
wrapDialog({
|
|
92378
92365
|
canEscapeKeyClose: false,
|
|
92379
|
-
title: "
|
|
92366
|
+
title: "Build CSV File",
|
|
92380
92367
|
style: { width: "fit-content" }
|
|
92381
92368
|
}),
|
|
92382
92369
|
reduxForm.reduxForm({ form: "SimpleInsertDataDialog" }),
|
|
@@ -92407,6 +92394,16 @@ const SimpleInsertDataDialog = compose(
|
|
|
92407
92394
|
reduxFormCellValidation
|
|
92408
92395
|
);
|
|
92409
92396
|
return /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement("div", { className: "bp3-dialog-body" }, /* @__PURE__ */ React$1.createElement(
|
|
92397
|
+
InputField,
|
|
92398
|
+
{
|
|
92399
|
+
isRequired: true,
|
|
92400
|
+
rightElement: /* @__PURE__ */ React$1.createElement("div", { style: { paddingTop: 6, paddingRight: 5 } }, ".csv"),
|
|
92401
|
+
inlineLabel: true,
|
|
92402
|
+
label: "File Name:",
|
|
92403
|
+
defaultValue: "manual_data_entry",
|
|
92404
|
+
name: "fileName"
|
|
92405
|
+
}
|
|
92406
|
+
), /* @__PURE__ */ React$1.createElement(
|
|
92410
92407
|
PreviewCsvData,
|
|
92411
92408
|
{
|
|
92412
92409
|
...{
|
|
@@ -92425,7 +92422,7 @@ const SimpleInsertDataDialog = compose(
|
|
|
92425
92422
|
DialogFooter,
|
|
92426
92423
|
{
|
|
92427
92424
|
submitting,
|
|
92428
|
-
onClick: handleSubmit(async () => {
|
|
92425
|
+
onClick: handleSubmit(async ({ fileName }) => {
|
|
92429
92426
|
if (lodashExports.some(validationToUse, (e) => e))
|
|
92430
92427
|
return;
|
|
92431
92428
|
if (await asyncValidateHelper(
|
|
@@ -92436,6 +92433,7 @@ const SimpleInsertDataDialog = compose(
|
|
|
92436
92433
|
))
|
|
92437
92434
|
return;
|
|
92438
92435
|
onSimpleInsertDialogFinish({
|
|
92436
|
+
fileName: fileName + ".csv",
|
|
92439
92437
|
newEntities: maybeStripIdFromEntities(
|
|
92440
92438
|
entsToUse,
|
|
92441
92439
|
validateAgainstSchema
|
|
@@ -99883,7 +99881,7 @@ function UploaderInner({
|
|
|
99883
99881
|
}
|
|
99884
99882
|
handleManuallyEnterData = async (e) => {
|
|
99885
99883
|
e.stopPropagation();
|
|
99886
|
-
const { newEntities } = await showSimpleInsertDataDialog(
|
|
99884
|
+
const { newEntities, fileName } = await showSimpleInsertDataDialog(
|
|
99887
99885
|
"onSimpleInsertDialogFinish",
|
|
99888
99886
|
{
|
|
99889
99887
|
validateAgainstSchema
|
|
@@ -99892,10 +99890,7 @@ function UploaderInner({
|
|
|
99892
99890
|
if (!newEntities) {
|
|
99893
99891
|
return;
|
|
99894
99892
|
} else {
|
|
99895
|
-
const newFileName = getNewName(
|
|
99896
|
-
fileListToUse,
|
|
99897
|
-
`manual_data_entry.csv`
|
|
99898
|
-
);
|
|
99893
|
+
const newFileName = getNewName(fileListToUse, fileName);
|
|
99899
99894
|
const { newFile, cleanedEntities } = getNewCsvFile(
|
|
99900
99895
|
newEntities,
|
|
99901
99896
|
newFileName
|
|
@@ -100460,31 +100455,22 @@ function UploaderInner({
|
|
|
100460
100455
|
className: "tg-upload-inner"
|
|
100461
100456
|
},
|
|
100462
100457
|
innerIcon || /* @__PURE__ */ React$1.createElement(core$5.Icon, { icon: "upload", iconSize: minimal ? 15 : 30 }),
|
|
100463
|
-
innerText || (minimal ? "Upload" : "Click or drag to upload")
|
|
100464
|
-
|
|
100465
|
-
|
|
100466
|
-
|
|
100467
|
-
|
|
100468
|
-
|
|
100469
|
-
|
|
100470
|
-
|
|
100471
|
-
|
|
100472
|
-
|
|
100473
|
-
|
|
100474
|
-
|
|
100475
|
-
|
|
100476
|
-
|
|
100477
|
-
|
|
100478
|
-
|
|
100479
|
-
"div",
|
|
100480
|
-
{
|
|
100481
|
-
style: {
|
|
100482
|
-
fontSize: 11,
|
|
100483
|
-
color: core$5.Colors.GRAY3,
|
|
100484
|
-
fontStyle: "italic"
|
|
100485
|
-
}
|
|
100486
|
-
},
|
|
100487
|
-
manualEnterSubMessage
|
|
100458
|
+
innerText || (minimal ? "Upload" : "Click or drag to upload"),
|
|
100459
|
+
validateAgainstSchema && /* @__PURE__ */ React$1.createElement(
|
|
100460
|
+
"div",
|
|
100461
|
+
{
|
|
100462
|
+
style: {
|
|
100463
|
+
textAlign: "center",
|
|
100464
|
+
// fontSize: 18,
|
|
100465
|
+
marginTop: 7,
|
|
100466
|
+
marginBottom: 5
|
|
100467
|
+
},
|
|
100468
|
+
onClick: handleManuallyEnterData,
|
|
100469
|
+
className: "link-button"
|
|
100470
|
+
},
|
|
100471
|
+
"...or ",
|
|
100472
|
+
manualEnterMessage
|
|
100473
|
+
)
|
|
100488
100474
|
)
|
|
100489
100475
|
), showFilesCount ? /* @__PURE__ */ React$1.createElement("div", { className: "tg-upload-file-list-counter" }, "Files: ", fileList ? fileList.length : 0) : null)
|
|
100490
100476
|
),
|
|
@@ -100559,12 +100545,15 @@ function UploaderInner({
|
|
|
100559
100545
|
incomingData: file.parsedData,
|
|
100560
100546
|
validateAgainstSchema
|
|
100561
100547
|
});
|
|
100562
|
-
const { newEntities } = await showSimpleInsertDataDialog(
|
|
100548
|
+
const { newEntities, fileName } = await showSimpleInsertDataDialog(
|
|
100563
100549
|
"onSimpleInsertDialogFinish",
|
|
100564
100550
|
{
|
|
100565
100551
|
dialogProps: {
|
|
100566
100552
|
title: "Edit Data"
|
|
100567
100553
|
},
|
|
100554
|
+
initialValues: {
|
|
100555
|
+
fileName: removeExt(file.name)
|
|
100556
|
+
},
|
|
100568
100557
|
validateAgainstSchema,
|
|
100569
100558
|
isEditingExistingFile: true,
|
|
100570
100559
|
searchResults,
|
|
@@ -100575,13 +100564,16 @@ function UploaderInner({
|
|
|
100575
100564
|
if (!newEntities) {
|
|
100576
100565
|
return;
|
|
100577
100566
|
} else {
|
|
100578
|
-
const { newFile, cleanedEntities } = getNewCsvFile(newEntities,
|
|
100579
|
-
Object.assign(file, {
|
|
100567
|
+
const { newFile, cleanedEntities } = getNewCsvFile(newEntities, fileName);
|
|
100568
|
+
const zoink = Object.assign({}, file, {
|
|
100580
100569
|
...newFile,
|
|
100581
100570
|
originFileObj: newFile,
|
|
100582
100571
|
originalFileObj: newFile,
|
|
100583
100572
|
parsedData: cleanedEntities
|
|
100584
100573
|
});
|
|
100574
|
+
zoink.name = newFile.name;
|
|
100575
|
+
fileList = [...fileList];
|
|
100576
|
+
fileList[index] = zoink;
|
|
100585
100577
|
handleSecondHalfOfUpload({
|
|
100586
100578
|
acceptedFiles: fileList,
|
|
100587
100579
|
cleanedFileList: fileList
|
package/index.es.js
CHANGED
|
@@ -30397,10 +30397,10 @@ var _propertyDesc = function (bitmap, value) {
|
|
|
30397
30397
|
};
|
|
30398
30398
|
};
|
|
30399
30399
|
|
|
30400
|
-
var dP$
|
|
30400
|
+
var dP$2 = require_objectDp();
|
|
30401
30401
|
var createDesc$3 = _propertyDesc;
|
|
30402
30402
|
var _hide = require_descriptors() ? function (object, key, value) {
|
|
30403
|
-
return dP$
|
|
30403
|
+
return dP$2.f(object, key, createDesc$3(1, value));
|
|
30404
30404
|
} : function (object, key, value) {
|
|
30405
30405
|
object[key] = value;
|
|
30406
30406
|
return object;
|
|
@@ -30416,7 +30416,7 @@ var core$3 = _coreExports;
|
|
|
30416
30416
|
var ctx$1 = _ctx;
|
|
30417
30417
|
var hide$2 = _hide;
|
|
30418
30418
|
var has$b = _has;
|
|
30419
|
-
var PROTOTYPE$
|
|
30419
|
+
var PROTOTYPE$2 = 'prototype';
|
|
30420
30420
|
|
|
30421
30421
|
var $export$8 = function (type, name, source) {
|
|
30422
30422
|
var IS_FORCED = type & $export$8.F;
|
|
@@ -30426,8 +30426,8 @@ var $export$8 = function (type, name, source) {
|
|
|
30426
30426
|
var IS_BIND = type & $export$8.B;
|
|
30427
30427
|
var IS_WRAP = type & $export$8.W;
|
|
30428
30428
|
var exports = IS_GLOBAL ? core$3 : core$3[name] || (core$3[name] = {});
|
|
30429
|
-
var expProto = exports[PROTOTYPE$
|
|
30430
|
-
var target = IS_GLOBAL ? global$4 : IS_STATIC ? global$4[name] : (global$4[name] || {})[PROTOTYPE$
|
|
30429
|
+
var expProto = exports[PROTOTYPE$2];
|
|
30430
|
+
var target = IS_GLOBAL ? global$4 : IS_STATIC ? global$4[name] : (global$4[name] || {})[PROTOTYPE$2];
|
|
30431
30431
|
var key, own, out;
|
|
30432
30432
|
if (IS_GLOBAL) source = name;
|
|
30433
30433
|
for (key in source) {
|
|
@@ -30451,7 +30451,7 @@ var $export$8 = function (type, name, source) {
|
|
|
30451
30451
|
} return new C(a, b, c);
|
|
30452
30452
|
} return C.apply(this, arguments);
|
|
30453
30453
|
};
|
|
30454
|
-
F[PROTOTYPE$
|
|
30454
|
+
F[PROTOTYPE$2] = C[PROTOTYPE$2];
|
|
30455
30455
|
return F;
|
|
30456
30456
|
// make static versions for prototype methods
|
|
30457
30457
|
})(out) : IS_PROTO && typeof out == 'function' ? ctx$1(Function.call, out) : out;
|
|
@@ -30588,14 +30588,14 @@ var _sharedKey = function (key) {
|
|
|
30588
30588
|
var has$a = _has;
|
|
30589
30589
|
var toIObject$4 = _toIobject;
|
|
30590
30590
|
var arrayIndexOf = _arrayIncludes(false);
|
|
30591
|
-
var IE_PROTO$
|
|
30591
|
+
var IE_PROTO$2 = _sharedKey('IE_PROTO');
|
|
30592
30592
|
|
|
30593
30593
|
var _objectKeysInternal = function (object, names) {
|
|
30594
30594
|
var O = toIObject$4(object);
|
|
30595
30595
|
var i = 0;
|
|
30596
30596
|
var result = [];
|
|
30597
30597
|
var key;
|
|
30598
|
-
for (key in O) if (key != IE_PROTO$
|
|
30598
|
+
for (key in O) if (key != IE_PROTO$2) has$a(O, key) && result.push(key);
|
|
30599
30599
|
// Don't enum bug & hidden keys
|
|
30600
30600
|
while (names.length > i) if (has$a(O, key = names[i++])) {
|
|
30601
30601
|
~arrayIndexOf(result, key) || result.push(key);
|
|
@@ -30610,10 +30610,10 @@ var _enumBugKeys = (
|
|
|
30610
30610
|
|
|
30611
30611
|
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
|
|
30612
30612
|
var $keys$3 = _objectKeysInternal;
|
|
30613
|
-
var enumBugKeys = _enumBugKeys;
|
|
30613
|
+
var enumBugKeys$1 = _enumBugKeys;
|
|
30614
30614
|
|
|
30615
30615
|
var _objectKeys = Object.keys || function keys(O) {
|
|
30616
|
-
return $keys$3(O, enumBugKeys);
|
|
30616
|
+
return $keys$3(O, enumBugKeys$1);
|
|
30617
30617
|
};
|
|
30618
30618
|
|
|
30619
30619
|
var _objectGops = {};
|
|
@@ -30720,27 +30720,19 @@ var _iterators = {};
|
|
|
30720
30720
|
|
|
30721
30721
|
var _redefine = _hide;
|
|
30722
30722
|
|
|
30723
|
-
var
|
|
30724
|
-
var
|
|
30725
|
-
|
|
30726
|
-
function require_objectDps () {
|
|
30727
|
-
if (hasRequired_objectDps) return _objectDps;
|
|
30728
|
-
hasRequired_objectDps = 1;
|
|
30729
|
-
var dP = require_objectDp();
|
|
30730
|
-
var anObject = _anObject;
|
|
30731
|
-
var getKeys = _objectKeys;
|
|
30723
|
+
var dP$1 = require_objectDp();
|
|
30724
|
+
var anObject$4 = _anObject;
|
|
30725
|
+
var getKeys$1 = _objectKeys;
|
|
30732
30726
|
|
|
30733
|
-
|
|
30734
|
-
|
|
30735
|
-
|
|
30736
|
-
|
|
30737
|
-
|
|
30738
|
-
|
|
30739
|
-
|
|
30740
|
-
|
|
30741
|
-
|
|
30742
|
-
return _objectDps;
|
|
30743
|
-
}
|
|
30727
|
+
var _objectDps = require_descriptors() ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
30728
|
+
anObject$4(O);
|
|
30729
|
+
var keys = getKeys$1(Properties);
|
|
30730
|
+
var length = keys.length;
|
|
30731
|
+
var i = 0;
|
|
30732
|
+
var P;
|
|
30733
|
+
while (length > i) dP$1.f(O, P = keys[i++], Properties[P]);
|
|
30734
|
+
return O;
|
|
30735
|
+
};
|
|
30744
30736
|
|
|
30745
30737
|
var _html;
|
|
30746
30738
|
var hasRequired_html;
|
|
@@ -30753,55 +30745,47 @@ function require_html () {
|
|
|
30753
30745
|
return _html;
|
|
30754
30746
|
}
|
|
30755
30747
|
|
|
30756
|
-
|
|
30757
|
-
var
|
|
30758
|
-
|
|
30759
|
-
|
|
30760
|
-
|
|
30761
|
-
|
|
30762
|
-
|
|
30763
|
-
var anObject = _anObject;
|
|
30764
|
-
var dPs = require_objectDps();
|
|
30765
|
-
var enumBugKeys = _enumBugKeys;
|
|
30766
|
-
var IE_PROTO = _sharedKey('IE_PROTO');
|
|
30767
|
-
var Empty = function () { /* empty */ };
|
|
30768
|
-
var PROTOTYPE = 'prototype';
|
|
30769
|
-
|
|
30770
|
-
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
|
30771
|
-
var createDict = function () {
|
|
30772
|
-
// Thrash, waste and sodomy: IE GC bug
|
|
30773
|
-
var iframe = require_domCreate()('iframe');
|
|
30774
|
-
var i = enumBugKeys.length;
|
|
30775
|
-
var lt = '<';
|
|
30776
|
-
var gt = '>';
|
|
30777
|
-
var iframeDocument;
|
|
30778
|
-
iframe.style.display = 'none';
|
|
30779
|
-
require_html().appendChild(iframe);
|
|
30780
|
-
iframe.src = 'javascript:'; // eslint-disable-line no-script-url
|
|
30781
|
-
// createDict = iframe.contentWindow.Object;
|
|
30782
|
-
// html.removeChild(iframe);
|
|
30783
|
-
iframeDocument = iframe.contentWindow.document;
|
|
30784
|
-
iframeDocument.open();
|
|
30785
|
-
iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
|
|
30786
|
-
iframeDocument.close();
|
|
30787
|
-
createDict = iframeDocument.F;
|
|
30788
|
-
while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
|
|
30789
|
-
return createDict();
|
|
30790
|
-
};
|
|
30748
|
+
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
|
|
30749
|
+
var anObject$3 = _anObject;
|
|
30750
|
+
var dPs = _objectDps;
|
|
30751
|
+
var enumBugKeys = _enumBugKeys;
|
|
30752
|
+
var IE_PROTO$1 = _sharedKey('IE_PROTO');
|
|
30753
|
+
var Empty = function () { /* empty */ };
|
|
30754
|
+
var PROTOTYPE$1 = 'prototype';
|
|
30791
30755
|
|
|
30792
|
-
|
|
30793
|
-
|
|
30794
|
-
|
|
30795
|
-
|
|
30796
|
-
|
|
30797
|
-
|
|
30798
|
-
|
|
30799
|
-
|
|
30800
|
-
|
|
30801
|
-
|
|
30802
|
-
|
|
30803
|
-
|
|
30804
|
-
|
|
30756
|
+
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
|
30757
|
+
var createDict = function () {
|
|
30758
|
+
// Thrash, waste and sodomy: IE GC bug
|
|
30759
|
+
var iframe = require_domCreate()('iframe');
|
|
30760
|
+
var i = enumBugKeys.length;
|
|
30761
|
+
var lt = '<';
|
|
30762
|
+
var gt = '>';
|
|
30763
|
+
var iframeDocument;
|
|
30764
|
+
iframe.style.display = 'none';
|
|
30765
|
+
require_html().appendChild(iframe);
|
|
30766
|
+
iframe.src = 'javascript:'; // eslint-disable-line no-script-url
|
|
30767
|
+
// createDict = iframe.contentWindow.Object;
|
|
30768
|
+
// html.removeChild(iframe);
|
|
30769
|
+
iframeDocument = iframe.contentWindow.document;
|
|
30770
|
+
iframeDocument.open();
|
|
30771
|
+
iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
|
|
30772
|
+
iframeDocument.close();
|
|
30773
|
+
createDict = iframeDocument.F;
|
|
30774
|
+
while (i--) delete createDict[PROTOTYPE$1][enumBugKeys[i]];
|
|
30775
|
+
return createDict();
|
|
30776
|
+
};
|
|
30777
|
+
|
|
30778
|
+
var _objectCreate = Object.create || function create(O, Properties) {
|
|
30779
|
+
var result;
|
|
30780
|
+
if (O !== null) {
|
|
30781
|
+
Empty[PROTOTYPE$1] = anObject$3(O);
|
|
30782
|
+
result = new Empty();
|
|
30783
|
+
Empty[PROTOTYPE$1] = null;
|
|
30784
|
+
// add "__proto__" for Object.getPrototypeOf polyfill
|
|
30785
|
+
result[IE_PROTO$1] = O;
|
|
30786
|
+
} else result = createDict();
|
|
30787
|
+
return Properties === undefined ? result : dPs(result, Properties);
|
|
30788
|
+
};
|
|
30805
30789
|
|
|
30806
30790
|
var _wks = {exports: {}};
|
|
30807
30791
|
|
|
@@ -30827,7 +30811,7 @@ var _setToStringTag = function (it, tag, stat) {
|
|
|
30827
30811
|
if (it && !has$9(it = stat ? it : it.prototype, TAG$1)) def(it, TAG$1, { configurable: true, value: tag });
|
|
30828
30812
|
};
|
|
30829
30813
|
|
|
30830
|
-
var create$3 =
|
|
30814
|
+
var create$3 = _objectCreate;
|
|
30831
30815
|
var descriptor = _propertyDesc;
|
|
30832
30816
|
var setToStringTag$2 = _setToStringTag;
|
|
30833
30817
|
var IteratorPrototype = {};
|
|
@@ -31470,7 +31454,7 @@ var toObject$1 = _toObject;
|
|
|
31470
31454
|
var toIObject = _toIobject;
|
|
31471
31455
|
var toPrimitive = _toPrimitive;
|
|
31472
31456
|
var createDesc = _propertyDesc;
|
|
31473
|
-
var _create$1 =
|
|
31457
|
+
var _create$1 = _objectCreate;
|
|
31474
31458
|
var gOPNExt = _objectGopnExt;
|
|
31475
31459
|
var $GOPD = _objectGopd;
|
|
31476
31460
|
var $GOPS = _objectGops;
|
|
@@ -31780,7 +31764,7 @@ var setPrototypeOf = { "default": setPrototypeOf$1, __esModule: true };
|
|
|
31780
31764
|
|
|
31781
31765
|
var $export = _export;
|
|
31782
31766
|
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
|
|
31783
|
-
$export($export.S, 'Object', { create:
|
|
31767
|
+
$export($export.S, 'Object', { create: _objectCreate });
|
|
31784
31768
|
|
|
31785
31769
|
var $Object$1 = _coreExports.Object;
|
|
31786
31770
|
var create$2 = function create(P, D) {
|
|
@@ -87565,7 +87549,7 @@ class DataTable extends React__default.Component {
|
|
|
87565
87549
|
tabIndex: -1,
|
|
87566
87550
|
onKeyDown: (e) => {
|
|
87567
87551
|
const isArrowKey = e.keyCode >= 37 && e.keyCode <= 40 || e.keyCode === 9;
|
|
87568
|
-
if (isArrowKey) {
|
|
87552
|
+
if (isArrowKey && e.target?.tagName !== "INPUT") {
|
|
87569
87553
|
const { schema: schema2, entities: entities2 } = computePresets(this.props);
|
|
87570
87554
|
const left = e.keyCode === 37;
|
|
87571
87555
|
const up = e.keyCode === 38;
|
|
@@ -91748,6 +91732,7 @@ async function tryToMatchSchemas({
|
|
|
91748
91732
|
incomingData,
|
|
91749
91733
|
validateAgainstSchema
|
|
91750
91734
|
}) {
|
|
91735
|
+
await resolveValidateAgainstSchema();
|
|
91751
91736
|
const userSchema = getSchema(incomingData);
|
|
91752
91737
|
const { searchResults, csvValidationIssue } = await matchSchemas({
|
|
91753
91738
|
userSchema,
|
|
@@ -91897,6 +91882,8 @@ const addSpecialPropToAsyncErrs = (res) => {
|
|
|
91897
91882
|
});
|
|
91898
91883
|
return res;
|
|
91899
91884
|
};
|
|
91885
|
+
async function resolveValidateAgainstSchema() {
|
|
91886
|
+
}
|
|
91900
91887
|
|
|
91901
91888
|
const getInitialSteps = (csvValidationIssue) => [
|
|
91902
91889
|
{ text: "Review Headers", active: csvValidationIssue },
|
|
@@ -92355,7 +92342,7 @@ const PreviewCsvData = observer(function(props) {
|
|
|
92355
92342
|
const SimpleInsertDataDialog = compose(
|
|
92356
92343
|
wrapDialog({
|
|
92357
92344
|
canEscapeKeyClose: false,
|
|
92358
|
-
title: "
|
|
92345
|
+
title: "Build CSV File",
|
|
92359
92346
|
style: { width: "fit-content" }
|
|
92360
92347
|
}),
|
|
92361
92348
|
reduxForm({ form: "SimpleInsertDataDialog" }),
|
|
@@ -92386,6 +92373,16 @@ const SimpleInsertDataDialog = compose(
|
|
|
92386
92373
|
reduxFormCellValidation
|
|
92387
92374
|
);
|
|
92388
92375
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", { className: "bp3-dialog-body" }, /* @__PURE__ */ React__default.createElement(
|
|
92376
|
+
InputField,
|
|
92377
|
+
{
|
|
92378
|
+
isRequired: true,
|
|
92379
|
+
rightElement: /* @__PURE__ */ React__default.createElement("div", { style: { paddingTop: 6, paddingRight: 5 } }, ".csv"),
|
|
92380
|
+
inlineLabel: true,
|
|
92381
|
+
label: "File Name:",
|
|
92382
|
+
defaultValue: "manual_data_entry",
|
|
92383
|
+
name: "fileName"
|
|
92384
|
+
}
|
|
92385
|
+
), /* @__PURE__ */ React__default.createElement(
|
|
92389
92386
|
PreviewCsvData,
|
|
92390
92387
|
{
|
|
92391
92388
|
...{
|
|
@@ -92404,7 +92401,7 @@ const SimpleInsertDataDialog = compose(
|
|
|
92404
92401
|
DialogFooter,
|
|
92405
92402
|
{
|
|
92406
92403
|
submitting,
|
|
92407
|
-
onClick: handleSubmit(async () => {
|
|
92404
|
+
onClick: handleSubmit(async ({ fileName }) => {
|
|
92408
92405
|
if (lodashExports.some(validationToUse, (e) => e))
|
|
92409
92406
|
return;
|
|
92410
92407
|
if (await asyncValidateHelper(
|
|
@@ -92415,6 +92412,7 @@ const SimpleInsertDataDialog = compose(
|
|
|
92415
92412
|
))
|
|
92416
92413
|
return;
|
|
92417
92414
|
onSimpleInsertDialogFinish({
|
|
92415
|
+
fileName: fileName + ".csv",
|
|
92418
92416
|
newEntities: maybeStripIdFromEntities(
|
|
92419
92417
|
entsToUse,
|
|
92420
92418
|
validateAgainstSchema
|
|
@@ -99862,7 +99860,7 @@ function UploaderInner({
|
|
|
99862
99860
|
}
|
|
99863
99861
|
handleManuallyEnterData = async (e) => {
|
|
99864
99862
|
e.stopPropagation();
|
|
99865
|
-
const { newEntities } = await showSimpleInsertDataDialog(
|
|
99863
|
+
const { newEntities, fileName } = await showSimpleInsertDataDialog(
|
|
99866
99864
|
"onSimpleInsertDialogFinish",
|
|
99867
99865
|
{
|
|
99868
99866
|
validateAgainstSchema
|
|
@@ -99871,10 +99869,7 @@ function UploaderInner({
|
|
|
99871
99869
|
if (!newEntities) {
|
|
99872
99870
|
return;
|
|
99873
99871
|
} else {
|
|
99874
|
-
const newFileName = getNewName(
|
|
99875
|
-
fileListToUse,
|
|
99876
|
-
`manual_data_entry.csv`
|
|
99877
|
-
);
|
|
99872
|
+
const newFileName = getNewName(fileListToUse, fileName);
|
|
99878
99873
|
const { newFile, cleanedEntities } = getNewCsvFile(
|
|
99879
99874
|
newEntities,
|
|
99880
99875
|
newFileName
|
|
@@ -100439,31 +100434,22 @@ function UploaderInner({
|
|
|
100439
100434
|
className: "tg-upload-inner"
|
|
100440
100435
|
},
|
|
100441
100436
|
innerIcon || /* @__PURE__ */ React__default.createElement(Icon, { icon: "upload", iconSize: minimal ? 15 : 30 }),
|
|
100442
|
-
innerText || (minimal ? "Upload" : "Click or drag to upload")
|
|
100443
|
-
|
|
100444
|
-
|
|
100445
|
-
|
|
100446
|
-
|
|
100447
|
-
|
|
100448
|
-
|
|
100449
|
-
|
|
100450
|
-
|
|
100451
|
-
|
|
100452
|
-
|
|
100453
|
-
|
|
100454
|
-
|
|
100455
|
-
|
|
100456
|
-
|
|
100457
|
-
|
|
100458
|
-
"div",
|
|
100459
|
-
{
|
|
100460
|
-
style: {
|
|
100461
|
-
fontSize: 11,
|
|
100462
|
-
color: Colors.GRAY3,
|
|
100463
|
-
fontStyle: "italic"
|
|
100464
|
-
}
|
|
100465
|
-
},
|
|
100466
|
-
manualEnterSubMessage
|
|
100437
|
+
innerText || (minimal ? "Upload" : "Click or drag to upload"),
|
|
100438
|
+
validateAgainstSchema && /* @__PURE__ */ React__default.createElement(
|
|
100439
|
+
"div",
|
|
100440
|
+
{
|
|
100441
|
+
style: {
|
|
100442
|
+
textAlign: "center",
|
|
100443
|
+
// fontSize: 18,
|
|
100444
|
+
marginTop: 7,
|
|
100445
|
+
marginBottom: 5
|
|
100446
|
+
},
|
|
100447
|
+
onClick: handleManuallyEnterData,
|
|
100448
|
+
className: "link-button"
|
|
100449
|
+
},
|
|
100450
|
+
"...or ",
|
|
100451
|
+
manualEnterMessage
|
|
100452
|
+
)
|
|
100467
100453
|
)
|
|
100468
100454
|
), showFilesCount ? /* @__PURE__ */ React__default.createElement("div", { className: "tg-upload-file-list-counter" }, "Files: ", fileList ? fileList.length : 0) : null)
|
|
100469
100455
|
),
|
|
@@ -100538,12 +100524,15 @@ function UploaderInner({
|
|
|
100538
100524
|
incomingData: file.parsedData,
|
|
100539
100525
|
validateAgainstSchema
|
|
100540
100526
|
});
|
|
100541
|
-
const { newEntities } = await showSimpleInsertDataDialog(
|
|
100527
|
+
const { newEntities, fileName } = await showSimpleInsertDataDialog(
|
|
100542
100528
|
"onSimpleInsertDialogFinish",
|
|
100543
100529
|
{
|
|
100544
100530
|
dialogProps: {
|
|
100545
100531
|
title: "Edit Data"
|
|
100546
100532
|
},
|
|
100533
|
+
initialValues: {
|
|
100534
|
+
fileName: removeExt(file.name)
|
|
100535
|
+
},
|
|
100547
100536
|
validateAgainstSchema,
|
|
100548
100537
|
isEditingExistingFile: true,
|
|
100549
100538
|
searchResults,
|
|
@@ -100554,13 +100543,16 @@ function UploaderInner({
|
|
|
100554
100543
|
if (!newEntities) {
|
|
100555
100544
|
return;
|
|
100556
100545
|
} else {
|
|
100557
|
-
const { newFile, cleanedEntities } = getNewCsvFile(newEntities,
|
|
100558
|
-
Object.assign(file, {
|
|
100546
|
+
const { newFile, cleanedEntities } = getNewCsvFile(newEntities, fileName);
|
|
100547
|
+
const zoink = Object.assign({}, file, {
|
|
100559
100548
|
...newFile,
|
|
100560
100549
|
originFileObj: newFile,
|
|
100561
100550
|
originalFileObj: newFile,
|
|
100562
100551
|
parsedData: cleanedEntities
|
|
100563
100552
|
});
|
|
100553
|
+
zoink.name = newFile.name;
|
|
100554
|
+
fileList = [...fileList];
|
|
100555
|
+
fileList[index] = zoink;
|
|
100564
100556
|
handleSecondHalfOfUpload({
|
|
100565
100557
|
acceptedFiles: fileList,
|
|
100566
100558
|
cleanedFileList: fileList
|
package/package.json
CHANGED
package/src/DataTable/index.js
CHANGED
|
@@ -1384,7 +1384,7 @@ class DataTable extends React.Component {
|
|
|
1384
1384
|
onKeyDown: e => {
|
|
1385
1385
|
const isArrowKey =
|
|
1386
1386
|
(e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode === 9;
|
|
1387
|
-
if (isArrowKey) {
|
|
1387
|
+
if (isArrowKey && e.target?.tagName !== "INPUT") {
|
|
1388
1388
|
const { schema, entities } = computePresets(this.props);
|
|
1389
1389
|
const left = e.keyCode === 37;
|
|
1390
1390
|
const up = e.keyCode === 38;
|
|
@@ -228,7 +228,7 @@ function UploaderInner({
|
|
|
228
228
|
}
|
|
229
229
|
handleManuallyEnterData = async e => {
|
|
230
230
|
e.stopPropagation();
|
|
231
|
-
const { newEntities } = await showSimpleInsertDataDialog(
|
|
231
|
+
const { newEntities, fileName } = await showSimpleInsertDataDialog(
|
|
232
232
|
"onSimpleInsertDialogFinish",
|
|
233
233
|
{
|
|
234
234
|
validateAgainstSchema
|
|
@@ -239,10 +239,7 @@ function UploaderInner({
|
|
|
239
239
|
} else {
|
|
240
240
|
//check existing files to make sure the new file name gets incremented if necessary
|
|
241
241
|
// fileList
|
|
242
|
-
const newFileName = getNewName(
|
|
243
|
-
fileListToUse,
|
|
244
|
-
`manual_data_entry.csv`
|
|
245
|
-
);
|
|
242
|
+
const newFileName = getNewName(fileListToUse, fileName);
|
|
246
243
|
const { newFile, cleanedEntities } = getNewCsvFile(
|
|
247
244
|
newEntities,
|
|
248
245
|
newFileName
|
|
@@ -948,32 +945,33 @@ function UploaderInner({
|
|
|
948
945
|
)}
|
|
949
946
|
{innerText ||
|
|
950
947
|
(minimal ? "Upload" : "Click or drag to upload")}
|
|
948
|
+
{validateAgainstSchema && (
|
|
949
|
+
<div
|
|
950
|
+
style={{
|
|
951
|
+
textAlign: "center",
|
|
952
|
+
// fontSize: 18,
|
|
953
|
+
marginTop: 7,
|
|
954
|
+
marginBottom: 5
|
|
955
|
+
}}
|
|
956
|
+
onClick={handleManuallyEnterData}
|
|
957
|
+
className="link-button"
|
|
958
|
+
>
|
|
959
|
+
...or {manualEnterMessage}
|
|
960
|
+
{/* <div
|
|
961
|
+
style={{
|
|
962
|
+
fontSize: 11,
|
|
963
|
+
color: Colors.GRAY3,
|
|
964
|
+
fontStyle: "italic"
|
|
965
|
+
}}
|
|
966
|
+
>
|
|
967
|
+
{manualEnterSubMessage}
|
|
968
|
+
</div> */}
|
|
969
|
+
</div>
|
|
970
|
+
)}
|
|
951
971
|
</div>
|
|
952
972
|
)}
|
|
953
973
|
</div>
|
|
954
|
-
|
|
955
|
-
<div
|
|
956
|
-
style={{
|
|
957
|
-
textAlign: "center",
|
|
958
|
-
fontSize: 18,
|
|
959
|
-
marginTop: 7,
|
|
960
|
-
marginBottom: 5
|
|
961
|
-
}}
|
|
962
|
-
onClick={handleManuallyEnterData}
|
|
963
|
-
className="link-button"
|
|
964
|
-
>
|
|
965
|
-
{manualEnterMessage}
|
|
966
|
-
<div
|
|
967
|
-
style={{
|
|
968
|
-
fontSize: 11,
|
|
969
|
-
color: Colors.GRAY3,
|
|
970
|
-
fontStyle: "italic"
|
|
971
|
-
}}
|
|
972
|
-
>
|
|
973
|
-
{manualEnterSubMessage}
|
|
974
|
-
</div>
|
|
975
|
-
</div>
|
|
976
|
-
)}
|
|
974
|
+
|
|
977
975
|
{showFilesCount ? (
|
|
978
976
|
<div className="tg-upload-file-list-counter">
|
|
979
977
|
Files: {fileList ? fileList.length : 0}
|
|
@@ -1057,13 +1055,16 @@ function UploaderInner({
|
|
|
1057
1055
|
validateAgainstSchema
|
|
1058
1056
|
});
|
|
1059
1057
|
|
|
1060
|
-
const { newEntities } =
|
|
1058
|
+
const { newEntities, fileName } =
|
|
1061
1059
|
await showSimpleInsertDataDialog(
|
|
1062
1060
|
"onSimpleInsertDialogFinish",
|
|
1063
1061
|
{
|
|
1064
1062
|
dialogProps: {
|
|
1065
1063
|
title: "Edit Data"
|
|
1066
1064
|
},
|
|
1065
|
+
initialValues: {
|
|
1066
|
+
fileName: removeExt(file.name)
|
|
1067
|
+
},
|
|
1067
1068
|
validateAgainstSchema,
|
|
1068
1069
|
isEditingExistingFile: true,
|
|
1069
1070
|
searchResults,
|
|
@@ -1076,14 +1077,16 @@ function UploaderInner({
|
|
|
1076
1077
|
return;
|
|
1077
1078
|
} else {
|
|
1078
1079
|
const { newFile, cleanedEntities } =
|
|
1079
|
-
getNewCsvFile(newEntities,
|
|
1080
|
-
|
|
1081
|
-
Object.assign(file, {
|
|
1080
|
+
getNewCsvFile(newEntities, fileName);
|
|
1081
|
+
const zoink = Object.assign({}, file, {
|
|
1082
1082
|
...newFile,
|
|
1083
1083
|
originFileObj: newFile,
|
|
1084
1084
|
originalFileObj: newFile,
|
|
1085
1085
|
parsedData: cleanedEntities
|
|
1086
1086
|
});
|
|
1087
|
+
zoink.name = newFile.name;
|
|
1088
|
+
fileList = [...fileList];
|
|
1089
|
+
fileList[index] = zoink;
|
|
1087
1090
|
handleSecondHalfOfUpload({
|
|
1088
1091
|
acceptedFiles: fileList,
|
|
1089
1092
|
cleanedFileList: fileList
|
|
@@ -25,6 +25,7 @@ export default async function tryToMatchSchemas({
|
|
|
25
25
|
incomingData,
|
|
26
26
|
validateAgainstSchema
|
|
27
27
|
}) {
|
|
28
|
+
await resolveValidateAgainstSchema(validateAgainstSchema);
|
|
28
29
|
const userSchema = getSchema(incomingData);
|
|
29
30
|
|
|
30
31
|
const { searchResults, csvValidationIssue } = await matchSchemas({
|
|
@@ -219,3 +220,15 @@ export const addSpecialPropToAsyncErrs = res => {
|
|
|
219
220
|
});
|
|
220
221
|
return res;
|
|
221
222
|
};
|
|
223
|
+
|
|
224
|
+
async function resolveValidateAgainstSchema() {
|
|
225
|
+
//tnw: wip!
|
|
226
|
+
// mapSeries(validateAgainstSchema.fields, async f => {
|
|
227
|
+
// if (f.type === "dropdown") {
|
|
228
|
+
// console.log(`type:`, f.type)
|
|
229
|
+
// if (f.getValues) {
|
|
230
|
+
// f.values = await f.getValues(props);
|
|
231
|
+
// }
|
|
232
|
+
// }
|
|
233
|
+
// })
|
|
234
|
+
}
|
package/src/UploadCsvWizard.js
CHANGED
|
@@ -21,6 +21,7 @@ import { MatchHeaders } from "./MatchHeaders";
|
|
|
21
21
|
import { isEmpty } from "lodash";
|
|
22
22
|
import { addSpecialPropToAsyncErrs } from "./FormComponents/tryToMatchSchemas";
|
|
23
23
|
import { cloneDeep } from "lodash";
|
|
24
|
+
import { InputField } from "./FormComponents";
|
|
24
25
|
|
|
25
26
|
const getInitialSteps = csvValidationIssue => [
|
|
26
27
|
{ text: "Review Headers", active: csvValidationIssue },
|
|
@@ -594,7 +595,7 @@ export const PreviewCsvData = observer(function (props) {
|
|
|
594
595
|
export const SimpleInsertDataDialog = compose(
|
|
595
596
|
wrapDialog({
|
|
596
597
|
canEscapeKeyClose: false,
|
|
597
|
-
title: "
|
|
598
|
+
title: "Build CSV File",
|
|
598
599
|
style: { width: "fit-content" }
|
|
599
600
|
}),
|
|
600
601
|
reduxForm({ form: "SimpleInsertDataDialog" }),
|
|
@@ -628,6 +629,16 @@ export const SimpleInsertDataDialog = compose(
|
|
|
628
629
|
return (
|
|
629
630
|
<>
|
|
630
631
|
<div className="bp3-dialog-body">
|
|
632
|
+
<InputField
|
|
633
|
+
isRequired
|
|
634
|
+
rightElement={
|
|
635
|
+
<div style={{ paddingTop: 6, paddingRight: 5 }}>.csv</div>
|
|
636
|
+
}
|
|
637
|
+
inlineLabel
|
|
638
|
+
label="File Name:"
|
|
639
|
+
defaultValue={"manual_data_entry"}
|
|
640
|
+
name="fileName"
|
|
641
|
+
></InputField>
|
|
631
642
|
<PreviewCsvData
|
|
632
643
|
{...{
|
|
633
644
|
matchedHeaders,
|
|
@@ -644,7 +655,7 @@ export const SimpleInsertDataDialog = compose(
|
|
|
644
655
|
</div>
|
|
645
656
|
<DialogFooter
|
|
646
657
|
submitting={submitting}
|
|
647
|
-
onClick={handleSubmit(async () => {
|
|
658
|
+
onClick={handleSubmit(async ({fileName}) => {
|
|
648
659
|
if (some(validationToUse, e => e)) return;
|
|
649
660
|
//do async validation here if needed
|
|
650
661
|
if (
|
|
@@ -657,6 +668,7 @@ export const SimpleInsertDataDialog = compose(
|
|
|
657
668
|
)
|
|
658
669
|
return;
|
|
659
670
|
onSimpleInsertDialogFinish({
|
|
671
|
+
fileName: fileName + ".csv",
|
|
660
672
|
newEntities: maybeStripIdFromEntities(
|
|
661
673
|
entsToUse,
|
|
662
674
|
validateAgainstSchema
|