Skip to content

Commit

Permalink
Merge pull request #34 from CompositionalIT/JordanMarr/main
Browse files Browse the repository at this point in the history
Add enterprise features
  • Loading branch information
Larocceau authored Oct 4, 2024
2 parents 3127eec + ae7d0a1 commit 04b93ff
Show file tree
Hide file tree
Showing 10 changed files with 1,066 additions and 427 deletions.
12 changes: 6 additions & 6 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
"fable"
]
},
"fantomas-tool": {
"version": "4.4.0",
"commands": [
"fantomas"
]
},
"femto": {
"version": "0.16.0",
"commands": [
"femto"
]
},
"fantomas": {
"version": "6.3.9",
"commands": [
"fantomas"
]
}
}
}
8 changes: 4 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false
insert_final_newline = true

[src/Client/*.fs]
# Feliz style
fsharp_single_argument_web_mode=true
[*.{fs,fsx}]
fsharp_multiline_bracket_style = stroustrup
fsharp_newline_before_multiline_computation_expression = false
58 changes: 51 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,57 @@

Feliz-style bindings for [ag-grid-react](https://www.npmjs.com/package/ag-grid-react)

## Version Compatibility
## Versions

### The table below gives the ranges of compatible versions of Feliz AgGrid with its dependent packages.
### Required versions of dependencies

| Feliz.AgGrid | ag-grid-react/community | React | Fable | Feliz |
|- |- |- |- |- |
| 0.0.6 | 25.x | 17.x | 3.x | 1.x |
| 1.x | 31.x | 18.x | 4.x | 2.x |
Note: ag-grid-react/enterprise is only required if using enterprise features.

| Feliz.AgGrid | ag-grid-react/community | ag-grid-react/enterprise | React | Fable | Feliz |
|--------------|-------------------------|--------------------------|-------|-------|-------|
| 2.x | 31.x | 31.x | 18.x | 4.x | 2.x |
| 1.x | 31.x | - | 18.x | 4.x | 2.x |
| 0.0.6 | 25.x | - | 17.x | 3.x | 1.x |

### Migration guides

#### v1 to v2

##### Import AG Grid style sheets

To give you better control of your bundle, Feliz.AgGrid no longer imports styles for you, so you will need to include
appropriate imports yourself. For example, add the following lines to your client code to import the necessary styles
and the Balham theme.

```fsharp
importAll "ag-grid-community/styles/ag-grid.css"
importAll "ag-grid-community/styles/ag-theme-balham.css"
```

##### Use new API

Many properties have been updated to more closely reflect the AG Grid docs. In particular, functions like
valueFormatter, valueSetter and cellRenderer now take single-parameter functions, with that parameter having properties
on it allowing you to access the data that you need. This makes it easier for you to get started from the AG Grid docs.

For example, rather than `ColumnDef.cellRenderer` giving you the value in the cell, you are now given a params object
that has a `.value` field.

```diff
- ColumnDef.cellRenderer (fun x _ ->
+ ColumnDef.cellRenderer (fun rendererParams ->
Html.span [
Html.span [
prop.style [ style.fontSize 9 ]
prop.children [ Html.text "🏅" ]
]
- Html.textf "%i" x
+ Html.text $"%i{rendererParams.value}"
])
```

You can see more examples of the required changes in [Git
commit `cbb0102`](https://github.com/CompositionalIT/feliz-ag-grid/commit/cbb0102e9a7504d0518d32999071c1751ea85be6).

## Installation

Expand All @@ -21,7 +64,8 @@ Found in `./src`

## Demo

Demo code is in `./demo`. You can see it running live at [https://compositionalit.github.io/feliz-ag-grid/](https://compositionalit.github.io/feliz-ag-grid/)
Demo code is in `./demo`. You can see it running live
at [https://compositionalit.github.io/feliz-ag-grid/](https://compositionalit.github.io/feliz-ag-grid/)

## Publishing a new package

Expand Down
18 changes: 9 additions & 9 deletions demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
## Deploy

- Change the reference to the src project into a reference to the appropriate NuGet package, e.g.:
``` diff
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\src\Feliz.AgGrid.fsproj" />
- </ItemGroup>
<ItemGroup>
<PackageReference Include="Feliz" Version="1.65.0" />
+ <PackageReference Include="Feliz.AgGrid" Version="0.0.4" />
```
```diff
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\src\Feliz.AgGrid.fsproj" />
- </ItemGroup>
<ItemGroup>
<PackageReference Include="Feliz" Version="1.65.0" />
+ <PackageReference Include="Feliz.AgGrid" Version="0.0.4" />
```
- Run `npm run publish-docs`
Loading

0 comments on commit 04b93ff

Please sign in to comment.