Socket
Socket
Sign inDemoInstall

cash-dom

Package Overview
Dependencies
0
Maintainers
3
Versions
54
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.0.4 to 8.0.0

3

CHANGELOG.md

@@ -0,1 +1,4 @@

### Version 8.0.0
- Improved alignment with jQuery regarding handling of non-bubbling events significantly
### Version 7.0.4

@@ -2,0 +5,0 @@ - Ensuring unusual but valid simple selectors are handled properly

interface Event {
namespace: string;
data: any;
relatedTarget?: Node | null;
___cd?: boolean;

@@ -5,0 +6,0 @@ ___ifocus?: boolean;

20

dist/cash.esm.js

@@ -589,3 +589,3 @@ /* MIT https://github.com/fabiospampinato/cash */

each(getSplitValues(eventFullName), (i, eventFullName) => {
const [nameOriginal, namespaces] = parseEventName(eventFullName), name = getEventNameBubbling(nameOriginal), isEventBubblingProxy = (nameOriginal !== name);
const [nameOriginal, namespaces] = parseEventName(eventFullName), name = getEventNameBubbling(nameOriginal);
this.each((i, ele) => {

@@ -595,4 +595,2 @@ if (!isElement(ele) && !isDocument(ele) && !isWindow(ele))

removeEvent(ele, name, namespaces, selector, callback);
if (isEventBubblingProxy)
removeEvent(ele, nameOriginal, namespaces, selector, callback);
});

@@ -631,3 +629,3 @@ });

each(getSplitValues(eventFullName), (i, eventFullName) => {
const [nameOriginal, namespaces] = parseEventName(eventFullName), name = getEventNameBubbling(nameOriginal), isEventBubblingProxy = (nameOriginal !== name), isEventFocus = (nameOriginal in eventsFocus);
const [nameOriginal, namespaces] = parseEventName(eventFullName), name = getEventNameBubbling(nameOriginal), isEventHover = (nameOriginal in eventsHover), isEventFocus = (nameOriginal in eventsFocus);
if (!name)

@@ -639,6 +637,8 @@ return;

const finalCallback = function (event) {
if (isEventBubblingProxy && (event.___ot ? event.___ot !== nameOriginal : event.type !== nameOriginal || (event.target[`___i${nameOriginal}`] && (delete event.target[`___i${nameOriginal}`], event.stopImmediatePropagation(), true))))
return;
if (event.target[`___i${event.type}`])
return event.stopImmediatePropagation(); // Ignoring native event in favor of the upcoming custom one
if (event.namespace && !hasNamespaces(namespaces, event.namespace.split(eventsNamespacesSeparator)))
return;
if (!selector && ((isEventFocus && (event.target !== ele || event.___ot === name)) || (isEventHover && event.relatedTarget && ele.contains(event.relatedTarget))))
return;
let thisArg = ele;

@@ -657,5 +657,2 @@ if (selector) {

}
else if (isEventFocus && event.___ot === nameOriginal && ele !== event.target && ele.contains(event.target)) {
return;
}
if (event.___cd) {

@@ -686,4 +683,2 @@ Object.defineProperty(event, 'currentTarget', {

addEvent(ele, name, namespaces, selector, finalCallback);
if (isEventBubblingProxy)
addEvent(ele, nameOriginal, namespaces, selector, finalCallback);
});

@@ -724,4 +719,5 @@ });

if (isEventFocus && isFunction(ele[event.___ot])) {
ele[`___i${event.___ot}`] = true; // Ensuring this event gets ignored
ele[`___i${event.type}`] = true; // Ensuring the native event is ignored
ele[event.___ot]();
ele[`___i${event.type}`] = false; // Ensuring the custom event is not ignored
}

@@ -728,0 +724,0 @@ ele.dispatchEvent(event);

@@ -731,4 +731,3 @@ /* MIT https://github.com/fabiospampinato/cash */

namespaces = _a[1],
name = getEventNameBubbling(nameOriginal),
isEventBubblingProxy = nameOriginal !== name;
name = getEventNameBubbling(nameOriginal);

@@ -738,3 +737,2 @@ _this.each(function (i, ele) {

removeEvent(ele, name, namespaces, selector, callback);
if (isEventBubblingProxy) removeEvent(ele, nameOriginal, namespaces, selector, callback);
});

@@ -782,3 +780,3 @@ });

name = getEventNameBubbling(nameOriginal),
isEventBubblingProxy = nameOriginal !== name,
isEventHover = nameOriginal in eventsHover,
isEventFocus = nameOriginal in eventsFocus;

@@ -792,4 +790,6 @@

var finalCallback = function finalCallback(event) {
if (isEventBubblingProxy && (event.___ot ? event.___ot !== nameOriginal : event.type !== nameOriginal || event.target["___i" + nameOriginal] && (delete event.target["___i" + nameOriginal], event.stopImmediatePropagation(), true))) return;
if (event.target["___i" + event.type]) return event.stopImmediatePropagation(); // Ignoring native event in favor of the upcoming custom one
if (event.namespace && !hasNamespaces(namespaces, event.namespace.split(eventsNamespacesSeparator))) return;
if (!selector && (isEventFocus && (event.target !== ele || event.___ot === name) || isEventHover && event.relatedTarget && ele.contains(event.relatedTarget))) return;
var thisArg = ele;

@@ -808,4 +808,2 @@

event.___cd = true; // Delegate
} else if (isEventFocus && event.___ot === nameOriginal && ele !== event.target && ele.contains(event.target)) {
return;
}

@@ -842,3 +840,2 @@

addEvent(ele, name, namespaces, selector, finalCallback);
if (isEventBubblingProxy) addEvent(ele, nameOriginal, namespaces, selector, finalCallback);
});

@@ -891,5 +888,7 @@ });

if (isEventFocus && isFunction(ele[event.___ot])) {
ele["___i" + event.___ot] = true; // Ensuring this event gets ignored
ele["___i" + event.type] = true; // Ensuring the native event is ignored
ele[event.___ot]();
ele["___i" + event.type] = false; // Ensuring the custom event is not ignored
}

