Bundled output for commit 88b17c1c60 [skip ci]

This commit is contained in:
Gandalf-the-Bot 2018-10-15 19:13:19 +00:00
parent 88b17c1c60
commit e7c71f6ba2
2 changed files with 8 additions and 8 deletions

View file

@ -908,7 +908,7 @@ var coreRenderer = function($window) {
} }
} }
function getKeyMap(vnodes, start, end) { function getKeyMap(vnodes, start, end) {
var map = {} var map = Object.create(null)
for (; start < end; start++) { for (; start < end; start++) {
var vnode = vnodes[start] var vnode = vnodes[start]
if (vnode != null) { if (vnode != null) {

14
mithril.min.js vendored
View file

@ -21,13 +21,13 @@ b.tag(b)}null!=b.attrs&&N(b.attrs,b,f);N(b.state,b,f);b.instance=x.normalize(e.c
b.children+"</svg>",a=a.firstChild):a.innerHTML=b.children;b.dom=a.firstChild;b.domSize=a.childNodes.length;for(b=E.createDocumentFragment();f=a.firstChild;)b.appendChild(f);C(t,b,c)}function h(t,b,f,c,a,d){if(b!==f&&(null!=b||null!=f))if(null==b||0===b.length)g(t,f,0,f.length,c,a,d);else if(null==f||0===f.length)y(b,0,b.length);else{for(var e=0,u=0,h=null,k=null;u<b.length;u++)if(null!=b[u]){h=null!=b[u].key;break}for(;e<f.length;e++)if(null!=f[e]){k=null!=f[e].key;break}if(null!==k||null!=h)if(h!== b.children+"</svg>",a=a.firstChild):a.innerHTML=b.children;b.dom=a.firstChild;b.domSize=a.childNodes.length;for(b=E.createDocumentFragment();f=a.firstChild;)b.appendChild(f);C(t,b,c)}function h(t,b,f,c,a,d){if(b!==f&&(null!=b||null!=f))if(null==b||0===b.length)g(t,f,0,f.length,c,a,d);else if(null==f||0===f.length)y(b,0,b.length);else{for(var e=0,u=0,h=null,k=null;u<b.length;u++)if(null!=b[u]){h=null!=b[u].key;break}for(;e<f.length;e++)if(null!=f[e]){k=null!=f[e].key;break}if(null!==k||null!=h)if(h!==
k)y(b,u,b.length),g(t,f,e,f.length,c,a,d);else if(k){k=b.length-1;h=f.length-1;for(var p,r,v,A,z,B;k>=u&&h>=e;)if(A=b[k],z=f[h],null==A)k--;else if(null==z)h--;else if(A.key===z.key)A!==z&&m(t,A,z,c,a,d),null!=z.dom&&(a=z.dom),k--,h--;else break;for(;k>=u&&h>=e;)if(r=b[u],v=f[e],null==r)u++;else if(null==v)e++;else if(r.key===v.key)u++,e++,r!==v&&m(t,r,v,c,l(b,u,a),d);else break;for(;k>=u&&h>=e;){if(null==r)u++;else if(null==v)e++;else if(null==A)k--;else if(null==z)h--;else if(e===h)break;else{if(r.key!== k)y(b,u,b.length),g(t,f,e,f.length,c,a,d);else if(k){k=b.length-1;h=f.length-1;for(var p,r,v,A,z,B;k>=u&&h>=e;)if(A=b[k],z=f[h],null==A)k--;else if(null==z)h--;else if(A.key===z.key)A!==z&&m(t,A,z,c,a,d),null!=z.dom&&(a=z.dom),k--,h--;else break;for(;k>=u&&h>=e;)if(r=b[u],v=f[e],null==r)u++;else if(null==v)e++;else if(r.key===v.key)u++,e++,r!==v&&m(t,r,v,c,l(b,u,a),d);else break;for(;k>=u&&h>=e;){if(null==r)u++;else if(null==v)e++;else if(null==A)k--;else if(null==z)h--;else if(e===h)break;else{if(r.key!==
z.key||A.key!==v.key)break;B=l(b,u,a);C(t,n(A),B);A!==v&&m(t,A,v,c,B,d);++e<=--h&&C(t,n(r),a);r!==z&&m(t,r,z,c,a,d);null!=z.dom&&(a=z.dom);u++;k--}A=b[k];z=f[h];r=b[u];v=f[e]}for(;k>=u&&h>=e;){if(null==A)k--;else if(null==z)h--;else if(A.key===z.key)A!==z&&m(t,A,z,c,a,d),null!=z.dom&&(a=z.dom),k--,h--;else break;A=b[k];z=f[h]}if(e>h)y(b,u,k+1);else if(u>k)g(t,f,e,h+1,c,a,d);else{v=a;A=h-e+1;r=Array(A);var x=2147483647,w=0;for(B=0;B<A;B++)r[B]=-1;for(B=h;B>=e;B--){if(null==p){p=b;A=u;z=k+1;for(var D= z.key||A.key!==v.key)break;B=l(b,u,a);C(t,n(A),B);A!==v&&m(t,A,v,c,B,d);++e<=--h&&C(t,n(r),a);r!==z&&m(t,r,z,c,a,d);null!=z.dom&&(a=z.dom);u++;k--}A=b[k];z=f[h];r=b[u];v=f[e]}for(;k>=u&&h>=e;){if(null==A)k--;else if(null==z)h--;else if(A.key===z.key)A!==z&&m(t,A,z,c,a,d),null!=z.dom&&(a=z.dom),k--,h--;else break;A=b[k];z=f[h]}if(e>h)y(b,u,k+1);else if(u>k)g(t,f,e,h+1,c,a,d);else{v=a;A=h-e+1;r=Array(A);var x=2147483647,w=0;for(B=0;B<A;B++)r[B]=-1;for(B=h;B>=e;B--){if(null==p){p=b;A=u;z=k+1;for(var D=
{};A<z;A++){var J=p[A];null!=J&&(J=J.key,null!=J&&(D[J]=A))}p=D}z=f[B];null!=z&&(D=p[z.key],null!=D&&(x=D<x?D:-1,r[B-e]=D,A=b[D],b[D]=null,A!==z&&m(t,A,z,c,a,d),null!=z.dom&&(a=z.dom),w++))}a=v;w!==k-u+1&&y(b,u,k+1);if(0===w)g(t,f,e,h+1,c,a,d);else if(-1===x){u=r.slice();b=[];b.push(0);k=0;for(B=r.length;k<B;++k)if(-1!==r[k])if(v=b[b.length-1],r[v]<r[k])u[k]=v,b.push(k);else{v=0;for(x=b.length-1;v<x;)w=(v+x)/2|0,r[b[w]]<r[k]?v=w+1:x=w;r[k]<r[b[v]]&&(0<v&&(u[k]=b[v-1]),b[v]=k)}v=b.length;for(x=b[v- Object.create(null);A<z;A++){var J=p[A];null!=J&&(J=J.key,null!=J&&(D[J]=A))}p=D}z=f[B];null!=z&&(D=p[z.key],null!=D&&(x=D<x?D:-1,r[B-e]=D,A=b[D],b[D]=null,A!==z&&m(t,A,z,c,a,d),null!=z.dom&&(a=z.dom),w++))}a=v;w!==k-u+1&&y(b,u,k+1);if(0===w)g(t,f,e,h+1,c,a,d);else if(-1===x){u=r.slice();b=[];b.push(0);k=0;for(B=r.length;k<B;++k)if(-1!==r[k])if(v=b[b.length-1],r[v]<r[k])u[k]=v,b.push(k);else{v=0;for(x=b.length-1;v<x;)w=(v+x)/2|0,r[b[w]]<r[k]?v=w+1:x=w;r[k]<r[b[v]]&&(0<v&&(u[k]=b[v-1]),b[v]=k)}v=b.length;
1];0<v--;)b[v]=x,x=u[x];u=b.length-1;for(B=h;B>=e;B--)v=f[B],-1===r[B-e]?q(t,v,c,d,a):b[u]===B-e?u--:C(t,n(v),a),null!=v.dom&&(a=f[B].dom)}else for(B=h;B>=e;B--)v=f[B],-1===r[B-e]&&q(t,v,c,d,a),null!=v.dom&&(a=f[B].dom)}}else{h=b.length<f.length?b.length:f.length;for(e=e<u?e:u;e<h;e++)r=b[e],v=f[e],r===v||null==r&&null==v||(null==r?q(t,v,c,d,l(b,e+1,a)):null==v?F(r):m(t,r,v,c,l(b,e+1,a),d));b.length>h&&y(b,e,b.length);f.length>h&&g(t,f,e,f.length,c,a,d)}}}function m(a,b,f,d,g,l){var t=b.tag;if(t=== for(x=b[v-1];0<v--;)b[v]=x,x=u[x];u=b.length-1;for(B=h;B>=e;B--)v=f[B],-1===r[B-e]?q(t,v,c,d,a):b[u]===B-e?u--:C(t,n(v),a),null!=v.dom&&(a=f[B].dom)}else for(B=h;B>=e;B--)v=f[B],-1===r[B-e]&&q(t,v,c,d,a),null!=v.dom&&(a=f[B].dom)}}else{h=b.length<f.length?b.length:f.length;for(e=e<u?e:u;e<h;e++)r=b[e],v=f[e],r===v||null==r&&null==v||(null==r?q(t,v,c,d,l(b,e+1,a)):null==v?F(r):m(t,r,v,c,l(b,e+1,a),d));b.length>h&&y(b,e,b.length);f.length>h&&g(t,f,e,f.length,c,a,d)}}}function m(a,b,f,d,g,l){var t=b.tag;
f.tag){f.state=b.state;f.events=b.events;var u;var y;null!=f.attrs&&"function"===typeof f.attrs.onbeforeupdate&&(u=e.call(f.attrs.onbeforeupdate,f,b));"string"!==typeof f.tag&&"function"===typeof f.state.onbeforeupdate&&(y=e.call(f.state.onbeforeupdate,f,b));void 0===u&&void 0===y||u||y?u=!1:(f.dom=b.dom,f.domSize=b.domSize,f.instance=b.instance,u=!0);if(!u)if("string"===typeof t)switch(null!=f.attrs&&L(f.attrs,f,d),t){case "#":b.children.toString()!==f.children.toString()&&(b.dom.nodeValue=f.children); if(t===f.tag){f.state=b.state;f.events=b.events;var u;var y;null!=f.attrs&&"function"===typeof f.attrs.onbeforeupdate&&(u=e.call(f.attrs.onbeforeupdate,f,b));"string"!==typeof f.tag&&"function"===typeof f.state.onbeforeupdate&&(y=e.call(f.state.onbeforeupdate,f,b));void 0===u&&void 0===y||u||y?u=!1:(f.dom=b.dom,f.domSize=b.domSize,f.instance=b.instance,u=!0);if(!u)if("string"===typeof t)switch(null!=f.attrs&&L(f.attrs,f,d),t){case "#":b.children.toString()!==f.children.toString()&&(b.dom.nodeValue=
f.dom=b.dom;break;case "<":b.children!==f.children?(n(b),k(a,f,l,g)):(f.dom=b.dom,f.domSize=b.domSize);break;case "[":h(a,b.children,f.children,d,g,l);b=0;d=f.children;f.dom=null;if(null!=d){for(var p=0;p<d.length;p++)a=d[p],null!=a&&null!=a.dom&&(null==f.dom&&(f.dom=a.dom),b+=a.domSize||1);1!==b&&(f.domSize=b)}break;default:a=f.dom=b.dom;l=f.attrs&&f.attrs.xmlns||G[f.tag]||l;"textarea"===f.tag&&(null==f.attrs&&(f.attrs={}),null!=f.text&&(f.attrs.value=f.text,f.text=void 0));g=b.attrs;t=f.attrs;u= f.children);f.dom=b.dom;break;case "<":b.children!==f.children?(n(b),k(a,f,l,g)):(f.dom=b.dom,f.domSize=b.domSize);break;case "[":h(a,b.children,f.children,d,g,l);b=0;d=f.children;f.dom=null;if(null!=d){for(var p=0;p<d.length;p++)a=d[p],null!=a&&null!=a.dom&&(null==f.dom&&(f.dom=a.dom),b+=a.domSize||1);1!==b&&(f.domSize=b)}break;default:a=f.dom=b.dom;l=f.attrs&&f.attrs.xmlns||G[f.tag]||l;"textarea"===f.tag&&(null==f.attrs&&(f.attrs={}),null!=f.text&&(f.attrs.value=f.text,f.text=void 0));g=b.attrs;
l;if(null!=t)for(p in t)D(f,p,g&&g[p],t[p],u);var C;if(null!=g)for(p in g)if(null!=(C=g[p])&&(null==t||null==t[p])){y=f;var r=p,v=u;"key"===r||"is"===r||null==C||w(r)||("o"!==r[0]||"n"!==r[1]||w(r)?"style"===r?T(y.dom,C,null):!S(y,r,v)||"className"===r||"option"===y.tag&&"value"===r||"input"===y.tag&&"type"===r?(v=r.indexOf(":"),-1!==v&&(r=r.slice(v+1)),!1!==C&&y.dom.removeAttribute("className"===r?"class":r)):y.dom[r]=null:U(y,r,void 0))}null!=f.attrs&&null!=f.attrs.contenteditable?c(f):null!=b.text&& t=f.attrs;u=l;if(null!=t)for(p in t)D(f,p,g&&g[p],t[p],u);var C;if(null!=g)for(p in g)if(null!=(C=g[p])&&(null==t||null==t[p])){y=f;var r=p,v=u;"key"===r||"is"===r||null==C||w(r)||("o"!==r[0]||"n"!==r[1]||w(r)?"style"===r?T(y.dom,C,null):!S(y,r,v)||"className"===r||"option"===y.tag&&"value"===r||"input"===y.tag&&"type"===r?(v=r.indexOf(":"),-1!==v&&(r=r.slice(v+1)),!1!==C&&y.dom.removeAttribute("className"===r?"class":r)):y.dom[r]=null:U(y,r,void 0))}null!=f.attrs&&null!=f.attrs.contenteditable?c(f):
null!=f.text&&""!==f.text?b.text.toString()!==f.text.toString()&&(b.dom.firstChild.nodeValue=f.text):(null!=b.text&&(b.children=[x("#",void 0,void 0,b.text,void 0,b.dom.firstChild)]),null!=f.text&&(f.children=[x("#",void 0,void 0,f.text,void 0,void 0)]),h(a,b.children,f.children,d,null,l))}else{f.instance=x.normalize(e.call(f.state.view,f));if(f.instance===f)throw Error("A view cannot return the vnode it received as argument");null!=f.attrs&&L(f.attrs,f,d);L(f.state,f,d);null!=f.instance?(null==b.instance? null!=b.text&&null!=f.text&&""!==f.text?b.text.toString()!==f.text.toString()&&(b.dom.firstChild.nodeValue=f.text):(null!=b.text&&(b.children=[x("#",void 0,void 0,b.text,void 0,b.dom.firstChild)]),null!=f.text&&(f.children=[x("#",void 0,void 0,f.text,void 0,void 0)]),h(a,b.children,f.children,d,null,l))}else{f.instance=x.normalize(e.call(f.state.view,f));if(f.instance===f)throw Error("A view cannot return the vnode it received as argument");null!=f.attrs&&L(f.attrs,f,d);L(f.state,f,d);null!=f.instance?
q(a,f.instance,d,l,g):m(a,b.instance,f.instance,d,g,l),f.dom=f.instance.dom,f.domSize=f.instance.domSize):null!=b.instance?(F(b.instance),f.dom=void 0,f.domSize=0):(f.dom=b.dom,f.domSize=b.domSize)}}else F(b),q(a,f,d,l,g)}function n(a){var b=a.domSize;if(null!=b||null==a.dom){var c=E.createDocumentFragment();if(0<b){for(a=a.dom;--b;)c.appendChild(a.nextSibling);c.insertBefore(a,c.firstChild)}return c}return a.dom}function l(a,b,c){for(;b<a.length;b++)if(null!=a[b]&&null!=a[b].dom)return a[b].dom; (null==b.instance?q(a,f.instance,d,l,g):m(a,b.instance,f.instance,d,g,l),f.dom=f.instance.dom,f.domSize=f.instance.domSize):null!=b.instance?(F(b.instance),f.dom=void 0,f.domSize=0):(f.dom=b.dom,f.domSize=b.domSize)}}else F(b),q(a,f,d,l,g)}function n(a){var b=a.domSize;if(null!=b||null==a.dom){var c=E.createDocumentFragment();if(0<b){for(a=a.dom;--b;)c.appendChild(a.nextSibling);c.insertBefore(a,c.firstChild)}return c}return a.dom}function l(a,b,c){for(;b<a.length;b++)if(null!=a[b]&&null!=a[b].dom)return a[b].dom;
return c}function C(a,b,c){null!=c?a.insertBefore(b,c):a.appendChild(b)}function c(a){var b=a.children;if(null!=b&&1===b.length&&"<"===b[0].tag)b=b[0].children,a.dom.innerHTML!==b&&(a.dom.innerHTML=b);else if(null!=a.text||null!=b&&0!==b.length)throw Error("Child node of a contenteditable must be trusted");}function y(a,b,c){for(;b<c;b++){var f=a[b];null!=f&&F(f)}}function F(a){function b(){if(++t===c&&(d(a,g),p(a),a.dom)){for(var b=a.dom.parentNode,f=a.domSize||1;--f;)b.removeChild(a.dom.nextSibling); return c}function C(a,b,c){null!=c?a.insertBefore(b,c):a.appendChild(b)}function c(a){var b=a.children;if(null!=b&&1===b.length&&"<"===b[0].tag)b=b[0].children,a.dom.innerHTML!==b&&(a.dom.innerHTML=b);else if(null!=a.text||null!=b&&0!==b.length)throw Error("Child node of a contenteditable must be trusted");}function y(a,b,c){for(;b<c;b++){var f=a[b];null!=f&&F(f)}}function F(a){function b(){if(++t===c&&(d(a,g),p(a),a.dom)){for(var b=a.dom.parentNode,f=a.domSize||1;--f;)b.removeChild(a.dom.nextSibling);
b.removeChild(a.dom)}}var c=1,t=0,g=a.state;if(a.attrs&&"function"===typeof a.attrs.onbeforeremove){var n=e.call(a.attrs.onbeforeremove,a);null!=n&&"function"===typeof n.then&&(c++,n.then(b,b))}"string"!==typeof a.tag&&"function"===typeof a.state.onbeforeremove&&(n=e.call(a.state.onbeforeremove,a),null!=n&&"function"===typeof n.then&&(c++,n.then(b,b)));b()}function p(a){a.attrs&&"function"===typeof a.attrs.onremove&&e.call(a.attrs.onremove,a);if("string"!==typeof a.tag)"function"===typeof a.state.onremove&& b.removeChild(a.dom)}}var c=1,t=0,g=a.state;if(a.attrs&&"function"===typeof a.attrs.onbeforeremove){var n=e.call(a.attrs.onbeforeremove,a);null!=n&&"function"===typeof n.then&&(c++,n.then(b,b))}"string"!==typeof a.tag&&"function"===typeof a.state.onbeforeremove&&(n=e.call(a.state.onbeforeremove,a),null!=n&&"function"===typeof n.then&&(c++,n.then(b,b)));b()}function p(a){a.attrs&&"function"===typeof a.attrs.onremove&&e.call(a.attrs.onremove,a);if("string"!==typeof a.tag)"function"===typeof a.state.onremove&&
e.call(a.state.onremove,a),null!=a.instance&&p(a.instance);else if(a=a.children,Array.isArray(a))for(var b=0;b<a.length;b++){var c=a[b];null!=c&&p(c)}}function D(a,b,c,d,e){if("key"!==b&&"is"!==b&&null!=d&&!w(b)&&(c!==d||"value"===b||"checked"===b||"selectedIndex"===b||"selected"===b&&a.dom===E.activeElement||"option"===a.tag&&a.dom.parentNode===E.activeElement||"object"===typeof d)){if("o"===b[0]&&"n"===b[1])return U(a,b,d);"xlink:"===b.slice(0,6)?a.dom.setAttributeNS("http://www.w3.org/1999/xlink", e.call(a.state.onremove,a),null!=a.instance&&p(a.instance);else if(a=a.children,Array.isArray(a))for(var b=0;b<a.length;b++){var c=a[b];null!=c&&p(c)}}function D(a,b,c,d,e){if("key"!==b&&"is"!==b&&null!=d&&!w(b)&&(c!==d||"value"===b||"checked"===b||"selectedIndex"===b||"selected"===b&&a.dom===E.activeElement||"option"===a.tag&&a.dom.parentNode===E.activeElement||"object"===typeof d)){if("o"===b[0]&&"n"===b[1])return U(a,b,d);"xlink:"===b.slice(0,6)?a.dom.setAttributeNS("http://www.w3.org/1999/xlink",