0.0.5 • Published 6 years ago

invock-js-ui v0.0.5

Weekly downloads
15
License
-
Repository
-
Last release
6 years ago

Invock-js-ui

Module for the invock-js Framework to build beautiful & clean UI quickly.

It's Aplha Version to test the UI components.

Table of Contents

  • installation
  • Title
  • SubTitle
  • Paragraph
  • Input && TextArea
  • CheckRadio
  • Select
  • ProgressBar
  • Table
  • Message
  • Form
  • Navigation / Menu
  • Modal / Popup
  • Chart

Installation

npm install invock-js-ui

Title

this component for Title UI, like :

  • Header
  • Title of Section
import invock, {Component} from "invock-js";
import {Title} from "invock-js-ui";

class App extends Component {
    render() {
        return `
            <div id="app" class="theme-bleu">
                {% Title title="hello world" classes="uppercase align-center" %}
            </div>
        `;
    }
}

invock.export("App", App);
invock.mount({ parent : "#container", root : "{% App %}" });

Parameters Title

ParameterTypeExemple
TitleStringHello World
classesStringalign-center uppercase
typeStringh1 OR h2 OR h3

SubTitle

this component for display Sub Title UI

import invock, {Component} from "invock-js";
import {SubTitle} from "invock-js-ui";

class App extends Component {
    render() {
        return `
            <div id="app" class="theme-bleu">
                {% SubTitle title="hello world" classes="uppercase align-center" %}
            </div>
        `;
    }
}

invock.export("App", App);
invock.mount({ parent : "#container", root : "{% App %}" });

Parameters SubTitle

ParameterTypeExemple
TitleStringHello World
classesStringalign-center uppercase

Paragraph

this component for display Long Text in Paragraph Element

import invock, {Component} from "invock-js";
import {Paragraph} from "invock-js-ui";

class App extends Component {
    render() {
        return `
            <div id="app" class="theme-bleu">
                {% Paragraph text="hello world" classes="uppercase align-center" %}
            </div>
        `;
    }
}

invock.export("App", App);
invock.mount({ parent : "#container", root : "{% App %}" });

Parameters Paragraph

ParameterTypeExemple
textStringlorem ipsum
classesStringalign-center uppercase

Input && TextArea

this component for display Input Element it's important to enter the Name Property of Input && TextArea Components

import invock, {Component} from "invock-js";
import {Input, TextArea} from "invock-js-ui";

class App extends Component {
    
    FirstNameChange(evt, self) {
        console.log(this);
         // return input Element
        console.log(evt);
        // return Event Object
        console.log(self);
        // return App Component
    }
    render() {
        return `
            <div id="app" class="theme-bleu">
                {% Input label="First Name" name="first_name" type="text" placeholder="Enter First Name" required="true" rule="string" onChange="{{this.FirstNameChange}}" %}
                {% TextArea label="Message" name="message" type="text" placeholder="Enter a message" required="true" rule="string" %}
            </div>
        `;
    }
}

invock.export("App", App);
invock.mount({ parent : "#container", root : "{% App %}" });

Parameters Input && TextArea

ParameterTypeExemple
labelStringFirst Name
nameStringfirst_name
typeStringtext / email / phone / password / number /...
placeholderStringEnter First Name
requiredBooleantrue / false
ruleStringstring, email, phone, url, number, boolean, text, date
onChangeFunctionFunction in parent Component

CheckRadio

this component for display CheckBox and Radio Box it's important to enter the Name Property of CheckRadio Components

import invock, {Component} from "invock-js";
import {CheckRadio} from "invock-js-ui";

class App extends Component {
    
    clickCheck(evt, self) {
        console.log(this);
         // return input Element
        console.log(evt);
        // return Event Object
        console.log(self);
        // return App Component
    }
    render() {
        return `
            <div id="app" class="theme-bleu">
                {% CheckRadio label="Conditions" name="condition" required="true" onClick="{{this.clickCheck}}" %}
                {% CheckRadio type="radio" label="Number 01" name="vote" required="true" value="1" %}
                {% CheckRadio type="radio" label="Number 02" name="vote" required="true" value="2" %}
                {% CheckRadio type="radio" label="Number 03" name="vote" required="true" value="3" %}
            </div>
        `;
    }
}

