@teselagen/ui 0.3.9 → 0.3.11

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.
Files changed (35) hide show
  1. package/index.js +102 -128
  2. package/index.mjs +102 -128
  3. package/package.json +1 -1
  4. package/src/AdvancedOptions.spec.js +3 -1
  5. package/src/DataTable/CellDragHandle.js +8 -8
  6. package/src/DataTable/FilterAndSortMenu.js +13 -13
  7. package/src/DataTable/PagingTool.js +10 -8
  8. package/src/DataTable/dataTableEnhancer.js +11 -9
  9. package/src/DataTable/index.js +115 -116
  10. package/src/DataTable/utils/queryParams.js +48 -48
  11. package/src/DataTable/utils/withTableParams.js +9 -18
  12. package/src/DialogFooter/index.js +1 -1
  13. package/src/FormComponents/Uploader.js +38 -38
  14. package/src/FormComponents/index.js +58 -58
  15. package/src/FormComponents/sortify.js +1 -1
  16. package/src/FormComponents/tryToMatchSchemas.js +4 -5
  17. package/src/MatchHeaders.js +19 -19
  18. package/src/MenuBar/index.js +10 -3
  19. package/src/PromptUnsavedChanges/index.js +1 -3
  20. package/src/UploadCsvWizard.js +12 -12
  21. package/src/autoTooltip.js +2 -2
  22. package/src/enhancers/withDialog/index.js +6 -6
  23. package/src/rerenderOnWindowResize.js +14 -15
  24. package/src/showConfirmationDialog/index.js +1 -3
  25. package/src/utils/basicHandleActionsWithFullState.js +5 -5
  26. package/src/utils/combineReducersWithFullState.js +9 -9
  27. package/src/utils/commandControls.js +21 -22
  28. package/src/utils/handlerHelpers.js +4 -4
  29. package/src/utils/hotkeyUtils.js +10 -8
  30. package/src/utils/menuUtils.js +79 -66
  31. package/src/utils/pureNoFunc.js +1 -1
  32. package/src/utils/renderOnDoc.js +2 -2
  33. package/src/utils/tgFormValues.js +23 -20
  34. package/src/utils/withSelectTableRecords.js +25 -23
  35. package/src/wrapDialog.js +98 -92
package/index.js CHANGED
@@ -30366,17 +30366,17 @@ var _toPrimitive = function (it, S) {
30366
30366
  throw TypeError("Can't convert object to primitive value");
30367
30367
  };
30368
30368
 
30369
- var anObject$3 = _anObject;
30369
+ var anObject$5 = _anObject;
30370
30370
  var IE8_DOM_DEFINE$1 = _ie8DomDefine;
30371
30371
  var toPrimitive$2 = _toPrimitive;
30372
- var dP$2 = Object.defineProperty;
30372
+ var dP$3 = Object.defineProperty;
30373
30373
 
30374
30374
  _objectDp.f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {
30375
- anObject$3(O);
30375
+ anObject$5(O);
30376
30376
  P = toPrimitive$2(P, true);
30377
- anObject$3(Attributes);
30377
+ anObject$5(Attributes);
30378
30378
  if (IE8_DOM_DEFINE$1) try {
30379
- return dP$2(O, P, Attributes);
30379
+ return dP$3(O, P, Attributes);
30380
30380
  } catch (e) { /* empty */ }
30381
30381
  if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
30382
30382
  if ('value' in Attributes) O[P] = Attributes.value;
@@ -30392,10 +30392,10 @@ var _propertyDesc = function (bitmap, value) {
30392
30392
  };
30393
30393
  };
30394
30394
 
30395
- var dP$1 = _objectDp;
30395
+ var dP$2 = _objectDp;
30396
30396
  var createDesc$3 = _propertyDesc;
