@whitesev/pops 2.2.7 → 2.2.9

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 (146) hide show
  1. package/dist/index.amd.js +2842 -3019
  2. package/dist/index.amd.js.map +1 -1
  3. package/dist/index.cjs.js +2842 -3019
  4. package/dist/index.cjs.js.map +1 -1
  5. package/dist/index.esm.js +2842 -3019
  6. package/dist/index.esm.js.map +1 -1
  7. package/dist/index.iife.js +2842 -3019
  8. package/dist/index.iife.js.map +1 -1
  9. package/dist/index.system.js +2842 -3019
  10. package/dist/index.system.js.map +1 -1
  11. package/dist/index.umd.js +2842 -3019
  12. package/dist/index.umd.js.map +1 -1
  13. package/dist/types/src/Pops.d.ts +11 -11
  14. package/dist/types/src/PopsIcon.d.ts +2 -2
  15. package/dist/types/src/components/rightClickMenu/index.d.ts +2 -2
  16. package/dist/types/src/components/tooltip/index.d.ts +2 -2
  17. package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +256 -259
  18. package/dist/types/src/types/animation.d.ts +19 -19
  19. package/dist/types/src/types/button.d.ts +187 -196
  20. package/dist/types/src/types/components.d.ts +213 -229
  21. package/dist/types/src/types/event.d.ts +63 -63
  22. package/dist/types/src/types/global.d.ts +20 -20
  23. package/dist/types/src/types/icon.d.ts +32 -32
  24. package/dist/types/src/types/inst.d.ts +24 -24
  25. package/dist/types/src/types/main.d.ts +114 -122
  26. package/dist/types/src/types/mask.d.ts +49 -49
  27. package/dist/types/src/types/position.d.ts +60 -60
  28. package/package.json +61 -56
  29. package/LICENSE +0 -674
  30. package/src/Pops.ts +0 -209
  31. package/src/PopsAnimation.ts +0 -32
  32. package/src/PopsCSS.ts +0 -51
  33. package/src/PopsCore.ts +0 -44
  34. package/src/PopsIcon.ts +0 -95
  35. package/src/PopsInst.ts +0 -21
  36. package/src/components/alert/config.ts +0 -62
  37. package/src/components/alert/index.css +0 -0
  38. package/src/components/alert/index.ts +0 -181
  39. package/src/components/alert/types/index.ts +0 -30
  40. package/src/components/confirm/config.ts +0 -90
  41. package/src/components/confirm/index.css +0 -0
  42. package/src/components/confirm/index.ts +0 -192
  43. package/src/components/confirm/types/index.ts +0 -17
  44. package/src/components/drawer/config.ts +0 -89
  45. package/src/components/drawer/index.css +0 -35
  46. package/src/components/drawer/index.ts +0 -260
  47. package/src/components/drawer/types/index.ts +0 -61
  48. package/src/components/folder/config.ts +0 -147
  49. package/src/components/folder/folderIcon.ts +0 -28
  50. package/src/components/folder/index.css +0 -314
  51. package/src/components/folder/index.ts +0 -1050
  52. package/src/components/folder/types/index.ts +0 -101
  53. package/src/components/iframe/config.ts +0 -60
  54. package/src/components/iframe/index.css +0 -75
  55. package/src/components/iframe/index.ts +0 -351
  56. package/src/components/iframe/types/index.ts +0 -146
  57. package/src/components/loading/config.ts +0 -29
  58. package/src/components/loading/index.css +0 -66
  59. package/src/components/loading/index.ts +0 -114
  60. package/src/components/loading/types/index.ts +0 -40
  61. package/src/components/panel/config.ts +0 -532
  62. package/src/components/panel/handlerComponents.ts +0 -3277
  63. package/src/components/panel/index.css +0 -1293
  64. package/src/components/panel/index.ts +0 -213
  65. package/src/components/panel/types/components-button.ts +0 -69
  66. package/src/components/panel/types/components-common.ts +0 -55
  67. package/src/components/panel/types/components-deepMenu.ts +0 -85
  68. package/src/components/panel/types/components-forms.ts +0 -45
  69. package/src/components/panel/types/components-input.ts +0 -82
  70. package/src/components/panel/types/components-own.ts +0 -31
  71. package/src/components/panel/types/components-select.ts +0 -101
  72. package/src/components/panel/types/components-selectMultiple.ts +0 -133
  73. package/src/components/panel/types/components-slider.ts +0 -78
  74. package/src/components/panel/types/components-switch.ts +0 -57
  75. package/src/components/panel/types/components-textarea.ts +0 -69
  76. package/src/components/panel/types/index.ts +0 -177
  77. package/src/components/prompt/config.ts +0 -94
  78. package/src/components/prompt/index.css +0 -34
  79. package/src/components/prompt/index.ts +0 -222
  80. package/src/components/prompt/types/index.ts +0 -55
  81. package/src/components/rightClickMenu/config.ts +0 -130
  82. package/src/components/rightClickMenu/index.css +0 -88
  83. package/src/components/rightClickMenu/index.ts +0 -689
  84. package/src/components/rightClickMenu/types/index.ts +0 -91
  85. package/src/components/searchSuggestion/config.ts +0 -59
  86. package/src/components/searchSuggestion/index.ts +0 -708
  87. package/src/components/searchSuggestion/types/index.ts +0 -147
  88. package/src/components/tooltip/config.ts +0 -34
  89. package/src/components/tooltip/index.css +0 -196
  90. package/src/components/tooltip/index.ts +0 -655
  91. package/src/components/tooltip/types/index.ts +0 -125
  92. package/src/config/CommonCSSClassName.ts +0 -17
  93. package/src/config/GlobalConfig.ts +0 -80
  94. package/src/css/animation.css +0 -2245
  95. package/src/css/button.css +0 -542
  96. package/src/css/common.css +0 -52
  97. package/src/css/index.css +0 -254
  98. package/src/css/ninePalaceGridPosition.css +0 -50
  99. package/src/css/scrollbar.css +0 -22
  100. package/src/handler/PopsElementHandler.ts +0 -325
  101. package/src/handler/PopsHandler.ts +0 -719
  102. package/src/svg/arrowLeft.svg +0 -4
  103. package/src/svg/arrowRight.svg +0 -4
  104. package/src/svg/chromeFilled.svg +0 -14
  105. package/src/svg/circleClose.svg +0 -8
  106. package/src/svg/close.svg +0 -5
  107. package/src/svg/cpu.svg +0 -8
  108. package/src/svg/delete.svg +0 -5
  109. package/src/svg/documentCopy.svg +0 -5
  110. package/src/svg/edit.svg +0 -8
  111. package/src/svg/eleme.svg +0 -5
  112. package/src/svg/elemePlus.svg +0 -5
  113. package/src/svg/headset.svg +0 -5
  114. package/src/svg/hide.svg +0 -8
  115. package/src/svg/keyboard.svg +0 -8
  116. package/src/svg/loading.svg +0 -5
  117. package/src/svg/max.svg +0 -5
  118. package/src/svg/min.svg +0 -5
  119. package/src/svg/mise.svg +0 -5
  120. package/src/svg/monitor.svg +0 -5
  121. package/src/svg/next.svg +0 -5
  122. package/src/svg/picture.svg +0 -8
  123. package/src/svg/prev.svg +0 -5
  124. package/src/svg/search.svg +0 -5
  125. package/src/svg/share.svg +0 -5
  126. package/src/svg/upload.svg +0 -5
  127. package/src/svg/videoPause.svg +0 -5
  128. package/src/svg/videoPlay.svg +0 -5
  129. package/src/svg/view.svg +0 -5
  130. package/src/types/PopsDOMUtilsEventType.d.ts +0 -259
  131. package/src/types/animation.d.ts +0 -19
  132. package/src/types/button.d.ts +0 -196
  133. package/src/types/components.d.ts +0 -229
  134. package/src/types/event.d.ts +0 -63
  135. package/src/types/global.d.ts +0 -20
  136. package/src/types/icon.d.ts +0 -32
  137. package/src/types/inst.d.ts +0 -24
  138. package/src/types/main.d.ts +0 -122
  139. package/src/types/mask.d.ts +0 -49
  140. package/src/types/position.d.ts +0 -60
  141. package/src/utils/PopsDOMUtils.ts +0 -2649
  142. package/src/utils/PopsDOMUtilsEventsConfig.ts +0 -6
  143. package/src/utils/PopsInstanceUtils.ts +0 -801
  144. package/src/utils/PopsMathUtils.ts +0 -77
  145. package/src/utils/PopsSafeUtils.ts +0 -24
  146. package/src/utils/PopsUtils.ts +0 -430
