@whitesev/pops 2.0.2 → 2.0.3

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.
@@ -27,7 +27,7 @@ export const PopsElementHandler = {
27
27
  if (style.startsWith(";")) {
28
28
  style = style.replace(";", "");
29
29
  }
30
- return `<div class="pops-mask" data-guid="${guid}" style="z-index:${zIndex};${style}"></div>`;
30
+ return /*html*/ `<div class="pops-mask" data-guid="${guid}" style="z-index:${zIndex};${style}"></div>`;
31
31
  },
32
32
  /**
33
33
  * 获取动画层HTML
@@ -62,25 +62,16 @@ export const PopsElementHandler = {
62
62
  }
63
63
  let hasBottomBtn = bottomBtnHTML.trim() === "" ? false : true;
64
64
  return /*html*/ `
65
- <div
66
- class="pops-anim"
67
- anim="${__config.animation || ""}"
68
- style="${popsAnimStyle}"
69
- data-guid="${guid}">
70
- ${
71
- config.style != null
72
- ? `<style tyle="text/css">${config.style}</style>`
73
- : ""
74
- }
75
- <div
76
- class="pops ${config.class || ""}"
77
- data-bottom-btn="${hasBottomBtn}"
78
- type-value="${type}"
79
- style="${popsStyle}"
80
- position="${popsPosition}"
81
- data-guid="${guid}">
82
- ${html}
83
- </div>
65
+ <div class="pops-anim" anim="${
66
+ __config.animation || ""
67
+ }" style="${popsAnimStyle}" data-guid="${guid}">${
68
+ config.style != null
69
+ ? `<style tyle="text/css">${config.style}</style>`
70
+ : ""
71
+ }
72
+ <div class="pops ${
73
+ config.class || ""
74
+ }" data-bottom-btn="${hasBottomBtn}" type-value="${type}" style="${popsStyle}" position="${popsPosition}" data-guid="${guid}">${html}</div>
84
75
  </div>`;
85
76
  },
86
77
  /**
@@ -108,23 +99,21 @@ export const PopsElementHandler = {
108
99
  let topRightButtonHTML = "";
109
100
  __config_iframe.topRightButton.split("|").forEach((item: string) => {
110
101
  item = item.toLowerCase();
111
- topRightButtonHTML += `
102
+ topRightButtonHTML += /*html*/ `
112
103
  <button class="pops-header-control" type="${item}">
113
104
  <i class="pops-icon">${
114
105
  (pops.config.iconSVG as any)[item]
115
106
  }</i>
116
107
  </button>`;
117
108
  });
118
- resultHTML = `
119
- <div class="pops-header-controls" data-margin>
120
- ${topRightButtonHTML}
121
- </div>`;
109
+ resultHTML = /*html*/ `
110
+ <div class="pops-header-controls" data-margin>${topRightButtonHTML}</div>`;
122
111
  } else {
123
112
  if (__config_confirm.btn?.close?.enable) {
124
- closeHTML = `
113
+ closeHTML = /*html*/ `
125
114
  <div class="pops-header-controls">
126
115
  <button class="pops-header-control" type="close" data-header>
127
- <i class="pops-icon">${pops.config.iconSVG["close"]}</i>
116
+ <i class="pops-icon">${pops.config.iconSVG["close"]}</i>
128
117
  </button>
129
118
  </div>`;
130
119
  }
@@ -189,20 +178,15 @@ export const PopsElementHandler = {
189
178
  iconHTML = okIcon;
190
179
  }
191
180
  iconHTML = iconHTML || "";
192
- okIconHTML = `
193
- <i class="pops-bottom-icon" is-loading="${config.btn.ok.iconIsLoading}">
194
- ${iconHTML}
195
- </i>`;
181
+ okIconHTML = /*html*/ `<i class="pops-bottom-icon" is-loading="${config.btn.ok.iconIsLoading}">${iconHTML}</i>`;
196
182
  }
197
- okHTML = `
183
+ okHTML = /*html*/ `
198
184
  <button
199
185
  class="pops-${type}-btn-ok ${okButtonSizeClassName}"
200
186
  type="${__config_confirm.btn.ok?.type}"
201
187
  data-has-icon="${(__config_confirm.btn.ok!.icon || "") !== ""}"
202
188
  data-rightIcon="${__config_confirm.btn.ok?.rightIcon}"
203
- >
204
- ${okIconHTML}
205
- <span>${config.btn.ok.text}</span>
189
+ >${okIconHTML}<span>${config.btn.ok.text}</span>
206
190
  </button>`;
207
191
  }
208
192
 
@@ -228,20 +212,15 @@ export const PopsElementHandler = {
228
212
  iconHTML = cancelIcon;
229
213
  }
230
214
  iconHTML = iconHTML || "";
231
- cancelIconHTML = `
232
- <i class="pops-bottom-icon" is-loading="${__config_confirm.btn.cancel.iconIsLoading}">
233
- ${iconHTML}
234
- </i>`;
215
+ cancelIconHTML = /*html*/ `<i class="pops-bottom-icon" is-loading="${__config_confirm.btn.cancel.iconIsLoading}">${iconHTML}</i>`;
235
216
  }
