Git Product home page Git Product logo

vis-ui.js's Introduction

vis-ui.js

This package provides JavaScript UI generator based on Bootstrap and jQuery UI.

Features

  • Generate form and input elements
  • Check and fill form
  • Tab navigation

Examples

Elements

Description how to use element generator.


Input

$("<div/>").generateElements({
    type: "input",
    name: "name",
    title: "Input",
    placeholder: "Enter the name",
    mandatory: true,
    cssClass: "input-css", 
    css: {width: "80%"}
})

Options

  • name: Field name
  • title: Title string
  • placeholder: Place holder in the input field
  • mandatory: Mandatory field: true, false or ReExpr ("/^\d+$/g" - only decimals)
  • cssClass: CSS class name
  • css: Custom CSS styles object. Example: {width: "80%"}
  • value: Default value

Text area

$("<div/>").generateElements({
    type: "textArea",
    name: "description" ,
    title: "Description",
    placeholder: "Enter the description",
})

Options

  • name: Field name
  • title: Title string
  • placeholder: Place holder in the input field
  • mandatory: Mandatory field: true, false or ReExpr ("/^\d+$/g" - only decimals)
  • cssClass: CSS class name
  • css: Custom CSS styles object. Example: {width: "80%"}
  • value: Default value

Check box

$("<div/>").generateElements({
    type: "checkbox",
    name: "check1",
    title: "Checkbox",
    mandatory: true,
    cssClass: "input-css", 
    css: {width: "80%"}
})

Options

  • name: Field name
  • title: Title string
  • placeholder: Place holder in the input field
  • mandatory: Mandatory field: true, false or ReExpr ("/^\d+$/g" - only decimals)
  • cssClass: CSS class name
  • css: Custom CSS styles object. Example: {width: "80%"}
  • value: Default value

Radio button

$("<div/>").generateElements({children:[{
        type: "radio",
        name: "yesNo",
        title: "Yes",
        css: {width: 50%}
    },{
        type: "radio",
        name: "yesNo",
        title: "no",
        css: {width: 50%}
}]})

Options

  • name: Field name
  • title: Title string
  • placeholder: Place holder in the input field
  • mandatory: Mandatory field: true, false or ReExpr ("/^\d+$/g" - only decimals)
  • cssClass: CSS class name
  • css: Custom CSS styles object. Example: {width: "80%"}
  • value: Default value

Select

$("<div/>").generateElements({type: "select", value: "de", options: {en:"English", de: "German"} })

Options

  • name: Field name
  • title: Title string
  • mandatory: Mandatory field: true, false or ReExpr ("/^\d+$/g" - only decimals)
  • cssClass: CSS class name
  • css: Custom CSS styles object. Example: {width: "80%"}
  • value: Default value
  • options: key/values object or array
  • multiply: Multiply selection. Default false

Basic usage example:

var $div = $("<div/>");
$div.generateElements({children:[{
    type:  'input',
    title: "Input",
    placeholder: "placeholder value",
    mandatory: true
},{
    type:  'input',
    name: "input2",
    title: "Input #2",
    placeholder: "placeholder value #2"
}]});

$div.popupDialog({
    title:       "Demo",
    maximizable: true,
    buttons:     [{
        text:  "OK",
        click: function(e) {
            var div = $(e.currentTarget).closest(".ui-dialog").find(".popup-dialog");
            div.popupDialog('close');
        }
    }]
});

Integration

Extend composer dependencies with eslider/vis-ui.js and update composer.

composer update

Load JS library to HTML.

<script src="web/assets/vis-ui.js/vis-ui.js-built.js"></script>

Add CSS styles.

<link media="all" type="text/css" rel="stylesheet" href="web/assets/require.css">

Package Managers

vis-ui.js's People

Contributors

eslider avatar davidpatzke avatar createreadupdate avatar

Watchers

James Cloos 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.