@whitesev/pops 3.2.1 → 3.2.2
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 +702 -667
- 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 +702 -667
- 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 +702 -667
- 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 +702 -667
- 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 +702 -667
- 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 +702 -667
- 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/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 +27 -25
- package/src/Pops.ts +206 -206
- package/src/PopsAnimation.ts +32 -32
- package/src/PopsCSS.ts +54 -54
- package/src/PopsCore.ts +37 -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 +421 -421
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* pops.panel的 switch
|
|
5
|
-
*/
|
|
6
|
-
export interface PopsPanelSwitchConfig extends PopsPanelGeneralConfig<PopsPanelSwitchConfig> {
|
|
7
|
-
/**
|
|
8
|
-
* 组件类型
|
|
9
|
-
*/
|
|
10
|
-
type: "switch";
|
|
11
|
-
/**
|
|
12
|
-
* 显示在左边的文字
|
|
13
|
-
*/
|
|
14
|
-
text: string;
|
|
15
|
-
/**
|
|
16
|
-
* (可选)左边的文字下面的描述
|
|
17
|
-
* @default ""
|
|
18
|
-
*/
|
|
19
|
-
description?: string;
|
|
20
|
-
/**
|
|
21
|
-
* (可选)是否禁用
|
|
22
|
-
* @default false
|
|
23
|
-
*/
|
|
24
|
-
disabled?: boolean | (() => boolean);
|
|
25
|
-
/**
|
|
26
|
-
* 获取该项的值的回调函数
|
|
27
|
-
*/
|
|
28
|
-
getValue(): boolean;
|
|
29
|
-
/**
|
|
30
|
-
* switch开启/关闭触发的回调函数
|
|
31
|
-
*/
|
|
32
|
-
callback(event: MouseEvent | PointerEvent, value: boolean): void;
|
|
33
|
-
}
|
|
1
|
+
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* pops.panel的 switch
|
|
5
|
+
*/
|
|
6
|
+
export interface PopsPanelSwitchConfig extends PopsPanelGeneralConfig<PopsPanelSwitchConfig> {
|
|
7
|
+
/**
|
|
8
|
+
* 组件类型
|
|
9
|
+
*/
|
|
10
|
+
type: "switch";
|
|
11
|
+
/**
|
|
12
|
+
* 显示在左边的文字
|
|
13
|
+
*/
|
|
14
|
+
text: string;
|
|
15
|
+
/**
|
|
16
|
+
* (可选)左边的文字下面的描述
|
|
17
|
+
* @default ""
|
|
18
|
+
*/
|
|
19
|
+
description?: string;
|
|
20
|
+
/**
|
|
21
|
+
* (可选)是否禁用
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
disabled?: boolean | (() => boolean);
|
|
25
|
+
/**
|
|
26
|
+
* 获取该项的值的回调函数
|
|
27
|
+
*/
|
|
28
|
+
getValue(): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* switch开启/关闭触发的回调函数
|
|
31
|
+
*/
|
|
32
|
+
callback(event: MouseEvent | PointerEvent, value: boolean): void;
|
|
33
|
+
}
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* pops.panel的 textarea
|
|
5
|
-
*/
|
|
6
|
-
export interface PopsPanelTextAreaConfig extends PopsPanelGeneralConfig<PopsPanelTextAreaConfig> {
|
|
7
|
-
/**
|
|
8
|
-
* 组件类型
|
|
9
|
-
*/
|
|
10
|
-
type: "textarea";
|
|
11
|
-
/**
|
|
12
|
-
* 显示在左边的文字
|
|
13
|
-
*/
|
|
14
|
-
text: string;
|
|
15
|
-
/**
|
|
16
|
-
* (可选)左边的文字下面的描述
|
|
17
|
-
* @default ""
|
|
18
|
-
*/
|
|
19
|
-
description?: string;
|
|
20
|
-
/**
|
|
21
|
-
* (可选)是否禁用
|
|
22
|
-
* @default false
|
|
23
|
-
*/
|
|
24
|
-
disabled?: boolean | (() => boolean);
|
|
25
|
-
/**
|
|
26
|
-
* 获取该项的值的回调函数
|
|
27
|
-
*/
|
|
28
|
-
getValue(): string;
|
|
29
|
-
/**
|
|
30
|
-
* textarea输入框的值改变触发的回调函数
|
|
31
|
-
* @param event 事件
|
|
32
|
-
* @param value 当前的textarea内的值
|
|
33
|
-
*/
|
|
34
|
-
callback(
|
|
35
|
-
event: InputEvent & {
|
|
36
|
-
target: HTMLTextAreaElement;
|
|
37
|
-
},
|
|
38
|
-
value: string
|
|
39
|
-
): void;
|
|
40
|
-
/**
|
|
41
|
-
* 输入框内的提示
|
|
42
|
-
* @default ""
|
|
43
|
-
*/
|
|
44
|
-
placeholder?: string;
|
|
45
|
-
}
|
|
1
|
+
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* pops.panel的 textarea
|
|
5
|
+
*/
|
|
6
|
+
export interface PopsPanelTextAreaConfig extends PopsPanelGeneralConfig<PopsPanelTextAreaConfig> {
|
|
7
|
+
/**
|
|
8
|
+
* 组件类型
|
|
9
|
+
*/
|
|
10
|
+
type: "textarea";
|
|
11
|
+
/**
|
|
12
|
+
* 显示在左边的文字
|
|
13
|
+
*/
|
|
14
|
+
text: string;
|
|
15
|
+
/**
|
|
16
|
+
* (可选)左边的文字下面的描述
|
|
17
|
+
* @default ""
|
|
18
|
+
*/
|
|
19
|
+
description?: string;
|
|
20
|
+
/**
|
|
21
|
+
* (可选)是否禁用
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
disabled?: boolean | (() => boolean);
|
|
25
|
+
/**
|
|
26
|
+
* 获取该项的值的回调函数
|
|
27
|
+
*/
|
|
28
|
+
getValue(): string;
|
|
29
|
+
/**
|
|
30
|
+
* textarea输入框的值改变触发的回调函数
|
|
31
|
+
* @param event 事件
|
|
32
|
+
* @param value 当前的textarea内的值
|
|
33
|
+
*/
|
|
34
|
+
callback(
|
|
35
|
+
event: InputEvent & {
|
|
36
|
+
target: HTMLTextAreaElement;
|
|
37
|
+
},
|
|
38
|
+
value: string
|
|
39
|
+
): void;
|
|
40
|
+
/**
|
|
41
|
+
* 输入框内的提示
|
|
42
|
+
* @default ""
|
|
43
|
+
*/
|
|
44
|
+
placeholder?: string;
|
|
45
|
+
}
|
|
@@ -1,244 +1,244 @@
|
|
|
1
|
-
import type { PopsTitleConfig, PopsDragConfig, PopsGeneralConfig } from "../../../types/components";
|
|
2
|
-
import type { PopsPanelContainerConfig } from "./components-container";
|
|
3
|
-
import type { PopsPanelSwitchConfig } from "./components-switch";
|
|
4
|
-
import type { PopsPanelSliderConfig } from "./components-slider";
|
|
5
|
-
import type { PopsPanelInputConfig } from "./components-input";
|
|
6
|
-
import type { PopsPanelTextAreaConfig } from "./components-textarea";
|
|
7
|
-
import type { PopsPanelSelectConfig } from "./components-select";
|
|
8
|
-
import type { PopsPanelButtonConfig } from "./components-button";
|
|
9
|
-
import type { PopsPanelDeepViewConfig } from "./components-deepMenu";
|
|
10
|
-
import type { PopsPanelOwnConfig } from "./components-own";
|
|
11
|
-
import type { PopsHeaderCloseButtonConfig } from "../../../types/button";
|
|
12
|
-
import type { PopsPanelSelectMultipleConfig } from "./components-selectMultiple";
|
|
13
|
-
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* panel的各种类型的配置项(不包括type="container"类型的)
|
|
17
|
-
*/
|
|
18
|
-
export type PopsPanelViewConfig =
|
|
19
|
-
| PopsPanelSwitchConfig
|
|
20
|
-
| PopsPanelSliderConfig
|
|
21
|
-
| PopsPanelInputConfig
|
|
22
|
-
| PopsPanelTextAreaConfig
|
|
23
|
-
| PopsPanelSelectConfig<any>
|
|
24
|
-
| PopsPanelSelectMultipleConfig<any>
|
|
25
|
-
| PopsPanelButtonConfig
|
|
26
|
-
| PopsPanelDeepViewConfig
|
|
27
|
-
| PopsPanelOwnConfig;
|
|
28
|
-
/**
|
|
29
|
-
* panel的views配置项
|
|
30
|
-
*/
|
|
31
|
-
export type PopsPanelMainViewConfig = PopsPanelViewConfig | PopsPanelContainerConfig;
|
|
32
|
-
/**
|
|
33
|
-
* panel的内部事件
|
|
34
|
-
*/
|
|
35
|
-
export type PopsPanelEventType = {
|
|
36
|
-
/**
|
|
37
|
-
* 该事件在右侧容器内的元素改变时触发
|
|
38
|
-
*/
|
|
39
|
-
"pops:renderRightContainer": {
|
|
40
|
-
/**
|
|
41
|
-
* 视图配置
|
|
42
|
-
*/
|
|
43
|
-
viewConfig: PopsPanelContentConfig[] | PopsPanelDeepViewConfig;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* pops.panel的content配置信息
|
|
49
|
-
*/
|
|
50
|
-
export interface PopsPanelContentConfig {
|
|
51
|
-
/**
|
|
52
|
-
* 元素属性id
|
|
53
|
-
*/
|
|
54
|
-
id: string;
|
|
55
|
-
/**
|
|
56
|
-
* (可选)元素的className,值为空的话就不设置
|
|
57
|
-
* @default ""
|
|
58
|
-
*/
|
|
59
|
-
className?: PopsPanelGeneralConfig<any>["className"];
|
|
60
|
-
/**
|
|
61
|
-
* 显示的文本,可以是html格式
|
|
62
|
-
*/
|
|
63
|
-
title: string | (() => string);
|
|
64
|
-
/**
|
|
65
|
-
* (可选)中间顶部的文本,如果为空,则使用title的值代替
|
|
66
|
-
* @default title
|
|
67
|
-
*/
|
|
68
|
-
headerTitle?: string | (() => string);
|
|
69
|
-
/**
|
|
70
|
-
* (可选)是否是默认的,指打开弹窗的先显示出来的内容,默认为首位第一个项,如果多个配置都设置了isDefault的值为true,那么只有第一个值生效
|
|
71
|
-
* @default false
|
|
72
|
-
*/
|
|
73
|
-
isDefault?: boolean | (() => boolean);
|
|
74
|
-
/**
|
|
75
|
-
* (可选)是否是位于底部的
|
|
76
|
-
*
|
|
77
|
-
* 自上而下排序
|
|
78
|
-
* @default false
|
|
79
|
-
*/
|
|
80
|
-
isBottom?: boolean | (() => boolean);
|
|
81
|
-
/**
|
|
82
|
-
* (可选)是否禁用左侧项的hover的CSS样式
|
|
83
|
-
*/
|
|
84
|
-
disableAsideItemHoverCSS?: boolean | (() => boolean);
|
|
85
|
-
/**
|
|
86
|
-
* (可选)是否自动滚动到默认的项
|
|
87
|
-
* @default false
|
|
88
|
-
*/
|
|
89
|
-
scrollToDefaultView?: boolean;
|
|
90
|
-
/**
|
|
91
|
-
* (可选)自定义元素属性.setAttribute、.getAttribute
|
|
92
|
-
* @default {}
|
|
93
|
-
*/
|
|
94
|
-
attributes?: PopsPanelGeneralConfig<any>["attributes"];
|
|
95
|
-
/**
|
|
96
|
-
* (可选)自定义元素内部的属性值
|
|
97
|
-
* @default {}
|
|
98
|
-
*/
|
|
99
|
-
props?: PopsPanelGeneralConfig<any>["props"];
|
|
100
|
-
/**
|
|
101
|
-
* 视图配置
|
|
102
|
-
*/
|
|
103
|
-
views: PopsPanelMainViewConfig[];
|
|
104
|
-
/**
|
|
105
|
-
* 左侧容器的点击回调(点击后第一个触发该回调)
|
|
106
|
-
* @returns
|
|
107
|
-
* + false 阻止默认行为
|
|
108
|
-
*/
|
|
109
|
-
clickFirstCallback?: (
|
|
110
|
-
event: MouseEvent | PointerEvent,
|
|
111
|
-
rightHeaderElement: HTMLUListElement,
|
|
112
|
-
rightContainerElement: HTMLUListElement
|
|
113
|
-
) => void | boolean | Promise<void | boolean>;
|
|
114
|
-
/**
|
|
115
|
-
* 左侧容器的点击回调
|
|
116
|
-
* @returns
|
|
117
|
-
* + false 阻止默认进入菜单详情
|
|
118
|
-
*/
|
|
119
|
-
clickCallback?: (
|
|
120
|
-
event: MouseEvent | PointerEvent,
|
|
121
|
-
rightHeaderElement: HTMLUListElement,
|
|
122
|
-
rightContainerElement: HTMLUListElement
|
|
123
|
-
) => void | boolean | Promise<void | boolean>;
|
|
124
|
-
/**
|
|
125
|
-
* 左侧项添加到panel后的回调
|
|
126
|
-
*/
|
|
127
|
-
afterRender?: (
|
|
128
|
-
/**
|
|
129
|
-
* 配置
|
|
130
|
-
*/
|
|
131
|
-
config: {
|
|
132
|
-
/** 容器配置 */
|
|
133
|
-
asideConfig: PopsPanelContentConfig;
|
|
134
|
-
/** 左侧容器的元素 */
|
|
135
|
-
$asideLiElement: HTMLLIElement;
|
|
136
|
-
}
|
|
137
|
-
) => void;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* pops.panel的bottomContent配置信息
|
|
142
|
-
*/
|
|
143
|
-
export interface PopsPanelBottomContentConfig {
|
|
144
|
-
/**
|
|
145
|
-
* (可选)元素的className,值为空的话就不设置
|
|
146
|
-
* @default ""
|
|
147
|
-
*/
|
|
148
|
-
className?: PopsPanelGeneralConfig<any>["className"];
|
|
149
|
-
/**
|
|
150
|
-
* (可选)配置所在位置
|
|
151
|
-
*
|
|
152
|
-
* @default "left"
|
|
153
|
-
*/
|
|
154
|
-
position: "left" | "right";
|
|
155
|
-
/**
|
|
156
|
-
* 显示的文本,可以是html格式
|
|
157
|
-
*/
|
|
158
|
-
text: string | (() => string);
|
|
159
|
-
/**
|
|
160
|
-
* (可选)是否禁用hover的CSS样式
|
|
161
|
-
* @default false
|
|
162
|
-
*/
|
|
163
|
-
disableHoverCSS?: boolean | (() => boolean);
|
|
164
|
-
/**
|
|
165
|
-
* (可选)自定义元素属性.setAttribute、.getAttribute
|
|
166
|
-
* @default {}
|
|
167
|
-
*/
|
|
168
|
-
attributes?: PopsPanelGeneralConfig<any>["attributes"];
|
|
169
|
-
/**
|
|
170
|
-
* (可选)自定义元素内部的属性值
|
|
171
|
-
* @default {}
|
|
172
|
-
*/
|
|
173
|
-
props?: PopsPanelGeneralConfig<any>["props"];
|
|
174
|
-
/**
|
|
175
|
-
* 该项的点击回调
|
|
176
|
-
*/
|
|
177
|
-
clickCallback?: (
|
|
178
|
-
/**
|
|
179
|
-
* 点击事件
|
|
180
|
-
*/
|
|
181
|
-
event: MouseEvent | PointerEvent
|
|
182
|
-
) => void;
|
|
183
|
-
/**
|
|
184
|
-
* 该项添加到panel后的回调
|
|
185
|
-
*/
|
|
186
|
-
afterRender?: (
|
|
187
|
-
/**
|
|
188
|
-
* 配置
|
|
189
|
-
*/
|
|
190
|
-
config: {
|
|
191
|
-
/** panel底部区域 */
|
|
192
|
-
$bottomWrapper: HTMLElement;
|
|
193
|
-
/** panel底部区域容器 */
|
|
194
|
-
$bottomContainer: HTMLElement;
|
|
195
|
-
/** panel底部区域左侧容器 */
|
|
196
|
-
$bottomLeftContainer: HTMLElement;
|
|
197
|
-
/** panel底部区域右侧容器 */
|
|
198
|
-
$bottomRightContainer: HTMLElement;
|
|
199
|
-
}
|
|
200
|
-
) => void;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* pops.panel
|
|
205
|
-
*/
|
|
206
|
-
export interface PopsPanelConfig extends PopsTitleConfig, PopsDragConfig, PopsGeneralConfig {
|
|
207
|
-
/**
|
|
208
|
-
* 内容配置
|
|
209
|
-
*/
|
|
210
|
-
content: PopsPanelContentConfig[];
|
|
211
|
-
/**
|
|
212
|
-
* 底部内容配置
|
|
213
|
-
*/
|
|
214
|
-
bottomContentConfig?: PopsPanelBottomContentConfig[];
|
|
215
|
-
/**
|
|
216
|
-
* 右上角的按钮配置
|
|
217
|
-
*/
|
|
218
|
-
btn?: {
|
|
219
|
-
/**
|
|
220
|
-
* 关闭按钮
|
|
221
|
-
*/
|
|
222
|
-
close?: PopsHeaderCloseButtonConfig;
|
|
223
|
-
};
|
|
224
|
-
/**
|
|
225
|
-
* 移动端适配的的className
|
|
226
|
-
*
|
|
227
|
-
* @default "pops-panel-is-mobile"
|
|
228
|
-
*/
|
|
229
|
-
mobileClassName?: PopsPanelGeneralConfig<any>["className"];
|
|
230
|
-
/**
|
|
231
|
-
* 是否强制是移动端,默认false
|
|
232
|
-
* + true 强制为移动端
|
|
233
|
-
* + false 自动根据UA判断是否是移动端
|
|
234
|
-
* @default false
|
|
235
|
-
*/
|
|
236
|
-
isMobile?: boolean;
|
|
237
|
-
/**
|
|
238
|
-
* 是否使用深度菜单切换动画
|
|
239
|
-
*
|
|
240
|
-
* 如果浏览器不支持`document.startViewTransition`函数,那么即使使用`useDeepMenuSwtichAnimation`为true,那么不会使用动画
|
|
241
|
-
* @default true
|
|
242
|
-
*/
|
|
243
|
-
useDeepMenuSwtichAnimation?: true;
|
|
244
|
-
}
|
|
1
|
+
import type { PopsTitleConfig, PopsDragConfig, PopsGeneralConfig } from "../../../types/components";
|
|
2
|
+
import type { PopsPanelContainerConfig } from "./components-container";
|
|
3
|
+
import type { PopsPanelSwitchConfig } from "./components-switch";
|
|
4
|
+
import type { PopsPanelSliderConfig } from "./components-slider";
|
|
5
|
+
import type { PopsPanelInputConfig } from "./components-input";
|
|
6
|
+
import type { PopsPanelTextAreaConfig } from "./components-textarea";
|
|
7
|
+
import type { PopsPanelSelectConfig } from "./components-select";
|
|
8
|
+
import type { PopsPanelButtonConfig } from "./components-button";
|
|
9
|
+
import type { PopsPanelDeepViewConfig } from "./components-deepMenu";
|
|
10
|
+
import type { PopsPanelOwnConfig } from "./components-own";
|
|
11
|
+
import type { PopsHeaderCloseButtonConfig } from "../../../types/button";
|
|
12
|
+
import type { PopsPanelSelectMultipleConfig } from "./components-selectMultiple";
|
|
13
|
+
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* panel的各种类型的配置项(不包括type="container"类型的)
|
|
17
|
+
*/
|
|
18
|
+
export type PopsPanelViewConfig =
|
|
19
|
+
| PopsPanelSwitchConfig
|
|
20
|
+
| PopsPanelSliderConfig
|
|
21
|
+
| PopsPanelInputConfig
|
|
22
|
+
| PopsPanelTextAreaConfig
|
|
23
|
+
| PopsPanelSelectConfig<any>
|
|
24
|
+
| PopsPanelSelectMultipleConfig<any>
|
|
25
|
+
| PopsPanelButtonConfig
|
|
26
|
+
| PopsPanelDeepViewConfig
|
|
27
|
+
| PopsPanelOwnConfig;
|
|
28
|
+
/**
|
|
29
|
+
* panel的views配置项
|
|
30
|
+
*/
|
|
31
|
+
export type PopsPanelMainViewConfig = PopsPanelViewConfig | PopsPanelContainerConfig;
|
|
32
|
+
/**
|
|
33
|
+
* panel的内部事件
|
|
34
|
+
*/
|
|
35
|
+
export type PopsPanelEventType = {
|
|
36
|
+
/**
|
|
37
|
+
* 该事件在右侧容器内的元素改变时触发
|
|
38
|
+
*/
|
|
39
|
+
"pops:renderRightContainer": {
|
|
40
|
+
/**
|
|
41
|
+
* 视图配置
|
|
42
|
+
*/
|
|
43
|
+
viewConfig: PopsPanelContentConfig[] | PopsPanelDeepViewConfig;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* pops.panel的content配置信息
|
|
49
|
+
*/
|
|
50
|
+
export interface PopsPanelContentConfig {
|
|
51
|
+
/**
|
|
52
|
+
* 元素属性id
|
|
53
|
+
*/
|
|
54
|
+
id: string;
|
|
55
|
+
/**
|
|
56
|
+
* (可选)元素的className,值为空的话就不设置
|
|
57
|
+
* @default ""
|
|
58
|
+
*/
|
|
59
|
+
className?: PopsPanelGeneralConfig<any>["className"];
|
|
60
|
+
/**
|
|
61
|
+
* 显示的文本,可以是html格式
|
|
62
|
+
*/
|
|
63
|
+
title: string | (() => string);
|
|
64
|
+
/**
|
|
65
|
+
* (可选)中间顶部的文本,如果为空,则使用title的值代替
|
|
66
|
+
* @default title
|
|
67
|
+
*/
|
|
68
|
+
headerTitle?: string | (() => string);
|
|
69
|
+
/**
|
|
70
|
+
* (可选)是否是默认的,指打开弹窗的先显示出来的内容,默认为首位第一个项,如果多个配置都设置了isDefault的值为true,那么只有第一个值生效
|
|
71
|
+
* @default false
|
|
72
|
+
*/
|
|
73
|
+
isDefault?: boolean | (() => boolean);
|
|
74
|
+
/**
|
|
75
|
+
* (可选)是否是位于底部的
|
|
76
|
+
*
|
|
77
|
+
* 自上而下排序
|
|
78
|
+
* @default false
|
|
79
|
+
*/
|
|
80
|
+
isBottom?: boolean | (() => boolean);
|
|
81
|
+
/**
|
|
82
|
+
* (可选)是否禁用左侧项的hover的CSS样式
|
|
83
|
+
*/
|
|
84
|
+
disableAsideItemHoverCSS?: boolean | (() => boolean);
|
|
85
|
+
/**
|
|
86
|
+
* (可选)是否自动滚动到默认的项
|
|
87
|
+
* @default false
|
|
88
|
+
*/
|
|
89
|
+
scrollToDefaultView?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* (可选)自定义元素属性.setAttribute、.getAttribute
|
|
92
|
+
* @default {}
|
|
93
|
+
*/
|
|
94
|
+
attributes?: PopsPanelGeneralConfig<any>["attributes"];
|
|
95
|
+
/**
|
|
96
|
+
* (可选)自定义元素内部的属性值
|
|
97
|
+
* @default {}
|
|
98
|
+
*/
|
|
99
|
+
props?: PopsPanelGeneralConfig<any>["props"];
|
|
100
|
+
/**
|
|
101
|
+
* 视图配置
|
|
102
|
+
*/
|
|
103
|
+
views: PopsPanelMainViewConfig[];
|
|
104
|
+
/**
|
|
105
|
+
* 左侧容器的点击回调(点击后第一个触发该回调)
|
|
106
|
+
* @returns
|
|
107
|
+
* + false 阻止默认行为
|
|
108
|
+
*/
|
|
109
|
+
clickFirstCallback?: (
|
|
110
|
+
event: MouseEvent | PointerEvent,
|
|
111
|
+
rightHeaderElement: HTMLUListElement,
|
|
112
|
+
rightContainerElement: HTMLUListElement
|
|
113
|
+
) => void | boolean | Promise<void | boolean>;
|
|
114
|
+
/**
|
|
115
|
+
* 左侧容器的点击回调
|
|
116
|
+
* @returns
|
|
117
|
+
* + false 阻止默认进入菜单详情
|
|
118
|
+
*/
|
|
119
|
+
clickCallback?: (
|
|
120
|
+
event: MouseEvent | PointerEvent,
|
|
121
|
+
rightHeaderElement: HTMLUListElement,
|
|
122
|
+
rightContainerElement: HTMLUListElement
|
|
123
|
+
) => void | boolean | Promise<void | boolean>;
|
|
124
|
+
/**
|
|
125
|
+
* 左侧项添加到panel后的回调
|
|
126
|
+
*/
|
|
127
|
+
afterRender?: (
|
|
128
|
+
/**
|
|
129
|
+
* 配置
|
|
130
|
+
*/
|
|
131
|
+
config: {
|
|
132
|
+
/** 容器配置 */
|
|
133
|
+
asideConfig: PopsPanelContentConfig;
|
|
134
|
+
/** 左侧容器的元素 */
|
|
135
|
+
$asideLiElement: HTMLLIElement;
|
|
136
|
+
}
|
|
137
|
+
) => void;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* pops.panel的bottomContent配置信息
|
|
142
|
+
*/
|
|
143
|
+
export interface PopsPanelBottomContentConfig {
|
|
144
|
+
/**
|
|
145
|
+
* (可选)元素的className,值为空的话就不设置
|
|
146
|
+
* @default ""
|
|
147
|
+
*/
|
|
148
|
+
className?: PopsPanelGeneralConfig<any>["className"];
|
|
149
|
+
/**
|
|
150
|
+
* (可选)配置所在位置
|
|
151
|
+
*
|
|
152
|
+
* @default "left"
|
|
153
|
+
*/
|
|
154
|
+
position: "left" | "right";
|
|
155
|
+
/**
|
|
156
|
+
* 显示的文本,可以是html格式
|
|
157
|
+
*/
|
|
158
|
+
text: string | (() => string);
|
|
159
|
+
/**
|
|
160
|
+
* (可选)是否禁用hover的CSS样式
|
|
161
|
+
* @default false
|
|
162
|
+
*/
|
|
163
|
+
disableHoverCSS?: boolean | (() => boolean);
|
|
164
|
+
/**
|
|
165
|
+
* (可选)自定义元素属性.setAttribute、.getAttribute
|
|
166
|
+
* @default {}
|
|
167
|
+
*/
|
|
168
|
+
attributes?: PopsPanelGeneralConfig<any>["attributes"];
|
|
169
|
+
/**
|
|
170
|
+
* (可选)自定义元素内部的属性值
|
|
171
|
+
* @default {}
|
|
172
|
+
*/
|
|
173
|
+
props?: PopsPanelGeneralConfig<any>["props"];
|
|
174
|
+
/**
|
|
175
|
+
* 该项的点击回调
|
|
176
|
+
*/
|
|
177
|
+
clickCallback?: (
|
|
178
|
+
/**
|
|
179
|
+
* 点击事件
|
|
180
|
+
*/
|
|
181
|
+
event: MouseEvent | PointerEvent
|
|
182
|
+
) => void;
|
|
183
|
+
/**
|
|
184
|
+
* 该项添加到panel后的回调
|
|
185
|
+
*/
|
|
186
|
+
afterRender?: (
|
|
187
|
+
/**
|
|
188
|
+
* 配置
|
|
189
|
+
*/
|
|
190
|
+
config: {
|
|
191
|
+
/** panel底部区域 */
|
|
192
|
+
$bottomWrapper: HTMLElement;
|
|
193
|
+
/** panel底部区域容器 */
|
|
194
|
+
$bottomContainer: HTMLElement;
|
|
195
|
+
/** panel底部区域左侧容器 */
|
|
196
|
+
$bottomLeftContainer: HTMLElement;
|
|
197
|
+
/** panel底部区域右侧容器 */
|
|
198
|
+
$bottomRightContainer: HTMLElement;
|
|
199
|
+
}
|
|
200
|
+
) => void;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* pops.panel
|
|
205
|
+
*/
|
|
206
|
+
export interface PopsPanelConfig extends PopsTitleConfig, PopsDragConfig, PopsGeneralConfig {
|
|
207
|
+
/**
|
|
208
|
+
* 内容配置
|
|
209
|
+
*/
|
|
210
|
+
content: PopsPanelContentConfig[];
|
|
211
|
+
/**
|
|
212
|
+
* 底部内容配置
|
|
213
|
+
*/
|
|
214
|
+
bottomContentConfig?: PopsPanelBottomContentConfig[];
|
|
215
|
+
/**
|
|
216
|
+
* 右上角的按钮配置
|
|
217
|
+
*/
|
|
218
|
+
btn?: {
|
|
219
|
+
/**
|
|
220
|
+
* 关闭按钮
|
|
221
|
+
*/
|
|
222
|
+
close?: PopsHeaderCloseButtonConfig;
|
|
223
|
+
};
|
|
224
|
+
/**
|
|
225
|
+
* 移动端适配的的className
|
|
226
|
+
*
|
|
227
|
+
* @default "pops-panel-is-mobile"
|
|
228
|
+
*/
|
|
229
|
+
mobileClassName?: PopsPanelGeneralConfig<any>["className"];
|
|
230
|
+
/**
|
|
231
|
+
* 是否强制是移动端,默认false
|
|
232
|
+
* + true 强制为移动端
|
|
233
|
+
* + false 自动根据UA判断是否是移动端
|
|
234
|
+
* @default false
|
|
235
|
+
*/
|
|
236
|
+
isMobile?: boolean;
|
|
237
|
+
/**
|
|
238
|
+
* 是否使用深度菜单切换动画
|
|
239
|
+
*
|
|
240
|
+
* 如果浏览器不支持`document.startViewTransition`函数,那么即使使用`useDeepMenuSwtichAnimation`为true,那么不会使用动画
|
|
241
|
+
* @default true
|
|
242
|
+
*/
|
|
243
|
+
useDeepMenuSwtichAnimation?: true;
|
|
244
|
+
}
|