@whitesev/pops 2.6.1 → 3.0.1
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 +2513 -1534
- package/dist/index.amd.js.map +1 -1
- package/dist/index.amd.min.js +1 -1
- package/dist/index.amd.min.js.map +1 -1
- package/dist/index.cjs.js +2513 -1534
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.cjs.min.js.map +1 -1
- package/dist/index.esm.js +2513 -1534
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.iife.js +2513 -1534
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +1 -1
- package/dist/index.iife.min.js.map +1 -1
- package/dist/index.system.js +2513 -1534
- package/dist/index.system.js.map +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/dist/index.umd.js +2513 -1534
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/types/eslint.config.d.mts +2 -0
- package/dist/types/src/Pops.d.ts +449 -103
- package/dist/types/src/PopsCSS.d.ts +3 -1
- package/dist/types/src/PopsIcon.d.ts +1 -1
- package/dist/types/src/PopsInst.d.ts +2 -2
- package/dist/types/src/components/alert/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/alert/index.d.ts +2 -2
- package/dist/types/src/components/alert/types/index.d.ts +4 -4
- package/dist/types/src/components/confirm/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/confirm/index.d.ts +2 -2
- package/dist/types/src/components/confirm/types/index.d.ts +2 -2
- package/dist/types/src/components/drawer/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/drawer/index.d.ts +2 -2
- package/dist/types/src/components/drawer/types/index.d.ts +2 -2
- package/dist/types/src/components/folder/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/folder/index.d.ts +2 -2
- package/dist/types/src/components/folder/types/index.d.ts +31 -7
- package/dist/types/src/components/iframe/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/iframe/index.d.ts +2 -5
- package/dist/types/src/components/iframe/types/index.d.ts +13 -42
- package/dist/types/src/components/loading/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/loading/index.d.ts +2 -2
- package/dist/types/src/components/loading/types/index.d.ts +4 -4
- package/dist/types/src/components/panel/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/panel/handlerComponents.d.ts +988 -49
- package/dist/types/src/components/panel/index.d.ts +2 -2
- package/dist/types/src/components/panel/types/components-button.d.ts +7 -6
- package/dist/types/src/components/panel/types/components-common.d.ts +7 -7
- package/dist/types/src/components/panel/types/components-container.d.ts +24 -0
- package/dist/types/src/components/panel/types/components-deepMenu.d.ts +14 -14
- package/dist/types/src/components/panel/types/components-input.d.ts +46 -21
- package/dist/types/src/components/panel/types/components-own.d.ts +5 -5
- package/dist/types/src/components/panel/types/components-select.d.ts +95 -36
- package/dist/types/src/components/panel/types/components-selectMultiple.d.ts +15 -20
- package/dist/types/src/components/panel/types/components-slider.d.ts +7 -8
- package/dist/types/src/components/panel/types/components-switch.d.ts +6 -6
- package/dist/types/src/components/panel/types/components-textarea.d.ts +6 -6
- package/dist/types/src/components/panel/types/index.d.ts +36 -28
- package/dist/types/src/components/prompt/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/prompt/index.d.ts +2 -2
- package/dist/types/src/components/prompt/types/index.d.ts +4 -3
- package/dist/types/src/components/rightClickMenu/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/rightClickMenu/index.d.ts +29 -27
- package/dist/types/src/components/rightClickMenu/types/index.d.ts +32 -11
- package/dist/types/src/components/searchSuggestion/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/searchSuggestion/index.d.ts +24 -9
- package/dist/types/src/components/searchSuggestion/types/index.d.ts +15 -13
- package/dist/types/src/components/tooltip/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/tooltip/index.d.ts +6 -21
- package/dist/types/src/components/tooltip/types/index.d.ts +8 -6
- package/dist/types/src/config/GlobalConfig.d.ts +3 -3
- package/dist/types/src/handler/PopsElementHandler.d.ts +6 -6
- package/dist/types/src/handler/PopsHandler.d.ts +18 -18
- package/dist/types/src/types/button.d.ts +4 -97
- package/dist/types/src/types/components.d.ts +8 -8
- package/dist/types/src/types/event.d.ts +0 -30
- package/dist/types/src/types/global.d.ts +4 -0
- package/dist/types/src/types/inst.d.ts +5 -5
- package/dist/types/src/types/main.d.ts +35 -80
- package/dist/types/src/types/mask.d.ts +18 -15
- package/dist/types/src/utils/PopsInstanceUtils.d.ts +15 -15
- package/dist/types/src/utils/PopsUtils.d.ts +4 -0
- package/package.json +12 -12
- package/src/Pops.ts +44 -44
- package/src/PopsAnimation.ts +1 -1
- package/src/PopsCSS.ts +4 -1
- package/src/PopsInst.ts +2 -2
- package/src/components/alert/{config.ts → defaultConfig.ts} +7 -7
- package/src/components/alert/index.ts +16 -18
- package/src/components/alert/types/index.ts +4 -4
- package/src/components/confirm/{config.ts → defaultConfig.ts} +11 -11
- package/src/components/confirm/index.ts +11 -13
- package/src/components/confirm/types/index.ts +3 -3
- package/src/components/drawer/{config.ts → defaultConfig.ts} +10 -10
- package/src/components/drawer/index.ts +18 -17
- package/src/components/drawer/types/index.ts +3 -3
- package/src/components/folder/{config.ts → defaultConfig.ts} +22 -18
- package/src/components/folder/index.ts +61 -60
- package/src/components/folder/types/index.ts +31 -18
- package/src/components/iframe/{config.ts → defaultConfig.ts} +2 -2
- package/src/components/iframe/index.ts +24 -29
- package/src/components/iframe/types/index.ts +13 -56
- package/src/components/loading/{config.ts → defaultConfig.ts} +3 -3
- package/src/components/loading/index.ts +13 -11
- package/src/components/loading/types/index.ts +5 -5
- package/src/components/panel/css/components-select.css +84 -0
- package/src/components/panel/defaultConfig.ts +818 -0
- package/src/components/panel/handlerComponents.ts +1431 -762
- package/src/components/panel/index.css +90 -6
- package/src/components/panel/index.ts +15 -28
- package/src/components/panel/types/components-button.ts +7 -6
- package/src/components/panel/types/components-common.ts +7 -7
- package/src/components/panel/types/components-container.ts +25 -0
- package/src/components/panel/types/components-deepMenu.ts +14 -14
- package/src/components/panel/types/components-input.ts +56 -21
- package/src/components/panel/types/components-own.ts +5 -5
- package/src/components/panel/types/components-select.ts +100 -38
- package/src/components/panel/types/components-selectMultiple.ts +16 -22
- package/src/components/panel/types/components-slider.ts +7 -8
- package/src/components/panel/types/components-switch.ts +6 -6
- package/src/components/panel/types/components-textarea.ts +6 -6
- package/src/components/panel/types/index.ts +45 -38
- package/src/components/prompt/{config.ts → defaultConfig.ts} +10 -10
- package/src/components/prompt/index.ts +13 -15
- package/src/components/prompt/types/index.ts +4 -3
- package/src/components/rightClickMenu/{config.ts → defaultConfig.ts} +20 -19
- package/src/components/rightClickMenu/index.ts +125 -108
- package/src/components/rightClickMenu/types/index.ts +36 -14
- package/src/components/searchSuggestion/{config.ts → defaultConfig.ts} +18 -11
- package/src/components/searchSuggestion/index.ts +130 -155
- package/src/components/searchSuggestion/types/index.ts +17 -15
- package/src/components/tooltip/{config.ts → defaultConfig.ts} +5 -6
- package/src/components/tooltip/index.ts +21 -21
- package/src/components/tooltip/types/index.ts +9 -7
- package/src/config/GlobalConfig.ts +2 -2
- package/src/handler/PopsElementHandler.ts +29 -30
- package/src/handler/PopsHandler.ts +43 -43
- package/src/types/button.d.ts +4 -97
- package/src/types/components.d.ts +8 -8
- package/src/types/event.d.ts +0 -30
- package/src/types/global.d.ts +4 -0
- package/src/types/inst.d.ts +5 -5
- package/src/types/main.d.ts +35 -80
- package/src/types/mask.d.ts +18 -15
- package/src/utils/PopsDOMUtils.ts +34 -34
- package/src/utils/PopsInstanceUtils.ts +129 -139
- package/src/utils/PopsUtils.ts +60 -45
- package/dist/types/src/components/alert/config.d.ts +0 -2
- package/dist/types/src/components/confirm/config.d.ts +0 -2
- package/dist/types/src/components/drawer/config.d.ts +0 -2
- package/dist/types/src/components/folder/config.d.ts +0 -2
- package/dist/types/src/components/iframe/config.d.ts +0 -2
- package/dist/types/src/components/loading/config.d.ts +0 -2
- package/dist/types/src/components/panel/config.d.ts +0 -2
- package/dist/types/src/components/panel/types/components-forms.d.ts +0 -23
- package/dist/types/src/components/prompt/config.d.ts +0 -2
- package/dist/types/src/components/rightClickMenu/config.d.ts +0 -2
- package/dist/types/src/components/searchSuggestion/config.d.ts +0 -2
- package/dist/types/src/components/tooltip/config.d.ts +0 -2
- package/src/components/panel/config.ts +0 -530
- package/src/components/panel/types/components-forms.ts +0 -24
|
@@ -652,6 +652,7 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
652
652
|
--el-disabled-text-color: #a8abb2;
|
|
653
653
|
--el-disabled-bg-color: #f5f7fa;
|
|
654
654
|
--el-disabled-border-color: #e4e7ed;
|
|
655
|
+
--el-color-danger: #f56c6c;
|
|
655
656
|
|
|
656
657
|
--pops-panel-components-input-text-color: #000000;
|
|
657
658
|
--pops-panel-components-input-text-bg-color: transparent;
|
|
@@ -666,20 +667,28 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
666
667
|
.pops-panel-input {
|
|
667
668
|
display: flex;
|
|
668
669
|
align-items: center;
|
|
670
|
+
flex-direction: column;
|
|
671
|
+
position: relative;
|
|
672
|
+
box-shadow: none;
|
|
673
|
+
width: 200px;
|
|
674
|
+
border: 0px;
|
|
675
|
+
}
|
|
676
|
+
.pops-panel-input_inner {
|
|
677
|
+
display: flex;
|
|
678
|
+
align-items: center;
|
|
679
|
+
width: 100%;
|
|
669
680
|
border: 1px solid var(--pops-panel-components-input-bd-color);
|
|
670
681
|
border-radius: 4px;
|
|
671
682
|
background-color: var(--pops-panel-components-input-bg-color);
|
|
672
|
-
position: relative;
|
|
673
683
|
box-shadow: none;
|
|
674
|
-
width: 200px;
|
|
675
684
|
}
|
|
676
|
-
.pops-panel-
|
|
685
|
+
.pops-panel-input_inner:hover {
|
|
677
686
|
border: 1px solid var(--pops-panel-components-input-hover-bd-color);
|
|
678
687
|
}
|
|
679
688
|
.pops-panel-input:has(input:disabled):hover {
|
|
680
689
|
--pops-panel-components-input-hover-bd-color: var(--pops-panel-components-input-bd-color);
|
|
681
690
|
}
|
|
682
|
-
.pops-panel-
|
|
691
|
+
.pops-panel-input_inner:has(input:focus) {
|
|
683
692
|
outline: 0;
|
|
684
693
|
border: 1px solid var(--pops-panel-components-input-focus-bd-color);
|
|
685
694
|
border-radius: 4px;
|
|
@@ -716,6 +725,25 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
716
725
|
margin: 0px;
|
|
717
726
|
padding: var(--pops-panel-components-input-text-default-padding);
|
|
718
727
|
}
|
|
728
|
+
.pops-panel-input input[type="search"]::-webkit-search-cancel-button {
|
|
729
|
+
-webkit-appearance: none;
|
|
730
|
+
display: none;
|
|
731
|
+
}
|
|
732
|
+
/* 颜色选择器不需要那么宽 */
|
|
733
|
+
.pops-panel-input:has(input[type="color"]) {
|
|
734
|
+
width: 50px;
|
|
735
|
+
}
|
|
736
|
+
.pops-panel-input input[type="color"] {
|
|
737
|
+
padding: 0px;
|
|
738
|
+
}
|
|
739
|
+
.pops-panel-input_inner:has(input[type="file"]) {
|
|
740
|
+
border: 0px;
|
|
741
|
+
background: transparent;
|
|
742
|
+
}
|
|
743
|
+
.pops-panel-input input[type="file"] {
|
|
744
|
+
padding: 0px;
|
|
745
|
+
line-height: 32px;
|
|
746
|
+
}
|
|
719
747
|
.pops-panel-input span.pops-panel-input__suffix {
|
|
720
748
|
display: inline-flex;
|
|
721
749
|
white-space: nowrap;
|
|
@@ -797,6 +825,22 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
797
825
|
.pops-panel-input input:disabled + .pops-panel-input__suffix {
|
|
798
826
|
display: none;
|
|
799
827
|
}
|
|
828
|
+
/* 校验样式 */
|
|
829
|
+
.pops-panel-input:has(.pops-panel-input-valid-error) {
|
|
830
|
+
--pops-panel-components-input-bd-color: var(--el-color-danger) !important;
|
|
831
|
+
--pops-panel-components-input-hover-bd-color: var(--pops-panel-components-input-bd-color);
|
|
832
|
+
--pops-panel-components-input-focus-bd-color: var(--pops-panel-components-input-bd-color);
|
|
833
|
+
}
|
|
834
|
+
.pops-panel-input .pops-panel-input-valid-error {
|
|
835
|
+
width: 100%;
|
|
836
|
+
color: var(--el-color-danger);
|
|
837
|
+
font-weight: 500;
|
|
838
|
+
font-size: 0.8em;
|
|
839
|
+
box-sizing: border-box;
|
|
840
|
+
vertical-align: middle;
|
|
841
|
+
display: inline-flex;
|
|
842
|
+
position: relative;
|
|
843
|
+
}
|
|
800
844
|
/* input的CSS */
|
|
801
845
|
|
|
802
846
|
/* textarea的CSS */
|
|
@@ -890,8 +934,14 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
890
934
|
}
|
|
891
935
|
/* select的CSS */
|
|
892
936
|
|
|
937
|
+
/* select useDialog的CSS */
|
|
938
|
+
.pops-panel-select {
|
|
939
|
+
}
|
|
940
|
+
/* select useDialog的CSS */
|
|
941
|
+
|
|
893
942
|
/* select-multiple的CSS*/
|
|
894
|
-
.pops-panel-select-multiple
|
|
943
|
+
.pops-panel-select-multiple,
|
|
944
|
+
.pops-panel-select {
|
|
895
945
|
--el-border-radius-base: 4px;
|
|
896
946
|
--el-fill-color-blank: #ffffff;
|
|
897
947
|
--el-transition-duration: 0.3s;
|
|
@@ -910,6 +960,7 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
910
960
|
--el-color-white: #ffffff;
|
|
911
961
|
width: 200px;
|
|
912
962
|
}
|
|
963
|
+
.pops-panel-select .el-select__wrapper,
|
|
913
964
|
.pops-panel-select-multiple .el-select__wrapper {
|
|
914
965
|
display: flex;
|
|
915
966
|
align-items: center;
|
|
@@ -929,9 +980,11 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
929
980
|
transform: translateZ(0);
|
|
930
981
|
border: 1px solid var(--el-border-color);
|
|
931
982
|
}
|
|
983
|
+
.pops-panel-select .el-select__wrapper.is-focused,
|
|
932
984
|
.pops-panel-select-multiple .el-select__wrapper.is-focused {
|
|
933
985
|
--el-border-color: var(--el-color-primary);
|
|
934
986
|
}
|
|
987
|
+
.pops-panel-select .el-select__selection,
|
|
935
988
|
.pops-panel-select-multiple .el-select__selection {
|
|
936
989
|
position: relative;
|
|
937
990
|
display: flex;
|
|
@@ -941,6 +994,16 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
941
994
|
min-width: 0;
|
|
942
995
|
gap: 6px;
|
|
943
996
|
}
|
|
997
|
+
.pops-panel-select .el-select__selection[data-selected-text-align="left"] {
|
|
998
|
+
justify-content: left;
|
|
999
|
+
}
|
|
1000
|
+
.pops-panel-select .el-select__selection[data-selected-text-align="center"] {
|
|
1001
|
+
justify-content: center;
|
|
1002
|
+
}
|
|
1003
|
+
.pops-panel-select .el-select__selection[data-selected-text-align="right"] {
|
|
1004
|
+
justify-content: right;
|
|
1005
|
+
}
|
|
1006
|
+
.pops-panel-select .el-select__selected-item,
|
|
944
1007
|
.pops-panel-select-multiple .el-select__selected-item {
|
|
945
1008
|
display: flex;
|
|
946
1009
|
flex-wrap: wrap;
|
|
@@ -949,15 +1012,24 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
949
1012
|
-ms-user-select: none;
|
|
950
1013
|
user-select: none;
|
|
951
1014
|
}
|
|
1015
|
+
.pops-panel-select .el-select__selected-item span {
|
|
1016
|
+
overflow: hidden;
|
|
1017
|
+
white-space: nowrap;
|
|
1018
|
+
text-overflow: ellipsis;
|
|
1019
|
+
}
|
|
1020
|
+
.pops-panel-select .el-select__selected-item.el-select__choose_tag .el-tag,
|
|
952
1021
|
.pops-panel-select-multiple .el-select__selected-item.el-select__choose_tag .el-tag {
|
|
953
1022
|
max-width: 200px;
|
|
954
1023
|
}
|
|
1024
|
+
.pops-panel-select .el-select__input-wrapper,
|
|
955
1025
|
.pops-panel-select-multiple .el-select__input-wrapper {
|
|
956
1026
|
max-width: 100%;
|
|
957
1027
|
}
|
|
1028
|
+
.pops-panel-select .el-select__selection.is-near,
|
|
958
1029
|
.pops-panel-select-multiple .el-select__selection.is-near {
|
|
959
1030
|
margin-left: -8px;
|
|
960
1031
|
}
|
|
1032
|
+
.pops-panel-select .el-select__placeholder,
|
|
961
1033
|
.pops-panel-select-multiple .el-select__placeholder {
|
|
962
1034
|
position: absolute;
|
|
963
1035
|
display: block;
|
|
@@ -969,6 +1041,7 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
969
1041
|
white-space: nowrap;
|
|
970
1042
|
color: var(--el-input-text-color, var(--el-text-color-regular));
|
|
971
1043
|
}
|
|
1044
|
+
.pops-panel-select .el-select__placeholder.is-transparent,
|
|
972
1045
|
.pops-panel-select-multiple .el-select__placeholder.is-transparent {
|
|
973
1046
|
-webkit-user-select: none;
|
|
974
1047
|
-moz-user-select: none;
|
|
@@ -976,6 +1049,8 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
976
1049
|
user-select: none;
|
|
977
1050
|
color: var(--el-text-color-placeholder);
|
|
978
1051
|
}
|
|
1052
|
+
.pops-panel-select .el-select__prefix,
|
|
1053
|
+
.pops-panel-select .el-select__suffix,
|
|
979
1054
|
.pops-panel-select-multiple .el-select__prefix,
|
|
980
1055
|
.pops-panel-select-multiple .el-select__suffix {
|
|
981
1056
|
display: flex;
|
|
@@ -984,6 +1059,7 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
984
1059
|
gap: 6px;
|
|
985
1060
|
color: var(--el-input-icon-color, var(--el-text-color-placeholder));
|
|
986
1061
|
}
|
|
1062
|
+
.pops-panel-select .el-icon,
|
|
987
1063
|
.pops-panel-select-multiple .el-icon {
|
|
988
1064
|
--color: inherit;
|
|
989
1065
|
height: 1em;
|
|
@@ -998,17 +1074,24 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
998
1074
|
color: var(--color);
|
|
999
1075
|
font-size: inherit;
|
|
1000
1076
|
}
|
|
1077
|
+
.pops-panel-select .el-icon svg,
|
|
1001
1078
|
.pops-panel-select-multiple .el-icon svg {
|
|
1002
1079
|
height: 1em;
|
|
1003
1080
|
width: 1em;
|
|
1004
1081
|
}
|
|
1082
|
+
.pops-panel-select .el-select__caret,
|
|
1005
1083
|
.pops-panel-select-multiple .el-select__caret {
|
|
1006
1084
|
color: var(--el-select-input-color);
|
|
1007
1085
|
font-size: var(--el-select-input-font-size);
|
|
1008
|
-
transition: var(--el-transition-duration);
|
|
1086
|
+
transition: transform var(--el-transition-duration);
|
|
1009
1087
|
transform: rotate(0);
|
|
1010
1088
|
cursor: pointer;
|
|
1011
1089
|
}
|
|
1090
|
+
/* 把箭头旋转 */
|
|
1091
|
+
.pops-panel-select[data-show-option] .el-select__caret,
|
|
1092
|
+
.pops-panel-select-multiple[data-show-option] .el-select__caret {
|
|
1093
|
+
transform: rotate(180deg);
|
|
1094
|
+
}
|
|
1012
1095
|
.pops-panel-select-multiple .el-tag {
|
|
1013
1096
|
--el-tag-font-size: 12px;
|
|
1014
1097
|
--el-tag-border-radius: 4px;
|
|
@@ -1081,6 +1164,7 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
1081
1164
|
text-overflow: ellipsis;
|
|
1082
1165
|
white-space: nowrap;
|
|
1083
1166
|
}
|
|
1167
|
+
/* 禁用样式 */
|
|
1084
1168
|
.pops-panel-select-multiple-disable {
|
|
1085
1169
|
--el-fill-color-blank: #f5f7fa;
|
|
1086
1170
|
--color: #a8abb2;
|
|
@@ -3,35 +3,22 @@ import { PopsHandler } from "../../handler/PopsHandler";
|
|
|
3
3
|
import { popsDOMUtils } from "../../utils/PopsDOMUtils";
|
|
4
4
|
import { PopsInstanceUtils } from "../../utils/PopsInstanceUtils";
|
|
5
5
|
import { popsUtils } from "../../utils/PopsUtils";
|
|
6
|
-
import type {
|
|
7
|
-
import {
|
|
6
|
+
import type { PopsPanelConfig, PopsPanelEventType } from "./types";
|
|
7
|
+
import { PopsPanelDefaultConfig } from "./defaultConfig";
|
|
8
8
|
import { PanelHandlerComponents } from "./handlerComponents";
|
|
9
9
|
import { GlobalConfig } from "../../config/GlobalConfig";
|
|
10
10
|
import { PopsCSS } from "../../PopsCSS";
|
|
11
11
|
import type { PopsType } from "../../types/main";
|
|
12
12
|
|
|
13
13
|
export const PopsPanel = {
|
|
14
|
-
init(
|
|
14
|
+
init(__config__: PopsPanelConfig) {
|
|
15
15
|
const guid = popsUtils.getRandomGUID();
|
|
16
16
|
// 设置当前类型
|
|
17
17
|
const popsType: PopsType = "panel";
|
|
18
18
|
|
|
19
|
-
let config: Required<
|
|
19
|
+
let config: Required<PopsPanelConfig> = PopsPanelDefaultConfig();
|
|
20
20
|
config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
|
|
21
|
-
config = popsUtils.assign(config,
|
|
22
|
-
if (details) {
|
|
23
|
-
if (Array.isArray(details.content)) {
|
|
24
|
-
// 存在内容配置
|
|
25
|
-
config.content = details.content;
|
|
26
|
-
}
|
|
27
|
-
if (Array.isArray(details.bottomContentConfig)) {
|
|
28
|
-
// 存在底部配置
|
|
29
|
-
config.bottomContentConfig = details.bottomContentConfig;
|
|
30
|
-
} else {
|
|
31
|
-
// 不存在底部配置 清空默认的
|
|
32
|
-
config.bottomContentConfig = [];
|
|
33
|
-
}
|
|
34
|
-
}
|
|
21
|
+
config = popsUtils.assign(config, __config__);
|
|
35
22
|
config = PopsHandler.handleOnly(popsType, config);
|
|
36
23
|
|
|
37
24
|
const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
|
|
@@ -109,7 +96,7 @@ export const PopsPanel = {
|
|
|
109
96
|
* 弹窗的主元素,包括动画层
|
|
110
97
|
*/
|
|
111
98
|
const $anim = PopsElementHandler.parseElement<HTMLDivElement>(animHTML);
|
|
112
|
-
|
|
99
|
+
// 结构元素
|
|
113
100
|
const {
|
|
114
101
|
$pops,
|
|
115
102
|
$headerBtnClose,
|
|
@@ -135,7 +122,7 @@ export const PopsPanel = {
|
|
|
135
122
|
*/
|
|
136
123
|
const $elList: HTMLElement[] = [$anim];
|
|
137
124
|
|
|
138
|
-
|
|
125
|
+
// 遮罩层元素
|
|
139
126
|
if (config.mask.enable) {
|
|
140
127
|
const handleMask = PopsHandler.handleMask({
|
|
141
128
|
type: popsType,
|
|
@@ -148,7 +135,7 @@ export const PopsPanel = {
|
|
|
148
135
|
$elList.push($mask);
|
|
149
136
|
}
|
|
150
137
|
|
|
151
|
-
|
|
138
|
+
// 处理返回的配置
|
|
152
139
|
const evtConfig = PopsHandler.handleEventConfig(
|
|
153
140
|
config,
|
|
154
141
|
guid,
|
|
@@ -159,16 +146,16 @@ export const PopsPanel = {
|
|
|
159
146
|
$pops,
|
|
160
147
|
$mask
|
|
161
148
|
);
|
|
162
|
-
|
|
149
|
+
// 为顶部右边的关闭按钮添加点击事件
|
|
163
150
|
PopsHandler.handleClickEvent("close", $headerBtnClose, evtConfig, config.btn?.close?.callback);
|
|
164
151
|
|
|
165
|
-
|
|
152
|
+
// 创建到页面中
|
|
166
153
|
popsDOMUtils.append($shadowRoot, $elList);
|
|
167
154
|
if (typeof config.beforeAppendToPageCallBack === "function") {
|
|
168
155
|
config.beforeAppendToPageCallBack($shadowRoot, $shadowContainer);
|
|
169
156
|
}
|
|
170
157
|
popsDOMUtils.appendBody($shadowContainer);
|
|
171
|
-
|
|
158
|
+
// 追加遮罩层元素
|
|
172
159
|
if ($mask != null) {
|
|
173
160
|
$anim.after($mask);
|
|
174
161
|
}
|
|
@@ -193,13 +180,13 @@ export const PopsPanel = {
|
|
|
193
180
|
|
|
194
181
|
PopsHandler.handlePush(popsType, {
|
|
195
182
|
guid: guid,
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
183
|
+
$anim: $anim,
|
|
184
|
+
$pops: $pops,
|
|
185
|
+
$mask: $mask!,
|
|
199
186
|
$shadowContainer: $shadowContainer,
|
|
200
187
|
$shadowRoot: $shadowRoot,
|
|
201
188
|
});
|
|
202
|
-
|
|
189
|
+
// 拖拽
|
|
203
190
|
if (config.drag) {
|
|
204
191
|
PopsInstanceUtils.drag($pops, {
|
|
205
192
|
dragElement: $title,
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
2
2
|
import type { PopsButtonStyleType } from "../../../types/button";
|
|
3
3
|
import type { PopsIconType } from "../../../types/icon";
|
|
4
4
|
/**
|
|
5
5
|
* pops.panel的 button
|
|
6
6
|
*/
|
|
7
|
-
export interface
|
|
7
|
+
export interface PopsPanelButtonConfig extends PopsPanelGeneralConfig<PopsPanelButtonConfig> {
|
|
8
|
+
/**
|
|
9
|
+
* 组件类型
|
|
10
|
+
*/
|
|
11
|
+
type: "button";
|
|
8
12
|
/**
|
|
9
13
|
* 显示在左边的文字
|
|
10
14
|
*/
|
|
@@ -13,12 +17,9 @@ export interface PopsPanelButtonDetails extends PopsPanelCommonDetails<PopsPanel
|
|
|
13
17
|
* (可选)左边的文字下面的描述
|
|
14
18
|
*/
|
|
15
19
|
description?: string;
|
|
16
|
-
/**
|
|
17
|
-
* 类型
|
|
18
|
-
*/
|
|
19
|
-
type: "button";
|
|
20
20
|
/**
|
|
21
21
|
* (可选)是否禁用
|
|
22
|
+
* @default false
|
|
22
23
|
*/
|
|
23
24
|
disable?: boolean;
|
|
24
25
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { PopsPanelContainerConfig } from "./components-container";
|
|
2
|
+
import type { PopsPanelViewConfig } from ".";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* 右侧容器的配置
|
|
6
6
|
*/
|
|
7
|
-
export interface
|
|
7
|
+
export interface PopsPanelRightAsideContainerConfig {
|
|
8
8
|
/** 当前的<li>元素 */
|
|
9
9
|
target: HTMLLIElement | undefined;
|
|
10
10
|
/** 当前的<li>元素的父<ul>元素 */
|
|
@@ -19,7 +19,7 @@ export interface PopsPanelRightAsideContainerOptions {
|
|
|
19
19
|
/**
|
|
20
20
|
* 通用配置
|
|
21
21
|
*/
|
|
22
|
-
export interface
|
|
22
|
+
export interface PopsPanelGeneralConfig<T extends PopsPanelViewConfig | PopsPanelContainerConfig> {
|
|
23
23
|
/**
|
|
24
24
|
* (可选)元素的className,值为空的话就不设置
|
|
25
25
|
* @default ""
|
|
@@ -45,11 +45,11 @@ export interface PopsPanelCommonDetails<T extends PopsPanelFormsTotalDetails | P
|
|
|
45
45
|
};
|
|
46
46
|
/**
|
|
47
47
|
* 在添加到<ul>元素后触发该回调
|
|
48
|
-
* @param
|
|
48
|
+
* @param viewConfig 配置
|
|
49
49
|
* @param container 右侧容器的元素
|
|
50
50
|
* @example
|
|
51
51
|
* // 例如在type为own时
|
|
52
|
-
* afterAddToUListCallBack(
|
|
52
|
+
* afterAddToUListCallBack(viewConfig, container) {
|
|
53
53
|
* DOMUtils.on(
|
|
54
54
|
container.formHeaderDivElement.querySelector(
|
|
55
55
|
"a"
|
|
@@ -69,5 +69,5 @@ export interface PopsPanelCommonDetails<T extends PopsPanelFormsTotalDetails | P
|
|
|
69
69
|
* // 例如在type为forms时
|
|
70
70
|
* container内只有container.ulElement这个属性
|
|
71
71
|
*/
|
|
72
|
-
afterAddToUListCallBack?: (
|
|
72
|
+
afterAddToUListCallBack?: (viewConfig: T, container: PopsPanelRightAsideContainerConfig) => void;
|
|
73
73
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
2
|
+
import type { PopsPanelViewConfig } from ".";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* pops.panel的 container
|
|
6
|
+
*/
|
|
7
|
+
export interface PopsPanelContainerConfig extends PopsPanelGeneralConfig<PopsPanelContainerConfig> {
|
|
8
|
+
/**
|
|
9
|
+
* 组件类型
|
|
10
|
+
*/
|
|
11
|
+
type: "container";
|
|
12
|
+
/**
|
|
13
|
+
* 显示在左边的文字
|
|
14
|
+
*/
|
|
15
|
+
text: string;
|
|
16
|
+
/**
|
|
17
|
+
* 是否进行折叠
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
isFold?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* 子配置
|
|
23
|
+
*/
|
|
24
|
+
views: PopsPanelViewConfig[];
|
|
25
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
1
|
+
import type { PopsPanelViewConfig } from ".";
|
|
2
|
+
import type { PopsPanelContainerConfig } from "./components-container";
|
|
3
|
+
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
4
4
|
/**
|
|
5
|
-
* pops.panel的
|
|
5
|
+
* pops.panel的 深层视图的配置
|
|
6
6
|
*/
|
|
7
|
-
export interface
|
|
7
|
+
export interface PopsPanelDeepViewConfig extends PopsPanelGeneralConfig<PopsPanelDeepViewConfig> {
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* 组件类型
|
|
10
10
|
*/
|
|
11
11
|
type: "deepMenu";
|
|
12
12
|
/**
|
|
@@ -34,29 +34,29 @@ export interface PopsPanelDeepMenuDetails extends PopsPanelCommonDetails<PopsPan
|
|
|
34
34
|
*/
|
|
35
35
|
clickCallBack?: (
|
|
36
36
|
event: MouseEvent | PointerEvent,
|
|
37
|
-
|
|
37
|
+
viewConfig: PopsPanelDeepViewConfig
|
|
38
38
|
) => boolean | void | Promise<boolean | void>;
|
|
39
39
|
/**
|
|
40
40
|
* 进入深层菜单后触发的回调
|
|
41
|
-
* @param
|
|
41
|
+
* @param viewConfig
|
|
42
42
|
*/
|
|
43
43
|
afterEnterDeepMenuCallBack?: (
|
|
44
|
-
|
|
44
|
+
viewConfig: PopsPanelDeepViewConfig,
|
|
45
45
|
container: {
|
|
46
46
|
/** 右侧的总容器 */
|
|
47
|
-
sectionContainer: HTMLElement;
|
|
47
|
+
$sectionContainer: HTMLElement;
|
|
48
48
|
/** 右侧的总容器的标题头容器 */
|
|
49
|
-
sectionContainerHeaderContainer: HTMLUListElement;
|
|
49
|
+
$sectionContainerHeaderContainer: HTMLUListElement;
|
|
50
50
|
/** 右侧的总容器的标题头 */
|
|
51
|
-
sectionContainerHeader: HTMLLIElement;
|
|
51
|
+
$sectionContainerHeader: HTMLLIElement;
|
|
52
52
|
/** 右侧的内容容器 */
|
|
53
|
-
sectionBodyContainer: HTMLUListElement;
|
|
53
|
+
$sectionBodyContainer: HTMLUListElement;
|
|
54
54
|
}
|
|
55
55
|
) => void;
|
|
56
56
|
/**
|
|
57
57
|
* 菜单配置
|
|
58
58
|
*/
|
|
59
|
-
|
|
59
|
+
views?: (PopsPanelContainerConfig | PopsPanelViewConfig)[];
|
|
60
60
|
/**
|
|
61
61
|
* (可选)头部的标题文字,没有的话默认是text
|
|
62
62
|
*/
|
|
@@ -1,9 +1,47 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* pops.panel的input的字符串type类型
|
|
5
|
+
*/
|
|
6
|
+
export type PopsPanelInputStringType = "text" | "color" | "search" | "email" | "tel" | "url";
|
|
7
|
+
/**
|
|
8
|
+
* pops.panel的input的日期type类型
|
|
9
|
+
*/
|
|
10
|
+
export type PopsPanelInputDateType = "date" | "datetime-local" | "time" | "month" | "week";
|
|
11
|
+
/**
|
|
12
|
+
* pops.panel的input的数字ype类型
|
|
13
|
+
*/
|
|
14
|
+
export type PopsPanelInputNumberType = "number";
|
|
15
|
+
/**
|
|
16
|
+
* pops.panel的input的密码type类型
|
|
17
|
+
*/
|
|
18
|
+
export type PopsPanelInputPasswordType = "password";
|
|
19
|
+
/**
|
|
20
|
+
* pops.panel的input的文件type类型
|
|
21
|
+
*/
|
|
22
|
+
export type PopsPanelInputFileType = "file";
|
|
23
|
+
/**
|
|
24
|
+
* pops.panel的input的type类型
|
|
25
|
+
*/
|
|
26
|
+
export type PopsPanelInputType =
|
|
27
|
+
| PopsPanelInputStringType
|
|
28
|
+
| PopsPanelInputDateType
|
|
29
|
+
| PopsPanelInputNumberType
|
|
30
|
+
| PopsPanelInputPasswordType
|
|
31
|
+
| PopsPanelInputFileType;
|
|
3
32
|
/**
|
|
4
33
|
* pops.panel的 input
|
|
5
34
|
*/
|
|
6
|
-
export interface
|
|
35
|
+
export interface PopsPanelInputConfig extends PopsPanelGeneralConfig<PopsPanelInputConfig> {
|
|
36
|
+
/**
|
|
37
|
+
* 组件类型
|
|
38
|
+
*/
|
|
39
|
+
type: "input";
|
|
40
|
+
/**
|
|
41
|
+
* (可选)输入框类型
|
|
42
|
+
* @default "text"
|
|
43
|
+
*/
|
|
44
|
+
inputType?: PopsPanelInputType;
|
|
7
45
|
/**
|
|
8
46
|
* 显示在左边的文字
|
|
9
47
|
*/
|
|
@@ -13,10 +51,6 @@ export interface PopsPanelInputDetails extends PopsPanelCommonDetails<PopsPanelI
|
|
|
13
51
|
* @default ""
|
|
14
52
|
*/
|
|
15
53
|
description?: string;
|
|
16
|
-
/**
|
|
17
|
-
* 类型
|
|
18
|
-
*/
|
|
19
|
-
type: "input";
|
|
20
54
|
/**
|
|
21
55
|
* (可选)是否禁用
|
|
22
56
|
* @default false
|
|
@@ -24,32 +58,33 @@ export interface PopsPanelInputDetails extends PopsPanelCommonDetails<PopsPanelI
|
|
|
24
58
|
disabled?: boolean | (() => boolean);
|
|
25
59
|
/**
|
|
26
60
|
* 获取该项的值的回调函数
|
|
61
|
+
*
|
|
62
|
+
* 组件初始化后会调用一次,用于初始话默认值
|
|
27
63
|
*/
|
|
28
|
-
getValue(): string;
|
|
64
|
+
getValue(): string | number | Date;
|
|
29
65
|
/**
|
|
30
66
|
* 输入框的值改变触发的回调函数
|
|
31
67
|
* @param event 输入事件
|
|
32
68
|
* @param value 输入框的值
|
|
33
|
-
* @param valueAsNumber
|
|
69
|
+
* @param valueAsNumber 如果inputType为number或日期类型,存在该值,类型为number(可能为isNaN),否则为undefined
|
|
70
|
+
* @param valueAsDate 如果inputType为日期类型,存在该值,类型为Date(可能为null),否则为undefined
|
|
34
71
|
*/
|
|
35
|
-
callback(
|
|
72
|
+
callback(
|
|
73
|
+
event: InputEvent,
|
|
74
|
+
value: string,
|
|
75
|
+
valueAsNumber?: number,
|
|
76
|
+
valueAsDate?: Date | null
|
|
77
|
+
): void | {
|
|
78
|
+
valid: boolean;
|
|
79
|
+
message?: string;
|
|
80
|
+
};
|
|
36
81
|
/**
|
|
37
82
|
* (可选)输入框内的提示
|
|
38
83
|
* @default ""
|
|
39
84
|
*/
|
|
40
85
|
placeholder?: string;
|
|
41
86
|
/**
|
|
42
|
-
*
|
|
43
|
-
* @default false
|
|
44
|
-
*/
|
|
45
|
-
isPassword?: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* (可选)是否是数字框
|
|
48
|
-
* @default false
|
|
49
|
-
*/
|
|
50
|
-
isNumber?: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* (可选)自己调用的处理回调函数
|
|
87
|
+
* (可选)初始化后调用的回调函数
|
|
53
88
|
*/
|
|
54
|
-
handlerCallBack?(
|
|
89
|
+
handlerCallBack?($li: HTMLLIElement, $input: HTMLInputElement): void;
|
|
55
90
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* pops.panel的 own
|
|
5
5
|
* 自定义的
|
|
6
6
|
*/
|
|
7
|
-
export interface
|
|
7
|
+
export interface PopsPanelOwnConfig extends PopsPanelGeneralConfig<PopsPanelOwnConfig> {
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* 组件类型
|
|
10
10
|
*/
|
|
11
11
|
type: "own";
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* 生成<li>标签元素
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
createLIElement($li: HTMLLIElement): HTMLLIElement;
|
|
16
16
|
}
|