|
|
@ -7,6 +7,7 @@ export function customTableFilterFunction(data: any, filter: any) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (const filterElementName of Object.keys(filter.columnFilters)) {
|
|
|
|
for (const filterElementName of Object.keys(filter.columnFilters)) {
|
|
|
|
const filterElement = filter.columnFilters[filterElementName];
|
|
|
|
const filterElement = filter.columnFilters[filterElementName];
|
|
|
|
|
|
|
|
// String Filter
|
|
|
|
if (filterElement.value) {
|
|
|
|
if (filterElement.value) {
|
|
|
|
if (filterElement.type === 'String' || filterElement.type === 'Id') {
|
|
|
|
if (filterElement.type === 'String' || filterElement.type === 'Id') {
|
|
|
|
let searchString = filterElement.value.trim();
|
|
|
|
let searchString = filterElement.value.trim();
|
|
|
@ -26,6 +27,7 @@ export function customTableFilterFunction(data: any, filter: any) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Number Filter
|
|
|
|
if (filterElement.min != null || filterElement.max != null) {
|
|
|
|
if (filterElement.min != null || filterElement.max != null) {
|
|
|
|
if (
|
|
|
|
if (
|
|
|
|
filterElement.type === 'Float' ||
|
|
|
|
filterElement.type === 'Float' ||
|
|
|
@ -44,6 +46,7 @@ export function customTableFilterFunction(data: any, filter: any) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// NumberRange Filter
|
|
|
|
if (filterElement.type === 'NumRange') {
|
|
|
|
if (filterElement.type === 'NumRange') {
|
|
|
|
if (
|
|
|
|
if (
|
|
|
|
filterElement.minValue.min != null ||
|
|
|
|
filterElement.minValue.min != null ||
|
|
|
@ -70,6 +73,19 @@ export function customTableFilterFunction(data: any, filter: any) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Date Filter
|
|
|
|
|
|
|
|
if (filterElement.from != null || filterElement.to != null) {
|
|
|
|
|
|
|
|
let dataElement = data[filterElementName];
|
|
|
|
|
|
|
|
if (dataElement == null) {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (filterElement.from != null && new Date(dataElement) < new Date(filterElement.from)) {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (filterElement.to != null && new Date(dataElement) > new Date(filterElement.to)) {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*const b =
|
|
|
|
/*const b =
|
|
|
|
!filter.includesString ||
|
|
|
|
!filter.includesString ||
|
|
|
|