From 24efe2abed231d4c3f123c615d44fa91c60e4885 Mon Sep 17 00:00:00 2001 From: Daniel Yang Date: Tue, 28 Jul 2015 22:48:52 +0800 Subject: [PATCH] Release 0.5.5 --- dist/Q.min.js | 4 ++-- dist/Q.native.min.js | 4 ++-- dist/Q.zepto.min.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/Q.min.js b/dist/Q.min.js index 727970a..d0dffd5 100644 --- a/dist/Q.min.js +++ b/dist/Q.min.js @@ -1,7 +1,7 @@ /*! - * Q.js v0.5.4 + * Q.js v0.5.5 * Inspired from vue.js * (c) 2015 Daniel Yang * Released under the MIT License. */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?exports.Q=e(require("jquery")):t.Q=e(t.jQuery)}(this,function(t){return function(t){function e(n){if(i[n])return i[n].exports;var s=i[n]={exports:{},id:n,loaded:!1};return t[n].call(s.exports,s,s.exports,e),s.loaded=!0,s.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){var n=i(1),s=i(3),r=i(5);s.extend(n,s),t.exports=r(n)},function(t,e,i){function n(t,e,i){for(var n,s=0,r=h.length;r>s;s++)if(n="q-"+h[s],t.hasAttribute(n))return e.push({name:n,value:t.getAttribute(n)}),t.removeAttribute(n),!0}function s(t,e,i){var r,o,h,l,f,p,d;for(r=0;l=t[r++];){if(1===l.nodeType){if(f=l.attributes,p=[],!n(l,p,i)){for(o=0,h=f.length;h>o;o++)0===f[o].name.indexOf("q-")&&p.push({name:f[o].name,value:f[o].value});i.useCache&&!d&&(d=d||++c,l.setAttribute("qtid",d),a.put(d,p))}p.length>0&&e(l,p,i)}l.childNodes.length&&!i.stop&&s(u.call(l.childNodes,0),e,i),i.stop=!1}}var r=function(){},o=window.requestAnimationFrame||window.webkitRequestAnimationFrame||setTimeout,a=new(i(2))(1e3),h=["vm","repeat","if"],c=0,u=[].slice;t.exports={slice:u,noop:r,addClass:function(t,e){if(t.classList)t.classList.add(e);else{var i=" "+(t.getAttribute("class")||"")+" ";i.indexOf(" "+e+" ")<0&&t.setAttribute("class",(i+e).trim())}},removeClass:function(t,e){if(t.classList)t.classList.remove(e);else{for(var i=" "+(t.getAttribute("class")||"")+" ",n=" "+e+" ";i.indexOf(n)>=0;)i=i.replace(n," ");t.setAttribute("class",i.trim())}},noexist:function(t,e){throw this.warn(t),new Error("Filter "+e+" hasn't implemented.")},warn:function(){return window.console&&console.error?function(){console.error.apply(console,arguments)}:r}(),isObject:function(t){return"object"==typeof t},nextTick:function(t,e){return e?o(function(){t.call(e)},0):o(t,0)},walk:s}},function(t,e){function i(t){this.size=0,this.limit=t,this.head=this.tail=void 0,this._keymap={}}var n=i.prototype;n.put=function(t,e){var i={key:t,value:e};return this._keymap[t]=i,this.tail?(this.tail.newer=i,i.older=this.tail):this.head=i,this.tail=i,this.size===this.limit?this.shift():void this.size++},n.shift=function(){var t=this.head;return t&&(this.head=this.head.newer,this.head.older=void 0,t.newer=t.older=void 0,this._keymap[t.key]=void 0),t},n.get=function(t,e){var i=this._keymap[t];if(void 0!==i)return i===this.tail?e?i:i.value:(i.newer&&(i===this.head&&(this.head=i.newer),i.newer.older=i.older),i.older&&(i.older.newer=i.newer),i.newer=void 0,i.older=this.tail,this.tail&&(this.tail.newer=i),this.tail=i,e?i:i.value)},t.exports=i},function(t,e,i){var n=i(4);t.exports={find:n.find,contains:n.contains,data:n.data,cleanData:n.cleanData,add:n.event.add,remove:n.event.remove,clone:n.clone,extend:n.extend}},function(e,i){e.exports=t},function(t,e,i){t.exports=function(t){function e(e){return t.contains(h.documentElement,e)}function n(t){this._init(t)}var s=i(8),r=i(9),o=i(7).mergeOptions,a=i(6),h=document;return n._=t,n.options={directives:i(10),filters:{}},n.get=function(e){var i=t.find(e)[0];return i?t.data(i,"QI"):new this({el:e})},n.all=function(e){var i=this;return t.find(e.el).map(function(n){return new i(t.extend(e,{el:n}))})},t.extend(n,a),t.extend(n.prototype,{_init:function(e){e=e||{},this.$el=e.el&&"string"==typeof e.el?t.find(e.el)[0]:e.el,this.$$={},this.$parent=e._parent,e=this.$options=o(this.constructor.options,e,this),this._isCompiled=!1,this._isAttached=!1,this._isReady=!1,this._events={},this._watchers={},this._children=[],this.$={},s.call(this,e),this._initScope(),this._callHook("created"),this.$el&&(t.data(this.$el,"QI",this),this.$mount(this.$el))},data:function(t,e){if(void 0===t)return this;var i,n=0,s=this;if(~t.indexOf(".")){var r=t.split(".");for(i=r.length;i-1>n;n++){if(t=r[n],+t+""===t&&(t=+t),!(t in s))return void 0;s=s[t]}}return i&&(t=r[n]),void 0===e?t?s[t]:s:void s.$set(t,e)},$on:function(t,e){return(this._events[t]||(this._events[t]=[])).push(e),this},$once:function(t,e){function i(){n.$off(t,i),e.apply(this,arguments)}var n=this;return i.fn=e,this.$on(t,i),this},$off:function(t,e){var i,n,s;if(!arguments.length)return this._events={},this;if(i=this._events[t],!i)return this;if(1===arguments.length)return this._events[t]=null,this;for(s=i.length;s--;)if(n=i[s],n===e||n.fn===e){i.splice(s,1);break}return this},$watch:function(t,e,i,n){var s=i?t+"**deep**":t;return(this._watchers[s]||(this._watchers[s]=[])).push(e),n&&e(this.data(t)),this},$emit:function(e){var i=t.slice.call(arguments,1);return r.emit.call(this,e,t.slice.call(i,0)),0===e.indexOf("data:")&&(e=e.substring(5),r.callDataChange.call(this,e,t.slice.call(i,0)),i.unshift(e),r.emit.call(this,"datachange",i)),this},_initScope:function(){this._initMethods()},_initMethods:function(){var t,e=this.$options.methods;if(e)for(t in e)this[t]=e[t].bind(this)},$mount:function(i){return this._isCompiled?t.warn("$mount() should be called only once"):(this._compile(i),this._isCompiled=!0,this._callHook("compiled"),void(e(this.$el)?(this._callHook("attached"),this._ready()):this.$once("hook:attached",this._ready)))},_ready:function(){this._isAttached=!0,this._isReady=!0,this._callHook("ready")},_compile:function(t){this.transclue(t,this.$options)},transclue:function(e,i){t.find(".q-mark",e).length?this._renderedBind(e,i):this._templateBind(e,i)},_templateBind:i(12),_renderedBind:function(t,e){},_callHook:function(t){var e=this.$options[t];if(e)for(var i=0,n=e.length;n>i;i++)e[i].call(this);this.$emit("hook:"+t)},_makeReadFilters:function(e){if(!e.length)return[];var i=this.$options.filters,n=this;return e.map(function(e){e=[].concat(e);var s=e.shift(),r=i[s]?i[s].read||i[s]:t.noexist(n,s);return function(t,i){return e?r.apply(n,[t].concat(e.push(i)&&e)):r.call(n,t,i)}})},applyFilters:function(t,e,i){if(!e||!e.length)return t;for(var n=0,s=e.length;s>n;n++)t=e[n].call(this,t,i);return t}}),t.extend(n.prototype,s.prototype),n}},function(t,e,i){function n(t,e){if(h[t])return!1;var i=h[t]=this.extend(e||{});return i}function s(t,e){return h[t]||this}function r(t){function e(){}return e.prototype=t,new e}function o(t){t=t||{};var e=this,i=a(t.name||"QComponent");return i.prototype=r(e.prototype),i.prototype.constructor=i,i.options=c(e.options,t),i["super"]=e,["extend","get","all","require","define"].forEach(function(t){i[t]=e[t]}),i}function a(t){return new Function("return function "+t+" (options) { this._init(options) }")()}var h={},c=i(7).mergeOptions;t.exports={define:n,require:s,extend:o}},function(t,e,i){function n(t,e,i){function n(n){var s=r[n]||o;a[n]=s(t[n],e[n],i,n)}var s,a={};for(s in t)n(s);for(s in e)t.hasOwnProperty(s)||n(s);return a}var s=i(1),r={};r.created=r.ready=r.attached=r.detached=r.compiled=r.beforeDestroy=r.destroyed=r.paramAttributes=function(t,e){return e?t?t.concat(e):Array.isArray(e)?e:[e]:t},r.filters=r.methods=r.directives=function(t,e){return e?t?s.extend({},t,e):e:t};var o=function(t,e){return void 0===e?t:e};t.exports={strats:r,mergeOptions:n}},function(t,e,i){function n(t,e,i){var n={data:i,up:t,top:t._top,namespace:e+""};t[e]="object"==typeof i&&null!==i?s(i)?new a(n):new o(n):i,~t._keys.indexOf(e)||t._keys.push(e)}function s(t){return Array.isArray(t)||t instanceof a}function r(t){return t.filter(function(t){return"number"==typeof t}).length}function o(t){var e=t.data,i=Object.keys(t.data||{}).filter(function(t){return 0!==t.indexOf("_")}).map(function(t){return+t+""===t?+t:t}),s=this;h.extend(this,e),this._keys=i,this._up=t.up,this._top=t.top||this,this._namespace=t.namespace||"",i.forEach(function(t){n(s,t,e[t])}),(Array.isArray(e)||e instanceof a)&&(this.length=r(i))}function a(t){o.call(this,t)}var h=i(1);h.extend(o.prototype,{$namespace:function(t){for(var e=[],i=this;void 0!=i;i=i._up)i._namespace&&e.unshift(i._namespace);return t&&e.push(t),e.join(".")},$key:function(){var t=this._namespace;return+t+""===t?+t:t},$up:function(){return this._up},$set:function(t,e){if("object"==typeof t){var i=this;Object.keys(t).forEach(function(e){i.$set(e,t[e])})}else{var s=this[t];n(this,t,e),this.$change(this.$namespace(t),this[t],s)}return this},$get:function(){var t,e=this._keys,i=this;return t=this instanceof o?{}:[],e.forEach(function(e){t[e]=i[e].$get?i[e].$get():i[e]}),t},$change:function(t,e,i,n){this._top.$emit&&this._top.$emit("data:"+t,e,i,n)}}),h.extend(a.prototype,o.prototype,{push:function(t){t=h.slice.call(arguments,0);for(var e=[],i=0,s=t.length;s>i;i++)n(this,this.length,t[i]),this._keys.push(this.length),e.push(this[this.length]),this.length++;return this.$change(this.$namespace(),this,null,{method:"push",res:e,args:t}),this},pop:function(){var t=this[--this.length];return delete this[this.length],this._keys.pop(),this.$change(this.$namespace(),this),t},unshift:function(t){this._keys.push(this.length),this.length++;for(var e=this.length;e--;)this[e]=this[e-1],"object"==typeof this[e]&&(this[e]._namespace=e+"");return n(this,0,t),this.$change(this.$namespace(),this),this},shift:function(){this.length--;for(var t=this[0],e=0,i=this.length;i>e;e++)this[e]=this[e+1],"object"==typeof this[e]&&(this[e]._namespace=e+"");return this._keys.pop(),delete this[this.length],this.$change(this.$namespace(),this),t},touch:function(t){this.$change(this.$namespace(t),this)},indexOf:function(t){if(t._up===this){var e=+t._namespace;if(this[e]===t)return e}else if("object"!=typeof t)for(var e=0,i=this.length;i>e;e++)if(this[e]===t)return e;return-1},splice:function(t,e){for(var i={method:"splice",args:[t,e]},n=0,s=e+t,r=this.length-e;r>t;t++,n++)this[t]=this[s+n],"object"==typeof this[t]&&(this[t]._namespace=t+"");for(;te;e++)t(this[e],e)},filter:function(t){var e=[];return this.forEach(function(i,n){t(i)&&e.push(i)}),e}}),t.exports=o},function(t,e,i){function n(t,e,i){i=i||this;var s=this._events[t];if(s){var o=0;s=s.length>1?r.slice.call(s,0):s;for(var a=s.length;a>o;o++)s[o].apply(i,e)}t.indexOf("data:")&&t.indexOf("hook:")&&this.$parent&&n.call(this.$parent,t,e,i)}function s(t,e){var i,s,o=t.split("."),a={_events:this._watchers};for(n.call(a,t,e);o.length>0;)t=o.join("."),i=t+"**deep**",s=r.slice.call(e,0,1),s[0]=this.data(t),n.call(a,i,s),o.pop();n.call(a,"**deep**",[this])}var r=(i(8),i(1));t.exports={emit:n,callDataChange:s}},function(t,e,i){function n(t,e,i){~e.indexOf(".")?(e=o.exec(e),t.data(e[1]).$set(e[2],i)):t.$set(e,i)}var s=i(1),r=i(7),o=/^(.*)\.([\w\-]+)$/;t.exports={show:function(t){var e=this.el;e.style.display=t?"block":"none"},"class":function(t){var e=this.el,i=this.arg;i?t?s.addClass(e,i):s.removeClass(e,i):(this.lastVal&&s.removeClass(e,this.lastVal),t&&(s.addClass(e,t),this.lastVal=t))},value:function(t){var e=this.el;"checkbox"===e.type?e.checked=t:e.value=t},attr:function(t){if(void 0!==t){var e=this.arg,i=this.el;if("style"===e)if("object"==typeof t)for(var n in t)t.hasOwnProperty(n)&&(i.style[n]=t[n]);else i.setAttribute(e,t);else e in i?i[e]=t:i.setAttribute(e,t)}},text:function(t){void 0!==t&&(this.el.textContent=null==t?"":t.toString())},html:function(t){this.el.innerHTML=t&&t.toString()||""},on:{bind:function(){var t=this,e=this.target,i=this.param,n=this.filters,r=this.vm,o=r.applyFilters(this.vm[e],n),a=i&&~i.indexOf("this")&&t.data();s.add(this.el,this.arg,function(t){if(!o||"function"!=typeof o)return s.warn("You need implement the "+e+" method.");var n=[];i?i.forEach(function(e){"e"===e?n.push(t):"this"===e&&n.push(a)}):n.push(t),o.apply(r,n)})}},model:{bind:function(){var t=this.target,e=this.namespace||"",i=this.el,n=this.vm,r=n.data(e),o=!1;s.add(i,"input propertychange change",function(e){o||r.$set(t,i.value)},n),s.add(i,"compositionstart",function(t){o=!0}),s.add(i,"compositionend",function(t){o=!1})},update:function(t){this.el.value=t}},vm:{bind:function(){this.el.removeAttribute("q-vm"),this.setting.stop=!0;var t,e,i=this.target,s=this.vm,o=this.el,a=o.getAttribute("q-ref")||!1,h=o.getAttribute("q-with")||"",c=o.getAttribute("q-extend"),u=this.namespace,l=u?[u,h].join("."):h,f=s.data(l),p=s.constructor.require(i),d=p.options.data;if(d&&Object.keys(d).forEach(function(t){t in f||f.$set(t,d[t])}),t={el:o,data:f.$get(),_parent:s},c&&(c=s.$options.extend[c])){if(c.data||c.el||c._parent)throw new Error("Extend Error");t=r.mergeOptions(t,c)}e=new p(t),s._children.push(e),a&&!function(){var t=s.$[a];t?t.length?t.push(e):s.$[a]=[t,e]:s.$[a]=e}();var m=!1,v=!1;s.$on("datachange",function(t,i,r,o){if(this===e)if(m)m=!1;else{v=!0;var a=l?[l,t].join("."):t;o?s[a][o.method].apply(s[a],o.args):n(s,a,i)}else if(this===s)if(v)v=!1;else if(!l||~t.indexOf(l)){m=!0;var h,c=l.length;c&&(c+=1),h=t.substring(c,t.length),o?e[h][o.method].apply(e[h],o.args):n(e,h,i)}})}},"if":{bind:function(){if(this.el.parentNode){var t=this.el,e=t.parentNode,i=document.createComment("q-if"),n=!1,s=!0,r=this.target,o=this.namespace,a=o?[o,r].join("."):r,h=this.filters,c=this.data(),u=this.vm;this.setting.stop=!0,u.$watch(a,function(r,a){r=u.applyFilters(r,h,a),n||r!==!0||(n=!0,u._templateBind(t,{data:c,namespace:o,immediate:!0})),r!==s&&(r===!0?(e.replaceChild(t,i),s=r):r===!1&&(e.replaceChild(i,t),s=r))},!1,!0)}}},el:{bind:function(){this.vm.$$[this.target]=this.el}},repeat:i(11)}},function(t,e,i){function n(t,e,i,n){var s,r,o,a,h=e.length;Object.keys(t).forEach(function(c){~c.indexOf(e)&&(s=c.substring(h+1),r=s.split("."),r.length&&(o=+r.shift(),(o-=n)>=i&&(r.unshift(o),r.unshift(e),a=r.join("."),t[a]=t[c],delete t[c])))})}var s=i(1);methods={"default":{clean:function(t,e){e.length&&(e.forEach(function(e){e.parentNode===t&&t.removeChild(e)}),s.cleanData(e),e.length=0)},insert:function(t,e,i){t.insertBefore(e,i)}},push:{insert:function(t,e,i){t.insertBefore(e,i)},dp:function(t,e){return e.res}},splice:{clean:function(t,e,i,s){var r=i[0],o=i[1],a=i[2].$namespace(),h=e.splice(r,o);return h.forEach(function(e){t.removeChild(e)}),i.done||(n(s,a,r,o),i.done=!0),!0},dp:function(t,e){return e.args.push(t),e.args}}},e.bind=function(){var t,e,i,n,r,o,a,h=this.el,c=this.setting,u=h.parentNode;u&&!c.stop&&(c.stop=!0,t=this.target,e=this.namespace,i=e?[e,t].join("."):t,n=this.filters,r=[],o=document.createComment("q-repeat"),a=this.vm,u.replaceChild(o,h),a.$watch(i,function(t,e,c){if(t=a.applyFilters(t,n),void 0!==t){var l=!n.length&&c?c.method:"default",f=(methods[l]||{}).dp,p=(methods[l]||{}).clean,d=(methods[l]||{}).insert;if(f&&(t=f(t,c)),!p||p(u,r,t,a._watchers,i)!==!0){var m,v=document.createDocumentFragment();t.forEach(function(t,e){m=s.clone(h),a._templateBind(m,{data:t,namespace:t.$namespace(),immediate:!0,useCache:!0}),r.push(m),v.appendChild(m)}),d&&d(u,v,o),a.$emit("repeat-render")}}},!1,!0))}},function(t,e,i){var n=i(13),s=i(1);t.exports=function(t,e){e=e||{};var i=this,r=i.$options.directives,o=(e.index,e.data||i,e.namespace);s.walk([t],function(t,a,h){a.forEach(function(a){var c=a.name.substring(2),u=r[c],l=n(a.value);u&&l.forEach(function(n){var r=i._makeReadFilters(n.filters),a=n.target,c=o?[o,a].join("."):a,l=s.isObject(u)?u.update:u,f=s.extend({el:t,vm:i,data:function(t){var e=[];return o&&e.push(o),t&&e.push(t),i.data(e.join("."))},namespace:o,setting:h},n,{filters:r}),p=f.data(a);l&&i.$watch(c,function(t,e){t=i.applyFilters(t,r,e),l.call(f,t,e)},"object"==typeof p,"boolean"==typeof e.immediate?e.immediate:void 0!==p),s.isObject(u)&&u.bind&&u.bind.call(f)})})},{useCache:e.useCache})}},function(t,e,i){function n(t){var e=t,i=r.get(e);if(i)return i;for(var n,h,c,u=[],l=o.length,f=!1,p={filter:!1,token:{filters:[]}};t.length;){for(h=0;l>h;h++)if(n=o[h][0].exec(t)){f=!0,c=o[h][1],c&&c(n,p,u),t=t.replace(o[h][0],""),p.filter&&(n=a.exec(t),s(n[0].trim(),p.token),t=t.replace(a,""),p.filter=!1);break}if(!f)throw new Error("Syntax error at: "+t);f=!1}return u.push(p.token),r.put(e,u),u}function s(t,e){for(var i,n=h.length,s=!1;t.length;){for(i=0;n>i;i++)if(captures=h[i][0].exec(t)){s=!0,foo=h[i][1],foo&&foo(captures,e.filters),t=t.replace(h[i][0],"");break}if(!s)throw new Error("Syntax error at: "+t);s=!1}}var r=new(i(2))(1e3),o=[[/^ +/],[/^([\w\-]+):/,function(t,e){e.token.arg=t[1]}],[/^([\w]+)\((.+?)\)/,function(t,e){e.token.target=t[1],e.token.param=t[2].split(/ *, */)}],[/^([\w\-\.]+)/,function(t,e){e.token.target=t[1]}],[/^(?=\|)/,function(t,e){e.filter=!0}],[/^,/,function(t,e,i){i.push(e.token),e.token={filters:[]}}]],a=/^(.+?)(?=,|$)/,h=[[/^ +/],[/^\| *([\w\-\!]+)/,function(t,e){e.push([t[1]])}],[/^(['"])(((\\['"])?([^\1])*)+)\1/,function(t,e){e[e.length-1].push(t[3])}],[/^([\w\-]+)/,function(t,e){e[e.length-1].push(t[1])}]];t.exports=n}])}); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?exports.Q=e(require("jquery")):t.Q=e(t.jQuery)}(this,function(t){return function(t){function e(n){if(i[n])return i[n].exports;var s=i[n]={exports:{},id:n,loaded:!1};return t[n].call(s.exports,s,s.exports,e),s.loaded=!0,s.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){var n=i(1),s=i(3),r=i(5);s.extend(n,s),t.exports=r(n)},function(t,e,i){function n(t,e,i){for(var n,s=0,r=h.length;r>s;s++)if(n="q-"+h[s],t.hasAttribute(n))return e.push({name:n,value:t.getAttribute(n)}),t.removeAttribute(n),!0}function s(t,e,i){var r,o,h,l,f,p,d;for(r=0;l=t[r++];){if(1===l.nodeType){if(f=l.attributes,p=[],!n(l,p,i)){for(o=0,h=f.length;h>o;o++)0===f[o].name.indexOf("q-")&&p.push({name:f[o].name,value:f[o].value});i.useCache&&!d&&(d=d||++c,l.setAttribute("qtid",d),a.put(d,p))}p.length>0&&e(l,p,i)}l.childNodes.length&&!i.stop&&s(u.call(l.childNodes,0),e,i),i.stop=!1}}var r=function(){},o=window.requestAnimationFrame||window.webkitRequestAnimationFrame||setTimeout,a=new(i(2))(1e3),h=["vm","repeat","if"],c=0,u=[].slice;t.exports={slice:u,noop:r,addClass:function(t,e){if(t.classList)t.classList.add(e);else{var i=" "+(t.getAttribute("class")||"")+" ";i.indexOf(" "+e+" ")<0&&t.setAttribute("class",(i+e).trim())}},removeClass:function(t,e){if(t.classList)t.classList.remove(e);else{for(var i=" "+(t.getAttribute("class")||"")+" ",n=" "+e+" ";i.indexOf(n)>=0;)i=i.replace(n," ");t.setAttribute("class",i.trim())}},noexist:function(t,e){throw this.warn(t),new Error("Filter "+e+" hasn't implemented.")},warn:function(){return window.console&&console.error?function(){console.error.apply(console,arguments)}:r}(),isObject:function(t){return"object"==typeof t},nextTick:function(t,e){return e?o(function(){t.call(e)},0):o(t,0)},walk:s}},function(t,e,i){function n(t){this.size=0,this.limit=t,this.head=this.tail=void 0,this._keymap={}}var s=n.prototype;s.put=function(t,e){var i={key:t,value:e};return this._keymap[t]=i,this.tail?(this.tail.newer=i,i.older=this.tail):this.head=i,this.tail=i,this.size===this.limit?this.shift():void this.size++},s.shift=function(){var t=this.head;return t&&(this.head=this.head.newer,this.head.older=void 0,t.newer=t.older=void 0,this._keymap[t.key]=void 0),t},s.get=function(t,e){var i=this._keymap[t];if(void 0!==i)return i===this.tail?e?i:i.value:(i.newer&&(i===this.head&&(this.head=i.newer),i.newer.older=i.older),i.older&&(i.older.newer=i.newer),i.newer=void 0,i.older=this.tail,this.tail&&(this.tail.newer=i),this.tail=i,e?i:i.value)},t.exports=n},function(t,e,i){var n=i(4);t.exports={find:n.find,contains:n.contains,data:n.data,cleanData:n.cleanData,add:n.event.add,remove:n.event.remove,clone:n.clone,extend:n.extend}},function(e,i,n){e.exports=t},function(t,e,i){t.exports=function(t){function e(e){return t.contains(h.documentElement,e)}function n(t){this._init(t)}var s=i(8),r=i(9),o=i(7).mergeOptions,a=i(6),h=document;return n._=t,n.options={directives:i(10),filters:{}},n.get=function(e){var i=t.find(e)[0];return i?t.data(i,"QI"):new this({el:e})},n.all=function(e){var i=this;return t.find(e.el).map(function(n){return new i(t.extend(e,{el:n}))})},t.extend(n,a),t.extend(n.prototype,{_init:function(e){e=e||{},this.$el=e.el&&"string"==typeof e.el?t.find(e.el)[0]:e.el,this.$$={},this.$parent=e._parent,e=this.$options=o(this.constructor.options,e,this),this._isCompiled=!1,this._isAttached=!1,this._isReady=!1,this._events={},this._watchers={},this._children=[],this.$={},s.call(this,e),this._initScope(),this._callHook("created"),this.$el&&(t.data(this.$el,"QI",this),this.$mount(this.$el))},data:function(t,e){if(void 0===t)return this;var i,n=0,s=this;if(~t.indexOf(".")){var r=t.split(".");for(i=r.length;i-1>n;n++){if(t=r[n],+t+""===t&&(t=+t),!(t in s))return void 0;s=s[t]}}return i&&(t=r[n]),void 0===e?t?s[t]:s:void s.$set(t,e)},$on:function(t,e){return(this._events[t]||(this._events[t]=[])).push(e),this},$once:function(t,e){function i(){n.$off(t,i),e.apply(this,arguments)}var n=this;return i.fn=e,this.$on(t,i),this},$off:function(t,e){var i,n,s;if(!arguments.length)return this._events={},this;if(i=this._events[t],!i)return this;if(1===arguments.length)return this._events[t]=null,this;for(s=i.length;s--;)if(n=i[s],n===e||n.fn===e){i.splice(s,1);break}return this},$watch:function(t,e,i,n){var s=i?t+"**deep**":t;return(this._watchers[s]||(this._watchers[s]=[])).push(e),n&&e(this.data(t)),this},$emit:function(e){var i=t.slice.call(arguments,1);return r.emit.call(this,e,t.slice.call(i,0)),0===e.indexOf("data:")&&(e=e.substring(5),r.callDataChange.call(this,e,t.slice.call(i,0)),i.unshift(e),r.emit.call(this,"datachange",i)),this},_initScope:function(){this._initMethods()},_initMethods:function(){var t,e=this.$options.methods;if(e)for(t in e)this[t]=e[t].bind(this)},$mount:function(i){return this._isCompiled?t.warn("$mount() should be called only once"):(this._compile(i),this._isCompiled=!0,this._callHook("compiled"),void(e(this.$el)?(this._callHook("attached"),this._ready()):this.$once("hook:attached",this._ready)))},_ready:function(){this._isAttached=!0,this._isReady=!0,this._callHook("ready")},_compile:function(t){this.transclue(t,this.$options)},transclue:function(e,i){t.find(".q-mark",e).length?this._renderedBind(e,i):this._templateBind(e,i)},_templateBind:i(12),_renderedBind:function(t,e){},_callHook:function(t){var e=this.$options[t];if(e)for(var i=0,n=e.length;n>i;i++)e[i].call(this);this.$emit("hook:"+t)},_makeReadFilters:function(e){if(!e.length)return[];var i=this.$options.filters,n=this;return e.map(function(e){e=[].concat(e);var s=e.shift(),r=i[s]?i[s].read||i[s]:t.noexist(n,s);return function(t,i){return e?r.apply(n,[t].concat(e.push(i)&&e)):r.call(n,t,i)}})},applyFilters:function(t,e,i){if(!e||!e.length)return t;for(var n=0,s=e.length;s>n;n++)t=e[n].call(this,t,i);return t}}),t.extend(n.prototype,s.prototype),n}},function(t,e,i){function n(t,e){if(h[t])return!1;var i=h[t]=this.extend(e||{});return i}function s(t,e){return h[t]||this}function r(t){function e(){}return e.prototype=t,new e}function o(t){t=t||{};var e=this,i=a(t.name||"QComponent");return i.prototype=r(e.prototype),i.prototype.constructor=i,i.options=c(e.options,t),i["super"]=e,["extend","get","all","require","define"].forEach(function(t){i[t]=e[t]}),i}function a(t){return new Function("return function "+t+" (options) { this._init(options) }")()}var h={},c=i(7).mergeOptions;t.exports={define:n,require:s,extend:o}},function(t,e,i){function n(t,e,i){function n(n){var s=r[n]||o;a[n]=s(t[n],e[n],i,n)}var s,a={};for(s in t)n(s);for(s in e)t.hasOwnProperty(s)||n(s);return a}var s=i(1),r={};r.created=r.ready=r.attached=r.detached=r.compiled=r.beforeDestroy=r.destroyed=r.paramAttributes=function(t,e){return e?t?t.concat(e):Array.isArray(e)?e:[e]:t},r.filters=r.methods=r.directives=function(t,e){return e?t?s.extend({},t,e):e:t};var o=function(t,e){return void 0===e?t:e};t.exports={strats:r,mergeOptions:n}},function(t,e,i){function n(t,e,i){var n={data:i,up:t,top:t._top,namespace:e+""};t[e]="object"==typeof i&&null!==i?s(i)?new a(n):new o(n):i,~t._keys.indexOf(e)||t._keys.push(e)}function s(t){return Array.isArray(t)||t instanceof a}function r(t){return t.filter(function(t){return"number"==typeof t}).length}function o(t){var e=t.data,i=Object.keys(t.data||{}).filter(function(t){return 0!==t.indexOf("_")}).map(function(t){return+t+""===t?+t:t}),s=this;h.extend(this,e),this._keys=i,this._up=t.up,this._top=t.top||this,this._namespace=t.namespace||"",i.forEach(function(t){n(s,t,e[t])}),(Array.isArray(e)||e instanceof a)&&(this.length=r(i))}function a(t){o.call(this,t)}var h=i(1);h.extend(o.prototype,{$namespace:function(t){for(var e=[],i=this;void 0!=i;i=i._up)i._namespace&&e.unshift(i._namespace);return t&&e.push(t),e.join(".")},$key:function(){var t=this._namespace;return+t+""===t?+t:t},$up:function(){return this._up},$set:function(t,e){if("object"==typeof t){var i=this;Object.keys(t).forEach(function(e){i.$set(e,t[e])})}else{var s=this[t];n(this,t,e),this.$change(this.$namespace(t),this[t],s)}return this},$get:function(){var t,e=this._keys,i=this;return t=this instanceof o?{}:[],e.forEach(function(e){t[e]=i[e].$get?i[e].$get():i[e]}),t},$change:function(t,e,i,n){this._top.$emit&&this._top.$emit("data:"+t,e,i,n)}}),h.extend(a.prototype,o.prototype,{push:function(t){t=h.slice.call(arguments,0);for(var e=[],i=0,s=t.length;s>i;i++)n(this,this.length,t[i]),this._keys.push(this.length),e.push(this[this.length]),this.length++;return this.$change(this.$namespace(),this,null,{method:"push",res:e,args:t}),this},pop:function(){var t=this[--this.length];return delete this[this.length],this._keys.pop(),this.$change(this.$namespace(),this),t},unshift:function(t){this._keys.push(this.length),this.length++;for(var e=this.length;e--;)this[e]=this[e-1],"object"==typeof this[e]&&(this[e]._namespace=e+"");return n(this,0,t),this.$change(this.$namespace(),this),this},shift:function(){this.length--;for(var t=this[0],e=0,i=this.length;i>e;e++)this[e]=this[e+1],"object"==typeof this[e]&&(this[e]._namespace=e+"");return this._keys.pop(),delete this[this.length],this.$change(this.$namespace(),this),t},touch:function(t){this.$change(this.$namespace(t),this)},indexOf:function(t){if(t._up===this){var e=+t._namespace;if(this[e]===t)return e}else if("object"!=typeof t)for(var e=0,i=this.length;i>e;e++)if(this[e]===t)return e;return-1},splice:function(t,e){for(var i={method:"splice",args:[t,e]},n=0,s=e+t,r=this.length-e;r>t;t++,n++)this[t]=this[s+n],"object"==typeof this[t]&&(this[t]._namespace=t+"");for(;te;e++)t(this[e],e)},filter:function(t){var e=[];return this.forEach(function(i,n){t(i)&&e.push(i)}),e}}),t.exports=o},function(t,e,i){function n(t,e,i){i=i||this;var s=this._events[t];if(s){var o=0;s=s.length>1?r.slice.call(s,0):s;for(var a=s.length;a>o;o++)s[o].apply(i,e)}t.indexOf("data:")&&t.indexOf("hook:")&&this.$parent&&n.call(this.$parent,t,e,i)}function s(t,e){var i,s,o=t.split("."),a={_events:this._watchers};for(n.call(a,t,e);o.length>0;)t=o.join("."),i=t+"**deep**",s=r.slice.call(e,0,1),s[0]=this.data(t),n.call(a,i,s),o.pop();n.call(a,"**deep**",[this])}var r=(i(8),i(1));t.exports={emit:n,callDataChange:s}},function(t,e,i){function n(t,e,i){~e.indexOf(".")?(e=o.exec(e),t.data(e[1]).$set(e[2],i)):t.$set(e,i)}var s=i(1),r=i(7),o=/^(.*)\.([\w\-]+)$/;t.exports={show:function(t){var e=this.el;e.style.display=t?"block":"none"},"class":function(t){var e=this.el,i=this.arg;i?t?s.addClass(e,i):s.removeClass(e,i):(this.lastVal&&s.removeClass(e,this.lastVal),t&&(s.addClass(e,t),this.lastVal=t))},value:function(t){var e=this.el;"checkbox"===e.type?e.checked=t:e.value=t},attr:function(t){if(void 0!==t){var e=this.arg,i=this.el;if("style"===e)if("object"==typeof t)for(var n in t)t.hasOwnProperty(n)&&(i.style[n]=t[n]);else i.setAttribute(e,t);else e in i?i[e]=t:i.setAttribute(e,t)}},text:function(t){void 0!==t&&(this.el.textContent=null==t?"":t.toString())},html:function(t){this.el.innerHTML=t&&t.toString()||""},on:{bind:function(){var t=this,e=this.target,i=this.param,n=this.filters,r=this.vm,o=r.applyFilters(this.vm[e],n),a=i&&~i.indexOf("this")&&t.data();s.add(this.el,this.arg,function(t){if(!o||"function"!=typeof o)return s.warn("You need implement the "+e+" method.");var n=[];i?i.forEach(function(e){"e"===e?n.push(t):"this"===e&&n.push(a)}):n.push(t),o.apply(r,n)})}},model:{bind:function(){var t=this.target,e=this.namespace||"",i=this.el,n=this.vm,r=n.data(e),o=!1;s.add(i,"input propertychange change",function(e){o||r.$set(t,i.value)},n),s.add(i,"compositionstart",function(t){o=!0}),s.add(i,"compositionend",function(t){o=!1})},update:function(t){this.el.value=t}},vm:{bind:function(){this.el.removeAttribute("q-vm"),this.setting.stop=!0;var t,e,i=this.target,s=this.vm,o=this.el,a=o.getAttribute("q-ref")||!1,h=o.getAttribute("q-with")||"",c=o.getAttribute("q-extend"),u=this.namespace,l=u?[u,h].join("."):h,f=s.data(l),p=s.constructor.require(i),d=p.options.data;if(d&&Object.keys(d).forEach(function(t){t in f||f.$set(t,d[t])}),t={el:o,data:f.$get(),_parent:s},c&&(c=s.$options.extend[c])){if(c.data||c.el||c._parent)throw new Error("Extend Error");t=r.mergeOptions(t,c)}e=new p(t),s._children.push(e),a&&!function(){var t=s.$[a];t?t.length?t.push(e):s.$[a]=[t,e]:s.$[a]=e}();var m=!1,v=!1;s.$on("datachange",function(t,i,r,o){if(this===e)if(m)m=!1;else{v=!0;var a=l?[l,t].join("."):t;o?s[a][o.method].apply(s[a],o.args):n(s,a,i)}else if(this===s)if(v)v=!1;else if(!l||!t.indexOf(l)){m=!0;var h,c=l.length;c&&(c+=1),h=t.substring(c,t.length),o?e[h][o.method].apply(e[h],o.args):n(e,h,i)}})}},"if":{bind:function(){if(this.el.parentNode){var t=this.el,e=t.parentNode,i=document.createComment("q-if"),n=!1,s=!0,r=this.target,o=this.namespace,a=o?[o,r].join("."):r,h=this.filters,c=this.data(),u=this.vm;this.setting.stop=!0,u.$watch(a,function(r,a){r=u.applyFilters(r,h,a),n||r!==!0||(n=!0,u._templateBind(t,{data:c,namespace:o,immediate:!0})),r!==s&&(r===!0?(e.replaceChild(t,i),s=r):r===!1&&(e.replaceChild(i,t),s=r))},!1,!0)}}},el:{bind:function(){this.vm.$$[this.target]=this.el}},repeat:i(11)}},function(t,e,i){function n(t,e,i,n){var s,r,o,a,h=e.length;Object.keys(t).forEach(function(c){~c.indexOf(e)&&(s=c.substring(h+1),r=s.split("."),r.length&&(o=+r.shift(),(o-=n)>=i&&(r.unshift(o),r.unshift(e),a=r.join("."),t[a]=t[c],delete t[c])))})}var s=i(1);methods={"default":{clean:function(t,e){e.length&&(e.forEach(function(e){e.parentNode===t&&t.removeChild(e)}),s.cleanData(e),e.length=0)},insert:function(t,e,i){t.insertBefore(e,i)}},push:{insert:function(t,e,i){t.insertBefore(e,i)},dp:function(t,e){return e.res}},splice:{clean:function(t,e,i,s){var r=i[0],o=i[1],a=i[2].$namespace(),h=e.splice(r,o);return h.forEach(function(e){t.removeChild(e)}),i.done||(n(s,a,r,o),i.done=!0),!0},dp:function(t,e){return e.args.push(t),e.args}}},e.bind=function(){var t,e,i,n,r,o,a,h=this.el,c=this.setting,u=h.parentNode;u&&!c.stop&&(c.stop=!0,t=this.target,e=this.namespace,i=e?[e,t].join("."):t,n=this.filters,r=[],o=document.createComment("q-repeat"),a=this.vm,u.replaceChild(o,h),a.$watch(i,function(t,e,c){if(t=a.applyFilters(t,n),void 0!==t){var l=!n.length&&c?c.method:"default",f=(methods[l]||{}).dp,p=(methods[l]||{}).clean,d=(methods[l]||{}).insert;if(f&&(t=f(t,c)),!p||p(u,r,t,a._watchers,i)!==!0){var m,v=document.createDocumentFragment();t.forEach(function(t,e){m=s.clone(h),a._templateBind(m,{data:t,namespace:t.$namespace(),immediate:!0,useCache:!0}),r.push(m),v.appendChild(m)}),d&&d(u,v,o),a.$emit("repeat-render")}}},!1,!0))}},function(t,e,i){var n=i(13),s=i(1);t.exports=function(t,e){e=e||{};var i=this,r=i.$options.directives,o=(e.index,e.data||i,e.namespace);s.walk([t],function(t,a,h){a.forEach(function(a){var c=a.name.substring(2),u=r[c],l=n(a.value);u&&l.forEach(function(n){var r=i._makeReadFilters(n.filters),a=n.target,c=o?[o,a].join("."):a,l=s.isObject(u)?u.update:u,f=s.extend({el:t,vm:i,data:function(t){var e=[];return o&&e.push(o),t&&e.push(t),i.data(e.join("."))},namespace:o,setting:h},n,{filters:r}),p=f.data(a);l&&i.$watch(c,function(t,e){t=i.applyFilters(t,r,e),l.call(f,t,e)},"object"==typeof p,"boolean"==typeof e.immediate?e.immediate:void 0!==p),s.isObject(u)&&u.bind&&u.bind.call(f)})})},{useCache:e.useCache})}},function(t,e,i){function n(t){var e=t,i=r.get(e);if(i)return i;for(var n,h,c,u=[],l=o.length,f=!1,p={filter:!1,token:{filters:[]}};t.length;){for(h=0;l>h;h++)if(n=o[h][0].exec(t)){f=!0,c=o[h][1],c&&c(n,p,u),t=t.replace(o[h][0],""),p.filter&&(n=a.exec(t),s(n[0].trim(),p.token),t=t.replace(a,""),p.filter=!1);break}if(!f)throw new Error("Syntax error at: "+t);f=!1}return u.push(p.token),r.put(e,u),u}function s(t,e){for(var i,n=h.length,s=!1;t.length;){for(i=0;n>i;i++)if(captures=h[i][0].exec(t)){s=!0,foo=h[i][1],foo&&foo(captures,e.filters),t=t.replace(h[i][0],"");break}if(!s)throw new Error("Syntax error at: "+t);s=!1}}var r=new(i(2))(1e3),o=[[/^ +/],[/^([\w\-]+):/,function(t,e){e.token.arg=t[1]}],[/^([\w]+)\((.+?)\)/,function(t,e){e.token.target=t[1],e.token.param=t[2].split(/ *, */)}],[/^([\w\-\.]+)/,function(t,e){e.token.target=t[1]}],[/^(?=\|)/,function(t,e){e.filter=!0}],[/^,/,function(t,e,i){i.push(e.token),e.token={filters:[]}}]],a=/^(.+?)(?=,|$)/,h=[[/^ +/],[/^\| *([\w\-\!]+)/,function(t,e){e.push([t[1]])}],[/^(['"])(((\\['"])?([^\1])*)+)\1/,function(t,e){e[e.length-1].push(t[3])}],[/^([\w\-]+)/,function(t,e){e[e.length-1].push(t[1])}]];t.exports=n}])}); \ No newline at end of file diff --git a/dist/Q.native.min.js b/dist/Q.native.min.js index 7bc8a74..f679b05 100644 --- a/dist/Q.native.min.js +++ b/dist/Q.native.min.js @@ -1,7 +1,7 @@ /*! - * Q.js v0.5.4 + * Q.js v0.5.5 * Inspired from vue.js * (c) 2015 Daniel Yang * Released under the MIT License. */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):"object"==typeof exports?exports.Q=e():t.Q=e()}(this,function(){return function(t){function e(i){if(n[i])return n[i].exports;var s=n[i]={exports:{},id:i,loaded:!1};return t[i].call(s.exports,s,s.exports,e),s.loaded=!0,s.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){var i=n(1),s=n(3),r=n(4);s.extend(i,s),t.exports=r(i)},function(t,e,n){function i(t,e,n){for(var i,s=0,r=h.length;r>s;s++)if(i="q-"+h[s],t.hasAttribute(i))return e.push({name:i,value:t.getAttribute(i)}),t.removeAttribute(i),!0}function s(t,e,n){var r,o,h,l,f,p,d;for(r=0;l=t[r++];){if(1===l.nodeType){if(f=l.attributes,p=[],!i(l,p,n)){for(o=0,h=f.length;h>o;o++)0===f[o].name.indexOf("q-")&&p.push({name:f[o].name,value:f[o].value});n.useCache&&!d&&(d=d||++c,l.setAttribute("qtid",d),a.put(d,p))}p.length>0&&e(l,p,n)}l.childNodes.length&&!n.stop&&s(u.call(l.childNodes,0),e,n),n.stop=!1}}var r=function(){},o=window.requestAnimationFrame||window.webkitRequestAnimationFrame||setTimeout,a=new(n(2))(1e3),h=["vm","repeat","if"],c=0,u=[].slice;t.exports={slice:u,noop:r,addClass:function(t,e){if(t.classList)t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}},removeClass:function(t,e){if(t.classList)t.classList.remove(e);else{for(var n=" "+(t.getAttribute("class")||"")+" ",i=" "+e+" ";n.indexOf(i)>=0;)n=n.replace(i," ");t.setAttribute("class",n.trim())}},noexist:function(t,e){throw this.warn(t),new Error("Filter "+e+" hasn't implemented.")},warn:function(){return window.console&&console.error?function(){console.error.apply(console,arguments)}:r}(),isObject:function(t){return"object"==typeof t},nextTick:function(t,e){return e?o(function(){t.call(e)},0):o(t,0)},walk:s}},function(t,e){function n(t){this.size=0,this.limit=t,this.head=this.tail=void 0,this._keymap={}}var i=n.prototype;i.put=function(t,e){var n={key:t,value:e};return this._keymap[t]=n,this.tail?(this.tail.newer=n,n.older=this.tail):this.head=n,this.tail=n,this.size===this.limit?this.shift():void this.size++},i.shift=function(){var t=this.head;return t&&(this.head=this.head.newer,this.head.older=void 0,t.newer=t.older=void 0,this._keymap[t.key]=void 0),t},i.get=function(t,e){var n=this._keymap[t];if(void 0!==n)return n===this.tail?e?n:n.value:(n.newer&&(n===this.head&&(this.head=n.newer),n.newer.older=n.older),n.older&&(n.older.newer=n.newer),n.newer=void 0,n.older=this.tail,this.tail&&(this.tail.newer=n),this.tail=n,e?n:n.value)},t.exports=n},function(t,e){function n(t,e){return t!==e&&t.contains(e)}function i(t,e,n){var i=t[a]=t[a]||++h,s=c[i]=c[i]||{};return void 0===n?s[e]:s[e]=n}var s="__cbs__",r={mouseover:!0},o=function(t,e){e=[].splice.call(arguments,1);for(var n,i,s=0,r=e.length;r>s;s++){n=e[s];for(i in n)t[i]=n[i]}return t},a="QDataUid",h=0,c={};t.exports={find:function(t){return this.slice.call(document.querySelectorAll(t),0)},contains:n,data:i,cleanData:function(t){t.forEach(function(t){var e=t[a];e&&e in c&&delete c[e]})},add:function(t,e,o,a){if(!a||r[e])t.addEventListener(e,o);else{var h=a.$el,c=i(h,s);c||(c=[],i(h,s,c),h.addEventListener(e,function(t){var e=t.target;c.forEach(function(i){var s=i.fn,r=i.el;n(r,e)&&s.call(r,t)})},!1)),c.push({el:t,fn:o})}},remove:function(t,e,n){t.removeEventListener(e,n,!1)},clone:function(t){return t.cloneNode(!0)},extend:function(t){return 1===arguments.length?o(this,t):o.apply(this,arguments)}}},function(t,e,n){t.exports=function(t){function e(e){return t.contains(h.documentElement,e)}function i(t){this._init(t)}var s=n(7),r=n(8),o=n(6).mergeOptions,a=n(5),h=document;return i._=t,i.options={directives:n(9),filters:{}},i.get=function(e){var n=t.find(e)[0];return n?t.data(n,"QI"):new this({el:e})},i.all=function(e){var n=this;return t.find(e.el).map(function(i){return new n(t.extend(e,{el:i}))})},t.extend(i,a),t.extend(i.prototype,{_init:function(e){e=e||{},this.$el=e.el&&"string"==typeof e.el?t.find(e.el)[0]:e.el,this.$$={},this.$parent=e._parent,e=this.$options=o(this.constructor.options,e,this),this._isCompiled=!1,this._isAttached=!1,this._isReady=!1,this._events={},this._watchers={},this._children=[],this.$={},s.call(this,e),this._initScope(),this._callHook("created"),this.$el&&(t.data(this.$el,"QI",this),this.$mount(this.$el))},data:function(t,e){if(void 0===t)return this;var n,i=0,s=this;if(~t.indexOf(".")){var r=t.split(".");for(n=r.length;n-1>i;i++){if(t=r[i],+t+""===t&&(t=+t),!(t in s))return void 0;s=s[t]}}return n&&(t=r[i]),void 0===e?t?s[t]:s:void s.$set(t,e)},$on:function(t,e){return(this._events[t]||(this._events[t]=[])).push(e),this},$once:function(t,e){function n(){i.$off(t,n),e.apply(this,arguments)}var i=this;return n.fn=e,this.$on(t,n),this},$off:function(t,e){var n,i,s;if(!arguments.length)return this._events={},this;if(n=this._events[t],!n)return this;if(1===arguments.length)return this._events[t]=null,this;for(s=n.length;s--;)if(i=n[s],i===e||i.fn===e){n.splice(s,1);break}return this},$watch:function(t,e,n,i){var s=n?t+"**deep**":t;return(this._watchers[s]||(this._watchers[s]=[])).push(e),i&&e(this.data(t)),this},$emit:function(e){var n=t.slice.call(arguments,1);return r.emit.call(this,e,t.slice.call(n,0)),0===e.indexOf("data:")&&(e=e.substring(5),r.callDataChange.call(this,e,t.slice.call(n,0)),n.unshift(e),r.emit.call(this,"datachange",n)),this},_initScope:function(){this._initMethods()},_initMethods:function(){var t,e=this.$options.methods;if(e)for(t in e)this[t]=e[t].bind(this)},$mount:function(n){return this._isCompiled?t.warn("$mount() should be called only once"):(this._compile(n),this._isCompiled=!0,this._callHook("compiled"),void(e(this.$el)?(this._callHook("attached"),this._ready()):this.$once("hook:attached",this._ready)))},_ready:function(){this._isAttached=!0,this._isReady=!0,this._callHook("ready")},_compile:function(t){this.transclue(t,this.$options)},transclue:function(e,n){t.find(".q-mark",e).length?this._renderedBind(e,n):this._templateBind(e,n)},_templateBind:n(11),_renderedBind:function(t,e){},_callHook:function(t){var e=this.$options[t];if(e)for(var n=0,i=e.length;i>n;n++)e[n].call(this);this.$emit("hook:"+t)},_makeReadFilters:function(e){if(!e.length)return[];var n=this.$options.filters,i=this;return e.map(function(e){e=[].concat(e);var s=e.shift(),r=n[s]?n[s].read||n[s]:t.noexist(i,s);return function(t,n){return e?r.apply(i,[t].concat(e.push(n)&&e)):r.call(i,t,n)}})},applyFilters:function(t,e,n){if(!e||!e.length)return t;for(var i=0,s=e.length;s>i;i++)t=e[i].call(this,t,n);return t}}),t.extend(i.prototype,s.prototype),i}},function(t,e,n){function i(t,e){if(h[t])return!1;var n=h[t]=this.extend(e||{});return n}function s(t,e){return h[t]||this}function r(t){function e(){}return e.prototype=t,new e}function o(t){t=t||{};var e=this,n=a(t.name||"QComponent");return n.prototype=r(e.prototype),n.prototype.constructor=n,n.options=c(e.options,t),n["super"]=e,["extend","get","all","require","define"].forEach(function(t){n[t]=e[t]}),n}function a(t){return new Function("return function "+t+" (options) { this._init(options) }")()}var h={},c=n(6).mergeOptions;t.exports={define:i,require:s,extend:o}},function(t,e,n){function i(t,e,n){function i(i){var s=r[i]||o;a[i]=s(t[i],e[i],n,i)}var s,a={};for(s in t)i(s);for(s in e)t.hasOwnProperty(s)||i(s);return a}var s=n(1),r={};r.created=r.ready=r.attached=r.detached=r.compiled=r.beforeDestroy=r.destroyed=r.paramAttributes=function(t,e){return e?t?t.concat(e):Array.isArray(e)?e:[e]:t},r.filters=r.methods=r.directives=function(t,e){return e?t?s.extend({},t,e):e:t};var o=function(t,e){return void 0===e?t:e};t.exports={strats:r,mergeOptions:i}},function(t,e,n){function i(t,e,n){var i={data:n,up:t,top:t._top,namespace:e+""};t[e]="object"==typeof n&&null!==n?s(n)?new a(i):new o(i):n,~t._keys.indexOf(e)||t._keys.push(e)}function s(t){return Array.isArray(t)||t instanceof a}function r(t){return t.filter(function(t){return"number"==typeof t}).length}function o(t){var e=t.data,n=Object.keys(t.data||{}).filter(function(t){return 0!==t.indexOf("_")}).map(function(t){return+t+""===t?+t:t}),s=this;h.extend(this,e),this._keys=n,this._up=t.up,this._top=t.top||this,this._namespace=t.namespace||"",n.forEach(function(t){i(s,t,e[t])}),(Array.isArray(e)||e instanceof a)&&(this.length=r(n))}function a(t){o.call(this,t)}var h=n(1);h.extend(o.prototype,{$namespace:function(t){for(var e=[],n=this;void 0!=n;n=n._up)n._namespace&&e.unshift(n._namespace);return t&&e.push(t),e.join(".")},$key:function(){var t=this._namespace;return+t+""===t?+t:t},$up:function(){return this._up},$set:function(t,e){if("object"==typeof t){var n=this;Object.keys(t).forEach(function(e){n.$set(e,t[e])})}else{var s=this[t];i(this,t,e),this.$change(this.$namespace(t),this[t],s)}return this},$get:function(){var t,e=this._keys,n=this;return t=this instanceof o?{}:[],e.forEach(function(e){t[e]=n[e].$get?n[e].$get():n[e]}),t},$change:function(t,e,n,i){this._top.$emit&&this._top.$emit("data:"+t,e,n,i)}}),h.extend(a.prototype,o.prototype,{push:function(t){t=h.slice.call(arguments,0);for(var e=[],n=0,s=t.length;s>n;n++)i(this,this.length,t[n]),this._keys.push(this.length),e.push(this[this.length]),this.length++;return this.$change(this.$namespace(),this,null,{method:"push",res:e,args:t}),this},pop:function(){var t=this[--this.length];return delete this[this.length],this._keys.pop(),this.$change(this.$namespace(),this),t},unshift:function(t){this._keys.push(this.length),this.length++;for(var e=this.length;e--;)this[e]=this[e-1],"object"==typeof this[e]&&(this[e]._namespace=e+"");return i(this,0,t),this.$change(this.$namespace(),this),this},shift:function(){this.length--;for(var t=this[0],e=0,n=this.length;n>e;e++)this[e]=this[e+1],"object"==typeof this[e]&&(this[e]._namespace=e+"");return this._keys.pop(),delete this[this.length],this.$change(this.$namespace(),this),t},touch:function(t){this.$change(this.$namespace(t),this)},indexOf:function(t){if(t._up===this){var e=+t._namespace;if(this[e]===t)return e}else if("object"!=typeof t)for(var e=0,n=this.length;n>e;e++)if(this[e]===t)return e;return-1},splice:function(t,e){for(var n={method:"splice",args:[t,e]},i=0,s=e+t,r=this.length-e;r>t;t++,i++)this[t]=this[s+i],"object"==typeof this[t]&&(this[t]._namespace=t+"");for(;te;e++)t(this[e],e)},filter:function(t){var e=[];return this.forEach(function(n,i){t(n)&&e.push(n)}),e}}),t.exports=o},function(t,e,n){function i(t,e,n){n=n||this;var s=this._events[t];if(s){var o=0;s=s.length>1?r.slice.call(s,0):s;for(var a=s.length;a>o;o++)s[o].apply(n,e)}t.indexOf("data:")&&t.indexOf("hook:")&&this.$parent&&i.call(this.$parent,t,e,n)}function s(t,e){var n,s,o=t.split("."),a={_events:this._watchers};for(i.call(a,t,e);o.length>0;)t=o.join("."),n=t+"**deep**",s=r.slice.call(e,0,1),s[0]=this.data(t),i.call(a,n,s),o.pop();i.call(a,"**deep**",[this])}var r=(n(7),n(1));t.exports={emit:i,callDataChange:s}},function(t,e,n){function i(t,e,n){~e.indexOf(".")?(e=o.exec(e),t.data(e[1]).$set(e[2],n)):t.$set(e,n)}var s=n(1),r=n(6),o=/^(.*)\.([\w\-]+)$/;t.exports={show:function(t){var e=this.el;e.style.display=t?"block":"none"},"class":function(t){var e=this.el,n=this.arg;n?t?s.addClass(e,n):s.removeClass(e,n):(this.lastVal&&s.removeClass(e,this.lastVal),t&&(s.addClass(e,t),this.lastVal=t))},value:function(t){var e=this.el;"checkbox"===e.type?e.checked=t:e.value=t},attr:function(t){if(void 0!==t){var e=this.arg,n=this.el;if("style"===e)if("object"==typeof t)for(var i in t)t.hasOwnProperty(i)&&(n.style[i]=t[i]);else n.setAttribute(e,t);else e in n?n[e]=t:n.setAttribute(e,t)}},text:function(t){void 0!==t&&(this.el.textContent=null==t?"":t.toString())},html:function(t){this.el.innerHTML=t&&t.toString()||""},on:{bind:function(){var t=this,e=this.target,n=this.param,i=this.filters,r=this.vm,o=r.applyFilters(this.vm[e],i),a=n&&~n.indexOf("this")&&t.data();s.add(this.el,this.arg,function(t){if(!o||"function"!=typeof o)return s.warn("You need implement the "+e+" method.");var i=[];n?n.forEach(function(e){"e"===e?i.push(t):"this"===e&&i.push(a)}):i.push(t),o.apply(r,i)})}},model:{bind:function(){var t=this.target,e=this.namespace||"",n=this.el,i=this.vm,r=i.data(e),o=!1;s.add(n,"input propertychange change",function(e){o||r.$set(t,n.value)},i),s.add(n,"compositionstart",function(t){o=!0}),s.add(n,"compositionend",function(t){o=!1})},update:function(t){this.el.value=t}},vm:{bind:function(){this.el.removeAttribute("q-vm"),this.setting.stop=!0;var t,e,n=this.target,s=this.vm,o=this.el,a=o.getAttribute("q-ref")||!1,h=o.getAttribute("q-with")||"",c=o.getAttribute("q-extend"),u=this.namespace,l=u?[u,h].join("."):h,f=s.data(l),p=s.constructor.require(n),d=p.options.data;if(d&&Object.keys(d).forEach(function(t){t in f||f.$set(t,d[t])}),t={el:o,data:f.$get(),_parent:s},c&&(c=s.$options.extend[c])){if(c.data||c.el||c._parent)throw new Error("Extend Error");t=r.mergeOptions(t,c)}e=new p(t),s._children.push(e),a&&!function(){var t=s.$[a];t?t.length?t.push(e):s.$[a]=[t,e]:s.$[a]=e}();var m=!1,v=!1;s.$on("datachange",function(t,n,r,o){if(this===e)if(m)m=!1;else{v=!0;var a=l?[l,t].join("."):t;o?s[a][o.method].apply(s[a],o.args):i(s,a,n)}else if(this===s)if(v)v=!1;else if(!l||~t.indexOf(l)){m=!0;var h,c=l.length;c&&(c+=1),h=t.substring(c,t.length),o?e[h][o.method].apply(e[h],o.args):i(e,h,n)}})}},"if":{bind:function(){if(this.el.parentNode){var t=this.el,e=t.parentNode,n=document.createComment("q-if"),i=!1,s=!0,r=this.target,o=this.namespace,a=o?[o,r].join("."):r,h=this.filters,c=this.data(),u=this.vm;this.setting.stop=!0,u.$watch(a,function(r,a){r=u.applyFilters(r,h,a),i||r!==!0||(i=!0,u._templateBind(t,{data:c,namespace:o,immediate:!0})),r!==s&&(r===!0?(e.replaceChild(t,n),s=r):r===!1&&(e.replaceChild(n,t),s=r))},!1,!0)}}},el:{bind:function(){this.vm.$$[this.target]=this.el}},repeat:n(10)}},function(t,e,n){function i(t,e,n,i){var s,r,o,a,h=e.length;Object.keys(t).forEach(function(c){~c.indexOf(e)&&(s=c.substring(h+1),r=s.split("."),r.length&&(o=+r.shift(),(o-=i)>=n&&(r.unshift(o),r.unshift(e),a=r.join("."),t[a]=t[c],delete t[c])))})}var s=n(1);methods={"default":{clean:function(t,e){e.length&&(e.forEach(function(e){e.parentNode===t&&t.removeChild(e)}),s.cleanData(e),e.length=0)},insert:function(t,e,n){t.insertBefore(e,n)}},push:{insert:function(t,e,n){t.insertBefore(e,n)},dp:function(t,e){return e.res}},splice:{clean:function(t,e,n,s){var r=n[0],o=n[1],a=n[2].$namespace(),h=e.splice(r,o);return h.forEach(function(e){t.removeChild(e)}),n.done||(i(s,a,r,o),n.done=!0),!0},dp:function(t,e){return e.args.push(t),e.args}}},e.bind=function(){var t,e,n,i,r,o,a,h=this.el,c=this.setting,u=h.parentNode;u&&!c.stop&&(c.stop=!0,t=this.target,e=this.namespace,n=e?[e,t].join("."):t,i=this.filters,r=[],o=document.createComment("q-repeat"),a=this.vm,u.replaceChild(o,h),a.$watch(n,function(t,e,c){if(t=a.applyFilters(t,i),void 0!==t){var l=!i.length&&c?c.method:"default",f=(methods[l]||{}).dp,p=(methods[l]||{}).clean,d=(methods[l]||{}).insert;if(f&&(t=f(t,c)),!p||p(u,r,t,a._watchers,n)!==!0){var m,v=document.createDocumentFragment();t.forEach(function(t,e){m=s.clone(h),a._templateBind(m,{data:t,namespace:t.$namespace(),immediate:!0,useCache:!0}),r.push(m),v.appendChild(m)}),d&&d(u,v,o),a.$emit("repeat-render")}}},!1,!0))}},function(t,e,n){var i=n(12),s=n(1);t.exports=function(t,e){e=e||{};var n=this,r=n.$options.directives,o=(e.index,e.data||n,e.namespace);s.walk([t],function(t,a,h){a.forEach(function(a){var c=a.name.substring(2),u=r[c],l=i(a.value);u&&l.forEach(function(i){var r=n._makeReadFilters(i.filters),a=i.target,c=o?[o,a].join("."):a,l=s.isObject(u)?u.update:u,f=s.extend({el:t,vm:n,data:function(t){var e=[];return o&&e.push(o),t&&e.push(t),n.data(e.join("."))},namespace:o,setting:h},i,{filters:r}),p=f.data(a);l&&n.$watch(c,function(t,e){t=n.applyFilters(t,r,e),l.call(f,t,e)},"object"==typeof p,"boolean"==typeof e.immediate?e.immediate:void 0!==p),s.isObject(u)&&u.bind&&u.bind.call(f)})})},{useCache:e.useCache})}},function(t,e,n){function i(t){var e=t,n=r.get(e);if(n)return n;for(var i,h,c,u=[],l=o.length,f=!1,p={filter:!1,token:{filters:[]}};t.length;){for(h=0;l>h;h++)if(i=o[h][0].exec(t)){f=!0,c=o[h][1],c&&c(i,p,u),t=t.replace(o[h][0],""),p.filter&&(i=a.exec(t),s(i[0].trim(),p.token),t=t.replace(a,""),p.filter=!1);break}if(!f)throw new Error("Syntax error at: "+t);f=!1}return u.push(p.token),r.put(e,u),u}function s(t,e){for(var n,i=h.length,s=!1;t.length;){for(n=0;i>n;n++)if(captures=h[n][0].exec(t)){s=!0,foo=h[n][1],foo&&foo(captures,e.filters),t=t.replace(h[n][0],"");break}if(!s)throw new Error("Syntax error at: "+t);s=!1}}var r=new(n(2))(1e3),o=[[/^ +/],[/^([\w\-]+):/,function(t,e){e.token.arg=t[1]}],[/^([\w]+)\((.+?)\)/,function(t,e){e.token.target=t[1],e.token.param=t[2].split(/ *, */)}],[/^([\w\-\.]+)/,function(t,e){e.token.target=t[1]}],[/^(?=\|)/,function(t,e){e.filter=!0}],[/^,/,function(t,e,n){n.push(e.token),e.token={filters:[]}}]],a=/^(.+?)(?=,|$)/,h=[[/^ +/],[/^\| *([\w\-\!]+)/,function(t,e){e.push([t[1]])}],[/^(['"])(((\\['"])?([^\1])*)+)\1/,function(t,e){e[e.length-1].push(t[3])}],[/^([\w\-]+)/,function(t,e){e[e.length-1].push(t[1])}]];t.exports=i}])}); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):"object"==typeof exports?exports.Q=e():t.Q=e()}(this,function(){return function(t){function e(i){if(n[i])return n[i].exports;var s=n[i]={exports:{},id:i,loaded:!1};return t[i].call(s.exports,s,s.exports,e),s.loaded=!0,s.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){var i=n(1),s=n(3),r=n(4);s.extend(i,s),t.exports=r(i)},function(t,e,n){function i(t,e,n){for(var i,s=0,r=h.length;r>s;s++)if(i="q-"+h[s],t.hasAttribute(i))return e.push({name:i,value:t.getAttribute(i)}),t.removeAttribute(i),!0}function s(t,e,n){var r,o,h,l,f,p,d;for(r=0;l=t[r++];){if(1===l.nodeType){if(f=l.attributes,p=[],!i(l,p,n)){for(o=0,h=f.length;h>o;o++)0===f[o].name.indexOf("q-")&&p.push({name:f[o].name,value:f[o].value});n.useCache&&!d&&(d=d||++c,l.setAttribute("qtid",d),a.put(d,p))}p.length>0&&e(l,p,n)}l.childNodes.length&&!n.stop&&s(u.call(l.childNodes,0),e,n),n.stop=!1}}var r=function(){},o=window.requestAnimationFrame||window.webkitRequestAnimationFrame||setTimeout,a=new(n(2))(1e3),h=["vm","repeat","if"],c=0,u=[].slice;t.exports={slice:u,noop:r,addClass:function(t,e){if(t.classList)t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}},removeClass:function(t,e){if(t.classList)t.classList.remove(e);else{for(var n=" "+(t.getAttribute("class")||"")+" ",i=" "+e+" ";n.indexOf(i)>=0;)n=n.replace(i," ");t.setAttribute("class",n.trim())}},noexist:function(t,e){throw this.warn(t),new Error("Filter "+e+" hasn't implemented.")},warn:function(){return window.console&&console.error?function(){console.error.apply(console,arguments)}:r}(),isObject:function(t){return"object"==typeof t},nextTick:function(t,e){return e?o(function(){t.call(e)},0):o(t,0)},walk:s}},function(t,e,n){function i(t){this.size=0,this.limit=t,this.head=this.tail=void 0,this._keymap={}}var s=i.prototype;s.put=function(t,e){var n={key:t,value:e};return this._keymap[t]=n,this.tail?(this.tail.newer=n,n.older=this.tail):this.head=n,this.tail=n,this.size===this.limit?this.shift():void this.size++},s.shift=function(){var t=this.head;return t&&(this.head=this.head.newer,this.head.older=void 0,t.newer=t.older=void 0,this._keymap[t.key]=void 0),t},s.get=function(t,e){var n=this._keymap[t];if(void 0!==n)return n===this.tail?e?n:n.value:(n.newer&&(n===this.head&&(this.head=n.newer),n.newer.older=n.older),n.older&&(n.older.newer=n.newer),n.newer=void 0,n.older=this.tail,this.tail&&(this.tail.newer=n),this.tail=n,e?n:n.value)},t.exports=i},function(t,e,n){function i(t,e){return t!==e&&t.contains(e)}function s(t,e,n){var i=t[h]=t[h]||++c,s=u[i]=u[i]||{};return void 0===n?s[e]:s[e]=n}var r="__cbs__",o={mouseover:!0},a=function(t,e){e=[].splice.call(arguments,1);for(var n,i,s=0,r=e.length;r>s;s++){n=e[s];for(i in n)t[i]=n[i]}return t},h="QDataUid",c=0,u={};t.exports={find:function(t){return this.slice.call(document.querySelectorAll(t),0)},contains:i,data:s,cleanData:function(t){t.forEach(function(t){var e=t[h];e&&e in u&&delete u[e]})},add:function(t,e,n,a){if(!a||o[e])t.addEventListener(e,n);else{var h=a.$el,c=s(h,r);c||(c=[],s(h,r,c),h.addEventListener(e,function(t){var e=t.target;c.forEach(function(n){var s=n.fn,r=n.el;i(r,e)&&s.call(r,t)})},!1)),c.push({el:t,fn:n})}},remove:function(t,e,n){t.removeEventListener(e,n,!1)},clone:function(t){return t.cloneNode(!0)},extend:function(t){return 1===arguments.length?a(this,t):a.apply(this,arguments)}}},function(t,e,n){t.exports=function(t){function e(e){return t.contains(h.documentElement,e)}function i(t){this._init(t)}var s=n(7),r=n(8),o=n(6).mergeOptions,a=n(5),h=document;return i._=t,i.options={directives:n(9),filters:{}},i.get=function(e){var n=t.find(e)[0];return n?t.data(n,"QI"):new this({el:e})},i.all=function(e){var n=this;return t.find(e.el).map(function(i){return new n(t.extend(e,{el:i}))})},t.extend(i,a),t.extend(i.prototype,{_init:function(e){e=e||{},this.$el=e.el&&"string"==typeof e.el?t.find(e.el)[0]:e.el,this.$$={},this.$parent=e._parent,e=this.$options=o(this.constructor.options,e,this),this._isCompiled=!1,this._isAttached=!1,this._isReady=!1,this._events={},this._watchers={},this._children=[],this.$={},s.call(this,e),this._initScope(),this._callHook("created"),this.$el&&(t.data(this.$el,"QI",this),this.$mount(this.$el))},data:function(t,e){if(void 0===t)return this;var n,i=0,s=this;if(~t.indexOf(".")){var r=t.split(".");for(n=r.length;n-1>i;i++){if(t=r[i],+t+""===t&&(t=+t),!(t in s))return void 0;s=s[t]}}return n&&(t=r[i]),void 0===e?t?s[t]:s:void s.$set(t,e)},$on:function(t,e){return(this._events[t]||(this._events[t]=[])).push(e),this},$once:function(t,e){function n(){i.$off(t,n),e.apply(this,arguments)}var i=this;return n.fn=e,this.$on(t,n),this},$off:function(t,e){var n,i,s;if(!arguments.length)return this._events={},this;if(n=this._events[t],!n)return this;if(1===arguments.length)return this._events[t]=null,this;for(s=n.length;s--;)if(i=n[s],i===e||i.fn===e){n.splice(s,1);break}return this},$watch:function(t,e,n,i){var s=n?t+"**deep**":t;return(this._watchers[s]||(this._watchers[s]=[])).push(e),i&&e(this.data(t)),this},$emit:function(e){var n=t.slice.call(arguments,1);return r.emit.call(this,e,t.slice.call(n,0)),0===e.indexOf("data:")&&(e=e.substring(5),r.callDataChange.call(this,e,t.slice.call(n,0)),n.unshift(e),r.emit.call(this,"datachange",n)),this},_initScope:function(){this._initMethods()},_initMethods:function(){var t,e=this.$options.methods;if(e)for(t in e)this[t]=e[t].bind(this)},$mount:function(n){return this._isCompiled?t.warn("$mount() should be called only once"):(this._compile(n),this._isCompiled=!0,this._callHook("compiled"),void(e(this.$el)?(this._callHook("attached"),this._ready()):this.$once("hook:attached",this._ready)))},_ready:function(){this._isAttached=!0,this._isReady=!0,this._callHook("ready")},_compile:function(t){this.transclue(t,this.$options)},transclue:function(e,n){t.find(".q-mark",e).length?this._renderedBind(e,n):this._templateBind(e,n)},_templateBind:n(11),_renderedBind:function(t,e){},_callHook:function(t){var e=this.$options[t];if(e)for(var n=0,i=e.length;i>n;n++)e[n].call(this);this.$emit("hook:"+t)},_makeReadFilters:function(e){if(!e.length)return[];var n=this.$options.filters,i=this;return e.map(function(e){e=[].concat(e);var s=e.shift(),r=n[s]?n[s].read||n[s]:t.noexist(i,s);return function(t,n){return e?r.apply(i,[t].concat(e.push(n)&&e)):r.call(i,t,n)}})},applyFilters:function(t,e,n){if(!e||!e.length)return t;for(var i=0,s=e.length;s>i;i++)t=e[i].call(this,t,n);return t}}),t.extend(i.prototype,s.prototype),i}},function(t,e,n){function i(t,e){if(h[t])return!1;var n=h[t]=this.extend(e||{});return n}function s(t,e){return h[t]||this}function r(t){function e(){}return e.prototype=t,new e}function o(t){t=t||{};var e=this,n=a(t.name||"QComponent");return n.prototype=r(e.prototype),n.prototype.constructor=n,n.options=c(e.options,t),n["super"]=e,["extend","get","all","require","define"].forEach(function(t){n[t]=e[t]}),n}function a(t){return new Function("return function "+t+" (options) { this._init(options) }")()}var h={},c=n(6).mergeOptions;t.exports={define:i,require:s,extend:o}},function(t,e,n){function i(t,e,n){function i(i){var s=r[i]||o;a[i]=s(t[i],e[i],n,i)}var s,a={};for(s in t)i(s);for(s in e)t.hasOwnProperty(s)||i(s);return a}var s=n(1),r={};r.created=r.ready=r.attached=r.detached=r.compiled=r.beforeDestroy=r.destroyed=r.paramAttributes=function(t,e){return e?t?t.concat(e):Array.isArray(e)?e:[e]:t},r.filters=r.methods=r.directives=function(t,e){return e?t?s.extend({},t,e):e:t};var o=function(t,e){return void 0===e?t:e};t.exports={strats:r,mergeOptions:i}},function(t,e,n){function i(t,e,n){var i={data:n,up:t,top:t._top,namespace:e+""};t[e]="object"==typeof n&&null!==n?s(n)?new a(i):new o(i):n,~t._keys.indexOf(e)||t._keys.push(e)}function s(t){return Array.isArray(t)||t instanceof a}function r(t){return t.filter(function(t){return"number"==typeof t}).length}function o(t){var e=t.data,n=Object.keys(t.data||{}).filter(function(t){return 0!==t.indexOf("_")}).map(function(t){return+t+""===t?+t:t}),s=this;h.extend(this,e),this._keys=n,this._up=t.up,this._top=t.top||this,this._namespace=t.namespace||"",n.forEach(function(t){i(s,t,e[t])}),(Array.isArray(e)||e instanceof a)&&(this.length=r(n))}function a(t){o.call(this,t)}var h=n(1);h.extend(o.prototype,{$namespace:function(t){for(var e=[],n=this;void 0!=n;n=n._up)n._namespace&&e.unshift(n._namespace);return t&&e.push(t),e.join(".")},$key:function(){var t=this._namespace;return+t+""===t?+t:t},$up:function(){return this._up},$set:function(t,e){if("object"==typeof t){var n=this;Object.keys(t).forEach(function(e){n.$set(e,t[e])})}else{var s=this[t];i(this,t,e),this.$change(this.$namespace(t),this[t],s)}return this},$get:function(){var t,e=this._keys,n=this;return t=this instanceof o?{}:[],e.forEach(function(e){t[e]=n[e].$get?n[e].$get():n[e]}),t},$change:function(t,e,n,i){this._top.$emit&&this._top.$emit("data:"+t,e,n,i)}}),h.extend(a.prototype,o.prototype,{push:function(t){t=h.slice.call(arguments,0);for(var e=[],n=0,s=t.length;s>n;n++)i(this,this.length,t[n]),this._keys.push(this.length),e.push(this[this.length]),this.length++;return this.$change(this.$namespace(),this,null,{method:"push",res:e,args:t}),this},pop:function(){var t=this[--this.length];return delete this[this.length],this._keys.pop(),this.$change(this.$namespace(),this),t},unshift:function(t){this._keys.push(this.length),this.length++;for(var e=this.length;e--;)this[e]=this[e-1],"object"==typeof this[e]&&(this[e]._namespace=e+"");return i(this,0,t),this.$change(this.$namespace(),this),this},shift:function(){this.length--;for(var t=this[0],e=0,n=this.length;n>e;e++)this[e]=this[e+1],"object"==typeof this[e]&&(this[e]._namespace=e+"");return this._keys.pop(),delete this[this.length],this.$change(this.$namespace(),this),t},touch:function(t){this.$change(this.$namespace(t),this)},indexOf:function(t){if(t._up===this){var e=+t._namespace;if(this[e]===t)return e}else if("object"!=typeof t)for(var e=0,n=this.length;n>e;e++)if(this[e]===t)return e;return-1},splice:function(t,e){for(var n={method:"splice",args:[t,e]},i=0,s=e+t,r=this.length-e;r>t;t++,i++)this[t]=this[s+i],"object"==typeof this[t]&&(this[t]._namespace=t+"");for(;te;e++)t(this[e],e)},filter:function(t){var e=[];return this.forEach(function(n,i){t(n)&&e.push(n)}),e}}),t.exports=o},function(t,e,n){function i(t,e,n){n=n||this;var s=this._events[t];if(s){var o=0;s=s.length>1?r.slice.call(s,0):s;for(var a=s.length;a>o;o++)s[o].apply(n,e)}t.indexOf("data:")&&t.indexOf("hook:")&&this.$parent&&i.call(this.$parent,t,e,n)}function s(t,e){var n,s,o=t.split("."),a={_events:this._watchers};for(i.call(a,t,e);o.length>0;)t=o.join("."),n=t+"**deep**",s=r.slice.call(e,0,1),s[0]=this.data(t),i.call(a,n,s),o.pop();i.call(a,"**deep**",[this])}var r=(n(7),n(1));t.exports={emit:i,callDataChange:s}},function(t,e,n){function i(t,e,n){~e.indexOf(".")?(e=o.exec(e),t.data(e[1]).$set(e[2],n)):t.$set(e,n)}var s=n(1),r=n(6),o=/^(.*)\.([\w\-]+)$/;t.exports={show:function(t){var e=this.el;e.style.display=t?"block":"none"},"class":function(t){var e=this.el,n=this.arg;n?t?s.addClass(e,n):s.removeClass(e,n):(this.lastVal&&s.removeClass(e,this.lastVal),t&&(s.addClass(e,t),this.lastVal=t))},value:function(t){var e=this.el;"checkbox"===e.type?e.checked=t:e.value=t},attr:function(t){if(void 0!==t){var e=this.arg,n=this.el;if("style"===e)if("object"==typeof t)for(var i in t)t.hasOwnProperty(i)&&(n.style[i]=t[i]);else n.setAttribute(e,t);else e in n?n[e]=t:n.setAttribute(e,t)}},text:function(t){void 0!==t&&(this.el.textContent=null==t?"":t.toString())},html:function(t){this.el.innerHTML=t&&t.toString()||""},on:{bind:function(){var t=this,e=this.target,n=this.param,i=this.filters,r=this.vm,o=r.applyFilters(this.vm[e],i),a=n&&~n.indexOf("this")&&t.data();s.add(this.el,this.arg,function(t){if(!o||"function"!=typeof o)return s.warn("You need implement the "+e+" method.");var i=[];n?n.forEach(function(e){"e"===e?i.push(t):"this"===e&&i.push(a)}):i.push(t),o.apply(r,i)})}},model:{bind:function(){var t=this.target,e=this.namespace||"",n=this.el,i=this.vm,r=i.data(e),o=!1;s.add(n,"input propertychange change",function(e){o||r.$set(t,n.value)},i),s.add(n,"compositionstart",function(t){o=!0}),s.add(n,"compositionend",function(t){o=!1})},update:function(t){this.el.value=t}},vm:{bind:function(){this.el.removeAttribute("q-vm"),this.setting.stop=!0;var t,e,n=this.target,s=this.vm,o=this.el,a=o.getAttribute("q-ref")||!1,h=o.getAttribute("q-with")||"",c=o.getAttribute("q-extend"),u=this.namespace,l=u?[u,h].join("."):h,f=s.data(l),p=s.constructor.require(n),d=p.options.data;if(d&&Object.keys(d).forEach(function(t){t in f||f.$set(t,d[t])}),t={el:o,data:f.$get(),_parent:s},c&&(c=s.$options.extend[c])){if(c.data||c.el||c._parent)throw new Error("Extend Error");t=r.mergeOptions(t,c)}e=new p(t),s._children.push(e),a&&!function(){var t=s.$[a];t?t.length?t.push(e):s.$[a]=[t,e]:s.$[a]=e}();var m=!1,v=!1;s.$on("datachange",function(t,n,r,o){if(this===e)if(m)m=!1;else{v=!0;var a=l?[l,t].join("."):t;o?s[a][o.method].apply(s[a],o.args):i(s,a,n)}else if(this===s)if(v)v=!1;else if(!l||!t.indexOf(l)){m=!0;var h,c=l.length;c&&(c+=1),h=t.substring(c,t.length),o?e[h][o.method].apply(e[h],o.args):i(e,h,n)}})}},"if":{bind:function(){if(this.el.parentNode){var t=this.el,e=t.parentNode,n=document.createComment("q-if"),i=!1,s=!0,r=this.target,o=this.namespace,a=o?[o,r].join("."):r,h=this.filters,c=this.data(),u=this.vm;this.setting.stop=!0,u.$watch(a,function(r,a){r=u.applyFilters(r,h,a),i||r!==!0||(i=!0,u._templateBind(t,{data:c,namespace:o,immediate:!0})),r!==s&&(r===!0?(e.replaceChild(t,n),s=r):r===!1&&(e.replaceChild(n,t),s=r))},!1,!0)}}},el:{bind:function(){this.vm.$$[this.target]=this.el}},repeat:n(10)}},function(t,e,n){function i(t,e,n,i){var s,r,o,a,h=e.length;Object.keys(t).forEach(function(c){~c.indexOf(e)&&(s=c.substring(h+1),r=s.split("."),r.length&&(o=+r.shift(),(o-=i)>=n&&(r.unshift(o),r.unshift(e),a=r.join("."),t[a]=t[c],delete t[c])))})}var s=n(1);methods={"default":{clean:function(t,e){e.length&&(e.forEach(function(e){e.parentNode===t&&t.removeChild(e)}),s.cleanData(e),e.length=0)},insert:function(t,e,n){t.insertBefore(e,n)}},push:{insert:function(t,e,n){t.insertBefore(e,n)},dp:function(t,e){return e.res}},splice:{clean:function(t,e,n,s){var r=n[0],o=n[1],a=n[2].$namespace(),h=e.splice(r,o);return h.forEach(function(e){t.removeChild(e)}),n.done||(i(s,a,r,o),n.done=!0),!0},dp:function(t,e){return e.args.push(t),e.args}}},e.bind=function(){var t,e,n,i,r,o,a,h=this.el,c=this.setting,u=h.parentNode;u&&!c.stop&&(c.stop=!0,t=this.target,e=this.namespace,n=e?[e,t].join("."):t,i=this.filters,r=[],o=document.createComment("q-repeat"),a=this.vm,u.replaceChild(o,h),a.$watch(n,function(t,e,c){if(t=a.applyFilters(t,i),void 0!==t){var l=!i.length&&c?c.method:"default",f=(methods[l]||{}).dp,p=(methods[l]||{}).clean,d=(methods[l]||{}).insert;if(f&&(t=f(t,c)),!p||p(u,r,t,a._watchers,n)!==!0){var m,v=document.createDocumentFragment();t.forEach(function(t,e){m=s.clone(h),a._templateBind(m,{data:t,namespace:t.$namespace(),immediate:!0,useCache:!0}),r.push(m),v.appendChild(m)}),d&&d(u,v,o),a.$emit("repeat-render")}}},!1,!0))}},function(t,e,n){var i=n(12),s=n(1);t.exports=function(t,e){e=e||{};var n=this,r=n.$options.directives,o=(e.index,e.data||n,e.namespace);s.walk([t],function(t,a,h){a.forEach(function(a){var c=a.name.substring(2),u=r[c],l=i(a.value);u&&l.forEach(function(i){var r=n._makeReadFilters(i.filters),a=i.target,c=o?[o,a].join("."):a,l=s.isObject(u)?u.update:u,f=s.extend({el:t,vm:n,data:function(t){var e=[];return o&&e.push(o),t&&e.push(t),n.data(e.join("."))},namespace:o,setting:h},i,{filters:r}),p=f.data(a);l&&n.$watch(c,function(t,e){t=n.applyFilters(t,r,e),l.call(f,t,e)},"object"==typeof p,"boolean"==typeof e.immediate?e.immediate:void 0!==p),s.isObject(u)&&u.bind&&u.bind.call(f)})})},{useCache:e.useCache})}},function(t,e,n){function i(t){var e=t,n=r.get(e);if(n)return n;for(var i,h,c,u=[],l=o.length,f=!1,p={filter:!1,token:{filters:[]}};t.length;){for(h=0;l>h;h++)if(i=o[h][0].exec(t)){f=!0,c=o[h][1],c&&c(i,p,u),t=t.replace(o[h][0],""),p.filter&&(i=a.exec(t),s(i[0].trim(),p.token),t=t.replace(a,""),p.filter=!1);break}if(!f)throw new Error("Syntax error at: "+t);f=!1}return u.push(p.token),r.put(e,u),u}function s(t,e){for(var n,i=h.length,s=!1;t.length;){for(n=0;i>n;n++)if(captures=h[n][0].exec(t)){s=!0,foo=h[n][1],foo&&foo(captures,e.filters),t=t.replace(h[n][0],"");break}if(!s)throw new Error("Syntax error at: "+t);s=!1}}var r=new(n(2))(1e3),o=[[/^ +/],[/^([\w\-]+):/,function(t,e){e.token.arg=t[1]}],[/^([\w]+)\((.+?)\)/,function(t,e){e.token.target=t[1],e.token.param=t[2].split(/ *, */)}],[/^([\w\-\.]+)/,function(t,e){e.token.target=t[1]}],[/^(?=\|)/,function(t,e){e.filter=!0}],[/^,/,function(t,e,n){n.push(e.token),e.token={filters:[]}}]],a=/^(.+?)(?=,|$)/,h=[[/^ +/],[/^\| *([\w\-\!]+)/,function(t,e){e.push([t[1]])}],[/^(['"])(((\\['"])?([^\1])*)+)\1/,function(t,e){e[e.length-1].push(t[3])}],[/^([\w\-]+)/,function(t,e){e[e.length-1].push(t[1])}]];t.exports=i}])}); \ No newline at end of file diff --git a/dist/Q.zepto.min.js b/dist/Q.zepto.min.js index def0cf2..8efa242 100644 --- a/dist/Q.zepto.min.js +++ b/dist/Q.zepto.min.js @@ -1,7 +1,7 @@ /*! - * Q.js v0.5.4 + * Q.js v0.5.5 * Inspired from vue.js * (c) 2015 Daniel Yang * Released under the MIT License. */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("zepto")):"function"==typeof define&&define.amd?define(["zepto"],e):"object"==typeof exports?exports.Q=e(require("zepto")):t.Q=e(t.Zepto)}(this,function(t){return function(t){function e(i){if(n[i])return n[i].exports;var s=n[i]={exports:{},id:i,loaded:!1};return t[i].call(s.exports,s,s.exports,e),s.loaded=!0,s.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){var i=n(1),s=n(3),r=n(5);s.extend(i,s),t.exports=r(i)},function(t,e,n){function i(t,e,n){for(var i,s=0,r=h.length;r>s;s++)if(i="q-"+h[s],t.hasAttribute(i))return e.push({name:i,value:t.getAttribute(i)}),t.removeAttribute(i),!0}function s(t,e,n){var r,o,h,l,f,p,d;for(r=0;l=t[r++];){if(1===l.nodeType){if(f=l.attributes,p=[],!i(l,p,n)){for(o=0,h=f.length;h>o;o++)0===f[o].name.indexOf("q-")&&p.push({name:f[o].name,value:f[o].value});n.useCache&&!d&&(d=d||++c,l.setAttribute("qtid",d),a.put(d,p))}p.length>0&&e(l,p,n)}l.childNodes.length&&!n.stop&&s(u.call(l.childNodes,0),e,n),n.stop=!1}}var r=function(){},o=window.requestAnimationFrame||window.webkitRequestAnimationFrame||setTimeout,a=new(n(2))(1e3),h=["vm","repeat","if"],c=0,u=[].slice;t.exports={slice:u,noop:r,addClass:function(t,e){if(t.classList)t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}},removeClass:function(t,e){if(t.classList)t.classList.remove(e);else{for(var n=" "+(t.getAttribute("class")||"")+" ",i=" "+e+" ";n.indexOf(i)>=0;)n=n.replace(i," ");t.setAttribute("class",n.trim())}},noexist:function(t,e){throw this.warn(t),new Error("Filter "+e+" hasn't implemented.")},warn:function(){return window.console&&console.error?function(){console.error.apply(console,arguments)}:r}(),isObject:function(t){return"object"==typeof t},nextTick:function(t,e){return e?o(function(){t.call(e)},0):o(t,0)},walk:s}},function(t,e){function n(t){this.size=0,this.limit=t,this.head=this.tail=void 0,this._keymap={}}var i=n.prototype;i.put=function(t,e){var n={key:t,value:e};return this._keymap[t]=n,this.tail?(this.tail.newer=n,n.older=this.tail):this.head=n,this.tail=n,this.size===this.limit?this.shift():void this.size++},i.shift=function(){var t=this.head;return t&&(this.head=this.head.newer,this.head.older=void 0,t.newer=t.older=void 0,this._keymap[t.key]=void 0),t},i.get=function(t,e){var n=this._keymap[t];if(void 0!==n)return n===this.tail?e?n:n.value:(n.newer&&(n===this.head&&(this.head=n.newer),n.newer.older=n.older),n.older&&(n.older.newer=n.newer),n.newer=void 0,n.older=this.tail,this.tail&&(this.tail.newer=n),this.tail=n,e?n:n.value)},t.exports=n},function(t,e,n){var i=n(4),s=i.extend,r="QDataUid",o=0,a={};t.exports={find:function(t){return this.slice.call(document.querySelectorAll(t),0)},contains:i.contains,data:function(t,e,n){var i=t[r]=t[r]||++o,s=a[i]=a[i]||{};return void 0===n?s[e]:s[e]=n},cleanData:function(t){t.forEach(function(t){var e=t[r];e&&e in a&&delete a[e]})},add:i.event.add,remove:i.event.remove,clone:function(t){return t.cloneNode(!0)},extend:function(t){return 1===arguments.length?s(this,t):s.apply(this,arguments)}}},function(e,n){e.exports=t},function(t,e,n){t.exports=function(t){function e(e){return t.contains(h.documentElement,e)}function i(t){this._init(t)}var s=n(8),r=n(9),o=n(7).mergeOptions,a=n(6),h=document;return i._=t,i.options={directives:n(10),filters:{}},i.get=function(e){var n=t.find(e)[0];return n?t.data(n,"QI"):new this({el:e})},i.all=function(e){var n=this;return t.find(e.el).map(function(i){return new n(t.extend(e,{el:i}))})},t.extend(i,a),t.extend(i.prototype,{_init:function(e){e=e||{},this.$el=e.el&&"string"==typeof e.el?t.find(e.el)[0]:e.el,this.$$={},this.$parent=e._parent,e=this.$options=o(this.constructor.options,e,this),this._isCompiled=!1,this._isAttached=!1,this._isReady=!1,this._events={},this._watchers={},this._children=[],this.$={},s.call(this,e),this._initScope(),this._callHook("created"),this.$el&&(t.data(this.$el,"QI",this),this.$mount(this.$el))},data:function(t,e){if(void 0===t)return this;var n,i=0,s=this;if(~t.indexOf(".")){var r=t.split(".");for(n=r.length;n-1>i;i++){if(t=r[i],+t+""===t&&(t=+t),!(t in s))return void 0;s=s[t]}}return n&&(t=r[i]),void 0===e?t?s[t]:s:void s.$set(t,e)},$on:function(t,e){return(this._events[t]||(this._events[t]=[])).push(e),this},$once:function(t,e){function n(){i.$off(t,n),e.apply(this,arguments)}var i=this;return n.fn=e,this.$on(t,n),this},$off:function(t,e){var n,i,s;if(!arguments.length)return this._events={},this;if(n=this._events[t],!n)return this;if(1===arguments.length)return this._events[t]=null,this;for(s=n.length;s--;)if(i=n[s],i===e||i.fn===e){n.splice(s,1);break}return this},$watch:function(t,e,n,i){var s=n?t+"**deep**":t;return(this._watchers[s]||(this._watchers[s]=[])).push(e),i&&e(this.data(t)),this},$emit:function(e){var n=t.slice.call(arguments,1);return r.emit.call(this,e,t.slice.call(n,0)),0===e.indexOf("data:")&&(e=e.substring(5),r.callDataChange.call(this,e,t.slice.call(n,0)),n.unshift(e),r.emit.call(this,"datachange",n)),this},_initScope:function(){this._initMethods()},_initMethods:function(){var t,e=this.$options.methods;if(e)for(t in e)this[t]=e[t].bind(this)},$mount:function(n){return this._isCompiled?t.warn("$mount() should be called only once"):(this._compile(n),this._isCompiled=!0,this._callHook("compiled"),void(e(this.$el)?(this._callHook("attached"),this._ready()):this.$once("hook:attached",this._ready)))},_ready:function(){this._isAttached=!0,this._isReady=!0,this._callHook("ready")},_compile:function(t){this.transclue(t,this.$options)},transclue:function(e,n){t.find(".q-mark",e).length?this._renderedBind(e,n):this._templateBind(e,n)},_templateBind:n(12),_renderedBind:function(t,e){},_callHook:function(t){var e=this.$options[t];if(e)for(var n=0,i=e.length;i>n;n++)e[n].call(this);this.$emit("hook:"+t)},_makeReadFilters:function(e){if(!e.length)return[];var n=this.$options.filters,i=this;return e.map(function(e){e=[].concat(e);var s=e.shift(),r=n[s]?n[s].read||n[s]:t.noexist(i,s);return function(t,n){return e?r.apply(i,[t].concat(e.push(n)&&e)):r.call(i,t,n)}})},applyFilters:function(t,e,n){if(!e||!e.length)return t;for(var i=0,s=e.length;s>i;i++)t=e[i].call(this,t,n);return t}}),t.extend(i.prototype,s.prototype),i}},function(t,e,n){function i(t,e){if(h[t])return!1;var n=h[t]=this.extend(e||{});return n}function s(t,e){return h[t]||this}function r(t){function e(){}return e.prototype=t,new e}function o(t){t=t||{};var e=this,n=a(t.name||"QComponent");return n.prototype=r(e.prototype),n.prototype.constructor=n,n.options=c(e.options,t),n["super"]=e,["extend","get","all","require","define"].forEach(function(t){n[t]=e[t]}),n}function a(t){return new Function("return function "+t+" (options) { this._init(options) }")()}var h={},c=n(7).mergeOptions;t.exports={define:i,require:s,extend:o}},function(t,e,n){function i(t,e,n){function i(i){var s=r[i]||o;a[i]=s(t[i],e[i],n,i)}var s,a={};for(s in t)i(s);for(s in e)t.hasOwnProperty(s)||i(s);return a}var s=n(1),r={};r.created=r.ready=r.attached=r.detached=r.compiled=r.beforeDestroy=r.destroyed=r.paramAttributes=function(t,e){return e?t?t.concat(e):Array.isArray(e)?e:[e]:t},r.filters=r.methods=r.directives=function(t,e){return e?t?s.extend({},t,e):e:t};var o=function(t,e){return void 0===e?t:e};t.exports={strats:r,mergeOptions:i}},function(t,e,n){function i(t,e,n){var i={data:n,up:t,top:t._top,namespace:e+""};t[e]="object"==typeof n&&null!==n?s(n)?new a(i):new o(i):n,~t._keys.indexOf(e)||t._keys.push(e)}function s(t){return Array.isArray(t)||t instanceof a}function r(t){return t.filter(function(t){return"number"==typeof t}).length}function o(t){var e=t.data,n=Object.keys(t.data||{}).filter(function(t){return 0!==t.indexOf("_")}).map(function(t){return+t+""===t?+t:t}),s=this;h.extend(this,e),this._keys=n,this._up=t.up,this._top=t.top||this,this._namespace=t.namespace||"",n.forEach(function(t){i(s,t,e[t])}),(Array.isArray(e)||e instanceof a)&&(this.length=r(n))}function a(t){o.call(this,t)}var h=n(1);h.extend(o.prototype,{$namespace:function(t){for(var e=[],n=this;void 0!=n;n=n._up)n._namespace&&e.unshift(n._namespace);return t&&e.push(t),e.join(".")},$key:function(){var t=this._namespace;return+t+""===t?+t:t},$up:function(){return this._up},$set:function(t,e){if("object"==typeof t){var n=this;Object.keys(t).forEach(function(e){n.$set(e,t[e])})}else{var s=this[t];i(this,t,e),this.$change(this.$namespace(t),this[t],s)}return this},$get:function(){var t,e=this._keys,n=this;return t=this instanceof o?{}:[],e.forEach(function(e){t[e]=n[e].$get?n[e].$get():n[e]}),t},$change:function(t,e,n,i){this._top.$emit&&this._top.$emit("data:"+t,e,n,i)}}),h.extend(a.prototype,o.prototype,{push:function(t){t=h.slice.call(arguments,0);for(var e=[],n=0,s=t.length;s>n;n++)i(this,this.length,t[n]),this._keys.push(this.length),e.push(this[this.length]),this.length++;return this.$change(this.$namespace(),this,null,{method:"push",res:e,args:t}),this},pop:function(){var t=this[--this.length];return delete this[this.length],this._keys.pop(),this.$change(this.$namespace(),this),t},unshift:function(t){this._keys.push(this.length),this.length++;for(var e=this.length;e--;)this[e]=this[e-1],"object"==typeof this[e]&&(this[e]._namespace=e+"");return i(this,0,t),this.$change(this.$namespace(),this),this},shift:function(){this.length--;for(var t=this[0],e=0,n=this.length;n>e;e++)this[e]=this[e+1],"object"==typeof this[e]&&(this[e]._namespace=e+"");return this._keys.pop(),delete this[this.length],this.$change(this.$namespace(),this),t},touch:function(t){this.$change(this.$namespace(t),this)},indexOf:function(t){if(t._up===this){var e=+t._namespace;if(this[e]===t)return e}else if("object"!=typeof t)for(var e=0,n=this.length;n>e;e++)if(this[e]===t)return e;return-1},splice:function(t,e){for(var n={method:"splice",args:[t,e]},i=0,s=e+t,r=this.length-e;r>t;t++,i++)this[t]=this[s+i],"object"==typeof this[t]&&(this[t]._namespace=t+"");for(;te;e++)t(this[e],e)},filter:function(t){var e=[];return this.forEach(function(n,i){t(n)&&e.push(n)}),e}}),t.exports=o},function(t,e,n){function i(t,e,n){n=n||this;var s=this._events[t];if(s){var o=0;s=s.length>1?r.slice.call(s,0):s;for(var a=s.length;a>o;o++)s[o].apply(n,e)}t.indexOf("data:")&&t.indexOf("hook:")&&this.$parent&&i.call(this.$parent,t,e,n)}function s(t,e){var n,s,o=t.split("."),a={_events:this._watchers};for(i.call(a,t,e);o.length>0;)t=o.join("."),n=t+"**deep**",s=r.slice.call(e,0,1),s[0]=this.data(t),i.call(a,n,s),o.pop();i.call(a,"**deep**",[this])}var r=(n(8),n(1));t.exports={emit:i,callDataChange:s}},function(t,e,n){function i(t,e,n){~e.indexOf(".")?(e=o.exec(e),t.data(e[1]).$set(e[2],n)):t.$set(e,n)}var s=n(1),r=n(7),o=/^(.*)\.([\w\-]+)$/;t.exports={show:function(t){var e=this.el;e.style.display=t?"block":"none"},"class":function(t){var e=this.el,n=this.arg;n?t?s.addClass(e,n):s.removeClass(e,n):(this.lastVal&&s.removeClass(e,this.lastVal),t&&(s.addClass(e,t),this.lastVal=t))},value:function(t){var e=this.el;"checkbox"===e.type?e.checked=t:e.value=t},attr:function(t){if(void 0!==t){var e=this.arg,n=this.el;if("style"===e)if("object"==typeof t)for(var i in t)t.hasOwnProperty(i)&&(n.style[i]=t[i]);else n.setAttribute(e,t);else e in n?n[e]=t:n.setAttribute(e,t)}},text:function(t){void 0!==t&&(this.el.textContent=null==t?"":t.toString())},html:function(t){this.el.innerHTML=t&&t.toString()||""},on:{bind:function(){var t=this,e=this.target,n=this.param,i=this.filters,r=this.vm,o=r.applyFilters(this.vm[e],i),a=n&&~n.indexOf("this")&&t.data();s.add(this.el,this.arg,function(t){if(!o||"function"!=typeof o)return s.warn("You need implement the "+e+" method.");var i=[];n?n.forEach(function(e){"e"===e?i.push(t):"this"===e&&i.push(a)}):i.push(t),o.apply(r,i)})}},model:{bind:function(){var t=this.target,e=this.namespace||"",n=this.el,i=this.vm,r=i.data(e),o=!1;s.add(n,"input propertychange change",function(e){o||r.$set(t,n.value)},i),s.add(n,"compositionstart",function(t){o=!0}),s.add(n,"compositionend",function(t){o=!1})},update:function(t){this.el.value=t}},vm:{bind:function(){this.el.removeAttribute("q-vm"),this.setting.stop=!0;var t,e,n=this.target,s=this.vm,o=this.el,a=o.getAttribute("q-ref")||!1,h=o.getAttribute("q-with")||"",c=o.getAttribute("q-extend"),u=this.namespace,l=u?[u,h].join("."):h,f=s.data(l),p=s.constructor.require(n),d=p.options.data;if(d&&Object.keys(d).forEach(function(t){t in f||f.$set(t,d[t])}),t={el:o,data:f.$get(),_parent:s},c&&(c=s.$options.extend[c])){if(c.data||c.el||c._parent)throw new Error("Extend Error");t=r.mergeOptions(t,c)}e=new p(t),s._children.push(e),a&&!function(){var t=s.$[a];t?t.length?t.push(e):s.$[a]=[t,e]:s.$[a]=e}();var m=!1,v=!1;s.$on("datachange",function(t,n,r,o){if(this===e)if(m)m=!1;else{v=!0;var a=l?[l,t].join("."):t;o?s[a][o.method].apply(s[a],o.args):i(s,a,n)}else if(this===s)if(v)v=!1;else if(!l||~t.indexOf(l)){m=!0;var h,c=l.length;c&&(c+=1),h=t.substring(c,t.length),o?e[h][o.method].apply(e[h],o.args):i(e,h,n)}})}},"if":{bind:function(){if(this.el.parentNode){var t=this.el,e=t.parentNode,n=document.createComment("q-if"),i=!1,s=!0,r=this.target,o=this.namespace,a=o?[o,r].join("."):r,h=this.filters,c=this.data(),u=this.vm;this.setting.stop=!0,u.$watch(a,function(r,a){r=u.applyFilters(r,h,a),i||r!==!0||(i=!0,u._templateBind(t,{data:c,namespace:o,immediate:!0})),r!==s&&(r===!0?(e.replaceChild(t,n),s=r):r===!1&&(e.replaceChild(n,t),s=r))},!1,!0)}}},el:{bind:function(){this.vm.$$[this.target]=this.el}},repeat:n(11)}},function(t,e,n){function i(t,e,n,i){var s,r,o,a,h=e.length;Object.keys(t).forEach(function(c){~c.indexOf(e)&&(s=c.substring(h+1),r=s.split("."),r.length&&(o=+r.shift(),(o-=i)>=n&&(r.unshift(o),r.unshift(e),a=r.join("."),t[a]=t[c],delete t[c])))})}var s=n(1);methods={"default":{clean:function(t,e){e.length&&(e.forEach(function(e){e.parentNode===t&&t.removeChild(e)}),s.cleanData(e),e.length=0)},insert:function(t,e,n){t.insertBefore(e,n)}},push:{insert:function(t,e,n){t.insertBefore(e,n)},dp:function(t,e){return e.res}},splice:{clean:function(t,e,n,s){var r=n[0],o=n[1],a=n[2].$namespace(),h=e.splice(r,o);return h.forEach(function(e){t.removeChild(e)}),n.done||(i(s,a,r,o),n.done=!0),!0},dp:function(t,e){return e.args.push(t),e.args}}},e.bind=function(){var t,e,n,i,r,o,a,h=this.el,c=this.setting,u=h.parentNode;u&&!c.stop&&(c.stop=!0,t=this.target,e=this.namespace,n=e?[e,t].join("."):t,i=this.filters,r=[],o=document.createComment("q-repeat"),a=this.vm,u.replaceChild(o,h),a.$watch(n,function(t,e,c){if(t=a.applyFilters(t,i),void 0!==t){var l=!i.length&&c?c.method:"default",f=(methods[l]||{}).dp,p=(methods[l]||{}).clean,d=(methods[l]||{}).insert;if(f&&(t=f(t,c)),!p||p(u,r,t,a._watchers,n)!==!0){var m,v=document.createDocumentFragment();t.forEach(function(t,e){m=s.clone(h),a._templateBind(m,{data:t,namespace:t.$namespace(),immediate:!0,useCache:!0}),r.push(m),v.appendChild(m)}),d&&d(u,v,o),a.$emit("repeat-render")}}},!1,!0))}},function(t,e,n){var i=n(13),s=n(1);t.exports=function(t,e){e=e||{};var n=this,r=n.$options.directives,o=(e.index,e.data||n,e.namespace);s.walk([t],function(t,a,h){a.forEach(function(a){var c=a.name.substring(2),u=r[c],l=i(a.value);u&&l.forEach(function(i){var r=n._makeReadFilters(i.filters),a=i.target,c=o?[o,a].join("."):a,l=s.isObject(u)?u.update:u,f=s.extend({el:t,vm:n,data:function(t){var e=[];return o&&e.push(o),t&&e.push(t),n.data(e.join("."))},namespace:o,setting:h},i,{filters:r}),p=f.data(a);l&&n.$watch(c,function(t,e){t=n.applyFilters(t,r,e),l.call(f,t,e)},"object"==typeof p,"boolean"==typeof e.immediate?e.immediate:void 0!==p),s.isObject(u)&&u.bind&&u.bind.call(f)})})},{useCache:e.useCache})}},function(t,e,n){function i(t){var e=t,n=r.get(e);if(n)return n;for(var i,h,c,u=[],l=o.length,f=!1,p={filter:!1,token:{filters:[]}};t.length;){for(h=0;l>h;h++)if(i=o[h][0].exec(t)){f=!0,c=o[h][1],c&&c(i,p,u),t=t.replace(o[h][0],""),p.filter&&(i=a.exec(t),s(i[0].trim(),p.token),t=t.replace(a,""),p.filter=!1);break}if(!f)throw new Error("Syntax error at: "+t);f=!1}return u.push(p.token),r.put(e,u),u}function s(t,e){for(var n,i=h.length,s=!1;t.length;){for(n=0;i>n;n++)if(captures=h[n][0].exec(t)){s=!0,foo=h[n][1],foo&&foo(captures,e.filters),t=t.replace(h[n][0],"");break}if(!s)throw new Error("Syntax error at: "+t);s=!1}}var r=new(n(2))(1e3),o=[[/^ +/],[/^([\w\-]+):/,function(t,e){e.token.arg=t[1]}],[/^([\w]+)\((.+?)\)/,function(t,e){e.token.target=t[1],e.token.param=t[2].split(/ *, */)}],[/^([\w\-\.]+)/,function(t,e){e.token.target=t[1]}],[/^(?=\|)/,function(t,e){e.filter=!0}],[/^,/,function(t,e,n){n.push(e.token),e.token={filters:[]}}]],a=/^(.+?)(?=,|$)/,h=[[/^ +/],[/^\| *([\w\-\!]+)/,function(t,e){e.push([t[1]])}],[/^(['"])(((\\['"])?([^\1])*)+)\1/,function(t,e){e[e.length-1].push(t[3])}],[/^([\w\-]+)/,function(t,e){e[e.length-1].push(t[1])}]];t.exports=i}])}); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("zepto")):"function"==typeof define&&define.amd?define(["zepto"],e):"object"==typeof exports?exports.Q=e(require("zepto")):t.Q=e(t.Zepto)}(this,function(t){return function(t){function e(i){if(n[i])return n[i].exports;var s=n[i]={exports:{},id:i,loaded:!1};return t[i].call(s.exports,s,s.exports,e),s.loaded=!0,s.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){var i=n(1),s=n(3),r=n(5);s.extend(i,s),t.exports=r(i)},function(t,e,n){function i(t,e,n){for(var i,s=0,r=h.length;r>s;s++)if(i="q-"+h[s],t.hasAttribute(i))return e.push({name:i,value:t.getAttribute(i)}),t.removeAttribute(i),!0}function s(t,e,n){var r,o,h,l,f,p,d;for(r=0;l=t[r++];){if(1===l.nodeType){if(f=l.attributes,p=[],!i(l,p,n)){for(o=0,h=f.length;h>o;o++)0===f[o].name.indexOf("q-")&&p.push({name:f[o].name,value:f[o].value});n.useCache&&!d&&(d=d||++c,l.setAttribute("qtid",d),a.put(d,p))}p.length>0&&e(l,p,n)}l.childNodes.length&&!n.stop&&s(u.call(l.childNodes,0),e,n),n.stop=!1}}var r=function(){},o=window.requestAnimationFrame||window.webkitRequestAnimationFrame||setTimeout,a=new(n(2))(1e3),h=["vm","repeat","if"],c=0,u=[].slice;t.exports={slice:u,noop:r,addClass:function(t,e){if(t.classList)t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}},removeClass:function(t,e){if(t.classList)t.classList.remove(e);else{for(var n=" "+(t.getAttribute("class")||"")+" ",i=" "+e+" ";n.indexOf(i)>=0;)n=n.replace(i," ");t.setAttribute("class",n.trim())}},noexist:function(t,e){throw this.warn(t),new Error("Filter "+e+" hasn't implemented.")},warn:function(){return window.console&&console.error?function(){console.error.apply(console,arguments)}:r}(),isObject:function(t){return"object"==typeof t},nextTick:function(t,e){return e?o(function(){t.call(e)},0):o(t,0)},walk:s}},function(t,e,n){function i(t){this.size=0,this.limit=t,this.head=this.tail=void 0,this._keymap={}}var s=i.prototype;s.put=function(t,e){var n={key:t,value:e};return this._keymap[t]=n,this.tail?(this.tail.newer=n,n.older=this.tail):this.head=n,this.tail=n,this.size===this.limit?this.shift():void this.size++},s.shift=function(){var t=this.head;return t&&(this.head=this.head.newer,this.head.older=void 0,t.newer=t.older=void 0,this._keymap[t.key]=void 0),t},s.get=function(t,e){var n=this._keymap[t];if(void 0!==n)return n===this.tail?e?n:n.value:(n.newer&&(n===this.head&&(this.head=n.newer),n.newer.older=n.older),n.older&&(n.older.newer=n.newer),n.newer=void 0,n.older=this.tail,this.tail&&(this.tail.newer=n),this.tail=n,e?n:n.value)},t.exports=i},function(t,e,n){var i=n(4),s=i.extend,r="QDataUid",o=0,a={};t.exports={find:function(t){return this.slice.call(document.querySelectorAll(t),0)},contains:i.contains,data:function(t,e,n){var i=t[r]=t[r]||++o,s=a[i]=a[i]||{};return void 0===n?s[e]:s[e]=n},cleanData:function(t){t.forEach(function(t){var e=t[r];e&&e in a&&delete a[e]})},add:i.event.add,remove:i.event.remove,clone:function(t){return t.cloneNode(!0)},extend:function(t){return 1===arguments.length?s(this,t):s.apply(this,arguments)}}},function(e,n,i){e.exports=t},function(t,e,n){t.exports=function(t){function e(e){return t.contains(h.documentElement,e)}function i(t){this._init(t)}var s=n(8),r=n(9),o=n(7).mergeOptions,a=n(6),h=document;return i._=t,i.options={directives:n(10),filters:{}},i.get=function(e){var n=t.find(e)[0];return n?t.data(n,"QI"):new this({el:e})},i.all=function(e){var n=this;return t.find(e.el).map(function(i){return new n(t.extend(e,{el:i}))})},t.extend(i,a),t.extend(i.prototype,{_init:function(e){e=e||{},this.$el=e.el&&"string"==typeof e.el?t.find(e.el)[0]:e.el,this.$$={},this.$parent=e._parent,e=this.$options=o(this.constructor.options,e,this),this._isCompiled=!1,this._isAttached=!1,this._isReady=!1,this._events={},this._watchers={},this._children=[],this.$={},s.call(this,e),this._initScope(),this._callHook("created"),this.$el&&(t.data(this.$el,"QI",this),this.$mount(this.$el))},data:function(t,e){if(void 0===t)return this;var n,i=0,s=this;if(~t.indexOf(".")){var r=t.split(".");for(n=r.length;n-1>i;i++){if(t=r[i],+t+""===t&&(t=+t),!(t in s))return void 0;s=s[t]}}return n&&(t=r[i]),void 0===e?t?s[t]:s:void s.$set(t,e)},$on:function(t,e){return(this._events[t]||(this._events[t]=[])).push(e),this},$once:function(t,e){function n(){i.$off(t,n),e.apply(this,arguments)}var i=this;return n.fn=e,this.$on(t,n),this},$off:function(t,e){var n,i,s;if(!arguments.length)return this._events={},this;if(n=this._events[t],!n)return this;if(1===arguments.length)return this._events[t]=null,this;for(s=n.length;s--;)if(i=n[s],i===e||i.fn===e){n.splice(s,1);break}return this},$watch:function(t,e,n,i){var s=n?t+"**deep**":t;return(this._watchers[s]||(this._watchers[s]=[])).push(e),i&&e(this.data(t)),this},$emit:function(e){var n=t.slice.call(arguments,1);return r.emit.call(this,e,t.slice.call(n,0)),0===e.indexOf("data:")&&(e=e.substring(5),r.callDataChange.call(this,e,t.slice.call(n,0)),n.unshift(e),r.emit.call(this,"datachange",n)),this},_initScope:function(){this._initMethods()},_initMethods:function(){var t,e=this.$options.methods;if(e)for(t in e)this[t]=e[t].bind(this)},$mount:function(n){return this._isCompiled?t.warn("$mount() should be called only once"):(this._compile(n),this._isCompiled=!0,this._callHook("compiled"),void(e(this.$el)?(this._callHook("attached"),this._ready()):this.$once("hook:attached",this._ready)))},_ready:function(){this._isAttached=!0,this._isReady=!0,this._callHook("ready")},_compile:function(t){this.transclue(t,this.$options)},transclue:function(e,n){t.find(".q-mark",e).length?this._renderedBind(e,n):this._templateBind(e,n)},_templateBind:n(12),_renderedBind:function(t,e){},_callHook:function(t){var e=this.$options[t];if(e)for(var n=0,i=e.length;i>n;n++)e[n].call(this);this.$emit("hook:"+t)},_makeReadFilters:function(e){if(!e.length)return[];var n=this.$options.filters,i=this;return e.map(function(e){e=[].concat(e);var s=e.shift(),r=n[s]?n[s].read||n[s]:t.noexist(i,s);return function(t,n){return e?r.apply(i,[t].concat(e.push(n)&&e)):r.call(i,t,n)}})},applyFilters:function(t,e,n){if(!e||!e.length)return t;for(var i=0,s=e.length;s>i;i++)t=e[i].call(this,t,n);return t}}),t.extend(i.prototype,s.prototype),i}},function(t,e,n){function i(t,e){if(h[t])return!1;var n=h[t]=this.extend(e||{});return n}function s(t,e){return h[t]||this}function r(t){function e(){}return e.prototype=t,new e}function o(t){t=t||{};var e=this,n=a(t.name||"QComponent");return n.prototype=r(e.prototype),n.prototype.constructor=n,n.options=c(e.options,t),n["super"]=e,["extend","get","all","require","define"].forEach(function(t){n[t]=e[t]}),n}function a(t){return new Function("return function "+t+" (options) { this._init(options) }")()}var h={},c=n(7).mergeOptions;t.exports={define:i,require:s,extend:o}},function(t,e,n){function i(t,e,n){function i(i){var s=r[i]||o;a[i]=s(t[i],e[i],n,i)}var s,a={};for(s in t)i(s);for(s in e)t.hasOwnProperty(s)||i(s);return a}var s=n(1),r={};r.created=r.ready=r.attached=r.detached=r.compiled=r.beforeDestroy=r.destroyed=r.paramAttributes=function(t,e){return e?t?t.concat(e):Array.isArray(e)?e:[e]:t},r.filters=r.methods=r.directives=function(t,e){return e?t?s.extend({},t,e):e:t};var o=function(t,e){return void 0===e?t:e};t.exports={strats:r,mergeOptions:i}},function(t,e,n){function i(t,e,n){var i={data:n,up:t,top:t._top,namespace:e+""};t[e]="object"==typeof n&&null!==n?s(n)?new a(i):new o(i):n,~t._keys.indexOf(e)||t._keys.push(e)}function s(t){return Array.isArray(t)||t instanceof a}function r(t){return t.filter(function(t){return"number"==typeof t}).length}function o(t){var e=t.data,n=Object.keys(t.data||{}).filter(function(t){return 0!==t.indexOf("_")}).map(function(t){return+t+""===t?+t:t}),s=this;h.extend(this,e),this._keys=n,this._up=t.up,this._top=t.top||this,this._namespace=t.namespace||"",n.forEach(function(t){i(s,t,e[t])}),(Array.isArray(e)||e instanceof a)&&(this.length=r(n))}function a(t){o.call(this,t)}var h=n(1);h.extend(o.prototype,{$namespace:function(t){for(var e=[],n=this;void 0!=n;n=n._up)n._namespace&&e.unshift(n._namespace);return t&&e.push(t),e.join(".")},$key:function(){var t=this._namespace;return+t+""===t?+t:t},$up:function(){return this._up},$set:function(t,e){if("object"==typeof t){var n=this;Object.keys(t).forEach(function(e){n.$set(e,t[e])})}else{var s=this[t];i(this,t,e),this.$change(this.$namespace(t),this[t],s)}return this},$get:function(){var t,e=this._keys,n=this;return t=this instanceof o?{}:[],e.forEach(function(e){t[e]=n[e].$get?n[e].$get():n[e]}),t},$change:function(t,e,n,i){this._top.$emit&&this._top.$emit("data:"+t,e,n,i)}}),h.extend(a.prototype,o.prototype,{push:function(t){t=h.slice.call(arguments,0);for(var e=[],n=0,s=t.length;s>n;n++)i(this,this.length,t[n]),this._keys.push(this.length),e.push(this[this.length]),this.length++;return this.$change(this.$namespace(),this,null,{method:"push",res:e,args:t}),this},pop:function(){var t=this[--this.length];return delete this[this.length],this._keys.pop(),this.$change(this.$namespace(),this),t},unshift:function(t){this._keys.push(this.length),this.length++;for(var e=this.length;e--;)this[e]=this[e-1],"object"==typeof this[e]&&(this[e]._namespace=e+"");return i(this,0,t),this.$change(this.$namespace(),this),this},shift:function(){this.length--;for(var t=this[0],e=0,n=this.length;n>e;e++)this[e]=this[e+1],"object"==typeof this[e]&&(this[e]._namespace=e+"");return this._keys.pop(),delete this[this.length],this.$change(this.$namespace(),this),t},touch:function(t){this.$change(this.$namespace(t),this)},indexOf:function(t){if(t._up===this){var e=+t._namespace;if(this[e]===t)return e}else if("object"!=typeof t)for(var e=0,n=this.length;n>e;e++)if(this[e]===t)return e;return-1},splice:function(t,e){for(var n={method:"splice",args:[t,e]},i=0,s=e+t,r=this.length-e;r>t;t++,i++)this[t]=this[s+i],"object"==typeof this[t]&&(this[t]._namespace=t+"");for(;te;e++)t(this[e],e)},filter:function(t){var e=[];return this.forEach(function(n,i){t(n)&&e.push(n)}),e}}),t.exports=o},function(t,e,n){function i(t,e,n){n=n||this;var s=this._events[t];if(s){var o=0;s=s.length>1?r.slice.call(s,0):s;for(var a=s.length;a>o;o++)s[o].apply(n,e)}t.indexOf("data:")&&t.indexOf("hook:")&&this.$parent&&i.call(this.$parent,t,e,n)}function s(t,e){var n,s,o=t.split("."),a={_events:this._watchers};for(i.call(a,t,e);o.length>0;)t=o.join("."),n=t+"**deep**",s=r.slice.call(e,0,1),s[0]=this.data(t),i.call(a,n,s),o.pop();i.call(a,"**deep**",[this])}var r=(n(8),n(1));t.exports={emit:i,callDataChange:s}},function(t,e,n){function i(t,e,n){~e.indexOf(".")?(e=o.exec(e),t.data(e[1]).$set(e[2],n)):t.$set(e,n)}var s=n(1),r=n(7),o=/^(.*)\.([\w\-]+)$/;t.exports={show:function(t){var e=this.el;e.style.display=t?"block":"none"},"class":function(t){var e=this.el,n=this.arg;n?t?s.addClass(e,n):s.removeClass(e,n):(this.lastVal&&s.removeClass(e,this.lastVal),t&&(s.addClass(e,t),this.lastVal=t))},value:function(t){var e=this.el;"checkbox"===e.type?e.checked=t:e.value=t},attr:function(t){if(void 0!==t){var e=this.arg,n=this.el;if("style"===e)if("object"==typeof t)for(var i in t)t.hasOwnProperty(i)&&(n.style[i]=t[i]);else n.setAttribute(e,t);else e in n?n[e]=t:n.setAttribute(e,t)}},text:function(t){void 0!==t&&(this.el.textContent=null==t?"":t.toString())},html:function(t){this.el.innerHTML=t&&t.toString()||""},on:{bind:function(){var t=this,e=this.target,n=this.param,i=this.filters,r=this.vm,o=r.applyFilters(this.vm[e],i),a=n&&~n.indexOf("this")&&t.data();s.add(this.el,this.arg,function(t){if(!o||"function"!=typeof o)return s.warn("You need implement the "+e+" method.");var i=[];n?n.forEach(function(e){"e"===e?i.push(t):"this"===e&&i.push(a)}):i.push(t),o.apply(r,i)})}},model:{bind:function(){var t=this.target,e=this.namespace||"",n=this.el,i=this.vm,r=i.data(e),o=!1;s.add(n,"input propertychange change",function(e){o||r.$set(t,n.value)},i),s.add(n,"compositionstart",function(t){o=!0}),s.add(n,"compositionend",function(t){o=!1})},update:function(t){this.el.value=t}},vm:{bind:function(){this.el.removeAttribute("q-vm"),this.setting.stop=!0;var t,e,n=this.target,s=this.vm,o=this.el,a=o.getAttribute("q-ref")||!1,h=o.getAttribute("q-with")||"",c=o.getAttribute("q-extend"),u=this.namespace,l=u?[u,h].join("."):h,f=s.data(l),p=s.constructor.require(n),d=p.options.data;if(d&&Object.keys(d).forEach(function(t){t in f||f.$set(t,d[t])}),t={el:o,data:f.$get(),_parent:s},c&&(c=s.$options.extend[c])){if(c.data||c.el||c._parent)throw new Error("Extend Error");t=r.mergeOptions(t,c)}e=new p(t),s._children.push(e),a&&!function(){var t=s.$[a];t?t.length?t.push(e):s.$[a]=[t,e]:s.$[a]=e}();var m=!1,v=!1;s.$on("datachange",function(t,n,r,o){if(this===e)if(m)m=!1;else{v=!0;var a=l?[l,t].join("."):t;o?s[a][o.method].apply(s[a],o.args):i(s,a,n)}else if(this===s)if(v)v=!1;else if(!l||!t.indexOf(l)){m=!0;var h,c=l.length;c&&(c+=1),h=t.substring(c,t.length),o?e[h][o.method].apply(e[h],o.args):i(e,h,n)}})}},"if":{bind:function(){if(this.el.parentNode){var t=this.el,e=t.parentNode,n=document.createComment("q-if"),i=!1,s=!0,r=this.target,o=this.namespace,a=o?[o,r].join("."):r,h=this.filters,c=this.data(),u=this.vm;this.setting.stop=!0,u.$watch(a,function(r,a){r=u.applyFilters(r,h,a),i||r!==!0||(i=!0,u._templateBind(t,{data:c,namespace:o,immediate:!0})),r!==s&&(r===!0?(e.replaceChild(t,n),s=r):r===!1&&(e.replaceChild(n,t),s=r))},!1,!0)}}},el:{bind:function(){this.vm.$$[this.target]=this.el}},repeat:n(11)}},function(t,e,n){function i(t,e,n,i){var s,r,o,a,h=e.length;Object.keys(t).forEach(function(c){~c.indexOf(e)&&(s=c.substring(h+1),r=s.split("."),r.length&&(o=+r.shift(),(o-=i)>=n&&(r.unshift(o),r.unshift(e),a=r.join("."),t[a]=t[c],delete t[c])))})}var s=n(1);methods={"default":{clean:function(t,e){e.length&&(e.forEach(function(e){e.parentNode===t&&t.removeChild(e)}),s.cleanData(e),e.length=0)},insert:function(t,e,n){t.insertBefore(e,n)}},push:{insert:function(t,e,n){t.insertBefore(e,n)},dp:function(t,e){return e.res}},splice:{clean:function(t,e,n,s){var r=n[0],o=n[1],a=n[2].$namespace(),h=e.splice(r,o);return h.forEach(function(e){t.removeChild(e)}),n.done||(i(s,a,r,o),n.done=!0),!0},dp:function(t,e){return e.args.push(t),e.args}}},e.bind=function(){var t,e,n,i,r,o,a,h=this.el,c=this.setting,u=h.parentNode;u&&!c.stop&&(c.stop=!0,t=this.target,e=this.namespace,n=e?[e,t].join("."):t,i=this.filters,r=[],o=document.createComment("q-repeat"),a=this.vm,u.replaceChild(o,h),a.$watch(n,function(t,e,c){if(t=a.applyFilters(t,i),void 0!==t){var l=!i.length&&c?c.method:"default",f=(methods[l]||{}).dp,p=(methods[l]||{}).clean,d=(methods[l]||{}).insert;if(f&&(t=f(t,c)),!p||p(u,r,t,a._watchers,n)!==!0){var m,v=document.createDocumentFragment();t.forEach(function(t,e){m=s.clone(h),a._templateBind(m,{data:t,namespace:t.$namespace(),immediate:!0,useCache:!0}),r.push(m),v.appendChild(m)}),d&&d(u,v,o),a.$emit("repeat-render")}}},!1,!0))}},function(t,e,n){var i=n(13),s=n(1);t.exports=function(t,e){e=e||{};var n=this,r=n.$options.directives,o=(e.index,e.data||n,e.namespace);s.walk([t],function(t,a,h){a.forEach(function(a){var c=a.name.substring(2),u=r[c],l=i(a.value);u&&l.forEach(function(i){var r=n._makeReadFilters(i.filters),a=i.target,c=o?[o,a].join("."):a,l=s.isObject(u)?u.update:u,f=s.extend({el:t,vm:n,data:function(t){var e=[];return o&&e.push(o),t&&e.push(t),n.data(e.join("."))},namespace:o,setting:h},i,{filters:r}),p=f.data(a);l&&n.$watch(c,function(t,e){t=n.applyFilters(t,r,e),l.call(f,t,e)},"object"==typeof p,"boolean"==typeof e.immediate?e.immediate:void 0!==p),s.isObject(u)&&u.bind&&u.bind.call(f)})})},{useCache:e.useCache})}},function(t,e,n){function i(t){var e=t,n=r.get(e);if(n)return n;for(var i,h,c,u=[],l=o.length,f=!1,p={filter:!1,token:{filters:[]}};t.length;){for(h=0;l>h;h++)if(i=o[h][0].exec(t)){f=!0,c=o[h][1],c&&c(i,p,u),t=t.replace(o[h][0],""),p.filter&&(i=a.exec(t),s(i[0].trim(),p.token),t=t.replace(a,""),p.filter=!1);break}if(!f)throw new Error("Syntax error at: "+t);f=!1}return u.push(p.token),r.put(e,u),u}function s(t,e){for(var n,i=h.length,s=!1;t.length;){for(n=0;i>n;n++)if(captures=h[n][0].exec(t)){s=!0,foo=h[n][1],foo&&foo(captures,e.filters),t=t.replace(h[n][0],"");break}if(!s)throw new Error("Syntax error at: "+t);s=!1}}var r=new(n(2))(1e3),o=[[/^ +/],[/^([\w\-]+):/,function(t,e){e.token.arg=t[1]}],[/^([\w]+)\((.+?)\)/,function(t,e){e.token.target=t[1],e.token.param=t[2].split(/ *, */)}],[/^([\w\-\.]+)/,function(t,e){e.token.target=t[1]}],[/^(?=\|)/,function(t,e){e.filter=!0}],[/^,/,function(t,e,n){n.push(e.token),e.token={filters:[]}}]],a=/^(.+?)(?=,|$)/,h=[[/^ +/],[/^\| *([\w\-\!]+)/,function(t,e){e.push([t[1]])}],[/^(['"])(((\\['"])?([^\1])*)+)\1/,function(t,e){e[e.length-1].push(t[3])}],[/^([\w\-]+)/,function(t,e){e[e.length-1].push(t[1])}]];t.exports=i}])}); \ No newline at end of file