@whitesev/pops 3.0.0 → 3.0.2
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 +1964 -719
- 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 +1964 -719
- 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 +1964 -719
- 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 +1964 -719
- 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 +1964 -719
- 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 +1964 -719
- 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/src/Pops.d.ts +413 -22
- package/dist/types/src/PopsCSS.d.ts +3 -1
- package/dist/types/src/PopsIcon.d.ts +1 -1
- package/dist/types/src/components/panel/handlerComponents.d.ts +1103 -21
- package/dist/types/src/components/panel/index.d.ts +2 -2
- package/dist/types/src/components/panel/types/components-button.d.ts +1 -1
- package/dist/types/src/components/panel/types/components-container.d.ts +1 -1
- package/dist/types/src/components/panel/types/components-deepMenu.d.ts +1 -1
- package/dist/types/src/components/panel/types/components-input.d.ts +41 -16
- package/dist/types/src/components/panel/types/components-own.d.ts +3 -3
- package/dist/types/src/components/panel/types/components-select.d.ts +126 -30
- package/dist/types/src/components/panel/types/components-selectMultiple.d.ts +10 -15
- package/dist/types/src/components/panel/types/components-slider.d.ts +2 -3
- package/dist/types/src/components/panel/types/components-switch.d.ts +1 -1
- package/dist/types/src/components/panel/types/components-textarea.d.ts +1 -1
- package/dist/types/src/components/searchSuggestion/index.d.ts +3 -3
- package/dist/types/src/types/global.d.ts +3 -1
- package/package.json +8 -8
- package/src/PopsCSS.ts +4 -1
- package/src/components/panel/css/components-select.css +84 -0
- package/src/components/panel/defaultConfig.ts +473 -213
- package/src/components/panel/handlerComponents.ts +1504 -499
- package/src/components/panel/index.css +149 -14
- package/src/components/panel/types/components-button.ts +1 -1
- package/src/components/panel/types/components-container.ts +1 -1
- package/src/components/panel/types/components-deepMenu.ts +1 -1
- package/src/components/panel/types/components-input.ts +51 -16
- package/src/components/panel/types/components-own.ts +3 -3
- package/src/components/panel/types/components-select.ts +131 -32
- package/src/components/panel/types/components-selectMultiple.ts +11 -16
- package/src/components/panel/types/components-slider.ts +2 -3
- package/src/components/panel/types/components-switch.ts +1 -1
- package/src/components/panel/types/components-textarea.ts +1 -1
- package/src/components/rightClickMenu/index.css +1 -1
- package/src/components/searchSuggestion/index.ts +20 -65
- package/src/css/common.css +4 -4
- package/src/types/global.d.ts +3 -1
|
@@ -278,13 +278,17 @@ section.pops-panel-container .pops-panel-forms-fold .pops-panel-forms-container-
|
|
|
278
278
|
.pops[type-value="panel"] section.pops-panel-container > ul > li div:nth-child(2) {
|
|
279
279
|
max-width: 55%;
|
|
280
280
|
}
|
|
281
|
+
.pops[type-value="panel"] .pops-panel-select .el-select__selected-item.el-select__placeholder {
|
|
282
|
+
max-width: -moz-available;
|
|
283
|
+
max-width: -webkit-fill-available;
|
|
284
|
+
}
|
|
281
285
|
.pops[type-value="panel"] section.pops-panel-container > ul > li .pops-panel-input span.pops-panel-input__suffix {
|
|
282
286
|
padding: 0 4px;
|
|
283
287
|
}
|
|
284
288
|
.pops[type-value="panel"] section.pops-panel-container .pops-panel-select select {
|
|
285
289
|
min-width: 88px !important;
|
|
286
|
-
width: -webkit-fill-available;
|
|
287
290
|
width: -moz-available;
|
|
291
|
+
width: -webkit-fill-available;
|
|
288
292
|
}
|
|
289
293
|
.pops[type-value="panel"] section.pops-panel-container .pops-panel-container-header-ul li {
|
|
290
294
|
font-size: 16px;
|
|
@@ -652,6 +656,7 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
652
656
|
--el-disabled-text-color: #a8abb2;
|
|
653
657
|
--el-disabled-bg-color: #f5f7fa;
|
|
654
658
|
--el-disabled-border-color: #e4e7ed;
|
|
659
|
+
--el-color-danger: #f56c6c;
|
|
655
660
|
|
|
656
661
|
--pops-panel-components-input-text-color: #000000;
|
|
657
662
|
--pops-panel-components-input-text-bg-color: transparent;
|
|
@@ -666,20 +671,28 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
666
671
|
.pops-panel-input {
|
|
667
672
|
display: flex;
|
|
668
673
|
align-items: center;
|
|
674
|
+
flex-direction: column;
|
|
675
|
+
position: relative;
|
|
676
|
+
box-shadow: none;
|
|
677
|
+
width: 200px;
|
|
678
|
+
border: 0px;
|
|
679
|
+
}
|
|
680
|
+
.pops-panel-input_inner {
|
|
681
|
+
display: flex;
|
|
682
|
+
align-items: center;
|
|
683
|
+
width: 100%;
|
|
669
684
|
border: 1px solid var(--pops-panel-components-input-bd-color);
|
|
670
685
|
border-radius: 4px;
|
|
671
686
|
background-color: var(--pops-panel-components-input-bg-color);
|
|
672
|
-
position: relative;
|
|
673
687
|
box-shadow: none;
|
|
674
|
-
width: 200px;
|
|
675
688
|
}
|
|
676
|
-
.pops-panel-
|
|
689
|
+
.pops-panel-input_inner:hover {
|
|
677
690
|
border: 1px solid var(--pops-panel-components-input-hover-bd-color);
|
|
678
691
|
}
|
|
679
692
|
.pops-panel-input:has(input:disabled):hover {
|
|
680
693
|
--pops-panel-components-input-hover-bd-color: var(--pops-panel-components-input-bd-color);
|
|
681
694
|
}
|
|
682
|
-
.pops-panel-
|
|
695
|
+
.pops-panel-input_inner:has(input:focus) {
|
|
683
696
|
outline: 0;
|
|
684
697
|
border: 1px solid var(--pops-panel-components-input-focus-bd-color);
|
|
685
698
|
border-radius: 4px;
|
|
@@ -716,14 +729,33 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
716
729
|
margin: 0px;
|
|
717
730
|
padding: var(--pops-panel-components-input-text-default-padding);
|
|
718
731
|
}
|
|
732
|
+
.pops-panel-input input[type="search"]::-webkit-search-cancel-button {
|
|
733
|
+
-webkit-appearance: none;
|
|
734
|
+
display: none;
|
|
735
|
+
}
|
|
736
|
+
/* 颜色选择器不需要那么宽 */
|
|
737
|
+
.pops-panel-input:has(input[type="color"]) {
|
|
738
|
+
width: 50px;
|
|
739
|
+
}
|
|
740
|
+
.pops-panel-input input[type="color"] {
|
|
741
|
+
padding: 0px;
|
|
742
|
+
}
|
|
743
|
+
.pops-panel-input_inner:has(input[type="file"]) {
|
|
744
|
+
border: 0px;
|
|
745
|
+
background: transparent;
|
|
746
|
+
}
|
|
747
|
+
.pops-panel-input input[type="file"] {
|
|
748
|
+
padding: 0px;
|
|
749
|
+
line-height: 32px;
|
|
750
|
+
}
|
|
719
751
|
.pops-panel-input span.pops-panel-input__suffix {
|
|
720
752
|
display: inline-flex;
|
|
721
753
|
white-space: nowrap;
|
|
722
754
|
flex-shrink: 0;
|
|
723
755
|
flex-wrap: nowrap;
|
|
724
756
|
height: 100%;
|
|
725
|
-
height: -webkit-fill-available;
|
|
726
757
|
height: -moz-available;
|
|
758
|
+
height: -webkit-fill-available;
|
|
727
759
|
text-align: center;
|
|
728
760
|
color: var(--pops-panel-components-input-suffix-color);
|
|
729
761
|
background: var(--pops-panel-components-input-suffix-bg-color);
|
|
@@ -797,6 +829,22 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
797
829
|
.pops-panel-input input:disabled + .pops-panel-input__suffix {
|
|
798
830
|
display: none;
|
|
799
831
|
}
|
|
832
|
+
/* 校验样式 */
|
|
833
|
+
.pops-panel-input:has(.pops-panel-input-valid-error) {
|
|
834
|
+
--pops-panel-components-input-bd-color: var(--el-color-danger) !important;
|
|
835
|
+
--pops-panel-components-input-hover-bd-color: var(--pops-panel-components-input-bd-color);
|
|
836
|
+
--pops-panel-components-input-focus-bd-color: var(--pops-panel-components-input-bd-color);
|
|
837
|
+
}
|
|
838
|
+
.pops-panel-input .pops-panel-input-valid-error {
|
|
839
|
+
width: 100%;
|
|
840
|
+
color: var(--el-color-danger);
|
|
841
|
+
font-weight: 500;
|
|
842
|
+
font-size: 0.8em;
|
|
843
|
+
box-sizing: border-box;
|
|
844
|
+
vertical-align: middle;
|
|
845
|
+
display: inline-flex;
|
|
846
|
+
position: relative;
|
|
847
|
+
}
|
|
800
848
|
/* input的CSS */
|
|
801
849
|
|
|
802
850
|
/* textarea的CSS */
|
|
@@ -849,6 +897,7 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
849
897
|
|
|
850
898
|
/* select的CSS */
|
|
851
899
|
.pops-panel-select {
|
|
900
|
+
--pops-panel-components-select-disabled-text-color: #a8abb2;
|
|
852
901
|
--pops-panel-components-select-text-color: #000000;
|
|
853
902
|
--pops-panel-components-select-bd-color: rgb(184, 184, 184, var(--pops-bd-opacity));
|
|
854
903
|
--pops-panel-components-select-hover-bd-color: rgb(184, 184, 184, var(--pops-bd-opacity));
|
|
@@ -890,8 +939,64 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
890
939
|
}
|
|
891
940
|
/* select的CSS */
|
|
892
941
|
|
|
942
|
+
/* select dialog 的CSS */
|
|
943
|
+
.pops-panel-select[data-mode="dialog"] {
|
|
944
|
+
}
|
|
945
|
+
/* select dialog 的CSS */
|
|
946
|
+
|
|
947
|
+
/* select horizontal 的CSS */
|
|
948
|
+
.pops-panel-select[data-mode="horizontal"] {
|
|
949
|
+
--pops-panel-components-select-horizontal-selected-text-color: #626aef;
|
|
950
|
+
--pops-panel-components-select-horizontal-selected-bg-color: #eff0fd;
|
|
951
|
+
}
|
|
952
|
+
.pops-panel-select[data-mode="horizontal"] .el-select__wrapper {
|
|
953
|
+
padding: 0;
|
|
954
|
+
gap: 0;
|
|
955
|
+
border: 0;
|
|
956
|
+
}
|
|
957
|
+
.pops-panel-select[data-mode="horizontal"] .select-item {
|
|
958
|
+
flex: 1;
|
|
959
|
+
display: flex;
|
|
960
|
+
justify-content: center;
|
|
961
|
+
align-items: center;
|
|
962
|
+
border: 1px solid var(--el-border-color);
|
|
963
|
+
height: -moz-available;
|
|
964
|
+
height: -webkit-fill-available;
|
|
965
|
+
border-left: 0;
|
|
966
|
+
}
|
|
967
|
+
.pops-panel-select[data-mode="horizontal"] .select-item:hover {
|
|
968
|
+
color: var(--el-color-primary);
|
|
969
|
+
}
|
|
970
|
+
.pops-panel-select[data-mode="horizontal"] .select-item:first-child {
|
|
971
|
+
border-left: 1px solid var(--el-border-color);
|
|
972
|
+
border-top-left-radius: var(--el-border-radius-base);
|
|
973
|
+
border-bottom-left-radius: var(--el-border-radius-base);
|
|
974
|
+
}
|
|
975
|
+
.pops-panel-select[data-mode="horizontal"] .select-item:last-child {
|
|
976
|
+
border-top-right-radius: var(--el-border-radius-base);
|
|
977
|
+
border-bottom-right-radius: var(--el-border-radius-base);
|
|
978
|
+
}
|
|
979
|
+
.pops-panel-select[data-mode="horizontal"] .select-item.select__selected-item {
|
|
980
|
+
color: var(--pops-panel-components-select-horizontal-selected-text-color);
|
|
981
|
+
background-color: var(--pops-panel-components-select-horizontal-selected-bg-color);
|
|
982
|
+
border-color: var(--pops-panel-components-select-horizontal-selected-bg-color);
|
|
983
|
+
}
|
|
984
|
+
.pops-panel-select[data-mode="horizontal"] .select-item:has(+ .select__selected-item) {
|
|
985
|
+
border-right: 0;
|
|
986
|
+
}
|
|
987
|
+
.pops-panel-select[data-mode="horizontal"] .select-item[disabled] {
|
|
988
|
+
color: var(--pops-panel-components-select-disabled-text-color);
|
|
989
|
+
--pops-panel-components-select-horizontal-selected-text-color: var(
|
|
990
|
+
--pops-panel-components-select-disabled-text-color
|
|
991
|
+
);
|
|
992
|
+
cursor: not-allowed;
|
|
993
|
+
background: unset;
|
|
994
|
+
}
|
|
995
|
+
/* select horizontal 的CSS */
|
|
996
|
+
|
|
893
997
|
/* select-multiple的CSS*/
|
|
894
|
-
.pops-panel-select-multiple
|
|
998
|
+
.pops-panel-select-multiple,
|
|
999
|
+
.pops-panel-select {
|
|
895
1000
|
--el-border-radius-base: 4px;
|
|
896
1001
|
--el-fill-color-blank: #ffffff;
|
|
897
1002
|
--el-transition-duration: 0.3s;
|
|
@@ -910,6 +1015,7 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
910
1015
|
--el-color-white: #ffffff;
|
|
911
1016
|
width: 200px;
|
|
912
1017
|
}
|
|
1018
|
+
.pops-panel-select .el-select__wrapper,
|
|
913
1019
|
.pops-panel-select-multiple .el-select__wrapper {
|
|
914
1020
|
display: flex;
|
|
915
1021
|
align-items: center;
|
|
@@ -929,9 +1035,11 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
929
1035
|
transform: translateZ(0);
|
|
930
1036
|
border: 1px solid var(--el-border-color);
|
|
931
1037
|
}
|
|
1038
|
+
.pops-panel-select .el-select__wrapper.is-focused,
|
|
932
1039
|
.pops-panel-select-multiple .el-select__wrapper.is-focused {
|
|
933
1040
|
--el-border-color: var(--el-color-primary);
|
|
934
1041
|
}
|
|
1042
|
+
.pops-panel-select .el-select__selection,
|
|
935
1043
|
.pops-panel-select-multiple .el-select__selection {
|
|
936
1044
|
position: relative;
|
|
937
1045
|
display: flex;
|
|
@@ -941,6 +1049,16 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
941
1049
|
min-width: 0;
|
|
942
1050
|
gap: 6px;
|
|
943
1051
|
}
|
|
1052
|
+
.pops-panel-select .el-select__selection[data-selected-text-align="left"] {
|
|
1053
|
+
justify-content: left;
|
|
1054
|
+
}
|
|
1055
|
+
.pops-panel-select .el-select__selection[data-selected-text-align="center"] {
|
|
1056
|
+
justify-content: center;
|
|
1057
|
+
}
|
|
1058
|
+
.pops-panel-select .el-select__selection[data-selected-text-align="right"] {
|
|
1059
|
+
justify-content: right;
|
|
1060
|
+
}
|
|
1061
|
+
.pops-panel-select .el-select__selected-item,
|
|
944
1062
|
.pops-panel-select-multiple .el-select__selected-item {
|
|
945
1063
|
display: flex;
|
|
946
1064
|
flex-wrap: wrap;
|
|
@@ -949,15 +1067,24 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
949
1067
|
-ms-user-select: none;
|
|
950
1068
|
user-select: none;
|
|
951
1069
|
}
|
|
1070
|
+
.pops-panel-select .el-select__selected-item span {
|
|
1071
|
+
overflow: hidden;
|
|
1072
|
+
white-space: nowrap;
|
|
1073
|
+
text-overflow: ellipsis;
|
|
1074
|
+
}
|
|
1075
|
+
.pops-panel-select .el-select__selected-item.el-select__choose_tag .el-tag,
|
|
952
1076
|
.pops-panel-select-multiple .el-select__selected-item.el-select__choose_tag .el-tag {
|
|
953
1077
|
max-width: 200px;
|
|
954
1078
|
}
|
|
1079
|
+
.pops-panel-select .el-select__input-wrapper,
|
|
955
1080
|
.pops-panel-select-multiple .el-select__input-wrapper {
|
|
956
1081
|
max-width: 100%;
|
|
957
1082
|
}
|
|
1083
|
+
.pops-panel-select .el-select__selection.is-near,
|
|
958
1084
|
.pops-panel-select-multiple .el-select__selection.is-near {
|
|
959
1085
|
margin-left: -8px;
|
|
960
1086
|
}
|
|
1087
|
+
.pops-panel-select .el-select__placeholder,
|
|
961
1088
|
.pops-panel-select-multiple .el-select__placeholder {
|
|
962
1089
|
position: absolute;
|
|
963
1090
|
display: block;
|
|
@@ -969,6 +1096,7 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
969
1096
|
white-space: nowrap;
|
|
970
1097
|
color: var(--el-input-text-color, var(--el-text-color-regular));
|
|
971
1098
|
}
|
|
1099
|
+
.pops-panel-select .el-select__placeholder.is-transparent,
|
|
972
1100
|
.pops-panel-select-multiple .el-select__placeholder.is-transparent {
|
|
973
1101
|
-webkit-user-select: none;
|
|
974
1102
|
-moz-user-select: none;
|
|
@@ -976,6 +1104,8 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
976
1104
|
user-select: none;
|
|
977
1105
|
color: var(--el-text-color-placeholder);
|
|
978
1106
|
}
|
|
1107
|
+
.pops-panel-select .el-select__prefix,
|
|
1108
|
+
.pops-panel-select .el-select__suffix,
|
|
979
1109
|
.pops-panel-select-multiple .el-select__prefix,
|
|
980
1110
|
.pops-panel-select-multiple .el-select__suffix {
|
|
981
1111
|
display: flex;
|
|
@@ -984,6 +1114,7 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
984
1114
|
gap: 6px;
|
|
985
1115
|
color: var(--el-input-icon-color, var(--el-text-color-placeholder));
|
|
986
1116
|
}
|
|
1117
|
+
.pops-panel-select .el-icon,
|
|
987
1118
|
.pops-panel-select-multiple .el-icon {
|
|
988
1119
|
--color: inherit;
|
|
989
1120
|
height: 1em;
|
|
@@ -998,10 +1129,12 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
998
1129
|
color: var(--color);
|
|
999
1130
|
font-size: inherit;
|
|
1000
1131
|
}
|
|
1132
|
+
.pops-panel-select .el-icon svg,
|
|
1001
1133
|
.pops-panel-select-multiple .el-icon svg {
|
|
1002
1134
|
height: 1em;
|
|
1003
1135
|
width: 1em;
|
|
1004
1136
|
}
|
|
1137
|
+
.pops-panel-select .el-select__caret,
|
|
1005
1138
|
.pops-panel-select-multiple .el-select__caret {
|
|
1006
1139
|
color: var(--el-select-input-color);
|
|
1007
1140
|
font-size: var(--el-select-input-font-size);
|
|
@@ -1010,6 +1143,7 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
1010
1143
|
cursor: pointer;
|
|
1011
1144
|
}
|
|
1012
1145
|
/* 把箭头旋转 */
|
|
1146
|
+
.pops-panel-select[data-show-option] .el-select__caret,
|
|
1013
1147
|
.pops-panel-select-multiple[data-show-option] .el-select__caret {
|
|
1014
1148
|
transform: rotate(180deg);
|
|
1015
1149
|
}
|
|
@@ -1085,19 +1219,20 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
1085
1219
|
text-overflow: ellipsis;
|
|
1086
1220
|
white-space: nowrap;
|
|
1087
1221
|
}
|
|
1088
|
-
|
|
1222
|
+
/* 禁用样式 */
|
|
1223
|
+
.pops-panel-select-disable {
|
|
1089
1224
|
--el-fill-color-blank: #f5f7fa;
|
|
1090
1225
|
--color: #a8abb2;
|
|
1091
1226
|
--el-border-color: #cbcbcb;
|
|
1092
1227
|
}
|
|
1093
|
-
.pops-panel-select-
|
|
1228
|
+
.pops-panel-select-disable .el-tag.el-tag--info {
|
|
1094
1229
|
--el-tag-bg-color: #e7e7e7;
|
|
1095
1230
|
--el-tag-text-color: var(--pops-components-is-disabled-text-color);
|
|
1096
1231
|
}
|
|
1097
|
-
.pops-panel-select-
|
|
1098
|
-
.pops-panel-select-
|
|
1099
|
-
.pops-panel-select-
|
|
1100
|
-
.pops-panel-select-
|
|
1232
|
+
.pops-panel-select-disable .el-select__selection .el-tag,
|
|
1233
|
+
.pops-panel-select-disable .el-tag .el-tag__close:hover,
|
|
1234
|
+
.pops-panel-select-disable .el-select__wrapper,
|
|
1235
|
+
.pops-panel-select-disable .el-select__caret {
|
|
1101
1236
|
cursor: not-allowed;
|
|
1102
1237
|
}
|
|
1103
1238
|
/* select-multiple的CSS*/
|
|
@@ -1146,8 +1281,8 @@ section.pops-panel-container .pops-panel-forms-container-item ul li.pops-panel-d
|
|
|
1146
1281
|
section.pops-panel-deepMenu-container .pops-panel-container-header-ul li.pops-panel-deepMenu-container-header {
|
|
1147
1282
|
display: flex;
|
|
1148
1283
|
align-items: center;
|
|
1149
|
-
width: -webkit-fill-available;
|
|
1150
1284
|
width: -moz-available;
|
|
1285
|
+
width: -webkit-fill-available;
|
|
1151
1286
|
padding: var(--pops-panel-forms-header-padding-top-bottom)
|
|
1152
1287
|
calc(
|
|
1153
1288
|
var(--pops-panel-forms-margin-left-right) + var(--pops-panel-forms-container-li-padding-left-right) -
|
|
@@ -1,13 +1,47 @@
|
|
|
1
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
35
|
export interface PopsPanelInputConfig extends PopsPanelGeneralConfig<PopsPanelInputConfig> {
|
|
7
36
|
/**
|
|
8
|
-
*
|
|
37
|
+
* 组件类型
|
|
9
38
|
*/
|
|
10
39
|
type: "input";
|
|
40
|
+
/**
|
|
41
|
+
* (可选)输入框类型
|
|
42
|
+
* @default "text"
|
|
43
|
+
*/
|
|
44
|
+
inputType?: PopsPanelInputType;
|
|
11
45
|
/**
|
|
12
46
|
* 显示在左边的文字
|
|
13
47
|
*/
|
|
@@ -24,32 +58,33 @@ export interface PopsPanelInputConfig extends PopsPanelGeneralConfig<PopsPanelIn
|
|
|
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
|
}
|
|
@@ -6,11 +6,11 @@ import type { PopsPanelGeneralConfig } from "./components-common";
|
|
|
6
6
|
*/
|
|
7
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
|
}
|
|
@@ -1,13 +1,105 @@
|
|
|
1
1
|
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
2
2
|
import type { PopsPanelContainerConfig } from "./components-container";
|
|
3
3
|
import type { PopsPanelViewConfig } from ".";
|
|
4
|
+
import type { PopsAlertConfig } from "../../alert/types";
|
|
5
|
+
export type PopsPanelSelectMode = "native" | "dialog" | "horizontal";
|
|
4
6
|
|
|
7
|
+
/**
|
|
8
|
+
* 分组配置
|
|
9
|
+
*
|
|
10
|
+
* 用在mode="dialog"里
|
|
11
|
+
*/
|
|
12
|
+
export type PopsPanelSelectDialogGroupOption<T> = {
|
|
13
|
+
/**
|
|
14
|
+
* 是否是分组
|
|
15
|
+
* @default false
|
|
16
|
+
*
|
|
17
|
+
* + true 这时候text的值是显示的分组名,value是可以忽略的
|
|
18
|
+
*/
|
|
19
|
+
isGroup?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* 分组内部选择是否是单选
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
isSingleSelect?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* 分组数据列表
|
|
27
|
+
*
|
|
28
|
+
* 该数据仅在mode === "dialog"下生效
|
|
29
|
+
* @default []
|
|
30
|
+
*/
|
|
31
|
+
groupDataOptions?: IFunction<Omit<PopsPanelSelectDataOption<T>, keyof PopsPanelSelectDialogGroupOption<T>>[]>;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* 选择项的配置数据
|
|
35
|
+
*/
|
|
36
|
+
export type PopsPanelSelectDataOption<T> = {
|
|
37
|
+
/**
|
|
38
|
+
* 真正的值
|
|
39
|
+
*/
|
|
40
|
+
value: T;
|
|
41
|
+
/**
|
|
42
|
+
* 显示的文字
|
|
43
|
+
*/
|
|
44
|
+
text:
|
|
45
|
+
| string
|
|
46
|
+
| ((
|
|
47
|
+
/** 当前的值 */
|
|
48
|
+
value: T,
|
|
49
|
+
/**当前选中的配置信息 */
|
|
50
|
+
selectedInfo?: PopsPanelSelectDataOption<T>
|
|
51
|
+
) => string);
|
|
52
|
+
/**
|
|
53
|
+
* 显示的文字是否是html
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
56
|
+
isHTML?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* (可选)是否禁用项
|
|
59
|
+
* 触发条件:
|
|
60
|
+
* + 点击select元素
|
|
61
|
+
* + select元素触发change事件
|
|
62
|
+
* @param value 当前的值
|
|
63
|
+
* @param selectedInfo 当前选中的配置信息
|
|
64
|
+
*/
|
|
65
|
+
disable?(value: T, selectedInfo?: PopsPanelSelectDataOption<T>): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* 子配置,跟随切换改变
|
|
68
|
+
*
|
|
69
|
+
* 选中项后,根据配置添加到页面中
|
|
70
|
+
*/
|
|
71
|
+
views?: IFunction<(PopsPanelContainerConfig | PopsPanelViewConfig)[]>;
|
|
72
|
+
/**
|
|
73
|
+
* (可选)是否是自定义输入的内容
|
|
74
|
+
* @default false
|
|
75
|
+
*/
|
|
76
|
+
addCustomInput?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* (可选)自定义输入内容存储的key
|
|
79
|
+
*
|
|
80
|
+
* 该属性内部未做处理,仅为传递作用
|
|
81
|
+
*/
|
|
82
|
+
customInputStoreKey?: string;
|
|
83
|
+
/**
|
|
84
|
+
* (可选)校验自定义输入内容
|
|
85
|
+
* @default () => {valid: true}
|
|
86
|
+
*/
|
|
87
|
+
onValid?(dataOption: PopsPanelSelectDataOption<T>): {
|
|
88
|
+
/**
|
|
89
|
+
*
|
|
90
|
+
* + true: 校验通过
|
|
91
|
+
* + false: 校验失败,阻止关闭弹窗
|
|
92
|
+
*/
|
|
93
|
+
valid: boolean;
|
|
94
|
+
message?: string;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
5
97
|
/**
|
|
6
98
|
* pops.panel的 select
|
|
7
99
|
*/
|
|
8
|
-
export interface PopsPanelSelectConfig<T = any> extends PopsPanelGeneralConfig<PopsPanelSelectConfig
|
|
100
|
+
export interface PopsPanelSelectConfig<T = any> extends PopsPanelGeneralConfig<PopsPanelSelectConfig<T>> {
|
|
9
101
|
/**
|
|
10
|
-
*
|
|
102
|
+
* 组件类型
|
|
11
103
|
*/
|
|
12
104
|
type: "select";
|
|
13
105
|
/**
|
|
@@ -23,48 +115,55 @@ export interface PopsPanelSelectConfig<T = any> extends PopsPanelGeneralConfig<P
|
|
|
23
115
|
* (可选)是否禁用
|
|
24
116
|
* @default false
|
|
25
117
|
*/
|
|
26
|
-
disabled?: boolean
|
|
118
|
+
disabled?: IFunction<boolean>;
|
|
119
|
+
/**
|
|
120
|
+
* 提示文字
|
|
121
|
+
*/
|
|
122
|
+
placeholder?: IFunction<string>;
|
|
123
|
+
/**
|
|
124
|
+
* 已选中文字的显示文字的对齐方式
|
|
125
|
+
*
|
|
126
|
+
* 也包括提示文字的对齐方式
|
|
127
|
+
* @default "left"
|
|
128
|
+
*/
|
|
129
|
+
selectedTextAlign?: "left" | "center" | "right";
|
|
27
130
|
/**
|
|
28
131
|
* 获取该项的值的回调函数
|
|
29
132
|
*/
|
|
30
133
|
getValue(): T;
|
|
31
134
|
/**
|
|
32
135
|
* 选择器的值改变触发的回调函数
|
|
33
|
-
* @param
|
|
34
|
-
* @param isSelectedValue 当前选中的值,也就是元素属性上的__value__
|
|
35
|
-
* @param isSelectedText 当前选中的文本
|
|
136
|
+
* @param isSelectedInfo 当前已选中的信息,可能为空
|
|
36
137
|
*/
|
|
37
|
-
callback?(
|
|
138
|
+
callback?(isSelectedInfo?: PopsPanelSelectDataOption<T>): void;
|
|
38
139
|
/**
|
|
39
140
|
* 点击select元素触发该回调
|
|
40
141
|
* @param event 点击事件
|
|
41
142
|
* @param selectElement 当前的select元素
|
|
143
|
+
* @returns
|
|
144
|
+
* + false 阻止更新状态
|
|
42
145
|
*/
|
|
43
|
-
clickCallBack?(
|
|
146
|
+
clickCallBack?(
|
|
147
|
+
event: PointerEvent | MouseEvent,
|
|
148
|
+
/** 当前已选中的信息 */
|
|
149
|
+
isSelectedInfo: PopsPanelSelectDataOption<T>
|
|
150
|
+
): void | boolean;
|
|
44
151
|
/**
|
|
45
|
-
*
|
|
152
|
+
* 选择列表内的数据
|
|
46
153
|
*/
|
|
47
|
-
data:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
disable?(value: T): boolean;
|
|
63
|
-
/**
|
|
64
|
-
* 子配置,跟随切换改变
|
|
65
|
-
*/
|
|
66
|
-
views?:
|
|
67
|
-
| (PopsPanelContainerConfig | PopsPanelViewConfig)[]
|
|
68
|
-
| (() => (PopsPanelContainerConfig | PopsPanelViewConfig)[]);
|
|
69
|
-
}[];
|
|
154
|
+
data: IFunction<PopsPanelSelectDataOption<T>[]>;
|
|
155
|
+
/**
|
|
156
|
+
* 显示模式
|
|
157
|
+
* @default "native"
|
|
158
|
+
*/
|
|
159
|
+
mode?: PopsPanelSelectMode;
|
|
160
|
+
/**
|
|
161
|
+
* 宽度
|
|
162
|
+
* @default "200px"
|
|
163
|
+
*/
|
|
164
|
+
width?: number | string;
|
|
165
|
+
/**
|
|
166
|
+
* 弹出的下拉列表弹窗的配置
|
|
167
|
+
*/
|
|
168
|
+
selectConfirmDialogConfig?: Partial<PopsAlertConfig>;
|
|
70
169
|
}
|