@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.cjs.js +336 -130
- package/index.es.js +337 -131
- package/index.umd.js +405 -173
- package/package.json +4 -4
- package/src/AlignmentView/Minimap.js +3 -8
- package/src/LinearView/index.js +11 -8
- package/src/LinearView/style.css +1 -1
- package/src/RowItem/Axis.js +1 -3
- package/src/RowItem/index.js +6 -6
- package/src/commands/index.js +8 -6
- package/src/style.css +4 -4
- package/src/withEditorInteractions/index.js +49 -47
- package/style.css +28 -5
package/index.cjs.js
CHANGED
|
@@ -64,8 +64,8 @@ const ReactDOM$1 = require("react-dom");
|
|
|
64
64
|
const reduxForm = require("redux-form");
|
|
65
65
|
const reactRedux = require("react-redux");
|
|
66
66
|
const select = require("@blueprintjs/select");
|
|
67
|
-
const datetime = require("@blueprintjs/datetime");
|
|
68
67
|
const redux = require("redux");
|
|
68
|
+
const datetime = require("@blueprintjs/datetime");
|
|
69
69
|
function _interopNamespaceDefault(e2) {
|
|
70
70
|
const n2 = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
71
71
|
if (e2) {
|
|
@@ -3041,7 +3041,7 @@ let clearMe;
|
|
|
3041
3041
|
inner2(dataTip, el, opts2);
|
|
3042
3042
|
break;
|
|
3043
3043
|
} 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
|
|
3044
|
-
!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) {
|
|
3044
|
+
!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) {
|
|
3045
3045
|
inner2(el.textContent, el, opts2);
|
|
3046
3046
|
break;
|
|
3047
3047
|
} else if (isEllipsized && el.offsetWidth >= el.scrollWidth)
|
|
@@ -3054,6 +3054,28 @@ let clearMe;
|
|
|
3054
3054
|
}
|
|
3055
3055
|
});
|
|
3056
3056
|
})();
|
|
3057
|
+
function parentIncludesNoChildDataTip(el, count2) {
|
|
3058
|
+
if (count2 > 4)
|
|
3059
|
+
return false;
|
|
3060
|
+
if (!el)
|
|
3061
|
+
return false;
|
|
3062
|
+
if (el.getAttribute("data-no-child-data-tip"))
|
|
3063
|
+
return true;
|
|
3064
|
+
return parentIncludesNoChildDataTip(el.parentElement, count2 + 1);
|
|
3065
|
+
}
|
|
3066
|
+
__name(parentIncludesNoChildDataTip, "parentIncludesNoChildDataTip");
|
|
3067
|
+
const LoadingDots = /* @__PURE__ */ __name(() => {
|
|
3068
|
+
const [dots, setDots] = React$2.useState("");
|
|
3069
|
+
React$2.useEffect(() => {
|
|
3070
|
+
const interval = setInterval(() => {
|
|
3071
|
+
setDots((dots2) => {
|
|
3072
|
+
return dots2.length === 3 ? "" : dots2 + ".";
|
|
3073
|
+
});
|
|
3074
|
+
}, 500);
|
|
3075
|
+
return () => clearInterval(interval);
|
|
3076
|
+
}, []);
|
|
3077
|
+
return /* @__PURE__ */ React$2.createElement("span", null, dots);
|
|
3078
|
+
}, "LoadingDots");
|
|
3057
3079
|
const AssignDefaultsModeContext = React$2.createContext({
|
|
3058
3080
|
inAssignDefaultsMode: false,
|
|
3059
3081
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
@@ -16933,11 +16955,20 @@ var _fails = /* @__PURE__ */ __name(function(exec) {
|
|
|
16933
16955
|
return true;
|
|
16934
16956
|
}
|
|
16935
16957
|
}, "_fails");
|
|
16936
|
-
var _descriptors
|
|
16937
|
-
|
|
16938
|
-
|
|
16939
|
-
|
|
16940
|
-
|
|
16958
|
+
var _descriptors;
|
|
16959
|
+
var hasRequired_descriptors;
|
|
16960
|
+
function require_descriptors() {
|
|
16961
|
+
if (hasRequired_descriptors)
|
|
16962
|
+
return _descriptors;
|
|
16963
|
+
hasRequired_descriptors = 1;
|
|
16964
|
+
_descriptors = !_fails(function() {
|
|
16965
|
+
return Object.defineProperty({}, "a", { get: function() {
|
|
16966
|
+
return 7;
|
|
16967
|
+
} }).a != 7;
|
|
16968
|
+
});
|
|
16969
|
+
return _descriptors;
|
|
16970
|
+
}
|
|
16971
|
+
__name(require_descriptors, "require_descriptors");
|
|
16941
16972
|
var _domCreate;
|
|
16942
16973
|
var hasRequired_domCreate;
|
|
16943
16974
|
function require_domCreate() {
|
|
@@ -16953,7 +16984,7 @@ function require_domCreate() {
|
|
|
16953
16984
|
return _domCreate;
|
|
16954
16985
|
}
|
|
16955
16986
|
__name(require_domCreate, "require_domCreate");
|
|
16956
|
-
var _ie8DomDefine = !
|
|
16987
|
+
var _ie8DomDefine = !require_descriptors() && !_fails(function() {
|
|
16957
16988
|
return Object.defineProperty(require_domCreate()("div"), "a", { get: function() {
|
|
16958
16989
|
return 7;
|
|
16959
16990
|
} }).a != 7;
|
|
@@ -16975,7 +17006,7 @@ var anObject$3 = _anObject;
|
|
|
16975
17006
|
var IE8_DOM_DEFINE$1 = _ie8DomDefine;
|
|
16976
17007
|
var toPrimitive$2 = _toPrimitive$1;
|
|
16977
17008
|
var dP$2 = Object.defineProperty;
|
|
16978
|
-
_objectDp.f =
|
|
17009
|
+
_objectDp.f = require_descriptors() ? Object.defineProperty : /* @__PURE__ */ __name(function defineProperty2(O2, P2, Attributes) {
|
|
16979
17010
|
anObject$3(O2);
|
|
16980
17011
|
P2 = toPrimitive$2(P2, true);
|
|
16981
17012
|
anObject$3(Attributes);
|
|
@@ -17000,7 +17031,7 @@ var _propertyDesc = /* @__PURE__ */ __name(function(bitmap, value) {
|
|
|
17000
17031
|
}, "_propertyDesc");
|
|
17001
17032
|
var dP$1 = _objectDp;
|
|
17002
17033
|
var createDesc$3 = _propertyDesc;
|
|
17003
|
-
var _hide =
|
|
17034
|
+
var _hide = require_descriptors() ? function(object3, key, value) {
|
|
17004
17035
|
return dP$1.f(object3, key, createDesc$3(1, value));
|
|
17005
17036
|
} : function(object3, key, value) {
|
|
17006
17037
|
object3[key] = value;
|
|
@@ -17187,7 +17218,15 @@ var _objectKeys = Object.keys || /* @__PURE__ */ __name(function keys(O2) {
|
|
|
17187
17218
|
var _objectGops = {};
|
|
17188
17219
|
_objectGops.f = Object.getOwnPropertySymbols;
|
|
17189
17220
|
var _objectPie = {};
|
|
17190
|
-
|
|
17221
|
+
var hasRequired_objectPie;
|
|
17222
|
+
function require_objectPie() {
|
|
17223
|
+
if (hasRequired_objectPie)
|
|
17224
|
+
return _objectPie;
|
|
17225
|
+
hasRequired_objectPie = 1;
|
|
17226
|
+
_objectPie.f = {}.propertyIsEnumerable;
|
|
17227
|
+
return _objectPie;
|
|
17228
|
+
}
|
|
17229
|
+
__name(require_objectPie, "require_objectPie");
|
|
17191
17230
|
var defined$1 = _defined;
|
|
17192
17231
|
var _toObject = /* @__PURE__ */ __name(function(it) {
|
|
17193
17232
|
return Object(defined$1(it));
|
|
@@ -17198,10 +17237,10 @@ function require_objectAssign() {
|
|
|
17198
17237
|
if (hasRequired_objectAssign)
|
|
17199
17238
|
return _objectAssign;
|
|
17200
17239
|
hasRequired_objectAssign = 1;
|
|
17201
|
-
var DESCRIPTORS2 =
|
|
17240
|
+
var DESCRIPTORS2 = require_descriptors();
|
|
17202
17241
|
var getKeys2 = _objectKeys;
|
|
17203
17242
|
var gOPS2 = _objectGops;
|
|
17204
|
-
var pIE2 =
|
|
17243
|
+
var pIE2 = require_objectPie();
|
|
17205
17244
|
var toObject2 = _toObject;
|
|
17206
17245
|
var IObject2 = require_iobject();
|
|
17207
17246
|
var $assign = Object.assign;
|
|
@@ -17273,7 +17312,7 @@ function require_objectDps() {
|
|
|
17273
17312
|
var dP2 = _objectDp;
|
|
17274
17313
|
var anObject2 = _anObject;
|
|
17275
17314
|
var getKeys2 = _objectKeys;
|
|
17276
|
-
_objectDps =
|
|
17315
|
+
_objectDps = require_descriptors() ? Object.defineProperties : /* @__PURE__ */ __name(function defineProperties3(O2, Properties2) {
|
|
17277
17316
|
anObject2(O2);
|
|
17278
17317
|
var keys5 = getKeys2(Properties2);
|
|
17279
17318
|
var length = keys5.length;
|
|
@@ -17754,7 +17793,7 @@ var _default$8 = /* @__PURE__ */ __name(function(instance, Constructor) {
|
|
|
17754
17793
|
}
|
|
17755
17794
|
}, "_default$8");
|
|
17756
17795
|
var $export$3 = _export;
|
|
17757
|
-
$export$3($export$3.S + $export$3.F * !
|
|
17796
|
+
$export$3($export$3.S + $export$3.F * !require_descriptors(), "Object", { defineProperty: _objectDp.f });
|
|
17758
17797
|
var $Object$2 = _coreExports.Object;
|
|
17759
17798
|
var defineProperty$c = /* @__PURE__ */ __name(function defineProperty3(it, key, desc) {
|
|
17760
17799
|
return $Object$2.defineProperty(it, key, desc);
|
|
@@ -17856,7 +17895,7 @@ var _wksDefine = /* @__PURE__ */ __name(function(name2) {
|
|
|
17856
17895
|
}, "_wksDefine");
|
|
17857
17896
|
var getKeys = _objectKeys;
|
|
17858
17897
|
var gOPS$1 = _objectGops;
|
|
17859
|
-
var pIE$1 =
|
|
17898
|
+
var pIE$1 = require_objectPie();
|
|
17860
17899
|
var _enumKeys = /* @__PURE__ */ __name(function(it) {
|
|
17861
17900
|
var result = getKeys(it);
|
|
17862
17901
|
var getSymbols2 = gOPS$1.f;
|
|
@@ -17897,14 +17936,14 @@ _objectGopnExt.f = /* @__PURE__ */ __name(function getOwnPropertyNames2(it) {
|
|
|
17897
17936
|
return windowNames && toString$5.call(it) == "[object Window]" ? getWindowNames(it) : gOPN$1(toIObject$2(it));
|
|
17898
17937
|
}, "getOwnPropertyNames");
|
|
17899
17938
|
var _objectGopd = {};
|
|
17900
|
-
var pIE =
|
|
17939
|
+
var pIE = require_objectPie();
|
|
17901
17940
|
var createDesc$1 = _propertyDesc;
|
|
17902
17941
|
var toIObject$1 = _toIobject;
|
|
17903
17942
|
var toPrimitive$1 = _toPrimitive$1;
|
|
17904
17943
|
var has$9 = _has;
|
|
17905
17944
|
var IE8_DOM_DEFINE = _ie8DomDefine;
|
|
17906
17945
|
var gOPD$5 = Object.getOwnPropertyDescriptor;
|
|
17907
|
-
_objectGopd.f =
|
|
17946
|
+
_objectGopd.f = require_descriptors() ? gOPD$5 : /* @__PURE__ */ __name(function getOwnPropertyDescriptor(O2, P2) {
|
|
17908
17947
|
O2 = toIObject$1(O2);
|
|
17909
17948
|
P2 = toPrimitive$1(P2, true);
|
|
17910
17949
|
if (IE8_DOM_DEFINE)
|
|
@@ -17917,7 +17956,7 @@ _objectGopd.f = _descriptors ? gOPD$5 : /* @__PURE__ */ __name(function getOwnPr
|
|
|
17917
17956
|
}, "getOwnPropertyDescriptor");
|
|
17918
17957
|
var global$2 = _globalExports;
|
|
17919
17958
|
var has$8 = _has;
|
|
17920
|
-
var DESCRIPTORS =
|
|
17959
|
+
var DESCRIPTORS = require_descriptors();
|
|
17921
17960
|
var $export$2 = _export;
|
|
17922
17961
|
var redefine = _redefine;
|
|
17923
17962
|
var META = _metaExports.KEY;
|
|
@@ -18077,7 +18116,7 @@ if (!USE_NATIVE) {
|
|
|
18077
18116
|
$GOPD.f = $getOwnPropertyDescriptor;
|
|
18078
18117
|
$DP.f = $defineProperty$1;
|
|
18079
18118
|
_objectGopn.f = gOPNExt.f = $getOwnPropertyNames;
|
|
18080
|
-
|
|
18119
|
+
require_objectPie().f = $propertyIsEnumerable;
|
|
18081
18120
|
$GOPS.f = $getOwnPropertySymbols;
|
|
18082
18121
|
if (DESCRIPTORS && !_library) {
|
|
18083
18122
|
redefine(ObjectProto, "propertyIsEnumerable", $propertyIsEnumerable);
|
|
@@ -39019,27 +39058,51 @@ __publicField(_TgSelect, "defaultProps", {
|
|
|
39019
39058
|
value: void 0
|
|
39020
39059
|
});
|
|
39021
39060
|
let TgSelect = _TgSelect;
|
|
39022
|
-
const
|
|
39023
|
-
const
|
|
39024
|
-
|
|
39025
|
-
|
|
39026
|
-
|
|
39027
|
-
|
|
39028
|
-
|
|
39029
|
-
|
|
39030
|
-
|
|
39031
|
-
|
|
39032
|
-
return matching;
|
|
39061
|
+
const withAsyncOptions = /* @__PURE__ */ __name((Component) => (props) => {
|
|
39062
|
+
const _a2 = props, { loadOptions, options } = _a2, rest = __objRest(_a2, ["loadOptions", "options"]);
|
|
39063
|
+
const [asyncOptions, setAsyncOptions] = React$2.useState([]);
|
|
39064
|
+
const [isLoading, setLoading] = React$2.useState(false);
|
|
39065
|
+
React$2.useEffect(() => {
|
|
39066
|
+
if (loadOptions) {
|
|
39067
|
+
setLoading(true);
|
|
39068
|
+
loadOptions().then((options2) => {
|
|
39069
|
+
setAsyncOptions(options2);
|
|
39070
|
+
setLoading(false);
|
|
39033
39071
|
});
|
|
39034
|
-
|
|
39035
|
-
|
|
39036
|
-
|
|
39037
|
-
|
|
39038
|
-
|
|
39039
|
-
|
|
39040
|
-
|
|
39041
|
-
|
|
39042
|
-
|
|
39072
|
+
}
|
|
39073
|
+
}, [loadOptions]);
|
|
39074
|
+
return /* @__PURE__ */ React$2.createElement(
|
|
39075
|
+
Component,
|
|
39076
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
39077
|
+
isLoading: isLoading || rest.isLoading,
|
|
39078
|
+
options: loadOptions ? asyncOptions : options
|
|
39079
|
+
})
|
|
39080
|
+
);
|
|
39081
|
+
}, "withAsyncOptions");
|
|
39082
|
+
const TgSelect$1 = redux.compose(
|
|
39083
|
+
withAsyncOptions,
|
|
39084
|
+
withProps((props) => {
|
|
39085
|
+
const { multi, value, options = [] } = props;
|
|
39086
|
+
let optionsToRet = options;
|
|
39087
|
+
if (multi && value) {
|
|
39088
|
+
const valArray = getValueArray(value);
|
|
39089
|
+
optionsToRet = options.filter((op) => {
|
|
39090
|
+
const isOptionSelected = valArray.some((val2) => {
|
|
39091
|
+
if (!val2)
|
|
39092
|
+
return false;
|
|
39093
|
+
const matching = lodashExports.isEqual(val2.value, op.value);
|
|
39094
|
+
return matching;
|
|
39095
|
+
});
|
|
39096
|
+
return !isOptionSelected;
|
|
39097
|
+
});
|
|
39098
|
+
}
|
|
39099
|
+
return {
|
|
39100
|
+
// unfilteredOptions is needed for finding selected items
|
|
39101
|
+
unfilteredOptions: options,
|
|
39102
|
+
options: optionsToRet
|
|
39103
|
+
};
|
|
39104
|
+
})
|
|
39105
|
+
)(TgSelect);
|
|
39043
39106
|
const itemDisabled = /* @__PURE__ */ __name((i) => i.disabled, "itemDisabled");
|
|
39044
39107
|
const noResultsDefault = /* @__PURE__ */ React$2.createElement("div", null, "No Results...");
|
|
39045
39108
|
const renderCreateNewOption$1 = /* @__PURE__ */ __name((query, active3, handleClick) => /* @__PURE__ */ React$2.createElement(
|
|
@@ -42389,19 +42452,59 @@ const generateToast = /* @__PURE__ */ __name((intent) => (message, options) => {
|
|
|
42389
42452
|
if (intent === core$5.Intent.DANGER) {
|
|
42390
42453
|
console.error("Toastr error message: ", message);
|
|
42391
42454
|
}
|
|
42455
|
+
const maybeAddClearAll = /* @__PURE__ */ __name(() => {
|
|
42456
|
+
const existingClearAllButtons = document.querySelectorAll(`.tg-clear-all-toasts`);
|
|
42457
|
+
existingClearAllButtons.forEach((button) => {
|
|
42458
|
+
button.remove();
|
|
42459
|
+
});
|
|
42460
|
+
const activeToasts = document.querySelectorAll(
|
|
42461
|
+
`.bp3-toast:not(.bp3-toast-exit)`
|
|
42462
|
+
);
|
|
42463
|
+
if (activeToasts.length > 1) {
|
|
42464
|
+
const topToaster = document.querySelector(`.bp3-toast`);
|
|
42465
|
+
if (!topToaster)
|
|
42466
|
+
return;
|
|
42467
|
+
const closeButton = document.createElement("div");
|
|
42468
|
+
closeButton.classList.add(
|
|
42469
|
+
core$5.Classes.BUTTON,
|
|
42470
|
+
core$5.Classes.LARGE,
|
|
42471
|
+
core$5.Classes.INTENT_PRIMARY,
|
|
42472
|
+
"tg-clear-all-toasts"
|
|
42473
|
+
);
|
|
42474
|
+
closeButton.innerText = "Clear all";
|
|
42475
|
+
closeButton.onclick = window.__tgClearAllToasts;
|
|
42476
|
+
closeButton.style.position = "absolute";
|
|
42477
|
+
closeButton.style.right = "-100px";
|
|
42478
|
+
topToaster.appendChild(closeButton);
|
|
42479
|
+
}
|
|
42480
|
+
}, "maybeAddClearAll");
|
|
42392
42481
|
const uniqKey = toastToUse.show(
|
|
42393
42482
|
{
|
|
42394
42483
|
intent,
|
|
42395
42484
|
message,
|
|
42396
|
-
|
|
42485
|
+
onDismiss: () => {
|
|
42486
|
+
if (options.onDismiss) {
|
|
42487
|
+
options.onDismiss();
|
|
42488
|
+
}
|
|
42489
|
+
setTimeout(() => {
|
|
42490
|
+
maybeAddClearAll();
|
|
42491
|
+
}, 0);
|
|
42492
|
+
},
|
|
42493
|
+
timeout: options.timeout || updatedTimeout || (!window.Cypress && intent === core$5.Intent.DANGER ? 6e4 : void 0),
|
|
42397
42494
|
action: options.action,
|
|
42398
42495
|
icon: options.icon,
|
|
42399
42496
|
className: classNames("preserve-newline", options.className)
|
|
42400
42497
|
},
|
|
42401
42498
|
options.key
|
|
42402
42499
|
);
|
|
42500
|
+
setTimeout(() => {
|
|
42501
|
+
maybeAddClearAll();
|
|
42502
|
+
}, 0);
|
|
42403
42503
|
function clear3() {
|
|
42404
42504
|
toastToUse.dismiss(uniqKey);
|
|
42505
|
+
setTimeout(() => {
|
|
42506
|
+
maybeAddClearAll();
|
|
42507
|
+
}, 0);
|
|
42405
42508
|
}
|
|
42406
42509
|
__name(clear3, "clear");
|
|
42407
42510
|
clear3.key = uniqKey;
|
|
@@ -42571,6 +42674,7 @@ const _FilterAndSortMenu = class _FilterAndSortMenu extends React$2.Component {
|
|
|
42571
42674
|
intent: core$5.Intent.SUCCESS,
|
|
42572
42675
|
text: "Filter",
|
|
42573
42676
|
secondaryText: "Clear",
|
|
42677
|
+
secondaryIntent: core$5.Intent.DANGER,
|
|
42574
42678
|
secondaryAction: () => {
|
|
42575
42679
|
currentFilter && removeSingleFilter(currentFilter.filterOn);
|
|
42576
42680
|
}
|
|
@@ -55460,17 +55564,20 @@ const _DataTable = class _DataTable extends React$2.Component {
|
|
|
55460
55564
|
});
|
|
55461
55565
|
}
|
|
55462
55566
|
}, "handleSelectAllRows"));
|
|
55567
|
+
__publicField(this, "updateValidationHelper", /* @__PURE__ */ __name(() => {
|
|
55568
|
+
const { entities, reduxFormCellValidation } = computePresets(this.props);
|
|
55569
|
+
this.updateValidation(entities, reduxFormCellValidation);
|
|
55570
|
+
}, "updateValidationHelper"));
|
|
55463
55571
|
__publicField(this, "updateValidation", /* @__PURE__ */ __name((entities, newCellValidate) => {
|
|
55464
55572
|
const { change, schema: schema2 } = computePresets(this.props);
|
|
55465
|
-
|
|
55466
|
-
|
|
55467
|
-
|
|
55468
|
-
|
|
55469
|
-
|
|
55470
|
-
|
|
55471
|
-
|
|
55472
|
-
|
|
55473
|
-
);
|
|
55573
|
+
const tableWideErr = validateTableWideErrors({
|
|
55574
|
+
entities,
|
|
55575
|
+
schema: schema2,
|
|
55576
|
+
newCellValidate,
|
|
55577
|
+
props: this.props
|
|
55578
|
+
});
|
|
55579
|
+
change("reduxFormCellValidation", tableWideErr);
|
|
55580
|
+
this.forceUpdate();
|
|
55474
55581
|
}, "updateValidation"));
|
|
55475
55582
|
__publicField(this, "handleDeleteCell", /* @__PURE__ */ __name(() => {
|
|
55476
55583
|
const {
|
|
@@ -55536,7 +55643,7 @@ const _DataTable = class _DataTable extends React$2.Component {
|
|
|
55536
55643
|
onFinishMsg: "Column Copied"
|
|
55537
55644
|
});
|
|
55538
55645
|
}, "handleCopyColumn"));
|
|
55539
|
-
__publicField(this, "handleCopyRows", /* @__PURE__ */ __name((rowElsToCopy, { specificColumn, onFinishMsg } = {}) => {
|
|
55646
|
+
__publicField(this, "handleCopyRows", /* @__PURE__ */ __name((rowElsToCopy, { specificColumn, onFinishMsg, isDownload } = {}) => {
|
|
55540
55647
|
let textToCopy = [];
|
|
55541
55648
|
const jsonToCopy = [];
|
|
55542
55649
|
lodashExports.forEach(rowElsToCopy, (rowEl) => {
|
|
@@ -55547,7 +55654,15 @@ const _DataTable = class _DataTable extends React$2.Component {
|
|
|
55547
55654
|
textToCopy = textToCopy.filter((text2) => text2).join("\n");
|
|
55548
55655
|
if (!textToCopy)
|
|
55549
55656
|
return window.toastr.warning("No text to copy");
|
|
55550
|
-
|
|
55657
|
+
if (isDownload) {
|
|
55658
|
+
downloadjs(textToCopy.replaceAll(" ", ","), "tableData.csv", "text/csv");
|
|
55659
|
+
} else {
|
|
55660
|
+
this.handleCopyHelper(
|
|
55661
|
+
textToCopy,
|
|
55662
|
+
jsonToCopy,
|
|
55663
|
+
onFinishMsg || "Row Copied"
|
|
55664
|
+
);
|
|
55665
|
+
}
|
|
55551
55666
|
}, "handleCopyRows"));
|
|
55552
55667
|
__publicField(this, "updateEntitiesHelper", /* @__PURE__ */ __name((ents, fn4) => {
|
|
55553
55668
|
const { change, reduxFormEntitiesUndoRedoStack = { currentVersion: 0 } } = this.props;
|
|
@@ -55600,14 +55715,14 @@ const _DataTable = class _DataTable extends React$2.Component {
|
|
|
55600
55715
|
window.toastr.success(message);
|
|
55601
55716
|
}
|
|
55602
55717
|
}, "handleCopyHelper"));
|
|
55603
|
-
__publicField(this, "handleCopyTable", /* @__PURE__ */ __name((e2) => {
|
|
55718
|
+
__publicField(this, "handleCopyTable", /* @__PURE__ */ __name((e2, opts2) => {
|
|
55604
55719
|
try {
|
|
55605
55720
|
const allRowEls = getAllRows(e2);
|
|
55606
55721
|
if (!allRowEls)
|
|
55607
55722
|
return;
|
|
55608
|
-
this.handleCopyRows(allRowEls, {
|
|
55723
|
+
this.handleCopyRows(allRowEls, __spreadProps(__spreadValues({}, opts2), {
|
|
55609
55724
|
onFinishMsg: "Table Copied"
|
|
55610
|
-
});
|
|
55725
|
+
}));
|
|
55611
55726
|
} catch (error) {
|
|
55612
55727
|
console.error(`error:`, error);
|
|
55613
55728
|
window.toastr.error("Error copying rows.");
|
|
@@ -55855,7 +55970,8 @@ const _DataTable = class _DataTable extends React$2.Component {
|
|
|
55855
55970
|
getRowClassName && getRowClassName(rowInfo, state2, this.props),
|
|
55856
55971
|
{
|
|
55857
55972
|
disabled: rowDisabled,
|
|
55858
|
-
selected: rowSelected && !withCheckboxes
|
|
55973
|
+
selected: rowSelected && !withCheckboxes,
|
|
55974
|
+
"rt-tr-last-row": rowInfo.index === entities.length - 1
|
|
55859
55975
|
}
|
|
55860
55976
|
),
|
|
55861
55977
|
"data-test-id": dataId === void 0 ? rowInfo.index : dataId,
|
|
@@ -55952,7 +56068,8 @@ const _DataTable = class _DataTable extends React$2.Component {
|
|
|
55952
56068
|
this.startCellEdit(cellId);
|
|
55953
56069
|
}
|
|
55954
56070
|
}, err2 && {
|
|
55955
|
-
"data-tip": (err2 == null ? void 0 : err2.message) || err2
|
|
56071
|
+
"data-tip": (err2 == null ? void 0 : err2.message) || err2,
|
|
56072
|
+
"data-no-child-data-tip": true
|
|
55956
56073
|
}), {
|
|
55957
56074
|
onContextMenu: (e2) => {
|
|
55958
56075
|
if (!isPrimarySelected) {
|
|
@@ -57258,6 +57375,7 @@ const _DataTable = class _DataTable extends React$2.Component {
|
|
|
57258
57375
|
);
|
|
57259
57376
|
}, "renderColumnHeader"));
|
|
57260
57377
|
if (this.props.helperProp) {
|
|
57378
|
+
this.props.helperProp.updateValidationHelper = this.updateValidationHelper;
|
|
57261
57379
|
this.props.helperProp.addEditableTableEntities = this.addEditableTableEntities;
|
|
57262
57380
|
this.props.helperProp.getEditableTableInfoAndThrowFormError = this.getEditableTableInfoAndThrowFormError;
|
|
57263
57381
|
}
|
|
@@ -57857,27 +57975,6 @@ const _DataTable = class _DataTable extends React$2.Component {
|
|
|
57857
57975
|
if (n2)
|
|
57858
57976
|
this.table = n2;
|
|
57859
57977
|
},
|
|
57860
|
-
additionalBodyEl: isCellEditable && !onlyShowRowsWErrors && /* @__PURE__ */ React$2.createElement(
|
|
57861
|
-
"div",
|
|
57862
|
-
{
|
|
57863
|
-
style: {
|
|
57864
|
-
width: "100%",
|
|
57865
|
-
display: "flex",
|
|
57866
|
-
justifyContent: "center"
|
|
57867
|
-
}
|
|
57868
|
-
},
|
|
57869
|
-
/* @__PURE__ */ React$2.createElement(
|
|
57870
|
-
core$5.Button,
|
|
57871
|
-
{
|
|
57872
|
-
icon: "add",
|
|
57873
|
-
onClick: () => {
|
|
57874
|
-
this.insertRows({ numRows: 10, appendToBottom: true });
|
|
57875
|
-
},
|
|
57876
|
-
minimal: true
|
|
57877
|
-
},
|
|
57878
|
-
"Add 10 Rows"
|
|
57879
|
-
)
|
|
57880
|
-
),
|
|
57881
57978
|
className: classNames({
|
|
57882
57979
|
isCellEditable,
|
|
57883
57980
|
"tg-table-loading": isLoading,
|
|
@@ -57919,6 +58016,37 @@ const _DataTable = class _DataTable extends React$2.Component {
|
|
|
57919
58016
|
SubComponent: SubComponentToUse
|
|
57920
58017
|
}, ReactTableProps)
|
|
57921
58018
|
),
|
|
58019
|
+
isCellEditable && /* @__PURE__ */ React$2.createElement("div", { style: { display: "flex" } }, /* @__PURE__ */ React$2.createElement(
|
|
58020
|
+
"div",
|
|
58021
|
+
{
|
|
58022
|
+
style: {
|
|
58023
|
+
width: "100%",
|
|
58024
|
+
display: "flex",
|
|
58025
|
+
justifyContent: "center"
|
|
58026
|
+
}
|
|
58027
|
+
},
|
|
58028
|
+
!onlyShowRowsWErrors && /* @__PURE__ */ React$2.createElement(
|
|
58029
|
+
core$5.Button,
|
|
58030
|
+
{
|
|
58031
|
+
icon: "add",
|
|
58032
|
+
onClick: () => {
|
|
58033
|
+
this.insertRows({ numRows: 10, appendToBottom: true });
|
|
58034
|
+
},
|
|
58035
|
+
minimal: true
|
|
58036
|
+
},
|
|
58037
|
+
"Add 10 Rows"
|
|
58038
|
+
)
|
|
58039
|
+
), /* @__PURE__ */ React$2.createElement(
|
|
58040
|
+
core$5.Button,
|
|
58041
|
+
{
|
|
58042
|
+
onClick: (e2) => {
|
|
58043
|
+
this.handleCopyTable(e2, { isDownload: true });
|
|
58044
|
+
},
|
|
58045
|
+
"data-tip": "Download Table as CSV",
|
|
58046
|
+
minimal: true,
|
|
58047
|
+
icon: "download"
|
|
58048
|
+
}
|
|
58049
|
+
)),
|
|
57922
58050
|
!noFooter && /* @__PURE__ */ React$2.createElement(
|
|
57923
58051
|
"div",
|
|
57924
58052
|
{
|
|
@@ -58526,6 +58654,7 @@ function MatchHeaders({
|
|
|
58526
58654
|
onMultiFileUploadSubmit,
|
|
58527
58655
|
doAllFilesHaveSameHeaders,
|
|
58528
58656
|
csvValidationIssue,
|
|
58657
|
+
ignoredHeadersMsg,
|
|
58529
58658
|
searchResults,
|
|
58530
58659
|
matchedHeaders,
|
|
58531
58660
|
userSchema,
|
|
@@ -58543,7 +58672,7 @@ function MatchHeaders({
|
|
|
58543
58672
|
if (v2)
|
|
58544
58673
|
flippedMatchedHeaders[v2] = k2;
|
|
58545
58674
|
});
|
|
58546
|
-
return /* @__PURE__ */ React$2.createElement("div", { style: { maxWidth: 500 } }, !onMultiFileUploadSubmit && /* @__PURE__ */ React$2.createElement(core$5.Callout, { style: { width: "fit-content" }, intent: "warning" }, csvValidationIssue), /* @__PURE__ */ React$2.createElement("br", null), /* @__PURE__ */ React$2.createElement(
|
|
58675
|
+
return /* @__PURE__ */ React$2.createElement("div", { style: { maxWidth: 500 } }, !onMultiFileUploadSubmit && /* @__PURE__ */ React$2.createElement(core$5.Callout, { style: { width: "fit-content" }, intent: "warning" }, csvValidationIssue), !onMultiFileUploadSubmit && ignoredHeadersMsg && /* @__PURE__ */ React$2.createElement(core$5.Callout, { style: { width: "fit-content" }, intent: "warning" }, ignoredHeadersMsg), /* @__PURE__ */ React$2.createElement("br", null), /* @__PURE__ */ React$2.createElement(
|
|
58547
58676
|
"tr",
|
|
58548
58677
|
{
|
|
58549
58678
|
style: {
|
|
@@ -58932,7 +59061,7 @@ const AdvancedOptions$1 = {
|
|
|
58932
59061
|
};
|
|
58933
59062
|
var Config = __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, BasicOptions), MatchOptions), FuzzyOptions), AdvancedOptions$1);
|
|
58934
59063
|
const SPACE = /[^ ]+/g;
|
|
58935
|
-
function norm(weight = 1, mantissa = 3) {
|
|
59064
|
+
function norm$1(weight = 1, mantissa = 3) {
|
|
58936
59065
|
const cache2 = /* @__PURE__ */ new Map();
|
|
58937
59066
|
const m2 = Math.pow(10, mantissa);
|
|
58938
59067
|
return {
|
|
@@ -58951,13 +59080,13 @@ function norm(weight = 1, mantissa = 3) {
|
|
|
58951
59080
|
}
|
|
58952
59081
|
};
|
|
58953
59082
|
}
|
|
58954
|
-
__name(norm, "norm");
|
|
59083
|
+
__name(norm$1, "norm$1");
|
|
58955
59084
|
const _FuseIndex = class _FuseIndex {
|
|
58956
59085
|
constructor({
|
|
58957
59086
|
getFn = Config.getFn,
|
|
58958
59087
|
fieldNormWeight = Config.fieldNormWeight
|
|
58959
59088
|
} = {}) {
|
|
58960
|
-
this.norm = norm(fieldNormWeight, 3);
|
|
59089
|
+
this.norm = norm$1(fieldNormWeight, 3);
|
|
58961
59090
|
this.getFn = getFn;
|
|
58962
59091
|
this.isCreated = false;
|
|
58963
59092
|
this.setIndexRecords();
|
|
@@ -60106,7 +60235,7 @@ function tryToMatchSchemas(_0) {
|
|
|
60106
60235
|
}) {
|
|
60107
60236
|
yield resolveValidateAgainstSchema();
|
|
60108
60237
|
const userSchema = getSchema(incomingData);
|
|
60109
|
-
const { searchResults, csvValidationIssue } = yield matchSchemas({
|
|
60238
|
+
const { searchResults, csvValidationIssue, ignoredHeadersMsg } = yield matchSchemas({
|
|
60110
60239
|
userSchema,
|
|
60111
60240
|
officialSchema: validateAgainstSchema
|
|
60112
60241
|
});
|
|
@@ -60142,6 +60271,7 @@ function tryToMatchSchemas(_0) {
|
|
|
60142
60271
|
}
|
|
60143
60272
|
});
|
|
60144
60273
|
return {
|
|
60274
|
+
ignoredHeadersMsg,
|
|
60145
60275
|
csvValidationIssue,
|
|
60146
60276
|
matchedHeaders,
|
|
60147
60277
|
userSchema,
|
|
@@ -60158,15 +60288,31 @@ function matchSchemas(_0) {
|
|
|
60158
60288
|
};
|
|
60159
60289
|
let csvValidationIssue = false;
|
|
60160
60290
|
const fuse = new Fuse(userSchema.fields, options);
|
|
60291
|
+
const matchedAltPaths = [];
|
|
60161
60292
|
officialSchema.fields.forEach((h2) => {
|
|
60162
60293
|
let hasMatch = false;
|
|
60163
60294
|
let result = fuse.search(h2.path) || [];
|
|
60295
|
+
const hadNormalPathMatch = userSchema.fields.some(
|
|
60296
|
+
(uh) => norm(uh.path) === norm(h2.path)
|
|
60297
|
+
);
|
|
60164
60298
|
userSchema.fields.forEach((uh, i) => {
|
|
60165
|
-
const pathMatch = uh.path
|
|
60166
|
-
const displayNameMatch = h2.displayName && uh.path
|
|
60167
|
-
const hasAlternatePathMatch = h2.alternatePathMatch && (lodashExports.isArray(h2.alternatePathMatch) ? h2.alternatePathMatch.
|
|
60168
|
-
|
|
60169
|
-
|
|
60299
|
+
const pathMatch = norm(uh.path) === norm(h2.path);
|
|
60300
|
+
const displayNameMatch = h2.displayName && norm(uh.path) === norm(getTextFromEl(h2.displayName));
|
|
60301
|
+
const hasAlternatePathMatch = !hadNormalPathMatch && h2.alternatePathMatch && (lodashExports.isArray(h2.alternatePathMatch) ? h2.alternatePathMatch : [h2.alternatePathMatch]).find((alternatePathMatch) => {
|
|
60302
|
+
let altPath = alternatePathMatch;
|
|
60303
|
+
if (lodashExports.isPlainObject(alternatePathMatch)) {
|
|
60304
|
+
altPath = alternatePathMatch.path;
|
|
60305
|
+
}
|
|
60306
|
+
return norm(uh.path) === norm(altPath);
|
|
60307
|
+
});
|
|
60308
|
+
if (hasAlternatePathMatch) {
|
|
60309
|
+
matchedAltPaths.push(
|
|
60310
|
+
hasAlternatePathMatch.path || hasAlternatePathMatch
|
|
60311
|
+
);
|
|
60312
|
+
if (hasAlternatePathMatch.format) {
|
|
60313
|
+
h2.format = hasAlternatePathMatch.format;
|
|
60314
|
+
}
|
|
60315
|
+
}
|
|
60170
60316
|
if (pathMatch || displayNameMatch || hasAlternatePathMatch) {
|
|
60171
60317
|
result = result.filter(({ path: path2 }) => path2 === uh.path);
|
|
60172
60318
|
result.unshift({
|
|
@@ -60186,6 +60332,16 @@ function matchSchemas(_0) {
|
|
|
60186
60332
|
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.";
|
|
60187
60333
|
}
|
|
60188
60334
|
});
|
|
60335
|
+
const ignoredUserSchemaFields = [];
|
|
60336
|
+
userSchema.fields.forEach((uh) => {
|
|
60337
|
+
if (!officialSchema.fields.find(
|
|
60338
|
+
(h2) => norm(h2.path) === norm(uh.path) || norm(h2.displayName) === norm(uh.path) || matchedAltPaths.includes(uh.path)
|
|
60339
|
+
)) {
|
|
60340
|
+
if (userSchema.userData.some((e2) => e2[uh.path])) {
|
|
60341
|
+
ignoredUserSchemaFields.push(uh);
|
|
60342
|
+
}
|
|
60343
|
+
}
|
|
60344
|
+
});
|
|
60189
60345
|
if (officialSchema.coerceUserSchema) {
|
|
60190
60346
|
officialSchema.coerceUserSchema({ userSchema, officialSchema });
|
|
60191
60347
|
}
|
|
@@ -60243,9 +60399,14 @@ function matchSchemas(_0) {
|
|
|
60243
60399
|
};
|
|
60244
60400
|
}
|
|
60245
60401
|
}
|
|
60402
|
+
let ignoredHeadersMsg;
|
|
60403
|
+
if (ignoredUserSchemaFields.length) {
|
|
60404
|
+
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(", ")}`;
|
|
60405
|
+
}
|
|
60246
60406
|
return {
|
|
60247
60407
|
searchResults: officialSchema.fields,
|
|
60248
|
-
csvValidationIssue
|
|
60408
|
+
csvValidationIssue,
|
|
60409
|
+
ignoredHeadersMsg
|
|
60249
60410
|
};
|
|
60250
60411
|
});
|
|
60251
60412
|
}
|
|
@@ -60264,6 +60425,10 @@ function resolveValidateAgainstSchema() {
|
|
|
60264
60425
|
});
|
|
60265
60426
|
}
|
|
60266
60427
|
__name(resolveValidateAgainstSchema, "resolveValidateAgainstSchema");
|
|
60428
|
+
function norm(h2) {
|
|
60429
|
+
return lodashExports.snakeCase(h2).toLowerCase().replace(/ /g, "");
|
|
60430
|
+
}
|
|
60431
|
+
__name(norm, "norm");
|
|
60267
60432
|
const getInitialSteps = /* @__PURE__ */ __name((csvValidationIssue) => [
|
|
60268
60433
|
{ text: "Review Headers", active: csvValidationIssue },
|
|
60269
60434
|
{ text: "Review Data", active: !csvValidationIssue }
|
|
@@ -60311,6 +60476,7 @@ const UploadCsvWizardDialog = compose(
|
|
|
60311
60476
|
doAllFilesHaveSameHeaders,
|
|
60312
60477
|
destroyForms,
|
|
60313
60478
|
csvValidationIssue,
|
|
60479
|
+
ignoredHeadersMsg,
|
|
60314
60480
|
searchResults,
|
|
60315
60481
|
matchedHeaders,
|
|
60316
60482
|
userSchema,
|
|
@@ -60422,6 +60588,7 @@ const UploadCsvWizardDialog = compose(
|
|
|
60422
60588
|
destroyForms,
|
|
60423
60589
|
setFilesWIssues,
|
|
60424
60590
|
csvValidationIssue,
|
|
60591
|
+
ignoredHeadersMsg,
|
|
60425
60592
|
searchResults,
|
|
60426
60593
|
matchedHeaders,
|
|
60427
60594
|
userSchema,
|
|
@@ -60457,6 +60624,7 @@ const UploadCsvWizardDialog = compose(
|
|
|
60457
60624
|
reduxFormEntitiesArray,
|
|
60458
60625
|
// onMultiFileUploadSubmit,
|
|
60459
60626
|
csvValidationIssue,
|
|
60627
|
+
ignoredHeadersMsg,
|
|
60460
60628
|
searchResults,
|
|
60461
60629
|
matchedHeaders,
|
|
60462
60630
|
userSchema,
|
|
@@ -60499,6 +60667,7 @@ const UploadCsvWizardDialog = compose(
|
|
|
60499
60667
|
searchResults,
|
|
60500
60668
|
onUploadWizardFinish,
|
|
60501
60669
|
csvValidationIssue,
|
|
60670
|
+
ignoredHeadersMsg,
|
|
60502
60671
|
matchedHeaders,
|
|
60503
60672
|
//fromRedux:
|
|
60504
60673
|
changeForm,
|
|
@@ -60528,6 +60697,7 @@ const UploadCsvWizardDialogInner = compose(
|
|
|
60528
60697
|
searchResults,
|
|
60529
60698
|
onUploadWizardFinish,
|
|
60530
60699
|
csvValidationIssue,
|
|
60700
|
+
ignoredHeadersMsg,
|
|
60531
60701
|
matchedHeaders,
|
|
60532
60702
|
//fromRedux:
|
|
60533
60703
|
handleSubmit,
|
|
@@ -60565,6 +60735,7 @@ const UploadCsvWizardDialogInner = compose(
|
|
|
60565
60735
|
__spreadValues({}, {
|
|
60566
60736
|
onMultiFileUploadSubmit,
|
|
60567
60737
|
csvValidationIssue,
|
|
60738
|
+
ignoredHeadersMsg,
|
|
60568
60739
|
searchResults,
|
|
60569
60740
|
matchedHeaders,
|
|
60570
60741
|
userSchema,
|
|
@@ -68737,7 +68908,7 @@ const isZipFile = /* @__PURE__ */ __name((file) => {
|
|
|
68737
68908
|
}, "isZipFile");
|
|
68738
68909
|
const getExt = /* @__PURE__ */ __name((file) => {
|
|
68739
68910
|
var _a2;
|
|
68740
|
-
return (_a2 = file == null ? void 0 : file.name) == null ? void 0 : _a2.split(".").pop();
|
|
68911
|
+
return (_a2 = (file == null ? void 0 : file.name) || (file == null ? void 0 : file.originalname)) == null ? void 0 : _a2.split(".").pop();
|
|
68741
68912
|
}, "getExt");
|
|
68742
68913
|
const isExcelFile = /* @__PURE__ */ __name((file) => getExt(file) === "xlsx", "isExcelFile");
|
|
68743
68914
|
const isCsvFile = /* @__PURE__ */ __name((file) => getExt(file) === "csv", "isCsvFile");
|
|
@@ -68825,7 +68996,9 @@ const parseCsvFile = /* @__PURE__ */ __name((csvFile, parserOptions = {}) => {
|
|
|
68825
68996
|
const opts2 = __spreadProps(__spreadValues(__spreadValues({}, defaultCsvParserOptions), setupCsvParserOptions(parserOptions)), {
|
|
68826
68997
|
complete: (results) => {
|
|
68827
68998
|
var _a2;
|
|
68828
|
-
if (results && ((_a2 = results.data) == null ? void 0 : _a2.length) && results.errors && results.errors.length === 1 && results.errors[0].code === `UndetectableDelimiter`
|
|
68999
|
+
if (results && ((_a2 = results.data) == null ? void 0 : _a2.length) && results.errors && (results.errors.length === 1 && results.errors[0].code === `UndetectableDelimiter` || results.errors.every(
|
|
69000
|
+
(e2) => e2.code === `TooFewFields` || e2.code === `TooManyFields`
|
|
69001
|
+
))) {
|
|
68829
69002
|
return resolve(results);
|
|
68830
69003
|
} else if (results && results.errors && results.errors.length) {
|
|
68831
69004
|
return reject("Error in csv: " + JSON.stringify(results.errors));
|
|
@@ -70375,7 +70548,7 @@ __name(_ValidateAgainstSchema, "ValidateAgainstSchema");
|
|
|
70375
70548
|
let ValidateAgainstSchema = _ValidateAgainstSchema;
|
|
70376
70549
|
const emptyPromise = Promise.resolve.bind(Promise);
|
|
70377
70550
|
function UploaderInner({
|
|
70378
|
-
accept:
|
|
70551
|
+
accept: __accept,
|
|
70379
70552
|
contentOverride: maybeContentOverride,
|
|
70380
70553
|
innerIcon,
|
|
70381
70554
|
innerText,
|
|
@@ -70405,20 +70578,37 @@ function UploaderInner({
|
|
|
70405
70578
|
dropzoneProps = {},
|
|
70406
70579
|
overflowList,
|
|
70407
70580
|
autoUnzip,
|
|
70408
|
-
disabled,
|
|
70581
|
+
disabled: _disabled,
|
|
70409
70582
|
noBuildCsvOption,
|
|
70410
70583
|
initializeForm,
|
|
70411
70584
|
showFilesCount,
|
|
70412
70585
|
threeDotMenuItems,
|
|
70413
70586
|
onPreviewClick
|
|
70414
70587
|
}) {
|
|
70415
|
-
var _a2, _b2, _c, _d
|
|
70588
|
+
var _a2, _b2, _c, _d;
|
|
70589
|
+
let dropzoneDisabled = _disabled;
|
|
70590
|
+
let _accept = __accept;
|
|
70416
70591
|
const validateAgainstSchemaStore = React$2.useRef(new ValidateAgainstSchema());
|
|
70417
|
-
const
|
|
70418
|
-
|
|
70419
|
-
|
|
70420
|
-
|
|
70421
|
-
)) == null ? void 0 :
|
|
70592
|
+
const [resolvedAccept, setResolvedAccept] = React$2.useState();
|
|
70593
|
+
if (resolvedAccept) {
|
|
70594
|
+
_accept = resolvedAccept;
|
|
70595
|
+
}
|
|
70596
|
+
const isAcceptPromise = (__accept == null ? void 0 : __accept.then) || (Array.isArray(__accept) ? __accept.some((a2) => a2 == null ? void 0 : a2.then) : false);
|
|
70597
|
+
const acceptLoading = !resolvedAccept && isAcceptPromise && `Accept Loading...`;
|
|
70598
|
+
if (isAcceptPromise && !resolvedAccept) {
|
|
70599
|
+
Promise.allSettled(Array.isArray(__accept) ? __accept : [__accept]).then(
|
|
70600
|
+
(results) => {
|
|
70601
|
+
const resolved = lodashExports.flatMap(results, (r2) => r2.value);
|
|
70602
|
+
setResolvedAccept(resolved);
|
|
70603
|
+
}
|
|
70604
|
+
);
|
|
70605
|
+
_accept = [];
|
|
70606
|
+
}
|
|
70607
|
+
if (acceptLoading)
|
|
70608
|
+
dropzoneDisabled = true;
|
|
70609
|
+
const accept = !_accept ? void 0 : isAcceptPromise && !resolvedAccept ? [] : lodashExports.isPlainObject(_accept) ? [_accept] : lodashExports.isArray(_accept) ? _accept : _accept.split(",").map((a2) => ({ type: a2 }));
|
|
70610
|
+
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);
|
|
70611
|
+
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);
|
|
70422
70612
|
React$2.useEffect(() => {
|
|
70423
70613
|
validateAgainstSchemaStore.current.setValidateAgainstSchema(
|
|
70424
70614
|
validateAgainstSchemaToUse
|
|
@@ -70428,7 +70618,6 @@ function UploaderInner({
|
|
|
70428
70618
|
if (validateAgainstSchemaToUse) {
|
|
70429
70619
|
validateAgainstSchema = validateAgainstSchemaStore.current;
|
|
70430
70620
|
}
|
|
70431
|
-
const accept = !_accept ? void 0 : lodashExports.isPlainObject(_accept) ? [_accept] : lodashExports.isArray(_accept) ? _accept : _accept.split(",").map((a2) => ({ type: a2 }));
|
|
70432
70621
|
if ((validateAgainstSchema || autoUnzip) && accept && !accept.some((a2) => a2.type === "zip")) {
|
|
70433
70622
|
accept == null ? void 0 : accept.unshift({
|
|
70434
70623
|
type: "zip",
|
|
@@ -70693,14 +70882,14 @@ function UploaderInner({
|
|
|
70693
70882
|
className: "tg-uploader-inner",
|
|
70694
70883
|
style: { width: "100%", height: "fit-content", minWidth: 0 }
|
|
70695
70884
|
},
|
|
70696
|
-
simpleAccept && /* @__PURE__ */ React$2.createElement(
|
|
70885
|
+
(simpleAccept || acceptLoading) && /* @__PURE__ */ React$2.createElement(
|
|
70697
70886
|
"div",
|
|
70698
70887
|
{
|
|
70699
70888
|
className: core$5.Classes.TEXT_MUTED,
|
|
70700
70889
|
style: { fontSize: 11, marginBottom: 5 }
|
|
70701
70890
|
},
|
|
70702
70891
|
advancedAccept ? /* @__PURE__ */ React$2.createElement("div", { style: {} }, "Accepts ", /* @__PURE__ */ React$2.createElement("span", { style: {} }, advancedAccept.map((a2, i) => {
|
|
70703
|
-
const
|
|
70892
|
+
const disabled = !(a2.description || a2.exampleFile || a2.exampleFiles);
|
|
70704
70893
|
const PopOrTooltip = a2.exampleFiles ? core$5.Popover : core$5.Tooltip;
|
|
70705
70894
|
const hasDownload = a2.exampleFile || a2.exampleFiles;
|
|
70706
70895
|
const CustomTag = !hasDownload ? "span" : "a";
|
|
@@ -70709,7 +70898,7 @@ function UploaderInner({
|
|
|
70709
70898
|
{
|
|
70710
70899
|
key: i,
|
|
70711
70900
|
interactionKind: "hover",
|
|
70712
|
-
disabled
|
|
70901
|
+
disabled,
|
|
70713
70902
|
modifiers: popoverOverflowModifiers,
|
|
70714
70903
|
content: a2.exampleFiles ? /* @__PURE__ */ React$2.createElement(core$5.Menu, null, a2.exampleFiles.map(
|
|
70715
70904
|
({ description: description2, subtext, exampleFile, icon }, i2) => {
|
|
@@ -70787,12 +70976,15 @@ function UploaderInner({
|
|
|
70787
70976
|
)
|
|
70788
70977
|
)
|
|
70789
70978
|
);
|
|
70790
|
-
}))) :
|
|
70979
|
+
}))) : acceptLoading ? (
|
|
70980
|
+
// make the dots below "load"
|
|
70981
|
+
/* @__PURE__ */ React$2.createElement(React$2.Fragment, null, "Accept Loading", /* @__PURE__ */ React$2.createElement(LoadingDots, null))
|
|
70982
|
+
) : /* @__PURE__ */ React$2.createElement(React$2.Fragment, null, "Accepts ", simpleAccept)
|
|
70791
70983
|
),
|
|
70792
70984
|
/* @__PURE__ */ React$2.createElement(
|
|
70793
70985
|
Dropzone$1,
|
|
70794
70986
|
__spreadValues(__spreadValues({
|
|
70795
|
-
disabled,
|
|
70987
|
+
disabled: dropzoneDisabled,
|
|
70796
70988
|
onClick: (evt) => evt.preventDefault(),
|
|
70797
70989
|
multiple: fileLimit !== 1,
|
|
70798
70990
|
accept: simpleAccept ? simpleAccept.split(", ").map((a2) => a2.startsWith(".") ? a2 : "." + a2).join(", ") : void 0
|
|
@@ -70875,7 +71067,13 @@ function UploaderInner({
|
|
|
70875
71067
|
if (isCsvOrExcelFile(file)) {
|
|
70876
71068
|
let parsedF;
|
|
70877
71069
|
try {
|
|
70878
|
-
parsedF = yield parseCsvOrExcelFile(file
|
|
71070
|
+
parsedF = yield parseCsvOrExcelFile(file, {
|
|
71071
|
+
csvParserOptions: lodashExports.isFunction(
|
|
71072
|
+
validateAgainstSchema.csvParserOptions
|
|
71073
|
+
) ? validateAgainstSchema.csvParserOptions({
|
|
71074
|
+
validateAgainstSchema
|
|
71075
|
+
}) : validateAgainstSchema.csvParserOptions
|
|
71076
|
+
});
|
|
70879
71077
|
} catch (error) {
|
|
70880
71078
|
console.error("error:", error);
|
|
70881
71079
|
window.toastr && window.toastr.error(
|
|
@@ -70887,7 +71085,8 @@ function UploaderInner({
|
|
|
70887
71085
|
csvValidationIssue: _csvValidationIssue,
|
|
70888
71086
|
matchedHeaders,
|
|
70889
71087
|
userSchema,
|
|
70890
|
-
searchResults
|
|
71088
|
+
searchResults,
|
|
71089
|
+
ignoredHeadersMsg
|
|
70891
71090
|
} = yield tryToMatchSchemas({
|
|
70892
71091
|
incomingData: parsedF.data,
|
|
70893
71092
|
validateAgainstSchema
|
|
@@ -70930,6 +71129,7 @@ function UploaderInner({
|
|
|
70930
71129
|
filesWIssues.push({
|
|
70931
71130
|
file,
|
|
70932
71131
|
csvValidationIssue,
|
|
71132
|
+
ignoredHeadersMsg,
|
|
70933
71133
|
matchedHeaders,
|
|
70934
71134
|
userSchema,
|
|
70935
71135
|
searchResults
|
|
@@ -70938,6 +71138,7 @@ function UploaderInner({
|
|
|
70938
71138
|
filesWOIssues.push({
|
|
70939
71139
|
file,
|
|
70940
71140
|
csvValidationIssue,
|
|
71141
|
+
ignoredHeadersMsg,
|
|
70941
71142
|
matchedHeaders,
|
|
70942
71143
|
userSchema,
|
|
70943
71144
|
searchResults
|
|
@@ -71037,7 +71238,8 @@ function UploaderInner({
|
|
|
71037
71238
|
"tg-dropzone-reject": isDragReject,
|
|
71038
71239
|
// 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
|
|
71039
71240
|
"tg-dropzone-accept": isDragAccept,
|
|
71040
|
-
"tg-dropzone-disabled":
|
|
71241
|
+
"tg-dropzone-disabled": dropzoneDisabled,
|
|
71242
|
+
"bp3-disabled": dropzoneDisabled
|
|
71041
71243
|
})
|
|
71042
71244
|
}),
|
|
71043
71245
|
/* @__PURE__ */ React$2.createElement("input", __spreadValues({}, getInputProps())),
|
|
@@ -82911,7 +83113,7 @@ const modifiableTypes = [
|
|
|
82911
83113
|
let allWarnings = [];
|
|
82912
83114
|
let makeToast = /* @__PURE__ */ __name(() => {
|
|
82913
83115
|
if (typeof window !== "undefined" && window.toastr && allWarnings.length) {
|
|
82914
|
-
window.toastr.warning(allWarnings.join("\n"));
|
|
83116
|
+
window.toastr.warning(lodashExports.uniq(allWarnings).join("\n"));
|
|
82915
83117
|
}
|
|
82916
83118
|
allWarnings = [];
|
|
82917
83119
|
}, "makeToast");
|
|
@@ -91812,6 +92014,8 @@ function convertAmbiguousStringToRegex(string2, isProtein2) {
|
|
|
91812
92014
|
}
|
|
91813
92015
|
__name(convertAmbiguousStringToRegex, "convertAmbiguousStringToRegex");
|
|
91814
92016
|
function getComplementSequenceString(sequence2, isRna2) {
|
|
92017
|
+
if (typeof sequence2 !== "string")
|
|
92018
|
+
return "";
|
|
91815
92019
|
let complementSeqString = "";
|
|
91816
92020
|
const complementMap = lodashExports.merge(
|
|
91817
92021
|
DNAComplementMap,
|
|
@@ -120649,6 +120853,7 @@ const Axis$1 = /* @__PURE__ */ __name(function(props) {
|
|
|
120649
120853
|
{
|
|
120650
120854
|
className: "veRowViewAxis veAxis",
|
|
120651
120855
|
height: annotationHeight,
|
|
120856
|
+
width,
|
|
120652
120857
|
style: __spreadValues({ marginTop, overflow: "visible", display: "block" }, style2)
|
|
120653
120858
|
},
|
|
120654
120859
|
tickMarkSVG,
|
|
@@ -123694,10 +123899,10 @@ function RowItem(props) {
|
|
|
123694
123899
|
height: height2
|
|
123695
123900
|
} = annotationVisibility2;
|
|
123696
123901
|
const { sequence: sequence2 = "", cutsites = [] } = row;
|
|
123697
|
-
const reverseSequence = getComplementSequenceString(
|
|
123902
|
+
const reverseSequence = showReverseSequence ? getComplementSequenceString(
|
|
123698
123903
|
alignmentData && alignmentData.sequence || sequence2,
|
|
123699
123904
|
isRna2
|
|
123700
|
-
);
|
|
123905
|
+
) : "";
|
|
123701
123906
|
const getGaps = React$2.useMemo(() => {
|
|
123702
123907
|
if (alignmentData) {
|
|
123703
123908
|
const gapMap = getGapMap$1(alignmentData.sequence);
|
|
@@ -124791,7 +124996,7 @@ function showFileDialog({ multiple = false, onSelect }) {
|
|
|
124791
124996
|
}
|
|
124792
124997
|
__name(showFileDialog, "showFileDialog");
|
|
124793
124998
|
const name = "@teselagen/ove";
|
|
124794
|
-
const version = "0.4.
|
|
124999
|
+
const version = "0.4.1";
|
|
124795
125000
|
const main = "./src/index.js";
|
|
124796
125001
|
const exports$1 = {
|
|
124797
125002
|
".": {
|
|
@@ -125793,8 +125998,10 @@ Object.keys(defaultCopyOptions).forEach((type) => {
|
|
|
125793
125998
|
const readOnlyDisabledTooltip = "Sorry this function is not allowed in Read-Only Mode";
|
|
125794
125999
|
const bpEditingDisabledTooltip = "Sequence Editing Disabled";
|
|
125795
126000
|
const noSelection = /* @__PURE__ */ __name(({ selectionLayer: selectionLayer2 = {} }) => !(selectionLayer2.start > -1 && selectionLayer2.end > -1) && "Selection Required", "noSelection");
|
|
125796
|
-
const triggerClipboardCommand = /* @__PURE__ */ __name((type) => {
|
|
125797
|
-
const wrapper2 = document.querySelector(
|
|
126001
|
+
const triggerClipboardCommand = /* @__PURE__ */ __name((type, props) => {
|
|
126002
|
+
const wrapper2 = document.querySelector(
|
|
126003
|
+
`#${props.editorName} .veVectorInteractionWrapper`
|
|
126004
|
+
);
|
|
125798
126005
|
if (!wrapper2) {
|
|
125799
126006
|
return window.toastr.info(`Cannot trigger a ${type} in the current view`);
|
|
125800
126007
|
}
|
|
@@ -125825,8 +126032,8 @@ const editCommandDefs = __spreadValues(__spreadProps(__spreadValues({
|
|
|
125825
126032
|
cut: {
|
|
125826
126033
|
isDisabled: (props) => props.disableBpEditing && bpEditingDisabledTooltip || props.readOnly && readOnlyDisabledTooltip || props.sequenceLength === 0,
|
|
125827
126034
|
isHidden: (props) => props.readOnly || props.disableBpEditing,
|
|
125828
|
-
handler: () => {
|
|
125829
|
-
triggerClipboardCommand("cut");
|
|
126035
|
+
handler: (props) => {
|
|
126036
|
+
triggerClipboardCommand("cut", props);
|
|
125830
126037
|
},
|
|
125831
126038
|
hotkey: "mod+x"
|
|
125832
126039
|
},
|
|
@@ -125844,13 +126051,13 @@ const editCommandDefs = __spreadValues(__spreadProps(__spreadValues({
|
|
|
125844
126051
|
},
|
|
125845
126052
|
copy: {
|
|
125846
126053
|
isDisabled: (props) => props.sequenceLength === 0,
|
|
125847
|
-
handler: () => triggerClipboardCommand("copy"),
|
|
126054
|
+
handler: (props) => triggerClipboardCommand("copy", props),
|
|
125848
126055
|
hotkey: "mod+c"
|
|
125849
126056
|
},
|
|
125850
126057
|
paste: {
|
|
125851
126058
|
isDisabled: (props) => props.readOnly && readOnlyDisabledTooltip,
|
|
125852
126059
|
isHidden: (props) => props.readOnly || props.disableBpEditing,
|
|
125853
|
-
handler: () => triggerClipboardCommand("paste"),
|
|
126060
|
+
handler: (props) => triggerClipboardCommand("paste", props),
|
|
125854
126061
|
hotkey: "mod+v"
|
|
125855
126062
|
},
|
|
125856
126063
|
undo: {
|
|
@@ -130088,7 +130295,7 @@ function VectorInteractionHOC(Component) {
|
|
|
130088
130295
|
...getEditDeleteHandlers("Feature", annotation),
|
|
130089
130296
|
...this.getSelectionMenuOptions(annotation),
|
|
130090
130297
|
...readOnly2 ? [] : [
|
|
130091
|
-
...parts2
|
|
130298
|
+
...parts2 ? [
|
|
130092
130299
|
"--",
|
|
130093
130300
|
{
|
|
130094
130301
|
text: "Make a Part from Feature",
|
|
@@ -130117,7 +130324,7 @@ function VectorInteractionHOC(Component) {
|
|
|
130117
130324
|
});
|
|
130118
130325
|
})
|
|
130119
130326
|
}
|
|
130120
|
-
],
|
|
130327
|
+
] : [],
|
|
130121
130328
|
{
|
|
130122
130329
|
text: "Merge With Another Feature",
|
|
130123
130330
|
onClick: () => {
|
|
@@ -132299,6 +132506,11 @@ const __LinearView = class __LinearView extends React$2.Component {
|
|
|
132299
132506
|
updateLabelsForInViewFeatures();
|
|
132300
132507
|
}
|
|
132301
132508
|
};
|
|
132509
|
+
const tickSpacingToUse = tickSpacing || (isLinViewZoomed ? massageTickSpacing(Math.ceil(120 / this.charWidth)) : massageTickSpacing(
|
|
132510
|
+
Math.floor(
|
|
132511
|
+
this.getMaxLength() / (sequenceData2.isProtein ? 9 : 10) * Math.max(1, Math.log10(1 / this.charWidth))
|
|
132512
|
+
)
|
|
132513
|
+
));
|
|
132302
132514
|
return /* @__PURE__ */ React$2.createElement(
|
|
132303
132515
|
ReactDraggable,
|
|
132304
132516
|
{
|
|
@@ -132400,9 +132612,7 @@ const __LinearView = class __LinearView extends React$2.Component {
|
|
|
132400
132612
|
bpsPerRow,
|
|
132401
132613
|
fullSequence: sequenceData2.sequence,
|
|
132402
132614
|
emptyText: getEmptyText({ sequenceData: sequenceData2, caretPosition: caretPosition2 }),
|
|
132403
|
-
tickSpacing:
|
|
132404
|
-
this.getMaxLength() / (sequenceData2.isProtein ? 9 : 10)
|
|
132405
|
-
)),
|
|
132615
|
+
tickSpacing: tickSpacingToUse,
|
|
132406
132616
|
annotationVisibility: __spreadValues(__spreadValues(__spreadValues({}, rest.annotationVisibility), (!isLinViewZoomed || this.charWidth < 5) && {
|
|
132407
132617
|
translations: false,
|
|
132408
132618
|
primaryProteinSequence: false,
|
|
@@ -132687,7 +132897,6 @@ const _Minimap = class _Minimap extends React$2.Component {
|
|
|
132687
132897
|
display: "flex",
|
|
132688
132898
|
flexDirection: "column",
|
|
132689
132899
|
overflowX: "visible"
|
|
132690
|
-
// overflowY: "hidden"
|
|
132691
132900
|
},
|
|
132692
132901
|
onClick: this.handleMinimapClick
|
|
132693
132902
|
},
|
|
@@ -132701,9 +132910,7 @@ const _Minimap = class _Minimap extends React$2.Component {
|
|
|
132701
132910
|
}
|
|
132702
132911
|
},
|
|
132703
132912
|
style: {
|
|
132704
|
-
// maxHeight: 350,
|
|
132705
132913
|
overflowY: minimapTracksPartialHeight > 190 ? "auto" : "hidden",
|
|
132706
|
-
// overflowY: "auto",
|
|
132707
132914
|
overflowX: "hidden",
|
|
132708
132915
|
position: "relative"
|
|
132709
132916
|
},
|
|
@@ -132734,7 +132941,6 @@ const _Minimap = class _Minimap extends React$2.Component {
|
|
|
132734
132941
|
{
|
|
132735
132942
|
style: {
|
|
132736
132943
|
marginTop: -3
|
|
132737
|
-
// paddingLeft: nameDivWidth
|
|
132738
132944
|
},
|
|
132739
132945
|
ref
|
|
132740
132946
|
},
|
|
@@ -132750,15 +132956,15 @@ const _Minimap = class _Minimap extends React$2.Component {
|
|
|
132750
132956
|
/* @__PURE__ */ React$2.createElement(
|
|
132751
132957
|
Axis$2,
|
|
132752
132958
|
__spreadValues({}, {
|
|
132753
|
-
row: { start: 0, end: seqLength },
|
|
132959
|
+
row: { start: 0, end: seqLength - 1 },
|
|
132754
132960
|
tickSpacing: massageTickSpacing(Math.floor(seqLength / 10)),
|
|
132755
132961
|
bpsPerRow: seqLength,
|
|
132756
132962
|
charWidth: charWidth2,
|
|
132757
132963
|
annotationHeight: 15,
|
|
132758
132964
|
sequenceLength: seqLength,
|
|
132759
132965
|
style: {
|
|
132760
|
-
|
|
132761
|
-
|
|
132966
|
+
height: 17,
|
|
132967
|
+
width: "100%"
|
|
132762
132968
|
}
|
|
132763
132969
|
})
|
|
132764
132970
|
)
|