@teselagen/ui 0.8.5 → 0.8.6-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DataTable/utils/filterLocalEntitiesToHasura.d.ts +5 -0
- package/DataTable/utils/initializeHasuraWhereAndFilter.d.ts +2 -0
- package/DataTable/utils/queryParams.d.ts +7 -14
- package/DataTable/utils/tableQueryParamsToHasuraClauses.d.ts +26 -0
- package/index.cjs.js +846 -972
- package/index.d.ts +1 -0
- package/index.es.js +846 -972
- package/package.json +1 -1
- package/src/DataTable/Columns.js +1 -1
- package/src/DataTable/DisplayOptions.js +1 -1
- package/src/DataTable/FilterAndSortMenu.js +27 -30
- package/src/DataTable/index.js +3 -14
- package/src/DataTable/style.css +1 -1
- package/src/DataTable/utils/filterLocalEntitiesToHasura.js +236 -0
- package/src/DataTable/utils/filterLocalEntitiesToHasura.test.js +587 -0
- package/src/DataTable/utils/initializeHasuraWhereAndFilter.js +26 -0
- package/src/DataTable/utils/queryParams.js +64 -772
- package/src/DataTable/utils/tableQueryParamsToHasuraClauses.js +260 -0
- package/src/DataTable/utils/tableQueryParamsToHasuraClauses.test.js +206 -0
- package/src/DataTable/utils/withTableParams.js +3 -16
- package/src/FormComponents/Uploader.js +5 -1
- package/src/FormComponents/index.js +2 -2
- package/src/autoTooltip.js +1 -0
- package/src/index.js +1 -0
- package/ui.css +1 -1
package/index.es.js
CHANGED
|
@@ -5785,12 +5785,12 @@ var freeGlobal = typeof global == "object" && global && global.Object === Object
|
|
|
5785
5785
|
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
5786
5786
|
var root$4 = freeGlobal || freeSelf || Function("return this")();
|
|
5787
5787
|
var Symbol$1 = root$4.Symbol;
|
|
5788
|
-
var objectProto$
|
|
5789
|
-
var hasOwnProperty$
|
|
5790
|
-
var nativeObjectToString$2 = objectProto$
|
|
5788
|
+
var objectProto$i = Object.prototype;
|
|
5789
|
+
var hasOwnProperty$f = objectProto$i.hasOwnProperty;
|
|
5790
|
+
var nativeObjectToString$2 = objectProto$i.toString;
|
|
5791
5791
|
var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : void 0;
|
|
5792
5792
|
function getRawTag(value) {
|
|
5793
|
-
var isOwn = hasOwnProperty$
|
|
5793
|
+
var isOwn = hasOwnProperty$f.call(value, symToStringTag$1), tag = value[symToStringTag$1];
|
|
5794
5794
|
try {
|
|
5795
5795
|
value[symToStringTag$1] = void 0;
|
|
5796
5796
|
var unmasked = true;
|
|
@@ -5807,8 +5807,8 @@ function getRawTag(value) {
|
|
|
5807
5807
|
return result;
|
|
5808
5808
|
}
|
|
5809
5809
|
__name(getRawTag, "getRawTag");
|
|
5810
|
-
var objectProto$
|
|
5811
|
-
var nativeObjectToString$1 = objectProto$
|
|
5810
|
+
var objectProto$h = Object.prototype;
|
|
5811
|
+
var nativeObjectToString$1 = objectProto$h.toString;
|
|
5812
5812
|
function objectToString(value) {
|
|
5813
5813
|
return nativeObjectToString$1.call(value);
|
|
5814
5814
|
}
|
|
@@ -5955,11 +5955,11 @@ function toSource(func) {
|
|
|
5955
5955
|
__name(toSource, "toSource");
|
|
5956
5956
|
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
5957
5957
|
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
5958
|
-
var funcProto$1 = Function.prototype, objectProto$
|
|
5958
|
+
var funcProto$1 = Function.prototype, objectProto$g = Object.prototype;
|
|
5959
5959
|
var funcToString$1 = funcProto$1.toString;
|
|
5960
|
-
var hasOwnProperty$
|
|
5960
|
+
var hasOwnProperty$e = objectProto$g.hasOwnProperty;
|
|
5961
5961
|
var reIsNative = RegExp(
|
|
5962
|
-
"^" + funcToString$1.call(hasOwnProperty$
|
|
5962
|
+
"^" + funcToString$1.call(hasOwnProperty$e).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
5963
5963
|
);
|
|
5964
5964
|
function baseIsNative(value) {
|
|
5965
5965
|
if (!isObject$2(value) || isMasked(value)) {
|
|
@@ -6132,11 +6132,11 @@ function eq$1(value, other) {
|
|
|
6132
6132
|
return value === other || value !== value && other !== other;
|
|
6133
6133
|
}
|
|
6134
6134
|
__name(eq$1, "eq$1");
|
|
6135
|
-
var objectProto$
|
|
6136
|
-
var hasOwnProperty$
|
|
6135
|
+
var objectProto$f = Object.prototype;
|
|
6136
|
+
var hasOwnProperty$d = objectProto$f.hasOwnProperty;
|
|
6137
6137
|
function assignValue(object2, key, value) {
|
|
6138
6138
|
var objValue = object2[key];
|
|
6139
|
-
if (!(hasOwnProperty$
|
|
6139
|
+
if (!(hasOwnProperty$d.call(object2, key) && eq$1(objValue, value)) || value === void 0 && !(key in object2)) {
|
|
6140
6140
|
baseAssignValue(object2, key, value);
|
|
6141
6141
|
}
|
|
6142
6142
|
}
|
|
@@ -6160,11 +6160,11 @@ function copyObject(source, props, object2, customizer) {
|
|
|
6160
6160
|
return object2;
|
|
6161
6161
|
}
|
|
6162
6162
|
__name(copyObject, "copyObject");
|
|
6163
|
-
var nativeMax$
|
|
6163
|
+
var nativeMax$3 = Math.max;
|
|
6164
6164
|
function overRest(func, start2, transform) {
|
|
6165
|
-
start2 = nativeMax$
|
|
6165
|
+
start2 = nativeMax$3(start2 === void 0 ? func.length - 1 : start2, 0);
|
|
6166
6166
|
return function() {
|
|
6167
|
-
var args = arguments, index2 = -1, length = nativeMax$
|
|
6167
|
+
var args = arguments, index2 = -1, length = nativeMax$3(args.length - start2, 0), array2 = Array(length);
|
|
6168
6168
|
while (++index2 < length) {
|
|
6169
6169
|
array2[index2] = args[start2 + index2];
|
|
6170
6170
|
}
|
|
@@ -6221,9 +6221,9 @@ function createAssigner(assigner) {
|
|
|
6221
6221
|
});
|
|
6222
6222
|
}
|
|
6223
6223
|
__name(createAssigner, "createAssigner");
|
|
6224
|
-
var objectProto$
|
|
6224
|
+
var objectProto$e = Object.prototype;
|
|
6225
6225
|
function isPrototype(value) {
|
|
6226
|
-
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$
|
|
6226
|
+
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$e;
|
|
6227
6227
|
return value === proto;
|
|
6228
6228
|
}
|
|
6229
6229
|
__name(isPrototype, "isPrototype");
|
|
@@ -6240,13 +6240,13 @@ function baseIsArguments(value) {
|
|
|
6240
6240
|
return isObjectLike$1(value) && baseGetTag(value) == argsTag$3;
|
|
6241
6241
|
}
|
|
6242
6242
|
__name(baseIsArguments, "baseIsArguments");
|
|
6243
|
-
var objectProto$
|
|
6244
|
-
var hasOwnProperty$
|
|
6245
|
-
var propertyIsEnumerable$1 = objectProto$
|
|
6243
|
+
var objectProto$d = Object.prototype;
|
|
6244
|
+
var hasOwnProperty$c = objectProto$d.hasOwnProperty;
|
|
6245
|
+
var propertyIsEnumerable$1 = objectProto$d.propertyIsEnumerable;
|
|
6246
6246
|
var isArguments = baseIsArguments(/* @__PURE__ */ function() {
|
|
6247
6247
|
return arguments;
|
|
6248
6248
|
}()) ? baseIsArguments : function(value) {
|
|
6249
|
-
return isObjectLike$1(value) && hasOwnProperty$
|
|
6249
|
+
return isObjectLike$1(value) && hasOwnProperty$c.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
|
|
6250
6250
|
};
|
|
6251
6251
|
function stubFalse() {
|
|
6252
6252
|
return false;
|
|
@@ -6289,12 +6289,12 @@ var nodeUtil = function() {
|
|
|
6289
6289
|
}();
|
|
6290
6290
|
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
6291
6291
|
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
6292
|
-
var objectProto$
|
|
6293
|
-
var hasOwnProperty$
|
|
6292
|
+
var objectProto$c = Object.prototype;
|
|
6293
|
+
var hasOwnProperty$b = objectProto$c.hasOwnProperty;
|
|
6294
6294
|
function arrayLikeKeys(value, inherited) {
|
|
6295
6295
|
var isArr = isArray$2(value), isArg = !isArr && isArguments(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;
|
|
6296
6296
|
for (var key in value) {
|
|
6297
|
-
if ((inherited || hasOwnProperty$
|
|
6297
|
+
if ((inherited || hasOwnProperty$b.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
6298
6298
|
(key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
6299
6299
|
isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
6300
6300
|
isType2 && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
|
|
@@ -6312,15 +6312,15 @@ function overArg(func, transform) {
|
|
|
6312
6312
|
}
|
|
6313
6313
|
__name(overArg, "overArg");
|
|
6314
6314
|
var nativeKeys = overArg(Object.keys, Object);
|
|
6315
|
-
var objectProto$
|
|
6316
|
-
var hasOwnProperty$
|
|
6315
|
+
var objectProto$b = Object.prototype;
|
|
6316
|
+
var hasOwnProperty$a = objectProto$b.hasOwnProperty;
|
|
6317
6317
|
function baseKeys(object2) {
|
|
6318
6318
|
if (!isPrototype(object2)) {
|
|
6319
6319
|
return nativeKeys(object2);
|
|
6320
6320
|
}
|
|
6321
6321
|
var result = [];
|
|
6322
6322
|
for (var key in Object(object2)) {
|
|
6323
|
-
if (hasOwnProperty$
|
|
6323
|
+
if (hasOwnProperty$a.call(object2, key) && key != "constructor") {
|
|
6324
6324
|
result.push(key);
|
|
6325
6325
|
}
|
|
6326
6326
|
}
|
|
@@ -6341,15 +6341,15 @@ function nativeKeysIn(object2) {
|
|
|
6341
6341
|
return result;
|
|
6342
6342
|
}
|
|
6343
6343
|
__name(nativeKeysIn, "nativeKeysIn");
|
|
6344
|
-
var objectProto$
|
|
6345
|
-
var hasOwnProperty$
|
|
6344
|
+
var objectProto$a = Object.prototype;
|
|
6345
|
+
var hasOwnProperty$9 = objectProto$a.hasOwnProperty;
|
|
6346
6346
|
function baseKeysIn(object2) {
|
|
6347
6347
|
if (!isObject$2(object2)) {
|
|
6348
6348
|
return nativeKeysIn(object2);
|
|
6349
6349
|
}
|
|
6350
6350
|
var isProto = isPrototype(object2), result = [];
|
|
6351
6351
|
for (var key in object2) {
|
|
6352
|
-
if (!(key == "constructor" && (isProto || !hasOwnProperty$
|
|
6352
|
+
if (!(key == "constructor" && (isProto || !hasOwnProperty$9.call(object2, key)))) {
|
|
6353
6353
|
result.push(key);
|
|
6354
6354
|
}
|
|
6355
6355
|
}
|
|
@@ -6385,22 +6385,22 @@ function hashDelete(key) {
|
|
|
6385
6385
|
}
|
|
6386
6386
|
__name(hashDelete, "hashDelete");
|
|
6387
6387
|
var HASH_UNDEFINED$2 = "__lodash_hash_undefined__";
|
|
6388
|
-
var objectProto$
|
|
6389
|
-
var hasOwnProperty$
|
|
6388
|
+
var objectProto$9 = Object.prototype;
|
|
6389
|
+
var hasOwnProperty$8 = objectProto$9.hasOwnProperty;
|
|
6390
6390
|
function hashGet(key) {
|
|
6391
6391
|
var data = this.__data__;
|
|
6392
6392
|
if (nativeCreate) {
|
|
6393
6393
|
var result = data[key];
|
|
6394
6394
|
return result === HASH_UNDEFINED$2 ? void 0 : result;
|
|
6395
6395
|
}
|
|
6396
|
-
return hasOwnProperty$
|
|
6396
|
+
return hasOwnProperty$8.call(data, key) ? data[key] : void 0;
|
|
6397
6397
|
}
|
|
6398
6398
|
__name(hashGet, "hashGet");
|
|
6399
|
-
var objectProto$
|
|
6400
|
-
var hasOwnProperty$
|
|
6399
|
+
var objectProto$8 = Object.prototype;
|
|
6400
|
+
var hasOwnProperty$7 = objectProto$8.hasOwnProperty;
|
|
6401
6401
|
function hashHas(key) {
|
|
6402
6402
|
var data = this.__data__;
|
|
6403
|
-
return nativeCreate ? data[key] !== void 0 : hasOwnProperty$
|
|
6403
|
+
return nativeCreate ? data[key] !== void 0 : hasOwnProperty$7.call(data, key);
|
|
6404
6404
|
}
|
|
6405
6405
|
__name(hashHas, "hashHas");
|
|
6406
6406
|
var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
|
|
@@ -6663,9 +6663,9 @@ function flatRest(func) {
|
|
|
6663
6663
|
__name(flatRest, "flatRest");
|
|
6664
6664
|
var getPrototype = overArg(Object.getPrototypeOf, Object);
|
|
6665
6665
|
var objectTag$3 = "[object Object]";
|
|
6666
|
-
var funcProto = Function.prototype, objectProto$
|
|
6666
|
+
var funcProto = Function.prototype, objectProto$7 = Object.prototype;
|
|
6667
6667
|
var funcToString = funcProto.toString;
|
|
6668
|
-
var hasOwnProperty$
|
|
6668
|
+
var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
|
|
6669
6669
|
var objectCtorString = funcToString.call(Object);
|
|
6670
6670
|
function isPlainObject$2(value) {
|
|
6671
6671
|
if (!isObjectLike$1(value) || baseGetTag(value) != objectTag$3) {
|
|
@@ -6675,7 +6675,7 @@ function isPlainObject$2(value) {
|
|
|
6675
6675
|
if (proto === null) {
|
|
6676
6676
|
return true;
|
|
6677
6677
|
}
|
|
6678
|
-
var Ctor = hasOwnProperty$
|
|
6678
|
+
var Ctor = hasOwnProperty$6.call(proto, "constructor") && proto.constructor;
|
|
6679
6679
|
return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
|
|
6680
6680
|
}
|
|
6681
6681
|
__name(isPlainObject$2, "isPlainObject$2");
|
|
@@ -7104,8 +7104,8 @@ function stubArray() {
|
|
|
7104
7104
|
return [];
|
|
7105
7105
|
}
|
|
7106
7106
|
__name(stubArray, "stubArray");
|
|
7107
|
-
var objectProto$
|
|
7108
|
-
var propertyIsEnumerable = objectProto$
|
|
7107
|
+
var objectProto$6 = Object.prototype;
|
|
7108
|
+
var propertyIsEnumerable = objectProto$6.propertyIsEnumerable;
|
|
7109
7109
|
var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
|
|
7110
7110
|
var getSymbols = !nativeGetSymbols$1 ? stubArray : function(object2) {
|
|
7111
7111
|
if (object2 == null) {
|
|
@@ -7173,11 +7173,11 @@ if (DataView$1 && getTag$1(new DataView$1(new ArrayBuffer(1))) != dataViewTag$3
|
|
|
7173
7173
|
return result;
|
|
7174
7174
|
}, "getTag$1");
|
|
7175
7175
|
}
|
|
7176
|
-
var objectProto$
|
|
7177
|
-
var hasOwnProperty$
|
|
7176
|
+
var objectProto$5 = Object.prototype;
|
|
7177
|
+
var hasOwnProperty$5 = objectProto$5.hasOwnProperty;
|
|
7178
7178
|
function initCloneArray(array2) {
|
|
7179
7179
|
var length = array2.length, result = new array2.constructor(length);
|
|
7180
|
-
if (length && typeof array2[0] == "string" && hasOwnProperty$
|
|
7180
|
+
if (length && typeof array2[0] == "string" && hasOwnProperty$5.call(array2, "index")) {
|
|
7181
7181
|
result.index = array2.index;
|
|
7182
7182
|
result.input = array2.input;
|
|
7183
7183
|
}
|
|
@@ -7491,8 +7491,8 @@ function equalByTag(object2, other, tag, bitmask, customizer, equalFunc, stack)
|
|
|
7491
7491
|
}
|
|
7492
7492
|
__name(equalByTag, "equalByTag");
|
|
7493
7493
|
var COMPARE_PARTIAL_FLAG$3 = 1;
|
|
7494
|
-
var objectProto$
|
|
7495
|
-
var hasOwnProperty$
|
|
7494
|
+
var objectProto$4 = Object.prototype;
|
|
7495
|
+
var hasOwnProperty$4 = objectProto$4.hasOwnProperty;
|
|
7496
7496
|
function equalObjects(object2, other, bitmask, customizer, equalFunc, stack) {
|
|
7497
7497
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, objProps = getAllKeys(object2), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
|
|
7498
7498
|
if (objLength != othLength && !isPartial) {
|
|
@@ -7501,7 +7501,7 @@ function equalObjects(object2, other, bitmask, customizer, equalFunc, stack) {
|
|
|
7501
7501
|
var index2 = objLength;
|
|
7502
7502
|
while (index2--) {
|
|
7503
7503
|
var key = objProps[index2];
|
|
7504
|
-
if (!(isPartial ? key in other : hasOwnProperty$
|
|
7504
|
+
if (!(isPartial ? key in other : hasOwnProperty$4.call(other, key))) {
|
|
7505
7505
|
return false;
|
|
7506
7506
|
}
|
|
7507
7507
|
}
|
|
@@ -7539,8 +7539,8 @@ function equalObjects(object2, other, bitmask, customizer, equalFunc, stack) {
|
|
|
7539
7539
|
__name(equalObjects, "equalObjects");
|
|
7540
7540
|
var COMPARE_PARTIAL_FLAG$2 = 1;
|
|
7541
7541
|
var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]";
|
|
7542
|
-
var objectProto$
|
|
7543
|
-
var hasOwnProperty$
|
|
7542
|
+
var objectProto$3 = Object.prototype;
|
|
7543
|
+
var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
|
|
7544
7544
|
function baseIsEqualDeep(object2, other, bitmask, customizer, equalFunc, stack) {
|
|
7545
7545
|
var objIsArr = isArray$2(object2), othIsArr = isArray$2(other), objTag = objIsArr ? arrayTag : getTag$1(object2), othTag = othIsArr ? arrayTag : getTag$1(other);
|
|
7546
7546
|
objTag = objTag == argsTag ? objectTag : objTag;
|
|
@@ -7558,7 +7558,7 @@ function baseIsEqualDeep(object2, other, bitmask, customizer, equalFunc, stack)
|
|
|
7558
7558
|
return objIsArr || isTypedArray(object2) ? equalArrays(object2, other, bitmask, customizer, equalFunc, stack) : equalByTag(object2, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
7559
7559
|
}
|
|
7560
7560
|
if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
|
|
7561
|
-
var objIsWrapped = objIsObj && hasOwnProperty$
|
|
7561
|
+
var objIsWrapped = objIsObj && hasOwnProperty$3.call(object2, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty$3.call(other, "__wrapped__");
|
|
7562
7562
|
if (objIsWrapped || othIsWrapped) {
|
|
7563
7563
|
var objUnwrapped = objIsWrapped ? object2.value() : object2, othUnwrapped = othIsWrapped ? other.value() : other;
|
|
7564
7564
|
stack || (stack = new Stack());
|
|
@@ -7774,7 +7774,7 @@ var now = /* @__PURE__ */ __name(function() {
|
|
|
7774
7774
|
return root$4.Date.now();
|
|
7775
7775
|
}, "now");
|
|
7776
7776
|
var FUNC_ERROR_TEXT$2 = "Expected a function";
|
|
7777
|
-
var nativeMax$
|
|
7777
|
+
var nativeMax$2 = Math.max, nativeMin$1 = Math.min;
|
|
7778
7778
|
function debounce(func, wait, options) {
|
|
7779
7779
|
var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
|
|
7780
7780
|
if (typeof func != "function") {
|
|
@@ -7784,7 +7784,7 @@ function debounce(func, wait, options) {
|
|
|
7784
7784
|
if (isObject$2(options)) {
|
|
7785
7785
|
leading = !!options.leading;
|
|
7786
7786
|
maxing = "maxWait" in options;
|
|
7787
|
-
maxWait = maxing ? nativeMax$
|
|
7787
|
+
maxWait = maxing ? nativeMax$2(toNumber(options.maxWait) || 0, wait) : maxWait;
|
|
7788
7788
|
trailing = "trailing" in options ? !!options.trailing : trailing;
|
|
7789
7789
|
}
|
|
7790
7790
|
function invokeFunc(time) {
|
|
@@ -7954,12 +7954,12 @@ function baseMerge(object2, source, srcIndex, customizer, stack) {
|
|
|
7954
7954
|
__name(baseMerge, "baseMerge");
|
|
7955
7955
|
var LARGE_ARRAY_SIZE$1 = 200;
|
|
7956
7956
|
function baseDifference(array2, values2, iteratee, comparator) {
|
|
7957
|
-
var index2 = -1,
|
|
7957
|
+
var index2 = -1, includes2 = arrayIncludes, isCommon = true, length = array2.length, result = [], valuesLength = values2.length;
|
|
7958
7958
|
if (!length) {
|
|
7959
7959
|
return result;
|
|
7960
7960
|
}
|
|
7961
7961
|
if (values2.length >= LARGE_ARRAY_SIZE$1) {
|
|
7962
|
-
|
|
7962
|
+
includes2 = cacheHas;
|
|
7963
7963
|
isCommon = false;
|
|
7964
7964
|
values2 = new SetCache(values2);
|
|
7965
7965
|
}
|
|
@@ -7975,7 +7975,7 @@ function baseDifference(array2, values2, iteratee, comparator) {
|
|
|
7975
7975
|
}
|
|
7976
7976
|
}
|
|
7977
7977
|
result.push(value);
|
|
7978
|
-
} else if (!
|
|
7978
|
+
} else if (!includes2(values2, computed3, comparator)) {
|
|
7979
7979
|
result.push(value);
|
|
7980
7980
|
}
|
|
7981
7981
|
}
|
|
@@ -7990,15 +7990,6 @@ function last$1(array2) {
|
|
|
7990
7990
|
return length ? array2[length - 1] : void 0;
|
|
7991
7991
|
}
|
|
7992
7992
|
__name(last$1, "last$1");
|
|
7993
|
-
function drop(array2, n2, guard) {
|
|
7994
|
-
var length = array2 == null ? 0 : array2.length;
|
|
7995
|
-
if (!length) {
|
|
7996
|
-
return [];
|
|
7997
|
-
}
|
|
7998
|
-
n2 = n2 === void 0 ? 1 : toInteger(n2);
|
|
7999
|
-
return baseSlice(array2, n2 < 0 ? 0 : n2, length);
|
|
8000
|
-
}
|
|
8001
|
-
__name(drop, "drop");
|
|
8002
7993
|
function castFunction(value) {
|
|
8003
7994
|
return typeof value == "function" ? value : identity$1;
|
|
8004
7995
|
}
|
|
@@ -8008,16 +7999,6 @@ function forEach(collection, iteratee) {
|
|
|
8008
7999
|
return func(collection, castFunction(iteratee));
|
|
8009
8000
|
}
|
|
8010
8001
|
__name(forEach, "forEach");
|
|
8011
|
-
function endsWith$1(string2, target, position2) {
|
|
8012
|
-
string2 = toString$4(string2);
|
|
8013
|
-
target = baseToString$1(target);
|
|
8014
|
-
var length = string2.length;
|
|
8015
|
-
position2 = position2 === void 0 ? length : baseClamp(toInteger(position2), 0, length);
|
|
8016
|
-
var end2 = position2;
|
|
8017
|
-
position2 -= target.length;
|
|
8018
|
-
return position2 >= 0 && string2.slice(position2, end2) == target;
|
|
8019
|
-
}
|
|
8020
|
-
__name(endsWith$1, "endsWith$1");
|
|
8021
8002
|
function arrayEvery(array2, predicate) {
|
|
8022
8003
|
var index2 = -1, length = array2 == null ? 0 : array2.length;
|
|
8023
8004
|
while (++index2 < length) {
|
|
@@ -8078,6 +8059,16 @@ function baseGt(value, other) {
|
|
|
8078
8059
|
return value > other;
|
|
8079
8060
|
}
|
|
8080
8061
|
__name(baseGt, "baseGt");
|
|
8062
|
+
var objectProto$2 = Object.prototype;
|
|
8063
|
+
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
8064
|
+
function baseHas(object2, key) {
|
|
8065
|
+
return object2 != null && hasOwnProperty$2.call(object2, key);
|
|
8066
|
+
}
|
|
8067
|
+
__name(baseHas, "baseHas");
|
|
8068
|
+
function has$1(object2, path2) {
|
|
8069
|
+
return object2 != null && hasPath(object2, path2, baseHas);
|
|
8070
|
+
}
|
|
8071
|
+
__name(has$1, "has$1");
|
|
8081
8072
|
var stringTag = "[object String]";
|
|
8082
8073
|
function isString$1(value) {
|
|
8083
8074
|
return typeof value == "string" || !isArray$2(value) && isObjectLike$1(value) && baseGetTag(value) == stringTag;
|
|
@@ -8093,6 +8084,17 @@ function values(object2) {
|
|
|
8093
8084
|
return object2 == null ? [] : baseValues(object2, keys$1(object2));
|
|
8094
8085
|
}
|
|
8095
8086
|
__name(values, "values");
|
|
8087
|
+
var nativeMax$1 = Math.max;
|
|
8088
|
+
function includes(collection, value, fromIndex, guard) {
|
|
8089
|
+
collection = isArrayLike(collection) ? collection : values(collection);
|
|
8090
|
+
fromIndex = fromIndex && true ? toInteger(fromIndex) : 0;
|
|
8091
|
+
var length = collection.length;
|
|
8092
|
+
if (fromIndex < 0) {
|
|
8093
|
+
fromIndex = nativeMax$1(length + fromIndex, 0);
|
|
8094
|
+
}
|
|
8095
|
+
return isString$1(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
|
|
8096
|
+
}
|
|
8097
|
+
__name(includes, "includes");
|
|
8096
8098
|
function baseInverter(object2, setter, iteratee, accumulator) {
|
|
8097
8099
|
baseForOwn(object2, function(value, key, object3) {
|
|
8098
8100
|
setter(accumulator, iteratee(value), key, object3);
|
|
@@ -8153,15 +8155,15 @@ function isEqualWith(value, other, customizer) {
|
|
|
8153
8155
|
return result === void 0 ? baseIsEqual(value, other, void 0, customizer) : !!result;
|
|
8154
8156
|
}
|
|
8155
8157
|
__name(isEqualWith, "isEqualWith");
|
|
8156
|
-
function isInteger(value) {
|
|
8157
|
-
return typeof value == "number" && value == toInteger(value);
|
|
8158
|
-
}
|
|
8159
|
-
__name(isInteger, "isInteger");
|
|
8160
8158
|
var numberTag = "[object Number]";
|
|
8161
8159
|
function isNumber$1(value) {
|
|
8162
8160
|
return typeof value == "number" || isObjectLike$1(value) && baseGetTag(value) == numberTag;
|
|
8163
8161
|
}
|
|
8164
8162
|
__name(isNumber$1, "isNumber$1");
|
|
8163
|
+
function isNull(value) {
|
|
8164
|
+
return value === null;
|
|
8165
|
+
}
|
|
8166
|
+
__name(isNull, "isNull");
|
|
8165
8167
|
function isUndefined(value) {
|
|
8166
8168
|
return value === void 0;
|
|
8167
8169
|
}
|
|
@@ -8618,14 +8620,14 @@ var createSet = !(Set$1 && 1 / setToArray(new Set$1([, -0]))[1] == INFINITY) ? n
|
|
|
8618
8620
|
};
|
|
8619
8621
|
var LARGE_ARRAY_SIZE = 200;
|
|
8620
8622
|
function baseUniq(array2, iteratee, comparator) {
|
|
8621
|
-
var index2 = -1,
|
|
8623
|
+
var index2 = -1, includes2 = arrayIncludes, length = array2.length, isCommon = true, result = [], seen = result;
|
|
8622
8624
|
if (length >= LARGE_ARRAY_SIZE) {
|
|
8623
8625
|
var set5 = iteratee ? null : createSet(array2);
|
|
8624
8626
|
if (set5) {
|
|
8625
8627
|
return setToArray(set5);
|
|
8626
8628
|
}
|
|
8627
8629
|
isCommon = false;
|
|
8628
|
-
|
|
8630
|
+
includes2 = cacheHas;
|
|
8629
8631
|
seen = new SetCache();
|
|
8630
8632
|
} else {
|
|
8631
8633
|
seen = iteratee ? [] : result;
|
|
@@ -8645,7 +8647,7 @@ function baseUniq(array2, iteratee, comparator) {
|
|
|
8645
8647
|
seen.push(computed3);
|
|
8646
8648
|
}
|
|
8647
8649
|
result.push(value);
|
|
8648
|
-
} else if (!
|
|
8650
|
+
} else if (!includes2(seen, computed3, comparator)) {
|
|
8649
8651
|
if (seen !== result) {
|
|
8650
8652
|
seen.push(computed3);
|
|
8651
8653
|
}
|
|
@@ -8655,10 +8657,6 @@ function baseUniq(array2, iteratee, comparator) {
|
|
|
8655
8657
|
return result;
|
|
8656
8658
|
}
|
|
8657
8659
|
__name(baseUniq, "baseUniq");
|
|
8658
|
-
function uniq(array2) {
|
|
8659
|
-
return array2 && array2.length ? baseUniq(array2) : [];
|
|
8660
|
-
}
|
|
8661
|
-
__name(uniq, "uniq");
|
|
8662
8660
|
function uniqBy(array2, iteratee) {
|
|
8663
8661
|
return array2 && array2.length ? baseUniq(array2, baseIteratee(iteratee)) : [];
|
|
8664
8662
|
}
|
|
@@ -19387,293 +19385,414 @@ function requireLib$1() {
|
|
|
19387
19385
|
__name(requireLib$1, "requireLib$1");
|
|
19388
19386
|
var libExports$1 = /* @__PURE__ */ requireLib$1();
|
|
19389
19387
|
const queryString = /* @__PURE__ */ getDefaultExportFromCjs(libExports$1);
|
|
19390
|
-
|
|
19391
|
-
|
|
19392
|
-
|
|
19393
|
-
|
|
19394
|
-
|
|
19395
|
-
|
|
19396
|
-
|
|
19397
|
-
|
|
19398
|
-
|
|
19399
|
-
|
|
19400
|
-
|
|
19401
|
-
|
|
19402
|
-
|
|
19403
|
-
|
|
19404
|
-
|
|
19405
|
-
|
|
19406
|
-
|
|
19407
|
-
|
|
19408
|
-
|
|
19409
|
-
|
|
19410
|
-
|
|
19411
|
-
|
|
19412
|
-
|
|
19413
|
-
|
|
19414
|
-
|
|
19415
|
-
|
|
19416
|
-
|
|
19417
|
-
|
|
19418
|
-
|
|
19419
|
-
}, "u") }, g2 = "en", D2 = {};
|
|
19420
|
-
D2[g2] = M2;
|
|
19421
|
-
var p2 = "$isDayjsObject", S2 = /* @__PURE__ */ __name(function(t3) {
|
|
19422
|
-
return t3 instanceof _2 || !(!t3 || !t3[p2]);
|
|
19423
|
-
}, "S"), w2 = /* @__PURE__ */ __name(function t3(e2, n3, r3) {
|
|
19424
|
-
var i3;
|
|
19425
|
-
if (!e2) return g2;
|
|
19426
|
-
if ("string" == typeof e2) {
|
|
19427
|
-
var s3 = e2.toLowerCase();
|
|
19428
|
-
D2[s3] && (i3 = s3), n3 && (D2[s3] = n3, i3 = s3);
|
|
19429
|
-
var u3 = e2.split("-");
|
|
19430
|
-
if (!i3 && u3.length > 1) return t3(u3[0]);
|
|
19431
|
-
} else {
|
|
19432
|
-
var a3 = e2.name;
|
|
19433
|
-
D2[a3] = e2, i3 = a3;
|
|
19388
|
+
function tableQueryParamsToHasuraClauses({
|
|
19389
|
+
page,
|
|
19390
|
+
pageSize,
|
|
19391
|
+
searchTerm,
|
|
19392
|
+
filters,
|
|
19393
|
+
order: order2,
|
|
19394
|
+
schema,
|
|
19395
|
+
// Add schema as a parameter
|
|
19396
|
+
additionalFilter
|
|
19397
|
+
}) {
|
|
19398
|
+
const ccFields = getFieldsMappedByCCDisplayName(schema);
|
|
19399
|
+
let where = {};
|
|
19400
|
+
const order_by = {};
|
|
19401
|
+
const limit = pageSize || 25;
|
|
19402
|
+
const offset3 = page && pageSize ? (page - 1) * pageSize : 0;
|
|
19403
|
+
if (searchTerm) {
|
|
19404
|
+
const searchTermFilters = [];
|
|
19405
|
+
schema.fields.forEach((field) => {
|
|
19406
|
+
const { type: type2, path: path2, searchDisabled } = field;
|
|
19407
|
+
if (searchDisabled || field.filterDisabled || type2 === "color") return;
|
|
19408
|
+
const filterValue = searchTerm;
|
|
19409
|
+
if (type2 === "string" || type2 === "lookup") {
|
|
19410
|
+
const o2 = set$1({}, path2, { _ilike: `%${filterValue}%` });
|
|
19411
|
+
searchTermFilters.push(o2);
|
|
19412
|
+
} else if (type2 === "boolean") {
|
|
19413
|
+
let regex;
|
|
19414
|
+
try {
|
|
19415
|
+
regex = new RegExp("^" + searchTerm, "ig");
|
|
19416
|
+
} catch (error) {
|
|
19434
19417
|
}
|
|
19435
|
-
|
|
19436
|
-
|
|
19437
|
-
|
|
19438
|
-
|
|
19439
|
-
|
|
19440
|
-
|
|
19441
|
-
|
|
19442
|
-
|
|
19443
|
-
};
|
|
19444
|
-
var _2 = function() {
|
|
19445
|
-
function M3(t3) {
|
|
19446
|
-
this.$L = w2(t3.locale, null, true), this.parse(t3), this.$x = this.$x || t3.x || {}, this[p2] = true;
|
|
19418
|
+
if (regex) {
|
|
19419
|
+
if ("true".replace(regex, "") !== "true") {
|
|
19420
|
+
const o2 = set$1({}, path2, { _eq: true });
|
|
19421
|
+
searchTermFilters.push(o2);
|
|
19422
|
+
} else if ("false".replace(regex, "") !== "false") {
|
|
19423
|
+
const o2 = set$1({}, path2, { _eq: false });
|
|
19424
|
+
searchTermFilters.push(o2);
|
|
19425
|
+
}
|
|
19447
19426
|
}
|
|
19448
|
-
|
|
19449
|
-
|
|
19450
|
-
|
|
19451
|
-
|
|
19452
|
-
|
|
19453
|
-
|
|
19454
|
-
|
|
19455
|
-
|
|
19456
|
-
|
|
19457
|
-
|
|
19458
|
-
|
|
19459
|
-
|
|
19460
|
-
|
|
19427
|
+
} else if ((type2 === "number" || type2 === "integer") && !isNaN(filterValue)) {
|
|
19428
|
+
const o2 = set$1({}, path2, { _eq: parseFloat(filterValue) });
|
|
19429
|
+
searchTermFilters.push(o2);
|
|
19430
|
+
}
|
|
19431
|
+
});
|
|
19432
|
+
if (searchTermFilters.length > 0) {
|
|
19433
|
+
if (Object.keys(where).length > 0) {
|
|
19434
|
+
where = { _and: [where, { _or: searchTermFilters }] };
|
|
19435
|
+
} else {
|
|
19436
|
+
where = { _or: searchTermFilters };
|
|
19437
|
+
}
|
|
19438
|
+
}
|
|
19439
|
+
}
|
|
19440
|
+
if (filters && filters.length > 0) {
|
|
19441
|
+
const filterClauses = filters.map((filter2) => {
|
|
19442
|
+
let { selectedFilter, filterOn, filterValue } = filter2;
|
|
19443
|
+
const fieldSchema = ccFields[filterOn] || {};
|
|
19444
|
+
const { path: path2, reference: reference2, type: type2 } = fieldSchema;
|
|
19445
|
+
let stringFilterValue = filterValue && filterValue.toString ? filterValue.toString() : filterValue;
|
|
19446
|
+
if (stringFilterValue === false) {
|
|
19447
|
+
stringFilterValue = "false";
|
|
19448
|
+
} else {
|
|
19449
|
+
stringFilterValue = stringFilterValue || "";
|
|
19450
|
+
}
|
|
19451
|
+
const arrayFilterValue = Array.isArray(filterValue) ? filterValue : stringFilterValue.split(";");
|
|
19452
|
+
if (type2 === "number" || type2 === "integer") {
|
|
19453
|
+
filterValue = Array.isArray(filterValue) ? filterValue.map((val) => Number(val)) : Number(filterValue);
|
|
19454
|
+
}
|
|
19455
|
+
if (fieldSchema.normalizeFilter) {
|
|
19456
|
+
filterValue = fieldSchema.normalizeFilter(
|
|
19457
|
+
filterValue,
|
|
19458
|
+
selectedFilter,
|
|
19459
|
+
filterOn
|
|
19460
|
+
);
|
|
19461
|
+
}
|
|
19462
|
+
if (reference2) {
|
|
19463
|
+
filterOn = reference2.sourceField;
|
|
19464
|
+
} else {
|
|
19465
|
+
filterOn = path2 || filterOn;
|
|
19466
|
+
}
|
|
19467
|
+
switch (selectedFilter) {
|
|
19468
|
+
case "none":
|
|
19469
|
+
return {};
|
|
19470
|
+
case "startsWith":
|
|
19471
|
+
return { [filterOn]: { _ilike: `${filterValue}%` } };
|
|
19472
|
+
case "endsWith":
|
|
19473
|
+
return { [filterOn]: { _ilike: `%${filterValue}` } };
|
|
19474
|
+
case "contains":
|
|
19475
|
+
return { [filterOn]: { _ilike: `%${filterValue}%` } };
|
|
19476
|
+
case "notContains":
|
|
19477
|
+
return { [filterOn]: { _not_ilike: `%${filterValue}%` } };
|
|
19478
|
+
case "isExactly":
|
|
19479
|
+
return { [filterOn]: { _eq: filterValue } };
|
|
19480
|
+
case "isEmpty":
|
|
19481
|
+
return {
|
|
19482
|
+
_or: [
|
|
19483
|
+
{ [filterOn]: { _eq: "" } },
|
|
19484
|
+
{ [filterOn]: { _is_null: true } }
|
|
19485
|
+
]
|
|
19486
|
+
};
|
|
19487
|
+
case "notEmpty":
|
|
19488
|
+
return {
|
|
19489
|
+
_and: [
|
|
19490
|
+
{ [filterOn]: { _neq: "" } },
|
|
19491
|
+
{ [filterOn]: { _is_null: false } }
|
|
19492
|
+
]
|
|
19493
|
+
};
|
|
19494
|
+
case "inList":
|
|
19495
|
+
return { [filterOn]: { _in: filterValue } };
|
|
19496
|
+
case "notInList":
|
|
19497
|
+
return { [filterOn]: { _nin: filterValue } };
|
|
19498
|
+
case "true":
|
|
19499
|
+
return { [filterOn]: { _eq: true } };
|
|
19500
|
+
case "false":
|
|
19501
|
+
return { [filterOn]: { _eq: false } };
|
|
19502
|
+
case "dateIs":
|
|
19503
|
+
return { [filterOn]: { _eq: filterValue } };
|
|
19504
|
+
case "notBetween":
|
|
19505
|
+
return {
|
|
19506
|
+
_or: [
|
|
19507
|
+
{
|
|
19508
|
+
[filterOn]: {
|
|
19509
|
+
_lt: new Date(arrayFilterValue[0])
|
|
19510
|
+
}
|
|
19511
|
+
},
|
|
19512
|
+
{
|
|
19513
|
+
[filterOn]: {
|
|
19514
|
+
_gt: new Date(
|
|
19515
|
+
new Date(arrayFilterValue[1]).setHours(23, 59)
|
|
19516
|
+
)
|
|
19517
|
+
}
|
|
19461
19518
|
}
|
|
19519
|
+
]
|
|
19520
|
+
};
|
|
19521
|
+
case "isBetween":
|
|
19522
|
+
return {
|
|
19523
|
+
[filterOn]: {
|
|
19524
|
+
_gte: new Date(arrayFilterValue[0]),
|
|
19525
|
+
_lte: new Date(new Date(arrayFilterValue[1]).setHours(23, 59))
|
|
19462
19526
|
}
|
|
19463
|
-
return new Date(e2);
|
|
19464
|
-
}(t3), this.init();
|
|
19465
|
-
}, m3.init = function() {
|
|
19466
|
-
var t3 = this.$d;
|
|
19467
|
-
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();
|
|
19468
|
-
}, m3.$utils = function() {
|
|
19469
|
-
return b2;
|
|
19470
|
-
}, m3.isValid = function() {
|
|
19471
|
-
return !(this.$d.toString() === l2);
|
|
19472
|
-
}, m3.isSame = function(t3, e2) {
|
|
19473
|
-
var n3 = O2(t3);
|
|
19474
|
-
return this.startOf(e2) <= n3 && n3 <= this.endOf(e2);
|
|
19475
|
-
}, m3.isAfter = function(t3, e2) {
|
|
19476
|
-
return O2(t3) < this.startOf(e2);
|
|
19477
|
-
}, m3.isBefore = function(t3, e2) {
|
|
19478
|
-
return this.endOf(e2) < O2(t3);
|
|
19479
|
-
}, m3.$g = function(t3, e2, n3) {
|
|
19480
|
-
return b2.u(t3) ? this[e2] : this.set(n3, t3);
|
|
19481
|
-
}, m3.unix = function() {
|
|
19482
|
-
return Math.floor(this.valueOf() / 1e3);
|
|
19483
|
-
}, m3.valueOf = function() {
|
|
19484
|
-
return this.$d.getTime();
|
|
19485
|
-
}, m3.startOf = function(t3, e2) {
|
|
19486
|
-
var n3 = this, r3 = !!b2.u(e2) || e2, f3 = b2.p(t3), l3 = /* @__PURE__ */ __name(function(t4, e3) {
|
|
19487
|
-
var i3 = b2.w(n3.$u ? Date.UTC(n3.$y, e3, t4) : new Date(n3.$y, e3, t4), n3);
|
|
19488
|
-
return r3 ? i3 : i3.endOf(a2);
|
|
19489
|
-
}, "l"), $2 = /* @__PURE__ */ __name(function(t4, e3) {
|
|
19490
|
-
return b2.w(n3.toDate()[t4].apply(n3.toDate("s"), (r3 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n3);
|
|
19491
|
-
}, "$"), y3 = this.$W, M4 = this.$M, m4 = this.$D, v3 = "set" + (this.$u ? "UTC" : "");
|
|
19492
|
-
switch (f3) {
|
|
19493
|
-
case h2:
|
|
19494
|
-
return r3 ? l3(1, 0) : l3(31, 11);
|
|
19495
|
-
case c2:
|
|
19496
|
-
return r3 ? l3(1, M4) : l3(0, M4 + 1);
|
|
19497
|
-
case o2:
|
|
19498
|
-
var g3 = this.$locale().weekStart || 0, D3 = (y3 < g3 ? y3 + 7 : y3) - g3;
|
|
19499
|
-
return l3(r3 ? m4 - D3 : m4 + (6 - D3), M4);
|
|
19500
|
-
case a2:
|
|
19501
|
-
case d2:
|
|
19502
|
-
return $2(v3 + "Hours", 0);
|
|
19503
|
-
case u2:
|
|
19504
|
-
return $2(v3 + "Minutes", 1);
|
|
19505
|
-
case s2:
|
|
19506
|
-
return $2(v3 + "Seconds", 2);
|
|
19507
|
-
case i2:
|
|
19508
|
-
return $2(v3 + "Milliseconds", 3);
|
|
19509
|
-
default:
|
|
19510
|
-
return this.clone();
|
|
19511
|
-
}
|
|
19512
|
-
}, m3.endOf = function(t3) {
|
|
19513
|
-
return this.startOf(t3, false);
|
|
19514
|
-
}, m3.$set = function(t3, e2) {
|
|
19515
|
-
var n3, o3 = b2.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[i2] = f3 + "Seconds", n3[r2] = f3 + "Milliseconds", n3)[o3], $2 = o3 === a2 ? this.$D + (e2 - this.$W) : e2;
|
|
19516
|
-
if (o3 === c2 || o3 === h2) {
|
|
19517
|
-
var y3 = this.clone().set(d2, 1);
|
|
19518
|
-
y3.$d[l3]($2), y3.init(), this.$d = y3.set(d2, Math.min(this.$D, y3.daysInMonth())).$d;
|
|
19519
|
-
} else l3 && this.$d[l3]($2);
|
|
19520
|
-
return this.init(), this;
|
|
19521
|
-
}, m3.set = function(t3, e2) {
|
|
19522
|
-
return this.clone().$set(t3, e2);
|
|
19523
|
-
}, m3.get = function(t3) {
|
|
19524
|
-
return this[b2.p(t3)]();
|
|
19525
|
-
}, m3.add = function(r3, f3) {
|
|
19526
|
-
var d3, l3 = this;
|
|
19527
|
-
r3 = Number(r3);
|
|
19528
|
-
var $2 = b2.p(f3), y3 = /* @__PURE__ */ __name(function(t3) {
|
|
19529
|
-
var e2 = O2(l3);
|
|
19530
|
-
return b2.w(e2.date(e2.date() + Math.round(t3 * r3)), l3);
|
|
19531
|
-
}, "y");
|
|
19532
|
-
if ($2 === c2) return this.set(c2, this.$M + r3);
|
|
19533
|
-
if ($2 === h2) return this.set(h2, this.$y + r3);
|
|
19534
|
-
if ($2 === a2) return y3(1);
|
|
19535
|
-
if ($2 === o2) return y3(7);
|
|
19536
|
-
var M4 = (d3 = {}, d3[s2] = e, d3[u2] = n2, d3[i2] = t2, d3)[$2] || 1, m4 = this.$d.getTime() + r3 * M4;
|
|
19537
|
-
return b2.w(m4, this);
|
|
19538
|
-
}, m3.subtract = function(t3, e2) {
|
|
19539
|
-
return this.add(-1 * t3, e2);
|
|
19540
|
-
}, m3.format = function(t3) {
|
|
19541
|
-
var e2 = this, n3 = this.$locale();
|
|
19542
|
-
if (!this.isValid()) return n3.invalidDate || l2;
|
|
19543
|
-
var r3 = t3 || "YYYY-MM-DDTHH:mm:ssZ", i3 = b2.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, i4, s4) {
|
|
19544
|
-
return t4 && (t4[n4] || t4(e2, r3)) || i4[n4].slice(0, s4);
|
|
19545
|
-
}, "h"), d3 = /* @__PURE__ */ __name(function(t4) {
|
|
19546
|
-
return b2.s(s3 % 12 || 12, t4, "0");
|
|
19547
|
-
}, "d"), $2 = f3 || function(t4, e3, n4) {
|
|
19548
|
-
var r4 = t4 < 12 ? "AM" : "PM";
|
|
19549
|
-
return n4 ? r4.toLowerCase() : r4;
|
|
19550
19527
|
};
|
|
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
|
-
case "H":
|
|
19579
|
-
return String(s3);
|
|
19580
|
-
case "HH":
|
|
19581
|
-
return b2.s(s3, 2, "0");
|
|
19582
|
-
case "h":
|
|
19583
|
-
return d3(1);
|
|
19584
|
-
case "hh":
|
|
19585
|
-
return d3(2);
|
|
19586
|
-
case "a":
|
|
19587
|
-
return $2(s3, u3, true);
|
|
19588
|
-
case "A":
|
|
19589
|
-
return $2(s3, u3, false);
|
|
19590
|
-
case "m":
|
|
19591
|
-
return String(u3);
|
|
19592
|
-
case "mm":
|
|
19593
|
-
return b2.s(u3, 2, "0");
|
|
19594
|
-
case "s":
|
|
19595
|
-
return String(e2.$s);
|
|
19596
|
-
case "ss":
|
|
19597
|
-
return b2.s(e2.$s, 2, "0");
|
|
19598
|
-
case "SSS":
|
|
19599
|
-
return b2.s(e2.$ms, 3, "0");
|
|
19600
|
-
case "Z":
|
|
19601
|
-
return i3;
|
|
19528
|
+
case "isBefore":
|
|
19529
|
+
return { [filterOn]: { _lt: new Date(filterValue) } };
|
|
19530
|
+
case "isAfter":
|
|
19531
|
+
return { [filterOn]: { _gt: new Date(filterValue) } };
|
|
19532
|
+
case "greaterThan":
|
|
19533
|
+
return { [filterOn]: { _gt: parseFloat(filterValue) } };
|
|
19534
|
+
case "lessThan":
|
|
19535
|
+
return { [filterOn]: { _lt: parseFloat(filterValue) } };
|
|
19536
|
+
case "inRange":
|
|
19537
|
+
return {
|
|
19538
|
+
[filterOn]: {
|
|
19539
|
+
_gte: parseFloat(arrayFilterValue[0]),
|
|
19540
|
+
_lte: parseFloat(arrayFilterValue[1])
|
|
19541
|
+
}
|
|
19542
|
+
};
|
|
19543
|
+
case "outsideRange":
|
|
19544
|
+
return {
|
|
19545
|
+
_or: [
|
|
19546
|
+
{
|
|
19547
|
+
[filterOn]: {
|
|
19548
|
+
_lt: parseFloat(arrayFilterValue[0])
|
|
19549
|
+
}
|
|
19550
|
+
},
|
|
19551
|
+
{
|
|
19552
|
+
[filterOn]: {
|
|
19553
|
+
_gt: parseFloat(arrayFilterValue[1])
|
|
19554
|
+
}
|
|
19602
19555
|
}
|
|
19603
|
-
|
|
19604
|
-
|
|
19605
|
-
|
|
19606
|
-
|
|
19607
|
-
|
|
19608
|
-
|
|
19609
|
-
|
|
19610
|
-
|
|
19611
|
-
|
|
19612
|
-
|
|
19613
|
-
|
|
19614
|
-
|
|
19556
|
+
]
|
|
19557
|
+
};
|
|
19558
|
+
case "equalTo":
|
|
19559
|
+
return {
|
|
19560
|
+
[filterOn]: {
|
|
19561
|
+
_eq: type2 === "number" || type2 === "integer" ? parseFloat(filterValue) : filterValue
|
|
19562
|
+
}
|
|
19563
|
+
};
|
|
19564
|
+
case "regex":
|
|
19565
|
+
return { [filterOn]: { _regex: filterValue } };
|
|
19566
|
+
default:
|
|
19567
|
+
console.warn(`Unsupported filter type: ${selectedFilter}`);
|
|
19568
|
+
return {};
|
|
19569
|
+
}
|
|
19570
|
+
}).map((filter2) => {
|
|
19571
|
+
const o2 = {};
|
|
19572
|
+
set$1(o2, Object.keys(filter2)[0], filter2[Object.keys(filter2)[0]]);
|
|
19573
|
+
return o2;
|
|
19574
|
+
});
|
|
19575
|
+
if (filterClauses.length > 0) {
|
|
19576
|
+
if (Object.keys(where).length > 0) {
|
|
19577
|
+
where = { _and: [where, ...filterClauses] };
|
|
19578
|
+
} else {
|
|
19579
|
+
where = { _and: filterClauses };
|
|
19580
|
+
}
|
|
19581
|
+
}
|
|
19582
|
+
}
|
|
19583
|
+
if (order2 && order2.length > 0) {
|
|
19584
|
+
order2.forEach((item) => {
|
|
19585
|
+
const field = item.startsWith("-") ? item.substring(1) : item;
|
|
19586
|
+
const direction = item.startsWith("-") ? "desc" : "asc";
|
|
19587
|
+
order_by[field] = direction;
|
|
19588
|
+
});
|
|
19589
|
+
}
|
|
19590
|
+
if (additionalFilter) {
|
|
19591
|
+
where = { _and: [where, additionalFilter] };
|
|
19592
|
+
}
|
|
19593
|
+
return { where, order_by, limit, offset: offset3 };
|
|
19594
|
+
}
|
|
19595
|
+
__name(tableQueryParamsToHasuraClauses, "tableQueryParamsToHasuraClauses");
|
|
19596
|
+
function getFieldsMappedByCCDisplayName(schema) {
|
|
19597
|
+
if (!schema || !schema.fields) return {};
|
|
19598
|
+
return schema.fields.reduce((acc, field) => {
|
|
19599
|
+
const ccDisplayName = getCCDisplayName(field);
|
|
19600
|
+
acc[ccDisplayName] = field;
|
|
19601
|
+
return acc;
|
|
19602
|
+
}, {});
|
|
19603
|
+
}
|
|
19604
|
+
__name(getFieldsMappedByCCDisplayName, "getFieldsMappedByCCDisplayName");
|
|
19605
|
+
function getCCDisplayName(field) {
|
|
19606
|
+
return camelCase(
|
|
19607
|
+
typeof field.displayName === "string" ? field.displayName : field.path
|
|
19608
|
+
);
|
|
19609
|
+
}
|
|
19610
|
+
__name(getCCDisplayName, "getCCDisplayName");
|
|
19611
|
+
function filterLocalEntitiesToHasura(records, { where, order_by, limit, offset: offset3, isInfinite } = {}) {
|
|
19612
|
+
let filteredRecords = [...records];
|
|
19613
|
+
if (where) {
|
|
19614
|
+
filteredRecords = applyWhereClause(filteredRecords, where);
|
|
19615
|
+
}
|
|
19616
|
+
if (order_by) {
|
|
19617
|
+
filteredRecords = applyOrderBy(filteredRecords, order_by);
|
|
19618
|
+
}
|
|
19619
|
+
const allFilteredRecords = [...filteredRecords];
|
|
19620
|
+
if (!isInfinite && offset3 !== void 0) {
|
|
19621
|
+
filteredRecords = filteredRecords.slice(offset3);
|
|
19622
|
+
}
|
|
19623
|
+
if (!isInfinite && limit !== void 0) {
|
|
19624
|
+
filteredRecords = filteredRecords.slice(0, limit);
|
|
19625
|
+
}
|
|
19626
|
+
return {
|
|
19627
|
+
entities: filteredRecords,
|
|
19628
|
+
entitiesAcrossPages: allFilteredRecords,
|
|
19629
|
+
entityCount: allFilteredRecords.length
|
|
19630
|
+
};
|
|
19631
|
+
}
|
|
19632
|
+
__name(filterLocalEntitiesToHasura, "filterLocalEntitiesToHasura");
|
|
19633
|
+
function applyWhereClause(records, where) {
|
|
19634
|
+
function applyFilter(record, filter2) {
|
|
19635
|
+
if (isEmpty$1(filter2)) {
|
|
19636
|
+
return true;
|
|
19637
|
+
}
|
|
19638
|
+
for (const key in filter2) {
|
|
19639
|
+
if (key === "_and") {
|
|
19640
|
+
if (isEmpty$1(filter2[key])) {
|
|
19641
|
+
continue;
|
|
19642
|
+
}
|
|
19643
|
+
if (!every(filter2[key], (subFilter) => applyFilter(record, subFilter))) {
|
|
19644
|
+
return false;
|
|
19645
|
+
}
|
|
19646
|
+
} else if (key === "_or") {
|
|
19647
|
+
if (isEmpty$1(filter2[key])) {
|
|
19648
|
+
continue;
|
|
19649
|
+
}
|
|
19650
|
+
if (!some(filter2[key], (subFilter) => applyFilter(record, subFilter))) {
|
|
19651
|
+
return false;
|
|
19652
|
+
}
|
|
19653
|
+
} else if (key === "_not") {
|
|
19654
|
+
if (applyFilter(record, filter2[key])) {
|
|
19655
|
+
return false;
|
|
19656
|
+
}
|
|
19657
|
+
} else {
|
|
19658
|
+
const value = record[key];
|
|
19659
|
+
const conditions = filter2[key];
|
|
19660
|
+
if (isObject$2(value) && isObject$2(conditions) && !hasOperator(conditions)) {
|
|
19661
|
+
return applyFilter(value, conditions);
|
|
19662
|
+
}
|
|
19663
|
+
for (const operator in conditions) {
|
|
19664
|
+
const conditionValue = conditions[operator];
|
|
19665
|
+
if (operator === "_gt" && conditions._lt) {
|
|
19666
|
+
if (!(value > conditionValue && value < conditions._lt))
|
|
19667
|
+
return false;
|
|
19668
|
+
continue;
|
|
19669
|
+
}
|
|
19670
|
+
if (operator === "_gte" && conditions._lte) {
|
|
19671
|
+
if (!(value >= conditionValue && value <= conditions._lte))
|
|
19672
|
+
return false;
|
|
19673
|
+
continue;
|
|
19674
|
+
}
|
|
19675
|
+
switch (operator) {
|
|
19676
|
+
case "_eq":
|
|
19677
|
+
if (!isEqual(value, conditionValue)) return false;
|
|
19615
19678
|
break;
|
|
19616
|
-
case
|
|
19617
|
-
|
|
19679
|
+
case "_neq":
|
|
19680
|
+
if (isEqual(value, conditionValue)) return false;
|
|
19618
19681
|
break;
|
|
19619
|
-
case
|
|
19620
|
-
|
|
19682
|
+
case "_gt":
|
|
19683
|
+
if (!(value > conditionValue)) return false;
|
|
19621
19684
|
break;
|
|
19622
|
-
case
|
|
19623
|
-
|
|
19685
|
+
case "_gte":
|
|
19686
|
+
if (!(value >= conditionValue)) return false;
|
|
19624
19687
|
break;
|
|
19625
|
-
case
|
|
19626
|
-
|
|
19688
|
+
case "_lt":
|
|
19689
|
+
if (!(value < conditionValue)) return false;
|
|
19627
19690
|
break;
|
|
19628
|
-
case
|
|
19629
|
-
|
|
19691
|
+
case "_lte":
|
|
19692
|
+
if (!(value <= conditionValue)) return false;
|
|
19630
19693
|
break;
|
|
19631
|
-
case
|
|
19632
|
-
$
|
|
19694
|
+
case "_like":
|
|
19695
|
+
if (!isString$1(value) || !new RegExp(conditionValue.replace(/%/g, ".*")).test(value))
|
|
19696
|
+
return false;
|
|
19633
19697
|
break;
|
|
19634
|
-
case
|
|
19635
|
-
$
|
|
19698
|
+
case "_ilike":
|
|
19699
|
+
if (!isString$1(value) || !new RegExp(conditionValue.replace(/%/g, ".*"), "i").test(value))
|
|
19700
|
+
return false;
|
|
19701
|
+
break;
|
|
19702
|
+
case "_nlike":
|
|
19703
|
+
if (!isString$1(value) || new RegExp(conditionValue.replace(/%/g, ".*")).test(value))
|
|
19704
|
+
return false;
|
|
19705
|
+
break;
|
|
19706
|
+
case "_nilike":
|
|
19707
|
+
if (!isString$1(value) || new RegExp(conditionValue.replace(/%/g, ".*"), "i").test(value))
|
|
19708
|
+
return false;
|
|
19709
|
+
break;
|
|
19710
|
+
case "_starts_with":
|
|
19711
|
+
if (!isString$1(value) || !value.startsWith(conditionValue))
|
|
19712
|
+
return false;
|
|
19713
|
+
break;
|
|
19714
|
+
case "_ends_with":
|
|
19715
|
+
if (!isString$1(value) || !value.endsWith(conditionValue))
|
|
19716
|
+
return false;
|
|
19717
|
+
break;
|
|
19718
|
+
case "_is_null":
|
|
19719
|
+
if (conditionValue && !isNull(value) || !conditionValue && isNull(value))
|
|
19720
|
+
return false;
|
|
19721
|
+
break;
|
|
19722
|
+
case "_contains":
|
|
19723
|
+
if (!isArray$2(value) || !every(conditionValue, (item) => includes(value, item)))
|
|
19724
|
+
return false;
|
|
19725
|
+
break;
|
|
19726
|
+
case "_contained_in":
|
|
19727
|
+
if (!isArray$2(value) || !every(value, (item) => includes(conditionValue, item)))
|
|
19728
|
+
return false;
|
|
19729
|
+
break;
|
|
19730
|
+
case "_has_key":
|
|
19731
|
+
if (!isObject$2(value) || !has$1(value, conditionValue)) return false;
|
|
19732
|
+
break;
|
|
19733
|
+
case "_has_keys_any":
|
|
19734
|
+
if (!isObject$2(value) || !some(conditionValue, (item) => has$1(value, item)))
|
|
19735
|
+
return false;
|
|
19736
|
+
break;
|
|
19737
|
+
case "_has_keys_all":
|
|
19738
|
+
if (!isObject$2(value) || !every(conditionValue, (item) => has$1(value, item)))
|
|
19739
|
+
return false;
|
|
19740
|
+
break;
|
|
19741
|
+
case "_similar":
|
|
19742
|
+
if (!isString$1(value) || !new RegExp(conditionValue.replace(/%/g, ".*")).test(value))
|
|
19743
|
+
return false;
|
|
19636
19744
|
break;
|
|
19637
19745
|
default:
|
|
19638
|
-
|
|
19746
|
+
if (operator.startsWith("_")) {
|
|
19747
|
+
console.warn(`Unsupported operator: ${operator}`);
|
|
19748
|
+
return false;
|
|
19749
|
+
} else {
|
|
19750
|
+
console.warn(`Unsupported operator: ${operator}`);
|
|
19751
|
+
return false;
|
|
19752
|
+
}
|
|
19639
19753
|
}
|
|
19640
|
-
|
|
19641
|
-
|
|
19642
|
-
|
|
19643
|
-
|
|
19644
|
-
|
|
19645
|
-
|
|
19646
|
-
|
|
19647
|
-
|
|
19648
|
-
|
|
19649
|
-
|
|
19650
|
-
|
|
19651
|
-
|
|
19652
|
-
|
|
19653
|
-
|
|
19654
|
-
|
|
19655
|
-
|
|
19656
|
-
|
|
19657
|
-
|
|
19658
|
-
|
|
19659
|
-
|
|
19660
|
-
|
|
19661
|
-
|
|
19662
|
-
|
|
19663
|
-
|
|
19664
|
-
|
|
19665
|
-
|
|
19666
|
-
|
|
19667
|
-
|
|
19668
|
-
|
|
19669
|
-
|
|
19670
|
-
}
|
|
19671
|
-
}
|
|
19672
|
-
|
|
19673
|
-
}
|
|
19674
|
-
__name(
|
|
19675
|
-
|
|
19676
|
-
|
|
19754
|
+
}
|
|
19755
|
+
}
|
|
19756
|
+
}
|
|
19757
|
+
return true;
|
|
19758
|
+
}
|
|
19759
|
+
__name(applyFilter, "applyFilter");
|
|
19760
|
+
function hasOperator(obj) {
|
|
19761
|
+
return Object.keys(obj).some((key) => key.startsWith("_"));
|
|
19762
|
+
}
|
|
19763
|
+
__name(hasOperator, "hasOperator");
|
|
19764
|
+
return records.filter((record) => applyFilter(record, where));
|
|
19765
|
+
}
|
|
19766
|
+
__name(applyWhereClause, "applyWhereClause");
|
|
19767
|
+
function applyOrderBy(records, order_by) {
|
|
19768
|
+
const keys2 = Object.keys(order_by);
|
|
19769
|
+
if (keys2.length > 0) {
|
|
19770
|
+
const field = keys2[0];
|
|
19771
|
+
const direction = order_by[field] === "asc" ? "asc" : "desc";
|
|
19772
|
+
return orderBy$1(records, [field], [direction]);
|
|
19773
|
+
}
|
|
19774
|
+
return records;
|
|
19775
|
+
}
|
|
19776
|
+
__name(applyOrderBy, "applyOrderBy");
|
|
19777
|
+
function initializeHasuraWhereAndFilter(additionalFilter, where = {}, currentParams) {
|
|
19778
|
+
where._and = where._and || [];
|
|
19779
|
+
where._or = where._or || [];
|
|
19780
|
+
if (typeof additionalFilter === "function") {
|
|
19781
|
+
const newWhere = additionalFilter(where, currentParams);
|
|
19782
|
+
if (newWhere) {
|
|
19783
|
+
where = __spreadValues(__spreadValues({}, where), newWhere);
|
|
19784
|
+
}
|
|
19785
|
+
} else if (typeof additionalFilter === "object")
|
|
19786
|
+
where._and.push(additionalFilter);
|
|
19787
|
+
}
|
|
19788
|
+
__name(initializeHasuraWhereAndFilter, "initializeHasuraWhereAndFilter");
|
|
19789
|
+
const addCustomColumnFilters = /* @__PURE__ */ __name((where, fields, currentParams) => {
|
|
19790
|
+
fields.forEach((field) => {
|
|
19791
|
+
const { customColumnFilter, filterDisabled } = field;
|
|
19792
|
+
if (filterDisabled || !customColumnFilter) return;
|
|
19793
|
+
customColumnFilter(where, currentParams);
|
|
19794
|
+
});
|
|
19795
|
+
}, "addCustomColumnFilters");
|
|
19677
19796
|
const defaultPageSizes = [5, 10, 15, 25, 50, 100, 200, 400];
|
|
19678
19797
|
function safeStringify(val) {
|
|
19679
19798
|
if (val !== null && typeof val === "object") {
|
|
@@ -19690,325 +19809,6 @@ function safeParse(val) {
|
|
|
19690
19809
|
}
|
|
19691
19810
|
}
|
|
19692
19811
|
__name(safeParse, "safeParse");
|
|
19693
|
-
function getCCDisplayName(field) {
|
|
19694
|
-
return camelCase(
|
|
19695
|
-
typeof field.displayName === "string" ? field.displayName : field.path
|
|
19696
|
-
);
|
|
19697
|
-
}
|
|
19698
|
-
__name(getCCDisplayName, "getCCDisplayName");
|
|
19699
|
-
function getFieldsMappedByCCDisplayName(schema) {
|
|
19700
|
-
return schema.fields.reduce((acc, field) => {
|
|
19701
|
-
const ccDisplayName = getCCDisplayName(field);
|
|
19702
|
-
acc[ccDisplayName] = field;
|
|
19703
|
-
return acc;
|
|
19704
|
-
}, {});
|
|
19705
|
-
}
|
|
19706
|
-
__name(getFieldsMappedByCCDisplayName, "getFieldsMappedByCCDisplayName");
|
|
19707
|
-
function orderEntitiesLocal(orderArray, entities, schema, ownProps) {
|
|
19708
|
-
if (orderArray == null ? void 0 : orderArray.length) {
|
|
19709
|
-
const orderFuncs = [];
|
|
19710
|
-
const ascOrDescArray = [];
|
|
19711
|
-
orderArray.forEach((order2) => {
|
|
19712
|
-
const ccDisplayName = order2.replace(/^-/gi, "");
|
|
19713
|
-
const ccFields = getFieldsMappedByCCDisplayName(schema);
|
|
19714
|
-
const field = ccFields[ccDisplayName];
|
|
19715
|
-
if (!field) {
|
|
19716
|
-
throw new Error(
|
|
19717
|
-
"Ruh roh, there should have been a column to sort on for " + order2 + " but none was found in " + schema.fields
|
|
19718
|
-
);
|
|
19719
|
-
}
|
|
19720
|
-
const { path: path2, getValueToFilterOn, sortFn } = field;
|
|
19721
|
-
if (field.type === "timestamp") {
|
|
19722
|
-
ascOrDescArray.push("desc");
|
|
19723
|
-
}
|
|
19724
|
-
ascOrDescArray.push(ccDisplayName === order2 ? "asc" : "desc");
|
|
19725
|
-
if (field.type === "timestamp") {
|
|
19726
|
-
orderFuncs.push((r2) => {
|
|
19727
|
-
const val = get$3(r2, path2);
|
|
19728
|
-
return !!val;
|
|
19729
|
-
});
|
|
19730
|
-
}
|
|
19731
|
-
if (path2 && endsWith$1(path2.toLowerCase(), "id")) {
|
|
19732
|
-
orderFuncs.push((o2) => {
|
|
19733
|
-
return parseInt(get$3(o2, path2), 10);
|
|
19734
|
-
});
|
|
19735
|
-
} else if (sortFn) {
|
|
19736
|
-
const toOrder = Array.isArray(sortFn) ? sortFn : [sortFn];
|
|
19737
|
-
orderFuncs.push(...toOrder);
|
|
19738
|
-
} else if (getValueToFilterOn) {
|
|
19739
|
-
orderFuncs.push((o2) => {
|
|
19740
|
-
return getValueToFilterOn(o2, ownProps);
|
|
19741
|
-
});
|
|
19742
|
-
} else {
|
|
19743
|
-
orderFuncs.push((r2) => {
|
|
19744
|
-
const val = get$3(r2, path2);
|
|
19745
|
-
return val && val.toLowerCase ? val.toLowerCase() : val;
|
|
19746
|
-
});
|
|
19747
|
-
}
|
|
19748
|
-
});
|
|
19749
|
-
entities = orderBy$1(entities, orderFuncs, ascOrDescArray);
|
|
19750
|
-
}
|
|
19751
|
-
return entities;
|
|
19752
|
-
}
|
|
19753
|
-
__name(orderEntitiesLocal, "orderEntitiesLocal");
|
|
19754
|
-
function getAndAndOrFilters(allFilters) {
|
|
19755
|
-
const orFilters = [];
|
|
19756
|
-
const andFilters = [];
|
|
19757
|
-
const otherOrFilters = [];
|
|
19758
|
-
allFilters.forEach((filter2) => {
|
|
19759
|
-
if (filter2.isOrFilter && typeof filter2.filterValue === "string" && filter2.filterValue.includes(",")) {
|
|
19760
|
-
const allFilterValues = filter2.filterValue.split(",");
|
|
19761
|
-
allFilterValues.forEach((filterValue, i2) => {
|
|
19762
|
-
filterValue = filterValue.trim();
|
|
19763
|
-
if (!filterValue) return;
|
|
19764
|
-
const newFilter = __spreadProps(__spreadValues({}, filter2), {
|
|
19765
|
-
filterValue
|
|
19766
|
-
});
|
|
19767
|
-
if (i2 === 0) {
|
|
19768
|
-
orFilters.push(newFilter);
|
|
19769
|
-
} else {
|
|
19770
|
-
const iMinus = i2 - 1;
|
|
19771
|
-
if (!otherOrFilters[iMinus]) otherOrFilters[iMinus] = [];
|
|
19772
|
-
otherOrFilters[iMinus].push(newFilter);
|
|
19773
|
-
}
|
|
19774
|
-
});
|
|
19775
|
-
} else if (filter2.isOrFilter) {
|
|
19776
|
-
orFilters.push(filter2);
|
|
19777
|
-
} else {
|
|
19778
|
-
andFilters.push(filter2);
|
|
19779
|
-
}
|
|
19780
|
-
});
|
|
19781
|
-
return {
|
|
19782
|
-
orFilters,
|
|
19783
|
-
andFilters,
|
|
19784
|
-
otherOrFilters
|
|
19785
|
-
};
|
|
19786
|
-
}
|
|
19787
|
-
__name(getAndAndOrFilters, "getAndAndOrFilters");
|
|
19788
|
-
function filterEntitiesLocal(filters = [], searchTerm, entities, schema, ownProps) {
|
|
19789
|
-
const allFilters = getAllFilters(filters, searchTerm, schema);
|
|
19790
|
-
if (allFilters.length) {
|
|
19791
|
-
const ccFields = getFieldsMappedByCCDisplayName(schema);
|
|
19792
|
-
const { andFilters, orFilters, otherOrFilters } = getAndAndOrFilters(allFilters);
|
|
19793
|
-
andFilters.forEach((filter2) => {
|
|
19794
|
-
entities = getEntitiesForGivenFilter(
|
|
19795
|
-
entities,
|
|
19796
|
-
filter2,
|
|
19797
|
-
ccFields,
|
|
19798
|
-
ownProps
|
|
19799
|
-
);
|
|
19800
|
-
});
|
|
19801
|
-
if (orFilters.length) {
|
|
19802
|
-
let orEntities = [];
|
|
19803
|
-
orFilters.concat(...otherOrFilters).forEach((filter2) => {
|
|
19804
|
-
orEntities = orEntities.concat(
|
|
19805
|
-
getEntitiesForGivenFilter(entities, filter2, ccFields, ownProps)
|
|
19806
|
-
);
|
|
19807
|
-
});
|
|
19808
|
-
entities = uniq(orEntities);
|
|
19809
|
-
}
|
|
19810
|
-
}
|
|
19811
|
-
return entities;
|
|
19812
|
-
}
|
|
19813
|
-
__name(filterEntitiesLocal, "filterEntitiesLocal");
|
|
19814
|
-
function cleanFilterValue(_filterValue, type2) {
|
|
19815
|
-
let filterValue = _filterValue;
|
|
19816
|
-
if (type2 === "number" || type2 === "integer") {
|
|
19817
|
-
filterValue = Array.isArray(filterValue) ? filterValue.map((val) => Number(val)) : Number(filterValue);
|
|
19818
|
-
}
|
|
19819
|
-
return filterValue;
|
|
19820
|
-
}
|
|
19821
|
-
__name(cleanFilterValue, "cleanFilterValue");
|
|
19822
|
-
function getEntitiesForGivenFilter(entities, filter2, ccFields, ownProps) {
|
|
19823
|
-
const { filterOn, filterValue: _filterValue, selectedFilter } = filter2;
|
|
19824
|
-
const field = ccFields[filterOn];
|
|
19825
|
-
const { path: path2, getValueToFilterOn } = field;
|
|
19826
|
-
const filterValue = cleanFilterValue(_filterValue, field.type);
|
|
19827
|
-
const subFilter = getSubFilter(false, selectedFilter, filterValue);
|
|
19828
|
-
entities = entities.filter((entity) => {
|
|
19829
|
-
const fieldVal = getValueToFilterOn ? getValueToFilterOn(entity, ownProps) : get$3(entity, path2);
|
|
19830
|
-
const shouldKeep = subFilter(fieldVal);
|
|
19831
|
-
return shouldKeep;
|
|
19832
|
-
});
|
|
19833
|
-
return entities;
|
|
19834
|
-
}
|
|
19835
|
-
__name(getEntitiesForGivenFilter, "getEntitiesForGivenFilter");
|
|
19836
|
-
function getFiltersFromSearchTerm(searchTerm, schema) {
|
|
19837
|
-
const searchTermFilters = [];
|
|
19838
|
-
if (searchTerm) {
|
|
19839
|
-
const sharedFields = {
|
|
19840
|
-
isOrFilter: true,
|
|
19841
|
-
isSearchTermFilter: true
|
|
19842
|
-
};
|
|
19843
|
-
schema.fields.forEach((field) => {
|
|
19844
|
-
const { type: type2, searchDisabled } = field;
|
|
19845
|
-
if (searchDisabled || field.filterDisabled || type2 === "color") return;
|
|
19846
|
-
const ccDisplayName = getCCDisplayName(field);
|
|
19847
|
-
const filterValue = cleanFilterValue(searchTerm, type2);
|
|
19848
|
-
if (type2 === "string" || type2 === "lookup") {
|
|
19849
|
-
searchTermFilters.push(__spreadProps(__spreadValues({}, sharedFields), {
|
|
19850
|
-
filterOn: ccDisplayName,
|
|
19851
|
-
filterValue: searchTerm,
|
|
19852
|
-
selectedFilter: "contains"
|
|
19853
|
-
}));
|
|
19854
|
-
} else if (type2 === "boolean") {
|
|
19855
|
-
let regex;
|
|
19856
|
-
try {
|
|
19857
|
-
regex = new RegExp("^" + searchTerm, "ig");
|
|
19858
|
-
} catch (error) {
|
|
19859
|
-
}
|
|
19860
|
-
if (regex) {
|
|
19861
|
-
if ("true".replace(regex, "") !== "true") {
|
|
19862
|
-
searchTermFilters.push(__spreadProps(__spreadValues({}, sharedFields), {
|
|
19863
|
-
filterOn: ccDisplayName,
|
|
19864
|
-
filterValue: true,
|
|
19865
|
-
selectedFilter: "true"
|
|
19866
|
-
}));
|
|
19867
|
-
} else if ("false".replace(regex, "") !== "false") {
|
|
19868
|
-
searchTermFilters.push(__spreadProps(__spreadValues({}, sharedFields), {
|
|
19869
|
-
filterOn: ccDisplayName,
|
|
19870
|
-
filterValue: false,
|
|
19871
|
-
selectedFilter: "false"
|
|
19872
|
-
}));
|
|
19873
|
-
}
|
|
19874
|
-
}
|
|
19875
|
-
} else if ((type2 === "number" || type2 === "integer") && !isNaN(filterValue)) {
|
|
19876
|
-
if (type2 === "integer" && !isInteger(filterValue)) {
|
|
19877
|
-
return;
|
|
19878
|
-
}
|
|
19879
|
-
searchTermFilters.push(__spreadProps(__spreadValues({}, sharedFields), {
|
|
19880
|
-
filterOn: ccDisplayName,
|
|
19881
|
-
filterValue,
|
|
19882
|
-
selectedFilter: "equalTo"
|
|
19883
|
-
}));
|
|
19884
|
-
}
|
|
19885
|
-
});
|
|
19886
|
-
}
|
|
19887
|
-
return searchTermFilters;
|
|
19888
|
-
}
|
|
19889
|
-
__name(getFiltersFromSearchTerm, "getFiltersFromSearchTerm");
|
|
19890
|
-
function getSubFilter(qb, selectedFilter, filterValue) {
|
|
19891
|
-
const ccSelectedFilter = camelCase(selectedFilter);
|
|
19892
|
-
let stringFilterValue = filterValue && filterValue.toString ? filterValue.toString() : filterValue;
|
|
19893
|
-
if (stringFilterValue === false) {
|
|
19894
|
-
stringFilterValue = "false";
|
|
19895
|
-
} else {
|
|
19896
|
-
stringFilterValue = stringFilterValue || "";
|
|
19897
|
-
}
|
|
19898
|
-
const filterValLower = stringFilterValue.toLowerCase && stringFilterValue.toLowerCase();
|
|
19899
|
-
const arrayFilterValue = Array.isArray(filterValue) ? filterValue : stringFilterValue.split(";");
|
|
19900
|
-
if (ccSelectedFilter === "startsWith") {
|
|
19901
|
-
return qb ? qb.startsWith(stringFilterValue) : (fieldVal) => {
|
|
19902
|
-
if (!fieldVal || !fieldVal.toLowerCase) return false;
|
|
19903
|
-
return startsWith(fieldVal.toLowerCase(), filterValLower);
|
|
19904
|
-
};
|
|
19905
|
-
} else if (ccSelectedFilter === "endsWith") {
|
|
19906
|
-
return qb ? qb.endsWith(stringFilterValue) : (fieldVal) => {
|
|
19907
|
-
if (!fieldVal || !fieldVal.toLowerCase) return false;
|
|
19908
|
-
return endsWith$1(fieldVal.toLowerCase(), filterValLower);
|
|
19909
|
-
};
|
|
19910
|
-
} else if (ccSelectedFilter === "contains" || ccSelectedFilter === "notContains") {
|
|
19911
|
-
return qb ? ccSelectedFilter === "contains" ? qb.contains(stringFilterValue.replace(/_/g, "\\_")) : qb.notContains(stringFilterValue.replace(/_/g, "\\_")) : (fieldVal) => {
|
|
19912
|
-
if (!fieldVal || !fieldVal.toLowerCase) return false;
|
|
19913
|
-
return ccSelectedFilter === "contains" ? fieldVal.toLowerCase().replace(filterValLower, "") !== fieldVal.toLowerCase() : fieldVal.toLowerCase().replace(filterValLower, "") === fieldVal.toLowerCase();
|
|
19914
|
-
};
|
|
19915
|
-
} else if (ccSelectedFilter === "inList") {
|
|
19916
|
-
return qb ? qb.inList(arrayFilterValue) : (fieldVal) => {
|
|
19917
|
-
if (!(fieldVal == null ? void 0 : fieldVal.toString)) return false;
|
|
19918
|
-
return arrayFilterValue.map((val) => {
|
|
19919
|
-
if (val) {
|
|
19920
|
-
if (val.toString) return val.toString().toLowerCase();
|
|
19921
|
-
return val.toLowerCase();
|
|
19922
|
-
}
|
|
19923
|
-
return void 0;
|
|
19924
|
-
}).indexOf(fieldVal.toString().toLowerCase()) > -1;
|
|
19925
|
-
};
|
|
19926
|
-
} else if (ccSelectedFilter === "notInList") {
|
|
19927
|
-
return qb ? qb.notInList(arrayFilterValue) : (fieldVal) => {
|
|
19928
|
-
if (!(fieldVal == null ? void 0 : fieldVal.toString)) return false;
|
|
19929
|
-
return arrayFilterValue.map((val) => {
|
|
19930
|
-
if (val) {
|
|
19931
|
-
if (val.toString) return val.toString().toLowerCase();
|
|
19932
|
-
return val.toLowerCase();
|
|
19933
|
-
}
|
|
19934
|
-
return void 0;
|
|
19935
|
-
}).indexOf(fieldVal.toString().toLowerCase()) === -1;
|
|
19936
|
-
};
|
|
19937
|
-
} else if (ccSelectedFilter === "isEmpty") {
|
|
19938
|
-
return qb ? qb.isEmpty() : (fieldVal) => {
|
|
19939
|
-
return !fieldVal;
|
|
19940
|
-
};
|
|
19941
|
-
} else if (ccSelectedFilter === "notEmpty") {
|
|
19942
|
-
return qb ? [qb.notNull(), qb.notEquals("")] : (fieldVal) => {
|
|
19943
|
-
return !!fieldVal;
|
|
19944
|
-
};
|
|
19945
|
-
} else if (ccSelectedFilter === "isExactly") {
|
|
19946
|
-
return qb ? filterValue : (fieldVal) => {
|
|
19947
|
-
return fieldVal === filterValue;
|
|
19948
|
-
};
|
|
19949
|
-
} else if (ccSelectedFilter === "true") {
|
|
19950
|
-
return qb ? qb.equals(true) : (fieldVal) => {
|
|
19951
|
-
return !!fieldVal;
|
|
19952
|
-
};
|
|
19953
|
-
} else if (ccSelectedFilter === "false") {
|
|
19954
|
-
return qb ? qb.equals(false) : (fieldVal) => {
|
|
19955
|
-
return !fieldVal;
|
|
19956
|
-
};
|
|
19957
|
-
} else if (ccSelectedFilter === "isBetween") {
|
|
19958
|
-
return qb ? qb.between(
|
|
19959
|
-
new Date(arrayFilterValue[0]),
|
|
19960
|
-
new Date(new Date(arrayFilterValue[1]).setHours(23, 59))
|
|
19961
|
-
// set end of day for more accurate filtering
|
|
19962
|
-
) : (fieldVal) => {
|
|
19963
|
-
return dayjs(arrayFilterValue[0]).valueOf() <= dayjs(fieldVal).valueOf() && dayjs(fieldVal).valueOf() <= dayjs(arrayFilterValue[1]).valueOf();
|
|
19964
|
-
};
|
|
19965
|
-
} else if (ccSelectedFilter === "notBetween") {
|
|
19966
|
-
return qb ? qb.notBetween(
|
|
19967
|
-
new Date(arrayFilterValue[0]),
|
|
19968
|
-
new Date(new Date(arrayFilterValue[1]).setHours(23, 59))
|
|
19969
|
-
// set end of day for more accurate filtering
|
|
19970
|
-
) : (fieldVal) => {
|
|
19971
|
-
return dayjs(arrayFilterValue[0]).valueOf() > dayjs(fieldVal).valueOf() || dayjs(fieldVal).valueOf() > dayjs(arrayFilterValue[1]).valueOf();
|
|
19972
|
-
};
|
|
19973
|
-
} else if (ccSelectedFilter === "isBefore") {
|
|
19974
|
-
return qb ? qb.lessThan(new Date(filterValue)) : (fieldVal) => {
|
|
19975
|
-
return dayjs(fieldVal).valueOf() < dayjs(filterValue).valueOf();
|
|
19976
|
-
};
|
|
19977
|
-
} else if (ccSelectedFilter === "isAfter") {
|
|
19978
|
-
return qb ? qb.greaterThan(new Date(new Date(filterValue).setHours(23, 59))) : (fieldVal) => {
|
|
19979
|
-
return dayjs(fieldVal).valueOf() > dayjs(filterValue).valueOf();
|
|
19980
|
-
};
|
|
19981
|
-
} else if (ccSelectedFilter === "greaterThan") {
|
|
19982
|
-
return qb ? qb.greaterThan(filterValue) : (fieldVal) => {
|
|
19983
|
-
return fieldVal > filterValue;
|
|
19984
|
-
};
|
|
19985
|
-
} else if (ccSelectedFilter === "lessThan") {
|
|
19986
|
-
return qb ? qb.lessThan(filterValue) : (fieldVal) => {
|
|
19987
|
-
return fieldVal < filterValue;
|
|
19988
|
-
};
|
|
19989
|
-
} else if (ccSelectedFilter === "inRange") {
|
|
19990
|
-
return qb ? qb.between(filterValue[0], filterValue[1]) : (fieldVal) => {
|
|
19991
|
-
return filterValue[0] <= fieldVal && fieldVal <= filterValue[1];
|
|
19992
|
-
};
|
|
19993
|
-
} else if (ccSelectedFilter === "outsideRange") {
|
|
19994
|
-
return qb ? qb.notBetween(filterValue[0], filterValue[1]) : (fieldVal) => {
|
|
19995
|
-
return filterValue[0] > fieldVal || fieldVal > filterValue[1];
|
|
19996
|
-
};
|
|
19997
|
-
} else if (ccSelectedFilter === "equalTo") {
|
|
19998
|
-
return qb ? filterValue : (fieldVal) => {
|
|
19999
|
-
return fieldVal === filterValue;
|
|
20000
|
-
};
|
|
20001
|
-
} else if (ccSelectedFilter === "regex") {
|
|
20002
|
-
return qb ? qb.matchesRegex(filterValue) : (fieldVal) => {
|
|
20003
|
-
new RegExp(filterValue).test(fieldVal);
|
|
20004
|
-
return fieldVal;
|
|
20005
|
-
};
|
|
20006
|
-
}
|
|
20007
|
-
throw new Error(
|
|
20008
|
-
`Unsupported filter ${selectedFilter}. Please make a new filter if you need one`
|
|
20009
|
-
);
|
|
20010
|
-
}
|
|
20011
|
-
__name(getSubFilter, "getSubFilter");
|
|
20012
19812
|
function getCurrentParamsFromUrl(location2, isSimple) {
|
|
20013
19813
|
let { search: search2 } = location2;
|
|
20014
19814
|
if (isSimple) {
|
|
@@ -20080,22 +19880,6 @@ function parseFilters(newParams) {
|
|
|
20080
19880
|
});
|
|
20081
19881
|
}
|
|
20082
19882
|
__name(parseFilters, "parseFilters");
|
|
20083
|
-
function buildRef(qb, reference2, searchField, expression) {
|
|
20084
|
-
if (reference2.reference) {
|
|
20085
|
-
return qb.related(reference2.target).whereAny({
|
|
20086
|
-
[reference2.sourceField]: buildRef(
|
|
20087
|
-
qb,
|
|
20088
|
-
reference2.reference,
|
|
20089
|
-
searchField,
|
|
20090
|
-
expression
|
|
20091
|
-
)
|
|
20092
|
-
});
|
|
20093
|
-
}
|
|
20094
|
-
return qb.related(reference2.target).whereAny({
|
|
20095
|
-
[searchField]: expression
|
|
20096
|
-
});
|
|
20097
|
-
}
|
|
20098
|
-
__name(buildRef, "buildRef");
|
|
20099
19883
|
function makeDataTableHandlers({
|
|
20100
19884
|
setNewParams,
|
|
20101
19885
|
defaults,
|
|
@@ -20183,40 +19967,18 @@ function makeDataTableHandlers({
|
|
|
20183
19967
|
};
|
|
20184
19968
|
}
|
|
20185
19969
|
__name(makeDataTableHandlers, "makeDataTableHandlers");
|
|
20186
|
-
function cleanupFilter(filter2) {
|
|
20187
|
-
let filterToUse = filter2;
|
|
20188
|
-
if (filterToUse.selectedFilter === "inList" && typeof filterToUse.filterValue === "number") {
|
|
20189
|
-
filterToUse = __spreadProps(__spreadValues({}, filterToUse), {
|
|
20190
|
-
filterValue: filterToUse.filterValue.toString()
|
|
20191
|
-
});
|
|
20192
|
-
}
|
|
20193
|
-
return filterToUse;
|
|
20194
|
-
}
|
|
20195
|
-
__name(cleanupFilter, "cleanupFilter");
|
|
20196
|
-
function getAllFilters(filters, searchTerm, schema) {
|
|
20197
|
-
let allFilters = [
|
|
20198
|
-
...filters,
|
|
20199
|
-
...getFiltersFromSearchTerm(searchTerm, schema)
|
|
20200
|
-
];
|
|
20201
|
-
allFilters = allFilters.filter((val) => {
|
|
20202
|
-
return val !== "";
|
|
20203
|
-
});
|
|
20204
|
-
return allFilters.map(cleanupFilter);
|
|
20205
|
-
}
|
|
20206
|
-
__name(getAllFilters, "getAllFilters");
|
|
20207
19970
|
function getQueryParams({
|
|
20208
19971
|
currentParams,
|
|
20209
|
-
urlConnected,
|
|
19972
|
+
// urlConnected,
|
|
20210
19973
|
defaults,
|
|
20211
19974
|
schema,
|
|
20212
19975
|
isInfinite,
|
|
20213
19976
|
entities,
|
|
20214
19977
|
isLocalCall,
|
|
20215
19978
|
additionalFilter,
|
|
20216
|
-
additionalOrFilter,
|
|
20217
19979
|
doNotCoercePageSize,
|
|
20218
19980
|
noOrderError,
|
|
20219
|
-
isCodeModel,
|
|
19981
|
+
// isCodeModel,
|
|
20220
19982
|
ownProps
|
|
20221
19983
|
}) {
|
|
20222
19984
|
Object.keys(currentParams).forEach(function(key) {
|
|
@@ -20239,232 +20001,65 @@ function getQueryParams({
|
|
|
20239
20001
|
)[0];
|
|
20240
20002
|
pageSize = closest;
|
|
20241
20003
|
}
|
|
20242
|
-
const
|
|
20004
|
+
const cleanedOrder = [];
|
|
20005
|
+
if (order2 && order2.length) {
|
|
20006
|
+
const ccFields = getFieldsMappedByCCDisplayName(schema);
|
|
20007
|
+
order2.forEach((orderVal) => {
|
|
20008
|
+
const ccDisplayName = orderVal.replace(/^-/gi, "");
|
|
20009
|
+
const schemaForField = ccFields[ccDisplayName];
|
|
20010
|
+
if (schemaForField) {
|
|
20011
|
+
const { path: path2 } = schemaForField;
|
|
20012
|
+
const reversed = ccDisplayName !== orderVal;
|
|
20013
|
+
const prefix2 = reversed ? "-" : "";
|
|
20014
|
+
cleanedOrder.push(prefix2 + path2);
|
|
20015
|
+
} else {
|
|
20016
|
+
!noOrderError && console.error(
|
|
20017
|
+
"No schema for field found!",
|
|
20018
|
+
ccDisplayName,
|
|
20019
|
+
JSON.stringify(schema.fields, null, 2)
|
|
20020
|
+
);
|
|
20021
|
+
}
|
|
20022
|
+
});
|
|
20023
|
+
}
|
|
20024
|
+
let toRet = {
|
|
20243
20025
|
//these are values that might be generally useful for the wrapped component
|
|
20244
20026
|
page,
|
|
20245
20027
|
pageSize: ownProps.controlled_pageSize || pageSize,
|
|
20246
|
-
order:
|
|
20028
|
+
order: cleanedOrder,
|
|
20247
20029
|
filters,
|
|
20248
20030
|
searchTerm
|
|
20249
20031
|
};
|
|
20032
|
+
const { where, order_by, limit, offset: offset3 } = tableQueryParamsToHasuraClauses({
|
|
20033
|
+
page,
|
|
20034
|
+
pageSize,
|
|
20035
|
+
searchTerm,
|
|
20036
|
+
filters,
|
|
20037
|
+
order: cleanedOrder,
|
|
20038
|
+
schema
|
|
20039
|
+
});
|
|
20040
|
+
initializeHasuraWhereAndFilter(additionalFilter, where, currentParams);
|
|
20041
|
+
addCustomColumnFilters(where, schema.fields, currentParams);
|
|
20250
20042
|
if (isLocalCall) {
|
|
20251
|
-
|
|
20252
|
-
|
|
20253
|
-
|
|
20254
|
-
|
|
20255
|
-
|
|
20256
|
-
|
|
20257
|
-
|
|
20258
|
-
|
|
20259
|
-
newEntities = orderEntitiesLocal(order2, newEntities, schema, ownProps);
|
|
20260
|
-
const entitiesAcrossPages = newEntities;
|
|
20261
|
-
const newEntityCount = newEntities.length;
|
|
20262
|
-
if (!isInfinite && !ownProps.controlled_pageSize) {
|
|
20263
|
-
const offset3 = (page - 1) * pageSize;
|
|
20264
|
-
newEntities = take(drop(newEntities, offset3), pageSize);
|
|
20265
|
-
}
|
|
20266
|
-
toReturn.entities = newEntities;
|
|
20267
|
-
toReturn.entitiesAcrossPages = entitiesAcrossPages;
|
|
20268
|
-
toReturn.entityCount = newEntityCount;
|
|
20269
|
-
return toReturn;
|
|
20043
|
+
toRet = __spreadValues(__spreadValues({}, toRet), filterLocalEntitiesToHasura(entities, {
|
|
20044
|
+
where,
|
|
20045
|
+
order_by,
|
|
20046
|
+
limit,
|
|
20047
|
+
offset: offset3,
|
|
20048
|
+
isInfinite
|
|
20049
|
+
}));
|
|
20050
|
+
return toRet;
|
|
20270
20051
|
} else {
|
|
20271
|
-
|
|
20272
|
-
|
|
20273
|
-
|
|
20274
|
-
|
|
20275
|
-
|
|
20276
|
-
|
|
20277
|
-
graphqlQueryParams.pageNumber = 1;
|
|
20278
|
-
} else {
|
|
20279
|
-
graphqlQueryParams.pageNumber = Number(page);
|
|
20280
|
-
graphqlQueryParams.pageSize = ownProps.controlled_pageSize || Number(pageSize);
|
|
20281
|
-
}
|
|
20282
|
-
const { model } = schema;
|
|
20283
|
-
if (!window.QueryBuilder) return toReturn;
|
|
20284
|
-
const qb = new window.QueryBuilder(model);
|
|
20285
|
-
const ccFields = getFieldsMappedByCCDisplayName(schema);
|
|
20286
|
-
if (tableQueryParams.order && tableQueryParams.order.length) {
|
|
20287
|
-
tableQueryParams.order.forEach((orderVal) => {
|
|
20288
|
-
const ccDisplayName = orderVal.replace(/^-/gi, "");
|
|
20289
|
-
const schemaForField = ccFields[ccDisplayName];
|
|
20290
|
-
if (schemaForField) {
|
|
20291
|
-
const { path: path2 } = schemaForField;
|
|
20292
|
-
const reversed = ccDisplayName !== orderVal;
|
|
20293
|
-
const prefix2 = reversed ? "-" : "";
|
|
20294
|
-
graphqlQueryParams.sort = [
|
|
20295
|
-
...graphqlQueryParams.sort || [],
|
|
20296
|
-
prefix2 + path2
|
|
20297
|
-
];
|
|
20298
|
-
} else {
|
|
20299
|
-
!noOrderError && console.error(
|
|
20300
|
-
"No schema for field found!",
|
|
20301
|
-
ccDisplayName,
|
|
20302
|
-
JSON.stringify(schema.fields, null, 2)
|
|
20303
|
-
);
|
|
20304
|
-
}
|
|
20305
|
-
});
|
|
20306
|
-
}
|
|
20307
|
-
let errorParsingUrlString;
|
|
20308
|
-
const additionalFilterToUse = additionalFilter(qb, currentParams);
|
|
20309
|
-
let additionalOrFilterToUse = additionalOrFilter(qb, currentParams);
|
|
20310
|
-
if (additionalOrFilterToUse && additionalOrFilterToUse.ignoreSearchTerm) {
|
|
20311
|
-
searchTerm = "";
|
|
20312
|
-
additionalOrFilterToUse = additionalOrFilterToUse.additionalOrFilterToUse;
|
|
20313
|
-
}
|
|
20314
|
-
const allFilters = getAllFilters(filters, searchTerm, schema);
|
|
20315
|
-
const { andFilters, orFilters, otherOrFilters } = getAndAndOrFilters(allFilters);
|
|
20316
|
-
try {
|
|
20317
|
-
const flattenFilters = /* @__PURE__ */ __name((filterObj) => {
|
|
20318
|
-
return flatMap(Object.keys(filterObj), (key) => {
|
|
20319
|
-
return filterObj[key].map((filter2) => ({
|
|
20320
|
-
[key]: filter2
|
|
20321
|
-
}));
|
|
20322
|
-
});
|
|
20323
|
-
}, "flattenFilters");
|
|
20324
|
-
const orFiltersObject = getQueries(orFilters, qb, ccFields);
|
|
20325
|
-
let allOrFilters = flattenFilters(orFiltersObject);
|
|
20326
|
-
otherOrFilters.forEach((orFilters2) => {
|
|
20327
|
-
const otherOrFiltersObject = getQueries(orFilters2, qb, ccFields);
|
|
20328
|
-
allOrFilters = allOrFilters.concat(
|
|
20329
|
-
flattenFilters(otherOrFiltersObject)
|
|
20330
|
-
);
|
|
20331
|
-
});
|
|
20332
|
-
allOrFilters.push(additionalOrFilterToUse);
|
|
20333
|
-
allOrFilters = allOrFilters.filter((obj) => !isEmpty$1(obj));
|
|
20334
|
-
const unflattenedAndQueries = getQueries(andFilters, qb, ccFields);
|
|
20335
|
-
let allAndFilters = flattenFilters(unflattenedAndQueries);
|
|
20336
|
-
allAndFilters.push(additionalFilterToUse);
|
|
20337
|
-
allAndFilters = allAndFilters.filter((obj) => !isEmpty$1(obj));
|
|
20338
|
-
if (allAndFilters.length) {
|
|
20339
|
-
qb.whereAll(...allAndFilters);
|
|
20340
|
-
}
|
|
20341
|
-
if (allOrFilters.length) {
|
|
20342
|
-
qb.andWhereAny(...allOrFilters);
|
|
20343
|
-
}
|
|
20344
|
-
const columnCustomFilters = getColumnCustomFilters(
|
|
20345
|
-
andFilters,
|
|
20346
|
-
qb,
|
|
20347
|
-
ccFields
|
|
20348
|
-
);
|
|
20349
|
-
if (columnCustomFilters.length) {
|
|
20350
|
-
qb.whereAll(...columnCustomFilters);
|
|
20351
|
-
}
|
|
20352
|
-
} catch (e) {
|
|
20353
|
-
if (urlConnected) {
|
|
20354
|
-
errorParsingUrlString = e;
|
|
20355
|
-
console.error(
|
|
20356
|
-
"The following error occurred when trying to build the query params. This is probably due to a malformed URL:",
|
|
20357
|
-
e
|
|
20358
|
-
);
|
|
20359
|
-
} else {
|
|
20360
|
-
console.error("Error building query params from filter:");
|
|
20361
|
-
throw e;
|
|
20052
|
+
return __spreadProps(__spreadValues({}, toRet), {
|
|
20053
|
+
variables: {
|
|
20054
|
+
where,
|
|
20055
|
+
order_by,
|
|
20056
|
+
limit,
|
|
20057
|
+
offset: offset3
|
|
20362
20058
|
}
|
|
20363
|
-
}
|
|
20364
|
-
if (qb.query.filters.length) {
|
|
20365
|
-
graphqlQueryParams.filter = qb.toJSON();
|
|
20366
|
-
}
|
|
20367
|
-
if (!graphqlQueryParams.sort.length) {
|
|
20368
|
-
graphqlQueryParams.sort.push("-updatedAt");
|
|
20369
|
-
}
|
|
20370
|
-
graphqlQueryParams.sort.push(
|
|
20371
|
-
isCodeModel ? "code" : window.__sortId || "id"
|
|
20372
|
-
);
|
|
20373
|
-
return __spreadProps(__spreadValues({}, toReturn), {
|
|
20374
|
-
//the query params will get passed directly to as variables to the graphql query
|
|
20375
|
-
variables: graphqlQueryParams,
|
|
20376
|
-
errorParsingUrlString
|
|
20377
20059
|
});
|
|
20378
20060
|
}
|
|
20379
20061
|
}
|
|
20380
20062
|
__name(getQueryParams, "getQueryParams");
|
|
20381
|
-
function getSubFiltersAndPath(filter2, qb, ccFields) {
|
|
20382
|
-
const { selectedFilter, filterValue, filterOn } = filter2;
|
|
20383
|
-
const fieldSchema = ccFields[filterOn];
|
|
20384
|
-
let filterValueToUse = filterValue;
|
|
20385
|
-
if (fieldSchema) {
|
|
20386
|
-
if (fieldSchema.normalizeFilter) {
|
|
20387
|
-
filterValueToUse = fieldSchema.normalizeFilter(
|
|
20388
|
-
filterValue,
|
|
20389
|
-
selectedFilter,
|
|
20390
|
-
filterOn
|
|
20391
|
-
);
|
|
20392
|
-
}
|
|
20393
|
-
}
|
|
20394
|
-
const _subFilters = getSubFilter(qb, selectedFilter, filterValueToUse);
|
|
20395
|
-
let filterField;
|
|
20396
|
-
if (fieldSchema) {
|
|
20397
|
-
const { path: path2, reference: reference2 } = fieldSchema;
|
|
20398
|
-
if (reference2) {
|
|
20399
|
-
filterField = reference2.sourceField;
|
|
20400
|
-
} else {
|
|
20401
|
-
filterField = path2;
|
|
20402
|
-
}
|
|
20403
|
-
} else if (filterOn === "id") {
|
|
20404
|
-
filterField = filterOn;
|
|
20405
|
-
} else {
|
|
20406
|
-
console.error("Trying to filter on unknown field");
|
|
20407
|
-
}
|
|
20408
|
-
const subFiltersToUse = [];
|
|
20409
|
-
const subFilters = Array.isArray(_subFilters) ? _subFilters : [_subFilters];
|
|
20410
|
-
subFilters.forEach((subFilter) => {
|
|
20411
|
-
let subFilterToUse = subFilter;
|
|
20412
|
-
if (fieldSchema) {
|
|
20413
|
-
const { path: path2, reference: reference2 } = fieldSchema;
|
|
20414
|
-
if (reference2) {
|
|
20415
|
-
subFilterToUse = buildRef(
|
|
20416
|
-
qb,
|
|
20417
|
-
reference2,
|
|
20418
|
-
last$1(path2.split(".")),
|
|
20419
|
-
subFilter
|
|
20420
|
-
);
|
|
20421
|
-
}
|
|
20422
|
-
}
|
|
20423
|
-
subFiltersToUse.push(subFilterToUse);
|
|
20424
|
-
});
|
|
20425
|
-
return {
|
|
20426
|
-
path: filterField,
|
|
20427
|
-
subFilters: subFiltersToUse
|
|
20428
|
-
};
|
|
20429
|
-
}
|
|
20430
|
-
__name(getSubFiltersAndPath, "getSubFiltersAndPath");
|
|
20431
|
-
function getQueries(filters, qb, ccFields) {
|
|
20432
|
-
const subQueries = filters.reduce((acc, filter2) => {
|
|
20433
|
-
if (!filter2) {
|
|
20434
|
-
console.warn("We should always have a filter object!");
|
|
20435
|
-
return acc;
|
|
20436
|
-
}
|
|
20437
|
-
const { filterOn } = filter2;
|
|
20438
|
-
const fieldSchema = ccFields[filterOn];
|
|
20439
|
-
if (!filter2.isSearchTermFilter && (fieldSchema == null ? void 0 : fieldSchema.additionalColumnFilter))
|
|
20440
|
-
return acc;
|
|
20441
|
-
const { path: path2, subFilters } = getSubFiltersAndPath(filter2, qb, ccFields);
|
|
20442
|
-
acc[path2] = subFilters;
|
|
20443
|
-
return acc;
|
|
20444
|
-
}, {});
|
|
20445
|
-
return subQueries;
|
|
20446
|
-
}
|
|
20447
|
-
__name(getQueries, "getQueries");
|
|
20448
|
-
function getColumnCustomFilters(filters, qb, ccFields) {
|
|
20449
|
-
const subQueries = filters.reduce((acc, filter2) => {
|
|
20450
|
-
if (!filter2) {
|
|
20451
|
-
console.warn("We should always have a filter object!");
|
|
20452
|
-
return acc;
|
|
20453
|
-
}
|
|
20454
|
-
const { filterOn } = filter2;
|
|
20455
|
-
const fieldSchema = ccFields[filterOn];
|
|
20456
|
-
if (filter2.isSearchTermFilter || !(fieldSchema == null ? void 0 : fieldSchema.additionalColumnFilter)) {
|
|
20457
|
-
return acc;
|
|
20458
|
-
}
|
|
20459
|
-
const { path: path2, subFilters } = getSubFiltersAndPath(filter2, qb, ccFields);
|
|
20460
|
-
subFilters.forEach((subFilter) => {
|
|
20461
|
-
acc.push(fieldSchema.additionalColumnFilter(qb, subFilter, path2));
|
|
20462
|
-
});
|
|
20463
|
-
return acc;
|
|
20464
|
-
}, []);
|
|
20465
|
-
return subQueries;
|
|
20466
|
-
}
|
|
20467
|
-
__name(getColumnCustomFilters, "getColumnCustomFilters");
|
|
20468
20063
|
function PagingInput({ disabled, onBlur, defaultPage }) {
|
|
20469
20064
|
const [page, setPage] = useState(defaultPage);
|
|
20470
20065
|
const defaultValue2 = useRef(defaultPage);
|
|
@@ -32978,6 +32573,293 @@ const InfoHelper = /* @__PURE__ */ __name((_g) => {
|
|
|
32978
32573
|
toReturn
|
|
32979
32574
|
);
|
|
32980
32575
|
}, "InfoHelper");
|
|
32576
|
+
var dayjs_min$1 = { exports: {} };
|
|
32577
|
+
var dayjs_min = dayjs_min$1.exports;
|
|
32578
|
+
var hasRequiredDayjs_min;
|
|
32579
|
+
function requireDayjs_min() {
|
|
32580
|
+
if (hasRequiredDayjs_min) return dayjs_min$1.exports;
|
|
32581
|
+
hasRequiredDayjs_min = 1;
|
|
32582
|
+
(function(module2, exports2) {
|
|
32583
|
+
!function(t2, e) {
|
|
32584
|
+
module2.exports = e();
|
|
32585
|
+
}(dayjs_min, function() {
|
|
32586
|
+
var t2 = 1e3, e = 6e4, n2 = 36e5, r2 = "millisecond", i2 = "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) {
|
|
32587
|
+
var e2 = ["th", "st", "nd", "rd"], n3 = t3 % 100;
|
|
32588
|
+
return "[" + t3 + (e2[(n3 - 20) % 10] || e2[n3] || e2[0]) + "]";
|
|
32589
|
+
}, "ordinal") }, m2 = /* @__PURE__ */ __name(function(t3, e2, n3) {
|
|
32590
|
+
var r3 = String(t3);
|
|
32591
|
+
return !r3 || r3.length >= e2 ? t3 : "" + Array(e2 + 1 - r3.length).join(n3) + t3;
|
|
32592
|
+
}, "m"), v2 = { s: m2, z: /* @__PURE__ */ __name(function(t3) {
|
|
32593
|
+
var e2 = -t3.utcOffset(), n3 = Math.abs(e2), r3 = Math.floor(n3 / 60), i3 = n3 % 60;
|
|
32594
|
+
return (e2 <= 0 ? "+" : "-") + m2(r3, 2, "0") + ":" + m2(i3, 2, "0");
|
|
32595
|
+
}, "z"), m: /* @__PURE__ */ __name(function t3(e2, n3) {
|
|
32596
|
+
if (e2.date() < n3.date()) return -t3(n3, e2);
|
|
32597
|
+
var r3 = 12 * (n3.year() - e2.year()) + (n3.month() - e2.month()), i3 = e2.clone().add(r3, c2), s3 = n3 - i3 < 0, u3 = e2.clone().add(r3 + (s3 ? -1 : 1), c2);
|
|
32598
|
+
return +(-(r3 + (n3 - i3) / (s3 ? i3 - u3 : u3 - i3)) || 0);
|
|
32599
|
+
}, "t"), a: /* @__PURE__ */ __name(function(t3) {
|
|
32600
|
+
return t3 < 0 ? Math.ceil(t3) || 0 : Math.floor(t3);
|
|
32601
|
+
}, "a"), p: /* @__PURE__ */ __name(function(t3) {
|
|
32602
|
+
return { M: c2, y: h2, w: o2, d: a2, D: d2, h: u2, m: s2, s: i2, ms: r2, Q: f2 }[t3] || String(t3 || "").toLowerCase().replace(/s$/, "");
|
|
32603
|
+
}, "p"), u: /* @__PURE__ */ __name(function(t3) {
|
|
32604
|
+
return void 0 === t3;
|
|
32605
|
+
}, "u") }, g2 = "en", D2 = {};
|
|
32606
|
+
D2[g2] = M2;
|
|
32607
|
+
var p2 = "$isDayjsObject", S2 = /* @__PURE__ */ __name(function(t3) {
|
|
32608
|
+
return t3 instanceof _2 || !(!t3 || !t3[p2]);
|
|
32609
|
+
}, "S"), w2 = /* @__PURE__ */ __name(function t3(e2, n3, r3) {
|
|
32610
|
+
var i3;
|
|
32611
|
+
if (!e2) return g2;
|
|
32612
|
+
if ("string" == typeof e2) {
|
|
32613
|
+
var s3 = e2.toLowerCase();
|
|
32614
|
+
D2[s3] && (i3 = s3), n3 && (D2[s3] = n3, i3 = s3);
|
|
32615
|
+
var u3 = e2.split("-");
|
|
32616
|
+
if (!i3 && u3.length > 1) return t3(u3[0]);
|
|
32617
|
+
} else {
|
|
32618
|
+
var a3 = e2.name;
|
|
32619
|
+
D2[a3] = e2, i3 = a3;
|
|
32620
|
+
}
|
|
32621
|
+
return !r3 && i3 && (g2 = i3), i3 || !r3 && g2;
|
|
32622
|
+
}, "t"), O2 = /* @__PURE__ */ __name(function(t3, e2) {
|
|
32623
|
+
if (S2(t3)) return t3.clone();
|
|
32624
|
+
var n3 = "object" == typeof e2 ? e2 : {};
|
|
32625
|
+
return n3.date = t3, n3.args = arguments, new _2(n3);
|
|
32626
|
+
}, "O"), b2 = v2;
|
|
32627
|
+
b2.l = w2, b2.i = S2, b2.w = function(t3, e2) {
|
|
32628
|
+
return O2(t3, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
|
|
32629
|
+
};
|
|
32630
|
+
var _2 = function() {
|
|
32631
|
+
function M3(t3) {
|
|
32632
|
+
this.$L = w2(t3.locale, null, true), this.parse(t3), this.$x = this.$x || t3.x || {}, this[p2] = true;
|
|
32633
|
+
}
|
|
32634
|
+
__name(M3, "M");
|
|
32635
|
+
var m3 = M3.prototype;
|
|
32636
|
+
return m3.parse = function(t3) {
|
|
32637
|
+
this.$d = function(t4) {
|
|
32638
|
+
var e2 = t4.date, n3 = t4.utc;
|
|
32639
|
+
if (null === e2) return /* @__PURE__ */ new Date(NaN);
|
|
32640
|
+
if (b2.u(e2)) return /* @__PURE__ */ new Date();
|
|
32641
|
+
if (e2 instanceof Date) return new Date(e2);
|
|
32642
|
+
if ("string" == typeof e2 && !/Z$/i.test(e2)) {
|
|
32643
|
+
var r3 = e2.match($);
|
|
32644
|
+
if (r3) {
|
|
32645
|
+
var i3 = r3[2] - 1 || 0, s3 = (r3[7] || "0").substring(0, 3);
|
|
32646
|
+
return n3 ? new Date(Date.UTC(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3)) : new Date(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3);
|
|
32647
|
+
}
|
|
32648
|
+
}
|
|
32649
|
+
return new Date(e2);
|
|
32650
|
+
}(t3), this.init();
|
|
32651
|
+
}, m3.init = function() {
|
|
32652
|
+
var t3 = this.$d;
|
|
32653
|
+
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();
|
|
32654
|
+
}, m3.$utils = function() {
|
|
32655
|
+
return b2;
|
|
32656
|
+
}, m3.isValid = function() {
|
|
32657
|
+
return !(this.$d.toString() === l2);
|
|
32658
|
+
}, m3.isSame = function(t3, e2) {
|
|
32659
|
+
var n3 = O2(t3);
|
|
32660
|
+
return this.startOf(e2) <= n3 && n3 <= this.endOf(e2);
|
|
32661
|
+
}, m3.isAfter = function(t3, e2) {
|
|
32662
|
+
return O2(t3) < this.startOf(e2);
|
|
32663
|
+
}, m3.isBefore = function(t3, e2) {
|
|
32664
|
+
return this.endOf(e2) < O2(t3);
|
|
32665
|
+
}, m3.$g = function(t3, e2, n3) {
|
|
32666
|
+
return b2.u(t3) ? this[e2] : this.set(n3, t3);
|
|
32667
|
+
}, m3.unix = function() {
|
|
32668
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
32669
|
+
}, m3.valueOf = function() {
|
|
32670
|
+
return this.$d.getTime();
|
|
32671
|
+
}, m3.startOf = function(t3, e2) {
|
|
32672
|
+
var n3 = this, r3 = !!b2.u(e2) || e2, f3 = b2.p(t3), l3 = /* @__PURE__ */ __name(function(t4, e3) {
|
|
32673
|
+
var i3 = b2.w(n3.$u ? Date.UTC(n3.$y, e3, t4) : new Date(n3.$y, e3, t4), n3);
|
|
32674
|
+
return r3 ? i3 : i3.endOf(a2);
|
|
32675
|
+
}, "l"), $2 = /* @__PURE__ */ __name(function(t4, e3) {
|
|
32676
|
+
return b2.w(n3.toDate()[t4].apply(n3.toDate("s"), (r3 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n3);
|
|
32677
|
+
}, "$"), y3 = this.$W, M4 = this.$M, m4 = this.$D, v3 = "set" + (this.$u ? "UTC" : "");
|
|
32678
|
+
switch (f3) {
|
|
32679
|
+
case h2:
|
|
32680
|
+
return r3 ? l3(1, 0) : l3(31, 11);
|
|
32681
|
+
case c2:
|
|
32682
|
+
return r3 ? l3(1, M4) : l3(0, M4 + 1);
|
|
32683
|
+
case o2:
|
|
32684
|
+
var g3 = this.$locale().weekStart || 0, D3 = (y3 < g3 ? y3 + 7 : y3) - g3;
|
|
32685
|
+
return l3(r3 ? m4 - D3 : m4 + (6 - D3), M4);
|
|
32686
|
+
case a2:
|
|
32687
|
+
case d2:
|
|
32688
|
+
return $2(v3 + "Hours", 0);
|
|
32689
|
+
case u2:
|
|
32690
|
+
return $2(v3 + "Minutes", 1);
|
|
32691
|
+
case s2:
|
|
32692
|
+
return $2(v3 + "Seconds", 2);
|
|
32693
|
+
case i2:
|
|
32694
|
+
return $2(v3 + "Milliseconds", 3);
|
|
32695
|
+
default:
|
|
32696
|
+
return this.clone();
|
|
32697
|
+
}
|
|
32698
|
+
}, m3.endOf = function(t3) {
|
|
32699
|
+
return this.startOf(t3, false);
|
|
32700
|
+
}, m3.$set = function(t3, e2) {
|
|
32701
|
+
var n3, o3 = b2.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[i2] = f3 + "Seconds", n3[r2] = f3 + "Milliseconds", n3)[o3], $2 = o3 === a2 ? this.$D + (e2 - this.$W) : e2;
|
|
32702
|
+
if (o3 === c2 || o3 === h2) {
|
|
32703
|
+
var y3 = this.clone().set(d2, 1);
|
|
32704
|
+
y3.$d[l3]($2), y3.init(), this.$d = y3.set(d2, Math.min(this.$D, y3.daysInMonth())).$d;
|
|
32705
|
+
} else l3 && this.$d[l3]($2);
|
|
32706
|
+
return this.init(), this;
|
|
32707
|
+
}, m3.set = function(t3, e2) {
|
|
32708
|
+
return this.clone().$set(t3, e2);
|
|
32709
|
+
}, m3.get = function(t3) {
|
|
32710
|
+
return this[b2.p(t3)]();
|
|
32711
|
+
}, m3.add = function(r3, f3) {
|
|
32712
|
+
var d3, l3 = this;
|
|
32713
|
+
r3 = Number(r3);
|
|
32714
|
+
var $2 = b2.p(f3), y3 = /* @__PURE__ */ __name(function(t3) {
|
|
32715
|
+
var e2 = O2(l3);
|
|
32716
|
+
return b2.w(e2.date(e2.date() + Math.round(t3 * r3)), l3);
|
|
32717
|
+
}, "y");
|
|
32718
|
+
if ($2 === c2) return this.set(c2, this.$M + r3);
|
|
32719
|
+
if ($2 === h2) return this.set(h2, this.$y + r3);
|
|
32720
|
+
if ($2 === a2) return y3(1);
|
|
32721
|
+
if ($2 === o2) return y3(7);
|
|
32722
|
+
var M4 = (d3 = {}, d3[s2] = e, d3[u2] = n2, d3[i2] = t2, d3)[$2] || 1, m4 = this.$d.getTime() + r3 * M4;
|
|
32723
|
+
return b2.w(m4, this);
|
|
32724
|
+
}, m3.subtract = function(t3, e2) {
|
|
32725
|
+
return this.add(-1 * t3, e2);
|
|
32726
|
+
}, m3.format = function(t3) {
|
|
32727
|
+
var e2 = this, n3 = this.$locale();
|
|
32728
|
+
if (!this.isValid()) return n3.invalidDate || l2;
|
|
32729
|
+
var r3 = t3 || "YYYY-MM-DDTHH:mm:ssZ", i3 = b2.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, i4, s4) {
|
|
32730
|
+
return t4 && (t4[n4] || t4(e2, r3)) || i4[n4].slice(0, s4);
|
|
32731
|
+
}, "h"), d3 = /* @__PURE__ */ __name(function(t4) {
|
|
32732
|
+
return b2.s(s3 % 12 || 12, t4, "0");
|
|
32733
|
+
}, "d"), $2 = f3 || function(t4, e3, n4) {
|
|
32734
|
+
var r4 = t4 < 12 ? "AM" : "PM";
|
|
32735
|
+
return n4 ? r4.toLowerCase() : r4;
|
|
32736
|
+
};
|
|
32737
|
+
return r3.replace(y2, function(t4, r4) {
|
|
32738
|
+
return r4 || function(t5) {
|
|
32739
|
+
switch (t5) {
|
|
32740
|
+
case "YY":
|
|
32741
|
+
return String(e2.$y).slice(-2);
|
|
32742
|
+
case "YYYY":
|
|
32743
|
+
return b2.s(e2.$y, 4, "0");
|
|
32744
|
+
case "M":
|
|
32745
|
+
return a3 + 1;
|
|
32746
|
+
case "MM":
|
|
32747
|
+
return b2.s(a3 + 1, 2, "0");
|
|
32748
|
+
case "MMM":
|
|
32749
|
+
return h3(n3.monthsShort, a3, c3, 3);
|
|
32750
|
+
case "MMMM":
|
|
32751
|
+
return h3(c3, a3);
|
|
32752
|
+
case "D":
|
|
32753
|
+
return e2.$D;
|
|
32754
|
+
case "DD":
|
|
32755
|
+
return b2.s(e2.$D, 2, "0");
|
|
32756
|
+
case "d":
|
|
32757
|
+
return String(e2.$W);
|
|
32758
|
+
case "dd":
|
|
32759
|
+
return h3(n3.weekdaysMin, e2.$W, o3, 2);
|
|
32760
|
+
case "ddd":
|
|
32761
|
+
return h3(n3.weekdaysShort, e2.$W, o3, 3);
|
|
32762
|
+
case "dddd":
|
|
32763
|
+
return o3[e2.$W];
|
|
32764
|
+
case "H":
|
|
32765
|
+
return String(s3);
|
|
32766
|
+
case "HH":
|
|
32767
|
+
return b2.s(s3, 2, "0");
|
|
32768
|
+
case "h":
|
|
32769
|
+
return d3(1);
|
|
32770
|
+
case "hh":
|
|
32771
|
+
return d3(2);
|
|
32772
|
+
case "a":
|
|
32773
|
+
return $2(s3, u3, true);
|
|
32774
|
+
case "A":
|
|
32775
|
+
return $2(s3, u3, false);
|
|
32776
|
+
case "m":
|
|
32777
|
+
return String(u3);
|
|
32778
|
+
case "mm":
|
|
32779
|
+
return b2.s(u3, 2, "0");
|
|
32780
|
+
case "s":
|
|
32781
|
+
return String(e2.$s);
|
|
32782
|
+
case "ss":
|
|
32783
|
+
return b2.s(e2.$s, 2, "0");
|
|
32784
|
+
case "SSS":
|
|
32785
|
+
return b2.s(e2.$ms, 3, "0");
|
|
32786
|
+
case "Z":
|
|
32787
|
+
return i3;
|
|
32788
|
+
}
|
|
32789
|
+
return null;
|
|
32790
|
+
}(t4) || i3.replace(":", "");
|
|
32791
|
+
});
|
|
32792
|
+
}, m3.utcOffset = function() {
|
|
32793
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
32794
|
+
}, m3.diff = function(r3, d3, l3) {
|
|
32795
|
+
var $2, y3 = this, M4 = b2.p(d3), m4 = O2(r3), v3 = (m4.utcOffset() - this.utcOffset()) * e, g3 = this - m4, D3 = /* @__PURE__ */ __name(function() {
|
|
32796
|
+
return b2.m(y3, m4);
|
|
32797
|
+
}, "D");
|
|
32798
|
+
switch (M4) {
|
|
32799
|
+
case h2:
|
|
32800
|
+
$2 = D3() / 12;
|
|
32801
|
+
break;
|
|
32802
|
+
case c2:
|
|
32803
|
+
$2 = D3();
|
|
32804
|
+
break;
|
|
32805
|
+
case f2:
|
|
32806
|
+
$2 = D3() / 3;
|
|
32807
|
+
break;
|
|
32808
|
+
case o2:
|
|
32809
|
+
$2 = (g3 - v3) / 6048e5;
|
|
32810
|
+
break;
|
|
32811
|
+
case a2:
|
|
32812
|
+
$2 = (g3 - v3) / 864e5;
|
|
32813
|
+
break;
|
|
32814
|
+
case u2:
|
|
32815
|
+
$2 = g3 / n2;
|
|
32816
|
+
break;
|
|
32817
|
+
case s2:
|
|
32818
|
+
$2 = g3 / e;
|
|
32819
|
+
break;
|
|
32820
|
+
case i2:
|
|
32821
|
+
$2 = g3 / t2;
|
|
32822
|
+
break;
|
|
32823
|
+
default:
|
|
32824
|
+
$2 = g3;
|
|
32825
|
+
}
|
|
32826
|
+
return l3 ? $2 : b2.a($2);
|
|
32827
|
+
}, m3.daysInMonth = function() {
|
|
32828
|
+
return this.endOf(c2).$D;
|
|
32829
|
+
}, m3.$locale = function() {
|
|
32830
|
+
return D2[this.$L];
|
|
32831
|
+
}, m3.locale = function(t3, e2) {
|
|
32832
|
+
if (!t3) return this.$L;
|
|
32833
|
+
var n3 = this.clone(), r3 = w2(t3, e2, true);
|
|
32834
|
+
return r3 && (n3.$L = r3), n3;
|
|
32835
|
+
}, m3.clone = function() {
|
|
32836
|
+
return b2.w(this.$d, this);
|
|
32837
|
+
}, m3.toDate = function() {
|
|
32838
|
+
return new Date(this.valueOf());
|
|
32839
|
+
}, m3.toJSON = function() {
|
|
32840
|
+
return this.isValid() ? this.toISOString() : null;
|
|
32841
|
+
}, m3.toISOString = function() {
|
|
32842
|
+
return this.$d.toISOString();
|
|
32843
|
+
}, m3.toString = function() {
|
|
32844
|
+
return this.$d.toUTCString();
|
|
32845
|
+
}, M3;
|
|
32846
|
+
}(), k2 = _2.prototype;
|
|
32847
|
+
return O2.prototype = k2, [["$ms", r2], ["$s", i2], ["$m", s2], ["$H", u2], ["$W", a2], ["$M", c2], ["$y", h2], ["$D", d2]].forEach(function(t3) {
|
|
32848
|
+
k2[t3[1]] = function(e2) {
|
|
32849
|
+
return this.$g(e2, t3[0], t3[1]);
|
|
32850
|
+
};
|
|
32851
|
+
}), O2.extend = function(t3, e2) {
|
|
32852
|
+
return t3.$i || (t3(e2, _2, O2), t3.$i = true), O2;
|
|
32853
|
+
}, O2.locale = w2, O2.isDayjs = S2, O2.unix = function(t3) {
|
|
32854
|
+
return O2(1e3 * t3);
|
|
32855
|
+
}, O2.en = D2[g2], O2.Ls = D2, O2.p = {}, O2;
|
|
32856
|
+
});
|
|
32857
|
+
})(dayjs_min$1);
|
|
32858
|
+
return dayjs_min$1.exports;
|
|
32859
|
+
}
|
|
32860
|
+
__name(requireDayjs_min, "requireDayjs_min");
|
|
32861
|
+
var dayjs_minExports = requireDayjs_min();
|
|
32862
|
+
const dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports);
|
|
32981
32863
|
var localizedFormat$2 = { exports: {} };
|
|
32982
32864
|
var localizedFormat$1 = localizedFormat$2.exports;
|
|
32983
32865
|
var hasRequiredLocalizedFormat;
|
|
@@ -33247,7 +33129,7 @@ function removeUnwantedProps(props) {
|
|
|
33247
33129
|
return cleanedProps;
|
|
33248
33130
|
}
|
|
33249
33131
|
__name(removeUnwantedProps, "removeUnwantedProps");
|
|
33250
|
-
const LabelWithTooltipInfo = /* @__PURE__ */ __name(({ label, tooltipInfo, labelStyle }) => tooltipInfo ? /* @__PURE__ */ React__default.createElement("
|
|
33132
|
+
const LabelWithTooltipInfo = /* @__PURE__ */ __name(({ label, tooltipInfo, labelStyle }) => tooltipInfo ? /* @__PURE__ */ React__default.createElement("span", { style: __spreadValues({ display: "flex", alignItems: "center" }, labelStyle) }, label, " ", /* @__PURE__ */ React__default.createElement(
|
|
33251
33133
|
InfoHelper,
|
|
33252
33134
|
{
|
|
33253
33135
|
style: { marginLeft: "5px", marginTop: "-6px" },
|
|
@@ -50768,42 +50650,42 @@ function getFilterMenuItems(dataType) {
|
|
|
50768
50650
|
let filterMenuItems2 = [];
|
|
50769
50651
|
if (dataType === "string") {
|
|
50770
50652
|
filterMenuItems2 = [
|
|
50771
|
-
"
|
|
50772
|
-
"
|
|
50773
|
-
"
|
|
50774
|
-
"
|
|
50775
|
-
"
|
|
50776
|
-
"
|
|
50777
|
-
"
|
|
50778
|
-
"
|
|
50779
|
-
"
|
|
50780
|
-
"
|
|
50653
|
+
"contains",
|
|
50654
|
+
"notContains",
|
|
50655
|
+
"startsWith",
|
|
50656
|
+
"endsWith",
|
|
50657
|
+
"isExactly",
|
|
50658
|
+
"regex",
|
|
50659
|
+
"inList",
|
|
50660
|
+
"notInList",
|
|
50661
|
+
"isEmpty",
|
|
50662
|
+
"notEmpty"
|
|
50781
50663
|
];
|
|
50782
50664
|
} else if (dataType === "lookup") {
|
|
50783
50665
|
filterMenuItems2 = [
|
|
50784
|
-
"
|
|
50785
|
-
"
|
|
50786
|
-
"
|
|
50787
|
-
"
|
|
50788
|
-
"
|
|
50789
|
-
"
|
|
50666
|
+
"contains",
|
|
50667
|
+
"notContains",
|
|
50668
|
+
"startsWith",
|
|
50669
|
+
"endsWith",
|
|
50670
|
+
"isExactly",
|
|
50671
|
+
"regex"
|
|
50790
50672
|
];
|
|
50791
50673
|
} else if (dataType === "boolean") {
|
|
50792
|
-
filterMenuItems2 = ["
|
|
50674
|
+
filterMenuItems2 = ["true", "false"];
|
|
50793
50675
|
} else if (dataType === "number" || dataType === "integer") {
|
|
50794
50676
|
filterMenuItems2 = [
|
|
50795
|
-
"
|
|
50796
|
-
"
|
|
50797
|
-
"
|
|
50798
|
-
"
|
|
50799
|
-
"
|
|
50800
|
-
"
|
|
50801
|
-
"
|
|
50677
|
+
"greaterThan",
|
|
50678
|
+
"lessThan",
|
|
50679
|
+
"inRange",
|
|
50680
|
+
"outsideRange",
|
|
50681
|
+
"equalTo",
|
|
50682
|
+
"inList",
|
|
50683
|
+
"notInList"
|
|
50802
50684
|
];
|
|
50803
50685
|
} else if (dataType === "timestamp") {
|
|
50804
|
-
filterMenuItems2 = ["
|
|
50686
|
+
filterMenuItems2 = ["isBetween", "notBetween", "isBefore", "isAfter"];
|
|
50805
50687
|
}
|
|
50806
|
-
return filterMenuItems2;
|
|
50688
|
+
return filterMenuItems2.map((item) => startCase(item));
|
|
50807
50689
|
}
|
|
50808
50690
|
__name(getFilterMenuItems, "getFilterMenuItems");
|
|
50809
50691
|
const ColumnFilterMenu = /* @__PURE__ */ __name(({
|
|
@@ -56391,20 +56273,15 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
|
|
|
56391
56273
|
props = __spreadValues(__spreadValues({}, props), tableParams);
|
|
56392
56274
|
const queryParams = useMemo(() => {
|
|
56393
56275
|
if (!isTableParamsConnected) {
|
|
56394
|
-
const additionalFilterToUse = typeof props.additionalFilter === "function" ? props.additionalFilter : () => props.additionalFilter;
|
|
56395
|
-
const additionalOrFilterToUse = typeof props.additionalOrFilter === "function" ? props.additionalOrFilter : () => props.additionalOrFilter;
|
|
56396
56276
|
return getQueryParams({
|
|
56397
56277
|
doNotCoercePageSize,
|
|
56398
56278
|
currentParams,
|
|
56399
56279
|
entities: props.entities,
|
|
56400
|
-
// for local table
|
|
56401
|
-
urlConnected,
|
|
56402
56280
|
defaults,
|
|
56403
56281
|
schema: convertedSchema,
|
|
56404
56282
|
isInfinite,
|
|
56405
56283
|
isLocalCall,
|
|
56406
|
-
additionalFilter:
|
|
56407
|
-
additionalOrFilter: additionalOrFilterToUse,
|
|
56284
|
+
additionalFilter: props.additionalFilter,
|
|
56408
56285
|
noOrderError: props.noOrderError,
|
|
56409
56286
|
isCodeModel: props.isCodeModel,
|
|
56410
56287
|
ownProps: props
|
|
@@ -56627,7 +56504,7 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
|
|
|
56627
56504
|
}) : !val;
|
|
56628
56505
|
});
|
|
56629
56506
|
}
|
|
56630
|
-
if (noValsForField) {
|
|
56507
|
+
if (noValsForField && entities.length) {
|
|
56631
56508
|
return __spreadProps(__spreadValues({}, field), {
|
|
56632
56509
|
isHidden: true,
|
|
56633
56510
|
isForcedHidden: true
|
|
@@ -71164,8 +71041,12 @@ const Uploader = /* @__PURE__ */ __name(({
|
|
|
71164
71041
|
onClick: /* @__PURE__ */ __name((evt) => evt.preventDefault(), "onClick"),
|
|
71165
71042
|
multiple: fileLimit !== 1,
|
|
71166
71043
|
accept: simpleAccept ? simpleAccept.split(", ").map((acc) => acc.startsWith(".") ? acc : "." + acc).join(", ") : void 0,
|
|
71167
|
-
onDrop: /* @__PURE__ */ __name((_acceptedFiles, rejectedFiles) => __async(void 0, null, function* () {
|
|
71044
|
+
onDrop: /* @__PURE__ */ __name((_acceptedFiles, rejectedFiles, e) => __async(void 0, null, function* () {
|
|
71168
71045
|
var _a2, _b2;
|
|
71046
|
+
const parentDropzone = e.target.closest(".tg-dropzone");
|
|
71047
|
+
if (parentDropzone) {
|
|
71048
|
+
parentDropzone.blur();
|
|
71049
|
+
}
|
|
71169
71050
|
let acceptedFiles = [];
|
|
71170
71051
|
for (const file of _acceptedFiles) {
|
|
71171
71052
|
if ((validateAgainstSchema || autoUnzip) && isZipFile(file)) {
|
|
@@ -71796,7 +71677,6 @@ const useTableParams = /* @__PURE__ */ __name((props) => {
|
|
|
71796
71677
|
var _a;
|
|
71797
71678
|
const {
|
|
71798
71679
|
additionalFilter,
|
|
71799
|
-
additionalOrFilter,
|
|
71800
71680
|
controlled_pageSize,
|
|
71801
71681
|
defaults: _defaults,
|
|
71802
71682
|
doNotCoercePageSize,
|
|
@@ -71904,28 +71784,21 @@ const useTableParams = /* @__PURE__ */ __name((props) => {
|
|
|
71904
71784
|
[controlled_pageSize, defaultsToUse, pageSize, history == null ? void 0 : history.location]
|
|
71905
71785
|
);
|
|
71906
71786
|
const queryParams = useMemo(() => {
|
|
71907
|
-
const additionalFilterToUse = typeof additionalFilter === "function" ? additionalFilter : () => additionalFilter;
|
|
71908
|
-
const additionalOrFilterToUse = typeof additionalOrFilter === "function" ? additionalOrFilter : () => additionalOrFilter;
|
|
71909
71787
|
return getQueryParams({
|
|
71910
71788
|
doNotCoercePageSize,
|
|
71911
71789
|
currentParams,
|
|
71912
71790
|
entities,
|
|
71913
|
-
// for local table
|
|
71914
|
-
urlConnected,
|
|
71915
71791
|
defaults: defaultsToUse,
|
|
71916
71792
|
schema: convertedSchema,
|
|
71917
71793
|
isInfinite: isInfinite || isSimple && !withPaging,
|
|
71918
71794
|
isLocalCall,
|
|
71919
|
-
additionalFilter
|
|
71920
|
-
additionalOrFilter: additionalOrFilterToUse,
|
|
71795
|
+
additionalFilter,
|
|
71921
71796
|
noOrderError,
|
|
71922
|
-
isCodeModel,
|
|
71923
71797
|
ownProps: passingProps
|
|
71924
71798
|
});
|
|
71925
71799
|
}, [
|
|
71926
71800
|
additionalFilter,
|
|
71927
71801
|
passingProps,
|
|
71928
|
-
additionalOrFilter,
|
|
71929
71802
|
doNotCoercePageSize,
|
|
71930
71803
|
currentParams,
|
|
71931
71804
|
entities,
|
|
@@ -78102,6 +77975,7 @@ export {
|
|
|
78102
77975
|
getTagsAndTagOptions,
|
|
78103
77976
|
getTextFromEl,
|
|
78104
77977
|
hotkeysById,
|
|
77978
|
+
initializeHasuraWhereAndFilter,
|
|
78105
77979
|
inventoryIcon,
|
|
78106
77980
|
isSafari,
|
|
78107
77981
|
keyboardIcon,
|