Giter Site home page Giter Site logo

naguvan / react-mst-form Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 0.0 5.68 MB

Library for generating React forms from JSON schema using the react, material-ui, mobx and mobx-state-tree.

Home Page: https://naguvan.github.io/react-mst-form/packages/typescript-react-app-demo/src/index.html

License: MIT License

TypeScript 97.93% HTML 2.07%
jest material-ui mobx mobx-react mobx-state-tree react typescript

react-mst-form's People

Contributors

naguvan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

react-mst-form's Issues

Error text for enum is not good

Error text for enum select fields includes all the values available in the enum. If we have a select field with 100 values, the error message will be loooong...

Additionally, it uses the values, not option labels. Values are usually some hash IDs that don't have any meaningful value for the user.

image

Can we just say "should be not empty"?

[BUG] Select converts to input when no enum options

When there are no enum options, select field fallbacks to input field. Which is not okay (IMHO). This is the line that does this:
const select: boolean = !!type.enum && type.enum.length > 0;

I believe just a check hasOwnProperty('enum') is enough to determine if field should be of select type or input text.

Release 2.0.0

TODO: need to update the progress and changes

  1. Non Json-Schema properties to be moved to single complex property called "meta" (non-spec property)

From:

{
 "password": {
    "type": "string",
    "component": "password",
    "minLength": 6,
    "maxLength": 20,
    "sequence": 2
 }
}

To:

{
 "password": {
    "type": "string",
    "minLength": 6,
    "maxLength": 20,
     "meta": {
          "component": "password",
          "sequence": 2
     }
 }
}
  1. Type specific "meta" properties with compile time check with typescript and runtime check with "mobx-state-tree"

  2. more material-ui component support for type "string". ex: "date", "datetime", "password" etc

Make the cancel button conditionally visible

Make the cancel button conditionally visible per form schema. The cancel label could be used for that. For example when a falsy value is supplied to "cancel" property, the Cancel button should not be rendered. A very simple change is needed, just change this:
{onCancel && (
to this:
{onCancel && cancel && (

image

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.