Browse Source

还原与包装

es6
windy 6 years ago
parent
commit
5d5fbd2c9c
  1. 10
      demo/js/case/combo/demo.search_text_value_combo.js
  2. 14
      dist/_fineui.min.js
  3. 4
      dist/base.js
  4. 78
      dist/bundle.js
  5. 16
      dist/bundle.min.js
  6. 10
      dist/demo.js
  7. 78
      dist/fineui.js
  8. 14
      dist/fineui.min.js
  9. 74
      dist/widget.js
  10. 4
      src/base/single/single.js
  11. 57
      src/component/allvaluemultitextvaluecombo/allvalue.multitextvalue.combo.js
  12. 16
      src/widget/searchmultitextvaluecombo/multitextvalue.combo.search.js

10
demo/js/case/combo/demo.search_text_value_combo.js

@ -60,9 +60,9 @@ Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
value: 10 value: 10
}] }]
}, { }, {
type: "bi.search_multi_text_value_combo", type: "bi.all_value_multi_text_value_combo",
items: Demo.CONSTANTS.ITEMS, items: Demo.CONSTANTS.ITEMS,
text: "请选择", text: "提示文本",
width: 200, width: 200,
value: { value: {
type: 1, type: 1,
@ -70,7 +70,13 @@ Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
}, },
ref: function () { ref: function () {
searchCombo = this; searchCombo = this;
},
listeners: [{
eventName: "BI.AllValueMultiTextValueCombo.EVENT_CONFIRM",
action: function () {
BI.Msg.toast(JSON.stringify(searchCombo.getValue()));
} }
}]
}, { }, {
type: "bi.button", type: "bi.button",
text: "setValue(3)", text: "setValue(3)",

14
dist/_fineui.min.js vendored

File diff suppressed because one or more lines are too long

4
dist/base.js vendored

@ -342,9 +342,9 @@ BI.Single = BI.inherit(BI.Widget, {
warningTitle: null, warningTitle: null,
tipType: null, // success或warning tipType: null, // success或warning
value: null, value: null,
belowMouse: false, // title是否跟随鼠标, belowMouse: false // title是否跟随鼠标,
// 之所以默认为body,是因为transform的效果影响 // 之所以默认为body,是因为transform的效果影响
container: "body" // container: "body"
}); });
}, },

78
dist/bundle.js vendored

