@teselagen/ui 0.8.6-beta.8 → 0.8.6-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js
CHANGED
|
@@ -19496,6 +19496,13 @@ function tableQueryParamsToHasuraClauses({
|
|
|
19496
19496
|
case "isExactly":
|
|
19497
19497
|
return { [filterOn]: { _eq: filterValue } };
|
|
19498
19498
|
case "isEmpty":
|
|
19499
|
+
if (filterOn.includes(".")) {
|
|
19500
|
+
return {
|
|
19501
|
+
_not: {
|
|
19502
|
+
[filterOn.split(".")[0]]: {}
|
|
19503
|
+
}
|
|
19504
|
+
};
|
|
19505
|
+
}
|
|
19499
19506
|
return {
|
|
19500
19507
|
_or: [
|
|
19501
19508
|
{ [filterOn]: { _eq: "" } },
|
package/index.es.js
CHANGED
|
@@ -19478,6 +19478,13 @@ function tableQueryParamsToHasuraClauses({
|
|
|
19478
19478
|
case "isExactly":
|
|
19479
19479
|
return { [filterOn]: { _eq: filterValue } };
|
|
19480
19480
|
case "isEmpty":
|
|
19481
|
+
if (filterOn.includes(".")) {
|
|
19482
|
+
return {
|
|
19483
|
+
_not: {
|
|
19484
|
+
[filterOn.split(".")[0]]: {}
|
|
19485
|
+
}
|
|
19486
|
+
};
|
|
19487
|
+
}
|
|
19481
19488
|
return {
|
|
19482
19489
|
_or: [
|
|
19483
19490
|
{ [filterOn]: { _eq: "" } },
|
package/package.json
CHANGED
|
@@ -240,14 +240,14 @@ function applyOrderBy(records, _order_by) {
|
|
|
240
240
|
const fields = [];
|
|
241
241
|
const directions = [];
|
|
242
242
|
const iteratees = [];
|
|
243
|
-
|
|
243
|
+
|
|
244
244
|
order_by.forEach(item => {
|
|
245
245
|
// Hasura-style: { field: "asc" }
|
|
246
246
|
const field = Object.keys(item)[0];
|
|
247
247
|
const direction = item[field];
|
|
248
248
|
fields.push(field);
|
|
249
249
|
directions.push(direction);
|
|
250
|
-
|
|
250
|
+
|
|
251
251
|
// Create a custom iteratee function for natural sorting
|
|
252
252
|
iteratees.push(record => {
|
|
253
253
|
const value = record[field];
|
|
@@ -255,12 +255,12 @@ function applyOrderBy(records, _order_by) {
|
|
|
255
255
|
if (isString(value) && /\d/.test(value)) {
|
|
256
256
|
// Return the value in a format that can be naturally sorted
|
|
257
257
|
// This effectively creates a sort key that respects natural ordering
|
|
258
|
-
return value.replace(/(\d+)/g, num => num.padStart(10,
|
|
258
|
+
return value.replace(/(\d+)/g, num => num.padStart(10, "0"));
|
|
259
259
|
}
|
|
260
260
|
return value;
|
|
261
261
|
});
|
|
262
262
|
});
|
|
263
|
-
|
|
263
|
+
|
|
264
264
|
// Use the custom iteratees for natural sorting
|
|
265
265
|
records = orderBy(records, iteratees, directions);
|
|
266
266
|
}
|
|
@@ -112,6 +112,15 @@ export function tableQueryParamsToHasuraClauses({
|
|
|
112
112
|
case "isExactly":
|
|
113
113
|
return { [filterOn]: { _eq: filterValue } };
|
|
114
114
|
case "isEmpty":
|
|
115
|
+
if (filterOn.includes(".")) {
|
|
116
|
+
// if we're filtering on a nested field, like a sequence table with parts.name
|
|
117
|
+
// we really want to just query on the top level field's existence
|
|
118
|
+
return {
|
|
119
|
+
_not: {
|
|
120
|
+
[filterOn.split(".")[0]]: {}
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
}
|
|
115
124
|
return {
|
|
116
125
|
_or: [
|
|
117
126
|
{ [filterOn]: { _eq: "" } },
|