Browse Source

Merge remote-tracking branch 'origin/master'

es6
Young 6 years ago
parent
commit
87bcbb64f5
  1. 3
      Gruntfile.js
  2. 8
      README.md
  3. 53
      dist/base.js
  4. 2
      dist/bundle.css
  5. 154
      dist/bundle.js
  6. 2
      dist/bundle.min.css
  7. 68
      dist/bundle.min.js
  8. 2
      dist/case.js
  9. 2
      dist/core.css
  10. 99
      dist/core.js
  11. 2
      dist/core_without_normalize.css
  12. 2
      dist/fineui.css
  13. 158
      dist/fineui.js
  14. 2
      dist/fineui.min.css
  15. 76
      dist/fineui.min.js
  16. 152
      dist/fineui_without_jquery_polyfill.js
  17. 49
      dist/index.html
  18. 4
      dist/polyfill.js
  19. 24
      dist/utils.js
  20. 8
      dist/utils.min.js
  21. 52
      index.html
  22. 544
      package-lock.json
  23. 2
      src/base/base.js
  24. 10
      src/base/combination/combo.js
  25. 6
      src/base/foundation/message.js
  26. 2
      src/base/layer/layer.popover.js
  27. 2
      src/base/layer/layer.popup.js
  28. 12
      src/base/single/button/button.basic.js
  29. 6
      src/base/single/editor/editor.textarea.js
  30. 2
      src/base/single/iframe/iframe.js
  31. 2
      src/base/single/img/img.js
  32. 2
      src/base/single/input/file.js
  33. 2
      src/base/single/single.js
  34. 2
      src/case/layer/layer.multipopup.js
  35. 4
      src/core/config.js
  36. 2
      src/core/controller/controller.layer.js
  37. 2
      src/core/controller/controller.popover.js
  38. 2
      src/core/controller/controller.resizer.js
  39. 4
      src/core/controller/controller.tooltips.js
  40. 4
      src/core/foundation.js
  41. 12
      src/core/func/function.js
  42. 2
      src/core/proto/date.i18n.js
  43. 20
      src/core/proto/date.js
  44. 4
      src/core/shortcut.js
  45. 19
      src/core/widget.js
  46. 4
      src/core/wrapper/layout/adapt/adapt.center.js
  47. 4
      src/core/wrapper/layout/adapt/adapt.horizontal.js
  48. 4
      src/core/wrapper/layout/adapt/adapt.vertical.js
  49. 2
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.center.js
  50. 2
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js
  51. 2
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js
  52. 4
      src/core/wrapper/layout/layout.horizontal.js
  53. 2
      src/core/wrapper/layout/layout.td.js
  54. 2
      src/css/core/utils/common.css
  55. 2
      src/less/core/utils/common.less

3
Gruntfile.js

@ -339,8 +339,7 @@ module.exports = function (grunt) {
},
server: {
options: {
port: 9001,
base: "./dist"
port: 9001
}
}
},

8
README.md

