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