From e6f94d0dbdc609b72975a7d350c894767f0acbdf Mon Sep 17 00:00:00 2001 From: Kabir Shah Date: Tue, 7 Feb 2017 18:47:00 -0800 Subject: [PATCH] v0.2.1 --- dist/moon.js | 5 +---- dist/moon.min.js | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/dist/moon.js b/dist/moon.js index 4fef6e90..bf478916 100644 --- a/dist/moon.js +++ b/dist/moon.js @@ -1158,6 +1158,7 @@ MoonComponent.prototype.constructor = MoonComponent; MoonComponent.prototype.init = function () { + callHook(this, 'created'); this.$destroyed = false; this.$props = this.$opts.props || []; @@ -1168,10 +1169,6 @@ } }; - MoonComponent.prototype.build = function () { - this.$parent.build(); - }; - components[name] = MoonComponent; return MoonComponent; }; diff --git a/dist/moon.min.js b/dist/moon.min.js index 8ca45d65..943b8e75 100644 --- a/dist/moon.min.js +++ b/dist/moon.min.js @@ -5,4 +5,4 @@ * Free to use under the MIT license. * https://kingpixil.github.io/license */ -!function(t,e){"object"==typeof module&&module.exports?module.exports=e():t.Moon=e()}(this,function(){"use strict";function t(r){this.$opts=r||{};var o=this;this.$id=i++,this.$name=this.$opts.name||"root",this.$parent=this.$opts.parent||null,this.$data=this.$opts.data||{},this.$render=this.$opts.render||x,this.$hooks=this.$opts.hooks||{},this.$methods=this.$opts.methods||{},this.$events={},this.$dom={},this.$destroyed=!1,this.$initialRender=!0,this.$queued=!1,n[t.config.prefix+"if"]=function(t,e,n){return"("+p(t,!1)+") ? "+e+" : ''"},n[t.config.prefix+"for"]=function(t,e,n){var r=t.split(" in "),i=r[0].split(","),o='instance.get("'+r[1]+'")',s=i.join(","),u=function(t,e,n,r){return i.indexOf(n)===-1?t:t.replace(e,'" + '+n+r+' + "')};return"instance.renderLoop("+o+", function("+s+") { return "+p(e,!0,u)+"; })"},n[t.config.prefix+"on"]=function(e,n,r){var i={stop:"event.stopPropagation();",prevent:"event.preventDefault();",ctrl:"if(!event.ctrlKey) {return;};",shift:"if(!event.shiftKey) {return;};",alt:"if(!event.altKey) {return;};"},o=e.split(":"),s=o[0].split("."),u=s[0],c="";s.shift();for(var a=0;a",t.current);return r===-1?(t.tokens.push({type:"comment",value:e.slice(t.current)}),void(t.current=n)):(t.tokens.push({type:"comment",value:e.slice(t.current,r)}),void(t.current=r+3))},A=function(t){var e=t.input,n=(e.length,"/"===e.charAt(t.current+1));e.charAt(t.current);t.tokens.push({type:"tagStart",close:n}),t.current+=n?2:1;var r=E(t);C(t);var i="/"===e.charAt(t.current);t.tokens.push({type:"tagEnd",close:!1}),t.current+=i?2:1,i&&(t.tokens.push({type:"tagStart",close:!0}),t.tokens.push({type:"tag",value:r}),t.tokens.push({type:"attribute",value:{}}),t.tokens.push({type:"tagEnd",close:!1}))},E=function(t){for(var e=t.input,n=e.length,r=t.current;r"!==i&&" "!==i)break;r++}for(var o=r;o"===i||" "===i)break;o++}var s=e.slice(r,o);return t.tokens.push({type:"tag",value:s}),t.current=o,s},C=function(t){for(var e=t.input,n=e.length,r=t.current,i={},o="",s=/([^=\s]*)(=?)("[^"]*"|[^\s"]*)/gi;r"===u||"/"===u)break;o+=u,r++}o.replace(s,function(t,e,n,r){var o=r[0],s=r[r.length-1];("'"===o&&"'"===s||'"'===o&&'"'===s)&&(r=r.slice(1,-1)),r||(r=e),e&&r&&(i[e]=r)}),t.current=r,t.tokens.push({type:"attribute",value:i})},M=function(t){for(var e={type:"ROOT",children:[]},n={current:0,tokens:t};n.current",t.current);return r===-1?(t.tokens.push({type:"comment",value:e.slice(t.current)}),void(t.current=n)):(t.tokens.push({type:"comment",value:e.slice(t.current,r)}),void(t.current=r+3))},A=function(t){var e=t.input,n=(e.length,"/"===e.charAt(t.current+1));e.charAt(t.current);t.tokens.push({type:"tagStart",close:n}),t.current+=n?2:1;var r=E(t);C(t);var i="/"===e.charAt(t.current);t.tokens.push({type:"tagEnd",close:!1}),t.current+=i?2:1,i&&(t.tokens.push({type:"tagStart",close:!0}),t.tokens.push({type:"tag",value:r}),t.tokens.push({type:"attribute",value:{}}),t.tokens.push({type:"tagEnd",close:!1}))},E=function(t){for(var e=t.input,n=e.length,r=t.current;r"!==i&&" "!==i)break;r++}for(var o=r;o"===i||" "===i)break;o++}var s=e.slice(r,o);return t.tokens.push({type:"tag",value:s}),t.current=o,s},C=function(t){for(var e=t.input,n=e.length,r=t.current,i={},o="",s=/([^=\s]*)(=?)("[^"]*"|[^\s"]*)/gi;r"===u||"/"===u)break;o+=u,r++}o.replace(s,function(t,e,n,r){var o=r[0],s=r[r.length-1];("'"===o&&"'"===s||'"'===o&&'"'===s)&&(r=r.slice(1,-1)),r||(r=e),e&&r&&(i[e]=r)}),t.current=r,t.tokens.push({type:"attribute",value:i})},M=function(t){for(var e={type:"ROOT",children:[]},n={current:0,tokens:t};n.current