@whitesev/pops 2.4.6 → 2.5.0

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 (154) hide show
  1. package/dist/index.amd.js +578 -571
  2. package/dist/index.amd.js.map +1 -1
  3. package/dist/index.amd.min.js +2 -0
  4. package/dist/index.amd.min.js.map +1 -0
  5. package/dist/index.cjs.js +578 -571
  6. package/dist/index.cjs.js.map +1 -1
  7. package/dist/index.cjs.min.js +2 -0
  8. package/dist/index.cjs.min.js.map +1 -0
  9. package/dist/index.esm.js +578 -571
  10. package/dist/index.esm.js.map +1 -1
  11. package/dist/index.esm.min.js +2 -0
  12. package/dist/index.esm.min.js.map +1 -0
  13. package/dist/index.iife.js +578 -571
  14. package/dist/index.iife.js.map +1 -1
  15. package/dist/index.iife.min.js +2 -0
  16. package/dist/index.iife.min.js.map +1 -0
  17. package/dist/index.system.js +578 -571
  18. package/dist/index.system.js.map +1 -1
  19. package/dist/index.system.min.js +2 -0
  20. package/dist/index.system.min.js.map +1 -0
  21. package/dist/index.umd.js +578 -571
  22. package/dist/index.umd.js.map +1 -1
  23. package/dist/index.umd.min.js +2 -0
  24. package/dist/index.umd.min.js.map +1 -0
  25. package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +252 -252
  26. package/dist/types/src/types/animation.d.ts +19 -19
  27. package/dist/types/src/types/button.d.ts +187 -187
  28. package/dist/types/src/types/components.d.ts +210 -210
  29. package/dist/types/src/types/event.d.ts +63 -63
  30. package/dist/types/src/types/global.d.ts +25 -25
  31. package/dist/types/src/types/icon.d.ts +32 -32
  32. package/dist/types/src/types/inst.d.ts +24 -24
  33. package/dist/types/src/types/main.d.ts +111 -111
  34. package/dist/types/src/types/mask.d.ts +49 -49
  35. package/dist/types/src/types/position.d.ts +60 -60
  36. package/index.ts +3 -0
  37. package/package.json +5 -2
  38. package/src/Pops.ts +206 -0
  39. package/src/PopsAnimation.ts +32 -0
  40. package/src/PopsCSS.ts +51 -0
  41. package/src/PopsCore.ts +64 -0
  42. package/src/PopsIcon.ts +95 -0
  43. package/src/PopsInst.ts +21 -0
  44. package/src/components/alert/config.ts +62 -0
  45. package/src/components/alert/index.css +0 -0
  46. package/src/components/alert/index.ts +163 -0
  47. package/src/components/alert/types/index.ts +23 -0
  48. package/src/components/confirm/config.ts +90 -0
  49. package/src/components/confirm/index.css +0 -0
  50. package/src/components/confirm/index.ts +166 -0
  51. package/src/components/confirm/types/index.ts +17 -0
  52. package/src/components/drawer/config.ts +89 -0
  53. package/src/components/drawer/index.css +37 -0
  54. package/src/components/drawer/index.ts +237 -0
  55. package/src/components/drawer/types/index.ts +61 -0
  56. package/src/components/folder/config.ts +147 -0
  57. package/src/components/folder/folderIcon.ts +28 -0
  58. package/src/components/folder/index.css +303 -0
  59. package/src/components/folder/index.ts +929 -0
  60. package/src/components/folder/types/index.ts +97 -0
  61. package/src/components/iframe/config.ts +60 -0
  62. package/src/components/iframe/index.css +76 -0
  63. package/src/components/iframe/index.ts +334 -0
  64. package/src/components/iframe/types/index.ts +139 -0
  65. package/src/components/loading/config.ts +29 -0
  66. package/src/components/loading/index.css +66 -0
  67. package/src/components/loading/index.ts +99 -0
  68. package/src/components/loading/types/index.ts +34 -0
  69. package/src/components/panel/config.ts +519 -0
  70. package/src/components/panel/handlerComponents.ts +2900 -0
  71. package/src/components/panel/index.css +1222 -0
  72. package/src/components/panel/index.ts +207 -0
  73. package/src/components/panel/types/components-button.ts +68 -0
  74. package/src/components/panel/types/components-common.ts +50 -0
  75. package/src/components/panel/types/components-deepMenu.ts +84 -0
  76. package/src/components/panel/types/components-forms.ts +44 -0
  77. package/src/components/panel/types/components-input.ts +78 -0
  78. package/src/components/panel/types/components-own.ts +30 -0
  79. package/src/components/panel/types/components-select.ts +93 -0
  80. package/src/components/panel/types/components-selectMultiple.ts +130 -0
  81. package/src/components/panel/types/components-slider.ts +77 -0
  82. package/src/components/panel/types/components-switch.ts +56 -0
  83. package/src/components/panel/types/components-textarea.ts +68 -0
  84. package/src/components/panel/types/index.ts +177 -0
  85. package/src/components/prompt/config.ts +94 -0
  86. package/src/components/prompt/index.css +34 -0
  87. package/src/components/prompt/index.ts +216 -0
  88. package/src/components/prompt/types/index.ts +55 -0
  89. package/src/components/rightClickMenu/config.ts +98 -0
  90. package/src/components/rightClickMenu/index.css +112 -0
  91. package/src/components/rightClickMenu/index.ts +602 -0
  92. package/src/components/rightClickMenu/types/index.ts +97 -0
  93. package/src/components/searchSuggestion/config.ts +56 -0
  94. package/src/components/searchSuggestion/index.ts +856 -0
  95. package/src/components/searchSuggestion/types/index.ts +239 -0
  96. package/src/components/tooltip/config.ts +34 -0
  97. package/src/components/tooltip/index.css +199 -0
  98. package/src/components/tooltip/index.ts +604 -0
  99. package/src/components/tooltip/types/index.ts +117 -0
  100. package/src/config/CommonCSSClassName.ts +17 -0
  101. package/src/config/GlobalConfig.ts +63 -0
  102. package/src/css/animation.css +987 -0
  103. package/src/css/button.css +551 -0
  104. package/src/css/common.css +48 -0
  105. package/src/css/index.css +253 -0
  106. package/src/css/ninePalaceGridPosition.css +50 -0
  107. package/src/css/scrollbar.css +22 -0
  108. package/src/handler/PopsElementHandler.ts +304 -0
  109. package/src/handler/PopsHandler.ts +589 -0
  110. package/src/svg/arrowLeft.svg +4 -0
  111. package/src/svg/arrowRight.svg +4 -0
  112. package/src/svg/chromeFilled.svg +11 -0
  113. package/src/svg/circleClose.svg +8 -0
  114. package/src/svg/close.svg +5 -0
  115. package/src/svg/cpu.svg +8 -0
  116. package/src/svg/delete.svg +5 -0
  117. package/src/svg/documentCopy.svg +5 -0
  118. package/src/svg/edit.svg +8 -0
  119. package/src/svg/eleme.svg +5 -0
  120. package/src/svg/elemePlus.svg +5 -0
  121. package/src/svg/headset.svg +5 -0
  122. package/src/svg/hide.svg +8 -0
  123. package/src/svg/keyboard.svg +8 -0
  124. package/src/svg/loading.svg +5 -0
  125. package/src/svg/max.svg +5 -0
  126. package/src/svg/min.svg +5 -0
  127. package/src/svg/mise.svg +5 -0
  128. package/src/svg/monitor.svg +5 -0
  129. package/src/svg/next.svg +5 -0
  130. package/src/svg/picture.svg +8 -0
  131. package/src/svg/prev.svg +5 -0
  132. package/src/svg/search.svg +5 -0
  133. package/src/svg/share.svg +5 -0
  134. package/src/svg/upload.svg +5 -0
  135. package/src/svg/videoPause.svg +5 -0
  136. package/src/svg/videoPlay.svg +5 -0
  137. package/src/svg/view.svg +5 -0
  138. package/src/types/PopsDOMUtilsEventType.d.ts +252 -0
  139. package/src/types/animation.d.ts +19 -0
  140. package/src/types/button.d.ts +187 -0
  141. package/src/types/components.d.ts +210 -0
  142. package/src/types/event.d.ts +63 -0
  143. package/src/types/global.d.ts +25 -0
  144. package/src/types/icon.d.ts +32 -0
  145. package/src/types/inst.d.ts +24 -0
  146. package/src/types/main.d.ts +111 -0
  147. package/src/types/mask.d.ts +49 -0
  148. package/src/types/position.d.ts +60 -0
  149. package/src/utils/PopsDOMUtils.ts +2408 -0
  150. package/src/utils/PopsDOMUtilsEventsConfig.ts +4 -0
  151. package/src/utils/PopsInstanceUtils.ts +688 -0
  152. package/src/utils/PopsMathUtils.ts +71 -0
  153. package/src/utils/PopsSafeUtils.ts +22 -0
  154. package/src/utils/PopsUtils.ts +406 -0
