@whitesev/pops 2.0.10 → 2.0.12

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 (57) hide show
  1. package/dist/index.amd.js +4695 -4403
  2. package/dist/index.amd.js.map +1 -1
  3. package/dist/index.cjs.js +4695 -4403
  4. package/dist/index.cjs.js.map +1 -1
  5. package/dist/index.esm.js +4695 -4403
  6. package/dist/index.esm.js.map +1 -1
  7. package/dist/index.iife.js +4695 -4403
  8. package/dist/index.iife.js.map +1 -1
  9. package/dist/index.system.js +4695 -4403
  10. package/dist/index.system.js.map +1 -1
  11. package/dist/index.umd.js +4695 -4403
  12. package/dist/index.umd.js.map +1 -1
  13. package/dist/types/src/Pops.d.ts +66 -42
  14. package/dist/types/src/PopsAnimation.d.ts +14 -0
  15. package/dist/types/src/PopsCSS.d.ts +34 -0
  16. package/dist/types/src/PopsIcon.d.ts +25 -0
  17. package/dist/types/src/PopsLayer.d.ts +3 -0
  18. package/dist/types/src/components/panel/buttonType.d.ts +2 -2
  19. package/dist/types/src/components/rightClickMenu/index.d.ts +2 -3
  20. package/dist/types/src/components/rightClickMenu/indexType.d.ts +4 -3
  21. package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +19 -6
  22. package/dist/types/src/types/button.d.ts +3 -3
  23. package/dist/types/src/types/icon.d.ts +1 -1
  24. package/dist/types/src/utils/PopsDOMUtils.d.ts +120 -26
  25. package/dist/types/src/utils/PopsInstanceUtils.d.ts +0 -6
  26. package/dist/types/src/utils/PopsUtils.d.ts +5 -6
  27. package/package.json +1 -1
  28. package/src/Pops.ts +12 -152
  29. package/src/PopsAnimation.ts +32 -0
  30. package/src/PopsCSS.ts +51 -0
  31. package/src/PopsIcon.ts +93 -0
  32. package/src/PopsLayer.ts +17 -0
  33. package/src/components/alert/index.ts +8 -8
  34. package/src/components/confirm/index.ts +8 -8
  35. package/src/components/drawer/index.ts +8 -8
  36. package/src/components/folder/index.ts +15 -15
  37. package/src/components/iframe/index.ts +9 -12
  38. package/src/components/loading/index.ts +5 -5
  39. package/src/components/panel/PanelHandleContentDetails.ts +28 -25
  40. package/src/components/panel/buttonType.ts +2 -2
  41. package/src/components/panel/config.ts +4 -0
  42. package/src/components/panel/index.css +33 -0
  43. package/src/components/panel/index.ts +9 -9
  44. package/src/components/prompt/index.ts +8 -8
  45. package/src/components/rightClickMenu/config.ts +7 -7
  46. package/src/components/rightClickMenu/index.ts +41 -29
  47. package/src/components/rightClickMenu/indexType.ts +5 -3
  48. package/src/components/searchSuggestion/index.ts +5 -5
  49. package/src/components/tooltip/index.ts +5 -5
  50. package/src/handler/PopsElementHandler.ts +17 -17
  51. package/src/handler/PopsHandler.ts +22 -19
  52. package/src/types/PopsDOMUtilsEventType.d.ts +19 -6
  53. package/src/types/button.d.ts +3 -3
  54. package/src/types/icon.d.ts +1 -1
  55. package/src/utils/PopsDOMUtils.ts +568 -170
  56. package/src/utils/PopsInstanceUtils.ts +13 -31
  57. package/src/utils/PopsUtils.ts +7 -16
