@whitesev/domutils 1.8.2 → 1.8.4
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/dist/index.amd.js +13 -11
- package/dist/index.amd.js.map +1 -1
- package/dist/index.amd.min.js +1 -1
- package/dist/index.amd.min.js.map +1 -1
- package/dist/index.cjs.js +13 -11
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.cjs.min.js.map +1 -1
- package/dist/index.esm.js +13 -11
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.iife.js +13 -11
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +1 -1
- package/dist/index.iife.min.js.map +1 -1
- package/dist/index.system.js +13 -11
- package/dist/index.system.js.map +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/dist/index.umd.js +13 -11
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/CommonUtils.ts +4 -4
- package/src/ElementEvent.ts +2 -0
package/dist/index.amd.js
CHANGED
|
@@ -292,9 +292,9 @@ define((function () { 'use strict';
|
|
|
292
292
|
const worker = `(()=>{var e={455(e,t){!function(e){"use strict";var t=function(e){return function(t){var r=e(t);return t.add(r),r}},r=function(e){return function(t,r){return e.set(t,r),r}},n=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,o=536870912,s=2*o,a=function(e,t){return function(r){var a=t.get(r),i=void 0===a?r.size:a<s?a+1:0;if(!r.has(i))return e(r,i);if(r.size<o){for(;r.has(i);)i=Math.floor(Math.random()*s);return e(r,i)}if(r.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;r.has(i);)i=Math.floor(Math.random()*n);return e(r,i)}},i=new WeakMap,u=r(i),c=a(u,i),l=t(c);e.addUniqueNumber=l,e.generateUniqueNumber=c}(t)}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,r),s.exports}(()=>{"use strict";const e=-32603,t=-32602,n=-32601,o=(e,t)=>Object.assign(new Error(e),{status:t}),s=t=>o('The handler of the method called "'.concat(t,'" returned an unexpected result.'),e),a=(t,r)=>async({data:{id:a,method:i,params:u}})=>{const c=r[i];try{if(void 0===c)throw(e=>o('The requested method called "'.concat(e,'" is not supported.'),n))(i);const r=void 0===u?c():c(u);if(void 0===r)throw(t=>o('The handler of the method called "'.concat(t,'" returned no required result.'),e))(i);const l=r instanceof Promise?await r:r;if(null===a){if(void 0!==l.result)throw s(i)}else{if(void 0===l.result)throw s(i);const{result:e,transferables:r=[]}=l;t.postMessage({id:a,result:e},r)}}catch(e){const{message:r,status:n=-32603}=e;t.postMessage({error:{code:n,message:r},id:a})}};var i=r(455);const u=new Map,c=(e,r,n)=>({...r,connect:({port:t})=>{t.start();const n=e(t,r),o=(0,i.generateUniqueNumber)(u);return u.set(o,()=>{n(),t.close(),u.delete(o)}),{result:o}},disconnect:({portId:e})=>{const r=u.get(e);if(void 0===r)throw(e=>o('The specified parameter called "portId" with the given value "'.concat(e,'" does not identify a port connected to this worker.'),t))(e);return r(),{result:null}},isSupported:async()=>{if(await new Promise(e=>{const t=new ArrayBuffer(0),{port1:r,port2:n}=new MessageChannel;r.onmessage=({data:t})=>e(null!==t),n.postMessage(t,[t])})){const e=n();return{result:e instanceof Promise?await e:e}}return{result:!1}}}),l=(e,t,r=()=>!0)=>{const n=c(l,t,r),o=a(e,n);return e.addEventListener("message",o),()=>e.removeEventListener("message",o)},d=(e,t)=>r=>{const n=t.get(r);if(void 0===n)return Promise.resolve(!1);const[o,s]=n;return e(o),t.delete(r),s(!1),Promise.resolve(!0)},m=(e,t,r,n)=>(o,s,a)=>{const i=o+s-t.timeOrigin,u=i-t.now();return new Promise(t=>{e.set(a,[r(n,u,i,e,t,a),t])})},f=new Map,h=d(globalThis.clearTimeout,f),p=new Map,v=d(globalThis.clearTimeout,p),w=((e,t)=>{const r=(n,o,s,a)=>{const i=n-e.now();i>0?o.set(a,[t(r,i,n,o,s,a),s]):(o.delete(a),s(!0))};return r})(performance,globalThis.setTimeout),g=m(f,performance,globalThis.setTimeout,w),T=m(p,performance,globalThis.setTimeout,w);l(self,{clear:async({timerId:e,timerType:t})=>({result:await("interval"===t?h(e):v(e))}),set:async({delay:e,now:t,timerId:r,timerType:n})=>({result:await("interval"===n?g:T)(e,t,r)})})})()})();`; // tslint:disable-line:max-line-length
|
|
293
293
|
|
|
294
294
|
const loadOrReturnBroker = createLoadOrReturnBroker(load, worker);
|
|
295
|
-
const clearInterval
|
|
296
|
-
const clearTimeout
|
|
297
|
-
const setInterval
|
|
295
|
+
const clearInterval = (timerId) => loadOrReturnBroker().clearInterval(timerId);
|
|
296
|
+
const clearTimeout = (timerId) => loadOrReturnBroker().clearTimeout(timerId);
|
|
297
|
+
const setInterval = (...args) => loadOrReturnBroker().setInterval(...args);
|
|
298
298
|
const setTimeout$1 = (...args) => loadOrReturnBroker().setTimeout(...args);
|
|
299
299
|
|
|
300
300
|
/** 通用工具类 */
|
|
@@ -303,10 +303,10 @@ define((function () { 'use strict';
|
|
|
303
303
|
document: document,
|
|
304
304
|
window: window,
|
|
305
305
|
top: top,
|
|
306
|
-
setTimeout: setTimeout,
|
|
307
|
-
clearTimeout: clearTimeout,
|
|
308
|
-
setInterval: setInterval,
|
|
309
|
-
clearInterval: clearInterval,
|
|
306
|
+
setTimeout: globalThis.setTimeout.bind(globalThis),
|
|
307
|
+
clearTimeout: globalThis.clearTimeout.bind(globalThis),
|
|
308
|
+
setInterval: globalThis.setInterval.bind(globalThis),
|
|
309
|
+
clearInterval: globalThis.clearInterval.bind(globalThis),
|
|
310
310
|
}),
|
|
311
311
|
/**
|
|
312
312
|
* 判断元素是否已显示或已连接
|
|
@@ -463,7 +463,7 @@ define((function () { 'use strict';
|
|
|
463
463
|
clearTimeout(timeId) {
|
|
464
464
|
try {
|
|
465
465
|
if (timeId != null) {
|
|
466
|
-
clearTimeout
|
|
466
|
+
clearTimeout(timeId);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
469
|
catch {
|
|
@@ -478,7 +478,7 @@ define((function () { 'use strict';
|
|
|
478
478
|
*/
|
|
479
479
|
setInterval(callback, timeout = 0) {
|
|
480
480
|
try {
|
|
481
|
-
return setInterval
|
|
481
|
+
return setInterval(callback, timeout);
|
|
482
482
|
}
|
|
483
483
|
catch {
|
|
484
484
|
return this.windowApi.setInterval(callback, timeout);
|
|
@@ -490,7 +490,7 @@ define((function () { 'use strict';
|
|
|
490
490
|
clearInterval(timeId) {
|
|
491
491
|
try {
|
|
492
492
|
if (timeId != null) {
|
|
493
|
-
clearInterval
|
|
493
|
+
clearInterval(timeId);
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
496
|
catch {
|
|
@@ -517,7 +517,7 @@ define((function () { 'use strict';
|
|
|
517
517
|
},
|
|
518
518
|
};
|
|
519
519
|
|
|
520
|
-
const version = "1.8.
|
|
520
|
+
const version = "1.8.3";
|
|
521
521
|
|
|
522
522
|
class ElementSelector {
|
|
523
523
|
windowApi;
|
|
@@ -2621,11 +2621,13 @@ define((function () { 'use strict';
|
|
|
2621
2621
|
await handler(evt, option);
|
|
2622
2622
|
};
|
|
2623
2623
|
const dblClickListener = this.on($el, "dblclick", (evt) => {
|
|
2624
|
+
this.preventEvent(evt);
|
|
2624
2625
|
dblclick_handler(evt, {
|
|
2625
2626
|
isDoubleClick: true,
|
|
2626
2627
|
});
|
|
2627
2628
|
}, options);
|
|
2628
2629
|
const touchEndListener = this.on($el, "pointerup", selector, (evt, selectorTarget) => {
|
|
2630
|
+
this.preventEvent(evt);
|
|
2629
2631
|
if (evt.pointerType === "touch") {
|
|
2630
2632
|
isMobileTouch = true;
|
|
2631
2633
|
}
|