30397
30397
  var _hide = _descriptors ? function (object, key, value) {
30398
- return dP$1.f(object, key, createDesc$3(1, value));
30398
+ return dP$2.f(object, key, createDesc$3(1, value));
30399
30399
  } : function (object, key, value) {
30400
30400
  object[key] = value;
30401
30401
  return object;
@@ -30411,7 +30411,7 @@ var core$3 = _coreExports;
30411
30411
  var ctx$1 = _ctx;
30412
30412
  var hide$2 = _hide;
30413
30413
  var has$b = _has;
30414
- var PROTOTYPE$1 = 'prototype';
30414
+ var PROTOTYPE$2 = 'prototype';
30415
30415
 
30416
30416
  var $export$8 = function (type, name, source) {
30417
30417
  var IS_FORCED = type & $export$8.F;
@@ -30421,8 +30421,8 @@ var $export$8 = function (type, name, source) {
30421
30421
  var IS_BIND = type & $export$8.B;
30422
30422
  var IS_WRAP = type & $export$8.W;
30423
30423
  var exports = IS_GLOBAL ? core$3 : core$3[name] || (core$3[name] = {});
30424
- var expProto = exports[PROTOTYPE$1];
30425
- var target = IS_GLOBAL ? global$4 : IS_STATIC ? global$4[name] : (global$4[name] || {})[PROTOTYPE$1];
30424
+ var expProto = exports[PROTOTYPE$2];
30425
+ var target = IS_GLOBAL ? global$4 : IS_STATIC ? global$4[name] : (global$4[name] || {})[PROTOTYPE$2];
30426
30426
  var key, own, out;
30427
30427
  if (IS_GLOBAL) source = name;
30428
30428
  for (key in source) {
@@ -30446,7 +30446,7 @@ var $export$8 = function (type, name, source) {
30446
30446
  } return new C(a, b, c);
30447
30447
  } return C.apply(this, arguments);
30448
30448
  };
30449
- F[PROTOTYPE$1] = C[PROTOTYPE$1];
30449
+ F[PROTOTYPE$2] = C[PROTOTYPE$2];
30450
30450
  return F;
30451
30451
  // make static versions for prototype methods
30452
30452
  })(out) : IS_PROTO && typeof out == 'function' ? ctx$1(Function.call, out) : out;
