Radio list component
Radio list is a component to build user interface, an instance of Component module. It is based on mag-component-list.
Installation
npm install mag-component-radio-list
Usage
Add the constructor to the scope:
var RadioList = ;
Create radio list instance:
var radioList = focusIndex: 0 classIcon: 'theme-icon theme-icon-checkbox' classIconActive: 'theme-icon theme-icon-checkbox-active' classChecked: 'checked' data: state: false title: 'Some title 1' value: 'string' state: true title: 'Some title 2' value: 'number' state: false title: 'Some title 3' value: 'object' ;
To change data after creation:
radioList;
To change item state:
radioList;
To reset to init state (data and focusIndex):
radioList;
To uncheck all items:
radioList;
To get checked item data:
console;
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-radio-list
is released under the MIT License.