|
|
@ -22,6 +22,7 @@ export class TextValueCombo extends Widget { |
|
|
|
static xtype = "bi.text_value_combo"; |
|
|
|
static xtype = "bi.text_value_combo"; |
|
|
|
|
|
|
|
|
|
|
|
static EVENT_CHANGE = "EVENT_CHANGE"; |
|
|
|
static EVENT_CHANGE = "EVENT_CHANGE"; |
|
|
|
|
|
|
|
static EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; |
|
|
|
|
|
|
|
|
|
|
|
_defaultConfig(config) { |
|
|
|
_defaultConfig(config) { |
|
|
|
return extend(super._defaultConfig(...arguments), { |
|
|
|
return extend(super._defaultConfig(...arguments), { |
|
|
@ -43,13 +44,13 @@ export class TextValueCombo extends Widget { |
|
|
|
const o = this.options; |
|
|
|
const o = this.options; |
|
|
|
o.value = isFunction(o.value) |
|
|
|
o.value = isFunction(o.value) |
|
|
|
? this.__watch(o.value, (context, newValue) => { |
|
|
|
? this.__watch(o.value, (context, newValue) => { |
|
|
|
this.setValue(newValue); |
|
|
|
this.setValue(newValue); |
|
|
|
}) |
|
|
|
}) |
|
|
|
: o.value; |
|
|
|
: o.value; |
|
|
|
o.items = isFunction(o.items) |
|
|
|
o.items = isFunction(o.items) |
|
|
|
? this.__watch(o.items, (context, newValue) => { |
|
|
|
? this.__watch(o.items, (context, newValue) => { |
|
|
|
this.populate(newValue); |
|
|
|
this.populate(newValue); |
|
|
|
}) |
|
|
|
}) |
|
|
|
: o.items; |
|
|
|
: o.items; |
|
|
|
super._init(...arguments); |
|
|
|
super._init(...arguments); |
|
|
|
} |
|
|
|
} |
|
|
@ -75,7 +76,7 @@ export class TextValueCombo extends Widget { |
|
|
|
|
|
|
|
|
|
|
|
const trigger = { |
|
|
|
const trigger = { |
|
|
|
type: SelectTextTrigger.xtype, |
|
|
|
type: SelectTextTrigger.xtype, |
|
|
|
ref: (ref) => (this.trigger = ref), |
|
|
|
ref: ref => (this.trigger = ref), |
|
|
|
cls: "text-value-trigger", |
|
|
|
cls: "text-value-trigger", |
|
|
|
items: o.items, |
|
|
|
items: o.items, |
|
|
|
height: toPix(o.height, o.simple ? 1 : 2), |
|
|
|
height: toPix(o.height, o.simple ? 1 : 2), |
|
|
@ -91,14 +92,14 @@ export class TextValueCombo extends Widget { |
|
|
|
this._clear(); |
|
|
|
this._clear(); |
|
|
|
this.fireEvent(TextValueCombo.EVENT_CHANGE); |
|
|
|
this.fireEvent(TextValueCombo.EVENT_CHANGE); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
], |
|
|
|
], |
|
|
|
...o.el, |
|
|
|
...o.el, |
|
|
|
}; |
|
|
|
}; |
|
|
|
let changeTag = false; |
|
|
|
let changeTag = false; |
|
|
|
const popup = { |
|
|
|
const popup = { |
|
|
|
type: TextValueComboPopup.xtype, |
|
|
|
type: TextValueComboPopup.xtype, |
|
|
|
ref: (ref) => (this.popup = ref), |
|
|
|
ref: ref => (this.popup = ref), |
|
|
|
chooseType: o.chooseType, |
|
|
|
chooseType: o.chooseType, |
|
|
|
items: o.items, |
|
|
|
items: o.items, |
|
|
|
allowSelectAll: o.allowSelectAll, |
|
|
|
allowSelectAll: o.allowSelectAll, |
|
|
@ -137,7 +138,7 @@ export class TextValueCombo extends Widget { |
|
|
|
action: (...args) => { |
|
|
|
action: (...args) => { |
|
|
|
this.combo.hideView(); |
|
|
|
this.combo.hideView(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
], |
|
|
|
], |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -145,7 +146,7 @@ export class TextValueCombo extends Widget { |
|
|
|
type: Combo.xtype, |
|
|
|
type: Combo.xtype, |
|
|
|
height: toPix(o.height, 2), |
|
|
|
height: toPix(o.height, 2), |
|
|
|
width: toPix(o.width, 2), |
|
|
|
width: toPix(o.width, 2), |
|
|
|
ref: (ref) => (this.combo = ref), |
|
|
|
ref: ref => (this.combo = ref), |
|
|
|
container: o.container, |
|
|
|
container: o.container, |
|
|
|
direction: o.direction, |
|
|
|
direction: o.direction, |
|
|
|
adjustLength: 2, |
|
|
|
adjustLength: 2, |
|
|
@ -155,16 +156,16 @@ export class TextValueCombo extends Widget { |
|
|
|
eventName: Combo.EVENT_BEFORE_POPUPVIEW, |
|
|
|
eventName: Combo.EVENT_BEFORE_POPUPVIEW, |
|
|
|
action: () => { |
|
|
|
action: () => { |
|
|
|
changeTag = false; |
|
|
|
changeTag = false; |
|
|
|
|
|
|
|
this.fireEvent(BI.TextValueCombo.EVENT_BEFORE_POPUPVIEW); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, { |
|
|
|
{ |
|
|
|
|
|
|
|
eventName: Combo.EVENT_AFTER_HIDEVIEW, |
|
|
|
eventName: Combo.EVENT_AFTER_HIDEVIEW, |
|
|
|
action: (...args) => { |
|
|
|
action: (...args) => { |
|
|
|
if (o.chooseType !== ButtonGroup.CHOOSE_TYPE_SINGLE && changeTag) { |
|
|
|
if (o.chooseType !== ButtonGroup.CHOOSE_TYPE_SINGLE && changeTag) { |
|
|
|
this.fireEvent(TextValueCombo.EVENT_CHANGE, ...args); |
|
|
|
this.fireEvent(TextValueCombo.EVENT_CHANGE, ...args); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
], |
|
|
|
], |
|
|
|
popup: { |
|
|
|
popup: { |
|
|
|
el: popup, |
|
|
|
el: popup, |
|
|
|