@@ -30575,14 +30575,14 @@ var _sharedKey = function (key) {
30575
30575
  var has$a = _has;
30576
30576
  var toIObject$4 = _toIobject;
30577
30577
  var arrayIndexOf = _arrayIncludes(false);
30578
- var IE_PROTO$1 = _sharedKey('IE_PROTO');
30578
+ var IE_PROTO$2 = _sharedKey('IE_PROTO');
30579
30579
 
30580
30580
  var _objectKeysInternal = function (object, names) {
30581
30581
  var O = toIObject$4(object);
30582
30582
  var i = 0;
30583
30583
  var result = [];
30584
30584
  var key;
30585
- for (key in O) if (key != IE_PROTO$1) has$a(O, key) && result.push(key);
30585
+ for (key in O) if (key != IE_PROTO$2) has$a(O, key) && result.push(key);
30586
30586
  // Don't enum bug & hidden keys
30587
30587
  while (names.length > i) if (has$a(O, key = names[i++])) {
30588
30588
  ~arrayIndexOf(result, key) || result.push(key);
@@ -30596,11 +30596,11 @@ var _enumBugKeys = (
30596
30596
  ).split(',');
30597
30597
 
30598
30598
  // 19.1.2.14 / 15.2.3.14 Object.keys(O)
30599
- var $keys$2 = _objectKeysInternal;
30600
- var enumBugKeys = _enumBugKeys;
30599
+ var $keys$3 = _objectKeysInternal;
30600
+ var enumBugKeys$1 = _enumBugKeys;
30601
30601
 
30602
30602
  var _objectKeys = Object.keys || function keys(O) {
30603
- return $keys$2(O, enumBugKeys);
30603
+ return $keys$3(O, enumBugKeys$1);
30604
30604
  };
30605
30605
 
30606
30606
  var _objectGops = {};
@@ -30707,27 +30707,19 @@ var _iterators = {};
30707
30707
 
30708
30708
  var _redefine = _hide;
30709
30709
 
30710
- var _objectDps;
30711
- var hasRequired_objectDps;
30712
-
30713
- function require_objectDps () {
30714
- if (hasRequired_objectDps) return _objectDps;
30715
- hasRequired_objectDps = 1;
30716
- var dP = _objectDp;
30717
- var anObject = _anObject;
30718
- var getKeys = _objectKeys;
30710
+ var dP$1 = _objectDp;
30711
+ var anObject$4 = _anObject;
30712
+ var getKeys$1 = _objectKeys;
30719
30713
 
30720
- _objectDps = _descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
30721
- anObject(O);
30722
- var keys = getKeys(Properties);
30723
- var length = keys.length;
30724
- var i = 0;
30725
- var P;
30726
- while (length > i) dP.f(O, P = keys[i++], Properties[P]);
30727
- return O;
30728
- };
30729
- return _objectDps;
30730
- }
30714
+ var _objectDps = _descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
30715
+ anObject$4(O);
30716
+ var keys = getKeys$1(Properties);
30717
+ var length = keys.length;
30718
+ var i = 0;
30719
+ var P;
30720
+ while (length > i) dP$1.f(O, P = keys[i++], Properties[P]);
30721
+ return O;
30722
+ };
30731
30723
 
30732
30724
  var _html;
30733
30725
  var hasRequired_html;
@@ -30740,55 +30732,47 @@ function require_html () {
30740
30732
  return _html;
30741
30733
  }
30742
30734
 
30743
- var _objectCreate;
30744
- var hasRequired_objectCreate;
30745
-
30746
- function require_objectCreate () {
30747
- if (hasRequired_objectCreate) return _objectCreate;
30748
- hasRequired_objectCreate = 1;
30749
- // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
30750
- var anObject = _anObject;
30751
- var dPs = require_objectDps();
30752
- var enumBugKeys = _enumBugKeys;
30753
- var IE_PROTO = _sharedKey('IE_PROTO');
30754
- var Empty = function () { /* empty */ };
30755
- var PROTOTYPE = 'prototype';
30756
-
30757
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
30758
- var createDict = function () {
30759
- // Thrash, waste and sodomy: IE GC bug
30760
- var iframe = require_domCreate()('iframe');
30761
- var i = enumBugKeys.length;
30762
- var lt = '<';
30763
- var gt = '>';
30764
- var iframeDocument;
30765
- iframe.style.display = 'none';
30766
- require_html().appendChild(iframe);
30767
- iframe.src = 'javascript:'; // eslint-disable-line no-script-url
30768
- // createDict = iframe.contentWindow.Object;
30769
- // html.removeChild(iframe);
30770
- iframeDocument = iframe.contentWindow.document;
30771
- iframeDocument.open();
30772
- iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
30773
- iframeDocument.close();
30774
- createDict = iframeDocument.F;
30775
- while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
30776
- return createDict();
30777
- };
30735
+ // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
30736
+ var anObject$3 = _anObject;
30737
+ var dPs = _objectDps;
30738
+ var enumBugKeys = _enumBugKeys;
30739
+ var IE_PROTO$1 = _sharedKey('IE_PROTO');
30740
+ var Empty = function () { /* empty */ };
30741
+ var PROTOTYPE$1 = 'prototype';
30778
30742
 
30779
- _objectCreate = Object.create || function create(O, Properties) {
30780
- var result;
30781
- if (O !== null) {
30782
- Empty[PROTOTYPE] = anObject(O);
30783
- result = new Empty();
30784
- Empty[PROTOTYPE] = null;
30785
- // add "__proto__" for Object.getPrototypeOf polyfill
30786
- result[IE_PROTO] = O;
30787
- } else result = createDict();
30788
- return Properties === undefined ? result : dPs(result, Properties);
30789
- };
30790
- return _objectCreate;
30791
- }
30743
+ // Create object with fake `null` prototype: use iframe Object with cleared prototype
30744
+ var createDict = function () {
30745
+ // Thrash, waste and sodomy: IE GC bug
30746
+ var iframe = require_domCreate()('iframe');
30747
+ var i = enumBugKeys.length;
30748
+ var lt = '<';
30749
+ var gt = '>';
30750
+ var iframeDocument;
30751
+ iframe.style.display = 'none';
30752
+ require_html().appendChild(iframe);
30753
+ iframe.src = 'javascript:'; // eslint-disable-line no-script-url
30754
+ // createDict = iframe.contentWindow.Object;
30755
+ // html.removeChild(iframe);
30756
+ iframeDocument = iframe.contentWindow.document;
30757
+ iframeDocument.open();
30758
+ iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
30759
+ iframeDocument.close();
30760
+ createDict = iframeDocument.F;
30761
+ while (i--) delete createDict[PROTOTYPE$1][enumBugKeys[i]];
30762
+ return createDict();
30763
+ };
30764
+
30765
+ var _objectCreate = Object.create || function create(O, Properties) {
30766
+ var result;
30767
+ if (O !== null) {
30768
+ Empty[PROTOTYPE$1] = anObject$3(O);
30769
+ result = new Empty();
30770
+ Empty[PROTOTYPE$1] = null;
30771
+ // add "__proto__" for Object.getPrototypeOf polyfill
30772
+ result[IE_PROTO$1] = O;
30773
+ } else result = createDict();
30774
+ return Properties === undefined ? result : dPs(result, Properties);
30775
+ };
30792
30776
 
30793
30777
  var _wks = {exports: {}};
30794
30778
 
@@ -30814,7 +30798,7 @@ var _setToStringTag = function (it, tag, stat) {
30814
30798
  if (it && !has$9(it = stat ? it : it.prototype, TAG$1)) def(it, TAG$1, { configurable: true, value: tag });
30815
30799
  };
30816
30800
 
30817
- var create$3 = require_objectCreate();
30801
+ var create$3 = _objectCreate;
30818
30802
  var descriptor = _propertyDesc;
30819
30803
  var setToStringTag$2 = _setToStringTag;
30820
30804
  var IteratorPrototype = {};
@@ -31388,24 +31372,17 @@ var _objectGopnExt = {};
31388
31372
 
31389
31373
  var _objectGopn = {};
31390
31374
 
31391
- var hasRequired_objectGopn;
31392
-
31393
- function require_objectGopn () {
31394
- if (hasRequired_objectGopn) return _objectGopn;
31395
- hasRequired_objectGopn = 1;
31396
- // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
31397
- var $keys = _objectKeysInternal;
31398
- var hiddenKeys = _enumBugKeys.concat('length', 'prototype');
31375
+ // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
31376
+ var $keys$2 = _objectKeysInternal;
31377
+ var hiddenKeys = _enumBugKeys.concat('length', 'prototype');
31399
31378
 
31400
- _objectGopn.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
31401
- return $keys(O, hiddenKeys);
31402
- };
31403
- return _objectGopn;
31404
- }
31379
+ _objectGopn.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
31380
+ return $keys$2(O, hiddenKeys);
31381
+ };
31405
31382
 
