@whitesev/pops 3.3.1 → 3.3.2
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 +12 -3
- 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 +12 -3
- 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 +12 -3
- 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 +12 -3
- 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 +12 -3
- 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 +12 -3
- 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/dist/types/src/Pops.d.ts +1 -0
- package/dist/types/src/utils/PopsUtils.d.ts +8 -0
- package/package.json +2 -1
- package/src/handler/PopsHandler.ts +2 -2
- package/src/utils/PopsUtils.ts +10 -0
package/dist/types/src/Pops.d.ts
CHANGED
|
@@ -100,6 +100,7 @@ declare class Pops {
|
|
|
100
100
|
formatTime(text?: string | number | Date, formatType?: "yyyy-MM-dd HH:mm:ss" | "yyyy/MM/dd HH:mm:ss" | "yyyy_MM_dd_HH_mm_ss" | "yyyy\u5E74MM\u6708dd\u65E5 HH\u65F6mm\u5206ss\u79D2" | "yyyy\u5E74MM\u6708dd\u65E5 hh:mm:ss" | "yyyy\u5E74MM\u6708dd\u65E5 HH:mm:ss" | "yyyy-MM-dd" | "yyyyMMdd" | "HH:mm:ss"): string;
|
|
101
101
|
formatByteToSize<T extends boolean>(byteSize: number | string, addType?: T | undefined): T extends true ? string : number;
|
|
102
102
|
AnyTouch: () => typeof import("any-touch").default;
|
|
103
|
+
AnyTouchDoubleTapPlugin: () => typeof import("@any-touch/doubletap").default;
|
|
103
104
|
isPhone(userAgent?: string): boolean;
|
|
104
105
|
setTimeout(callback: (...args: any[]) => any, timeout?: number): number;
|
|
105
106
|
clearTimeout(timeId: number | undefined): void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import AnyTouch from "any-touch";
|
|
2
|
+
import doubletap from "@any-touch/doubletap";
|
|
2
3
|
declare class PopsUtils {
|
|
3
4
|
/**
|
|
4
5
|
* 判断是否是window,例如window、self、globalThis
|
|
@@ -112,7 +113,14 @@ declare class PopsUtils {
|
|
|
112
113
|
* > 793.27
|
|
113
114
|
**/
|
|
114
115
|
formatByteToSize<T extends boolean>(byteSize: number | string, addType?: T): T extends true ? string : number;
|
|
116
|
+
/**
|
|
117
|
+
* https://github.com/any86/any-touch/blob/master/README.CN.md
|
|
118
|
+
*/
|
|
115
119
|
AnyTouch: () => typeof AnyTouch;
|
|
120
|
+
/**
|
|
121
|
+
* `any-touch`的`doubletap`事件插件
|
|
122
|
+
*/
|
|
123
|
+
AnyTouchDoubleTapPlugin: () => typeof doubletap;
|
|
116
124
|
/**
|
|
117
125
|
* 通过navigator.userAgent判断是否是手机访问
|
|
118
126
|
* @param userAgent
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@whitesev/pops",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.2",
|
|
4
4
|
"description": "弹窗库,包含了alert、confirm、prompt、drawer、folder、loading、iframe、panel、tooltip、searchSuggestion、rightClickMenu组件",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ScriptCat",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"registry": "https://registry.npmjs.org/"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
+
"@any-touch/doubletap": "^2.2.0",
|
|
43
44
|
"any-touch": "^2.2.0"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
@@ -171,14 +171,14 @@ export const PopsHandler = {
|
|
|
171
171
|
);
|
|
172
172
|
}
|
|
173
173
|
// 判断按下的元素是否是pops-anim
|
|
174
|
-
popsDOMUtils.on(config.animElement,
|
|
174
|
+
popsDOMUtils.on(config.animElement, "pointerup", (event) => {
|
|
175
175
|
const $click = event.composedPath()[0] as HTMLElement;
|
|
176
176
|
isMaskClick = isAnimElement($click);
|
|
177
177
|
});
|
|
178
178
|
// 如果有动画层,在动画层上监听点击事件
|
|
179
179
|
popsDOMUtils.on<MouseEvent | PointerEvent>(config.animElement, "click", (event) => {
|
|
180
180
|
const $click = event.composedPath()[0] as HTMLElement;
|
|
181
|
-
if (isAnimElement($click)
|
|
181
|
+
if (isMaskClick && isAnimElement($click)) {
|
|
182
182
|
return clickEvent(event);
|
|
183
183
|
}
|
|
184
184
|
});
|
package/src/utils/PopsUtils.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import AnyTouch from "any-touch";
|
|
2
|
+
import doubletap from "@any-touch/doubletap";
|
|
2
3
|
import { PopsCore } from "../PopsCore";
|
|
3
4
|
import type { PopsUtilsOwnObject } from "../types/main";
|
|
4
5
|
|
|
@@ -336,9 +337,18 @@ class PopsUtils {
|
|
|
336
337
|
result = addType ? result + resultType.toString() : (parseFloat(result.toString()) as any);
|
|
337
338
|
return result;
|
|
338
339
|
}
|
|
340
|
+
/**
|
|
341
|
+
* https://github.com/any86/any-touch/blob/master/README.CN.md
|
|
342
|
+
*/
|
|
339
343
|
AnyTouch = () => {
|
|
340
344
|
return AnyTouch;
|
|
341
345
|
};
|
|
346
|
+
/**
|
|
347
|
+
* `any-touch`的`doubletap`事件插件
|
|
348
|
+
*/
|
|
349
|
+
AnyTouchDoubleTapPlugin = () => {
|
|
350
|
+
return doubletap;
|
|
351
|
+
};
|
|
342
352
|
/**
|
|
343
353
|
* 通过navigator.userAgent判断是否是手机访问
|
|
344
354
|
* @param userAgent
|