Documentation! + some little fixes to add consistency between components

This commit is contained in:
Keegan
2016-02-16 01:03:21 -08:00
parent b0ac596543
commit 24bfc54991
27 changed files with 724 additions and 1010 deletions
+2 -1
View File
@@ -7,6 +7,7 @@ module.exports = {
manipulator: 'checkboxgroup',
defaults: {
label: '',
options: []
options: [],
attributes: {}
}
};
+1 -4
View File
@@ -3,8 +3,5 @@
module.exports = {
name: 'footer',
template: require('../../templates/components/footer.tpl'),
manipulator: 'html',
defaults: {
attributes: {}
}
manipulator: 'html'
};
-1
View File
@@ -5,7 +5,6 @@ module.exports = {
template: require('../../templates/components/heading.tpl'),
manipulator: 'html',
defaults: {
attributes: {},
size: 4
}
};
+2 -1
View File
@@ -7,6 +7,7 @@ module.exports = {
manipulator: 'radiogroup',
defaults: {
label: '',
options: []
options: [],
attributes: {}
}
};
+2 -1
View File
@@ -7,7 +7,8 @@ module.exports = {
manipulator: 'val',
defaults: {
label: '',
options: []
options: [],
attributes: {}
},
initialize: function() {
var self = this;
+1 -2
View File
@@ -3,9 +3,8 @@
module.exports = {
name: 'submit',
template: require('../../templates/components/submit.tpl'),
manipulator: 'val',
manipulator: 'html',
defaults: {
label: '',
attributes: {}
}
};
+1 -4
View File
@@ -3,8 +3,5 @@
module.exports = {
name: 'text',
template: require('../../templates/components/text.tpl'),
manipulator: 'html',
defaults: {
attributes: {}
}
manipulator: 'html'
};
+11 -8
View File
@@ -113,7 +113,7 @@ function ClayConfig(settings, config, $rootContainer) {
utils.updateProperties(self.EVENTS, {writable: false});
/**
* @returns {ClayItem}
* @returns {Array.<ClayItem>}
*/
self.getAllItems = function() {
_checkBuilt('getAllItems');
@@ -121,21 +121,21 @@ function ClayConfig(settings, config, $rootContainer) {
};
/**
* @param {string} key
* @param {string} appKey
* @returns {ClayItem}
*/
self.getItemByAppKey = function(key) {
self.getItemByAppKey = function(appKey) {
_checkBuilt('getItemByAppKey');
return _itemsByAppKey[key];
return _itemsByAppKey[appKey];
};
/**
* @param {string} key
* @param {string} id
* @returns {ClayItem}
*/
self.getItemById = function(key) {
self.getItemById = function(id) {
_checkBuilt('getItemById');
return _itemsById[key];
return _itemsById[id];
};
/**
@@ -181,6 +181,9 @@ function ClayConfig(settings, config, $rootContainer) {
// prevent external modifications of properties
utils.updateProperties(self, { writable: false, configurable: false });
// expose the config to allow developers to update it before the build is run
self.config = config;
}
/**
@@ -191,7 +194,7 @@ function ClayConfig(settings, config, $rootContainer) {
* @param {string|{}} component.manipulator - methods to attach to the component
* @param {function} component.manipulator.set - set manipulator method
* @param {function} component.manipulator.get - get manipulator method
* @param {{}} component.defaults - template defaults
* @param {{}} [component.defaults] - template defaults
* @param {function} [component.initialize] - method to scaffold the component
* @return {boolean} - Returns true if component was registered correctly
*/
+1 -1
View File
@@ -23,7 +23,7 @@ function ClayItem(config) {
'Make sure to register it with ClayConfig.registerComponent()');
}
var _templateData = _.extend({}, _component.defaults, config);
var _templateData = _.extend({}, _component.defaults || {}, config);
/** @type {string|null} */
self.id = config.id || null;
-3
View File
@@ -43,9 +43,6 @@ module.exports = function (file, options) {
}
if (typeof file !== 'string') {
// Factory: return a function.
// Set options variable here so it is ready for when browserifyTransform
// is called. Note: first argument is the options.
options = file;
return browserifyTransform;
} else {