@whitesev/pops 1.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 (46) hide show
  1. package/dist/index.amd.js +4651 -0
  2. package/dist/index.amd.js.map +1 -0
  3. package/dist/index.cjs.js +4649 -0
  4. package/dist/index.cjs.js.map +1 -0
  5. package/dist/index.esm.js +4647 -0
  6. package/dist/index.esm.js.map +1 -0
  7. package/dist/index.iife.js +4652 -0
  8. package/dist/index.iife.js.map +1 -0
  9. package/dist/index.system.js +4654 -0
  10. package/dist/index.system.js.map +1 -0
  11. package/dist/index.umd.js +4655 -0
  12. package/dist/index.umd.js.map +1 -0
  13. package/dist/types/index.d.ts +2 -0
  14. package/dist/types/src/Config.d.ts +1 -0
  15. package/dist/types/src/Core.d.ts +18 -0
  16. package/dist/types/src/Pops.d.ts +171 -0
  17. package/dist/types/src/components/alert/index.d.ts +4 -0
  18. package/dist/types/src/components/confirm/index.d.ts +4 -0
  19. package/dist/types/src/components/drawer/index.d.ts +2 -0
  20. package/dist/types/src/components/folder/index.d.ts +2 -0
  21. package/dist/types/src/components/iframe/index.d.ts +2 -0
  22. package/dist/types/src/components/loading/index.d.ts +2 -0
  23. package/dist/types/src/components/panel/index.d.ts +2 -0
  24. package/dist/types/src/components/prompt/index.d.ts +2 -0
  25. package/dist/types/src/components/rightClickMenu/index.d.ts +2 -0
  26. package/dist/types/src/components/tooltip/index.d.ts +2 -0
  27. package/dist/types/src/handler/PopsElementHandler.d.ts +54 -0
  28. package/dist/types/src/handler/PopsHandler.d.ts +210 -0
  29. package/dist/types/src/utils/AnyTouch.d.ts +17 -0
  30. package/dist/types/src/utils/PopsDOMUtils.d.ts +278 -0
  31. package/dist/types/src/utils/PopsDOMUtilsEvent.d.ts +332 -0
  32. package/dist/types/src/utils/PopsMathUtils.d.ts +25 -0
  33. package/dist/types/src/utils/PopsUIUtils.d.ts +85 -0
  34. package/dist/types/src/utils/PopsUtils.d.ts +123 -0
  35. package/package.json +42 -0
  36. package/src/types/PopsDOMUtilsEventType.d.ts +248 -0
  37. package/src/types/animation.d.ts +19 -0
  38. package/src/types/button.d.ts +216 -0
  39. package/src/types/components.d.ts +197 -0
  40. package/src/types/event.d.ts +60 -0
  41. package/src/types/global.d.ts +11 -0
  42. package/src/types/icon.d.ts +30 -0
  43. package/src/types/layer.d.ts +20 -0
  44. package/src/types/main.d.ts +89 -0
  45. package/src/types/mask.d.ts +35 -0
  46. package/src/types/position.d.ts +60 -0
