@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
|
@@ -722,6 +722,8 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
722
722
|
flex-shrink: 0;
|
|
723
723
|
flex-wrap: nowrap;
|
|
724
724
|
height: 100%;
|
|
725
|
+
height: -webkit-fill-available;
|
|
726
|
+
height: -moz-available;
|
|
725
727
|
text-align: center;
|
|
726
728
|
color: var(--pops-panel-components-input-suffix-color);
|
|
727
729
|
background: var(--pops-panel-components-input-suffix-bg-color);
|
|
@@ -750,11 +752,13 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
750
752
|
.pops-panel-input:active span.pops-panel-input__suffix:has(svg[data-type="circleClose"]) {
|
|
751
753
|
display: inline-flex;
|
|
752
754
|
}
|
|
753
|
-
/*
|
|
755
|
+
/* 当清空图标显示时或查看图标存在时,则隐藏输入框的padding-right */
|
|
754
756
|
.pops-panel-input:hover:has(span.pops-panel-input__suffix svg[data-type="circleClose"]) input,
|
|
755
757
|
.pops-panel-input:focus:has(span.pops-panel-input__suffix svg[data-type="circleClose"]) input,
|
|
756
758
|
.pops-panel-input:focus-within:has(span.pops-panel-input__suffix svg[data-type="circleClose"]) input,
|
|
757
|
-
.pops-panel-input:active:has(span.pops-panel-input__suffix svg[data-type="circleClose"]) input
|
|
759
|
+
.pops-panel-input:active:has(span.pops-panel-input__suffix svg[data-type="circleClose"]) input,
|
|
760
|
+
.pops-panel-input:has(span.pops-panel-input__suffix svg[data-type="view"]) input,
|
|
761
|
+
.pops-panel-input:has(span.pops-panel-input__suffix svg[data-type="hide"]) input {
|
|
758
762
|
padding-right: 0;
|
|
759
763
|
}
|
|
760
764
|
.pops-panel-input .pops-panel-icon {
|
|
@@ -1001,10 +1005,14 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
1001
1005
|
.pops-panel-select-multiple .el-select__caret {
|
|
1002
1006
|
color: var(--el-select-input-color);
|
|
1003
1007
|
font-size: var(--el-select-input-font-size);
|
|
1004
|
-
transition: var(--el-transition-duration);
|
|
1008
|
+
transition: transform var(--el-transition-duration);
|
|
1005
1009
|
transform: rotate(0);
|
|
1006
1010
|
cursor: pointer;
|
|
1007
1011
|
}
|
|
1012
|
+
/* 把箭头旋转 */
|
|
1013
|
+
.pops-panel-select-multiple[data-show-option] .el-select__caret {
|
|
1014
|
+
transform: rotate(180deg);
|
|
1015
|
+
}
|
|
1008
1016
|
.pops-panel-select-multiple .el-tag {
|
|
1009
1017
|
--el-tag-font-size: 12px;
|
|
1010
1018
|
--el-tag-border-radius: 4px;
|
|
@@ -3,35 +3,22 @@ import { PopsHandler } from "../../handler/PopsHandler";
|
|
|
3
3
|
import { popsDOMUtils } from "../../utils/PopsDOMUtils";
|
|
4
4
|
import { PopsInstanceUtils } from "../../utils/PopsInstanceUtils";
|
|
5
5
|
import { popsUtils } from "../../utils/PopsUtils";
|
|
6
|
-
import type {
|
|
7
|
-
import {
|
|
6
|
+
import type { PopsPanelConfig, PopsPanelEventType } from "./types";
|
|
7
|
+
import { PopsPanelDefaultConfig } from "./defaultConfig";
|
|
8
8
|
import { PanelHandlerComponents } from "./handlerComponents";
|
|
9
9
|
import { GlobalConfig } from "../../config/GlobalConfig";
|
|
10
10
|
import { PopsCSS } from "../../PopsCSS";
|
|
11
11
|
import type { PopsType } from "../../types/main";
|
|
12
12
|
|
|
13
13
|
export const PopsPanel = {
|
|
14
|
-
init(
|
|
14
|
+
init(__config__: PopsPanelConfig) {
|
|
15
15
|
const guid = popsUtils.getRandomGUID();
|
|
16
16
|
// 设置当前类型
|
|
17
17
|
const popsType: PopsType = "panel";
|
|
18
18
|
|
|
19
|
-
let config: Required<
|
|
19
|
+
let config: Required<PopsPanelConfig> = PopsPanelDefaultConfig();
|
|
20
20
|
config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
|
|
21
|
-
config = popsUtils.assign(config,
|
|
22
|
-
if (details) {
|
|
23
|
-
if (Array.isArray(details.content)) {
|
|
24
|
-
// 存在内容配置
|
|
25
|
-
config.content = details.content;
|
|
26
|
-
}
|
|
27
|
-
if (Array.isArray(details.bottomContentConfig)) {
|
|
28
|
-
// 存在底部配置
|
|
29
|
-
config.bottomContentConfig = details.bottomContentConfig;
|
|
30
|
-
} else {
|
|
31
|
-
// 不存在底部配置 清空默认的
|
|
32
|
-
config.bottomContentConfig = [];
|
|
33
|
-
}
|
|
34
|
-
}
|
|
21
|
+
config = popsUtils.assign(config, __config__);
|
|
35
22
|
config = PopsHandler.handleOnly(popsType, config);
|
|
36
23
|
|
|
37
24
|
const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
|
|
@@ -109,7 +96,7 @@ export const PopsPanel = {
|
|
|
109
96
|
* 弹窗的主元素,包括动画层
|
|
110
97
|
*/
|
|
111
98
|
const $anim = PopsElementHandler.parseElement<HTMLDivElement>(animHTML);
|
|
112
|
-
|
|
99
|
+
// 结构元素
|
|
113
100
|
const {
|
|
114
101
|
$pops,
|
|
115
102
|
$headerBtnClose,
|
|
@@ -135,7 +122,7 @@ export const PopsPanel = {
|
|
|
135
122
|
*/
|
|
136
123
|
const $elList: HTMLElement[] = [$anim];
|
|
137
124
|
|
|
138
|
-
|
|
125
|
+
// 遮罩层元素
|
|
139
126
|
if (config.mask.enable) {
|
|
140
127
|
const handleMask = PopsHandler.handleMask({
|
|
141
128
|
type: popsType,
|
|
@@ -148,7 +135,7 @@ export const PopsPanel = {
|
|
|
148
135
|
$elList.push($mask);
|
|
149
136
|
}
|
|
150
137
|
|
|
151
|
-
|
|
138
|
+
// 处理返回的配置
|
|
152
139
|
const evtConfig = PopsHandler.handleEventConfig(
|
|
153
140
|
config,
|
|
154
141
|
guid,
|
|
@@ -159,16 +146,16 @@ export const PopsPanel = {
|
|
|
159
146
|
$pops,
|
|
160
147
|
$mask
|
|
161
148
|
);
|
|
162
|
-
|
|
149
|
+
// 为顶部右边的关闭按钮添加点击事件
|
|
163
150
|
PopsHandler.handleClickEvent("close", $headerBtnClose, evtConfig, config.btn?.close?.callback);
|
|
164
151
|
|
|
165
|
-
|
|
152
|
+
// 创建到页面中
|
|
166
153
|
popsDOMUtils.append($shadowRoot, $elList);
|
|
167
154
|
if (typeof config.beforeAppendToPageCallBack === "function") {
|
|
168
155
|
config.beforeAppendToPageCallBack($shadowRoot, $shadowContainer);
|
|
169
156
|
}
|
|
170
157
|
popsDOMUtils.appendBody($shadowContainer);
|
|
171
|
-
|
|
158
|
+
// 追加遮罩层元素
|
|
172
159
|
if ($mask != null) {
|
|
173
160
|
$anim.after($mask);
|
|
174
161
|
}
|
|
@@ -193,13 +180,13 @@ export const PopsPanel = {
|
|
|
193
180
|
|
|
194
181
|
PopsHandler.handlePush(popsType, {
|
|
195
182
|
guid: guid,
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
183
|
+
$anim: $anim,
|
|
184
|
+
$pops: $pops,
|
|
185
|
+
$mask: $mask!,
|
|
199
186
|
$shadowContainer: $shadowContainer,
|
|
200
187
|
$shadowRoot: $shadowRoot,
|
|
201
188
|
});
|
|
202
|
-
|
|
189
|
+
// 拖拽
|
|
203
190
|
if (config.drag) {
|
|
204
191
|
PopsInstanceUtils.drag($pops, {
|
|
205
192
|
dragElement: $title,
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
2
2
|
import type { PopsButtonStyleType } from "../../../types/button";
|
|
3
3
|
import type { PopsIconType } from "../../../types/icon";
|
|
4
4
|
/**
|
|
5
5
|
* pops.panel的 button
|
|
6
6
|
*/
|
|
7
|
-
export interface
|
|
7
|
+
export interface PopsPanelButtonConfig extends PopsPanelGeneralConfig<PopsPanelButtonConfig> {
|
|
8
|
+
/**
|
|
9
|
+
* 类型
|
|
10
|
+
*/
|
|
11
|
+
type: "button";
|
|
8
12
|
/**
|
|
9
13
|
* 显示在左边的文字
|
|
10
14
|
*/
|
|
@@ -13,12 +17,9 @@ export interface PopsPanelButtonDetails extends PopsPanelCommonDetails<PopsPanel
|
|
|
13
17
|
* (可选)左边的文字下面的描述
|
|
14
18
|
*/
|
|
15
19
|
description?: string;
|
|
16
|
-
/**
|
|
17
|
-
* 类型
|
|
18
|
-
*/
|
|
19
|
-
type: "button";
|
|
20
20
|
/**
|
|
21
21
|
* (可选)是否禁用
|
|
22
|
+
* @default false
|
|
22
23
|
*/
|
|
23
24
|
disable?: boolean;
|
|
24
25
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { PopsPanelContainerConfig } from "./components-container";
|
|
2
|
+
import type { PopsPanelViewConfig } from ".";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* 右侧容器的配置
|
|
6
6
|
*/
|
|
7
|
-
export interface
|
|
7
|
+
export interface PopsPanelRightAsideContainerConfig {
|
|
8
8
|
/** 当前的<li>元素 */
|
|
9
9
|
target: HTMLLIElement | undefined;
|
|
10
10
|
/** 当前的<li>元素的父<ul>元素 */
|
|
@@ -19,7 +19,7 @@ export interface PopsPanelRightAsideContainerOptions {
|
|
|
19
19
|
/**
|
|
20
20
|
* 通用配置
|
|
21
21
|
*/
|
|
22
|
-
export interface
|
|
22
|
+
export interface PopsPanelGeneralConfig<T extends PopsPanelViewConfig | PopsPanelContainerConfig> {
|
|
23
23
|
/**
|
|
24
24
|
* (可选)元素的className,值为空的话就不设置
|
|
25
25
|
* @default ""
|
|
@@ -45,11 +45,11 @@ export interface PopsPanelCommonDetails<T extends PopsPanelFormsTotalDetails | P
|
|
|
45
45
|
};
|
|
46
46
|
/**
|
|
47
47
|
* 在添加到<ul>元素后触发该回调
|
|
48
|
-
* @param
|
|
48
|
+
* @param viewConfig 配置
|
|
49
49
|
* @param container 右侧容器的元素
|
|
50
50
|
* @example
|
|
51
51
|
* // 例如在type为own时
|
|
52
|
-
* afterAddToUListCallBack(
|
|
52
|
+
* afterAddToUListCallBack(viewConfig, container) {
|
|
53
53
|
* DOMUtils.on(
|
|
54
54
|
container.formHeaderDivElement.querySelector(
|
|
55
55
|
"a"
|
|
@@ -69,5 +69,5 @@ export interface PopsPanelCommonDetails<T extends PopsPanelFormsTotalDetails | P
|
|
|
69
69
|
* // 例如在type为forms时
|
|
70
70
|
* container内只有container.ulElement这个属性
|
|
71
71
|
*/
|
|
72
|
-
afterAddToUListCallBack?: (
|
|
72
|
+
afterAddToUListCallBack?: (viewConfig: T, container: PopsPanelRightAsideContainerConfig) => void;
|
|
73
73
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
2
|
+
import type { PopsPanelViewConfig } from ".";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* pops.panel的 container
|
|
6
|
+
*/
|
|
7
|
+
export interface PopsPanelContainerConfig extends PopsPanelGeneralConfig<PopsPanelContainerConfig> {
|
|
8
|
+
/**
|
|
9
|
+
* 类型
|
|
10
|
+
*/
|
|
11
|
+
type: "container";
|
|
12
|
+
/**
|
|
13
|
+
* 显示在左边的文字
|
|
14
|
+
*/
|
|
15
|
+
text: string;
|
|
16
|
+
/**
|
|
17
|
+
* 是否进行折叠
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
isFold?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* 子配置
|
|
23
|
+
*/
|
|
24
|
+
views: PopsPanelViewConfig[];
|
|
25
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
1
|
+
import type { PopsPanelViewConfig } from ".";
|
|
2
|
+
import type { PopsPanelContainerConfig } from "./components-container";
|
|
3
|
+
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
4
4
|
/**
|
|
5
|
-
* pops.panel的
|
|
5
|
+
* pops.panel的 深层视图的配置
|
|
6
6
|
*/
|
|
7
|
-
export interface
|
|
7
|
+
export interface PopsPanelDeepViewConfig extends PopsPanelGeneralConfig<PopsPanelDeepViewConfig> {
|
|
8
8
|
/**
|
|
9
9
|
* 类型
|
|
10
10
|
*/
|
|
@@ -34,29 +34,29 @@ export interface PopsPanelDeepMenuDetails extends PopsPanelCommonDetails<PopsPan
|
|
|
34
34
|
*/
|
|
35
35
|
clickCallBack?: (
|
|
36
36
|
event: MouseEvent | PointerEvent,
|
|
37
|
-
|
|
37
|
+
viewConfig: PopsPanelDeepViewConfig
|
|
38
38
|
) => boolean | void | Promise<boolean | void>;
|
|
39
39
|
/**
|
|
40
40
|
* 进入深层菜单后触发的回调
|
|
41
|
-
* @param
|
|
41
|
+
* @param viewConfig
|
|
42
42
|
*/
|
|
43
43
|
afterEnterDeepMenuCallBack?: (
|
|
44
|
-
|
|
44
|
+
viewConfig: PopsPanelDeepViewConfig,
|
|
45
45
|
container: {
|
|
46
46
|
/** 右侧的总容器 */
|
|
47
|
-
sectionContainer: HTMLElement;
|
|
47
|
+
$sectionContainer: HTMLElement;
|
|
48
48
|
/** 右侧的总容器的标题头容器 */
|
|
49
|
-
sectionContainerHeaderContainer: HTMLUListElement;
|
|
49
|
+
$sectionContainerHeaderContainer: HTMLUListElement;
|
|
50
50
|
/** 右侧的总容器的标题头 */
|
|
51
|
-
sectionContainerHeader: HTMLLIElement;
|
|
51
|
+
$sectionContainerHeader: HTMLLIElement;
|
|
52
52
|
/** 右侧的内容容器 */
|
|
53
|
-
sectionBodyContainer: HTMLUListElement;
|
|
53
|
+
$sectionBodyContainer: HTMLUListElement;
|
|
54
54
|
}
|
|
55
55
|
) => void;
|
|
56
56
|
/**
|
|
57
57
|
* 菜单配置
|
|
58
58
|
*/
|
|
59
|
-
|
|
59
|
+
views?: (PopsPanelContainerConfig | PopsPanelViewConfig)[];
|
|
60
60
|
/**
|
|
61
61
|
* (可选)头部的标题文字,没有的话默认是text
|
|
62
62
|
*/
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* pops.panel的 input
|
|
5
5
|
*/
|
|
6
|
-
export interface
|
|
6
|
+
export interface PopsPanelInputConfig extends PopsPanelGeneralConfig<PopsPanelInputConfig> {
|
|
7
|
+
/**
|
|
8
|
+
* 类型
|
|
9
|
+
*/
|
|
10
|
+
type: "input";
|
|
7
11
|
/**
|
|
8
12
|
* 显示在左边的文字
|
|
9
13
|
*/
|
|
@@ -13,10 +17,6 @@ export interface PopsPanelInputDetails extends PopsPanelCommonDetails<PopsPanelI
|
|
|
13
17
|
* @default ""
|
|
14
18
|
*/
|
|
15
19
|
description?: string;
|
|
16
|
-
/**
|
|
17
|
-
* 类型
|
|
18
|
-
*/
|
|
19
|
-
type: "input";
|
|
20
20
|
/**
|
|
21
21
|
* (可选)是否禁用
|
|
22
22
|
* @default false
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* pops.panel的 own
|
|
5
5
|
* 自定义的
|
|
6
6
|
*/
|
|
7
|
-
export interface
|
|
7
|
+
export interface PopsPanelOwnConfig extends PopsPanelGeneralConfig<PopsPanelOwnConfig> {
|
|
8
8
|
/**
|
|
9
9
|
* 类型
|
|
10
10
|
*/
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
1
|
+
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
2
|
+
import type { PopsPanelContainerConfig } from "./components-container";
|
|
3
|
+
import type { PopsPanelViewConfig } from ".";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* pops.panel的 select
|
|
7
7
|
*/
|
|
8
|
-
export interface
|
|
8
|
+
export interface PopsPanelSelectConfig<T = any> extends PopsPanelGeneralConfig<PopsPanelSelectConfig> {
|
|
9
|
+
/**
|
|
10
|
+
* 类型
|
|
11
|
+
*/
|
|
12
|
+
type: "select";
|
|
9
13
|
/**
|
|
10
14
|
* 显示在左边的文字
|
|
11
15
|
*/
|
|
@@ -15,10 +19,6 @@ export interface PopsPanelSelectDetails<T = any> extends PopsPanelCommonDetails<
|
|
|
15
19
|
* @default ""
|
|
16
20
|
*/
|
|
17
21
|
description?: string;
|
|
18
|
-
/**
|
|
19
|
-
* 类型
|
|
20
|
-
*/
|
|
21
|
-
type: "select";
|
|
22
22
|
/**
|
|
23
23
|
* (可选)是否禁用
|
|
24
24
|
* @default false
|
|
@@ -63,8 +63,8 @@ export interface PopsPanelSelectDetails<T = any> extends PopsPanelCommonDetails<
|
|
|
63
63
|
/**
|
|
64
64
|
* 子配置,跟随切换改变
|
|
65
65
|
*/
|
|
66
|
-
|
|
67
|
-
| (
|
|
68
|
-
| (() => (
|
|
66
|
+
views?:
|
|
67
|
+
| (PopsPanelContainerConfig | PopsPanelViewConfig)[]
|
|
68
|
+
| (() => (PopsPanelContainerConfig | PopsPanelViewConfig)[]);
|
|
69
69
|
}[];
|
|
70
70
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { PopsAlertConfig } from "../../alert/types";
|
|
2
|
+
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
3
3
|
|
|
4
4
|
export interface PopsPanelSelectMultipleDataOption<T> {
|
|
5
5
|
/**
|
|
@@ -35,8 +35,11 @@ export interface PopsPanelSelectMultipleDataOption<T> {
|
|
|
35
35
|
/**
|
|
36
36
|
* pops.panel的 select
|
|
37
37
|
*/
|
|
38
|
-
export interface
|
|
39
|
-
|
|
38
|
+
export interface PopsPanelSelectMultipleConfig<T = any> extends PopsPanelGeneralConfig<PopsPanelSelectMultipleConfig> {
|
|
39
|
+
/**
|
|
40
|
+
* 类型
|
|
41
|
+
*/
|
|
42
|
+
type: "select-multiple";
|
|
40
43
|
/**
|
|
41
44
|
* 显示在左边的文字
|
|
42
45
|
*/
|
|
@@ -45,10 +48,6 @@ export interface PopsPanelSelectMultipleDetails<T = any>
|
|
|
45
48
|
* (可选)左边的文字下面的描述
|
|
46
49
|
*/
|
|
47
50
|
description?: string;
|
|
48
|
-
/**
|
|
49
|
-
* 类型
|
|
50
|
-
*/
|
|
51
|
-
type: "select-multiple";
|
|
52
51
|
/**
|
|
53
52
|
* (可选)是否禁用
|
|
54
53
|
*/
|
|
@@ -64,7 +63,7 @@ export interface PopsPanelSelectMultipleDetails<T = any>
|
|
|
64
63
|
/**
|
|
65
64
|
* 弹出的下拉列表弹窗的配置
|
|
66
65
|
*/
|
|
67
|
-
|
|
66
|
+
selectConfirmDialogConfig?: Partial<PopsAlertConfig>;
|
|
68
67
|
/**
|
|
69
68
|
* 选择器的值改变触发的回调函数
|
|
70
69
|
* @param event 事件
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* pops.panel的 slider
|
|
5
5
|
*/
|
|
6
|
-
export interface
|
|
6
|
+
export interface PopsPanelSliderConfig extends PopsPanelGeneralConfig<PopsPanelSliderConfig> {
|
|
7
|
+
/**
|
|
8
|
+
* 类型
|
|
9
|
+
* @default "slider"
|
|
10
|
+
*/
|
|
11
|
+
type: "slider";
|
|
7
12
|
/**
|
|
8
13
|
* 显示在左边的文字
|
|
9
14
|
*/
|
|
@@ -13,11 +18,6 @@ export interface PopsPanelSliderDetails extends PopsPanelCommonDetails<PopsPanel
|
|
|
13
18
|
* @default ""
|
|
14
19
|
*/
|
|
15
20
|
description?: string;
|
|
16
|
-
/**
|
|
17
|
-
* 类型
|
|
18
|
-
* @default "slider"
|
|
19
|
-
*/
|
|
20
|
-
type: "slider";
|
|
21
21
|
/**
|
|
22
22
|
* (可选)是否禁用
|
|
23
23
|
* @default false
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* pops.panel的 switch
|
|
5
5
|
*/
|
|
6
|
-
export interface
|
|
6
|
+
export interface PopsPanelSwitchConfig extends PopsPanelGeneralConfig<PopsPanelSwitchConfig> {
|
|
7
|
+
/**
|
|
8
|
+
* 类型
|
|
9
|
+
*/
|
|
10
|
+
type: "switch";
|
|
7
11
|
/**
|
|
8
12
|
* 显示在左边的文字
|
|
9
13
|
*/
|
|
@@ -13,10 +17,6 @@ export interface PopsPanelSwitchDetails extends PopsPanelCommonDetails<PopsPanel
|
|
|
13
17
|
* @default ""
|
|
14
18
|
*/
|
|
15
19
|
description?: string;
|
|
16
|
-
/**
|
|
17
|
-
* 类型
|
|
18
|
-
*/
|
|
19
|
-
type: "switch";
|
|
20
20
|
/**
|
|
21
21
|
* (可选)是否禁用
|
|
22
22
|
* @default false
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* pops.panel的 textarea
|
|
5
5
|
*/
|
|
6
|
-
export interface
|
|
6
|
+
export interface PopsPanelTextAreaConfig extends PopsPanelGeneralConfig<PopsPanelTextAreaConfig> {
|
|
7
|
+
/**
|
|
8
|
+
* 类型
|
|
9
|
+
*/
|
|
10
|
+
type: "textarea";
|
|
7
11
|
/**
|
|
8
12
|
* 显示在左边的文字
|
|
9
13
|
*/
|
|
@@ -13,10 +17,6 @@ export interface PopsPanelTextAreaDetails extends PopsPanelCommonDetails<PopsPan
|
|
|
13
17
|
* @default ""
|
|
14
18
|
*/
|
|
15
19
|
description?: string;
|
|
16
|
-
/**
|
|
17
|
-
* 类型
|
|
18
|
-
*/
|
|
19
|
-
type: "textarea";
|
|
20
20
|
/**
|
|
21
21
|
* (可选)是否禁用
|
|
22
22
|
* @default false
|
|
@@ -1,29 +1,34 @@
|
|
|
1
|
-
import type { PopsTitleConfig, PopsDragConfig,
|
|
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 {
|
|
13
|
-
import type {
|
|
14
|
-
|
|
15
|
-
/** panel的各种类型的配置项 */
|
|
16
|
-
export type PopsPanelFormsTotalDetails =
|
|
17
|
-
| PopsPanelSwitchDetails
|
|
18
|
-
| PopsPanelSliderDetails
|
|
19
|
-
| PopsPanelInputDetails
|
|
20
|
-
| PopsPanelTextAreaDetails
|
|
21
|
-
| PopsPanelSelectDetails<any>
|
|
22
|
-
| PopsPanelSelectMultipleDetails<any>
|
|
23
|
-
| PopsPanelButtonDetails
|
|
24
|
-
| PopsPanelDeepMenuDetails
|
|
25
|
-
| PopsPanelOwnDetails;
|
|
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";
|
|
26
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;
|
|
27
32
|
/**
|
|
28
33
|
* panel的内部事件
|
|
29
34
|
*/
|
|
@@ -33,9 +38,9 @@ export type PopsPanelEventType = {
|
|
|
33
38
|
*/
|
|
34
39
|
"pops:renderRightContainer": {
|
|
35
40
|
/**
|
|
36
|
-
*
|
|
41
|
+
* 视图配置
|
|
37
42
|
*/
|
|
38
|
-
|
|
43
|
+
viewConfig: PopsPanelContentConfig[] | PopsPanelDeepViewConfig;
|
|
39
44
|
};
|
|
40
45
|
};
|
|
41
46
|
|
|
@@ -51,7 +56,7 @@ export interface PopsPanelContentConfig {
|
|
|
51
56
|
* (可选)元素的className,值为空的话就不设置
|
|
52
57
|
* @default ""
|
|
53
58
|
*/
|
|
54
|
-
className?:
|
|
59
|
+
className?: PopsPanelGeneralConfig<any>["className"];
|
|
55
60
|
/**
|
|
56
61
|
* 显示的文本,可以是html格式
|
|
57
62
|
*/
|
|
@@ -84,16 +89,18 @@ export interface PopsPanelContentConfig {
|
|
|
84
89
|
scrollToDefaultView?: boolean;
|
|
85
90
|
/**
|
|
86
91
|
* (可选)自定义元素属性.setAttribute、.getAttribute
|
|
92
|
+
* @default {}
|
|
87
93
|
*/
|
|
88
|
-
attributes?:
|
|
94
|
+
attributes?: PopsPanelGeneralConfig<any>["attributes"];
|
|
89
95
|
/**
|
|
90
96
|
* (可选)自定义元素内部的属性值
|
|
97
|
+
* @default {}
|
|
91
98
|
*/
|
|
92
|
-
props?:
|
|
99
|
+
props?: PopsPanelGeneralConfig<any>["props"];
|
|
93
100
|
/**
|
|
94
|
-
*
|
|
101
|
+
* 视图配置
|
|
95
102
|
*/
|
|
96
|
-
|
|
103
|
+
views: PopsPanelMainViewConfig[];
|
|
97
104
|
/**
|
|
98
105
|
* 左侧容器的点击回调(点击后第一个触发该回调)
|
|
99
106
|
* @returns
|
|
@@ -138,7 +145,7 @@ export interface PopsPanelBottomContentConfig {
|
|
|
138
145
|
* (可选)元素的className,值为空的话就不设置
|
|
139
146
|
* @default ""
|
|
140
147
|
*/
|
|
141
|
-
className?:
|
|
148
|
+
className?: PopsPanelGeneralConfig<any>["className"];
|
|
142
149
|
/**
|
|
143
150
|
* (可选)配置所在位置
|
|
144
151
|
*
|
|
@@ -158,12 +165,12 @@ export interface PopsPanelBottomContentConfig {
|
|
|
158
165
|
* (可选)自定义元素属性.setAttribute、.getAttribute
|
|
159
166
|
* @default {}
|
|
160
167
|
*/
|
|
161
|
-
attributes?:
|
|
168
|
+
attributes?: PopsPanelGeneralConfig<any>["attributes"];
|
|
162
169
|
/**
|
|
163
170
|
* (可选)自定义元素内部的属性值
|
|
164
171
|
* @default {}
|
|
165
172
|
*/
|
|
166
|
-
props?:
|
|
173
|
+
props?: PopsPanelGeneralConfig<any>["props"];
|
|
167
174
|
/**
|
|
168
175
|
* 该项的点击回调
|
|
169
176
|
*/
|
|
@@ -196,7 +203,7 @@ export interface PopsPanelBottomContentConfig {
|
|
|
196
203
|
/**
|
|
197
204
|
* pops.panel
|
|
198
205
|
*/
|
|
199
|
-
export interface
|
|
206
|
+
export interface PopsPanelConfig extends PopsTitleConfig, PopsDragConfig, PopsGeneralConfig {
|
|
200
207
|
/**
|
|
201
208
|
* 内容配置
|
|
202
209
|
*/
|
|
@@ -212,14 +219,14 @@ export interface PopsPanelDetails extends PopsTitleConfig, PopsDragConfig, PopsC
|
|
|
212
219
|
/**
|
|
213
220
|
* 关闭按钮
|
|
214
221
|
*/
|
|
215
|
-
close?:
|
|
222
|
+
close?: PopsHeaderCloseButtonConfig;
|
|
216
223
|
};
|
|
217
224
|
/**
|
|
218
225
|
* 移动端适配的的className
|
|
219
226
|
*
|
|
220
227
|
* @default "pops-panel-is-mobile"
|
|
221
228
|
*/
|
|
222
|
-
mobileClassName?:
|
|
229
|
+
mobileClassName?: PopsPanelGeneralConfig<any>["className"];
|
|
223
230
|
/**
|
|
224
231
|
* 是否强制是移动端,默认false
|
|
225
232
|
* + true 强制为移动端
|