@whitesev/pops 3.2.1 → 3.3.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/README.md +249 -249
- package/dist/index.amd.js +736 -948
- 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 +736 -948
- 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 +736 -948
- 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 +736 -948
- 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 +736 -948
- 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 +736 -948
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/types/src/PopsCore.d.ts +15 -7
- package/dist/types/src/components/folder/types/index.d.ts +43 -13
- package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +313 -313
- package/dist/types/src/types/animation.d.ts +19 -19
- package/dist/types/src/types/button.d.ts +94 -94
- package/dist/types/src/types/components.d.ts +211 -211
- package/dist/types/src/types/event.d.ts +43 -43
- package/dist/types/src/types/global.d.ts +31 -31
- package/dist/types/src/types/icon.d.ts +32 -32
- package/dist/types/src/types/inst.d.ts +28 -28
- package/dist/types/src/types/main.d.ts +66 -66
- package/dist/types/src/types/mask.d.ts +52 -52
- package/dist/types/src/types/position.d.ts +60 -60
- package/package.json +28 -27
- package/src/Pops.ts +206 -206
- package/src/PopsAnimation.ts +32 -32
- package/src/PopsCSS.ts +54 -54
- package/src/PopsCore.ts +53 -37
- package/src/PopsIcon.ts +95 -95
- package/src/PopsInst.ts +21 -21
- package/src/components/alert/defaultConfig.ts +62 -62
- package/src/components/alert/index.ts +163 -163
- package/src/components/alert/types/index.ts +23 -23
- package/src/components/confirm/defaultConfig.ts +90 -90
- package/src/components/confirm/index.ts +165 -165
- package/src/components/confirm/types/index.ts +13 -17
- package/src/components/drawer/defaultConfig.ts +89 -89
- package/src/components/drawer/index.css +37 -37
- package/src/components/drawer/index.ts +245 -245
- package/src/components/drawer/types/index.ts +62 -61
- package/src/components/folder/defaultConfig.ts +151 -151
- package/src/components/folder/folderIcon.ts +28 -28
- package/src/components/folder/index.css +303 -303
- package/src/components/folder/index.ts +953 -932
- package/src/components/folder/types/index.ts +143 -110
- package/src/components/iframe/defaultConfig.ts +60 -60
- package/src/components/iframe/index.css +76 -76
- package/src/components/iframe/index.ts +331 -331
- package/src/components/iframe/types/index.ts +96 -96
- package/src/components/loading/defaultConfig.ts +29 -29
- package/src/components/loading/index.css +66 -66
- package/src/components/loading/index.ts +101 -101
- package/src/components/loading/types/index.ts +36 -34
- package/src/components/panel/css/components-select.css +84 -84
- package/src/components/panel/defaultConfig.ts +868 -868
- package/src/components/panel/handlerComponents.ts +3993 -3993
- package/src/components/panel/index.css +1403 -1403
- package/src/components/panel/index.ts +221 -221
- package/src/components/panel/types/components-button.ts +56 -56
- package/src/components/panel/types/components-common.ts +73 -73
- package/src/components/panel/types/components-container.ts +25 -25
- package/src/components/panel/types/components-deepMenu.ts +64 -64
- package/src/components/panel/types/components-input.ts +90 -90
- package/src/components/panel/types/components-own.ts +16 -16
- package/src/components/panel/types/components-select.ts +169 -169
- package/src/components/panel/types/components-selectMultiple.ts +105 -104
- package/src/components/panel/types/components-slider.ts +55 -55
- package/src/components/panel/types/components-switch.ts +33 -33
- package/src/components/panel/types/components-textarea.ts +45 -45
- package/src/components/panel/types/index.ts +244 -244
- package/src/components/prompt/defaultConfig.ts +94 -94
- package/src/components/prompt/index.css +34 -34
- package/src/components/prompt/index.ts +187 -215
- package/src/components/prompt/types/index.ts +57 -56
- package/src/components/rightClickMenu/defaultConfig.ts +103 -103
- package/src/components/rightClickMenu/index.css +115 -115
- package/src/components/rightClickMenu/index.ts +662 -662
- package/src/components/rightClickMenu/types/index.ts +145 -143
- package/src/components/searchSuggestion/defaultConfig.ts +63 -63
- package/src/components/searchSuggestion/index.ts +813 -813
- package/src/components/searchSuggestion/types/index.ts +244 -242
- package/src/components/tooltip/defaultConfig.ts +33 -33
- package/src/components/tooltip/index.css +199 -199
- package/src/components/tooltip/index.ts +617 -617
- package/src/components/tooltip/types/index.ts +123 -121
- package/src/config/CommonCSSClassName.ts +17 -17
- package/src/config/GlobalConfig.ts +63 -63
- package/src/css/animation.css +987 -987
- package/src/css/button.css +551 -551
- package/src/css/common.css +54 -54
- package/src/css/index.css +253 -253
- package/src/css/ninePalaceGridPosition.css +50 -50
- package/src/css/scrollbar.css +22 -22
- package/src/handler/PopsElementHandler.ts +303 -303
- package/src/handler/PopsHandler.ts +611 -611
- package/src/types/PopsDOMUtilsEventType.d.ts +313 -313
- package/src/types/animation.d.ts +19 -19
- package/src/types/button.d.ts +94 -94
- package/src/types/components.d.ts +211 -211
- package/src/types/event.d.ts +43 -43
- package/src/types/global.d.ts +31 -31
- package/src/types/icon.d.ts +32 -32
- package/src/types/inst.d.ts +28 -28
- package/src/types/main.d.ts +66 -66
- package/src/types/mask.d.ts +52 -52
- package/src/types/position.d.ts +60 -60
- package/src/utils/PopsDOMUtils.ts +2483 -2483
- package/src/utils/PopsDOMUtilsEventsConfig.ts +4 -4
- package/src/utils/PopsInstanceUtils.ts +714 -714
- package/src/utils/PopsMathUtils.ts +71 -71
- package/src/utils/PopsSafeUtils.ts +22 -22
- package/src/utils/PopsUtils.ts +391 -421
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import type { PopsType } from "./main";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 事件配置
|
|
5
|
-
*/
|
|
6
|
-
export interface PopsEventConfig {
|
|
7
|
-
/** 最外层包裹的元素 */
|
|
8
|
-
$shadowContainer: HTMLDivElement;
|
|
9
|
-
/** ShadowRoot */
|
|
10
|
-
$shadowRoot: ShadowRoot | HTMLElement;
|
|
11
|
-
/** -> 动画层 */
|
|
12
|
-
$el: HTMLDivElement;
|
|
13
|
-
/** 动画层 */
|
|
14
|
-
$anim: HTMLDivElement;
|
|
15
|
-
/** 主元素 */
|
|
16
|
-
$pops: HTMLDivElement;
|
|
17
|
-
/** 遮罩层 */
|
|
18
|
-
$mask?: HTMLDivElement;
|
|
19
|
-
/** 当前弹窗类型 */
|
|
20
|
-
mode: PopsType;
|
|
21
|
-
/** 唯一id */
|
|
22
|
-
guid: string;
|
|
23
|
-
/**
|
|
24
|
-
* 关闭弹窗
|
|
25
|
-
*/
|
|
26
|
-
close(): Promise<void>;
|
|
27
|
-
/**
|
|
28
|
-
* 隐藏弹窗
|
|
29
|
-
*/
|
|
30
|
-
hide(): Promise<void>;
|
|
31
|
-
/**
|
|
32
|
-
* 显示弹出
|
|
33
|
-
*/
|
|
34
|
-
show($parent?: HTMLElement | Document | ShadowRoot): Promise<void>;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* 处理过的事件配置
|
|
39
|
-
*/
|
|
40
|
-
export interface PopsHandlerEventConfig extends PopsEventConfig {
|
|
41
|
-
/** 当前按钮类型 */
|
|
42
|
-
type: "cancel" | "close" | "ok" | "other";
|
|
43
|
-
}
|
|
1
|
+
import type { PopsType } from "./main";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 事件配置
|
|
5
|
+
*/
|
|
6
|
+
export interface PopsEventConfig {
|
|
7
|
+
/** 最外层包裹的元素 */
|
|
8
|
+
$shadowContainer: HTMLDivElement;
|
|
9
|
+
/** ShadowRoot */
|
|
10
|
+
$shadowRoot: ShadowRoot | HTMLElement;
|
|
11
|
+
/** -> 动画层 */
|
|
12
|
+
$el: HTMLDivElement;
|
|
13
|
+
/** 动画层 */
|
|
14
|
+
$anim: HTMLDivElement;
|
|
15
|
+
/** 主元素 */
|
|
16
|
+
$pops: HTMLDivElement;
|
|
17
|
+
/** 遮罩层 */
|
|
18
|
+
$mask?: HTMLDivElement;
|
|
19
|
+
/** 当前弹窗类型 */
|
|
20
|
+
mode: PopsType;
|
|
21
|
+
/** 唯一id */
|
|
22
|
+
guid: string;
|
|
23
|
+
/**
|
|
24
|
+
* 关闭弹窗
|
|
25
|
+
*/
|
|
26
|
+
close(): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* 隐藏弹窗
|
|
29
|
+
*/
|
|
30
|
+
hide(): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* 显示弹出
|
|
33
|
+
*/
|
|
34
|
+
show($parent?: HTMLElement | Document | ShadowRoot): Promise<void>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 处理过的事件配置
|
|
39
|
+
*/
|
|
40
|
+
export interface PopsHandlerEventConfig extends PopsEventConfig {
|
|
41
|
+
/** 当前按钮类型 */
|
|
42
|
+
type: "cancel" | "close" | "ok" | "other";
|
|
43
|
+
}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
declare module "*.css" {
|
|
2
|
-
const content: string;
|
|
3
|
-
export default content;
|
|
4
|
-
}
|
|
5
|
-
declare module "*.svg" {
|
|
6
|
-
const content: string;
|
|
7
|
-
export default content;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
declare let unsafeWindow: Window & typeof globalThis;
|
|
11
|
-
|
|
12
|
-
declare interface Window {
|
|
13
|
-
trustedTypes: any;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
declare type DeepRequired<T> = T extends any[]
|
|
17
|
-
? T
|
|
18
|
-
: // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
19
|
-
T extends Function
|
|
20
|
-
? T
|
|
21
|
-
: T extends object
|
|
22
|
-
? T extends Node
|
|
23
|
-
? T
|
|
24
|
-
: {
|
|
25
|
-
[K in keyof T]-?: DeepRequired<T[K]>;
|
|
26
|
-
}
|
|
27
|
-
: T;
|
|
28
|
-
|
|
29
|
-
declare type IPromise<T> = T | Promise<T>;
|
|
30
|
-
|
|
31
|
-
declare type IFunction<T> = T | (() => T);
|
|
1
|
+
declare module "*.css" {
|
|
2
|
+
const content: string;
|
|
3
|
+
export default content;
|
|
4
|
+
}
|
|
5
|
+
declare module "*.svg" {
|
|
6
|
+
const content: string;
|
|
7
|
+
export default content;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
declare let unsafeWindow: Window & typeof globalThis;
|
|
11
|
+
|
|
12
|
+
declare interface Window {
|
|
13
|
+
trustedTypes: any;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare type DeepRequired<T> = T extends any[]
|
|
17
|
+
? T
|
|
18
|
+
: // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
19
|
+
T extends Function
|
|
20
|
+
? T
|
|
21
|
+
: T extends object
|
|
22
|
+
? T extends Node
|
|
23
|
+
? T
|
|
24
|
+
: {
|
|
25
|
+
[K in keyof T]-?: DeepRequired<T[K]>;
|
|
26
|
+
}
|
|
27
|
+
: T;
|
|
28
|
+
|
|
29
|
+
declare type IPromise<T> = T | Promise<T>;
|
|
30
|
+
|
|
31
|
+
declare type IFunction<T> = T | (() => T);
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 按钮svg图标
|
|
3
|
-
*/
|
|
4
|
-
export type PopsIconType =
|
|
5
|
-
| "min"
|
|
6
|
-
| "mise"
|
|
7
|
-
| "max"
|
|
8
|
-
| "close"
|
|
9
|
-
| "edit"
|
|
10
|
-
| "share"
|
|
11
|
-
| "delete"
|
|
12
|
-
| "search"
|
|
13
|
-
| "upload"
|
|
14
|
-
| "loading"
|
|
15
|
-
| "next"
|
|
16
|
-
| "prev"
|
|
17
|
-
| "eleme"
|
|
18
|
-
| "elemePlus"
|
|
19
|
-
| "chromeFilled"
|
|
20
|
-
| "cpu"
|
|
21
|
-
| "videoPlay"
|
|
22
|
-
| "videoPause"
|
|
23
|
-
| "headset"
|
|
24
|
-
| "monitor"
|
|
25
|
-
| "documentCopy"
|
|
26
|
-
| "picture"
|
|
27
|
-
| "circleClose"
|
|
28
|
-
| "view"
|
|
29
|
-
| "hide"
|
|
30
|
-
| "keyboard"
|
|
31
|
-
| "arrowRight"
|
|
32
|
-
| "arrowLeft";
|
|
1
|
+
/**
|
|
2
|
+
* 按钮svg图标
|
|
3
|
+
*/
|
|
4
|
+
export type PopsIconType =
|
|
5
|
+
| "min"
|
|
6
|
+
| "mise"
|
|
7
|
+
| "max"
|
|
8
|
+
| "close"
|
|
9
|
+
| "edit"
|
|
10
|
+
| "share"
|
|
11
|
+
| "delete"
|
|
12
|
+
| "search"
|
|
13
|
+
| "upload"
|
|
14
|
+
| "loading"
|
|
15
|
+
| "next"
|
|
16
|
+
| "prev"
|
|
17
|
+
| "eleme"
|
|
18
|
+
| "elemePlus"
|
|
19
|
+
| "chromeFilled"
|
|
20
|
+
| "cpu"
|
|
21
|
+
| "videoPlay"
|
|
22
|
+
| "videoPause"
|
|
23
|
+
| "headset"
|
|
24
|
+
| "monitor"
|
|
25
|
+
| "documentCopy"
|
|
26
|
+
| "picture"
|
|
27
|
+
| "circleClose"
|
|
28
|
+
| "view"
|
|
29
|
+
| "hide"
|
|
30
|
+
| "keyboard"
|
|
31
|
+
| "arrowRight"
|
|
32
|
+
| "arrowLeft";
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* config实例配置
|
|
3
|
-
*/
|
|
4
|
-
export interface PopsInstConfig {
|
|
5
|
-
/** 固定id */
|
|
6
|
-
guid: string;
|
|
7
|
-
/** 动画元素 */
|
|
8
|
-
$anim: HTMLDivElement;
|
|
9
|
-
/** 主元素 */
|
|
10
|
-
$pops: HTMLDivElement;
|
|
11
|
-
/** 遮罩层元素 */
|
|
12
|
-
$mask?: HTMLDivElement;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* config实例通用配置
|
|
16
|
-
*/
|
|
17
|
-
export interface PopsInstGeneralConfig extends PopsInstConfig {
|
|
18
|
-
/** shadow容器 */
|
|
19
|
-
$shadowContainer: HTMLDivElement;
|
|
20
|
-
/** shadow容器的shandowRoot */
|
|
21
|
-
$shadowRoot: ShadowRoot | HTMLElement;
|
|
22
|
-
/** 移除实例前的回调函数 */
|
|
23
|
-
beforeRemoveCallBack?: (instCommonConfig: PopsInstGeneralConfig) => void;
|
|
24
|
-
/** 配置 */
|
|
25
|
-
config: any;
|
|
26
|
-
/** 销毁元素 */
|
|
27
|
-
destory(): void | Promise<void>;
|
|
28
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* config实例配置
|
|
3
|
+
*/
|
|
4
|
+
export interface PopsInstConfig {
|
|
5
|
+
/** 固定id */
|
|
6
|
+
guid: string;
|
|
7
|
+
/** 动画元素 */
|
|
8
|
+
$anim: HTMLDivElement;
|
|
9
|
+
/** 主元素 */
|
|
10
|
+
$pops: HTMLDivElement;
|
|
11
|
+
/** 遮罩层元素 */
|
|
12
|
+
$mask?: HTMLDivElement;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* config实例通用配置
|
|
16
|
+
*/
|
|
17
|
+
export interface PopsInstGeneralConfig extends PopsInstConfig {
|
|
18
|
+
/** shadow容器 */
|
|
19
|
+
$shadowContainer: HTMLDivElement;
|
|
20
|
+
/** shadow容器的shandowRoot */
|
|
21
|
+
$shadowRoot: ShadowRoot | HTMLElement;
|
|
22
|
+
/** 移除实例前的回调函数 */
|
|
23
|
+
beforeRemoveCallBack?: (instCommonConfig: PopsInstGeneralConfig) => void;
|
|
24
|
+
/** 配置 */
|
|
25
|
+
config: any;
|
|
26
|
+
/** 销毁元素 */
|
|
27
|
+
destory(): void | Promise<void>;
|
|
28
|
+
}
|
|
@@ -1,66 +1,66 @@
|
|
|
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";
|
|
12
|
-
|
|
13
|
-
export interface PopsUtilsOwnObject<V> {
|
|
14
|
-
[key: string]: V | PopsUtilsOwnObject<V>;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/** pops所有的类型配置 11个*/
|
|
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;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/** pops的类型 */
|
|
33
|
-
export type PopsType = keyof PopsConfig;
|
|
34
|
-
|
|
35
|
-
/** pops中支持only的配置 */
|
|
36
|
-
export type PopsSupportOnlyConfig = Omit<PopsConfig, "searchSuggestion">;
|
|
37
|
-
|
|
38
|
-
/** 存储实例的类型 */
|
|
39
|
-
export type PopsInstStoreType = keyof Omit<PopsConfig, "searchSuggestion">;
|
|
40
|
-
|
|
41
|
-
/** pops弹窗支持动画元素的配置 8个 */
|
|
42
|
-
export type PopsSupportAnimConfig = Omit<PopsConfig, "tooltip" | "rightClickMenu" | "searchSuggestion">;
|
|
43
|
-
|
|
44
|
-
/** pops弹窗支持动画元素的类型 */
|
|
45
|
-
export type PopsSupportAnimConfigType = keyof PopsSupportAnimConfig;
|
|
46
|
-
|
|
47
|
-
/** pops弹窗支持标题栏的配置 */
|
|
48
|
-
export type PopsSupportHeaderTitleConfig = Pick<
|
|
49
|
-
PopsConfig,
|
|
50
|
-
"alert" | "confirm" | "prompt" | "iframe" | "drawer" | "folder" | "panel"
|
|
51
|
-
>;
|
|
52
|
-
|
|
53
|
-
/** pops弹窗支持标题栏的类型 */
|
|
54
|
-
export type PopsSupportHeaderTitleConfigType = keyof PopsSupportHeaderTitleConfig;
|
|
55
|
-
|
|
56
|
-
/** pops支持底部按钮的配置 */
|
|
57
|
-
export type PopsSupportBottomButtonConfig = Pick<PopsConfig, "alert" | "confirm" | "prompt" | "drawer">;
|
|
58
|
-
|
|
59
|
-
/** pops支持底部按钮的类型 */
|
|
60
|
-
export type PopsSupportBottomButtonConfigType = keyof PopsSupportHeaderTitleConfig;
|
|
61
|
-
|
|
62
|
-
/** pops支持中间内容的配置 */
|
|
63
|
-
export type PopsSupportContentConfig = Pick<PopsConfig, "alert" | "confirm" | "prompt" | "drawer" | "loading">;
|
|
64
|
-
|
|
65
|
-
/** pops支持中间内容的类型 */
|
|
66
|
-
export type PopsSupportContentConfigType = keyof PopsSupportContentConfig;
|
|
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";
|
|
12
|
+
|
|
13
|
+
export interface PopsUtilsOwnObject<V> {
|
|
14
|
+
[key: string]: V | PopsUtilsOwnObject<V>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** pops所有的类型配置 11个*/
|
|
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;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** pops的类型 */
|
|
33
|
+
export type PopsType = keyof PopsConfig;
|
|
34
|
+
|
|
35
|
+
/** pops中支持only的配置 */
|
|
36
|
+
export type PopsSupportOnlyConfig = Omit<PopsConfig, "searchSuggestion">;
|
|
37
|
+
|
|
38
|
+
/** 存储实例的类型 */
|
|
39
|
+
export type PopsInstStoreType = keyof Omit<PopsConfig, "searchSuggestion">;
|
|
40
|
+
|
|
41
|
+
/** pops弹窗支持动画元素的配置 8个 */
|
|
42
|
+
export type PopsSupportAnimConfig = Omit<PopsConfig, "tooltip" | "rightClickMenu" | "searchSuggestion">;
|
|
43
|
+
|
|
44
|
+
/** pops弹窗支持动画元素的类型 */
|
|
45
|
+
export type PopsSupportAnimConfigType = keyof PopsSupportAnimConfig;
|
|
46
|
+
|
|
47
|
+
/** pops弹窗支持标题栏的配置 */
|
|
48
|
+
export type PopsSupportHeaderTitleConfig = Pick<
|
|
49
|
+
PopsConfig,
|
|
50
|
+
"alert" | "confirm" | "prompt" | "iframe" | "drawer" | "folder" | "panel"
|
|
51
|
+
>;
|
|
52
|
+
|
|
53
|
+
/** pops弹窗支持标题栏的类型 */
|
|
54
|
+
export type PopsSupportHeaderTitleConfigType = keyof PopsSupportHeaderTitleConfig;
|
|
55
|
+
|
|
56
|
+
/** pops支持底部按钮的配置 */
|
|
57
|
+
export type PopsSupportBottomButtonConfig = Pick<PopsConfig, "alert" | "confirm" | "prompt" | "drawer">;
|
|
58
|
+
|
|
59
|
+
/** pops支持底部按钮的类型 */
|
|
60
|
+
export type PopsSupportBottomButtonConfigType = keyof PopsSupportHeaderTitleConfig;
|
|
61
|
+
|
|
62
|
+
/** pops支持中间内容的配置 */
|
|
63
|
+
export type PopsSupportContentConfig = Pick<PopsConfig, "alert" | "confirm" | "prompt" | "drawer" | "loading">;
|
|
64
|
+
|
|
65
|
+
/** pops支持中间内容的类型 */
|
|
66
|
+
export type PopsSupportContentConfigType = keyof PopsSupportContentConfig;
|
|
@@ -1,52 +1,52 @@
|
|
|
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
|
-
|
|
9
|
-
/**
|
|
10
|
-
* 遮罩层配置
|
|
11
|
-
*/
|
|
12
|
-
export interface PopsMaskConfig {
|
|
13
|
-
/**
|
|
14
|
-
* 是否启用遮罩层,默认false
|
|
15
|
-
* @default false
|
|
16
|
-
*/
|
|
17
|
-
enable?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* 点击事件
|
|
20
|
-
*/
|
|
21
|
-
clickEvent?: {
|
|
22
|
-
/**
|
|
23
|
-
* 点击遮罩层是否触发关闭事件
|
|
24
|
-
* @default false
|
|
25
|
-
*/
|
|
26
|
-
toClose?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* 点击遮罩层是否触发隐藏事件
|
|
29
|
-
* @default false
|
|
30
|
-
*/
|
|
31
|
-
toHide?: boolean;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* 遮罩层自定义的点击事件
|
|
35
|
-
* @param originalRun 当toClose为true,它是关闭弹窗,当toHide为true,它是隐藏弹窗
|
|
36
|
-
* @param config 配置信息
|
|
37
|
-
*/
|
|
38
|
-
clickCallBack?:
|
|
39
|
-
| ((
|
|
40
|
-
originalRun: () => void | Promise<void>,
|
|
41
|
-
config:
|
|
42
|
-
| PopsAlertConfig
|
|
43
|
-
| PopsDrawerConfig
|
|
44
|
-
| PopsIframeConfig
|
|
45
|
-
| PopsPromptConfig
|
|
46
|
-
| PopsFolderConfig
|
|
47
|
-
| PopsLoadingConfig
|
|
48
|
-
| PopsPanelConfig
|
|
49
|
-
) => void)
|
|
50
|
-
| undefined
|
|
51
|
-
| null;
|
|
52
|
-
}
|
|
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
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 遮罩层配置
|
|
11
|
+
*/
|
|
12
|
+
export interface PopsMaskConfig {
|
|
13
|
+
/**
|
|
14
|
+
* 是否启用遮罩层,默认false
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
enable?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* 点击事件
|
|
20
|
+
*/
|
|
21
|
+
clickEvent?: {
|
|
22
|
+
/**
|
|
23
|
+
* 点击遮罩层是否触发关闭事件
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
toClose?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* 点击遮罩层是否触发隐藏事件
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
toHide?: boolean;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* 遮罩层自定义的点击事件
|
|
35
|
+
* @param originalRun 当toClose为true,它是关闭弹窗,当toHide为true,它是隐藏弹窗
|
|
36
|
+
* @param config 配置信息
|
|
37
|
+
*/
|
|
38
|
+
clickCallBack?:
|
|
39
|
+
| ((
|
|
40
|
+
originalRun: () => void | Promise<void>,
|
|
41
|
+
config:
|
|
42
|
+
| PopsAlertConfig
|
|
43
|
+
| PopsDrawerConfig
|
|
44
|
+
| PopsIframeConfig
|
|
45
|
+
| PopsPromptConfig
|
|
46
|
+
| PopsFolderConfig
|
|
47
|
+
| PopsLoadingConfig
|
|
48
|
+
| PopsPanelConfig
|
|
49
|
+
) => void)
|
|
50
|
+
| undefined
|
|
51
|
+
| null;
|
|
52
|
+
}
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 弹窗位置
|
|
3
|
-
*/
|
|
4
|
-
export type PopsPosition =
|
|
5
|
-
| "top_left"
|
|
6
|
-
| "top"
|
|
7
|
-
| "top_right"
|
|
8
|
-
| "center_left"
|
|
9
|
-
| "center"
|
|
10
|
-
| "center_right"
|
|
11
|
-
| "bottom_left"
|
|
12
|
-
| "bottom"
|
|
13
|
-
| "bottom_right";
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* 按钮位置
|
|
17
|
-
*/
|
|
18
|
-
export type PopsJustifyContent =
|
|
19
|
-
| "center"
|
|
20
|
-
| "end"
|
|
21
|
-
| "flex-end"
|
|
22
|
-
| "flex-start"
|
|
23
|
-
| "left"
|
|
24
|
-
| "normal"
|
|
25
|
-
| "right"
|
|
26
|
-
| "space-around"
|
|
27
|
-
| "space-between"
|
|
28
|
-
| "space-evenly"
|
|
29
|
-
| "start"
|
|
30
|
-
| "stretch"
|
|
31
|
-
| "inherit"
|
|
32
|
-
| "initial"
|
|
33
|
-
| "revert"
|
|
34
|
-
| "revert-layer"
|
|
35
|
-
| "unset";
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* text-align
|
|
39
|
-
*/
|
|
40
|
-
export type PopsTextAlign =
|
|
41
|
-
| "center"
|
|
42
|
-
| "end"
|
|
43
|
-
| "justify"
|
|
44
|
-
| "left"
|
|
45
|
-
| "right"
|
|
46
|
-
| "start"
|
|
47
|
-
| "-webkit-auto"
|
|
48
|
-
| "-moz-center-or-inherit"
|
|
49
|
-
| "-webkit-center"
|
|
50
|
-
| "-moz-center"
|
|
51
|
-
| "-webkit-left"
|
|
52
|
-
| "-moz-left"
|
|
53
|
-
| "-webkit-match-parent"
|
|
54
|
-
| "-webkit-right"
|
|
55
|
-
| "-moz-right"
|
|
56
|
-
| "inherit"
|
|
57
|
-
| "initial"
|
|
58
|
-
| "revert"
|
|
59
|
-
| "revert-layer"
|
|
60
|
-
| "unset";
|
|
1
|
+
/**
|
|
2
|
+
* 弹窗位置
|
|
3
|
+
*/
|
|
4
|
+
export type PopsPosition =
|
|
5
|
+
| "top_left"
|
|
6
|
+
| "top"
|
|
7
|
+
| "top_right"
|
|
8
|
+
| "center_left"
|
|
9
|
+
| "center"
|
|
10
|
+
| "center_right"
|
|
11
|
+
| "bottom_left"
|
|
12
|
+
| "bottom"
|
|
13
|
+
| "bottom_right";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 按钮位置
|
|
17
|
+
*/
|
|
18
|
+
export type PopsJustifyContent =
|
|
19
|
+
| "center"
|
|
20
|
+
| "end"
|
|
21
|
+
| "flex-end"
|
|
22
|
+
| "flex-start"
|
|
23
|
+
| "left"
|
|
24
|
+
| "normal"
|
|
25
|
+
| "right"
|
|
26
|
+
| "space-around"
|
|
27
|
+
| "space-between"
|
|
28
|
+
| "space-evenly"
|
|
29
|
+
| "start"
|
|
30
|
+
| "stretch"
|
|
31
|
+
| "inherit"
|
|
32
|
+
| "initial"
|
|
33
|
+
| "revert"
|
|
34
|
+
| "revert-layer"
|
|
35
|
+
| "unset";
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* text-align
|
|
39
|
+
*/
|
|
40
|
+
export type PopsTextAlign =
|
|
41
|
+
| "center"
|
|
42
|
+
| "end"
|
|
43
|
+
| "justify"
|
|
44
|
+
| "left"
|
|
45
|
+
| "right"
|
|
46
|
+
| "start"
|
|
47
|
+
| "-webkit-auto"
|
|
48
|
+
| "-moz-center-or-inherit"
|
|
49
|
+
| "-webkit-center"
|
|
50
|
+
| "-moz-center"
|
|
51
|
+
| "-webkit-left"
|
|
52
|
+
| "-moz-left"
|
|
53
|
+
| "-webkit-match-parent"
|
|
54
|
+
| "-webkit-right"
|
|
55
|
+
| "-moz-right"
|
|
56
|
+
| "inherit"
|
|
57
|
+
| "initial"
|
|
58
|
+
| "revert"
|
|
59
|
+
| "revert-layer"
|
|
60
|
+
| "unset";
|