Coder Social home page Coder Social logo

virtual-form's Introduction

virtual-form

Form interface for virtual-dom

WORK IN PROGRESS

The intention is for this to be a set of form node utility functions that will allow us to patch properties to behave how we expect. This is probably better than trying to implement a VNode transform: it's always better to create the thing you wanted in the first place.

This is very early, doesn't work, no tests. I'm working in the open here. However I am closely following the MDN docs and expect to document all of the considered properties.

Form elements

button

fieldset

form

input

keygen

label

legend

meter

optgroup

progress

select

textarea

Contributors

  • Matt Esch

MIT Licenced

virtual-form's People

Contributors

matt-esch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ashnur

virtual-form's Issues

Implementing a function?

Hi I'm wondering what the proper way of implementing a virtual-form 'function' would be? Would this work (minus any syntax or logic issues)? Do I have to worry about the parent or children? What about error handling?

module.exports = {
    init: function(vt) {
        this.vt = vt;
        this.name = 'fieldset'
        this.validProps = ['disabled', 'form', 'name'];
    }

    create: function(props, children, opts) {
        props = props || {};

        if (!is_intersection(Object.keys(props), this.validProps)) {
            return undefined;
        }

        return new VNode(
            this.name,
            props,
            childs,
            opts.key || undefined,
            opts.namespace || undefined
        );
    },
    is_intersetion: function(h, a) {
        return a.some(function(e) {
            return h.indexOf(e) >= 0;
        });
    }
}

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.