Browse Source

Merge pull request #536 in VISUAL/fineui from ~WINDY/fineui:master to master

* commit 'c45bce6d3b27788d7fe91794b04783ddcdc8ee6a':
  update
  update
  uddate
  combo和single destroyed
  还原与包装
  update
  BI-27919
  update
  update
  修改下mulritextvaluecombo
  update
  更新
  update
  DEC-3303
  update
  BI-28087 slider控件可编辑区域值显示规范
es6
windy 7 years ago
parent
commit
02aeeebf82
  1. 25
      demo/js/case/combo/demo.search_text_value_combo.js
  2. 16
      demo/js/case/combo/demo.text_value_combo.js
  3. 58
      dist/_fineui.min.js
  4. 73438
      dist/base.js
  5. 228986
      dist/bundle.js
  6. 44
      dist/bundle.min.js
  7. 41
      dist/demo.js
  8. 229484
      dist/fineui.js
  9. 58
      dist/fineui.min.js
  10. 2
      dist/utils.min.js
  11. 50986
      dist/widget.js
  12. 2
      src/base/combination/combo.js
  13. 57
      src/component/allvaluemultitextvaluecombo/allvalue.multitextvalue.combo.js
  14. 1
      src/widget/downlist/combo.downlist.js
  15. 2
      src/widget/dynamicdate/dynamicdate.caculate.js
  16. 33
      src/widget/intervalslider/intervalslider.js

25
demo/js/case/combo/demo.search_text_value_combo.js

@ -6,7 +6,7 @@ Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
baseCls: ""
},
render: function () {
var combo;
var combo, searchCombo;
return {
type: "bi.horizontal_auto",
items: [{
@ -60,14 +60,23 @@ Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
value: 10
}]
}, {
type: "bi.search_multi_text_value_combo",
type: "bi.all_value_multi_text_value_combo",
items: Demo.CONSTANTS.ITEMS,
text: "请选择",
text: "提示文本",
width: 200,
value: {
type: 1,
value: ["1", "2", "柳州市城贸金属材料有限责任公司", "3"]
}
},
ref: function () {
searchCombo = this;
},
listeners: [{
eventName: "BI.AllValueMultiTextValueCombo.EVENT_CONFIRM",
action: function () {
BI.Msg.toast(JSON.stringify(searchCombo.getValue()));
}
}]
}, {
type: "bi.button",
text: "setValue(3)",
@ -76,6 +85,14 @@ Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
handler: function () {
combo.setValue(11);
}
}, {
type: "bi.button",
text: "getValue()",
width: 90,
height: 25,
handler: function () {
BI.Msg.toast(JSON.stringify(searchCombo.getValue()));
}
}],
vgap: 20
};

16
demo/js/case/combo/demo.text_value_combo.js

@ -6,9 +6,9 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, {
baseCls: ""
},
render: function () {
var combo;
var combo, wrapper;
return {
type: "bi.vertical",
type: "bi.button_group",
items: [{
type: "bi.text_value_combo",
ref: function () {
@ -39,17 +39,23 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, {
value: ["1", "2", "3"]
}
}, {
type: "bi.popup_view",
type: "bi.button",
width: 90,
height: 25,
handler: function () {
combo.setValue(3);
wrapper.populate();
}
}, {
type: 'bi.label',
height: 1000
}],
vgap: 20
ref: function () {
wrapper = this;
},
layouts: [{
type: "bi.vertical",
vgap: 20
}]
};
}
});

58
dist/_fineui.min.js vendored

File diff suppressed because one or more lines are too long

73438
dist/base.js vendored

File diff suppressed because it is too large Load Diff

228986
dist/bundle.js vendored

File diff suppressed because one or more lines are too long

44
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

41
dist/demo.js vendored

@ -2077,7 +2077,7 @@ Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
baseCls: ""
},
render: function () {
var combo;
var combo, searchCombo;
return {
type: "bi.horizontal_auto",
items: [{
@ -2131,14 +2131,23 @@ Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
value: 10
}]
}, {
type: "bi.search_multi_text_value_combo",
type: "bi.all_value_multi_text_value_combo",
items: Demo.CONSTANTS.ITEMS,
text: "请选择",
text: "提示文本",
width: 200,
value: {
type: 1,
value: ["1", "2", "柳州市城贸金属材料有限责任公司", "3"]
}
},
ref: function () {
searchCombo = this;
},
listeners: [{
eventName: "BI.AllValueMultiTextValueCombo.EVENT_CONFIRM",
action: function () {
BI.Msg.toast(JSON.stringify(searchCombo.getValue()));
}
}]
}, {
type: "bi.button",
text: "setValue(3)",
@ -2147,6 +2156,14 @@ Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
handler: function () {
combo.setValue(11);
}
}, {
type: "bi.button",
text: "getValue()",
width: 90,
height: 25,
handler: function () {
BI.Msg.toast(JSON.stringify(searchCombo.getValue()));
}
}],
vgap: 20
};
@ -2205,9 +2222,9 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, {
baseCls: ""
},
render: function () {
var combo;
var combo, wrapper;
return {
type: "bi.vertical",
type: "bi.button_group",
items: [{
type: "bi.text_value_combo",
ref: function () {
@ -2238,17 +2255,23 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, {
value: ["1", "2", "3"]
}
}, {
type: "bi.popup_view",
type: "bi.button",
width: 90,
height: 25,
handler: function () {
combo.setValue(3);
wrapper.populate();
}
}, {
type: 'bi.label',
height: 1000
}],
vgap: 20
ref: function () {
wrapper = this;
},
layouts: [{
type: "bi.vertical",
vgap: 20
}]
};
}
});

