intact-vue
Advanced tools
Comparing version 0.2.20 to 0.2.21
@@ -276,3 +276,3 @@ (function (global, factory) { | ||
context: { | ||
data: props.parent.$data | ||
$data: props.parent.$data | ||
} | ||
@@ -288,5 +288,8 @@ }); | ||
for (var key in vNode.props) { | ||
if (~['children', '_context', 'className', 'style'].indexOf(key)) continue; | ||
if (~['children', '_context', 'className', 'style', 'ref'].indexOf(key)) continue; | ||
attrs[key] = vNode.props[key]; | ||
} | ||
if (props.data.ref) { | ||
__props.ref = props.data.ref; | ||
} | ||
if (vNode.props.className) { | ||
@@ -293,0 +296,0 @@ __props.staticClass = vNode.props.className; |
@@ -1,1 +0,1 @@ | ||
(function(t,e){typeof exports==="object"&&typeof module!=="undefined"?module.exports=e(require("vue"),require("intact/dist/intact")):typeof define==="function"&&define.amd?define(["vue","intact/dist/intact"],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 r=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 n=function(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}};var i=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 o=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 a=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 s=e.Vdt.miss.h;var u=t.prototype.__patch__;var f=e.utils;var c=f.get;var l=f.set;function p(t){if(Array.isArray(t)){var e=[];t.forEach(function(t){e.push(v(t))});return e}return v(t)}function v(t){if(t==null)return t;var e=typeof t==="undefined"?"undefined":r(t);if(e==="string"||e==="number")return t;if(t.type)return t;if(k(t)){var n=t.componentOptions;return s(n.Ctor,d(t),null,null,t.key,t.ref)}if(t.text!==undefined){return t.text}return s(m,{vueVNode:t},null,g(t))}function d(t){var e=t.componentOptions;var r=t.data;var n=r.attrs;var i=e.Ctor.propTypes;var o={};if(n){for(var a in n){if(~["staticClass","class","style","staticStyle"].indexOf(a))continue;var s=n[a];if(i&&i[a]===Boolean&&s===""){s=true}o[a]=s}}o.className=g(t);o.style=I(t);if(t.key){o.key=t.key}var u=r.scopedSlots;if(u){var f=function t(e){o[e]=function(){return p(u[e].apply(this,arguments))}};for(var c in u){f(c)}}var l=r.model;if(l){o.value=l.value;o["v-model"]=l.expression}else if(r.directives){var v=r.directives;for(var d=0;d<v.length;d++){var _=v[d];if(_.name==="model"){o.value=_.value;o["v-model"]=_.expression;break}}}b(t,o);for(var m in e.listeners){if(m==="input"){o["ev-$change:value"]=function(t,r){e.listeners.input(r)}}else{o["ev-"+m]=e.listeners[m]}}var A=t.slots||Q(e.children);var N=y(A),O=N.children,x=N._blocks;o.children=O;if(o._blocks){Object.assign(o._blocks,x)}else{o._blocks=x}h(t,o);return o}function h(t,e){var r=t.context.$data;e._context={data:{get:function t(e){if(e!=null){return c(r,e)}else{return r}},set:function t(e,n){l(r,e,n)}}}}function y(t){var e=t.default,r=o(t,["default"]);var n=void 0;if(r){n={};var i=function t(e){n[e]=function(){return p(r[e])}};for(var a in r){i(a)}}return{children:p(e),_blocks:n}}function _(t){function e(e){return t(e)}e.options={functional:true,render:function e(r,n){var i=d({componentOptions:{Ctor:t,listeners:n.listeners},data:n.data,slots:n.slots(),context:{data:n.parent.$data}});var o=t(i,true);if(Array.isArray(o)){throw new Error("Array children does not be supported.")}var a={};var s={attrs:a};for(var u in o.props){if(~["children","_context","className","style"].indexOf(u))continue;a[u]=o.props[u]}if(o.props.className){s.staticClass=o.props.className}if(o.props.style){s.staticStyle=o.props.style}return r(o.tag,s,o.props.children)}};e.cid="IntactFunctionalComponent";return e}var m=function(){function t(){n(this,t)}t.prototype.init=function t(e,r){this.destroyed=true;this._addProps(r);return u(null,r.props.vueVNode,false,false,this.parentDom)};t.prototype.update=function t(e,r){this._addProps(r);return u(e.props.vueVNode,r.props.vueVNode,false,false,this.parentDom)};t.prototype.destroy=function t(e){u(e.props.vueVNode,null)};t.prototype._addProps=function t(e){this.vdt={vNode:e};var r=e.props;var n=r.vueVNode;for(var i in r){if(i==="vueVNode")continue;if(!n.data)n.data={};var o=n.data;var a=r[i];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}}};return t}();function b(t,e){var r=t.data.ref;if(r){var n=t.context.$refs;var i=void 0;e.ref=function(e){if(e){i=e;if(t.data.refInFor){if(!Array.isArray(n)){n[r]=[i]}else if(n[r].indexOf(i)<0){n[r].push(i)}}else{n[r]=i}}else{if(Array.isArray(n[r])){var o=n[r].indexOf(i);if(~o){n[r].splice(o,1)}}else{n[r]=i=undefined}}}}}function g(t){var e=void 0;var r=t.data;if(r){if(r.staticClass){e=r.staticClass}if(r.class){if(!e){e=A(r.class)}else{e+=" "+A(r.class)}}}return e}function A(t){if(t==null)return"";if(Array.isArray(t)){return N(t)}if((typeof t==="undefined"?"undefined":r(t))==="object"){return O(t)}if(typeof t==="string"){return t}return""}function N(t){var e="";var r=void 0;for(var n=0;n<t.length;n++){if((r=A(t[n]))!=null&&r!==""){if(e)e+=" ";e+=r}}return e}function O(t){var e="";for(var r in t){if(t[r]){if(e)e+=" ";e+=r}}return e}function I(t){var e=void 0;var r=t.data;if(r){e=x(r.style);if(r.staticStyle){return Object.assign(r.staticStyle,e)}}return e}function x(t){if(!t)return t;if(Array.isArray(t)){return V(t)}if(typeof t==="string"){return C(t)}return t}function V(t){var e={};for(var r=0;r<t.length;r++){if(t[r]){Object.assign(e,t[r])}}return e}var $=Object.create(null);function C(t){var e=$[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())}});$[t]=r;return r}function k(t){var e=t.data;return e&&(e=e.hook)&&(e=e.init)&&t.componentOptions.Ctor.cid==="IntactVue"}function Q(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(j)){delete e[u]}}return e}function j(t){return t.isComment&&!t.asyncFactory||t.text===" "}var w=t.prototype;var S=w.init;var P=w.$nextTick;var E=w._updateFromParent;var T={};var M=void 0;var F=false;var q=function(t){i(e,t);function e(r){n(this,e);var i=r&&r._parentVnode;if(i){var o=v(i);var s=a(this,t.call(this,o.props));r.mounted=[s.mount];r._renderChildren=true;s.$options=r;s.$vnode=i;s._isVue=true;s.vNode=o;o.children=s}else{var s=a(this,t.call(this,r))}s._prevActiveInstance=T;T=s;return a(s)}e.prototype.init=function e(r,n){var i=this;var e=function e(){var o=t.prototype.init.call(i,r,n);T=i._prevActiveInstance;i._prevActiveInstance=null;return o};if(!this._isVue)return e();var o=F;if(!n){F=true}if(!F){M=this.mountedQueue}var a=e();F=o;return a};e.prototype.update=function e(r,n,i){var o=this;var e=function e(){o._prevActiveInstance=T;T=o;var a=t.prototype.update.call(o,r,n,i);T=o._prevActiveInstance;o._prevActiveInstance=null;return a};if(!this._isVue)return e();var a=F;if(!n&&!i&&this._updateCount===0){F=true}if(!F){M=this.mountedQueue}var s=e();F=a;return s};e.prototype.$mount=function e(r,n){this.__initMountedQueue();this.parentVNode=this.vNode.parentVNode=this._prevActiveInstance&&this._prevActiveInstance.vNode;this.$el=t.prototype.init.call(this,null,this.vNode);this._vnode={};var i=this.$options;var o=i._refElm;if(o){i._parentElm.replaceChild(this.$el,o)}else{i._parentElm.appendChild(this.$el)}this.__triggerMountedQueue();T=this._prevActiveInstance;this._prevActiveInstance=null};e.prototype.$forceUpdate=function e(){this.__initMountedQueue();this._prevActiveInstance=T;T=this;var r=v(this.$vnode);var n=this.vNode;r.children=this;this.vNode=r;this.parentVNode=this.vNode.parentVNode=this._prevActiveInstance&&this._prevActiveInstance.vNode;t.prototype.update.call(this,n,r);this.$options._renderChildren=true;var i=n.ref;var o=r.ref;if(i!==o){if(i){i(null)}if(o){o(this)}}this.__triggerMountedQueue();T=this._prevActiveInstance;this._prevActiveInstance=null};e.prototype.$destroy=function t(){this.destroy()};e.prototype.__initMountedQueue=function e(){this._shouldTrigger=false;if(!M){this._shouldTrigger=true;if(!this.mountedQueue){t.prototype._initMountedQueue.call(this)}M=this.mountedQueue}else{this.mountedQueue=M}};e.prototype.__triggerMountedQueue=function e(){if(this._shouldTrigger){t.prototype._triggerMountedQueue.call(this);M=null;this._shouldTrigger=false}};e.prototype.$on=function t(){};e.prototype.$off=function t(){};return e}(e);q.cid="IntactVue";q.options=Object.assign({},t.options);q.functionalWrapper=_;q.normalize=p;q.prototype.$nextTick=P;q.prototype._updateFromParent=E;return q}); | ||
(function(t,e){typeof exports==="object"&&typeof module!=="undefined"?module.exports=e(require("vue"),require("intact/dist/intact")):typeof define==="function"&&define.amd?define(["vue","intact/dist/intact"],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 r=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 n=function(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}};var i=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 o=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 a=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 s=e.Vdt.miss.h;var u=t.prototype.__patch__;var f=e.utils;var c=f.get;var l=f.set;function p(t){if(Array.isArray(t)){var e=[];t.forEach(function(t){e.push(v(t))});return e}return v(t)}function v(t){if(t==null)return t;var e=typeof t==="undefined"?"undefined":r(t);if(e==="string"||e==="number")return t;if(t.type)return t;if(k(t)){var n=t.componentOptions;return s(n.Ctor,d(t),null,null,t.key,t.ref)}if(t.text!==undefined){return t.text}return s(m,{vueVNode:t},null,g(t))}function d(t){var e=t.componentOptions;var r=t.data;var n=r.attrs;var i=e.Ctor.propTypes;var o={};if(n){for(var a in n){if(~["staticClass","class","style","staticStyle"].indexOf(a))continue;var s=n[a];if(i&&i[a]===Boolean&&s===""){s=true}o[a]=s}}o.className=g(t);o.style=I(t);if(t.key){o.key=t.key}var u=r.scopedSlots;if(u){var f=function t(e){o[e]=function(){return p(u[e].apply(this,arguments))}};for(var c in u){f(c)}}var l=r.model;if(l){o.value=l.value;o["v-model"]=l.expression}else if(r.directives){var v=r.directives;for(var d=0;d<v.length;d++){var _=v[d];if(_.name==="model"){o.value=_.value;o["v-model"]=_.expression;break}}}b(t,o);for(var m in e.listeners){if(m==="input"){o["ev-$change:value"]=function(t,r){e.listeners.input(r)}}else{o["ev-"+m]=e.listeners[m]}}var A=t.slots||Q(e.children);var N=y(A),O=N.children,x=N._blocks;o.children=O;if(o._blocks){Object.assign(o._blocks,x)}else{o._blocks=x}h(t,o);return o}function h(t,e){var r=t.context.$data;e._context={data:{get:function t(e){if(e!=null){return c(r,e)}else{return r}},set:function t(e,n){l(r,e,n)}}}}function y(t){var e=t.default,r=o(t,["default"]);var n=void 0;if(r){n={};var i=function t(e){n[e]=function(){return p(r[e])}};for(var a in r){i(a)}}return{children:p(e),_blocks:n}}function _(t){function e(e){return t(e)}e.options={functional:true,render:function e(r,n){var i=d({componentOptions:{Ctor:t,listeners:n.listeners},data:n.data,slots:n.slots(),context:{$data:n.parent.$data}});var o=t(i,true);if(Array.isArray(o)){throw new Error("Array children does not be supported.")}var a={};var s={attrs:a};for(var u in o.props){if(~["children","_context","className","style","ref"].indexOf(u))continue;a[u]=o.props[u]}if(n.data.ref){s.ref=n.data.ref}if(o.props.className){s.staticClass=o.props.className}if(o.props.style){s.staticStyle=o.props.style}return r(o.tag,s,o.props.children)}};e.cid="IntactFunctionalComponent";return e}var m=function(){function t(){n(this,t)}t.prototype.init=function t(e,r){this.destroyed=true;this._addProps(r);return u(null,r.props.vueVNode,false,false,this.parentDom)};t.prototype.update=function t(e,r){this._addProps(r);return u(e.props.vueVNode,r.props.vueVNode,false,false,this.parentDom)};t.prototype.destroy=function t(e){u(e.props.vueVNode,null)};t.prototype._addProps=function t(e){this.vdt={vNode:e};var r=e.props;var n=r.vueVNode;for(var i in r){if(i==="vueVNode")continue;if(!n.data)n.data={};var o=n.data;var a=r[i];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}}};return t}();function b(t,e){var r=t.data.ref;if(r){var n=t.context.$refs;var i=void 0;e.ref=function(e){if(e){i=e;if(t.data.refInFor){if(!Array.isArray(n)){n[r]=[i]}else if(n[r].indexOf(i)<0){n[r].push(i)}}else{n[r]=i}}else{if(Array.isArray(n[r])){var o=n[r].indexOf(i);if(~o){n[r].splice(o,1)}}else{n[r]=i=undefined}}}}}function g(t){var e=void 0;var r=t.data;if(r){if(r.staticClass){e=r.staticClass}if(r.class){if(!e){e=A(r.class)}else{e+=" "+A(r.class)}}}return e}function A(t){if(t==null)return"";if(Array.isArray(t)){return N(t)}if((typeof t==="undefined"?"undefined":r(t))==="object"){return O(t)}if(typeof t==="string"){return t}return""}function N(t){var e="";var r=void 0;for(var n=0;n<t.length;n++){if((r=A(t[n]))!=null&&r!==""){if(e)e+=" ";e+=r}}return e}function O(t){var e="";for(var r in t){if(t[r]){if(e)e+=" ";e+=r}}return e}function I(t){var e=void 0;var r=t.data;if(r){e=x(r.style);if(r.staticStyle){return Object.assign(r.staticStyle,e)}}return e}function x(t){if(!t)return t;if(Array.isArray(t)){return $(t)}if(typeof t==="string"){return C(t)}return t}function $(t){var e={};for(var r=0;r<t.length;r++){if(t[r]){Object.assign(e,t[r])}}return e}var V=Object.create(null);function C(t){var e=V[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())}});V[t]=r;return r}function k(t){var e=t.data;return e&&(e=e.hook)&&(e=e.init)&&t.componentOptions.Ctor.cid==="IntactVue"}function Q(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(j)){delete e[u]}}return e}function j(t){return t.isComment&&!t.asyncFactory||t.text===" "}var w=t.prototype;var S=w.init;var P=w.$nextTick;var E=w._updateFromParent;var T={};var M=void 0;var F=false;var q=function(t){i(e,t);function e(r){n(this,e);var i=r&&r._parentVnode;if(i){var o=v(i);var s=a(this,t.call(this,o.props));r.mounted=[s.mount];r._renderChildren=true;s.$options=r;s.$vnode=i;s._isVue=true;s.vNode=o;o.children=s}else{var s=a(this,t.call(this,r))}s._prevActiveInstance=T;T=s;return a(s)}e.prototype.init=function e(r,n){var i=this;var e=function e(){var o=t.prototype.init.call(i,r,n);T=i._prevActiveInstance;i._prevActiveInstance=null;return o};if(!this._isVue)return e();var o=F;if(!n){F=true}if(!F){M=this.mountedQueue}var a=e();F=o;return a};e.prototype.update=function e(r,n,i){var o=this;var e=function e(){o._prevActiveInstance=T;T=o;var a=t.prototype.update.call(o,r,n,i);T=o._prevActiveInstance;o._prevActiveInstance=null;return a};if(!this._isVue)return e();var a=F;if(!n&&!i&&this._updateCount===0){F=true}if(!F){M=this.mountedQueue}var s=e();F=a;return s};e.prototype.$mount=function e(r,n){this.__initMountedQueue();this.parentVNode=this.vNode.parentVNode=this._prevActiveInstance&&this._prevActiveInstance.vNode;this.$el=t.prototype.init.call(this,null,this.vNode);this._vnode={};var i=this.$options;var o=i._refElm;if(o){i._parentElm.replaceChild(this.$el,o)}else{i._parentElm.appendChild(this.$el)}this.__triggerMountedQueue();T=this._prevActiveInstance;this._prevActiveInstance=null};e.prototype.$forceUpdate=function e(){this.__initMountedQueue();this._prevActiveInstance=T;T=this;var r=v(this.$vnode);var n=this.vNode;r.children=this;this.vNode=r;this.parentVNode=this.vNode.parentVNode=this._prevActiveInstance&&this._prevActiveInstance.vNode;t.prototype.update.call(this,n,r);this.$options._renderChildren=true;var i=n.ref;var o=r.ref;if(i!==o){if(i){i(null)}if(o){o(this)}}this.__triggerMountedQueue();T=this._prevActiveInstance;this._prevActiveInstance=null};e.prototype.$destroy=function t(){this.destroy()};e.prototype.__initMountedQueue=function e(){this._shouldTrigger=false;if(!M){this._shouldTrigger=true;if(!this.mountedQueue){t.prototype._initMountedQueue.call(this)}M=this.mountedQueue}else{this.mountedQueue=M}};e.prototype.__triggerMountedQueue=function e(){if(this._shouldTrigger){t.prototype._triggerMountedQueue.call(this);M=null;this._shouldTrigger=false}};e.prototype.$on=function t(){};e.prototype.$off=function t(){};return e}(e);q.cid="IntactVue";q.options=Object.assign({},t.options);q.functionalWrapper=_;q.normalize=p;q.prototype.$nextTick=P;q.prototype._updateFromParent=E;return q}); |
{ | ||
"name": "intact-vue", | ||
"version": "0.2.20", | ||
"version": "0.2.21", | ||
"description": "A compatibility layer for running intact component in vue", | ||
@@ -5,0 +5,0 @@ "main": "dist/intact.vue.js", |
@@ -182,3 +182,3 @@ import Intact from 'intact/dist/intact'; | ||
context: { | ||
data: props.parent.$data, | ||
$data: props.parent.$data, | ||
}, | ||
@@ -194,5 +194,8 @@ }); | ||
for (const key in vNode.props) { | ||
if (~['children', '_context', 'className', 'style'].indexOf(key)) continue; | ||
if (~['children', '_context', 'className', 'style', 'ref'].indexOf(key)) continue; | ||
attrs[key] = vNode.props[key]; | ||
} | ||
if (props.data.ref) { | ||
__props.ref = props.data.ref; | ||
} | ||
if (vNode.props.className) { | ||
@@ -199,0 +202,0 @@ __props.staticClass = vNode.props.className; |
50927
1165