Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(mostly) enterprise features #39

Merged
merged 5 commits into from
Dec 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/AgGrid.fs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ type IColumn = { getColId: unit -> string }
[<Erase>]
type IColumnDefProp<'row, 'value> = interface end

type IRowHeightParameters<'row> = {
data: 'row option
node: IRowNode<'row>
api: IGridApi<'row>
}

let columnDefProp<'row, 'value> = unbox<IColumnDefProp<'row, 'value>>

// Although the AG Grid docs suggest that this should have two type params, we only give it one so that column defs
Expand Down Expand Up @@ -506,6 +512,8 @@ type AgGrid<'row> =
static member inline defaultColDef(defaults: IColumnDefProp<'row, 'value> seq) =
agGridProp<'row> ("defaultColDef", defaults |> unbox<_ seq> |> createObj)

static member inline getRowHeight(v: IRowHeightParameters<'row> -> int option) = agGridProp<'row> ("getRowHeight", v)

static member onColumnGroupOpened(callback: _ -> unit) = // This can't be inline otherwise Fable produces invalid JS
let onColumnGroupOpened =
fun ev ->
Expand Down Expand Up @@ -716,6 +724,15 @@ type AgGrid<'row> =
icon: obj option//HtmlElement
}

type IGroupCellRendererParams<'row, 'value> = {
suppressCount: bool
suppressDoubleClickExpand: bool
checkBox: bool
innerRenderer: ICellRendererParams<'row, 'value> -> ReactElement
innerRendererParams: obj array
totalValueGetter: string
}

[<RequireQualifiedAccess>]
type BuiltInMenuItem =
| AutoSizeAll
Expand Down Expand Up @@ -762,6 +779,11 @@ type AgGrid<'row> =
static member inline aggFunc(v: AggregateFunction) = columnDefProp<'row, 'value> ("aggFunc" ==> v.AggregateText)
static member inline rowGroup(v: bool) = columnDefProp<'row, 'value> ("rowGroup" ==> v)

static member inline suppressAggFuncInHeader(v:bool) = columnDefProp<'row, 'value> ("suppressAggFuncInHeader" ==> v)

static member inline cellRendererParams(v: IGroupCellRendererParams<'row, 'value>) =
columnDefProp<'row, 'value> ("cellRendererParams" ==> v)

[<Erase>]
type AgGrid<'row> =
static member inline rowGroupPanelShow(v: RowGroupPanelShow) =
Expand All @@ -770,6 +792,9 @@ type AgGrid<'row> =
static member inline groupDisplayType(v: RowGroupingDisplayType) =
agGridProp<'row> ("groupDisplayType", v.RowGroupingDisplayTypeText)

static member inline autoGroupColumnDef(values: IColumnDefProp<'row, 'value> seq) =
agGridProp ("autoGroupColumnDef", values |> unbox<_ seq> |> createObj)

static member inline pivotMode(v: bool) = agGridProp<'row> ("pivotMode", v)

static member inline getDataPath( v: 'row -> string array) = agGridProp<'row> ("getDataPath", v)
Expand Down
Loading