@whitesev/pops 2.5.5 → 2.6.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 +158 -150
- 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 +158 -150
- 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 +158 -150
- 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 +158 -150
- 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 +158 -150
- 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 +158 -150
- 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/Pops.d.ts +14 -14
- package/dist/types/src/components/alert/index.d.ts +1 -1
- package/dist/types/src/components/confirm/index.d.ts +1 -1
- package/dist/types/src/components/drawer/index.d.ts +1 -1
- package/dist/types/src/components/folder/index.d.ts +1 -1
- package/dist/types/src/components/iframe/index.d.ts +2 -2
- package/dist/types/src/components/iframe/types/index.d.ts +6 -6
- package/dist/types/src/components/loading/index.d.ts +1 -1
- package/dist/types/src/components/panel/index.d.ts +4 -4
- package/dist/types/src/components/prompt/index.d.ts +1 -1
- package/dist/types/src/handler/PopsHandler.d.ts +18 -17
- package/dist/types/src/types/button.d.ts +4 -4
- package/dist/types/src/types/event.d.ts +7 -7
- package/dist/types/src/utils/PopsInstanceUtils.d.ts +8 -8
- package/package.json +5 -5
- package/src/components/alert/index.ts +13 -13
- package/src/components/confirm/index.ts +15 -16
- package/src/components/drawer/index.ts +22 -22
- package/src/components/folder/index.ts +14 -14
- package/src/components/iframe/index.ts +19 -20
- package/src/components/iframe/types/index.ts +6 -6
- package/src/components/loading/index.ts +8 -8
- package/src/components/panel/index.css +12 -1
- package/src/components/panel/index.ts +11 -11
- package/src/components/prompt/index.ts +28 -29
- package/src/handler/PopsHandler.ts +70 -68
- package/src/types/button.d.ts +4 -4
- package/src/types/event.d.ts +7 -7
- package/src/utils/PopsInstanceUtils.ts +28 -24
|
@@ -2,6 +2,7 @@ import { GlobalConfig } from "../../config/GlobalConfig";
|
|
|
2
2
|
import { PopsElementHandler } from "../../handler/PopsElementHandler";
|
|
3
3
|
import { PopsHandler } from "../../handler/PopsHandler";
|
|
4
4
|
import { PopsCSS } from "../../PopsCSS";
|
|
5
|
+
import type { PopsHandlerEventConfig } from "../../types/event";
|
|
5
6
|
import type { PopsType } from "../../types/main";
|
|
6
7
|
import { popsDOMUtils } from "../../utils/PopsDOMUtils";
|
|
7
8
|
import { popsUtils } from "../../utils/PopsUtils";
|
|
@@ -99,32 +100,32 @@ export const PopsDrawer = {
|
|
|
99
100
|
/**
|
|
100
101
|
* 遮罩层元素
|
|
101
102
|
*/
|
|
102
|
-
let $mask: HTMLDivElement |
|
|
103
|
+
let $mask: HTMLDivElement | undefined = void 0;
|
|
103
104
|
/**
|
|
104
105
|
* 已创建的元素列表
|
|
105
106
|
*/
|
|
106
|
-
const
|
|
107
|
+
const $elList: HTMLElement[] = [$anim];
|
|
107
108
|
|
|
108
109
|
if (config.mask.enable) {
|
|
109
|
-
const
|
|
110
|
+
const handleMask = PopsHandler.handleMask({
|
|
110
111
|
type: popsType,
|
|
111
112
|
guid: guid,
|
|
112
113
|
config: config,
|
|
113
114
|
animElement: $anim,
|
|
114
115
|
maskHTML: maskHTML,
|
|
115
116
|
});
|
|
116
|
-
$mask =
|
|
117
|
-
|
|
117
|
+
$mask = handleMask.maskElement;
|
|
118
|
+
$elList.push($mask);
|
|
118
119
|
}
|
|
119
|
-
const
|
|
120
|
+
const evtConfig = PopsHandler.handleEventConfig(
|
|
121
|
+
config,
|
|
120
122
|
guid,
|
|
121
123
|
$shadowContainer,
|
|
122
124
|
$shadowRoot,
|
|
123
125
|
popsType,
|
|
124
126
|
$anim,
|
|
125
127
|
$pops,
|
|
126
|
-
$mask
|
|
127
|
-
config
|
|
128
|
+
$mask
|
|
128
129
|
);
|
|
129
130
|
/* 处理方向 */
|
|
130
131
|
|
|
@@ -153,11 +154,14 @@ export const PopsDrawer = {
|
|
|
153
154
|
/* 按下Esc键触发关闭 */
|
|
154
155
|
if (config.closeOnPressEscape) {
|
|
155
156
|
PopsHandler.handleKeyboardEvent("Escape", [], function () {
|
|
156
|
-
|
|
157
|
+
evtConfig.close();
|
|
157
158
|
});
|
|
158
159
|
}
|
|
159
160
|
/* 待处理的点击事件列表 */
|
|
160
|
-
const needHandleClickEventList
|
|
161
|
+
const needHandleClickEventList: {
|
|
162
|
+
type: PopsHandlerEventConfig["type"];
|
|
163
|
+
ele: HTMLElement;
|
|
164
|
+
}[] = [
|
|
161
165
|
{
|
|
162
166
|
type: "close",
|
|
163
167
|
ele: $headerCloseBtn,
|
|
@@ -176,20 +180,16 @@ export const PopsDrawer = {
|
|
|
176
180
|
},
|
|
177
181
|
];
|
|
178
182
|
needHandleClickEventList.forEach((item) => {
|
|
179
|
-
PopsHandler.handleClickEvent(
|
|
180
|
-
item.type
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
(_eventDetails_) => {
|
|
184
|
-
if (typeof (config.btn as any)[item.type].callback === "function") {
|
|
185
|
-
(config.btn as any)[item.type].callback(_eventDetails_);
|
|
186
|
-
}
|
|
183
|
+
PopsHandler.handleClickEvent(item.type, item.ele, evtConfig, (details, event) => {
|
|
184
|
+
const callback = config.btn[item.type].callback;
|
|
185
|
+
if (typeof callback === "function") {
|
|
186
|
+
callback(details, event);
|
|
187
187
|
}
|
|
188
|
-
);
|
|
188
|
+
});
|
|
189
189
|
});
|
|
190
190
|
|
|
191
191
|
/* 先隐藏,然后根据config.openDelay来显示 */
|
|
192
|
-
|
|
192
|
+
$elList.forEach((element) => {
|
|
193
193
|
element.style.setProperty("display", "none");
|
|
194
194
|
if (["top"].includes(config.direction)) {
|
|
195
195
|
$pops.style.setProperty("height", config.size.toString());
|
|
@@ -212,7 +212,7 @@ export const PopsDrawer = {
|
|
|
212
212
|
});
|
|
213
213
|
/* 创建到页面中 */
|
|
214
214
|
|
|
215
|
-
popsDOMUtils.append($shadowRoot,
|
|
215
|
+
popsDOMUtils.append($shadowRoot, $elList);
|
|
216
216
|
if (typeof config.beforeAppendToPageCallBack === "function") {
|
|
217
217
|
config.beforeAppendToPageCallBack($shadowRoot, $shadowContainer);
|
|
218
218
|
}
|
|
@@ -236,7 +236,7 @@ export const PopsDrawer = {
|
|
|
236
236
|
$shadowContainer: $shadowContainer,
|
|
237
237
|
$shadowRoot: $shadowRoot,
|
|
238
238
|
});
|
|
239
|
-
const result = PopsHandler.
|
|
239
|
+
const result = PopsHandler.handleResultConfig(evtConfig);
|
|
240
240
|
return result;
|
|
241
241
|
},
|
|
242
242
|
};
|
|
@@ -252,41 +252,41 @@ export const PopsFolder = {
|
|
|
252
252
|
/**
|
|
253
253
|
* 遮罩层元素
|
|
254
254
|
*/
|
|
255
|
-
let $mask: HTMLDivElement |
|
|
255
|
+
let $mask: HTMLDivElement | undefined = void 0;
|
|
256
256
|
/**
|
|
257
257
|
* 已创建的元素列表
|
|
258
258
|
*/
|
|
259
|
-
const
|
|
259
|
+
const $elList: HTMLElement[] = [$anim];
|
|
260
260
|
|
|
261
261
|
if (config.mask.enable) {
|
|
262
|
-
const
|
|
262
|
+
const handleMask = PopsHandler.handleMask({
|
|
263
263
|
type: popsType,
|
|
264
264
|
guid: guid,
|
|
265
265
|
config: config,
|
|
266
266
|
animElement: $anim,
|
|
267
267
|
maskHTML: maskHTML,
|
|
268
268
|
});
|
|
269
|
-
$mask =
|
|
270
|
-
|
|
269
|
+
$mask = handleMask.maskElement;
|
|
270
|
+
$elList.push($mask);
|
|
271
271
|
}
|
|
272
272
|
/* 事件 */
|
|
273
|
-
const
|
|
273
|
+
const evtConfig = PopsHandler.handleEventConfig(
|
|
274
|
+
config,
|
|
274
275
|
guid,
|
|
275
276
|
$shadowContainer,
|
|
276
277
|
$shadowRoot,
|
|
277
278
|
popsType,
|
|
278
279
|
$anim,
|
|
279
280
|
$pops,
|
|
280
|
-
$mask
|
|
281
|
-
config
|
|
281
|
+
$mask
|
|
282
282
|
);
|
|
283
|
-
PopsHandler.handleClickEvent("close", $btnCloseBtn,
|
|
284
|
-
PopsHandler.handleClickEvent("ok", btnOkElement,
|
|
285
|
-
PopsHandler.handleClickEvent("cancel", btnCancelElement,
|
|
286
|
-
PopsHandler.handleClickEvent("other", btnOtherElement,
|
|
283
|
+
PopsHandler.handleClickEvent("close", $btnCloseBtn, evtConfig, config.btn.close.callback);
|
|
284
|
+
PopsHandler.handleClickEvent("ok", btnOkElement, evtConfig, config.btn.ok.callback);
|
|
285
|
+
PopsHandler.handleClickEvent("cancel", btnCancelElement, evtConfig, config.btn.cancel.callback);
|
|
286
|
+
PopsHandler.handleClickEvent("other", btnOtherElement, evtConfig, config.btn.other.callback);
|
|
287
287
|
/* 创建到页面中 */
|
|
288
288
|
|
|
289
|
-
popsDOMUtils.append($shadowRoot,
|
|
289
|
+
popsDOMUtils.append($shadowRoot, $elList);
|
|
290
290
|
if (typeof config.beforeAppendToPageCallBack === "function") {
|
|
291
291
|
config.beforeAppendToPageCallBack($shadowRoot, $shadowContainer);
|
|
292
292
|
}
|
|
@@ -923,7 +923,7 @@ export const PopsFolder = {
|
|
|
923
923
|
$shadowContainer: $shadowContainer,
|
|
924
924
|
$shadowRoot: $shadowRoot,
|
|
925
925
|
});
|
|
926
|
-
const result = PopsHandler.
|
|
926
|
+
const result = PopsHandler.handleResultConfig(evtConfig);
|
|
927
927
|
return result;
|
|
928
928
|
},
|
|
929
929
|
};
|
|
@@ -4,7 +4,7 @@ import { PopsElementHandler } from "../../handler/PopsElementHandler";
|
|
|
4
4
|
import { PopsHandler } from "../../handler/PopsHandler";
|
|
5
5
|
import { PopsCSS } from "../../PopsCSS";
|
|
6
6
|
import { PopsInstData } from "../../PopsInst";
|
|
7
|
-
import type {
|
|
7
|
+
import type { PopsEventConfig } from "../../types/event";
|
|
8
8
|
import { popsDOMUtils } from "../../utils/PopsDOMUtils";
|
|
9
9
|
import { PopsInstanceUtils } from "../../utils/PopsInstanceUtils";
|
|
10
10
|
import { popsUtils } from "../../utils/PopsUtils";
|
|
@@ -115,14 +115,14 @@ export const PopsIframe = {
|
|
|
115
115
|
/**
|
|
116
116
|
* 遮罩层元素
|
|
117
117
|
*/
|
|
118
|
-
let $mask: HTMLDivElement |
|
|
118
|
+
let $mask: HTMLDivElement | undefined = void 0;
|
|
119
119
|
/**
|
|
120
120
|
* 已创建的元素列表
|
|
121
121
|
*/
|
|
122
|
-
const
|
|
122
|
+
const $elList: HTMLElement[] = [$anim];
|
|
123
123
|
|
|
124
124
|
if (config.mask.enable) {
|
|
125
|
-
const
|
|
125
|
+
const handleMask = PopsHandler.handleMask({
|
|
126
126
|
type: popsType,
|
|
127
127
|
guid: guid,
|
|
128
128
|
|
|
@@ -130,25 +130,24 @@ export const PopsIframe = {
|
|
|
130
130
|
animElement: $anim,
|
|
131
131
|
maskHTML: maskHTML,
|
|
132
132
|
});
|
|
133
|
-
$mask =
|
|
134
|
-
|
|
133
|
+
$mask = handleMask.maskElement;
|
|
134
|
+
$elList.push($mask);
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
const
|
|
137
|
+
const evtConfig = PopsHandler.handleEventConfig(
|
|
138
|
+
config,
|
|
138
139
|
guid,
|
|
139
140
|
$shadowContainer,
|
|
140
141
|
$shadowRoot,
|
|
141
142
|
popsType,
|
|
142
143
|
$anim,
|
|
143
|
-
|
|
144
|
-
$
|
|
145
|
-
|
|
146
|
-
config
|
|
147
|
-
) as any as PopsEventDetails & {
|
|
144
|
+
$pops,
|
|
145
|
+
$mask
|
|
146
|
+
) as any as PopsEventConfig & {
|
|
148
147
|
iframeElement: HTMLIFrameElement;
|
|
149
148
|
};
|
|
150
149
|
|
|
151
|
-
|
|
150
|
+
evtConfig["iframeElement"] = $iframe!;
|
|
152
151
|
|
|
153
152
|
popsDOMUtils.on($anim, popsDOMUtils.getAnimationEndNameList(), function () {
|
|
154
153
|
/* 动画加载完毕 */
|
|
@@ -170,11 +169,11 @@ export const PopsIframe = {
|
|
|
170
169
|
$title!.querySelector<HTMLElement>("p")!.innerText = $iframe!.contentDocument.title;
|
|
171
170
|
}
|
|
172
171
|
|
|
173
|
-
config.loadEndCallBack(
|
|
172
|
+
config.loadEndCallBack(evtConfig);
|
|
174
173
|
});
|
|
175
174
|
/* 创建到页面中 */
|
|
176
175
|
|
|
177
|
-
popsDOMUtils.append($shadowRoot,
|
|
176
|
+
popsDOMUtils.append($shadowRoot, $elList);
|
|
178
177
|
if (typeof config.beforeAppendToPageCallBack === "function") {
|
|
179
178
|
config.beforeAppendToPageCallBack($shadowRoot, $shadowContainer);
|
|
180
179
|
}
|
|
@@ -218,7 +217,7 @@ export const PopsIframe = {
|
|
|
218
217
|
// 显示复位图标
|
|
219
218
|
headerMiseBtnElement.style.setProperty("display", "");
|
|
220
219
|
if (typeof config?.btn?.min?.callback === "function") {
|
|
221
|
-
config.btn.min.callback(
|
|
220
|
+
config.btn.min.callback(evtConfig, event);
|
|
222
221
|
}
|
|
223
222
|
},
|
|
224
223
|
{
|
|
@@ -252,7 +251,7 @@ export const PopsIframe = {
|
|
|
252
251
|
// 显示复位图标
|
|
253
252
|
headerMiseBtnElement.style.setProperty("display", "");
|
|
254
253
|
if (typeof config?.btn?.max?.callback === "function") {
|
|
255
|
-
config.btn.max.callback(
|
|
254
|
+
config.btn.max.callback(evtConfig, event);
|
|
256
255
|
}
|
|
257
256
|
},
|
|
258
257
|
{
|
|
@@ -294,7 +293,7 @@ export const PopsIframe = {
|
|
|
294
293
|
headerMiseBtnElement.style.setProperty("display", "none");
|
|
295
294
|
}
|
|
296
295
|
if (typeof config?.btn?.mise?.callback === "function") {
|
|
297
|
-
config.btn.mise.callback(
|
|
296
|
+
config.btn.mise.callback(evtConfig, event);
|
|
298
297
|
}
|
|
299
298
|
},
|
|
300
299
|
{
|
|
@@ -310,7 +309,7 @@ export const PopsIframe = {
|
|
|
310
309
|
event.stopPropagation();
|
|
311
310
|
PopsInstanceUtils.removeInstance([PopsInstData.iframe], guid, false);
|
|
312
311
|
if (typeof config?.btn?.close?.callback === "function") {
|
|
313
|
-
config.btn.close.callback(
|
|
312
|
+
config.btn.close.callback(evtConfig, event);
|
|
314
313
|
}
|
|
315
314
|
},
|
|
316
315
|
{
|
|
@@ -329,7 +328,7 @@ export const PopsIframe = {
|
|
|
329
328
|
$shadowRoot: $shadowRoot,
|
|
330
329
|
});
|
|
331
330
|
|
|
332
|
-
const result = PopsHandler.
|
|
331
|
+
const result = PopsHandler.handleResultConfig(evtConfig);
|
|
333
332
|
return result;
|
|
334
333
|
},
|
|
335
334
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PopsTitleConfig, PopsDragConfig, PopsCommonConfig } from "../../../types/components";
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type { PopsEventConfig } from "../../../types/event";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* pops.iframe的按钮的点击回调参数event
|
|
@@ -65,7 +65,7 @@ export interface PopsIframeDetails extends PopsTitleConfig, PopsDragConfig, Pops
|
|
|
65
65
|
* 点击的回调函数
|
|
66
66
|
*/
|
|
67
67
|
callback: (
|
|
68
|
-
|
|
68
|
+
eventConfig: PopsEventConfig & {
|
|
69
69
|
iframeElement: HTMLIFrameElement;
|
|
70
70
|
},
|
|
71
71
|
event: MouseEvent | PointerEvent
|
|
@@ -79,7 +79,7 @@ export interface PopsIframeDetails extends PopsTitleConfig, PopsDragConfig, Pops
|
|
|
79
79
|
* 点击的回调函数
|
|
80
80
|
*/
|
|
81
81
|
callback: (
|
|
82
|
-
|
|
82
|
+
eventConfig: PopsEventConfig & {
|
|
83
83
|
iframeElement: HTMLIFrameElement;
|
|
84
84
|
},
|
|
85
85
|
event: MouseEvent | PointerEvent
|
|
@@ -93,7 +93,7 @@ export interface PopsIframeDetails extends PopsTitleConfig, PopsDragConfig, Pops
|
|
|
93
93
|
* 点击的回调函数
|
|
94
94
|
*/
|
|
95
95
|
callback: (
|
|
96
|
-
|
|
96
|
+
eventConfig: PopsEventConfig & {
|
|
97
97
|
iframeElement: HTMLIFrameElement;
|
|
98
98
|
},
|
|
99
99
|
event: MouseEvent | PointerEvent
|
|
@@ -107,7 +107,7 @@ export interface PopsIframeDetails extends PopsTitleConfig, PopsDragConfig, Pops
|
|
|
107
107
|
* 点击的回调函数
|
|
108
108
|
*/
|
|
109
109
|
callback: (
|
|
110
|
-
|
|
110
|
+
eventConfig: PopsEventConfig & {
|
|
111
111
|
iframeElement: HTMLIFrameElement;
|
|
112
112
|
},
|
|
113
113
|
event: MouseEvent | PointerEvent
|
|
@@ -132,7 +132,7 @@ export interface PopsIframeDetails extends PopsTitleConfig, PopsDragConfig, Pops
|
|
|
132
132
|
* 加载完毕的回调
|
|
133
133
|
*/
|
|
134
134
|
loadEndCallBack?: (
|
|
135
|
-
details:
|
|
135
|
+
details: PopsEventConfig & {
|
|
136
136
|
iframeElement: HTMLIFrameElement;
|
|
137
137
|
}
|
|
138
138
|
) => void;
|
|
@@ -56,15 +56,15 @@ export const PopsLoading = {
|
|
|
56
56
|
/**
|
|
57
57
|
* 遮罩层元素
|
|
58
58
|
*/
|
|
59
|
-
let $mask: HTMLDivElement |
|
|
59
|
+
let $mask: HTMLDivElement | undefined = void 0;
|
|
60
60
|
/**
|
|
61
61
|
* 已创建的元素列表
|
|
62
62
|
*/
|
|
63
|
-
const
|
|
63
|
+
const $elList: HTMLElement[] = [$anim];
|
|
64
64
|
|
|
65
65
|
if (config.mask.enable) {
|
|
66
66
|
// 创建遮罩层
|
|
67
|
-
const
|
|
67
|
+
const handleMask = PopsHandler.handleMask({
|
|
68
68
|
type: PopsType,
|
|
69
69
|
guid: guid,
|
|
70
70
|
|
|
@@ -72,11 +72,11 @@ export const PopsLoading = {
|
|
|
72
72
|
animElement: $anim,
|
|
73
73
|
maskHTML: maskHTML,
|
|
74
74
|
});
|
|
75
|
-
$mask =
|
|
76
|
-
|
|
75
|
+
$mask = handleMask.maskElement;
|
|
76
|
+
$elList.push($mask);
|
|
77
77
|
}
|
|
78
|
-
const
|
|
79
|
-
popsDOMUtils.append(config.parent,
|
|
78
|
+
const evtConfig = PopsHandler.handleLoadingEventConfig(config, guid, PopsType, $anim, $pops, $mask);
|
|
79
|
+
popsDOMUtils.append(config.parent, $elList);
|
|
80
80
|
if ($mask != null) {
|
|
81
81
|
$anim.after($mask);
|
|
82
82
|
}
|
|
@@ -93,7 +93,7 @@ export const PopsLoading = {
|
|
|
93
93
|
popsDOMUtils.css($anim, "position", "absolute !important");
|
|
94
94
|
$mask && popsDOMUtils.css($mask, "position", "absolute !important");
|
|
95
95
|
}
|
|
96
|
-
const result = PopsHandler.
|
|
96
|
+
const result = PopsHandler.handleResultConfig(evtConfig);
|
|
97
97
|
return result;
|
|
98
98
|
},
|
|
99
99
|
};
|
|
@@ -278,6 +278,9 @@ section.pops-panel-container .pops-panel-forms-fold .pops-panel-forms-container-
|
|
|
278
278
|
.pops[type-value="panel"] section.pops-panel-container > ul > li div:nth-child(2) {
|
|
279
279
|
max-width: 55%;
|
|
280
280
|
}
|
|
281
|
+
.pops[type-value="panel"] section.pops-panel-container > ul > li .pops-panel-input span.pops-panel-input__suffix {
|
|
282
|
+
padding: 0 4px;
|
|
283
|
+
}
|
|
281
284
|
.pops[type-value="panel"] section.pops-panel-container .pops-panel-select select {
|
|
282
285
|
min-width: 88px !important;
|
|
283
286
|
width: -webkit-fill-available;
|
|
@@ -668,6 +671,7 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
668
671
|
background-color: var(--pops-panel-components-input-bg-color);
|
|
669
672
|
position: relative;
|
|
670
673
|
box-shadow: none;
|
|
674
|
+
width: 200px;
|
|
671
675
|
}
|
|
672
676
|
.pops-panel-input:hover {
|
|
673
677
|
border: 1px solid var(--pops-panel-components-input-hover-bd-color);
|
|
@@ -724,7 +728,7 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
724
728
|
transition: all 0.3s;
|
|
725
729
|
pointer-events: none;
|
|
726
730
|
padding: 0 8px;
|
|
727
|
-
position:
|
|
731
|
+
position: relative;
|
|
728
732
|
right: 0px;
|
|
729
733
|
border-top-right-radius: 4px;
|
|
730
734
|
border-bottom-right-radius: 4px;
|
|
@@ -746,6 +750,13 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
746
750
|
.pops-panel-input:active span.pops-panel-input__suffix:has(svg[data-type="circleClose"]) {
|
|
747
751
|
display: inline-flex;
|
|
748
752
|
}
|
|
753
|
+
/* 当清空图标显示时,则隐藏输入框的padding-right */
|
|
754
|
+
.pops-panel-input:hover:has(span.pops-panel-input__suffix svg[data-type="circleClose"]) input,
|
|
755
|
+
.pops-panel-input:focus:has(span.pops-panel-input__suffix svg[data-type="circleClose"]) input,
|
|
756
|
+
.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 {
|
|
758
|
+
padding-right: 0;
|
|
759
|
+
}
|
|
749
760
|
.pops-panel-input .pops-panel-icon {
|
|
750
761
|
cursor: pointer;
|
|
751
762
|
}
|
|
@@ -129,41 +129,41 @@ export const PopsPanel = {
|
|
|
129
129
|
/**
|
|
130
130
|
* 遮罩层元素
|
|
131
131
|
*/
|
|
132
|
-
let $mask: HTMLDivElement |
|
|
132
|
+
let $mask: HTMLDivElement | undefined = void 0;
|
|
133
133
|
/**
|
|
134
134
|
* 已创建的元素列表
|
|
135
135
|
*/
|
|
136
|
-
const
|
|
136
|
+
const $elList: HTMLElement[] = [$anim];
|
|
137
137
|
|
|
138
138
|
/* 遮罩层元素 */
|
|
139
139
|
if (config.mask.enable) {
|
|
140
|
-
const
|
|
140
|
+
const handleMask = PopsHandler.handleMask({
|
|
141
141
|
type: popsType,
|
|
142
142
|
guid: guid,
|
|
143
143
|
config: config,
|
|
144
144
|
animElement: $anim,
|
|
145
145
|
maskHTML: maskHTML,
|
|
146
146
|
});
|
|
147
|
-
$mask = maskElement;
|
|
148
|
-
|
|
147
|
+
$mask = handleMask.maskElement;
|
|
148
|
+
$elList.push($mask);
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
/* 处理返回的配置 */
|
|
152
|
-
const
|
|
152
|
+
const evtConfig = PopsHandler.handleEventConfig(
|
|
153
|
+
config,
|
|
153
154
|
guid,
|
|
154
155
|
$shadowContainer,
|
|
155
156
|
$shadowRoot,
|
|
156
157
|
popsType,
|
|
157
158
|
$anim,
|
|
158
159
|
$pops,
|
|
159
|
-
$mask
|
|
160
|
-
config
|
|
160
|
+
$mask
|
|
161
161
|
);
|
|
162
162
|
/* 为顶部右边的关闭按钮添加点击事件 */
|
|
163
|
-
PopsHandler.handleClickEvent("close", $headerBtnClose,
|
|
163
|
+
PopsHandler.handleClickEvent("close", $headerBtnClose, evtConfig, config.btn?.close?.callback);
|
|
164
164
|
|
|
165
165
|
/* 创建到页面中 */
|
|
166
|
-
popsDOMUtils.append($shadowRoot,
|
|
166
|
+
popsDOMUtils.append($shadowRoot, $elList);
|
|
167
167
|
if (typeof config.beforeAppendToPageCallBack === "function") {
|
|
168
168
|
config.beforeAppendToPageCallBack($shadowRoot, $shadowContainer);
|
|
169
169
|
}
|
|
@@ -209,7 +209,7 @@ export const PopsPanel = {
|
|
|
209
209
|
endCallBack: config.dragEndCallBack,
|
|
210
210
|
});
|
|
211
211
|
}
|
|
212
|
-
const result = PopsHandler.
|
|
212
|
+
const result = PopsHandler.handleResultConfig(evtConfig);
|
|
213
213
|
|
|
214
214
|
return {
|
|
215
215
|
...result,
|
|
@@ -104,76 +104,75 @@ export const PopsPrompt = {
|
|
|
104
104
|
/**
|
|
105
105
|
* 遮罩层元素
|
|
106
106
|
*/
|
|
107
|
-
let $mask: HTMLDivElement |
|
|
107
|
+
let $mask: HTMLDivElement | undefined = void 0;
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
110
|
* 已创建的元素列表
|
|
111
111
|
*/
|
|
112
|
-
const
|
|
112
|
+
const $elList: HTMLElement[] = [$anim];
|
|
113
113
|
|
|
114
114
|
if (config.mask.enable) {
|
|
115
115
|
// 启用遮罩层
|
|
116
|
-
const
|
|
116
|
+
const handleMask = PopsHandler.handleMask({
|
|
117
117
|
type: popsType,
|
|
118
118
|
guid: guid,
|
|
119
119
|
config: config,
|
|
120
120
|
animElement: $anim,
|
|
121
121
|
maskHTML: maskHTML,
|
|
122
122
|
});
|
|
123
|
-
$mask =
|
|
124
|
-
|
|
123
|
+
$mask = handleMask.maskElement;
|
|
124
|
+
$elList.push($mask);
|
|
125
125
|
}
|
|
126
|
-
const
|
|
126
|
+
const evtConfig = PopsHandler.handleEventConfig(
|
|
127
|
+
config,
|
|
127
128
|
guid,
|
|
128
129
|
$shadowContainer,
|
|
129
130
|
$shadowRoot,
|
|
130
131
|
popsType,
|
|
131
132
|
$anim,
|
|
132
|
-
|
|
133
|
-
$
|
|
134
|
-
$mask!,
|
|
135
|
-
config
|
|
133
|
+
$pops,
|
|
134
|
+
$mask
|
|
136
135
|
);
|
|
137
136
|
/* 输入框赋值初始值 */
|
|
138
137
|
|
|
139
|
-
$input
|
|
138
|
+
$input.value = config.content.text;
|
|
140
139
|
PopsHandler.handlePromptClickEvent(
|
|
141
140
|
"close",
|
|
142
|
-
$input
|
|
143
|
-
$btnClose
|
|
144
|
-
|
|
141
|
+
$input,
|
|
142
|
+
$btnClose,
|
|
143
|
+
evtConfig,
|
|
145
144
|
|
|
146
|
-
config.btn.close
|
|
145
|
+
config.btn.close.callback
|
|
147
146
|
);
|
|
148
147
|
|
|
149
148
|
PopsHandler.handlePromptClickEvent(
|
|
150
149
|
"ok",
|
|
151
|
-
$input
|
|
152
|
-
$btnOk
|
|
153
|
-
|
|
150
|
+
$input,
|
|
151
|
+
$btnOk,
|
|
152
|
+
evtConfig,
|
|
154
153
|
|
|
155
|
-
config.btn.ok
|
|
154
|
+
config.btn.ok.callback
|
|
156
155
|
);
|
|
157
156
|
PopsHandler.handlePromptClickEvent(
|
|
158
157
|
"cancel",
|
|
159
|
-
$input
|
|
160
|
-
$btnCancel
|
|
161
|
-
|
|
158
|
+
$input,
|
|
159
|
+
$btnCancel,
|
|
160
|
+
evtConfig,
|
|
162
161
|
|
|
163
|
-
config.btn.cancel
|
|
162
|
+
config.btn.cancel.callback
|
|
164
163
|
);
|
|
165
164
|
|
|
166
165
|
PopsHandler.handlePromptClickEvent(
|
|
167
166
|
"other",
|
|
168
|
-
$input
|
|
169
|
-
$btnOther
|
|
170
|
-
|
|
167
|
+
$input,
|
|
168
|
+
$btnOther,
|
|
169
|
+
evtConfig,
|
|
171
170
|
|
|
172
|
-
config.btn.other
|
|
171
|
+
config.btn.other.callback
|
|
173
172
|
);
|
|
174
173
|
/* 创建到页面中 */
|
|
175
174
|
|
|
176
|
-
popsDOMUtils.append($shadowRoot,
|
|
175
|
+
popsDOMUtils.append($shadowRoot, $elList);
|
|
177
176
|
if (typeof config.beforeAppendToPageCallBack === "function") {
|
|
178
177
|
config.beforeAppendToPageCallBack($shadowRoot, $shadowContainer);
|
|
179
178
|
}
|
|
@@ -210,7 +209,7 @@ export const PopsPrompt = {
|
|
|
210
209
|
if (config.content.select) {
|
|
211
210
|
$input.select();
|
|
212
211
|
}
|
|
213
|
-
const result = PopsHandler.
|
|
212
|
+
const result = PopsHandler.handleResultConfig(evtConfig);
|
|
214
213
|
return result;
|
|
215
214
|
},
|
|
216
215
|
};
|