@whitesev/pops 1.6.2 → 1.6.3
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/dist/index.amd.js +891 -872
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +891 -872
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +891 -872
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +891 -872
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +891 -872
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +891 -872
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/components/alert/config.d.ts +1 -1
- package/dist/types/src/components/confirm/config.d.ts +1 -1
- package/dist/types/src/components/drawer/config.d.ts +1 -1
- package/dist/types/src/components/folder/config.d.ts +1 -1
- package/dist/types/src/components/iframe/config.d.ts +1 -1
- package/dist/types/src/components/loading/config.d.ts +1 -1
- package/dist/types/src/components/panel/config.d.ts +1 -1
- package/dist/types/src/components/prompt/config.d.ts +1 -1
- package/dist/types/src/components/searchSuggestion/config.d.ts +1 -1
- package/dist/types/src/components/tooltip/config.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/alert/config.ts +54 -52
- package/src/components/alert/index.ts +1 -1
- package/src/components/confirm/config.ts +80 -78
- package/src/components/confirm/index.ts +1 -1
- package/src/components/drawer/config.ts +74 -72
- package/src/components/drawer/index.ts +1 -1
- package/src/components/folder/config.ts +119 -117
- package/src/components/folder/index.ts +1 -1
- package/src/components/iframe/config.ts +52 -50
- package/src/components/iframe/index.ts +1 -1
- package/src/components/loading/config.ts +23 -21
- package/src/components/loading/index.ts +1 -1
- package/src/components/panel/config.ts +320 -318
- package/src/components/panel/index.ts +2 -4
- package/src/components/prompt/config.ts +88 -86
- package/src/components/prompt/index.ts +1 -1
- package/src/components/rightClickMenu/config.ts +2 -4
- package/src/components/searchSuggestion/config.ts +56 -53
- package/src/components/searchSuggestion/index.ts +1 -1
- package/src/components/tooltip/config.ts +26 -24
- package/src/components/tooltip/index.ts +1 -1
|
@@ -4,9 +4,7 @@ import { pops } from "../../Pops";
|
|
|
4
4
|
import { popsDOMUtils } from "../../utils/PopsDOMUtils";
|
|
5
5
|
import { PopsInstanceUtils } from "../../utils/PopsInstanceUtils";
|
|
6
6
|
import { popsUtils } from "../../utils/PopsUtils";
|
|
7
|
-
import type {
|
|
8
|
-
PopsPanelDetails,
|
|
9
|
-
} from "./indexType";
|
|
7
|
+
import type { PopsPanelDetails } from "./indexType";
|
|
10
8
|
import { PopsPanelConfig } from "./config";
|
|
11
9
|
import { PanelHandleContentDetails } from "./PanelHandleContentDetails";
|
|
12
10
|
|
|
@@ -23,7 +21,7 @@ export class PopsPanel {
|
|
|
23
21
|
pops.config.cssText.panelCSS,
|
|
24
22
|
]);
|
|
25
23
|
|
|
26
|
-
let config: Required<PopsPanelDetails> = PopsPanelConfig;
|
|
24
|
+
let config: Required<PopsPanelDetails> = PopsPanelConfig();
|
|
27
25
|
config = popsUtils.assign(config, details);
|
|
28
26
|
if (details && Array.isArray(details.content)) {
|
|
29
27
|
config.content = details.content;
|
|
@@ -1,102 +1,104 @@
|
|
|
1
1
|
import type { PopsPromptDetails } from "./indexType";
|
|
2
2
|
|
|
3
|
-
export const PopsPromptConfig: Required<PopsPromptDetails>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
3
|
+
export const PopsPromptConfig = (): Required<PopsPromptDetails> => {
|
|
4
|
+
return {
|
|
5
|
+
title: {
|
|
6
|
+
text: "默认标题",
|
|
7
|
+
position: "left",
|
|
8
|
+
html: false,
|
|
9
|
+
style: "",
|
|
10
|
+
},
|
|
11
|
+
content: {
|
|
12
|
+
text: "",
|
|
13
|
+
select: false,
|
|
14
|
+
password: false,
|
|
15
|
+
row: false,
|
|
16
|
+
focus: true,
|
|
17
|
+
placeholder: "默认提示",
|
|
18
|
+
style: "",
|
|
19
|
+
},
|
|
20
|
+
btn: {
|
|
21
|
+
merge: false,
|
|
22
|
+
mergeReverse: false,
|
|
23
|
+
reverse: false,
|
|
24
|
+
position: "flex-end",
|
|
25
|
+
ok: {
|
|
26
|
+
enable: true,
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
size: void 0,
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
icon: void 0,
|
|
31
|
+
rightIcon: false,
|
|
32
|
+
iconIsLoading: false,
|
|
33
|
+
text: "确定",
|
|
34
|
+
type: "success",
|
|
35
|
+
callback(event) {
|
|
36
|
+
console.log(event);
|
|
37
|
+
event.close();
|
|
38
|
+
},
|
|
37
39
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
enable: true,
|
|
40
|
+
cancel: {
|
|
41
|
+
enable: true,
|
|
41
42
|
|
|
42
|
-
|
|
43
|
+
size: void 0,
|
|
43
44
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
icon: void 0,
|
|
46
|
+
rightIcon: false,
|
|
47
|
+
iconIsLoading: false,
|
|
48
|
+
text: "关闭",
|
|
49
|
+
type: "default",
|
|
50
|
+
callback(event) {
|
|
51
|
+
console.log(event);
|
|
52
|
+
event.close();
|
|
53
|
+
},
|
|
52
54
|
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
enable: false,
|
|
55
|
+
other: {
|
|
56
|
+
enable: false,
|
|
56
57
|
|
|
57
|
-
|
|
58
|
+
size: void 0,
|
|
58
59
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
60
|
+
icon: void 0,
|
|
61
|
+
rightIcon: false,
|
|
62
|
+
iconIsLoading: false,
|
|
63
|
+
text: "其它按钮",
|
|
64
|
+
type: "default",
|
|
65
|
+
callback(event) {
|
|
66
|
+
console.log(event);
|
|
67
|
+
event.close();
|
|
68
|
+
},
|
|
67
69
|
},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
close: {
|
|
71
|
+
enable: true,
|
|
72
|
+
callback(event) {
|
|
73
|
+
console.log(event);
|
|
74
|
+
event.close();
|
|
75
|
+
},
|
|
74
76
|
},
|
|
75
77
|
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
},
|
|
78
|
+
class: "",
|
|
79
|
+
only: false,
|
|
80
|
+
width: "350px",
|
|
81
|
+
height: "200px",
|
|
82
|
+
position: "center",
|
|
83
|
+
animation: "pops-anim-fadein-zoom",
|
|
84
|
+
zIndex: 10000,
|
|
85
|
+
mask: {
|
|
86
|
+
enable: false,
|
|
87
|
+
clickEvent: {
|
|
88
|
+
toClose: false,
|
|
89
|
+
toHide: false,
|
|
90
|
+
},
|
|
90
91
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
92
|
+
clickCallBack: void 0,
|
|
93
|
+
},
|
|
94
|
+
drag: false,
|
|
95
|
+
dragLimit: true,
|
|
96
|
+
dragExtraDistance: 3,
|
|
97
|
+
dragMoveCallBack() {},
|
|
98
|
+
dragEndCallBack() {},
|
|
99
|
+
forbiddenScroll: false,
|
|
99
100
|
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
style: null,
|
|
102
|
+
beforeAppendToPageCallBack() {},
|
|
103
|
+
};
|
|
102
104
|
};
|
|
@@ -19,7 +19,7 @@ export class PopsPrompt {
|
|
|
19
19
|
pops.config.cssText.common,
|
|
20
20
|
pops.config.cssText.promptCSS,
|
|
21
21
|
]);
|
|
22
|
-
let config: Required<PopsPromptDetails> = PopsPromptConfig;
|
|
22
|
+
let config: Required<PopsPromptDetails> = PopsPromptConfig();
|
|
23
23
|
config = popsUtils.assign(config, details);
|
|
24
24
|
let guid = popsUtils.getRandomGUID();
|
|
25
25
|
const PopsType = "prompt";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { pops } from "../../Pops";
|
|
2
2
|
import type { PopsRightClickMenuDetails } from "./indexType";
|
|
3
3
|
|
|
4
|
-
export const rightClickMenuConfig = () => {
|
|
5
|
-
|
|
4
|
+
export const rightClickMenuConfig = (): Required<PopsRightClickMenuDetails> => {
|
|
5
|
+
return {
|
|
6
6
|
target: document.documentElement,
|
|
7
7
|
targetSelector: null,
|
|
8
8
|
data: [
|
|
@@ -117,6 +117,4 @@ export const rightClickMenuConfig = () => {
|
|
|
117
117
|
style: null,
|
|
118
118
|
beforeAppendToPageCallBack() {},
|
|
119
119
|
};
|
|
120
|
-
|
|
121
|
-
return config;
|
|
122
120
|
};
|
|
@@ -1,55 +1,58 @@
|
|
|
1
1
|
import type { PopsSearchSuggestionDetails } from "./indexType";
|
|
2
2
|
|
|
3
|
-
export const searchSuggestionConfig
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
3
|
+
export const searchSuggestionConfig =
|
|
4
|
+
(): Required<PopsSearchSuggestionDetails> => {
|
|
5
|
+
return {
|
|
6
|
+
// @ts-ignore
|
|
7
|
+
target: null,
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
inputTarget: null,
|
|
10
|
+
selfDocument: document,
|
|
11
|
+
data: [
|
|
12
|
+
{
|
|
13
|
+
value: "数据1",
|
|
14
|
+
text: "数据1-html",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
value: "数据2",
|
|
18
|
+
text: "数据2-html",
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
deleteIcon: {
|
|
22
|
+
enable: true,
|
|
23
|
+
callback(event, liElement, data) {
|
|
24
|
+
console.log("删除当前项", [event, liElement, data]);
|
|
25
|
+
liElement.remove();
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
className: "",
|
|
29
|
+
isAbsolute: true,
|
|
30
|
+
isAnimation: true,
|
|
31
|
+
width: "250px",
|
|
32
|
+
maxHeight: "300px",
|
|
33
|
+
followTargetWidth: true,
|
|
34
|
+
topDistance: 0,
|
|
35
|
+
position: "auto",
|
|
36
|
+
positionTopToReverse: true,
|
|
37
|
+
zIndex: 10000,
|
|
38
|
+
searchingTip: "正在搜索中...",
|
|
39
|
+
toSearhNotResultHTML: '<li data-none="true">暂无其它数据</li>',
|
|
40
|
+
toHideWithNotResult: false,
|
|
41
|
+
followPosition: "target",
|
|
42
|
+
getItemHTML(item) {
|
|
43
|
+
return item.text ?? item;
|
|
44
|
+
},
|
|
45
|
+
async getData(value) {
|
|
46
|
+
console.log("当前输入框的值是:", value);
|
|
47
|
+
return [];
|
|
48
|
+
},
|
|
49
|
+
itemClickCallBack(event, liElement, data) {
|
|
50
|
+
console.log("item项的点击回调", [event, liElement, data]);
|
|
51
|
+
this.inputTarget.value = data.value;
|
|
52
|
+
},
|
|
53
|
+
selectCallBack(event, liElement, data) {
|
|
54
|
+
console.log("item项的选中回调", [event, liElement, data]);
|
|
55
|
+
},
|
|
56
|
+
style: "",
|
|
57
|
+
};
|
|
58
|
+
};
|
|
@@ -15,7 +15,7 @@ export class PopsSearchSuggestion {
|
|
|
15
15
|
]);
|
|
16
16
|
|
|
17
17
|
let config: Required<PopsSearchSuggestionDetails> =
|
|
18
|
-
PopsSearchSuggestionConfig;
|
|
18
|
+
PopsSearchSuggestionConfig();
|
|
19
19
|
config = popsUtils.assign(config, details);
|
|
20
20
|
if (config.target == null) {
|
|
21
21
|
throw new TypeError("config.target 不能为空");
|
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
import type { PopsToolTipDetails } from "./indexType";
|
|
2
2
|
|
|
3
|
-
export const PopsTooltipConfig: Required<PopsToolTipDetails>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
export const PopsTooltipConfig = (): Required<PopsToolTipDetails> => {
|
|
4
|
+
return {
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
target: null,
|
|
7
|
+
content: "默认文字",
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
position: "top",
|
|
10
|
+
className: "",
|
|
11
|
+
alwaysShow: false,
|
|
12
|
+
triggerShowEventName: "mouseenter touchstart",
|
|
13
|
+
triggerCloseEventName: "mouseleave touchend",
|
|
14
|
+
zIndex: 10000,
|
|
15
|
+
only: false,
|
|
16
|
+
eventOption: {
|
|
17
|
+
passive: false,
|
|
18
|
+
capture: true,
|
|
19
|
+
once: false,
|
|
20
|
+
},
|
|
21
|
+
showBeforeCallBack() {},
|
|
22
|
+
showAfterCallBack() {},
|
|
23
|
+
closeBeforeCallBack() {},
|
|
24
|
+
closeAfterCallBack() {},
|
|
25
|
+
arrowDistance: 12.5,
|
|
26
|
+
otherDistance: 0,
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
style: "",
|
|
29
|
+
beforeAppendToPageCallBack() {},
|
|
30
|
+
};
|
|
29
31
|
};
|
|
@@ -15,7 +15,7 @@ export class PopsTooltip {
|
|
|
15
15
|
pops.config.cssText.tooltipCSS,
|
|
16
16
|
]);
|
|
17
17
|
|
|
18
|
-
let config: Required<PopsToolTipDetails> = PopsTooltipConfig;
|
|
18
|
+
let config: Required<PopsToolTipDetails> = PopsTooltipConfig();
|
|
19
19
|
config = popsUtils.assign(config, details);
|
|
20
20
|
if (!(config.target instanceof HTMLElement)) {
|
|
21
21
|
throw "config.target 必须是HTMLElement类型";
|