@whitesev/pops 1.9.7 → 2.0.0
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.
- package/dist/index.amd.js +225 -173
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +225 -173
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +225 -173
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +225 -173
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +225 -173
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +225 -173
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/utils/PopsSafeUtils.d.ts +6 -0
- package/package.json +1 -1
- package/src/Pops.ts +4 -3
- package/src/components/folder/index.ts +45 -32
- package/src/components/panel/PanelHandleContentDetails.ts +176 -132
- package/src/components/rightClickMenu/index.ts +9 -3
- package/src/components/searchSuggestion/index.ts +13 -4
- package/src/components/tooltip/index.ts +2 -1
- package/src/utils/PopsDOMUtils.ts +9 -3
- package/src/utils/PopsSafeUtils.ts +22 -0
package/package.json
CHANGED
package/src/Pops.ts
CHANGED
|
@@ -78,12 +78,13 @@ import { PopsMathFloatUtils } from "./utils/PopsMathUtils";
|
|
|
78
78
|
import { PanelHandleContentDetails } from "./components/panel/PanelHandleContentDetails";
|
|
79
79
|
import { GlobalConfig } from "./GlobalConfig";
|
|
80
80
|
import { PopsTooltip, type PopsTooltipResult } from "./components/tooltip";
|
|
81
|
+
import { PopsSafeUtils } from "./utils/PopsSafeUtils";
|
|
81
82
|
|
|
82
83
|
class Pops {
|
|
83
84
|
/** 配置 */
|
|
84
85
|
config = {
|
|
85
86
|
/** 版本号 */
|
|
86
|
-
version: "2025.
|
|
87
|
+
version: "2025.3.2",
|
|
87
88
|
cssText: {
|
|
88
89
|
/** 主CSS */
|
|
89
90
|
index: indexCSS,
|
|
@@ -194,7 +195,7 @@ class Pops {
|
|
|
194
195
|
/* 处理获取当前所有的动画名 */
|
|
195
196
|
this.config.isInit = true;
|
|
196
197
|
let animationStyle = document.createElement("style");
|
|
197
|
-
animationStyle
|
|
198
|
+
PopsSafeUtils.setSafeHTML(animationStyle, this.config.cssText.anim);
|
|
198
199
|
popsDOMUtils.appendHead(animationStyle);
|
|
199
200
|
this.config.animation = null as any;
|
|
200
201
|
this.config.animation = PopsInstanceUtils.getKeyFrames(
|
|
@@ -283,7 +284,7 @@ class Pops {
|
|
|
283
284
|
* 提示框
|
|
284
285
|
* @param details 配置
|
|
285
286
|
*/
|
|
286
|
-
tooltip = <T extends PopsToolTipDetails=PopsToolTipDetails>(details: T) => {
|
|
287
|
+
tooltip = <T extends PopsToolTipDetails = PopsToolTipDetails>(details: T) => {
|
|
287
288
|
let popsTooltip = new PopsTooltip(details) as PopsTooltipResult<T>;
|
|
288
289
|
return popsTooltip;
|
|
289
290
|
};
|
|
@@ -4,6 +4,7 @@ import { PopsHandler } from "../../handler/PopsHandler";
|
|
|
4
4
|
import { pops } from "../../Pops";
|
|
5
5
|
import { popsDOMUtils } from "../../utils/PopsDOMUtils";
|
|
6
6
|
import { PopsInstanceUtils } from "../../utils/PopsInstanceUtils";
|
|
7
|
+
import { PopsSafeUtils } from "../../utils/PopsSafeUtils";
|
|
7
8
|
import { popsUtils } from "../../utils/PopsUtils";
|
|
8
9
|
import { PopsFolderConfig } from "./config";
|
|
9
10
|
import { Folder_ICON } from "./folderIcon";
|
|
@@ -387,27 +388,36 @@ export class PopsFolder {
|
|
|
387
388
|
fileNameElement.className = "pops-folder-list-table__body-td";
|
|
388
389
|
fileTimeElement.className = "pops-folder-list-table__body-td";
|
|
389
390
|
fileFormatSize.className = "pops-folder-list-table__body-td";
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
391
|
+
PopsSafeUtils.setSafeHTML(
|
|
392
|
+
fileNameElement,
|
|
393
|
+
/*html*/ `
|
|
394
|
+
<div class="pops-folder-list-file-name cursor-p">
|
|
395
|
+
<div>
|
|
396
|
+
<img src="${fileIcon}" alt="${fileType}" class="pops-folder-list-file-icon u-file-icon u-file-icon--list">
|
|
397
|
+
<a title="${fileName}" class="pops-folder-list-file-name-title-text inline-block-v-middle text-ellip list-name-text">
|
|
398
|
+
${fileName}
|
|
399
|
+
</a>
|
|
400
|
+
</div>
|
|
401
|
+
</div>
|
|
402
|
+
`
|
|
403
|
+
);
|
|
404
|
+
PopsSafeUtils.setSafeHTML(
|
|
405
|
+
fileTimeElement,
|
|
406
|
+
/*html*/ `
|
|
407
|
+
<div class="pops-folder-list__time">
|
|
408
|
+
<span>${latestTime}</span>
|
|
409
|
+
</div>
|
|
410
|
+
`
|
|
411
|
+
);
|
|
412
|
+
PopsSafeUtils.setSafeHTML(
|
|
413
|
+
fileFormatSize,
|
|
414
|
+
/*html*/ `
|
|
415
|
+
<div class="pops-folder-list-format-size">
|
|
416
|
+
<span>${fileSize}</span>
|
|
417
|
+
</div>
|
|
418
|
+
`
|
|
419
|
+
);
|
|
405
420
|
|
|
406
|
-
fileFormatSize.innerHTML = `
|
|
407
|
-
<div class="pops-folder-list-format-size">
|
|
408
|
-
<span>${fileSize}</span>
|
|
409
|
-
</div>
|
|
410
|
-
`;
|
|
411
421
|
/* 存储原来的值 */
|
|
412
422
|
let __value__ = {
|
|
413
423
|
fileName: origin_fileName,
|
|
@@ -479,17 +489,20 @@ export class PopsFolder {
|
|
|
479
489
|
}
|
|
480
490
|
folderELement.className = "pops-folder-list-table__body-row";
|
|
481
491
|
fileNameElement.className = "pops-folder-list-table__body-td";
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
492
|
+
PopsSafeUtils.setSafeHTML(
|
|
493
|
+
fileNameElement,
|
|
494
|
+
/*html*/ `
|
|
495
|
+
<div class="pops-folder-list-file-name pops-mobile-folder-list-file-name cursor-p">
|
|
496
|
+
<img src="${fileIcon}" alt="${fileType}" class="pops-folder-list-file-icon u-file-icon u-file-icon--list">
|
|
497
|
+
<div>
|
|
498
|
+
<a title="${fileName}" class="pops-folder-list-file-name-title-text inline-block-v-middle text-ellip list-name-text">
|
|
499
|
+
${fileName}
|
|
500
|
+
</a>
|
|
501
|
+
<span>${latestTime} ${fileSize}</span>
|
|
502
|
+
</div>
|
|
503
|
+
</div>
|
|
504
|
+
`
|
|
505
|
+
);
|
|
493
506
|
/* 存储原来的值 */
|
|
494
507
|
let __value__ = {
|
|
495
508
|
fileName: origin_fileName,
|
|
@@ -511,7 +524,7 @@ export class PopsFolder {
|
|
|
511
524
|
* 清空每行的元素
|
|
512
525
|
*/
|
|
513
526
|
function clearFolerRow() {
|
|
514
|
-
folderListBodyElement
|
|
527
|
+
PopsSafeUtils.setSafeHTML(folderListBodyElement, "");
|
|
515
528
|
}
|
|
516
529
|
function getArrowIconElement() {
|
|
517
530
|
let iconArrowElement = popsDOMUtils.createElement("div", {
|
|
@@ -2,6 +2,7 @@ import { pops } from "../../Pops";
|
|
|
2
2
|
import { popsDOMUtils } from "../../utils/PopsDOMUtils";
|
|
3
3
|
import { PopsInstanceUtils } from "../../utils/PopsInstanceUtils";
|
|
4
4
|
import { PopsMathFloatUtils } from "../../utils/PopsMathUtils";
|
|
5
|
+
import { PopsSafeUtils } from "../../utils/PopsSafeUtils";
|
|
5
6
|
import { popsUtils } from "../../utils/PopsUtils";
|
|
6
7
|
import type { PopsAlertDetails } from "../alert/indexType";
|
|
7
8
|
import type { PopsTooltipResult } from "../tooltip";
|
|
@@ -135,8 +136,8 @@ export const PanelHandleContentDetails = () => {
|
|
|
135
136
|
* 清空container容器的元素
|
|
136
137
|
*/
|
|
137
138
|
clearContainer() {
|
|
138
|
-
this.sectionContainerHeaderULElement
|
|
139
|
-
this.sectionContainerULElement
|
|
139
|
+
PopsSafeUtils.setSafeHTML(this.sectionContainerHeaderULElement, "");
|
|
140
|
+
PopsSafeUtils.setSafeHTML(this.sectionContainerULElement, "");
|
|
140
141
|
this.$el.$content
|
|
141
142
|
?.querySelectorAll("section.pops-panel-deepMenu-container")
|
|
142
143
|
.forEach((ele) => ele.remove());
|
|
@@ -223,8 +224,9 @@ export const PanelHandleContentDetails = () => {
|
|
|
223
224
|
createAsideItem(asideConfig: PopsPanelContentConfig) {
|
|
224
225
|
let liElement = document.createElement("li");
|
|
225
226
|
liElement.id = asideConfig.id;
|
|
226
|
-
|
|
227
|
-
liElement
|
|
227
|
+
// @ts-ignore
|
|
228
|
+
liElement["__forms__"] = asideConfig.forms;
|
|
229
|
+
PopsSafeUtils.setSafeHTML(liElement, asideConfig.title);
|
|
228
230
|
/* 处理className */
|
|
229
231
|
this.setElementClassName(liElement, asideConfig.className);
|
|
230
232
|
this.setElementAttributes(liElement, asideConfig.attributes);
|
|
@@ -247,18 +249,21 @@ export const PanelHandleContentDetails = () => {
|
|
|
247
249
|
if (Boolean(formConfig.description)) {
|
|
248
250
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
249
251
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
<
|
|
258
|
-
<
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
252
|
+
PopsSafeUtils.setSafeHTML(
|
|
253
|
+
liElement,
|
|
254
|
+
/*html*/ `
|
|
255
|
+
<div class="pops-panel-item-left-text">
|
|
256
|
+
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>
|
|
257
|
+
${leftDescriptionText}
|
|
258
|
+
</div>
|
|
259
|
+
<div class="pops-panel-switch">
|
|
260
|
+
<input class="pops-panel-switch__input" type="checkbox">
|
|
261
|
+
<span class="pops-panel-switch__core">
|
|
262
|
+
<div class="pops-panel-switch__action">
|
|
263
|
+
</div>
|
|
264
|
+
</span>
|
|
265
|
+
</div>`
|
|
266
|
+
);
|
|
262
267
|
const PopsPanelSwitch = {
|
|
263
268
|
[Symbol.toStringTag]: "PopsPanelSwitch",
|
|
264
269
|
$data: {
|
|
@@ -366,15 +371,18 @@ export const PanelHandleContentDetails = () => {
|
|
|
366
371
|
if (Boolean(formConfig.description)) {
|
|
367
372
|
leftDescriptionText = `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
368
373
|
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
374
|
+
PopsSafeUtils.setSafeHTML(
|
|
375
|
+
liElement,
|
|
376
|
+
/*html*/ `
|
|
377
|
+
<div class="pops-panel-item-left-text">
|
|
378
|
+
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>
|
|
379
|
+
${leftDescriptionText}
|
|
380
|
+
</div>
|
|
381
|
+
<div class="pops-panel-slider">
|
|
382
|
+
<input type="range" min="${formConfig.min}" max="${formConfig.max}">
|
|
383
|
+
</div>
|
|
384
|
+
`
|
|
385
|
+
);
|
|
378
386
|
let rangeInputElement = liElement.querySelector<HTMLInputElement>(
|
|
379
387
|
".pops-panel-slider input[type=range]"
|
|
380
388
|
)!;
|
|
@@ -441,19 +449,22 @@ export const PanelHandleContentDetails = () => {
|
|
|
441
449
|
if (Boolean(formConfig.description)) {
|
|
442
450
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
443
451
|
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
<div class="pops-slider__runway">
|
|
451
|
-
<div class="pops-slider__bar" style="width: 0%; left: 0%"></div>
|
|
452
|
-
<div class="pops-slider__button-wrapper" style="left: 0%">
|
|
453
|
-
<div class="pops-slider__button"></div>
|
|
454
|
-
</div>
|
|
452
|
+
PopsSafeUtils.setSafeHTML(
|
|
453
|
+
liElement,
|
|
454
|
+
/*html*/ `
|
|
455
|
+
<div class="pops-panel-item-left-text" style="flex: 1;">
|
|
456
|
+
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>
|
|
457
|
+
${leftDescriptionText}
|
|
455
458
|
</div>
|
|
456
|
-
|
|
459
|
+
<div class="pops-slider pops-slider-width">
|
|
460
|
+
<div class="pops-slider__runway">
|
|
461
|
+
<div class="pops-slider__bar" style="width: 0%; left: 0%"></div>
|
|
462
|
+
<div class="pops-slider__button-wrapper" style="left: 0%">
|
|
463
|
+
<div class="pops-slider__button"></div>
|
|
464
|
+
</div>
|
|
465
|
+
</div>
|
|
466
|
+
</div>`
|
|
467
|
+
);
|
|
457
468
|
const PopsPanelSlider = {
|
|
458
469
|
[Symbol.toStringTag]: "PopsPanelSlider",
|
|
459
470
|
/**
|
|
@@ -1033,15 +1044,18 @@ export const PanelHandleContentDetails = () => {
|
|
|
1033
1044
|
if (Boolean(formConfig.description)) {
|
|
1034
1045
|
leftDescriptionText = `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
1035
1046
|
}
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1047
|
+
PopsSafeUtils.setSafeHTML(
|
|
1048
|
+
liElement,
|
|
1049
|
+
/*html*/ `
|
|
1050
|
+
<div class="pops-panel-item-left-text">
|
|
1051
|
+
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>
|
|
1052
|
+
${leftDescriptionText}
|
|
1053
|
+
</div>
|
|
1054
|
+
<div class="pops-panel-input pops-user-select-none">
|
|
1055
|
+
<input type="${inputType}" placeholder="${formConfig.placeholder}">
|
|
1056
|
+
</div>
|
|
1057
|
+
`
|
|
1058
|
+
);
|
|
1045
1059
|
const PopsPanelInput = {
|
|
1046
1060
|
[Symbol.toStringTag]: "PopsPanelInput",
|
|
1047
1061
|
$ele: {
|
|
@@ -1088,11 +1102,14 @@ export const PanelHandleContentDetails = () => {
|
|
|
1088
1102
|
this.$ele.input.nextSibling
|
|
1089
1103
|
);
|
|
1090
1104
|
this.$ele.inputSpanIcon.className = "pops-panel-input__suffix";
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1105
|
+
PopsSafeUtils.setSafeHTML(
|
|
1106
|
+
this.$ele.inputSpanIcon,
|
|
1107
|
+
/*html*/ `
|
|
1108
|
+
<span class="pops-panel-input__suffix-inner">
|
|
1109
|
+
<i class="pops-panel-icon"></i>
|
|
1110
|
+
</span>
|
|
1111
|
+
`
|
|
1112
|
+
);
|
|
1096
1113
|
this.$ele.inputSpanIconInner =
|
|
1097
1114
|
this.$ele.inputSpanIcon.querySelector<HTMLElement>(
|
|
1098
1115
|
".pops-panel-input__suffix-inner"
|
|
@@ -1131,7 +1148,7 @@ export const PanelHandleContentDetails = () => {
|
|
|
1131
1148
|
},
|
|
1132
1149
|
/**
|
|
1133
1150
|
* 设置input元素的type
|
|
1134
|
-
* @param
|
|
1151
|
+
* @param [typeValue="text"] type值
|
|
1135
1152
|
*/
|
|
1136
1153
|
setInputType(typeValue = "text") {
|
|
1137
1154
|
this.$ele.input.setAttribute("type", typeValue);
|
|
@@ -1140,14 +1157,14 @@ export const PanelHandleContentDetails = () => {
|
|
|
1140
1157
|
* 删除图标按钮
|
|
1141
1158
|
*/
|
|
1142
1159
|
removeCircleIcon() {
|
|
1143
|
-
this.$ele.icon
|
|
1160
|
+
PopsSafeUtils.setSafeHTML(this.$ele.icon, "");
|
|
1144
1161
|
},
|
|
1145
1162
|
/**
|
|
1146
1163
|
* 添加清空图标按钮
|
|
1147
|
-
* @param
|
|
1164
|
+
* @param [svgHTML=pops.config.iconSVG.circleClose] svg图标,默认为清空的图标
|
|
1148
1165
|
*/
|
|
1149
1166
|
setCircleIcon(svgHTML = pops.config.iconSVG.circleClose) {
|
|
1150
|
-
this.$ele.icon
|
|
1167
|
+
PopsSafeUtils.setSafeHTML(this.$ele.icon, svgHTML);
|
|
1151
1168
|
},
|
|
1152
1169
|
/**
|
|
1153
1170
|
* 添加图标按钮的点击事件
|
|
@@ -1244,16 +1261,19 @@ export const PanelHandleContentDetails = () => {
|
|
|
1244
1261
|
if (Boolean(formConfig.description)) {
|
|
1245
1262
|
leftDescriptionText = `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
1246
1263
|
}
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1264
|
+
PopsSafeUtils.setSafeHTML(
|
|
1265
|
+
liElement,
|
|
1266
|
+
/*html*/ `
|
|
1267
|
+
<div class="pops-panel-item-left-text">
|
|
1268
|
+
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>
|
|
1269
|
+
${leftDescriptionText}
|
|
1270
|
+
</div>
|
|
1271
|
+
<div class="pops-panel-textarea">
|
|
1272
|
+
<textarea placeholder="${formConfig.placeholder ?? ""}">
|
|
1273
|
+
</textarea>
|
|
1274
|
+
</div>
|
|
1275
|
+
`
|
|
1276
|
+
);
|
|
1257
1277
|
|
|
1258
1278
|
const PopsPanelTextArea = {
|
|
1259
1279
|
[Symbol.toStringTag]: "PopsPanelTextArea",
|
|
@@ -1336,15 +1356,18 @@ export const PanelHandleContentDetails = () => {
|
|
|
1336
1356
|
if (Boolean(formConfig.description)) {
|
|
1337
1357
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
1338
1358
|
}
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1359
|
+
PopsSafeUtils.setSafeHTML(
|
|
1360
|
+
liElement,
|
|
1361
|
+
/*html*/ `
|
|
1362
|
+
<div class="pops-panel-item-left-text">
|
|
1363
|
+
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>
|
|
1364
|
+
${leftDescriptionText}
|
|
1365
|
+
</div>
|
|
1366
|
+
<div class="pops-panel-select pops-user-select-none">
|
|
1367
|
+
<select></select>
|
|
1368
|
+
</div>
|
|
1369
|
+
`
|
|
1370
|
+
);
|
|
1348
1371
|
|
|
1349
1372
|
const PopsPanelSelect = {
|
|
1350
1373
|
[Symbol.toStringTag]: "PopsPanelSelect",
|
|
@@ -1569,34 +1592,36 @@ export const PanelHandleContentDetails = () => {
|
|
|
1569
1592
|
if (Boolean(formConfig.description)) {
|
|
1570
1593
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
1571
1594
|
}
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
<div class="el-
|
|
1582
|
-
|
|
1595
|
+
PopsSafeUtils.setSafeHTML(
|
|
1596
|
+
liElement,
|
|
1597
|
+
/*html*/ `
|
|
1598
|
+
<div class="pops-panel-item-left-text">
|
|
1599
|
+
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>
|
|
1600
|
+
${leftDescriptionText}
|
|
1601
|
+
</div>
|
|
1602
|
+
<div class="pops-panel-select-multiple">
|
|
1603
|
+
<div class="el-select__wrapper">
|
|
1604
|
+
<div class="el-select__selection">
|
|
1605
|
+
<!-- 这个是用于手动输入的,这里暂不适配 -->
|
|
1606
|
+
<div class="el-select__selected-item el-select__input-wrapper">
|
|
1607
|
+
|
|
1608
|
+
</div>
|
|
1609
|
+
<!-- 这个是placeholder -->
|
|
1610
|
+
<div class="el-select__selected-item el-select__placeholder">
|
|
1611
|
+
</div>
|
|
1583
1612
|
</div>
|
|
1584
|
-
<!--
|
|
1585
|
-
<div class="el-
|
|
1613
|
+
<!-- 下拉箭头 -->
|
|
1614
|
+
<div class="el-select__suffix">
|
|
1615
|
+
<i class="el-icon el-select__caret el-select__icon">
|
|
1616
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
|
|
1617
|
+
<path fill="currentColor" d="M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"></path>
|
|
1618
|
+
</svg>
|
|
1619
|
+
</i>
|
|
1586
1620
|
</div>
|
|
1587
1621
|
</div>
|
|
1588
|
-
<!-- 下拉箭头 -->
|
|
1589
|
-
<div class="el-select__suffix">
|
|
1590
|
-
<i class="el-icon el-select__caret el-select__icon">
|
|
1591
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
|
|
1592
|
-
<path fill="currentColor" d="M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"></path>
|
|
1593
|
-
</svg>
|
|
1594
|
-
</i>
|
|
1595
|
-
</div>
|
|
1596
1622
|
</div>
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1623
|
+
`
|
|
1624
|
+
);
|
|
1600
1625
|
const PopsPanelSelectMultiple = {
|
|
1601
1626
|
[Symbol.toStringTag]: "PopsPanelSelectMultiple",
|
|
1602
1627
|
$el: {
|
|
@@ -1743,7 +1768,7 @@ export const PanelHandleContentDetails = () => {
|
|
|
1743
1768
|
".el-icon.el-tag__close"
|
|
1744
1769
|
)!;
|
|
1745
1770
|
if (data.isHTML) {
|
|
1746
|
-
$tagText
|
|
1771
|
+
PopsSafeUtils.setSafeHTML($tagText, data.text);
|
|
1747
1772
|
} else {
|
|
1748
1773
|
$tagText.innerText = data.text;
|
|
1749
1774
|
}
|
|
@@ -2197,18 +2222,21 @@ export const PanelHandleContentDetails = () => {
|
|
|
2197
2222
|
if (Boolean(formConfig.description)) {
|
|
2198
2223
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
2199
2224
|
}
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
<
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2225
|
+
PopsSafeUtils.setSafeHTML(
|
|
2226
|
+
liElement,
|
|
2227
|
+
/*html*/ `
|
|
2228
|
+
<div class="pops-panel-item-left-text">
|
|
2229
|
+
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>
|
|
2230
|
+
${leftDescriptionText}
|
|
2231
|
+
</div>
|
|
2232
|
+
<div class="pops-panel-button">
|
|
2233
|
+
<button class="pops-panel-button_inner">
|
|
2234
|
+
<i class="pops-bottom-icon"></i>
|
|
2235
|
+
<span class="pops-panel-button-text"></span>
|
|
2236
|
+
</button>
|
|
2237
|
+
</div>
|
|
2238
|
+
`
|
|
2239
|
+
);
|
|
2212
2240
|
|
|
2213
2241
|
const PopsPanelButton = {
|
|
2214
2242
|
[Symbol.toStringTag]: "PopsPanelButton",
|
|
@@ -2285,7 +2313,7 @@ export const PanelHandleContentDetails = () => {
|
|
|
2285
2313
|
* 设置icon图标的svg
|
|
2286
2314
|
*/
|
|
2287
2315
|
setIconSVG(svgHTML: string) {
|
|
2288
|
-
this.$ele.icon
|
|
2316
|
+
PopsSafeUtils.setSafeHTML(this.$ele.icon, svgHTML);
|
|
2289
2317
|
},
|
|
2290
2318
|
/**
|
|
2291
2319
|
* 设置icon图标是否旋转
|
|
@@ -2324,7 +2352,7 @@ export const PanelHandleContentDetails = () => {
|
|
|
2324
2352
|
* @param text
|
|
2325
2353
|
*/
|
|
2326
2354
|
setButtonText(text: string) {
|
|
2327
|
-
this.$ele.spanText
|
|
2355
|
+
PopsSafeUtils.setSafeHTML(this.$ele.spanText, text);
|
|
2328
2356
|
},
|
|
2329
2357
|
setClickEvent() {
|
|
2330
2358
|
popsDOMUtils.on(this.$ele.button, "click", void 0, (event) => {
|
|
@@ -2372,16 +2400,19 @@ export const PanelHandleContentDetails = () => {
|
|
|
2372
2400
|
if (formConfig.rightText) {
|
|
2373
2401
|
rightText = /*html*/ `<p class="pops-panel-item-right-text">${formConfig.rightText}</p>`;
|
|
2374
2402
|
}
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2403
|
+
PopsSafeUtils.setSafeHTML(
|
|
2404
|
+
$li,
|
|
2405
|
+
/*html*/ `
|
|
2406
|
+
<div class="pops-panel-item-left-text">
|
|
2407
|
+
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>
|
|
2408
|
+
${leftDescriptionText}
|
|
2409
|
+
</div>
|
|
2410
|
+
<div class="pops-panel-deepMenu">
|
|
2411
|
+
${rightText}
|
|
2412
|
+
${arrowRightIconHTML}
|
|
2413
|
+
</div>
|
|
2414
|
+
`
|
|
2415
|
+
);
|
|
2385
2416
|
const PopsPanelDeepMenu = {
|
|
2386
2417
|
[Symbol.toStringTag]: "PopsPanelDeepMenu",
|
|
2387
2418
|
$ele: {
|
|
@@ -2418,20 +2449,25 @@ export const PanelHandleContentDetails = () => {
|
|
|
2418
2449
|
let formHeaderDivElement = popsDOMUtils.createElement("div", {
|
|
2419
2450
|
className: "pops-panel-forms-container-item-header-text",
|
|
2420
2451
|
});
|
|
2421
|
-
|
|
2452
|
+
PopsSafeUtils.setSafeHTML(
|
|
2453
|
+
formHeaderDivElement,
|
|
2454
|
+
formConfig_forms["text"]
|
|
2455
|
+
);
|
|
2422
2456
|
|
|
2423
2457
|
if (formConfig_forms.isFold) {
|
|
2424
2458
|
/* 添加第一个 */
|
|
2425
2459
|
/* 加进容器内 */
|
|
2426
|
-
|
|
2460
|
+
PopsSafeUtils.setSafeHTML(
|
|
2461
|
+
formHeaderDivElement,
|
|
2462
|
+
/*html*/ `
|
|
2427
2463
|
<p>${formConfig_forms.text}</p>
|
|
2428
2464
|
<i class="pops-panel-forms-fold-container-icon">
|
|
2429
2465
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
|
|
2430
2466
|
<path d="M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"></path>
|
|
2431
2467
|
</svg>
|
|
2432
2468
|
</i>
|
|
2433
|
-
|
|
2434
|
-
|
|
2469
|
+
`
|
|
2470
|
+
);
|
|
2435
2471
|
// 添加点击事件
|
|
2436
2472
|
popsDOMUtils.on(formHeaderDivElement, "click", (event) => {
|
|
2437
2473
|
if (formContainerListElement.hasAttribute("data-fold-enable")) {
|
|
@@ -2671,18 +2707,23 @@ export const PanelHandleContentDetails = () => {
|
|
|
2671
2707
|
let formHeaderDivElement = popsDOMUtils.createElement("div", {
|
|
2672
2708
|
className: "pops-panel-forms-container-item-header-text",
|
|
2673
2709
|
});
|
|
2674
|
-
|
|
2710
|
+
PopsSafeUtils.setSafeHTML(
|
|
2711
|
+
formHeaderDivElement,
|
|
2712
|
+
formConfig_forms["text"]
|
|
2713
|
+
);
|
|
2675
2714
|
if (formConfig_forms.isFold) {
|
|
2676
2715
|
/* 加进容器内 */
|
|
2677
|
-
|
|
2716
|
+
PopsSafeUtils.setSafeHTML(
|
|
2717
|
+
formHeaderDivElement,
|
|
2718
|
+
/*html*/ `
|
|
2678
2719
|
<p>${formConfig_forms.text}</p>
|
|
2679
2720
|
<i class="pops-panel-forms-fold-container-icon">
|
|
2680
2721
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
|
|
2681
2722
|
<path d="M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"></path>
|
|
2682
2723
|
</svg>
|
|
2683
2724
|
</i>
|
|
2684
|
-
|
|
2685
|
-
|
|
2725
|
+
`
|
|
2726
|
+
);
|
|
2686
2727
|
// 添加点击事件
|
|
2687
2728
|
popsDOMUtils.on(formHeaderDivElement, "click", (event) => {
|
|
2688
2729
|
if (formContainerListElement.hasAttribute("data-fold-enable")) {
|
|
@@ -2784,7 +2825,10 @@ export const PanelHandleContentDetails = () => {
|
|
|
2784
2825
|
let containerHeaderTitleLIElement = document.createElement("li");
|
|
2785
2826
|
(containerHeaderTitleLIElement as any)["__asideConfig__"] =
|
|
2786
2827
|
asideConfig;
|
|
2787
|
-
|
|
2828
|
+
PopsSafeUtils.setSafeHTML(
|
|
2829
|
+
containerHeaderTitleLIElement,
|
|
2830
|
+
headerTitleText
|
|
2831
|
+
);
|
|
2788
2832
|
this.sectionContainerHeaderULElement.appendChild(
|
|
2789
2833
|
containerHeaderTitleLIElement
|
|
2790
2834
|
);
|
|
@@ -37,9 +37,15 @@ export class PopsRightClickMenu {
|
|
|
37
37
|
]);
|
|
38
38
|
|
|
39
39
|
if (config.style != null) {
|
|
40
|
-
let cssNode =
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
let cssNode = popsDOMUtils.createElement(
|
|
41
|
+
"style",
|
|
42
|
+
{
|
|
43
|
+
innerHTML: config.style,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
type: "text/css",
|
|
47
|
+
}
|
|
48
|
+
);
|
|
43
49
|
$shadowRoot.appendChild(cssNode);
|
|
44
50
|
}
|
|
45
51
|
|