@teselagen/ui 0.4.1 → 0.4.2

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 CHANGED
@@ -5544,10 +5544,10 @@ var ownKeys$2 = typeof Reflect !== "undefined" && Reflect.ownKeys ? Reflect.ownK
5544
5544
  /* istanbul ignore next */
5545
5545
  Object.getOwnPropertyNames
5546
5546
  );
5547
- function toPrimitive$3(value) {
5547
+ function toPrimitive$2(value) {
5548
5548
  return value === null ? null : typeof value === "object" ? "" + value : value;
5549
5549
  }
5550
- __name(toPrimitive$3, "toPrimitive$3");
5550
+ __name(toPrimitive$2, "toPrimitive$2");
5551
5551
  function hasProp(target, prop) {
5552
5552
  return objectPrototype$1.hasOwnProperty.call(target, prop);
5553
5553
  }
@@ -6564,7 +6564,7 @@ var ObservableValue = /* @__PURE__ */ function(_Atom) {
6564
6564
  return this.name_ + "[" + this.value_ + "]";
6565
6565
  }, "toString2");
6566
6566
  _proto.valueOf = /* @__PURE__ */ __name(function valueOf() {
6567
- return toPrimitive$3(this.get());
6567
+ return toPrimitive$2(this.get());
6568
6568
  }, "valueOf");
6569
6569
  _proto[_Symbol$toPrimitive] = function() {
6570
6570
  return this.valueOf();
@@ -6749,7 +6749,7 @@ var ComputedValue = /* @__PURE__ */ function() {
6749
6749
  return this.name_ + "[" + this.derivation.toString() + "]";
6750
6750
  }, "toString2");
6751
6751
  _proto.valueOf = /* @__PURE__ */ __name(function valueOf() {
6752
- return toPrimitive$3(this.get());
6752
+ return toPrimitive$2(this.get());
6753
6753
  }, "valueOf");
6754
6754
  _proto[_Symbol$toPrimitive$1] = function() {
6755
6755
  return this.valueOf();
@@ -11369,7 +11369,7 @@ lodash.exports;
11369
11369
  "^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar2, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
11370
11370
  );
11371
11371
  var Buffer2 = moduleExports2 ? context.Buffer : undefined$12, Symbol2 = context.Symbol, Uint8Array2 = context.Uint8Array, allocUnsafe = 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;
