@whitesev/pops 2.0.10 → 2.0.11
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 +1632 -1570
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +1632 -1570
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1632 -1570
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +1632 -1570
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +1632 -1570
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +1632 -1570
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/Pops.d.ts +50 -30
- package/dist/types/src/PopsAnimation.d.ts +14 -0
- package/dist/types/src/PopsCSS.d.ts +34 -0
- package/dist/types/src/PopsIcon.d.ts +25 -0
- package/dist/types/src/PopsLayer.d.ts +3 -0
- package/dist/types/src/components/panel/buttonType.d.ts +2 -2
- package/dist/types/src/components/rightClickMenu/index.d.ts +1 -2
- package/dist/types/src/components/rightClickMenu/indexType.d.ts +2 -2
- package/dist/types/src/types/button.d.ts +3 -3
- package/dist/types/src/types/icon.d.ts +1 -1
- package/dist/types/src/utils/PopsDOMUtils.d.ts +12 -0
- package/dist/types/src/utils/PopsInstanceUtils.d.ts +0 -6
- package/dist/types/src/utils/PopsUtils.d.ts +5 -6
- package/package.json +1 -1
- package/src/Pops.ts +12 -152
- package/src/PopsAnimation.ts +32 -0
- package/src/PopsCSS.ts +51 -0
- package/src/PopsIcon.ts +93 -0
- package/src/PopsLayer.ts +17 -0
- package/src/components/alert/index.ts +8 -8
- package/src/components/confirm/index.ts +8 -8
- package/src/components/drawer/index.ts +8 -8
- package/src/components/folder/index.ts +15 -15
- package/src/components/iframe/index.ts +9 -12
- package/src/components/loading/index.ts +5 -5
- package/src/components/panel/PanelHandleContentDetails.ts +28 -25
- package/src/components/panel/buttonType.ts +2 -2
- package/src/components/panel/config.ts +4 -0
- package/src/components/panel/index.css +33 -0
- package/src/components/panel/index.ts +9 -9
- package/src/components/prompt/index.ts +8 -8
- package/src/components/rightClickMenu/config.ts +7 -7
- package/src/components/rightClickMenu/index.ts +9 -10
- package/src/components/rightClickMenu/indexType.ts +2 -2
- package/src/components/searchSuggestion/index.ts +5 -5
- package/src/components/tooltip/index.ts +5 -5
- package/src/handler/PopsElementHandler.ts +17 -17
- package/src/handler/PopsHandler.ts +22 -19
- package/src/types/button.d.ts +3 -3
- package/src/types/icon.d.ts +1 -1
- package/src/utils/PopsDOMUtils.ts +34 -1
- package/src/utils/PopsInstanceUtils.ts +13 -31
- package/src/utils/PopsUtils.ts +7 -16
package/src/utils/PopsUtils.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PopsCore } from "../Core";
|
|
2
2
|
import type { PopsUtilsOwnObject } from "../types/main";
|
|
3
|
-
import { popsDOMUtils } from "./PopsDOMUtils";
|
|
4
3
|
import {
|
|
5
4
|
clearInterval as WorkerClearInterval,
|
|
6
5
|
clearTimeout as WorkerClearTimeout,
|
|
@@ -182,21 +181,6 @@ class PopsUtils {
|
|
|
182
181
|
);
|
|
183
182
|
}
|
|
184
183
|
}
|
|
185
|
-
/**
|
|
186
|
-
* 字符串转HTMLElement
|
|
187
|
-
* @param elementString
|
|
188
|
-
* @returns
|
|
189
|
-
*/
|
|
190
|
-
parseTextToDOM<R extends HTMLElement>(elementString: string): R {
|
|
191
|
-
/* 去除前后的换行和空格 */
|
|
192
|
-
elementString = elementString
|
|
193
|
-
.replace(/^[\n|\s]*/g, "")
|
|
194
|
-
.replace(/[\n|\s]*$/g, "");
|
|
195
|
-
let targetElement = popsDOMUtils.createElement("div", {
|
|
196
|
-
innerHTML: elementString,
|
|
197
|
-
});
|
|
198
|
-
return targetElement.firstChild as any as R;
|
|
199
|
-
}
|
|
200
184
|
/**
|
|
201
185
|
* 判断元素/页面中是否包含该元素
|
|
202
186
|
* @param target 需要判断的元素
|
|
@@ -389,6 +373,13 @@ class PopsUtils {
|
|
|
389
373
|
AnyTouch = () => {
|
|
390
374
|
return AnyTouch;
|
|
391
375
|
};
|
|
376
|
+
/**
|
|
377
|
+
* 通过navigator.userAgent判断是否是手机访问
|
|
378
|
+
* @param userAgent
|
|
379
|
+
*/
|
|
380
|
+
isPhone(userAgent = PopsCore.globalThis.navigator.userAgent): boolean {
|
|
381
|
+
return Boolean(/(iPhone|iPad|iPod|iOS|Android)/i.test(userAgent));
|
|
382
|
+
}
|
|
392
383
|
/**
|
|
393
384
|
* 自动使用 Worker 执行 setTimeout
|
|
394
385
|
*/
|