feat: The Computed Column function is passed `row`, `index`, and `array`
πWhat is this pr about?
The Computed Column function is passed row, index, and array. The latter two are new.
I modeled this change on JavaScript's map() callback parameter.
π Changes
Before:
export interface ComputedColumn extends ColumnOptionsRaw {
function: (arg0: any) => any;
}
After:
export interface ComputedColumn extends ColumnOptionsRaw {
function: (arg0: any, index: number, array: any[]) => any;
}
array is a string[]. I'm not sure why anything in this file has an any type, but I used it here to follow conventions.
Along the way, I noticed that the addColumn and addColumns parameters may have the wrong types?
Related
- #461
- #462
- #463
I've decided to convert this to a draft because I'm not sure if the new values will be correct when rows are filtered and/or sorted (or what "correct" means in this context).
@DanKaplanSES Could you split the PR in 3 different ones fixing 3 different Problems? One of them are okay to be merged rest would have some comments