1
- import { Section , sectionNames } from "lowcoder-design" ;
2
1
import { ChildrenTypeToDepsKeys , depsConfig } from "../../generators/withExposing" ;
3
- import { BoolControl } from "../../controls/boolControl" ;
4
- import { CustomRuleControl } from "../../controls/codeControl" ;
5
2
import { isEmpty } from "lodash" ;
6
- import { ConstructorToComp , RecordConstructorToComp } from "lowcoder-core" ;
7
- import {
8
- arrayStringExposingStateControl ,
9
- jsonExposingStateControl ,
10
- stringExposingStateControl ,
11
- } from "../../controls/codeStateControl" ;
12
- import { requiredPropertyView } from "comps/utils/propertyUtils" ;
3
+ import { RecordConstructorToComp } from "lowcoder-core" ;
4
+ import { stringExposingStateControl } from "../../controls/codeStateControl" ;
13
5
import { trans } from "i18n" ;
14
6
import { useEffect , useRef , useState } from "react" ;
15
- import { SelectInputOptionControl } from "../../controls/optionsControl" ;
16
7
import { refMethods } from "comps/generators/withMethodExposing" ;
17
8
import { blurMethod , focusWithOptions } from "comps/utils/methodUtils" ;
18
9
import { TourStepControl } from "@lowcoder-ee/comps/controls/tourStepControl" ;
@@ -55,7 +46,7 @@ export const selectInputValidate = (
55
46
56
47
export const useSelectInputValidate = ( props : ValidationParams ) => {
57
48
const [ validateState , setValidateState ] = useState ( { } ) ;
58
- const changeRef = useRef ( false )
49
+ const changeRef = useRef ( false ) ;
59
50
const propsRef = useRef < ValidationParams > ( props ) ;
60
51
propsRef . current = props ;
61
52
@@ -67,16 +58,16 @@ export const useSelectInputValidate = (props: ValidationParams) => {
67
58
selectInputValidate ( {
68
59
...propsRef . current ,
69
60
value : {
70
- value,
71
- } ,
61
+ value
62
+ }
72
63
} )
73
64
) ;
74
65
} ;
75
66
76
67
useEffect ( ( ) => {
77
- props . value . onChange ?.( defaultValue )
68
+ props . value . onChange ?.( defaultValue ) ;
78
69
} , [ defaultValue ] ) ;
79
-
70
+
80
71
useEffect ( ( ) => {
81
72
if ( ! changeRef . current ) return ;
82
73
@@ -93,7 +84,7 @@ export const useSelectInputValidate = (props: ValidationParams) => {
93
84
return [
94
85
validateState ,
95
86
// handleValidate,
96
- handleChange ,
87
+ handleChange
97
88
] as const ;
98
89
} ;
99
90
@@ -136,14 +127,33 @@ export const TourInputCommonConfig = [
136
127
name : "selectedIndex" ,
137
128
desc : trans ( "selectInput.selectedIndexDesc" ) ,
138
129
depKeys : [ "value" , "options" ] ,
139
- func : ( input ) => input . options . findIndex ?.( ( o : any ) => o . value === input . value ) ,
130
+ func : ( input ) => input . options . findIndex ?.( ( o : any ) => o . value === input . value )
140
131
} ) ,
141
132
depsConfig < ChildrenType , ChildrenTypeToDepsKeys < ChildrenType > > ( {
142
133
name : "selectedLabel" ,
143
134
desc : trans ( "selectInput.selectedLabelDesc" ) ,
144
135
depKeys : [ "value" , "options" ] ,
145
- func : ( input ) => input . options . find ?.( ( o : any ) => o . value === input . value ) ?. title ,
146
- } ) ,
136
+ func : ( input ) => input . options . find ?.( ( o : any ) => o . value === input . value ) ?. title
137
+ } )
147
138
] ;
148
139
149
140
export const selectDivRefMethods = refMethods < HTMLDivElement > ( [ focusWithOptions , blurMethod ] ) ;
141
+ let styleExample = {
142
+ "style" : { "boxShadow" : "inset 0 0 15px #fff" } ,
143
+ "color" : "rgba(40, 0, 255, .4)"
144
+ } ;
145
+
146
+ export const TourStepMaskTooltip = (
147
+ < div >
148
+ { trans ( "tour.options.mask.tooltip" ) } :
149
+ < br />
150
+ < br />
151
+ { trans ( "tour.options.mask.tooltipValidTypes" ) }
152
+ < br />
153
+ < br />
154
+ < h3 > Example:</ h3 >
155
+ < code >
156
+ { JSON . stringify ( styleExample , null , 1 ) }
157
+ </ code >
158
+ </ div >
159
+ ) ;
0 commit comments