@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.
Files changed (55) hide show
  1. package/dist/index.amd.js +1632 -1570
  2. package/dist/index.amd.js.map +1 -1
  3. package/dist/index.cjs.js +1632 -1570
  4. package/dist/index.cjs.js.map +1 -1
  5. package/dist/index.esm.js +1632 -1570
  6. package/dist/index.esm.js.map +1 -1
  7. package/dist/index.iife.js +1632 -1570
  8. package/dist/index.iife.js.map +1 -1
  9. package/dist/index.system.js +1632 -1570
  10. package/dist/index.system.js.map +1 -1
  11. package/dist/index.umd.js +1632 -1570
  12. package/dist/index.umd.js.map +1 -1
  13. package/dist/types/src/Pops.d.ts +50 -30
  14. package/dist/types/src/PopsAnimation.d.ts +14 -0
  15. package/dist/types/src/PopsCSS.d.ts +34 -0
  16. package/dist/types/src/PopsIcon.d.ts +25 -0
  17. package/dist/types/src/PopsLayer.d.ts +3 -0
  18. package/dist/types/src/components/panel/buttonType.d.ts +2 -2
  19. package/dist/types/src/components/rightClickMenu/index.d.ts +1 -2
  20. package/dist/types/src/components/rightClickMenu/indexType.d.ts +2 -2
  21. package/dist/types/src/types/button.d.ts +3 -3
  22. package/dist/types/src/types/icon.d.ts +1 -1
  23. package/dist/types/src/utils/PopsDOMUtils.d.ts +12 -0
  24. package/dist/types/src/utils/PopsInstanceUtils.d.ts +0 -6
  25. package/dist/types/src/utils/PopsUtils.d.ts +5 -6
  26. package/package.json +1 -1
  27. package/src/Pops.ts +12 -152
  28. package/src/PopsAnimation.ts +32 -0
  29. package/src/PopsCSS.ts +51 -0
  30. package/src/PopsIcon.ts +93 -0
  31. package/src/PopsLayer.ts +17 -0
  32. package/src/components/alert/index.ts +8 -8
  33. package/src/components/confirm/index.ts +8 -8
  34. package/src/components/drawer/index.ts +8 -8
  35. package/src/components/folder/index.ts +15 -15
  36. package/src/components/iframe/index.ts +9 -12
  37. package/src/components/loading/index.ts +5 -5
  38. package/src/components/panel/PanelHandleContentDetails.ts +28 -25
  39. package/src/components/panel/buttonType.ts +2 -2
  40. package/src/components/panel/config.ts +4 -0
  41. package/src/components/panel/index.css +33 -0
  42. package/src/components/panel/index.ts +9 -9
  43. package/src/components/prompt/index.ts +8 -8
  44. package/src/components/rightClickMenu/config.ts +7 -7
  45. package/src/components/rightClickMenu/index.ts +9 -10
  46. package/src/components/rightClickMenu/indexType.ts +2 -2
  47. package/src/components/searchSuggestion/index.ts +5 -5
  48. package/src/components/tooltip/index.ts +5 -5
  49. package/src/handler/PopsElementHandler.ts +17 -17
  50. package/src/handler/PopsHandler.ts +22 -19
  51. package/src/types/button.d.ts +3 -3
  52. package/src/types/icon.d.ts +1 -1
  53. package/src/utils/PopsDOMUtils.ts +34 -1
  54. package/src/utils/PopsInstanceUtils.ts +13 -31
  55. package/src/utils/PopsUtils.ts +7 -16
@@ -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
  */