@ -10,7 +10,7 @@ import {
VerticalAdaptLayout ,
deepClone ,
Selection ,
SIZE _CONSANTS
size
} from "@/core" ;
import { Single , Combo } from "@/base" ;
import { MultiTreeSearcher } from "./trigger/searcher.multi.tree" ;
@ -33,6 +33,7 @@ export class MultiTreeCombo extends Single {
static EVENT _CONFIRM = "EVENT_CONFIRM" ;
static EVENT _BEFORE _POPUPVIEW = "EVENT_BEFORE_POPUPVIEW" ;
static EVENT _AFTER _HIDEVIEW = "EVENT_AFTER_HIDEVIEW" ;
static EVENT _BEFORE _NUMBER _COUNTER _POPUPVIEW = "EVENT_BEFORE_NUMBER_COUNTER_POPUPVIEW" ;
_defaultConfig ( ) {
return extend ( super . _defaultConfig ( ... arguments ) , {
@ -70,13 +71,8 @@ export class MultiTreeCombo extends Single {
text : o . text ,
defaultText : o . defaultText ,
watermark : o . watermark ,
masker : {
offset : {
left : 0 ,
top : 0 ,
right : 0 ,
bottom : SIZE _CONSANTS . LIST _ITEM _HEIGHT + 1 ,
} ,
adapter : ( ) => {
return this . popup . getView ( ) ;
} ,
searcher : {
type : "bi.multi_tree_searcher" ,
@ -104,8 +100,6 @@ export class MultiTreeCombo extends Single {
type : MultiTreePopup . xtype ,
ref ( ) {
self . popup = this ;
self . trigger . setAdapter ( this ) ;
self . numberCounter . setAdapter ( this ) ;
} ,
listeners : [
{
@ -160,13 +154,14 @@ export class MultiTreeCombo extends Single {
} ) ;
} ,
maxWidth : o . isNeedAdjustWidth ? "auto" : 500 ,
... o . popup ,
} ,
isNeedAdjustWidth : o . isNeedAdjustWidth ,
value : { value : o . value || { } } ,
hideChecker ( e ) {
return (
triggerBtn . element . find ( e . target ) . length === 0 &&
self . numberCounter . element . find ( e . target ) . length === 0
size ( s elf . numberCounter . getView ( ) ? . element . find ( e . target ) ) === 0
) ;
} ,
} ) ;
@ -295,23 +290,18 @@ export class MultiTreeCombo extends Single {
} ) ;
this . numberCounter = createWidget ( {
type : "bi.multi_select_check_selected_switcher" ,
type : MultiSelectCheckSelectedSwitcher ,
el : {
// type: "bi.multi_tree_check_selected_button",
type : MultiTreeCheckSelectedButton . xtype ,
} ,
popup : {
// type: "bi.multi_tree_check_pane",
type : MultiTreeCheckPane . xtype ,
... o . popup ,
} ,
masker : {
offset : {
left : 0 ,
top : 0 ,
right : 0 ,
bottom : SIZE _CONSANTS . LIST _ITEM _HEIGHT + 1 ,
} ,
adapter : ( ) => {
return this . popup . getView ( ) ;
} ,
masker : o . masker ,
itemsCreator : o . itemsCreator ,
valueFormatter : o . valueFormatter ,
value : { value : o . value || { } } ,
@ -334,6 +324,7 @@ export class MultiTreeCombo extends Single {
want2showCounter = null ;
showCounter ( ) ;
}
this . fireEvent ( MultiTreeCombo . EVENT _BEFORE _NUMBER _COUNTER _POPUPVIEW ) ;
}
) ;
@ -443,4 +434,12 @@ export class MultiTreeCombo extends Single {
setWaterMark ( v ) {
this . trigger . setWaterMark ( v ) ;
}
getPopup ( ) {
return this . popup ;
}
getNumberCounter ( ) {
return this . numberCounter ;
}
}