@@ -0,0 +1,17 @@
1
+ /**
2
+ * 通用的CSS类名
3
+ */
4
+ export const PopsCommonCSSClassName = {
5
+ flexCenter: "pops-flex-items-center",
6
+ flexYCenter: "pops-flex-y-center",
7
+ flexXCenter: "pops-flex-x-center",
8
+ hide: "pops-hide",
9
+ hideImportant: "pops-hide-important",
10
+ noBorder: "pops-no-border",
11
+ noBorderImportant: "pops-no-border-important",
12
+ userSelectNone: "pops-user-select-none",
13
+ lineHeightCenter: "pops-line-height-center",
14
+ widthFill: "pops-width-fill",
15
+ textIsDisabled: "pops-text-is-disabled",
16
+ textIsDisabledImportant: "pops-text-is-disabled-important",
17
+ };
@@ -0,0 +1,63 @@
1
+ import type { PopsCommonConfig, PopsDragConfig } from "../types/components";
2
+
3
+ type EnterReturnType<T> = null | T | (() => T);
4
+
5
+ type GlobalConfigOption = {
6
+ style?: EnterReturnType<string>;
7
+ zIndex?: EnterReturnType<number> | EnterReturnType<string>;
8
+ } & Partial<PopsCommonConfig> &
9
+ Partial<PopsDragConfig>;
10
+
11
+ type ResultGlobalConfigOption<T> = T extends null | undefined ? never : T extends (...args: any) => infer R ? R : T;
12
+
13
+ export const GlobalConfig = {
14
+ config: {} as GlobalConfigOption,
15
+ /**
16
+ * 为所有弹窗设置全局属性
17
+ */
18
+ setGlobalConfig(config: GlobalConfigOption) {
19
+ Reflect.ownKeys(config).forEach((keyName) => {
20
+ Reflect.set(GlobalConfig.config, keyName, Reflect.get(config, keyName));
21
+ });
22
+ },
23
+ /**
24
+ * 获取全局配置
25
+ */
26
+ getGlobalConfig() {
27
+ const result: {
28
+ [P in keyof GlobalConfigOption]: ResultGlobalConfigOption<GlobalConfigOption[P]>;
29
+ } = {};
30
+ Object.keys(GlobalConfig.config).forEach((keyName) => {
31
+ const configValue = Reflect.get(GlobalConfig.config, keyName);
32
+ if (keyName === "style") {
33
+ // 设置style属性
34
+ const style = configValue == null ? "" : typeof configValue === "function" ? configValue() : configValue;
35
+
36
+ if (typeof style === "string") {
37
+ result.style = style;
38
+ }
39
+ } else if (keyName === "zIndex") {
40
+ // 设置zIndex属性
41
+ let zIndex = configValue == null ? "" : typeof configValue === "function" ? configValue() : configValue;
42
+ if (typeof zIndex === "string") {
43
+ const newIndex = (zIndex = Number(zIndex));
44
+ if (!isNaN(newIndex)) {
45
+ result.zIndex = newIndex;
46
+ }
47
+ } else {
48
+ if (!isNaN(zIndex)) {
49
+ result.zIndex = zIndex;
50
+ }
51
+ }
52
+ } else if (keyName === "mask") {
53
+ const mask = GlobalConfig.config.mask == null ? {} : GlobalConfig.config.mask;
54
+ if (typeof mask === "object" && mask != null) {
55
+ result.mask = mask;
56
+ }
57
+ } else {
58
+ Reflect.set(result, keyName, configValue);
59
+ }
60
+ });
61
+ return result;
62
+ },
63
+ };