@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.iife.js
CHANGED
|
@@ -313,6 +313,31 @@ var pops = (function () {
|
|
|
313
313
|
}
|
|
314
314
|
const popsUtils = new PopsUtils();
|
|
315
315
|
|
|
316
|
+
const PopsSafeUtils = {
|
|
317
|
+
/**
|
|
318
|
+
* 设置安全的html
|
|
319
|
+
*/
|
|
320
|
+
setSafeHTML($el, text) {
|
|
321
|
+
// 创建 TrustedHTML 策略(需 CSP 允许)
|
|
322
|
+
try {
|
|
323
|
+
$el.innerHTML = text;
|
|
324
|
+
}
|
|
325
|
+
catch (error) {
|
|
326
|
+
// @ts-ignore
|
|
327
|
+
if (globalThis.trustedTypes) {
|
|
328
|
+
// @ts-ignore
|
|
329
|
+
const policy = globalThis.trustedTypes.createPolicy("safe-innerHTML", {
|
|
330
|
+
createHTML: (html) => html,
|
|
331
|
+
});
|
|
332
|
+
$el.innerHTML = policy.createHTML(text);
|
|
333
|
+
}
|
|
334
|
+
else {
|
|
335
|
+
throw new Error("trustedTypes is not defined");
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
};
|
|
340
|
+
|
|
316
341
|
class PopsDOMUtilsEvent {
|
|
317
342
|
on(element, eventType, selector, callback, option) {
|
|
318
343
|
/**
|
|
@@ -1250,7 +1275,7 @@ var pops = (function () {
|
|
|
1250
1275
|
attributes) {
|
|
1251
1276
|
let tempElement = PopsCore.document.createElement(tagName);
|
|
1252
1277
|
if (typeof property === "string") {
|
|
1253
|
-
tempElement
|
|
1278
|
+
PopsSafeUtils.setSafeHTML(tempElement, property);
|
|
1254
1279
|
return tempElement;
|
|
1255
1280
|
}
|
|
1256
1281
|
if (property == null) {
|
|
@@ -1261,6 +1286,11 @@ var pops = (function () {
|
|
|
1261
1286
|
}
|
|
1262
1287
|
Object.keys(property).forEach((key) => {
|
|
1263
1288
|
let value = property[key];
|
|
1289
|
+
if (key === "innerHTML") {
|
|
1290
|
+
PopsSafeUtils.setSafeHTML(tempElement, value);
|
|
1291
|
+
return;
|
|
1292
|
+
}
|
|
1293
|
+
// @ts-ignore
|
|
1264
1294
|
tempElement[key] = value;
|
|
1265
1295
|
});
|
|
1266
1296
|
Object.keys(attributes).forEach((key) => {
|
|
@@ -1463,7 +1493,7 @@ var pops = (function () {
|
|
|
1463
1493
|
}
|
|
1464
1494
|
function parseHTMLByCreateDom() {
|
|
1465
1495
|
let tempDIV = PopsCore.document.createElement("div");
|
|
1466
|
-
tempDIV
|
|
1496
|
+
PopsSafeUtils.setSafeHTML(tempDIV, html);
|
|
1467
1497
|
if (isComplete) {
|
|
1468
1498
|
return tempDIV;
|
|
1469
1499
|
}
|
|
@@ -4859,26 +4889,29 @@ var pops = (function () {
|
|
|
4859
4889
|
fileNameElement.className = "pops-folder-list-table__body-td";
|
|
4860
4890
|
fileTimeElement.className = "pops-folder-list-table__body-td";
|
|
4861
4891
|
fileFormatSize.className = "pops-folder-list-table__body-td";
|
|
4862
|
-
fileNameElement
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4892
|
+
PopsSafeUtils.setSafeHTML(fileNameElement,
|
|
4893
|
+
/*html*/ `
|
|
4894
|
+
<div class="pops-folder-list-file-name cursor-p">
|
|
4895
|
+
<div>
|
|
4896
|
+
<img src="${fileIcon}" alt="${fileType}" class="pops-folder-list-file-icon u-file-icon u-file-icon--list">
|
|
4897
|
+
<a title="${fileName}" class="pops-folder-list-file-name-title-text inline-block-v-middle text-ellip list-name-text">
|
|
4898
|
+
${fileName}
|
|
4899
|
+
</a>
|
|
4900
|
+
</div>
|
|
4901
|
+
</div>
|
|
4902
|
+
`);
|
|
4903
|
+
PopsSafeUtils.setSafeHTML(fileTimeElement,
|
|
4904
|
+
/*html*/ `
|
|
4905
|
+
<div class="pops-folder-list__time">
|
|
4906
|
+
<span>${latestTime}</span>
|
|
4907
|
+
</div>
|
|
4908
|
+
`);
|
|
4909
|
+
PopsSafeUtils.setSafeHTML(fileFormatSize,
|
|
4910
|
+
/*html*/ `
|
|
4911
|
+
<div class="pops-folder-list-format-size">
|
|
4912
|
+
<span>${fileSize}</span>
|
|
4913
|
+
</div>
|
|
4914
|
+
`);
|
|
4882
4915
|
/* 存储原来的值 */
|
|
4883
4916
|
let __value__ = {
|
|
4884
4917
|
fileName: origin_fileName,
|
|
@@ -4939,17 +4972,18 @@ var pops = (function () {
|
|
|
4939
4972
|
}
|
|
4940
4973
|
folderELement.className = "pops-folder-list-table__body-row";
|
|
4941
4974
|
fileNameElement.className = "pops-folder-list-table__body-td";
|
|
4942
|
-
fileNameElement
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4975
|
+
PopsSafeUtils.setSafeHTML(fileNameElement,
|
|
4976
|
+
/*html*/ `
|
|
4977
|
+
<div class="pops-folder-list-file-name pops-mobile-folder-list-file-name cursor-p">
|
|
4978
|
+
<img src="${fileIcon}" alt="${fileType}" class="pops-folder-list-file-icon u-file-icon u-file-icon--list">
|
|
4979
|
+
<div>
|
|
4980
|
+
<a title="${fileName}" class="pops-folder-list-file-name-title-text inline-block-v-middle text-ellip list-name-text">
|
|
4981
|
+
${fileName}
|
|
4982
|
+
</a>
|
|
4983
|
+
<span>${latestTime} ${fileSize}</span>
|
|
4984
|
+
</div>
|
|
4985
|
+
</div>
|
|
4986
|
+
`);
|
|
4953
4987
|
/* 存储原来的值 */
|
|
4954
4988
|
let __value__ = {
|
|
4955
4989
|
fileName: origin_fileName,
|
|
@@ -4969,7 +5003,7 @@ var pops = (function () {
|
|
|
4969
5003
|
* 清空每行的元素
|
|
4970
5004
|
*/
|
|
4971
5005
|
function clearFolerRow() {
|
|
4972
|
-
folderListBodyElement
|
|
5006
|
+
PopsSafeUtils.setSafeHTML(folderListBodyElement, "");
|
|
4973
5007
|
}
|
|
4974
5008
|
function getArrowIconElement() {
|
|
4975
5009
|
let iconArrowElement = popsDOMUtils.createElement("div", {
|
|
@@ -5543,6 +5577,7 @@ var pops = (function () {
|
|
|
5543
5577
|
disable() {
|
|
5544
5578
|
return false;
|
|
5545
5579
|
},
|
|
5580
|
+
forms: [],
|
|
5546
5581
|
},
|
|
5547
5582
|
{
|
|
5548
5583
|
value: "text",
|
|
@@ -5550,6 +5585,7 @@ var pops = (function () {
|
|
|
5550
5585
|
disable() {
|
|
5551
5586
|
return false;
|
|
5552
5587
|
},
|
|
5588
|
+
forms: [],
|
|
5553
5589
|
},
|
|
5554
5590
|
{
|
|
5555
5591
|
value: "html",
|
|
@@ -5557,6 +5593,7 @@ var pops = (function () {
|
|
|
5557
5593
|
disable() {
|
|
5558
5594
|
return false;
|
|
5559
5595
|
},
|
|
5596
|
+
forms: [],
|
|
5560
5597
|
},
|
|
5561
5598
|
],
|
|
5562
5599
|
},
|
|
@@ -5965,8 +6002,8 @@ var pops = (function () {
|
|
|
5965
6002
|
* 清空container容器的元素
|
|
5966
6003
|
*/
|
|
5967
6004
|
clearContainer() {
|
|
5968
|
-
this.sectionContainerHeaderULElement
|
|
5969
|
-
this.sectionContainerULElement
|
|
6005
|
+
PopsSafeUtils.setSafeHTML(this.sectionContainerHeaderULElement, "");
|
|
6006
|
+
PopsSafeUtils.setSafeHTML(this.sectionContainerULElement, "");
|
|
5970
6007
|
this.$el.$content
|
|
5971
6008
|
?.querySelectorAll("section.pops-panel-deepMenu-container")
|
|
5972
6009
|
.forEach((ele) => ele.remove());
|
|
@@ -6052,8 +6089,9 @@ var pops = (function () {
|
|
|
6052
6089
|
createAsideItem(asideConfig) {
|
|
6053
6090
|
let liElement = document.createElement("li");
|
|
6054
6091
|
liElement.id = asideConfig.id;
|
|
6092
|
+
// @ts-ignore
|
|
6055
6093
|
liElement["__forms__"] = asideConfig.forms;
|
|
6056
|
-
liElement
|
|
6094
|
+
PopsSafeUtils.setSafeHTML(liElement, asideConfig.title);
|
|
6057
6095
|
/* 处理className */
|
|
6058
6096
|
this.setElementClassName(liElement, asideConfig.className);
|
|
6059
6097
|
this.setElementAttributes(liElement, asideConfig.attributes);
|
|
@@ -6076,18 +6114,19 @@ var pops = (function () {
|
|
|
6076
6114
|
if (Boolean(formConfig.description)) {
|
|
6077
6115
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
6078
6116
|
}
|
|
6079
|
-
liElement
|
|
6080
|
-
|
|
6081
|
-
<
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
|
|
6085
|
-
<
|
|
6086
|
-
|
|
6087
|
-
<
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6117
|
+
PopsSafeUtils.setSafeHTML(liElement,
|
|
6118
|
+
/*html*/ `
|
|
6119
|
+
<div class="pops-panel-item-left-text">
|
|
6120
|
+
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>
|
|
6121
|
+
${leftDescriptionText}
|
|
6122
|
+
</div>
|
|
6123
|
+
<div class="pops-panel-switch">
|
|
6124
|
+
<input class="pops-panel-switch__input" type="checkbox">
|
|
6125
|
+
<span class="pops-panel-switch__core">
|
|
6126
|
+
<div class="pops-panel-switch__action">
|
|
6127
|
+
</div>
|
|
6128
|
+
</span>
|
|
6129
|
+
</div>`);
|
|
6091
6130
|
const PopsPanelSwitch = {
|
|
6092
6131
|
[Symbol.toStringTag]: "PopsPanelSwitch",
|
|
6093
6132
|
$data: {
|
|
@@ -6177,14 +6216,16 @@ var pops = (function () {
|
|
|
6177
6216
|
if (Boolean(formConfig.description)) {
|
|
6178
6217
|
leftDescriptionText = `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
6179
6218
|
}
|
|
6180
|
-
liElement
|
|
6181
|
-
|
|
6182
|
-
<
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
<
|
|
6187
|
-
|
|
6219
|
+
PopsSafeUtils.setSafeHTML(liElement,
|
|
6220
|
+
/*html*/ `
|
|
6221
|
+
<div class="pops-panel-item-left-text">
|
|
6222
|
+
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>
|
|
6223
|
+
${leftDescriptionText}
|
|
6224
|
+
</div>
|
|
6225
|
+
<div class="pops-panel-slider">
|
|
6226
|
+
<input type="range" min="${formConfig.min}" max="${formConfig.max}">
|
|
6227
|
+
</div>
|
|
6228
|
+
`);
|
|
6188
6229
|
let rangeInputElement = liElement.querySelector(".pops-panel-slider input[type=range]");
|
|
6189
6230
|
if (formConfig.step) {
|
|
6190
6231
|
rangeInputElement.setAttribute("step", formConfig.step.toString());
|
|
@@ -6240,19 +6281,20 @@ var pops = (function () {
|
|
|
6240
6281
|
if (Boolean(formConfig.description)) {
|
|
6241
6282
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
6242
6283
|
}
|
|
6243
|
-
liElement
|
|
6244
|
-
|
|
6245
|
-
<
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
<div class="pops-slider pops-slider-width">
|
|
6249
|
-
<div class="pops-slider__runway">
|
|
6250
|
-
<div class="pops-slider__bar" style="width: 0%; left: 0%"></div>
|
|
6251
|
-
<div class="pops-slider__button-wrapper" style="left: 0%">
|
|
6252
|
-
<div class="pops-slider__button"></div>
|
|
6253
|
-
</div>
|
|
6284
|
+
PopsSafeUtils.setSafeHTML(liElement,
|
|
6285
|
+
/*html*/ `
|
|
6286
|
+
<div class="pops-panel-item-left-text" style="flex: 1;">
|
|
6287
|
+
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>
|
|
6288
|
+
${leftDescriptionText}
|
|
6254
6289
|
</div>
|
|
6255
|
-
|
|
6290
|
+
<div class="pops-slider pops-slider-width">
|
|
6291
|
+
<div class="pops-slider__runway">
|
|
6292
|
+
<div class="pops-slider__bar" style="width: 0%; left: 0%"></div>
|
|
6293
|
+
<div class="pops-slider__button-wrapper" style="left: 0%">
|
|
6294
|
+
<div class="pops-slider__button"></div>
|
|
6295
|
+
</div>
|
|
6296
|
+
</div>
|
|
6297
|
+
</div>`);
|
|
6256
6298
|
const PopsPanelSlider = {
|
|
6257
6299
|
[Symbol.toStringTag]: "PopsPanelSlider",
|
|
6258
6300
|
/**
|
|
@@ -6802,15 +6844,16 @@ var pops = (function () {
|
|
|
6802
6844
|
if (Boolean(formConfig.description)) {
|
|
6803
6845
|
leftDescriptionText = `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
6804
6846
|
}
|
|
6805
|
-
liElement
|
|
6806
|
-
|
|
6807
|
-
<
|
|
6808
|
-
|
|
6809
|
-
|
|
6810
|
-
|
|
6811
|
-
<
|
|
6812
|
-
|
|
6813
|
-
|
|
6847
|
+
PopsSafeUtils.setSafeHTML(liElement,
|
|
6848
|
+
/*html*/ `
|
|
6849
|
+
<div class="pops-panel-item-left-text">
|
|
6850
|
+
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>
|
|
6851
|
+
${leftDescriptionText}
|
|
6852
|
+
</div>
|
|
6853
|
+
<div class="pops-panel-input pops-user-select-none">
|
|
6854
|
+
<input type="${inputType}" placeholder="${formConfig.placeholder}">
|
|
6855
|
+
</div>
|
|
6856
|
+
`);
|
|
6814
6857
|
const PopsPanelInput = {
|
|
6815
6858
|
[Symbol.toStringTag]: "PopsPanelInput",
|
|
6816
6859
|
$ele: {
|
|
@@ -6853,11 +6896,12 @@ var pops = (function () {
|
|
|
6853
6896
|
initEle() {
|
|
6854
6897
|
this.$ele.input.parentElement.insertBefore(this.$ele.inputSpanIcon, this.$ele.input.nextSibling);
|
|
6855
6898
|
this.$ele.inputSpanIcon.className = "pops-panel-input__suffix";
|
|
6856
|
-
this.$ele.inputSpanIcon
|
|
6857
|
-
|
|
6858
|
-
<
|
|
6859
|
-
|
|
6860
|
-
|
|
6899
|
+
PopsSafeUtils.setSafeHTML(this.$ele.inputSpanIcon,
|
|
6900
|
+
/*html*/ `
|
|
6901
|
+
<span class="pops-panel-input__suffix-inner">
|
|
6902
|
+
<i class="pops-panel-icon"></i>
|
|
6903
|
+
</span>
|
|
6904
|
+
`);
|
|
6861
6905
|
this.$ele.inputSpanIconInner =
|
|
6862
6906
|
this.$ele.inputSpanIcon.querySelector(".pops-panel-input__suffix-inner");
|
|
6863
6907
|
this.$ele.icon =
|
|
@@ -6892,7 +6936,7 @@ var pops = (function () {
|
|
|
6892
6936
|
},
|
|
6893
6937
|
/**
|
|
6894
6938
|
* 设置input元素的type
|
|
6895
|
-
* @param
|
|
6939
|
+
* @param [typeValue="text"] type值
|
|
6896
6940
|
*/
|
|
6897
6941
|
setInputType(typeValue = "text") {
|
|
6898
6942
|
this.$ele.input.setAttribute("type", typeValue);
|
|
@@ -6901,14 +6945,14 @@ var pops = (function () {
|
|
|
6901
6945
|
* 删除图标按钮
|
|
6902
6946
|
*/
|
|
6903
6947
|
removeCircleIcon() {
|
|
6904
|
-
this.$ele.icon
|
|
6948
|
+
PopsSafeUtils.setSafeHTML(this.$ele.icon, "");
|
|
6905
6949
|
},
|
|
6906
6950
|
/**
|
|
6907
6951
|
* 添加清空图标按钮
|
|
6908
|
-
* @param
|
|
6952
|
+
* @param [svgHTML=pops.config.iconSVG.circleClose] svg图标,默认为清空的图标
|
|
6909
6953
|
*/
|
|
6910
6954
|
setCircleIcon(svgHTML = pops.config.iconSVG.circleClose) {
|
|
6911
|
-
this.$ele.icon
|
|
6955
|
+
PopsSafeUtils.setSafeHTML(this.$ele.icon, svgHTML);
|
|
6912
6956
|
},
|
|
6913
6957
|
/**
|
|
6914
6958
|
* 添加图标按钮的点击事件
|
|
@@ -6997,16 +7041,17 @@ var pops = (function () {
|
|
|
6997
7041
|
if (Boolean(formConfig.description)) {
|
|
6998
7042
|
leftDescriptionText = `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
6999
7043
|
}
|
|
7000
|
-
liElement
|
|
7001
|
-
|
|
7002
|
-
<
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
<
|
|
7007
|
-
|
|
7008
|
-
|
|
7009
|
-
|
|
7044
|
+
PopsSafeUtils.setSafeHTML(liElement,
|
|
7045
|
+
/*html*/ `
|
|
7046
|
+
<div class="pops-panel-item-left-text">
|
|
7047
|
+
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>
|
|
7048
|
+
${leftDescriptionText}
|
|
7049
|
+
</div>
|
|
7050
|
+
<div class="pops-panel-textarea">
|
|
7051
|
+
<textarea placeholder="${formConfig.placeholder ?? ""}">
|
|
7052
|
+
</textarea>
|
|
7053
|
+
</div>
|
|
7054
|
+
`);
|
|
7010
7055
|
const PopsPanelTextArea = {
|
|
7011
7056
|
[Symbol.toStringTag]: "PopsPanelTextArea",
|
|
7012
7057
|
$ele: {
|
|
@@ -7060,6 +7105,7 @@ var pops = (function () {
|
|
|
7060
7105
|
* @param formConfig
|
|
7061
7106
|
*/
|
|
7062
7107
|
createSectionContainerItem_select(formConfig) {
|
|
7108
|
+
const that = this;
|
|
7063
7109
|
let liElement = document.createElement("li");
|
|
7064
7110
|
liElement["__formConfig__"] = formConfig;
|
|
7065
7111
|
this.setElementClassName(liElement, formConfig.className);
|
|
@@ -7070,15 +7116,16 @@ var pops = (function () {
|
|
|
7070
7116
|
if (Boolean(formConfig.description)) {
|
|
7071
7117
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
7072
7118
|
}
|
|
7073
|
-
liElement
|
|
7074
|
-
|
|
7075
|
-
<
|
|
7076
|
-
|
|
7077
|
-
|
|
7078
|
-
|
|
7079
|
-
<select
|
|
7080
|
-
|
|
7081
|
-
|
|
7119
|
+
PopsSafeUtils.setSafeHTML(liElement,
|
|
7120
|
+
/*html*/ `
|
|
7121
|
+
<div class="pops-panel-item-left-text">
|
|
7122
|
+
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>
|
|
7123
|
+
${leftDescriptionText}
|
|
7124
|
+
</div>
|
|
7125
|
+
<div class="pops-panel-select pops-user-select-none">
|
|
7126
|
+
<select></select>
|
|
7127
|
+
</div>
|
|
7128
|
+
`);
|
|
7082
7129
|
const PopsPanelSelect = {
|
|
7083
7130
|
[Symbol.toStringTag]: "PopsPanelSelect",
|
|
7084
7131
|
$ele: {
|
|
@@ -7088,6 +7135,7 @@ var pops = (function () {
|
|
|
7088
7135
|
$eleKey: {
|
|
7089
7136
|
disable: "__disable__",
|
|
7090
7137
|
value: "__value__",
|
|
7138
|
+
forms: "__forms__",
|
|
7091
7139
|
},
|
|
7092
7140
|
$data: {
|
|
7093
7141
|
defaultValue: formConfig.getValue(),
|
|
@@ -7118,31 +7166,50 @@ var pops = (function () {
|
|
|
7118
7166
|
getNodeValue($ele, key) {
|
|
7119
7167
|
return Reflect.get($ele, key);
|
|
7120
7168
|
},
|
|
7169
|
+
/**
|
|
7170
|
+
* 禁用选项
|
|
7171
|
+
*/
|
|
7121
7172
|
disable() {
|
|
7122
7173
|
this.$ele.select.setAttribute("disabled", "true");
|
|
7123
7174
|
this.$ele.panelSelect.classList.add("pops-panel-select-disable");
|
|
7124
7175
|
},
|
|
7176
|
+
/**
|
|
7177
|
+
* 取消禁用
|
|
7178
|
+
*/
|
|
7125
7179
|
notDisable() {
|
|
7126
7180
|
this.$ele.select.removeAttribute("disabled");
|
|
7127
7181
|
this.$ele.panelSelect.classList.remove("pops-panel-select-disable");
|
|
7128
7182
|
},
|
|
7183
|
+
/**
|
|
7184
|
+
* 判断是否禁用
|
|
7185
|
+
*/
|
|
7129
7186
|
isDisabled() {
|
|
7130
7187
|
return (this.$ele.select.hasAttribute("disabled") ||
|
|
7131
7188
|
this.$ele.panelSelect.classList.contains("pops-panel-select-disable"));
|
|
7132
7189
|
},
|
|
7190
|
+
/**
|
|
7191
|
+
* 初始化选项
|
|
7192
|
+
*/
|
|
7133
7193
|
initOption() {
|
|
7134
7194
|
formConfig.data.forEach((dataItem) => {
|
|
7135
7195
|
// 初始化默认选中
|
|
7136
7196
|
let optionElement = document.createElement("option");
|
|
7137
7197
|
this.setNodeValue(optionElement, this.$eleKey.value, dataItem.value);
|
|
7138
7198
|
this.setNodeValue(optionElement, this.$eleKey.disable, dataItem.disable);
|
|
7199
|
+
this.setNodeValue(optionElement, this.$eleKey.forms, dataItem.forms);
|
|
7139
7200
|
if (dataItem.value === this.$data.defaultValue) {
|
|
7140
|
-
|
|
7201
|
+
this.setOptionSelected(optionElement);
|
|
7141
7202
|
}
|
|
7142
7203
|
optionElement.innerText = dataItem.text;
|
|
7143
7204
|
this.$ele.select.appendChild(optionElement);
|
|
7144
7205
|
});
|
|
7145
7206
|
},
|
|
7207
|
+
/**
|
|
7208
|
+
* 设置选项选中
|
|
7209
|
+
*/
|
|
7210
|
+
setOptionSelected($option) {
|
|
7211
|
+
$option.setAttribute("selected", "true");
|
|
7212
|
+
},
|
|
7146
7213
|
/** 检测所有option并设置禁用状态 */
|
|
7147
7214
|
setSelectOptionsDisableStatus() {
|
|
7148
7215
|
if (this.$ele.select.options && this.$ele.select.options.length) {
|
|
@@ -7170,9 +7237,11 @@ var pops = (function () {
|
|
|
7170
7237
|
getSelectOptionInfo($option) {
|
|
7171
7238
|
let optionValue = this.getNodeValue($option, this.$eleKey.value);
|
|
7172
7239
|
let optionText = $option.innerText || $option.textContent;
|
|
7240
|
+
let optionForms = this.getNodeValue($option, this.$eleKey.forms);
|
|
7173
7241
|
return {
|
|
7174
7242
|
value: optionValue,
|
|
7175
7243
|
text: optionText,
|
|
7244
|
+
forms: optionForms,
|
|
7176
7245
|
$option: $option,
|
|
7177
7246
|
};
|
|
7178
7247
|
},
|
|
@@ -7181,12 +7250,34 @@ var pops = (function () {
|
|
|
7181
7250
|
*/
|
|
7182
7251
|
setChangeEvent() {
|
|
7183
7252
|
popsDOMUtils.on(this.$ele.select, "change", void 0, (event) => {
|
|
7253
|
+
let $isSelectedElement = event.target[event.target.selectedIndex];
|
|
7254
|
+
let selectInfo = this.getSelectOptionInfo($isSelectedElement);
|
|
7184
7255
|
this.setSelectOptionsDisableStatus();
|
|
7185
7256
|
if (typeof formConfig.callback === "function") {
|
|
7186
|
-
let $isSelectedElement = event.target[event.target.selectedIndex];
|
|
7187
|
-
let selectInfo = this.getSelectOptionInfo($isSelectedElement);
|
|
7188
7257
|
formConfig.callback(event, selectInfo.value, selectInfo.text);
|
|
7189
7258
|
}
|
|
7259
|
+
let forms = typeof selectInfo.forms === "function"
|
|
7260
|
+
? selectInfo.forms()
|
|
7261
|
+
: selectInfo.forms;
|
|
7262
|
+
if (Array.isArray(forms)) {
|
|
7263
|
+
/* 如果成功创建,加入到中间容器中 */
|
|
7264
|
+
let childUListClassName = "pops-panel-select-child-forms";
|
|
7265
|
+
// 移除旧的元素
|
|
7266
|
+
while (liElement.nextElementSibling) {
|
|
7267
|
+
if (liElement.nextElementSibling.classList.contains(childUListClassName)) {
|
|
7268
|
+
liElement.nextElementSibling.remove();
|
|
7269
|
+
}
|
|
7270
|
+
else {
|
|
7271
|
+
break;
|
|
7272
|
+
}
|
|
7273
|
+
}
|
|
7274
|
+
let $childUList = document.createElement("ul");
|
|
7275
|
+
$childUList.className = childUListClassName;
|
|
7276
|
+
popsDOMUtils.after(liElement, $childUList);
|
|
7277
|
+
that.uListContainerAddItem(formConfig, {
|
|
7278
|
+
ulElement: $childUList,
|
|
7279
|
+
});
|
|
7280
|
+
}
|
|
7190
7281
|
});
|
|
7191
7282
|
},
|
|
7192
7283
|
/**
|
|
@@ -7221,33 +7312,34 @@ var pops = (function () {
|
|
|
7221
7312
|
if (Boolean(formConfig.description)) {
|
|
7222
7313
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
7223
7314
|
}
|
|
7224
|
-
liElement
|
|
7225
|
-
|
|
7226
|
-
<
|
|
7227
|
-
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
<div class="
|
|
7231
|
-
<div class="el-
|
|
7232
|
-
|
|
7233
|
-
|
|
7234
|
-
|
|
7315
|
+
PopsSafeUtils.setSafeHTML(liElement,
|
|
7316
|
+
/*html*/ `
|
|
7317
|
+
<div class="pops-panel-item-left-text">
|
|
7318
|
+
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>
|
|
7319
|
+
${leftDescriptionText}
|
|
7320
|
+
</div>
|
|
7321
|
+
<div class="pops-panel-select-multiple">
|
|
7322
|
+
<div class="el-select__wrapper">
|
|
7323
|
+
<div class="el-select__selection">
|
|
7324
|
+
<!-- 这个是用于手动输入的,这里暂不适配 -->
|
|
7325
|
+
<div class="el-select__selected-item el-select__input-wrapper">
|
|
7326
|
+
|
|
7327
|
+
</div>
|
|
7328
|
+
<!-- 这个是placeholder -->
|
|
7329
|
+
<div class="el-select__selected-item el-select__placeholder">
|
|
7330
|
+
</div>
|
|
7235
7331
|
</div>
|
|
7236
|
-
<!--
|
|
7237
|
-
<div class="el-
|
|
7332
|
+
<!-- 下拉箭头 -->
|
|
7333
|
+
<div class="el-select__suffix">
|
|
7334
|
+
<i class="el-icon el-select__caret el-select__icon">
|
|
7335
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
|
|
7336
|
+
<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>
|
|
7337
|
+
</svg>
|
|
7338
|
+
</i>
|
|
7238
7339
|
</div>
|
|
7239
7340
|
</div>
|
|
7240
|
-
<!-- 下拉箭头 -->
|
|
7241
|
-
<div class="el-select__suffix">
|
|
7242
|
-
<i class="el-icon el-select__caret el-select__icon">
|
|
7243
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
|
|
7244
|
-
<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>
|
|
7245
|
-
</svg>
|
|
7246
|
-
</i>
|
|
7247
|
-
</div>
|
|
7248
7341
|
</div>
|
|
7249
|
-
|
|
7250
|
-
`;
|
|
7342
|
+
`);
|
|
7251
7343
|
const PopsPanelSelectMultiple = {
|
|
7252
7344
|
[Symbol.toStringTag]: "PopsPanelSelectMultiple",
|
|
7253
7345
|
$el: {
|
|
@@ -7372,7 +7464,7 @@ var pops = (function () {
|
|
|
7372
7464
|
/** 关闭图标 */
|
|
7373
7465
|
const $closeIcon = $selectedItem.querySelector(".el-icon.el-tag__close");
|
|
7374
7466
|
if (data.isHTML) {
|
|
7375
|
-
$tagText
|
|
7467
|
+
PopsSafeUtils.setSafeHTML($tagText, data.text);
|
|
7376
7468
|
}
|
|
7377
7469
|
else {
|
|
7378
7470
|
$tagText.innerText = data.text;
|
|
@@ -7525,12 +7617,28 @@ var pops = (function () {
|
|
|
7525
7617
|
Reflect.set($item, "data-info", dataInfo);
|
|
7526
7618
|
return $item;
|
|
7527
7619
|
}
|
|
7620
|
+
/**
|
|
7621
|
+
* 设置选择项的禁用状态
|
|
7622
|
+
*/
|
|
7623
|
+
function setSelectItemDisabled($el) {
|
|
7624
|
+
$el.setAttribute("aria-disabled", "true");
|
|
7625
|
+
}
|
|
7626
|
+
/**
|
|
7627
|
+
* 移除选择项的禁用状态
|
|
7628
|
+
*/
|
|
7629
|
+
function removeSelectItemDisabled($el) {
|
|
7630
|
+
$el.removeAttribute("aria-disabled");
|
|
7631
|
+
$el.removeAttribute("disabled");
|
|
7632
|
+
}
|
|
7528
7633
|
/**
|
|
7529
7634
|
* 设置选择项的点击事件
|
|
7530
7635
|
*/
|
|
7531
7636
|
function setSelectElementClickEvent($ele) {
|
|
7532
7637
|
popsDOMUtils.on($ele, "click", (event) => {
|
|
7533
7638
|
popsDOMUtils.preventEvent(event);
|
|
7639
|
+
if ($ele.hasAttribute("disabled") || $ele.ariaDisabled) {
|
|
7640
|
+
return;
|
|
7641
|
+
}
|
|
7534
7642
|
if (typeof formConfig.clickCallBack === "function") {
|
|
7535
7643
|
let clickResult = formConfig.clickCallBack(event, getAllSelectedInfo());
|
|
7536
7644
|
if (typeof clickResult === "boolean" && !clickResult) {
|
|
@@ -7596,7 +7704,6 @@ var pops = (function () {
|
|
|
7596
7704
|
--el-fill-color-light: #f5f7fa;
|
|
7597
7705
|
}
|
|
7598
7706
|
.select-item{
|
|
7599
|
-
cursor: pointer;
|
|
7600
7707
|
cursor: pointer;
|
|
7601
7708
|
font-size: var(--el-font-size-base);
|
|
7602
7709
|
padding: 0 32px 0 20px;
|
|
@@ -7609,6 +7716,12 @@ var pops = (function () {
|
|
|
7609
7716
|
line-height: 34px;
|
|
7610
7717
|
box-sizing: border-box;
|
|
7611
7718
|
}
|
|
7719
|
+
.select-item[aria-disabled],
|
|
7720
|
+
.select-item[disabled]{
|
|
7721
|
+
cursor: not-allowed;
|
|
7722
|
+
color: #a8abb2;
|
|
7723
|
+
background: unset;
|
|
7724
|
+
}
|
|
7612
7725
|
.select-item:hover{
|
|
7613
7726
|
background-color: var(--el-fill-color-light);
|
|
7614
7727
|
}
|
|
@@ -7646,6 +7759,15 @@ var pops = (function () {
|
|
|
7646
7759
|
$selectContainer.appendChild($select);
|
|
7647
7760
|
// 设置每一项的点击事件
|
|
7648
7761
|
setSelectElementClickEvent($select);
|
|
7762
|
+
// 设置禁用状态
|
|
7763
|
+
if (typeof item.disable === "function" &&
|
|
7764
|
+
item.disable(item.value)) {
|
|
7765
|
+
setSelectItemDisabled($select);
|
|
7766
|
+
// 后续不设置元素的选中状态
|
|
7767
|
+
return;
|
|
7768
|
+
}
|
|
7769
|
+
// 移除禁用状态
|
|
7770
|
+
removeSelectItemDisabled($select);
|
|
7649
7771
|
let findValue = selectedInfo.find((value) => value.value === item.value);
|
|
7650
7772
|
if (findValue) {
|
|
7651
7773
|
setItemSelected($select);
|
|
@@ -7749,18 +7871,19 @@ var pops = (function () {
|
|
|
7749
7871
|
if (Boolean(formConfig.description)) {
|
|
7750
7872
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
7751
7873
|
}
|
|
7752
|
-
liElement
|
|
7753
|
-
|
|
7754
|
-
<
|
|
7755
|
-
|
|
7756
|
-
|
|
7757
|
-
|
|
7758
|
-
<
|
|
7759
|
-
<
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
|
|
7763
|
-
|
|
7874
|
+
PopsSafeUtils.setSafeHTML(liElement,
|
|
7875
|
+
/*html*/ `
|
|
7876
|
+
<div class="pops-panel-item-left-text">
|
|
7877
|
+
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>
|
|
7878
|
+
${leftDescriptionText}
|
|
7879
|
+
</div>
|
|
7880
|
+
<div class="pops-panel-button">
|
|
7881
|
+
<button class="pops-panel-button_inner">
|
|
7882
|
+
<i class="pops-bottom-icon"></i>
|
|
7883
|
+
<span class="pops-panel-button-text"></span>
|
|
7884
|
+
</button>
|
|
7885
|
+
</div>
|
|
7886
|
+
`);
|
|
7764
7887
|
const PopsPanelButton = {
|
|
7765
7888
|
[Symbol.toStringTag]: "PopsPanelButton",
|
|
7766
7889
|
$ele: {
|
|
@@ -7830,7 +7953,7 @@ var pops = (function () {
|
|
|
7830
7953
|
* 设置icon图标的svg
|
|
7831
7954
|
*/
|
|
7832
7955
|
setIconSVG(svgHTML) {
|
|
7833
|
-
this.$ele.icon
|
|
7956
|
+
PopsSafeUtils.setSafeHTML(this.$ele.icon, svgHTML);
|
|
7834
7957
|
},
|
|
7835
7958
|
/**
|
|
7836
7959
|
* 设置icon图标是否旋转
|
|
@@ -7869,7 +7992,7 @@ var pops = (function () {
|
|
|
7869
7992
|
* @param text
|
|
7870
7993
|
*/
|
|
7871
7994
|
setButtonText(text) {
|
|
7872
|
-
this.$ele.spanText
|
|
7995
|
+
PopsSafeUtils.setSafeHTML(this.$ele.spanText, text);
|
|
7873
7996
|
},
|
|
7874
7997
|
setClickEvent() {
|
|
7875
7998
|
popsDOMUtils.on(this.$ele.button, "click", void 0, (event) => {
|
|
@@ -7915,16 +8038,17 @@ var pops = (function () {
|
|
|
7915
8038
|
if (formConfig.rightText) {
|
|
7916
8039
|
rightText = /*html*/ `<p class="pops-panel-item-right-text">${formConfig.rightText}</p>`;
|
|
7917
8040
|
}
|
|
7918
|
-
$li
|
|
7919
|
-
|
|
7920
|
-
<
|
|
7921
|
-
|
|
7922
|
-
|
|
7923
|
-
|
|
7924
|
-
|
|
7925
|
-
|
|
7926
|
-
|
|
7927
|
-
|
|
8041
|
+
PopsSafeUtils.setSafeHTML($li,
|
|
8042
|
+
/*html*/ `
|
|
8043
|
+
<div class="pops-panel-item-left-text">
|
|
8044
|
+
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>
|
|
8045
|
+
${leftDescriptionText}
|
|
8046
|
+
</div>
|
|
8047
|
+
<div class="pops-panel-deepMenu">
|
|
8048
|
+
${rightText}
|
|
8049
|
+
${arrowRightIconHTML}
|
|
8050
|
+
</div>
|
|
8051
|
+
`);
|
|
7928
8052
|
const PopsPanelDeepMenu = {
|
|
7929
8053
|
[Symbol.toStringTag]: "PopsPanelDeepMenu",
|
|
7930
8054
|
$ele: {
|
|
@@ -7954,19 +8078,19 @@ var pops = (function () {
|
|
|
7954
8078
|
let formHeaderDivElement = popsDOMUtils.createElement("div", {
|
|
7955
8079
|
className: "pops-panel-forms-container-item-header-text",
|
|
7956
8080
|
});
|
|
7957
|
-
formHeaderDivElement
|
|
8081
|
+
PopsSafeUtils.setSafeHTML(formHeaderDivElement, formConfig_forms["text"]);
|
|
7958
8082
|
if (formConfig_forms.isFold) {
|
|
7959
8083
|
/* 添加第一个 */
|
|
7960
8084
|
/* 加进容器内 */
|
|
7961
|
-
formHeaderDivElement
|
|
8085
|
+
PopsSafeUtils.setSafeHTML(formHeaderDivElement,
|
|
8086
|
+
/*html*/ `
|
|
7962
8087
|
<p>${formConfig_forms.text}</p>
|
|
7963
8088
|
<i class="pops-panel-forms-fold-container-icon">
|
|
7964
8089
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
|
|
7965
8090
|
<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>
|
|
7966
8091
|
</svg>
|
|
7967
8092
|
</i>
|
|
7968
|
-
|
|
7969
|
-
`;
|
|
8093
|
+
`);
|
|
7970
8094
|
// 添加点击事件
|
|
7971
8095
|
popsDOMUtils.on(formHeaderDivElement, "click", (event) => {
|
|
7972
8096
|
if (formContainerListElement.hasAttribute("data-fold-enable")) {
|
|
@@ -8164,18 +8288,18 @@ var pops = (function () {
|
|
|
8164
8288
|
let formHeaderDivElement = popsDOMUtils.createElement("div", {
|
|
8165
8289
|
className: "pops-panel-forms-container-item-header-text",
|
|
8166
8290
|
});
|
|
8167
|
-
formHeaderDivElement
|
|
8291
|
+
PopsSafeUtils.setSafeHTML(formHeaderDivElement, formConfig_forms["text"]);
|
|
8168
8292
|
if (formConfig_forms.isFold) {
|
|
8169
8293
|
/* 加进容器内 */
|
|
8170
|
-
formHeaderDivElement
|
|
8294
|
+
PopsSafeUtils.setSafeHTML(formHeaderDivElement,
|
|
8295
|
+
/*html*/ `
|
|
8171
8296
|
<p>${formConfig_forms.text}</p>
|
|
8172
8297
|
<i class="pops-panel-forms-fold-container-icon">
|
|
8173
8298
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
|
|
8174
8299
|
<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>
|
|
8175
8300
|
</svg>
|
|
8176
8301
|
</i>
|
|
8177
|
-
|
|
8178
|
-
`;
|
|
8302
|
+
`);
|
|
8179
8303
|
// 添加点击事件
|
|
8180
8304
|
popsDOMUtils.on(formHeaderDivElement, "click", (event) => {
|
|
8181
8305
|
if (formContainerListElement.hasAttribute("data-fold-enable")) {
|
|
@@ -8261,7 +8385,7 @@ var pops = (function () {
|
|
|
8261
8385
|
let containerHeaderTitleLIElement = document.createElement("li");
|
|
8262
8386
|
containerHeaderTitleLIElement["__asideConfig__"] =
|
|
8263
8387
|
asideConfig;
|
|
8264
|
-
containerHeaderTitleLIElement
|
|
8388
|
+
PopsSafeUtils.setSafeHTML(containerHeaderTitleLIElement, headerTitleText);
|
|
8265
8389
|
this.sectionContainerHeaderULElement.appendChild(containerHeaderTitleLIElement);
|
|
8266
8390
|
}
|
|
8267
8391
|
let __forms__ = asideLiElement["__forms__"];
|
|
@@ -8550,9 +8674,11 @@ var pops = (function () {
|
|
|
8550
8674
|
pops.config.cssText.rightClickMenu,
|
|
8551
8675
|
]);
|
|
8552
8676
|
if (config.style != null) {
|
|
8553
|
-
let cssNode =
|
|
8554
|
-
|
|
8555
|
-
|
|
8677
|
+
let cssNode = popsDOMUtils.createElement("style", {
|
|
8678
|
+
innerHTML: config.style,
|
|
8679
|
+
}, {
|
|
8680
|
+
type: "text/css",
|
|
8681
|
+
});
|
|
8556
8682
|
$shadowRoot.appendChild(cssNode);
|
|
8557
8683
|
}
|
|
8558
8684
|
const PopsContextMenu = {
|
|
@@ -9034,8 +9160,11 @@ var pops = (function () {
|
|
|
9034
9160
|
]);
|
|
9035
9161
|
if (config.style != null) {
|
|
9036
9162
|
let cssNode = document.createElement("style");
|
|
9037
|
-
|
|
9038
|
-
|
|
9163
|
+
popsDOMUtils.createElement("style", {
|
|
9164
|
+
innerHTML: config.style,
|
|
9165
|
+
}, {
|
|
9166
|
+
type: "text/css",
|
|
9167
|
+
});
|
|
9039
9168
|
$shadowRoot.appendChild(cssNode);
|
|
9040
9169
|
}
|
|
9041
9170
|
const SearchSuggestion = {
|
|
@@ -9412,7 +9541,7 @@ var pops = (function () {
|
|
|
9412
9541
|
* 清空所有的搜索结果
|
|
9413
9542
|
*/
|
|
9414
9543
|
clearAllSearchItemLi() {
|
|
9415
|
-
SearchSuggestion.$el.$hintULContainer
|
|
9544
|
+
PopsSafeUtils.setSafeHTML(SearchSuggestion.$el.$hintULContainer, "");
|
|
9416
9545
|
},
|
|
9417
9546
|
/**
|
|
9418
9547
|
* 更新搜索建议框的位置(top、left)
|
|
@@ -9494,7 +9623,8 @@ var pops = (function () {
|
|
|
9494
9623
|
* 动态更新CSS
|
|
9495
9624
|
*/
|
|
9496
9625
|
updateDynamicCSS() {
|
|
9497
|
-
|
|
9626
|
+
let cssText = this.getDynamicCSS();
|
|
9627
|
+
PopsSafeUtils.setSafeHTML(this.$el.$dynamicCSS, cssText);
|
|
9498
9628
|
},
|
|
9499
9629
|
/**
|
|
9500
9630
|
* 更新页面显示的搜索结果
|
|
@@ -9684,7 +9814,7 @@ var pops = (function () {
|
|
|
9684
9814
|
if (text == null) {
|
|
9685
9815
|
text = this.getContent();
|
|
9686
9816
|
}
|
|
9687
|
-
this.$el.$content
|
|
9817
|
+
PopsSafeUtils.setSafeHTML(this.$el.$content, text);
|
|
9688
9818
|
}
|
|
9689
9819
|
/**
|
|
9690
9820
|
* 获取z-index
|
|
@@ -10056,7 +10186,7 @@ var pops = (function () {
|
|
|
10056
10186
|
/** 配置 */
|
|
10057
10187
|
config = {
|
|
10058
10188
|
/** 版本号 */
|
|
10059
|
-
version: "
|
|
10189
|
+
version: "2025.3.2",
|
|
10060
10190
|
cssText: {
|
|
10061
10191
|
/** 主CSS */
|
|
10062
10192
|
index: indexCSS,
|
|
@@ -10161,7 +10291,7 @@ var pops = (function () {
|
|
|
10161
10291
|
/* 处理获取当前所有的动画名 */
|
|
10162
10292
|
this.config.isInit = true;
|
|
10163
10293
|
let animationStyle = document.createElement("style");
|
|
10164
|
-
animationStyle
|
|
10294
|
+
PopsSafeUtils.setSafeHTML(animationStyle, this.config.cssText.anim);
|
|
10165
10295
|
popsDOMUtils.appendHead(animationStyle);
|
|
10166
10296
|
this.config.animation = null;
|
|
10167
10297
|
this.config.animation = PopsInstanceUtils.getKeyFrames(animationStyle.sheet);
|