@teselagen/ui 0.3.46 → 0.3.48
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 +160 -106
- package/index.es.js +161 -107
- package/package.json +3 -2
- package/src/DataTable/index.js +67 -4
- package/src/UploadCsvWizard.js +2 -23
- package/src/index.js +3 -2
- package/src/throwFormError.js +16 -0
package/index.cjs.js
CHANGED
|
@@ -6829,10 +6829,10 @@ var ownKeys$3 = typeof Reflect !== "undefined" && Reflect.ownKeys ? Reflect.ownK
|
|
|
6829
6829
|
/* istanbul ignore next */
|
|
6830
6830
|
Object.getOwnPropertyNames
|
|
6831
6831
|
);
|
|
6832
|
-
function toPrimitive$
|
|
6832
|
+
function toPrimitive$2(value) {
|
|
6833
6833
|
return value === null ? null : typeof value === "object" ? "" + value : value;
|
|
6834
6834
|
}
|
|
6835
|
-
__name(toPrimitive$
|
|
6835
|
+
__name(toPrimitive$2, "toPrimitive$2");
|
|
6836
6836
|
function hasProp(target, prop) {
|
|
6837
6837
|
return objectPrototype$1.hasOwnProperty.call(target, prop);
|
|
6838
6838
|
}
|
|
@@ -7729,7 +7729,7 @@ var ObservableValue = /* @__PURE__ */ function(_Atom) {
|
|
|
7729
7729
|
return this.name_ + "[" + this.value_ + "]";
|
|
7730
7730
|
}, "toString");
|
|
7731
7731
|
_proto.valueOf = /* @__PURE__ */ __name(function valueOf() {
|
|
7732
|
-
return toPrimitive$
|
|
7732
|
+
return toPrimitive$2(this.get());
|
|
7733
7733
|
}, "valueOf");
|
|
7734
7734
|
_proto[_Symbol$toPrimitive] = function() {
|
|
7735
7735
|
return this.valueOf();
|
|
@@ -7914,7 +7914,7 @@ var ComputedValue = /* @__PURE__ */ function() {
|
|
|
7914
7914
|
return this.name_ + "[" + this.derivation.toString() + "]";
|
|
7915
7915
|
}, "toString");
|
|
7916
7916
|
_proto.valueOf = /* @__PURE__ */ __name(function valueOf() {
|
|
7917
|
-
return toPrimitive$
|
|
7917
|
+
return toPrimitive$2(this.get());
|
|
7918
7918
|
}, "valueOf");
|
|
7919
7919
|
_proto[_Symbol$toPrimitive$1] = function() {
|
|
7920
7920
|
return this.valueOf();
|
|
@@ -12548,7 +12548,7 @@ lodash.exports;
|
|
|
12548
12548
|
"^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar2, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
12549
12549
|
);
|
|
12550
12550
|
var Buffer2 = moduleExports2 ? context.Buffer : undefined$12, Symbol2 = context.Symbol, Uint8Array2 = context.Uint8Array, allocUnsafe2 = Buffer2 ? Buffer2.allocUnsafe : undefined$12, getPrototype2 = overArg2(Object2.getPrototypeOf, Object2), objectCreate2 = Object2.create, propertyIsEnumerable3 = objectProto2.propertyIsEnumerable, splice3 = arrayProto2.splice, spreadableSymbol2 = Symbol2 ? Symbol2.isConcatSpreadable : undefined$12, symIterator = Symbol2 ? Symbol2.iterator : undefined$12, symToStringTag2 = Symbol2 ? Symbol2.toStringTag : undefined$12;
|
|
12551
|
-
var
|
|
12551
|
+
var defineProperty5 = function() {
|
|
12552
12552
|
try {
|
|
12553
12553
|
var func = getNative2(Object2, "defineProperty");
|
|
12554
12554
|
func({}, "", {});
|
|
@@ -12988,8 +12988,8 @@ lodash.exports;
|
|
|
12988
12988
|
}
|
|
12989
12989
|
__name(baseAssignIn2, "baseAssignIn");
|
|
12990
12990
|
function baseAssignValue2(object2, key, value) {
|
|
12991
|
-
if (key == "__proto__" &&
|
|
12992
|
-
|
|
12991
|
+
if (key == "__proto__" && defineProperty5) {
|
|
12992
|
+
defineProperty5(object2, key, {
|
|
12993
12993
|
"configurable": true,
|
|
12994
12994
|
"enumerable": true,
|
|
12995
12995
|
"value": value,
|
|
@@ -13722,8 +13722,8 @@ lodash.exports;
|
|
|
13722
13722
|
metaMap.set(func, data);
|
|
13723
13723
|
return func;
|
|
13724
13724
|
};
|
|
13725
|
-
var baseSetToString2 = !
|
|
13726
|
-
return
|
|
13725
|
+
var baseSetToString2 = !defineProperty5 ? identity3 : function(func, string2) {
|
|
13726
|
+
return defineProperty5(func, "toString", {
|
|
13727
13727
|
"configurable": true,
|
|
13728
13728
|
"enumerable": false,
|
|
13729
13729
|
"value": constant2(string2),
|
|
@@ -18272,11 +18272,20 @@ var _fails = /* @__PURE__ */ __name(function(exec) {
|
|
|
18272
18272
|
return true;
|
|
18273
18273
|
}
|
|
18274
18274
|
}, "_fails");
|
|
18275
|
-
var _descriptors
|
|
18276
|
-
|
|
18277
|
-
|
|
18278
|
-
|
|
18279
|
-
|
|
18275
|
+
var _descriptors;
|
|
18276
|
+
var hasRequired_descriptors;
|
|
18277
|
+
function require_descriptors() {
|
|
18278
|
+
if (hasRequired_descriptors)
|
|
18279
|
+
return _descriptors;
|
|
18280
|
+
hasRequired_descriptors = 1;
|
|
18281
|
+
_descriptors = !_fails(function() {
|
|
18282
|
+
return Object.defineProperty({}, "a", { get: function() {
|
|
18283
|
+
return 7;
|
|
18284
|
+
} }).a != 7;
|
|
18285
|
+
});
|
|
18286
|
+
return _descriptors;
|
|
18287
|
+
}
|
|
18288
|
+
__name(require_descriptors, "require_descriptors");
|
|
18280
18289
|
var _domCreate;
|
|
18281
18290
|
var hasRequired_domCreate;
|
|
18282
18291
|
function require_domCreate() {
|
|
@@ -18292,11 +18301,20 @@ function require_domCreate() {
|
|
|
18292
18301
|
return _domCreate;
|
|
18293
18302
|
}
|
|
18294
18303
|
__name(require_domCreate, "require_domCreate");
|
|
18295
|
-
var _ie8DomDefine
|
|
18296
|
-
|
|
18297
|
-
|
|
18298
|
-
|
|
18299
|
-
|
|
18304
|
+
var _ie8DomDefine;
|
|
18305
|
+
var hasRequired_ie8DomDefine;
|
|
18306
|
+
function require_ie8DomDefine() {
|
|
18307
|
+
if (hasRequired_ie8DomDefine)
|
|
18308
|
+
return _ie8DomDefine;
|
|
18309
|
+
hasRequired_ie8DomDefine = 1;
|
|
18310
|
+
_ie8DomDefine = !require_descriptors() && !_fails(function() {
|
|
18311
|
+
return Object.defineProperty(require_domCreate()("div"), "a", { get: function() {
|
|
18312
|
+
return 7;
|
|
18313
|
+
} }).a != 7;
|
|
18314
|
+
});
|
|
18315
|
+
return _ie8DomDefine;
|
|
18316
|
+
}
|
|
18317
|
+
__name(require_ie8DomDefine, "require_ie8DomDefine");
|
|
18300
18318
|
var isObject$d = _isObject;
|
|
18301
18319
|
var _toPrimitive = /* @__PURE__ */ __name(function(it, S2) {
|
|
18302
18320
|
if (!isObject$d(it))
|
|
@@ -18310,25 +18328,33 @@ var _toPrimitive = /* @__PURE__ */ __name(function(it, S2) {
|
|
|
18310
18328
|
return val;
|
|
18311
18329
|
throw TypeError("Can't convert object to primitive value");
|
|
18312
18330
|
}, "_toPrimitive");
|
|
18313
|
-
var
|
|
18314
|
-
|
|
18315
|
-
|
|
18316
|
-
|
|
18317
|
-
|
|
18318
|
-
|
|
18319
|
-
|
|
18320
|
-
|
|
18321
|
-
|
|
18322
|
-
|
|
18323
|
-
|
|
18324
|
-
|
|
18325
|
-
|
|
18326
|
-
|
|
18327
|
-
|
|
18328
|
-
|
|
18329
|
-
|
|
18330
|
-
|
|
18331
|
-
|
|
18331
|
+
var hasRequired_objectDp;
|
|
18332
|
+
function require_objectDp() {
|
|
18333
|
+
if (hasRequired_objectDp)
|
|
18334
|
+
return _objectDp;
|
|
18335
|
+
hasRequired_objectDp = 1;
|
|
18336
|
+
var anObject2 = _anObject;
|
|
18337
|
+
var IE8_DOM_DEFINE2 = require_ie8DomDefine();
|
|
18338
|
+
var toPrimitive2 = _toPrimitive;
|
|
18339
|
+
var dP2 = Object.defineProperty;
|
|
18340
|
+
_objectDp.f = require_descriptors() ? Object.defineProperty : /* @__PURE__ */ __name(function defineProperty5(O2, P2, Attributes) {
|
|
18341
|
+
anObject2(O2);
|
|
18342
|
+
P2 = toPrimitive2(P2, true);
|
|
18343
|
+
anObject2(Attributes);
|
|
18344
|
+
if (IE8_DOM_DEFINE2)
|
|
18345
|
+
try {
|
|
18346
|
+
return dP2(O2, P2, Attributes);
|
|
18347
|
+
} catch (e2) {
|
|
18348
|
+
}
|
|
18349
|
+
if ("get" in Attributes || "set" in Attributes)
|
|
18350
|
+
throw TypeError("Accessors not supported!");
|
|
18351
|
+
if ("value" in Attributes)
|
|
18352
|
+
O2[P2] = Attributes.value;
|
|
18353
|
+
return O2;
|
|
18354
|
+
}, "defineProperty");
|
|
18355
|
+
return _objectDp;
|
|
18356
|
+
}
|
|
18357
|
+
__name(require_objectDp, "require_objectDp");
|
|
18332
18358
|
var _propertyDesc = /* @__PURE__ */ __name(function(bitmap, value) {
|
|
18333
18359
|
return {
|
|
18334
18360
|
enumerable: !(bitmap & 1),
|
|
@@ -18337,9 +18363,9 @@ var _propertyDesc = /* @__PURE__ */ __name(function(bitmap, value) {
|
|
|
18337
18363
|
value
|
|
18338
18364
|
};
|
|
18339
18365
|
}, "_propertyDesc");
|
|
18340
|
-
var dP$2 =
|
|
18366
|
+
var dP$2 = require_objectDp();
|
|
18341
18367
|
var createDesc$3 = _propertyDesc;
|
|
18342
|
-
var _hide =
|
|
18368
|
+
var _hide = require_descriptors() ? function(object2, key, value) {
|
|
18343
18369
|
return dP$2.f(object2, key, createDesc$3(1, value));
|
|
18344
18370
|
} : function(object2, key, value) {
|
|
18345
18371
|
object2[key] = value;
|
|
@@ -18411,25 +18437,16 @@ var toString$6 = {}.toString;
|
|
|
18411
18437
|
var _cof = /* @__PURE__ */ __name(function(it) {
|
|
18412
18438
|
return toString$6.call(it).slice(8, -1);
|
|
18413
18439
|
}, "_cof");
|
|
18414
|
-
var
|
|
18415
|
-
var
|
|
18416
|
-
|
|
18417
|
-
|
|
18418
|
-
return _iobject;
|
|
18419
|
-
hasRequired_iobject = 1;
|
|
18420
|
-
var cof2 = _cof;
|
|
18421
|
-
_iobject = Object("z").propertyIsEnumerable(0) ? Object : function(it) {
|
|
18422
|
-
return cof2(it) == "String" ? it.split("") : Object(it);
|
|
18423
|
-
};
|
|
18424
|
-
return _iobject;
|
|
18425
|
-
}
|
|
18426
|
-
__name(require_iobject, "require_iobject");
|
|
18440
|
+
var cof$2 = _cof;
|
|
18441
|
+
var _iobject = Object("z").propertyIsEnumerable(0) ? Object : function(it) {
|
|
18442
|
+
return cof$2(it) == "String" ? it.split("") : Object(it);
|
|
18443
|
+
};
|
|
18427
18444
|
var _defined = /* @__PURE__ */ __name(function(it) {
|
|
18428
18445
|
if (it == void 0)
|
|
18429
18446
|
throw TypeError("Can't call method on " + it);
|
|
18430
18447
|
return it;
|
|
18431
18448
|
}, "_defined");
|
|
18432
|
-
var IObject =
|
|
18449
|
+
var IObject = _iobject;
|
|
18433
18450
|
var defined$2 = _defined;
|
|
18434
18451
|
var _toIobject = /* @__PURE__ */ __name(function(it) {
|
|
18435
18452
|
return IObject(defined$2(it));
|
|
@@ -18526,15 +18543,7 @@ var _objectKeys = Object.keys || /* @__PURE__ */ __name(function keys(O2) {
|
|
|
18526
18543
|
var _objectGops = {};
|
|
18527
18544
|
_objectGops.f = Object.getOwnPropertySymbols;
|
|
18528
18545
|
var _objectPie = {};
|
|
18529
|
-
|
|
18530
|
-
function require_objectPie() {
|
|
18531
|
-
if (hasRequired_objectPie)
|
|
18532
|
-
return _objectPie;
|
|
18533
|
-
hasRequired_objectPie = 1;
|
|
18534
|
-
_objectPie.f = {}.propertyIsEnumerable;
|
|
18535
|
-
return _objectPie;
|
|
18536
|
-
}
|
|
18537
|
-
__name(require_objectPie, "require_objectPie");
|
|
18546
|
+
_objectPie.f = {}.propertyIsEnumerable;
|
|
18538
18547
|
var defined$1 = _defined;
|
|
18539
18548
|
var _toObject = /* @__PURE__ */ __name(function(it) {
|
|
18540
18549
|
return Object(defined$1(it));
|
|
@@ -18545,12 +18554,12 @@ function require_objectAssign() {
|
|
|
18545
18554
|
if (hasRequired_objectAssign)
|
|
18546
18555
|
return _objectAssign;
|
|
18547
18556
|
hasRequired_objectAssign = 1;
|
|
18548
|
-
var DESCRIPTORS2 =
|
|
18557
|
+
var DESCRIPTORS2 = require_descriptors();
|
|
18549
18558
|
var getKeys2 = _objectKeys;
|
|
18550
18559
|
var gOPS2 = _objectGops;
|
|
18551
|
-
var pIE2 =
|
|
18560
|
+
var pIE2 = _objectPie;
|
|
18552
18561
|
var toObject2 = _toObject;
|
|
18553
|
-
var IObject2 =
|
|
18562
|
+
var IObject2 = _iobject;
|
|
18554
18563
|
var $assign = Object.assign;
|
|
18555
18564
|
_objectAssign = !$assign || _fails(function() {
|
|
18556
18565
|
var A2 = {};
|
|
@@ -18611,10 +18620,10 @@ var _iterStep = /* @__PURE__ */ __name(function(done, value) {
|
|
|
18611
18620
|
}, "_iterStep");
|
|
18612
18621
|
var _iterators = {};
|
|
18613
18622
|
var _redefine = _hide;
|
|
18614
|
-
var dP$1 =
|
|
18623
|
+
var dP$1 = require_objectDp();
|
|
18615
18624
|
var anObject$4 = _anObject;
|
|
18616
18625
|
var getKeys$1 = _objectKeys;
|
|
18617
|
-
var _objectDps =
|
|
18626
|
+
var _objectDps = require_descriptors() ? Object.defineProperties : /* @__PURE__ */ __name(function defineProperties(O2, Properties) {
|
|
18618
18627
|
anObject$4(O2);
|
|
18619
18628
|
var keys3 = getKeys$1(Properties);
|
|
18620
18629
|
var length = keys3.length;
|
|
@@ -18681,7 +18690,7 @@ var $exports = _wks.exports = function(name) {
|
|
|
18681
18690
|
};
|
|
18682
18691
|
$exports.store = store;
|
|
18683
18692
|
var _wksExports = _wks.exports;
|
|
18684
|
-
var def =
|
|
18693
|
+
var def = require_objectDp().f;
|
|
18685
18694
|
var has$9 = _has;
|
|
18686
18695
|
var TAG$1 = _wksExports("toStringTag");
|
|
18687
18696
|
var _setToStringTag = /* @__PURE__ */ __name(function(it, tag, stat) {
|
|
@@ -18954,7 +18963,7 @@ var ArrayProto = Array.prototype;
|
|
|
18954
18963
|
var _isArrayIter = /* @__PURE__ */ __name(function(it) {
|
|
18955
18964
|
return it !== void 0 && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
|
|
18956
18965
|
}, "_isArrayIter");
|
|
18957
|
-
var $defineProperty$1 =
|
|
18966
|
+
var $defineProperty$1 = require_objectDp();
|
|
18958
18967
|
var createDesc$2 = _propertyDesc;
|
|
18959
18968
|
var _createProperty = /* @__PURE__ */ __name(function(object2, index2, value) {
|
|
18960
18969
|
if (index2 in object2)
|
|
@@ -19083,9 +19092,9 @@ var _default$8 = /* @__PURE__ */ __name(function(instance, Constructor) {
|
|
|
19083
19092
|
}
|
|
19084
19093
|
}, "_default$8");
|
|
19085
19094
|
var $export$3 = _export;
|
|
19086
|
-
$export$3($export$3.S + $export$3.F * !
|
|
19095
|
+
$export$3($export$3.S + $export$3.F * !require_descriptors(), "Object", { defineProperty: require_objectDp().f });
|
|
19087
19096
|
var $Object$2 = _coreExports.Object;
|
|
19088
|
-
var defineProperty$9 = /* @__PURE__ */ __name(function
|
|
19097
|
+
var defineProperty$9 = /* @__PURE__ */ __name(function defineProperty2(it, key, desc) {
|
|
19089
19098
|
return $Object$2.defineProperty(it, key, desc);
|
|
19090
19099
|
}, "defineProperty");
|
|
19091
19100
|
var defineProperty$8 = { "default": defineProperty$9, __esModule: true };
|
|
@@ -19124,7 +19133,7 @@ var _meta = { exports: {} };
|
|
|
19124
19133
|
var META$1 = _uid("meta");
|
|
19125
19134
|
var isObject$c = _isObject;
|
|
19126
19135
|
var has$7 = _has;
|
|
19127
|
-
var setDesc =
|
|
19136
|
+
var setDesc = require_objectDp().f;
|
|
19128
19137
|
var id = 0;
|
|
19129
19138
|
var isExtensible = Object.isExtensible || function() {
|
|
19130
19139
|
return true;
|
|
@@ -19177,7 +19186,7 @@ var meta = _meta.exports = {
|
|
|
19177
19186
|
var _metaExports = _meta.exports;
|
|
19178
19187
|
var core = _coreExports;
|
|
19179
19188
|
var wksExt$1 = _wksExt;
|
|
19180
|
-
var defineProperty$7 =
|
|
19189
|
+
var defineProperty$7 = require_objectDp().f;
|
|
19181
19190
|
var _wksDefine = /* @__PURE__ */ __name(function(name) {
|
|
19182
19191
|
var $Symbol2 = core.Symbol || (core.Symbol = {});
|
|
19183
19192
|
if (name.charAt(0) != "_" && !(name in $Symbol2))
|
|
@@ -19185,7 +19194,7 @@ var _wksDefine = /* @__PURE__ */ __name(function(name) {
|
|
|
19185
19194
|
}, "_wksDefine");
|
|
19186
19195
|
var getKeys = _objectKeys;
|
|
19187
19196
|
var gOPS$1 = _objectGops;
|
|
19188
|
-
var pIE$1 =
|
|
19197
|
+
var pIE$1 = _objectPie;
|
|
19189
19198
|
var _enumKeys = /* @__PURE__ */ __name(function(it) {
|
|
19190
19199
|
var result = getKeys(it);
|
|
19191
19200
|
var getSymbols2 = gOPS$1.f;
|
|
@@ -19226,14 +19235,14 @@ _objectGopnExt.f = /* @__PURE__ */ __name(function getOwnPropertyNames2(it) {
|
|
|
19226
19235
|
return windowNames && toString$5.call(it) == "[object Window]" ? getWindowNames(it) : gOPN$1(toIObject$2(it));
|
|
19227
19236
|
}, "getOwnPropertyNames");
|
|
19228
19237
|
var _objectGopd = {};
|
|
19229
|
-
var pIE =
|
|
19238
|
+
var pIE = _objectPie;
|
|
19230
19239
|
var createDesc$1 = _propertyDesc;
|
|
19231
19240
|
var toIObject$1 = _toIobject;
|
|
19232
19241
|
var toPrimitive$1 = _toPrimitive;
|
|
19233
19242
|
var has$6 = _has;
|
|
19234
|
-
var IE8_DOM_DEFINE =
|
|
19243
|
+
var IE8_DOM_DEFINE = require_ie8DomDefine();
|
|
19235
19244
|
var gOPD$2 = Object.getOwnPropertyDescriptor;
|
|
19236
|
-
_objectGopd.f =
|
|
19245
|
+
_objectGopd.f = require_descriptors() ? gOPD$2 : /* @__PURE__ */ __name(function getOwnPropertyDescriptor(O2, P2) {
|
|
19237
19246
|
O2 = toIObject$1(O2);
|
|
19238
19247
|
P2 = toPrimitive$1(P2, true);
|
|
19239
19248
|
if (IE8_DOM_DEFINE)
|
|
@@ -19246,7 +19255,7 @@ _objectGopd.f = _descriptors ? gOPD$2 : /* @__PURE__ */ __name(function getOwnPr
|
|
|
19246
19255
|
}, "getOwnPropertyDescriptor");
|
|
19247
19256
|
var global$1 = _globalExports;
|
|
19248
19257
|
var has$5 = _has;
|
|
19249
|
-
var DESCRIPTORS =
|
|
19258
|
+
var DESCRIPTORS = require_descriptors();
|
|
19250
19259
|
var $export$2 = _export;
|
|
19251
19260
|
var redefine = _redefine;
|
|
19252
19261
|
var META = _metaExports.KEY;
|
|
@@ -19269,7 +19278,7 @@ var _create$1 = _objectCreate;
|
|
|
19269
19278
|
var gOPNExt = _objectGopnExt;
|
|
19270
19279
|
var $GOPD = _objectGopd;
|
|
19271
19280
|
var $GOPS = _objectGops;
|
|
19272
|
-
var $DP =
|
|
19281
|
+
var $DP = require_objectDp();
|
|
19273
19282
|
var $keys$1 = _objectKeys;
|
|
19274
19283
|
var gOPD$1 = $GOPD.f;
|
|
19275
19284
|
var dP = $DP.f;
|
|
@@ -19312,7 +19321,7 @@ var isSymbol$8 = USE_NATIVE && typeof $Symbol.iterator == "symbol" ? function(it
|
|
|
19312
19321
|
} : function(it) {
|
|
19313
19322
|
return it instanceof $Symbol;
|
|
19314
19323
|
};
|
|
19315
|
-
var $defineProperty = /* @__PURE__ */ __name(function
|
|
19324
|
+
var $defineProperty = /* @__PURE__ */ __name(function defineProperty3(it, key, D2) {
|
|
19316
19325
|
if (it === ObjectProto)
|
|
19317
19326
|
$defineProperty(OPSymbols, key, D2);
|
|
19318
19327
|
anObject(it);
|
|
@@ -19406,7 +19415,7 @@ if (!USE_NATIVE) {
|
|
|
19406
19415
|
$GOPD.f = $getOwnPropertyDescriptor;
|
|
19407
19416
|
$DP.f = $defineProperty;
|
|
19408
19417
|
_objectGopn.f = gOPNExt.f = $getOwnPropertyNames;
|
|
19409
|
-
|
|
19418
|
+
_objectPie.f = $propertyIsEnumerable;
|
|
19410
19419
|
$GOPS.f = $getOwnPropertySymbols;
|
|
19411
19420
|
if (DESCRIPTORS && !_library) {
|
|
19412
19421
|
redefine(ObjectProto, "propertyIsEnumerable", $propertyIsEnumerable);
|
|
@@ -55360,7 +55369,7 @@ var KNOWN_STATICS = {
|
|
|
55360
55369
|
arguments: true,
|
|
55361
55370
|
arity: true
|
|
55362
55371
|
};
|
|
55363
|
-
var
|
|
55372
|
+
var defineProperty4 = Object.defineProperty;
|
|
55364
55373
|
var getOwnPropertyNames4 = Object.getOwnPropertyNames;
|
|
55365
55374
|
var getOwnPropertySymbols3 = Object.getOwnPropertySymbols;
|
|
55366
55375
|
var getOwnPropertyDescriptor3 = Object.getOwnPropertyDescriptor;
|
|
@@ -55383,7 +55392,7 @@ function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
|
|
|
55383
55392
|
if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {
|
|
55384
55393
|
var descriptor2 = getOwnPropertyDescriptor3(sourceComponent, key);
|
|
55385
55394
|
try {
|
|
55386
|
-
|
|
55395
|
+
defineProperty4(targetComponent, key, descriptor2);
|
|
55387
55396
|
} catch (e2) {
|
|
55388
55397
|
}
|
|
55389
55398
|
}
|
|
@@ -56454,6 +56463,16 @@ const editCellHelper = /* @__PURE__ */ __name(({
|
|
|
56454
56463
|
lodashExports.set(entity, path2, nv);
|
|
56455
56464
|
return { entity, error };
|
|
56456
56465
|
}, "editCellHelper");
|
|
56466
|
+
const throwFormError = /* @__PURE__ */ __name((error) => {
|
|
56467
|
+
if (error.message) {
|
|
56468
|
+
console.error("error:", error);
|
|
56469
|
+
}
|
|
56470
|
+
const errorToUse = error.message ? { _error: error.message } : typeof error === "string" ? { _error: error } : error;
|
|
56471
|
+
if (!errorToUse._error) {
|
|
56472
|
+
errorToUse._error = "Error Submitting Form";
|
|
56473
|
+
}
|
|
56474
|
+
throw new reduxForm.SubmissionError(errorToUse);
|
|
56475
|
+
}, "throwFormError");
|
|
56457
56476
|
T();
|
|
56458
56477
|
const PRIMARY_SELECTED_VAL = "main_cell";
|
|
56459
56478
|
dayjs.extend(localizedFormat);
|
|
@@ -56951,7 +56970,12 @@ const _DataTable = class _DataTable extends React$1.Component {
|
|
|
56951
56970
|
const { change, schema } = computePresets(this.props);
|
|
56952
56971
|
change(
|
|
56953
56972
|
"reduxFormCellValidation",
|
|
56954
|
-
validateTableWideErrors({
|
|
56973
|
+
validateTableWideErrors({
|
|
56974
|
+
entities,
|
|
56975
|
+
schema,
|
|
56976
|
+
newCellValidate,
|
|
56977
|
+
props: this.props
|
|
56978
|
+
})
|
|
56955
56979
|
);
|
|
56956
56980
|
}, "updateValidation"));
|
|
56957
56981
|
__publicField(this, "handleDeleteCell", /* @__PURE__ */ __name(() => {
|
|
@@ -58313,10 +58337,38 @@ const _DataTable = class _DataTable extends React$1.Component {
|
|
|
58313
58337
|
indexToStartAt: entities2.length
|
|
58314
58338
|
}
|
|
58315
58339
|
);
|
|
58316
|
-
|
|
58340
|
+
if (lodashExports.every(entities2, "_isClean")) {
|
|
58341
|
+
lodashExports.forEach(newEnts, (e2, i) => {
|
|
58342
|
+
entities2[i] = e2;
|
|
58343
|
+
});
|
|
58344
|
+
} else {
|
|
58345
|
+
entities2.splice(entities2.length, 0, ...newEnts);
|
|
58346
|
+
}
|
|
58317
58347
|
this.updateValidation(entities2, __spreadValues(__spreadValues({}, reduxFormCellValidation), validationErrors));
|
|
58318
58348
|
});
|
|
58319
58349
|
}, "addEditableTableEntities"));
|
|
58350
|
+
__publicField(this, "getEditableTableInfoAndThrowFormError", /* @__PURE__ */ __name(() => {
|
|
58351
|
+
const { schema, reduxFormEntities, reduxFormCellValidation } = computePresets(this.props);
|
|
58352
|
+
const { entsToUse, validationToUse } = removeCleanRows(
|
|
58353
|
+
reduxFormEntities,
|
|
58354
|
+
reduxFormCellValidation
|
|
58355
|
+
);
|
|
58356
|
+
const validationWTableErrs = validateTableWideErrors({
|
|
58357
|
+
entities: entsToUse,
|
|
58358
|
+
schema,
|
|
58359
|
+
newCellValidate: validationToUse
|
|
58360
|
+
});
|
|
58361
|
+
if (!(entsToUse == null ? void 0 : entsToUse.length)) {
|
|
58362
|
+
throwFormError(
|
|
58363
|
+
"Please add at least one row to the table before submitting."
|
|
58364
|
+
);
|
|
58365
|
+
}
|
|
58366
|
+
const invalid = lodashExports.isEmpty(validationWTableErrs) || !lodashExports.some(validationWTableErrs, (v2) => v2) ? void 0 : validationWTableErrs;
|
|
58367
|
+
if (invalid) {
|
|
58368
|
+
throwFormError("Please fix the errors in the table before submitting.");
|
|
58369
|
+
}
|
|
58370
|
+
return entsToUse;
|
|
58371
|
+
}, "getEditableTableInfoAndThrowFormError"));
|
|
58320
58372
|
__publicField(this, "insertRows", /* @__PURE__ */ __name(({ above, numRows = 1, appendToBottom } = {}) => {
|
|
58321
58373
|
const { entities = [], reduxFormCellValidation } = computePresets(
|
|
58322
58374
|
this.props
|
|
@@ -58711,6 +58763,7 @@ const _DataTable = class _DataTable extends React$1.Component {
|
|
|
58711
58763
|
}, "renderColumnHeader"));
|
|
58712
58764
|
if (this.props.helperProp) {
|
|
58713
58765
|
this.props.helperProp.addEditableTableEntities = this.addEditableTableEntities;
|
|
58766
|
+
this.props.helperProp.getEditableTableInfoAndThrowFormError = this.getEditableTableInfoAndThrowFormError;
|
|
58714
58767
|
}
|
|
58715
58768
|
this.hotkeyEnabler = withHotkeys(__spreadProps(__spreadValues({
|
|
58716
58769
|
moveUpARow: {
|
|
@@ -59722,6 +59775,26 @@ const formatPasteData = /* @__PURE__ */ __name(({ schema, newVal, path: path2 })
|
|
|
59722
59775
|
}
|
|
59723
59776
|
return newVal;
|
|
59724
59777
|
}, "formatPasteData");
|
|
59778
|
+
function removeCleanRows(reduxFormEntities, reduxFormCellValidation) {
|
|
59779
|
+
const toFilterOut = {};
|
|
59780
|
+
const entsToUse = (reduxFormEntities || []).filter((e2) => {
|
|
59781
|
+
if (!(e2._isClean || isEntityClean(e2)))
|
|
59782
|
+
return true;
|
|
59783
|
+
else {
|
|
59784
|
+
toFilterOut[getIdOrCodeOrIndex(e2)] = true;
|
|
59785
|
+
return false;
|
|
59786
|
+
}
|
|
59787
|
+
});
|
|
59788
|
+
const validationToUse = {};
|
|
59789
|
+
lodashExports.forEach(reduxFormCellValidation, (v2, k2) => {
|
|
59790
|
+
const [rowId] = k2.split(":");
|
|
59791
|
+
if (!toFilterOut[rowId]) {
|
|
59792
|
+
validationToUse[k2] = v2;
|
|
59793
|
+
}
|
|
59794
|
+
});
|
|
59795
|
+
return { entsToUse, validationToUse };
|
|
59796
|
+
}
|
|
59797
|
+
__name(removeCleanRows, "removeCleanRows");
|
|
59725
59798
|
const wrapDialog = /* @__PURE__ */ __name((topLevelDialogProps = {}) => (Component) => (props) => {
|
|
59726
59799
|
const r2 = React$1.useRef();
|
|
59727
59800
|
const memoedHotkeys = React$1.useMemo(
|
|
@@ -62251,26 +62324,6 @@ function asyncValidateHelper(validateAgainstSchema, currentEnts, changeForm, tab
|
|
|
62251
62324
|
});
|
|
62252
62325
|
}
|
|
62253
62326
|
__name(asyncValidateHelper, "asyncValidateHelper");
|
|
62254
|
-
function removeCleanRows(reduxFormEntities, reduxFormCellValidation) {
|
|
62255
|
-
const toFilterOut = {};
|
|
62256
|
-
const entsToUse = (reduxFormEntities || []).filter((e2) => {
|
|
62257
|
-
if (!(e2._isClean || isEntityClean(e2)))
|
|
62258
|
-
return true;
|
|
62259
|
-
else {
|
|
62260
|
-
toFilterOut[getIdOrCodeOrIndex(e2)] = true;
|
|
62261
|
-
return false;
|
|
62262
|
-
}
|
|
62263
|
-
});
|
|
62264
|
-
const validationToUse = {};
|
|
62265
|
-
lodashExports.forEach(reduxFormCellValidation, (v2, k2) => {
|
|
62266
|
-
const [rowId] = k2.split(":");
|
|
62267
|
-
if (!toFilterOut[rowId]) {
|
|
62268
|
-
validationToUse[k2] = v2;
|
|
62269
|
-
}
|
|
62270
|
-
});
|
|
62271
|
-
return { entsToUse, validationToUse };
|
|
62272
|
-
}
|
|
62273
|
-
__name(removeCleanRows, "removeCleanRows");
|
|
62274
62327
|
function maybeStripIdFromEntities(ents, validateAgainstSchema) {
|
|
62275
62328
|
var _a2;
|
|
62276
62329
|
let toRet;
|
|
@@ -78977,6 +79030,7 @@ exports.strainIcon = strainIcon;
|
|
|
78977
79030
|
exports.tgFormValueSelector = tgFormValueSelector;
|
|
78978
79031
|
exports.tgFormValues = tgFormValues;
|
|
78979
79032
|
exports.tg_modalState = tg_modalState;
|
|
79033
|
+
exports.throwFormError = throwFormError;
|
|
78980
79034
|
exports.tickMenuEnhancer = tickMenuEnhancer;
|
|
78981
79035
|
exports.tubeIcon = tubeIcon;
|
|
78982
79036
|
exports.useDialog = useDialog;
|
package/index.es.js
CHANGED
|
@@ -60,7 +60,7 @@ import * as React$1 from "react";
|
|
|
60
60
|
import React__default, { forwardRef, useImperativeHandle, Fragment, useMemo, useRef, useReducer, useEffect, useCallback, useState, memo, Component, PureComponent, createElement, isValidElement, useContext } from "react";
|
|
61
61
|
import { Icon, Classes, Button, Intent, Keys, MenuItem, Tag, useHotkeys, Popover, Tooltip, Toaster, Position, Menu, MenuDivider, NumericInput, InputGroup, Spinner, FormGroup, TextArea, Checkbox, Switch, EditableText, RadioGroup, Callout, ContextMenu, Dialog, Card, Tabs, Tab, Colors, Overlay, KeyCombo, ProgressBar } from "@blueprintjs/core";
|
|
62
62
|
import ReactDOM, { unstable_batchedUpdates, findDOMNode as findDOMNode$1 } from "react-dom";
|
|
63
|
-
import { FormName, formValueSelector, change, Field, reduxForm, destroy, initialize, Fields } from "redux-form";
|
|
63
|
+
import { FormName, formValueSelector, change, Field, reduxForm, SubmissionError, destroy, initialize, Fields } from "redux-form";
|
|
64
64
|
import { connect, useStore } from "react-redux";
|
|
65
65
|
import { getCreateNewItem, MultiSelect, Suggest } from "@blueprintjs/select";
|
|
66
66
|
import { DateRangeInput, DateInput } from "@blueprintjs/datetime";
|
|
@@ -6811,10 +6811,10 @@ var ownKeys$3 = typeof Reflect !== "undefined" && Reflect.ownKeys ? Reflect.ownK
|
|
|
6811
6811
|
/* istanbul ignore next */
|
|
6812
6812
|
Object.getOwnPropertyNames
|
|
6813
6813
|
);
|
|
6814
|
-
function toPrimitive$
|
|
6814
|
+
function toPrimitive$2(value) {
|
|
6815
6815
|
return value === null ? null : typeof value === "object" ? "" + value : value;
|
|
6816
6816
|
}
|
|
6817
|
-
__name(toPrimitive$
|
|
6817
|
+
__name(toPrimitive$2, "toPrimitive$2");
|
|
6818
6818
|
function hasProp(target, prop) {
|
|
6819
6819
|
return objectPrototype$1.hasOwnProperty.call(target, prop);
|
|
6820
6820
|
}
|
|
@@ -7711,7 +7711,7 @@ var ObservableValue = /* @__PURE__ */ function(_Atom) {
|
|
|
7711
7711
|
return this.name_ + "[" + this.value_ + "]";
|
|
7712
7712
|
}, "toString");
|
|
7713
7713
|
_proto.valueOf = /* @__PURE__ */ __name(function valueOf() {
|
|
7714
|
-
return toPrimitive$
|
|
7714
|
+
return toPrimitive$2(this.get());
|
|
7715
7715
|
}, "valueOf");
|
|
7716
7716
|
_proto[_Symbol$toPrimitive] = function() {
|
|
7717
7717
|
return this.valueOf();
|
|
@@ -7896,7 +7896,7 @@ var ComputedValue = /* @__PURE__ */ function() {
|
|
|
7896
7896
|
return this.name_ + "[" + this.derivation.toString() + "]";
|
|
7897
7897
|
}, "toString");
|
|
7898
7898
|
_proto.valueOf = /* @__PURE__ */ __name(function valueOf() {
|
|
7899
|
-
return toPrimitive$
|
|
7899
|
+
return toPrimitive$2(this.get());
|
|
7900
7900
|
}, "valueOf");
|
|
7901
7901
|
_proto[_Symbol$toPrimitive$1] = function() {
|
|
7902
7902
|
return this.valueOf();
|
|
@@ -12530,7 +12530,7 @@ lodash.exports;
|
|
|
12530
12530
|
"^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar2, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
12531
12531
|
);
|
|
12532
12532
|
var Buffer2 = moduleExports2 ? context.Buffer : undefined$12, Symbol2 = context.Symbol, Uint8Array2 = context.Uint8Array, allocUnsafe2 = Buffer2 ? Buffer2.allocUnsafe : undefined$12, getPrototype2 = overArg2(Object2.getPrototypeOf, Object2), objectCreate2 = Object2.create, propertyIsEnumerable3 = objectProto2.propertyIsEnumerable, splice3 = arrayProto2.splice, spreadableSymbol2 = Symbol2 ? Symbol2.isConcatSpreadable : undefined$12, symIterator = Symbol2 ? Symbol2.iterator : undefined$12, symToStringTag2 = Symbol2 ? Symbol2.toStringTag : undefined$12;
|
|
12533
|
-
var
|
|
12533
|
+
var defineProperty5 = function() {
|
|
12534
12534
|
try {
|
|
12535
12535
|
var func = getNative2(Object2, "defineProperty");
|
|
12536
12536
|
func({}, "", {});
|
|
@@ -12970,8 +12970,8 @@ lodash.exports;
|
|
|
12970
12970
|
}
|
|
12971
12971
|
__name(baseAssignIn2, "baseAssignIn");
|
|
12972
12972
|
function baseAssignValue2(object2, key, value) {
|
|
12973
|
-
if (key == "__proto__" &&
|
|
12974
|
-
|
|
12973
|
+
if (key == "__proto__" && defineProperty5) {
|
|
12974
|
+
defineProperty5(object2, key, {
|
|
12975
12975
|
"configurable": true,
|
|
12976
12976
|
"enumerable": true,
|
|
12977
12977
|
"value": value,
|
|
@@ -13704,8 +13704,8 @@ lodash.exports;
|
|
|
13704
13704
|
metaMap.set(func, data);
|
|
13705
13705
|
return func;
|
|
13706
13706
|
};
|
|
13707
|
-
var baseSetToString2 = !
|
|
13708
|
-
return
|
|
13707
|
+
var baseSetToString2 = !defineProperty5 ? identity3 : function(func, string2) {
|
|
13708
|
+
return defineProperty5(func, "toString", {
|
|
13709
13709
|
"configurable": true,
|
|
13710
13710
|
"enumerable": false,
|
|
13711
13711
|
"value": constant2(string2),
|
|
@@ -18254,11 +18254,20 @@ var _fails = /* @__PURE__ */ __name(function(exec) {
|
|
|
18254
18254
|
return true;
|
|
18255
18255
|
}
|
|
18256
18256
|
}, "_fails");
|
|
18257
|
-
var _descriptors
|
|
18258
|
-
|
|
18259
|
-
|
|
18260
|
-
|
|
18261
|
-
|
|
18257
|
+
var _descriptors;
|
|
18258
|
+
var hasRequired_descriptors;
|
|
18259
|
+
function require_descriptors() {
|
|
18260
|
+
if (hasRequired_descriptors)
|
|
18261
|
+
return _descriptors;
|
|
18262
|
+
hasRequired_descriptors = 1;
|
|
18263
|
+
_descriptors = !_fails(function() {
|
|
18264
|
+
return Object.defineProperty({}, "a", { get: function() {
|
|
18265
|
+
return 7;
|
|
18266
|
+
} }).a != 7;
|
|
18267
|
+
});
|
|
18268
|
+
return _descriptors;
|
|
18269
|
+
}
|
|
18270
|
+
__name(require_descriptors, "require_descriptors");
|
|
18262
18271
|
var _domCreate;
|
|
18263
18272
|
var hasRequired_domCreate;
|
|
18264
18273
|
function require_domCreate() {
|
|
@@ -18274,11 +18283,20 @@ function require_domCreate() {
|
|
|
18274
18283
|
return _domCreate;
|
|
18275
18284
|
}
|
|
18276
18285
|
__name(require_domCreate, "require_domCreate");
|
|
18277
|
-
var _ie8DomDefine
|
|
18278
|
-
|
|
18279
|
-
|
|
18280
|
-
|
|
18281
|
-
|
|
18286
|
+
var _ie8DomDefine;
|
|
18287
|
+
var hasRequired_ie8DomDefine;
|
|
18288
|
+
function require_ie8DomDefine() {
|
|
18289
|
+
if (hasRequired_ie8DomDefine)
|
|
18290
|
+
return _ie8DomDefine;
|
|
18291
|
+
hasRequired_ie8DomDefine = 1;
|
|
18292
|
+
_ie8DomDefine = !require_descriptors() && !_fails(function() {
|
|
18293
|
+
return Object.defineProperty(require_domCreate()("div"), "a", { get: function() {
|
|
18294
|
+
return 7;
|
|
18295
|
+
} }).a != 7;
|
|
18296
|
+
});
|
|
18297
|
+
return _ie8DomDefine;
|
|
18298
|
+
}
|
|
18299
|
+
__name(require_ie8DomDefine, "require_ie8DomDefine");
|
|
18282
18300
|
var isObject$d = _isObject;
|
|
18283
18301
|
var _toPrimitive = /* @__PURE__ */ __name(function(it, S2) {
|
|
18284
18302
|
if (!isObject$d(it))
|
|
@@ -18292,25 +18310,33 @@ var _toPrimitive = /* @__PURE__ */ __name(function(it, S2) {
|
|
|
18292
18310
|
return val;
|
|
18293
18311
|
throw TypeError("Can't convert object to primitive value");
|
|
18294
18312
|
}, "_toPrimitive");
|
|
18295
|
-
var
|
|
18296
|
-
|
|
18297
|
-
|
|
18298
|
-
|
|
18299
|
-
|
|
18300
|
-
|
|
18301
|
-
|
|
18302
|
-
|
|
18303
|
-
|
|
18304
|
-
|
|
18305
|
-
|
|
18306
|
-
|
|
18307
|
-
|
|
18308
|
-
|
|
18309
|
-
|
|
18310
|
-
|
|
18311
|
-
|
|
18312
|
-
|
|
18313
|
-
|
|
18313
|
+
var hasRequired_objectDp;
|
|
18314
|
+
function require_objectDp() {
|
|
18315
|
+
if (hasRequired_objectDp)
|
|
18316
|
+
return _objectDp;
|
|
18317
|
+
hasRequired_objectDp = 1;
|
|
18318
|
+
var anObject2 = _anObject;
|
|
18319
|
+
var IE8_DOM_DEFINE2 = require_ie8DomDefine();
|
|
18320
|
+
var toPrimitive2 = _toPrimitive;
|
|
18321
|
+
var dP2 = Object.defineProperty;
|
|
18322
|
+
_objectDp.f = require_descriptors() ? Object.defineProperty : /* @__PURE__ */ __name(function defineProperty5(O2, P2, Attributes) {
|
|
18323
|
+
anObject2(O2);
|
|
18324
|
+
P2 = toPrimitive2(P2, true);
|
|
18325
|
+
anObject2(Attributes);
|
|
18326
|
+
if (IE8_DOM_DEFINE2)
|
|
18327
|
+
try {
|
|
18328
|
+
return dP2(O2, P2, Attributes);
|
|
18329
|
+
} catch (e2) {
|
|
18330
|
+
}
|
|
18331
|
+
if ("get" in Attributes || "set" in Attributes)
|
|
18332
|
+
throw TypeError("Accessors not supported!");
|
|
18333
|
+
if ("value" in Attributes)
|
|
18334
|
+
O2[P2] = Attributes.value;
|
|
18335
|
+
return O2;
|
|
18336
|
+
}, "defineProperty");
|
|
18337
|
+
return _objectDp;
|
|
18338
|
+
}
|
|
18339
|
+
__name(require_objectDp, "require_objectDp");
|
|
18314
18340
|
var _propertyDesc = /* @__PURE__ */ __name(function(bitmap, value) {
|
|
18315
18341
|
return {
|
|
18316
18342
|
enumerable: !(bitmap & 1),
|
|
@@ -18319,9 +18345,9 @@ var _propertyDesc = /* @__PURE__ */ __name(function(bitmap, value) {
|
|
|
18319
18345
|
value
|
|
18320
18346
|
};
|
|
18321
18347
|
}, "_propertyDesc");
|
|
18322
|
-
var dP$2 =
|
|
18348
|
+
var dP$2 = require_objectDp();
|
|
18323
18349
|
var createDesc$3 = _propertyDesc;
|
|
18324
|
-
var _hide =
|
|
18350
|
+
var _hide = require_descriptors() ? function(object2, key, value) {
|
|
18325
18351
|
return dP$2.f(object2, key, createDesc$3(1, value));
|
|
18326
18352
|
} : function(object2, key, value) {
|
|
18327
18353
|
object2[key] = value;
|
|
@@ -18393,25 +18419,16 @@ var toString$6 = {}.toString;
|
|
|
18393
18419
|
var _cof = /* @__PURE__ */ __name(function(it) {
|
|
18394
18420
|
return toString$6.call(it).slice(8, -1);
|
|
18395
18421
|
}, "_cof");
|
|
18396
|
-
var
|
|
18397
|
-
var
|
|
18398
|
-
|
|
18399
|
-
|
|
18400
|
-
return _iobject;
|
|
18401
|
-
hasRequired_iobject = 1;
|
|
18402
|
-
var cof2 = _cof;
|
|
18403
|
-
_iobject = Object("z").propertyIsEnumerable(0) ? Object : function(it) {
|
|
18404
|
-
return cof2(it) == "String" ? it.split("") : Object(it);
|
|
18405
|
-
};
|
|
18406
|
-
return _iobject;
|
|
18407
|
-
}
|
|
18408
|
-
__name(require_iobject, "require_iobject");
|
|
18422
|
+
var cof$2 = _cof;
|
|
18423
|
+
var _iobject = Object("z").propertyIsEnumerable(0) ? Object : function(it) {
|
|
18424
|
+
return cof$2(it) == "String" ? it.split("") : Object(it);
|
|
18425
|
+
};
|
|
18409
18426
|
var _defined = /* @__PURE__ */ __name(function(it) {
|
|
18410
18427
|
if (it == void 0)
|
|
18411
18428
|
throw TypeError("Can't call method on " + it);
|
|
18412
18429
|
return it;
|
|
18413
18430
|
}, "_defined");
|
|
18414
|
-
var IObject =
|
|
18431
|
+
var IObject = _iobject;
|
|
18415
18432
|
var defined$2 = _defined;
|
|
18416
18433
|
var _toIobject = /* @__PURE__ */ __name(function(it) {
|
|
18417
18434
|
return IObject(defined$2(it));
|
|
@@ -18508,15 +18525,7 @@ var _objectKeys = Object.keys || /* @__PURE__ */ __name(function keys(O2) {
|
|
|
18508
18525
|
var _objectGops = {};
|
|
18509
18526
|
_objectGops.f = Object.getOwnPropertySymbols;
|
|
18510
18527
|
var _objectPie = {};
|
|
18511
|
-
|
|
18512
|
-
function require_objectPie() {
|
|
18513
|
-
if (hasRequired_objectPie)
|
|
18514
|
-
return _objectPie;
|
|
18515
|
-
hasRequired_objectPie = 1;
|
|
18516
|
-
_objectPie.f = {}.propertyIsEnumerable;
|
|
18517
|
-
return _objectPie;
|
|
18518
|
-
}
|
|
18519
|
-
__name(require_objectPie, "require_objectPie");
|
|
18528
|
+
_objectPie.f = {}.propertyIsEnumerable;
|
|
18520
18529
|
var defined$1 = _defined;
|
|
18521
18530
|
var _toObject = /* @__PURE__ */ __name(function(it) {
|
|
18522
18531
|
return Object(defined$1(it));
|
|
@@ -18527,12 +18536,12 @@ function require_objectAssign() {
|
|
|
18527
18536
|
if (hasRequired_objectAssign)
|
|
18528
18537
|
return _objectAssign;
|
|
18529
18538
|
hasRequired_objectAssign = 1;
|
|
18530
|
-
var DESCRIPTORS2 =
|
|
18539
|
+
var DESCRIPTORS2 = require_descriptors();
|
|
18531
18540
|
var getKeys2 = _objectKeys;
|
|
18532
18541
|
var gOPS2 = _objectGops;
|
|
18533
|
-
var pIE2 =
|
|
18542
|
+
var pIE2 = _objectPie;
|
|
18534
18543
|
var toObject2 = _toObject;
|
|
18535
|
-
var IObject2 =
|
|
18544
|
+
var IObject2 = _iobject;
|
|
18536
18545
|
var $assign = Object.assign;
|
|
18537
18546
|
_objectAssign = !$assign || _fails(function() {
|
|
18538
18547
|
var A2 = {};
|
|
@@ -18593,10 +18602,10 @@ var _iterStep = /* @__PURE__ */ __name(function(done, value) {
|
|
|
18593
18602
|
}, "_iterStep");
|
|
18594
18603
|
var _iterators = {};
|
|
18595
18604
|
var _redefine = _hide;
|
|
18596
|
-
var dP$1 =
|
|
18605
|
+
var dP$1 = require_objectDp();
|
|
18597
18606
|
var anObject$4 = _anObject;
|
|
18598
18607
|
var getKeys$1 = _objectKeys;
|
|
18599
|
-
var _objectDps =
|
|
18608
|
+
var _objectDps = require_descriptors() ? Object.defineProperties : /* @__PURE__ */ __name(function defineProperties(O2, Properties) {
|
|
18600
18609
|
anObject$4(O2);
|
|
18601
18610
|
var keys3 = getKeys$1(Properties);
|
|
18602
18611
|
var length = keys3.length;
|
|
@@ -18663,7 +18672,7 @@ var $exports = _wks.exports = function(name) {
|
|
|
18663
18672
|
};
|
|
18664
18673
|
$exports.store = store;
|
|
18665
18674
|
var _wksExports = _wks.exports;
|
|
18666
|
-
var def =
|
|
18675
|
+
var def = require_objectDp().f;
|
|
18667
18676
|
var has$9 = _has;
|
|
18668
18677
|
var TAG$1 = _wksExports("toStringTag");
|
|
18669
18678
|
var _setToStringTag = /* @__PURE__ */ __name(function(it, tag, stat) {
|
|
@@ -18936,7 +18945,7 @@ var ArrayProto = Array.prototype;
|
|
|
18936
18945
|
var _isArrayIter = /* @__PURE__ */ __name(function(it) {
|
|
18937
18946
|
return it !== void 0 && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
|
|
18938
18947
|
}, "_isArrayIter");
|
|
18939
|
-
var $defineProperty$1 =
|
|
18948
|
+
var $defineProperty$1 = require_objectDp();
|
|
18940
18949
|
var createDesc$2 = _propertyDesc;
|
|
18941
18950
|
var _createProperty = /* @__PURE__ */ __name(function(object2, index2, value) {
|
|
18942
18951
|
if (index2 in object2)
|
|
@@ -19065,9 +19074,9 @@ var _default$8 = /* @__PURE__ */ __name(function(instance, Constructor) {
|
|
|
19065
19074
|
}
|
|
19066
19075
|
}, "_default$8");
|
|
19067
19076
|
var $export$3 = _export;
|
|
19068
|
-
$export$3($export$3.S + $export$3.F * !
|
|
19077
|
+
$export$3($export$3.S + $export$3.F * !require_descriptors(), "Object", { defineProperty: require_objectDp().f });
|
|
19069
19078
|
var $Object$2 = _coreExports.Object;
|
|
19070
|
-
var defineProperty$9 = /* @__PURE__ */ __name(function
|
|
19079
|
+
var defineProperty$9 = /* @__PURE__ */ __name(function defineProperty2(it, key, desc) {
|
|
19071
19080
|
return $Object$2.defineProperty(it, key, desc);
|
|
19072
19081
|
}, "defineProperty");
|
|
19073
19082
|
var defineProperty$8 = { "default": defineProperty$9, __esModule: true };
|
|
@@ -19106,7 +19115,7 @@ var _meta = { exports: {} };
|
|
|
19106
19115
|
var META$1 = _uid("meta");
|
|
19107
19116
|
var isObject$c = _isObject;
|
|
19108
19117
|
var has$7 = _has;
|
|
19109
|
-
var setDesc =
|
|
19118
|
+
var setDesc = require_objectDp().f;
|
|
19110
19119
|
var id = 0;
|
|
19111
19120
|
var isExtensible = Object.isExtensible || function() {
|
|
19112
19121
|
return true;
|
|
@@ -19159,7 +19168,7 @@ var meta = _meta.exports = {
|
|
|
19159
19168
|
var _metaExports = _meta.exports;
|
|
19160
19169
|
var core = _coreExports;
|
|
19161
19170
|
var wksExt$1 = _wksExt;
|
|
19162
|
-
var defineProperty$7 =
|
|
19171
|
+
var defineProperty$7 = require_objectDp().f;
|
|
19163
19172
|
var _wksDefine = /* @__PURE__ */ __name(function(name) {
|
|
19164
19173
|
var $Symbol2 = core.Symbol || (core.Symbol = {});
|
|
19165
19174
|
if (name.charAt(0) != "_" && !(name in $Symbol2))
|
|
@@ -19167,7 +19176,7 @@ var _wksDefine = /* @__PURE__ */ __name(function(name) {
|
|
|
19167
19176
|
}, "_wksDefine");
|
|
19168
19177
|
var getKeys = _objectKeys;
|
|
19169
19178
|
var gOPS$1 = _objectGops;
|
|
19170
|
-
var pIE$1 =
|
|
19179
|
+
var pIE$1 = _objectPie;
|
|
19171
19180
|
var _enumKeys = /* @__PURE__ */ __name(function(it) {
|
|
19172
19181
|
var result = getKeys(it);
|
|
19173
19182
|
var getSymbols2 = gOPS$1.f;
|
|
@@ -19208,14 +19217,14 @@ _objectGopnExt.f = /* @__PURE__ */ __name(function getOwnPropertyNames2(it) {
|
|
|
19208
19217
|
return windowNames && toString$5.call(it) == "[object Window]" ? getWindowNames(it) : gOPN$1(toIObject$2(it));
|
|
19209
19218
|
}, "getOwnPropertyNames");
|
|
19210
19219
|
var _objectGopd = {};
|
|
19211
|
-
var pIE =
|
|
19220
|
+
var pIE = _objectPie;
|
|
19212
19221
|
var createDesc$1 = _propertyDesc;
|
|
19213
19222
|
var toIObject$1 = _toIobject;
|
|
19214
19223
|
var toPrimitive$1 = _toPrimitive;
|
|
19215
19224
|
var has$6 = _has;
|
|
19216
|
-
var IE8_DOM_DEFINE =
|
|
19225
|
+
var IE8_DOM_DEFINE = require_ie8DomDefine();
|
|
19217
19226
|
var gOPD$2 = Object.getOwnPropertyDescriptor;
|
|
19218
|
-
_objectGopd.f =
|
|
19227
|
+
_objectGopd.f = require_descriptors() ? gOPD$2 : /* @__PURE__ */ __name(function getOwnPropertyDescriptor(O2, P2) {
|
|
19219
19228
|
O2 = toIObject$1(O2);
|
|
19220
19229
|
P2 = toPrimitive$1(P2, true);
|
|
19221
19230
|
if (IE8_DOM_DEFINE)
|
|
@@ -19228,7 +19237,7 @@ _objectGopd.f = _descriptors ? gOPD$2 : /* @__PURE__ */ __name(function getOwnPr
|
|
|
19228
19237
|
}, "getOwnPropertyDescriptor");
|
|
19229
19238
|
var global$1 = _globalExports;
|
|
19230
19239
|
var has$5 = _has;
|
|
19231
|
-
var DESCRIPTORS =
|
|
19240
|
+
var DESCRIPTORS = require_descriptors();
|
|
19232
19241
|
var $export$2 = _export;
|
|
19233
19242
|
var redefine = _redefine;
|
|
19234
19243
|
var META = _metaExports.KEY;
|
|
@@ -19251,7 +19260,7 @@ var _create$1 = _objectCreate;
|
|
|
19251
19260
|
var gOPNExt = _objectGopnExt;
|
|
19252
19261
|
var $GOPD = _objectGopd;
|
|
19253
19262
|
var $GOPS = _objectGops;
|
|
19254
|
-
var $DP =
|
|
19263
|
+
var $DP = require_objectDp();
|
|
19255
19264
|
var $keys$1 = _objectKeys;
|
|
19256
19265
|
var gOPD$1 = $GOPD.f;
|
|
19257
19266
|
var dP = $DP.f;
|
|
@@ -19294,7 +19303,7 @@ var isSymbol$8 = USE_NATIVE && typeof $Symbol.iterator == "symbol" ? function(it
|
|
|
19294
19303
|
} : function(it) {
|
|
19295
19304
|
return it instanceof $Symbol;
|
|
19296
19305
|
};
|
|
19297
|
-
var $defineProperty = /* @__PURE__ */ __name(function
|
|
19306
|
+
var $defineProperty = /* @__PURE__ */ __name(function defineProperty3(it, key, D2) {
|
|
19298
19307
|
if (it === ObjectProto)
|
|
19299
19308
|
$defineProperty(OPSymbols, key, D2);
|
|
19300
19309
|
anObject(it);
|
|
@@ -19388,7 +19397,7 @@ if (!USE_NATIVE) {
|
|
|
19388
19397
|
$GOPD.f = $getOwnPropertyDescriptor;
|
|
19389
19398
|
$DP.f = $defineProperty;
|
|
19390
19399
|
_objectGopn.f = gOPNExt.f = $getOwnPropertyNames;
|
|
19391
|
-
|
|
19400
|
+
_objectPie.f = $propertyIsEnumerable;
|
|
19392
19401
|
$GOPS.f = $getOwnPropertySymbols;
|
|
19393
19402
|
if (DESCRIPTORS && !_library) {
|
|
19394
19403
|
redefine(ObjectProto, "propertyIsEnumerable", $propertyIsEnumerable);
|
|
@@ -55342,7 +55351,7 @@ var KNOWN_STATICS = {
|
|
|
55342
55351
|
arguments: true,
|
|
55343
55352
|
arity: true
|
|
55344
55353
|
};
|
|
55345
|
-
var
|
|
55354
|
+
var defineProperty4 = Object.defineProperty;
|
|
55346
55355
|
var getOwnPropertyNames4 = Object.getOwnPropertyNames;
|
|
55347
55356
|
var getOwnPropertySymbols3 = Object.getOwnPropertySymbols;
|
|
55348
55357
|
var getOwnPropertyDescriptor3 = Object.getOwnPropertyDescriptor;
|
|
@@ -55365,7 +55374,7 @@ function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
|
|
|
55365
55374
|
if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {
|
|
55366
55375
|
var descriptor2 = getOwnPropertyDescriptor3(sourceComponent, key);
|
|
55367
55376
|
try {
|
|
55368
|
-
|
|
55377
|
+
defineProperty4(targetComponent, key, descriptor2);
|
|
55369
55378
|
} catch (e2) {
|
|
55370
55379
|
}
|
|
55371
55380
|
}
|
|
@@ -56436,6 +56445,16 @@ const editCellHelper = /* @__PURE__ */ __name(({
|
|
|
56436
56445
|
lodashExports.set(entity, path2, nv);
|
|
56437
56446
|
return { entity, error };
|
|
56438
56447
|
}, "editCellHelper");
|
|
56448
|
+
const throwFormError = /* @__PURE__ */ __name((error) => {
|
|
56449
|
+
if (error.message) {
|
|
56450
|
+
console.error("error:", error);
|
|
56451
|
+
}
|
|
56452
|
+
const errorToUse = error.message ? { _error: error.message } : typeof error === "string" ? { _error: error } : error;
|
|
56453
|
+
if (!errorToUse._error) {
|
|
56454
|
+
errorToUse._error = "Error Submitting Form";
|
|
56455
|
+
}
|
|
56456
|
+
throw new SubmissionError(errorToUse);
|
|
56457
|
+
}, "throwFormError");
|
|
56439
56458
|
T();
|
|
56440
56459
|
const PRIMARY_SELECTED_VAL = "main_cell";
|
|
56441
56460
|
dayjs.extend(localizedFormat);
|
|
@@ -56933,7 +56952,12 @@ const _DataTable = class _DataTable extends React__default.Component {
|
|
|
56933
56952
|
const { change: change2, schema } = computePresets(this.props);
|
|
56934
56953
|
change2(
|
|
56935
56954
|
"reduxFormCellValidation",
|
|
56936
|
-
validateTableWideErrors({
|
|
56955
|
+
validateTableWideErrors({
|
|
56956
|
+
entities,
|
|
56957
|
+
schema,
|
|
56958
|
+
newCellValidate,
|
|
56959
|
+
props: this.props
|
|
56960
|
+
})
|
|
56937
56961
|
);
|
|
56938
56962
|
}, "updateValidation"));
|
|
56939
56963
|
__publicField(this, "handleDeleteCell", /* @__PURE__ */ __name(() => {
|
|
@@ -58295,10 +58319,38 @@ const _DataTable = class _DataTable extends React__default.Component {
|
|
|
58295
58319
|
indexToStartAt: entities2.length
|
|
58296
58320
|
}
|
|
58297
58321
|
);
|
|
58298
|
-
|
|
58322
|
+
if (lodashExports.every(entities2, "_isClean")) {
|
|
58323
|
+
lodashExports.forEach(newEnts, (e2, i) => {
|
|
58324
|
+
entities2[i] = e2;
|
|
58325
|
+
});
|
|
58326
|
+
} else {
|
|
58327
|
+
entities2.splice(entities2.length, 0, ...newEnts);
|
|
58328
|
+
}
|
|
58299
58329
|
this.updateValidation(entities2, __spreadValues(__spreadValues({}, reduxFormCellValidation), validationErrors));
|
|
58300
58330
|
});
|
|
58301
58331
|
}, "addEditableTableEntities"));
|
|
58332
|
+
__publicField(this, "getEditableTableInfoAndThrowFormError", /* @__PURE__ */ __name(() => {
|
|
58333
|
+
const { schema, reduxFormEntities, reduxFormCellValidation } = computePresets(this.props);
|
|
58334
|
+
const { entsToUse, validationToUse } = removeCleanRows(
|
|
58335
|
+
reduxFormEntities,
|
|
58336
|
+
reduxFormCellValidation
|
|
58337
|
+
);
|
|
58338
|
+
const validationWTableErrs = validateTableWideErrors({
|
|
58339
|
+
entities: entsToUse,
|
|
58340
|
+
schema,
|
|
58341
|
+
newCellValidate: validationToUse
|
|
58342
|
+
});
|
|
58343
|
+
if (!(entsToUse == null ? void 0 : entsToUse.length)) {
|
|
58344
|
+
throwFormError(
|
|
58345
|
+
"Please add at least one row to the table before submitting."
|
|
58346
|
+
);
|
|
58347
|
+
}
|
|
58348
|
+
const invalid = lodashExports.isEmpty(validationWTableErrs) || !lodashExports.some(validationWTableErrs, (v2) => v2) ? void 0 : validationWTableErrs;
|
|
58349
|
+
if (invalid) {
|
|
58350
|
+
throwFormError("Please fix the errors in the table before submitting.");
|
|
58351
|
+
}
|
|
58352
|
+
return entsToUse;
|
|
58353
|
+
}, "getEditableTableInfoAndThrowFormError"));
|
|
58302
58354
|
__publicField(this, "insertRows", /* @__PURE__ */ __name(({ above, numRows = 1, appendToBottom } = {}) => {
|
|
58303
58355
|
const { entities = [], reduxFormCellValidation } = computePresets(
|
|
58304
58356
|
this.props
|
|
@@ -58693,6 +58745,7 @@ const _DataTable = class _DataTable extends React__default.Component {
|
|
|
58693
58745
|
}, "renderColumnHeader"));
|
|
58694
58746
|
if (this.props.helperProp) {
|
|
58695
58747
|
this.props.helperProp.addEditableTableEntities = this.addEditableTableEntities;
|
|
58748
|
+
this.props.helperProp.getEditableTableInfoAndThrowFormError = this.getEditableTableInfoAndThrowFormError;
|
|
58696
58749
|
}
|
|
58697
58750
|
this.hotkeyEnabler = withHotkeys(__spreadProps(__spreadValues({
|
|
58698
58751
|
moveUpARow: {
|
|
@@ -59704,6 +59757,26 @@ const formatPasteData = /* @__PURE__ */ __name(({ schema, newVal, path: path2 })
|
|
|
59704
59757
|
}
|
|
59705
59758
|
return newVal;
|
|
59706
59759
|
}, "formatPasteData");
|
|
59760
|
+
function removeCleanRows(reduxFormEntities, reduxFormCellValidation) {
|
|
59761
|
+
const toFilterOut = {};
|
|
59762
|
+
const entsToUse = (reduxFormEntities || []).filter((e2) => {
|
|
59763
|
+
if (!(e2._isClean || isEntityClean(e2)))
|
|
59764
|
+
return true;
|
|
59765
|
+
else {
|
|
59766
|
+
toFilterOut[getIdOrCodeOrIndex(e2)] = true;
|
|
59767
|
+
return false;
|
|
59768
|
+
}
|
|
59769
|
+
});
|
|
59770
|
+
const validationToUse = {};
|
|
59771
|
+
lodashExports.forEach(reduxFormCellValidation, (v2, k2) => {
|
|
59772
|
+
const [rowId] = k2.split(":");
|
|
59773
|
+
if (!toFilterOut[rowId]) {
|
|
59774
|
+
validationToUse[k2] = v2;
|
|
59775
|
+
}
|
|
59776
|
+
});
|
|
59777
|
+
return { entsToUse, validationToUse };
|
|
59778
|
+
}
|
|
59779
|
+
__name(removeCleanRows, "removeCleanRows");
|
|
59707
59780
|
const wrapDialog = /* @__PURE__ */ __name((topLevelDialogProps = {}) => (Component2) => (props) => {
|
|
59708
59781
|
const r2 = useRef();
|
|
59709
59782
|
const memoedHotkeys = useMemo(
|
|
@@ -62233,26 +62306,6 @@ function asyncValidateHelper(validateAgainstSchema, currentEnts, changeForm, tab
|
|
|
62233
62306
|
});
|
|
62234
62307
|
}
|
|
62235
62308
|
__name(asyncValidateHelper, "asyncValidateHelper");
|
|
62236
|
-
function removeCleanRows(reduxFormEntities, reduxFormCellValidation) {
|
|
62237
|
-
const toFilterOut = {};
|
|
62238
|
-
const entsToUse = (reduxFormEntities || []).filter((e2) => {
|
|
62239
|
-
if (!(e2._isClean || isEntityClean(e2)))
|
|
62240
|
-
return true;
|
|
62241
|
-
else {
|
|
62242
|
-
toFilterOut[getIdOrCodeOrIndex(e2)] = true;
|
|
62243
|
-
return false;
|
|
62244
|
-
}
|
|
62245
|
-
});
|
|
62246
|
-
const validationToUse = {};
|
|
62247
|
-
lodashExports.forEach(reduxFormCellValidation, (v2, k2) => {
|
|
62248
|
-
const [rowId] = k2.split(":");
|
|
62249
|
-
if (!toFilterOut[rowId]) {
|
|
62250
|
-
validationToUse[k2] = v2;
|
|
62251
|
-
}
|
|
62252
|
-
});
|
|
62253
|
-
return { entsToUse, validationToUse };
|
|
62254
|
-
}
|
|
62255
|
-
__name(removeCleanRows, "removeCleanRows");
|
|
62256
62309
|
function maybeStripIdFromEntities(ents, validateAgainstSchema) {
|
|
62257
62310
|
var _a2;
|
|
62258
62311
|
let toRet;
|
|
@@ -78960,6 +79013,7 @@ export {
|
|
|
78960
79013
|
tgFormValueSelector,
|
|
78961
79014
|
tgFormValues,
|
|
78962
79015
|
tg_modalState,
|
|
79016
|
+
throwFormError,
|
|
78963
79017
|
tickMenuEnhancer,
|
|
78964
79018
|
tubeIcon,
|
|
78965
79019
|
useDialog,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teselagen/ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.48",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -10,12 +10,13 @@
|
|
|
10
10
|
"./style.css": "./style.css"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@teselagen/file-utils": "0.3.
|
|
13
|
+
"@teselagen/file-utils": "0.3.11",
|
|
14
14
|
"@teselagen/bounce-loader": "0.3.11",
|
|
15
15
|
"@blueprintjs/core": "3.52.0",
|
|
16
16
|
"@blueprintjs/datetime": "3.23.19",
|
|
17
17
|
"@blueprintjs/icons": "3.33.0",
|
|
18
18
|
"@blueprintjs/select": "3.18.11",
|
|
19
|
+
"@teselagen/react-table": "6.10.16",
|
|
19
20
|
"axios": "^0.21.1",
|
|
20
21
|
"bluebird": "3.7.2",
|
|
21
22
|
"buffer": "5.7.1",
|
package/src/DataTable/index.js
CHANGED
|
@@ -27,7 +27,8 @@ import {
|
|
|
27
27
|
omitBy,
|
|
28
28
|
times,
|
|
29
29
|
some,
|
|
30
|
-
isFunction
|
|
30
|
+
isFunction,
|
|
31
|
+
every
|
|
31
32
|
} from "lodash";
|
|
32
33
|
import joinUrl from "url-join";
|
|
33
34
|
|
|
@@ -87,6 +88,7 @@ import { validateTableWideErrors } from "./validateTableWideErrors";
|
|
|
87
88
|
import { editCellHelper } from "./editCellHelper";
|
|
88
89
|
import { getCellVal } from "./getCellVal";
|
|
89
90
|
import { getVals } from "./getVals";
|
|
91
|
+
import { throwFormError } from "../throwFormError";
|
|
90
92
|
enablePatches();
|
|
91
93
|
|
|
92
94
|
const PRIMARY_SELECTED_VAL = "main_cell";
|
|
@@ -99,6 +101,8 @@ class DataTable extends React.Component {
|
|
|
99
101
|
if (this.props.helperProp) {
|
|
100
102
|
this.props.helperProp.addEditableTableEntities =
|
|
101
103
|
this.addEditableTableEntities;
|
|
104
|
+
this.props.helperProp.getEditableTableInfoAndThrowFormError =
|
|
105
|
+
this.getEditableTableInfoAndThrowFormError;
|
|
102
106
|
}
|
|
103
107
|
this.hotkeyEnabler = withHotkeys({
|
|
104
108
|
moveUpARow: {
|
|
@@ -798,7 +802,12 @@ class DataTable extends React.Component {
|
|
|
798
802
|
const { change, schema } = computePresets(this.props);
|
|
799
803
|
change(
|
|
800
804
|
"reduxFormCellValidation",
|
|
801
|
-
validateTableWideErrors({
|
|
805
|
+
validateTableWideErrors({
|
|
806
|
+
entities,
|
|
807
|
+
schema,
|
|
808
|
+
newCellValidate,
|
|
809
|
+
props: this.props
|
|
810
|
+
})
|
|
802
811
|
);
|
|
803
812
|
};
|
|
804
813
|
handleDeleteCell = () => {
|
|
@@ -2991,8 +3000,13 @@ class DataTable extends React.Component {
|
|
|
2991
3000
|
indexToStartAt: entities.length
|
|
2992
3001
|
}
|
|
2993
3002
|
);
|
|
2994
|
-
|
|
2995
|
-
|
|
3003
|
+
if (every(entities, "_isClean")) {
|
|
3004
|
+
forEach(newEnts, (e, i) => {
|
|
3005
|
+
entities[i] = e;
|
|
3006
|
+
});
|
|
3007
|
+
} else {
|
|
3008
|
+
entities.splice(entities.length, 0, ...newEnts);
|
|
3009
|
+
}
|
|
2996
3010
|
|
|
2997
3011
|
this.updateValidation(entities, {
|
|
2998
3012
|
...reduxFormCellValidation,
|
|
@@ -3000,6 +3014,35 @@ class DataTable extends React.Component {
|
|
|
3000
3014
|
});
|
|
3001
3015
|
});
|
|
3002
3016
|
};
|
|
3017
|
+
getEditableTableInfoAndThrowFormError = () => {
|
|
3018
|
+
const { schema, reduxFormEntities, reduxFormCellValidation } =
|
|
3019
|
+
computePresets(this.props);
|
|
3020
|
+
const { entsToUse, validationToUse } = removeCleanRows(
|
|
3021
|
+
reduxFormEntities,
|
|
3022
|
+
reduxFormCellValidation
|
|
3023
|
+
);
|
|
3024
|
+
const validationWTableErrs = validateTableWideErrors({
|
|
3025
|
+
entities: entsToUse,
|
|
3026
|
+
schema,
|
|
3027
|
+
newCellValidate: validationToUse
|
|
3028
|
+
});
|
|
3029
|
+
|
|
3030
|
+
if (!entsToUse?.length) {
|
|
3031
|
+
throwFormError(
|
|
3032
|
+
"Please add at least one row to the table before submitting."
|
|
3033
|
+
);
|
|
3034
|
+
}
|
|
3035
|
+
const invalid =
|
|
3036
|
+
isEmpty(validationWTableErrs) || !some(validationWTableErrs, v => v)
|
|
3037
|
+
? undefined
|
|
3038
|
+
: validationWTableErrs;
|
|
3039
|
+
|
|
3040
|
+
if (invalid) {
|
|
3041
|
+
throwFormError("Please fix the errors in the table before submitting.");
|
|
3042
|
+
}
|
|
3043
|
+
|
|
3044
|
+
return entsToUse;
|
|
3045
|
+
};
|
|
3003
3046
|
|
|
3004
3047
|
insertRows = ({ above, numRows = 1, appendToBottom } = {}) => {
|
|
3005
3048
|
const { entities = [], reduxFormCellValidation } = computePresets(
|
|
@@ -3744,3 +3787,23 @@ const formatPasteData = ({ schema, newVal, path }) => {
|
|
|
3744
3787
|
}
|
|
3745
3788
|
return newVal;
|
|
3746
3789
|
};
|
|
3790
|
+
|
|
3791
|
+
export function removeCleanRows(reduxFormEntities, reduxFormCellValidation) {
|
|
3792
|
+
const toFilterOut = {};
|
|
3793
|
+
const entsToUse = (reduxFormEntities || []).filter(e => {
|
|
3794
|
+
if (!(e._isClean || isEntityClean(e))) return true;
|
|
3795
|
+
else {
|
|
3796
|
+
toFilterOut[getIdOrCodeOrIndex(e)] = true;
|
|
3797
|
+
return false;
|
|
3798
|
+
}
|
|
3799
|
+
});
|
|
3800
|
+
|
|
3801
|
+
const validationToUse = {};
|
|
3802
|
+
forEach(reduxFormCellValidation, (v, k) => {
|
|
3803
|
+
const [rowId] = k.split(":");
|
|
3804
|
+
if (!toFilterOut[rowId]) {
|
|
3805
|
+
validationToUse[k] = v;
|
|
3806
|
+
}
|
|
3807
|
+
});
|
|
3808
|
+
return { entsToUse, validationToUse };
|
|
3809
|
+
}
|
package/src/UploadCsvWizard.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Callout, Icon, Intent, Tab, Tabs } from "@blueprintjs/core";
|
|
|
4
4
|
import immer from "immer";
|
|
5
5
|
import { observer } from "mobx-react";
|
|
6
6
|
import "./UploadCsvWizard.css";
|
|
7
|
-
import {
|
|
7
|
+
import { isFunction } from "lodash";
|
|
8
8
|
import { compose } from "recompose";
|
|
9
9
|
import SimpleStepViz from "./SimpleStepViz";
|
|
10
10
|
import { nanoid } from "nanoid";
|
|
@@ -12,11 +12,10 @@ import { tgFormValueSelector } from "./utils/tgFormValues";
|
|
|
12
12
|
import { some } from "lodash";
|
|
13
13
|
import { times } from "lodash";
|
|
14
14
|
import DialogFooter from "./DialogFooter";
|
|
15
|
-
import DataTable, {
|
|
15
|
+
import DataTable, { removeCleanRows } from "./DataTable";
|
|
16
16
|
import wrapDialog from "./wrapDialog";
|
|
17
17
|
import { omit } from "lodash";
|
|
18
18
|
import { connect } from "react-redux";
|
|
19
|
-
import getIdOrCodeOrIndex from "./DataTable/utils/getIdOrCodeOrIndex";
|
|
20
19
|
import { MatchHeaders } from "./MatchHeaders";
|
|
21
20
|
import { isEmpty } from "lodash";
|
|
22
21
|
import { addSpecialPropToAsyncErrs } from "./FormComponents/tryToMatchSchemas";
|
|
@@ -703,26 +702,6 @@ async function asyncValidateHelper(
|
|
|
703
702
|
}
|
|
704
703
|
}
|
|
705
704
|
|
|
706
|
-
export function removeCleanRows(reduxFormEntities, reduxFormCellValidation) {
|
|
707
|
-
const toFilterOut = {};
|
|
708
|
-
const entsToUse = (reduxFormEntities || []).filter(e => {
|
|
709
|
-
if (!(e._isClean || isEntityClean(e))) return true;
|
|
710
|
-
else {
|
|
711
|
-
toFilterOut[getIdOrCodeOrIndex(e)] = true;
|
|
712
|
-
return false;
|
|
713
|
-
}
|
|
714
|
-
});
|
|
715
|
-
|
|
716
|
-
const validationToUse = {};
|
|
717
|
-
forEach(reduxFormCellValidation, (v, k) => {
|
|
718
|
-
const [rowId] = k.split(":");
|
|
719
|
-
if (!toFilterOut[rowId]) {
|
|
720
|
-
validationToUse[k] = v;
|
|
721
|
-
}
|
|
722
|
-
});
|
|
723
|
-
return { entsToUse, validationToUse };
|
|
724
|
-
}
|
|
725
|
-
|
|
726
705
|
function maybeStripIdFromEntities(ents, validateAgainstSchema) {
|
|
727
706
|
let toRet;
|
|
728
707
|
if (validateAgainstSchema?.fields?.some(({ path }) => path === "id")) {
|
package/src/index.js
CHANGED
|
@@ -17,19 +17,20 @@ export {
|
|
|
17
17
|
} from "./DataTable/utils/withSelectedEntities";
|
|
18
18
|
export {
|
|
19
19
|
default as DataTable,
|
|
20
|
-
ConnectedPagingTool as PagingTool
|
|
20
|
+
ConnectedPagingTool as PagingTool,
|
|
21
|
+
removeCleanRows
|
|
21
22
|
} from "./DataTable";
|
|
22
23
|
|
|
23
24
|
export { default as getIdOrCodeOrIndex } from "./DataTable/utils/getIdOrCodeOrIndex";
|
|
24
25
|
export { default as convertSchema } from "./DataTable/utils/convertSchema";
|
|
25
26
|
export { default as Loading } from "./Loading";
|
|
27
|
+
export { throwFormError } from "./throwFormError";
|
|
26
28
|
export { default as AdvancedOptions } from "./AdvancedOptions";
|
|
27
29
|
export { default as TgSelect } from "./TgSelect";
|
|
28
30
|
export { default as wrapDialog } from "./wrapDialog";
|
|
29
31
|
export { default as PromptUnsavedChanges } from "./PromptUnsavedChanges";
|
|
30
32
|
export { default as BlueprintError } from "./BlueprintError";
|
|
31
33
|
export { default as DropdownButton } from "./DropdownButton";
|
|
32
|
-
export { removeCleanRows } from "./UploadCsvWizard";
|
|
33
34
|
export { default as DialogFooter } from "./DialogFooter";
|
|
34
35
|
export { default as adHoc } from "./utils/adHoc";
|
|
35
36
|
export { default as IntentText } from "./IntentText";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SubmissionError } from "redux-form";
|
|
2
|
+
|
|
3
|
+
export const throwFormError = error => {
|
|
4
|
+
if (error.message) {
|
|
5
|
+
console.error("error:", error);
|
|
6
|
+
}
|
|
7
|
+
const errorToUse = error.message
|
|
8
|
+
? { _error: error.message }
|
|
9
|
+
: typeof error === "string"
|
|
10
|
+
? { _error: error }
|
|
11
|
+
: error;
|
|
12
|
+
if (!errorToUse._error) {
|
|
13
|
+
errorToUse._error = "Error Submitting Form";
|
|
14
|
+
}
|
|
15
|
+
throw new SubmissionError(errorToUse);
|
|
16
|
+
};
|