Coder Social home page Coder Social logo

Comments (5)

Mortaro avatar Mortaro commented on June 22, 2024

Heyo, that seems like something that can be achieved with binds, could you please provide me with an example in pseudocode?

If this is what i'm guessing it is, you could use inheritance from a base form class that loops instance variables of the child class and generates both a form and a backend for it. That would be an awesome idea for an open source project

from nullstack.

agsb avatar agsb commented on June 22, 2024

heyo,

As CSS describes the layout, this could describe the fields, for a form;

As a initial draft, using regex for validation, show before box, view is ids for css, namedb is the name for use in back-end, etc. Could define some defaults before translate, maybe using a 'default' ;)

layout : {
record : {
'form' : { 'name' : 'uuid },
'name' : { 'validate' : '[a-z]{6-16}' , 'show' : ' Name or Nickname : ', 'view' : ' css id' , 'namedb' : ' ftu_user_lite' },
'age' : { 'validade' : '[0-9][0-9]' , 'show' : ' Age from 1970 : ', 'view' : 'css id', 'namedb' : 'ftu_ages_seth' },
'zip' : { 'validade', '[0-9]{2}.[0-9]{4}.[0-9]{4}' , 'show' : 'Where to send : ', 'view' : '** css id **' , 'namedb' : 'ftu_zip_lost' }
}
}

from nullstack.

Mortaro avatar Mortaro commented on June 22, 2024

This would be a cool opensource class that extends Nullstack

You could achieve this by doing a map on each key and binding it like <input bind={record[key]} />

from nullstack.

agsb avatar agsb commented on June 22, 2024

from nullstack.

Mortaro avatar Mortaro commented on June 22, 2024

The standard key could be a static attribute in the class (not async) which would be accessible in all environments.

In this example resource would be your library that extends Nullstack and is extendable and generates a crud from a custom schema:

import Resource from './Resource';

class Page extends Resource {

  static schema = {
    title: '',
    slug: '',
    content: ''
  }

  static collection = 'pages';
  static redirect = '/pages';
  static title = 'Create Page';
  static required = ['title', 'slug'];

}

export default Page;

It could also have more complexes schemas like the JSON you mentioned.

I'm going to mark the issue as resolved since the tools to create this are present in Nullstack, but would love to see opensource packages making this work out of the box, if you end up creating one please keep me posted πŸ’œ

from nullstack.

Related Issues (20)

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.