@teselagen/ove 0.7.28 → 0.7.30-beta.1
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/CreateAnnotationsPage.d.ts +4 -3
- package/README.md +1 -1
- package/fileUtils.d.ts +12 -0
- package/html2canvas.esm--JN4fLQL.js +7891 -0
- package/html2canvas.esm-B7d7VJmQ.cjs +7891 -0
- package/index.cjs.js +1305 -1121
- package/index.es.js +1305 -1121
- package/index.umd.js +189161 -0
- package/ove.css +17 -4
- package/package.json +5 -9
- package/redux/findTool.d.ts +1 -0
- package/selectors/searchLayersSelector.d.ts +1 -1
- package/src/AutoAnnotate.js +1 -1
- package/src/CreateAnnotationsPage.js +1 -2
- package/src/Editor/style.css +8 -3
- package/src/FindBar/index.js +32 -1
- package/src/RowItem/SelectionLayer/index.js +42 -4
- package/src/RowItem/SelectionLayer/style.css +8 -0
- package/src/fileUtils.js +103 -0
- package/src/helperComponents/PropertiesDialog/TranslationProperties.js +1 -1
- package/src/redux/findTool.js +9 -0
- package/src/selectors/searchLayersSelector.js +40 -2
- package/style.css +12098 -1
- package/AASliver.js +0 -187
- package/AddLaddersDialog.js +0 -82
- package/AdditionalCutsiteInfoDialog.js +0 -599
- package/AlignmentVisibilityTool.js +0 -105
- package/AnnotationContainerHolder.js +0 -20
- package/AnnotationPositioner.js +0 -27
- package/AutoAnnotate.js +0 -501
- package/AutoAnnotateBpMatchingDialog.js +0 -208
- package/Axis.js +0 -151
- package/AxisNumbers.js +0 -35
- package/Browser.js +0 -106
- package/Caret.js +0 -63
- package/Chromatogram.js +0 -293
- package/CircularDnaSequence.js +0 -73
- package/CircularZoomMinimap.js +0 -16
- package/ColorPicker.js +0 -30
- package/CommandHotkeyHandler.js +0 -44
- package/CreateAnnotationsPage.js +0 -98
- package/Cutsite.js +0 -18
- package/CutsiteProperties.js +0 -176
- package/CutsiteSelectionLayers.js +0 -47
- package/Cutsites.js +0 -271
- package/DeletionLayer.js +0 -28
- package/DropHandler.css +0 -21
- package/DropHandler.js +0 -64
- package/EditCaretPosition.js +0 -234
- package/EditTrackNameDialog.js +0 -30
- package/Feature.js +0 -83
- package/FeatureProperties.js +0 -6
- package/FillWindow.js +0 -47
- package/GenbankView.js +0 -74
- package/GeneralProperties.js +0 -117
- package/GenericAnnotationProperties.js +0 -406
- package/GlobalDialog.js +0 -73
- package/GlobalDialogUtils.js +0 -110
- package/GoToDialog.js +0 -25
- package/HorizontalPanelDragHandle.js +0 -35
- package/Keyboard.js +0 -85
- package/Labels.js +0 -327
- package/Ladder.css +0 -20
- package/Ladder.js +0 -303
- package/MeltingTemp.js +0 -85
- package/Menlo.ttf +0 -0
- package/Minimap.js +0 -515
- package/Mismatches.js +0 -134
- package/Monaco.ttf +0 -0
- package/MultipleSeqsDetectedOnImportDialog.js +0 -74
- package/Orf.js +0 -109
- package/OrfProperties.js +0 -117
- package/Orfs.js +0 -35
- package/PCRTool.js +0 -179
- package/PairwiseAlignmentView.js +0 -68
- package/Part.js +0 -34
- package/PartProperties.js +0 -9
- package/PassThrough.js +0 -3
- package/PerformantSelectionLayer.js +0 -32
- package/PinchHelper.js +0 -24
- package/PointedAnnotation.js +0 -347
- package/PositionAnnotationOnCircle.js +0 -26
- package/Primer.js +0 -41
- package/PrimerProperties.js +0 -19
- package/ReflexContainer.js +0 -802
- package/ReflexElement.js +0 -160
- package/ReflexEvents.js +0 -77
- package/ReflexSplitter.js +0 -205
- package/RenameSequenceDialog.js +0 -7
- package/RotateCircularViewSlider.js +0 -93
- package/SelectDialog.js +0 -150
- package/SequenceName.js +0 -15
- package/SimpleCircularOrLinearView.js +0 -381
- package/SimpleOligoPreview.js +0 -39
- package/SingleEnzymeCutsiteInfo.js +0 -139
- package/ToolbarItem.js +0 -192
- package/Translation.js +0 -198
- package/TranslationProperties.js +0 -149
- package/UncontrolledSliderWithPlusMinusBtns.css +0 -5
- package/UncontrolledSliderWithPlusMinusBtns.js +0 -134
- package/VeTopRightContainer.js +0 -12
- package/ZoomCircularViewSlider.js +0 -62
- package/ZoomLinearView.js +0 -47
- package/addAlignment.js +0 -6
- package/addMetaToActionCreators.js +0 -12
- package/addWrappedAddons.js +0 -20
- package/alignmentTool.js +0 -503
- package/alignments.js +0 -379
- package/annotationLabelVisibility.js +0 -2
- package/annotationSearchSelector.js +0 -24
- package/annotationTypes.js +0 -35
- package/annotationVisibility.js +0 -196
- package/annotationsToSupport.js +0 -104
- package/arrayToObjWithIds.js +0 -17
- package/arrayUtils.js +0 -19
- package/array_move.js +0 -10
- package/calculateTickMarkPositionsForGivenRange.js +0 -47
- package/caretPosition.js +0 -27
- package/cdsFeaturesSelector.js +0 -9
- package/charWidth.js +0 -22
- package/circular.js +0 -19
- package/circularSelector.js +0 -4
- package/clickAndDragUtils.js +0 -576
- package/coerceInitialValue.js +0 -7
- package/combineReducersDontIgnoreKeys.js +0 -12
- package/commandUtils.js +0 -20
- package/constants.js +0 -2
- package/copyOptions.js +0 -34
- package/createFragmentLines.js +0 -120
- package/createMergedDefaultStateReducer.js +0 -30
- package/createMetaAction.js +0 -12
- package/createSequenceInputPopup.js +0 -290
- package/createSequenceInputPopupStyle.css +0 -87
- package/createSimpleDialog.js +0 -89
- package/createYourOwnEnzyme.js +0 -39
- package/cutsiteLabelColorSelector.js +0 -6
- package/cutsiteTool.js +0 -88
- package/cutsitesByRangeSelector.js +0 -5
- package/cutsitesSelector.js +0 -61
- package/darkmode.css +0 -98
- package/defaultConfig.js +0 -150
- package/deletionLayers.js +0 -36
- package/description.js +0 -21
- package/digestTool.js +0 -34
- package/dnaToColor.js +0 -17
- package/downloadTool.js +0 -39
- package/draggableClassnames.js +0 -5
- package/drawAnnotations.js +0 -440
- package/drawDirectedPiePiece.js +0 -142
- package/editTool.js +0 -49
- package/editorSelector.js +0 -2
- package/editorUtils.js +0 -205
- package/estimateRowHeight.js +0 -184
- package/featureLengthsToHide.js +0 -27
- package/featureTool.js +0 -34
- package/features.js +0 -19
- package/featuresSelector.js +0 -8
- package/filteredCutsitesSelector.js +0 -136
- package/filteredFeaturesSelector.js +0 -32
- package/filteredPartsSelector.js +0 -57
- package/filteredPrimersSelector.js +0 -27
- package/filteredRestrictionEnzymesSelector.js +0 -1
- package/find.png +0 -0
- package/findTool.js +0 -79
- package/findToolConstants.js +0 -1
- package/frameTranslations.js +0 -52
- package/fullscreen.png +0 -0
- package/getAdditionalEnzymesSelector.js +0 -46
- package/getAngleForPositionMidpoint.js +0 -3
- package/getAnnotationClassnames.js +0 -12
- package/getAnnotationNameAndStartStopString.js +0 -61
- package/getBpsPerRow.js +0 -19
- package/getCutsiteLabelHeights.js +0 -56
- package/getGapMap.js +0 -12
- package/getGaps.js +0 -27
- package/getInternalLabel.js +0 -40
- package/getOveHotkeyDefs.js +0 -12
- package/getPairwiseOverviewLinearViewOptions.js +0 -38
- package/getRangeAnglesSpecial.js +0 -12
- package/getStructuredBases.js +0 -97
- package/getTrackFromEvent.js +0 -25
- package/getVisibleStartEnd.js +0 -7
- package/getXStartAndWidthFromNonCircularRange.js +0 -12
- package/getXStartAndWidthOfRangeWrtRow.js +0 -27
- package/getXStartAndWidthOfRowAnnotation.js +0 -19
- package/getYOffset.js +0 -15
- package/hoveredAnnotation.js +0 -24
- package/importTool.js +0 -27
- package/index.js +0 -71
- package/inlineFindTool.js +0 -38
- package/isElementInViewport.js +0 -29
- package/isEnzymeFilterAndSelector.js +0 -1
- package/isTargetWithinEl.js +0 -6
- package/labelLineIntensity.js +0 -25
- package/labelSize.js +0 -23
- package/ladderDefaults.js +0 -25
- package/lastSavedId.js +0 -20
- package/lineageLines.js +0 -11
- package/linear.png +0 -0
- package/makeStore.js +0 -34
- package/massageTickSpacing.js +0 -19
- package/materiallyAvailable.js +0 -19
- package/middleware.js +0 -112
- package/minimumOrfSize.js +0 -24
- package/minimumOrfSizeSelector.js +0 -2
- package/modalActions.js +0 -3
- package/moveCaret.js +0 -58
- package/name.js +0 -19
- package/normalizeAngle.js +0 -3
- package/normalizeAngleRange.js +0 -9
- package/oligoTool.js +0 -30
- package/onlyUpdateForKeysDeep.js +0 -31
- package/orfFrameToColorMap.js +0 -10
- package/orfTool.js +0 -136
- package/orfsSelector.js +0 -15
- package/panelsShown.js +0 -294
- package/partLengthsToHide.js +0 -23
- package/partOverhangs.js +0 -6
- package/partTagSearch.js +0 -69
- package/partTool.js +0 -45
- package/parts.js +0 -19
- package/partsSelector.js +0 -8
- package/pie.png +0 -0
- package/polarToSpecialCartesian.js +0 -7
- package/positionCutsites.js +0 -6
- package/prepareRowData.js +0 -64
- package/primerBases.js +0 -221
- package/primerLengthsToHide.js +0 -27
- package/primers.js +0 -19
- package/primersSelector.js +0 -8
- package/print.png +0 -0
- package/printTool.js +0 -31
- package/propertiesTool.js +0 -40
- package/proteinUtils.js +0 -3
- package/pureNoFunc.js +0 -18
- package/readOnly.js +0 -25
- package/redoTool.js +0 -30
- package/reflex-styles.css +0 -128
- package/reflex-styles.css.map +0 -9
- package/relaxLabelAngles.js +0 -157
- package/relaxLabels_DEPRECATED.js +0 -105
- package/replacementLayers.js +0 -36
- package/restrictionEnzymes.js +0 -52
- package/restrictionEnzymesSelector.js +0 -34
- package/rowviewContants.js +0 -3
- package/ruler.css +0 -89
- package/save.png +0 -0
- package/saveTool.js +0 -44
- package/searchLayersSelector.js +0 -71
- package/selectedAnnotations.js +0 -89
- package/selectedAnnotationsSelector.js +0 -1
- package/selectedCutsitesSelector.js +0 -21
- package/selectedPartTags.js +0 -21
- package/selectionLayer.js +0 -25
- package/sequence.js +0 -12
- package/sequenceDataHistory.js +0 -43
- package/sequenceDataSelector.js +0 -2
- package/sequenceLengthSelector.js +0 -5
- package/sequenceSelector.js +0 -4
- package/sharedActionCreators.js +0 -0
- package/shouldFlipText.js +0 -4
- package/shouldRerender.js +0 -27
- package/showFileDialog.js +0 -25
- package/showGCContent.js +0 -23
- package/show_cut_sites.png +0 -0
- package/show_features.png +0 -0
- package/show_orfs.png +0 -0
- package/show_primers.png +0 -0
- package/simpleDialog.css +0 -13
- package/specialCutsiteFilterOptions.js +0 -22
- package/tagsToBoldSelector.js +0 -2
- package/toggle_views.svg +0 -1
- package/toolBar.js +0 -23
- package/translationSearchMatchesSelector.js +0 -14
- package/translations.js +0 -20
- package/translationsRawSelector.js +0 -8
- package/translationsSelector.js +0 -137
- package/typeField.js +0 -24
- package/undoTool.js +0 -30
- package/updateEditor.js +0 -200
- package/updateLabelsForInViewFeatures.js +0 -55
- package/updateLabelsForInViewFeaturesCircView.js +0 -41
- package/updateTrackHelper.js +0 -58
- package/uppercaseSequenceMapFont.js +0 -25
- package/upsertDeleteActionGenerator.js +0 -31
- package/useAAColorType.js +0 -8
- package/useAdditionalOrfStartCodons.js +0 -24
- package/useAnnotationLimits.js +0 -42
- package/useChromatogramPrefs.js +0 -31
- package/useFormValue.js +0 -7
- package/useLadders.js +0 -6
- package/useMeltingTemp.js +0 -7
- package/useTmType.js +0 -10
- package/userDefinedHandlersAndOpts.js +0 -61
- package/utils.js +0 -37
- package/versionHistory.js +0 -26
- package/versionHistoryTool.js +0 -21
- package/viewSubmenu.js +0 -479
- package/visibilityTool.js +0 -39
- package/withHover.js +0 -113
- package/withRestrictionEnzymes.js +0 -15
package/index.es.js
CHANGED
|
@@ -5783,12 +5783,12 @@ var freeGlobal = typeof global == "object" && global && global.Object === Object
|
|
|
5783
5783
|
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
5784
5784
|
var root$4 = freeGlobal || freeSelf || Function("return this")();
|
|
5785
5785
|
var Symbol$1 = root$4.Symbol;
|
|
5786
|
-
var objectProto$
|
|
5787
|
-
var hasOwnProperty$
|
|
5788
|
-
var nativeObjectToString$2 = objectProto$
|
|
5786
|
+
var objectProto$k = Object.prototype;
|
|
5787
|
+
var hasOwnProperty$k = objectProto$k.hasOwnProperty;
|
|
5788
|
+
var nativeObjectToString$2 = objectProto$k.toString;
|
|
5789
5789
|
var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : void 0;
|
|
5790
5790
|
function getRawTag(value) {
|
|
5791
|
-
var isOwn = hasOwnProperty$
|
|
5791
|
+
var isOwn = hasOwnProperty$k.call(value, symToStringTag$1), tag = value[symToStringTag$1];
|
|
5792
5792
|
try {
|
|
5793
5793
|
value[symToStringTag$1] = void 0;
|
|
5794
5794
|
var unmasked = true;
|
|
@@ -5805,8 +5805,8 @@ function getRawTag(value) {
|
|
|
5805
5805
|
return result;
|
|
5806
5806
|
}
|
|
5807
5807
|
__name(getRawTag, "getRawTag");
|
|
5808
|
-
var objectProto$
|
|
5809
|
-
var nativeObjectToString$1 = objectProto$
|
|
5808
|
+
var objectProto$j = Object.prototype;
|
|
5809
|
+
var nativeObjectToString$1 = objectProto$j.toString;
|
|
5810
5810
|
function objectToString(value) {
|
|
5811
5811
|
return nativeObjectToString$1.call(value);
|
|
5812
5812
|
}
|
|
@@ -5953,11 +5953,11 @@ function toSource(func) {
|
|
|
5953
5953
|
__name(toSource, "toSource");
|
|
5954
5954
|
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
5955
5955
|
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
5956
|
-
var funcProto$1 = Function.prototype, objectProto$
|
|
5956
|
+
var funcProto$1 = Function.prototype, objectProto$i = Object.prototype;
|
|
5957
5957
|
var funcToString$1 = funcProto$1.toString;
|
|
5958
|
-
var hasOwnProperty$
|
|
5958
|
+
var hasOwnProperty$j = objectProto$i.hasOwnProperty;
|
|
5959
5959
|
var reIsNative = RegExp(
|
|
5960
|
-
"^" + funcToString$1.call(hasOwnProperty$
|
|
5960
|
+
"^" + funcToString$1.call(hasOwnProperty$j).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
5961
5961
|
);
|
|
5962
5962
|
function baseIsNative(value) {
|
|
5963
5963
|
if (!isObject$2(value) || isMasked(value)) {
|
|
@@ -6130,11 +6130,11 @@ function eq$1(value, other) {
|
|
|
6130
6130
|
return value === other || value !== value && other !== other;
|
|
6131
6131
|
}
|
|
6132
6132
|
__name(eq$1, "eq$1");
|
|
6133
|
-
var objectProto$
|
|
6134
|
-
var hasOwnProperty$
|
|
6133
|
+
var objectProto$h = Object.prototype;
|
|
6134
|
+
var hasOwnProperty$i = objectProto$h.hasOwnProperty;
|
|
6135
6135
|
function assignValue(object3, key, value) {
|
|
6136
6136
|
var objValue = object3[key];
|
|
6137
|
-
if (!(hasOwnProperty$
|
|
6137
|
+
if (!(hasOwnProperty$i.call(object3, key) && eq$1(objValue, value)) || value === void 0 && !(key in object3)) {
|
|
6138
6138
|
baseAssignValue(object3, key, value);
|
|
6139
6139
|
}
|
|
6140
6140
|
}
|
|
@@ -6219,9 +6219,9 @@ function createAssigner(assigner) {
|
|
|
6219
6219
|
});
|
|
6220
6220
|
}
|
|
6221
6221
|
__name(createAssigner, "createAssigner");
|
|
6222
|
-
var objectProto$
|
|
6222
|
+
var objectProto$g = Object.prototype;
|
|
6223
6223
|
function isPrototype(value) {
|
|
6224
|
-
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$
|
|
6224
|
+
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$g;
|
|
6225
6225
|
return value === proto;
|
|
6226
6226
|
}
|
|
6227
6227
|
__name(isPrototype, "isPrototype");
|
|
@@ -6238,13 +6238,13 @@ function baseIsArguments(value) {
|
|
|
6238
6238
|
return isObjectLike$1(value) && baseGetTag(value) == argsTag$3;
|
|
6239
6239
|
}
|
|
6240
6240
|
__name(baseIsArguments, "baseIsArguments");
|
|
6241
|
-
var objectProto$
|
|
6242
|
-
var hasOwnProperty$
|
|
6243
|
-
var propertyIsEnumerable$1 = objectProto$
|
|
6241
|
+
var objectProto$f = Object.prototype;
|
|
6242
|
+
var hasOwnProperty$h = objectProto$f.hasOwnProperty;
|
|
6243
|
+
var propertyIsEnumerable$1 = objectProto$f.propertyIsEnumerable;
|
|
6244
6244
|
var isArguments$2 = baseIsArguments(/* @__PURE__ */ function() {
|
|
6245
6245
|
return arguments;
|
|
6246
6246
|
}()) ? baseIsArguments : function(value) {
|
|
6247
|
-
return isObjectLike$1(value) && hasOwnProperty$
|
|
6247
|
+
return isObjectLike$1(value) && hasOwnProperty$h.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
|
|
6248
6248
|
};
|
|
6249
6249
|
function stubFalse() {
|
|
6250
6250
|
return false;
|
|
@@ -6253,8 +6253,8 @@ __name(stubFalse, "stubFalse");
|
|
|
6253
6253
|
var freeExports$2 = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
6254
6254
|
var freeModule$2 = freeExports$2 && typeof module == "object" && module && !module.nodeType && module;
|
|
6255
6255
|
var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2;
|
|
6256
|
-
var Buffer$
|
|
6257
|
-
var nativeIsBuffer = Buffer$
|
|
6256
|
+
var Buffer$2 = moduleExports$2 ? root$4.Buffer : void 0;
|
|
6257
|
+
var nativeIsBuffer = Buffer$2 ? Buffer$2.isBuffer : void 0;
|
|
6258
6258
|
var isBuffer$1 = nativeIsBuffer || stubFalse;
|
|
6259
6259
|
var argsTag$2 = "[object Arguments]", arrayTag$2 = "[object Array]", boolTag$3 = "[object Boolean]", dateTag$3 = "[object Date]", errorTag$2 = "[object Error]", funcTag$1 = "[object Function]", mapTag$7 = "[object Map]", numberTag$4 = "[object Number]", objectTag$4 = "[object Object]", regexpTag$3 = "[object RegExp]", setTag$7 = "[object Set]", stringTag$4 = "[object String]", weakMapTag$2 = "[object WeakMap]";
|
|
6260
6260
|
var arrayBufferTag$3 = "[object ArrayBuffer]", dataViewTag$4 = "[object DataView]", float32Tag$2 = "[object Float32Array]", float64Tag$2 = "[object Float64Array]", int8Tag$2 = "[object Int8Array]", int16Tag$2 = "[object Int16Array]", int32Tag$2 = "[object Int32Array]", uint8Tag$2 = "[object Uint8Array]", uint8ClampedTag$2 = "[object Uint8ClampedArray]", uint16Tag$2 = "[object Uint16Array]", uint32Tag$2 = "[object Uint32Array]";
|
|
@@ -6287,12 +6287,12 @@ var nodeUtil = function() {
|
|
|
6287
6287
|
}();
|
|
6288
6288
|
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
6289
6289
|
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
6290
|
-
var objectProto$
|
|
6291
|
-
var hasOwnProperty$
|
|
6290
|
+
var objectProto$e = Object.prototype;
|
|
6291
|
+
var hasOwnProperty$g = objectProto$e.hasOwnProperty;
|
|
6292
6292
|
function arrayLikeKeys(value, inherited) {
|
|
6293
6293
|
var isArr = isArray$2(value), isArg = !isArr && isArguments$2(value), isBuff = !isArr && !isArg && isBuffer$1(value), isType2 = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType2, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
|
|
6294
6294
|
for (var key in value) {
|
|
6295
|
-
if ((inherited || hasOwnProperty$
|
|
6295
|
+
if ((inherited || hasOwnProperty$g.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
6296
6296
|
(key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
6297
6297
|
isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
6298
6298
|
isType2 && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
|
|
@@ -6310,15 +6310,15 @@ function overArg(func, transform) {
|
|
|
6310
6310
|
}
|
|
6311
6311
|
__name(overArg, "overArg");
|
|
6312
6312
|
var nativeKeys = overArg(Object.keys, Object);
|
|
6313
|
-
var objectProto$
|
|
6314
|
-
var hasOwnProperty$
|
|
6313
|
+
var objectProto$d = Object.prototype;
|
|
6314
|
+
var hasOwnProperty$f = objectProto$d.hasOwnProperty;
|
|
6315
6315
|
function baseKeys(object3) {
|
|
6316
6316
|
if (!isPrototype(object3)) {
|
|
6317
6317
|
return nativeKeys(object3);
|
|
6318
6318
|
}
|
|
6319
6319
|
var result = [];
|
|
6320
6320
|
for (var key in Object(object3)) {
|
|
6321
|
-
if (hasOwnProperty$
|
|
6321
|
+
if (hasOwnProperty$f.call(object3, key) && key != "constructor") {
|
|
6322
6322
|
result.push(key);
|
|
6323
6323
|
}
|
|
6324
6324
|
}
|
|
@@ -6329,15 +6329,15 @@ function keys$1(object3) {
|
|
|
6329
6329
|
return isArrayLike(object3) ? arrayLikeKeys(object3) : baseKeys(object3);
|
|
6330
6330
|
}
|
|
6331
6331
|
__name(keys$1, "keys$1");
|
|
6332
|
-
var objectProto$
|
|
6333
|
-
var hasOwnProperty$
|
|
6332
|
+
var objectProto$c = Object.prototype;
|
|
6333
|
+
var hasOwnProperty$e = objectProto$c.hasOwnProperty;
|
|
6334
6334
|
var assign$2 = createAssigner(function(object3, source) {
|
|
6335
6335
|
if (isPrototype(source) || isArrayLike(source)) {
|
|
6336
6336
|
copyObject(source, keys$1(source), object3);
|
|
6337
6337
|
return;
|
|
6338
6338
|
}
|
|
6339
6339
|
for (var key in source) {
|
|
6340
|
-
if (hasOwnProperty$
|
|
6340
|
+
if (hasOwnProperty$e.call(source, key)) {
|
|
6341
6341
|
assignValue(object3, key, source[key]);
|
|
6342
6342
|
}
|
|
6343
6343
|
}
|
|
@@ -6352,15 +6352,15 @@ function nativeKeysIn(object3) {
|
|
|
6352
6352
|
return result;
|
|
6353
6353
|
}
|
|
6354
6354
|
__name(nativeKeysIn, "nativeKeysIn");
|
|
6355
|
-
var objectProto$
|
|
6356
|
-
var hasOwnProperty$
|
|
6355
|
+
var objectProto$b = Object.prototype;
|
|
6356
|
+
var hasOwnProperty$d = objectProto$b.hasOwnProperty;
|
|
6357
6357
|
function baseKeysIn(object3) {
|
|
6358
6358
|
if (!isObject$2(object3)) {
|
|
6359
6359
|
return nativeKeysIn(object3);
|
|
6360
6360
|
}
|
|
6361
6361
|
var isProto = isPrototype(object3), result = [];
|
|
6362
6362
|
for (var key in object3) {
|
|
6363
|
-
if (!(key == "constructor" && (isProto || !hasOwnProperty$
|
|
6363
|
+
if (!(key == "constructor" && (isProto || !hasOwnProperty$d.call(object3, key)))) {
|
|
6364
6364
|
result.push(key);
|
|
6365
6365
|
}
|
|
6366
6366
|
}
|
|
@@ -6399,22 +6399,22 @@ function hashDelete(key) {
|
|
|
6399
6399
|
}
|
|
6400
6400
|
__name(hashDelete, "hashDelete");
|
|
6401
6401
|
var HASH_UNDEFINED$2 = "__lodash_hash_undefined__";
|
|
6402
|
-
var objectProto$
|
|
6403
|
-
var hasOwnProperty$
|
|
6402
|
+
var objectProto$a = Object.prototype;
|
|
6403
|
+
var hasOwnProperty$c = objectProto$a.hasOwnProperty;
|
|
6404
6404
|
function hashGet(key) {
|
|
6405
6405
|
var data = this.__data__;
|
|
6406
6406
|
if (nativeCreate) {
|
|
6407
6407
|
var result = data[key];
|
|
6408
6408
|
return result === HASH_UNDEFINED$2 ? void 0 : result;
|
|
6409
6409
|
}
|
|
6410
|
-
return hasOwnProperty$
|
|
6410
|
+
return hasOwnProperty$c.call(data, key) ? data[key] : void 0;
|
|
6411
6411
|
}
|
|
6412
6412
|
__name(hashGet, "hashGet");
|
|
6413
|
-
var objectProto$
|
|
6414
|
-
var hasOwnProperty$
|
|
6413
|
+
var objectProto$9 = Object.prototype;
|
|
6414
|
+
var hasOwnProperty$b = objectProto$9.hasOwnProperty;
|
|
6415
6415
|
function hashHas(key) {
|
|
6416
6416
|
var data = this.__data__;
|
|
6417
|
-
return nativeCreate ? data[key] !== void 0 : hasOwnProperty$
|
|
6417
|
+
return nativeCreate ? data[key] !== void 0 : hasOwnProperty$b.call(data, key);
|
|
6418
6418
|
}
|
|
6419
6419
|
__name(hashHas, "hashHas");
|
|
6420
6420
|
var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
|
|
@@ -6677,9 +6677,9 @@ function flatRest(func) {
|
|
|
6677
6677
|
__name(flatRest, "flatRest");
|
|
6678
6678
|
var getPrototype = overArg(Object.getPrototypeOf, Object);
|
|
6679
6679
|
var objectTag$3 = "[object Object]";
|
|
6680
|
-
var funcProto = Function.prototype, objectProto$
|
|
6680
|
+
var funcProto = Function.prototype, objectProto$8 = Object.prototype;
|
|
6681
6681
|
var funcToString = funcProto.toString;
|
|
6682
|
-
var hasOwnProperty$
|
|
6682
|
+
var hasOwnProperty$a = objectProto$8.hasOwnProperty;
|
|
6683
6683
|
var objectCtorString = funcToString.call(Object);
|
|
6684
6684
|
function isPlainObject$2(value) {
|
|
6685
6685
|
if (!isObjectLike$1(value) || baseGetTag(value) != objectTag$3) {
|
|
@@ -6689,7 +6689,7 @@ function isPlainObject$2(value) {
|
|
|
6689
6689
|
if (proto === null) {
|
|
6690
6690
|
return true;
|
|
6691
6691
|
}
|
|
6692
|
-
var Ctor = hasOwnProperty$
|
|
6692
|
+
var Ctor = hasOwnProperty$a.call(proto, "constructor") && proto.constructor;
|
|
6693
6693
|
return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
|
|
6694
6694
|
}
|
|
6695
6695
|
__name(isPlainObject$2, "isPlainObject$2");
|
|
@@ -7124,7 +7124,7 @@ __name(baseAssignIn, "baseAssignIn");
|
|
|
7124
7124
|
var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
7125
7125
|
var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
|
|
7126
7126
|
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
7127
|
-
var Buffer$
|
|
7127
|
+
var Buffer$1 = moduleExports ? root$4.Buffer : void 0, allocUnsafe = Buffer$1 ? Buffer$1.allocUnsafe : void 0;
|
|
7128
7128
|
function cloneBuffer(buffer2, isDeep) {
|
|
7129
7129
|
if (isDeep) {
|
|
7130
7130
|
return buffer2.slice();
|
|
@@ -7149,8 +7149,8 @@ function stubArray() {
|
|
|
7149
7149
|
return [];
|
|
7150
7150
|
}
|
|
7151
7151
|
__name(stubArray, "stubArray");
|
|
7152
|
-
var objectProto$
|
|
7153
|
-
var propertyIsEnumerable = objectProto$
|
|
7152
|
+
var objectProto$7 = Object.prototype;
|
|
7153
|
+
var propertyIsEnumerable = objectProto$7.propertyIsEnumerable;
|
|
7154
7154
|
var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
|
|
7155
7155
|
var getSymbols = !nativeGetSymbols$1 ? stubArray : function(object3) {
|
|
7156
7156
|
if (object3 == null) {
|
|
@@ -7218,11 +7218,11 @@ if (DataView$1 && getTag$1(new DataView$1(new ArrayBuffer(1))) != dataViewTag$3
|
|
|
7218
7218
|
return result;
|
|
7219
7219
|
}, "getTag$1");
|
|
7220
7220
|
}
|
|
7221
|
-
var objectProto$
|
|
7222
|
-
var hasOwnProperty$
|
|
7221
|
+
var objectProto$6 = Object.prototype;
|
|
7222
|
+
var hasOwnProperty$9 = objectProto$6.hasOwnProperty;
|
|
7223
7223
|
function initCloneArray(array2) {
|
|
7224
7224
|
var length = array2.length, result = new array2.constructor(length);
|
|
7225
|
-
if (length && typeof array2[0] == "string" && hasOwnProperty$
|
|
7225
|
+
if (length && typeof array2[0] == "string" && hasOwnProperty$9.call(array2, "index")) {
|
|
7226
7226
|
result.index = array2.index;
|
|
7227
7227
|
result.input = array2.input;
|
|
7228
7228
|
}
|
|
@@ -7536,8 +7536,8 @@ function equalByTag(object3, other, tag, bitmask, customizer, equalFunc, stack)
|
|
|
7536
7536
|
}
|
|
7537
7537
|
__name(equalByTag, "equalByTag");
|
|
7538
7538
|
var COMPARE_PARTIAL_FLAG$3 = 1;
|
|
7539
|
-
var objectProto$
|
|
7540
|
-
var hasOwnProperty$
|
|
7539
|
+
var objectProto$5 = Object.prototype;
|
|
7540
|
+
var hasOwnProperty$8 = objectProto$5.hasOwnProperty;
|
|
7541
7541
|
function equalObjects(object3, other, bitmask, customizer, equalFunc, stack) {
|
|
7542
7542
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, objProps = getAllKeys(object3), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
|
|
7543
7543
|
if (objLength != othLength && !isPartial) {
|
|
@@ -7546,7 +7546,7 @@ function equalObjects(object3, other, bitmask, customizer, equalFunc, stack) {
|
|
|
7546
7546
|
var index2 = objLength;
|
|
7547
7547
|
while (index2--) {
|
|
7548
7548
|
var key = objProps[index2];
|
|
7549
|
-
if (!(isPartial ? key in other : hasOwnProperty$
|
|
7549
|
+
if (!(isPartial ? key in other : hasOwnProperty$8.call(other, key))) {
|
|
7550
7550
|
return false;
|
|
7551
7551
|
}
|
|
7552
7552
|
}
|
|
@@ -7584,8 +7584,8 @@ function equalObjects(object3, other, bitmask, customizer, equalFunc, stack) {
|
|
|
7584
7584
|
__name(equalObjects, "equalObjects");
|
|
7585
7585
|
var COMPARE_PARTIAL_FLAG$2 = 1;
|
|
7586
7586
|
var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]";
|
|
7587
|
-
var objectProto$
|
|
7588
|
-
var hasOwnProperty$
|
|
7587
|
+
var objectProto$4 = Object.prototype;
|
|
7588
|
+
var hasOwnProperty$7 = objectProto$4.hasOwnProperty;
|
|
7589
7589
|
function baseIsEqualDeep(object3, other, bitmask, customizer, equalFunc, stack) {
|
|
7590
7590
|
var objIsArr = isArray$2(object3), othIsArr = isArray$2(other), objTag = objIsArr ? arrayTag : getTag$1(object3), othTag = othIsArr ? arrayTag : getTag$1(other);
|
|
7591
7591
|
objTag = objTag == argsTag ? objectTag : objTag;
|
|
@@ -7603,7 +7603,7 @@ function baseIsEqualDeep(object3, other, bitmask, customizer, equalFunc, stack)
|
|
|
7603
7603
|
return objIsArr || isTypedArray(object3) ? equalArrays(object3, other, bitmask, customizer, equalFunc, stack) : equalByTag(object3, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
7604
7604
|
}
|
|
7605
7605
|
if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
|
|
7606
|
-
var objIsWrapped = objIsObj && hasOwnProperty$
|
|
7606
|
+
var objIsWrapped = objIsObj && hasOwnProperty$7.call(object3, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty$7.call(other, "__wrapped__");
|
|
7607
7607
|
if (objIsWrapped || othIsWrapped) {
|
|
7608
7608
|
var objUnwrapped = objIsWrapped ? object3.value() : object3, othUnwrapped = othIsWrapped ? other.value() : other;
|
|
7609
7609
|
stack || (stack = new Stack());
|
|
@@ -7815,10 +7815,10 @@ function createAggregator(setter, initializer) {
|
|
|
7815
7815
|
};
|
|
7816
7816
|
}
|
|
7817
7817
|
__name(createAggregator, "createAggregator");
|
|
7818
|
-
var objectProto$
|
|
7819
|
-
var hasOwnProperty$
|
|
7818
|
+
var objectProto$3 = Object.prototype;
|
|
7819
|
+
var hasOwnProperty$6 = objectProto$3.hasOwnProperty;
|
|
7820
7820
|
var countBy = createAggregator(function(result, value, key) {
|
|
7821
|
-
if (hasOwnProperty$
|
|
7821
|
+
if (hasOwnProperty$6.call(result, key)) {
|
|
7822
7822
|
++result[key];
|
|
7823
7823
|
} else {
|
|
7824
7824
|
baseAssignValue(result, key, 1);
|
|
@@ -8054,15 +8054,6 @@ var differenceBy = baseRest(function(array2, values3) {
|
|
|
8054
8054
|
}
|
|
8055
8055
|
return isArrayLikeObject(array2) ? baseDifference(array2, baseFlatten(values3, 1, isArrayLikeObject, true), baseIteratee(iteratee)) : [];
|
|
8056
8056
|
});
|
|
8057
|
-
function drop$2(array2, n2, guard) {
|
|
8058
|
-
var length = array2 == null ? 0 : array2.length;
|
|
8059
|
-
if (!length) {
|
|
8060
|
-
return [];
|
|
8061
|
-
}
|
|
8062
|
-
n2 = n2 === void 0 ? 1 : toInteger(n2);
|
|
8063
|
-
return baseSlice(array2, n2 < 0 ? 0 : n2, length);
|
|
8064
|
-
}
|
|
8065
|
-
__name(drop$2, "drop$2");
|
|
8066
8057
|
function castFunction(value) {
|
|
8067
8058
|
return typeof value == "function" ? value : identity$3;
|
|
8068
8059
|
}
|
|
@@ -8171,6 +8162,16 @@ function baseGt(value, other) {
|
|
|
8171
8162
|
return value > other;
|
|
8172
8163
|
}
|
|
8173
8164
|
__name(baseGt, "baseGt");
|
|
8165
|
+
var objectProto$2 = Object.prototype;
|
|
8166
|
+
var hasOwnProperty$5 = objectProto$2.hasOwnProperty;
|
|
8167
|
+
function baseHas(object3, key) {
|
|
8168
|
+
return object3 != null && hasOwnProperty$5.call(object3, key);
|
|
8169
|
+
}
|
|
8170
|
+
__name(baseHas, "baseHas");
|
|
8171
|
+
function has$3(object3, path2) {
|
|
8172
|
+
return object3 != null && hasPath(object3, path2, baseHas);
|
|
8173
|
+
}
|
|
8174
|
+
__name(has$3, "has$3");
|
|
8174
8175
|
var stringTag = "[object String]";
|
|
8175
8176
|
function isString$1(value) {
|
|
8176
8177
|
return typeof value == "string" || !isArray$2(value) && isObjectLike$1(value) && baseGetTag(value) == stringTag;
|
|
@@ -8304,15 +8305,15 @@ function isEqualWith(value, other, customizer) {
|
|
|
8304
8305
|
return result === void 0 ? baseIsEqual(value, other, void 0, customizer) : !!result;
|
|
8305
8306
|
}
|
|
8306
8307
|
__name(isEqualWith, "isEqualWith");
|
|
8307
|
-
function isInteger(value) {
|
|
8308
|
-
return typeof value == "number" && value == toInteger(value);
|
|
8309
|
-
}
|
|
8310
|
-
__name(isInteger, "isInteger");
|
|
8311
8308
|
var numberTag = "[object Number]";
|
|
8312
8309
|
function isNumber$2(value) {
|
|
8313
8310
|
return typeof value == "number" || isObjectLike$1(value) && baseGetTag(value) == numberTag;
|
|
8314
8311
|
}
|
|
8315
8312
|
__name(isNumber$2, "isNumber$2");
|
|
8313
|
+
function isNull(value) {
|
|
8314
|
+
return value === null;
|
|
8315
|
+
}
|
|
8316
|
+
__name(isNull, "isNull");
|
|
8316
8317
|
function isUndefined(value) {
|
|
8317
8318
|
return value === void 0;
|
|
8318
8319
|
}
|
|
@@ -15991,6 +15992,7 @@ var itemSizeEstimator = /* @__PURE__ */ __name(function itemSizeEstimator2() {
|
|
|
15991
15992
|
return 41.36;
|
|
15992
15993
|
}, "itemSizeEstimator");
|
|
15993
15994
|
var ReactTableDefaults = defaultProps$1;
|
|
15995
|
+
var VIRTUALIZE_CUTOFF_LENGTH = 200;
|
|
15994
15996
|
var ReactTable = function(_Methods) {
|
|
15995
15997
|
_inherits$8(ReactTable2, _Methods);
|
|
15996
15998
|
function ReactTable2(props) {
|
|
@@ -16576,7 +16578,7 @@ var ReactTable = function(_Methods) {
|
|
|
16576
16578
|
minWidth: rowMinWidth + "px"
|
|
16577
16579
|
})
|
|
16578
16580
|
}, tBodyProps.rest),
|
|
16579
|
-
pageRows.length <
|
|
16581
|
+
_this2.props.noVirtual || pageRows.length < VIRTUALIZE_CUTOFF_LENGTH ? pageRows.map(function(d2, i) {
|
|
16580
16582
|
return makePageRow(d2, i);
|
|
16581
16583
|
}) : React__default.createElement(ReactList, {
|
|
16582
16584
|
type: "variable",
|
|
@@ -16680,7 +16682,7 @@ const getIdOrCodeOrIndex = /* @__PURE__ */ __name((record, rowIndex) => {
|
|
|
16680
16682
|
const getSelectedRowsFromEntities = /* @__PURE__ */ __name((entities, idMap) => {
|
|
16681
16683
|
if (!idMap) return [];
|
|
16682
16684
|
return entities.reduce((acc, entity, i) => {
|
|
16683
|
-
return idMap[getIdOrCodeOrIndex(entity, i)] ? acc.concat(i) : acc;
|
|
16685
|
+
return idMap[getIdOrCodeOrIndex(entity, i)] ? acc.concat([i]) : acc;
|
|
16684
16686
|
}, []);
|
|
16685
16687
|
}, "getSelectedRowsFromEntities");
|
|
16686
16688
|
const removeCleanRows = /* @__PURE__ */ __name((entities, cellValidation) => {
|
|
@@ -16799,9 +16801,9 @@ const stripNumberAtEnd = /* @__PURE__ */ __name((str) => {
|
|
|
16799
16801
|
var _a2;
|
|
16800
16802
|
return (_a2 = str == null ? void 0 : str.replace) == null ? void 0 : _a2.call(str, getNumberStrAtEnd(str), "");
|
|
16801
16803
|
}, "stripNumberAtEnd");
|
|
16802
|
-
const getAllRows = /* @__PURE__ */ __name((
|
|
16803
|
-
|
|
16804
|
-
const allRowEls =
|
|
16804
|
+
const getAllRows = /* @__PURE__ */ __name((tableRef) => {
|
|
16805
|
+
var _a2, _b2;
|
|
16806
|
+
const allRowEls = (_b2 = (_a2 = tableRef.current) == null ? void 0 : _a2.tableRef) == null ? void 0 : _b2.querySelectorAll(".rt-tr");
|
|
16805
16807
|
if (!allRowEls || !allRowEls.length) {
|
|
16806
16808
|
return;
|
|
16807
16809
|
}
|
|
@@ -17068,14 +17070,14 @@ const handleCopyRows = /* @__PURE__ */ __name((rowElsToCopy, { specificColumn, o
|
|
|
17068
17070
|
handleCopyHelper(textToCopy, jsonToCopy, onFinishMsg || "Row Copied");
|
|
17069
17071
|
}
|
|
17070
17072
|
}, "handleCopyRows");
|
|
17071
|
-
const handleCopyColumn = /* @__PURE__ */ __name((
|
|
17073
|
+
const handleCopyColumn = /* @__PURE__ */ __name((tableRef, cellWrapper, selectedRecords) => {
|
|
17072
17074
|
const specificColumn = cellWrapper.getAttribute("data-test");
|
|
17073
|
-
let rowElsToCopy = getAllRows(
|
|
17075
|
+
let rowElsToCopy = getAllRows(tableRef);
|
|
17074
17076
|
if (!rowElsToCopy) return;
|
|
17075
17077
|
if (selectedRecords) {
|
|
17076
|
-
const ids2 = selectedRecords.map((
|
|
17078
|
+
const ids2 = selectedRecords.map((e) => {
|
|
17077
17079
|
var _a2;
|
|
17078
|
-
return (_a2 = getIdOrCodeOrIndex(
|
|
17080
|
+
return (_a2 = getIdOrCodeOrIndex(e)) == null ? void 0 : _a2.toString();
|
|
17079
17081
|
});
|
|
17080
17082
|
rowElsToCopy = Array.from(rowElsToCopy).filter((rowEl) => {
|
|
17081
17083
|
var _a2;
|
|
@@ -17108,9 +17110,9 @@ const isBottomRightCornerOfRectangle = /* @__PURE__ */ __name(({
|
|
|
17108
17110
|
const isBottomRight = i === lastRowIndex && cellIndex === lastCellIndex;
|
|
17109
17111
|
return isBottomRight;
|
|
17110
17112
|
}, "isBottomRightCornerOfRectangle");
|
|
17111
|
-
const handleCopyTable = /* @__PURE__ */ __name((
|
|
17113
|
+
const handleCopyTable = /* @__PURE__ */ __name((tableRef, opts2) => {
|
|
17112
17114
|
try {
|
|
17113
|
-
const allRowEls = getAllRows(
|
|
17115
|
+
const allRowEls = getAllRows(tableRef);
|
|
17114
17116
|
if (!allRowEls) return;
|
|
17115
17117
|
handleCopyRows(allRowEls, __spreadProps(__spreadValues({}, opts2), {
|
|
17116
17118
|
onFinishMsg: "Table Copied"
|
|
@@ -17147,13 +17149,15 @@ const useTableEntities = /* @__PURE__ */ __name((tableFormName) => {
|
|
|
17147
17149
|
},
|
|
17148
17150
|
[dispatch, tableFormName]
|
|
17149
17151
|
);
|
|
17150
|
-
const { allOrderedEntities, selectedEntities } = useSelector(
|
|
17151
|
-
|
|
17152
|
-
|
|
17153
|
-
|
|
17154
|
-
|
|
17155
|
-
|
|
17156
|
-
|
|
17152
|
+
const { allOrderedEntities, selectedEntities } = useSelector(
|
|
17153
|
+
(state2) => {
|
|
17154
|
+
var _a2, _b2, _c, _d, _e, _f;
|
|
17155
|
+
return {
|
|
17156
|
+
allOrderedEntities: (_c = (_b2 = (_a2 = state2.form) == null ? void 0 : _a2[tableFormName]) == null ? void 0 : _b2.values) == null ? void 0 : _c.allOrderedEntities,
|
|
17157
|
+
selectedEntities: (_f = (_e = (_d = state2.form) == null ? void 0 : _d[tableFormName]) == null ? void 0 : _e.values) == null ? void 0 : _f.reduxFormSelectedEntityIdMap
|
|
17158
|
+
};
|
|
17159
|
+
}
|
|
17160
|
+
);
|
|
17157
17161
|
return { selectTableEntities, allOrderedEntities, selectedEntities };
|
|
17158
17162
|
}, "useTableEntities");
|
|
17159
17163
|
const useDeepEqualMemo = /* @__PURE__ */ __name((value) => {
|
|
@@ -19527,293 +19531,501 @@ function requireLib$8() {
|
|
|
19527
19531
|
__name(requireLib$8, "requireLib$8");
|
|
19528
19532
|
var libExports$3 = /* @__PURE__ */ requireLib$8();
|
|
19529
19533
|
const queryString = /* @__PURE__ */ getDefaultExportFromCjs(libExports$3);
|
|
19530
|
-
|
|
19531
|
-
|
|
19532
|
-
|
|
19533
|
-
|
|
19534
|
-
|
|
19535
|
-
|
|
19536
|
-
|
|
19537
|
-
|
|
19538
|
-
|
|
19539
|
-
|
|
19540
|
-
|
|
19541
|
-
|
|
19542
|
-
|
|
19543
|
-
|
|
19544
|
-
|
|
19545
|
-
|
|
19546
|
-
|
|
19547
|
-
|
|
19548
|
-
|
|
19549
|
-
|
|
19550
|
-
|
|
19551
|
-
|
|
19552
|
-
|
|
19553
|
-
|
|
19554
|
-
|
|
19555
|
-
|
|
19556
|
-
|
|
19557
|
-
|
|
19558
|
-
|
|
19559
|
-
|
|
19560
|
-
|
|
19561
|
-
|
|
19562
|
-
|
|
19563
|
-
|
|
19564
|
-
|
|
19565
|
-
|
|
19566
|
-
|
|
19567
|
-
|
|
19568
|
-
|
|
19569
|
-
|
|
19570
|
-
|
|
19571
|
-
|
|
19572
|
-
|
|
19573
|
-
|
|
19574
|
-
}
|
|
19575
|
-
|
|
19576
|
-
|
|
19577
|
-
if (S2(t3)) return t3.clone();
|
|
19578
|
-
var n3 = "object" == typeof e2 ? e2 : {};
|
|
19579
|
-
return n3.date = t3, n3.args = arguments, new _2(n3);
|
|
19580
|
-
}, "O"), b3 = v2;
|
|
19581
|
-
b3.l = w2, b3.i = S2, b3.w = function(t3, e2) {
|
|
19582
|
-
return O2(t3, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
|
|
19583
|
-
};
|
|
19584
|
-
var _2 = function() {
|
|
19585
|
-
function M3(t3) {
|
|
19586
|
-
this.$L = w2(t3.locale, null, true), this.parse(t3), this.$x = this.$x || t3.x || {}, this[p2] = true;
|
|
19534
|
+
function tableQueryParamsToHasuraClauses({
|
|
19535
|
+
page,
|
|
19536
|
+
pageSize,
|
|
19537
|
+
searchTerm,
|
|
19538
|
+
filters,
|
|
19539
|
+
order: order2,
|
|
19540
|
+
schema: schema2,
|
|
19541
|
+
// Add schema as a parameter
|
|
19542
|
+
additionalFilter
|
|
19543
|
+
}) {
|
|
19544
|
+
const ccFields = getFieldsMappedByCCDisplayName(schema2);
|
|
19545
|
+
let where = {};
|
|
19546
|
+
const order_by = [];
|
|
19547
|
+
const limit = pageSize || 25;
|
|
19548
|
+
const offset4 = page && pageSize ? (page - 1) * pageSize : 0;
|
|
19549
|
+
if (searchTerm) {
|
|
19550
|
+
const searchTermFilters = [];
|
|
19551
|
+
const uniqueFieldsByPath = {};
|
|
19552
|
+
const searchTerms = searchTerm.split(",");
|
|
19553
|
+
schema2.fields.forEach((field) => {
|
|
19554
|
+
const { type: type2, path: path2, searchDisabled } = field;
|
|
19555
|
+
if (uniqueFieldsByPath[path2]) return;
|
|
19556
|
+
uniqueFieldsByPath[path2] = true;
|
|
19557
|
+
if (searchDisabled || field.filterDisabled || type2 === "color") return;
|
|
19558
|
+
searchTerms.forEach((term) => {
|
|
19559
|
+
const filterValue = term.trim();
|
|
19560
|
+
if (type2 === "string" || type2 === "lookup") {
|
|
19561
|
+
const o2 = set$2({}, path2, { _ilike: `%${filterValue}%` });
|
|
19562
|
+
searchTermFilters.push(o2);
|
|
19563
|
+
} else if (type2 === "boolean") {
|
|
19564
|
+
let regex;
|
|
19565
|
+
try {
|
|
19566
|
+
regex = new RegExp("^" + filterValue, "ig");
|
|
19567
|
+
} catch (error) {
|
|
19568
|
+
}
|
|
19569
|
+
if (regex) {
|
|
19570
|
+
if ("true".replace(regex, "") !== "true") {
|
|
19571
|
+
const o2 = set$2({}, path2, { _eq: true });
|
|
19572
|
+
searchTermFilters.push(o2);
|
|
19573
|
+
} else if ("false".replace(regex, "") !== "false") {
|
|
19574
|
+
const o2 = set$2({}, path2, { _eq: false });
|
|
19575
|
+
searchTermFilters.push(o2);
|
|
19576
|
+
}
|
|
19577
|
+
}
|
|
19578
|
+
} else if ((type2 === "number" || type2 === "integer") && !isNaN(filterValue)) {
|
|
19579
|
+
const o2 = set$2({}, path2, { _eq: parseFloat(filterValue) });
|
|
19580
|
+
searchTermFilters.push(o2);
|
|
19587
19581
|
}
|
|
19588
|
-
|
|
19589
|
-
|
|
19590
|
-
|
|
19591
|
-
|
|
19592
|
-
|
|
19593
|
-
|
|
19594
|
-
|
|
19595
|
-
|
|
19596
|
-
|
|
19597
|
-
|
|
19598
|
-
|
|
19599
|
-
|
|
19600
|
-
|
|
19582
|
+
});
|
|
19583
|
+
});
|
|
19584
|
+
if (searchTermFilters.length > 0) {
|
|
19585
|
+
if (Object.keys(where).length > 0) {
|
|
19586
|
+
where = { _and: [where, { _or: searchTermFilters }] };
|
|
19587
|
+
} else {
|
|
19588
|
+
where = { _or: searchTermFilters };
|
|
19589
|
+
}
|
|
19590
|
+
}
|
|
19591
|
+
}
|
|
19592
|
+
if (filters && filters.length > 0) {
|
|
19593
|
+
const filterClauses = filters.map((filter2) => {
|
|
19594
|
+
let { selectedFilter, filterOn, filterValue } = filter2;
|
|
19595
|
+
const fieldSchema = ccFields[filterOn] || {};
|
|
19596
|
+
const { path: path2, reference: reference2, type: type2, customColumnFilter } = fieldSchema;
|
|
19597
|
+
if (customColumnFilter) {
|
|
19598
|
+
return customColumnFilter(filterValue);
|
|
19599
|
+
}
|
|
19600
|
+
let stringFilterValue = filterValue && filterValue.toString ? filterValue.toString() : filterValue;
|
|
19601
|
+
if (stringFilterValue === false) {
|
|
19602
|
+
stringFilterValue = "false";
|
|
19603
|
+
} else {
|
|
19604
|
+
stringFilterValue = stringFilterValue || "";
|
|
19605
|
+
}
|
|
19606
|
+
const arrayFilterValue = Array.isArray(filterValue) ? filterValue : stringFilterValue.split(";");
|
|
19607
|
+
if (type2 === "number" || type2 === "integer") {
|
|
19608
|
+
filterValue = Array.isArray(filterValue) ? filterValue.map((val2) => Number(val2)) : Number(filterValue);
|
|
19609
|
+
}
|
|
19610
|
+
if (fieldSchema.normalizeFilter) {
|
|
19611
|
+
filterValue = fieldSchema.normalizeFilter(
|
|
19612
|
+
filterValue,
|
|
19613
|
+
selectedFilter,
|
|
19614
|
+
filterOn
|
|
19615
|
+
);
|
|
19616
|
+
}
|
|
19617
|
+
if (reference2) {
|
|
19618
|
+
filterOn = reference2.sourceField;
|
|
19619
|
+
} else {
|
|
19620
|
+
filterOn = path2 || filterOn;
|
|
19621
|
+
}
|
|
19622
|
+
switch (selectedFilter) {
|
|
19623
|
+
case "none":
|
|
19624
|
+
return {};
|
|
19625
|
+
case "startsWith":
|
|
19626
|
+
return { [filterOn]: { _ilike: `${filterValue}%` } };
|
|
19627
|
+
case "endsWith":
|
|
19628
|
+
return { [filterOn]: { _ilike: `%${filterValue}` } };
|
|
19629
|
+
case "contains":
|
|
19630
|
+
return { [filterOn]: { _ilike: `%${filterValue}%` } };
|
|
19631
|
+
case "notContains":
|
|
19632
|
+
return { [filterOn]: { _nilike: `%${filterValue}%` } };
|
|
19633
|
+
case "isExactly":
|
|
19634
|
+
return { [filterOn]: { _eq: filterValue } };
|
|
19635
|
+
case "isEmpty":
|
|
19636
|
+
if (filterOn.includes(".")) {
|
|
19637
|
+
return {
|
|
19638
|
+
_not: {
|
|
19639
|
+
[filterOn.split(".")[0]]: {}
|
|
19601
19640
|
}
|
|
19602
|
-
}
|
|
19603
|
-
return new Date(e2);
|
|
19604
|
-
}(t3), this.init();
|
|
19605
|
-
}, m3.init = function() {
|
|
19606
|
-
var t3 = this.$d;
|
|
19607
|
-
this.$y = t3.getFullYear(), this.$M = t3.getMonth(), this.$D = t3.getDate(), this.$W = t3.getDay(), this.$H = t3.getHours(), this.$m = t3.getMinutes(), this.$s = t3.getSeconds(), this.$ms = t3.getMilliseconds();
|
|
19608
|
-
}, m3.$utils = function() {
|
|
19609
|
-
return b3;
|
|
19610
|
-
}, m3.isValid = function() {
|
|
19611
|
-
return !(this.$d.toString() === l2);
|
|
19612
|
-
}, m3.isSame = function(t3, e2) {
|
|
19613
|
-
var n3 = O2(t3);
|
|
19614
|
-
return this.startOf(e2) <= n3 && n3 <= this.endOf(e2);
|
|
19615
|
-
}, m3.isAfter = function(t3, e2) {
|
|
19616
|
-
return O2(t3) < this.startOf(e2);
|
|
19617
|
-
}, m3.isBefore = function(t3, e2) {
|
|
19618
|
-
return this.endOf(e2) < O2(t3);
|
|
19619
|
-
}, m3.$g = function(t3, e2, n3) {
|
|
19620
|
-
return b3.u(t3) ? this[e2] : this.set(n3, t3);
|
|
19621
|
-
}, m3.unix = function() {
|
|
19622
|
-
return Math.floor(this.valueOf() / 1e3);
|
|
19623
|
-
}, m3.valueOf = function() {
|
|
19624
|
-
return this.$d.getTime();
|
|
19625
|
-
}, m3.startOf = function(t3, e2) {
|
|
19626
|
-
var n3 = this, r3 = !!b3.u(e2) || e2, f3 = b3.p(t3), l3 = /* @__PURE__ */ __name(function(t4, e3) {
|
|
19627
|
-
var i2 = b3.w(n3.$u ? Date.UTC(n3.$y, e3, t4) : new Date(n3.$y, e3, t4), n3);
|
|
19628
|
-
return r3 ? i2 : i2.endOf(a2);
|
|
19629
|
-
}, "l"), $2 = /* @__PURE__ */ __name(function(t4, e3) {
|
|
19630
|
-
return b3.w(n3.toDate()[t4].apply(n3.toDate("s"), (r3 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n3);
|
|
19631
|
-
}, "$"), y3 = this.$W, M4 = this.$M, m4 = this.$D, v3 = "set" + (this.$u ? "UTC" : "");
|
|
19632
|
-
switch (f3) {
|
|
19633
|
-
case h2:
|
|
19634
|
-
return r3 ? l3(1, 0) : l3(31, 11);
|
|
19635
|
-
case c2:
|
|
19636
|
-
return r3 ? l3(1, M4) : l3(0, M4 + 1);
|
|
19637
|
-
case o2:
|
|
19638
|
-
var g3 = this.$locale().weekStart || 0, D3 = (y3 < g3 ? y3 + 7 : y3) - g3;
|
|
19639
|
-
return l3(r3 ? m4 - D3 : m4 + (6 - D3), M4);
|
|
19640
|
-
case a2:
|
|
19641
|
-
case d2:
|
|
19642
|
-
return $2(v3 + "Hours", 0);
|
|
19643
|
-
case u2:
|
|
19644
|
-
return $2(v3 + "Minutes", 1);
|
|
19645
|
-
case s2:
|
|
19646
|
-
return $2(v3 + "Seconds", 2);
|
|
19647
|
-
case i:
|
|
19648
|
-
return $2(v3 + "Milliseconds", 3);
|
|
19649
|
-
default:
|
|
19650
|
-
return this.clone();
|
|
19641
|
+
};
|
|
19651
19642
|
}
|
|
19652
|
-
|
|
19653
|
-
|
|
19654
|
-
|
|
19655
|
-
|
|
19656
|
-
|
|
19657
|
-
var y3 = this.clone().set(d2, 1);
|
|
19658
|
-
y3.$d[l3]($2), y3.init(), this.$d = y3.set(d2, Math.min(this.$D, y3.daysInMonth())).$d;
|
|
19659
|
-
} else l3 && this.$d[l3]($2);
|
|
19660
|
-
return this.init(), this;
|
|
19661
|
-
}, m3.set = function(t3, e2) {
|
|
19662
|
-
return this.clone().$set(t3, e2);
|
|
19663
|
-
}, m3.get = function(t3) {
|
|
19664
|
-
return this[b3.p(t3)]();
|
|
19665
|
-
}, m3.add = function(r3, f3) {
|
|
19666
|
-
var d3, l3 = this;
|
|
19667
|
-
r3 = Number(r3);
|
|
19668
|
-
var $2 = b3.p(f3), y3 = /* @__PURE__ */ __name(function(t3) {
|
|
19669
|
-
var e2 = O2(l3);
|
|
19670
|
-
return b3.w(e2.date(e2.date() + Math.round(t3 * r3)), l3);
|
|
19671
|
-
}, "y");
|
|
19672
|
-
if ($2 === c2) return this.set(c2, this.$M + r3);
|
|
19673
|
-
if ($2 === h2) return this.set(h2, this.$y + r3);
|
|
19674
|
-
if ($2 === a2) return y3(1);
|
|
19675
|
-
if ($2 === o2) return y3(7);
|
|
19676
|
-
var M4 = (d3 = {}, d3[s2] = e, d3[u2] = n2, d3[i] = t2, d3)[$2] || 1, m4 = this.$d.getTime() + r3 * M4;
|
|
19677
|
-
return b3.w(m4, this);
|
|
19678
|
-
}, m3.subtract = function(t3, e2) {
|
|
19679
|
-
return this.add(-1 * t3, e2);
|
|
19680
|
-
}, m3.format = function(t3) {
|
|
19681
|
-
var e2 = this, n3 = this.$locale();
|
|
19682
|
-
if (!this.isValid()) return n3.invalidDate || l2;
|
|
19683
|
-
var r3 = t3 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b3.z(this), s3 = this.$H, u3 = this.$m, a3 = this.$M, o3 = n3.weekdays, c3 = n3.months, f3 = n3.meridiem, h3 = /* @__PURE__ */ __name(function(t4, n4, i3, s4) {
|
|
19684
|
-
return t4 && (t4[n4] || t4(e2, r3)) || i3[n4].slice(0, s4);
|
|
19685
|
-
}, "h"), d3 = /* @__PURE__ */ __name(function(t4) {
|
|
19686
|
-
return b3.s(s3 % 12 || 12, t4, "0");
|
|
19687
|
-
}, "d"), $2 = f3 || function(t4, e3, n4) {
|
|
19688
|
-
var r4 = t4 < 12 ? "AM" : "PM";
|
|
19689
|
-
return n4 ? r4.toLowerCase() : r4;
|
|
19643
|
+
return {
|
|
19644
|
+
_or: [
|
|
19645
|
+
{ [filterOn]: { _eq: "" } },
|
|
19646
|
+
{ [filterOn]: { _is_null: true } }
|
|
19647
|
+
]
|
|
19690
19648
|
};
|
|
19691
|
-
|
|
19692
|
-
|
|
19693
|
-
|
|
19694
|
-
|
|
19695
|
-
|
|
19696
|
-
|
|
19697
|
-
|
|
19698
|
-
|
|
19699
|
-
|
|
19700
|
-
|
|
19701
|
-
|
|
19702
|
-
|
|
19703
|
-
|
|
19704
|
-
|
|
19705
|
-
|
|
19706
|
-
|
|
19707
|
-
|
|
19708
|
-
|
|
19709
|
-
|
|
19710
|
-
|
|
19711
|
-
|
|
19712
|
-
|
|
19713
|
-
|
|
19714
|
-
|
|
19715
|
-
|
|
19716
|
-
|
|
19717
|
-
|
|
19718
|
-
|
|
19719
|
-
|
|
19720
|
-
case "HH":
|
|
19721
|
-
return b3.s(s3, 2, "0");
|
|
19722
|
-
case "h":
|
|
19723
|
-
return d3(1);
|
|
19724
|
-
case "hh":
|
|
19725
|
-
return d3(2);
|
|
19726
|
-
case "a":
|
|
19727
|
-
return $2(s3, u3, true);
|
|
19728
|
-
case "A":
|
|
19729
|
-
return $2(s3, u3, false);
|
|
19730
|
-
case "m":
|
|
19731
|
-
return String(u3);
|
|
19732
|
-
case "mm":
|
|
19733
|
-
return b3.s(u3, 2, "0");
|
|
19734
|
-
case "s":
|
|
19735
|
-
return String(e2.$s);
|
|
19736
|
-
case "ss":
|
|
19737
|
-
return b3.s(e2.$s, 2, "0");
|
|
19738
|
-
case "SSS":
|
|
19739
|
-
return b3.s(e2.$ms, 3, "0");
|
|
19740
|
-
case "Z":
|
|
19741
|
-
return i2;
|
|
19649
|
+
case "notEmpty":
|
|
19650
|
+
return {
|
|
19651
|
+
_and: [
|
|
19652
|
+
{ [filterOn]: { _neq: "" } },
|
|
19653
|
+
{ [filterOn]: { _is_null: false } }
|
|
19654
|
+
]
|
|
19655
|
+
};
|
|
19656
|
+
case "inList":
|
|
19657
|
+
return { [filterOn]: { _in: filterValue } };
|
|
19658
|
+
case "notInList":
|
|
19659
|
+
return { [filterOn]: { _nin: filterValue } };
|
|
19660
|
+
case "true":
|
|
19661
|
+
return { [filterOn]: { _eq: true } };
|
|
19662
|
+
case "false":
|
|
19663
|
+
return { [filterOn]: { _eq: false } };
|
|
19664
|
+
case "dateIs":
|
|
19665
|
+
return { [filterOn]: { _eq: filterValue } };
|
|
19666
|
+
case "notBetween":
|
|
19667
|
+
return {
|
|
19668
|
+
_or: [
|
|
19669
|
+
{
|
|
19670
|
+
[filterOn]: {
|
|
19671
|
+
_lt: new Date(arrayFilterValue[0])
|
|
19672
|
+
}
|
|
19673
|
+
},
|
|
19674
|
+
{
|
|
19675
|
+
[filterOn]: {
|
|
19676
|
+
_gt: new Date(new Date(arrayFilterValue[1]).setHours(23, 59))
|
|
19677
|
+
}
|
|
19742
19678
|
}
|
|
19743
|
-
|
|
19744
|
-
|
|
19745
|
-
|
|
19746
|
-
|
|
19747
|
-
|
|
19748
|
-
|
|
19749
|
-
|
|
19750
|
-
|
|
19751
|
-
}
|
|
19752
|
-
|
|
19753
|
-
|
|
19754
|
-
|
|
19679
|
+
]
|
|
19680
|
+
};
|
|
19681
|
+
case "isBetween":
|
|
19682
|
+
return {
|
|
19683
|
+
[filterOn]: {
|
|
19684
|
+
_gte: new Date(arrayFilterValue[0]),
|
|
19685
|
+
_lte: new Date(new Date(arrayFilterValue[1]).setHours(23, 59))
|
|
19686
|
+
}
|
|
19687
|
+
};
|
|
19688
|
+
case "isBefore":
|
|
19689
|
+
return { [filterOn]: { _lt: new Date(filterValue) } };
|
|
19690
|
+
case "isAfter":
|
|
19691
|
+
return { [filterOn]: { _gt: new Date(filterValue) } };
|
|
19692
|
+
case "greaterThan":
|
|
19693
|
+
return { [filterOn]: { _gt: parseFloat(filterValue) } };
|
|
19694
|
+
case "lessThan":
|
|
19695
|
+
return { [filterOn]: { _lt: parseFloat(filterValue) } };
|
|
19696
|
+
case "inRange":
|
|
19697
|
+
return {
|
|
19698
|
+
[filterOn]: {
|
|
19699
|
+
_gte: parseFloat(arrayFilterValue[0]),
|
|
19700
|
+
_lte: parseFloat(arrayFilterValue[1])
|
|
19701
|
+
}
|
|
19702
|
+
};
|
|
19703
|
+
case "outsideRange":
|
|
19704
|
+
return {
|
|
19705
|
+
_or: [
|
|
19706
|
+
{
|
|
19707
|
+
[filterOn]: {
|
|
19708
|
+
_lt: parseFloat(arrayFilterValue[0])
|
|
19709
|
+
}
|
|
19710
|
+
},
|
|
19711
|
+
{
|
|
19712
|
+
[filterOn]: {
|
|
19713
|
+
_gt: parseFloat(arrayFilterValue[1])
|
|
19714
|
+
}
|
|
19715
|
+
}
|
|
19716
|
+
]
|
|
19717
|
+
};
|
|
19718
|
+
case "equalTo":
|
|
19719
|
+
return {
|
|
19720
|
+
[filterOn]: {
|
|
19721
|
+
_eq: type2 === "number" || type2 === "integer" ? parseFloat(filterValue) : filterValue
|
|
19722
|
+
}
|
|
19723
|
+
};
|
|
19724
|
+
case "regex":
|
|
19725
|
+
return { [filterOn]: { _regex: filterValue } };
|
|
19726
|
+
default:
|
|
19727
|
+
console.warn(`Unsupported filter type: ${selectedFilter}`);
|
|
19728
|
+
return {};
|
|
19729
|
+
}
|
|
19730
|
+
});
|
|
19731
|
+
if (filterClauses.length > 0) {
|
|
19732
|
+
if (Object.keys(where).length > 0) {
|
|
19733
|
+
where = { _and: [where, ...filterClauses] };
|
|
19734
|
+
} else {
|
|
19735
|
+
where = { _and: filterClauses };
|
|
19736
|
+
}
|
|
19737
|
+
}
|
|
19738
|
+
}
|
|
19739
|
+
if (order2 && order2.length > 0) {
|
|
19740
|
+
order2.forEach((item) => {
|
|
19741
|
+
const field = item.startsWith("-") ? item.substring(1) : item;
|
|
19742
|
+
const direction = item.startsWith("-") ? "desc" : "asc";
|
|
19743
|
+
order_by.push({ [field]: direction });
|
|
19744
|
+
});
|
|
19745
|
+
}
|
|
19746
|
+
if (additionalFilter) {
|
|
19747
|
+
where = { _and: [where, additionalFilter] };
|
|
19748
|
+
}
|
|
19749
|
+
return { where, order_by, limit, offset: offset4 };
|
|
19750
|
+
}
|
|
19751
|
+
__name(tableQueryParamsToHasuraClauses, "tableQueryParamsToHasuraClauses");
|
|
19752
|
+
function getFieldsMappedByCCDisplayName(schema2) {
|
|
19753
|
+
if (!schema2 || !schema2.fields) return {};
|
|
19754
|
+
return schema2.fields.reduce((acc, field) => {
|
|
19755
|
+
const ccDisplayName = getCCDisplayName(field);
|
|
19756
|
+
acc[ccDisplayName] = field;
|
|
19757
|
+
return acc;
|
|
19758
|
+
}, {});
|
|
19759
|
+
}
|
|
19760
|
+
__name(getFieldsMappedByCCDisplayName, "getFieldsMappedByCCDisplayName");
|
|
19761
|
+
function getCCDisplayName(field) {
|
|
19762
|
+
return camelCase(
|
|
19763
|
+
typeof field.displayName === "string" ? field.displayName : field.path
|
|
19764
|
+
);
|
|
19765
|
+
}
|
|
19766
|
+
__name(getCCDisplayName, "getCCDisplayName");
|
|
19767
|
+
function filterLocalEntitiesToHasura(records, { where, order_by, limit, offset: offset4, isInfinite } = {}) {
|
|
19768
|
+
let filteredRecords = [...records];
|
|
19769
|
+
if (where) {
|
|
19770
|
+
filteredRecords = applyWhereClause(filteredRecords, where);
|
|
19771
|
+
}
|
|
19772
|
+
if (order_by) {
|
|
19773
|
+
filteredRecords = applyOrderBy(filteredRecords, order_by);
|
|
19774
|
+
}
|
|
19775
|
+
filteredRecords = restoreEntitiesFromLocalFilter(filteredRecords);
|
|
19776
|
+
const allFilteredRecords = [...filteredRecords];
|
|
19777
|
+
if (!isInfinite && offset4 !== void 0) {
|
|
19778
|
+
filteredRecords = filteredRecords.slice(offset4);
|
|
19779
|
+
}
|
|
19780
|
+
if (!isInfinite && limit !== void 0) {
|
|
19781
|
+
filteredRecords = filteredRecords.slice(0, limit);
|
|
19782
|
+
}
|
|
19783
|
+
return {
|
|
19784
|
+
entities: filteredRecords,
|
|
19785
|
+
entitiesAcrossPages: allFilteredRecords,
|
|
19786
|
+
entityCount: allFilteredRecords.length
|
|
19787
|
+
};
|
|
19788
|
+
}
|
|
19789
|
+
__name(filterLocalEntitiesToHasura, "filterLocalEntitiesToHasura");
|
|
19790
|
+
function applyWhereClause(records, where) {
|
|
19791
|
+
function applyFilter(record, filter2) {
|
|
19792
|
+
if (isEmpty$1(filter2)) {
|
|
19793
|
+
return true;
|
|
19794
|
+
}
|
|
19795
|
+
for (const key in filter2) {
|
|
19796
|
+
if (key === "_and") {
|
|
19797
|
+
if (isEmpty$1(filter2[key])) {
|
|
19798
|
+
continue;
|
|
19799
|
+
}
|
|
19800
|
+
if (!every(filter2[key], (subFilter) => applyFilter(record, subFilter))) {
|
|
19801
|
+
return false;
|
|
19802
|
+
}
|
|
19803
|
+
} else if (key === "_or") {
|
|
19804
|
+
if (isEmpty$1(filter2[key])) {
|
|
19805
|
+
continue;
|
|
19806
|
+
}
|
|
19807
|
+
if (!some(filter2[key], (subFilter) => applyFilter(record, subFilter))) {
|
|
19808
|
+
return false;
|
|
19809
|
+
}
|
|
19810
|
+
} else if (key === "_not") {
|
|
19811
|
+
if (applyFilter(record, filter2[key])) {
|
|
19812
|
+
return false;
|
|
19813
|
+
}
|
|
19814
|
+
} else {
|
|
19815
|
+
const value = get$4(record, key);
|
|
19816
|
+
const conditions = filter2[key];
|
|
19817
|
+
if (isObject$2(value) && isObject$2(conditions) && !hasOperator(conditions)) {
|
|
19818
|
+
return applyFilter(value, conditions);
|
|
19819
|
+
}
|
|
19820
|
+
for (const operator in conditions) {
|
|
19821
|
+
const conditionValue = conditions[operator];
|
|
19822
|
+
if (operator === "_gt" && conditions._lt) {
|
|
19823
|
+
if (!(value > conditionValue && value < conditions._lt))
|
|
19824
|
+
return false;
|
|
19825
|
+
continue;
|
|
19826
|
+
}
|
|
19827
|
+
if (operator === "_gte" && conditions._lte) {
|
|
19828
|
+
if (!(value >= conditionValue && value <= conditions._lte))
|
|
19829
|
+
return false;
|
|
19830
|
+
continue;
|
|
19831
|
+
}
|
|
19832
|
+
switch (operator) {
|
|
19833
|
+
case "_eq":
|
|
19834
|
+
if (!isEqual$3(value, conditionValue)) return false;
|
|
19755
19835
|
break;
|
|
19756
|
-
case
|
|
19757
|
-
$
|
|
19836
|
+
case "_neq":
|
|
19837
|
+
if (isEqual$3(value, conditionValue)) return false;
|
|
19758
19838
|
break;
|
|
19759
|
-
case
|
|
19760
|
-
|
|
19839
|
+
case "_gt":
|
|
19840
|
+
if (!(value > conditionValue)) return false;
|
|
19761
19841
|
break;
|
|
19762
|
-
case
|
|
19763
|
-
|
|
19842
|
+
case "_gte":
|
|
19843
|
+
if (!(value >= conditionValue)) return false;
|
|
19764
19844
|
break;
|
|
19765
|
-
case
|
|
19766
|
-
|
|
19845
|
+
case "_lt":
|
|
19846
|
+
if (!(value < conditionValue)) return false;
|
|
19767
19847
|
break;
|
|
19768
|
-
case
|
|
19769
|
-
|
|
19848
|
+
case "_lte":
|
|
19849
|
+
if (!(value <= conditionValue)) return false;
|
|
19770
19850
|
break;
|
|
19771
|
-
case
|
|
19772
|
-
$
|
|
19851
|
+
case "_like":
|
|
19852
|
+
if (!isString$1(value) || !new RegExp(conditionValue.replace(/%/g, ".*")).test(value))
|
|
19853
|
+
return false;
|
|
19773
19854
|
break;
|
|
19774
|
-
case
|
|
19775
|
-
$
|
|
19855
|
+
case "_ilike":
|
|
19856
|
+
if (!isString$1(value) || !new RegExp(conditionValue.replace(/%/g, ".*"), "i").test(value))
|
|
19857
|
+
return false;
|
|
19858
|
+
break;
|
|
19859
|
+
case "_nlike":
|
|
19860
|
+
if (!isString$1(value) || new RegExp(conditionValue.replace(/%/g, ".*")).test(value))
|
|
19861
|
+
return false;
|
|
19862
|
+
break;
|
|
19863
|
+
case "_nilike":
|
|
19864
|
+
if (!isString$1(value) || new RegExp(conditionValue.replace(/%/g, ".*"), "i").test(value))
|
|
19865
|
+
return false;
|
|
19866
|
+
break;
|
|
19867
|
+
case "_starts_with":
|
|
19868
|
+
if (!isString$1(value) || !value.startsWith(conditionValue))
|
|
19869
|
+
return false;
|
|
19870
|
+
break;
|
|
19871
|
+
case "_ends_with":
|
|
19872
|
+
if (!isString$1(value) || !value.endsWith(conditionValue))
|
|
19873
|
+
return false;
|
|
19874
|
+
break;
|
|
19875
|
+
case "_is_null":
|
|
19876
|
+
if (conditionValue && !isNull(value) || !conditionValue && isNull(value))
|
|
19877
|
+
return false;
|
|
19878
|
+
break;
|
|
19879
|
+
case "_contains":
|
|
19880
|
+
if (!isArray$2(value) || !every(conditionValue, (item) => includes(value, item)))
|
|
19881
|
+
return false;
|
|
19882
|
+
break;
|
|
19883
|
+
case "_contained_in":
|
|
19884
|
+
if (!isArray$2(value) || !every(value, (item) => includes(conditionValue, item)))
|
|
19885
|
+
return false;
|
|
19886
|
+
break;
|
|
19887
|
+
case "_has_key":
|
|
19888
|
+
if (!isObject$2(value) || !has$3(value, conditionValue)) return false;
|
|
19889
|
+
break;
|
|
19890
|
+
case "_has_keys_any":
|
|
19891
|
+
if (!isObject$2(value) || !some(conditionValue, (item) => has$3(value, item)))
|
|
19892
|
+
return false;
|
|
19893
|
+
break;
|
|
19894
|
+
case "_has_keys_all":
|
|
19895
|
+
if (!isObject$2(value) || !every(conditionValue, (item) => has$3(value, item)))
|
|
19896
|
+
return false;
|
|
19897
|
+
break;
|
|
19898
|
+
case "_similar":
|
|
19899
|
+
if (!isString$1(value) || !new RegExp(conditionValue.replace(/%/g, ".*")).test(value))
|
|
19900
|
+
return false;
|
|
19776
19901
|
break;
|
|
19777
19902
|
default:
|
|
19778
|
-
|
|
19903
|
+
if (operator.startsWith("_")) {
|
|
19904
|
+
console.warn(`Unsupported operator: ${operator}`);
|
|
19905
|
+
return false;
|
|
19906
|
+
} else {
|
|
19907
|
+
console.warn(`Unsupported operator: ${operator}`);
|
|
19908
|
+
return false;
|
|
19909
|
+
}
|
|
19779
19910
|
}
|
|
19780
|
-
|
|
19781
|
-
|
|
19782
|
-
|
|
19783
|
-
|
|
19784
|
-
|
|
19785
|
-
|
|
19786
|
-
|
|
19787
|
-
|
|
19788
|
-
|
|
19789
|
-
|
|
19790
|
-
|
|
19791
|
-
|
|
19792
|
-
|
|
19793
|
-
|
|
19794
|
-
|
|
19795
|
-
|
|
19796
|
-
|
|
19797
|
-
|
|
19798
|
-
|
|
19799
|
-
|
|
19800
|
-
|
|
19801
|
-
|
|
19802
|
-
|
|
19803
|
-
|
|
19804
|
-
|
|
19805
|
-
|
|
19806
|
-
|
|
19807
|
-
|
|
19808
|
-
|
|
19809
|
-
|
|
19911
|
+
}
|
|
19912
|
+
}
|
|
19913
|
+
}
|
|
19914
|
+
return true;
|
|
19915
|
+
}
|
|
19916
|
+
__name(applyFilter, "applyFilter");
|
|
19917
|
+
function hasOperator(obj) {
|
|
19918
|
+
return Object.keys(obj).some((key) => key.startsWith("_"));
|
|
19919
|
+
}
|
|
19920
|
+
__name(hasOperator, "hasOperator");
|
|
19921
|
+
return records.filter((record) => applyFilter(record, where));
|
|
19922
|
+
}
|
|
19923
|
+
__name(applyWhereClause, "applyWhereClause");
|
|
19924
|
+
function applyOrderBy(records, _order_by) {
|
|
19925
|
+
const order_by = isArray$2(_order_by) ? _order_by : isEmpty$1(_order_by) ? [] : [_order_by];
|
|
19926
|
+
if (order_by.length > 0) {
|
|
19927
|
+
const orderFuncs = [];
|
|
19928
|
+
const ascOrDescArray = [];
|
|
19929
|
+
order_by.forEach(
|
|
19930
|
+
({ path: path2, direction, type: type2, sortFn, getValueToFilterOn, ownProps }) => {
|
|
19931
|
+
direction = direction || "desc";
|
|
19932
|
+
if (sortFn) {
|
|
19933
|
+
const sortFnArray = Array.isArray(sortFn) ? sortFn : [sortFn];
|
|
19934
|
+
sortFnArray.forEach((fn4) => {
|
|
19935
|
+
const getter = typeof fn4 === "function" ? fn4 : (r2) => get$4(r2, fn4);
|
|
19936
|
+
orderFuncs.push((r2) => {
|
|
19937
|
+
const val2 = getter(r2);
|
|
19938
|
+
return val2 !== null && val2 !== void 0 ? 1 : 0;
|
|
19939
|
+
});
|
|
19940
|
+
ascOrDescArray.push("desc");
|
|
19941
|
+
orderFuncs.push(getter);
|
|
19942
|
+
ascOrDescArray.push(direction);
|
|
19943
|
+
});
|
|
19944
|
+
} else if (getValueToFilterOn) {
|
|
19945
|
+
orderFuncs.push((r2) => {
|
|
19946
|
+
const val2 = getValueToFilterOn(r2, ownProps);
|
|
19947
|
+
return val2 !== null && val2 !== void 0 ? 1 : 0;
|
|
19948
|
+
});
|
|
19949
|
+
ascOrDescArray.push("desc");
|
|
19950
|
+
orderFuncs.push((r2) => getValueToFilterOn(r2, ownProps));
|
|
19951
|
+
ascOrDescArray.push(direction);
|
|
19952
|
+
} else if (type2 === "timestamp") {
|
|
19953
|
+
orderFuncs.push((r2) => {
|
|
19954
|
+
const val2 = get$4(r2, path2);
|
|
19955
|
+
return val2 ? 1 : 0;
|
|
19956
|
+
});
|
|
19957
|
+
ascOrDescArray.push("desc");
|
|
19958
|
+
orderFuncs.push((r2) => {
|
|
19959
|
+
const val2 = get$4(r2, path2);
|
|
19960
|
+
return val2 ? new Date(val2).getTime() : -Infinity;
|
|
19961
|
+
});
|
|
19962
|
+
ascOrDescArray.push(direction);
|
|
19963
|
+
} else if (path2 && endsWith$1(path2.toLowerCase(), "id")) {
|
|
19964
|
+
orderFuncs.push((r2) => {
|
|
19965
|
+
const val2 = get$4(r2, path2);
|
|
19966
|
+
return val2 !== null && val2 !== void 0 ? 1 : 0;
|
|
19967
|
+
});
|
|
19968
|
+
ascOrDescArray.push("desc");
|
|
19969
|
+
orderFuncs.push((o2) => {
|
|
19970
|
+
const val2 = get$4(o2, path2);
|
|
19971
|
+
if (val2 === null || val2 === void 0) return -Infinity;
|
|
19972
|
+
return parseInt(val2, 10) || 0;
|
|
19973
|
+
});
|
|
19974
|
+
ascOrDescArray.push(direction);
|
|
19975
|
+
} else {
|
|
19976
|
+
orderFuncs.push((r2) => {
|
|
19977
|
+
const val2 = get$4(r2, path2);
|
|
19978
|
+
return val2 !== null && val2 !== void 0 ? 1 : 0;
|
|
19979
|
+
});
|
|
19980
|
+
ascOrDescArray.push("desc");
|
|
19981
|
+
orderFuncs.push((r2) => {
|
|
19982
|
+
const val2 = get$4(r2, path2);
|
|
19983
|
+
if (val2 === null || val2 === void 0) return -Infinity;
|
|
19984
|
+
if (isString$1(val2)) {
|
|
19985
|
+
return val2.toLowerCase().replace(
|
|
19986
|
+
/(\d+)/g,
|
|
19987
|
+
(num) => (
|
|
19988
|
+
// Pad numbers with leading zeros for proper natural sort
|
|
19989
|
+
num.padStart(10, "0")
|
|
19990
|
+
)
|
|
19991
|
+
);
|
|
19992
|
+
}
|
|
19993
|
+
return val2;
|
|
19994
|
+
});
|
|
19995
|
+
ascOrDescArray.push(direction);
|
|
19996
|
+
}
|
|
19997
|
+
}
|
|
19998
|
+
);
|
|
19999
|
+
records = orderBy$1(records, orderFuncs, ascOrDescArray);
|
|
20000
|
+
}
|
|
20001
|
+
return records;
|
|
20002
|
+
}
|
|
20003
|
+
__name(applyOrderBy, "applyOrderBy");
|
|
20004
|
+
function restoreEntitiesFromLocalFilter(ents) {
|
|
20005
|
+
return ents.map((entity) => {
|
|
20006
|
+
forEach$1(entity, (val2, key) => {
|
|
20007
|
+
var _a2;
|
|
20008
|
+
if ((_a2 = key.startsWith) == null ? void 0 : _a2.call(key, "___original___")) {
|
|
20009
|
+
entity[key.slice("___original___".length)] = val2;
|
|
20010
|
+
delete entity[key];
|
|
20011
|
+
}
|
|
19810
20012
|
});
|
|
19811
|
-
|
|
19812
|
-
|
|
20013
|
+
return entity;
|
|
20014
|
+
});
|
|
19813
20015
|
}
|
|
19814
|
-
__name(
|
|
19815
|
-
|
|
19816
|
-
|
|
20016
|
+
__name(restoreEntitiesFromLocalFilter, "restoreEntitiesFromLocalFilter");
|
|
20017
|
+
function initializeHasuraWhereAndFilter(additionalFilter, where = {}, currentParams) {
|
|
20018
|
+
where._and = where._and || [];
|
|
20019
|
+
where._or = where._or || [];
|
|
20020
|
+
if (typeof additionalFilter === "function") {
|
|
20021
|
+
const newWhere = additionalFilter(where, currentParams);
|
|
20022
|
+
if (newWhere) {
|
|
20023
|
+
Object.assign(where, newWhere);
|
|
20024
|
+
}
|
|
20025
|
+
} else if (typeof additionalFilter === "object")
|
|
20026
|
+
where._and.push(additionalFilter);
|
|
20027
|
+
}
|
|
20028
|
+
__name(initializeHasuraWhereAndFilter, "initializeHasuraWhereAndFilter");
|
|
19817
20029
|
const defaultPageSizes = [5, 10, 15, 25, 50, 100, 200, 400];
|
|
19818
20030
|
function safeStringify(val2) {
|
|
19819
20031
|
if (val2 !== null && typeof val2 === "object") {
|
|
@@ -19830,325 +20042,6 @@ function safeParse(val2) {
|
|
|
19830
20042
|
}
|
|
19831
20043
|
}
|
|
19832
20044
|
__name(safeParse, "safeParse");
|
|
19833
|
-
function getCCDisplayName(field) {
|
|
19834
|
-
return camelCase(
|
|
19835
|
-
typeof field.displayName === "string" ? field.displayName : field.path
|
|
19836
|
-
);
|
|
19837
|
-
}
|
|
19838
|
-
__name(getCCDisplayName, "getCCDisplayName");
|
|
19839
|
-
function getFieldsMappedByCCDisplayName(schema2) {
|
|
19840
|
-
return schema2.fields.reduce((acc, field) => {
|
|
19841
|
-
const ccDisplayName = getCCDisplayName(field);
|
|
19842
|
-
acc[ccDisplayName] = field;
|
|
19843
|
-
return acc;
|
|
19844
|
-
}, {});
|
|
19845
|
-
}
|
|
19846
|
-
__name(getFieldsMappedByCCDisplayName, "getFieldsMappedByCCDisplayName");
|
|
19847
|
-
function orderEntitiesLocal(orderArray, entities, schema2, ownProps) {
|
|
19848
|
-
if (orderArray == null ? void 0 : orderArray.length) {
|
|
19849
|
-
const orderFuncs = [];
|
|
19850
|
-
const ascOrDescArray = [];
|
|
19851
|
-
orderArray.forEach((order2) => {
|
|
19852
|
-
const ccDisplayName = order2.replace(/^-/gi, "");
|
|
19853
|
-
const ccFields = getFieldsMappedByCCDisplayName(schema2);
|
|
19854
|
-
const field = ccFields[ccDisplayName];
|
|
19855
|
-
if (!field) {
|
|
19856
|
-
throw new Error(
|
|
19857
|
-
"Ruh roh, there should have been a column to sort on for " + order2 + " but none was found in " + schema2.fields
|
|
19858
|
-
);
|
|
19859
|
-
}
|
|
19860
|
-
const { path: path2, getValueToFilterOn, sortFn } = field;
|
|
19861
|
-
if (field.type === "timestamp") {
|
|
19862
|
-
ascOrDescArray.push("desc");
|
|
19863
|
-
}
|
|
19864
|
-
ascOrDescArray.push(ccDisplayName === order2 ? "asc" : "desc");
|
|
19865
|
-
if (field.type === "timestamp") {
|
|
19866
|
-
orderFuncs.push((r2) => {
|
|
19867
|
-
const val2 = get$4(r2, path2);
|
|
19868
|
-
return !!val2;
|
|
19869
|
-
});
|
|
19870
|
-
}
|
|
19871
|
-
if (path2 && endsWith$1(path2.toLowerCase(), "id")) {
|
|
19872
|
-
orderFuncs.push((o2) => {
|
|
19873
|
-
return parseInt(get$4(o2, path2), 10);
|
|
19874
|
-
});
|
|
19875
|
-
} else if (sortFn) {
|
|
19876
|
-
const toOrder = Array.isArray(sortFn) ? sortFn : [sortFn];
|
|
19877
|
-
orderFuncs.push(...toOrder);
|
|
19878
|
-
} else if (getValueToFilterOn) {
|
|
19879
|
-
orderFuncs.push((o2) => {
|
|
19880
|
-
return getValueToFilterOn(o2, ownProps);
|
|
19881
|
-
});
|
|
19882
|
-
} else {
|
|
19883
|
-
orderFuncs.push((r2) => {
|
|
19884
|
-
const val2 = get$4(r2, path2);
|
|
19885
|
-
return val2 && val2.toLowerCase ? val2.toLowerCase() : val2;
|
|
19886
|
-
});
|
|
19887
|
-
}
|
|
19888
|
-
});
|
|
19889
|
-
entities = orderBy$1(entities, orderFuncs, ascOrDescArray);
|
|
19890
|
-
}
|
|
19891
|
-
return entities;
|
|
19892
|
-
}
|
|
19893
|
-
__name(orderEntitiesLocal, "orderEntitiesLocal");
|
|
19894
|
-
function getAndAndOrFilters(allFilters) {
|
|
19895
|
-
const orFilters = [];
|
|
19896
|
-
const andFilters = [];
|
|
19897
|
-
const otherOrFilters = [];
|
|
19898
|
-
allFilters.forEach((filter2) => {
|
|
19899
|
-
if (filter2.isOrFilter && typeof filter2.filterValue === "string" && filter2.filterValue.includes(",")) {
|
|
19900
|
-
const allFilterValues = filter2.filterValue.split(",");
|
|
19901
|
-
allFilterValues.forEach((filterValue, i) => {
|
|
19902
|
-
filterValue = filterValue.trim();
|
|
19903
|
-
if (!filterValue) return;
|
|
19904
|
-
const newFilter = __spreadProps(__spreadValues({}, filter2), {
|
|
19905
|
-
filterValue
|
|
19906
|
-
});
|
|
19907
|
-
if (i === 0) {
|
|
19908
|
-
orFilters.push(newFilter);
|
|
19909
|
-
} else {
|
|
19910
|
-
const iMinus = i - 1;
|
|
19911
|
-
if (!otherOrFilters[iMinus]) otherOrFilters[iMinus] = [];
|
|
19912
|
-
otherOrFilters[iMinus].push(newFilter);
|
|
19913
|
-
}
|
|
19914
|
-
});
|
|
19915
|
-
} else if (filter2.isOrFilter) {
|
|
19916
|
-
orFilters.push(filter2);
|
|
19917
|
-
} else {
|
|
19918
|
-
andFilters.push(filter2);
|
|
19919
|
-
}
|
|
19920
|
-
});
|
|
19921
|
-
return {
|
|
19922
|
-
orFilters,
|
|
19923
|
-
andFilters,
|
|
19924
|
-
otherOrFilters
|
|
19925
|
-
};
|
|
19926
|
-
}
|
|
19927
|
-
__name(getAndAndOrFilters, "getAndAndOrFilters");
|
|
19928
|
-
function filterEntitiesLocal(filters = [], searchTerm, entities, schema2, ownProps) {
|
|
19929
|
-
const allFilters = getAllFilters(filters, searchTerm, schema2);
|
|
19930
|
-
if (allFilters.length) {
|
|
19931
|
-
const ccFields = getFieldsMappedByCCDisplayName(schema2);
|
|
19932
|
-
const { andFilters, orFilters, otherOrFilters } = getAndAndOrFilters(allFilters);
|
|
19933
|
-
andFilters.forEach((filter2) => {
|
|
19934
|
-
entities = getEntitiesForGivenFilter(
|
|
19935
|
-
entities,
|
|
19936
|
-
filter2,
|
|
19937
|
-
ccFields,
|
|
19938
|
-
ownProps
|
|
19939
|
-
);
|
|
19940
|
-
});
|
|
19941
|
-
if (orFilters.length) {
|
|
19942
|
-
let orEntities = [];
|
|
19943
|
-
orFilters.concat(...otherOrFilters).forEach((filter2) => {
|
|
19944
|
-
orEntities = orEntities.concat(
|
|
19945
|
-
getEntitiesForGivenFilter(entities, filter2, ccFields, ownProps)
|
|
19946
|
-
);
|
|
19947
|
-
});
|
|
19948
|
-
entities = uniq(orEntities);
|
|
19949
|
-
}
|
|
19950
|
-
}
|
|
19951
|
-
return entities;
|
|
19952
|
-
}
|
|
19953
|
-
__name(filterEntitiesLocal, "filterEntitiesLocal");
|
|
19954
|
-
function cleanFilterValue(_filterValue, type2) {
|
|
19955
|
-
let filterValue = _filterValue;
|
|
19956
|
-
if (type2 === "number" || type2 === "integer") {
|
|
19957
|
-
filterValue = Array.isArray(filterValue) ? filterValue.map((val2) => Number(val2)) : Number(filterValue);
|
|
19958
|
-
}
|
|
19959
|
-
return filterValue;
|
|
19960
|
-
}
|
|
19961
|
-
__name(cleanFilterValue, "cleanFilterValue");
|
|
19962
|
-
function getEntitiesForGivenFilter(entities, filter2, ccFields, ownProps) {
|
|
19963
|
-
const { filterOn, filterValue: _filterValue, selectedFilter } = filter2;
|
|
19964
|
-
const field = ccFields[filterOn];
|
|
19965
|
-
const { path: path2, getValueToFilterOn } = field;
|
|
19966
|
-
const filterValue = cleanFilterValue(_filterValue, field.type);
|
|
19967
|
-
const subFilter = getSubFilter(false, selectedFilter, filterValue);
|
|
19968
|
-
entities = entities.filter((entity) => {
|
|
19969
|
-
const fieldVal = getValueToFilterOn ? getValueToFilterOn(entity, ownProps) : get$4(entity, path2);
|
|
19970
|
-
const shouldKeep = subFilter(fieldVal);
|
|
19971
|
-
return shouldKeep;
|
|
19972
|
-
});
|
|
19973
|
-
return entities;
|
|
19974
|
-
}
|
|
19975
|
-
__name(getEntitiesForGivenFilter, "getEntitiesForGivenFilter");
|
|
19976
|
-
function getFiltersFromSearchTerm(searchTerm, schema2) {
|
|
19977
|
-
const searchTermFilters = [];
|
|
19978
|
-
if (searchTerm) {
|
|
19979
|
-
const sharedFields = {
|
|
19980
|
-
isOrFilter: true,
|
|
19981
|
-
isSearchTermFilter: true
|
|
19982
|
-
};
|
|
19983
|
-
schema2.fields.forEach((field) => {
|
|
19984
|
-
const { type: type2, searchDisabled } = field;
|
|
19985
|
-
if (searchDisabled || field.filterDisabled || type2 === "color") return;
|
|
19986
|
-
const ccDisplayName = getCCDisplayName(field);
|
|
19987
|
-
const filterValue = cleanFilterValue(searchTerm, type2);
|
|
19988
|
-
if (type2 === "string" || type2 === "lookup") {
|
|
19989
|
-
searchTermFilters.push(__spreadProps(__spreadValues({}, sharedFields), {
|
|
19990
|
-
filterOn: ccDisplayName,
|
|
19991
|
-
filterValue: searchTerm,
|
|
19992
|
-
selectedFilter: "contains"
|
|
19993
|
-
}));
|
|
19994
|
-
} else if (type2 === "boolean") {
|
|
19995
|
-
let regex;
|
|
19996
|
-
try {
|
|
19997
|
-
regex = new RegExp("^" + searchTerm, "ig");
|
|
19998
|
-
} catch (error) {
|
|
19999
|
-
}
|
|
20000
|
-
if (regex) {
|
|
20001
|
-
if ("true".replace(regex, "") !== "true") {
|
|
20002
|
-
searchTermFilters.push(__spreadProps(__spreadValues({}, sharedFields), {
|
|
20003
|
-
filterOn: ccDisplayName,
|
|
20004
|
-
filterValue: true,
|
|
20005
|
-
selectedFilter: "true"
|
|
20006
|
-
}));
|
|
20007
|
-
} else if ("false".replace(regex, "") !== "false") {
|
|
20008
|
-
searchTermFilters.push(__spreadProps(__spreadValues({}, sharedFields), {
|
|
20009
|
-
filterOn: ccDisplayName,
|
|
20010
|
-
filterValue: false,
|
|
20011
|
-
selectedFilter: "false"
|
|
20012
|
-
}));
|
|
20013
|
-
}
|
|
20014
|
-
}
|
|
20015
|
-
} else if ((type2 === "number" || type2 === "integer") && !isNaN(filterValue)) {
|
|
20016
|
-
if (type2 === "integer" && !isInteger(filterValue)) {
|
|
20017
|
-
return;
|
|
20018
|
-
}
|
|
20019
|
-
searchTermFilters.push(__spreadProps(__spreadValues({}, sharedFields), {
|
|
20020
|
-
filterOn: ccDisplayName,
|
|
20021
|
-
filterValue,
|
|
20022
|
-
selectedFilter: "equalTo"
|
|
20023
|
-
}));
|
|
20024
|
-
}
|
|
20025
|
-
});
|
|
20026
|
-
}
|
|
20027
|
-
return searchTermFilters;
|
|
20028
|
-
}
|
|
20029
|
-
__name(getFiltersFromSearchTerm, "getFiltersFromSearchTerm");
|
|
20030
|
-
function getSubFilter(qb, selectedFilter, filterValue) {
|
|
20031
|
-
const ccSelectedFilter = camelCase(selectedFilter);
|
|
20032
|
-
let stringFilterValue = filterValue && filterValue.toString ? filterValue.toString() : filterValue;
|
|
20033
|
-
if (stringFilterValue === false) {
|
|
20034
|
-
stringFilterValue = "false";
|
|
20035
|
-
} else {
|
|
20036
|
-
stringFilterValue = stringFilterValue || "";
|
|
20037
|
-
}
|
|
20038
|
-
const filterValLower = stringFilterValue.toLowerCase && stringFilterValue.toLowerCase();
|
|
20039
|
-
const arrayFilterValue = Array.isArray(filterValue) ? filterValue : stringFilterValue.split(";");
|
|
20040
|
-
if (ccSelectedFilter === "startsWith") {
|
|
20041
|
-
return qb ? qb.startsWith(stringFilterValue) : (fieldVal) => {
|
|
20042
|
-
if (!fieldVal || !fieldVal.toLowerCase) return false;
|
|
20043
|
-
return startsWith(fieldVal.toLowerCase(), filterValLower);
|
|
20044
|
-
};
|
|
20045
|
-
} else if (ccSelectedFilter === "endsWith") {
|
|
20046
|
-
return qb ? qb.endsWith(stringFilterValue) : (fieldVal) => {
|
|
20047
|
-
if (!fieldVal || !fieldVal.toLowerCase) return false;
|
|
20048
|
-
return endsWith$1(fieldVal.toLowerCase(), filterValLower);
|
|
20049
|
-
};
|
|
20050
|
-
} else if (ccSelectedFilter === "contains" || ccSelectedFilter === "notContains") {
|
|
20051
|
-
return qb ? ccSelectedFilter === "contains" ? qb.contains(stringFilterValue.replace(/_/g, "\\_")) : qb.notContains(stringFilterValue.replace(/_/g, "\\_")) : (fieldVal) => {
|
|
20052
|
-
if (!fieldVal || !fieldVal.toLowerCase) return false;
|
|
20053
|
-
return ccSelectedFilter === "contains" ? fieldVal.toLowerCase().replace(filterValLower, "") !== fieldVal.toLowerCase() : fieldVal.toLowerCase().replace(filterValLower, "") === fieldVal.toLowerCase();
|
|
20054
|
-
};
|
|
20055
|
-
} else if (ccSelectedFilter === "inList") {
|
|
20056
|
-
return qb ? qb.inList(arrayFilterValue) : (fieldVal) => {
|
|
20057
|
-
if (!(fieldVal == null ? void 0 : fieldVal.toString)) return false;
|
|
20058
|
-
return arrayFilterValue.map((val2) => {
|
|
20059
|
-
if (val2) {
|
|
20060
|
-
if (val2.toString) return val2.toString().toLowerCase();
|
|
20061
|
-
return val2.toLowerCase();
|
|
20062
|
-
}
|
|
20063
|
-
return void 0;
|
|
20064
|
-
}).indexOf(fieldVal.toString().toLowerCase()) > -1;
|
|
20065
|
-
};
|
|
20066
|
-
} else if (ccSelectedFilter === "notInList") {
|
|
20067
|
-
return qb ? qb.notInList(arrayFilterValue) : (fieldVal) => {
|
|
20068
|
-
if (!(fieldVal == null ? void 0 : fieldVal.toString)) return false;
|
|
20069
|
-
return arrayFilterValue.map((val2) => {
|
|
20070
|
-
if (val2) {
|
|
20071
|
-
if (val2.toString) return val2.toString().toLowerCase();
|
|
20072
|
-
return val2.toLowerCase();
|
|
20073
|
-
}
|
|
20074
|
-
return void 0;
|
|
20075
|
-
}).indexOf(fieldVal.toString().toLowerCase()) === -1;
|
|
20076
|
-
};
|
|
20077
|
-
} else if (ccSelectedFilter === "isEmpty") {
|
|
20078
|
-
return qb ? qb.isEmpty() : (fieldVal) => {
|
|
20079
|
-
return !fieldVal;
|
|
20080
|
-
};
|
|
20081
|
-
} else if (ccSelectedFilter === "notEmpty") {
|
|
20082
|
-
return qb ? [qb.notNull(), qb.notEquals("")] : (fieldVal) => {
|
|
20083
|
-
return !!fieldVal;
|
|
20084
|
-
};
|
|
20085
|
-
} else if (ccSelectedFilter === "isExactly") {
|
|
20086
|
-
return qb ? filterValue : (fieldVal) => {
|
|
20087
|
-
return fieldVal === filterValue;
|
|
20088
|
-
};
|
|
20089
|
-
} else if (ccSelectedFilter === "true") {
|
|
20090
|
-
return qb ? qb.equals(true) : (fieldVal) => {
|
|
20091
|
-
return !!fieldVal;
|
|
20092
|
-
};
|
|
20093
|
-
} else if (ccSelectedFilter === "false") {
|
|
20094
|
-
return qb ? qb.equals(false) : (fieldVal) => {
|
|
20095
|
-
return !fieldVal;
|
|
20096
|
-
};
|
|
20097
|
-
} else if (ccSelectedFilter === "isBetween") {
|
|
20098
|
-
return qb ? qb.between(
|
|
20099
|
-
new Date(arrayFilterValue[0]),
|
|
20100
|
-
new Date(new Date(arrayFilterValue[1]).setHours(23, 59))
|
|
20101
|
-
// set end of day for more accurate filtering
|
|
20102
|
-
) : (fieldVal) => {
|
|
20103
|
-
return dayjs(arrayFilterValue[0]).valueOf() <= dayjs(fieldVal).valueOf() && dayjs(fieldVal).valueOf() <= dayjs(arrayFilterValue[1]).valueOf();
|
|
20104
|
-
};
|
|
20105
|
-
} else if (ccSelectedFilter === "notBetween") {
|
|
20106
|
-
return qb ? qb.notBetween(
|
|
20107
|
-
new Date(arrayFilterValue[0]),
|
|
20108
|
-
new Date(new Date(arrayFilterValue[1]).setHours(23, 59))
|
|
20109
|
-
// set end of day for more accurate filtering
|
|
20110
|
-
) : (fieldVal) => {
|
|
20111
|
-
return dayjs(arrayFilterValue[0]).valueOf() > dayjs(fieldVal).valueOf() || dayjs(fieldVal).valueOf() > dayjs(arrayFilterValue[1]).valueOf();
|
|
20112
|
-
};
|
|
20113
|
-
} else if (ccSelectedFilter === "isBefore") {
|
|
20114
|
-
return qb ? qb.lessThan(new Date(filterValue)) : (fieldVal) => {
|
|
20115
|
-
return dayjs(fieldVal).valueOf() < dayjs(filterValue).valueOf();
|
|
20116
|
-
};
|
|
20117
|
-
} else if (ccSelectedFilter === "isAfter") {
|
|
20118
|
-
return qb ? qb.greaterThan(new Date(new Date(filterValue).setHours(23, 59))) : (fieldVal) => {
|
|
20119
|
-
return dayjs(fieldVal).valueOf() > dayjs(filterValue).valueOf();
|
|
20120
|
-
};
|
|
20121
|
-
} else if (ccSelectedFilter === "greaterThan") {
|
|
20122
|
-
return qb ? qb.greaterThan(filterValue) : (fieldVal) => {
|
|
20123
|
-
return fieldVal > filterValue;
|
|
20124
|
-
};
|
|
20125
|
-
} else if (ccSelectedFilter === "lessThan") {
|
|
20126
|
-
return qb ? qb.lessThan(filterValue) : (fieldVal) => {
|
|
20127
|
-
return fieldVal < filterValue;
|
|
20128
|
-
};
|
|
20129
|
-
} else if (ccSelectedFilter === "inRange") {
|
|
20130
|
-
return qb ? qb.between(filterValue[0], filterValue[1]) : (fieldVal) => {
|
|
20131
|
-
return filterValue[0] <= fieldVal && fieldVal <= filterValue[1];
|
|
20132
|
-
};
|
|
20133
|
-
} else if (ccSelectedFilter === "outsideRange") {
|
|
20134
|
-
return qb ? qb.notBetween(filterValue[0], filterValue[1]) : (fieldVal) => {
|
|
20135
|
-
return filterValue[0] > fieldVal || fieldVal > filterValue[1];
|
|
20136
|
-
};
|
|
20137
|
-
} else if (ccSelectedFilter === "equalTo") {
|
|
20138
|
-
return qb ? filterValue : (fieldVal) => {
|
|
20139
|
-
return fieldVal === filterValue;
|
|
20140
|
-
};
|
|
20141
|
-
} else if (ccSelectedFilter === "regex") {
|
|
20142
|
-
return qb ? qb.matchesRegex(filterValue) : (fieldVal) => {
|
|
20143
|
-
new RegExp(filterValue).test(fieldVal);
|
|
20144
|
-
return fieldVal;
|
|
20145
|
-
};
|
|
20146
|
-
}
|
|
20147
|
-
throw new Error(
|
|
20148
|
-
`Unsupported filter ${selectedFilter}. Please make a new filter if you need one`
|
|
20149
|
-
);
|
|
20150
|
-
}
|
|
20151
|
-
__name(getSubFilter, "getSubFilter");
|
|
20152
20045
|
function getCurrentParamsFromUrl(location2, isSimple) {
|
|
20153
20046
|
let { search: search2 } = location2;
|
|
20154
20047
|
return parseFilters(queryString.parse(search2, { ignoreQueryPrefix: true }));
|
|
@@ -20212,22 +20105,6 @@ function parseFilters(newParams) {
|
|
|
20212
20105
|
});
|
|
20213
20106
|
}
|
|
20214
20107
|
__name(parseFilters, "parseFilters");
|
|
20215
|
-
function buildRef(qb, reference2, searchField, expression) {
|
|
20216
|
-
if (reference2.reference) {
|
|
20217
|
-
return qb.related(reference2.target).whereAny({
|
|
20218
|
-
[reference2.sourceField]: buildRef(
|
|
20219
|
-
qb,
|
|
20220
|
-
reference2.reference,
|
|
20221
|
-
searchField,
|
|
20222
|
-
expression
|
|
20223
|
-
)
|
|
20224
|
-
});
|
|
20225
|
-
}
|
|
20226
|
-
return qb.related(reference2.target).whereAny({
|
|
20227
|
-
[searchField]: expression
|
|
20228
|
-
});
|
|
20229
|
-
}
|
|
20230
|
-
__name(buildRef, "buildRef");
|
|
20231
20108
|
function makeDataTableHandlers({
|
|
20232
20109
|
setNewParams,
|
|
20233
20110
|
defaults: defaults2,
|
|
@@ -20315,27 +20192,19 @@ function makeDataTableHandlers({
|
|
|
20315
20192
|
};
|
|
20316
20193
|
}
|
|
20317
20194
|
__name(makeDataTableHandlers, "makeDataTableHandlers");
|
|
20318
|
-
function
|
|
20319
|
-
|
|
20320
|
-
|
|
20321
|
-
|
|
20322
|
-
|
|
20323
|
-
|
|
20324
|
-
|
|
20325
|
-
|
|
20326
|
-
|
|
20327
|
-
|
|
20328
|
-
function getAllFilters(filters, searchTerm, schema2) {
|
|
20329
|
-
let allFilters = [
|
|
20330
|
-
...filters,
|
|
20331
|
-
...getFiltersFromSearchTerm(searchTerm, schema2)
|
|
20332
|
-
];
|
|
20333
|
-
allFilters = allFilters.filter((val2) => {
|
|
20334
|
-
return val2 !== "";
|
|
20195
|
+
function cleanupFilters({ filters, ccFields }) {
|
|
20196
|
+
(filters || []).forEach((filter2) => {
|
|
20197
|
+
const { filterOn, filterValue } = filter2;
|
|
20198
|
+
const field = ccFields[filterOn];
|
|
20199
|
+
if (field.type === "number" || field.type === "integer") {
|
|
20200
|
+
filter2.filterValue = Array.isArray(filterValue) ? filterValue.map((val2) => Number(val2)) : Number(filterValue);
|
|
20201
|
+
}
|
|
20202
|
+
if (filter2.selectedFilter === "inList" && typeof filter2.filterValue === "number") {
|
|
20203
|
+
filter2.filterValue = filter2.filterValue.toString();
|
|
20204
|
+
}
|
|
20335
20205
|
});
|
|
20336
|
-
return allFilters.map(cleanupFilter);
|
|
20337
20206
|
}
|
|
20338
|
-
__name(
|
|
20207
|
+
__name(cleanupFilters, "cleanupFilters");
|
|
20339
20208
|
function getQueryParams({
|
|
20340
20209
|
currentParams,
|
|
20341
20210
|
urlConnected,
|
|
@@ -20345,88 +20214,45 @@ function getQueryParams({
|
|
|
20345
20214
|
entities,
|
|
20346
20215
|
isLocalCall,
|
|
20347
20216
|
additionalFilter,
|
|
20348
|
-
additionalOrFilter,
|
|
20349
20217
|
doNotCoercePageSize,
|
|
20350
20218
|
noOrderError,
|
|
20351
20219
|
isCodeModel,
|
|
20352
20220
|
ownProps
|
|
20353
20221
|
}) {
|
|
20354
|
-
|
|
20355
|
-
|
|
20356
|
-
|
|
20222
|
+
let errorParsingUrlString;
|
|
20223
|
+
try {
|
|
20224
|
+
Object.keys(currentParams).forEach(function(key) {
|
|
20225
|
+
if (currentParams[key] === void 0) {
|
|
20226
|
+
delete currentParams[key];
|
|
20227
|
+
}
|
|
20228
|
+
});
|
|
20229
|
+
const tableQueryParams = __spreadValues(__spreadValues({}, defaults2), currentParams);
|
|
20230
|
+
let { page, pageSize, searchTerm, filters, order: order2 } = tableQueryParams;
|
|
20231
|
+
const ccFields = getFieldsMappedByCCDisplayName(schema2);
|
|
20232
|
+
cleanupFilters({ filters, ccFields });
|
|
20233
|
+
if (page <= 0 || isNaN(page)) {
|
|
20234
|
+
page = void 0;
|
|
20357
20235
|
}
|
|
20358
|
-
});
|
|
20359
|
-
const tableQueryParams = __spreadValues(__spreadValues({}, defaults2), currentParams);
|
|
20360
|
-
let { page, pageSize, searchTerm, filters, order: order2 } = tableQueryParams;
|
|
20361
|
-
if (page <= 0 || isNaN(page)) {
|
|
20362
|
-
page = void 0;
|
|
20363
|
-
}
|
|
20364
|
-
if (isInfinite) {
|
|
20365
|
-
page = void 0;
|
|
20366
|
-
pageSize = void 0;
|
|
20367
|
-
}
|
|
20368
|
-
if (pageSize !== void 0 && !doNotCoercePageSize) {
|
|
20369
|
-
const closest2 = clone$1(window.tgPageSizes || defaultPageSizes).sort(
|
|
20370
|
-
(a2, b3) => Math.abs(pageSize - a2) - Math.abs(pageSize - b3)
|
|
20371
|
-
)[0];
|
|
20372
|
-
pageSize = closest2;
|
|
20373
|
-
}
|
|
20374
|
-
const toReturn = {
|
|
20375
|
-
//these are values that might be generally useful for the wrapped component
|
|
20376
|
-
page,
|
|
20377
|
-
pageSize: ownProps.controlled_pageSize || pageSize,
|
|
20378
|
-
order: order2,
|
|
20379
|
-
filters,
|
|
20380
|
-
searchTerm
|
|
20381
|
-
};
|
|
20382
|
-
if (isLocalCall) {
|
|
20383
|
-
let newEntities = entities;
|
|
20384
|
-
newEntities = filterEntitiesLocal(
|
|
20385
|
-
filters,
|
|
20386
|
-
searchTerm,
|
|
20387
|
-
newEntities,
|
|
20388
|
-
schema2,
|
|
20389
|
-
ownProps
|
|
20390
|
-
);
|
|
20391
|
-
newEntities = orderEntitiesLocal(order2, newEntities, schema2, ownProps);
|
|
20392
|
-
const entitiesAcrossPages = newEntities;
|
|
20393
|
-
const newEntityCount = newEntities.length;
|
|
20394
|
-
if (!isInfinite && !ownProps.controlled_pageSize) {
|
|
20395
|
-
const offset4 = (page - 1) * pageSize;
|
|
20396
|
-
newEntities = take(drop$2(newEntities, offset4), pageSize);
|
|
20397
|
-
}
|
|
20398
|
-
toReturn.entities = newEntities;
|
|
20399
|
-
toReturn.entitiesAcrossPages = entitiesAcrossPages;
|
|
20400
|
-
toReturn.entityCount = newEntityCount;
|
|
20401
|
-
return toReturn;
|
|
20402
|
-
} else {
|
|
20403
|
-
const graphqlQueryParams = {
|
|
20404
|
-
// need to make sure sort exists because of https://github.com/apollographql/apollo-client/issues/3077
|
|
20405
|
-
sort: []
|
|
20406
|
-
};
|
|
20407
20236
|
if (isInfinite) {
|
|
20408
|
-
|
|
20409
|
-
|
|
20410
|
-
}
|
|
20411
|
-
|
|
20412
|
-
|
|
20413
|
-
|
|
20414
|
-
|
|
20415
|
-
|
|
20416
|
-
|
|
20417
|
-
const
|
|
20418
|
-
if (
|
|
20419
|
-
|
|
20237
|
+
page = void 0;
|
|
20238
|
+
pageSize = void 0;
|
|
20239
|
+
}
|
|
20240
|
+
if (pageSize !== void 0 && !doNotCoercePageSize) {
|
|
20241
|
+
const closest2 = clone$1(window.tgPageSizes || defaultPageSizes).sort(
|
|
20242
|
+
(a2, b3) => Math.abs(pageSize - a2) - Math.abs(pageSize - b3)
|
|
20243
|
+
)[0];
|
|
20244
|
+
pageSize = closest2;
|
|
20245
|
+
}
|
|
20246
|
+
const cleanedOrder = [];
|
|
20247
|
+
if (order2 && order2.length) {
|
|
20248
|
+
order2.forEach((orderVal) => {
|
|
20420
20249
|
const ccDisplayName = orderVal.replace(/^-/gi, "");
|
|
20421
20250
|
const schemaForField = ccFields[ccDisplayName];
|
|
20422
20251
|
if (schemaForField) {
|
|
20423
20252
|
const { path: path2 } = schemaForField;
|
|
20424
20253
|
const reversed = ccDisplayName !== orderVal;
|
|
20425
20254
|
const prefix2 = reversed ? "-" : "";
|
|
20426
|
-
|
|
20427
|
-
...graphqlQueryParams.sort || [],
|
|
20428
|
-
prefix2 + path2
|
|
20429
|
-
];
|
|
20255
|
+
cleanedOrder.push(prefix2 + path2);
|
|
20430
20256
|
} else {
|
|
20431
20257
|
!noOrderError && console.error(
|
|
20432
20258
|
"No schema for field found!",
|
|
@@ -20436,167 +20262,104 @@ function getQueryParams({
|
|
|
20436
20262
|
}
|
|
20437
20263
|
});
|
|
20438
20264
|
}
|
|
20439
|
-
let
|
|
20440
|
-
|
|
20441
|
-
|
|
20442
|
-
|
|
20443
|
-
|
|
20444
|
-
|
|
20445
|
-
|
|
20446
|
-
|
|
20447
|
-
const {
|
|
20448
|
-
|
|
20449
|
-
|
|
20450
|
-
|
|
20451
|
-
|
|
20452
|
-
|
|
20453
|
-
|
|
20454
|
-
|
|
20455
|
-
|
|
20456
|
-
|
|
20457
|
-
|
|
20458
|
-
|
|
20459
|
-
|
|
20460
|
-
|
|
20461
|
-
|
|
20462
|
-
|
|
20463
|
-
|
|
20464
|
-
|
|
20465
|
-
|
|
20466
|
-
|
|
20467
|
-
|
|
20468
|
-
|
|
20469
|
-
|
|
20470
|
-
|
|
20471
|
-
|
|
20472
|
-
|
|
20473
|
-
|
|
20474
|
-
|
|
20475
|
-
}
|
|
20476
|
-
const columnCustomFilters = getColumnCustomFilters(
|
|
20477
|
-
andFilters,
|
|
20478
|
-
qb,
|
|
20479
|
-
ccFields
|
|
20265
|
+
let toRet = {
|
|
20266
|
+
//these are values that might be generally useful for the wrapped component
|
|
20267
|
+
page,
|
|
20268
|
+
pageSize: ownProps.controlled_pageSize || pageSize,
|
|
20269
|
+
order: cleanedOrder,
|
|
20270
|
+
filters,
|
|
20271
|
+
searchTerm
|
|
20272
|
+
};
|
|
20273
|
+
const { where, order_by, limit, offset: offset4 } = tableQueryParamsToHasuraClauses({
|
|
20274
|
+
page,
|
|
20275
|
+
pageSize,
|
|
20276
|
+
searchTerm,
|
|
20277
|
+
filters,
|
|
20278
|
+
order: cleanedOrder,
|
|
20279
|
+
schema: schema2
|
|
20280
|
+
});
|
|
20281
|
+
initializeHasuraWhereAndFilter(additionalFilter, where, currentParams);
|
|
20282
|
+
if (isLocalCall) {
|
|
20283
|
+
const r2 = filterLocalEntitiesToHasura(
|
|
20284
|
+
prepEntitiesForLocalFilter({ entities, ccFields }),
|
|
20285
|
+
{
|
|
20286
|
+
where,
|
|
20287
|
+
order_by: (Array.isArray(order_by) ? order_by : [order_by]).map(
|
|
20288
|
+
(obj) => {
|
|
20289
|
+
const path2 = Object.keys(obj)[0];
|
|
20290
|
+
return __spreadValues({
|
|
20291
|
+
path: path2,
|
|
20292
|
+
direction: obj[path2],
|
|
20293
|
+
ownProps
|
|
20294
|
+
}, ccFields[path2]);
|
|
20295
|
+
}
|
|
20296
|
+
),
|
|
20297
|
+
limit,
|
|
20298
|
+
offset: offset4,
|
|
20299
|
+
isInfinite
|
|
20300
|
+
}
|
|
20480
20301
|
);
|
|
20481
|
-
|
|
20482
|
-
|
|
20483
|
-
|
|
20484
|
-
|
|
20485
|
-
|
|
20486
|
-
errorParsingUrlString = e;
|
|
20487
|
-
console.error(
|
|
20488
|
-
"The following error occurred when trying to build the query params. This is probably due to a malformed URL:",
|
|
20489
|
-
e
|
|
20490
|
-
);
|
|
20491
|
-
} else {
|
|
20492
|
-
console.error("Error building query params from filter:");
|
|
20493
|
-
throw e;
|
|
20302
|
+
toRet = __spreadValues(__spreadValues({}, toRet), r2);
|
|
20303
|
+
return toRet;
|
|
20304
|
+
} else {
|
|
20305
|
+
if (!order_by.length) {
|
|
20306
|
+
order_by.push({ updatedAt: "desc" });
|
|
20494
20307
|
}
|
|
20308
|
+
order_by.push(
|
|
20309
|
+
isCodeModel ? { code: "asc" } : { [window.__sortId || "id"]: "asc" }
|
|
20310
|
+
);
|
|
20311
|
+
return __spreadProps(__spreadValues({}, toRet), {
|
|
20312
|
+
variables: {
|
|
20313
|
+
where,
|
|
20314
|
+
order_by,
|
|
20315
|
+
limit,
|
|
20316
|
+
offset: offset4
|
|
20317
|
+
}
|
|
20318
|
+
});
|
|
20495
20319
|
}
|
|
20496
|
-
|
|
20497
|
-
|
|
20498
|
-
|
|
20499
|
-
|
|
20500
|
-
|
|
20320
|
+
} catch (e) {
|
|
20321
|
+
if (urlConnected) {
|
|
20322
|
+
errorParsingUrlString = e;
|
|
20323
|
+
console.error(
|
|
20324
|
+
"The following error occurred when trying to build the query params. This is probably due to a malformed URL:",
|
|
20325
|
+
e
|
|
20326
|
+
);
|
|
20327
|
+
return {
|
|
20328
|
+
errorParsingUrlString,
|
|
20329
|
+
variables: {
|
|
20330
|
+
where: {},
|
|
20331
|
+
order_by: [],
|
|
20332
|
+
limit: 0,
|
|
20333
|
+
offset: 0
|
|
20334
|
+
}
|
|
20335
|
+
};
|
|
20336
|
+
} else {
|
|
20337
|
+
console.error("Error building query params from filter:");
|
|
20338
|
+
throw e;
|
|
20501
20339
|
}
|
|
20502
|
-
graphqlQueryParams.sort.push(
|
|
20503
|
-
isCodeModel ? "code" : window.__sortId || "id"
|
|
20504
|
-
);
|
|
20505
|
-
return __spreadProps(__spreadValues({}, toReturn), {
|
|
20506
|
-
//the query params will get passed directly to as variables to the graphql query
|
|
20507
|
-
variables: graphqlQueryParams,
|
|
20508
|
-
errorParsingUrlString
|
|
20509
|
-
});
|
|
20510
20340
|
}
|
|
20511
20341
|
}
|
|
20512
20342
|
__name(getQueryParams, "getQueryParams");
|
|
20513
|
-
function
|
|
20514
|
-
const
|
|
20515
|
-
|
|
20516
|
-
|
|
20517
|
-
|
|
20518
|
-
|
|
20519
|
-
|
|
20520
|
-
|
|
20521
|
-
|
|
20522
|
-
|
|
20523
|
-
);
|
|
20524
|
-
}
|
|
20525
|
-
}
|
|
20526
|
-
const _subFilters = getSubFilter(qb, selectedFilter, filterValueToUse);
|
|
20527
|
-
let filterField;
|
|
20528
|
-
if (fieldSchema) {
|
|
20529
|
-
const { path: path2, reference: reference2 } = fieldSchema;
|
|
20530
|
-
if (reference2) {
|
|
20531
|
-
filterField = reference2.sourceField;
|
|
20532
|
-
} else {
|
|
20533
|
-
filterField = path2;
|
|
20534
|
-
}
|
|
20535
|
-
} else if (filterOn === "id") {
|
|
20536
|
-
filterField = filterOn;
|
|
20537
|
-
} else {
|
|
20538
|
-
console.error("Trying to filter on unknown field");
|
|
20539
|
-
}
|
|
20540
|
-
const subFiltersToUse = [];
|
|
20541
|
-
const subFilters = Array.isArray(_subFilters) ? _subFilters : [_subFilters];
|
|
20542
|
-
subFilters.forEach((subFilter) => {
|
|
20543
|
-
let subFilterToUse = subFilter;
|
|
20544
|
-
if (fieldSchema) {
|
|
20545
|
-
const { path: path2, reference: reference2 } = fieldSchema;
|
|
20546
|
-
if (reference2) {
|
|
20547
|
-
subFilterToUse = buildRef(
|
|
20548
|
-
qb,
|
|
20549
|
-
reference2,
|
|
20550
|
-
last$1(path2.split(".")),
|
|
20551
|
-
subFilter
|
|
20552
|
-
);
|
|
20343
|
+
function prepEntitiesForLocalFilter({ entities, ccFields }) {
|
|
20344
|
+
const r2 = entities.map((entity) => {
|
|
20345
|
+
const toSpread = {};
|
|
20346
|
+
let hasChanged = false;
|
|
20347
|
+
forEach$1(ccFields, ({ getValueToFilterOn, path: path2 }) => {
|
|
20348
|
+
if (getValueToFilterOn) {
|
|
20349
|
+
hasChanged = true;
|
|
20350
|
+
toSpread["___original___" + path2] = entity[path2];
|
|
20351
|
+
const value = getValueToFilterOn(entity);
|
|
20352
|
+
toSpread[path2] = value;
|
|
20553
20353
|
}
|
|
20354
|
+
});
|
|
20355
|
+
if (hasChanged) {
|
|
20356
|
+
return __spreadValues(__spreadValues({}, entity), toSpread);
|
|
20554
20357
|
}
|
|
20555
|
-
|
|
20358
|
+
return entity;
|
|
20556
20359
|
});
|
|
20557
|
-
return
|
|
20558
|
-
path: filterField,
|
|
20559
|
-
subFilters: subFiltersToUse
|
|
20560
|
-
};
|
|
20561
|
-
}
|
|
20562
|
-
__name(getSubFiltersAndPath, "getSubFiltersAndPath");
|
|
20563
|
-
function getQueries(filters, qb, ccFields) {
|
|
20564
|
-
const subQueries = filters.reduce((acc, filter2) => {
|
|
20565
|
-
if (!filter2) {
|
|
20566
|
-
console.warn("We should always have a filter object!");
|
|
20567
|
-
return acc;
|
|
20568
|
-
}
|
|
20569
|
-
const { filterOn } = filter2;
|
|
20570
|
-
const fieldSchema = ccFields[filterOn];
|
|
20571
|
-
if (!filter2.isSearchTermFilter && (fieldSchema == null ? void 0 : fieldSchema.additionalColumnFilter))
|
|
20572
|
-
return acc;
|
|
20573
|
-
const { path: path2, subFilters } = getSubFiltersAndPath(filter2, qb, ccFields);
|
|
20574
|
-
acc[path2] = subFilters;
|
|
20575
|
-
return acc;
|
|
20576
|
-
}, {});
|
|
20577
|
-
return subQueries;
|
|
20578
|
-
}
|
|
20579
|
-
__name(getQueries, "getQueries");
|
|
20580
|
-
function getColumnCustomFilters(filters, qb, ccFields) {
|
|
20581
|
-
const subQueries = filters.reduce((acc, filter2) => {
|
|
20582
|
-
if (!filter2) {
|
|
20583
|
-
console.warn("We should always have a filter object!");
|
|
20584
|
-
return acc;
|
|
20585
|
-
}
|
|
20586
|
-
const { filterOn } = filter2;
|
|
20587
|
-
const fieldSchema = ccFields[filterOn];
|
|
20588
|
-
if (filter2.isSearchTermFilter || !(fieldSchema == null ? void 0 : fieldSchema.additionalColumnFilter)) {
|
|
20589
|
-
return acc;
|
|
20590
|
-
}
|
|
20591
|
-
const { path: path2, subFilters } = getSubFiltersAndPath(filter2, qb, ccFields);
|
|
20592
|
-
subFilters.forEach((subFilter) => {
|
|
20593
|
-
acc.push(fieldSchema.additionalColumnFilter(qb, subFilter, path2));
|
|
20594
|
-
});
|
|
20595
|
-
return acc;
|
|
20596
|
-
}, []);
|
|
20597
|
-
return subQueries;
|
|
20360
|
+
return r2;
|
|
20598
20361
|
}
|
|
20599
|
-
__name(
|
|
20362
|
+
__name(prepEntitiesForLocalFilter, "prepEntitiesForLocalFilter");
|
|
20600
20363
|
function PagingInput({ disabled, onBlur, defaultPage }) {
|
|
20601
20364
|
const [page, setPage] = useState(defaultPage);
|
|
20602
20365
|
const defaultValue2 = useRef(defaultPage);
|
|
@@ -32400,7 +32163,15 @@ function requireColor() {
|
|
|
32400
32163
|
__name(requireColor, "requireColor");
|
|
32401
32164
|
var colorExports = requireColor();
|
|
32402
32165
|
const Color = /* @__PURE__ */ getDefaultExportFromCjs(colorExports);
|
|
32403
|
-
|
|
32166
|
+
function determineBlackOrWhiteTextColor(c2) {
|
|
32167
|
+
try {
|
|
32168
|
+
return Color(c2).isLight() ? "#000000" : "#FFFFFF";
|
|
32169
|
+
} catch (e) {
|
|
32170
|
+
console.error("Error in color parsing:", e);
|
|
32171
|
+
return "#000000";
|
|
32172
|
+
}
|
|
32173
|
+
}
|
|
32174
|
+
__name(determineBlackOrWhiteTextColor, "determineBlackOrWhiteTextColor");
|
|
32404
32175
|
function getTagsAndTagOptions(allTags) {
|
|
32405
32176
|
return flatMap(allTags, (tag) => {
|
|
32406
32177
|
if (tag.tagOptions && tag.tagOptions.length) {
|
|
@@ -32987,6 +32758,293 @@ const InfoHelper = /* @__PURE__ */ __name((_e) => {
|
|
|
32987
32758
|
toReturn
|
|
32988
32759
|
);
|
|
32989
32760
|
}, "InfoHelper");
|
|
32761
|
+
var dayjs_min$1 = { exports: {} };
|
|
32762
|
+
var dayjs_min = dayjs_min$1.exports;
|
|
32763
|
+
var hasRequiredDayjs_min;
|
|
32764
|
+
function requireDayjs_min() {
|
|
32765
|
+
if (hasRequiredDayjs_min) return dayjs_min$1.exports;
|
|
32766
|
+
hasRequiredDayjs_min = 1;
|
|
32767
|
+
(function(module2, exports2) {
|
|
32768
|
+
!function(t2, e) {
|
|
32769
|
+
module2.exports = e();
|
|
32770
|
+
}(dayjs_min, function() {
|
|
32771
|
+
var t2 = 1e3, e = 6e4, n2 = 36e5, r2 = "millisecond", i = "second", s2 = "minute", u2 = "hour", a2 = "day", o2 = "week", c2 = "month", f2 = "quarter", h2 = "year", d2 = "date", l2 = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y2 = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M2 = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: /* @__PURE__ */ __name(function(t3) {
|
|
32772
|
+
var e2 = ["th", "st", "nd", "rd"], n3 = t3 % 100;
|
|
32773
|
+
return "[" + t3 + (e2[(n3 - 20) % 10] || e2[n3] || e2[0]) + "]";
|
|
32774
|
+
}, "ordinal") }, m2 = /* @__PURE__ */ __name(function(t3, e2, n3) {
|
|
32775
|
+
var r3 = String(t3);
|
|
32776
|
+
return !r3 || r3.length >= e2 ? t3 : "" + Array(e2 + 1 - r3.length).join(n3) + t3;
|
|
32777
|
+
}, "m"), v2 = { s: m2, z: /* @__PURE__ */ __name(function(t3) {
|
|
32778
|
+
var e2 = -t3.utcOffset(), n3 = Math.abs(e2), r3 = Math.floor(n3 / 60), i2 = n3 % 60;
|
|
32779
|
+
return (e2 <= 0 ? "+" : "-") + m2(r3, 2, "0") + ":" + m2(i2, 2, "0");
|
|
32780
|
+
}, "z"), m: /* @__PURE__ */ __name(function t3(e2, n3) {
|
|
32781
|
+
if (e2.date() < n3.date()) return -t3(n3, e2);
|
|
32782
|
+
var r3 = 12 * (n3.year() - e2.year()) + (n3.month() - e2.month()), i2 = e2.clone().add(r3, c2), s3 = n3 - i2 < 0, u3 = e2.clone().add(r3 + (s3 ? -1 : 1), c2);
|
|
32783
|
+
return +(-(r3 + (n3 - i2) / (s3 ? i2 - u3 : u3 - i2)) || 0);
|
|
32784
|
+
}, "t"), a: /* @__PURE__ */ __name(function(t3) {
|
|
32785
|
+
return t3 < 0 ? Math.ceil(t3) || 0 : Math.floor(t3);
|
|
32786
|
+
}, "a"), p: /* @__PURE__ */ __name(function(t3) {
|
|
32787
|
+
return { M: c2, y: h2, w: o2, d: a2, D: d2, h: u2, m: s2, s: i, ms: r2, Q: f2 }[t3] || String(t3 || "").toLowerCase().replace(/s$/, "");
|
|
32788
|
+
}, "p"), u: /* @__PURE__ */ __name(function(t3) {
|
|
32789
|
+
return void 0 === t3;
|
|
32790
|
+
}, "u") }, g2 = "en", D2 = {};
|
|
32791
|
+
D2[g2] = M2;
|
|
32792
|
+
var p2 = "$isDayjsObject", S2 = /* @__PURE__ */ __name(function(t3) {
|
|
32793
|
+
return t3 instanceof _2 || !(!t3 || !t3[p2]);
|
|
32794
|
+
}, "S"), w2 = /* @__PURE__ */ __name(function t3(e2, n3, r3) {
|
|
32795
|
+
var i2;
|
|
32796
|
+
if (!e2) return g2;
|
|
32797
|
+
if ("string" == typeof e2) {
|
|
32798
|
+
var s3 = e2.toLowerCase();
|
|
32799
|
+
D2[s3] && (i2 = s3), n3 && (D2[s3] = n3, i2 = s3);
|
|
32800
|
+
var u3 = e2.split("-");
|
|
32801
|
+
if (!i2 && u3.length > 1) return t3(u3[0]);
|
|
32802
|
+
} else {
|
|
32803
|
+
var a3 = e2.name;
|
|
32804
|
+
D2[a3] = e2, i2 = a3;
|
|
32805
|
+
}
|
|
32806
|
+
return !r3 && i2 && (g2 = i2), i2 || !r3 && g2;
|
|
32807
|
+
}, "t"), O2 = /* @__PURE__ */ __name(function(t3, e2) {
|
|
32808
|
+
if (S2(t3)) return t3.clone();
|
|
32809
|
+
var n3 = "object" == typeof e2 ? e2 : {};
|
|
32810
|
+
return n3.date = t3, n3.args = arguments, new _2(n3);
|
|
32811
|
+
}, "O"), b3 = v2;
|
|
32812
|
+
b3.l = w2, b3.i = S2, b3.w = function(t3, e2) {
|
|
32813
|
+
return O2(t3, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
|
|
32814
|
+
};
|
|
32815
|
+
var _2 = function() {
|
|
32816
|
+
function M3(t3) {
|
|
32817
|
+
this.$L = w2(t3.locale, null, true), this.parse(t3), this.$x = this.$x || t3.x || {}, this[p2] = true;
|
|
32818
|
+
}
|
|
32819
|
+
__name(M3, "M");
|
|
32820
|
+
var m3 = M3.prototype;
|
|
32821
|
+
return m3.parse = function(t3) {
|
|
32822
|
+
this.$d = function(t4) {
|
|
32823
|
+
var e2 = t4.date, n3 = t4.utc;
|
|
32824
|
+
if (null === e2) return /* @__PURE__ */ new Date(NaN);
|
|
32825
|
+
if (b3.u(e2)) return /* @__PURE__ */ new Date();
|
|
32826
|
+
if (e2 instanceof Date) return new Date(e2);
|
|
32827
|
+
if ("string" == typeof e2 && !/Z$/i.test(e2)) {
|
|
32828
|
+
var r3 = e2.match($);
|
|
32829
|
+
if (r3) {
|
|
32830
|
+
var i2 = r3[2] - 1 || 0, s3 = (r3[7] || "0").substring(0, 3);
|
|
32831
|
+
return n3 ? new Date(Date.UTC(r3[1], i2, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3)) : new Date(r3[1], i2, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3);
|
|
32832
|
+
}
|
|
32833
|
+
}
|
|
32834
|
+
return new Date(e2);
|
|
32835
|
+
}(t3), this.init();
|
|
32836
|
+
}, m3.init = function() {
|
|
32837
|
+
var t3 = this.$d;
|
|
32838
|
+
this.$y = t3.getFullYear(), this.$M = t3.getMonth(), this.$D = t3.getDate(), this.$W = t3.getDay(), this.$H = t3.getHours(), this.$m = t3.getMinutes(), this.$s = t3.getSeconds(), this.$ms = t3.getMilliseconds();
|
|
32839
|
+
}, m3.$utils = function() {
|
|
32840
|
+
return b3;
|
|
32841
|
+
}, m3.isValid = function() {
|
|
32842
|
+
return !(this.$d.toString() === l2);
|
|
32843
|
+
}, m3.isSame = function(t3, e2) {
|
|
32844
|
+
var n3 = O2(t3);
|
|
32845
|
+
return this.startOf(e2) <= n3 && n3 <= this.endOf(e2);
|
|
32846
|
+
}, m3.isAfter = function(t3, e2) {
|
|
32847
|
+
return O2(t3) < this.startOf(e2);
|
|
32848
|
+
}, m3.isBefore = function(t3, e2) {
|
|
32849
|
+
return this.endOf(e2) < O2(t3);
|
|
32850
|
+
}, m3.$g = function(t3, e2, n3) {
|
|
32851
|
+
return b3.u(t3) ? this[e2] : this.set(n3, t3);
|
|
32852
|
+
}, m3.unix = function() {
|
|
32853
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
32854
|
+
}, m3.valueOf = function() {
|
|
32855
|
+
return this.$d.getTime();
|
|
32856
|
+
}, m3.startOf = function(t3, e2) {
|
|
32857
|
+
var n3 = this, r3 = !!b3.u(e2) || e2, f3 = b3.p(t3), l3 = /* @__PURE__ */ __name(function(t4, e3) {
|
|
32858
|
+
var i2 = b3.w(n3.$u ? Date.UTC(n3.$y, e3, t4) : new Date(n3.$y, e3, t4), n3);
|
|
32859
|
+
return r3 ? i2 : i2.endOf(a2);
|
|
32860
|
+
}, "l"), $2 = /* @__PURE__ */ __name(function(t4, e3) {
|
|
32861
|
+
return b3.w(n3.toDate()[t4].apply(n3.toDate("s"), (r3 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n3);
|
|
32862
|
+
}, "$"), y3 = this.$W, M4 = this.$M, m4 = this.$D, v3 = "set" + (this.$u ? "UTC" : "");
|
|
32863
|
+
switch (f3) {
|
|
32864
|
+
case h2:
|
|
32865
|
+
return r3 ? l3(1, 0) : l3(31, 11);
|
|
32866
|
+
case c2:
|
|
32867
|
+
return r3 ? l3(1, M4) : l3(0, M4 + 1);
|
|
32868
|
+
case o2:
|
|
32869
|
+
var g3 = this.$locale().weekStart || 0, D3 = (y3 < g3 ? y3 + 7 : y3) - g3;
|
|
32870
|
+
return l3(r3 ? m4 - D3 : m4 + (6 - D3), M4);
|
|
32871
|
+
case a2:
|
|
32872
|
+
case d2:
|
|
32873
|
+
return $2(v3 + "Hours", 0);
|
|
32874
|
+
case u2:
|
|
32875
|
+
return $2(v3 + "Minutes", 1);
|
|
32876
|
+
case s2:
|
|
32877
|
+
return $2(v3 + "Seconds", 2);
|
|
32878
|
+
case i:
|
|
32879
|
+
return $2(v3 + "Milliseconds", 3);
|
|
32880
|
+
default:
|
|
32881
|
+
return this.clone();
|
|
32882
|
+
}
|
|
32883
|
+
}, m3.endOf = function(t3) {
|
|
32884
|
+
return this.startOf(t3, false);
|
|
32885
|
+
}, m3.$set = function(t3, e2) {
|
|
32886
|
+
var n3, o3 = b3.p(t3), f3 = "set" + (this.$u ? "UTC" : ""), l3 = (n3 = {}, n3[a2] = f3 + "Date", n3[d2] = f3 + "Date", n3[c2] = f3 + "Month", n3[h2] = f3 + "FullYear", n3[u2] = f3 + "Hours", n3[s2] = f3 + "Minutes", n3[i] = f3 + "Seconds", n3[r2] = f3 + "Milliseconds", n3)[o3], $2 = o3 === a2 ? this.$D + (e2 - this.$W) : e2;
|
|
32887
|
+
if (o3 === c2 || o3 === h2) {
|
|
32888
|
+
var y3 = this.clone().set(d2, 1);
|
|
32889
|
+
y3.$d[l3]($2), y3.init(), this.$d = y3.set(d2, Math.min(this.$D, y3.daysInMonth())).$d;
|
|
32890
|
+
} else l3 && this.$d[l3]($2);
|
|
32891
|
+
return this.init(), this;
|
|
32892
|
+
}, m3.set = function(t3, e2) {
|
|
32893
|
+
return this.clone().$set(t3, e2);
|
|
32894
|
+
}, m3.get = function(t3) {
|
|
32895
|
+
return this[b3.p(t3)]();
|
|
32896
|
+
}, m3.add = function(r3, f3) {
|
|
32897
|
+
var d3, l3 = this;
|
|
32898
|
+
r3 = Number(r3);
|
|
32899
|
+
var $2 = b3.p(f3), y3 = /* @__PURE__ */ __name(function(t3) {
|
|
32900
|
+
var e2 = O2(l3);
|
|
32901
|
+
return b3.w(e2.date(e2.date() + Math.round(t3 * r3)), l3);
|
|
32902
|
+
}, "y");
|
|
32903
|
+
if ($2 === c2) return this.set(c2, this.$M + r3);
|
|
32904
|
+
if ($2 === h2) return this.set(h2, this.$y + r3);
|
|
32905
|
+
if ($2 === a2) return y3(1);
|
|
32906
|
+
if ($2 === o2) return y3(7);
|
|
32907
|
+
var M4 = (d3 = {}, d3[s2] = e, d3[u2] = n2, d3[i] = t2, d3)[$2] || 1, m4 = this.$d.getTime() + r3 * M4;
|
|
32908
|
+
return b3.w(m4, this);
|
|
32909
|
+
}, m3.subtract = function(t3, e2) {
|
|
32910
|
+
return this.add(-1 * t3, e2);
|
|
32911
|
+
}, m3.format = function(t3) {
|
|
32912
|
+
var e2 = this, n3 = this.$locale();
|
|
32913
|
+
if (!this.isValid()) return n3.invalidDate || l2;
|
|
32914
|
+
var r3 = t3 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b3.z(this), s3 = this.$H, u3 = this.$m, a3 = this.$M, o3 = n3.weekdays, c3 = n3.months, f3 = n3.meridiem, h3 = /* @__PURE__ */ __name(function(t4, n4, i3, s4) {
|
|
32915
|
+
return t4 && (t4[n4] || t4(e2, r3)) || i3[n4].slice(0, s4);
|
|
32916
|
+
}, "h"), d3 = /* @__PURE__ */ __name(function(t4) {
|
|
32917
|
+
return b3.s(s3 % 12 || 12, t4, "0");
|
|
32918
|
+
}, "d"), $2 = f3 || function(t4, e3, n4) {
|
|
32919
|
+
var r4 = t4 < 12 ? "AM" : "PM";
|
|
32920
|
+
return n4 ? r4.toLowerCase() : r4;
|
|
32921
|
+
};
|
|
32922
|
+
return r3.replace(y2, function(t4, r4) {
|
|
32923
|
+
return r4 || function(t5) {
|
|
32924
|
+
switch (t5) {
|
|
32925
|
+
case "YY":
|
|
32926
|
+
return String(e2.$y).slice(-2);
|
|
32927
|
+
case "YYYY":
|
|
32928
|
+
return b3.s(e2.$y, 4, "0");
|
|
32929
|
+
case "M":
|
|
32930
|
+
return a3 + 1;
|
|
32931
|
+
case "MM":
|
|
32932
|
+
return b3.s(a3 + 1, 2, "0");
|
|
32933
|
+
case "MMM":
|
|
32934
|
+
return h3(n3.monthsShort, a3, c3, 3);
|
|
32935
|
+
case "MMMM":
|
|
32936
|
+
return h3(c3, a3);
|
|
32937
|
+
case "D":
|
|
32938
|
+
return e2.$D;
|
|
32939
|
+
case "DD":
|
|
32940
|
+
return b3.s(e2.$D, 2, "0");
|
|
32941
|
+
case "d":
|
|
32942
|
+
return String(e2.$W);
|
|
32943
|
+
case "dd":
|
|
32944
|
+
return h3(n3.weekdaysMin, e2.$W, o3, 2);
|
|
32945
|
+
case "ddd":
|
|
32946
|
+
return h3(n3.weekdaysShort, e2.$W, o3, 3);
|
|
32947
|
+
case "dddd":
|
|
32948
|
+
return o3[e2.$W];
|
|
32949
|
+
case "H":
|
|
32950
|
+
return String(s3);
|
|
32951
|
+
case "HH":
|
|
32952
|
+
return b3.s(s3, 2, "0");
|
|
32953
|
+
case "h":
|
|
32954
|
+
return d3(1);
|
|
32955
|
+
case "hh":
|
|
32956
|
+
return d3(2);
|
|
32957
|
+
case "a":
|
|
32958
|
+
return $2(s3, u3, true);
|
|
32959
|
+
case "A":
|
|
32960
|
+
return $2(s3, u3, false);
|
|
32961
|
+
case "m":
|
|
32962
|
+
return String(u3);
|
|
32963
|
+
case "mm":
|
|
32964
|
+
return b3.s(u3, 2, "0");
|
|
32965
|
+
case "s":
|
|
32966
|
+
return String(e2.$s);
|
|
32967
|
+
case "ss":
|
|
32968
|
+
return b3.s(e2.$s, 2, "0");
|
|
32969
|
+
case "SSS":
|
|
32970
|
+
return b3.s(e2.$ms, 3, "0");
|
|
32971
|
+
case "Z":
|
|
32972
|
+
return i2;
|
|
32973
|
+
}
|
|
32974
|
+
return null;
|
|
32975
|
+
}(t4) || i2.replace(":", "");
|
|
32976
|
+
});
|
|
32977
|
+
}, m3.utcOffset = function() {
|
|
32978
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
32979
|
+
}, m3.diff = function(r3, d3, l3) {
|
|
32980
|
+
var $2, y3 = this, M4 = b3.p(d3), m4 = O2(r3), v3 = (m4.utcOffset() - this.utcOffset()) * e, g3 = this - m4, D3 = /* @__PURE__ */ __name(function() {
|
|
32981
|
+
return b3.m(y3, m4);
|
|
32982
|
+
}, "D");
|
|
32983
|
+
switch (M4) {
|
|
32984
|
+
case h2:
|
|
32985
|
+
$2 = D3() / 12;
|
|
32986
|
+
break;
|
|
32987
|
+
case c2:
|
|
32988
|
+
$2 = D3();
|
|
32989
|
+
break;
|
|
32990
|
+
case f2:
|
|
32991
|
+
$2 = D3() / 3;
|
|
32992
|
+
break;
|
|
32993
|
+
case o2:
|
|
32994
|
+
$2 = (g3 - v3) / 6048e5;
|
|
32995
|
+
break;
|
|
32996
|
+
case a2:
|
|
32997
|
+
$2 = (g3 - v3) / 864e5;
|
|
32998
|
+
break;
|
|
32999
|
+
case u2:
|
|
33000
|
+
$2 = g3 / n2;
|
|
33001
|
+
break;
|
|
33002
|
+
case s2:
|
|
33003
|
+
$2 = g3 / e;
|
|
33004
|
+
break;
|
|
33005
|
+
case i:
|
|
33006
|
+
$2 = g3 / t2;
|
|
33007
|
+
break;
|
|
33008
|
+
default:
|
|
33009
|
+
$2 = g3;
|
|
33010
|
+
}
|
|
33011
|
+
return l3 ? $2 : b3.a($2);
|
|
33012
|
+
}, m3.daysInMonth = function() {
|
|
33013
|
+
return this.endOf(c2).$D;
|
|
33014
|
+
}, m3.$locale = function() {
|
|
33015
|
+
return D2[this.$L];
|
|
33016
|
+
}, m3.locale = function(t3, e2) {
|
|
33017
|
+
if (!t3) return this.$L;
|
|
33018
|
+
var n3 = this.clone(), r3 = w2(t3, e2, true);
|
|
33019
|
+
return r3 && (n3.$L = r3), n3;
|
|
33020
|
+
}, m3.clone = function() {
|
|
33021
|
+
return b3.w(this.$d, this);
|
|
33022
|
+
}, m3.toDate = function() {
|
|
33023
|
+
return new Date(this.valueOf());
|
|
33024
|
+
}, m3.toJSON = function() {
|
|
33025
|
+
return this.isValid() ? this.toISOString() : null;
|
|
33026
|
+
}, m3.toISOString = function() {
|
|
33027
|
+
return this.$d.toISOString();
|
|
33028
|
+
}, m3.toString = function() {
|
|
33029
|
+
return this.$d.toUTCString();
|
|
33030
|
+
}, M3;
|
|
33031
|
+
}(), k2 = _2.prototype;
|
|
33032
|
+
return O2.prototype = k2, [["$ms", r2], ["$s", i], ["$m", s2], ["$H", u2], ["$W", a2], ["$M", c2], ["$y", h2], ["$D", d2]].forEach(function(t3) {
|
|
33033
|
+
k2[t3[1]] = function(e2) {
|
|
33034
|
+
return this.$g(e2, t3[0], t3[1]);
|
|
33035
|
+
};
|
|
33036
|
+
}), O2.extend = function(t3, e2) {
|
|
33037
|
+
return t3.$i || (t3(e2, _2, O2), t3.$i = true), O2;
|
|
33038
|
+
}, O2.locale = w2, O2.isDayjs = S2, O2.unix = function(t3) {
|
|
33039
|
+
return O2(1e3 * t3);
|
|
33040
|
+
}, O2.en = D2[g2], O2.Ls = D2, O2.p = {}, O2;
|
|
33041
|
+
});
|
|
33042
|
+
})(dayjs_min$1);
|
|
33043
|
+
return dayjs_min$1.exports;
|
|
33044
|
+
}
|
|
33045
|
+
__name(requireDayjs_min, "requireDayjs_min");
|
|
33046
|
+
var dayjs_minExports = requireDayjs_min();
|
|
33047
|
+
const dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports);
|
|
32990
33048
|
var localizedFormat$2 = { exports: {} };
|
|
32991
33049
|
var localizedFormat$1 = localizedFormat$2.exports;
|
|
32992
33050
|
var hasRequiredLocalizedFormat;
|
|
@@ -33226,7 +33284,7 @@ function removeUnwantedProps(props) {
|
|
|
33226
33284
|
return cleanedProps;
|
|
33227
33285
|
}
|
|
33228
33286
|
__name(removeUnwantedProps, "removeUnwantedProps");
|
|
33229
|
-
const LabelWithTooltipInfo = /* @__PURE__ */ __name(({ label, tooltipInfo, labelStyle }) => tooltipInfo ? /* @__PURE__ */ React__default.createElement("
|
|
33287
|
+
const LabelWithTooltipInfo = /* @__PURE__ */ __name(({ label, tooltipInfo, labelStyle }) => tooltipInfo ? /* @__PURE__ */ React__default.createElement("span", { style: __spreadValues({ display: "flex", alignItems: "center" }, labelStyle) }, label, " ", /* @__PURE__ */ React__default.createElement(
|
|
33230
33288
|
InfoHelper,
|
|
33231
33289
|
{
|
|
33232
33290
|
style: { marginLeft: "5px", marginTop: "-6px" },
|
|
@@ -36884,7 +36942,7 @@ const multiViewColumn = __spreadProps(__spreadValues({}, viewColumn), {
|
|
|
36884
36942
|
));
|
|
36885
36943
|
}, "render")
|
|
36886
36944
|
});
|
|
36887
|
-
|
|
36945
|
+
const convertSchema = /* @__PURE__ */ __name((schema2) => {
|
|
36888
36946
|
let schemaToUse = schema2;
|
|
36889
36947
|
if (!schemaToUse.fields && Array.isArray(schema2)) {
|
|
36890
36948
|
schemaToUse = {
|
|
@@ -36893,35 +36951,26 @@ function convertSchema(schema2) {
|
|
|
36893
36951
|
}
|
|
36894
36952
|
schemaToUse = __spreadValues({}, schemaToUse);
|
|
36895
36953
|
schemaToUse.fields = schemaToUse.fields.map((field, i) => {
|
|
36896
|
-
let fieldToUse = field;
|
|
36897
36954
|
if (typeof field === "string") {
|
|
36898
|
-
|
|
36955
|
+
return {
|
|
36899
36956
|
displayName: startCase(camelCase(field)),
|
|
36900
36957
|
path: field,
|
|
36901
36958
|
type: "string"
|
|
36902
36959
|
};
|
|
36903
|
-
} else
|
|
36904
|
-
fieldToUse =
|
|
36905
|
-
|
|
36906
|
-
|
|
36907
|
-
|
|
36908
|
-
|
|
36909
|
-
|
|
36910
|
-
|
|
36911
|
-
}
|
|
36912
|
-
|
|
36913
|
-
if (!fieldToUse.path) {
|
|
36914
|
-
fieldToUse = __spreadProps(__spreadValues({}, fieldToUse), {
|
|
36915
|
-
filterDisabled: true,
|
|
36916
|
-
sortDisabled: true,
|
|
36917
|
-
path: "fake-path" + i
|
|
36918
|
-
});
|
|
36960
|
+
} else {
|
|
36961
|
+
const fieldToUse = __spreadValues({}, field);
|
|
36962
|
+
fieldToUse.type = fieldToUse.type || "string";
|
|
36963
|
+
fieldToUse.displayName = fieldToUse.displayName || startCase(camelCase(fieldToUse.path || ""));
|
|
36964
|
+
if (!fieldToUse.path) {
|
|
36965
|
+
fieldToUse.filterDisabled = true;
|
|
36966
|
+
fieldToUse.sortDisabled = true;
|
|
36967
|
+
fieldToUse.path = "fake-path" + i;
|
|
36968
|
+
}
|
|
36969
|
+
return fieldToUse;
|
|
36919
36970
|
}
|
|
36920
|
-
return fieldToUse;
|
|
36921
36971
|
});
|
|
36922
36972
|
return schemaToUse;
|
|
36923
|
-
}
|
|
36924
|
-
__name(convertSchema, "convertSchema");
|
|
36973
|
+
}, "convertSchema");
|
|
36925
36974
|
const TableFormTrackerContext = React__default.createContext({
|
|
36926
36975
|
formNames: [],
|
|
36927
36976
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
@@ -50484,42 +50533,42 @@ function getFilterMenuItems(dataType) {
|
|
|
50484
50533
|
let filterMenuItems2 = [];
|
|
50485
50534
|
if (dataType === "string") {
|
|
50486
50535
|
filterMenuItems2 = [
|
|
50487
|
-
"
|
|
50488
|
-
"
|
|
50489
|
-
"
|
|
50490
|
-
"
|
|
50491
|
-
"
|
|
50492
|
-
"
|
|
50493
|
-
"
|
|
50494
|
-
"
|
|
50495
|
-
"
|
|
50496
|
-
"
|
|
50536
|
+
"contains",
|
|
50537
|
+
"notContains",
|
|
50538
|
+
"startsWith",
|
|
50539
|
+
"endsWith",
|
|
50540
|
+
"isExactly",
|
|
50541
|
+
"regex",
|
|
50542
|
+
"inList",
|
|
50543
|
+
"notInList",
|
|
50544
|
+
"isEmpty",
|
|
50545
|
+
"notEmpty"
|
|
50497
50546
|
];
|
|
50498
50547
|
} else if (dataType === "lookup") {
|
|
50499
50548
|
filterMenuItems2 = [
|
|
50500
|
-
"
|
|
50501
|
-
"
|
|
50502
|
-
"
|
|
50503
|
-
"
|
|
50504
|
-
"
|
|
50505
|
-
"
|
|
50549
|
+
"contains",
|
|
50550
|
+
"notContains",
|
|
50551
|
+
"startsWith",
|
|
50552
|
+
"endsWith",
|
|
50553
|
+
"isExactly",
|
|
50554
|
+
"regex"
|
|
50506
50555
|
];
|
|
50507
50556
|
} else if (dataType === "boolean") {
|
|
50508
|
-
filterMenuItems2 = ["
|
|
50557
|
+
filterMenuItems2 = ["true", "false"];
|
|
50509
50558
|
} else if (dataType === "number" || dataType === "integer") {
|
|
50510
50559
|
filterMenuItems2 = [
|
|
50511
|
-
"
|
|
50512
|
-
"
|
|
50513
|
-
"
|
|
50514
|
-
"
|
|
50515
|
-
"
|
|
50516
|
-
"
|
|
50517
|
-
"
|
|
50560
|
+
"greaterThan",
|
|
50561
|
+
"lessThan",
|
|
50562
|
+
"inRange",
|
|
50563
|
+
"outsideRange",
|
|
50564
|
+
"equalTo",
|
|
50565
|
+
"inList",
|
|
50566
|
+
"notInList"
|
|
50518
50567
|
];
|
|
50519
50568
|
} else if (dataType === "timestamp") {
|
|
50520
|
-
filterMenuItems2 = ["
|
|
50569
|
+
filterMenuItems2 = ["isBetween", "notBetween", "isBefore", "isAfter"];
|
|
50521
50570
|
}
|
|
50522
|
-
return filterMenuItems2;
|
|
50571
|
+
return filterMenuItems2.map((item) => startCase(item));
|
|
50523
50572
|
}
|
|
50524
50573
|
__name(getFilterMenuItems, "getFilterMenuItems");
|
|
50525
50574
|
const ColumnFilterMenu = /* @__PURE__ */ __name(({
|
|
@@ -51020,7 +51069,7 @@ const RenderColumnHeader = /* @__PURE__ */ __name(({
|
|
|
51020
51069
|
if (order2 && order2.length) {
|
|
51021
51070
|
order2.forEach((order22) => {
|
|
51022
51071
|
const orderField = order22.replace("-", "");
|
|
51023
|
-
if (orderField ===
|
|
51072
|
+
if (orderField === path2) {
|
|
51024
51073
|
if (orderField === order22) {
|
|
51025
51074
|
ordering = "asc";
|
|
51026
51075
|
} else {
|
|
@@ -55956,6 +56005,7 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
55956
56005
|
);
|
|
55957
56006
|
const tableRef = useRef();
|
|
55958
56007
|
const alreadySelected = useRef(false);
|
|
56008
|
+
const [noVirtual, setNoVirtual] = useState(false);
|
|
55959
56009
|
const [onlyShowRowsWErrors, setOnlyShowRowsWErrors] = useState(false);
|
|
55960
56010
|
const [entitiesUndoRedoStack, setEntitiesUndoRedoStack] = useState({
|
|
55961
56011
|
currentVersion: 0
|
|
@@ -56107,8 +56157,6 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
56107
56157
|
props = __spreadValues(__spreadValues({}, props), tableParams);
|
|
56108
56158
|
const queryParams = useMemo$1(() => {
|
|
56109
56159
|
if (!isTableParamsConnected) {
|
|
56110
|
-
const additionalFilterToUse = typeof props.additionalFilter === "function" ? props.additionalFilter : () => props.additionalFilter;
|
|
56111
|
-
const additionalOrFilterToUse = typeof props.additionalOrFilter === "function" ? props.additionalOrFilter : () => props.additionalOrFilter;
|
|
56112
56160
|
return getQueryParams({
|
|
56113
56161
|
doNotCoercePageSize,
|
|
56114
56162
|
currentParams,
|
|
@@ -56119,8 +56167,7 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
56119
56167
|
schema: convertedSchema,
|
|
56120
56168
|
isInfinite,
|
|
56121
56169
|
isLocalCall,
|
|
56122
|
-
additionalFilter:
|
|
56123
|
-
additionalOrFilter: additionalOrFilterToUse,
|
|
56170
|
+
additionalFilter: props.additionalFilter,
|
|
56124
56171
|
noOrderError: props.noOrderError,
|
|
56125
56172
|
isCodeModel: props.isCodeModel,
|
|
56126
56173
|
ownProps: props
|
|
@@ -56343,7 +56390,7 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
56343
56390
|
}) : !val2;
|
|
56344
56391
|
});
|
|
56345
56392
|
}
|
|
56346
|
-
if (noValsForField) {
|
|
56393
|
+
if (noValsForField && entities.length) {
|
|
56347
56394
|
return __spreadProps(__spreadValues({}, field), {
|
|
56348
56395
|
isHidden: true,
|
|
56349
56396
|
isForcedHidden: true
|
|
@@ -56800,76 +56847,94 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
56800
56847
|
updateEntitiesHelper,
|
|
56801
56848
|
updateValidation
|
|
56802
56849
|
]);
|
|
56803
|
-
const
|
|
56804
|
-
(
|
|
56805
|
-
|
|
56806
|
-
|
|
56807
|
-
|
|
56808
|
-
|
|
56809
|
-
|
|
56810
|
-
|
|
56811
|
-
Object.keys(selectedCells).forEach((key) => {
|
|
56812
|
-
const [rowId, path2] = key.split(":");
|
|
56813
|
-
const eInfo = entityIdToEntity[rowId];
|
|
56814
|
-
if (eInfo) {
|
|
56815
|
-
if (firstRowIndex === void 0 || eInfo.i < firstRowIndex) {
|
|
56816
|
-
firstRowIndex = eInfo.i;
|
|
56817
|
-
}
|
|
56818
|
-
if (!selectionGrid[eInfo.i]) {
|
|
56819
|
-
selectionGrid[eInfo.i] = [];
|
|
56820
|
-
}
|
|
56821
|
-
const cellIndex = pathToIndex[path2];
|
|
56822
|
-
if (firstCellIndex === void 0 || cellIndex < firstCellIndex) {
|
|
56823
|
-
firstCellIndex = cellIndex;
|
|
56824
|
-
}
|
|
56825
|
-
selectionGrid[eInfo.i][cellIndex] = true;
|
|
56826
|
-
}
|
|
56827
|
-
});
|
|
56828
|
-
if (firstRowIndex === void 0) return;
|
|
56829
|
-
const allRows = getAllRows(e);
|
|
56830
|
-
let fullCellText = "";
|
|
56831
|
-
const fullJson = [];
|
|
56832
|
-
times(selectionGrid.length, (i) => {
|
|
56833
|
-
const row = selectionGrid[i];
|
|
56834
|
-
if (fullCellText) {
|
|
56835
|
-
fullCellText += "\n";
|
|
56850
|
+
const waitUntilAllRowsAreRendered = useCallback$1(() => {
|
|
56851
|
+
return new Promise((resolve) => {
|
|
56852
|
+
const interval = setInterval(() => {
|
|
56853
|
+
var _a3, _b2;
|
|
56854
|
+
const allRowEls = (_b2 = (_a3 = tableRef.current) == null ? void 0 : _a3.tableRef) == null ? void 0 : _b2.querySelectorAll(".rt-tr-group");
|
|
56855
|
+
if ((allRowEls == null ? void 0 : allRowEls.length) === entities.length) {
|
|
56856
|
+
clearInterval(interval);
|
|
56857
|
+
resolve();
|
|
56836
56858
|
}
|
|
56837
|
-
|
|
56838
|
-
|
|
56839
|
-
|
|
56840
|
-
|
|
56841
|
-
|
|
56842
|
-
|
|
56843
|
-
|
|
56844
|
-
|
|
56845
|
-
|
|
56846
|
-
|
|
56847
|
-
|
|
56848
|
-
|
|
56849
|
-
|
|
56850
|
-
|
|
56851
|
-
|
|
56852
|
-
|
|
56859
|
+
}, 50);
|
|
56860
|
+
});
|
|
56861
|
+
}, []);
|
|
56862
|
+
const handleCopySelectedCells = useCallback$1(() => __async(void 0, null, function* () {
|
|
56863
|
+
if (isEmpty$1(selectedCells)) return;
|
|
56864
|
+
if (entities.length > VIRTUALIZE_CUTOFF_LENGTH) {
|
|
56865
|
+
setNoVirtual(true);
|
|
56866
|
+
yield waitUntilAllRowsAreRendered();
|
|
56867
|
+
}
|
|
56868
|
+
const pathToIndex = getFieldPathToIndex(schema2);
|
|
56869
|
+
const entityIdToEntity = getEntityIdToEntity(entities);
|
|
56870
|
+
const selectionGrid = [];
|
|
56871
|
+
let firstRowIndex;
|
|
56872
|
+
let firstCellIndex;
|
|
56873
|
+
Object.keys(selectedCells).forEach((key) => {
|
|
56874
|
+
const [rowId, path2] = key.split(":");
|
|
56875
|
+
const eInfo = entityIdToEntity[rowId];
|
|
56876
|
+
if (eInfo) {
|
|
56877
|
+
if (firstRowIndex === void 0 || eInfo.i < firstRowIndex) {
|
|
56878
|
+
firstRowIndex = eInfo.i;
|
|
56879
|
+
}
|
|
56880
|
+
if (!selectionGrid[eInfo.i]) {
|
|
56881
|
+
selectionGrid[eInfo.i] = [];
|
|
56882
|
+
}
|
|
56883
|
+
const cellIndex = pathToIndex[path2];
|
|
56884
|
+
if (firstCellIndex === void 0 || cellIndex < firstCellIndex) {
|
|
56885
|
+
firstCellIndex = cellIndex;
|
|
56853
56886
|
}
|
|
56854
|
-
|
|
56855
|
-
|
|
56856
|
-
|
|
56857
|
-
|
|
56858
|
-
|
|
56859
|
-
|
|
56887
|
+
selectionGrid[eInfo.i][cellIndex] = true;
|
|
56888
|
+
}
|
|
56889
|
+
});
|
|
56890
|
+
if (firstRowIndex === void 0) return;
|
|
56891
|
+
const allRows = getAllRows(tableRef);
|
|
56892
|
+
let fullCellText = "";
|
|
56893
|
+
const fullJson = [];
|
|
56894
|
+
times(selectionGrid.length, (i) => {
|
|
56895
|
+
const row = selectionGrid[i];
|
|
56896
|
+
if (fullCellText) {
|
|
56897
|
+
fullCellText += "\n";
|
|
56898
|
+
}
|
|
56899
|
+
if (!row) {
|
|
56900
|
+
return;
|
|
56901
|
+
} else {
|
|
56902
|
+
const jsonRow = [];
|
|
56903
|
+
let [rowCopyText, json] = getRowCopyText(allRows[i + 1]);
|
|
56904
|
+
rowCopyText = rowCopyText.split(" ");
|
|
56905
|
+
times(row.length, (i2) => {
|
|
56906
|
+
const cell = row[i2];
|
|
56907
|
+
if (cell) {
|
|
56908
|
+
fullCellText += rowCopyText[i2];
|
|
56909
|
+
jsonRow.push(json[i2]);
|
|
56910
|
+
}
|
|
56911
|
+
if (i2 !== row.length - 1 && i2 >= firstCellIndex) fullCellText += " ";
|
|
56912
|
+
});
|
|
56913
|
+
fullJson.push(jsonRow);
|
|
56914
|
+
}
|
|
56915
|
+
});
|
|
56916
|
+
if (!fullCellText) return window.toastr.warning("No text to copy");
|
|
56917
|
+
handleCopyHelper(fullCellText, fullJson, "Selected cells copied");
|
|
56918
|
+
setNoVirtual(false);
|
|
56919
|
+
}), [entities, selectedCells, schema2, waitUntilAllRowsAreRendered]);
|
|
56860
56920
|
const handleCopySelectedRows = useCallback$1(
|
|
56861
|
-
(selectedRecords,
|
|
56862
|
-
|
|
56863
|
-
|
|
56921
|
+
(selectedRecords) => __async(void 0, null, function* () {
|
|
56922
|
+
if (entities.length > VIRTUALIZE_CUTOFF_LENGTH) {
|
|
56923
|
+
setNoVirtual(true);
|
|
56924
|
+
yield waitUntilAllRowsAreRendered();
|
|
56925
|
+
}
|
|
56926
|
+
const idToIndex = entities.reduce((acc, e, i) => {
|
|
56927
|
+
acc[e.id || e.code] = i;
|
|
56864
56928
|
return acc;
|
|
56865
56929
|
}, {});
|
|
56866
56930
|
const rowNumbersToCopy = selectedRecords.map((rec) => idToIndex[rec.id || rec.code] + 1).sort();
|
|
56867
56931
|
if (!rowNumbersToCopy.length) return;
|
|
56868
56932
|
rowNumbersToCopy.unshift(0);
|
|
56869
56933
|
try {
|
|
56870
|
-
const allRowEls = getAllRows(
|
|
56934
|
+
const allRowEls = getAllRows(tableRef);
|
|
56871
56935
|
if (!allRowEls) return;
|
|
56872
56936
|
const rowEls = rowNumbersToCopy.map((i) => allRowEls[i]);
|
|
56937
|
+
if (window.Cypress) window.Cypress.__copiedRowsLength = rowEls.length;
|
|
56873
56938
|
handleCopyRows(rowEls, {
|
|
56874
56939
|
onFinishMsg: "Selected rows copied"
|
|
56875
56940
|
});
|
|
@@ -56877,8 +56942,9 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
56877
56942
|
console.error(`error:`, error);
|
|
56878
56943
|
window.toastr.error("Error copying rows.");
|
|
56879
56944
|
}
|
|
56880
|
-
|
|
56881
|
-
|
|
56945
|
+
setNoVirtual(false);
|
|
56946
|
+
}),
|
|
56947
|
+
[entities, waitUntilAllRowsAreRendered]
|
|
56882
56948
|
);
|
|
56883
56949
|
const handleCopyHotkey = useCallback$1(
|
|
56884
56950
|
(e) => {
|
|
@@ -57645,7 +57711,7 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
57645
57711
|
{
|
|
57646
57712
|
key: "copyColumn",
|
|
57647
57713
|
onClick: /* @__PURE__ */ __name(() => {
|
|
57648
|
-
handleCopyColumn(
|
|
57714
|
+
handleCopyColumn(tableRef, cellWrapper);
|
|
57649
57715
|
}, "onClick"),
|
|
57650
57716
|
text: "Column"
|
|
57651
57717
|
}
|
|
@@ -57658,7 +57724,7 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
57658
57724
|
{
|
|
57659
57725
|
key: "copyColumnSelected",
|
|
57660
57726
|
onClick: /* @__PURE__ */ __name(() => {
|
|
57661
|
-
handleCopyColumn(
|
|
57727
|
+
handleCopyColumn(tableRef, cellWrapper, selectedRecords);
|
|
57662
57728
|
}, "onClick"),
|
|
57663
57729
|
text: "Column (Selected)"
|
|
57664
57730
|
}
|
|
@@ -57701,7 +57767,7 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
57701
57767
|
{
|
|
57702
57768
|
key: "copyFullTableRows",
|
|
57703
57769
|
onClick: /* @__PURE__ */ __name(() => {
|
|
57704
|
-
handleCopyTable(
|
|
57770
|
+
handleCopyTable(tableRef);
|
|
57705
57771
|
}, "onClick"),
|
|
57706
57772
|
text: "Table"
|
|
57707
57773
|
}
|
|
@@ -58238,6 +58304,7 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
58238
58304
|
__spreadValues({
|
|
58239
58305
|
data: filteredEnts,
|
|
58240
58306
|
ref: tableRef,
|
|
58307
|
+
noVirtual,
|
|
58241
58308
|
className: classNames({
|
|
58242
58309
|
isCellEditable,
|
|
58243
58310
|
"tg-table-loading": isLoading,
|
|
@@ -58305,7 +58372,8 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
58305
58372
|
resizePersist,
|
|
58306
58373
|
resized,
|
|
58307
58374
|
rowsToShow,
|
|
58308
|
-
style2
|
|
58375
|
+
style2,
|
|
58376
|
+
noVirtual
|
|
58309
58377
|
]
|
|
58310
58378
|
);
|
|
58311
58379
|
return /* @__PURE__ */ React__default.createElement("div", { tabIndex: "1", onKeyDown: handleKeyDown, onKeyUp: handleKeyUp }, /* @__PURE__ */ React__default.createElement(
|
|
@@ -58508,7 +58576,7 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
58508
58576
|
try {
|
|
58509
58577
|
const allEntities = yield safeQuery(fragment, {
|
|
58510
58578
|
variables: {
|
|
58511
|
-
|
|
58579
|
+
where: variables.where,
|
|
58512
58580
|
sort: variables.sort
|
|
58513
58581
|
},
|
|
58514
58582
|
canCancel: true
|
|
@@ -58588,8 +58656,8 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
58588
58656
|
), /* @__PURE__ */ React__default.createElement(
|
|
58589
58657
|
Button,
|
|
58590
58658
|
{
|
|
58591
|
-
onClick: /* @__PURE__ */ __name((
|
|
58592
|
-
handleCopyTable(
|
|
58659
|
+
onClick: /* @__PURE__ */ __name(() => {
|
|
58660
|
+
handleCopyTable(tableRef, { isDownload: true });
|
|
58593
58661
|
}, "onClick"),
|
|
58594
58662
|
"data-tip": "Download Table as CSV",
|
|
58595
58663
|
minimal: true,
|
|
@@ -68873,6 +68941,7 @@ function parseCsvOrExcelFile(_0) {
|
|
|
68873
68941
|
}
|
|
68874
68942
|
__name(parseCsvOrExcelFile, "parseCsvOrExcelFile");
|
|
68875
68943
|
const filterFilesInZip = /* @__PURE__ */ __name((file, accepted) => __async(void 0, null, function* () {
|
|
68944
|
+
var _a2, _b2, _c, _d;
|
|
68876
68945
|
if (!file || Array.isArray(file) && !file.length) return [];
|
|
68877
68946
|
const zipExtracted = yield extractZipFiles(file);
|
|
68878
68947
|
const acceptedFiles = [];
|
|
@@ -68882,9 +68951,12 @@ const filterFilesInZip = /* @__PURE__ */ __name((file, accepted) => __async(void
|
|
|
68882
68951
|
}
|
|
68883
68952
|
}
|
|
68884
68953
|
if (acceptedFiles.length && acceptedFiles.length < zipExtracted.length)
|
|
68885
|
-
window.toastr.warning
|
|
68954
|
+
(_b2 = (_a2 = window == null ? void 0 : window.toastr) == null ? void 0 : _a2.warning) == null ? void 0 : _b2.call(
|
|
68955
|
+
_a2,
|
|
68956
|
+
"Some files don't have the proper file extension."
|
|
68957
|
+
);
|
|
68886
68958
|
if (!acceptedFiles.length)
|
|
68887
|
-
window.toastr.warning("No files with the proper extension were found.");
|
|
68959
|
+
(_d = (_c = window == null ? void 0 : window.toastr) == null ? void 0 : _c.warning) == null ? void 0 : _d.call(_c, "No files with the proper extension were found.");
|
|
68888
68960
|
return acceptedFiles;
|
|
68889
68961
|
}), "filterFilesInZip");
|
|
68890
68962
|
function removeExt(filename) {
|
|
@@ -70865,8 +70937,12 @@ const Uploader = /* @__PURE__ */ __name(({
|
|
|
70865
70937
|
onClick: /* @__PURE__ */ __name((evt) => evt.preventDefault(), "onClick"),
|
|
70866
70938
|
multiple: fileLimit !== 1,
|
|
70867
70939
|
accept: simpleAccept ? simpleAccept.split(", ").map((acc) => acc.startsWith(".") ? acc : "." + acc).join(", ") : void 0,
|
|
70868
|
-
onDrop: /* @__PURE__ */ __name((_acceptedFiles, rejectedFiles) => __async(void 0, null, function* () {
|
|
70940
|
+
onDrop: /* @__PURE__ */ __name((_acceptedFiles, rejectedFiles, e) => __async(void 0, null, function* () {
|
|
70869
70941
|
var _a3, _b3;
|
|
70942
|
+
const parentDropzone = e.target.closest(".tg-dropzone");
|
|
70943
|
+
if (parentDropzone) {
|
|
70944
|
+
parentDropzone.blur();
|
|
70945
|
+
}
|
|
70870
70946
|
let acceptedFiles = [];
|
|
70871
70947
|
for (const file of _acceptedFiles) {
|
|
70872
70948
|
if ((validateAgainstSchema || autoUnzip) && isZipFile(file)) {
|
|
@@ -76928,6 +77004,7 @@ const updateAmbiguousOrLiteral = createMetaAction(
|
|
|
76928
77004
|
"updateAmbiguousOrLiteral"
|
|
76929
77005
|
);
|
|
76930
77006
|
const updateDnaOrAA = createMetaAction("updateDnaOrAA");
|
|
77007
|
+
const updateMismatchesAllowed = createMetaAction("updateMismatchesAllowed");
|
|
76931
77008
|
const updateMatchNumber = createMetaAction("updateMatchNumber");
|
|
76932
77009
|
const findTool = createMergedDefaultStateReducer(
|
|
76933
77010
|
{
|
|
@@ -76959,6 +77036,12 @@ const findTool = createMergedDefaultStateReducer(
|
|
|
76959
77036
|
dnaOrAA: payload
|
|
76960
77037
|
});
|
|
76961
77038
|
},
|
|
77039
|
+
[updateMismatchesAllowed]: (state2, payload) => {
|
|
77040
|
+
return __spreadProps(__spreadValues({}, state2), {
|
|
77041
|
+
matchNumber: 0,
|
|
77042
|
+
mismatchesAllowed: payload
|
|
77043
|
+
});
|
|
77044
|
+
},
|
|
76962
77045
|
[updateSearchText]: (state2, payload) => {
|
|
76963
77046
|
return __spreadProps(__spreadValues({}, state2), {
|
|
76964
77047
|
matchNumber: 0,
|
|
@@ -76978,6 +77061,7 @@ const findTool = createMergedDefaultStateReducer(
|
|
|
76978
77061
|
dnaOrAA: "DNA",
|
|
76979
77062
|
ambiguousOrLiteral: "LITERAL",
|
|
76980
77063
|
highlightAll: false,
|
|
77064
|
+
mismatchesAllowed: 0,
|
|
76981
77065
|
matchNumber: 0
|
|
76982
77066
|
}
|
|
76983
77067
|
);
|
|
@@ -76990,6 +77074,7 @@ const findTool$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
|
|
|
76990
77074
|
updateAmbiguousOrLiteral,
|
|
76991
77075
|
updateDnaOrAA,
|
|
76992
77076
|
updateMatchNumber,
|
|
77077
|
+
updateMismatchesAllowed,
|
|
76993
77078
|
updateSearchText
|
|
76994
77079
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
76995
77080
|
const openToolbarItemUpdate = createMetaAction("openToolbarItemUpdate");
|
|
@@ -77427,30 +77512,31 @@ function adjustRangeToDeletionOfAnotherRange(rangeToBeAdjusted, anotherRange, ma
|
|
|
77427
77512
|
anotherRange,
|
|
77428
77513
|
maxLength
|
|
77429
77514
|
);
|
|
77430
|
-
if (trimmedRange) {
|
|
77431
|
-
|
|
77432
|
-
anotherRange,
|
|
77433
|
-
maxLength
|
|
77434
|
-
);
|
|
77435
|
-
nonCircularDeletionRanges.forEach(function(nonCircularDeletionRange) {
|
|
77436
|
-
const deletionLength = nonCircularDeletionRange.end - nonCircularDeletionRange.start + 1;
|
|
77437
|
-
if (trimmedRange.start > trimmedRange.end) {
|
|
77438
|
-
if (nonCircularDeletionRange.start < trimmedRange.end) {
|
|
77439
|
-
trimmedRange.start -= deletionLength;
|
|
77440
|
-
trimmedRange.end -= deletionLength;
|
|
77441
|
-
} else if (nonCircularDeletionRange.start < trimmedRange.start) {
|
|
77442
|
-
trimmedRange.start -= deletionLength;
|
|
77443
|
-
} else ;
|
|
77444
|
-
} else {
|
|
77445
|
-
if (nonCircularDeletionRange.start < trimmedRange.start) {
|
|
77446
|
-
trimmedRange.start -= deletionLength;
|
|
77447
|
-
trimmedRange.end -= deletionLength;
|
|
77448
|
-
} else if (nonCircularDeletionRange.start < trimmedRange.end) {
|
|
77449
|
-
trimmedRange.end -= deletionLength;
|
|
77450
|
-
} else ;
|
|
77451
|
-
}
|
|
77452
|
-
});
|
|
77515
|
+
if (!trimmedRange) {
|
|
77516
|
+
return null;
|
|
77453
77517
|
}
|
|
77518
|
+
const nonCircularDeletionRanges = splitRangeIntoTwoPartsIfItIsCircular(
|
|
77519
|
+
anotherRange,
|
|
77520
|
+
maxLength
|
|
77521
|
+
);
|
|
77522
|
+
nonCircularDeletionRanges.forEach(function(nonCircularDeletionRange) {
|
|
77523
|
+
const deletionLength = nonCircularDeletionRange.end - nonCircularDeletionRange.start + 1;
|
|
77524
|
+
if (trimmedRange.start > trimmedRange.end) {
|
|
77525
|
+
if (nonCircularDeletionRange.start < trimmedRange.end) {
|
|
77526
|
+
trimmedRange.start -= deletionLength;
|
|
77527
|
+
trimmedRange.end -= deletionLength;
|
|
77528
|
+
} else if (nonCircularDeletionRange.start < trimmedRange.start) {
|
|
77529
|
+
trimmedRange.start -= deletionLength;
|
|
77530
|
+
} else ;
|
|
77531
|
+
} else {
|
|
77532
|
+
if (nonCircularDeletionRange.start < trimmedRange.start) {
|
|
77533
|
+
trimmedRange.start -= deletionLength;
|
|
77534
|
+
trimmedRange.end -= deletionLength;
|
|
77535
|
+
} else if (nonCircularDeletionRange.start < trimmedRange.end) {
|
|
77536
|
+
trimmedRange.end -= deletionLength;
|
|
77537
|
+
} else ;
|
|
77538
|
+
}
|
|
77539
|
+
});
|
|
77454
77540
|
return trimmedRange;
|
|
77455
77541
|
}
|
|
77456
77542
|
__name(adjustRangeToDeletionOfAnotherRange, "adjustRangeToDeletionOfAnotherRange");
|
|
@@ -83824,6 +83910,36 @@ function addSizeIdName(frag, sequenceLength) {
|
|
|
83824
83910
|
});
|
|
83825
83911
|
}
|
|
83826
83912
|
__name(addSizeIdName, "addSizeIdName");
|
|
83913
|
+
function findApproxMatches(searchSeq, targetSeq, maxMismatches, circular2 = false) {
|
|
83914
|
+
const matches = [];
|
|
83915
|
+
const lenA = searchSeq.length;
|
|
83916
|
+
const lenB = targetSeq.length;
|
|
83917
|
+
const targetSeqExtended = circular2 ? targetSeq + targetSeq.slice(0, lenA - 1) : targetSeq;
|
|
83918
|
+
const limit = circular2 ? lenB : lenB - lenA + 1;
|
|
83919
|
+
for (let i = 0; i < limit; i++) {
|
|
83920
|
+
const window2 = targetSeqExtended.slice(i, i + lenA);
|
|
83921
|
+
let mismatchCount = 0;
|
|
83922
|
+
const mismatchPositions = [];
|
|
83923
|
+
for (let j2 = 0; j2 < lenA; j2++) {
|
|
83924
|
+
if (searchSeq[j2] !== window2[j2]) {
|
|
83925
|
+
mismatchPositions.push(j2);
|
|
83926
|
+
mismatchCount++;
|
|
83927
|
+
if (mismatchCount > maxMismatches) break;
|
|
83928
|
+
}
|
|
83929
|
+
}
|
|
83930
|
+
if (mismatchCount <= maxMismatches) {
|
|
83931
|
+
matches.push({
|
|
83932
|
+
index: i,
|
|
83933
|
+
match: window2,
|
|
83934
|
+
mismatchPositions,
|
|
83935
|
+
numMismatches: mismatchPositions.length
|
|
83936
|
+
// Keep for backwards compatibility
|
|
83937
|
+
});
|
|
83938
|
+
}
|
|
83939
|
+
}
|
|
83940
|
+
return matches;
|
|
83941
|
+
}
|
|
83942
|
+
__name(findApproxMatches, "findApproxMatches");
|
|
83827
83943
|
var spliceString$1;
|
|
83828
83944
|
var hasRequiredSpliceString;
|
|
83829
83945
|
function requireSpliceString() {
|
|
@@ -92909,11 +93025,11 @@ function requireLib$3() {
|
|
|
92909
93025
|
if (hasRequiredLib$3) return lib$3;
|
|
92910
93026
|
hasRequiredLib$3 = 1;
|
|
92911
93027
|
var isNumber2 = requireLib$4();
|
|
92912
|
-
function
|
|
93028
|
+
function isInteger(value) {
|
|
92913
93029
|
return isNumber2(value) && value % 1 === 0;
|
|
92914
93030
|
}
|
|
92915
|
-
__name(
|
|
92916
|
-
lib$3 =
|
|
93031
|
+
__name(isInteger, "isInteger");
|
|
93032
|
+
lib$3 = isInteger;
|
|
92917
93033
|
return lib$3;
|
|
92918
93034
|
}
|
|
92919
93035
|
__name(requireLib$3, "requireLib$3");
|
|
@@ -92922,9 +93038,9 @@ var hasRequiredLib$2;
|
|
|
92922
93038
|
function requireLib$2() {
|
|
92923
93039
|
if (hasRequiredLib$2) return lib$2;
|
|
92924
93040
|
hasRequiredLib$2 = 1;
|
|
92925
|
-
var
|
|
93041
|
+
var isInteger = requireLib$3();
|
|
92926
93042
|
function isNonNegativeInteger(value) {
|
|
92927
|
-
return
|
|
93043
|
+
return isInteger(value) && value >= 0;
|
|
92928
93044
|
}
|
|
92929
93045
|
__name(isNonNegativeInteger, "isNonNegativeInteger");
|
|
92930
93046
|
lib$2 = isNonNegativeInteger;
|
|
@@ -96174,7 +96290,7 @@ var bufferpackExports = requireBufferpack();
|
|
|
96174
96290
|
const bufferpack = /* @__PURE__ */ getDefaultExportFromCjs(bufferpackExports);
|
|
96175
96291
|
var string_decoder = {};
|
|
96176
96292
|
var safeBuffer = { exports: {} };
|
|
96177
|
-
var buffer$
|
|
96293
|
+
var buffer$1 = {};
|
|
96178
96294
|
var base64Js = {};
|
|
96179
96295
|
var hasRequiredBase64Js;
|
|
96180
96296
|
function requireBase64Js() {
|
|
@@ -96376,7 +96492,7 @@ __name(requireIeee754, "requireIeee754");
|
|
|
96376
96492
|
*/
|
|
96377
96493
|
var hasRequiredBuffer;
|
|
96378
96494
|
function requireBuffer() {
|
|
96379
|
-
if (hasRequiredBuffer) return buffer$
|
|
96495
|
+
if (hasRequiredBuffer) return buffer$1;
|
|
96380
96496
|
hasRequiredBuffer = 1;
|
|
96381
96497
|
(function(exports2) {
|
|
96382
96498
|
var base64 = requireBase64Js();
|
|
@@ -97788,8 +97904,8 @@ function requireBuffer() {
|
|
|
97788
97904
|
}
|
|
97789
97905
|
return table2;
|
|
97790
97906
|
}();
|
|
97791
|
-
})(buffer$
|
|
97792
|
-
return buffer$
|
|
97907
|
+
})(buffer$1);
|
|
97908
|
+
return buffer$1;
|
|
97793
97909
|
}
|
|
97794
97910
|
__name(requireBuffer, "requireBuffer");
|
|
97795
97911
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
@@ -98111,7 +98227,6 @@ function requireString_decoder() {
|
|
|
98111
98227
|
__name(requireString_decoder, "requireString_decoder");
|
|
98112
98228
|
var string_decoderExports = requireString_decoder();
|
|
98113
98229
|
var bufferExports = requireBuffer();
|
|
98114
|
-
const buffer$1 = /* @__PURE__ */ getDefaultExportFromCjs(bufferExports);
|
|
98115
98230
|
const isBrowser$3 = typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
98116
98231
|
function getArrayBufferFromFile(file) {
|
|
98117
98232
|
if (!isBrowser$3) {
|
|
@@ -98141,12 +98256,11 @@ function toArrayBuffer(buffer2) {
|
|
|
98141
98256
|
return ab;
|
|
98142
98257
|
}
|
|
98143
98258
|
__name(toArrayBuffer, "toArrayBuffer");
|
|
98144
|
-
const Buffer$1 = buffer$1.Buffer;
|
|
98145
98259
|
function snapgeneToJson(_0) {
|
|
98146
98260
|
return __async(this, arguments, function* (fileObj, options = {}) {
|
|
98147
98261
|
try {
|
|
98148
98262
|
let read2 = /* @__PURE__ */ __name(function(size, fmt) {
|
|
98149
|
-
const buffer2 = Buffer
|
|
98263
|
+
const buffer2 = bufferExports.Buffer.from(arrayBuffer.slice(offset4, size + offset4));
|
|
98150
98264
|
offset4 += size;
|
|
98151
98265
|
if (fmt) {
|
|
98152
98266
|
const decoder = new string_decoderExports.StringDecoder(fmt);
|
|
@@ -106244,7 +106358,7 @@ function translationsRawSelector(sequenceData2) {
|
|
|
106244
106358
|
}
|
|
106245
106359
|
__name(translationsRawSelector, "translationsRawSelector");
|
|
106246
106360
|
const translationsRawSelector$1 = createSelector(sequenceDataSelector, translationsRawSelector);
|
|
106247
|
-
function searchLayersSelector(sequence2, isCircular, isOpen, searchString, ambiguousOrLiteral, dnaOrAA, isProtein2, proteinSequence) {
|
|
106361
|
+
function searchLayersSelector(sequence2, isCircular, isOpen, searchString, ambiguousOrLiteral, dnaOrAA, isProtein2, proteinSequence, mismatchesAllowed) {
|
|
106248
106362
|
if (!searchString || !isOpen) {
|
|
106249
106363
|
return [];
|
|
106250
106364
|
}
|
|
@@ -106272,6 +106386,26 @@ function searchLayersSelector(sequence2, isCircular, isOpen, searchString, ambig
|
|
|
106272
106386
|
});
|
|
106273
106387
|
});
|
|
106274
106388
|
}
|
|
106389
|
+
if (dnaOrAA === "DNA" && ambiguousOrLiteral === "LITERAL" && mismatchesAllowed > 0) {
|
|
106390
|
+
const approxMatches = findApproxMatches(
|
|
106391
|
+
searchString,
|
|
106392
|
+
sequence2,
|
|
106393
|
+
mismatchesAllowed,
|
|
106394
|
+
isCircular
|
|
106395
|
+
);
|
|
106396
|
+
const matches2 = approxMatches.map((match) => ({
|
|
106397
|
+
start: match.index,
|
|
106398
|
+
end: match.index + match.match.length - 1,
|
|
106399
|
+
matchedString: match.match,
|
|
106400
|
+
mismatchPositions: match.mismatchPositions,
|
|
106401
|
+
numMismatches: match.numMismatches,
|
|
106402
|
+
isSearchLayer: true,
|
|
106403
|
+
forward: true
|
|
106404
|
+
})).sort((a2, b3) => a2.start - b3.start);
|
|
106405
|
+
return matches2.map((match) => __spreadProps(__spreadValues({}, match), {
|
|
106406
|
+
className: "veSearchLayer"
|
|
106407
|
+
}));
|
|
106408
|
+
}
|
|
106275
106409
|
const matches = findSequenceMatches(sequence2, searchString, {
|
|
106276
106410
|
isCircular,
|
|
106277
106411
|
isAmbiguous: ambiguousOrLiteral === "AMBIGUOUS",
|
|
@@ -106296,6 +106430,7 @@ const searchLayersSelector$1 = createSelector(
|
|
|
106296
106430
|
(state2) => state2.findTool && state2.findTool.dnaOrAA,
|
|
106297
106431
|
(state2) => state2.sequenceData.isProtein,
|
|
106298
106432
|
(state2) => state2.sequenceData.proteinSequence,
|
|
106433
|
+
(state2) => state2.findTool && state2.findTool.mismatchesAllowed,
|
|
106299
106434
|
searchLayersSelector
|
|
106300
106435
|
);
|
|
106301
106436
|
const translationSearchMatchesSelector = createSelector(
|
|
@@ -117300,26 +117435,49 @@ function SelectionLayer$2(props) {
|
|
|
117300
117435
|
)
|
|
117301
117436
|
];
|
|
117302
117437
|
}
|
|
117303
|
-
|
|
117304
|
-
|
|
117438
|
+
const selectionElement = /* @__PURE__ */ React__default.createElement(
|
|
117439
|
+
"div",
|
|
117440
|
+
{
|
|
117441
|
+
onClick: _onClick,
|
|
117442
|
+
title: selectionMessage,
|
|
117443
|
+
onContextMenu: onSelectionContextMenu,
|
|
117444
|
+
key,
|
|
117445
|
+
className: classNameToPass + " veSelectionLayer veRowViewSelectionLayer notCaret " + (isTrueStart ? " isTrueStart " : "") + (isTrueEnd ? " isTrueEnd " : ""),
|
|
117446
|
+
style: __spreadProps(__spreadValues({
|
|
117447
|
+
width,
|
|
117448
|
+
left: leftMargin + xStart
|
|
117449
|
+
}, style2), {
|
|
117450
|
+
background: color2 || topLevelColor,
|
|
117451
|
+
height
|
|
117452
|
+
})
|
|
117453
|
+
}
|
|
117454
|
+
);
|
|
117455
|
+
let mismatchElements = [];
|
|
117456
|
+
if (selectionLayer2.mismatchPositions && selectionLayer2.mismatchPositions.length > 0) {
|
|
117457
|
+
const relativeToOverlap = selectionLayer2.mismatchPositions.filter((pos) => {
|
|
117458
|
+
const absPos = pos + selectionLayer2.start;
|
|
117459
|
+
return absPos >= overlap.start && absPos <= overlap.end;
|
|
117460
|
+
}).map((pos) => {
|
|
117461
|
+
return pos - (overlap.start - selectionLayer2.start);
|
|
117462
|
+
});
|
|
117463
|
+
mismatchElements = relativeToOverlap.map((pos, i) => /* @__PURE__ */ React__default.createElement(
|
|
117305
117464
|
"div",
|
|
117306
117465
|
{
|
|
117307
|
-
|
|
117308
|
-
|
|
117309
|
-
|
|
117310
|
-
|
|
117311
|
-
|
|
117312
|
-
|
|
117313
|
-
|
|
117314
|
-
|
|
117315
|
-
|
|
117316
|
-
|
|
117317
|
-
|
|
117318
|
-
})
|
|
117466
|
+
key: `${key}-mismatch-${i}`,
|
|
117467
|
+
className: "veSelectionLayer veMismatchLayer notCaret",
|
|
117468
|
+
style: {
|
|
117469
|
+
width: charWidth2,
|
|
117470
|
+
left: leftMargin + xStart + pos * charWidth2,
|
|
117471
|
+
top: 0,
|
|
117472
|
+
height: height || "100%",
|
|
117473
|
+
background: "red",
|
|
117474
|
+
position: "absolute",
|
|
117475
|
+
opacity: 0.5
|
|
117476
|
+
}
|
|
117319
117477
|
}
|
|
117320
|
-
)
|
|
117321
|
-
|
|
117322
|
-
];
|
|
117478
|
+
));
|
|
117479
|
+
}
|
|
117480
|
+
return [selectionElement, ...mismatchElements, ...caretSvgs];
|
|
117323
117481
|
});
|
|
117324
117482
|
} else {
|
|
117325
117483
|
return null;
|
|
@@ -122192,7 +122350,7 @@ function showFileDialog({ multiple = false, onSelect }) {
|
|
|
122192
122350
|
input.click();
|
|
122193
122351
|
}
|
|
122194
122352
|
__name(showFileDialog, "showFileDialog");
|
|
122195
|
-
const version = "0.7.
|
|
122353
|
+
const version = "0.7.29";
|
|
122196
122354
|
const packageJson = {
|
|
122197
122355
|
version
|
|
122198
122356
|
};
|
|
@@ -135650,10 +135808,10 @@ function requireLodash() {
|
|
|
135650
135808
|
return value > other;
|
|
135651
135809
|
}
|
|
135652
135810
|
__name(baseGt2, "baseGt");
|
|
135653
|
-
function
|
|
135811
|
+
function baseHas2(object3, key) {
|
|
135654
135812
|
return object3 != null && hasOwnProperty2.call(object3, key);
|
|
135655
135813
|
}
|
|
135656
|
-
__name(
|
|
135814
|
+
__name(baseHas2, "baseHas");
|
|
135657
135815
|
function baseHasIn2(object3, key) {
|
|
135658
135816
|
return object3 != null && key in Object2(object3);
|
|
135659
135817
|
}
|
|
@@ -138671,10 +138829,10 @@ function requireLodash() {
|
|
|
138671
138829
|
return tag == funcTag2 || tag == genTag2 || tag == asyncTag2 || tag == proxyTag2;
|
|
138672
138830
|
}
|
|
138673
138831
|
__name(isFunction2, "isFunction");
|
|
138674
|
-
function
|
|
138832
|
+
function isInteger(value) {
|
|
138675
138833
|
return typeof value == "number" && value == toInteger2(value);
|
|
138676
138834
|
}
|
|
138677
|
-
__name(
|
|
138835
|
+
__name(isInteger, "isInteger");
|
|
138678
138836
|
function isLength2(value) {
|
|
138679
138837
|
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER2;
|
|
138680
138838
|
}
|
|
@@ -138709,10 +138867,10 @@ function requireLodash() {
|
|
|
138709
138867
|
return baseIsNative2(value);
|
|
138710
138868
|
}
|
|
138711
138869
|
__name(isNative2, "isNative");
|
|
138712
|
-
function
|
|
138870
|
+
function isNull2(value) {
|
|
138713
138871
|
return value === null;
|
|
138714
138872
|
}
|
|
138715
|
-
__name(
|
|
138873
|
+
__name(isNull2, "isNull");
|
|
138716
138874
|
function isNil(value) {
|
|
138717
138875
|
return value == null;
|
|
138718
138876
|
}
|
|
@@ -138735,7 +138893,7 @@ function requireLodash() {
|
|
|
138735
138893
|
__name(isPlainObject2, "isPlainObject");
|
|
138736
138894
|
var isRegExp = nodeIsRegExp ? baseUnary2(nodeIsRegExp) : baseIsRegExp;
|
|
138737
138895
|
function isSafeInteger(value) {
|
|
138738
|
-
return
|
|
138896
|
+
return isInteger(value) && value >= -9007199254740991 && value <= MAX_SAFE_INTEGER2;
|
|
138739
138897
|
}
|
|
138740
138898
|
__name(isSafeInteger, "isSafeInteger");
|
|
138741
138899
|
var isSet2 = nodeIsSet2 ? baseUnary2(nodeIsSet2) : baseIsSet2;
|
|
@@ -138921,7 +139079,7 @@ function requireLodash() {
|
|
|
138921
139079
|
}
|
|
138922
139080
|
__name(get7, "get");
|
|
138923
139081
|
function has4(object3, path2) {
|
|
138924
|
-
return object3 != null && hasPath2(object3, path2,
|
|
139082
|
+
return object3 != null && hasPath2(object3, path2, baseHas2);
|
|
138925
139083
|
}
|
|
138926
139084
|
__name(has4, "has");
|
|
138927
139085
|
function hasIn2(object3, path2) {
|
|
@@ -139872,7 +140030,7 @@ function requireLodash() {
|
|
|
139872
140030
|
lodash2.isError = isError;
|
|
139873
140031
|
lodash2.isFinite = isFinite2;
|
|
139874
140032
|
lodash2.isFunction = isFunction2;
|
|
139875
|
-
lodash2.isInteger =
|
|
140033
|
+
lodash2.isInteger = isInteger;
|
|
139876
140034
|
lodash2.isLength = isLength2;
|
|
139877
140035
|
lodash2.isMap = isMap2;
|
|
139878
140036
|
lodash2.isMatch = isMatch;
|
|
@@ -139880,7 +140038,7 @@ function requireLodash() {
|
|
|
139880
140038
|
lodash2.isNaN = isNaN2;
|
|
139881
140039
|
lodash2.isNative = isNative2;
|
|
139882
140040
|
lodash2.isNil = isNil;
|
|
139883
|
-
lodash2.isNull =
|
|
140041
|
+
lodash2.isNull = isNull2;
|
|
139884
140042
|
lodash2.isNumber = isNumber2;
|
|
139885
140043
|
lodash2.isObject = isObject2;
|
|
139886
140044
|
lodash2.isObjectLike = isObjectLike2;
|
|
@@ -149018,6 +149176,7 @@ const _FindBar = class _FindBar extends React__default.Component {
|
|
|
149018
149176
|
annotationVisibilityShow: annotationVisibilityShow2,
|
|
149019
149177
|
updateAmbiguousOrLiteral: updateAmbiguousOrLiteral2,
|
|
149020
149178
|
updateDnaOrAA: updateDnaOrAA2,
|
|
149179
|
+
updateMismatchesAllowed: updateMismatchesAllowed2,
|
|
149021
149180
|
updateMatchNumber: _updateMatchNumber,
|
|
149022
149181
|
selectionLayerUpdate: selectionLayerUpdate2,
|
|
149023
149182
|
annotationSearchMatches,
|
|
@@ -149030,6 +149189,7 @@ const _FindBar = class _FindBar extends React__default.Component {
|
|
|
149030
149189
|
ambiguousOrLiteral,
|
|
149031
149190
|
matchesTotal = 0,
|
|
149032
149191
|
matchNumber = 0,
|
|
149192
|
+
mismatchesAllowed = 0,
|
|
149033
149193
|
isInline
|
|
149034
149194
|
} = findTool2;
|
|
149035
149195
|
const updateMatchNumber2 = /* @__PURE__ */ __name((...args) => {
|
|
@@ -149069,6 +149229,30 @@ const _FindBar = class _FindBar extends React__default.Component {
|
|
|
149069
149229
|
}, "onChange")
|
|
149070
149230
|
}
|
|
149071
149231
|
), /* @__PURE__ */ React__default.createElement(InfoHelper, { style: { marginLeft: 10 } }, /* @__PURE__ */ React__default.createElement("div", null, "Ambiguous substitutions:", /* @__PURE__ */ React__default.createElement("div", { style: { display: "flex", fontSize: 12 } }, /* @__PURE__ */ React__default.createElement("div", { style: { marginRight: 20 } }, /* @__PURE__ */ React__default.createElement("div", { style: { fontSize: 14, marginBottom: 4, marginTop: 5 } }, "DNA:"), /* @__PURE__ */ React__default.createElement("div", null, "M: AC"), /* @__PURE__ */ React__default.createElement("div", null, "R: AG"), /* @__PURE__ */ React__default.createElement("div", null, "W: AT"), /* @__PURE__ */ React__default.createElement("div", null, "S: CG"), /* @__PURE__ */ React__default.createElement("div", null, "Y: CT"), /* @__PURE__ */ React__default.createElement("div", null, "K: GT"), /* @__PURE__ */ React__default.createElement("div", null, "V: ACG"), /* @__PURE__ */ React__default.createElement("div", null, "H: ACT"), /* @__PURE__ */ React__default.createElement("div", null, "D: AGT"), /* @__PURE__ */ React__default.createElement("div", null, "B: CGT"), /* @__PURE__ */ React__default.createElement("div", null, "X: GATC"), /* @__PURE__ */ React__default.createElement("div", null, "N: GATC"), /* @__PURE__ */ React__default.createElement("div", null, "*: any")), /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement("div", { style: { fontSize: 14, marginBottom: 4, marginTop: 5 } }, "AA:"), /* @__PURE__ */ React__default.createElement("div", null, "B: ND"), /* @__PURE__ */ React__default.createElement("div", null, "J: IL"), /* @__PURE__ */ React__default.createElement("div", null, "X: ACDEFGHIKLMNPQRSTVWY"), /* @__PURE__ */ React__default.createElement("div", null, "Z: QE"), /* @__PURE__ */ React__default.createElement("div", null, "*: any")))))),
|
|
149232
|
+
/* @__PURE__ */ React__default.createElement(
|
|
149233
|
+
"div",
|
|
149234
|
+
{
|
|
149235
|
+
key: "mismatchesAllowed",
|
|
149236
|
+
style: { marginTop: "8px", display: "flex", alignItems: "center" }
|
|
149237
|
+
},
|
|
149238
|
+
/* @__PURE__ */ React__default.createElement("label", { style: { marginRight: "8px" } }, "Mismatches Allowed:"),
|
|
149239
|
+
/* @__PURE__ */ React__default.createElement(
|
|
149240
|
+
NumericInput,
|
|
149241
|
+
{
|
|
149242
|
+
min: 0,
|
|
149243
|
+
max: 10,
|
|
149244
|
+
className: "tg-mismatches-allowed-input",
|
|
149245
|
+
style: { width: "60px" },
|
|
149246
|
+
value: mismatchesAllowed,
|
|
149247
|
+
disabled: dnaOrAA !== "DNA" || ambiguousOrLiteral !== "LITERAL",
|
|
149248
|
+
onValueChange: /* @__PURE__ */ __name((value) => {
|
|
149249
|
+
const newValue = Math.max(0, parseInt(value, 10) || 0);
|
|
149250
|
+
updateMismatchesAllowed2(newValue);
|
|
149251
|
+
}, "onValueChange")
|
|
149252
|
+
}
|
|
149253
|
+
),
|
|
149254
|
+
/* @__PURE__ */ React__default.createElement(InfoHelper, { style: { marginLeft: 10 } }, /* @__PURE__ */ React__default.createElement("div", null, "Number of mismatches allowed when searching DNA sequences with literal matching.", /* @__PURE__ */ React__default.createElement("br", null), /* @__PURE__ */ React__default.createElement("br", null), "Higher values may slow down search performance."))
|
|
149255
|
+
),
|
|
149072
149256
|
/* @__PURE__ */ React__default.createElement(
|
|
149073
149257
|
Switch,
|
|
149074
149258
|
{
|