@whitesev/pops 2.2.4 → 2.2.6

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.
@@ -65,7 +65,7 @@ export interface PopsPanelSelectMultipleDetails<T = any> extends PopsPanelCommon
65
65
  /**
66
66
  * (可选)是否禁用
67
67
  */
68
- disabled?: boolean | ((value: T) => boolean);
68
+ disabled?: boolean | (() => boolean);
69
69
  /**
70
70
  * 提示文字
71
71
  */
@@ -6,7 +6,7 @@ export declare const PopsElementHandler: {
6
6
  * @param zIndex z-index
7
7
  * @param style
8
8
  */
9
- getMaskHTML(guid: string, zIndex?: number, style?: string): string;
9
+ createMask(guid: string, zIndex?: number, style?: string): string;
10
10
  /**
11
11
  * 获取动画层HTML
12
12
  * @param guid
@@ -16,34 +16,34 @@ export declare const PopsElementHandler: {
16
16
  * @param bottomBtnHTML
17
17
  * @param zIndex
18
18
  */
19
- getAnimHTML(guid: string, type: PopsSupportAnimDetailsType, config: PopsSupportAnimDetails[keyof PopsSupportAnimDetails], html: string | undefined, bottomBtnHTML: string | undefined, zIndex: number): string;
19
+ createAnim(guid: string, type: PopsSupportAnimDetailsType, config: PopsSupportAnimDetails[keyof PopsSupportAnimDetails], html: string | undefined, bottomBtnHTML: string | undefined, zIndex: number): string;
20
20
  /**
21
21
  * 获取顶部按钮层HTML
22
22
  * @param type
23
23
  * @param config
24
24
  */
25
- getHeaderBtnHTML(type: PopsSupportHeaderTitleDetailsType, config: PopsSupportHeaderTitleDetails[keyof PopsSupportHeaderTitleDetails]): string;
26
- /**
27
- * 获取底部按钮层HTML
28
- * @param type
29
- * @param config
30
- */
31
- getBottomBtnHTML(type: PopsSupportBottomBtnDetailsType, config: Omit<PopsSupportBottomBtnDetails[keyof PopsSupportBottomBtnDetails], "content">): string;
25
+ createHeader(type: PopsSupportHeaderTitleDetailsType, config: PopsSupportHeaderTitleDetails[keyof PopsSupportHeaderTitleDetails]): string;
32
26
  /**
33
27
  * 获取标题style
34
28
  * @param type 弹窗类型
35
29
  * @param config 弹窗配置
36
30
  */
37
- getHeaderStyle(type: PopsSupportHeaderTitleDetailsType, config: PopsSupportHeaderTitleDetails[keyof PopsSupportHeaderTitleDetails]): {
31
+ createHeaderStyle(type: PopsSupportHeaderTitleDetailsType, config: PopsSupportHeaderTitleDetails[keyof PopsSupportHeaderTitleDetails]): {
38
32
  headerStyle: string;
39
33
  headerPStyle: string;
40
34
  };
35
+ /**
36
+ * 获取底部按钮层HTML
37
+ * @param type
38
+ * @param config
39
+ */
40
+ createBottom(type: PopsSupportBottomBtnDetailsType, config: Omit<PopsSupportBottomBtnDetails[keyof PopsSupportBottomBtnDetails], "content">): string;
41
41
  /**
42
42
  * 获取内容style
43
43
  * @param type 弹窗类型
44
44
  * @param config 弹窗配置
45
45
  */
46
- getContentStyle(type: PopsSupportContentDetailsType, config: PopsSupportContentDetails[keyof PopsSupportContentDetails]): {
46
+ createContentStyle(type: PopsSupportContentDetailsType, config: PopsSupportContentDetails[keyof PopsSupportContentDetails]): {
47
47
  contentStyle: string;
48
48
  contentPStyle: string;
49
49
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whitesev/pops",
3
- "version": "2.2.4",
3
+ "version": "2.2.6",
4
4
  "type": "module",
5
5
  "description": "弹窗库",
6
6
  "main": "dist/index.cjs.js",
package/src/Pops.ts CHANGED
@@ -36,7 +36,7 @@ class Pops {
36
36
  /** 配置 */
37
37
  config = {
38
38
  /** 版本号 */
39
- version: "2025.7.16",
39
+ version: "2025.7.18",
40
40
  cssText: PopsCSS,
41
41
  /** icon图标的svg代码 */
42
42
  iconSVG: PopsIcon.$data,
@@ -53,18 +53,18 @@ export const PopsAlert = {
53
53
 
54
54
  // 先把z-index提取出来
55
55
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
56
- let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
57
- let headerBtnHTML = PopsElementHandler.getHeaderBtnHTML(popsType, config);
58
- let bottomBtnHTML = PopsElementHandler.getBottomBtnHTML(popsType, config);
59
- let { headerStyle, headerPStyle } = PopsElementHandler.getHeaderStyle(
56
+ let maskHTML = PopsElementHandler.createMask(guid, zIndex);
57
+ let headerBtnHTML = PopsElementHandler.createHeader(popsType, config);
58
+ let bottomBtnHTML = PopsElementHandler.createBottom(popsType, config);
59
+ let { headerStyle, headerPStyle } = PopsElementHandler.createHeaderStyle(
60
60
  popsType,
61
61
  config
62
62
  );
63
- let { contentStyle, contentPStyle } = PopsElementHandler.getContentStyle(
63
+ let { contentStyle, contentPStyle } = PopsElementHandler.createContentStyle(
64
64
  popsType,
65
65
  config
66
66
  );
67
- let animHTML = PopsElementHandler.getAnimHTML(
67
+ let animHTML = PopsElementHandler.createAnim(
68
68
  guid,
69
69
  popsType,
70
70
  config,
@@ -53,19 +53,19 @@ export const PopsConfirm = {
53
53
 
54
54
  // 先把z-index提取出来
55
55
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
56
- let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
56
+ let maskHTML = PopsElementHandler.createMask(guid, zIndex);
57
57
 
58
- let headerBtnHTML = PopsElementHandler.getHeaderBtnHTML(popsType, config);
59
- let bottomBtnHTML = PopsElementHandler.getBottomBtnHTML(popsType, config);
60
- let { headerStyle, headerPStyle } = PopsElementHandler.getHeaderStyle(
58
+ let headerBtnHTML = PopsElementHandler.createHeader(popsType, config);
59
+ let bottomBtnHTML = PopsElementHandler.createBottom(popsType, config);
60
+ let { headerStyle, headerPStyle } = PopsElementHandler.createHeaderStyle(
61
61
  popsType,
62
62
  config
63
63
  );
64
- let { contentStyle, contentPStyle } = PopsElementHandler.getContentStyle(
64
+ let { contentStyle, contentPStyle } = PopsElementHandler.createContentStyle(
65
65
  popsType,
66
66
  config
67
67
  );
68
- let animHTML = PopsElementHandler.getAnimHTML(
68
+ let animHTML = PopsElementHandler.createAnim(
69
69
  guid,
70
70
  popsType,
71
71
  config,
@@ -52,19 +52,19 @@ export const PopsDrawer = {
52
52
 
53
53
  // 先把z-index提取出来
54
54
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
55
- let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
55
+ let maskHTML = PopsElementHandler.createMask(guid, zIndex);
56
56
 
57
- let headerBtnHTML = PopsElementHandler.getHeaderBtnHTML(popsType, config);
58
- let bottomBtnHTML = PopsElementHandler.getBottomBtnHTML(popsType, config);
59
- let { headerStyle, headerPStyle } = PopsElementHandler.getHeaderStyle(
57
+ let headerBtnHTML = PopsElementHandler.createHeader(popsType, config);
58
+ let bottomBtnHTML = PopsElementHandler.createBottom(popsType, config);
59
+ let { headerStyle, headerPStyle } = PopsElementHandler.createHeaderStyle(
60
60
  popsType,
61
61
  config
62
62
  );
63
- let { contentStyle, contentPStyle } = PopsElementHandler.getContentStyle(
63
+ let { contentStyle, contentPStyle } = PopsElementHandler.createContentStyle(
64
64
  popsType,
65
65
  config
66
66
  );
67
- let animHTML = PopsElementHandler.getAnimHTML(
67
+ let animHTML = PopsElementHandler.createAnim(
68
68
  guid,
69
69
  popsType,
70
70
  config,
@@ -127,15 +127,15 @@ export const PopsFolder = {
127
127
 
128
128
  // 先把z-index提取出来
129
129
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
130
- let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
130
+ let maskHTML = PopsElementHandler.createMask(guid, zIndex);
131
131
 
132
- let headerBtnHTML = PopsElementHandler.getHeaderBtnHTML(popsType, config);
133
- let bottomBtnHTML = PopsElementHandler.getBottomBtnHTML(popsType, config);
134
- let { headerStyle, headerPStyle } = PopsElementHandler.getHeaderStyle(
132
+ let headerBtnHTML = PopsElementHandler.createHeader(popsType, config);
133
+ let bottomBtnHTML = PopsElementHandler.createBottom(popsType, config);
134
+ let { headerStyle, headerPStyle } = PopsElementHandler.createHeaderStyle(
135
135
  popsType,
136
136
  config
137
137
  );
138
- let animHTML = PopsElementHandler.getAnimHTML(
138
+ let animHTML = PopsElementHandler.createAnim(
139
139
  guid,
140
140
  popsType,
141
141
  config,
@@ -35,7 +35,7 @@
35
35
  position: unset;
36
36
  }
37
37
  .pops[type-value="iframe"].pops[type-module="min"]
38
- .pops-header-control[type="min"] {
38
+ .pops-header-control[data-type="min"] {
39
39
  display: none;
40
40
  }
41
41
  .pops[type-value="iframe"].pops-iframe-unset-top {
@@ -62,17 +62,17 @@ export const PopsIframe = {
62
62
 
63
63
  // 先把z-index提取出来
64
64
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
65
- let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex, maskExtraStyle);
65
+ let maskHTML = PopsElementHandler.createMask(guid, zIndex, maskExtraStyle);
66
66
 
67
- let headerBtnHTML = PopsElementHandler.getHeaderBtnHTML(popsType, config);
67
+ let headerBtnHTML = PopsElementHandler.createHeader(popsType, config);
68
68
  let iframeLoadingHTML = '<div class="pops-loading"></div>';
69
69
  let titleText =
70
70
  config.title!.text!.trim() !== "" ? config.title.text : config.url;
71
- let { headerStyle, headerPStyle } = PopsElementHandler.getHeaderStyle(
71
+ let { headerStyle, headerPStyle } = PopsElementHandler.createHeaderStyle(
72
72
  popsType,
73
73
  config
74
74
  );
75
- let animHTML = PopsElementHandler.getAnimHTML(
75
+ let animHTML = PopsElementHandler.createAnim(
76
76
  guid,
77
77
  popsType,
78
78
  config,
@@ -19,13 +19,13 @@ export const PopsLoading = {
19
19
 
20
20
  // 先把z-index提取出来
21
21
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
22
- let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
22
+ let maskHTML = PopsElementHandler.createMask(guid, zIndex);
23
23
 
24
- let { contentPStyle } = PopsElementHandler.getContentStyle(
24
+ let { contentPStyle } = PopsElementHandler.createContentStyle(
25
25
  "loading",
26
26
  config
27
27
  );
28
- let animHTML = PopsElementHandler.getAnimHTML(
28
+ let animHTML = PopsElementHandler.createAnim(
29
29
  guid,
30
30
  PopsType,
31
31
  config,
@@ -34,7 +34,6 @@ export const PopsPanelConfig = (): DeepRequired<PopsPanelDetails> => {
34
34
  type: "switch",
35
35
  // @ts-ignore
36
36
  props: {},
37
- disabled: false,
38
37
  attributes: [],
39
38
  getValue() {
40
39
  return true;
@@ -59,6 +58,21 @@ export const PopsPanelConfig = (): DeepRequired<PopsPanelDetails> => {
59
58
  min: 1,
60
59
  max: 100,
61
60
  },
61
+ {
62
+ className: "panel-button",
63
+ text: "button",
64
+ type: "button",
65
+ // @ts-ignore
66
+ props: {},
67
+ attributes: [],
68
+ buttonIcon: "view",
69
+ buttonIconIsLoading: true,
70
+ buttonType: "default",
71
+ buttonText: "default按钮",
72
+ callback(event) {
73
+ console.log("点击按钮", event);
74
+ },
75
+ },
62
76
  {
63
77
  className: "panel-button",
64
78
  text: "button",
@@ -173,6 +187,7 @@ export const PopsPanelConfig = (): DeepRequired<PopsPanelDetails> => {
173
187
  className: "panel-select",
174
188
  text: "select",
175
189
  type: "select",
190
+ disabled: true,
176
191
  // @ts-ignore
177
192
  props: {},
178
193
  attributes: [],
@@ -215,6 +230,7 @@ export const PopsPanelConfig = (): DeepRequired<PopsPanelDetails> => {
215
230
  className: "panel-select-multiple",
216
231
  type: "select-multiple",
217
232
  text: "select-multiple",
233
+ disabled: true,
218
234
  // @ts-ignore
219
235
  props: {},
220
236