|
|
@ -50,6 +50,7 @@ export class MultiSelectInsertCombo extends Single { |
|
|
|
static EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; |
|
|
|
static EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; |
|
|
|
static EVENT_CONFIRM = "EVENT_CONFIRM"; |
|
|
|
static EVENT_CONFIRM = "EVENT_CONFIRM"; |
|
|
|
static EVENT_ADD_ITEM = "EVENT_ADD_ITEM"; |
|
|
|
static EVENT_ADD_ITEM = "EVENT_ADD_ITEM"; |
|
|
|
|
|
|
|
static EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW"; |
|
|
|
|
|
|
|
|
|
|
|
_defaultConfig() { |
|
|
|
_defaultConfig() { |
|
|
|
return extend(super._defaultConfig(...arguments), { |
|
|
|
return extend(super._defaultConfig(...arguments), { |
|
|
@ -116,7 +117,7 @@ export class MultiSelectInsertCombo extends Single { |
|
|
|
self.fireEvent(MultiSelectInsertCombo.EVENT_BLUR); |
|
|
|
self.fireEvent(MultiSelectInsertCombo.EVENT_BLUR); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
this.trigger.on(MultiSelectInsertTrigger.EVENT_START, function () { |
|
|
|
this.trigger.on(MultiSelectInsertTrigger.EVENT_START, function() { |
|
|
|
self._setStartValue(""); |
|
|
|
self._setStartValue(""); |
|
|
|
this.getSearcher().setValue(self.storeValue); |
|
|
|
this.getSearcher().setValue(self.storeValue); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -124,11 +125,11 @@ export class MultiSelectInsertCombo extends Single { |
|
|
|
self._setStartValue(""); |
|
|
|
self._setStartValue(""); |
|
|
|
self.fireEvent(MultiSelectInsertCombo.EVENT_STOP); |
|
|
|
self.fireEvent(MultiSelectInsertCombo.EVENT_STOP); |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.trigger.on(MultiSelectInsertTrigger.EVENT_PAUSE, function () { |
|
|
|
this.trigger.on(MultiSelectInsertTrigger.EVENT_PAUSE, function() { |
|
|
|
self._addItem(assertShowValue, true); |
|
|
|
self._addItem(assertShowValue, true); |
|
|
|
self.fireEvent(MultiSelectInsertCombo.EVENT_ADD_ITEM, this.getSearcher().getKeyword()); |
|
|
|
self.fireEvent(MultiSelectInsertCombo.EVENT_ADD_ITEM, this.getSearcher().getKeyword()); |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.trigger.on(MultiSelectInsertTrigger.EVENT_SEARCHING, function (keywords) { |
|
|
|
this.trigger.on(MultiSelectInsertTrigger.EVENT_SEARCHING, function(keywords) { |
|
|
|
const lastKeyword = last(keywords); |
|
|
|
const lastKeyword = last(keywords); |
|
|
|
keywords = initial(keywords || []); |
|
|
|
keywords = initial(keywords || []); |
|
|
|
if (keywords.length > 0) { |
|
|
|
if (keywords.length > 0) { |
|
|
@ -150,7 +151,7 @@ export class MultiSelectInsertCombo extends Single { |
|
|
|
self.fireEvent(MultiSelectInsertCombo.EVENT_SEARCHING); |
|
|
|
self.fireEvent(MultiSelectInsertCombo.EVENT_SEARCHING); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
this.trigger.on(MultiSelectInsertTrigger.EVENT_CHANGE, function (value, obj) { |
|
|
|
this.trigger.on(MultiSelectInsertTrigger.EVENT_CHANGE, function(value, obj) { |
|
|
|
if (obj instanceof MultiSelectBar) { |
|
|
|
if (obj instanceof MultiSelectBar) { |
|
|
|
self._joinAll(this.getValue(), () => { |
|
|
|
self._joinAll(this.getValue(), () => { |
|
|
|
assertShowValue(); |
|
|
|
assertShowValue(); |
|
|
@ -236,7 +237,7 @@ export class MultiSelectInsertCombo extends Single { |
|
|
|
}, |
|
|
|
}, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
this.combo.on(Combo.EVENT_BEFORE_POPUPVIEW, function () { |
|
|
|
this.combo.on(Combo.EVENT_BEFORE_POPUPVIEW, function() { |
|
|
|
if (!this.isViewVisible()) { |
|
|
|
if (!this.isViewVisible()) { |
|
|
|
self._dataChange = false; // 标记数据是否发生变化
|
|
|
|
self._dataChange = false; // 标记数据是否发生变化
|
|
|
|
} |
|
|
|
} |
|
|
@ -255,6 +256,7 @@ export class MultiSelectInsertCombo extends Single { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
self._dataChange && self.fireEvent(MultiSelectInsertCombo.EVENT_CONFIRM); |
|
|
|
self._dataChange && self.fireEvent(MultiSelectInsertCombo.EVENT_CONFIRM); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.fireEvent(MultiSelectInsertCombo.EVENT_AFTER_HIDEVIEW); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
triggerBtn.on(TriggerIconButton.EVENT_CHANGE, () => { |
|
|
|
triggerBtn.on(TriggerIconButton.EVENT_CHANGE, () => { |
|
|
@ -280,7 +282,7 @@ export class MultiSelectInsertCombo extends Single { |
|
|
|
self.combo.showView(); |
|
|
|
self.combo.showView(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.numberCounter.on(MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW, function () { |
|
|
|
this.numberCounter.on(MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW, function() { |
|
|
|
this.updateSelectedValue(self.storeValue); |
|
|
|
this.updateSelectedValue(self.storeValue); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
@ -337,7 +339,7 @@ export class MultiSelectInsertCombo extends Single { |
|
|
|
_itemsCreator4Trigger(op, callback) { |
|
|
|
_itemsCreator4Trigger(op, callback) { |
|
|
|
const self = this, |
|
|
|
const self = this, |
|
|
|
o = this.options; |
|
|
|
o = this.options; |
|
|
|
o.itemsCreator(op, function (res) { |
|
|
|
o.itemsCreator(op, function(res) { |
|
|
|
if (op.times === 1 && isNotNull(op.keywords)) { |
|
|
|
if (op.times === 1 && isNotNull(op.keywords)) { |
|
|
|
// 预防trigger内部把当前的storeValue改掉
|
|
|
|
// 预防trigger内部把当前的storeValue改掉
|
|
|
|
self.trigger.setValue(deepClone(self.getValue())); |
|
|
|
self.trigger.setValue(deepClone(self.getValue())); |
|
|
|