|
|
|
@ -71892,7 +71892,7 @@ BI.RichEditor = BI.inherit(BI.Widget, {
|
|
|
|
|
type: "bi.combo", |
|
|
|
|
element: this, |
|
|
|
|
toggle: false, |
|
|
|
|
direction: "top", |
|
|
|
|
direction: "top,left", |
|
|
|
|
isNeedAdjustWidth: false, |
|
|
|
|
isNeedAdjustHeight: false, |
|
|
|
|
adjustLength: 1, |
|
|
|
@ -92129,14 +92129,14 @@ BI.SingleSelectSearchLoader = BI.inherit(BI.Widget, {
|
|
|
|
|
}, |
|
|
|
|
itemsCreator: function (op, callback) { |
|
|
|
|
self.storeValue && (op = BI.extend(op || {}, { |
|
|
|
|
selectedValues: self.storeValue.value |
|
|
|
|
selectedValues: [self.storeValue] |
|
|
|
|
})); |
|
|
|
|
opts.itemsCreator(op, function (ob) { |
|
|
|
|
var keyword = ob.keyword = opts.keywordGetter(); |
|
|
|
|
hasNext = ob.hasNext; |
|
|
|
|
var firstItems = []; |
|
|
|
|
if (op.times === 1 && self.storeValue) { |
|
|
|
|
var json = BI.map(self.storeValue.value, function (i, v) { |
|
|
|
|
var json = BI.map([self.storeValue], function (i, v) { |
|
|
|
|
var txt = opts.valueFormatter(v) || v; |
|
|
|
|
return { |
|
|
|
|
text: txt, |
|
|
|
@ -92202,7 +92202,7 @@ BI.SingleSelectSearchLoader = BI.inherit(BI.Widget, {
|
|
|
|
|
|
|
|
|
|
setValue: function (v) { |
|
|
|
|
//暂存的值一定是新的值,不然v改掉后,storeValue也跟着改了
|
|
|
|
|
this.storeValue = BI.deepClone(v); |
|
|
|
|
this.storeValue = v; |
|
|
|
|
this.button_group.setValue(v); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -92350,10 +92350,10 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
|
|
|
|
|
var self = this, o = this.options; |
|
|
|
|
|
|
|
|
|
var assertShowValue = function () { |
|
|
|
|
BI.isKey(self._startValue) && (self.storeValue.value = [self._startValue]); |
|
|
|
|
BI.isKey(self._startValue) && (self.storeValue = self._startValue); |
|
|
|
|
self.trigger.getSearcher().setState(self.storeValue); |
|
|
|
|
}; |
|
|
|
|
this.storeValue = {}; |
|
|
|
|
this.storeValue = ''; |
|
|
|
|
//标记正在请求数据
|
|
|
|
|
this.requesting = false; |
|
|
|
|
|
|
|
|
@ -92374,7 +92374,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
|
|
|
|
|
o.itemsCreator(op, function (res) { |
|
|
|
|
if (op.times === 1 && BI.isNotNull(op.keywords)) { |
|
|
|
|
//预防trigger内部把当前的storeValue改掉
|
|
|
|
|
self.trigger.setValue(BI.deepClone(self.getValue())); |
|
|
|
|
self.trigger.setValue(self.getValue()); |
|
|
|
|
} |
|
|
|
|
callback.apply(self, arguments); |
|
|
|
|
}); |
|
|
|
@ -92540,9 +92540,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_assertValue: function (val) { |
|
|
|
|
val || (val = {}); |
|
|
|
|
val.type || (val.type = BI.Selection.Single); |
|
|
|
|
val.value || (val.value = []); |
|
|
|
|
val || (val = ''); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_makeMap: function (values) { |
|
|
|
@ -92667,13 +92665,13 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setValue: function (v) { |
|
|
|
|
this.storeValue = v || {}; |
|
|
|
|
this.storeValue = v || ''; |
|
|
|
|
this._assertValue(this.storeValue); |
|
|
|
|
this.combo.setValue(this.storeValue); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
getValue: function () { |
|
|
|
|
return BI.deepClone(this.storeValue); |
|
|
|
|
return this.storeValue; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
populate: function () { |
|
|
|
@ -92763,16 +92761,12 @@ BI.SingleSelectList = BI.inherit(BI.Widget, {
|
|
|
|
|
this.list.addItems.apply(this.list, arguments); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setValue: function (data) { |
|
|
|
|
this.list["setValue"](data.value); |
|
|
|
|
setValue: function (v) { |
|
|
|
|
this.list.setValue([v]); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
getValue: function () { |
|
|
|
|
return { |
|
|
|
|
type: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, |
|
|
|
|
value: this.list.getValue(), |
|
|
|
|
assist: this.list.getNotSelectedValue() |
|
|
|
|
}; |
|
|
|
|
return this.list.getValue()[0]; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
empty: function () { |
|
|
|
@ -92883,13 +92877,13 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
|
|
|
|
|
itemsCreator: function (op, callback) { |
|
|
|
|
var startValue = self._startValue; |
|
|
|
|
self.storeValue && (op = BI.extend(op || {}, { |
|
|
|
|
selectedValues: self.storeValue.value |
|
|
|
|
selectedValues: [self.storeValue] |
|
|
|
|
})); |
|
|
|
|
opts.itemsCreator(op, function (ob) { |
|
|
|
|
hasNext = ob.hasNext; |
|
|
|
|
var firstItems = []; |
|
|
|
|
if (op.times === 1 && self.storeValue) { |
|
|
|
|
var json = BI.map(self.storeValue.value, function (i, v) { |
|
|
|
|
var json = BI.map([self.storeValue], function (i, v) { |
|
|
|
|
var txt = opts.valueFormatter(v) || v; |
|
|
|
|
return { |
|
|
|
|
text: txt, |
|
|
|
@ -92898,20 +92892,11 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
|
|
|
|
|
selected: false |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
if (BI.isKey(self._startValue) && !self.storeValue.value.contains(self._startValue)) { |
|
|
|
|
var txt = opts.valueFormatter(startValue) || startValue; |
|
|
|
|
json.unshift({ |
|
|
|
|
text: txt, |
|
|
|
|
value: startValue, |
|
|
|
|
title: txt, |
|
|
|
|
selected: true |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
firstItems = self._createItems(json); |
|
|
|
|
} |
|
|
|
|
callback(firstItems.concat(self._createItems(ob.items)), ob.keyword || ""); |
|
|
|
|
if (op.times === 1 && self.storeValue) { |
|
|
|
|
BI.isKey(startValue) && self.storeValue.value["pushDistinct"](startValue); |
|
|
|
|
BI.isKey(startValue) && (self.storeValue = startValue); |
|
|
|
|
self.setValue(self.storeValue); |
|
|
|
|
} |
|
|
|
|
(op.times === 1) && self._scrollToTop(); |
|
|
|
@ -92946,9 +92931,7 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_assertValue: function (val) { |
|
|
|
|
val || (val = {}); |
|
|
|
|
val.type || (val.type = BI.Selection.Single); |
|
|
|
|
val.value || (val.value = []); |
|
|
|
|
val || (val = ''); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setStartValue: function (v) { |
|
|
|
@ -92956,7 +92939,7 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setValue: function (v) { |
|
|
|
|
this.storeValue = v || {}; |
|
|
|
|
this.storeValue = v || ''; |
|
|
|
|
this._assertValue(this.storeValue); |
|
|
|
|
this.button_group.setValue(this.storeValue); |
|
|
|
|
}, |
|
|
|
@ -93043,10 +93026,6 @@ BI.SingleSelectPopupView = BI.inherit(BI.Widget, {
|
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
isAllSelected: function () { |
|
|
|
|
return this.loader.isAllSelected(); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setStartValue: function (v) { |
|
|
|
|
this.loader.setStartValue(v); |
|
|
|
|
}, |
|
|
|
@ -93164,8 +93143,8 @@ BI.SingleSelectTrigger = BI.inherit(BI.Trigger, {
|
|
|
|
|
this.searcher.setAdapter(adapter); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setValue: function (ob) { |
|
|
|
|
this.searcher.setValue(ob); |
|
|
|
|
setValue: function (v) { |
|
|
|
|
this.searcher.setValue(v); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
getKey: function () { |
|
|
|
@ -93371,22 +93350,13 @@ BI.SingleSelectSearcher = BI.inherit(BI.Widget, {
|
|
|
|
|
this.searcher.setAdapter(adapter); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setState: function (ob) { |
|
|
|
|
setState: function (v) { |
|
|
|
|
var o = this.options; |
|
|
|
|
ob || (ob = {}); |
|
|
|
|
ob.value || (ob.value = []); |
|
|
|
|
if (ob.value.length === 0) { |
|
|
|
|
v || (v = ''); |
|
|
|
|
if (v === '') { |
|
|
|
|
this.editor.setState(BI.Selection.None); |
|
|
|
|
} else { |
|
|
|
|
var state = ""; |
|
|
|
|
BI.each(ob.value, function (i, v) { |
|
|
|
|
if (i === 0) { |
|
|
|
|
state += "" + (o.valueFormatter(v + "") || v); |
|
|
|
|
} else { |
|
|
|
|
state += "," + (o.valueFormatter(v + "") || v); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
this.editor.setState(state); |
|
|
|
|
this.editor.setState(o.valueFormatter(v + "") || v); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|