@ -12,15 +12,9 @@ Documentation
http://fanruan.coding.me/fineui-doc/
### API
GithubPages: [https://fanruan.github.io/fineui](https://fanruan.github.io/fineui)
CodingPages: [http://fanruan.coding.me/fineui](http://fanruan.coding.me/fineui)
### Demo
CodingPages: [http://fanruan.coding.me/fineui/dist/index.html](http://fanruan.coding.me/fineui/dist/index.html)
CodingPages: [http://fanruan.coding.me/fineui](http://fanruan.coding.me/fineui)
License

53
dist/base.js vendored

@ -420,7 +420,7 @@ BI.Single = BI.inherit(BI.Widget, {
clearTimeout(this.timeout);
}
this._hideTooltip();
$(this.element).unbind("mouseenter.title" + this.getName())
this.element.unbind("mouseenter.title" + this.getName())
.unbind("mousemove.title" + this.getName())
.unbind("mouseleave.title" + this.getName());
this._hoverBinded = false;
@ -736,14 +736,14 @@ BI.BasicButton = BI.inherit(BI.Single, {
var selected = false;
hand.mousedown(function (e) {
// if (e.button === 0) {
$(document).bind("mouseup." + self.getName(), function (e) {
BI.Widget._renderEngine.createElement(document).bind("mouseup." + self.getName(), function (e) {
// if (e.button === 0) {
if (BI.DOM.isExist(self) && !hand.__isMouseInBounds__(e) && mouseDown === true && !selected) {
// self.setSelected(!self.isSelected());
self._trigger();
}
mouseDown = false;
$(document).unbind("mouseup." + self.getName());
BI.Widget._renderEngine.createElement(document).unbind("mouseup." + self.getName());
// }
});
if (mouseDown === true) {
@ -765,7 +765,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
}
mouseDown = false;
selected = false;
$(document).unbind("mouseup." + self.getName());
BI.Widget._renderEngine.createElement(document).unbind("mouseup." + self.getName());
// }
});
break;
@ -776,11 +776,11 @@ BI.BasicButton = BI.inherit(BI.Single, {
var mouseDown = false;
var interval;
hand.mousedown(function (e) {
$(document).bind("mouseup." + self.getName(), function (e) {
BI.Widget._renderEngine.createElement(document).bind("mouseup." + self.getName(), function (e) {
interval && clearInterval(interval);
interval = null;
mouseDown = false;
$(document).unbind("mouseup." + self.getName());
BI.Widget._renderEngine.createElement(document).unbind("mouseup." + self.getName());
});
if (mouseDown === true) {
return;
@ -1010,7 +1010,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
},
empty: function () {
$(document).unbind("mouseup." + this.getName());
BI.Widget._renderEngine.createElement(document).unbind("mouseup." + this.getName());
BI.BasicButton.superclass.empty.apply(this, arguments);
},
@ -2504,14 +2504,17 @@ BI.PartTree = BI.inherit(BI.AsyncTree, {
}
});
BI.shortcut("bi.part_tree", BI.PartTree);BI.Resizers = new BI.ResizeController();
BI.shortcut("bi.part_tree", BI.PartTree);BI.prepares.push(function () {
BI.Resizers = new BI.ResizeController();
BI.Layers = new BI.LayerController();
BI.Maskers = new BI.MaskersController();
BI.Bubbles = new BI.BubblesController();
BI.Tooltips = new BI.TooltipsController();
BI.Popovers = new BI.PopoverController();
BI.Broadcasts = new BI.BroadcastController();
BI.StyleLoaders = new BI.StyleLoaderManager();/**
BI.StyleLoaders = new BI.StyleLoaderManager();
});
/**
* CollectionView
*
* Created by GUY on 2016/1/15.
@ -3153,7 +3156,7 @@ BI.Combo = BI.inherit(BI.Widget, {
// BI-10290 公式combo双击公式内容会收起
if ((this.element.find(e.target).length > 0 && e.type !== "mousewheel")
|| (this.popupView && this.popupView.element.find(e.target).length > 0)
|| e.target.className === "CodeMirror-cursor" || $(e.target).closest(".CodeMirror-hints").length > 0) {// BI-9887 CodeMirror的公式弹框需要特殊处理下
|| e.target.className === "CodeMirror-cursor" || BI.Widget._renderEngine.createElement(e.target).closest(".CodeMirror-hints").length > 0) {// BI-9887 CodeMirror的公式弹框需要特殊处理下
return;
}
var isHide = this.options.hideChecker.apply(this, [e]);
@ -3174,7 +3177,7 @@ BI.Combo = BI.inherit(BI.Widget, {
}
this.element.removeClass(this.options.comboClass);
$(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW);
},
@ -3187,8 +3190,8 @@ BI.Combo = BI.inherit(BI.Widget, {
this.adjustHeight();
this.element.addClass(this.options.comboClass);
$(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
$(document).bind("mousedown." + this.getName(), BI.bind(this._hideIf, this)).bind("mousewheel." + this.getName(), BI.bind(this._hideIf, this));
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
BI.Widget._renderEngine.createElement(document).bind("mousedown." + this.getName(), BI.bind(this._hideIf, this)).bind("mousewheel." + this.getName(), BI.bind(this._hideIf, this));
this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW);
},
@ -3356,7 +3359,7 @@ BI.Combo = BI.inherit(BI.Widget, {
},
destroy: function () {
$(document).unbind("mousedown." + this.getName())
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName())
.unbind("mousewheel." + this.getName())
.unbind("mouseenter." + this.getName())
.unbind("mousemove." + this.getName())
@ -5093,7 +5096,7 @@ BI.Msg = function () {
},
toast: function (message, options, context) {
options = options || {};
context = context || $("body");
context = context || BI.Widget._renderEngine.createElement("body");
var level = options.level || "normal";
var autoClose = BI.isNull(options.autoClose) ? true : options.autoClose;
var toast = BI.createWidget({
@ -5123,7 +5126,7 @@ BI.Msg = function () {
}, 5000);
},
_show: function (hasCancel, title, message, callback) {
$mask = $("<div class=\"bi-z-index-mask\">").css({
$mask = BI.Widget._renderEngine.createElement("<div class=\"bi-z-index-mask\">").css({
position: "absolute",
zIndex: BI.zIndex_tip - 2,
top: 0,
@ -5132,7 +5135,7 @@ BI.Msg = function () {
bottom: 0,
opacity: 0.5
}).appendTo("body");
$pop = $("<div class=\"bi-message-depend\">").css({
$pop = BI.Widget._renderEngine.createElement("<div class=\"bi-message-depend\">").css({
position: "absolute",
zIndex: BI.zIndex_tip - 1,
top: 0,
@ -5659,7 +5662,7 @@ BI.Popover = BI.inherit(BI.Widget, {
this.startY = 0;
this.tracker = new BI.MouseMoveTracker(function (deltaX, deltaY) {
var size = self._calculateSize();
var W = $("body").width(), H = $("body").height();
var W = BI.Widget._renderEngine.createElement("body").width(), H = BI.Widget._renderEngine.createElement("body").height();
self.startX += deltaX;
self.startY += deltaY;
self.element.css({
@ -5979,7 +5982,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
return BI.createWidget({
type: "bi.center",
cls: "list-view-toolbar bi-high-light bi-border-top",
cls: "list-view-toolbar bi-high-light bi-split-top",
height: 24,
items: BI.createItems(o.buttons, {
once: false,
@ -8804,9 +8807,9 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
self._focus();
self.fireEvent(BI.TextAreaEditor.EVENT_FOCUS);
}
$(document).bind("mousedown." + self.getName(), function (e) {
BI.Widget._renderEngine.createElement(document).bind("mousedown." + self.getName(), function (e) {
if (BI.DOM.isExist(self) && !self.element.__isMouseInBounds__(e)) {
$(document).unbind("mousedown." + self.getName());
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + self.getName());
self.content.element.blur();
}
});
@ -8816,7 +8819,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
self._blur();
self.fireEvent(BI.TextAreaEditor.EVENT_BLUR);
}
$(document).unbind("mousedown." + self.getName());
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + self.getName());
});
if (BI.isKey(o.value)) {
self.setValue(o.value);
@ -8956,7 +8959,7 @@ BI.Iframe = BI.inherit(BI.Single, {
_init: function () {
var o = this.options;
this.options.element = $("<iframe frameborder='0' src='" + o.src + "'>");
this.options.element = BI.Widget._renderEngine.createElement("<iframe frameborder='0' src='" + o.src + "'>");
BI.Iframe.superclass._init.apply(this, arguments);
},
@ -9008,7 +9011,7 @@ BI.Img = BI.inherit(BI.Single, {
_init: function () {
var o = this.options;
this.options.element = $("<img src='" + o.src + "'>");
this.options.element = BI.Widget._renderEngine.createElement("<img src='" + o.src + "'>");
BI.Img.superclass._init.apply(this, arguments);
},
@ -9639,7 +9642,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
},
select: function () {
$(this.wrap.dom.input).click();
BI.Widget._renderEngine.createElement(this.wrap.dom.input).click();
},
upload: function (handler) {

2
dist/bundle.css vendored

@ -470,7 +470,7 @@ textarea {
.bi-split-left {
border-left: 1px solid #f2f4f7;
}
.bi-theme-dark .bi-border {
.bi-theme-dark .bi-split {
border: 1px solid #2F3149;
}
.bi-theme-dark .bi-split-top {

154
dist/bundle.js vendored

@ -15,7 +15,9 @@ if (typeof window !== "undefined") {
_global = this;
}
if (_global.BI == null) {
_global.BI = {};
_global.BI = {prepares: []};
} else {
_global.BI.prepares = [];
}/*!
* jQuery JavaScript Library v1.9.1
* http://jquery.com/
@ -21484,10 +21486,10 @@ _.extend(BI.OB.prototype, {
// if (o.root !== true) {
// throw new Error("root is a required property");
// }
this.element = $(o.element);
this.element = BI.Widget._renderEngine.createElement(this);
this._isRoot = true;
} else {
this.element = $(document.createElement(o.tagName));
this.element = BI.Widget._renderEngine.createElement(this);
}
this.element._isWidget = true;
if (o.baseCls || o.extraCls || o.cls) {
@ -21862,6 +21864,21 @@ _.extend(BI.OB.prototype, {
this.purgeListeners();
}
});
BI.Widget.registerRenderEngine = function (engine) {
BI.Widget._renderEngine = engine;
};
BI.Widget.registerRenderEngine({
createElement: function (widget) {
if(BI.isWidget(widget)) {
var o = widget.options;
if (o.element) {
return $(o.element);
}
return $(document.createElement(o.tagName));
}
return $(widget);
}
});
})();(function () {
var kv = {};
BI.shortcut = function (xtype, cls) {
@ -21882,6 +21899,10 @@ _.extend(BI.OB.prototype, {
};
BI.createWidget = function (item, options, context) {
// 先把准备环境准备好
while(BI.prepares && BI.prepares.length > 0) {
BI.prepares.shift()();
}
var el, w;
item || (item = {});
if (BI.isWidget(options)) {
@ -26017,7 +26038,7 @@ BI.RedMarkBehavior = BI.inherit(BI.Behavior, {
});
}
});// 工程配置
(function () {
BI.prepares.push(function () {
// 注册布局
var isSupportFlex = BI.isSupportCss3("flex");
BI.Plugin.registerWidget("bi.horizontal", function (ob) {
@ -26063,7 +26084,7 @@ BI.RedMarkBehavior = BI.inherit(BI.Behavior, {
return ob;
});
}());/**
});/**
* guy
* 控制器
* Controller层超类
@ -26406,7 +26427,7 @@ BI.LayerController = BI.inherit(BI.Controller, {
w = from.element;
}
if (BI.isNotEmptyString(w)) {
w = $(w);
w = BI.Widget._renderEngine.createElement(w);
}
if (this.has(name)) {
return this.get(name);
@ -26623,7 +26644,7 @@ BI.PopoverController = BI.inherit(BI.Controller, {
this.floatContainer[name].visible();
var popover = this.get(name);
popover.show && popover.show();
var W = $(this.options.render).width(), H = $(this.options.render).height();
var W = BI.Widget._renderEngine.createElement(this.options.render).width(), H = BI.Widget._renderEngine.createElement(this.options.render).height();
var w = popover.element.width(), h = popover.element.height();
var left = (W - w) / 2, top = (H - h) / 2;
if (left < 0) {
@ -26689,7 +26710,7 @@ BI.ResizeController = BI.inherit(BI.Controller, {
self._resize(ev);
// }
}, 30);
_global.$ && $(window).resize(fn);
BI.Widget._renderEngine.createElement(window).resize(fn);
},
_resize: function (ev) {
@ -26828,10 +26849,10 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
// var scale = context.element.offset().left / context.element.get(0).getBoundingClientRect().left;
// var x = (e.pageX || e.clientX) * scale + 15, y = (e.pageY || e.clientY) * scale + 15;
var x = (e.pageX || e.clientX) + 15, y = (e.pageY || e.clientY) + 15;
if (x + tooltip.element.outerWidth() > $("body").outerWidth()) {
if (x + tooltip.element.outerWidth() > BI.Widget._renderEngine.createElement("body").outerWidth()) {
x -= tooltip.element.outerWidth() + 15;
}
if (y + tooltip.element.outerHeight() > $("body").outerHeight()) {
if (y + tooltip.element.outerHeight() > BI.Widget._renderEngine.createElement("body").outerHeight()) {
y -= tooltip.element.outerHeight() + 15;
!opt.belowMouse && (y = Math.min(y, offset.top - tooltip.element.outerHeight() - 5));
} else {
@ -28000,7 +28021,7 @@ BI.extend(BI.DOM, {
},
isExist: function (obj) {
return $("body").find(obj.element).length > 0;
return BI.Widget._renderEngine.createElement("body").find(obj.element).length > 0;
},
// 预加载图片
@ -28176,7 +28197,7 @@ BI.extend(BI.DOM, {
},
getTextSizeWidth: function (text, fontSize) {
var span = $("<span></span>").addClass("text-width-span").appendTo($("body"));
var span = BI.Widget._renderEngine.createElement("<span></span>").addClass("text-width-span").appendTo($("body"));
if (fontSize == null) {
fontSize = 12;
@ -28194,11 +28215,11 @@ BI.extend(BI.DOM, {
// 获取滚动条的宽度
getScrollWidth: function () {
if (this._scrollWidth == null) {
var ul = $("<div>").width(50).height(50).css({
var ul = BI.Widget._renderEngine.createElement("<div>").width(50).height(50).css({
position: "absolute",
top: "-9999px",
overflow: "scroll"
}).appendTo($("body"));
}).appendTo("body");
this._scrollWidth = ul[0].offsetWidth - ul[0].clientWidth;
ul.destroy();
}
@ -28208,7 +28229,7 @@ BI.extend(BI.DOM, {
getImage: function (param, fillStyle, backgroundColor) {
var canvas = document.createElement("canvas");
var ratio = 2;
$("body").append(canvas);
BI.Widget._renderEngine.createElement("body").append(canvas);
var w = BI.DOM.getTextSizeWidth(param, 14) + 6;
canvas.width = w * ratio;
canvas.height = 24 * ratio;
@ -28218,7 +28239,7 @@ BI.extend(BI.DOM, {
ctx.fillStyle = fillStyle || "#3D4D66";
ctx.textBaseline = "middle";
ctx.fillText(param, 6 * ratio, 12 * ratio);
$(canvas).destroy();
BI.Widget._renderEngine.createElement(canvas).destroy();
var backColor = backgroundColor || "#EAF2FD";
// IE可以放大缩小所以要固定最大最小宽高
return {
@ -28854,7 +28875,7 @@ _.extend(Array.prototype, {
}
}
});
_global.$ && $(function () {
BI.prepares.push(function () {
// 牵扯到国际化这些常量在页面加载后再生效
// full day names
Date._DN = [BI.i18nText("BI-Basic_Sunday"),
@ -29057,25 +29078,7 @@ Date.prototype.getWeekEndDate = function () {
return this.getOffsetDate(Date._OFFSET[w < startOfWeek ? (7 + w - startOfWeek) : (w - startOfWeek)] + 6);
};
/** Checks date and time equality */
Date.prototype.equalsTo = function (date) {
return ((this.getFullYear() == date.getFullYear()) &&
(this.getMonth() == date.getMonth()) &&
(this.getDate() == date.getDate()) &&
(this.getHours() == date.getHours()) &&
(this.getMinutes() == date.getMinutes()) &&
(this.getSeconds() == date.getSeconds()));
};
/** Set only the year, month, date parts (keep existing time) */
Date.prototype.setDateOnly = function (date) {
var tmp = BI.getDate(date);
this.setDate(1);
this.setFullYear(tmp.getFullYear());
this.setMonth(tmp.getMonth());
this.setDate(tmp.getDate());
};
/** Prints the date in a string according to the given format. */
// 格式化打印日期
Date.prototype.print = function (str) {
var m = this.getMonth();
var d = this.getDate();
@ -30242,7 +30245,7 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.CenterAdaptLayout.superclass.render.apply(this, arguments);
this.$table = $("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative",
width: "100%",
height: "100%",
@ -30251,7 +30254,7 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
border: "none",
"border-collapse": "separate"
});
this.$tr = $("<tr>");
this.$tr = BI.Widget._renderEngine.createElement("<tr>");
this.$tr.appendTo(this.$table);
this.populate(this.options.items);
},
@ -30350,7 +30353,7 @@ BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.HorizontalAdaptLayout.superclass.render.apply(this, arguments);
this.$table = $("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative",
width: "100%",
"white-space": "nowrap",
@ -30358,7 +30361,7 @@ BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, {
border: "none",
"border-collapse": "separate"
});
this.$tr = $("<tr>");
this.$tr = BI.Widget._renderEngine.createElement("<tr>");
this.$tr.appendTo(this.$table);
this.populate(this.options.items);
},
@ -30627,7 +30630,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
render: function () {
BI.VerticalAdaptLayout.superclass.render.apply(this, arguments);
var o = this.options;
this.$table = $("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative",
width: o.horizontalAlign === BI.HorizontalAlign.Stretch ? "100%" : "auto",
height: "100%",
@ -30636,7 +30639,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
border: "none",
"border-collapse": "separate"
});
this.$tr = $("<tr>");
this.$tr = BI.Widget._renderEngine.createElement("<tr>");
this.$tr.appendTo(this.$table);
this.populate(this.options.items);
},
@ -31268,7 +31271,7 @@ BI.FlexCenterLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.FlexCenterLayout.superclass.render.apply(this, arguments);
this.$wrapper = $("<div>").addClass("flex-wrapper-center-layout-wrapper");
this.$wrapper = BI.Widget._renderEngine.createElement("<div>").addClass("flex-wrapper-center-layout-wrapper");
this.populate(this.options.items);
},
@ -31322,7 +31325,7 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, {
render: function () {
BI.FlexHorizontalLayout.superclass.render.apply(this, arguments);
var o = this.options;
this.$wrapper = $("<div>").addClass("flex-wrapper-horizontal-layout-wrapper " + o.verticalAlign);
this.$wrapper = BI.Widget._renderEngine.createElement("<div>").addClass("flex-wrapper-horizontal-layout-wrapper " + o.verticalAlign);
this.populate(this.options.items);
},
@ -31396,7 +31399,7 @@ BI.FlexVerticalCenter = BI.inherit(BI.Layout, {
render: function () {
BI.FlexVerticalCenter.superclass.render.apply(this, arguments);
var o = this.options;
this.$wrapper = $("<div>").addClass("flex-wrapper-vertical-center-wrapper " + o.horizontalAlign);
this.$wrapper = BI.Widget._renderEngine.createElement("<div>").addClass("flex-wrapper-vertical-center-wrapper " + o.horizontalAlign);
this.populate(this.options.items);
},
@ -32492,14 +32495,14 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.HorizontalLayout.superclass.render.apply(this, arguments);
this.$table = $("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative",
"white-space": "nowrap",
"border-spacing": "0px",
border: "none",
"border-collapse": "separate"
});
this.$tr = $("<tr>");
this.$tr = BI.Widget._renderEngine.createElement("<tr>");
this.$tr.appendTo(this.$table);
this.populate(this.options.items);
},
@ -33136,7 +33139,7 @@ BI.TdLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.TdLayout.superclass.render.apply(this, arguments);
this.$table = $("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative",
width: "100%",
height: "100%",
@ -35647,7 +35650,7 @@ BI.Single = BI.inherit(BI.Widget, {
clearTimeout(this.timeout);
}
this._hideTooltip();
$(this.element).unbind("mouseenter.title" + this.getName())
this.element.unbind("mouseenter.title" + this.getName())
.unbind("mousemove.title" + this.getName())
.unbind("mouseleave.title" + this.getName());
this._hoverBinded = false;
@ -35963,14 +35966,14 @@ BI.BasicButton = BI.inherit(BI.Single, {
var selected = false;
hand.mousedown(function (e) {
// if (e.button === 0) {
$(document).bind("mouseup." + self.getName(), function (e) {
BI.Widget._renderEngine.createElement(document).bind("mouseup." + self.getName(), function (e) {
// if (e.button === 0) {
if (BI.DOM.isExist(self) && !hand.__isMouseInBounds__(e) && mouseDown === true && !selected) {
// self.setSelected(!self.isSelected());
self._trigger();
}
mouseDown = false;
$(document).unbind("mouseup." + self.getName());
BI.Widget._renderEngine.createElement(document).unbind("mouseup." + self.getName());
// }
});
if (mouseDown === true) {
@ -35992,7 +35995,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
}
mouseDown = false;
selected = false;
$(document).unbind("mouseup." + self.getName());
BI.Widget._renderEngine.createElement(document).unbind("mouseup." + self.getName());
// }
});
break;
@ -36003,11 +36006,11 @@ BI.BasicButton = BI.inherit(BI.Single, {
var mouseDown = false;
var interval;
hand.mousedown(function (e) {
$(document).bind("mouseup." + self.getName(), function (e) {
BI.Widget._renderEngine.createElement(document).bind("mouseup." + self.getName(), function (e) {
interval && clearInterval(interval);
interval = null;
mouseDown = false;
$(document).unbind("mouseup." + self.getName());
BI.Widget._renderEngine.createElement(document).unbind("mouseup." + self.getName());
});
if (mouseDown === true) {
return;
@ -36237,7 +36240,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
},
empty: function () {
$(document).unbind("mouseup." + this.getName());
BI.Widget._renderEngine.createElement(document).unbind("mouseup." + this.getName());
BI.BasicButton.superclass.empty.apply(this, arguments);
},
@ -37731,14 +37734,17 @@ BI.PartTree = BI.inherit(BI.AsyncTree, {
}
});
BI.shortcut("bi.part_tree", BI.PartTree);BI.Resizers = new BI.ResizeController();
BI.shortcut("bi.part_tree", BI.PartTree);BI.prepares.push(function () {
BI.Resizers = new BI.ResizeController();
BI.Layers = new BI.LayerController();
BI.Maskers = new BI.MaskersController();
BI.Bubbles = new BI.BubblesController();
BI.Tooltips = new BI.TooltipsController();
BI.Popovers = new BI.PopoverController();
BI.Broadcasts = new BI.BroadcastController();
BI.StyleLoaders = new BI.StyleLoaderManager();/**
BI.StyleLoaders = new BI.StyleLoaderManager();
});
/**
* CollectionView
*
* Created by GUY on 2016/1/15.
@ -38380,7 +38386,7 @@ BI.Combo = BI.inherit(BI.Widget, {
// BI-10290 公式combo双击公式内容会收起
if ((this.element.find(e.target).length > 0 && e.type !== "mousewheel")
|| (this.popupView && this.popupView.element.find(e.target).length > 0)
|| e.target.className === "CodeMirror-cursor" || $(e.target).closest(".CodeMirror-hints").length > 0) {// BI-9887 CodeMirror的公式弹框需要特殊处理下
|| e.target.className === "CodeMirror-cursor" || BI.Widget._renderEngine.createElement(e.target).closest(".CodeMirror-hints").length > 0) {// BI-9887 CodeMirror的公式弹框需要特殊处理下
return;
}
var isHide = this.options.hideChecker.apply(this, [e]);
@ -38401,7 +38407,7 @@ BI.Combo = BI.inherit(BI.Widget, {
}
this.element.removeClass(this.options.comboClass);
$(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW);
},
@ -38414,8 +38420,8 @@ BI.Combo = BI.inherit(BI.Widget, {
this.adjustHeight();
this.element.addClass(this.options.comboClass);
$(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
$(document).bind("mousedown." + this.getName(), BI.bind(this._hideIf, this)).bind("mousewheel." + this.getName(), BI.bind(this._hideIf, this));
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
BI.Widget._renderEngine.createElement(document).bind("mousedown." + this.getName(), BI.bind(this._hideIf, this)).bind("mousewheel." + this.getName(), BI.bind(this._hideIf, this));
this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW);
},
@ -38583,7 +38589,7 @@ BI.Combo = BI.inherit(BI.Widget, {
},
destroy: function () {
$(document).unbind("mousedown." + this.getName())
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName())
.unbind("mousewheel." + this.getName())
.unbind("mouseenter." + this.getName())
.unbind("mousemove." + this.getName())
@ -40320,7 +40326,7 @@ BI.Msg = function () {
},
toast: function (message, options, context) {
options = options || {};
context = context || $("body");
context = context || BI.Widget._renderEngine.createElement("body");
var level = options.level || "normal";
var autoClose = BI.isNull(options.autoClose) ? true : options.autoClose;
var toast = BI.createWidget({
@ -40350,7 +40356,7 @@ BI.Msg = function () {
}, 5000);
},
_show: function (hasCancel, title, message, callback) {
$mask = $("<div class=\"bi-z-index-mask\">").css({
$mask = BI.Widget._renderEngine.createElement("<div class=\"bi-z-index-mask\">").css({
position: "absolute",
zIndex: BI.zIndex_tip - 2,
top: 0,
@ -40359,7 +40365,7 @@ BI.Msg = function () {
bottom: 0,
opacity: 0.5
}).appendTo("body");
$pop = $("<div class=\"bi-message-depend\">").css({
$pop = BI.Widget._renderEngine.createElement("<div class=\"bi-message-depend\">").css({
position: "absolute",
zIndex: BI.zIndex_tip - 1,
top: 0,
@ -40886,7 +40892,7 @@ BI.Popover = BI.inherit(BI.Widget, {
this.startY = 0;
this.tracker = new BI.MouseMoveTracker(function (deltaX, deltaY) {
var size = self._calculateSize();
var W = $("body").width(), H = $("body").height();
var W = BI.Widget._renderEngine.createElement("body").width(), H = BI.Widget._renderEngine.createElement("body").height();
self.startX += deltaX;
self.startY += deltaY;
self.element.css({
@ -41206,7 +41212,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
return BI.createWidget({
type: "bi.center",
cls: "list-view-toolbar bi-high-light bi-border-top",
cls: "list-view-toolbar bi-high-light bi-split-top",
height: 24,
items: BI.createItems(o.buttons, {
once: false,
@ -44031,9 +44037,9 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
self._focus();
self.fireEvent(BI.TextAreaEditor.EVENT_FOCUS);
}
$(document).bind("mousedown." + self.getName(), function (e) {
BI.Widget._renderEngine.createElement(document).bind("mousedown." + self.getName(), function (e) {
if (BI.DOM.isExist(self) && !self.element.__isMouseInBounds__(e)) {
$(document).unbind("mousedown." + self.getName());
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + self.getName());
self.content.element.blur();
}
});
@ -44043,7 +44049,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
self._blur();
self.fireEvent(BI.TextAreaEditor.EVENT_BLUR);
}
$(document).unbind("mousedown." + self.getName());
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + self.getName());
});
if (BI.isKey(o.value)) {
self.setValue(o.value);
@ -44183,7 +44189,7 @@ BI.Iframe = BI.inherit(BI.Single, {
_init: function () {
var o = this.options;
this.options.element = $("<iframe frameborder='0' src='" + o.src + "'>");
this.options.element = BI.Widget._renderEngine.createElement("<iframe frameborder='0' src='" + o.src + "'>");
BI.Iframe.superclass._init.apply(this, arguments);
},
@ -44235,7 +44241,7 @@ BI.Img = BI.inherit(BI.Single, {
_init: function () {
var o = this.options;
this.options.element = $("<img src='" + o.src + "'>");
this.options.element = BI.Widget._renderEngine.createElement("<img src='" + o.src + "'>");
BI.Img.superclass._init.apply(this, arguments);
},
@ -44866,7 +44872,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
},
select: function () {
$(this.wrap.dom.input).click();
BI.Widget._renderEngine.createElement(this.wrap.dom.input).click();
},
upload: function (handler) {
@ -55427,7 +55433,7 @@ BI.MultiPopupView = BI.inherit(BI.PopupView, {
this.buttongroup = BI.createWidget({
type: "bi.button_group",
cls: "list-view-toolbar bi-high-light bi-border-top",
cls: "list-view-toolbar bi-high-light bi-split-top",
height: 24,
items: BI.createItems(text, {
type: "bi.text_button",

2
dist/bundle.min.css vendored

File diff suppressed because one or more lines are too long

68
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/case.js vendored

@ -6842,7 +6842,7 @@ BI.MultiPopupView = BI.inherit(BI.PopupView, {
this.buttongroup = BI.createWidget({
type: "bi.button_group",
cls: "list-view-toolbar bi-high-light bi-border-top",
cls: "list-view-toolbar bi-high-light bi-split-top",
height: 24,
items: BI.createItems(text, {
type: "bi.text_button",

2
dist/core.css vendored

@ -470,7 +470,7 @@ textarea {
.bi-split-left {
border-left: 1px solid #f2f4f7;
}
.bi-theme-dark .bi-border {
.bi-theme-dark .bi-split {
border: 1px solid #2F3149;
}
.bi-theme-dark .bi-split-top {

99
dist/core.js vendored

@ -15,7 +15,9 @@ if (typeof window !== "undefined") {
_global = this;
}
if (_global.BI == null) {
_global.BI = {};
_global.BI = {prepares: []};
} else {
_global.BI.prepares = [];
}/*!
* jQuery JavaScript Library v1.9.1
* http://jquery.com/
@ -21484,10 +21486,10 @@ _.extend(BI.OB.prototype, {
// if (o.root !== true) {
// throw new Error("root is a required property");
// }
this.element = $(o.element);
this.element = BI.Widget._renderEngine.createElement(this);
this._isRoot = true;
} else {
this.element = $(document.createElement(o.tagName));
this.element = BI.Widget._renderEngine.createElement(this);
}
this.element._isWidget = true;
if (o.baseCls || o.extraCls || o.cls) {
@ -21862,6 +21864,21 @@ _.extend(BI.OB.prototype, {
this.purgeListeners();
}
});
BI.Widget.registerRenderEngine = function (engine) {
BI.Widget._renderEngine = engine;
};
BI.Widget.registerRenderEngine({
createElement: function (widget) {
if(BI.isWidget(widget)) {
var o = widget.options;
if (o.element) {
return $(o.element);
}
return $(document.createElement(o.tagName));
}
return $(widget);
}
});
})();(function () {
var kv = {};
BI.shortcut = function (xtype, cls) {
@ -21882,6 +21899,10 @@ _.extend(BI.OB.prototype, {
};
BI.createWidget = function (item, options, context) {
// 先把准备环境准备好
while(BI.prepares && BI.prepares.length > 0) {
BI.prepares.shift()();
}
var el, w;
item || (item = {});
if (BI.isWidget(options)) {
@ -26017,7 +26038,7 @@ BI.RedMarkBehavior = BI.inherit(BI.Behavior, {
});
}
});// 工程配置
(function () {
BI.prepares.push(function () {
// 注册布局
var isSupportFlex = BI.isSupportCss3("flex");
BI.Plugin.registerWidget("bi.horizontal", function (ob) {
@ -26063,7 +26084,7 @@ BI.RedMarkBehavior = BI.inherit(BI.Behavior, {
return ob;
});
}());/**
});/**
* guy
* 控制器
* Controller层超类
@ -26406,7 +26427,7 @@ BI.LayerController = BI.inherit(BI.Controller, {
w = from.element;
}
if (BI.isNotEmptyString(w)) {
w = $(w);
w = BI.Widget._renderEngine.createElement(w);
}
if (this.has(name)) {
return this.get(name);
@ -26623,7 +26644,7 @@ BI.PopoverController = BI.inherit(BI.Controller, {
this.floatContainer[name].visible();
var popover = this.get(name);
popover.show && popover.show();
var W = $(this.options.render).width(), H = $(this.options.render).height();
var W = BI.Widget._renderEngine.createElement(this.options.render).width(), H = BI.Widget._renderEngine.createElement(this.options.render).height();
var w = popover.element.width(), h = popover.element.height();
var left = (W - w) / 2, top = (H - h) / 2;
if (left < 0) {
@ -26689,7 +26710,7 @@ BI.ResizeController = BI.inherit(BI.Controller, {
self._resize(ev);
// }
}, 30);
_global.$ && $(window).resize(fn);
BI.Widget._renderEngine.createElement(window).resize(fn);
},
_resize: function (ev) {
@ -26828,10 +26849,10 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
// var scale = context.element.offset().left / context.element.get(0).getBoundingClientRect().left;
// var x = (e.pageX || e.clientX) * scale + 15, y = (e.pageY || e.clientY) * scale + 15;
var x = (e.pageX || e.clientX) + 15, y = (e.pageY || e.clientY) + 15;
if (x + tooltip.element.outerWidth() > $("body").outerWidth()) {
if (x + tooltip.element.outerWidth() > BI.Widget._renderEngine.createElement("body").outerWidth()) {
x -= tooltip.element.outerWidth() + 15;
}
if (y + tooltip.element.outerHeight() > $("body").outerHeight()) {
if (y + tooltip.element.outerHeight() > BI.Widget._renderEngine.createElement("body").outerHeight()) {
y -= tooltip.element.outerHeight() + 15;
!opt.belowMouse && (y = Math.min(y, offset.top - tooltip.element.outerHeight() - 5));
} else {
@ -28000,7 +28021,7 @@ BI.extend(BI.DOM, {
},
isExist: function (obj) {
return $("body").find(obj.element).length > 0;
return BI.Widget._renderEngine.createElement("body").find(obj.element).length > 0;
},
// 预加载图片
@ -28176,7 +28197,7 @@ BI.extend(BI.DOM, {
},
getTextSizeWidth: function (text, fontSize) {
var span = $("<span></span>").addClass("text-width-span").appendTo($("body"));
var span = BI.Widget._renderEngine.createElement("<span></span>").addClass("text-width-span").appendTo($("body"));
if (fontSize == null) {
fontSize = 12;
@ -28194,11 +28215,11 @@ BI.extend(BI.DOM, {
// 获取滚动条的宽度
getScrollWidth: function () {
if (this._scrollWidth == null) {
var ul = $("<div>").width(50).height(50).css({
var ul = BI.Widget._renderEngine.createElement("<div>").width(50).height(50).css({
position: "absolute",
top: "-9999px",
overflow: "scroll"
}).appendTo($("body"));
}).appendTo("body");
this._scrollWidth = ul[0].offsetWidth - ul[0].clientWidth;
ul.destroy();
}
@ -28208,7 +28229,7 @@ BI.extend(BI.DOM, {
getImage: function (param, fillStyle, backgroundColor) {
var canvas = document.createElement("canvas");
var ratio = 2;
$("body").append(canvas);
BI.Widget._renderEngine.createElement("body").append(canvas);
var w = BI.DOM.getTextSizeWidth(param, 14) + 6;
canvas.width = w * ratio;
canvas.height = 24 * ratio;
@ -28218,7 +28239,7 @@ BI.extend(BI.DOM, {
ctx.fillStyle = fillStyle || "#3D4D66";
ctx.textBaseline = "middle";
ctx.fillText(param, 6 * ratio, 12 * ratio);
$(canvas).destroy();
BI.Widget._renderEngine.createElement(canvas).destroy();
var backColor = backgroundColor || "#EAF2FD";
// IE可以放大缩小所以要固定最大最小宽高
return {
@ -28854,7 +28875,7 @@ _.extend(Array.prototype, {
}
}
});
_global.$ && $(function () {
BI.prepares.push(function () {
// 牵扯到国际化这些常量在页面加载后再生效
// full day names
Date._DN = [BI.i18nText("BI-Basic_Sunday"),
@ -29057,25 +29078,7 @@ Date.prototype.getWeekEndDate = function () {
return this.getOffsetDate(Date._OFFSET[w < startOfWeek ? (7 + w - startOfWeek) : (w - startOfWeek)] + 6);
};
/** Checks date and time equality */
Date.prototype.equalsTo = function (date) {
return ((this.getFullYear() == date.getFullYear()) &&
(this.getMonth() == date.getMonth()) &&
(this.getDate() == date.getDate()) &&
(this.getHours() == date.getHours()) &&
(this.getMinutes() == date.getMinutes()) &&
(this.getSeconds() == date.getSeconds()));
};
/** Set only the year, month, date parts (keep existing time) */
Date.prototype.setDateOnly = function (date) {
var tmp = BI.getDate(date);
this.setDate(1);
this.setFullYear(tmp.getFullYear());
this.setMonth(tmp.getMonth());
this.setDate(tmp.getDate());
};
/** Prints the date in a string according to the given format. */
// 格式化打印日期
Date.prototype.print = function (str) {
var m = this.getMonth();
var d = this.getDate();
@ -30242,7 +30245,7 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.CenterAdaptLayout.superclass.render.apply(this, arguments);
this.$table = $("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative",
width: "100%",
height: "100%",
@ -30251,7 +30254,7 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
border: "none",
"border-collapse": "separate"
});
this.$tr = $("<tr>");
this.$tr = BI.Widget._renderEngine.createElement("<tr>");
this.$tr.appendTo(this.$table);
this.populate(this.options.items);
},
@ -30350,7 +30353,7 @@ BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.HorizontalAdaptLayout.superclass.render.apply(this, arguments);
this.$table = $("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative",
width: "100%",
"white-space": "nowrap",
@ -30358,7 +30361,7 @@ BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, {
border: "none",
"border-collapse": "separate"
});
this.$tr = $("<tr>");
this.$tr = BI.Widget._renderEngine.createElement("<tr>");
this.$tr.appendTo(this.$table);
this.populate(this.options.items);
},
@ -30627,7 +30630,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
render: function () {
BI.VerticalAdaptLayout.superclass.render.apply(this, arguments);
var o = this.options;
this.$table = $("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative",
width: o.horizontalAlign === BI.HorizontalAlign.Stretch ? "100%" : "auto",
height: "100%",
@ -30636,7 +30639,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
border: "none",
"border-collapse": "separate"
});
this.$tr = $("<tr>");
this.$tr = BI.Widget._renderEngine.createElement("<tr>");
this.$tr.appendTo(this.$table);
this.populate(this.options.items);
},
@ -31268,7 +31271,7 @@ BI.FlexCenterLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.FlexCenterLayout.superclass.render.apply(this, arguments);
this.$wrapper = $("<div>").addClass("flex-wrapper-center-layout-wrapper");
this.$wrapper = BI.Widget._renderEngine.createElement("<div>").addClass("flex-wrapper-center-layout-wrapper");
this.populate(this.options.items);
},
@ -31322,7 +31325,7 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, {
render: function () {
BI.FlexHorizontalLayout.superclass.render.apply(this, arguments);
var o = this.options;
this.$wrapper = $("<div>").addClass("flex-wrapper-horizontal-layout-wrapper " + o.verticalAlign);
this.$wrapper = BI.Widget._renderEngine.createElement("<div>").addClass("flex-wrapper-horizontal-layout-wrapper " + o.verticalAlign);
this.populate(this.options.items);
},
@ -31396,7 +31399,7 @@ BI.FlexVerticalCenter = BI.inherit(BI.Layout, {
render: function () {
BI.FlexVerticalCenter.superclass.render.apply(this, arguments);
var o = this.options;
this.$wrapper = $("<div>").addClass("flex-wrapper-vertical-center-wrapper " + o.horizontalAlign);
this.$wrapper = BI.Widget._renderEngine.createElement("<div>").addClass("flex-wrapper-vertical-center-wrapper " + o.horizontalAlign);
this.populate(this.options.items);
},
@ -32492,14 +32495,14 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.HorizontalLayout.superclass.render.apply(this, arguments);
this.$table = $("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative",
"white-space": "nowrap",
"border-spacing": "0px",
border: "none",
"border-collapse": "separate"
});
this.$tr = $("<tr>");
this.$tr = BI.Widget._renderEngine.createElement("<tr>");
this.$tr.appendTo(this.$table);
this.populate(this.options.items);
},
@ -33136,7 +33139,7 @@ BI.TdLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.TdLayout.superclass.render.apply(this, arguments);
this.$table = $("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative",
width: "100%",
height: "100%",

2
dist/core_without_normalize.css vendored

@ -189,7 +189,7 @@ textarea {
.bi-split-left {
border-left: 1px solid #f2f4f7;
}
.bi-theme-dark .bi-border {
.bi-theme-dark .bi-split {
border: 1px solid #2F3149;
}
.bi-theme-dark .bi-split-top {

2
dist/fineui.css vendored

@ -470,7 +470,7 @@ textarea {
.bi-split-left {
border-left: 1px solid #f2f4f7;
}
.bi-theme-dark .bi-border {
.bi-theme-dark .bi-split {
border: 1px solid #2F3149;
}
.bi-theme-dark .bi-split-top {

158
dist/fineui.js vendored

@ -15,7 +15,9 @@ if (typeof window !== "undefined") {
_global = this;
}
if (_global.BI == null) {
_global.BI = {};
_global.BI = {prepares: []};
} else {
_global.BI.prepares = [];
}// Production steps of ECMA-262, Edition 5, 15.4.4.14
// Reference: http://es5.github.io/#x15.4.4.14
if (!Array.prototype.indexOf) {
@ -254,7 +256,9 @@ if (typeof window !== "undefined") {
_global = this;
}
if (_global.BI == null) {
_global.BI = {};
_global.BI = {prepares: []};
} else {
_global.BI.prepares = [];
}/*!
* jQuery JavaScript Library v1.9.1
* http://jquery.com/
@ -21723,10 +21727,10 @@ _.extend(BI.OB.prototype, {
// if (o.root !== true) {
// throw new Error("root is a required property");
// }
this.element = $(o.element);
this.element = BI.Widget._renderEngine.createElement(this);
this._isRoot = true;
} else {
this.element = $(document.createElement(o.tagName));
this.element = BI.Widget._renderEngine.createElement(this);
}
this.element._isWidget = true;
if (o.baseCls || o.extraCls || o.cls) {
@ -22101,6 +22105,21 @@ _.extend(BI.OB.prototype, {
this.purgeListeners();
}
});
BI.Widget.registerRenderEngine = function (engine) {
BI.Widget._renderEngine = engine;
};
BI.Widget.registerRenderEngine({
createElement: function (widget) {
if(BI.isWidget(widget)) {
var o = widget.options;
if (o.element) {
return $(o.element);
}
return $(document.createElement(o.tagName));
}
return $(widget);
}
});
})();(function () {
var kv = {};
BI.shortcut = function (xtype, cls) {
@ -22121,6 +22140,10 @@ _.extend(BI.OB.prototype, {
};
BI.createWidget = function (item, options, context) {
// 先把准备环境准备好
while(BI.prepares && BI.prepares.length > 0) {
BI.prepares.shift()();
}
var el, w;
item || (item = {});
if (BI.isWidget(options)) {
@ -26256,7 +26279,7 @@ BI.RedMarkBehavior = BI.inherit(BI.Behavior, {
});
}
});// 工程配置
(function () {
BI.prepares.push(function () {
// 注册布局
var isSupportFlex = BI.isSupportCss3("flex");
BI.Plugin.registerWidget("bi.horizontal", function (ob) {
@ -26302,7 +26325,7 @@ BI.RedMarkBehavior = BI.inherit(BI.Behavior, {
return ob;
});
}());/**
});/**
* guy
* 控制器
* Controller层超类
@ -26645,7 +26668,7 @@ BI.LayerController = BI.inherit(BI.Controller, {
w = from.element;
}
if (BI.isNotEmptyString(w)) {
w = $(w);
w = BI.Widget._renderEngine.createElement(w);
}
if (this.has(name)) {
return this.get(name);
@ -26862,7 +26885,7 @@ BI.PopoverController = BI.inherit(BI.Controller, {
this.floatContainer[name].visible();
var popover = this.get(name);
popover.show && popover.show();
var W = $(this.options.render).width(), H = $(this.options.render).height();
var W = BI.Widget._renderEngine.createElement(this.options.render).width(), H = BI.Widget._renderEngine.createElement(this.options.render).height();
var w = popover.element.width(), h = popover.element.height();
var left = (W - w) / 2, top = (H - h) / 2;
if (left < 0) {
@ -26928,7 +26951,7 @@ BI.ResizeController = BI.inherit(BI.Controller, {
self._resize(ev);
// }
}, 30);
_global.$ && $(window).resize(fn);
BI.Widget._renderEngine.createElement(window).resize(fn);
},
_resize: function (ev) {
@ -27067,10 +27090,10 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
// var scale = context.element.offset().left / context.element.get(0).getBoundingClientRect().left;
// var x = (e.pageX || e.clientX) * scale + 15, y = (e.pageY || e.clientY) * scale + 15;
var x = (e.pageX || e.clientX) + 15, y = (e.pageY || e.clientY) + 15;
if (x + tooltip.element.outerWidth() > $("body").outerWidth()) {
if (x + tooltip.element.outerWidth() > BI.Widget._renderEngine.createElement("body").outerWidth()) {
x -= tooltip.element.outerWidth() + 15;
}
if (y + tooltip.element.outerHeight() > $("body").outerHeight()) {
if (y + tooltip.element.outerHeight() > BI.Widget._renderEngine.createElement("body").outerHeight()) {
y -= tooltip.element.outerHeight() + 15;
!opt.belowMouse && (y = Math.min(y, offset.top - tooltip.element.outerHeight() - 5));
} else {
@ -28239,7 +28262,7 @@ BI.extend(BI.DOM, {
},
isExist: function (obj) {
return $("body").find(obj.element).length > 0;
return BI.Widget._renderEngine.createElement("body").find(obj.element).length > 0;
},
// 预加载图片
@ -28415,7 +28438,7 @@ BI.extend(BI.DOM, {
},
getTextSizeWidth: function (text, fontSize) {
var span = $("<span></span>").addClass("text-width-span").appendTo($("body"));
var span = BI.Widget._renderEngine.createElement("<span></span>").addClass("text-width-span").appendTo($("body"));
if (fontSize == null) {
fontSize = 12;
@ -28433,11 +28456,11 @@ BI.extend(BI.DOM, {
// 获取滚动条的宽度
getScrollWidth: function () {
if (this._scrollWidth == null) {
var ul = $("<div>").width(50).height(50).css({
var ul = BI.Widget._renderEngine.createElement("<div>").width(50).height(50).css({
position: "absolute",
top: "-9999px",
overflow: "scroll"
}).appendTo($("body"));
}).appendTo("body");
this._scrollWidth = ul[0].offsetWidth - ul[0].clientWidth;
ul.destroy();
}
@ -28447,7 +28470,7 @@ BI.extend(BI.DOM, {
getImage: function (param, fillStyle, backgroundColor) {
var canvas = document.createElement("canvas");
var ratio = 2;
$("body").append(canvas);
BI.Widget._renderEngine.createElement("body").append(canvas);
var w = BI.DOM.getTextSizeWidth(param, 14) + 6;
canvas.width = w * ratio;
canvas.height = 24 * ratio;
@ -28457,7 +28480,7 @@ BI.extend(BI.DOM, {
ctx.fillStyle = fillStyle || "#3D4D66";
ctx.textBaseline = "middle";
ctx.fillText(param, 6 * ratio, 12 * ratio);
$(canvas).destroy();
BI.Widget._renderEngine.createElement(canvas).destroy();
var backColor = backgroundColor || "#EAF2FD";
// IE可以放大缩小所以要固定最大最小宽高
return {
@ -29093,7 +29116,7 @@ _.extend(Array.prototype, {
}
}
});
_global.$ && $(function () {
BI.prepares.push(function () {
// 牵扯到国际化这些常量在页面加载后再生效
// full day names
Date._DN = [BI.i18nText("BI-Basic_Sunday"),
@ -29296,25 +29319,7 @@ Date.prototype.getWeekEndDate = function () {
return this.getOffsetDate(Date._OFFSET[w < startOfWeek ? (7 + w - startOfWeek) : (w - startOfWeek)] + 6);
};
/** Checks date and time equality */
Date.prototype.equalsTo = function (date) {
return ((this.getFullYear() == date.getFullYear()) &&
(this.getMonth() == date.getMonth()) &&
(this.getDate() == date.getDate()) &&
(this.getHours() == date.getHours()) &&
(this.getMinutes() == date.getMinutes()) &&
(this.getSeconds() == date.getSeconds()));
};
/** Set only the year, month, date parts (keep existing time) */
Date.prototype.setDateOnly = function (date) {
var tmp = BI.getDate(date);
this.setDate(1);
this.setFullYear(tmp.getFullYear());
this.setMonth(tmp.getMonth());
this.setDate(tmp.getDate());
};
/** Prints the date in a string according to the given format. */
// 格式化打印日期
Date.prototype.print = function (str) {
var m = this.getMonth();
var d = this.getDate();
@ -30481,7 +30486,7 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.CenterAdaptLayout.superclass.render.apply(this, arguments);
this.$table = $("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative",
width: "100%",
height: "100%",
@ -30490,7 +30495,7 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
border: "none",
"border-collapse": "separate"
});
this.$tr = $("<tr>");
this.$tr = BI.Widget._renderEngine.createElement("<tr>");
this.$tr.appendTo(this.$table);
this.populate(this.options.items);
},
@ -30589,7 +30594,7 @@ BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.HorizontalAdaptLayout.superclass.render.apply(this, arguments);
this.$table = $("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative",
width: "100%",
"white-space": "nowrap",
@ -30597,7 +30602,7 @@ BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, {
border: "none",
"border-collapse": "separate"
});
this.$tr = $("<tr>");
this.$tr = BI.Widget._renderEngine.createElement("<tr>");
this.$tr.appendTo(this.$table);
this.populate(this.options.items);
},
@ -30866,7 +30871,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
render: function () {
BI.VerticalAdaptLayout.superclass.render.apply(this, arguments);
var o = this.options;
this.$table = $("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative",
width: o.horizontalAlign === BI.HorizontalAlign.Stretch ? "100%" : "auto",
height: "100%",
@ -30875,7 +30880,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
border: "none",
"border-collapse": "separate"
});
this.$tr = $("<tr>");
this.$tr = BI.Widget._renderEngine.createElement("<tr>");
this.$tr.appendTo(this.$table);
this.populate(this.options.items);
},
@ -31507,7 +31512,7 @@ BI.FlexCenterLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.FlexCenterLayout.superclass.render.apply(this, arguments);
this.$wrapper = $("<div>").addClass("flex-wrapper-center-layout-wrapper");
this.$wrapper = BI.Widget._renderEngine.createElement("<div>").addClass("flex-wrapper-center-layout-wrapper");
this.populate(this.options.items);
},
@ -31561,7 +31566,7 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, {
render: function () {
BI.FlexHorizontalLayout.superclass.render.apply(this, arguments);
var o = this.options;
this.$wrapper = $("<div>").addClass("flex-wrapper-horizontal-layout-wrapper " + o.verticalAlign);
this.$wrapper = BI.Widget._renderEngine.createElement("<div>").addClass("flex-wrapper-horizontal-layout-wrapper " + o.verticalAlign);
this.populate(this.options.items);
},
@ -31635,7 +31640,7 @@ BI.FlexVerticalCenter = BI.inherit(BI.Layout, {
render: function () {
BI.FlexVerticalCenter.superclass.render.apply(this, arguments);
var o = this.options;
this.$wrapper = $("<div>").addClass("flex-wrapper-vertical-center-wrapper " + o.horizontalAlign);
this.$wrapper = BI.Widget._renderEngine.createElement("<div>").addClass("flex-wrapper-vertical-center-wrapper " + o.horizontalAlign);
this.populate(this.options.items);
},
@ -32731,14 +32736,14 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.HorizontalLayout.superclass.render.apply(this, arguments);
this.$table = $("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative",
"white-space": "nowrap",
"border-spacing": "0px",
border: "none",
"border-collapse": "separate"
});
this.$tr = $("<tr>");
this.$tr = BI.Widget._renderEngine.createElement("<tr>");
this.$tr.appendTo(this.$table);
this.populate(this.options.items);
},
@ -33375,7 +33380,7 @@ BI.TdLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.TdLayout.superclass.render.apply(this, arguments);
this.$table = $("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative",
width: "100%",
height: "100%",
@ -35886,7 +35891,7 @@ BI.Single = BI.inherit(BI.Widget, {
clearTimeout(this.timeout);
}
this._hideTooltip();
$(this.element).unbind("mouseenter.title" + this.getName())
this.element.unbind("mouseenter.title" + this.getName())
.unbind("mousemove.title" + this.getName())
.unbind("mouseleave.title" + this.getName());
this._hoverBinded = false;
@ -36202,14 +36207,14 @@ BI.BasicButton = BI.inherit(BI.Single, {
var selected = false;
hand.mousedown(function (e) {
// if (e.button === 0) {
$(document).bind("mouseup." + self.getName(), function (e) {
BI.Widget._renderEngine.createElement(document).bind("mouseup." + self.getName(), function (e) {
// if (e.button === 0) {
if (BI.DOM.isExist(self) && !hand.__isMouseInBounds__(e) && mouseDown === true && !selected) {
// self.setSelected(!self.isSelected());
self._trigger();
}
mouseDown = false;
$(document).unbind("mouseup." + self.getName());
BI.Widget._renderEngine.createElement(document).unbind("mouseup." + self.getName());
// }
});
if (mouseDown === true) {
@ -36231,7 +36236,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
}
mouseDown = false;
selected = false;
$(document).unbind("mouseup." + self.getName());
BI.Widget._renderEngine.createElement(document).unbind("mouseup." + self.getName());
// }
});
break;
@ -36242,11 +36247,11 @@ BI.BasicButton = BI.inherit(BI.Single, {
var mouseDown = false;
var interval;
hand.mousedown(function (e) {
$(document).bind("mouseup." + self.getName(), function (e) {
BI.Widget._renderEngine.createElement(document).bind("mouseup." + self.getName(), function (e) {
interval && clearInterval(interval);
interval = null;
mouseDown = false;
$(document).unbind("mouseup." + self.getName());
BI.Widget._renderEngine.createElement(document).unbind("mouseup." + self.getName());
});
if (mouseDown === true) {
return;
@ -36476,7 +36481,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
},
empty: function () {
$(document).unbind("mouseup." + this.getName());
BI.Widget._renderEngine.createElement(document).unbind("mouseup." + this.getName());
BI.BasicButton.superclass.empty.apply(this, arguments);
},
@ -37970,14 +37975,17 @@ BI.PartTree = BI.inherit(BI.AsyncTree, {
}
});
BI.shortcut("bi.part_tree", BI.PartTree);BI.Resizers = new BI.ResizeController();
BI.shortcut("bi.part_tree", BI.PartTree);BI.prepares.push(function () {
BI.Resizers = new BI.ResizeController();
BI.Layers = new BI.LayerController();
BI.Maskers = new BI.MaskersController();
BI.Bubbles = new BI.BubblesController();
BI.Tooltips = new BI.TooltipsController();
BI.Popovers = new BI.PopoverController();
BI.Broadcasts = new BI.BroadcastController();
BI.StyleLoaders = new BI.StyleLoaderManager();/**
BI.StyleLoaders = new BI.StyleLoaderManager();
});
/**
* CollectionView
*
* Created by GUY on 2016/1/15.
@ -38619,7 +38627,7 @@ BI.Combo = BI.inherit(BI.Widget, {
// BI-10290 公式combo双击公式内容会收起
if ((this.element.find(e.target).length > 0 && e.type !== "mousewheel")
|| (this.popupView && this.popupView.element.find(e.target).length > 0)
|| e.target.className === "CodeMirror-cursor" || $(e.target).closest(".CodeMirror-hints").length > 0) {// BI-9887 CodeMirror的公式弹框需要特殊处理下
|| e.target.className === "CodeMirror-cursor" || BI.Widget._renderEngine.createElement(e.target).closest(".CodeMirror-hints").length > 0) {// BI-9887 CodeMirror的公式弹框需要特殊处理下
return;
}
var isHide = this.options.hideChecker.apply(this, [e]);
@ -38640,7 +38648,7 @@ BI.Combo = BI.inherit(BI.Widget, {
}
this.element.removeClass(this.options.comboClass);
$(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW);
},
@ -38653,8 +38661,8 @@ BI.Combo = BI.inherit(BI.Widget, {
this.adjustHeight();
this.element.addClass(this.options.comboClass);
$(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
$(document).bind("mousedown." + this.getName(), BI.bind(this._hideIf, this)).bind("mousewheel." + this.getName(), BI.bind(this._hideIf, this));
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
BI.Widget._renderEngine.createElement(document).bind("mousedown." + this.getName(), BI.bind(this._hideIf, this)).bind("mousewheel." + this.getName(), BI.bind(this._hideIf, this));
this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW);
},
@ -38822,7 +38830,7 @@ BI.Combo = BI.inherit(BI.Widget, {
},
destroy: function () {
$(document).unbind("mousedown." + this.getName())
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName())
.unbind("mousewheel." + this.getName())
.unbind("mouseenter." + this.getName())
.unbind("mousemove." + this.getName())
@ -40559,7 +40567,7 @@ BI.Msg = function () {
},
toast: function (message, options, context) {
options = options || {};
context = context || $("body");
context = context || BI.Widget._renderEngine.createElement("body");
var level = options.level || "normal";
var autoClose = BI.isNull(options.autoClose) ? true : options.autoClose;
var toast = BI.createWidget({
@ -40589,7 +40597,7 @@ BI.Msg = function () {
}, 5000);
},
_show: function (hasCancel, title, message, callback) {
$mask = $("<div class=\"bi-z-index-mask\">").css({
$mask = BI.Widget._renderEngine.createElement("<div class=\"bi-z-index-mask\">").css({
position: "absolute",
zIndex: BI.zIndex_tip - 2,
top: 0,
@ -40598,7 +40606,7 @@ BI.Msg = function () {
bottom: 0,
opacity: 0.5
}).appendTo("body");
$pop = $("<div class=\"bi-message-depend\">").css({
$pop = BI.Widget._renderEngine.createElement("<div class=\"bi-message-depend\">").css({
position: "absolute",
zIndex: BI.zIndex_tip - 1,
top: 0,
@ -41125,7 +41133,7 @@ BI.Popover = BI.inherit(BI.Widget, {
this.startY = 0;
this.tracker = new BI.MouseMoveTracker(function (deltaX, deltaY) {
var size = self._calculateSize();
var W = $("body").width(), H = $("body").height();
var W = BI.Widget._renderEngine.createElement("body").width(), H = BI.Widget._renderEngine.createElement("body").height();
self.startX += deltaX;
self.startY += deltaY;
self.element.css({
@ -41445,7 +41453,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
return BI.createWidget({
type: "bi.center",
cls: "list-view-toolbar bi-high-light bi-border-top",
cls: "list-view-toolbar bi-high-light bi-split-top",
height: 24,
items: BI.createItems(o.buttons, {
once: false,
@ -44270,9 +44278,9 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
self._focus();
self.fireEvent(BI.TextAreaEditor.EVENT_FOCUS);
}
$(document).bind("mousedown." + self.getName(), function (e) {
BI.Widget._renderEngine.createElement(document).bind("mousedown." + self.getName(), function (e) {
if (BI.DOM.isExist(self) && !self.element.__isMouseInBounds__(e)) {
$(document).unbind("mousedown." + self.getName());
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + self.getName());
self.content.element.blur();
}
});
@ -44282,7 +44290,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
self._blur();
self.fireEvent(BI.TextAreaEditor.EVENT_BLUR);
}
$(document).unbind("mousedown." + self.getName());
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + self.getName());
});
if (BI.isKey(o.value)) {
self.setValue(o.value);
@ -44422,7 +44430,7 @@ BI.Iframe = BI.inherit(BI.Single, {
_init: function () {
var o = this.options;
this.options.element = $("<iframe frameborder='0' src='" + o.src + "'>");
this.options.element = BI.Widget._renderEngine.createElement("<iframe frameborder='0' src='" + o.src + "'>");
BI.Iframe.superclass._init.apply(this, arguments);
},
@ -44474,7 +44482,7 @@ BI.Img = BI.inherit(BI.Single, {
_init: function () {
var o = this.options;
this.options.element = $("<img src='" + o.src + "'>");
this.options.element = BI.Widget._renderEngine.createElement("<img src='" + o.src + "'>");
BI.Img.superclass._init.apply(this, arguments);
},
@ -45105,7 +45113,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
},
select: function () {
$(this.wrap.dom.input).click();
BI.Widget._renderEngine.createElement(this.wrap.dom.input).click();
},
upload: function (handler) {
@ -55666,7 +55674,7 @@ BI.MultiPopupView = BI.inherit(BI.PopupView, {
this.buttongroup = BI.createWidget({
type: "bi.button_group",
cls: "list-view-toolbar bi-high-light bi-border-top",
cls: "list-view-toolbar bi-high-light bi-split-top",
height: 24,
items: BI.createItems(text, {
type: "bi.text_button",

2
dist/fineui.min.css vendored

File diff suppressed because one or more lines are too long

76
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

152
dist/fineui_without_jquery_polyfill.js vendored

@ -15,7 +15,9 @@ if (typeof window !== "undefined") {
_global = this;
}
if (_global.BI == null) {
_global.BI = {};
_global.BI = {prepares: []};
} else {
_global.BI.prepares = [];
}/**
* @license
* Lodash (Custom Build) <https://lodash.com/>
@ -11869,10 +11871,10 @@ _.extend(BI.OB.prototype, {
// if (o.root !== true) {
// throw new Error("root is a required property");
// }
this.element = $(o.element);
this.element = BI.Widget._renderEngine.createElement(this);
this._isRoot = true;
} else {
this.element = $(document.createElement(o.tagName));
this.element = BI.Widget._renderEngine.createElement(this);
}
this.element._isWidget = true;
if (o.baseCls || o.extraCls || o.cls) {
@ -12247,6 +12249,21 @@ _.extend(BI.OB.prototype, {
this.purgeListeners();
}
});
BI.Widget.registerRenderEngine = function (engine) {
BI.Widget._renderEngine = engine;
};
BI.Widget.registerRenderEngine({
createElement: function (widget) {
if(BI.isWidget(widget)) {
var o = widget.options;
if (o.element) {
return $(o.element);
}
return $(document.createElement(o.tagName));
}
return $(widget);
}
});
})();(function () {
var kv = {};
BI.shortcut = function (xtype, cls) {
@ -12267,6 +12284,10 @@ _.extend(BI.OB.prototype, {
};
BI.createWidget = function (item, options, context) {
// 先把准备环境准备好
while(BI.prepares && BI.prepares.length > 0) {
BI.prepares.shift()();
}
var el, w;
item || (item = {});
if (BI.isWidget(options)) {
@ -16402,7 +16423,7 @@ BI.RedMarkBehavior = BI.inherit(BI.Behavior, {
});
}
});// 工程配置
(function () {
BI.prepares.push(function () {
// 注册布局
var isSupportFlex = BI.isSupportCss3("flex");
BI.Plugin.registerWidget("bi.horizontal", function (ob) {
@ -16448,7 +16469,7 @@ BI.RedMarkBehavior = BI.inherit(BI.Behavior, {
return ob;
});
}());/**
});/**
* guy
* 控制器
* Controller层超类
@ -16791,7 +16812,7 @@ BI.LayerController = BI.inherit(BI.Controller, {
w = from.element;
}
if (BI.isNotEmptyString(w)) {
w = $(w);
w = BI.Widget._renderEngine.createElement(w);
}
if (this.has(name)) {
return this.get(name);
@ -17008,7 +17029,7 @@ BI.PopoverController = BI.inherit(BI.Controller, {
this.floatContainer[name].visible();
var popover = this.get(name);
popover.show && popover.show();
var W = $(this.options.render).width(), H = $(this.options.render).height();
var W = BI.Widget._renderEngine.createElement(this.options.render).width(), H = BI.Widget._renderEngine.createElement(this.options.render).height();
var w = popover.element.width(), h = popover.element.height();
var left = (W - w) / 2, top = (H - h) / 2;
if (left < 0) {
@ -17074,7 +17095,7 @@ BI.ResizeController = BI.inherit(BI.Controller, {
self._resize(ev);
// }
}, 30);
_global.$ && $(window).resize(fn);
BI.Widget._renderEngine.createElement(window).resize(fn);
},
_resize: function (ev) {
@ -17213,10 +17234,10 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
// var scale = context.element.offset().left / context.element.get(0).getBoundingClientRect().left;
// var x = (e.pageX || e.clientX) * scale + 15, y = (e.pageY || e.clientY) * scale + 15;
var x = (e.pageX || e.clientX) + 15, y = (e.pageY || e.clientY) + 15;
if (x + tooltip.element.outerWidth() > $("body").outerWidth()) {
if (x + tooltip.element.outerWidth() > BI.Widget._renderEngine.createElement("body").outerWidth()) {
x -= tooltip.element.outerWidth() + 15;
}
if (y + tooltip.element.outerHeight() > $("body").outerHeight()) {
if (y + tooltip.element.outerHeight() > BI.Widget._renderEngine.createElement("body").outerHeight()) {
y -= tooltip.element.outerHeight() + 15;
!opt.belowMouse && (y = Math.min(y, offset.top - tooltip.element.outerHeight() - 5));
} else {
@ -17794,7 +17815,7 @@ BI.extend(BI.DOM, {
},
isExist: function (obj) {
return $("body").find(obj.element).length > 0;
return BI.Widget._renderEngine.createElement("body").find(obj.element).length > 0;
},
// 预加载图片
@ -17970,7 +17991,7 @@ BI.extend(BI.DOM, {
},
getTextSizeWidth: function (text, fontSize) {
var span = $("<span></span>").addClass("text-width-span").appendTo($("body"));
var span = BI.Widget._renderEngine.createElement("<span></span>").addClass("text-width-span").appendTo($("body"));
if (fontSize == null) {
fontSize = 12;
@ -17988,11 +18009,11 @@ BI.extend(BI.DOM, {
// 获取滚动条的宽度
getScrollWidth: function () {
if (this._scrollWidth == null) {
var ul = $("<div>").width(50).height(50).css({
var ul = BI.Widget._renderEngine.createElement("<div>").width(50).height(50).css({
position: "absolute",
top: "-9999px",
overflow: "scroll"
}).appendTo($("body"));
}).appendTo("body");
this._scrollWidth = ul[0].offsetWidth - ul[0].clientWidth;
ul.destroy();
}
@ -18002,7 +18023,7 @@ BI.extend(BI.DOM, {
getImage: function (param, fillStyle, backgroundColor) {
var canvas = document.createElement("canvas");
var ratio = 2;
$("body").append(canvas);
BI.Widget._renderEngine.createElement("body").append(canvas);
var w = BI.DOM.getTextSizeWidth(param, 14) + 6;
canvas.width = w * ratio;
canvas.height = 24 * ratio;
@ -18012,7 +18033,7 @@ BI.extend(BI.DOM, {
ctx.fillStyle = fillStyle || "#3D4D66";
ctx.textBaseline = "middle";
ctx.fillText(param, 6 * ratio, 12 * ratio);
$(canvas).destroy();
BI.Widget._renderEngine.createElement(canvas).destroy();
var backColor = backgroundColor || "#EAF2FD";
// IE可以放大缩小所以要固定最大最小宽高
return {
@ -18648,7 +18669,7 @@ _.extend(Array.prototype, {
}
}
});
_global.$ && $(function () {
BI.prepares.push(function () {
// 牵扯到国际化这些常量在页面加载后再生效
// full day names
Date._DN = [BI.i18nText("BI-Basic_Sunday"),
@ -18851,25 +18872,7 @@ Date.prototype.getWeekEndDate = function () {
return this.getOffsetDate(Date._OFFSET[w < startOfWeek ? (7 + w - startOfWeek) : (w - startOfWeek)] + 6);
};
/** Checks date and time equality */
Date.prototype.equalsTo = function (date) {
return ((this.getFullYear() == date.getFullYear()) &&
(this.getMonth() == date.getMonth()) &&
(this.getDate() == date.getDate()) &&
(this.getHours() == date.getHours()) &&
(this.getMinutes() == date.getMinutes()) &&
(this.getSeconds() == date.getSeconds()));
};
/** Set only the year, month, date parts (keep existing time) */
Date.prototype.setDateOnly = function (date) {
var tmp = BI.getDate(date);
this.setDate(1);
this.setFullYear(tmp.getFullYear());
this.setMonth(tmp.getMonth());
this.setDate(tmp.getDate());
};
/** Prints the date in a string according to the given format. */
// 格式化打印日期
Date.prototype.print = function (str) {
var m = this.getMonth();
var d = this.getDate();
@ -19969,7 +19972,7 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.CenterAdaptLayout.superclass.render.apply(this, arguments);
this.$table = $("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative",
width: "100%",
height: "100%",
@ -19978,7 +19981,7 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
border: "none",
"border-collapse": "separate"
});
this.$tr = $("<tr>");
this.$tr = BI.Widget._renderEngine.createElement("<tr>");
this.$tr.appendTo(this.$table);
this.populate(this.options.items);
},
@ -20077,7 +20080,7 @@ BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.HorizontalAdaptLayout.superclass.render.apply(this, arguments);
this.$table = $("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative",
width: "100%",
"white-space": "nowrap",
@ -20085,7 +20088,7 @@ BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, {
border: "none",
"border-collapse": "separate"
});
this.$tr = $("<tr>");
this.$tr = BI.Widget._renderEngine.createElement("<tr>");
this.$tr.appendTo(this.$table);
this.populate(this.options.items);
},
@ -20354,7 +20357,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
render: function () {
BI.VerticalAdaptLayout.superclass.render.apply(this, arguments);
var o = this.options;
this.$table = $("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative",
width: o.horizontalAlign === BI.HorizontalAlign.Stretch ? "100%" : "auto",
height: "100%",
@ -20363,7 +20366,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
border: "none",
"border-collapse": "separate"
});
this.$tr = $("<tr>");
this.$tr = BI.Widget._renderEngine.createElement("<tr>");
this.$tr.appendTo(this.$table);
this.populate(this.options.items);
},
@ -20995,7 +20998,7 @@ BI.FlexCenterLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.FlexCenterLayout.superclass.render.apply(this, arguments);
this.$wrapper = $("<div>").addClass("flex-wrapper-center-layout-wrapper");
this.$wrapper = BI.Widget._renderEngine.createElement("<div>").addClass("flex-wrapper-center-layout-wrapper");
this.populate(this.options.items);
},
@ -21049,7 +21052,7 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, {
render: function () {
BI.FlexHorizontalLayout.superclass.render.apply(this, arguments);
var o = this.options;
this.$wrapper = $("<div>").addClass("flex-wrapper-horizontal-layout-wrapper " + o.verticalAlign);
this.$wrapper = BI.Widget._renderEngine.createElement("<div>").addClass("flex-wrapper-horizontal-layout-wrapper " + o.verticalAlign);
this.populate(this.options.items);
},
@ -21123,7 +21126,7 @@ BI.FlexVerticalCenter = BI.inherit(BI.Layout, {
render: function () {
BI.FlexVerticalCenter.superclass.render.apply(this, arguments);
var o = this.options;
this.$wrapper = $("<div>").addClass("flex-wrapper-vertical-center-wrapper " + o.horizontalAlign);
this.$wrapper = BI.Widget._renderEngine.createElement("<div>").addClass("flex-wrapper-vertical-center-wrapper " + o.horizontalAlign);
this.populate(this.options.items);
},
@ -22219,14 +22222,14 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.HorizontalLayout.superclass.render.apply(this, arguments);
this.$table = $("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative",
"white-space": "nowrap",
"border-spacing": "0px",
border: "none",
"border-collapse": "separate"
});
this.$tr = $("<tr>");
this.$tr = BI.Widget._renderEngine.createElement("<tr>");
this.$tr.appendTo(this.$table);
this.populate(this.options.items);
},
@ -22863,7 +22866,7 @@ BI.TdLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.TdLayout.superclass.render.apply(this, arguments);
this.$table = $("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative",
width: "100%",
height: "100%",
@ -25173,7 +25176,7 @@ BI.Single = BI.inherit(BI.Widget, {
clearTimeout(this.timeout);
}
this._hideTooltip();
$(this.element).unbind("mouseenter.title" + this.getName())
this.element.unbind("mouseenter.title" + this.getName())
.unbind("mousemove.title" + this.getName())
.unbind("mouseleave.title" + this.getName());
this._hoverBinded = false;
@ -25489,14 +25492,14 @@ BI.BasicButton = BI.inherit(BI.Single, {
var selected = false;
hand.mousedown(function (e) {
// if (e.button === 0) {
$(document).bind("mouseup." + self.getName(), function (e) {
BI.Widget._renderEngine.createElement(document).bind("mouseup." + self.getName(), function (e) {
// if (e.button === 0) {
if (BI.DOM.isExist(self) && !hand.__isMouseInBounds__(e) && mouseDown === true && !selected) {
// self.setSelected(!self.isSelected());
self._trigger();
}
mouseDown = false;
$(document).unbind("mouseup." + self.getName());
BI.Widget._renderEngine.createElement(document).unbind("mouseup." + self.getName());
// }
});
if (mouseDown === true) {
@ -25518,7 +25521,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
}
mouseDown = false;
selected = false;
$(document).unbind("mouseup." + self.getName());
BI.Widget._renderEngine.createElement(document).unbind("mouseup." + self.getName());
// }
});
break;
@ -25529,11 +25532,11 @@ BI.BasicButton = BI.inherit(BI.Single, {
var mouseDown = false;
var interval;
hand.mousedown(function (e) {
$(document).bind("mouseup." + self.getName(), function (e) {
BI.Widget._renderEngine.createElement(document).bind("mouseup." + self.getName(), function (e) {
interval && clearInterval(interval);
interval = null;
mouseDown = false;
$(document).unbind("mouseup." + self.getName());
BI.Widget._renderEngine.createElement(document).unbind("mouseup." + self.getName());
});
if (mouseDown === true) {
return;
@ -25763,7 +25766,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
},
empty: function () {
$(document).unbind("mouseup." + this.getName());
BI.Widget._renderEngine.createElement(document).unbind("mouseup." + this.getName());
BI.BasicButton.superclass.empty.apply(this, arguments);
},
@ -26357,14 +26360,17 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, {
});
BI.ButtonTree.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.button_tree", BI.ButtonTree);BI.Resizers = new BI.ResizeController();
BI.shortcut("bi.button_tree", BI.ButtonTree);BI.prepares.push(function () {
BI.Resizers = new BI.ResizeController();
BI.Layers = new BI.LayerController();
BI.Maskers = new BI.MaskersController();
BI.Bubbles = new BI.BubblesController();
BI.Tooltips = new BI.TooltipsController();
BI.Popovers = new BI.PopoverController();
BI.Broadcasts = new BI.BroadcastController();
BI.StyleLoaders = new BI.StyleLoaderManager();/**
BI.StyleLoaders = new BI.StyleLoaderManager();
});
/**
* CollectionView
*
* Created by GUY on 2016/1/15.
@ -27006,7 +27012,7 @@ BI.Combo = BI.inherit(BI.Widget, {
// BI-10290 公式combo双击公式内容会收起
if ((this.element.find(e.target).length > 0 && e.type !== "mousewheel")
|| (this.popupView && this.popupView.element.find(e.target).length > 0)
|| e.target.className === "CodeMirror-cursor" || $(e.target).closest(".CodeMirror-hints").length > 0) {// BI-9887 CodeMirror的公式弹框需要特殊处理下
|| e.target.className === "CodeMirror-cursor" || BI.Widget._renderEngine.createElement(e.target).closest(".CodeMirror-hints").length > 0) {// BI-9887 CodeMirror的公式弹框需要特殊处理下
return;
}
var isHide = this.options.hideChecker.apply(this, [e]);
@ -27027,7 +27033,7 @@ BI.Combo = BI.inherit(BI.Widget, {
}
this.element.removeClass(this.options.comboClass);
$(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW);
},
@ -27040,8 +27046,8 @@ BI.Combo = BI.inherit(BI.Widget, {
this.adjustHeight();
this.element.addClass(this.options.comboClass);
$(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
$(document).bind("mousedown." + this.getName(), BI.bind(this._hideIf, this)).bind("mousewheel." + this.getName(), BI.bind(this._hideIf, this));
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
BI.Widget._renderEngine.createElement(document).bind("mousedown." + this.getName(), BI.bind(this._hideIf, this)).bind("mousewheel." + this.getName(), BI.bind(this._hideIf, this));
this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW);
},
@ -27209,7 +27215,7 @@ BI.Combo = BI.inherit(BI.Widget, {
},
destroy: function () {
$(document).unbind("mousedown." + this.getName())
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName())
.unbind("mousewheel." + this.getName())
.unbind("mouseenter." + this.getName())
.unbind("mousemove." + this.getName())
@ -28946,7 +28952,7 @@ BI.Msg = function () {
},
toast: function (message, options, context) {
options = options || {};
context = context || $("body");
context = context || BI.Widget._renderEngine.createElement("body");
var level = options.level || "normal";
var autoClose = BI.isNull(options.autoClose) ? true : options.autoClose;
var toast = BI.createWidget({
@ -28976,7 +28982,7 @@ BI.Msg = function () {
}, 5000);
},
_show: function (hasCancel, title, message, callback) {
$mask = $("<div class=\"bi-z-index-mask\">").css({
$mask = BI.Widget._renderEngine.createElement("<div class=\"bi-z-index-mask\">").css({
position: "absolute",
zIndex: BI.zIndex_tip - 2,
top: 0,
@ -28985,7 +28991,7 @@ BI.Msg = function () {
bottom: 0,
opacity: 0.5
}).appendTo("body");
$pop = $("<div class=\"bi-message-depend\">").css({
$pop = BI.Widget._renderEngine.createElement("<div class=\"bi-message-depend\">").css({
position: "absolute",
zIndex: BI.zIndex_tip - 1,
top: 0,
@ -29512,7 +29518,7 @@ BI.Popover = BI.inherit(BI.Widget, {
this.startY = 0;
this.tracker = new BI.MouseMoveTracker(function (deltaX, deltaY) {
var size = self._calculateSize();
var W = $("body").width(), H = $("body").height();
var W = BI.Widget._renderEngine.createElement("body").width(), H = BI.Widget._renderEngine.createElement("body").height();
self.startX += deltaX;
self.startY += deltaY;
self.element.css({
@ -29832,7 +29838,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
return BI.createWidget({
type: "bi.center",
cls: "list-view-toolbar bi-high-light bi-border-top",
cls: "list-view-toolbar bi-high-light bi-split-top",
height: 24,
items: BI.createItems(o.buttons, {
once: false,
@ -32657,9 +32663,9 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
self._focus();
self.fireEvent(BI.TextAreaEditor.EVENT_FOCUS);
}
$(document).bind("mousedown." + self.getName(), function (e) {
BI.Widget._renderEngine.createElement(document).bind("mousedown." + self.getName(), function (e) {
if (BI.DOM.isExist(self) && !self.element.__isMouseInBounds__(e)) {
$(document).unbind("mousedown." + self.getName());
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + self.getName());
self.content.element.blur();
}
});
@ -32669,7 +32675,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
self._blur();
self.fireEvent(BI.TextAreaEditor.EVENT_BLUR);
}
$(document).unbind("mousedown." + self.getName());
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + self.getName());
});
if (BI.isKey(o.value)) {
self.setValue(o.value);
@ -32809,7 +32815,7 @@ BI.Iframe = BI.inherit(BI.Single, {
_init: function () {
var o = this.options;
this.options.element = $("<iframe frameborder='0' src='" + o.src + "'>");
this.options.element = BI.Widget._renderEngine.createElement("<iframe frameborder='0' src='" + o.src + "'>");
BI.Iframe.superclass._init.apply(this, arguments);
},
@ -32861,7 +32867,7 @@ BI.Img = BI.inherit(BI.Single, {
_init: function () {
var o = this.options;
this.options.element = $("<img src='" + o.src + "'>");
this.options.element = BI.Widget._renderEngine.createElement("<img src='" + o.src + "'>");
BI.Img.superclass._init.apply(this, arguments);
},
@ -39320,7 +39326,7 @@ BI.MultiPopupView = BI.inherit(BI.PopupView, {
this.buttongroup = BI.createWidget({
type: "bi.button_group",
cls: "list-view-toolbar bi-high-light bi-border-top",
cls: "list-view-toolbar bi-high-light bi-split-top",
height: 24,
items: BI.createItems(text, {
type: "bi.text_button",

49
dist/index.html vendored

@ -1,49 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<!--核心css文件-->
<link rel="stylesheet" type="text/css" href="core.css"/>
<!--基础css文件, 包含一些最基本控件的样式-->
<link rel="stylesheet" type="text/css" href="base.css"/>
<!--BI控件样式-->
<link rel="stylesheet" type="text/css" href="widget.css"/>
<!--资源样式, 包括font、icon、background、app-->
<link rel="stylesheet" type="text/css" href="resource.css"/>
<!--当前demo定义的样式-->
<link rel="stylesheet" type="text/css" href="demo.css"/>
<!--IE9及以下兼容-->
<script src="polyfill.js"></script>
<!--核心js-->
<script src="core.js"></script>
<!--BI路由js-->
<script src="router.js"></script>
<!--fix1.0版本框架, 只用ui的话不用引入, fix1.0依赖于router,引入的顺序需在core.js、router.js之后, 可以和2.0版本同时使用或使用任一个均可-->
<script src="fix/fix-1.0.js"></script>
<!--fix2.0版本框架, 只用ui的话不用引入, 引入的顺序需在core.js之后-->
<script src="fix/fix.js"></script>
<!--基础js, 包括最基本的控件-->
<script src="base.js"></script>
<!--基础js, 存放一些通用组件,如选色组件、富文本组件等-->
<script src="case.js"></script>
<!--BI控件js-->
<script src="widget.js"></script>
<!--fix2.0版本框架与fineui结合的代码, 只用ui的话不用引入, 引入的顺序需在fix和控件库(core/base/case/widget)之后之后-->
<script src="fix/fix.compact.js"></script>
<!--工程配置文件,主要是BI.servletURL(根目录)、BI.resourceURL(资源路径)、BI.i18n(国际化)-->
<script src="config.js"></script>
<script src="demo.js"></script>
</head>
<body>
<div id="wrapper"></div>
</body>
</html>

4
dist/polyfill.js vendored

@ -15,7 +15,9 @@ if (typeof window !== "undefined") {
_global = this;
}
if (_global.BI == null) {
_global.BI = {};
_global.BI = {prepares: []};
} else {
_global.BI.prepares = [];
}// Production steps of ECMA-262, Edition 5, 15.4.4.14
// Reference: http://es5.github.io/#x15.4.4.14
if (!Array.prototype.indexOf) {

24
dist/utils.js vendored

@ -15,7 +15,9 @@ if (typeof window !== "undefined") {
_global = this;
}
if (_global.BI == null) {
_global.BI = {};
_global.BI = {prepares: []};
} else {
_global.BI.prepares = [];
}/**
* @license
* Lodash (Custom Build) <https://lodash.com/>
@ -10828,25 +10830,7 @@ Date.prototype.getWeekEndDate = function () {
return this.getOffsetDate(Date._OFFSET[w < startOfWeek ? (7 + w - startOfWeek) : (w - startOfWeek)] + 6);
};
/** Checks date and time equality */
Date.prototype.equalsTo = function (date) {
return ((this.getFullYear() == date.getFullYear()) &&
(this.getMonth() == date.getMonth()) &&
(this.getDate() == date.getDate()) &&
(this.getHours() == date.getHours()) &&
(this.getMinutes() == date.getMinutes()) &&
(this.getSeconds() == date.getSeconds()));
};
/** Set only the year, month, date parts (keep existing time) */
Date.prototype.setDateOnly = function (date) {
var tmp = BI.getDate(date);
this.setDate(1);
this.setFullYear(tmp.getFullYear());
this.setMonth(tmp.getMonth());
this.setDate(tmp.getDate());
};
/** Prints the date in a string according to the given format. */
// 格式化打印日期
Date.prototype.print = function (str) {
var m = this.getMonth();
var d = this.getDate();

8
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

52
index.html

@ -1,5 +1,49 @@
<html>
<script>
location.href = "docs/_book/index.html"
</script>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<!--核心css文件-->
<link rel="stylesheet" type="text/css" href="dist/core.css"/>
<!--基础css文件, 包含一些最基本控件的样式-->
<link rel="stylesheet" type="text/css" href="dist/base.css"/>
<!--BI控件样式-->
<link rel="stylesheet" type="text/css" href="dist/widget.css"/>
<!--资源样式, 包括font、icon、background、app-->
<link rel="stylesheet" type="text/css" href="dist/resource.css"/>
<!--当前demo定义的样式-->
<link rel="stylesheet" type="text/css" href="dist/demo.css"/>
<!--IE9及以下兼容-->
<script src="dist/polyfill.js"></script>
<!--核心js-->
<script src="dist/core.js"></script>
<!--BI路由js-->
<script src="dist/router.js"></script>
<!--fix1.0版本框架, 只用ui的话不用引入, fix1.0依赖于router,引入的顺序需在core.js、router.js之后, 可以和2.0版本同时使用或使用任一个均可-->
<script src="dist/fix/fix-1.0.js"></script>
<!--fix2.0版本框架, 只用ui的话不用引入, 引入的顺序需在core.js之后-->
<script src="dist/fix/fix.js"></script>
<!--基础js, 包括最基本的控件-->
<script src="dist/base.js"></script>
<!--基础js, 存放一些通用组件,如选色组件、富文本组件等-->
<script src="dist/case.js"></script>
<!--BI控件js-->
<script src="dist/widget.js"></script>
<!--fix2.0版本框架与fineui结合的代码, 只用ui的话不用引入, 引入的顺序需在fix和控件库(core/base/case/widget)之后之后-->
<script src="dist/fix/fix.compact.js"></script>
<!--工程配置文件,主要是BI.servletURL(根目录)、BI.resourceURL(资源路径)、BI.i18n(国际化)-->
<script src="dist/config.js"></script>
<script src="dist/demo.js"></script>
</head>
<body>
<div id="wrapper"></div>
</body>
</html>

544
package-lock.json generated

File diff suppressed because it is too large Load Diff

2
src/base/base.js

@ -1,3 +1,4 @@
BI.prepares.push(function () {
BI.Resizers = new BI.ResizeController();
BI.Layers = new BI.LayerController();
BI.Maskers = new BI.MaskersController();
@ -6,3 +7,4 @@ BI.Tooltips = new BI.TooltipsController();
BI.Popovers = new BI.PopoverController();
BI.Broadcasts = new BI.BroadcastController();
BI.StyleLoaders = new BI.StyleLoaderManager();
});

10
src/base/combination/combo.js

@ -263,7 +263,7 @@ BI.Combo = BI.inherit(BI.Widget, {
// BI-10290 公式combo双击公式内容会收起
if ((this.element.find(e.target).length > 0 && e.type !== "mousewheel")
|| (this.popupView && this.popupView.element.find(e.target).length > 0)
|| e.target.className === "CodeMirror-cursor" || $(e.target).closest(".CodeMirror-hints").length > 0) {// BI-9887 CodeMirror的公式弹框需要特殊处理下
|| e.target.className === "CodeMirror-cursor" || BI.Widget._renderEngine.createElement(e.target).closest(".CodeMirror-hints").length > 0) {// BI-9887 CodeMirror的公式弹框需要特殊处理下
return;
}
var isHide = this.options.hideChecker.apply(this, [e]);
@ -284,7 +284,7 @@ BI.Combo = BI.inherit(BI.Widget, {
}
this.element.removeClass(this.options.comboClass);
$(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW);
},
@ -297,8 +297,8 @@ BI.Combo = BI.inherit(BI.Widget, {
this.adjustHeight();
this.element.addClass(this.options.comboClass);
$(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
$(document).bind("mousedown." + this.getName(), BI.bind(this._hideIf, this)).bind("mousewheel." + this.getName(), BI.bind(this._hideIf, this));
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
BI.Widget._renderEngine.createElement(document).bind("mousedown." + this.getName(), BI.bind(this._hideIf, this)).bind("mousewheel." + this.getName(), BI.bind(this._hideIf, this));
this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW);
},
@ -466,7 +466,7 @@ BI.Combo = BI.inherit(BI.Widget, {
},
destroy: function () {
$(document).unbind("mousedown." + this.getName())
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName())
.unbind("mousewheel." + this.getName())
.unbind("mouseenter." + this.getName())
.unbind("mousemove." + this.getName())

6
src/base/foundation/message.js

@ -19,7 +19,7 @@ BI.Msg = function () {
},
toast: function (message, options, context) {
options = options || {};
context = context || $("body");
context = context || BI.Widget._renderEngine.createElement("body");
var level = options.level || "normal";
var autoClose = BI.isNull(options.autoClose) ? true : options.autoClose;
var toast = BI.createWidget({
@ -49,7 +49,7 @@ BI.Msg = function () {
}, 5000);
},
_show: function (hasCancel, title, message, callback) {
$mask = $("<div class=\"bi-z-index-mask\">").css({
$mask = BI.Widget._renderEngine.createElement("<div class=\"bi-z-index-mask\">").css({
position: "absolute",
zIndex: BI.zIndex_tip - 2,
top: 0,
@ -58,7 +58,7 @@ BI.Msg = function () {
bottom: 0,
opacity: 0.5
}).appendTo("body");
$pop = $("<div class=\"bi-message-depend\">").css({
$pop = BI.Widget._renderEngine.createElement("<div class=\"bi-message-depend\">").css({
position: "absolute",
zIndex: BI.zIndex_tip - 1,
top: 0,

2
src/base/layer/layer.popover.js

@ -30,7 +30,7 @@ BI.Popover = BI.inherit(BI.Widget, {
this.startY = 0;
this.tracker = new BI.MouseMoveTracker(function (deltaX, deltaY) {
var size = self._calculateSize();
var W = $("body").width(), H = $("body").height();
var W = BI.Widget._renderEngine.createElement("body").width(), H = BI.Widget._renderEngine.createElement("body").height();
self.startX += deltaX;
self.startY += deltaY;
self.element.css({

2
src/base/layer/layer.popup.js

@ -129,7 +129,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
return BI.createWidget({
type: "bi.center",
cls: "list-view-toolbar bi-high-light bi-border-top",
cls: "list-view-toolbar bi-high-light bi-split-top",
height: 24,
items: BI.createItems(o.buttons, {
once: false,

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

@ -127,14 +127,14 @@ BI.BasicButton = BI.inherit(BI.Single, {
var selected = false;
hand.mousedown(function (e) {
// if (e.button === 0) {
$(document).bind("mouseup." + self.getName(), function (e) {
BI.Widget._renderEngine.createElement(document).bind("mouseup." + self.getName(), function (e) {
// if (e.button === 0) {
if (BI.DOM.isExist(self) && !hand.__isMouseInBounds__(e) && mouseDown === true && !selected) {
// self.setSelected(!self.isSelected());
self._trigger();
}
mouseDown = false;
$(document).unbind("mouseup." + self.getName());
BI.Widget._renderEngine.createElement(document).unbind("mouseup." + self.getName());
// }
});
if (mouseDown === true) {
@ -156,7 +156,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
}
mouseDown = false;
selected = false;
$(document).unbind("mouseup." + self.getName());
BI.Widget._renderEngine.createElement(document).unbind("mouseup." + self.getName());
// }
});
break;
@ -167,11 +167,11 @@ BI.BasicButton = BI.inherit(BI.Single, {
var mouseDown = false;
var interval;
hand.mousedown(function (e) {
$(document).bind("mouseup." + self.getName(), function (e) {
BI.Widget._renderEngine.createElement(document).bind("mouseup." + self.getName(), function (e) {
interval && clearInterval(interval);
interval = null;
mouseDown = false;
$(document).unbind("mouseup." + self.getName());
BI.Widget._renderEngine.createElement(document).unbind("mouseup." + self.getName());
});
if (mouseDown === true) {
return;
@ -401,7 +401,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
},
empty: function () {
$(document).unbind("mouseup." + this.getName());
BI.Widget._renderEngine.createElement(document).unbind("mouseup." + this.getName());
BI.BasicButton.superclass.empty.apply(this, arguments);
},

6
src/base/single/editor/editor.textarea.js

@ -47,9 +47,9 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
self._focus();
self.fireEvent(BI.TextAreaEditor.EVENT_FOCUS);
}
$(document).bind("mousedown." + self.getName(), function (e) {
BI.Widget._renderEngine.createElement(document).bind("mousedown." + self.getName(), function (e) {
if (BI.DOM.isExist(self) && !self.element.__isMouseInBounds__(e)) {
$(document).unbind("mousedown." + self.getName());
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + self.getName());
self.content.element.blur();
}
});
@ -59,7 +59,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
self._blur();
self.fireEvent(BI.TextAreaEditor.EVENT_BLUR);
}
$(document).unbind("mousedown." + self.getName());
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + self.getName());
});
if (BI.isKey(o.value)) {
self.setValue(o.value);

2
src/base/single/iframe/iframe.js

@ -17,7 +17,7 @@ BI.Iframe = BI.inherit(BI.Single, {
_init: function () {
var o = this.options;
this.options.element = $("<iframe frameborder='0' src='" + o.src + "'>");
this.options.element = BI.Widget._renderEngine.createElement("<iframe frameborder='0' src='" + o.src + "'>");
BI.Iframe.superclass._init.apply(this, arguments);
},

2
src/base/single/img/img.js

@ -19,7 +19,7 @@ BI.Img = BI.inherit(BI.Single, {
_init: function () {
var o = this.options;
this.options.element = $("<img src='" + o.src + "'>");
this.options.element = BI.Widget._renderEngine.createElement("<img src='" + o.src + "'>");
BI.Img.superclass._init.apply(this, arguments);
},

2
src/base/single/input/file.js

@ -582,7 +582,7 @@
},
select: function () {
$(this.wrap.dom.input).click();
BI.Widget._renderEngine.createElement(this.wrap.dom.input).click();
},
upload: function (handler) {

2
src/base/single/single.js

@ -101,7 +101,7 @@ BI.Single = BI.inherit(BI.Widget, {
clearTimeout(this.timeout);
}
this._hideTooltip();
$(this.element).unbind("mouseenter.title" + this.getName())
this.element.unbind("mouseenter.title" + this.getName())
.unbind("mousemove.title" + this.getName())
.unbind("mouseleave.title" + this.getName());
this._hoverBinded = false;

2
src/case/layer/layer.multipopup.js

@ -34,7 +34,7 @@ BI.MultiPopupView = BI.inherit(BI.PopupView, {
this.buttongroup = BI.createWidget({
type: "bi.button_group",
cls: "list-view-toolbar bi-high-light bi-border-top",
cls: "list-view-toolbar bi-high-light bi-split-top",
height: 24,
items: BI.createItems(text, {
type: "bi.text_button",

4
src/core/config.js

@ -1,5 +1,5 @@
// 工程配置
(function () {
BI.prepares.push(function () {
// 注册布局
var isSupportFlex = BI.isSupportCss3("flex");
BI.Plugin.registerWidget("bi.horizontal", function (ob) {
@ -45,4 +45,4 @@
return ob;
});
}());
});

2
src/core/controller/controller.layer.js

@ -49,7 +49,7 @@ BI.LayerController = BI.inherit(BI.Controller, {
w = from.element;
}
if (BI.isNotEmptyString(w)) {
w = $(w);
w = BI.Widget._renderEngine.createElement(w);
}
if (this.has(name)) {
return this.get(name);

2
src/core/controller/controller.popover.js

@ -93,7 +93,7 @@ BI.PopoverController = BI.inherit(BI.Controller, {
this.floatContainer[name].visible();
var popover = this.get(name);
popover.show && popover.show();
var W = $(this.options.render).width(), H = $(this.options.render).height();
var W = BI.Widget._renderEngine.createElement(this.options.render).width(), H = BI.Widget._renderEngine.createElement(this.options.render).height();
var w = popover.element.width(), h = popover.element.height();
var left = (W - w) / 2, top = (H - h) / 2;
if (left < 0) {

2
src/core/controller/controller.resizer.js

@ -18,7 +18,7 @@ BI.ResizeController = BI.inherit(BI.Controller, {
self._resize(ev);
// }
}, 30);
_global.$ && $(window).resize(fn);
BI.Widget._renderEngine.createElement(window).resize(fn);
},
_resize: function (ev) {

4
src/core/controller/controller.tooltips.js

@ -89,10 +89,10 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
// var scale = context.element.offset().left / context.element.get(0).getBoundingClientRect().left;
// var x = (e.pageX || e.clientX) * scale + 15, y = (e.pageY || e.clientY) * scale + 15;
var x = (e.pageX || e.clientX) + 15, y = (e.pageY || e.clientY) + 15;
if (x + tooltip.element.outerWidth() > $("body").outerWidth()) {
if (x + tooltip.element.outerWidth() > BI.Widget._renderEngine.createElement("body").outerWidth()) {
x -= tooltip.element.outerWidth() + 15;
}
if (y + tooltip.element.outerHeight() > $("body").outerHeight()) {
if (y + tooltip.element.outerHeight() > BI.Widget._renderEngine.createElement("body").outerHeight()) {
y -= tooltip.element.outerHeight() + 15;
!opt.belowMouse && (y = Math.min(y, offset.top - tooltip.element.outerHeight() - 5));
} else {

4
src/core/foundation.js vendored

@ -15,5 +15,7 @@ if (typeof window !== "undefined") {
_global = this;
}
if (_global.BI == null) {
_global.BI = {};
_global.BI = {prepares: []};
} else {
_global.BI.prepares = [];
}

12
src/core/func/function.js

@ -100,7 +100,7 @@ BI.extend(BI.DOM, {
},
isExist: function (obj) {
return $("body").find(obj.element).length > 0;
return BI.Widget._renderEngine.createElement("body").find(obj.element).length > 0;
},
// 预加载图片
@ -276,7 +276,7 @@ BI.extend(BI.DOM, {
},
getTextSizeWidth: function (text, fontSize) {
var span = $("<span></span>").addClass("text-width-span").appendTo($("body"));
var span = BI.Widget._renderEngine.createElement("<span></span>").addClass("text-width-span").appendTo($("body"));
if (fontSize == null) {
fontSize = 12;
@ -294,11 +294,11 @@ BI.extend(BI.DOM, {
// 获取滚动条的宽度
getScrollWidth: function () {
if (this._scrollWidth == null) {
var ul = $("<div>").width(50).height(50).css({
var ul = BI.Widget._renderEngine.createElement("<div>").width(50).height(50).css({
position: "absolute",
top: "-9999px",
overflow: "scroll"
}).appendTo($("body"));
}).appendTo("body");
this._scrollWidth = ul[0].offsetWidth - ul[0].clientWidth;
ul.destroy();
}
@ -308,7 +308,7 @@ BI.extend(BI.DOM, {
getImage: function (param, fillStyle, backgroundColor) {
var canvas = document.createElement("canvas");
var ratio = 2;
$("body").append(canvas);
BI.Widget._renderEngine.createElement("body").append(canvas);
var w = BI.DOM.getTextSizeWidth(param, 14) + 6;
canvas.width = w * ratio;
canvas.height = 24 * ratio;
@ -318,7 +318,7 @@ BI.extend(BI.DOM, {
ctx.fillStyle = fillStyle || "#3D4D66";
ctx.textBaseline = "middle";
ctx.fillText(param, 6 * ratio, 12 * ratio);
$(canvas).destroy();
BI.Widget._renderEngine.createElement(canvas).destroy();
var backColor = backgroundColor || "#EAF2FD";
// IE可以放大缩小所以要固定最大最小宽高
return {

2
src/core/proto/date.i18n.js

@ -1,4 +1,4 @@
_global.$ && $(function () {
BI.prepares.push(function () {
// 牵扯到国际化这些常量在页面加载后再生效
// full day names
Date._DN = [BI.i18nText("BI-Basic_Sunday"),

20
src/core/proto/date.js

@ -137,25 +137,7 @@ Date.prototype.getWeekEndDate = function () {
return this.getOffsetDate(Date._OFFSET[w < startOfWeek ? (7 + w - startOfWeek) : (w - startOfWeek)] + 6);
};
/** Checks date and time equality */
Date.prototype.equalsTo = function (date) {
return ((this.getFullYear() == date.getFullYear()) &&
(this.getMonth() == date.getMonth()) &&
(this.getDate() == date.getDate()) &&
(this.getHours() == date.getHours()) &&
(this.getMinutes() == date.getMinutes()) &&
(this.getSeconds() == date.getSeconds()));
};
/** Set only the year, month, date parts (keep existing time) */
Date.prototype.setDateOnly = function (date) {
var tmp = BI.getDate(date);
this.setDate(1);
this.setFullYear(tmp.getFullYear());
this.setMonth(tmp.getMonth());
this.setDate(tmp.getDate());
};
/** Prints the date in a string according to the given format. */
// 格式化打印日期
Date.prototype.print = function (str) {
var m = this.getMonth();
var d = this.getDate();

4
src/core/shortcut.js

@ -18,6 +18,10 @@
};
BI.createWidget = function (item, options, context) {
// 先把准备环境准备好
while(BI.prepares && BI.prepares.length > 0) {
BI.prepares.shift()();
}
var el, w;
item || (item = {});
if (BI.isWidget(options)) {

19
src/core/widget.js

@ -93,10 +93,10 @@
// if (o.root !== true) {
// throw new Error("root is a required property");
// }
this.element = $(o.element);
this.element = BI.Widget._renderEngine.createElement(this);
this._isRoot = true;
} else {
this.element = $(document.createElement(o.tagName));
this.element = BI.Widget._renderEngine.createElement(this);
}
this.element._isWidget = true;
if (o.baseCls || o.extraCls || o.cls) {
@ -471,4 +471,19 @@
this.purgeListeners();
}
});
BI.Widget.registerRenderEngine = function (engine) {
BI.Widget._renderEngine = engine;
};
BI.Widget.registerRenderEngine({
createElement: function (widget) {
if(BI.isWidget(widget)) {
var o = widget.options;
if (o.element) {
return $(o.element);
}
return $(document.createElement(o.tagName));
}
return $(widget);
}
});
})();

4
src/core/wrapper/layout/adapt/adapt.center.js

@ -18,7 +18,7 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.CenterAdaptLayout.superclass.render.apply(this, arguments);
this.$table = $("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative",
width: "100%",
height: "100%",
@ -27,7 +27,7 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
border: "none",
"border-collapse": "separate"
});
this.$tr = $("<tr>");
this.$tr = BI.Widget._renderEngine.createElement("<tr>");
this.$tr.appendTo(this.$table);
this.populate(this.options.items);
},

4
src/core/wrapper/layout/adapt/adapt.horizontal.js

@ -19,7 +19,7 @@ BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.HorizontalAdaptLayout.superclass.render.apply(this, arguments);
this.$table = $("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative",
width: "100%",
"white-space": "nowrap",
@ -27,7 +27,7 @@ BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, {
border: "none",
"border-collapse": "separate"
});
this.$tr = $("<tr>");
this.$tr = BI.Widget._renderEngine.createElement("<tr>");
this.$tr.appendTo(this.$table);
this.populate(this.options.items);
},

4
src/core/wrapper/layout/adapt/adapt.vertical.js

@ -18,7 +18,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
render: function () {
BI.VerticalAdaptLayout.superclass.render.apply(this, arguments);
var o = this.options;
this.$table = $("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative",
width: o.horizontalAlign === BI.HorizontalAlign.Stretch ? "100%" : "auto",
height: "100%",
@ -27,7 +27,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
border: "none",
"border-collapse": "separate"
});
this.$tr = $("<tr>");
this.$tr = BI.Widget._renderEngine.createElement("<tr>");
this.$tr.appendTo(this.$table);
this.populate(this.options.items);
},

2
src/core/wrapper/layout/flex/wrapper/flex.wrapper.center.js

@ -13,7 +13,7 @@ BI.FlexCenterLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.FlexCenterLayout.superclass.render.apply(this, arguments);
this.$wrapper = $("<div>").addClass("flex-wrapper-center-layout-wrapper");
this.$wrapper = BI.Widget._renderEngine.createElement("<div>").addClass("flex-wrapper-center-layout-wrapper");
this.populate(this.options.items);
},

2
src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js

@ -23,7 +23,7 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, {
render: function () {
BI.FlexHorizontalLayout.superclass.render.apply(this, arguments);
var o = this.options;
this.$wrapper = $("<div>").addClass("flex-wrapper-horizontal-layout-wrapper " + o.verticalAlign);
this.$wrapper = BI.Widget._renderEngine.createElement("<div>").addClass("flex-wrapper-horizontal-layout-wrapper " + o.verticalAlign);
this.populate(this.options.items);
},

2
src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js

@ -23,7 +23,7 @@ BI.FlexVerticalCenter = BI.inherit(BI.Layout, {
render: function () {
BI.FlexVerticalCenter.superclass.render.apply(this, arguments);
var o = this.options;
this.$wrapper = $("<div>").addClass("flex-wrapper-vertical-center-wrapper " + o.horizontalAlign);
this.$wrapper = BI.Widget._renderEngine.createElement("<div>").addClass("flex-wrapper-vertical-center-wrapper " + o.horizontalAlign);
this.populate(this.options.items);
},

4
src/core/wrapper/layout/layout.horizontal.js

@ -20,14 +20,14 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.HorizontalLayout.superclass.render.apply(this, arguments);
this.$table = $("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative",
"white-space": "nowrap",
"border-spacing": "0px",
border: "none",
"border-collapse": "separate"
});
this.$tr = $("<tr>");
this.$tr = BI.Widget._renderEngine.createElement("<tr>");
this.$tr.appendTo(this.$table);
this.populate(this.options.items);
},

2
src/core/wrapper/layout/layout.td.js

@ -25,7 +25,7 @@ BI.TdLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.TdLayout.superclass.render.apply(this, arguments);
this.$table = $("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative",
width: "100%",
height: "100%",

2
src/css/core/utils/common.css

@ -189,7 +189,7 @@ textarea {
.bi-split-left {
border-left: 1px solid #f2f4f7;
}
.bi-theme-dark .bi-border {
.bi-theme-dark .bi-split {
border: 1px solid #2F3149;
}
.bi-theme-dark .bi-split-top {

2
src/less/core/utils/common.less

@ -242,7 +242,7 @@ textarea {
}
.bi-theme-dark {
.bi-border {
.bi-split {
border: 1px solid @border-color-light-line-theme-dark;
}

Loading…
Cancel
Save