@qbix/q.js 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1,12 @@
1
- !function(t,r){"object"==typeof module&&module.exports?module.exports=r():"function"==typeof define&&define.amd?define([],r):t.Handlebars=r()}("undefined"!=typeof self?self:this,function(){"use strict";function t(t){this.string=String(t)}function r(t,r){return Object.prototype.hasOwnProperty.call(t,r)}function e(t,e){for(var n in e)r(e,n)&&(t[n]=e[n]);return t}function n(t){var r={};return t&&"object"==typeof t&&e(r,t),r}function a(r){return null==r?"":r instanceof t?r.toString():String(r).replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[t]))}function i(t,r){if(null!=t){if(!r)return t;for(var e=r.split("."),n=t,a=0;a<e.length;a++){var i=e[a];"["===i[0]&&"]"==i[i.length-1]&&(i=i.slice(1,-1)),n=null!=n?n[i]:void 0}return n}}function s(t){for(var r=[],e="",n=null,a=!1,i=0,s=0;s<t.length;s++){var o=t[s];if(n){if(a){e+=o,a=!1;continue}if("\\"===o){e+=o,a=!0;continue}e+=o,o===n&&(n=null)}else"'"!==o&&'"'!==o?"("!==o?")"!==o?/\s/.test(o)&&0===i?e&&(r.push(e),e=""):e+=o:(i>0&&i--,e+=o):(i++,e+=o):(e+=o,n=o)}return e&&r.push(e),r}function o(t){var r=s(t);return r.length?r[0]:""}function f(t){return"("===t[0]&&")"===t[t.length-1]}function l(t,r,e,n){if(f(t)){var a=t.slice(1,-1).trim(),s=o(a);if(p[s]){var u=c(a.slice(s.length).trim(),r,e,n),h={hash:u.hash,data:n,fn:()=>"",inverse:()=>""};return p[s].apply(r,u.args.concat(h))}return l(a,r,e,n)}return"'"===t[0]&&"'"===t[t.length-1]||'"'===t[0]&&'"'===t[t.length-1]?t.slice(1,-1):function(t,r,e,n){if("this"===t||"."===t)return r;if("@index"===t)return n&&n["@index"];if("@key"===t)return n&&n["@key"];if("@first"===t)return n&&n["@first"];if("@last"===t)return n&&n["@last"];if(0===t.indexOf("@root."))return i(n.root,t.slice(6));if("@root"===t)return n.root;for(var a=0;0===t.indexOf("../");)a++,t=t.slice(3);var s=r;if(a>0){var o=e.length-1-a;o<0&&(o=0),s=e[o]}return i(s,t)}(t,r,e,n)}function c(t,r,e,n){for(var a=s(t),i=[],o={},f=0;f<a.length;f++){var c=a[f],u=c.indexOf("=");if(u>0){var p=c.slice(0,u),h=c.slice(u+1);o[p]=l(h,r,e,n)}else i.push(l(c,r,e,n))}return{args:i,hash:o}}function u(t){for(var r=0,e="var out='';var __stack=[ctx];\n",n=t.split(/(\{\{\{\{[\s\S]+?\}\}\}\}|\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\})/),a=[],i=0;i<n.length;i++){if(N=n[i])if(N.startsWith("{{{{raw}}}}")){var l=t.indexOf("{{{{/raw}}}}",t.indexOf(N)),c=t.slice(t.indexOf(N)+10,l);e+="out+="+JSON.stringify(c)+";\n",i+=2}else if(N.startsWith("{{{")&&N.endsWith("}}}")){var u=N.slice(3,-3).trim();e+="var v=evalMaybePath("+JSON.stringify(u)+",ctx,__stack,data);out+=(v==null?'':v);\n"}else if(N.startsWith("{{")&&N.endsWith("}}")){var p=N.slice(2,-2).trim();if("!"===p[0]||p.startsWith("--"))continue;if("#"===p[0]){var h=o(c=p.slice(1).trim()),v=c.slice(h.length).trim(),g=/\s+as\s+\|([^|]+)\|/.exec(v),d=null;g&&(d=g[1].trim().split(/\s+/),v=v.replace(g[0],""));var x=++r;if(a.push(x),e+="var parsed"+x+"=parseArgs("+JSON.stringify(v)+",ctx,__stack,data);",e+="var outerCtx"+x+"=ctx;var opts"+x+"={hash:parsed"+x+".hash,data:data,fn:function(sub,o){var out='';var d=createFrame(data);if(o&&o.data)assign(d,o.data);var data=d;ctx=sub||outerCtx"+x+";__stack.push(ctx);",d)for(var y=0;y<d.length;y++)e+="ctx["+JSON.stringify(d[y])+"]=sub;";continue}if("else"===p){e+="return out;},inverse:function(sub,o){var out='';ctx=sub||ctx;__stack.push(ctx);\n";continue}if("/"===p[0]){l=p.slice(1).trim();var O=a.pop();e+="return out;}};if(!opts"+O+".inverse)opts"+O+".inverse=function(){return '';};var r=(helpers["+JSON.stringify(l)+"]||helpers.blockHelperMissing).apply(ctx,parsed"+O+".args.concat(opts"+O+"));out+=(r||'');ctx=outerCtx"+O+";__stack.pop();\n";continue}if(p.startsWith("#>")){var S=p.slice(2).trim();e+="if(partials["+JSON.stringify(S)+"])out+=partials["+JSON.stringify(S)+"](ctx,partials,helpers,data,evalMaybePath,parseArgs,escapeExpression,createFrame,assign,firstToken,{fn:function(){return '';}});\n";continue}if(">"===p[0]){var m=s(v=p.slice(1).trim()),b=m.shift(),k=f(b),_=m.join(" ");e+="var pName"+(x=++r)+"="+(k?"evalMaybePath("+JSON.stringify(b)+",ctx,__stack,data)":"'"+b+"'")+";",e+="var pArgs=parseArgs("+JSON.stringify(_)+",ctx,__stack,data);",e+="var pCtx=ctx;if(Object.keys(pArgs.hash).length) pCtx=assign({},ctx),assign(pCtx,pArgs.hash);",e+="if(partials[pName"+x+"])out+=partials[pName"+x+"](pCtx,partials,helpers,data,evalMaybePath,parseArgs,escapeExpression,createFrame,assign,firstToken);\n";continue}var N=o(p);e+="if(helpers["+JSON.stringify(N)+"]) {var p=parseArgs("+JSON.stringify(p.slice(N.length).trim())+",ctx,__stack,data);var opts={hash:p.hash,data:data,fn:function(){return ''},inverse:function(){return ''}};out+=(helpers["+JSON.stringify(N)+"]||helpers.helperMissing).apply(ctx,p.args.concat(opts))||'';} else {var v=evalMaybePath("+JSON.stringify(p)+",ctx,__stack,data);out+=(v==null?'':escapeExpression(v));}\n"}else e+="out+="+JSON.stringify(N)+";\n"}return e+="return out;",new Function("ctx","partials","helpers","data","evalMaybePath","parseArgs","escapeExpression","createFrame","assign","firstToken",e)}t.prototype.toString=function(){return this.string};var p=Object.create(null),h=Object.create(null);return p.if=function(t,r){return t?r.fn(this,{data:r.data}):r.inverse(this,{data:r.data})},p.unless=function(t,r){return t?r.inverse(this,{data:r.data}):r.fn(this,{data:r.data})},p.each=function(t,r){if(!t||Array.isArray(t)&&!t.length)return r.inverse(this);var e,a="",i=0;if(Array.isArray(t))for(i=0;i<t.length;i++)(e=n(r.data))["@index"]=i,e["@first"]=0===i,e["@last"]=i===t.length-1,a+=r.fn(t[i],{data:e});else{var s=Object.keys(t);for(i=0;i<s.length;i++){var o=s[i];(e=n(r.data))["@key"]=o,e["@index"]=i,e["@first"]=0===i,e["@last"]=i===s.length-1,a+=r.fn(t[o],{data:e})}}return a},p.with=(t,r)=>t?r.fn(t):r.inverse(this),p.log=t=>{console&&console.log&&console.log(t)},p.lookup=(t,r)=>t?t[r]:"",p.helperMissing=()=>"",p.blockHelperMissing=(t,r)=>t?r.fn(t):r.inverse(t),{compile:(t,r)=>{return i=u(String(t)),function(t,r){var s=r&&r.data||{};return void 0===s.root&&(s.root=t),i(t||{},h,p,s,l,c,a,n,e,o)};var i},registerHelper:(t,e)=>{if("object"==typeof t)for(var n in t)r(t,n)&&(p[n]=t[n]);else p[t]=e},registerPartial:(t,e)=>{if("object"==typeof t)for(var n in t)r(t,n)&&(h[n]="function"==typeof e?e:u(String(e)));else h[t]="function"==typeof e?e:u(String(e))},helpers:p,partials:h,escapeExpression:a,createFrame:n,SafeString:t}});
1
+ if(!window.$){var c=function(a){this.length=a.length;for(var b=0;b<a.length;b++)this[b]=a[b]};if(!window.jQuery){var fn={each:function(a){for(var b=0;b<this.length;b++)a.call(this[b],b,this[b]);return this},html:function(a){if(a===undefined)return this[0]&&this[0].innerHTML;return this.each(function(){this.innerHTML=a})},text:function(a){if(a===undefined)return this[0]&&this[0].textContent;return this.each(function(){this.textContent=a})},val:function(v){if(!this[0])return;var el=this[0];if(v===undefined)return el.value;
2
+ if(el.value!==undefined)this.each(function(){this.value=v});return this},append:function(a){return this.each(function(){var b=this;if(a instanceof c)a.each(function(){b.appendChild(this)});else if(a instanceof Element)b.appendChild(a);else if(typeof a==="string")b.insertAdjacentHTML("beforeend",a)})},prepend:function(a){return this.each(function(){var b=this;if(a instanceof c)a.each(function(){b.insertBefore(this,b.firstChild)});else if(a instanceof Element)b.insertBefore(a,b.firstChild);else if(typeof a===
3
+ "string")b.insertAdjacentHTML("afterbegin",a)})},appendTo:function(a){var t=this;if(a instanceof c)a.each(function(){for(var i=0;i<t.length;i++)this.appendChild(t[i])});else if(a instanceof Element)for(var i=0;i<t.length;i++)a.appendChild(t[i]);else if(typeof a==="string")$(a).append(this);return this},prependTo:function(a){var t=this;if(a instanceof c)a.each(function(){for(var i=0;i<t.length;i++)this.insertBefore(t[i],this.firstChild)});else if(a instanceof Element)for(var i=0;i<t.length;i++)a.insertBefore(t[i],
4
+ a.firstChild);else if(typeof a==="string")$(a).prepend(this);return this},parents:function(s){var p=[];this.each(function(){for(var x=this.parentElement;x;x=x.parentElement)if(p.indexOf(x)<0)p.push(x)});p=new c(p);return s?p.filter(s):p},parent:function(s){var p=[];this.each(function(){var x=this.parentElement;if(x&&p.indexOf(x)<0)p.push(x)});p=new c(p);return s?p.filter(s):p},children:function(s){var ch=[];this.each(function(){for(var i=0;i<this.children.length;i++)ch.push(this.children[i])});ch=
5
+ new c(ch);return s?ch.filter(s):ch},filter:function(sel){var r=[];this.each(function(){if(this.matches(sel))r.push(this)});return new c(r)},eq:function(i){return new c([this[i]])},addClass:function(a){return this.each(function(){this.classList.add(a)})},removeClass:function(a){return this.each(function(){this.classList.remove(a)})},hasClass:function(a){return this[0]?this[0].classList.contains(a):false},attr:function(a,b){if(typeof a==="object"&&a){for(var k in a)this.each(function(){this.setAttribute(k,
6
+ a[k])});return this}if(b===undefined)return this[0]&&this[0].getAttribute(a);return this.each(function(){this.setAttribute(a,b)})},css:function(a,b){if(typeof a==="object"&&a){for(var k in a)this.each(function(){this.style[k]=a[k]});return this}if(b===undefined)return this[0]&&getComputedStyle(this[0])[a];return this.each(function(){this.style[a]=b})},scrollTop:function(v){if(!this[0])return 0;if(v===undefined)return this[0].scrollTop;return this.each(function(){this.scrollTop=v})},on:function(a,
7
+ b){return this.each(function(){this.addEventListener(a,b)})},off:function(a,b){return this.each(function(){this.removeEventListener(a,b)})},trigger:function(a){return this.each(function(){this.dispatchEvent(new Event(a))})},hide:function(){return this.each(function(){this.style.display="none"})},show:function(){return this.each(function(){this.style.display=""})},toggle:function(state){return this.each(function(){this.style.display=state===undefined?this.style.display==="none"?"":"none":state?"":
8
+ "none"})},empty:function(){return this.each(function(){this.innerHTML=""})},remove:function(){return this.each(function(){this.remove()})},find:function(a){return new c(this[0]?this[0].querySelectorAll(a):[])},closest:function(a){return new c(this[0]?[this[0].closest(a)]:[])},height:function(){return this[0]?this[0].offsetHeight:0},width:function(){return this[0]?this[0].offsetWidth:0},outerHeight:function(){if(!this[0])return 0;var s=getComputedStyle(this[0]);return this[0].offsetHeight+parseFloat(s.marginTop||
9
+ 0)+parseFloat(s.marginBottom||0)},outerWidth:function(){if(!this[0])return 0;var s=getComputedStyle(this[0]);return this[0].offsetWidth+parseFloat(s.marginLeft||0)+parseFloat(s.marginRight||0)},data:function(a,b){if(!this[0])return;if(!this[0].__data)this[0].__data={};if(b===undefined)return this[0].__data[a];this.each(function(){this.__data[a]=b});return this},is:function(a){if(!this[0])return!1;if(a===":visible")return this[0].offsetParent!==null;return this[0].matches(a)},ready:function(fn){if(this[0]===
10
+ document||this[0]===window)if(document.readyState==="complete"||document.readyState==="interactive")setTimeout(fn,0);else document.addEventListener("DOMContentLoaded",fn);return this}};["click","focus","blur","change","submit"].forEach(function(ev){fn[ev]=function(handler){if(handler)return this.on(ev,handler);return this.trigger(ev)}});c.prototype=fn;window.$=window.jQuery=function(a){if(typeof a==="function")return $(document).ready(a);if(typeof a==="string"&&a.trim().startsWith("<")){a=a.trim();
11
+ var tagMatch=a.match(/^<([a-z0-9-]+)/i);if(tagMatch){var tag=tagMatch[1];var attrMatch=a.match(/<[^>]+>/);var attrs={};(attrMatch?attrMatch[0]:"").replace(/([a-zA-Z_:][-a-zA-Z0-9_:.]*)="([^"]*)"/g,function(_,key,val){attrs[key]=val});return new c([Q.element?Q.element(tag,attrs):Object.assign(document.createElement(tag),attrs)])}var div=document.createElement("div");div.innerHTML=a;return new c(Array.from(div.children))}if(typeof a==="string")return new c(document.querySelectorAll(a));if(a instanceof
12
+ Element||a===window||a===document)return new c([a]);if(a&&a.length)return new c(a);return new c([])};window.$.fn=fn;fn.constructor=c}};
@@ -1,18 +1,10 @@
1
- var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.checkStringArgs=function(a,b,d){if(null==a)throw new TypeError("The 'this' value for String.prototype."+d+" must not be null or undefined");if(b instanceof RegExp)throw new TypeError("First argument to String.prototype."+d+" must not be a regular expression");return a+""};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;
2
- $jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,d){a!=Array.prototype&&a!=Object.prototype&&(a[b]=d.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);
3
- $jscomp.polyfill=function(a,b,d,f){if(b){d=$jscomp.global;a=a.split(".");for(f=0;f<a.length-1;f++){var g=a[f];g in d||(d[g]={});d=d[g]}a=a[a.length-1];f=d[a];b=b(f);b!=f&&null!=b&&$jscomp.defineProperty(d,a,{configurable:!0,writable:!0,value:b})}};
4
- $jscomp.polyfill("String.prototype.startsWith",function(a){return a?a:function(a,d){var b=$jscomp.checkStringArgs(this,a,"startsWith");a+="";var g=b.length,e=a.length;d=Math.max(0,Math.min(d|0,b.length));for(var h=0;h<e&&d<g;)if(b[d++]!=a[h++])return!1;return h>=e}},"es6","es3");$jscomp.owns=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};
5
- $jscomp.polyfill("Object.assign",function(a){return a?a:function(a,d){for(var b=1;b<arguments.length;b++){var g=arguments[b];if(g)for(var e in g)$jscomp.owns(g,e)&&(a[e]=g[e])}return a}},"es6","es3");$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.Symbol=function(){var a=0;return function(b){return $jscomp.SYMBOL_PREFIX+(b||"")+a++}}();
6
- $jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.iterator;a||(a=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&$jscomp.defineProperty(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(a){var b=0;return $jscomp.iteratorPrototype(function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}})};
7
- $jscomp.iteratorPrototype=function(a){$jscomp.initSymbolIterator();a={next:a};a[$jscomp.global.Symbol.iterator]=function(){return this};return a};$jscomp.polyfill("Array.from",function(a){return a?a:function(a,d,f){$jscomp.initSymbolIterator();d=null!=d?d:function(a){return a};var b=[],e=a[Symbol.iterator];if("function"==typeof e)for(a=e.call(a);!(e=a.next()).done;)b.push(d.call(f,e.value));else{e=a.length;for(var h=0;h<e;h++)b.push(d.call(f,a[h]))}return b}},"es6","es3");
8
- if(!window.$){var c=function(a){this.length=a.length;for(var b=0;b<a.length;b++)this[b]=a[b]};if(!window.jQuery){var fn={each:function(a){for(var b=0;b<this.length;b++)a.call(this[b],b,this[b]);return this},html:function(a){return void 0===a?this[0]&&this[0].innerHTML:this.each(function(){this.innerHTML=a})},text:function(a){return void 0===a?this[0]&&this[0].textContent:this.each(function(){this.textContent=a})},val:function(a){if(this[0]){var b=this[0];if(void 0===a)return b.value;void 0!==b.value&&
9
- this.each(function(){this.value=a});return this}},append:function(a){return this.each(function(){var b=this;a instanceof c?a.each(function(){b.appendChild(this)}):a instanceof Element?b.appendChild(a):"string"===typeof a&&b.insertAdjacentHTML("beforeend",a)})},prepend:function(a){return this.each(function(){var b=this;a instanceof c?a.each(function(){b.insertBefore(this,b.firstChild)}):a instanceof Element?b.insertBefore(a,b.firstChild):"string"===typeof a&&b.insertAdjacentHTML("afterbegin",a)})},
10
- appendTo:function(a){var b=this;if(a instanceof c)a.each(function(){for(var a=0;a<b.length;a++)this.appendChild(b[a])});else if(a instanceof Element)for(var d=0;d<b.length;d++)a.appendChild(b[d]);else"string"===typeof a&&$(a).append(this);return this},prependTo:function(a){var b=this;if(a instanceof c)a.each(function(){for(var a=0;a<b.length;a++)this.insertBefore(b[a],this.firstChild)});else if(a instanceof Element)for(var d=0;d<b.length;d++)a.insertBefore(b[d],a.firstChild);else"string"===typeof a&&
11
- $(a).prepend(this);return this},parents:function(a){var b=[];this.each(function(){for(var a=this.parentElement;a;a=a.parentElement)0>b.indexOf(a)&&b.push(a)});b=new c(b);return a?b.filter(a):b},parent:function(a){var b=[];this.each(function(){var a=this.parentElement;a&&0>b.indexOf(a)&&b.push(a)});b=new c(b);return a?b.filter(a):b},children:function(a){var b=[];this.each(function(){for(var a=0;a<this.children.length;a++)b.push(this.children[a])});b=new c(b);return a?b.filter(a):b},filter:function(a){var b=
12
- [];this.each(function(){this.matches(a)&&b.push(this)});return new c(b)},eq:function(a){return new c([this[a]])},addClass:function(a){return this.each(function(){this.classList.add(a)})},removeClass:function(a){return this.each(function(){this.classList.remove(a)})},hasClass:function(a){return this[0]?this[0].classList.contains(a):!1},attr:function(a,b){if("object"===typeof a&&a){for(var d in a)this.each(function(){this.setAttribute(d,a[d])});return this}return void 0===b?this[0]&&this[0].getAttribute(a):
13
- this.each(function(){this.setAttribute(a,b)})},css:function(a,b){if("object"===typeof a&&a){for(var d in a)this.each(function(){this.style[d]=a[d]});return this}return void 0===b?this[0]&&getComputedStyle(this[0])[a]:this.each(function(){this.style[a]=b})},scrollTop:function(a){return this[0]?void 0===a?this[0].scrollTop:this.each(function(){this.scrollTop=a}):0},on:function(a,b){return this.each(function(){this.addEventListener(a,b)})},off:function(a,b){return this.each(function(){this.removeEventListener(a,
14
- b)})},trigger:function(a){return this.each(function(){this.dispatchEvent(new Event(a))})},hide:function(){return this.each(function(){this.style.display="none"})},show:function(){return this.each(function(){this.style.display="block"})},toggle:function(a){return this.each(function(){this.style.display=void 0===a?"none"===this.style.display?"":"none":a?"":"none"})},empty:function(){return this.each(function(){this.innerHTML=""})},remove:function(){return this.each(function(){this.remove()})},find:function(a){return new c(this[0]?
15
- this[0].querySelectorAll(a):[])},closest:function(a){return new c(this[0]?[this[0].closest(a)]:[])},height:function(){return this[0]?this[0].offsetHeight:0},width:function(){return this[0]?this[0].offsetWidth:0},outerHeight:function(){if(!this[0])return 0;var a=getComputedStyle(this[0]);return this[0].offsetHeight+parseFloat(a.marginTop||0)+parseFloat(a.marginBottom||0)},outerWidth:function(){if(!this[0])return 0;var a=getComputedStyle(this[0]);return this[0].offsetWidth+parseFloat(a.marginLeft||
16
- 0)+parseFloat(a.marginRight||0)},data:function(a,b){if(this[0]){this[0].__data||(this[0].__data={});if(void 0===b)return this[0].__data[a];this.each(function(){this.__data[a]=b});return this}},is:function(a){return this[0]?":visible"===a?null!==this[0].offsetParent:this[0].matches(a):!1},ready:function(a){if(this[0]===document||this[0]===window)"complete"===document.readyState||"interactive"===document.readyState?setTimeout(a,0):document.addEventListener("DOMContentLoaded",a);return this}};["click",
17
- "focus","blur","change","submit"].forEach(function(a){fn[a]=function(b){return b?this.on(a,b):this.trigger(a)}});c.prototype=fn;window.$=window.jQuery=function(a){if("function"===typeof a)return $(document).ready(a);if("string"===typeof a&&a.trim().startsWith("<")){a=a.trim();var b=a.match(/^<([a-z0-9-]+)/i);if(b){b=b[1];a=a.match(/<[^>]+>/);var d={};(a?a[0]:"").replace(/([a-zA-Z_:][-a-zA-Z0-9_:.]*)="([^"]*)"/g,function(a,b,e){d[b]=e});return new c([Q.element?Q.element(b,d):Object.assign(document.createElement(b),
18
- d)])}b=document.createElement("div");b.innerHTML=a;return new c(Array.from(b.children))}return"string"===typeof a?new c(document.querySelectorAll(a)):a instanceof Element||a===window||a===document?new c([a]):a&&a.length?new c(a):new c([])};window.$.fn=fn;fn.constructor=c}};
1
+ if(!window.$){var c=function(a){this.length=a.length;for(var b=0;b<a.length;b++)this[b]=a[b]};if(!window.jQuery){var fn={each:function(a){for(var b=0;b<this.length;b++)a.call(this[b],b,this[b]);return this},html:function(a){if(a===undefined)return this[0]&&this[0].innerHTML;return this.each(function(){this.innerHTML=a})},append:function(a){return this.each(function(){var b=this;if(a instanceof c)a.each(function(){b.appendChild(this)});else if(a instanceof Element)b.appendChild(a);else if(typeof a===
2
+ "string")b.insertAdjacentHTML("beforeend",a)})},prepend:function(a){return this.each(function(){var b=this;if(a instanceof c)a.each(function(){b.insertBefore(this,b.firstChild)});else if(a instanceof Element)b.insertBefore(a,b.firstChild);else if(typeof a==="string")b.insertAdjacentHTML("afterbegin",a)})},appendTo:function(a){var t=this;if(a instanceof c)a.each(function(){for(var i=0;i<t.length;i++)this.appendChild(t[i])});else if(a instanceof Element)for(var i=0;i<t.length;i++)a.appendChild(t[i]);
3
+ else if(typeof a==="string")$(a).append(this);return this},prependTo:function(a){var t=this;if(a instanceof c)a.each(function(){for(var i=0;i<t.length;i++)this.insertBefore(t[i],this.firstChild)});else if(a instanceof Element)for(var i=0;i<t.length;i++)a.insertBefore(t[i],a.firstChild);else if(typeof a==="string")$(a).prepend(this);return this},parents:function(s){var p=[];this.each(function(){for(var x=this.parentElement;x;x=x.parentElement)if(p.indexOf(x)<0)p.push(x)});p=new c(p);return s?p.filter(s):
4
+ p},parent:function(s){var p=[];this.each(function(){var x=this.parentElement;if(x&&p.indexOf(x)<0)p.push(x)});p=new c(p);return s?p.filter(s):p},children:function(s){var ch=[];this.each(function(){for(var i=0;i<this.children.length;i++)ch.push(this.children[i])});ch=new c(ch);return s?ch.filter(s):ch},addClass:function(a){return this.each(function(){this.classList.add(a)})},removeClass:function(a){return this.each(function(){this.classList.remove(a)})},hasClass:function(a){return this[0]?this[0].classList.contains(a):
5
+ false},attr:function(a,b){if(b===undefined)return this[0]&&this[0].getAttribute(a);return this.each(function(){this.setAttribute(a,b)})},css:function(a,b){if(typeof a==="object"&&a){for(var k in a)this.each(function(){this.style[k]=a[k]});return this}if(b===undefined)return this[0]&&getComputedStyle(this[0])[a];return this.each(function(){this.style[a]=b})},scrollTop:function(v){if(!this[0])return 0;if(v===undefined)return this[0].scrollTop;return this.each(function(){this.scrollTop=v})},on:function(a,
6
+ b){return this.each(function(){this.addEventListener(a,b)})},off:function(a,b){return this.each(function(){this.removeEventListener(a,b)})},trigger:function(a){return this.each(function(){this.dispatchEvent(new Event(a))})},hide:function(){return this.each(function(){this.style.display="none"})},show:function(){return this.each(function(){this.style.display="block"})},empty:function(){return this.each(function(){this.innerHTML=""})},remove:function(){return this.each(function(){this.remove()})},find:function(a){return new c(this[0]?
7
+ this[0].querySelectorAll(a):[])},closest:function(a){return new c(this[0]?[this[0].closest(a)]:[])},height:function(){return this[0]?this[0].offsetHeight:0},width:function(){return this[0]?this[0].offsetWidth:0},outerHeight:function(){if(!this[0])return 0;var s=getComputedStyle(this[0]);return this[0].offsetHeight+parseFloat(s.marginTop||0)+parseFloat(s.marginBottom||0)},outerWidth:function(){if(!this[0])return 0;var s=getComputedStyle(this[0]);return this[0].offsetWidth+parseFloat(s.marginLeft||
8
+ 0)+parseFloat(s.marginRight||0)},data:function(a,b){if(!this[0])return;if(!this[0].__data)this[0].__data={};if(b===undefined)return this[0].__data[a];this.each(function(){this.__data[a]=b});return this},is:function(a){if(!this[0])return!1;if(a===":visible")return this[0].offsetParent!==null;return this[0].matches(a)},ready:function(fn){if(this[0]===document||this[0]===window)if(document.readyState==="complete"||document.readyState==="interactive")setTimeout(fn,0);else document.addEventListener("DOMContentLoaded",
9
+ fn);return this}};["click","focus","blur","change","submit"].forEach(function(ev){fn[ev]=function(handler){if(handler)return this.on(ev,handler);return this.trigger(ev)}});c.prototype=fn;window.$=window.jQuery=function(a){if(typeof a==="function")return $(document).ready(a);if(typeof a==="string"&&a.trim().startsWith("<")){a=a.trim();var tagMatch=a.match(/^<([a-z0-9-]+)/i);if(tagMatch){var tag=tagMatch[1];var attrMatch=a.match(/<[^>]+>/);var attrs={};(attrMatch?attrMatch[0]:"").replace(/([a-zA-Z_:][-a-zA-Z0-9_:.]*)="([^"]*)"/g,
10
+ function(_,key,val){attrs[key]=val});return new c([Q.element?Q.element(tag,attrs):Object.assign(document.createElement(tag),attrs)])}var div=document.createElement("div");div.innerHTML=a;return new c(Array.from(div.children))}if(typeof a==="string")return new c(document.querySelectorAll(a));if(a instanceof Element||a===window||a===document)return new c([a]);if(a&&a.length)return new c(a);return new c([])};window.$.fn=fn;fn.constructor=c}};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qbix/q.js",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Q.js, the Qbix JavaScript framework",
5
5
  "main": "dist/Q.min.js",
6
6
  "files": [