@qbix/q 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.
- package/README.md +4 -6
- package/dist/Metrics.js +2013 -1
- package/dist/Metrics.min.js +159 -94
- package/dist/handlebars.minimal.min.js +12 -1
- package/dist/jquery.minimal.min.js +10 -18
- package/package.json +1 -1
|
@@ -1 +1,12 @@
|
|
|
1
|
-
!
|
|
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
|
|
2
|
-
|
|
3
|
-
$
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
this.
|
|
10
|
-
|
|
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}};
|