@whitesev/pops 2.2.0 → 2.2.1

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 (38) hide show
  1. package/dist/index.amd.js +108 -100
  2. package/dist/index.amd.js.map +1 -1
  3. package/dist/index.cjs.js +108 -100
  4. package/dist/index.cjs.js.map +1 -1
  5. package/dist/index.esm.js +108 -100
  6. package/dist/index.esm.js.map +1 -1
  7. package/dist/index.iife.js +108 -100
  8. package/dist/index.iife.js.map +1 -1
  9. package/dist/index.system.js +108 -100
  10. package/dist/index.system.js.map +1 -1
  11. package/dist/index.umd.js +108 -100
  12. package/dist/index.umd.js.map +1 -1
  13. package/dist/types/src/Pops.d.ts +16 -16
  14. package/dist/types/src/PopsInst.d.ts +8 -0
  15. package/dist/types/src/components/panel/index.d.ts +1 -1
  16. package/dist/types/src/handler/PopsElementHandler.d.ts +2 -2
  17. package/dist/types/src/handler/PopsHandler.d.ts +6 -6
  18. package/dist/types/src/types/button.d.ts +2 -2
  19. package/dist/types/src/types/event.d.ts +3 -3
  20. package/dist/types/src/types/{layer.d.ts → inst.d.ts} +7 -5
  21. package/dist/types/src/types/main.d.ts +8 -33
  22. package/dist/types/src/utils/PopsInstanceUtils.d.ts +10 -10
  23. package/package.json +1 -1
  24. package/src/Pops.ts +2 -2
  25. package/src/PopsInst.ts +21 -0
  26. package/src/components/alert/index.ts +2 -2
  27. package/src/components/iframe/index.ts +2 -2
  28. package/src/components/rightClickMenu/index.ts +2 -2
  29. package/src/css/scrollbar.css +9 -5
  30. package/src/handler/PopsElementHandler.ts +2 -2
  31. package/src/handler/PopsHandler.ts +30 -30
  32. package/src/types/button.d.ts +2 -2
  33. package/src/types/event.d.ts +3 -3
  34. package/src/types/{layer.d.ts → inst.d.ts} +7 -5
  35. package/src/types/main.d.ts +8 -33
  36. package/src/utils/PopsInstanceUtils.ts +84 -81
  37. package/dist/types/src/PopsLayer.d.ts +0 -5
  38. package/src/PopsLayer.ts +0 -18
@@ -68,17 +68,17 @@ declare class Pops {
68
68
  [key: string]: CSSKeyframesRule;
69
69
  };
70
70
  /** 存储已创建的元素 */
