@whitesev/pops 2.1.3 → 2.1.5

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 (134) hide show
  1. package/dist/index.amd.js +253 -227
  2. package/dist/index.amd.js.map +1 -1
  3. package/dist/index.cjs.js +253 -227
  4. package/dist/index.cjs.js.map +1 -1
  5. package/dist/index.esm.js +253 -227
  6. package/dist/index.esm.js.map +1 -1
  7. package/dist/index.iife.js +253 -227
  8. package/dist/index.iife.js.map +1 -1
  9. package/dist/index.system.js +253 -227
  10. package/dist/index.system.js.map +1 -1
  11. package/dist/index.umd.js +253 -227
  12. package/dist/index.umd.js.map +1 -1
  13. package/dist/types/src/GlobalConfig.d.ts +7 -2
  14. package/dist/types/src/Pops.d.ts +61 -39
  15. package/dist/types/src/{Core.d.ts → PopsCore.d.ts} +4 -3
  16. package/dist/types/src/PopsIcon.d.ts +30 -2
  17. package/dist/types/src/PopsLayer.d.ts +3 -1
  18. package/dist/types/src/components/alert/config.d.ts +1 -1
  19. package/dist/types/src/components/alert/index.d.ts +1 -1
  20. package/dist/types/src/components/alert/{indexType.d.ts → types/index.d.ts} +2 -2
  21. package/dist/types/src/components/confirm/config.d.ts +1 -1
  22. package/dist/types/src/components/confirm/index.d.ts +1 -1
  23. package/dist/types/src/components/confirm/{indexType.d.ts → types/index.d.ts} +1 -1
  24. package/dist/types/src/components/drawer/config.d.ts +1 -1
  25. package/dist/types/src/components/drawer/index.d.ts +1 -1
  26. package/dist/types/src/components/drawer/{indexType.d.ts → types/index.d.ts} +1 -1
  27. package/dist/types/src/components/folder/config.d.ts +1 -1
  28. package/dist/types/src/components/folder/index.d.ts +1 -1
  29. package/dist/types/src/components/folder/{indexType.d.ts → types/index.d.ts} +1 -1
  30. package/dist/types/src/components/iframe/config.d.ts +1 -1
  31. package/dist/types/src/components/iframe/index.d.ts +1 -1
  32. package/dist/types/src/components/iframe/{indexType.d.ts → types/index.d.ts} +2 -2
  33. package/dist/types/src/components/loading/config.d.ts +1 -1
  34. package/dist/types/src/components/loading/index.d.ts +1 -1
  35. package/dist/types/src/components/loading/{indexType.d.ts → types/index.d.ts} +1 -1
  36. package/dist/types/src/components/panel/config.d.ts +1 -1
  37. package/dist/types/src/components/panel/{PanelHandleContentDetails.d.ts → handlerComponents.d.ts} +39 -28
  38. package/dist/types/src/components/panel/index.d.ts +16 -2
  39. package/dist/types/src/components/panel/{buttonType.d.ts → types/components-button.d.ts} +3 -3
  40. package/dist/types/src/components/panel/{commonType.d.ts → types/components-common.d.ts} +2 -2
  41. package/dist/types/src/components/panel/{deepMenuType.d.ts → types/components-deepMenu.d.ts} +3 -3
  42. package/dist/types/src/components/panel/{formsType.d.ts → types/components-forms.d.ts} +2 -2
  43. package/dist/types/src/components/panel/{inputType.d.ts → types/components-input.d.ts} +1 -1
  44. package/dist/types/src/components/panel/{ownType.d.ts → types/components-own.d.ts} +1 -1
  45. package/dist/types/src/components/panel/{selectType.d.ts → types/components-select.d.ts} +3 -3
  46. package/dist/types/src/components/panel/{selectMultipleType.d.ts → types/components-selectMultiple.d.ts} +2 -2
  47. package/dist/types/src/components/panel/{sliderType.d.ts → types/components-slider.d.ts} +1 -1
  48. package/dist/types/src/components/panel/{switchType.d.ts → types/components-switch.d.ts} +1 -1
  49. package/dist/types/src/components/panel/{textareaType.d.ts → types/components-textarea.d.ts} +1 -1
  50. package/dist/types/src/components/panel/{indexType.d.ts → types/index.d.ts} +26 -12
  51. package/dist/types/src/components/prompt/config.d.ts +1 -1
  52. package/dist/types/src/components/prompt/index.d.ts +1 -1
  53. package/dist/types/src/components/prompt/{indexType.d.ts → types/index.d.ts} +1 -1
  54. package/dist/types/src/components/rightClickMenu/config.d.ts +1 -1
  55. package/dist/types/src/components/rightClickMenu/index.d.ts +2 -2
  56. package/dist/types/src/components/rightClickMenu/{indexType.d.ts → types/index.d.ts} +2 -2
  57. package/dist/types/src/components/searchSuggestion/config.d.ts +1 -1
  58. package/dist/types/src/components/searchSuggestion/index.d.ts +2 -2
  59. package/dist/types/src/components/searchSuggestion/{indexType.d.ts → types/index.d.ts} +1 -1
  60. package/dist/types/src/components/tooltip/config.d.ts +1 -1
  61. package/dist/types/src/components/tooltip/index.d.ts +2 -2
  62. package/dist/types/src/components/tooltip/{indexType.d.ts → types/index.d.ts} +1 -1
  63. package/dist/types/src/handler/PopsHandler.d.ts +8 -8
  64. package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +1 -1
  65. package/dist/types/src/types/button.d.ts +3 -2
  66. package/dist/types/src/types/event.d.ts +4 -3
  67. package/dist/types/src/types/global.d.ts +4 -4
  68. package/dist/types/src/types/main.d.ts +18 -10
  69. package/dist/types/src/types/mask.d.ts +8 -0
  70. package/dist/types/src/{Config.d.ts → utils/PopsDOMUtilsEventsConfig.d.ts} +3 -0
  71. package/dist/types/src/utils/PopsInstanceUtils.d.ts +8 -8
  72. package/package.json +9 -10
  73. package/src/GlobalConfig.ts +6 -5
  74. package/src/Pops.ts +17 -17
  75. package/src/{Core.ts → PopsCore.ts} +13 -14
  76. package/src/PopsIcon.ts +34 -32
  77. package/src/PopsLayer.ts +8 -7
  78. package/src/components/alert/config.ts +1 -1
  79. package/src/components/alert/index.ts +1 -1
  80. package/src/components/alert/{indexType.ts → types/index.ts} +2 -2
  81. package/src/components/confirm/config.ts +1 -1
  82. package/src/components/confirm/index.ts +1 -1
  83. package/src/components/confirm/{indexType.ts → types/index.ts} +1 -1
  84. package/src/components/drawer/config.ts +1 -1
  85. package/src/components/drawer/index.ts +1 -1
  86. package/src/components/drawer/{indexType.ts → types/index.ts} +1 -1
  87. package/src/components/folder/config.ts +1 -1
  88. package/src/components/folder/index.ts +1 -1
  89. package/src/components/folder/{indexType.ts → types/index.ts} +1 -1
  90. package/src/components/iframe/config.ts +1 -1
  91. package/src/components/iframe/index.ts +4 -4
  92. package/src/components/iframe/{indexType.ts → types/index.ts} +2 -2
  93. package/src/components/loading/config.ts +1 -1
  94. package/src/components/loading/index.ts +1 -1
  95. package/src/components/loading/{indexType.ts → types/index.ts} +1 -1
  96. package/src/components/panel/config.ts +1 -1
  97. package/src/components/panel/{PanelHandleContentDetails.ts → handlerComponents.ts} +287 -258
  98. package/src/components/panel/index.ts +23 -5
  99. package/src/components/panel/{buttonType.ts → types/components-button.ts} +5 -4
  100. package/src/components/panel/{commonType.ts → types/components-common.ts} +2 -2
  101. package/src/components/panel/{deepMenuType.ts → types/components-deepMenu.ts} +3 -3
  102. package/src/components/panel/{formsType.ts → types/components-forms.ts} +2 -2
  103. package/src/components/panel/{inputType.ts → types/components-input.ts} +1 -1
  104. package/src/components/panel/{ownType.ts → types/components-own.ts} +1 -1
  105. package/src/components/panel/{selectType.ts → types/components-select.ts} +3 -3
  106. package/src/components/panel/{selectMultipleType.ts → types/components-selectMultiple.ts} +2 -2
  107. package/src/components/panel/{sliderType.ts → types/components-slider.ts} +1 -1
  108. package/src/components/panel/{switchType.ts → types/components-switch.ts} +1 -1
  109. package/src/components/panel/{textareaType.ts → types/components-textarea.ts} +1 -1
  110. package/src/components/panel/{indexType.ts → types/index.ts} +28 -12
  111. package/src/components/prompt/config.ts +1 -1
  112. package/src/components/prompt/index.ts +1 -1
  113. package/src/components/prompt/{indexType.ts → types/index.ts} +1 -1
  114. package/src/components/rightClickMenu/config.ts +1 -1
  115. package/src/components/rightClickMenu/index.ts +2 -2
  116. package/src/components/rightClickMenu/{indexType.ts → types/index.ts} +2 -2
  117. package/src/components/searchSuggestion/config.ts +1 -1
  118. package/src/components/searchSuggestion/index.ts +1 -1
  119. package/src/components/searchSuggestion/{indexType.ts → types/index.ts} +1 -1
  120. package/src/components/tooltip/config.ts +1 -1
  121. package/src/components/tooltip/index.ts +1 -1
  122. package/src/components/tooltip/{indexType.ts → types/index.ts} +1 -1
  123. package/src/handler/PopsElementHandler.ts +3 -3
  124. package/src/handler/PopsHandler.ts +26 -26
  125. package/src/types/PopsDOMUtilsEventType.d.ts +1 -1
  126. package/src/types/button.d.ts +3 -2
  127. package/src/types/event.d.ts +4 -3
  128. package/src/types/global.d.ts +4 -4
  129. package/src/types/main.d.ts +18 -10
  130. package/src/types/mask.d.ts +8 -0
  131. package/src/utils/PopsDOMUtils.ts +2 -2
  132. package/src/{Config.ts → utils/PopsDOMUtilsEventsConfig.ts} +3 -0
  133. package/src/utils/PopsInstanceUtils.ts +12 -12
  134. package/src/utils/PopsUtils.ts +2 -5
