@whitesev/pops 3.2.1 → 3.2.2

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 (126) hide show
  1. package/README.md +249 -249
  2. package/dist/index.amd.js +702 -667
  3. package/dist/index.amd.js.map +1 -1
  4. package/dist/index.amd.min.js +1 -1
  5. package/dist/index.amd.min.js.map +1 -1
  6. package/dist/index.cjs.js +702 -667
  7. package/dist/index.cjs.js.map +1 -1
  8. package/dist/index.cjs.min.js +1 -1
  9. package/dist/index.cjs.min.js.map +1 -1
  10. package/dist/index.esm.js +702 -667
  11. package/dist/index.esm.js.map +1 -1
  12. package/dist/index.esm.min.js +1 -1
  13. package/dist/index.esm.min.js.map +1 -1
  14. package/dist/index.iife.js +702 -667
  15. package/dist/index.iife.js.map +1 -1
  16. package/dist/index.iife.min.js +1 -1
  17. package/dist/index.iife.min.js.map +1 -1
  18. package/dist/index.system.js +702 -667
  19. package/dist/index.system.js.map +1 -1
  20. package/dist/index.system.min.js +1 -1
  21. package/dist/index.system.min.js.map +1 -1
  22. package/dist/index.umd.js +702 -667
  23. package/dist/index.umd.js.map +1 -1
  24. package/dist/index.umd.min.js +1 -1
  25. package/dist/index.umd.min.js.map +1 -1
  26. package/dist/types/src/components/folder/types/index.d.ts +43 -13
  27. package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +313 -313
  28. package/dist/types/src/types/animation.d.ts +19 -19
  29. package/dist/types/src/types/button.d.ts +94 -94
  30. package/dist/types/src/types/components.d.ts +211 -211
  31. package/dist/types/src/types/event.d.ts +43 -43
  32. package/dist/types/src/types/global.d.ts +31 -31
  33. package/dist/types/src/types/icon.d.ts +32 -32
  34. package/dist/types/src/types/inst.d.ts +28 -28
  35. package/dist/types/src/types/main.d.ts +66 -66
  36. package/dist/types/src/types/mask.d.ts +52 -52
  37. package/dist/types/src/types/position.d.ts +60 -60
  38. package/package.json +27 -25
  39. package/src/Pops.ts +206 -206
  40. package/src/PopsAnimation.ts +32 -32
  41. package/src/PopsCSS.ts +54 -54
  42. package/src/PopsCore.ts +37 -37
  43. package/src/PopsIcon.ts +95 -95
  44. package/src/PopsInst.ts +21 -21
  45. package/src/components/alert/defaultConfig.ts +62 -62
  46. package/src/components/alert/index.ts +163 -163
  47. package/src/components/alert/types/index.ts +23 -23
  48. package/src/components/confirm/defaultConfig.ts +90 -90
  49. package/src/components/confirm/index.ts +165 -165
  50. package/src/components/confirm/types/index.ts +13 -17
  51. package/src/components/drawer/defaultConfig.ts +89 -89
  52. package/src/components/drawer/index.css +37 -37
  53. package/src/components/drawer/index.ts +245 -245
  54. package/src/components/drawer/types/index.ts +62 -61
  55. package/src/components/folder/defaultConfig.ts +151 -151
  56. package/src/components/folder/folderIcon.ts +28 -28
  57. package/src/components/folder/index.css +303 -303
  58. package/src/components/folder/index.ts +953 -932
  59. package/src/components/folder/types/index.ts +143 -110
  60. package/src/components/iframe/defaultConfig.ts +60 -60
  61. package/src/components/iframe/index.css +76 -76
  62. package/src/components/iframe/index.ts +331 -331
  63. package/src/components/iframe/types/index.ts +96 -96
  64. package/src/components/loading/defaultConfig.ts +29 -29
  65. package/src/components/loading/index.css +66 -66
  66. package/src/components/loading/index.ts +101 -101
  67. package/src/components/loading/types/index.ts +36 -34
  68. package/src/components/panel/css/components-select.css +84 -84
  69. package/src/components/panel/defaultConfig.ts +868 -868
  70. package/src/components/panel/handlerComponents.ts +3993 -3993
  71. package/src/components/panel/index.css +1403 -1403
  72. package/src/components/panel/index.ts +221 -221
  73. package/src/components/panel/types/components-button.ts +56 -56
  74. package/src/components/panel/types/components-common.ts +73 -73
  75. package/src/components/panel/types/components-container.ts +25 -25
  76. package/src/components/panel/types/components-deepMenu.ts +64 -64
  77. package/src/components/panel/types/components-input.ts +90 -90
  78. package/src/components/panel/types/components-own.ts +16 -16
  79. package/src/components/panel/types/components-select.ts +169 -169
  80. package/src/components/panel/types/components-selectMultiple.ts +105 -104
  81. package/src/components/panel/types/components-slider.ts +55 -55
  82. package/src/components/panel/types/components-switch.ts +33 -33
  83. package/src/components/panel/types/components-textarea.ts +45 -45
  84. package/src/components/panel/types/index.ts +244 -244
  85. package/src/components/prompt/defaultConfig.ts +94 -94
  86. package/src/components/prompt/index.css +34 -34
  87. package/src/components/prompt/index.ts +187 -215
  88. package/src/components/prompt/types/index.ts +57 -56
  89. package/src/components/rightClickMenu/defaultConfig.ts +103 -103
  90. package/src/components/rightClickMenu/index.css +115 -115
  91. package/src/components/rightClickMenu/index.ts +662 -662
  92. package/src/components/rightClickMenu/types/index.ts +145 -143
  93. package/src/components/searchSuggestion/defaultConfig.ts +63 -63
  94. package/src/components/searchSuggestion/index.ts +813 -813
  95. package/src/components/searchSuggestion/types/index.ts +244 -242
  96. package/src/components/tooltip/defaultConfig.ts +33 -33
  97. package/src/components/tooltip/index.css +199 -199
  98. package/src/components/tooltip/index.ts +617 -617
  99. package/src/components/tooltip/types/index.ts +123 -121
  100. package/src/config/CommonCSSClassName.ts +17 -17
  101. package/src/config/GlobalConfig.ts +63 -63
  102. package/src/css/animation.css +987 -987
  103. package/src/css/button.css +551 -551
  104. package/src/css/common.css +54 -54
  105. package/src/css/index.css +253 -253
  106. package/src/css/ninePalaceGridPosition.css +50 -50
  107. package/src/css/scrollbar.css +22 -22
  108. package/src/handler/PopsElementHandler.ts +303 -303
  109. package/src/handler/PopsHandler.ts +611 -611
  110. package/src/types/PopsDOMUtilsEventType.d.ts +313 -313
  111. package/src/types/animation.d.ts +19 -19
  112. package/src/types/button.d.ts +94 -94
  113. package/src/types/components.d.ts +211 -211
  114. package/src/types/event.d.ts +43 -43
  115. package/src/types/global.d.ts +31 -31
  116. package/src/types/icon.d.ts +32 -32
  117. package/src/types/inst.d.ts +28 -28
  118. package/src/types/main.d.ts +66 -66
  119. package/src/types/mask.d.ts +52 -52
  120. package/src/types/position.d.ts +60 -60
  121. package/src/utils/PopsDOMUtils.ts +2483 -2483
  122. package/src/utils/PopsDOMUtilsEventsConfig.ts +4 -4
  123. package/src/utils/PopsInstanceUtils.ts +714 -714
  124. package/src/utils/PopsMathUtils.ts +71 -71
  125. package/src/utils/PopsSafeUtils.ts +22 -22
  126. package/src/utils/PopsUtils.ts +421 -421