@@ -0,0 +1,93 @@
1
+ import type { PopsIconType } from "./types/icon";
2
+ import SVG_min from "./svg/min.svg";
3
+ import SVG_mise from "./svg/mise.svg";
4
+ import SVG_max from "./svg/max.svg";
5
+ import SVG_close from "./svg/close.svg";
6
+ import SVG_edit from "./svg/edit.svg";
7
+ import SVG_share from "./svg/share.svg";
8
+ import SVG_delete from "./svg/delete.svg";
9
+ import SVG_search from "./svg/search.svg";
10
+ import SVG_upload from "./svg/upload.svg";
11
+ import SVG_loading from "./svg/loading.svg";
12
+ import SVG_next from "./svg/next.svg";
13
+ import SVG_prev from "./svg/prev.svg";
14
+ import SVG_eleme from "./svg/eleme.svg";
15
+ import SVG_elemePlus from "./svg/elemePlus.svg";
16
+ import SVG_chromeFilled from "./svg/chromeFilled.svg";
17
+ import SVG_cpu from "./svg/cpu.svg";
18
+ import SVG_videoPlay from "./svg/videoPlay.svg";
19
+ import SVG_videoPause from "./svg/videoPause.svg";
20
+ import SVG_headset from "./svg/headset.svg";
21
+ import SVG_monitor from "./svg/monitor.svg";
22
+ import SVG_documentCopy from "./svg/documentCopy.svg";
23
+ import SVG_picture from "./svg/picture.svg";
24
+ import SVG_circleClose from "./svg/circleClose.svg";
25
+ import SVG_view from "./svg/view.svg";
26
+ import SVG_hide from "./svg/hide.svg";
27
+ import SVG_keyboard from "./svg/keyboard.svg";
28
+ import SVG_arrowRight from "./svg/arrowRight.svg";
29
+ import SVG_arrowLeft from "./svg/arrowLeft.svg";
30
+
31
+ export const PopsIcon = {
32
+ $data: {
33
+ min: SVG_min,
34
+ mise: SVG_mise,
35
+ max: SVG_max,
36
+ close: SVG_close,
37
+ edit: SVG_edit,
38
+ share: SVG_share,
39
+ delete: SVG_delete,
40
+ search: SVG_search,
41
+ upload: SVG_upload,
42
+ loading: SVG_loading,
43
+ next: SVG_next,
44
+ prev: SVG_prev,
45
+ eleme: SVG_eleme,
46
+ elemePlus: SVG_elemePlus,
47
+ chromeFilled: SVG_chromeFilled,
48
+ cpu: SVG_cpu,
49
+ videoPlay: SVG_videoPlay,
50
+ videoPause: SVG_videoPause,
51
+ headset: SVG_headset,
52
+ monitor: SVG_monitor,
53
+ documentCopy: SVG_documentCopy,
54
+ picture: SVG_picture,
55
+ circleClose: SVG_circleClose,
56
+ view: SVG_view,
57
+ hide: SVG_hide,
58
+ keyboard: SVG_keyboard,
59
+ arrowRight: SVG_arrowRight,
60
+ arrowLeft: SVG_arrowLeft,
61
+ } as {
62
+ [key in PopsIconType]: string;
63
+ },
64
+ /**
65
+ * 判断是否存在某个icon
66
+ * @param iconName 图标名
67
+ */
68
+ hasIcon(iconName: string) {
69
+ return Object.keys(PopsIcon.$data).includes(iconName);
70
+ },
71
+ /**
72
+ * 获取icon
73
+ * @param iconName 图标名
74
+ */
75
+ getIcon(iconName: string): string | null {
76
+ return PopsIcon.$data[iconName as keyof typeof this.$data];
77
+ },
78
+ /**
79
+ * 删除图标
80
+ * @param iconName 图标名
81
+ */
82
+ deleteIcon(iconName: string) {
83
+ return Reflect.deleteProperty(PopsIcon.$data, iconName);
84
+ },
85
+ /**
86
+ * 设置图标
87
+ * @param iconName 图标名
88
+ * @param iconHTML 图标html
89
+ */
90
+ setIcon(iconName: string, iconHTML: string) {
91
+ Reflect.set(PopsIcon.$data, iconName, iconHTML);
92
+ },
93
+ };
@@ -0,0 +1,17 @@
1
+ import type { PopsLayerCommonConfig } from "./types/layer";
2
+ import type { PopsLayerMode } from "./types/main";
3
+
4
+ export const PopsLayer = {
5
+ alert: [],
6
+ confirm: [],
7
+ prompt: [],
8
+ loading: [],
9
+ iframe: [],
10
+ tooltip: [],
11
+ drawer: [],
12
+ folder: [],
13
+ panel: [],
14
+ rightClickMenu: [],
15
+ } as {
16
+ [key in PopsLayerMode]: PopsLayerCommonConfig[];
17
+ };
@@ -1,13 +1,13 @@
1
1
  import { GlobalConfig } from "../../GlobalConfig";
2
2
  import { PopsElementHandler } from "../../handler/PopsElementHandler";
3
3
  import { PopsHandler } from "../../handler/PopsHandler";
4
- import { pops } from "../../Pops";
5
4
  import { popsDOMUtils } from "../../utils/PopsDOMUtils";
6
5
  import { PopsInstanceUtils } from "../../utils/PopsInstanceUtils";
7
6
  import { popsUtils } from "../../utils/PopsUtils";
8
7
  import { PopsAlertConfig } from "./config";
9
8
  import type { PopsMode } from "../../types/main";
