@whitesev/pops 2.6.0 → 3.0.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 (184) hide show
  1. package/dist/index.amd.js +1233 -1092
  2. package/dist/index.amd.js.map +1 -1
  3. package/dist/index.amd.min.js +1 -1
  4. package/dist/index.amd.min.js.map +1 -1
  5. package/dist/index.cjs.js +1233 -1092
  6. package/dist/index.cjs.js.map +1 -1
  7. package/dist/index.cjs.min.js +1 -1
  8. package/dist/index.cjs.min.js.map +1 -1
  9. package/dist/index.esm.js +1233 -1092
  10. package/dist/index.esm.js.map +1 -1
  11. package/dist/index.esm.min.js +1 -1
  12. package/dist/index.esm.min.js.map +1 -1
  13. package/dist/index.iife.js +1233 -1092
  14. package/dist/index.iife.js.map +1 -1
  15. package/dist/index.iife.min.js +1 -1
  16. package/dist/index.iife.min.js.map +1 -1
  17. package/dist/index.system.js +1233 -1092
  18. package/dist/index.system.js.map +1 -1
  19. package/dist/index.system.min.js +1 -1
  20. package/dist/index.system.min.js.map +1 -1
  21. package/dist/index.umd.js +1233 -1092
  22. package/dist/index.umd.js.map +1 -1
  23. package/dist/index.umd.min.js +1 -1
  24. package/dist/index.umd.min.js.map +1 -1
  25. package/dist/types/eslint.config.d.mts +2 -0
  26. package/dist/types/src/Pops.d.ts +98 -103
  27. package/dist/types/src/PopsInst.d.ts +2 -2
  28. package/dist/types/src/components/alert/defaultConfig.d.ts +2 -0
  29. package/dist/types/src/components/alert/index.d.ts +2 -2
  30. package/dist/types/src/components/alert/types/index.d.ts +4 -4
  31. package/dist/types/src/components/confirm/defaultConfig.d.ts +2 -0
  32. package/dist/types/src/components/confirm/index.d.ts +2 -2
  33. package/dist/types/src/components/confirm/types/index.d.ts +2 -2
  34. package/dist/types/src/components/drawer/defaultConfig.d.ts +2 -0
  35. package/dist/types/src/components/drawer/index.d.ts +2 -2
  36. package/dist/types/src/components/drawer/types/index.d.ts +2 -2
  37. package/dist/types/src/components/folder/defaultConfig.d.ts +2 -0
  38. package/dist/types/src/components/folder/index.d.ts +2 -2
  39. package/dist/types/src/components/folder/types/index.d.ts +31 -7
  40. package/dist/types/src/components/iframe/defaultConfig.d.ts +2 -0
  41. package/dist/types/src/components/iframe/index.d.ts +2 -5
  42. package/dist/types/src/components/iframe/types/index.d.ts +13 -42
  43. package/dist/types/src/components/loading/defaultConfig.d.ts +2 -0
  44. package/dist/types/src/components/loading/index.d.ts +2 -2
  45. package/dist/types/src/components/loading/types/index.d.ts +4 -4
  46. package/dist/types/src/components/panel/defaultConfig.d.ts +2 -0
  47. package/dist/types/src/components/panel/handlerComponents.d.ts +47 -43
  48. package/dist/types/src/components/panel/index.d.ts +3 -3
  49. package/dist/types/src/components/panel/types/components-button.d.ts +7 -6
  50. package/dist/types/src/components/panel/types/components-common.d.ts +7 -7
  51. package/dist/types/src/components/panel/types/components-container.d.ts +24 -0
  52. package/dist/types/src/components/panel/types/components-deepMenu.d.ts +13 -13
  53. package/dist/types/src/components/panel/types/components-input.d.ts +6 -6
  54. package/dist/types/src/components/panel/types/components-own.d.ts +2 -2
  55. package/dist/types/src/components/panel/types/components-select.d.ts +9 -9
  56. package/dist/types/src/components/panel/types/components-selectMultiple.d.ts +8 -8
  57. package/dist/types/src/components/panel/types/components-slider.d.ts +7 -7
  58. package/dist/types/src/components/panel/types/components-switch.d.ts +6 -6
  59. package/dist/types/src/components/panel/types/components-textarea.d.ts +6 -6
  60. package/dist/types/src/components/panel/types/index.d.ts +36 -28
  61. package/dist/types/src/components/prompt/defaultConfig.d.ts +2 -0
  62. package/dist/types/src/components/prompt/index.d.ts +2 -2
  63. package/dist/types/src/components/prompt/types/index.d.ts +4 -3
  64. package/dist/types/src/components/rightClickMenu/defaultConfig.d.ts +2 -0
  65. package/dist/types/src/components/rightClickMenu/index.d.ts +29 -27
  66. package/dist/types/src/components/rightClickMenu/types/index.d.ts +32 -11
  67. package/dist/types/src/components/searchSuggestion/defaultConfig.d.ts +2 -0
  68. package/dist/types/src/components/searchSuggestion/index.d.ts +21 -6
  69. package/dist/types/src/components/searchSuggestion/types/index.d.ts +15 -13
  70. package/dist/types/src/components/tooltip/defaultConfig.d.ts +2 -0
  71. package/dist/types/src/components/tooltip/index.d.ts +6 -21
  72. package/dist/types/src/components/tooltip/types/index.d.ts +8 -6
  73. package/dist/types/src/config/GlobalConfig.d.ts +3 -3
  74. package/dist/types/src/handler/PopsElementHandler.d.ts +6 -6
  75. package/dist/types/src/handler/PopsHandler.d.ts +18 -18
  76. package/dist/types/src/types/button.d.ts +4 -97
  77. package/dist/types/src/types/components.d.ts +8 -8
  78. package/dist/types/src/types/event.d.ts +0 -30
  79. package/dist/types/src/types/global.d.ts +2 -0
  80. package/dist/types/src/types/inst.d.ts +5 -5
  81. package/dist/types/src/types/main.d.ts +35 -80
  82. package/dist/types/src/types/mask.d.ts +18 -15
  83. package/dist/types/src/utils/PopsInstanceUtils.d.ts +15 -15
  84. package/dist/types/src/utils/PopsUtils.d.ts +4 -0
  85. package/package.json +10 -10
  86. package/src/Pops.ts +44 -44
  87. package/src/PopsAnimation.ts +1 -1
  88. package/src/PopsInst.ts +2 -2
  89. package/src/components/alert/{config.ts → defaultConfig.ts} +7 -7
  90. package/src/components/alert/index.ts +16 -18
  91. package/src/components/alert/types/index.ts +4 -4
  92. package/src/components/confirm/{config.ts → defaultConfig.ts} +11 -11
  93. package/src/components/confirm/index.ts +11 -13
  94. package/src/components/confirm/types/index.ts +3 -3
  95. package/src/components/drawer/{config.ts → defaultConfig.ts} +10 -10
  96. package/src/components/drawer/index.ts +18 -17
  97. package/src/components/drawer/types/index.ts +3 -3
  98. package/src/components/folder/{config.ts → defaultConfig.ts} +22 -18
  99. package/src/components/folder/index.ts +61 -60
  100. package/src/components/folder/types/index.ts +31 -18
  101. package/src/components/iframe/{config.ts → defaultConfig.ts} +2 -2
  102. package/src/components/iframe/index.ts +24 -29
  103. package/src/components/iframe/types/index.ts +13 -56
  104. package/src/components/loading/{config.ts → defaultConfig.ts} +3 -3
  105. package/src/components/loading/index.ts +13 -11
  106. package/src/components/loading/types/index.ts +5 -5
  107. package/src/components/panel/{config.ts → defaultConfig.ts} +115 -37
  108. package/src/components/panel/handlerComponents.ts +446 -428
  109. package/src/components/panel/index.css +11 -3
  110. package/src/components/panel/index.ts +15 -28
  111. package/src/components/panel/types/components-button.ts +7 -6
  112. package/src/components/panel/types/components-common.ts +7 -7
  113. package/src/components/panel/types/components-container.ts +25 -0
  114. package/src/components/panel/types/components-deepMenu.ts +13 -13
  115. package/src/components/panel/types/components-input.ts +6 -6
  116. package/src/components/panel/types/components-own.ts +2 -2
  117. package/src/components/panel/types/components-select.ts +11 -11
  118. package/src/components/panel/types/components-selectMultiple.ts +8 -9
  119. package/src/components/panel/types/components-slider.ts +7 -7
  120. package/src/components/panel/types/components-switch.ts +6 -6
  121. package/src/components/panel/types/components-textarea.ts +6 -6
  122. package/src/components/panel/types/index.ts +45 -38
  123. package/src/components/prompt/{config.ts → defaultConfig.ts} +10 -10
  124. package/src/components/prompt/index.ts +13 -15
  125. package/src/components/prompt/types/index.ts +4 -3
  126. package/src/components/rightClickMenu/{config.ts → defaultConfig.ts} +20 -19
  127. package/src/components/rightClickMenu/index.ts +125 -108
  128. package/src/components/rightClickMenu/types/index.ts +36 -14
  129. package/src/components/searchSuggestion/{config.ts → defaultConfig.ts} +18 -11
  130. package/src/components/searchSuggestion/index.ts +116 -96
  131. package/src/components/searchSuggestion/types/index.ts +17 -15
  132. package/src/components/tooltip/{config.ts → defaultConfig.ts} +5 -6
  133. package/src/components/tooltip/index.ts +21 -21
  134. package/src/components/tooltip/types/index.ts +9 -7
  135. package/src/config/GlobalConfig.ts +2 -2
  136. package/src/css/common.css +6 -0
  137. package/src/handler/PopsElementHandler.ts +29 -30
  138. package/src/handler/PopsHandler.ts +43 -43
  139. package/src/svg/cpu.svg +7 -7
  140. package/src/svg/delete.svg +4 -4
  141. package/src/svg/documentCopy.svg +4 -4
  142. package/src/svg/edit.svg +7 -7
  143. package/src/svg/eleme.svg +4 -4
  144. package/src/svg/elemePlus.svg +4 -4
  145. package/src/svg/headset.svg +4 -4
  146. package/src/svg/hide.svg +7 -7
  147. package/src/svg/keyboard.svg +7 -7
  148. package/src/svg/loading.svg +4 -4
  149. package/src/svg/max.svg +4 -4
  150. package/src/svg/min.svg +2 -4
  151. package/src/svg/mise.svg +4 -4
  152. package/src/svg/monitor.svg +4 -4
  153. package/src/svg/next.svg +4 -4
  154. package/src/svg/picture.svg +7 -7
  155. package/src/svg/prev.svg +4 -4
  156. package/src/svg/search.svg +4 -4
  157. package/src/svg/share.svg +4 -4
  158. package/src/svg/upload.svg +4 -4
  159. package/src/svg/videoPause.svg +4 -4
  160. package/src/svg/videoPlay.svg +4 -4
  161. package/src/svg/view.svg +4 -4
  162. package/src/types/button.d.ts +4 -97
  163. package/src/types/components.d.ts +8 -8
  164. package/src/types/event.d.ts +0 -30
  165. package/src/types/global.d.ts +2 -0
  166. package/src/types/inst.d.ts +5 -5
  167. package/src/types/main.d.ts +35 -80
  168. package/src/types/mask.d.ts +18 -15
  169. package/src/utils/PopsDOMUtils.ts +34 -34
  170. package/src/utils/PopsInstanceUtils.ts +129 -139
  171. package/src/utils/PopsUtils.ts +60 -45
  172. package/dist/types/src/components/alert/config.d.ts +0 -2
  173. package/dist/types/src/components/confirm/config.d.ts +0 -2
  174. package/dist/types/src/components/drawer/config.d.ts +0 -2
  175. package/dist/types/src/components/folder/config.d.ts +0 -2
  176. package/dist/types/src/components/iframe/config.d.ts +0 -2
  177. package/dist/types/src/components/loading/config.d.ts +0 -2
  178. package/dist/types/src/components/panel/config.d.ts +0 -2
  179. package/dist/types/src/components/panel/types/components-forms.d.ts +0 -23
  180. package/dist/types/src/components/prompt/config.d.ts +0 -2
  181. package/dist/types/src/components/rightClickMenu/config.d.ts +0 -2
  182. package/dist/types/src/components/searchSuggestion/config.d.ts +0 -2
  183. package/dist/types/src/components/tooltip/config.d.ts +0 -2
  184. package/src/components/panel/types/components-forms.ts +0 -24