@@ -896,0 +895,0 @@

/* MIT https://github.com/fabiospampinato/cash */
(function(){
'use strict';var e={"class":"className",contenteditable:"contentEditable","for":"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};function g(a,b){try{return a(b)}catch(c){return b}}
var m=document,n=window,aa=m.documentElement,p=m.createElement.bind(m),ba=p("div"),r=p("table"),ca=p("tbody"),da=p("tr"),t=Array.isArray,u=Array.prototype,ea=u.concat,v=u.filter,fa=u.indexOf,ha=u.map,ia=u.push,ja=u.slice,w=u.some,ka=u.splice,la=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,ma=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,na=/<.+>/,oa=/^\w+$/;function x(a,b){return a&&(y(b)||B(b))?ma.test(a)?b.getElementsByClassName(a.slice(1)):oa.test(a)?b.getElementsByTagName(a):b.querySelectorAll(a):[]}
var C=function(){function a(a,c){if(a){if(a instanceof C)return a;var b=a;if(D(a)){if(b=(c instanceof C?c[0]:c)||m,b=la.test(a)?b.getElementById(a.slice(1)):na.test(a)?pa(a):x(a,b),!b)return}else if(E(a))return this.ready(a);if(b.nodeType||b===n)b=[b];this.length=b.length;a=0;for(c=this.length;a<c;a++)this[a]=b[a]}}a.prototype.init=function(b,c){return new a(b,c)};return a}(),F=C.prototype,G=F.init;G.fn=G.prototype=F;F.length=0;F.splice=ka;"function"===typeof Symbol&&(F[Symbol.iterator]=u[Symbol.iterator]);
F.map=function(a){return G(ea.apply([],ha.call(this,function(b,c){return a.call(b,c,b)})))};F.slice=function(a,b){return G(ja.call(this,a,b))};var ra=/-([a-z])/g;function H(a){return a.replace(ra,function(a,c){return c.toUpperCase()})}function I(a,b,c){if(c)for(c=a.length;c--&&!1!==b.call(a[c],c,a[c]););else{c=0;for(var d=a.length;c<d&&!1!==b.call(a[c],c,a[c]);c++);}return a}G.each=I;F.each=function(a){return I(this,a)};F.removeProp=function(a){return this.each(function(b,c){delete c[e[a]||a]})};
function J(a){for(var b=1;b<arguments.length;b++);b=arguments.length;if(!b)return{};if(1===b)return J(G,a);for(var c=1;c<b;c++)for(var d in arguments[c])a[d]=arguments[c][d];return a}G.extend=J;F.extend=function(a){return J(F,a)};G.guid=1;function sa(a,b){var c=a&&(a.matches||a.webkitMatchesSelector||a.msMatchesSelector);return!!c&&!!b&&c.call(a,b)}function K(a){return!!a&&a===a.window}function y(a){return!!a&&9===a.nodeType}function B(a){return!!a&&1===a.nodeType}
function E(a){return"function"===typeof a}function D(a){return"string"===typeof a}function ta(a){return!isNaN(parseFloat(a))&&isFinite(a)}G.isWindow=K;G.isFunction=E;G.isNumeric=ta;G.isArray=t;F.prop=function(a,b){if(a){if(D(a))return a=e[a]||a,2>arguments.length?this[0]&&this[0][a]:this.each(function(c,h){h[a]=b});for(var c in a)this.prop(c,a[c]);return this}};F.get=function(a){if(void 0===a)return ja.call(this);a=Number(a);return this[0>a?a+this.length:a]};F.eq=function(a){return G(this.get(a))};
F.first=function(){return this.eq(0)};F.last=function(){return this.eq(-1)};function L(a){return D(a)?function(b,c){return sa(c,a)}:E(a)?a:a instanceof C?function(b,c){return a.is(c)}:a?function(b,c){return c===a}:function(){return!1}}F.filter=function(a){var b=L(a);return G(v.call(this,function(a,d){return b.call(a,d,a)}))};function M(a,b){return b?a.filter(b):a}var ua=/\S+/g;function N(a){return D(a)?a.match(ua)||[]:[]}F.hasClass=function(a){return!!a&&w.call(this,function(b){return B(b)&&b.classList.contains(a)})};
var m=document,n=window,p=m.documentElement,t=m.createElement.bind(m),aa=t("div"),u=t("table"),ba=t("tbody"),ca=t("tr"),v=Array.isArray,w=Array.prototype,da=w.concat,x=w.filter,ea=w.indexOf,fa=w.map,ha=w.push,ia=w.slice,y=w.some,ja=w.splice,ka=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,la=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,ma=/<.+>/,na=/^\w+$/;function z(a,b){return a&&(A(b)||B(b))?la.test(a)?b.getElementsByClassName(a.slice(1)):na.test(a)?b.getElementsByTagName(a):b.querySelectorAll(a):[]}
var C=function(){function a(a,c){if(a){if(a instanceof C)return a;var b=a;if(D(a)){if(b=(c instanceof C?c[0]:c)||m,b=ka.test(a)?b.getElementById(a.slice(1)):ma.test(a)?oa(a):z(a,b),!b)return}else if(E(a))return this.ready(a);if(b.nodeType||b===n)b=[b];this.length=b.length;a=0;for(c=this.length;a<c;a++)this[a]=b[a]}}a.prototype.init=function(b,c){return new a(b,c)};return a}(),F=C.prototype,G=F.init;G.fn=G.prototype=F;F.length=0;F.splice=ja;"function"===typeof Symbol&&(F[Symbol.iterator]=w[Symbol.iterator]);
F.map=function(a){return G(da.apply([],fa.call(this,function(b,c){return a.call(b,c,b)})))};F.slice=function(a,b){return G(ia.call(this,a,b))};var pa=/-([a-z])/g;function H(a){return a.replace(pa,function(a,c){return c.toUpperCase()})}function I(a,b,c){if(c)for(c=a.length;c--&&!1!==b.call(a[c],c,a[c]););else{c=0;for(var d=a.length;c<d&&!1!==b.call(a[c],c,a[c]);c++);}return a}G.each=I;F.each=function(a){return I(this,a)};F.removeProp=function(a){return this.each(function(b,c){delete c[e[a]||a]})};
function J(a){for(var b=1;b<arguments.length;b++);b=arguments.length;if(!b)return{};if(1===b)return J(G,a);for(var c=1;c<b;c++)for(var d in arguments[c])a[d]=arguments[c][d];return a}G.extend=J;F.extend=function(a){return J(F,a)};G.guid=1;function qa(a,b){var c=a&&(a.matches||a.webkitMatchesSelector||a.msMatchesSelector);return!!c&&!!b&&c.call(a,b)}function K(a){return!!a&&a===a.window}function A(a){return!!a&&9===a.nodeType}function B(a){return!!a&&1===a.nodeType}
function E(a){return"function"===typeof a}function D(a){return"string"===typeof a}function ra(a){return!isNaN(parseFloat(a))&&isFinite(a)}G.isWindow=K;G.isFunction=E;G.isNumeric=ra;G.isArray=v;F.prop=function(a,b){if(a){if(D(a))return a=e[a]||a,2>arguments.length?this[0]&&this[0][a]:this.each(function(c,h){h[a]=b});for(var c in a)this.prop(c,a[c]);return this}};F.get=function(a){if(void 0===a)return ia.call(this);a=Number(a);return this[0>a?a+this.length:a]};F.eq=function(a){return G(this.get(a))};
F.first=function(){return this.eq(0)};F.last=function(){return this.eq(-1)};function L(a){return D(a)?function(b,c){return qa(c,a)}:E(a)?a:a instanceof C?function(b,c){return a.is(c)}:a?function(b,c){return c===a}:function(){return!1}}F.filter=function(a){var b=L(a);return G(x.call(this,function(a,d){return b.call(a,d,a)}))};function M(a,b){return b?a.filter(b):a}var sa=/\S+/g;function N(a){return D(a)?a.match(sa)||[]:[]}F.hasClass=function(a){return!!a&&y.call(this,function(b){return B(b)&&b.classList.contains(a)})};
F.removeAttr=function(a){var b=N(a);return this.each(function(a,d){B(d)&&I(b,function(a,b){d.removeAttribute(b)})})};F.attr=function(a,b){if(a){if(D(a)){if(2>arguments.length){if(!this[0]||!B(this[0]))return;var c=this[0].getAttribute(a);return null===c?void 0:c}return void 0===b?this:null===b?this.removeAttr(a):this.each(function(c,h){B(h)&&h.setAttribute(a,b)})}for(c in a)this.attr(c,a[c]);return this}};
F.toggleClass=function(a,b){var c=N(a),d=void 0!==b;return this.each(function(a,f){B(f)&&I(c,function(a,c){d?b?f.classList.add(c):f.classList.remove(c):f.classList.toggle(c)})})};F.addClass=function(a){return this.toggleClass(a,!0)};F.removeClass=function(a){return arguments.length?this.toggleClass(a,!1):this.attr("class","")};
function O(a,b,c,d){for(var h=[],f=E(b),l=d&&L(d),q=0,z=a.length;q<z;q++)if(f){var k=b(a[q]);k.length&&ia.apply(h,k)}else for(k=a[q][b];!(null==k||d&&l(-1,k));)h.push(k),k=c?k[b]:null;return h}function P(a){return 1<a.length?v.call(a,function(a,c,d){return fa.call(d,a)===c}):a}G.unique=P;F.add=function(a,b){return G(P(this.get().concat(G(a,b).get())))};function Q(a,b,c){if(B(a)){var d=n.getComputedStyle(a,null);return c?d.getPropertyValue(b)||void 0:d[b]||a.style[b]}}
function R(a,b){return parseInt(Q(a,b),10)||0}var S=/^--/,T={},va=ba.style,wa=["webkit","moz","ms"];function xa(a,b){void 0===b&&(b=S.test(a));if(b)return a;if(!T[a]){b=H(a);var c=""+b[0].toUpperCase()+b.slice(1);b=(b+" "+wa.join(c+" ")+c).split(" ");I(b,function(b,c){if(c in va)return T[a]=c,!1})}return T[a]}
var ya={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function za(a,b,c){void 0===c&&(c=S.test(a));return c||ya[a]||!ta(b)?b:b+"px"}
F.css=function(a,b){if(D(a)){var c=S.test(a);a=xa(a,c);if(2>arguments.length)return this[0]&&Q(this[0],a,c);if(!a)return this;b=za(a,b,c);return this.each(function(d,f){B(f)&&(c?f.style.setProperty(a,b):f.style[a]=b)})}for(var d in a)this.css(d,a[d]);return this};var Aa=/^\s+|\s+$/;function Ba(a,b){a=a.dataset[b]||a.dataset[H(b)];return Aa.test(a)?a:g(JSON.parse,a)}
F.data=function(a,b){if(!a){if(!this[0])return;var c={},d;for(d in this[0].dataset)c[d]=Ba(this[0],d);return c}if(D(a))return 2>arguments.length?this[0]&&Ba(this[0],a):void 0===b?this:this.each(function(c,d){c=b;c=g(JSON.stringify,c);d.dataset[H(a)]=c});for(d in a)this.data(d,a[d]);return this};function Ca(a,b){var c=a.documentElement;return Math.max(a.body["scroll"+b],c["scroll"+b],a.body["offset"+b],c["offset"+b],c["client"+b])}
function Da(a,b){return R(a,"border"+(b?"Left":"Top")+"Width")+R(a,"padding"+(b?"Left":"Top"))+R(a,"padding"+(b?"Right":"Bottom"))+R(a,"border"+(b?"Right":"Bottom")+"Width")}
I([!0,!1],function(a,b){I(["Width","Height"],function(a,d){F[(b?"outer":"inner")+d]=function(c){if(this[0])return K(this[0])?b?this[0]["inner"+d]:this[0].document.documentElement["client"+d]:y(this[0])?Ca(this[0],d):this[0][(b?"offset":"client")+d]+(c&&b?R(this[0],"margin"+(a?"Top":"Left"))+R(this[0],"margin"+(a?"Bottom":"Right")):0)}})});
I(["Width","Height"],function(a,b){var c=b.toLowerCase();F[c]=function(d){if(!this[0])return void 0===d?void 0:this;if(!arguments.length)return K(this[0])?this[0].document.documentElement["client"+b]:y(this[0])?Ca(this[0],b):this[0].getBoundingClientRect()[c]-Da(this[0],!a);var h=parseInt(d,10);return this.each(function(b,d){B(d)&&(b=Q(d,"boxSizing"),d.style[c]=za(c,h+("border-box"===b?Da(d,!a):0)))})}});var U={};
F.toggle=function(a){return this.each(function(b,c){if(B(c))if(void 0===a?"none"===Q(c,"display"):a){if(c.style.display=c.___cd||"","none"===Q(c,"display")){b=c.style;c=c.tagName;if(U[c])c=U[c];else{var d=p(c);m.body.insertBefore(d,null);var h=Q(d,"display");m.body.removeChild(d);c=U[c]="none"!==h?h:"block"}b.display=c}}else c.___cd=Q(c,"display"),c.style.display="none"})};F.hide=function(){return this.toggle(!1)};F.show=function(){return this.toggle(!0)};
function Ea(a,b){return!b||!w.call(b,function(b){return 0>a.indexOf(b)})}var V={focus:"focusin",blur:"focusout"},W={mouseenter:"mouseover",mouseleave:"mouseout"},Fa=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function Ga(a,b,c,d,h){var f=a.___ce=a.___ce||{};f[b]=f[b]||[];f[b].push([c,d,h]);a.addEventListener(b,h)}function X(a){a=a.split(".");return[a[0],a.slice(1).sort()]}
function Y(a,b,c,d,h){var f=a.___ce=a.___ce||{};if(b)f[b]&&(f[b]=f[b].filter(function(f){var l=f[0],z=f[1];f=f[2];if(h&&f.guid!==h.guid||!Ea(l,c)||d&&d!==z)return!0;a.removeEventListener(b,f)}));else for(b in f)Y(a,b,c,d,h)}
F.off=function(a,b,c){var d=this;if(void 0===a)this.each(function(a,b){(B(b)||y(b)||K(b))&&Y(b)});else if(D(a))E(b)&&(c=b,b=""),I(N(a),function(a,h){a=X(h);var f=a[0],l=a[1],k=W[f]||V[f]||f,Ka=f!==k;d.each(function(a,d){if(B(d)||y(d)||K(d))Y(d,k,l,b,c),Ka&&Y(d,f,l,b,c)})});else for(var h in a)this.off(h,a[h]);return this};
F.on=function(a,b,c,d,h){var f=this;if(!D(a)){for(var l in a)this.on(l,b,c,a[l],h);return this}D(b)||(void 0!==b&&null!==b&&(void 0!==c&&(d=c),c=b),b="");E(d)||(d=c,c=void 0);if(!d)return this;I(N(a),function(a,l){a=X(l);var k=a[0],z=a[1],q=W[k]||V[k]||k,qa=k!==q,La=k in V;q&&f.each(function(a,f){if(B(f)||y(f)||K(f))a=function Ma(a){if(!(qa&&(a.___ot?a.___ot!==k:a.type!==k||a.target["___i"+k]&&(delete a.target["___i"+k],a.stopImmediatePropagation(),!0))||a.namespace&&!Ea(z,a.namespace.split(".")))){var l=
f;if(b){for(var A=a.target;!sa(A,b);){if(A===f)return;A=A.parentNode;if(!A)return}l=A;a.___cd=!0}else if(La&&a.___ot===k&&f!==a.target&&f.contains(a.target))return;a.___cd&&Object.defineProperty(a,"currentTarget",{configurable:!0,get:function(){return l}});Object.defineProperty(a,"data",{configurable:!0,get:function(){return c}});A=d.call(l,a,a.___td);h&&Y(f,q,z,b,Ma);!1===A&&(a.preventDefault(),a.stopPropagation())}},a.guid=d.guid=d.guid||G.guid++,Ga(f,q,z,b,a),qa&&Ga(f,k,z,b,a)})});return this};
F.one=function(a,b,c,d){return this.on(a,b,c,d,!0)};F.ready=function(a){function b(){return setTimeout(a,0,G)}"loading"!==m.readyState?b():m.addEventListener("DOMContentLoaded",b);return this};
F.trigger=function(a,b){if(D(a)){var c=X(a),d=c[0];c=c[1];var h=W[d]||V[d]||d;if(!h)return this;var f=Fa.test(h)?"MouseEvents":"HTMLEvents";a=m.createEvent(f);a.initEvent(h,!0,!0);a.namespace=c.join(".");a.___ot=d}a.___td=b;var l=a.___ot in V;return this.each(function(b,c){l&&E(c[a.___ot])&&(c["___i"+a.___ot]=!0,c[a.___ot]());c.dispatchEvent(a)})};
function Ha(a){return a.multiple&&a.options?O(v.call(a.options,function(a){return a.selected&&!a.disabled&&!a.parentNode.disabled}),"value"):a.value||""}var Ia=/%20/g,Ja=/\r?\n/g,Na=/file|reset|submit|button|image/i,Oa=/radio|checkbox/i;
F.serialize=function(){var a="";this.each(function(b,c){I(c.elements||[c],function(b,c){c.disabled||!c.name||"FIELDSET"===c.tagName||Na.test(c.type)||Oa.test(c.type)&&!c.checked||(b=Ha(c),void 0!==b&&(b=t(b)?b:[b],I(b,function(b,d){b=a;d="&"+encodeURIComponent(c.name)+"="+encodeURIComponent(d.replace(Ja,"\r\n")).replace(Ia,"+");a=b+d})))})});return a.slice(1)};
F.val=function(a){return arguments.length?this.each(function(b,c){if((b=c.multiple&&c.options)||Oa.test(c.type)){var d=t(a)?ha.call(a,String):null===a?[]:[String(a)];b?I(c.options,function(a,b){b.selected=0<=d.indexOf(b.value)},!0):c.checked=0<=d.indexOf(c.value)}else c.value=void 0===a||null===a?"":a}):this[0]&&Ha(this[0])};F.clone=function(){return this.map(function(a,b){return b.cloneNode(!0)})};F.detach=function(a){M(this,a).each(function(a,c){c.parentNode&&c.parentNode.removeChild(c)});return this};
var Pa=/^\s*<(\w+)[^>]*>/,Qa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,Ra={"*":ba,tr:ca,td:da,th:da,thead:r,tbody:r,tfoot:r};function pa(a){if(!D(a))return[];if(Qa.test(a))return[p(RegExp.$1)];var b=Pa.test(a)&&RegExp.$1;b=Ra[b]||Ra["*"];b.innerHTML=a;return G(b.childNodes).detach().get()}G.parseHTML=pa;F.empty=function(){return this.each(function(a,b){for(;b.firstChild;)b.removeChild(b.firstChild)})};
function O(a,b,c,d){for(var h=[],f=E(b),q=d&&L(d),r=0,k=a.length;r<k;r++)if(f){var l=b(a[r]);l.length&&ha.apply(h,l)}else for(l=a[r][b];!(null==l||d&&q(-1,l));)h.push(l),l=c?l[b]:null;return h}function P(a){return 1<a.length?x.call(a,function(a,c,d){return ea.call(d,a)===c}):a}G.unique=P;F.add=function(a,b){return G(P(this.get().concat(G(a,b).get())))};function Q(a,b,c){if(B(a)){var d=n.getComputedStyle(a,null);return c?d.getPropertyValue(b)||void 0:d[b]||a.style[b]}}
function R(a,b){return parseInt(Q(a,b),10)||0}var S=/^--/,T={},ta=aa.style,ua=["webkit","moz","ms"];function va(a,b){void 0===b&&(b=S.test(a));if(b)return a;if(!T[a]){b=H(a);var c=""+b[0].toUpperCase()+b.slice(1);b=(b+" "+ua.join(c+" ")+c).split(" ");I(b,function(b,c){if(c in ta)return T[a]=c,!1})}return T[a]}
var wa={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function xa(a,b,c){void 0===c&&(c=S.test(a));return c||wa[a]||!ra(b)?b:b+"px"}
F.css=function(a,b){if(D(a)){var c=S.test(a);a=va(a,c);if(2>arguments.length)return this[0]&&Q(this[0],a,c);if(!a)return this;b=xa(a,b,c);return this.each(function(d,f){B(f)&&(c?f.style.setProperty(a,b):f.style[a]=b)})}for(var d in a)this.css(d,a[d]);return this};var ya=/^\s+|\s+$/;function za(a,b){a=a.dataset[b]||a.dataset[H(b)];return ya.test(a)?a:g(JSON.parse,a)}
F.data=function(a,b){if(!a){if(!this[0])return;var c={},d;for(d in this[0].dataset)c[d]=za(this[0],d);return c}if(D(a))return 2>arguments.length?this[0]&&za(this[0],a):void 0===b?this:this.each(function(c,d){c=b;c=g(JSON.stringify,c);d.dataset[H(a)]=c});for(d in a)this.data(d,a[d]);return this};function Aa(a,b){var c=a.documentElement;return Math.max(a.body["scroll"+b],c["scroll"+b],a.body["offset"+b],c["offset"+b],c["client"+b])}
function Ba(a,b){return R(a,"border"+(b?"Left":"Top")+"Width")+R(a,"padding"+(b?"Left":"Top"))+R(a,"padding"+(b?"Right":"Bottom"))+R(a,"border"+(b?"Right":"Bottom")+"Width")}
I([!0,!1],function(a,b){I(["Width","Height"],function(a,d){F[(b?"outer":"inner")+d]=function(c){if(this[0])return K(this[0])?b?this[0]["inner"+d]:this[0].document.documentElement["client"+d]:A(this[0])?Aa(this[0],d):this[0][(b?"offset":"client")+d]+(c&&b?R(this[0],"margin"+(a?"Top":"Left"))+R(this[0],"margin"+(a?"Bottom":"Right")):0)}})});
I(["Width","Height"],function(a,b){var c=b.toLowerCase();F[c]=function(d){if(!this[0])return void 0===d?void 0:this;if(!arguments.length)return K(this[0])?this[0].document.documentElement["client"+b]:A(this[0])?Aa(this[0],b):this[0].getBoundingClientRect()[c]-Ba(this[0],!a);var h=parseInt(d,10);return this.each(function(b,d){B(d)&&(b=Q(d,"boxSizing"),d.style[c]=xa(c,h+("border-box"===b?Ba(d,!a):0)))})}});var U={};
F.toggle=function(a){return this.each(function(b,c){if(B(c))if(void 0===a?"none"===Q(c,"display"):a){if(c.style.display=c.___cd||"","none"===Q(c,"display")){b=c.style;c=c.tagName;if(U[c])c=U[c];else{var d=t(c);m.body.insertBefore(d,null);var h=Q(d,"display");m.body.removeChild(d);c=U[c]="none"!==h?h:"block"}b.display=c}}else c.___cd=Q(c,"display"),c.style.display="none"})};F.hide=function(){return this.toggle(!1)};F.show=function(){return this.toggle(!0)};
function Ca(a,b){return!b||!y.call(b,function(b){return 0>a.indexOf(b)})}var V={focus:"focusin",blur:"focusout"},W={mouseenter:"mouseover",mouseleave:"mouseout"},Da=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function Ea(a,b,c,d,h){var f=a.___ce=a.___ce||{};f[b]=f[b]||[];f[b].push([c,d,h]);a.addEventListener(b,h)}function X(a){a=a.split(".");return[a[0],a.slice(1).sort()]}
function Y(a,b,c,d,h){var f=a.___ce=a.___ce||{};if(b)f[b]&&(f[b]=f[b].filter(function(f){var q=f[0],k=f[1];f=f[2];if(h&&f.guid!==h.guid||!Ca(q,c)||d&&d!==k)return!0;a.removeEventListener(b,f)}));else for(b in f)Y(a,b,c,d,h)}
F.off=function(a,b,c){var d=this;if(void 0===a)this.each(function(a,b){(B(b)||A(b)||K(b))&&Y(b)});else if(D(a))E(b)&&(c=b,b=""),I(N(a),function(a,h){a=X(h);h=a[0];var f=a[1],k=W[h]||V[h]||h;d.each(function(a,d){(B(d)||A(d)||K(d))&&Y(d,k,f,b,c)})});else for(var h in a)this.off(h,a[h]);return this};
F.on=function(a,b,c,d,h){var f=this;if(!D(a)){for(var q in a)this.on(q,b,c,a[q],h);return this}D(b)||(void 0!==b&&null!==b&&(void 0!==c&&(d=c),c=b),b="");E(d)||(d=c,c=void 0);if(!d)return this;I(N(a),function(a,k){a=X(k);k=a[0];var q=a[1],r=W[k]||V[k]||k,Ia=k in W,Ja=k in V;r&&f.each(function(a,f){if(B(f)||A(f)||K(f))a=function Ka(a){if(a.target["___i"+a.type])return a.stopImmediatePropagation();if(!a.namespace||Ca(q,a.namespace.split(".")))if(b||!(Ja&&(a.target!==f||a.___ot===r)||Ia&&a.relatedTarget&&
f.contains(a.relatedTarget))){var k=f;if(b){for(var l=a.target;!qa(l,b);){if(l===f)return;l=l.parentNode;if(!l)return}k=l;a.___cd=!0}a.___cd&&Object.defineProperty(a,"currentTarget",{configurable:!0,get:function(){return k}});Object.defineProperty(a,"data",{configurable:!0,get:function(){return c}});l=d.call(k,a,a.___td);h&&Y(f,r,q,b,Ka);!1===l&&(a.preventDefault(),a.stopPropagation())}},a.guid=d.guid=d.guid||G.guid++,Ea(f,r,q,b,a)})});return this};F.one=function(a,b,c,d){return this.on(a,b,c,d,!0)};
F.ready=function(a){function b(){return setTimeout(a,0,G)}"loading"!==m.readyState?b():m.addEventListener("DOMContentLoaded",b);return this};F.trigger=function(a,b){if(D(a)){var c=X(a),d=c[0];c=c[1];var h=W[d]||V[d]||d;if(!h)return this;var f=Da.test(h)?"MouseEvents":"HTMLEvents";a=m.createEvent(f);a.initEvent(h,!0,!0);a.namespace=c.join(".");a.___ot=d}a.___td=b;var q=a.___ot in V;return this.each(function(b,c){q&&E(c[a.___ot])&&(c["___i"+a.type]=!0,c[a.___ot](),c["___i"+a.type]=!1);c.dispatchEvent(a)})};
function Fa(a){return a.multiple&&a.options?O(x.call(a.options,function(a){return a.selected&&!a.disabled&&!a.parentNode.disabled}),"value"):a.value||""}var Ga=/%20/g,Ha=/\r?\n/g,La=/file|reset|submit|button|image/i,Ma=/radio|checkbox/i;
F.serialize=function(){var a="";this.each(function(b,c){I(c.elements||[c],function(b,c){c.disabled||!c.name||"FIELDSET"===c.tagName||La.test(c.type)||Ma.test(c.type)&&!c.checked||(b=Fa(c),void 0!==b&&(b=v(b)?b:[b],I(b,function(b,d){b=a;d="&"+encodeURIComponent(c.name)+"="+encodeURIComponent(d.replace(Ha,"\r\n")).replace(Ga,"+");a=b+d})))})});return a.slice(1)};
F.val=function(a){return arguments.length?this.each(function(b,c){if((b=c.multiple&&c.options)||Ma.test(c.type)){var d=v(a)?fa.call(a,String):null===a?[]:[String(a)];b?I(c.options,function(a,b){b.selected=0<=d.indexOf(b.value)},!0):c.checked=0<=d.indexOf(c.value)}else c.value=void 0===a||null===a?"":a}):this[0]&&Fa(this[0])};F.clone=function(){return this.map(function(a,b){return b.cloneNode(!0)})};F.detach=function(a){M(this,a).each(function(a,c){c.parentNode&&c.parentNode.removeChild(c)});return this};
var Na=/^\s*<(\w+)[^>]*>/,Oa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,Pa={"*":aa,tr:ba,td:ca,th:ca,thead:u,tbody:u,tfoot:u};function oa(a){if(!D(a))return[];if(Oa.test(a))return[t(RegExp.$1)];var b=Na.test(a)&&RegExp.$1;b=Pa[b]||Pa["*"];b.innerHTML=a;return G(b.childNodes).detach().get()}G.parseHTML=oa;F.empty=function(){return this.each(function(a,b){for(;b.firstChild;)b.removeChild(b.firstChild)})};
F.html=function(a){return arguments.length?void 0===a?this:this.each(function(b,c){B(c)&&(c.innerHTML=a)}):this[0]&&this[0].innerHTML};F.remove=function(a){M(this,a).detach().off();return this};F.text=function(a){return void 0===a?this[0]?this[0].textContent:"":this.each(function(b,c){B(c)&&(c.textContent=a)})};F.unwrap=function(){this.parent().each(function(a,b){"BODY"!==b.tagName&&(a=G(b),a.replaceWith(a.children()))});return this};
F.offset=function(){var a=this[0];if(a)return a=a.getBoundingClientRect(),{top:a.top+n.pageYOffset,left:a.left+n.pageXOffset}};F.offsetParent=function(){return this.map(function(a,b){for(a=b.offsetParent;a&&"static"===Q(a,"position");)a=a.offsetParent;return a||aa})};
F.offset=function(){var a=this[0];if(a)return a=a.getBoundingClientRect(),{top:a.top+n.pageYOffset,left:a.left+n.pageXOffset}};F.offsetParent=function(){return this.map(function(a,b){for(a=b.offsetParent;a&&"static"===Q(a,"position");)a=a.offsetParent;return a||p})};
F.position=function(){var a=this[0];if(a){var b="fixed"===Q(a,"position"),c=b?a.getBoundingClientRect():this.offset();if(!b){var d=a.ownerDocument;for(b=a.offsetParent||d.documentElement;(b===d.body||b===d.documentElement)&&"static"===Q(b,"position");)b=b.parentNode;b!==a&&B(b)&&(d=G(b).offset(),c.top-=d.top+R(b,"borderTopWidth"),c.left-=d.left+R(b,"borderLeftWidth"))}return{top:c.top-R(a,"marginTop"),left:c.left-R(a,"marginLeft")}}};
F.children=function(a){return M(G(P(O(this,function(a){return a.children}))),a)};F.contents=function(){return G(P(O(this,function(a){return"IFRAME"===a.tagName?[a.contentDocument]:"TEMPLATE"===a.tagName?a.content.childNodes:a.childNodes})))};F.find=function(a){return G(P(O(this,function(b){return x(a,b)})))};var Sa=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Ta=/^$|^module$|\/(java|ecma)script/i,Ua=["type","src","nonce","noModule"];
function Va(a,b){a=G(a);a.filter("script").add(a.find("script")).each(function(a,d){if(Ta.test(d.type)&&aa.contains(d)){var c=p("script");c.text=d.textContent.replace(Sa,"");I(Ua,function(a,b){d[b]&&(c[b]=d[b])});b.head.insertBefore(c,null);b.head.removeChild(c)}})}
function Z(a,b,c,d,h,f,l,q){I(a,function(a,f){I(G(f),function(a,f){I(G(b),function(b,k){var l=c?k:f;b=c?a:b;k=c?f:k;l=b?l.cloneNode(!0):l;b=!b;h?k.insertBefore(l,d?k.firstChild:null):k.parentNode.insertBefore(l,d?k:k.nextSibling);b&&Va(l,k.ownerDocument)},q)},l)},f);return b}F.after=function(){return Z(arguments,this,!1,!1,!1,!0,!0)};F.append=function(){return Z(arguments,this,!1,!1,!0)};F.appendTo=function(a){return Z(arguments,this,!0,!1,!0)};F.before=function(){return Z(arguments,this,!1,!0)};
F.children=function(a){return M(G(P(O(this,function(a){return a.children}))),a)};F.contents=function(){return G(P(O(this,function(a){return"IFRAME"===a.tagName?[a.contentDocument]:"TEMPLATE"===a.tagName?a.content.childNodes:a.childNodes})))};F.find=function(a){return G(P(O(this,function(b){return z(a,b)})))};var Qa=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Ra=/^$|^module$|\/(java|ecma)script/i,Sa=["type","src","nonce","noModule"];
function Ta(a,b){a=G(a);a.filter("script").add(a.find("script")).each(function(a,d){if(Ra.test(d.type)&&p.contains(d)){var c=t("script");c.text=d.textContent.replace(Qa,"");I(Sa,function(a,b){d[b]&&(c[b]=d[b])});b.head.insertBefore(c,null);b.head.removeChild(c)}})}
function Z(a,b,c,d,h,f,q,r){I(a,function(a,f){I(G(f),function(a,f){I(G(b),function(b,k){var l=c?k:f;b=c?a:b;k=c?f:k;l=b?l.cloneNode(!0):l;b=!b;h?k.insertBefore(l,d?k.firstChild:null):k.parentNode.insertBefore(l,d?k:k.nextSibling);b&&Ta(l,k.ownerDocument)},r)},q)},f);return b}F.after=function(){return Z(arguments,this,!1,!1,!1,!0,!0)};F.append=function(){return Z(arguments,this,!1,!1,!0)};F.appendTo=function(a){return Z(arguments,this,!0,!1,!0)};F.before=function(){return Z(arguments,this,!1,!0)};
F.insertAfter=function(a){return Z(arguments,this,!0,!1,!1,!1,!1,!0)};F.insertBefore=function(a){return Z(arguments,this,!0,!0)};F.prepend=function(){return Z(arguments,this,!1,!0,!0,!0,!0)};F.prependTo=function(a){return Z(arguments,this,!0,!0,!0,!1,!1,!0)};F.replaceWith=function(a){return this.before(a).remove()};F.replaceAll=function(a){G(a).replaceWith(this);return this};F.wrapAll=function(a){a=G(a);for(var b=a[0];b.children.length;)b=b.firstElementChild;this.first().before(a);return this.appendTo(b)};
F.wrap=function(a){return this.each(function(b,c){var d=G(a)[0];G(c).wrapAll(b?d.cloneNode(!0):d)})};F.wrapInner=function(a){return this.each(function(b,c){b=G(c);c=b.contents();c.length?c.wrapAll(a):b.append(a)})};F.has=function(a){var b=D(a)?function(b,d){return x(a,d).length}:function(b,d){return d.contains(a)};return this.filter(b)};F.is=function(a){var b=L(a);return w.call(this,function(a,d){return b.call(a,d,a)})};F.next=function(a,b,c){return M(G(P(O(this,"nextElementSibling",b,c))),a)};
F.nextAll=function(a){return this.next(a,!0)};F.nextUntil=function(a,b){return this.next(b,!0,a)};F.not=function(a){var b=L(a);return this.filter(function(c,d){return(!D(a)||B(d))&&!b.call(d,c,d)})};F.parent=function(a){return M(G(P(O(this,"parentNode"))),a)};F.index=function(a){var b=a?G(a)[0]:this[0];a=a?this:G(b).parent().children();return fa.call(a,b)};F.closest=function(a){var b=this.filter(a);if(b.length)return b;var c=this.parent();return c.length?c.closest(a):b};
F.wrap=function(a){return this.each(function(b,c){var d=G(a)[0];G(c).wrapAll(b?d.cloneNode(!0):d)})};F.wrapInner=function(a){return this.each(function(b,c){b=G(c);c=b.contents();c.length?c.wrapAll(a):b.append(a)})};F.has=function(a){var b=D(a)?function(b,d){return z(a,d).length}:function(b,d){return d.contains(a)};return this.filter(b)};F.is=function(a){var b=L(a);return y.call(this,function(a,d){return b.call(a,d,a)})};F.next=function(a,b,c){return M(G(P(O(this,"nextElementSibling",b,c))),a)};
F.nextAll=function(a){return this.next(a,!0)};F.nextUntil=function(a,b){return this.next(b,!0,a)};F.not=function(a){var b=L(a);return this.filter(function(c,d){return(!D(a)||B(d))&&!b.call(d,c,d)})};F.parent=function(a){return M(G(P(O(this,"parentNode"))),a)};F.index=function(a){var b=a?G(a)[0]:this[0];a=a?this:G(b).parent().children();return ea.call(a,b)};F.closest=function(a){var b=this.filter(a);if(b.length)return b;var c=this.parent();return c.length?c.closest(a):b};
F.parents=function(a,b){return M(G(P(O(this,"parentElement",!0,b))),a)};F.parentsUntil=function(a,b){return this.parents(b,a)};F.prev=function(a,b,c){return M(G(P(O(this,"previousElementSibling",b,c))),a)};F.prevAll=function(a){return this.prev(a,!0)};F.prevUntil=function(a,b){return this.prev(b,!0,a)};F.siblings=function(a){return M(G(P(O(this,function(a){return G(a).parent().children().not(a)}))),a)};"undefined"!==typeof exports?module.exports=G:n.cash=n.$=G;
})();

@@ -38,2 +38,3 @@

data: any,
relatedTarget?: Node | null,
___cd?: boolean, // Delegate

@@ -1435,4 +1436,3 @@ ___ifocus?: boolean, // Ignore focus

const [nameOriginal, namespaces] = parseEventName ( eventFullName ),
name = getEventNameBubbling ( nameOriginal ),
isEventBubblingProxy = ( nameOriginal !== name );
name = getEventNameBubbling ( nameOriginal );

@@ -1445,4 +1445,2 @@ this.each ( ( i, ele ) => {

if ( isEventBubblingProxy ) removeEvent ( ele, nameOriginal, namespaces, selector, callback );
});

@@ -1539,3 +1537,3 @@

name = getEventNameBubbling ( nameOriginal ),
isEventBubblingProxy = ( nameOriginal !== name ),
isEventHover = ( nameOriginal in eventsHover ),
isEventFocus = ( nameOriginal in eventsFocus );

@@ -1551,6 +1549,8 @@

if ( isEventBubblingProxy && ( event.___ot ? event.___ot !== nameOriginal : event.type !== nameOriginal || ( event.target[`___i${nameOriginal}`] && ( delete event.target[`___i${nameOriginal}`], event.stopImmediatePropagation (), true ) ) ) ) return;
if ( event.target[`___i${event.type}`] ) return event.stopImmediatePropagation (); // Ignoring native event in favor of the upcoming custom one
if ( event.namespace && !hasNamespaces ( namespaces, event.namespace.split ( eventsNamespacesSeparator ) ) ) return;
if ( !selector && ( ( isEventFocus && ( event.target !== ele || event.___ot === name ) ) || ( isEventHover && event.relatedTarget && ele.contains ( event.relatedTarget ) ) ) ) return;
let thisArg: EventTarget = ele;

@@ -1576,6 +1576,2 @@

} else if ( isEventFocus && event.___ot === nameOriginal && ele !== event.target && ele.contains ( event.target ) ) {
return;
}

@@ -1622,4 +1618,2 @@

if ( isEventBubblingProxy ) addEvent ( ele, nameOriginal, namespaces, selector, finalCallback );
});