@@ -0,0 +1,60 @@
1
+ /**
2
+ * 事件配置
3
+ */
4
+ declare interface PopsIframeEventDetails {
5
+ /**
6
+ * 唯一id
7
+ */
8
+ guid: string;
9
+ /**
10
+ * 当前弹窗类型
11
+ */
12
+ mode: PopsMode;
13
+ /**
14
+ * 动画层
15
+ */
16
+ animElement: HTMLElement;
17
+ /**
18
+ * 主元素
19
+ */
20
+ popsElement: HTMLElement;
21
+ /**
22
+ * 遮罩层
23
+ */
24
+ maskElement: HTMLElement;
25
+ /**
26
+ * 当前配置
27
+ */
28
+ config: any;
29
+ }
30
+ /**
31
+ * 事件配置
32
+ */
33
+ declare interface PopsEventDetails {
34
+ /** 最外层包裹的元素 */
35
+ $shadowContainer: HTMLDivElement;
36
+ /** ShadowRoot */
37
+ $shadowRoot: ShadowRoot;
38
+ /** -> 动画层 */
39
+ element: HTMLDivElement;
40
+ /** 动画层 */
41
+ animElement: HTMLDivElement;
42
+ /** 主元素 */
43
+ popsElement: HTMLDivElement;
44
+ /** 遮罩层 */
45
+ maskElement?: HTMLDivElement;
46
+ /** 当前弹窗类型 */
47
+ mode: mode;
48
+ guid: guid;
49
+ close: () => void;
50
+ hide: () => void;
51
+ show: () => void;
52
+ }
53
+
54
+ /**
55
+ * 处理过的事件配置
56
+ */
57
+ declare interface PopsHandlerEventDetails extends PopsEventDetails {
58
+ /** 当前按钮类型 */
59
+ type: "cancel" | "close" | "ok" | "other";
60
+ }
@@ -0,0 +1,11 @@
1
+ declare var unsafeWindow: Window & typeof globalThis;
2
+
3
+ declare module "*.css" {
4
+ const content: string;
5
+ export default content;
6
+ }
7
+
8
+ declare module "*.svg" {
9
+ const content: string;
10
+ export default content;
11
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * 按钮svg图标
3
+ */
4
+ export type PopsIcon =
5
+ | "min"
6
+ | "mise"
7
+ | "max"
8
+ | "close"
9
+ | "edit"
10
+ | "share"
11
+ | "delete"
12
+ | "search"
13
+ | "upload"
14
+ | "loading"
15
+ | "next"
16
+ | "prev"
17
+ | "eleme"
18
+ | "elemePlus"
19
+ | "chromeFilled"
20
+ | "cpu"
21
+ | "videoPlay"
22
+ | "videoPause"
23
+ | "headset"
24
+ | "monitor"
25
+ | "documentCopy"
26
+ | "picture"
27
+ | "circleClose"
28
+ | "view"
29
+ | "hide"
30
+ | "keyboard";
@@ -0,0 +1,20 @@
1
+ /**
2
+ * config内存储饿实例配置
3
+ */
4
+ declare interface PopsLayerConfig {
5
+ /** 固定id */
6
+ guid: string;
7
+ /** 动画元素 */
8
+ animElement: HTMLDivElement;
9
+ /** 主元素 */
10
+ popsElement: HTMLDivElement;
11
+ /** 遮罩层元素 */
12
+ maskElement?: HTMLDivElement;
13
+ }
14
+
15
+ declare interface PopsLayerCommonConfig extends PopsLayerConfig {
16
+ /** shadow容器 */
17
+ $shadowContainer: HTMLDivElement;
18
+ /** shadow容器的shandowRoot */
19
+ $shadowRoot: ShadowRoot;
20
+ }
@@ -0,0 +1,89 @@
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";
9
+
10
+ declare interface PopsUtilsOwnObject<V extends any> {
11
+ [key: string]: V | PopsUtilsOwnObject<V>;
12
+ }
13
+
14
+ /** pops的类型 8个 */
15
+ declare type PopsType =
16
+ | "alert"
17
+ | "confirm"
18
+ | "prompt"
19
+ | "loading"
20
+ | "iframe"
21
+ // | "tooltip"
22
+ | "drawer"
23
+ | "folder"
24
+ | "panel";
25
+ // | "rightClickMenu";
26
+
27
+ /** pops所有的类型 10个 */
28
+ declare type PopsMode = PopsType | "tooltip" | "rightClickMenu";
29
+
30
+ /** 存储实例的类型 9个 */
31
+ declare type PopsLayerMode = PopsType | "tooltip";
32
+
33
+ /** pops弹窗支持动画元素的配置 */
34
+ declare interface PopsSupportAnim {
35
+ alert: PopsAlertDetails;
36
+ confirm: PopsConfirmDetails;
37
+ prompt: PopsPromptDetails;
38
+ loading: PopsLoadingDetails;
39
+ iframe: PopsIframeDetails;
40
+ drawer: PopsDrawerDetails;
41
+ folder: PopsFolderDetails;
42
+ panel: PopsPanelDetails;
43
+ }
44
+ /** pops弹窗支持动画元素的类型 */
45
+ declare type PopsTypeSupportAnim = keyof PopsSupportAnim;
46
+
47
+ /** pops弹窗支持标题栏的配置 */
48
+ declare interface PopsSupportHeaderTitle {
49
+ alert: PopsAlertDetails;
50
+ confirm: PopsConfirmDetails;
51
+ prompt: PopsPromptDetails;
52
+ iframe: PopsIframeDetails;
53
+ drawer: PopsDrawerDetails;
54
+ folder: PopsFolderDetails;
55
+ panel: PopsPanelDetails;
56
+ }
57
+ /** pops弹窗支持标题栏的类型 */
58
+ declare type PopsTypeSupportHeaderTitle = keyof PopsSupportHeaderTitle;
59
+
60
+ /** pops支持底部按钮的配置 */
61
+ declare interface PopsSupportBottomBtn {
62
+ alert: PopsAlertDetails;
63
+ confirm: PopsConfirmDetails;
64
+ prompt: PopsPromptDetails;
65
+ drawer: PopsDrawerDetails;
66
+ }
67
+ /** pops支持底部按钮的类型 */
68
+ declare type PopsTypeSupportBottomBtn = keyof PopsSupportHeaderTitle;
69
+
70
+ /** pops支持中间内容的配置 */
71
+ declare interface PopsSupportContent {
72
+ alert: PopsAlertDetails;
73
+ confirm: PopsConfirmDetails;
74
+ prompt: PopsPromptDetails;
75
+ drawer: PopsDrawerDetails;
76
+ }
77
+ /** pops支持中间内容的类型 */
78
+ declare type PopsTypeSupportContent = keyof PopsSupportHeaderTitle;
79
+
80
+ /** panel的各种类型的配置项 */
81
+ declare type PopsPanelFormsTotalDetails =
82
+ | PopsPanelSwitchDetails
83
+ | PopsPanelSliderDetails
84
+ | PopsPanelInputDetails
85
+ | PopsPanelTextAreaDetails
86
+ | PopsPanelSelectDetails<any>
87
+ | PopsPanelButtonDetails
88
+ | PopsPanelDeepMenuDetails
89
+ | PopsPanelOwnDetails;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * 遮罩层配置
3
+ */
4
+ declare interface PopsMaskDetails {
5
+ /**
6
+ * 是否启用遮罩层,默认false
7
+ */
8
+ enable?: boolean;
9
+ clickEvent?: {
10
+ /**
11
+ * 点击遮罩层是否触发关闭事件
12
+ */
13
+ toClose?: boolean;
14
+ /**
15
+ * 点击遮罩层是否触发隐藏事件
16
+ */
17
+ toHide?: boolean;
18
+ };
19
+ /**
20
+ * 遮罩层自定义的点击事件
21
+ * @param originalRun 当toClose为true,它是关闭弹窗,当toHide为true,它是隐藏弹窗
22
+ * @param config 配置信息
23
+ */
24
+ clickCallBack?: (
25
+ originalRun: (originalRun: Function) => void,
26
+ config:
27
+ | PopsAlertDetails
28
+ | PopsDrawerDetails
29
+ | PopsIframeDetails
30
+ | PopsPromptDetails
31
+ | PopsFolderDetails
32
+ | PopsLoadingDetails
33
+ | PopsPanelDetails
34
+ ) => void;
35
+ }
@@ -0,0 +1,60 @@
1
+ /**
2
+ * 弹窗位置
3
+ */
4
+ declare type PopsPosition =
5
+ | "top_left"
6
+ | "top"
7
+ | "top_right"
8
+ | "center_left"
9
+ | "center"
10
+ | "center_right"
11
+ | "bottom_left"
12
+ | "bottom"
13
+ | "bottom_right";
14
+
15
+ /**
16
+ * 按钮位置
17
+ */
18
+ declare type PopsJustifyContent =
19
+ | "center"
20
+ | "end"
21
+ | "flex-end"
22
+ | "flex-start"
23
+ | "left"
24
+ | "normal"
25
+ | "right"
26
+ | "space-around"
27
+ | "space-between"
28
+ | "space-evenly"
29
+ | "start"
30
+ | "stretch"
31
+ | "inherit"
32
+ | "initial"
33
+ | "revert"
34
+ | "revert-layer"
35
+ | "unset";
36
+
37
+ /**
38
+ * text-align
39
+ */
40
+ declare type PopsTextAlign =
41
+ | "center"
42
+ | "end"
43
+ | "justify"
44
+ | "left"
45
+ | "right"
46
+ | "start"
47
+ | "-webkit-auto"
48
+ | "-moz-center-or-inherit"
49
+ | "-webkit-center"
50
+ | "-moz-center"
51
+ | "-webkit-left"
52
+ | "-moz-left"
53
+ | "-webkit-match-parent"
54
+ | "-webkit-right"
55
+ | "-moz-right"
56
+ | "inherit"
57
+ | "initial"
58
+ | "revert"
59
+ | "revert-layer"
60
+ | "unset";