@teselagen/ove 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.es.js CHANGED
@@ -59,13 +59,13 @@ var __async = (__this, __arguments, generator) => {
59
59
  var _q, _r, _s, _t, _u, _x, _A, _H;
60
60
  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, KeyCombo, AnchorButton, Slider as Slider$1, ButtonGroup, HTMLSelect, Label, ResizeSensor, FocusStyleManager } from "@blueprintjs/core";
61
61
  import * as React$2 from "react";
62
- import React__default$1, { forwardRef, useImperativeHandle, Fragment, useMemo as useMemo$1, useRef, useReducer, useEffect, useCallback as useCallback$1, useState, memo, Component, PureComponent, createElement, isValidElement, useContext, useLayoutEffect as useLayoutEffect$1 } from "react";
62
+ import React__default$1, { useState, useEffect, forwardRef, useImperativeHandle, Fragment, useMemo as useMemo$1, useRef, useReducer, useCallback as useCallback$1, memo, Component, PureComponent, createElement, isValidElement, useContext, useLayoutEffect as useLayoutEffect$1 } from "react";
63
63
  import ReactDOM$1, { unstable_batchedUpdates, findDOMNode as findDOMNode$1, flushSync, unmountComponentAtNode, render as render$2 } from "react-dom";
64
64
  import { FormName, formValueSelector, change, Field, reduxForm, SubmissionError, destroy as destroy$1, initialize, reducer as reducer$3, getFormValues, FieldArray } from "redux-form";
65
65
  import { connect, useStore, Provider } from "react-redux";
66
66
  import { getCreateNewItem, MultiSelect, Suggest } from "@blueprintjs/select";
67
+ import { compose as compose$1, combineReducers, createStore as createStore$2, applyMiddleware, bindActionCreators } from "redux";
67
68
  import { DateRangeInput, DateInput } from "@blueprintjs/datetime";
68
- import { combineReducers, compose as compose$1, createStore as createStore$2, applyMiddleware, bindActionCreators } from "redux";
69
69
  const blueprint = "";
70
70
  const blueprintDatetime = "";
71
71
  const blueprintIcons = "";
@@ -3023,7 +3023,7 @@ let clearMe;
3023
3023
  inner2(dataTip, el, opts2);
3024
3024
  break;
3025
3025
  } else if (isEllipsized && el.offsetWidth < el.scrollWidth - 4 && //the -4 is adding a teeny bit of tolerance to fix issues with the column headers getting tooltips even when fully visible
3026
- !el.classList.contains("no-data-tip") && !document.body.classList.contains("drag-active") && el.textContent && ((_b2 = (_a2 = el.textContent) == null ? void 0 : _a2.trim) == null ? void 0 : _b2.call(_a2).length) !== 0) {
3026
+ !el.classList.contains("no-data-tip") && !parentIncludesNoChildDataTip(el, 0) && !document.body.classList.contains("drag-active") && el.textContent && ((_b2 = (_a2 = el.textContent) == null ? void 0 : _a2.trim) == null ? void 0 : _b2.call(_a2).length) !== 0) {
3027
3027
  inner2(el.textContent, el, opts2);
3028
3028
  break;
3029
3029
  } else if (isEllipsized && el.offsetWidth >= el.scrollWidth)
@@ -3036,6 +3036,28 @@ let clearMe;
3036
3036
  }
3037
3037
  });
3038
3038
  })();
