+v14.0.0
jComponent supports versioning of components. In other words: you can provide multiple same components with different versions.
// COMPONENT('name@VERSION', ...)
COMPONENT('textbox', function(self, config) {
self.make = function() {
console.log('textbox');
};
});
COMPONENT('textbox@1', function(self, config) {
self.make = function() {
console.log('textbox v1');
};
});
COMPONENT('textbox@2', function(self, config) {
self.make = function() {
console.log('textbox v2');
};
});
Multiple versions in the one component:
COMPONENT('textbox, textbox@1, textbox@2', function(self, config) {
self.make = function() {
console.log('3 versions of textbox');
};
});
<!-- MAIN VERSION -->
<div data-jc="textbox"></div>
<!-- VERSION 1 -->
<div data-jc="textbox@1"></div>
<!-- VERSION 2 -->
<div data-jc="textbox@2"></div>
<script>
// Travelsing for all version
SETTER('textbox', 'setter', 'test');
// Travelsing for version 1
SETTER('textbox@1', 'setter', 'test');
// Travelsing for version 2
SETTER('textbox@2', 'setter', 'test');
</script>
jComponent brings great new features for versioning. You can define same components with different functionality.
This version will be applied for all components which don't have added specific version manually.
DEF.version = '1';
// {String} Sets the default version for all components
// Default: empty
This version will be applied for all components which don't have added specific version manually.
VERSION('textbox@1', 'dropdown@3', 'textarea@2');