@@ -1,15 +1,15 @@
1
- import type { PopsCommonConfig } from "../../../types/components";
2
- import type { PopsPanelCommonDetails } from "../../panel/types/components-common";
1
+ import type { PopsGeneralConfig } from "../../../types/components";
2
+ import type { PopsPanelGeneralConfig } from "../../panel/types/components-common";
3
3
  /** tooltip的出现位置 */
4
4
  export type PopsTooltipPosition = "top" | "right" | "bottom" | "left" | "follow";
5
5
  /**
6
6
  * pops.tooltip
7
7
  */
8
- export interface PopsToolTipDetails extends Pick<PopsCommonConfig, "useShadowRoot" | "only" | "zIndex" | "style" | "beforeAppendToPageCallBack"> {
8
+ export interface PopsToolTipConfig extends Pick<PopsGeneralConfig, "useShadowRoot" | "only" | "zIndex" | "style" | "beforeAppendToPageCallBack"> {
9
9
  /**
10
10
  * 目标元素
11
11
  */
12
- target: HTMLElement;
12
+ $target: HTMLElement;
13
13
  /**
14
14
  * 显示的文字
15
15
  */
@@ -33,7 +33,7 @@ export interface PopsToolTipDetails extends Pick<PopsCommonConfig, "useShadowRoo
33
33
  * + `github-tooltip` github的样式
34
34
  * @default ""
35
35
  */
36
- className?: PopsPanelCommonDetails<any>["className"];
36
+ className?: PopsPanelGeneralConfig<any>["className"];
37
37
  /**
38
38
  * 是否使用fixed定位,false则是absolute定位
39
39
  *
@@ -66,7 +66,9 @@ export interface PopsToolTipDetails extends Pick<PopsCommonConfig, "useShadowRoo
66
66
  * 监听的事件配置
67
67
  */
68
68
  eventOption?: {
69
- [P in keyof AddEventListenerOptions]: AddEventListenerOptions[P];
69
+ once?: boolean;
70
+ passive?: boolean;
71
+ capture?: boolean;
70
72
  };
71
73
  /**
72
74
  * 触发显示前的回调
@@ -1,9 +1,9 @@
1
- import type { PopsCommonConfig, PopsDragConfig } from "../types/components";
1
+ import type { PopsGeneralConfig, PopsDragConfig } from "../types/components";
2
2
  type EnterReturnType<T> = null | T | (() => T);
3
3
  type GlobalConfigOption = {
4
4
  style?: EnterReturnType<string>;
5
5
  zIndex?: EnterReturnType<number> | EnterReturnType<string>;
6
- } & Partial<PopsCommonConfig> & Partial<PopsDragConfig>;
6
+ } & Partial<PopsGeneralConfig> & Partial<PopsDragConfig>;
7
7
  export declare const GlobalConfig: {
8
8
  config: GlobalConfigOption;
9
9
  /**
@@ -23,7 +23,7 @@ export declare const GlobalConfig: {
23
23
  height?: string | undefined;
24
24
  position?: import("../types/position").PopsPosition | undefined;
25
25
  animation?: import("../types/animation").PopsAnimation | undefined;
26
- mask?: import("../types/mask").PopsMaskDetails | undefined;
26
+ mask?: import("../types/mask").PopsMaskConfig | undefined;
27
27
  forbiddenScroll?: boolean | undefined;
28
28
  beforeAppendToPageCallBack?: void;
29
29
  drag?: boolean | undefined;
@@ -1,4 +1,4 @@
1
- import type { PopsSupportAnimDetails, PopsSupportBottomBtnDetails, PopsSupportContentDetails, PopsSupportHeaderTitleDetails, PopsSupportAnimDetailsType, PopsSupportBottomBtnDetailsType, PopsSupportContentDetailsType, PopsSupportHeaderTitleDetailsType } from "../types/main";
1
+ import type { PopsSupportAnimConfig, PopsSupportBottomButtonConfig, PopsSupportContentConfig, PopsSupportHeaderTitleConfig, PopsSupportAnimConfigType, PopsSupportBottomButtonConfigType, PopsSupportContentConfigType, PopsSupportHeaderTitleConfigType } from "../types/main";
2
2
  export declare const PopsElementHandler: {
3
3
  /**
4
4
  * 获取遮罩层HTML
@@ -16,19 +16,19 @@ export declare const PopsElementHandler: {
16
16
  * @param bottomBtnHTML
17
17
  * @param zIndex
18
18
  */
19
- createAnim(guid: string, type: PopsSupportAnimDetailsType, config: PopsSupportAnimDetails[keyof PopsSupportAnimDetails], html: string | undefined, bottomBtnHTML: string | undefined, zIndex: number): string;
19
+ createAnim(guid: string, type: PopsSupportAnimConfigType, config: PopsSupportAnimConfig[keyof PopsSupportAnimConfig], html: string | undefined, bottomBtnHTML: string | undefined, zIndex: number): string;
20
20
  /**
21
21
  * 获取顶部按钮层HTML
22
22
  * @param type
23
23
  * @param config
24
24
  */
25
- createHeader(type: PopsSupportHeaderTitleDetailsType, config: PopsSupportHeaderTitleDetails[keyof PopsSupportHeaderTitleDetails]): string;
25
+ createHeader(type: PopsSupportHeaderTitleConfigType, config: PopsSupportHeaderTitleConfig[keyof PopsSupportHeaderTitleConfig]): string;
26
26
  /**
27
27
  * 获取标题style
28
28
  * @param type 弹窗类型
29
29
  * @param config 弹窗配置
30
30
  */
31
- createHeaderStyle(type: PopsSupportHeaderTitleDetailsType, config: PopsSupportHeaderTitleDetails[keyof PopsSupportHeaderTitleDetails]): {
31
+ createHeaderStyle(type: PopsSupportHeaderTitleConfigType, config: PopsSupportHeaderTitleConfig[keyof PopsSupportHeaderTitleConfig]): {
32
32
  headerStyle: string;
33
33
  headerPStyle: string;
34
34
  };
@@ -37,13 +37,13 @@ export declare const PopsElementHandler: {
37
37
  * @param type
38
38
  * @param config
39
39
  */
40
- createBottom(type: PopsSupportBottomBtnDetailsType, config: Omit<PopsSupportBottomBtnDetails[keyof PopsSupportBottomBtnDetails], "content">): string;
40
+ createBottom(type: PopsSupportBottomButtonConfigType, config: Omit<PopsSupportBottomButtonConfig[keyof PopsSupportBottomButtonConfig], "content">): string;
41
41
  /**
42
42
  * 获取内容style
43
43
  * @param type 弹窗类型
44
44
  * @param config 弹窗配置
45
45
  */
46
- createContentStyle(type: PopsSupportContentDetailsType, config: PopsSupportContentDetails[keyof PopsSupportContentDetails]): {
46
+ createContentStyle(type: PopsSupportContentConfigType, config: PopsSupportContentConfig[keyof PopsSupportContentConfig]): {
47
47
  contentStyle: string;
48
48
  contentPStyle: string;
49
49
  };
@@ -1,20 +1,20 @@
1
- import type { PopsAlertDetails } from "../components/alert/types";
2
- import type { PopsConfirmDetails } from "../components/confirm/types";
3
- import type { PopsDrawerDetails } from "../components/drawer/types";
4
- import type { PopsFolderDetails } from "../components/folder/types";
5
- import type { PopsIframeDetails } from "../components/iframe/types";
6
- import type { PopsLoadingDetails } from "../components/loading/types";
7
- import type { PopsPanelDetails } from "../components/panel/types";
8
- import type { PopsPromptDetails } from "../components/prompt/types/index";
9
- import type { PopsCommonConfig } from "../types/components";
1
+ import type { PopsAlertConfig } from "../components/alert/types";
2
+ import type { PopsConfirmConfig } from "../components/confirm/types";
3
+ import type { PopsDrawerConfig } from "../components/drawer/types";
4
+ import type { PopsFolderConfig } from "../components/folder/types";
5
+ import type { PopsIframeConfig } from "../components/iframe/types";
6
+ import type { PopsLoadingConfig } from "../components/loading/types";
7
+ import type { PopsPanelConfig } from "../components/panel/types";
8
+ import type { PopsPromptConfig } from "../components/prompt/types/index";
9
+ import type { PopsGeneralConfig } from "../types/components";
10
10
  import type { PopsEventConfig, PopsHandlerEventConfig } from "../types/event";
11
- import type { PopsInstCommonConfig } from "../types/inst";
12
- import type { PopsInstStoreType, PopsType, PopsSupportAnimDetailsType, PopsSupportOnlyDetails } from "../types/main";
11
+ import type { PopsInstGeneralConfig } from "../types/inst";
12
+ import type { PopsInstStoreType, PopsType, PopsSupportAnimConfigType, PopsSupportOnlyConfig } from "../types/main";
13
13
  export declare const PopsHandler: {
14
14
  /**
15
15
  * 创建shadow
16
16
  */
17
- handlerShadow(config: Pick<PopsCommonConfig, "useShadowRoot">): {
17
+ handlerShadow(config: Pick<PopsGeneralConfig, "useShadowRoot">): {
18
18
  $shadowContainer: HTMLDivElement;
19
19
  $shadowRoot: ShadowRoot;
20
20
  } | {
@@ -39,7 +39,7 @@ export declare const PopsHandler: {
39
39
  handleMask(config?: {
40
40
  type: "alert" | "confirm" | "prompt" | "loading" | "iframe" | "drawer" | "folder" | "panel";
41
41
  guid: string;
42
- config: Required<PopsAlertDetails> | Required<PopsLoadingDetails> | Required<PopsIframeDetails> | Required<PopsDrawerDetails> | Required<PopsPanelDetails> | Required<PopsFolderDetails>;
42
+ config: Required<PopsAlertConfig> | Required<PopsLoadingConfig> | Required<PopsIframeConfig> | Required<PopsDrawerConfig> | Required<PopsPanelConfig> | Required<PopsFolderConfig>;
43
43
  animElement: HTMLElement;
44
44
  maskHTML: string;
45
45
  }): {
@@ -50,7 +50,7 @@ export declare const PopsHandler: {
50
50
  * @param animElement
51
51
  * @param type
52
52
  */
53
- handleQueryElement(animElement: HTMLDivElement, type: PopsSupportAnimDetailsType): {
53
+ handleQueryElement(animElement: HTMLDivElement, type: PopsSupportAnimConfigType): {
54
54
  /**
55
55
  * 主元素
56
56
  */
@@ -183,7 +183,7 @@ export declare const PopsHandler: {
183
183
  * @param $mask 遮罩层
184
184
  * @param config 当前配置
185
185
  */
186
- handleEventConfig(config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, guid: string, $shadowContainer: HTMLDivElement, $shadowRoot: ShadowRoot | HTMLElement, mode: PopsInstStoreType, $anim: HTMLDivElement, $pops: HTMLDivElement, $mask?: HTMLDivElement): PopsEventConfig;
186
+ handleEventConfig(config: PopsAlertConfig | PopsDrawerConfig | PopsPromptConfig | PopsConfirmConfig | PopsIframeConfig | PopsLoadingConfig | PopsPanelConfig | PopsFolderConfig, guid: string, $shadowContainer: HTMLDivElement, $shadowRoot: ShadowRoot | HTMLElement, mode: PopsInstStoreType, $anim: HTMLDivElement, $pops: HTMLDivElement, $mask?: HTMLDivElement): PopsEventConfig;
187
187
  /**
188
188
  * 获取loading的事件配置
189
189
  * @param guid
@@ -193,7 +193,7 @@ export declare const PopsHandler: {
193
193
  * @param $mask 遮罩层
194
194
  * @param config 当前配置
195
195
  */
196
- handleLoadingEventConfig(config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, guid: string, mode: "loading", $anim: HTMLDivElement, $pops: HTMLDivElement, $mask?: HTMLDivElement): Omit<PopsEventConfig, "$shadowContainer" | "$shadowRoot">;
196
+ handleLoadingEventConfig(config: PopsAlertConfig | PopsDrawerConfig | PopsPromptConfig | PopsConfirmConfig | PopsIframeConfig | PopsLoadingConfig | PopsPanelConfig | PopsFolderConfig, guid: string, mode: "loading", $anim: HTMLDivElement, $pops: HTMLDivElement, $mask?: HTMLDivElement): Omit<PopsEventConfig, "$shadowContainer" | "$shadowRoot">;
197
197
  /**
198
198
  * 处理返回的配置,针对popsHandler.handleEventConfig
199
199
  * @param config 配置
@@ -238,11 +238,11 @@ export declare const PopsHandler: {
238
238
  * @param type 当前弹窗类型
239
239
  * @param config 配置
240
240
  */
241
- handleOnly<T extends Required<PopsSupportOnlyDetails[keyof PopsSupportOnlyDetails]>>(type: PopsType, config: T): T;
241
+ handleOnly<T extends Required<PopsSupportOnlyConfig[keyof PopsSupportOnlyConfig]>>(type: PopsType, config: T): T;
242
242
  /**
243
243
  * 处理把已创建的元素保存到内部环境中
244
244
  * @param type 当前弹窗类型
245
245
  * @param value
246
246
  */
247
- handlePush(type: PopsInstStoreType, value: PopsInstCommonConfig): void;
247
+ handlePush(type: PopsInstStoreType, value: PopsInstGeneralConfig): void;
248
248
  };
@@ -1,6 +1,5 @@
1
1
  import type { PopsEventConfig, PopsHandlerEventConfig } from "./event";
2
2
  import type { PopsIconType } from "./icon";
3
- import type { PopsType } from "./main";
4
3
 
5
4
  /**
6
5
  * 按钮类型
@@ -24,56 +23,10 @@ export type PopsButtonStyleType =
24
23
  */
25
24
  export type PopsButtonSize = "large" | "small";
26
25
 
27
- /**
28
- * 按钮的点击回调参数event
29
- */
30
- export interface PopsBtnCallBackEvent {
31
- /**
32
- * 元素
33
- */
34
- element: HTMLElement;
35
- /**
36
- * 动画元素(包裹着弹窗元素)
37
- */
38
- animElement: HTMLElement;
39
- /**
40
- * 弹窗元素
41
- */
42
- popsElement: HTMLElement;
43
- /**
44
- * 遮罩层元素
45
- */
46
- maskElement: HTMLElement | undefined;
47
- /**
48
- * 按钮调用类型
49
- */
50
- type: PopsButtonType;
51
- /**
52
- * 调用的方法
53
- */
54
- mode: PopsType;
55
- /**
56
- * 唯一id
57
- */
58
- guid: string;
59
- /**
60
- * 关闭弹窗
61
- */
62
- close(): void;
63
- /**
64
- * 隐藏弹窗
65
- */
66
- hide(): void;
67
- /**
68
- * 显示弹窗
69
- */
70
- show(): void;
71
- }
72
-
73
26
  /**
74
27
  * 按钮配置
75
28
  */
76
- export interface PopsButtonDetails<T = object> {
29
+ export interface PopsGlobalButtonConfig<T = object> {
77
30
  /**
78
31
  * 是否启用按钮
79
32
  */
@@ -116,7 +69,7 @@ export interface PopsButtonDetails<T = object> {
116
69
  /**
117
70
  * 按钮配置(匹配任意类型)
118
71
  */
119
- export type PopsButtonDetailsAnyType<T = object> = Omit<PopsButtonDetails<T>, "type"> & {
72
+ export type PopsButtonConfigAnyType<T = object> = Omit<PopsGlobalButtonConfig<T>, "type"> & {
120
73
  /**
121
74
  * 按钮样式类型
122
75
  * @default "default"
@@ -124,56 +77,10 @@ export type PopsButtonDetailsAnyType<T = object> = Omit<PopsButtonDetails<T>, "t
124
77
  type: string;
125
78
  };
126
79
 
127
- /** prompt的点击回调 */
128
- export interface PopsPromptButtonDetails extends PopsButtonDetails {
129
- callback(
130
- eventConfig: PopsHandlerEventConfig & {
131
- text: string;
132
- },
133
- event: PointerEvent | MouseEvent
134
- ): void;
135
- }
136
- /**
137
- * 右上角关闭按钮点击回调的配置
138
- */
139
- export interface PopsHeaderCloseButtonClickCallBackEvent {
140
- /**
141
- * 动画元素(包裹着弹窗元素)
142
- */
143
- animElement: HTMLElement;
144
- /**
145
- * 遮罩层元素,如果未设置,那么不存在
146
- */
147
- maskElement?: HTMLElement;
148
- /**
149
- * 按钮调用类型
150
- */
151
- type: string;
152
- /**
153
- * 唯一id
154
- */
155
- guid: string;
156
- /**
157
- * 关闭弹窗
158
- */
159
- close(): void;
160
- /**
161
- * 隐藏弹窗
162
- */
163
- hide(): void;
164
- /**
165
- * 显示弹窗
166
- */
167
- show(): void;
168
- /**
169
- * 输入的内容
170
- */
171
- text: string;
172
- }
173
80
  /**
174
81
  * 顶部关闭按钮配置
175
82
  */
176
- export interface PopsHeaderCloseButtonDetails {
83
+ export interface PopsHeaderCloseButtonConfig {
177
84
  /**
178
85
  * 是否启用按钮
179
86
  */
@@ -183,5 +90,5 @@ export interface PopsHeaderCloseButtonDetails {
183
90
  *
184
91
  * 如果传入该值,那么将不会自动关闭弹窗
185
92
  */
186
- callback?: (details: PopsEventConfig, event: PointerEvent | MouseEvent) => void;
93
+ callback?: (eventConfig: PopsEventConfig, event: PointerEvent | MouseEvent) => void;
187
94
  }
@@ -1,7 +1,7 @@
1
1
  import type { PopsAnimation } from "./animation";
2
2
  import type { PopsPosition, PopsTextAlign, PopsJustifyContent } from "./position";
3
- import type { PopsButtonDetails, PopsButtonDetailsAnyType, PopsHeaderCloseButtonDetails } from "./button";
4
- import type { PopsMaskDetails } from "./mask";
3
+ import type { PopsGlobalButtonConfig, PopsButtonConfigAnyType, PopsHeaderCloseButtonConfig } from "./button";
4
+ import type { PopsMaskConfig } from "./mask";
5
5
 
6
6
  /**
7
7
  * 标题配置
@@ -62,7 +62,7 @@ export interface PopsButtonConfig {
62
62
  /**
63
63
  * 右上角的关闭按钮
64
64
  */
65
- close?: PopsHeaderCloseButtonDetails;
65
+ close?: PopsHeaderCloseButtonConfig;
66
66
  };
67
67
  }
68
68
  /**
@@ -88,15 +88,15 @@ export interface PopsMoreButtonConfig<T = object> {
88
88
  /**
89
89
  * 确定按钮
90
90
  */
91
- ok?: Partial<PopsButtonDetails<T> | PopsButtonDetailsAnyType<T>>;
91
+ ok?: Partial<PopsGlobalButtonConfig<T> | PopsButtonConfigAnyType<T>>;
92
92
  /**
93
93
  * 取消按钮
94
94
  */
95
- cancel?: Partial<PopsButtonDetails<T> | PopsButtonDetailsAnyType<T>>;
95
+ cancel?: Partial<PopsGlobalButtonConfig<T> | PopsButtonConfigAnyType<T>>;
96
96
  /**
97
97
  * 其他按钮
98
98
  */
99
- other?: Partial<PopsButtonDetails<T> | PopsButtonDetailsAnyType<T>>;
99
+ other?: Partial<PopsGlobalButtonConfig<T> | PopsButtonConfigAnyType<T>>;
100
100
  };
101
101
  }
102
102
  /**
@@ -136,7 +136,7 @@ export interface PopsDragConfig {
136
136
  /**
137
137
  * 通用配置
138
138
  */
139
- export interface PopsCommonConfig {
139
+ export interface PopsGeneralConfig {
140
140
  /**
141
141
  * 是否使用shadowRoot
142
142
  *
@@ -188,7 +188,7 @@ export interface PopsCommonConfig {
188
188
  /**
189
189
  * 遮罩层
190
190
  */
191
- mask?: PopsMaskDetails;
191
+ mask?: PopsMaskConfig;
192
192
  /**
193
193
  * 是否禁用页面滚动
194
194
  *
@@ -1,35 +1,5 @@
1
- import type { PopsIframeDetails } from "../components/iframe/types";
2
1
  import type { PopsType } from "./main";
3
2
 
4
- /**
5
- * 事件配置
6
- */
7
- export interface PopsIframeEventConfig {
8
- /**
9
- * 唯一id
10
- */
11
- guid: string;
12
- /**
13
- * 当前弹窗类型
14
- */
15
- mode: PopsType;
16
- /**
17
- * 动画层
18
- */
19
- animElement: HTMLElement;
20
- /**
21
- * 主元素
22
- */
23
- popsElement: HTMLElement;
24
- /**
25
- * 遮罩层
26
- */
27
- maskElement: HTMLElement;
28
- /**
29
- * 当前配置
30
- */
31
- config: PopsIframeDetails;
32
- }
33
3
  /**
34
4
  * 事件配置
35
5
  */
@@ -25,3 +25,5 @@ declare type DeepRequired<T> = T extends any[]
25
25
  [K in keyof T]-?: DeepRequired<T[K]>;
26
26
  }
27
27
  : T;
28
+
29
+ declare type IPromise<T> = Promise<T> | T;
@@ -5,20 +5,20 @@ export interface PopsInstConfig {
5
5
  /** 固定id */
6
6
  guid: string;
7
7
  /** 动画元素 */
8
- animElement: HTMLDivElement;
8
+ $anim: HTMLDivElement;
9
9
  /** 主元素 */
10
- popsElement: HTMLDivElement;
10
+ $pops: HTMLDivElement;
11
11
  /** 遮罩层元素 */
12
- maskElement?: HTMLDivElement;
12
+ $mask?: HTMLDivElement;
13
13
  }
14
14
  /**
15
15
  * config实例通用配置
16
16
  */
17
- export interface PopsInstCommonConfig extends PopsInstConfig {
17
+ export interface PopsInstGeneralConfig extends PopsInstConfig {
18
18
  /** shadow容器 */
19
19
  $shadowContainer: HTMLDivElement;
20
20
  /** shadow容器的shandowRoot */
21
21
  $shadowRoot: ShadowRoot | HTMLElement;
22
22
  /** 移除实例前的回调函数 */
23
- beforeRemoveCallBack?: (instCommonConfig: PopsInstCommonConfig) => void;
23
+ beforeRemoveCallBack?: (instCommonConfig: PopsInstGeneralConfig) => void;
24
24
  }
@@ -1,111 +1,66 @@
1
- import type { PopsAlertDetails } from "../components/alert/types";
2
- import type { PopsConfirmDetails } from "../components/confirm/types";
3
- import type { PopsDrawerDetails } from "../components/drawer/types";
4
- import type { PopsFolderDetails } from "../components/folder/types";
5
- import type { PopsIframeDetails } from "../components/iframe/types";
6
- import type { PopsLoadingDetails } from "../components/loading/types";
7
- import type { PopsPanelButtonDetails } from "../components/panel/types/components-button";
8
- import type { PopsPanelDeepMenuDetails } from "../components/panel/types/components-deepMenu";
9
- import type { PopsPanelDetails } from "../components/panel/types";
10
- import type { PopsPanelInputDetails } from "../components/panel/types/components-input";
11
- import type { PopsPanelOwnDetails } from "../components/panel/types/components-own";
12
- import type { PopsPanelSelectDetails } from "../components/panel/types/components-select";
13
- import type { PopsPanelSliderDetails } from "../components/panel/types/components-slider";
14
- import type { PopsPanelSwitchDetails } from "../components/panel/types/components-switch";
15
- import type { PopsPanelTextAreaDetails } from "../components/panel/types/components-textarea";
16
- import type { PopsPromptDetails } from "../components/prompt/types/index";
17
- import type { PopsRightClickMenuDetails } from "../components/rightClickMenu/types";
18
- import type { PopsToolTipDetails } from "../components/tooltip/types/index";
19
- import type { PopsSearchSuggestionDetails } from "../components/searchSuggestion/types";
1
+ import type { PopsAlertConfig } from "../components/alert/types";
2
+ import type { PopsConfirmConfig } from "../components/confirm/types";
3
+ import type { PopsDrawerConfig } from "../components/drawer/types";
4
+ import type { PopsFolderConfig } from "../components/folder/types";
5
+ import type { PopsIframeConfig } from "../components/iframe/types";
6
+ import type { PopsLoadingConfig } from "../components/loading/types";
7
+ import type { PopsPanelConfig } from "../components/panel/types";
8
+ import type { PopsPromptConfig } from "../components/prompt/types/index";
9
+ import type { PopsRightClickMenuConfig } from "../components/rightClickMenu/types";
10
+ import type { PopsToolTipConfig } from "../components/tooltip/types/index";
11
+ import type { PopsSearchSuggestionConfig } from "../components/searchSuggestion/types";
20
12
 
21
13
  export interface PopsUtilsOwnObject<V> {
22
14
  [key: string]: V | PopsUtilsOwnObject<V>;
23
15
  }
24
16
 
25
17
  /** pops所有的类型配置 11个*/
26
- export interface PopsDetails {
27
- alert: PopsAlertDetails;
28
- confirm: PopsConfirmDetails;
29
- prompt: PopsPromptDetails;
30
- loading: PopsLoadingDetails;
31
- iframe: PopsIframeDetails;
32
- tooltip: PopsToolTipDetails;
33
- drawer: PopsDrawerDetails;
34
- folder: PopsFolderDetails;
35
- panel: PopsPanelDetails;
36
- rightClickMenu: PopsRightClickMenuDetails;
37
- searchSuggestion: PopsSearchSuggestionDetails;
18
+ export interface PopsConfig {
19
+ alert: PopsAlertConfig;
20
+ confirm: PopsConfirmConfig;
21
+ prompt: PopsPromptConfig;
22
+ loading: PopsLoadingConfig;
23
+ iframe: PopsIframeConfig;
24
+ tooltip: PopsToolTipConfig;
25
+ drawer: PopsDrawerConfig;
26
+ folder: PopsFolderConfig;
27
+ panel: PopsPanelConfig;
28
+ rightClickMenu: PopsRightClickMenuConfig;
29
+ searchSuggestion: PopsSearchSuggestionConfig;
38
30
  }
39
31
 
40
32
  /** pops的类型 */
41
- export type PopsType = keyof PopsDetails;
33
+ export type PopsType = keyof PopsConfig;
42
34
 
43
35
  /** pops中支持only的配置 */
44
- export type PopsSupportOnlyDetails = Omit<PopsDetails, "searchSuggestion">;
36
+ export type PopsSupportOnlyConfig = Omit<PopsConfig, "searchSuggestion">;
45
37
 
46
38
  /** 存储实例的类型 */
47
- export type PopsInstStoreType = keyof Omit<PopsDetails, "searchSuggestion">;
39
+ export type PopsInstStoreType = keyof Omit<PopsConfig, "searchSuggestion">;
48
40
 
49
41
  /** pops弹窗支持动画元素的配置 8个 */
50
- export type PopsSupportAnimDetails = Omit<PopsDetails, "tooltip" | "rightClickMenu" | "searchSuggestion">;
42
+ export type PopsSupportAnimConfig = Omit<PopsConfig, "tooltip" | "rightClickMenu" | "searchSuggestion">;
51
43
 
52
44
  /** pops弹窗支持动画元素的类型 */
53
- export type PopsSupportAnimDetailsType = keyof PopsSupportAnimDetails;
45
+ export type PopsSupportAnimConfigType = keyof PopsSupportAnimConfig;
54
46
 
55
47
  /** pops弹窗支持标题栏的配置 */
56
- export type PopsSupportHeaderTitleDetails = Pick<
57
- PopsDetails,
48
+ export type PopsSupportHeaderTitleConfig = Pick<
49
+ PopsConfig,
58
50
  "alert" | "confirm" | "prompt" | "iframe" | "drawer" | "folder" | "panel"
59
51
  >;
60
52
 
61
53
  /** pops弹窗支持标题栏的类型 */
62
- export type PopsSupportHeaderTitleDetailsType = keyof PopsSupportHeaderTitleDetails;
54
+ export type PopsSupportHeaderTitleConfigType = keyof PopsSupportHeaderTitleConfig;
63
55
 
64
56
  /** pops支持底部按钮的配置 */
65
- export type PopsSupportBottomBtnDetails = Pick<PopsDetails, "alert" | "confirm" | "prompt" | "drawer">;
57
+ export type PopsSupportBottomButtonConfig = Pick<PopsConfig, "alert" | "confirm" | "prompt" | "drawer">;
66
58
 
67
59
  /** pops支持底部按钮的类型 */
68
- export type PopsSupportBottomBtnDetailsType = keyof PopsSupportHeaderTitleDetails;
60
+ export type PopsSupportBottomButtonConfigType = keyof PopsSupportHeaderTitleConfig;
69
61
 
70
62
  /** pops支持中间内容的配置 */
71
- export type PopsSupportContentDetails = Pick<PopsDetails, "alert" | "confirm" | "prompt" | "drawer" | "loading">;
63
+ export type PopsSupportContentConfig = Pick<PopsConfig, "alert" | "confirm" | "prompt" | "drawer" | "loading">;
72
64
 
73
65
  /** pops支持中间内容的类型 */
74
- export type PopsSupportContentDetailsType = keyof PopsSupportContentDetails;
75
-
76
- /** panel的各种类型的配置项 */
77
- export type PopsPanelFormsTotalDetails =
78
- | PopsPanelSwitchDetails
79
- | PopsPanelSliderDetails
80
- | PopsPanelInputDetails
81
- | PopsPanelTextAreaDetails
82
- | PopsPanelSelectDetails<any>
83
- | PopsPanelButtonDetails
84
- | PopsPanelDeepMenuDetails
85
- | PopsPanelOwnDetails;
86
-
87
- /**
88
- * pops.xxx的调用返回值
89
- */
90
- export interface PopsCallResult {
91
- /** 唯一标识id */
92
- guid: string;
93
- /** 影子元素 */
94
- $shadowContainer: HTMLDivElement;
95
- /** 影子元素的根节点 */
96
- $shadowRoot: ShadowRoot | HTMLElement;
97
- /** 元素 */
98
- element: HTMLDivElement;
99
- /** 动画层元素 */
100
- animElement: HTMLDivElement;
101
- /** pops元素 */
102
- popsElement: HTMLDivElement;
103
- /** 遮罩层元素 */
104
- maskElement?: HTMLDivElement;
105
- /** 关闭弹窗 */
106
- close(): void;
107
- /** 隐藏弹窗 */
108
- hide(): void;
109
- /** 显示弹窗 */
110
- show(): void;
111
- }
66
+ export type PopsSupportContentConfigType = keyof PopsSupportContentConfig;
@@ -1,20 +1,23 @@
1
- import type { PopsAlertDetails } from "../components/alert/types";
2
- import type { PopsDrawerDetails } from "../components/drawer/types";
3
- import type { PopsFolderDetails } from "../components/folder/types";
4
- import type { PopsIframeDetails } from "../components/iframe/types";
5
- import type { PopsLoadingDetails } from "../components/loading/types";
6
- import type { PopsPanelDetails } from "../components/panel/types";
7
- import type { PopsPromptDetails } from "../components/prompt/types/index";
1
+ import type { PopsAlertConfig } from "../components/alert/types";
2
+ import type { PopsDrawerConfig } from "../components/drawer/types";
3
+ import type { PopsFolderConfig } from "../components/folder/types";
4
+ import type { PopsIframeConfig } from "../components/iframe/types";
5
+ import type { PopsLoadingConfig } from "../components/loading/types";
6
+ import type { PopsPanelConfig } from "../components/panel/types";
7
+ import type { PopsPromptConfig } from "../components/prompt/types/index";
8
8
 
9
9
  /**
10
10
  * 遮罩层配置
11
11
  */
12
- export interface PopsMaskDetails {
12
+ export interface PopsMaskConfig {
13
13
  /**
14
14
  * 是否启用遮罩层,默认false
15
15
  * @default false
16
16
  */
17
17
  enable?: boolean;
18
+ /**
19
+ * 点击事件
20
+ */
18
21
  clickEvent?: {
19
22
  /**
20
23
  * 点击遮罩层是否触发关闭事件
@@ -36,13 +39,13 @@ export interface PopsMaskDetails {
36
39
  | ((
37
40
  originalRun: () => void | Promise<void>,
38
41
  config:
39
- | PopsAlertDetails
40
- | PopsDrawerDetails
41
- | PopsIframeDetails
42
- | PopsPromptDetails
43
- | PopsFolderDetails
44
- | PopsLoadingDetails
45
- | PopsPanelDetails
42
+ | PopsAlertConfig
43
+ | PopsDrawerConfig
44
+ | PopsIframeConfig
45
+ | PopsPromptConfig
46
+ | PopsFolderConfig
47
+ | PopsLoadingConfig
48
+ | PopsPanelConfig
46
49
  ) => void)
47
50
  | undefined
48
51
  | null;