|
@@ -1,7 +1,17 @@
|
|
|
|
|
+var CONVERT_RE = /-(.)/g,
|
|
|
|
|
+ converter = function (m, char) {
|
|
|
|
|
+ return char.toUpperCase()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+function convertCSSProperty (prop) {
|
|
|
|
|
+ if (prop.charAt(0) === '-') prop = prop.slice(1)
|
|
|
|
|
+ return prop.replace(CONVERT_RE, converter)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
module.exports = {
|
|
module.exports = {
|
|
|
|
|
|
|
|
- on : require('./on'),
|
|
|
|
|
- each : require('./each'),
|
|
|
|
|
|
|
+ on : require('./on'),
|
|
|
|
|
+ each : require('./each'),
|
|
|
|
|
|
|
|
text: function (value) {
|
|
text: function (value) {
|
|
|
this.el.textContent =
|
|
this.el.textContent =
|
|
@@ -12,6 +22,10 @@ module.exports = {
|
|
|
show: function (value) {
|
|
show: function (value) {
|
|
|
this.el.style.display = value ? '' : 'none'
|
|
this.el.style.display = value ? '' : 'none'
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
|
|
+ visible: function (value) {
|
|
|
|
|
+ this.el.style.visibility = value ? '' : 'hidden'
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
focus: function (value) {
|
|
focus: function (value) {
|
|
|
this.el[value ? 'focus' : 'blur']()
|
|
this.el[value ? 'focus' : 'blur']()
|
|
@@ -75,5 +89,14 @@ module.exports = {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ style: {
|
|
|
|
|
+ bind: function () {
|
|
|
|
|
+ this.arg = convertCSSProperty(this.arg)
|
|
|
|
|
+ },
|
|
|
|
|
+ update: function (value) {
|
|
|
|
|
+ this.el.style[this.arg] = value
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|