(core) Use individual choices for filtering choice lists

Test Plan: Wrote unit and browser tests that verify new behavior.

Reviewers: paulfitz, dsagal

Reviewed By: dsagal

Subscribers: alexmojaki

Differential Revision: https://phab.getgrist.com/D2855
This commit is contained in:
George Gevoian
2021-06-11 07:32:05 -07:00
parent 5d3a4b5b5b
commit b94eb107d4
6 changed files with 71 additions and 20 deletions

View File

@@ -24,7 +24,7 @@ export class ColumnFilter extends Disposable {
private _include: boolean;
private _values: Set<CellValue>;
constructor(private _initialFilterJson: string) {
constructor(private _initialFilterJson: string, private _columnType?: string) {
super();
this.setState(_initialFilterJson);
}
@@ -85,7 +85,7 @@ export class ColumnFilter extends Disposable {
}
private _updateState(): void {
this.filterFunc.set(makeFilterFunc(this._getState()));
this.filterFunc.set(makeFilterFunc(this._getState(), this._columnType));
}
private _getState(): FilterState {

View File

@@ -36,7 +36,7 @@ export class SectionFilter extends Disposable {
const funcs: Array<RowFilterFunc<RowId> | null> = fields.map(f => {
const filterFunc = (openFilter && openFilter.fieldRef === f.getRowId()) ?
use(openFilter.colFilter.filterFunc) :
buildColFilter(use(f.activeFilter));
buildColFilter(use(f.activeFilter), use(f.column).type());
const getter = tableData.getRowPropFunc(use(f.colId));