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 auto row height and wrap text to column settings #51

Merged
merged 3 commits into from
Feb 13, 2024
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
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
; https://editorconfig.org/

root = true

[*]
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true
indent_style = space
indent_size = 2

4 changes: 4 additions & 0 deletions ELM_CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Elm Changelog

## [25.0.0]

- Add `autoHeight` and `wrapText` to `ColumnSettings`

## [24.0.0]

- Added `rowClassRules` to `GridConfig`
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": "24.0.0",
"version": "25.0.0",
"exposed-modules": [
"AgGrid.ContextMenu",
"AgGrid.Expression",
Expand Down
6 changes: 6 additions & 0 deletions src/AgGrid.elm
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ type alias ColumnDef dataType =
type alias ColumnSettings =
{ aggFunc : Aggregation
, allowedAggFuncs : Maybe (List Aggregation)
, autoHeight : Bool
, defaultAggFunc : Aggregation
, autoHeaderHeight : Bool
, cellClassRules : List ClassRule
Expand Down Expand Up @@ -350,6 +351,7 @@ type alias ColumnSettings =
, valueSetter : Maybe String
, width : Maybe Float
, wrapHeaderText : Bool
, wrapText : Bool
}


Expand Down Expand Up @@ -576,6 +578,7 @@ defaultSettings : ColumnSettings
defaultSettings =
{ aggFunc = NoAggregation
, allowedAggFuncs = Nothing
, autoHeight = False
, defaultAggFunc = SumAggregation
, autoHeaderHeight = False
, cellClassRules = []
Expand Down Expand Up @@ -617,6 +620,7 @@ defaultSettings =
, valueSetter = Nothing
, width = Nothing
, wrapHeaderText = False
, wrapText = False
}


Expand Down Expand Up @@ -1052,6 +1056,7 @@ columnDefEncoder gridConfig columnDef =
Json.Encode.object
[ ( "aggFunc", encodeMaybe Json.Encode.string (aggregationToString columnDef.settings.aggFunc) )
, ( "allowedAggFuncs", encodeMaybe (List.filterMap aggregationToString >> Json.Encode.list Json.Encode.string) columnDef.settings.allowedAggFuncs )
, ( "autoHeight", Json.Encode.bool columnDef.settings.autoHeight )
, ( "defaultAggFunc", encodeMaybe Json.Encode.string (aggregationToString columnDef.settings.defaultAggFunc) )
, ( "autoHeaderHeight", Json.Encode.bool columnDef.settings.autoHeaderHeight )
, ( "cellClassRules", encodeClassRules columnDef.settings.cellClassRules )
Expand Down Expand Up @@ -1241,6 +1246,7 @@ columnDefEncoder gridConfig columnDef =
Json.Encode.null
)
, ( "wrapHeaderText", Json.Encode.bool columnDef.settings.wrapHeaderText )
, ( "wrapText", Json.Encode.bool columnDef.settings.wrapText )
]


Expand Down
Loading