3039
+ function parentIncludesNoChildDataTip(el, count2) {
3040
+ if (count2 > 4)
3041
+ return false;
3042
+ if (!el)
3043
+ return false;
3044
+ if (el.getAttribute("data-no-child-data-tip"))
3045
+ return true;
3046
+ return parentIncludesNoChildDataTip(el.parentElement, count2 + 1);
3047
+ }
3048
+ __name(parentIncludesNoChildDataTip, "parentIncludesNoChildDataTip");
3049
+ const LoadingDots = /* @__PURE__ */ __name(() => {
3050
+ const [dots, setDots] = useState("");
3051
+ useEffect(() => {
3052
+ const interval = setInterval(() => {
3053
+ setDots((dots2) => {
3054
+ return dots2.length === 3 ? "" : dots2 + ".";
3055
+ });
3056
+ }, 500);
3057
+ return () => clearInterval(interval);
3058
+ }, []);
3059
+ return /* @__PURE__ */ React__default$1.createElement("span", null, dots);
3060
+ }, "LoadingDots");
3039
3061
  const AssignDefaultsModeContext = React__default$1.createContext({
3040
3062
  inAssignDefaultsMode: false,
3041
3063
  // eslint-disable-next-line @typescript-eslint/no-empty-function
@@ -16915,11 +16937,20 @@ var _fails = /* @__PURE__ */ __name(function(exec) {
16915
16937
  return true;
16916
16938
  }
16917
16939
  }, "_fails");
16918
- var _descriptors = !_fails(function() {
16919
- return Object.defineProperty({}, "a", { get: function() {
16920
- return 7;
16921
- } }).a != 7;
16922
- });
16940
+ var _descriptors;
16941
+ var hasRequired_descriptors;
16942
+ function require_descriptors() {
16943
+ if (hasRequired_descriptors)
16944
+ return _descriptors;
16945
+ hasRequired_descriptors = 1;
16946
+ _descriptors = !_fails(function() {
16947
+ return Object.defineProperty({}, "a", { get: function() {
16948
+ return 7;
16949
+ } }).a != 7;
16950
+ });
16951
+ return _descriptors;
16952
+ }
16953
+ __name(require_descriptors, "require_descriptors");
16923
16954
  var _domCreate;
16924
16955
  var hasRequired_domCreate;
16925
16956
  function require_domCreate() {
@@ -16935,7 +16966,7 @@ function require_domCreate() {
16935
16966
  return _domCreate;
16936
16967
  }
16937
16968
  __name(require_domCreate, "require_domCreate");
16938
- var _ie8DomDefine = !_descriptors && !_fails(function() {
16969
+ var _ie8DomDefine = !require_descriptors() && !_fails(function() {
16939
16970
  return Object.defineProperty(require_domCreate()("div"), "a", { get: function() {
16940
16971
  return 7;
16941
16972
  } }).a != 7;
@@ -16957,7 +16988,7 @@ var anObject$3 = _anObject;
16957
16988
  var IE8_DOM_DEFINE$1 = _ie8DomDefine;
16958
16989
  var toPrimitive$2 = _toPrimitive$1;
16959
16990
  var dP$2 = Object.defineProperty;
16960
- _objectDp.f = _descriptors ? Object.defineProperty : /* @__PURE__ */ __name(function defineProperty2(O2, P2, Attributes) {
16991
+ _objectDp.f = require_descriptors() ? Object.defineProperty : /* @__PURE__ */ __name(function defineProperty2(O2, P2, Attributes) {
16961
16992
  anObject$3(O2);
16962
16993
  P2 = toPrimitive$2(P2, true);
16963
16994
  anObject$3(Attributes);
@@ -16982,7 +17013,7 @@ var _propertyDesc = /* @__PURE__ */ __name(function(bitmap, value) {
16982
17013
  }, "_propertyDesc");
16983
17014
  var dP$1 = _objectDp;
16984
17015
  var createDesc$3 = _propertyDesc;
16985
- var _hide = _descriptors ? function(object3, key, value) {
17016
+ var _hide = require_descriptors() ? function(object3, key, value) {
16986
17017
  return dP$1.f(object3, key, createDesc$3(1, value));
16987
17018
  } : function(object3, key, value) {
16988
17019
  object3[key] = value;
@@ -17169,7 +17200,15 @@ var _objectKeys = Object.keys || /* @__PURE__ */ __name(function keys(O2) {
17169
17200
  var _objectGops = {};
17170
17201
  _objectGops.f = Object.getOwnPropertySymbols;
17171
17202
  var _objectPie = {};
17172
- _objectPie.f = {}.propertyIsEnumerable;
17203
+ var hasRequired_objectPie;
17204
+ function require_objectPie() {
17205
+ if (hasRequired_objectPie)
17206
+ return _objectPie;
17207
+ hasRequired_objectPie = 1;
17208
+ _objectPie.f = {}.propertyIsEnumerable;
17209
+ return _objectPie;
17210
+ }
17211
+ __name(require_objectPie, "require_objectPie");
17173
17212
  var defined$1 = _defined;
17174
17213
  var _toObject = /* @__PURE__ */ __name(function(it) {
17175
17214
  return Object(defined$1(it));
@@ -17180,10 +17219,10 @@ function require_objectAssign() {
17180
17219
  if (hasRequired_objectAssign)
17181
17220
  return _objectAssign;
17182
17221
  hasRequired_objectAssign = 1;
17183
- var DESCRIPTORS2 = _descriptors;
17222
+ var DESCRIPTORS2 = require_descriptors();
17184
17223
  var getKeys2 = _objectKeys;
17185
17224
  var gOPS2 = _objectGops;
17186
- var pIE2 = _objectPie;
17225
+ var pIE2 = require_objectPie();
17187
17226
  var toObject2 = _toObject;
17188
17227
  var IObject2 = require_iobject();
17189
17228
  var $assign = Object.assign;
@@ -17255,7 +17294,7 @@ function require_objectDps() {
17255
17294
  var dP2 = _objectDp;
17256
17295
  var anObject2 = _anObject;
17257
17296
  var getKeys2 = _objectKeys;
17258
- _objectDps = _descriptors ? Object.defineProperties : /* @__PURE__ */ __name(function defineProperties3(O2, Properties2) {
17297
+ _objectDps = require_descriptors() ? Object.defineProperties : /* @__PURE__ */ __name(function defineProperties3(O2, Properties2) {
17259
17298
  anObject2(O2);
17260
17299
  var keys5 = getKeys2(Properties2);
17261
17300
  var length = keys5.length;
@@ -17736,7 +17775,7 @@ var _default$8 = /* @__PURE__ */ __name(function(instance, Constructor) {
17736
17775
  }
17737
17776
  }, "_default$8");
17738
17777
  var $export$3 = _export;
17739
- $export$3($export$3.S + $export$3.F * !_descriptors, "Object", { defineProperty: _objectDp.f });
17778
+ $export$3($export$3.S + $export$3.F * !require_descriptors(), "Object", { defineProperty: _objectDp.f });
17740
17779
  var $Object$2 = _coreExports.Object;
17741
17780
  var defineProperty$c = /* @__PURE__ */ __name(function defineProperty3(it, key, desc) {
17742
17781
  return $Object$2.defineProperty(it, key, desc);
@@ -17838,7 +17877,7 @@ var _wksDefine = /* @__PURE__ */ __name(function(name2) {
17838
17877
  }, "_wksDefine");
17839
17878
  var getKeys = _objectKeys;
17840
17879
  var gOPS$1 = _objectGops;
17841
- var pIE$1 = _objectPie;
17880
+ var pIE$1 = require_objectPie();
17842
17881
  var _enumKeys = /* @__PURE__ */ __name(function(it) {
17843
17882
  var result = getKeys(it);
17844
17883
  var getSymbols2 = gOPS$1.f;
@@ -17879,14 +17918,14 @@ _objectGopnExt.f = /* @__PURE__ */ __name(function getOwnPropertyNames2(it) {
17879
17918
  return windowNames && toString$5.call(it) == "[object Window]" ? getWindowNames(it) : gOPN$1(toIObject$2(it));
17880
17919
  }, "getOwnPropertyNames");
17881
17920
  var _objectGopd = {};
17882
- var pIE = _objectPie;
17921
+ var pIE = require_objectPie();
17883
17922
  var createDesc$1 = _propertyDesc;
17884
17923
  var toIObject$1 = _toIobject;
17885
17924
  var toPrimitive$1 = _toPrimitive$1;
17886
17925
  var has$9 = _has;
17887
17926
  var IE8_DOM_DEFINE = _ie8DomDefine;
17888
17927
  var gOPD$5 = Object.getOwnPropertyDescriptor;
17889
- _objectGopd.f = _descriptors ? gOPD$5 : /* @__PURE__ */ __name(function getOwnPropertyDescriptor(O2, P2) {
17928
+ _objectGopd.f = require_descriptors() ? gOPD$5 : /* @__PURE__ */ __name(function getOwnPropertyDescriptor(O2, P2) {
17890
17929
  O2 = toIObject$1(O2);
17891
17930
  P2 = toPrimitive$1(P2, true);
17892
17931
  if (IE8_DOM_DEFINE)
@@ -17899,7 +17938,7 @@ _objectGopd.f = _descriptors ? gOPD$5 : /* @__PURE__ */ __name(function getOwnPr
17899
17938
  }, "getOwnPropertyDescriptor");
17900
17939
  var global$2 = _globalExports;
17901
17940
  var has$8 = _has;
17902
- var DESCRIPTORS = _descriptors;
17941
+ var DESCRIPTORS = require_descriptors();
17903
17942
  var $export$2 = _export;
17904
17943
  var redefine = _redefine;
17905
17944
  var META = _metaExports.KEY;
@@ -18059,7 +18098,7 @@ if (!USE_NATIVE) {
18059
18098
  $GOPD.f = $getOwnPropertyDescriptor;
18060
18099
  $DP.f = $defineProperty$1;
18061
18100
  _objectGopn.f = gOPNExt.f = $getOwnPropertyNames;
18062
- _objectPie.f = $propertyIsEnumerable;
18101
+ require_objectPie().f = $propertyIsEnumerable;
18063
18102
  $GOPS.f = $getOwnPropertySymbols;
18064
18103
  if (DESCRIPTORS && !_library) {
18065
18104
  redefine(ObjectProto, "propertyIsEnumerable", $propertyIsEnumerable);
@@ -39001,27 +39040,51 @@ __publicField(_TgSelect, "defaultProps", {
39001
39040
  value: void 0
39002
39041
  });
39003
39042
  let TgSelect = _TgSelect;
39004
- const TgSelect$1 = withProps((props) => {
39005
- const { multi, value, options } = props;
39006
- let optionsToRet = options;
39007
- if (multi && value) {
39008
- const valArray = getValueArray(value);
39009
- optionsToRet = options.filter((op) => {
39010
- const isOptionSelected = valArray.some((val2) => {
39011
- if (!val2)
39012
- return false;
39013
- const matching = lodashExports.isEqual(val2.value, op.value);
39014
- return matching;
39043
+ const withAsyncOptions = /* @__PURE__ */ __name((Component2) => (props) => {
39044
+ const _a2 = props, { loadOptions, options } = _a2, rest = __objRest(_a2, ["loadOptions", "options"]);
39045
+ const [asyncOptions, setAsyncOptions] = useState([]);
39046
+ const [isLoading, setLoading] = useState(false);
39047
+ useEffect(() => {
39048
+ if (loadOptions) {
39049
+ setLoading(true);
39050
+ loadOptions().then((options2) => {
39051
+ setAsyncOptions(options2);
39052
+ setLoading(false);
39015
39053
  });
39016
- return !isOptionSelected;
39017
- });
39018
- }
39019
- return {
39020
- // unfilteredOptions is needed for finding selected items
39021
- unfilteredOptions: options,
39022
- options: optionsToRet
39023
- };
39024
- })(TgSelect);
39054
+ }
39055
+ }, [loadOptions]);
39056
+ return /* @__PURE__ */ React__default$1.createElement(
39057
+ Component2,
39058
+ __spreadProps(__spreadValues({}, rest), {
39059
+ isLoading: isLoading || rest.isLoading,
39060
+ options: loadOptions ? asyncOptions : options
39061
+ })
39062
+ );
39063
+ }, "withAsyncOptions");
39064
+ const TgSelect$1 = compose$1(
39065
+ withAsyncOptions,
39066
+ withProps((props) => {
39067
+ const { multi, value, options = [] } = props;
39068
+ let optionsToRet = options;
39069
+ if (multi && value) {
39070
+ const valArray = getValueArray(value);
39071
+ optionsToRet = options.filter((op) => {
39072
+ const isOptionSelected = valArray.some((val2) => {
39073
+ if (!val2)
39074
+ return false;
39075
+ const matching = lodashExports.isEqual(val2.value, op.value);
39076
+ return matching;
39077
+ });
39078
+ return !isOptionSelected;
39079
+ });
39080
+ }
39081
+ return {
39082
+ // unfilteredOptions is needed for finding selected items
39083
+ unfilteredOptions: options,
39084
+ options: optionsToRet
39085
+ };
39086
+ })
39087
+ )(TgSelect);
39025
39088
  const itemDisabled = /* @__PURE__ */ __name((i) => i.disabled, "itemDisabled");
39026
39089
  const noResultsDefault = /* @__PURE__ */ React__default$1.createElement("div", null, "No Results...");
39027
39090
  const renderCreateNewOption$1 = /* @__PURE__ */ __name((query, active3, handleClick) => /* @__PURE__ */ React__default$1.createElement(
@@ -42371,19 +42434,59 @@ const generateToast = /* @__PURE__ */ __name((intent) => (message, options) => {
42371
42434
  if (intent === Intent.DANGER) {
42372
42435
  console.error("Toastr error message: ", message);
42373
42436
  }
42437
+ const maybeAddClearAll = /* @__PURE__ */ __name(() => {
42438
+ const existingClearAllButtons = document.querySelectorAll(`.tg-clear-all-toasts`);
42439
+ existingClearAllButtons.forEach((button) => {
42440
+ button.remove();
42441
+ });
42442
+ const activeToasts = document.querySelectorAll(
42443
+ `.bp3-toast:not(.bp3-toast-exit)`
42444
+ );
42445
+ if (activeToasts.length > 1) {
42446
+ const topToaster = document.querySelector(`.bp3-toast`);
42447
+ if (!topToaster)
42448
+ return;
42449
+ const closeButton = document.createElement("div");
42450
+ closeButton.classList.add(
42451
+ Classes.BUTTON,
42452
+ Classes.LARGE,
42453
+ Classes.INTENT_PRIMARY,
42454
+ "tg-clear-all-toasts"
42455
+ );
42456
+ closeButton.innerText = "Clear all";
42457
+ closeButton.onclick = window.__tgClearAllToasts;
42458
+ closeButton.style.position = "absolute";
42459
+ closeButton.style.right = "-100px";
42460
+ topToaster.appendChild(closeButton);
42461
+ }
42462
+ }, "maybeAddClearAll");
42374
42463
  const uniqKey = toastToUse.show(
42375
42464
  {
42376
42465
  intent,
42377
42466
  message,
42378
- timeout: options.timeout || updatedTimeout || intent === Intent.DANGER ? 6e4 : void 0,
42467
+ onDismiss: () => {
42468
+ if (options.onDismiss) {
42469
+ options.onDismiss();
42470
+ }
42471
+ setTimeout(() => {
42472
+ maybeAddClearAll();
42473
+ }, 0);
42474
+ },
42475
+ timeout: options.timeout || updatedTimeout || (!window.Cypress && intent === Intent.DANGER ? 6e4 : void 0),
42379
42476
  action: options.action,
42380
42477
  icon: options.icon,
42381
42478
  className: classNames("preserve-newline", options.className)
42382
42479
  },
42383
42480
  options.key
42384
42481
  );
42482
+ setTimeout(() => {
42483
+ maybeAddClearAll();
42484
+ }, 0);
42385
42485
  function clear3() {
42386
42486
  toastToUse.dismiss(uniqKey);
42487
+ setTimeout(() => {
42488
+ maybeAddClearAll();
42489
+ }, 0);
42387
42490
  }
42388
42491
  __name(clear3, "clear");
42389
42492
  clear3.key = uniqKey;
@@ -42553,6 +42656,7 @@ const _FilterAndSortMenu = class _FilterAndSortMenu extends React__default$1.Com
42553
42656
  intent: Intent.SUCCESS,
42554
42657
  text: "Filter",
42555
42658
  secondaryText: "Clear",
42659
+ secondaryIntent: Intent.DANGER,
42556
42660
  secondaryAction: () => {
42557
42661
  currentFilter && removeSingleFilter(currentFilter.filterOn);
42558
42662
  }
@@ -55442,17 +55546,20 @@ const _DataTable = class _DataTable extends React__default$1.Component {
55442
55546
  });
55443
55547
  }
55444
55548
  }, "handleSelectAllRows"));
55549
+ __publicField(this, "updateValidationHelper", /* @__PURE__ */ __name(() => {
55550
+ const { entities, reduxFormCellValidation } = computePresets(this.props);
55551
+ this.updateValidation(entities, reduxFormCellValidation);
55552
+ }, "updateValidationHelper"));
55445
55553
  __publicField(this, "updateValidation", /* @__PURE__ */ __name((entities, newCellValidate) => {
55446
55554
  const { change: change2, schema: schema2 } = computePresets(this.props);
55447
- change2(
55448
- "reduxFormCellValidation",
55449
- validateTableWideErrors({
55450
- entities,
55451
- schema: schema2,
55452
- newCellValidate,
55453
- props: this.props
55454
- })
55455
- );
55555
+ const tableWideErr = validateTableWideErrors({
55556
+ entities,
55557
+ schema: schema2,
55558
+ newCellValidate,
55559
+ props: this.props
55560
+ });
55561
+ change2("reduxFormCellValidation", tableWideErr);
55562
+ this.forceUpdate();
55456
55563
  }, "updateValidation"));
55457
55564
  __publicField(this, "handleDeleteCell", /* @__PURE__ */ __name(() => {
55458
55565
  const {
@@ -55518,7 +55625,7 @@ const _DataTable = class _DataTable extends React__default$1.Component {
55518
55625
  onFinishMsg: "Column Copied"
55519
55626
  });
55520
55627
  }, "handleCopyColumn"));
55521
- __publicField(this, "handleCopyRows", /* @__PURE__ */ __name((rowElsToCopy, { specificColumn, onFinishMsg } = {}) => {
55628
+ __publicField(this, "handleCopyRows", /* @__PURE__ */ __name((rowElsToCopy, { specificColumn, onFinishMsg, isDownload } = {}) => {
55522
55629
  let textToCopy = [];
55523
55630
  const jsonToCopy = [];
55524
55631
  lodashExports.forEach(rowElsToCopy, (rowEl) => {
@@ -55529,7 +55636,15 @@ const _DataTable = class _DataTable extends React__default$1.Component {
55529
55636
  textToCopy = textToCopy.filter((text2) => text2).join("\n");
55530
55637
  if (!textToCopy)
55531
55638
  return window.toastr.warning("No text to copy");
55532
- this.handleCopyHelper(textToCopy, jsonToCopy, onFinishMsg || "Row Copied");
55639
+ if (isDownload) {
55640
+ downloadjs(textToCopy.replaceAll(" ", ","), "tableData.csv", "text/csv");
55641
+ } else {
55642
+ this.handleCopyHelper(
55643
+ textToCopy,
55644
+ jsonToCopy,
55645
+ onFinishMsg || "Row Copied"
55646
+ );
55647
+ }
55533
55648
  }, "handleCopyRows"));
55534
55649
  __publicField(this, "updateEntitiesHelper", /* @__PURE__ */ __name((ents, fn4) => {
55535
55650
  const { change: change2, reduxFormEntitiesUndoRedoStack = { currentVersion: 0 } } = this.props;
@@ -55582,14 +55697,14 @@ const _DataTable = class _DataTable extends React__default$1.Component {
55582
55697
  window.toastr.success(message);
55583
55698
  }
55584
55699
  }, "handleCopyHelper"));
55585
- __publicField(this, "handleCopyTable", /* @__PURE__ */ __name((e2) => {
55700
+ __publicField(this, "handleCopyTable", /* @__PURE__ */ __name((e2, opts2) => {
55586
55701
  try {
55587
55702
  const allRowEls = getAllRows(e2);
55588
55703
  if (!allRowEls)
55589
55704
  return;
55590
- this.handleCopyRows(allRowEls, {
55705
+ this.handleCopyRows(allRowEls, __spreadProps(__spreadValues({}, opts2), {
55591
55706
  onFinishMsg: "Table Copied"
55592
- });
55707
+ }));
55593
55708
  } catch (error) {
55594
55709
  console.error(`error:`, error);
55595
55710
  window.toastr.error("Error copying rows.");
@@ -55837,7 +55952,8 @@ const _DataTable = class _DataTable extends React__default$1.Component {
55837
55952
  getRowClassName && getRowClassName(rowInfo, state2, this.props),
55838
55953
  {
55839
55954
  disabled: rowDisabled,
55840
- selected: rowSelected && !withCheckboxes
55955
+ selected: rowSelected && !withCheckboxes,
55956
+ "rt-tr-last-row": rowInfo.index === entities.length - 1
55841
55957
  }
55842
55958
  ),
55843
55959
  "data-test-id": dataId === void 0 ? rowInfo.index : dataId,
@@ -55934,7 +56050,8 @@ const _DataTable = class _DataTable extends React__default$1.Component {
55934
56050
  this.startCellEdit(cellId);
55935
56051
  }
55936
56052
  }, err2 && {
55937
- "data-tip": (err2 == null ? void 0 : err2.message) || err2
56053
+ "data-tip": (err2 == null ? void 0 : err2.message) || err2,
56054
+ "data-no-child-data-tip": true
55938
56055
  }), {
55939
56056
  onContextMenu: (e2) => {
55940
56057
  if (!isPrimarySelected) {
@@ -57240,6 +57357,7 @@ const _DataTable = class _DataTable extends React__default$1.Component {
57240
57357
  );
57241
57358
  }, "renderColumnHeader"));
57242
57359
  if (this.props.helperProp) {
57360
+ this.props.helperProp.updateValidationHelper = this.updateValidationHelper;
57243
57361
  this.props.helperProp.addEditableTableEntities = this.addEditableTableEntities;
57244
57362
  this.props.helperProp.getEditableTableInfoAndThrowFormError = this.getEditableTableInfoAndThrowFormError;
57245
57363
  }
@@ -57839,27 +57957,6 @@ const _DataTable = class _DataTable extends React__default$1.Component {
57839
57957
  if (n2)
57840
57958
  this.table = n2;
57841
57959
  },
57842
- additionalBodyEl: isCellEditable && !onlyShowRowsWErrors && /* @__PURE__ */ React__default$1.createElement(
57843
- "div",
57844
- {
57845
- style: {
57846
- width: "100%",
57847
- display: "flex",
57848
- justifyContent: "center"
57849
- }
57850
- },
57851
- /* @__PURE__ */ React__default$1.createElement(
57852
- Button,
57853
- {
57854
- icon: "add",
57855
- onClick: () => {
57856
- this.insertRows({ numRows: 10, appendToBottom: true });
57857
- },
57858
- minimal: true
57859
- },
57860
- "Add 10 Rows"
57861
- )
57862
- ),
57863
57960
  className: classNames({
57864
57961
  isCellEditable,
57865
57962
  "tg-table-loading": isLoading,
@@ -57901,6 +57998,37 @@ const _DataTable = class _DataTable extends React__default$1.Component {
57901
57998
  SubComponent: SubComponentToUse
57902
57999
  }, ReactTableProps)
57903
58000
  ),
58001
+ isCellEditable && /* @__PURE__ */ React__default$1.createElement("div", { style: { display: "flex" } }, /* @__PURE__ */ React__default$1.createElement(
58002
+ "div",
58003
+ {
58004
+ style: {
58005
+ width: "100%",
58006
+ display: "flex",
58007
+ justifyContent: "center"
58008
+ }
58009
+ },
58010
+ !onlyShowRowsWErrors && /* @__PURE__ */ React__default$1.createElement(
58011
+ Button,
58012
+ {
58013
+ icon: "add",
58014
+ onClick: () => {
58015
+ this.insertRows({ numRows: 10, appendToBottom: true });
58016
+ },
58017
+ minimal: true
58018
+ },
58019
+ "Add 10 Rows"
58020
+ )
58021
+ ), /* @__PURE__ */ React__default$1.createElement(
58022
+ Button,
58023
+ {
58024
+ onClick: (e2) => {
58025
+ this.handleCopyTable(e2, { isDownload: true });
58026
+ },
58027
+ "data-tip": "Download Table as CSV",
58028
+ minimal: true,
58029
+ icon: "download"
58030
+ }
58031
+ )),
57904
58032
  !noFooter && /* @__PURE__ */ React__default$1.createElement(
57905
58033
  "div",
57906
58034
  {
@@ -58508,6 +58636,7 @@ function MatchHeaders({
58508
58636
  onMultiFileUploadSubmit,
58509
58637
  doAllFilesHaveSameHeaders,
58510
58638
  csvValidationIssue,
58639
+ ignoredHeadersMsg,
58511
58640
  searchResults,
58512
58641
  matchedHeaders,
58513
58642
  userSchema,
@@ -58525,7 +58654,7 @@ function MatchHeaders({
58525
58654
  if (v2)
58526
58655
  flippedMatchedHeaders[v2] = k2;
58527
58656
  });
58528
- return /* @__PURE__ */ React__default$1.createElement("div", { style: { maxWidth: 500 } }, !onMultiFileUploadSubmit && /* @__PURE__ */ React__default$1.createElement(Callout, { style: { width: "fit-content" }, intent: "warning" }, csvValidationIssue), /* @__PURE__ */ React__default$1.createElement("br", null), /* @__PURE__ */ React__default$1.createElement(
58657
+ return /* @__PURE__ */ React__default$1.createElement("div", { style: { maxWidth: 500 } }, !onMultiFileUploadSubmit && /* @__PURE__ */ React__default$1.createElement(Callout, { style: { width: "fit-content" }, intent: "warning" }, csvValidationIssue), !onMultiFileUploadSubmit && ignoredHeadersMsg && /* @__PURE__ */ React__default$1.createElement(Callout, { style: { width: "fit-content" }, intent: "warning" }, ignoredHeadersMsg), /* @__PURE__ */ React__default$1.createElement("br", null), /* @__PURE__ */ React__default$1.createElement(
58529
58658
  "tr",
58530
58659
  {
58531
58660
  style: {
@@ -58914,7 +59043,7 @@ const AdvancedOptions$1 = {
58914
59043
  };
58915
59044
  var Config = __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, BasicOptions), MatchOptions), FuzzyOptions), AdvancedOptions$1);
58916
59045
  const SPACE = /[^ ]+/g;
58917
- function norm(weight = 1, mantissa = 3) {
59046
+ function norm$1(weight = 1, mantissa = 3) {
58918
59047
  const cache2 = /* @__PURE__ */ new Map();
58919
59048
  const m2 = Math.pow(10, mantissa);
58920
59049
  return {
@@ -58933,13 +59062,13 @@ function norm(weight = 1, mantissa = 3) {
58933
59062
  }
58934
59063
  };
58935
59064
  }
58936
- __name(norm, "norm");
59065
+ __name(norm$1, "norm$1");
58937
59066
  const _FuseIndex = class _FuseIndex {
58938
59067
  constructor({
58939
59068
  getFn = Config.getFn,
58940
59069
  fieldNormWeight = Config.fieldNormWeight
58941
59070
  } = {}) {
58942
- this.norm = norm(fieldNormWeight, 3);
59071
+ this.norm = norm$1(fieldNormWeight, 3);
58943
59072
  this.getFn = getFn;
58944
59073
  this.isCreated = false;
58945
59074
  this.setIndexRecords();
@@ -60088,7 +60217,7 @@ function tryToMatchSchemas(_0) {
60088
60217
  }) {
60089
60218
  yield resolveValidateAgainstSchema();
60090
60219
  const userSchema = getSchema(incomingData);
60091
- const { searchResults, csvValidationIssue } = yield matchSchemas({
60220
+ const { searchResults, csvValidationIssue, ignoredHeadersMsg } = yield matchSchemas({
60092
60221
  userSchema,
60093
60222
  officialSchema: validateAgainstSchema
60094
60223
  });
@@ -60124,6 +60253,7 @@ function tryToMatchSchemas(_0) {
60124
60253
  }
60125
60254
  });
60126
60255
  return {
60256
+ ignoredHeadersMsg,
60127
60257
  csvValidationIssue,
60128
60258
  matchedHeaders,
60129
60259
  userSchema,
@@ -60140,15 +60270,31 @@ function matchSchemas(_0) {
60140
60270
  };
60141
60271
  let csvValidationIssue = false;
60142
60272
  const fuse = new Fuse(userSchema.fields, options);
60273
+ const matchedAltPaths = [];
60143
60274
  officialSchema.fields.forEach((h2) => {
60144
60275
  let hasMatch = false;
60145
60276
  let result = fuse.search(h2.path) || [];
60277
+ const hadNormalPathMatch = userSchema.fields.some(
60278
+ (uh) => norm(uh.path) === norm(h2.path)
60279
+ );
60146
60280
  userSchema.fields.forEach((uh, i) => {
60147
- const pathMatch = uh.path.toLowerCase().replace(/ /g, "") === h2.path.toLowerCase().replace(/ /g, "");
60148
- const displayNameMatch = h2.displayName && uh.path.toLowerCase().replace(/ /g, "") === getTextFromEl(h2.displayName).toLowerCase().replace(/ /g, "");
60149
- const hasAlternatePathMatch = h2.alternatePathMatch && (lodashExports.isArray(h2.alternatePathMatch) ? h2.alternatePathMatch.some((alternatePathMatch) => {
60150
- return uh.path.toLowerCase().replace(/ /g, "") === alternatePathMatch.toLowerCase().replace(/ /g, "");
60151
- }) : uh.path.toLowerCase().replace(/ /g, "") === h2.alternatePathMatch.toLowerCase().replace(/ /g, ""));
60281
+ const pathMatch = norm(uh.path) === norm(h2.path);
60282
+ const displayNameMatch = h2.displayName && norm(uh.path) === norm(getTextFromEl(h2.displayName));
60283
+ const hasAlternatePathMatch = !hadNormalPathMatch && h2.alternatePathMatch && (lodashExports.isArray(h2.alternatePathMatch) ? h2.alternatePathMatch : [h2.alternatePathMatch]).find((alternatePathMatch) => {
60284
+ let altPath = alternatePathMatch;
60285
+ if (lodashExports.isPlainObject(alternatePathMatch)) {
60286
+ altPath = alternatePathMatch.path;
60287
+ }
60288
+ return norm(uh.path) === norm(altPath);
60289
+ });
60290
+ if (hasAlternatePathMatch) {
60291
+ matchedAltPaths.push(
60292
+ hasAlternatePathMatch.path || hasAlternatePathMatch
60293
+ );
60294
+ if (hasAlternatePathMatch.format) {
60295
+ h2.format = hasAlternatePathMatch.format;
60296
+ }
60297
+ }
60152
60298
  if (pathMatch || displayNameMatch || hasAlternatePathMatch) {
60153
60299
  result = result.filter(({ path: path2 }) => path2 === uh.path);
60154
60300
  result.unshift({
@@ -60168,6 +60314,16 @@ function matchSchemas(_0) {
60168
60314
  csvValidationIssue = "It looks like some of the headers in your uploaded file(s) do not match the expected headers. Please look over and correct any issues with the mappings below.";
60169
60315
  }
60170
60316
  });
60317
+ const ignoredUserSchemaFields = [];
60318
+ userSchema.fields.forEach((uh) => {
60319
+ if (!officialSchema.fields.find(
60320
+ (h2) => norm(h2.path) === norm(uh.path) || norm(h2.displayName) === norm(uh.path) || matchedAltPaths.includes(uh.path)
60321
+ )) {
60322
+ if (userSchema.userData.some((e2) => e2[uh.path])) {
60323
+ ignoredUserSchemaFields.push(uh);
60324
+ }
60325
+ }
60326
+ });
60171
60327
  if (officialSchema.coerceUserSchema) {
60172
60328
  officialSchema.coerceUserSchema({ userSchema, officialSchema });
60173
60329
  }
@@ -60225,9 +60381,14 @@ function matchSchemas(_0) {
60225
60381
  };
60226
60382
  }
60227
60383
  }
60384
+ let ignoredHeadersMsg;
60385
+ if (ignoredUserSchemaFields.length) {
60386
+ ignoredHeadersMsg = `It looks like the following headers in your file didn't map to any of the accepted headers: ${ignoredUserSchemaFields.map((f2) => f2.displayName || f2.path).join(", ")}`;
60387
+ }
60228
60388
  return {
60229
60389
  searchResults: officialSchema.fields,
60230
- csvValidationIssue
60390
+ csvValidationIssue,
60391
+ ignoredHeadersMsg
60231
60392
  };
60232
60393
  });
60233
60394
  }
@@ -60246,6 +60407,10 @@ function resolveValidateAgainstSchema() {
60246
60407
  });
60247
60408
  }
60248
60409
  __name(resolveValidateAgainstSchema, "resolveValidateAgainstSchema");
60410
+ function norm(h2) {
60411
+ return lodashExports.snakeCase(h2).toLowerCase().replace(/ /g, "");
60412
+ }
60413
+ __name(norm, "norm");
60249
60414
  const getInitialSteps = /* @__PURE__ */ __name((csvValidationIssue) => [
60250
60415
  { text: "Review Headers", active: csvValidationIssue },
60251
60416
  { text: "Review Data", active: !csvValidationIssue }
@@ -60293,6 +60458,7 @@ const UploadCsvWizardDialog = compose(
60293
60458
  doAllFilesHaveSameHeaders,
60294
60459
  destroyForms,
60295
60460
  csvValidationIssue,
60461
+ ignoredHeadersMsg,
60296
60462
  searchResults,
60297
60463
  matchedHeaders,
60298
60464
  userSchema,
@@ -60404,6 +60570,7 @@ const UploadCsvWizardDialog = compose(
60404
60570
  destroyForms,
60405
60571
  setFilesWIssues,
60406
60572
  csvValidationIssue,
60573
+ ignoredHeadersMsg,
60407
60574
  searchResults,
60408
60575
  matchedHeaders,
60409
60576
  userSchema,
@@ -60439,6 +60606,7 @@ const UploadCsvWizardDialog = compose(
60439
60606
  reduxFormEntitiesArray,
60440
60607
  // onMultiFileUploadSubmit,
60441
60608
  csvValidationIssue,
60609
+ ignoredHeadersMsg,
60442
60610
  searchResults,
60443
60611
  matchedHeaders,
60444
60612
  userSchema,
@@ -60481,6 +60649,7 @@ const UploadCsvWizardDialog = compose(
60481
60649
  searchResults,
60482
60650
  onUploadWizardFinish,
60483
60651
  csvValidationIssue,
60652
+ ignoredHeadersMsg,
60484
60653
  matchedHeaders,
60485
60654
  //fromRedux:
60486
60655
  changeForm,
@@ -60510,6 +60679,7 @@ const UploadCsvWizardDialogInner = compose(
60510
60679
  searchResults,
60511
60680
  onUploadWizardFinish,
60512
60681
  csvValidationIssue,
60682
+ ignoredHeadersMsg,
60513
60683
  matchedHeaders,
60514
60684
  //fromRedux:
60515
60685
  handleSubmit,
@@ -60547,6 +60717,7 @@ const UploadCsvWizardDialogInner = compose(
60547
60717
  __spreadValues({}, {
60548
60718
  onMultiFileUploadSubmit,
60549
60719
  csvValidationIssue,
60720
+ ignoredHeadersMsg,
60550
60721
  searchResults,
60551
60722
  matchedHeaders,
60552
60723
  userSchema,
@@ -68719,7 +68890,7 @@ const isZipFile = /* @__PURE__ */ __name((file) => {
68719
68890
  }, "isZipFile");
68720
68891
  const getExt = /* @__PURE__ */ __name((file) => {
68721
68892
  var _a2;
68722
- return (_a2 = file == null ? void 0 : file.name) == null ? void 0 : _a2.split(".").pop();
68893
+ return (_a2 = (file == null ? void 0 : file.name) || (file == null ? void 0 : file.originalname)) == null ? void 0 : _a2.split(".").pop();
68723
68894
  }, "getExt");
68724
68895
  const isExcelFile = /* @__PURE__ */ __name((file) => getExt(file) === "xlsx", "isExcelFile");
68725
68896
  const isCsvFile = /* @__PURE__ */ __name((file) => getExt(file) === "csv", "isCsvFile");
@@ -68807,7 +68978,9 @@ const parseCsvFile = /* @__PURE__ */ __name((csvFile, parserOptions = {}) => {
68807
68978
  const opts2 = __spreadProps(__spreadValues(__spreadValues({}, defaultCsvParserOptions), setupCsvParserOptions(parserOptions)), {
68808
68979
  complete: (results) => {
68809
68980
  var _a2;
68810
- if (results && ((_a2 = results.data) == null ? void 0 : _a2.length) && results.errors && results.errors.length === 1 && results.errors[0].code === `UndetectableDelimiter`) {
68981
+ if (results && ((_a2 = results.data) == null ? void 0 : _a2.length) && results.errors && (results.errors.length === 1 && results.errors[0].code === `UndetectableDelimiter` || results.errors.every(
68982
+ (e2) => e2.code === `TooFewFields` || e2.code === `TooManyFields`
68983
+ ))) {
68811
68984
  return resolve(results);
68812
68985
  } else if (results && results.errors && results.errors.length) {
68813
68986
  return reject("Error in csv: " + JSON.stringify(results.errors));
@@ -70357,7 +70530,7 @@ __name(_ValidateAgainstSchema, "ValidateAgainstSchema");
70357
70530
  let ValidateAgainstSchema = _ValidateAgainstSchema;
70358
70531
  const emptyPromise = Promise.resolve.bind(Promise);
70359
70532
  function UploaderInner({
70360
- accept: _accept,
70533
+ accept: __accept,
70361
70534
  contentOverride: maybeContentOverride,
70362
70535
  innerIcon,
70363
70536
  innerText,
@@ -70387,20 +70560,37 @@ function UploaderInner({
70387
70560
  dropzoneProps = {},
70388
70561
  overflowList,
70389
70562
  autoUnzip,
70390
- disabled,
70563
+ disabled: _disabled,
70391
70564
  noBuildCsvOption,
70392
70565
  initializeForm,
70393
70566
  showFilesCount,
70394
70567
  threeDotMenuItems,
70395
70568
  onPreviewClick
70396
70569
  }) {
70397
- var _a2, _b2, _c, _d, _e, _f;
70570
+ var _a2, _b2, _c, _d;
70571
+ let dropzoneDisabled = _disabled;
70572
+ let _accept = __accept;
70398
70573
  const validateAgainstSchemaStore = useRef(new ValidateAgainstSchema());
70399
- const callout = _callout || ((_c = (_b2 = (_a2 = lodashExports.isArray(_accept) ? _accept : [_accept]).find) == null ? void 0 : _b2.call(_a2, (a2) => a2 == null ? void 0 : a2.callout)) == null ? void 0 : _c.callout);
70400
- const validateAgainstSchemaToUse = _validateAgainstSchema || ((_f = (_e = (_d = lodashExports.isArray(_accept) ? _accept : [_accept]).find) == null ? void 0 : _e.call(
70401
- _d,
70402
- (a2) => a2 == null ? void 0 : a2.validateAgainstSchema
70403
- )) == null ? void 0 : _f.validateAgainstSchema);
70574
+ const [resolvedAccept, setResolvedAccept] = useState();
70575
+ if (resolvedAccept) {
70576
+ _accept = resolvedAccept;
70577
+ }
70578
+ const isAcceptPromise = (__accept == null ? void 0 : __accept.then) || (Array.isArray(__accept) ? __accept.some((a2) => a2 == null ? void 0 : a2.then) : false);
70579
+ const acceptLoading = !resolvedAccept && isAcceptPromise && `Accept Loading...`;
70580
+ if (isAcceptPromise && !resolvedAccept) {
70581
+ Promise.allSettled(Array.isArray(__accept) ? __accept : [__accept]).then(
70582
+ (results) => {
70583
+ const resolved = lodashExports.flatMap(results, (r2) => r2.value);
70584
+ setResolvedAccept(resolved);
70585
+ }
70586
+ );
70587
+ _accept = [];
70588
+ }
70589
+ if (acceptLoading)
70590
+ dropzoneDisabled = true;
70591
+ const accept = !_accept ? void 0 : isAcceptPromise && !resolvedAccept ? [] : lodashExports.isPlainObject(_accept) ? [_accept] : lodashExports.isArray(_accept) ? _accept : _accept.split(",").map((a2) => ({ type: a2 }));
70592
+ const callout = _callout || ((_b2 = (_a2 = accept == null ? void 0 : accept.find) == null ? void 0 : _a2.call(accept, (a2) => a2 == null ? void 0 : a2.callout)) == null ? void 0 : _b2.callout);
70593
+ const validateAgainstSchemaToUse = _validateAgainstSchema || ((_d = (_c = accept == null ? void 0 : accept.find) == null ? void 0 : _c.call(accept, (a2) => a2 == null ? void 0 : a2.validateAgainstSchema)) == null ? void 0 : _d.validateAgainstSchema);
70404
70594
  useEffect(() => {
70405
70595
  validateAgainstSchemaStore.current.setValidateAgainstSchema(
70406
70596
  validateAgainstSchemaToUse
@@ -70410,7 +70600,6 @@ function UploaderInner({
70410
70600
  if (validateAgainstSchemaToUse) {
70411
70601
  validateAgainstSchema = validateAgainstSchemaStore.current;
70412
70602
  }
70413
- const accept = !_accept ? void 0 : lodashExports.isPlainObject(_accept) ? [_accept] : lodashExports.isArray(_accept) ? _accept : _accept.split(",").map((a2) => ({ type: a2 }));
70414
70603
  if ((validateAgainstSchema || autoUnzip) && accept && !accept.some((a2) => a2.type === "zip")) {
70415
70604
  accept == null ? void 0 : accept.unshift({
70416
70605
  type: "zip",
@@ -70675,14 +70864,14 @@ function UploaderInner({
70675
70864
  className: "tg-uploader-inner",
70676
70865
  style: { width: "100%", height: "fit-content", minWidth: 0 }
70677
70866
  },
70678
- simpleAccept && /* @__PURE__ */ React__default$1.createElement(
70867
+ (simpleAccept || acceptLoading) && /* @__PURE__ */ React__default$1.createElement(
70679
70868
  "div",
70680
70869
  {
70681
70870
  className: Classes.TEXT_MUTED,
70682
70871
  style: { fontSize: 11, marginBottom: 5 }
70683
70872
  },
70684
70873
  advancedAccept ? /* @__PURE__ */ React__default$1.createElement("div", { style: {} }, "Accepts  ", /* @__PURE__ */ React__default$1.createElement("span", { style: {} }, advancedAccept.map((a2, i) => {
70685
- const disabled2 = !(a2.description || a2.exampleFile || a2.exampleFiles);
70874
+ const disabled = !(a2.description || a2.exampleFile || a2.exampleFiles);
70686
70875
  const PopOrTooltip = a2.exampleFiles ? Popover : Tooltip;
70687
70876
  const hasDownload = a2.exampleFile || a2.exampleFiles;
70688
70877
  const CustomTag = !hasDownload ? "span" : "a";
@@ -70691,7 +70880,7 @@ function UploaderInner({
70691
70880
  {
70692
70881
  key: i,
70693
70882
  interactionKind: "hover",
70694
- disabled: disabled2,
70883
+ disabled,
70695
70884
  modifiers: popoverOverflowModifiers,
70696
70885
  content: a2.exampleFiles ? /* @__PURE__ */ React__default$1.createElement(Menu, null, a2.exampleFiles.map(
70697
70886
  ({ description: description2, subtext, exampleFile, icon }, i2) => {
@@ -70769,12 +70958,15 @@ function UploaderInner({
70769
70958
  )
70770
70959
  )
70771
70960
  );
70772
- }))) : /* @__PURE__ */ React__default$1.createElement(React__default$1.Fragment, null, "Accepts ", simpleAccept)
70961
+ }))) : acceptLoading ? (
70962
+ // make the dots below "load"
70963
+ /* @__PURE__ */ React__default$1.createElement(React__default$1.Fragment, null, "Accept Loading", /* @__PURE__ */ React__default$1.createElement(LoadingDots, null))
70964
+ ) : /* @__PURE__ */ React__default$1.createElement(React__default$1.Fragment, null, "Accepts ", simpleAccept)
70773
70965
  ),
70774
70966
  /* @__PURE__ */ React__default$1.createElement(
70775
70967
  Dropzone$1,
70776
70968
  __spreadValues(__spreadValues({
70777
- disabled,
70969
+ disabled: dropzoneDisabled,
70778
70970
  onClick: (evt) => evt.preventDefault(),
70779
70971
  multiple: fileLimit !== 1,
70780
70972
  accept: simpleAccept ? simpleAccept.split(", ").map((a2) => a2.startsWith(".") ? a2 : "." + a2).join(", ") : void 0
@@ -70857,7 +71049,13 @@ function UploaderInner({
70857
71049
  if (isCsvOrExcelFile(file)) {
70858
71050
  let parsedF;
70859
71051
  try {
70860
- parsedF = yield parseCsvOrExcelFile(file);
71052
+ parsedF = yield parseCsvOrExcelFile(file, {
71053
+ csvParserOptions: lodashExports.isFunction(
71054
+ validateAgainstSchema.csvParserOptions
71055
+ ) ? validateAgainstSchema.csvParserOptions({
71056
+ validateAgainstSchema
71057
+ }) : validateAgainstSchema.csvParserOptions
71058
+ });
70861
71059
  } catch (error) {
70862
71060
  console.error("error:", error);
70863
71061
  window.toastr && window.toastr.error(
@@ -70869,7 +71067,8 @@ function UploaderInner({
70869
71067
  csvValidationIssue: _csvValidationIssue,
70870
71068
  matchedHeaders,
70871
71069
  userSchema,
70872
- searchResults
71070
+ searchResults,
71071
+ ignoredHeadersMsg
70873
71072
  } = yield tryToMatchSchemas({
70874
71073
  incomingData: parsedF.data,
70875
71074
  validateAgainstSchema
@@ -70912,6 +71111,7 @@ function UploaderInner({
70912
71111
  filesWIssues.push({
70913
71112
  file,
70914
71113
  csvValidationIssue,
71114
+ ignoredHeadersMsg,
70915
71115
  matchedHeaders,
70916
71116
  userSchema,
70917
71117
  searchResults
@@ -70920,6 +71120,7 @@ function UploaderInner({
70920
71120
  filesWOIssues.push({
70921
71121
  file,
70922
71122
  csvValidationIssue,
71123
+ ignoredHeadersMsg,
70923
71124
  matchedHeaders,
70924
71125
  userSchema,
70925
71126
  searchResults
@@ -71019,7 +71220,8 @@ function UploaderInner({
71019
71220
  "tg-dropzone-reject": isDragReject,
71020
71221
  // tnr: the acceptClassName/rejectClassName doesn't work with file extensions (only mimetypes are supported when dragging). Thus we'll just always turn the drop area blue when dragging and let the filtering occur on drop. See https://github.com/react-dropzone/react-dropzone/issues/888#issuecomment-773938074
71021
71222
  "tg-dropzone-accept": isDragAccept,
71022
- "tg-dropzone-disabled": disabled
71223
+ "tg-dropzone-disabled": dropzoneDisabled,
71224
+ "bp3-disabled": dropzoneDisabled
71023
71225
  })
71024
71226
  }),
71025
71227
  /* @__PURE__ */ React__default$1.createElement("input", __spreadValues({}, getInputProps())),
@@ -82893,7 +83095,7 @@ const modifiableTypes = [
82893
83095
  let allWarnings = [];
82894
83096
  let makeToast = /* @__PURE__ */ __name(() => {
82895
83097
  if (typeof window !== "undefined" && window.toastr && allWarnings.length) {
82896
- window.toastr.warning(allWarnings.join("\n"));
83098
+ window.toastr.warning(lodashExports.uniq(allWarnings).join("\n"));
82897
83099
  }
82898
83100
  allWarnings = [];
82899
83101
  }, "makeToast");
@@ -91794,6 +91996,8 @@ function convertAmbiguousStringToRegex(string2, isProtein2) {
91794
91996
  }
91795
91997
  __name(convertAmbiguousStringToRegex, "convertAmbiguousStringToRegex");
91796
91998
  function getComplementSequenceString(sequence2, isRna2) {
91999
+ if (typeof sequence2 !== "string")
92000
+ return "";
91797
92001
  let complementSeqString = "";
91798
92002
  const complementMap = lodashExports.merge(
91799
92003
  DNAComplementMap,
@@ -120631,6 +120835,7 @@ const Axis$1 = /* @__PURE__ */ __name(function(props) {
120631
120835
  {
120632
120836
  className: "veRowViewAxis veAxis",
120633
120837
  height: annotationHeight,
120838
+ width,
120634
120839
  style: __spreadValues({ marginTop, overflow: "visible", display: "block" }, style2)
120635
120840
  },
120636
120841
  tickMarkSVG,
@@ -123676,10 +123881,10 @@ function RowItem(props) {
123676
123881
  height: height2
123677
123882
  } = annotationVisibility2;
123678
123883
  const { sequence: sequence2 = "", cutsites = [] } = row;
123679
- const reverseSequence = getComplementSequenceString(
123884
+ const reverseSequence = showReverseSequence ? getComplementSequenceString(
123680
123885
  alignmentData && alignmentData.sequence || sequence2,
123681
123886
  isRna2
123682
- );
123887
+ ) : "";
123683
123888
  const getGaps2 = useMemo$1(() => {
123684
123889
  if (alignmentData) {
123685
123890
  const gapMap = getGapMap$1(alignmentData.sequence);
@@ -124773,7 +124978,7 @@ function showFileDialog({ multiple = false, onSelect }) {
124773
124978
  }
124774
124979
  __name(showFileDialog, "showFileDialog");
124775
124980
  const name = "@teselagen/ove";
124776
- const version = "0.4.0";
124981
+ const version = "0.4.1";
124777
124982
  const main = "./src/index.js";
124778
124983
  const exports$1 = {
124779
124984
  ".": {
@@ -125775,8 +125980,10 @@ Object.keys(defaultCopyOptions).forEach((type) => {
125775
125980
  const readOnlyDisabledTooltip = "Sorry this function is not allowed in Read-Only Mode";
125776
125981
  const bpEditingDisabledTooltip = "Sequence Editing Disabled";
125777
125982
  const noSelection = /* @__PURE__ */ __name(({ selectionLayer: selectionLayer2 = {} }) => !(selectionLayer2.start > -1 && selectionLayer2.end > -1) && "Selection Required", "noSelection");
125778
- const triggerClipboardCommand = /* @__PURE__ */ __name((type) => {
125779
- const wrapper2 = document.querySelector(".veVectorInteractionWrapper");
125983
+ const triggerClipboardCommand = /* @__PURE__ */ __name((type, props) => {
125984
+ const wrapper2 = document.querySelector(
125985
+ `#${props.editorName} .veVectorInteractionWrapper`
125986
+ );
125780
125987
  if (!wrapper2) {
125781
125988
  return window.toastr.info(`Cannot trigger a ${type} in the current view`);
125782
125989
  }
@@ -125807,8 +126014,8 @@ const editCommandDefs = __spreadValues(__spreadProps(__spreadValues({
125807
126014
  cut: {
125808
126015
  isDisabled: (props) => props.disableBpEditing && bpEditingDisabledTooltip || props.readOnly && readOnlyDisabledTooltip || props.sequenceLength === 0,
125809
126016
  isHidden: (props) => props.readOnly || props.disableBpEditing,
125810
- handler: () => {
125811
- triggerClipboardCommand("cut");
126017
+ handler: (props) => {
126018
+ triggerClipboardCommand("cut", props);
125812
126019
  },
125813
126020
  hotkey: "mod+x"
125814
126021
  },
@@ -125826,13 +126033,13 @@ const editCommandDefs = __spreadValues(__spreadProps(__spreadValues({
125826
126033
  },
125827
126034
  copy: {
125828
126035
  isDisabled: (props) => props.sequenceLength === 0,
125829
- handler: () => triggerClipboardCommand("copy"),
126036
+ handler: (props) => triggerClipboardCommand("copy", props),
125830
126037
  hotkey: "mod+c"
125831
126038
  },
125832
126039
  paste: {
125833
126040
  isDisabled: (props) => props.readOnly && readOnlyDisabledTooltip,
125834
126041
  isHidden: (props) => props.readOnly || props.disableBpEditing,
125835
- handler: () => triggerClipboardCommand("paste"),
126042
+ handler: (props) => triggerClipboardCommand("paste", props),
125836
126043
  hotkey: "mod+v"
125837
126044
  },
125838
126045
  undo: {
@@ -130070,7 +130277,7 @@ function VectorInteractionHOC(Component2) {
130070
130277
  ...getEditDeleteHandlers("Feature", annotation),
130071
130278
  ...this.getSelectionMenuOptions(annotation),
130072
130279
  ...readOnly2 ? [] : [
130073
- ...parts2 && [
130280
+ ...parts2 ? [
130074
130281
  "--",
130075
130282
  {
130076
130283
  text: "Make a Part from Feature",
@@ -130099,7 +130306,7 @@ function VectorInteractionHOC(Component2) {
130099
130306
  });
130100
130307
  })
130101
130308
  }
130102
- ],
130309
+ ] : [],
130103
130310
  {
130104
130311
  text: "Merge With Another Feature",
130105
130312
  onClick: () => {
@@ -132281,6 +132488,11 @@ const __LinearView = class __LinearView extends React__default$1.Component {
132281
132488
  updateLabelsForInViewFeatures();
132282
132489
  }
132283
132490
  };
132491
+ const tickSpacingToUse = tickSpacing || (isLinViewZoomed ? massageTickSpacing(Math.ceil(120 / this.charWidth)) : massageTickSpacing(
132492
+ Math.floor(
132493
+ this.getMaxLength() / (sequenceData2.isProtein ? 9 : 10) * Math.max(1, Math.log10(1 / this.charWidth))
132494
+ )
132495
+ ));
132284
132496
  return /* @__PURE__ */ React__default$1.createElement(
132285
132497
  ReactDraggable,
132286
132498
  {
@@ -132382,9 +132594,7 @@ const __LinearView = class __LinearView extends React__default$1.Component {
132382
132594
  bpsPerRow,
132383
132595
  fullSequence: sequenceData2.sequence,
132384
132596
  emptyText: getEmptyText({ sequenceData: sequenceData2, caretPosition: caretPosition2 }),
132385
- tickSpacing: tickSpacing || (isLinViewZoomed ? massageTickSpacing(Math.ceil(120 / this.charWidth)) : Math.floor(
132386
- this.getMaxLength() / (sequenceData2.isProtein ? 9 : 10)
132387
- )),
132597
+ tickSpacing: tickSpacingToUse,
132388
132598
  annotationVisibility: __spreadValues(__spreadValues(__spreadValues({}, rest.annotationVisibility), (!isLinViewZoomed || this.charWidth < 5) && {
132389
132599
  translations: false,
132390
132600
  primaryProteinSequence: false,
@@ -132669,7 +132879,6 @@ const _Minimap = class _Minimap extends React__default$1.Component {
132669
132879
  display: "flex",
132670
132880
  flexDirection: "column",
132671
132881
  overflowX: "visible"
132672
- // overflowY: "hidden"
132673
132882
  },
132674
132883
  onClick: this.handleMinimapClick
132675
132884
  },
@@ -132683,9 +132892,7 @@ const _Minimap = class _Minimap extends React__default$1.Component {
132683
132892
  }
132684
132893
  },
132685
132894
  style: {
132686
- // maxHeight: 350,
132687
132895
  overflowY: minimapTracksPartialHeight > 190 ? "auto" : "hidden",
132688
- // overflowY: "auto",
132689
132896
  overflowX: "hidden",
132690
132897
  position: "relative"
132691
132898
  },
@@ -132716,7 +132923,6 @@ const _Minimap = class _Minimap extends React__default$1.Component {
132716
132923
  {
132717
132924
  style: {
132718
132925
  marginTop: -3
132719
- // paddingLeft: nameDivWidth
132720
132926
  },
132721
132927
  ref
132722
132928
  },
@@ -132732,15 +132938,15 @@ const _Minimap = class _Minimap extends React__default$1.Component {
132732
132938
  /* @__PURE__ */ React__default$1.createElement(
132733
132939
  Axis$2,
132734
132940
  __spreadValues({}, {
132735
- row: { start: 0, end: seqLength },
132941
+ row: { start: 0, end: seqLength - 1 },
132736
132942
  tickSpacing: massageTickSpacing(Math.floor(seqLength / 10)),
132737
132943
  bpsPerRow: seqLength,
132738
132944
  charWidth: charWidth2,
132739
132945
  annotationHeight: 15,
132740
132946
  sequenceLength: seqLength,
132741
132947
  style: {
132742
- // paddingLeft: nameDivWidth,
132743
- height: 17
132948
+ height: 17,
132949
+ width: "100%"
132744
132950
  }
132745
132951
  })
132746
132952
  )