229484
dist/fineui.js vendored

File diff suppressed because one or more lines are too long

58
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

50986
dist/widget.js vendored

File diff suppressed because it is too large Load Diff

2
src/base/combination/combo.js

@ -261,7 +261,7 @@ BI.Combo = BI.inherit(BI.Widget, {
// return;
// }
// BI-10290 公式combo双击公式内容会收起
if (this.element.find(e.target).length > 0
if ((this.element.find(e.target).length > 0 && e.type !== "mousewheel")
|| (this.popupView && this.popupView.element.find(e.target).length > 0)
|| e.target.className === "CodeMirror-cursor" || $(e.target).closest(".CodeMirror-hints").length > 0) {// BI-9887 CodeMirror的公式弹框需要特殊处理下
return;

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);

1
src/widget/downlist/combo.downlist.js

@ -10,7 +10,6 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
adjustLength: 0,
direction: "bottom",
trigger: "click",
container: null,
stopPropagation: false,
el: {}
});

2
src/widget/dynamicdate/dynamicdate.caculate.js

@ -45,7 +45,7 @@
date = this.getBeginDate(date, obj);
}
return date;
return BI.getDate(date.getFullYear(), date.getMonth(), date.getDate());
},
getBeginDate: function (date, obj) {

33
src/widget/intervalslider/intervalslider.js

@ -48,7 +48,6 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
type: "bi.sign_text_editor",
cls: "slider-editor-button",
text: this.options.unit,
textAlign: "left",
allowBlank: false,
width: c.EDITOR_WIDTH,
validationChecker: function (v) {
@ -61,13 +60,14 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
self.labelOne.element.removeClass("bi-border");
});
this.labelOne.on(BI.Editor.EVENT_CONFIRM, function () {
var oldValueOne = self.valueOne;
var v = BI.parseFloat(this.getValue());
self.valueOne = v;
var percent = self._getPercentByValue(v);
var significantPercent = BI.parseFloat(percent.toFixed(1));// 分成1000份
self._setLabelOnePosition(significantPercent);
self._setSliderOnePosition(significantPercent);
self._setBlueTrack();
self._checkLabelPosition(oldValueOne, self.valueTwo, self.valueOne, self.valueTwo);
self.fireEvent(BI.IntervalSlider.EVENT_CHANGE);
});
@ -77,7 +77,6 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
text: this.options.unit,
allowBlank: false,
width: c.EDITOR_WIDTH,
textAlign: "right",
validationChecker: function (v) {
return self._checkValidation(v);
}
@ -88,13 +87,14 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
self.labelTwo.element.removeClass("bi-border");
});
this.labelTwo.on(BI.Editor.EVENT_CONFIRM, function () {
var oldValueTwo = self.valueTwo;
var v = BI.parseFloat(this.getValue());
self.valueTwo = v;
var percent = self._getPercentByValue(v);
var significantPercent = BI.parseFloat(percent.toFixed(1));
self._setLabelTwoPosition(significantPercent);
self._setSliderTwoPosition(significantPercent);
self._setBlueTrack();
self._checkLabelPosition(self.valueOne, oldValueTwo, self.valueOne, self.valueTwo);
self.fireEvent(BI.IntervalSlider.EVENT_CHANGE);
});
@ -142,16 +142,17 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
var v = this._getValueByPercent(significantPercent);
v = this._assertValue(v);
v = o.digit === false ? v : v.toFixed(o.digit);
var oldValueOne = this.valueOne, oldValueTwo = this.valueTwo;
if(isLeft) {
this._setLabelOnePosition(significantPercent);
this._setSliderOnePosition(significantPercent);
this.labelOne.setValue(v);
this.valueOne = v;
this._checkLabelPosition(oldValueOne, oldValueTwo, v, this.valueTwo);
}else{
this._setLabelTwoPosition(significantPercent);
this._setSliderTwoPosition(significantPercent);
this.labelTwo.setValue(v);
this.valueTwo = v;
this._checkLabelPosition(oldValueOne, oldValueTwo, this.valueOne, v);
}
this._setBlueTrack();
},
@ -326,14 +327,16 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
}
},
_setLabelOnePosition: function (percent) {
// this.labelOne.element.css({left: percent + "%"});
// this._checkOverlap();
},
_setLabelTwoPosition: function (percent) {
// this.labelTwo.element.css({left: percent + "%"});
// this._checkOverlap();
_checkLabelPosition: function (oldValueOne, oldValueTwo, valueOne, valueTwo, isLeft) {
oldValueOne = BI.parseFloat(oldValueOne);
oldValueTwo = BI.parseFloat(oldValueTwo);
valueOne = BI.parseFloat(valueOne);
valueTwo = BI.parseFloat(valueTwo);
if((oldValueOne <= oldValueTwo && valueOne > valueTwo) || (oldValueOne >= oldValueTwo && valueOne < valueTwo)) {
var isSliderOneLeft = BI.parseFloat(this.sliderOne.element[0].style.left) < BI.parseFloat(this.sliderTwo.element[0].style.left);
this.labelOne.element.css({left: isSliderOneLeft ? "0%" : "100%"});
this.labelTwo.element.css({left: isSliderOneLeft ? "100%" : "0%"});
}
},
_setSliderOnePosition: function (percent) {
@ -366,9 +369,7 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
_setAllPosition: function (one, two) {
this._setSliderOnePosition(one);
this._setLabelOnePosition(one);
this._setSliderTwoPosition(two);
this._setLabelTwoPosition(two);
this._setBlueTrack();
},

Loading…
Cancel
Save