@@ -1,146 +0,0 @@
1
- import type {
2
- PopsTitleConfig,
3
- PopsDragConfig,
4
- PopsCommonConfig,
5
- } from "../../../types/components";
6
-
7
- import type { PopsEventDetails } from "../../../types/event";
8
-
9
- /**
10
- * pops.iframe的按钮的点击回调参数event
11
- */
12
- export interface PopsBtnIframeCallBackEvent {
13
- /**
14
- * 动画元素(包裹着弹窗元素)
15
- */
16
- animElement: HTMLElement;
17
- /**
18
- * 弹窗元素
19
- */
20
- popsElement: HTMLElement;
21
- /**
22
- * 遮罩层元素,如果未设置,那么不存在
23
- */
24
- maskElement?: HTMLElement;
25
- /**
26
- * iframe元素
27
- */
28
- iframePopsElement: HTMLIFrameElement;
29
- /**
30
- * 使用的方法名
31
- */
32
- function: "iframe";
33
- /**
34
- * 唯一id
35
- */
36
- guid: string;
37
- }
38
-
39
- /**
40
- * pops.iframe
41
- */
42
- export interface PopsIframeDetails
43
- extends PopsTitleConfig,
44
- PopsDragConfig,
45
- PopsCommonConfig {
46
- /**
47
- * 加载配置
48
- */
49
- loading: {
50
- /**
51
- * 是否启用加载中的loading
52
- */
53
- enable: boolean;
54
- /**
55
- * 是否启用loading图标
56
- */
57
- icon: boolean;
58
- /**
59
- * 文字
60
- */
61
- text: string;
62
- };
63
- /**
64
- * 按钮配置
65
- */
66
- btn: {
67
- /**
68
- * 最小化
69
- */
70
- min: {
71
- /**
72
- * 点击的回调函数
73
- */
74
- callback: (
75
- eventDetails: PopsEventDetails & {
76
- iframeElement: HTMLIFrameElement;
77
- },
78
- event: MouseEvent | PointerEvent
79
- ) => void;
80
- };
81
- /**
82
- * 最大化
83
- */
84
- max: {
85
- /**
86
- * 点击的回调函数
87
- */
88
- callback: (
89
- eventDetails: PopsEventDetails & {
90
- iframeElement: HTMLIFrameElement;
91
- },
92
- event: MouseEvent | PointerEvent
93
- ) => void;
94
- };
95
- /**
96
- * 窗口化
97
- */
98
- mise: {
99
- /**
100
- * 点击的回调函数
101
- */
102
- callback: (
103
- eventDetails: PopsEventDetails & {
104
- iframeElement: HTMLIFrameElement;
105
- },
106
- event: MouseEvent | PointerEvent
107
- ) => void;
108
- };
109
- /**
110
- * 关闭
111
- */
112
- close: {
113
- /**
114
- * 点击的回调函数
115
- */
116
- callback: (
117
- eventDetails: PopsEventDetails & {
118
- iframeElement: HTMLIFrameElement;
119
- },
120
- event: MouseEvent | PointerEvent
121
- ) => void;
122
- };
123
- };
124
- /**
125
- * 加载的地址,默认为window.location.href
126
- * @default window.location.href
127
- */
128
- url?: string;
129
- /**
130
- * 右上角按钮顺序:最小化、最大化、窗口化、关闭
131
- */
132
- topRightButton: "min|max|mise|close";
133
- /**
134
- * 是否启用沙箱,默认false
135
- * @default false
136
- */
137
- sandbox?: boolean;
138
- /**
139
- * 加载完毕的回调
140
- */
141
- loadEndCallBack?: (
142
- details: PopsEventDetails & {
143
- iframeElement: HTMLIFrameElement;
144
- }
145
- ) => void;
146
- }
@@ -1,29 +0,0 @@
1
- import type { PopsLoadingDetails } from "./types";
2
-
3
- export const PopsLoadingConfig = (): DeepRequired<PopsLoadingDetails> => {
4
- return {
5
- parent: document.body,
6
- content: {
7
- text: "加载中...",
8
- icon: "loading",
9
- style: "",
10
- },
11
- useShadowRoot: true,
12
- class: "",
13
- only: false,
14
- zIndex: 10000,
15
- mask: {
16
- enable: false,
17
- clickEvent: {
18
- toClose: false,
19
- toHide: false,
20
- },
21
- clickCallBack: null,
22
- },
23
- animation: "pops-anim-fadein-zoom",
24
- forbiddenScroll: false,
25
- isAbsolute: false,
26
- style: null,
27
- addIndexCSS: true,
28
- };
29
- };
@@ -1,66 +0,0 @@
1
- .pops[type-value="loading"] {
2
- --loading-bd-color: rgba(0, 0, 0, 0.2);
3
- --loading-bg-color: rgb(255, 255, 255, var(--pops-bg-opacity));
4
- --loading-box-shadow-color: rgb(0 0 0 / 50%);
5
- --loading-icon-color: rgba(100, 149, 237, 0.1);
6
- --loading-icon-bd-top-color: rgb(100, 149, 237, var(--pops-bd-opacity));
7
- }
8
- .pops[type-value="loading"] {
9
- position: absolute;
10
- top: 272.5px;
11
- top: 50%;
12
- left: 26px;
13
- left: 50%;
14
- display: flex;
15
- overflow: hidden;
16
- padding: 10px 15px;
17
- max-width: 100%;
18
- max-height: 100%;
19
- min-width: 0;
20
- min-height: 0;
21
- border: 1px solid var(--loading-bd-color);
22
- border-radius: 5px;
23
- background-color: var(--loading-bg-color);
24
- box-shadow: 0 0 5px var(--loading-box-shadow-color);
25
- vertical-align: middle;
26
- transition: all 0.35s;
27
- transform: translate(-50%, -50%);
28
- user-select: none;
29
- -webkit-user-select: none;
30
- -moz-user-select: none;
31
- -ms-user-select: none;
32
- flex-direction: column;
33
- align-items: center;
34
- justify-content: center;
35
- align-content: center;
36
- }
37
- .pops[type-value="loading"]:before {
38
- float: left;
39
- display: inline-block;
40
- width: 2em;
41
- height: 2em;
42
- border: 0.3em solid var(--loading-icon-color);
43
- border-top: 0.3em solid var(--loading-icon-bd-top-color);
44
- border-radius: 50%;
45
- content: " ";
46
- vertical-align: middle;
47
- font-size: inherit;
48
- animation: pops-anim-wait-rotate 1.2s linear infinite;
49
- }
50
- .pops[type-value="loading"] .pops-loading-content {
51
- position: static;
52
- top: 0;
53
- bottom: 0;
54
- float: left;
55
- overflow: hidden;
56
- width: auto;
57
- font-size: inherit;
58
- line-height: normal;
59
- align-content: center;
60
- }
61
-
62
- @media (prefers-color-scheme: dark) {
63
- .pops[type-value="loading"] {
64
- --loading-bg-color: #222222;
65
- }
66
- }
@@ -1,114 +0,0 @@
1
- import { GlobalConfig } from "../../config/GlobalConfig";
2
- import { PopsElementHandler } from "../../handler/PopsElementHandler";
3
- import { PopsHandler } from "../../handler/PopsHandler";
4
- import { PopsCSS } from "../../PopsCSS";
5
- import { popsDOMUtils } from "../../utils/PopsDOMUtils";
6
- import { popsUtils } from "../../utils/PopsUtils";
7
- import { PopsLoadingConfig } from "./config";
8
- import type { PopsLoadingDetails } from "./types";
9
-
10
- export const PopsLoading = {
11
- init(details: PopsLoadingDetails) {
12
- let config = PopsLoadingConfig();
13
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
14
- config = popsUtils.assign(config, details);
15
- let guid = popsUtils.getRandomGUID();
16
- const PopsType = "loading";
17
-
18
- config = PopsHandler.handleOnly(PopsType, config);
19
-
20
- // 先把z-index提取出来
21
- let zIndex = PopsHandler.handleZIndex(config.zIndex);
22
- let maskHTML = PopsElementHandler.createMask(guid, zIndex);
23
-
24
- let { contentPStyle } = PopsElementHandler.createContentStyle(
25
- "loading",
26
- config
27
- );
28
- let animHTML = PopsElementHandler.createAnim(
29
- guid,
30
- PopsType,
31
- config,
32
- /*html*/ `
33
- <div class="pops-content pops-${PopsType}-content">${
34
- config.addIndexCSS
35
- ? /*html*/ `
36
- <style data-model-name="index">${PopsCSS.index}</style>
37
- <style data-model-name="anim">${PopsCSS.anim}</style>
38
- <style data-model-name="common">${PopsCSS.common}</style>
39
- `
40
- : ""
41
- }
42
- <style data-model-name="loadingCSS">
43
- ${PopsCSS.loadingCSS}
44
- </style>
45
- ${config.style != null ? `<style>${config.style}</style>` : ""}
46
- <p pops class="pops-${PopsType}-content-text" style="${contentPStyle}">${
47
- config.content.text
48
- }</p>
49
- </div>`,
50
- "",
51
- zIndex
52
- );
53
-
54
- /**
55
- * 弹窗的主元素,包括动画层
56
- */
57
-
58
- let $anim = PopsElementHandler.parseElement<HTMLDivElement>(animHTML);
59
-
60
- let { popsElement: $pops } = PopsHandler.handleQueryElement(
61
- $anim,
62
- PopsType
63
- );
64
- /**
65
- * 遮罩层元素
66
- */
67
- let $mask: HTMLDivElement | null = null;
68
- /**
69
- * 已创建的元素列表
70
- */
71
- let elementList: HTMLElement[] = [$anim];
72
-
73
- if (config.mask.enable) {
74
- // 创建遮罩层
75
- let _handleMask_ = PopsHandler.handleMask({
76
- type: PopsType,
77
- guid: guid,
78
-
79
- config: config,
80
- animElement: $anim,
81
- maskHTML: maskHTML,
82
- });
83
- $mask = _handleMask_.maskElement;
84
- elementList.push($mask);
85
- }
86
- let eventDetails = PopsHandler.handleLoadingEventDetails(
87
- guid,
88
- PopsType,
89
- $anim,
90
- $pops!,
91
- $mask!,
92
- config
93
- );
94
- popsDOMUtils.append(config.parent, elementList);
95
- if ($mask != null) {
96
- $anim.after($mask);
97
- }
98
- PopsHandler.handlePush(PopsType, {
99
- guid: guid,
100
- animElement: $anim,
101
- popsElement: $pops!,
102
- maskElement: $mask!,
103
- } as any);
104
-
105
- if (config.isAbsolute) {
106
- // 遮罩层必须是跟随主内容
107
- // 即设置主内容position: relative,mask:position: absolute
108
- popsDOMUtils.css($anim, "position", "absolute !important");
109
- $mask && popsDOMUtils.css($mask, "position", "absolute !important");
110
- }
111
- let result = PopsHandler.handleResultDetails(eventDetails);
112
- return result;
113
- },
114
- };
@@ -1,40 +0,0 @@
1
- import type {
2
- PopsCommonConfig,
3
- PopsContentConfig,
4
- } from "../../../types/components";
5
-
6
- /**
7
- * pops.loading
8
- */
9
- export interface PopsLoadingDetails
10
- extends Omit<
11
- PopsCommonConfig,
12
- "width" | "height" | "position" | "beforeAppendToPageCallBack"
13
- > {
14
- /**
15
- * 父元素,默认为document.body
16
- * @default document.body
17
- */
18
- parent?: HTMLElement;
19
- /**
20
- * 内容配置
21
- */
22
- content: Omit<PopsContentConfig["content"], "html"> & {
23
- /**
24
- * 图标
25
- */
26
- icon?: string;
27
- };
28
- /**
29
- * (可选)添加主CSS,默认为true,当页面中存在anim覆盖时,可能会有一些样式问题,取消添加该CSS即可解决
30
- * @default true
31
- */
32
- addIndexCSS?: boolean;
33
- /**
34
- * 为pops-anim和pops-mask设置position: absolute(需要自行设置parent的position为relative)
35
- *
36
- * 它们默认的position为fixed
37
- * @default false
38
- */
39
- isAbsolute?: boolean;
40
- }