autoql-fe-utils 1.10.5 → 1.10.6
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/dist/index.global.js +73 -23
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +73 -23
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +73 -23
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.global.js
CHANGED
|
@@ -17222,21 +17222,26 @@
|
|
|
17222
17222
|
};
|
|
17223
17223
|
} else if ((column == null ? void 0 : column.type) === "DATE_STRING" /* DATE_STRING */) {
|
|
17224
17224
|
return (headerValue, rowValue) => {
|
|
17225
|
-
|
|
17226
|
-
if (rowValue === void 0 || rowValue === null) {
|
|
17227
|
-
return false;
|
|
17228
|
-
}
|
|
17229
|
-
const formattedElement = formatElement({
|
|
17230
|
-
element: rowValue,
|
|
17231
|
-
column,
|
|
17232
|
-
config: dataFormatting
|
|
17233
|
-
});
|
|
17234
|
-
const shouldFilter = String(formattedElement != null ? formattedElement : "").toLowerCase().includes(String(headerValue != null ? headerValue : "").toLowerCase());
|
|
17235
|
-
return shouldFilter;
|
|
17236
|
-
} catch (error) {
|
|
17237
|
-
console.error(error);
|
|
17225
|
+
if (rowValue === void 0 || rowValue === null) {
|
|
17238
17226
|
return false;
|
|
17239
17227
|
}
|
|
17228
|
+
const formattedElement = formatElement({
|
|
17229
|
+
element: rowValue,
|
|
17230
|
+
column,
|
|
17231
|
+
config: dataFormatting
|
|
17232
|
+
});
|
|
17233
|
+
const raw = String(headerValue != null ? headerValue : "").trim();
|
|
17234
|
+
const lowerElement = String(formattedElement != null ? formattedElement : "").toLowerCase();
|
|
17235
|
+
const lowerValue = lowerElement.toLowerCase();
|
|
17236
|
+
if (raw.startsWith("!=")) {
|
|
17237
|
+
const searchTerm = raw.slice(2).trim().toLowerCase();
|
|
17238
|
+
return searchTerm.length === 0 ? true : lowerValue !== searchTerm;
|
|
17239
|
+
}
|
|
17240
|
+
if (raw.startsWith("!")) {
|
|
17241
|
+
const searchTerm = raw.slice(1).trim().toLowerCase();
|
|
17242
|
+
return searchTerm.length === 0 ? true : !lowerValue.includes(searchTerm);
|
|
17243
|
+
}
|
|
17244
|
+
return lowerValue.includes(raw.toLowerCase());
|
|
17240
17245
|
};
|
|
17241
17246
|
} else if (isColumnNumberType(column)) {
|
|
17242
17247
|
return (headerValue, rowValue) => {
|
|
@@ -17283,15 +17288,20 @@
|
|
|
17283
17288
|
};
|
|
17284
17289
|
} else {
|
|
17285
17290
|
return (headerValue, rowValue) => {
|
|
17286
|
-
|
|
17287
|
-
if (rowValue === void 0 || rowValue === null) {
|
|
17288
|
-
return false;
|
|
17289
|
-
}
|
|
17290
|
-
return String(rowValue != null ? rowValue : "").toLowerCase().includes(String(headerValue != null ? headerValue : "").toLowerCase());
|
|
17291
|
-
} catch (error) {
|
|
17292
|
-
console.error(error);
|
|
17291
|
+
if (rowValue === void 0 || rowValue === null) {
|
|
17293
17292
|
return false;
|
|
17294
17293
|
}
|
|
17294
|
+
const raw = String(headerValue != null ? headerValue : "").trim();
|
|
17295
|
+
const lowerValue = String(rowValue != null ? rowValue : "").toLowerCase();
|
|
17296
|
+
if (raw.startsWith("!=")) {
|
|
17297
|
+
const searchTerm = raw.slice(2).trim().toLowerCase();
|
|
17298
|
+
return searchTerm.length === 0 ? true : lowerValue !== searchTerm;
|
|
17299
|
+
}
|
|
17300
|
+
if (raw.startsWith("!")) {
|
|
17301
|
+
const searchTerm = raw.slice(1).trim().toLowerCase();
|
|
17302
|
+
return searchTerm.length === 0 ? true : !lowerValue.includes(searchTerm);
|
|
17303
|
+
}
|
|
17304
|
+
return lowerValue.includes(raw.toLowerCase());
|
|
17295
17305
|
};
|
|
17296
17306
|
}
|
|
17297
17307
|
return void 0;
|
|
@@ -18522,6 +18532,33 @@
|
|
|
18522
18532
|
return String(row[columnIndex]) !== String(filterValue);
|
|
18523
18533
|
});
|
|
18524
18534
|
}
|
|
18535
|
+
if (op === "!" || op === "not_like") {
|
|
18536
|
+
if (colType === "DATE" /* DATE */) {
|
|
18537
|
+
return data.concat().filter((row) => {
|
|
18538
|
+
var _a;
|
|
18539
|
+
const cell = row[columnIndex];
|
|
18540
|
+
if (isNil(cell)) return true;
|
|
18541
|
+
const parts = parseRangeParts(filterValue);
|
|
18542
|
+
const precision = getPrecisionForDayJS(getFilterPrecision(column));
|
|
18543
|
+
const start = dayjsWithPlugins_default.utc(parts[0]).startOf(precision);
|
|
18544
|
+
const end = dayjsWithPlugins_default.utc((_a = parts[1]) != null ? _a : parts[0]).endOf(precision);
|
|
18545
|
+
const rowVal = getDayJSObj({ value: cell, column });
|
|
18546
|
+
return !(start.isSameOrBefore(rowVal) && rowVal.isSameOrBefore(end));
|
|
18547
|
+
});
|
|
18548
|
+
}
|
|
18549
|
+
if (colType === "DATE_STRING" /* DATE_STRING */) {
|
|
18550
|
+
return data.concat().filter((row) => {
|
|
18551
|
+
const cell = row[columnIndex];
|
|
18552
|
+
if (isNil(cell)) return true;
|
|
18553
|
+
const formatted = formatElement({ element: cell, column, config: dataFormatting });
|
|
18554
|
+
return !ci(formatted).includes(ci(filterValue));
|
|
18555
|
+
});
|
|
18556
|
+
}
|
|
18557
|
+
return data.concat().filter((row) => {
|
|
18558
|
+
const cell = row[columnIndex];
|
|
18559
|
+
return isNil(cell) || !ci(cell).includes(ci(filterValue));
|
|
18560
|
+
});
|
|
18561
|
+
}
|
|
18525
18562
|
if (op === "in" || op === "contains_list") {
|
|
18526
18563
|
const values = parseList(filterValue);
|
|
18527
18564
|
if (!values.length) return data.concat();
|
|
@@ -21282,9 +21319,22 @@
|
|
|
21282
21319
|
const stringValue = typeof rawValue === "string" ? rawValue.trim() : rawValue;
|
|
21283
21320
|
let operator = "like";
|
|
21284
21321
|
let value = rawValue;
|
|
21285
|
-
if (typeof stringValue === "string"
|
|
21286
|
-
|
|
21287
|
-
|
|
21322
|
+
if (typeof stringValue === "string") {
|
|
21323
|
+
const operatorMatch = stringValue.match(/^(!=|!|=|<=|>=|<|>)\s*(.*)$/);
|
|
21324
|
+
if (operatorMatch) {
|
|
21325
|
+
const opPrefix = operatorMatch[1];
|
|
21326
|
+
const cleanValue = operatorMatch[2];
|
|
21327
|
+
value = cleanValue;
|
|
21328
|
+
if (opPrefix === "!") {
|
|
21329
|
+
operator = "!";
|
|
21330
|
+
} else if (opPrefix === "!=") {
|
|
21331
|
+
operator = "!=";
|
|
21332
|
+
} else if (opPrefix === "=") {
|
|
21333
|
+
operator = "=";
|
|
21334
|
+
} else if (["<", ">", "<=", ">="].includes(opPrefix)) {
|
|
21335
|
+
operator = opPrefix;
|
|
21336
|
+
}
|
|
21337
|
+
}
|
|
21288
21338
|
}
|
|
21289
21339
|
if (value === void 0 || value === null || typeof value === "string" && value === "") {
|
|
21290
21340
|
return;
|