@whitesev/pops 2.1.3 → 2.1.4
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 +182 -164
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +182 -164
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +182 -164
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +182 -164
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +182 -164
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +182 -164
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/Pops.d.ts +24 -7
- package/dist/types/src/components/panel/PanelHandleContentDetails.d.ts +23 -15
- package/dist/types/src/components/panel/index.d.ts +16 -2
- package/dist/types/src/components/panel/indexType.d.ts +14 -0
- package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +1 -1
- package/dist/types/src/types/button.d.ts +3 -2
- package/dist/types/src/types/event.d.ts +3 -2
- package/dist/types/src/types/global.d.ts +4 -4
- package/dist/types/src/types/main.d.ts +8 -0
- package/dist/types/src/types/mask.d.ts +8 -0
- package/package.json +9 -10
- package/src/Pops.ts +1 -1
- package/src/components/panel/PanelHandleContentDetails.ts +270 -244
- package/src/components/panel/index.ts +20 -2
- package/src/components/panel/indexType.ts +16 -0
- package/src/types/PopsDOMUtilsEventType.d.ts +1 -1
- package/src/types/button.d.ts +3 -2
- package/src/types/event.d.ts +3 -2
- package/src/types/global.d.ts +4 -4
- package/src/types/main.d.ts +8 -0
- package/src/types/mask.d.ts +8 -0
- package/src/utils/PopsUtils.ts +1 -4
package/dist/index.iife.js
CHANGED
|
@@ -330,8 +330,7 @@ var pops = (function () {
|
|
|
330
330
|
if (target === PopsCore.self) {
|
|
331
331
|
return true;
|
|
332
332
|
}
|
|
333
|
-
if (typeof unsafeWindow !== "undefined" &&
|
|
334
|
-
target === unsafeWindow) {
|
|
333
|
+
if (typeof unsafeWindow !== "undefined" && target === unsafeWindow) {
|
|
335
334
|
return true;
|
|
336
335
|
}
|
|
337
336
|
if (target?.Math?.toString() !== "[object Math]") {
|
|
@@ -7078,6 +7077,8 @@ var pops = (function () {
|
|
|
7078
7077
|
* 元素
|
|
7079
7078
|
*/
|
|
7080
7079
|
$el: {
|
|
7080
|
+
/** pops主元素 */
|
|
7081
|
+
$pops: null,
|
|
7081
7082
|
/** 内容 */
|
|
7082
7083
|
$content: null,
|
|
7083
7084
|
/** 左侧容器 */
|
|
@@ -7090,8 +7091,6 @@ var pops = (function () {
|
|
|
7090
7091
|
* @param details
|
|
7091
7092
|
*/
|
|
7092
7093
|
init(details) {
|
|
7093
|
-
// @ts-ignore
|
|
7094
|
-
this.$el = null;
|
|
7095
7094
|
this.$el = {
|
|
7096
7095
|
...details.$el,
|
|
7097
7096
|
};
|
|
@@ -7154,11 +7153,12 @@ var pops = (function () {
|
|
|
7154
7153
|
* 清空container容器的元素
|
|
7155
7154
|
*/
|
|
7156
7155
|
clearContainer() {
|
|
7156
|
+
Reflect.deleteProperty(this.$el.$contentSectionContainer, "__formConfig__");
|
|
7157
7157
|
PopsSafeUtils.setSafeHTML(this.sectionContainerHeaderULElement, "");
|
|
7158
7158
|
PopsSafeUtils.setSafeHTML(this.sectionContainerULElement, "");
|
|
7159
7159
|
this.$el.$content
|
|
7160
7160
|
?.querySelectorAll("section.pops-panel-deepMenu-container")
|
|
7161
|
-
.forEach((
|
|
7161
|
+
.forEach(($el) => $el.remove());
|
|
7162
7162
|
},
|
|
7163
7163
|
/**
|
|
7164
7164
|
* 清空左侧容器已访问记录
|
|
@@ -7166,8 +7166,8 @@ var pops = (function () {
|
|
|
7166
7166
|
clearAsideItemIsVisited() {
|
|
7167
7167
|
this.$el.$contentAside
|
|
7168
7168
|
.querySelectorAll(".pops-is-visited")
|
|
7169
|
-
.forEach((
|
|
7170
|
-
popsDOMUtils.removeClassName(
|
|
7169
|
+
.forEach(($el) => {
|
|
7170
|
+
popsDOMUtils.removeClassName($el, "pops-is-visited");
|
|
7171
7171
|
});
|
|
7172
7172
|
},
|
|
7173
7173
|
/**
|
|
@@ -7244,34 +7244,33 @@ var pops = (function () {
|
|
|
7244
7244
|
* @param asideConfig
|
|
7245
7245
|
*/
|
|
7246
7246
|
createAsideItem(asideConfig) {
|
|
7247
|
-
let
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
PopsSafeUtils.setSafeHTML(liElement, asideConfig.title);
|
|
7247
|
+
let $li = document.createElement("li");
|
|
7248
|
+
$li.id = asideConfig.id;
|
|
7249
|
+
Reflect.set($li, "__forms__", asideConfig.forms);
|
|
7250
|
+
PopsSafeUtils.setSafeHTML($li, asideConfig.title);
|
|
7252
7251
|
/* 处理className */
|
|
7253
|
-
this.setElementClassName(
|
|
7254
|
-
this.setElementAttributes(
|
|
7255
|
-
this.setElementProps(
|
|
7256
|
-
return
|
|
7252
|
+
this.setElementClassName($li, asideConfig.className);
|
|
7253
|
+
this.setElementAttributes($li, asideConfig.attributes);
|
|
7254
|
+
this.setElementProps($li, asideConfig.props);
|
|
7255
|
+
return $li;
|
|
7257
7256
|
},
|
|
7258
7257
|
/**
|
|
7259
|
-
* 创建中间容器的元素<li>
|
|
7260
7258
|
* type ==> switch
|
|
7259
|
+
* 创建中间容器的元素<li>
|
|
7261
7260
|
* @param formConfig
|
|
7262
7261
|
*/
|
|
7263
7262
|
createSectionContainerItem_switch(formConfig) {
|
|
7264
|
-
let
|
|
7265
|
-
|
|
7266
|
-
this.setElementClassName(
|
|
7267
|
-
this.setElementAttributes(
|
|
7268
|
-
this.setElementProps(
|
|
7263
|
+
let $li = document.createElement("li");
|
|
7264
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
7265
|
+
this.setElementClassName($li, formConfig.className);
|
|
7266
|
+
this.setElementAttributes($li, formConfig.attributes);
|
|
7267
|
+
this.setElementProps($li, formConfig.props);
|
|
7269
7268
|
/* 左边底部的描述的文字 */
|
|
7270
7269
|
let leftDescriptionText = "";
|
|
7271
7270
|
if (Boolean(formConfig.description)) {
|
|
7272
7271
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
7273
7272
|
}
|
|
7274
|
-
PopsSafeUtils.setSafeHTML(
|
|
7273
|
+
PopsSafeUtils.setSafeHTML($li,
|
|
7275
7274
|
/*html*/ `
|
|
7276
7275
|
<div class="pops-panel-item-left-text">
|
|
7277
7276
|
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>${leftDescriptionText}</div>
|
|
@@ -7288,9 +7287,9 @@ var pops = (function () {
|
|
|
7288
7287
|
value: Boolean(formConfig.getValue()),
|
|
7289
7288
|
},
|
|
7290
7289
|
$ele: {
|
|
7291
|
-
switch:
|
|
7292
|
-
input:
|
|
7293
|
-
core:
|
|
7290
|
+
switch: $li.querySelector(".pops-panel-switch"),
|
|
7291
|
+
input: $li.querySelector(".pops-panel-switch__input"),
|
|
7292
|
+
core: $li.querySelector(".pops-panel-switch__core"),
|
|
7294
7293
|
},
|
|
7295
7294
|
init() {
|
|
7296
7295
|
this.setStatus(this.$data.value);
|
|
@@ -7352,26 +7351,26 @@ var pops = (function () {
|
|
|
7352
7351
|
},
|
|
7353
7352
|
};
|
|
7354
7353
|
PopsPanelSwitch.init();
|
|
7355
|
-
|
|
7356
|
-
return
|
|
7354
|
+
Reflect.set($li, "data-switch", PopsPanelSwitch);
|
|
7355
|
+
return $li;
|
|
7357
7356
|
},
|
|
7358
7357
|
/**
|
|
7359
|
-
* 获取中间容器的元素<li>
|
|
7360
7358
|
* type ==> slider
|
|
7359
|
+
* 获取中间容器的元素<li>
|
|
7361
7360
|
* @param formConfig
|
|
7362
7361
|
*/
|
|
7363
7362
|
createSectionContainerItem_slider(formConfig) {
|
|
7364
|
-
let
|
|
7365
|
-
|
|
7366
|
-
this.setElementClassName(
|
|
7367
|
-
this.setElementAttributes(
|
|
7368
|
-
this.setElementProps(
|
|
7363
|
+
let $li = document.createElement("li");
|
|
7364
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
7365
|
+
this.setElementClassName($li, formConfig.className);
|
|
7366
|
+
this.setElementAttributes($li, formConfig.attributes);
|
|
7367
|
+
this.setElementProps($li, formConfig.props);
|
|
7369
7368
|
/* 左边底部的描述的文字 */
|
|
7370
7369
|
let leftDescriptionText = "";
|
|
7371
7370
|
if (Boolean(formConfig.description)) {
|
|
7372
7371
|
leftDescriptionText = `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
7373
7372
|
}
|
|
7374
|
-
PopsSafeUtils.setSafeHTML(
|
|
7373
|
+
PopsSafeUtils.setSafeHTML($li,
|
|
7375
7374
|
/*html*/ `
|
|
7376
7375
|
<div class="pops-panel-item-left-text">
|
|
7377
7376
|
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>${leftDescriptionText}</div>
|
|
@@ -7379,11 +7378,11 @@ var pops = (function () {
|
|
|
7379
7378
|
<input type="range" min="${formConfig.min}" max="${formConfig.max}">
|
|
7380
7379
|
</div>
|
|
7381
7380
|
`);
|
|
7382
|
-
let
|
|
7381
|
+
let $rangeInput = $li.querySelector(".pops-panel-slider input[type=range]");
|
|
7383
7382
|
if (formConfig.step) {
|
|
7384
|
-
|
|
7383
|
+
$rangeInput.setAttribute("step", formConfig.step.toString());
|
|
7385
7384
|
}
|
|
7386
|
-
|
|
7385
|
+
$rangeInput.value = formConfig.getValue().toString();
|
|
7387
7386
|
/**
|
|
7388
7387
|
* 获取提示的内容
|
|
7389
7388
|
* @param value
|
|
@@ -7397,9 +7396,9 @@ var pops = (function () {
|
|
|
7397
7396
|
}
|
|
7398
7397
|
};
|
|
7399
7398
|
let tooltip = PopsTooltip.init({
|
|
7400
|
-
target:
|
|
7399
|
+
target: $rangeInput.parentElement,
|
|
7401
7400
|
content: () => {
|
|
7402
|
-
return getToolTipContent(
|
|
7401
|
+
return getToolTipContent($rangeInput.value);
|
|
7403
7402
|
},
|
|
7404
7403
|
zIndex: () => {
|
|
7405
7404
|
return PopsInstanceUtils.getPopsMaxZIndex().zIndex;
|
|
@@ -7410,32 +7409,31 @@ var pops = (function () {
|
|
|
7410
7409
|
position: "top",
|
|
7411
7410
|
arrowDistance: 10,
|
|
7412
7411
|
});
|
|
7413
|
-
popsDOMUtils.on(
|
|
7414
|
-
tooltip.toolTip.changeContent(getToolTipContent(
|
|
7412
|
+
popsDOMUtils.on($rangeInput, ["input", "propertychange"], void 0, function (event) {
|
|
7413
|
+
tooltip.toolTip.changeContent(getToolTipContent($rangeInput.value));
|
|
7415
7414
|
if (typeof formConfig.callback === "function") {
|
|
7416
|
-
formConfig.callback(event,
|
|
7415
|
+
formConfig.callback(event, $rangeInput.valueAsNumber);
|
|
7417
7416
|
}
|
|
7418
7417
|
});
|
|
7419
|
-
return
|
|
7418
|
+
return $li;
|
|
7420
7419
|
},
|
|
7421
7420
|
/**
|
|
7422
|
-
* 获取中间容器的元素<li>
|
|
7423
7421
|
* type ==> slider
|
|
7422
|
+
* 获取中间容器的元素<li>
|
|
7424
7423
|
* @param formConfig
|
|
7425
7424
|
*/
|
|
7426
7425
|
createSectionContainerItem_slider_new(formConfig) {
|
|
7427
|
-
let
|
|
7428
|
-
|
|
7429
|
-
|
|
7430
|
-
this.
|
|
7431
|
-
this.
|
|
7432
|
-
this.setElementProps(liElement, formConfig.props);
|
|
7426
|
+
let $li = document.createElement("li");
|
|
7427
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
7428
|
+
this.setElementClassName($li, formConfig.className);
|
|
7429
|
+
this.setElementAttributes($li, formConfig.attributes);
|
|
7430
|
+
this.setElementProps($li, formConfig.props);
|
|
7433
7431
|
/* 左边底部的描述的文字 */
|
|
7434
7432
|
let leftDescriptionText = "";
|
|
7435
7433
|
if (Boolean(formConfig.description)) {
|
|
7436
7434
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
7437
7435
|
}
|
|
7438
|
-
PopsSafeUtils.setSafeHTML(
|
|
7436
|
+
PopsSafeUtils.setSafeHTML($li,
|
|
7439
7437
|
/*html*/ `
|
|
7440
7438
|
<div class="pops-panel-item-left-text" style="flex: 1;">
|
|
7441
7439
|
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>${leftDescriptionText}</div>
|
|
@@ -7510,11 +7508,11 @@ var pops = (function () {
|
|
|
7510
7508
|
tooltip: null,
|
|
7511
7509
|
},
|
|
7512
7510
|
$ele: {
|
|
7513
|
-
slider:
|
|
7514
|
-
runAway:
|
|
7515
|
-
bar:
|
|
7516
|
-
buttonWrapper:
|
|
7517
|
-
button:
|
|
7511
|
+
slider: $li.querySelector(".pops-slider"),
|
|
7512
|
+
runAway: $li.querySelector(".pops-slider__runway"),
|
|
7513
|
+
bar: $li.querySelector(".pops-slider__bar"),
|
|
7514
|
+
buttonWrapper: $li.querySelector(".pops-slider__button-wrapper"),
|
|
7515
|
+
button: $li.querySelector(".pops-slider__button"),
|
|
7518
7516
|
},
|
|
7519
7517
|
$interval: {
|
|
7520
7518
|
isCheck: false,
|
|
@@ -7580,14 +7578,10 @@ var pops = (function () {
|
|
|
7580
7578
|
this.$ele.slider.setAttribute("data-max", this.max.toString());
|
|
7581
7579
|
this.$ele.slider.setAttribute("data-value", this.value.toString());
|
|
7582
7580
|
this.$ele.slider.setAttribute("data-step", this.step.toString());
|
|
7583
|
-
|
|
7584
|
-
this.$ele.slider
|
|
7585
|
-
|
|
7586
|
-
this.$ele.slider
|
|
7587
|
-
// @ts-ignore
|
|
7588
|
-
this.$ele.slider["data-value"] = this.value;
|
|
7589
|
-
// @ts-ignore
|
|
7590
|
-
this.$ele.slider["data-step"] = this.step;
|
|
7581
|
+
Reflect.set(this.$ele.slider, "data-min", this.min);
|
|
7582
|
+
Reflect.set(this.$ele.slider, "data-max", this.max);
|
|
7583
|
+
Reflect.set(this.$ele.slider, "data-value", this.value);
|
|
7584
|
+
Reflect.set(this.$ele.slider, "data-step", this.step);
|
|
7591
7585
|
},
|
|
7592
7586
|
/**
|
|
7593
7587
|
* 初始化滑块的总长度的数据(px)
|
|
@@ -7607,7 +7601,7 @@ var pops = (function () {
|
|
|
7607
7601
|
let widthPx = 0;
|
|
7608
7602
|
for (let stepValue = this.min; stepValue <= this.max; stepValue += this.step) {
|
|
7609
7603
|
let value = this.formatValue(stepValue);
|
|
7610
|
-
let info
|
|
7604
|
+
let info;
|
|
7611
7605
|
if (value === this.min) {
|
|
7612
7606
|
/* 起始 */
|
|
7613
7607
|
info = {
|
|
@@ -7650,7 +7644,7 @@ var pops = (function () {
|
|
|
7650
7644
|
let widthPx = 0;
|
|
7651
7645
|
for (let stepValue = this.min; stepValue <= this.max; stepValue = PopsMathFloatUtils.add(stepValue, this.step)) {
|
|
7652
7646
|
let value = this.formatValue(stepValue);
|
|
7653
|
-
let info
|
|
7647
|
+
let info;
|
|
7654
7648
|
if (value === this.min) {
|
|
7655
7649
|
/* 起始 */
|
|
7656
7650
|
info = {
|
|
@@ -7808,7 +7802,7 @@ var pops = (function () {
|
|
|
7808
7802
|
event.target !== this.$ele.bar) {
|
|
7809
7803
|
return;
|
|
7810
7804
|
}
|
|
7811
|
-
let clickX = parseFloat(event.offsetX);
|
|
7805
|
+
let clickX = parseFloat(event.offsetX.toString());
|
|
7812
7806
|
this.dragStartCallBack();
|
|
7813
7807
|
this.dragMoveCallBack(event, clickX, this.value);
|
|
7814
7808
|
this.dragEndCallBack(clickX);
|
|
@@ -7961,7 +7955,7 @@ var pops = (function () {
|
|
|
7961
7955
|
return formConfig.getToolTipContent(PopsPanelSlider.value);
|
|
7962
7956
|
}
|
|
7963
7957
|
else {
|
|
7964
|
-
return PopsPanelSlider.value;
|
|
7958
|
+
return PopsPanelSlider.value.toString();
|
|
7965
7959
|
}
|
|
7966
7960
|
}
|
|
7967
7961
|
let tooltip = PopsTooltip.init({
|
|
@@ -8005,20 +7999,20 @@ var pops = (function () {
|
|
|
8005
7999
|
},
|
|
8006
8000
|
};
|
|
8007
8001
|
PopsPanelSlider.init();
|
|
8008
|
-
|
|
8009
|
-
return
|
|
8002
|
+
Reflect.set($li, "data-slider", PopsPanelSlider);
|
|
8003
|
+
return $li;
|
|
8010
8004
|
},
|
|
8011
8005
|
/**
|
|
8012
|
-
* 获取中间容器的元素<li>
|
|
8013
8006
|
* type ==> input
|
|
8007
|
+
* 获取中间容器的元素<li>
|
|
8014
8008
|
* @param formConfig
|
|
8015
8009
|
*/
|
|
8016
8010
|
createSectionContainerItem_input(formConfig) {
|
|
8017
|
-
let
|
|
8018
|
-
|
|
8019
|
-
this.setElementClassName(
|
|
8020
|
-
this.setElementAttributes(
|
|
8021
|
-
this.setElementProps(
|
|
8011
|
+
let $li = document.createElement("li");
|
|
8012
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
8013
|
+
this.setElementClassName($li, formConfig.className);
|
|
8014
|
+
this.setElementAttributes($li, formConfig.attributes);
|
|
8015
|
+
this.setElementProps($li, formConfig.props);
|
|
8022
8016
|
let inputType = "text";
|
|
8023
8017
|
if (formConfig.isPassword) {
|
|
8024
8018
|
inputType = "password";
|
|
@@ -8031,7 +8025,7 @@ var pops = (function () {
|
|
|
8031
8025
|
if (Boolean(formConfig.description)) {
|
|
8032
8026
|
leftDescriptionText = `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
8033
8027
|
}
|
|
8034
|
-
PopsSafeUtils.setSafeHTML(
|
|
8028
|
+
PopsSafeUtils.setSafeHTML($li,
|
|
8035
8029
|
/*html*/ `
|
|
8036
8030
|
<div class="pops-panel-item-left-text">
|
|
8037
8031
|
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>${leftDescriptionText}</div>
|
|
@@ -8042,8 +8036,8 @@ var pops = (function () {
|
|
|
8042
8036
|
const PopsPanelInput = {
|
|
8043
8037
|
[Symbol.toStringTag]: "PopsPanelInput",
|
|
8044
8038
|
$ele: {
|
|
8045
|
-
panelInput:
|
|
8046
|
-
input:
|
|
8039
|
+
panelInput: $li.querySelector(".pops-panel-input"),
|
|
8040
|
+
input: $li.querySelector("input"),
|
|
8047
8041
|
inputSpanIcon: document.createElement("span"),
|
|
8048
8042
|
inputSpanIconInner: null,
|
|
8049
8043
|
icon: null,
|
|
@@ -8072,7 +8066,7 @@ var pops = (function () {
|
|
|
8072
8066
|
this.disable();
|
|
8073
8067
|
}
|
|
8074
8068
|
if (typeof formConfig.handlerCallBack === "function") {
|
|
8075
|
-
formConfig.handlerCallBack(
|
|
8069
|
+
formConfig.handlerCallBack($li, this.$ele.input);
|
|
8076
8070
|
}
|
|
8077
8071
|
},
|
|
8078
8072
|
/**
|
|
@@ -8207,26 +8201,26 @@ var pops = (function () {
|
|
|
8207
8201
|
},
|
|
8208
8202
|
};
|
|
8209
8203
|
PopsPanelInput.init();
|
|
8210
|
-
|
|
8211
|
-
return
|
|
8204
|
+
Reflect.set($li, "data-input", PopsPanelInput);
|
|
8205
|
+
return $li;
|
|
8212
8206
|
},
|
|
8213
8207
|
/**
|
|
8214
|
-
* 获取中间容器的元素<li>
|
|
8215
8208
|
* type ==> textarea
|
|
8209
|
+
* 获取中间容器的元素<li>
|
|
8216
8210
|
* @param formConfig
|
|
8217
8211
|
*/
|
|
8218
8212
|
createSectionContainerItem_textarea(formConfig) {
|
|
8219
|
-
let
|
|
8220
|
-
|
|
8221
|
-
this.setElementClassName(
|
|
8222
|
-
this.setElementAttributes(
|
|
8223
|
-
this.setElementProps(
|
|
8213
|
+
let $li = document.createElement("li");
|
|
8214
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
8215
|
+
this.setElementClassName($li, formConfig.className);
|
|
8216
|
+
this.setElementAttributes($li, formConfig.attributes);
|
|
8217
|
+
this.setElementProps($li, formConfig.props);
|
|
8224
8218
|
/* 左边底部的描述的文字 */
|
|
8225
8219
|
let leftDescriptionText = "";
|
|
8226
8220
|
if (Boolean(formConfig.description)) {
|
|
8227
8221
|
leftDescriptionText = `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
8228
8222
|
}
|
|
8229
|
-
PopsSafeUtils.setSafeHTML(
|
|
8223
|
+
PopsSafeUtils.setSafeHTML($li,
|
|
8230
8224
|
/*html*/ `
|
|
8231
8225
|
<div class="pops-panel-item-left-text">
|
|
8232
8226
|
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>${leftDescriptionText}</div>
|
|
@@ -8237,8 +8231,8 @@ var pops = (function () {
|
|
|
8237
8231
|
const PopsPanelTextArea = {
|
|
8238
8232
|
[Symbol.toStringTag]: "PopsPanelTextArea",
|
|
8239
8233
|
$ele: {
|
|
8240
|
-
panelTextarea:
|
|
8241
|
-
textarea:
|
|
8234
|
+
panelTextarea: $li.querySelector(".pops-panel-textarea"),
|
|
8235
|
+
textarea: $li.querySelector(".pops-panel-textarea textarea"),
|
|
8242
8236
|
},
|
|
8243
8237
|
$data: {
|
|
8244
8238
|
value: formConfig.getValue(),
|
|
@@ -8270,35 +8264,36 @@ var pops = (function () {
|
|
|
8270
8264
|
*/
|
|
8271
8265
|
setChangeEvent() {
|
|
8272
8266
|
popsDOMUtils.on(this.$ele.textarea, ["input", "propertychange"], void 0, (event) => {
|
|
8273
|
-
|
|
8267
|
+
let value = this.$ele.textarea.value;
|
|
8268
|
+
this.$data.value = value;
|
|
8274
8269
|
if (typeof formConfig.callback === "function") {
|
|
8275
|
-
formConfig.callback(event,
|
|
8270
|
+
formConfig.callback(event, value);
|
|
8276
8271
|
}
|
|
8277
8272
|
});
|
|
8278
8273
|
},
|
|
8279
8274
|
};
|
|
8280
8275
|
PopsPanelTextArea.init();
|
|
8281
|
-
|
|
8282
|
-
return
|
|
8276
|
+
Reflect.set($li, "data-textarea", PopsPanelTextArea);
|
|
8277
|
+
return $li;
|
|
8283
8278
|
},
|
|
8284
8279
|
/**
|
|
8285
|
-
* 获取中间容器的元素<li>
|
|
8286
8280
|
* type ==> select
|
|
8281
|
+
* 获取中间容器的元素<li>
|
|
8287
8282
|
* @param formConfig
|
|
8288
8283
|
*/
|
|
8289
8284
|
createSectionContainerItem_select(formConfig) {
|
|
8290
8285
|
const that = this;
|
|
8291
|
-
let
|
|
8292
|
-
|
|
8293
|
-
this.setElementClassName(
|
|
8294
|
-
this.setElementAttributes(
|
|
8295
|
-
this.setElementProps(
|
|
8286
|
+
let $li = document.createElement("li");
|
|
8287
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
8288
|
+
this.setElementClassName($li, formConfig.className);
|
|
8289
|
+
this.setElementAttributes($li, formConfig.attributes);
|
|
8290
|
+
this.setElementProps($li, formConfig.props);
|
|
8296
8291
|
/* 左边底部的描述的文字 */
|
|
8297
8292
|
let leftDescriptionText = "";
|
|
8298
8293
|
if (Boolean(formConfig.description)) {
|
|
8299
8294
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
8300
8295
|
}
|
|
8301
|
-
PopsSafeUtils.setSafeHTML(
|
|
8296
|
+
PopsSafeUtils.setSafeHTML($li,
|
|
8302
8297
|
/*html*/ `
|
|
8303
8298
|
<div class="pops-panel-item-left-text">
|
|
8304
8299
|
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>${leftDescriptionText}</div>
|
|
@@ -8309,8 +8304,8 @@ var pops = (function () {
|
|
|
8309
8304
|
const PopsPanelSelect = {
|
|
8310
8305
|
[Symbol.toStringTag]: "PopsPanelSelect",
|
|
8311
8306
|
$ele: {
|
|
8312
|
-
panelSelect:
|
|
8313
|
-
select:
|
|
8307
|
+
panelSelect: $li.querySelector(".pops-panel-select"),
|
|
8308
|
+
select: $li.querySelector(".pops-panel-select select"),
|
|
8314
8309
|
},
|
|
8315
8310
|
$eleKey: {
|
|
8316
8311
|
disable: "__disable__",
|
|
@@ -8430,7 +8425,7 @@ var pops = (function () {
|
|
|
8430
8425
|
*/
|
|
8431
8426
|
setChangeEvent() {
|
|
8432
8427
|
popsDOMUtils.on(this.$ele.select, "change", void 0, (event) => {
|
|
8433
|
-
let $isSelectedElement =
|
|
8428
|
+
let $isSelectedElement = this.$ele.select[this.$ele.select.selectedIndex];
|
|
8434
8429
|
let selectInfo = this.getSelectOptionInfo($isSelectedElement);
|
|
8435
8430
|
this.setSelectOptionsDisableStatus();
|
|
8436
8431
|
if (typeof formConfig.callback === "function") {
|
|
@@ -8443,9 +8438,9 @@ var pops = (function () {
|
|
|
8443
8438
|
/* 如果成功创建,加入到中间容器中 */
|
|
8444
8439
|
let childUListClassName = "pops-panel-select-child-forms";
|
|
8445
8440
|
// 移除旧的元素
|
|
8446
|
-
while (
|
|
8447
|
-
if (
|
|
8448
|
-
|
|
8441
|
+
while ($li.nextElementSibling) {
|
|
8442
|
+
if ($li.nextElementSibling.classList.contains(childUListClassName)) {
|
|
8443
|
+
$li.nextElementSibling.remove();
|
|
8449
8444
|
}
|
|
8450
8445
|
else {
|
|
8451
8446
|
break;
|
|
@@ -8453,7 +8448,7 @@ var pops = (function () {
|
|
|
8453
8448
|
}
|
|
8454
8449
|
let $childUList = document.createElement("ul");
|
|
8455
8450
|
$childUList.className = childUListClassName;
|
|
8456
|
-
popsDOMUtils.after(
|
|
8451
|
+
popsDOMUtils.after($li, $childUList);
|
|
8457
8452
|
that.uListContainerAddItem(formConfig, {
|
|
8458
8453
|
ulElement: $childUList,
|
|
8459
8454
|
});
|
|
@@ -8473,26 +8468,26 @@ var pops = (function () {
|
|
|
8473
8468
|
},
|
|
8474
8469
|
};
|
|
8475
8470
|
PopsPanelSelect.init();
|
|
8476
|
-
Reflect.set(
|
|
8477
|
-
return
|
|
8471
|
+
Reflect.set($li, "data-select", PopsPanelSelect);
|
|
8472
|
+
return $li;
|
|
8478
8473
|
},
|
|
8479
8474
|
/**
|
|
8480
|
-
* 获取中间容器的元素<li>
|
|
8481
8475
|
* type ==> select-multiple
|
|
8476
|
+
* 获取中间容器的元素<li>
|
|
8482
8477
|
* @param formConfig
|
|
8483
8478
|
*/
|
|
8484
8479
|
createSectionContainerItem_select_multiple_new(formConfig) {
|
|
8485
|
-
let
|
|
8486
|
-
Reflect.set(
|
|
8487
|
-
this.setElementClassName(
|
|
8488
|
-
this.setElementAttributes(
|
|
8489
|
-
this.setElementProps(
|
|
8480
|
+
let $li = document.createElement("li");
|
|
8481
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
8482
|
+
this.setElementClassName($li, formConfig.className);
|
|
8483
|
+
this.setElementAttributes($li, formConfig.attributes);
|
|
8484
|
+
this.setElementProps($li, formConfig.props);
|
|
8490
8485
|
/* 左边底部的描述的文字 */
|
|
8491
8486
|
let leftDescriptionText = "";
|
|
8492
8487
|
if (Boolean(formConfig.description)) {
|
|
8493
8488
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
8494
8489
|
}
|
|
8495
|
-
PopsSafeUtils.setSafeHTML(
|
|
8490
|
+
PopsSafeUtils.setSafeHTML($li,
|
|
8496
8491
|
/*html*/ `
|
|
8497
8492
|
<div class="pops-panel-item-left-text">
|
|
8498
8493
|
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>${leftDescriptionText}</div>
|
|
@@ -8567,15 +8562,14 @@ var pops = (function () {
|
|
|
8567
8562
|
},
|
|
8568
8563
|
/** 初始化$el变量 */
|
|
8569
8564
|
inintEl() {
|
|
8570
|
-
this.$el.$container =
|
|
8571
|
-
this.$el.$wrapper =
|
|
8572
|
-
this.$el.$section =
|
|
8573
|
-
this.$el.$selectedInputWrapper =
|
|
8574
|
-
this.$el.$selectedPlaceHolderWrapper =
|
|
8575
|
-
liElement.querySelector(".el-select__selected-item.el-select__placeholder");
|
|
8565
|
+
this.$el.$container = $li.querySelector(".pops-panel-select-multiple");
|
|
8566
|
+
this.$el.$wrapper = $li.querySelector(".el-select__wrapper");
|
|
8567
|
+
this.$el.$section = $li.querySelector(".el-select__selection");
|
|
8568
|
+
this.$el.$selectedInputWrapper = $li.querySelector(".el-select__selected-item.el-select__input-wrapper");
|
|
8569
|
+
this.$el.$selectedPlaceHolderWrapper = $li.querySelector(".el-select__selected-item.el-select__placeholder");
|
|
8576
8570
|
this.$el.$suffix =
|
|
8577
|
-
|
|
8578
|
-
this.$el.$suffixIcon =
|
|
8571
|
+
$li.querySelector(".el-select__suffix");
|
|
8572
|
+
this.$el.$suffixIcon = $li.querySelector(".el-select__suffix .el-icon");
|
|
8579
8573
|
// 先把手动输入框隐藏
|
|
8580
8574
|
this.hideInputWrapper();
|
|
8581
8575
|
},
|
|
@@ -9133,26 +9127,26 @@ var pops = (function () {
|
|
|
9133
9127
|
},
|
|
9134
9128
|
};
|
|
9135
9129
|
PopsPanelSelectMultiple.init();
|
|
9136
|
-
Reflect.set(
|
|
9137
|
-
return
|
|
9130
|
+
Reflect.set($li, "data-select-multiple", PopsPanelSelectMultiple);
|
|
9131
|
+
return $li;
|
|
9138
9132
|
},
|
|
9139
9133
|
/**
|
|
9140
|
-
* 获取中间容器的元素<li>
|
|
9141
9134
|
* type ==> button
|
|
9135
|
+
* 获取中间容器的元素<li>
|
|
9142
9136
|
* @param formConfig
|
|
9143
9137
|
*/
|
|
9144
9138
|
createSectionContainerItem_button(formConfig) {
|
|
9145
|
-
let
|
|
9146
|
-
|
|
9147
|
-
this.setElementClassName(
|
|
9148
|
-
this.setElementAttributes(
|
|
9149
|
-
this.setElementProps(
|
|
9139
|
+
let $li = document.createElement("li");
|
|
9140
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
9141
|
+
this.setElementClassName($li, formConfig.className);
|
|
9142
|
+
this.setElementAttributes($li, formConfig.attributes);
|
|
9143
|
+
this.setElementProps($li, formConfig.props);
|
|
9150
9144
|
/* 左边底部的描述的文字 */
|
|
9151
9145
|
let leftDescriptionText = "";
|
|
9152
9146
|
if (Boolean(formConfig.description)) {
|
|
9153
9147
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
9154
9148
|
}
|
|
9155
|
-
PopsSafeUtils.setSafeHTML(
|
|
9149
|
+
PopsSafeUtils.setSafeHTML($li,
|
|
9156
9150
|
/*html*/ `
|
|
9157
9151
|
<div class="pops-panel-item-left-text">
|
|
9158
9152
|
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>${leftDescriptionText}</div>
|
|
@@ -9166,10 +9160,10 @@ var pops = (function () {
|
|
|
9166
9160
|
const PopsPanelButton = {
|
|
9167
9161
|
[Symbol.toStringTag]: "PopsPanelButton",
|
|
9168
9162
|
$ele: {
|
|
9169
|
-
panelButton:
|
|
9170
|
-
button:
|
|
9171
|
-
icon:
|
|
9172
|
-
spanText:
|
|
9163
|
+
panelButton: $li.querySelector(".pops-panel-button"),
|
|
9164
|
+
button: $li.querySelector(".pops-panel-button .pops-panel-button_inner"),
|
|
9165
|
+
icon: $li.querySelector(".pops-panel-button .pops-bottom-icon"),
|
|
9166
|
+
spanText: $li.querySelector(".pops-panel-button .pops-panel-button-text"),
|
|
9173
9167
|
},
|
|
9174
9168
|
$data: {},
|
|
9175
9169
|
init() {
|
|
@@ -9282,10 +9276,11 @@ var pops = (function () {
|
|
|
9282
9276
|
},
|
|
9283
9277
|
};
|
|
9284
9278
|
PopsPanelButton.init();
|
|
9285
|
-
|
|
9286
|
-
return
|
|
9279
|
+
Reflect.set($li, "data-button", PopsPanelButton);
|
|
9280
|
+
return $li;
|
|
9287
9281
|
},
|
|
9288
9282
|
/**
|
|
9283
|
+
* type ==> deepMenu
|
|
9289
9284
|
* 获取深层容器的元素<li>
|
|
9290
9285
|
* @param formConfig
|
|
9291
9286
|
*/
|
|
@@ -9293,7 +9288,7 @@ var pops = (function () {
|
|
|
9293
9288
|
let that = this;
|
|
9294
9289
|
let $li = document.createElement("li");
|
|
9295
9290
|
$li.classList.add("pops-panel-deepMenu-nav-item");
|
|
9296
|
-
$li
|
|
9291
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
9297
9292
|
this.setElementClassName($li, formConfig.className);
|
|
9298
9293
|
// 设置属性
|
|
9299
9294
|
this.setElementAttributes($li, formConfig.attributes);
|
|
@@ -9429,6 +9424,7 @@ var pops = (function () {
|
|
|
9429
9424
|
let $deepMenuContainer = popsDOMUtils.createElement("section", {
|
|
9430
9425
|
className: "pops-panel-container pops-panel-deepMenu-container",
|
|
9431
9426
|
});
|
|
9427
|
+
Reflect.set($deepMenuContainer, "__formConfig__", formConfig);
|
|
9432
9428
|
let $deepMenuHeaderUL = popsDOMUtils.createElement("ul", {
|
|
9433
9429
|
className: "pops-panel-deepMenu-container-header-ul",
|
|
9434
9430
|
});
|
|
@@ -9443,13 +9439,13 @@ var pops = (function () {
|
|
|
9443
9439
|
className: "pops-panel-deepMenu-container-left-arrow-icon",
|
|
9444
9440
|
innerHTML: PopsIcon.getIcon("arrowLeft"),
|
|
9445
9441
|
});
|
|
9446
|
-
popsDOMUtils.on($headerLeftArrow, "click",
|
|
9447
|
-
event
|
|
9448
|
-
event?.stopPropagation();
|
|
9442
|
+
popsDOMUtils.on($headerLeftArrow, "click", (event) => {
|
|
9443
|
+
popsDOMUtils.preventEvent(event);
|
|
9449
9444
|
// 返回上一层菜单
|
|
9450
|
-
let $prev = $deepMenuContainer.previousElementSibling;
|
|
9445
|
+
let $prev = ($deepMenuContainer.previousElementSibling);
|
|
9451
9446
|
popsDOMUtils.cssShow($prev);
|
|
9452
9447
|
$deepMenuContainer.remove();
|
|
9448
|
+
that.triggerRenderRightContainer($prev);
|
|
9453
9449
|
}, {
|
|
9454
9450
|
once: true,
|
|
9455
9451
|
});
|
|
@@ -9472,6 +9468,7 @@ var pops = (function () {
|
|
|
9472
9468
|
sectionBodyContainer: $deepMenuBodyUL,
|
|
9473
9469
|
});
|
|
9474
9470
|
}
|
|
9471
|
+
that.triggerRenderRightContainer($deepMenuContainer);
|
|
9475
9472
|
},
|
|
9476
9473
|
/** 设置项的点击事件 */
|
|
9477
9474
|
setLiClickEvent() {
|
|
@@ -9487,22 +9484,22 @@ var pops = (function () {
|
|
|
9487
9484
|
},
|
|
9488
9485
|
};
|
|
9489
9486
|
PopsPanelDeepMenu.init();
|
|
9490
|
-
$li
|
|
9487
|
+
Reflect.set($li, "data-deepMenu", PopsPanelDeepMenu);
|
|
9491
9488
|
return $li;
|
|
9492
9489
|
},
|
|
9493
9490
|
/**
|
|
9494
|
-
* 获取中间容器的元素<li>
|
|
9495
9491
|
* type ===> own
|
|
9492
|
+
* 获取中间容器的元素<li>
|
|
9496
9493
|
* @param formConfig
|
|
9497
9494
|
*/
|
|
9498
9495
|
createSectionContainerItem_own(formConfig) {
|
|
9499
|
-
let
|
|
9500
|
-
|
|
9496
|
+
let $li = document.createElement("li");
|
|
9497
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
9501
9498
|
if (formConfig.className) {
|
|
9502
|
-
|
|
9499
|
+
$li.className = formConfig.className;
|
|
9503
9500
|
}
|
|
9504
|
-
|
|
9505
|
-
return
|
|
9501
|
+
$li = formConfig.getLiElementCallBack($li);
|
|
9502
|
+
return $li;
|
|
9506
9503
|
},
|
|
9507
9504
|
/**
|
|
9508
9505
|
* 获取中间容器的元素<li>
|
|
@@ -9623,6 +9620,17 @@ var pops = (function () {
|
|
|
9623
9620
|
});
|
|
9624
9621
|
}
|
|
9625
9622
|
},
|
|
9623
|
+
/**
|
|
9624
|
+
* 触发触发渲染右侧容器的事件
|
|
9625
|
+
*/
|
|
9626
|
+
triggerRenderRightContainer($container) {
|
|
9627
|
+
let __formConfig__ = Reflect.get($container, "__formConfig__");
|
|
9628
|
+
this.$el.$pops.dispatchEvent(new CustomEvent("pops:renderRightContainer", {
|
|
9629
|
+
detail: {
|
|
9630
|
+
formConfig: __formConfig__,
|
|
9631
|
+
},
|
|
9632
|
+
}));
|
|
9633
|
+
},
|
|
9626
9634
|
/**
|
|
9627
9635
|
*
|
|
9628
9636
|
* @param formConfig
|
|
@@ -9649,6 +9657,8 @@ var pops = (function () {
|
|
|
9649
9657
|
const that = this;
|
|
9650
9658
|
popsDOMUtils.on(asideLiElement, "click", void 0, (event) => {
|
|
9651
9659
|
this.clearContainer();
|
|
9660
|
+
let rightContainerFormConfig = Reflect.get(asideLiElement, "__forms__");
|
|
9661
|
+
Reflect.set(that.$el.$contentSectionContainer, "__formConfig__", rightContainerFormConfig);
|
|
9652
9662
|
popsDOMUtils.cssShow(that.$el.$contentSectionContainer);
|
|
9653
9663
|
this.clearAsideItemIsVisited();
|
|
9654
9664
|
this.setAsideItemIsVisited(asideLiElement);
|
|
@@ -9656,20 +9666,19 @@ var pops = (function () {
|
|
|
9656
9666
|
let headerTitleText = asideConfig.headerTitle ?? asideConfig.title;
|
|
9657
9667
|
if (typeof headerTitleText === "string" &&
|
|
9658
9668
|
headerTitleText.trim() !== "") {
|
|
9659
|
-
let
|
|
9660
|
-
|
|
9661
|
-
|
|
9662
|
-
|
|
9663
|
-
|
|
9664
|
-
|
|
9665
|
-
let __forms__ = asideLiElement["__forms__"];
|
|
9666
|
-
__forms__.forEach((formConfig) => {
|
|
9669
|
+
let $containerHeaderTitle = document.createElement("li");
|
|
9670
|
+
Reflect.set($containerHeaderTitle, "__asideConfig__", asideConfig);
|
|
9671
|
+
PopsSafeUtils.setSafeHTML($containerHeaderTitle, headerTitleText);
|
|
9672
|
+
this.sectionContainerHeaderULElement.appendChild($containerHeaderTitle);
|
|
9673
|
+
}
|
|
9674
|
+
rightContainerFormConfig.forEach((formConfig) => {
|
|
9667
9675
|
this.createSectionContainerItem_forms(formConfig);
|
|
9668
9676
|
});
|
|
9669
9677
|
if (typeof asideConfig.callback === "function") {
|
|
9670
9678
|
/* 执行回调 */
|
|
9671
9679
|
asideConfig.callback(event, this.sectionContainerHeaderULElement, this.sectionContainerULElement);
|
|
9672
9680
|
}
|
|
9681
|
+
that.triggerRenderRightContainer(that.$el.$contentSectionContainer);
|
|
9673
9682
|
});
|
|
9674
9683
|
},
|
|
9675
9684
|
};
|
|
@@ -9766,6 +9775,7 @@ var pops = (function () {
|
|
|
9766
9775
|
panelHandleContentDetails.init({
|
|
9767
9776
|
config: config,
|
|
9768
9777
|
$el: {
|
|
9778
|
+
$pops: $pops,
|
|
9769
9779
|
$content: $content,
|
|
9770
9780
|
$contentAside: $contentAside,
|
|
9771
9781
|
$contentSectionContainer: $contentSectionContainer,
|
|
@@ -9790,7 +9800,15 @@ var pops = (function () {
|
|
|
9790
9800
|
});
|
|
9791
9801
|
}
|
|
9792
9802
|
let result = PopsHandler.handleResultDetails(eventDetails);
|
|
9793
|
-
return
|
|
9803
|
+
return {
|
|
9804
|
+
...result,
|
|
9805
|
+
addEventListener: (event, listener, options) => {
|
|
9806
|
+
$pops.addEventListener(event, listener, options);
|
|
9807
|
+
},
|
|
9808
|
+
removeEventListener: (event, listener, options) => {
|
|
9809
|
+
$pops.removeEventListener(event, listener, options);
|
|
9810
|
+
},
|
|
9811
|
+
};
|
|
9794
9812
|
},
|
|
9795
9813
|
};
|
|
9796
9814
|
|
|
@@ -11034,7 +11052,7 @@ var pops = (function () {
|
|
|
11034
11052
|
/** 配置 */
|
|
11035
11053
|
config = {
|
|
11036
11054
|
/** 版本号 */
|
|
11037
|
-
version: "2025.6.
|
|
11055
|
+
version: "2025.6.25",
|
|
11038
11056
|
cssText: PopsCSS,
|
|
11039
11057
|
/** icon图标的svg代码 */
|
|
11040
11058
|
iconSVG: PopsIcon.$data,
|