diff --git a/lib/redom.min.js b/lib/redom.min.js index 62a62cba..11e59f27 100644 --- a/lib/redom.min.js +++ b/lib/redom.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.redom=e.redom||{})}(this,function(e){"use strict";function t(e,t,n){var i=e.el||e,r=t.el||t;return y(r)&&(r=r.el),t===r&&r.__redom_view&&(t=r.__redom_view),t!==r&&(r.__redom_view=t),t.isMounted?t.remount&&t.remount():t.mount&&t.mount(),n?i.insertBefore(r,n.el||n):i.appendChild(r),t.isMounted?t.remounted&&t.remounted():(t.isMounted=!0,t.mounted&&t.mounted()),t}function n(e,t){var n=e.el||e,i=t.el||t;return t===i&&i.__redom_view&&(t=i.__redom_view),t.unmount&&t.unmount(),n.removeChild(i),t.isMounted=!1,t.unmounted&&t.unmounted(),t}function i(e,t,n){var r=e.el||e;if(arguments.length>2)r.style[t]=n;else if(w(t))r.setAttribute("style",t);else for(var o in t)i(r,o,t[o])}function r(e,t,n){var o=e.el||e,u=o instanceof window.SVGElement;if(arguments.length>2)"style"===t?i(o,n):u&&p(n)?o[t]=n:!u&&(t in o||p(n))?o[t]=n:o.setAttribute(t,n);else for(var s in t)r(o,s,t[s])}function o(e,n){for(var i=0;i0;)t[n]=arguments[n+1];var i;if(w(e))i=N(e).cloneNode(!1);else{if(!g(e))throw new Error("At least one argument required");i=e.cloneNode(!1)}return o(i,t),i}function l(e,i){if(void 0===i.length)return l(e,[i]);for(var r=e.el||e,o=r.firstChild,u=0;u0;)t[n]=arguments[n+1];var i;if(w(e))i=V(e).cloneNode(!1);else{if(!g(e))throw new Error("At least one argument required");i=e.cloneNode(!1)}return o(i,t),i}var c=function(e){return b.createTextNode(e)},m=function(e){return function(t){return typeof t===e}},w=m("string"),_=m("number"),p=m("function"),g=function(e){return e&&e.nodeType},y=function(e){return e&&e.__redom_list},b=document,x="#".charCodeAt(0),A=".".charCodeAt(0),C={},N=function(e){return C[e]||u(e)};s.extend=function(e){var t=N(e);return s.bind(this,t)};var k=s;d.extend=function(e,t,n,i){return d.bind(d,e,t,n,i)},a.extend=d.extend,d.prototype.update=function(e){void 0===e&&(e=[]);for(var t=this.View,n=this.key,i=p(n),r=this.initData,o=new Array(e.length),u=this.views,s=n&&{},a=n&&this.lookup,d=0;d0;)t[n]=arguments[n+1];var r;if(S(e))r=L(e).cloneNode(!1);else{if(!T(e))throw new Error("At least one argument required");r=e.cloneNode(!1)}return c(r,t),r}function _(e,t){if(void 0===t.length)return _(e,[t]);for(var n=k(e).firstChild,r=0;r0;)t[n]=arguments[n+1];var r;if(S(e))r=M(e).cloneNode(!1);else{if(!T(e))throw new Error("At least one argument required");r=e.cloneNode(!1)}return c(r,t),r}var y={},g={},b={};document&&(b=document.createElement("p").style);var x=function(e,n){if(null!=n){if(n in y)return;y[n]=!0}var r=[];if(t(e,function(e){r.push(e)}),r.length){var i=document.createElement("style");i.textContent=r.join(""),document.head.appendChild(i)}},C="#".charCodeAt(0),A=".".charCodeAt(0),N=["onmount","onunmount"],j=function(e){return document.createTextNode(e)},E=function(e){return S(e)?v(e):k(e)},k=function(e){return e.nodeType&&e||!e.el&&e||k(e.el)},S=function(e){return"string"==typeof e},V=function(e){return"number"==typeof e},D=function(e){return"function"==typeof e},T=function(e){return e&&e.nodeType},q={},L=function(e){return q[e]||(q[e]=i(e))};v.extend=function(e){var t=L(e);return v.bind(this,t)};var z=v;m.extend=function(e,t,n,r){return m.bind(m,e,t,n,r)},h.extend=m.extend,m.prototype.update=function(e){void 0===e&&(e=[]);for(var t=this.View,n=this.key,r=D(n),i=this.initData,o=new Array(e.length),u=this.views,f=n&&{},l=n&&this.lookup,a=0;a