@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
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { PopsGeneralConfig } from "../../../types/components";
|
|
2
|
+
import type { PopsPanelGeneralConfig } from "../../panel/types/components-common";
|
|
3
3
|
/** tooltip的出现位置 */
|
|
4
4
|
export type PopsTooltipPosition = "top" | "right" | "bottom" | "left" | "follow";
|
|
5
5
|
/**
|
|
6
6
|
* pops.tooltip
|
|
7
7
|
*/
|
|
8
|
-
export interface
|
|
8
|
+
export interface PopsToolTipConfig extends Pick<PopsGeneralConfig, "useShadowRoot" | "only" | "zIndex" | "style" | "beforeAppendToPageCallBack"> {
|
|
9
9
|
/**
|
|
10
10
|
* 目标元素
|
|
11
11
|
*/
|
|
12
|
-
target: HTMLElement;
|
|
12
|
+
$target: HTMLElement;
|
|
13
13
|
/**
|
|
14
14
|
* 显示的文字
|
|
15
15
|
*/
|
|
@@ -33,7 +33,7 @@ export interface PopsToolTipDetails extends Pick<PopsCommonConfig, "useShadowRoo
|
|
|
33
33
|
* + `github-tooltip` github的样式
|
|
34
34
|
* @default ""
|
|
35
35
|
*/
|
|
36
|
-
className?:
|
|
36
|
+
className?: PopsPanelGeneralConfig<any>["className"];
|
|
37
37
|
/**
|
|
38
38
|
* 是否使用fixed定位,false则是absolute定位
|
|
39
39
|
*
|
|
@@ -66,7 +66,9 @@ export interface PopsToolTipDetails extends Pick<PopsCommonConfig, "useShadowRoo
|
|
|
66
66
|
* 监听的事件配置
|
|
67
67
|
*/
|
|
68
68
|
eventOption?: {
|
|
69
|
-
|
|
69
|
+
once?: boolean;
|
|
70
|
+
passive?: boolean;
|
|
71
|
+
capture?: boolean;
|
|
70
72
|
};
|
|
71
73
|
/**
|
|
72
74
|
* 触发显示前的回调
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PopsGeneralConfig, PopsDragConfig } from "../types/components";
|
|
2
2
|
type EnterReturnType<T> = null | T | (() => T);
|
|
3
3
|
type GlobalConfigOption = {
|
|
4
4
|
style?: EnterReturnType<string>;
|
|
5
5
|
zIndex?: EnterReturnType<number> | EnterReturnType<string>;
|
|
6
|
-
} & Partial<
|
|
6
|
+
} & Partial<PopsGeneralConfig> & Partial<PopsDragConfig>;
|
|
7
7
|
export declare const GlobalConfig: {
|
|
8
8
|
config: GlobalConfigOption;
|
|
9
9
|
/**
|
|
@@ -23,7 +23,7 @@ export declare const GlobalConfig: {
|
|
|
23
23
|
height?: string | undefined;
|
|
24
24
|
position?: import("../types/position").PopsPosition | undefined;
|
|
25
25
|
animation?: import("../types/animation").PopsAnimation | undefined;
|
|
26
|
-
mask?: import("../types/mask").
|
|
26
|
+
mask?: import("../types/mask").PopsMaskConfig | undefined;
|
|
27
27
|
forbiddenScroll?: boolean | undefined;
|
|
28
28
|
beforeAppendToPageCallBack?: void;
|
|
29
29
|
drag?: boolean | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PopsSupportAnimConfig, PopsSupportBottomButtonConfig, PopsSupportContentConfig, PopsSupportHeaderTitleConfig, PopsSupportAnimConfigType, PopsSupportBottomButtonConfigType, PopsSupportContentConfigType, PopsSupportHeaderTitleConfigType } from "../types/main";
|
|
2
2
|
export declare const PopsElementHandler: {
|
|
3
3
|
/**
|
|
4
4
|
* 获取遮罩层HTML
|
|
@@ -16,19 +16,19 @@ export declare const PopsElementHandler: {
|
|
|
16
16
|
* @param bottomBtnHTML
|
|
17
17
|
* @param zIndex
|
|
18
18
|
*/
|
|
19
|
-
createAnim(guid: string, type:
|
|
19
|
+
createAnim(guid: string, type: PopsSupportAnimConfigType, config: PopsSupportAnimConfig[keyof PopsSupportAnimConfig], html: string | undefined, bottomBtnHTML: string | undefined, zIndex: number): string;
|
|
20
20
|
/**
|
|
21
21
|
* 获取顶部按钮层HTML
|
|
22
22
|
* @param type
|
|
23
23
|
* @param config
|
|
24
24
|
*/
|
|
25
|
-
createHeader(type:
|
|
25
|
+
createHeader(type: PopsSupportHeaderTitleConfigType, config: PopsSupportHeaderTitleConfig[keyof PopsSupportHeaderTitleConfig]): string;
|
|
26
26
|
/**
|
|
27
27
|
* 获取标题style
|
|
28
28
|
* @param type 弹窗类型
|
|
29
29
|
* @param config 弹窗配置
|
|
30
30
|
*/
|
|
31
|
-
createHeaderStyle(type:
|
|
31
|
+
createHeaderStyle(type: PopsSupportHeaderTitleConfigType, config: PopsSupportHeaderTitleConfig[keyof PopsSupportHeaderTitleConfig]): {
|
|
32
32
|
headerStyle: string;
|
|
33
33
|
headerPStyle: string;
|
|
34
34
|
};
|
|
@@ -37,13 +37,13 @@ export declare const PopsElementHandler: {
|
|
|
37
37
|
* @param type
|
|
38
38
|
* @param config
|
|
39
39
|
*/
|
|
40
|
-
createBottom(type:
|
|
40
|
+
createBottom(type: PopsSupportBottomButtonConfigType, config: Omit<PopsSupportBottomButtonConfig[keyof PopsSupportBottomButtonConfig], "content">): string;
|
|
41
41
|
/**
|
|
42
42
|
* 获取内容style
|
|
43
43
|
* @param type 弹窗类型
|
|
44
44
|
* @param config 弹窗配置
|
|
45
45
|
*/
|
|
46
|
-
createContentStyle(type:
|
|
46
|
+
createContentStyle(type: PopsSupportContentConfigType, config: PopsSupportContentConfig[keyof PopsSupportContentConfig]): {
|
|
47
47
|
contentStyle: string;
|
|
48
48
|
contentPStyle: string;
|
|
49
49
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
9
|
-
import type {
|
|
1
|
+
import type { PopsAlertConfig } from "../components/alert/types";
|
|
2
|
+
import type { PopsConfirmConfig } from "../components/confirm/types";
|
|
3
|
+
import type { PopsDrawerConfig } from "../components/drawer/types";
|
|
4
|
+
import type { PopsFolderConfig } from "../components/folder/types";
|
|
5
|
+
import type { PopsIframeConfig } from "../components/iframe/types";
|
|
6
|
+
import type { PopsLoadingConfig } from "../components/loading/types";
|
|
7
|
+
import type { PopsPanelConfig } from "../components/panel/types";
|
|
8
|
+
import type { PopsPromptConfig } from "../components/prompt/types/index";
|
|
9
|
+
import type { PopsGeneralConfig } from "../types/components";
|
|
10
10
|
import type { PopsEventConfig, PopsHandlerEventConfig } from "../types/event";
|
|
11
|
-
import type {
|
|
12
|
-
import type { PopsInstStoreType, PopsType,
|
|
11
|
+
import type { PopsInstGeneralConfig } from "../types/inst";
|
|
12
|
+
import type { PopsInstStoreType, PopsType, PopsSupportAnimConfigType, PopsSupportOnlyConfig } from "../types/main";
|
|
13
13
|
export declare const PopsHandler: {
|
|
14
14
|
/**
|
|
15
15
|
* 创建shadow
|
|
16
16
|
*/
|
|
17
|
-
handlerShadow(config: Pick<
|
|
17
|
+
handlerShadow(config: Pick<PopsGeneralConfig, "useShadowRoot">): {
|
|
18
18
|
$shadowContainer: HTMLDivElement;
|
|
19
19
|
$shadowRoot: ShadowRoot;
|
|
20
20
|
} | {
|
|
@@ -39,7 +39,7 @@ export declare const PopsHandler: {
|
|
|
39
39
|
handleMask(config?: {
|
|
40
40
|
type: "alert" | "confirm" | "prompt" | "loading" | "iframe" | "drawer" | "folder" | "panel";
|
|
41
41
|
guid: string;
|
|
42
|
-
config: Required<
|
|
42
|
+
config: Required<PopsAlertConfig> | Required<PopsLoadingConfig> | Required<PopsIframeConfig> | Required<PopsDrawerConfig> | Required<PopsPanelConfig> | Required<PopsFolderConfig>;
|
|
43
43
|
animElement: HTMLElement;
|
|
44
44
|
maskHTML: string;
|
|
45
45
|
}): {
|
|
@@ -50,7 +50,7 @@ export declare const PopsHandler: {
|
|
|
50
50
|
* @param animElement
|
|
51
51
|
* @param type
|
|
52
52
|
*/
|
|
53
|
-
handleQueryElement(animElement: HTMLDivElement, type:
|
|
53
|
+
handleQueryElement(animElement: HTMLDivElement, type: PopsSupportAnimConfigType): {
|
|
54
54
|
/**
|
|
55
55
|
* 主元素
|
|
56
56
|
*/
|
|
@@ -183,7 +183,7 @@ export declare const PopsHandler: {
|
|
|
183
183
|
* @param $mask 遮罩层
|
|
184
184
|
* @param config 当前配置
|
|
185
185
|
*/
|
|
186
|
-
handleEventConfig(config:
|
|
186
|
+
handleEventConfig(config: PopsAlertConfig | PopsDrawerConfig | PopsPromptConfig | PopsConfirmConfig | PopsIframeConfig | PopsLoadingConfig | PopsPanelConfig | PopsFolderConfig, guid: string, $shadowContainer: HTMLDivElement, $shadowRoot: ShadowRoot | HTMLElement, mode: PopsInstStoreType, $anim: HTMLDivElement, $pops: HTMLDivElement, $mask?: HTMLDivElement): PopsEventConfig;
|
|
187
187
|
/**
|
|
188
188
|
* 获取loading的事件配置
|
|
189
189
|
* @param guid
|
|
@@ -193,7 +193,7 @@ export declare const PopsHandler: {
|
|
|
193
193
|
* @param $mask 遮罩层
|
|
194
194
|
* @param config 当前配置
|
|
195
195
|
*/
|
|
196
|
-
handleLoadingEventConfig(config:
|
|
196
|
+
handleLoadingEventConfig(config: PopsAlertConfig | PopsDrawerConfig | PopsPromptConfig | PopsConfirmConfig | PopsIframeConfig | PopsLoadingConfig | PopsPanelConfig | PopsFolderConfig, guid: string, mode: "loading", $anim: HTMLDivElement, $pops: HTMLDivElement, $mask?: HTMLDivElement): Omit<PopsEventConfig, "$shadowContainer" | "$shadowRoot">;
|
|
197
197
|
/**
|
|
198
198
|
* 处理返回的配置,针对popsHandler.handleEventConfig
|
|
199
199
|
* @param config 配置
|
|
@@ -238,11 +238,11 @@ export declare const PopsHandler: {
|
|
|
238
238
|
* @param type 当前弹窗类型
|
|
239
239
|
* @param config 配置
|
|
240
240
|
*/
|
|
241
|
-
handleOnly<T extends Required<
|
|
241
|
+
handleOnly<T extends Required<PopsSupportOnlyConfig[keyof PopsSupportOnlyConfig]>>(type: PopsType, config: T): T;
|
|
242
242
|
/**
|
|
243
243
|
* 处理把已创建的元素保存到内部环境中
|
|
244
244
|
* @param type 当前弹窗类型
|
|
245
245
|
* @param value
|
|
246
246
|
*/
|
|
247
|
-
handlePush(type: PopsInstStoreType, value:
|
|
247
|
+
handlePush(type: PopsInstStoreType, value: PopsInstGeneralConfig): void;
|
|
248
248
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { PopsEventConfig, PopsHandlerEventConfig } from "./event";
|
|
2
2
|
import type { PopsIconType } from "./icon";
|
|
3
|
-
import type { PopsType } from "./main";
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* 按钮类型
|
|
@@ -24,56 +23,10 @@ export type PopsButtonStyleType =
|
|
|
24
23
|
*/
|
|
25
24
|
export type PopsButtonSize = "large" | "small";
|
|
26
25
|
|
|
27
|
-
/**
|
|
28
|
-
* 按钮的点击回调参数event
|
|
29
|
-
*/
|
|
30
|
-
export interface PopsBtnCallBackEvent {
|
|
31
|
-
/**
|
|
32
|
-
* 元素
|
|
33
|
-
*/
|
|
34
|
-
element: HTMLElement;
|
|
35
|
-
/**
|
|
36
|
-
* 动画元素(包裹着弹窗元素)
|
|
37
|
-
*/
|
|
38
|
-
animElement: HTMLElement;
|
|
39
|
-
/**
|
|
40
|
-
* 弹窗元素
|
|
41
|
-
*/
|
|
42
|
-
popsElement: HTMLElement;
|
|
43
|
-
/**
|
|
44
|
-
* 遮罩层元素
|
|
45
|
-
*/
|
|
46
|
-
maskElement: HTMLElement | undefined;
|
|
47
|
-
/**
|
|
48
|
-
* 按钮调用类型
|
|
49
|
-
*/
|
|
50
|
-
type: PopsButtonType;
|
|
51
|
-
/**
|
|
52
|
-
* 调用的方法
|
|
53
|
-
*/
|
|
54
|
-
mode: PopsType;
|
|
55
|
-
/**
|
|
56
|
-
* 唯一id
|
|
57
|
-
*/
|
|
58
|
-
guid: string;
|
|
59
|
-
/**
|
|
60
|
-
* 关闭弹窗
|
|
61
|
-
*/
|
|
62
|
-
close(): void;
|
|
63
|
-
/**
|
|
64
|
-
* 隐藏弹窗
|
|
65
|
-
*/
|
|
66
|
-
hide(): void;
|
|
67
|
-
/**
|
|
68
|
-
* 显示弹窗
|
|
69
|
-
*/
|
|
70
|
-
show(): void;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
26
|
/**
|
|
74
27
|
* 按钮配置
|
|
75
28
|
*/
|
|
76
|
-
export interface
|
|
29
|
+
export interface PopsGlobalButtonConfig<T = object> {
|
|
77
30
|
/**
|
|
78
31
|
* 是否启用按钮
|
|
79
32
|
*/
|
|
@@ -116,7 +69,7 @@ export interface PopsButtonDetails<T = object> {
|
|
|
116
69
|
/**
|
|
117
70
|
* 按钮配置(匹配任意类型)
|
|
118
71
|
*/
|
|
119
|
-
export type
|
|
72
|
+
export type PopsButtonConfigAnyType<T = object> = Omit<PopsGlobalButtonConfig<T>, "type"> & {
|
|
120
73
|
/**
|
|
121
74
|
* 按钮样式类型
|
|
122
75
|
* @default "default"
|
|
@@ -124,56 +77,10 @@ export type PopsButtonDetailsAnyType<T = object> = Omit<PopsButtonDetails<T>, "t
|
|
|
124
77
|
type: string;
|
|
125
78
|
};
|
|
126
79
|
|
|
127
|
-
/** prompt的点击回调 */
|
|
128
|
-
export interface PopsPromptButtonDetails extends PopsButtonDetails {
|
|
129
|
-
callback(
|
|
130
|
-
eventConfig: PopsHandlerEventConfig & {
|
|
131
|
-
text: string;
|
|
132
|
-
},
|
|
133
|
-
event: PointerEvent | MouseEvent
|
|
134
|
-
): void;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* 右上角关闭按钮点击回调的配置
|
|
138
|
-
*/
|
|
139
|
-
export interface PopsHeaderCloseButtonClickCallBackEvent {
|
|
140
|
-
/**
|
|
141
|
-
* 动画元素(包裹着弹窗元素)
|
|
142
|
-
*/
|
|
143
|
-
animElement: HTMLElement;
|
|
144
|
-
/**
|
|
145
|
-
* 遮罩层元素,如果未设置,那么不存在
|
|
146
|
-
*/
|
|
147
|
-
maskElement?: HTMLElement;
|
|
148
|
-
/**
|
|
149
|
-
* 按钮调用类型
|
|
150
|
-
*/
|
|
151
|
-
type: string;
|
|
152
|
-
/**
|
|
153
|
-
* 唯一id
|
|
154
|
-
*/
|
|
155
|
-
guid: string;
|
|
156
|
-
/**
|
|
157
|
-
* 关闭弹窗
|
|
158
|
-
*/
|
|
159
|
-
close(): void;
|
|
160
|
-
/**
|
|
161
|
-
* 隐藏弹窗
|
|
162
|
-
*/
|
|
163
|
-
hide(): void;
|
|
164
|
-
/**
|
|
165
|
-
* 显示弹窗
|
|
166
|
-
*/
|
|
167
|
-
show(): void;
|
|
168
|
-
/**
|
|
169
|
-
* 输入的内容
|
|
170
|
-
*/
|
|
171
|
-
text: string;
|
|
172
|
-
}
|
|
173
80
|
/**
|
|
174
81
|
* 顶部关闭按钮配置
|
|
175
82
|
*/
|
|
176
|
-
export interface
|
|
83
|
+
export interface PopsHeaderCloseButtonConfig {
|
|
177
84
|
/**
|
|
178
85
|
* 是否启用按钮
|
|
179
86
|
*/
|
|
@@ -183,5 +90,5 @@ export interface PopsHeaderCloseButtonDetails {
|
|
|
183
90
|
*
|
|
184
91
|
* 如果传入该值,那么将不会自动关闭弹窗
|
|
185
92
|
*/
|
|
186
|
-
callback?: (
|
|
93
|
+
callback?: (eventConfig: PopsEventConfig, event: PointerEvent | MouseEvent) => void;
|
|
187
94
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PopsAnimation } from "./animation";
|
|
2
2
|
import type { PopsPosition, PopsTextAlign, PopsJustifyContent } from "./position";
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
3
|
+
import type { PopsGlobalButtonConfig, PopsButtonConfigAnyType, PopsHeaderCloseButtonConfig } from "./button";
|
|
4
|
+
import type { PopsMaskConfig } from "./mask";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* 标题配置
|
|
@@ -62,7 +62,7 @@ export interface PopsButtonConfig {
|
|
|
62
62
|
/**
|
|
63
63
|
* 右上角的关闭按钮
|
|
64
64
|
*/
|
|
65
|
-
close?:
|
|
65
|
+
close?: PopsHeaderCloseButtonConfig;
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
68
|
/**
|
|
@@ -88,15 +88,15 @@ export interface PopsMoreButtonConfig<T = object> {
|
|
|
88
88
|
/**
|
|
89
89
|
* 确定按钮
|
|
90
90
|
*/
|
|
91
|
-
ok?: Partial<
|
|
91
|
+
ok?: Partial<PopsGlobalButtonConfig<T> | PopsButtonConfigAnyType<T>>;
|
|
92
92
|
/**
|
|
93
93
|
* 取消按钮
|
|
94
94
|
*/
|
|
95
|
-
cancel?: Partial<
|
|
95
|
+
cancel?: Partial<PopsGlobalButtonConfig<T> | PopsButtonConfigAnyType<T>>;
|
|
96
96
|
/**
|
|
97
97
|
* 其他按钮
|
|
98
98
|
*/
|
|
99
|
-
other?: Partial<
|
|
99
|
+
other?: Partial<PopsGlobalButtonConfig<T> | PopsButtonConfigAnyType<T>>;
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
@@ -136,7 +136,7 @@ export interface PopsDragConfig {
|
|
|
136
136
|
/**
|
|
137
137
|
* 通用配置
|
|
138
138
|
*/
|
|
139
|
-
export interface
|
|
139
|
+
export interface PopsGeneralConfig {
|
|
140
140
|
/**
|
|
141
141
|
* 是否使用shadowRoot
|
|
142
142
|
*
|
|
@@ -188,7 +188,7 @@ export interface PopsCommonConfig {
|
|
|
188
188
|
/**
|
|
189
189
|
* 遮罩层
|
|
190
190
|
*/
|
|
191
|
-
mask?:
|
|
191
|
+
mask?: PopsMaskConfig;
|
|
192
192
|
/**
|
|
193
193
|
* 是否禁用页面滚动
|
|
194
194
|
*
|
|
@@ -1,35 +1,5 @@
|
|
|
1
|
-
import type { PopsIframeDetails } from "../components/iframe/types";
|
|
2
1
|
import type { PopsType } from "./main";
|
|
3
2
|
|
|
4
|
-
/**
|
|
5
|
-
* 事件配置
|
|
6
|
-
*/
|
|
7
|
-
export interface PopsIframeEventConfig {
|
|
8
|
-
/**
|
|
9
|
-
* 唯一id
|
|
10
|
-
*/
|
|
11
|
-
guid: string;
|
|
12
|
-
/**
|
|
13
|
-
* 当前弹窗类型
|
|
14
|
-
*/
|
|
15
|
-
mode: PopsType;
|
|
16
|
-
/**
|
|
17
|
-
* 动画层
|
|
18
|
-
*/
|
|
19
|
-
animElement: HTMLElement;
|
|
20
|
-
/**
|
|
21
|
-
* 主元素
|
|
22
|
-
*/
|
|
23
|
-
popsElement: HTMLElement;
|
|
24
|
-
/**
|
|
25
|
-
* 遮罩层
|
|
26
|
-
*/
|
|
27
|
-
maskElement: HTMLElement;
|
|
28
|
-
/**
|
|
29
|
-
* 当前配置
|
|
30
|
-
*/
|
|
31
|
-
config: PopsIframeDetails;
|
|
32
|
-
}
|
|
33
3
|
/**
|
|
34
4
|
* 事件配置
|
|
35
5
|
*/
|
|
@@ -5,20 +5,20 @@ export interface PopsInstConfig {
|
|
|
5
5
|
/** 固定id */
|
|
6
6
|
guid: string;
|
|
7
7
|
/** 动画元素 */
|
|
8
|
-
|
|
8
|
+
$anim: HTMLDivElement;
|
|
9
9
|
/** 主元素 */
|
|
10
|
-
|
|
10
|
+
$pops: HTMLDivElement;
|
|
11
11
|
/** 遮罩层元素 */
|
|
12
|
-
|
|
12
|
+
$mask?: HTMLDivElement;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* config实例通用配置
|
|
16
16
|
*/
|
|
17
|
-
export interface
|
|
17
|
+
export interface PopsInstGeneralConfig extends PopsInstConfig {
|
|
18
18
|
/** shadow容器 */
|
|
19
19
|
$shadowContainer: HTMLDivElement;
|
|
20
20
|
/** shadow容器的shandowRoot */
|
|
21
21
|
$shadowRoot: ShadowRoot | HTMLElement;
|
|
22
22
|
/** 移除实例前的回调函数 */
|
|
23
|
-
beforeRemoveCallBack?: (instCommonConfig:
|
|
23
|
+
beforeRemoveCallBack?: (instCommonConfig: PopsInstGeneralConfig) => void;
|
|
24
24
|
}
|
|
@@ -1,111 +1,66 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
9
|
-
import type {
|
|
10
|
-
import type {
|
|
11
|
-
import type {
|
|
12
|
-
import type { PopsPanelSelectDetails } from "../components/panel/types/components-select";
|
|
13
|
-
import type { PopsPanelSliderDetails } from "../components/panel/types/components-slider";
|
|
14
|
-
import type { PopsPanelSwitchDetails } from "../components/panel/types/components-switch";
|
|
15
|
-
import type { PopsPanelTextAreaDetails } from "../components/panel/types/components-textarea";
|
|
16
|
-
import type { PopsPromptDetails } from "../components/prompt/types/index";
|
|
17
|
-
import type { PopsRightClickMenuDetails } from "../components/rightClickMenu/types";
|
|
18
|
-
import type { PopsToolTipDetails } from "../components/tooltip/types/index";
|
|
19
|
-
import type { PopsSearchSuggestionDetails } from "../components/searchSuggestion/types";
|
|
1
|
+
import type { PopsAlertConfig } from "../components/alert/types";
|
|
2
|
+
import type { PopsConfirmConfig } from "../components/confirm/types";
|
|
3
|
+
import type { PopsDrawerConfig } from "../components/drawer/types";
|
|
4
|
+
import type { PopsFolderConfig } from "../components/folder/types";
|
|
5
|
+
import type { PopsIframeConfig } from "../components/iframe/types";
|
|
6
|
+
import type { PopsLoadingConfig } from "../components/loading/types";
|
|
7
|
+
import type { PopsPanelConfig } from "../components/panel/types";
|
|
8
|
+
import type { PopsPromptConfig } from "../components/prompt/types/index";
|
|
9
|
+
import type { PopsRightClickMenuConfig } from "../components/rightClickMenu/types";
|
|
10
|
+
import type { PopsToolTipConfig } from "../components/tooltip/types/index";
|
|
11
|
+
import type { PopsSearchSuggestionConfig } from "../components/searchSuggestion/types";
|
|
20
12
|
|
|
21
13
|
export interface PopsUtilsOwnObject<V> {
|
|
22
14
|
[key: string]: V | PopsUtilsOwnObject<V>;
|
|
23
15
|
}
|
|
24
16
|
|
|
25
17
|
/** pops所有的类型配置 11个*/
|
|
26
|
-
export interface
|
|
27
|
-
alert:
|
|
28
|
-
confirm:
|
|
29
|
-
prompt:
|
|
30
|
-
loading:
|
|
31
|
-
iframe:
|
|
32
|
-
tooltip:
|
|
33
|
-
drawer:
|
|
34
|
-
folder:
|
|
35
|
-
panel:
|
|
36
|
-
rightClickMenu:
|
|
37
|
-
searchSuggestion:
|
|
18
|
+
export interface PopsConfig {
|
|
19
|
+
alert: PopsAlertConfig;
|
|
20
|
+
confirm: PopsConfirmConfig;
|
|
21
|
+
prompt: PopsPromptConfig;
|
|
22
|
+
loading: PopsLoadingConfig;
|
|
23
|
+
iframe: PopsIframeConfig;
|
|
24
|
+
tooltip: PopsToolTipConfig;
|
|
25
|
+
drawer: PopsDrawerConfig;
|
|
26
|
+
folder: PopsFolderConfig;
|
|
27
|
+
panel: PopsPanelConfig;
|
|
28
|
+
rightClickMenu: PopsRightClickMenuConfig;
|
|
29
|
+
searchSuggestion: PopsSearchSuggestionConfig;
|
|
38
30
|
}
|
|
39
31
|
|
|
40
32
|
/** pops的类型 */
|
|
41
|
-
export type PopsType = keyof
|
|
33
|
+
export type PopsType = keyof PopsConfig;
|
|
42
34
|
|
|
43
35
|
/** pops中支持only的配置 */
|
|
44
|
-
export type
|
|
36
|
+
export type PopsSupportOnlyConfig = Omit<PopsConfig, "searchSuggestion">;
|
|
45
37
|
|
|
46
38
|
/** 存储实例的类型 */
|
|
47
|
-
export type PopsInstStoreType = keyof Omit<
|
|
39
|
+
export type PopsInstStoreType = keyof Omit<PopsConfig, "searchSuggestion">;
|
|
48
40
|
|
|
49
41
|
/** pops弹窗支持动画元素的配置 8个 */
|
|
50
|
-
export type
|
|
42
|
+
export type PopsSupportAnimConfig = Omit<PopsConfig, "tooltip" | "rightClickMenu" | "searchSuggestion">;
|
|
51
43
|
|
|
52
44
|
/** pops弹窗支持动画元素的类型 */
|
|
53
|
-
export type
|
|
45
|
+
export type PopsSupportAnimConfigType = keyof PopsSupportAnimConfig;
|
|
54
46
|
|
|
55
47
|
/** pops弹窗支持标题栏的配置 */
|
|
56
|
-
export type
|
|
57
|
-
|
|
48
|
+
export type PopsSupportHeaderTitleConfig = Pick<
|
|
49
|
+
PopsConfig,
|
|
58
50
|
"alert" | "confirm" | "prompt" | "iframe" | "drawer" | "folder" | "panel"
|
|
59
51
|
>;
|
|
60
52
|
|
|
61
53
|
/** pops弹窗支持标题栏的类型 */
|
|
62
|
-
export type
|
|
54
|
+
export type PopsSupportHeaderTitleConfigType = keyof PopsSupportHeaderTitleConfig;
|
|
63
55
|
|
|
64
56
|
/** pops支持底部按钮的配置 */
|
|
65
|
-
export type
|
|
57
|
+
export type PopsSupportBottomButtonConfig = Pick<PopsConfig, "alert" | "confirm" | "prompt" | "drawer">;
|
|
66
58
|
|
|
67
59
|
/** pops支持底部按钮的类型 */
|
|
68
|
-
export type
|
|
60
|
+
export type PopsSupportBottomButtonConfigType = keyof PopsSupportHeaderTitleConfig;
|
|
69
61
|
|
|
70
62
|
/** pops支持中间内容的配置 */
|
|
71
|
-
export type
|
|
63
|
+
export type PopsSupportContentConfig = Pick<PopsConfig, "alert" | "confirm" | "prompt" | "drawer" | "loading">;
|
|
72
64
|
|
|
73
65
|
/** pops支持中间内容的类型 */
|
|
74
|
-
export type
|
|
75
|
-
|
|
76
|
-
/** panel的各种类型的配置项 */
|
|
77
|
-
export type PopsPanelFormsTotalDetails =
|
|
78
|
-
| PopsPanelSwitchDetails
|
|
79
|
-
| PopsPanelSliderDetails
|
|
80
|
-
| PopsPanelInputDetails
|
|
81
|
-
| PopsPanelTextAreaDetails
|
|
82
|
-
| PopsPanelSelectDetails<any>
|
|
83
|
-
| PopsPanelButtonDetails
|
|
84
|
-
| PopsPanelDeepMenuDetails
|
|
85
|
-
| PopsPanelOwnDetails;
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* pops.xxx的调用返回值
|
|
89
|
-
*/
|
|
90
|
-
export interface PopsCallResult {
|
|
91
|
-
/** 唯一标识id */
|
|
92
|
-
guid: string;
|
|
93
|
-
/** 影子元素 */
|
|
94
|
-
$shadowContainer: HTMLDivElement;
|
|
95
|
-
/** 影子元素的根节点 */
|
|
96
|
-
$shadowRoot: ShadowRoot | HTMLElement;
|
|
97
|
-
/** 元素 */
|
|
98
|
-
element: HTMLDivElement;
|
|
99
|
-
/** 动画层元素 */
|
|
100
|
-
animElement: HTMLDivElement;
|
|
101
|
-
/** pops元素 */
|
|
102
|
-
popsElement: HTMLDivElement;
|
|
103
|
-
/** 遮罩层元素 */
|
|
104
|
-
maskElement?: HTMLDivElement;
|
|
105
|
-
/** 关闭弹窗 */
|
|
106
|
-
close(): void;
|
|
107
|
-
/** 隐藏弹窗 */
|
|
108
|
-
hide(): void;
|
|
109
|
-
/** 显示弹窗 */
|
|
110
|
-
show(): void;
|
|
111
|
-
}
|
|
66
|
+
export type PopsSupportContentConfigType = keyof PopsSupportContentConfig;
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
1
|
+
import type { PopsAlertConfig } from "../components/alert/types";
|
|
2
|
+
import type { PopsDrawerConfig } from "../components/drawer/types";
|
|
3
|
+
import type { PopsFolderConfig } from "../components/folder/types";
|
|
4
|
+
import type { PopsIframeConfig } from "../components/iframe/types";
|
|
5
|
+
import type { PopsLoadingConfig } from "../components/loading/types";
|
|
6
|
+
import type { PopsPanelConfig } from "../components/panel/types";
|
|
7
|
+
import type { PopsPromptConfig } from "../components/prompt/types/index";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* 遮罩层配置
|
|
11
11
|
*/
|
|
12
|
-
export interface
|
|
12
|
+
export interface PopsMaskConfig {
|
|
13
13
|
/**
|
|
14
14
|
* 是否启用遮罩层,默认false
|
|
15
15
|
* @default false
|
|
16
16
|
*/
|
|
17
17
|
enable?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* 点击事件
|
|
20
|
+
*/
|
|
18
21
|
clickEvent?: {
|
|
19
22
|
/**
|
|
20
23
|
* 点击遮罩层是否触发关闭事件
|
|
@@ -36,13 +39,13 @@ export interface PopsMaskDetails {
|
|
|
36
39
|
| ((
|
|
37
40
|
originalRun: () => void | Promise<void>,
|
|
38
41
|
config:
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
|
42
|
-
|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
42
|
+
| PopsAlertConfig
|
|
43
|
+
| PopsDrawerConfig
|
|
44
|
+
| PopsIframeConfig
|
|
45
|
+
| PopsPromptConfig
|
|
46
|
+
| PopsFolderConfig
|
|
47
|
+
| PopsLoadingConfig
|
|
48
|
+
| PopsPanelConfig
|
|
46
49
|
) => void)
|
|
47
50
|
| undefined
|
|
48
51
|
| null;
|