Browse Source

Merge pull request #187 in FUI/fineui from ~GUY/fineui:master to master

* commit 'a5a2d2959f86652259df929c0fb39ec77f5f15be':
  update
  flex 布局IE10兼容
  update
  IE9
  统一slider
  update
  update
  BI-10727 布局
es6
guy 7 years ago
parent
commit
c01fabe8c8
  1. 20
      bi/base.js
  2. 18
      bi/core.css
  3. 125
      bi/core.js
  4. 238
      bi/widget.js
  5. 4
      demo/js/widget/slider/demo.slider.js
  6. 20
      dist/base.js
  7. 18
      dist/bundle.css
  8. 383
      dist/bundle.js
  9. 2
      dist/bundle.min.css
  10. 54
      dist/bundle.min.js
  11. 18
      dist/core.css
  12. 125
      dist/core.js
  13. 4
      dist/demo.js
  14. 2
      dist/fix/fix.js
  15. 238
      dist/widget.js
  16. 8
      src/base/collection/collection.js
  17. 8
      src/base/grid/grid.js
  18. 4
      src/base/single/button/button.basic.js
  19. 82
      src/core/inject.js
  20. 15
      src/core/model.js
  21. 20
      src/core/store.js
  22. 2
      src/css/core/wrapper/flex.center.css
  23. 6
      src/css/core/wrapper/flex.horizontal.css
  24. 4
      src/css/core/wrapper/flex.vertical.center.css
  25. 2
      src/css/core/wrapper/flex.wrapper.center.css
  26. 2
      src/css/core/wrapper/flex.wrapper.horizontal.css
  27. 2
      src/css/core/wrapper/flex.wrapper.vertical.center.css
  28. 2
      src/data/data.js
  29. 2
      src/less/core/wrapper/flex.center.less
  30. 6
      src/less/core/wrapper/flex.horizontal.less
  31. 4
      src/less/core/wrapper/flex.vertical.center.less
  32. 2
      src/less/core/wrapper/flex.wrapper.center.less
  33. 2
      src/less/core/wrapper/flex.wrapper.horizontal.less
  34. 2
      src/less/core/wrapper/flex.wrapper.vertical.center.less
  35. 14
      src/widget/arrangement/arrangement.js
  36. 15
      src/widget/intervalslider/intervalslider.js
  37. 204
      src/widget/singleslider/button/editor.sign.text.js
  38. 6
      src/widget/singleslider/singleslider.js

20
bi/base.js