11372
- var defineProperty6 = function() {
11372
+ var defineProperty5 = function() {
11373
11373
  try {
11374
11374
  var func = getNative2(Object2, "defineProperty");
11375
11375
  func({}, "", {});
@@ -11809,8 +11809,8 @@ lodash.exports;
11809
11809
  }
11810
11810
  __name(baseAssignIn2, "baseAssignIn");
11811
11811
  function baseAssignValue2(object2, key, value) {
11812
- if (key == "__proto__" && defineProperty6) {
11813
- defineProperty6(object2, key, {
11812
+ if (key == "__proto__" && defineProperty5) {
11813
+ defineProperty5(object2, key, {
11814
11814
  "configurable": true,
11815
11815
  "enumerable": true,
11816
11816
  "value": value,
@@ -12543,8 +12543,8 @@ lodash.exports;
12543
12543
  metaMap.set(func, data);
12544
12544
  return func;
12545
12545
  };
12546
- var baseSetToString2 = !defineProperty6 ? identity3 : function(func, string2) {
12547
- return defineProperty6(func, "toString", {
12546
+ var baseSetToString2 = !defineProperty5 ? identity3 : function(func, string2) {
12547
+ return defineProperty5(func, "toString", {
12548
12548
  "configurable": true,
12549
12549
  "enumerable": false,
12550
12550
  "value": constant2(string2),
@@ -17093,11 +17093,20 @@ var _fails = /* @__PURE__ */ __name(function(exec) {
17093
17093
  return true;
17094
17094
  }
17095
17095
  }, "_fails");
17096
- var _descriptors = !_fails(function() {
17097
- return Object.defineProperty({}, "a", { get: function() {
17098
- return 7;
17099
- } }).a != 7;
17100
- });
17096
+ var _descriptors;
17097
+ var hasRequired_descriptors;
17098
+ function require_descriptors() {
17099
+ if (hasRequired_descriptors)
17100
+ return _descriptors;
17101
+ hasRequired_descriptors = 1;
17102
+ _descriptors = !_fails(function() {
17103
+ return Object.defineProperty({}, "a", { get: function() {
17104
+ return 7;
17105
+ } }).a != 7;
17106
+ });
17107
+ return _descriptors;
17108
+ }
17109
+ __name(require_descriptors, "require_descriptors");
17101
17110
  var _domCreate;
17102
17111
  var hasRequired_domCreate;
17103
17112
  function require_domCreate() {
@@ -17113,7 +17122,7 @@ function require_domCreate() {
17113
17122
  return _domCreate;
17114
17123
  }
17115
17124
  __name(require_domCreate, "require_domCreate");
17116
- var _ie8DomDefine = !_descriptors && !_fails(function() {
17125
+ var _ie8DomDefine = !require_descriptors() && !_fails(function() {
17117
17126
  return Object.defineProperty(require_domCreate()("div"), "a", { get: function() {
17118
17127
  return 7;
17119
17128
  } }).a != 7;
@@ -17131,25 +17140,33 @@ var _toPrimitive$1 = /* @__PURE__ */ __name(function(it, S2) {
17131
17140
  return val;
17132
17141
  throw TypeError("Can't convert object to primitive value");
17133
17142
  }, "_toPrimitive$1");
17134
- var anObject$3 = _anObject;
17135
- var IE8_DOM_DEFINE$1 = _ie8DomDefine;
17136
- var toPrimitive$2 = _toPrimitive$1;
17137
- var dP$2 = Object.defineProperty;
17138
- _objectDp.f = _descriptors ? Object.defineProperty : /* @__PURE__ */ __name(function defineProperty(O2, P2, Attributes) {
17139
- anObject$3(O2);
17140
- P2 = toPrimitive$2(P2, true);
17141
- anObject$3(Attributes);
17142
- if (IE8_DOM_DEFINE$1)
17143
- try {
17144
- return dP$2(O2, P2, Attributes);
17145
- } catch (e2) {
17146
- }
17147
- if ("get" in Attributes || "set" in Attributes)
17148
- throw TypeError("Accessors not supported!");
17149
- if ("value" in Attributes)
17150
- O2[P2] = Attributes.value;
17151
- return O2;
17152
- }, "defineProperty");
17143
+ var hasRequired_objectDp;
17144
+ function require_objectDp() {
17145
+ if (hasRequired_objectDp)
17146
+ return _objectDp;
17147
+ hasRequired_objectDp = 1;
17148
+ var anObject2 = _anObject;
17149
+ var IE8_DOM_DEFINE2 = _ie8DomDefine;
17150
+ var toPrimitive2 = _toPrimitive$1;
17151
+ var dP2 = Object.defineProperty;
17152
+ _objectDp.f = require_descriptors() ? Object.defineProperty : /* @__PURE__ */ __name(function defineProperty5(O2, P2, Attributes) {
17153
+ anObject2(O2);
17154
+ P2 = toPrimitive2(P2, true);
17155
+ anObject2(Attributes);
17156
+ if (IE8_DOM_DEFINE2)
17157
+ try {
17158
+ return dP2(O2, P2, Attributes);
17159
+ } catch (e2) {
17160
+ }
17161
+ if ("get" in Attributes || "set" in Attributes)
17162
+ throw TypeError("Accessors not supported!");
17163
+ if ("value" in Attributes)
17164
+ O2[P2] = Attributes.value;
17165
+ return O2;
17166
+ }, "defineProperty");
17167
+ return _objectDp;
17168
+ }
17169
+ __name(require_objectDp, "require_objectDp");
17153
17170
  var _propertyDesc = /* @__PURE__ */ __name(function(bitmap, value) {
17154
17171
  return {
17155
17172
  enumerable: !(bitmap & 1),
@@ -17158,9 +17175,9 @@ var _propertyDesc = /* @__PURE__ */ __name(function(bitmap, value) {
17158
17175
  value
17159
17176
  };
17160
17177
  }, "_propertyDesc");
17161
- var dP$1 = _objectDp;
17178
+ var dP$1 = require_objectDp();
17162
17179
  var createDesc$3 = _propertyDesc;
17163
- var _hide = _descriptors ? function(object2, key, value) {
17180
+ var _hide = require_descriptors() ? function(object2, key, value) {
17164
17181
  return dP$1.f(object2, key, createDesc$3(1, value));
17165
17182
  } : function(object2, key, value) {
17166
17183
  object2[key] = value;
@@ -17366,7 +17383,7 @@ function require_objectAssign() {
17366
17383
  if (hasRequired_objectAssign)
17367
17384
  return _objectAssign;
17368
17385
  hasRequired_objectAssign = 1;
17369
- var DESCRIPTORS2 = _descriptors;
17386
+ var DESCRIPTORS2 = require_descriptors();
17370
17387
  var getKeys2 = _objectKeys;
17371
17388
  var gOPS2 = _objectGops;
17372
17389
  var pIE2 = require_objectPie();
@@ -17438,10 +17455,10 @@ function require_objectDps() {
17438
17455
  if (hasRequired_objectDps)
17439
17456
  return _objectDps;
17440
17457
  hasRequired_objectDps = 1;
17441
- var dP2 = _objectDp;
17458
+ var dP2 = require_objectDp();
17442
17459
  var anObject2 = _anObject;
17443
17460
  var getKeys2 = _objectKeys;
17444
- _objectDps = _descriptors ? Object.defineProperties : /* @__PURE__ */ __name(function defineProperties2(O2, Properties) {
17461
+ _objectDps = require_descriptors() ? Object.defineProperties : /* @__PURE__ */ __name(function defineProperties2(O2, Properties) {
17445
17462
  anObject2(O2);
17446
17463
  var keys3 = getKeys2(Properties);
17447
17464
  var length = keys3.length;
@@ -17520,7 +17537,7 @@ var $exports = _wks.exports = function(name) {
17520
17537
  };
17521
17538
  $exports.store = store;
17522
17539
  var _wksExports = _wks.exports;
17523
- var def = _objectDp.f;
17540
+ var def = require_objectDp().f;
17524
17541
  var has$9 = _has;
17525
17542
  var TAG$1 = _wksExports("toStringTag");
17526
17543
  var _setToStringTag = /* @__PURE__ */ __name(function(it, tag, stat) {
@@ -17793,7 +17810,7 @@ var ArrayProto = Array.prototype;
17793
17810
  var _isArrayIter = /* @__PURE__ */ __name(function(it) {
17794
17811
  return it !== void 0 && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
17795
17812
  }, "_isArrayIter");
17796
- var $defineProperty$3 = _objectDp;
17813
+ var $defineProperty$3 = require_objectDp();
17797
17814
  var createDesc$2 = _propertyDesc;
17798
17815
  var _createProperty = /* @__PURE__ */ __name(function(object2, index2, value) {
17799
17816
  if (index2 in object2)
@@ -17922,9 +17939,9 @@ var _default$7 = /* @__PURE__ */ __name(function(instance, Constructor) {
17922
17939
  }
17923
17940
  }, "_default$7");
17924
17941
  var $export$3 = _export;
17925
- $export$3($export$3.S + $export$3.F * !_descriptors, "Object", { defineProperty: _objectDp.f });
17942
+ $export$3($export$3.S + $export$3.F * !require_descriptors(), "Object", { defineProperty: require_objectDp().f });
17926
17943
  var $Object$2 = _coreExports.Object;
17927
- var defineProperty$8 = /* @__PURE__ */ __name(function defineProperty3(it, key, desc) {
17944
+ var defineProperty$8 = /* @__PURE__ */ __name(function defineProperty(it, key, desc) {
17928
17945
  return $Object$2.defineProperty(it, key, desc);
17929
17946
  }, "defineProperty");
17930
17947
  var defineProperty$7 = { "default": defineProperty$8, __esModule: true };
@@ -17963,7 +17980,7 @@ var _meta = { exports: {} };
17963
17980
  var META$1 = _uid("meta");
17964
17981
  var isObject$c = _isObject;
17965
17982
  var has$7 = _has;
17966
- var setDesc = _objectDp.f;
17983
+ var setDesc = require_objectDp().f;
17967
17984
  var id = 0;
17968
17985
  var isExtensible = Object.isExtensible || function() {
17969
17986
  return true;
@@ -18016,7 +18033,7 @@ var meta = _meta.exports = {
18016
18033
  var _metaExports = _meta.exports;
18017
18034
  var core = _coreExports;
18018
18035
  var wksExt$1 = _wksExt;
18019
- var defineProperty$6 = _objectDp.f;
18036
+ var defineProperty$6 = require_objectDp().f;
18020
18037
  var _wksDefine = /* @__PURE__ */ __name(function(name) {
18021
18038
  var $Symbol2 = core.Symbol || (core.Symbol = {});
18022
18039
  if (name.charAt(0) != "_" && !(name in $Symbol2))
@@ -18072,7 +18089,7 @@ var toPrimitive$1 = _toPrimitive$1;
18072
18089
  var has$6 = _has;
18073
18090
  var IE8_DOM_DEFINE = _ie8DomDefine;
18074
18091
  var gOPD$3 = Object.getOwnPropertyDescriptor;
18075
- _objectGopd.f = _descriptors ? gOPD$3 : /* @__PURE__ */ __name(function getOwnPropertyDescriptor(O2, P2) {
18092
+ _objectGopd.f = require_descriptors() ? gOPD$3 : /* @__PURE__ */ __name(function getOwnPropertyDescriptor(O2, P2) {
18076
18093
  O2 = toIObject$1(O2);
18077
18094
  P2 = toPrimitive$1(P2, true);
18078
18095
  if (IE8_DOM_DEFINE)
@@ -18085,7 +18102,7 @@ _objectGopd.f = _descriptors ? gOPD$3 : /* @__PURE__ */ __name(function getOwnPr
18085
18102
  }, "getOwnPropertyDescriptor");
18086
18103
  var global$1 = _globalExports;
18087
18104
  var has$5 = _has;
18088
- var DESCRIPTORS = _descriptors;
18105
+ var DESCRIPTORS = require_descriptors();
18089
18106
  var $export$2 = _export;
18090
18107
  var redefine = _redefine;
18091
18108
  var META = _metaExports.KEY;
@@ -18108,7 +18125,7 @@ var _create$1 = require_objectCreate();
18108
18125
  var gOPNExt = _objectGopnExt;
18109
18126
  var $GOPD = _objectGopd;
18110
18127
  var $GOPS = _objectGops;
18111
- var $DP = _objectDp;
18128
+ var $DP = require_objectDp();
18112
18129
  var $keys$1 = _objectKeys;
18113
18130
  var gOPD$2 = $GOPD.f;
18114
18131
  var dP = $DP.f;
@@ -18151,7 +18168,7 @@ var isSymbol$8 = USE_NATIVE && typeof $Symbol.iterator == "symbol" ? function(it
18151
18168
  } : function(it) {
18152
18169
  return it instanceof $Symbol;
18153
18170
  };
18154
- var $defineProperty$2 = /* @__PURE__ */ __name(function defineProperty4(it, key, D2) {
18171
+ var $defineProperty$2 = /* @__PURE__ */ __name(function defineProperty3(it, key, D2) {
18155
18172
  if (it === ObjectProto)
18156
18173
  $defineProperty$2(OPSymbols, key, D2);
18157
18174
  anObject(it);
@@ -54456,7 +54473,7 @@ var KNOWN_STATICS = {
54456
54473
  arguments: true,
54457
54474
  arity: true
54458
54475
  };
54459
- var defineProperty5 = Object.defineProperty;
54476
+ var defineProperty4 = Object.defineProperty;
54460
54477
  var getOwnPropertyNames4 = Object.getOwnPropertyNames;
54461
54478
  var getOwnPropertySymbols3 = Object.getOwnPropertySymbols;
54462
54479
  var getOwnPropertyDescriptor3 = Object.getOwnPropertyDescriptor;
@@ -54479,7 +54496,7 @@ function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
54479
54496
  if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {
54480
54497
  var descriptor2 = getOwnPropertyDescriptor3(sourceComponent, key);
54481
54498
  try {
54482
- defineProperty5(targetComponent, key, descriptor2);
54499
+ defineProperty4(targetComponent, key, descriptor2);
54483
54500
  } catch (e2) {
54484
54501
  }
54485
54502
  }
@@ -55347,7 +55364,9 @@ function validateTableWideErrors({
55347
55364
  });
55348
55365
  }
55349
55366
  const displayNameMap = {};
55367
+ const fieldUpperToPath = {};
55350
55368
  lodashExports.forEach(schema.fields, (f2) => {
55369
+ fieldUpperToPath[f2.path.toUpperCase()] = f2.path;
55351
55370
  displayNameMap[f2.path] = f2.displayName || lodashExports.startCase(lodashExports.camelCase(f2.path));
55352
55371
  });
55353
55372
  function getDisplayName2(path2) {
@@ -55387,6 +55406,27 @@ function validateTableWideErrors({
55387
55406
  });
55388
55407
  });
55389
55408
  }
55409
+ const requireIfs = [];
55410
+ schema.fields.forEach((col) => {
55411
+ const { path: path2, requireIf } = col;
55412
+ if (requireIf) {
55413
+ const requireIfPath = fieldUpperToPath[requireIf.toUpperCase()];
55414
+ requireIfs.push([requireIfPath, path2]);
55415
+ }
55416
+ });
55417
+ requireIfs.forEach(([requireIfPath, path2]) => {
55418
+ entities.forEach((entity) => {
55419
+ const requireIfVal = getCellVal(entity, requireIfPath);
55420
+ const pathVal = getCellVal(entity, path2);
55421
+ if (requireIfVal && !pathVal) {
55422
+ const cellId = `${getIdOrCodeOrIndex(entity)}:${path2}`;
55423
+ newCellValidate[cellId] = {
55424
+ message: `This field is required if ${displayNameMap[requireIfPath]} is present`,
55425
+ _isTableWideError: true
55426
+ };
55427
+ }
55428
+ });
55429
+ });
55390
55430
  if (schema.requireAllOrNone) {
55391
55431
  (lodashExports.isArray(schema.requireAllOrNone[0]) ? schema.requireAllOrNone : [schema.requireAllOrNone]).forEach((reqs) => {
55392
55432
  entities.forEach((entity) => {
package/index.es.js CHANGED
@@ -5526,10 +5526,10 @@ var ownKeys$2 = typeof Reflect !== "undefined" && Reflect.ownKeys ? Reflect.ownK
5526
5526
  /* istanbul ignore next */
5527
5527
  Object.getOwnPropertyNames
5528
5528
  );
5529
- function toPrimitive$3(value) {
5529
+ function toPrimitive$2(value) {
5530
5530
  return value === null ? null : typeof value === "object" ? "" + value : value;
5531
5531
  }
5532
- __name(toPrimitive$3, "toPrimitive$3");
5532
+ __name(toPrimitive$2, "toPrimitive$2");
5533
5533
  function hasProp(target, prop) {
5534
5534
  return objectPrototype$1.hasOwnProperty.call(target, prop);
5535
5535
  }
@@ -6546,7 +6546,7 @@ var ObservableValue = /* @__PURE__ */ function(_Atom) {
6546
6546
  return this.name_ + "[" + this.value_ + "]";
6547
6547
  }, "toString2");
6548
6548
  _proto.valueOf = /* @__PURE__ */ __name(function valueOf() {
6549
- return toPrimitive$3(this.get());
6549
+ return toPrimitive$2(this.get());
6550
6550
  }, "valueOf");
6551
6551
  _proto[_Symbol$toPrimitive] = function() {
6552
6552
  return this.valueOf();
@@ -6731,7 +6731,7 @@ var ComputedValue = /* @__PURE__ */ function() {
6731
6731
  return this.name_ + "[" + this.derivation.toString() + "]";
6732
6732
  }, "toString2");
6733
6733
  _proto.valueOf = /* @__PURE__ */ __name(function valueOf() {
6734
- return toPrimitive$3(this.get());
6734
+ return toPrimitive$2(this.get());
6735
6735
  }, "valueOf");
6736
6736
  _proto[_Symbol$toPrimitive$1] = function() {
6737
6737
  return this.valueOf();
@@ -11351,7 +11351,7 @@ lodash.exports;
11351
11351
  "^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar2, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
11352
11352
  );
11353
11353
  var Buffer2 = moduleExports2 ? context.Buffer : undefined$12, Symbol2 = context.Symbol, Uint8Array2 = context.Uint8Array, allocUnsafe = 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;
11354
- var defineProperty6 = function() {
11354
+ var defineProperty5 = function() {
11355
11355
  try {
11356
11356
  var func = getNative2(Object2, "defineProperty");
11357
11357
  func({}, "", {});
@@ -11791,8 +11791,8 @@ lodash.exports;
11791
11791
  }
11792
11792
  __name(baseAssignIn2, "baseAssignIn");
11793
11793
  function baseAssignValue2(object2, key, value) {
11794
- if (key == "__proto__" && defineProperty6) {
11795
- defineProperty6(object2, key, {
11794
+ if (key == "__proto__" && defineProperty5) {
11795
+ defineProperty5(object2, key, {
11796
11796
  "configurable": true,
11797
11797
  "enumerable": true,
11798
11798
  "value": value,
@@ -12525,8 +12525,8 @@ lodash.exports;
12525
12525
  metaMap.set(func, data);
12526
12526
  return func;
12527
12527
  };
12528
- var baseSetToString2 = !defineProperty6 ? identity3 : function(func, string2) {
12529
- return defineProperty6(func, "toString", {
12528
+ var baseSetToString2 = !defineProperty5 ? identity3 : function(func, string2) {
12529
+ return defineProperty5(func, "toString", {
12530
12530
  "configurable": true,
12531
12531
  "enumerable": false,
12532
12532
  "value": constant2(string2),
@@ -17075,11 +17075,20 @@ var _fails = /* @__PURE__ */ __name(function(exec) {
17075
17075
  return true;
17076
17076
  }
17077
17077
  }, "_fails");
17078
- var _descriptors = !_fails(function() {
17079
- return Object.defineProperty({}, "a", { get: function() {
17080
- return 7;
17081
- } }).a != 7;
17082
- });
17078
+ var _descriptors;
17079
+ var hasRequired_descriptors;
17080
+ function require_descriptors() {
17081
+ if (hasRequired_descriptors)
17082
+ return _descriptors;
17083
+ hasRequired_descriptors = 1;
17084
+ _descriptors = !_fails(function() {
17085
+ return Object.defineProperty({}, "a", { get: function() {
17086
+ return 7;
17087
+ } }).a != 7;
17088
+ });
17089
+ return _descriptors;
17090
+ }
17091
+ __name(require_descriptors, "require_descriptors");
17083
17092
  var _domCreate;
17084
17093
  var hasRequired_domCreate;
17085
17094
  function require_domCreate() {
@@ -17095,7 +17104,7 @@ function require_domCreate() {
17095
17104
  return _domCreate;
17096
17105
  }
17097
17106
  __name(require_domCreate, "require_domCreate");
17098
- var _ie8DomDefine = !_descriptors && !_fails(function() {
17107
+ var _ie8DomDefine = !require_descriptors() && !_fails(function() {
17099
17108
  return Object.defineProperty(require_domCreate()("div"), "a", { get: function() {
17100
17109
  return 7;
17101
17110
  } }).a != 7;
@@ -17113,25 +17122,33 @@ var _toPrimitive$1 = /* @__PURE__ */ __name(function(it, S2) {
17113
17122
  return val;
17114
17123
  throw TypeError("Can't convert object to primitive value");
17115
17124
  }, "_toPrimitive$1");
17116
- var anObject$3 = _anObject;
17117
- var IE8_DOM_DEFINE$1 = _ie8DomDefine;
17118
- var toPrimitive$2 = _toPrimitive$1;
17119
- var dP$2 = Object.defineProperty;
17120
- _objectDp.f = _descriptors ? Object.defineProperty : /* @__PURE__ */ __name(function defineProperty(O2, P2, Attributes) {
17121
- anObject$3(O2);
17122
- P2 = toPrimitive$2(P2, true);
17123
- anObject$3(Attributes);
17124
- if (IE8_DOM_DEFINE$1)
17125
- try {
17126
- return dP$2(O2, P2, Attributes);
17127
- } catch (e2) {
17128
- }
17129
- if ("get" in Attributes || "set" in Attributes)
17130
- throw TypeError("Accessors not supported!");
17131
- if ("value" in Attributes)
17132
- O2[P2] = Attributes.value;
17133
- return O2;
17134
- }, "defineProperty");
17125
+ var hasRequired_objectDp;
17126
+ function require_objectDp() {
17127
+ if (hasRequired_objectDp)
17128
+ return _objectDp;
17129
+ hasRequired_objectDp = 1;
17130
+ var anObject2 = _anObject;
17131
+ var IE8_DOM_DEFINE2 = _ie8DomDefine;
17132
+ var toPrimitive2 = _toPrimitive$1;
17133
+ var dP2 = Object.defineProperty;
17134
+ _objectDp.f = require_descriptors() ? Object.defineProperty : /* @__PURE__ */ __name(function defineProperty5(O2, P2, Attributes) {
17135
+ anObject2(O2);
17136
+ P2 = toPrimitive2(P2, true);
17137
+ anObject2(Attributes);
17138
+ if (IE8_DOM_DEFINE2)
17139
+ try {
17140
+ return dP2(O2, P2, Attributes);
17141
+ } catch (e2) {
17142
+ }
17143
+ if ("get" in Attributes || "set" in Attributes)
17144
+ throw TypeError("Accessors not supported!");
17145
+ if ("value" in Attributes)
17146
+ O2[P2] = Attributes.value;
17147
+ return O2;
17148
+ }, "defineProperty");
17149
+ return _objectDp;
17150
+ }
17151
+ __name(require_objectDp, "require_objectDp");
17135
17152
  var _propertyDesc = /* @__PURE__ */ __name(function(bitmap, value) {
17136
17153
  return {
17137
17154
  enumerable: !(bitmap & 1),
@@ -17140,9 +17157,9 @@ var _propertyDesc = /* @__PURE__ */ __name(function(bitmap, value) {
17140
17157
  value
17141
17158
  };
17142
17159
  }, "_propertyDesc");
17143
- var dP$1 = _objectDp;
17160
+ var dP$1 = require_objectDp();
17144
17161
  var createDesc$3 = _propertyDesc;
17145
- var _hide = _descriptors ? function(object2, key, value) {
17162
+ var _hide = require_descriptors() ? function(object2, key, value) {
17146
17163
  return dP$1.f(object2, key, createDesc$3(1, value));
17147
17164
  } : function(object2, key, value) {
17148
17165
  object2[key] = value;
@@ -17348,7 +17365,7 @@ function require_objectAssign() {
17348
17365
  if (hasRequired_objectAssign)
17349
17366
  return _objectAssign;
17350
17367
  hasRequired_objectAssign = 1;
17351
- var DESCRIPTORS2 = _descriptors;
17368
+ var DESCRIPTORS2 = require_descriptors();
17352
17369
  var getKeys2 = _objectKeys;
17353
17370
  var gOPS2 = _objectGops;
17354
17371
  var pIE2 = require_objectPie();
@@ -17420,10 +17437,10 @@ function require_objectDps() {
17420
17437
  if (hasRequired_objectDps)
17421
17438
  return _objectDps;
17422
17439
  hasRequired_objectDps = 1;
17423
- var dP2 = _objectDp;
17440
+ var dP2 = require_objectDp();
17424
17441
  var anObject2 = _anObject;
17425
17442
  var getKeys2 = _objectKeys;
17426
- _objectDps = _descriptors ? Object.defineProperties : /* @__PURE__ */ __name(function defineProperties2(O2, Properties) {
17443
+ _objectDps = require_descriptors() ? Object.defineProperties : /* @__PURE__ */ __name(function defineProperties2(O2, Properties) {
17427
17444
  anObject2(O2);
17428
17445
  var keys3 = getKeys2(Properties);
17429
17446
  var length = keys3.length;
@@ -17502,7 +17519,7 @@ var $exports = _wks.exports = function(name) {
17502
17519
  };
17503
17520
  $exports.store = store;
17504
17521
  var _wksExports = _wks.exports;
17505
- var def = _objectDp.f;
17522
+ var def = require_objectDp().f;
17506
17523
  var has$9 = _has;
17507
17524
  var TAG$1 = _wksExports("toStringTag");
17508
17525
  var _setToStringTag = /* @__PURE__ */ __name(function(it, tag, stat) {
@@ -17775,7 +17792,7 @@ var ArrayProto = Array.prototype;
17775
17792
  var _isArrayIter = /* @__PURE__ */ __name(function(it) {
17776
17793
  return it !== void 0 && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
17777
17794
  }, "_isArrayIter");
17778
- var $defineProperty$3 = _objectDp;
17795
+ var $defineProperty$3 = require_objectDp();
17779
17796
  var createDesc$2 = _propertyDesc;
17780
17797
  var _createProperty = /* @__PURE__ */ __name(function(object2, index2, value) {
17781
17798
  if (index2 in object2)
@@ -17904,9 +17921,9 @@ var _default$7 = /* @__PURE__ */ __name(function(instance, Constructor) {
17904
17921
  }
17905
17922
  }, "_default$7");
17906
17923
  var $export$3 = _export;
17907
- $export$3($export$3.S + $export$3.F * !_descriptors, "Object", { defineProperty: _objectDp.f });
17924
+ $export$3($export$3.S + $export$3.F * !require_descriptors(), "Object", { defineProperty: require_objectDp().f });
17908
17925
  var $Object$2 = _coreExports.Object;
17909
- var defineProperty$8 = /* @__PURE__ */ __name(function defineProperty3(it, key, desc) {
17926
+ var defineProperty$8 = /* @__PURE__ */ __name(function defineProperty(it, key, desc) {
17910
17927
  return $Object$2.defineProperty(it, key, desc);
17911
17928
  }, "defineProperty");
17912
17929
  var defineProperty$7 = { "default": defineProperty$8, __esModule: true };
@@ -17945,7 +17962,7 @@ var _meta = { exports: {} };
17945
17962
  var META$1 = _uid("meta");
17946
17963
  var isObject$c = _isObject;
17947
17964
  var has$7 = _has;
17948
- var setDesc = _objectDp.f;
17965
+ var setDesc = require_objectDp().f;
17949
17966
  var id = 0;
17950
17967
  var isExtensible = Object.isExtensible || function() {
17951
17968
  return true;
@@ -17998,7 +18015,7 @@ var meta = _meta.exports = {
17998
18015
  var _metaExports = _meta.exports;
17999
18016
  var core = _coreExports;
18000
18017
  var wksExt$1 = _wksExt;
18001
- var defineProperty$6 = _objectDp.f;
18018
+ var defineProperty$6 = require_objectDp().f;
18002
18019
  var _wksDefine = /* @__PURE__ */ __name(function(name) {
18003
18020
  var $Symbol2 = core.Symbol || (core.Symbol = {});
18004
18021
  if (name.charAt(0) != "_" && !(name in $Symbol2))
@@ -18054,7 +18071,7 @@ var toPrimitive$1 = _toPrimitive$1;
18054
18071
  var has$6 = _has;
18055
18072
  var IE8_DOM_DEFINE = _ie8DomDefine;
18056
18073
  var gOPD$3 = Object.getOwnPropertyDescriptor;
18057
- _objectGopd.f = _descriptors ? gOPD$3 : /* @__PURE__ */ __name(function getOwnPropertyDescriptor(O2, P2) {
18074
+ _objectGopd.f = require_descriptors() ? gOPD$3 : /* @__PURE__ */ __name(function getOwnPropertyDescriptor(O2, P2) {
18058
18075
  O2 = toIObject$1(O2);
18059
18076
  P2 = toPrimitive$1(P2, true);
18060
18077
  if (IE8_DOM_DEFINE)
@@ -18067,7 +18084,7 @@ _objectGopd.f = _descriptors ? gOPD$3 : /* @__PURE__ */ __name(function getOwnPr
18067
18084
  }, "getOwnPropertyDescriptor");
18068
18085
  var global$1 = _globalExports;
18069
18086
  var has$5 = _has;
18070
- var DESCRIPTORS = _descriptors;
18087
+ var DESCRIPTORS = require_descriptors();
18071
18088
  var $export$2 = _export;
18072
18089
  var redefine = _redefine;
18073
18090
  var META = _metaExports.KEY;
@@ -18090,7 +18107,7 @@ var _create$1 = require_objectCreate();
18090
18107
  var gOPNExt = _objectGopnExt;
18091
18108
  var $GOPD = _objectGopd;
18092
18109
  var $GOPS = _objectGops;
18093
- var $DP = _objectDp;
18110
+ var $DP = require_objectDp();
18094
18111
  var $keys$1 = _objectKeys;
18095
18112
  var gOPD$2 = $GOPD.f;
18096
18113
  var dP = $DP.f;
@@ -18133,7 +18150,7 @@ var isSymbol$8 = USE_NATIVE && typeof $Symbol.iterator == "symbol" ? function(it
18133
18150
  } : function(it) {
18134
18151
  return it instanceof $Symbol;
18135
18152
  };
18136
- var $defineProperty$2 = /* @__PURE__ */ __name(function defineProperty4(it, key, D2) {
18153
+ var $defineProperty$2 = /* @__PURE__ */ __name(function defineProperty3(it, key, D2) {
18137
18154
  if (it === ObjectProto)
18138
18155
  $defineProperty$2(OPSymbols, key, D2);
18139
18156
  anObject(it);
@@ -54438,7 +54455,7 @@ var KNOWN_STATICS = {
54438
54455
  arguments: true,
54439
54456
  arity: true
54440
54457
  };
54441
- var defineProperty5 = Object.defineProperty;
54458
+ var defineProperty4 = Object.defineProperty;
54442
54459
  var getOwnPropertyNames4 = Object.getOwnPropertyNames;
54443
54460
  var getOwnPropertySymbols3 = Object.getOwnPropertySymbols;
54444
54461
  var getOwnPropertyDescriptor3 = Object.getOwnPropertyDescriptor;
@@ -54461,7 +54478,7 @@ function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
54461
54478
  if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {
54462
54479
  var descriptor2 = getOwnPropertyDescriptor3(sourceComponent, key);
54463
54480
  try {
54464
- defineProperty5(targetComponent, key, descriptor2);
54481
+ defineProperty4(targetComponent, key, descriptor2);
54465
54482
  } catch (e2) {
54466
54483
  }
54467
54484
  }
@@ -55329,7 +55346,9 @@ function validateTableWideErrors({
55329
55346
  });
55330
55347
  }
55331
55348
  const displayNameMap = {};
55349
+ const fieldUpperToPath = {};
55332
55350
  lodashExports.forEach(schema.fields, (f2) => {
55351
+ fieldUpperToPath[f2.path.toUpperCase()] = f2.path;
55333
55352
  displayNameMap[f2.path] = f2.displayName || lodashExports.startCase(lodashExports.camelCase(f2.path));
55334
55353
  });
55335
55354
  function getDisplayName2(path2) {
@@ -55369,6 +55388,27 @@ function validateTableWideErrors({
55369
55388
  });
55370
55389
  });
55371
55390
  }
55391
+ const requireIfs = [];
55392
+ schema.fields.forEach((col) => {
55393
+ const { path: path2, requireIf } = col;
55394
+ if (requireIf) {
55395
+ const requireIfPath = fieldUpperToPath[requireIf.toUpperCase()];
55396
+ requireIfs.push([requireIfPath, path2]);
55397
+ }
55398
+ });
55399
+ requireIfs.forEach(([requireIfPath, path2]) => {
55400
+ entities.forEach((entity) => {
55401
+ const requireIfVal = getCellVal(entity, requireIfPath);
55402
+ const pathVal = getCellVal(entity, path2);
55403
+ if (requireIfVal && !pathVal) {
55404
+ const cellId = `${getIdOrCodeOrIndex(entity)}:${path2}`;
55405
+ newCellValidate[cellId] = {
55406
+ message: `This field is required if ${displayNameMap[requireIfPath]} is present`,
55407
+ _isTableWideError: true
55408
+ };
55409
+ }
55410
+ });
55411
+ });
55372
55412
  if (schema.requireAllOrNone) {
55373
55413
  (lodashExports.isArray(schema.requireAllOrNone[0]) ? schema.requireAllOrNone : [schema.requireAllOrNone]).forEach((reqs) => {
55374
55414
  entities.forEach((entity) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teselagen/ui",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "main": "./src/index.js",
5
5
  "exports": {
6
6
  ".": {
@@ -45,6 +45,7 @@
45
45
  "react-markdown": "8.0.7",
46
46
  "react-redux": "^8.0.5",
47
47
  "react-rnd": "^10.2.4",
48
+ "react-router-dom": "^4.3.1",
48
49
  "react-sortable-hoc": "^0.6.8",
49
50
  "react-transition-group": "^2.4.0",
50
51
  "recompose": "npm:react-recompose@0.31.1",
@@ -28,7 +28,10 @@ export function validateTableWideErrors({
28
28
  });
29
29
  }
30
30
  const displayNameMap = {};
31
+ const fieldUpperToPath = {};
32
+
31
33
  forEach(schema.fields, f => {
34
+ fieldUpperToPath[f.path.toUpperCase()] = f.path;
32
35
  displayNameMap[f.path] = f.displayName || startCase(camelCase(f.path));
33
36
  });
34
37
  function getDisplayName(path) {
@@ -80,6 +83,28 @@ export function validateTableWideErrors({
80
83
  });
81
84
  });
82
85
  }
86
+
87
+ const requireIfs = [];
88
+ schema.fields.forEach(col => {
89
+ const { path, requireIf } = col;
90
+ if (requireIf) {
91
+ const requireIfPath = fieldUpperToPath[requireIf.toUpperCase()];
92
+ requireIfs.push([requireIfPath, path]);
93
+ }
94
+ });
95
+ requireIfs.forEach(([requireIfPath, path]) => {
96
+ entities.forEach(entity => {
97
+ const requireIfVal = getCellVal(entity, requireIfPath);
98
+ const pathVal = getCellVal(entity, path);
99
+ if (requireIfVal && !pathVal) {
100
+ const cellId = `${getIdOrCodeOrIndex(entity)}:${path}`;
101
+ newCellValidate[cellId] = {
102
+ message: `This field is required if ${displayNameMap[requireIfPath]} is present`,
103
+ _isTableWideError: true
104
+ };
105
+ }
106
+ });
107
+ });
83
108
  if (schema.requireAllOrNone) {
84
109
  (isArray(schema.requireAllOrNone[0])
85
110
  ? schema.requireAllOrNone