31406
31383
  // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
31407
31384
  var toIObject$2 = _toIobject;
31408
- var gOPN$1 = require_objectGopn().f;
31385
+ var gOPN$1 = _objectGopn.f;
31409
31386
  var toString$5 = {}.toString;
31410
31387
 
31411
31388
  var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
@@ -31464,7 +31441,7 @@ var toObject$1 = _toObject;
31464
31441
  var toIObject = _toIobject;
31465
31442
  var toPrimitive = _toPrimitive;
31466
31443
  var createDesc = _propertyDesc;
31467
- var _create$1 = require_objectCreate();
31444
+ var _create$1 = _objectCreate;
31468
31445
  var gOPNExt = _objectGopnExt;
31469
31446
  var $GOPD = _objectGopd;
31470
31447
  var $GOPS = _objectGops;
@@ -31592,7 +31569,7 @@ if (!USE_NATIVE) {
31592
31569
 
31593
31570
  $GOPD.f = $getOwnPropertyDescriptor;
31594
31571
  $DP.f = $defineProperty;
31595
- require_objectGopn().f = gOPNExt.f = $getOwnPropertyNames;
31572
+ _objectGopn.f = gOPNExt.f = $getOwnPropertyNames;
31596
31573
  require_objectPie().f = $propertyIsEnumerable;
31597
31574
  $GOPS.f = $getOwnPropertySymbols;
31598
31575
 
@@ -31774,7 +31751,7 @@ var setPrototypeOf = { "default": setPrototypeOf$1, __esModule: true };
31774
31751
 
31775
31752
  var $export = _export;
31776
31753
  // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
31777
- $export($export.S, 'Object', { create: require_objectCreate() });
31754
+ $export($export.S, 'Object', { create: _objectCreate });
31778
31755
 
31779
31756
  var $Object$1 = _coreExports.Object;
31780
31757
  var create$2 = function create(P, D) {
@@ -85603,13 +85580,7 @@ function withTableParams(compOrOpts, pTopLevelOpts) {
85603
85580
  return {};
85604
85581
  }
85605
85582
  const mergedOpts = getMergedOpts(topLevelOptions, ownProps);
85606
- const {
85607
- formName,
85608
- urlConnected,
85609
- history,
85610
- defaults,
85611
- onlyOneFilter
85612
- } = mergedOpts;
85583
+ const { formName, urlConnected, history, defaults, onlyOneFilter } = mergedOpts;
85613
85584
  function updateSearch(val) {
85614
85585
  setTimeout(function() {
85615
85586
  dispatch(reduxForm.change(formName, "reduxFormSearchInput", val || ""));
@@ -85648,12 +85619,7 @@ function withTableParams(compOrOpts, pTopLevelOpts) {
85648
85619
  action(...args, currentParams);
85649
85620
  };
85650
85621
  });
85651
- const {
85652
- variables,
85653
- selectedEntities,
85654
- mergedOpts,
85655
- ...restStateProps
85656
- } = stateProps;
85622
+ const { variables, selectedEntities, mergedOpts, ...restStateProps } = stateProps;
85657
85623
  const changeFormValue = (...args) => dispatchProps.dispatch(reduxForm.change(formName, ...args));
85658
85624
  const tableParams = {
85659
85625
  changeFormValue,
@@ -85995,7 +85961,8 @@ const dataTableEnhancer = compose(
85995
85961
  // "reduxFormExpandedEntityIdMap"
85996
85962
  // ]
85997
85963
  // }),
85998
- branch((props) => !props.alwaysRerender, pure)
85964
+ branch((props) => !props.alwaysRerender, pure),
85965
+ observer
85999
85966
  );
86000
85967
 
86001
85968
  const defaultProps = {
@@ -89549,7 +89516,9 @@ const wrapDialog = (topLevelDialogProps = {}) => (Component) => (props) => {
89549
89516
  return doNotTriggerClick();
89550
89517
  }
89551
89518
  const parentEl = r.current?.closest(".bp3-dialog-container");
89552
- const dialogs = document.querySelectorAll(".bp3-dialog-container");
89519
+ const dialogs = document.querySelectorAll(
89520
+ ".bp3-dialog-container"
89521
+ );
89553
89522
  const numDialogs = dialogs?.length;
89554
89523
  if (numDialogs > 1) {
89555
89524
  const topMostDialog = dialogs[numDialogs - 1];
@@ -89901,6 +89870,7 @@ function MatchHeaders({
89901
89870
  marginBottom: 10,
89902
89871
  marginLeft: 20,
89903
89872
  fontSize: 10
89873
+ /* color: Colors.RED1 */
89904
89874
  }
89905
89875
  },
89906
89876
  userMatchedHeader && [
@@ -91889,10 +91859,7 @@ const UploadCsvWizardDialog = compose(
91889
91859
  if (props.filesWIssues.length > 0) {
91890
91860
  const reduxFormEntitiesArray = [];
91891
91861
  const finishedFiles = props.filesWIssues.map((f, i) => {
91892
- const {
91893
- reduxFormEntities,
91894
- reduxFormCellValidation
91895
- } = reduxForm.formValueSelector(`editableCellTable-${i}`)(
91862
+ const { reduxFormEntities, reduxFormCellValidation } = reduxForm.formValueSelector(`editableCellTable-${i}`)(
91896
91863
  state,
91897
91864
  "reduxFormEntities",
91898
91865
  "reduxFormCellValidation"
@@ -92269,6 +92236,8 @@ const PreviewCsvData = observer(function(props) {
92269
92236
  userSchema = exampleData,
92270
92237
  initialEntities
92271
92238
  } = props;
92239
+ const rerenderKey = React$1.useRef(0);
92240
+ rerenderKey.current = rerenderKey.current + 1;
92272
92241
  const data = userSchema.userData && userSchema.userData.length && userSchema.userData.map((row) => {
92273
92242
  const toRet = {
92274
92243
  _isClean: row._isClean
@@ -92315,6 +92284,7 @@ const PreviewCsvData = observer(function(props) {
92315
92284
  {
92316
92285
  maxWidth: 800,
92317
92286
  maxHeight: 500,
92287
+ rerenderKey: rerenderKey.current,
92318
92288
  destroyOnUnmount: false,
92319
92289
  doNotValidateUntouchedRows: true,
92320
92290
  formName: datatableFormName || "editableCellTable",
@@ -100366,9 +100336,10 @@ function UploaderInner({
100366
100336
  }, 200);
100367
100337
  }
100368
100338
  }
100339
+ } else {
100340
+ toKeep.push(...cleanedAccepted);
100369
100341
  }
100370
100342
  if (toKeep.length === 0) {
100371
- console.log(`asdfasdfas`);
100372
100343
  window.toastr && window.toastr.error(
100373
100344
  `It looks like there wasn't any data in your file. Please add some data and try again`
100374
100345
  );
@@ -104270,7 +104241,14 @@ const EnhancedMenuItem = compose(
104270
104241
  }
104271
104242
  }),
104272
104243
  branch(({ navTo }) => navTo, withRouter$1)
104273
- )(function({ navTo, context, staticContext, didMount, willUnmount, ...props }) {
104244
+ )(function({
104245
+ navTo,
104246
+ context,
104247
+ staticContext,
104248
+ didMount,
104249
+ willUnmount,
104250
+ ...props
104251
+ }) {
104274
104252
  let MenuItemComp = core$5.MenuItem;
104275
104253
  if (navTo) {
104276
104254
  MenuItemComp = MenuItemLink;
@@ -105652,11 +105630,7 @@ function getCommandHotkeyHandlers(commands) {
105652
105630
  return handlers;
105653
105631
  }
105654
105632
 
105655
- const withCommand = (mappings) => (WrappedComponent) => ({
105656
- cmd,
105657
- cmdOptions = {},
105658
- ...props
105659
- }) => {
105633
+ const withCommand = (mappings) => (WrappedComponent) => ({ cmd, cmdOptions = {}, ...props }) => {
105660
105634
  const mappedProps = {};
105661
105635
  Object.keys(mappings).forEach((k) => {
105662
105636
  mappedProps[k] = mappings[k] === "execute" ? (event) => cmd.execute({ event }) : typeof mappings[k] === "function" ? mappings[k](cmd, props) : cmd[mappings[k]];