Comparing version 4.0.3 to 4.1.0
@@ -327,6 +327,10 @@ function _mergeNamespaces(n, m) { | ||
var bind$1 = window.addEventListener ? 'addEventListener' : 'attachEvent', | ||
unbind$1 = window.removeEventListener ? 'removeEventListener' : 'detachEvent', | ||
prefix = bind$1 !== 'addEventListener' ? 'on' : ''; | ||
var bind$1, unbind$1, prefix; | ||
function detect () { | ||
bind$1 = window.addEventListener ? 'addEventListener' : 'attachEvent'; | ||
unbind$1 = window.removeEventListener ? 'removeEventListener' : 'detachEvent'; | ||
prefix = bind$1 !== 'addEventListener' ? 'on' : ''; | ||
} | ||
/** | ||
@@ -344,2 +348,3 @@ * Bind `el` event `type` to `fn`. | ||
var bind_1 = componentEvent.bind = function(el, type, fn, capture){ | ||
if (!bind$1) detect(); | ||
el[bind$1](prefix + type, fn, capture || false); | ||
@@ -361,2 +366,3 @@ return fn; | ||
var unbind_1 = componentEvent.unbind = function(el, type, fn, capture){ | ||
if (!unbind$1) detect(); | ||
el[unbind$1](prefix + type, fn, capture || false); | ||
@@ -363,0 +369,0 @@ return fn; |
@@ -331,6 +331,10 @@ 'use strict'; | ||
var bind$1 = window.addEventListener ? 'addEventListener' : 'attachEvent', | ||
unbind$1 = window.removeEventListener ? 'removeEventListener' : 'detachEvent', | ||
prefix = bind$1 !== 'addEventListener' ? 'on' : ''; | ||
var bind$1, unbind$1, prefix; | ||
function detect () { | ||
bind$1 = window.addEventListener ? 'addEventListener' : 'attachEvent'; | ||
unbind$1 = window.removeEventListener ? 'removeEventListener' : 'detachEvent'; | ||
prefix = bind$1 !== 'addEventListener' ? 'on' : ''; | ||
} | ||
/** | ||
@@ -348,2 +352,3 @@ * Bind `el` event `type` to `fn`. | ||
var bind_1 = componentEvent.bind = function(el, type, fn, capture){ | ||
if (!bind$1) detect(); | ||
el[bind$1](prefix + type, fn, capture || false); | ||
@@ -365,2 +370,3 @@ return fn; | ||
var unbind_1 = componentEvent.unbind = function(el, type, fn, capture){ | ||
if (!unbind$1) detect(); | ||
el[unbind$1](prefix + type, fn, capture || false); | ||
@@ -367,0 +373,0 @@ return fn; |
@@ -333,6 +333,10 @@ (function (global, factory) { | ||
var bind$1 = window.addEventListener ? 'addEventListener' : 'attachEvent', | ||
unbind$1 = window.removeEventListener ? 'removeEventListener' : 'detachEvent', | ||
prefix = bind$1 !== 'addEventListener' ? 'on' : ''; | ||
var bind$1, unbind$1, prefix; | ||
function detect () { | ||
bind$1 = window.addEventListener ? 'addEventListener' : 'attachEvent'; | ||
unbind$1 = window.removeEventListener ? 'removeEventListener' : 'detachEvent'; | ||
prefix = bind$1 !== 'addEventListener' ? 'on' : ''; | ||
} | ||
/** | ||
@@ -350,2 +354,3 @@ * Bind `el` event `type` to `fn`. | ||
var bind_1 = componentEvent.bind = function(el, type, fn, capture){ | ||
if (!bind$1) detect(); | ||
el[bind$1](prefix + type, fn, capture || false); | ||
@@ -367,2 +372,3 @@ return fn; | ||
var unbind_1 = componentEvent.unbind = function(el, type, fn, capture){ | ||
if (!unbind$1) detect(); | ||
el[unbind$1](prefix + type, fn, capture || false); | ||
@@ -369,0 +375,0 @@ return fn; |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).MinDom={})}(this,(function(e){"use strict";function t(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}const n=Object.prototype.toString,r=Object.prototype.hasOwnProperty;function o(e,t){return r.call(e,t)}function i(e,t){let r,i;if(void 0===e)return;const c=function(e){return"[object Array]"===n.call(e)}(e)?u:l;for(let n in e)if(o(e,n)&&(r=e[n],i=t(r,c(n)),!1===i))return r}function l(e){return e}function u(e){return Number(e)}const c=Object.prototype.toString;function d(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function a(e,t){return e&&"function"==typeof e.matches&&e.matches(t)}function s(e,t,n){for(var r=n?e:e.parentNode;r&&r.nodeType!==document.DOCUMENT_NODE&&r.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(a(r,t))return r;r=r.parentNode}return a(r,t)?r:null}d.prototype.add=function(e){return this.list.add(e),this},d.prototype.remove=function(e){return"[object RegExp]"==c.call(e)?this.removeMatching(e):(this.list.remove(e),this)},d.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},d.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},d.prototype.array=function(){return Array.from(this.list)},d.prototype.has=d.prototype.contains=function(e){return this.list.contains(e)};var f={},p=window.addEventListener?"addEventListener":"attachEvent",h=window.removeEventListener?"removeEventListener":"detachEvent",y="addEventListener"!==p?"on":"",g=t({__proto__:null,bind:f.bind=function(e,t,n,r){return e[p](y+t,n,r||!1),n},unbind:f.unbind=function(e,t,n,r){return e[h](y+t,n,r||!1),n},default:f},[f]),b=["focus","blur"];var v,m={bind:function(e,t,n,r,o){return-1!==b.indexOf(n)&&(o=!0),g.bind(e,n,(function(n){var o=n.target||n.srcElement;n.delegateTarget=s(o,t,!0),n.delegateTarget&&r.call(e,n)}),o)},unbind:function(e,t,n,r){return-1!==b.indexOf(t)&&(r=!0),g.unbind(e,t,n,r)}},E=function(e,t){if("string"!=typeof e)throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var r=n[1];if("body"==r){return(o=t.createElement("html")).innerHTML=e,o.removeChild(o.lastChild)}var o,i=Object.prototype.hasOwnProperty.call(w,r)?w[r]:w._default,l=i[0],u=i[1],c=i[2];(o=t.createElement("div")).innerHTML=u+e+c;for(;l--;)o=o.lastChild;if(o.firstChild==o.lastChild)return o.removeChild(o.firstChild);var d=t.createDocumentFragment();for(;o.firstChild;)d.appendChild(o.removeChild(o.firstChild));return d},O=!1;"undefined"!=typeof document&&((v=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',O=!v.getElementsByTagName("link").length,v=void 0);var w={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:O?[1,"X<div>","</div>"]:[0,"",""]};w.td=w.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],w.option=w.optgroup=[1,'<select multiple="multiple">',"</select>"],w.thead=w.tbody=w.colgroup=w.caption=w.tfoot=[1,"<table>","</table>"],w.polyline=w.ellipse=w.polygon=w.circle=w.text=w.line=w.path=w.rect=w.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var T=E;e.assignStyle=function(e,...t){const n=e.style;return i(t,(function(e){e&&i(e,(function(e,t){n[t]=e}))})),e},e.attr=function(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)},e.classes=function(e){return new d(e)},e.clear=function(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e},e.closest=s,e.delegate=m,e.domify=T,e.event=g,e.matches=a,e.query=function(e,t){return(t=t||document).querySelector(e)},e.queryAll=function(e,t){return(t=t||document).querySelectorAll(e)},e.remove=function(e){e.parentNode&&e.parentNode.removeChild(e)},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).MinDom={})}(this,(function(e){"use strict";function t(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}const n=Object.prototype.toString,r=Object.prototype.hasOwnProperty;function o(e,t){return r.call(e,t)}function i(e,t){let r,i;if(void 0===e)return;const c=function(e){return"[object Array]"===n.call(e)}(e)?u:l;for(let n in e)if(o(e,n)&&(r=e[n],i=t(r,c(n)),!1===i))return r}function l(e){return e}function u(e){return Number(e)}const c=Object.prototype.toString;function a(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function d(e,t){return e&&"function"==typeof e.matches&&e.matches(t)}function s(e,t,n){for(var r=n?e:e.parentNode;r&&r.nodeType!==document.DOCUMENT_NODE&&r.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(d(r,t))return r;r=r.parentNode}return d(r,t)?r:null}a.prototype.add=function(e){return this.list.add(e),this},a.prototype.remove=function(e){return"[object RegExp]"==c.call(e)?this.removeMatching(e):(this.list.remove(e),this)},a.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},a.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},a.prototype.array=function(){return Array.from(this.list)},a.prototype.has=a.prototype.contains=function(e){return this.list.contains(e)};var f,p,h,y={};function g(){f=window.addEventListener?"addEventListener":"attachEvent",p=window.removeEventListener?"removeEventListener":"detachEvent",h="addEventListener"!==f?"on":""}var b=t({__proto__:null,bind:y.bind=function(e,t,n,r){return f||g(),e[f](h+t,n,r||!1),n},unbind:y.unbind=function(e,t,n,r){return p||g(),e[p](h+t,n,r||!1),n},default:y},[y]),v=["focus","blur"];var m,E={bind:function(e,t,n,r,o){return-1!==v.indexOf(n)&&(o=!0),b.bind(e,n,(function(n){var o=n.target||n.srcElement;n.delegateTarget=s(o,t,!0),n.delegateTarget&&r.call(e,n)}),o)},unbind:function(e,t,n,r){return-1!==v.indexOf(t)&&(r=!0),b.unbind(e,t,n,r)}},O=function(e,t){if("string"!=typeof e)throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var r=n[1];if("body"==r){return(o=t.createElement("html")).innerHTML=e,o.removeChild(o.lastChild)}var o,i=Object.prototype.hasOwnProperty.call(T,r)?T[r]:T._default,l=i[0],u=i[1],c=i[2];(o=t.createElement("div")).innerHTML=u+e+c;for(;l--;)o=o.lastChild;if(o.firstChild==o.lastChild)return o.removeChild(o.firstChild);var a=t.createDocumentFragment();for(;o.firstChild;)a.appendChild(o.removeChild(o.firstChild));return a},w=!1;"undefined"!=typeof document&&((m=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',w=!m.getElementsByTagName("link").length,m=void 0);var T={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:w?[1,"X<div>","</div>"]:[0,"",""]};T.td=T.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],T.option=T.optgroup=[1,'<select multiple="multiple">',"</select>"],T.thead=T.tbody=T.colgroup=T.caption=T.tfoot=[1,"<table>","</table>"],T.polyline=T.ellipse=T.polygon=T.circle=T.text=T.line=T.path=T.rect=T.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var C=O;e.assignStyle=function(e,...t){const n=e.style;return i(t,(function(e){e&&i(e,(function(e,t){n[t]=e}))})),e},e.attr=function(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)},e.classes=function(e){return new a(e)},e.clear=function(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e},e.closest=s,e.delegate=E,e.domify=C,e.event=b,e.matches=d,e.query=function(e,t){return(t=t||document).querySelector(e)},e.queryAll=function(e,t){return(t=t||document).querySelectorAll(e)},e.remove=function(e){e.parentNode&&e.parentNode.removeChild(e)},Object.defineProperty(e,"__esModule",{value:!0})})); |
{ | ||
"name": "min-dom", | ||
"version": "4.0.3", | ||
"version": "4.1.0", | ||
"description": "A minimal dom utility toolbelt", | ||
@@ -36,3 +36,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"component-event": "^0.1.4", | ||
"component-event": "^0.2.1", | ||
"domify": "^1.4.1", | ||
@@ -39,0 +39,0 @@ "min-dash": "^4.0.0" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
118939
1499
+ Addedcomponent-event@0.2.1(transitive)
- Removedcomponent-event@0.1.4(transitive)
Updatedcomponent-event@^0.2.1