@whitesev/pops 1.6.4 → 1.6.5
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 +9156 -9134
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +9154 -9132
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +9152 -9130
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +9157 -9135
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +9159 -9137
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +9160 -9138
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/Pops.d.ts +309 -308
- package/dist/types/src/components/panel/PanelHandleContentDetails.d.ts +165 -149
- package/dist/types/src/components/panel/indexType.d.ts +102 -87
- package/package.json +1 -1
- package/src/components/panel/PanelHandleContentDetails.ts +122 -94
- package/src/components/panel/indexType.ts +16 -1
|
@@ -1,149 +1,165 @@
|
|
|
1
|
-
import type { PopsPanelButtonDetails } from "./buttonType";
|
|
2
|
-
import type { PopsPanelRightAsideContainerOptions } from "./commonType";
|
|
3
|
-
import type { PopsPanelDeepMenuDetails } from "./deepMenuType";
|
|
4
|
-
import type { PopsPanelContentConfig, PopsPanelDetails, PopsPanelFormsTotalDetails } from "./indexType";
|
|
5
|
-
import type { PopsPanelInputDetails } from "./inputType";
|
|
6
|
-
import type { PopsPanelOwnDetails } from "./ownType";
|
|
7
|
-
import type { PopsPanelSelectMultipleDetails } from "./selectMultipleType";
|
|
8
|
-
import type { PopsPanelSelectDetails } from "./selectType";
|
|
9
|
-
import type { PopsPanelSliderDetails } from "./sliderType";
|
|
10
|
-
import type { PopsPanelSwitchDetails } from "./switchType";
|
|
11
|
-
import type { PopsPanelTextAreaDetails } from "./textareaType";
|
|
12
|
-
export declare const PanelHandleContentDetails: () => {
|
|
13
|
-
/**
|
|
14
|
-
* 左侧的ul容器
|
|
15
|
-
*/
|
|
16
|
-
asideULElement: HTMLUListElement;
|
|
17
|
-
/**
|
|
18
|
-
* 右侧主内容的顶部文字ul容器
|
|
19
|
-
*/
|
|
20
|
-
sectionContainerHeaderULElement: HTMLUListElement;
|
|
21
|
-
/**
|
|
22
|
-
* 右侧主内容的ul容器
|
|
23
|
-
*/
|
|
24
|
-
sectionContainerULElement: HTMLUListElement;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
$
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
*
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
*
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
*
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
*
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
*
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
*
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
*
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
*
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
*
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
*
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
*
|
|
129
|
-
* @param formConfig
|
|
130
|
-
*/
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
*
|
|
134
|
-
* @param formConfig
|
|
135
|
-
*/
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
* @param
|
|
141
|
-
*/
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
*
|
|
145
|
-
* @param
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
1
|
+
import type { PopsPanelButtonDetails } from "./buttonType";
|
|
2
|
+
import type { PopsPanelRightAsideContainerOptions } from "./commonType";
|
|
3
|
+
import type { PopsPanelDeepMenuDetails } from "./deepMenuType";
|
|
4
|
+
import type { PopsPanelContentConfig, PopsPanelDetails, PopsPanelFormsTotalDetails } from "./indexType";
|
|
5
|
+
import type { PopsPanelInputDetails } from "./inputType";
|
|
6
|
+
import type { PopsPanelOwnDetails } from "./ownType";
|
|
7
|
+
import type { PopsPanelSelectMultipleDetails } from "./selectMultipleType";
|
|
8
|
+
import type { PopsPanelSelectDetails } from "./selectType";
|
|
9
|
+
import type { PopsPanelSliderDetails } from "./sliderType";
|
|
10
|
+
import type { PopsPanelSwitchDetails } from "./switchType";
|
|
11
|
+
import type { PopsPanelTextAreaDetails } from "./textareaType";
|
|
12
|
+
export declare const PanelHandleContentDetails: () => {
|
|
13
|
+
/**
|
|
14
|
+
* 左侧的ul容器
|
|
15
|
+
*/
|
|
16
|
+
asideULElement: HTMLUListElement;
|
|
17
|
+
/**
|
|
18
|
+
* 右侧主内容的顶部文字ul容器
|
|
19
|
+
*/
|
|
20
|
+
sectionContainerHeaderULElement: HTMLUListElement;
|
|
21
|
+
/**
|
|
22
|
+
* 右侧主内容的ul容器
|
|
23
|
+
*/
|
|
24
|
+
sectionContainerULElement: HTMLUListElement;
|
|
25
|
+
/**
|
|
26
|
+
* 元素
|
|
27
|
+
*/
|
|
28
|
+
$el: {
|
|
29
|
+
/** 内容 */
|
|
30
|
+
$content: HTMLDivElement;
|
|
31
|
+
/** 左侧容器 */
|
|
32
|
+
$contentAside: HTMLDivElement;
|
|
33
|
+
/** 右侧容器 */
|
|
34
|
+
$contentSectionContainer: HTMLDivElement;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* 初始化
|
|
38
|
+
* @param details
|
|
39
|
+
*/
|
|
40
|
+
init(details: {
|
|
41
|
+
config: Required<PopsPanelDetails>;
|
|
42
|
+
$el: {
|
|
43
|
+
$content: HTMLDivElement;
|
|
44
|
+
$contentAside: HTMLDivElement;
|
|
45
|
+
$contentSectionContainer: HTMLDivElement;
|
|
46
|
+
};
|
|
47
|
+
}): void;
|
|
48
|
+
/**
|
|
49
|
+
* 清空container容器的元素
|
|
50
|
+
*/
|
|
51
|
+
clearContainer(): void;
|
|
52
|
+
/**
|
|
53
|
+
* 清空左侧容器已访问记录
|
|
54
|
+
*/
|
|
55
|
+
clearAsideItemIsVisited(): void;
|
|
56
|
+
/**
|
|
57
|
+
* 设置左侧容器已访问记录
|
|
58
|
+
* @param element
|
|
59
|
+
*/
|
|
60
|
+
setAsideItemIsVisited(element: HTMLElement): void;
|
|
61
|
+
/**
|
|
62
|
+
* 为元素添加自定义属性
|
|
63
|
+
* @param element
|
|
64
|
+
* @param attributes
|
|
65
|
+
*/
|
|
66
|
+
setElementAttributes(element: HTMLElement, attributes?: any): void;
|
|
67
|
+
/**
|
|
68
|
+
* 为元素设置(自定义)属性
|
|
69
|
+
* @param element
|
|
70
|
+
* @param props
|
|
71
|
+
*/
|
|
72
|
+
setElementProps(element: HTMLElement, props?: any): void;
|
|
73
|
+
/**
|
|
74
|
+
* 为元素设置classname
|
|
75
|
+
* @param element
|
|
76
|
+
* @param className
|
|
77
|
+
*/
|
|
78
|
+
setElementClassName(element: HTMLElement, className?: string | string[] | (() => string | string[])): void;
|
|
79
|
+
/**
|
|
80
|
+
* 创建左侧容器元素<li>
|
|
81
|
+
* @param asideConfig
|
|
82
|
+
*/
|
|
83
|
+
createAsideItem(asideConfig: PopsPanelContentConfig): HTMLLIElement;
|
|
84
|
+
/**
|
|
85
|
+
* 创建中间容器的元素<li>
|
|
86
|
+
* type ==> switch
|
|
87
|
+
* @param formConfig
|
|
88
|
+
*/
|
|
89
|
+
createSectionContainerItem_switch(formConfig: PopsPanelSwitchDetails): HTMLLIElement;
|
|
90
|
+
/**
|
|
91
|
+
* 获取中间容器的元素<li>
|
|
92
|
+
* type ==> slider
|
|
93
|
+
* @param formConfig
|
|
94
|
+
*/
|
|
95
|
+
createSectionContainerItem_slider(formConfig: PopsPanelSliderDetails): HTMLLIElement;
|
|
96
|
+
/**
|
|
97
|
+
* 获取中间容器的元素<li>
|
|
98
|
+
* type ==> slider
|
|
99
|
+
* @param formConfig
|
|
100
|
+
*/
|
|
101
|
+
createSectionContainerItem_slider_new(formConfig: PopsPanelSliderDetails): HTMLLIElement;
|
|
102
|
+
/**
|
|
103
|
+
* 获取中间容器的元素<li>
|
|
104
|
+
* type ==> input
|
|
105
|
+
* @param formConfig
|
|
106
|
+
*/
|
|
107
|
+
createSectionContainerItem_input(formConfig: PopsPanelInputDetails): HTMLLIElement;
|
|
108
|
+
/**
|
|
109
|
+
* 获取中间容器的元素<li>
|
|
110
|
+
* type ==> textarea
|
|
111
|
+
* @param formConfig
|
|
112
|
+
*/
|
|
113
|
+
createSectionContainerItem_textarea(formConfig: PopsPanelTextAreaDetails): HTMLLIElement;
|
|
114
|
+
/**
|
|
115
|
+
* 获取中间容器的元素<li>
|
|
116
|
+
* type ==> select
|
|
117
|
+
* @param formConfig
|
|
118
|
+
*/
|
|
119
|
+
createSectionContainerItem_select(formConfig: PopsPanelSelectDetails<any>): HTMLLIElement;
|
|
120
|
+
/**
|
|
121
|
+
* 获取中间容器的元素<li>
|
|
122
|
+
* type ==> select-multiple
|
|
123
|
+
* @param formConfig
|
|
124
|
+
*/
|
|
125
|
+
createSectionContainerItem_select_multiple_new(formConfig: PopsPanelSelectMultipleDetails<any>): HTMLLIElement;
|
|
126
|
+
/**
|
|
127
|
+
* 获取中间容器的元素<li>
|
|
128
|
+
* type ==> button
|
|
129
|
+
* @param formConfig
|
|
130
|
+
*/
|
|
131
|
+
createSectionContainerItem_button(formConfig: PopsPanelButtonDetails): HTMLLIElement;
|
|
132
|
+
/**
|
|
133
|
+
* 获取深层容器的元素<li>
|
|
134
|
+
* @param formConfig
|
|
135
|
+
*/
|
|
136
|
+
createSectionContainerItem_deepMenu(formConfig: PopsPanelDeepMenuDetails): HTMLLIElement;
|
|
137
|
+
/**
|
|
138
|
+
* 获取中间容器的元素<li>
|
|
139
|
+
* type ===> own
|
|
140
|
+
* @param formConfig
|
|
141
|
+
*/
|
|
142
|
+
createSectionContainerItem_own(formConfig: PopsPanelOwnDetails): HTMLLIElement;
|
|
143
|
+
/**
|
|
144
|
+
* 获取中间容器的元素<li>
|
|
145
|
+
* @param formConfig
|
|
146
|
+
*/
|
|
147
|
+
createSectionContainerItem(formConfig: PopsPanelFormsTotalDetails): HTMLLIElement | undefined;
|
|
148
|
+
/**
|
|
149
|
+
* 生成配置每一项的元素
|
|
150
|
+
* @param formConfig
|
|
151
|
+
*/
|
|
152
|
+
initFormItem(formConfig: PopsPanelContentConfig): void;
|
|
153
|
+
/**
|
|
154
|
+
*
|
|
155
|
+
* @param formConfig
|
|
156
|
+
* @param containerOptions
|
|
157
|
+
*/
|
|
158
|
+
uListContainerAddItem(formConfig: PopsPanelFormsTotalDetails, containerOptions: PopsPanelRightAsideContainerOptions): void;
|
|
159
|
+
/**
|
|
160
|
+
* 为左侧容器元素添加点击事件
|
|
161
|
+
* @param asideLiElement 左侧的容器<li>元素
|
|
162
|
+
* @param asideConfig 配置
|
|
163
|
+
*/
|
|
164
|
+
setAsideItemClickEvent(asideLiElement: HTMLElement, asideConfig: PopsPanelContentConfig): void;
|
|
165
|
+
};
|
|
@@ -1,87 +1,102 @@
|
|
|
1
|
-
import type { PopsTitleConfig, PopsDragConfig, PopsCommonConfig } from "../../types/components";
|
|
2
|
-
import type { PopsPanelFormsDetails } from "./formsType";
|
|
3
|
-
import type { PopsPanelSwitchDetails } from "./switchType";
|
|
4
|
-
import type { PopsPanelSliderDetails } from "./sliderType";
|
|
5
|
-
import type { PopsPanelInputDetails } from "./inputType";
|
|
6
|
-
import type { PopsPanelTextAreaDetails } from "./textareaType";
|
|
7
|
-
import type { PopsPanelSelectDetails } from "./selectType";
|
|
8
|
-
import type { PopsPanelButtonDetails } from "./buttonType";
|
|
9
|
-
import type { PopsPanelDeepMenuDetails } from "./deepMenuType";
|
|
10
|
-
import type { PopsPanelOwnDetails } from "./ownType";
|
|
11
|
-
import type { PopsHeaderCloseButtonDetails } from "../../types/button";
|
|
12
|
-
import { PopsPanelSelectMultipleDetails } from "./selectMultipleType";
|
|
13
|
-
/** panel的各种类型的配置项 */
|
|
14
|
-
export type PopsPanelFormsTotalDetails = PopsPanelSwitchDetails | PopsPanelSliderDetails | PopsPanelInputDetails | PopsPanelTextAreaDetails | PopsPanelSelectDetails<any> | PopsPanelSelectMultipleDetails<any> | PopsPanelButtonDetails | PopsPanelDeepMenuDetails | PopsPanelOwnDetails;
|
|
15
|
-
/**
|
|
16
|
-
* pops.panel的content配置信息
|
|
17
|
-
*/
|
|
18
|
-
export interface PopsPanelContentConfig {
|
|
19
|
-
/**
|
|
20
|
-
* 元素属性id
|
|
21
|
-
*/
|
|
22
|
-
id: string;
|
|
23
|
-
/**
|
|
24
|
-
*
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
*
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
*
|
|
33
|
-
*/
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
*
|
|
37
|
-
*/
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
*
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
*
|
|
45
|
-
*/
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
*
|
|
49
|
-
*/
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
*
|
|
53
|
-
*/
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
*
|
|
57
|
-
*/
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
*
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
*
|
|
85
|
-
*/
|
|
86
|
-
|
|
87
|
-
|
|
1
|
+
import type { PopsTitleConfig, PopsDragConfig, PopsCommonConfig } from "../../types/components";
|
|
2
|
+
import type { PopsPanelFormsDetails } from "./formsType";
|
|
3
|
+
import type { PopsPanelSwitchDetails } from "./switchType";
|
|
4
|
+
import type { PopsPanelSliderDetails } from "./sliderType";
|
|
5
|
+
import type { PopsPanelInputDetails } from "./inputType";
|
|
6
|
+
import type { PopsPanelTextAreaDetails } from "./textareaType";
|
|
7
|
+
import type { PopsPanelSelectDetails } from "./selectType";
|
|
8
|
+
import type { PopsPanelButtonDetails } from "./buttonType";
|
|
9
|
+
import type { PopsPanelDeepMenuDetails } from "./deepMenuType";
|
|
10
|
+
import type { PopsPanelOwnDetails } from "./ownType";
|
|
11
|
+
import type { PopsHeaderCloseButtonDetails } from "../../types/button";
|
|
12
|
+
import { PopsPanelSelectMultipleDetails } from "./selectMultipleType";
|
|
13
|
+
/** panel的各种类型的配置项 */
|
|
14
|
+
export type PopsPanelFormsTotalDetails = PopsPanelSwitchDetails | PopsPanelSliderDetails | PopsPanelInputDetails | PopsPanelTextAreaDetails | PopsPanelSelectDetails<any> | PopsPanelSelectMultipleDetails<any> | PopsPanelButtonDetails | PopsPanelDeepMenuDetails | PopsPanelOwnDetails;
|
|
15
|
+
/**
|
|
16
|
+
* pops.panel的content配置信息
|
|
17
|
+
*/
|
|
18
|
+
export interface PopsPanelContentConfig {
|
|
19
|
+
/**
|
|
20
|
+
* 元素属性id
|
|
21
|
+
*/
|
|
22
|
+
id: string;
|
|
23
|
+
/**
|
|
24
|
+
* 元素的className
|
|
25
|
+
*/
|
|
26
|
+
className?: string | string[];
|
|
27
|
+
/**
|
|
28
|
+
* 左侧的标题,可以是html格式
|
|
29
|
+
*/
|
|
30
|
+
title: string;
|
|
31
|
+
/**
|
|
32
|
+
* (可选)中间顶部的标题
|
|
33
|
+
*/
|
|
34
|
+
headerTitle?: string;
|
|
35
|
+
/**
|
|
36
|
+
* (可选)内容高度是否自动适应(与headerTitle的高度有关)
|
|
37
|
+
*/
|
|
38
|
+
autoAdaptionContentHeight?: string;
|
|
39
|
+
/**
|
|
40
|
+
* (可选)是否是默认的,指打开弹窗的先显示出来的内容
|
|
41
|
+
*/
|
|
42
|
+
isDefault?: boolean | (() => boolean);
|
|
43
|
+
/**
|
|
44
|
+
* (可选)是否自动滚动到默认的项
|
|
45
|
+
*/
|
|
46
|
+
scrollToDefaultView?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* (可选)自定义元素属性
|
|
49
|
+
*/
|
|
50
|
+
attributes?: any;
|
|
51
|
+
/**
|
|
52
|
+
* (可选)自定义属性
|
|
53
|
+
*/
|
|
54
|
+
props?: HTMLElement;
|
|
55
|
+
/**
|
|
56
|
+
* 子配置
|
|
57
|
+
*/
|
|
58
|
+
forms: (PopsPanelFormsDetails | PopsPanelFormsTotalDetails)[];
|
|
59
|
+
/**
|
|
60
|
+
* 左侧容器的点击回调
|
|
61
|
+
*/
|
|
62
|
+
callback?: (event: MouseEvent | PointerEvent, rightHeaderElement: HTMLUListElement, rightContainerElement: HTMLUListElement) => void;
|
|
63
|
+
/**
|
|
64
|
+
* 左侧容器添加到panel后的回调
|
|
65
|
+
* @param rightHeaderElement
|
|
66
|
+
* @param rightContainerElement
|
|
67
|
+
*/
|
|
68
|
+
afterRender?: (data: {
|
|
69
|
+
/** 容器配置 */
|
|
70
|
+
asideConfig: PopsPanelContentConfig;
|
|
71
|
+
/** 左侧容器的元素 */
|
|
72
|
+
$asideLiElement: HTMLLIElement;
|
|
73
|
+
}) => void;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* pops.panel
|
|
77
|
+
*/
|
|
78
|
+
export interface PopsPanelDetails extends PopsTitleConfig, PopsDragConfig, PopsCommonConfig {
|
|
79
|
+
/**
|
|
80
|
+
* 内容配置
|
|
81
|
+
*/
|
|
82
|
+
content: PopsPanelContentConfig[];
|
|
83
|
+
/**
|
|
84
|
+
* 按钮配置
|
|
85
|
+
*/
|
|
86
|
+
btn?: {
|
|
87
|
+
/**
|
|
88
|
+
* 右上角的关闭按钮
|
|
89
|
+
*/
|
|
90
|
+
close?: PopsHeaderCloseButtonDetails;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* 移动端适配的的className,默认为pops-panel-is-mobile
|
|
94
|
+
*/
|
|
95
|
+
mobileClassName?: string;
|
|
96
|
+
/**
|
|
97
|
+
* 是否强制是移动端,默认false
|
|
98
|
+
* + true 强制为移动端
|
|
99
|
+
* + false 自动根据UA判断是否是移动端
|
|
100
|
+
*/
|
|
101
|
+
isMobile?: boolean;
|
|
102
|
+
}
|