@whitesev/pops 2.0.3 → 2.0.4

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.
@@ -158,9 +158,9 @@ declare class Pops {
158
158
  getMaxZIndex(deviation?: number): number;
159
159
  getKeyFrames(sheet: CSSStyleSheet): {};
160
160
  removeInstance(moreLayerConfigList: PopsLayerCommonConfig[][], guid: string, isAll?: boolean): PopsLayerCommonConfig[][];
161
- hide(popsType: PopsLayerMode, layerConfigList: PopsLayerCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement, maskElement: HTMLElement): void;
162
- show(popsType: PopsLayerMode, layerConfigList: PopsLayerCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement, maskElement: HTMLElement): void;
163
- close(popsType: string, layerConfigList: PopsLayerCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement): void;
161
+ hide(popsType: PopsLayerMode, layerConfigList: PopsLayerCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement, maskElement: HTMLElement): Promise<void>;
162
+ show(popsType: PopsLayerMode, layerConfigList: PopsLayerCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement, maskElement?: HTMLElement): Promise<void>;
163
+ close(popsType: string, layerConfigList: PopsLayerCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement): Promise<void>;
164
164
  drag(moveElement: HTMLElement, options: {
165
165
  dragElement: HTMLElement;
166
166
  limit: boolean;
@@ -40,7 +40,7 @@ export interface PopsSearchSuggestionDetails<T = any> extends Pick<PopsCommonCon
40
40
  */
41
41
  className?: string;
42
42
  /**
43
- * position是否使用absolut
43
+ * position是否使用absolut,否则是relative
44
44
  * @default true
45
45
  */
46
46
  isAbsolute?: boolean;
@@ -48,9 +48,9 @@ export interface PopsEventDetails {
48
48
  /** 当前弹窗类型 */
49
49
  mode: mode;
50
50
  guid: guid;
51
- close: () => void;
52
- hide: () => void;
53
- show: () => void;
51
+ close: () => Promise<void>;
52
+ hide: () => Promise<void>;
53
+ show: () => Promise<void>;
54
54
  }
55
55
 
56
56
  /**
@@ -26,7 +26,7 @@ export interface PopsMaskDetails {
26
26
  */
27
27
  clickCallBack?:
28
28
  | ((
29
- originalRun: () => void,
29
+ originalRun: () => void | Promise<void>,
30
30
  config:
31
31
  | PopsAlertDetails
32
32
  | PopsDrawerDetails
@@ -64,7 +64,7 @@ export declare const PopsInstanceUtils: {
64
64
  * @param animElement
65
65
  * @param maskElement
66
66
  */
67
- hide(popsType: PopsLayerMode, layerConfigList: PopsLayerCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement, maskElement: HTMLElement): void;
67
+ hide(popsType: PopsLayerMode, layerConfigList: PopsLayerCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement, maskElement: HTMLElement): Promise<void>;
68
68
  /**
69
69
  * 显示
70
70
  * @param popsType
@@ -74,7 +74,7 @@ export declare const PopsInstanceUtils: {
74
74
  * @param animElement
75
75
  * @param maskElement
76
76
  */
77
- show(popsType: PopsLayerMode, layerConfigList: PopsLayerCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement, maskElement: HTMLElement): void;
77
+ show(popsType: PopsLayerMode, layerConfigList: PopsLayerCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement, maskElement?: HTMLElement): Promise<void>;
78
78
  /**
79
79
  * 关闭
80
80
  * @param popsType
@@ -83,7 +83,7 @@ export declare const PopsInstanceUtils: {
83
83
  * @param config
84
84
  * @param animElement
85
85
  */
86
- close(popsType: string, layerConfigList: PopsLayerCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement): void;
86
+ close(popsType: string, layerConfigList: PopsLayerCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement): Promise<void>;
87
87
  /**
88
88
  * 拖拽元素
89
89
  * 说明:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whitesev/pops",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "弹窗库",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
package/src/Pops.ts CHANGED
@@ -84,7 +84,7 @@ class Pops {
84
84
  /** 配置 */
85
85
  config = {
86
86
  /** 版本号 */
87
- version: "2025.5.1",
87
+ version: "2025.5.12",
88
88
  cssText: {
89
89
  /** 主CSS */
90
90
  index: indexCSS,
@@ -79,6 +79,9 @@ export class PopsLoading {
79
79
  maskHTML: maskHTML,
80
80
  });
81
81
  $mask = _handleMask_.maskElement;
82
+ // 遮罩层必须是跟随主内容
83
+ // 即设置主内容position: relative,mask:position: absolute
84
+ popsDOMUtils.css($mask, "position", "absolute !important");
82
85
  elementList.push($mask);
83
86
  }
84
87
  let eventDetails = PopsHandler.handleLoadingEventDetails(
@@ -46,7 +46,7 @@ export interface PopsSearchSuggestionDetails<T = any>
46
46
  */
47
47
  className?: string;
48
48
  /**
49
- * position是否使用absolut
49
+ * position是否使用absolut,否则是relative
50
50
  * @default true
51
51
  */
52
52
  isAbsolute?: boolean;
@@ -99,9 +99,7 @@ export const PopsHandler = {
99
99
  animElement: HTMLElement;
100
100
  maskHTML: string;
101
101
  }
102
- ): {
103
- maskElement: HTMLDivElement;
104
- } {
102
+ ) {
105
103
  let result = {
106
104
  maskElement: popsUtils.parseTextToDOM<HTMLDivElement>(details.maskHTML),
107
105
  };
@@ -117,7 +115,7 @@ export const PopsHandler = {
117
115
  function originalRun() {
118
116
  if (details.config.mask!.clickEvent!.toClose) {
119
117
  /* 关闭 */
120
- PopsInstanceUtils.close(
118
+ return PopsInstanceUtils.close(
121
119
  details.type,
122
120
  targetLayer,
123
121
  details.guid,
@@ -126,7 +124,7 @@ export const PopsHandler = {
126
124
  );
127
125
  } else if (details.config.mask!.clickEvent!.toHide) {
128
126
  /* 隐藏 */
129
- PopsInstanceUtils.hide(
127
+ return PopsInstanceUtils.hide(
130
128
  details.type,
131
129
  targetLayer,
132
130
  details.guid,
@@ -400,7 +398,7 @@ export const PopsHandler = {
400
398
  mode: mode,
401
399
  guid: guid,
402
400
  close() {
403
- PopsInstanceUtils.close(
401
+ return PopsInstanceUtils.close(
404
402
  mode,
405
403
  pops.config.layer[mode],
406
404
  guid,
@@ -409,7 +407,7 @@ export const PopsHandler = {
409
407
  );
410
408
  },
411
409
  hide() {
412
- PopsInstanceUtils.hide(
410
+ return PopsInstanceUtils.hide(
413
411
  mode,
414
412
  pops.config.layer[mode],
415
413
  guid,
@@ -419,7 +417,7 @@ export const PopsHandler = {
419
417
  );
420
418
  },
421
419
  show() {
422
- PopsInstanceUtils.show(
420
+ return PopsInstanceUtils.show(
423
421
  mode,
424
422
  pops.config.layer[mode],
425
423
  guid,
@@ -463,7 +461,7 @@ export const PopsHandler = {
463
461
  mode: mode,
464
462
  guid: guid,
465
463
  close() {
466
- PopsInstanceUtils.close(
464
+ return PopsInstanceUtils.close(
467
465
  mode,
468
466
  pops.config.layer[mode],
469
467
  guid,
@@ -472,7 +470,7 @@ export const PopsHandler = {
472
470
  );
473
471
  },
474
472
  hide() {
475
- PopsInstanceUtils.hide(
473
+ return PopsInstanceUtils.hide(
476
474
  mode,
477
475
  pops.config.layer[mode],
478
476
  guid,
@@ -482,7 +480,7 @@ export const PopsHandler = {
482
480
  );
483
481
  },
484
482
  show() {
485
- PopsInstanceUtils.show(
483
+ return PopsInstanceUtils.show(
486
484
  mode,
487
485
  pops.config.layer[mode],
488
486
  guid,
@@ -48,9 +48,9 @@ export interface PopsEventDetails {
48
48
  /** 当前弹窗类型 */
49
49
  mode: mode;
50
50
  guid: guid;
51
- close: () => void;
52
- hide: () => void;
53
- show: () => void;
51
+ close: () => Promise<void>;
52
+ hide: () => Promise<void>;
53
+ show: () => Promise<void>;
54
54
  }
55
55
 
56
56
  /**
@@ -26,7 +26,7 @@ export interface PopsMaskDetails {
26
26
  */
27
27
  clickCallBack?:
28
28
  | ((
29
- originalRun: () => void,
29
+ originalRun: () => void | Promise<void>,
30
30
  config:
31
31
  | PopsAlertDetails
32
32
  | PopsDrawerDetails
@@ -1569,32 +1569,34 @@ class PopsDOMUtils extends PopsDOMUtilsEvent {
1569
1569
  if (element == null) {
1570
1570
  return;
1571
1571
  }
1572
+ let setStyleProperty = (
1573
+ propertyName: string,
1574
+ propertyValue: string | number
1575
+ ) => {
1576
+ if (
1577
+ typeof propertyValue === "string" &&
1578
+ propertyValue.trim().endsWith("!important")
1579
+ ) {
1580
+ propertyValue = propertyValue
1581
+ .trim()
1582
+ .replace(/!important$/gi, "")
1583
+ .trim();
1584
+ element.style.setProperty(propertyName, propertyValue, "important");
1585
+ } else {
1586
+ propertyValue = handlePixe(propertyName, propertyValue);
1587
+ element.style.setProperty(propertyName, propertyValue);
1588
+ }
1589
+ };
1572
1590
  if (typeof property === "string") {
1573
1591
  if (value == null) {
1574
1592
  return getComputedStyle(element).getPropertyValue(property);
1575
1593
  } else {
1576
- if (value === "string" && value.includes("!important")) {
1577
- element.style.setProperty(property, value, "important");
1578
- } else {
1579
- value = handlePixe(property, value);
1580
- element.style.setProperty(property, value);
1581
- }
1594
+ setStyleProperty(property, value);
1582
1595
  }
1583
1596
  } else if (typeof property === "object") {
1584
1597
  for (let prop in property) {
1585
- if (
1586
- typeof property[prop] === "string" &&
1587
- (property[prop] as string).includes("!important")
1588
- ) {
1589
- element.style.setProperty(
1590
- prop,
1591
- property[prop] as string,
1592
- "important"
1593
- );
1594
- } else {
1595
- property[prop] = handlePixe(prop, property[prop] as string);
1596
- element.style.setProperty(prop, property[prop] as string);
1597
- }
1598
+ let value = property[prop];
1599
+ setStyleProperty(prop, value!);
1598
1600
  }
1599
1601
  }
1600
1602
  }
@@ -268,24 +268,29 @@ export const PopsInstanceUtils = {
268
268
  animElement: HTMLElement,
269
269
  maskElement: HTMLElement
270
270
  ) {
271
- let popsElement =
272
- animElement.querySelector<HTMLDivElement>(".pops[type-value]")!;
273
- if (popsType === "drawer") {
274
- let drawerConfig = config as Required<PopsDrawerDetails>;
275
- setTimeout(() => {
276
- maskElement.style.setProperty("display", "none");
277
- if (["top", "bottom"].includes(drawerConfig.direction)) {
278
- popsElement.style.setProperty("height", "0");
279
- } else if (["left", "right"].includes(drawerConfig.direction)) {
280
- popsElement.style.setProperty("width", "0");
281
- } else {
282
- console.error("未知direction:", drawerConfig.direction);
283
- }
284
- }, drawerConfig.closeDelay);
285
- } else {
286
- layerConfigList.forEach((layerConfigItem) => {
287
- if (layerConfigItem.guid === guid) {
271
+ return new Promise<void>((resolve) => {
272
+ let popsElement =
273
+ animElement.querySelector<HTMLDivElement>(".pops[type-value]")!;
274
+ if (popsType === "drawer") {
275
+ let drawerConfig = config as Required<PopsDrawerDetails>;
276
+ setTimeout(() => {
277
+ maskElement.style.setProperty("display", "none");
278
+ if (["top", "bottom"].includes(drawerConfig.direction)) {
279
+ popsElement.style.setProperty("height", "0");
280
+ } else if (["left", "right"].includes(drawerConfig.direction)) {
281
+ popsElement.style.setProperty("width", "0");
282
+ } else {
283
+ console.error("未知direction:", drawerConfig.direction);
284
+ }
285
+ resolve();
286
+ }, drawerConfig.closeDelay);
287
+ } else {
288
+ let findLayerIns = layerConfigList.find(
289
+ (layerConfigItem) => layerConfigItem.guid === guid
290
+ );
291
+ if (findLayerIns) {
288
292
  /* 存在动画 */
293
+ let layerConfigItem = findLayerIns;
289
294
  layerConfigItem.animElement.style.width = "100%";
290
295
  layerConfigItem.animElement.style.height = "100%";
291
296
  (layerConfigItem.animElement.style as any)["animation-name"] =
@@ -295,6 +300,9 @@ export const PopsInstanceUtils = {
295
300
  (layerConfigItem.animElement.style as any)["animation-name"]
296
301
  )
297
302
  ) {
303
+ /**
304
+ * 动画结束的回调
305
+ */
298
306
  function animationendCallBack() {
299
307
  layerConfigItem.animElement.style.display = "none";
300
308
  if (layerConfigItem.maskElement) {
@@ -308,6 +316,7 @@ export const PopsInstanceUtils = {
308
316
  capture: true,
309
317
  }
310
318
  );
319
+ resolve();
311
320
  }
312
321
  popsDOMUtils.on(
313
322
  layerConfigItem.animElement,
@@ -322,14 +331,13 @@ export const PopsInstanceUtils = {
322
331
  if (layerConfigItem.maskElement) {
323
332
  layerConfigItem.maskElement.style.display = "none";
324
333
  }
325
- }
326
334
 
327
- return;
335
+ resolve();
336
+ }
328
337
  }
329
- });
330
- }
338
+ }
339
+ });
331
340
  },
332
-
333
341
  /**
334
342
  * 显示
335
343
  * @param popsType
@@ -353,27 +361,32 @@ export const PopsInstanceUtils = {
353
361
  | PopsPanelDetails
354
362
  | PopsFolderDetails,
355
363
  animElement: HTMLElement,
356
- maskElement: HTMLElement
364
+ maskElement?: HTMLElement
357
365
  ) {
358
- let popsElement =
359
- animElement.querySelector<HTMLDivElement>(".pops[type-value]")!;
360
- if (popsType === "drawer") {
361
- let drawerConfig = config as PopsDrawerDetails;
362
- setTimeout(() => {
363
- maskElement.style.setProperty("display", "");
364
- let direction = drawerConfig.direction!;
365
- let size = drawerConfig.size!.toString();
366
- if (["top", "bottom"].includes(direction)) {
367
- popsElement.style.setProperty("height", size);
368
- } else if (["left", "right"].includes(direction)) {
369
- popsElement.style.setProperty("width", size);
370
- } else {
371
- console.error("未知direction:", direction);
372
- }
373
- }, drawerConfig.openDelay);
374
- } else {
375
- layerConfigList.forEach((layerConfigItem) => {
376
- if (layerConfigItem.guid === guid) {
366
+ return new Promise<void>((resolve) => {
367
+ let popsElement =
368
+ animElement.querySelector<HTMLDivElement>(".pops[type-value]")!;
369
+ if (popsType === "drawer") {
370
+ let drawerConfig = config as PopsDrawerDetails;
371
+ setTimeout(() => {
372
+ popsDOMUtils.css(maskElement!, "display", "");
373
+ let direction = drawerConfig.direction!;
374
+ let size = drawerConfig.size!.toString();
375
+ if (["top", "bottom"].includes(direction)) {
376
+ popsElement.style.setProperty("height", size);
377
+ } else if (["left", "right"].includes(direction)) {
378
+ popsElement.style.setProperty("width", size);
379
+ } else {
380
+ console.error("未知direction:", direction);
381
+ }
382
+ resolve();
383
+ }, drawerConfig.openDelay);
384
+ } else {
385
+ let findLayerIns = layerConfigList.find(
386
+ (layerConfigItem) => layerConfigItem.guid === guid
387
+ );
388
+ if (findLayerIns) {
389
+ let layerConfigItem = findLayerIns;
377
390
  layerConfigItem.animElement.style.width = "";
378
391
  layerConfigItem.animElement.style.height = "";
379
392
  (layerConfigItem.animElement.style as any)["animation-name"] =
@@ -385,10 +398,9 @@ export const PopsInstanceUtils = {
385
398
  (layerConfigItem.animElement.style as any)["animation-name"]
386
399
  )
387
400
  ) {
388
- layerConfigItem.animElement.style.display = "";
389
- if (layerConfigItem.maskElement) {
390
- layerConfigItem.maskElement.style.display = "";
391
- }
401
+ /**
402
+ * 动画结束的回调
403
+ */
392
404
  function animationendCallBack() {
393
405
  popsDOMUtils.off(
394
406
  layerConfigItem.animElement,
@@ -398,6 +410,11 @@ export const PopsInstanceUtils = {
398
410
  capture: true,
399
411
  }
400
412
  );
413
+ resolve();
414
+ }
415
+ layerConfigItem.animElement.style.display = "";
416
+ if (layerConfigItem.maskElement) {
417
+ layerConfigItem.maskElement.style.display = "";
401
418
  }
402
419
  popsDOMUtils.on(
403
420
  layerConfigItem.animElement,
@@ -412,11 +429,11 @@ export const PopsInstanceUtils = {
412
429
  if (layerConfigItem.maskElement) {
413
430
  layerConfigItem.maskElement.style.display = "";
414
431
  }
432
+ resolve();
415
433
  }
416
434
  }
417
- return;
418
- });
419
- }
435
+ }
436
+ });
420
437
  },
421
438
  /**
422
439
  * 关闭
@@ -441,61 +458,68 @@ export const PopsInstanceUtils = {
441
458
  | PopsFolderDetails,
442
459
  animElement: HTMLElement
443
460
  ) {
444
- let popsElement =
445
- animElement.querySelector<HTMLDivElement>(".pops[type-value]")!;
446
- let drawerConfig = config as Required<PopsDrawerDetails>;
447
- /**
448
- * 动画结束事件
449
- */
450
- function transitionendEvent() {
451
- function closeCallBack(event: Event) {
452
- if ((event as TransitionEvent).propertyName !== "transform") {
453
- return;
461
+ return new Promise<void>((resolve) => {
462
+ let popsElement =
463
+ animElement.querySelector<HTMLDivElement>(".pops[type-value]")!;
464
+ let drawerConfig = config as Required<PopsDrawerDetails>;
465
+ /**
466
+ * 动画结束事件
467
+ */
468
+ function transitionendEvent() {
469
+ /**
470
+ * 弹窗已关闭的回调
471
+ */
472
+ function closeCallBack(event: Event) {
473
+ if ((event as TransitionEvent).propertyName !== "transform") {
474
+ return;
475
+ }
476
+ popsDOMUtils.off(
477
+ popsElement,
478
+ popsDOMUtils.getTransitionEndNameList(),
479
+ void 0,
480
+ closeCallBack
481
+ );
482
+ PopsInstanceUtils.removeInstance([layerConfigList], guid);
483
+ resolve();
454
484
  }
455
- popsDOMUtils.off(
485
+ /* 监听过渡结束 */
486
+ popsDOMUtils.on(
456
487
  popsElement,
457
488
  popsDOMUtils.getTransitionEndNameList(),
458
- void 0,
459
489
  closeCallBack
460
490
  );
461
- PopsInstanceUtils.removeInstance([layerConfigList], guid);
462
- }
463
- /* 监听过渡结束 */
464
- popsDOMUtils.on(
465
- popsElement,
466
- popsDOMUtils.getTransitionEndNameList(),
467
- closeCallBack
468
- );
469
- let popsTransForm = getComputedStyle(popsElement).transform;
470
- if (popsTransForm !== "none") {
471
- popsDOMUtils.trigger(
472
- popsElement,
473
- popsDOMUtils.getTransitionEndNameList(),
474
- void 0,
475
- true
476
- );
477
- return;
491
+ let popsTransForm = getComputedStyle(popsElement).transform;
492
+ if (popsTransForm !== "none") {
493
+ popsDOMUtils.trigger(
494
+ popsElement,
495
+ popsDOMUtils.getTransitionEndNameList(),
496
+ void 0,
497
+ true
498
+ );
499
+ return;
500
+ }
501
+ if (["top"].includes(drawerConfig.direction)) {
502
+ popsElement.style.setProperty("transform", "translateY(-100%)");
503
+ } else if (["bottom"].includes(drawerConfig.direction)) {
504
+ popsElement.style.setProperty("transform", "translateY(100%)");
505
+ } else if (["left"].includes(drawerConfig.direction)) {
506
+ popsElement.style.setProperty("transform", "translateX(-100%)");
507
+ } else if (["right"].includes(drawerConfig.direction)) {
508
+ popsElement.style.setProperty("transform", "translateX(100%)");
509
+ } else {
510
+ console.error("未知direction:", drawerConfig.direction);
511
+ }
478
512
  }
479
- if (["top"].includes(drawerConfig.direction)) {
480
- popsElement.style.setProperty("transform", "translateY(-100%)");
481
- } else if (["bottom"].includes(drawerConfig.direction)) {
482
- popsElement.style.setProperty("transform", "translateY(100%)");
483
- } else if (["left"].includes(drawerConfig.direction)) {
484
- popsElement.style.setProperty("transform", "translateX(-100%)");
485
- } else if (["right"].includes(drawerConfig.direction)) {
486
- popsElement.style.setProperty("transform", "translateX(100%)");
513
+
514
+ if (popsType === "drawer") {
515
+ setTimeout(() => {
516
+ transitionendEvent();
517
+ }, drawerConfig.closeDelay);
487
518
  } else {
488
- console.error("未知direction:", drawerConfig.direction);
519
+ PopsInstanceUtils.removeInstance([layerConfigList], guid);
520
+ resolve();
489
521
  }
490
- }
491
-
492
- if (popsType === "drawer") {
493
- setTimeout(() => {
494
- transitionendEvent();
495
- }, drawerConfig.closeDelay);
496
- } else {
497
- PopsInstanceUtils.removeInstance([layerConfigList], guid);
498
- }
522
+ });
499
523
  },
500
524
  /**
501
525
  * 拖拽元素