mag-component-value-list

1.0.5 • Public • Published

Value list component

build status npm version dependencies status devDependencies status Gitter

Value list is a component to build user interface, an instance of Component module.

Installation

npm install mag-component-value-list

Usage

Add the constructor to the scope:

var ValueList = require('mag-component-value-list');

Create value list instance:

var valueList = new ValueList({
    data: [11, 22, 35, 56, 78],
    cycle: true,
    render: function ( $body ) {
        $body.innerText = 'Number: ' + this.current.value;
    },
    events: {
        // current state was changed
        'data:change': function ( event ) {
            console.log(event);
        }
    }
});

To get current state:

console.log(valueList.current);

Development mode

There is a global var DEVELOP which activates additional consistency checks and protection logic not available in release mode.

Contribution

If you have any problems or suggestions please open an issue according to the contribution rules.

License

mag-component-value-list is released under the MIT License.

Package Sidebar

Install

npm i mag-component-value-list

Weekly Downloads

5

Version

1.0.5

License

MIT

Unpacked Size

15.4 kB

Total Files

26

Last publish

Collaborators

  • magsdk