@ -696,7 +696,6 @@ BI.BasicButton = BI.inherit(BI.Single, {
var mouseDown = false;
hand.mousedown(function () {
mouseDown = true;
ev(e);
});
hand.mouseup(function (e) {
if (mouseDown === true) {
@ -777,9 +776,6 @@ BI.BasicButton = BI.inherit(BI.Single, {
hand.mousedown(function (e) {
ev(e);
});
hand.mouseup(function (e) {
ev(e);
});
}
hand.click(clk);
break;
@ -2809,8 +2805,12 @@ BI.CollectionView = BI.inherit(BI.Widget, {
this.container.setHeight(this._height);
this._calculateChildrenToRender();
this.element.scrollTop(o.scrollTop);
this.element.scrollLeft(o.scrollLeft);
//元素未挂载时不能设置scrollTop
try {
this.element.scrollTop(o.scrollTop);
this.element.scrollLeft(o.scrollLeft);
} catch (e) {
}
}
},
@ -14989,8 +14989,12 @@ BI.GridView = BI.inherit(BI.Widget, {
this._rowSizeAndPositionManager = new BI.ScalingCellSizeAndPositionManager(this.rowCount, o.rowHeightGetter, o.estimatedRowSize);
this._calculateChildrenToRender();
this.element.scrollTop(o.scrollTop);
this.element.scrollLeft(o.scrollLeft);
//元素未挂载时不能设置scrollTop
try {
this.element.scrollTop(o.scrollTop);
this.element.scrollLeft(o.scrollLeft);
} catch (e) {
}
},
setScrollLeft: function (scrollLeft) {

18
bi/core.css

@ -1225,12 +1225,14 @@ i {
-moz-justify-content: center;
-ms-justify-content: center;
-o-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
/* 09版 */
-webkit-box-align: center;
/* 12版 */
-webkit-align-items: center;
-moz-align-items: center;
-ms-flex-align: center;
-ms-align-items: center;
-o-align-items: center;
align-items: center;
@ -1263,13 +1265,15 @@ i {
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
-o-justify-content: flex-start;
-ms-flex-pack: start;
justify-content: flex-start;
/* 09版 */
-webkit-box-align: flex-start;
-webkit-box-align: start;
/* 12版 */
-webkit-align-items: flex-start;
-moz-align-items: flex-start;
-ms-align-items: flex-start;
-ms-flex-align: start;
-o-align-items: flex-start;
align-items: flex-start;
/* 09版 */
@ -1288,6 +1292,7 @@ i {
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-ms-flex-align: center;
-o-align-items: center;
align-items: center;
}
@ -1298,6 +1303,7 @@ i {
-webkit-align-items: flex-end;
-moz-align-items: flex-end;
-ms-align-items: flex-end;
-ms-flex-align: end;
-o-align-items: flex-end;
align-items: flex-end;
}
@ -1329,6 +1335,7 @@ i {
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
-o-justify-content: flex-start;
-ms-flex-pack: start;
justify-content: flex-start;
/* 09版 */
-webkit-box-align: center;
@ -1336,6 +1343,7 @@ i {
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-ms-flex-align: center;
-o-align-items: center;
align-items: center;
/* 09版 */
@ -1362,6 +1370,7 @@ i {
-webkit-justify-content: center;
-moz-justify-content: center;
-ms-justify-content: center;
-ms-flex-pack: center;
-o-justify-content: center;
justify-content: center;
/* 09版 */
@ -1370,6 +1379,7 @@ i {
-webkit-align-items: stretch;
-moz-align-items: stretch;
-ms-align-items: stretch;
-ms-flex-align: stretch;
-o-align-items: stretch;
align-items: stretch;
}
@ -1400,6 +1410,7 @@ i {
-webkit-justify-content: center;
-moz-justify-content: center;
-ms-justify-content: center;
-ms-flex-pack: center;
-o-justify-content: center;
justify-content: center;
/* 09版 */
@ -1408,6 +1419,7 @@ i {
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-ms-flex-align: center;
-o-align-items: center;
align-items: center;
min-width: 100%;
@ -1441,6 +1453,7 @@ i {
-webkit-justify-content: flex-start;
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
-ms-flex-pack: start;
-o-justify-content: flex-start;
justify-content: flex-start;
/* 09版 */
@ -1449,6 +1462,7 @@ i {
-webkit-align-items: flex-start;
-moz-align-items: flex-start;
-ms-align-items: flex-start;
-ms-flex-align: start;
-o-align-items: flex-start;
align-items: flex-start;
/* 09版 */
@ -1508,6 +1522,7 @@ i {
-webkit-justify-content: flex-start;
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
-ms-flex-pack: start;
-o-justify-content: flex-start;
justify-content: flex-start;
/* 09版 */
@ -1516,6 +1531,7 @@ i {
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-ms-flex-align: center;
-o-align-items: center;
align-items: center;
/* 09版 */

125
bi/core.js

@ -20147,7 +20147,89 @@ BI.extend(BI.DOM, {
}
return this._scrollWidth;
}
});/**
});;(function () {
var constantInjection = {};
BI.constant = function (xtype, cls) {
if (constantInjection[xtype] != null) {
throw ("constant:[" + xtype + "] has been registed");
}
constantInjection[xtype] = cls;
};
var modelInjection = {};
BI.model = function (xtype, cls) {
if (modelInjection[xtype] != null) {
throw ("model:[" + xtype + "] has been registed");
}
modelInjection[xtype] = cls;
};
var storeInjection = {};
BI.stores = function (xtype, cls) {
if (storeInjection[xtype] != null) {
throw ("store:[" + xtype + "] has been registed");
}
storeInjection[xtype] = cls;
};
var providerInjection = {};
BI.provider = function (xtype, cls) {
if (providerInjection[xtype] != null) {
throw ("provider:[" + xtype + "] has been registed");
}
providerInjection[xtype] = cls;
};
BI.config = function (type, configFn) {
if (constantInjection[type]) {
return constantInjection[type] = configFn(constantInjection[type]);
}
if (providerInjection[type]) {
if (!providers[type]) {
providers[type] = new providerInjection[type]();
}
return configFn(providers[type])
}
}
BI.Constants = {
getConstant: function (type) {
return constantInjection[type];
}
}
BI.Models = {
getModel: function (type, config) {
return new modelInjection[type](config);
}
}
var stores = {};
BI.Stores = {
getStore: function (type, config) {
if (stores[type]) {
return stores[type];
}
return stores[type] = new storeInjection[type](config);
}
}
var providers = {}, providerInstance = {}
BI.Providers = {
getProvider: function (type, config) {
if (!providers[type]) {
providers[type] = new providerInjection[type]();
}
if (!providerInstance[type]) {
providerInstance[type] = new providers[type].$get()(config);
}
return providerInstance[type];
}
}
})();
/**
* guy
* 检测某个Widget的EventChange事件然后去show某个card
* @type {*|void|Object}
@ -20530,22 +20612,7 @@ BI.HorizontalFillLayoutLogic = BI.inherit(BI.Logic, {
_init: function () {
BI.HorizontalFillLayoutLogic.superclass._init.apply(this, arguments);
}
});;(function () {
var models = {};
BI.models = function (xtype, cls) {
if (models[xtype] != null) {
throw ("models:[" + xtype + "] has been registed");
}
models[xtype] = cls;
};
BI.Models = {
getModel: function (type, config) {
return new models[type](config);
}
}
})();
BI.Plugin = BI.Plugin || {};
});BI.Plugin = BI.Plugin || {};
;
(function () {
var _WidgetsPlugin = {};
@ -21718,27 +21785,7 @@ $.extend(String, {
return args[i];
});
}
});;(function () {
var kv = {};
BI.stores = function (xtype, cls) {
if (kv[xtype] != null) {
throw ("stores:[" + xtype + "] has been registed");
}
kv[xtype] = cls;
};
var stores = {};
BI.Stores = {
getStore: function (type, config) {
if (stores[type]) {
return stores[type];
}
return stores[type] = new kv[type](config);
}
}
})();
BI.EventListener = {
});BI.EventListener = {
listen: function listen(target, eventType, callback) {
if (target.addEventListener) {
target.addEventListener(eventType, callback, false);
@ -25719,7 +25766,7 @@ BI.Data = Data = {};
* 存放bi里面通用的一些常量
* @type {{}}
*/
Data.Constant = BI.Constant = BICst = {};
Data.Constant = BICst = {};
/**
* 缓冲池
* @type {{Buffer: {}}}

238
bi/widget.js

@ -1045,7 +1045,7 @@ BI.Arrangement = BI.inherit(BI.Widget, {
element: this.container
});
}
this.wrapper.populate(items);
this.wrapper.addItems(items);
},
getClientWidth: function () {
@ -1778,7 +1778,17 @@ BI.Arrangement = BI.inherit(BI.Widget, {
},
populate: function (items) {
this.regions = {};
// this.regions = {};
var self = this;
BI.each(this.regions, function (name, region) {
var exist = BI.some(items, function (i, item) {
return item.el.attr("id") === name;
});
if (!exist) {
self.regions[name].el.setVisible(false);
}
delete self.regions[name];
});
this._populate(items);
this._renderRegion();
}
@ -5620,7 +5630,9 @@ BI.IntervalSlider = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.IntervalSlider.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-interval-slider bi-slider-track"
baseCls: "bi-interval-slider bi-slider-track",
digit: false,
unit: ""
})
},
@ -5652,8 +5664,9 @@ BI.IntervalSlider = BI.inherit(BI.Widget, {
this.track = this._createTrackWrapper();
this.labelOne = BI.createWidget({
type: "bi.sign_editor",
type: "bi.sign_text_editor",
cls: "slider-editor-button",
text: this.options.unit,
errorText: "",
allowBlank: false,
width: c.EDITOR_WIDTH,
@ -5678,9 +5691,10 @@ BI.IntervalSlider = BI.inherit(BI.Widget, {
});
this.labelTwo = BI.createWidget({
type: "bi.sign_editor",
type: "bi.sign_text_editor",
cls: "slider-editor-button",
errorText: "",
text: this.options.unit,
allowBlank: false,
width: c.EDITOR_WIDTH,
validationChecker: function (v) {
@ -5741,10 +5755,12 @@ BI.IntervalSlider = BI.inherit(BI.Widget, {
},
_rePosBySizeAfterMove: function (size, isLeft) {
var o = this.options;
var percent = size * 100 / (this._getGrayTrackLength());
var significantPercent = BI.parseFloat(percent.toFixed(1));
var v = this._getValueByPercent(significantPercent);
v = this._assertValue(v);
v = o.digit === false ? v : v.toFixed(o.digit);
if(isLeft){
this._setLabelOnePosition(significantPercent);
this._setSliderOnePosition(significantPercent);
@ -6056,8 +6072,11 @@ BI.IntervalSlider = BI.inherit(BI.Widget, {
},
setValue: function (v) {
var o = this.options;
var valueOne = BI.parseFloat(v.min);
var valueTwo = BI.parseFloat(v.max);
valueOne = o.digit === false ? valueOne : valueOne.toFixed(o.digit);
valueTwo = o.digit === false ? valueTwo : valueTwo.toFixed(o.digit);
if (!isNaN(valueOne) && !isNaN(valueTwo)) {
if (this._checkValidation(valueOne)) {
this.valueOne = valueOne;
@ -17276,6 +17295,209 @@ BI.SequenceTable = BI.inherit(BI.Widget, {
}
});
BI.shortcut('bi.sequence_table', BI.SequenceTable);/**
* Created by User on 2017/11/16.
*/
BI.SignTextEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.SignTextEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-sign-initial-editor",
hgap: 4,
vgap: 2,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn,
allowBlank: true,
watermark: "",
errorText: "",
text: "",
height: 24
})
},
_init: function () {
BI.SignTextEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.editor",
height: o.height,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
value: o.value,
validationChecker: o.validationChecker,
quitChecker: o.quitChecker,
allowBlank: o.allowBlank,
watermark: o.watermark,
errorText: o.errorText
});
this.text = BI.createWidget({
type: "bi.text_button",
cls: "sign-editor-text",
title: o.title,
warningTitle: o.warningTitle,
tipType: o.tipType,
textAlign: "left",
height: o.height,
hgap: 4,
handler: function () {
self._showInput();
self.editor.focus();
self.editor.selectAll();
}
});
this.text.on(BI.TextButton.EVENT_CHANGE, function () {
BI.nextTick(function () {
self.fireEvent(BI.SignTextEditor.EVENT_CLICK_LABEL)
});
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.text,
left: 0,
right: 0,
top: 0,
bottom: 0
}]
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.editor.on(BI.Editor.EVENT_CONFIRM, function () {
self._showHint();
self._checkText();
self.fireEvent(BI.SignTextEditor.EVENT_CONFIRM, arguments);
});
this.editor.on(BI.Editor.EVENT_ERROR, function () {
self._checkText();
});
BI.createWidget({
type: "bi.vertical",
scrolly: false,
element: this,
items: [this.editor]
});
this._showHint();
self._checkText();
},
_checkText: function () {
var o = this.options;
BI.nextTick(BI.bind(function () {
if (this.editor.getValue() === "") {
this.text.setValue(o.watermark || "");
this.text.element.addClass("bi-water-mark");
} else {
var v = this.editor.getValue();
v = (BI.isEmpty(v) || v == o.text) ? o.text : v + o.text;
this.text.setValue(v);
this.text.element.removeClass("bi-water-mark");
}
}, this));
},
_showInput: function () {
this.editor.visible();
this.text.invisible();
},
_showHint: function () {
this.editor.invisible();
this.text.visible();
},
setTitle: function (title) {
this.text.setTitle(title);
},
setWarningTitle: function (title) {
this.text.setWarningTitle(title);
},
focus: function () {
this._showInput();
this.editor.focus();
},
blur: function () {
this.editor.blur();
this._showHint();
this._checkText();
},
doRedMark: function () {
if (this.editor.getValue() === "" && BI.isKey(this.options.watermark)) {
return;
}
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
if (this.editor.getValue() === "" && BI.isKey(this.options.watermark)) {
return;
}
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
isValid: function () {
return this.editor.isValid();
},
setErrorText: function (text) {
this.editor.setErrorText(text);
},
getErrorText: function () {
return this.editor.getErrorText();
},
isEditing: function () {
return this.editor.isEditing();
},
getLastValidValue: function () {
return this.editor.getLastValidValue();
},
setValue: function (v) {
this.editor.setValue(v);
this._checkText();
},
getValue: function () {
return this.editor.getValue();
},
getState: function () {
return this.text.getValue();
},
setState: function (v) {
var o = this.options;
this._showHint();
v = (BI.isEmpty(v) || v == o.text) ? o.text : v + o.text;
this.text.setValue(v);
}
});
BI.SignTextEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.sign_text_editor", BI.SignTextEditor);/**
* Created by zcf on 2016/9/22.
*/
BI.SliderIconButton = BI.inherit(BI.Widget, {
@ -17322,7 +17544,8 @@ BI.SingleSlider = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.SingleSlider.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-slider bi-slider-track",
digit: false
digit: false,
unit: ""
});
},
_init: function () {
@ -17382,9 +17605,10 @@ BI.SingleSlider = BI.inherit(BI.Widget, {
}
});
this.label = BI.createWidget({
type: "bi.sign_editor",
type: "bi.sign_text_editor",
cls: "slider-editor-button",
errorText: "",
text: o.unit,
width: c.EDITOR_WIDTH - 2,
allowBlank: false,
validationChecker: function (v) {

4
demo/js/widget/slider/demo.slider.js

@ -45,7 +45,7 @@ Demo.Slider = BI.inherit(BI.Widget, {
normalSingleSlider.populate();
var singleSliderLabel = BI.createWidget({
type: "bi.single_slider_label",
type: "bi.single_slider",
width: o.width,
height: o.height,
digit: 0,
@ -75,7 +75,7 @@ Demo.Slider = BI.inherit(BI.Widget, {
intervalSlider.populate();
var intervalSliderLabel = BI.createWidget({
type: "bi.interval_slider_label",
type: "bi.interval_slider",
width: o.width,
unit: "个",
cls: "layout-bg-white"

20
dist/base.js vendored

@ -696,7 +696,6 @@ BI.BasicButton = BI.inherit(BI.Single, {
var mouseDown = false;
hand.mousedown(function () {
mouseDown = true;
ev(e);
});
hand.mouseup(function (e) {
if (mouseDown === true) {
@ -777,9 +776,6 @@ BI.BasicButton = BI.inherit(BI.Single, {
hand.mousedown(function (e) {
ev(e);
});
hand.mouseup(function (e) {
ev(e);
});
}
hand.click(clk);
break;
@ -2809,8 +2805,12 @@ BI.CollectionView = BI.inherit(BI.Widget, {
this.container.setHeight(this._height);
this._calculateChildrenToRender();
this.element.scrollTop(o.scrollTop);
this.element.scrollLeft(o.scrollLeft);
//元素未挂载时不能设置scrollTop
try {
this.element.scrollTop(o.scrollTop);
this.element.scrollLeft(o.scrollLeft);
} catch (e) {
}
}
},
@ -14989,8 +14989,12 @@ BI.GridView = BI.inherit(BI.Widget, {
this._rowSizeAndPositionManager = new BI.ScalingCellSizeAndPositionManager(this.rowCount, o.rowHeightGetter, o.estimatedRowSize);
this._calculateChildrenToRender();
this.element.scrollTop(o.scrollTop);
this.element.scrollLeft(o.scrollLeft);
//元素未挂载时不能设置scrollTop
try {
this.element.scrollTop(o.scrollTop);
this.element.scrollLeft(o.scrollLeft);
} catch (e) {
}
},
setScrollLeft: function (scrollLeft) {

18
dist/bundle.css vendored

@ -1225,12 +1225,14 @@ i {
-moz-justify-content: center;
-ms-justify-content: center;
-o-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
/* 09版 */
-webkit-box-align: center;
/* 12版 */
-webkit-align-items: center;
-moz-align-items: center;
-ms-flex-align: center;
-ms-align-items: center;
-o-align-items: center;
align-items: center;
@ -1263,13 +1265,15 @@ i {
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
-o-justify-content: flex-start;
-ms-flex-pack: start;
justify-content: flex-start;
/* 09版 */
-webkit-box-align: flex-start;
-webkit-box-align: start;
/* 12版 */
-webkit-align-items: flex-start;
-moz-align-items: flex-start;
-ms-align-items: flex-start;
-ms-flex-align: start;
-o-align-items: flex-start;
align-items: flex-start;
/* 09版 */
@ -1288,6 +1292,7 @@ i {
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-ms-flex-align: center;
-o-align-items: center;
align-items: center;
}
@ -1298,6 +1303,7 @@ i {
-webkit-align-items: flex-end;
-moz-align-items: flex-end;
-ms-align-items: flex-end;
-ms-flex-align: end;
-o-align-items: flex-end;
align-items: flex-end;
}
@ -1329,6 +1335,7 @@ i {
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
-o-justify-content: flex-start;
-ms-flex-pack: start;
justify-content: flex-start;
/* 09版 */
-webkit-box-align: center;
@ -1336,6 +1343,7 @@ i {
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-ms-flex-align: center;
-o-align-items: center;
align-items: center;
/* 09版 */
@ -1362,6 +1370,7 @@ i {
-webkit-justify-content: center;
-moz-justify-content: center;
-ms-justify-content: center;
-ms-flex-pack: center;
-o-justify-content: center;
justify-content: center;
/* 09版 */
@ -1370,6 +1379,7 @@ i {
-webkit-align-items: stretch;
-moz-align-items: stretch;
-ms-align-items: stretch;
-ms-flex-align: stretch;
-o-align-items: stretch;
align-items: stretch;
}
@ -1400,6 +1410,7 @@ i {
-webkit-justify-content: center;
-moz-justify-content: center;
-ms-justify-content: center;
-ms-flex-pack: center;
-o-justify-content: center;
justify-content: center;
/* 09版 */
@ -1408,6 +1419,7 @@ i {
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-ms-flex-align: center;
-o-align-items: center;
align-items: center;
min-width: 100%;
@ -1441,6 +1453,7 @@ i {
-webkit-justify-content: flex-start;
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
-ms-flex-pack: start;
-o-justify-content: flex-start;
justify-content: flex-start;
/* 09版 */
@ -1449,6 +1462,7 @@ i {
-webkit-align-items: flex-start;
-moz-align-items: flex-start;
-ms-align-items: flex-start;
-ms-flex-align: start;
-o-align-items: flex-start;
align-items: flex-start;
/* 09版 */
@ -1508,6 +1522,7 @@ i {
-webkit-justify-content: flex-start;
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
-ms-flex-pack: start;
-o-justify-content: flex-start;
justify-content: flex-start;
/* 09版 */
@ -1516,6 +1531,7 @@ i {
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-ms-flex-align: center;
-o-align-items: center;
align-items: center;
/* 09版 */

383
dist/bundle.js vendored

@ -20147,7 +20147,89 @@ BI.extend(BI.DOM, {
}
return this._scrollWidth;
}
});/**
});;(function () {
var constantInjection = {};
BI.constant = function (xtype, cls) {
if (constantInjection[xtype] != null) {
throw ("constant:[" + xtype + "] has been registed");
}
constantInjection[xtype] = cls;
};
var modelInjection = {};
BI.model = function (xtype, cls) {
if (modelInjection[xtype] != null) {
throw ("model:[" + xtype + "] has been registed");
}
modelInjection[xtype] = cls;
};
var storeInjection = {};
BI.stores = function (xtype, cls) {
if (storeInjection[xtype] != null) {
throw ("store:[" + xtype + "] has been registed");
}
storeInjection[xtype] = cls;
};
var providerInjection = {};
BI.provider = function (xtype, cls) {
if (providerInjection[xtype] != null) {
throw ("provider:[" + xtype + "] has been registed");
}
providerInjection[xtype] = cls;
};
BI.config = function (type, configFn) {
if (constantInjection[type]) {
return constantInjection[type] = configFn(constantInjection[type]);
}
if (providerInjection[type]) {
if (!providers[type]) {
providers[type] = new providerInjection[type]();
}
return configFn(providers[type])
}
}
BI.Constants = {
getConstant: function (type) {
return constantInjection[type];
}
}
BI.Models = {
getModel: function (type, config) {
return new modelInjection[type](config);
}
}
var stores = {};
BI.Stores = {
getStore: function (type, config) {
if (stores[type]) {
return stores[type];
}
return stores[type] = new storeInjection[type](config);
}
}
var providers = {}, providerInstance = {}
BI.Providers = {
getProvider: function (type, config) {
if (!providers[type]) {
providers[type] = new providerInjection[type]();
}
if (!providerInstance[type]) {
providerInstance[type] = new providers[type].$get()(config);
}
return providerInstance[type];
}
}
})();
/**
* guy
* 检测某个Widget的EventChange事件然后去show某个card
* @type {*|void|Object}
@ -20530,22 +20612,7 @@ BI.HorizontalFillLayoutLogic = BI.inherit(BI.Logic, {
_init: function () {
BI.HorizontalFillLayoutLogic.superclass._init.apply(this, arguments);
}
});;(function () {
var models = {};
BI.models = function (xtype, cls) {
if (models[xtype] != null) {
throw ("models:[" + xtype + "] has been registed");
}
models[xtype] = cls;
};
BI.Models = {
getModel: function (type, config) {
return new models[type](config);
}
}
})();
BI.Plugin = BI.Plugin || {};
});BI.Plugin = BI.Plugin || {};
;
(function () {
var _WidgetsPlugin = {};
@ -21718,27 +21785,7 @@ $.extend(String, {
return args[i];
});
}
});;(function () {
var kv = {};
BI.stores = function (xtype, cls) {
if (kv[xtype] != null) {
throw ("stores:[" + xtype + "] has been registed");
}
kv[xtype] = cls;
};
var stores = {};
BI.Stores = {
getStore: function (type, config) {
if (stores[type]) {
return stores[type];
}
return stores[type] = new kv[type](config);
}
}
})();
BI.EventListener = {
});BI.EventListener = {
listen: function listen(target, eventType, callback) {
if (target.addEventListener) {
target.addEventListener(eventType, callback, false);
@ -25719,7 +25766,7 @@ BI.Data = Data = {};
* 存放bi里面通用的一些常量
* @type {{}}
*/
Data.Constant = BI.Constant = BICst = {};
Data.Constant = BICst = {};
/**
* 缓冲池
* @type {{Buffer: {}}}
@ -26474,7 +26521,6 @@ BI.BasicButton = BI.inherit(BI.Single, {
var mouseDown = false;
hand.mousedown(function () {
mouseDown = true;
ev(e);
});
hand.mouseup(function (e) {
if (mouseDown === true) {
@ -26555,9 +26601,6 @@ BI.BasicButton = BI.inherit(BI.Single, {
hand.mousedown(function (e) {
ev(e);
});
hand.mouseup(function (e) {
ev(e);
});
}
hand.click(clk);
break;
@ -28587,8 +28630,12 @@ BI.CollectionView = BI.inherit(BI.Widget, {
this.container.setHeight(this._height);
this._calculateChildrenToRender();
this.element.scrollTop(o.scrollTop);
this.element.scrollLeft(o.scrollLeft);
//元素未挂载时不能设置scrollTop
try {
this.element.scrollTop(o.scrollTop);
this.element.scrollLeft(o.scrollLeft);
} catch (e) {
}
}
},
@ -40767,8 +40814,12 @@ BI.GridView = BI.inherit(BI.Widget, {
this._rowSizeAndPositionManager = new BI.ScalingCellSizeAndPositionManager(this.rowCount, o.rowHeightGetter, o.estimatedRowSize);
this._calculateChildrenToRender();
this.element.scrollTop(o.scrollTop);
this.element.scrollLeft(o.scrollLeft);
//元素未挂载时不能设置scrollTop
try {
this.element.scrollTop(o.scrollTop);
this.element.scrollLeft(o.scrollLeft);
} catch (e) {
}
},
setScrollLeft: function (scrollLeft) {
@ -76126,7 +76177,7 @@ BI.Arrangement = BI.inherit(BI.Widget, {
element: this.container
});
}
this.wrapper.populate(items);
this.wrapper.addItems(items);
},
getClientWidth: function () {
@ -76859,7 +76910,17 @@ BI.Arrangement = BI.inherit(BI.Widget, {
},
populate: function (items) {
this.regions = {};
// this.regions = {};
var self = this;
BI.each(this.regions, function (name, region) {
var exist = BI.some(items, function (i, item) {
return item.el.attr("id") === name;
});
if (!exist) {
self.regions[name].el.setVisible(false);
}
delete self.regions[name];
});
this._populate(items);
this._renderRegion();
}
@ -80701,7 +80762,9 @@ BI.IntervalSlider = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.IntervalSlider.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-interval-slider bi-slider-track"
baseCls: "bi-interval-slider bi-slider-track",
digit: false,
unit: ""
})
},
@ -80733,8 +80796,9 @@ BI.IntervalSlider = BI.inherit(BI.Widget, {
this.track = this._createTrackWrapper();
this.labelOne = BI.createWidget({
type: "bi.sign_editor",
type: "bi.sign_text_editor",
cls: "slider-editor-button",
text: this.options.unit,
errorText: "",
allowBlank: false,
width: c.EDITOR_WIDTH,
@ -80759,9 +80823,10 @@ BI.IntervalSlider = BI.inherit(BI.Widget, {
});
this.labelTwo = BI.createWidget({
type: "bi.sign_editor",
type: "bi.sign_text_editor",
cls: "slider-editor-button",
errorText: "",
text: this.options.unit,
allowBlank: false,
width: c.EDITOR_WIDTH,
validationChecker: function (v) {
@ -80822,10 +80887,12 @@ BI.IntervalSlider = BI.inherit(BI.Widget, {
},
_rePosBySizeAfterMove: function (size, isLeft) {
var o = this.options;
var percent = size * 100 / (this._getGrayTrackLength());
var significantPercent = BI.parseFloat(percent.toFixed(1));
var v = this._getValueByPercent(significantPercent);
v = this._assertValue(v);
v = o.digit === false ? v : v.toFixed(o.digit);
if(isLeft){
this._setLabelOnePosition(significantPercent);
this._setSliderOnePosition(significantPercent);
@ -81137,8 +81204,11 @@ BI.IntervalSlider = BI.inherit(BI.Widget, {
},
setValue: function (v) {
var o = this.options;
var valueOne = BI.parseFloat(v.min);
var valueTwo = BI.parseFloat(v.max);
valueOne = o.digit === false ? valueOne : valueOne.toFixed(o.digit);
valueTwo = o.digit === false ? valueTwo : valueTwo.toFixed(o.digit);
if (!isNaN(valueOne) && !isNaN(valueTwo)) {
if (this._checkValidation(valueOne)) {
this.valueOne = valueOne;
@ -92357,6 +92427,209 @@ BI.SequenceTable = BI.inherit(BI.Widget, {
}
});
BI.shortcut('bi.sequence_table', BI.SequenceTable);/**
* Created by User on 2017/11/16.
*/
BI.SignTextEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.SignTextEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-sign-initial-editor",
hgap: 4,
vgap: 2,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn,
allowBlank: true,
watermark: "",
errorText: "",
text: "",
height: 24
})
},
_init: function () {
BI.SignTextEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.editor",
height: o.height,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
value: o.value,
validationChecker: o.validationChecker,
quitChecker: o.quitChecker,
allowBlank: o.allowBlank,
watermark: o.watermark,
errorText: o.errorText
});
this.text = BI.createWidget({
type: "bi.text_button",
cls: "sign-editor-text",
title: o.title,
warningTitle: o.warningTitle,
tipType: o.tipType,
textAlign: "left",
height: o.height,
hgap: 4,
handler: function () {
self._showInput();
self.editor.focus();
self.editor.selectAll();
}
});
this.text.on(BI.TextButton.EVENT_CHANGE, function () {
BI.nextTick(function () {
self.fireEvent(BI.SignTextEditor.EVENT_CLICK_LABEL)
});
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.text,
left: 0,
right: 0,
top: 0,
bottom: 0
}]
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.editor.on(BI.Editor.EVENT_CONFIRM, function () {
self._showHint();
self._checkText();
self.fireEvent(BI.SignTextEditor.EVENT_CONFIRM, arguments);
});
this.editor.on(BI.Editor.EVENT_ERROR, function () {
self._checkText();
});
BI.createWidget({
type: "bi.vertical",
scrolly: false,
element: this,
items: [this.editor]
});
this._showHint();
self._checkText();
},
_checkText: function () {
var o = this.options;
BI.nextTick(BI.bind(function () {
if (this.editor.getValue() === "") {
this.text.setValue(o.watermark || "");
this.text.element.addClass("bi-water-mark");
} else {
var v = this.editor.getValue();
v = (BI.isEmpty(v) || v == o.text) ? o.text : v + o.text;
this.text.setValue(v);
this.text.element.removeClass("bi-water-mark");
}
}, this));
},
_showInput: function () {
this.editor.visible();
this.text.invisible();
},
_showHint: function () {
this.editor.invisible();
this.text.visible();
},
setTitle: function (title) {
this.text.setTitle(title);
},
setWarningTitle: function (title) {
this.text.setWarningTitle(title);
},
focus: function () {
this._showInput();
this.editor.focus();
},
blur: function () {
this.editor.blur();
this._showHint();
this._checkText();
},
doRedMark: function () {
if (this.editor.getValue() === "" && BI.isKey(this.options.watermark)) {
return;
}
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
if (this.editor.getValue() === "" && BI.isKey(this.options.watermark)) {
return;
}
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
isValid: function () {
return this.editor.isValid();
},
setErrorText: function (text) {
this.editor.setErrorText(text);
},
getErrorText: function () {
return this.editor.getErrorText();
},
isEditing: function () {
return this.editor.isEditing();
},
getLastValidValue: function () {
return this.editor.getLastValidValue();
},
setValue: function (v) {
this.editor.setValue(v);
this._checkText();
},
getValue: function () {
return this.editor.getValue();
},
getState: function () {
return this.text.getValue();
},
setState: function (v) {
var o = this.options;
this._showHint();
v = (BI.isEmpty(v) || v == o.text) ? o.text : v + o.text;
this.text.setValue(v);
}
});
BI.SignTextEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.sign_text_editor", BI.SignTextEditor);/**
* Created by zcf on 2016/9/22.
*/
BI.SliderIconButton = BI.inherit(BI.Widget, {
@ -92403,7 +92676,8 @@ BI.SingleSlider = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.SingleSlider.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-slider bi-slider-track",
digit: false
digit: false,
unit: ""
});
},
_init: function () {
@ -92463,9 +92737,10 @@ BI.SingleSlider = BI.inherit(BI.Widget, {
}
});
this.label = BI.createWidget({
type: "bi.sign_editor",
type: "bi.sign_text_editor",
cls: "slider-editor-button",
errorText: "",
text: o.unit,
width: c.EDITOR_WIDTH - 2,
allowBlank: false,
validationChecker: function (v) {

2
dist/bundle.min.css vendored

File diff suppressed because one or more lines are too long

54
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

18
dist/core.css vendored

@ -1225,12 +1225,14 @@ i {
-moz-justify-content: center;
-ms-justify-content: center;
-o-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
/* 09版 */
-webkit-box-align: center;
/* 12版 */
-webkit-align-items: center;
-moz-align-items: center;
-ms-flex-align: center;
-ms-align-items: center;
-o-align-items: center;
align-items: center;
@ -1263,13 +1265,15 @@ i {
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
-o-justify-content: flex-start;
-ms-flex-pack: start;
justify-content: flex-start;
/* 09版 */
-webkit-box-align: flex-start;
-webkit-box-align: start;
/* 12版 */
-webkit-align-items: flex-start;
-moz-align-items: flex-start;
-ms-align-items: flex-start;
-ms-flex-align: start;
-o-align-items: flex-start;
align-items: flex-start;
/* 09版 */
@ -1288,6 +1292,7 @@ i {
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-ms-flex-align: center;
-o-align-items: center;
align-items: center;
}
@ -1298,6 +1303,7 @@ i {
-webkit-align-items: flex-end;
-moz-align-items: flex-end;
-ms-align-items: flex-end;
-ms-flex-align: end;
-o-align-items: flex-end;
align-items: flex-end;
}
@ -1329,6 +1335,7 @@ i {
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
-o-justify-content: flex-start;
-ms-flex-pack: start;
justify-content: flex-start;
/* 09版 */
-webkit-box-align: center;
@ -1336,6 +1343,7 @@ i {
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-ms-flex-align: center;
-o-align-items: center;
align-items: center;
/* 09版 */
@ -1362,6 +1370,7 @@ i {
-webkit-justify-content: center;
-moz-justify-content: center;
-ms-justify-content: center;
-ms-flex-pack: center;
-o-justify-content: center;
justify-content: center;
/* 09版 */
@ -1370,6 +1379,7 @@ i {
-webkit-align-items: stretch;
-moz-align-items: stretch;
-ms-align-items: stretch;
-ms-flex-align: stretch;
-o-align-items: stretch;
align-items: stretch;
}
@ -1400,6 +1410,7 @@ i {
-webkit-justify-content: center;
-moz-justify-content: center;
-ms-justify-content: center;
-ms-flex-pack: center;
-o-justify-content: center;
justify-content: center;
/* 09版 */
@ -1408,6 +1419,7 @@ i {
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-ms-flex-align: center;
-o-align-items: center;
align-items: center;
min-width: 100%;
@ -1441,6 +1453,7 @@ i {
-webkit-justify-content: flex-start;
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
-ms-flex-pack: start;
-o-justify-content: flex-start;
justify-content: flex-start;
/* 09版 */
@ -1449,6 +1462,7 @@ i {
-webkit-align-items: flex-start;
-moz-align-items: flex-start;
-ms-align-items: flex-start;
-ms-flex-align: start;
-o-align-items: flex-start;
align-items: flex-start;
/* 09版 */
@ -1508,6 +1522,7 @@ i {
-webkit-justify-content: flex-start;
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
-ms-flex-pack: start;
-o-justify-content: flex-start;
justify-content: flex-start;
/* 09版 */
@ -1516,6 +1531,7 @@ i {
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-ms-flex-align: center;
-o-align-items: center;
align-items: center;
/* 09版 */

125
dist/core.js vendored

@ -20147,7 +20147,89 @@ BI.extend(BI.DOM, {
}
return this._scrollWidth;
}
});/**
});;(function () {
var constantInjection = {};
BI.constant = function (xtype, cls) {
if (constantInjection[xtype] != null) {
throw ("constant:[" + xtype + "] has been registed");
}
constantInjection[xtype] = cls;
};
var modelInjection = {};
BI.model = function (xtype, cls) {
if (modelInjection[xtype] != null) {
throw ("model:[" + xtype + "] has been registed");
}
modelInjection[xtype] = cls;
};
var storeInjection = {};
BI.stores = function (xtype, cls) {
if (storeInjection[xtype] != null) {
throw ("store:[" + xtype + "] has been registed");
}
storeInjection[xtype] = cls;
};
var providerInjection = {};
BI.provider = function (xtype, cls) {
if (providerInjection[xtype] != null) {
throw ("provider:[" + xtype + "] has been registed");
}
providerInjection[xtype] = cls;
};
BI.config = function (type, configFn) {
if (constantInjection[type]) {
return constantInjection[type] = configFn(constantInjection[type]);
}
if (providerInjection[type]) {
if (!providers[type]) {
providers[type] = new providerInjection[type]();
}
return configFn(providers[type])
}
}
BI.Constants = {
getConstant: function (type) {
return constantInjection[type];
}
}
BI.Models = {
getModel: function (type, config) {
return new modelInjection[type](config);
}
}
var stores = {};
BI.Stores = {
getStore: function (type, config) {
if (stores[type]) {
return stores[type];
}
return stores[type] = new storeInjection[type](config);
}
}
var providers = {}, providerInstance = {}
BI.Providers = {
getProvider: function (type, config) {
if (!providers[type]) {
providers[type] = new providerInjection[type]();
}
if (!providerInstance[type]) {
providerInstance[type] = new providers[type].$get()(config);
}
return providerInstance[type];
}
}
})();
/**
* guy
* 检测某个Widget的EventChange事件然后去show某个card
* @type {*|void|Object}
@ -20530,22 +20612,7 @@ BI.HorizontalFillLayoutLogic = BI.inherit(BI.Logic, {
_init: function () {
BI.HorizontalFillLayoutLogic.superclass._init.apply(this, arguments);
}
});;(function () {
var models = {};
BI.models = function (xtype, cls) {
if (models[xtype] != null) {
throw ("models:[" + xtype + "] has been registed");
}
models[xtype] = cls;
};
BI.Models = {
getModel: function (type, config) {
return new models[type](config);
}
}
})();
BI.Plugin = BI.Plugin || {};
});BI.Plugin = BI.Plugin || {};
;
(function () {
var _WidgetsPlugin = {};
@ -21718,27 +21785,7 @@ $.extend(String, {
return args[i];
});
}
});;(function () {
var kv = {};
BI.stores = function (xtype, cls) {
if (kv[xtype] != null) {
throw ("stores:[" + xtype + "] has been registed");
}
kv[xtype] = cls;
};
var stores = {};
BI.Stores = {
getStore: function (type, config) {
if (stores[type]) {
return stores[type];
}
return stores[type] = new kv[type](config);
}
}
})();
BI.EventListener = {
});BI.EventListener = {
listen: function listen(target, eventType, callback) {
if (target.addEventListener) {
target.addEventListener(eventType, callback, false);
@ -25719,7 +25766,7 @@ BI.Data = Data = {};
* 存放bi里面通用的一些常量
* @type {{}}
*/
Data.Constant = BI.Constant = BICst = {};
Data.Constant = BICst = {};
/**
* 缓冲池
* @type {{Buffer: {}}}

4
dist/demo.js vendored

@ -13031,7 +13031,7 @@ Demo.Slider = BI.inherit(BI.Widget, {
normalSingleSlider.populate();
var singleSliderLabel = BI.createWidget({
type: "bi.single_slider_label",
type: "bi.single_slider",
width: o.width,
height: o.height,
digit: 0,
@ -13061,7 +13061,7 @@ Demo.Slider = BI.inherit(BI.Widget, {
intervalSlider.populate();
var intervalSliderLabel = BI.createWidget({
type: "bi.interval_slider_label",
type: "bi.interval_slider",
width: o.width,
unit: "个",
cls: "layout-bg-white"

2
dist/fix/fix.js vendored

@ -898,7 +898,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
if (typeof Proxy === 'function') {
return vm.$$computed = new Proxy(props, {
has: function has(target, key) {
return key in computed;
return computed && key in computed;
},
get: function get(target, key) {
return createComputedGetter(vm, key)();

238
dist/widget.js vendored

@ -1045,7 +1045,7 @@ BI.Arrangement = BI.inherit(BI.Widget, {
element: this.container
});
}
this.wrapper.populate(items);
this.wrapper.addItems(items);
},
getClientWidth: function () {
@ -1778,7 +1778,17 @@ BI.Arrangement = BI.inherit(BI.Widget, {
},
populate: function (items) {
this.regions = {};
// this.regions = {};
var self = this;
BI.each(this.regions, function (name, region) {
var exist = BI.some(items, function (i, item) {
return item.el.attr("id") === name;
});
if (!exist) {
self.regions[name].el.setVisible(false);
}
delete self.regions[name];
});
this._populate(items);
this._renderRegion();
}
@ -5620,7 +5630,9 @@ BI.IntervalSlider = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.IntervalSlider.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-interval-slider bi-slider-track"
baseCls: "bi-interval-slider bi-slider-track",
digit: false,
unit: ""
})
},
@ -5652,8 +5664,9 @@ BI.IntervalSlider = BI.inherit(BI.Widget, {
this.track = this._createTrackWrapper();
this.labelOne = BI.createWidget({
type: "bi.sign_editor",
type: "bi.sign_text_editor",
cls: "slider-editor-button",
text: this.options.unit,
errorText: "",
allowBlank: false,
width: c.EDITOR_WIDTH,
@ -5678,9 +5691,10 @@ BI.IntervalSlider = BI.inherit(BI.Widget, {
});
this.labelTwo = BI.createWidget({
type: "bi.sign_editor",
type: "bi.sign_text_editor",
cls: "slider-editor-button",
errorText: "",
text: this.options.unit,
allowBlank: false,
width: c.EDITOR_WIDTH,
validationChecker: function (v) {
@ -5741,10 +5755,12 @@ BI.IntervalSlider = BI.inherit(BI.Widget, {
},
_rePosBySizeAfterMove: function (size, isLeft) {
var o = this.options;
var percent = size * 100 / (this._getGrayTrackLength());
var significantPercent = BI.parseFloat(percent.toFixed(1));
var v = this._getValueByPercent(significantPercent);
v = this._assertValue(v);
v = o.digit === false ? v : v.toFixed(o.digit);
if(isLeft){
this._setLabelOnePosition(significantPercent);
this._setSliderOnePosition(significantPercent);
@ -6056,8 +6072,11 @@ BI.IntervalSlider = BI.inherit(BI.Widget, {
},
setValue: function (v) {
var o = this.options;
var valueOne = BI.parseFloat(v.min);
var valueTwo = BI.parseFloat(v.max);
valueOne = o.digit === false ? valueOne : valueOne.toFixed(o.digit);
valueTwo = o.digit === false ? valueTwo : valueTwo.toFixed(o.digit);
if (!isNaN(valueOne) && !isNaN(valueTwo)) {
if (this._checkValidation(valueOne)) {
this.valueOne = valueOne;
@ -17276,6 +17295,209 @@ BI.SequenceTable = BI.inherit(BI.Widget, {
}
});
BI.shortcut('bi.sequence_table', BI.SequenceTable);/**
* Created by User on 2017/11/16.
*/
BI.SignTextEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.SignTextEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-sign-initial-editor",
hgap: 4,
vgap: 2,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn,
allowBlank: true,
watermark: "",
errorText: "",
text: "",
height: 24
})
},
_init: function () {
BI.SignTextEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.editor",
height: o.height,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
value: o.value,
validationChecker: o.validationChecker,
quitChecker: o.quitChecker,
allowBlank: o.allowBlank,
watermark: o.watermark,
errorText: o.errorText
});
this.text = BI.createWidget({
type: "bi.text_button",
cls: "sign-editor-text",
title: o.title,
warningTitle: o.warningTitle,
tipType: o.tipType,
textAlign: "left",
height: o.height,
hgap: 4,
handler: function () {
self._showInput();
self.editor.focus();
self.editor.selectAll();
}
});
this.text.on(BI.TextButton.EVENT_CHANGE, function () {
BI.nextTick(function () {
self.fireEvent(BI.SignTextEditor.EVENT_CLICK_LABEL)
});
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.text,
left: 0,
right: 0,
top: 0,
bottom: 0
}]
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.editor.on(BI.Editor.EVENT_CONFIRM, function () {
self._showHint();
self._checkText();
self.fireEvent(BI.SignTextEditor.EVENT_CONFIRM, arguments);
});
this.editor.on(BI.Editor.EVENT_ERROR, function () {
self._checkText();
});
BI.createWidget({
type: "bi.vertical",
scrolly: false,
element: this,
items: [this.editor]
});
this._showHint();
self._checkText();
},
_checkText: function () {
var o = this.options;
BI.nextTick(BI.bind(function () {
if (this.editor.getValue() === "") {
this.text.setValue(o.watermark || "");
this.text.element.addClass("bi-water-mark");
} else {
var v = this.editor.getValue();
v = (BI.isEmpty(v) || v == o.text) ? o.text : v + o.text;
this.text.setValue(v);
this.text.element.removeClass("bi-water-mark");
}
}, this));
},
_showInput: function () {
this.editor.visible();
this.text.invisible();
},
_showHint: function () {
this.editor.invisible();
this.text.visible();
},
setTitle: function (title) {
this.text.setTitle(title);
},
setWarningTitle: function (title) {
this.text.setWarningTitle(title);
},
focus: function () {
this._showInput();
this.editor.focus();
},
blur: function () {
this.editor.blur();
this._showHint();
this._checkText();
},
doRedMark: function () {
if (this.editor.getValue() === "" && BI.isKey(this.options.watermark)) {
return;
}
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
if (this.editor.getValue() === "" && BI.isKey(this.options.watermark)) {
return;
}
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
isValid: function () {
return this.editor.isValid();
},
setErrorText: function (text) {
this.editor.setErrorText(text);
},
getErrorText: function () {
return this.editor.getErrorText();
},
isEditing: function () {
return this.editor.isEditing();
},
getLastValidValue: function () {
return this.editor.getLastValidValue();
},
setValue: function (v) {
this.editor.setValue(v);
this._checkText();
},
getValue: function () {
return this.editor.getValue();
},
getState: function () {
return this.text.getValue();
},
setState: function (v) {
var o = this.options;
this._showHint();
v = (BI.isEmpty(v) || v == o.text) ? o.text : v + o.text;
this.text.setValue(v);
}
});
BI.SignTextEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.sign_text_editor", BI.SignTextEditor);/**
* Created by zcf on 2016/9/22.
*/
BI.SliderIconButton = BI.inherit(BI.Widget, {
@ -17322,7 +17544,8 @@ BI.SingleSlider = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.SingleSlider.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-slider bi-slider-track",
digit: false
digit: false,
unit: ""
});
},
_init: function () {
@ -17382,9 +17605,10 @@ BI.SingleSlider = BI.inherit(BI.Widget, {
}
});
this.label = BI.createWidget({
type: "bi.sign_editor",
type: "bi.sign_text_editor",
cls: "slider-editor-button",
errorText: "",
text: o.unit,
width: c.EDITOR_WIDTH - 2,
allowBlank: false,
validationChecker: function (v) {

8
src/base/collection/collection.js

@ -279,8 +279,12 @@ BI.CollectionView = BI.inherit(BI.Widget, {
this.container.setHeight(this._height);
this._calculateChildrenToRender();
this.element.scrollTop(o.scrollTop);
this.element.scrollLeft(o.scrollLeft);
//元素未挂载时不能设置scrollTop
try {
this.element.scrollTop(o.scrollTop);
this.element.scrollLeft(o.scrollLeft);
} catch (e) {
}
}
},

8
src/base/grid/grid.js

@ -244,8 +244,12 @@ BI.GridView = BI.inherit(BI.Widget, {
this._rowSizeAndPositionManager = new BI.ScalingCellSizeAndPositionManager(this.rowCount, o.rowHeightGetter, o.estimatedRowSize);
this._calculateChildrenToRender();
this.element.scrollTop(o.scrollTop);
this.element.scrollLeft(o.scrollLeft);
//元素未挂载时不能设置scrollTop
try {
this.element.scrollTop(o.scrollTop);
this.element.scrollLeft(o.scrollLeft);
} catch (e) {
}
},
setScrollLeft: function (scrollLeft) {

4
src/base/single/button/button.basic.js

@ -109,7 +109,6 @@ BI.BasicButton = BI.inherit(BI.Single, {
var mouseDown = false;
hand.mousedown(function () {
mouseDown = true;
ev(e);
});
hand.mouseup(function (e) {
if (mouseDown === true) {
@ -190,9 +189,6 @@ BI.BasicButton = BI.inherit(BI.Single, {
hand.mousedown(function (e) {
ev(e);
});
hand.mouseup(function (e) {
ev(e);
});
}
hand.click(clk);
break;

82
src/core/inject.js

@ -0,0 +1,82 @@
;(function () {
var constantInjection = {};
BI.constant = function (xtype, cls) {
if (constantInjection[xtype] != null) {
throw ("constant:[" + xtype + "] has been registed");
}
constantInjection[xtype] = cls;
};
var modelInjection = {};
BI.model = function (xtype, cls) {
if (modelInjection[xtype] != null) {
throw ("model:[" + xtype + "] has been registed");
}
modelInjection[xtype] = cls;
};
var storeInjection = {};
BI.stores = function (xtype, cls) {
if (storeInjection[xtype] != null) {
throw ("store:[" + xtype + "] has been registed");
}
storeInjection[xtype] = cls;
};
var providerInjection = {};
BI.provider = function (xtype, cls) {
if (providerInjection[xtype] != null) {
throw ("provider:[" + xtype + "] has been registed");
}
providerInjection[xtype] = cls;
};
BI.config = function (type, configFn) {
if (constantInjection[type]) {
return constantInjection[type] = configFn(constantInjection[type]);
}
if (providerInjection[type]) {
if (!providers[type]) {
providers[type] = new providerInjection[type]();
}
return configFn(providers[type])
}
}
BI.Constants = {
getConstant: function (type) {
return constantInjection[type];
}
}
BI.Models = {
getModel: function (type, config) {
return new modelInjection[type](config);
}
}
var stores = {};
BI.Stores = {
getStore: function (type, config) {
if (stores[type]) {
return stores[type];
}
return stores[type] = new storeInjection[type](config);
}
}
var providers = {}, providerInstance = {}
BI.Providers = {
getProvider: function (type, config) {
if (!providers[type]) {
providers[type] = new providerInjection[type]();
}
if (!providerInstance[type]) {
providerInstance[type] = new providers[type].$get()(config);
}
return providerInstance[type];
}
}
})();

15
src/core/model.js

@ -1,15 +0,0 @@
;(function () {
var models = {};
BI.models = function (xtype, cls) {
if (models[xtype] != null) {
throw ("models:[" + xtype + "] has been registed");
}
models[xtype] = cls;
};
BI.Models = {
getModel: function (type, config) {
return new models[type](config);
}
}
})();

20
src/core/store.js

@ -1,20 +0,0 @@
;(function () {
var kv = {};
BI.stores = function (xtype, cls) {
if (kv[xtype] != null) {
throw ("stores:[" + xtype + "] has been registed");
}
kv[xtype] = cls;
};
var stores = {};
BI.Stores = {
getStore: function (type, config) {
if (stores[type]) {
return stores[type];
}
return stores[type] = new kv[type](config);
}
}
})();

2
src/css/core/wrapper/flex.center.css

@ -26,12 +26,14 @@
-moz-justify-content: center;
-ms-justify-content: center;
-o-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
/* 09版 */
-webkit-box-align: center;
/* 12版 */
-webkit-align-items: center;
-moz-align-items: center;
-ms-flex-align: center;
-ms-align-items: center;
-o-align-items: center;
align-items: center;

6
src/css/core/wrapper/flex.horizontal.css

@ -26,13 +26,15 @@
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
-o-justify-content: flex-start;
-ms-flex-pack: start;
justify-content: flex-start;
/* 09版 */
-webkit-box-align: flex-start;
-webkit-box-align: start;
/* 12版 */
-webkit-align-items: flex-start;
-moz-align-items: flex-start;
-ms-align-items: flex-start;
-ms-flex-align: start;
-o-align-items: flex-start;
align-items: flex-start;
/* 09版 */
@ -51,6 +53,7 @@
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-ms-flex-align: center;
-o-align-items: center;
align-items: center;
}
@ -61,6 +64,7 @@
-webkit-align-items: flex-end;
-moz-align-items: flex-end;
-ms-align-items: flex-end;
-ms-flex-align: end;
-o-align-items: flex-end;
align-items: flex-end;
}

4
src/css/core/wrapper/flex.vertical.center.css

@ -26,6 +26,7 @@
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
-o-justify-content: flex-start;
-ms-flex-pack: start;
justify-content: flex-start;
/* 09版 */
-webkit-box-align: center;
@ -33,6 +34,7 @@
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-ms-flex-align: center;
-o-align-items: center;
align-items: center;
/* 09版 */
@ -59,6 +61,7 @@
-webkit-justify-content: center;
-moz-justify-content: center;
-ms-justify-content: center;
-ms-flex-pack: center;
-o-justify-content: center;
justify-content: center;
/* 09版 */
@ -67,6 +70,7 @@
-webkit-align-items: stretch;
-moz-align-items: stretch;
-ms-align-items: stretch;
-ms-flex-align: stretch;
-o-align-items: stretch;
align-items: stretch;
}

2
src/css/core/wrapper/flex.wrapper.center.css

@ -25,6 +25,7 @@
-webkit-justify-content: center;
-moz-justify-content: center;
-ms-justify-content: center;
-ms-flex-pack: center;
-o-justify-content: center;
justify-content: center;
/* 09版 */
@ -33,6 +34,7 @@
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-ms-flex-align: center;
-o-align-items: center;
align-items: center;
min-width: 100%;

2
src/css/core/wrapper/flex.wrapper.horizontal.css

@ -25,6 +25,7 @@
-webkit-justify-content: flex-start;
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
-ms-flex-pack: start;
-o-justify-content: flex-start;
justify-content: flex-start;
/* 09版 */
@ -33,6 +34,7 @@
-webkit-align-items: flex-start;
-moz-align-items: flex-start;
-ms-align-items: flex-start;
-ms-flex-align: start;
-o-align-items: flex-start;
align-items: flex-start;
/* 09版 */

2
src/css/core/wrapper/flex.wrapper.vertical.center.css

@ -25,6 +25,7 @@
-webkit-justify-content: flex-start;
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
-ms-flex-pack: start;
-o-justify-content: flex-start;
justify-content: flex-start;
/* 09版 */
@ -33,6 +34,7 @@
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-ms-flex-align: center;
-o-align-items: center;
align-items: center;
/* 09版 */

2
src/data/data.js

@ -8,4 +8,4 @@ BI.Data = Data = {};
* 存放bi里面通用的一些常量
* @type {{}}
*/
Data.Constant = BI.Constant = BICst = {};
Data.Constant = BICst = {};

2
src/less/core/wrapper/flex.center.less

@ -22,6 +22,7 @@
-moz-justify-content: center;
-ms-justify-content: center;
-o-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
/* 09版 */
@ -29,6 +30,7 @@
/* 12版 */
-webkit-align-items: center;
-moz-align-items: center;
-ms-flex-align: center;
-ms-align-items: center;
-o-align-items: center;
align-items: center;

6
src/less/core/wrapper/flex.horizontal.less

@ -22,14 +22,16 @@
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
-o-justify-content: flex-start;
-ms-flex-pack: start;
justify-content: flex-start;
/* 09版 */
-webkit-box-align: flex-start;
-webkit-box-align: start;
/* 12版 */
-webkit-align-items: flex-start;
-moz-align-items: flex-start;
-ms-align-items: flex-start;
-ms-flex-align: start;
-o-align-items: flex-start;
align-items: flex-start;
@ -49,6 +51,7 @@
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-ms-flex-align: center;
-o-align-items: center;
align-items: center;
}
@ -59,6 +62,7 @@
-webkit-align-items: flex-end;
-moz-align-items: flex-end;
-ms-align-items: flex-end;
-ms-flex-align: end;
-o-align-items: flex-end;
align-items: flex-end;
}

4
src/less/core/wrapper/flex.vertical.center.less

@ -22,6 +22,7 @@
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
-o-justify-content: flex-start;
-ms-flex-pack: start;
justify-content: flex-start;
/* 09版 */
@ -30,6 +31,7 @@
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-ms-flex-align: center;
-o-align-items: center;
align-items: center;
@ -58,6 +60,7 @@
-webkit-justify-content: center;
-moz-justify-content: center;
-ms-justify-content: center;
-ms-flex-pack: center;
-o-justify-content: center;
justify-content: center;
/* 09版 */
@ -66,6 +69,7 @@
-webkit-align-items: stretch;
-moz-align-items: stretch;
-ms-align-items: stretch;
-ms-flex-align: stretch;
-o-align-items: stretch;
align-items: stretch;
}

2
src/less/core/wrapper/flex.wrapper.center.less

@ -21,6 +21,7 @@
-webkit-justify-content: center;
-moz-justify-content: center;
-ms-justify-content: center;
-ms-flex-pack: center;
-o-justify-content: center;
justify-content: center;
@ -30,6 +31,7 @@
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-ms-flex-align: center;
-o-align-items: center;
align-items: center;

2
src/less/core/wrapper/flex.wrapper.horizontal.less

@ -21,6 +21,7 @@
-webkit-justify-content: flex-start;
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
-ms-flex-pack: start;
-o-justify-content: flex-start;
justify-content: flex-start;
@ -30,6 +31,7 @@
-webkit-align-items: flex-start;
-moz-align-items: flex-start;
-ms-align-items: flex-start;
-ms-flex-align: start;
-o-align-items: flex-start;
align-items: flex-start;

2
src/less/core/wrapper/flex.wrapper.vertical.center.less

@ -22,6 +22,7 @@
-webkit-justify-content: flex-start;
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
-ms-flex-pack: start;
-o-justify-content: flex-start;
justify-content: flex-start;
@ -31,6 +32,7 @@
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-ms-flex-align: center;
-o-align-items: center;
align-items: center;

14
src/widget/arrangement/arrangement.js

@ -298,7 +298,7 @@ BI.Arrangement = BI.inherit(BI.Widget, {
element: this.container
});
}
this.wrapper.populate(items);
this.wrapper.addItems(items);
},
getClientWidth: function () {
@ -1031,7 +1031,17 @@ BI.Arrangement = BI.inherit(BI.Widget, {
},
populate: function (items) {
this.regions = {};
// this.regions = {};
var self = this;
BI.each(this.regions, function (name, region) {
var exist = BI.some(items, function (i, item) {
return item.el.attr("id") === name;
});
if (!exist) {
self.regions[name].el.setVisible(false);
}
delete self.regions[name];
});
this._populate(items);
this._renderRegion();
}

15
src/widget/intervalslider/intervalslider.js

@ -14,7 +14,9 @@ BI.IntervalSlider = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.IntervalSlider.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-interval-slider bi-slider-track"
baseCls: "bi-interval-slider bi-slider-track",
digit: false,
unit: ""
})
},
@ -46,8 +48,9 @@ BI.IntervalSlider = BI.inherit(BI.Widget, {
this.track = this._createTrackWrapper();
this.labelOne = BI.createWidget({
type: "bi.sign_editor",
type: "bi.sign_text_editor",
cls: "slider-editor-button",
text: this.options.unit,
errorText: "",
allowBlank: false,
width: c.EDITOR_WIDTH,
@ -72,9 +75,10 @@ BI.IntervalSlider = BI.inherit(BI.Widget, {
});
this.labelTwo = BI.createWidget({
type: "bi.sign_editor",
type: "bi.sign_text_editor",
cls: "slider-editor-button",
errorText: "",
text: this.options.unit,
allowBlank: false,
width: c.EDITOR_WIDTH,
validationChecker: function (v) {
@ -135,10 +139,12 @@ BI.IntervalSlider = BI.inherit(BI.Widget, {
},
_rePosBySizeAfterMove: function (size, isLeft) {
var o = this.options;
var percent = size * 100 / (this._getGrayTrackLength());
var significantPercent = BI.parseFloat(percent.toFixed(1));
var v = this._getValueByPercent(significantPercent);
v = this._assertValue(v);
v = o.digit === false ? v : v.toFixed(o.digit);
if(isLeft){
this._setLabelOnePosition(significantPercent);
this._setSliderOnePosition(significantPercent);
@ -450,8 +456,11 @@ BI.IntervalSlider = BI.inherit(BI.Widget, {
},
setValue: function (v) {
var o = this.options;
var valueOne = BI.parseFloat(v.min);
var valueTwo = BI.parseFloat(v.max);
valueOne = o.digit === false ? valueOne : valueOne.toFixed(o.digit);
valueTwo = o.digit === false ? valueTwo : valueTwo.toFixed(o.digit);
if (!isNaN(valueOne) && !isNaN(valueTwo)) {
if (this._checkValidation(valueOne)) {
this.valueOne = valueOne;

204
src/widget/singleslider/button/editor.sign.text.js

@ -0,0 +1,204 @@
/**
* Created by User on 2017/11/16.
*/
BI.SignTextEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.SignTextEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-sign-initial-editor",
hgap: 4,
vgap: 2,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn,
allowBlank: true,
watermark: "",
errorText: "",
text: "",
height: 24
})
},
_init: function () {
BI.SignTextEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.editor",
height: o.height,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
value: o.value,
validationChecker: o.validationChecker,
quitChecker: o.quitChecker,
allowBlank: o.allowBlank,
watermark: o.watermark,
errorText: o.errorText
});
this.text = BI.createWidget({
type: "bi.text_button",
cls: "sign-editor-text",
title: o.title,
warningTitle: o.warningTitle,
tipType: o.tipType,
textAlign: "left",
height: o.height,
hgap: 4,
handler: function () {
self._showInput();
self.editor.focus();
self.editor.selectAll();
}
});
this.text.on(BI.TextButton.EVENT_CHANGE, function () {
BI.nextTick(function () {
self.fireEvent(BI.SignTextEditor.EVENT_CLICK_LABEL)
});
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.text,
left: 0,
right: 0,
top: 0,
bottom: 0
}]
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.editor.on(BI.Editor.EVENT_CONFIRM, function () {
self._showHint();
self._checkText();
self.fireEvent(BI.SignTextEditor.EVENT_CONFIRM, arguments);
});
this.editor.on(BI.Editor.EVENT_ERROR, function () {
self._checkText();
});
BI.createWidget({
type: "bi.vertical",
scrolly: false,
element: this,
items: [this.editor]
});
this._showHint();
self._checkText();
},
_checkText: function () {
var o = this.options;
BI.nextTick(BI.bind(function () {
if (this.editor.getValue() === "") {
this.text.setValue(o.watermark || "");
this.text.element.addClass("bi-water-mark");
} else {
var v = this.editor.getValue();
v = (BI.isEmpty(v) || v == o.text) ? o.text : v + o.text;
this.text.setValue(v);
this.text.element.removeClass("bi-water-mark");
}
}, this));
},
_showInput: function () {
this.editor.visible();
this.text.invisible();
},
_showHint: function () {
this.editor.invisible();
this.text.visible();
},
setTitle: function (title) {
this.text.setTitle(title);
},
setWarningTitle: function (title) {
this.text.setWarningTitle(title);
},
focus: function () {
this._showInput();
this.editor.focus();
},
blur: function () {
this.editor.blur();
this._showHint();
this._checkText();
},
doRedMark: function () {
if (this.editor.getValue() === "" && BI.isKey(this.options.watermark)) {
return;
}
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
if (this.editor.getValue() === "" && BI.isKey(this.options.watermark)) {
return;
}
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
isValid: function () {
return this.editor.isValid();
},
setErrorText: function (text) {
this.editor.setErrorText(text);
},
getErrorText: function () {
return this.editor.getErrorText();
},
isEditing: function () {
return this.editor.isEditing();
},
getLastValidValue: function () {
return this.editor.getLastValidValue();
},
setValue: function (v) {
this.editor.setValue(v);
this._checkText();
},
getValue: function () {
return this.editor.getValue();
},
getState: function () {
return this.text.getValue();
},
setState: function (v) {
var o = this.options;
this._showHint();
v = (BI.isEmpty(v) || v == o.text) ? o.text : v + o.text;
this.text.setValue(v);
}
});
BI.SignTextEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.sign_text_editor", BI.SignTextEditor);

6
src/widget/singleslider/singleslider.js

@ -13,7 +13,8 @@ BI.SingleSlider = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.SingleSlider.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-slider bi-slider-track",
digit: false
digit: false,
unit: ""
});
},
_init: function () {
@ -73,9 +74,10 @@ BI.SingleSlider = BI.inherit(BI.Widget, {
}
});
this.label = BI.createWidget({
type: "bi.sign_editor",
type: "bi.sign_text_editor",
cls: "slider-editor-button",
errorText: "",
text: o.unit,
width: c.EDITOR_WIDTH - 2,
allowBlank: false,
validationChecker: function (v) {

Loading…
Cancel
Save