@teselagen/ove 0.3.49 → 0.3.51

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
@@ -18357,25 +18357,16 @@ var toString$6 = {}.toString;
18357
18357
  var _cof = /* @__PURE__ */ __name(function(it) {
18358
18358
  return toString$6.call(it).slice(8, -1);
18359
18359
  }, "_cof");
18360
- var _iobject;
18361
- var hasRequired_iobject;
18362
- function require_iobject() {
18363
- if (hasRequired_iobject)
18364
- return _iobject;
18365
- hasRequired_iobject = 1;
18366
- var cof2 = _cof;
18367
- _iobject = Object("z").propertyIsEnumerable(0) ? Object : function(it) {
18368
- return cof2(it) == "String" ? it.split("") : Object(it);
18369
- };
18370
- return _iobject;
18371
- }
18372
- __name(require_iobject, "require_iobject");
18360
+ var cof$2 = _cof;
18361
+ var _iobject = Object("z").propertyIsEnumerable(0) ? Object : function(it) {
18362
+ return cof$2(it) == "String" ? it.split("") : Object(it);
18363
+ };
18373
18364
  var _defined = /* @__PURE__ */ __name(function(it) {
18374
18365
  if (it == void 0)
18375
18366
  throw TypeError("Can't call method on " + it);
18376
18367
  return it;
18377
18368
  }, "_defined");
18378
- var IObject = require_iobject();
18369
+ var IObject = _iobject;
18379
18370
  var defined$2 = _defined;
