@@ -169,7 +169,7 @@ window.ComponentDot = class {
169
169
delete : 'delete'
170
170
} ;
171
171
172
- constructor ( name , select , selected , limit = 0 , menu_mode = false , menu_placeholder = '' ) {
172
+ constructor ( name , select , selected , limit = 0 , menu = { } ) {
173
173
if ( ! Array . isArray ( selected ) ) {
174
174
console . error ( 'Dot param selected must be array!' ) ;
175
175
return ;
@@ -185,6 +185,7 @@ window.ComponentDot = class {
185
185
this . DOM . addEventListener ( "contextmenu" , ( e ) => {
186
186
e . preventDefault ( ) ;
187
187
} ) ;
188
+ this . menu = Object . assign ( { mode :false , placeholder :'未选择' , height :'350px' } , menu ) ;
188
189
189
190
this . selected_data = selected ;
190
191
this . select_data = [ ] ;
@@ -200,18 +201,18 @@ window.ComponentDot = class {
200
201
}
201
202
} ) ;
202
203
queue . forEach ( ( D ) => D . click ( ) ) ;
203
- if ( menu_mode === true ) this . DOM . querySelector ( '.menu-list' ) . style . display = 'none' ;
204
+ if ( this . menu . mode === true ) this . DOM . querySelector ( '.menu-list' ) . style . display = 'none' ;
204
205
} ) ;
205
- if ( menu_mode === false ) {
206
+ if ( this . menu . mode === false ) {
206
207
this . make ( selected , select ) ;
207
208
} else {
208
- this . menu_placeholder = menu_placeholder ;
209
+ this . menu_placeholder = this . menu . placeholder ;
209
210
this . menuMake ( selected , select ) ;
210
211
}
211
212
let search = this . DOM . querySelector ( `.dot-search` ) ;
212
213
search . addEventListener ( 'input' , ( ) => {
213
214
setTimeout ( ( ) => {
214
- this . search ( search , menu_mode ) ;
215
+ this . search ( search , this . menu . mode ) ;
215
216
} , 500 ) ;
216
217
} ) ;
217
218
}
@@ -253,6 +254,7 @@ window.ComponentDot = class {
253
254
254
255
let list = document . createElement ( 'div' ) ;
255
256
list . className = 'list dlp-scroll' ;
257
+ list . style . maxHeight = this . menu . height ;
256
258
257
259
let check = _component . check ;
258
260
check = check . replace ( `width="16" height="16"` , `width="12" height="12"` ) ;
@@ -1061,6 +1063,7 @@ window.ComponentLine = class {
1061
1063
}
1062
1064
} , false ) ;
1063
1065
td . appendChild ( input ) ;
1066
+ td . style . position = 'relative' ;
1064
1067
break ;
1065
1068
case 'select' :
1066
1069
td . append ( this . menuMake ( column , value , settings . options , settings . options_limit , settings . name ) ) ;
0 commit comments