@whitesev/pops 2.4.6 → 2.4.7
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 +578 -571
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +578 -571
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +578 -571
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +578 -571
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +578 -571
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +578 -571
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +252 -252
- package/dist/types/src/types/animation.d.ts +19 -19
- package/dist/types/src/types/button.d.ts +187 -187
- package/dist/types/src/types/components.d.ts +210 -210
- package/dist/types/src/types/event.d.ts +63 -63
- package/dist/types/src/types/global.d.ts +25 -25
- package/dist/types/src/types/icon.d.ts +32 -32
- package/dist/types/src/types/inst.d.ts +24 -24
- package/dist/types/src/types/main.d.ts +111 -111
- package/dist/types/src/types/mask.d.ts +49 -49
- package/dist/types/src/types/position.d.ts +60 -60
- package/index.ts +3 -0
- package/package.json +4 -2
- package/src/Pops.ts +206 -0
- package/src/PopsAnimation.ts +32 -0
- package/src/PopsCSS.ts +51 -0
- package/src/PopsCore.ts +64 -0
- package/src/PopsIcon.ts +95 -0
- package/src/PopsInst.ts +21 -0
- package/src/components/alert/config.ts +62 -0
- package/src/components/alert/index.css +0 -0
- package/src/components/alert/index.ts +163 -0
- package/src/components/alert/types/index.ts +23 -0
- package/src/components/confirm/config.ts +90 -0
- package/src/components/confirm/index.css +0 -0
- package/src/components/confirm/index.ts +166 -0
- package/src/components/confirm/types/index.ts +17 -0
- package/src/components/drawer/config.ts +89 -0
- package/src/components/drawer/index.css +37 -0
- package/src/components/drawer/index.ts +237 -0
- package/src/components/drawer/types/index.ts +61 -0
- package/src/components/folder/config.ts +147 -0
- package/src/components/folder/folderIcon.ts +28 -0
- package/src/components/folder/index.css +303 -0
- package/src/components/folder/index.ts +929 -0
- package/src/components/folder/types/index.ts +97 -0
- package/src/components/iframe/config.ts +60 -0
- package/src/components/iframe/index.css +76 -0
- package/src/components/iframe/index.ts +334 -0
- package/src/components/iframe/types/index.ts +139 -0
- package/src/components/loading/config.ts +29 -0
- package/src/components/loading/index.css +66 -0
- package/src/components/loading/index.ts +99 -0
- package/src/components/loading/types/index.ts +34 -0
- package/src/components/panel/config.ts +519 -0
- package/src/components/panel/handlerComponents.ts +2900 -0
- package/src/components/panel/index.css +1222 -0
- package/src/components/panel/index.ts +207 -0
- package/src/components/panel/types/components-button.ts +68 -0
- package/src/components/panel/types/components-common.ts +50 -0
- package/src/components/panel/types/components-deepMenu.ts +84 -0
- package/src/components/panel/types/components-forms.ts +44 -0
- package/src/components/panel/types/components-input.ts +78 -0
- package/src/components/panel/types/components-own.ts +30 -0
- package/src/components/panel/types/components-select.ts +93 -0
- package/src/components/panel/types/components-selectMultiple.ts +130 -0
- package/src/components/panel/types/components-slider.ts +77 -0
- package/src/components/panel/types/components-switch.ts +56 -0
- package/src/components/panel/types/components-textarea.ts +68 -0
- package/src/components/panel/types/index.ts +177 -0
- package/src/components/prompt/config.ts +94 -0
- package/src/components/prompt/index.css +34 -0
- package/src/components/prompt/index.ts +216 -0
- package/src/components/prompt/types/index.ts +55 -0
- package/src/components/rightClickMenu/config.ts +98 -0
- package/src/components/rightClickMenu/index.css +112 -0
- package/src/components/rightClickMenu/index.ts +602 -0
- package/src/components/rightClickMenu/types/index.ts +97 -0
- package/src/components/searchSuggestion/config.ts +56 -0
- package/src/components/searchSuggestion/index.ts +856 -0
- package/src/components/searchSuggestion/types/index.ts +239 -0
- package/src/components/tooltip/config.ts +34 -0
- package/src/components/tooltip/index.css +199 -0
- package/src/components/tooltip/index.ts +604 -0
- package/src/components/tooltip/types/index.ts +117 -0
- package/src/config/CommonCSSClassName.ts +17 -0
- package/src/config/GlobalConfig.ts +63 -0
- package/src/css/animation.css +987 -0
- package/src/css/button.css +551 -0
- package/src/css/common.css +48 -0
- package/src/css/index.css +253 -0
- package/src/css/ninePalaceGridPosition.css +50 -0
- package/src/css/scrollbar.css +22 -0
- package/src/handler/PopsElementHandler.ts +304 -0
- package/src/handler/PopsHandler.ts +589 -0
- package/src/svg/arrowLeft.svg +4 -0
- package/src/svg/arrowRight.svg +4 -0
- package/src/svg/chromeFilled.svg +11 -0
- package/src/svg/circleClose.svg +8 -0
- package/src/svg/close.svg +5 -0
- package/src/svg/cpu.svg +8 -0
- package/src/svg/delete.svg +5 -0
- package/src/svg/documentCopy.svg +5 -0
- package/src/svg/edit.svg +8 -0
- package/src/svg/eleme.svg +5 -0
- package/src/svg/elemePlus.svg +5 -0
- package/src/svg/headset.svg +5 -0
- package/src/svg/hide.svg +8 -0
- package/src/svg/keyboard.svg +8 -0
- package/src/svg/loading.svg +5 -0
- package/src/svg/max.svg +5 -0
- package/src/svg/min.svg +5 -0
- package/src/svg/mise.svg +5 -0
- package/src/svg/monitor.svg +5 -0
- package/src/svg/next.svg +5 -0
- package/src/svg/picture.svg +8 -0
- package/src/svg/prev.svg +5 -0
- package/src/svg/search.svg +5 -0
- package/src/svg/share.svg +5 -0
- package/src/svg/upload.svg +5 -0
- package/src/svg/videoPause.svg +5 -0
- package/src/svg/videoPlay.svg +5 -0
- package/src/svg/view.svg +5 -0
- package/src/types/PopsDOMUtilsEventType.d.ts +252 -0
- package/src/types/animation.d.ts +19 -0
- package/src/types/button.d.ts +187 -0
- package/src/types/components.d.ts +210 -0
- package/src/types/event.d.ts +63 -0
- package/src/types/global.d.ts +25 -0
- package/src/types/icon.d.ts +32 -0
- package/src/types/inst.d.ts +24 -0
- package/src/types/main.d.ts +111 -0
- package/src/types/mask.d.ts +49 -0
- package/src/types/position.d.ts +60 -0
- package/src/utils/PopsDOMUtils.ts +2408 -0
- package/src/utils/PopsDOMUtilsEventsConfig.ts +4 -0
- package/src/utils/PopsInstanceUtils.ts +688 -0
- package/src/utils/PopsMathUtils.ts +71 -0
- package/src/utils/PopsSafeUtils.ts +22 -0
- package/src/utils/PopsUtils.ts +406 -0
|
@@ -0,0 +1,216 @@
|
|
|
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 type { PopsType } from "../../types/main";
|
|
6
|
+
import { popsDOMUtils } from "../../utils/PopsDOMUtils";
|
|
7
|
+
import { PopsInstanceUtils } from "../../utils/PopsInstanceUtils";
|
|
8
|
+
import { popsUtils } from "../../utils/PopsUtils";
|
|
9
|
+
import { PopsPromptConfig } from "./config";
|
|
10
|
+
import type { PopsPromptDetails } from "./types/index";
|
|
11
|
+
|
|
12
|
+
export const PopsPrompt = {
|
|
13
|
+
init(details: PopsPromptDetails) {
|
|
14
|
+
const guid = popsUtils.getRandomGUID();
|
|
15
|
+
// 设置当前类型
|
|
16
|
+
const popsType: PopsType = "prompt";
|
|
17
|
+
|
|
18
|
+
let config = PopsPromptConfig();
|
|
19
|
+
config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
|
|
20
|
+
config = popsUtils.assign(config, details);
|
|
21
|
+
config = PopsHandler.handleOnly(popsType, config);
|
|
22
|
+
|
|
23
|
+
const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
|
|
24
|
+
PopsHandler.handleInit($shadowRoot, [
|
|
25
|
+
{
|
|
26
|
+
name: "index",
|
|
27
|
+
css: PopsCSS.index,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: "ninePalaceGridPosition",
|
|
31
|
+
css: PopsCSS.ninePalaceGridPosition,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "scrollbar",
|
|
35
|
+
css: PopsCSS.scrollbar,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: "button",
|
|
39
|
+
css: PopsCSS.button,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "anim",
|
|
43
|
+
css: PopsCSS.anim,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: "common",
|
|
47
|
+
css: PopsCSS.common,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "promptCSS",
|
|
51
|
+
css: PopsCSS.promptCSS,
|
|
52
|
+
},
|
|
53
|
+
]);
|
|
54
|
+
|
|
55
|
+
// 先把z-index提取出来
|
|
56
|
+
const zIndex = PopsHandler.handleZIndex(config.zIndex);
|
|
57
|
+
const maskHTML = PopsElementHandler.createMask(guid, zIndex);
|
|
58
|
+
|
|
59
|
+
const headerBtnHTML = PopsElementHandler.createHeader(popsType, config);
|
|
60
|
+
const bottomBtnHTML = PopsElementHandler.createBottom(popsType, config);
|
|
61
|
+
const { headerStyle, headerPStyle } = PopsElementHandler.createHeaderStyle(popsType, config);
|
|
62
|
+
const { contentPStyle } = PopsElementHandler.createContentStyle(popsType, config);
|
|
63
|
+
const animHTML = PopsElementHandler.createAnim(
|
|
64
|
+
guid,
|
|
65
|
+
popsType,
|
|
66
|
+
config,
|
|
67
|
+
/*html*/ `
|
|
68
|
+
<div class="pops-title pops-${popsType}-title" style="text-align: ${
|
|
69
|
+
config.title.position
|
|
70
|
+
};${headerStyle}">${
|
|
71
|
+
config.title.html
|
|
72
|
+
? config.title.text
|
|
73
|
+
: `<p pops class="pops-${popsType}-title-text" style="${headerPStyle}">${config.title.text}</p>`
|
|
74
|
+
}${headerBtnHTML}</div>
|
|
75
|
+
<div class="pops-content pops-${popsType}-content" style="${contentPStyle}">${
|
|
76
|
+
config.content.row
|
|
77
|
+
? '<textarea name="pops-input-text" pops="" placeholder="' +
|
|
78
|
+
config.content.placeholder +
|
|
79
|
+
'"></textarea>'
|
|
80
|
+
: '<input name="pops-input-text" pops="" placeholder="' +
|
|
81
|
+
config.content.placeholder +
|
|
82
|
+
'" type="' +
|
|
83
|
+
(config.content.password ? "password" : "text") +
|
|
84
|
+
'">'
|
|
85
|
+
}</div>${bottomBtnHTML}`,
|
|
86
|
+
bottomBtnHTML,
|
|
87
|
+
zIndex
|
|
88
|
+
);
|
|
89
|
+
/**
|
|
90
|
+
* 弹窗的主元素,包括动画层
|
|
91
|
+
*/
|
|
92
|
+
|
|
93
|
+
const $anim = PopsElementHandler.parseElement<HTMLDivElement>(animHTML);
|
|
94
|
+
|
|
95
|
+
const {
|
|
96
|
+
popsElement: $pops,
|
|
97
|
+
inputElement: $input,
|
|
98
|
+
headerCloseBtnElement: $btnClose,
|
|
99
|
+
btnOkElement: $btnOk,
|
|
100
|
+
btnCancelElement: $btnCancel,
|
|
101
|
+
btnOtherElement: $btnOther,
|
|
102
|
+
titleElement: $title,
|
|
103
|
+
} = PopsHandler.handleQueryElement($anim, popsType);
|
|
104
|
+
/**
|
|
105
|
+
* 遮罩层元素
|
|
106
|
+
*/
|
|
107
|
+
let $mask: HTMLDivElement | null = null;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* 已创建的元素列表
|
|
111
|
+
*/
|
|
112
|
+
const elementList: HTMLElement[] = [$anim];
|
|
113
|
+
|
|
114
|
+
if (config.mask.enable) {
|
|
115
|
+
// 启用遮罩层
|
|
116
|
+
const _handleMask_ = PopsHandler.handleMask({
|
|
117
|
+
type: popsType,
|
|
118
|
+
guid: guid,
|
|
119
|
+
config: config,
|
|
120
|
+
animElement: $anim,
|
|
121
|
+
maskHTML: maskHTML,
|
|
122
|
+
});
|
|
123
|
+
$mask = _handleMask_.maskElement;
|
|
124
|
+
elementList.push($mask);
|
|
125
|
+
}
|
|
126
|
+
const eventDetails = PopsHandler.handleEventDetails(
|
|
127
|
+
guid,
|
|
128
|
+
$shadowContainer,
|
|
129
|
+
$shadowRoot,
|
|
130
|
+
popsType,
|
|
131
|
+
$anim,
|
|
132
|
+
|
|
133
|
+
$pops!,
|
|
134
|
+
$mask!,
|
|
135
|
+
config
|
|
136
|
+
);
|
|
137
|
+
/* 输入框赋值初始值 */
|
|
138
|
+
|
|
139
|
+
$input!.value = config.content.text;
|
|
140
|
+
PopsHandler.handlePromptClickEvent(
|
|
141
|
+
"close",
|
|
142
|
+
$input!,
|
|
143
|
+
$btnClose!,
|
|
144
|
+
eventDetails,
|
|
145
|
+
|
|
146
|
+
config.btn.close!.callback!
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
PopsHandler.handlePromptClickEvent(
|
|
150
|
+
"ok",
|
|
151
|
+
$input!,
|
|
152
|
+
$btnOk!,
|
|
153
|
+
eventDetails,
|
|
154
|
+
|
|
155
|
+
config.btn.ok!.callback!
|
|
156
|
+
);
|
|
157
|
+
PopsHandler.handlePromptClickEvent(
|
|
158
|
+
"cancel",
|
|
159
|
+
$input!,
|
|
160
|
+
$btnCancel!,
|
|
161
|
+
eventDetails,
|
|
162
|
+
|
|
163
|
+
config.btn.cancel!.callback!
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
PopsHandler.handlePromptClickEvent(
|
|
167
|
+
"other",
|
|
168
|
+
$input!,
|
|
169
|
+
$btnOther!,
|
|
170
|
+
eventDetails,
|
|
171
|
+
|
|
172
|
+
config.btn.other!.callback!
|
|
173
|
+
);
|
|
174
|
+
/* 创建到页面中 */
|
|
175
|
+
|
|
176
|
+
popsDOMUtils.append($shadowRoot, elementList);
|
|
177
|
+
if (typeof config.beforeAppendToPageCallBack === "function") {
|
|
178
|
+
config.beforeAppendToPageCallBack($shadowRoot, $shadowContainer);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
popsDOMUtils.appendBody($shadowContainer);
|
|
182
|
+
if ($mask != null) {
|
|
183
|
+
$anim.after($mask);
|
|
184
|
+
}
|
|
185
|
+
PopsHandler.handlePush(popsType, {
|
|
186
|
+
guid: guid,
|
|
187
|
+
animElement: $anim,
|
|
188
|
+
|
|
189
|
+
popsElement: $pops!,
|
|
190
|
+
|
|
191
|
+
maskElement: $mask!,
|
|
192
|
+
$shadowContainer: $shadowContainer,
|
|
193
|
+
$shadowRoot: $shadowRoot,
|
|
194
|
+
});
|
|
195
|
+
/* 拖拽 */
|
|
196
|
+
if (config.drag) {
|
|
197
|
+
PopsInstanceUtils.drag($pops!, {
|
|
198
|
+
dragElement: $title!,
|
|
199
|
+
limit: config.dragLimit,
|
|
200
|
+
extraDistance: config.dragExtraDistance,
|
|
201
|
+
moveCallBack: config.dragMoveCallBack,
|
|
202
|
+
endCallBack: config.dragEndCallBack,
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
/* 设置自动获取焦点 */
|
|
206
|
+
if (config.content.focus) {
|
|
207
|
+
$input.focus();
|
|
208
|
+
}
|
|
209
|
+
/* 设置自动选中所有文字 */
|
|
210
|
+
if (config.content.select) {
|
|
211
|
+
$input.select();
|
|
212
|
+
}
|
|
213
|
+
const result = PopsHandler.handleResultDetails(eventDetails);
|
|
214
|
+
return result;
|
|
215
|
+
},
|
|
216
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
PopsTitleConfig,
|
|
3
|
+
PopsDragConfig,
|
|
4
|
+
PopsCommonConfig,
|
|
5
|
+
PopsMoreButtonConfig,
|
|
6
|
+
} from "../../../types/components";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* pops.prompt
|
|
10
|
+
*/
|
|
11
|
+
export interface PopsPromptDetails
|
|
12
|
+
extends PopsTitleConfig,
|
|
13
|
+
PopsDragConfig,
|
|
14
|
+
PopsMoreButtonConfig<{
|
|
15
|
+
text: string;
|
|
16
|
+
}>,
|
|
17
|
+
PopsCommonConfig {
|
|
18
|
+
/**
|
|
19
|
+
* 内容配置
|
|
20
|
+
*/
|
|
21
|
+
content: {
|
|
22
|
+
/**
|
|
23
|
+
* 内容文字
|
|
24
|
+
*/
|
|
25
|
+
text: string;
|
|
26
|
+
/**
|
|
27
|
+
* 是否是密码
|
|
28
|
+
*/
|
|
29
|
+
password?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* 是否支持多行输入
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
row?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* 是否自动获取焦点
|
|
37
|
+
* @default true
|
|
38
|
+
*/
|
|
39
|
+
focus?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* 是否自动选择输入框的所有文字
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
select?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* 输入框内的提示文字
|
|
47
|
+
* @default ""
|
|
48
|
+
*/
|
|
49
|
+
placeholder?: string;
|
|
50
|
+
/**
|
|
51
|
+
* (可选)文字的自定义CSS
|
|
52
|
+
*/
|
|
53
|
+
style?: string;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { PopsIcon } from "../../PopsIcon";
|
|
2
|
+
import type { PopsRightClickMenuDetails } from "./types";
|
|
3
|
+
|
|
4
|
+
export const rightClickMenuConfig = (): DeepRequired<PopsRightClickMenuDetails> => {
|
|
5
|
+
return {
|
|
6
|
+
target: document.documentElement,
|
|
7
|
+
targetSelector: null,
|
|
8
|
+
data: [
|
|
9
|
+
{
|
|
10
|
+
icon: PopsIcon.getIcon("search")!,
|
|
11
|
+
iconIsLoading: false,
|
|
12
|
+
text: "搜索",
|
|
13
|
+
item: [],
|
|
14
|
+
callback(clickEvent, contextMenuEvent, liElement) {
|
|
15
|
+
console.log("点击:" + this.text, [clickEvent, contextMenuEvent, liElement]);
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
icon: PopsIcon.getIcon("documentCopy")!,
|
|
20
|
+
iconIsLoading: false,
|
|
21
|
+
text: "复制",
|
|
22
|
+
item: [],
|
|
23
|
+
callback(clickEvent, contextMenuEvent, liElement) {
|
|
24
|
+
console.log("点击:" + this.text, [clickEvent, contextMenuEvent, liElement]);
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
icon: PopsIcon.getIcon("delete")!,
|
|
29
|
+
text: "删除",
|
|
30
|
+
iconIsLoading: false,
|
|
31
|
+
item: [],
|
|
32
|
+
callback(clickEvent, contextMenuEvent, liElement) {
|
|
33
|
+
console.log("点击:" + this.text, [clickEvent, contextMenuEvent, liElement]);
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
icon: PopsIcon.getIcon("loading")!,
|
|
38
|
+
iconIsLoading: true,
|
|
39
|
+
text: "加载",
|
|
40
|
+
item: [],
|
|
41
|
+
callback(clickEvent, contextMenuEvent, liElement) {
|
|
42
|
+
console.log("点击:" + this.text, [clickEvent, contextMenuEvent, liElement]);
|
|
43
|
+
return false;
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
icon: PopsIcon.getIcon("elemePlus")!,
|
|
48
|
+
iconIsLoading: true,
|
|
49
|
+
text: "饿了么",
|
|
50
|
+
callback(clickEvent, contextMenuEvent, liElement) {
|
|
51
|
+
console.log("点击:" + this.text, [clickEvent, contextMenuEvent, liElement]);
|
|
52
|
+
return false;
|
|
53
|
+
},
|
|
54
|
+
item: [
|
|
55
|
+
{
|
|
56
|
+
icon: "",
|
|
57
|
+
iconIsLoading: false,
|
|
58
|
+
text: "处理文件",
|
|
59
|
+
item: [],
|
|
60
|
+
callback(clickEvent, contextMenuEvent, liElement) {
|
|
61
|
+
console.log("点击:" + this.text, [clickEvent, contextMenuEvent, liElement]);
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
icon: "",
|
|
66
|
+
iconIsLoading: false,
|
|
67
|
+
text: "其它处理",
|
|
68
|
+
callback(clickEvent, contextMenuEvent, liElement) {
|
|
69
|
+
console.log("点击:" + this.text, [clickEvent, contextMenuEvent, liElement]);
|
|
70
|
+
},
|
|
71
|
+
item: [
|
|
72
|
+
{
|
|
73
|
+
icon: PopsIcon.getIcon("view")!,
|
|
74
|
+
iconIsLoading: false,
|
|
75
|
+
text: "查看",
|
|
76
|
+
item: [],
|
|
77
|
+
callback(clickEvent, contextMenuEvent, liElement) {
|
|
78
|
+
console.log("点击:" + this.text, [clickEvent, contextMenuEvent, liElement]);
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
chileMenuLeftOrRightDistance: 0,
|
|
87
|
+
childMenuTopOrBottomDistance: 0,
|
|
88
|
+
useShadowRoot: true,
|
|
89
|
+
className: "",
|
|
90
|
+
isAnimation: false,
|
|
91
|
+
useScaleAnimation: true,
|
|
92
|
+
only: false,
|
|
93
|
+
zIndex: 10000,
|
|
94
|
+
preventDefault: true,
|
|
95
|
+
style: null,
|
|
96
|
+
beforeAppendToPageCallBack() {},
|
|
97
|
+
};
|
|
98
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
.pops-rightClickMenu {
|
|
2
|
+
--pops-right-context-color: #000000;
|
|
3
|
+
--pops-right-context-bg-color: rgb(255, 255, 255, 0.733);
|
|
4
|
+
--pops-right-context-backdrop-filter: blur(10px);
|
|
5
|
+
--pops-right-context-z-index: 10000;
|
|
6
|
+
--pops-right-context-bd-radius: 6px;
|
|
7
|
+
--pops-right-context-menu-shadow-color: rgb(114, 114, 114, 0.251);
|
|
8
|
+
--pops-right-context-menu-row-bd-radius: 6px;
|
|
9
|
+
--pops-right-context-menu-row-visited-color: rgb(0, 0, 0, 0.067);
|
|
10
|
+
--pops-right-context-menu-row-hover-color: rgb(0, 0, 0, 0.067);
|
|
11
|
+
}
|
|
12
|
+
.pops-rightClickMenu * {
|
|
13
|
+
-webkit-box-sizing: border-box;
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
margin: 0;
|
|
16
|
+
padding: 0;
|
|
17
|
+
-webkit-tap-highlight-color: transparent;
|
|
18
|
+
scrollbar-width: thin;
|
|
19
|
+
}
|
|
20
|
+
.pops-rightClickMenu {
|
|
21
|
+
position: fixed;
|
|
22
|
+
z-index: var(--pops-right-context-z-index);
|
|
23
|
+
text-align: center;
|
|
24
|
+
border-radius: var(--pops-right-context-bd-radius);
|
|
25
|
+
font-size: 16px;
|
|
26
|
+
font-weight: 500;
|
|
27
|
+
color: var(--pops-right-context-color);
|
|
28
|
+
background: var(--pops-right-context-bg-color);
|
|
29
|
+
box-shadow: 0 0.25rem 0.5rem 0.125rem var(--pops-right-context-menu-shadow-color);
|
|
30
|
+
-webkit-backdrop-filter: var(--pops-right-context-backdrop-filter);
|
|
31
|
+
backdrop-filter: var(--pops-right-context-backdrop-filter);
|
|
32
|
+
}
|
|
33
|
+
/* scale动画 */
|
|
34
|
+
.pops-rightClickMenu-anim-scale {
|
|
35
|
+
transition:
|
|
36
|
+
opacity 150ms cubic-bezier(0.2, 0, 0.2, 1),
|
|
37
|
+
transform 150ms cubic-bezier(0.2, 0, 0.2, 1);
|
|
38
|
+
transform: scale(0.85);
|
|
39
|
+
}
|
|
40
|
+
.pops-rightClickMenu-anim-scale-open {
|
|
41
|
+
transform: scale(1);
|
|
42
|
+
}
|
|
43
|
+
.pops-rightClickMenu-anim-scale-not-open {
|
|
44
|
+
opacity: 0;
|
|
45
|
+
}
|
|
46
|
+
/* 展开动画 */
|
|
47
|
+
.pops-rightClickMenu-anim-grid {
|
|
48
|
+
display: grid;
|
|
49
|
+
transition: 0.3s;
|
|
50
|
+
grid-template-rows: 0fr;
|
|
51
|
+
}
|
|
52
|
+
.pops-rightClickMenu-anim-show {
|
|
53
|
+
grid-template-rows: 1fr;
|
|
54
|
+
}
|
|
55
|
+
.pops-rightClickMenu-is-visited {
|
|
56
|
+
background: var(--pops-right-context-menu-row-visited-color);
|
|
57
|
+
}
|
|
58
|
+
i.pops-rightClickMenu-icon {
|
|
59
|
+
height: 1em;
|
|
60
|
+
width: 1em;
|
|
61
|
+
line-height: normal;
|
|
62
|
+
align-content: center;
|
|
63
|
+
display: inline-flex;
|
|
64
|
+
justify-content: center;
|
|
65
|
+
align-items: center;
|
|
66
|
+
position: relative;
|
|
67
|
+
fill: currentColor;
|
|
68
|
+
color: inherit;
|
|
69
|
+
font-size: inherit;
|
|
70
|
+
margin-right: 6px;
|
|
71
|
+
}
|
|
72
|
+
i.pops-rightClickMenu-icon[is-loading="true"] {
|
|
73
|
+
animation: rotating 2s linear infinite;
|
|
74
|
+
}
|
|
75
|
+
.pops-rightClickMenu li:hover {
|
|
76
|
+
background: var(--pops-right-context-menu-row-hover-color);
|
|
77
|
+
cursor: pointer;
|
|
78
|
+
}
|
|
79
|
+
.pops-rightClickMenu ul {
|
|
80
|
+
margin: 0;
|
|
81
|
+
padding: 0;
|
|
82
|
+
display: flex;
|
|
83
|
+
flex-direction: column;
|
|
84
|
+
align-items: flex-start;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
overflow: hidden;
|
|
87
|
+
}
|
|
88
|
+
.pops-rightClickMenu ul li {
|
|
89
|
+
padding: 5px 10px;
|
|
90
|
+
margin: 5px 5px;
|
|
91
|
+
border-radius: var(--pops-right-context-menu-row-bd-radius);
|
|
92
|
+
display: flex;
|
|
93
|
+
width: -webkit-fill-available;
|
|
94
|
+
width: -moz-available;
|
|
95
|
+
text-align: left;
|
|
96
|
+
align-items: center;
|
|
97
|
+
-webkit-user-select: none;
|
|
98
|
+
-moz-user-select: none;
|
|
99
|
+
-ms-user-select: none;
|
|
100
|
+
user-select: none;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@media (prefers-color-scheme: dark) {
|
|
104
|
+
/*.pops-rightClickMenu {
|
|
105
|
+
--pops-right-context-menu-shadow-color: #3c3c3c;
|
|
106
|
+
}*/
|
|
107
|
+
}
|
|
108
|
+
@media (hover: hover) {
|
|
109
|
+
.pops-rightClickMenu ul li:active {
|
|
110
|
+
transform: scale(0.98);
|
|
111
|
+
}
|
|
112
|
+
}
|