10
9
  import type { PopsAlertDetails } from "./indexType";
10
+ import { PopsCSS } from "../../PopsCSS";
11
11
 
12
12
  export const PopsAlert = {
13
13
  init(details: PopsAlertDetails) {
@@ -21,13 +21,13 @@ export const PopsAlert = {
21
21
 
22
22
  const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
23
23
  PopsHandler.handleInit($shadowRoot, [
24
- pops.config.cssText.index,
25
- pops.config.cssText.ninePalaceGridPosition,
26
- pops.config.cssText.scrollbar,
27
- pops.config.cssText.button,
28
- pops.config.cssText.anim,
29
- pops.config.cssText.common,
30
- pops.config.cssText.alertCSS,
24
+ PopsCSS.index,
25
+ PopsCSS.ninePalaceGridPosition,
26
+ PopsCSS.scrollbar,
27
+ PopsCSS.button,
28
+ PopsCSS.anim,
29
+ PopsCSS.common,
30
+ PopsCSS.alertCSS,
31
31
  ]);
32
32
 
33
33
  // 先把z-index提取出来
@@ -1,7 +1,7 @@
1
1
  import { GlobalConfig } from "../../GlobalConfig";
2
2
  import { PopsElementHandler } from "../../handler/PopsElementHandler";
3
3
  import { PopsHandler } from "../../handler/PopsHandler";
4
- import { pops } from "../../Pops";
4
+ import { PopsCSS } from "../../PopsCSS";
5
5
  import { popsDOMUtils } from "../../utils/PopsDOMUtils";
6
6
  import { PopsInstanceUtils } from "../../utils/PopsInstanceUtils";
7
7
  import { popsUtils } from "../../utils/PopsUtils";
@@ -20,13 +20,13 @@ export const PopsConfirm = {
20
20
 
21
21
  const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
22
22
  PopsHandler.handleInit($shadowRoot, [
23
- pops.config.cssText.index,
24
- pops.config.cssText.ninePalaceGridPosition,
25
- pops.config.cssText.scrollbar,
26
- pops.config.cssText.button,
27
- pops.config.cssText.anim,
28
- pops.config.cssText.common,
29
- pops.config.cssText.confirmCSS,
23
+ PopsCSS.index,
24
+ PopsCSS.ninePalaceGridPosition,
25
+ PopsCSS.scrollbar,
26
+ PopsCSS.button,
27
+ PopsCSS.anim,
28
+ PopsCSS.common,
29
+ PopsCSS.confirmCSS,
30
30
  ]);
31
31
 
32
32
  // 先把z-index提取出来
@@ -1,7 +1,7 @@
1
1
  import { GlobalConfig } from "../../GlobalConfig";
2
2
  import { PopsElementHandler } from "../../handler/PopsElementHandler";
3
3
  import { PopsHandler } from "../../handler/PopsHandler";
4
- import { pops } from "../../Pops";
4
+ import { PopsCSS } from "../../PopsCSS";
5
5
  import { popsDOMUtils } from "../../utils/PopsDOMUtils";
6
6
  import { popsUtils } from "../../utils/PopsUtils";
7
7
  import { PopsDrawerConfig } from "./config";
@@ -19,13 +19,13 @@ export const PopsDrawer = {
19
19
 
20
20
  const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
21
21
  PopsHandler.handleInit($shadowRoot, [
22
- pops.config.cssText.index,
23
- pops.config.cssText.ninePalaceGridPosition,
24
- pops.config.cssText.scrollbar,
25
- pops.config.cssText.button,
26
- pops.config.cssText.anim,
27
- pops.config.cssText.common,
28
- pops.config.cssText.drawerCSS,
22
+ PopsCSS.index,
23
+ PopsCSS.ninePalaceGridPosition,
24
+ PopsCSS.scrollbar,
25
+ PopsCSS.button,
26
+ PopsCSS.anim,
27
+ PopsCSS.common,
28
+ PopsCSS.drawerCSS,
29
29
  ]);
30
30
 
31
31
  // 先把z-index提取出来
@@ -1,11 +1,12 @@
1
1
  import { GlobalConfig } from "../../GlobalConfig";
2
2
  import { PopsElementHandler } from "../../handler/PopsElementHandler";
3
3
  import { PopsHandler } from "../../handler/PopsHandler";
4
- import { pops } from "../../Pops";
4
+ import { PopsCSS } from "../../PopsCSS";
5
5
  import { popsDOMUtils } from "../../utils/PopsDOMUtils";
6
6
  import { PopsInstanceUtils } from "../../utils/PopsInstanceUtils";
7
7
  import { PopsSafeUtils } from "../../utils/PopsSafeUtils";
8
8
  import { popsUtils } from "../../utils/PopsUtils";
9
+ import { PopsLoading } from "../loading";
9
10
  import { PopsFolderConfig } from "./config";
10
11
  import { Folder_ICON } from "./folderIcon";
11
12
  import type { PopsFolderDataConfig, PopsFolderDetails } from "./indexType";
@@ -23,13 +24,13 @@ export const PopsFolder = {
23
24
 
24
25
  const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
25
26
  PopsHandler.handleInit($shadowRoot, [
26
- pops.config.cssText.index,
27
- pops.config.cssText.ninePalaceGridPosition,
28
- pops.config.cssText.scrollbar,
29
- pops.config.cssText.button,
30
- pops.config.cssText.anim,
31
- pops.config.cssText.common,
32
- pops.config.cssText.folderCSS,
27
+ PopsCSS.index,
28
+ PopsCSS.ninePalaceGridPosition,
29
+ PopsCSS.scrollbar,
30
+ PopsCSS.button,
31
+ PopsCSS.anim,
32
+ PopsCSS.common,
33
+ PopsCSS.folderCSS,
33
34
  ]);
34
35
 
35
36
  /* 办公几件套 */
@@ -129,7 +130,7 @@ export const PopsFolder = {
129
130
  : `<p pops style="${headerPStyle}">${config.title.text}</p>`
130
131
  }${headerBtnHTML}</div>
131
132
  <div class="pops-folder-content ${
132
- pops.isPhone() ? "pops-mobile-folder-content" : ""
133
+ popsUtils.isPhone() ? "pops-mobile-folder-content" : ""
133
134
  }">
134
135
  <div class="pops-folder-list">
135
136
  <div class="pops-folder-file-list-breadcrumb">
@@ -213,7 +214,7 @@ export const PopsFolder = {
213
214
  <table class="pops-folder-list-table__body">
214
215
  <colgroup>
215
216
  ${
216
- pops.isPhone()
217
+ popsUtils.isPhone()
217
218
  ? `<col width="100%">`
218
219
  : `
219
220
  <col width="52%">
@@ -572,9 +573,8 @@ export const PopsFolder = {
572
573
  } else {
573
574
  console.error("获取导航按钮失败");
574
575
  }
575
- let loadingMask = pops.loading({
576
+ let loadingMask = PopsLoading.init({
576
577
  parent: $content,
577
-
578
578
  content: {
579
579
  text: "获取文件列表中...",
580
580
  },
@@ -600,7 +600,7 @@ export const PopsFolder = {
600
600
  _config_: PopsFolderDataConfig
601
601
  ) {
602
602
  clearFolerRow();
603
- let loadingMask = pops.loading({
603
+ let loadingMask = PopsLoading.init({
604
604
  parent: $content,
605
605
 
606
606
  content: {
@@ -828,7 +828,7 @@ export const PopsFolder = {
828
828
  sortFolderConfig(_config_, config.sort.name, config.sort.isDesc);
829
829
  _config_.forEach((item) => {
830
830
  if (item["isFolder"]) {
831
- let { folderELement, fileNameElement } = pops.isPhone()
831
+ let { folderELement, fileNameElement } = popsUtils.isPhone()
832
832
  ? createMobileFolderRowElement(item["fileName"], "", "", true)
833
833
  : createFolderRowElement(item["fileName"], "", "", true);
834
834
 
@@ -842,7 +842,7 @@ export const PopsFolder = {
842
842
 
843
843
  folderListBodyElement.appendChild(folderELement);
844
844
  } else {
845
- let { folderELement, fileNameElement } = pops.isPhone()
845
+ let { folderELement, fileNameElement } = popsUtils.isPhone()
846
846
  ? createMobileFolderRowElement(
847
847
  item["fileName"],
848
848
  item.latestTime,
@@ -2,7 +2,8 @@ import { PopsCore } from "../../Core";
2
2
  import { GlobalConfig } from "../../GlobalConfig";
3
3
  import { PopsElementHandler } from "../../handler/PopsElementHandler";
4
4
  import { PopsHandler } from "../../handler/PopsHandler";
5
- import { pops } from "../../Pops";
5
+ import { PopsCSS } from "../../PopsCSS";
6
+ import { PopsLayer } from "../../PopsLayer";
6
7
  import type { PopsEventDetails } from "../../types/event";
7
8
  import { popsDOMUtils } from "../../utils/PopsDOMUtils";
8
9
  import { PopsInstanceUtils } from "../../utils/PopsInstanceUtils";
@@ -26,12 +27,12 @@ export const PopsIframe = {
26
27
 
27
28
  const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
28
29
  PopsHandler.handleInit($shadowRoot, [
29
- pops.config.cssText.index,
30
- pops.config.cssText.ninePalaceGridPosition,
31
- pops.config.cssText.scrollbar,
32
- pops.config.cssText.anim,
33
- pops.config.cssText.common,
34
- pops.config.cssText.iframeCSS,
30
+ PopsCSS.index,
31
+ PopsCSS.ninePalaceGridPosition,
32
+ PopsCSS.scrollbar,
33
+ PopsCSS.anim,
34
+ PopsCSS.common,
35
+ PopsCSS.iframeCSS,
35
36
  ]);
36
37
 
37
38
  let maskExtraStyle =
@@ -304,11 +305,7 @@ export const PopsIframe = {
304
305
  (event) => {
305
306
  event.preventDefault();
306
307
  event.stopPropagation();
307
- PopsInstanceUtils.removeInstance(
308
- [pops.config.layer.iframe],
309
- guid,
310
- false
311
- );
308
+ PopsInstanceUtils.removeInstance([PopsLayer.iframe], guid, false);
312
309
  if (typeof config?.btn?.close?.callback === "function") {
313
310
  config.btn.close.callback(eventDetails, event);
314
311
  }
@@ -1,7 +1,7 @@
1
1
  import { GlobalConfig } from "../../GlobalConfig";
2
2
  import { PopsElementHandler } from "../../handler/PopsElementHandler";
3
3
  import { PopsHandler } from "../../handler/PopsHandler";
4
- import { pops } from "../../Pops";
4
+ import { PopsCSS } from "../../PopsCSS";
5
5
  import { popsDOMUtils } from "../../utils/PopsDOMUtils";
6
6
  import { popsUtils } from "../../utils/PopsUtils";
7
7
  import { PopsLoadingConfig } from "./config";
@@ -33,14 +33,14 @@ export const PopsLoading = {
33
33
  <div class="pops-loading-content">${
34
34
  config.addIndexCSS
35
35
  ? /*html*/ `
36
- <style data-model-name="index">${pops.config.cssText.index}</style>
37
- <style data-model-name="anim">${pops.config.cssText.anim}</style>
38
- <style data-model-name="common">${pops.config.cssText.common}</style>
36
+ <style data-model-name="index">${PopsCSS.index}</style>
37
+ <style data-model-name="anim">${PopsCSS.anim}</style>
38
+ <style data-model-name="common">${PopsCSS.common}</style>
39
39
  `
40
40
  : ""
41
41
  }
42
42
  <style data-model-name="loadingCSS">
43
- ${pops.config.cssText.loadingCSS}
43
+ ${PopsCSS.loadingCSS}
44
44
  </style>
45
45
  ${config.style != null ? `<style>${config.style}</style>` : ""}
46
46
  <p pops style="${contentPStyle}">${config.content.text}</p>
@@ -1,11 +1,12 @@
1
- import { pops } from "../../Pops";
1
+ import { PopsIcon } from "../../PopsIcon";
2
2
  import { popsDOMUtils } from "../../utils/PopsDOMUtils";
3
3
  import { PopsInstanceUtils } from "../../utils/PopsInstanceUtils";
4
4
  import { PopsMathFloatUtils } from "../../utils/PopsMathUtils";
5
5
  import { PopsSafeUtils } from "../../utils/PopsSafeUtils";
6
6
  import { popsUtils } from "../../utils/PopsUtils";
7
+ import { PopsAlert } from "../alert";
7
8
  import type { PopsAlertDetails } from "../alert/indexType";
8
- import type { PopsTooltip } from "../tooltip";
9
+ import { PopsTooltip } from "../tooltip";
9
10
  import type { PopsPanelButtonDetails } from "./buttonType";
10
11
  import type { PopsPanelRightAsideContainerOptions } from "./commonType";
11
12
  import type { PopsPanelDeepMenuDetails } from "./deepMenuType";
@@ -401,7 +402,7 @@ export const PanelHandleContentDetails = () => {
401
402
  return value as string;
402
403
  }
403
404
  };
404
- let tooltip = pops.tooltip({
405
+ let tooltip = PopsTooltip.init({
405
406
  target: rangeInputElement.parentElement!,
406
407
  content: () => {
407
408
  return getToolTipContent(rangeInputElement.value);
@@ -576,11 +577,11 @@ export const PanelHandleContentDetails = () => {
576
577
  let isSuccess = false;
577
578
  let oldTotalWidth = this.$data.totalWidth;
578
579
  let timer: number | undefined = void 0;
579
- let interval = popsUtils.setInterval(() => {
580
+ let interval = setInterval(() => {
580
581
  if (isSuccess) {
581
582
  this.$interval.isCheck = false;
582
- popsUtils.clearTimeout(timer);
583
- popsUtils.clearInterval(interval);
583
+ clearTimeout(timer);
584
+ clearInterval(interval);
584
585
  } else {
585
586
  this.initTotalWidth();
586
587
  if (this.$data.totalWidth !== 0) {
@@ -598,8 +599,8 @@ export const PanelHandleContentDetails = () => {
598
599
  }
599
600
  }, checkStepTime);
600
601
  /* 最长检测时间是10s */
601
- timer = popsUtils.setTimeout(() => {
602
- popsUtils.clearInterval(interval);
602
+ timer = setTimeout(() => {
603
+ clearInterval(interval);
603
604
  }, maxTime);
604
605
  },
605
606
  /**
@@ -981,16 +982,16 @@ export const PanelHandleContentDetails = () => {
981
982
  return;
982
983
  }
983
984
  this.$data.isCheckingStopDragMove = true;
984
- let interval = popsUtils.setInterval(() => {
985
+ let interval = setInterval(() => {
985
986
  if (!this.$data.isMove) {
986
987
  this.$data.isCheckingStopDragMove = false;
987
988
  this.closeToolTip();
988
- popsUtils.clearInterval(interval);
989
+ clearInterval(interval);
989
990
  }
990
991
  }, 200);
991
- popsUtils.setTimeout(() => {
992
+ setTimeout(() => {
992
993
  this.$data.isCheckingStopDragMove = false;
993
- popsUtils.clearInterval(interval);
994
+ clearInterval(interval);
994
995
  }, 2000);
995
996
  },
996
997
  /**
@@ -1008,7 +1009,7 @@ export const PanelHandleContentDetails = () => {
1008
1009
  }
1009
1010
  }
1010
1011
 
1011
- let tooltip = pops.tooltip({
1012
+ let tooltip = PopsTooltip.init({
1012
1013
  target: this.$ele.button,
1013
1014
  content: getToolTipContent,
1014
1015
  zIndex: () => {
@@ -1105,12 +1106,12 @@ export const PanelHandleContentDetails = () => {
1105
1106
  this.setInputValue(this.$data.value);
1106
1107
  /* 如果是密码框,放进图标 */
1107
1108
  if (formConfig.isPassword) {
1108
- this.setCircleIcon(pops.config.iconSVG.view);
1109
+ this.setCircleIcon(PopsIcon.getIcon("view")!);
1109
1110
  this.setCircleIconClickEvent();
1110
1111
  } else {
1111
1112
  /* 先判断预设值是否为空,不为空添加清空图标按钮 */
1112
1113
  if (this.$ele.input.value != "") {
1113
- this.setCircleIcon(pops.config.iconSVG.circleClose);
1114
+ this.setCircleIcon(PopsIcon.getIcon("circleClose")!);
1114
1115
  this.setCircleIconClickEvent();
1115
1116
  }
1116
1117
  }
@@ -1191,9 +1192,9 @@ export const PanelHandleContentDetails = () => {
1191
1192
  },
1192
1193
  /**
1193
1194
  * 添加清空图标按钮
1194
- * @param [svgHTML=pops.config.iconSVG.circleClose] svg图标,默认为清空的图标
1195
+ * @param [svgHTML=PopsIcon.getIcon("circleClose")] svg图标,默认为清空的图标
1195
1196
  */
1196
- setCircleIcon(svgHTML = pops.config.iconSVG.circleClose) {
1197
+ setCircleIcon(svgHTML = PopsIcon.getIcon("circleClose")!) {
1197
1198
  PopsSafeUtils.setSafeHTML(this.$ele.icon, svgHTML);
1198
1199
  },
1199
1200
  /**
@@ -1213,13 +1214,13 @@ export const PanelHandleContentDetails = () => {
1213
1214
  this.$data.isView = false;
1214
1215
  /* 显示输入框内容,且更换图标为隐藏图标 */
1215
1216
  this.setInputType("text");
1216
- this.setCircleIcon(pops.config.iconSVG.hide);
1217
+ this.setCircleIcon(PopsIcon.getIcon("hide")!);
1217
1218
  } else {
1218
1219
  /* 当前不可见 => 点击改变为显示 */
1219
1220
  this.$data.isView = true;
1220
1221
  /* 隐藏输入框内容,且更换图标为显示图标 */
1221
1222
  this.setInputType("password");
1222
- this.setCircleIcon(pops.config.iconSVG.view);
1223
+ this.setCircleIcon(PopsIcon.getIcon("view")!);
1223
1224
  }
1224
1225
  } else {
1225
1226
  /* 普通输入框 */
@@ -1249,7 +1250,7 @@ export const PanelHandleContentDetails = () => {
1249
1250
  this.$ele.icon.innerHTML === ""
1250
1251
  ) {
1251
1252
  /* 不为空,显示清空图标 */
1252
- this.setCircleIcon(pops.config.iconSVG.circleClose);
1253
+ this.setCircleIcon(PopsIcon.getIcon("circleClose")!);
1253
1254
  this.setCircleIconClickEvent();
1254
1255
  } else if (this.$ele.input.value === "") {
1255
1256
  this.removeCircleIcon();
@@ -2211,7 +2212,7 @@ export const PanelHandleContentDetails = () => {
2211
2212
  } as PopsAlertDetails,
2212
2213
  userConfirmDetails
2213
2214
  );
2214
- let $dialog = pops.alert(confirmDetails);
2215
+ let $dialog = PopsAlert.init(confirmDetails);
2215
2216
  let $selectContainer =
2216
2217
  $dialog.$shadowRoot.querySelector<HTMLUListElement>(
2217
2218
  ".select-container"
@@ -2401,8 +2402,8 @@ export const PanelHandleContentDetails = () => {
2401
2402
  formConfig.buttonIcon.trim() !== ""
2402
2403
  ) {
2403
2404
  /* 存在icon图标且不为空 */
2404
- if (formConfig.buttonIcon in pops.config.iconSVG) {
2405
- this.setIconSVG(pops.config.iconSVG[formConfig.buttonIcon]);
2405
+ if (PopsIcon.hasIcon(formConfig.buttonIcon)) {
2406
+ this.setIconSVG(PopsIcon.getIcon(formConfig.buttonIcon)!);
2406
2407
  } else {
2407
2408
  this.setIconSVG(formConfig.buttonIcon);
2408
2409
  }
@@ -2530,7 +2531,9 @@ export const PanelHandleContentDetails = () => {
2530
2531
  : true;
2531
2532
  let arrowRightIconHTML = "";
2532
2533
  if (arrowRightIcon) {
2533
- arrowRightIconHTML = `<i class="pops-panel-deepMenu-arrowRight-icon">${pops.config.iconSVG.arrowRight}</i>`;
2534
+ arrowRightIconHTML = `<i class="pops-panel-deepMenu-arrowRight-icon">${PopsIcon.getIcon(
2535
+ "arrowRight"
2536
+ )}</i>`;
2534
2537
  }
2535
2538
  let rightText = "";
2536
2539
  if (formConfig.rightText) {
@@ -2688,7 +2691,7 @@ export const PanelHandleContentDetails = () => {
2688
2691
  });
2689
2692
  let $headerLeftArrow = popsDOMUtils.createElement("i", {
2690
2693
  className: "pops-panel-deepMenu-container-left-arrow-icon",
2691
- innerHTML: pops.config.iconSVG.arrowLeft,
2694
+ innerHTML: PopsIcon.getIcon("arrowLeft")!,
2692
2695
  });
2693
2696
  popsDOMUtils.on(
2694
2697
  $headerLeftArrow,
@@ -1,6 +1,6 @@
1
1
  import type { PopsPanelCommonDetails } from "./commonType";
2
2
  import type { PopsButtonStyleType } from "../../types/button";
3
- import type { PopsIcon } from "../../types/icon";
3
+ import type { PopsIconType } from "../../types/icon";
4
4
  /**
5
5
  * pops.panel的 button
6
6
  */
@@ -48,7 +48,7 @@ export interface PopsPanelButtonDetails extends PopsPanelCommonDetails<PopsPanel
48
48
  /**
49
49
  * 按钮的图标,已配置的svg请看pops.config.iconSVG,或者自定义的图标svg代码
50
50
  */
51
- buttonIcon?: PopsIcon;
51
+ buttonIcon?: PopsIconType;
52
52
  /**
53
53
  * 按钮的图标在右边
54
54
  */
@@ -1,3 +1,4 @@
1
+ import { popsDOMUtils } from "../../utils/PopsDOMUtils";
1
2
  import type { PopsPanelDetails } from "./indexType";
2
3
 
3
4
  export const PopsPanelConfig = (): DeepRequired<PopsPanelDetails> => {
@@ -130,6 +131,7 @@ export const PopsPanelConfig = (): DeepRequired<PopsPanelDetails> => {
130
131
  return "50";
131
132
  },
132
133
  callback(event, value) {
134
+ popsDOMUtils.preventEvent(event);
133
135
  console.log("输入框内容改变:", value);
134
136
  },
135
137
  placeholder: "请输入内容",
@@ -145,6 +147,7 @@ export const PopsPanelConfig = (): DeepRequired<PopsPanelDetails> => {
145
147
  return "123456";
146
148
  },
147
149
  callback(event, value) {
150
+ popsDOMUtils.preventEvent(event);
148
151
  console.log("密码输入框内容改变:", value);
149
152
  },
150
153
  isPassword: true,
@@ -161,6 +164,7 @@ export const PopsPanelConfig = (): DeepRequired<PopsPanelDetails> => {
161
164
  return "50";
162
165
  },
163
166
  callback(event, value) {
167
+ popsDOMUtils.preventEvent(event);
164
168
  console.log("textarea输入框内容改变:", value);
165
169
  },
166
170
  placeholder: "请输入内容",
@@ -1076,3 +1076,36 @@ section.pops-panel-container
1076
1076
  height: inherit;
1077
1077
  }
1078
1078
  /* deepMenu的css */
1079
+
1080
+ /* <code> */
1081
+ .pops[type-value="panel"] code {
1082
+ font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
1083
+ font-size: 0.85em;
1084
+ color: #000;
1085
+ background-color: #f0f0f0;
1086
+ border-radius: 3px;
1087
+ border: 0;
1088
+ padding: 0.2em 0;
1089
+ white-space: normal;
1090
+ background: #f5f5f5;
1091
+ text-wrap: wrap;
1092
+ text-align: left;
1093
+ word-spacing: normal;
1094
+ word-break: normal;
1095
+ word-wrap: normal;
1096
+ line-height: 1.4;
1097
+ -moz-tab-size: 8;
1098
+ -o-tab-size: 8;
1099
+ tab-size: 8;
1100
+ -webkit-hyphens: none;
1101
+ -moz-hyphens: none;
1102
+ -ms-hyphens: none;
1103
+ hyphens: none;
1104
+ direction: ltr;
1105
+ }
1106
+
1107
+ .pops[type-value="panel"] code::before,
1108
+ .pops[type-value="panel"] code::after {
1109
+ letter-spacing: -0.2em;
1110
+ content: "\00a0";
1111
+ }
@@ -1,6 +1,5 @@
1
1
  import { PopsElementHandler } from "../../handler/PopsElementHandler";
2
2
  import { PopsHandler } from "../../handler/PopsHandler";
3
- import { pops } from "../../Pops";
4
3
  import { popsDOMUtils } from "../../utils/PopsDOMUtils";
5
4
  import { PopsInstanceUtils } from "../../utils/PopsInstanceUtils";
6
5
  import { popsUtils } from "../../utils/PopsUtils";
@@ -8,6 +7,7 @@ import type { PopsPanelDetails } from "./indexType";
8
7
  import { PopsPanelConfig } from "./config";
9
8
  import { PanelHandleContentDetails } from "./PanelHandleContentDetails";
10
9
  import { GlobalConfig } from "../../GlobalConfig";
10
+ import { PopsCSS } from "../../PopsCSS";
11
11
 
12
12
  export const PopsPanel = {
13
13
  init(details: PopsPanelDetails) {
@@ -25,13 +25,13 @@ export const PopsPanel = {
25
25
 
26
26
  const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
27
27
  PopsHandler.handleInit($shadowRoot, [
28
- pops.config.cssText.index,
29
- pops.config.cssText.ninePalaceGridPosition,
30
- pops.config.cssText.scrollbar,
31
- pops.config.cssText.button,
32
- pops.config.cssText.anim,
33
- pops.config.cssText.common,
34
- pops.config.cssText.panelCSS,
28
+ PopsCSS.index,
29
+ PopsCSS.ninePalaceGridPosition,
30
+ PopsCSS.scrollbar,
31
+ PopsCSS.button,
32
+ PopsCSS.anim,
33
+ PopsCSS.common,
34
+ PopsCSS.panelCSS,
35
35
  ]);
36
36
 
37
37
  // 先把z-index提取出来
@@ -81,7 +81,7 @@ export const PopsPanel = {
81
81
  contentAsideElement: $contentAside,
82
82
  contentSectionContainerElement: $contentSectionContainer,
83
83
  } = PopsHandler.handleQueryElement($anim, PopsType);
84
- if (config.isMobile || pops.isPhone()) {
84
+ if (config.isMobile || popsUtils.isPhone()) {
85
85
  popsDOMUtils.addClassName($pops, config.mobileClassName);
86
86
  }
87
87
  /**