@@ -1731,6 +1725,8 @@

ele[`___i${event.___ot}`] = true; // Ensuring this event gets ignored
ele[`___i${event.type}`] = true; // Ensuring the native event is ignored
ele[event.___ot]();
ele[`___i${event.type}`] = false; // Ensuring the custom event is not ignored
}

@@ -1737,0 +1733,0 @@

{
"name": "cash-dom",
"description": "An absurdly small jQuery alternative for modern browsers.",
"version": "7.0.4",
"version": "8.0.0",
"license": "MIT",

@@ -6,0 +6,0 @@ "browser": "./dist/cash.js",

@@ -34,6 +34,6 @@

Get Cash from [CloudFlare](https://cdnjs.cloudflare.com/ajax/libs/cash/7.0.4/cash.min.js) or [jsDelivr](https://cdn.jsdelivr.net/npm/cash-dom@7.0.4/dist/cash.min.js) and use it like this:
Get Cash from [CloudFlare](https://cdnjs.cloudflare.com/ajax/libs/cash/8.0.0/cash.min.js) or [jsDelivr](https://cdn.jsdelivr.net/npm/cash-dom@8.0.0/dist/cash.min.js) and use it like this:
```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/cash/7.0.4/cash.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/cash/8.0.0/cash.min.js"></script>
<script>

@@ -40,0 +40,0 @@ $(function () {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc