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

Add cssClasses attribute to context menu #42

Merged
merged 3 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions ELM_CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Elm Changelog

## [22.0.0]

- Added `cssClasses` attribute to context menu action
- Added `floatingFilter` attribute to ColumnDefs

## [21.0.0]

- ColumnDefs now support a FilterType `DateFilter`, which makes AGGrid intrepret the column as having dates and offering date type specific filtering with date pickers etc.
Expand Down
2 changes: 1 addition & 1 deletion elm.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "mercurymedia/elm-ag-grid",
"summary": "AgGrid integration for Elm",
"license": "MIT",
"version": "21.0.0",
"version": "22.0.0",
"exposed-modules": [
"AgGrid.ContextMenu",
"AgGrid.Expression",
Expand Down
5 changes: 5 additions & 0 deletions src/AgGrid.elm
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ type alias ColumnSettings =
}
, filterValueGetter : Maybe String
, flex : Maybe Int
, floatingFilter : Bool
, headerCheckboxSelection : Bool
, hide : Bool
, lockPosition : LockPosition
Expand Down Expand Up @@ -534,6 +535,7 @@ Default column settings:
}
, filterValueGetter = Nothing
, flex = Nothing
, floatingFilter = False
, headerCheckboxSelection = False
, hide = False
, lockPosition = NoPositionLock
Expand All @@ -558,6 +560,7 @@ Default column settings:
, valueSetter = Nothing
, width = Nothing
, wrapHeaderText = False
}

-}
defaultSettings : ColumnSettings
Expand All @@ -578,6 +581,7 @@ defaultSettings =
}
, filterValueGetter = Nothing
, flex = Nothing
, floatingFilter = False
, headerCheckboxSelection = False
, hide = False
, lockPosition = NoPositionLock
Expand Down Expand Up @@ -1111,6 +1115,7 @@ columnDefEncoder gridConfig columnDef =
)
, ( "filterValueGetter", encodedFilterValueGetter )
, ( "flex", encodeMaybe Json.Encode.int columnDef.settings.flex )
, ( "floatingFilter", Json.Encode.bool columnDef.settings.floatingFilter )
, ( "headerCheckboxSelection", Json.Encode.bool columnDef.settings.headerCheckboxSelection )
, ( "headerName", Json.Encode.string columnDef.headerName )
, ( "hide", Json.Encode.bool columnDef.settings.hide )
Expand Down
4 changes: 4 additions & 0 deletions src/AgGrid/ContextMenu.elm
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ type alias ContextActionAttributes =
, actionName : Maybe String
, icon : Maybe String
, disabled : Eval Bool
, cssClasses : List String
, subMenu : List ContextAction
}

Expand All @@ -78,6 +79,7 @@ contextAction :
, actionName : Maybe String
, disabled : Eval Bool
, icon : Maybe String
, cssClasses : List String
, subMenu : List ContextAction
}
-> ContextAction
Expand Down Expand Up @@ -105,6 +107,7 @@ defaultActionAttributes =
, disabled = Const False
, actionName = Nothing
, icon = Nothing
, cssClasses = []
, subMenu = []
}

Expand Down Expand Up @@ -292,5 +295,6 @@ encodeCustomContextAction action =
, ( "actionName", Json.Encode.Extra.encodeMaybe Json.Encode.string action.actionName )
, ( "disabledCallback", Expression.encode Json.Encode.bool action.disabled )
, ( "icon", Json.Encode.Extra.encodeMaybe Json.Encode.string action.icon )
, ( "cssClasses", Json.Encode.list Json.Encode.string action.cssClasses )
, ( "subMenu", Json.Encode.list encodeContextAction action.subMenu )
]
Loading