@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.
Files changed (53) hide show
  1. package/dist/index.amd.js +158 -150
  2. package/dist/index.amd.js.map +1 -1
  3. package/dist/index.amd.min.js +1 -1
  4. package/dist/index.amd.min.js.map +1 -1
  5. package/dist/index.cjs.js +158 -150
  6. package/dist/index.cjs.js.map +1 -1
  7. package/dist/index.cjs.min.js +1 -1
  8. package/dist/index.cjs.min.js.map +1 -1
  9. package/dist/index.esm.js +158 -150
  10. package/dist/index.esm.js.map +1 -1
  11. package/dist/index.esm.min.js +1 -1
  12. package/dist/index.esm.min.js.map +1 -1
  13. package/dist/index.iife.js +158 -150
  14. package/dist/index.iife.js.map +1 -1
  15. package/dist/index.iife.min.js +1 -1
  16. package/dist/index.iife.min.js.map +1 -1
  17. package/dist/index.system.js +158 -150
  18. package/dist/index.system.js.map +1 -1
  19. package/dist/index.system.min.js +1 -1
  20. package/dist/index.system.min.js.map +1 -1
  21. package/dist/index.umd.js +158 -150
  22. package/dist/index.umd.js.map +1 -1
  23. package/dist/index.umd.min.js +1 -1
  24. package/dist/index.umd.min.js.map +1 -1
  25. package/dist/types/src/Pops.d.ts +14 -14
  26. package/dist/types/src/components/alert/index.d.ts +1 -1
  27. package/dist/types/src/components/confirm/index.d.ts +1 -1
  28. package/dist/types/src/components/drawer/index.d.ts +1 -1
  29. package/dist/types/src/components/folder/index.d.ts +1 -1
  30. package/dist/types/src/components/iframe/index.d.ts +2 -2
  31. package/dist/types/src/components/iframe/types/index.d.ts +6 -6
  32. package/dist/types/src/components/loading/index.d.ts +1 -1
  33. package/dist/types/src/components/panel/index.d.ts +4 -4
  34. package/dist/types/src/components/prompt/index.d.ts +1 -1
  35. package/dist/types/src/handler/PopsHandler.d.ts +18 -17
  36. package/dist/types/src/types/button.d.ts +4 -4
  37. package/dist/types/src/types/event.d.ts +7 -7
  38. package/dist/types/src/utils/PopsInstanceUtils.d.ts +8 -8
  39. package/package.json +5 -5
  40. package/src/components/alert/index.ts +13 -13
  41. package/src/components/confirm/index.ts +15 -16
  42. package/src/components/drawer/index.ts +22 -22
  43. package/src/components/folder/index.ts +14 -14
  44. package/src/components/iframe/index.ts +19 -20
  45. package/src/components/iframe/types/index.ts +6 -6
  46. package/src/components/loading/index.ts +8 -8
  47. package/src/components/panel/index.css +12 -1
  48. package/src/components/panel/index.ts +11 -11
  49. package/src/components/prompt/index.ts +28 -29
  50. package/src/handler/PopsHandler.ts +70 -68
  51. package/src/types/button.d.ts +4 -4
  52. package/src/types/event.d.ts +7 -7
  53. 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 | null = null;
103
+ let $mask: HTMLDivElement | undefined = void 0;
103
104
  /**
104
105
  * 已创建的元素列表
105
106
  */
106
- const elementList: HTMLElement[] = [$anim];
107
+ const $elList: HTMLElement[] = [$anim];
107
108
 
