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