@ -36257,9 +36257,9 @@ BI.Single = BI.inherit(BI.Widget, {
warningTitle: null, warningTitle: null,
tipType: null, // success或warning tipType: null, // success或warning
value: null, value: null,
belowMouse: false, // title是否跟随鼠标, belowMouse: false // title是否跟随鼠标,
// 之所以默认为body,是因为transform的效果影响 // 之所以默认为body,是因为transform的效果影响
container: "body" // container: "body"
}); });
}, },
@ -104555,11 +104555,7 @@ BI.SearchMultiTextValueCombo = BI.inherit(BI.Single, {
}, },
setValue: function (v) { setValue: function (v) {
var obj = { this.storeValue = BI.deepClone(v || {});
type: BI.Selection.Multi,
value: v || []
};
this.storeValue = BI.deepClone(obj);
this._updateAllValue(); this._updateAllValue();
this._assertValue(this.storeValue); this._assertValue(this.storeValue);
this.combo.setValue(this.storeValue); this.combo.setValue(this.storeValue);
@ -104567,15 +104563,7 @@ BI.SearchMultiTextValueCombo = BI.inherit(BI.Single, {
}, },
getValue: function () { getValue: function () {
var obj = BI.deepClone(this.storeValue), self = this; return BI.deepClone(this.storeValue);
if(obj.type === BI.Selection.All) {
var values = [];
BI.each(this.options.items, function (idx, item) {
!BI.contains(self.storeValue.value, item.value) && values.push(item.value);
});
return values;
}
return obj.value;
}, },
_populate: function () { _populate: function () {
@ -112580,7 +112568,63 @@ BI.AllValueChooserPane = BI.inherit(BI.AbstractAllValueChooser, {
} }
}); });
BI.AllValueChooserPane.EVENT_CHANGE = "AllValueChooserPane.EVENT_CHANGE"; BI.AllValueChooserPane.EVENT_CHANGE = "AllValueChooserPane.EVENT_CHANGE";
BI.shortcut("bi.all_value_chooser_pane", BI.AllValueChooserPane);BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { BI.shortcut("bi.all_value_chooser_pane", BI.AllValueChooserPane);BI.AllValueMultiTextValueCombo = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-all-value-multi-text-value-combo",
width: 200,
height: 30,
items: []
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.search_multi_text_value_combo",
text: o.text,
height: o.height,
items: o.items,
value: o.value,
valueFormatter: o.valueFormatter,
listeners: [{
eventName: BI.SearchMultiTextValueCombo.EVENT_CONFIRM,
action: function () {
self.fireEvent(BI.AllValueMultiTextValueCombo.EVENT_CONFIRM);
}
}],
ref: function () {
self.combo = this;
}
};
},
setValue: function (v) {
this.combo.setValue({
type: BI.Selection.Multi,
value: v || []
});
},
getValue: function () {
var obj = this.combo.getValue() || {};
obj.value = obj.value || [];
if(obj.type === BI.Selection.All) {
var values = [];
BI.each(this.options.items, function (idx, item) {
!BI.contains(obj.value, item.value) && values.push(item.value);
});
return values;
}
return obj.value || [];
},
populate: function (items) {
this.options.items = items;
this.combo.populate.apply(this, arguments);
}
});
BI.AllValueMultiTextValueCombo.EVENT_CONFIRM = "AllValueMultiTextValueCombo.EVENT_CONFIRM";
BI.shortcut("bi.all_value_multi_text_value_combo", BI.AllValueMultiTextValueCombo);BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
_const: { _const: {
perPage: 100 perPage: 100

16
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

10
dist/demo.js vendored

@ -2131,9 +2131,9 @@ Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
value: 10 value: 10
}] }]
}, { }, {
type: "bi.search_multi_text_value_combo", type: "bi.all_value_multi_text_value_combo",
items: Demo.CONSTANTS.ITEMS, items: Demo.CONSTANTS.ITEMS,
text: "请选择", text: "提示文本",
width: 200, width: 200,
value: { value: {
type: 1, type: 1,
@ -2141,7 +2141,13 @@ Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
}, },
ref: function () { ref: function () {
searchCombo = this; searchCombo = this;
},
listeners: [{
eventName: "BI.AllValueMultiTextValueCombo.EVENT_CONFIRM",
action: function () {
BI.Msg.toast(JSON.stringify(searchCombo.getValue()));
} }
}]
}, { }, {
type: "bi.button", type: "bi.button",
text: "setValue(3)", text: "setValue(3)",

78
dist/fineui.js vendored

@ -36506,9 +36506,9 @@ BI.Single = BI.inherit(BI.Widget, {
warningTitle: null, warningTitle: null,
tipType: null, // success或warning tipType: null, // success或warning
value: null, value: null,
belowMouse: false, // title是否跟随鼠标, belowMouse: false // title是否跟随鼠标,
// 之所以默认为body,是因为transform的效果影响 // 之所以默认为body,是因为transform的效果影响
container: "body" // container: "body"
}); });
}, },
@ -104804,11 +104804,7 @@ BI.SearchMultiTextValueCombo = BI.inherit(BI.Single, {
}, },
setValue: function (v) { setValue: function (v) {
var obj = { this.storeValue = BI.deepClone(v || {});
type: BI.Selection.Multi,
value: v || []
};
this.storeValue = BI.deepClone(obj);
this._updateAllValue(); this._updateAllValue();
this._assertValue(this.storeValue); this._assertValue(this.storeValue);
this.combo.setValue(this.storeValue); this.combo.setValue(this.storeValue);
@ -104816,15 +104812,7 @@ BI.SearchMultiTextValueCombo = BI.inherit(BI.Single, {
}, },
getValue: function () { getValue: function () {
var obj = BI.deepClone(this.storeValue), self = this; return BI.deepClone(this.storeValue);
if(obj.type === BI.Selection.All) {
var values = [];
BI.each(this.options.items, function (idx, item) {
!BI.contains(self.storeValue.value, item.value) && values.push(item.value);
});
return values;
}
return obj.value;
}, },
_populate: function () { _populate: function () {
@ -112829,7 +112817,63 @@ BI.AllValueChooserPane = BI.inherit(BI.AbstractAllValueChooser, {
} }
}); });
BI.AllValueChooserPane.EVENT_CHANGE = "AllValueChooserPane.EVENT_CHANGE"; BI.AllValueChooserPane.EVENT_CHANGE = "AllValueChooserPane.EVENT_CHANGE";
BI.shortcut("bi.all_value_chooser_pane", BI.AllValueChooserPane);BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { BI.shortcut("bi.all_value_chooser_pane", BI.AllValueChooserPane);BI.AllValueMultiTextValueCombo = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-all-value-multi-text-value-combo",
width: 200,
height: 30,
items: []
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.search_multi_text_value_combo",
text: o.text,
height: o.height,
items: o.items,
value: o.value,
valueFormatter: o.valueFormatter,
listeners: [{
eventName: BI.SearchMultiTextValueCombo.EVENT_CONFIRM,
action: function () {
self.fireEvent(BI.AllValueMultiTextValueCombo.EVENT_CONFIRM);
}
}],
ref: function () {
self.combo = this;
}
};
},
setValue: function (v) {
this.combo.setValue({
type: BI.Selection.Multi,
value: v || []
});
},
getValue: function () {
var obj = this.combo.getValue() || {};
obj.value = obj.value || [];
if(obj.type === BI.Selection.All) {
var values = [];
BI.each(this.options.items, function (idx, item) {
!BI.contains(obj.value, item.value) && values.push(item.value);
});
return values;
}
return obj.value || [];
},
populate: function (items) {
this.options.items = items;
this.combo.populate.apply(this, arguments);
}
});
BI.AllValueMultiTextValueCombo.EVENT_CONFIRM = "AllValueMultiTextValueCombo.EVENT_CONFIRM";
BI.shortcut("bi.all_value_multi_text_value_combo", BI.AllValueMultiTextValueCombo);BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
_const: { _const: {
perPage: 100 perPage: 100

14
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

74
dist/widget.js vendored

@ -16549,11 +16549,7 @@ BI.SearchMultiTextValueCombo = BI.inherit(BI.Single, {
}, },
setValue: function (v) { setValue: function (v) {
var obj = { this.storeValue = BI.deepClone(v || {});
type: BI.Selection.Multi,
value: v || []
};
this.storeValue = BI.deepClone(obj);
this._updateAllValue(); this._updateAllValue();
this._assertValue(this.storeValue); this._assertValue(this.storeValue);
this.combo.setValue(this.storeValue); this.combo.setValue(this.storeValue);
@ -16561,15 +16557,7 @@ BI.SearchMultiTextValueCombo = BI.inherit(BI.Single, {
}, },
getValue: function () { getValue: function () {
var obj = BI.deepClone(this.storeValue), self = this; return BI.deepClone(this.storeValue);
if(obj.type === BI.Selection.All) {
var values = [];
BI.each(this.options.items, function (idx, item) {
!BI.contains(self.storeValue.value, item.value) && values.push(item.value);
});
return values;
}
return obj.value;
}, },
_populate: function () { _populate: function () {
@ -24574,7 +24562,63 @@ BI.AllValueChooserPane = BI.inherit(BI.AbstractAllValueChooser, {
} }
}); });
BI.AllValueChooserPane.EVENT_CHANGE = "AllValueChooserPane.EVENT_CHANGE"; BI.AllValueChooserPane.EVENT_CHANGE = "AllValueChooserPane.EVENT_CHANGE";
BI.shortcut("bi.all_value_chooser_pane", BI.AllValueChooserPane);BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { BI.shortcut("bi.all_value_chooser_pane", BI.AllValueChooserPane);BI.AllValueMultiTextValueCombo = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-all-value-multi-text-value-combo",
width: 200,
height: 30,
items: []
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.search_multi_text_value_combo",
text: o.text,
height: o.height,
items: o.items,
value: o.value,
valueFormatter: o.valueFormatter,
listeners: [{
eventName: BI.SearchMultiTextValueCombo.EVENT_CONFIRM,
action: function () {
self.fireEvent(BI.AllValueMultiTextValueCombo.EVENT_CONFIRM);
}
}],
ref: function () {
self.combo = this;
}
};
},
setValue: function (v) {
this.combo.setValue({
type: BI.Selection.Multi,
value: v || []
});
},
getValue: function () {
var obj = this.combo.getValue() || {};
obj.value = obj.value || [];
if(obj.type === BI.Selection.All) {
var values = [];
BI.each(this.options.items, function (idx, item) {
!BI.contains(obj.value, item.value) && values.push(item.value);
});
return values;
}
return obj.value || [];
},
populate: function (items) {
this.options.items = items;
this.combo.populate.apply(this, arguments);
}
});
BI.AllValueMultiTextValueCombo.EVENT_CONFIRM = "AllValueMultiTextValueCombo.EVENT_CONFIRM";
BI.shortcut("bi.all_value_multi_text_value_combo", BI.AllValueMultiTextValueCombo);BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
_const: { _const: {
perPage: 100 perPage: 100

4
src/base/single/single.js

@ -19,9 +19,9 @@ BI.Single = BI.inherit(BI.Widget, {
warningTitle: null, warningTitle: null,
tipType: null, // success或warning tipType: null, // success或warning
value: null, value: null,
belowMouse: false, // title是否跟随鼠标, belowMouse: false // title是否跟随鼠标,
// 之所以默认为body,是因为transform的效果影响 // 之所以默认为body,是因为transform的效果影响
container: "body" // container: "body"
}); });
}, },

