|
|
@ -8,6 +8,7 @@ export class IconCombo extends Widget { |
|
|
|
static xtype = "bi.icon_combo"; |
|
|
|
static xtype = "bi.icon_combo"; |
|
|
|
|
|
|
|
|
|
|
|
static EVENT_CHANGE = "EVENT_CHANGE"; |
|
|
|
static EVENT_CHANGE = "EVENT_CHANGE"; |
|
|
|
|
|
|
|
static EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; |
|
|
|
|
|
|
|
|
|
|
|
_defaultConfig() { |
|
|
|
_defaultConfig() { |
|
|
|
return extend(super._defaultConfig(...arguments), { |
|
|
|
return extend(super._defaultConfig(...arguments), { |
|
|
@ -55,18 +56,18 @@ export class IconCombo extends Widget { |
|
|
|
value: o.value, |
|
|
|
value: o.value, |
|
|
|
isShowDown: o.isShowDown, |
|
|
|
isShowDown: o.isShowDown, |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.popup = createWidget(o.popup, { |
|
|
|
this.popupEl = createWidget(o.popup, { |
|
|
|
type: IconComboPopup.xtype, |
|
|
|
type: IconComboPopup.xtype, |
|
|
|
chooseType: o.chooseType, |
|
|
|
chooseType: o.chooseType, |
|
|
|
items: o.items, |
|
|
|
items: o.items, |
|
|
|
value: o.value, |
|
|
|
value: o.value, |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.popup.on(IconComboPopup.EVENT_CHANGE, () => { |
|
|
|
this.popupEl.on(IconComboPopup.EVENT_CHANGE, () => { |
|
|
|
this.setValue(this.popup.getValue()); |
|
|
|
this.setValue(this.popupEl.getValue()); |
|
|
|
this.iconCombo.hideView(); |
|
|
|
this.iconCombo.hideView(); |
|
|
|
this.fireEvent(IconCombo.EVENT_CHANGE); |
|
|
|
this.fireEvent(IconCombo.EVENT_CHANGE); |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.popup.on(Controller.EVENT_CHANGE, (...args) => { |
|
|
|
this.popupEl.on(Controller.EVENT_CHANGE, (...args) => { |
|
|
|
this.fireEvent(Controller.EVENT_CHANGE, ...args); |
|
|
|
this.fireEvent(Controller.EVENT_CHANGE, ...args); |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.iconCombo = createWidget({ |
|
|
|
this.iconCombo = createWidget({ |
|
|
@ -82,11 +83,20 @@ export class IconCombo extends Widget { |
|
|
|
el: this.trigger, |
|
|
|
el: this.trigger, |
|
|
|
hideWhenAnotherComboOpen: o.hideWhenAnotherComboOpen, |
|
|
|
hideWhenAnotherComboOpen: o.hideWhenAnotherComboOpen, |
|
|
|
popup: { |
|
|
|
popup: { |
|
|
|
el: this.popup, |
|
|
|
el: this.popupEl, |
|
|
|
maxWidth: o.maxWidth, |
|
|
|
maxWidth: o.maxWidth, |
|
|
|
maxHeight: o.maxHeight, |
|
|
|
maxHeight: o.maxHeight, |
|
|
|
minWidth: o.minWidth, |
|
|
|
minWidth: o.minWidth, |
|
|
|
|
|
|
|
ref: (ref) => { |
|
|
|
|
|
|
|
this.popup = ref; |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
listeners: [{ |
|
|
|
|
|
|
|
eventName: Combo.EVENT_BEFORE_POPUPVIEW, |
|
|
|
|
|
|
|
action: () => { |
|
|
|
|
|
|
|
this.fireEvent(IconCombo.EVENT_BEFORE_POPUPVIEW); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}], |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -100,15 +110,19 @@ export class IconCombo extends Widget { |
|
|
|
|
|
|
|
|
|
|
|
setValue(v) { |
|
|
|
setValue(v) { |
|
|
|
this.trigger.setValue(v); |
|
|
|
this.trigger.setValue(v); |
|
|
|
this.popup.setValue(v); |
|
|
|
this.popupEl.setValue(v); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
getValue() { |
|
|
|
getValue() { |
|
|
|
const value = this.popup.getValue(); |
|
|
|
const value = this.popupEl.getValue(); |
|
|
|
|
|
|
|
|
|
|
|
return isNull(value) ? [] : isArray(value) ? value : [value]; |
|
|
|
return isNull(value) ? [] : isArray(value) ? value : [value]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getPopup() { |
|
|
|
|
|
|
|
return this.popup; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
populate(items) { |
|
|
|
populate(items) { |
|
|
|
this.options.items = items; |
|
|
|
this.options.items = items; |
|
|
|
this.iconCombo.populate(items); |
|
|
|
this.iconCombo.populate(items); |
|
|
|