@whitesev/pops 3.0.0 → 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 +1417 -579
- 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 +1417 -579
- 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 +1417 -579
- 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 +1417 -579
- 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 +1417 -579
- 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 +1417 -579
- 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 +372 -21
- 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 +956 -21
- package/dist/types/src/components/panel/index.d.ts +1 -1
- 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 +89 -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 +290 -80
- package/src/components/panel/handlerComponents.ts +1112 -461
- package/src/components/panel/index.css +85 -5
- 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 +94 -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/searchSuggestion/index.ts +20 -65
- package/src/types/global.d.ts +3 -1
|
@@ -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,10 +1074,12 @@ 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);
|
|
@@ -1010,6 +1088,7 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
1010
1088
|
cursor: pointer;
|
|
1011
1089
|
}
|
|
1012
1090
|
/* 把箭头旋转 */
|
|
1091
|
+
.pops-panel-select[data-show-option] .el-select__caret,
|
|
1013
1092
|
.pops-panel-select-multiple[data-show-option] .el-select__caret {
|
|
1014
1093
|
transform: rotate(180deg);
|
|
1015
1094
|
}
|
|
@@ -1085,6 +1164,7 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
|
|
|
1085
1164
|
text-overflow: ellipsis;
|
|
1086
1165
|
white-space: nowrap;
|
|
1087
1166
|
}
|
|
1167
|
+
/* 禁用样式 */
|
|
1088
1168
|
.pops-panel-select-multiple-disable {
|
|
1089
1169
|
--el-fill-color-blank: #f5f7fa;
|
|
1090
1170
|
--color: #a8abb2;
|
|
@@ -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,75 @@
|
|
|
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";
|
|
4
5
|
|
|
6
|
+
export interface PopsPanelSelectDataOption<T> {
|
|
7
|
+
/**
|
|
8
|
+
* 真正的值
|
|
9
|
+
*/
|
|
10
|
+
value: T;
|
|
11
|
+
/**
|
|
12
|
+
* 显示的文字
|
|
13
|
+
*/
|
|
14
|
+
text:
|
|
15
|
+
| string
|
|
16
|
+
| ((
|
|
17
|
+
/** 当前的值 */
|
|
18
|
+
value: T,
|
|
19
|
+
/**当前选中的配置信息 */
|
|
20
|
+
selectedInfo?: PopsPanelSelectDataOption<T>
|
|
21
|
+
) => string);
|
|
22
|
+
/**
|
|
23
|
+
* 显示的文字是否是html
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
isHTML?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* (可选)是否禁用项
|
|
29
|
+
* 触发条件:
|
|
30
|
+
* + 点击select元素
|
|
31
|
+
* + select元素触发change事件
|
|
32
|
+
* @param value 当前的值
|
|
33
|
+
* @param selectedInfo 当前选中的配置信息
|
|
34
|
+
*/
|
|
35
|
+
disable?(value: T, selectedInfo?: PopsPanelSelectDataOption<T>): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* 子配置,跟随切换改变
|
|
38
|
+
*
|
|
39
|
+
* 选中项后,根据配置添加到页面中
|
|
40
|
+
*/
|
|
41
|
+
views?: IFunction<(PopsPanelContainerConfig | PopsPanelViewConfig)[]>;
|
|
42
|
+
/**
|
|
43
|
+
* (可选)是否是自定义输入的内容
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
addCustomInput?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* (可选)自定义输入内容存储的key
|
|
49
|
+
*
|
|
50
|
+
* 该属性内部未做处理,仅为传递作用
|
|
51
|
+
*/
|
|
52
|
+
customInputStoreKey?: string;
|
|
53
|
+
/**
|
|
54
|
+
* (可选)校验自定义输入内容
|
|
55
|
+
* @default () => {valid: true}
|
|
56
|
+
*/
|
|
57
|
+
onValid?(dataOption: PopsPanelSelectDataOption<T>): {
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* + true: 校验通过
|
|
61
|
+
* + false: 校验失败,阻止关闭弹窗
|
|
62
|
+
*/
|
|
63
|
+
valid: boolean;
|
|
64
|
+
message?: string;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
5
67
|
/**
|
|
6
68
|
* pops.panel的 select
|
|
7
69
|
*/
|
|
8
|
-
export interface PopsPanelSelectConfig<T = any> extends PopsPanelGeneralConfig<PopsPanelSelectConfig
|
|
70
|
+
export interface PopsPanelSelectConfig<T = any> extends PopsPanelGeneralConfig<PopsPanelSelectConfig<T>> {
|
|
9
71
|
/**
|
|
10
|
-
*
|
|
72
|
+
* 组件类型
|
|
11
73
|
*/
|
|
12
74
|
type: "select";
|
|
13
75
|
/**
|
|
@@ -23,48 +85,48 @@ export interface PopsPanelSelectConfig<T = any> extends PopsPanelGeneralConfig<P
|
|
|
23
85
|
* (可选)是否禁用
|
|
24
86
|
* @default false
|
|
25
87
|
*/
|
|
26
|
-
disabled?: boolean
|
|
88
|
+
disabled?: IFunction<boolean>;
|
|
89
|
+
/**
|
|
90
|
+
* 提示文字
|
|
91
|
+
*/
|
|
92
|
+
placeholder?: IFunction<string>;
|
|
93
|
+
/**
|
|
94
|
+
* 已选中文字的显示文字的对齐方式
|
|
95
|
+
*
|
|
96
|
+
* 也包括提示文字的对齐方式
|
|
97
|
+
* @default "left"
|
|
98
|
+
*/
|
|
99
|
+
selectedTextAlign?: "left" | "center" | "right";
|
|
27
100
|
/**
|
|
28
101
|
* 获取该项的值的回调函数
|
|
29
102
|
*/
|
|
30
103
|
getValue(): T;
|
|
31
104
|
/**
|
|
32
105
|
* 选择器的值改变触发的回调函数
|
|
33
|
-
* @param
|
|
34
|
-
* @param isSelectedValue 当前选中的值,也就是元素属性上的__value__
|
|
35
|
-
* @param isSelectedText 当前选中的文本
|
|
106
|
+
* @param isSelectedInfo 当前已选中的信息,可能为空
|
|
36
107
|
*/
|
|
37
|
-
callback?(
|
|
108
|
+
callback?(isSelectedInfo?: PopsPanelSelectDataOption<T>): void;
|
|
38
109
|
/**
|
|
39
110
|
* 点击select元素触发该回调
|
|
40
111
|
* @param event 点击事件
|
|
41
112
|
* @param selectElement 当前的select元素
|
|
42
113
|
*/
|
|
43
|
-
clickCallBack?(
|
|
114
|
+
clickCallBack?(
|
|
115
|
+
event: PointerEvent | MouseEvent,
|
|
116
|
+
/** 当前已选中的信息 */
|
|
117
|
+
isSelectedInfo: PopsPanelSelectDataOption<T>
|
|
118
|
+
): void | boolean;
|
|
44
119
|
/**
|
|
45
|
-
*
|
|
120
|
+
* 选择列表内的数据
|
|
46
121
|
*/
|
|
47
|
-
data:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
* (可选)是否禁用项
|
|
58
|
-
* 触发条件:
|
|
59
|
-
* + 点击select元素
|
|
60
|
-
* + select元素触发change事件
|
|
61
|
-
*/
|
|
62
|
-
disable?(value: T): boolean;
|
|
63
|
-
/**
|
|
64
|
-
* 子配置,跟随切换改变
|
|
65
|
-
*/
|
|
66
|
-
views?:
|
|
67
|
-
| (PopsPanelContainerConfig | PopsPanelViewConfig)[]
|
|
68
|
-
| (() => (PopsPanelContainerConfig | PopsPanelViewConfig)[]);
|
|
69
|
-
}[];
|
|
122
|
+
data: IFunction<PopsPanelSelectDataOption<T>[]>;
|
|
123
|
+
/**
|
|
124
|
+
* 是否使用弹窗代替
|
|
125
|
+
* @default false
|
|
126
|
+
*/
|
|
127
|
+
useDialog?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* 弹出的下拉列表弹窗的配置
|
|
130
|
+
*/
|
|
131
|
+
selectConfirmDialogConfig?: Partial<PopsAlertConfig>;
|
|
70
132
|
}
|
|
@@ -35,9 +35,10 @@ export interface PopsPanelSelectMultipleDataOption<T> {
|
|
|
35
35
|
/**
|
|
36
36
|
* pops.panel的 select
|
|
37
37
|
*/
|
|
38
|
-
export interface PopsPanelSelectMultipleConfig<T = any>
|
|
38
|
+
export interface PopsPanelSelectMultipleConfig<T = any>
|
|
39
|
+
extends PopsPanelGeneralConfig<PopsPanelSelectMultipleConfig<T>> {
|
|
39
40
|
/**
|
|
40
|
-
*
|
|
41
|
+
* 组件类型
|
|
41
42
|
*/
|
|
42
43
|
type: "select-multiple";
|
|
43
44
|
/**
|
|
@@ -60,30 +61,20 @@ export interface PopsPanelSelectMultipleConfig<T = any> extends PopsPanelGeneral
|
|
|
60
61
|
* 获取该项的值的回调函数
|
|
61
62
|
*/
|
|
62
63
|
getValue(): T[];
|
|
63
|
-
/**
|
|
64
|
-
* 弹出的下拉列表弹窗的配置
|
|
65
|
-
*/
|
|
66
|
-
selectConfirmDialogConfig?: Partial<PopsAlertConfig>;
|
|
67
64
|
/**
|
|
68
65
|
* 选择器的值改变触发的回调函数
|
|
69
|
-
* @param
|
|
70
|
-
* @param isSelectedValue 当前选中的值,也就是元素属性上的__value__
|
|
71
|
-
* @param isSelectedText 当前选中的文本
|
|
66
|
+
* @param isSelectedInfo 当前已选中的信息
|
|
72
67
|
*/
|
|
73
|
-
callback?(
|
|
74
|
-
/** 当前已选中的信息 */
|
|
75
|
-
isSelectedInfo: PopsPanelSelectMultipleDataOption<any>[]
|
|
76
|
-
): void;
|
|
68
|
+
callback?(isSelectedInfo: PopsPanelSelectMultipleDataOption<T>[]): void;
|
|
77
69
|
/**
|
|
78
70
|
* 点击某个项的元素触发该回调
|
|
79
71
|
* @param event 点击事件
|
|
80
|
-
* @param selectElement 当前的选中的元素
|
|
81
72
|
* @returns 如果返回boolean为false,则不会触发默认的点击事件
|
|
82
73
|
*/
|
|
83
74
|
clickCallBack?(
|
|
84
75
|
event: PointerEvent | MouseEvent,
|
|
85
76
|
/** 当前已选中的信息 */
|
|
86
|
-
isSelectedInfo: PopsPanelSelectMultipleDataOption<
|
|
77
|
+
isSelectedInfo: PopsPanelSelectMultipleDataOption<T>[]
|
|
87
78
|
): void | boolean;
|
|
88
79
|
/**
|
|
89
80
|
* 点击标签tag的关闭图标触发该回调
|
|
@@ -103,7 +94,11 @@ export interface PopsPanelSelectMultipleConfig<T = any> extends PopsPanelGeneral
|
|
|
103
94
|
}
|
|
104
95
|
) => void | boolean;
|
|
105
96
|
/**
|
|
106
|
-
*
|
|
97
|
+
* 选择列表内的数据
|
|
107
98
|
*/
|
|
108
99
|
data: PopsPanelSelectMultipleDataOption<T>[];
|
|
100
|
+
/**
|
|
101
|
+
* 弹出的下拉列表弹窗的配置
|
|
102
|
+
*/
|
|
103
|
+
selectConfirmDialogConfig?: Partial<PopsAlertConfig>;
|
|
109
104
|
}
|
|
@@ -5,8 +5,7 @@ import type { PopsPanelGeneralConfig } from "./components-common";
|
|
|
5
5
|
*/
|
|
6
6
|
export interface PopsPanelSliderConfig extends PopsPanelGeneralConfig<PopsPanelSliderConfig> {
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* @default "slider"
|
|
8
|
+
* 组件类型
|
|
10
9
|
*/
|
|
11
10
|
type: "slider";
|
|
12
11
|
/**
|
|
@@ -39,7 +38,7 @@ export interface PopsPanelSliderConfig extends PopsPanelGeneralConfig<PopsPanelS
|
|
|
39
38
|
/**
|
|
40
39
|
* 获取tooltip的提示内容,可自定义,默认为slider的值
|
|
41
40
|
*/
|
|
42
|
-
getToolTipContent
|
|
41
|
+
getToolTipContent?(value: number): string;
|
|
43
42
|
/**
|
|
44
43
|
* 滑块的最小值
|
|
45
44
|
*/
|