57
src/component/allvaluemultitextvaluecombo/allvalue.multitextvalue.combo.js

@ -0,0 +1,57 @@
BI.AllValueMultiTextValueCombo = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-all-value-multi-text-value-combo",
width: 200,
height: 30,
items: []
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.search_multi_text_value_combo",
text: o.text,
height: o.height,
items: o.items,
value: o.value,
valueFormatter: o.valueFormatter,
listeners: [{
eventName: BI.SearchMultiTextValueCombo.EVENT_CONFIRM,
action: function () {
self.fireEvent(BI.AllValueMultiTextValueCombo.EVENT_CONFIRM);
}
}],
ref: function () {
self.combo = this;
}
};
},
setValue: function (v) {
this.combo.setValue({
type: BI.Selection.Multi,
value: v || []
});
},
getValue: function () {
var obj = this.combo.getValue() || {};
obj.value = obj.value || [];
if(obj.type === BI.Selection.All) {
var values = [];
BI.each(this.options.items, function (idx, item) {
!BI.contains(obj.value, item.value) && values.push(item.value);
});
return values;
}
return obj.value || [];
},
populate: function (items) {
this.options.items = items;
this.combo.populate.apply(this, arguments);
}
});
BI.AllValueMultiTextValueCombo.EVENT_CONFIRM = "AllValueMultiTextValueCombo.EVENT_CONFIRM";
BI.shortcut("bi.all_value_multi_text_value_combo", BI.AllValueMultiTextValueCombo);

16
src/widget/searchmultitextvaluecombo/multitextvalue.combo.search.js

@ -442,11 +442,7 @@ BI.SearchMultiTextValueCombo = BI.inherit(BI.Single, {
}, },
setValue: function (v) { setValue: function (v) {
var obj = { this.storeValue = BI.deepClone(v || {});
type: BI.Selection.Multi,
value: v || []
};
this.storeValue = BI.deepClone(obj);
this._updateAllValue(); this._updateAllValue();
this._assertValue(this.storeValue); this._assertValue(this.storeValue);
this.combo.setValue(this.storeValue); this.combo.setValue(this.storeValue);
@ -454,15 +450,7 @@ BI.SearchMultiTextValueCombo = BI.inherit(BI.Single, {
}, },
getValue: function () { getValue: function () {
var obj = BI.deepClone(this.storeValue), self = this; return BI.deepClone(this.storeValue);
if(obj.type === BI.Selection.All) {
var values = [];
BI.each(this.options.items, function (idx, item) {
!BI.contains(self.storeValue.value, item.value) && values.push(item.value);
});
return values;
}
return obj.value;
}, },
_populate: function () { _populate: function () {

Loading…
Cancel
Save