@whitesev/pops 3.2.1 → 3.2.2
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.
- package/README.md +249 -249
- package/dist/index.amd.js +702 -667
- package/dist/index.amd.js.map +1 -1
- package/dist/index.amd.min.js +1 -1
- package/dist/index.amd.min.js.map +1 -1
- package/dist/index.cjs.js +702 -667
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.cjs.min.js.map +1 -1
- package/dist/index.esm.js +702 -667
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.iife.js +702 -667
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +1 -1
- package/dist/index.iife.min.js.map +1 -1
- package/dist/index.system.js +702 -667
- package/dist/index.system.js.map +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/dist/index.umd.js +702 -667
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/types/src/components/folder/types/index.d.ts +43 -13
- package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +313 -313
- package/dist/types/src/types/animation.d.ts +19 -19
- package/dist/types/src/types/button.d.ts +94 -94
- package/dist/types/src/types/components.d.ts +211 -211
- package/dist/types/src/types/event.d.ts +43 -43
- package/dist/types/src/types/global.d.ts +31 -31
- package/dist/types/src/types/icon.d.ts +32 -32
- package/dist/types/src/types/inst.d.ts +28 -28
- package/dist/types/src/types/main.d.ts +66 -66
- package/dist/types/src/types/mask.d.ts +52 -52
- package/dist/types/src/types/position.d.ts +60 -60
- package/package.json +27 -25
- package/src/Pops.ts +206 -206
- package/src/PopsAnimation.ts +32 -32
- package/src/PopsCSS.ts +54 -54
- package/src/PopsCore.ts +37 -37
- package/src/PopsIcon.ts +95 -95
- package/src/PopsInst.ts +21 -21
- package/src/components/alert/defaultConfig.ts +62 -62
- package/src/components/alert/index.ts +163 -163
- package/src/components/alert/types/index.ts +23 -23
- package/src/components/confirm/defaultConfig.ts +90 -90
- package/src/components/confirm/index.ts +165 -165
- package/src/components/confirm/types/index.ts +13 -17
- package/src/components/drawer/defaultConfig.ts +89 -89
- package/src/components/drawer/index.css +37 -37
- package/src/components/drawer/index.ts +245 -245
- package/src/components/drawer/types/index.ts +62 -61
- package/src/components/folder/defaultConfig.ts +151 -151
- package/src/components/folder/folderIcon.ts +28 -28
- package/src/components/folder/index.css +303 -303
- package/src/components/folder/index.ts +953 -932
- package/src/components/folder/types/index.ts +143 -110
- package/src/components/iframe/defaultConfig.ts +60 -60
- package/src/components/iframe/index.css +76 -76
- package/src/components/iframe/index.ts +331 -331
- package/src/components/iframe/types/index.ts +96 -96
- package/src/components/loading/defaultConfig.ts +29 -29
- package/src/components/loading/index.css +66 -66
- package/src/components/loading/index.ts +101 -101
- package/src/components/loading/types/index.ts +36 -34
- package/src/components/panel/css/components-select.css +84 -84
- package/src/components/panel/defaultConfig.ts +868 -868
- package/src/components/panel/handlerComponents.ts +3993 -3993
- package/src/components/panel/index.css +1403 -1403
- package/src/components/panel/index.ts +221 -221
- package/src/components/panel/types/components-button.ts +56 -56
- package/src/components/panel/types/components-common.ts +73 -73
- package/src/components/panel/types/components-container.ts +25 -25
- package/src/components/panel/types/components-deepMenu.ts +64 -64
- package/src/components/panel/types/components-input.ts +90 -90
- package/src/components/panel/types/components-own.ts +16 -16
- package/src/components/panel/types/components-select.ts +169 -169
- package/src/components/panel/types/components-selectMultiple.ts +105 -104
- package/src/components/panel/types/components-slider.ts +55 -55
- package/src/components/panel/types/components-switch.ts +33 -33
- package/src/components/panel/types/components-textarea.ts +45 -45
- package/src/components/panel/types/index.ts +244 -244
- package/src/components/prompt/defaultConfig.ts +94 -94
- package/src/components/prompt/index.css +34 -34
- package/src/components/prompt/index.ts +187 -215
- package/src/components/prompt/types/index.ts +57 -56
- package/src/components/rightClickMenu/defaultConfig.ts +103 -103
- package/src/components/rightClickMenu/index.css +115 -115
- package/src/components/rightClickMenu/index.ts +662 -662
- package/src/components/rightClickMenu/types/index.ts +145 -143
- package/src/components/searchSuggestion/defaultConfig.ts +63 -63
- package/src/components/searchSuggestion/index.ts +813 -813
- package/src/components/searchSuggestion/types/index.ts +244 -242
- package/src/components/tooltip/defaultConfig.ts +33 -33
- package/src/components/tooltip/index.css +199 -199
- package/src/components/tooltip/index.ts +617 -617
- package/src/components/tooltip/types/index.ts +123 -121
- package/src/config/CommonCSSClassName.ts +17 -17
- package/src/config/GlobalConfig.ts +63 -63
- package/src/css/animation.css +987 -987
- package/src/css/button.css +551 -551
- package/src/css/common.css +54 -54
- package/src/css/index.css +253 -253
- package/src/css/ninePalaceGridPosition.css +50 -50
- package/src/css/scrollbar.css +22 -22
- package/src/handler/PopsElementHandler.ts +303 -303
- package/src/handler/PopsHandler.ts +611 -611
- package/src/types/PopsDOMUtilsEventType.d.ts +313 -313
- package/src/types/animation.d.ts +19 -19
- package/src/types/button.d.ts +94 -94
- package/src/types/components.d.ts +211 -211
- package/src/types/event.d.ts +43 -43
- package/src/types/global.d.ts +31 -31
- package/src/types/icon.d.ts +32 -32
- package/src/types/inst.d.ts +28 -28
- package/src/types/main.d.ts +66 -66
- package/src/types/mask.d.ts +52 -52
- package/src/types/position.d.ts +60 -60
- package/src/utils/PopsDOMUtils.ts +2483 -2483
- package/src/utils/PopsDOMUtilsEventsConfig.ts +4 -4
- package/src/utils/PopsInstanceUtils.ts +714 -714
- package/src/utils/PopsMathUtils.ts +71 -71
- package/src/utils/PopsSafeUtils.ts +22 -22
- package/src/utils/PopsUtils.ts +421 -421
package/src/PopsCSS.ts
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import indexCSS from "./css/index.css";
|
|
2
|
-
import ninePalaceGridPositionCSS from "./css/ninePalaceGridPosition.css";
|
|
3
|
-
import scrollbarCSS from "./css/scrollbar.css";
|
|
4
|
-
import buttonCSS from "./css/button.css";
|
|
5
|
-
import commonCSS from "./css/common.css";
|
|
6
|
-
import animCSS from "./css/animation.css";
|
|
7
|
-
import alertCSS from "./components/alert/index.css";
|
|
8
|
-
import confirmCSS from "./components/confirm/index.css";
|
|
9
|
-
import promptCSS from "./components/prompt/index.css";
|
|
10
|
-
import loadingCSS from "./components/loading/index.css";
|
|
11
|
-
import iframeCSS from "./components/iframe/index.css";
|
|
12
|
-
import tooltipCSS from "./components/tooltip/index.css";
|
|
13
|
-
import drawerCSS from "./components/drawer/index.css";
|
|
14
|
-
import folderCSS from "./components/folder/index.css";
|
|
15
|
-
import panelCSS from "./components/panel/index.css";
|
|
16
|
-
import rightClickMenuCSS from "./components/rightClickMenu/index.css";
|
|
17
|
-
import panelComponents_Select_CSS from "./components/panel/css/components-select.css";
|
|
18
|
-
|
|
19
|
-
export const PopsCSS = {
|
|
20
|
-
/** 主CSS */
|
|
21
|
-
index: indexCSS,
|
|
22
|
-
/** 九宫格位置CSS */
|
|
23
|
-
ninePalaceGridPosition: ninePalaceGridPositionCSS,
|
|
24
|
-
/** 滚动条CSS */
|
|
25
|
-
scrollbar: scrollbarCSS,
|
|
26
|
-
/** 按钮CSS */
|
|
27
|
-
button: buttonCSS,
|
|
28
|
-
/** 通用的CSS */
|
|
29
|
-
common: commonCSS,
|
|
30
|
-
/** 动画 */
|
|
31
|
-
anim: animCSS,
|
|
32
|
-
/** pops.alert */
|
|
33
|
-
alertCSS: alertCSS,
|
|
34
|
-
/** pops.cponfirm */
|
|
35
|
-
confirmCSS: confirmCSS,
|
|
36
|
-
/** pops.prompt */
|
|
37
|
-
promptCSS: promptCSS,
|
|
38
|
-
/** pops.loading */
|
|
39
|
-
loadingCSS: loadingCSS,
|
|
40
|
-
/** pops.iframe */
|
|
41
|
-
iframeCSS: iframeCSS,
|
|
42
|
-
/** pops.tooltip */
|
|
43
|
-
tooltipCSS: tooltipCSS,
|
|
44
|
-
/** pops.drawer */
|
|
45
|
-
drawerCSS: drawerCSS,
|
|
46
|
-
/** pops.folder */
|
|
47
|
-
folderCSS: folderCSS,
|
|
48
|
-
/** pops.panel */
|
|
49
|
-
panelCSS: panelCSS,
|
|
50
|
-
/** pops.rightClickMenu */
|
|
51
|
-
rightClickMenu: rightClickMenuCSS,
|
|
52
|
-
/** pops.panel的select组件 */
|
|
53
|
-
panelComponents_Select: panelComponents_Select_CSS,
|
|
54
|
-
};
|
|
1
|
+
import indexCSS from "./css/index.css";
|
|
2
|
+
import ninePalaceGridPositionCSS from "./css/ninePalaceGridPosition.css";
|
|
3
|
+
import scrollbarCSS from "./css/scrollbar.css";
|
|
4
|
+
import buttonCSS from "./css/button.css";
|
|
5
|
+
import commonCSS from "./css/common.css";
|
|
6
|
+
import animCSS from "./css/animation.css";
|
|
7
|
+
import alertCSS from "./components/alert/index.css";
|
|
8
|
+
import confirmCSS from "./components/confirm/index.css";
|
|
9
|
+
import promptCSS from "./components/prompt/index.css";
|
|
10
|
+
import loadingCSS from "./components/loading/index.css";
|
|
11
|
+
import iframeCSS from "./components/iframe/index.css";
|
|
12
|
+
import tooltipCSS from "./components/tooltip/index.css";
|
|
13
|
+
import drawerCSS from "./components/drawer/index.css";
|
|
14
|
+
import folderCSS from "./components/folder/index.css";
|
|
15
|
+
import panelCSS from "./components/panel/index.css";
|
|
16
|
+
import rightClickMenuCSS from "./components/rightClickMenu/index.css";
|
|
17
|
+
import panelComponents_Select_CSS from "./components/panel/css/components-select.css";
|
|
18
|
+
|
|
19
|
+
export const PopsCSS = {
|
|
20
|
+
/** 主CSS */
|
|
21
|
+
index: indexCSS,
|
|
22
|
+
/** 九宫格位置CSS */
|
|
23
|
+
ninePalaceGridPosition: ninePalaceGridPositionCSS,
|
|
24
|
+
/** 滚动条CSS */
|
|
25
|
+
scrollbar: scrollbarCSS,
|
|
26
|
+
/** 按钮CSS */
|
|
27
|
+
button: buttonCSS,
|
|
28
|
+
/** 通用的CSS */
|
|
29
|
+
common: commonCSS,
|
|
30
|
+
/** 动画 */
|
|
31
|
+
anim: animCSS,
|
|
32
|
+
/** pops.alert */
|
|
33
|
+
alertCSS: alertCSS,
|
|
34
|
+
/** pops.cponfirm */
|
|
35
|
+
confirmCSS: confirmCSS,
|
|
36
|
+
/** pops.prompt */
|
|
37
|
+
promptCSS: promptCSS,
|
|
38
|
+
/** pops.loading */
|
|
39
|
+
loadingCSS: loadingCSS,
|
|
40
|
+
/** pops.iframe */
|
|
41
|
+
iframeCSS: iframeCSS,
|
|
42
|
+
/** pops.tooltip */
|
|
43
|
+
tooltipCSS: tooltipCSS,
|
|
44
|
+
/** pops.drawer */
|
|
45
|
+
drawerCSS: drawerCSS,
|
|
46
|
+
/** pops.folder */
|
|
47
|
+
folderCSS: folderCSS,
|
|
48
|
+
/** pops.panel */
|
|
49
|
+
panelCSS: panelCSS,
|
|
50
|
+
/** pops.rightClickMenu */
|
|
51
|
+
rightClickMenu: rightClickMenuCSS,
|
|
52
|
+
/** pops.panel的select组件 */
|
|
53
|
+
panelComponents_Select: panelComponents_Select_CSS,
|
|
54
|
+
};
|
package/src/PopsCore.ts
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
const PopsCoreDefaultEnv = {
|
|
2
|
-
document: document,
|
|
3
|
-
window: window,
|
|
4
|
-
globalThis: globalThis,
|
|
5
|
-
self: self,
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
const PopsCoreEnv = Object.assign({}, PopsCoreDefaultEnv);
|
|
9
|
-
|
|
10
|
-
const PopsCore = {
|
|
11
|
-
init(option?: typeof PopsCoreDefaultEnv) {
|
|
12
|
-
if (!option) {
|
|
13
|
-
option = Object.assign({}, PopsCoreDefaultEnv);
|
|
14
|
-
}
|
|
15
|
-
Object.assign(PopsCoreEnv, option);
|
|
16
|
-
},
|
|
17
|
-
get document() {
|
|
18
|
-
return PopsCoreEnv.document;
|
|
19
|
-
},
|
|
20
|
-
get window() {
|
|
21
|
-
return PopsCoreEnv.window;
|
|
22
|
-
},
|
|
23
|
-
get globalThis() {
|
|
24
|
-
return PopsCoreEnv.globalThis;
|
|
25
|
-
},
|
|
26
|
-
get self() {
|
|
27
|
-
return PopsCoreEnv.self;
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const OriginPrototype = {
|
|
32
|
-
Object: {
|
|
33
|
-
defineProperty: Object.defineProperty,
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export { PopsCore, OriginPrototype };
|
|
1
|
+
const PopsCoreDefaultEnv = {
|
|
2
|
+
document: document,
|
|
3
|
+
window: window,
|
|
4
|
+
globalThis: globalThis,
|
|
5
|
+
self: self,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const PopsCoreEnv = Object.assign({}, PopsCoreDefaultEnv);
|
|
9
|
+
|
|
10
|
+
const PopsCore = {
|
|
11
|
+
init(option?: typeof PopsCoreDefaultEnv) {
|
|
12
|
+
if (!option) {
|
|
13
|
+
option = Object.assign({}, PopsCoreDefaultEnv);
|
|
14
|
+
}
|
|
15
|
+
Object.assign(PopsCoreEnv, option);
|
|
16
|
+
},
|
|
17
|
+
get document() {
|
|
18
|
+
return PopsCoreEnv.document;
|
|
19
|
+
},
|
|
20
|
+
get window() {
|
|
21
|
+
return PopsCoreEnv.window;
|
|
22
|
+
},
|
|
23
|
+
get globalThis() {
|
|
24
|
+
return PopsCoreEnv.globalThis;
|
|
25
|
+
},
|
|
26
|
+
get self() {
|
|
27
|
+
return PopsCoreEnv.self;
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const OriginPrototype = {
|
|
32
|
+
Object: {
|
|
33
|
+
defineProperty: Object.defineProperty,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { PopsCore, OriginPrototype };
|
package/src/PopsIcon.ts
CHANGED
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
import type { PopsIconType } from "./types/icon";
|
|
2
|
-
import SVG_min from "./svg/min.svg";
|
|
3
|
-
import SVG_mise from "./svg/mise.svg";
|
|
4
|
-
import SVG_max from "./svg/max.svg";
|
|
5
|
-
import SVG_close from "./svg/close.svg";
|
|
6
|
-
import SVG_edit from "./svg/edit.svg";
|
|
7
|
-
import SVG_share from "./svg/share.svg";
|
|
8
|
-
import SVG_delete from "./svg/delete.svg";
|
|
9
|
-
import SVG_search from "./svg/search.svg";
|
|
10
|
-
import SVG_upload from "./svg/upload.svg";
|
|
11
|
-
import SVG_loading from "./svg/loading.svg";
|
|
12
|
-
import SVG_next from "./svg/next.svg";
|
|
13
|
-
import SVG_prev from "./svg/prev.svg";
|
|
14
|
-
import SVG_eleme from "./svg/eleme.svg";
|
|
15
|
-
import SVG_elemePlus from "./svg/elemePlus.svg";
|
|
16
|
-
import SVG_chromeFilled from "./svg/chromeFilled.svg";
|
|
17
|
-
import SVG_cpu from "./svg/cpu.svg";
|
|
18
|
-
import SVG_videoPlay from "./svg/videoPlay.svg";
|
|
19
|
-
import SVG_videoPause from "./svg/videoPause.svg";
|
|
20
|
-
import SVG_headset from "./svg/headset.svg";
|
|
21
|
-
import SVG_monitor from "./svg/monitor.svg";
|
|
22
|
-
import SVG_documentCopy from "./svg/documentCopy.svg";
|
|
23
|
-
import SVG_picture from "./svg/picture.svg";
|
|
24
|
-
import SVG_circleClose from "./svg/circleClose.svg";
|
|
25
|
-
import SVG_view from "./svg/view.svg";
|
|
26
|
-
import SVG_hide from "./svg/hide.svg";
|
|
27
|
-
import SVG_keyboard from "./svg/keyboard.svg";
|
|
28
|
-
import SVG_arrowRight from "./svg/arrowRight.svg";
|
|
29
|
-
import SVG_arrowLeft from "./svg/arrowLeft.svg";
|
|
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
|
-
|
|
64
|
-
export const PopsIcon = {
|
|
65
|
-
$data: PopsIconData,
|
|
66
|
-
/**
|
|
67
|
-
* 判断是否存在某个icon
|
|
68
|
-
* @param iconName 图标名
|
|
69
|
-
*/
|
|
70
|
-
hasIcon(iconName: string) {
|
|
71
|
-
return Object.keys(PopsIcon.$data).includes(iconName);
|
|
72
|
-
},
|
|
73
|
-
/**
|
|
74
|
-
* 获取icon
|
|
75
|
-
* @param iconName 图标名
|
|
76
|
-
*/
|
|
77
|
-
getIcon(iconName: string): string | null {
|
|
78
|
-
return PopsIcon.$data[iconName as keyof typeof this.$data];
|
|
79
|
-
},
|
|
80
|
-
/**
|
|
81
|
-
* 删除图标
|
|
82
|
-
* @param iconName 图标名
|
|
83
|
-
*/
|
|
84
|
-
deleteIcon(iconName: string) {
|
|
85
|
-
return Reflect.deleteProperty(PopsIcon.$data, iconName);
|
|
86
|
-
},
|
|
87
|
-
/**
|
|
88
|
-
* 设置图标
|
|
89
|
-
* @param iconName 图标名
|
|
90
|
-
* @param iconHTML 图标html
|
|
91
|
-
*/
|
|
92
|
-
setIcon(iconName: string, iconHTML: string) {
|
|
93
|
-
Reflect.set(PopsIcon.$data, iconName, iconHTML);
|
|
94
|
-
},
|
|
95
|
-
};
|
|
1
|
+
import type { PopsIconType } from "./types/icon";
|
|
2
|
+
import SVG_min from "./svg/min.svg";
|
|
3
|
+
import SVG_mise from "./svg/mise.svg";
|
|
4
|
+
import SVG_max from "./svg/max.svg";
|
|
5
|
+
import SVG_close from "./svg/close.svg";
|
|
6
|
+
import SVG_edit from "./svg/edit.svg";
|
|
7
|
+
import SVG_share from "./svg/share.svg";
|
|
8
|
+
import SVG_delete from "./svg/delete.svg";
|
|
9
|
+
import SVG_search from "./svg/search.svg";
|
|
10
|
+
import SVG_upload from "./svg/upload.svg";
|
|
11
|
+
import SVG_loading from "./svg/loading.svg";
|
|
12
|
+
import SVG_next from "./svg/next.svg";
|
|
13
|
+
import SVG_prev from "./svg/prev.svg";
|
|
14
|
+
import SVG_eleme from "./svg/eleme.svg";
|
|
15
|
+
import SVG_elemePlus from "./svg/elemePlus.svg";
|
|
16
|
+
import SVG_chromeFilled from "./svg/chromeFilled.svg";
|
|
17
|
+
import SVG_cpu from "./svg/cpu.svg";
|
|
18
|
+
import SVG_videoPlay from "./svg/videoPlay.svg";
|
|
19
|
+
import SVG_videoPause from "./svg/videoPause.svg";
|
|
20
|
+
import SVG_headset from "./svg/headset.svg";
|
|
21
|
+
import SVG_monitor from "./svg/monitor.svg";
|
|
22
|
+
import SVG_documentCopy from "./svg/documentCopy.svg";
|
|
23
|
+
import SVG_picture from "./svg/picture.svg";
|
|
24
|
+
import SVG_circleClose from "./svg/circleClose.svg";
|
|
25
|
+
import SVG_view from "./svg/view.svg";
|
|
26
|
+
import SVG_hide from "./svg/hide.svg";
|
|
27
|
+
import SVG_keyboard from "./svg/keyboard.svg";
|
|
28
|
+
import SVG_arrowRight from "./svg/arrowRight.svg";
|
|
29
|
+
import SVG_arrowLeft from "./svg/arrowLeft.svg";
|
|
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
|
+
|
|
64
|
+
export const PopsIcon = {
|
|
65
|
+
$data: PopsIconData,
|
|
66
|
+
/**
|
|
67
|
+
* 判断是否存在某个icon
|
|
68
|
+
* @param iconName 图标名
|
|
69
|
+
*/
|
|
70
|
+
hasIcon(iconName: string) {
|
|
71
|
+
return Object.keys(PopsIcon.$data).includes(iconName);
|
|
72
|
+
},
|
|
73
|
+
/**
|
|
74
|
+
* 获取icon
|
|
75
|
+
* @param iconName 图标名
|
|
76
|
+
*/
|
|
77
|
+
getIcon(iconName: string): string | null {
|
|
78
|
+
return PopsIcon.$data[iconName as keyof typeof this.$data];
|
|
79
|
+
},
|
|
80
|
+
/**
|
|
81
|
+
* 删除图标
|
|
82
|
+
* @param iconName 图标名
|
|
83
|
+
*/
|
|
84
|
+
deleteIcon(iconName: string) {
|
|
85
|
+
return Reflect.deleteProperty(PopsIcon.$data, iconName);
|
|
86
|
+
},
|
|
87
|
+
/**
|
|
88
|
+
* 设置图标
|
|
89
|
+
* @param iconName 图标名
|
|
90
|
+
* @param iconHTML 图标html
|
|
91
|
+
*/
|
|
92
|
+
setIcon(iconName: string, iconHTML: string) {
|
|
93
|
+
Reflect.set(PopsIcon.$data, iconName, iconHTML);
|
|
94
|
+
},
|
|
95
|
+
};
|
package/src/PopsInst.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import type { PopsInstGeneralConfig } from "./types/inst";
|
|
2
|
-
import type { PopsInstStoreType } from "./types/main";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* 弹窗实例数据
|
|
6
|
-
*/
|
|
7
|
-
export const PopsInstData: {
|
|
8
|
-
[key in PopsInstStoreType]: PopsInstGeneralConfig[];
|
|
9
|
-
} = {
|
|
10
|
-
alert: [],
|
|
11
|
-
confirm: [],
|
|
12
|
-
drawer: [],
|
|
13
|
-
folder: [],
|
|
14
|
-
iframe: [],
|
|
15
|
-
loading: [],
|
|
16
|
-
panel: [],
|
|
17
|
-
prompt: [],
|
|
18
|
-
rightClickMenu: [],
|
|
19
|
-
// 没有 searchSuggestion
|
|
20
|
-
tooltip: [],
|
|
21
|
-
};
|
|
1
|
+
import type { PopsInstGeneralConfig } from "./types/inst";
|
|
2
|
+
import type { PopsInstStoreType } from "./types/main";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 弹窗实例数据
|
|
6
|
+
*/
|
|
7
|
+
export const PopsInstData: {
|
|
8
|
+
[key in PopsInstStoreType]: PopsInstGeneralConfig[];
|
|
9
|
+
} = {
|
|
10
|
+
alert: [],
|
|
11
|
+
confirm: [],
|
|
12
|
+
drawer: [],
|
|
13
|
+
folder: [],
|
|
14
|
+
iframe: [],
|
|
15
|
+
loading: [],
|
|
16
|
+
panel: [],
|
|
17
|
+
prompt: [],
|
|
18
|
+
rightClickMenu: [],
|
|
19
|
+
// 没有 searchSuggestion
|
|
20
|
+
tooltip: [],
|
|
21
|
+
};
|
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
import type { PopsAlertConfig } from "./types";
|
|
2
|
-
|
|
3
|
-
export const PopsAlertDefaultConfig = (): DeepRequired<PopsAlertConfig> => {
|
|
4
|
-
return {
|
|
5
|
-
title: {
|
|
6
|
-
text: "默认标题",
|
|
7
|
-
position: "left",
|
|
8
|
-
html: false,
|
|
9
|
-
style: "",
|
|
10
|
-
},
|
|
11
|
-
content: {
|
|
12
|
-
text: "默认内容",
|
|
13
|
-
html: false,
|
|
14
|
-
style: "",
|
|
15
|
-
},
|
|
16
|
-
btn: {
|
|
17
|
-
position: "flex-end",
|
|
18
|
-
ok: {
|
|
19
|
-
size: void 0 as any,
|
|
20
|
-
enable: true,
|
|
21
|
-
icon: void 0 as any,
|
|
22
|
-
rightIcon: false,
|
|
23
|
-
iconIsLoading: false,
|
|
24
|
-
text: "确定",
|
|
25
|
-
type: "primary",
|
|
26
|
-
callback: function (eventConfig) {
|
|
27
|
-
eventConfig.close();
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
close: {
|
|
31
|
-
enable: true,
|
|
32
|
-
callback: function (eventConfig) {
|
|
33
|
-
eventConfig.close();
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
useShadowRoot: true,
|
|
38
|
-
class: "",
|
|
39
|
-
only: false,
|
|
40
|
-
width: window.innerWidth < 550 ? "88vw" : "350px",
|
|
41
|
-
height: window.innerHeight < 450 ? "70vh" : "200px",
|
|
42
|
-
position: "center",
|
|
43
|
-
animation: "pops-anim-fadein-zoom",
|
|
44
|
-
zIndex: 10000,
|
|
45
|
-
mask: {
|
|
46
|
-
enable: false,
|
|
47
|
-
clickEvent: {
|
|
48
|
-
toClose: false,
|
|
49
|
-
toHide: false,
|
|
50
|
-
},
|
|
51
|
-
clickCallBack: null,
|
|
52
|
-
},
|
|
53
|
-
drag: false,
|
|
54
|
-
dragLimit: true,
|
|
55
|
-
dragExtraDistance: 3,
|
|
56
|
-
dragMoveCallBack() {},
|
|
57
|
-
dragEndCallBack() {},
|
|
58
|
-
forbiddenScroll: false,
|
|
59
|
-
style: null,
|
|
60
|
-
beforeAppendToPageCallBack() {},
|
|
61
|
-
} as DeepRequired<PopsAlertConfig>;
|
|
62
|
-
};
|
|
1
|
+
import type { PopsAlertConfig } from "./types";
|
|
2
|
+
|
|
3
|
+
export const PopsAlertDefaultConfig = (): DeepRequired<PopsAlertConfig> => {
|
|
4
|
+
return {
|
|
5
|
+
title: {
|
|
6
|
+
text: "默认标题",
|
|
7
|
+
position: "left",
|
|
8
|
+
html: false,
|
|
9
|
+
style: "",
|
|
10
|
+
},
|
|
11
|
+
content: {
|
|
12
|
+
text: "默认内容",
|
|
13
|
+
html: false,
|
|
14
|
+
style: "",
|
|
15
|
+
},
|
|
16
|
+
btn: {
|
|
17
|
+
position: "flex-end",
|
|
18
|
+
ok: {
|
|
19
|
+
size: void 0 as any,
|
|
20
|
+
enable: true,
|
|
21
|
+
icon: void 0 as any,
|
|
22
|
+
rightIcon: false,
|
|
23
|
+
iconIsLoading: false,
|
|
24
|
+
text: "确定",
|
|
25
|
+
type: "primary",
|
|
26
|
+
callback: function (eventConfig) {
|
|
27
|
+
eventConfig.close();
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
close: {
|
|
31
|
+
enable: true,
|
|
32
|
+
callback: function (eventConfig) {
|
|
33
|
+
eventConfig.close();
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
useShadowRoot: true,
|
|
38
|
+
class: "",
|
|
39
|
+
only: false,
|
|
40
|
+
width: window.innerWidth < 550 ? "88vw" : "350px",
|
|
41
|
+
height: window.innerHeight < 450 ? "70vh" : "200px",
|
|
42
|
+
position: "center",
|
|
43
|
+
animation: "pops-anim-fadein-zoom",
|
|
44
|
+
zIndex: 10000,
|
|
45
|
+
mask: {
|
|
46
|
+
enable: false,
|
|
47
|
+
clickEvent: {
|
|
48
|
+
toClose: false,
|
|
49
|
+
toHide: false,
|
|
50
|
+
},
|
|
51
|
+
clickCallBack: null,
|
|
52
|
+
},
|
|
53
|
+
drag: false,
|
|
54
|
+
dragLimit: true,
|
|
55
|
+
dragExtraDistance: 3,
|
|
56
|
+
dragMoveCallBack() {},
|
|
57
|
+
dragEndCallBack() {},
|
|
58
|
+
forbiddenScroll: false,
|
|
59
|
+
style: null,
|
|
60
|
+
beforeAppendToPageCallBack() {},
|
|
61
|
+
} as DeepRequired<PopsAlertConfig>;
|
|
62
|
+
};
|