From 3c711224b2572a077679dafa7d0e1ce62fc9030e Mon Sep 17 00:00:00 2001 From: Joost Kaptein Date: Fri, 16 Aug 2024 16:21:51 +0100 Subject: [PATCH] DU for built in menu items --- src/AgGrid.fs | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/src/AgGrid.fs b/src/AgGrid.fs index 3be2e82..25c66d8 100644 --- a/src/AgGrid.fs +++ b/src/AgGrid.fs @@ -716,8 +716,42 @@ type AgGrid<'row> = icon: obj //HtmlElement } + [] + type BuiltInMenuItem = + | AutoSizeAll + | ExpandAll + | ContractAll + | Copy + | CopyWithHeaders + | CopyWithGroupHeaders + | Cut + | Paste + | ResetColumns + | Export + | CsvExport + | ExcelExport + | ChartRange + | PivotChart + + member this.BuiltInMenuItemText = + match this with + | AutoSizeAll -> "autoSizeAll" + | ExpandAll -> "expandAll" + | ContractAll -> "contractAll" + | Copy -> "copy" + | CopyWithHeaders -> "copyWithHeaders" + | CopyWithGroupHeaders -> "copyWithGroupHeaders" + | Cut -> "cut" + | Paste -> "paste" + | ResetColumns -> "resetColumns" + | Export -> "export" + | CsvExport -> "csvExport" + | ExcelExport -> "excelExport" + | ChartRange -> "chartRange" + | PivotChart -> "pivotChart" + type MenuItem = - | BuiltIn of string + | BuiltIn of BuiltInMenuItem | Custom of MenuItemDef /// See https://www.ag-grid.com/react-data-grid/grid-interface/#grid-api. @@ -757,7 +791,7 @@ type AgGrid<'row> = [| for item in menuItems do match item with - | BuiltIn builtInItemName -> box builtInItemName + | BuiltIn builtInItemName -> box builtInItemName.BuiltInMenuItemText | Custom customMenuItem -> box customMenuItem |] ) \ No newline at end of file