Closed raisercostin closed 5 months ago
I tested it in the example project and it doesn't work. I think this is because the default value is falsely when the item is selected. The item you want to exclude must have the value true.
But try changing false to true in the following code:
if (valueFilterItem && Object.keys(valueFilterItem).length) {
// add all keys to be filtered out
if (valueFilterItem.all) { // <-------------------------- here --------------------------
Object.keys(values).forEach(k => {
if (k !== 'all') {
const keyPresent = valueFilterItem[k]
.
.
.
And I confirmed that if all is true, all values are excluded by default.
valueFilter: {
date: {
all: true
}
},
If I misunderstand, please provide sample code. Please understand that there is no test code.
Thank you for your interest in this project
Yes. You're right. I changed the meaning. valueFilter
meaning is to filter out. I will change to be compatible with existing behavior.
Fixed. I also changed the 'all' field to '*'. Could be configurable but I didn't want to add complexity.
Allow configuration of valueFilter without listing all values for a key. All false will exclude all. Then add the needed one with true. All could also be selected, and exclude the unwanted ones with false. Is also compatible with existing clients.