@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.umd.js
CHANGED
|
@@ -333,8 +333,7 @@
|
|
|
333
333
|
if (target === PopsCore.self) {
|
|
334
334
|
return true;
|
|
335
335
|
}
|
|
336
|
-
if (typeof unsafeWindow !== "undefined" &&
|
|
337
|
-
target === unsafeWindow) {
|
|
336
|
+
if (typeof unsafeWindow !== "undefined" && target === unsafeWindow) {
|
|
338
337
|
return true;
|
|
339
338
|
}
|
|
340
339
|
if (target?.Math?.toString() !== "[object Math]") {
|
|
@@ -7081,6 +7080,8 @@
|
|
|
7081
7080
|
* 元素
|
|
7082
7081
|
*/
|
|
7083
7082
|
$el: {
|
|
7083
|
+
/** pops主元素 */
|
|
7084
|
+
$pops: null,
|
|
7084
7085
|
/** 内容 */
|
|
7085
7086
|
$content: null,
|
|
7086
7087
|
/** 左侧容器 */
|
|
@@ -7093,8 +7094,6 @@
|
|
|
7093
7094
|
* @param details
|
|
7094
7095
|
*/
|
|
7095
7096
|
init(details) {
|
|
7096
|
-
// @ts-ignore
|
|
7097
|
-
this.$el = null;
|
|
7098
7097
|
this.$el = {
|
|
7099
7098
|
...details.$el,
|
|
7100
7099
|
};
|
|
@@ -7157,11 +7156,12 @@
|
|
|
7157
7156
|
* 清空container容器的元素
|
|
7158
7157
|
*/
|
|
7159
7158
|
clearContainer() {
|
|
7159
|
+
Reflect.deleteProperty(this.$el.$contentSectionContainer, "__formConfig__");
|
|
7160
7160
|
PopsSafeUtils.setSafeHTML(this.sectionContainerHeaderULElement, "");
|
|
7161
7161
|
PopsSafeUtils.setSafeHTML(this.sectionContainerULElement, "");
|
|
7162
7162
|
this.$el.$content
|
|
7163
7163
|
?.querySelectorAll("section.pops-panel-deepMenu-container")
|
|
7164
|
-
.forEach((
|
|
7164
|
+
.forEach(($el) => $el.remove());
|
|
7165
7165
|
},
|
|
7166
7166
|
/**
|
|
7167
7167
|
* 清空左侧容器已访问记录
|
|
@@ -7169,8 +7169,8 @@
|
|
|
7169
7169
|
clearAsideItemIsVisited() {
|
|
7170
7170
|
this.$el.$contentAside
|
|
7171
7171
|
.querySelectorAll(".pops-is-visited")
|
|
7172
|
-
.forEach((
|
|
7173
|
-
popsDOMUtils.removeClassName(
|
|
7172
|
+
.forEach(($el) => {
|
|
7173
|
+
popsDOMUtils.removeClassName($el, "pops-is-visited");
|
|
7174
7174
|
});
|
|
7175
7175
|
},
|
|
7176
7176
|
/**
|
|
@@ -7247,34 +7247,33 @@
|
|
|
7247
7247
|
* @param asideConfig
|
|
7248
7248
|
*/
|
|
7249
7249
|
createAsideItem(asideConfig) {
|
|
7250
|
-
let
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
PopsSafeUtils.setSafeHTML(liElement, asideConfig.title);
|
|
7250
|
+
let $li = document.createElement("li");
|
|
7251
|
+
$li.id = asideConfig.id;
|
|
7252
|
+
Reflect.set($li, "__forms__", asideConfig.forms);
|
|
7253
|
+
PopsSafeUtils.setSafeHTML($li, asideConfig.title);
|
|
7255
7254
|
/* 处理className */
|
|
7256
|
-
this.setElementClassName(
|
|
7257
|
-
this.setElementAttributes(
|
|
7258
|
-
this.setElementProps(
|
|
7259
|
-
return
|
|
7255
|
+
this.setElementClassName($li, asideConfig.className);
|
|
7256
|
+
this.setElementAttributes($li, asideConfig.attributes);
|
|
7257
|
+
this.setElementProps($li, asideConfig.props);
|
|
7258
|
+
return $li;
|
|
7260
7259
|
},
|
|
7261
7260
|
/**
|
|
7262
|
-
* 创建中间容器的元素<li>
|
|
7263
7261
|
* type ==> switch
|
|
7262
|
+
* 创建中间容器的元素<li>
|
|
7264
7263
|
* @param formConfig
|
|
7265
7264
|
*/
|
|
7266
7265
|
createSectionContainerItem_switch(formConfig) {
|
|
7267
|
-
let
|
|
7268
|
-
|
|
7269
|
-
this.setElementClassName(
|
|
7270
|
-
this.setElementAttributes(
|
|
7271
|
-
this.setElementProps(
|
|
7266
|
+
let $li = document.createElement("li");
|
|
7267
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
7268
|
+
this.setElementClassName($li, formConfig.className);
|
|
7269
|
+
this.setElementAttributes($li, formConfig.attributes);
|
|
7270
|
+
this.setElementProps($li, formConfig.props);
|
|
7272
7271
|
/* 左边底部的描述的文字 */
|
|
7273
7272
|
let leftDescriptionText = "";
|
|
7274
7273
|
if (Boolean(formConfig.description)) {
|
|
7275
7274
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
7276
7275
|
}
|
|
7277
|
-
PopsSafeUtils.setSafeHTML(
|
|
7276
|
+
PopsSafeUtils.setSafeHTML($li,
|
|
7278
7277
|
/*html*/ `
|
|
7279
7278
|
<div class="pops-panel-item-left-text">
|
|
7280
7279
|
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>${leftDescriptionText}</div>
|
|
@@ -7291,9 +7290,9 @@
|
|
|
7291
7290
|
value: Boolean(formConfig.getValue()),
|
|
7292
7291
|
},
|
|
7293
7292
|
$ele: {
|
|
7294
|
-
switch:
|
|
7295
|
-
input:
|
|
7296
|
-
core:
|
|
7293
|
+
switch: $li.querySelector(".pops-panel-switch"),
|
|
7294
|
+
input: $li.querySelector(".pops-panel-switch__input"),
|
|
7295
|
+
core: $li.querySelector(".pops-panel-switch__core"),
|
|
7297
7296
|
},
|
|
7298
7297
|
init() {
|
|
7299
7298
|
this.setStatus(this.$data.value);
|
|
@@ -7355,26 +7354,26 @@
|
|
|
7355
7354
|
},
|
|
7356
7355
|
};
|
|
7357
7356
|
PopsPanelSwitch.init();
|
|
7358
|
-
|
|
7359
|
-
return
|
|
7357
|
+
Reflect.set($li, "data-switch", PopsPanelSwitch);
|
|
7358
|
+
return $li;
|
|
7360
7359
|
},
|
|
7361
7360
|
/**
|
|
7362
|
-
* 获取中间容器的元素<li>
|
|
7363
7361
|
* type ==> slider
|
|
7362
|
+
* 获取中间容器的元素<li>
|
|
7364
7363
|
* @param formConfig
|
|
7365
7364
|
*/
|
|
7366
7365
|
createSectionContainerItem_slider(formConfig) {
|
|
7367
|
-
let
|
|
7368
|
-
|
|
7369
|
-
this.setElementClassName(
|
|
7370
|
-
this.setElementAttributes(
|
|
7371
|
-
this.setElementProps(
|
|
7366
|
+
let $li = document.createElement("li");
|
|
7367
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
7368
|
+
this.setElementClassName($li, formConfig.className);
|
|
7369
|
+
this.setElementAttributes($li, formConfig.attributes);
|
|
7370
|
+
this.setElementProps($li, formConfig.props);
|
|
7372
7371
|
/* 左边底部的描述的文字 */
|
|
7373
7372
|
let leftDescriptionText = "";
|
|
7374
7373
|
if (Boolean(formConfig.description)) {
|
|
7375
7374
|
leftDescriptionText = `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
7376
7375
|
}
|
|
7377
|
-
PopsSafeUtils.setSafeHTML(
|
|
7376
|
+
PopsSafeUtils.setSafeHTML($li,
|
|
7378
7377
|
/*html*/ `
|
|
7379
7378
|
<div class="pops-panel-item-left-text">
|
|
7380
7379
|
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>${leftDescriptionText}</div>
|
|
@@ -7382,11 +7381,11 @@
|
|
|
7382
7381
|
<input type="range" min="${formConfig.min}" max="${formConfig.max}">
|
|
7383
7382
|
</div>
|
|
7384
7383
|
`);
|
|
7385
|
-
let
|
|
7384
|
+
let $rangeInput = $li.querySelector(".pops-panel-slider input[type=range]");
|
|
7386
7385
|
if (formConfig.step) {
|
|
7387
|
-
|
|
7386
|
+
$rangeInput.setAttribute("step", formConfig.step.toString());
|
|
7388
7387
|
}
|
|
7389
|
-
|
|
7388
|
+
$rangeInput.value = formConfig.getValue().toString();
|
|
7390
7389
|
/**
|
|
7391
7390
|
* 获取提示的内容
|
|
7392
7391
|
* @param value
|
|
@@ -7400,9 +7399,9 @@
|
|
|
7400
7399
|
}
|
|
7401
7400
|
};
|
|
7402
7401
|
let tooltip = PopsTooltip.init({
|
|
7403
|
-
target:
|
|
7402
|
+
target: $rangeInput.parentElement,
|
|
7404
7403
|
content: () => {
|
|
7405
|
-
return getToolTipContent(
|
|
7404
|
+
return getToolTipContent($rangeInput.value);
|
|
7406
7405
|
},
|
|
7407
7406
|
zIndex: () => {
|
|
7408
7407
|
return PopsInstanceUtils.getPopsMaxZIndex().zIndex;
|
|
@@ -7413,32 +7412,31 @@
|
|
|
7413
7412
|
position: "top",
|
|
7414
7413
|
arrowDistance: 10,
|
|
7415
7414
|
});
|
|
7416
|
-
popsDOMUtils.on(
|
|
7417
|
-
tooltip.toolTip.changeContent(getToolTipContent(
|
|
7415
|
+
popsDOMUtils.on($rangeInput, ["input", "propertychange"], void 0, function (event) {
|
|
7416
|
+
tooltip.toolTip.changeContent(getToolTipContent($rangeInput.value));
|
|
7418
7417
|
if (typeof formConfig.callback === "function") {
|
|
7419
|
-
formConfig.callback(event,
|
|
7418
|
+
formConfig.callback(event, $rangeInput.valueAsNumber);
|
|
7420
7419
|
}
|
|
7421
7420
|
});
|
|
7422
|
-
return
|
|
7421
|
+
return $li;
|
|
7423
7422
|
},
|
|
7424
7423
|
/**
|
|
7425
|
-
* 获取中间容器的元素<li>
|
|
7426
7424
|
* type ==> slider
|
|
7425
|
+
* 获取中间容器的元素<li>
|
|
7427
7426
|
* @param formConfig
|
|
7428
7427
|
*/
|
|
7429
7428
|
createSectionContainerItem_slider_new(formConfig) {
|
|
7430
|
-
let
|
|
7431
|
-
|
|
7432
|
-
|
|
7433
|
-
this.
|
|
7434
|
-
this.
|
|
7435
|
-
this.setElementProps(liElement, formConfig.props);
|
|
7429
|
+
let $li = document.createElement("li");
|
|
7430
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
7431
|
+
this.setElementClassName($li, formConfig.className);
|
|
7432
|
+
this.setElementAttributes($li, formConfig.attributes);
|
|
7433
|
+
this.setElementProps($li, formConfig.props);
|
|
7436
7434
|
/* 左边底部的描述的文字 */
|
|
7437
7435
|
let leftDescriptionText = "";
|
|
7438
7436
|
if (Boolean(formConfig.description)) {
|
|
7439
7437
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
7440
7438
|
}
|
|
7441
|
-
PopsSafeUtils.setSafeHTML(
|
|
7439
|
+
PopsSafeUtils.setSafeHTML($li,
|
|
7442
7440
|
/*html*/ `
|
|
7443
7441
|
<div class="pops-panel-item-left-text" style="flex: 1;">
|
|
7444
7442
|
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>${leftDescriptionText}</div>
|
|
@@ -7513,11 +7511,11 @@
|
|
|
7513
7511
|
tooltip: null,
|
|
7514
7512
|
},
|
|
7515
7513
|
$ele: {
|
|
7516
|
-
slider:
|
|
7517
|
-
runAway:
|
|
7518
|
-
bar:
|
|
7519
|
-
buttonWrapper:
|
|
7520
|
-
button:
|
|
7514
|
+
slider: $li.querySelector(".pops-slider"),
|
|
7515
|
+
runAway: $li.querySelector(".pops-slider__runway"),
|
|
7516
|
+
bar: $li.querySelector(".pops-slider__bar"),
|
|
7517
|
+
buttonWrapper: $li.querySelector(".pops-slider__button-wrapper"),
|
|
7518
|
+
button: $li.querySelector(".pops-slider__button"),
|
|
7521
7519
|
},
|
|
7522
7520
|
$interval: {
|
|
7523
7521
|
isCheck: false,
|
|
@@ -7583,14 +7581,10 @@
|
|
|
7583
7581
|
this.$ele.slider.setAttribute("data-max", this.max.toString());
|
|
7584
7582
|
this.$ele.slider.setAttribute("data-value", this.value.toString());
|
|
7585
7583
|
this.$ele.slider.setAttribute("data-step", this.step.toString());
|
|
7586
|
-
|
|
7587
|
-
this.$ele.slider
|
|
7588
|
-
|
|
7589
|
-
this.$ele.slider
|
|
7590
|
-
// @ts-ignore
|
|
7591
|
-
this.$ele.slider["data-value"] = this.value;
|
|
7592
|
-
// @ts-ignore
|
|
7593
|
-
this.$ele.slider["data-step"] = this.step;
|
|
7584
|
+
Reflect.set(this.$ele.slider, "data-min", this.min);
|
|
7585
|
+
Reflect.set(this.$ele.slider, "data-max", this.max);
|
|
7586
|
+
Reflect.set(this.$ele.slider, "data-value", this.value);
|
|
7587
|
+
Reflect.set(this.$ele.slider, "data-step", this.step);
|
|
7594
7588
|
},
|
|
7595
7589
|
/**
|
|
7596
7590
|
* 初始化滑块的总长度的数据(px)
|
|
@@ -7610,7 +7604,7 @@
|
|
|
7610
7604
|
let widthPx = 0;
|
|
7611
7605
|
for (let stepValue = this.min; stepValue <= this.max; stepValue += this.step) {
|
|
7612
7606
|
let value = this.formatValue(stepValue);
|
|
7613
|
-
let info
|
|
7607
|
+
let info;
|
|
7614
7608
|
if (value === this.min) {
|
|
7615
7609
|
/* 起始 */
|
|
7616
7610
|
info = {
|
|
@@ -7653,7 +7647,7 @@
|
|
|
7653
7647
|
let widthPx = 0;
|
|
7654
7648
|
for (let stepValue = this.min; stepValue <= this.max; stepValue = PopsMathFloatUtils.add(stepValue, this.step)) {
|
|
7655
7649
|
let value = this.formatValue(stepValue);
|
|
7656
|
-
let info
|
|
7650
|
+
let info;
|
|
7657
7651
|
if (value === this.min) {
|
|
7658
7652
|
/* 起始 */
|
|
7659
7653
|
info = {
|
|
@@ -7811,7 +7805,7 @@
|
|
|
7811
7805
|
event.target !== this.$ele.bar) {
|
|
7812
7806
|
return;
|
|
7813
7807
|
}
|
|
7814
|
-
let clickX = parseFloat(event.offsetX);
|
|
7808
|
+
let clickX = parseFloat(event.offsetX.toString());
|
|
7815
7809
|
this.dragStartCallBack();
|
|
7816
7810
|
this.dragMoveCallBack(event, clickX, this.value);
|
|
7817
7811
|
this.dragEndCallBack(clickX);
|
|
@@ -7964,7 +7958,7 @@
|
|
|
7964
7958
|
return formConfig.getToolTipContent(PopsPanelSlider.value);
|
|
7965
7959
|
}
|
|
7966
7960
|
else {
|
|
7967
|
-
return PopsPanelSlider.value;
|
|
7961
|
+
return PopsPanelSlider.value.toString();
|
|
7968
7962
|
}
|
|
7969
7963
|
}
|
|
7970
7964
|
let tooltip = PopsTooltip.init({
|
|
@@ -8008,20 +8002,20 @@
|
|
|
8008
8002
|
},
|
|
8009
8003
|
};
|
|
8010
8004
|
PopsPanelSlider.init();
|
|
8011
|
-
|
|
8012
|
-
return
|
|
8005
|
+
Reflect.set($li, "data-slider", PopsPanelSlider);
|
|
8006
|
+
return $li;
|
|
8013
8007
|
},
|
|
8014
8008
|
/**
|
|
8015
|
-
* 获取中间容器的元素<li>
|
|
8016
8009
|
* type ==> input
|
|
8010
|
+
* 获取中间容器的元素<li>
|
|
8017
8011
|
* @param formConfig
|
|
8018
8012
|
*/
|
|
8019
8013
|
createSectionContainerItem_input(formConfig) {
|
|
8020
|
-
let
|
|
8021
|
-
|
|
8022
|
-
this.setElementClassName(
|
|
8023
|
-
this.setElementAttributes(
|
|
8024
|
-
this.setElementProps(
|
|
8014
|
+
let $li = document.createElement("li");
|
|
8015
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
8016
|
+
this.setElementClassName($li, formConfig.className);
|
|
8017
|
+
this.setElementAttributes($li, formConfig.attributes);
|
|
8018
|
+
this.setElementProps($li, formConfig.props);
|
|
8025
8019
|
let inputType = "text";
|
|
8026
8020
|
if (formConfig.isPassword) {
|
|
8027
8021
|
inputType = "password";
|
|
@@ -8034,7 +8028,7 @@
|
|
|
8034
8028
|
if (Boolean(formConfig.description)) {
|
|
8035
8029
|
leftDescriptionText = `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
8036
8030
|
}
|
|
8037
|
-
PopsSafeUtils.setSafeHTML(
|
|
8031
|
+
PopsSafeUtils.setSafeHTML($li,
|
|
8038
8032
|
/*html*/ `
|
|
8039
8033
|
<div class="pops-panel-item-left-text">
|
|
8040
8034
|
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>${leftDescriptionText}</div>
|
|
@@ -8045,8 +8039,8 @@
|
|
|
8045
8039
|
const PopsPanelInput = {
|
|
8046
8040
|
[Symbol.toStringTag]: "PopsPanelInput",
|
|
8047
8041
|
$ele: {
|
|
8048
|
-
panelInput:
|
|
8049
|
-
input:
|
|
8042
|
+
panelInput: $li.querySelector(".pops-panel-input"),
|
|
8043
|
+
input: $li.querySelector("input"),
|
|
8050
8044
|
inputSpanIcon: document.createElement("span"),
|
|
8051
8045
|
inputSpanIconInner: null,
|
|
8052
8046
|
icon: null,
|
|
@@ -8075,7 +8069,7 @@
|
|
|
8075
8069
|
this.disable();
|
|
8076
8070
|
}
|
|
8077
8071
|
if (typeof formConfig.handlerCallBack === "function") {
|
|
8078
|
-
formConfig.handlerCallBack(
|
|
8072
|
+
formConfig.handlerCallBack($li, this.$ele.input);
|
|
8079
8073
|
}
|
|
8080
8074
|
},
|
|
8081
8075
|
/**
|
|
@@ -8210,26 +8204,26 @@
|
|
|
8210
8204
|
},
|
|
8211
8205
|
};
|
|
8212
8206
|
PopsPanelInput.init();
|
|
8213
|
-
|
|
8214
|
-
return
|
|
8207
|
+
Reflect.set($li, "data-input", PopsPanelInput);
|
|
8208
|
+
return $li;
|
|
8215
8209
|
},
|
|
8216
8210
|
/**
|
|
8217
|
-
* 获取中间容器的元素<li>
|
|
8218
8211
|
* type ==> textarea
|
|
8212
|
+
* 获取中间容器的元素<li>
|
|
8219
8213
|
* @param formConfig
|
|
8220
8214
|
*/
|
|
8221
8215
|
createSectionContainerItem_textarea(formConfig) {
|
|
8222
|
-
let
|
|
8223
|
-
|
|
8224
|
-
this.setElementClassName(
|
|
8225
|
-
this.setElementAttributes(
|
|
8226
|
-
this.setElementProps(
|
|
8216
|
+
let $li = document.createElement("li");
|
|
8217
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
8218
|
+
this.setElementClassName($li, formConfig.className);
|
|
8219
|
+
this.setElementAttributes($li, formConfig.attributes);
|
|
8220
|
+
this.setElementProps($li, formConfig.props);
|
|
8227
8221
|
/* 左边底部的描述的文字 */
|
|
8228
8222
|
let leftDescriptionText = "";
|
|
8229
8223
|
if (Boolean(formConfig.description)) {
|
|
8230
8224
|
leftDescriptionText = `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
8231
8225
|
}
|
|
8232
|
-
PopsSafeUtils.setSafeHTML(
|
|
8226
|
+
PopsSafeUtils.setSafeHTML($li,
|
|
8233
8227
|
/*html*/ `
|
|
8234
8228
|
<div class="pops-panel-item-left-text">
|
|
8235
8229
|
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>${leftDescriptionText}</div>
|
|
@@ -8240,8 +8234,8 @@
|
|
|
8240
8234
|
const PopsPanelTextArea = {
|
|
8241
8235
|
[Symbol.toStringTag]: "PopsPanelTextArea",
|
|
8242
8236
|
$ele: {
|
|
8243
|
-
panelTextarea:
|
|
8244
|
-
textarea:
|
|
8237
|
+
panelTextarea: $li.querySelector(".pops-panel-textarea"),
|
|
8238
|
+
textarea: $li.querySelector(".pops-panel-textarea textarea"),
|
|
8245
8239
|
},
|
|
8246
8240
|
$data: {
|
|
8247
8241
|
value: formConfig.getValue(),
|
|
@@ -8273,35 +8267,36 @@
|
|
|
8273
8267
|
*/
|
|
8274
8268
|
setChangeEvent() {
|
|
8275
8269
|
popsDOMUtils.on(this.$ele.textarea, ["input", "propertychange"], void 0, (event) => {
|
|
8276
|
-
|
|
8270
|
+
let value = this.$ele.textarea.value;
|
|
8271
|
+
this.$data.value = value;
|
|
8277
8272
|
if (typeof formConfig.callback === "function") {
|
|
8278
|
-
formConfig.callback(event,
|
|
8273
|
+
formConfig.callback(event, value);
|
|
8279
8274
|
}
|
|
8280
8275
|
});
|
|
8281
8276
|
},
|
|
8282
8277
|
};
|
|
8283
8278
|
PopsPanelTextArea.init();
|
|
8284
|
-
|
|
8285
|
-
return
|
|
8279
|
+
Reflect.set($li, "data-textarea", PopsPanelTextArea);
|
|
8280
|
+
return $li;
|
|
8286
8281
|
},
|
|
8287
8282
|
/**
|
|
8288
|
-
* 获取中间容器的元素<li>
|
|
8289
8283
|
* type ==> select
|
|
8284
|
+
* 获取中间容器的元素<li>
|
|
8290
8285
|
* @param formConfig
|
|
8291
8286
|
*/
|
|
8292
8287
|
createSectionContainerItem_select(formConfig) {
|
|
8293
8288
|
const that = this;
|
|
8294
|
-
let
|
|
8295
|
-
|
|
8296
|
-
this.setElementClassName(
|
|
8297
|
-
this.setElementAttributes(
|
|
8298
|
-
this.setElementProps(
|
|
8289
|
+
let $li = document.createElement("li");
|
|
8290
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
8291
|
+
this.setElementClassName($li, formConfig.className);
|
|
8292
|
+
this.setElementAttributes($li, formConfig.attributes);
|
|
8293
|
+
this.setElementProps($li, formConfig.props);
|
|
8299
8294
|
/* 左边底部的描述的文字 */
|
|
8300
8295
|
let leftDescriptionText = "";
|
|
8301
8296
|
if (Boolean(formConfig.description)) {
|
|
8302
8297
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
8303
8298
|
}
|
|
8304
|
-
PopsSafeUtils.setSafeHTML(
|
|
8299
|
+
PopsSafeUtils.setSafeHTML($li,
|
|
8305
8300
|
/*html*/ `
|
|
8306
8301
|
<div class="pops-panel-item-left-text">
|
|
8307
8302
|
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>${leftDescriptionText}</div>
|
|
@@ -8312,8 +8307,8 @@
|
|
|
8312
8307
|
const PopsPanelSelect = {
|
|
8313
8308
|
[Symbol.toStringTag]: "PopsPanelSelect",
|
|
8314
8309
|
$ele: {
|
|
8315
|
-
panelSelect:
|
|
8316
|
-
select:
|
|
8310
|
+
panelSelect: $li.querySelector(".pops-panel-select"),
|
|
8311
|
+
select: $li.querySelector(".pops-panel-select select"),
|
|
8317
8312
|
},
|
|
8318
8313
|
$eleKey: {
|
|
8319
8314
|
disable: "__disable__",
|
|
@@ -8433,7 +8428,7 @@
|
|
|
8433
8428
|
*/
|
|
8434
8429
|
setChangeEvent() {
|
|
8435
8430
|
popsDOMUtils.on(this.$ele.select, "change", void 0, (event) => {
|
|
8436
|
-
let $isSelectedElement =
|
|
8431
|
+
let $isSelectedElement = this.$ele.select[this.$ele.select.selectedIndex];
|
|
8437
8432
|
let selectInfo = this.getSelectOptionInfo($isSelectedElement);
|
|
8438
8433
|
this.setSelectOptionsDisableStatus();
|
|
8439
8434
|
if (typeof formConfig.callback === "function") {
|
|
@@ -8446,9 +8441,9 @@
|
|
|
8446
8441
|
/* 如果成功创建,加入到中间容器中 */
|
|
8447
8442
|
let childUListClassName = "pops-panel-select-child-forms";
|
|
8448
8443
|
// 移除旧的元素
|
|
8449
|
-
while (
|
|
8450
|
-
if (
|
|
8451
|
-
|
|
8444
|
+
while ($li.nextElementSibling) {
|
|
8445
|
+
if ($li.nextElementSibling.classList.contains(childUListClassName)) {
|
|
8446
|
+
$li.nextElementSibling.remove();
|
|
8452
8447
|
}
|
|
8453
8448
|
else {
|
|
8454
8449
|
break;
|
|
@@ -8456,7 +8451,7 @@
|
|
|
8456
8451
|
}
|
|
8457
8452
|
let $childUList = document.createElement("ul");
|
|
8458
8453
|
$childUList.className = childUListClassName;
|
|
8459
|
-
popsDOMUtils.after(
|
|
8454
|
+
popsDOMUtils.after($li, $childUList);
|
|
8460
8455
|
that.uListContainerAddItem(formConfig, {
|
|
8461
8456
|
ulElement: $childUList,
|
|
8462
8457
|
});
|
|
@@ -8476,26 +8471,26 @@
|
|
|
8476
8471
|
},
|
|
8477
8472
|
};
|
|
8478
8473
|
PopsPanelSelect.init();
|
|
8479
|
-
Reflect.set(
|
|
8480
|
-
return
|
|
8474
|
+
Reflect.set($li, "data-select", PopsPanelSelect);
|
|
8475
|
+
return $li;
|
|
8481
8476
|
},
|
|
8482
8477
|
/**
|
|
8483
|
-
* 获取中间容器的元素<li>
|
|
8484
8478
|
* type ==> select-multiple
|
|
8479
|
+
* 获取中间容器的元素<li>
|
|
8485
8480
|
* @param formConfig
|
|
8486
8481
|
*/
|
|
8487
8482
|
createSectionContainerItem_select_multiple_new(formConfig) {
|
|
8488
|
-
let
|
|
8489
|
-
Reflect.set(
|
|
8490
|
-
this.setElementClassName(
|
|
8491
|
-
this.setElementAttributes(
|
|
8492
|
-
this.setElementProps(
|
|
8483
|
+
let $li = document.createElement("li");
|
|
8484
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
8485
|
+
this.setElementClassName($li, formConfig.className);
|
|
8486
|
+
this.setElementAttributes($li, formConfig.attributes);
|
|
8487
|
+
this.setElementProps($li, formConfig.props);
|
|
8493
8488
|
/* 左边底部的描述的文字 */
|
|
8494
8489
|
let leftDescriptionText = "";
|
|
8495
8490
|
if (Boolean(formConfig.description)) {
|
|
8496
8491
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
8497
8492
|
}
|
|
8498
|
-
PopsSafeUtils.setSafeHTML(
|
|
8493
|
+
PopsSafeUtils.setSafeHTML($li,
|
|
8499
8494
|
/*html*/ `
|
|
8500
8495
|
<div class="pops-panel-item-left-text">
|
|
8501
8496
|
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>${leftDescriptionText}</div>
|
|
@@ -8570,15 +8565,14 @@
|
|
|
8570
8565
|
},
|
|
8571
8566
|
/** 初始化$el变量 */
|
|
8572
8567
|
inintEl() {
|
|
8573
|
-
this.$el.$container =
|
|
8574
|
-
this.$el.$wrapper =
|
|
8575
|
-
this.$el.$section =
|
|
8576
|
-
this.$el.$selectedInputWrapper =
|
|
8577
|
-
this.$el.$selectedPlaceHolderWrapper =
|
|
8578
|
-
liElement.querySelector(".el-select__selected-item.el-select__placeholder");
|
|
8568
|
+
this.$el.$container = $li.querySelector(".pops-panel-select-multiple");
|
|
8569
|
+
this.$el.$wrapper = $li.querySelector(".el-select__wrapper");
|
|
8570
|
+
this.$el.$section = $li.querySelector(".el-select__selection");
|
|
8571
|
+
this.$el.$selectedInputWrapper = $li.querySelector(".el-select__selected-item.el-select__input-wrapper");
|
|
8572
|
+
this.$el.$selectedPlaceHolderWrapper = $li.querySelector(".el-select__selected-item.el-select__placeholder");
|
|
8579
8573
|
this.$el.$suffix =
|
|
8580
|
-
|
|
8581
|
-
this.$el.$suffixIcon =
|
|
8574
|
+
$li.querySelector(".el-select__suffix");
|
|
8575
|
+
this.$el.$suffixIcon = $li.querySelector(".el-select__suffix .el-icon");
|
|
8582
8576
|
// 先把手动输入框隐藏
|
|
8583
8577
|
this.hideInputWrapper();
|
|
8584
8578
|
},
|
|
@@ -9136,26 +9130,26 @@
|
|
|
9136
9130
|
},
|
|
9137
9131
|
};
|
|
9138
9132
|
PopsPanelSelectMultiple.init();
|
|
9139
|
-
Reflect.set(
|
|
9140
|
-
return
|
|
9133
|
+
Reflect.set($li, "data-select-multiple", PopsPanelSelectMultiple);
|
|
9134
|
+
return $li;
|
|
9141
9135
|
},
|
|
9142
9136
|
/**
|
|
9143
|
-
* 获取中间容器的元素<li>
|
|
9144
9137
|
* type ==> button
|
|
9138
|
+
* 获取中间容器的元素<li>
|
|
9145
9139
|
* @param formConfig
|
|
9146
9140
|
*/
|
|
9147
9141
|
createSectionContainerItem_button(formConfig) {
|
|
9148
|
-
let
|
|
9149
|
-
|
|
9150
|
-
this.setElementClassName(
|
|
9151
|
-
this.setElementAttributes(
|
|
9152
|
-
this.setElementProps(
|
|
9142
|
+
let $li = document.createElement("li");
|
|
9143
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
9144
|
+
this.setElementClassName($li, formConfig.className);
|
|
9145
|
+
this.setElementAttributes($li, formConfig.attributes);
|
|
9146
|
+
this.setElementProps($li, formConfig.props);
|
|
9153
9147
|
/* 左边底部的描述的文字 */
|
|
9154
9148
|
let leftDescriptionText = "";
|
|
9155
9149
|
if (Boolean(formConfig.description)) {
|
|
9156
9150
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
9157
9151
|
}
|
|
9158
|
-
PopsSafeUtils.setSafeHTML(
|
|
9152
|
+
PopsSafeUtils.setSafeHTML($li,
|
|
9159
9153
|
/*html*/ `
|
|
9160
9154
|
<div class="pops-panel-item-left-text">
|
|
9161
9155
|
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>${leftDescriptionText}</div>
|
|
@@ -9169,10 +9163,10 @@
|
|
|
9169
9163
|
const PopsPanelButton = {
|
|
9170
9164
|
[Symbol.toStringTag]: "PopsPanelButton",
|
|
9171
9165
|
$ele: {
|
|
9172
|
-
panelButton:
|
|
9173
|
-
button:
|
|
9174
|
-
icon:
|
|
9175
|
-
spanText:
|
|
9166
|
+
panelButton: $li.querySelector(".pops-panel-button"),
|
|
9167
|
+
button: $li.querySelector(".pops-panel-button .pops-panel-button_inner"),
|
|
9168
|
+
icon: $li.querySelector(".pops-panel-button .pops-bottom-icon"),
|
|
9169
|
+
spanText: $li.querySelector(".pops-panel-button .pops-panel-button-text"),
|
|
9176
9170
|
},
|
|
9177
9171
|
$data: {},
|
|
9178
9172
|
init() {
|
|
@@ -9285,10 +9279,11 @@
|
|
|
9285
9279
|
},
|
|
9286
9280
|
};
|
|
9287
9281
|
PopsPanelButton.init();
|
|
9288
|
-
|
|
9289
|
-
return
|
|
9282
|
+
Reflect.set($li, "data-button", PopsPanelButton);
|
|
9283
|
+
return $li;
|
|
9290
9284
|
},
|
|
9291
9285
|
/**
|
|
9286
|
+
* type ==> deepMenu
|
|
9292
9287
|
* 获取深层容器的元素<li>
|
|
9293
9288
|
* @param formConfig
|
|
9294
9289
|
*/
|
|
@@ -9296,7 +9291,7 @@
|
|
|
9296
9291
|
let that = this;
|
|
9297
9292
|
let $li = document.createElement("li");
|
|
9298
9293
|
$li.classList.add("pops-panel-deepMenu-nav-item");
|
|
9299
|
-
$li
|
|
9294
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
9300
9295
|
this.setElementClassName($li, formConfig.className);
|
|
9301
9296
|
// 设置属性
|
|
9302
9297
|
this.setElementAttributes($li, formConfig.attributes);
|
|
@@ -9432,6 +9427,7 @@
|
|
|
9432
9427
|
let $deepMenuContainer = popsDOMUtils.createElement("section", {
|
|
9433
9428
|
className: "pops-panel-container pops-panel-deepMenu-container",
|
|
9434
9429
|
});
|
|
9430
|
+
Reflect.set($deepMenuContainer, "__formConfig__", formConfig);
|
|
9435
9431
|
let $deepMenuHeaderUL = popsDOMUtils.createElement("ul", {
|
|
9436
9432
|
className: "pops-panel-deepMenu-container-header-ul",
|
|
9437
9433
|
});
|
|
@@ -9446,13 +9442,13 @@
|
|
|
9446
9442
|
className: "pops-panel-deepMenu-container-left-arrow-icon",
|
|
9447
9443
|
innerHTML: PopsIcon.getIcon("arrowLeft"),
|
|
9448
9444
|
});
|
|
9449
|
-
popsDOMUtils.on($headerLeftArrow, "click",
|
|
9450
|
-
event
|
|
9451
|
-
event?.stopPropagation();
|
|
9445
|
+
popsDOMUtils.on($headerLeftArrow, "click", (event) => {
|
|
9446
|
+
popsDOMUtils.preventEvent(event);
|
|
9452
9447
|
// 返回上一层菜单
|
|
9453
|
-
let $prev = $deepMenuContainer.previousElementSibling;
|
|
9448
|
+
let $prev = ($deepMenuContainer.previousElementSibling);
|
|
9454
9449
|
popsDOMUtils.cssShow($prev);
|
|
9455
9450
|
$deepMenuContainer.remove();
|
|
9451
|
+
that.triggerRenderRightContainer($prev);
|
|
9456
9452
|
}, {
|
|
9457
9453
|
once: true,
|
|
9458
9454
|
});
|
|
@@ -9475,6 +9471,7 @@
|
|
|
9475
9471
|
sectionBodyContainer: $deepMenuBodyUL,
|
|
9476
9472
|
});
|
|
9477
9473
|
}
|
|
9474
|
+
that.triggerRenderRightContainer($deepMenuContainer);
|
|
9478
9475
|
},
|
|
9479
9476
|
/** 设置项的点击事件 */
|
|
9480
9477
|
setLiClickEvent() {
|
|
@@ -9490,22 +9487,22 @@
|
|
|
9490
9487
|
},
|
|
9491
9488
|
};
|
|
9492
9489
|
PopsPanelDeepMenu.init();
|
|
9493
|
-
$li
|
|
9490
|
+
Reflect.set($li, "data-deepMenu", PopsPanelDeepMenu);
|
|
9494
9491
|
return $li;
|
|
9495
9492
|
},
|
|
9496
9493
|
/**
|
|
9497
|
-
* 获取中间容器的元素<li>
|
|
9498
9494
|
* type ===> own
|
|
9495
|
+
* 获取中间容器的元素<li>
|
|
9499
9496
|
* @param formConfig
|
|
9500
9497
|
*/
|
|
9501
9498
|
createSectionContainerItem_own(formConfig) {
|
|
9502
|
-
let
|
|
9503
|
-
|
|
9499
|
+
let $li = document.createElement("li");
|
|
9500
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
9504
9501
|
if (formConfig.className) {
|
|
9505
|
-
|
|
9502
|
+
$li.className = formConfig.className;
|
|
9506
9503
|
}
|
|
9507
|
-
|
|
9508
|
-
return
|
|
9504
|
+
$li = formConfig.getLiElementCallBack($li);
|
|
9505
|
+
return $li;
|
|
9509
9506
|
},
|
|
9510
9507
|
/**
|
|
9511
9508
|
* 获取中间容器的元素<li>
|
|
@@ -9626,6 +9623,17 @@
|
|
|
9626
9623
|
});
|
|
9627
9624
|
}
|
|
9628
9625
|
},
|
|
9626
|
+
/**
|
|
9627
|
+
* 触发触发渲染右侧容器的事件
|
|
9628
|
+
*/
|
|
9629
|
+
triggerRenderRightContainer($container) {
|
|
9630
|
+
let __formConfig__ = Reflect.get($container, "__formConfig__");
|
|
9631
|
+
this.$el.$pops.dispatchEvent(new CustomEvent("pops:renderRightContainer", {
|
|
9632
|
+
detail: {
|
|
9633
|
+
formConfig: __formConfig__,
|
|
9634
|
+
},
|
|
9635
|
+
}));
|
|
9636
|
+
},
|
|
9629
9637
|
/**
|
|
9630
9638
|
*
|
|
9631
9639
|
* @param formConfig
|
|
@@ -9652,6 +9660,8 @@
|
|
|
9652
9660
|
const that = this;
|
|
9653
9661
|
popsDOMUtils.on(asideLiElement, "click", void 0, (event) => {
|
|
9654
9662
|
this.clearContainer();
|
|
9663
|
+
let rightContainerFormConfig = Reflect.get(asideLiElement, "__forms__");
|
|
9664
|
+
Reflect.set(that.$el.$contentSectionContainer, "__formConfig__", rightContainerFormConfig);
|
|
9655
9665
|
popsDOMUtils.cssShow(that.$el.$contentSectionContainer);
|
|
9656
9666
|
this.clearAsideItemIsVisited();
|
|
9657
9667
|
this.setAsideItemIsVisited(asideLiElement);
|
|
@@ -9659,20 +9669,19 @@
|
|
|
9659
9669
|
let headerTitleText = asideConfig.headerTitle ?? asideConfig.title;
|
|
9660
9670
|
if (typeof headerTitleText === "string" &&
|
|
9661
9671
|
headerTitleText.trim() !== "") {
|
|
9662
|
-
let
|
|
9663
|
-
|
|
9664
|
-
|
|
9665
|
-
|
|
9666
|
-
|
|
9667
|
-
|
|
9668
|
-
let __forms__ = asideLiElement["__forms__"];
|
|
9669
|
-
__forms__.forEach((formConfig) => {
|
|
9672
|
+
let $containerHeaderTitle = document.createElement("li");
|
|
9673
|
+
Reflect.set($containerHeaderTitle, "__asideConfig__", asideConfig);
|
|
9674
|
+
PopsSafeUtils.setSafeHTML($containerHeaderTitle, headerTitleText);
|
|
9675
|
+
this.sectionContainerHeaderULElement.appendChild($containerHeaderTitle);
|
|
9676
|
+
}
|
|
9677
|
+
rightContainerFormConfig.forEach((formConfig) => {
|
|
9670
9678
|
this.createSectionContainerItem_forms(formConfig);
|
|
9671
9679
|
});
|
|
9672
9680
|
if (typeof asideConfig.callback === "function") {
|
|
9673
9681
|
/* 执行回调 */
|
|
9674
9682
|
asideConfig.callback(event, this.sectionContainerHeaderULElement, this.sectionContainerULElement);
|
|
9675
9683
|
}
|
|
9684
|
+
that.triggerRenderRightContainer(that.$el.$contentSectionContainer);
|
|
9676
9685
|
});
|
|
9677
9686
|
},
|
|
9678
9687
|
};
|
|
@@ -9769,6 +9778,7 @@
|
|
|
9769
9778
|
panelHandleContentDetails.init({
|
|
9770
9779
|
config: config,
|
|
9771
9780
|
$el: {
|
|
9781
|
+
$pops: $pops,
|
|
9772
9782
|
$content: $content,
|
|
9773
9783
|
$contentAside: $contentAside,
|
|
9774
9784
|
$contentSectionContainer: $contentSectionContainer,
|
|
@@ -9793,7 +9803,15 @@
|
|
|
9793
9803
|
});
|
|
9794
9804
|
}
|
|
9795
9805
|
let result = PopsHandler.handleResultDetails(eventDetails);
|
|
9796
|
-
return
|
|
9806
|
+
return {
|
|
9807
|
+
...result,
|
|
9808
|
+
addEventListener: (event, listener, options) => {
|
|
9809
|
+
$pops.addEventListener(event, listener, options);
|
|
9810
|
+
},
|
|
9811
|
+
removeEventListener: (event, listener, options) => {
|
|
9812
|
+
$pops.removeEventListener(event, listener, options);
|
|
9813
|
+
},
|
|
9814
|
+
};
|
|
9797
9815
|
},
|
|
9798
9816
|
};
|
|
9799
9817
|
|
|
@@ -11037,7 +11055,7 @@
|
|
|
11037
11055
|
/** 配置 */
|
|
11038
11056
|
config = {
|
|
11039
11057
|
/** 版本号 */
|
|
11040
|
-
version: "2025.6.
|
|
11058
|
+
version: "2025.6.25",
|
|
11041
11059
|
cssText: PopsCSS,
|
|
11042
11060
|
/** icon图标的svg代码 */
|
|
11043
11061
|
iconSVG: PopsIcon.$data,
|