236
- cancelHTML = `
217
+ cancelHTML = /*html*/ `
237
218
  <button
238
219
  class="pops-${type}-btn-cancel ${cancelButtonSizeClassName}"
239
220
  type="${__config_confirm.btn.cancel.type}"
240
221
  data-has-icon="${(__config_confirm.btn.cancel.icon || "") !== ""}"
241
222
  data-rightIcon="${__config_confirm.btn.cancel.rightIcon}"
242
- >
243
- ${cancelIconHTML}
244
- <span>${__config_confirm.btn.cancel.text}</span>
223
+ >${cancelIconHTML}<span>${__config_confirm.btn.cancel.text}</span>
245
224
  </button>`;
246
225
  }
247
226
 
@@ -267,20 +246,15 @@ export const PopsElementHandler = {
267
246
  otherIcon;
268
247
  }
269
248
  iconHTML = iconHTML || "";
270
- otherIconHTML = `
271
- <i class="pops-bottom-icon" is-loading="${__config_confirm.btn.other.iconIsLoading}">
272
- ${iconHTML}
273
- </i>`;
249
+ otherIconHTML = /*html*/ `<i class="pops-bottom-icon" is-loading="${__config_confirm.btn.other.iconIsLoading}">${iconHTML}</i>`;
274
250
  }
275
- ohterHTML = `
251
+ ohterHTML = /*html*/ `
276
252
  <button
277
253
  class="pops-${type}-btn-other ${otherButtonSizeClassName}"
278
254
  type="${__config_confirm.btn.other.type}"
279
255
  data-has-icon="${(__config_confirm.btn.other.icon || "") !== ""}"
280
256
  data-rightIcon="${__config_confirm.btn.other.rightIcon}"
281
- >
282
- ${otherIconHTML}
283
- <span>${__config_confirm.btn.other.text}</span>
257
+ >${otherIconHTML}<span>${__config_confirm.btn.other.text}</span>
284
258
  </button>`;
285
259
  }
286
260
 
@@ -291,34 +265,22 @@ export const PopsElementHandler = {
291
265
  } else {
292
266
  flexStyle += "flex-direction: row;";
293
267
  }
294
- resultHTML = `
295
- <div class="pops-${type}-btn" style="${btnStyle}">
296
- ${ohterHTML}
297
- <div
268
+ resultHTML = /*html*/ `
269
+ <div class="pops-${type}-btn" style="${btnStyle}">${ohterHTML}<div
298
270
  class="pops-${type}-btn-merge"
299
- style="${flexStyle}">
300
- ${okHTML}
301
- ${cancelHTML}
302
- </div>
271
+ style="${flexStyle}">${okHTML}${cancelHTML}</div>
303
272
  </div>
304
273
  `;
305
274
  } else {
306
- resultHTML = `
307
- <div class="pops-${type}-btn" style="${btnStyle}">
308
- ${okHTML}
309
- ${cancelHTML}
310
- ${ohterHTML}
311
- </div>
312
- `;
275
+ resultHTML = /*html*/ `<div class="pops-${type}-btn" style="${btnStyle}">${okHTML}${cancelHTML}${ohterHTML}</div>`;
313
276
  }
314
277
  return resultHTML;
315
278
  },
316
279
  /**
317
280
  * 获取标题style
318
- * @param type
319
- * @param config
281
+ * @param type 弹窗类型
282
+ * @param config 弹窗配置
320
283
  */
321
-
322
284
  getHeaderStyle(
323
285
  type: PopsTypeSupportHeaderTitle,
324
286
  config: PopsSupportHeaderTitle[keyof PopsSupportHeaderTitle]
@@ -331,10 +293,9 @@ export const PopsElementHandler = {
331
293
  },
332
294
  /**
333
295
  * 获取内容style
334
- * @param type
335
- * @param config
296
+ * @param type 弹窗类型
297
+ * @param config 弹窗配置
336
298
  */
337
-
338
299
  getContentStyle(
339
300
  type: PopsTypeSupportContent,
340
301
  config: PopsSupportContent[keyof PopsSupportContent]