108
109
  if (config.mask.enable) {
109
- const _handleMask_ = PopsHandler.handleMask({
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 = _handleMask_.maskElement;
117
- elementList.push($mask);
117
+ $mask = handleMask.maskElement;
118
+ $elList.push($mask);
118
119
  }
119
- const eventDetails = PopsHandler.handleEventDetails(
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
- eventDetails.close();
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 as "close" | "cancel" | "ok" | "other",
181
- item.ele,
182
- eventDetails,
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
- elementList.forEach((element) => {
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, elementList);
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.handleResultDetails(eventDetails);
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 | null = null;
255
+ let $mask: HTMLDivElement | undefined = void 0;
256
256
  /**
257
257
  * 已创建的元素列表
258
258
  */
259
- const elementList: HTMLElement[] = [$anim];
259
+ const $elList: HTMLElement[] = [$anim];
260
260
 
261
261
  if (config.mask.enable) {
262
- const _handleMask_ = PopsHandler.handleMask({
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 = _handleMask_.maskElement;
270
- elementList.push($mask);
269
+ $mask = handleMask.maskElement;
270
+ $elList.push($mask);
271
271
  }
272
272
  /* 事件 */
273
- const eventDetails = PopsHandler.handleEventDetails(
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, eventDetails, config.btn.close!.callback!);
284
- PopsHandler.handleClickEvent("ok", btnOkElement, eventDetails, config.btn.ok!.callback!);
285
- PopsHandler.handleClickEvent("cancel", btnCancelElement, eventDetails, config.btn.cancel!.callback!);
286
- PopsHandler.handleClickEvent("other", btnOtherElement, eventDetails, config.btn.other!.callback!);
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, elementList);
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.handleResultDetails(eventDetails);
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 { PopsEventDetails } from "../../types/event";
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 | null = null;
118
+ let $mask: HTMLDivElement | undefined = void 0;
119
119
  /**
120
120
  * 已创建的元素列表
121
121
  */
122
- const elementList: HTMLElement[] = [$anim];
122
+ const $elList: HTMLElement[] = [$anim];
123
123
 
124
124
  if (config.mask.enable) {
125
- const _handleMask_ = PopsHandler.handleMask({
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 = _handleMask_.maskElement;
134
- elementList.push($mask);
133
+ $mask = handleMask.maskElement;
134
+ $elList.push($mask);
135
135
  }
136
136
 
137
- const eventDetails = PopsHandler.handleEventDetails(
137
+ const evtConfig = PopsHandler.handleEventConfig(
138
+ config,
138
139
  guid,
139
140
  $shadowContainer,
140
141
  $shadowRoot,
141
142
  popsType,
142
143
  $anim,
143
-
144
- $pops!,
145
- $mask!,
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
- eventDetails["iframeElement"] = $iframe!;
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(eventDetails);
172
+ config.loadEndCallBack(evtConfig);
174
173
  });
175
174
  /* 创建到页面中 */
176
175
 
177
- popsDOMUtils.append($shadowRoot, elementList);
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(eventDetails, event);
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(eventDetails, event);
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(eventDetails, event);
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(eventDetails, event);
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.handleResultDetails(eventDetails);
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 { PopsEventDetails } from "../../../types/event";
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
- eventDetails: PopsEventDetails & {
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
- eventDetails: PopsEventDetails & {
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
- eventDetails: PopsEventDetails & {
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
- eventDetails: PopsEventDetails & {
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: PopsEventDetails & {
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 | null = null;
59
+ let $mask: HTMLDivElement | undefined = void 0;
60
60
  /**
61
61
  * 已创建的元素列表
62
62
  */
63
- const elementList: HTMLElement[] = [$anim];
63
+ const $elList: HTMLElement[] = [$anim];
64
64
 
65
65
  if (config.mask.enable) {
66
66
  // 创建遮罩层
67
- const _handleMask_ = PopsHandler.handleMask({
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 = _handleMask_.maskElement;
76
- elementList.push($mask);
75
+ $mask = handleMask.maskElement;
76
+ $elList.push($mask);
77
77
  }
78
- const eventDetails = PopsHandler.handleLoadingEventDetails(guid, PopsType, $anim, $pops!, $mask!, config);
79
- popsDOMUtils.append(config.parent, elementList);
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.handleResultDetails(eventDetails);
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: absolute;
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 | null = null;
132
+ let $mask: HTMLDivElement | undefined = void 0;
133
133
  /**
134
134
  * 已创建的元素列表
135
135
  */
136
- const isCreatedElementList: HTMLElement[] = [$anim];
136
+ const $elList: HTMLElement[] = [$anim];
137
137
 
138
138
  /* 遮罩层元素 */
139
139
  if (config.mask.enable) {
140
- const { maskElement } = PopsHandler.handleMask({
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
- isCreatedElementList.push($mask);
147
+ $mask = handleMask.maskElement;
148
+ $elList.push($mask);
149
149
  }
150
150
 
151
151
  /* 处理返回的配置 */
152
- const eventDetails = PopsHandler.handleEventDetails(
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, eventDetails, config.btn.close!.callback!);
163
+ PopsHandler.handleClickEvent("close", $headerBtnClose, evtConfig, config.btn?.close?.callback);
164
164
 
165
165
  /* 创建到页面中 */
166
- popsDOMUtils.append($shadowRoot, isCreatedElementList);
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.handleResultDetails(eventDetails);
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 | null = null;
107
+ let $mask: HTMLDivElement | undefined = void 0;
108
108
 
109
109
  /**
110
110
  * 已创建的元素列表
111
111
  */
112
- const elementList: HTMLElement[] = [$anim];
112
+ const $elList: HTMLElement[] = [$anim];
113
113
 
114
114
  if (config.mask.enable) {
115
115
  // 启用遮罩层
116
- const _handleMask_ = PopsHandler.handleMask({
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 = _handleMask_.maskElement;
124
- elementList.push($mask);
123
+ $mask = handleMask.maskElement;
124
+ $elList.push($mask);
125
125
  }
126
- const eventDetails = PopsHandler.handleEventDetails(
126
+ const evtConfig = PopsHandler.handleEventConfig(
127
+ config,
127
128
  guid,
128
129
  $shadowContainer,
129
130
  $shadowRoot,
130
131
  popsType,
131
132
  $anim,
132
-
133
- $pops!,
134
- $mask!,
135
- config
133
+ $pops,
134
+ $mask
136
135
  );
137
136
  /* 输入框赋值初始值 */
138
137
 
139
- $input!.value = config.content.text;
138
+ $input.value = config.content.text;
140
139
  PopsHandler.handlePromptClickEvent(
141
140
  "close",
142
- $input!,
143
- $btnClose!,
144
- eventDetails,
141
+ $input,
142
+ $btnClose,
143
+ evtConfig,
145
144
 
146
- config.btn.close!.callback!
145
+ config.btn.close.callback
147
146
  );
148
147
 
149
148
  PopsHandler.handlePromptClickEvent(
150
149
  "ok",
151
- $input!,
152
- $btnOk!,
153
- eventDetails,
150
+ $input,
151
+ $btnOk,
152
+ evtConfig,
154
153
 
155
- config.btn.ok!.callback!
154
+ config.btn.ok.callback
156
155
  );
157
156
  PopsHandler.handlePromptClickEvent(
158
157
  "cancel",
159
- $input!,
160
- $btnCancel!,
161
- eventDetails,
158
+ $input,
159
+ $btnCancel,
160
+ evtConfig,
162
161
 
163
- config.btn.cancel!.callback!
162
+ config.btn.cancel.callback
164
163
  );
165
164
 
166
165
  PopsHandler.handlePromptClickEvent(
167
166
  "other",
168
- $input!,
169
- $btnOther!,
170
- eventDetails,
167
+ $input,
168
+ $btnOther,
169
+ evtConfig,
171
170
 
172
- config.btn.other!.callback!
171
+ config.btn.other.callback
173
172
  );
174
173
  /* 创建到页面中 */
175
174
 
176
- popsDOMUtils.append($shadowRoot, elementList);
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.handleResultDetails(eventDetails);
212
+ const result = PopsHandler.handleResultConfig(evtConfig);
214
213
  return result;
215
214
  },
216
215
  };