diff --git a/dist/base.js b/dist/base.js index 8026981..b18ecc4 100644 --- a/dist/base.js +++ b/dist/base.js @@ -1,3 +1,3 @@ -/**! Qoopido.nucleus 3.2.7 | http://nucleus.qoopido.com | (c) 2020 Dirk Lueth */ -!function(t){"use strict";var e=Object,r=e.create,o=e.getOwnPropertyNames,n=e.getOwnPropertyDescriptor,i=e.defineProperty;function p(t,e,r,o){return{__proto__:null,value:t,enumerable:!!o,configurable:!!r,writable:!!e}}function c(t,e,r,o,n){i(this,t,new p(e,r,o,n))}c.call(Object.prototype,"define",c),Function.prototype.define("extends",(function(t){for(var e,i=this.prototype,c=o(i),s={constructor:new p(this,!0,!0)},u=0;(e=c[u])&&!s[e];u++)s[e]=n(i,e);try{this.prototype=r(t.prototype||t,s)}catch(t){}if(this.prototype===i)throw new TypeError("Unable to extend, prototype is not writable");return this}))}(); +/**! Qoopido.nucleus 3.2.8 | http://nucleus.qoopido.com | (c) 2020 Dirk Lueth */ +!function(t){"use strict";var e=Object,r=e.create,o=e.getOwnPropertyNames,n=e.getOwnPropertyDescriptor,p=e.defineProperty;function i(t,e,r,o){return{__proto__:null,value:t,enumerable:!!o,configurable:!!r,writable:!!e}}function c(t,e,r,o,n){p(this,t,new i(e,r,o,n))}c.call(Object.prototype,"define",c),Function.prototype.define("extends",(function(t){for(var e,p=this,c=p.prototype,u=o(c),a={constructor:new i(p,!0,!0)},y=0;(e=u[y])&&!a[e];y++)a[e]=n(c,e);try{p.prototype=r(t.prototype||t,a)}catch(t){}if(p.prototype===c)throw new TypeError("Unable to extend, prototype is not writable");return p}))}(); //# sourceMappingURL=base.js.map diff --git a/dist/base.js.map b/dist/base.js.map index aa7a322..e643063 100644 --- a/dist/base.js.map +++ b/dist/base.js.map @@ -1 +1 @@ -{"version":3,"sources":["base.js"],"names":["strPrototype","object","Object","objectCreate","create","objectGetOwnPropertyNames","getOwnPropertyNames","objectGetOwnPropertyDescriptor","getOwnPropertyDescriptor","objectDefineProperty","defineProperty","ClassDescriptor","value","writable","configurable","enumerable","__proto__","objectDefine","name","this","call","prototype","Function","define","source","property","names","properties","constructor","i","e","TypeError"],"mappings":";CAAC,SAASA,GACT,aAEA,IAAIC,EAAiCC,OACpCC,EAAiCF,EAAOG,OACxCC,EAAiCJ,EAAOK,oBACxCC,EAAiCN,EAAOO,yBACxCC,EAAiCR,EAAOS,eAEzC,SAASC,EAAgBC,EAAOC,EAAUC,EAAcC,GACvD,MAAO,CACNC,UAAc,KACdJ,MAAcA,EACdG,aAAgBA,EAChBD,eAAgBA,EAChBD,WAAgBA,GAIlB,SAASI,EAAaC,EAAMN,EAAOC,EAAUC,EAAcC,GAC1DN,EAAqBU,KAAMD,EAAM,IAAIP,EAAgBC,EAAOC,EAAUC,EAAcC,IA6BrFE,EAAaG,KAAKlB,OAAOmB,UAAW,SAAUJ,GAC9CK,SAASD,UAAUE,OAAO,WA3B1B,SAAyBC,GAOxB,IANA,IAIQC,EAHPJ,EADgBF,KACc,UAC9BO,EAAarB,EAA0BgB,GACvCM,EAAa,CAAEC,YAAc,IAAIjB,EAHjBQ,MAGuC,GAAM,IAC7DU,EAAI,GAEEJ,EAAWC,EAAMG,MAAQF,EAAWF,GAAWI,IACrDF,EAAWF,GAAYlB,EAA+Bc,EAAWI,GAGlE,IAViBN,KAWC,UAAIhB,EAAaqB,EAAmB,WAAKA,EAAQG,GACjE,MAAMG,IAMR,GAlBiBX,KAkBG,YAAME,EACzB,MAAM,IAAIU,UAAU,+CAGrB,OAtBiBZ,QAxBnB","file":"base.js","sourcesContent":["(function(strPrototype) {\n\t'use strict';\n\n\tvar object = Object,\n\t\tobjectCreate = object.create,\n\t\tobjectGetOwnPropertyNames = object.getOwnPropertyNames,\n\t\tobjectGetOwnPropertyDescriptor = object.getOwnPropertyDescriptor,\n\t\tobjectDefineProperty = object.defineProperty;\n\n\tfunction ClassDescriptor(value, writable, configurable, enumerable) {\n\t\treturn {\n\t\t\t__proto__: null,\n\t\t\tvalue: value,\n\t\t\tenumerable: !!enumerable,\n\t\t\tconfigurable: !!configurable,\n\t\t\twritable: !!writable\n\t\t};\n\t}\n\n\tfunction objectDefine(name, value, writable, configurable, enumerable) {\n\t\tobjectDefineProperty(this, name, new ClassDescriptor(value, writable, configurable, enumerable));\n\t}\n\n\tfunction functionExtends(source) {\n\t\tvar self = this,\n\t\t\tprototype = self[strPrototype],\n\t\t\tnames = objectGetOwnPropertyNames(prototype),\n\t\t\tproperties = { constructor: new ClassDescriptor(self, true, true)},\n\t\t\ti = 0, property;\n\n\t\tfor(; (property = names[i]) && !properties[property]; i++) {\n\t\t\tproperties[property] = objectGetOwnPropertyDescriptor(prototype, property);\n\t\t}\n\n\t\ttry {\n\t\t\tself[strPrototype] = objectCreate(source[strPrototype] || source, properties);\n\t\t} catch(e) {\n\t\t\t// ES6 class prototypes are readonly at least in Chrome\n\t\t\t// (and assignment throws an error in strict mode) ...\n\t\t}\n\n\t\t// ... which is handled here\n\t\tif(self[strPrototype] === prototype) {\n\t\t\tthrow new TypeError('Unable to extend, prototype is not writable');\n\t\t}\n\n\t\treturn self;\n\t}\n\n\tobjectDefine.call(Object.prototype, 'define', objectDefine);\n\tFunction.prototype.define('extends', functionExtends);\n}('prototype'));\n"]} \ No newline at end of file +{"version":3,"sources":["base.js"],"names":["strPrototype","object","Object","objectCreate","create","objectGetOwnPropertyNames","getOwnPropertyNames","objectGetOwnPropertyDescriptor","getOwnPropertyDescriptor","objectDefineProperty","defineProperty","ClassDescriptor","value","writable","configurable","enumerable","__proto__","objectDefine","name","this","call","prototype","Function","define","source","property","self","names","properties","constructor","i","e","TypeError"],"mappings":";CAAC,SAASA,GACT,aAEA,IAAIC,EAAiCC,OACpCC,EAAiCF,EAAOG,OACxCC,EAAiCJ,EAAOK,oBACxCC,EAAiCN,EAAOO,yBACxCC,EAAiCR,EAAOS,eAEzC,SAASC,EAAgBC,EAAOC,EAAUC,EAAcC,GACvD,MAAO,CACNC,UAAc,KACdJ,MAAcA,EACdG,aAAgBA,EAChBD,eAAgBA,EAChBD,WAAgBA,GAIlB,SAASI,EAAaC,EAAMN,EAAOC,EAAUC,EAAcC,GAC1DN,EAAqBU,KAAMD,EAAM,IAAIP,EAAgBC,EAAOC,EAAUC,EAAcC,IA6BrFE,EAAaG,KAAKlB,OAAOmB,UAAW,SAAUJ,GAC9CK,SAASD,UAAUE,OAAO,WA3B1B,SAAyBC,GAOxB,IANA,IAIQC,EAJJC,EAAaP,KAChBE,EAAaK,EAAiB,UAC9BC,EAAatB,EAA0BgB,GACvCO,EAAa,CAAEC,YAAc,IAAIlB,EAAgBe,GAAM,GAAM,IAC7DI,EAAI,GAEEL,EAAWE,EAAMG,MAAQF,EAAWH,GAAWK,IACrDF,EAAWH,GAAYlB,EAA+Bc,EAAWI,GAGlE,IACCC,EAAiB,UAAIvB,EAAaqB,EAAmB,WAAKA,EAAQI,GACjE,MAAMG,IAMR,GAAGL,EAAiB,YAAML,EACzB,MAAM,IAAIW,UAAU,+CAGrB,OAAON,KA9CT","file":"base.js","sourcesContent":["(function(strPrototype) {\n\t'use strict';\n\n\tvar object = Object,\n\t\tobjectCreate = object.create,\n\t\tobjectGetOwnPropertyNames = object.getOwnPropertyNames,\n\t\tobjectGetOwnPropertyDescriptor = object.getOwnPropertyDescriptor,\n\t\tobjectDefineProperty = object.defineProperty;\n\n\tfunction ClassDescriptor(value, writable, configurable, enumerable) {\n\t\treturn {\n\t\t\t__proto__: null,\n\t\t\tvalue: value,\n\t\t\tenumerable: !!enumerable,\n\t\t\tconfigurable: !!configurable,\n\t\t\twritable: !!writable\n\t\t};\n\t}\n\n\tfunction objectDefine(name, value, writable, configurable, enumerable) {\n\t\tobjectDefineProperty(this, name, new ClassDescriptor(value, writable, configurable, enumerable));\n\t}\n\n\tfunction functionExtends(source) {\n\t\tvar self = this,\n\t\t\tprototype = self[strPrototype],\n\t\t\tnames = objectGetOwnPropertyNames(prototype),\n\t\t\tproperties = { constructor: new ClassDescriptor(self, true, true)},\n\t\t\ti = 0, property;\n\n\t\tfor(; (property = names[i]) && !properties[property]; i++) {\n\t\t\tproperties[property] = objectGetOwnPropertyDescriptor(prototype, property);\n\t\t}\n\n\t\ttry {\n\t\t\tself[strPrototype] = objectCreate(source[strPrototype] || source, properties);\n\t\t} catch(e) {\n\t\t\t// ES6 class prototypes are readonly at least in Chrome\n\t\t\t// (and assignment throws an error in strict mode) ...\n\t\t}\n\n\t\t// ... which is handled here\n\t\tif(self[strPrototype] === prototype) {\n\t\t\tthrow new TypeError('Unable to extend, prototype is not writable');\n\t\t}\n\n\t\treturn self;\n\t}\n\n\tobjectDefine.call(Object.prototype, 'define', objectDefine);\n\tFunction.prototype.define('extends', functionExtends);\n}('prototype'));\n"]} \ No newline at end of file diff --git a/dist/component/iterator.js b/dist/component/iterator.js index ddbb769..de20274 100644 --- a/dist/component/iterator.js +++ b/dist/component/iterator.js @@ -1,3 +1,3 @@ -/**! Qoopido.nucleus 3.2.7 | http://nucleus.qoopido.com | (c) 2020 Dirk Lueth */ -!function(){"use strict";provide(["/demand/weakmap","../emitter","../function/merge"],(function(t,e,n){var i=new t;function s(t,e){var n;if((n=i.get(t))&&n.data)return n.data[e]}function r(t,s){var a=e.call(this);return i.set(a,{settings:n({},r.settings,s),index:null,data:null}),t&&a.setData(t),a}return r.prototype={get length(){return s(this,"length")||0},get index(){return function(t,e){var n;if(n=i.get(t))return n.index}(this)},get item(){return s(this,this.index)},setData:function(t){var e,n;return"object"==typeof t&&t.length&&(n=(e=i.get(this)).settings,e.data=t,null!==n.initial&&this.seek(n.initial)),this},seek:function(t){var e=i.get(this);return(t=parseInt(t,10))!==e.index&&"undefined"!=typeof e.data[t]&&(e.index=t),this},first:function(){return this.seek(0)},last:function(){return this.seek(this.length-1)},previous:function(){var t,e=i.get(this).settings;return t=!0===e.loop?(this.index-1)%this.length:this.index-1,t=!0===e.loop&&t<0?this.length+t:t,this.seek(t)},next:function(){var t;return t=!0===i.get(this).settings.loop?(this.index+1)%this.length:this.index+1,this.seek(t)}},r.settings={loop:!0,initial:0},r.extends(e)}))}(); +/**! Qoopido.nucleus 3.2.8 | http://nucleus.qoopido.com | (c) 2020 Dirk Lueth */ +!function(){"use strict";provide(["/demand/weakmap","../emitter","../function/merge"],(function(t,e,n){var i=new t;function r(t,e){var n;if((n=i.get(t))&&n.data)return n.data[e]}function s(t,r){var a=e.call(this);return i.set(a,{settings:n({},s.settings,r),index:null,data:null}),t&&a.setData(t),a}return s.prototype={get length(){return r(this,"length")||0},get index(){return function(t,e){var n;if(n=i.get(t))return n.index}(this)},get item(){return r(this,this.index)},setData:function(t){var e,n,r=this;return"object"==typeof t&&t.length&&(n=(e=i.get(r)).settings,e.data=t,null!==n.initial&&r.seek(n.initial)),r},seek:function(t){var e=i.get(this);return(t=parseInt(t,10))!==e.index&&"undefined"!=typeof e.data[t]&&(e.index=t),this},first:function(){return this.seek(0)},last:function(){return this.seek(this.length-1)},previous:function(){var t,e=this,n=i.get(e).settings;return t=!0===n.loop?(e.index-1)%e.length:e.index-1,t=!0===n.loop&&t<0?e.length+t:t,e.seek(t)},next:function(){var t,e=this;return t=!0===i.get(e).settings.loop?(e.index+1)%e.length:e.index+1,e.seek(t)}},s.settings={loop:!0,initial:0},s.extends(e)}))}(); //# sourceMappingURL=iterator.js.map diff --git a/dist/component/iterator.js.map b/dist/component/iterator.js.map index c94b3bf..9108ccc 100644 --- a/dist/component/iterator.js.map +++ b/dist/component/iterator.js.map @@ -1 +1 @@ -{"version":3,"sources":["component/iterator.js"],"names":["provide","Weakmap","Emitter","functionMerge","storage","getDataProperty","context","property","properties","get","data","ComponentIterator","settings","self","call","this","set","index","setData","prototype","length","getStorageProperty","item","initial","seek","parseInt","first","last","previous","loop","next","extends"],"mappings":";CAOC,WACA,aAiHAA,QAAQ,CAAE,kBAAmB,aAAc,sBA/G3C,SAAoBC,EAASC,EAASC,GACrC,IAAIC,EAAU,IAAIH,EAUlB,SAASI,EAAgBC,EAASC,GACjC,IAAIC,EAEJ,IAAIA,EAAaJ,EAAQK,IAAIH,KAAa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2B,IAHbb,EAAQK,IADLM,MACeH,SAGdiB,MAJDd,KAIwBE,MAAQ,GAJhCF,KAI0CK,OAJ1CL,KAIwDE,MAAQ,EAJhEF,KAMLS,KAAKP,KAIpBN,EAAkBC,SAAW,CAAEiB,MAAM,EAAMN,QAAS,GAE7CZ,EAAkBoB,QAAQ7B,MA/GnC","file":"iterator.js","sourcesContent":["/**\n * @use /demand/weakmap\n *\n * @require ../emitter\n * @require ../function/merge\n */\n\n(function() {\n\t'use strict';\n\n\tfunction definition(Weakmap, Emitter, functionMerge) {\n\t\tvar storage = new Weakmap();\n\n\t\tfunction getStorageProperty(context, property) {\n\t\t\tvar properties;\n\n\t\t\tif(properties = storage.get(context)) {\n\t\t\t\treturn properties[property];\n\t\t\t}\n\t\t}\n\n\t\tfunction getDataProperty(context, property) {\n\t\t\tvar properties;\n\n\t\t\tif((properties = storage.get(context)) && properties.data) {\n\t\t\t\treturn properties.data[property];\n\t\t\t}\n\t\t}\n\n\t\tfunction ComponentIterator(data, settings) {\n\t\t\tvar self = Emitter.call(this);\n\n\t\t\tstorage.set(self, {\n\t\t\t\tsettings: functionMerge({}, ComponentIterator.settings, settings),\n\t\t\t\tindex: null,\n\t\t\t\tdata: null\n\t\t\t});\n\n\t\t\tdata && self.setData(data);\n\n\t\t\treturn self;\n\t\t}\n\n\t\tComponentIterator.prototype = {\n\t\t\t// properties\n\t\t\t\t// length\n\t\t\t\t\tget length() {\n\t\t\t\t\t\treturn getDataProperty(this, 'length') || 0;\n\t\t\t\t\t},\n\t\t\t\t// index\n\t\t\t\t\tget index() {\n\t\t\t\t\t\treturn getStorageProperty(this, 'index');\n\t\t\t\t\t},\n\t\t\t\t// item\n\t\t\t\t\tget item() {\n\t\t\t\t\t\treturn getDataProperty(this, this.index);\n\t\t\t\t\t},\n\t\t\t// methods\n\t\t\t\tsetData: function(data) {\n\t\t\t\t\tvar self = this,\n\t\t\t\t\t\tproperties, settings;\n\n\t\t\t\t\tif(typeof data === 'object' && data.length) {\n\t\t\t\t\t\tproperties = storage.get(self);\n\t\t\t\t\t\tsettings = properties.settings;\n\n\t\t\t\t\t\tproperties.data = data;\n\n\t\t\t\t\t\tif(settings.initial !== null) {\n\t\t\t\t\t\t\tself.seek(settings.initial);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn self;\n\t\t\t\t},\n\t\t\t\tseek: function(index) {\n\t\t\t\t\tvar self = this,\n\t\t\t\t\t\tproperties = storage.get(self);\n\n\t\t\t\t\tindex = parseInt(index, 10);\n\n\t\t\t\t\tif(index !== properties.index && typeof properties.data[index] !== 'undefined') {\n\t\t\t\t\t\tproperties.index = index;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn self;\n\t\t\t\t},\n\t\t\t\tfirst: function() {\n\t\t\t\t\treturn this.seek(0);\n\t\t\t\t},\n\t\t\t\tlast: function() {\n\t\t\t\t\tvar self = this;\n\n\t\t\t\t\treturn self.seek(self.length - 1);\n\t\t\t\t},\n\t\t\t\tprevious: function() {\n\t\t\t\t\tvar self = this,\n\t\t\t\t\t\tsettings = storage.get(self).settings,\n\t\t\t\t\t\tindex;\n\n\t\t\t\t\tindex = (settings.loop === true) ? (self.index - 1) % self.length : self.index - 1;\n\t\t\t\t\tindex = (settings.loop === true && index < 0) ? self.length + index : index;\n\n\t\t\t\t\treturn self.seek(index);\n\t\t\t\t},\n\t\t\t\tnext: function() {\n\t\t\t\t\tvar self = this,\n\t\t\t\t\t\tsettings = storage.get(self).settings,\n\t\t\t\t\t\tindex;\n\n\t\t\t\t\tindex = (settings.loop === true) ? (self.index + 1) % self.length : self.index + 1;\n\n\t\t\t\t\treturn self.seek(index);\n\t\t\t\t}\n\t\t};\n\n\t\tComponentIterator.settings = { loop: true, initial: 0 };\n\n\t\treturn ComponentIterator.extends(Emitter);\n\t}\n\n\tprovide([ '/demand/weakmap', '../emitter', '../function/merge' ], definition);\n}());\n"]} \ No newline at end of file +{"version":3,"sources":["component/iterator.js"],"names":["provide","Weakmap","Emitter","functionMerge","storage","getDataProperty","context","property","properties","get","data","ComponentIterator","settings","self","call","this","set","index","setData","prototype","length","getStorageProperty","item","initial","seek","parseInt","first","last","previous","loop","next","extends"],"mappings":";CAOC,WACA,aAiHAA,QAAQ,CAAE,kBAAmB,aAAc,sBA/G3C,SAAoBC,EAASC,EAASC,GACrC,IAAIC,EAAU,IAAIH,EAUlB,SAASI,EAAgBC,EAASC,GACjC,IAAIC,EAEJ,IAAIA,EAAaJ,EAAQK,IAAIH,KAAaE,EAAWE,KACpD,OAAOF,EAAWE,KAAKH,GAIzB,SAASI,EAAkBD,EAAME,GAChC,IAAIC,EAAOX,EAAQY,KAAKC,MAUxB,OARAX,EAAQY,IAAIH,EAAM,CACjBD,SAAUT,EAAc,GAAIQ,EAAkBC,SAAUA,GACxDK,MAAU,KACVP,KAAU,OAGXA,GAAQG,EAAKK,QAAQR,GAEdG,EA8ER,OA3EAF,EAAkBQ,UAAY,CAG3BC,aACC,OAAOf,EAAgBU,KAAM,WAAa,GAG3CE,YACC,OAtCJ,SAA4BX,EAASC,GACpC,IAAIC,EAEJ,GAAGA,EAAaJ,EAAQK,IAAIH,GAC3B,OAAOE,EAAmB,MAkCjBa,CAAmBN,OAG3BO,WACC,OAAOjB,EAAgBU,KAAMA,KAAKE,QAGpCC,QAAS,SAASR,GACjB,IACCF,EAAYI,EADTC,EAAOE,KAcX,MAXmB,iBAATL,GAAqBA,EAAKU,SAEnCR,GADAJ,EAAaJ,EAAQK,IAAII,IACDD,SAExBJ,EAAWE,KAAOA,EAEM,OAArBE,EAASW,SACXV,EAAKW,KAAKZ,EAASW,UAIdV,GAERW,KAAM,SAASP,GACd,IACCT,EAAaJ,EAAQK,IADLM,MASjB,OANAE,EAAQQ,SAASR,EAAO,OAEXT,EAAWS,OAA2C,oBAA3BT,EAAWE,KAAKO,KACvDT,EAAWS,MAAQA,GANHF,MAWlBW,MAAO,WACN,OAAOX,KAAKS,KAAK,IAElBG,KAAM,WAGL,OAFWZ,KAECS,KAFDT,KAEWK,OAAS,IAEhCQ,SAAU,WACT,IAECX,EAFGJ,EAAaE,KAChBH,EAAaR,EAAQK,IAAII,GAAMD,SAMhC,OAHAK,GAA2B,IAAlBL,EAASiB,MAAkBhB,EAAKI,MAAQ,GAAKJ,EAAKO,OAASP,EAAKI,MAAQ,EACjFA,GAA2B,IAAlBL,EAASiB,MAAiBZ,EAAQ,EAAKJ,EAAKO,OAASH,EAAQA,EAE/DJ,EAAKW,KAAKP,IAElBa,KAAM,WACL,IAECb,EAFGJ,EAAaE,KAMjB,OAFAE,GAA2B,IAHbb,EAAQK,IAAII,GAAMD,SAGdiB,MAAkBhB,EAAKI,MAAQ,GAAKJ,EAAKO,OAASP,EAAKI,MAAQ,EAE1EJ,EAAKW,KAAKP,KAIpBN,EAAkBC,SAAW,CAAEiB,MAAM,EAAMN,QAAS,GAE7CZ,EAAkBoB,QAAQ7B,MA/GnC","file":"iterator.js","sourcesContent":["/**\n * @use /demand/weakmap\n *\n * @require ../emitter\n * @require ../function/merge\n */\n\n(function() {\n\t'use strict';\n\n\tfunction definition(Weakmap, Emitter, functionMerge) {\n\t\tvar storage = new Weakmap();\n\n\t\tfunction getStorageProperty(context, property) {\n\t\t\tvar properties;\n\n\t\t\tif(properties = storage.get(context)) {\n\t\t\t\treturn properties[property];\n\t\t\t}\n\t\t}\n\n\t\tfunction getDataProperty(context, property) {\n\t\t\tvar properties;\n\n\t\t\tif((properties = storage.get(context)) && properties.data) {\n\t\t\t\treturn properties.data[property];\n\t\t\t}\n\t\t}\n\n\t\tfunction ComponentIterator(data, settings) {\n\t\t\tvar self = Emitter.call(this);\n\n\t\t\tstorage.set(self, {\n\t\t\t\tsettings: functionMerge({}, ComponentIterator.settings, settings),\n\t\t\t\tindex: null,\n\t\t\t\tdata: null\n\t\t\t});\n\n\t\t\tdata && self.setData(data);\n\n\t\t\treturn self;\n\t\t}\n\n\t\tComponentIterator.prototype = {\n\t\t\t// properties\n\t\t\t\t// length\n\t\t\t\t\tget length() {\n\t\t\t\t\t\treturn getDataProperty(this, 'length') || 0;\n\t\t\t\t\t},\n\t\t\t\t// index\n\t\t\t\t\tget index() {\n\t\t\t\t\t\treturn getStorageProperty(this, 'index');\n\t\t\t\t\t},\n\t\t\t\t// item\n\t\t\t\t\tget item() {\n\t\t\t\t\t\treturn getDataProperty(this, this.index);\n\t\t\t\t\t},\n\t\t\t// methods\n\t\t\t\tsetData: function(data) {\n\t\t\t\t\tvar self = this,\n\t\t\t\t\t\tproperties, settings;\n\n\t\t\t\t\tif(typeof data === 'object' && data.length) {\n\t\t\t\t\t\tproperties = storage.get(self);\n\t\t\t\t\t\tsettings = properties.settings;\n\n\t\t\t\t\t\tproperties.data = data;\n\n\t\t\t\t\t\tif(settings.initial !== null) {\n\t\t\t\t\t\t\tself.seek(settings.initial);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn self;\n\t\t\t\t},\n\t\t\t\tseek: function(index) {\n\t\t\t\t\tvar self = this,\n\t\t\t\t\t\tproperties = storage.get(self);\n\n\t\t\t\t\tindex = parseInt(index, 10);\n\n\t\t\t\t\tif(index !== properties.index && typeof properties.data[index] !== 'undefined') {\n\t\t\t\t\t\tproperties.index = index;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn self;\n\t\t\t\t},\n\t\t\t\tfirst: function() {\n\t\t\t\t\treturn this.seek(0);\n\t\t\t\t},\n\t\t\t\tlast: function() {\n\t\t\t\t\tvar self = this;\n\n\t\t\t\t\treturn self.seek(self.length - 1);\n\t\t\t\t},\n\t\t\t\tprevious: function() {\n\t\t\t\t\tvar self = this,\n\t\t\t\t\t\tsettings = storage.get(self).settings,\n\t\t\t\t\t\tindex;\n\n\t\t\t\t\tindex = (settings.loop === true) ? (self.index - 1) % self.length : self.index - 1;\n\t\t\t\t\tindex = (settings.loop === true && index < 0) ? self.length + index : index;\n\n\t\t\t\t\treturn self.seek(index);\n\t\t\t\t},\n\t\t\t\tnext: function() {\n\t\t\t\t\tvar self = this,\n\t\t\t\t\t\tsettings = storage.get(self).settings,\n\t\t\t\t\t\tindex;\n\n\t\t\t\t\tindex = (settings.loop === true) ? (self.index + 1) % self.length : self.index + 1;\n\n\t\t\t\t\treturn self.seek(index);\n\t\t\t\t}\n\t\t};\n\n\t\tComponentIterator.settings = { loop: true, initial: 0 };\n\n\t\treturn ComponentIterator.extends(Emitter);\n\t}\n\n\tprovide([ '/demand/weakmap', '../emitter', '../function/merge' ], definition);\n}());\n"]} \ No newline at end of file diff --git a/dist/component/sense.js b/dist/component/sense.js index 85c37aa..351d93b 100644 --- a/dist/component/sense.js +++ b/dist/component/sense.js @@ -1,3 +1,3 @@ -/**! Qoopido.nucleus 3.2.7 | http://nucleus.qoopido.com | (c) 2020 Dirk Lueth */ +/**! Qoopido.nucleus 3.2.8 | http://nucleus.qoopido.com | (c) 2020 Dirk Lueth */ !function(t){"use strict";provide(["/demand/weakmap","../emitter",t.matchMedia||"../polyfill/window/matchmedia"],(function(t,e,a){var i=new t;function n(t){var n=e.call(this),r=a(t);return i.set(n,r),r.addListener((function(){n.emit(!0===r.matches?"match":"unmatch")})),n}return n.prototype={get matches(){var t=i.get(this);if(t)return t.matches}},n.extends(e)}))}(this); //# sourceMappingURL=sense.js.map diff --git a/dist/dom/collection.js b/dist/dom/collection.js index 201f199..3c23b0b 100644 --- a/dist/dom/collection.js +++ b/dist/dom/collection.js @@ -1,3 +1,3 @@ -/**! Qoopido.nucleus 3.2.7 | http://nucleus.qoopido.com | (c) 2020 Dirk Lueth */ -!function(t){"use strict";provide(["/demand/validator/isTypeOf","/demand/validator/isInstanceOf","/demand/descriptor","./element"],(function(e,n,r,i){var s=Array.prototype.slice,l=Object.defineProperty;function o(n){var r,i,l=0;if(e(n,"string"))for(r=n.split(","),n=[],l=0;i=r[l];l++)try{n=n.concat(s.call(t.querySelectorAll(i)))}catch(t){}return n.length&&!Array.isArray(n)&&(n=s.call(n)),Array.isArray(n)||(n=[n]),n}function c(t){for(var e,n=this,r=n.elements,i=s.call(arguments,1),l=0;e=r[l];l++)e[t].apply(e,i);return n}function u(t,e){return(t=n(t,i)?t:new i(t))&&t[e].call(t,a(this.elements)),this}function a(e){for(var n,r=t.createDocumentFragment(),i=0;n=e[i];i++)r.appendChild(n.node);return r}function f(t){return l(this,"elements",new r([])),l(this,"nodes",new r([])),t&&this.add(t),this}return f.prototype={get length(){return this.elements.length},get:function(t){return this.elements[t]},add:function(t){var e,r=0;for(t=o(t);e=t[r];r++)-1===this.nodes.indexOf(e.node||e)&&(e=n(e,i)?e:new i(e),this.elements.push(e),this.nodes.push(e.node));return this},remove:function(t){var e,n,r=0;for(t=o(t);e=t[r];r++)-1!==(n=this.nodes.indexOf(e.node||e))&&(this.elements.splice(n,1),this.nodes.splice(n,1));return this},each:function(t){for(var e,n=this.elements,r=0;e=n[r];r++)t.call(e,r);return this},setAttribute:function(t,e){return c.call(this,"setAttribute",t,e)},setAttributes:function(t){return c.call(this,"setAttributes",t)},removeAttribute:function(t){return c.call(this,"removeAttribute",t)},removeAttributes:function(t){return c.call(this,"removeAttributes",t)},setStyle:function(t,e){return c.call(this,"setStyle",t,e)},setStyles:function(t){return c.call(this,"setStyles",t)},removeStyle:function(t){return c.call(this,"removeStyle",t)},removeStyles:function(t){return c.call(this,"removeStyles",t)},addClass:function(t){return c.call(this,"addClass",t)},removeClass:function(t){return c.call(this,"removeClass",t)},toggleClass:function(t){return c.call(this,"toggleClass",t)},prependTo:function(t){return u.call(this,t,"prepend")},appendTo:function(t){return u.call(this,t,"append")},insertBefore:function(t){return(t=n(t,i)?t:new i(t))&&(t=t.node)&&t.parentNode.insertBefore(a(this.elements),t),this},insertAfter:function(t){var e,r;return(t=n(t,i)?t:new i(t))&&(t=t.node)&&(r=a(this.elements),(e=t.nextSibling)?t.parentNode.insertBefore(r,e):t.parentNode.appendChild(r)),this},replace:function(t){for(var e,n=this.elements,r=0;e=n[r];r++)0===r?e.replace(t):e.insertAfter(n[r-1]);return this},detach:function(){for(var t,e=this.elements,n=0;t=e[n];n++)t.detach();return this},blur:function(){return c.call(this,"blur")},on:function(){return c.apply(this,["on"].concat(s.call(arguments)))},one:function(){return c.apply(this,["one"].concat(s.call(arguments)))},off:function(){return c.apply(this,["off"].concat(s.call(arguments)))},emit:function(){return c.apply(this,["emit"].concat(s.call(arguments)))}},f}))}(document); +/**! Qoopido.nucleus 3.2.8 | http://nucleus.qoopido.com | (c) 2020 Dirk Lueth */ +!function(e){"use strict";provide(["/demand/validator/isTypeOf","/demand/validator/isInstanceOf","/demand/descriptor","./element"],(function(t,n,r,i){var s=Array.prototype.slice,l=Object.defineProperty;function o(n){var r,i,l=0;if(t(n,"string"))for(r=n.split(","),n=[],l=0;i=r[l];l++)try{n=n.concat(s.call(e.querySelectorAll(i)))}catch(e){}return n.length&&!Array.isArray(n)&&(n=s.call(n)),Array.isArray(n)||(n=[n]),n}function c(e){for(var t,n=this,r=n.elements,i=s.call(arguments,1),l=0;t=r[l];l++)t[e].apply(t,i);return n}function a(e,t){return(e=n(e,i)?e:new i(e))&&e[t].call(e,u(this.elements)),this}function u(t){for(var n,r=e.createDocumentFragment(),i=0;n=t[i];i++)r.appendChild(n.node);return r}function f(e){var t=this;return l(t,"elements",new r([])),l(t,"nodes",new r([])),e&&t.add(e),t}return f.prototype={get length(){return this.elements.length},get:function(e){return this.elements[e]},add:function(e){var t,r=this,s=0;for(e=o(e);t=e[s];s++)-1===r.nodes.indexOf(t.node||t)&&(t=n(t,i)?t:new i(t),r.elements.push(t),r.nodes.push(t.node));return r},remove:function(e){var t,n,r=this,i=0;for(e=o(e);t=e[i];i++)-1!==(n=r.nodes.indexOf(t.node||t))&&(r.elements.splice(n,1),r.nodes.splice(n,1));return r},each:function(e){for(var t,n=this.elements,r=0;t=n[r];r++)e.call(t,r);return this},setAttribute:function(e,t){return c.call(this,"setAttribute",e,t)},setAttributes:function(e){return c.call(this,"setAttributes",e)},removeAttribute:function(e){return c.call(this,"removeAttribute",e)},removeAttributes:function(e){return c.call(this,"removeAttributes",e)},setStyle:function(e,t){return c.call(this,"setStyle",e,t)},setStyles:function(e){return c.call(this,"setStyles",e)},removeStyle:function(e){return c.call(this,"removeStyle",e)},removeStyles:function(e){return c.call(this,"removeStyles",e)},addClass:function(e){return c.call(this,"addClass",e)},removeClass:function(e){return c.call(this,"removeClass",e)},toggleClass:function(e){return c.call(this,"toggleClass",e)},prependTo:function(e){return a.call(this,e,"prepend")},appendTo:function(e){return a.call(this,e,"append")},insertBefore:function(e){return(e=n(e,i)?e:new i(e))&&(e=e.node)&&e.parentNode.insertBefore(u(this.elements),e),this},insertAfter:function(e){var t,r;return(e=n(e,i)?e:new i(e))&&(e=e.node)&&(r=u(this.elements),(t=e.nextSibling)?e.parentNode.insertBefore(r,t):e.parentNode.appendChild(r)),this},replace:function(e){for(var t,n=this.elements,r=0;t=n[r];r++)0===r?t.replace(e):t.insertAfter(n[r-1]);return this},detach:function(){for(var e,t=this.elements,n=0;e=t[n];n++)e.detach();return this},blur:function(){return c.call(this,"blur")},on:function(){return c.apply(this,["on"].concat(s.call(arguments)))},one:function(){return c.apply(this,["one"].concat(s.call(arguments)))},off:function(){return c.apply(this,["off"].concat(s.call(arguments)))},emit:function(){return c.apply(this,["emit"].concat(s.call(arguments)))}},f}))}(document); //# sourceMappingURL=collection.js.map diff --git a/dist/dom/collection.js.map b/dist/dom/collection.js.map index 6b75d3d..1353636 100644 --- a/dist/dom/collection.js.map +++ b/dist/dom/collection.js.map @@ -1 +1 @@ -{"version":3,"sources":["dom/collection.js"],"names":["document","provide","isTypeOf","isInstanceOf","Descriptor","DomElement","arrayPrototypeSlice","Array","prototype","slice","objectDefineProperty","Object","defineProperty","resolveElements","elements","selectors","selector","i","split","concat","call","querySelectorAll","exception","length","isArray","map","method","element","self","this","parameter","arguments","apply","mapFragment","target","buildFragment","fragment","createDocumentFragment","appendChild","node","DomCollection","add","get","index","temp","nodes","indexOf","push","remove","splice","each","callback","setAttribute","attribute","value","setAttributes","attributes","removeAttribute","removeAttributes","setStyle","property","setStyles","properties","removeStyle","removeStyles","addClass","name","removeClass","toggleClass","prependTo","appendTo","insertBefore","parentNode","insertAfter","sibling","nextSibling","replace","detach","blur","on","one","off","emit"],"mappings":";CAQC,SAASA,GACT,aAoPAC,QAAQ,CAAE,6BAA8B,iCAAkC,qBAAsB,cAlPhG,SAAoBC,EAAUC,EAAcC,EAAYC,GACvD,IAAIC,EAAuBC,MAAMC,UAAUC,MAC1CC,EAAuBC,OAAOC,eAE/B,SAASC,EAAgBC,GACxB,IAAIC,EAAWC,EAAUC,EAAI,EAE7B,GAAGf,EAASY,EAAU,UAIrB,IAHAC,EAAYD,EAASI,MAAM,KAC3BJ,EAAY,GAERG,EAAI,EAAGD,EAAWD,EAAUE,GAAIA,IACnC,IACCH,EAAWA,EAASK,OAAOb,EAAoBc,KAAKpB,EAASqB,iBAAiBL,KAC7E,MAAMM,IAYV,OARGR,EAASS,SAAWhB,MAAMiB,QAAQV,KACpCA,EAAWR,EAAoBc,KAAKN,IAGjCP,MAAMiB,QAAQV,KACjBA,EAAW,CAAEA,IAGPA,EAGR,SAASW,EAAIC,GAMZ,IALA,IAGQC,EAHJC,EAAYC,KACff,EAAYc,EAAKd,SACjBgB,EAAYxB,EAAoBc,KAAKW,UAAW,GAChDd,EAAI,EAECU,EAAUb,EAASG,GAAIA,IAC5BU,EAAQD,GAAQM,MAAML,EAASG,GAGhC,OAAOF,EAGR,SAASK,EAAYC,EAAQR,GAS5B,OANAQ,EAAS/B,EAAa+B,EAAQ7B,GAAc6B,EAAS,IAAI7B,EAAW6B,KAGnEA,EAAOR,GAAQN,KAAKc,EAAQC,EALlBN,KAKqCf,WALrCe,KAWZ,SAASM,EAAcrB,GAItB,IAHA,IACQa,EADJS,EAAWpC,EAASqC,yBACvBpB,EAAI,EAECU,EAAUb,EAASG,GAAIA,IAC5BmB,EAASE,YAAYX,EAAQY,MAG9B,OAAOH,EAGR,SAASI,EAAc1B,GAUtB,OAPAJ,EAFWmB,KAEgB,WAAY,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,EADce,KACEf,SAChBG,EAAI,EAECU,EAAUb,EAASG,GAAIA,IAC5BU,EAAQkD,SAGT,OARehD,MAUhBiD,KAAM,WACL,OAAOrD,EAAIL,KAAKS,KAAM,SAEvBkD,GAAI,WACH,OAAOtD,EAAIO,MAAMH,KAAM,CAAE,MAAOV,OAAOb,EAAoBc,KAAKW,cAEjEiD,IAAK,WACJ,OAAOvD,EAAIO,MAAMH,KAAM,CAAE,OAAQV,OAAOb,EAAoBc,KAAKW,cAElEkD,IAAK,WACJ,OAAOxD,EAAIO,MAAMH,KAAM,CAAE,OAAQV,OAAOb,EAAoBc,KAAKW,cAElEmD,KAAM,WACL,OAAOzD,EAAIO,MAAMH,KAAM,CAAE,QAASV,OAAOb,EAAoBc,KAAKW,eAI7DS,KAlPT,CAsPExC","file":"collection.js","sourcesContent":["/**\n * @use /demand/validator/isTypeOf\n * @use /demand/validator/isInstanceOf\n * @use /demand/descriptor\n *\n * @require ../element\n */\n\n(function(document) {\n\t'use strict';\n\n\tfunction definition(isTypeOf, isInstanceOf, Descriptor, DomElement) {\n\t\tvar arrayPrototypeSlice = Array.prototype.slice,\n\t\t\tobjectDefineProperty = Object.defineProperty;\n\n\t\tfunction resolveElements(elements) {\n\t\t\tvar selectors, selector, i = 0;\n\n\t\t\tif(isTypeOf(elements, 'string')) {\n\t\t\t\tselectors = elements.split(',');\n\t\t\t\telements = [];\n\n\t\t\t\tfor(i = 0; selector = selectors[i]; i++) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\telements = elements.concat(arrayPrototypeSlice.call(document.querySelectorAll(selector)));\n\t\t\t\t\t} catch(exception) {} // eslint-disable-line no-empty\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(elements.length && !Array.isArray(elements)) {\n\t\t\t\telements = arrayPrototypeSlice.call(elements);\n\t\t\t}\n\n\t\t\tif(!Array.isArray(elements)) {\n\t\t\t\telements = [ elements ];\n\t\t\t}\n\n\t\t\treturn elements;\n\t\t}\n\n\t\tfunction map(method) {\n\t\t\tvar self = this,\n\t\t\t\telements = self.elements,\n\t\t\t\tparameter = arrayPrototypeSlice.call(arguments, 1),\n\t\t\t\ti = 0, element;\n\n\t\t\tfor(; element = elements[i]; i++) {\n\t\t\t\telement[method].apply(element, parameter);\n\t\t\t}\n\n\t\t\treturn self;\n\t\t}\n\n\t\tfunction mapFragment(target, method) {\n\t\t\tvar self = this;\n\n\t\t\ttarget = isInstanceOf(target, DomElement) ? target : new DomElement(target);\n\n\t\t\tif(target) {\n\t\t\t\ttarget[method].call(target, buildFragment(self.elements));\n\t\t\t}\n\n\t\t\treturn self;\n\t\t}\n\n\t\tfunction buildFragment(elements) {\n\t\t\tvar fragment = document.createDocumentFragment(),\n\t\t\t\ti = 0, element;\n\n\t\t\tfor(; element = elements[i]; i++) {\n\t\t\t\tfragment.appendChild(element.node);\n\t\t\t}\n\n\t\t\treturn fragment;\n\t\t}\n\n\t\tfunction DomCollection(elements) {\n\t\t\tvar self = this;\n\n\t\t\tobjectDefineProperty(self, 'elements', new Descriptor([]));\n\t\t\tobjectDefineProperty(self, 'nodes', new Descriptor([]));\n\n\t\t\tif(elements) {\n\t\t\t\tself.add(elements);\n\t\t\t}\n\n\t\t\treturn self;\n\t\t}\n\n\t\tDomCollection.prototype = {\n\t\t\t/* only for reference\n\t\t\telements: null,\n\t\t\tnodes: null\n\t\t\t*/\n\t\t\tget length() {\n\t\t\t\treturn this.elements.length;\n\t\t\t},\n\t\t\tget: function(index) {\n\t\t\t\treturn this.elements[index];\n\t\t\t},\n\t\t\tadd: function(elements) {\n\t\t\t\tvar self = this,\n\t\t\t\t\ti = 0, temp;\n\n\t\t\t\telements = resolveElements(elements);\n\n\t\t\t\tfor(; temp = elements[i]; i++) {\n\t\t\t\t\tif(self.nodes.indexOf(temp.node || temp) === -1) {\n\t\t\t\t\t\ttemp = isInstanceOf(temp, DomElement) ? temp : new DomElement(temp);\n\n\t\t\t\t\t\tself.elements.push(temp);\n\t\t\t\t\t\tself.nodes.push(temp.node);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tremove: function(elements) {\n\t\t\t\tvar self = this,\n\t\t\t\t\ti = 0, temp, index;\n\n\t\t\t\telements = resolveElements(elements);\n\n\t\t\t\tfor(; temp = elements[i]; i++) {\n\t\t\t\t\tif((index = self.nodes.indexOf(temp.node || temp)) !== -1) {\n\t\t\t\t\t\tself.elements.splice(index, 1);\n\t\t\t\t\t\tself.nodes.splice(index, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\teach: function(callback) {\n\t\t\t\tvar self = this,\n\t\t\t\t\telements = self.elements,\n\t\t\t\t\ti = 0, element;\n\n\t\t\t\tfor(; element = elements[i]; i++) {\n\t\t\t\t\tcallback.call(element, i);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tsetAttribute: function(attribute, value) {\n\t\t\t\treturn map.call(this, 'setAttribute', attribute, value);\n\t\t\t},\n\t\t\tsetAttributes: function(attributes) {\n\t\t\t\treturn map.call(this, 'setAttributes', attributes);\n\t\t\t},\n\t\t\tremoveAttribute: function(attribute) {\n\t\t\t\treturn map.call(this, 'removeAttribute', attribute);\n\t\t\t},\n\t\t\tremoveAttributes: function(attributes) {\n\t\t\t\treturn map.call(this, 'removeAttributes', attributes);\n\t\t\t},\n\t\t\tsetStyle: function(property, value) {\n\t\t\t\treturn map.call(this, 'setStyle', property, value);\n\t\t\t},\n\t\t\tsetStyles: function(properties) {\n\t\t\t\treturn map.call(this, 'setStyles', properties);\n\t\t\t},\n\t\t\tremoveStyle: function(property) {\n\t\t\t\treturn map.call(this, 'removeStyle', property);\n\t\t\t},\n\t\t\tremoveStyles: function(properties) {\n\t\t\t\treturn map.call(this, 'removeStyles', properties);\n\t\t\t},\n\t\t\taddClass: function(name) {\n\t\t\t\treturn map.call(this, 'addClass', name);\n\t\t\t},\n\t\t\tremoveClass: function(name) {\n\t\t\t\treturn map.call(this, 'removeClass', name);\n\t\t\t},\n\t\t\ttoggleClass: function(name) {\n\t\t\t\treturn map.call(this, 'toggleClass', name);\n\t\t\t},\n\t\t\tprependTo: function(target) {\n\t\t\t\treturn mapFragment.call(this, target, 'prepend');\n\t\t\t},\n\t\t\tappendTo: function(target) {\n\t\t\t\treturn mapFragment.call(this, target, 'append');\n\t\t\t},\n\t\t\tinsertBefore: function(target) {\n\t\t\t\tvar self = this;\n\n\t\t\t\ttarget = isInstanceOf(target, DomElement) ? target : new DomElement(target);\n\n\t\t\t\tif(target && (target = target.node)) {\n\t\t\t\t\ttarget.parentNode.insertBefore(buildFragment(self.elements), target);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tinsertAfter: function(target) {\n\t\t\t\tvar self = this,\n\t\t\t\t\tsibling, fragment;\n\n\t\t\t\ttarget = isInstanceOf(target, DomElement) ? target : new DomElement(target);\n\n\t\t\t\tif(target && (target = target.node)) {\n\t\t\t\t\tfragment = buildFragment(self.elements);\n\n\t\t\t\t\t(sibling = target.nextSibling) ? target.parentNode.insertBefore(fragment, sibling) : target.parentNode.appendChild(fragment);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\treplace: function(target) {\n\t\t\t\tvar self = this,\n\t\t\t\t\telements = self.elements,\n\t\t\t\t\ti = 0, element;\n\n\t\t\t\tfor(; element = elements[i]; i++) {\n\t\t\t\t\tif(i === 0) {\n\t\t\t\t\t\telement.replace(target);\n\t\t\t\t\t} else {\n\t\t\t\t\t\telement.insertAfter(elements[i - 1]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tdetach: function() {\n\t\t\t\tvar self = this,\n\t\t\t\t\telements = self.elements,\n\t\t\t\t\ti = 0, element;\n\n\t\t\t\tfor(; element = elements[i]; i++) {\n\t\t\t\t\telement.detach();\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tblur: function() {\n\t\t\t\treturn map.call(this, 'blur');\n\t\t\t},\n\t\t\ton: function() {\n\t\t\t\treturn map.apply(this, [ 'on' ].concat(arrayPrototypeSlice.call(arguments)));\n\t\t\t},\n\t\t\tone: function() {\n\t\t\t\treturn map.apply(this, [ 'one' ].concat(arrayPrototypeSlice.call(arguments)));\n\t\t\t},\n\t\t\toff: function() {\n\t\t\t\treturn map.apply(this, [ 'off' ].concat(arrayPrototypeSlice.call(arguments)));\n\t\t\t},\n\t\t\temit: function() {\n\t\t\t\treturn map.apply(this, [ 'emit' ].concat(arrayPrototypeSlice.call(arguments)));\n\t\t\t}\n\t\t};\n\n\t\treturn DomCollection;\n\t}\n\n\tprovide([ '/demand/validator/isTypeOf', '/demand/validator/isInstanceOf', '/demand/descriptor', './element' ], definition);\n}(document));\n"]} \ No newline at end of file +{"version":3,"sources":["dom/collection.js"],"names":["document","provide","isTypeOf","isInstanceOf","Descriptor","DomElement","arrayPrototypeSlice","Array","prototype","slice","objectDefineProperty","Object","defineProperty","resolveElements","elements","selectors","selector","i","split","concat","call","querySelectorAll","exception","length","isArray","map","method","element","self","this","parameter","arguments","apply","mapFragment","target","buildFragment","fragment","createDocumentFragment","appendChild","node","DomCollection","add","get","index","temp","nodes","indexOf","push","remove","splice","each","callback","setAttribute","attribute","value","setAttributes","attributes","removeAttribute","removeAttributes","setStyle","property","setStyles","properties","removeStyle","removeStyles","addClass","name","removeClass","toggleClass","prependTo","appendTo","insertBefore","parentNode","insertAfter","sibling","nextSibling","replace","detach","blur","on","one","off","emit"],"mappings":";CAQC,SAASA,GACT,aAoPAC,QAAQ,CAAE,6BAA8B,iCAAkC,qBAAsB,cAlPhG,SAAoBC,EAAUC,EAAcC,EAAYC,GACvD,IAAIC,EAAuBC,MAAMC,UAAUC,MAC1CC,EAAuBC,OAAOC,eAE/B,SAASC,EAAgBC,GACxB,IAAIC,EAAWC,EAAUC,EAAI,EAE7B,GAAGf,EAASY,EAAU,UAIrB,IAHAC,EAAYD,EAAS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AM,CAAE,OAAQV,OAAOb,EAAoBc,KAAKW,cAElEmD,KAAM,WACL,OAAOzD,EAAIO,MAAMH,KAAM,CAAE,QAASV,OAAOb,EAAoBc,KAAKW,eAI7DS,KAlPT,CAsPExC","file":"collection.js","sourcesContent":["/**\n * @use /demand/validator/isTypeOf\n * @use /demand/validator/isInstanceOf\n * @use /demand/descriptor\n *\n * @require ../element\n */\n\n(function(document) {\n\t'use strict';\n\n\tfunction definition(isTypeOf, isInstanceOf, Descriptor, DomElement) {\n\t\tvar arrayPrototypeSlice = Array.prototype.slice,\n\t\t\tobjectDefineProperty = Object.defineProperty;\n\n\t\tfunction resolveElements(elements) {\n\t\t\tvar selectors, selector, i = 0;\n\n\t\t\tif(isTypeOf(elements, 'string')) {\n\t\t\t\tselectors = elements.split(',');\n\t\t\t\telements = [];\n\n\t\t\t\tfor(i = 0; selector = selectors[i]; i++) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\telements = elements.concat(arrayPrototypeSlice.call(document.querySelectorAll(selector)));\n\t\t\t\t\t} catch(exception) {} // eslint-disable-line no-empty\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(elements.length && !Array.isArray(elements)) {\n\t\t\t\telements = arrayPrototypeSlice.call(elements);\n\t\t\t}\n\n\t\t\tif(!Array.isArray(elements)) {\n\t\t\t\telements = [ elements ];\n\t\t\t}\n\n\t\t\treturn elements;\n\t\t}\n\n\t\tfunction map(method) {\n\t\t\tvar self = this,\n\t\t\t\telements = self.elements,\n\t\t\t\tparameter = arrayPrototypeSlice.call(arguments, 1),\n\t\t\t\ti = 0, element;\n\n\t\t\tfor(; element = elements[i]; i++) {\n\t\t\t\telement[method].apply(element, parameter);\n\t\t\t}\n\n\t\t\treturn self;\n\t\t}\n\n\t\tfunction mapFragment(target, method) {\n\t\t\tvar self = this;\n\n\t\t\ttarget = isInstanceOf(target, DomElement) ? target : new DomElement(target);\n\n\t\t\tif(target) {\n\t\t\t\ttarget[method].call(target, buildFragment(self.elements));\n\t\t\t}\n\n\t\t\treturn self;\n\t\t}\n\n\t\tfunction buildFragment(elements) {\n\t\t\tvar fragment = document.createDocumentFragment(),\n\t\t\t\ti = 0, element;\n\n\t\t\tfor(; element = elements[i]; i++) {\n\t\t\t\tfragment.appendChild(element.node);\n\t\t\t}\n\n\t\t\treturn fragment;\n\t\t}\n\n\t\tfunction DomCollection(elements) {\n\t\t\tvar self = this;\n\n\t\t\tobjectDefineProperty(self, 'elements', new Descriptor([]));\n\t\t\tobjectDefineProperty(self, 'nodes', new Descriptor([]));\n\n\t\t\tif(elements) {\n\t\t\t\tself.add(elements);\n\t\t\t}\n\n\t\t\treturn self;\n\t\t}\n\n\t\tDomCollection.prototype = {\n\t\t\t/* only for reference\n\t\t\telements: null,\n\t\t\tnodes: null\n\t\t\t*/\n\t\t\tget length() {\n\t\t\t\treturn this.elements.length;\n\t\t\t},\n\t\t\tget: function(index) {\n\t\t\t\treturn this.elements[index];\n\t\t\t},\n\t\t\tadd: function(elements) {\n\t\t\t\tvar self = this,\n\t\t\t\t\ti = 0, temp;\n\n\t\t\t\telements = resolveElements(elements);\n\n\t\t\t\tfor(; temp = elements[i]; i++) {\n\t\t\t\t\tif(self.nodes.indexOf(temp.node || temp) === -1) {\n\t\t\t\t\t\ttemp = isInstanceOf(temp, DomElement) ? temp : new DomElement(temp);\n\n\t\t\t\t\t\tself.elements.push(temp);\n\t\t\t\t\t\tself.nodes.push(temp.node);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tremove: function(elements) {\n\t\t\t\tvar self = this,\n\t\t\t\t\ti = 0, temp, index;\n\n\t\t\t\telements = resolveElements(elements);\n\n\t\t\t\tfor(; temp = elements[i]; i++) {\n\t\t\t\t\tif((index = self.nodes.indexOf(temp.node || temp)) !== -1) {\n\t\t\t\t\t\tself.elements.splice(index, 1);\n\t\t\t\t\t\tself.nodes.splice(index, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\teach: function(callback) {\n\t\t\t\tvar self = this,\n\t\t\t\t\telements = self.elements,\n\t\t\t\t\ti = 0, element;\n\n\t\t\t\tfor(; element = elements[i]; i++) {\n\t\t\t\t\tcallback.call(element, i);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tsetAttribute: function(attribute, value) {\n\t\t\t\treturn map.call(this, 'setAttribute', attribute, value);\n\t\t\t},\n\t\t\tsetAttributes: function(attributes) {\n\t\t\t\treturn map.call(this, 'setAttributes', attributes);\n\t\t\t},\n\t\t\tremoveAttribute: function(attribute) {\n\t\t\t\treturn map.call(this, 'removeAttribute', attribute);\n\t\t\t},\n\t\t\tremoveAttributes: function(attributes) {\n\t\t\t\treturn map.call(this, 'removeAttributes', attributes);\n\t\t\t},\n\t\t\tsetStyle: function(property, value) {\n\t\t\t\treturn map.call(this, 'setStyle', property, value);\n\t\t\t},\n\t\t\tsetStyles: function(properties) {\n\t\t\t\treturn map.call(this, 'setStyles', properties);\n\t\t\t},\n\t\t\tremoveStyle: function(property) {\n\t\t\t\treturn map.call(this, 'removeStyle', property);\n\t\t\t},\n\t\t\tremoveStyles: function(properties) {\n\t\t\t\treturn map.call(this, 'removeStyles', properties);\n\t\t\t},\n\t\t\taddClass: function(name) {\n\t\t\t\treturn map.call(this, 'addClass', name);\n\t\t\t},\n\t\t\tremoveClass: function(name) {\n\t\t\t\treturn map.call(this, 'removeClass', name);\n\t\t\t},\n\t\t\ttoggleClass: function(name) {\n\t\t\t\treturn map.call(this, 'toggleClass', name);\n\t\t\t},\n\t\t\tprependTo: function(target) {\n\t\t\t\treturn mapFragment.call(this, target, 'prepend');\n\t\t\t},\n\t\t\tappendTo: function(target) {\n\t\t\t\treturn mapFragment.call(this, target, 'append');\n\t\t\t},\n\t\t\tinsertBefore: function(target) {\n\t\t\t\tvar self = this;\n\n\t\t\t\ttarget = isInstanceOf(target, DomElement) ? target : new DomElement(target);\n\n\t\t\t\tif(target && (target = target.node)) {\n\t\t\t\t\ttarget.parentNode.insertBefore(buildFragment(self.elements), target);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tinsertAfter: function(target) {\n\t\t\t\tvar self = this,\n\t\t\t\t\tsibling, fragment;\n\n\t\t\t\ttarget = isInstanceOf(target, DomElement) ? target : new DomElement(target);\n\n\t\t\t\tif(target && (target = target.node)) {\n\t\t\t\t\tfragment = buildFragment(self.elements);\n\n\t\t\t\t\t(sibling = target.nextSibling) ? target.parentNode.insertBefore(fragment, sibling) : target.parentNode.appendChild(fragment);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\treplace: function(target) {\n\t\t\t\tvar self = this,\n\t\t\t\t\telements = self.elements,\n\t\t\t\t\ti = 0, element;\n\n\t\t\t\tfor(; element = elements[i]; i++) {\n\t\t\t\t\tif(i === 0) {\n\t\t\t\t\t\telement.replace(target);\n\t\t\t\t\t} else {\n\t\t\t\t\t\telement.insertAfter(elements[i - 1]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tdetach: function() {\n\t\t\t\tvar self = this,\n\t\t\t\t\telements = self.elements,\n\t\t\t\t\ti = 0, element;\n\n\t\t\t\tfor(; element = elements[i]; i++) {\n\t\t\t\t\telement.detach();\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tblur: function() {\n\t\t\t\treturn map.call(this, 'blur');\n\t\t\t},\n\t\t\ton: function() {\n\t\t\t\treturn map.apply(this, [ 'on' ].concat(arrayPrototypeSlice.call(arguments)));\n\t\t\t},\n\t\t\tone: function() {\n\t\t\t\treturn map.apply(this, [ 'one' ].concat(arrayPrototypeSlice.call(arguments)));\n\t\t\t},\n\t\t\toff: function() {\n\t\t\t\treturn map.apply(this, [ 'off' ].concat(arrayPrototypeSlice.call(arguments)));\n\t\t\t},\n\t\t\temit: function() {\n\t\t\t\treturn map.apply(this, [ 'emit' ].concat(arrayPrototypeSlice.call(arguments)));\n\t\t\t}\n\t\t};\n\n\t\treturn DomCollection;\n\t}\n\n\tprovide([ '/demand/validator/isTypeOf', '/demand/validator/isInstanceOf', '/demand/descriptor', './element' ], definition);\n}(document));\n"]} \ No newline at end of file diff --git a/dist/dom/element.js b/dist/dom/element.js index 9cd6b9e..9f98a90 100644 --- a/dist/dom/element.js +++ b/dist/dom/element.js @@ -1,3 +1,3 @@ -/**! Qoopido.nucleus 3.2.7 | http://nucleus.qoopido.com | (c) 2020 Dirk Lueth */ -!function(t,e){"use strict";provide(["/demand/validator/isObject","/demand/validator/isInstanceOf","/demand/validator/isTypeOf","/demand/function/uuid","/demand/function/iterate","/demand/descriptor","./event","../hooks/css","../support/method"],(function(n,i,r,o,s,u,d,a,f){var l=e.body||e.getElementsByTagName("body")[0],c=Array.prototype.concat,h=Array.prototype.slice,p=Object.defineProperty,g=Object.defineProperties,v=e.getElementsByTagName("head")[0],m="textContent"in e.createElement("a")?"textContent":"innerText",y=f("matches",l)||f("matchesSelector",l),b=/^<(\w+)\s*\/>$/,S=/ +/g,C=/^\s*^/,A=r(v.previousElementSibling,"undefined")?function(){for(var t=this;t=t.previousSibling;)if(1===t.nodeType)return t}:function(){return this.previousElementSibling},E=r(v.nextElementSibling,"undefined")?function(){for(var t=this;t=t.nextSibling;)if(1===t.nodeType)return t}:function(){return this.nextElementSibling},T={},N=!1;function w(t){return N||"boolean"==typeof t?t:t&&t.capture}function B(n,i,r){var o;(o=e.createEvent("CustomEvent")).initCustomEvent(n,"load"!==n&&"resize"!==n,"load"!==n&&"resize"!==n,i),r&&(o.uuid=r,o.isDelegate=!0),this.node.dispatchEvent(o),this.node===t||o.defaultPrevented||"function"!=typeof this.node[n]||this.node[n]()}function L(t){if("string"==typeof t)try{t=b.test(t)?e.createElement(t.replace(b,"$1").toLowerCase()):e.querySelector(t)}catch(e){t=null}if(!t)throw new Error("Element could not be resolved");return t}function x(t){return c.apply([],h.call(t)).join(" ").split(S)}function P(t,e){for(var n,i=0;n=t.path[i];i++){if(n[y]&&n[y](e))return t.currentTarget=n,!0;if(n===t.currentTarget)break}return!1}function j(t,e,n,i,r){var o=!(i&&1===i),s=!!o&&[];for(r=!o&&r;t=e.call(t);)if(1===t.nodeType){if(!n||t[y](n)){if(!o)return t;s.push(t)}if(r)break}return s}function H(t,e,n,i){var r=!(n&&1===n),o=!!r&&[];for(i=!r&&i;t=t.parentNode;)if(1===t.nodeType){if(!e||t[y](e)){if(!r)return t;o.push(t)}if(i)break}return o}function O(e,i,r){var s;return(s=(e=L(e)).uuid)||(s=o(),T[s]={},p(e,"uuid",new u(s))),g(this,{uuid:new u(s),type:new u(e===t?"#window":e.nodeName),node:new u(e)}),n(i)&&this.setAttributes(i),n(r)&&this.setStyles(r),this}return function(){var e,n=function(){},i=""+ +new Date;try{e=Object.defineProperty({},"passive",{get:function(){N=!0}}),t.addEventListener(i,n,e),t.removeEventListener(i,n,e)}catch(t){}}(),O.prototype={clone:function(){return new O(this.node.cloneNode(!0))},focus:function(){return this.node.focus(),this},blur:function(){return this.node.blur(),this},getPosition:function(){var t=this.node.getBoundingClientRect();return{left:t.left+l.scrollLeft,top:t.top+l.scrollTop}},getOffset:function(t){var e=this.node,n=t?e.getBoundingClientRect():null;return{left:t?n.left:e.offsetLeft,top:t?n.top:e.offsetTop}},getWidth:function(t){var e,n=this.node,i=n.offsetWidth;return t&&(e=getComputedStyle(n),i+=parseInt(e.marginLeft)+parseInt(e.marginRight)),i},getHeight:function(t){var e,n=this.node,i=n.offsetHeight;return t&&(e=getComputedStyle(n),i+=parseInt(e.marginTop)+parseInt(e.marginBottom)),i},getContent:function(t){var e=this.node;return t?e.innerHTML:e[m]},getAttribute:function(t){if(r(t,"string"))return this.node.getAttribute(t)},getAttributes:function(){for(var t,e=this,n={},i=x(arguments),r=0;t=i[r];r++)n[t]=e.node.getAttribute(t);return n},getStyle:function(t){if(r(t,"string"))return a.process("get",this.node,t)},getStyles:function(){for(var t,e=this,n={},i=x(arguments),r=0;t=i[r];r++)n[t]=a.process("get",e.node,t);return n},getSiblingBefore:function(t,e){return j(this.node,A,t,1,e)},getSiblingAfter:function(t,e){return j(this.node,E,t,1,e)},getSiblings:function(t){return this.getSiblingsBefore(t).concat(this.getSiblingsAfter(t))},getSiblingsBefore:function(t){return j(this.node,A,t)},getSiblingsAfter:function(t){return j(this.node,E,t)},getChildren:function(t){var e,n,i,r,o=this.node;if(t)C.test(t)?(e=o.uuid,o.setAttribute("nucleus-uuid",e),t='[nucleus-uuid="'+e+'"] '+t,n=h.call(o.parentNode.querySelectorAll(t)),o.removeAttribute("nucleus-uuid")):n=h.call(o.querySelectorAll(t));else for(n=[],i=0;r=o.childNodes[i];i++)1===r.nodeType&&n.push(r);return n},getParent:function(t,e){return H(this.node,t,1,e)},getParents:function(t){return H(this.node,t)},hasChild:function(t){var e=this.node;return e!==t&&e.contains(t.node||t)},hasClass:function(t){return!!t&&new RegExp("(?:^|\\s)"+t+"(?:\\s|$)").test(this.node.className)},isVisible:function(){var t=this.node;return!(t.offsetWidth<=0&&t.offsetHeight<=0||"hidden"===this.getStyle("visibility")||this.getStyle("opacity")<=0)},setContent:function(t,e){var n=this.node;return e?n.innerHTML=t:n[m]=t,this},setAttribute:function(t,e){return r(t,"string")&&this.node.setAttribute(t,e),this},setAttributes:function(t){var e=this;return s(t,(function(t,n){e.setAttribute(t,n)})),e},removeAttribute:function(t){return r(t,"string")&&this.node.removeAttribute(t),this},removeAttributes:function(){for(var t,e=this,n=x(arguments),i=0;t=n[i];i++)e.removeAttribute(t);return e},setStyle:function(t,e){return r(t,"string")&&a.process("set",this.node,t,e),this},setStyles:function(t){var e=this;return s(t,(function(t,n){a.process("set",e.node,t,n)})),e},removeStyle:function(t){return r(t,"string")&&this.setStyle(t,""),this},removeStyles:function(){for(var t,e=this,n=x(arguments),i=0;t=n[i];i++)e.setStyle(t,"");return e},addClass:function(t){return t&&!this.hasClass(t)&&(this.node.className+=this.node.className?" "+t:t),this},removeClass:function(t){return t&&this.hasClass(t)&&(this.node.className=this.node.className.replace(new RegExp("(?:^|\\s)"+t+"(?!\\S)"),"").trim()),this},toggleClass:function(t){return t&&(this.hasClass(t)?this.removeClass(t):this.addClass(t)),this},prepend:function(t){var e=this.node;if(t)try{t=i(t,O)?t.node:L(t),e.firstChild?e.insertBefore(t,e.firstChild):this.append(t)}catch(n){e.insertAdjacentHTML("afterBegin",t)}return this},append:function(t){var e=this.node;if(t)try{e.appendChild(i(t,O)?t.node:L(t))}catch(n){e.insertAdjacentHTML("beforeEnd",t)}return this},prependTo:function(t){var e=this.node;return t&&((t=t.node||L(t)).firstChild?t.insertBefore(e,t.firstChild):this.appendTo(t)),this},appendTo:function(t){return t&&(t.node||L(t)).appendChild(this.node),this},insertBefore:function(t){var e=this.node;return t&&(t=t.node||L(t)).parentNode.insertBefore(e,t),this},insertAfter:function(t){var e=this.node;return t&&((t=t.node||L(t)).nextSibling?t.parentNode.insertBefore(e,t.nextSibling):this.appendTo(t.parentNode)),this},replace:function(t){var e=this.node;return t&&(t=t.node||L(t)).parentNode.replaceChild(e,t),this},replaceWith:function(t){var e=this.node;return t&&(t=i(t,O)?t.node:L(t),e.parentNode.replaceChild(t,e)),this},detach:function(){var t=this.node;return t.parentNode&&t.parentNode.removeChild(t),this},on:function(t){var e,n=this,i=4===arguments.length||"string"==typeof arguments[1]?arguments[1]:null,r=4===arguments.length||"function"==typeof arguments[2]?arguments[2]:arguments[1],s=w(arguments.length>3?arguments[3]:arguments[2]),u=r.uuid||(r.uuid=o()),a=0;for(t=t.split(S);e=t[a];a++){var f=e+"-"+u,l=function(t){var e;(t=new d(t)).isPropagationStopped||(e=t.delegate,t.uuid=o(),i&&!P(t,i)||r.call(t.currentTarget,t,t.originalEvent.detail),e&&(delete t.delegate,B.call(n,e)))};l.type=e,T[n.uuid][f]=l,n.node.addEventListener(e,l,s)}return n},one:function(t){var e=this,n=5===arguments.length||"string"==typeof arguments[1]?arguments[1]:null,i=5===arguments.length||"function"==typeof arguments[2]?arguments[2]:arguments[1],r=w(arguments.length>3?arguments[3]:arguments[2]),s=!1!==(arguments.length>4?arguments[4]:arguments[3]),u=function(n){e.off(!0===s?n.type:t,u,r),i.call(this,n,n.originalEvent.detail)};return i.uuid=u.uuid=o(),n?e.on(t,n,u,r):e.on(t,u,r),e},off:function(t,e,n){var i,r,o,s=this.node,u=0;for(n=w(n),t=t.split(" ");i=t[u];u++)(o=(r=e.uuid&&i+"-"+e.uuid||null)&&T[this.uuid][r]||null)?(s.removeEventListener(i,o,n),delete T[this.uuid][r]):s.removeEventListener(i,e,n);return this},emit:function(t,e){return B.call(this,t,e),this}},O}))}(this,document); +/**! Qoopido.nucleus 3.2.8 | http://nucleus.qoopido.com | (c) 2020 Dirk Lueth */ +!function(e,t){"use strict";provide(["/demand/validator/isObject","/demand/validator/isInstanceOf","/demand/validator/isTypeOf","/demand/function/uuid","/demand/function/iterate","/demand/descriptor","./event","../hooks/css","../support/method"],(function(n,r,i,o,s,u,d,a,f){var c=t.body||t.getElementsByTagName("body")[0],l=Array.prototype.concat,h=Array.prototype.slice,p=Object.defineProperty,g=Object.defineProperties,v=t.getElementsByTagName("head")[0],m=null,y="undefined",b="string",S="textContent"in t.createElement("a")?"textContent":"innerText",C=f("matches",c)||f("matchesSelector",c),A=/^<(\w+)\s*\/>$/,E=/ +/g,T=/^\s*^/,N=i(v.previousElementSibling,y)?function(){for(var e=this;e=e.previousSibling;)if(1===e.nodeType)return e}:function(){return this.previousElementSibling},w=i(v.nextElementSibling,y)?function(){for(var e=this;e=e.nextSibling;)if(1===e.nodeType)return e}:function(){return this.nextElementSibling},B={},L=!1;function x(e){return L||"boolean"==typeof e?e:e&&e.capture}function P(n,r,i){var o,s=this;(o=t.createEvent("CustomEvent")).initCustomEvent(n,"load"!==n&&"resize"!==n,"load"!==n&&"resize"!==n,r),i&&(o.uuid=i,o.isDelegate=!0),s.node.dispatchEvent(o),s.node===e||o.defaultPrevented||"function"!=typeof s.node[n]||s.node[n]()}function j(e){if("string"==typeof e)try{e=A.test(e)?t.createElement(e.replace(A,"$1").toLowerCase()):t.querySelector(e)}catch(t){e=m}if(!e)throw new Error("Element could not be resolved");return e}function H(e){return l.apply([],h.call(e)).join(" ").split(E)}function O(e,t){for(var n,r=0;n=e.path[r];r++){if(n[C]&&n[C](t))return e.currentTarget=n,!0;if(n===e.currentTarget)break}return!1}function I(e,t,n,r,i){var o=!(r&&1===r),s=!!o&&[];for(i=!o&&i;e=t.call(e);)if(1===e.nodeType){if(!n||e[C](n)){if(!o)return e;s.push(e)}if(i)break}return s}function R(e,t,n,r){var i=!(n&&1===n),o=!!i&&[];for(r=!i&&r;e=e.parentNode;)if(1===e.nodeType){if(!t||e[C](t)){if(!i)return e;o.push(e)}if(r)break}return o}function k(t,r,i){var s,d=this;return(s=(t=j(t)).uuid)||(s=o(),B[s]={},p(t,"uuid",new u(s))),g(d,{uuid:new u(s),type:new u(t===e?"#window":t.nodeName),node:new u(t)}),n(r)&&d.setAttributes(r),n(i)&&d.setStyles(i),d}return function(){var t,n=function(){},r=""+ +new Date;try{t=Object.defineProperty({},"passive",{get:function(){L=!0}}),e.addEventListener(r,n,t),e.removeEventListener(r,n,t)}catch(e){}}(),k.prototype={clone:function(){return new k(this.node.cloneNode(!0))},focus:function(){return this.node.focus(),this},blur:function(){return this.node.blur(),this},getPosition:function(){var e=this.node.getBoundingClientRect();return{left:e.left+c.scrollLeft,top:e.top+c.scrollTop}},getOffset:function(e){var t=this.node,n=e?t.getBoundingClientRect():null;return{left:e?n.left:t.offsetLeft,top:e?n.top:t.offsetTop}},getWidth:function(e){var t,n=this.node,r=n.offsetWidth;return e&&(t=getComputedStyle(n),r+=parseInt(t.marginLeft)+parseInt(t.marginRight)),r},getHeight:function(e){var t,n=this.node,r=n.offsetHeight;return e&&(t=getComputedStyle(n),r+=parseInt(t.marginTop)+parseInt(t.marginBottom)),r},getContent:function(e){var t=this.node;return e?t.innerHTML:t[S]},getAttribute:function(e){if(i(e,b))return this.node.getAttribute(e)},getAttributes:function(){for(var e,t=this,n={},r=H(arguments),i=0;e=r[i];i++)n[e]=t.node.getAttribute(e);return n},getStyle:function(e){if(i(e,b))return a.process("get",this.node,e)},getStyles:function(){for(var e,t=this,n={},r=H(arguments),i=0;e=r[i];i++)n[e]=a.process("get",t.node,e);return n},getSiblingBefore:function(e,t){return I(this.node,N,e,1,t)},getSiblingAfter:function(e,t){return I(this.node,w,e,1,t)},getSiblings:function(e){return this.getSiblingsBefore(e).concat(this.getSiblingsAfter(e))},getSiblingsBefore:function(e){return I(this.node,N,e)},getSiblingsAfter:function(e){return I(this.node,w,e)},getChildren:function(e){var t,n,r,i,o=this.node;if(e)T.test(e)?(t=o.uuid,o.setAttribute("nucleus-uuid",t),e='[nucleus-uuid="'+t+'"] '+e,n=h.call(o.parentNode.querySelectorAll(e)),o.removeAttribute("nucleus-uuid")):n=h.call(o.querySelectorAll(e));else for(n=[],r=0;i=o.childNodes[r];r++)1===i.nodeType&&n.push(i);return n},getParent:function(e,t){return R(this.node,e,1,t)},getParents:function(e){return R(this.node,e)},hasChild:function(e){var t=this.node;return t!==e&&t.contains(e.node||e)},hasClass:function(e){return!!e&&new RegExp("(?:^|\\s)"+e+"(?:\\s|$)").test(this.node.className)},isVisible:function(){var e=this,t=e.node;return!(t.offsetWidth<=0&&t.offsetHeight<=0||"hidden"===e.getStyle("visibility")||e.getStyle("opacity")<=0)},setContent:function(e,t){var n=this.node;return t?n.innerHTML=e:n[S]=e,this},setAttribute:function(e,t){return i(e,b)&&this.node.setAttribute(e,t),this},setAttributes:function(e){var t=this;return s(e,(function(e,n){t.setAttribute(e,n)})),t},removeAttribute:function(e){return i(e,b)&&this.node.removeAttribute(e),this},removeAttributes:function(){for(var e,t=this,n=H(arguments),r=0;e=n[r];r++)t.removeAttribute(e);return t},setStyle:function(e,t){return i(e,b)&&a.process("set",this.node,e,t),this},setStyles:function(e){var t=this;return s(e,(function(e,n){a.process("set",t.node,e,n)})),t},removeStyle:function(e){return i(e,b)&&this.setStyle(e,""),this},removeStyles:function(){for(var e,t=this,n=H(arguments),r=0;e=n[r];r++)t.setStyle(e,"");return t},addClass:function(e){var t=this;return e&&!t.hasClass(e)&&(t.node.className+=t.node.className?" "+e:e),t},removeClass:function(e){var t=this;return e&&t.hasClass(e)&&(t.node.className=t.node.className.replace(new RegExp("(?:^|\\s)"+e+"(?!\\S)"),"").trim()),t},toggleClass:function(e){var t=this;return e&&(t.hasClass(e)?t.removeClass(e):t.addClass(e)),t},prepend:function(e){var t=this,n=t.node;if(e)try{e=r(e,k)?e.node:j(e),n.firstChild?n.insertBefore(e,n.firstChild):t.append(e)}catch(t){n.insertAdjacentHTML("afterBegin",e)}return t},append:function(e){var t=this.node;if(e)try{t.appendChild(r(e,k)?e.node:j(e))}catch(n){t.insertAdjacentHTML("beforeEnd",e)}return this},prependTo:function(e){var t=this,n=t.node;return e&&((e=e.node||j(e)).firstChild?e.insertBefore(n,e.firstChild):t.appendTo(e)),t},appendTo:function(e){return e&&(e.node||j(e)).appendChild(this.node),this},insertBefore:function(e){var t=this.node;return e&&(e=e.node||j(e)).parentNode.insertBefore(t,e),this},insertAfter:function(e){var t=this,n=t.node;return e&&((e=e.node||j(e)).nextSibling?e.parentNode.insertBefore(n,e.nextSibling):t.appendTo(e.parentNode)),t},replace:function(e){var t=this.node;return e&&(e=e.node||j(e)).parentNode.replaceChild(t,e),this},replaceWith:function(e){var t=this.node;return e&&(e=r(e,k)?e.node:j(e),t.parentNode.replaceChild(e,t)),this},detach:function(){var e=this.node;return e.parentNode&&e.parentNode.removeChild(e),this},on:function(e){var t,n=this,r=4===arguments.length||"string"==typeof arguments[1]?arguments[1]:m,i=4===arguments.length||"function"==typeof arguments[2]?arguments[2]:arguments[1],s=x(arguments.length>3?arguments[3]:arguments[2]),u=i.uuid||(i.uuid=o()),a=0;for(e=e.split(E);t=e[a];a++){var f=t+"-"+u,c=function(e){var t;(e=new d(e)).isPropagationStopped||(t=e.delegate,e.uuid=o(),r&&!O(e,r)||i.call(e.currentTarget,e,e.originalEvent.detail),t&&(delete e.delegate,P.call(n,t)))};c.type=t,B[n.uuid][f]=c,n.node.addEventListener(t,c,s)}return n},one:function(e){var t=this,n=5===arguments.length||"string"==typeof arguments[1]?arguments[1]:m,r=5===arguments.length||"function"==typeof arguments[2]?arguments[2]:arguments[1],i=x(arguments.length>3?arguments[3]:arguments[2]),s=!1!==(arguments.length>4?arguments[4]:arguments[3]),u=function(n){t.off(!0===s?n.type:e,u,i),r.call(this,n,n.originalEvent.detail)};return r.uuid=u.uuid=o(),n?t.on(e,n,u,i):t.on(e,u,i),t},off:function(e,t,n){var r,i,o,s=this,u=s.node,d=0;for(n=x(n),e=e.split(" ");r=e[d];d++)(o=(i=t.uuid&&r+"-"+t.uuid||m)&&B[s.uuid][i]||m)?(u.removeEventListener(r,o,n),delete B[s.uuid][i]):u.removeEventListener(r,t,n);return s},emit:function(e,t){return P.call(this,e,t),this}},k}))}(this,document); //# sourceMappingURL=element.js.map diff --git a/dist/dom/element.js.map b/dist/dom/element.js.map index 1f68a40..1fc2c0c 100644 --- a/dist/dom/element.js.map +++ b/dist/dom/element.js.map @@ -1 +1 @@ -{"version":3,"sources":["dom/element.js"],"names":["global","document","provide","isObject","isInstanceOf","isTypeOf","generateUuid","iterate","Descriptor","Event","hooksCss","supportMethod","documentBody","body","getElementsByTagName","arrayPrototypeConcat","Array","prototype","concat","arrayPrototypeSlice","slice","objectDefineProperty","Object","defineProperty","objectDefineProperties","defineProperties","head","STRING_CONTENTATTRIBUTE","createElement","STRING_MATCHES","regexMatchTag","regexMatchSpaces","regexMatchChildSeclector","previousSibling","previousElementSibling","element","this","nodeType","nextSibling","nextElementSibling","listener","supportsPassiveListener","processOptions","options","capture","emitEvent","type","detail","uuid","event","createEvent","initCustomEvent","isDelegate","node","dispatchEvent","defaultPrevented","resolveElement","test","replace","toLowerCase","querySelector","exception","Error","resolveArguments","parameters","apply","call","join","split","matchesDelegate","delegate","pointer","i","path","currentTarget","getSiblings","method","selector","limit","strict","multiple","siblings","push","getParents","parents","parentNode","DomElement","attributes","styles","nodeName","setAttributes","setStyles","noop","Date","get","addEventListener","removeEventListener","error","clone","cloneNode","focus","blur","getPosition","bbox","getBoundingClientRect","left","scrollLeft","top","scrollTop","getOffset","viewport","offsetLeft","offsetTop","getWidth","includeMargin","style","width","offsetWidth","getComputedStyle","parseInt","marginLeft","marginRight","getHeight","height","offsetHeight","marginTop","marginBottom","getContent","getHtml","innerHTML","getAttribute","attribute","getAttributes","self","result","arguments","getStyle","property","process","getStyles","properties","getSiblingBefore","getSiblingAfter","getSiblingsBefore","getSiblingsAfter","getChildren","matches","match","setAttribute","querySelectorAll","removeAttribute","childNodes","getParent","hasChild","child","contains","hasClass","name","RegExp","className","isVisible","setContent","source","isHtml","value","removeAttributes","setStyle","removeStyle","removeStyles","addClass","removeClass","trim","toggleClass","prepend","target","firstChild","insertBefore","append","insertAdjacentHTML","appendChild","prependTo","appendTo","insertAfter","replaceChild","replaceWith","detach","removeChild","on","events","length","fn","id","handler","delegateTo","isPropagationStopped","originalEvent","one","each","off","emit","data"],"mappings":";CAaC,SAASA,EAAQC,GACjB,aAkqBAC,QAAQ,CAAE,6BAA8B,iCAAkC,6BAA8B,wBAAyB,2BAA4B,qBAAsB,UAAW,eAAgB,sBAhqB9M,SAAoBC,EAAUC,EAAcC,EAAUC,EAAcC,EAASC,EAAYC,EAAOC,EAAUC,GACzG,IACCC,EAA2BX,EAASY,MAAQZ,EAASa,qBAAqB,QAAQ,GAClFC,EAA2BC,MAAMC,UAAUC,OAC3CC,EAA2BH,MAAMC,UAAUG,MAC3CC,EAA2BC,OAAOC,eAClCC,EAA2BF,OAAOG,iBAClCC,EAA2BzB,EAASa,qBAAqB,QAAQ,GAKjEa,EAA4B,gBAAiB1B,EAAS2B,cAAc,KAAQ,cAAgB,YAC5FC,EAA2BlB,EAAc,UAAWC,IAAiBD,EAAc,kBAAmBC,GAEtGkB,EAA2B,iBAC3BC,EAA2B,MA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ypeOf\n * @use /demand/function/uuid\n * @use /demand/function/iterate\n * @use /demand/descriptor\n *\n * @require ./event\n * @require ../hooks/css\n * @require ../support/method\n */\n\n(function(global, document) {\n\t'use strict';\n\n\tfunction definition(isObject, isInstanceOf, isTypeOf, generateUuid, iterate, Descriptor, Event, hooksCss, supportMethod) {\n\t\tvar //shortcuts\n\t\t\tdocumentBody = document.body || document.getElementsByTagName('body')[0],\n\t\t\tarrayPrototypeConcat = Array.prototype.concat,\n\t\t\tarrayPrototypeSlice = Array.prototype.slice,\n\t\t\tobjectDefineProperty = Object.defineProperty,\n\t\t\tobjectDefineProperties = Object.defineProperties,\n\t\t\thead = document.getElementsByTagName('head')[0],\n\t\t\t// constants\n\t\t\tNULL = null,\n\t\t\tSTRING_UNDEFINED = 'undefined',\n\t\t\tSTRING_STRING = 'string',\n\t\t\tSTRING_CONTENTATTRIBUTE = ('textContent' in document.createElement('a')) ? 'textContent' : 'innerText',\n\t\t\tSTRING_MATCHES = supportMethod('matches', documentBody) || supportMethod('matchesSelector', documentBody),\n\t\t\t// regular expressions\n\t\t\tregexMatchTag = /^<(\\w+)\\s*\\/>$/,\n\t\t\tregexMatchSpaces = / +/g,\n\t\t\tregexMatchChildSeclector = /^\\s*^/,\n\t\t\t// methods\n\t\t\tpreviousSibling = (!isTypeOf(head.previousElementSibling, STRING_UNDEFINED)) ? function previousSibling() { return this.previousElementSibling; } : function previousSibling() { var element = this; while(element = element.previousSibling) { if(element.nodeType === 1 ) { return element; } } },\n\t\t\tnextSibling = (!isTypeOf(head.nextElementSibling, STRING_UNDEFINED)) ? function nextSibling() { return this.nextElementSibling; } : function nextSibling() { var element = this; while(element = element.nextSibling) { if(element.nodeType === 1 ) { return element; } } },\n\t\t\t// flags\n\t\t\t// general storage & objects\n\t\t\tlistener = {},\n\t\t\tsupportsPassiveListener = false;\n\n\t\t(function() {\n\t\t\tvar noop = function() {},\n\t\t\t\tevent = '' + (+new Date()),\n\t\t\t\toptions;\n\n\t\t\ttry {\n\t\t\t\toptions = Object.defineProperty({}, 'passive', {\n\t\t\t\t\tget: function() {\n\t\t\t\t\t\tsupportsPassiveListener = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tglobal.addEventListener(event, noop, options);\n\t\t\t\tglobal.removeEventListener(event, noop, options);\n\t\t\t} catch(error) {} /* eslint-disable-line no-empty */\n\t\t}());\n\n\t\tfunction processOptions(options) {\n\t\t\tif(supportsPassiveListener || typeof options === 'boolean') {\n\t\t\t\treturn options;\n\t\t\t}\n\n\t\t\treturn options && options.capture;\n\t\t}\n\n\t\tfunction emitEvent(type, detail, uuid) {\n\t\t\tvar self = this,\n\t\t\t\tevent;\n\n\t\t\tevent = document.createEvent('CustomEvent');\n\t\t\tevent.initCustomEvent(type, type !== 'load' && type !== 'resize', type !== 'load' && type !== 'resize', detail);\n\n\t\t\tif(uuid) {\n\t\t\t\tevent.uuid = uuid;\n\t\t\t\tevent.isDelegate = true;\n\t\t\t}\n\n\t\t\tself.node.dispatchEvent(event);\n\n\t\t\tif(self.node !== global && !event.defaultPrevented && typeof self.node[type] === 'function') {\n\t\t\t\tself.node[type]();\n\t\t\t}\n\t\t}\n\n\t\tfunction resolveElement(element) {\n\t\t\tif(typeof element === 'string') {\n\t\t\t\ttry {\n\t\t\t\t\tif(regexMatchTag.test(element)) {\n\t\t\t\t\t\telement = document.createElement(element.replace(regexMatchTag, '$1').toLowerCase());\n\t\t\t\t\t} else {\n\t\t\t\t\t\telement = document.querySelector(element);\n\t\t\t\t\t}\n\t\t\t\t} catch(exception) {\n\t\t\t\t\telement = NULL;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(!element) {\n\t\t\t\tthrow new Error('Element could not be resolved');\n\t\t\t}\n\n\t\t\treturn element;\n\t\t}\n\n\t\tfunction resolveArguments(parameters) {\n\t\t\treturn arrayPrototypeConcat.apply([], arrayPrototypeSlice.call(parameters)).join(' ').split(regexMatchSpaces);\n\t\t}\n\n\t\tfunction matchesDelegate(event, delegate) {\n\t\t\tvar i = 0, pointer;\n\n\t\t\tfor(; pointer = event.path[i]; i++) {\n\t\t\t\tif(pointer[STRING_MATCHES] && pointer[STRING_MATCHES](delegate)) {\n\t\t\t\t\tevent.currentTarget = pointer;\n\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tif(pointer === event.currentTarget) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tfunction getSiblings(pointer, method, selector, limit, strict) {\n\t\t\tvar multiple = !(limit && limit === 1),\n\t\t\t\tsiblings = multiple ? [] : false;\n\n\t\t\tstrict = multiple ? false : strict;\n\n\t\t\twhile(pointer = method.call(pointer)) {\n\t\t\t\tif(pointer.nodeType === 1) {\n\t\t\t\t\tif(!selector || pointer[STRING_MATCHES](selector)) {\n\t\t\t\t\t\tif(multiple) {\n\t\t\t\t\t\t\tsiblings.push(pointer);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn pointer;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif(strict) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn siblings;\n\t\t}\n\n\t\tfunction getParents(pointer, selector, limit, strict) {\n\t\t\tvar multiple = !(limit && limit === 1),\n\t\t\t\tparents = multiple ? [] : false;\n\n\t\t\tstrict = multiple ? false : strict;\n\n\t\t\twhile(pointer = pointer.parentNode) {\n\t\t\t\tif(pointer.nodeType === 1) {\n\t\t\t\t\tif(!selector || pointer[STRING_MATCHES](selector)) {\n\t\t\t\t\t\tif(multiple) {\n\t\t\t\t\t\t\tparents.push(pointer);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn pointer;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif(strict) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn parents\n\t\t}\n\n\t\tfunction DomElement(element, attributes, styles) {\n\t\t\tvar self = this,\n\t\t\t\tuuid;\n\n\t\t\telement = resolveElement(element);\n\t\t\tuuid = element.uuid;\n\n\t\t\tif(!uuid) {\n\t\t\t\tuuid = generateUuid();\n\t\t\t\tlistener[uuid] = {};\n\n\t\t\t\tobjectDefineProperty(element, 'uuid', new Descriptor(uuid));\n\t\t\t}\n\n\t\t\tobjectDefineProperties(self, {\n\t\t\t\tuuid: new Descriptor(uuid),\n\t\t\t\ttype: new Descriptor(element === global ? '#window' : element.nodeName),\n\t\t\t\tnode: new Descriptor(element)\n\t\t\t});\n\n\t\t\tif(isObject(attributes)) {\n\t\t\t\tself.setAttributes(attributes);\n\t\t\t}\n\n\t\t\tif(isObject(styles)) {\n\t\t\t\tself.setStyles(styles);\n\t\t\t}\n\n\t\t\treturn self;\n\t\t}\n\n\t\tDomElement.prototype = {\n\t\t\t/* only for reference\n\t\t\t uuid: NULL,\n\t\t\t type: NULL,\n\t\t\t node: NULL\n\t\t\t */\n\t\t\tclone: function() {\n\t\t\t\treturn new DomElement(this.node.cloneNode(true));\n\t\t\t},\n\t\t\tfocus: function() {\n\t\t\t\tthis.node.focus();\n\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tblur: function() {\n\t\t\t\tthis.node.blur();\n\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tgetPosition: function() {\n\t\t\t\tvar bbox = this.node.getBoundingClientRect();\n\n\t\t\t\treturn {\n\t\t\t\t\tleft: bbox.left + documentBody.scrollLeft,\n\t\t\t\t\ttop: bbox.top + documentBody.scrollTop\n\t\t\t\t};\n\t\t\t},\n\t\t\tgetOffset: function(viewport) {\n\t\t\t\tvar node = this.node,\n\t\t\t\t\tbbox = viewport ? node.getBoundingClientRect() : null;\n\n\t\t\t\treturn {\n\t\t\t\t\tleft: viewport ? bbox.left : node.offsetLeft,\n\t\t\t\t\ttop: viewport ? bbox.top : node.offsetTop\n\t\t\t\t};\n\t\t\t},\n\t\t\tgetWidth: function(includeMargin) {\n\t\t\t\tvar node = this.node,\n\t\t\t\t\twidth = node.offsetWidth,\n\t\t\t\t\tstyle;\n\n\t\t\t\tif(includeMargin) {\n\t\t\t\t\tstyle = getComputedStyle(node);\n\n\t\t\t\t\twidth += parseInt(style.marginLeft) + parseInt(style.marginRight);\n\t\t\t\t}\n\n\t\t\t\treturn width;\n\t\t\t},\n\t\t\tgetHeight: function(includeMargin) {\n\t\t\t\tvar node = this.node,\n\t\t\t\t\theight = node.offsetHeight,\n\t\t\t\t\tstyle;\n\n\t\t\t\tif(includeMargin) {\n\t\t\t\t\tstyle = getComputedStyle(node);\n\n\t\t\t\t\theight += parseInt(style.marginTop) + parseInt(style.marginBottom);\n\t\t\t\t}\n\n\t\t\t\treturn height;\n\t\t\t},\n\t\t\tgetContent: function(getHtml) {\n\t\t\t\tvar node = this.node;\n\n\t\t\t\treturn getHtml ? node.innerHTML : node[STRING_CONTENTATTRIBUTE];\n\t\t\t},\n\t\t\tgetAttribute: function(attribute) {\n\t\t\t\tvar self = this;\n\n\t\t\t\tif(isTypeOf(attribute, STRING_STRING)) {\n\t\t\t\t\treturn self.node.getAttribute(attribute);\n\t\t\t\t}\n\t\t\t},\n\t\t\tgetAttributes: function() {\n\t\t\t\tvar self = this,\n\t\t\t\t\tresult = {},\n\t\t\t\t\tattributes = resolveArguments(arguments),\n\t\t\t\t\ti = 0, attribute;\n\n\t\t\t\tfor(; attribute = attributes[i]; i++) {\n\t\t\t\t\tresult[attribute] = self.node.getAttribute(attribute);\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t},\n\t\t\tgetStyle: function(property) {\n\t\t\t\tvar self = this;\n\n\t\t\t\tif(isTypeOf(property, STRING_STRING)) {\n\t\t\t\t\treturn hooksCss.process('get', self.node, property);\n\t\t\t\t}\n\t\t\t},\n\t\t\tgetStyles: function() {\n\t\t\t\tvar self = this,\n\t\t\t\t\tresult = {},\n\t\t\t\t\tproperties = resolveArguments(arguments),\n\t\t\t\t\ti = 0, property;\n\n\t\t\t\tfor(; property = properties[i]; i++) {\n\t\t\t\t\tresult[property] = hooksCss.process('get', self.node, property);\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t},\n\t\t\tgetSiblingBefore: function(selector, strict) {\n\t\t\t\treturn getSiblings(this.node, previousSibling, selector, 1, strict);\n\t\t\t},\n\t\t\tgetSiblingAfter: function(selector, strict) {\n\t\t\t\treturn getSiblings(this.node, nextSibling, selector, 1, strict);\n\t\t\t},\n\t\t\tgetSiblings: function(selector) {\n\t\t\t\treturn this.getSiblingsBefore(selector).concat(this.getSiblingsAfter(selector));\n\t\t\t},\n\t\t\tgetSiblingsBefore: function(selector) {\n\t\t\t\treturn getSiblings(this.node, previousSibling, selector);\n\t\t\t},\n\t\t\tgetSiblingsAfter: function(selector) {\n\t\t\t\treturn getSiblings(this.node, nextSibling, selector);\n\t\t\t},\n\t\t\tgetChildren: function(selector) {\n\t\t\t\tvar self = this.node,\n\t\t\t\t\tuuid, matches, i, match;\n\n\t\t\t\tif(!selector) {\n\t\t\t\t\tmatches = [];\n\n\t\t\t\t\tfor(i = 0; match = self.childNodes[i]; i++) {\n\t\t\t\t\t\tif(match.nodeType === 1) {\n\t\t\t\t\t\t\tmatches.push(match);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if(regexMatchChildSeclector.test(selector)) {\n\t\t\t\t\tuuid = self.uuid;\n\n\t\t\t\t\tself.setAttribute('nucleus-uuid', uuid);\n\n\t\t\t\t\tselector = '[nucleus-uuid=\"' + uuid + '\"] ' + selector;\n\t\t\t\t\tmatches = arrayPrototypeSlice.call(self.parentNode.querySelectorAll(selector));\n\n\t\t\t\t\tself.removeAttribute('nucleus-uuid');\n\t\t\t\t} else {\n\t\t\t\t\tmatches = arrayPrototypeSlice.call(self.querySelectorAll(selector));\n\t\t\t\t}\n\n\t\t\t\treturn matches;\n\t\t\t},\n\t\t\tgetParent: function(selector, strict) {\n\t\t\t\treturn getParents(this.node, selector, 1, strict);\n\t\t\t},\n\t\t\tgetParents: function(selector) {\n\t\t\t\treturn getParents(this.node, selector);\n\t\t\t},\n\t\t\thasChild: function(child) {\n\t\t\t\tvar node = this.node;\n\n\t\t\t\treturn node !== child && node.contains(child.node || child);\n\t\t\t},\n\t\t\thasClass: function(name) {\n\t\t\t\treturn (name) ? (new RegExp('(?:^|\\\\s)' + name + '(?:\\\\s|$)')).test(this.node.className) : false;\n\t\t\t},\n\t\t\tisVisible: function() {\n\t\t\t\tvar self = this,\n\t\t\t\t\tnode = self.node;\n\n\t\t\t\treturn !((node.offsetWidth <= 0 && node.offsetHeight <= 0) || self.getStyle('visibility') === 'hidden' || self.getStyle('opacity') <= 0);\n\t\t\t},\n\t\t\tsetContent: function(source, isHtml) {\n\t\t\t\tvar self = this,\n\t\t\t\t\tnode = self.node;\n\n\t\t\t\tif(isHtml) {\n\t\t\t\t\tnode.innerHTML = source;\n\t\t\t\t} else {\n\t\t\t\t\tnode[STRING_CONTENTATTRIBUTE] = source;\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tsetAttribute: function(attribute, value) {\n\t\t\t\tvar self = this;\n\n\t\t\t\tif(isTypeOf(attribute, STRING_STRING)) {\n\t\t\t\t\tself.node.setAttribute(attribute, value);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tsetAttributes: function(attributes) {\n\t\t\t\tvar self = this;\n\n\t\t\t\titerate(attributes, function(attribute, value) {\n\t\t\t\t\tself.setAttribute(attribute, value);\n\t\t\t\t});\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tremoveAttribute: function(attribute) {\n\t\t\t\tvar self = this;\n\n\t\t\t\tif(isTypeOf(attribute, STRING_STRING)) {\n\t\t\t\t\tself.node.removeAttribute(attribute);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tremoveAttributes: function() {\n\t\t\t\tvar self = this,\n\t\t\t\t\tattributes = resolveArguments(arguments),\n\t\t\t\t\ti = 0, attribute;\n\n\t\t\t\tfor(; attribute = attributes[i]; i++) {\n\t\t\t\t\tself.removeAttribute(attribute);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tsetStyle: function(property, value) {\n\t\t\t\tvar self = this;\n\n\t\t\t\tif(isTypeOf(property, STRING_STRING)) {\n\t\t\t\t\thooksCss.process('set', self.node, property, value);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tsetStyles: function(properties) {\n\t\t\t\tvar self = this;\n\n\t\t\t\titerate(properties, function(property, value) {\n\t\t\t\t\thooksCss.process('set', self.node, property, value);\n\t\t\t\t});\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tremoveStyle: function(property) {\n\t\t\t\tvar self = this;\n\n\t\t\t\tif(isTypeOf(property, STRING_STRING)) {\n\t\t\t\t\tself.setStyle(property, '');\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tremoveStyles: function() {\n\t\t\t\tvar self = this,\n\t\t\t\t\tproperties = resolveArguments(arguments),\n\t\t\t\t\ti = 0, property;\n\n\t\t\t\tfor(; property = properties[i]; i++) {\n\t\t\t\t\tself.setStyle(property, '');\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\taddClass: function(name) {\n\t\t\t\tvar self = this;\n\n\t\t\t\tif(name && !self.hasClass(name)) {\n\t\t\t\t\tself.node.className += (self.node.className) ? ' ' + name : name;\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tremoveClass: function(name) {\n\t\t\t\tvar self = this;\n\n\t\t\t\tif(name && self.hasClass(name)) {\n\t\t\t\t\tself.node.className = self.node.className.replace(new RegExp('(?:^|\\\\s)' + name + '(?!\\\\S)'), '').trim();\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\ttoggleClass: function(name) {\n\t\t\t\tvar self = this;\n\n\t\t\t\tif(name) {\n\t\t\t\t\tself.hasClass(name) ? self.removeClass(name) : self.addClass(name);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tprepend: function(element) {\n\t\t\t\tvar self = this,\n\t\t\t\t\ttarget = self.node;\n\n\t\t\t\tif(element) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\telement = (isInstanceOf(element, DomElement)) ? element.node : resolveElement(element);\n\n\t\t\t\t\t\ttarget.firstChild ? target.insertBefore(element, target.firstChild) : self.append(element);\n\t\t\t\t\t} catch(exception) {\n\t\t\t\t\t\ttarget.insertAdjacentHTML('afterBegin', element);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tappend: function(element) {\n\t\t\t\tvar self = this,\n\t\t\t\t\ttarget = self.node;\n\n\t\t\t\tif(element) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\ttarget.appendChild((isInstanceOf(element, DomElement)) ? element.node : resolveElement(element));\n\t\t\t\t\t} catch(exception) {\n\t\t\t\t\t\ttarget.insertAdjacentHTML('beforeEnd', element);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tprependTo: function(target) {\n\t\t\t\tvar self = this,\n\t\t\t\t\tnode = self.node;\n\n\t\t\t\tif(target) {\n\t\t\t\t\t(target = target.node || resolveElement(target)).firstChild ? target.insertBefore(node, target.firstChild) : self.appendTo(target);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tappendTo: function(target) {\n\t\t\t\tvar self = this;\n\n\t\t\t\tif(target) {\n\t\t\t\t\t(target.node || resolveElement(target)).appendChild(self.node);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tinsertBefore: function(target) {\n\t\t\t\tvar self = this,\n\t\t\t\t\tnode = self.node;\n\n\t\t\t\tif(target) {\n\t\t\t\t\t(target = target.node || resolveElement(target)).parentNode.insertBefore(node, target);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tinsertAfter: function(target) {\n\t\t\t\tvar self = this,\n\t\t\t\t\tnode = self.node;\n\n\t\t\t\tif(target) {\n\t\t\t\t\t(target = target.node || resolveElement(target)).nextSibling ? target.parentNode.insertBefore(node, target.nextSibling) : self.appendTo(target.parentNode);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\treplace: function(target) {\n\t\t\t\tvar self = this,\n\t\t\t\t\tnode = self.node;\n\n\t\t\t\tif(target) {\n\t\t\t\t\t(target = target.node || resolveElement(target)).parentNode.replaceChild(node, target);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\treplaceWith: function(element) {\n\t\t\t\tvar self = this,\n\t\t\t\t\ttarget = self.node;\n\n\t\t\t\tif(element) {\n\t\t\t\t\telement = (isInstanceOf(element, DomElement)) ? element.node : resolveElement(element);\n\n\t\t\t\t\ttarget.parentNode.replaceChild(element, target);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tdetach: function() {\n\t\t\t\tvar self = this,\n\t\t\t\t\tnode = self.node;\n\n\t\t\t\tnode.parentNode && node.parentNode.removeChild(node);\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\ton: function(events) {\n\t\t\t\tvar self = this,\n\t\t\t\t\tdelegate = (arguments.length === 4 || typeof arguments[1] === 'string') ? arguments[1] : NULL,\n\t\t\t\t\tfn = (arguments.length === 4 || typeof arguments[2] === 'function') ? arguments[2] : arguments[1],\n\t\t\t\t\toptions = processOptions((arguments.length > 3) ? arguments[3] : arguments[2]),\n\t\t\t\t\tuuid = fn.uuid || (fn.uuid = generateUuid()),\n\t\t\t\t\ti = 0, event;\n\n\t\t\t\tevents = events.split(regexMatchSpaces);\n\n\t\t\t\tfor(; event = events[i]; i++) {\n\t\t\t\t\tvar id = event + '-' + uuid,\n\t\t\t\t\t\thandler = function(event) {\n\t\t\t\t\t\t\tvar delegateTo;\n\n\t\t\t\t\t\t\tevent = new Event(event);\n\n\t\t\t\t\t\t\tif(!event.isPropagationStopped) {\n\t\t\t\t\t\t\t\tdelegateTo = event.delegate;\n\t\t\t\t\t\t\t\tevent.uuid = generateUuid();\n\n\t\t\t\t\t\t\t\tif(!delegate || matchesDelegate(event, delegate)) {\n\t\t\t\t\t\t\t\t\tfn.call(event.currentTarget, event, event.originalEvent.detail);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif(delegateTo) {\n\t\t\t\t\t\t\t\t\tdelete event.delegate;\n\n\t\t\t\t\t\t\t\t\temitEvent.call(self, delegateTo);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\n\t\t\t\t\thandler.type = event;\n\t\t\t\t\tlistener[self.uuid][id] = handler;\n\n\t\t\t\t\tself.node.addEventListener(event, handler, options);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tone: function(events) {\n\t\t\t\tvar self = this,\n\t\t\t\t\tdelegate = (arguments.length === 5 || typeof arguments[1] === 'string') ? arguments[1] : NULL,\n\t\t\t\t\tfn = (arguments.length === 5 || typeof arguments[2] === 'function') ? arguments[2] : arguments[1],\n\t\t\t\t\toptions = processOptions((arguments.length > 3) ? arguments[3] : arguments[2]),\n\t\t\t\t\teach = ((arguments.length > 4) ? arguments[4] : arguments[3]) !== false,\n\t\t\t\t\thandler = function(event) {\n\t\t\t\t\t\tself.off(((each === true) ? event.type : events), handler, options);\n\n\t\t\t\t\t\tfn.call(this, event, event.originalEvent.detail);\n\t\t\t\t\t};\n\n\t\t\t\tfn.uuid = handler.uuid = generateUuid();\n\n\t\t\t\tif(delegate) {\n\t\t\t\t\tself.on(events, delegate, handler, options);\n\t\t\t\t} else {\n\t\t\t\t\tself.on(events, handler, options);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\toff: function(events, fn, options) {\n\t\t\t\tvar self = this,\n\t\t\t\t\tnode = self.node,\n\t\t\t\t\ti = 0, event, id, handler;\n\n\t\t\t\toptions = processOptions(options);\n\t\t\t\tevents = events.split(' ');\n\n\t\t\t\tfor(; event = events[i]; i++) {\n\t\t\t\t\tid = fn.uuid && event + '-' + fn.uuid || NULL;\n\t\t\t\t\thandler = id && listener[self.uuid][id] || NULL;\n\n\t\t\t\t\tif(handler) {\n\t\t\t\t\t\tnode.removeEventListener(event, handler, options);\n\n\t\t\t\t\t\tdelete listener[self.uuid][id];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnode.removeEventListener(event, fn, options);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\temit: function(event, data) {\n\t\t\t\tvar self = this;\n\n\t\t\t\temitEvent.call(self, event, data);\n\n\t\t\t\treturn self;\n\t\t\t}\n\t\t};\n\n\t\treturn DomElement;\n\t}\n\n\tprovide([ '/demand/validator/isObject', '/demand/validator/isInstanceOf', '/demand/validator/isTypeOf', '/demand/function/uuid', '/demand/function/iterate', '/demand/descriptor', './event', '../hooks/css', '../support/method' ], definition);\n}(this, document));\n"]} \ No newline at end of file +{"version":3,"sources":["dom/element.js"],"names":["global","document","provide","isObject","isInstanceOf","isTypeOf","generateUuid","iterate","Descriptor","Event","hooksCss","supportMethod","documentBody","body","getElementsByTagName","arrayPrototypeConcat","Array","prototype","concat","arrayPrototypeSlice","slice","objectDefineProperty","Object","defineProperty","objectDefineProperties","defineProperties","head","NULL","STRING_UNDEFINED","STRING_STRING","STRING_CONTENTATTRIBUTE","createElement","STRING_MATCHES","regexMatchTag","regexMatchSpaces","regexMatchChildSeclector","previousSibling","previousElementSibling","element","this","nodeType","nextSibling","nextElementSibling","listener","supportsPassiveListener","processOptions","options","capture","emitEvent","type","detail","uuid","event","self","createEvent","initCustomEvent","isDelegate","node","dispatchEvent","defaultPrevented","resolveElement","test","replace","toLowerCase","querySelector","exception","Error","resolveArguments","parameters","apply","call","join","split","matchesDelegate","delegate","pointer","i","path","currentTarget","getSiblings","method","selector","limit","strict","multiple","siblings","push","getParents","parents","parentNode","DomElement","attributes","styles","nodeName","setAttributes","setStyles","noop","Date","get","addEventListener","removeEventListener","error","clone","cloneNode","focus","blur","getPosition","bbox","getBoundingClientRect","left","scrollLeft","top","scrollTop","getOffset","viewport","offsetLeft","offsetTop","getWidth","includeMargin","style","width","offsetWidth","getComputedStyle","parseInt","marginLeft","marginRight","getHeight","height","offsetHeight","marginTop","marginBottom","getContent","getHtml","innerHTML","getAttribute","attribute","getAttributes","result","arguments","getStyle","property","process","getStyles","properties","getSiblingBefore","getSiblingAfter","getSiblingsBefore","getSiblingsAfter","getChildren","matches","match","setAttribute","querySelectorAll","removeAttribute","childNodes","getParent","hasChild","child","contains","hasClass","name","RegExp","className","isVisible","setContent","source","isHtml","value","removeAttributes","setStyle","removeStyle","removeStyles","addClass","removeClass","trim","toggleClass","prepend","target","firstChild","insertBefore","append","insertAdjacentHTML","appendChild","prependTo","appendTo","insertAfter","replaceChild","replaceWith","detach","removeChild","on","events","length","fn","id","handler","delegateTo","isPropagationStopped","originalEvent","one","each","off","emit","data"],"mappings":";CAaC,SAASA,EAAQC,GACjB,aAkqBAC,QAAQ,CAAE,6BAA8B,iCAAkC,6BAA8B,wBAAyB,2BAA4B,qBAAsB,UAAW,eAAgB,sBAhqB9M,SAAoBC,EAAUC,EAAcC,EAAUC,EAAcC,EAASC,EAAYC,EAAOC,EAAUC,GACzG,IACCC,EAA2BX,EAASY,MAAQZ,EAASa,qBAAqB,QAAQ,GAClFC,EAA2BC,MAAMC,UAAUC,OAC3CC,EAA2BH,MAAMC,UAAUG,MAC3CC,EAA2BC,OAAOC,eAClCC,EAA2BF,OAAOG,iBAClCC,EAA2BzB,EAASa,qBAAqB,QAAQ,GAEjEa,EAA2B,KAC3BC,EAA2B,YAC3BC,EAA2B,SAC3BC,EAA4B,gBAAiB7B,EAAS8B,cAAc,KAAQ,cAAgB,YAC5FC,EAA2BrB,EAAc,UAAWC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3J,EAAUsB,KAFC/B,KAEUa,EAAOuJ,GAFjBpK,OAQNmD,KAhqBT,CAoqBEnD,KAAMtC","file":"element.js","sourcesContent":["/**\n * @use /demand/validator/isObject\n * @use /demand/validator/isInstanceOf\n * @use /demand/validator/isTypeOf\n * @use /demand/function/uuid\n * @use /demand/function/iterate\n * @use /demand/descriptor\n *\n * @require ./event\n * @require ../hooks/css\n * @require ../support/method\n */\n\n(function(global, document) {\n\t'use strict';\n\n\tfunction definition(isObject, isInstanceOf, isTypeOf, generateUuid, iterate, Descriptor, Event, hooksCss, supportMethod) {\n\t\tvar //shortcuts\n\t\t\tdocumentBody = document.body || document.getElementsByTagName('body')[0],\n\t\t\tarrayPrototypeConcat = Array.prototype.concat,\n\t\t\tarrayPrototypeSlice = Array.prototype.slice,\n\t\t\tobjectDefineProperty = Object.defineProperty,\n\t\t\tobjectDefineProperties = Object.defineProperties,\n\t\t\thead = document.getElementsByTagName('head')[0],\n\t\t\t// constants\n\t\t\tNULL = null,\n\t\t\tSTRING_UNDEFINED = 'undefined',\n\t\t\tSTRING_STRING = 'string',\n\t\t\tSTRING_CONTENTATTRIBUTE = ('textContent' in document.createElement('a')) ? 'textContent' : 'innerText',\n\t\t\tSTRING_MATCHES = supportMethod('matches', documentBody) || supportMethod('matchesSelector', documentBody),\n\t\t\t// regular expressions\n\t\t\tregexMatchTag = /^<(\\w+)\\s*\\/>$/,\n\t\t\tregexMatchSpaces = / +/g,\n\t\t\tregexMatchChildSeclector = /^\\s*^/,\n\t\t\t// methods\n\t\t\tpreviousSibling = (!isTypeOf(head.previousElementSibling, STRING_UNDEFINED)) ? function previousSibling() { return this.previousElementSibling; } : function previousSibling() { var element = this; while(element = element.previousSibling) { if(element.nodeType === 1 ) { return element; } } },\n\t\t\tnextSibling = (!isTypeOf(head.nextElementSibling, STRING_UNDEFINED)) ? function nextSibling() { return this.nextElementSibling; } : function nextSibling() { var element = this; while(element = element.nextSibling) { if(element.nodeType === 1 ) { return element; } } },\n\t\t\t// flags\n\t\t\t// general storage & objects\n\t\t\tlistener = {},\n\t\t\tsupportsPassiveListener = false;\n\n\t\t(function() {\n\t\t\tvar noop = function() {},\n\t\t\t\tevent = '' + (+new Date()),\n\t\t\t\toptions;\n\n\t\t\ttry {\n\t\t\t\toptions = Object.defineProperty({}, 'passive', {\n\t\t\t\t\tget: function() {\n\t\t\t\t\t\tsupportsPassiveListener = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tglobal.addEventListener(event, noop, options);\n\t\t\t\tglobal.removeEventListener(event, noop, options);\n\t\t\t} catch(error) {} /* eslint-disable-line no-empty */\n\t\t}());\n\n\t\tfunction processOptions(options) {\n\t\t\tif(supportsPassiveListener || typeof options === 'boolean') {\n\t\t\t\treturn options;\n\t\t\t}\n\n\t\t\treturn options && options.capture;\n\t\t}\n\n\t\tfunction emitEvent(type, detail, uuid) {\n\t\t\tvar self = this,\n\t\t\t\tevent;\n\n\t\t\tevent = document.createEvent('CustomEvent');\n\t\t\tevent.initCustomEvent(type, type !== 'load' && type !== 'resize', type !== 'load' && type !== 'resize', detail);\n\n\t\t\tif(uuid) {\n\t\t\t\tevent.uuid = uuid;\n\t\t\t\tevent.isDelegate = true;\n\t\t\t}\n\n\t\t\tself.node.dispatchEvent(event);\n\n\t\t\tif(self.node !== global && !event.defaultPrevented && typeof self.node[type] === 'function') {\n\t\t\t\tself.node[type]();\n\t\t\t}\n\t\t}\n\n\t\tfunction resolveElement(element) {\n\t\t\tif(typeof element === 'string') {\n\t\t\t\ttry {\n\t\t\t\t\tif(regexMatchTag.test(element)) {\n\t\t\t\t\t\telement = document.createElement(element.replace(regexMatchTag, '$1').toLowerCase());\n\t\t\t\t\t} else {\n\t\t\t\t\t\telement = document.querySelector(element);\n\t\t\t\t\t}\n\t\t\t\t} catch(exception) {\n\t\t\t\t\telement = NULL;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(!element) {\n\t\t\t\tthrow new Error('Element could not be resolved');\n\t\t\t}\n\n\t\t\treturn element;\n\t\t}\n\n\t\tfunction resolveArguments(parameters) {\n\t\t\treturn arrayPrototypeConcat.apply([], arrayPrototypeSlice.call(parameters)).join(' ').split(regexMatchSpaces);\n\t\t}\n\n\t\tfunction matchesDelegate(event, delegate) {\n\t\t\tvar i = 0, pointer;\n\n\t\t\tfor(; pointer = event.path[i]; i++) {\n\t\t\t\tif(pointer[STRING_MATCHES] && pointer[STRING_MATCHES](delegate)) {\n\t\t\t\t\tevent.currentTarget = pointer;\n\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tif(pointer === event.currentTarget) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tfunction getSiblings(pointer, method, selector, limit, strict) {\n\t\t\tvar multiple = !(limit && limit === 1),\n\t\t\t\tsiblings = multiple ? [] : false;\n\n\t\t\tstrict = multiple ? false : strict;\n\n\t\t\twhile(pointer = method.call(pointer)) {\n\t\t\t\tif(pointer.nodeType === 1) {\n\t\t\t\t\tif(!selector || pointer[STRING_MATCHES](selector)) {\n\t\t\t\t\t\tif(multiple) {\n\t\t\t\t\t\t\tsiblings.push(pointer);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn pointer;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif(strict) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn siblings;\n\t\t}\n\n\t\tfunction getParents(pointer, selector, limit, strict) {\n\t\t\tvar multiple = !(limit && limit === 1),\n\t\t\t\tparents = multiple ? [] : false;\n\n\t\t\tstrict = multiple ? false : strict;\n\n\t\t\twhile(pointer = pointer.parentNode) {\n\t\t\t\tif(pointer.nodeType === 1) {\n\t\t\t\t\tif(!selector || pointer[STRING_MATCHES](selector)) {\n\t\t\t\t\t\tif(multiple) {\n\t\t\t\t\t\t\tparents.push(pointer);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn pointer;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif(strict) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn parents\n\t\t}\n\n\t\tfunction DomElement(element, attributes, styles) {\n\t\t\tvar self = this,\n\t\t\t\tuuid;\n\n\t\t\telement = resolveElement(element);\n\t\t\tuuid = element.uuid;\n\n\t\t\tif(!uuid) {\n\t\t\t\tuuid = generateUuid();\n\t\t\t\tlistener[uuid] = {};\n\n\t\t\t\tobjectDefineProperty(element, 'uuid', new Descriptor(uuid));\n\t\t\t}\n\n\t\t\tobjectDefineProperties(self, {\n\t\t\t\tuuid: new Descriptor(uuid),\n\t\t\t\ttype: new Descriptor(element === global ? '#window' : element.nodeName),\n\t\t\t\tnode: new Descriptor(element)\n\t\t\t});\n\n\t\t\tif(isObject(attributes)) {\n\t\t\t\tself.setAttributes(attributes);\n\t\t\t}\n\n\t\t\tif(isObject(styles)) {\n\t\t\t\tself.setStyles(styles);\n\t\t\t}\n\n\t\t\treturn self;\n\t\t}\n\n\t\tDomElement.prototype = {\n\t\t\t/* only for reference\n\t\t\t uuid: NULL,\n\t\t\t type: NULL,\n\t\t\t node: NULL\n\t\t\t */\n\t\t\tclone: function() {\n\t\t\t\treturn new DomElement(this.node.cloneNode(true));\n\t\t\t},\n\t\t\tfocus: function() {\n\t\t\t\tthis.node.focus();\n\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tblur: function() {\n\t\t\t\tthis.node.blur();\n\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tgetPosition: function() {\n\t\t\t\tvar bbox = this.node.getBoundingClientRect();\n\n\t\t\t\treturn {\n\t\t\t\t\tleft: bbox.left + documentBody.scrollLeft,\n\t\t\t\t\ttop: bbox.top + documentBody.scrollTop\n\t\t\t\t};\n\t\t\t},\n\t\t\tgetOffset: function(viewport) {\n\t\t\t\tvar node = this.node,\n\t\t\t\t\tbbox = viewport ? node.getBoundingClientRect() : null;\n\n\t\t\t\treturn {\n\t\t\t\t\tleft: viewport ? bbox.left : node.offsetLeft,\n\t\t\t\t\ttop: viewport ? bbox.top : node.offsetTop\n\t\t\t\t};\n\t\t\t},\n\t\t\tgetWidth: function(includeMargin) {\n\t\t\t\tvar node = this.node,\n\t\t\t\t\twidth = node.offsetWidth,\n\t\t\t\t\tstyle;\n\n\t\t\t\tif(includeMargin) {\n\t\t\t\t\tstyle = getComputedStyle(node);\n\n\t\t\t\t\twidth += parseInt(style.marginLeft) + parseInt(style.marginRight);\n\t\t\t\t}\n\n\t\t\t\treturn width;\n\t\t\t},\n\t\t\tgetHeight: function(includeMargin) {\n\t\t\t\tvar node = this.node,\n\t\t\t\t\theight = node.offsetHeight,\n\t\t\t\t\tstyle;\n\n\t\t\t\tif(includeMargin) {\n\t\t\t\t\tstyle = getComputedStyle(node);\n\n\t\t\t\t\theight += parseInt(style.marginTop) + parseInt(style.marginBottom);\n\t\t\t\t}\n\n\t\t\t\treturn height;\n\t\t\t},\n\t\t\tgetContent: function(getHtml) {\n\t\t\t\tvar node = this.node;\n\n\t\t\t\treturn getHtml ? node.innerHTML : node[STRING_CONTENTATTRIBUTE];\n\t\t\t},\n\t\t\tgetAttribute: function(attribute) {\n\t\t\t\tvar self = this;\n\n\t\t\t\tif(isTypeOf(attribute, STRING_STRING)) {\n\t\t\t\t\treturn self.node.getAttribute(attribute);\n\t\t\t\t}\n\t\t\t},\n\t\t\tgetAttributes: function() {\n\t\t\t\tvar self = this,\n\t\t\t\t\tresult = {},\n\t\t\t\t\tattributes = resolveArguments(arguments),\n\t\t\t\t\ti = 0, attribute;\n\n\t\t\t\tfor(; attribute = attributes[i]; i++) {\n\t\t\t\t\tresult[attribute] = self.node.getAttribute(attribute);\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t},\n\t\t\tgetStyle: function(property) {\n\t\t\t\tvar self = this;\n\n\t\t\t\tif(isTypeOf(property, STRING_STRING)) {\n\t\t\t\t\treturn hooksCss.process('get', self.node, property);\n\t\t\t\t}\n\t\t\t},\n\t\t\tgetStyles: function() {\n\t\t\t\tvar self = this,\n\t\t\t\t\tresult = {},\n\t\t\t\t\tproperties = resolveArguments(arguments),\n\t\t\t\t\ti = 0, property;\n\n\t\t\t\tfor(; property = properties[i]; i++) {\n\t\t\t\t\tresult[property] = hooksCss.process('get', self.node, property);\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t},\n\t\t\tgetSiblingBefore: function(selector, strict) {\n\t\t\t\treturn getSiblings(this.node, previousSibling, selector, 1, strict);\n\t\t\t},\n\t\t\tgetSiblingAfter: function(selector, strict) {\n\t\t\t\treturn getSiblings(this.node, nextSibling, selector, 1, strict);\n\t\t\t},\n\t\t\tgetSiblings: function(selector) {\n\t\t\t\treturn this.getSiblingsBefore(selector).concat(this.getSiblingsAfter(selector));\n\t\t\t},\n\t\t\tgetSiblingsBefore: function(selector) {\n\t\t\t\treturn getSiblings(this.node, previousSibling, selector);\n\t\t\t},\n\t\t\tgetSiblingsAfter: function(selector) {\n\t\t\t\treturn getSiblings(this.node, nextSibling, selector);\n\t\t\t},\n\t\t\tgetChildren: function(selector) {\n\t\t\t\tvar self = this.node,\n\t\t\t\t\tuuid, matches, i, match;\n\n\t\t\t\tif(!selector) {\n\t\t\t\t\tmatches = [];\n\n\t\t\t\t\tfor(i = 0; match = self.childNodes[i]; i++) {\n\t\t\t\t\t\tif(match.nodeType === 1) {\n\t\t\t\t\t\t\tmatches.push(match);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if(regexMatchChildSeclector.test(selector)) {\n\t\t\t\t\tuuid = self.uuid;\n\n\t\t\t\t\tself.setAttribute('nucleus-uuid', uuid);\n\n\t\t\t\t\tselector = '[nucleus-uuid=\"' + uuid + '\"] ' + selector;\n\t\t\t\t\tmatches = arrayPrototypeSlice.call(self.parentNode.querySelectorAll(selector));\n\n\t\t\t\t\tself.removeAttribute('nucleus-uuid');\n\t\t\t\t} else {\n\t\t\t\t\tmatches = arrayPrototypeSlice.call(self.querySelectorAll(selector));\n\t\t\t\t}\n\n\t\t\t\treturn matches;\n\t\t\t},\n\t\t\tgetParent: function(selector, strict) {\n\t\t\t\treturn getParents(this.node, selector, 1, strict);\n\t\t\t},\n\t\t\tgetParents: function(selector) {\n\t\t\t\treturn getParents(this.node, selector);\n\t\t\t},\n\t\t\thasChild: function(child) {\n\t\t\t\tvar node = this.node;\n\n\t\t\t\treturn node !== child && node.contains(child.node || child);\n\t\t\t},\n\t\t\thasClass: function(name) {\n\t\t\t\treturn (name) ? (new RegExp('(?:^|\\\\s)' + name + '(?:\\\\s|$)')).test(this.node.className) : false;\n\t\t\t},\n\t\t\tisVisible: function() {\n\t\t\t\tvar self = this,\n\t\t\t\t\tnode = self.node;\n\n\t\t\t\treturn !((node.offsetWidth <= 0 && node.offsetHeight <= 0) || self.getStyle('visibility') === 'hidden' || self.getStyle('opacity') <= 0);\n\t\t\t},\n\t\t\tsetContent: function(source, isHtml) {\n\t\t\t\tvar self = this,\n\t\t\t\t\tnode = self.node;\n\n\t\t\t\tif(isHtml) {\n\t\t\t\t\tnode.innerHTML = source;\n\t\t\t\t} else {\n\t\t\t\t\tnode[STRING_CONTENTATTRIBUTE] = source;\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tsetAttribute: function(attribute, value) {\n\t\t\t\tvar self = this;\n\n\t\t\t\tif(isTypeOf(attribute, STRING_STRING)) {\n\t\t\t\t\tself.node.setAttribute(attribute, value);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tsetAttributes: function(attributes) {\n\t\t\t\tvar self = this;\n\n\t\t\t\titerate(attributes, function(attribute, value) {\n\t\t\t\t\tself.setAttribute(attribute, value);\n\t\t\t\t});\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tremoveAttribute: function(attribute) {\n\t\t\t\tvar self = this;\n\n\t\t\t\tif(isTypeOf(attribute, STRING_STRING)) {\n\t\t\t\t\tself.node.removeAttribute(attribute);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tremoveAttributes: function() {\n\t\t\t\tvar self = this,\n\t\t\t\t\tattributes = resolveArguments(arguments),\n\t\t\t\t\ti = 0, attribute;\n\n\t\t\t\tfor(; attribute = attributes[i]; i++) {\n\t\t\t\t\tself.removeAttribute(attribute);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tsetStyle: function(property, value) {\n\t\t\t\tvar self = this;\n\n\t\t\t\tif(isTypeOf(property, STRING_STRING)) {\n\t\t\t\t\thooksCss.process('set', self.node, property, value);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tsetStyles: function(properties) {\n\t\t\t\tvar self = this;\n\n\t\t\t\titerate(properties, function(property, value) {\n\t\t\t\t\thooksCss.process('set', self.node, property, value);\n\t\t\t\t});\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tremoveStyle: function(property) {\n\t\t\t\tvar self = this;\n\n\t\t\t\tif(isTypeOf(property, STRING_STRING)) {\n\t\t\t\t\tself.setStyle(property, '');\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tremoveStyles: function() {\n\t\t\t\tvar self = this,\n\t\t\t\t\tproperties = resolveArguments(arguments),\n\t\t\t\t\ti = 0, property;\n\n\t\t\t\tfor(; property = properties[i]; i++) {\n\t\t\t\t\tself.setStyle(property, '');\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\taddClass: function(name) {\n\t\t\t\tvar self = this;\n\n\t\t\t\tif(name && !self.hasClass(name)) {\n\t\t\t\t\tself.node.className += (self.node.className) ? ' ' + name : name;\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tremoveClass: function(name) {\n\t\t\t\tvar self = this;\n\n\t\t\t\tif(name && self.hasClass(name)) {\n\t\t\t\t\tself.node.className = self.node.className.replace(new RegExp('(?:^|\\\\s)' + name + '(?!\\\\S)'), '').trim();\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\ttoggleClass: function(name) {\n\t\t\t\tvar self = this;\n\n\t\t\t\tif(name) {\n\t\t\t\t\tself.hasClass(name) ? self.removeClass(name) : self.addClass(name);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tprepend: function(element) {\n\t\t\t\tvar self = this,\n\t\t\t\t\ttarget = self.node;\n\n\t\t\t\tif(element) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\telement = (isInstanceOf(element, DomElement)) ? element.node : resolveElement(element);\n\n\t\t\t\t\t\ttarget.firstChild ? target.insertBefore(element, target.firstChild) : self.append(element);\n\t\t\t\t\t} catch(exception) {\n\t\t\t\t\t\ttarget.insertAdjacentHTML('afterBegin', element);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tappend: function(element) {\n\t\t\t\tvar self = this,\n\t\t\t\t\ttarget = self.node;\n\n\t\t\t\tif(element) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\ttarget.appendChild((isInstanceOf(element, DomElement)) ? element.node : resolveElement(element));\n\t\t\t\t\t} catch(exception) {\n\t\t\t\t\t\ttarget.insertAdjacentHTML('beforeEnd', element);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tprependTo: function(target) {\n\t\t\t\tvar self = this,\n\t\t\t\t\tnode = self.node;\n\n\t\t\t\tif(target) {\n\t\t\t\t\t(target = target.node || resolveElement(target)).firstChild ? target.insertBefore(node, target.firstChild) : self.appendTo(target);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tappendTo: function(target) {\n\t\t\t\tvar self = this;\n\n\t\t\t\tif(target) {\n\t\t\t\t\t(target.node || resolveElement(target)).appendChild(self.node);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tinsertBefore: function(target) {\n\t\t\t\tvar self = this,\n\t\t\t\t\tnode = self.node;\n\n\t\t\t\tif(target) {\n\t\t\t\t\t(target = target.node || resolveElement(target)).parentNode.insertBefore(node, target);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tinsertAfter: function(target) {\n\t\t\t\tvar self = this,\n\t\t\t\t\tnode = self.node;\n\n\t\t\t\tif(target) {\n\t\t\t\t\t(target = target.node || resolveElement(target)).nextSibling ? target.parentNode.insertBefore(node, target.nextSibling) : self.appendTo(target.parentNode);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\treplace: function(target) {\n\t\t\t\tvar self = this,\n\t\t\t\t\tnode = self.node;\n\n\t\t\t\tif(target) {\n\t\t\t\t\t(target = target.node || resolveElement(target)).parentNode.replaceChild(node, target);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\treplaceWith: function(element) {\n\t\t\t\tvar self = this,\n\t\t\t\t\ttarget = self.node;\n\n\t\t\t\tif(element) {\n\t\t\t\t\telement = (isInstanceOf(element, DomElement)) ? element.node : resolveElement(element);\n\n\t\t\t\t\ttarget.parentNode.replaceChild(element, target);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tdetach: function() {\n\t\t\t\tvar self = this,\n\t\t\t\t\tnode = self.node;\n\n\t\t\t\tnode.parentNode && node.parentNode.removeChild(node);\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\ton: function(events) {\n\t\t\t\tvar self = this,\n\t\t\t\t\tdelegate = (arguments.length === 4 || typeof arguments[1] === 'string') ? arguments[1] : NULL,\n\t\t\t\t\tfn = (arguments.length === 4 || typeof arguments[2] === 'function') ? arguments[2] : arguments[1],\n\t\t\t\t\toptions = processOptions((arguments.length > 3) ? arguments[3] : arguments[2]),\n\t\t\t\t\tuuid = fn.uuid || (fn.uuid = generateUuid()),\n\t\t\t\t\ti = 0, event;\n\n\t\t\t\tevents = events.split(regexMatchSpaces);\n\n\t\t\t\tfor(; event = events[i]; i++) {\n\t\t\t\t\tvar id = event + '-' + uuid,\n\t\t\t\t\t\thandler = function(event) {\n\t\t\t\t\t\t\tvar delegateTo;\n\n\t\t\t\t\t\t\tevent = new Event(event);\n\n\t\t\t\t\t\t\tif(!event.isPropagationStopped) {\n\t\t\t\t\t\t\t\tdelegateTo = event.delegate;\n\t\t\t\t\t\t\t\tevent.uuid = generateUuid();\n\n\t\t\t\t\t\t\t\tif(!delegate || matchesDelegate(event, delegate)) {\n\t\t\t\t\t\t\t\t\tfn.call(event.currentTarget, event, event.originalEvent.detail);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif(delegateTo) {\n\t\t\t\t\t\t\t\t\tdelete event.delegate;\n\n\t\t\t\t\t\t\t\t\temitEvent.call(self, delegateTo);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\n\t\t\t\t\thandler.type = event;\n\t\t\t\t\tlistener[self.uuid][id] = handler;\n\n\t\t\t\t\tself.node.addEventListener(event, handler, options);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\tone: function(events) {\n\t\t\t\tvar self = this,\n\t\t\t\t\tdelegate = (arguments.length === 5 || typeof arguments[1] === 'string') ? arguments[1] : NULL,\n\t\t\t\t\tfn = (arguments.length === 5 || typeof arguments[2] === 'function') ? arguments[2] : arguments[1],\n\t\t\t\t\toptions = processOptions((arguments.length > 3) ? arguments[3] : arguments[2]),\n\t\t\t\t\teach = ((arguments.length > 4) ? arguments[4] : arguments[3]) !== false,\n\t\t\t\t\thandler = function(event) {\n\t\t\t\t\t\tself.off(((each === true) ? event.type : events), handler, options);\n\n\t\t\t\t\t\tfn.call(this, event, event.originalEvent.detail);\n\t\t\t\t\t};\n\n\t\t\t\tfn.uuid = handler.uuid = generateUuid();\n\n\t\t\t\tif(delegate) {\n\t\t\t\t\tself.on(events, delegate, handler, options);\n\t\t\t\t} else {\n\t\t\t\t\tself.on(events, handler, options);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\toff: function(events, fn, options) {\n\t\t\t\tvar self = this,\n\t\t\t\t\tnode = self.node,\n\t\t\t\t\ti = 0, event, id, handler;\n\n\t\t\t\toptions = processOptions(options);\n\t\t\t\tevents = events.split(' ');\n\n\t\t\t\tfor(; event = events[i]; i++) {\n\t\t\t\t\tid = fn.uuid && event + '-' + fn.uuid || NULL;\n\t\t\t\t\thandler = id && listener[self.uuid][id] || NULL;\n\n\t\t\t\t\tif(handler) {\n\t\t\t\t\t\tnode.removeEventListener(event, handler, options);\n\n\t\t\t\t\t\tdelete listener[self.uuid][id];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnode.removeEventListener(event, fn, options);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\t\t\temit: function(event, data) {\n\t\t\t\tvar self = this;\n\n\t\t\t\temitEvent.call(self, event, data);\n\n\t\t\t\treturn self;\n\t\t\t}\n\t\t};\n\n\t\treturn DomElement;\n\t}\n\n\tprovide([ '/demand/validator/isObject', '/demand/validator/isInstanceOf', '/demand/validator/isTypeOf', '/demand/function/uuid', '/demand/function/iterate', '/demand/descriptor', './event', '../hooks/css', '../support/method' ], definition);\n}(this, document));\n"]} \ No newline at end of file diff --git a/dist/dom/element/appear.js b/dist/dom/element/appear.js index e58b42f..71c66fd 100644 --- a/dist/dom/element/appear.js +++ b/dist/dom/element/appear.js @@ -1,3 +1,3 @@ -/**! Qoopido.nucleus 3.2.7 | http://nucleus.qoopido.com | (c) 2020 Dirk Lueth */ -!function(t,e,i){"use strict";if("CSS1Compat"!==e.compatMode)throw new Error("Browser needs to be in standards mode");provide(["/demand/weakmap","../element","../../function/merge","../../function/debounce"],(function(n,o,r,s){var a=e.documentElement,c=new o(t),d={},u=new n,h=[];function l(){d.left=0,d.top=0,d.right=t.innerWidth||a.clientWidth,d.bottom=t.innerHeight||a.clientHeight}function p(){var t=u.get(this),e=t.settings,i=t.boundaries,n=e.threshold,o=void 0!==n?n:a.clientWidth*e.auto,r=void 0!==n?n:a.clientHeight*e.auto;i.left=d.left-o,i.top=d.top-r,i.right=d.right+o,i.bottom=d.bottom+r}function g(t,e){var i=t.getBoundingClientRect();return!(i.right<=e.left||i.bottom<=e.top||i.left>=e.right||i.top>=e.bottom)}function f(){var t=this.node,e=u.get(this);return g(t,d)?2:g(t,e.boundaries)?1:0}function m(t,e){var i=o.call(this,t);return"auto"===(e=r({},m.settings,e)).threshold&&delete e.threshold,u.set(i,{settings:e,boundaries:{},state:-1}),c.on("resize orientationchange",s(p.bind(i))),p.call(i),h.push(i),i}return c.on("resize orientationchange",s(l)),l(),i((function(){for(var t,e,i,n,o=0;t=h[o];o++)if(!(i=(e=u.get(t)).settings).visibility||t.isVisible()){if((n=f.call(t))!==e.state){switch(n){case 0:t.emit("disappear",{priority:1});break;case 1:t.emit(e.state<=0?"appear":"disappear",{priority:2});break;case 2:t.emit("appear",{priority:1})}e.state=n}i.recur||2!==n||(h.splice(o,1),o--)}}),1e3/30),m.settings={threshold:"auto",recur:!0,auto:1,visibility:!0},m.extends(o)}))}(this,document,setInterval); +/**! Qoopido.nucleus 3.2.8 | http://nucleus.qoopido.com | (c) 2020 Dirk Lueth */ +!function(t,e,i){"use strict";if("CSS1Compat"!==e.compatMode)throw new Error("Browser needs to be in standards mode");provide(["/demand/weakmap","../element","../../function/merge","../../function/debounce"],(function(n,o,r,s){var a=e.documentElement,c=new o(t),u={},d=new n,h=[],l="resize orientationchange",g="appear",f="disappear";function m(){u.left=0,u.top=0,u.right=t.innerWidth||a.clientWidth,u.bottom=t.innerHeight||a.clientHeight}function p(){var t=d.get(this),e=t.settings,i=t.boundaries,n=e.threshold,o=void 0!==n?n:a.clientWidth*e.auto,r=void 0!==n?n:a.clientHeight*e.auto;i.left=u.left-o,i.top=u.top-r,i.right=u.right+o,i.bottom=u.bottom+r}function b(t,e){var i=t.getBoundingClientRect();return!(i.right<=e.left||i.bottom<=e.top||i.left>=e.right||i.top>=e.bottom)}function v(){var t=this.node,e=d.get(this);return b(t,u)?2:b(t,e.boundaries)?1:0}function w(t,e){var i=o.call(this,t);return"auto"===(e=r({},w.settings,e)).threshold&&delete e.threshold,d.set(i,{settings:e,boundaries:{},state:-1}),c.on(l,s(p.bind(i))),p.call(i),h.push(i),i}return c.on(l,s(m)),m(),i((function(){for(var t,e,i,n,o=0;t=h[o];o++)if(!(i=(e=d.get(t)).settings).visibility||t.isVisible()){if((n=v.call(t))!==e.state){switch(n){case 0:t.emit(f,{priority:1});break;case 1:t.emit(e.state<=0?g:f,{priority:2});break;case 2:t.emit(g,{priority:1})}e.state=n}i.recur||2!==n||(h.splice(o,1),o--)}}),1e3/30),w.settings={threshold:"auto",recur:!0,auto:1,visibility:!0},w.extends(o)}))}(this,document,setInterval); //# sourceMappingURL=appear.js.map diff --git a/dist/dom/element/appear.js.map b/dist/dom/element/appear.js.map index f995ba0..104e33b 100644 --- a/dist/dom/element/appear.js.map +++ b/dist/dom/element/appear.js.map @@ -1 +1 @@ -{"version":3,"sources":["dom/element/appear.js"],"names":["global","document","setInterval","compatMode","Error","provide","Weakmap","DomElement","functionMerge","functionDebounce","documentElement","window","viewport","storage","elements","updateViewport","left","top","right","innerWidth","clientWidth","bottom","innerHeight","clientHeight","updateBoundaries","properties","get","this","settings","boundaries","treshold","threshold","x","undefined","auto","y","isWithinBoundaries","element","rect","getBoundingClientRect","check","node","DomElementAppear","self","call","set","state","on","bind","push","i","visibility","isVisible","emit","priority","recur","splice","extends"],"mappings":";CAQC,SAASA,EAAQC,EAAUC,GAC3B,aAEA,GAA2B,eAAxBD,EAASE,WACX,MAAM,IAAIC,MAAM,yCAqIjBC,QAAQ,CAAE,kBAAmB,aAAc,uBAAwB,4BAlInE,SAAoBC,EAASC,EAAYC,EAAeC,GACvD,IAAIC,EAAmBT,EAASS,gBAC/BC,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B,EAAiBoB,KAAKD,GACtB7B,EAASmC,KAAKN,GAEPA,EAUR,OArHAhC,EAAOoC,GAJa,2BAIKtC,EAAiBM,IAC1CA,IAEAb,GAAY,WAGX,IAFA,IAAWmC,EAASZ,EAAYG,EAAUkB,EAAtCI,EAAI,EAEFb,EAAUvB,EAASoC,GAAIA,IAI5B,KAFAtB,GADAH,EAAaZ,EAAQa,IAAIW,IACDT,UAEXuB,YAAcd,EAAQe,YAAa,CAG/C,IAFAN,EAAQN,EAAMI,KAAKP,MAENZ,EAAWqB,MAAO,CAC9B,OAAOA,GACN,KAAK,EACJT,EAAQgB,KAlBM,YAkBgB,CAAEC,SAAU,IAE1C,MACD,KAAK,EACJjB,EAAQgB,KAAK5B,EAAWqB,OAAS,EAvBnB,SACA,YAsBuD,CAAEQ,SAAU,IAEjF,MACD,KAAK,EACJjB,EAAQgB,KA3BM,SA2Ba,CAAEC,SAAU,IAKzC7B,EAAWqB,MAAQA,EAGhBlB,EAAS2B,OAAmB,IAAVT,IACrBhC,EAAS0C,OAAON,EAAG,GACnBA,QAID,IAAO,IAwEVR,EAAiBd,SAAW,CAC3BG,UAAY,OACZwB,OAAY,EACZrB,KAAY,EACZiB,YAAY,GAGNT,EAAiBe,QAAQlD,MAtIlC,CA0IEoB,KAAM1B,SAAUC","file":"appear.js","sourcesContent":["/**\n * @use /demand/weakmap\n *\n * @require ../element\n * @require ../../function/merge\n * @require ../../function/debounce\n */\n\n(function(global, document, setInterval) {\n\t'use strict';\n\n\tif(document.compatMode !== 'CSS1Compat') {\n\t\tthrow new Error('Browser needs to be in standards mode');\n\t}\n\n\tfunction definition(Weakmap, DomElement, functionMerge, functionDebounce) {\n\t\tvar documentElement = document.documentElement,\n\t\t\twindow = new DomElement(global),\n\t\t\tviewport = {},\n\t\t\tstorage = new Weakmap(),\n\t\t\telements = [],\n\t\t\tEVENTS_RESIZE = 'resize orientationchange',\n\t\t\tEVENT_APPEAR = 'appear',\n\t\t\tEVENT_DISAPPEAR = 'disappear';\n\n\t\twindow.on(EVENTS_RESIZE, functionDebounce(updateViewport));\n\t\tupdateViewport();\n\n\t\tsetInterval(function() {\n\t\t\tvar i = 0, element, properties, settings, state;\n\n\t\t\tfor(; element = elements[i]; i++) {\n\t\t\t\tproperties = storage.get(element);\n\t\t\t\tsettings = properties.settings;\n\n\t\t\t\tif(!settings.visibility || element.isVisible()) {\n\t\t\t\t\tstate = check.call(element);\n\n\t\t\t\t\tif(state !== properties.state) {\n\t\t\t\t\t\tswitch(state) {\n\t\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t\telement.emit(EVENT_DISAPPEAR, { priority: 1 });\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\telement.emit(properties.state <= 0 ? EVENT_APPEAR : EVENT_DISAPPEAR, { priority: 2 });\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\telement.emit(EVENT_APPEAR, { priority: 1 });\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tproperties.state = state;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!settings.recur && state === 2) {\n\t\t\t\t\t\telements.splice(i, 1);\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}, 1000 / 30);\n\n\t\tfunction updateViewport() {\n\t\t\tviewport.left = 0;\n\t\t\tviewport.top = 0;\n\t\t\tviewport.right = global.innerWidth || documentElement.clientWidth;\n\t\t\tviewport.bottom = global.innerHeight || documentElement.clientHeight;\n\t\t}\n\n\t\tfunction updateBoundaries() {\n\t\t\tvar properties = storage.get(this),\n\t\t\t\tsettings = properties.settings,\n\t\t\t\tboundaries = properties.boundaries,\n\t\t\t\ttreshold = settings.threshold,\n\t\t\t\tx = (treshold !== undefined) ? treshold : documentElement.clientWidth * settings.auto,\n\t\t\t\ty = (treshold !== undefined) ? treshold : documentElement.clientHeight * settings.auto;\n\n\t\t\tboundaries.left = viewport.left - x;\n\t\t\tboundaries.top = viewport.top - y;\n\t\t\tboundaries.right = viewport.right + x;\n\t\t\tboundaries.bottom = viewport.bottom + y;\n\t\t}\n\n\t\tfunction isWithinBoundaries(element, boundaries) {\n\t\t\tvar rect = element.getBoundingClientRect();\n\n\t\t\tif(rect.right <= boundaries.left || rect.bottom <= boundaries.top || rect.left >= boundaries.right || rect.top >= boundaries.bottom) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tfunction check() {\n\t\t\tvar self = this,\n\t\t\t\tnode = self.node,\n\t\t\t\tproperties = storage.get(self);\n\n\t\t\tif(isWithinBoundaries(node, viewport)) {\n\t\t\t\treturn 2;\n\t\t\t}\n\n\t\t\tif(isWithinBoundaries(node, properties.boundaries)) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t}\n\n\t\tfunction DomElementAppear(element, settings) {\n\t\t\tvar self = DomElement.call(this, element);\n\n\t\t\tsettings = functionMerge({}, DomElementAppear.settings, settings);\n\n\t\t\tif(settings.threshold === 'auto') {\n\t\t\t\tdelete settings.threshold;\n\t\t\t}\n\n\t\t\tstorage.set(self, {\n\t\t\t\tsettings: settings,\n\t\t\t\tboundaries: {},\n\t\t\t\tstate: -1\n\t\t\t});\n\n\t\t\twindow.on(EVENTS_RESIZE, functionDebounce(updateBoundaries.bind(self)));\n\n\t\t\tupdateBoundaries.call(self);\n\t\t\telements.push(self);\n\n\t\t\treturn self;\n\t\t}\n\n\t\tDomElementAppear.settings = {\n\t\t\tthreshold: 'auto',\n\t\t\trecur: true,\n\t\t\tauto: 1,\n\t\t\tvisibility: true\n\t\t};\n\n\t\treturn DomElementAppear.extends(DomElement);\n\t}\n\n\tprovide([ '/demand/weakmap', '../element', '../../function/merge', '../../function/debounce' ], definition);\n}(this, document, setInterval));\n"]} \ No newline at end of file +{"version":3,"sources":["dom/element/appear.js"],"names":["global","document","setInterval","compatMode","Error","provide","Weakmap","DomElement","functionMerge","functionDebounce","documentElement","window","viewport","storage","elements","EVENTS_RESIZE","EVENT_APPEAR","EVENT_DISAPPEAR","updateViewport","left","top","right","innerWidth","clientWidth","bottom","innerHeight","clientHeight","updateBoundaries","properties","get","this","settings","boundaries","treshold","threshold","x","undefined","auto","y","isWithinBoundaries","element","rect","getBoundingClientRect","check","node","DomElementAppear","self","call","set","state","on","bind","push","i","visibility","isVisible","emit","priority","recur","splice","extends"],"mappings":";CAQC,SAASA,EAAQC,EAAUC,GAC3B,aAEA,GAA2B,eAAxBD,EAASE,WACX,MAAM,IAAIC,MAAM,yCAqIjBC,QAAQ,CAAE,kBAAmB,aAAc,uBAAwB,4BAlInE,SAAoBC,EAASC,EAAYC,EAAeC,GACvD,IAAIC,EAAmBT,EAASS,gBAC/BC,EAAmB,IAAIJ,EAAWP,GAClCY,EAAmB,GACnBC,EAAmB,IAAIP,EACvBQ,EAAmB,GACnBC,EAAmB,2BACnBC,EAAmB,SACnBC,EAAmB,YA0CpB,SAASC,IACRN,EAASO,KAAS,EAClBP,EAASQ,IAAS,EAClBR,EAASS,MAASrB,EAAOsB,YAAcZ,EAAgBa,YACvDX,EAASY,OAASxB,EAAOyB,aAAef,EAAgBgB,aAGzD,SAASC,IACR,IAAIC,EAAaf,EAAQgB,IAAIC,MAC5BC,EAAaH,EAAWG,SACxBC,EAAaJ,EAAWI,WACxBC,EAAaF,EAASG,UACtBC,OAA2BC,IAAbH,EAA0BA,EAAWvB,EAAgBa,YAAcQ,EAASM,KAC1FC,OAA2BF,IAAbH,EAA0BA,EAAWvB,EAAgBgB,aAAeK,EAASM,KAE5FL,EAAWb,KAASP,EAASO,KAAOgB,EACpCH,EAAWZ,IAASR,EAASQ,IAAMkB,EACnCN,EAAWX,MAAST,EAASS,MAAQc,EACrCH,EAAWR,OAASZ,EAASY,OAASc,EAGvC,SAASC,EAAmBC,EAASR,GACpC,IAAIS,EAAOD,EAAQE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AAG,GACnBA,QAID,IAAO,IAwEVR,EAAiBd,SAAW,CAC3BG,UAAY,OACZwB,OAAY,EACZrB,KAAY,EACZiB,YAAY,GAGNT,EAAiBe,QAAQrD,MAtIlC,CA0IEuB,KAAM7B,SAAUC","file":"appear.js","sourcesContent":["/**\n * @use /demand/weakmap\n *\n * @require ../element\n * @require ../../function/merge\n * @require ../../function/debounce\n */\n\n(function(global, document, setInterval) {\n\t'use strict';\n\n\tif(document.compatMode !== 'CSS1Compat') {\n\t\tthrow new Error('Browser needs to be in standards mode');\n\t}\n\n\tfunction definition(Weakmap, DomElement, functionMerge, functionDebounce) {\n\t\tvar documentElement = document.documentElement,\n\t\t\twindow = new DomElement(global),\n\t\t\tviewport = {},\n\t\t\tstorage = new Weakmap(),\n\t\t\telements = [],\n\t\t\tEVENTS_RESIZE = 'resize orientationchange',\n\t\t\tEVENT_APPEAR = 'appear',\n\t\t\tEVENT_DISAPPEAR = 'disappear';\n\n\t\twindow.on(EVENTS_RESIZE, functionDebounce(updateViewport));\n\t\tupdateViewport();\n\n\t\tsetInterval(function() {\n\t\t\tvar i = 0, element, properties, settings, state;\n\n\t\t\tfor(; element = elements[i]; i++) {\n\t\t\t\tproperties = storage.get(element);\n\t\t\t\tsettings = properties.settings;\n\n\t\t\t\tif(!settings.visibility || element.isVisible()) {\n\t\t\t\t\tstate = check.call(element);\n\n\t\t\t\t\tif(state !== properties.state) {\n\t\t\t\t\t\tswitch(state) {\n\t\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t\telement.emit(EVENT_DISAPPEAR, { priority: 1 });\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\telement.emit(properties.state <= 0 ? EVENT_APPEAR : EVENT_DISAPPEAR, { priority: 2 });\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\telement.emit(EVENT_APPEAR, { priority: 1 });\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tproperties.state = state;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!settings.recur && state === 2) {\n\t\t\t\t\t\telements.splice(i, 1);\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}, 1000 / 30);\n\n\t\tfunction updateViewport() {\n\t\t\tviewport.left = 0;\n\t\t\tviewport.top = 0;\n\t\t\tviewport.right = global.innerWidth || documentElement.clientWidth;\n\t\t\tviewport.bottom = global.innerHeight || documentElement.clientHeight;\n\t\t}\n\n\t\tfunction updateBoundaries() {\n\t\t\tvar properties = storage.get(this),\n\t\t\t\tsettings = properties.settings,\n\t\t\t\tboundaries = properties.boundaries,\n\t\t\t\ttreshold = settings.threshold,\n\t\t\t\tx = (treshold !== undefined) ? treshold : documentElement.clientWidth * settings.auto,\n\t\t\t\ty = (treshold !== undefined) ? treshold : documentElement.clientHeight * settings.auto;\n\n\t\t\tboundaries.left = viewport.left - x;\n\t\t\tboundaries.top = viewport.top - y;\n\t\t\tboundaries.right = viewport.right + x;\n\t\t\tboundaries.bottom = viewport.bottom + y;\n\t\t}\n\n\t\tfunction isWithinBoundaries(element, boundaries) {\n\t\t\tvar rect = element.getBoundingClientRect();\n\n\t\t\tif(rect.right <= boundaries.left || rect.bottom <= boundaries.top || rect.left >= boundaries.right || rect.top >= boundaries.bottom) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tfunction check() {\n\t\t\tvar self = this,\n\t\t\t\tnode = self.node,\n\t\t\t\tproperties = storage.get(self);\n\n\t\t\tif(isWithinBoundaries(node, viewport)) {\n\t\t\t\treturn 2;\n\t\t\t}\n\n\t\t\tif(isWithinBoundaries(node, properties.boundaries)) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t}\n\n\t\tfunction DomElementAppear(element, settings) {\n\t\t\tvar self = DomElement.call(this, element);\n\n\t\t\tsettings = functionMerge({}, DomElementAppear.settings, settings);\n\n\t\t\tif(settings.threshold === 'auto') {\n\t\t\t\tdelete settings.threshold;\n\t\t\t}\n\n\t\t\tstorage.set(self, {\n\t\t\t\tsettings: settings,\n\t\t\t\tboundaries: {},\n\t\t\t\tstate: -1\n\t\t\t});\n\n\t\t\twindow.on(EVENTS_RESIZE, functionDebounce(updateBoundaries.bind(self)));\n\n\t\t\tupdateBoundaries.call(self);\n\t\t\telements.push(self);\n\n\t\t\treturn self;\n\t\t}\n\n\t\tDomElementAppear.settings = {\n\t\t\tthreshold: 'auto',\n\t\t\trecur: true,\n\t\t\tauto: 1,\n\t\t\tvisibility: true\n\t\t};\n\n\t\treturn DomElementAppear.extends(DomElement);\n\t}\n\n\tprovide([ '/demand/weakmap', '../element', '../../function/merge', '../../function/debounce' ], definition);\n}(this, document, setInterval));\n"]} \ No newline at end of file diff --git a/dist/dom/element/resize.js b/dist/dom/element/resize.js index 80426bc..9a1eac5 100644 --- a/dist/dom/element/resize.js +++ b/dist/dom/element/resize.js @@ -1,3 +1,3 @@ -/**! Qoopido.nucleus 3.2.7 | http://nucleus.qoopido.com | (c) 2020 Dirk Lueth */ +/**! Qoopido.nucleus 3.2.8 | http://nucleus.qoopido.com | (c) 2020 Dirk Lueth */ !function(){"use strict";provide(["/demand/weakmap","../element"],(function(e,n){var t=new e,i=!(document.documentMode<11)&&"pointerEvents"in document.createElement("iframe").style,o={pointerEvents:"none",userSelect:"none",userDrag:"none",zIndex:"-1",display:"block",opacity:0,position:"absolute",left:0,top:"-100%",width:"100%",height:"100%",margin:"1px 0 0",padding:0,border:"none"};return i||(o.visibility="hidden"),function(e){var i,d,a=n.call(this,e),r=t.get(a.node);if(r)return r;i=a.getStyle("position"),d=new n("