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 6 years ago
parent
commit
02aeeebf82
  1. 23
      demo/js/case/combo/demo.search_text_value_combo.js
  2. 14
      demo/js/case/combo/demo.text_value_combo.js
  3. 58
      dist/_fineui.min.js
  4. 2
      dist/base.js
  5. 96
      dist/bundle.js
  6. 44
      dist/bundle.min.js
  7. 37
      dist/demo.js
  8. 96
      dist/fineui.js
  9. 58
      dist/fineui.min.js
  10. 2
      dist/utils.min.js
  11. 94
      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

23
demo/js/case/combo/demo.search_text_value_combo.js

@ -6,7 +6,7 @@ Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
baseCls: "" baseCls: ""
}, },
render: function () { render: function () {
var combo; var combo, searchCombo;
return { return {
type: "bi.horizontal_auto", type: "bi.horizontal_auto",
items: [{ items: [{
@ -60,14 +60,23 @@ 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,
value: ["1", "2", "柳州市城贸金属材料有限责任公司", "3"] 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", type: "bi.button",
text: "setValue(3)", text: "setValue(3)",
@ -76,6 +85,14 @@ Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
handler: function () { handler: function () {
combo.setValue(11); combo.setValue(11);
} }
}, {
type: "bi.button",
text: "getValue()",
width: 90,
height: 25,
handler: function () {
BI.Msg.toast(JSON.stringify(searchCombo.getValue()));
}
}], }],
vgap: 20 vgap: 20
}; };

14
demo/js/case/combo/demo.text_value_combo.js

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

58
dist/_fineui.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/base.js vendored

@ -3271,7 +3271,7 @@ BI.Combo = BI.inherit(BI.Widget, {
// return; // return;
// } // }
// BI-10290 公式combo双击公式内容会收起 // 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) || (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的公式弹框需要特殊处理下 || e.target.className === "CodeMirror-cursor" || $(e.target).closest(".CodeMirror-hints").length > 0) {// BI-9887 CodeMirror的公式弹框需要特殊处理下
return; return;

96
dist/bundle.js vendored

@ -39186,7 +39186,7 @@ BI.Combo = BI.inherit(BI.Widget, {
// return; // return;
// } // }
// BI-10290 公式combo双击公式内容会收起 // 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) || (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的公式弹框需要特殊处理下 || e.target.className === "CodeMirror-cursor" || $(e.target).closest(".CodeMirror-hints").length > 0) {// BI-9887 CodeMirror的公式弹框需要特殊处理下
return; return;
@ -90229,7 +90229,6 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
adjustLength: 0, adjustLength: 0,
direction: "bottom", direction: "bottom",
trigger: "click", trigger: "click",
container: null,
stopPropagation: false, stopPropagation: false,
el: {} el: {}
}); });
@ -90897,7 +90896,7 @@ BI.shortcut("bi.down_list_popup", BI.DownListPopup);/**
date = this.getBeginDate(date, obj); date = this.getBeginDate(date, obj);
} }
return date; return BI.getDate(date.getFullYear(), date.getMonth(), date.getDate());
}, },
getBeginDate: function (date, obj) { getBeginDate: function (date, obj) {
@ -94251,7 +94250,6 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
type: "bi.sign_text_editor", type: "bi.sign_text_editor",
cls: "slider-editor-button", cls: "slider-editor-button",
text: this.options.unit, text: this.options.unit,
textAlign: "left",
allowBlank: false, allowBlank: false,
width: c.EDITOR_WIDTH, width: c.EDITOR_WIDTH,
validationChecker: function (v) { validationChecker: function (v) {
@ -94264,13 +94262,14 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
self.labelOne.element.removeClass("bi-border"); self.labelOne.element.removeClass("bi-border");
}); });
this.labelOne.on(BI.Editor.EVENT_CONFIRM, function () { this.labelOne.on(BI.Editor.EVENT_CONFIRM, function () {
var oldValueOne = self.valueOne;
var v = BI.parseFloat(this.getValue()); var v = BI.parseFloat(this.getValue());
self.valueOne = v; self.valueOne = v;
var percent = self._getPercentByValue(v); var percent = self._getPercentByValue(v);
var significantPercent = BI.parseFloat(percent.toFixed(1));// 分成1000份 var significantPercent = BI.parseFloat(percent.toFixed(1));// 分成1000份
self._setLabelOnePosition(significantPercent);
self._setSliderOnePosition(significantPercent); self._setSliderOnePosition(significantPercent);
self._setBlueTrack(); self._setBlueTrack();
self._checkLabelPosition(oldValueOne, self.valueTwo, self.valueOne, self.valueTwo);
self.fireEvent(BI.IntervalSlider.EVENT_CHANGE); self.fireEvent(BI.IntervalSlider.EVENT_CHANGE);
}); });
@ -94280,7 +94279,6 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
text: this.options.unit, text: this.options.unit,
allowBlank: false, allowBlank: false,
width: c.EDITOR_WIDTH, width: c.EDITOR_WIDTH,
textAlign: "right",
validationChecker: function (v) { validationChecker: function (v) {
return self._checkValidation(v); return self._checkValidation(v);
} }
@ -94291,13 +94289,14 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
self.labelTwo.element.removeClass("bi-border"); self.labelTwo.element.removeClass("bi-border");
}); });
this.labelTwo.on(BI.Editor.EVENT_CONFIRM, function () { this.labelTwo.on(BI.Editor.EVENT_CONFIRM, function () {
var oldValueTwo = self.valueTwo;
var v = BI.parseFloat(this.getValue()); var v = BI.parseFloat(this.getValue());
self.valueTwo = v; self.valueTwo = v;
var percent = self._getPercentByValue(v); var percent = self._getPercentByValue(v);
var significantPercent = BI.parseFloat(percent.toFixed(1)); var significantPercent = BI.parseFloat(percent.toFixed(1));
self._setLabelTwoPosition(significantPercent);
self._setSliderTwoPosition(significantPercent); self._setSliderTwoPosition(significantPercent);
self._setBlueTrack(); self._setBlueTrack();
self._checkLabelPosition(self.valueOne, oldValueTwo, self.valueOne, self.valueTwo);
self.fireEvent(BI.IntervalSlider.EVENT_CHANGE); self.fireEvent(BI.IntervalSlider.EVENT_CHANGE);
}); });
@ -94345,16 +94344,17 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
var v = this._getValueByPercent(significantPercent); var v = this._getValueByPercent(significantPercent);
v = this._assertValue(v); v = this._assertValue(v);
v = o.digit === false ? v : v.toFixed(o.digit); v = o.digit === false ? v : v.toFixed(o.digit);
var oldValueOne = this.valueOne, oldValueTwo = this.valueTwo;
if(isLeft) { if(isLeft) {
this._setLabelOnePosition(significantPercent);
this._setSliderOnePosition(significantPercent); this._setSliderOnePosition(significantPercent);
this.labelOne.setValue(v); this.labelOne.setValue(v);
this.valueOne = v; this.valueOne = v;
this._checkLabelPosition(oldValueOne, oldValueTwo, v, this.valueTwo);
}else{ }else{
this._setLabelTwoPosition(significantPercent);
this._setSliderTwoPosition(significantPercent); this._setSliderTwoPosition(significantPercent);
this.labelTwo.setValue(v); this.labelTwo.setValue(v);
this.valueTwo = v; this.valueTwo = v;
this._checkLabelPosition(oldValueOne, oldValueTwo, this.valueOne, v);
} }
this._setBlueTrack(); this._setBlueTrack();
}, },
@ -94529,14 +94529,16 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
} }
}, },
_setLabelOnePosition: function (percent) { _checkLabelPosition: function (oldValueOne, oldValueTwo, valueOne, valueTwo, isLeft) {
// this.labelOne.element.css({left: percent + "%"}); oldValueOne = BI.parseFloat(oldValueOne);
// this._checkOverlap(); oldValueTwo = BI.parseFloat(oldValueTwo);
}, valueOne = BI.parseFloat(valueOne);
valueTwo = BI.parseFloat(valueTwo);
_setLabelTwoPosition: function (percent) { if((oldValueOne <= oldValueTwo && valueOne > valueTwo) || (oldValueOne >= oldValueTwo && valueOne < valueTwo)) {
// this.labelTwo.element.css({left: percent + "%"}); var isSliderOneLeft = BI.parseFloat(this.sliderOne.element[0].style.left) < BI.parseFloat(this.sliderTwo.element[0].style.left);
// this._checkOverlap(); this.labelOne.element.css({left: isSliderOneLeft ? "0%" : "100%"});
this.labelTwo.element.css({left: isSliderOneLeft ? "100%" : "0%"});
}
}, },
_setSliderOnePosition: function (percent) { _setSliderOnePosition: function (percent) {
@ -94569,9 +94571,7 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
_setAllPosition: function (one, two) { _setAllPosition: function (one, two) {
this._setSliderOnePosition(one); this._setSliderOnePosition(one);
this._setLabelOnePosition(one);
this._setSliderTwoPosition(two); this._setSliderTwoPosition(two);
this._setLabelTwoPosition(two);
this._setBlueTrack(); this._setBlueTrack();
}, },
@ -112564,7 +112564,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

44
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

37
dist/demo.js vendored

@ -2077,7 +2077,7 @@ Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
baseCls: "" baseCls: ""
}, },
render: function () { render: function () {
var combo; var combo, searchCombo;
return { return {
type: "bi.horizontal_auto", type: "bi.horizontal_auto",
items: [{ items: [{
@ -2131,14 +2131,23 @@ 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,
value: ["1", "2", "柳州市城贸金属材料有限责任公司", "3"] 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", type: "bi.button",
text: "setValue(3)", text: "setValue(3)",
@ -2147,6 +2156,14 @@ Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
handler: function () { handler: function () {
combo.setValue(11); combo.setValue(11);
} }
}, {
type: "bi.button",
text: "getValue()",
width: 90,
height: 25,
handler: function () {
BI.Msg.toast(JSON.stringify(searchCombo.getValue()));
}
}], }],
vgap: 20 vgap: 20
}; };
@ -2205,9 +2222,9 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, {
baseCls: "" baseCls: ""
}, },
render: function () { render: function () {
var combo; var combo, wrapper;
return { return {
type: "bi.vertical", type: "bi.button_group",
items: [{ items: [{
type: "bi.text_value_combo", type: "bi.text_value_combo",
ref: function () { ref: function () {
@ -2238,17 +2255,23 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, {
value: ["1", "2", "3"] value: ["1", "2", "3"]
} }
}, { }, {
type: "bi.popup_view", type: "bi.button",
width: 90, width: 90,
height: 25, height: 25,
handler: function () { handler: function () {
combo.setValue(3); wrapper.populate();
} }
}, { }, {
type: 'bi.label', type: 'bi.label',
height: 1000 height: 1000
}], }],
ref: function () {
wrapper = this;
},
layouts: [{
type: "bi.vertical",
vgap: 20 vgap: 20
}]
}; };
} }
}); });

96
dist/fineui.js vendored

@ -39435,7 +39435,7 @@ BI.Combo = BI.inherit(BI.Widget, {
// return; // return;
// } // }
// BI-10290 公式combo双击公式内容会收起 // 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) || (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的公式弹框需要特殊处理下 || e.target.className === "CodeMirror-cursor" || $(e.target).closest(".CodeMirror-hints").length > 0) {// BI-9887 CodeMirror的公式弹框需要特殊处理下
return; return;
@ -90478,7 +90478,6 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
adjustLength: 0, adjustLength: 0,
direction: "bottom", direction: "bottom",
trigger: "click", trigger: "click",
container: null,
stopPropagation: false, stopPropagation: false,
el: {} el: {}
}); });
@ -91146,7 +91145,7 @@ BI.shortcut("bi.down_list_popup", BI.DownListPopup);/**
date = this.getBeginDate(date, obj); date = this.getBeginDate(date, obj);
} }
return date; return BI.getDate(date.getFullYear(), date.getMonth(), date.getDate());
}, },
getBeginDate: function (date, obj) { getBeginDate: function (date, obj) {
@ -94500,7 +94499,6 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
type: "bi.sign_text_editor", type: "bi.sign_text_editor",
cls: "slider-editor-button", cls: "slider-editor-button",
text: this.options.unit, text: this.options.unit,
textAlign: "left",
allowBlank: false, allowBlank: false,
width: c.EDITOR_WIDTH, width: c.EDITOR_WIDTH,
validationChecker: function (v) { validationChecker: function (v) {
@ -94513,13 +94511,14 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
self.labelOne.element.removeClass("bi-border"); self.labelOne.element.removeClass("bi-border");
}); });
this.labelOne.on(BI.Editor.EVENT_CONFIRM, function () { this.labelOne.on(BI.Editor.EVENT_CONFIRM, function () {
var oldValueOne = self.valueOne;
var v = BI.parseFloat(this.getValue()); var v = BI.parseFloat(this.getValue());
self.valueOne = v; self.valueOne = v;
var percent = self._getPercentByValue(v); var percent = self._getPercentByValue(v);
var significantPercent = BI.parseFloat(percent.toFixed(1));// 分成1000份 var significantPercent = BI.parseFloat(percent.toFixed(1));// 分成1000份
self._setLabelOnePosition(significantPercent);
self._setSliderOnePosition(significantPercent); self._setSliderOnePosition(significantPercent);
self._setBlueTrack(); self._setBlueTrack();
self._checkLabelPosition(oldValueOne, self.valueTwo, self.valueOne, self.valueTwo);
self.fireEvent(BI.IntervalSlider.EVENT_CHANGE); self.fireEvent(BI.IntervalSlider.EVENT_CHANGE);
}); });
@ -94529,7 +94528,6 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
text: this.options.unit, text: this.options.unit,
allowBlank: false, allowBlank: false,
width: c.EDITOR_WIDTH, width: c.EDITOR_WIDTH,
textAlign: "right",
validationChecker: function (v) { validationChecker: function (v) {
return self._checkValidation(v); return self._checkValidation(v);
} }
@ -94540,13 +94538,14 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
self.labelTwo.element.removeClass("bi-border"); self.labelTwo.element.removeClass("bi-border");
}); });
this.labelTwo.on(BI.Editor.EVENT_CONFIRM, function () { this.labelTwo.on(BI.Editor.EVENT_CONFIRM, function () {
var oldValueTwo = self.valueTwo;
var v = BI.parseFloat(this.getValue()); var v = BI.parseFloat(this.getValue());
self.valueTwo = v; self.valueTwo = v;
var percent = self._getPercentByValue(v); var percent = self._getPercentByValue(v);
var significantPercent = BI.parseFloat(percent.toFixed(1)); var significantPercent = BI.parseFloat(percent.toFixed(1));
self._setLabelTwoPosition(significantPercent);
self._setSliderTwoPosition(significantPercent); self._setSliderTwoPosition(significantPercent);
self._setBlueTrack(); self._setBlueTrack();
self._checkLabelPosition(self.valueOne, oldValueTwo, self.valueOne, self.valueTwo);
self.fireEvent(BI.IntervalSlider.EVENT_CHANGE); self.fireEvent(BI.IntervalSlider.EVENT_CHANGE);
}); });
@ -94594,16 +94593,17 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
var v = this._getValueByPercent(significantPercent); var v = this._getValueByPercent(significantPercent);
v = this._assertValue(v); v = this._assertValue(v);
v = o.digit === false ? v : v.toFixed(o.digit); v = o.digit === false ? v : v.toFixed(o.digit);
var oldValueOne = this.valueOne, oldValueTwo = this.valueTwo;
if(isLeft) { if(isLeft) {
this._setLabelOnePosition(significantPercent);
this._setSliderOnePosition(significantPercent); this._setSliderOnePosition(significantPercent);
this.labelOne.setValue(v); this.labelOne.setValue(v);
this.valueOne = v; this.valueOne = v;
this._checkLabelPosition(oldValueOne, oldValueTwo, v, this.valueTwo);
}else{ }else{
this._setLabelTwoPosition(significantPercent);
this._setSliderTwoPosition(significantPercent); this._setSliderTwoPosition(significantPercent);
this.labelTwo.setValue(v); this.labelTwo.setValue(v);
this.valueTwo = v; this.valueTwo = v;
this._checkLabelPosition(oldValueOne, oldValueTwo, this.valueOne, v);
} }
this._setBlueTrack(); this._setBlueTrack();
}, },
@ -94778,14 +94778,16 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
} }
}, },
_setLabelOnePosition: function (percent) { _checkLabelPosition: function (oldValueOne, oldValueTwo, valueOne, valueTwo, isLeft) {
// this.labelOne.element.css({left: percent + "%"}); oldValueOne = BI.parseFloat(oldValueOne);
// this._checkOverlap(); oldValueTwo = BI.parseFloat(oldValueTwo);
}, valueOne = BI.parseFloat(valueOne);
valueTwo = BI.parseFloat(valueTwo);
_setLabelTwoPosition: function (percent) { if((oldValueOne <= oldValueTwo && valueOne > valueTwo) || (oldValueOne >= oldValueTwo && valueOne < valueTwo)) {
// this.labelTwo.element.css({left: percent + "%"}); var isSliderOneLeft = BI.parseFloat(this.sliderOne.element[0].style.left) < BI.parseFloat(this.sliderTwo.element[0].style.left);
// this._checkOverlap(); this.labelOne.element.css({left: isSliderOneLeft ? "0%" : "100%"});
this.labelTwo.element.css({left: isSliderOneLeft ? "100%" : "0%"});
}
}, },
_setSliderOnePosition: function (percent) { _setSliderOnePosition: function (percent) {
@ -94818,9 +94820,7 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
_setAllPosition: function (one, two) { _setAllPosition: function (one, two) {
this._setSliderOnePosition(one); this._setSliderOnePosition(one);
this._setLabelOnePosition(one);
this._setSliderTwoPosition(two); this._setSliderTwoPosition(two);
this._setLabelTwoPosition(two);
this._setBlueTrack(); this._setBlueTrack();
}, },
@ -112813,7 +112813,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

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

94
dist/widget.js vendored

@ -2226,7 +2226,6 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
adjustLength: 0, adjustLength: 0,
direction: "bottom", direction: "bottom",
trigger: "click", trigger: "click",
container: null,
stopPropagation: false, stopPropagation: false,
el: {} el: {}
}); });
@ -2894,7 +2893,7 @@ BI.shortcut("bi.down_list_popup", BI.DownListPopup);/**
date = this.getBeginDate(date, obj); date = this.getBeginDate(date, obj);
} }
return date; return BI.getDate(date.getFullYear(), date.getMonth(), date.getDate());
}, },
getBeginDate: function (date, obj) { getBeginDate: function (date, obj) {
@ -6248,7 +6247,6 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
type: "bi.sign_text_editor", type: "bi.sign_text_editor",
cls: "slider-editor-button", cls: "slider-editor-button",
text: this.options.unit, text: this.options.unit,
textAlign: "left",
allowBlank: false, allowBlank: false,
width: c.EDITOR_WIDTH, width: c.EDITOR_WIDTH,
validationChecker: function (v) { validationChecker: function (v) {
@ -6261,13 +6259,14 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
self.labelOne.element.removeClass("bi-border"); self.labelOne.element.removeClass("bi-border");
}); });
this.labelOne.on(BI.Editor.EVENT_CONFIRM, function () { this.labelOne.on(BI.Editor.EVENT_CONFIRM, function () {
var oldValueOne = self.valueOne;
var v = BI.parseFloat(this.getValue()); var v = BI.parseFloat(this.getValue());
self.valueOne = v; self.valueOne = v;
var percent = self._getPercentByValue(v); var percent = self._getPercentByValue(v);
var significantPercent = BI.parseFloat(percent.toFixed(1));// 分成1000份 var significantPercent = BI.parseFloat(percent.toFixed(1));// 分成1000份
self._setLabelOnePosition(significantPercent);
self._setSliderOnePosition(significantPercent); self._setSliderOnePosition(significantPercent);
self._setBlueTrack(); self._setBlueTrack();
self._checkLabelPosition(oldValueOne, self.valueTwo, self.valueOne, self.valueTwo);
self.fireEvent(BI.IntervalSlider.EVENT_CHANGE); self.fireEvent(BI.IntervalSlider.EVENT_CHANGE);
}); });
@ -6277,7 +6276,6 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
text: this.options.unit, text: this.options.unit,
allowBlank: false, allowBlank: false,
width: c.EDITOR_WIDTH, width: c.EDITOR_WIDTH,
textAlign: "right",
validationChecker: function (v) { validationChecker: function (v) {
return self._checkValidation(v); return self._checkValidation(v);
} }
@ -6288,13 +6286,14 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
self.labelTwo.element.removeClass("bi-border"); self.labelTwo.element.removeClass("bi-border");
}); });
this.labelTwo.on(BI.Editor.EVENT_CONFIRM, function () { this.labelTwo.on(BI.Editor.EVENT_CONFIRM, function () {
var oldValueTwo = self.valueTwo;
var v = BI.parseFloat(this.getValue()); var v = BI.parseFloat(this.getValue());
self.valueTwo = v; self.valueTwo = v;
var percent = self._getPercentByValue(v); var percent = self._getPercentByValue(v);
var significantPercent = BI.parseFloat(percent.toFixed(1)); var significantPercent = BI.parseFloat(percent.toFixed(1));
self._setLabelTwoPosition(significantPercent);
self._setSliderTwoPosition(significantPercent); self._setSliderTwoPosition(significantPercent);
self._setBlueTrack(); self._setBlueTrack();
self._checkLabelPosition(self.valueOne, oldValueTwo, self.valueOne, self.valueTwo);
self.fireEvent(BI.IntervalSlider.EVENT_CHANGE); self.fireEvent(BI.IntervalSlider.EVENT_CHANGE);
}); });
@ -6342,16 +6341,17 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
var v = this._getValueByPercent(significantPercent); var v = this._getValueByPercent(significantPercent);
v = this._assertValue(v); v = this._assertValue(v);
v = o.digit === false ? v : v.toFixed(o.digit); v = o.digit === false ? v : v.toFixed(o.digit);
var oldValueOne = this.valueOne, oldValueTwo = this.valueTwo;
if(isLeft) { if(isLeft) {
this._setLabelOnePosition(significantPercent);
this._setSliderOnePosition(significantPercent); this._setSliderOnePosition(significantPercent);
this.labelOne.setValue(v); this.labelOne.setValue(v);
this.valueOne = v; this.valueOne = v;
this._checkLabelPosition(oldValueOne, oldValueTwo, v, this.valueTwo);
}else{ }else{
this._setLabelTwoPosition(significantPercent);
this._setSliderTwoPosition(significantPercent); this._setSliderTwoPosition(significantPercent);
this.labelTwo.setValue(v); this.labelTwo.setValue(v);
this.valueTwo = v; this.valueTwo = v;
this._checkLabelPosition(oldValueOne, oldValueTwo, this.valueOne, v);
} }
this._setBlueTrack(); this._setBlueTrack();
}, },
@ -6526,14 +6526,16 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
} }
}, },
_setLabelOnePosition: function (percent) { _checkLabelPosition: function (oldValueOne, oldValueTwo, valueOne, valueTwo, isLeft) {
// this.labelOne.element.css({left: percent + "%"}); oldValueOne = BI.parseFloat(oldValueOne);
// this._checkOverlap(); oldValueTwo = BI.parseFloat(oldValueTwo);
}, valueOne = BI.parseFloat(valueOne);
valueTwo = BI.parseFloat(valueTwo);
_setLabelTwoPosition: function (percent) { if((oldValueOne <= oldValueTwo && valueOne > valueTwo) || (oldValueOne >= oldValueTwo && valueOne < valueTwo)) {
// this.labelTwo.element.css({left: percent + "%"}); var isSliderOneLeft = BI.parseFloat(this.sliderOne.element[0].style.left) < BI.parseFloat(this.sliderTwo.element[0].style.left);
// this._checkOverlap(); this.labelOne.element.css({left: isSliderOneLeft ? "0%" : "100%"});
this.labelTwo.element.css({left: isSliderOneLeft ? "100%" : "0%"});
}
}, },
_setSliderOnePosition: function (percent) { _setSliderOnePosition: function (percent) {
@ -6566,9 +6568,7 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
_setAllPosition: function (one, two) { _setAllPosition: function (one, two) {
this._setSliderOnePosition(one); this._setSliderOnePosition(one);
this._setLabelOnePosition(one);
this._setSliderTwoPosition(two); this._setSliderTwoPosition(two);
this._setLabelTwoPosition(two);
this._setBlueTrack(); this._setBlueTrack();
}, },
@ -24561,7 +24561,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

2
src/base/combination/combo.js

@ -261,7 +261,7 @@ BI.Combo = BI.inherit(BI.Widget, {
// return; // return;
// } // }
// BI-10290 公式combo双击公式内容会收起 // 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) || (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的公式弹框需要特殊处理下 || e.target.className === "CodeMirror-cursor" || $(e.target).closest(".CodeMirror-hints").length > 0) {// BI-9887 CodeMirror的公式弹框需要特殊处理下
return; 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, adjustLength: 0,
direction: "bottom", direction: "bottom",
trigger: "click", trigger: "click",
container: null,
stopPropagation: false, stopPropagation: false,
el: {} el: {}
}); });

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

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

Loading…
Cancel
Save