@whitesev/pops 2.6.0 → 3.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.
- package/dist/index.amd.js +1233 -1092
- 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 +1233 -1092
- 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 +1233 -1092
- 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 +1233 -1092
- 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 +1233 -1092
- 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 +1233 -1092
- 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/eslint.config.d.mts +2 -0
- package/dist/types/src/Pops.d.ts +98 -103
- package/dist/types/src/PopsInst.d.ts +2 -2
- package/dist/types/src/components/alert/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/alert/index.d.ts +2 -2
- package/dist/types/src/components/alert/types/index.d.ts +4 -4
- package/dist/types/src/components/confirm/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/confirm/index.d.ts +2 -2
- package/dist/types/src/components/confirm/types/index.d.ts +2 -2
- package/dist/types/src/components/drawer/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/drawer/index.d.ts +2 -2
- package/dist/types/src/components/drawer/types/index.d.ts +2 -2
- package/dist/types/src/components/folder/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/folder/index.d.ts +2 -2
- package/dist/types/src/components/folder/types/index.d.ts +31 -7
- package/dist/types/src/components/iframe/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/iframe/index.d.ts +2 -5
- package/dist/types/src/components/iframe/types/index.d.ts +13 -42
- package/dist/types/src/components/loading/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/loading/index.d.ts +2 -2
- package/dist/types/src/components/loading/types/index.d.ts +4 -4
- package/dist/types/src/components/panel/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/panel/handlerComponents.d.ts +47 -43
- package/dist/types/src/components/panel/index.d.ts +3 -3
- package/dist/types/src/components/panel/types/components-button.d.ts +7 -6
- package/dist/types/src/components/panel/types/components-common.d.ts +7 -7
- package/dist/types/src/components/panel/types/components-container.d.ts +24 -0
- package/dist/types/src/components/panel/types/components-deepMenu.d.ts +13 -13
- package/dist/types/src/components/panel/types/components-input.d.ts +6 -6
- package/dist/types/src/components/panel/types/components-own.d.ts +2 -2
- package/dist/types/src/components/panel/types/components-select.d.ts +9 -9
- package/dist/types/src/components/panel/types/components-selectMultiple.d.ts +8 -8
- package/dist/types/src/components/panel/types/components-slider.d.ts +7 -7
- package/dist/types/src/components/panel/types/components-switch.d.ts +6 -6
- package/dist/types/src/components/panel/types/components-textarea.d.ts +6 -6
- package/dist/types/src/components/panel/types/index.d.ts +36 -28
- package/dist/types/src/components/prompt/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/prompt/index.d.ts +2 -2
- package/dist/types/src/components/prompt/types/index.d.ts +4 -3
- package/dist/types/src/components/rightClickMenu/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/rightClickMenu/index.d.ts +29 -27
- package/dist/types/src/components/rightClickMenu/types/index.d.ts +32 -11
- package/dist/types/src/components/searchSuggestion/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/searchSuggestion/index.d.ts +21 -6
- package/dist/types/src/components/searchSuggestion/types/index.d.ts +15 -13
- package/dist/types/src/components/tooltip/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/tooltip/index.d.ts +6 -21
- package/dist/types/src/components/tooltip/types/index.d.ts +8 -6
- package/dist/types/src/config/GlobalConfig.d.ts +3 -3
- package/dist/types/src/handler/PopsElementHandler.d.ts +6 -6
- package/dist/types/src/handler/PopsHandler.d.ts +18 -18
- package/dist/types/src/types/button.d.ts +4 -97
- package/dist/types/src/types/components.d.ts +8 -8
- package/dist/types/src/types/event.d.ts +0 -30
- package/dist/types/src/types/global.d.ts +2 -0
- package/dist/types/src/types/inst.d.ts +5 -5
- package/dist/types/src/types/main.d.ts +35 -80
- package/dist/types/src/types/mask.d.ts +18 -15
- package/dist/types/src/utils/PopsInstanceUtils.d.ts +15 -15
- package/dist/types/src/utils/PopsUtils.d.ts +4 -0
- package/package.json +10 -10
- package/src/Pops.ts +44 -44
- package/src/PopsAnimation.ts +1 -1
- package/src/PopsInst.ts +2 -2
- package/src/components/alert/{config.ts → defaultConfig.ts} +7 -7
- package/src/components/alert/index.ts +16 -18
- package/src/components/alert/types/index.ts +4 -4
- package/src/components/confirm/{config.ts → defaultConfig.ts} +11 -11
- package/src/components/confirm/index.ts +11 -13
- package/src/components/confirm/types/index.ts +3 -3
- package/src/components/drawer/{config.ts → defaultConfig.ts} +10 -10
- package/src/components/drawer/index.ts +18 -17
- package/src/components/drawer/types/index.ts +3 -3
- package/src/components/folder/{config.ts → defaultConfig.ts} +22 -18
- package/src/components/folder/index.ts +61 -60
- package/src/components/folder/types/index.ts +31 -18
- package/src/components/iframe/{config.ts → defaultConfig.ts} +2 -2
- package/src/components/iframe/index.ts +24 -29
- package/src/components/iframe/types/index.ts +13 -56
- package/src/components/loading/{config.ts → defaultConfig.ts} +3 -3
- package/src/components/loading/index.ts +13 -11
- package/src/components/loading/types/index.ts +5 -5
- package/src/components/panel/{config.ts → defaultConfig.ts} +115 -37
- package/src/components/panel/handlerComponents.ts +446 -428
- package/src/components/panel/index.css +11 -3
- package/src/components/panel/index.ts +15 -28
- package/src/components/panel/types/components-button.ts +7 -6
- package/src/components/panel/types/components-common.ts +7 -7
- package/src/components/panel/types/components-container.ts +25 -0
- package/src/components/panel/types/components-deepMenu.ts +13 -13
- package/src/components/panel/types/components-input.ts +6 -6
- package/src/components/panel/types/components-own.ts +2 -2
- package/src/components/panel/types/components-select.ts +11 -11
- package/src/components/panel/types/components-selectMultiple.ts +8 -9
- package/src/components/panel/types/components-slider.ts +7 -7
- package/src/components/panel/types/components-switch.ts +6 -6
- package/src/components/panel/types/components-textarea.ts +6 -6
- package/src/components/panel/types/index.ts +45 -38
- package/src/components/prompt/{config.ts → defaultConfig.ts} +10 -10
- package/src/components/prompt/index.ts +13 -15
- package/src/components/prompt/types/index.ts +4 -3
- package/src/components/rightClickMenu/{config.ts → defaultConfig.ts} +20 -19
- package/src/components/rightClickMenu/index.ts +125 -108
- package/src/components/rightClickMenu/types/index.ts +36 -14
- package/src/components/searchSuggestion/{config.ts → defaultConfig.ts} +18 -11
- package/src/components/searchSuggestion/index.ts +116 -96
- package/src/components/searchSuggestion/types/index.ts +17 -15
- package/src/components/tooltip/{config.ts → defaultConfig.ts} +5 -6
- package/src/components/tooltip/index.ts +21 -21
- package/src/components/tooltip/types/index.ts +9 -7
- package/src/config/GlobalConfig.ts +2 -2
- package/src/css/common.css +6 -0
- package/src/handler/PopsElementHandler.ts +29 -30
- package/src/handler/PopsHandler.ts +43 -43
- package/src/svg/cpu.svg +7 -7
- package/src/svg/delete.svg +4 -4
- package/src/svg/documentCopy.svg +4 -4
- package/src/svg/edit.svg +7 -7
- package/src/svg/eleme.svg +4 -4
- package/src/svg/elemePlus.svg +4 -4
- package/src/svg/headset.svg +4 -4
- package/src/svg/hide.svg +7 -7
- package/src/svg/keyboard.svg +7 -7
- package/src/svg/loading.svg +4 -4
- package/src/svg/max.svg +4 -4
- package/src/svg/min.svg +2 -4
- package/src/svg/mise.svg +4 -4
- package/src/svg/monitor.svg +4 -4
- package/src/svg/next.svg +4 -4
- package/src/svg/picture.svg +7 -7
- package/src/svg/prev.svg +4 -4
- package/src/svg/search.svg +4 -4
- package/src/svg/share.svg +4 -4
- package/src/svg/upload.svg +4 -4
- package/src/svg/videoPause.svg +4 -4
- package/src/svg/videoPlay.svg +4 -4
- package/src/svg/view.svg +4 -4
- package/src/types/button.d.ts +4 -97
- package/src/types/components.d.ts +8 -8
- package/src/types/event.d.ts +0 -30
- package/src/types/global.d.ts +2 -0
- package/src/types/inst.d.ts +5 -5
- package/src/types/main.d.ts +35 -80
- package/src/types/mask.d.ts +18 -15
- package/src/utils/PopsDOMUtils.ts +34 -34
- package/src/utils/PopsInstanceUtils.ts +129 -139
- package/src/utils/PopsUtils.ts +60 -45
- package/dist/types/src/components/alert/config.d.ts +0 -2
- package/dist/types/src/components/confirm/config.d.ts +0 -2
- package/dist/types/src/components/drawer/config.d.ts +0 -2
- package/dist/types/src/components/folder/config.d.ts +0 -2
- package/dist/types/src/components/iframe/config.d.ts +0 -2
- package/dist/types/src/components/loading/config.d.ts +0 -2
- package/dist/types/src/components/panel/config.d.ts +0 -2
- package/dist/types/src/components/panel/types/components-forms.d.ts +0 -23
- package/dist/types/src/components/prompt/config.d.ts +0 -2
- package/dist/types/src/components/rightClickMenu/config.d.ts +0 -2
- package/dist/types/src/components/searchSuggestion/config.d.ts +0 -2
- package/dist/types/src/components/tooltip/config.d.ts +0 -2
- package/src/components/panel/types/components-forms.ts +0 -24
|
@@ -4,25 +4,24 @@ import { PopsElementHandler } from "../../handler/PopsElementHandler";
|
|
|
4
4
|
import { PopsHandler } from "../../handler/PopsHandler";
|
|
5
5
|
import { PopsCSS } from "../../PopsCSS";
|
|
6
6
|
import { PopsInstData } from "../../PopsInst";
|
|
7
|
-
import type { PopsEventConfig } from "../../types/event";
|
|
8
7
|
import { popsDOMUtils } from "../../utils/PopsDOMUtils";
|
|
9
8
|
import { PopsInstanceUtils } from "../../utils/PopsInstanceUtils";
|
|
10
9
|
import { popsUtils } from "../../utils/PopsUtils";
|
|
11
|
-
import {
|
|
12
|
-
import type {
|
|
10
|
+
import { PopsIframeDefaultConfig } from "./defaultConfig";
|
|
11
|
+
import type { PopsIframeClickEventConfig, PopsIframeConfig } from "./types";
|
|
13
12
|
import type { PopsType } from "../../types/main";
|
|
14
13
|
|
|
15
14
|
export const PopsIframe = {
|
|
16
|
-
init(
|
|
15
|
+
init(__config__: PopsIframeConfig) {
|
|
17
16
|
const guid = popsUtils.getRandomGUID();
|
|
18
17
|
// 设置当前类型
|
|
19
18
|
const popsType: PopsType = "iframe";
|
|
20
19
|
|
|
21
|
-
let config =
|
|
20
|
+
let config = PopsIframeDefaultConfig();
|
|
22
21
|
config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
|
|
23
|
-
config = popsUtils.assign(config,
|
|
22
|
+
config = popsUtils.assign(config, __config__);
|
|
24
23
|
if (config.url == null) {
|
|
25
|
-
throw new
|
|
24
|
+
throw new TypeError("config.url must not be null.");
|
|
26
25
|
}
|
|
27
26
|
config = PopsHandler.handleOnly(popsType, config);
|
|
28
27
|
|
|
@@ -61,7 +60,7 @@ export const PopsIframe = {
|
|
|
61
60
|
const maskHTML = PopsElementHandler.createMask(guid, zIndex, maskExtraStyle);
|
|
62
61
|
|
|
63
62
|
const headerBtnHTML = PopsElementHandler.createHeader(popsType, config);
|
|
64
|
-
const iframeLoadingHTML = '<div class="pops-loading"></div>';
|
|
63
|
+
const iframeLoadingHTML = /*html*/ '<div class="pops-loading"></div>';
|
|
65
64
|
const titleText = config.title!.text!.trim() !== "" ? config.title.text : config.url;
|
|
66
65
|
const { headerStyle, headerPStyle } = PopsElementHandler.createHeaderStyle(popsType, config);
|
|
67
66
|
const animHTML = PopsElementHandler.createAnim(
|
|
@@ -143,35 +142,33 @@ export const PopsIframe = {
|
|
|
143
142
|
$anim,
|
|
144
143
|
$pops,
|
|
145
144
|
$mask
|
|
146
|
-
) as
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
evtConfig["iframeElement"] = $iframe!;
|
|
145
|
+
) as PopsIframeClickEventConfig;
|
|
146
|
+
// 赋值额外的$iframe参数
|
|
147
|
+
evtConfig.$iframe = $iframe!;
|
|
151
148
|
|
|
152
149
|
popsDOMUtils.on($anim, popsDOMUtils.getAnimationEndNameList(), function () {
|
|
153
|
-
|
|
150
|
+
// 动画加载完毕
|
|
154
151
|
$anim.style.width = "0%";
|
|
155
152
|
$anim.style.height = "0%";
|
|
156
153
|
});
|
|
157
154
|
|
|
158
155
|
popsDOMUtils.on($iframe, "load", () => {
|
|
159
|
-
|
|
156
|
+
// iframe加载中...
|
|
160
157
|
loadingElement?.remove();
|
|
161
158
|
$contentLoading!.style.animation = "iframeLoadingChange_85 0.3s forwards";
|
|
162
159
|
popsDOMUtils.on($contentLoading, popsDOMUtils.getAnimationEndNameList(), () => {
|
|
163
|
-
|
|
160
|
+
// 动画加载完毕就移除
|
|
164
161
|
$contentLoading!.remove();
|
|
165
162
|
});
|
|
166
163
|
|
|
167
164
|
if (config.title!.text!.trim() === "" && $iframe!.contentDocument) {
|
|
168
|
-
|
|
165
|
+
// 同域名下的才可以获取网页标题
|
|
169
166
|
$title!.querySelector<HTMLElement>("p")!.innerText = $iframe!.contentDocument.title;
|
|
170
167
|
}
|
|
171
168
|
|
|
172
169
|
config.loadEndCallBack(evtConfig);
|
|
173
170
|
});
|
|
174
|
-
|
|
171
|
+
// 创建到页面中
|
|
175
172
|
|
|
176
173
|
popsDOMUtils.append($shadowRoot, $elList);
|
|
177
174
|
if (typeof config.beforeAppendToPageCallBack === "function") {
|
|
@@ -182,7 +179,7 @@ export const PopsIframe = {
|
|
|
182
179
|
if ($mask != null) {
|
|
183
180
|
$anim.after($mask);
|
|
184
181
|
}
|
|
185
|
-
|
|
182
|
+
// 拖拽
|
|
186
183
|
if (config.drag) {
|
|
187
184
|
PopsInstanceUtils.drag($pops!, {
|
|
188
185
|
dragElement: $title!,
|
|
@@ -193,7 +190,7 @@ export const PopsIframe = {
|
|
|
193
190
|
});
|
|
194
191
|
}
|
|
195
192
|
const TYPE_MODULE = "type-module";
|
|
196
|
-
|
|
193
|
+
// 最小化按钮点击事件
|
|
197
194
|
let origin_left = "";
|
|
198
195
|
let origin_top = "";
|
|
199
196
|
let origin_is_max = false;
|
|
@@ -224,7 +221,7 @@ export const PopsIframe = {
|
|
|
224
221
|
capture: true,
|
|
225
222
|
}
|
|
226
223
|
);
|
|
227
|
-
|
|
224
|
+
// 最大化按钮点击事件
|
|
228
225
|
popsDOMUtils.on<MouseEvent | PointerEvent>(
|
|
229
226
|
headerMaxBtnElement,
|
|
230
227
|
"click",
|
|
@@ -258,9 +255,9 @@ export const PopsIframe = {
|
|
|
258
255
|
capture: true,
|
|
259
256
|
}
|
|
260
257
|
);
|
|
261
|
-
|
|
258
|
+
// 先隐藏窗口化按钮
|
|
262
259
|
headerMiseBtnElement?.style?.setProperty("display", "none");
|
|
263
|
-
|
|
260
|
+
// 复位按钮点击事件
|
|
264
261
|
popsDOMUtils.on<MouseEvent | PointerEvent>(
|
|
265
262
|
headerMiseBtnElement,
|
|
266
263
|
"click",
|
|
@@ -300,7 +297,7 @@ export const PopsIframe = {
|
|
|
300
297
|
capture: true,
|
|
301
298
|
}
|
|
302
299
|
);
|
|
303
|
-
|
|
300
|
+
// 关闭按钮点击事件
|
|
304
301
|
popsDOMUtils.on<MouseEvent | PointerEvent>(
|
|
305
302
|
headerCloseBtnElement,
|
|
306
303
|
"click",
|
|
@@ -319,11 +316,9 @@ export const PopsIframe = {
|
|
|
319
316
|
|
|
320
317
|
PopsHandler.handlePush(popsType, {
|
|
321
318
|
guid: guid,
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
maskElement: $mask!,
|
|
319
|
+
$anim: $anim,
|
|
320
|
+
$pops: $pops!,
|
|
321
|
+
$mask: $mask!,
|
|
327
322
|
$shadowContainer: $shadowContainer,
|
|
328
323
|
$shadowRoot: $shadowRoot,
|
|
329
324
|
});
|
|
@@ -1,41 +1,21 @@
|
|
|
1
|
-
import type { PopsTitleConfig, PopsDragConfig,
|
|
1
|
+
import type { PopsTitleConfig, PopsDragConfig, PopsGeneralConfig } from "../../../types/components";
|
|
2
2
|
|
|
3
3
|
import type { PopsEventConfig } from "../../../types/event";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* pops.iframe
|
|
6
|
+
* pops.iframe的按钮点击事件回调的配置参数
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
9
|
-
/**
|
|
10
|
-
* 动画元素(包裹着弹窗元素)
|
|
11
|
-
*/
|
|
12
|
-
animElement: HTMLElement;
|
|
13
|
-
/**
|
|
14
|
-
* 弹窗元素
|
|
15
|
-
*/
|
|
16
|
-
popsElement: HTMLElement;
|
|
17
|
-
/**
|
|
18
|
-
* 遮罩层元素,如果未设置,那么不存在
|
|
19
|
-
*/
|
|
20
|
-
maskElement?: HTMLElement;
|
|
8
|
+
export type PopsIframeClickEventConfig = PopsEventConfig & {
|
|
21
9
|
/**
|
|
22
10
|
* iframe元素
|
|
23
11
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
* 使用的方法名
|
|
27
|
-
*/
|
|
28
|
-
function: "iframe";
|
|
29
|
-
/**
|
|
30
|
-
* 唯一id
|
|
31
|
-
*/
|
|
32
|
-
guid: string;
|
|
33
|
-
}
|
|
12
|
+
$iframe: HTMLIFrameElement;
|
|
13
|
+
};
|
|
34
14
|
|
|
35
15
|
/**
|
|
36
16
|
* pops.iframe
|
|
37
17
|
*/
|
|
38
|
-
export interface
|
|
18
|
+
export interface PopsIframeConfig extends PopsTitleConfig, PopsDragConfig, PopsGeneralConfig {
|
|
39
19
|
/**
|
|
40
20
|
* 加载配置
|
|
41
21
|
*/
|
|
@@ -64,12 +44,7 @@ export interface PopsIframeDetails extends PopsTitleConfig, PopsDragConfig, Pops
|
|
|
64
44
|
/**
|
|
65
45
|
* 点击的回调函数
|
|
66
46
|
*/
|
|
67
|
-
callback: (
|
|
68
|
-
eventConfig: PopsEventConfig & {
|
|
69
|
-
iframeElement: HTMLIFrameElement;
|
|
70
|
-
},
|
|
71
|
-
event: MouseEvent | PointerEvent
|
|
72
|
-
) => void;
|
|
47
|
+
callback: (eventConfig: PopsIframeClickEventConfig, event: MouseEvent | PointerEvent) => void;
|
|
73
48
|
};
|
|
74
49
|
/**
|
|
75
50
|
* 最大化
|
|
@@ -78,12 +53,7 @@ export interface PopsIframeDetails extends PopsTitleConfig, PopsDragConfig, Pops
|
|
|
78
53
|
/**
|
|
79
54
|
* 点击的回调函数
|
|
80
55
|
*/
|
|
81
|
-
callback: (
|
|
82
|
-
eventConfig: PopsEventConfig & {
|
|
83
|
-
iframeElement: HTMLIFrameElement;
|
|
84
|
-
},
|
|
85
|
-
event: MouseEvent | PointerEvent
|
|
86
|
-
) => void;
|
|
56
|
+
callback: (eventConfig: PopsIframeClickEventConfig, event: MouseEvent | PointerEvent) => void;
|
|
87
57
|
};
|
|
88
58
|
/**
|
|
89
59
|
* 窗口化
|
|
@@ -92,12 +62,7 @@ export interface PopsIframeDetails extends PopsTitleConfig, PopsDragConfig, Pops
|
|
|
92
62
|
/**
|
|
93
63
|
* 点击的回调函数
|
|
94
64
|
*/
|
|
95
|
-
callback: (
|
|
96
|
-
eventConfig: PopsEventConfig & {
|
|
97
|
-
iframeElement: HTMLIFrameElement;
|
|
98
|
-
},
|
|
99
|
-
event: MouseEvent | PointerEvent
|
|
100
|
-
) => void;
|
|
65
|
+
callback: (eventConfig: PopsIframeClickEventConfig, event: MouseEvent | PointerEvent) => void;
|
|
101
66
|
};
|
|
102
67
|
/**
|
|
103
68
|
* 关闭
|
|
@@ -106,12 +71,7 @@ export interface PopsIframeDetails extends PopsTitleConfig, PopsDragConfig, Pops
|
|
|
106
71
|
/**
|
|
107
72
|
* 点击的回调函数
|
|
108
73
|
*/
|
|
109
|
-
callback: (
|
|
110
|
-
eventConfig: PopsEventConfig & {
|
|
111
|
-
iframeElement: HTMLIFrameElement;
|
|
112
|
-
},
|
|
113
|
-
event: MouseEvent | PointerEvent
|
|
114
|
-
) => void;
|
|
74
|
+
callback: (eventConfig: PopsIframeClickEventConfig, event: MouseEvent | PointerEvent) => void;
|
|
115
75
|
};
|
|
116
76
|
};
|
|
117
77
|
/**
|
|
@@ -121,8 +81,9 @@ export interface PopsIframeDetails extends PopsTitleConfig, PopsDragConfig, Pops
|
|
|
121
81
|
url?: string;
|
|
122
82
|
/**
|
|
123
83
|
* 右上角按钮顺序:最小化、最大化、窗口化、关闭
|
|
84
|
+
* @default "min|max|mise|close"
|
|
124
85
|
*/
|
|
125
|
-
topRightButton:
|
|
86
|
+
topRightButton: string;
|
|
126
87
|
/**
|
|
127
88
|
* 是否启用沙箱,默认false
|
|
128
89
|
* @default false
|
|
@@ -131,9 +92,5 @@ export interface PopsIframeDetails extends PopsTitleConfig, PopsDragConfig, Pops
|
|
|
131
92
|
/**
|
|
132
93
|
* 加载完毕的回调
|
|
133
94
|
*/
|
|
134
|
-
loadEndCallBack?: (
|
|
135
|
-
details: PopsEventConfig & {
|
|
136
|
-
iframeElement: HTMLIFrameElement;
|
|
137
|
-
}
|
|
138
|
-
) => void;
|
|
95
|
+
loadEndCallBack?: (eventConfig: PopsIframeClickEventConfig) => void;
|
|
139
96
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PopsLoadingConfig } from "./types";
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const PopsLoadingDefaultConfig = (): DeepRequired<PopsLoadingConfig> => {
|
|
4
4
|
return {
|
|
5
|
-
parent: document.body,
|
|
5
|
+
$parent: document.body || document.documentElement,
|
|
6
6
|
content: {
|
|
7
7
|
text: "加载中...",
|
|
8
8
|
icon: "loading",
|
|
@@ -4,16 +4,17 @@ import { PopsHandler } from "../../handler/PopsHandler";
|
|
|
4
4
|
import { PopsCSS } from "../../PopsCSS";
|
|
5
5
|
import { popsDOMUtils } from "../../utils/PopsDOMUtils";
|
|
6
6
|
import { popsUtils } from "../../utils/PopsUtils";
|
|
7
|
-
import {
|
|
8
|
-
import type {
|
|
7
|
+
import { PopsLoadingDefaultConfig } from "./defaultConfig";
|
|
8
|
+
import type { PopsLoadingConfig } from "./types";
|
|
9
9
|
|
|
10
10
|
export const PopsLoading = {
|
|
11
|
-
init(
|
|
12
|
-
let config = PopsLoadingConfig();
|
|
13
|
-
config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
|
|
14
|
-
config = popsUtils.assign(config, details);
|
|
11
|
+
init(__config__: PopsLoadingConfig) {
|
|
15
12
|
const guid = popsUtils.getRandomGUID();
|
|
13
|
+
// 设置当前类型
|
|
16
14
|
const PopsType = "loading";
|
|
15
|
+
let config = PopsLoadingDefaultConfig();
|
|
16
|
+
config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
|
|
17
|
+
config = popsUtils.assign(config, __config__);
|
|
17
18
|
|
|
18
19
|
config = PopsHandler.handleOnly(PopsType, config);
|
|
19
20
|
|
|
@@ -76,16 +77,17 @@ export const PopsLoading = {
|
|
|
76
77
|
$elList.push($mask);
|
|
77
78
|
}
|
|
78
79
|
const evtConfig = PopsHandler.handleLoadingEventConfig(config, guid, PopsType, $anim, $pops, $mask);
|
|
79
|
-
popsDOMUtils.append(config
|
|
80
|
+
popsDOMUtils.append(config.$parent, $elList);
|
|
80
81
|
if ($mask != null) {
|
|
81
82
|
$anim.after($mask);
|
|
82
83
|
}
|
|
84
|
+
// @ts-ignore
|
|
83
85
|
PopsHandler.handlePush(PopsType, {
|
|
84
86
|
guid: guid,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
87
|
+
$anim: $anim,
|
|
88
|
+
$pops: $pops!,
|
|
89
|
+
$mask: $mask!,
|
|
90
|
+
});
|
|
89
91
|
|
|
90
92
|
if (config.isAbsolute) {
|
|
91
93
|
// 遮罩层必须是跟随主内容
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PopsGeneralConfig, PopsContentConfig } from "../../../types/components";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* pops.loading
|
|
5
5
|
*/
|
|
6
|
-
export interface
|
|
7
|
-
extends Omit<
|
|
6
|
+
export interface PopsLoadingConfig
|
|
7
|
+
extends Omit<PopsGeneralConfig, "width" | "height" | "position" | "beforeAppendToPageCallBack"> {
|
|
8
8
|
/**
|
|
9
9
|
* 父元素,默认为document.body
|
|
10
|
-
* @default document.body
|
|
10
|
+
* @default document.body || document.documentElement
|
|
11
11
|
*/
|
|
12
|
-
parent?: HTMLElement;
|
|
12
|
+
$parent?: HTMLElement;
|
|
13
13
|
/**
|
|
14
14
|
* 内容配置
|
|
15
15
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { popsDOMUtils } from "../../utils/PopsDOMUtils";
|
|
2
|
-
import type {
|
|
2
|
+
import type { PopsPanelConfig } from "./types";
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const PopsPanelDefaultConfig = (): DeepRequired<PopsPanelConfig> => {
|
|
5
5
|
return {
|
|
6
6
|
title: {
|
|
7
7
|
text: "默认标题",
|
|
@@ -14,18 +14,18 @@ export const PopsPanelConfig = (): DeepRequired<PopsPanelDetails> => {
|
|
|
14
14
|
id: "whitesev-panel-config-1",
|
|
15
15
|
title: "菜单配置1",
|
|
16
16
|
headerTitle: "菜单配置1",
|
|
17
|
-
isDefault:
|
|
17
|
+
isDefault: true,
|
|
18
18
|
attributes: {
|
|
19
19
|
"data-test": "test",
|
|
20
20
|
"data-test-2": "test2",
|
|
21
21
|
},
|
|
22
|
-
|
|
22
|
+
views: [
|
|
23
23
|
{
|
|
24
24
|
className: "forms-1",
|
|
25
25
|
text: "区域设置",
|
|
26
|
-
type: "
|
|
26
|
+
type: "container",
|
|
27
27
|
attributes: {},
|
|
28
|
-
|
|
28
|
+
views: [
|
|
29
29
|
{
|
|
30
30
|
className: "panel-switch",
|
|
31
31
|
text: "switch",
|
|
@@ -141,12 +141,12 @@ export const PopsPanelConfig = (): DeepRequired<PopsPanelDetails> => {
|
|
|
141
141
|
id: "whitesev-panel-config-2",
|
|
142
142
|
title: "菜单配置2",
|
|
143
143
|
headerTitle: "菜单配置2",
|
|
144
|
-
isDefault:
|
|
144
|
+
isDefault: false,
|
|
145
145
|
attributes: {
|
|
146
146
|
"data-value": "value",
|
|
147
147
|
"data-value-2": "value2",
|
|
148
148
|
},
|
|
149
|
-
|
|
149
|
+
views: [
|
|
150
150
|
{
|
|
151
151
|
className: "panel-input",
|
|
152
152
|
text: "input",
|
|
@@ -167,7 +167,6 @@ export const PopsPanelConfig = (): DeepRequired<PopsPanelDetails> => {
|
|
|
167
167
|
className: "panel-input-password",
|
|
168
168
|
text: "input-password",
|
|
169
169
|
type: "input",
|
|
170
|
-
// @ts-ignore
|
|
171
170
|
props: {},
|
|
172
171
|
attributes: {},
|
|
173
172
|
getValue() {
|
|
@@ -184,7 +183,6 @@ export const PopsPanelConfig = (): DeepRequired<PopsPanelDetails> => {
|
|
|
184
183
|
className: "panel-textarea",
|
|
185
184
|
text: "textarea",
|
|
186
185
|
type: "textarea",
|
|
187
|
-
// @ts-ignore
|
|
188
186
|
props: {},
|
|
189
187
|
attributes: {},
|
|
190
188
|
getValue() {
|
|
@@ -196,12 +194,94 @@ export const PopsPanelConfig = (): DeepRequired<PopsPanelDetails> => {
|
|
|
196
194
|
},
|
|
197
195
|
placeholder: "请输入内容",
|
|
198
196
|
},
|
|
197
|
+
{
|
|
198
|
+
className: "panel-select-disabled",
|
|
199
|
+
text: "select-disabled",
|
|
200
|
+
type: "select",
|
|
201
|
+
disabled: true,
|
|
202
|
+
props: {},
|
|
203
|
+
attributes: {},
|
|
204
|
+
getValue() {
|
|
205
|
+
return 50;
|
|
206
|
+
},
|
|
207
|
+
callback(event, isSelectedValue, isSelectedText) {
|
|
208
|
+
console.log(`select当前选项:${isSelectedValue},当前选项文本:${isSelectedText}`);
|
|
209
|
+
},
|
|
210
|
+
data: [
|
|
211
|
+
{
|
|
212
|
+
value: "all",
|
|
213
|
+
text: "所有",
|
|
214
|
+
disable() {
|
|
215
|
+
return false;
|
|
216
|
+
},
|
|
217
|
+
views: [],
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
value: "text",
|
|
221
|
+
text: "文本",
|
|
222
|
+
disable() {
|
|
223
|
+
return false;
|
|
224
|
+
},
|
|
225
|
+
views: [],
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
value: "html",
|
|
229
|
+
text: "超文本",
|
|
230
|
+
disable() {
|
|
231
|
+
return false;
|
|
232
|
+
},
|
|
233
|
+
views: [],
|
|
234
|
+
},
|
|
235
|
+
],
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
className: "panel-select-multiple-disabled",
|
|
239
|
+
type: "select-multiple",
|
|
240
|
+
text: "select-multiple-disabled",
|
|
241
|
+
disabled: true,
|
|
242
|
+
props: {},
|
|
243
|
+
|
|
244
|
+
attributes: {},
|
|
245
|
+
placeholder: "请至少选择一个选项",
|
|
246
|
+
getValue() {
|
|
247
|
+
return ["select-1", "select-2"];
|
|
248
|
+
},
|
|
249
|
+
callback(selectInfo) {
|
|
250
|
+
console.log(`select值改变,多选信息`, selectInfo);
|
|
251
|
+
},
|
|
252
|
+
clickCallBack(event, isSelectedInfo) {
|
|
253
|
+
console.log("点击", event, isSelectedInfo);
|
|
254
|
+
},
|
|
255
|
+
closeIconClickCallBack(event, data) {
|
|
256
|
+
console.log("点击关闭图标的事件", data);
|
|
257
|
+
},
|
|
258
|
+
data: [
|
|
259
|
+
{
|
|
260
|
+
value: "select-1",
|
|
261
|
+
text: "单选1",
|
|
262
|
+
isHTML: false,
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
value: "select-2",
|
|
266
|
+
text: "单选2",
|
|
267
|
+
isHTML: false,
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
value: "select-3",
|
|
271
|
+
text: "单选3",
|
|
272
|
+
isHTML: false,
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
value: "select-4",
|
|
276
|
+
text: "单选4",
|
|
277
|
+
isHTML: false,
|
|
278
|
+
},
|
|
279
|
+
],
|
|
280
|
+
},
|
|
199
281
|
{
|
|
200
282
|
className: "panel-select",
|
|
201
283
|
text: "select",
|
|
202
284
|
type: "select",
|
|
203
|
-
disabled: true,
|
|
204
|
-
// @ts-ignore
|
|
205
285
|
props: {},
|
|
206
286
|
attributes: {},
|
|
207
287
|
getValue() {
|
|
@@ -217,7 +297,7 @@ export const PopsPanelConfig = (): DeepRequired<PopsPanelDetails> => {
|
|
|
217
297
|
disable() {
|
|
218
298
|
return false;
|
|
219
299
|
},
|
|
220
|
-
|
|
300
|
+
views: [],
|
|
221
301
|
},
|
|
222
302
|
{
|
|
223
303
|
value: "text",
|
|
@@ -225,7 +305,7 @@ export const PopsPanelConfig = (): DeepRequired<PopsPanelDetails> => {
|
|
|
225
305
|
disable() {
|
|
226
306
|
return false;
|
|
227
307
|
},
|
|
228
|
-
|
|
308
|
+
views: [],
|
|
229
309
|
},
|
|
230
310
|
{
|
|
231
311
|
value: "html",
|
|
@@ -233,7 +313,7 @@ export const PopsPanelConfig = (): DeepRequired<PopsPanelDetails> => {
|
|
|
233
313
|
disable() {
|
|
234
314
|
return false;
|
|
235
315
|
},
|
|
236
|
-
|
|
316
|
+
views: [],
|
|
237
317
|
},
|
|
238
318
|
],
|
|
239
319
|
},
|
|
@@ -241,8 +321,6 @@ export const PopsPanelConfig = (): DeepRequired<PopsPanelDetails> => {
|
|
|
241
321
|
className: "panel-select-multiple",
|
|
242
322
|
type: "select-multiple",
|
|
243
323
|
text: "select-multiple",
|
|
244
|
-
disabled: true,
|
|
245
|
-
// @ts-ignore
|
|
246
324
|
props: {},
|
|
247
325
|
|
|
248
326
|
attributes: {},
|
|
@@ -307,9 +385,9 @@ export const PopsPanelConfig = (): DeepRequired<PopsPanelDetails> => {
|
|
|
307
385
|
],
|
|
308
386
|
},
|
|
309
387
|
{
|
|
310
|
-
type: "
|
|
388
|
+
type: "container",
|
|
311
389
|
text: "deep菜单",
|
|
312
|
-
|
|
390
|
+
views: [
|
|
313
391
|
{
|
|
314
392
|
type: "deepMenu",
|
|
315
393
|
className: "panel-deepMenu",
|
|
@@ -317,20 +395,20 @@ export const PopsPanelConfig = (): DeepRequired<PopsPanelDetails> => {
|
|
|
317
395
|
description: "二级菜单",
|
|
318
396
|
rightText: "自定义配置",
|
|
319
397
|
arrowRightIcon: true,
|
|
320
|
-
afterAddToUListCallBack(
|
|
321
|
-
console.log(
|
|
398
|
+
afterAddToUListCallBack(viewConfig, container) {
|
|
399
|
+
console.log(viewConfig, container);
|
|
322
400
|
},
|
|
323
|
-
clickCallBack(event,
|
|
324
|
-
console.log("进入子配置", event,
|
|
401
|
+
clickCallBack(event, viewConfig) {
|
|
402
|
+
console.log("进入子配置", event, viewConfig);
|
|
325
403
|
},
|
|
326
|
-
|
|
404
|
+
views: [
|
|
327
405
|
{
|
|
328
406
|
className: "forms-1",
|
|
329
407
|
text: "区域设置",
|
|
330
|
-
type: "
|
|
408
|
+
type: "container",
|
|
331
409
|
attributes: {},
|
|
332
410
|
props: {},
|
|
333
|
-
|
|
411
|
+
views: [
|
|
334
412
|
{
|
|
335
413
|
className: "panel-switch",
|
|
336
414
|
text: "switch",
|
|
@@ -420,24 +498,24 @@ export const PopsPanelConfig = (): DeepRequired<PopsPanelDetails> => {
|
|
|
420
498
|
description: "二级菜单",
|
|
421
499
|
rightText: "自定义配置",
|
|
422
500
|
arrowRightIcon: true,
|
|
423
|
-
afterAddToUListCallBack(
|
|
424
|
-
console.log(
|
|
501
|
+
afterAddToUListCallBack(viewConfig, container) {
|
|
502
|
+
console.log(viewConfig, container);
|
|
425
503
|
},
|
|
426
|
-
clickCallBack(event,
|
|
427
|
-
console.log("进入子配置", event,
|
|
504
|
+
clickCallBack(event, viewConfig) {
|
|
505
|
+
console.log("进入子配置", event, viewConfig);
|
|
428
506
|
},
|
|
429
|
-
|
|
507
|
+
views: [],
|
|
430
508
|
},
|
|
431
509
|
],
|
|
432
510
|
},
|
|
433
511
|
{
|
|
434
|
-
type: "
|
|
512
|
+
type: "container",
|
|
435
513
|
isFold: true,
|
|
436
514
|
text: "折叠菜单",
|
|
437
|
-
afterAddToUListCallBack(
|
|
438
|
-
console.log(
|
|
515
|
+
afterAddToUListCallBack(viewConfig, container) {
|
|
516
|
+
console.log(viewConfig, container);
|
|
439
517
|
},
|
|
440
|
-
|
|
518
|
+
views: [
|
|
441
519
|
{
|
|
442
520
|
className: "panel-switch",
|
|
443
521
|
text: "switch",
|
|
@@ -469,7 +547,7 @@ export const PopsPanelConfig = (): DeepRequired<PopsPanelDetails> => {
|
|
|
469
547
|
},
|
|
470
548
|
// @ts-ignore
|
|
471
549
|
props: {},
|
|
472
|
-
|
|
550
|
+
views: [],
|
|
473
551
|
clickFirstCallback: function () {
|
|
474
552
|
return false;
|
|
475
553
|
},
|
|
@@ -484,7 +562,7 @@ export const PopsPanelConfig = (): DeepRequired<PopsPanelDetails> => {
|
|
|
484
562
|
},
|
|
485
563
|
// @ts-ignore
|
|
486
564
|
props: {},
|
|
487
|
-
|
|
565
|
+
views: [],
|
|
488
566
|
clickFirstCallback: function () {
|
|
489
567
|
return false;
|
|
490
568
|
},
|