@@ -1,163 +1,163 @@
1
- import { GlobalConfig } from "../../config/GlobalConfig";
2
- import { PopsElementHandler } from "../../handler/PopsElementHandler";
3
- import { PopsHandler } from "../../handler/PopsHandler";
4
- import { popsDOMUtils } from "../../utils/PopsDOMUtils";
5
- import { PopsInstanceUtils } from "../../utils/PopsInstanceUtils";
6
- import { popsUtils } from "../../utils/PopsUtils";
7
- import { PopsAlertDefaultConfig } from "./defaultConfig";
8
- import type { PopsType } from "../../types/main";
9
- import type { PopsAlertConfig } from "./types";
10
- import { PopsCSS } from "../../PopsCSS";
11
-
12
- export const PopsAlert = {
13
- init(__config__: PopsAlertConfig) {
14
- const guid = popsUtils.getRandomGUID();
15
- // 设置当前类型
16
- const popsType: PopsType = "alert";
17
-
18
- let config = PopsAlertDefaultConfig();
19
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
20
- config = popsUtils.assign(config, __config__);
21
- config = PopsHandler.handleOnly(popsType, config);
22
-
23
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
24
- PopsHandler.handleInit($shadowRoot, [
25
- {
26
- name: "index",
27
- css: PopsCSS.index,
28
- },
29
- {
30
- name: "ninePalaceGridPosition",
31
- css: PopsCSS.ninePalaceGridPosition,
32
- },
33
- {
34
- name: "scrollbar",
35
- css: PopsCSS.scrollbar,
36
- },
37
- {
38
- name: "button",
39
- css: PopsCSS.button,
40
- },
41
- {
42
- name: "anim",
43
- css: PopsCSS.anim,
44
- },
45
- {
46
- name: "common",
47
- css: PopsCSS.common,
48
- },
49
- {
50
- name: "alertCSS",
51
- css: PopsCSS.alertCSS,
52
- },
53
- ]);
54
-
55
- // 先把z-index提取出来
56
- const zIndex = PopsHandler.handleZIndex(config.zIndex);
57
- const maskHTML = PopsElementHandler.createMask(guid, zIndex);
58
- const headerBtnHTML = PopsElementHandler.createHeader(popsType, config);
59
- const bottomBtnHTML = PopsElementHandler.createBottom(popsType, config);
60
- const { headerStyle, headerPStyle } = PopsElementHandler.createHeaderStyle(popsType, config);
61
- const { contentStyle, contentPStyle } = PopsElementHandler.createContentStyle(popsType, config);
62
- const animHTML = PopsElementHandler.createAnim(
63
- guid,
64
- popsType,
65
- config,
66
- /*html*/ `
67
- <div class="pops-title pops-${popsType}-title" style="text-align: ${config.title.position};${headerStyle}">${
68
- config.title.html
69
- ? config.title.text
70
- : `<p pops class="pops-${popsType}-title-text" style="${headerPStyle}">${config.title.text}</p>`
71
- }${headerBtnHTML}</div>
72
- <div class="pops-content pops-${popsType}-content" style="${contentStyle}">${
73
- config.content.html
74
- ? config.content.text
75
- : `<p pops class="pops-${popsType}-content-text" style="${contentPStyle}">${config.content.text}</p>`
76
- }</div>${bottomBtnHTML}`,
77
- bottomBtnHTML,
78
- zIndex
79
- );
80
- /**
81
- * 弹窗的主元素,包括动画层
82
- */
83
- const $anim = PopsElementHandler.parseElement<HTMLDivElement>(animHTML);
84
-
85
- const {
86
- $pops: $pops,
87
- $headerBtnClose: $headerCloseBtn,
88
- $btnOk: btnOkElement,
89
- $title: $title,
90
- } = PopsHandler.handleQueryElement($anim, popsType);
91
-
92
- /** 遮罩层元素 */
93
- let $mask: HTMLDivElement | undefined = void 0;
94
- /** 已创建的元素列表 */
95
- const $elList: HTMLElement[] = [$anim];
96
-
97
- // 遮罩层元素
98
-
99
- if (config.mask.enable) {
100
- const handleMask = PopsHandler.handleMask({
101
- type: popsType,
102
- guid: guid,
103
- config: config,
104
- animElement: $anim,
105
- maskHTML: maskHTML,
106
- });
107
- $mask = handleMask.maskElement;
108
- $elList.push($mask);
109
- }
110
- // 处理返回的配置
111
- const evtConfig = PopsHandler.handleEventConfig(
112
- config,
113
- guid,
114
- $shadowContainer,
115
- $shadowRoot,
116
- popsType,
117
- $anim,
118
- $pops,
119
- $mask
120
- );
121
- const result = PopsHandler.handleResultConfig(evtConfig);
122
- // 为顶部右边的关闭按钮添加点击事件
123
- PopsHandler.handleClickEvent("close", $headerCloseBtn, evtConfig, config.btn.close?.callback);
124
- // 为底部ok按钮添加点击事件
125
- PopsHandler.handleClickEvent("ok", btnOkElement, evtConfig, config.btn.ok?.callback);
126
-
127
- // 创建到页面中
128
-
129
- popsDOMUtils.append($shadowRoot, $elList);
130
- if (typeof config.beforeAppendToPageCallBack === "function") {
131
- config.beforeAppendToPageCallBack($shadowRoot, $shadowContainer);
132
- }
133
-
134
- popsDOMUtils.appendBody($shadowContainer);
135
- if ($mask != null) {
136
- // 添加遮罩层
137
- $anim.after($mask);
138
- }
139
- // 保存
140
- PopsHandler.handlePush(popsType, {
141
- guid: guid,
142
- $anim: $anim,
143
- $pops: $pops!,
144
- $mask: $mask!,
145
- $shadowContainer: $shadowContainer,
146
- $shadowRoot: $shadowRoot,
147
- config: config,
148
- destory: result.close,
149
- });
150
- // 拖拽
151
- if (config.drag) {
152
- PopsInstanceUtils.drag($pops!, {
153
- dragElement: $title!,
154
- limit: config.dragLimit,
155
- extraDistance: config.dragExtraDistance!,
156
- moveCallBack: config.dragMoveCallBack!,
157
- endCallBack: config.dragEndCallBack!,
158
- });
159
- }
160
-
161
- return result;
162
- },
163
- };
1
+ import { GlobalConfig } from "../../config/GlobalConfig";
2
+ import { PopsElementHandler } from "../../handler/PopsElementHandler";
3
+ import { PopsHandler } from "../../handler/PopsHandler";
4
+ import { popsDOMUtils } from "../../utils/PopsDOMUtils";
5
+ import { PopsInstanceUtils } from "../../utils/PopsInstanceUtils";
6
+ import { popsUtils } from "../../utils/PopsUtils";
7
+ import { PopsAlertDefaultConfig } from "./defaultConfig";
8
+ import type { PopsType } from "../../types/main";
9
+ import type { PopsAlertConfig } from "./types";
10
+ import { PopsCSS } from "../../PopsCSS";
11
+
12
+ export const PopsAlert = {
13
+ init(__config__: PopsAlertConfig) {
14
+ const guid = popsUtils.getRandomGUID();
15
+ // 设置当前类型
16
+ const popsType: PopsType = "alert";
17
+
18
+ let config = PopsAlertDefaultConfig();
19
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
20
+ config = popsUtils.assign(config, __config__);
21
+ config = PopsHandler.handleOnly(popsType, config);
22
+
23
+ const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
24
+ PopsHandler.handleInit($shadowRoot, [
25
+ {
26
+ name: "index",
27
+ css: PopsCSS.index,
28
+ },
29
+ {
30
+ name: "ninePalaceGridPosition",
31
+ css: PopsCSS.ninePalaceGridPosition,
32
+ },
33
+ {
34
+ name: "scrollbar",
35
+ css: PopsCSS.scrollbar,
36
+ },
37
+ {
38
+ name: "button",
39
+ css: PopsCSS.button,
40
+ },
41
+ {
42
+ name: "anim",
43
+ css: PopsCSS.anim,
44
+ },
45
+ {
46
+ name: "common",
47
+ css: PopsCSS.common,
48
+ },
49
+ {
50
+ name: "alertCSS",
51
+ css: PopsCSS.alertCSS,
52
+ },
53
+ ]);
54
+
55
+ // 先把z-index提取出来
56
+ const zIndex = PopsHandler.handleZIndex(config.zIndex);
57
+ const maskHTML = PopsElementHandler.createMask(guid, zIndex);
58
+ const headerBtnHTML = PopsElementHandler.createHeader(popsType, config);
59
+ const bottomBtnHTML = PopsElementHandler.createBottom(popsType, config);
60
+ const { headerStyle, headerPStyle } = PopsElementHandler.createHeaderStyle(popsType, config);
61
+ const { contentStyle, contentPStyle } = PopsElementHandler.createContentStyle(popsType, config);
62
+ const animHTML = PopsElementHandler.createAnim(
63
+ guid,
64
+ popsType,
65
+ config,
66
+ /*html*/ `
67
+ <div class="pops-title pops-${popsType}-title" style="text-align: ${config.title.position};${headerStyle}">${
68
+ config.title.html
69
+ ? config.title.text
70
+ : `<p pops class="pops-${popsType}-title-text" style="${headerPStyle}">${config.title.text}</p>`
71
+ }${headerBtnHTML}</div>
72
+ <div class="pops-content pops-${popsType}-content" style="${contentStyle}">${
73
+ config.content.html
74
+ ? config.content.text
75
+ : `<p pops class="pops-${popsType}-content-text" style="${contentPStyle}">${config.content.text}</p>`
76
+ }</div>${bottomBtnHTML}`,
77
+ bottomBtnHTML,
78
+ zIndex
79
+ );
80
+ /**
81
+ * 弹窗的主元素,包括动画层
82
+ */
83
+ const $anim = PopsElementHandler.parseElement<HTMLDivElement>(animHTML);
84
+
85
+ const {
86
+ $pops: $pops,
87
+ $headerBtnClose: $headerCloseBtn,
88
+ $btnOk: btnOkElement,
89
+ $title: $title,
90
+ } = PopsHandler.handleQueryElement($anim, popsType);
91
+
92
+ /** 遮罩层元素 */
93
+ let $mask: HTMLDivElement | undefined = void 0;
94
+ /** 已创建的元素列表 */
95
+ const $elList: HTMLElement[] = [$anim];
96
+
97
+ // 遮罩层元素
98
+
99
+ if (config.mask.enable) {
100
+ const handleMask = PopsHandler.handleMask({
101
+ type: popsType,
102
+ guid: guid,
103
+ config: config,
104
+ animElement: $anim,
105
+ maskHTML: maskHTML,
106
+ });
107
+ $mask = handleMask.maskElement;
108
+ $elList.push($mask);
109
+ }
110
+ // 处理返回的配置
111
+ const evtConfig = PopsHandler.handleEventConfig(
112
+ config,
113
+ guid,
114
+ $shadowContainer,
115
+ $shadowRoot,
116
+ popsType,
117
+ $anim,
118
+ $pops,
119
+ $mask
120
+ );
121
+ const result = PopsHandler.handleResultConfig(evtConfig);
122
+ // 为顶部右边的关闭按钮添加点击事件
123
+ PopsHandler.handleClickEvent("close", $headerCloseBtn, evtConfig, config.btn.close?.callback);
124
+ // 为底部ok按钮添加点击事件
125
+ PopsHandler.handleClickEvent("ok", btnOkElement, evtConfig, config.btn.ok?.callback);
126
+
127
+ // 创建到页面中
128
+
129
+ popsDOMUtils.append($shadowRoot, $elList);
130
+ if (typeof config.beforeAppendToPageCallBack === "function") {
131
+ config.beforeAppendToPageCallBack($shadowRoot, $shadowContainer);
132
+ }
133
+
134
+ popsDOMUtils.appendBody($shadowContainer);
135
+ if ($mask != null) {
136
+ // 添加遮罩层
137
+ $anim.after($mask);
138
+ }
139
+ // 保存
140
+ PopsHandler.handlePush(popsType, {
141
+ guid: guid,
142
+ $anim: $anim,
143
+ $pops: $pops!,
144
+ $mask: $mask!,
145
+ $shadowContainer: $shadowContainer,
146
+ $shadowRoot: $shadowRoot,
147
+ config: config,
148
+ destory: result.close,
149
+ });
150
+ // 拖拽
151
+ if (config.drag) {
152
+ PopsInstanceUtils.drag($pops!, {
153
+ dragElement: $title!,
154
+ limit: config.dragLimit,
155
+ extraDistance: config.dragExtraDistance!,
156
+ moveCallBack: config.dragMoveCallBack!,
157
+ endCallBack: config.dragEndCallBack!,
158
+ });
159
+ }
160
+
161
+ return result;
162
+ },
163
+ };
@@ -1,23 +1,23 @@
1
- import type {
2
- PopsTitleConfig,
3
- PopsContentConfig,
4
- PopsDragConfig,
5
- PopsGeneralConfig,
6
- PopsButtonConfig,
7
- } from "../../../types/components";
8
- import type { PopsGlobalButtonConfig, PopsButtonConfigAnyType } from "../../../types/button";
9
-
10
- /**
11
- * pops.alert
12
- */
13
- export interface PopsAlertConfig extends PopsTitleConfig, PopsContentConfig, PopsDragConfig, PopsGeneralConfig {
14
- /**
15
- * 按钮配置
16
- */
17
- btn?: Partial<PopsButtonConfig["btn"]> & {
18
- /**
19
- * 确定按钮
20
- */
21
- ok?: Partial<PopsGlobalButtonConfig | PopsButtonConfigAnyType>;
22
- };
23
- }
1
+ import type {
2
+ PopsTitleConfig,
3
+ PopsContentConfig,
4
+ PopsDragConfig,
5
+ PopsGeneralConfig,
6
+ PopsButtonConfig,
7
+ } from "../../../types/components";
8
+ import type { PopsGlobalButtonConfig, PopsButtonConfigAnyType } from "../../../types/button";
9
+
10
+ /**
11
+ * pops.alert
12
+ */
13
+ export interface PopsAlertConfig extends PopsTitleConfig, PopsContentConfig, PopsDragConfig, PopsGeneralConfig {
14
+ /**
15
+ * 按钮配置
16
+ */
17
+ btn?: Partial<PopsButtonConfig["btn"]> & {
18
+ /**
19
+ * 确定按钮
20
+ */
21
+ ok?: Partial<PopsGlobalButtonConfig | PopsButtonConfigAnyType>;
22
+ };
23
+ }
@@ -1,90 +1,90 @@
1
- import type { PopsConfirmConfig } from "./types";
2
-
3
- export const PopsConfirmDefaultConfig = (): DeepRequired<PopsConfirmConfig> => {
4
- return {
5
- title: {
6
- text: "默认标题",
7
- position: "left",
8
- html: false,
9
- style: "",
10
- },
11
- content: {
12
- text: "默认内容",
13
- html: false,
14
- style: "",
15
- },
16
- btn: {
17
- merge: false,
18
- mergeReverse: false,
19
- reverse: false,
20
- position: "flex-end",
21
- ok: {
22
- enable: true,
23
- size: void 0 as any,
24
- icon: void 0 as any,
25
- rightIcon: false,
26
- iconIsLoading: false,
27
- text: "确定",
28
- type: "primary",
29
- callback(eventConfig) {
30
- eventConfig.close();
31
- },
32
- },
33
- cancel: {
34
- enable: true,
35
- size: void 0 as any,
36
- icon: void 0 as any,
37
- rightIcon: false,
38
- iconIsLoading: false,
39
- text: "关闭",
40
- type: "default",
41
- callback(eventConfig) {
42
- eventConfig.close();
43
- },
44
- },
45
- other: {
46
- enable: false,
47
- size: void 0 as any,
48
- icon: void 0 as any,
49
- rightIcon: false,
50
- iconIsLoading: false,
51
- text: "其它按钮",
52
- type: "default",
53
- callback(eventConfig) {
54
- eventConfig.close();
55
- },
56
- },
57
- close: {
58
- enable: true,
59
- callback(eventConfig) {
60
- eventConfig.close();
61
- },
62
- },
63
- },
64
- useShadowRoot: true,
65
- class: "",
66
- only: false,
67
- width: window.innerWidth < 550 ? "88vw" : "350px",
68
- height: window.innerHeight < 450 ? "70vh" : "200px",
69
- position: "center",
70
- animation: "pops-anim-fadein-zoom",
71
- zIndex: 10000,
72
- mask: {
73
- enable: false,
74
- clickEvent: {
75
- toClose: false,
76
- toHide: false,
77
- },
78
- clickCallBack: null,
79
- },
80
- drag: false,
81
- dragLimit: true,
82
- dragExtraDistance: 3,
83
- dragMoveCallBack() {},
84
- dragEndCallBack() {},
85
- forbiddenScroll: false,
86
-
87
- style: null,
88
- beforeAppendToPageCallBack() {},
89
- } as DeepRequired<PopsConfirmConfig>;
90
- };
1
+ import type { PopsConfirmConfig } from "./types";
2
+
3
+ export const PopsConfirmDefaultConfig = (): DeepRequired<PopsConfirmConfig> => {
4
+ return {
5
+ title: {
6
+ text: "默认标题",
7
+ position: "left",
8
+ html: false,
9
+ style: "",
10
+ },
11
+ content: {
12
+ text: "默认内容",
13
+ html: false,
14
+ style: "",
15
+ },
16
+ btn: {
17
+ merge: false,
18
+ mergeReverse: false,
19
+ reverse: false,
20
+ position: "flex-end",
21
+ ok: {
22
+ enable: true,
23
+ size: void 0 as any,
24
+ icon: void 0 as any,
25
+ rightIcon: false,
26
+ iconIsLoading: false,
27
+ text: "确定",
28
+ type: "primary",
29
+ callback(eventConfig) {
30
+ eventConfig.close();
31
+ },
32
+ },
33
+ cancel: {
34
+ enable: true,
35
+ size: void 0 as any,
36
+ icon: void 0 as any,
37
+ rightIcon: false,
38
+ iconIsLoading: false,
39
+ text: "关闭",
40
+ type: "default",
41
+ callback(eventConfig) {
42
+ eventConfig.close();
43
+ },
44
+ },
45
+ other: {
46
+ enable: false,
47
+ size: void 0 as any,
48
+ icon: void 0 as any,
49
+ rightIcon: false,
50
+ iconIsLoading: false,
51
+ text: "其它按钮",
52
+ type: "default",
53
+ callback(eventConfig) {
54
+ eventConfig.close();
55
+ },
56
+ },
57
+ close: {
58
+ enable: true,
59
+ callback(eventConfig) {
60
+ eventConfig.close();
61
+ },
62
+ },
63
+ },
64
+ useShadowRoot: true,
65
+ class: "",
66
+ only: false,
67
+ width: window.innerWidth < 550 ? "88vw" : "350px",
68
+ height: window.innerHeight < 450 ? "70vh" : "200px",
69
+ position: "center",
70
+ animation: "pops-anim-fadein-zoom",
71
+ zIndex: 10000,
72
+ mask: {
73
+ enable: false,
74
+ clickEvent: {
75
+ toClose: false,
76
+ toHide: false,
77
+ },
78
+ clickCallBack: null,
79
+ },
80
+ drag: false,
81
+ dragLimit: true,
82
+ dragExtraDistance: 3,
83
+ dragMoveCallBack() {},
84
+ dragEndCallBack() {},
85
+ forbiddenScroll: false,
86
+
87
+ style: null,
88
+ beforeAppendToPageCallBack() {},
89
+ } as DeepRequired<PopsConfirmConfig>;
90
+ };