@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.cjs.js
CHANGED
|
@@ -5801,12 +5801,12 @@ var freeGlobal = typeof global == "object" && global && global.Object === Object
|
|
|
5801
5801
|
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
5802
5802
|
var root$4 = freeGlobal || freeSelf || Function("return this")();
|
|
5803
5803
|
var Symbol$1 = root$4.Symbol;
|
|
5804
|
-
var objectProto$
|
|
5805
|
-
var hasOwnProperty$
|
|
5806
|
-
var nativeObjectToString$2 = objectProto$
|
|
5804
|
+
var objectProto$k = Object.prototype;
|
|
5805
|
+
var hasOwnProperty$k = objectProto$k.hasOwnProperty;
|
|
5806
|
+
var nativeObjectToString$2 = objectProto$k.toString;
|
|
5807
5807
|
var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : void 0;
|
|
5808
5808
|
function getRawTag(value) {
|
|
5809
|
-
var isOwn = hasOwnProperty$
|
|
5809
|
+
var isOwn = hasOwnProperty$k.call(value, symToStringTag$1), tag = value[symToStringTag$1];
|
|
5810
5810
|
try {
|
|
5811
5811
|
value[symToStringTag$1] = void 0;
|
|
5812
5812
|
var unmasked = true;
|
|
@@ -5823,8 +5823,8 @@ function getRawTag(value) {
|
|
|
5823
5823
|
return result;
|
|
5824
5824
|
}
|
|
5825
5825
|
__name(getRawTag, "getRawTag");
|
|
5826
|
-
var objectProto$
|
|
5827
|
-
var nativeObjectToString$1 = objectProto$
|
|
5826
|
+
var objectProto$j = Object.prototype;
|
|
5827
|
+
var nativeObjectToString$1 = objectProto$j.toString;
|
|
5828
5828
|
function objectToString(value) {
|
|
5829
5829
|
return nativeObjectToString$1.call(value);
|
|
5830
5830
|
}
|
|
@@ -5971,11 +5971,11 @@ function toSource(func) {
|
|
|
5971
5971
|
__name(toSource, "toSource");
|
|
5972
5972
|
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
5973
5973
|
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
5974
|
-
var funcProto$1 = Function.prototype, objectProto$
|
|
5974
|
+
var funcProto$1 = Function.prototype, objectProto$i = Object.prototype;
|
|
5975
5975
|
var funcToString$1 = funcProto$1.toString;
|
|
5976
|
-
var hasOwnProperty$
|
|
5976
|
+
var hasOwnProperty$j = objectProto$i.hasOwnProperty;
|
|
5977
5977
|
var reIsNative = RegExp(
|
|
5978
|
-
"^" + funcToString$1.call(hasOwnProperty$
|
|
5978
|
+
"^" + funcToString$1.call(hasOwnProperty$j).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
5979
5979
|
);
|
|
5980
5980
|
function baseIsNative(value) {
|
|
5981
5981
|
if (!isObject$2(value) || isMasked(value)) {
|
|
@@ -6148,11 +6148,11 @@ function eq$1(value, other) {
|
|
|
6148
6148
|
return value === other || value !== value && other !== other;
|
|
6149
6149
|
}
|
|
6150
6150
|
__name(eq$1, "eq$1");
|
|
6151
|
-
var objectProto$
|
|
6152
|
-
var hasOwnProperty$
|
|
6151
|
+
var objectProto$h = Object.prototype;
|
|
6152
|
+
var hasOwnProperty$i = objectProto$h.hasOwnProperty;
|
|
6153
6153
|
function assignValue(object3, key, value) {
|
|
6154
6154
|
var objValue = object3[key];
|
|
6155
|
-
if (!(hasOwnProperty$
|
|
6155
|
+
if (!(hasOwnProperty$i.call(object3, key) && eq$1(objValue, value)) || value === void 0 && !(key in object3)) {
|
|
6156
6156
|
baseAssignValue(object3, key, value);
|
|
6157
6157
|
}
|
|
6158
6158
|
}
|
|
@@ -6237,9 +6237,9 @@ function createAssigner(assigner) {
|
|
|
6237
6237
|
});
|
|
6238
6238
|
}
|
|
6239
6239
|
__name(createAssigner, "createAssigner");
|
|
6240
|
-
var objectProto$
|
|
6240
|
+
var objectProto$g = Object.prototype;
|
|
6241
6241
|
function isPrototype(value) {
|
|
6242
|
-
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$
|
|
6242
|
+
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$g;
|
|
6243
6243
|
return value === proto;
|
|
6244
6244
|
}
|
|
6245
6245
|
__name(isPrototype, "isPrototype");
|
|
@@ -6256,13 +6256,13 @@ function baseIsArguments(value) {
|
|
|
6256
6256
|
return isObjectLike$1(value) && baseGetTag(value) == argsTag$3;
|
|
6257
6257
|
}
|
|
6258
6258
|
__name(baseIsArguments, "baseIsArguments");
|
|
6259
|
-
var objectProto$
|
|
6260
|
-
var hasOwnProperty$
|
|
6261
|
-
var propertyIsEnumerable$1 = objectProto$
|
|
6259
|
+
var objectProto$f = Object.prototype;
|
|
6260
|
+
var hasOwnProperty$h = objectProto$f.hasOwnProperty;
|
|
6261
|
+
var propertyIsEnumerable$1 = objectProto$f.propertyIsEnumerable;
|
|
6262
6262
|
var isArguments$2 = baseIsArguments(/* @__PURE__ */ function() {
|
|
6263
6263
|
return arguments;
|
|
6264
6264
|
}()) ? baseIsArguments : function(value) {
|
|
6265
|
-
return isObjectLike$1(value) && hasOwnProperty$
|
|
6265
|
+
return isObjectLike$1(value) && hasOwnProperty$h.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
|
|
6266
6266
|
};
|
|
6267
6267
|
function stubFalse() {
|
|
6268
6268
|
return false;
|
|
@@ -6271,8 +6271,8 @@ __name(stubFalse, "stubFalse");
|
|
|
6271
6271
|
var freeExports$2 = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
6272
6272
|
var freeModule$2 = freeExports$2 && typeof module == "object" && module && !module.nodeType && module;
|
|
6273
6273
|
var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2;
|
|
6274
|
-
var Buffer$
|
|
6275
|
-
var nativeIsBuffer = Buffer$
|
|
6274
|
+
var Buffer$2 = moduleExports$2 ? root$4.Buffer : void 0;
|
|
6275
|
+
var nativeIsBuffer = Buffer$2 ? Buffer$2.isBuffer : void 0;
|
|
6276
6276
|
var isBuffer$1 = nativeIsBuffer || stubFalse;
|
|
6277
6277
|
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]";
|
|
6278
6278
|
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]";
|
|
@@ -6305,12 +6305,12 @@ var nodeUtil = function() {
|
|
|
6305
6305
|
}();
|
|
6306
6306
|
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
6307
6307
|
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
6308
|
-
var objectProto$
|
|
6309
|
-
var hasOwnProperty$
|
|
6308
|
+
var objectProto$e = Object.prototype;
|
|
6309
|
+
var hasOwnProperty$g = objectProto$e.hasOwnProperty;
|
|
6310
6310
|
function arrayLikeKeys(value, inherited) {
|
|
6311
6311
|
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;
|
|
6312
6312
|
for (var key in value) {
|
|
6313
|
-
if ((inherited || hasOwnProperty$
|
|
6313
|
+
if ((inherited || hasOwnProperty$g.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
6314
6314
|
(key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
6315
6315
|
isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
6316
6316
|
isType2 && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
|
|
@@ -6328,15 +6328,15 @@ function overArg(func, transform) {
|
|
|
6328
6328
|
}
|
|
6329
6329
|
__name(overArg, "overArg");
|
|
6330
6330
|
var nativeKeys = overArg(Object.keys, Object);
|
|
6331
|
-
var objectProto$
|
|
6332
|
-
var hasOwnProperty$
|
|
6331
|
+
var objectProto$d = Object.prototype;
|
|
6332
|
+
var hasOwnProperty$f = objectProto$d.hasOwnProperty;
|
|
6333
6333
|
function baseKeys(object3) {
|
|
6334
6334
|
if (!isPrototype(object3)) {
|
|
6335
6335
|
return nativeKeys(object3);
|
|
6336
6336
|
}
|
|
6337
6337
|
var result = [];
|
|
6338
6338
|
for (var key in Object(object3)) {
|
|
6339
|
-
if (hasOwnProperty$
|
|
6339
|
+
if (hasOwnProperty$f.call(object3, key) && key != "constructor") {
|
|
6340
6340
|
result.push(key);
|
|
6341
6341
|
}
|
|
6342
6342
|
}
|
|
@@ -6347,15 +6347,15 @@ function keys$1(object3) {
|
|
|
6347
6347
|
return isArrayLike(object3) ? arrayLikeKeys(object3) : baseKeys(object3);
|
|
6348
6348
|
}
|
|
6349
6349
|
__name(keys$1, "keys$1");
|
|
6350
|
-
var objectProto$
|
|
6351
|
-
var hasOwnProperty$
|
|
6350
|
+
var objectProto$c = Object.prototype;
|
|
6351
|
+
var hasOwnProperty$e = objectProto$c.hasOwnProperty;
|
|
6352
6352
|
var assign$2 = createAssigner(function(object3, source) {
|
|
6353
6353
|
if (isPrototype(source) || isArrayLike(source)) {
|
|
6354
6354
|
copyObject(source, keys$1(source), object3);
|
|
6355
6355
|
return;
|
|
6356
6356
|
}
|
|
6357
6357
|
for (var key in source) {
|
|
6358
|
-
if (hasOwnProperty$
|
|
6358
|
+
if (hasOwnProperty$e.call(source, key)) {
|
|
6359
6359
|
assignValue(object3, key, source[key]);
|
|
6360
6360
|
}
|
|
6361
6361
|
}
|
|
@@ -6370,15 +6370,15 @@ function nativeKeysIn(object3) {
|
|
|
6370
6370
|
return result;
|
|
6371
6371
|
}
|
|
6372
6372
|
__name(nativeKeysIn, "nativeKeysIn");
|
|
6373
|
-
var objectProto$
|
|
6374
|
-
var hasOwnProperty$
|
|
6373
|
+
var objectProto$b = Object.prototype;
|
|
6374
|
+
var hasOwnProperty$d = objectProto$b.hasOwnProperty;
|
|
6375
6375
|
function baseKeysIn(object3) {
|
|
6376
6376
|
if (!isObject$2(object3)) {
|
|
6377
6377
|
return nativeKeysIn(object3);
|
|
6378
6378
|
}
|
|
6379
6379
|
var isProto = isPrototype(object3), result = [];
|
|
6380
6380
|
for (var key in object3) {
|
|
6381
|
-
if (!(key == "constructor" && (isProto || !hasOwnProperty$
|
|
6381
|
+
if (!(key == "constructor" && (isProto || !hasOwnProperty$d.call(object3, key)))) {
|
|
6382
6382
|
result.push(key);
|
|
6383
6383
|
}
|
|
6384
6384
|
}
|
|
@@ -6417,22 +6417,22 @@ function hashDelete(key) {
|
|
|
6417
6417
|
}
|
|
6418
6418
|
__name(hashDelete, "hashDelete");
|
|
6419
6419
|
var HASH_UNDEFINED$2 = "__lodash_hash_undefined__";
|
|
6420
|
-
var objectProto$
|
|
6421
|
-
var hasOwnProperty$
|
|
6420
|
+
var objectProto$a = Object.prototype;
|
|
6421
|
+
var hasOwnProperty$c = objectProto$a.hasOwnProperty;
|
|
6422
6422
|
function hashGet(key) {
|
|
6423
6423
|
var data = this.__data__;
|
|
6424
6424
|
if (nativeCreate) {
|
|
6425
6425
|
var result = data[key];
|
|
6426
6426
|
return result === HASH_UNDEFINED$2 ? void 0 : result;
|
|
6427
6427
|
}
|
|
6428
|
-
return hasOwnProperty$
|
|
6428
|
+
return hasOwnProperty$c.call(data, key) ? data[key] : void 0;
|
|
6429
6429
|
}
|
|
6430
6430
|
__name(hashGet, "hashGet");
|
|
6431
|
-
var objectProto$
|
|
6432
|
-
var hasOwnProperty$
|
|
6431
|
+
var objectProto$9 = Object.prototype;
|
|
6432
|
+
var hasOwnProperty$b = objectProto$9.hasOwnProperty;
|
|
6433
6433
|
function hashHas(key) {
|
|
6434
6434
|
var data = this.__data__;
|
|
6435
|
-
return nativeCreate ? data[key] !== void 0 : hasOwnProperty$
|
|
6435
|
+
return nativeCreate ? data[key] !== void 0 : hasOwnProperty$b.call(data, key);
|
|
6436
6436
|
}
|
|
6437
6437
|
__name(hashHas, "hashHas");
|
|
6438
6438
|
var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
|
|
@@ -6695,9 +6695,9 @@ function flatRest(func) {
|
|
|
6695
6695
|
__name(flatRest, "flatRest");
|
|
6696
6696
|
var getPrototype = overArg(Object.getPrototypeOf, Object);
|
|
6697
6697
|
var objectTag$3 = "[object Object]";
|
|
6698
|
-
var funcProto = Function.prototype, objectProto$
|
|
6698
|
+
var funcProto = Function.prototype, objectProto$8 = Object.prototype;
|
|
6699
6699
|
var funcToString = funcProto.toString;
|
|
6700
|
-
var hasOwnProperty$
|
|
6700
|
+
var hasOwnProperty$a = objectProto$8.hasOwnProperty;
|
|
6701
6701
|
var objectCtorString = funcToString.call(Object);
|
|
6702
6702
|
function isPlainObject$2(value) {
|
|
6703
6703
|
if (!isObjectLike$1(value) || baseGetTag(value) != objectTag$3) {
|
|
@@ -6707,7 +6707,7 @@ function isPlainObject$2(value) {
|
|
|
6707
6707
|
if (proto === null) {
|
|
6708
6708
|
return true;
|
|
6709
6709
|
}
|
|
6710
|
-
var Ctor = hasOwnProperty$
|
|
6710
|
+
var Ctor = hasOwnProperty$a.call(proto, "constructor") && proto.constructor;
|
|
6711
6711
|
return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
|
|
6712
6712
|
}
|
|
6713
6713
|
__name(isPlainObject$2, "isPlainObject$2");
|
|
@@ -7142,7 +7142,7 @@ __name(baseAssignIn, "baseAssignIn");
|
|
|
7142
7142
|
var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
7143
7143
|
var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
|
|
7144
7144
|
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
7145
|
-
var Buffer$
|
|
7145
|
+
var Buffer$1 = moduleExports ? root$4.Buffer : void 0, allocUnsafe = Buffer$1 ? Buffer$1.allocUnsafe : void 0;
|
|
7146
7146
|
function cloneBuffer(buffer2, isDeep) {
|
|
7147
7147
|
if (isDeep) {
|
|
7148
7148
|
return buffer2.slice();
|
|
@@ -7167,8 +7167,8 @@ function stubArray() {
|
|
|
7167
7167
|
return [];
|
|
7168
7168
|
}
|
|
7169
7169
|
__name(stubArray, "stubArray");
|
|
7170
|
-
var objectProto$
|
|
7171
|
-
var propertyIsEnumerable = objectProto$
|
|
7170
|
+
var objectProto$7 = Object.prototype;
|
|
7171
|
+
var propertyIsEnumerable = objectProto$7.propertyIsEnumerable;
|
|
7172
7172
|
var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
|
|
7173
7173
|
var getSymbols = !nativeGetSymbols$1 ? stubArray : function(object3) {
|
|
7174
7174
|
if (object3 == null) {
|
|
@@ -7236,11 +7236,11 @@ if (DataView$1 && getTag$1(new DataView$1(new ArrayBuffer(1))) != dataViewTag$3
|
|
|
7236
7236
|
return result;
|
|
7237
7237
|
}, "getTag$1");
|
|
7238
7238
|
}
|
|
7239
|
-
var objectProto$
|
|
7240
|
-
var hasOwnProperty$
|
|
7239
|
+
var objectProto$6 = Object.prototype;
|
|
7240
|
+
var hasOwnProperty$9 = objectProto$6.hasOwnProperty;
|
|
7241
7241
|
function initCloneArray(array2) {
|
|
7242
7242
|
var length = array2.length, result = new array2.constructor(length);
|
|
7243
|
-
if (length && typeof array2[0] == "string" && hasOwnProperty$
|
|
7243
|
+
if (length && typeof array2[0] == "string" && hasOwnProperty$9.call(array2, "index")) {
|
|
7244
7244
|
result.index = array2.index;
|
|
7245
7245
|
result.input = array2.input;
|
|
7246
7246
|
}
|
|
@@ -7554,8 +7554,8 @@ function equalByTag(object3, other, tag, bitmask, customizer, equalFunc, stack)
|
|
|
7554
7554
|
}
|
|
7555
7555
|
__name(equalByTag, "equalByTag");
|
|
7556
7556
|
var COMPARE_PARTIAL_FLAG$3 = 1;
|
|
7557
|
-
var objectProto$
|
|
7558
|
-
var hasOwnProperty$
|
|
7557
|
+
var objectProto$5 = Object.prototype;
|
|
7558
|
+
var hasOwnProperty$8 = objectProto$5.hasOwnProperty;
|
|
7559
7559
|
function equalObjects(object3, other, bitmask, customizer, equalFunc, stack) {
|
|
7560
7560
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, objProps = getAllKeys(object3), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
|
|
7561
7561
|
if (objLength != othLength && !isPartial) {
|
|
@@ -7564,7 +7564,7 @@ function equalObjects(object3, other, bitmask, customizer, equalFunc, stack) {
|
|
|
7564
7564
|
var index2 = objLength;
|
|
7565
7565
|
while (index2--) {
|
|
7566
7566
|
var key = objProps[index2];
|
|
7567
|
-
if (!(isPartial ? key in other : hasOwnProperty$
|
|
7567
|
+
if (!(isPartial ? key in other : hasOwnProperty$8.call(other, key))) {
|
|
7568
7568
|
return false;
|
|
7569
7569
|
}
|
|
7570
7570
|
}
|
|
@@ -7602,8 +7602,8 @@ function equalObjects(object3, other, bitmask, customizer, equalFunc, stack) {
|
|
|
7602
7602
|
__name(equalObjects, "equalObjects");
|
|
7603
7603
|
var COMPARE_PARTIAL_FLAG$2 = 1;
|
|
7604
7604
|
var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]";
|
|
7605
|
-
var objectProto$
|
|
7606
|
-
var hasOwnProperty$
|
|
7605
|
+
var objectProto$4 = Object.prototype;
|
|
7606
|
+
var hasOwnProperty$7 = objectProto$4.hasOwnProperty;
|
|
7607
7607
|
function baseIsEqualDeep(object3, other, bitmask, customizer, equalFunc, stack) {
|
|
7608
7608
|
var objIsArr = isArray$2(object3), othIsArr = isArray$2(other), objTag = objIsArr ? arrayTag : getTag$1(object3), othTag = othIsArr ? arrayTag : getTag$1(other);
|
|
7609
7609
|
objTag = objTag == argsTag ? objectTag : objTag;
|
|
@@ -7621,7 +7621,7 @@ function baseIsEqualDeep(object3, other, bitmask, customizer, equalFunc, stack)
|
|
|
7621
7621
|
return objIsArr || isTypedArray(object3) ? equalArrays(object3, other, bitmask, customizer, equalFunc, stack) : equalByTag(object3, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
7622
7622
|
}
|
|
7623
7623
|
if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
|
|
7624
|
-
var objIsWrapped = objIsObj && hasOwnProperty$
|
|
7624
|
+
var objIsWrapped = objIsObj && hasOwnProperty$7.call(object3, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty$7.call(other, "__wrapped__");
|
|
7625
7625
|
if (objIsWrapped || othIsWrapped) {
|
|
7626
7626
|
var objUnwrapped = objIsWrapped ? object3.value() : object3, othUnwrapped = othIsWrapped ? other.value() : other;
|
|
7627
7627
|
stack || (stack = new Stack());
|
|
@@ -7833,10 +7833,10 @@ function createAggregator(setter, initializer) {
|
|
|
7833
7833
|
};
|
|
7834
7834
|
}
|
|
7835
7835
|
__name(createAggregator, "createAggregator");
|
|
7836
|
-
var objectProto$
|
|
7837
|
-
var hasOwnProperty$
|
|
7836
|
+
var objectProto$3 = Object.prototype;
|
|
7837
|
+
var hasOwnProperty$6 = objectProto$3.hasOwnProperty;
|
|
7838
7838
|
var countBy = createAggregator(function(result, value, key) {
|
|
7839
|
-
if (hasOwnProperty$
|
|
7839
|
+
if (hasOwnProperty$6.call(result, key)) {
|
|
7840
7840
|
++result[key];
|
|
7841
7841
|
} else {
|
|
7842
7842
|
baseAssignValue(result, key, 1);
|
|
@@ -8072,15 +8072,6 @@ var differenceBy = baseRest(function(array2, values3) {
|
|
|
8072
8072
|
}
|
|
8073
8073
|
return isArrayLikeObject(array2) ? baseDifference(array2, baseFlatten(values3, 1, isArrayLikeObject, true), baseIteratee(iteratee)) : [];
|
|
8074
8074
|
});
|
|
8075
|
-
function drop$2(array2, n2, guard) {
|
|
8076
|
-
var length = array2 == null ? 0 : array2.length;
|
|
8077
|
-
if (!length) {
|
|
8078
|
-
return [];
|
|
8079
|
-
}
|
|
8080
|
-
n2 = n2 === void 0 ? 1 : toInteger(n2);
|
|
8081
|
-
return baseSlice(array2, n2 < 0 ? 0 : n2, length);
|
|
8082
|
-
}
|
|
8083
|
-
__name(drop$2, "drop$2");
|
|
8084
8075
|
function castFunction(value) {
|
|
8085
8076
|
return typeof value == "function" ? value : identity$3;
|
|
8086
8077
|
}
|
|
@@ -8189,6 +8180,16 @@ function baseGt(value, other) {
|
|
|
8189
8180
|
return value > other;
|
|
8190
8181
|
}
|
|
8191
8182
|
__name(baseGt, "baseGt");
|
|
8183
|
+
var objectProto$2 = Object.prototype;
|
|
8184
|
+
var hasOwnProperty$5 = objectProto$2.hasOwnProperty;
|
|
8185
|
+
function baseHas(object3, key) {
|
|
8186
|
+
return object3 != null && hasOwnProperty$5.call(object3, key);
|
|
8187
|
+
}
|
|
8188
|
+
__name(baseHas, "baseHas");
|
|
8189
|
+
function has$3(object3, path2) {
|
|
8190
|
+
return object3 != null && hasPath(object3, path2, baseHas);
|
|
8191
|
+
}
|
|
8192
|
+
__name(has$3, "has$3");
|
|
8192
8193
|
var stringTag = "[object String]";
|
|
8193
8194
|
function isString$1(value) {
|
|
8194
8195
|
return typeof value == "string" || !isArray$2(value) && isObjectLike$1(value) && baseGetTag(value) == stringTag;
|
|
@@ -8322,15 +8323,15 @@ function isEqualWith(value, other, customizer) {
|
|
|
8322
8323
|
return result === void 0 ? baseIsEqual(value, other, void 0, customizer) : !!result;
|
|
8323
8324
|
}
|
|
8324
8325
|
__name(isEqualWith, "isEqualWith");
|
|
8325
|
-
function isInteger(value) {
|
|
8326
|
-
return typeof value == "number" && value == toInteger(value);
|
|
8327
|
-
}
|
|
8328
|
-
__name(isInteger, "isInteger");
|
|
8329
8326
|
var numberTag = "[object Number]";
|
|
8330
8327
|
function isNumber$2(value) {
|
|
8331
8328
|
return typeof value == "number" || isObjectLike$1(value) && baseGetTag(value) == numberTag;
|
|
8332
8329
|
}
|
|
8333
8330
|
__name(isNumber$2, "isNumber$2");
|
|
8331
|
+
function isNull(value) {
|
|
8332
|
+
return value === null;
|
|
8333
|
+
}
|
|
8334
|
+
__name(isNull, "isNull");
|
|
8334
8335
|
function isUndefined(value) {
|
|
8335
8336
|
return value === void 0;
|
|
8336
8337
|
}
|
|
@@ -16009,6 +16010,7 @@ var itemSizeEstimator = /* @__PURE__ */ __name(function itemSizeEstimator2() {
|
|
|
16009
16010
|
return 41.36;
|
|
16010
16011
|
}, "itemSizeEstimator");
|
|
16011
16012
|
var ReactTableDefaults = defaultProps$1;
|
|
16013
|
+
var VIRTUALIZE_CUTOFF_LENGTH = 200;
|
|
16012
16014
|
var ReactTable = function(_Methods) {
|
|
16013
16015
|
_inherits$8(ReactTable2, _Methods);
|
|
16014
16016
|
function ReactTable2(props) {
|
|
@@ -16594,7 +16596,7 @@ var ReactTable = function(_Methods) {
|
|
|
16594
16596
|
minWidth: rowMinWidth + "px"
|
|
16595
16597
|
})
|
|
16596
16598
|
}, tBodyProps.rest),
|
|
16597
|
-
pageRows.length <
|
|
16599
|
+
_this2.props.noVirtual || pageRows.length < VIRTUALIZE_CUTOFF_LENGTH ? pageRows.map(function(d2, i) {
|
|
16598
16600
|
return makePageRow(d2, i);
|
|
16599
16601
|
}) : React.createElement(ReactList, {
|
|
16600
16602
|
type: "variable",
|
|
@@ -16698,7 +16700,7 @@ const getIdOrCodeOrIndex = /* @__PURE__ */ __name((record, rowIndex) => {
|
|
|
16698
16700
|
const getSelectedRowsFromEntities = /* @__PURE__ */ __name((entities, idMap) => {
|
|
16699
16701
|
if (!idMap) return [];
|
|
16700
16702
|
return entities.reduce((acc, entity, i) => {
|
|
16701
|
-
return idMap[getIdOrCodeOrIndex(entity, i)] ? acc.concat(i) : acc;
|
|
16703
|
+
return idMap[getIdOrCodeOrIndex(entity, i)] ? acc.concat([i]) : acc;
|
|
16702
16704
|
}, []);
|
|
16703
16705
|
}, "getSelectedRowsFromEntities");
|
|
16704
16706
|
const removeCleanRows = /* @__PURE__ */ __name((entities, cellValidation) => {
|
|
@@ -16817,9 +16819,9 @@ const stripNumberAtEnd = /* @__PURE__ */ __name((str) => {
|
|
|
16817
16819
|
var _a2;
|
|
16818
16820
|
return (_a2 = str == null ? void 0 : str.replace) == null ? void 0 : _a2.call(str, getNumberStrAtEnd(str), "");
|
|
16819
16821
|
}, "stripNumberAtEnd");
|
|
16820
|
-
const getAllRows = /* @__PURE__ */ __name((
|
|
16821
|
-
|
|
16822
|
-
const allRowEls =
|
|
16822
|
+
const getAllRows = /* @__PURE__ */ __name((tableRef) => {
|
|
16823
|
+
var _a2, _b2;
|
|
16824
|
+
const allRowEls = (_b2 = (_a2 = tableRef.current) == null ? void 0 : _a2.tableRef) == null ? void 0 : _b2.querySelectorAll(".rt-tr");
|
|
16823
16825
|
if (!allRowEls || !allRowEls.length) {
|
|
16824
16826
|
return;
|
|
16825
16827
|
}
|
|
@@ -17086,14 +17088,14 @@ const handleCopyRows = /* @__PURE__ */ __name((rowElsToCopy, { specificColumn, o
|
|
|
17086
17088
|
handleCopyHelper(textToCopy, jsonToCopy, onFinishMsg || "Row Copied");
|
|
17087
17089
|
}
|
|
17088
17090
|
}, "handleCopyRows");
|
|
17089
|
-
const handleCopyColumn = /* @__PURE__ */ __name((
|
|
17091
|
+
const handleCopyColumn = /* @__PURE__ */ __name((tableRef, cellWrapper, selectedRecords) => {
|
|
17090
17092
|
const specificColumn = cellWrapper.getAttribute("data-test");
|
|
17091
|
-
let rowElsToCopy = getAllRows(
|
|
17093
|
+
let rowElsToCopy = getAllRows(tableRef);
|
|
17092
17094
|
if (!rowElsToCopy) return;
|
|
17093
17095
|
if (selectedRecords) {
|
|
17094
|
-
const ids2 = selectedRecords.map((
|
|
17096
|
+
const ids2 = selectedRecords.map((e) => {
|
|
17095
17097
|
var _a2;
|
|
17096
|
-
return (_a2 = getIdOrCodeOrIndex(
|
|
17098
|
+
return (_a2 = getIdOrCodeOrIndex(e)) == null ? void 0 : _a2.toString();
|
|
17097
17099
|
});
|
|
17098
17100
|
rowElsToCopy = Array.from(rowElsToCopy).filter((rowEl) => {
|
|
17099
17101
|
var _a2;
|
|
@@ -17126,9 +17128,9 @@ const isBottomRightCornerOfRectangle = /* @__PURE__ */ __name(({
|
|
|
17126
17128
|
const isBottomRight = i === lastRowIndex && cellIndex === lastCellIndex;
|
|
17127
17129
|
return isBottomRight;
|
|
17128
17130
|
}, "isBottomRightCornerOfRectangle");
|
|
17129
|
-
const handleCopyTable = /* @__PURE__ */ __name((
|
|
17131
|
+
const handleCopyTable = /* @__PURE__ */ __name((tableRef, opts2) => {
|
|
17130
17132
|
try {
|
|
17131
|
-
const allRowEls = getAllRows(
|
|
17133
|
+
const allRowEls = getAllRows(tableRef);
|
|
17132
17134
|
if (!allRowEls) return;
|
|
17133
17135
|
handleCopyRows(allRowEls, __spreadProps(__spreadValues({}, opts2), {
|
|
17134
17136
|
onFinishMsg: "Table Copied"
|
|
@@ -17165,13 +17167,15 @@ const useTableEntities = /* @__PURE__ */ __name((tableFormName) => {
|
|
|
17165
17167
|
},
|
|
17166
17168
|
[dispatch, tableFormName]
|
|
17167
17169
|
);
|
|
17168
|
-
const { allOrderedEntities, selectedEntities } = reactRedux.useSelector(
|
|
17169
|
-
|
|
17170
|
-
|
|
17171
|
-
|
|
17172
|
-
|
|
17173
|
-
|
|
17174
|
-
|
|
17170
|
+
const { allOrderedEntities, selectedEntities } = reactRedux.useSelector(
|
|
17171
|
+
(state2) => {
|
|
17172
|
+
var _a2, _b2, _c, _d, _e, _f;
|
|
17173
|
+
return {
|
|
17174
|
+
allOrderedEntities: (_c = (_b2 = (_a2 = state2.form) == null ? void 0 : _a2[tableFormName]) == null ? void 0 : _b2.values) == null ? void 0 : _c.allOrderedEntities,
|
|
17175
|
+
selectedEntities: (_f = (_e = (_d = state2.form) == null ? void 0 : _d[tableFormName]) == null ? void 0 : _e.values) == null ? void 0 : _f.reduxFormSelectedEntityIdMap
|
|
17176
|
+
};
|
|
17177
|
+
}
|
|
17178
|
+
);
|
|
17175
17179
|
return { selectTableEntities, allOrderedEntities, selectedEntities };
|
|
17176
17180
|
}, "useTableEntities");
|
|
17177
17181
|
const useDeepEqualMemo = /* @__PURE__ */ __name((value) => {
|
|
@@ -19545,293 +19549,501 @@ function requireLib$8() {
|
|
|
19545
19549
|
__name(requireLib$8, "requireLib$8");
|
|
19546
19550
|
var libExports$3 = /* @__PURE__ */ requireLib$8();
|
|
19547
19551
|
const queryString = /* @__PURE__ */ getDefaultExportFromCjs(libExports$3);
|
|
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
|
-
|
|
19578
|
-
|
|
19579
|
-
|
|
19580
|
-
|
|
19581
|
-
|
|
19582
|
-
|
|
19583
|
-
|
|
19584
|
-
|
|
19585
|
-
|
|
19586
|
-
|
|
19587
|
-
|
|
19588
|
-
|
|
19589
|
-
|
|
19590
|
-
|
|
19591
|
-
|
|
19592
|
-
}
|
|
19593
|
-
|
|
19594
|
-
|
|
19595
|
-
if (S2(t3)) return t3.clone();
|
|
19596
|
-
var n3 = "object" == typeof e2 ? e2 : {};
|
|
19597
|
-
return n3.date = t3, n3.args = arguments, new _2(n3);
|
|
19598
|
-
}, "O"), b3 = v2;
|
|
19599
|
-
b3.l = w2, b3.i = S2, b3.w = function(t3, e2) {
|
|
19600
|
-
return O2(t3, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
|
|
19601
|
-
};
|
|
19602
|
-
var _2 = function() {
|
|
19603
|
-
function M3(t3) {
|
|
19604
|
-
this.$L = w2(t3.locale, null, true), this.parse(t3), this.$x = this.$x || t3.x || {}, this[p2] = true;
|
|
19552
|
+
function tableQueryParamsToHasuraClauses({
|
|
19553
|
+
page,
|
|
19554
|
+
pageSize,
|
|
19555
|
+
searchTerm,
|
|
19556
|
+
filters,
|
|
19557
|
+
order: order2,
|
|
19558
|
+
schema: schema2,
|
|
19559
|
+
// Add schema as a parameter
|
|
19560
|
+
additionalFilter
|
|
19561
|
+
}) {
|
|
19562
|
+
const ccFields = getFieldsMappedByCCDisplayName(schema2);
|
|
19563
|
+
let where = {};
|
|
19564
|
+
const order_by = [];
|
|
19565
|
+
const limit = pageSize || 25;
|
|
19566
|
+
const offset4 = page && pageSize ? (page - 1) * pageSize : 0;
|
|
19567
|
+
if (searchTerm) {
|
|
19568
|
+
const searchTermFilters = [];
|
|
19569
|
+
const uniqueFieldsByPath = {};
|
|
19570
|
+
const searchTerms = searchTerm.split(",");
|
|
19571
|
+
schema2.fields.forEach((field) => {
|
|
19572
|
+
const { type: type2, path: path2, searchDisabled } = field;
|
|
19573
|
+
if (uniqueFieldsByPath[path2]) return;
|
|
19574
|
+
uniqueFieldsByPath[path2] = true;
|
|
19575
|
+
if (searchDisabled || field.filterDisabled || type2 === "color") return;
|
|
19576
|
+
searchTerms.forEach((term) => {
|
|
19577
|
+
const filterValue = term.trim();
|
|
19578
|
+
if (type2 === "string" || type2 === "lookup") {
|
|
19579
|
+
const o2 = set$2({}, path2, { _ilike: `%${filterValue}%` });
|
|
19580
|
+
searchTermFilters.push(o2);
|
|
19581
|
+
} else if (type2 === "boolean") {
|
|
19582
|
+
let regex;
|
|
19583
|
+
try {
|
|
19584
|
+
regex = new RegExp("^" + filterValue, "ig");
|
|
19585
|
+
} catch (error) {
|
|
19586
|
+
}
|
|
19587
|
+
if (regex) {
|
|
19588
|
+
if ("true".replace(regex, "") !== "true") {
|
|
19589
|
+
const o2 = set$2({}, path2, { _eq: true });
|
|
19590
|
+
searchTermFilters.push(o2);
|
|
19591
|
+
} else if ("false".replace(regex, "") !== "false") {
|
|
19592
|
+
const o2 = set$2({}, path2, { _eq: false });
|
|
19593
|
+
searchTermFilters.push(o2);
|
|
19594
|
+
}
|
|
19595
|
+
}
|
|
19596
|
+
} else if ((type2 === "number" || type2 === "integer") && !isNaN(filterValue)) {
|
|
19597
|
+
const o2 = set$2({}, path2, { _eq: parseFloat(filterValue) });
|
|
19598
|
+
searchTermFilters.push(o2);
|
|
19605
19599
|
}
|
|
19606
|
-
|
|
19607
|
-
|
|
19608
|
-
|
|
19609
|
-
|
|
19610
|
-
|
|
19611
|
-
|
|
19612
|
-
|
|
19613
|
-
|
|
19614
|
-
|
|
19615
|
-
|
|
19616
|
-
|
|
19617
|
-
|
|
19618
|
-
|
|
19600
|
+
});
|
|
19601
|
+
});
|
|
19602
|
+
if (searchTermFilters.length > 0) {
|
|
19603
|
+
if (Object.keys(where).length > 0) {
|
|
19604
|
+
where = { _and: [where, { _or: searchTermFilters }] };
|
|
19605
|
+
} else {
|
|
19606
|
+
where = { _or: searchTermFilters };
|
|
19607
|
+
}
|
|
19608
|
+
}
|
|
19609
|
+
}
|
|
19610
|
+
if (filters && filters.length > 0) {
|
|
19611
|
+
const filterClauses = filters.map((filter2) => {
|
|
19612
|
+
let { selectedFilter, filterOn, filterValue } = filter2;
|
|
19613
|
+
const fieldSchema = ccFields[filterOn] || {};
|
|
19614
|
+
const { path: path2, reference: reference2, type: type2, customColumnFilter } = fieldSchema;
|
|
19615
|
+
if (customColumnFilter) {
|
|
19616
|
+
return customColumnFilter(filterValue);
|
|
19617
|
+
}
|
|
19618
|
+
let stringFilterValue = filterValue && filterValue.toString ? filterValue.toString() : filterValue;
|
|
19619
|
+
if (stringFilterValue === false) {
|
|
19620
|
+
stringFilterValue = "false";
|
|
19621
|
+
} else {
|
|
19622
|
+
stringFilterValue = stringFilterValue || "";
|
|
19623
|
+
}
|
|
19624
|
+
const arrayFilterValue = Array.isArray(filterValue) ? filterValue : stringFilterValue.split(";");
|
|
19625
|
+
if (type2 === "number" || type2 === "integer") {
|
|
19626
|
+
filterValue = Array.isArray(filterValue) ? filterValue.map((val2) => Number(val2)) : Number(filterValue);
|
|
19627
|
+
}
|
|
19628
|
+
if (fieldSchema.normalizeFilter) {
|
|
19629
|
+
filterValue = fieldSchema.normalizeFilter(
|
|
19630
|
+
filterValue,
|
|
19631
|
+
selectedFilter,
|
|
19632
|
+
filterOn
|
|
19633
|
+
);
|
|
19634
|
+
}
|
|
19635
|
+
if (reference2) {
|
|
19636
|
+
filterOn = reference2.sourceField;
|
|
19637
|
+
} else {
|
|
19638
|
+
filterOn = path2 || filterOn;
|
|
19639
|
+
}
|
|
19640
|
+
switch (selectedFilter) {
|
|
19641
|
+
case "none":
|
|
19642
|
+
return {};
|
|
19643
|
+
case "startsWith":
|
|
19644
|
+
return { [filterOn]: { _ilike: `${filterValue}%` } };
|
|
19645
|
+
case "endsWith":
|
|
19646
|
+
return { [filterOn]: { _ilike: `%${filterValue}` } };
|
|
19647
|
+
case "contains":
|
|
19648
|
+
return { [filterOn]: { _ilike: `%${filterValue}%` } };
|
|
19649
|
+
case "notContains":
|
|
19650
|
+
return { [filterOn]: { _nilike: `%${filterValue}%` } };
|
|
19651
|
+
case "isExactly":
|
|
19652
|
+
return { [filterOn]: { _eq: filterValue } };
|
|
19653
|
+
case "isEmpty":
|
|
19654
|
+
if (filterOn.includes(".")) {
|
|
19655
|
+
return {
|
|
19656
|
+
_not: {
|
|
19657
|
+
[filterOn.split(".")[0]]: {}
|
|
19619
19658
|
}
|
|
19620
|
-
}
|
|
19621
|
-
return new Date(e2);
|
|
19622
|
-
}(t3), this.init();
|
|
19623
|
-
}, m3.init = function() {
|
|
19624
|
-
var t3 = this.$d;
|
|
19625
|
-
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();
|
|
19626
|
-
}, m3.$utils = function() {
|
|
19627
|
-
return b3;
|
|
19628
|
-
}, m3.isValid = function() {
|
|
19629
|
-
return !(this.$d.toString() === l2);
|
|
19630
|
-
}, m3.isSame = function(t3, e2) {
|
|
19631
|
-
var n3 = O2(t3);
|
|
19632
|
-
return this.startOf(e2) <= n3 && n3 <= this.endOf(e2);
|
|
19633
|
-
}, m3.isAfter = function(t3, e2) {
|
|
19634
|
-
return O2(t3) < this.startOf(e2);
|
|
19635
|
-
}, m3.isBefore = function(t3, e2) {
|
|
19636
|
-
return this.endOf(e2) < O2(t3);
|
|
19637
|
-
}, m3.$g = function(t3, e2, n3) {
|
|
19638
|
-
return b3.u(t3) ? this[e2] : this.set(n3, t3);
|
|
19639
|
-
}, m3.unix = function() {
|
|
19640
|
-
return Math.floor(this.valueOf() / 1e3);
|
|
19641
|
-
}, m3.valueOf = function() {
|
|
19642
|
-
return this.$d.getTime();
|
|
19643
|
-
}, m3.startOf = function(t3, e2) {
|
|
19644
|
-
var n3 = this, r3 = !!b3.u(e2) || e2, f3 = b3.p(t3), l3 = /* @__PURE__ */ __name(function(t4, e3) {
|
|
19645
|
-
var i2 = b3.w(n3.$u ? Date.UTC(n3.$y, e3, t4) : new Date(n3.$y, e3, t4), n3);
|
|
19646
|
-
return r3 ? i2 : i2.endOf(a2);
|
|
19647
|
-
}, "l"), $2 = /* @__PURE__ */ __name(function(t4, e3) {
|
|
19648
|
-
return b3.w(n3.toDate()[t4].apply(n3.toDate("s"), (r3 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n3);
|
|
19649
|
-
}, "$"), y3 = this.$W, M4 = this.$M, m4 = this.$D, v3 = "set" + (this.$u ? "UTC" : "");
|
|
19650
|
-
switch (f3) {
|
|
19651
|
-
case h2:
|
|
19652
|
-
return r3 ? l3(1, 0) : l3(31, 11);
|
|
19653
|
-
case c2:
|
|
19654
|
-
return r3 ? l3(1, M4) : l3(0, M4 + 1);
|
|
19655
|
-
case o2:
|
|
19656
|
-
var g3 = this.$locale().weekStart || 0, D3 = (y3 < g3 ? y3 + 7 : y3) - g3;
|
|
19657
|
-
return l3(r3 ? m4 - D3 : m4 + (6 - D3), M4);
|
|
19658
|
-
case a2:
|
|
19659
|
-
case d2:
|
|
19660
|
-
return $2(v3 + "Hours", 0);
|
|
19661
|
-
case u2:
|
|
19662
|
-
return $2(v3 + "Minutes", 1);
|
|
19663
|
-
case s2:
|
|
19664
|
-
return $2(v3 + "Seconds", 2);
|
|
19665
|
-
case i:
|
|
19666
|
-
return $2(v3 + "Milliseconds", 3);
|
|
19667
|
-
default:
|
|
19668
|
-
return this.clone();
|
|
19659
|
+
};
|
|
19669
19660
|
}
|
|
19670
|
-
|
|
19671
|
-
|
|
19672
|
-
|
|
19673
|
-
|
|
19674
|
-
|
|
19675
|
-
var y3 = this.clone().set(d2, 1);
|
|
19676
|
-
y3.$d[l3]($2), y3.init(), this.$d = y3.set(d2, Math.min(this.$D, y3.daysInMonth())).$d;
|
|
19677
|
-
} else l3 && this.$d[l3]($2);
|
|
19678
|
-
return this.init(), this;
|
|
19679
|
-
}, m3.set = function(t3, e2) {
|
|
19680
|
-
return this.clone().$set(t3, e2);
|
|
19681
|
-
}, m3.get = function(t3) {
|
|
19682
|
-
return this[b3.p(t3)]();
|
|
19683
|
-
}, m3.add = function(r3, f3) {
|
|
19684
|
-
var d3, l3 = this;
|
|
19685
|
-
r3 = Number(r3);
|
|
19686
|
-
var $2 = b3.p(f3), y3 = /* @__PURE__ */ __name(function(t3) {
|
|
19687
|
-
var e2 = O2(l3);
|
|
19688
|
-
return b3.w(e2.date(e2.date() + Math.round(t3 * r3)), l3);
|
|
19689
|
-
}, "y");
|
|
19690
|
-
if ($2 === c2) return this.set(c2, this.$M + r3);
|
|
19691
|
-
if ($2 === h2) return this.set(h2, this.$y + r3);
|
|
19692
|
-
if ($2 === a2) return y3(1);
|
|
19693
|
-
if ($2 === o2) return y3(7);
|
|
19694
|
-
var M4 = (d3 = {}, d3[s2] = e, d3[u2] = n2, d3[i] = t2, d3)[$2] || 1, m4 = this.$d.getTime() + r3 * M4;
|
|
19695
|
-
return b3.w(m4, this);
|
|
19696
|
-
}, m3.subtract = function(t3, e2) {
|
|
19697
|
-
return this.add(-1 * t3, e2);
|
|
19698
|
-
}, m3.format = function(t3) {
|
|
19699
|
-
var e2 = this, n3 = this.$locale();
|
|
19700
|
-
if (!this.isValid()) return n3.invalidDate || l2;
|
|
19701
|
-
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) {
|
|
19702
|
-
return t4 && (t4[n4] || t4(e2, r3)) || i3[n4].slice(0, s4);
|
|
19703
|
-
}, "h"), d3 = /* @__PURE__ */ __name(function(t4) {
|
|
19704
|
-
return b3.s(s3 % 12 || 12, t4, "0");
|
|
19705
|
-
}, "d"), $2 = f3 || function(t4, e3, n4) {
|
|
19706
|
-
var r4 = t4 < 12 ? "AM" : "PM";
|
|
19707
|
-
return n4 ? r4.toLowerCase() : r4;
|
|
19661
|
+
return {
|
|
19662
|
+
_or: [
|
|
19663
|
+
{ [filterOn]: { _eq: "" } },
|
|
19664
|
+
{ [filterOn]: { _is_null: true } }
|
|
19665
|
+
]
|
|
19708
19666
|
};
|
|
19709
|
-
|
|
19710
|
-
|
|
19711
|
-
|
|
19712
|
-
|
|
19713
|
-
|
|
19714
|
-
|
|
19715
|
-
|
|
19716
|
-
|
|
19717
|
-
|
|
19718
|
-
|
|
19719
|
-
|
|
19720
|
-
|
|
19721
|
-
|
|
19722
|
-
|
|
19723
|
-
|
|
19724
|
-
|
|
19725
|
-
|
|
19726
|
-
|
|
19727
|
-
|
|
19728
|
-
|
|
19729
|
-
|
|
19730
|
-
|
|
19731
|
-
|
|
19732
|
-
|
|
19733
|
-
|
|
19734
|
-
|
|
19735
|
-
|
|
19736
|
-
|
|
19737
|
-
|
|
19738
|
-
case "HH":
|
|
19739
|
-
return b3.s(s3, 2, "0");
|
|
19740
|
-
case "h":
|
|
19741
|
-
return d3(1);
|
|
19742
|
-
case "hh":
|
|
19743
|
-
return d3(2);
|
|
19744
|
-
case "a":
|
|
19745
|
-
return $2(s3, u3, true);
|
|
19746
|
-
case "A":
|
|
19747
|
-
return $2(s3, u3, false);
|
|
19748
|
-
case "m":
|
|
19749
|
-
return String(u3);
|
|
19750
|
-
case "mm":
|
|
19751
|
-
return b3.s(u3, 2, "0");
|
|
19752
|
-
case "s":
|
|
19753
|
-
return String(e2.$s);
|
|
19754
|
-
case "ss":
|
|
19755
|
-
return b3.s(e2.$s, 2, "0");
|
|
19756
|
-
case "SSS":
|
|
19757
|
-
return b3.s(e2.$ms, 3, "0");
|
|
19758
|
-
case "Z":
|
|
19759
|
-
return i2;
|
|
19667
|
+
case "notEmpty":
|
|
19668
|
+
return {
|
|
19669
|
+
_and: [
|
|
19670
|
+
{ [filterOn]: { _neq: "" } },
|
|
19671
|
+
{ [filterOn]: { _is_null: false } }
|
|
19672
|
+
]
|
|
19673
|
+
};
|
|
19674
|
+
case "inList":
|
|
19675
|
+
return { [filterOn]: { _in: filterValue } };
|
|
19676
|
+
case "notInList":
|
|
19677
|
+
return { [filterOn]: { _nin: filterValue } };
|
|
19678
|
+
case "true":
|
|
19679
|
+
return { [filterOn]: { _eq: true } };
|
|
19680
|
+
case "false":
|
|
19681
|
+
return { [filterOn]: { _eq: false } };
|
|
19682
|
+
case "dateIs":
|
|
19683
|
+
return { [filterOn]: { _eq: filterValue } };
|
|
19684
|
+
case "notBetween":
|
|
19685
|
+
return {
|
|
19686
|
+
_or: [
|
|
19687
|
+
{
|
|
19688
|
+
[filterOn]: {
|
|
19689
|
+
_lt: new Date(arrayFilterValue[0])
|
|
19690
|
+
}
|
|
19691
|
+
},
|
|
19692
|
+
{
|
|
19693
|
+
[filterOn]: {
|
|
19694
|
+
_gt: new Date(new Date(arrayFilterValue[1]).setHours(23, 59))
|
|
19695
|
+
}
|
|
19760
19696
|
}
|
|
19761
|
-
|
|
19762
|
-
|
|
19763
|
-
|
|
19764
|
-
|
|
19765
|
-
|
|
19766
|
-
|
|
19767
|
-
|
|
19768
|
-
|
|
19769
|
-
}
|
|
19770
|
-
|
|
19771
|
-
|
|
19772
|
-
|
|
19697
|
+
]
|
|
19698
|
+
};
|
|
19699
|
+
case "isBetween":
|
|
19700
|
+
return {
|
|
19701
|
+
[filterOn]: {
|
|
19702
|
+
_gte: new Date(arrayFilterValue[0]),
|
|
19703
|
+
_lte: new Date(new Date(arrayFilterValue[1]).setHours(23, 59))
|
|
19704
|
+
}
|
|
19705
|
+
};
|
|
19706
|
+
case "isBefore":
|
|
19707
|
+
return { [filterOn]: { _lt: new Date(filterValue) } };
|
|
19708
|
+
case "isAfter":
|
|
19709
|
+
return { [filterOn]: { _gt: new Date(filterValue) } };
|
|
19710
|
+
case "greaterThan":
|
|
19711
|
+
return { [filterOn]: { _gt: parseFloat(filterValue) } };
|
|
19712
|
+
case "lessThan":
|
|
19713
|
+
return { [filterOn]: { _lt: parseFloat(filterValue) } };
|
|
19714
|
+
case "inRange":
|
|
19715
|
+
return {
|
|
19716
|
+
[filterOn]: {
|
|
19717
|
+
_gte: parseFloat(arrayFilterValue[0]),
|
|
19718
|
+
_lte: parseFloat(arrayFilterValue[1])
|
|
19719
|
+
}
|
|
19720
|
+
};
|
|
19721
|
+
case "outsideRange":
|
|
19722
|
+
return {
|
|
19723
|
+
_or: [
|
|
19724
|
+
{
|
|
19725
|
+
[filterOn]: {
|
|
19726
|
+
_lt: parseFloat(arrayFilterValue[0])
|
|
19727
|
+
}
|
|
19728
|
+
},
|
|
19729
|
+
{
|
|
19730
|
+
[filterOn]: {
|
|
19731
|
+
_gt: parseFloat(arrayFilterValue[1])
|
|
19732
|
+
}
|
|
19733
|
+
}
|
|
19734
|
+
]
|
|
19735
|
+
};
|
|
19736
|
+
case "equalTo":
|
|
19737
|
+
return {
|
|
19738
|
+
[filterOn]: {
|
|
19739
|
+
_eq: type2 === "number" || type2 === "integer" ? parseFloat(filterValue) : filterValue
|
|
19740
|
+
}
|
|
19741
|
+
};
|
|
19742
|
+
case "regex":
|
|
19743
|
+
return { [filterOn]: { _regex: filterValue } };
|
|
19744
|
+
default:
|
|
19745
|
+
console.warn(`Unsupported filter type: ${selectedFilter}`);
|
|
19746
|
+
return {};
|
|
19747
|
+
}
|
|
19748
|
+
});
|
|
19749
|
+
if (filterClauses.length > 0) {
|
|
19750
|
+
if (Object.keys(where).length > 0) {
|
|
19751
|
+
where = { _and: [where, ...filterClauses] };
|
|
19752
|
+
} else {
|
|
19753
|
+
where = { _and: filterClauses };
|
|
19754
|
+
}
|
|
19755
|
+
}
|
|
19756
|
+
}
|
|
19757
|
+
if (order2 && order2.length > 0) {
|
|
19758
|
+
order2.forEach((item) => {
|
|
19759
|
+
const field = item.startsWith("-") ? item.substring(1) : item;
|
|
19760
|
+
const direction = item.startsWith("-") ? "desc" : "asc";
|
|
19761
|
+
order_by.push({ [field]: direction });
|
|
19762
|
+
});
|
|
19763
|
+
}
|
|
19764
|
+
if (additionalFilter) {
|
|
19765
|
+
where = { _and: [where, additionalFilter] };
|
|
19766
|
+
}
|
|
19767
|
+
return { where, order_by, limit, offset: offset4 };
|
|
19768
|
+
}
|
|
19769
|
+
__name(tableQueryParamsToHasuraClauses, "tableQueryParamsToHasuraClauses");
|
|
19770
|
+
function getFieldsMappedByCCDisplayName(schema2) {
|
|
19771
|
+
if (!schema2 || !schema2.fields) return {};
|
|
19772
|
+
return schema2.fields.reduce((acc, field) => {
|
|
19773
|
+
const ccDisplayName = getCCDisplayName(field);
|
|
19774
|
+
acc[ccDisplayName] = field;
|
|
19775
|
+
return acc;
|
|
19776
|
+
}, {});
|
|
19777
|
+
}
|
|
19778
|
+
__name(getFieldsMappedByCCDisplayName, "getFieldsMappedByCCDisplayName");
|
|
19779
|
+
function getCCDisplayName(field) {
|
|
19780
|
+
return camelCase(
|
|
19781
|
+
typeof field.displayName === "string" ? field.displayName : field.path
|
|
19782
|
+
);
|
|
19783
|
+
}
|
|
19784
|
+
__name(getCCDisplayName, "getCCDisplayName");
|
|
19785
|
+
function filterLocalEntitiesToHasura(records, { where, order_by, limit, offset: offset4, isInfinite } = {}) {
|
|
19786
|
+
let filteredRecords = [...records];
|
|
19787
|
+
if (where) {
|
|
19788
|
+
filteredRecords = applyWhereClause(filteredRecords, where);
|
|
19789
|
+
}
|
|
19790
|
+
if (order_by) {
|
|
19791
|
+
filteredRecords = applyOrderBy(filteredRecords, order_by);
|
|
19792
|
+
}
|
|
19793
|
+
filteredRecords = restoreEntitiesFromLocalFilter(filteredRecords);
|
|
19794
|
+
const allFilteredRecords = [...filteredRecords];
|
|
19795
|
+
if (!isInfinite && offset4 !== void 0) {
|
|
19796
|
+
filteredRecords = filteredRecords.slice(offset4);
|
|
19797
|
+
}
|
|
19798
|
+
if (!isInfinite && limit !== void 0) {
|
|
19799
|
+
filteredRecords = filteredRecords.slice(0, limit);
|
|
19800
|
+
}
|
|
19801
|
+
return {
|
|
19802
|
+
entities: filteredRecords,
|
|
19803
|
+
entitiesAcrossPages: allFilteredRecords,
|
|
19804
|
+
entityCount: allFilteredRecords.length
|
|
19805
|
+
};
|
|
19806
|
+
}
|
|
19807
|
+
__name(filterLocalEntitiesToHasura, "filterLocalEntitiesToHasura");
|
|
19808
|
+
function applyWhereClause(records, where) {
|
|
19809
|
+
function applyFilter(record, filter2) {
|
|
19810
|
+
if (isEmpty$1(filter2)) {
|
|
19811
|
+
return true;
|
|
19812
|
+
}
|
|
19813
|
+
for (const key in filter2) {
|
|
19814
|
+
if (key === "_and") {
|
|
19815
|
+
if (isEmpty$1(filter2[key])) {
|
|
19816
|
+
continue;
|
|
19817
|
+
}
|
|
19818
|
+
if (!every(filter2[key], (subFilter) => applyFilter(record, subFilter))) {
|
|
19819
|
+
return false;
|
|
19820
|
+
}
|
|
19821
|
+
} else if (key === "_or") {
|
|
19822
|
+
if (isEmpty$1(filter2[key])) {
|
|
19823
|
+
continue;
|
|
19824
|
+
}
|
|
19825
|
+
if (!some(filter2[key], (subFilter) => applyFilter(record, subFilter))) {
|
|
19826
|
+
return false;
|
|
19827
|
+
}
|
|
19828
|
+
} else if (key === "_not") {
|
|
19829
|
+
if (applyFilter(record, filter2[key])) {
|
|
19830
|
+
return false;
|
|
19831
|
+
}
|
|
19832
|
+
} else {
|
|
19833
|
+
const value = get$4(record, key);
|
|
19834
|
+
const conditions = filter2[key];
|
|
19835
|
+
if (isObject$2(value) && isObject$2(conditions) && !hasOperator(conditions)) {
|
|
19836
|
+
return applyFilter(value, conditions);
|
|
19837
|
+
}
|
|
19838
|
+
for (const operator in conditions) {
|
|
19839
|
+
const conditionValue = conditions[operator];
|
|
19840
|
+
if (operator === "_gt" && conditions._lt) {
|
|
19841
|
+
if (!(value > conditionValue && value < conditions._lt))
|
|
19842
|
+
return false;
|
|
19843
|
+
continue;
|
|
19844
|
+
}
|
|
19845
|
+
if (operator === "_gte" && conditions._lte) {
|
|
19846
|
+
if (!(value >= conditionValue && value <= conditions._lte))
|
|
19847
|
+
return false;
|
|
19848
|
+
continue;
|
|
19849
|
+
}
|
|
19850
|
+
switch (operator) {
|
|
19851
|
+
case "_eq":
|
|
19852
|
+
if (!isEqual$3(value, conditionValue)) return false;
|
|
19773
19853
|
break;
|
|
19774
|
-
case
|
|
19775
|
-
$
|
|
19854
|
+
case "_neq":
|
|
19855
|
+
if (isEqual$3(value, conditionValue)) return false;
|
|
19776
19856
|
break;
|
|
19777
|
-
case
|
|
19778
|
-
|
|
19857
|
+
case "_gt":
|
|
19858
|
+
if (!(value > conditionValue)) return false;
|
|
19779
19859
|
break;
|
|
19780
|
-
case
|
|
19781
|
-
|
|
19860
|
+
case "_gte":
|
|
19861
|
+
if (!(value >= conditionValue)) return false;
|
|
19782
19862
|
break;
|
|
19783
|
-
case
|
|
19784
|
-
|
|
19863
|
+
case "_lt":
|
|
19864
|
+
if (!(value < conditionValue)) return false;
|
|
19785
19865
|
break;
|
|
19786
|
-
case
|
|
19787
|
-
|
|
19866
|
+
case "_lte":
|
|
19867
|
+
if (!(value <= conditionValue)) return false;
|
|
19788
19868
|
break;
|
|
19789
|
-
case
|
|
19790
|
-
$
|
|
19869
|
+
case "_like":
|
|
19870
|
+
if (!isString$1(value) || !new RegExp(conditionValue.replace(/%/g, ".*")).test(value))
|
|
19871
|
+
return false;
|
|
19791
19872
|
break;
|
|
19792
|
-
case
|
|
19793
|
-
$
|
|
19873
|
+
case "_ilike":
|
|
19874
|
+
if (!isString$1(value) || !new RegExp(conditionValue.replace(/%/g, ".*"), "i").test(value))
|
|
19875
|
+
return false;
|
|
19876
|
+
break;
|
|
19877
|
+
case "_nlike":
|
|
19878
|
+
if (!isString$1(value) || new RegExp(conditionValue.replace(/%/g, ".*")).test(value))
|
|
19879
|
+
return false;
|
|
19880
|
+
break;
|
|
19881
|
+
case "_nilike":
|
|
19882
|
+
if (!isString$1(value) || new RegExp(conditionValue.replace(/%/g, ".*"), "i").test(value))
|
|
19883
|
+
return false;
|
|
19884
|
+
break;
|
|
19885
|
+
case "_starts_with":
|
|
19886
|
+
if (!isString$1(value) || !value.startsWith(conditionValue))
|
|
19887
|
+
return false;
|
|
19888
|
+
break;
|
|
19889
|
+
case "_ends_with":
|
|
19890
|
+
if (!isString$1(value) || !value.endsWith(conditionValue))
|
|
19891
|
+
return false;
|
|
19892
|
+
break;
|
|
19893
|
+
case "_is_null":
|
|
19894
|
+
if (conditionValue && !isNull(value) || !conditionValue && isNull(value))
|
|
19895
|
+
return false;
|
|
19896
|
+
break;
|
|
19897
|
+
case "_contains":
|
|
19898
|
+
if (!isArray$2(value) || !every(conditionValue, (item) => includes(value, item)))
|
|
19899
|
+
return false;
|
|
19900
|
+
break;
|
|
19901
|
+
case "_contained_in":
|
|
19902
|
+
if (!isArray$2(value) || !every(value, (item) => includes(conditionValue, item)))
|
|
19903
|
+
return false;
|
|
19904
|
+
break;
|
|
19905
|
+
case "_has_key":
|
|
19906
|
+
if (!isObject$2(value) || !has$3(value, conditionValue)) return false;
|
|
19907
|
+
break;
|
|
19908
|
+
case "_has_keys_any":
|
|
19909
|
+
if (!isObject$2(value) || !some(conditionValue, (item) => has$3(value, item)))
|
|
19910
|
+
return false;
|
|
19911
|
+
break;
|
|
19912
|
+
case "_has_keys_all":
|
|
19913
|
+
if (!isObject$2(value) || !every(conditionValue, (item) => has$3(value, item)))
|
|
19914
|
+
return false;
|
|
19915
|
+
break;
|
|
19916
|
+
case "_similar":
|
|
19917
|
+
if (!isString$1(value) || !new RegExp(conditionValue.replace(/%/g, ".*")).test(value))
|
|
19918
|
+
return false;
|
|
19794
19919
|
break;
|
|
19795
19920
|
default:
|
|
19796
|
-
|
|
19921
|
+
if (operator.startsWith("_")) {
|
|
19922
|
+
console.warn(`Unsupported operator: ${operator}`);
|
|
19923
|
+
return false;
|
|
19924
|
+
} else {
|
|
19925
|
+
console.warn(`Unsupported operator: ${operator}`);
|
|
19926
|
+
return false;
|
|
19927
|
+
}
|
|
19797
19928
|
}
|
|
19798
|
-
|
|
19799
|
-
|
|
19800
|
-
|
|
19801
|
-
|
|
19802
|
-
|
|
19803
|
-
|
|
19804
|
-
|
|
19805
|
-
|
|
19806
|
-
|
|
19807
|
-
|
|
19808
|
-
|
|
19809
|
-
|
|
19810
|
-
|
|
19811
|
-
|
|
19812
|
-
|
|
19813
|
-
|
|
19814
|
-
|
|
19815
|
-
|
|
19816
|
-
|
|
19817
|
-
|
|
19818
|
-
|
|
19819
|
-
|
|
19820
|
-
|
|
19821
|
-
|
|
19822
|
-
|
|
19823
|
-
|
|
19824
|
-
|
|
19825
|
-
|
|
19826
|
-
|
|
19827
|
-
|
|
19929
|
+
}
|
|
19930
|
+
}
|
|
19931
|
+
}
|
|
19932
|
+
return true;
|
|
19933
|
+
}
|
|
19934
|
+
__name(applyFilter, "applyFilter");
|
|
19935
|
+
function hasOperator(obj) {
|
|
19936
|
+
return Object.keys(obj).some((key) => key.startsWith("_"));
|
|
19937
|
+
}
|
|
19938
|
+
__name(hasOperator, "hasOperator");
|
|
19939
|
+
return records.filter((record) => applyFilter(record, where));
|
|
19940
|
+
}
|
|
19941
|
+
__name(applyWhereClause, "applyWhereClause");
|
|
19942
|
+
function applyOrderBy(records, _order_by) {
|
|
19943
|
+
const order_by = isArray$2(_order_by) ? _order_by : isEmpty$1(_order_by) ? [] : [_order_by];
|
|
19944
|
+
if (order_by.length > 0) {
|
|
19945
|
+
const orderFuncs = [];
|
|
19946
|
+
const ascOrDescArray = [];
|
|
19947
|
+
order_by.forEach(
|
|
19948
|
+
({ path: path2, direction, type: type2, sortFn, getValueToFilterOn, ownProps }) => {
|
|
19949
|
+
direction = direction || "desc";
|
|
19950
|
+
if (sortFn) {
|
|
19951
|
+
const sortFnArray = Array.isArray(sortFn) ? sortFn : [sortFn];
|
|
19952
|
+
sortFnArray.forEach((fn4) => {
|
|
19953
|
+
const getter = typeof fn4 === "function" ? fn4 : (r2) => get$4(r2, fn4);
|
|
19954
|
+
orderFuncs.push((r2) => {
|
|
19955
|
+
const val2 = getter(r2);
|
|
19956
|
+
return val2 !== null && val2 !== void 0 ? 1 : 0;
|
|
19957
|
+
});
|
|
19958
|
+
ascOrDescArray.push("desc");
|
|
19959
|
+
orderFuncs.push(getter);
|
|
19960
|
+
ascOrDescArray.push(direction);
|
|
19961
|
+
});
|
|
19962
|
+
} else if (getValueToFilterOn) {
|
|
19963
|
+
orderFuncs.push((r2) => {
|
|
19964
|
+
const val2 = getValueToFilterOn(r2, ownProps);
|
|
19965
|
+
return val2 !== null && val2 !== void 0 ? 1 : 0;
|
|
19966
|
+
});
|
|
19967
|
+
ascOrDescArray.push("desc");
|
|
19968
|
+
orderFuncs.push((r2) => getValueToFilterOn(r2, ownProps));
|
|
19969
|
+
ascOrDescArray.push(direction);
|
|
19970
|
+
} else if (type2 === "timestamp") {
|
|
19971
|
+
orderFuncs.push((r2) => {
|
|
19972
|
+
const val2 = get$4(r2, path2);
|
|
19973
|
+
return val2 ? 1 : 0;
|
|
19974
|
+
});
|
|
19975
|
+
ascOrDescArray.push("desc");
|
|
19976
|
+
orderFuncs.push((r2) => {
|
|
19977
|
+
const val2 = get$4(r2, path2);
|
|
19978
|
+
return val2 ? new Date(val2).getTime() : -Infinity;
|
|
19979
|
+
});
|
|
19980
|
+
ascOrDescArray.push(direction);
|
|
19981
|
+
} else if (path2 && endsWith$1(path2.toLowerCase(), "id")) {
|
|
19982
|
+
orderFuncs.push((r2) => {
|
|
19983
|
+
const val2 = get$4(r2, path2);
|
|
19984
|
+
return val2 !== null && val2 !== void 0 ? 1 : 0;
|
|
19985
|
+
});
|
|
19986
|
+
ascOrDescArray.push("desc");
|
|
19987
|
+
orderFuncs.push((o2) => {
|
|
19988
|
+
const val2 = get$4(o2, path2);
|
|
19989
|
+
if (val2 === null || val2 === void 0) return -Infinity;
|
|
19990
|
+
return parseInt(val2, 10) || 0;
|
|
19991
|
+
});
|
|
19992
|
+
ascOrDescArray.push(direction);
|
|
19993
|
+
} else {
|
|
19994
|
+
orderFuncs.push((r2) => {
|
|
19995
|
+
const val2 = get$4(r2, path2);
|
|
19996
|
+
return val2 !== null && val2 !== void 0 ? 1 : 0;
|
|
19997
|
+
});
|
|
19998
|
+
ascOrDescArray.push("desc");
|
|
19999
|
+
orderFuncs.push((r2) => {
|
|
20000
|
+
const val2 = get$4(r2, path2);
|
|
20001
|
+
if (val2 === null || val2 === void 0) return -Infinity;
|
|
20002
|
+
if (isString$1(val2)) {
|
|
20003
|
+
return val2.toLowerCase().replace(
|
|
20004
|
+
/(\d+)/g,
|
|
20005
|
+
(num) => (
|
|
20006
|
+
// Pad numbers with leading zeros for proper natural sort
|
|
20007
|
+
num.padStart(10, "0")
|
|
20008
|
+
)
|
|
20009
|
+
);
|
|
20010
|
+
}
|
|
20011
|
+
return val2;
|
|
20012
|
+
});
|
|
20013
|
+
ascOrDescArray.push(direction);
|
|
20014
|
+
}
|
|
20015
|
+
}
|
|
20016
|
+
);
|
|
20017
|
+
records = orderBy$1(records, orderFuncs, ascOrDescArray);
|
|
20018
|
+
}
|
|
20019
|
+
return records;
|
|
20020
|
+
}
|
|
20021
|
+
__name(applyOrderBy, "applyOrderBy");
|
|
20022
|
+
function restoreEntitiesFromLocalFilter(ents) {
|
|
20023
|
+
return ents.map((entity) => {
|
|
20024
|
+
forEach$1(entity, (val2, key) => {
|
|
20025
|
+
var _a2;
|
|
20026
|
+
if ((_a2 = key.startsWith) == null ? void 0 : _a2.call(key, "___original___")) {
|
|
20027
|
+
entity[key.slice("___original___".length)] = val2;
|
|
20028
|
+
delete entity[key];
|
|
20029
|
+
}
|
|
19828
20030
|
});
|
|
19829
|
-
|
|
19830
|
-
|
|
20031
|
+
return entity;
|
|
20032
|
+
});
|
|
19831
20033
|
}
|
|
19832
|
-
__name(
|
|
19833
|
-
|
|
19834
|
-
|
|
20034
|
+
__name(restoreEntitiesFromLocalFilter, "restoreEntitiesFromLocalFilter");
|
|
20035
|
+
function initializeHasuraWhereAndFilter(additionalFilter, where = {}, currentParams) {
|
|
20036
|
+
where._and = where._and || [];
|
|
20037
|
+
where._or = where._or || [];
|
|
20038
|
+
if (typeof additionalFilter === "function") {
|
|
20039
|
+
const newWhere = additionalFilter(where, currentParams);
|
|
20040
|
+
if (newWhere) {
|
|
20041
|
+
Object.assign(where, newWhere);
|
|
20042
|
+
}
|
|
20043
|
+
} else if (typeof additionalFilter === "object")
|
|
20044
|
+
where._and.push(additionalFilter);
|
|
20045
|
+
}
|
|
20046
|
+
__name(initializeHasuraWhereAndFilter, "initializeHasuraWhereAndFilter");
|
|
19835
20047
|
const defaultPageSizes = [5, 10, 15, 25, 50, 100, 200, 400];
|
|
19836
20048
|
function safeStringify(val2) {
|
|
19837
20049
|
if (val2 !== null && typeof val2 === "object") {
|
|
@@ -19848,325 +20060,6 @@ function safeParse(val2) {
|
|
|
19848
20060
|
}
|
|
19849
20061
|
}
|
|
19850
20062
|
__name(safeParse, "safeParse");
|
|
19851
|
-
function getCCDisplayName(field) {
|
|
19852
|
-
return camelCase(
|
|
19853
|
-
typeof field.displayName === "string" ? field.displayName : field.path
|
|
19854
|
-
);
|
|
19855
|
-
}
|
|
19856
|
-
__name(getCCDisplayName, "getCCDisplayName");
|
|
19857
|
-
function getFieldsMappedByCCDisplayName(schema2) {
|
|
19858
|
-
return schema2.fields.reduce((acc, field) => {
|
|
19859
|
-
const ccDisplayName = getCCDisplayName(field);
|
|
19860
|
-
acc[ccDisplayName] = field;
|
|
19861
|
-
return acc;
|
|
19862
|
-
}, {});
|
|
19863
|
-
}
|
|
19864
|
-
__name(getFieldsMappedByCCDisplayName, "getFieldsMappedByCCDisplayName");
|
|
19865
|
-
function orderEntitiesLocal(orderArray, entities, schema2, ownProps) {
|
|
19866
|
-
if (orderArray == null ? void 0 : orderArray.length) {
|
|
19867
|
-
const orderFuncs = [];
|
|
19868
|
-
const ascOrDescArray = [];
|
|
19869
|
-
orderArray.forEach((order2) => {
|
|
19870
|
-
const ccDisplayName = order2.replace(/^-/gi, "");
|
|
19871
|
-
const ccFields = getFieldsMappedByCCDisplayName(schema2);
|
|
19872
|
-
const field = ccFields[ccDisplayName];
|
|
19873
|
-
if (!field) {
|
|
19874
|
-
throw new Error(
|
|
19875
|
-
"Ruh roh, there should have been a column to sort on for " + order2 + " but none was found in " + schema2.fields
|
|
19876
|
-
);
|
|
19877
|
-
}
|
|
19878
|
-
const { path: path2, getValueToFilterOn, sortFn } = field;
|
|
19879
|
-
if (field.type === "timestamp") {
|
|
19880
|
-
ascOrDescArray.push("desc");
|
|
19881
|
-
}
|
|
19882
|
-
ascOrDescArray.push(ccDisplayName === order2 ? "asc" : "desc");
|
|
19883
|
-
if (field.type === "timestamp") {
|
|
19884
|
-
orderFuncs.push((r2) => {
|
|
19885
|
-
const val2 = get$4(r2, path2);
|
|
19886
|
-
return !!val2;
|
|
19887
|
-
});
|
|
19888
|
-
}
|
|
19889
|
-
if (path2 && endsWith$1(path2.toLowerCase(), "id")) {
|
|
19890
|
-
orderFuncs.push((o2) => {
|
|
19891
|
-
return parseInt(get$4(o2, path2), 10);
|
|
19892
|
-
});
|
|
19893
|
-
} else if (sortFn) {
|
|
19894
|
-
const toOrder = Array.isArray(sortFn) ? sortFn : [sortFn];
|
|
19895
|
-
orderFuncs.push(...toOrder);
|
|
19896
|
-
} else if (getValueToFilterOn) {
|
|
19897
|
-
orderFuncs.push((o2) => {
|
|
19898
|
-
return getValueToFilterOn(o2, ownProps);
|
|
19899
|
-
});
|
|
19900
|
-
} else {
|
|
19901
|
-
orderFuncs.push((r2) => {
|
|
19902
|
-
const val2 = get$4(r2, path2);
|
|
19903
|
-
return val2 && val2.toLowerCase ? val2.toLowerCase() : val2;
|
|
19904
|
-
});
|
|
19905
|
-
}
|
|
19906
|
-
});
|
|
19907
|
-
entities = orderBy$1(entities, orderFuncs, ascOrDescArray);
|
|
19908
|
-
}
|
|
19909
|
-
return entities;
|
|
19910
|
-
}
|
|
19911
|
-
__name(orderEntitiesLocal, "orderEntitiesLocal");
|
|
19912
|
-
function getAndAndOrFilters(allFilters) {
|
|
19913
|
-
const orFilters = [];
|
|
19914
|
-
const andFilters = [];
|
|
19915
|
-
const otherOrFilters = [];
|
|
19916
|
-
allFilters.forEach((filter2) => {
|
|
19917
|
-
if (filter2.isOrFilter && typeof filter2.filterValue === "string" && filter2.filterValue.includes(",")) {
|
|
19918
|
-
const allFilterValues = filter2.filterValue.split(",");
|
|
19919
|
-
allFilterValues.forEach((filterValue, i) => {
|
|
19920
|
-
filterValue = filterValue.trim();
|
|
19921
|
-
if (!filterValue) return;
|
|
19922
|
-
const newFilter = __spreadProps(__spreadValues({}, filter2), {
|
|
19923
|
-
filterValue
|
|
19924
|
-
});
|
|
19925
|
-
if (i === 0) {
|
|
19926
|
-
orFilters.push(newFilter);
|
|
19927
|
-
} else {
|
|
19928
|
-
const iMinus = i - 1;
|
|
19929
|
-
if (!otherOrFilters[iMinus]) otherOrFilters[iMinus] = [];
|
|
19930
|
-
otherOrFilters[iMinus].push(newFilter);
|
|
19931
|
-
}
|
|
19932
|
-
});
|
|
19933
|
-
} else if (filter2.isOrFilter) {
|
|
19934
|
-
orFilters.push(filter2);
|
|
19935
|
-
} else {
|
|
19936
|
-
andFilters.push(filter2);
|
|
19937
|
-
}
|
|
19938
|
-
});
|
|
19939
|
-
return {
|
|
19940
|
-
orFilters,
|
|
19941
|
-
andFilters,
|
|
19942
|
-
otherOrFilters
|
|
19943
|
-
};
|
|
19944
|
-
}
|
|
19945
|
-
__name(getAndAndOrFilters, "getAndAndOrFilters");
|
|
19946
|
-
function filterEntitiesLocal(filters = [], searchTerm, entities, schema2, ownProps) {
|
|
19947
|
-
const allFilters = getAllFilters(filters, searchTerm, schema2);
|
|
19948
|
-
if (allFilters.length) {
|
|
19949
|
-
const ccFields = getFieldsMappedByCCDisplayName(schema2);
|
|
19950
|
-
const { andFilters, orFilters, otherOrFilters } = getAndAndOrFilters(allFilters);
|
|
19951
|
-
andFilters.forEach((filter2) => {
|
|
19952
|
-
entities = getEntitiesForGivenFilter(
|
|
19953
|
-
entities,
|
|
19954
|
-
filter2,
|
|
19955
|
-
ccFields,
|
|
19956
|
-
ownProps
|
|
19957
|
-
);
|
|
19958
|
-
});
|
|
19959
|
-
if (orFilters.length) {
|
|
19960
|
-
let orEntities = [];
|
|
19961
|
-
orFilters.concat(...otherOrFilters).forEach((filter2) => {
|
|
19962
|
-
orEntities = orEntities.concat(
|
|
19963
|
-
getEntitiesForGivenFilter(entities, filter2, ccFields, ownProps)
|
|
19964
|
-
);
|
|
19965
|
-
});
|
|
19966
|
-
entities = uniq(orEntities);
|
|
19967
|
-
}
|
|
19968
|
-
}
|
|
19969
|
-
return entities;
|
|
19970
|
-
}
|
|
19971
|
-
__name(filterEntitiesLocal, "filterEntitiesLocal");
|
|
19972
|
-
function cleanFilterValue(_filterValue, type2) {
|
|
19973
|
-
let filterValue = _filterValue;
|
|
19974
|
-
if (type2 === "number" || type2 === "integer") {
|
|
19975
|
-
filterValue = Array.isArray(filterValue) ? filterValue.map((val2) => Number(val2)) : Number(filterValue);
|
|
19976
|
-
}
|
|
19977
|
-
return filterValue;
|
|
19978
|
-
}
|
|
19979
|
-
__name(cleanFilterValue, "cleanFilterValue");
|
|
19980
|
-
function getEntitiesForGivenFilter(entities, filter2, ccFields, ownProps) {
|
|
19981
|
-
const { filterOn, filterValue: _filterValue, selectedFilter } = filter2;
|
|
19982
|
-
const field = ccFields[filterOn];
|
|
19983
|
-
const { path: path2, getValueToFilterOn } = field;
|
|
19984
|
-
const filterValue = cleanFilterValue(_filterValue, field.type);
|
|
19985
|
-
const subFilter = getSubFilter(false, selectedFilter, filterValue);
|
|
19986
|
-
entities = entities.filter((entity) => {
|
|
19987
|
-
const fieldVal = getValueToFilterOn ? getValueToFilterOn(entity, ownProps) : get$4(entity, path2);
|
|
19988
|
-
const shouldKeep = subFilter(fieldVal);
|
|
19989
|
-
return shouldKeep;
|
|
19990
|
-
});
|
|
19991
|
-
return entities;
|
|
19992
|
-
}
|
|
19993
|
-
__name(getEntitiesForGivenFilter, "getEntitiesForGivenFilter");
|
|
19994
|
-
function getFiltersFromSearchTerm(searchTerm, schema2) {
|
|
19995
|
-
const searchTermFilters = [];
|
|
19996
|
-
if (searchTerm) {
|
|
19997
|
-
const sharedFields = {
|
|
19998
|
-
isOrFilter: true,
|
|
19999
|
-
isSearchTermFilter: true
|
|
20000
|
-
};
|
|
20001
|
-
schema2.fields.forEach((field) => {
|
|
20002
|
-
const { type: type2, searchDisabled } = field;
|
|
20003
|
-
if (searchDisabled || field.filterDisabled || type2 === "color") return;
|
|
20004
|
-
const ccDisplayName = getCCDisplayName(field);
|
|
20005
|
-
const filterValue = cleanFilterValue(searchTerm, type2);
|
|
20006
|
-
if (type2 === "string" || type2 === "lookup") {
|
|
20007
|
-
searchTermFilters.push(__spreadProps(__spreadValues({}, sharedFields), {
|
|
20008
|
-
filterOn: ccDisplayName,
|
|
20009
|
-
filterValue: searchTerm,
|
|
20010
|
-
selectedFilter: "contains"
|
|
20011
|
-
}));
|
|
20012
|
-
} else if (type2 === "boolean") {
|
|
20013
|
-
let regex;
|
|
20014
|
-
try {
|
|
20015
|
-
regex = new RegExp("^" + searchTerm, "ig");
|
|
20016
|
-
} catch (error) {
|
|
20017
|
-
}
|
|
20018
|
-
if (regex) {
|
|
20019
|
-
if ("true".replace(regex, "") !== "true") {
|
|
20020
|
-
searchTermFilters.push(__spreadProps(__spreadValues({}, sharedFields), {
|
|
20021
|
-
filterOn: ccDisplayName,
|
|
20022
|
-
filterValue: true,
|
|
20023
|
-
selectedFilter: "true"
|
|
20024
|
-
}));
|
|
20025
|
-
} else if ("false".replace(regex, "") !== "false") {
|
|
20026
|
-
searchTermFilters.push(__spreadProps(__spreadValues({}, sharedFields), {
|
|
20027
|
-
filterOn: ccDisplayName,
|
|
20028
|
-
filterValue: false,
|
|
20029
|
-
selectedFilter: "false"
|
|
20030
|
-
}));
|
|
20031
|
-
}
|
|
20032
|
-
}
|
|
20033
|
-
} else if ((type2 === "number" || type2 === "integer") && !isNaN(filterValue)) {
|
|
20034
|
-
if (type2 === "integer" && !isInteger(filterValue)) {
|
|
20035
|
-
return;
|
|
20036
|
-
}
|
|
20037
|
-
searchTermFilters.push(__spreadProps(__spreadValues({}, sharedFields), {
|
|
20038
|
-
filterOn: ccDisplayName,
|
|
20039
|
-
filterValue,
|
|
20040
|
-
selectedFilter: "equalTo"
|
|
20041
|
-
}));
|
|
20042
|
-
}
|
|
20043
|
-
});
|
|
20044
|
-
}
|
|
20045
|
-
return searchTermFilters;
|
|
20046
|
-
}
|
|
20047
|
-
__name(getFiltersFromSearchTerm, "getFiltersFromSearchTerm");
|
|
20048
|
-
function getSubFilter(qb, selectedFilter, filterValue) {
|
|
20049
|
-
const ccSelectedFilter = camelCase(selectedFilter);
|
|
20050
|
-
let stringFilterValue = filterValue && filterValue.toString ? filterValue.toString() : filterValue;
|
|
20051
|
-
if (stringFilterValue === false) {
|
|
20052
|
-
stringFilterValue = "false";
|
|
20053
|
-
} else {
|
|
20054
|
-
stringFilterValue = stringFilterValue || "";
|
|
20055
|
-
}
|
|
20056
|
-
const filterValLower = stringFilterValue.toLowerCase && stringFilterValue.toLowerCase();
|
|
20057
|
-
const arrayFilterValue = Array.isArray(filterValue) ? filterValue : stringFilterValue.split(";");
|
|
20058
|
-
if (ccSelectedFilter === "startsWith") {
|
|
20059
|
-
return qb ? qb.startsWith(stringFilterValue) : (fieldVal) => {
|
|
20060
|
-
if (!fieldVal || !fieldVal.toLowerCase) return false;
|
|
20061
|
-
return startsWith(fieldVal.toLowerCase(), filterValLower);
|
|
20062
|
-
};
|
|
20063
|
-
} else if (ccSelectedFilter === "endsWith") {
|
|
20064
|
-
return qb ? qb.endsWith(stringFilterValue) : (fieldVal) => {
|
|
20065
|
-
if (!fieldVal || !fieldVal.toLowerCase) return false;
|
|
20066
|
-
return endsWith$1(fieldVal.toLowerCase(), filterValLower);
|
|
20067
|
-
};
|
|
20068
|
-
} else if (ccSelectedFilter === "contains" || ccSelectedFilter === "notContains") {
|
|
20069
|
-
return qb ? ccSelectedFilter === "contains" ? qb.contains(stringFilterValue.replace(/_/g, "\\_")) : qb.notContains(stringFilterValue.replace(/_/g, "\\_")) : (fieldVal) => {
|
|
20070
|
-
if (!fieldVal || !fieldVal.toLowerCase) return false;
|
|
20071
|
-
return ccSelectedFilter === "contains" ? fieldVal.toLowerCase().replace(filterValLower, "") !== fieldVal.toLowerCase() : fieldVal.toLowerCase().replace(filterValLower, "") === fieldVal.toLowerCase();
|
|
20072
|
-
};
|
|
20073
|
-
} else if (ccSelectedFilter === "inList") {
|
|
20074
|
-
return qb ? qb.inList(arrayFilterValue) : (fieldVal) => {
|
|
20075
|
-
if (!(fieldVal == null ? void 0 : fieldVal.toString)) return false;
|
|
20076
|
-
return arrayFilterValue.map((val2) => {
|
|
20077
|
-
if (val2) {
|
|
20078
|
-
if (val2.toString) return val2.toString().toLowerCase();
|
|
20079
|
-
return val2.toLowerCase();
|
|
20080
|
-
}
|
|
20081
|
-
return void 0;
|
|
20082
|
-
}).indexOf(fieldVal.toString().toLowerCase()) > -1;
|
|
20083
|
-
};
|
|
20084
|
-
} else if (ccSelectedFilter === "notInList") {
|
|
20085
|
-
return qb ? qb.notInList(arrayFilterValue) : (fieldVal) => {
|
|
20086
|
-
if (!(fieldVal == null ? void 0 : fieldVal.toString)) return false;
|
|
20087
|
-
return arrayFilterValue.map((val2) => {
|
|
20088
|
-
if (val2) {
|
|
20089
|
-
if (val2.toString) return val2.toString().toLowerCase();
|
|
20090
|
-
return val2.toLowerCase();
|
|
20091
|
-
}
|
|
20092
|
-
return void 0;
|
|
20093
|
-
}).indexOf(fieldVal.toString().toLowerCase()) === -1;
|
|
20094
|
-
};
|
|
20095
|
-
} else if (ccSelectedFilter === "isEmpty") {
|
|
20096
|
-
return qb ? qb.isEmpty() : (fieldVal) => {
|
|
20097
|
-
return !fieldVal;
|
|
20098
|
-
};
|
|
20099
|
-
} else if (ccSelectedFilter === "notEmpty") {
|
|
20100
|
-
return qb ? [qb.notNull(), qb.notEquals("")] : (fieldVal) => {
|
|
20101
|
-
return !!fieldVal;
|
|
20102
|
-
};
|
|
20103
|
-
} else if (ccSelectedFilter === "isExactly") {
|
|
20104
|
-
return qb ? filterValue : (fieldVal) => {
|
|
20105
|
-
return fieldVal === filterValue;
|
|
20106
|
-
};
|
|
20107
|
-
} else if (ccSelectedFilter === "true") {
|
|
20108
|
-
return qb ? qb.equals(true) : (fieldVal) => {
|
|
20109
|
-
return !!fieldVal;
|
|
20110
|
-
};
|
|
20111
|
-
} else if (ccSelectedFilter === "false") {
|
|
20112
|
-
return qb ? qb.equals(false) : (fieldVal) => {
|
|
20113
|
-
return !fieldVal;
|
|
20114
|
-
};
|
|
20115
|
-
} else if (ccSelectedFilter === "isBetween") {
|
|
20116
|
-
return qb ? qb.between(
|
|
20117
|
-
new Date(arrayFilterValue[0]),
|
|
20118
|
-
new Date(new Date(arrayFilterValue[1]).setHours(23, 59))
|
|
20119
|
-
// set end of day for more accurate filtering
|
|
20120
|
-
) : (fieldVal) => {
|
|
20121
|
-
return dayjs(arrayFilterValue[0]).valueOf() <= dayjs(fieldVal).valueOf() && dayjs(fieldVal).valueOf() <= dayjs(arrayFilterValue[1]).valueOf();
|
|
20122
|
-
};
|
|
20123
|
-
} else if (ccSelectedFilter === "notBetween") {
|
|
20124
|
-
return qb ? qb.notBetween(
|
|
20125
|
-
new Date(arrayFilterValue[0]),
|
|
20126
|
-
new Date(new Date(arrayFilterValue[1]).setHours(23, 59))
|
|
20127
|
-
// set end of day for more accurate filtering
|
|
20128
|
-
) : (fieldVal) => {
|
|
20129
|
-
return dayjs(arrayFilterValue[0]).valueOf() > dayjs(fieldVal).valueOf() || dayjs(fieldVal).valueOf() > dayjs(arrayFilterValue[1]).valueOf();
|
|
20130
|
-
};
|
|
20131
|
-
} else if (ccSelectedFilter === "isBefore") {
|
|
20132
|
-
return qb ? qb.lessThan(new Date(filterValue)) : (fieldVal) => {
|
|
20133
|
-
return dayjs(fieldVal).valueOf() < dayjs(filterValue).valueOf();
|
|
20134
|
-
};
|
|
20135
|
-
} else if (ccSelectedFilter === "isAfter") {
|
|
20136
|
-
return qb ? qb.greaterThan(new Date(new Date(filterValue).setHours(23, 59))) : (fieldVal) => {
|
|
20137
|
-
return dayjs(fieldVal).valueOf() > dayjs(filterValue).valueOf();
|
|
20138
|
-
};
|
|
20139
|
-
} else if (ccSelectedFilter === "greaterThan") {
|
|
20140
|
-
return qb ? qb.greaterThan(filterValue) : (fieldVal) => {
|
|
20141
|
-
return fieldVal > filterValue;
|
|
20142
|
-
};
|
|
20143
|
-
} else if (ccSelectedFilter === "lessThan") {
|
|
20144
|
-
return qb ? qb.lessThan(filterValue) : (fieldVal) => {
|
|
20145
|
-
return fieldVal < filterValue;
|
|
20146
|
-
};
|
|
20147
|
-
} else if (ccSelectedFilter === "inRange") {
|
|
20148
|
-
return qb ? qb.between(filterValue[0], filterValue[1]) : (fieldVal) => {
|
|
20149
|
-
return filterValue[0] <= fieldVal && fieldVal <= filterValue[1];
|
|
20150
|
-
};
|
|
20151
|
-
} else if (ccSelectedFilter === "outsideRange") {
|
|
20152
|
-
return qb ? qb.notBetween(filterValue[0], filterValue[1]) : (fieldVal) => {
|
|
20153
|
-
return filterValue[0] > fieldVal || fieldVal > filterValue[1];
|
|
20154
|
-
};
|
|
20155
|
-
} else if (ccSelectedFilter === "equalTo") {
|
|
20156
|
-
return qb ? filterValue : (fieldVal) => {
|
|
20157
|
-
return fieldVal === filterValue;
|
|
20158
|
-
};
|
|
20159
|
-
} else if (ccSelectedFilter === "regex") {
|
|
20160
|
-
return qb ? qb.matchesRegex(filterValue) : (fieldVal) => {
|
|
20161
|
-
new RegExp(filterValue).test(fieldVal);
|
|
20162
|
-
return fieldVal;
|
|
20163
|
-
};
|
|
20164
|
-
}
|
|
20165
|
-
throw new Error(
|
|
20166
|
-
`Unsupported filter ${selectedFilter}. Please make a new filter if you need one`
|
|
20167
|
-
);
|
|
20168
|
-
}
|
|
20169
|
-
__name(getSubFilter, "getSubFilter");
|
|
20170
20063
|
function getCurrentParamsFromUrl(location2, isSimple) {
|
|
20171
20064
|
let { search: search2 } = location2;
|
|
20172
20065
|
return parseFilters(queryString.parse(search2, { ignoreQueryPrefix: true }));
|
|
@@ -20230,22 +20123,6 @@ function parseFilters(newParams) {
|
|
|
20230
20123
|
});
|
|
20231
20124
|
}
|
|
20232
20125
|
__name(parseFilters, "parseFilters");
|
|
20233
|
-
function buildRef(qb, reference2, searchField, expression) {
|
|
20234
|
-
if (reference2.reference) {
|
|
20235
|
-
return qb.related(reference2.target).whereAny({
|
|
20236
|
-
[reference2.sourceField]: buildRef(
|
|
20237
|
-
qb,
|
|
20238
|
-
reference2.reference,
|
|
20239
|
-
searchField,
|
|
20240
|
-
expression
|
|
20241
|
-
)
|
|
20242
|
-
});
|
|
20243
|
-
}
|
|
20244
|
-
return qb.related(reference2.target).whereAny({
|
|
20245
|
-
[searchField]: expression
|
|
20246
|
-
});
|
|
20247
|
-
}
|
|
20248
|
-
__name(buildRef, "buildRef");
|
|
20249
20126
|
function makeDataTableHandlers({
|
|
20250
20127
|
setNewParams,
|
|
20251
20128
|
defaults: defaults2,
|
|
@@ -20333,27 +20210,19 @@ function makeDataTableHandlers({
|
|
|
20333
20210
|
};
|
|
20334
20211
|
}
|
|
20335
20212
|
__name(makeDataTableHandlers, "makeDataTableHandlers");
|
|
20336
|
-
function
|
|
20337
|
-
|
|
20338
|
-
|
|
20339
|
-
|
|
20340
|
-
|
|
20341
|
-
|
|
20342
|
-
|
|
20343
|
-
|
|
20344
|
-
|
|
20345
|
-
|
|
20346
|
-
function getAllFilters(filters, searchTerm, schema2) {
|
|
20347
|
-
let allFilters = [
|
|
20348
|
-
...filters,
|
|
20349
|
-
...getFiltersFromSearchTerm(searchTerm, schema2)
|
|
20350
|
-
];
|
|
20351
|
-
allFilters = allFilters.filter((val2) => {
|
|
20352
|
-
return val2 !== "";
|
|
20213
|
+
function cleanupFilters({ filters, ccFields }) {
|
|
20214
|
+
(filters || []).forEach((filter2) => {
|
|
20215
|
+
const { filterOn, filterValue } = filter2;
|
|
20216
|
+
const field = ccFields[filterOn];
|
|
20217
|
+
if (field.type === "number" || field.type === "integer") {
|
|
20218
|
+
filter2.filterValue = Array.isArray(filterValue) ? filterValue.map((val2) => Number(val2)) : Number(filterValue);
|
|
20219
|
+
}
|
|
20220
|
+
if (filter2.selectedFilter === "inList" && typeof filter2.filterValue === "number") {
|
|
20221
|
+
filter2.filterValue = filter2.filterValue.toString();
|
|
20222
|
+
}
|
|
20353
20223
|
});
|
|
20354
|
-
return allFilters.map(cleanupFilter);
|
|
20355
20224
|
}
|
|
20356
|
-
__name(
|
|
20225
|
+
__name(cleanupFilters, "cleanupFilters");
|
|
20357
20226
|
function getQueryParams({
|
|
20358
20227
|
currentParams,
|
|
20359
20228
|
urlConnected,
|
|
@@ -20363,88 +20232,45 @@ function getQueryParams({
|
|
|
20363
20232
|
entities,
|
|
20364
20233
|
isLocalCall,
|
|
20365
20234
|
additionalFilter,
|
|
20366
|
-
additionalOrFilter,
|
|
20367
20235
|
doNotCoercePageSize,
|
|
20368
20236
|
noOrderError,
|
|
20369
20237
|
isCodeModel,
|
|
20370
20238
|
ownProps
|
|
20371
20239
|
}) {
|
|
20372
|
-
|
|
20373
|
-
|
|
20374
|
-
|
|
20240
|
+
let errorParsingUrlString;
|
|
20241
|
+
try {
|
|
20242
|
+
Object.keys(currentParams).forEach(function(key) {
|
|
20243
|
+
if (currentParams[key] === void 0) {
|
|
20244
|
+
delete currentParams[key];
|
|
20245
|
+
}
|
|
20246
|
+
});
|
|
20247
|
+
const tableQueryParams = __spreadValues(__spreadValues({}, defaults2), currentParams);
|
|
20248
|
+
let { page, pageSize, searchTerm, filters, order: order2 } = tableQueryParams;
|
|
20249
|
+
const ccFields = getFieldsMappedByCCDisplayName(schema2);
|
|
20250
|
+
cleanupFilters({ filters, ccFields });
|
|
20251
|
+
if (page <= 0 || isNaN(page)) {
|
|
20252
|
+
page = void 0;
|
|
20375
20253
|
}
|
|
20376
|
-
});
|
|
20377
|
-
const tableQueryParams = __spreadValues(__spreadValues({}, defaults2), currentParams);
|
|
20378
|
-
let { page, pageSize, searchTerm, filters, order: order2 } = tableQueryParams;
|
|
20379
|
-
if (page <= 0 || isNaN(page)) {
|
|
20380
|
-
page = void 0;
|
|
20381
|
-
}
|
|
20382
|
-
if (isInfinite) {
|
|
20383
|
-
page = void 0;
|
|
20384
|
-
pageSize = void 0;
|
|
20385
|
-
}
|
|
20386
|
-
if (pageSize !== void 0 && !doNotCoercePageSize) {
|
|
20387
|
-
const closest2 = clone$1(window.tgPageSizes || defaultPageSizes).sort(
|
|
20388
|
-
(a2, b3) => Math.abs(pageSize - a2) - Math.abs(pageSize - b3)
|
|
20389
|
-
)[0];
|
|
20390
|
-
pageSize = closest2;
|
|
20391
|
-
}
|
|
20392
|
-
const toReturn = {
|
|
20393
|
-
//these are values that might be generally useful for the wrapped component
|
|
20394
|
-
page,
|
|
20395
|
-
pageSize: ownProps.controlled_pageSize || pageSize,
|
|
20396
|
-
order: order2,
|
|
20397
|
-
filters,
|
|
20398
|
-
searchTerm
|
|
20399
|
-
};
|
|
20400
|
-
if (isLocalCall) {
|
|
20401
|
-
let newEntities = entities;
|
|
20402
|
-
newEntities = filterEntitiesLocal(
|
|
20403
|
-
filters,
|
|
20404
|
-
searchTerm,
|
|
20405
|
-
newEntities,
|
|
20406
|
-
schema2,
|
|
20407
|
-
ownProps
|
|
20408
|
-
);
|
|
20409
|
-
newEntities = orderEntitiesLocal(order2, newEntities, schema2, ownProps);
|
|
20410
|
-
const entitiesAcrossPages = newEntities;
|
|
20411
|
-
const newEntityCount = newEntities.length;
|
|
20412
|
-
if (!isInfinite && !ownProps.controlled_pageSize) {
|
|
20413
|
-
const offset4 = (page - 1) * pageSize;
|
|
20414
|
-
newEntities = take(drop$2(newEntities, offset4), pageSize);
|
|
20415
|
-
}
|
|
20416
|
-
toReturn.entities = newEntities;
|
|
20417
|
-
toReturn.entitiesAcrossPages = entitiesAcrossPages;
|
|
20418
|
-
toReturn.entityCount = newEntityCount;
|
|
20419
|
-
return toReturn;
|
|
20420
|
-
} else {
|
|
20421
|
-
const graphqlQueryParams = {
|
|
20422
|
-
// need to make sure sort exists because of https://github.com/apollographql/apollo-client/issues/3077
|
|
20423
|
-
sort: []
|
|
20424
|
-
};
|
|
20425
20254
|
if (isInfinite) {
|
|
20426
|
-
|
|
20427
|
-
|
|
20428
|
-
}
|
|
20429
|
-
|
|
20430
|
-
|
|
20431
|
-
|
|
20432
|
-
|
|
20433
|
-
|
|
20434
|
-
|
|
20435
|
-
const
|
|
20436
|
-
if (
|
|
20437
|
-
|
|
20255
|
+
page = void 0;
|
|
20256
|
+
pageSize = void 0;
|
|
20257
|
+
}
|
|
20258
|
+
if (pageSize !== void 0 && !doNotCoercePageSize) {
|
|
20259
|
+
const closest2 = clone$1(window.tgPageSizes || defaultPageSizes).sort(
|
|
20260
|
+
(a2, b3) => Math.abs(pageSize - a2) - Math.abs(pageSize - b3)
|
|
20261
|
+
)[0];
|
|
20262
|
+
pageSize = closest2;
|
|
20263
|
+
}
|
|
20264
|
+
const cleanedOrder = [];
|
|
20265
|
+
if (order2 && order2.length) {
|
|
20266
|
+
order2.forEach((orderVal) => {
|
|
20438
20267
|
const ccDisplayName = orderVal.replace(/^-/gi, "");
|
|
20439
20268
|
const schemaForField = ccFields[ccDisplayName];
|
|
20440
20269
|
if (schemaForField) {
|
|
20441
20270
|
const { path: path2 } = schemaForField;
|
|
20442
20271
|
const reversed = ccDisplayName !== orderVal;
|
|
20443
20272
|
const prefix2 = reversed ? "-" : "";
|
|
20444
|
-
|
|
20445
|
-
...graphqlQueryParams.sort || [],
|
|
20446
|
-
prefix2 + path2
|
|
20447
|
-
];
|
|
20273
|
+
cleanedOrder.push(prefix2 + path2);
|
|
20448
20274
|
} else {
|
|
20449
20275
|
!noOrderError && console.error(
|
|
20450
20276
|
"No schema for field found!",
|
|
@@ -20454,167 +20280,104 @@ function getQueryParams({
|
|
|
20454
20280
|
}
|
|
20455
20281
|
});
|
|
20456
20282
|
}
|
|
20457
|
-
let
|
|
20458
|
-
|
|
20459
|
-
|
|
20460
|
-
|
|
20461
|
-
|
|
20462
|
-
|
|
20463
|
-
|
|
20464
|
-
|
|
20465
|
-
const {
|
|
20466
|
-
|
|
20467
|
-
|
|
20468
|
-
|
|
20469
|
-
|
|
20470
|
-
|
|
20471
|
-
|
|
20472
|
-
|
|
20473
|
-
|
|
20474
|
-
|
|
20475
|
-
|
|
20476
|
-
|
|
20477
|
-
|
|
20478
|
-
|
|
20479
|
-
|
|
20480
|
-
|
|
20481
|
-
|
|
20482
|
-
|
|
20483
|
-
|
|
20484
|
-
|
|
20485
|
-
|
|
20486
|
-
|
|
20487
|
-
|
|
20488
|
-
|
|
20489
|
-
|
|
20490
|
-
|
|
20491
|
-
|
|
20492
|
-
|
|
20493
|
-
}
|
|
20494
|
-
const columnCustomFilters = getColumnCustomFilters(
|
|
20495
|
-
andFilters,
|
|
20496
|
-
qb,
|
|
20497
|
-
ccFields
|
|
20283
|
+
let toRet = {
|
|
20284
|
+
//these are values that might be generally useful for the wrapped component
|
|
20285
|
+
page,
|
|
20286
|
+
pageSize: ownProps.controlled_pageSize || pageSize,
|
|
20287
|
+
order: cleanedOrder,
|
|
20288
|
+
filters,
|
|
20289
|
+
searchTerm
|
|
20290
|
+
};
|
|
20291
|
+
const { where, order_by, limit, offset: offset4 } = tableQueryParamsToHasuraClauses({
|
|
20292
|
+
page,
|
|
20293
|
+
pageSize,
|
|
20294
|
+
searchTerm,
|
|
20295
|
+
filters,
|
|
20296
|
+
order: cleanedOrder,
|
|
20297
|
+
schema: schema2
|
|
20298
|
+
});
|
|
20299
|
+
initializeHasuraWhereAndFilter(additionalFilter, where, currentParams);
|
|
20300
|
+
if (isLocalCall) {
|
|
20301
|
+
const r2 = filterLocalEntitiesToHasura(
|
|
20302
|
+
prepEntitiesForLocalFilter({ entities, ccFields }),
|
|
20303
|
+
{
|
|
20304
|
+
where,
|
|
20305
|
+
order_by: (Array.isArray(order_by) ? order_by : [order_by]).map(
|
|
20306
|
+
(obj) => {
|
|
20307
|
+
const path2 = Object.keys(obj)[0];
|
|
20308
|
+
return __spreadValues({
|
|
20309
|
+
path: path2,
|
|
20310
|
+
direction: obj[path2],
|
|
20311
|
+
ownProps
|
|
20312
|
+
}, ccFields[path2]);
|
|
20313
|
+
}
|
|
20314
|
+
),
|
|
20315
|
+
limit,
|
|
20316
|
+
offset: offset4,
|
|
20317
|
+
isInfinite
|
|
20318
|
+
}
|
|
20498
20319
|
);
|
|
20499
|
-
|
|
20500
|
-
|
|
20501
|
-
|
|
20502
|
-
|
|
20503
|
-
|
|
20504
|
-
errorParsingUrlString = e;
|
|
20505
|
-
console.error(
|
|
20506
|
-
"The following error occurred when trying to build the query params. This is probably due to a malformed URL:",
|
|
20507
|
-
e
|
|
20508
|
-
);
|
|
20509
|
-
} else {
|
|
20510
|
-
console.error("Error building query params from filter:");
|
|
20511
|
-
throw e;
|
|
20320
|
+
toRet = __spreadValues(__spreadValues({}, toRet), r2);
|
|
20321
|
+
return toRet;
|
|
20322
|
+
} else {
|
|
20323
|
+
if (!order_by.length) {
|
|
20324
|
+
order_by.push({ updatedAt: "desc" });
|
|
20512
20325
|
}
|
|
20326
|
+
order_by.push(
|
|
20327
|
+
isCodeModel ? { code: "asc" } : { [window.__sortId || "id"]: "asc" }
|
|
20328
|
+
);
|
|
20329
|
+
return __spreadProps(__spreadValues({}, toRet), {
|
|
20330
|
+
variables: {
|
|
20331
|
+
where,
|
|
20332
|
+
order_by,
|
|
20333
|
+
limit,
|
|
20334
|
+
offset: offset4
|
|
20335
|
+
}
|
|
20336
|
+
});
|
|
20513
20337
|
}
|
|
20514
|
-
|
|
20515
|
-
|
|
20516
|
-
|
|
20517
|
-
|
|
20518
|
-
|
|
20338
|
+
} catch (e) {
|
|
20339
|
+
if (urlConnected) {
|
|
20340
|
+
errorParsingUrlString = e;
|
|
20341
|
+
console.error(
|
|
20342
|
+
"The following error occurred when trying to build the query params. This is probably due to a malformed URL:",
|
|
20343
|
+
e
|
|
20344
|
+
);
|
|
20345
|
+
return {
|
|
20346
|
+
errorParsingUrlString,
|
|
20347
|
+
variables: {
|
|
20348
|
+
where: {},
|
|
20349
|
+
order_by: [],
|
|
20350
|
+
limit: 0,
|
|
20351
|
+
offset: 0
|
|
20352
|
+
}
|
|
20353
|
+
};
|
|
20354
|
+
} else {
|
|
20355
|
+
console.error("Error building query params from filter:");
|
|
20356
|
+
throw e;
|
|
20519
20357
|
}
|
|
20520
|
-
graphqlQueryParams.sort.push(
|
|
20521
|
-
isCodeModel ? "code" : window.__sortId || "id"
|
|
20522
|
-
);
|
|
20523
|
-
return __spreadProps(__spreadValues({}, toReturn), {
|
|
20524
|
-
//the query params will get passed directly to as variables to the graphql query
|
|
20525
|
-
variables: graphqlQueryParams,
|
|
20526
|
-
errorParsingUrlString
|
|
20527
|
-
});
|
|
20528
20358
|
}
|
|
20529
20359
|
}
|
|
20530
20360
|
__name(getQueryParams, "getQueryParams");
|
|
20531
|
-
function
|
|
20532
|
-
const
|
|
20533
|
-
|
|
20534
|
-
|
|
20535
|
-
|
|
20536
|
-
|
|
20537
|
-
|
|
20538
|
-
|
|
20539
|
-
|
|
20540
|
-
|
|
20541
|
-
);
|
|
20542
|
-
}
|
|
20543
|
-
}
|
|
20544
|
-
const _subFilters = getSubFilter(qb, selectedFilter, filterValueToUse);
|
|
20545
|
-
let filterField;
|
|
20546
|
-
if (fieldSchema) {
|
|
20547
|
-
const { path: path2, reference: reference2 } = fieldSchema;
|
|
20548
|
-
if (reference2) {
|
|
20549
|
-
filterField = reference2.sourceField;
|
|
20550
|
-
} else {
|
|
20551
|
-
filterField = path2;
|
|
20552
|
-
}
|
|
20553
|
-
} else if (filterOn === "id") {
|
|
20554
|
-
filterField = filterOn;
|
|
20555
|
-
} else {
|
|
20556
|
-
console.error("Trying to filter on unknown field");
|
|
20557
|
-
}
|
|
20558
|
-
const subFiltersToUse = [];
|
|
20559
|
-
const subFilters = Array.isArray(_subFilters) ? _subFilters : [_subFilters];
|
|
20560
|
-
subFilters.forEach((subFilter) => {
|
|
20561
|
-
let subFilterToUse = subFilter;
|
|
20562
|
-
if (fieldSchema) {
|
|
20563
|
-
const { path: path2, reference: reference2 } = fieldSchema;
|
|
20564
|
-
if (reference2) {
|
|
20565
|
-
subFilterToUse = buildRef(
|
|
20566
|
-
qb,
|
|
20567
|
-
reference2,
|
|
20568
|
-
last$1(path2.split(".")),
|
|
20569
|
-
subFilter
|
|
20570
|
-
);
|
|
20361
|
+
function prepEntitiesForLocalFilter({ entities, ccFields }) {
|
|
20362
|
+
const r2 = entities.map((entity) => {
|
|
20363
|
+
const toSpread = {};
|
|
20364
|
+
let hasChanged = false;
|
|
20365
|
+
forEach$1(ccFields, ({ getValueToFilterOn, path: path2 }) => {
|
|
20366
|
+
if (getValueToFilterOn) {
|
|
20367
|
+
hasChanged = true;
|
|
20368
|
+
toSpread["___original___" + path2] = entity[path2];
|
|
20369
|
+
const value = getValueToFilterOn(entity);
|
|
20370
|
+
toSpread[path2] = value;
|
|
20571
20371
|
}
|
|
20372
|
+
});
|
|
20373
|
+
if (hasChanged) {
|
|
20374
|
+
return __spreadValues(__spreadValues({}, entity), toSpread);
|
|
20572
20375
|
}
|
|
20573
|
-
|
|
20376
|
+
return entity;
|
|
20574
20377
|
});
|
|
20575
|
-
return
|
|
20576
|
-
path: filterField,
|
|
20577
|
-
subFilters: subFiltersToUse
|
|
20578
|
-
};
|
|
20579
|
-
}
|
|
20580
|
-
__name(getSubFiltersAndPath, "getSubFiltersAndPath");
|
|
20581
|
-
function getQueries(filters, qb, ccFields) {
|
|
20582
|
-
const subQueries = filters.reduce((acc, filter2) => {
|
|
20583
|
-
if (!filter2) {
|
|
20584
|
-
console.warn("We should always have a filter object!");
|
|
20585
|
-
return acc;
|
|
20586
|
-
}
|
|
20587
|
-
const { filterOn } = filter2;
|
|
20588
|
-
const fieldSchema = ccFields[filterOn];
|
|
20589
|
-
if (!filter2.isSearchTermFilter && (fieldSchema == null ? void 0 : fieldSchema.additionalColumnFilter))
|
|
20590
|
-
return acc;
|
|
20591
|
-
const { path: path2, subFilters } = getSubFiltersAndPath(filter2, qb, ccFields);
|
|
20592
|
-
acc[path2] = subFilters;
|
|
20593
|
-
return acc;
|
|
20594
|
-
}, {});
|
|
20595
|
-
return subQueries;
|
|
20596
|
-
}
|
|
20597
|
-
__name(getQueries, "getQueries");
|
|
20598
|
-
function getColumnCustomFilters(filters, qb, ccFields) {
|
|
20599
|
-
const subQueries = filters.reduce((acc, filter2) => {
|
|
20600
|
-
if (!filter2) {
|
|
20601
|
-
console.warn("We should always have a filter object!");
|
|
20602
|
-
return acc;
|
|
20603
|
-
}
|
|
20604
|
-
const { filterOn } = filter2;
|
|
20605
|
-
const fieldSchema = ccFields[filterOn];
|
|
20606
|
-
if (filter2.isSearchTermFilter || !(fieldSchema == null ? void 0 : fieldSchema.additionalColumnFilter)) {
|
|
20607
|
-
return acc;
|
|
20608
|
-
}
|
|
20609
|
-
const { path: path2, subFilters } = getSubFiltersAndPath(filter2, qb, ccFields);
|
|
20610
|
-
subFilters.forEach((subFilter) => {
|
|
20611
|
-
acc.push(fieldSchema.additionalColumnFilter(qb, subFilter, path2));
|
|
20612
|
-
});
|
|
20613
|
-
return acc;
|
|
20614
|
-
}, []);
|
|
20615
|
-
return subQueries;
|
|
20378
|
+
return r2;
|
|
20616
20379
|
}
|
|
20617
|
-
__name(
|
|
20380
|
+
__name(prepEntitiesForLocalFilter, "prepEntitiesForLocalFilter");
|
|
20618
20381
|
function PagingInput({ disabled, onBlur, defaultPage }) {
|
|
20619
20382
|
const [page, setPage] = React.useState(defaultPage);
|
|
20620
20383
|
const defaultValue2 = React.useRef(defaultPage);
|
|
@@ -32418,7 +32181,15 @@ function requireColor() {
|
|
|
32418
32181
|
__name(requireColor, "requireColor");
|
|
32419
32182
|
var colorExports = requireColor();
|
|
32420
32183
|
const Color = /* @__PURE__ */ getDefaultExportFromCjs(colorExports);
|
|
32421
|
-
|
|
32184
|
+
function determineBlackOrWhiteTextColor(c2) {
|
|
32185
|
+
try {
|
|
32186
|
+
return Color(c2).isLight() ? "#000000" : "#FFFFFF";
|
|
32187
|
+
} catch (e) {
|
|
32188
|
+
console.error("Error in color parsing:", e);
|
|
32189
|
+
return "#000000";
|
|
32190
|
+
}
|
|
32191
|
+
}
|
|
32192
|
+
__name(determineBlackOrWhiteTextColor, "determineBlackOrWhiteTextColor");
|
|
32422
32193
|
function getTagsAndTagOptions(allTags) {
|
|
32423
32194
|
return flatMap(allTags, (tag) => {
|
|
32424
32195
|
if (tag.tagOptions && tag.tagOptions.length) {
|
|
@@ -33005,6 +32776,293 @@ const InfoHelper = /* @__PURE__ */ __name((_e) => {
|
|
|
33005
32776
|
toReturn
|
|
33006
32777
|
);
|
|
33007
32778
|
}, "InfoHelper");
|
|
32779
|
+
var dayjs_min$1 = { exports: {} };
|
|
32780
|
+
var dayjs_min = dayjs_min$1.exports;
|
|
32781
|
+
var hasRequiredDayjs_min;
|
|
32782
|
+
function requireDayjs_min() {
|
|
32783
|
+
if (hasRequiredDayjs_min) return dayjs_min$1.exports;
|
|
32784
|
+
hasRequiredDayjs_min = 1;
|
|
32785
|
+
(function(module2, exports2) {
|
|
32786
|
+
!function(t2, e) {
|
|
32787
|
+
module2.exports = e();
|
|
32788
|
+
}(dayjs_min, function() {
|
|
32789
|
+
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) {
|
|
32790
|
+
var e2 = ["th", "st", "nd", "rd"], n3 = t3 % 100;
|
|
32791
|
+
return "[" + t3 + (e2[(n3 - 20) % 10] || e2[n3] || e2[0]) + "]";
|
|
32792
|
+
}, "ordinal") }, m2 = /* @__PURE__ */ __name(function(t3, e2, n3) {
|
|
32793
|
+
var r3 = String(t3);
|
|
32794
|
+
return !r3 || r3.length >= e2 ? t3 : "" + Array(e2 + 1 - r3.length).join(n3) + t3;
|
|
32795
|
+
}, "m"), v2 = { s: m2, z: /* @__PURE__ */ __name(function(t3) {
|
|
32796
|
+
var e2 = -t3.utcOffset(), n3 = Math.abs(e2), r3 = Math.floor(n3 / 60), i2 = n3 % 60;
|
|
32797
|
+
return (e2 <= 0 ? "+" : "-") + m2(r3, 2, "0") + ":" + m2(i2, 2, "0");
|
|
32798
|
+
}, "z"), m: /* @__PURE__ */ __name(function t3(e2, n3) {
|
|
32799
|
+
if (e2.date() < n3.date()) return -t3(n3, e2);
|
|
32800
|
+
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);
|
|
32801
|
+
return +(-(r3 + (n3 - i2) / (s3 ? i2 - u3 : u3 - i2)) || 0);
|
|
32802
|
+
}, "t"), a: /* @__PURE__ */ __name(function(t3) {
|
|
32803
|
+
return t3 < 0 ? Math.ceil(t3) || 0 : Math.floor(t3);
|
|
32804
|
+
}, "a"), p: /* @__PURE__ */ __name(function(t3) {
|
|
32805
|
+
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$/, "");
|
|
32806
|
+
}, "p"), u: /* @__PURE__ */ __name(function(t3) {
|
|
32807
|
+
return void 0 === t3;
|
|
32808
|
+
}, "u") }, g2 = "en", D2 = {};
|
|
32809
|
+
D2[g2] = M2;
|
|
32810
|
+
var p2 = "$isDayjsObject", S2 = /* @__PURE__ */ __name(function(t3) {
|
|
32811
|
+
return t3 instanceof _2 || !(!t3 || !t3[p2]);
|
|
32812
|
+
}, "S"), w2 = /* @__PURE__ */ __name(function t3(e2, n3, r3) {
|
|
32813
|
+
var i2;
|
|
32814
|
+
if (!e2) return g2;
|
|
32815
|
+
if ("string" == typeof e2) {
|
|
32816
|
+
var s3 = e2.toLowerCase();
|
|
32817
|
+
D2[s3] && (i2 = s3), n3 && (D2[s3] = n3, i2 = s3);
|
|
32818
|
+
var u3 = e2.split("-");
|
|
32819
|
+
if (!i2 && u3.length > 1) return t3(u3[0]);
|
|
32820
|
+
} else {
|
|
32821
|
+
var a3 = e2.name;
|
|
32822
|
+
D2[a3] = e2, i2 = a3;
|
|
32823
|
+
}
|
|
32824
|
+
return !r3 && i2 && (g2 = i2), i2 || !r3 && g2;
|
|
32825
|
+
}, "t"), O2 = /* @__PURE__ */ __name(function(t3, e2) {
|
|
32826
|
+
if (S2(t3)) return t3.clone();
|
|
32827
|
+
var n3 = "object" == typeof e2 ? e2 : {};
|
|
32828
|
+
return n3.date = t3, n3.args = arguments, new _2(n3);
|
|
32829
|
+
}, "O"), b3 = v2;
|
|
32830
|
+
b3.l = w2, b3.i = S2, b3.w = function(t3, e2) {
|
|
32831
|
+
return O2(t3, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
|
|
32832
|
+
};
|
|
32833
|
+
var _2 = function() {
|
|
32834
|
+
function M3(t3) {
|
|
32835
|
+
this.$L = w2(t3.locale, null, true), this.parse(t3), this.$x = this.$x || t3.x || {}, this[p2] = true;
|
|
32836
|
+
}
|
|
32837
|
+
__name(M3, "M");
|
|
32838
|
+
var m3 = M3.prototype;
|
|
32839
|
+
return m3.parse = function(t3) {
|
|
32840
|
+
this.$d = function(t4) {
|
|
32841
|
+
var e2 = t4.date, n3 = t4.utc;
|
|
32842
|
+
if (null === e2) return /* @__PURE__ */ new Date(NaN);
|
|
32843
|
+
if (b3.u(e2)) return /* @__PURE__ */ new Date();
|
|
32844
|
+
if (e2 instanceof Date) return new Date(e2);
|
|
32845
|
+
if ("string" == typeof e2 && !/Z$/i.test(e2)) {
|
|
32846
|
+
var r3 = e2.match($);
|
|
32847
|
+
if (r3) {
|
|
32848
|
+
var i2 = r3[2] - 1 || 0, s3 = (r3[7] || "0").substring(0, 3);
|
|
32849
|
+
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);
|
|
32850
|
+
}
|
|
32851
|
+
}
|
|
32852
|
+
return new Date(e2);
|
|
32853
|
+
}(t3), this.init();
|
|
32854
|
+
}, m3.init = function() {
|
|
32855
|
+
var t3 = this.$d;
|
|
32856
|
+
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();
|
|
32857
|
+
}, m3.$utils = function() {
|
|
32858
|
+
return b3;
|
|
32859
|
+
}, m3.isValid = function() {
|
|
32860
|
+
return !(this.$d.toString() === l2);
|
|
32861
|
+
}, m3.isSame = function(t3, e2) {
|
|
32862
|
+
var n3 = O2(t3);
|
|
32863
|
+
return this.startOf(e2) <= n3 && n3 <= this.endOf(e2);
|
|
32864
|
+
}, m3.isAfter = function(t3, e2) {
|
|
32865
|
+
return O2(t3) < this.startOf(e2);
|
|
32866
|
+
}, m3.isBefore = function(t3, e2) {
|
|
32867
|
+
return this.endOf(e2) < O2(t3);
|
|
32868
|
+
}, m3.$g = function(t3, e2, n3) {
|
|
32869
|
+
return b3.u(t3) ? this[e2] : this.set(n3, t3);
|
|
32870
|
+
}, m3.unix = function() {
|
|
32871
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
32872
|
+
}, m3.valueOf = function() {
|
|
32873
|
+
return this.$d.getTime();
|
|
32874
|
+
}, m3.startOf = function(t3, e2) {
|
|
32875
|
+
var n3 = this, r3 = !!b3.u(e2) || e2, f3 = b3.p(t3), l3 = /* @__PURE__ */ __name(function(t4, e3) {
|
|
32876
|
+
var i2 = b3.w(n3.$u ? Date.UTC(n3.$y, e3, t4) : new Date(n3.$y, e3, t4), n3);
|
|
32877
|
+
return r3 ? i2 : i2.endOf(a2);
|
|
32878
|
+
}, "l"), $2 = /* @__PURE__ */ __name(function(t4, e3) {
|
|
32879
|
+
return b3.w(n3.toDate()[t4].apply(n3.toDate("s"), (r3 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n3);
|
|
32880
|
+
}, "$"), y3 = this.$W, M4 = this.$M, m4 = this.$D, v3 = "set" + (this.$u ? "UTC" : "");
|
|
32881
|
+
switch (f3) {
|
|
32882
|
+
case h2:
|
|
32883
|
+
return r3 ? l3(1, 0) : l3(31, 11);
|
|
32884
|
+
case c2:
|
|
32885
|
+
return r3 ? l3(1, M4) : l3(0, M4 + 1);
|
|
32886
|
+
case o2:
|
|
32887
|
+
var g3 = this.$locale().weekStart || 0, D3 = (y3 < g3 ? y3 + 7 : y3) - g3;
|
|
32888
|
+
return l3(r3 ? m4 - D3 : m4 + (6 - D3), M4);
|
|
32889
|
+
case a2:
|
|
32890
|
+
case d2:
|
|
32891
|
+
return $2(v3 + "Hours", 0);
|
|
32892
|
+
case u2:
|
|
32893
|
+
return $2(v3 + "Minutes", 1);
|
|
32894
|
+
case s2:
|
|
32895
|
+
return $2(v3 + "Seconds", 2);
|
|
32896
|
+
case i:
|
|
32897
|
+
return $2(v3 + "Milliseconds", 3);
|
|
32898
|
+
default:
|
|
32899
|
+
return this.clone();
|
|
32900
|
+
}
|
|
32901
|
+
}, m3.endOf = function(t3) {
|
|
32902
|
+
return this.startOf(t3, false);
|
|
32903
|
+
}, m3.$set = function(t3, e2) {
|
|
32904
|
+
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;
|
|
32905
|
+
if (o3 === c2 || o3 === h2) {
|
|
32906
|
+
var y3 = this.clone().set(d2, 1);
|
|
32907
|
+
y3.$d[l3]($2), y3.init(), this.$d = y3.set(d2, Math.min(this.$D, y3.daysInMonth())).$d;
|
|
32908
|
+
} else l3 && this.$d[l3]($2);
|
|
32909
|
+
return this.init(), this;
|
|
32910
|
+
}, m3.set = function(t3, e2) {
|
|
32911
|
+
return this.clone().$set(t3, e2);
|
|
32912
|
+
}, m3.get = function(t3) {
|
|
32913
|
+
return this[b3.p(t3)]();
|
|
32914
|
+
}, m3.add = function(r3, f3) {
|
|
32915
|
+
var d3, l3 = this;
|
|
32916
|
+
r3 = Number(r3);
|
|
32917
|
+
var $2 = b3.p(f3), y3 = /* @__PURE__ */ __name(function(t3) {
|
|
32918
|
+
var e2 = O2(l3);
|
|
32919
|
+
return b3.w(e2.date(e2.date() + Math.round(t3 * r3)), l3);
|
|
32920
|
+
}, "y");
|
|
32921
|
+
if ($2 === c2) return this.set(c2, this.$M + r3);
|
|
32922
|
+
if ($2 === h2) return this.set(h2, this.$y + r3);
|
|
32923
|
+
if ($2 === a2) return y3(1);
|
|
32924
|
+
if ($2 === o2) return y3(7);
|
|
32925
|
+
var M4 = (d3 = {}, d3[s2] = e, d3[u2] = n2, d3[i] = t2, d3)[$2] || 1, m4 = this.$d.getTime() + r3 * M4;
|
|
32926
|
+
return b3.w(m4, this);
|
|
32927
|
+
}, m3.subtract = function(t3, e2) {
|
|
32928
|
+
return this.add(-1 * t3, e2);
|
|
32929
|
+
}, m3.format = function(t3) {
|
|
32930
|
+
var e2 = this, n3 = this.$locale();
|
|
32931
|
+
if (!this.isValid()) return n3.invalidDate || l2;
|
|
32932
|
+
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) {
|
|
32933
|
+
return t4 && (t4[n4] || t4(e2, r3)) || i3[n4].slice(0, s4);
|
|
32934
|
+
}, "h"), d3 = /* @__PURE__ */ __name(function(t4) {
|
|
32935
|
+
return b3.s(s3 % 12 || 12, t4, "0");
|
|
32936
|
+
}, "d"), $2 = f3 || function(t4, e3, n4) {
|
|
32937
|
+
var r4 = t4 < 12 ? "AM" : "PM";
|
|
32938
|
+
return n4 ? r4.toLowerCase() : r4;
|
|
32939
|
+
};
|
|
32940
|
+
return r3.replace(y2, function(t4, r4) {
|
|
32941
|
+
return r4 || function(t5) {
|
|
32942
|
+
switch (t5) {
|
|
32943
|
+
case "YY":
|
|
32944
|
+
return String(e2.$y).slice(-2);
|
|
32945
|
+
case "YYYY":
|
|
32946
|
+
return b3.s(e2.$y, 4, "0");
|
|
32947
|
+
case "M":
|
|
32948
|
+
return a3 + 1;
|
|
32949
|
+
case "MM":
|
|
32950
|
+
return b3.s(a3 + 1, 2, "0");
|
|
32951
|
+
case "MMM":
|
|
32952
|
+
return h3(n3.monthsShort, a3, c3, 3);
|
|
32953
|
+
case "MMMM":
|
|
32954
|
+
return h3(c3, a3);
|
|
32955
|
+
case "D":
|
|
32956
|
+
return e2.$D;
|
|
32957
|
+
case "DD":
|
|
32958
|
+
return b3.s(e2.$D, 2, "0");
|
|
32959
|
+
case "d":
|
|
32960
|
+
return String(e2.$W);
|
|
32961
|
+
case "dd":
|
|
32962
|
+
return h3(n3.weekdaysMin, e2.$W, o3, 2);
|
|
32963
|
+
case "ddd":
|
|
32964
|
+
return h3(n3.weekdaysShort, e2.$W, o3, 3);
|
|
32965
|
+
case "dddd":
|
|
32966
|
+
return o3[e2.$W];
|
|
32967
|
+
case "H":
|
|
32968
|
+
return String(s3);
|
|
32969
|
+
case "HH":
|
|
32970
|
+
return b3.s(s3, 2, "0");
|
|
32971
|
+
case "h":
|
|
32972
|
+
return d3(1);
|
|
32973
|
+
case "hh":
|
|
32974
|
+
return d3(2);
|
|
32975
|
+
case "a":
|
|
32976
|
+
return $2(s3, u3, true);
|
|
32977
|
+
case "A":
|
|
32978
|
+
return $2(s3, u3, false);
|
|
32979
|
+
case "m":
|
|
32980
|
+
return String(u3);
|
|
32981
|
+
case "mm":
|
|
32982
|
+
return b3.s(u3, 2, "0");
|
|
32983
|
+
case "s":
|
|
32984
|
+
return String(e2.$s);
|
|
32985
|
+
case "ss":
|
|
32986
|
+
return b3.s(e2.$s, 2, "0");
|
|
32987
|
+
case "SSS":
|
|
32988
|
+
return b3.s(e2.$ms, 3, "0");
|
|
32989
|
+
case "Z":
|
|
32990
|
+
return i2;
|
|
32991
|
+
}
|
|
32992
|
+
return null;
|
|
32993
|
+
}(t4) || i2.replace(":", "");
|
|
32994
|
+
});
|
|
32995
|
+
}, m3.utcOffset = function() {
|
|
32996
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
32997
|
+
}, m3.diff = function(r3, d3, l3) {
|
|
32998
|
+
var $2, y3 = this, M4 = b3.p(d3), m4 = O2(r3), v3 = (m4.utcOffset() - this.utcOffset()) * e, g3 = this - m4, D3 = /* @__PURE__ */ __name(function() {
|
|
32999
|
+
return b3.m(y3, m4);
|
|
33000
|
+
}, "D");
|
|
33001
|
+
switch (M4) {
|
|
33002
|
+
case h2:
|
|
33003
|
+
$2 = D3() / 12;
|
|
33004
|
+
break;
|
|
33005
|
+
case c2:
|
|
33006
|
+
$2 = D3();
|
|
33007
|
+
break;
|
|
33008
|
+
case f2:
|
|
33009
|
+
$2 = D3() / 3;
|
|
33010
|
+
break;
|
|
33011
|
+
case o2:
|
|
33012
|
+
$2 = (g3 - v3) / 6048e5;
|
|
33013
|
+
break;
|
|
33014
|
+
case a2:
|
|
33015
|
+
$2 = (g3 - v3) / 864e5;
|
|
33016
|
+
break;
|
|
33017
|
+
case u2:
|
|
33018
|
+
$2 = g3 / n2;
|
|
33019
|
+
break;
|
|
33020
|
+
case s2:
|
|
33021
|
+
$2 = g3 / e;
|
|
33022
|
+
break;
|
|
33023
|
+
case i:
|
|
33024
|
+
$2 = g3 / t2;
|
|
33025
|
+
break;
|
|
33026
|
+
default:
|
|
33027
|
+
$2 = g3;
|
|
33028
|
+
}
|
|
33029
|
+
return l3 ? $2 : b3.a($2);
|
|
33030
|
+
}, m3.daysInMonth = function() {
|
|
33031
|
+
return this.endOf(c2).$D;
|
|
33032
|
+
}, m3.$locale = function() {
|
|
33033
|
+
return D2[this.$L];
|
|
33034
|
+
}, m3.locale = function(t3, e2) {
|
|
33035
|
+
if (!t3) return this.$L;
|
|
33036
|
+
var n3 = this.clone(), r3 = w2(t3, e2, true);
|
|
33037
|
+
return r3 && (n3.$L = r3), n3;
|
|
33038
|
+
}, m3.clone = function() {
|
|
33039
|
+
return b3.w(this.$d, this);
|
|
33040
|
+
}, m3.toDate = function() {
|
|
33041
|
+
return new Date(this.valueOf());
|
|
33042
|
+
}, m3.toJSON = function() {
|
|
33043
|
+
return this.isValid() ? this.toISOString() : null;
|
|
33044
|
+
}, m3.toISOString = function() {
|
|
33045
|
+
return this.$d.toISOString();
|
|
33046
|
+
}, m3.toString = function() {
|
|
33047
|
+
return this.$d.toUTCString();
|
|
33048
|
+
}, M3;
|
|
33049
|
+
}(), k2 = _2.prototype;
|
|
33050
|
+
return O2.prototype = k2, [["$ms", r2], ["$s", i], ["$m", s2], ["$H", u2], ["$W", a2], ["$M", c2], ["$y", h2], ["$D", d2]].forEach(function(t3) {
|
|
33051
|
+
k2[t3[1]] = function(e2) {
|
|
33052
|
+
return this.$g(e2, t3[0], t3[1]);
|
|
33053
|
+
};
|
|
33054
|
+
}), O2.extend = function(t3, e2) {
|
|
33055
|
+
return t3.$i || (t3(e2, _2, O2), t3.$i = true), O2;
|
|
33056
|
+
}, O2.locale = w2, O2.isDayjs = S2, O2.unix = function(t3) {
|
|
33057
|
+
return O2(1e3 * t3);
|
|
33058
|
+
}, O2.en = D2[g2], O2.Ls = D2, O2.p = {}, O2;
|
|
33059
|
+
});
|
|
33060
|
+
})(dayjs_min$1);
|
|
33061
|
+
return dayjs_min$1.exports;
|
|
33062
|
+
}
|
|
33063
|
+
__name(requireDayjs_min, "requireDayjs_min");
|
|
33064
|
+
var dayjs_minExports = requireDayjs_min();
|
|
33065
|
+
const dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports);
|
|
33008
33066
|
var localizedFormat$2 = { exports: {} };
|
|
33009
33067
|
var localizedFormat$1 = localizedFormat$2.exports;
|
|
33010
33068
|
var hasRequiredLocalizedFormat;
|
|
@@ -33244,7 +33302,7 @@ function removeUnwantedProps(props) {
|
|
|
33244
33302
|
return cleanedProps;
|
|
33245
33303
|
}
|
|
33246
33304
|
__name(removeUnwantedProps, "removeUnwantedProps");
|
|
33247
|
-
const LabelWithTooltipInfo = /* @__PURE__ */ __name(({ label, tooltipInfo, labelStyle }) => tooltipInfo ? /* @__PURE__ */ React.createElement("
|
|
33305
|
+
const LabelWithTooltipInfo = /* @__PURE__ */ __name(({ label, tooltipInfo, labelStyle }) => tooltipInfo ? /* @__PURE__ */ React.createElement("span", { style: __spreadValues({ display: "flex", alignItems: "center" }, labelStyle) }, label, " ", /* @__PURE__ */ React.createElement(
|
|
33248
33306
|
InfoHelper,
|
|
33249
33307
|
{
|
|
33250
33308
|
style: { marginLeft: "5px", marginTop: "-6px" },
|
|
@@ -36902,7 +36960,7 @@ const multiViewColumn = __spreadProps(__spreadValues({}, viewColumn), {
|
|
|
36902
36960
|
));
|
|
36903
36961
|
}, "render")
|
|
36904
36962
|
});
|
|
36905
|
-
|
|
36963
|
+
const convertSchema = /* @__PURE__ */ __name((schema2) => {
|
|
36906
36964
|
let schemaToUse = schema2;
|
|
36907
36965
|
if (!schemaToUse.fields && Array.isArray(schema2)) {
|
|
36908
36966
|
schemaToUse = {
|
|
@@ -36911,35 +36969,26 @@ function convertSchema(schema2) {
|
|
|
36911
36969
|
}
|
|
36912
36970
|
schemaToUse = __spreadValues({}, schemaToUse);
|
|
36913
36971
|
schemaToUse.fields = schemaToUse.fields.map((field, i) => {
|
|
36914
|
-
let fieldToUse = field;
|
|
36915
36972
|
if (typeof field === "string") {
|
|
36916
|
-
|
|
36973
|
+
return {
|
|
36917
36974
|
displayName: startCase(camelCase(field)),
|
|
36918
36975
|
path: field,
|
|
36919
36976
|
type: "string"
|
|
36920
36977
|
};
|
|
36921
|
-
} else
|
|
36922
|
-
fieldToUse =
|
|
36923
|
-
|
|
36924
|
-
|
|
36925
|
-
|
|
36926
|
-
|
|
36927
|
-
|
|
36928
|
-
|
|
36929
|
-
}
|
|
36930
|
-
|
|
36931
|
-
if (!fieldToUse.path) {
|
|
36932
|
-
fieldToUse = __spreadProps(__spreadValues({}, fieldToUse), {
|
|
36933
|
-
filterDisabled: true,
|
|
36934
|
-
sortDisabled: true,
|
|
36935
|
-
path: "fake-path" + i
|
|
36936
|
-
});
|
|
36978
|
+
} else {
|
|
36979
|
+
const fieldToUse = __spreadValues({}, field);
|
|
36980
|
+
fieldToUse.type = fieldToUse.type || "string";
|
|
36981
|
+
fieldToUse.displayName = fieldToUse.displayName || startCase(camelCase(fieldToUse.path || ""));
|
|
36982
|
+
if (!fieldToUse.path) {
|
|
36983
|
+
fieldToUse.filterDisabled = true;
|
|
36984
|
+
fieldToUse.sortDisabled = true;
|
|
36985
|
+
fieldToUse.path = "fake-path" + i;
|
|
36986
|
+
}
|
|
36987
|
+
return fieldToUse;
|
|
36937
36988
|
}
|
|
36938
|
-
return fieldToUse;
|
|
36939
36989
|
});
|
|
36940
36990
|
return schemaToUse;
|
|
36941
|
-
}
|
|
36942
|
-
__name(convertSchema, "convertSchema");
|
|
36991
|
+
}, "convertSchema");
|
|
36943
36992
|
const TableFormTrackerContext = React.createContext({
|
|
36944
36993
|
formNames: [],
|
|
36945
36994
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
@@ -50502,42 +50551,42 @@ function getFilterMenuItems(dataType) {
|
|
|
50502
50551
|
let filterMenuItems2 = [];
|
|
50503
50552
|
if (dataType === "string") {
|
|
50504
50553
|
filterMenuItems2 = [
|
|
50505
|
-
"
|
|
50506
|
-
"
|
|
50507
|
-
"
|
|
50508
|
-
"
|
|
50509
|
-
"
|
|
50510
|
-
"
|
|
50511
|
-
"
|
|
50512
|
-
"
|
|
50513
|
-
"
|
|
50514
|
-
"
|
|
50554
|
+
"contains",
|
|
50555
|
+
"notContains",
|
|
50556
|
+
"startsWith",
|
|
50557
|
+
"endsWith",
|
|
50558
|
+
"isExactly",
|
|
50559
|
+
"regex",
|
|
50560
|
+
"inList",
|
|
50561
|
+
"notInList",
|
|
50562
|
+
"isEmpty",
|
|
50563
|
+
"notEmpty"
|
|
50515
50564
|
];
|
|
50516
50565
|
} else if (dataType === "lookup") {
|
|
50517
50566
|
filterMenuItems2 = [
|
|
50518
|
-
"
|
|
50519
|
-
"
|
|
50520
|
-
"
|
|
50521
|
-
"
|
|
50522
|
-
"
|
|
50523
|
-
"
|
|
50567
|
+
"contains",
|
|
50568
|
+
"notContains",
|
|
50569
|
+
"startsWith",
|
|
50570
|
+
"endsWith",
|
|
50571
|
+
"isExactly",
|
|
50572
|
+
"regex"
|
|
50524
50573
|
];
|
|
50525
50574
|
} else if (dataType === "boolean") {
|
|
50526
|
-
filterMenuItems2 = ["
|
|
50575
|
+
filterMenuItems2 = ["true", "false"];
|
|
50527
50576
|
} else if (dataType === "number" || dataType === "integer") {
|
|
50528
50577
|
filterMenuItems2 = [
|
|
50529
|
-
"
|
|
50530
|
-
"
|
|
50531
|
-
"
|
|
50532
|
-
"
|
|
50533
|
-
"
|
|
50534
|
-
"
|
|
50535
|
-
"
|
|
50578
|
+
"greaterThan",
|
|
50579
|
+
"lessThan",
|
|
50580
|
+
"inRange",
|
|
50581
|
+
"outsideRange",
|
|
50582
|
+
"equalTo",
|
|
50583
|
+
"inList",
|
|
50584
|
+
"notInList"
|
|
50536
50585
|
];
|
|
50537
50586
|
} else if (dataType === "timestamp") {
|
|
50538
|
-
filterMenuItems2 = ["
|
|
50587
|
+
filterMenuItems2 = ["isBetween", "notBetween", "isBefore", "isAfter"];
|
|
50539
50588
|
}
|
|
50540
|
-
return filterMenuItems2;
|
|
50589
|
+
return filterMenuItems2.map((item) => startCase(item));
|
|
50541
50590
|
}
|
|
50542
50591
|
__name(getFilterMenuItems, "getFilterMenuItems");
|
|
50543
50592
|
const ColumnFilterMenu = /* @__PURE__ */ __name(({
|
|
@@ -51038,7 +51087,7 @@ const RenderColumnHeader = /* @__PURE__ */ __name(({
|
|
|
51038
51087
|
if (order2 && order2.length) {
|
|
51039
51088
|
order2.forEach((order22) => {
|
|
51040
51089
|
const orderField = order22.replace("-", "");
|
|
51041
|
-
if (orderField ===
|
|
51090
|
+
if (orderField === path2) {
|
|
51042
51091
|
if (orderField === order22) {
|
|
51043
51092
|
ordering = "asc";
|
|
51044
51093
|
} else {
|
|
@@ -55974,6 +56023,7 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
55974
56023
|
);
|
|
55975
56024
|
const tableRef = React.useRef();
|
|
55976
56025
|
const alreadySelected = React.useRef(false);
|
|
56026
|
+
const [noVirtual, setNoVirtual] = React.useState(false);
|
|
55977
56027
|
const [onlyShowRowsWErrors, setOnlyShowRowsWErrors] = React.useState(false);
|
|
55978
56028
|
const [entitiesUndoRedoStack, setEntitiesUndoRedoStack] = React.useState({
|
|
55979
56029
|
currentVersion: 0
|
|
@@ -56125,8 +56175,6 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
56125
56175
|
props = __spreadValues(__spreadValues({}, props), tableParams);
|
|
56126
56176
|
const queryParams = React.useMemo(() => {
|
|
56127
56177
|
if (!isTableParamsConnected) {
|
|
56128
|
-
const additionalFilterToUse = typeof props.additionalFilter === "function" ? props.additionalFilter : () => props.additionalFilter;
|
|
56129
|
-
const additionalOrFilterToUse = typeof props.additionalOrFilter === "function" ? props.additionalOrFilter : () => props.additionalOrFilter;
|
|
56130
56178
|
return getQueryParams({
|
|
56131
56179
|
doNotCoercePageSize,
|
|
56132
56180
|
currentParams,
|
|
@@ -56137,8 +56185,7 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
56137
56185
|
schema: convertedSchema,
|
|
56138
56186
|
isInfinite,
|
|
56139
56187
|
isLocalCall,
|
|
56140
|
-
additionalFilter:
|
|
56141
|
-
additionalOrFilter: additionalOrFilterToUse,
|
|
56188
|
+
additionalFilter: props.additionalFilter,
|
|
56142
56189
|
noOrderError: props.noOrderError,
|
|
56143
56190
|
isCodeModel: props.isCodeModel,
|
|
56144
56191
|
ownProps: props
|
|
@@ -56361,7 +56408,7 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
56361
56408
|
}) : !val2;
|
|
56362
56409
|
});
|
|
56363
56410
|
}
|
|
56364
|
-
if (noValsForField) {
|
|
56411
|
+
if (noValsForField && entities.length) {
|
|
56365
56412
|
return __spreadProps(__spreadValues({}, field), {
|
|
56366
56413
|
isHidden: true,
|
|
56367
56414
|
isForcedHidden: true
|
|
@@ -56818,76 +56865,94 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
56818
56865
|
updateEntitiesHelper,
|
|
56819
56866
|
updateValidation
|
|
56820
56867
|
]);
|
|
56821
|
-
const
|
|
56822
|
-
(
|
|
56823
|
-
|
|
56824
|
-
|
|
56825
|
-
|
|
56826
|
-
|
|
56827
|
-
|
|
56828
|
-
|
|
56829
|
-
Object.keys(selectedCells).forEach((key) => {
|
|
56830
|
-
const [rowId, path2] = key.split(":");
|
|
56831
|
-
const eInfo = entityIdToEntity[rowId];
|
|
56832
|
-
if (eInfo) {
|
|
56833
|
-
if (firstRowIndex === void 0 || eInfo.i < firstRowIndex) {
|
|
56834
|
-
firstRowIndex = eInfo.i;
|
|
56835
|
-
}
|
|
56836
|
-
if (!selectionGrid[eInfo.i]) {
|
|
56837
|
-
selectionGrid[eInfo.i] = [];
|
|
56838
|
-
}
|
|
56839
|
-
const cellIndex = pathToIndex[path2];
|
|
56840
|
-
if (firstCellIndex === void 0 || cellIndex < firstCellIndex) {
|
|
56841
|
-
firstCellIndex = cellIndex;
|
|
56842
|
-
}
|
|
56843
|
-
selectionGrid[eInfo.i][cellIndex] = true;
|
|
56844
|
-
}
|
|
56845
|
-
});
|
|
56846
|
-
if (firstRowIndex === void 0) return;
|
|
56847
|
-
const allRows = getAllRows(e);
|
|
56848
|
-
let fullCellText = "";
|
|
56849
|
-
const fullJson = [];
|
|
56850
|
-
times(selectionGrid.length, (i) => {
|
|
56851
|
-
const row = selectionGrid[i];
|
|
56852
|
-
if (fullCellText) {
|
|
56853
|
-
fullCellText += "\n";
|
|
56868
|
+
const waitUntilAllRowsAreRendered = React.useCallback(() => {
|
|
56869
|
+
return new Promise((resolve) => {
|
|
56870
|
+
const interval = setInterval(() => {
|
|
56871
|
+
var _a3, _b2;
|
|
56872
|
+
const allRowEls = (_b2 = (_a3 = tableRef.current) == null ? void 0 : _a3.tableRef) == null ? void 0 : _b2.querySelectorAll(".rt-tr-group");
|
|
56873
|
+
if ((allRowEls == null ? void 0 : allRowEls.length) === entities.length) {
|
|
56874
|
+
clearInterval(interval);
|
|
56875
|
+
resolve();
|
|
56854
56876
|
}
|
|
56855
|
-
|
|
56856
|
-
|
|
56857
|
-
|
|
56858
|
-
|
|
56859
|
-
|
|
56860
|
-
|
|
56861
|
-
|
|
56862
|
-
|
|
56863
|
-
|
|
56864
|
-
|
|
56865
|
-
|
|
56866
|
-
|
|
56867
|
-
|
|
56868
|
-
|
|
56869
|
-
|
|
56870
|
-
|
|
56877
|
+
}, 50);
|
|
56878
|
+
});
|
|
56879
|
+
}, []);
|
|
56880
|
+
const handleCopySelectedCells = React.useCallback(() => __async(exports, null, function* () {
|
|
56881
|
+
if (isEmpty$1(selectedCells)) return;
|
|
56882
|
+
if (entities.length > VIRTUALIZE_CUTOFF_LENGTH) {
|
|
56883
|
+
setNoVirtual(true);
|
|
56884
|
+
yield waitUntilAllRowsAreRendered();
|
|
56885
|
+
}
|
|
56886
|
+
const pathToIndex = getFieldPathToIndex(schema2);
|
|
56887
|
+
const entityIdToEntity = getEntityIdToEntity(entities);
|
|
56888
|
+
const selectionGrid = [];
|
|
56889
|
+
let firstRowIndex;
|
|
56890
|
+
let firstCellIndex;
|
|
56891
|
+
Object.keys(selectedCells).forEach((key) => {
|
|
56892
|
+
const [rowId, path2] = key.split(":");
|
|
56893
|
+
const eInfo = entityIdToEntity[rowId];
|
|
56894
|
+
if (eInfo) {
|
|
56895
|
+
if (firstRowIndex === void 0 || eInfo.i < firstRowIndex) {
|
|
56896
|
+
firstRowIndex = eInfo.i;
|
|
56897
|
+
}
|
|
56898
|
+
if (!selectionGrid[eInfo.i]) {
|
|
56899
|
+
selectionGrid[eInfo.i] = [];
|
|
56900
|
+
}
|
|
56901
|
+
const cellIndex = pathToIndex[path2];
|
|
56902
|
+
if (firstCellIndex === void 0 || cellIndex < firstCellIndex) {
|
|
56903
|
+
firstCellIndex = cellIndex;
|
|
56871
56904
|
}
|
|
56872
|
-
|
|
56873
|
-
|
|
56874
|
-
|
|
56875
|
-
|
|
56876
|
-
|
|
56877
|
-
|
|
56905
|
+
selectionGrid[eInfo.i][cellIndex] = true;
|
|
56906
|
+
}
|
|
56907
|
+
});
|
|
56908
|
+
if (firstRowIndex === void 0) return;
|
|
56909
|
+
const allRows = getAllRows(tableRef);
|
|
56910
|
+
let fullCellText = "";
|
|
56911
|
+
const fullJson = [];
|
|
56912
|
+
times(selectionGrid.length, (i) => {
|
|
56913
|
+
const row = selectionGrid[i];
|
|
56914
|
+
if (fullCellText) {
|
|
56915
|
+
fullCellText += "\n";
|
|
56916
|
+
}
|
|
56917
|
+
if (!row) {
|
|
56918
|
+
return;
|
|
56919
|
+
} else {
|
|
56920
|
+
const jsonRow = [];
|
|
56921
|
+
let [rowCopyText, json] = getRowCopyText(allRows[i + 1]);
|
|
56922
|
+
rowCopyText = rowCopyText.split(" ");
|
|
56923
|
+
times(row.length, (i2) => {
|
|
56924
|
+
const cell = row[i2];
|
|
56925
|
+
if (cell) {
|
|
56926
|
+
fullCellText += rowCopyText[i2];
|
|
56927
|
+
jsonRow.push(json[i2]);
|
|
56928
|
+
}
|
|
56929
|
+
if (i2 !== row.length - 1 && i2 >= firstCellIndex) fullCellText += " ";
|
|
56930
|
+
});
|
|
56931
|
+
fullJson.push(jsonRow);
|
|
56932
|
+
}
|
|
56933
|
+
});
|
|
56934
|
+
if (!fullCellText) return window.toastr.warning("No text to copy");
|
|
56935
|
+
handleCopyHelper(fullCellText, fullJson, "Selected cells copied");
|
|
56936
|
+
setNoVirtual(false);
|
|
56937
|
+
}), [entities, selectedCells, schema2, waitUntilAllRowsAreRendered]);
|
|
56878
56938
|
const handleCopySelectedRows = React.useCallback(
|
|
56879
|
-
(selectedRecords,
|
|
56880
|
-
|
|
56881
|
-
|
|
56939
|
+
(selectedRecords) => __async(exports, null, function* () {
|
|
56940
|
+
if (entities.length > VIRTUALIZE_CUTOFF_LENGTH) {
|
|
56941
|
+
setNoVirtual(true);
|
|
56942
|
+
yield waitUntilAllRowsAreRendered();
|
|
56943
|
+
}
|
|
56944
|
+
const idToIndex = entities.reduce((acc, e, i) => {
|
|
56945
|
+
acc[e.id || e.code] = i;
|
|
56882
56946
|
return acc;
|
|
56883
56947
|
}, {});
|
|
56884
56948
|
const rowNumbersToCopy = selectedRecords.map((rec) => idToIndex[rec.id || rec.code] + 1).sort();
|
|
56885
56949
|
if (!rowNumbersToCopy.length) return;
|
|
56886
56950
|
rowNumbersToCopy.unshift(0);
|
|
56887
56951
|
try {
|
|
56888
|
-
const allRowEls = getAllRows(
|
|
56952
|
+
const allRowEls = getAllRows(tableRef);
|
|
56889
56953
|
if (!allRowEls) return;
|
|
56890
56954
|
const rowEls = rowNumbersToCopy.map((i) => allRowEls[i]);
|
|
56955
|
+
if (window.Cypress) window.Cypress.__copiedRowsLength = rowEls.length;
|
|
56891
56956
|
handleCopyRows(rowEls, {
|
|
56892
56957
|
onFinishMsg: "Selected rows copied"
|
|
56893
56958
|
});
|
|
@@ -56895,8 +56960,9 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
56895
56960
|
console.error(`error:`, error);
|
|
56896
56961
|
window.toastr.error("Error copying rows.");
|
|
56897
56962
|
}
|
|
56898
|
-
|
|
56899
|
-
|
|
56963
|
+
setNoVirtual(false);
|
|
56964
|
+
}),
|
|
56965
|
+
[entities, waitUntilAllRowsAreRendered]
|
|
56900
56966
|
);
|
|
56901
56967
|
const handleCopyHotkey = React.useCallback(
|
|
56902
56968
|
(e) => {
|
|
@@ -57663,7 +57729,7 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
57663
57729
|
{
|
|
57664
57730
|
key: "copyColumn",
|
|
57665
57731
|
onClick: /* @__PURE__ */ __name(() => {
|
|
57666
|
-
handleCopyColumn(
|
|
57732
|
+
handleCopyColumn(tableRef, cellWrapper);
|
|
57667
57733
|
}, "onClick"),
|
|
57668
57734
|
text: "Column"
|
|
57669
57735
|
}
|
|
@@ -57676,7 +57742,7 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
57676
57742
|
{
|
|
57677
57743
|
key: "copyColumnSelected",
|
|
57678
57744
|
onClick: /* @__PURE__ */ __name(() => {
|
|
57679
|
-
handleCopyColumn(
|
|
57745
|
+
handleCopyColumn(tableRef, cellWrapper, selectedRecords);
|
|
57680
57746
|
}, "onClick"),
|
|
57681
57747
|
text: "Column (Selected)"
|
|
57682
57748
|
}
|
|
@@ -57719,7 +57785,7 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
57719
57785
|
{
|
|
57720
57786
|
key: "copyFullTableRows",
|
|
57721
57787
|
onClick: /* @__PURE__ */ __name(() => {
|
|
57722
|
-
handleCopyTable(
|
|
57788
|
+
handleCopyTable(tableRef);
|
|
57723
57789
|
}, "onClick"),
|
|
57724
57790
|
text: "Table"
|
|
57725
57791
|
}
|
|
@@ -58256,6 +58322,7 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
58256
58322
|
__spreadValues({
|
|
58257
58323
|
data: filteredEnts,
|
|
58258
58324
|
ref: tableRef,
|
|
58325
|
+
noVirtual,
|
|
58259
58326
|
className: classNames({
|
|
58260
58327
|
isCellEditable,
|
|
58261
58328
|
"tg-table-loading": isLoading,
|
|
@@ -58323,7 +58390,8 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
58323
58390
|
resizePersist,
|
|
58324
58391
|
resized,
|
|
58325
58392
|
rowsToShow,
|
|
58326
|
-
style2
|
|
58393
|
+
style2,
|
|
58394
|
+
noVirtual
|
|
58327
58395
|
]
|
|
58328
58396
|
);
|
|
58329
58397
|
return /* @__PURE__ */ React.createElement("div", { tabIndex: "1", onKeyDown: handleKeyDown, onKeyUp: handleKeyUp }, /* @__PURE__ */ React.createElement(
|
|
@@ -58526,7 +58594,7 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
58526
58594
|
try {
|
|
58527
58595
|
const allEntities = yield safeQuery(fragment, {
|
|
58528
58596
|
variables: {
|
|
58529
|
-
|
|
58597
|
+
where: variables.where,
|
|
58530
58598
|
sort: variables.sort
|
|
58531
58599
|
},
|
|
58532
58600
|
canCancel: true
|
|
@@ -58606,8 +58674,8 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
58606
58674
|
), /* @__PURE__ */ React.createElement(
|
|
58607
58675
|
core.Button,
|
|
58608
58676
|
{
|
|
58609
|
-
onClick: /* @__PURE__ */ __name((
|
|
58610
|
-
handleCopyTable(
|
|
58677
|
+
onClick: /* @__PURE__ */ __name(() => {
|
|
58678
|
+
handleCopyTable(tableRef, { isDownload: true });
|
|
58611
58679
|
}, "onClick"),
|
|
58612
58680
|
"data-tip": "Download Table as CSV",
|
|
58613
58681
|
minimal: true,
|
|
@@ -68891,6 +68959,7 @@ function parseCsvOrExcelFile(_0) {
|
|
|
68891
68959
|
}
|
|
68892
68960
|
__name(parseCsvOrExcelFile, "parseCsvOrExcelFile");
|
|
68893
68961
|
const filterFilesInZip = /* @__PURE__ */ __name((file, accepted) => __async(exports, null, function* () {
|
|
68962
|
+
var _a2, _b2, _c, _d;
|
|
68894
68963
|
if (!file || Array.isArray(file) && !file.length) return [];
|
|
68895
68964
|
const zipExtracted = yield extractZipFiles(file);
|
|
68896
68965
|
const acceptedFiles = [];
|
|
@@ -68900,9 +68969,12 @@ const filterFilesInZip = /* @__PURE__ */ __name((file, accepted) => __async(expo
|
|
|
68900
68969
|
}
|
|
68901
68970
|
}
|
|
68902
68971
|
if (acceptedFiles.length && acceptedFiles.length < zipExtracted.length)
|
|
68903
|
-
window.toastr.warning
|
|
68972
|
+
(_b2 = (_a2 = window == null ? void 0 : window.toastr) == null ? void 0 : _a2.warning) == null ? void 0 : _b2.call(
|
|
68973
|
+
_a2,
|
|
68974
|
+
"Some files don't have the proper file extension."
|
|
68975
|
+
);
|
|
68904
68976
|
if (!acceptedFiles.length)
|
|
68905
|
-
window.toastr.warning("No files with the proper extension were found.");
|
|
68977
|
+
(_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.");
|
|
68906
68978
|
return acceptedFiles;
|
|
68907
68979
|
}), "filterFilesInZip");
|
|
68908
68980
|
function removeExt(filename) {
|
|
@@ -70883,8 +70955,12 @@ const Uploader = /* @__PURE__ */ __name(({
|
|
|
70883
70955
|
onClick: /* @__PURE__ */ __name((evt) => evt.preventDefault(), "onClick"),
|
|
70884
70956
|
multiple: fileLimit !== 1,
|
|
70885
70957
|
accept: simpleAccept ? simpleAccept.split(", ").map((acc) => acc.startsWith(".") ? acc : "." + acc).join(", ") : void 0,
|
|
70886
|
-
onDrop: /* @__PURE__ */ __name((_acceptedFiles, rejectedFiles) => __async(exports, null, function* () {
|
|
70958
|
+
onDrop: /* @__PURE__ */ __name((_acceptedFiles, rejectedFiles, e) => __async(exports, null, function* () {
|
|
70887
70959
|
var _a3, _b3;
|
|
70960
|
+
const parentDropzone = e.target.closest(".tg-dropzone");
|
|
70961
|
+
if (parentDropzone) {
|
|
70962
|
+
parentDropzone.blur();
|
|
70963
|
+
}
|
|
70888
70964
|
let acceptedFiles = [];
|
|
70889
70965
|
for (const file of _acceptedFiles) {
|
|
70890
70966
|
if ((validateAgainstSchema || autoUnzip) && isZipFile(file)) {
|
|
@@ -76946,6 +77022,7 @@ const updateAmbiguousOrLiteral = createMetaAction(
|
|
|
76946
77022
|
"updateAmbiguousOrLiteral"
|
|
76947
77023
|
);
|
|
76948
77024
|
const updateDnaOrAA = createMetaAction("updateDnaOrAA");
|
|
77025
|
+
const updateMismatchesAllowed = createMetaAction("updateMismatchesAllowed");
|
|
76949
77026
|
const updateMatchNumber = createMetaAction("updateMatchNumber");
|
|
76950
77027
|
const findTool = createMergedDefaultStateReducer(
|
|
76951
77028
|
{
|
|
@@ -76977,6 +77054,12 @@ const findTool = createMergedDefaultStateReducer(
|
|
|
76977
77054
|
dnaOrAA: payload
|
|
76978
77055
|
});
|
|
76979
77056
|
},
|
|
77057
|
+
[updateMismatchesAllowed]: (state2, payload) => {
|
|
77058
|
+
return __spreadProps(__spreadValues({}, state2), {
|
|
77059
|
+
matchNumber: 0,
|
|
77060
|
+
mismatchesAllowed: payload
|
|
77061
|
+
});
|
|
77062
|
+
},
|
|
76980
77063
|
[updateSearchText]: (state2, payload) => {
|
|
76981
77064
|
return __spreadProps(__spreadValues({}, state2), {
|
|
76982
77065
|
matchNumber: 0,
|
|
@@ -76996,6 +77079,7 @@ const findTool = createMergedDefaultStateReducer(
|
|
|
76996
77079
|
dnaOrAA: "DNA",
|
|
76997
77080
|
ambiguousOrLiteral: "LITERAL",
|
|
76998
77081
|
highlightAll: false,
|
|
77082
|
+
mismatchesAllowed: 0,
|
|
76999
77083
|
matchNumber: 0
|
|
77000
77084
|
}
|
|
77001
77085
|
);
|
|
@@ -77008,6 +77092,7 @@ const findTool$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
|
|
|
77008
77092
|
updateAmbiguousOrLiteral,
|
|
77009
77093
|
updateDnaOrAA,
|
|
77010
77094
|
updateMatchNumber,
|
|
77095
|
+
updateMismatchesAllowed,
|
|
77011
77096
|
updateSearchText
|
|
77012
77097
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
77013
77098
|
const openToolbarItemUpdate = createMetaAction("openToolbarItemUpdate");
|
|
@@ -77445,30 +77530,31 @@ function adjustRangeToDeletionOfAnotherRange(rangeToBeAdjusted, anotherRange, ma
|
|
|
77445
77530
|
anotherRange,
|
|
77446
77531
|
maxLength
|
|
77447
77532
|
);
|
|
77448
|
-
if (trimmedRange) {
|
|
77449
|
-
|
|
77450
|
-
anotherRange,
|
|
77451
|
-
maxLength
|
|
77452
|
-
);
|
|
77453
|
-
nonCircularDeletionRanges.forEach(function(nonCircularDeletionRange) {
|
|
77454
|
-
const deletionLength = nonCircularDeletionRange.end - nonCircularDeletionRange.start + 1;
|
|
77455
|
-
if (trimmedRange.start > trimmedRange.end) {
|
|
77456
|
-
if (nonCircularDeletionRange.start < trimmedRange.end) {
|
|
77457
|
-
trimmedRange.start -= deletionLength;
|
|
77458
|
-
trimmedRange.end -= deletionLength;
|
|
77459
|
-
} else if (nonCircularDeletionRange.start < trimmedRange.start) {
|
|
77460
|
-
trimmedRange.start -= deletionLength;
|
|
77461
|
-
} else ;
|
|
77462
|
-
} else {
|
|
77463
|
-
if (nonCircularDeletionRange.start < trimmedRange.start) {
|
|
77464
|
-
trimmedRange.start -= deletionLength;
|
|
77465
|
-
trimmedRange.end -= deletionLength;
|
|
77466
|
-
} else if (nonCircularDeletionRange.start < trimmedRange.end) {
|
|
77467
|
-
trimmedRange.end -= deletionLength;
|
|
77468
|
-
} else ;
|
|
77469
|
-
}
|
|
77470
|
-
});
|
|
77533
|
+
if (!trimmedRange) {
|
|
77534
|
+
return null;
|
|
77471
77535
|
}
|
|
77536
|
+
const nonCircularDeletionRanges = splitRangeIntoTwoPartsIfItIsCircular(
|
|
77537
|
+
anotherRange,
|
|
77538
|
+
maxLength
|
|
77539
|
+
);
|
|
77540
|
+
nonCircularDeletionRanges.forEach(function(nonCircularDeletionRange) {
|
|
77541
|
+
const deletionLength = nonCircularDeletionRange.end - nonCircularDeletionRange.start + 1;
|
|
77542
|
+
if (trimmedRange.start > trimmedRange.end) {
|
|
77543
|
+
if (nonCircularDeletionRange.start < trimmedRange.end) {
|
|
77544
|
+
trimmedRange.start -= deletionLength;
|
|
77545
|
+
trimmedRange.end -= deletionLength;
|
|
77546
|
+
} else if (nonCircularDeletionRange.start < trimmedRange.start) {
|
|
77547
|
+
trimmedRange.start -= deletionLength;
|
|
77548
|
+
} else ;
|
|
77549
|
+
} else {
|
|
77550
|
+
if (nonCircularDeletionRange.start < trimmedRange.start) {
|
|
77551
|
+
trimmedRange.start -= deletionLength;
|
|
77552
|
+
trimmedRange.end -= deletionLength;
|
|
77553
|
+
} else if (nonCircularDeletionRange.start < trimmedRange.end) {
|
|
77554
|
+
trimmedRange.end -= deletionLength;
|
|
77555
|
+
} else ;
|
|
77556
|
+
}
|
|
77557
|
+
});
|
|
77472
77558
|
return trimmedRange;
|
|
77473
77559
|
}
|
|
77474
77560
|
__name(adjustRangeToDeletionOfAnotherRange, "adjustRangeToDeletionOfAnotherRange");
|
|
@@ -83842,6 +83928,36 @@ function addSizeIdName(frag, sequenceLength) {
|
|
|
83842
83928
|
});
|
|
83843
83929
|
}
|
|
83844
83930
|
__name(addSizeIdName, "addSizeIdName");
|
|
83931
|
+
function findApproxMatches(searchSeq, targetSeq, maxMismatches, circular2 = false) {
|
|
83932
|
+
const matches = [];
|
|
83933
|
+
const lenA = searchSeq.length;
|
|
83934
|
+
const lenB = targetSeq.length;
|
|
83935
|
+
const targetSeqExtended = circular2 ? targetSeq + targetSeq.slice(0, lenA - 1) : targetSeq;
|
|
83936
|
+
const limit = circular2 ? lenB : lenB - lenA + 1;
|
|
83937
|
+
for (let i = 0; i < limit; i++) {
|
|
83938
|
+
const window2 = targetSeqExtended.slice(i, i + lenA);
|
|
83939
|
+
let mismatchCount = 0;
|
|
83940
|
+
const mismatchPositions = [];
|
|
83941
|
+
for (let j2 = 0; j2 < lenA; j2++) {
|
|
83942
|
+
if (searchSeq[j2] !== window2[j2]) {
|
|
83943
|
+
mismatchPositions.push(j2);
|
|
83944
|
+
mismatchCount++;
|
|
83945
|
+
if (mismatchCount > maxMismatches) break;
|
|
83946
|
+
}
|
|
83947
|
+
}
|
|
83948
|
+
if (mismatchCount <= maxMismatches) {
|
|
83949
|
+
matches.push({
|
|
83950
|
+
index: i,
|
|
83951
|
+
match: window2,
|
|
83952
|
+
mismatchPositions,
|
|
83953
|
+
numMismatches: mismatchPositions.length
|
|
83954
|
+
// Keep for backwards compatibility
|
|
83955
|
+
});
|
|
83956
|
+
}
|
|
83957
|
+
}
|
|
83958
|
+
return matches;
|
|
83959
|
+
}
|
|
83960
|
+
__name(findApproxMatches, "findApproxMatches");
|
|
83845
83961
|
var spliceString$1;
|
|
83846
83962
|
var hasRequiredSpliceString;
|
|
83847
83963
|
function requireSpliceString() {
|
|
@@ -92927,11 +93043,11 @@ function requireLib$3() {
|
|
|
92927
93043
|
if (hasRequiredLib$3) return lib$3;
|
|
92928
93044
|
hasRequiredLib$3 = 1;
|
|
92929
93045
|
var isNumber2 = requireLib$4();
|
|
92930
|
-
function
|
|
93046
|
+
function isInteger(value) {
|
|
92931
93047
|
return isNumber2(value) && value % 1 === 0;
|
|
92932
93048
|
}
|
|
92933
|
-
__name(
|
|
92934
|
-
lib$3 =
|
|
93049
|
+
__name(isInteger, "isInteger");
|
|
93050
|
+
lib$3 = isInteger;
|
|
92935
93051
|
return lib$3;
|
|
92936
93052
|
}
|
|
92937
93053
|
__name(requireLib$3, "requireLib$3");
|
|
@@ -92940,9 +93056,9 @@ var hasRequiredLib$2;
|
|
|
92940
93056
|
function requireLib$2() {
|
|
92941
93057
|
if (hasRequiredLib$2) return lib$2;
|
|
92942
93058
|
hasRequiredLib$2 = 1;
|
|
92943
|
-
var
|
|
93059
|
+
var isInteger = requireLib$3();
|
|
92944
93060
|
function isNonNegativeInteger(value) {
|
|
92945
|
-
return
|
|
93061
|
+
return isInteger(value) && value >= 0;
|
|
92946
93062
|
}
|
|
92947
93063
|
__name(isNonNegativeInteger, "isNonNegativeInteger");
|
|
92948
93064
|
lib$2 = isNonNegativeInteger;
|
|
@@ -96192,7 +96308,7 @@ var bufferpackExports = requireBufferpack();
|
|
|
96192
96308
|
const bufferpack = /* @__PURE__ */ getDefaultExportFromCjs(bufferpackExports);
|
|
96193
96309
|
var string_decoder = {};
|
|
96194
96310
|
var safeBuffer = { exports: {} };
|
|
96195
|
-
var buffer$
|
|
96311
|
+
var buffer$1 = {};
|
|
96196
96312
|
var base64Js = {};
|
|
96197
96313
|
var hasRequiredBase64Js;
|
|
96198
96314
|
function requireBase64Js() {
|
|
@@ -96394,7 +96510,7 @@ __name(requireIeee754, "requireIeee754");
|
|
|
96394
96510
|
*/
|
|
96395
96511
|
var hasRequiredBuffer;
|
|
96396
96512
|
function requireBuffer() {
|
|
96397
|
-
if (hasRequiredBuffer) return buffer$
|
|
96513
|
+
if (hasRequiredBuffer) return buffer$1;
|
|
96398
96514
|
hasRequiredBuffer = 1;
|
|
96399
96515
|
(function(exports2) {
|
|
96400
96516
|
var base64 = requireBase64Js();
|
|
@@ -97806,8 +97922,8 @@ function requireBuffer() {
|
|
|
97806
97922
|
}
|
|
97807
97923
|
return table2;
|
|
97808
97924
|
}();
|
|
97809
|
-
})(buffer$
|
|
97810
|
-
return buffer$
|
|
97925
|
+
})(buffer$1);
|
|
97926
|
+
return buffer$1;
|
|
97811
97927
|
}
|
|
97812
97928
|
__name(requireBuffer, "requireBuffer");
|
|
97813
97929
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
@@ -98129,7 +98245,6 @@ function requireString_decoder() {
|
|
|
98129
98245
|
__name(requireString_decoder, "requireString_decoder");
|
|
98130
98246
|
var string_decoderExports = requireString_decoder();
|
|
98131
98247
|
var bufferExports = requireBuffer();
|
|
98132
|
-
const buffer$1 = /* @__PURE__ */ getDefaultExportFromCjs(bufferExports);
|
|
98133
98248
|
const isBrowser$3 = typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
98134
98249
|
function getArrayBufferFromFile(file) {
|
|
98135
98250
|
if (!isBrowser$3) {
|
|
@@ -98159,12 +98274,11 @@ function toArrayBuffer(buffer2) {
|
|
|
98159
98274
|
return ab;
|
|
98160
98275
|
}
|
|
98161
98276
|
__name(toArrayBuffer, "toArrayBuffer");
|
|
98162
|
-
const Buffer$1 = buffer$1.Buffer;
|
|
98163
98277
|
function snapgeneToJson(_0) {
|
|
98164
98278
|
return __async(this, arguments, function* (fileObj, options = {}) {
|
|
98165
98279
|
try {
|
|
98166
98280
|
let read2 = /* @__PURE__ */ __name(function(size, fmt) {
|
|
98167
|
-
const buffer2 = Buffer
|
|
98281
|
+
const buffer2 = bufferExports.Buffer.from(arrayBuffer.slice(offset4, size + offset4));
|
|
98168
98282
|
offset4 += size;
|
|
98169
98283
|
if (fmt) {
|
|
98170
98284
|
const decoder = new string_decoderExports.StringDecoder(fmt);
|
|
@@ -106262,7 +106376,7 @@ function translationsRawSelector(sequenceData2) {
|
|
|
106262
106376
|
}
|
|
106263
106377
|
__name(translationsRawSelector, "translationsRawSelector");
|
|
106264
106378
|
const translationsRawSelector$1 = createSelector(sequenceDataSelector, translationsRawSelector);
|
|
106265
|
-
function searchLayersSelector(sequence2, isCircular, isOpen, searchString, ambiguousOrLiteral, dnaOrAA, isProtein2, proteinSequence) {
|
|
106379
|
+
function searchLayersSelector(sequence2, isCircular, isOpen, searchString, ambiguousOrLiteral, dnaOrAA, isProtein2, proteinSequence, mismatchesAllowed) {
|
|
106266
106380
|
if (!searchString || !isOpen) {
|
|
106267
106381
|
return [];
|
|
106268
106382
|
}
|
|
@@ -106290,6 +106404,26 @@ function searchLayersSelector(sequence2, isCircular, isOpen, searchString, ambig
|
|
|
106290
106404
|
});
|
|
106291
106405
|
});
|
|
106292
106406
|
}
|
|
106407
|
+
if (dnaOrAA === "DNA" && ambiguousOrLiteral === "LITERAL" && mismatchesAllowed > 0) {
|
|
106408
|
+
const approxMatches = findApproxMatches(
|
|
106409
|
+
searchString,
|
|
106410
|
+
sequence2,
|
|
106411
|
+
mismatchesAllowed,
|
|
106412
|
+
isCircular
|
|
106413
|
+
);
|
|
106414
|
+
const matches2 = approxMatches.map((match) => ({
|
|
106415
|
+
start: match.index,
|
|
106416
|
+
end: match.index + match.match.length - 1,
|
|
106417
|
+
matchedString: match.match,
|
|
106418
|
+
mismatchPositions: match.mismatchPositions,
|
|
106419
|
+
numMismatches: match.numMismatches,
|
|
106420
|
+
isSearchLayer: true,
|
|
106421
|
+
forward: true
|
|
106422
|
+
})).sort((a2, b3) => a2.start - b3.start);
|
|
106423
|
+
return matches2.map((match) => __spreadProps(__spreadValues({}, match), {
|
|
106424
|
+
className: "veSearchLayer"
|
|
106425
|
+
}));
|
|
106426
|
+
}
|
|
106293
106427
|
const matches = findSequenceMatches(sequence2, searchString, {
|
|
106294
106428
|
isCircular,
|
|
106295
106429
|
isAmbiguous: ambiguousOrLiteral === "AMBIGUOUS",
|
|
@@ -106314,6 +106448,7 @@ const searchLayersSelector$1 = createSelector(
|
|
|
106314
106448
|
(state2) => state2.findTool && state2.findTool.dnaOrAA,
|
|
106315
106449
|
(state2) => state2.sequenceData.isProtein,
|
|
106316
106450
|
(state2) => state2.sequenceData.proteinSequence,
|
|
106451
|
+
(state2) => state2.findTool && state2.findTool.mismatchesAllowed,
|
|
106317
106452
|
searchLayersSelector
|
|
106318
106453
|
);
|
|
106319
106454
|
const translationSearchMatchesSelector = createSelector(
|
|
@@ -117318,26 +117453,49 @@ function SelectionLayer$2(props) {
|
|
|
117318
117453
|
)
|
|
117319
117454
|
];
|
|
117320
117455
|
}
|
|
117321
|
-
|
|
117322
|
-
|
|
117456
|
+
const selectionElement = /* @__PURE__ */ React.createElement(
|
|
117457
|
+
"div",
|
|
117458
|
+
{
|
|
117459
|
+
onClick: _onClick,
|
|
117460
|
+
title: selectionMessage,
|
|
117461
|
+
onContextMenu: onSelectionContextMenu,
|
|
117462
|
+
key,
|
|
117463
|
+
className: classNameToPass + " veSelectionLayer veRowViewSelectionLayer notCaret " + (isTrueStart ? " isTrueStart " : "") + (isTrueEnd ? " isTrueEnd " : ""),
|
|
117464
|
+
style: __spreadProps(__spreadValues({
|
|
117465
|
+
width,
|
|
117466
|
+
left: leftMargin + xStart
|
|
117467
|
+
}, style2), {
|
|
117468
|
+
background: color2 || topLevelColor,
|
|
117469
|
+
height
|
|
117470
|
+
})
|
|
117471
|
+
}
|
|
117472
|
+
);
|
|
117473
|
+
let mismatchElements = [];
|
|
117474
|
+
if (selectionLayer2.mismatchPositions && selectionLayer2.mismatchPositions.length > 0) {
|
|
117475
|
+
const relativeToOverlap = selectionLayer2.mismatchPositions.filter((pos) => {
|
|
117476
|
+
const absPos = pos + selectionLayer2.start;
|
|
117477
|
+
return absPos >= overlap.start && absPos <= overlap.end;
|
|
117478
|
+
}).map((pos) => {
|
|
117479
|
+
return pos - (overlap.start - selectionLayer2.start);
|
|
117480
|
+
});
|
|
117481
|
+
mismatchElements = relativeToOverlap.map((pos, i) => /* @__PURE__ */ React.createElement(
|
|
117323
117482
|
"div",
|
|
117324
117483
|
{
|
|
117325
|
-
|
|
117326
|
-
|
|
117327
|
-
|
|
117328
|
-
|
|
117329
|
-
|
|
117330
|
-
|
|
117331
|
-
|
|
117332
|
-
|
|
117333
|
-
|
|
117334
|
-
|
|
117335
|
-
|
|
117336
|
-
})
|
|
117484
|
+
key: `${key}-mismatch-${i}`,
|
|
117485
|
+
className: "veSelectionLayer veMismatchLayer notCaret",
|
|
117486
|
+
style: {
|
|
117487
|
+
width: charWidth2,
|
|
117488
|
+
left: leftMargin + xStart + pos * charWidth2,
|
|
117489
|
+
top: 0,
|
|
117490
|
+
height: height || "100%",
|
|
117491
|
+
background: "red",
|
|
117492
|
+
position: "absolute",
|
|
117493
|
+
opacity: 0.5
|
|
117494
|
+
}
|
|
117337
117495
|
}
|
|
117338
|
-
)
|
|
117339
|
-
|
|
117340
|
-
];
|
|
117496
|
+
));
|
|
117497
|
+
}
|
|
117498
|
+
return [selectionElement, ...mismatchElements, ...caretSvgs];
|
|
117341
117499
|
});
|
|
117342
117500
|
} else {
|
|
117343
117501
|
return null;
|
|
@@ -122210,7 +122368,7 @@ function showFileDialog({ multiple = false, onSelect }) {
|
|
|
122210
122368
|
input.click();
|
|
122211
122369
|
}
|
|
122212
122370
|
__name(showFileDialog, "showFileDialog");
|
|
122213
|
-
const version = "0.7.
|
|
122371
|
+
const version = "0.7.29";
|
|
122214
122372
|
const packageJson = {
|
|
122215
122373
|
version
|
|
122216
122374
|
};
|
|
@@ -135668,10 +135826,10 @@ function requireLodash() {
|
|
|
135668
135826
|
return value > other;
|
|
135669
135827
|
}
|
|
135670
135828
|
__name(baseGt2, "baseGt");
|
|
135671
|
-
function
|
|
135829
|
+
function baseHas2(object3, key) {
|
|
135672
135830
|
return object3 != null && hasOwnProperty2.call(object3, key);
|
|
135673
135831
|
}
|
|
135674
|
-
__name(
|
|
135832
|
+
__name(baseHas2, "baseHas");
|
|
135675
135833
|
function baseHasIn2(object3, key) {
|
|
135676
135834
|
return object3 != null && key in Object2(object3);
|
|
135677
135835
|
}
|
|
@@ -138689,10 +138847,10 @@ function requireLodash() {
|
|
|
138689
138847
|
return tag == funcTag2 || tag == genTag2 || tag == asyncTag2 || tag == proxyTag2;
|
|
138690
138848
|
}
|
|
138691
138849
|
__name(isFunction2, "isFunction");
|
|
138692
|
-
function
|
|
138850
|
+
function isInteger(value) {
|
|
138693
138851
|
return typeof value == "number" && value == toInteger2(value);
|
|
138694
138852
|
}
|
|
138695
|
-
__name(
|
|
138853
|
+
__name(isInteger, "isInteger");
|
|
138696
138854
|
function isLength2(value) {
|
|
138697
138855
|
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER2;
|
|
138698
138856
|
}
|
|
@@ -138727,10 +138885,10 @@ function requireLodash() {
|
|
|
138727
138885
|
return baseIsNative2(value);
|
|
138728
138886
|
}
|
|
138729
138887
|
__name(isNative2, "isNative");
|
|
138730
|
-
function
|
|
138888
|
+
function isNull2(value) {
|
|
138731
138889
|
return value === null;
|
|
138732
138890
|
}
|
|
138733
|
-
__name(
|
|
138891
|
+
__name(isNull2, "isNull");
|
|
138734
138892
|
function isNil(value) {
|
|
138735
138893
|
return value == null;
|
|
138736
138894
|
}
|
|
@@ -138753,7 +138911,7 @@ function requireLodash() {
|
|
|
138753
138911
|
__name(isPlainObject2, "isPlainObject");
|
|
138754
138912
|
var isRegExp = nodeIsRegExp ? baseUnary2(nodeIsRegExp) : baseIsRegExp;
|
|
138755
138913
|
function isSafeInteger(value) {
|
|
138756
|
-
return
|
|
138914
|
+
return isInteger(value) && value >= -9007199254740991 && value <= MAX_SAFE_INTEGER2;
|
|
138757
138915
|
}
|
|
138758
138916
|
__name(isSafeInteger, "isSafeInteger");
|
|
138759
138917
|
var isSet2 = nodeIsSet2 ? baseUnary2(nodeIsSet2) : baseIsSet2;
|
|
@@ -138939,7 +139097,7 @@ function requireLodash() {
|
|
|
138939
139097
|
}
|
|
138940
139098
|
__name(get7, "get");
|
|
138941
139099
|
function has4(object3, path2) {
|
|
138942
|
-
return object3 != null && hasPath2(object3, path2,
|
|
139100
|
+
return object3 != null && hasPath2(object3, path2, baseHas2);
|
|
138943
139101
|
}
|
|
138944
139102
|
__name(has4, "has");
|
|
138945
139103
|
function hasIn2(object3, path2) {
|
|
@@ -139890,7 +140048,7 @@ function requireLodash() {
|
|
|
139890
140048
|
lodash2.isError = isError;
|
|
139891
140049
|
lodash2.isFinite = isFinite2;
|
|
139892
140050
|
lodash2.isFunction = isFunction2;
|
|
139893
|
-
lodash2.isInteger =
|
|
140051
|
+
lodash2.isInteger = isInteger;
|
|
139894
140052
|
lodash2.isLength = isLength2;
|
|
139895
140053
|
lodash2.isMap = isMap2;
|
|
139896
140054
|
lodash2.isMatch = isMatch;
|
|
@@ -139898,7 +140056,7 @@ function requireLodash() {
|
|
|
139898
140056
|
lodash2.isNaN = isNaN2;
|
|
139899
140057
|
lodash2.isNative = isNative2;
|
|
139900
140058
|
lodash2.isNil = isNil;
|
|
139901
|
-
lodash2.isNull =
|
|
140059
|
+
lodash2.isNull = isNull2;
|
|
139902
140060
|
lodash2.isNumber = isNumber2;
|
|
139903
140061
|
lodash2.isObject = isObject2;
|
|
139904
140062
|
lodash2.isObjectLike = isObjectLike2;
|
|
@@ -149036,6 +149194,7 @@ const _FindBar = class _FindBar extends React.Component {
|
|
|
149036
149194
|
annotationVisibilityShow: annotationVisibilityShow2,
|
|
149037
149195
|
updateAmbiguousOrLiteral: updateAmbiguousOrLiteral2,
|
|
149038
149196
|
updateDnaOrAA: updateDnaOrAA2,
|
|
149197
|
+
updateMismatchesAllowed: updateMismatchesAllowed2,
|
|
149039
149198
|
updateMatchNumber: _updateMatchNumber,
|
|
149040
149199
|
selectionLayerUpdate: selectionLayerUpdate2,
|
|
149041
149200
|
annotationSearchMatches,
|
|
@@ -149048,6 +149207,7 @@ const _FindBar = class _FindBar extends React.Component {
|
|
|
149048
149207
|
ambiguousOrLiteral,
|
|
149049
149208
|
matchesTotal = 0,
|
|
149050
149209
|
matchNumber = 0,
|
|
149210
|
+
mismatchesAllowed = 0,
|
|
149051
149211
|
isInline
|
|
149052
149212
|
} = findTool2;
|
|
149053
149213
|
const updateMatchNumber2 = /* @__PURE__ */ __name((...args) => {
|
|
@@ -149087,6 +149247,30 @@ const _FindBar = class _FindBar extends React.Component {
|
|
|
149087
149247
|
}, "onChange")
|
|
149088
149248
|
}
|
|
149089
149249
|
), /* @__PURE__ */ React.createElement(InfoHelper, { style: { marginLeft: 10 } }, /* @__PURE__ */ React.createElement("div", null, "Ambiguous substitutions:", /* @__PURE__ */ React.createElement("div", { style: { display: "flex", fontSize: 12 } }, /* @__PURE__ */ React.createElement("div", { style: { marginRight: 20 } }, /* @__PURE__ */ React.createElement("div", { style: { fontSize: 14, marginBottom: 4, marginTop: 5 } }, "DNA:"), /* @__PURE__ */ React.createElement("div", null, "M: AC"), /* @__PURE__ */ React.createElement("div", null, "R: AG"), /* @__PURE__ */ React.createElement("div", null, "W: AT"), /* @__PURE__ */ React.createElement("div", null, "S: CG"), /* @__PURE__ */ React.createElement("div", null, "Y: CT"), /* @__PURE__ */ React.createElement("div", null, "K: GT"), /* @__PURE__ */ React.createElement("div", null, "V: ACG"), /* @__PURE__ */ React.createElement("div", null, "H: ACT"), /* @__PURE__ */ React.createElement("div", null, "D: AGT"), /* @__PURE__ */ React.createElement("div", null, "B: CGT"), /* @__PURE__ */ React.createElement("div", null, "X: GATC"), /* @__PURE__ */ React.createElement("div", null, "N: GATC"), /* @__PURE__ */ React.createElement("div", null, "*: any")), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { style: { fontSize: 14, marginBottom: 4, marginTop: 5 } }, "AA:"), /* @__PURE__ */ React.createElement("div", null, "B: ND"), /* @__PURE__ */ React.createElement("div", null, "J: IL"), /* @__PURE__ */ React.createElement("div", null, "X: ACDEFGHIKLMNPQRSTVWY"), /* @__PURE__ */ React.createElement("div", null, "Z: QE"), /* @__PURE__ */ React.createElement("div", null, "*: any")))))),
|
|
149250
|
+
/* @__PURE__ */ React.createElement(
|
|
149251
|
+
"div",
|
|
149252
|
+
{
|
|
149253
|
+
key: "mismatchesAllowed",
|
|
149254
|
+
style: { marginTop: "8px", display: "flex", alignItems: "center" }
|
|
149255
|
+
},
|
|
149256
|
+
/* @__PURE__ */ React.createElement("label", { style: { marginRight: "8px" } }, "Mismatches Allowed:"),
|
|
149257
|
+
/* @__PURE__ */ React.createElement(
|
|
149258
|
+
core.NumericInput,
|
|
149259
|
+
{
|
|
149260
|
+
min: 0,
|
|
149261
|
+
max: 10,
|
|
149262
|
+
className: "tg-mismatches-allowed-input",
|
|
149263
|
+
style: { width: "60px" },
|
|
149264
|
+
value: mismatchesAllowed,
|
|
149265
|
+
disabled: dnaOrAA !== "DNA" || ambiguousOrLiteral !== "LITERAL",
|
|
149266
|
+
onValueChange: /* @__PURE__ */ __name((value) => {
|
|
149267
|
+
const newValue = Math.max(0, parseInt(value, 10) || 0);
|
|
149268
|
+
updateMismatchesAllowed2(newValue);
|
|
149269
|
+
}, "onValueChange")
|
|
149270
|
+
}
|
|
149271
|
+
),
|
|
149272
|
+
/* @__PURE__ */ React.createElement(InfoHelper, { style: { marginLeft: 10 } }, /* @__PURE__ */ React.createElement("div", null, "Number of mismatches allowed when searching DNA sequences with literal matching.", /* @__PURE__ */ React.createElement("br", null), /* @__PURE__ */ React.createElement("br", null), "Higher values may slow down search performance."))
|
|
149273
|
+
),
|
|
149090
149274
|
/* @__PURE__ */ React.createElement(
|
|
149091
149275
|
core.Switch,
|
|
149092
149276
|
{
|