minutool 1.0.26 → 1.0.27
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.d.ts +2 -2
- package/dist/minutool.js +8 -8
- package/dist/minutool.js.map +1 -1
- package/dist/minutool.umd.cjs +1 -1
- package/dist/minutool.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -151,7 +151,7 @@ export declare const bindClick: (element: EventTarget | string, payload: (event:
|
|
|
151
151
|
* @param payload - 事件回调函数
|
|
152
152
|
* @returns 解绑函数
|
|
153
153
|
*/
|
|
154
|
-
export declare const bindDomEvent: <E extends Event = Event>(element: EventTarget | string, eventName: string, payload: (event: E) => void) => () => void;
|
|
154
|
+
export declare const bindDomEvent: <E extends Event = Event>(element: EventTarget | string, eventName: string, payload: (event: E) => void, options?: boolean | AddEventListenerOptions) => () => void;
|
|
155
155
|
|
|
156
156
|
/**
|
|
157
157
|
* 绑定双击事件,并返回一个解绑函数
|
|
@@ -165,7 +165,7 @@ export declare const bindDoubleClick: (element: EventTarget | string, payload: (
|
|
|
165
165
|
* 为 input/textarea 绑定支持 IME 的防抖函数
|
|
166
166
|
* @param element - DOM 元素
|
|
167
167
|
* @param callback - 回调,参数为 { value, event }
|
|
168
|
-
* @param delay - 防抖延迟(ms),默认
|
|
168
|
+
* @param delay - 防抖延迟(ms),默认 50
|
|
169
169
|
* @returns { destroy, cancel, flush }
|
|
170
170
|
*/
|
|
171
171
|
export declare const bindInputDebounce: (element: HTMLInputElement | HTMLTextAreaElement, callback: (value: string, event: InputEvent) => void, delay?: number) => (() => void);
|
package/dist/minutool.js
CHANGED
|
@@ -326,16 +326,16 @@ const ln = (e, t) => {
|
|
|
326
326
|
var s;
|
|
327
327
|
const c = i.target, a = (s = c == null ? void 0 : c.closest) == null ? void 0 : s.call(c, t);
|
|
328
328
|
a && o(i, a);
|
|
329
|
-
}), mn = (e, t) => M(e, "click", t), dn = (e, t) => M(e, "keyup", t), gn = (e, t) => M(e, "keydown", t), hn = (e, t) => M(e, "dblclick", t), M = (e, t, n) => {
|
|
330
|
-
const
|
|
331
|
-
n(
|
|
332
|
-
},
|
|
333
|
-
if (!
|
|
329
|
+
}), mn = (e, t) => M(e, "click", t), dn = (e, t) => M(e, "keyup", t), gn = (e, t) => M(e, "keydown", t), hn = (e, t) => M(e, "dblclick", t), M = (e, t, n, o) => {
|
|
330
|
+
const r = (c) => {
|
|
331
|
+
n(c);
|
|
332
|
+
}, i = typeof e == "string" ? T(e) : e;
|
|
333
|
+
if (!i)
|
|
334
334
|
throw new Error(`EventTarget not found for selector: ${e}`);
|
|
335
|
-
return
|
|
336
|
-
|
|
335
|
+
return i.addEventListener(t, r, o), () => {
|
|
336
|
+
i.removeEventListener(t, r, o);
|
|
337
337
|
};
|
|
338
|
-
}, xn = (e, t, n =
|
|
338
|
+
}, xn = (e, t, n = 50) => {
|
|
339
339
|
let o = !1, r = null, i = null, c = null;
|
|
340
340
|
const a = (x) => {
|
|
341
341
|
let h = x.target.value;
|