invock.export("App", App);
invock.mount({ parent : "#container", root : "{% App %}" });

Parameters Input && TextArea

ParameterTypeExemple
labelStringConditions
nameStringconditions
typeStringcheckbox / radio
checkedBooleantrue / false
requiredBooleantrue / false
onClickFunctionFunction in parent Component

Select

this component for display Select Element it's important to enter the Name Property of Select Component

import invock, {Component} from "invock-js";
import {Select} from "invock-js-ui";

class App extends Component {
    
    constructor(props) {
        super(props);
        this.props.options = [
            { label : "TV", value: "tv" },
            { label : "mobile", value: "mobile" },
            { label : "PC", value: "pc" },
        ];
    }
    
    changeSelect(evt, self) {
        console.log(this);
         // return input Element
        console.log(evt);
        // return Event Object
        console.log(self);
        // return App Component
    }
    render() {
        return `
            <div id="app" class="theme-bleu">
                {% Select label="Type of product" name="product" required="true" options="{{props.options}}" onChange="{{this.changeSelect}}" %}
            </div>
        `;
    }
}

invock.export("App", App);
invock.mount({ parent : "#container", root : "{% App %}" });

Parameters Select

ParameterTypeExemple
labelStringType of Product
nameStringtype_product
requiredBooleantrue / false
ruleStringstring, email, phone, url, number, boolean, text, date
optionsArray { label : "PC", value : 1 }
onChangeFunctionFunction in parent Component

ProgressBar

this component for display ProgressBar Component

import invock, {Component} from "invock-js";
import {ProgressBar} from "invock-js-ui";

class App extends Component {
    
    constructor(props) {
        super(props);
        this.pourcent = 10;
    }
                             
    EventChange(evt, self) {
        self.pourcent +=10;
        self.changePourcent();
    }
    
    changePourcent() {
         var comp = this.getComponent("ProgressBar");
        comp.setChange(this.pourcent);
    }

    render() {
        return `
            <div id="app" class="theme-bleu">
                {% ProgressBar value="10" label="pourcent of tolerance" %}

                <div class="align-center top30">
                    {% Bouton text="Progress" onClick="{{this.EventChange}}" %}
                </div>
            </div>
        `;
    }
}

invock.export("App", App);
invock.mount({ parent : "#container", root : "{% App %}" });

Parameters Select

ParameterTypeExemple
labelStringpourcent of tolerance
valueNumber10

Table

this component for display Table Element

import invock, {Component} from "invock-js";
import {Table} from "invock-js-ui";

class App extends Component {
    
    constructor(props) {
        super(props);
        this.table = {
                names : ["#", "name", "email", "job", "about"],
                rows : [
                    [1, "John Doe", "johndoe@exemple.com", "developper front-end", "About Jogn Doe"],
                    [2, "John Smith", "johnsmith@exemple.com", "developper back-end", "About John Smith"],
                    [3, "Nina Smith", "ninasmith@exemple.com", "Designer", "About Nina Smith"],
                ]
            }
    }

    render() {
        return `
            <div id="app" class="theme-bleu">
                <div>
                    {% Table names="{{this.table.names}}" rows="{{this.table.rows}}" adaptive="true" %}
                </div>
                
            </div>
        `;
    }
}

invock.export("App", App);
invock.mount({ parent : "#container", root : "{% App %}" });

Parameters Table

ParameterTypeExemple
namesArrayArray of names for Header of table "name", "email
rowsArrayArray of data to display
adaptiveBooleantrue / false

Message

this component for display Message Composant

import invock, {Component} from "invock-js";
import {Message} from "invock-js-ui";

class App extends Component {

    render() {
        return `
            <div id="app" class="theme-bleu">
                <div>
                    {% Message message="Email has sent" type="success"  %}
                </div>
                
            </div>
        `;
    }
}

invock.export("App", App);
invock.mount({ parent : "#container", root : "{% App %}" });

Parameters Message

ParameterTypeExemple
messageStringEmail has sent
typeStringsuccess / alert / info / warning

Form

comming soon

Navigation / Menu

comming soon

Modal / Popup

comming soon

Chart

comming soon