
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
mag-component-list
Advanced tools
List is a component to build user interface, an instance of Component module. May be associated with mag-data-cacher and stb-component-scrollbar.
npm install mag-component-list
Add the singleton to the scope:
var List = require('mag-component-list');
Create list instance:
var list = new List({
cycle: false,
className: 'list',
data: [
'0',
'1',
'2',
'3',
'4'
],
// custom render function
render: function ( $item, config ) {},
// data provider to get visible part from all data, may use mag-data-cacher
provider: dataProvider,
// associated ScrollBar component link, may use stb-component-scrollbar
scroll: new ScrollBar({}),
size: 3,
focusIndex: 0,
propagate: false,
type: List.prototype.TYPE_HORIZONTAL,
events: {
'focus:item': function ( event ) {
console.log(event);
},
'click:item': function ( event ) {
console.log(event);
}
}
});
To change data after creation:
list.setData({
focusIndex: 0,
data: [
'Item 0',
'Item 1'
]
});
To change focus position by index:
list.focusIndex(index);
To change focus item:
list.focusItem($item);
To blur item:
list.blurItem($item);
To mark item:
list.markItem($item, true);
There is a global var
DEVELOP
which activates additional consistency checks and protection logic not available in release mode.
If you have any problems or suggestions please open an issue according to the contribution rules.
mag-component-list
is released under the MIT License.
FAQs
Base list implementation.
The npm package mag-component-list receives a total of 1 weekly downloads. As such, mag-component-list popularity was classified as not popular.
We found that mag-component-list demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.