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 3 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
28 changes: 27 additions & 1 deletion 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
RowNode: IRowNode<'row>
Larocceau marked this conversation as resolved.
Show resolved Hide resolved
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,9 @@ 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)


Larocceau marked this conversation as resolved.
Show resolved Hide resolved
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 +725,16 @@ 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
}


Larocceau marked this conversation as resolved.
Show resolved Hide resolved
[<RequireQualifiedAccess>]
type BuiltInMenuItem =
| AutoSizeAll
Expand Down Expand Up @@ -762,6 +781,10 @@ 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 GroupCellRendererParams(v: IGroupCellRendererParams<'row, 'value>) =
mattgallagher92 marked this conversation as resolved.
Show resolved Hide resolved
columnDefProp<'row, 'value> ("cellRendererParams" ==> v)

[<Erase>]
type AgGrid<'row> =
static member inline rowGroupPanelShow(v: RowGroupPanelShow) =
Expand All @@ -770,6 +793,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 All @@ -787,4 +813,4 @@ type AgGrid<'row> =
| BuiltIn builtInItemName -> box builtInItemName.BuiltInMenuItemText
| Custom customMenuItem -> box customMenuItem
|]
)
)
Loading