71
- layer: {
72
- iframe: import("./types/layer").PopsLayerCommonConfig[];
73
- loading: import("./types/layer").PopsLayerCommonConfig[];
74
- folder: import("./types/layer").PopsLayerCommonConfig[];
75
- alert: import("./types/layer").PopsLayerCommonConfig[];
76
- confirm: import("./types/layer").PopsLayerCommonConfig[];
77
- prompt: import("./types/layer").PopsLayerCommonConfig[];
78
- drawer: import("./types/layer").PopsLayerCommonConfig[];
79
- panel: import("./types/layer").PopsLayerCommonConfig[];
80
- tooltip: import("./types/layer").PopsLayerCommonConfig[];
81
- rightClickMenu: import("./types/layer").PopsLayerCommonConfig[];
71
+ instData: {
72
+ iframe: import("./types/inst").PopsInstCommonConfig[];
73
+ loading: import("./types/inst").PopsInstCommonConfig[];
74
+ folder: import("./types/inst").PopsInstCommonConfig[];
75
+ alert: import("./types/inst").PopsInstCommonConfig[];
76
+ confirm: import("./types/inst").PopsInstCommonConfig[];
77
+ prompt: import("./types/inst").PopsInstCommonConfig[];
78
+ tooltip: import("./types/inst").PopsInstCommonConfig[];
79
+ drawer: import("./types/inst").PopsInstCommonConfig[];
80
+ panel: import("./types/inst").PopsInstCommonConfig[];
81
+ rightClickMenu: import("./types/inst").PopsInstCommonConfig[];
82
82
  };
83
83
  /** 禁止滚动 */
84
84
  forbiddenScroll: {
@@ -189,10 +189,10 @@ declare class Pops {
189
189
  isOverMaxZIndex: boolean;
190
190
  };
191
191
  getMaxZIndex(deviation?: number): number;
192
- removeInstance(moreLayerConfigList: import("./types/layer").PopsLayerCommonConfig[][], guid: string, isAll?: boolean): import("./types/layer").PopsLayerCommonConfig[][];
193
- hide(popsType: import("./types/main").PopsLayerMode, layerConfigList: import("./types/layer").PopsLayerCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement, maskElement: HTMLElement): Promise<void>;
194
- show(popsType: import("./types/main").PopsLayerMode, layerConfigList: import("./types/layer").PopsLayerCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement, maskElement?: HTMLElement): Promise<void>;
195
- close(popsType: string, layerConfigList: import("./types/layer").PopsLayerCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement): Promise<void>;
192
+ removeInstance(instConfigList: import("./types/inst").PopsInstCommonConfig[][], guid: string, isAll?: boolean): import("./types/inst").PopsInstCommonConfig[][];
193
+ hide(popsType: import("./types/main").PopsInstStoreType, instConfigList: import("./types/inst").PopsInstCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement, maskElement: HTMLElement): Promise<void>;
194
+ show(popsType: import("./types/main").PopsInstStoreType, instConfigList: import("./types/inst").PopsInstCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement, maskElement?: HTMLElement): Promise<void>;
195
+ close(popsType: string, instConfigList: import("./types/inst").PopsInstCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement): Promise<void>;
196
196
  drag(moveElement: HTMLElement, options: {
197
197
  dragElement: HTMLElement;
198
198
  limit: boolean;
@@ -409,7 +409,7 @@ declare class Pops {
409
409
  animElement: HTMLDivElement;
410
410
  popsElement: HTMLDivElement;
411
411
  maskElement?: HTMLDivElement | undefined;
412
- mode: import("./types/main").PopsMode;
412
+ mode: import("./types/main").PopsType;
413
413
  };
414
414
  /**
415
415
  * 右键菜单
@@ -0,0 +1,8 @@
1
+ import type { PopsInstCommonConfig } from "./types/inst";
2
+ import type { PopsInstStoreType } from "./types/main";
3
+ /**
4
+ * 弹窗实例数据
5
+ */
6
+ export declare const PopsInstData: {
7
+ [key in PopsInstStoreType]: PopsInstCommonConfig[];
8
+ };
@@ -13,6 +13,6 @@ export declare const PopsPanel: {
13
13
  animElement: HTMLDivElement;
14
14
  popsElement: HTMLDivElement;
15
15
  maskElement?: HTMLDivElement | undefined;
16
- mode: import("../../types/main").PopsMode;
16
+ mode: import("../../types/main").PopsType;
17
17
  };
18
18
  };
@@ -1,4 +1,4 @@
1
- import type { PopsSupportAnim, PopsSupportBottomBtn, PopsSupportContent, PopsSupportHeaderTitle, PopsTypeSupportAnim, PopsTypeSupportBottomBtn, PopsTypeSupportContent, PopsTypeSupportHeaderTitle } from "../types/main";
1
+ import type { PopsSupportAnim, PopsSupportBottomBtn, PopsSupportContent, PopsSupportHeaderTitle, PopsSupportAnimType, PopsTypeSupportBottomBtn, PopsTypeSupportContent, PopsTypeSupportHeaderTitle } from "../types/main";
2
2
  export declare const PopsElementHandler: {
3
3
  /**
4
4
  * 获取遮罩层HTML
@@ -16,7 +16,7 @@ export declare const PopsElementHandler: {
16
16
  * @param bottomBtnHTML
17
17
  * @param zIndex
18
18
  */
19
- getAnimHTML(guid: string, type: PopsTypeSupportAnim, config: PopsSupportAnim[keyof PopsSupportAnim], html: string | undefined, bottomBtnHTML: string | undefined, zIndex: number): string;
19
+ getAnimHTML(guid: string, type: PopsSupportAnimType, config: PopsSupportAnim[keyof PopsSupportAnim], html: string | undefined, bottomBtnHTML: string | undefined, zIndex: number): string;
20
20
  /**
21
21
  * 获取顶部按钮层HTML
22
22
  * @param type
@@ -8,8 +8,8 @@ import type { PopsPanelDetails } from "../components/panel/types";
8
8
  import type { PopsPromptDetails } from "../components/prompt/types/index";
9
9
  import type { PopsCommonConfig } from "../types/components";
10
10
  import { PopsEventDetails, PopsHandlerEventDetails } from "../types/event";
11
- import { PopsLayerCommonConfig } from "../types/layer";
12
- import type { PopsAllDetails, PopsLayerMode, PopsMode, PopsType } from "../types/main";
11
+ import { PopsInstCommonConfig } from "../types/inst";
12
+ import type { PopsDetails, PopsInstStoreType, PopsType, PopsSupportAnimType } from "../types/main";
13
13
  export declare const PopsHandler: {
14
14
  /**
15
15
  * 创建shadow
@@ -50,7 +50,7 @@ export declare const PopsHandler: {
50
50
  * @param animElement
51
51
  * @param type
52
52
  */
53
- handleQueryElement(animElement: HTMLDivElement, type: PopsType): {
53
+ handleQueryElement(animElement: HTMLDivElement, type: PopsSupportAnimType): {
54
54
  /**
55
55
  * 主元素
56
56
  */
@@ -163,7 +163,7 @@ export declare const PopsHandler: {
163
163
  * @param maskElement 遮罩层
164
164
  * @param config 当前配置
165
165
  */
166
- handleEventDetails(guid: string, $shadowContainer: HTMLDivElement, $shadowRoot: ShadowRoot | HTMLElement, mode: PopsLayerMode, animElement: HTMLDivElement, popsElement: HTMLDivElement, maskElement: HTMLDivElement, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails): PopsEventDetails;
166
+ handleEventDetails(guid: string, $shadowContainer: HTMLDivElement, $shadowRoot: ShadowRoot | HTMLElement, mode: PopsInstStoreType, animElement: HTMLDivElement, popsElement: HTMLDivElement, maskElement: HTMLDivElement, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails): PopsEventDetails;
167
167
  /**
168
168
  * 获取loading的事件配置
169
169
  * @param guid
@@ -217,11 +217,11 @@ export declare const PopsHandler: {
217
217
  * @param type 当前弹窗类型
218
218
  * @param config 配置
219
219
  */
220
- handleOnly<T extends Required<PopsAllDetails[keyof PopsAllDetails]>>(type: PopsMode, config: T): T;
220
+ handleOnly<T extends Required<PopsDetails[keyof PopsDetails]>>(type: PopsType, config: T): T;
221
221
  /**
222
222
  * 处理把已创建的元素保存到内部环境中
223
223
  * @param type 当前弹窗类型
224
224
  * @param value
225
225
  */
226
- handlePush(type: PopsLayerMode, value: PopsLayerCommonConfig): void;
226
+ handlePush(type: PopsInstStoreType, value: PopsInstCommonConfig): void;
227
227
  };
@@ -1,6 +1,6 @@
1
1
  import { PopsEventDetails, PopsHandlerEventDetails } from "./event";
2
2
  import type { PopsIconType } from "./icon";
3
- import type { PopsMode } from "./main";
3
+ import type { PopsType } from "./main";
4
4
 
5
5
  /**
6
6
  * 按钮类型
@@ -51,7 +51,7 @@ export interface PopsBtnCallBackEvent {
51
51
  /**
52
52
  * 调用的方法
53
53
  */
54
- mode: PopsMode;
54
+ mode: PopsType;
55
55
  /**
56
56
  * 唯一id
57
57
  */
@@ -1,5 +1,5 @@
1
1
  import type { PopsIframeDetails } from "../components/iframe/types";
2
- import type { PopsMode } from "./main";
2
+ import type { PopsType } from "./main";
3
3
 
4
4
  /**
5
5
  * 事件配置
@@ -12,7 +12,7 @@ export interface PopsIframeEventDetails {
12
12
  /**
13
13
  * 当前弹窗类型
14
14
  */
15
- mode: PopsMode;
15
+ mode: PopsType;
16
16
  /**
17
17
  * 动画层
18
18
  */
@@ -47,7 +47,7 @@ export interface PopsEventDetails {
47
47
  /** 遮罩层 */
48
48
  maskElement?: HTMLDivElement;
49
49
  /** 当前弹窗类型 */
50
- mode: PopsMode;
50
+ mode: PopsType;
51
51
  guid: string;
52
52
  close: () => Promise<void>;
53
53
  hide: () => Promise<void>;
@@ -1,7 +1,7 @@
1
1
  /**
2
- * config内存储饿实例配置
2
+ * config实例配置
3
3
  */
4
- export interface PopsLayerConfig {
4
+ export interface PopsInstConfig {
5
5
  /** 固定id */
6
6
  guid: string;
7
7
  /** 动画元素 */
@@ -11,12 +11,14 @@ export interface PopsLayerConfig {
11
11
  /** 遮罩层元素 */
12
12
  maskElement?: HTMLDivElement;
13
13
  }
14
-
15
- export interface PopsLayerCommonConfig extends PopsLayerConfig {
14
+ /**
15
+ * config实例通用配置
16
+ */
17
+ export interface PopsInstCommonConfig extends PopsInstConfig {
16
18
  /** shadow容器 */
17
19
  $shadowContainer: HTMLDivElement;
18
20
  /** shadow容器的shandowRoot */
19
21
  $shadowRoot: ShadowRoot | HTMLElement;
20
22
  /** 移除实例前的回调函数 */
21
- beforeRemoveCallBack?: (layerCommonConfig: PopsLayerCommonConfig) => void;
23
+ beforeRemoveCallBack?: (instCommonConfig: PopsInstCommonConfig) => void;
22
24
  }
@@ -22,7 +22,7 @@ export interface PopsUtilsOwnObject<V extends any> {
22
22
  }
23
23
 
24
24
  /** pops的所有类型配置 10个 */
25
- export interface PopsAllDetails {
25
+ export interface PopsDetails {
26
26
  alert: PopsAlertDetails;
27
27
  confirm: PopsConfirmDetails;
28
28
  prompt: PopsPromptDetails;
@@ -35,42 +35,17 @@ export interface PopsAllDetails {
35
35
  rightClickMenu: PopsRightClickMenuDetails;
36
36
  }
37
37
 
38
- /** pops的类型配置 8个 */
39
- export interface PopsTypeDetails {
40
- alert: PopsAlertDetails;
41
- confirm: PopsConfirmDetails;
42
- prompt: PopsPromptDetails;
43
- loading: PopsLoadingDetails;
44
- iframe: PopsIframeDetails;
45
- // tooltip: PopsToolTipDetails;
46
- drawer: PopsDrawerDetails;
47
- folder: PopsFolderDetails;
48
- panel: PopsPanelDetails;
49
- // rightClickMenu: PopsRightClickMenuDetails;
50
- }
51
-
52
- /** pops的类型 8个 */
53
- export type PopsType = keyof PopsTypeDetails;
54
-
55
38
  /** pops所有的类型 10个 */
56
- export type PopsMode = PopsType | "tooltip" | "rightClickMenu";
39
+ export type PopsType = keyof PopsDetails;
57
40
 
58
- /** 存储实例的类型 9个 */
59
- export type PopsLayerMode = PopsType | "tooltip" | "rightClickMenu";
41
+ /** 存储实例的类型 10个 */
42
+ export type PopsInstStoreType = PopsType;
43
+
44
+ /** pops弹窗支持动画元素的配置 8个 */
45
+ export type PopsSupportAnim = Omit<PopsDetails, "tooltip" | "rightClickMenu">;
60
46
 
61
- /** pops弹窗支持动画元素的配置 */
62
- export interface PopsSupportAnim {
63
- alert: PopsAlertDetails;
64
- confirm: PopsConfirmDetails;
65
- prompt: PopsPromptDetails;
66
- loading: PopsLoadingDetails;
67
- iframe: PopsIframeDetails;
68
- drawer: PopsDrawerDetails;
69
- folder: PopsFolderDetails;
70
- panel: PopsPanelDetails;
71
- }
72
47
  /** pops弹窗支持动画元素的类型 */
73
- export type PopsTypeSupportAnim = keyof PopsSupportAnim;
48
+ export type PopsSupportAnimType = keyof PopsSupportAnim;
74
49
 
75
50
  /** pops弹窗支持标题栏的配置 */
76
51
  export interface PopsSupportHeaderTitle {
@@ -6,8 +6,8 @@ import type { PopsIframeDetails } from "../components/iframe/types";
6
6
  import type { PopsLoadingDetails } from "../components/loading/types";
7
7
  import type { PopsPanelDetails } from "../components/panel/types";
8
8
  import type { PopsPromptDetails } from "../components/prompt/types/index";
9
- import type { PopsLayerCommonConfig } from "../types/layer";
10
- import type { PopsLayerMode } from "../types/main";
9
+ import type { PopsInstCommonConfig } from "../types/inst";
10
+ import type { PopsInstStoreType } from "../types/main";
11
11
  export declare const PopsInstanceUtils: {
12
12
  /**
13
13
  * 获取页面中最大的z-index的元素信息
@@ -44,40 +44,40 @@ export declare const PopsInstanceUtils: {
44
44
  getMaxZIndex(deviation?: number): number;
45
45
  /**
46
46
  * 删除配置中对应的对象
47
- * @param moreLayerConfigList 配置实例列表
47
+ * @param instConfigList 配置实例列表
48
48
  * @param guid 唯一标识
49
49
  * @param isAll 是否全部删除
50
50
  */
51
- removeInstance(moreLayerConfigList: PopsLayerCommonConfig[][], guid: string, isAll?: boolean): PopsLayerCommonConfig[][];
51
+ removeInstance(instConfigList: PopsInstCommonConfig[][], guid: string, isAll?: boolean): PopsInstCommonConfig[][];
52
52
  /**
53
53
  * 隐藏
54
54
  * @param popsType
55
- * @param layerConfigList
55
+ * @param instConfigList
56
56
  * @param guid
57
57
  * @param config
58
58
  * @param animElement
59
59
  * @param maskElement
60
60
  */
61
- hide(popsType: PopsLayerMode, layerConfigList: PopsLayerCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement, maskElement: HTMLElement): Promise<void>;
61
+ hide(popsType: PopsInstStoreType, instConfigList: PopsInstCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement, maskElement: HTMLElement): Promise<void>;
62
62
  /**
63
63
  * 显示
64
64
  * @param popsType
65
- * @param layerConfigList
65
+ * @param instConfigList
66
66
  * @param guid
67
67
  * @param config
68
68
  * @param animElement
69
69
  * @param maskElement
70
70
  */
71
- show(popsType: PopsLayerMode, layerConfigList: PopsLayerCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement, maskElement?: HTMLElement): Promise<void>;
71
+ show(popsType: PopsInstStoreType, instConfigList: PopsInstCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement, maskElement?: HTMLElement): Promise<void>;
72
72
  /**
73
73
  * 关闭
74
74
  * @param popsType
75
- * @param layerConfigList
75
+ * @param instConfigList
76
76
  * @param guid
77
77
  * @param config
78
78
  * @param animElement
79
79
  */
80
- close(popsType: string, layerConfigList: PopsLayerCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement): Promise<void>;
80
+ close(popsType: string, instConfigList: PopsInstCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement): Promise<void>;
81
81
  /**
82
82
  * 拖拽元素
83
83
  * 说明:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whitesev/pops",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "type": "module",
5
5
  "description": "弹窗库",
6
6
  "main": "dist/index.cjs.js",
package/src/Pops.ts CHANGED
@@ -29,7 +29,7 @@ import { GlobalConfig } from "./GlobalConfig";
29
29
  import { PopsTooltip } from "./components/tooltip";
30
30
  import { PopsCSS } from "./PopsCSS";
31
31
  import { PopsIcon } from "./PopsIcon";
32
- import { PopsLayerData } from "./PopsLayer";
32
+ import { PopsInstData } from "./PopsInst";
33
33
  import { PopsAnimation } from "./PopsAnimation";
34
34
 
35
35
  class Pops {
@@ -43,7 +43,7 @@ class Pops {
43
43
  /** 当前已配置的动画@keyframes名字映射(初始化时生成) */
44
44
  animation: PopsAnimation.$data,
45
45
  /** 存储已创建的元素 */
46
- layer: PopsLayerData,
46
+ instData: PopsInstData,
47
47
  /** 禁止滚动 */
48
48
  forbiddenScroll: {
49
49
  event(event: Event) {
@@ -0,0 +1,21 @@
1
+ import type { PopsInstCommonConfig } from "./types/inst";
2
+ import type { PopsInstStoreType } from "./types/main";
3
+
4
+ /**
5
+ * 弹窗实例数据
6
+ */
7
+ export const PopsInstData: {
8
+ [key in PopsInstStoreType]: PopsInstCommonConfig[];
9
+ } = {
10
+ alert: [],
11
+ confirm: [],
12
+ drawer: [],
13
+ folder: [],
14
+ iframe: [],
15
+ loading: [],
16
+ panel: [],
17
+ prompt: [],
18
+ rightClickMenu: [],
19
+ // 没有 searchSuggestion
20
+ tooltip: [],
21
+ };
@@ -5,7 +5,7 @@ import { popsDOMUtils } from "../../utils/PopsDOMUtils";
5
5
  import { PopsInstanceUtils } from "../../utils/PopsInstanceUtils";
6
6
  import { popsUtils } from "../../utils/PopsUtils";
7
7
  import { PopsAlertConfig } from "./config";
8
- import type { PopsMode } from "../../types/main";
8
+ import type { PopsType } from "../../types/main";
9
9
  import type { PopsAlertDetails } from "./types";
10
10
  import { PopsCSS } from "../../PopsCSS";
11
11
 
@@ -13,7 +13,7 @@ export const PopsAlert = {
13
13
  init(details: PopsAlertDetails) {
14
14
  const guid = popsUtils.getRandomGUID();
15
15
  // 设置当前类型
16
- const PopsType: PopsMode = "alert";
16
+ const PopsType: PopsType = "alert";
17
17
  let config = PopsAlertConfig();
18
18
  config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
19
19
  config = popsUtils.assign(config, details);
@@ -3,7 +3,7 @@ import { GlobalConfig } from "../../GlobalConfig";
3
3
  import { PopsElementHandler } from "../../handler/PopsElementHandler";
4
4
  import { PopsHandler } from "../../handler/PopsHandler";
5
5
  import { PopsCSS } from "../../PopsCSS";
6
- import { PopsLayerData } from "../../PopsLayer";
6
+ import { PopsInstData } from "../../PopsInst";
7
7
  import type { PopsEventDetails } from "../../types/event";
8
8
  import { popsDOMUtils } from "../../utils/PopsDOMUtils";
9
9
  import { PopsInstanceUtils } from "../../utils/PopsInstanceUtils";
@@ -323,7 +323,7 @@ export const PopsIframe = {
323
323
  (event) => {
324
324
  event.preventDefault();
325
325
  event.stopPropagation();
326
- PopsInstanceUtils.removeInstance([PopsLayerData.iframe], guid, false);
326
+ PopsInstanceUtils.removeInstance([PopsInstData.iframe], guid, false);
327
327
  if (typeof config?.btn?.close?.callback === "function") {
328
328
  config.btn.close.callback(eventDetails, event);
329
329
  }
@@ -184,8 +184,8 @@ export const PopsRightClickMenu = {
184
184
  guid: guid,
185
185
  animElement: rootElement,
186
186
  popsElement: rootElement,
187
- beforeRemoveCallBack(layerCommonConfig) {
188
- PopsContextMenu.closeAllMenu(layerCommonConfig.popsElement);
187
+ beforeRemoveCallBack(instCommonConfig) {
188
+ PopsContextMenu.closeAllMenu(instCommonConfig.popsElement);
189
189
  },
190
190
  });
191
191
  }
@@ -1,18 +1,22 @@
1
- /* firefox上暂不支持::-webkit-scrollbar */
1
+ /* ::-webkit-scrollbar 是非标准的css */
2
+ /* https://caniuse.com/?search=%20%3A%3A-webkit-scrollbar */
2
3
  .pops ::-webkit-scrollbar {
3
4
  width: 6px;
4
5
  height: 0;
5
6
  }
6
7
 
8
+ /* 滚动条轨道 */
7
9
  .pops ::-webkit-scrollbar-track {
8
10
  width: 0;
9
11
  }
10
- .pops ::-webkit-scrollbar-thumb:hover {
11
- background: rgb(178, 178, 178, var(--pops-bg-opacity));
12
- }
12
+ /* 滚动条滑块 */
13
13
  .pops ::-webkit-scrollbar-thumb {
14
14
  min-height: 28px;
15
15
  border-radius: 2em;
16
- background: rgb(204, 204, 204, var(--pops-bg-opacity));
16
+ background: rgb(204, 204, 204, var(--pops-bg-opacity, 1));
17
17
  background-clip: padding-box;
18
18
  }
19
+ /* 滚动条滑块 */
20
+ .pops ::-webkit-scrollbar-thumb:hover {
21
+ background: rgb(178, 178, 178, var(--pops-bg-opacity, 1));
22
+ }
@@ -7,7 +7,7 @@ import type {
7
7
  PopsSupportBottomBtn,
8
8
  PopsSupportContent,
9
9
  PopsSupportHeaderTitle,
10
- PopsTypeSupportAnim,
10
+ PopsSupportAnimType,
11
11
  PopsTypeSupportBottomBtn,
12
12
  PopsTypeSupportContent,
13
13
  PopsTypeSupportHeaderTitle,
@@ -40,7 +40,7 @@ export const PopsElementHandler = {
40
40
  */
41
41
  getAnimHTML(
42
42
  guid: string,
43
- type: PopsTypeSupportAnim,
43
+ type: PopsSupportAnimType,
44
44
  config: PopsSupportAnim[keyof PopsSupportAnim],
45
45
  html = "",
46
46
  bottomBtnHTML = "",
@@ -8,15 +8,15 @@ import type { PopsPanelDetails } from "../components/panel/types";
8
8
  import type { PopsPromptDetails } from "../components/prompt/types/index";
9
9
  import { PopsCore } from "../PopsCore";
10
10
  import { PopsAnimation } from "../PopsAnimation";
11
- import { PopsLayerData } from "../PopsLayer";
11
+ import { PopsInstData } from "../PopsInst";
12
12
  import type { PopsCommonConfig } from "../types/components";
13
13
  import { PopsEventDetails, PopsHandlerEventDetails } from "../types/event";
14
- import { PopsLayerCommonConfig } from "../types/layer";
14
+ import { PopsInstCommonConfig } from "../types/inst";
15
15
  import type {
16
- PopsAllDetails,
17
- PopsLayerMode,
18
- PopsMode,
16
+ PopsDetails,
17
+ PopsInstStoreType,
19
18
  PopsType,
19
+ PopsSupportAnimType,
20
20
  } from "../types/main";
21
21
  import { popsDOMUtils } from "../utils/PopsDOMUtils";
22
22
  import { PopsInstanceUtils } from "../utils/PopsInstanceUtils";
@@ -145,13 +145,13 @@ export const PopsHandler = {
145
145
  function clickEvent(event: MouseEvent | PointerEvent) {
146
146
  popsDOMUtils.preventEvent(event);
147
147
  // 获取该类型实例存储列表
148
- let targetLayer = PopsLayerData[details.type];
148
+ let targetInst = PopsInstData[details.type];
149
149
  function originalRun() {
150
150
  if (details.config.mask!.clickEvent!.toClose) {
151
151
  /* 关闭 */
152
152
  return PopsInstanceUtils.close(
153
153
  details.type,
154
- targetLayer,
154
+ targetInst,
155
155
  details.guid,
156
156
  details.config,
157
157
  details.animElement
@@ -160,7 +160,7 @@ export const PopsHandler = {
160
160
  /* 隐藏 */
161
161
  return PopsInstanceUtils.hide(
162
162
  details.type,
163
- targetLayer,
163
+ targetInst,
164
164
  details.guid,
165
165
  details.config,
166
166
  details.animElement,
@@ -234,7 +234,7 @@ export const PopsHandler = {
234
234
  * @param animElement
235
235
  * @param type
236
236
  */
237
- handleQueryElement(animElement: HTMLDivElement, type: PopsType) {
237
+ handleQueryElement(animElement: HTMLDivElement, type: PopsSupportAnimType) {
238
238
  return {
239
239
  /**
240
240
  * 主元素
@@ -408,7 +408,7 @@ export const PopsHandler = {
408
408
  guid: string,
409
409
  $shadowContainer: HTMLDivElement,
410
410
  $shadowRoot: ShadowRoot | HTMLElement,
411
- mode: PopsLayerMode,
411
+ mode: PopsInstStoreType,
412
412
  animElement: HTMLDivElement,
413
413
  popsElement: HTMLDivElement,
414
414
  maskElement: HTMLDivElement,
@@ -434,7 +434,7 @@ export const PopsHandler = {
434
434
  close() {
435
435
  return PopsInstanceUtils.close(
436
436
  mode,
437
- PopsLayerData[mode],
437
+ PopsInstData[mode],
438
438
  guid,
439
439
  config,
440
440
  animElement
@@ -443,7 +443,7 @@ export const PopsHandler = {
443
443
  hide() {
444
444
  return PopsInstanceUtils.hide(
445
445
  mode,
446
- PopsLayerData[mode],
446
+ PopsInstData[mode],
447
447
  guid,
448
448
  config,
449
449
  animElement,
@@ -453,7 +453,7 @@ export const PopsHandler = {
453
453
  show() {
454
454
  return PopsInstanceUtils.show(
455
455
  mode,
456
- PopsLayerData[mode],
456
+ PopsInstData[mode],
457
457
  guid,
458
458
  config,
459
459
  animElement,
@@ -497,7 +497,7 @@ export const PopsHandler = {
497
497
  close() {
498
498
  return PopsInstanceUtils.close(
499
499
  mode,
500
- PopsLayerData[mode],
500
+ PopsInstData[mode],
501
501
  guid,
502
502
  config,
503
503
  animElement
@@ -506,7 +506,7 @@ export const PopsHandler = {
506
506
  hide() {
507
507
  return PopsInstanceUtils.hide(
508
508
  mode,
509
- PopsLayerData[mode],
509
+ PopsInstData[mode],
510
510
  guid,
511
511
  config,
512
512
  animElement,
@@ -516,7 +516,7 @@ export const PopsHandler = {
516
516
  show() {
517
517
  return PopsInstanceUtils.show(
518
518
  mode,
519
- PopsLayerData[mode],
519
+ PopsInstData[mode],
520
520
  guid,
521
521
  config,
522
522
  animElement,
@@ -660,8 +660,8 @@ export const PopsHandler = {
660
660
  * @param type 当前弹窗类型
661
661
  * @param config 配置
662
662
  */
663
- handleOnly<T extends Required<PopsAllDetails[keyof PopsAllDetails]>>(
664
- type: PopsMode,
663
+ handleOnly<T extends Required<PopsDetails[keyof PopsDetails]>>(
664
+ type: PopsType,
665
665
  config: T
666
666
  ): T {
667
667
  if (config.only) {
@@ -670,20 +670,20 @@ export const PopsHandler = {
670
670
  type === "tooltip" ||
671
671
  type === "rightClickMenu"
672
672
  ) {
673
- let layer = PopsLayerData[type as keyof typeof PopsLayerData];
674
- if (layer) {
675
- PopsInstanceUtils.removeInstance([layer], "", true);
673
+ let inst = PopsInstData[type as keyof typeof PopsInstData];
674
+ if (inst) {
675
+ PopsInstanceUtils.removeInstance([inst], "", true);
676
676
  }
677
677
  } else {
678
678
  PopsInstanceUtils.removeInstance(
679
679
  [
680
- PopsLayerData.alert,
681
- PopsLayerData.confirm,
682
- PopsLayerData.prompt,
683
- PopsLayerData.iframe,
684
- PopsLayerData.drawer,
685
- PopsLayerData.folder,
686
- PopsLayerData.panel,
680
+ PopsInstData.alert,
681
+ PopsInstData.confirm,
682
+ PopsInstData.prompt,
683
+ PopsInstData.iframe,
684
+ PopsInstData.drawer,
685
+ PopsInstData.folder,
686
+ PopsInstData.panel,
687
687
  ],
688
688
  "",
689
689
  true
@@ -707,7 +707,7 @@ export const PopsHandler = {
707
707
  * @param type 当前弹窗类型
708
708
  * @param value
709
709
  */
710
- handlePush(type: PopsLayerMode, value: PopsLayerCommonConfig) {
711
- PopsLayerData[type].push(value);
710
+ handlePush(type: PopsInstStoreType, value: PopsInstCommonConfig) {
711
+ PopsInstData[type].push(value);
712
712
  },
713
713
  };
@@ -1,6 +1,6 @@
1
1
  import { PopsEventDetails, PopsHandlerEventDetails } from "./event";
2
2
  import type { PopsIconType } from "./icon";
3
- import type { PopsMode } from "./main";
3
+ import type { PopsType } from "./main";
4
4
 
5
5
  /**
6
6
  * 按钮类型
@@ -51,7 +51,7 @@ export interface PopsBtnCallBackEvent {
51
51
  /**
52
52
  * 调用的方法
53
53
  */
54
- mode: PopsMode;
54
+ mode: PopsType;
55
55
  /**
56
56
  * 唯一id
57
57
  */