@whitesev/pops 2.1.2 → 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 +183 -165
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +183 -165
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +183 -165
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +183 -165
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +183 -165
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +183 -165
- 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/folder/index.css +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
|
@@ -14,6 +14,7 @@ import type { PopsPanelFormsDetails } from "./formsType";
|
|
|
14
14
|
import type {
|
|
15
15
|
PopsPanelContentConfig,
|
|
16
16
|
PopsPanelDetails,
|
|
17
|
+
PopsPanelEventType,
|
|
17
18
|
PopsPanelFormsTotalDetails,
|
|
18
19
|
} from "./indexType";
|
|
19
20
|
import type { PopsPanelInputDetails } from "./inputType";
|
|
@@ -45,12 +46,14 @@ export const PanelHandleContentDetails = () => {
|
|
|
45
46
|
* 元素
|
|
46
47
|
*/
|
|
47
48
|
$el: {
|
|
49
|
+
/** pops主元素 */
|
|
50
|
+
$pops: null as any as HTMLElement,
|
|
48
51
|
/** 内容 */
|
|
49
|
-
$content: null as any as
|
|
52
|
+
$content: null as any as HTMLElement,
|
|
50
53
|
/** 左侧容器 */
|
|
51
|
-
$contentAside: null as any as
|
|
54
|
+
$contentAside: null as any as HTMLElement,
|
|
52
55
|
/** 右侧容器 */
|
|
53
|
-
$contentSectionContainer: null as any as
|
|
56
|
+
$contentSectionContainer: null as any as HTMLElement,
|
|
54
57
|
},
|
|
55
58
|
/**
|
|
56
59
|
* 初始化
|
|
@@ -59,13 +62,12 @@ export const PanelHandleContentDetails = () => {
|
|
|
59
62
|
init(details: {
|
|
60
63
|
config: Required<PopsPanelDetails>;
|
|
61
64
|
$el: {
|
|
62
|
-
$
|
|
63
|
-
$
|
|
64
|
-
$
|
|
65
|
+
$pops: HTMLElement;
|
|
66
|
+
$content: HTMLElement;
|
|
67
|
+
$contentAside: HTMLElement;
|
|
68
|
+
$contentSectionContainer: HTMLElement;
|
|
65
69
|
};
|
|
66
70
|
}) {
|
|
67
|
-
// @ts-ignore
|
|
68
|
-
this.$el = null;
|
|
69
71
|
this.$el = {
|
|
70
72
|
...details.$el,
|
|
71
73
|
};
|
|
@@ -136,11 +138,15 @@ export const PanelHandleContentDetails = () => {
|
|
|
136
138
|
* 清空container容器的元素
|
|
137
139
|
*/
|
|
138
140
|
clearContainer() {
|
|
141
|
+
Reflect.deleteProperty(
|
|
142
|
+
this.$el.$contentSectionContainer,
|
|
143
|
+
"__formConfig__"
|
|
144
|
+
);
|
|
139
145
|
PopsSafeUtils.setSafeHTML(this.sectionContainerHeaderULElement, "");
|
|
140
146
|
PopsSafeUtils.setSafeHTML(this.sectionContainerULElement, "");
|
|
141
147
|
this.$el.$content
|
|
142
148
|
?.querySelectorAll("section.pops-panel-deepMenu-container")
|
|
143
|
-
.forEach((
|
|
149
|
+
.forEach(($el) => $el.remove());
|
|
144
150
|
},
|
|
145
151
|
/**
|
|
146
152
|
* 清空左侧容器已访问记录
|
|
@@ -148,8 +154,8 @@ export const PanelHandleContentDetails = () => {
|
|
|
148
154
|
clearAsideItemIsVisited() {
|
|
149
155
|
this.$el.$contentAside
|
|
150
156
|
.querySelectorAll<HTMLDivElement>(".pops-is-visited")
|
|
151
|
-
.forEach((
|
|
152
|
-
popsDOMUtils.removeClassName(
|
|
157
|
+
.forEach(($el) => {
|
|
158
|
+
popsDOMUtils.removeClassName($el, "pops-is-visited");
|
|
153
159
|
});
|
|
154
160
|
},
|
|
155
161
|
/**
|
|
@@ -227,35 +233,34 @@ export const PanelHandleContentDetails = () => {
|
|
|
227
233
|
* @param asideConfig
|
|
228
234
|
*/
|
|
229
235
|
createAsideItem(asideConfig: PopsPanelContentConfig) {
|
|
230
|
-
let
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
PopsSafeUtils.setSafeHTML(liElement, asideConfig.title);
|
|
236
|
+
let $li = document.createElement("li");
|
|
237
|
+
$li.id = asideConfig.id;
|
|
238
|
+
Reflect.set($li, "__forms__", asideConfig.forms);
|
|
239
|
+
PopsSafeUtils.setSafeHTML($li, asideConfig.title);
|
|
235
240
|
/* 处理className */
|
|
236
|
-
this.setElementClassName(
|
|
237
|
-
this.setElementAttributes(
|
|
238
|
-
this.setElementProps(
|
|
239
|
-
return
|
|
241
|
+
this.setElementClassName($li, asideConfig.className);
|
|
242
|
+
this.setElementAttributes($li, asideConfig.attributes);
|
|
243
|
+
this.setElementProps($li, asideConfig.props);
|
|
244
|
+
return $li;
|
|
240
245
|
},
|
|
241
246
|
/**
|
|
242
|
-
* 创建中间容器的元素<li>
|
|
243
247
|
* type ==> switch
|
|
248
|
+
* 创建中间容器的元素<li>
|
|
244
249
|
* @param formConfig
|
|
245
250
|
*/
|
|
246
251
|
createSectionContainerItem_switch(formConfig: PopsPanelSwitchDetails) {
|
|
247
|
-
let
|
|
248
|
-
(
|
|
249
|
-
this.setElementClassName(
|
|
250
|
-
this.setElementAttributes(
|
|
251
|
-
this.setElementProps(
|
|
252
|
+
let $li = document.createElement("li");
|
|
253
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
254
|
+
this.setElementClassName($li, formConfig.className);
|
|
255
|
+
this.setElementAttributes($li, formConfig.attributes);
|
|
256
|
+
this.setElementProps($li, formConfig.props);
|
|
252
257
|
/* 左边底部的描述的文字 */
|
|
253
258
|
let leftDescriptionText = "";
|
|
254
259
|
if (Boolean(formConfig.description)) {
|
|
255
260
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
256
261
|
}
|
|
257
262
|
PopsSafeUtils.setSafeHTML(
|
|
258
|
-
|
|
263
|
+
$li,
|
|
259
264
|
/*html*/ `
|
|
260
265
|
<div class="pops-panel-item-left-text">
|
|
261
266
|
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>${leftDescriptionText}</div>
|
|
@@ -273,14 +278,11 @@ export const PanelHandleContentDetails = () => {
|
|
|
273
278
|
value: Boolean(formConfig.getValue()),
|
|
274
279
|
},
|
|
275
280
|
$ele: {
|
|
276
|
-
switch:
|
|
277
|
-
|
|
278
|
-
input: liElement.querySelector<HTMLInputElement>(
|
|
281
|
+
switch: $li.querySelector<HTMLDivElement>(".pops-panel-switch")!,
|
|
282
|
+
input: $li.querySelector<HTMLInputElement>(
|
|
279
283
|
".pops-panel-switch__input"
|
|
280
284
|
)!,
|
|
281
|
-
core:
|
|
282
|
-
".pops-panel-switch__core"
|
|
283
|
-
)!,
|
|
285
|
+
core: $li.querySelector<HTMLSpanElement>(".pops-panel-switch__core")!,
|
|
284
286
|
},
|
|
285
287
|
init() {
|
|
286
288
|
this.setStatus(this.$data.value);
|
|
@@ -355,27 +357,27 @@ export const PanelHandleContentDetails = () => {
|
|
|
355
357
|
};
|
|
356
358
|
|
|
357
359
|
PopsPanelSwitch.init();
|
|
358
|
-
(
|
|
359
|
-
return
|
|
360
|
+
Reflect.set($li, "data-switch", PopsPanelSwitch);
|
|
361
|
+
return $li;
|
|
360
362
|
},
|
|
361
363
|
/**
|
|
362
|
-
* 获取中间容器的元素<li>
|
|
363
364
|
* type ==> slider
|
|
365
|
+
* 获取中间容器的元素<li>
|
|
364
366
|
* @param formConfig
|
|
365
367
|
*/
|
|
366
368
|
createSectionContainerItem_slider(formConfig: PopsPanelSliderDetails) {
|
|
367
|
-
let
|
|
368
|
-
(
|
|
369
|
-
this.setElementClassName(
|
|
370
|
-
this.setElementAttributes(
|
|
371
|
-
this.setElementProps(
|
|
369
|
+
let $li = document.createElement("li");
|
|
370
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
371
|
+
this.setElementClassName($li, formConfig.className);
|
|
372
|
+
this.setElementAttributes($li, formConfig.attributes);
|
|
373
|
+
this.setElementProps($li, formConfig.props);
|
|
372
374
|
/* 左边底部的描述的文字 */
|
|
373
375
|
let leftDescriptionText = "";
|
|
374
376
|
if (Boolean(formConfig.description)) {
|
|
375
377
|
leftDescriptionText = `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
376
378
|
}
|
|
377
379
|
PopsSafeUtils.setSafeHTML(
|
|
378
|
-
|
|
380
|
+
$li,
|
|
379
381
|
/*html*/ `
|
|
380
382
|
<div class="pops-panel-item-left-text">
|
|
381
383
|
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>${leftDescriptionText}</div>
|
|
@@ -384,13 +386,13 @@ export const PanelHandleContentDetails = () => {
|
|
|
384
386
|
</div>
|
|
385
387
|
`
|
|
386
388
|
);
|
|
387
|
-
let
|
|
389
|
+
let $rangeInput = $li.querySelector<HTMLInputElement>(
|
|
388
390
|
".pops-panel-slider input[type=range]"
|
|
389
391
|
)!;
|
|
390
392
|
if (formConfig.step) {
|
|
391
|
-
|
|
393
|
+
$rangeInput.setAttribute("step", formConfig.step.toString());
|
|
392
394
|
}
|
|
393
|
-
|
|
395
|
+
$rangeInput.value = formConfig.getValue().toString();
|
|
394
396
|
/**
|
|
395
397
|
* 获取提示的内容
|
|
396
398
|
* @param value
|
|
@@ -403,9 +405,9 @@ export const PanelHandleContentDetails = () => {
|
|
|
403
405
|
}
|
|
404
406
|
};
|
|
405
407
|
let tooltip = PopsTooltip.init({
|
|
406
|
-
target:
|
|
408
|
+
target: $rangeInput.parentElement!,
|
|
407
409
|
content: () => {
|
|
408
|
-
return getToolTipContent(
|
|
410
|
+
return getToolTipContent($rangeInput.value);
|
|
409
411
|
},
|
|
410
412
|
zIndex: () => {
|
|
411
413
|
return PopsInstanceUtils.getPopsMaxZIndex().zIndex;
|
|
@@ -416,43 +418,37 @@ export const PanelHandleContentDetails = () => {
|
|
|
416
418
|
position: "top",
|
|
417
419
|
arrowDistance: 10,
|
|
418
420
|
});
|
|
419
|
-
popsDOMUtils.on(
|
|
420
|
-
|
|
421
|
+
popsDOMUtils.on<InputEvent>(
|
|
422
|
+
$rangeInput,
|
|
421
423
|
["input", "propertychange"],
|
|
422
424
|
void 0,
|
|
423
425
|
function (event) {
|
|
424
|
-
tooltip.toolTip.changeContent(
|
|
425
|
-
getToolTipContent(rangeInputElement.value)
|
|
426
|
-
);
|
|
426
|
+
tooltip.toolTip.changeContent(getToolTipContent($rangeInput.value));
|
|
427
427
|
if (typeof formConfig.callback === "function") {
|
|
428
|
-
formConfig.callback(
|
|
429
|
-
event as InputEvent,
|
|
430
|
-
(event as any).target.value
|
|
431
|
-
);
|
|
428
|
+
formConfig.callback(event, $rangeInput.valueAsNumber);
|
|
432
429
|
}
|
|
433
430
|
}
|
|
434
431
|
);
|
|
435
|
-
return
|
|
432
|
+
return $li;
|
|
436
433
|
},
|
|
437
434
|
/**
|
|
438
|
-
* 获取中间容器的元素<li>
|
|
439
435
|
* type ==> slider
|
|
436
|
+
* 获取中间容器的元素<li>
|
|
440
437
|
* @param formConfig
|
|
441
438
|
*/
|
|
442
439
|
createSectionContainerItem_slider_new(formConfig: PopsPanelSliderDetails) {
|
|
443
|
-
let
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
this.
|
|
447
|
-
this.
|
|
448
|
-
this.setElementProps(liElement, formConfig.props);
|
|
440
|
+
let $li = document.createElement("li");
|
|
441
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
442
|
+
this.setElementClassName($li, formConfig.className);
|
|
443
|
+
this.setElementAttributes($li, formConfig.attributes);
|
|
444
|
+
this.setElementProps($li, formConfig.props);
|
|
449
445
|
/* 左边底部的描述的文字 */
|
|
450
446
|
let leftDescriptionText = "";
|
|
451
447
|
if (Boolean(formConfig.description)) {
|
|
452
448
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
453
449
|
}
|
|
454
450
|
PopsSafeUtils.setSafeHTML(
|
|
455
|
-
|
|
451
|
+
$li,
|
|
456
452
|
/*html*/ `
|
|
457
453
|
<div class="pops-panel-item-left-text" style="flex: 1;">
|
|
458
454
|
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>${leftDescriptionText}</div>
|
|
@@ -537,15 +533,13 @@ export const PanelHandleContentDetails = () => {
|
|
|
537
533
|
tooltip: null as any as ReturnType<typeof PopsTooltip.init>,
|
|
538
534
|
},
|
|
539
535
|
$ele: {
|
|
540
|
-
slider:
|
|
541
|
-
runAway:
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
bar: liElement.querySelector<HTMLElement>(".pops-slider__bar")!,
|
|
545
|
-
buttonWrapper: liElement.querySelector<HTMLElement>(
|
|
536
|
+
slider: $li.querySelector<HTMLElement>(".pops-slider")!,
|
|
537
|
+
runAway: $li.querySelector<HTMLElement>(".pops-slider__runway")!,
|
|
538
|
+
bar: $li.querySelector<HTMLElement>(".pops-slider__bar")!,
|
|
539
|
+
buttonWrapper: $li.querySelector<HTMLElement>(
|
|
546
540
|
".pops-slider__button-wrapper"
|
|
547
541
|
)!,
|
|
548
|
-
button:
|
|
542
|
+
button: $li.querySelector<HTMLElement>(".pops-slider__button")!,
|
|
549
543
|
},
|
|
550
544
|
$interval: {
|
|
551
545
|
isCheck: false,
|
|
@@ -611,14 +605,10 @@ export const PanelHandleContentDetails = () => {
|
|
|
611
605
|
this.$ele.slider.setAttribute("data-max", this.max.toString());
|
|
612
606
|
this.$ele.slider.setAttribute("data-value", this.value.toString());
|
|
613
607
|
this.$ele.slider.setAttribute("data-step", this.step.toString());
|
|
614
|
-
|
|
615
|
-
this.$ele.slider
|
|
616
|
-
|
|
617
|
-
this.$ele.slider
|
|
618
|
-
// @ts-ignore
|
|
619
|
-
this.$ele.slider["data-value"] = this.value;
|
|
620
|
-
// @ts-ignore
|
|
621
|
-
this.$ele.slider["data-step"] = this.step;
|
|
608
|
+
Reflect.set(this.$ele.slider, "data-min", this.min);
|
|
609
|
+
Reflect.set(this.$ele.slider, "data-max", this.max);
|
|
610
|
+
Reflect.set(this.$ele.slider, "data-value", this.value);
|
|
611
|
+
Reflect.set(this.$ele.slider, "data-step", this.step);
|
|
622
612
|
},
|
|
623
613
|
/**
|
|
624
614
|
* 初始化滑块的总长度的数据(px)
|
|
@@ -642,7 +632,7 @@ export const PanelHandleContentDetails = () => {
|
|
|
642
632
|
stepValue += this.step
|
|
643
633
|
) {
|
|
644
634
|
let value = this.formatValue(stepValue);
|
|
645
|
-
let info
|
|
635
|
+
let info;
|
|
646
636
|
if (value === this.min) {
|
|
647
637
|
/* 起始 */
|
|
648
638
|
info = {
|
|
@@ -667,7 +657,7 @@ export const PanelHandleContentDetails = () => {
|
|
|
667
657
|
// info["pxRight"] = this.$data.totalWidth;
|
|
668
658
|
//}
|
|
669
659
|
}
|
|
670
|
-
this.$data.stepBlockMap.set(index, info
|
|
660
|
+
this.$data.stepBlockMap.set(index, info);
|
|
671
661
|
index++;
|
|
672
662
|
widthPx += this.$data.stepPx;
|
|
673
663
|
}
|
|
@@ -688,7 +678,7 @@ export const PanelHandleContentDetails = () => {
|
|
|
688
678
|
stepValue = PopsMathFloatUtils.add(stepValue, this.step)
|
|
689
679
|
) {
|
|
690
680
|
let value = this.formatValue(stepValue);
|
|
691
|
-
let info
|
|
681
|
+
let info;
|
|
692
682
|
if (value === this.min) {
|
|
693
683
|
/* 起始 */
|
|
694
684
|
info = {
|
|
@@ -713,7 +703,7 @@ export const PanelHandleContentDetails = () => {
|
|
|
713
703
|
// info["pxRight"] = this.$data.totalWidth;
|
|
714
704
|
//}
|
|
715
705
|
}
|
|
716
|
-
this.$data.stepBlockMap.set(index, info
|
|
706
|
+
this.$data.stepBlockMap.set(index, info);
|
|
717
707
|
index++;
|
|
718
708
|
widthPx += this.$data.stepPx;
|
|
719
709
|
}
|
|
@@ -845,7 +835,7 @@ export const PanelHandleContentDetails = () => {
|
|
|
845
835
|
* 设置进度条点击定位的事件
|
|
846
836
|
*/
|
|
847
837
|
setRunAwayClickEvent() {
|
|
848
|
-
popsDOMUtils.on(
|
|
838
|
+
popsDOMUtils.on<PointerEvent | MouseEvent>(
|
|
849
839
|
this.$ele.runAway,
|
|
850
840
|
"click",
|
|
851
841
|
void 0,
|
|
@@ -856,7 +846,7 @@ export const PanelHandleContentDetails = () => {
|
|
|
856
846
|
) {
|
|
857
847
|
return;
|
|
858
848
|
}
|
|
859
|
-
let clickX = parseFloat(
|
|
849
|
+
let clickX = parseFloat(event.offsetX.toString());
|
|
860
850
|
this.dragStartCallBack();
|
|
861
851
|
this.dragMoveCallBack(event, clickX, this.value);
|
|
862
852
|
this.dragEndCallBack(clickX);
|
|
@@ -1005,7 +995,7 @@ export const PanelHandleContentDetails = () => {
|
|
|
1005
995
|
if (typeof formConfig.getToolTipContent === "function") {
|
|
1006
996
|
return formConfig.getToolTipContent(PopsPanelSlider.value);
|
|
1007
997
|
} else {
|
|
1008
|
-
return PopsPanelSlider.value
|
|
998
|
+
return PopsPanelSlider.value.toString();
|
|
1009
999
|
}
|
|
1010
1000
|
}
|
|
1011
1001
|
|
|
@@ -1052,20 +1042,20 @@ export const PanelHandleContentDetails = () => {
|
|
|
1052
1042
|
},
|
|
1053
1043
|
};
|
|
1054
1044
|
PopsPanelSlider.init();
|
|
1055
|
-
(
|
|
1056
|
-
return
|
|
1045
|
+
Reflect.set($li, "data-slider", PopsPanelSlider);
|
|
1046
|
+
return $li;
|
|
1057
1047
|
},
|
|
1058
1048
|
/**
|
|
1059
|
-
* 获取中间容器的元素<li>
|
|
1060
1049
|
* type ==> input
|
|
1050
|
+
* 获取中间容器的元素<li>
|
|
1061
1051
|
* @param formConfig
|
|
1062
1052
|
*/
|
|
1063
1053
|
createSectionContainerItem_input(formConfig: PopsPanelInputDetails) {
|
|
1064
|
-
let
|
|
1065
|
-
(
|
|
1066
|
-
this.setElementClassName(
|
|
1067
|
-
this.setElementAttributes(
|
|
1068
|
-
this.setElementProps(
|
|
1054
|
+
let $li = document.createElement("li");
|
|
1055
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
1056
|
+
this.setElementClassName($li, formConfig.className);
|
|
1057
|
+
this.setElementAttributes($li, formConfig.attributes);
|
|
1058
|
+
this.setElementProps($li, formConfig.props);
|
|
1069
1059
|
let inputType = "text";
|
|
1070
1060
|
if (formConfig.isPassword) {
|
|
1071
1061
|
inputType = "password";
|
|
@@ -1078,7 +1068,7 @@ export const PanelHandleContentDetails = () => {
|
|
|
1078
1068
|
leftDescriptionText = `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
1079
1069
|
}
|
|
1080
1070
|
PopsSafeUtils.setSafeHTML(
|
|
1081
|
-
|
|
1071
|
+
$li,
|
|
1082
1072
|
/*html*/ `
|
|
1083
1073
|
<div class="pops-panel-item-left-text">
|
|
1084
1074
|
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>${leftDescriptionText}</div>
|
|
@@ -1090,9 +1080,8 @@ export const PanelHandleContentDetails = () => {
|
|
|
1090
1080
|
const PopsPanelInput = {
|
|
1091
1081
|
[Symbol.toStringTag]: "PopsPanelInput",
|
|
1092
1082
|
$ele: {
|
|
1093
|
-
panelInput:
|
|
1094
|
-
|
|
1095
|
-
input: liElement.querySelector<HTMLInputElement>("input")!,
|
|
1083
|
+
panelInput: $li.querySelector<HTMLDivElement>(".pops-panel-input")!,
|
|
1084
|
+
input: $li.querySelector<HTMLInputElement>("input")!,
|
|
1096
1085
|
inputSpanIcon: document.createElement("span"),
|
|
1097
1086
|
inputSpanIconInner: null as any as HTMLSpanElement,
|
|
1098
1087
|
icon: null as any as HTMLElement,
|
|
@@ -1121,7 +1110,7 @@ export const PanelHandleContentDetails = () => {
|
|
|
1121
1110
|
this.disable();
|
|
1122
1111
|
}
|
|
1123
1112
|
if (typeof formConfig.handlerCallBack === "function") {
|
|
1124
|
-
formConfig.handlerCallBack(
|
|
1113
|
+
formConfig.handlerCallBack($li, this.$ele.input);
|
|
1125
1114
|
}
|
|
1126
1115
|
},
|
|
1127
1116
|
/**
|
|
@@ -1237,7 +1226,7 @@ export const PanelHandleContentDetails = () => {
|
|
|
1237
1226
|
* 监听输入框内容改变
|
|
1238
1227
|
*/
|
|
1239
1228
|
setInputChangeEvent() {
|
|
1240
|
-
popsDOMUtils.on(
|
|
1229
|
+
popsDOMUtils.on<InputEvent>(
|
|
1241
1230
|
this.$ele.input,
|
|
1242
1231
|
["input", "propertychange"],
|
|
1243
1232
|
void 0,
|
|
@@ -1259,12 +1248,12 @@ export const PanelHandleContentDetails = () => {
|
|
|
1259
1248
|
if (typeof formConfig.callback === "function") {
|
|
1260
1249
|
if (formConfig.isNumber) {
|
|
1261
1250
|
formConfig.callback(
|
|
1262
|
-
event
|
|
1251
|
+
event,
|
|
1263
1252
|
this.$ele.input.value,
|
|
1264
1253
|
this.$ele.input.valueAsNumber
|
|
1265
1254
|
);
|
|
1266
1255
|
} else {
|
|
1267
|
-
formConfig.callback(event
|
|
1256
|
+
formConfig.callback(event, this.$ele.input.value);
|
|
1268
1257
|
}
|
|
1269
1258
|
}
|
|
1270
1259
|
}
|
|
@@ -1272,20 +1261,20 @@ export const PanelHandleContentDetails = () => {
|
|
|
1272
1261
|
},
|
|
1273
1262
|
};
|
|
1274
1263
|
PopsPanelInput.init();
|
|
1275
|
-
(
|
|
1276
|
-
return
|
|
1264
|
+
Reflect.set($li, "data-input", PopsPanelInput);
|
|
1265
|
+
return $li;
|
|
1277
1266
|
},
|
|
1278
1267
|
/**
|
|
1279
|
-
* 获取中间容器的元素<li>
|
|
1280
1268
|
* type ==> textarea
|
|
1269
|
+
* 获取中间容器的元素<li>
|
|
1281
1270
|
* @param formConfig
|
|
1282
1271
|
*/
|
|
1283
1272
|
createSectionContainerItem_textarea(formConfig: PopsPanelTextAreaDetails) {
|
|
1284
|
-
let
|
|
1285
|
-
(
|
|
1286
|
-
this.setElementClassName(
|
|
1287
|
-
this.setElementAttributes(
|
|
1288
|
-
this.setElementProps(
|
|
1273
|
+
let $li = document.createElement("li");
|
|
1274
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
1275
|
+
this.setElementClassName($li, formConfig.className);
|
|
1276
|
+
this.setElementAttributes($li, formConfig.attributes);
|
|
1277
|
+
this.setElementProps($li, formConfig.props);
|
|
1289
1278
|
|
|
1290
1279
|
/* 左边底部的描述的文字 */
|
|
1291
1280
|
let leftDescriptionText = "";
|
|
@@ -1293,7 +1282,7 @@ export const PanelHandleContentDetails = () => {
|
|
|
1293
1282
|
leftDescriptionText = `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
1294
1283
|
}
|
|
1295
1284
|
PopsSafeUtils.setSafeHTML(
|
|
1296
|
-
|
|
1285
|
+
$li,
|
|
1297
1286
|
/*html*/ `
|
|
1298
1287
|
<div class="pops-panel-item-left-text">
|
|
1299
1288
|
<p class="pops-panel-item-left-main-text">${
|
|
@@ -1308,10 +1297,10 @@ export const PanelHandleContentDetails = () => {
|
|
|
1308
1297
|
const PopsPanelTextArea = {
|
|
1309
1298
|
[Symbol.toStringTag]: "PopsPanelTextArea",
|
|
1310
1299
|
$ele: {
|
|
1311
|
-
panelTextarea:
|
|
1300
|
+
panelTextarea: $li.querySelector<HTMLDivElement>(
|
|
1312
1301
|
".pops-panel-textarea"
|
|
1313
1302
|
)!,
|
|
1314
|
-
textarea:
|
|
1303
|
+
textarea: $li.querySelector<HTMLTextAreaElement>(
|
|
1315
1304
|
".pops-panel-textarea textarea"
|
|
1316
1305
|
)!,
|
|
1317
1306
|
},
|
|
@@ -1350,14 +1339,20 @@ export const PanelHandleContentDetails = () => {
|
|
|
1350
1339
|
* 监听选择内容改变
|
|
1351
1340
|
*/
|
|
1352
1341
|
setChangeEvent() {
|
|
1353
|
-
popsDOMUtils.on(
|
|
1342
|
+
popsDOMUtils.on<InputEvent>(
|
|
1354
1343
|
this.$ele.textarea,
|
|
1355
1344
|
["input", "propertychange"],
|
|
1356
1345
|
void 0,
|
|
1357
1346
|
(event) => {
|
|
1358
|
-
|
|
1347
|
+
let value = this.$ele.textarea.value;
|
|
1348
|
+
this.$data.value = value;
|
|
1359
1349
|
if (typeof formConfig.callback === "function") {
|
|
1360
|
-
formConfig.callback(
|
|
1350
|
+
formConfig.callback(
|
|
1351
|
+
event as InputEvent & {
|
|
1352
|
+
target: HTMLTextAreaElement;
|
|
1353
|
+
},
|
|
1354
|
+
value
|
|
1355
|
+
);
|
|
1361
1356
|
}
|
|
1362
1357
|
}
|
|
1363
1358
|
);
|
|
@@ -1365,29 +1360,29 @@ export const PanelHandleContentDetails = () => {
|
|
|
1365
1360
|
};
|
|
1366
1361
|
|
|
1367
1362
|
PopsPanelTextArea.init();
|
|
1368
|
-
(
|
|
1363
|
+
Reflect.set($li, "data-textarea", PopsPanelTextArea);
|
|
1369
1364
|
|
|
1370
|
-
return
|
|
1365
|
+
return $li;
|
|
1371
1366
|
},
|
|
1372
1367
|
/**
|
|
1373
|
-
* 获取中间容器的元素<li>
|
|
1374
1368
|
* type ==> select
|
|
1369
|
+
* 获取中间容器的元素<li>
|
|
1375
1370
|
* @param formConfig
|
|
1376
1371
|
*/
|
|
1377
1372
|
createSectionContainerItem_select(formConfig: PopsPanelSelectDetails<any>) {
|
|
1378
1373
|
const that = this;
|
|
1379
|
-
let
|
|
1380
|
-
(
|
|
1381
|
-
this.setElementClassName(
|
|
1382
|
-
this.setElementAttributes(
|
|
1383
|
-
this.setElementProps(
|
|
1374
|
+
let $li = document.createElement("li");
|
|
1375
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
1376
|
+
this.setElementClassName($li, formConfig.className);
|
|
1377
|
+
this.setElementAttributes($li, formConfig.attributes);
|
|
1378
|
+
this.setElementProps($li, formConfig.props);
|
|
1384
1379
|
/* 左边底部的描述的文字 */
|
|
1385
1380
|
let leftDescriptionText = "";
|
|
1386
1381
|
if (Boolean(formConfig.description)) {
|
|
1387
1382
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
1388
1383
|
}
|
|
1389
1384
|
PopsSafeUtils.setSafeHTML(
|
|
1390
|
-
|
|
1385
|
+
$li,
|
|
1391
1386
|
/*html*/ `
|
|
1392
1387
|
<div class="pops-panel-item-left-text">
|
|
1393
1388
|
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>${leftDescriptionText}</div>
|
|
@@ -1400,9 +1395,8 @@ export const PanelHandleContentDetails = () => {
|
|
|
1400
1395
|
const PopsPanelSelect = {
|
|
1401
1396
|
[Symbol.toStringTag]: "PopsPanelSelect",
|
|
1402
1397
|
$ele: {
|
|
1403
|
-
panelSelect:
|
|
1404
|
-
|
|
1405
|
-
select: liElement.querySelector<HTMLSelectElement>(
|
|
1398
|
+
panelSelect: $li.querySelector<HTMLDivElement>(".pops-panel-select")!,
|
|
1399
|
+
select: $li.querySelector<HTMLSelectElement>(
|
|
1406
1400
|
".pops-panel-select select"
|
|
1407
1401
|
)!,
|
|
1408
1402
|
},
|
|
@@ -1544,46 +1538,47 @@ export const PanelHandleContentDetails = () => {
|
|
|
1544
1538
|
* 监听选择内容改变
|
|
1545
1539
|
*/
|
|
1546
1540
|
setChangeEvent() {
|
|
1547
|
-
popsDOMUtils.on
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1541
|
+
popsDOMUtils.on<PointerEvent | TouchEvent>(
|
|
1542
|
+
this.$ele.select,
|
|
1543
|
+
"change",
|
|
1544
|
+
void 0,
|
|
1545
|
+
(event) => {
|
|
1546
|
+
let $isSelectedElement = this.$ele.select[
|
|
1547
|
+
this.$ele.select.selectedIndex
|
|
1548
|
+
] as HTMLOptionElement;
|
|
1549
|
+
let selectInfo = this.getSelectOptionInfo($isSelectedElement);
|
|
1550
|
+
this.setSelectOptionsDisableStatus();
|
|
1551
|
+
if (typeof formConfig.callback === "function") {
|
|
1552
|
+
formConfig.callback(event, selectInfo.value, selectInfo.text);
|
|
1553
|
+
}
|
|
1554
|
+
let forms =
|
|
1555
|
+
typeof selectInfo.forms === "function"
|
|
1556
|
+
? selectInfo.forms()
|
|
1557
|
+
: selectInfo.forms;
|
|
1558
|
+
if (Array.isArray(forms)) {
|
|
1559
|
+
/* 如果成功创建,加入到中间容器中 */
|
|
1560
|
+
let childUListClassName = "pops-panel-select-child-forms";
|
|
1561
|
+
// 移除旧的元素
|
|
1562
|
+
while ($li.nextElementSibling) {
|
|
1563
|
+
if (
|
|
1564
|
+
$li.nextElementSibling.classList.contains(
|
|
1565
|
+
childUListClassName
|
|
1566
|
+
)
|
|
1567
|
+
) {
|
|
1568
|
+
$li.nextElementSibling.remove();
|
|
1569
|
+
} else {
|
|
1570
|
+
break;
|
|
1571
|
+
}
|
|
1577
1572
|
}
|
|
1573
|
+
let $childUList = document.createElement("ul");
|
|
1574
|
+
$childUList.className = childUListClassName;
|
|
1575
|
+
popsDOMUtils.after($li, $childUList);
|
|
1576
|
+
that.uListContainerAddItem(formConfig, {
|
|
1577
|
+
ulElement: $childUList,
|
|
1578
|
+
});
|
|
1578
1579
|
}
|
|
1579
|
-
let $childUList = document.createElement("ul");
|
|
1580
|
-
$childUList.className = childUListClassName;
|
|
1581
|
-
popsDOMUtils.after(liElement, $childUList);
|
|
1582
|
-
that.uListContainerAddItem(formConfig as any, {
|
|
1583
|
-
ulElement: $childUList,
|
|
1584
|
-
});
|
|
1585
1580
|
}
|
|
1586
|
-
|
|
1581
|
+
);
|
|
1587
1582
|
},
|
|
1588
1583
|
/**
|
|
1589
1584
|
* 监听点击事件
|
|
@@ -1599,29 +1594,29 @@ export const PanelHandleContentDetails = () => {
|
|
|
1599
1594
|
};
|
|
1600
1595
|
|
|
1601
1596
|
PopsPanelSelect.init();
|
|
1602
|
-
Reflect.set(
|
|
1603
|
-
return
|
|
1597
|
+
Reflect.set($li, "data-select", PopsPanelSelect);
|
|
1598
|
+
return $li;
|
|
1604
1599
|
},
|
|
1605
1600
|
/**
|
|
1606
|
-
* 获取中间容器的元素<li>
|
|
1607
1601
|
* type ==> select-multiple
|
|
1602
|
+
* 获取中间容器的元素<li>
|
|
1608
1603
|
* @param formConfig
|
|
1609
1604
|
*/
|
|
1610
1605
|
createSectionContainerItem_select_multiple_new(
|
|
1611
1606
|
formConfig: PopsPanelSelectMultipleDetails<any>
|
|
1612
1607
|
) {
|
|
1613
|
-
let
|
|
1614
|
-
Reflect.set(
|
|
1615
|
-
this.setElementClassName(
|
|
1616
|
-
this.setElementAttributes(
|
|
1617
|
-
this.setElementProps(
|
|
1608
|
+
let $li = document.createElement("li");
|
|
1609
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
1610
|
+
this.setElementClassName($li, formConfig.className);
|
|
1611
|
+
this.setElementAttributes($li, formConfig.attributes);
|
|
1612
|
+
this.setElementProps($li, formConfig.props);
|
|
1618
1613
|
/* 左边底部的描述的文字 */
|
|
1619
1614
|
let leftDescriptionText = "";
|
|
1620
1615
|
if (Boolean(formConfig.description)) {
|
|
1621
1616
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
1622
1617
|
}
|
|
1623
1618
|
PopsSafeUtils.setSafeHTML(
|
|
1624
|
-
|
|
1619
|
+
$li,
|
|
1625
1620
|
/*html*/ `
|
|
1626
1621
|
<div class="pops-panel-item-left-text">
|
|
1627
1622
|
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>${leftDescriptionText}</div>
|
|
@@ -1697,25 +1692,24 @@ export const PanelHandleContentDetails = () => {
|
|
|
1697
1692
|
},
|
|
1698
1693
|
/** 初始化$el变量 */
|
|
1699
1694
|
inintEl() {
|
|
1700
|
-
this.$el.$container =
|
|
1695
|
+
this.$el.$container = $li.querySelector<HTMLElement>(
|
|
1701
1696
|
".pops-panel-select-multiple"
|
|
1702
1697
|
)!;
|
|
1703
|
-
this.$el.$wrapper =
|
|
1698
|
+
this.$el.$wrapper = $li.querySelector<HTMLElement>(
|
|
1704
1699
|
".el-select__wrapper"
|
|
1705
1700
|
)!;
|
|
1706
|
-
this.$el.$section =
|
|
1701
|
+
this.$el.$section = $li.querySelector<HTMLElement>(
|
|
1707
1702
|
".el-select__selection"
|
|
1708
1703
|
)!;
|
|
1709
|
-
this.$el.$selectedInputWrapper =
|
|
1704
|
+
this.$el.$selectedInputWrapper = $li.querySelector<HTMLElement>(
|
|
1710
1705
|
".el-select__selected-item.el-select__input-wrapper"
|
|
1711
1706
|
)!;
|
|
1712
|
-
this.$el.$selectedPlaceHolderWrapper =
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
)!;
|
|
1707
|
+
this.$el.$selectedPlaceHolderWrapper = $li.querySelector<HTMLElement>(
|
|
1708
|
+
".el-select__selected-item.el-select__placeholder"
|
|
1709
|
+
)!;
|
|
1716
1710
|
this.$el.$suffix =
|
|
1717
|
-
|
|
1718
|
-
this.$el.$suffixIcon =
|
|
1711
|
+
$li.querySelector<HTMLElement>(".el-select__suffix")!;
|
|
1712
|
+
this.$el.$suffixIcon = $li.querySelector<HTMLElement>(
|
|
1719
1713
|
".el-select__suffix .el-icon"
|
|
1720
1714
|
)!;
|
|
1721
1715
|
|
|
@@ -2341,20 +2335,20 @@ export const PanelHandleContentDetails = () => {
|
|
|
2341
2335
|
};
|
|
2342
2336
|
|
|
2343
2337
|
PopsPanelSelectMultiple.init();
|
|
2344
|
-
Reflect.set(
|
|
2345
|
-
return
|
|
2338
|
+
Reflect.set($li, "data-select-multiple", PopsPanelSelectMultiple);
|
|
2339
|
+
return $li;
|
|
2346
2340
|
},
|
|
2347
2341
|
/**
|
|
2348
|
-
* 获取中间容器的元素<li>
|
|
2349
2342
|
* type ==> button
|
|
2343
|
+
* 获取中间容器的元素<li>
|
|
2350
2344
|
* @param formConfig
|
|
2351
2345
|
*/
|
|
2352
2346
|
createSectionContainerItem_button(formConfig: PopsPanelButtonDetails) {
|
|
2353
|
-
let
|
|
2354
|
-
(
|
|
2355
|
-
this.setElementClassName(
|
|
2356
|
-
this.setElementAttributes(
|
|
2357
|
-
this.setElementProps(
|
|
2347
|
+
let $li = document.createElement("li");
|
|
2348
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
2349
|
+
this.setElementClassName($li, formConfig.className);
|
|
2350
|
+
this.setElementAttributes($li, formConfig.attributes);
|
|
2351
|
+
this.setElementProps($li, formConfig.props);
|
|
2358
2352
|
|
|
2359
2353
|
/* 左边底部的描述的文字 */
|
|
2360
2354
|
let leftDescriptionText = "";
|
|
@@ -2362,7 +2356,7 @@ export const PanelHandleContentDetails = () => {
|
|
|
2362
2356
|
leftDescriptionText = /*html*/ `<p class="pops-panel-item-left-desc-text">${formConfig.description}</p>`;
|
|
2363
2357
|
}
|
|
2364
2358
|
PopsSafeUtils.setSafeHTML(
|
|
2365
|
-
|
|
2359
|
+
$li,
|
|
2366
2360
|
/*html*/ `
|
|
2367
2361
|
<div class="pops-panel-item-left-text">
|
|
2368
2362
|
<p class="pops-panel-item-left-main-text">${formConfig.text}</p>${leftDescriptionText}</div>
|
|
@@ -2378,15 +2372,14 @@ export const PanelHandleContentDetails = () => {
|
|
|
2378
2372
|
const PopsPanelButton = {
|
|
2379
2373
|
[Symbol.toStringTag]: "PopsPanelButton",
|
|
2380
2374
|
$ele: {
|
|
2381
|
-
panelButton:
|
|
2382
|
-
|
|
2383
|
-
button: liElement.querySelector<HTMLDivElement>(
|
|
2375
|
+
panelButton: $li.querySelector<HTMLDivElement>(".pops-panel-button")!,
|
|
2376
|
+
button: $li.querySelector<HTMLDivElement>(
|
|
2384
2377
|
".pops-panel-button .pops-panel-button_inner"
|
|
2385
2378
|
)!,
|
|
2386
|
-
icon:
|
|
2379
|
+
icon: $li.querySelector<HTMLDivElement>(
|
|
2387
2380
|
".pops-panel-button .pops-bottom-icon"
|
|
2388
2381
|
)!,
|
|
2389
|
-
spanText:
|
|
2382
|
+
spanText: $li.querySelector<HTMLDivElement>(
|
|
2390
2383
|
".pops-panel-button .pops-panel-button-text"
|
|
2391
2384
|
)!,
|
|
2392
2385
|
},
|
|
@@ -2500,10 +2493,11 @@ export const PanelHandleContentDetails = () => {
|
|
|
2500
2493
|
},
|
|
2501
2494
|
};
|
|
2502
2495
|
PopsPanelButton.init();
|
|
2503
|
-
(
|
|
2504
|
-
return
|
|
2496
|
+
Reflect.set($li, "data-button", PopsPanelButton);
|
|
2497
|
+
return $li;
|
|
2505
2498
|
},
|
|
2506
2499
|
/**
|
|
2500
|
+
* type ==> deepMenu
|
|
2507
2501
|
* 获取深层容器的元素<li>
|
|
2508
2502
|
* @param formConfig
|
|
2509
2503
|
*/
|
|
@@ -2511,7 +2505,7 @@ export const PanelHandleContentDetails = () => {
|
|
|
2511
2505
|
let that = this;
|
|
2512
2506
|
let $li = document.createElement("li");
|
|
2513
2507
|
$li.classList.add("pops-panel-deepMenu-nav-item");
|
|
2514
|
-
($li
|
|
2508
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
2515
2509
|
this.setElementClassName($li, formConfig.className);
|
|
2516
2510
|
// 设置属性
|
|
2517
2511
|
this.setElementAttributes($li, formConfig.attributes);
|
|
@@ -2647,13 +2641,16 @@ export const PanelHandleContentDetails = () => {
|
|
|
2647
2641
|
if (
|
|
2648
2642
|
typeof formConfig_forms.afterAddToUListCallBack === "function"
|
|
2649
2643
|
) {
|
|
2650
|
-
formConfig_forms.afterAddToUListCallBack(
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2644
|
+
formConfig_forms.afterAddToUListCallBack(
|
|
2645
|
+
formConfig as any as PopsPanelFormsDetails,
|
|
2646
|
+
{
|
|
2647
|
+
target: formContainerListElement,
|
|
2648
|
+
ulElement: formContainerULElement,
|
|
2649
|
+
sectionContainerULElement: that.sectionContainerULElement,
|
|
2650
|
+
formContainerListElement: formContainerListElement,
|
|
2651
|
+
formHeaderDivElement: formHeaderDivElement,
|
|
2652
|
+
}
|
|
2653
|
+
);
|
|
2657
2654
|
}
|
|
2658
2655
|
} else {
|
|
2659
2656
|
/* 如果成功创建,加入到中间容器中 */
|
|
@@ -2669,9 +2666,9 @@ export const PanelHandleContentDetails = () => {
|
|
|
2669
2666
|
*/
|
|
2670
2667
|
gotoDeepMenu(event: Event, liElement: HTMLLIElement) {
|
|
2671
2668
|
/** 当前所在的容器 */
|
|
2672
|
-
let currentSection = liElement.closest(
|
|
2669
|
+
let currentSection = liElement.closest<HTMLElement>(
|
|
2673
2670
|
"section.pops-panel-container"
|
|
2674
|
-
)
|
|
2671
|
+
);
|
|
2675
2672
|
if (currentSection) {
|
|
2676
2673
|
popsDOMUtils.cssHide(currentSection, true);
|
|
2677
2674
|
}
|
|
@@ -2679,6 +2676,7 @@ export const PanelHandleContentDetails = () => {
|
|
|
2679
2676
|
let $deepMenuContainer = popsDOMUtils.createElement("section", {
|
|
2680
2677
|
className: "pops-panel-container pops-panel-deepMenu-container",
|
|
2681
2678
|
});
|
|
2679
|
+
Reflect.set($deepMenuContainer, "__formConfig__", formConfig);
|
|
2682
2680
|
let $deepMenuHeaderUL = popsDOMUtils.createElement("ul", {
|
|
2683
2681
|
className: "pops-panel-deepMenu-container-header-ul",
|
|
2684
2682
|
});
|
|
@@ -2696,14 +2694,15 @@ export const PanelHandleContentDetails = () => {
|
|
|
2696
2694
|
popsDOMUtils.on(
|
|
2697
2695
|
$headerLeftArrow,
|
|
2698
2696
|
"click",
|
|
2699
|
-
void 0,
|
|
2700
2697
|
(event) => {
|
|
2701
|
-
event
|
|
2702
|
-
event?.stopPropagation();
|
|
2698
|
+
popsDOMUtils.preventEvent(event);
|
|
2703
2699
|
// 返回上一层菜单
|
|
2704
|
-
let $prev =
|
|
2700
|
+
let $prev = <HTMLElement>(
|
|
2701
|
+
$deepMenuContainer.previousElementSibling
|
|
2702
|
+
);
|
|
2705
2703
|
popsDOMUtils.cssShow($prev);
|
|
2706
2704
|
$deepMenuContainer.remove();
|
|
2705
|
+
that.triggerRenderRightContainer($prev);
|
|
2707
2706
|
},
|
|
2708
2707
|
{
|
|
2709
2708
|
once: true,
|
|
@@ -2733,6 +2732,7 @@ export const PanelHandleContentDetails = () => {
|
|
|
2733
2732
|
sectionBodyContainer: $deepMenuBodyUL,
|
|
2734
2733
|
});
|
|
2735
2734
|
}
|
|
2735
|
+
that.triggerRenderRightContainer($deepMenuContainer);
|
|
2736
2736
|
},
|
|
2737
2737
|
/** 设置项的点击事件 */
|
|
2738
2738
|
setLiClickEvent() {
|
|
@@ -2749,23 +2749,23 @@ export const PanelHandleContentDetails = () => {
|
|
|
2749
2749
|
};
|
|
2750
2750
|
|
|
2751
2751
|
PopsPanelDeepMenu.init();
|
|
2752
|
-
($li
|
|
2752
|
+
Reflect.set($li, "data-deepMenu", PopsPanelDeepMenu);
|
|
2753
2753
|
|
|
2754
2754
|
return $li;
|
|
2755
2755
|
},
|
|
2756
2756
|
/**
|
|
2757
|
-
* 获取中间容器的元素<li>
|
|
2758
2757
|
* type ===> own
|
|
2758
|
+
* 获取中间容器的元素<li>
|
|
2759
2759
|
* @param formConfig
|
|
2760
2760
|
*/
|
|
2761
2761
|
createSectionContainerItem_own(formConfig: PopsPanelOwnDetails) {
|
|
2762
|
-
let
|
|
2763
|
-
(
|
|
2762
|
+
let $li = document.createElement("li");
|
|
2763
|
+
Reflect.set($li, "__formConfig__", formConfig);
|
|
2764
2764
|
if (formConfig.className) {
|
|
2765
|
-
|
|
2765
|
+
$li.className = formConfig.className;
|
|
2766
2766
|
}
|
|
2767
|
-
|
|
2768
|
-
return
|
|
2767
|
+
$li = formConfig.getLiElementCallBack($li);
|
|
2768
|
+
return $li;
|
|
2769
2769
|
},
|
|
2770
2770
|
/**
|
|
2771
2771
|
* 获取中间容器的元素<li>
|
|
@@ -2885,12 +2885,15 @@ export const PanelHandleContentDetails = () => {
|
|
|
2885
2885
|
);
|
|
2886
2886
|
that.setElementProps(formContainerListElement, formConfig.props);
|
|
2887
2887
|
childForms.forEach((childFormConfig) => {
|
|
2888
|
-
that.uListContainerAddItem(
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2888
|
+
that.uListContainerAddItem(
|
|
2889
|
+
childFormConfig as PopsPanelFormsTotalDetails,
|
|
2890
|
+
{
|
|
2891
|
+
ulElement: formContainerULElement,
|
|
2892
|
+
sectionContainerULElement: that.sectionContainerULElement,
|
|
2893
|
+
formContainerListElement: formContainerListElement,
|
|
2894
|
+
formHeaderDivElement: formHeaderDivElement,
|
|
2895
|
+
}
|
|
2896
|
+
);
|
|
2894
2897
|
});
|
|
2895
2898
|
formContainerListElement.appendChild(formContainerULElement);
|
|
2896
2899
|
that.sectionContainerULElement.appendChild(formContainerListElement);
|
|
@@ -2906,11 +2909,31 @@ export const PanelHandleContentDetails = () => {
|
|
|
2906
2909
|
}
|
|
2907
2910
|
} else {
|
|
2908
2911
|
/* 如果成功创建,加入到中间容器中 */
|
|
2909
|
-
that.uListContainerAddItem(
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
+
that.uListContainerAddItem(
|
|
2913
|
+
formConfig as any as PopsPanelFormsTotalDetails,
|
|
2914
|
+
{
|
|
2915
|
+
ulElement: that.sectionContainerULElement,
|
|
2916
|
+
}
|
|
2917
|
+
);
|
|
2912
2918
|
}
|
|
2913
2919
|
},
|
|
2920
|
+
/**
|
|
2921
|
+
* 触发触发渲染右侧容器的事件
|
|
2922
|
+
*/
|
|
2923
|
+
triggerRenderRightContainer($container: HTMLElement) {
|
|
2924
|
+
let __formConfig__: PopsPanelEventType["pops:renderRightContainer"]["formConfig"] =
|
|
2925
|
+
Reflect.get($container, "__formConfig__");
|
|
2926
|
+
this.$el.$pops.dispatchEvent(
|
|
2927
|
+
new CustomEvent<PopsPanelEventType["pops:renderRightContainer"]>(
|
|
2928
|
+
<keyof PopsPanelEventType>"pops:renderRightContainer",
|
|
2929
|
+
{
|
|
2930
|
+
detail: {
|
|
2931
|
+
formConfig: __formConfig__,
|
|
2932
|
+
},
|
|
2933
|
+
}
|
|
2934
|
+
)
|
|
2935
|
+
);
|
|
2936
|
+
},
|
|
2914
2937
|
/**
|
|
2915
2938
|
*
|
|
2916
2939
|
* @param formConfig
|
|
@@ -2947,6 +2970,16 @@ export const PanelHandleContentDetails = () => {
|
|
|
2947
2970
|
void 0,
|
|
2948
2971
|
(event) => {
|
|
2949
2972
|
this.clearContainer();
|
|
2973
|
+
let rightContainerFormConfig = Reflect.get(
|
|
2974
|
+
asideLiElement,
|
|
2975
|
+
"__forms__"
|
|
2976
|
+
) as PopsPanelContentConfig[];
|
|
2977
|
+
|
|
2978
|
+
Reflect.set(
|
|
2979
|
+
that.$el.$contentSectionContainer,
|
|
2980
|
+
"__formConfig__",
|
|
2981
|
+
rightContainerFormConfig
|
|
2982
|
+
);
|
|
2950
2983
|
popsDOMUtils.cssShow(that.$el.$contentSectionContainer);
|
|
2951
2984
|
this.clearAsideItemIsVisited();
|
|
2952
2985
|
this.setAsideItemIsVisited(asideLiElement);
|
|
@@ -2956,23 +2989,15 @@ export const PanelHandleContentDetails = () => {
|
|
|
2956
2989
|
typeof headerTitleText === "string" &&
|
|
2957
2990
|
headerTitleText.trim() !== ""
|
|
2958
2991
|
) {
|
|
2959
|
-
let
|
|
2960
|
-
(
|
|
2961
|
-
|
|
2962
|
-
PopsSafeUtils.setSafeHTML(
|
|
2963
|
-
containerHeaderTitleLIElement,
|
|
2964
|
-
headerTitleText
|
|
2965
|
-
);
|
|
2992
|
+
let $containerHeaderTitle = document.createElement("li");
|
|
2993
|
+
Reflect.set($containerHeaderTitle, "__asideConfig__", asideConfig);
|
|
2994
|
+
PopsSafeUtils.setSafeHTML($containerHeaderTitle, headerTitleText);
|
|
2966
2995
|
this.sectionContainerHeaderULElement.appendChild(
|
|
2967
|
-
|
|
2996
|
+
$containerHeaderTitle
|
|
2968
2997
|
);
|
|
2969
2998
|
}
|
|
2970
2999
|
|
|
2971
|
-
|
|
2972
|
-
"__forms__"
|
|
2973
|
-
] as PopsPanelContentConfig[];
|
|
2974
|
-
|
|
2975
|
-
__forms__.forEach((formConfig) => {
|
|
3000
|
+
rightContainerFormConfig.forEach((formConfig) => {
|
|
2976
3001
|
this.createSectionContainerItem_forms(formConfig);
|
|
2977
3002
|
});
|
|
2978
3003
|
|
|
@@ -2984,6 +3009,7 @@ export const PanelHandleContentDetails = () => {
|
|
|
2984
3009
|
this.sectionContainerULElement
|
|
2985
3010
|
);
|
|
2986
3011
|
}
|
|
3012
|
+
that.triggerRenderRightContainer(that.$el.$contentSectionContainer);
|
|
2987
3013
|
}
|
|
2988
3014
|
);
|
|
2989
3015
|
},
|