18380
18371
  var _toIobject = /* @__PURE__ */ __name(function(it) {
18381
18372
  return IObject(defined$2(it));
@@ -18464,23 +18455,15 @@ var _objectKeysInternal = /* @__PURE__ */ __name(function(object3, names2) {
18464
18455
  return result;
18465
18456
  }, "_objectKeysInternal");
18466
18457
  var _enumBugKeys = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");
18467
- var $keys$2 = _objectKeysInternal;
18458
+ var $keys$3 = _objectKeysInternal;
18468
18459
  var enumBugKeys$1 = _enumBugKeys;
18469
18460
  var _objectKeys = Object.keys || /* @__PURE__ */ __name(function keys(O2) {
18470
- return $keys$2(O2, enumBugKeys$1);
18461
+ return $keys$3(O2, enumBugKeys$1);
18471
18462
  }, "keys");
18472
18463
  var _objectGops = {};
18473
18464
  _objectGops.f = Object.getOwnPropertySymbols;
18474
18465
  var _objectPie = {};
18475
- var hasRequired_objectPie;
18476
- function require_objectPie() {
18477
- if (hasRequired_objectPie)
18478
- return _objectPie;
18479
- hasRequired_objectPie = 1;
18480
- _objectPie.f = {}.propertyIsEnumerable;
18481
- return _objectPie;
18482
- }
18483
- __name(require_objectPie, "require_objectPie");
18466
+ _objectPie.f = {}.propertyIsEnumerable;
18484
18467
  var defined$1 = _defined;
18485
18468
  var _toObject = /* @__PURE__ */ __name(function(it) {
18486
18469
  return Object(defined$1(it));
@@ -18494,9 +18477,9 @@ function require_objectAssign() {
18494
18477
  var DESCRIPTORS2 = _descriptors;
18495
18478
  var getKeys2 = _objectKeys;
18496
18479
  var gOPS2 = _objectGops;
18497
- var pIE2 = require_objectPie();
18480
+ var pIE2 = _objectPie;
18498
18481
  var toObject2 = _toObject;
18499
- var IObject2 = require_iobject();
18482
+ var IObject2 = _iobject;
18500
18483
  var $assign = Object.assign;
18501
18484
  _objectAssign = !$assign || _fails(function() {
18502
18485
  var A2 = {};
@@ -19131,7 +19114,7 @@ var _wksDefine = /* @__PURE__ */ __name(function(name2) {
19131
19114
  }, "_wksDefine");
19132
19115
  var getKeys = _objectKeys;
19133
19116
  var gOPS$1 = _objectGops;
19134
- var pIE$1 = require_objectPie();
19117
+ var pIE$1 = _objectPie;
19135
19118
  var _enumKeys = /* @__PURE__ */ __name(function(it) {
19136
19119
  var result = getKeys(it);
19137
19120
  var getSymbols2 = gOPS$1.f;
@@ -19152,21 +19135,13 @@ var _isArray = Array.isArray || /* @__PURE__ */ __name(function isArray(arg) {
19152
19135
  }, "isArray");
19153
19136
  var _objectGopnExt = {};
19154
19137
  var _objectGopn = {};
19155
- var hasRequired_objectGopn;
19156
- function require_objectGopn() {
19157
- if (hasRequired_objectGopn)
19158
- return _objectGopn;
19159
- hasRequired_objectGopn = 1;
19160
- var $keys2 = _objectKeysInternal;
19161
- var hiddenKeys = _enumBugKeys.concat("length", "prototype");
19162
- _objectGopn.f = Object.getOwnPropertyNames || /* @__PURE__ */ __name(function getOwnPropertyNames4(O2) {
19163
- return $keys2(O2, hiddenKeys);
19164
- }, "getOwnPropertyNames");
19165
- return _objectGopn;
19166
- }
19167
- __name(require_objectGopn, "require_objectGopn");
19138
+ var $keys$2 = _objectKeysInternal;
19139
+ var hiddenKeys = _enumBugKeys.concat("length", "prototype");
19140
+ _objectGopn.f = Object.getOwnPropertyNames || /* @__PURE__ */ __name(function getOwnPropertyNames(O2) {
19141
+ return $keys$2(O2, hiddenKeys);
19142
+ }, "getOwnPropertyNames");
19168
19143
  var toIObject$2 = _toIobject;
19169
- var gOPN$1 = require_objectGopn().f;
19144
+ var gOPN$1 = _objectGopn.f;
19170
19145
  var toString$5 = {}.toString;
19171
19146
  var windowNames = typeof window == "object" && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [];
19172
19147
  var getWindowNames = /* @__PURE__ */ __name(function(it) {
@@ -19176,11 +19151,11 @@ var getWindowNames = /* @__PURE__ */ __name(function(it) {
19176
19151
  return windowNames.slice();
19177
19152
  }
19178
19153
  }, "getWindowNames");
19179
- _objectGopnExt.f = /* @__PURE__ */ __name(function getOwnPropertyNames(it) {
19154
+ _objectGopnExt.f = /* @__PURE__ */ __name(function getOwnPropertyNames2(it) {
19180
19155
  return windowNames && toString$5.call(it) == "[object Window]" ? getWindowNames(it) : gOPN$1(toIObject$2(it));
19181
19156
  }, "getOwnPropertyNames");
19182
19157
  var _objectGopd = {};
19183
- var pIE = require_objectPie();
19158
+ var pIE = _objectPie;
19184
19159
  var createDesc$1 = _propertyDesc;
19185
19160
  var toIObject$1 = _toIobject;
19186
19161
  var toPrimitive$1 = _toPrimitive$1;
@@ -19315,7 +19290,7 @@ var $getOwnPropertyDescriptor = /* @__PURE__ */ __name(function getOwnPropertyDe
19315
19290
  D2.enumerable = true;
19316
19291
  return D2;
19317
19292
  }, "getOwnPropertyDescriptor");
19318
- var $getOwnPropertyNames = /* @__PURE__ */ __name(function getOwnPropertyNames2(it) {
19293
+ var $getOwnPropertyNames = /* @__PURE__ */ __name(function getOwnPropertyNames3(it) {
19319
19294
  var names2 = gOPN(toIObject(it));
19320
19295
  var result = [];
19321
19296
  var i = 0;
@@ -19359,8 +19334,8 @@ if (!USE_NATIVE) {
19359
19334
  }, "toString"));
19360
19335
  $GOPD.f = $getOwnPropertyDescriptor;
19361
19336
  $DP.f = $defineProperty$1;
19362
- require_objectGopn().f = gOPNExt.f = $getOwnPropertyNames;
19363
- require_objectPie().f = $propertyIsEnumerable;
19337
+ _objectGopn.f = gOPNExt.f = $getOwnPropertyNames;
19338
+ _objectPie.f = $propertyIsEnumerable;
19364
19339
  $GOPS.f = $getOwnPropertySymbols;
19365
19340
  if (DESCRIPTORS && !_library) {
19366
19341
  redefine(ObjectProto, "propertyIsEnumerable", $propertyIsEnumerable);
@@ -39999,6 +39974,13 @@ const popoverOverflowModifiers = {
39999
39974
  const _TgSelect = class _TgSelect extends React__default$1.Component {
40000
39975
  constructor(props) {
40001
39976
  super(props);
39977
+ __publicField(this, "setOpenState", /* @__PURE__ */ __name((isOpen) => {
39978
+ const { handleOpenChange } = this.props;
39979
+ if (handleOpenChange) {
39980
+ handleOpenChange(isOpen);
39981
+ }
39982
+ this.setState({ isOpen });
39983
+ }, "setOpenState"));
40002
39984
  __publicField(this, "itemRenderer", /* @__PURE__ */ __name((i, { index: index2, handleClick, modifiers: modifiers2 }) => {
40003
39985
  const optionRenderer = this.getOptionRenderer();
40004
39986
  const onClick = i.onClick || handleClick;
@@ -40031,7 +40013,7 @@ const _TgSelect = class _TgSelect extends React__default$1.Component {
40031
40013
  if (multi) {
40032
40014
  let valArray = getValueArray(value);
40033
40015
  if (closeOnSelect || item.closeOnSelect) {
40034
- this.setState({ isOpen: false });
40016
+ this.setOpenState(false);
40035
40017
  this.input && this.input.blur();
40036
40018
  }
40037
40019
  if (isTagSelect && item.value && item.value.includes && item.value.includes(":")) {
@@ -40048,7 +40030,7 @@ const _TgSelect = class _TgSelect extends React__default$1.Component {
40048
40030
  }
40049
40031
  return onChange([...valArray, item]);
40050
40032
  } else {
40051
- this.setState({ isOpen: false });
40033
+ this.setOpenState(false);
40052
40034
  this.input && this.input.blur();
40053
40035
  return onChange(item);
40054
40036
  }
@@ -40061,7 +40043,7 @@ const _TgSelect = class _TgSelect extends React__default$1.Component {
40061
40043
  );
40062
40044
  e2.stopPropagation();
40063
40045
  onChange(filteredVals);
40064
- this.setState({ isOpen: false });
40046
+ this.setOpenState(false);
40065
40047
  this.input.focus();
40066
40048
  }, "handleTagRemove"));
40067
40049
  __publicField(this, "handleTagInputRemove", /* @__PURE__ */ __name((val2, index2) => {
@@ -40082,7 +40064,7 @@ const _TgSelect = class _TgSelect extends React__default$1.Component {
40082
40064
  const { onChange } = this.props;
40083
40065
  this.setState({ query: "" });
40084
40066
  onChange(newValue);
40085
- this.setState({ isOpen: false });
40067
+ this.setOpenState(false);
40086
40068
  this.input.focus();
40087
40069
  }, "handleClear"));
40088
40070
  __publicField(this, "itemListPredicate", /* @__PURE__ */ __name((queryString2, item) => {
@@ -40105,9 +40087,12 @@ const _TgSelect = class _TgSelect extends React__default$1.Component {
40105
40087
  }, "handleActiveItemChange"));
40106
40088
  __publicField(this, "onInteraction", /* @__PURE__ */ __name(() => {
40107
40089
  if (this.input != null && this.input !== document.activeElement) {
40108
- this.setState({ isOpen: false, query: "" });
40090
+ this.setOpenState(false);
40091
+ this.setState({
40092
+ query: ""
40093
+ });
40109
40094
  } else if (!this.props.openOnKeyDown) {
40110
- this.setState({ isOpen: true });
40095
+ this.setOpenState(true);
40111
40096
  }
40112
40097
  }, "onInteraction"));
40113
40098
  __publicField(this, "queryHasExactOptionMatch", /* @__PURE__ */ __name(() => {
@@ -40216,7 +40201,7 @@ const _TgSelect = class _TgSelect extends React__default$1.Component {
40216
40201
  onClick: (e2) => {
40217
40202
  if (this.state.isOpen) {
40218
40203
  e2.stopPropagation();
40219
- this.setState({ isOpen: false });
40204
+ this.setOpenState(false);
40220
40205
  }
40221
40206
  },
40222
40207
  disabled,
@@ -40289,11 +40274,11 @@ const _TgSelect = class _TgSelect extends React__default$1.Component {
40289
40274
  if (this.input != null) {
40290
40275
  this.input.blur();
40291
40276
  }
40292
- this.setState({ isOpen: false });
40277
+ this.setOpenState(false);
40293
40278
  e2.preventDefault();
40294
40279
  e2.stopPropagation();
40295
40280
  } else if (!(which === Keys.BACKSPACE || which === Keys.ARROW_LEFT || which === Keys.ARROW_RIGHT)) {
40296
- this.setState({ isOpen: true });
40281
+ this.setOpenState(true);
40297
40282
  }
40298
40283
  },
40299
40284
  inputProps: __spreadValues({
@@ -55175,7 +55160,7 @@ var KNOWN_STATICS = {
55175
55160
  arity: true
55176
55161
  };
55177
55162
  var defineProperty$3 = Object.defineProperty;
55178
- var getOwnPropertyNames3 = Object.getOwnPropertyNames;
55163
+ var getOwnPropertyNames4 = Object.getOwnPropertyNames;
55179
55164
  var getOwnPropertySymbols3 = Object.getOwnPropertySymbols;
55180
55165
  var getOwnPropertyDescriptor3 = Object.getOwnPropertyDescriptor;
55181
55166
  var getPrototypeOf = Object.getPrototypeOf;
@@ -55188,7 +55173,7 @@ function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
55188
55173
  hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
55189
55174
  }
55190
55175
  }
55191
- var keys5 = getOwnPropertyNames3(sourceComponent);
55176
+ var keys5 = getOwnPropertyNames4(sourceComponent);
55192
55177
  if (getOwnPropertySymbols3) {
55193
55178
  keys5 = keys5.concat(getOwnPropertySymbols3(sourceComponent));
55194
55179
  }
@@ -56417,13 +56402,24 @@ const _DataTable = class _DataTable extends React__default$1.Component {
56417
56402
  }, 0);
56418
56403
  }
56419
56404
  }, "updateFromProps"));
56420
- __publicField(this, "formatAndValidateEntities", /* @__PURE__ */ __name((entities) => {
56405
+ __publicField(this, "formatAndValidateEntities", /* @__PURE__ */ __name((entities, { useDefaultValues, indexToStartAt } = {}) => {
56421
56406
  const { schema: schema2 } = this.props;
56422
56407
  const editableFields = schema2.fields.filter((f2) => !f2.isNotEditable);
56423
56408
  const validationErrors = {};
56424
56409
  const newEnts = immer(entities, (entities2) => {
56425
56410
  entities2.forEach((e2, index2) => {
56426
56411
  editableFields.forEach((columnSchema) => {
56412
+ if (useDefaultValues) {
56413
+ if (e2[columnSchema.path] === void 0) {
56414
+ if (lodashExports.isFunction(columnSchema.defaultValue)) {
56415
+ e2[columnSchema.path] = columnSchema.defaultValue(
56416
+ index2 + indexToStartAt,
56417
+ e2
56418
+ );
56419
+ } else
56420
+ e2[columnSchema.path] = columnSchema.defaultValue;
56421
+ }
56422
+ }
56427
56423
  const { error } = editCellHelper({
56428
56424
  entity: e2,
56429
56425
  columnSchema,
@@ -56747,8 +56743,9 @@ const _DataTable = class _DataTable extends React__default$1.Component {
56747
56743
  }, "handleCut"));
56748
56744
  __publicField(this, "getCellCopyText", /* @__PURE__ */ __name((cellWrapper) => {
56749
56745
  const text2 = cellWrapper && cellWrapper.getAttribute("data-copy-text");
56746
+ const jsonText = cellWrapper && cellWrapper.getAttribute("data-copy-json");
56750
56747
  const toRet = text2 || cellWrapper.textContent || "";
56751
- return toRet;
56748
+ return [toRet, jsonText];
56752
56749
  }, "getCellCopyText"));
56753
56750
  __publicField(this, "handleCopyRow", /* @__PURE__ */ __name((rowEl) => {
56754
56751
  const text2 = this.getRowCopyText(rowEl);
@@ -56756,13 +56753,26 @@ const _DataTable = class _DataTable extends React__default$1.Component {
56756
56753
  return window.toastr.warning("No text to copy");
56757
56754
  this.handleCopyHelper(text2, "Row Copied");
56758
56755
  }, "handleCopyRow"));
56759
- __publicField(this, "handleCopyColumn", /* @__PURE__ */ __name((e2, cellWrapper) => {
56756
+ __publicField(this, "handleCopyColumn", /* @__PURE__ */ __name((e2, cellWrapper, selectedRecords) => {
56760
56757
  const cellType = cellWrapper.getAttribute("data-test");
56761
- const allRowEls = getAllRows(e2);
56762
- if (!allRowEls)
56758
+ let rowElsToCopy = getAllRows(e2);
56759
+ if (!rowElsToCopy)
56760
+ return;
56761
+ if (selectedRecords) {
56762
+ const ids = selectedRecords.map((e22) => {
56763
+ var _a2;
56764
+ return (_a2 = getIdOrCodeOrIndex(e22)) == null ? void 0 : _a2.toString();
56765
+ });
56766
+ rowElsToCopy = Array.from(rowElsToCopy).filter((rowEl) => {
56767
+ var _a2;
56768
+ const id2 = (_a2 = rowEl.closest(".rt-tr-group")) == null ? void 0 : _a2.getAttribute("data-test-id");
56769
+ return id2 !== void 0 && ids.includes(id2);
56770
+ });
56771
+ }
56772
+ if (!rowElsToCopy)
56763
56773
  return;
56764
56774
  const textToCopy = lodashExports.map(
56765
- allRowEls,
56775
+ rowElsToCopy,
56766
56776
  (rowEl) => this.getRowCopyText(rowEl, { cellType })
56767
56777
  ).filter((text2) => text2).join("\n");
56768
56778
  if (!textToCopy)
@@ -56803,9 +56813,10 @@ const _DataTable = class _DataTable extends React__default$1.Component {
56803
56813
  return this.getCellCopyText(cellChild);
56804
56814
  }).join(" ");
56805
56815
  }, "getRowCopyText"));
56806
- __publicField(this, "handleCopyHelper", /* @__PURE__ */ __name((stringToCopy, message) => {
56816
+ __publicField(this, "handleCopyHelper", /* @__PURE__ */ __name((stringToCopy, objToCopy, message) => {
56807
56817
  const copyHandler = /* @__PURE__ */ __name((e2) => {
56808
56818
  e2.preventDefault();
56819
+ e2.clipboardData.setData("application/json", JSON.stringify(objToCopy));
56809
56820
  e2.clipboardData.setData("text/plain", stringToCopy);
56810
56821
  }, "copyHandler");
56811
56822
  document.addEventListener("copy", copyHandler);
@@ -57667,6 +57678,22 @@ const _DataTable = class _DataTable extends React__default$1.Component {
57667
57678
  noEllipsis = true;
57668
57679
  } else {
57669
57680
  if (reduxFormEditingCell === cellId) {
57681
+ if (column.type === "genericSelect") {
57682
+ const GenericSelectComp = column.GenericSelectComp;
57683
+ return /* @__PURE__ */ React__default$1.createElement(
57684
+ GenericSelectComp,
57685
+ __spreadProps(__spreadValues({
57686
+ rowId,
57687
+ initialValue: text2
57688
+ }, dataTest), {
57689
+ finishEdit: (newVal2, doNotStopEditing) => {
57690
+ this.finishCellEdit(cellId, newVal2, doNotStopEditing);
57691
+ },
57692
+ dataTest,
57693
+ cancelEdit: this.cancelCellEdit
57694
+ })
57695
+ );
57696
+ }
57670
57697
  if (column.type === "dropdown" || column.type === "dropdownMulti") {
57671
57698
  return /* @__PURE__ */ React__default$1.createElement(
57672
57699
  DropdownCell,
@@ -57727,7 +57754,7 @@ const _DataTable = class _DataTable extends React__default$1.Component {
57727
57754
  title: title || void 0
57728
57755
  }),
57729
57756
  val2
57730
- ), isCellEditable && (column.type === "dropdown" || column.type === "dropdownMulti") && /* @__PURE__ */ React__default$1.createElement(
57757
+ ), isCellEditable && (column.type === "dropdown" || column.type === "dropdownMulti" || column.type === "genericSelect") && /* @__PURE__ */ React__default$1.createElement(
57731
57758
  Icon,
57732
57759
  {
57733
57760
  icon: "caret-down",
@@ -57870,7 +57897,7 @@ const _DataTable = class _DataTable extends React__default$1.Component {
57870
57897
  const cellNumStr2 = getNumberStrAtEnd(cellVal);
57871
57898
  const cellNum2 = Number(cellNumStr2);
57872
57899
  const cellTextNoNum = stripNumberAtEnd(cellVal);
57873
- if (cellNumStr2.startsWith("0")) {
57900
+ if (cellNumStr2 == null ? void 0 : cellNumStr2.startsWith("0")) {
57874
57901
  maybePad = cellNumStr2.length;
57875
57902
  }
57876
57903
  if (cellTextNoNum && !prefix2) {
@@ -58017,16 +58044,19 @@ const _DataTable = class _DataTable extends React__default$1.Component {
58017
58044
  return getIdOrCodeOrIndex(e2, i) === rowId;
58018
58045
  });
58019
58046
  const insertIndex = above ? indexToInsert : indexToInsert + 1;
58020
- let { newEnts, validationErrors } = this.formatAndValidateEntities(newEntities);
58047
+ const insertIndexToUse = appendToBottom ? entities2.length : insertIndex;
58048
+ let { newEnts, validationErrors } = this.formatAndValidateEntities(
58049
+ newEntities,
58050
+ {
58051
+ useDefaultValues: true,
58052
+ indexToStartAt: insertIndexToUse
58053
+ }
58054
+ );
58021
58055
  newEnts = newEnts.map((e2) => __spreadProps(__spreadValues({}, e2), {
58022
58056
  _isClean: true
58023
58057
  }));
58024
58058
  this.updateValidation(entities2, __spreadValues(__spreadValues({}, reduxFormCellValidation), validationErrors));
58025
- entities2.splice(
58026
- appendToBottom ? entities2.length : insertIndex,
58027
- 0,
58028
- ...newEnts
58029
- );
58059
+ entities2.splice(insertIndexToUse, 0, ...newEnts);
58030
58060
  });
58031
58061
  this.refocusTable();
58032
58062
  }, "insertRows"));
@@ -58067,8 +58097,8 @@ const _DataTable = class _DataTable extends React__default$1.Component {
58067
58097
  {
58068
58098
  key: "copyCell",
58069
58099
  onClick: () => {
58070
- const text2 = this.getCellCopyText(cellWrapper);
58071
- this.handleCopyHelper(text2, "Cell copied");
58100
+ const [text2, jsonText] = this.getCellCopyText(cellWrapper);
58101
+ this.handleCopyHelper(text2, jsonText, "Cell copied");
58072
58102
  },
58073
58103
  text: "Cell"
58074
58104
  }
@@ -58086,6 +58116,20 @@ const _DataTable = class _DataTable extends React__default$1.Component {
58086
58116
  }
58087
58117
  )
58088
58118
  );
58119
+ if (selectedRecords.length > 1) {
58120
+ copyMenuItems.push(
58121
+ /* @__PURE__ */ React__default$1.createElement(
58122
+ MenuItem,
58123
+ {
58124
+ key: "copyColumnSelected",
58125
+ onClick: () => {
58126
+ this.handleCopyColumn(e2, cellWrapper, selectedRecords);
58127
+ },
58128
+ text: "Column (Selected)"
58129
+ }
58130
+ )
58131
+ );
58132
+ }
58089
58133
  }
58090
58134
  if (selectedRecords.length === 0 || selectedRecords.length === 1) {
58091
58135
  const cell = e2.target.querySelector(".tg-cell-wrapper") || e2.target.closest(".tg-cell-wrapper") || e2.target.closest(".rt-td");
@@ -59339,7 +59383,8 @@ function getNumberStrAtEnd(str) {
59339
59383
  }
59340
59384
  __name(getNumberStrAtEnd, "getNumberStrAtEnd");
59341
59385
  function stripNumberAtEnd(str) {
59342
- return str.replace(getNumberStrAtEnd(str), "");
59386
+ var _a2;
59387
+ return (_a2 = str == null ? void 0 : str.replace) == null ? void 0 : _a2.call(str, getNumberStrAtEnd(str), "");
59343
59388
  }
59344
59389
  __name(stripNumberAtEnd, "stripNumberAtEnd");
59345
59390
  function isEntityClean(e2) {
@@ -61715,7 +61760,7 @@ const PreviewCsvData = observer(function(props) {
61715
61760
  } = props;
61716
61761
  const rerenderKey = useRef(0);
61717
61762
  rerenderKey.current = rerenderKey.current + 1;
61718
- const data = userSchema.userData && userSchema.userData.length && userSchema.userData.map((row) => {
61763
+ const data = userSchema.userData && userSchema.userData.length && userSchema.userData.map((row, i) => {
61719
61764
  const toRet = {
61720
61765
  _isClean: row._isClean
61721
61766
  };
@@ -61728,7 +61773,10 @@ const PreviewCsvData = observer(function(props) {
61728
61773
  }
61729
61774
  if (toRet[path2] === void 0 || toRet[path2] === "") {
61730
61775
  if (defaultValue2) {
61731
- toRet[path2] = defaultValue2;
61776
+ if (lodashExports.isFunction(defaultValue2)) {
61777
+ toRet[path2] = defaultValue2(i, row);
61778
+ } else
61779
+ toRet[path2] = defaultValue2;
61732
61780
  } else {
61733
61781
  toRet[path2] = "";
61734
61782
  }
@@ -71488,6 +71536,7 @@ function UploaderInner({
71488
71536
  overflowList,
71489
71537
  autoUnzip,
71490
71538
  disabled,
71539
+ noBuildCsvOption,
71491
71540
  initializeForm,
71492
71541
  showFilesCount,
71493
71542
  threeDotMenuItems,
@@ -71666,12 +71715,14 @@ function UploaderInner({
71666
71715
  subtext: "Includes Upload Instructions and Column Info",
71667
71716
  exampleFile: handleDownloadXlsxFile
71668
71717
  },
71669
- {
71670
- description: manualEnterMessage,
71671
- subtext: manualEnterSubMessage,
71672
- icon: "manually-entered-data",
71673
- exampleFile: handleManuallyEnterData
71674
- }
71718
+ ...noBuildCsvOption ? [] : [
71719
+ {
71720
+ description: manualEnterMessage,
71721
+ subtext: manualEnterSubMessage,
71722
+ icon: "manually-entered-data",
71723
+ exampleFile: handleManuallyEnterData
71724
+ }
71725
+ ]
71675
71726
  ];
71676
71727
  delete a2.exampleFile;
71677
71728
  }
@@ -72120,7 +72171,7 @@ function UploaderInner({
72120
72171
  },
72121
72172
  innerIcon || /* @__PURE__ */ React__default$1.createElement(Icon, { icon: "upload", iconSize: minimal ? 15 : 30 }),
72122
72173
  innerText || (minimal ? "Upload" : "Click or drag to upload"),
72123
- validateAgainstSchema && /* @__PURE__ */ React__default$1.createElement(
72174
+ validateAgainstSchema && !noBuildCsvOption && /* @__PURE__ */ React__default$1.createElement(
72124
72175
  "div",
72125
72176
  {
72126
72177
  style: {
@@ -77892,7 +77943,7 @@ const minimumOrfSize$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
77892
77943
  }, Symbol.toStringTag, { value: "Module" }));
77893
77944
  const protein_letters = "ACDEFGHIKLMNPQRSTVWY";
77894
77945
  const protein_letters_withUandX = "ACDEFGHIKLMNPQRSTVWYUX";
77895
- const extended_protein_letters = "ACDEFGHIKLMNPQRSTVWYBXZJUO*";
77946
+ const extended_protein_letters = "ACDEFGHIKLMNPQRSTVWYBXZJUO";
77896
77947
  const ambiguous_dna_letters = "GATCRYWSMKHBVDN";
77897
77948
  const unambiguous_dna_letters = "GATC";
77898
77949
  const ambiguous_rna_letters = "GAUCRYWSMKHBVDN";
@@ -77948,7 +77999,7 @@ const extended_protein_values = {
77948
77999
  Y: "Y",
77949
78000
  Z: "QE",
77950
78001
  "*": "\\*\\.",
77951
- ".": "\\.\\.",
78002
+ ".": "\\.",
77952
78003
  "-": "\\-"
77953
78004
  };
77954
78005
  const bioData = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
@@ -84055,9 +84106,12 @@ function getReplaceChars({
84055
84106
  isRna: isRna2,
84056
84107
  isMixedRnaAndDna
84057
84108
  } = {}) {
84058
- return isProtein2 ? {} : isOligo2 ? {} : isRna2 ? { t: "u" } : isMixedRnaAndDna ? {} : (
84059
- //just plain old dna
84060
- {}
84109
+ return isProtein2 ? {} : (
84110
+ // {".": "*"}
84111
+ isOligo2 ? {} : isRna2 ? { t: "u" } : isMixedRnaAndDna ? {} : (
84112
+ //just plain old dna
84113
+ {}
84114
+ )
84061
84115
  );
84062
84116
  }
84063
84117
  __name(getReplaceChars, "getReplaceChars");
@@ -84793,7 +84847,9 @@ function arrayRotate(arr, count2) {
84793
84847
  }
84794
84848
  __name(arrayRotate, "arrayRotate");
84795
84849
  function rotateSequenceDataToPosition(sequenceData2, caretPosition2, options) {
84796
- const newSequenceData = tidyUpSequenceData(sequenceData2, options);
84850
+ const newSequenceData = tidyUpSequenceData(sequenceData2, __spreadValues({
84851
+ doNotRemoveInvalidChars: true
84852
+ }, options));
84797
84853
  newSequenceData.sequence = rotateBpsToPosition(
84798
84854
  newSequenceData.sequence,
84799
84855
  caretPosition2
@@ -84830,7 +84886,7 @@ function adjustAnnotationsToInsert(annotationsToBeAdjusted, insertStart, insertL
84830
84886
  __name(adjustAnnotationsToInsert, "adjustAnnotationsToInsert");
84831
84887
  function insertSequenceDataAtPositionOrRange(_sequenceDataToInsert, _existingSequenceData, caretPositionOrRange, options = {}) {
84832
84888
  const { maintainOriginSplit } = options;
84833
- let existingSequenceData = tidyUpSequenceData(_existingSequenceData, options);
84889
+ let existingSequenceData = tidyUpSequenceData(_existingSequenceData, __spreadValues({ doNotRemoveInvalidChars: true }, options));
84834
84890
  const sequenceDataToInsert = tidyUpSequenceData(
84835
84891
  _sequenceDataToInsert,
84836
84892
  options
@@ -84848,6 +84904,7 @@ function insertSequenceDataAtPositionOrRange(_sequenceDataToInsert, _existingSeq
84848
84904
  return acc[type] = [];
84849
84905
  }, {})), {
84850
84906
  sequence: "",
84907
+ doNotRemoveInvalidChars: true,
84851
84908
  proteinSequence: "",
84852
84909
  chromatogramData: void 0
84853
84910
  }),
@@ -92878,7 +92935,7 @@ function getSequenceDataBetweenRange(seqData, range2, options = {}) {
92878
92935
  if (!range2)
92879
92936
  return seqData;
92880
92937
  const { exclude = {}, excludePartial = {} } = options;
92881
- const seqDataToUse = tidyUpSequenceData(seqData, options);
92938
+ const seqDataToUse = tidyUpSequenceData(seqData, __spreadValues({ doNotRemoveInvalidChars: true }, options));
92882
92939
  annotationTypes.forEach((type) => {
92883
92940
  delete seqDataToUse[`filtered${lodashExports.startCase(type)}`];
92884
92941
  });
@@ -92929,9 +92986,9 @@ function getSequenceDataBetweenRange(seqData, range2, options = {}) {
92929
92986
  }
92930
92987
  });
92931
92988
  });
92932
- return tidyUpSequenceData(toRet, options);
92989
+ return tidyUpSequenceData(toRet, __spreadValues({ doNotRemoveInvalidChars: true }, options));
92933
92990
  }
92934
- return tidyUpSequenceData(seqDataToReturn, options);
92991
+ return tidyUpSequenceData(seqDataToReturn, __spreadValues({ doNotRemoveInvalidChars: true }, options));
92935
92992
  }
92936
92993
  __name(getSequenceDataBetweenRange, "getSequenceDataBetweenRange");
92937
92994
  function getAnnotationsBetweenRange(annotationsToBeAdjusted, range2, maxLength, shouldExcludePartial) {
@@ -92978,7 +93035,7 @@ function getComplementSequenceAndAnnotations(pSeqObj, options = {}) {
92978
93035
  const newSeqObj = Object.assign({}, seqObj, {
92979
93036
  sequence: getComplementSequenceString(seqObj.sequence, seqObj.isRna)
92980
93037
  });
92981
- return tidyUpSequenceData(newSeqObj, options);
93038
+ return tidyUpSequenceData(newSeqObj, __spreadValues({ doNotRemoveInvalidChars: true }, options));
92982
93039
  }
92983
93040
  __name(getComplementSequenceAndAnnotations, "getComplementSequenceAndAnnotations");
92984
93041
  function getCutsiteType(restrictionEnzyme) {
@@ -93026,7 +93083,7 @@ __name(getReverseComplementAnnotation, "getReverseComplementAnnotation");
93026
93083
  function getReverseComplementSequenceAndAnnoations(pSeqObj, options = {}) {
93027
93084
  const seqObj = tidyUpSequenceData(
93028
93085
  getSequenceDataBetweenRange(pSeqObj, options.range),
93029
- options
93086
+ __spreadValues({ doNotRemoveInvalidChars: true }, options)
93030
93087
  );
93031
93088
  const newSeqObj = Object.assign(
93032
93089
  {},
@@ -93046,7 +93103,9 @@ function getReverseComplementSequenceAndAnnoations(pSeqObj, options = {}) {
93046
93103
  return acc;
93047
93104
  }, {})
93048
93105
  );
93049
- return tidyUpSequenceData(newSeqObj, options);
93106
+ return tidyUpSequenceData(newSeqObj, __spreadValues({
93107
+ doNotRemoveInvalidChars: true
93108
+ }, options));
93050
93109
  }
93051
93110
  __name(getReverseComplementSequenceAndAnnoations, "getReverseComplementSequenceAndAnnoations");
93052
93111
  function guessIfSequenceIsDnaAndNotProtein(seq, options = {}) {
@@ -93992,6 +94051,30 @@ function flattenSequenceArray(parsingResultArray, opts2) {
93992
94051
  return parsingResultArray;
93993
94052
  }
93994
94053
  __name(flattenSequenceArray, "flattenSequenceArray");
94054
+ function parseFeatureLocation(locStr, isProtein2, inclusive1BasedStart, inclusive1BasedEnd) {
94055
+ locStr = locStr.trim();
94056
+ const locArr = [];
94057
+ locStr.replace(/(\d+)/g, function(string2, match2) {
94058
+ locArr.push(match2);
94059
+ });
94060
+ const locArray = [];
94061
+ for (let i = 0; i < locArr.length; i += 2) {
94062
+ const start2 = parseInt(locArr[i], 10) - (inclusive1BasedStart ? 0 : 1);
94063
+ let end2 = parseInt(locArr[i + 1], 10) - (inclusive1BasedEnd ? 0 : 1);
94064
+ if (isNaN(end2)) {
94065
+ end2 = start2;
94066
+ }
94067
+ const location2 = {
94068
+ start: start2,
94069
+ end: end2
94070
+ };
94071
+ locArray.push(
94072
+ isProtein2 ? convertAACaretPositionOrRangeToDna(location2) : location2
94073
+ );
94074
+ }
94075
+ return locArray;
94076
+ }
94077
+ __name(parseFeatureLocation, "parseFeatureLocation");
93995
94078
  function genbankToJson(string2, options = {}) {
93996
94079
  const {
93997
94080
  inclusive1BasedStart,
@@ -94316,7 +94399,15 @@ function genbankToJson(string2, options = {}) {
94316
94399
  }
94317
94400
  if (isFeatureLineRunon(line, featureLocationIndentation)) {
94318
94401
  if (lastLineWasLocation) {
94319
- parseFeatureLocation(line.trim(), options);
94402
+ const feat = getCurrentFeature();
94403
+ feat.locations = feat.locations.concat(
94404
+ parseFeatureLocation(
94405
+ line.trim(),
94406
+ options.isProtein,
94407
+ inclusive1BasedStart,
94408
+ inclusive1BasedEnd
94409
+ )
94410
+ );
94320
94411
  lastLineWasLocation = true;
94321
94412
  } else {
94322
94413
  if (currentFeatureNote) {
@@ -94342,7 +94433,14 @@ function genbankToJson(string2, options = {}) {
94342
94433
  const feat = getCurrentFeature();
94343
94434
  feat.type = key;
94344
94435
  feat.strand = strand;
94345
- parseFeatureLocation(val2, options);
94436
+ feat.locations = feat.locations.concat(
94437
+ parseFeatureLocation(
94438
+ val2,
94439
+ options.isProtein,
94440
+ inclusive1BasedStart,
94441
+ inclusive1BasedEnd
94442
+ )
94443
+ );
94346
94444
  lastLineWasLocation = true;
94347
94445
  }
94348
94446
  }
@@ -94365,29 +94463,6 @@ function genbankToJson(string2, options = {}) {
94365
94463
  return qual;
94366
94464
  }
94367
94465
  __name(isNote, "isNote");
94368
- function parseFeatureLocation(locStr, options2) {
94369
- locStr = locStr.trim();
94370
- const locArr = [];
94371
- locStr.replace(/(\d+)/g, function(string22, match2) {
94372
- locArr.push(match2);
94373
- });
94374
- for (let i = 0; i < locArr.length; i += 2) {
94375
- const start2 = parseInt(locArr[i], 10) - (inclusive1BasedStart ? 0 : 1);
94376
- let end2 = parseInt(locArr[i + 1], 10) - (inclusive1BasedEnd ? 0 : 1);
94377
- if (isNaN(end2)) {
94378
- end2 = start2;
94379
- }
94380
- const location2 = {
94381
- start: start2,
94382
- end: end2
94383
- };
94384
- const feat = getCurrentFeature();
94385
- feat.locations.push(
94386
- options2.isProtein ? convertAACaretPositionOrRangeToDna(location2) : location2
94387
- );
94388
- }
94389
- }
94390
- __name(parseFeatureLocation, "parseFeatureLocation");
94391
94466
  function parseFeatureNote(line) {
94392
94467
  let newLine;
94393
94468
  newLine = line.trimLeft();
@@ -106641,7 +106716,9 @@ function addHighlightedDifferences(alignmentTracks) {
106641
106716
  if (track2.isUnmapped) {
106642
106717
  return track2;
106643
106718
  }
106644
- const sequenceData2 = tidyUpSequenceData(track2.sequenceData);
106719
+ const sequenceData2 = tidyUpSequenceData(track2.sequenceData, {
106720
+ doNotRemoveInvalidChars: true
106721
+ });
106645
106722
  const matchHighlightRanges = getRangeMatchesBetweenTemplateAndNonTemplate(
106646
106723
  alignmentTracks[0].alignmentData.sequence,
106647
106724
  track2.alignmentData.sequence
@@ -106701,7 +106778,9 @@ const alignments = /* @__PURE__ */ __name((state2 = {}, { payload = {}, type })
106701
106778
  const templateSeq = payloadToUse.pairwiseAlignments[0][0];
106702
106779
  const pairwiseOverviewAlignmentTracks = [
106703
106780
  __spreadProps(__spreadValues({}, templateSeq), {
106704
- sequenceData: tidyUpSequenceData(templateSeq.sequenceData),
106781
+ sequenceData: tidyUpSequenceData(templateSeq.sequenceData, {
106782
+ doNotRemoveInvalidChars: true
106783
+ }),
106705
106784
  alignmentData: { sequence: templateSeq.sequenceData.sequence }
106706
106785
  //remove the gaps from the template sequence
106707
106786
  })
@@ -106730,7 +106809,9 @@ const alignments = /* @__PURE__ */ __name((state2 = {}, { payload = {}, type })
106730
106809
  }));
106731
106810
  }
106732
106811
  const alignedSeqMinusInserts = __spreadProps(__spreadValues({}, alignedSeq), {
106733
- sequenceData: __spreadProps(__spreadValues({}, tidyUpSequenceData(alignedSeq.sequenceData)), {
106812
+ sequenceData: __spreadProps(__spreadValues({}, tidyUpSequenceData(alignedSeq.sequenceData, {
106813
+ doNotRemoveInvalidChars: true
106814
+ })), {
106734
106815
  sequence: template.sequenceData.sequence
106735
106816
  }),
106736
106817
  additionalSelectionLayers,
@@ -110682,7 +110763,7 @@ const handleSave = /* @__PURE__ */ __name((props) => (..._0) => __async(void 0,
110682
110763
  }
110683
110764
  const promiseOrVal = (!readOnly2 || alwaysAllowSave || opts2.isSaveAs) && saveHandler && saveHandler(
110684
110765
  opts2,
110685
- tidyUpSequenceData(sequenceData2, { annotationsAsObjects: true }),
110766
+ tidyUpSequenceData(sequenceData2, { doNotRemoveInvalidChars: true, annotationsAsObjects: true }),
110686
110767
  props,
110687
110768
  updateLastSavedIdToCurrent
110688
110769
  );
@@ -111282,7 +111363,7 @@ function jsonToJson(incomingJson) {
111282
111363
  return JSON.stringify(
111283
111364
  lodashExports.omit(
111284
111365
  cleanUpTeselagenJsonForExport(
111285
- tidyUpSequenceData(incomingJson, { annotationsAsObjects: false })
111366
+ tidyUpSequenceData(incomingJson, { doNotRemoveInvalidChars: true, annotationsAsObjects: false })
111286
111367
  ),
111287
111368
  [
111288
111369
  "sequenceFragments",
@@ -125765,7 +125846,7 @@ function showFileDialog({ multiple = false, onSelect }) {
125765
125846
  }
125766
125847
  __name(showFileDialog, "showFileDialog");
125767
125848
  const name = "@teselagen/ove";
125768
- const version = "0.3.48";
125849
+ const version = "0.3.50";
125769
125850
  const main = "./src/index.js";
125770
125851
  const exports$1 = {
125771
125852
  ".": {
@@ -130501,7 +130582,7 @@ function VectorInteractionHOC(Component2) {
130501
130582
  }
130502
130583
  }
130503
130584
  ),
130504
- { annotationsAsObjects: true }
130585
+ { doNotRemoveInvalidChars: true, annotationsAsObjects: true }
130505
130586
  );
130506
130587
  if (!(this.sequenceDataToCopy || {}).textToCopy && !seqData.sequence.length)
130507
130588
  return window.toastr.warning(
@@ -130517,7 +130598,7 @@ function VectorInteractionHOC(Component2) {
130517
130598
  this.handleDnaDelete(false);
130518
130599
  onCut(
130519
130600
  e2,
130520
- tidyUpSequenceData(seqData, { annotationsAsObjects: true }),
130601
+ tidyUpSequenceData(seqData, { doNotRemoveInvalidChars: true, annotationsAsObjects: true }),
130521
130602
  this.props
130522
130603
  );
130523
130604
  document.body.removeEventListener("cut", this.handleCut);