@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.cjs.js
CHANGED
|
@@ -5803,12 +5803,12 @@ var freeGlobal = typeof global == "object" && global && global.Object === Object
|
|
|
5803
5803
|
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
5804
5804
|
var root$4 = freeGlobal || freeSelf || Function("return this")();
|
|
5805
5805
|
var Symbol$1 = root$4.Symbol;
|
|
5806
|
-
var objectProto$
|
|
5807
|
-
var hasOwnProperty$
|
|
5808
|
-
var nativeObjectToString$2 = objectProto$
|
|
5806
|
+
var objectProto$i = Object.prototype;
|
|
5807
|
+
var hasOwnProperty$f = objectProto$i.hasOwnProperty;
|
|
5808
|
+
var nativeObjectToString$2 = objectProto$i.toString;
|
|
5809
5809
|
var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : void 0;
|
|
5810
5810
|
function getRawTag(value) {
|
|
5811
|
-
var isOwn = hasOwnProperty$
|
|
5811
|
+
var isOwn = hasOwnProperty$f.call(value, symToStringTag$1), tag = value[symToStringTag$1];
|
|
5812
5812
|
try {
|
|
5813
5813
|
value[symToStringTag$1] = void 0;
|
|
5814
5814
|
var unmasked = true;
|
|
@@ -5825,8 +5825,8 @@ function getRawTag(value) {
|
|
|
5825
5825
|
return result;
|
|
5826
5826
|
}
|
|
5827
5827
|
__name(getRawTag, "getRawTag");
|
|
5828
|
-
var objectProto$
|
|
5829
|
-
var nativeObjectToString$1 = objectProto$
|
|
5828
|
+
var objectProto$h = Object.prototype;
|
|
5829
|
+
var nativeObjectToString$1 = objectProto$h.toString;
|
|
5830
5830
|
function objectToString(value) {
|
|
5831
5831
|
return nativeObjectToString$1.call(value);
|
|
5832
5832
|
}
|
|
@@ -5973,11 +5973,11 @@ function toSource(func) {
|
|
|
5973
5973
|
__name(toSource, "toSource");
|
|
5974
5974
|
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
5975
5975
|
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
5976
|
-
var funcProto$1 = Function.prototype, objectProto$
|
|
5976
|
+
var funcProto$1 = Function.prototype, objectProto$g = Object.prototype;
|
|
5977
5977
|
var funcToString$1 = funcProto$1.toString;
|
|
5978
|
-
var hasOwnProperty$
|
|
5978
|
+
var hasOwnProperty$e = objectProto$g.hasOwnProperty;
|
|
5979
5979
|
var reIsNative = RegExp(
|
|
5980
|
-
"^" + funcToString$1.call(hasOwnProperty$
|
|
5980
|
+
"^" + funcToString$1.call(hasOwnProperty$e).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
5981
5981
|
);
|
|
5982
5982
|
function baseIsNative(value) {
|
|
5983
5983
|
if (!isObject$2(value) || isMasked(value)) {
|
|
@@ -6150,11 +6150,11 @@ function eq$1(value, other) {
|
|
|
6150
6150
|
return value === other || value !== value && other !== other;
|
|
6151
6151
|
}
|
|
6152
6152
|
__name(eq$1, "eq$1");
|
|
6153
|
-
var objectProto$
|
|
6154
|
-
var hasOwnProperty$
|
|
6153
|
+
var objectProto$f = Object.prototype;
|
|
6154
|
+
var hasOwnProperty$d = objectProto$f.hasOwnProperty;
|
|
6155
6155
|
function assignValue(object2, key, value) {
|
|
6156
6156
|
var objValue = object2[key];
|
|
6157
|
-
if (!(hasOwnProperty$
|
|
6157
|
+
if (!(hasOwnProperty$d.call(object2, key) && eq$1(objValue, value)) || value === void 0 && !(key in object2)) {
|
|
6158
6158
|
baseAssignValue(object2, key, value);
|
|
6159
6159
|
}
|
|
6160
6160
|
}
|
|
@@ -6178,11 +6178,11 @@ function copyObject(source, props, object2, customizer) {
|
|
|
6178
6178
|
return object2;
|
|
6179
6179
|
}
|
|
6180
6180
|
__name(copyObject, "copyObject");
|
|
6181
|
-
var nativeMax$
|
|
6181
|
+
var nativeMax$3 = Math.max;
|
|
6182
6182
|
function overRest(func, start2, transform) {
|
|
6183
|
-
start2 = nativeMax$
|
|
6183
|
+
start2 = nativeMax$3(start2 === void 0 ? func.length - 1 : start2, 0);
|
|
6184
6184
|
return function() {
|
|
6185
|
-
var args = arguments, index2 = -1, length = nativeMax$
|
|
6185
|
+
var args = arguments, index2 = -1, length = nativeMax$3(args.length - start2, 0), array2 = Array(length);
|
|
6186
6186
|
while (++index2 < length) {
|
|
6187
6187
|
array2[index2] = args[start2 + index2];
|
|
6188
6188
|
}
|
|
@@ -6239,9 +6239,9 @@ function createAssigner(assigner) {
|
|
|
6239
6239
|
});
|
|
6240
6240
|
}
|
|
6241
6241
|
__name(createAssigner, "createAssigner");
|
|
6242
|
-
var objectProto$
|
|
6242
|
+
var objectProto$e = Object.prototype;
|
|
6243
6243
|
function isPrototype(value) {
|
|
6244
|
-
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$
|
|
6244
|
+
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$e;
|
|
6245
6245
|
return value === proto;
|
|
6246
6246
|
}
|
|
6247
6247
|
__name(isPrototype, "isPrototype");
|
|
@@ -6258,13 +6258,13 @@ function baseIsArguments(value) {
|
|
|
6258
6258
|
return isObjectLike$1(value) && baseGetTag(value) == argsTag$3;
|
|
6259
6259
|
}
|
|
6260
6260
|
__name(baseIsArguments, "baseIsArguments");
|
|
6261
|
-
var objectProto$
|
|
6262
|
-
var hasOwnProperty$
|
|
6263
|
-
var propertyIsEnumerable$1 = objectProto$
|
|
6261
|
+
var objectProto$d = Object.prototype;
|
|
6262
|
+
var hasOwnProperty$c = objectProto$d.hasOwnProperty;
|
|
6263
|
+
var propertyIsEnumerable$1 = objectProto$d.propertyIsEnumerable;
|
|
6264
6264
|
var isArguments = baseIsArguments(/* @__PURE__ */ function() {
|
|
6265
6265
|
return arguments;
|
|
6266
6266
|
}()) ? baseIsArguments : function(value) {
|
|
6267
|
-
return isObjectLike$1(value) && hasOwnProperty$
|
|
6267
|
+
return isObjectLike$1(value) && hasOwnProperty$c.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
|
|
6268
6268
|
};
|
|
6269
6269
|
function stubFalse() {
|
|
6270
6270
|
return false;
|
|
@@ -6307,12 +6307,12 @@ var nodeUtil = function() {
|
|
|
6307
6307
|
}();
|
|
6308
6308
|
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
6309
6309
|
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
6310
|
-
var objectProto$
|
|
6311
|
-
var hasOwnProperty$
|
|
6310
|
+
var objectProto$c = Object.prototype;
|
|
6311
|
+
var hasOwnProperty$b = objectProto$c.hasOwnProperty;
|
|
6312
6312
|
function arrayLikeKeys(value, inherited) {
|
|
6313
6313
|
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;
|
|
6314
6314
|
for (var key in value) {
|
|
6315
|
-
if ((inherited || hasOwnProperty$
|
|
6315
|
+
if ((inherited || hasOwnProperty$b.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
6316
6316
|
(key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
6317
6317
|
isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
6318
6318
|
isType2 && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
|
|
@@ -6330,15 +6330,15 @@ function overArg(func, transform) {
|
|
|
6330
6330
|
}
|
|
6331
6331
|
__name(overArg, "overArg");
|
|
6332
6332
|
var nativeKeys = overArg(Object.keys, Object);
|
|
6333
|
-
var objectProto$
|
|
6334
|
-
var hasOwnProperty$
|
|
6333
|
+
var objectProto$b = Object.prototype;
|
|
6334
|
+
var hasOwnProperty$a = objectProto$b.hasOwnProperty;
|
|
6335
6335
|
function baseKeys(object2) {
|
|
6336
6336
|
if (!isPrototype(object2)) {
|
|
6337
6337
|
return nativeKeys(object2);
|
|
6338
6338
|
}
|
|
6339
6339
|
var result = [];
|
|
6340
6340
|
for (var key in Object(object2)) {
|
|
6341
|
-
if (hasOwnProperty$
|
|
6341
|
+
if (hasOwnProperty$a.call(object2, key) && key != "constructor") {
|
|
6342
6342
|
result.push(key);
|
|
6343
6343
|
}
|
|
6344
6344
|
}
|
|
@@ -6359,15 +6359,15 @@ function nativeKeysIn(object2) {
|
|
|
6359
6359
|
return result;
|
|
6360
6360
|
}
|
|
6361
6361
|
__name(nativeKeysIn, "nativeKeysIn");
|
|
6362
|
-
var objectProto$
|
|
6363
|
-
var hasOwnProperty$
|
|
6362
|
+
var objectProto$a = Object.prototype;
|
|
6363
|
+
var hasOwnProperty$9 = objectProto$a.hasOwnProperty;
|
|
6364
6364
|
function baseKeysIn(object2) {
|
|
6365
6365
|
if (!isObject$2(object2)) {
|
|
6366
6366
|
return nativeKeysIn(object2);
|
|
6367
6367
|
}
|
|
6368
6368
|
var isProto = isPrototype(object2), result = [];
|
|
6369
6369
|
for (var key in object2) {
|
|
6370
|
-
if (!(key == "constructor" && (isProto || !hasOwnProperty$
|
|
6370
|
+
if (!(key == "constructor" && (isProto || !hasOwnProperty$9.call(object2, key)))) {
|
|
6371
6371
|
result.push(key);
|
|
6372
6372
|
}
|
|
6373
6373
|
}
|
|
@@ -6403,22 +6403,22 @@ function hashDelete(key) {
|
|
|
6403
6403
|
}
|
|
6404
6404
|
__name(hashDelete, "hashDelete");
|
|
6405
6405
|
var HASH_UNDEFINED$2 = "__lodash_hash_undefined__";
|
|
6406
|
-
var objectProto$
|
|
6407
|
-
var hasOwnProperty$
|
|
6406
|
+
var objectProto$9 = Object.prototype;
|
|
6407
|
+
var hasOwnProperty$8 = objectProto$9.hasOwnProperty;
|
|
6408
6408
|
function hashGet(key) {
|
|
6409
6409
|
var data = this.__data__;
|
|
6410
6410
|
if (nativeCreate) {
|
|
6411
6411
|
var result = data[key];
|
|
6412
6412
|
return result === HASH_UNDEFINED$2 ? void 0 : result;
|
|
6413
6413
|
}
|
|
6414
|
-
return hasOwnProperty$
|
|
6414
|
+
return hasOwnProperty$8.call(data, key) ? data[key] : void 0;
|
|
6415
6415
|
}
|
|
6416
6416
|
__name(hashGet, "hashGet");
|
|
6417
|
-
var objectProto$
|
|
6418
|
-
var hasOwnProperty$
|
|
6417
|
+
var objectProto$8 = Object.prototype;
|
|
6418
|
+
var hasOwnProperty$7 = objectProto$8.hasOwnProperty;
|
|
6419
6419
|
function hashHas(key) {
|
|
6420
6420
|
var data = this.__data__;
|
|
6421
|
-
return nativeCreate ? data[key] !== void 0 : hasOwnProperty$
|
|
6421
|
+
return nativeCreate ? data[key] !== void 0 : hasOwnProperty$7.call(data, key);
|
|
6422
6422
|
}
|
|
6423
6423
|
__name(hashHas, "hashHas");
|
|
6424
6424
|
var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
|
|
@@ -6681,9 +6681,9 @@ function flatRest(func) {
|
|
|
6681
6681
|
__name(flatRest, "flatRest");
|
|
6682
6682
|
var getPrototype = overArg(Object.getPrototypeOf, Object);
|
|
6683
6683
|
var objectTag$3 = "[object Object]";
|
|
6684
|
-
var funcProto = Function.prototype, objectProto$
|
|
6684
|
+
var funcProto = Function.prototype, objectProto$7 = Object.prototype;
|
|
6685
6685
|
var funcToString = funcProto.toString;
|
|
6686
|
-
var hasOwnProperty$
|
|
6686
|
+
var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
|
|
6687
6687
|
var objectCtorString = funcToString.call(Object);
|
|
6688
6688
|
function isPlainObject$2(value) {
|
|
6689
6689
|
if (!isObjectLike$1(value) || baseGetTag(value) != objectTag$3) {
|
|
@@ -6693,7 +6693,7 @@ function isPlainObject$2(value) {
|
|
|
6693
6693
|
if (proto === null) {
|
|
6694
6694
|
return true;
|
|
6695
6695
|
}
|
|
6696
|
-
var Ctor = hasOwnProperty$
|
|
6696
|
+
var Ctor = hasOwnProperty$6.call(proto, "constructor") && proto.constructor;
|
|
6697
6697
|
return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
|
|
6698
6698
|
}
|
|
6699
6699
|
__name(isPlainObject$2, "isPlainObject$2");
|
|
@@ -7122,8 +7122,8 @@ function stubArray() {
|
|
|
7122
7122
|
return [];
|
|
7123
7123
|
}
|
|
7124
7124
|
__name(stubArray, "stubArray");
|
|
7125
|
-
var objectProto$
|
|
7126
|
-
var propertyIsEnumerable = objectProto$
|
|
7125
|
+
var objectProto$6 = Object.prototype;
|
|
7126
|
+
var propertyIsEnumerable = objectProto$6.propertyIsEnumerable;
|
|
7127
7127
|
var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
|
|
7128
7128
|
var getSymbols = !nativeGetSymbols$1 ? stubArray : function(object2) {
|
|
7129
7129
|
if (object2 == null) {
|
|
@@ -7191,11 +7191,11 @@ if (DataView$1 && getTag$1(new DataView$1(new ArrayBuffer(1))) != dataViewTag$3
|
|
|
7191
7191
|
return result;
|
|
7192
7192
|
}, "getTag$1");
|
|
7193
7193
|
}
|
|
7194
|
-
var objectProto$
|
|
7195
|
-
var hasOwnProperty$
|
|
7194
|
+
var objectProto$5 = Object.prototype;
|
|
7195
|
+
var hasOwnProperty$5 = objectProto$5.hasOwnProperty;
|
|
7196
7196
|
function initCloneArray(array2) {
|
|
7197
7197
|
var length = array2.length, result = new array2.constructor(length);
|
|
7198
|
-
if (length && typeof array2[0] == "string" && hasOwnProperty$
|
|
7198
|
+
if (length && typeof array2[0] == "string" && hasOwnProperty$5.call(array2, "index")) {
|
|
7199
7199
|
result.index = array2.index;
|
|
7200
7200
|
result.input = array2.input;
|
|
7201
7201
|
}
|
|
@@ -7509,8 +7509,8 @@ function equalByTag(object2, other, tag, bitmask, customizer, equalFunc, stack)
|
|
|
7509
7509
|
}
|
|
7510
7510
|
__name(equalByTag, "equalByTag");
|
|
7511
7511
|
var COMPARE_PARTIAL_FLAG$3 = 1;
|
|
7512
|
-
var objectProto$
|
|
7513
|
-
var hasOwnProperty$
|
|
7512
|
+
var objectProto$4 = Object.prototype;
|
|
7513
|
+
var hasOwnProperty$4 = objectProto$4.hasOwnProperty;
|
|
7514
7514
|
function equalObjects(object2, other, bitmask, customizer, equalFunc, stack) {
|
|
7515
7515
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, objProps = getAllKeys(object2), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
|
|
7516
7516
|
if (objLength != othLength && !isPartial) {
|
|
@@ -7519,7 +7519,7 @@ function equalObjects(object2, other, bitmask, customizer, equalFunc, stack) {
|
|
|
7519
7519
|
var index2 = objLength;
|
|
7520
7520
|
while (index2--) {
|
|
7521
7521
|
var key = objProps[index2];
|
|
7522
|
-
if (!(isPartial ? key in other : hasOwnProperty$
|
|
7522
|
+
if (!(isPartial ? key in other : hasOwnProperty$4.call(other, key))) {
|
|
7523
7523
|
return false;
|
|
7524
7524
|
}
|
|
7525
7525
|
}
|
|
@@ -7557,8 +7557,8 @@ function equalObjects(object2, other, bitmask, customizer, equalFunc, stack) {
|
|
|
7557
7557
|
__name(equalObjects, "equalObjects");
|
|
7558
7558
|
var COMPARE_PARTIAL_FLAG$2 = 1;
|
|
7559
7559
|
var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]";
|
|
7560
|
-
var objectProto$
|
|
7561
|
-
var hasOwnProperty$
|
|
7560
|
+
var objectProto$3 = Object.prototype;
|
|
7561
|
+
var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
|
|
7562
7562
|
function baseIsEqualDeep(object2, other, bitmask, customizer, equalFunc, stack) {
|
|
7563
7563
|
var objIsArr = isArray$2(object2), othIsArr = isArray$2(other), objTag = objIsArr ? arrayTag : getTag$1(object2), othTag = othIsArr ? arrayTag : getTag$1(other);
|
|
7564
7564
|
objTag = objTag == argsTag ? objectTag : objTag;
|
|
@@ -7576,7 +7576,7 @@ function baseIsEqualDeep(object2, other, bitmask, customizer, equalFunc, stack)
|
|
|
7576
7576
|
return objIsArr || isTypedArray(object2) ? equalArrays(object2, other, bitmask, customizer, equalFunc, stack) : equalByTag(object2, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
7577
7577
|
}
|
|
7578
7578
|
if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
|
|
7579
|
-
var objIsWrapped = objIsObj && hasOwnProperty$
|
|
7579
|
+
var objIsWrapped = objIsObj && hasOwnProperty$3.call(object2, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty$3.call(other, "__wrapped__");
|
|
7580
7580
|
if (objIsWrapped || othIsWrapped) {
|
|
7581
7581
|
var objUnwrapped = objIsWrapped ? object2.value() : object2, othUnwrapped = othIsWrapped ? other.value() : other;
|
|
7582
7582
|
stack || (stack = new Stack());
|
|
@@ -7792,7 +7792,7 @@ var now = /* @__PURE__ */ __name(function() {
|
|
|
7792
7792
|
return root$4.Date.now();
|
|
7793
7793
|
}, "now");
|
|
7794
7794
|
var FUNC_ERROR_TEXT$2 = "Expected a function";
|
|
7795
|
-
var nativeMax$
|
|
7795
|
+
var nativeMax$2 = Math.max, nativeMin$1 = Math.min;
|
|
7796
7796
|
function debounce(func, wait, options) {
|
|
7797
7797
|
var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
|
|
7798
7798
|
if (typeof func != "function") {
|
|
@@ -7802,7 +7802,7 @@ function debounce(func, wait, options) {
|
|
|
7802
7802
|
if (isObject$2(options)) {
|
|
7803
7803
|
leading = !!options.leading;
|
|
7804
7804
|
maxing = "maxWait" in options;
|
|
7805
|
-
maxWait = maxing ? nativeMax$
|
|
7805
|
+
maxWait = maxing ? nativeMax$2(toNumber(options.maxWait) || 0, wait) : maxWait;
|
|
7806
7806
|
trailing = "trailing" in options ? !!options.trailing : trailing;
|
|
7807
7807
|
}
|
|
7808
7808
|
function invokeFunc(time) {
|
|
@@ -7972,12 +7972,12 @@ function baseMerge(object2, source, srcIndex, customizer, stack) {
|
|
|
7972
7972
|
__name(baseMerge, "baseMerge");
|
|
7973
7973
|
var LARGE_ARRAY_SIZE$1 = 200;
|
|
7974
7974
|
function baseDifference(array2, values2, iteratee, comparator) {
|
|
7975
|
-
var index2 = -1,
|
|
7975
|
+
var index2 = -1, includes2 = arrayIncludes, isCommon = true, length = array2.length, result = [], valuesLength = values2.length;
|
|
7976
7976
|
if (!length) {
|
|
7977
7977
|
return result;
|
|
7978
7978
|
}
|
|
7979
7979
|
if (values2.length >= LARGE_ARRAY_SIZE$1) {
|
|
7980
|
-
|
|
7980
|
+
includes2 = cacheHas;
|
|
7981
7981
|
isCommon = false;
|
|
7982
7982
|
values2 = new SetCache(values2);
|
|
7983
7983
|
}
|
|
@@ -7993,7 +7993,7 @@ function baseDifference(array2, values2, iteratee, comparator) {
|
|
|
7993
7993
|
}
|
|
7994
7994
|
}
|
|
7995
7995
|
result.push(value);
|
|
7996
|
-
} else if (!
|
|
7996
|
+
} else if (!includes2(values2, computed3, comparator)) {
|
|
7997
7997
|
result.push(value);
|
|
7998
7998
|
}
|
|
7999
7999
|
}
|
|
@@ -8008,15 +8008,6 @@ function last$1(array2) {
|
|
|
8008
8008
|
return length ? array2[length - 1] : void 0;
|
|
8009
8009
|
}
|
|
8010
8010
|
__name(last$1, "last$1");
|
|
8011
|
-
function drop(array2, n2, guard) {
|
|
8012
|
-
var length = array2 == null ? 0 : array2.length;
|
|
8013
|
-
if (!length) {
|
|
8014
|
-
return [];
|
|
8015
|
-
}
|
|
8016
|
-
n2 = n2 === void 0 ? 1 : toInteger(n2);
|
|
8017
|
-
return baseSlice(array2, n2 < 0 ? 0 : n2, length);
|
|
8018
|
-
}
|
|
8019
|
-
__name(drop, "drop");
|
|
8020
8011
|
function castFunction(value) {
|
|
8021
8012
|
return typeof value == "function" ? value : identity$1;
|
|
8022
8013
|
}
|
|
@@ -8026,16 +8017,6 @@ function forEach(collection, iteratee) {
|
|
|
8026
8017
|
return func(collection, castFunction(iteratee));
|
|
8027
8018
|
}
|
|
8028
8019
|
__name(forEach, "forEach");
|
|
8029
|
-
function endsWith$1(string2, target, position2) {
|
|
8030
|
-
string2 = toString$4(string2);
|
|
8031
|
-
target = baseToString$1(target);
|
|
8032
|
-
var length = string2.length;
|
|
8033
|
-
position2 = position2 === void 0 ? length : baseClamp(toInteger(position2), 0, length);
|
|
8034
|
-
var end2 = position2;
|
|
8035
|
-
position2 -= target.length;
|
|
8036
|
-
return position2 >= 0 && string2.slice(position2, end2) == target;
|
|
8037
|
-
}
|
|
8038
|
-
__name(endsWith$1, "endsWith$1");
|
|
8039
8020
|
function arrayEvery(array2, predicate) {
|
|
8040
8021
|
var index2 = -1, length = array2 == null ? 0 : array2.length;
|
|
8041
8022
|
while (++index2 < length) {
|
|
@@ -8096,6 +8077,16 @@ function baseGt(value, other) {
|
|
|
8096
8077
|
return value > other;
|
|
8097
8078
|
}
|
|
8098
8079
|
__name(baseGt, "baseGt");
|
|
8080
|
+
var objectProto$2 = Object.prototype;
|
|
8081
|
+
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
8082
|
+
function baseHas(object2, key) {
|
|
8083
|
+
return object2 != null && hasOwnProperty$2.call(object2, key);
|
|
8084
|
+
}
|
|
8085
|
+
__name(baseHas, "baseHas");
|
|
8086
|
+
function has$1(object2, path2) {
|
|
8087
|
+
return object2 != null && hasPath(object2, path2, baseHas);
|
|
8088
|
+
}
|
|
8089
|
+
__name(has$1, "has$1");
|
|
8099
8090
|
var stringTag = "[object String]";
|
|
8100
8091
|
function isString$1(value) {
|
|
8101
8092
|
return typeof value == "string" || !isArray$2(value) && isObjectLike$1(value) && baseGetTag(value) == stringTag;
|
|
@@ -8111,6 +8102,17 @@ function values(object2) {
|
|
|
8111
8102
|
return object2 == null ? [] : baseValues(object2, keys$1(object2));
|
|
8112
8103
|
}
|
|
8113
8104
|
__name(values, "values");
|
|
8105
|
+
var nativeMax$1 = Math.max;
|
|
8106
|
+
function includes(collection, value, fromIndex, guard) {
|
|
8107
|
+
collection = isArrayLike(collection) ? collection : values(collection);
|
|
8108
|
+
fromIndex = fromIndex && true ? toInteger(fromIndex) : 0;
|
|
8109
|
+
var length = collection.length;
|
|
8110
|
+
if (fromIndex < 0) {
|
|
8111
|
+
fromIndex = nativeMax$1(length + fromIndex, 0);
|
|
8112
|
+
}
|
|
8113
|
+
return isString$1(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
|
|
8114
|
+
}
|
|
8115
|
+
__name(includes, "includes");
|
|
8114
8116
|
function baseInverter(object2, setter, iteratee, accumulator) {
|
|
8115
8117
|
baseForOwn(object2, function(value, key, object3) {
|
|
8116
8118
|
setter(accumulator, iteratee(value), key, object3);
|
|
@@ -8171,15 +8173,15 @@ function isEqualWith(value, other, customizer) {
|
|
|
8171
8173
|
return result === void 0 ? baseIsEqual(value, other, void 0, customizer) : !!result;
|
|
8172
8174
|
}
|
|
8173
8175
|
__name(isEqualWith, "isEqualWith");
|
|
8174
|
-
function isInteger(value) {
|
|
8175
|
-
return typeof value == "number" && value == toInteger(value);
|
|
8176
|
-
}
|
|
8177
|
-
__name(isInteger, "isInteger");
|
|
8178
8176
|
var numberTag = "[object Number]";
|
|
8179
8177
|
function isNumber$1(value) {
|
|
8180
8178
|
return typeof value == "number" || isObjectLike$1(value) && baseGetTag(value) == numberTag;
|
|
8181
8179
|
}
|
|
8182
8180
|
__name(isNumber$1, "isNumber$1");
|
|
8181
|
+
function isNull(value) {
|
|
8182
|
+
return value === null;
|
|
8183
|
+
}
|
|
8184
|
+
__name(isNull, "isNull");
|
|
8183
8185
|
function isUndefined(value) {
|
|
8184
8186
|
return value === void 0;
|
|
8185
8187
|
}
|
|
@@ -8636,14 +8638,14 @@ var createSet = !(Set$1 && 1 / setToArray(new Set$1([, -0]))[1] == INFINITY) ? n
|
|
|
8636
8638
|
};
|
|
8637
8639
|
var LARGE_ARRAY_SIZE = 200;
|
|
8638
8640
|
function baseUniq(array2, iteratee, comparator) {
|
|
8639
|
-
var index2 = -1,
|
|
8641
|
+
var index2 = -1, includes2 = arrayIncludes, length = array2.length, isCommon = true, result = [], seen = result;
|
|
8640
8642
|
if (length >= LARGE_ARRAY_SIZE) {
|
|
8641
8643
|
var set5 = iteratee ? null : createSet(array2);
|
|
8642
8644
|
if (set5) {
|
|
8643
8645
|
return setToArray(set5);
|
|
8644
8646
|
}
|
|
8645
8647
|
isCommon = false;
|
|
8646
|
-
|
|
8648
|
+
includes2 = cacheHas;
|
|
8647
8649
|
seen = new SetCache();
|
|
8648
8650
|
} else {
|
|
8649
8651
|
seen = iteratee ? [] : result;
|
|
@@ -8663,7 +8665,7 @@ function baseUniq(array2, iteratee, comparator) {
|
|
|
8663
8665
|
seen.push(computed3);
|
|
8664
8666
|
}
|
|
8665
8667
|
result.push(value);
|
|
8666
|
-
} else if (!
|
|
8668
|
+
} else if (!includes2(seen, computed3, comparator)) {
|
|
8667
8669
|
if (seen !== result) {
|
|
8668
8670
|
seen.push(computed3);
|
|
8669
8671
|
}
|
|
@@ -8673,10 +8675,6 @@ function baseUniq(array2, iteratee, comparator) {
|
|
|
8673
8675
|
return result;
|
|
8674
8676
|
}
|
|
8675
8677
|
__name(baseUniq, "baseUniq");
|
|
8676
|
-
function uniq(array2) {
|
|
8677
|
-
return array2 && array2.length ? baseUniq(array2) : [];
|
|
8678
|
-
}
|
|
8679
|
-
__name(uniq, "uniq");
|
|
8680
8678
|
function uniqBy(array2, iteratee) {
|
|
8681
8679
|
return array2 && array2.length ? baseUniq(array2, baseIteratee(iteratee)) : [];
|
|
8682
8680
|
}
|
|
@@ -19405,293 +19403,414 @@ function requireLib$1() {
|
|
|
19405
19403
|
__name(requireLib$1, "requireLib$1");
|
|
19406
19404
|
var libExports$1 = /* @__PURE__ */ requireLib$1();
|
|
19407
19405
|
const queryString = /* @__PURE__ */ getDefaultExportFromCjs(libExports$1);
|
|
19408
|
-
|
|
19409
|
-
|
|
19410
|
-
|
|
19411
|
-
|
|
19412
|
-
|
|
19413
|
-
|
|
19414
|
-
|
|
19415
|
-
|
|
19416
|
-
|
|
19417
|
-
|
|
19418
|
-
|
|
19419
|
-
|
|
19420
|
-
|
|
19421
|
-
|
|
19422
|
-
|
|
19423
|
-
|
|
19424
|
-
|
|
19425
|
-
|
|
19426
|
-
|
|
19427
|
-
|
|
19428
|
-
|
|
19429
|
-
|
|
19430
|
-
|
|
19431
|
-
|
|
19432
|
-
|
|
19433
|
-
|
|
19434
|
-
|
|
19435
|
-
|
|
19436
|
-
|
|
19437
|
-
}, "u") }, g2 = "en", D2 = {};
|
|
19438
|
-
D2[g2] = M2;
|
|
19439
|
-
var p2 = "$isDayjsObject", S2 = /* @__PURE__ */ __name(function(t3) {
|
|
19440
|
-
return t3 instanceof _2 || !(!t3 || !t3[p2]);
|
|
19441
|
-
}, "S"), w2 = /* @__PURE__ */ __name(function t3(e2, n3, r3) {
|
|
19442
|
-
var i3;
|
|
19443
|
-
if (!e2) return g2;
|
|
19444
|
-
if ("string" == typeof e2) {
|
|
19445
|
-
var s3 = e2.toLowerCase();
|
|
19446
|
-
D2[s3] && (i3 = s3), n3 && (D2[s3] = n3, i3 = s3);
|
|
19447
|
-
var u3 = e2.split("-");
|
|
19448
|
-
if (!i3 && u3.length > 1) return t3(u3[0]);
|
|
19449
|
-
} else {
|
|
19450
|
-
var a3 = e2.name;
|
|
19451
|
-
D2[a3] = e2, i3 = a3;
|
|
19406
|
+
function tableQueryParamsToHasuraClauses({
|
|
19407
|
+
page,
|
|
19408
|
+
pageSize,
|
|
19409
|
+
searchTerm,
|
|
19410
|
+
filters,
|
|
19411
|
+
order: order2,
|
|
19412
|
+
schema,
|
|
19413
|
+
// Add schema as a parameter
|
|
19414
|
+
additionalFilter
|
|
19415
|
+
}) {
|
|
19416
|
+
const ccFields = getFieldsMappedByCCDisplayName(schema);
|
|
19417
|
+
let where = {};
|
|
19418
|
+
const order_by = {};
|
|
19419
|
+
const limit = pageSize || 25;
|
|
19420
|
+
const offset3 = page && pageSize ? (page - 1) * pageSize : 0;
|
|
19421
|
+
if (searchTerm) {
|
|
19422
|
+
const searchTermFilters = [];
|
|
19423
|
+
schema.fields.forEach((field) => {
|
|
19424
|
+
const { type: type2, path: path2, searchDisabled } = field;
|
|
19425
|
+
if (searchDisabled || field.filterDisabled || type2 === "color") return;
|
|
19426
|
+
const filterValue = searchTerm;
|
|
19427
|
+
if (type2 === "string" || type2 === "lookup") {
|
|
19428
|
+
const o2 = set$1({}, path2, { _ilike: `%${filterValue}%` });
|
|
19429
|
+
searchTermFilters.push(o2);
|
|
19430
|
+
} else if (type2 === "boolean") {
|
|
19431
|
+
let regex;
|
|
19432
|
+
try {
|
|
19433
|
+
regex = new RegExp("^" + searchTerm, "ig");
|
|
19434
|
+
} catch (error) {
|
|
19452
19435
|
}
|
|
19453
|
-
|
|
19454
|
-
|
|
19455
|
-
|
|
19456
|
-
|
|
19457
|
-
|
|
19458
|
-
|
|
19459
|
-
|
|
19460
|
-
|
|
19461
|
-
};
|
|
19462
|
-
var _2 = function() {
|
|
19463
|
-
function M3(t3) {
|
|
19464
|
-
this.$L = w2(t3.locale, null, true), this.parse(t3), this.$x = this.$x || t3.x || {}, this[p2] = true;
|
|
19436
|
+
if (regex) {
|
|
19437
|
+
if ("true".replace(regex, "") !== "true") {
|
|
19438
|
+
const o2 = set$1({}, path2, { _eq: true });
|
|
19439
|
+
searchTermFilters.push(o2);
|
|
19440
|
+
} else if ("false".replace(regex, "") !== "false") {
|
|
19441
|
+
const o2 = set$1({}, path2, { _eq: false });
|
|
19442
|
+
searchTermFilters.push(o2);
|
|
19443
|
+
}
|
|
19465
19444
|
}
|
|
19466
|
-
|
|
19467
|
-
|
|
19468
|
-
|
|
19469
|
-
|
|
19470
|
-
|
|
19471
|
-
|
|
19472
|
-
|
|
19473
|
-
|
|
19474
|
-
|
|
19475
|
-
|
|
19476
|
-
|
|
19477
|
-
|
|
19478
|
-
|
|
19445
|
+
} else if ((type2 === "number" || type2 === "integer") && !isNaN(filterValue)) {
|
|
19446
|
+
const o2 = set$1({}, path2, { _eq: parseFloat(filterValue) });
|
|
19447
|
+
searchTermFilters.push(o2);
|
|
19448
|
+
}
|
|
19449
|
+
});
|
|
19450
|
+
if (searchTermFilters.length > 0) {
|
|
19451
|
+
if (Object.keys(where).length > 0) {
|
|
19452
|
+
where = { _and: [where, { _or: searchTermFilters }] };
|
|
19453
|
+
} else {
|
|
19454
|
+
where = { _or: searchTermFilters };
|
|
19455
|
+
}
|
|
19456
|
+
}
|
|
19457
|
+
}
|
|
19458
|
+
if (filters && filters.length > 0) {
|
|
19459
|
+
const filterClauses = filters.map((filter2) => {
|
|
19460
|
+
let { selectedFilter, filterOn, filterValue } = filter2;
|
|
19461
|
+
const fieldSchema = ccFields[filterOn] || {};
|
|
19462
|
+
const { path: path2, reference: reference2, type: type2 } = fieldSchema;
|
|
19463
|
+
let stringFilterValue = filterValue && filterValue.toString ? filterValue.toString() : filterValue;
|
|
19464
|
+
if (stringFilterValue === false) {
|
|
19465
|
+
stringFilterValue = "false";
|
|
19466
|
+
} else {
|
|
19467
|
+
stringFilterValue = stringFilterValue || "";
|
|
19468
|
+
}
|
|
19469
|
+
const arrayFilterValue = Array.isArray(filterValue) ? filterValue : stringFilterValue.split(";");
|
|
19470
|
+
if (type2 === "number" || type2 === "integer") {
|
|
19471
|
+
filterValue = Array.isArray(filterValue) ? filterValue.map((val) => Number(val)) : Number(filterValue);
|
|
19472
|
+
}
|
|
19473
|
+
if (fieldSchema.normalizeFilter) {
|
|
19474
|
+
filterValue = fieldSchema.normalizeFilter(
|
|
19475
|
+
filterValue,
|
|
19476
|
+
selectedFilter,
|
|
19477
|
+
filterOn
|
|
19478
|
+
);
|
|
19479
|
+
}
|
|
19480
|
+
if (reference2) {
|
|
19481
|
+
filterOn = reference2.sourceField;
|
|
19482
|
+
} else {
|
|
19483
|
+
filterOn = path2 || filterOn;
|
|
19484
|
+
}
|
|
19485
|
+
switch (selectedFilter) {
|
|
19486
|
+
case "none":
|
|
19487
|
+
return {};
|
|
19488
|
+
case "startsWith":
|
|
19489
|
+
return { [filterOn]: { _ilike: `${filterValue}%` } };
|
|
19490
|
+
case "endsWith":
|
|
19491
|
+
return { [filterOn]: { _ilike: `%${filterValue}` } };
|
|
19492
|
+
case "contains":
|
|
19493
|
+
return { [filterOn]: { _ilike: `%${filterValue}%` } };
|
|
19494
|
+
case "notContains":
|
|
19495
|
+
return { [filterOn]: { _not_ilike: `%${filterValue}%` } };
|
|
19496
|
+
case "isExactly":
|
|
19497
|
+
return { [filterOn]: { _eq: filterValue } };
|
|
19498
|
+
case "isEmpty":
|
|
19499
|
+
return {
|
|
19500
|
+
_or: [
|
|
19501
|
+
{ [filterOn]: { _eq: "" } },
|
|
19502
|
+
{ [filterOn]: { _is_null: true } }
|
|
19503
|
+
]
|
|
19504
|
+
};
|
|
19505
|
+
case "notEmpty":
|
|
19506
|
+
return {
|
|
19507
|
+
_and: [
|
|
19508
|
+
{ [filterOn]: { _neq: "" } },
|
|
19509
|
+
{ [filterOn]: { _is_null: false } }
|
|
19510
|
+
]
|
|
19511
|
+
};
|
|
19512
|
+
case "inList":
|
|
19513
|
+
return { [filterOn]: { _in: filterValue } };
|
|
19514
|
+
case "notInList":
|
|
19515
|
+
return { [filterOn]: { _nin: filterValue } };
|
|
19516
|
+
case "true":
|
|
19517
|
+
return { [filterOn]: { _eq: true } };
|
|
19518
|
+
case "false":
|
|
19519
|
+
return { [filterOn]: { _eq: false } };
|
|
19520
|
+
case "dateIs":
|
|
19521
|
+
return { [filterOn]: { _eq: filterValue } };
|
|
19522
|
+
case "notBetween":
|
|
19523
|
+
return {
|
|
19524
|
+
_or: [
|
|
19525
|
+
{
|
|
19526
|
+
[filterOn]: {
|
|
19527
|
+
_lt: new Date(arrayFilterValue[0])
|
|
19528
|
+
}
|
|
19529
|
+
},
|
|
19530
|
+
{
|
|
19531
|
+
[filterOn]: {
|
|
19532
|
+
_gt: new Date(
|
|
19533
|
+
new Date(arrayFilterValue[1]).setHours(23, 59)
|
|
19534
|
+
)
|
|
19535
|
+
}
|
|
19479
19536
|
}
|
|
19537
|
+
]
|
|
19538
|
+
};
|
|
19539
|
+
case "isBetween":
|
|
19540
|
+
return {
|
|
19541
|
+
[filterOn]: {
|
|
19542
|
+
_gte: new Date(arrayFilterValue[0]),
|
|
19543
|
+
_lte: new Date(new Date(arrayFilterValue[1]).setHours(23, 59))
|
|
19480
19544
|
}
|
|
19481
|
-
return new Date(e2);
|
|
19482
|
-
}(t3), this.init();
|
|
19483
|
-
}, m3.init = function() {
|
|
19484
|
-
var t3 = this.$d;
|
|
19485
|
-
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();
|
|
19486
|
-
}, m3.$utils = function() {
|
|
19487
|
-
return b2;
|
|
19488
|
-
}, m3.isValid = function() {
|
|
19489
|
-
return !(this.$d.toString() === l2);
|
|
19490
|
-
}, m3.isSame = function(t3, e2) {
|
|
19491
|
-
var n3 = O2(t3);
|
|
19492
|
-
return this.startOf(e2) <= n3 && n3 <= this.endOf(e2);
|
|
19493
|
-
}, m3.isAfter = function(t3, e2) {
|
|
19494
|
-
return O2(t3) < this.startOf(e2);
|
|
19495
|
-
}, m3.isBefore = function(t3, e2) {
|
|
19496
|
-
return this.endOf(e2) < O2(t3);
|
|
19497
|
-
}, m3.$g = function(t3, e2, n3) {
|
|
19498
|
-
return b2.u(t3) ? this[e2] : this.set(n3, t3);
|
|
19499
|
-
}, m3.unix = function() {
|
|
19500
|
-
return Math.floor(this.valueOf() / 1e3);
|
|
19501
|
-
}, m3.valueOf = function() {
|
|
19502
|
-
return this.$d.getTime();
|
|
19503
|
-
}, m3.startOf = function(t3, e2) {
|
|
19504
|
-
var n3 = this, r3 = !!b2.u(e2) || e2, f3 = b2.p(t3), l3 = /* @__PURE__ */ __name(function(t4, e3) {
|
|
19505
|
-
var i3 = b2.w(n3.$u ? Date.UTC(n3.$y, e3, t4) : new Date(n3.$y, e3, t4), n3);
|
|
19506
|
-
return r3 ? i3 : i3.endOf(a2);
|
|
19507
|
-
}, "l"), $2 = /* @__PURE__ */ __name(function(t4, e3) {
|
|
19508
|
-
return b2.w(n3.toDate()[t4].apply(n3.toDate("s"), (r3 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n3);
|
|
19509
|
-
}, "$"), y3 = this.$W, M4 = this.$M, m4 = this.$D, v3 = "set" + (this.$u ? "UTC" : "");
|
|
19510
|
-
switch (f3) {
|
|
19511
|
-
case h2:
|
|
19512
|
-
return r3 ? l3(1, 0) : l3(31, 11);
|
|
19513
|
-
case c2:
|
|
19514
|
-
return r3 ? l3(1, M4) : l3(0, M4 + 1);
|
|
19515
|
-
case o2:
|
|
19516
|
-
var g3 = this.$locale().weekStart || 0, D3 = (y3 < g3 ? y3 + 7 : y3) - g3;
|
|
19517
|
-
return l3(r3 ? m4 - D3 : m4 + (6 - D3), M4);
|
|
19518
|
-
case a2:
|
|
19519
|
-
case d2:
|
|
19520
|
-
return $2(v3 + "Hours", 0);
|
|
19521
|
-
case u2:
|
|
19522
|
-
return $2(v3 + "Minutes", 1);
|
|
19523
|
-
case s2:
|
|
19524
|
-
return $2(v3 + "Seconds", 2);
|
|
19525
|
-
case i2:
|
|
19526
|
-
return $2(v3 + "Milliseconds", 3);
|
|
19527
|
-
default:
|
|
19528
|
-
return this.clone();
|
|
19529
|
-
}
|
|
19530
|
-
}, m3.endOf = function(t3) {
|
|
19531
|
-
return this.startOf(t3, false);
|
|
19532
|
-
}, m3.$set = function(t3, e2) {
|
|
19533
|
-
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;
|
|
19534
|
-
if (o3 === c2 || o3 === h2) {
|
|
19535
|
-
var y3 = this.clone().set(d2, 1);
|
|
19536
|
-
y3.$d[l3]($2), y3.init(), this.$d = y3.set(d2, Math.min(this.$D, y3.daysInMonth())).$d;
|
|
19537
|
-
} else l3 && this.$d[l3]($2);
|
|
19538
|
-
return this.init(), this;
|
|
19539
|
-
}, m3.set = function(t3, e2) {
|
|
19540
|
-
return this.clone().$set(t3, e2);
|
|
19541
|
-
}, m3.get = function(t3) {
|
|
19542
|
-
return this[b2.p(t3)]();
|
|
19543
|
-
}, m3.add = function(r3, f3) {
|
|
19544
|
-
var d3, l3 = this;
|
|
19545
|
-
r3 = Number(r3);
|
|
19546
|
-
var $2 = b2.p(f3), y3 = /* @__PURE__ */ __name(function(t3) {
|
|
19547
|
-
var e2 = O2(l3);
|
|
19548
|
-
return b2.w(e2.date(e2.date() + Math.round(t3 * r3)), l3);
|
|
19549
|
-
}, "y");
|
|
19550
|
-
if ($2 === c2) return this.set(c2, this.$M + r3);
|
|
19551
|
-
if ($2 === h2) return this.set(h2, this.$y + r3);
|
|
19552
|
-
if ($2 === a2) return y3(1);
|
|
19553
|
-
if ($2 === o2) return y3(7);
|
|
19554
|
-
var M4 = (d3 = {}, d3[s2] = e, d3[u2] = n2, d3[i2] = t2, d3)[$2] || 1, m4 = this.$d.getTime() + r3 * M4;
|
|
19555
|
-
return b2.w(m4, this);
|
|
19556
|
-
}, m3.subtract = function(t3, e2) {
|
|
19557
|
-
return this.add(-1 * t3, e2);
|
|
19558
|
-
}, m3.format = function(t3) {
|
|
19559
|
-
var e2 = this, n3 = this.$locale();
|
|
19560
|
-
if (!this.isValid()) return n3.invalidDate || l2;
|
|
19561
|
-
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) {
|
|
19562
|
-
return t4 && (t4[n4] || t4(e2, r3)) || i4[n4].slice(0, s4);
|
|
19563
|
-
}, "h"), d3 = /* @__PURE__ */ __name(function(t4) {
|
|
19564
|
-
return b2.s(s3 % 12 || 12, t4, "0");
|
|
19565
|
-
}, "d"), $2 = f3 || function(t4, e3, n4) {
|
|
19566
|
-
var r4 = t4 < 12 ? "AM" : "PM";
|
|
19567
|
-
return n4 ? r4.toLowerCase() : r4;
|
|
19568
19545
|
};
|
|
19569
|
-
|
|
19570
|
-
|
|
19571
|
-
|
|
19572
|
-
|
|
19573
|
-
|
|
19574
|
-
|
|
19575
|
-
|
|
19576
|
-
|
|
19577
|
-
|
|
19578
|
-
|
|
19579
|
-
|
|
19580
|
-
|
|
19581
|
-
|
|
19582
|
-
|
|
19583
|
-
|
|
19584
|
-
|
|
19585
|
-
|
|
19586
|
-
|
|
19587
|
-
|
|
19588
|
-
|
|
19589
|
-
|
|
19590
|
-
|
|
19591
|
-
|
|
19592
|
-
|
|
19593
|
-
|
|
19594
|
-
|
|
19595
|
-
|
|
19596
|
-
case "H":
|
|
19597
|
-
return String(s3);
|
|
19598
|
-
case "HH":
|
|
19599
|
-
return b2.s(s3, 2, "0");
|
|
19600
|
-
case "h":
|
|
19601
|
-
return d3(1);
|
|
19602
|
-
case "hh":
|
|
19603
|
-
return d3(2);
|
|
19604
|
-
case "a":
|
|
19605
|
-
return $2(s3, u3, true);
|
|
19606
|
-
case "A":
|
|
19607
|
-
return $2(s3, u3, false);
|
|
19608
|
-
case "m":
|
|
19609
|
-
return String(u3);
|
|
19610
|
-
case "mm":
|
|
19611
|
-
return b2.s(u3, 2, "0");
|
|
19612
|
-
case "s":
|
|
19613
|
-
return String(e2.$s);
|
|
19614
|
-
case "ss":
|
|
19615
|
-
return b2.s(e2.$s, 2, "0");
|
|
19616
|
-
case "SSS":
|
|
19617
|
-
return b2.s(e2.$ms, 3, "0");
|
|
19618
|
-
case "Z":
|
|
19619
|
-
return i3;
|
|
19546
|
+
case "isBefore":
|
|
19547
|
+
return { [filterOn]: { _lt: new Date(filterValue) } };
|
|
19548
|
+
case "isAfter":
|
|
19549
|
+
return { [filterOn]: { _gt: new Date(filterValue) } };
|
|
19550
|
+
case "greaterThan":
|
|
19551
|
+
return { [filterOn]: { _gt: parseFloat(filterValue) } };
|
|
19552
|
+
case "lessThan":
|
|
19553
|
+
return { [filterOn]: { _lt: parseFloat(filterValue) } };
|
|
19554
|
+
case "inRange":
|
|
19555
|
+
return {
|
|
19556
|
+
[filterOn]: {
|
|
19557
|
+
_gte: parseFloat(arrayFilterValue[0]),
|
|
19558
|
+
_lte: parseFloat(arrayFilterValue[1])
|
|
19559
|
+
}
|
|
19560
|
+
};
|
|
19561
|
+
case "outsideRange":
|
|
19562
|
+
return {
|
|
19563
|
+
_or: [
|
|
19564
|
+
{
|
|
19565
|
+
[filterOn]: {
|
|
19566
|
+
_lt: parseFloat(arrayFilterValue[0])
|
|
19567
|
+
}
|
|
19568
|
+
},
|
|
19569
|
+
{
|
|
19570
|
+
[filterOn]: {
|
|
19571
|
+
_gt: parseFloat(arrayFilterValue[1])
|
|
19572
|
+
}
|
|
19620
19573
|
}
|
|
19621
|
-
|
|
19622
|
-
|
|
19623
|
-
|
|
19624
|
-
|
|
19625
|
-
|
|
19626
|
-
|
|
19627
|
-
|
|
19628
|
-
|
|
19629
|
-
|
|
19630
|
-
|
|
19631
|
-
|
|
19632
|
-
|
|
19574
|
+
]
|
|
19575
|
+
};
|
|
19576
|
+
case "equalTo":
|
|
19577
|
+
return {
|
|
19578
|
+
[filterOn]: {
|
|
19579
|
+
_eq: type2 === "number" || type2 === "integer" ? parseFloat(filterValue) : filterValue
|
|
19580
|
+
}
|
|
19581
|
+
};
|
|
19582
|
+
case "regex":
|
|
19583
|
+
return { [filterOn]: { _regex: filterValue } };
|
|
19584
|
+
default:
|
|
19585
|
+
console.warn(`Unsupported filter type: ${selectedFilter}`);
|
|
19586
|
+
return {};
|
|
19587
|
+
}
|
|
19588
|
+
}).map((filter2) => {
|
|
19589
|
+
const o2 = {};
|
|
19590
|
+
set$1(o2, Object.keys(filter2)[0], filter2[Object.keys(filter2)[0]]);
|
|
19591
|
+
return o2;
|
|
19592
|
+
});
|
|
19593
|
+
if (filterClauses.length > 0) {
|
|
19594
|
+
if (Object.keys(where).length > 0) {
|
|
19595
|
+
where = { _and: [where, ...filterClauses] };
|
|
19596
|
+
} else {
|
|
19597
|
+
where = { _and: filterClauses };
|
|
19598
|
+
}
|
|
19599
|
+
}
|
|
19600
|
+
}
|
|
19601
|
+
if (order2 && order2.length > 0) {
|
|
19602
|
+
order2.forEach((item) => {
|
|
19603
|
+
const field = item.startsWith("-") ? item.substring(1) : item;
|
|
19604
|
+
const direction = item.startsWith("-") ? "desc" : "asc";
|
|
19605
|
+
order_by[field] = direction;
|
|
19606
|
+
});
|
|
19607
|
+
}
|
|
19608
|
+
if (additionalFilter) {
|
|
19609
|
+
where = { _and: [where, additionalFilter] };
|
|
19610
|
+
}
|
|
19611
|
+
return { where, order_by, limit, offset: offset3 };
|
|
19612
|
+
}
|
|
19613
|
+
__name(tableQueryParamsToHasuraClauses, "tableQueryParamsToHasuraClauses");
|
|
19614
|
+
function getFieldsMappedByCCDisplayName(schema) {
|
|
19615
|
+
if (!schema || !schema.fields) return {};
|
|
19616
|
+
return schema.fields.reduce((acc, field) => {
|
|
19617
|
+
const ccDisplayName = getCCDisplayName(field);
|
|
19618
|
+
acc[ccDisplayName] = field;
|
|
19619
|
+
return acc;
|
|
19620
|
+
}, {});
|
|
19621
|
+
}
|
|
19622
|
+
__name(getFieldsMappedByCCDisplayName, "getFieldsMappedByCCDisplayName");
|
|
19623
|
+
function getCCDisplayName(field) {
|
|
19624
|
+
return camelCase(
|
|
19625
|
+
typeof field.displayName === "string" ? field.displayName : field.path
|
|
19626
|
+
);
|
|
19627
|
+
}
|
|
19628
|
+
__name(getCCDisplayName, "getCCDisplayName");
|
|
19629
|
+
function filterLocalEntitiesToHasura(records, { where, order_by, limit, offset: offset3, isInfinite } = {}) {
|
|
19630
|
+
let filteredRecords = [...records];
|
|
19631
|
+
if (where) {
|
|
19632
|
+
filteredRecords = applyWhereClause(filteredRecords, where);
|
|
19633
|
+
}
|
|
19634
|
+
if (order_by) {
|
|
19635
|
+
filteredRecords = applyOrderBy(filteredRecords, order_by);
|
|
19636
|
+
}
|
|
19637
|
+
const allFilteredRecords = [...filteredRecords];
|
|
19638
|
+
if (!isInfinite && offset3 !== void 0) {
|
|
19639
|
+
filteredRecords = filteredRecords.slice(offset3);
|
|
19640
|
+
}
|
|
19641
|
+
if (!isInfinite && limit !== void 0) {
|
|
19642
|
+
filteredRecords = filteredRecords.slice(0, limit);
|
|
19643
|
+
}
|
|
19644
|
+
return {
|
|
19645
|
+
entities: filteredRecords,
|
|
19646
|
+
entitiesAcrossPages: allFilteredRecords,
|
|
19647
|
+
entityCount: allFilteredRecords.length
|
|
19648
|
+
};
|
|
19649
|
+
}
|
|
19650
|
+
__name(filterLocalEntitiesToHasura, "filterLocalEntitiesToHasura");
|
|
19651
|
+
function applyWhereClause(records, where) {
|
|
19652
|
+
function applyFilter(record, filter2) {
|
|
19653
|
+
if (isEmpty$1(filter2)) {
|
|
19654
|
+
return true;
|
|
19655
|
+
}
|
|
19656
|
+
for (const key in filter2) {
|
|
19657
|
+
if (key === "_and") {
|
|
19658
|
+
if (isEmpty$1(filter2[key])) {
|
|
19659
|
+
continue;
|
|
19660
|
+
}
|
|
19661
|
+
if (!every(filter2[key], (subFilter) => applyFilter(record, subFilter))) {
|
|
19662
|
+
return false;
|
|
19663
|
+
}
|
|
19664
|
+
} else if (key === "_or") {
|
|
19665
|
+
if (isEmpty$1(filter2[key])) {
|
|
19666
|
+
continue;
|
|
19667
|
+
}
|
|
19668
|
+
if (!some(filter2[key], (subFilter) => applyFilter(record, subFilter))) {
|
|
19669
|
+
return false;
|
|
19670
|
+
}
|
|
19671
|
+
} else if (key === "_not") {
|
|
19672
|
+
if (applyFilter(record, filter2[key])) {
|
|
19673
|
+
return false;
|
|
19674
|
+
}
|
|
19675
|
+
} else {
|
|
19676
|
+
const value = record[key];
|
|
19677
|
+
const conditions = filter2[key];
|
|
19678
|
+
if (isObject$2(value) && isObject$2(conditions) && !hasOperator(conditions)) {
|
|
19679
|
+
return applyFilter(value, conditions);
|
|
19680
|
+
}
|
|
19681
|
+
for (const operator in conditions) {
|
|
19682
|
+
const conditionValue = conditions[operator];
|
|
19683
|
+
if (operator === "_gt" && conditions._lt) {
|
|
19684
|
+
if (!(value > conditionValue && value < conditions._lt))
|
|
19685
|
+
return false;
|
|
19686
|
+
continue;
|
|
19687
|
+
}
|
|
19688
|
+
if (operator === "_gte" && conditions._lte) {
|
|
19689
|
+
if (!(value >= conditionValue && value <= conditions._lte))
|
|
19690
|
+
return false;
|
|
19691
|
+
continue;
|
|
19692
|
+
}
|
|
19693
|
+
switch (operator) {
|
|
19694
|
+
case "_eq":
|
|
19695
|
+
if (!isEqual(value, conditionValue)) return false;
|
|
19633
19696
|
break;
|
|
19634
|
-
case
|
|
19635
|
-
|
|
19697
|
+
case "_neq":
|
|
19698
|
+
if (isEqual(value, conditionValue)) return false;
|
|
19636
19699
|
break;
|
|
19637
|
-
case
|
|
19638
|
-
|
|
19700
|
+
case "_gt":
|
|
19701
|
+
if (!(value > conditionValue)) return false;
|
|
19639
19702
|
break;
|
|
19640
|
-
case
|
|
19641
|
-
|
|
19703
|
+
case "_gte":
|
|
19704
|
+
if (!(value >= conditionValue)) return false;
|
|
19642
19705
|
break;
|
|
19643
|
-
case
|
|
19644
|
-
|
|
19706
|
+
case "_lt":
|
|
19707
|
+
if (!(value < conditionValue)) return false;
|
|
19645
19708
|
break;
|
|
19646
|
-
case
|
|
19647
|
-
|
|
19709
|
+
case "_lte":
|
|
19710
|
+
if (!(value <= conditionValue)) return false;
|
|
19648
19711
|
break;
|
|
19649
|
-
case
|
|
19650
|
-
$
|
|
19712
|
+
case "_like":
|
|
19713
|
+
if (!isString$1(value) || !new RegExp(conditionValue.replace(/%/g, ".*")).test(value))
|
|
19714
|
+
return false;
|
|
19651
19715
|
break;
|
|
19652
|
-
case
|
|
19653
|
-
$
|
|
19716
|
+
case "_ilike":
|
|
19717
|
+
if (!isString$1(value) || !new RegExp(conditionValue.replace(/%/g, ".*"), "i").test(value))
|
|
19718
|
+
return false;
|
|
19719
|
+
break;
|
|
19720
|
+
case "_nlike":
|
|
19721
|
+
if (!isString$1(value) || new RegExp(conditionValue.replace(/%/g, ".*")).test(value))
|
|
19722
|
+
return false;
|
|
19723
|
+
break;
|
|
19724
|
+
case "_nilike":
|
|
19725
|
+
if (!isString$1(value) || new RegExp(conditionValue.replace(/%/g, ".*"), "i").test(value))
|
|
19726
|
+
return false;
|
|
19727
|
+
break;
|
|
19728
|
+
case "_starts_with":
|
|
19729
|
+
if (!isString$1(value) || !value.startsWith(conditionValue))
|
|
19730
|
+
return false;
|
|
19731
|
+
break;
|
|
19732
|
+
case "_ends_with":
|
|
19733
|
+
if (!isString$1(value) || !value.endsWith(conditionValue))
|
|
19734
|
+
return false;
|
|
19735
|
+
break;
|
|
19736
|
+
case "_is_null":
|
|
19737
|
+
if (conditionValue && !isNull(value) || !conditionValue && isNull(value))
|
|
19738
|
+
return false;
|
|
19739
|
+
break;
|
|
19740
|
+
case "_contains":
|
|
19741
|
+
if (!isArray$2(value) || !every(conditionValue, (item) => includes(value, item)))
|
|
19742
|
+
return false;
|
|
19743
|
+
break;
|
|
19744
|
+
case "_contained_in":
|
|
19745
|
+
if (!isArray$2(value) || !every(value, (item) => includes(conditionValue, item)))
|
|
19746
|
+
return false;
|
|
19747
|
+
break;
|
|
19748
|
+
case "_has_key":
|
|
19749
|
+
if (!isObject$2(value) || !has$1(value, conditionValue)) return false;
|
|
19750
|
+
break;
|
|
19751
|
+
case "_has_keys_any":
|
|
19752
|
+
if (!isObject$2(value) || !some(conditionValue, (item) => has$1(value, item)))
|
|
19753
|
+
return false;
|
|
19754
|
+
break;
|
|
19755
|
+
case "_has_keys_all":
|
|
19756
|
+
if (!isObject$2(value) || !every(conditionValue, (item) => has$1(value, item)))
|
|
19757
|
+
return false;
|
|
19758
|
+
break;
|
|
19759
|
+
case "_similar":
|
|
19760
|
+
if (!isString$1(value) || !new RegExp(conditionValue.replace(/%/g, ".*")).test(value))
|
|
19761
|
+
return false;
|
|
19654
19762
|
break;
|
|
19655
19763
|
default:
|
|
19656
|
-
|
|
19764
|
+
if (operator.startsWith("_")) {
|
|
19765
|
+
console.warn(`Unsupported operator: ${operator}`);
|
|
19766
|
+
return false;
|
|
19767
|
+
} else {
|
|
19768
|
+
console.warn(`Unsupported operator: ${operator}`);
|
|
19769
|
+
return false;
|
|
19770
|
+
}
|
|
19657
19771
|
}
|
|
19658
|
-
|
|
19659
|
-
|
|
19660
|
-
|
|
19661
|
-
|
|
19662
|
-
|
|
19663
|
-
|
|
19664
|
-
|
|
19665
|
-
|
|
19666
|
-
|
|
19667
|
-
|
|
19668
|
-
|
|
19669
|
-
|
|
19670
|
-
|
|
19671
|
-
|
|
19672
|
-
|
|
19673
|
-
|
|
19674
|
-
|
|
19675
|
-
|
|
19676
|
-
|
|
19677
|
-
|
|
19678
|
-
|
|
19679
|
-
|
|
19680
|
-
|
|
19681
|
-
|
|
19682
|
-
|
|
19683
|
-
|
|
19684
|
-
|
|
19685
|
-
|
|
19686
|
-
|
|
19687
|
-
|
|
19688
|
-
}
|
|
19689
|
-
}
|
|
19690
|
-
|
|
19691
|
-
}
|
|
19692
|
-
__name(
|
|
19693
|
-
|
|
19694
|
-
|
|
19772
|
+
}
|
|
19773
|
+
}
|
|
19774
|
+
}
|
|
19775
|
+
return true;
|
|
19776
|
+
}
|
|
19777
|
+
__name(applyFilter, "applyFilter");
|
|
19778
|
+
function hasOperator(obj) {
|
|
19779
|
+
return Object.keys(obj).some((key) => key.startsWith("_"));
|
|
19780
|
+
}
|
|
19781
|
+
__name(hasOperator, "hasOperator");
|
|
19782
|
+
return records.filter((record) => applyFilter(record, where));
|
|
19783
|
+
}
|
|
19784
|
+
__name(applyWhereClause, "applyWhereClause");
|
|
19785
|
+
function applyOrderBy(records, order_by) {
|
|
19786
|
+
const keys2 = Object.keys(order_by);
|
|
19787
|
+
if (keys2.length > 0) {
|
|
19788
|
+
const field = keys2[0];
|
|
19789
|
+
const direction = order_by[field] === "asc" ? "asc" : "desc";
|
|
19790
|
+
return orderBy$1(records, [field], [direction]);
|
|
19791
|
+
}
|
|
19792
|
+
return records;
|
|
19793
|
+
}
|
|
19794
|
+
__name(applyOrderBy, "applyOrderBy");
|
|
19795
|
+
function initializeHasuraWhereAndFilter(additionalFilter, where = {}, currentParams) {
|
|
19796
|
+
where._and = where._and || [];
|
|
19797
|
+
where._or = where._or || [];
|
|
19798
|
+
if (typeof additionalFilter === "function") {
|
|
19799
|
+
const newWhere = additionalFilter(where, currentParams);
|
|
19800
|
+
if (newWhere) {
|
|
19801
|
+
where = __spreadValues(__spreadValues({}, where), newWhere);
|
|
19802
|
+
}
|
|
19803
|
+
} else if (typeof additionalFilter === "object")
|
|
19804
|
+
where._and.push(additionalFilter);
|
|
19805
|
+
}
|
|
19806
|
+
__name(initializeHasuraWhereAndFilter, "initializeHasuraWhereAndFilter");
|
|
19807
|
+
const addCustomColumnFilters = /* @__PURE__ */ __name((where, fields, currentParams) => {
|
|
19808
|
+
fields.forEach((field) => {
|
|
19809
|
+
const { customColumnFilter, filterDisabled } = field;
|
|
19810
|
+
if (filterDisabled || !customColumnFilter) return;
|
|
19811
|
+
customColumnFilter(where, currentParams);
|
|
19812
|
+
});
|
|
19813
|
+
}, "addCustomColumnFilters");
|
|
19695
19814
|
const defaultPageSizes = [5, 10, 15, 25, 50, 100, 200, 400];
|
|
19696
19815
|
function safeStringify(val) {
|
|
19697
19816
|
if (val !== null && typeof val === "object") {
|
|
@@ -19708,325 +19827,6 @@ function safeParse(val) {
|
|
|
19708
19827
|
}
|
|
19709
19828
|
}
|
|
19710
19829
|
__name(safeParse, "safeParse");
|
|
19711
|
-
function getCCDisplayName(field) {
|
|
19712
|
-
return camelCase(
|
|
19713
|
-
typeof field.displayName === "string" ? field.displayName : field.path
|
|
19714
|
-
);
|
|
19715
|
-
}
|
|
19716
|
-
__name(getCCDisplayName, "getCCDisplayName");
|
|
19717
|
-
function getFieldsMappedByCCDisplayName(schema) {
|
|
19718
|
-
return schema.fields.reduce((acc, field) => {
|
|
19719
|
-
const ccDisplayName = getCCDisplayName(field);
|
|
19720
|
-
acc[ccDisplayName] = field;
|
|
19721
|
-
return acc;
|
|
19722
|
-
}, {});
|
|
19723
|
-
}
|
|
19724
|
-
__name(getFieldsMappedByCCDisplayName, "getFieldsMappedByCCDisplayName");
|
|
19725
|
-
function orderEntitiesLocal(orderArray, entities, schema, ownProps) {
|
|
19726
|
-
if (orderArray == null ? void 0 : orderArray.length) {
|
|
19727
|
-
const orderFuncs = [];
|
|
19728
|
-
const ascOrDescArray = [];
|
|
19729
|
-
orderArray.forEach((order2) => {
|
|
19730
|
-
const ccDisplayName = order2.replace(/^-/gi, "");
|
|
19731
|
-
const ccFields = getFieldsMappedByCCDisplayName(schema);
|
|
19732
|
-
const field = ccFields[ccDisplayName];
|
|
19733
|
-
if (!field) {
|
|
19734
|
-
throw new Error(
|
|
19735
|
-
"Ruh roh, there should have been a column to sort on for " + order2 + " but none was found in " + schema.fields
|
|
19736
|
-
);
|
|
19737
|
-
}
|
|
19738
|
-
const { path: path2, getValueToFilterOn, sortFn } = field;
|
|
19739
|
-
if (field.type === "timestamp") {
|
|
19740
|
-
ascOrDescArray.push("desc");
|
|
19741
|
-
}
|
|
19742
|
-
ascOrDescArray.push(ccDisplayName === order2 ? "asc" : "desc");
|
|
19743
|
-
if (field.type === "timestamp") {
|
|
19744
|
-
orderFuncs.push((r2) => {
|
|
19745
|
-
const val = get$3(r2, path2);
|
|
19746
|
-
return !!val;
|
|
19747
|
-
});
|
|
19748
|
-
}
|
|
19749
|
-
if (path2 && endsWith$1(path2.toLowerCase(), "id")) {
|
|
19750
|
-
orderFuncs.push((o2) => {
|
|
19751
|
-
return parseInt(get$3(o2, path2), 10);
|
|
19752
|
-
});
|
|
19753
|
-
} else if (sortFn) {
|
|
19754
|
-
const toOrder = Array.isArray(sortFn) ? sortFn : [sortFn];
|
|
19755
|
-
orderFuncs.push(...toOrder);
|
|
19756
|
-
} else if (getValueToFilterOn) {
|
|
19757
|
-
orderFuncs.push((o2) => {
|
|
19758
|
-
return getValueToFilterOn(o2, ownProps);
|
|
19759
|
-
});
|
|
19760
|
-
} else {
|
|
19761
|
-
orderFuncs.push((r2) => {
|
|
19762
|
-
const val = get$3(r2, path2);
|
|
19763
|
-
return val && val.toLowerCase ? val.toLowerCase() : val;
|
|
19764
|
-
});
|
|
19765
|
-
}
|
|
19766
|
-
});
|
|
19767
|
-
entities = orderBy$1(entities, orderFuncs, ascOrDescArray);
|
|
19768
|
-
}
|
|
19769
|
-
return entities;
|
|
19770
|
-
}
|
|
19771
|
-
__name(orderEntitiesLocal, "orderEntitiesLocal");
|
|
19772
|
-
function getAndAndOrFilters(allFilters) {
|
|
19773
|
-
const orFilters = [];
|
|
19774
|
-
const andFilters = [];
|
|
19775
|
-
const otherOrFilters = [];
|
|
19776
|
-
allFilters.forEach((filter2) => {
|
|
19777
|
-
if (filter2.isOrFilter && typeof filter2.filterValue === "string" && filter2.filterValue.includes(",")) {
|
|
19778
|
-
const allFilterValues = filter2.filterValue.split(",");
|
|
19779
|
-
allFilterValues.forEach((filterValue, i2) => {
|
|
19780
|
-
filterValue = filterValue.trim();
|
|
19781
|
-
if (!filterValue) return;
|
|
19782
|
-
const newFilter = __spreadProps(__spreadValues({}, filter2), {
|
|
19783
|
-
filterValue
|
|
19784
|
-
});
|
|
19785
|
-
if (i2 === 0) {
|
|
19786
|
-
orFilters.push(newFilter);
|
|
19787
|
-
} else {
|
|
19788
|
-
const iMinus = i2 - 1;
|
|
19789
|
-
if (!otherOrFilters[iMinus]) otherOrFilters[iMinus] = [];
|
|
19790
|
-
otherOrFilters[iMinus].push(newFilter);
|
|
19791
|
-
}
|
|
19792
|
-
});
|
|
19793
|
-
} else if (filter2.isOrFilter) {
|
|
19794
|
-
orFilters.push(filter2);
|
|
19795
|
-
} else {
|
|
19796
|
-
andFilters.push(filter2);
|
|
19797
|
-
}
|
|
19798
|
-
});
|
|
19799
|
-
return {
|
|
19800
|
-
orFilters,
|
|
19801
|
-
andFilters,
|
|
19802
|
-
otherOrFilters
|
|
19803
|
-
};
|
|
19804
|
-
}
|
|
19805
|
-
__name(getAndAndOrFilters, "getAndAndOrFilters");
|
|
19806
|
-
function filterEntitiesLocal(filters = [], searchTerm, entities, schema, ownProps) {
|
|
19807
|
-
const allFilters = getAllFilters(filters, searchTerm, schema);
|
|
19808
|
-
if (allFilters.length) {
|
|
19809
|
-
const ccFields = getFieldsMappedByCCDisplayName(schema);
|
|
19810
|
-
const { andFilters, orFilters, otherOrFilters } = getAndAndOrFilters(allFilters);
|
|
19811
|
-
andFilters.forEach((filter2) => {
|
|
19812
|
-
entities = getEntitiesForGivenFilter(
|
|
19813
|
-
entities,
|
|
19814
|
-
filter2,
|
|
19815
|
-
ccFields,
|
|
19816
|
-
ownProps
|
|
19817
|
-
);
|
|
19818
|
-
});
|
|
19819
|
-
if (orFilters.length) {
|
|
19820
|
-
let orEntities = [];
|
|
19821
|
-
orFilters.concat(...otherOrFilters).forEach((filter2) => {
|
|
19822
|
-
orEntities = orEntities.concat(
|
|
19823
|
-
getEntitiesForGivenFilter(entities, filter2, ccFields, ownProps)
|
|
19824
|
-
);
|
|
19825
|
-
});
|
|
19826
|
-
entities = uniq(orEntities);
|
|
19827
|
-
}
|
|
19828
|
-
}
|
|
19829
|
-
return entities;
|
|
19830
|
-
}
|
|
19831
|
-
__name(filterEntitiesLocal, "filterEntitiesLocal");
|
|
19832
|
-
function cleanFilterValue(_filterValue, type2) {
|
|
19833
|
-
let filterValue = _filterValue;
|
|
19834
|
-
if (type2 === "number" || type2 === "integer") {
|
|
19835
|
-
filterValue = Array.isArray(filterValue) ? filterValue.map((val) => Number(val)) : Number(filterValue);
|
|
19836
|
-
}
|
|
19837
|
-
return filterValue;
|
|
19838
|
-
}
|
|
19839
|
-
__name(cleanFilterValue, "cleanFilterValue");
|
|
19840
|
-
function getEntitiesForGivenFilter(entities, filter2, ccFields, ownProps) {
|
|
19841
|
-
const { filterOn, filterValue: _filterValue, selectedFilter } = filter2;
|
|
19842
|
-
const field = ccFields[filterOn];
|
|
19843
|
-
const { path: path2, getValueToFilterOn } = field;
|
|
19844
|
-
const filterValue = cleanFilterValue(_filterValue, field.type);
|
|
19845
|
-
const subFilter = getSubFilter(false, selectedFilter, filterValue);
|
|
19846
|
-
entities = entities.filter((entity) => {
|
|
19847
|
-
const fieldVal = getValueToFilterOn ? getValueToFilterOn(entity, ownProps) : get$3(entity, path2);
|
|
19848
|
-
const shouldKeep = subFilter(fieldVal);
|
|
19849
|
-
return shouldKeep;
|
|
19850
|
-
});
|
|
19851
|
-
return entities;
|
|
19852
|
-
}
|
|
19853
|
-
__name(getEntitiesForGivenFilter, "getEntitiesForGivenFilter");
|
|
19854
|
-
function getFiltersFromSearchTerm(searchTerm, schema) {
|
|
19855
|
-
const searchTermFilters = [];
|
|
19856
|
-
if (searchTerm) {
|
|
19857
|
-
const sharedFields = {
|
|
19858
|
-
isOrFilter: true,
|
|
19859
|
-
isSearchTermFilter: true
|
|
19860
|
-
};
|
|
19861
|
-
schema.fields.forEach((field) => {
|
|
19862
|
-
const { type: type2, searchDisabled } = field;
|
|
19863
|
-
if (searchDisabled || field.filterDisabled || type2 === "color") return;
|
|
19864
|
-
const ccDisplayName = getCCDisplayName(field);
|
|
19865
|
-
const filterValue = cleanFilterValue(searchTerm, type2);
|
|
19866
|
-
if (type2 === "string" || type2 === "lookup") {
|
|
19867
|
-
searchTermFilters.push(__spreadProps(__spreadValues({}, sharedFields), {
|
|
19868
|
-
filterOn: ccDisplayName,
|
|
19869
|
-
filterValue: searchTerm,
|
|
19870
|
-
selectedFilter: "contains"
|
|
19871
|
-
}));
|
|
19872
|
-
} else if (type2 === "boolean") {
|
|
19873
|
-
let regex;
|
|
19874
|
-
try {
|
|
19875
|
-
regex = new RegExp("^" + searchTerm, "ig");
|
|
19876
|
-
} catch (error) {
|
|
19877
|
-
}
|
|
19878
|
-
if (regex) {
|
|
19879
|
-
if ("true".replace(regex, "") !== "true") {
|
|
19880
|
-
searchTermFilters.push(__spreadProps(__spreadValues({}, sharedFields), {
|
|
19881
|
-
filterOn: ccDisplayName,
|
|
19882
|
-
filterValue: true,
|
|
19883
|
-
selectedFilter: "true"
|
|
19884
|
-
}));
|
|
19885
|
-
} else if ("false".replace(regex, "") !== "false") {
|
|
19886
|
-
searchTermFilters.push(__spreadProps(__spreadValues({}, sharedFields), {
|
|
19887
|
-
filterOn: ccDisplayName,
|
|
19888
|
-
filterValue: false,
|
|
19889
|
-
selectedFilter: "false"
|
|
19890
|
-
}));
|
|
19891
|
-
}
|
|
19892
|
-
}
|
|
19893
|
-
} else if ((type2 === "number" || type2 === "integer") && !isNaN(filterValue)) {
|
|
19894
|
-
if (type2 === "integer" && !isInteger(filterValue)) {
|
|
19895
|
-
return;
|
|
19896
|
-
}
|
|
19897
|
-
searchTermFilters.push(__spreadProps(__spreadValues({}, sharedFields), {
|
|
19898
|
-
filterOn: ccDisplayName,
|
|
19899
|
-
filterValue,
|
|
19900
|
-
selectedFilter: "equalTo"
|
|
19901
|
-
}));
|
|
19902
|
-
}
|
|
19903
|
-
});
|
|
19904
|
-
}
|
|
19905
|
-
return searchTermFilters;
|
|
19906
|
-
}
|
|
19907
|
-
__name(getFiltersFromSearchTerm, "getFiltersFromSearchTerm");
|
|
19908
|
-
function getSubFilter(qb, selectedFilter, filterValue) {
|
|
19909
|
-
const ccSelectedFilter = camelCase(selectedFilter);
|
|
19910
|
-
let stringFilterValue = filterValue && filterValue.toString ? filterValue.toString() : filterValue;
|
|
19911
|
-
if (stringFilterValue === false) {
|
|
19912
|
-
stringFilterValue = "false";
|
|
19913
|
-
} else {
|
|
19914
|
-
stringFilterValue = stringFilterValue || "";
|
|
19915
|
-
}
|
|
19916
|
-
const filterValLower = stringFilterValue.toLowerCase && stringFilterValue.toLowerCase();
|
|
19917
|
-
const arrayFilterValue = Array.isArray(filterValue) ? filterValue : stringFilterValue.split(";");
|
|
19918
|
-
if (ccSelectedFilter === "startsWith") {
|
|
19919
|
-
return qb ? qb.startsWith(stringFilterValue) : (fieldVal) => {
|
|
19920
|
-
if (!fieldVal || !fieldVal.toLowerCase) return false;
|
|
19921
|
-
return startsWith(fieldVal.toLowerCase(), filterValLower);
|
|
19922
|
-
};
|
|
19923
|
-
} else if (ccSelectedFilter === "endsWith") {
|
|
19924
|
-
return qb ? qb.endsWith(stringFilterValue) : (fieldVal) => {
|
|
19925
|
-
if (!fieldVal || !fieldVal.toLowerCase) return false;
|
|
19926
|
-
return endsWith$1(fieldVal.toLowerCase(), filterValLower);
|
|
19927
|
-
};
|
|
19928
|
-
} else if (ccSelectedFilter === "contains" || ccSelectedFilter === "notContains") {
|
|
19929
|
-
return qb ? ccSelectedFilter === "contains" ? qb.contains(stringFilterValue.replace(/_/g, "\\_")) : qb.notContains(stringFilterValue.replace(/_/g, "\\_")) : (fieldVal) => {
|
|
19930
|
-
if (!fieldVal || !fieldVal.toLowerCase) return false;
|
|
19931
|
-
return ccSelectedFilter === "contains" ? fieldVal.toLowerCase().replace(filterValLower, "") !== fieldVal.toLowerCase() : fieldVal.toLowerCase().replace(filterValLower, "") === fieldVal.toLowerCase();
|
|
19932
|
-
};
|
|
19933
|
-
} else if (ccSelectedFilter === "inList") {
|
|
19934
|
-
return qb ? qb.inList(arrayFilterValue) : (fieldVal) => {
|
|
19935
|
-
if (!(fieldVal == null ? void 0 : fieldVal.toString)) return false;
|
|
19936
|
-
return arrayFilterValue.map((val) => {
|
|
19937
|
-
if (val) {
|
|
19938
|
-
if (val.toString) return val.toString().toLowerCase();
|
|
19939
|
-
return val.toLowerCase();
|
|
19940
|
-
}
|
|
19941
|
-
return void 0;
|
|
19942
|
-
}).indexOf(fieldVal.toString().toLowerCase()) > -1;
|
|
19943
|
-
};
|
|
19944
|
-
} else if (ccSelectedFilter === "notInList") {
|
|
19945
|
-
return qb ? qb.notInList(arrayFilterValue) : (fieldVal) => {
|
|
19946
|
-
if (!(fieldVal == null ? void 0 : fieldVal.toString)) return false;
|
|
19947
|
-
return arrayFilterValue.map((val) => {
|
|
19948
|
-
if (val) {
|
|
19949
|
-
if (val.toString) return val.toString().toLowerCase();
|
|
19950
|
-
return val.toLowerCase();
|
|
19951
|
-
}
|
|
19952
|
-
return void 0;
|
|
19953
|
-
}).indexOf(fieldVal.toString().toLowerCase()) === -1;
|
|
19954
|
-
};
|
|
19955
|
-
} else if (ccSelectedFilter === "isEmpty") {
|
|
19956
|
-
return qb ? qb.isEmpty() : (fieldVal) => {
|
|
19957
|
-
return !fieldVal;
|
|
19958
|
-
};
|
|
19959
|
-
} else if (ccSelectedFilter === "notEmpty") {
|
|
19960
|
-
return qb ? [qb.notNull(), qb.notEquals("")] : (fieldVal) => {
|
|
19961
|
-
return !!fieldVal;
|
|
19962
|
-
};
|
|
19963
|
-
} else if (ccSelectedFilter === "isExactly") {
|
|
19964
|
-
return qb ? filterValue : (fieldVal) => {
|
|
19965
|
-
return fieldVal === filterValue;
|
|
19966
|
-
};
|
|
19967
|
-
} else if (ccSelectedFilter === "true") {
|
|
19968
|
-
return qb ? qb.equals(true) : (fieldVal) => {
|
|
19969
|
-
return !!fieldVal;
|
|
19970
|
-
};
|
|
19971
|
-
} else if (ccSelectedFilter === "false") {
|
|
19972
|
-
return qb ? qb.equals(false) : (fieldVal) => {
|
|
19973
|
-
return !fieldVal;
|
|
19974
|
-
};
|
|
19975
|
-
} else if (ccSelectedFilter === "isBetween") {
|
|
19976
|
-
return qb ? qb.between(
|
|
19977
|
-
new Date(arrayFilterValue[0]),
|
|
19978
|
-
new Date(new Date(arrayFilterValue[1]).setHours(23, 59))
|
|
19979
|
-
// set end of day for more accurate filtering
|
|
19980
|
-
) : (fieldVal) => {
|
|
19981
|
-
return dayjs(arrayFilterValue[0]).valueOf() <= dayjs(fieldVal).valueOf() && dayjs(fieldVal).valueOf() <= dayjs(arrayFilterValue[1]).valueOf();
|
|
19982
|
-
};
|
|
19983
|
-
} else if (ccSelectedFilter === "notBetween") {
|
|
19984
|
-
return qb ? qb.notBetween(
|
|
19985
|
-
new Date(arrayFilterValue[0]),
|
|
19986
|
-
new Date(new Date(arrayFilterValue[1]).setHours(23, 59))
|
|
19987
|
-
// set end of day for more accurate filtering
|
|
19988
|
-
) : (fieldVal) => {
|
|
19989
|
-
return dayjs(arrayFilterValue[0]).valueOf() > dayjs(fieldVal).valueOf() || dayjs(fieldVal).valueOf() > dayjs(arrayFilterValue[1]).valueOf();
|
|
19990
|
-
};
|
|
19991
|
-
} else if (ccSelectedFilter === "isBefore") {
|
|
19992
|
-
return qb ? qb.lessThan(new Date(filterValue)) : (fieldVal) => {
|
|
19993
|
-
return dayjs(fieldVal).valueOf() < dayjs(filterValue).valueOf();
|
|
19994
|
-
};
|
|
19995
|
-
} else if (ccSelectedFilter === "isAfter") {
|
|
19996
|
-
return qb ? qb.greaterThan(new Date(new Date(filterValue).setHours(23, 59))) : (fieldVal) => {
|
|
19997
|
-
return dayjs(fieldVal).valueOf() > dayjs(filterValue).valueOf();
|
|
19998
|
-
};
|
|
19999
|
-
} else if (ccSelectedFilter === "greaterThan") {
|
|
20000
|
-
return qb ? qb.greaterThan(filterValue) : (fieldVal) => {
|
|
20001
|
-
return fieldVal > filterValue;
|
|
20002
|
-
};
|
|
20003
|
-
} else if (ccSelectedFilter === "lessThan") {
|
|
20004
|
-
return qb ? qb.lessThan(filterValue) : (fieldVal) => {
|
|
20005
|
-
return fieldVal < filterValue;
|
|
20006
|
-
};
|
|
20007
|
-
} else if (ccSelectedFilter === "inRange") {
|
|
20008
|
-
return qb ? qb.between(filterValue[0], filterValue[1]) : (fieldVal) => {
|
|
20009
|
-
return filterValue[0] <= fieldVal && fieldVal <= filterValue[1];
|
|
20010
|
-
};
|
|
20011
|
-
} else if (ccSelectedFilter === "outsideRange") {
|
|
20012
|
-
return qb ? qb.notBetween(filterValue[0], filterValue[1]) : (fieldVal) => {
|
|
20013
|
-
return filterValue[0] > fieldVal || fieldVal > filterValue[1];
|
|
20014
|
-
};
|
|
20015
|
-
} else if (ccSelectedFilter === "equalTo") {
|
|
20016
|
-
return qb ? filterValue : (fieldVal) => {
|
|
20017
|
-
return fieldVal === filterValue;
|
|
20018
|
-
};
|
|
20019
|
-
} else if (ccSelectedFilter === "regex") {
|
|
20020
|
-
return qb ? qb.matchesRegex(filterValue) : (fieldVal) => {
|
|
20021
|
-
new RegExp(filterValue).test(fieldVal);
|
|
20022
|
-
return fieldVal;
|
|
20023
|
-
};
|
|
20024
|
-
}
|
|
20025
|
-
throw new Error(
|
|
20026
|
-
`Unsupported filter ${selectedFilter}. Please make a new filter if you need one`
|
|
20027
|
-
);
|
|
20028
|
-
}
|
|
20029
|
-
__name(getSubFilter, "getSubFilter");
|
|
20030
19830
|
function getCurrentParamsFromUrl(location2, isSimple) {
|
|
20031
19831
|
let { search: search2 } = location2;
|
|
20032
19832
|
if (isSimple) {
|
|
@@ -20098,22 +19898,6 @@ function parseFilters(newParams) {
|
|
|
20098
19898
|
});
|
|
20099
19899
|
}
|
|
20100
19900
|
__name(parseFilters, "parseFilters");
|
|
20101
|
-
function buildRef(qb, reference2, searchField, expression) {
|
|
20102
|
-
if (reference2.reference) {
|
|
20103
|
-
return qb.related(reference2.target).whereAny({
|
|
20104
|
-
[reference2.sourceField]: buildRef(
|
|
20105
|
-
qb,
|
|
20106
|
-
reference2.reference,
|
|
20107
|
-
searchField,
|
|
20108
|
-
expression
|
|
20109
|
-
)
|
|
20110
|
-
});
|
|
20111
|
-
}
|
|
20112
|
-
return qb.related(reference2.target).whereAny({
|
|
20113
|
-
[searchField]: expression
|
|
20114
|
-
});
|
|
20115
|
-
}
|
|
20116
|
-
__name(buildRef, "buildRef");
|
|
20117
19901
|
function makeDataTableHandlers({
|
|
20118
19902
|
setNewParams,
|
|
20119
19903
|
defaults,
|
|
@@ -20201,40 +19985,18 @@ function makeDataTableHandlers({
|
|
|
20201
19985
|
};
|
|
20202
19986
|
}
|
|
20203
19987
|
__name(makeDataTableHandlers, "makeDataTableHandlers");
|
|
20204
|
-
function cleanupFilter(filter2) {
|
|
20205
|
-
let filterToUse = filter2;
|
|
20206
|
-
if (filterToUse.selectedFilter === "inList" && typeof filterToUse.filterValue === "number") {
|
|
20207
|
-
filterToUse = __spreadProps(__spreadValues({}, filterToUse), {
|
|
20208
|
-
filterValue: filterToUse.filterValue.toString()
|
|
20209
|
-
});
|
|
20210
|
-
}
|
|
20211
|
-
return filterToUse;
|
|
20212
|
-
}
|
|
20213
|
-
__name(cleanupFilter, "cleanupFilter");
|
|
20214
|
-
function getAllFilters(filters, searchTerm, schema) {
|
|
20215
|
-
let allFilters = [
|
|
20216
|
-
...filters,
|
|
20217
|
-
...getFiltersFromSearchTerm(searchTerm, schema)
|
|
20218
|
-
];
|
|
20219
|
-
allFilters = allFilters.filter((val) => {
|
|
20220
|
-
return val !== "";
|
|
20221
|
-
});
|
|
20222
|
-
return allFilters.map(cleanupFilter);
|
|
20223
|
-
}
|
|
20224
|
-
__name(getAllFilters, "getAllFilters");
|
|
20225
19988
|
function getQueryParams({
|
|
20226
19989
|
currentParams,
|
|
20227
|
-
urlConnected,
|
|
19990
|
+
// urlConnected,
|
|
20228
19991
|
defaults,
|
|
20229
19992
|
schema,
|
|
20230
19993
|
isInfinite,
|
|
20231
19994
|
entities,
|
|
20232
19995
|
isLocalCall,
|
|
20233
19996
|
additionalFilter,
|
|
20234
|
-
additionalOrFilter,
|
|
20235
19997
|
doNotCoercePageSize,
|
|
20236
19998
|
noOrderError,
|
|
20237
|
-
isCodeModel,
|
|
19999
|
+
// isCodeModel,
|
|
20238
20000
|
ownProps
|
|
20239
20001
|
}) {
|
|
20240
20002
|
Object.keys(currentParams).forEach(function(key) {
|
|
@@ -20257,232 +20019,65 @@ function getQueryParams({
|
|
|
20257
20019
|
)[0];
|
|
20258
20020
|
pageSize = closest;
|
|
20259
20021
|
}
|
|
20260
|
-
const
|
|
20022
|
+
const cleanedOrder = [];
|
|
20023
|
+
if (order2 && order2.length) {
|
|
20024
|
+
const ccFields = getFieldsMappedByCCDisplayName(schema);
|
|
20025
|
+
order2.forEach((orderVal) => {
|
|
20026
|
+
const ccDisplayName = orderVal.replace(/^-/gi, "");
|
|
20027
|
+
const schemaForField = ccFields[ccDisplayName];
|
|
20028
|
+
if (schemaForField) {
|
|
20029
|
+
const { path: path2 } = schemaForField;
|
|
20030
|
+
const reversed = ccDisplayName !== orderVal;
|
|
20031
|
+
const prefix2 = reversed ? "-" : "";
|
|
20032
|
+
cleanedOrder.push(prefix2 + path2);
|
|
20033
|
+
} else {
|
|
20034
|
+
!noOrderError && console.error(
|
|
20035
|
+
"No schema for field found!",
|
|
20036
|
+
ccDisplayName,
|
|
20037
|
+
JSON.stringify(schema.fields, null, 2)
|
|
20038
|
+
);
|
|
20039
|
+
}
|
|
20040
|
+
});
|
|
20041
|
+
}
|
|
20042
|
+
let toRet = {
|
|
20261
20043
|
//these are values that might be generally useful for the wrapped component
|
|
20262
20044
|
page,
|
|
20263
20045
|
pageSize: ownProps.controlled_pageSize || pageSize,
|
|
20264
|
-
order:
|
|
20046
|
+
order: cleanedOrder,
|
|
20265
20047
|
filters,
|
|
20266
20048
|
searchTerm
|
|
20267
20049
|
};
|
|
20050
|
+
const { where, order_by, limit, offset: offset3 } = tableQueryParamsToHasuraClauses({
|
|
20051
|
+
page,
|
|
20052
|
+
pageSize,
|
|
20053
|
+
searchTerm,
|
|
20054
|
+
filters,
|
|
20055
|
+
order: cleanedOrder,
|
|
20056
|
+
schema
|
|
20057
|
+
});
|
|
20058
|
+
initializeHasuraWhereAndFilter(additionalFilter, where, currentParams);
|
|
20059
|
+
addCustomColumnFilters(where, schema.fields, currentParams);
|
|
20268
20060
|
if (isLocalCall) {
|
|
20269
|
-
|
|
20270
|
-
|
|
20271
|
-
|
|
20272
|
-
|
|
20273
|
-
|
|
20274
|
-
|
|
20275
|
-
|
|
20276
|
-
|
|
20277
|
-
newEntities = orderEntitiesLocal(order2, newEntities, schema, ownProps);
|
|
20278
|
-
const entitiesAcrossPages = newEntities;
|
|
20279
|
-
const newEntityCount = newEntities.length;
|
|
20280
|
-
if (!isInfinite && !ownProps.controlled_pageSize) {
|
|
20281
|
-
const offset3 = (page - 1) * pageSize;
|
|
20282
|
-
newEntities = take(drop(newEntities, offset3), pageSize);
|
|
20283
|
-
}
|
|
20284
|
-
toReturn.entities = newEntities;
|
|
20285
|
-
toReturn.entitiesAcrossPages = entitiesAcrossPages;
|
|
20286
|
-
toReturn.entityCount = newEntityCount;
|
|
20287
|
-
return toReturn;
|
|
20061
|
+
toRet = __spreadValues(__spreadValues({}, toRet), filterLocalEntitiesToHasura(entities, {
|
|
20062
|
+
where,
|
|
20063
|
+
order_by,
|
|
20064
|
+
limit,
|
|
20065
|
+
offset: offset3,
|
|
20066
|
+
isInfinite
|
|
20067
|
+
}));
|
|
20068
|
+
return toRet;
|
|
20288
20069
|
} else {
|
|
20289
|
-
|
|
20290
|
-
|
|
20291
|
-
|
|
20292
|
-
|
|
20293
|
-
|
|
20294
|
-
|
|
20295
|
-
graphqlQueryParams.pageNumber = 1;
|
|
20296
|
-
} else {
|
|
20297
|
-
graphqlQueryParams.pageNumber = Number(page);
|
|
20298
|
-
graphqlQueryParams.pageSize = ownProps.controlled_pageSize || Number(pageSize);
|
|
20299
|
-
}
|
|
20300
|
-
const { model } = schema;
|
|
20301
|
-
if (!window.QueryBuilder) return toReturn;
|
|
20302
|
-
const qb = new window.QueryBuilder(model);
|
|
20303
|
-
const ccFields = getFieldsMappedByCCDisplayName(schema);
|
|
20304
|
-
if (tableQueryParams.order && tableQueryParams.order.length) {
|
|
20305
|
-
tableQueryParams.order.forEach((orderVal) => {
|
|
20306
|
-
const ccDisplayName = orderVal.replace(/^-/gi, "");
|
|
20307
|
-
const schemaForField = ccFields[ccDisplayName];
|
|
20308
|
-
if (schemaForField) {
|
|
20309
|
-
const { path: path2 } = schemaForField;
|
|
20310
|
-
const reversed = ccDisplayName !== orderVal;
|
|
20311
|
-
const prefix2 = reversed ? "-" : "";
|
|
20312
|
-
graphqlQueryParams.sort = [
|
|
20313
|
-
...graphqlQueryParams.sort || [],
|
|
20314
|
-
prefix2 + path2
|
|
20315
|
-
];
|
|
20316
|
-
} else {
|
|
20317
|
-
!noOrderError && console.error(
|
|
20318
|
-
"No schema for field found!",
|
|
20319
|
-
ccDisplayName,
|
|
20320
|
-
JSON.stringify(schema.fields, null, 2)
|
|
20321
|
-
);
|
|
20322
|
-
}
|
|
20323
|
-
});
|
|
20324
|
-
}
|
|
20325
|
-
let errorParsingUrlString;
|
|
20326
|
-
const additionalFilterToUse = additionalFilter(qb, currentParams);
|
|
20327
|
-
let additionalOrFilterToUse = additionalOrFilter(qb, currentParams);
|
|
20328
|
-
if (additionalOrFilterToUse && additionalOrFilterToUse.ignoreSearchTerm) {
|
|
20329
|
-
searchTerm = "";
|
|
20330
|
-
additionalOrFilterToUse = additionalOrFilterToUse.additionalOrFilterToUse;
|
|
20331
|
-
}
|
|
20332
|
-
const allFilters = getAllFilters(filters, searchTerm, schema);
|
|
20333
|
-
const { andFilters, orFilters, otherOrFilters } = getAndAndOrFilters(allFilters);
|
|
20334
|
-
try {
|
|
20335
|
-
const flattenFilters = /* @__PURE__ */ __name((filterObj) => {
|
|
20336
|
-
return flatMap(Object.keys(filterObj), (key) => {
|
|
20337
|
-
return filterObj[key].map((filter2) => ({
|
|
20338
|
-
[key]: filter2
|
|
20339
|
-
}));
|
|
20340
|
-
});
|
|
20341
|
-
}, "flattenFilters");
|
|
20342
|
-
const orFiltersObject = getQueries(orFilters, qb, ccFields);
|
|
20343
|
-
let allOrFilters = flattenFilters(orFiltersObject);
|
|
20344
|
-
otherOrFilters.forEach((orFilters2) => {
|
|
20345
|
-
const otherOrFiltersObject = getQueries(orFilters2, qb, ccFields);
|
|
20346
|
-
allOrFilters = allOrFilters.concat(
|
|
20347
|
-
flattenFilters(otherOrFiltersObject)
|
|
20348
|
-
);
|
|
20349
|
-
});
|
|
20350
|
-
allOrFilters.push(additionalOrFilterToUse);
|
|
20351
|
-
allOrFilters = allOrFilters.filter((obj) => !isEmpty$1(obj));
|
|
20352
|
-
const unflattenedAndQueries = getQueries(andFilters, qb, ccFields);
|
|
20353
|
-
let allAndFilters = flattenFilters(unflattenedAndQueries);
|
|
20354
|
-
allAndFilters.push(additionalFilterToUse);
|
|
20355
|
-
allAndFilters = allAndFilters.filter((obj) => !isEmpty$1(obj));
|
|
20356
|
-
if (allAndFilters.length) {
|
|
20357
|
-
qb.whereAll(...allAndFilters);
|
|
20358
|
-
}
|
|
20359
|
-
if (allOrFilters.length) {
|
|
20360
|
-
qb.andWhereAny(...allOrFilters);
|
|
20361
|
-
}
|
|
20362
|
-
const columnCustomFilters = getColumnCustomFilters(
|
|
20363
|
-
andFilters,
|
|
20364
|
-
qb,
|
|
20365
|
-
ccFields
|
|
20366
|
-
);
|
|
20367
|
-
if (columnCustomFilters.length) {
|
|
20368
|
-
qb.whereAll(...columnCustomFilters);
|
|
20369
|
-
}
|
|
20370
|
-
} catch (e) {
|
|
20371
|
-
if (urlConnected) {
|
|
20372
|
-
errorParsingUrlString = e;
|
|
20373
|
-
console.error(
|
|
20374
|
-
"The following error occurred when trying to build the query params. This is probably due to a malformed URL:",
|
|
20375
|
-
e
|
|
20376
|
-
);
|
|
20377
|
-
} else {
|
|
20378
|
-
console.error("Error building query params from filter:");
|
|
20379
|
-
throw e;
|
|
20070
|
+
return __spreadProps(__spreadValues({}, toRet), {
|
|
20071
|
+
variables: {
|
|
20072
|
+
where,
|
|
20073
|
+
order_by,
|
|
20074
|
+
limit,
|
|
20075
|
+
offset: offset3
|
|
20380
20076
|
}
|
|
20381
|
-
}
|
|
20382
|
-
if (qb.query.filters.length) {
|
|
20383
|
-
graphqlQueryParams.filter = qb.toJSON();
|
|
20384
|
-
}
|
|
20385
|
-
if (!graphqlQueryParams.sort.length) {
|
|
20386
|
-
graphqlQueryParams.sort.push("-updatedAt");
|
|
20387
|
-
}
|
|
20388
|
-
graphqlQueryParams.sort.push(
|
|
20389
|
-
isCodeModel ? "code" : window.__sortId || "id"
|
|
20390
|
-
);
|
|
20391
|
-
return __spreadProps(__spreadValues({}, toReturn), {
|
|
20392
|
-
//the query params will get passed directly to as variables to the graphql query
|
|
20393
|
-
variables: graphqlQueryParams,
|
|
20394
|
-
errorParsingUrlString
|
|
20395
20077
|
});
|
|
20396
20078
|
}
|
|
20397
20079
|
}
|
|
20398
20080
|
__name(getQueryParams, "getQueryParams");
|
|
20399
|
-
function getSubFiltersAndPath(filter2, qb, ccFields) {
|
|
20400
|
-
const { selectedFilter, filterValue, filterOn } = filter2;
|
|
20401
|
-
const fieldSchema = ccFields[filterOn];
|
|
20402
|
-
let filterValueToUse = filterValue;
|
|
20403
|
-
if (fieldSchema) {
|
|
20404
|
-
if (fieldSchema.normalizeFilter) {
|
|
20405
|
-
filterValueToUse = fieldSchema.normalizeFilter(
|
|
20406
|
-
filterValue,
|
|
20407
|
-
selectedFilter,
|
|
20408
|
-
filterOn
|
|
20409
|
-
);
|
|
20410
|
-
}
|
|
20411
|
-
}
|
|
20412
|
-
const _subFilters = getSubFilter(qb, selectedFilter, filterValueToUse);
|
|
20413
|
-
let filterField;
|
|
20414
|
-
if (fieldSchema) {
|
|
20415
|
-
const { path: path2, reference: reference2 } = fieldSchema;
|
|
20416
|
-
if (reference2) {
|
|
20417
|
-
filterField = reference2.sourceField;
|
|
20418
|
-
} else {
|
|
20419
|
-
filterField = path2;
|
|
20420
|
-
}
|
|
20421
|
-
} else if (filterOn === "id") {
|
|
20422
|
-
filterField = filterOn;
|
|
20423
|
-
} else {
|
|
20424
|
-
console.error("Trying to filter on unknown field");
|
|
20425
|
-
}
|
|
20426
|
-
const subFiltersToUse = [];
|
|
20427
|
-
const subFilters = Array.isArray(_subFilters) ? _subFilters : [_subFilters];
|
|
20428
|
-
subFilters.forEach((subFilter) => {
|
|
20429
|
-
let subFilterToUse = subFilter;
|
|
20430
|
-
if (fieldSchema) {
|
|
20431
|
-
const { path: path2, reference: reference2 } = fieldSchema;
|
|
20432
|
-
if (reference2) {
|
|
20433
|
-
subFilterToUse = buildRef(
|
|
20434
|
-
qb,
|
|
20435
|
-
reference2,
|
|
20436
|
-
last$1(path2.split(".")),
|
|
20437
|
-
subFilter
|
|
20438
|
-
);
|
|
20439
|
-
}
|
|
20440
|
-
}
|
|
20441
|
-
subFiltersToUse.push(subFilterToUse);
|
|
20442
|
-
});
|
|
20443
|
-
return {
|
|
20444
|
-
path: filterField,
|
|
20445
|
-
subFilters: subFiltersToUse
|
|
20446
|
-
};
|
|
20447
|
-
}
|
|
20448
|
-
__name(getSubFiltersAndPath, "getSubFiltersAndPath");
|
|
20449
|
-
function getQueries(filters, qb, ccFields) {
|
|
20450
|
-
const subQueries = filters.reduce((acc, filter2) => {
|
|
20451
|
-
if (!filter2) {
|
|
20452
|
-
console.warn("We should always have a filter object!");
|
|
20453
|
-
return acc;
|
|
20454
|
-
}
|
|
20455
|
-
const { filterOn } = filter2;
|
|
20456
|
-
const fieldSchema = ccFields[filterOn];
|
|
20457
|
-
if (!filter2.isSearchTermFilter && (fieldSchema == null ? void 0 : fieldSchema.additionalColumnFilter))
|
|
20458
|
-
return acc;
|
|
20459
|
-
const { path: path2, subFilters } = getSubFiltersAndPath(filter2, qb, ccFields);
|
|
20460
|
-
acc[path2] = subFilters;
|
|
20461
|
-
return acc;
|
|
20462
|
-
}, {});
|
|
20463
|
-
return subQueries;
|
|
20464
|
-
}
|
|
20465
|
-
__name(getQueries, "getQueries");
|
|
20466
|
-
function getColumnCustomFilters(filters, qb, ccFields) {
|
|
20467
|
-
const subQueries = filters.reduce((acc, filter2) => {
|
|
20468
|
-
if (!filter2) {
|
|
20469
|
-
console.warn("We should always have a filter object!");
|
|
20470
|
-
return acc;
|
|
20471
|
-
}
|
|
20472
|
-
const { filterOn } = filter2;
|
|
20473
|
-
const fieldSchema = ccFields[filterOn];
|
|
20474
|
-
if (filter2.isSearchTermFilter || !(fieldSchema == null ? void 0 : fieldSchema.additionalColumnFilter)) {
|
|
20475
|
-
return acc;
|
|
20476
|
-
}
|
|
20477
|
-
const { path: path2, subFilters } = getSubFiltersAndPath(filter2, qb, ccFields);
|
|
20478
|
-
subFilters.forEach((subFilter) => {
|
|
20479
|
-
acc.push(fieldSchema.additionalColumnFilter(qb, subFilter, path2));
|
|
20480
|
-
});
|
|
20481
|
-
return acc;
|
|
20482
|
-
}, []);
|
|
20483
|
-
return subQueries;
|
|
20484
|
-
}
|
|
20485
|
-
__name(getColumnCustomFilters, "getColumnCustomFilters");
|
|
20486
20081
|
function PagingInput({ disabled, onBlur, defaultPage }) {
|
|
20487
20082
|
const [page, setPage] = React.useState(defaultPage);
|
|
20488
20083
|
const defaultValue2 = React.useRef(defaultPage);
|
|
@@ -32996,6 +32591,293 @@ const InfoHelper = /* @__PURE__ */ __name((_g) => {
|
|
|
32996
32591
|
toReturn
|
|
32997
32592
|
);
|
|
32998
32593
|
}, "InfoHelper");
|
|
32594
|
+
var dayjs_min$1 = { exports: {} };
|
|
32595
|
+
var dayjs_min = dayjs_min$1.exports;
|
|
32596
|
+
var hasRequiredDayjs_min;
|
|
32597
|
+
function requireDayjs_min() {
|
|
32598
|
+
if (hasRequiredDayjs_min) return dayjs_min$1.exports;
|
|
32599
|
+
hasRequiredDayjs_min = 1;
|
|
32600
|
+
(function(module2, exports2) {
|
|
32601
|
+
!function(t2, e) {
|
|
32602
|
+
module2.exports = e();
|
|
32603
|
+
}(dayjs_min, function() {
|
|
32604
|
+
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) {
|
|
32605
|
+
var e2 = ["th", "st", "nd", "rd"], n3 = t3 % 100;
|
|
32606
|
+
return "[" + t3 + (e2[(n3 - 20) % 10] || e2[n3] || e2[0]) + "]";
|
|
32607
|
+
}, "ordinal") }, m2 = /* @__PURE__ */ __name(function(t3, e2, n3) {
|
|
32608
|
+
var r3 = String(t3);
|
|
32609
|
+
return !r3 || r3.length >= e2 ? t3 : "" + Array(e2 + 1 - r3.length).join(n3) + t3;
|
|
32610
|
+
}, "m"), v2 = { s: m2, z: /* @__PURE__ */ __name(function(t3) {
|
|
32611
|
+
var e2 = -t3.utcOffset(), n3 = Math.abs(e2), r3 = Math.floor(n3 / 60), i3 = n3 % 60;
|
|
32612
|
+
return (e2 <= 0 ? "+" : "-") + m2(r3, 2, "0") + ":" + m2(i3, 2, "0");
|
|
32613
|
+
}, "z"), m: /* @__PURE__ */ __name(function t3(e2, n3) {
|
|
32614
|
+
if (e2.date() < n3.date()) return -t3(n3, e2);
|
|
32615
|
+
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);
|
|
32616
|
+
return +(-(r3 + (n3 - i3) / (s3 ? i3 - u3 : u3 - i3)) || 0);
|
|
32617
|
+
}, "t"), a: /* @__PURE__ */ __name(function(t3) {
|
|
32618
|
+
return t3 < 0 ? Math.ceil(t3) || 0 : Math.floor(t3);
|
|
32619
|
+
}, "a"), p: /* @__PURE__ */ __name(function(t3) {
|
|
32620
|
+
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$/, "");
|
|
32621
|
+
}, "p"), u: /* @__PURE__ */ __name(function(t3) {
|
|
32622
|
+
return void 0 === t3;
|
|
32623
|
+
}, "u") }, g2 = "en", D2 = {};
|
|
32624
|
+
D2[g2] = M2;
|
|
32625
|
+
var p2 = "$isDayjsObject", S2 = /* @__PURE__ */ __name(function(t3) {
|
|
32626
|
+
return t3 instanceof _2 || !(!t3 || !t3[p2]);
|
|
32627
|
+
}, "S"), w2 = /* @__PURE__ */ __name(function t3(e2, n3, r3) {
|
|
32628
|
+
var i3;
|
|
32629
|
+
if (!e2) return g2;
|
|
32630
|
+
if ("string" == typeof e2) {
|
|
32631
|
+
var s3 = e2.toLowerCase();
|
|
32632
|
+
D2[s3] && (i3 = s3), n3 && (D2[s3] = n3, i3 = s3);
|
|
32633
|
+
var u3 = e2.split("-");
|
|
32634
|
+
if (!i3 && u3.length > 1) return t3(u3[0]);
|
|
32635
|
+
} else {
|
|
32636
|
+
var a3 = e2.name;
|
|
32637
|
+
D2[a3] = e2, i3 = a3;
|
|
32638
|
+
}
|
|
32639
|
+
return !r3 && i3 && (g2 = i3), i3 || !r3 && g2;
|
|
32640
|
+
}, "t"), O2 = /* @__PURE__ */ __name(function(t3, e2) {
|
|
32641
|
+
if (S2(t3)) return t3.clone();
|
|
32642
|
+
var n3 = "object" == typeof e2 ? e2 : {};
|
|
32643
|
+
return n3.date = t3, n3.args = arguments, new _2(n3);
|
|
32644
|
+
}, "O"), b2 = v2;
|
|
32645
|
+
b2.l = w2, b2.i = S2, b2.w = function(t3, e2) {
|
|
32646
|
+
return O2(t3, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
|
|
32647
|
+
};
|
|
32648
|
+
var _2 = function() {
|
|
32649
|
+
function M3(t3) {
|
|
32650
|
+
this.$L = w2(t3.locale, null, true), this.parse(t3), this.$x = this.$x || t3.x || {}, this[p2] = true;
|
|
32651
|
+
}
|
|
32652
|
+
__name(M3, "M");
|
|
32653
|
+
var m3 = M3.prototype;
|
|
32654
|
+
return m3.parse = function(t3) {
|
|
32655
|
+
this.$d = function(t4) {
|
|
32656
|
+
var e2 = t4.date, n3 = t4.utc;
|
|
32657
|
+
if (null === e2) return /* @__PURE__ */ new Date(NaN);
|
|
32658
|
+
if (b2.u(e2)) return /* @__PURE__ */ new Date();
|
|
32659
|
+
if (e2 instanceof Date) return new Date(e2);
|
|
32660
|
+
if ("string" == typeof e2 && !/Z$/i.test(e2)) {
|
|
32661
|
+
var r3 = e2.match($);
|
|
32662
|
+
if (r3) {
|
|
32663
|
+
var i3 = r3[2] - 1 || 0, s3 = (r3[7] || "0").substring(0, 3);
|
|
32664
|
+
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);
|
|
32665
|
+
}
|
|
32666
|
+
}
|
|
32667
|
+
return new Date(e2);
|
|
32668
|
+
}(t3), this.init();
|
|
32669
|
+
}, m3.init = function() {
|
|
32670
|
+
var t3 = this.$d;
|
|
32671
|
+
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();
|
|
32672
|
+
}, m3.$utils = function() {
|
|
32673
|
+
return b2;
|
|
32674
|
+
}, m3.isValid = function() {
|
|
32675
|
+
return !(this.$d.toString() === l2);
|
|
32676
|
+
}, m3.isSame = function(t3, e2) {
|
|
32677
|
+
var n3 = O2(t3);
|
|
32678
|
+
return this.startOf(e2) <= n3 && n3 <= this.endOf(e2);
|
|
32679
|
+
}, m3.isAfter = function(t3, e2) {
|
|
32680
|
+
return O2(t3) < this.startOf(e2);
|
|
32681
|
+
}, m3.isBefore = function(t3, e2) {
|
|
32682
|
+
return this.endOf(e2) < O2(t3);
|
|
32683
|
+
}, m3.$g = function(t3, e2, n3) {
|
|
32684
|
+
return b2.u(t3) ? this[e2] : this.set(n3, t3);
|
|
32685
|
+
}, m3.unix = function() {
|
|
32686
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
32687
|
+
}, m3.valueOf = function() {
|
|
32688
|
+
return this.$d.getTime();
|
|
32689
|
+
}, m3.startOf = function(t3, e2) {
|
|
32690
|
+
var n3 = this, r3 = !!b2.u(e2) || e2, f3 = b2.p(t3), l3 = /* @__PURE__ */ __name(function(t4, e3) {
|
|
32691
|
+
var i3 = b2.w(n3.$u ? Date.UTC(n3.$y, e3, t4) : new Date(n3.$y, e3, t4), n3);
|
|
32692
|
+
return r3 ? i3 : i3.endOf(a2);
|
|
32693
|
+
}, "l"), $2 = /* @__PURE__ */ __name(function(t4, e3) {
|
|
32694
|
+
return b2.w(n3.toDate()[t4].apply(n3.toDate("s"), (r3 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n3);
|
|
32695
|
+
}, "$"), y3 = this.$W, M4 = this.$M, m4 = this.$D, v3 = "set" + (this.$u ? "UTC" : "");
|
|
32696
|
+
switch (f3) {
|
|
32697
|
+
case h2:
|
|
32698
|
+
return r3 ? l3(1, 0) : l3(31, 11);
|
|
32699
|
+
case c2:
|
|
32700
|
+
return r3 ? l3(1, M4) : l3(0, M4 + 1);
|
|
32701
|
+
case o2:
|
|
32702
|
+
var g3 = this.$locale().weekStart || 0, D3 = (y3 < g3 ? y3 + 7 : y3) - g3;
|
|
32703
|
+
return l3(r3 ? m4 - D3 : m4 + (6 - D3), M4);
|
|
32704
|
+
case a2:
|
|
32705
|
+
case d2:
|
|
32706
|
+
return $2(v3 + "Hours", 0);
|
|
32707
|
+
case u2:
|
|
32708
|
+
return $2(v3 + "Minutes", 1);
|
|
32709
|
+
case s2:
|
|
32710
|
+
return $2(v3 + "Seconds", 2);
|
|
32711
|
+
case i2:
|
|
32712
|
+
return $2(v3 + "Milliseconds", 3);
|
|
32713
|
+
default:
|
|
32714
|
+
return this.clone();
|
|
32715
|
+
}
|
|
32716
|
+
}, m3.endOf = function(t3) {
|
|
32717
|
+
return this.startOf(t3, false);
|
|
32718
|
+
}, m3.$set = function(t3, e2) {
|
|
32719
|
+
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;
|
|
32720
|
+
if (o3 === c2 || o3 === h2) {
|
|
32721
|
+
var y3 = this.clone().set(d2, 1);
|
|
32722
|
+
y3.$d[l3]($2), y3.init(), this.$d = y3.set(d2, Math.min(this.$D, y3.daysInMonth())).$d;
|
|
32723
|
+
} else l3 && this.$d[l3]($2);
|
|
32724
|
+
return this.init(), this;
|
|
32725
|
+
}, m3.set = function(t3, e2) {
|
|
32726
|
+
return this.clone().$set(t3, e2);
|
|
32727
|
+
}, m3.get = function(t3) {
|
|
32728
|
+
return this[b2.p(t3)]();
|
|
32729
|
+
}, m3.add = function(r3, f3) {
|
|
32730
|
+
var d3, l3 = this;
|
|
32731
|
+
r3 = Number(r3);
|
|
32732
|
+
var $2 = b2.p(f3), y3 = /* @__PURE__ */ __name(function(t3) {
|
|
32733
|
+
var e2 = O2(l3);
|
|
32734
|
+
return b2.w(e2.date(e2.date() + Math.round(t3 * r3)), l3);
|
|
32735
|
+
}, "y");
|
|
32736
|
+
if ($2 === c2) return this.set(c2, this.$M + r3);
|
|
32737
|
+
if ($2 === h2) return this.set(h2, this.$y + r3);
|
|
32738
|
+
if ($2 === a2) return y3(1);
|
|
32739
|
+
if ($2 === o2) return y3(7);
|
|
32740
|
+
var M4 = (d3 = {}, d3[s2] = e, d3[u2] = n2, d3[i2] = t2, d3)[$2] || 1, m4 = this.$d.getTime() + r3 * M4;
|
|
32741
|
+
return b2.w(m4, this);
|
|
32742
|
+
}, m3.subtract = function(t3, e2) {
|
|
32743
|
+
return this.add(-1 * t3, e2);
|
|
32744
|
+
}, m3.format = function(t3) {
|
|
32745
|
+
var e2 = this, n3 = this.$locale();
|
|
32746
|
+
if (!this.isValid()) return n3.invalidDate || l2;
|
|
32747
|
+
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) {
|
|
32748
|
+
return t4 && (t4[n4] || t4(e2, r3)) || i4[n4].slice(0, s4);
|
|
32749
|
+
}, "h"), d3 = /* @__PURE__ */ __name(function(t4) {
|
|
32750
|
+
return b2.s(s3 % 12 || 12, t4, "0");
|
|
32751
|
+
}, "d"), $2 = f3 || function(t4, e3, n4) {
|
|
32752
|
+
var r4 = t4 < 12 ? "AM" : "PM";
|
|
32753
|
+
return n4 ? r4.toLowerCase() : r4;
|
|
32754
|
+
};
|
|
32755
|
+
return r3.replace(y2, function(t4, r4) {
|
|
32756
|
+
return r4 || function(t5) {
|
|
32757
|
+
switch (t5) {
|
|
32758
|
+
case "YY":
|
|
32759
|
+
return String(e2.$y).slice(-2);
|
|
32760
|
+
case "YYYY":
|
|
32761
|
+
return b2.s(e2.$y, 4, "0");
|
|
32762
|
+
case "M":
|
|
32763
|
+
return a3 + 1;
|
|
32764
|
+
case "MM":
|
|
32765
|
+
return b2.s(a3 + 1, 2, "0");
|
|
32766
|
+
case "MMM":
|
|
32767
|
+
return h3(n3.monthsShort, a3, c3, 3);
|
|
32768
|
+
case "MMMM":
|
|
32769
|
+
return h3(c3, a3);
|
|
32770
|
+
case "D":
|
|
32771
|
+
return e2.$D;
|
|
32772
|
+
case "DD":
|
|
32773
|
+
return b2.s(e2.$D, 2, "0");
|
|
32774
|
+
case "d":
|
|
32775
|
+
return String(e2.$W);
|
|
32776
|
+
case "dd":
|
|
32777
|
+
return h3(n3.weekdaysMin, e2.$W, o3, 2);
|
|
32778
|
+
case "ddd":
|
|
32779
|
+
return h3(n3.weekdaysShort, e2.$W, o3, 3);
|
|
32780
|
+
case "dddd":
|
|
32781
|
+
return o3[e2.$W];
|
|
32782
|
+
case "H":
|
|
32783
|
+
return String(s3);
|
|
32784
|
+
case "HH":
|
|
32785
|
+
return b2.s(s3, 2, "0");
|
|
32786
|
+
case "h":
|
|
32787
|
+
return d3(1);
|
|
32788
|
+
case "hh":
|
|
32789
|
+
return d3(2);
|
|
32790
|
+
case "a":
|
|
32791
|
+
return $2(s3, u3, true);
|
|
32792
|
+
case "A":
|
|
32793
|
+
return $2(s3, u3, false);
|
|
32794
|
+
case "m":
|
|
32795
|
+
return String(u3);
|
|
32796
|
+
case "mm":
|
|
32797
|
+
return b2.s(u3, 2, "0");
|
|
32798
|
+
case "s":
|
|
32799
|
+
return String(e2.$s);
|
|
32800
|
+
case "ss":
|
|
32801
|
+
return b2.s(e2.$s, 2, "0");
|
|
32802
|
+
case "SSS":
|
|
32803
|
+
return b2.s(e2.$ms, 3, "0");
|
|
32804
|
+
case "Z":
|
|
32805
|
+
return i3;
|
|
32806
|
+
}
|
|
32807
|
+
return null;
|
|
32808
|
+
}(t4) || i3.replace(":", "");
|
|
32809
|
+
});
|
|
32810
|
+
}, m3.utcOffset = function() {
|
|
32811
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
32812
|
+
}, m3.diff = function(r3, d3, l3) {
|
|
32813
|
+
var $2, y3 = this, M4 = b2.p(d3), m4 = O2(r3), v3 = (m4.utcOffset() - this.utcOffset()) * e, g3 = this - m4, D3 = /* @__PURE__ */ __name(function() {
|
|
32814
|
+
return b2.m(y3, m4);
|
|
32815
|
+
}, "D");
|
|
32816
|
+
switch (M4) {
|
|
32817
|
+
case h2:
|
|
32818
|
+
$2 = D3() / 12;
|
|
32819
|
+
break;
|
|
32820
|
+
case c2:
|
|
32821
|
+
$2 = D3();
|
|
32822
|
+
break;
|
|
32823
|
+
case f2:
|
|
32824
|
+
$2 = D3() / 3;
|
|
32825
|
+
break;
|
|
32826
|
+
case o2:
|
|
32827
|
+
$2 = (g3 - v3) / 6048e5;
|
|
32828
|
+
break;
|
|
32829
|
+
case a2:
|
|
32830
|
+
$2 = (g3 - v3) / 864e5;
|
|
32831
|
+
break;
|
|
32832
|
+
case u2:
|
|
32833
|
+
$2 = g3 / n2;
|
|
32834
|
+
break;
|
|
32835
|
+
case s2:
|
|
32836
|
+
$2 = g3 / e;
|
|
32837
|
+
break;
|
|
32838
|
+
case i2:
|
|
32839
|
+
$2 = g3 / t2;
|
|
32840
|
+
break;
|
|
32841
|
+
default:
|
|
32842
|
+
$2 = g3;
|
|
32843
|
+
}
|
|
32844
|
+
return l3 ? $2 : b2.a($2);
|
|
32845
|
+
}, m3.daysInMonth = function() {
|
|
32846
|
+
return this.endOf(c2).$D;
|
|
32847
|
+
}, m3.$locale = function() {
|
|
32848
|
+
return D2[this.$L];
|
|
32849
|
+
}, m3.locale = function(t3, e2) {
|
|
32850
|
+
if (!t3) return this.$L;
|
|
32851
|
+
var n3 = this.clone(), r3 = w2(t3, e2, true);
|
|
32852
|
+
return r3 && (n3.$L = r3), n3;
|
|
32853
|
+
}, m3.clone = function() {
|
|
32854
|
+
return b2.w(this.$d, this);
|
|
32855
|
+
}, m3.toDate = function() {
|
|
32856
|
+
return new Date(this.valueOf());
|
|
32857
|
+
}, m3.toJSON = function() {
|
|
32858
|
+
return this.isValid() ? this.toISOString() : null;
|
|
32859
|
+
}, m3.toISOString = function() {
|
|
32860
|
+
return this.$d.toISOString();
|
|
32861
|
+
}, m3.toString = function() {
|
|
32862
|
+
return this.$d.toUTCString();
|
|
32863
|
+
}, M3;
|
|
32864
|
+
}(), k2 = _2.prototype;
|
|
32865
|
+
return O2.prototype = k2, [["$ms", r2], ["$s", i2], ["$m", s2], ["$H", u2], ["$W", a2], ["$M", c2], ["$y", h2], ["$D", d2]].forEach(function(t3) {
|
|
32866
|
+
k2[t3[1]] = function(e2) {
|
|
32867
|
+
return this.$g(e2, t3[0], t3[1]);
|
|
32868
|
+
};
|
|
32869
|
+
}), O2.extend = function(t3, e2) {
|
|
32870
|
+
return t3.$i || (t3(e2, _2, O2), t3.$i = true), O2;
|
|
32871
|
+
}, O2.locale = w2, O2.isDayjs = S2, O2.unix = function(t3) {
|
|
32872
|
+
return O2(1e3 * t3);
|
|
32873
|
+
}, O2.en = D2[g2], O2.Ls = D2, O2.p = {}, O2;
|
|
32874
|
+
});
|
|
32875
|
+
})(dayjs_min$1);
|
|
32876
|
+
return dayjs_min$1.exports;
|
|
32877
|
+
}
|
|
32878
|
+
__name(requireDayjs_min, "requireDayjs_min");
|
|
32879
|
+
var dayjs_minExports = requireDayjs_min();
|
|
32880
|
+
const dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports);
|
|
32999
32881
|
var localizedFormat$2 = { exports: {} };
|
|
33000
32882
|
var localizedFormat$1 = localizedFormat$2.exports;
|
|
33001
32883
|
var hasRequiredLocalizedFormat;
|
|
@@ -33265,7 +33147,7 @@ function removeUnwantedProps(props) {
|
|
|
33265
33147
|
return cleanedProps;
|
|
33266
33148
|
}
|
|
33267
33149
|
__name(removeUnwantedProps, "removeUnwantedProps");
|
|
33268
|
-
const LabelWithTooltipInfo = /* @__PURE__ */ __name(({ label, tooltipInfo, labelStyle }) => tooltipInfo ? /* @__PURE__ */ React.createElement("
|
|
33150
|
+
const LabelWithTooltipInfo = /* @__PURE__ */ __name(({ label, tooltipInfo, labelStyle }) => tooltipInfo ? /* @__PURE__ */ React.createElement("span", { style: __spreadValues({ display: "flex", alignItems: "center" }, labelStyle) }, label, " ", /* @__PURE__ */ React.createElement(
|
|
33269
33151
|
InfoHelper,
|
|
33270
33152
|
{
|
|
33271
33153
|
style: { marginLeft: "5px", marginTop: "-6px" },
|
|
@@ -50786,42 +50668,42 @@ function getFilterMenuItems(dataType) {
|
|
|
50786
50668
|
let filterMenuItems2 = [];
|
|
50787
50669
|
if (dataType === "string") {
|
|
50788
50670
|
filterMenuItems2 = [
|
|
50789
|
-
"
|
|
50790
|
-
"
|
|
50791
|
-
"
|
|
50792
|
-
"
|
|
50793
|
-
"
|
|
50794
|
-
"
|
|
50795
|
-
"
|
|
50796
|
-
"
|
|
50797
|
-
"
|
|
50798
|
-
"
|
|
50671
|
+
"contains",
|
|
50672
|
+
"notContains",
|
|
50673
|
+
"startsWith",
|
|
50674
|
+
"endsWith",
|
|
50675
|
+
"isExactly",
|
|
50676
|
+
"regex",
|
|
50677
|
+
"inList",
|
|
50678
|
+
"notInList",
|
|
50679
|
+
"isEmpty",
|
|
50680
|
+
"notEmpty"
|
|
50799
50681
|
];
|
|
50800
50682
|
} else if (dataType === "lookup") {
|
|
50801
50683
|
filterMenuItems2 = [
|
|
50802
|
-
"
|
|
50803
|
-
"
|
|
50804
|
-
"
|
|
50805
|
-
"
|
|
50806
|
-
"
|
|
50807
|
-
"
|
|
50684
|
+
"contains",
|
|
50685
|
+
"notContains",
|
|
50686
|
+
"startsWith",
|
|
50687
|
+
"endsWith",
|
|
50688
|
+
"isExactly",
|
|
50689
|
+
"regex"
|
|
50808
50690
|
];
|
|
50809
50691
|
} else if (dataType === "boolean") {
|
|
50810
|
-
filterMenuItems2 = ["
|
|
50692
|
+
filterMenuItems2 = ["true", "false"];
|
|
50811
50693
|
} else if (dataType === "number" || dataType === "integer") {
|
|
50812
50694
|
filterMenuItems2 = [
|
|
50813
|
-
"
|
|
50814
|
-
"
|
|
50815
|
-
"
|
|
50816
|
-
"
|
|
50817
|
-
"
|
|
50818
|
-
"
|
|
50819
|
-
"
|
|
50695
|
+
"greaterThan",
|
|
50696
|
+
"lessThan",
|
|
50697
|
+
"inRange",
|
|
50698
|
+
"outsideRange",
|
|
50699
|
+
"equalTo",
|
|
50700
|
+
"inList",
|
|
50701
|
+
"notInList"
|
|
50820
50702
|
];
|
|
50821
50703
|
} else if (dataType === "timestamp") {
|
|
50822
|
-
filterMenuItems2 = ["
|
|
50704
|
+
filterMenuItems2 = ["isBetween", "notBetween", "isBefore", "isAfter"];
|
|
50823
50705
|
}
|
|
50824
|
-
return filterMenuItems2;
|
|
50706
|
+
return filterMenuItems2.map((item) => startCase(item));
|
|
50825
50707
|
}
|
|
50826
50708
|
__name(getFilterMenuItems, "getFilterMenuItems");
|
|
50827
50709
|
const ColumnFilterMenu = /* @__PURE__ */ __name(({
|
|
@@ -56409,20 +56291,15 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
|
|
|
56409
56291
|
props = __spreadValues(__spreadValues({}, props), tableParams);
|
|
56410
56292
|
const queryParams = React.useMemo(() => {
|
|
56411
56293
|
if (!isTableParamsConnected) {
|
|
56412
|
-
const additionalFilterToUse = typeof props.additionalFilter === "function" ? props.additionalFilter : () => props.additionalFilter;
|
|
56413
|
-
const additionalOrFilterToUse = typeof props.additionalOrFilter === "function" ? props.additionalOrFilter : () => props.additionalOrFilter;
|
|
56414
56294
|
return getQueryParams({
|
|
56415
56295
|
doNotCoercePageSize,
|
|
56416
56296
|
currentParams,
|
|
56417
56297
|
entities: props.entities,
|
|
56418
|
-
// for local table
|
|
56419
|
-
urlConnected,
|
|
56420
56298
|
defaults,
|
|
56421
56299
|
schema: convertedSchema,
|
|
56422
56300
|
isInfinite,
|
|
56423
56301
|
isLocalCall,
|
|
56424
|
-
additionalFilter:
|
|
56425
|
-
additionalOrFilter: additionalOrFilterToUse,
|
|
56302
|
+
additionalFilter: props.additionalFilter,
|
|
56426
56303
|
noOrderError: props.noOrderError,
|
|
56427
56304
|
isCodeModel: props.isCodeModel,
|
|
56428
56305
|
ownProps: props
|
|
@@ -56645,7 +56522,7 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
|
|
|
56645
56522
|
}) : !val;
|
|
56646
56523
|
});
|
|
56647
56524
|
}
|
|
56648
|
-
if (noValsForField) {
|
|
56525
|
+
if (noValsForField && entities.length) {
|
|
56649
56526
|
return __spreadProps(__spreadValues({}, field), {
|
|
56650
56527
|
isHidden: true,
|
|
56651
56528
|
isForcedHidden: true
|
|
@@ -71182,8 +71059,12 @@ const Uploader = /* @__PURE__ */ __name(({
|
|
|
71182
71059
|
onClick: /* @__PURE__ */ __name((evt) => evt.preventDefault(), "onClick"),
|
|
71183
71060
|
multiple: fileLimit !== 1,
|
|
71184
71061
|
accept: simpleAccept ? simpleAccept.split(", ").map((acc) => acc.startsWith(".") ? acc : "." + acc).join(", ") : void 0,
|
|
71185
|
-
onDrop: /* @__PURE__ */ __name((_acceptedFiles, rejectedFiles) => __async(exports, null, function* () {
|
|
71062
|
+
onDrop: /* @__PURE__ */ __name((_acceptedFiles, rejectedFiles, e) => __async(exports, null, function* () {
|
|
71186
71063
|
var _a2, _b2;
|
|
71064
|
+
const parentDropzone = e.target.closest(".tg-dropzone");
|
|
71065
|
+
if (parentDropzone) {
|
|
71066
|
+
parentDropzone.blur();
|
|
71067
|
+
}
|
|
71187
71068
|
let acceptedFiles = [];
|
|
71188
71069
|
for (const file of _acceptedFiles) {
|
|
71189
71070
|
if ((validateAgainstSchema || autoUnzip) && isZipFile(file)) {
|
|
@@ -71814,7 +71695,6 @@ const useTableParams = /* @__PURE__ */ __name((props) => {
|
|
|
71814
71695
|
var _a;
|
|
71815
71696
|
const {
|
|
71816
71697
|
additionalFilter,
|
|
71817
|
-
additionalOrFilter,
|
|
71818
71698
|
controlled_pageSize,
|
|
71819
71699
|
defaults: _defaults,
|
|
71820
71700
|
doNotCoercePageSize,
|
|
@@ -71922,28 +71802,21 @@ const useTableParams = /* @__PURE__ */ __name((props) => {
|
|
|
71922
71802
|
[controlled_pageSize, defaultsToUse, pageSize, history == null ? void 0 : history.location]
|
|
71923
71803
|
);
|
|
71924
71804
|
const queryParams = React.useMemo(() => {
|
|
71925
|
-
const additionalFilterToUse = typeof additionalFilter === "function" ? additionalFilter : () => additionalFilter;
|
|
71926
|
-
const additionalOrFilterToUse = typeof additionalOrFilter === "function" ? additionalOrFilter : () => additionalOrFilter;
|
|
71927
71805
|
return getQueryParams({
|
|
71928
71806
|
doNotCoercePageSize,
|
|
71929
71807
|
currentParams,
|
|
71930
71808
|
entities,
|
|
71931
|
-
// for local table
|
|
71932
|
-
urlConnected,
|
|
71933
71809
|
defaults: defaultsToUse,
|
|
71934
71810
|
schema: convertedSchema,
|
|
71935
71811
|
isInfinite: isInfinite || isSimple && !withPaging,
|
|
71936
71812
|
isLocalCall,
|
|
71937
|
-
additionalFilter
|
|
71938
|
-
additionalOrFilter: additionalOrFilterToUse,
|
|
71813
|
+
additionalFilter,
|
|
71939
71814
|
noOrderError,
|
|
71940
|
-
isCodeModel,
|
|
71941
71815
|
ownProps: passingProps
|
|
71942
71816
|
});
|
|
71943
71817
|
}, [
|
|
71944
71818
|
additionalFilter,
|
|
71945
71819
|
passingProps,
|
|
71946
|
-
additionalOrFilter,
|
|
71947
71820
|
doNotCoercePageSize,
|
|
71948
71821
|
currentParams,
|
|
71949
71822
|
entities,
|
|
@@ -78119,6 +77992,7 @@ exports.getTagProps = getTagProps;
|
|
|
78119
77992
|
exports.getTagsAndTagOptions = getTagsAndTagOptions;
|
|
78120
77993
|
exports.getTextFromEl = getTextFromEl;
|
|
78121
77994
|
exports.hotkeysById = hotkeysById;
|
|
77995
|
+
exports.initializeHasuraWhereAndFilter = initializeHasuraWhereAndFilter;
|
|
78122
77996
|
exports.inventoryIcon = inventoryIcon;
|
|
78123
77997
|
exports.isSafari = isSafari;
|
|
78124
77998
|
exports.keyboardIcon = keyboardIcon;
|