intact-vue
Advanced tools
Comparing version 0.5.7 to 0.5.8
@@ -794,3 +794,3 @@ 'use strict'; | ||
// options.mounted = [ | ||
// activeInstance ? | ||
// activeInstance ? | ||
// () => { | ||
@@ -877,2 +877,5 @@ // this.$nextTick(this.mount); | ||
// should update elm of vnode of Vue to let Vue hanlde dom correctly | ||
this.$vnode.elm = element; | ||
return element; | ||
@@ -879,0 +882,0 @@ }; |
@@ -796,3 +796,3 @@ (function (global, factory) { | ||
// options.mounted = [ | ||
// activeInstance ? | ||
// activeInstance ? | ||
// () => { | ||
@@ -879,2 +879,5 @@ // this.$nextTick(this.mount); | ||
// should update elm of vnode of Vue to let Vue hanlde dom correctly | ||
this.$vnode.elm = element; | ||
return element; | ||
@@ -881,0 +884,0 @@ }; |
@@ -1,1 +0,1 @@ | ||
(function(t,e){typeof exports==="object"&&typeof module!=="undefined"?module.exports=e(require("vue"),require("intact/dist")):typeof define==="function"&&define.amd?define(["vue","intact/dist"],e):t.Intact=e(t.Vue,t.Intact)})(this,function(t,e){"use strict";t=t&&t.hasOwnProperty("default")?t["default"]:t;e=e&&e.hasOwnProperty("default")?e["default"]:e;var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol==="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};var a=function(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}};var s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){t[n]=r[n]}}}return t};var r=function(t,e){if(typeof e!=="function"&&e!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof e)}t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}});if(e)Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e};var u=function(t,e){var r={};for(var n in t){if(e.indexOf(n)>=0)continue;if(!Object.prototype.hasOwnProperty.call(t,n))continue;r[n]=t[n]}return r};var f=function(t,e){if(!t){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e&&(typeof e==="object"||typeof e==="function")?e:t};var i=e.Vdt.miss;var o=i.h;var l=i.hooks;var c=i.config;var p=e.utils;var v=p.get;var d=p.set;var I=p.extend;var S=p.isArray;var h=p.create;var A=p.hasOwn;var y=t.prototype._v("");var _=y.constructor;if(l){l.beforeInsert=function(t){var e=t.dom;var r=t.parentVNode;var n=void 0;var i=void 0;while(r){if((n=r.tag)&&n.cid==="IntactVue"&&(n=r.children.$options)){if((n=i=n.parent)&&(n=n.$options)&&(n=n._scopeId)){e.setAttribute(n,"")}if(i){r=i.$parent;while(r){if((n=r.$options)&&(n=n._scopeId)){e.setAttribute(n,"")}r=r.$parent}}break}else{r=r.parentVNode}}}}if(c){c.disableDelegate=true}t.mixin({beforeCreate:function t(){if(!this.$parent&&this.$vnode){this.$parent=this.$vnode.context}}});function w(t){var e=function e(t){if(S(t)){var r=[];t.forEach(function(t){if(S(t)){r.push.apply(r,e(t))}else{r.push(m(t))}});return r}return m(t)};var r=e(t);if(Array.isArray(r)){var n=r.length;return n===0?undefined:n===1?r[0]:r}return r}function m(t){if(t==null)return t;var e=typeof t==="undefined"?"undefined":n(t);if(e==="string"||e==="number")return t;if(t.type)return t;if(t.text!==undefined){return t.text}if(D(t)){var r=t.componentOptions;t=o(r.Ctor,g(t),null,null,t.key,t.ref)}else{t=o(k,{vueVNode:t},null,P(t),t.key)}t._isVue=true;return t}function g(t){var e=t.componentOptions;var r=t.data;var n=r.attrs;var i=e.Ctor.propTypes;var a={};if(n){for(var o in n){if(~["staticClass","class","style","staticStyle"].indexOf(o))continue;var s=n[o];if(i){var u=G(o);if(A.call(i,u)){o=u;var f=void 0;if(((f=i[o])===Boolean||f&&(S(f)&&f.indexOf(Boolean)>-1||f.type===Boolean||S(f.type)&&f.type.indexOf(Boolean)>-1))&&(s===""||s===o)){s=true}}}a[o]=s}}var l=P(t);if(l!==undefined){a.className=l}var c=j(t);if(c!==undefined){a.style=c}if(t.key){a.key=t.key}else if(r.key){a.key=r.key}var p=r.scopedSlots;if(p){var v=a._blocks?a._blocks:a._blocks={};var d=function t(i){v[i]=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++){r[n-1]=arguments[n]}return w(p[i].apply(this,r))}};for(var h in p){d(h)}}var y=r.model;if(y){a.value=y.value;a["v-model"]=y.expression}if(r.directives){var _=r.directives;for(var m=0;m<_.length;m++){var g=_[m];if(g.name==="model"){a.value=g.value;a["v-model"]=g.expression;break}else if(g.name==="show"&&!g.value){if(a.style){a.style.display="none"}else{a.style={display:"none"}}}}}M(t,a);var b=e.listeners;if(b){var $=function t(e){var n=b[e];var r=n;if(e==="input"){e="$change:value";r=function t(e,r){return n(r)}}else if(e.substr(0,7)==="update:"){var i=e.substr(7);if(i.indexOf("-")>-1)return"continue";e="$change:"+i;r=function t(e,r){return n(r)}}var o="ev-"+G(e);if(a[o]){a[o]=[a[o],r]}else{a[o]=r}x=e};for(var x in b){var O=$(x);if(O==="continue")continue}}var k=t.slots||R(e.children);var N=T(k),V=N.children,C=N._blocks;a.children=V;if(a._blocks){I(a._blocks,C)}else{a._blocks=C}Q(t,a);return a}function Q(t,e){var n=t.context;e._context={data:{get:function t(e){if(e!=null){return v(n,e)}else{return n.$data}},set:function t(e,r){d(n,e,r)},$router:v(n,"_routerRoot._router")}}}function T(t){var e=t.default,r=u(t,["default"]);var n=void 0;if(r){n={};var i=function t(e){n[e]=function(){return w(r[e])}};for(var o in r){i(o)}}return{children:w(e),_blocks:n}}function b(t,e,r){var n={};var i={attrs:n};var o=e.props;for(var a in o){if(~["children","_context","className","style","ref","key"].indexOf(a))continue;n[a]=o[a]}if(e.ref){i.ref=r.data.ref}if(o.className){i.staticClass=o.className}if(e.props.style){i.staticStyle=o.style}if(e.key!=null){i.key=o.key}var s=o.children;if(s&&!Array.isArray(s)){s=[s]}return t(e.tag,i,s)}function $(o){function t(t){return o(t)}t.options={functional:true,render:function t(e,r){var n=g({componentOptions:{Ctor:o,listeners:r.listeners},data:r.data,slots:r.slots(),context:r.parent});var i=o(n,true);if(S(i)){return i.map(function(t){return b(e,t,r)})}return b(e,i,r)}};t.cid="IntactFunctionalComponent";return t}var x=/_ev[A-Z]/;var O=t.prototype.__patch__;var k=function(){function t(){a(this,t)}t.prototype.init=function t(e,r){this.destroyed=true;this._addProps(r);return O(null,r.props.vueVNode,false,false,this.parentDom)};t.prototype.update=function t(e,r){this._addProps(r);return O(e.props.vueVNode,r.props.vueVNode,false,false,this.parentDom)};t.prototype.destroy=function t(e){O(e.props.vueVNode,null)};t.prototype._addProps=function t(e){this.vdt={vNode:e};var r=e.props;var n=r.vueVNode;if(n.elm){n=z(n)}for(var i in r){if(i==="vueVNode")continue;if(x.test(i))continue;if(!n.data)n.data={};var o=n.data;var a=r[i];if(i==="className"){o.staticClass=a;delete o.class}else if(i==="style"){if(o.staticStyle){o.staticStyle=s({},o.staticStyle,a)}else{o.staticStyle=a}}else if(i.substr(0,3)==="ev-"){if(!o.on)o.on={};o.on[i.substr(3)]=a}else{if(!o.attrs)o.attrs={};o.attrs[i]=a}}e.props=s({},r,{vueVNode:n})};return t}();function M(n,t){var i=n.data.ref;if(i){var o=n.context.$refs;t.ref=function(t,e){if(!o)return;if(!e){if(n.data.refInFor){if(!S(o[i])){o[i]=[t]}else if(o[i].indexOf(t)<0){o[i].push(t)}}else{o[i]=t}}else{if(S(o[i])){var r=o[i].indexOf(t);if(~r){o[i].splice(r,1)}}else{o[i]=undefined}}};t.ref.key=i}}function P(t){var e=void 0;var r=t.data;if(r){if(r.staticClass){e=r.staticClass}if(r.class){if(!e){e=N(r.class)}else{e+=" "+N(r.class)}}}return e}function N(t){if(t==null)return"";if(S(t)){return V(t)}if((typeof t==="undefined"?"undefined":n(t))==="object"){return C(t)}if(typeof t==="string"){return t}return""}function V(t){var e="";var r=void 0;for(var n=0;n<t.length;n++){if((r=N(t[n]))!=null&&r!==""){if(e)e+=" ";e+=r}}return e}function C(t){var e="";for(var r in t){if(t[r]){if(e)e+=" ";e+=r}}return e}function j(t){var e=void 0;var r=t.data;if(r){e=E(r.style);if(r.staticStyle){return I(r.staticStyle,e)}}return e}function E(t){if(!t)return t;if(S(t)){return F(t)}if(typeof t==="string"){return q(t)}return t}function F(t){var e={};for(var r=0;r<t.length;r++){if(t[r]){I(e,t[r])}}return e}var B=h(null);function q(t){var e=B[t];if(e)return e;var r={};var n=/;(?![^(]*\))/g;var i=/:(.+)/;t.split(n).forEach(function(t){if(t){var e=t.split(i);e.length>1&&(r[e[0].trim()]=e[1].trim())}});B[t]=r;return r}function D(t){var e=t.data;return e&&(e=e.hook)&&(e=e.init)&&t.componentOptions.Ctor.cid==="IntactVue"}function R(t){var e={};if(!t){return e}for(var r=0,n=t.length;r<n;r++){var i=t[r];var o=i.data;if(o&&o.attrs&&o.attrs.slot){delete o.attrs.slot}if(o&&o.slot!=null){var a=o.slot;var s=e[a]||(e[a]=[]);if(i.tag==="template"){s.push.apply(s,i.children||[])}else{s.push(i)}}else{(e.default||(e.default=[])).push(i)}}for(var u in e){if(e[u].every(U)){delete e[u]}}return e}function U(t){return t.isComment&&!t.asyncFactory||t.text===" "}function z(t){var e=new _(t.tag,t.data?s({},t.data):t.data,t.children&&t.children.slice(),t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);e.ns=t.ns;e.isStatic=t.isStatic;e.key=t.key;e.isComment=t.isComment;e.fnContext=t.fnContext;e.fnOptions=t.fnOptions;e.fnScopeId=t.fnScopeId;e.asyncMeta=t.asyncMeta;e.isCloned=true;return e}function W(r){var n=Object.create(null);return function(t){var e=n[t];return e||(n[t]=r(t))}}var Z=/-(\w)/g;var G=W(function(t){return t.replace(Z,function(t,e){return e?e.toUpperCase():""})});var H=t.prototype;var J=H.init;var K=H.$nextTick;var L=H._updateFromParent;var X=e.utils.extend;var Y=void 0;var tt=void 0;var et=function(s){r(o,s);function o(t){a(this,o);var e=t&&t._parentVnode;if(e){var r=m(e);var n=f(this,s.call(this,r.props));t._renderChildren=true;n.$options=t;n.$vnode=e;n._isVue=true;n.$scopedSlots={$stable:true};n.vNode=r;r.children=n;var i=t.parent;if(i){n.$parent=i;n.$root=i.$root;i.$children.push(n)}n.$children=[];n._data=n.props;n.$refs={};n._uid=n.uniqueId;t.name=n.displayName||n.constructor.name}else{var n=f(this,s.call(this,t))}return f(n)}o.prototype.init=function t(r,n){var i=this;var t=function t(){i.__pushActiveInstance();var e=s.prototype.init.call(i,r,n);i.__popActiveInstance();return e};if(!this._isVue)return t();tt=this.mountedQueue;var e=t();return e};o.prototype.update=function t(r,n,i){var o=this;var t=function t(){o.__pushActiveInstance();var e=s.prototype.update.call(o,r,n,i);o.__popActiveInstance();return e};if(!this._isVue)return t();var e=this._shouldTrigger;this.__initMountedQueue();var a=t();this.__triggerMountedQueue();this._shouldTrigger=e;return a};o.prototype.$mount=function t(e,r){var n=this;var i=this._shouldTrigger;this.__initMountedQueue();this.parentVNode=this.vNode.parentVNode=Y&&Y.vNode;this.inited=true;this.$el=this.init(null,this.vNode);this.vNode.dom=this.$el;this._vnode={};var o=this.$options;var a=o._refElm;var s=o._parentElm;if(s){if(a){s.insertBefore(this.$el,a)}else{s.appendChild(this.$el)}}this.$el.__vue__=this;this.mountedQueue.push(function(){n.mount()});this.__triggerMountedQueue();this._shouldTrigger=i};o.prototype.$forceUpdate=function t(){var e=this._shouldTrigger;this.__initMountedQueue();var r=m(this.$vnode);var n=this.vNode;r.children=this;this.vNode=r;this.parentVNode=this.vNode.parentVNode=Y&&Y.vNode;this.$vnode.elm=this.update(n,r);this.$options._renderChildren=true;var i=n.ref;var o=r.ref;if(i!==o&&!(i&&o&&i.key===o.key)){if(i){i(this,true)}if(o){o(this)}}this.__triggerMountedQueue();this._shouldTrigger=e};o.prototype.$destroy=function t(){delete this.$el.__vue__;var e=this.$parent;if(e){var r=e.$children;if(r.length){var n=r.indexOf(this);if(~n){r.splice(n,1)}}}this.destroy()};o.prototype.__initMountedQueue=function t(){this._shouldTrigger=false;if(!tt||tt.done){this._shouldTrigger=true;if(!this.mountedQueue||this.mountedQueue.done){this._initMountedQueue()}tt=this.mountedQueue}else{this.mountedQueue=tt}};o.prototype.__triggerMountedQueue=function t(){if(this._shouldTrigger){if(this.mounted){this._triggerMountedQueue()}else{this.$options.mounted=[this._triggerMountedQueue]}tt=null;this._shouldTrigger=false}};o.prototype.__pushActiveInstance=function t(){this._prevActiveInstance=Y;Y=this};o.prototype.__popActiveInstance=function t(){Y=this._prevActiveInstance;this._prevActiveInstance=null};o.prototype.$on=function t(){};o.prototype.$off=function t(){};return o}(e);et.cid="IntactVue";et.options=X({},t.options);et.functionalWrapper=$;et.normalize=w;et.prototype.$nextTick=K;et.prototype._updateFromParent=L;if(!Object.setPrototypeOf){X(et,e);if(!et.template){et.template=e.template}}return et}); | ||
(function(t,e){typeof exports==="object"&&typeof module!=="undefined"?module.exports=e(require("vue"),require("intact/dist")):typeof define==="function"&&define.amd?define(["vue","intact/dist"],e):t.Intact=e(t.Vue,t.Intact)})(this,function(t,e){"use strict";t=t&&t.hasOwnProperty("default")?t["default"]:t;e=e&&e.hasOwnProperty("default")?e["default"]:e;var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol==="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};var a=function(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}};var s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){t[n]=r[n]}}}return t};var r=function(t,e){if(typeof e!=="function"&&e!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof e)}t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}});if(e)Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e};var u=function(t,e){var r={};for(var n in t){if(e.indexOf(n)>=0)continue;if(!Object.prototype.hasOwnProperty.call(t,n))continue;r[n]=t[n]}return r};var f=function(t,e){if(!t){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e&&(typeof e==="object"||typeof e==="function")?e:t};var i=e.Vdt.miss;var o=i.h;var l=i.hooks;var c=i.config;var p=e.utils;var v=p.get;var d=p.set;var I=p.extend;var S=p.isArray;var h=p.create;var A=p.hasOwn;var y=t.prototype._v("");var _=y.constructor;if(l){l.beforeInsert=function(t){var e=t.dom;var r=t.parentVNode;var n=void 0;var i=void 0;while(r){if((n=r.tag)&&n.cid==="IntactVue"&&(n=r.children.$options)){if((n=i=n.parent)&&(n=n.$options)&&(n=n._scopeId)){e.setAttribute(n,"")}if(i){r=i.$parent;while(r){if((n=r.$options)&&(n=n._scopeId)){e.setAttribute(n,"")}r=r.$parent}}break}else{r=r.parentVNode}}}}if(c){c.disableDelegate=true}t.mixin({beforeCreate:function t(){if(!this.$parent&&this.$vnode){this.$parent=this.$vnode.context}}});function w(t){var e=function e(t){if(S(t)){var r=[];t.forEach(function(t){if(S(t)){r.push.apply(r,e(t))}else{r.push(m(t))}});return r}return m(t)};var r=e(t);if(Array.isArray(r)){var n=r.length;return n===0?undefined:n===1?r[0]:r}return r}function m(t){if(t==null)return t;var e=typeof t==="undefined"?"undefined":n(t);if(e==="string"||e==="number")return t;if(t.type)return t;if(t.text!==undefined){return t.text}if(D(t)){var r=t.componentOptions;t=o(r.Ctor,g(t),null,null,t.key,t.ref)}else{t=o(k,{vueVNode:t},null,P(t),t.key)}t._isVue=true;return t}function g(t){var e=t.componentOptions;var r=t.data;var n=r.attrs;var i=e.Ctor.propTypes;var a={};if(n){for(var o in n){if(~["staticClass","class","style","staticStyle"].indexOf(o))continue;var s=n[o];if(i){var u=G(o);if(A.call(i,u)){o=u;var f=void 0;if(((f=i[o])===Boolean||f&&(S(f)&&f.indexOf(Boolean)>-1||f.type===Boolean||S(f.type)&&f.type.indexOf(Boolean)>-1))&&(s===""||s===o)){s=true}}}a[o]=s}}var l=P(t);if(l!==undefined){a.className=l}var c=j(t);if(c!==undefined){a.style=c}if(t.key){a.key=t.key}else if(r.key){a.key=r.key}var p=r.scopedSlots;if(p){var v=a._blocks?a._blocks:a._blocks={};var d=function t(i){v[i]=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++){r[n-1]=arguments[n]}return w(p[i].apply(this,r))}};for(var h in p){d(h)}}var y=r.model;if(y){a.value=y.value;a["v-model"]=y.expression}if(r.directives){var _=r.directives;for(var m=0;m<_.length;m++){var g=_[m];if(g.name==="model"){a.value=g.value;a["v-model"]=g.expression;break}else if(g.name==="show"&&!g.value){if(a.style){a.style.display="none"}else{a.style={display:"none"}}}}}M(t,a);var b=e.listeners;if(b){var $=function t(e){var n=b[e];var r=n;if(e==="input"){e="$change:value";r=function t(e,r){return n(r)}}else if(e.substr(0,7)==="update:"){var i=e.substr(7);if(i.indexOf("-")>-1)return"continue";e="$change:"+i;r=function t(e,r){return n(r)}}var o="ev-"+G(e);if(a[o]){a[o]=[a[o],r]}else{a[o]=r}x=e};for(var x in b){var O=$(x);if(O==="continue")continue}}var k=t.slots||R(e.children);var N=T(k),V=N.children,C=N._blocks;a.children=V;if(a._blocks){I(a._blocks,C)}else{a._blocks=C}Q(t,a);return a}function Q(t,e){var n=t.context;e._context={data:{get:function t(e){if(e!=null){return v(n,e)}else{return n.$data}},set:function t(e,r){d(n,e,r)},$router:v(n,"_routerRoot._router")}}}function T(t){var e=t.default,r=u(t,["default"]);var n=void 0;if(r){n={};var i=function t(e){n[e]=function(){return w(r[e])}};for(var o in r){i(o)}}return{children:w(e),_blocks:n}}function b(t,e,r){var n={};var i={attrs:n};var o=e.props;for(var a in o){if(~["children","_context","className","style","ref","key"].indexOf(a))continue;n[a]=o[a]}if(e.ref){i.ref=r.data.ref}if(o.className){i.staticClass=o.className}if(e.props.style){i.staticStyle=o.style}if(e.key!=null){i.key=o.key}var s=o.children;if(s&&!Array.isArray(s)){s=[s]}return t(e.tag,i,s)}function $(o){function t(t){return o(t)}t.options={functional:true,render:function t(e,r){var n=g({componentOptions:{Ctor:o,listeners:r.listeners},data:r.data,slots:r.slots(),context:r.parent});var i=o(n,true);if(S(i)){return i.map(function(t){return b(e,t,r)})}return b(e,i,r)}};t.cid="IntactFunctionalComponent";return t}var x=/_ev[A-Z]/;var O=t.prototype.__patch__;var k=function(){function t(){a(this,t)}t.prototype.init=function t(e,r){this.destroyed=true;this._addProps(r);return O(null,r.props.vueVNode,false,false,this.parentDom)};t.prototype.update=function t(e,r){this._addProps(r);return O(e.props.vueVNode,r.props.vueVNode,false,false,this.parentDom)};t.prototype.destroy=function t(e){O(e.props.vueVNode,null)};t.prototype._addProps=function t(e){this.vdt={vNode:e};var r=e.props;var n=r.vueVNode;if(n.elm){n=z(n)}for(var i in r){if(i==="vueVNode")continue;if(x.test(i))continue;if(!n.data)n.data={};var o=n.data;var a=r[i];if(i==="className"){o.staticClass=a;delete o.class}else if(i==="style"){if(o.staticStyle){o.staticStyle=s({},o.staticStyle,a)}else{o.staticStyle=a}}else if(i.substr(0,3)==="ev-"){if(!o.on)o.on={};o.on[i.substr(3)]=a}else{if(!o.attrs)o.attrs={};o.attrs[i]=a}}e.props=s({},r,{vueVNode:n})};return t}();function M(n,t){var i=n.data.ref;if(i){var o=n.context.$refs;t.ref=function(t,e){if(!o)return;if(!e){if(n.data.refInFor){if(!S(o[i])){o[i]=[t]}else if(o[i].indexOf(t)<0){o[i].push(t)}}else{o[i]=t}}else{if(S(o[i])){var r=o[i].indexOf(t);if(~r){o[i].splice(r,1)}}else{o[i]=undefined}}};t.ref.key=i}}function P(t){var e=void 0;var r=t.data;if(r){if(r.staticClass){e=r.staticClass}if(r.class){if(!e){e=N(r.class)}else{e+=" "+N(r.class)}}}return e}function N(t){if(t==null)return"";if(S(t)){return V(t)}if((typeof t==="undefined"?"undefined":n(t))==="object"){return C(t)}if(typeof t==="string"){return t}return""}function V(t){var e="";var r=void 0;for(var n=0;n<t.length;n++){if((r=N(t[n]))!=null&&r!==""){if(e)e+=" ";e+=r}}return e}function C(t){var e="";for(var r in t){if(t[r]){if(e)e+=" ";e+=r}}return e}function j(t){var e=void 0;var r=t.data;if(r){e=E(r.style);if(r.staticStyle){return I(r.staticStyle,e)}}return e}function E(t){if(!t)return t;if(S(t)){return F(t)}if(typeof t==="string"){return q(t)}return t}function F(t){var e={};for(var r=0;r<t.length;r++){if(t[r]){I(e,t[r])}}return e}var B=h(null);function q(t){var e=B[t];if(e)return e;var r={};var n=/;(?![^(]*\))/g;var i=/:(.+)/;t.split(n).forEach(function(t){if(t){var e=t.split(i);e.length>1&&(r[e[0].trim()]=e[1].trim())}});B[t]=r;return r}function D(t){var e=t.data;return e&&(e=e.hook)&&(e=e.init)&&t.componentOptions.Ctor.cid==="IntactVue"}function R(t){var e={};if(!t){return e}for(var r=0,n=t.length;r<n;r++){var i=t[r];var o=i.data;if(o&&o.attrs&&o.attrs.slot){delete o.attrs.slot}if(o&&o.slot!=null){var a=o.slot;var s=e[a]||(e[a]=[]);if(i.tag==="template"){s.push.apply(s,i.children||[])}else{s.push(i)}}else{(e.default||(e.default=[])).push(i)}}for(var u in e){if(e[u].every(U)){delete e[u]}}return e}function U(t){return t.isComment&&!t.asyncFactory||t.text===" "}function z(t){var e=new _(t.tag,t.data?s({},t.data):t.data,t.children&&t.children.slice(),t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);e.ns=t.ns;e.isStatic=t.isStatic;e.key=t.key;e.isComment=t.isComment;e.fnContext=t.fnContext;e.fnOptions=t.fnOptions;e.fnScopeId=t.fnScopeId;e.asyncMeta=t.asyncMeta;e.isCloned=true;return e}function W(r){var n=Object.create(null);return function(t){var e=n[t];return e||(n[t]=r(t))}}var Z=/-(\w)/g;var G=W(function(t){return t.replace(Z,function(t,e){return e?e.toUpperCase():""})});var H=t.prototype;var J=H.init;var K=H.$nextTick;var L=H._updateFromParent;var X=e.utils.extend;var Y=void 0;var tt=void 0;var et=function(s){r(o,s);function o(t){a(this,o);var e=t&&t._parentVnode;if(e){var r=m(e);var n=f(this,s.call(this,r.props));t._renderChildren=true;n.$options=t;n.$vnode=e;n._isVue=true;n.$scopedSlots={$stable:true};n.vNode=r;r.children=n;var i=t.parent;if(i){n.$parent=i;n.$root=i.$root;i.$children.push(n)}n.$children=[];n._data=n.props;n.$refs={};n._uid=n.uniqueId;t.name=n.displayName||n.constructor.name}else{var n=f(this,s.call(this,t))}return f(n)}o.prototype.init=function t(r,n){var i=this;var t=function t(){i.__pushActiveInstance();var e=s.prototype.init.call(i,r,n);i.__popActiveInstance();return e};if(!this._isVue)return t();tt=this.mountedQueue;var e=t();return e};o.prototype.update=function t(r,n,i){var o=this;var t=function t(){o.__pushActiveInstance();var e=s.prototype.update.call(o,r,n,i);o.__popActiveInstance();return e};if(!this._isVue)return t();var e=this._shouldTrigger;this.__initMountedQueue();var a=t();this.__triggerMountedQueue();this._shouldTrigger=e;this.$vnode.elm=a;return a};o.prototype.$mount=function t(e,r){var n=this;var i=this._shouldTrigger;this.__initMountedQueue();this.parentVNode=this.vNode.parentVNode=Y&&Y.vNode;this.inited=true;this.$el=this.init(null,this.vNode);this.vNode.dom=this.$el;this._vnode={};var o=this.$options;var a=o._refElm;var s=o._parentElm;if(s){if(a){s.insertBefore(this.$el,a)}else{s.appendChild(this.$el)}}this.$el.__vue__=this;this.mountedQueue.push(function(){n.mount()});this.__triggerMountedQueue();this._shouldTrigger=i};o.prototype.$forceUpdate=function t(){var e=this._shouldTrigger;this.__initMountedQueue();var r=m(this.$vnode);var n=this.vNode;r.children=this;this.vNode=r;this.parentVNode=this.vNode.parentVNode=Y&&Y.vNode;this.$vnode.elm=this.update(n,r);this.$options._renderChildren=true;var i=n.ref;var o=r.ref;if(i!==o&&!(i&&o&&i.key===o.key)){if(i){i(this,true)}if(o){o(this)}}this.__triggerMountedQueue();this._shouldTrigger=e};o.prototype.$destroy=function t(){delete this.$el.__vue__;var e=this.$parent;if(e){var r=e.$children;if(r.length){var n=r.indexOf(this);if(~n){r.splice(n,1)}}}this.destroy()};o.prototype.__initMountedQueue=function t(){this._shouldTrigger=false;if(!tt||tt.done){this._shouldTrigger=true;if(!this.mountedQueue||this.mountedQueue.done){this._initMountedQueue()}tt=this.mountedQueue}else{this.mountedQueue=tt}};o.prototype.__triggerMountedQueue=function t(){if(this._shouldTrigger){if(this.mounted){this._triggerMountedQueue()}else{this.$options.mounted=[this._triggerMountedQueue]}tt=null;this._shouldTrigger=false}};o.prototype.__pushActiveInstance=function t(){this._prevActiveInstance=Y;Y=this};o.prototype.__popActiveInstance=function t(){Y=this._prevActiveInstance;this._prevActiveInstance=null};o.prototype.$on=function t(){};o.prototype.$off=function t(){};return o}(e);et.cid="IntactVue";et.options=X({},t.options);et.functionalWrapper=$;et.normalize=w;et.prototype.$nextTick=K;et.prototype._updateFromParent=L;if(!Object.setPrototypeOf){X(et,e);if(!et.template){et.template=e.template}}return et}); |
{ | ||
"name": "intact-vue", | ||
"version": "0.5.7", | ||
"version": "0.5.8", | ||
"description": "A compatibility layer for running intact component in vue", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -38,3 +38,3 @@ import Vue from 'vue'; | ||
// options.mounted = [ | ||
// activeInstance ? | ||
// activeInstance ? | ||
// () => { | ||
@@ -50,3 +50,3 @@ // this.$nextTick(this.mount); | ||
this.$options = options; | ||
this.$vnode = parentVNode; | ||
this.$vnode = parentVNode; | ||
this._isVue = true; | ||
@@ -104,3 +104,3 @@ | ||
if (!this._isVue) return update(); | ||
if (!this._isVue) return update(); | ||
@@ -110,3 +110,3 @@ // maybe update in updating | ||
this.__initMountedQueue(); | ||
const element = update(); | ||
@@ -117,2 +117,5 @@ | ||
// should update elm of vnode of Vue to let Vue hanlde dom correctly | ||
this.$vnode.elm = element; | ||
return element; | ||
@@ -177,3 +180,3 @@ } | ||
const nextRef = vNode.ref; | ||
if (lastRef !== nextRef && | ||
if (lastRef !== nextRef && | ||
// if the string of the key is the same, do nothing | ||
@@ -180,0 +183,0 @@ !(lastRef && nextRef && lastRef.key === nextRef.key) |
102720
2547