Last active
June 13, 2017 15:33
-
-
Save bentayloruk/575e24b620235ae8bf04da3c7d9105bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ReactQueryBuilder | |
open Fable.Core | |
open Fable.Import | |
open Fable.Import.React | |
open Fable.Core.JsInterop | |
open Fable.Helpers.React.Props | |
open System | |
// TODO | |
// * Can we have Pojo properties be uppercase, but lowercase in JS generation? Cosmetic. | |
type Name = string | |
type Label = string | |
[<Pojo>] | |
type Field = { | |
name : Name | |
label : Label } | |
[<StringEnum>] | |
type CombinatorName = And | Or | |
[<Pojo>] | |
type Combinator = { | |
name : CombinatorName | |
label : Label } | |
type internal IQueryBuilderProp = | |
inherit IHTMLProp | |
type QueryBuilderProps = | |
| Fields of Field array | |
| Combinators of Combinator array | |
interface IQueryBuilderProp | |
let QueryBuilder = importDefault<ComponentClass<obj>> "react-querybuilder" | |
let inline queryBuilder (htmlProps: IHTMLProp list) = Fable.Helpers.React.from QueryBuilder (keyValueList CaseRules.LowerFirst htmlProps) [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment