@whitesev/pops 1.9.6 → 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 +307 -177
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +307 -177
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +307 -177
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +307 -177
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +307 -177
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +307 -177
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/components/panel/selectType.d.ts +6 -0
- 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 +270 -138
- package/src/components/panel/config.ts +3 -0
- package/src/components/panel/selectType.ts +8 -0
- 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/dist/index.esm.js
CHANGED
|
@@ -310,6 +310,31 @@ class PopsUtils {
|
|
|
310
310
|
}
|
|
311
311
|
const popsUtils = new PopsUtils();
|
|
312
312
|
|
|
313
|
+
const PopsSafeUtils = {
|
|
314
|
+
/**
|
|
315
|
+
* 设置安全的html
|
|
316
|
+
*/
|
|
317
|
+
setSafeHTML($el, text) {
|
|
318
|
+
// 创建 TrustedHTML 策略(需 CSP 允许)
|
|
319
|
+
try {
|
|
320
|
+
$el.innerHTML = text;
|
|
321
|
+
}
|
|
322
|
+
catch (error) {
|
|
323
|
+
// @ts-ignore
|
|
324
|
+
if (globalThis.trustedTypes) {
|
|
325
|
+
// @ts-ignore
|
|
326
|
+
const policy = globalThis.trustedTypes.createPolicy("safe-innerHTML", {
|
|
327
|
+
createHTML: (html) => html,
|
|
328
|
+
});
|
|
329
|
+
$el.innerHTML = policy.createHTML(text);
|
|
330
|
+
}
|
|
331
|
+
else {
|
|
332
|
+
throw new Error("trustedTypes is not defined");
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
};
|
|
337
|
+
|
|
313
338
|
class PopsDOMUtilsEvent {
|
|
314
339
|
on(element, eventType, selector, callback, option) {
|
|
315
340
|
/**
|
|
@@ -1247,7 +1272,7 @@ class PopsDOMUtils extends PopsDOMUtilsEvent {
|
|
|
1247
1272
|
attributes) {
|
|
1248
1273
|
let tempElement = PopsCore.document.createElement(tagName);
|
|
1249
1274
|
if (typeof property === "string") {
|
|
1250
|
-
tempElement
|
|
1275
|
+
PopsSafeUtils.setSafeHTML(tempElement, property);
|
|
1251
1276
|
return tempElement;
|
|
1252
1277
|
}
|
|
1253
1278
|
if (property == null) {
|
|
@@ -1258,6 +1283,11 @@ class PopsDOMUtils extends PopsDOMUtilsEvent {
|
|
|
1258
1283
|
}
|
|
1259
1284
|
Object.keys(property).forEach((key) => {
|
|
1260
1285
|
let value = property[key];
|
|
1286
|
+
if (key === "innerHTML") {
|
|
1287
|
+
PopsSafeUtils.setSafeHTML(tempElement, value);
|
|
1288
|
+
return;
|
|
1289
|
+
}
|
|
1290
|
+
// @ts-ignore
|
|
1261
1291
|
tempElement[key] = value;
|
|
1262
1292
|
});
|
|
1263
1293
|
Object.keys(attributes).forEach((key) => {
|
|
@@ -1460,7 +1490,7 @@ class PopsDOMUtils extends PopsDOMUtilsEvent {
|
|
|
1460
1490
|
}
|
|
1461
1491
|
function parseHTMLByCreateDom() {
|
|
1462
1492
|
let tempDIV = PopsCore.document.createElement("div");
|
|
1463
|
-
tempDIV
|
|
1493
|
+
PopsSafeUtils.setSafeHTML(tempDIV, html);
|
|
1464
1494
|
if (isComplete) {
|
|
1465
1495
|
return tempDIV;
|
|
1466
1496
|
}
|
|
@@ -4856,26 +4886,29 @@ class PopsFolder {
|
|
|
4856
4886
|
fileNameElement.className = "pops-folder-list-table__body-td";
|
|
4857
4887
|
fileTimeElement.className = "pops-folder-list-table__body-td";
|
|
4858
4888
|
fileFormatSize.className = "pops-folder-list-table__body-td";
|
|
4859
|
-
fileNameElement
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4889
|
+
PopsSafeUtils.setSafeHTML(fileNameElement,
|
|
4890
|
+
/*html*/ `
|
|
4891
|
+
<div class="pops-folder-list-file-name cursor-p">
|
|
4892
|
+
<div>
|
|
4893
|
+
<img src="${fileIcon}" alt="${fileType}" class="pops-folder-list-file-icon u-file-icon u-file-icon--list">
|
|
4894
|
+
<a title="${fileName}" class="pops-folder-list-file-name-title-text inline-block-v-middle text-ellip list-name-text">
|
|
4895
|
+
${fileName}
|
|
4896
|
+
</a>
|
|
4897
|
+
</div>
|
|
4898
|
+
</div>
|
|
4899
|
+
`);
|
|
4900
|
+
PopsSafeUtils.setSafeHTML(fileTimeElement,
|
|
4901
|
+
/*html*/ `
|
|
4902
|
+
<div class="pops-folder-list__time">
|
|
4903
|
+
<span>${latestTime}</span>
|
|
4904
|
+
</div>
|
|
4905
|
+
`);
|
|
4906
|
+
PopsSafeUtils.setSafeHTML(fileFormatSize,
|
|
4907
|
+
/*html*/ `
|
|
4908
|
+
<div class="pops-folder-list-format-size">
|
|
4909
|
+
<span>${fileSize}</span>
|
|
4910
|
+
</div>
|
|
4911
|
+
`);
|
|
4879
4912
|
/* 存储原来的值 */
|
|
4880
4913
|
let __value__ = {
|
|
4881
4914
|
fileName: origin_fileName,
|
|
@@ -4936,17 +4969,18 @@ class PopsFolder {
|
|
|
4936
4969
|
}
|
|
4937
4970
|
folderELement.className = "pops-folder-list-table__body-row";
|
|
4938
4971
|
fileNameElement.className = "pops-folder-list-table__body-td";
|
|
4939
|
-
fileNameElement
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4972
|
+
PopsSafeUtils.setSafeHTML(fileNameElement,
|
|
4973
|
+
/*html*/ `
|
|
4974
|
+
<div class="pops-folder-list-file-name pops-mobile-folder-list-file-name cursor-p">
|
|
4975
|
+
<img src="${fileIcon}" alt="${fileType}" class="pops-folder-list-file-icon u-file-icon u-file-icon--list">
|
|
4976
|
+
<div>
|
|
4977
|
+
<a title="${fileName}" class="pops-folder-list-file-name-title-text inline-block-v-middle text-ellip list-name-text">
|
|
4978
|
+
${fileName}
|
|
4979
|
+
</a>
|
|
4980
|
+
<span>${latestTime} ${fileSize}</span>
|
|
4981
|
+
</div>
|
|
4982
|
+
</div>
|
|
4983
|
+
`);
|
|
4950
4984
|
/* 存储原来的值 */
|
|
4951
4985
|
let __value__ = {
|
|
4952
4986
|
fileName: origin_fileName,
|
|
@@ -4966,7 +5000,7 @@ class PopsFolder {
|
|
|
4966
5000
|
* 清空每行的元素
|
|
4967
5001
|
*/
|
|
4968
5002
|
function clearFolerRow() {
|
|
4969
|
-
folderListBodyElement
|
|
5003
|
+
PopsSafeUtils.setSafeHTML(folderListBodyElement, "");
|
|
4970
5004
|
}
|
|
4971
5005
|
function getArrowIconElement() {
|
|
4972
5006
|
let iconArrowElement = popsDOMUtils.createElement("div", {
|
|
@@ -5540,6 +5574,7 @@ const PopsPanelConfig = () => {
|
|
|
5540
5574
|
disable() {
|
|
5541
5575
|
return false;
|
|
5542
5576
|
},
|
|
5577
|
+
forms: [],
|
|
5543
5578
|
},
|
|
5544
5579
|
{
|
|
5545
5580
|
value: "text",
|
|
@@ -5547,6 +5582,7 @@ const PopsPanelConfig = () => {
|
|
|
5547
5582
|
disable() {
|
|
5548
5583
|
return false;
|
|
5549
5584
|
},
|
|
5585
|
+
forms: [],
|
|
5550
5586
|
},
|
|
5551
5587
|
{
|
|
5552
5588
|
value: "html",
|
|
@@ -5554,6 +5590,7 @@ const PopsPanelConfig = () => {
|
|
|
5554
5590
|
disable() {
|
|
5555
5591
|
return false;
|
|
5556
5592
|
},
|
|
5593
|
+
forms: [],
|
|
5557
5594
|
},
|
|
5558
5595
|
],
|
|
5559
5596
|
},
|
|
@@ -5962,8 +5999,8 @@ const PanelHandleContentDetails = () => {
|
|
|
5962
5999
|
* 清空container容器的元素
|
|
5963
6000
|
*/
|
|
5964
6001
|
clearContainer() {
|
|
5965
|
-
this.sectionContainerHeaderULElement
|
|
5966
|
-
this.sectionContainerULElement
|
|
6002
|
+
PopsSafeUtils.setSafeHTML(this.sectionContainerHeaderULElement, "");
|
|
6003
|
+
PopsSafeUtils.setSafeHTML(this.sectionContainerULElement, "");
|
|
5967
6004
|
this.$el.$content
|
|
5968
6005
|
?.querySelectorAll("section.pops-panel-deepMenu-container")
|
|
5969
6006
|
.forEach((ele) => ele.remove());
|
|
@@ -6049,8 +6086,9 @@ const PanelHandleContentDetails = () => {
|
|
|
6049
6086
|
createAsideItem(asideConfig) {
|
|
6050
6087
|
let liElement = document.createElement("li");
|
|
6051
6088
|
liElement.id = asideConfig.id;
|
|
6089
|
+
// @ts-ignore
|
|
6052
6090
|
liElement["__forms__"] = asideConfig.forms;
|
|
6053
|
-
liElement
|
|
6091
|
+
PopsSafeUtils.setSafeHTML(liElement, asideConfig.title);
|
|
6054
6092
|
/* 处理className */
|
|
6055
6093
|
this.setElementClassName(liElement, asideConfig.className);
|
|
6056
6094
|
this.setElementAttributes(liElement, asideConfig.attributes);
|
|
@@ -6073,18 +6111,19 @@ const PanelHandleContentDetails = () => {
|
|
|
6073
6111
|
if (Boolean(formConfig.description)) {
|
|
6074
6112
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
6075
6113
|
}
|
|
6076
|
-
liElement
|
|
6077
|
-
|
|
6078
|
-
<
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
<
|
|
6083
|
-
|
|
6084
|
-
<
|
|
6085
|
-
|
|
6086
|
-
|
|
6087
|
-
|
|
6114
|
+
PopsSafeUtils.setSafeHTML(liElement,
|
|
6115
|
+
/*html*/ `
|
|
6116
|
+
<div class="pops-panel-item-left-text">
|
|
6117
|
+
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>
|
|
6118
|
+
${leftDescriptionText}
|
|
6119
|
+
</div>
|
|
6120
|
+
<div class="pops-panel-switch">
|
|
6121
|
+
<input class="pops-panel-switch__input" type="checkbox">
|
|
6122
|
+
<span class="pops-panel-switch__core">
|
|
6123
|
+
<div class="pops-panel-switch__action">
|
|
6124
|
+
</div>
|
|
6125
|
+
</span>
|
|
6126
|
+
</div>`);
|
|
6088
6127
|
const PopsPanelSwitch = {
|
|
6089
6128
|
[Symbol.toStringTag]: "PopsPanelSwitch",
|
|
6090
6129
|
$data: {
|
|
@@ -6174,14 +6213,16 @@ const PanelHandleContentDetails = () => {
|
|
|
6174
6213
|
if (Boolean(formConfig.description)) {
|
|
6175
6214
|
leftDescriptionText = `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
6176
6215
|
}
|
|
6177
|
-
liElement
|
|
6178
|
-
|
|
6179
|
-
<
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
<
|
|
6184
|
-
|
|
6216
|
+
PopsSafeUtils.setSafeHTML(liElement,
|
|
6217
|
+
/*html*/ `
|
|
6218
|
+
<div class="pops-panel-item-left-text">
|
|
6219
|
+
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>
|
|
6220
|
+
${leftDescriptionText}
|
|
6221
|
+
</div>
|
|
6222
|
+
<div class="pops-panel-slider">
|
|
6223
|
+
<input type="range" min="${formConfig.min}" max="${formConfig.max}">
|
|
6224
|
+
</div>
|
|
6225
|
+
`);
|
|
6185
6226
|
let rangeInputElement = liElement.querySelector(".pops-panel-slider input[type=range]");
|
|
6186
6227
|
if (formConfig.step) {
|
|
6187
6228
|
rangeInputElement.setAttribute("step", formConfig.step.toString());
|
|
@@ -6237,19 +6278,20 @@ const PanelHandleContentDetails = () => {
|
|
|
6237
6278
|
if (Boolean(formConfig.description)) {
|
|
6238
6279
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
6239
6280
|
}
|
|
6240
|
-
liElement
|
|
6241
|
-
|
|
6242
|
-
<
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
<div class="pops-slider pops-slider-width">
|
|
6246
|
-
<div class="pops-slider__runway">
|
|
6247
|
-
<div class="pops-slider__bar" style="width: 0%; left: 0%"></div>
|
|
6248
|
-
<div class="pops-slider__button-wrapper" style="left: 0%">
|
|
6249
|
-
<div class="pops-slider__button"></div>
|
|
6250
|
-
</div>
|
|
6281
|
+
PopsSafeUtils.setSafeHTML(liElement,
|
|
6282
|
+
/*html*/ `
|
|
6283
|
+
<div class="pops-panel-item-left-text" style="flex: 1;">
|
|
6284
|
+
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>
|
|
6285
|
+
${leftDescriptionText}
|
|
6251
6286
|
</div>
|
|
6252
|
-
|
|
6287
|
+
<div class="pops-slider pops-slider-width">
|
|
6288
|
+
<div class="pops-slider__runway">
|
|
6289
|
+
<div class="pops-slider__bar" style="width: 0%; left: 0%"></div>
|
|
6290
|
+
<div class="pops-slider__button-wrapper" style="left: 0%">
|
|
6291
|
+
<div class="pops-slider__button"></div>
|
|
6292
|
+
</div>
|
|
6293
|
+
</div>
|
|
6294
|
+
</div>`);
|
|
6253
6295
|
const PopsPanelSlider = {
|
|
6254
6296
|
[Symbol.toStringTag]: "PopsPanelSlider",
|
|
6255
6297
|
/**
|
|
@@ -6799,15 +6841,16 @@ const PanelHandleContentDetails = () => {
|
|
|
6799
6841
|
if (Boolean(formConfig.description)) {
|
|
6800
6842
|
leftDescriptionText = `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
6801
6843
|
}
|
|
6802
|
-
liElement
|
|
6803
|
-
|
|
6804
|
-
<
|
|
6805
|
-
|
|
6806
|
-
|
|
6807
|
-
|
|
6808
|
-
<
|
|
6809
|
-
|
|
6810
|
-
|
|
6844
|
+
PopsSafeUtils.setSafeHTML(liElement,
|
|
6845
|
+
/*html*/ `
|
|
6846
|
+
<div class="pops-panel-item-left-text">
|
|
6847
|
+
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>
|
|
6848
|
+
${leftDescriptionText}
|
|
6849
|
+
</div>
|
|
6850
|
+
<div class="pops-panel-input pops-user-select-none">
|
|
6851
|
+
<input type="${inputType}" placeholder="${formConfig.placeholder}">
|
|
6852
|
+
</div>
|
|
6853
|
+
`);
|
|
6811
6854
|
const PopsPanelInput = {
|
|
6812
6855
|
[Symbol.toStringTag]: "PopsPanelInput",
|
|
6813
6856
|
$ele: {
|
|
@@ -6850,11 +6893,12 @@ const PanelHandleContentDetails = () => {
|
|
|
6850
6893
|
initEle() {
|
|
6851
6894
|
this.$ele.input.parentElement.insertBefore(this.$ele.inputSpanIcon, this.$ele.input.nextSibling);
|
|
6852
6895
|
this.$ele.inputSpanIcon.className = "pops-panel-input__suffix";
|
|
6853
|
-
this.$ele.inputSpanIcon
|
|
6854
|
-
|
|
6855
|
-
<
|
|
6856
|
-
|
|
6857
|
-
|
|
6896
|
+
PopsSafeUtils.setSafeHTML(this.$ele.inputSpanIcon,
|
|
6897
|
+
/*html*/ `
|
|
6898
|
+
<span class="pops-panel-input__suffix-inner">
|
|
6899
|
+
<i class="pops-panel-icon"></i>
|
|
6900
|
+
</span>
|
|
6901
|
+
`);
|
|
6858
6902
|
this.$ele.inputSpanIconInner =
|
|
6859
6903
|
this.$ele.inputSpanIcon.querySelector(".pops-panel-input__suffix-inner");
|
|
6860
6904
|
this.$ele.icon =
|
|
@@ -6889,7 +6933,7 @@ const PanelHandleContentDetails = () => {
|
|
|
6889
6933
|
},
|
|
6890
6934
|
/**
|
|
6891
6935
|
* 设置input元素的type
|
|
6892
|
-
* @param
|
|
6936
|
+
* @param [typeValue="text"] type值
|
|
6893
6937
|
*/
|
|
6894
6938
|
setInputType(typeValue = "text") {
|
|
6895
6939
|
this.$ele.input.setAttribute("type", typeValue);
|
|
@@ -6898,14 +6942,14 @@ const PanelHandleContentDetails = () => {
|
|
|
6898
6942
|
* 删除图标按钮
|
|
6899
6943
|
*/
|
|
6900
6944
|
removeCircleIcon() {
|
|
6901
|
-
this.$ele.icon
|
|
6945
|
+
PopsSafeUtils.setSafeHTML(this.$ele.icon, "");
|
|
6902
6946
|
},
|
|
6903
6947
|
/**
|
|
6904
6948
|
* 添加清空图标按钮
|
|
6905
|
-
* @param
|
|
6949
|
+
* @param [svgHTML=pops.config.iconSVG.circleClose] svg图标,默认为清空的图标
|
|
6906
6950
|
*/
|
|
6907
6951
|
setCircleIcon(svgHTML = pops.config.iconSVG.circleClose) {
|
|
6908
|
-
this.$ele.icon
|
|
6952
|
+
PopsSafeUtils.setSafeHTML(this.$ele.icon, svgHTML);
|
|
6909
6953
|
},
|
|
6910
6954
|
/**
|
|
6911
6955
|
* 添加图标按钮的点击事件
|
|
@@ -6994,16 +7038,17 @@ const PanelHandleContentDetails = () => {
|
|
|
6994
7038
|
if (Boolean(formConfig.description)) {
|
|
6995
7039
|
leftDescriptionText = `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
6996
7040
|
}
|
|
6997
|
-
liElement
|
|
6998
|
-
|
|
6999
|
-
<
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
<
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
|
|
7041
|
+
PopsSafeUtils.setSafeHTML(liElement,
|
|
7042
|
+
/*html*/ `
|
|
7043
|
+
<div class="pops-panel-item-left-text">
|
|
7044
|
+
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>
|
|
7045
|
+
${leftDescriptionText}
|
|
7046
|
+
</div>
|
|
7047
|
+
<div class="pops-panel-textarea">
|
|
7048
|
+
<textarea placeholder="${formConfig.placeholder ?? ""}">
|
|
7049
|
+
</textarea>
|
|
7050
|
+
</div>
|
|
7051
|
+
`);
|
|
7007
7052
|
const PopsPanelTextArea = {
|
|
7008
7053
|
[Symbol.toStringTag]: "PopsPanelTextArea",
|
|
7009
7054
|
$ele: {
|
|
@@ -7057,6 +7102,7 @@ const PanelHandleContentDetails = () => {
|
|
|
7057
7102
|
* @param formConfig
|
|
7058
7103
|
*/
|
|
7059
7104
|
createSectionContainerItem_select(formConfig) {
|
|
7105
|
+
const that = this;
|
|
7060
7106
|
let liElement = document.createElement("li");
|
|
7061
7107
|
liElement["__formConfig__"] = formConfig;
|
|
7062
7108
|
this.setElementClassName(liElement, formConfig.className);
|
|
@@ -7067,15 +7113,16 @@ const PanelHandleContentDetails = () => {
|
|
|
7067
7113
|
if (Boolean(formConfig.description)) {
|
|
7068
7114
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
7069
7115
|
}
|
|
7070
|
-
liElement
|
|
7071
|
-
|
|
7072
|
-
<
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
|
|
7076
|
-
<select
|
|
7077
|
-
|
|
7078
|
-
|
|
7116
|
+
PopsSafeUtils.setSafeHTML(liElement,
|
|
7117
|
+
/*html*/ `
|
|
7118
|
+
<div class="pops-panel-item-left-text">
|
|
7119
|
+
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>
|
|
7120
|
+
${leftDescriptionText}
|
|
7121
|
+
</div>
|
|
7122
|
+
<div class="pops-panel-select pops-user-select-none">
|
|
7123
|
+
<select></select>
|
|
7124
|
+
</div>
|
|
7125
|
+
`);
|
|
7079
7126
|
const PopsPanelSelect = {
|
|
7080
7127
|
[Symbol.toStringTag]: "PopsPanelSelect",
|
|
7081
7128
|
$ele: {
|
|
@@ -7085,6 +7132,7 @@ const PanelHandleContentDetails = () => {
|
|
|
7085
7132
|
$eleKey: {
|
|
7086
7133
|
disable: "__disable__",
|
|
7087
7134
|
value: "__value__",
|
|
7135
|
+
forms: "__forms__",
|
|
7088
7136
|
},
|
|
7089
7137
|
$data: {
|
|
7090
7138
|
defaultValue: formConfig.getValue(),
|
|
@@ -7115,31 +7163,50 @@ const PanelHandleContentDetails = () => {
|
|
|
7115
7163
|
getNodeValue($ele, key) {
|
|
7116
7164
|
return Reflect.get($ele, key);
|
|
7117
7165
|
},
|
|
7166
|
+
/**
|
|
7167
|
+
* 禁用选项
|
|
7168
|
+
*/
|
|
7118
7169
|
disable() {
|
|
7119
7170
|
this.$ele.select.setAttribute("disabled", "true");
|
|
7120
7171
|
this.$ele.panelSelect.classList.add("pops-panel-select-disable");
|
|
7121
7172
|
},
|
|
7173
|
+
/**
|
|
7174
|
+
* 取消禁用
|
|
7175
|
+
*/
|
|
7122
7176
|
notDisable() {
|
|
7123
7177
|
this.$ele.select.removeAttribute("disabled");
|
|
7124
7178
|
this.$ele.panelSelect.classList.remove("pops-panel-select-disable");
|
|
7125
7179
|
},
|
|
7180
|
+
/**
|
|
7181
|
+
* 判断是否禁用
|
|
7182
|
+
*/
|
|
7126
7183
|
isDisabled() {
|
|
7127
7184
|
return (this.$ele.select.hasAttribute("disabled") ||
|
|
7128
7185
|
this.$ele.panelSelect.classList.contains("pops-panel-select-disable"));
|
|
7129
7186
|
},
|
|
7187
|
+
/**
|
|
7188
|
+
* 初始化选项
|
|
7189
|
+
*/
|
|
7130
7190
|
initOption() {
|
|
7131
7191
|
formConfig.data.forEach((dataItem) => {
|
|
7132
7192
|
// 初始化默认选中
|
|
7133
7193
|
let optionElement = document.createElement("option");
|
|
7134
7194
|
this.setNodeValue(optionElement, this.$eleKey.value, dataItem.value);
|
|
7135
7195
|
this.setNodeValue(optionElement, this.$eleKey.disable, dataItem.disable);
|
|
7196
|
+
this.setNodeValue(optionElement, this.$eleKey.forms, dataItem.forms);
|
|
7136
7197
|
if (dataItem.value === this.$data.defaultValue) {
|
|
7137
|
-
|
|
7198
|
+
this.setOptionSelected(optionElement);
|
|
7138
7199
|
}
|
|
7139
7200
|
optionElement.innerText = dataItem.text;
|
|
7140
7201
|
this.$ele.select.appendChild(optionElement);
|
|
7141
7202
|
});
|
|
7142
7203
|
},
|
|
7204
|
+
/**
|
|
7205
|
+
* 设置选项选中
|
|
7206
|
+
*/
|
|
7207
|
+
setOptionSelected($option) {
|
|
7208
|
+
$option.setAttribute("selected", "true");
|
|
7209
|
+
},
|
|
7143
7210
|
/** 检测所有option并设置禁用状态 */
|
|
7144
7211
|
setSelectOptionsDisableStatus() {
|
|
7145
7212
|
if (this.$ele.select.options && this.$ele.select.options.length) {
|
|
@@ -7167,9 +7234,11 @@ const PanelHandleContentDetails = () => {
|
|
|
7167
7234
|
getSelectOptionInfo($option) {
|
|
7168
7235
|
let optionValue = this.getNodeValue($option, this.$eleKey.value);
|
|
7169
7236
|
let optionText = $option.innerText || $option.textContent;
|
|
7237
|
+
let optionForms = this.getNodeValue($option, this.$eleKey.forms);
|
|
7170
7238
|
return {
|
|
7171
7239
|
value: optionValue,
|
|
7172
7240
|
text: optionText,
|
|
7241
|
+
forms: optionForms,
|
|
7173
7242
|
$option: $option,
|
|
7174
7243
|
};
|
|
7175
7244
|
},
|
|
@@ -7178,12 +7247,34 @@ const PanelHandleContentDetails = () => {
|
|
|
7178
7247
|
*/
|
|
7179
7248
|
setChangeEvent() {
|
|
7180
7249
|
popsDOMUtils.on(this.$ele.select, "change", void 0, (event) => {
|
|
7250
|
+
let $isSelectedElement = event.target[event.target.selectedIndex];
|
|
7251
|
+
let selectInfo = this.getSelectOptionInfo($isSelectedElement);
|
|
7181
7252
|
this.setSelectOptionsDisableStatus();
|
|
7182
7253
|
if (typeof formConfig.callback === "function") {
|
|
7183
|
-
let $isSelectedElement = event.target[event.target.selectedIndex];
|
|
7184
|
-
let selectInfo = this.getSelectOptionInfo($isSelectedElement);
|
|
7185
7254
|
formConfig.callback(event, selectInfo.value, selectInfo.text);
|
|
7186
7255
|
}
|
|
7256
|
+
let forms = typeof selectInfo.forms === "function"
|
|
7257
|
+
? selectInfo.forms()
|
|
7258
|
+
: selectInfo.forms;
|
|
7259
|
+
if (Array.isArray(forms)) {
|
|
7260
|
+
/* 如果成功创建,加入到中间容器中 */
|
|
7261
|
+
let childUListClassName = "pops-panel-select-child-forms";
|
|
7262
|
+
// 移除旧的元素
|
|
7263
|
+
while (liElement.nextElementSibling) {
|
|
7264
|
+
if (liElement.nextElementSibling.classList.contains(childUListClassName)) {
|
|
7265
|
+
liElement.nextElementSibling.remove();
|
|
7266
|
+
}
|
|
7267
|
+
else {
|
|
7268
|
+
break;
|
|
7269
|
+
}
|
|
7270
|
+
}
|
|
7271
|
+
let $childUList = document.createElement("ul");
|
|
7272
|
+
$childUList.className = childUListClassName;
|
|
7273
|
+
popsDOMUtils.after(liElement, $childUList);
|
|
7274
|
+
that.uListContainerAddItem(formConfig, {
|
|
7275
|
+
ulElement: $childUList,
|
|
7276
|
+
});
|
|
7277
|
+
}
|
|
7187
7278
|
});
|
|
7188
7279
|
},
|
|
7189
7280
|
/**
|
|
@@ -7218,33 +7309,34 @@ const PanelHandleContentDetails = () => {
|
|
|
7218
7309
|
if (Boolean(formConfig.description)) {
|
|
7219
7310
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
7220
7311
|
}
|
|
7221
|
-
liElement
|
|
7222
|
-
|
|
7223
|
-
<
|
|
7224
|
-
|
|
7225
|
-
|
|
7226
|
-
|
|
7227
|
-
<div class="
|
|
7228
|
-
<div class="el-
|
|
7229
|
-
|
|
7230
|
-
|
|
7231
|
-
|
|
7312
|
+
PopsSafeUtils.setSafeHTML(liElement,
|
|
7313
|
+
/*html*/ `
|
|
7314
|
+
<div class="pops-panel-item-left-text">
|
|
7315
|
+
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>
|
|
7316
|
+
${leftDescriptionText}
|
|
7317
|
+
</div>
|
|
7318
|
+
<div class="pops-panel-select-multiple">
|
|
7319
|
+
<div class="el-select__wrapper">
|
|
7320
|
+
<div class="el-select__selection">
|
|
7321
|
+
<!-- 这个是用于手动输入的,这里暂不适配 -->
|
|
7322
|
+
<div class="el-select__selected-item el-select__input-wrapper">
|
|
7323
|
+
|
|
7324
|
+
</div>
|
|
7325
|
+
<!-- 这个是placeholder -->
|
|
7326
|
+
<div class="el-select__selected-item el-select__placeholder">
|
|
7327
|
+
</div>
|
|
7232
7328
|
</div>
|
|
7233
|
-
<!--
|
|
7234
|
-
<div class="el-
|
|
7329
|
+
<!-- 下拉箭头 -->
|
|
7330
|
+
<div class="el-select__suffix">
|
|
7331
|
+
<i class="el-icon el-select__caret el-select__icon">
|
|
7332
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
|
|
7333
|
+
<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>
|
|
7334
|
+
</svg>
|
|
7335
|
+
</i>
|
|
7235
7336
|
</div>
|
|
7236
7337
|
</div>
|
|
7237
|
-
<!-- 下拉箭头 -->
|
|
7238
|
-
<div class="el-select__suffix">
|
|
7239
|
-
<i class="el-icon el-select__caret el-select__icon">
|
|
7240
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
|
|
7241
|
-
<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>
|
|
7242
|
-
</svg>
|
|
7243
|
-
</i>
|
|
7244
|
-
</div>
|
|
7245
7338
|
</div>
|
|
7246
|
-
|
|
7247
|
-
`;
|
|
7339
|
+
`);
|
|
7248
7340
|
const PopsPanelSelectMultiple = {
|
|
7249
7341
|
[Symbol.toStringTag]: "PopsPanelSelectMultiple",
|
|
7250
7342
|
$el: {
|
|
@@ -7369,7 +7461,7 @@ const PanelHandleContentDetails = () => {
|
|
|
7369
7461
|
/** 关闭图标 */
|
|
7370
7462
|
const $closeIcon = $selectedItem.querySelector(".el-icon.el-tag__close");
|
|
7371
7463
|
if (data.isHTML) {
|
|
7372
|
-
$tagText
|
|
7464
|
+
PopsSafeUtils.setSafeHTML($tagText, data.text);
|
|
7373
7465
|
}
|
|
7374
7466
|
else {
|
|
7375
7467
|
$tagText.innerText = data.text;
|
|
@@ -7522,12 +7614,28 @@ const PanelHandleContentDetails = () => {
|
|
|
7522
7614
|
Reflect.set($item, "data-info", dataInfo);
|
|
7523
7615
|
return $item;
|
|
7524
7616
|
}
|
|
7617
|
+
/**
|
|
7618
|
+
* 设置选择项的禁用状态
|
|
7619
|
+
*/
|
|
7620
|
+
function setSelectItemDisabled($el) {
|
|
7621
|
+
$el.setAttribute("aria-disabled", "true");
|
|
7622
|
+
}
|
|
7623
|
+
/**
|
|
7624
|
+
* 移除选择项的禁用状态
|
|
7625
|
+
*/
|
|
7626
|
+
function removeSelectItemDisabled($el) {
|
|
7627
|
+
$el.removeAttribute("aria-disabled");
|
|
7628
|
+
$el.removeAttribute("disabled");
|
|
7629
|
+
}
|
|
7525
7630
|
/**
|
|
7526
7631
|
* 设置选择项的点击事件
|
|
7527
7632
|
*/
|
|
7528
7633
|
function setSelectElementClickEvent($ele) {
|
|
7529
7634
|
popsDOMUtils.on($ele, "click", (event) => {
|
|
7530
7635
|
popsDOMUtils.preventEvent(event);
|
|
7636
|
+
if ($ele.hasAttribute("disabled") || $ele.ariaDisabled) {
|
|
7637
|
+
return;
|
|
7638
|
+
}
|
|
7531
7639
|
if (typeof formConfig.clickCallBack === "function") {
|
|
7532
7640
|
let clickResult = formConfig.clickCallBack(event, getAllSelectedInfo());
|
|
7533
7641
|
if (typeof clickResult === "boolean" && !clickResult) {
|
|
@@ -7593,7 +7701,6 @@ const PanelHandleContentDetails = () => {
|
|
|
7593
7701
|
--el-fill-color-light: #f5f7fa;
|
|
7594
7702
|
}
|
|
7595
7703
|
.select-item{
|
|
7596
|
-
cursor: pointer;
|
|
7597
7704
|
cursor: pointer;
|
|
7598
7705
|
font-size: var(--el-font-size-base);
|
|
7599
7706
|
padding: 0 32px 0 20px;
|
|
@@ -7606,6 +7713,12 @@ const PanelHandleContentDetails = () => {
|
|
|
7606
7713
|
line-height: 34px;
|
|
7607
7714
|
box-sizing: border-box;
|
|
7608
7715
|
}
|
|
7716
|
+
.select-item[aria-disabled],
|
|
7717
|
+
.select-item[disabled]{
|
|
7718
|
+
cursor: not-allowed;
|
|
7719
|
+
color: #a8abb2;
|
|
7720
|
+
background: unset;
|
|
7721
|
+
}
|
|
7609
7722
|
.select-item:hover{
|
|
7610
7723
|
background-color: var(--el-fill-color-light);
|
|
7611
7724
|
}
|
|
@@ -7643,6 +7756,15 @@ const PanelHandleContentDetails = () => {
|
|
|
7643
7756
|
$selectContainer.appendChild($select);
|
|
7644
7757
|
// 设置每一项的点击事件
|
|
7645
7758
|
setSelectElementClickEvent($select);
|
|
7759
|
+
// 设置禁用状态
|
|
7760
|
+
if (typeof item.disable === "function" &&
|
|
7761
|
+
item.disable(item.value)) {
|
|
7762
|
+
setSelectItemDisabled($select);
|
|
7763
|
+
// 后续不设置元素的选中状态
|
|
7764
|
+
return;
|
|
7765
|
+
}
|
|
7766
|
+
// 移除禁用状态
|
|
7767
|
+
removeSelectItemDisabled($select);
|
|
7646
7768
|
let findValue = selectedInfo.find((value) => value.value === item.value);
|
|
7647
7769
|
if (findValue) {
|
|
7648
7770
|
setItemSelected($select);
|
|
@@ -7746,18 +7868,19 @@ const PanelHandleContentDetails = () => {
|
|
|
7746
7868
|
if (Boolean(formConfig.description)) {
|
|
7747
7869
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
7748
7870
|
}
|
|
7749
|
-
liElement
|
|
7750
|
-
|
|
7751
|
-
<
|
|
7752
|
-
|
|
7753
|
-
|
|
7754
|
-
|
|
7755
|
-
<
|
|
7756
|
-
<
|
|
7757
|
-
|
|
7758
|
-
|
|
7759
|
-
|
|
7760
|
-
|
|
7871
|
+
PopsSafeUtils.setSafeHTML(liElement,
|
|
7872
|
+
/*html*/ `
|
|
7873
|
+
<div class="pops-panel-item-left-text">
|
|
7874
|
+
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>
|
|
7875
|
+
${leftDescriptionText}
|
|
7876
|
+
</div>
|
|
7877
|
+
<div class="pops-panel-button">
|
|
7878
|
+
<button class="pops-panel-button_inner">
|
|
7879
|
+
<i class="pops-bottom-icon"></i>
|
|
7880
|
+
<span class="pops-panel-button-text"></span>
|
|
7881
|
+
</button>
|
|
7882
|
+
</div>
|
|
7883
|
+
`);
|
|
7761
7884
|
const PopsPanelButton = {
|
|
7762
7885
|
[Symbol.toStringTag]: "PopsPanelButton",
|
|
7763
7886
|
$ele: {
|
|
@@ -7827,7 +7950,7 @@ const PanelHandleContentDetails = () => {
|
|
|
7827
7950
|
* 设置icon图标的svg
|
|
7828
7951
|
*/
|
|
7829
7952
|
setIconSVG(svgHTML) {
|
|
7830
|
-
this.$ele.icon
|
|
7953
|
+
PopsSafeUtils.setSafeHTML(this.$ele.icon, svgHTML);
|
|
7831
7954
|
},
|
|
7832
7955
|
/**
|
|
7833
7956
|
* 设置icon图标是否旋转
|
|
@@ -7866,7 +7989,7 @@ const PanelHandleContentDetails = () => {
|
|
|
7866
7989
|
* @param text
|
|
7867
7990
|
*/
|
|
7868
7991
|
setButtonText(text) {
|
|
7869
|
-
this.$ele.spanText
|
|
7992
|
+
PopsSafeUtils.setSafeHTML(this.$ele.spanText, text);
|
|
7870
7993
|
},
|
|
7871
7994
|
setClickEvent() {
|
|
7872
7995
|
popsDOMUtils.on(this.$ele.button, "click", void 0, (event) => {
|
|
@@ -7912,16 +8035,17 @@ const PanelHandleContentDetails = () => {
|
|
|
7912
8035
|
if (formConfig.rightText) {
|
|
7913
8036
|
rightText = /*html*/ `<p class="pops-panel-item-right-text">${formConfig.rightText}</p>`;
|
|
7914
8037
|
}
|
|
7915
|
-
$li
|
|
7916
|
-
|
|
7917
|
-
<
|
|
7918
|
-
|
|
7919
|
-
|
|
7920
|
-
|
|
7921
|
-
|
|
7922
|
-
|
|
7923
|
-
|
|
7924
|
-
|
|
8038
|
+
PopsSafeUtils.setSafeHTML($li,
|
|
8039
|
+
/*html*/ `
|
|
8040
|
+
<div class="pops-panel-item-left-text">
|
|
8041
|
+
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>
|
|
8042
|
+
${leftDescriptionText}
|
|
8043
|
+
</div>
|
|
8044
|
+
<div class="pops-panel-deepMenu">
|
|
8045
|
+
${rightText}
|
|
8046
|
+
${arrowRightIconHTML}
|
|
8047
|
+
</div>
|
|
8048
|
+
`);
|
|
7925
8049
|
const PopsPanelDeepMenu = {
|
|
7926
8050
|
[Symbol.toStringTag]: "PopsPanelDeepMenu",
|
|
7927
8051
|
$ele: {
|
|
@@ -7951,19 +8075,19 @@ const PanelHandleContentDetails = () => {
|
|
|
7951
8075
|
let formHeaderDivElement = popsDOMUtils.createElement("div", {
|
|
7952
8076
|
className: "pops-panel-forms-container-item-header-text",
|
|
7953
8077
|
});
|
|
7954
|
-
formHeaderDivElement
|
|
8078
|
+
PopsSafeUtils.setSafeHTML(formHeaderDivElement, formConfig_forms["text"]);
|
|
7955
8079
|
if (formConfig_forms.isFold) {
|
|
7956
8080
|
/* 添加第一个 */
|
|
7957
8081
|
/* 加进容器内 */
|
|
7958
|
-
formHeaderDivElement
|
|
8082
|
+
PopsSafeUtils.setSafeHTML(formHeaderDivElement,
|
|
8083
|
+
/*html*/ `
|
|
7959
8084
|
<p>${formConfig_forms.text}</p>
|
|
7960
8085
|
<i class="pops-panel-forms-fold-container-icon">
|
|
7961
8086
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
|
|
7962
8087
|
<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>
|
|
7963
8088
|
</svg>
|
|
7964
8089
|
</i>
|
|
7965
|
-
|
|
7966
|
-
`;
|
|
8090
|
+
`);
|
|
7967
8091
|
// 添加点击事件
|
|
7968
8092
|
popsDOMUtils.on(formHeaderDivElement, "click", (event) => {
|
|
7969
8093
|
if (formContainerListElement.hasAttribute("data-fold-enable")) {
|
|
@@ -8161,18 +8285,18 @@ const PanelHandleContentDetails = () => {
|
|
|
8161
8285
|
let formHeaderDivElement = popsDOMUtils.createElement("div", {
|
|
8162
8286
|
className: "pops-panel-forms-container-item-header-text",
|
|
8163
8287
|
});
|
|
8164
|
-
formHeaderDivElement
|
|
8288
|
+
PopsSafeUtils.setSafeHTML(formHeaderDivElement, formConfig_forms["text"]);
|
|
8165
8289
|
if (formConfig_forms.isFold) {
|
|
8166
8290
|
/* 加进容器内 */
|
|
8167
|
-
formHeaderDivElement
|
|
8291
|
+
PopsSafeUtils.setSafeHTML(formHeaderDivElement,
|
|
8292
|
+
/*html*/ `
|
|
8168
8293
|
<p>${formConfig_forms.text}</p>
|
|
8169
8294
|
<i class="pops-panel-forms-fold-container-icon">
|
|
8170
8295
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
|
|
8171
8296
|
<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>
|
|
8172
8297
|
</svg>
|
|
8173
8298
|
</i>
|
|
8174
|
-
|
|
8175
|
-
`;
|
|
8299
|
+
`);
|
|
8176
8300
|
// 添加点击事件
|
|
8177
8301
|
popsDOMUtils.on(formHeaderDivElement, "click", (event) => {
|
|
8178
8302
|
if (formContainerListElement.hasAttribute("data-fold-enable")) {
|
|
@@ -8258,7 +8382,7 @@ const PanelHandleContentDetails = () => {
|
|
|
8258
8382
|
let containerHeaderTitleLIElement = document.createElement("li");
|
|
8259
8383
|
containerHeaderTitleLIElement["__asideConfig__"] =
|
|
8260
8384
|
asideConfig;
|
|
8261
|
-
containerHeaderTitleLIElement
|
|
8385
|
+
PopsSafeUtils.setSafeHTML(containerHeaderTitleLIElement, headerTitleText);
|
|
8262
8386
|
this.sectionContainerHeaderULElement.appendChild(containerHeaderTitleLIElement);
|
|
8263
8387
|
}
|
|
8264
8388
|
let __forms__ = asideLiElement["__forms__"];
|
|
@@ -8547,9 +8671,11 @@ class PopsRightClickMenu {
|
|
|
8547
8671
|
pops.config.cssText.rightClickMenu,
|
|
8548
8672
|
]);
|
|
8549
8673
|
if (config.style != null) {
|
|
8550
|
-
let cssNode =
|
|
8551
|
-
|
|
8552
|
-
|
|
8674
|
+
let cssNode = popsDOMUtils.createElement("style", {
|
|
8675
|
+
innerHTML: config.style,
|
|
8676
|
+
}, {
|
|
8677
|
+
type: "text/css",
|
|
8678
|
+
});
|
|
8553
8679
|
$shadowRoot.appendChild(cssNode);
|
|
8554
8680
|
}
|
|
8555
8681
|
const PopsContextMenu = {
|
|
@@ -9031,8 +9157,11 @@ class PopsSearchSuggestion {
|
|
|
9031
9157
|
]);
|
|
9032
9158
|
if (config.style != null) {
|
|
9033
9159
|
let cssNode = document.createElement("style");
|
|
9034
|
-
|
|
9035
|
-
|
|
9160
|
+
popsDOMUtils.createElement("style", {
|
|
9161
|
+
innerHTML: config.style,
|
|
9162
|
+
}, {
|
|
9163
|
+
type: "text/css",
|
|
9164
|
+
});
|
|
9036
9165
|
$shadowRoot.appendChild(cssNode);
|
|
9037
9166
|
}
|
|
9038
9167
|
const SearchSuggestion = {
|
|
@@ -9409,7 +9538,7 @@ class PopsSearchSuggestion {
|
|
|
9409
9538
|
* 清空所有的搜索结果
|
|
9410
9539
|
*/
|
|
9411
9540
|
clearAllSearchItemLi() {
|
|
9412
|
-
SearchSuggestion.$el.$hintULContainer
|
|
9541
|
+
PopsSafeUtils.setSafeHTML(SearchSuggestion.$el.$hintULContainer, "");
|
|
9413
9542
|
},
|
|
9414
9543
|
/**
|
|
9415
9544
|
* 更新搜索建议框的位置(top、left)
|
|
@@ -9491,7 +9620,8 @@ class PopsSearchSuggestion {
|
|
|
9491
9620
|
* 动态更新CSS
|
|
9492
9621
|
*/
|
|
9493
9622
|
updateDynamicCSS() {
|
|
9494
|
-
|
|
9623
|
+
let cssText = this.getDynamicCSS();
|
|
9624
|
+
PopsSafeUtils.setSafeHTML(this.$el.$dynamicCSS, cssText);
|
|
9495
9625
|
},
|
|
9496
9626
|
/**
|
|
9497
9627
|
* 更新页面显示的搜索结果
|
|
@@ -9681,7 +9811,7 @@ class ToolTip {
|
|
|
9681
9811
|
if (text == null) {
|
|
9682
9812
|
text = this.getContent();
|
|
9683
9813
|
}
|
|
9684
|
-
this.$el.$content
|
|
9814
|
+
PopsSafeUtils.setSafeHTML(this.$el.$content, text);
|
|
9685
9815
|
}
|
|
9686
9816
|
/**
|
|
9687
9817
|
* 获取z-index
|
|
@@ -10053,7 +10183,7 @@ class Pops {
|
|
|
10053
10183
|
/** 配置 */
|
|
10054
10184
|
config = {
|
|
10055
10185
|
/** 版本号 */
|
|
10056
|
-
version: "
|
|
10186
|
+
version: "2025.3.2",
|
|
10057
10187
|
cssText: {
|
|
10058
10188
|
/** 主CSS */
|
|
10059
10189
|
index: indexCSS,
|
|
@@ -10158,7 +10288,7 @@ class Pops {
|
|
|
10158
10288
|
/* 处理获取当前所有的动画名 */
|
|
10159
10289
|
this.config.isInit = true;
|
|
10160
10290
|
let animationStyle = document.createElement("style");
|
|
10161
|
-
animationStyle
|
|
10291
|
+
PopsSafeUtils.setSafeHTML(animationStyle, this.config.cssText.anim);
|
|
10162
10292
|
popsDOMUtils.appendHead(animationStyle);
|
|
10163
10293
|
this.config.animation = null;
|
|
10164
10294
|
this.config.animation = PopsInstanceUtils.getKeyFrames(animationStyle.sheet);
|