Skip to content

Commit

Permalink
Merge pull request #51 from mercurymedia/feature/auto-row-height
Browse files Browse the repository at this point in the history
Add auto row height and wrap text to column settings
  • Loading branch information
hingew authored Feb 13, 2024
2 parents 83b61a3 + 9d73460 commit 20a41a8
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
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

0 comments on commit 20a41a8

Please sign in to comment.