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