Giter Site home page Giter Site logo

feliz.2sxc's Introduction

Feliz.2Sxc Nuget

Bindings and Helpers to facilitate creating apps for 2sxc with Feliz and Fable.

Features

2sxc Context

Typed interface to the main 2sxc internal api.

API

Uses Fable.SimpleHttp and Thoth.Json for a fresh async interface to setup requests against 2sxc data repositories and visual queries.

Toolbar Builder

Setting up a 2sxc toolbar was never easier, the toolbar builder provides a typed interface including documentation.

Then inject it with prop.toolbar and starts it with new hook React.useToolbarRef. When a 2sxc dialog closes, it calls the referesh callback.

let toolbar (person: PersonInfo option) =
    match person with
    | Some p ->
        Sxc.toolbar [ bi.toolbar.empty [ cp.contentType "Person"
                                         cp.entityId p.Id ]
                      bi.command.edit ()
                      bi.command.delete (
                          [ bp.color color.gray ], 
                          [ cp.entityGuid p.Guid
                            cp.title p.Name ])
                      bi.command.custom (
                          [ bp.color color.seaGreen
                            bp.title "Open 2sxc"
                            bp.icon "icon-sxc-glasses" ],
                          [ cp.openInNewTab "https://2sxc.org/" ]
                      )
                      bi.settings [ se.hover.right ] ]
    | _ ->
        Sxc.toolbar [ bi.toolbar.empty [ cp.contentType "Person" ]
                      bi.command.new' () ]

[<ReactComponent>]
let Person (sxc: Sxc.Context) refresh person =
    Html.li [ prop.toolbar (toolbar (Some person))
              prop.ref (React.useToolbarRef sxc refresh)
              prop.key person.Id
              prop.children [ [ Html.img [ prop.src $"{person.Photo}"
                                           prop.className "person" ]
                                Html.strong person.Name ]
                              |> Html.div ] ]

Routing just works

This part is now a separate package: Feliz.Router.BasePath.

Install-Package Feliz.Router.BasePath

feliz.2sxc's People

Contributors

scullman avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.