@@ -1,6 +1,6 @@
1
- import type { PopsPanelCommonDetails } from "./commonType";
2
- import type { PopsPanelFormsDetails } from "./formsType";
3
- import type { PopsPanelFormsTotalDetails } from "./indexType";
1
+ import type { PopsPanelCommonDetails } from "./components-common";
2
+ import type { PopsPanelFormsDetails } from "./components-forms";
3
+ import type { PopsPanelFormsTotalDetails } from ".";
4
4
  /**
5
5
  * pops.panel的 select
6
6
  */
@@ -1,5 +1,5 @@
1
- import type { PopsAlertDetails } from "../alert/indexType";
2
- import type { PopsPanelCommonDetails } from "./commonType";
1
+ import type { PopsAlertDetails } from "../../alert/types";
2
+ import type { PopsPanelCommonDetails } from "./components-common";
3
3
  export interface PopsPanelSelectMultipleDataOption<T> {
4
4
  /**
5
5
  * 真正的值
@@ -1,4 +1,4 @@
1
- import type { PopsPanelCommonDetails } from "./commonType";
1
+ import type { PopsPanelCommonDetails } from "./components-common";
2
2
  /**
3
3
  * pops.panel的 slider
4
4
  */
@@ -1,4 +1,4 @@
1
- import type { PopsPanelCommonDetails } from "./commonType";
1
+ import type { PopsPanelCommonDetails } from "./components-common";
2
2
  /**
3
3
  * pops.panel的 switch
4
4
  */
@@ -1,4 +1,4 @@
1
- import type { PopsPanelCommonDetails } from "./commonType";
1
+ import type { PopsPanelCommonDetails } from "./components-common";
2
2
  /**
3
3
  * pops.panel的 textarea
4
4
  */
@@ -1,17 +1,31 @@
1
- import type { PopsTitleConfig, PopsDragConfig, PopsCommonConfig } from "../../types/components";
2
- import type { PopsPanelFormsDetails } from "./formsType";
3
- import type { PopsPanelSwitchDetails } from "./switchType";
4
- import type { PopsPanelSliderDetails } from "./sliderType";
5
- import type { PopsPanelInputDetails } from "./inputType";
6
- import type { PopsPanelTextAreaDetails } from "./textareaType";
7
- import type { PopsPanelSelectDetails } from "./selectType";
8
- import type { PopsPanelButtonDetails } from "./buttonType";
9
- import type { PopsPanelDeepMenuDetails } from "./deepMenuType";
10
- import type { PopsPanelOwnDetails } from "./ownType";
11
- import type { PopsHeaderCloseButtonDetails } from "../../types/button";
12
- import { PopsPanelSelectMultipleDetails } from "./selectMultipleType";
1
+ import type { PopsTitleConfig, PopsDragConfig, PopsCommonConfig } from "../../../types/components";
2
+ import type { PopsPanelFormsDetails } from "./components-forms";
3
+ import type { PopsPanelSwitchDetails } from "./components-switch";
4
+ import type { PopsPanelSliderDetails } from "./components-slider";
5
+ import type { PopsPanelInputDetails } from "./components-input";
6
+ import type { PopsPanelTextAreaDetails } from "./components-textarea";
7
+ import type { PopsPanelSelectDetails } from "./components-select";
8
+ import type { PopsPanelButtonDetails } from "./components-button";
9
+ import type { PopsPanelDeepMenuDetails } from "./components-deepMenu";
10
+ import type { PopsPanelOwnDetails } from "./components-own";
11
+ import type { PopsHeaderCloseButtonDetails } from "../../../types/button";
12
+ import { PopsPanelSelectMultipleDetails } from "./components-selectMultiple";
13
13
  /** panel的各种类型的配置项 */
14
14
  export type PopsPanelFormsTotalDetails = PopsPanelSwitchDetails | PopsPanelSliderDetails | PopsPanelInputDetails | PopsPanelTextAreaDetails | PopsPanelSelectDetails<any> | PopsPanelSelectMultipleDetails<any> | PopsPanelButtonDetails | PopsPanelDeepMenuDetails | PopsPanelOwnDetails;
15
+ /**
16
+ * panel的内部事件
17
+ */
18
+ export type PopsPanelEventType = {
19
+ /**
20
+ * 该事件在右侧容器内的元素改变时触发
21
+ */
22
+ "pops:renderRightContainer": {
23
+ /**
24
+ * 菜单配置
25
+ */
26
+ formConfig: PopsPanelContentConfig[] | PopsPanelDeepMenuDetails;
27
+ };
28
+ };
15
29
  /**
16
30
  * pops.panel的content配置信息
17
31
  */
@@ -1,2 +1,2 @@
1
- import type { PopsPromptDetails } from "./indexType";
1
+ import type { PopsPromptDetails } from "./types/index";
2
2
  export declare const PopsPromptConfig: () => DeepRequired<PopsPromptDetails>;
@@ -1,4 +1,4 @@
1
- import type { PopsPromptDetails } from "./indexType";
1
+ import type { PopsPromptDetails } from "./types/index";
2
2
  export declare const PopsPrompt: {
3
3
  init(details: PopsPromptDetails): Omit<import("../../types/event").PopsEventDetails, "function" | "type">;
4
4
  };
@@ -1,4 +1,4 @@
1
- import type { PopsTitleConfig, PopsDragConfig, PopsCommonConfig, PopsMoreButtonConfig } from "../../types/components";
1
+ import type { PopsTitleConfig, PopsDragConfig, PopsCommonConfig, PopsMoreButtonConfig } from "../../../types/components";
2
2
  /**
3
3
  * pops.prompt
4
4
  */
@@ -1,2 +1,2 @@
1
- import type { PopsRightClickMenuDetails } from "./indexType";
1
+ import type { PopsRightClickMenuDetails } from "./types";
2
2
  export declare const rightClickMenuConfig: () => DeepRequired<PopsRightClickMenuDetails>;
@@ -1,9 +1,9 @@
1
- import type { PopsRightClickMenuDetails } from "./indexType";
1
+ import type { PopsRightClickMenuDetails } from "./types";
2
2
  export declare const PopsRightClickMenu: {
3
3
  init(details: PopsRightClickMenuDetails): {
4
4
  guid: string;
5
5
  config: {
6
- target: Node | HTMLElement | {
6
+ target: HTMLElement | Node | {
7
7
  addEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean) => void;
8
8
  dispatchEvent: (event: Event) => boolean;
9
9
  removeEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean) => void;
@@ -1,5 +1,5 @@
1
- import type { PopsCommonConfig } from "../../types/components";
2
- import type { PopsIconType } from "../../types/icon";
1
+ import type { PopsCommonConfig } from "../../../types/components";
2
+ import type { PopsIconType } from "../../../types/icon";
3
3
  /**
4
4
  * pops.rightClickMenu的右键菜单配置
5
5
  */
@@ -1,2 +1,2 @@
1
- import type { PopsSearchSuggestionDetails } from "./indexType";
1
+ import type { PopsSearchSuggestionDetails } from "./types/index";
2
2
  export declare const searchSuggestionConfig: () => DeepRequired<PopsSearchSuggestionDetails>;
@@ -1,10 +1,10 @@
1
- import type { PopsSearchSuggestionDetails } from "./indexType";
1
+ import type { PopsSearchSuggestionDetails } from "./types/index";
2
2
  export declare const PopsSearchSuggestion: {
3
3
  init(details: PopsSearchSuggestionDetails): {
4
4
  /**
5
5
  * 当前的环境,可以是document,可以是shadowroot,默认是document
6
6
  */
7
- selfDocument: Document | ShadowRoot | (Document | ShadowRoot)[];
7
+ selfDocument: ShadowRoot | Document | (ShadowRoot | Document)[];
8
8
  $el: {
9
9
  /** 根元素 */
10
10
  root: HTMLElement;
@@ -1,4 +1,4 @@
1
- import type { PopsCommonConfig } from "../../types/components";
1
+ import type { PopsCommonConfig } from "../../../types/components";
2
2
  /**
3
3
  * 搜索建议悬浮窗
4
4
  * pops.searchSuggestion
@@ -1,2 +1,2 @@
1
- import type { PopsToolTipDetails } from "./indexType";
1
+ import type { PopsToolTipDetails } from "./types/index";
2
2
  export declare const PopsTooltipConfig: () => DeepRequired<PopsToolTipDetails>;
@@ -1,4 +1,4 @@
1
- import type { PopsToolTipDetails } from "./indexType";
1
+ import type { PopsToolTipDetails } from "./types/index";
2
2
  type ToolTipEventTypeName = "MouseEvent" | "TouchEvent";
3
3
  export declare class ToolTip {
4
4
  $el: {
@@ -185,7 +185,7 @@ export declare const PopsTooltip: {
185
185
  target: HTMLElement;
186
186
  content: string | (() => string);
187
187
  isDiffContent: boolean;
188
- position: import("./indexType").PopsTooltipPosition;
188
+ position: import("./types/index").PopsTooltipPosition;
189
189
  className: string;
190
190
  isFixed: boolean;
191
191
  alwaysShow: boolean;
@@ -1,4 +1,4 @@
1
- import type { PopsCommonConfig } from "../../types/components";
1
+ import type { PopsCommonConfig } from "../../../types/components";
2
2
  /** tooltip的出现位置 */
3
3
  export type PopsTooltipPosition = "top" | "right" | "bottom" | "left" | "follow";
4
4
  /**
@@ -1,11 +1,11 @@
1
- import type { PopsAlertDetails } from "../components/alert/indexType";
2
- import type { PopsConfirmDetails } from "../components/confirm/indexType";
3
- import type { PopsDrawerDetails } from "../components/drawer/indexType";
4
- import type { PopsFolderDetails } from "../components/folder/indexType";
5
- import type { PopsIframeDetails } from "../components/iframe/indexType";
6
- import type { PopsLoadingDetails } from "../components/loading/indexType";
7
- import type { PopsPanelDetails } from "../components/panel/indexType";
8
- import type { PopsPromptDetails } from "../components/prompt/indexType";
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
9
  import type { PopsCommonConfig } from "../types/components";
10
10
  import { PopsEventDetails, PopsHandlerEventDetails } from "../types/event";
11
11
  import { PopsLayerCommonConfig } from "../types/layer";
@@ -213,7 +213,7 @@ export declare interface PopsDOMUtilsEventListenerOptionsAttribute {
213
213
  /**
214
214
  * 属性配置
215
215
  */
216
- option: DOMUtilsEventListenerOption;
216
+ option: PopsDOMUtilsEventListenerOption;
217
217
  /**
218
218
  * 用户添加的事件
219
219
  */
@@ -1,5 +1,6 @@
1
1
  import { PopsEventDetails, PopsHandlerEventDetails } from "./event";
2
2
  import type { PopsIconType } from "./icon";
3
+ import type { PopsMode } from "./main";
3
4
 
4
5
  /**
5
6
  * 按钮类型
@@ -105,7 +106,7 @@ export interface PopsButtonDetails<T = {}> {
105
106
  text: string;
106
107
  /**
107
108
  * 按钮点击的回调
108
- *
109
+ *
109
110
  * 如果传入该值,那么将不会自动关闭弹窗
110
111
  */
111
112
  callback(
@@ -151,7 +152,7 @@ export interface PopsButtonDetailsAnyType<T = {}> {
151
152
  text: string;
152
153
  /**
153
154
  * 按钮点击的回调
154
- *
155
+ *
155
156
  * 如果传入该值,那么将不会自动关闭弹窗
156
157
  */
157
158
  callback(
@@ -1,4 +1,5 @@
1
- import type { PopsIframeDetails } from "../components/iframe/indexType";
1
+ import type { PopsIframeDetails } from "../components/iframe/types";
2
+ import type { PopsMode } from "./main";
2
3
 
3
4
  /**
4
5
  * 事件配置
@@ -46,8 +47,8 @@ export interface PopsEventDetails {
46
47
  /** 遮罩层 */
47
48
  maskElement?: HTMLDivElement;
48
49
  /** 当前弹窗类型 */
49
- mode: mode;
50
- guid: guid;
50
+ mode: PopsMode;
51
+ guid: string;
51
52
  close: () => Promise<void>;
52
53
  hide: () => Promise<void>;
53
54
  show: () => Promise<void>;
@@ -1,15 +1,15 @@
1
- declare var unsafeWindow: Window & typeof globalThis;
2
-
3
1
  declare module "*.css" {
4
2
  const content: string;
5
3
  export default content;
6
4
  }
7
-
8
5
  declare module "*.svg" {
9
6
  const content: string;
10
7
  export default content;
11
8
  }
12
- type DeepRequired<T> = T extends Function
9
+
10
+ declare var unsafeWindow: Window & typeof globalThis;
11
+
12
+ declare type DeepRequired<T> = T extends Function
13
13
  ? T
14
14
  : T extends object
15
15
  ? T extends Node
@@ -1,13 +1,21 @@
1
- import type { PopsAlertDetails } from "../components/alert/indexType";
2
- import type { PopsConfirmDetails } from "../components/confirm/indexType";
3
- import type { PopsDrawerDetails } from "../components/drawer/indexType";
4
- import type { PopsFolderDetails } from "../components/folder/indexType";
5
- import type { PopsIframeDetails } from "../components/iframe/indexType";
6
- import type { PopsLoadingDetails } from "../components/loading/indexType";
7
- import type { PopsPanelDetails } from "../components/panel/indexType";
8
- import type { PopsPromptDetails } from "../components/prompt/indexType";
9
- import { PopsRightClickMenuDetails } from "../components/rightClickMenu/indexType";
10
- import { PopsToolTipDetails } from "../components/tooltip/indexType";
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 { PopsRightClickMenuDetails } from "../components/rightClickMenu/types";
18
+ import { PopsToolTipDetails } from "../components/tooltip/types/index";
11
19
 
12
20
  export interface PopsUtilsOwnObject<V extends any> {
13
21
  [key: string]: V | PopsUtilsOwnObject<V>;
@@ -1,3 +1,11 @@
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";
8
+
1
9
  /**
2
10
  * 遮罩层配置
3
11
  */
@@ -1 +1,4 @@
1
+ /**
2
+ * 存储在元素属性上的事件名
3
+ */
1
4
  export declare const SymbolEvents: unique symbol;
@@ -1,11 +1,11 @@
1
- import type { PopsAlertDetails } from "../components/alert/indexType";
2
- import type { PopsConfirmDetails } from "../components/confirm/indexType";
3
- import type { PopsDrawerDetails } from "../components/drawer/indexType";
4
- import type { PopsFolderDetails } from "../components/folder/indexType";
5
- import type { PopsIframeDetails } from "../components/iframe/indexType";
6
- import type { PopsLoadingDetails } from "../components/loading/indexType";
7
- import type { PopsPanelDetails } from "../components/panel/indexType";
8
- import type { PopsPromptDetails } from "../components/prompt/indexType";
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
9
  import type { PopsLayerCommonConfig } from "../types/layer";
10
10
  import type { PopsLayerMode } from "../types/main";
11
11
  export declare const PopsInstanceUtils: {
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
+ "$schema": "https://json.schemastore.org/package.json",
2
3
  "name": "@whitesev/pops",
3
- "version": "2.1.3",
4
+ "version": "2.1.5",
5
+ "type": "module",
4
6
  "description": "弹窗库",
5
- "$schema": "https://json.schemastore.org/package.json",
6
7
  "main": "dist/index.cjs.js",
7
8
  "module": "dist/index.esm.js",
8
9
  "types": "dist/types/index.d.ts",
@@ -35,18 +36,16 @@
35
36
  "author": "WhiteSev",
36
37
  "license": "MIT",
37
38
  "dependencies": {
38
- "@rollup/plugin-commonjs": "^25.0.8",
39
- "@rollup/plugin-node-resolve": "^15.3.1",
40
- "@rollup/plugin-typescript": "^11.1.6",
41
39
  "any-touch": "^2.2.0",
42
- "rollup-plugin-clear": "^2.0.7",
43
- "tslib": "^2.8.1",
44
40
  "worker-timers": "^8.0.21"
45
41
  },
46
42
  "devDependencies": {
47
- "rollup-plugin-import-css": "^3.5.8",
48
- "rollup-plugin-livereload": "^2.0.5",
49
- "rollup-plugin-serve": "^1.1.1",
43
+ "@rollup/plugin-commonjs": "^28.0.6",
44
+ "@rollup/plugin-node-resolve": "^16.0.1",
45
+ "@rollup/plugin-typescript": "^12.1.2",
46
+ "rollup-plugin-clear": "^2.0.7",
47
+ "rollup-plugin-import-css": "^4.0.1",
48
+ "tslib": "^2.8.1",
50
49
  "typescript": "^5.8.3"
51
50
  },
52
51
  "scripts": {
@@ -1,17 +1,19 @@
1
- import type { PopsCommonConfig } from "./types/components";
1
+ import type { PopsCommonConfig, PopsDragConfig } from "./types/components";
2
2
 
3
3
  type EnterReturnType<T> = null | T | (() => T);
4
4
 
5
5
  type GlobalConfigOption = {
6
6
  style?: EnterReturnType<string>;
7
7
  zIndex?: EnterReturnType<number> | EnterReturnType<string>;
8
- } & Partial<PopsCommonConfig>;
8
+ } & Partial<PopsCommonConfig> &
9
+ Partial<PopsDragConfig>;
9
10
 
10
11
  type ResultGlobalConfigOption<T> = T extends null | undefined
11
12
  ? never
12
13
  : T extends (...args: any) => infer R
13
14
  ? R
14
15
  : T;
16
+
15
17
  export const GlobalConfig = {
16
18
  config: {} as GlobalConfigOption,
17
19
  /**
@@ -39,8 +41,7 @@ export const GlobalConfig = {
39
41
  configValue == null
40
42
  ? ""
41
43
  : typeof configValue === "function"
42
- ? // @ts-ignore
43
- configValue()
44
+ ? configValue()
44
45
  : configValue;
45
46
 
46
47
  if (typeof style === "string") {
@@ -55,7 +56,7 @@ export const GlobalConfig = {
55
56
  ? configValue()
56
57
  : configValue;
57
58
  if (typeof zIndex === "string") {
58
- let newIndex = (zIndex = parseInt(zIndex));
59
+ let newIndex = (zIndex = Number(zIndex));
59
60
  if (!isNaN(newIndex)) {
60
61
  result.zIndex = newIndex;
61
62
  }
package/src/Pops.ts CHANGED
@@ -1,49 +1,49 @@
1
1
  import { popsDOMUtils } from "./utils/PopsDOMUtils";
2
2
  import { PopsInstanceUtils } from "./utils/PopsInstanceUtils";
3
3
  import { popsUtils } from "./utils/PopsUtils";
4
- import { PopsCore } from "./Core";
4
+ import { PopsCore } from "./PopsCore";
5
5
  import { PopsAlert } from "./components/alert";
6
- import type { PopsAlertDetails } from "./components/alert/indexType";
6
+ import type { PopsAlertDetails } from "./components/alert/types";
7
7
  import { PopsConfirm } from "./components/confirm";
8
- import type { PopsConfirmDetails } from "./components/confirm/indexType";
9
- import type { PopsPromptDetails } from "./components/prompt/indexType";
8
+ import type { PopsConfirmDetails } from "./components/confirm/types";
9
+ import type { PopsPromptDetails } from "./components/prompt/types/index";
10
10
  import { PopsPrompt } from "./components/prompt";
11
- import type { PopsLoadingDetails } from "./components/loading/indexType";
11
+ import type { PopsLoadingDetails } from "./components/loading/types";
12
12
  import { PopsLoading } from "./components/loading";
13
- import type { PopsIframeDetails } from "./components/iframe/indexType";
13
+ import type { PopsIframeDetails } from "./components/iframe/types";
14
14
  import { PopsIframe } from "./components/iframe";
15
- import type { PopsToolTipDetails } from "./components/tooltip/indexType";
15
+ import type { PopsToolTipDetails } from "./components/tooltip/types/index";
16
16
  import { PopsDrawer } from "./components/drawer";
17
- import type { PopsDrawerDetails } from "./components/drawer/indexType";
18
- import type { PopsFolderDetails } from "./components/folder/indexType";
17
+ import type { PopsDrawerDetails } from "./components/drawer/types";
18
+ import type { PopsFolderDetails } from "./components/folder/types";
19
19
  import { PopsFolder } from "./components/folder";
20
- import type { PopsPanelDetails } from "./components/panel/indexType";
20
+ import type { PopsPanelDetails } from "./components/panel/types";
21
21
  import { PopsPanel } from "./components/panel";
22
22
  import { PopsRightClickMenu } from "./components/rightClickMenu";
23
- import type { PopsRightClickMenuDetails } from "./components/rightClickMenu/indexType";
24
- import type { PopsSearchSuggestionDetails } from "./components/searchSuggestion/indexType";
23
+ import type { PopsRightClickMenuDetails } from "./components/rightClickMenu/types";
24
+ import type { PopsSearchSuggestionDetails } from "./components/searchSuggestion/types/index";
25
25
  import { PopsSearchSuggestion } from "./components/searchSuggestion";
26
26
  import { PopsMathFloatUtils } from "./utils/PopsMathUtils";
27
- import { PanelHandleContentDetails } from "./components/panel/PanelHandleContentDetails";
27
+ import { PanelHandlerComponents } from "./components/panel/handlerComponents";
28
28
  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 { PopsLayer } from "./PopsLayer";
32
+ import { PopsLayerData } from "./PopsLayer";
33
33
  import { PopsAnimation } from "./PopsAnimation";
34
34
 
35
35
  class Pops {
36
36
  /** 配置 */
37
37
  config = {
38
38
  /** 版本号 */
39
- version: "2025.6.18",
39
+ version: "2025.7.1",
40
40
  cssText: PopsCSS,
41
41
  /** icon图标的svg代码 */
42
42
  iconSVG: PopsIcon.$data,
43
43
  /** 当前已配置的动画@keyframes名字映射(初始化时生成) */
44
44
  animation: PopsAnimation.$data,
45
45
  /** 存储已创建的元素 */
46
- layer: PopsLayer,
46
+ layer: PopsLayerData,
47
47
  /** 禁止滚动 */
48
48
  forbiddenScroll: {
49
49
  event(event: Event) {
@@ -59,7 +59,7 @@ class Pops {
59
59
  /** pops处理float类型使用的工具类 */
60
60
  MathFloatUtils: PopsMathFloatUtils,
61
61
  /** pops.panel中用于处理各个类型的工具 */
62
- panelHandleContentUtils: PanelHandleContentDetails,
62
+ PanelHandlerComponents: PanelHandlerComponents,
63
63
  };
64
64
  init() {}
65
65
  /**
@@ -1,24 +1,20 @@
1
+ interface PopsCoreOption {
2
+ document: Document;
3
+ window: Window;
4
+ globalThis: typeof globalThis;
5
+ self: typeof globalThis;
6
+ }
7
+
1
8
  const PopsCoreDefaultEnv: PopsCoreOption = {
2
9
  document: document,
3
10
  window: window,
4
11
  globalThis: globalThis,
5
12
  self: self,
6
13
  };
7
- const PopsCoreEnv: PopsCoreOption = {
8
- document: document,
9
- window: window,
10
- globalThis: globalThis,
11
- self: self,
12
- };
13
14
 
14
- export interface PopsCoreOption {
15
- document: Document;
16
- window: Window;
17
- globalThis: typeof globalThis;
18
- self: typeof globalThis;
19
- }
15
+ const PopsCoreEnv: PopsCoreOption = Object.assign({}, PopsCoreDefaultEnv);
20
16
 
21
- export const PopsCore = {
17
+ const PopsCore = {
22
18
  init(option?: PopsCoreOption) {
23
19
  if (!option) {
24
20
  option = Object.assign({}, PopsCoreDefaultEnv);
@@ -38,8 +34,11 @@ export const PopsCore = {
38
34
  return PopsCoreEnv.self;
39
35
  },
40
36
  };
41
- export const OriginPrototype = {
37
+
38
+ const OriginPrototype = {
42
39
  Object: {
43
40
  defineProperty: Object.defineProperty,
44
41
  },
45
42
  };
43
+
44
+ export { PopsCoreOption, PopsCore, OriginPrototype };
package/src/PopsIcon.ts CHANGED
@@ -28,39 +28,41 @@ import SVG_keyboard from "./svg/keyboard.svg";
28
28
  import SVG_arrowRight from "./svg/arrowRight.svg";
29
29
  import SVG_arrowLeft from "./svg/arrowLeft.svg";
30
30
 
31
+ const PopsIconData: {
32
+ [key in PopsIconType]: string;
33
+ } = {
34
+ min: SVG_min,
35
+ mise: SVG_mise,
36
+ max: SVG_max,
37
+ close: SVG_close,
38
+ edit: SVG_edit,
39
+ share: SVG_share,
40
+ delete: SVG_delete,
41
+ search: SVG_search,
42
+ upload: SVG_upload,
43
+ loading: SVG_loading,
44
+ next: SVG_next,
45
+ prev: SVG_prev,
46
+ eleme: SVG_eleme,
47
+ elemePlus: SVG_elemePlus,
48
+ chromeFilled: SVG_chromeFilled,
49
+ cpu: SVG_cpu,
50
+ videoPlay: SVG_videoPlay,
51
+ videoPause: SVG_videoPause,
52
+ headset: SVG_headset,
53
+ monitor: SVG_monitor,
54
+ documentCopy: SVG_documentCopy,
55
+ picture: SVG_picture,
56
+ circleClose: SVG_circleClose,
57
+ view: SVG_view,
58
+ hide: SVG_hide,
59
+ keyboard: SVG_keyboard,
60
+ arrowRight: SVG_arrowRight,
61
+ arrowLeft: SVG_arrowLeft,
62
+ };
63
+
31
64
  export const PopsIcon = {
32
- $data: {
33
- min: SVG_min,
34
- mise: SVG_mise,
35
- max: SVG_max,
36
- close: SVG_close,
37
- edit: SVG_edit,
38
- share: SVG_share,
39
- delete: SVG_delete,
40
- search: SVG_search,
41
- upload: SVG_upload,
42
- loading: SVG_loading,
43
- next: SVG_next,
44
- prev: SVG_prev,
45
- eleme: SVG_eleme,
46
- elemePlus: SVG_elemePlus,
47
- chromeFilled: SVG_chromeFilled,
48
- cpu: SVG_cpu,
49
- videoPlay: SVG_videoPlay,
50
- videoPause: SVG_videoPause,
51
- headset: SVG_headset,
52
- monitor: SVG_monitor,
53
- documentCopy: SVG_documentCopy,
54
- picture: SVG_picture,
55
- circleClose: SVG_circleClose,
56
- view: SVG_view,
57
- hide: SVG_hide,
58
- keyboard: SVG_keyboard,
59
- arrowRight: SVG_arrowRight,
60
- arrowLeft: SVG_arrowLeft,
61
- } as {
62
- [key in PopsIconType]: string;
63
- },
65
+ $data: PopsIconData,
64
66
  /**
65
67
  * 判断是否存在某个icon
66
68
  * @param iconName 图标名