@teselagen/ui 0.3.10 → 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 +99 -127
  2. package/index.mjs +99 -127
  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 +36 -37
  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;
@@ -30475,20 +30475,12 @@ var _cof = function (it) {
30475
30475
  return toString$6.call(it).slice(8, -1);
30476
30476
  };
30477
30477
 
30478
- var _iobject;
30479
- var hasRequired_iobject;
30480
-
30481
- function require_iobject () {
30482
- if (hasRequired_iobject) return _iobject;
30483
- hasRequired_iobject = 1;
30484
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
30485
- var cof = _cof;
30486
- // eslint-disable-next-line no-prototype-builtins
30487
- _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
30488
- return cof(it) == 'String' ? it.split('') : Object(it);
30489
- };
30490
- return _iobject;
30491
- }
30478
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
30479
+ var cof$2 = _cof;
30480
+ // eslint-disable-next-line no-prototype-builtins
30481
+ var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
30482
+ return cof$2(it) == 'String' ? it.split('') : Object(it);
30483
+ };
30492
30484
 
30493
30485
  // 7.2.1 RequireObjectCoercible(argument)
30494
30486
  var _defined = function (it) {
@@ -30497,7 +30489,7 @@ var _defined = function (it) {
30497
30489
  };
30498
30490
 
30499
30491
  // to indexed object, toObject with fallback for non-array-like ES3 strings
30500
- var IObject = require_iobject();
30492
+ var IObject = _iobject;
30501
30493
  var defined$2 = _defined;
30502
30494
  var _toIobject = function (it) {
30503
30495
  return IObject(defined$2(it));
@@ -30583,14 +30575,14 @@ var _sharedKey = function (key) {
30583
30575
  var has$a = _has;
30584
30576
  var toIObject$4 = _toIobject;
30585
30577
  var arrayIndexOf = _arrayIncludes(false);
30586
- var IE_PROTO$1 = _sharedKey('IE_PROTO');
30578
+ var IE_PROTO$2 = _sharedKey('IE_PROTO');
30587
30579
 
30588
30580
  var _objectKeysInternal = function (object, names) {
30589
30581
  var O = toIObject$4(object);
30590
30582
  var i = 0;
30591
30583
  var result = [];
30592
30584
  var key;
30593
- 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);
30594
30586
  // Don't enum bug & hidden keys
30595
30587
  while (names.length > i) if (has$a(O, key = names[i++])) {
30596
30588
  ~arrayIndexOf(result, key) || result.push(key);
@@ -30605,10 +30597,10 @@ var _enumBugKeys = (
30605
30597
 
30606
30598
  // 19.1.2.14 / 15.2.3.14 Object.keys(O)
30607
30599
  var $keys$3 = _objectKeysInternal;
30608
- var enumBugKeys = _enumBugKeys;
30600
+ var enumBugKeys$1 = _enumBugKeys;
30609
30601
 
30610
30602
  var _objectKeys = Object.keys || function keys(O) {
30611
- return $keys$3(O, enumBugKeys);
30603
+ return $keys$3(O, enumBugKeys$1);
30612
30604
  };
30613
30605
 
30614
30606
  var _objectGops = {};
@@ -30644,7 +30636,7 @@ function require_objectAssign () {
30644
30636
  var gOPS = _objectGops;
30645
30637
  var pIE = require_objectPie();
30646
30638
  var toObject = _toObject;
30647
- var IObject = require_iobject();
30639
+ var IObject = _iobject;
30648
30640
  var $assign = Object.assign;
30649
30641
 
30650
30642
  // should work with symbols and should have deterministic property order (V8 bug)
@@ -30715,27 +30707,19 @@ var _iterators = {};
30715
30707
 
30716
30708
  var _redefine = _hide;
30717
30709
 
30718
- var _objectDps;
30719
- var hasRequired_objectDps;
30720
-
30721
- function require_objectDps () {
30722
- if (hasRequired_objectDps) return _objectDps;
30723
- hasRequired_objectDps = 1;
30724
- var dP = _objectDp;
30725
- var anObject = _anObject;
30726
- var getKeys = _objectKeys;
30710
+ var dP$1 = _objectDp;
30711
+ var anObject$4 = _anObject;
30712
+ var getKeys$1 = _objectKeys;
30727
30713
 
30728
- _objectDps = _descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
30729
- anObject(O);
30730
- var keys = getKeys(Properties);
30731
- var length = keys.length;
30732
- var i = 0;
30733
- var P;
30734
- while (length > i) dP.f(O, P = keys[i++], Properties[P]);
30735
- return O;
30736
- };
30737
- return _objectDps;
30738
- }
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
+ };
30739
30723
 
30740
30724
  var _html;
30741
30725
  var hasRequired_html;
@@ -30748,55 +30732,47 @@ function require_html () {
30748
30732
  return _html;
30749
30733
  }
30750
30734
 
30751
- var _objectCreate;
30752
- var hasRequired_objectCreate;
30753
-
30754
- function require_objectCreate () {
30755
- if (hasRequired_objectCreate) return _objectCreate;
30756
- hasRequired_objectCreate = 1;
30757
- // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
30758
- var anObject = _anObject;
30759
- var dPs = require_objectDps();
30760
- var enumBugKeys = _enumBugKeys;
30761
- var IE_PROTO = _sharedKey('IE_PROTO');
30762
- var Empty = function () { /* empty */ };
30763
- var PROTOTYPE = 'prototype';
30764
-
30765
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
30766
- var createDict = function () {
30767
- // Thrash, waste and sodomy: IE GC bug
30768
- var iframe = require_domCreate()('iframe');
30769
- var i = enumBugKeys.length;
30770
- var lt = '<';
30771
- var gt = '>';
30772
- var iframeDocument;
30773
- iframe.style.display = 'none';
30774
- require_html().appendChild(iframe);
30775
- iframe.src = 'javascript:'; // eslint-disable-line no-script-url
30776
- // createDict = iframe.contentWindow.Object;
30777
- // html.removeChild(iframe);
30778
- iframeDocument = iframe.contentWindow.document;
30779
- iframeDocument.open();
30780
- iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
30781
- iframeDocument.close();
30782
- createDict = iframeDocument.F;
30783
- while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
30784
- return createDict();
30785
- };
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';
30786
30742
 
30787
- _objectCreate = Object.create || function create(O, Properties) {
30788
- var result;
30789
- if (O !== null) {
30790
- Empty[PROTOTYPE] = anObject(O);
30791
- result = new Empty();
30792
- Empty[PROTOTYPE] = null;
30793
- // add "__proto__" for Object.getPrototypeOf polyfill
30794
- result[IE_PROTO] = O;
30795
- } else result = createDict();
30796
- return Properties === undefined ? result : dPs(result, Properties);
30797
- };
30798
- return _objectCreate;
30799
- }
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
+ };
30800
30776
 
30801
30777
  var _wks = {exports: {}};
30802
30778
 
@@ -30822,7 +30798,7 @@ var _setToStringTag = function (it, tag, stat) {
30822
30798
  if (it && !has$9(it = stat ? it : it.prototype, TAG$1)) def(it, TAG$1, { configurable: true, value: tag });
30823
30799
  };
30824
30800
 
30825
- var create$3 = require_objectCreate();
30801
+ var create$3 = _objectCreate;
30826
30802
  var descriptor = _propertyDesc;
30827
30803
  var setToStringTag$2 = _setToStringTag;
30828
30804
  var IteratorPrototype = {};
@@ -31465,7 +31441,7 @@ var toObject$1 = _toObject;
31465
31441
  var toIObject = _toIobject;
31466
31442
  var toPrimitive = _toPrimitive;
31467
31443
  var createDesc = _propertyDesc;
31468
- var _create$1 = require_objectCreate();
31444
+ var _create$1 = _objectCreate;
31469
31445
  var gOPNExt = _objectGopnExt;
31470
31446
  var $GOPD = _objectGopd;
31471
31447
  var $GOPS = _objectGops;
@@ -31775,7 +31751,7 @@ var setPrototypeOf = { "default": setPrototypeOf$1, __esModule: true };
31775
31751
 
31776
31752
  var $export = _export;
31777
31753
  // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
31778
- $export($export.S, 'Object', { create: require_objectCreate() });
31754
+ $export($export.S, 'Object', { create: _objectCreate });
31779
31755
 
31780
31756
  var $Object$1 = _coreExports.Object;
31781
31757
  var create$2 = function create(P, D) {
@@ -85604,13 +85580,7 @@ function withTableParams(compOrOpts, pTopLevelOpts) {
85604
85580
  return {};
85605
85581
  }
85606
85582
  const mergedOpts = getMergedOpts(topLevelOptions, ownProps);
85607
- const {
85608
- formName,
85609
- urlConnected,
85610
- history,
85611
- defaults,
85612
- onlyOneFilter
85613
- } = mergedOpts;
85583
+ const { formName, urlConnected, history, defaults, onlyOneFilter } = mergedOpts;
85614
85584
  function updateSearch(val) {
85615
85585
  setTimeout(function() {
85616
85586
  dispatch(reduxForm.change(formName, "reduxFormSearchInput", val || ""));
@@ -85649,12 +85619,7 @@ function withTableParams(compOrOpts, pTopLevelOpts) {
85649
85619
  action(...args, currentParams);
85650
85620
  };
85651
85621
  });
85652
- const {
85653
- variables,
85654
- selectedEntities,
85655
- mergedOpts,
85656
- ...restStateProps
85657
- } = stateProps;
85622
+ const { variables, selectedEntities, mergedOpts, ...restStateProps } = stateProps;
85658
85623
  const changeFormValue = (...args) => dispatchProps.dispatch(reduxForm.change(formName, ...args));
85659
85624
  const tableParams = {
85660
85625
  changeFormValue,
@@ -85996,7 +85961,8 @@ const dataTableEnhancer = compose(
85996
85961
  // "reduxFormExpandedEntityIdMap"
85997
85962
  // ]
85998
85963
  // }),
85999
- branch((props) => !props.alwaysRerender, pure)
85964
+ branch((props) => !props.alwaysRerender, pure),
85965
+ observer
86000
85966
  );
86001
85967
 
86002
85968
  const defaultProps = {
@@ -89550,7 +89516,9 @@ const wrapDialog = (topLevelDialogProps = {}) => (Component) => (props) => {
89550
89516
  return doNotTriggerClick();
89551
89517
  }
89552
89518
  const parentEl = r.current?.closest(".bp3-dialog-container");
89553
- const dialogs = document.querySelectorAll(".bp3-dialog-container");
89519
+ const dialogs = document.querySelectorAll(
89520
+ ".bp3-dialog-container"
89521
+ );
89554
89522
  const numDialogs = dialogs?.length;
89555
89523
  if (numDialogs > 1) {
89556
89524
  const topMostDialog = dialogs[numDialogs - 1];
@@ -89902,6 +89870,7 @@ function MatchHeaders({
89902
89870
  marginBottom: 10,
89903
89871
  marginLeft: 20,
89904
89872
  fontSize: 10
89873
+ /* color: Colors.RED1 */
89905
89874
  }
89906
89875
  },
89907
89876
  userMatchedHeader && [
@@ -91890,10 +91859,7 @@ const UploadCsvWizardDialog = compose(
91890
91859
  if (props.filesWIssues.length > 0) {
91891
91860
  const reduxFormEntitiesArray = [];
91892
91861
  const finishedFiles = props.filesWIssues.map((f, i) => {
91893
- const {
91894
- reduxFormEntities,
91895
- reduxFormCellValidation
91896
- } = reduxForm.formValueSelector(`editableCellTable-${i}`)(
91862
+ const { reduxFormEntities, reduxFormCellValidation } = reduxForm.formValueSelector(`editableCellTable-${i}`)(
91897
91863
  state,
91898
91864
  "reduxFormEntities",
91899
91865
  "reduxFormCellValidation"
@@ -92270,6 +92236,8 @@ const PreviewCsvData = observer(function(props) {
92270
92236
  userSchema = exampleData,
92271
92237
  initialEntities
92272
92238
  } = props;
92239
+ const rerenderKey = React$1.useRef(0);
92240
+ rerenderKey.current = rerenderKey.current + 1;
92273
92241
  const data = userSchema.userData && userSchema.userData.length && userSchema.userData.map((row) => {
92274
92242
  const toRet = {
92275
92243
  _isClean: row._isClean
@@ -92316,6 +92284,7 @@ const PreviewCsvData = observer(function(props) {
92316
92284
  {
92317
92285
  maxWidth: 800,
92318
92286
  maxHeight: 500,
92287
+ rerenderKey: rerenderKey.current,
92319
92288
  destroyOnUnmount: false,
92320
92289
  doNotValidateUntouchedRows: true,
92321
92290
  formName: datatableFormName || "editableCellTable",
@@ -104272,7 +104241,14 @@ const EnhancedMenuItem = compose(
104272
104241
  }
104273
104242
  }),
104274
104243
  branch(({ navTo }) => navTo, withRouter$1)
104275
- )(function({ navTo, context, staticContext, didMount, willUnmount, ...props }) {
104244
+ )(function({
104245
+ navTo,
104246
+ context,
104247
+ staticContext,
104248
+ didMount,
104249
+ willUnmount,
104250
+ ...props
104251
+ }) {
104276
104252
  let MenuItemComp = core$5.MenuItem;
104277
104253
  if (navTo) {
104278
104254
  MenuItemComp = MenuItemLink;
@@ -105654,11 +105630,7 @@ function getCommandHotkeyHandlers(commands) {
105654
105630
  return handlers;
105655
105631
  }
105656
105632
 
105657
- const withCommand = (mappings) => (WrappedComponent) => ({
105658
- cmd,
105659
- cmdOptions = {},
105660
- ...props
105661
- }) => {
105633
+ const withCommand = (mappings) => (WrappedComponent) => ({ cmd, cmdOptions = {}, ...props }) => {
105662
105634
  const mappedProps = {};
105663
105635
  Object.keys(mappings).forEach((k) => {
105664
105636
  mappedProps[k] = mappings[k] === "execute" ? (event) => cmd.execute({ event }) : typeof mappings[k] === "function" ? mappings[k](cmd, props) : cmd[mappings[k]];