From dbf724a3a8b3b1100add9eb3077562debff16bde Mon Sep 17 00:00:00 2001 From: Jordan Marr Date: Sun, 21 Apr 2024 16:28:40 -0400 Subject: [PATCH 1/2] Added some features from the enterprise version --- src/AgGrid.fs | 316 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 281 insertions(+), 35 deletions(-) diff --git a/src/AgGrid.fs b/src/AgGrid.fs index eb71e85..ffb9a81 100644 --- a/src/AgGrid.fs +++ b/src/AgGrid.fs @@ -4,18 +4,200 @@ module Feliz.AgGrid open System open Fable.Core open Fable.Core.JsInterop - open Feliz let agGrid : obj = import "AgGridReact" "ag-grid-react" -importAll "ag-grid-community/styles/ag-grid.css" -importAll "ag-grid-community/styles/ag-theme-alpine.css" -importAll "ag-grid-community/styles/ag-theme-balham.css" -importAll "ag-grid-community/styles/ag-theme-material.css" +// User should load the CSS files in their own project +//importAll "ag-grid-community/styles/ag-grid.css" +//importAll "ag-grid-community/styles/ag-theme-alpine.css" +//importAll "ag-grid-community/styles/ag-theme-balham.css" +//importAll "ag-grid-community/styles/ag-theme-material.css" + +// https://www.ag-grid.com/javascript-data-grid/row-object/ +[] +type IRowNode<'row> = { + id: string + data : 'row + updateData: 'row -> unit + setData: 'row -> unit + setSelected : bool -> unit + rowIndex : int + rowTop : int + displayed : bool + isHovered : bool + isFullWidthCell : bool + isSelected : bool +} + +[] +type ICellRange = { + id : string + startRow : obj + endRow : obj +} + with + member this.startRowIndex : int = this.startRow?rowIndex + member this.endRowIndex : int = this.endRow?rowIndex + +// https://www.ag-grid.com/javascript-data-grid/grid-interface/#grid-api +[] +type IGridApi<'row> = + abstract copyToClipboard : unit -> unit + abstract pasteFromClipboard : unit -> unit + abstract refreshCells : unit -> unit + abstract redrawRows : unit -> unit + abstract setGridOption : string -> obj -> unit + abstract getSelectedNodes : unit -> IRowNode<'row>[] + abstract getCellRanges : unit -> ICellRange[] + +// https://www.ag-grid.com/javascript-data-grid/column-object/ +[] +type IColumn = { + getColId : unit -> string +} + +[] +type IColumnDefProp<'row, 'value> = interface end +let columnDefProp<'row, 'value> = unbox> + +[] +type IColumnDef<'row> = interface end + +[] +module CallbackParams = + // https://www.ag-grid.com/react-data-grid/column-properties/#reference-editing-valueSetter + // https://www.ag-grid.com/javascript-data-grid//column-properties/#reference-editing-valueParser + [] + type IValueChangedParams<'row, 'value> = { + oldValue : 'value + newValue : 'value + node : IRowNode<'row> + data : 'row + column : IColumn + colDef: IColumnDef<'row> + api : IGridApi<'row> + } + with member this.rowIndex = this.node.rowIndex + + // https://www.ag-grid.com/javascript-data-grid/component-cell-editor/#reference-ICellEditorParams + [] + type IValueParams<'row, 'value> = { + value : 'value + data : 'row + node : IRowNode<'row> + colDef : IColumnDef<'row> + column : IColumn + api : IGridApi<'row> + rowIndex: int + } + + // https://www.ag-grid.com/javascript-data-grid/grid-events/#reference-selection-cellFocused + [] + type ICellFocusedEvent<'row> = { + api : IGridApi<'row> + rowIndex : int + column : IColumn + isFullWidthCell: bool + } + + // https://www.ag-grid.com/javascript-data-grid//grid-options/#reference-rowModels-getRowId + [] + type IGetRowIdParams<'row> = { + data : 'row + level : int + parentKeys: string[] + api : IGridApi<'row> + context: obj + } + + [] + type ICellRendererParams<'row, 'value> = { + value : 'value + data : 'row + node : IRowNode<'row> + colDef : IColumnDef<'row> + column : IColumn + api : IGridApi<'row> + rowIndex: int + } + + [] + type IPasteEvent<'row> = { + source : string + api : IGridApi<'row> + context : obj + ``type`` : string + } + + [] + type IProcessDataFromClipboardParams<'row> = { + data : string[][] + api : IGridApi<'row> + context : obj + } type RowSelection = Single | Multiple -type RowFilter = Number | Text | Date member this.FilterText = sprintf "ag%OColumnFilter" this + +[] +type RowGroupingDisplayType = + | SingleColumn + | MultipleColumns + | GroupRows + | Custom + member this.RowGroupingDisplayTypeText = + match this with + | SingleColumn -> "singleColumn" + | MultipleColumns -> "multipleColumns" + | GroupRows -> "groupRows" + | Custom -> "custom" + +[] +type RowGroupPanelShow = + | Always | OnlyWhenGrouping | Never + member this.RowGroupPanelShowText = + match this with + | Always -> "always" + | OnlyWhenGrouping -> "onlyWhenGrouping" + | Never -> "never" + +[] +type RowFilter = + | Number | Text | Date | Set + member this.FilterText = sprintf "ag%OColumnFilter" this + +[] +type CellDataType = + | Text | Number | Date | DateString | Boolean | Object | Custom of string + member this.CellDataTypeText = + match this with + | Text -> "text" + | Number -> "number" + | Date -> "date" + | DateString -> "dateString" + | Boolean -> "boolean" + | Object -> "object" + | Custom s -> s + +[] +type AgCellEditor = + | SelectCellEditor + | RichSelectCellEditor + | NumberCellEditor + | DateCellEditor + | DateStringCellEditor + | CheckboxCellEditor + | LargeTextCellEditor + | TextCellEditor + member this.RichCellEditorText = + sprintf "ag%O" this + +[] + +type AggregateFunction = + | Sum | Min | Max | Count | Avg | First | Last + member this.AggregateText = (sprintf "%O" this).ToLower() + type DOMLayout = Normal | AutoHeight | Print member this.LayoutText = @@ -41,57 +223,93 @@ type MenuItem = | BuiltIn of string | Custom of MenuItemDef -[] -type IColumnDefProp<'row, 'value> = interface end -let columnDefProp<'row, 'value> = unbox> -let columnDefProps<'row, 'value> = unbox> - -[] -type IColumnDef<'row> = interface end - type ColumnType = RightAligned | NumericColumn let openClosed = function | true -> "open" | false -> "closed" [] -let CellRendererComponent<'value,'row> (render:'value -> 'row -> ReactElement, p) = - render p?value p?data +let CellRendererComponent<'row, 'value> (render: (ICellRendererParams<'row, 'value>) -> ReactElement, p: ICellRendererParams<'row, 'value>) = + render p [] type ColumnDef<'row, 'value> = + static member inline create (props: IColumnDefProp<'row, 'value> seq) = createObj !!props :?> IColumnDef<'row> + + static member inline aggFunc (v:AggregateFunction) = columnDefProp<'row, 'value> ("aggFunc" ==> v.AggregateText) static member inline autoComparator = columnDefProp<'row, 'value> ("comparator" ==> compare) static member inline cellClass (setClass:'value -> 'row -> #seq) = columnDefProp<'row, 'value> ("cellClass" ==> fun p -> setClass p?value p?data |> Seq.toArray) static member inline cellClassRules (rules: (string*('value -> 'row -> bool)) list) = columnDefProp<'row, 'value> ("cellClassRules" ==> (rules |> List.map (fun (className, rule) -> className ==> fun p -> rule p?value p?data) |> createObj)) + static member cellDataType (v:bool) = columnDefProp<'row, 'value> ("cellDataType" ==> v) + static member cellDataType (v:CellDataType) = columnDefProp<'row, 'value> ("cellDataType" ==> v.CellDataTypeText) + [] static member cellRendererFramework _ = failwith "cellRendererFramework isn't supported in the latest version of AgGrid. Use cellRenderer instead" - static member cellRenderer (render:'value -> 'row -> ReactElement) = columnDefProp<'row, 'value> ("cellRenderer" ==> fun p -> CellRendererComponent(render, p)) + + // Removed to resolve type inference issue with multiple overloads + //static member cellRenderer' (render: 'value -> 'row -> ReactElement) = columnDefProp<'row, 'value> ("cellRenderer" ==> fun (p: ICellRendererParams<'row, 'value>) -> CellRendererComponentSimple(render, p.value, p.data)) + static member cellRenderer (render: ICellRendererParams<'row, 'value> -> ReactElement) = columnDefProp<'row, 'value> ("cellRenderer" ==> fun p -> CellRendererComponent(render, p)) + + // Removed to resolve type inference issue with multiple overloads + //static member cellEditor' (render: 'value -> 'row -> ReactElement) = columnDefProp<'row, 'value> ("cellEditor" ==> fun (p: ICellRendererParams<'row, 'value>) -> CellRendererComponentSimple(render, p.value, p.data)) + static member cellEditor (render: ICellRendererParams<'row, 'value> -> ReactElement) = columnDefProp<'row, 'value> ("cellEditor" ==> fun p -> CellRendererComponent(render, p)) + static member cellEditor (v:string) = columnDefProp<'row, 'value> ("cellEditor" ==> v) + static member cellEditor (v: AgCellEditor) = columnDefProp<'row, 'value> ("cellEditor" ==> v.RichCellEditorText) + + static member cellEditorParams (v: string seq) = columnDefProp<'row, 'value> ("cellEditorParams" ==> {| values = v |> Seq.toArray |}) + static member cellEditorParams (v: obj) = columnDefProp<'row, 'value> ("cellEditorParams" ==> v) + static member cellEditorPopup (v:bool) = columnDefProp<'row, 'value> ("cellEditorPopup" ==> v) static member inline cellStyle (setStyle:'value -> 'row -> _) = columnDefProp<'row, 'value> ("cellStyle" ==> fun p -> setStyle p?value p?data) static member inline checkboxSelection (v:bool) = columnDefProp<'row, 'value> ("checkboxSelection" ==> v) static member inline colId (v:string) = columnDefProp<'row, 'value> ("colId" ==> v) static member inline columnGroupShow (v:bool) = columnDefProp<'row, 'value> ("columnGroupShow" ==> openClosed v) static member inline columnType ct = columnDefProp<'row, 'value> ("type" ==> match ct with RightAligned -> "rightAligned" | NumericColumn -> "numericColumn") static member inline comparator (callback: 'a -> 'a -> int) = columnDefProp<'row, 'value> ("comparator" ==> fun a b -> callback a b) - static member inline create<'v> (props:seq>) = props |> unbox<_ seq> |> createObj |> unbox> + static member inline editable (callback:'value -> 'row -> bool) = columnDefProp<'row, 'value> ("editable" ==> fun p -> callback p?value p?data) - static member inline field (v:'a -> string) = columnDefProp<'row, 'value> ("field" ==> v (unbox null)) - static member inline field (v:string) = columnDefProp<'row, 'value> ("field" ==> v) + static member inline editable (v: bool) = columnDefProp<'row, 'value> ("editable" ==> v) + static member inline equals (callback: 'value -> 'value -> bool) = columnDefProp<'row, 'value> ("equals" ==> callback) + static member inline enableRowGroup (v:bool) = columnDefProp<'row, 'value> ("enableRowGroup" ==> v) + static member inline enableCellChangeFlash (v:bool) = columnDefProp<'row, 'value> ("enableCellChangeFlash" ==> v) + //static member inline field (v:'a -> string) = columnDefProp<'row, 'value> ("field" ==> v (unbox null)) + static member inline field (v:string) = columnDefProp<'row, 'value> ("field" ==> v) + static member inline field (f: 'row -> _) = + // usage: `AgGrid.field _.FirstName` or `AgGrid.field (fun x -> x.FirstName)` + // Result = "FirstName" + // Get everthing after first '.' + let idxOfFirstDot = (string f).IndexOf('.') + let field = (string f).Substring(idxOfFirstDot + 1) + columnDefProp<'row, 'value> ("field" ==> field) + static member inline filter (v:RowFilter) = columnDefProp<'row, 'value> ("filter" ==> v.FilterText) + static member inline filter (v:bool) = columnDefProp<'row, 'value> ("filter" ==> v) + static member inline floatingFilter (v:bool) = columnDefProp<'row, 'value> ("floatingFilter" ==> v) static member inline headerCheckboxSelection (v:bool) = columnDefProp<'row, 'value> ("headerCheckboxSelection" ==> v) static member inline headerClass (v:string) = columnDefProp<'row, 'value> ("headerClass" ==> v) static member inline headerComponentFramework (callback:'colId -> 'props -> ReactElement) = columnDefProp<'row, 'value> ("headerComponentFramework" ==> fun p -> callback p?column?colId p) - static member inline headerName (v:string) = columnDefProp<'row, 'value> ("headerName" ==> v) + static member inline headerName (v:string) = columnDefProp<'row, 'value> ("headerName" ==> v) + static member inline wrapHeaderText (v:bool) = columnDefProp<'row, 'value> ("wrapHeaderText" ==> v) + static member inline autoHeaderHeight (v:bool) = columnDefProp<'row, 'value> ("autoHeight" ==> v) static member inline hide (v:bool) = columnDefProp<'row, 'value> ("hide" ==> v) static member inline maxWidth (v:int) = columnDefProp<'row, 'value> ("maxWidth" ==> v) static member inline minWidth (v:int) = columnDefProp<'row, 'value> ("minWidth" ==> v) static member inline onCellClicked (handler:'value -> 'row -> unit) = columnDefProp<'row, 'value> ("onCellClicked" ==> (fun p -> handler p?value p?data)) + static member inline pinned (v:bool) = columnDefProp<'row, 'value> ("pinned" ==> v) + static member inline pivot(v:bool) = columnDefProp<'row, 'value> ("pivot" ==> v) static member inline resizable (v:bool) = columnDefProp<'row, 'value> ("resizable" ==> v) + static member inline rowDrag (v:bool) = columnDefProp<'row, 'value> ("rowDrag" ==> v) + static member inline rowGroup (v:bool) = columnDefProp<'row, 'value> ("rowGroup" ==> v) static member inline sortable (v:bool) = columnDefProp<'row, 'value> ("sortable" ==> v) static member inline suppressKeyboardEvent callback = columnDefProp<'row, 'value> ("suppressKeyboardEvent" ==> fun x -> callback x?event) static member inline suppressMovable = columnDefProp<'row, 'value> ("suppressMovable" ==> true) - static member inline valueFormatter (v:'value -> 'row -> string) = columnDefProp<'row, 'value> ("valueFormatter" ==> (fun p -> v p?value p?data)) - static member inline valueGetter (f:'row -> 'value) = columnDefProp<'row, 'value> ("valueGetter" ==> (fun x -> f x?data)) - static member inline valueSetter (f:string -> 'value -> 'row -> unit) = columnDefProp<'row, 'value> ("valueSetter" ==> (fun x -> f x?newValue x?oldValue x?data; false)) // return false to prevent the grid from immediately refreshing + + // Removed to resolve type inference issue with multiple overloads + //static member inline valueFormatter (callback:'value -> 'row -> string) = columnDefProp<'row, 'value> ("valueFormatter" ==> (fun (p: IValueParams<'row, 'value>) -> callback p.value p.data)) + static member inline valueFormatter (callback: IValueParams<'row, 'value> -> string) = columnDefProp<'row, 'value> ("valueFormatter" ==> callback) + static member inline valueGetter (f:'row -> _) = columnDefProp<'row, 'value> ("valueGetter" ==> (fun x -> f x?data)) + static member inline valueSetter (f: IValueChangedParams<'row, 'value> -> unit) = columnDefProp<'row, 'value> ("valueSetter" ==> f) + static member inline valueSetter (f: IValueChangedParams<'row, 'value> -> bool) = columnDefProp<'row, 'value> ("valueSetter" ==> f) + static member inline valueParser (f: IValueChangedParams<'row, 'value> -> obj) = columnDefProp<'row, 'value> ("valueParser" ==> f) // Is never called by AgGrid static member inline width (v:int) = columnDefProp<'row, 'value> ("width" ==> v) [] @@ -104,7 +322,7 @@ type ColumnGroup<'row> = static member inline marryChildren(v:bool) = columnGroupDefProp<'row> ("marryChildren" ==> v) static member inline openByDefault(v:bool) = columnGroupDefProp<'row> ("openByDefault" ==> v) - static member inline create<'row> (props:seq>) (children:seq>) = + static member inline create (props:seq>) (children:seq>) = props |> Seq.append [(columnGroupDefProp<'row> ("children" ==> Seq.toArray children))] |> unbox<_ seq> |> createObj |> unbox> [] @@ -112,23 +330,35 @@ type IAgGridProp<'row> = interface end let agGridProp<'row> (x:obj) = unbox> x [] -type AgGrid() = - static member inline onSelectionChanged (callback:'row array -> unit) = agGridProp<'row>("onSelectionChanged", fun x -> x?api?getSelectedRows() |> callback) +type AgGrid<'row> = + static member inline animateRows (v:bool) = agGridProp<'row>("animateRows" ==> v) + static member inline alwaysShowVerticalScroll (v:bool) = agGridProp<'row>("alwaysShowVerticalScroll" ==> v) + static member inline columnDefs (columns:IColumnDef<'row> seq) = agGridProp<'row>("columnDefs", columns |> unbox |> Seq.toArray) + static member inline copyHeadersToClipboard (v:bool) = agGridProp<'row>("copyHeadersToClipboard" ==> v) + static member inline domLayout (l:DOMLayout) = agGridProp<'row>("domLayout", l.LayoutText) + static member inline enableCellTextSelection (v:bool) = agGridProp<'row> ("enableCellTextSelection" ==> v) + static member inline ensureDomOrder (v:bool) = agGridProp<'row> ("ensureDomOrder" ==> v) + static member inline enterNavigatesVertically (v:bool) = agGridProp<'row> ("enterNavigatesVertically" ==> v) + static member inline getRowNodeId (callback: 'row -> _) = agGridProp<'row>("getRowNodeId", callback) + static member inline getRowId (callback: IGetRowIdParams<'row> -> string) = agGridProp<'row>("getRowId", callback) + static member inline onCellEditRequest (callback: obj -> unit) = agGridProp<'row>("onCellEditRequest", callback) static member inline onCellValueChanged callback = agGridProp<'row>("onCellValueChanged", fun x -> callback x?data) + static member inline onPasteStart (callback: IPasteEvent<'row> -> unit) = agGridProp<'row>("onPasteStart", callback) + static member inline onPasteEnd (callback: IPasteEvent<'row> -> unit) = agGridProp<'row>("onPasteEnd", callback) static member inline onRowClicked (handler:'value -> 'row -> unit) = agGridProp<'row> ("onRowClicked" ==> (fun p -> handler p?value p?data)) + static member inline onSelectionChanged (callback:'row array -> unit) = agGridProp<'row>("onSelectionChanged", fun x -> x?api?getSelectedRows() |> callback) + static member inline readOnlyEdit (v:bool) = agGridProp<'row>("readOnlyEdit" ==> v) static member inline singleClickEdit (v:bool) = agGridProp<'row>("singleClickEdit" ==> v) static member inline rowDeselection (v:bool) = agGridProp<'row>("rowDeselection", v) static member inline rowSelection (s:RowSelection) = agGridProp<'row>("rowSelection", s.ToString().ToLower()) static member inline isRowSelectable (callback:'row -> bool) = agGridProp<'row>("isRowSelectable" ==> fun x -> x?data |> callback) static member inline suppressRowClickSelection (v:bool) = agGridProp<'row>("suppressRowClickSelection" ==> v) - static member inline enableCellTextSelection (v:bool) = agGridProp<'row> ("enableCellTextSelection" ==> v) - static member inline ensureDomOrder (v:bool) = agGridProp<'row> ("ensureDomOrder" ==> v) static member inline rowHeight (h:int) = agGridProp<'row>("rowHeight", h) - static member inline domLayout (l:DOMLayout) = agGridProp<'row>("domLayout", l.LayoutText) static member inline immutableData (v:bool) = agGridProp<'row>("immutableData", v) + /// Converts your data to a JS array to populate the grid. (This is less efficient than passing an array.) + static member inline rowData (data:'row seq) = agGridProp<'row>("rowData", Seq.toArray data) static member inline rowData (data:'row array) = agGridProp<'row>("rowData", data) - static member inline getRowNodeId (callback: 'row -> _) = agGridProp<'row>("getRowNodeId", callback) - static member inline columnDefs (columns:IColumnDef<'row> seq) = agGridProp<'row>("columnDefs", columns |> unbox |> Seq.toArray) + static member inline rowDragManaged (v:bool) = agGridProp<'row>("rowDragManaged" ==> v) static member inline defaultColDef (defaults:IColumnDefProp<'row, 'value> seq) = agGridProp<'row>("defaultColDef", defaults |> unbox<_ seq> |> createObj) static member onColumnGroupOpened (callback:_ -> unit) = // This can't be inline otherwise Fable produces invalid JS let onColumnGroupOpened = fun ev -> @@ -140,7 +370,7 @@ type AgGrid() = ev?columnApi?autoSizeColumns(colIds)) 0 |> ignore |} |> callback agGridProp<'row>("onColumnGroupOpened", onColumnGroupOpened) - + static member inline paginationPageSize (pageSize:int) = agGridProp<'row>("paginationPageSize", pageSize) static member inline paginationAutoPageSize (v:bool) = agGridProp<'row>("paginationAutoPageSize", v) static member inline pagination (v:bool) = agGridProp<'row>("pagination", v) @@ -156,8 +386,13 @@ type AgGrid() = Export = fun () -> ev?api?exportDataAsCsv(obj()) |} |> callback agGridProp<'row>("onGridReady", onGridReady) + + static member inline processDataFromClipboard (callback: IProcessDataFromClipboardParams<'row> -> string[][]) = agGridProp<'row>("processDataFromClipboard", callback) static member inline enableRangeHandle (v: bool) = agGridProp<'row>("enableRangeHandle", v) static member inline enableRangeSelection (v: bool) = agGridProp<'row>("enableRangeSelection", v) + static member inline pivotMode (v: bool) = agGridProp<'row>("pivotMode", v) + static member inline treeData (v: bool) = agGridProp<'row>("treeData", v) + static member inline suppressAggFuncInHeader (v: bool) = agGridProp<'row>("suppressAggFuncInHeader", v) static member inline getContextMenuItems (callback : int -> int -> MenuItem list) = agGridProp<'row>("getContextMenuItems", fun x -> let menuItems = callback x?node?rowIndex x?column?colId [| @@ -167,7 +402,10 @@ type AgGrid() = | Custom customMenuItem -> box customMenuItem |]) static member inline headerHeight height = agGridProp<'row>("headerHeight", height) - static member inline onCellFocused callback = agGridProp<'row>("onCellFocused", fun x -> callback x?rowIndex x?column?colId) + static member inline groupHeaderHeight height = agGridProp<'row>("groupHeaderHeight", height) + [] + static member inline onCellFocused callback = agGridProp<'row>("onCellFocused", fun x -> callback (int x?rowIndex) (int x?column?colId)) + static member inline onCellFocused callback = agGridProp<'row>("onCellFocused", fun (e: ICellFocusedEvent<'row>) -> callback e) static member inline onRangeSelectionChanged callback = agGridProp<'row>("onRangeSelectionChanged", fun x -> let selectedRange = x?api?getCellRanges()?at(0) let startRow = selectedRange?startRow?rowIndex @@ -191,4 +429,12 @@ type AgGrid() = static member inline key (v:int) = agGridProp<'row> (prop.key v) static member inline key (v:System.Guid) = agGridProp<'row> (prop.key v) - static member inline grid<'row> (props:IAgGridProp<'row> seq) = Interop.reactApi.createElement (agGrid, createObj !!props) + static member inline dataTypeDefinitions (v: obj) = agGridProp<'row>("dataTypeDefinitions", v) + static member inline enableFillHandle (v: bool) = agGridProp<'row>("enableFillHandle", v) + static member inline rowGroupPanelShow (v: RowGroupPanelShow) = agGridProp<'row>("rowGroupPanelShow", v.RowGroupPanelShowText) + static member inline groupDisplayType (v: RowGroupingDisplayType) = agGridProp<'row>("groupDisplayType", v.RowGroupingDisplayTypeText) + + static member inline undoRedoCellEditing (v: bool) = agGridProp<'row>("undoRedoCellEditing", v) + static member inline undoRedoCellEditingLimit (v: int) = agGridProp<'row>("undoRedoCellEditingLimit", v) + + static member inline grid (props: IAgGridProp<'row> seq) = Interop.reactApi.createElement (agGrid, createObj !!props) From 17908f2bf2bc5e8d837f595521d126a25ebdb5ad Mon Sep 17 00:00:00 2001 From: Jordan Marr Date: Fri, 31 May 2024 14:36:13 -0400 Subject: [PATCH 2/2] Added LicenseManager --- src/AgGrid.fs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/AgGrid.fs b/src/AgGrid.fs index ffb9a81..67069d1 100644 --- a/src/AgGrid.fs +++ b/src/AgGrid.fs @@ -8,11 +8,10 @@ open Feliz let agGrid : obj = import "AgGridReact" "ag-grid-react" -// User should load the CSS files in their own project -//importAll "ag-grid-community/styles/ag-grid.css" -//importAll "ag-grid-community/styles/ag-theme-alpine.css" -//importAll "ag-grid-community/styles/ag-theme-balham.css" -//importAll "ag-grid-community/styles/ag-theme-material.css" +[] +[] +type LicenseManager = + static member setLicenseKey (key: string) : unit = jsNative // https://www.ag-grid.com/javascript-data-grid/row-object/ []