Browse Source

Merge remote-tracking branch 'origin/master' into webpack

es6
iapyang 5 years ago
parent
commit
025f39bc23
  1. 7
      changelog.md
  2. 2
      demo/app.js
  3. 4
      demo/js/north.js
  4. 3
      dist/2.0/fineui.css
  5. 189
      dist/2.0/fineui.ie.js
  6. 74
      dist/2.0/fineui.ie.min.js
  7. 189
      dist/2.0/fineui.js
  8. 2
      dist/2.0/fineui.min.css
  9. 74
      dist/2.0/fineui.min.js
  10. 3
      dist/base.css
  11. 47
      dist/base.js
  12. 3
      dist/bundle.css
  13. 189
      dist/bundle.ie.js
  14. 74
      dist/bundle.ie.min.js
  15. 189
      dist/bundle.js
  16. 2
      dist/bundle.min.css
  17. 74
      dist/bundle.min.js
  18. 17
      dist/case.js
  19. 48
      dist/core.js
  20. 6
      dist/demo.js
  21. 3
      dist/fineui.css
  22. 189
      dist/fineui.ie.js
  23. 74
      dist/fineui.ie.min.js
  24. 189
      dist/fineui.js
  25. 2
      dist/fineui.min.css
  26. 74
      dist/fineui.min.js
  27. 110
      dist/fineui_without_jquery_polyfill.js
  28. 2
      dist/utils.js
  29. 4
      dist/utils.min.js
  30. 77
      dist/widget.js
  31. 3
      src/base/layer/layer.popover.js
  32. 10
      src/base/list/listview.js
  33. 2
      src/base/single/button/button.basic.js
  34. 6
      src/base/single/single.js
  35. 4
      src/base/tree/ztree/asynctree.js
  36. 2
      src/base/tree/ztree/jquery.ztree.core-3.5.js
  37. 2
      src/base/tree/ztree/jquery.ztree.excheck-3.5.js
  38. 2
      src/base/tree/ztree/list/listasynctree.js
  39. 2
      src/base/tree/ztree/list/listparttree.js
  40. 2
      src/base/tree/ztree/list/listtreeview.js
  41. 2
      src/base/tree/ztree/parttree.js
  42. 8
      src/base/tree/ztree/treeview.js
  43. 7
      src/case/colorchooser/colorchooser.js
  44. 2
      src/case/colorchooser/colorchooser.trigger.js
  45. 2
      src/case/colorchooser/colorchooser.trigger.long.js
  46. 2
      src/case/combo/bubblecombo/popup.bubble.js
  47. 2
      src/case/tree/ztree/tree.display.js
  48. 2
      src/case/tree/ztree/tree.list.display.js
  49. 2
      src/component/treevaluechooser/abstract.treevaluechooser.js
  50. 2
      src/component/treevaluechooser/combo.listtreevaluechooser.js
  51. 193
      src/component/valuechooser/__test__/combo.valuechooser.insert.test.js
  52. 163
      src/component/valuechooser/__test__/combo.valuechooser.test.js
  53. 111
      src/component/valuechooser/__test__/pane.valuechooser.test.js
  54. 2
      src/core/alias.js
  55. 2
      src/core/controller/controller.resizer.js
  56. 6
      src/core/platform/web/dom.js
  57. 4
      src/core/platform/web/jquery/_jquery.js
  58. 2
      src/core/platform/web/jquery/event.js
  59. 14
      src/core/platform/web/jquery/fn.js
  60. 12
      src/core/platform/web/load.js
  61. 6
      src/core/widget.js
  62. 3
      src/css/base/view/popover.css
  63. 1
      src/less/base/view/popover.less
  64. 2
      src/third/jquery.mousewheel.js
  65. 1
      src/widget/datepane/datepane.js
  66. 2
      src/widget/multilayerselecttree/multilayerselecttree.combo.js
  67. 2
      src/widget/multilayersingletree/multilayersingletree.combo.js
  68. 21
      src/widget/multiselectlist/multiselectlist.insert.js
  69. 21
      src/widget/multiselectlist/multiselectlist.insert.nobar.js
  70. 21
      src/widget/multiselectlist/multiselectlist.js
  71. 5
      src/widget/multitree/multi.tree.list.combo.js
  72. 8
      test/utils.js

7
changelog.md

@ -1,4 +1,11 @@
# 更新日志
2.0(2019-09)
- [视觉]popover弹出框增加圆角
- 文本列表通过复制粘贴的形式选中值的时候发送事件
- 修复tree_value_chooser选中节点的唯一子节点后搜索该子节点,无法取消选中的问题
- button的bubble创建的popup在收起的时候会destroy
- 修复了dynamic_date_pane在切换静态时间和动态时间的时候不会发事件的问题
2.0(2019-08)
- 修复valueChooser系列不支持value属性的问题
- 更新了若干icon-font的样式

2
demo/app.js

@ -1,7 +1,7 @@
Demo = {
version: 1.0
};
$(function () {
BI.$(function () {
var ref;
BI.each(Demo.CONFIG, function (index, item) {

4
demo/js/north.js

@ -28,13 +28,13 @@ Demo.North = BI.inherit(BI.Widget, {
type: "bi.text_button",
text: "星空蓝",
handler: function () {
$("html").removeClass("bi-theme-default").addClass("bi-theme-dark");
BI.$("html").removeClass("bi-theme-default").addClass("bi-theme-dark");
}
}, {
type: "bi.text_button",
text: "典雅白",
handler: function () {
$("html").removeClass("bi-theme-dark").addClass("bi-theme-default");
BI.$("html").removeClass("bi-theme-dark").addClass("bi-theme-default");
}
}]
}

3
dist/2.0/fineui.css vendored

@ -4244,6 +4244,9 @@ ul.ztree.zTreeDragUL {
-moz-border-radius: 2px;
border-radius: 2px;
}
.bi-popover {
border: 1px solid transparent;
}
/**********BI.BIListView*************/
.bi-popup-view {
position: fixed !important;

189
dist/2.0/fineui.ie.js vendored

@ -12131,11 +12131,11 @@ if (!_global.BI) {
if (BI.isWidget(widget)) {
var o = widget.options;
if (o.element) {
return $(o.element);
return BI.$(o.element);
}
return $(document.createElement(o.tagName));
return BI.$(document.createElement(o.tagName));
}
return $(widget);
return BI.$(widget);
},
createFragment: function () {
return document.createDocumentFragment();
@ -18360,7 +18360,7 @@ BI.ShowAction = BI.inherit(BI.Action, {
try {
// 注意0啊
// var jo = $.parseJSON(text) || {};
var jo = _global.$ ? _global.$.parseJSON(text) : _global.JSON.parse(text);
var jo = BI.$ ? BI.$.parseJSON(text) : _global.JSON.parse(text);
if (jo == null) {
jo = {};
}
@ -19464,7 +19464,7 @@ BI.ResizeController = BI.inherit(BI.Controller, {
_resize: function (ev) {
BI.each(this.resizerManger, function (key, resizer) {
if (resizer instanceof $) {
if (resizer instanceof BI.$) {
if (resizer.is(":visible")) {
resizer.trigger("__resize__");
}
@ -21790,7 +21790,7 @@ BI.prepares.push(function () {
BI.extend(BI.DOM, {
patchProps: function (fromElement, toElement) {
var elemData = jQuery._data(fromElement[0]);
var elemData = BI.jQuery._data(fromElement[0]);
var events = elemData.events;
BI.each(events, function (eventKey, event) {
BI.each(event, function (i, handler) {
@ -21802,7 +21802,7 @@ BI.prepares.push(function () {
throw new Error("不匹配");
}
BI.each(fromChildren, function (i, child) {
BI.DOM.patchProps(jQuery(child), jQuery(toChildren[i]));
BI.DOM.patchProps(BI.jQuery(child), BI.jQuery(toChildren[i]));
});
BI.each(fromElement.data("__widgets"), function (i, widget) {
widget.element = toElement;
@ -21819,7 +21819,7 @@ BI.prepares.push(function () {
var frag = BI.Widget._renderEngine.createFragment();
BI.each(doms, function (i, dom) {
dom instanceof BI.Widget && (dom = dom.element);
dom instanceof $ && dom[0] && frag.appendChild(dom[0]);
dom instanceof BI.$ && dom[0] && frag.appendChild(dom[0]);
});
return frag;
},
@ -32336,7 +32336,9 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
// })();
// Expose jQuery to the global object
window.jQuery = window.$ = jQuery;
BI.jQuery = BI.$ = jQuery;
window.$ = window.$ || jQuery;
window.jQuery = window.jQuery || jQuery;
// Expose jQuery as an AMD module, but only for AMD loaders that
// understand the issues with loading multiple versions of jQuery
@ -32357,13 +32359,13 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
})( window );/*
* 给jQuery.Event对象添加的工具方法
*/
$.extend($.Event.prototype, {
BI.$.extend(BI.$.Event.prototype, {
// event.stopEvent
stopEvent: function () {
this.stopPropagation();
this.preventDefault();
}
});if (jQuery) {
});if (BI.jQuery) {
(function ($) {
// richer:容器在其各个边缘留出的空间
if (!$.fn.insets) {
@ -32419,9 +32421,9 @@ $.extend($.Event.prototype, {
};
}
})(jQuery);
})(BI.jQuery);
BI.extend(jQuery.fn, {
BI.extend(BI.jQuery.fn, {
destroy: function () {
this.remove();
@ -32464,7 +32466,7 @@ $.extend($.Event.prototype, {
if (tidx >= 0) {
// 标红的text未encode
this.append(BI.htmlEncode(textLeft.substr(0, tidx)));
this.append($("<span>").addClass("bi-keyword-red-mark")
this.append(BI.$("<span>").addClass("bi-keyword-red-mark")
.html(BI.htmlEncode(textLeft.substr(tidx, keyword.length))));
textLeft = textLeft.substr(tidx + keyword.length);
@ -32474,7 +32476,7 @@ $.extend($.Event.prototype, {
} else if (pidx != null && pidx >= 0 && Math.floor(pidx / text.length) === Math.floor((pidx + keyword.length - 1) / text.length)) {
// 标红的text未encode
this.append(BI.htmlEncode(textLeft.substr(0, pidx)));
this.append($("<span>").addClass("bi-keyword-red-mark")
this.append(BI.$("<span>").addClass("bi-keyword-red-mark")
.html(BI.htmlEncode(textLeft.substr(pidx, keyword.length))));
if (py != null) {
py = py.substr(pidx + keyword.length);
@ -32491,8 +32493,8 @@ $.extend($.Event.prototype, {
},
getDomHeight: function (parent) {
var clone = $(this).clone();
clone.appendTo($(parent || "body"));
var clone = BI.$(this).clone();
clone.appendTo(BI.$(parent || "body"));
var height = clone.height();
clone.remove();
return height;
@ -32597,17 +32599,17 @@ _.extend(BI, {
$import: function () {
var _LOADED = {}; // alex:保存加载过的
function loadReady (src, must) {
var $scripts = $("head script, body script");
$.each($scripts, function (i, item) {
var $scripts = BI.$("head script, body script");
BI.$.each($scripts, function (i, item) {
if (item.src.indexOf(src) != -1) {
_LOADED[src] = true;
}
});
var $links = $("head link");
$.each($links, function (i, item) {
var $links = BI.$("head link");
BI.$.each($links, function (i, item) {
if (item.href.indexOf(src) != -1 && must) {
_LOADED[src] = false;
$(item).remove();
BI.$(item).remove();
}
});
}
@ -32629,7 +32631,7 @@ _.extend(BI, {
_LOADED[src] = true;
} else {
// alex:这里用同步调用的方式,必须等待ajax完成
$.ajax({
BI.$.ajax({
url: src,
dataType: "script", // alex:指定dataType为script,jquery会帮忙做globalEval的事情
async: false,
@ -37914,7 +37916,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
module.exports = factory;
} else {
// Browser globals
factory(jQuery);
factory(BI.jQuery);
}
}(function ($) {
@ -38339,7 +38341,11 @@ BI.Single = BI.inherit(BI.Widget, {
clearTimeout(self.hideTimeout);
self.hideTimeout = null;
}
self._showToolTip(self._e || e, opt);
// CHART-10611 在拖拽的情况下, 鼠标拖拽着元素离开了拖拽元素的容器,但是子元素在dom结构上仍然属于容器
// 这样会认为鼠标仍然在容器中, 500ms内放开的话,会在容器之外显示鼠标停留处显示容器的title
if (self.element.__isMouseInBounds__(self._e || e)) {
self._showToolTip(self._e || e, opt);
}
}
}, 500);
@ -38803,6 +38809,8 @@ BI.BasicButton = BI.inherit(BI.Single, {
el: {
type: "bi.bubble_combo",
trigger: "",
// bubble的提示不需要一直存在在界面上
destroyWhenHide: true,
ref: function () {
self.combo = this;
},
@ -39768,7 +39776,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
track(treeNode.children);
var treeObj = self.nodes;
var nodes = treeObj.getSelectedNodes();
$.each(nodes, function (index, node) {
BI.$.each(nodes, function (index, node) {
node.halfCheck = false;
});
}
@ -39905,7 +39913,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
n.isParent = n.isParent || n.parent;
// 处理标红
if (BI.isKey(o.paras.keyword)) {
n.text = $("<div>").__textKeywordMarked__(n.text, o.paras.keyword, n.py).html();
n.text = BI.$("<div>").__textKeywordMarked__(n.text, o.paras.keyword, n.py).html();
} else {
n.text = BI.htmlEncode(n.text + "");
}
@ -39949,7 +39957,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
if (self._stop === true) {
return;
}
self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
self.nodes = BI.$.fn.zTree.init(tree.element, setting, nodes);
};
var op = BI.extend({}, o.paras, {
times: 1
@ -39999,7 +40007,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
},
callback: {}
};
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);
this.nodes = BI.$.fn.zTree.init(this.tree.element, setting, nodes);
},
start: function () {
@ -40157,7 +40165,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
};
function onClick (event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj(treeId);
var zTree = BI.$.fn.zTree.getZTreeObj(treeId);
// 当前点击节点的状态是半选,且为true_part, 则将其改为false_part,使得点击半选后切换到的是全选
var checked = treeNode.checked;
var status = treeNode.getCheckStatus();
@ -40183,7 +40191,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
track(treeNode.children);
var treeObj = $.fn.zTree.getZTreeObj(treeId);
var treeObj = BI.$.fn.zTree.getZTreeObj(treeId);
var nodes = treeObj.getSelectedNodes();
BI.each(nodes, function (index, node) {
node.halfCheck = false;
@ -40478,7 +40486,7 @@ BI.PartTree = BI.inherit(BI.AsyncTree, {
if (self._stop === true) {
return;
}
self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
self.nodes = BI.$.fn.zTree.init(tree.element, setting, nodes);
}
BI.delay(function () {
@ -40557,7 +40565,7 @@ BI.ListTreeView = BI.inherit(BI.TreeView, {
};
function onClick (event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj(treeId);
var zTree = BI.$.fn.zTree.getZTreeObj(treeId);
var checked = treeNode.checked;
self._checkValue(treeNode, !checked);
zTree.checkNode(treeNode, !checked, true, true);
@ -40670,7 +40678,7 @@ BI.ListAsyncTree = BI.inherit(BI.ListTreeView, {
}
function onClick (event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj(treeId);
var zTree = BI.$.fn.zTree.getZTreeObj(treeId);
var checked = treeNode.checked;
self._checkValue(treeNode, !checked);
zTree.checkNode(treeNode, !checked, true, true);
@ -40808,7 +40816,7 @@ BI.ListPartTree = BI.inherit(BI.ListAsyncTree, {
if (self._stop === true) {
return;
}
self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
self.nodes = BI.$.fn.zTree.init(tree.element, setting, nodes);
}
BI.delay(function () {
@ -44041,7 +44049,7 @@ BI.Popover = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.Popover.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-popover bi-card",
baseCls: "bi-popover bi-card bi-border-radius",
// width: 600,
// height: 500,
size: "normal", // small, normal, big
@ -44089,6 +44097,7 @@ BI.Popover = BI.inherit(BI.Widget, {
cls: "bi-font-bold",
height: this._constant.HEADER_HEIGHT,
text: o.header,
title: o.header,
textAlign: "left"
},
left: 20,
@ -44633,8 +44642,16 @@ BI.ListView = BI.inherit(BI.Widget, {
o.scrollTop = self.element.scrollTop();
self._calculateBlocksToRender();
});
var lastWidth = this.element.width(),
lastHeight = this.element.height();
BI.ResizeDetector.addResizeListener(this, function () {
self._calculateBlocksToRender();
var width = self.element.width(),
height = self.element.height();
if (width !== lastWidth || height !== lastHeight) {
lastWidth = width;
lastHeight = height;
self._calculateBlocksToRender();
}
});
},
@ -51422,7 +51439,7 @@ BI.shortcut("bi.custom_tree", BI.CustomTree);/*
var zt = $.fn.zTree,
$$ = tools.$,
consts = zt.consts;
})(jQuery);/*
})(BI.jQuery);/*
* JQuery zTree excheck v3.5.18
* http://zTree.me/
*
@ -52051,7 +52068,7 @@ BI.shortcut("bi.custom_tree", BI.CustomTree);/*
}
return html;
}
})(jQuery);/**
})(BI.jQuery);/**
* 可以改变图标的button
*
* Created by GUY on 2016/2/2.
@ -54271,7 +54288,8 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.ColorChooser.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-color-chooser",
value: ""
value: "",
height: 24
});
},
@ -54291,8 +54309,8 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.trigger = _ref;
},
width: o.width,
height: o.height
width: o.width - 2,
height: o.height - 2
}, o.el),
popup: {
el: BI.extend({
@ -54705,7 +54723,7 @@ BI.ColorChooserTrigger = BI.inherit(BI.Trigger, {
var conf = BI.ColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border",
height: 24
height: 22
});
},
@ -54769,7 +54787,7 @@ BI.LongColorChooserTrigger = BI.inherit(BI.Trigger, {
var conf = BI.LongColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border",
height: 24
height: 22
});
},
@ -56074,9 +56092,11 @@ BI.TextBubblePopupBarView = BI.inherit(BI.Widget, {
buttons: [{
level: "ignore",
value: false,
stopPropagation: true,
text: BI.i18nText("BI-Basic_Cancel")
}, {
value: true,
stopPropagation: true,
text: BI.i18nText("BI-Basic_Sure")
}]
};
@ -61205,7 +61225,7 @@ BI.DisplayTree = BI.inherit(BI.TreeView, {
initTree: function (nodes, setting) {
var setting = setting || this._configSetting();
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);
this.nodes = BI.$.fn.zTree.init(this.tree.element, setting, nodes);
},
destroy: function () {
@ -61282,7 +61302,7 @@ BI.ListDisplayTree = BI.inherit(BI.ListTreeView, {
initTree: function (nodes, setting) {
var setting = setting || this._configSetting();
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);
this.nodes = BI.$.fn.zTree.init(this.tree.element, setting, nodes);
},
destroy: function () {
@ -62967,6 +62987,7 @@ BI.shortcut("bi.static_date_pane_card", BI.StaticDatePaneCard);BI.DynamicDatePan
default:
break;
}
self.fireEvent("EVENT_CHANGE");
}
}],
ref: function () {
@ -68565,7 +68586,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.setValue([value]);
self.combo.hideView();
}
}]
@ -69747,7 +69768,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.setValue([value]);
self.combo.hideView();
}
}]
@ -74533,6 +74554,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE);
});
}
}
@ -74606,16 +74628,14 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -74716,8 +74736,6 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}
@ -74873,6 +74891,7 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE);
});
}
}
@ -74949,16 +74968,14 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -75061,8 +75078,6 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}
@ -75196,6 +75211,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
});
}
}
@ -75268,16 +75284,14 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -75408,8 +75422,6 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}
@ -76380,7 +76392,8 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
height: 24,
allowEdit: true
allowEdit: true,
allowInsertValue: true
});
},
@ -76409,7 +76422,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
type: "bi.multi_list_tree_searcher",
itemsCreator: o.itemsCreator,
popup: {
type: "bi.multi_tree_search_insert_pane",
type: o.allowInsertValue ? "bi.multi_tree_search_insert_pane" : "bi.multi_tree_search_pane",
el: {
type: "bi.list_part_tree"
},
@ -87289,7 +87302,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
path.push(split);
childrenCount.push(expanded.length);
// 如果只有一个值且取消的就是这个值
if (i === parents.length - 1 && expanded.length === 1 && expanded[0] === notSelectedValue) {
if (i === parents.length - 1 && expanded.length === 1 && expanded[0].value === notSelectedValue) {
for (var j = childrenCount.length - 1; j >= 0; j--) {
if (childrenCount[j] === 1) {
self._deleteNode(selectedValues, path[j]);
@ -88153,6 +88166,8 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser,
text: o.text,
value: o.value,
watermark: o.watermark,
allowInsertValue: o.allowInsertValue,
allowEdit: o.allowEdit,
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,

74
dist/2.0/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

189
dist/2.0/fineui.js vendored

@ -12131,11 +12131,11 @@ if (!_global.BI) {
if (BI.isWidget(widget)) {
var o = widget.options;
if (o.element) {
return $(o.element);
return BI.$(o.element);
}
return $(document.createElement(o.tagName));
return BI.$(document.createElement(o.tagName));
}
return $(widget);
return BI.$(widget);
},
createFragment: function () {
return document.createDocumentFragment();
@ -18360,7 +18360,7 @@ BI.ShowAction = BI.inherit(BI.Action, {
try {
// 注意0啊
// var jo = $.parseJSON(text) || {};
var jo = _global.$ ? _global.$.parseJSON(text) : _global.JSON.parse(text);
var jo = BI.$ ? BI.$.parseJSON(text) : _global.JSON.parse(text);
if (jo == null) {
jo = {};
}
@ -19464,7 +19464,7 @@ BI.ResizeController = BI.inherit(BI.Controller, {
_resize: function (ev) {
BI.each(this.resizerManger, function (key, resizer) {
if (resizer instanceof $) {
if (resizer instanceof BI.$) {
if (resizer.is(":visible")) {
resizer.trigger("__resize__");
}
@ -21790,7 +21790,7 @@ BI.prepares.push(function () {
BI.extend(BI.DOM, {
patchProps: function (fromElement, toElement) {
var elemData = jQuery._data(fromElement[0]);
var elemData = BI.jQuery._data(fromElement[0]);
var events = elemData.events;
BI.each(events, function (eventKey, event) {
BI.each(event, function (i, handler) {
@ -21802,7 +21802,7 @@ BI.prepares.push(function () {
throw new Error("不匹配");
}
BI.each(fromChildren, function (i, child) {
BI.DOM.patchProps(jQuery(child), jQuery(toChildren[i]));
BI.DOM.patchProps(BI.jQuery(child), BI.jQuery(toChildren[i]));
});
BI.each(fromElement.data("__widgets"), function (i, widget) {
widget.element = toElement;
@ -21819,7 +21819,7 @@ BI.prepares.push(function () {
var frag = BI.Widget._renderEngine.createFragment();
BI.each(doms, function (i, dom) {
dom instanceof BI.Widget && (dom = dom.element);
dom instanceof $ && dom[0] && frag.appendChild(dom[0]);
dom instanceof BI.$ && dom[0] && frag.appendChild(dom[0]);
});
return frag;
},
@ -32336,7 +32336,9 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
// })();
// Expose jQuery to the global object
window.jQuery = window.$ = jQuery;
BI.jQuery = BI.$ = jQuery;
window.$ = window.$ || jQuery;
window.jQuery = window.jQuery || jQuery;
// Expose jQuery as an AMD module, but only for AMD loaders that
// understand the issues with loading multiple versions of jQuery
@ -32357,13 +32359,13 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
})( window );/*
* 给jQuery.Event对象添加的工具方法
*/
$.extend($.Event.prototype, {
BI.$.extend(BI.$.Event.prototype, {
// event.stopEvent
stopEvent: function () {
this.stopPropagation();
this.preventDefault();
}
});if (jQuery) {
});if (BI.jQuery) {
(function ($) {
// richer:容器在其各个边缘留出的空间
if (!$.fn.insets) {
@ -32419,9 +32421,9 @@ $.extend($.Event.prototype, {
};
}
})(jQuery);
})(BI.jQuery);
BI.extend(jQuery.fn, {
BI.extend(BI.jQuery.fn, {
destroy: function () {
this.remove();
@ -32464,7 +32466,7 @@ $.extend($.Event.prototype, {
if (tidx >= 0) {
// 标红的text未encode
this.append(BI.htmlEncode(textLeft.substr(0, tidx)));
this.append($("<span>").addClass("bi-keyword-red-mark")
this.append(BI.$("<span>").addClass("bi-keyword-red-mark")
.html(BI.htmlEncode(textLeft.substr(tidx, keyword.length))));
textLeft = textLeft.substr(tidx + keyword.length);
@ -32474,7 +32476,7 @@ $.extend($.Event.prototype, {
} else if (pidx != null && pidx >= 0 && Math.floor(pidx / text.length) === Math.floor((pidx + keyword.length - 1) / text.length)) {
// 标红的text未encode
this.append(BI.htmlEncode(textLeft.substr(0, pidx)));
this.append($("<span>").addClass("bi-keyword-red-mark")
this.append(BI.$("<span>").addClass("bi-keyword-red-mark")
.html(BI.htmlEncode(textLeft.substr(pidx, keyword.length))));
if (py != null) {
py = py.substr(pidx + keyword.length);
@ -32491,8 +32493,8 @@ $.extend($.Event.prototype, {
},
getDomHeight: function (parent) {
var clone = $(this).clone();
clone.appendTo($(parent || "body"));
var clone = BI.$(this).clone();
clone.appendTo(BI.$(parent || "body"));
var height = clone.height();
clone.remove();
return height;
@ -32597,17 +32599,17 @@ _.extend(BI, {
$import: function () {
var _LOADED = {}; // alex:保存加载过的
function loadReady (src, must) {
var $scripts = $("head script, body script");
$.each($scripts, function (i, item) {
var $scripts = BI.$("head script, body script");
BI.$.each($scripts, function (i, item) {
if (item.src.indexOf(src) != -1) {
_LOADED[src] = true;
}
});
var $links = $("head link");
$.each($links, function (i, item) {
var $links = BI.$("head link");
BI.$.each($links, function (i, item) {
if (item.href.indexOf(src) != -1 && must) {
_LOADED[src] = false;
$(item).remove();
BI.$(item).remove();
}
});
}
@ -32629,7 +32631,7 @@ _.extend(BI, {
_LOADED[src] = true;
} else {
// alex:这里用同步调用的方式,必须等待ajax完成
$.ajax({
BI.$.ajax({
url: src,
dataType: "script", // alex:指定dataType为script,jquery会帮忙做globalEval的事情
async: false,
@ -38318,7 +38320,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
module.exports = factory;
} else {
// Browser globals
factory(jQuery);
factory(BI.jQuery);
}
}(function ($) {
@ -38743,7 +38745,11 @@ BI.Single = BI.inherit(BI.Widget, {
clearTimeout(self.hideTimeout);
self.hideTimeout = null;
}
self._showToolTip(self._e || e, opt);
// CHART-10611 在拖拽的情况下, 鼠标拖拽着元素离开了拖拽元素的容器,但是子元素在dom结构上仍然属于容器
// 这样会认为鼠标仍然在容器中, 500ms内放开的话,会在容器之外显示鼠标停留处显示容器的title
if (self.element.__isMouseInBounds__(self._e || e)) {
self._showToolTip(self._e || e, opt);
}
}
}, 500);
@ -39207,6 +39213,8 @@ BI.BasicButton = BI.inherit(BI.Single, {
el: {
type: "bi.bubble_combo",
trigger: "",
// bubble的提示不需要一直存在在界面上
destroyWhenHide: true,
ref: function () {
self.combo = this;
},
@ -40172,7 +40180,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
track(treeNode.children);
var treeObj = self.nodes;
var nodes = treeObj.getSelectedNodes();
$.each(nodes, function (index, node) {
BI.$.each(nodes, function (index, node) {
node.halfCheck = false;
});
}
@ -40309,7 +40317,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
n.isParent = n.isParent || n.parent;
// 处理标红
if (BI.isKey(o.paras.keyword)) {
n.text = $("<div>").__textKeywordMarked__(n.text, o.paras.keyword, n.py).html();
n.text = BI.$("<div>").__textKeywordMarked__(n.text, o.paras.keyword, n.py).html();
} else {
n.text = BI.htmlEncode(n.text + "");
}
@ -40353,7 +40361,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
if (self._stop === true) {
return;
}
self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
self.nodes = BI.$.fn.zTree.init(tree.element, setting, nodes);
};
var op = BI.extend({}, o.paras, {
times: 1
@ -40403,7 +40411,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
},
callback: {}
};
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);
this.nodes = BI.$.fn.zTree.init(this.tree.element, setting, nodes);
},
start: function () {
@ -40561,7 +40569,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
};
function onClick (event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj(treeId);
var zTree = BI.$.fn.zTree.getZTreeObj(treeId);
// 当前点击节点的状态是半选,且为true_part, 则将其改为false_part,使得点击半选后切换到的是全选
var checked = treeNode.checked;
var status = treeNode.getCheckStatus();
@ -40587,7 +40595,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
track(treeNode.children);
var treeObj = $.fn.zTree.getZTreeObj(treeId);
var treeObj = BI.$.fn.zTree.getZTreeObj(treeId);
var nodes = treeObj.getSelectedNodes();
BI.each(nodes, function (index, node) {
node.halfCheck = false;
@ -40882,7 +40890,7 @@ BI.PartTree = BI.inherit(BI.AsyncTree, {
if (self._stop === true) {
return;
}
self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
self.nodes = BI.$.fn.zTree.init(tree.element, setting, nodes);
}
BI.delay(function () {
@ -40961,7 +40969,7 @@ BI.ListTreeView = BI.inherit(BI.TreeView, {
};
function onClick (event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj(treeId);
var zTree = BI.$.fn.zTree.getZTreeObj(treeId);
var checked = treeNode.checked;
self._checkValue(treeNode, !checked);
zTree.checkNode(treeNode, !checked, true, true);
@ -41074,7 +41082,7 @@ BI.ListAsyncTree = BI.inherit(BI.ListTreeView, {
}
function onClick (event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj(treeId);
var zTree = BI.$.fn.zTree.getZTreeObj(treeId);
var checked = treeNode.checked;
self._checkValue(treeNode, !checked);
zTree.checkNode(treeNode, !checked, true, true);
@ -41212,7 +41220,7 @@ BI.ListPartTree = BI.inherit(BI.ListAsyncTree, {
if (self._stop === true) {
return;
}
self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
self.nodes = BI.$.fn.zTree.init(tree.element, setting, nodes);
}
BI.delay(function () {
@ -44445,7 +44453,7 @@ BI.Popover = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.Popover.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-popover bi-card",
baseCls: "bi-popover bi-card bi-border-radius",
// width: 600,
// height: 500,
size: "normal", // small, normal, big
@ -44493,6 +44501,7 @@ BI.Popover = BI.inherit(BI.Widget, {
cls: "bi-font-bold",
height: this._constant.HEADER_HEIGHT,
text: o.header,
title: o.header,
textAlign: "left"
},
left: 20,
@ -45037,8 +45046,16 @@ BI.ListView = BI.inherit(BI.Widget, {
o.scrollTop = self.element.scrollTop();
self._calculateBlocksToRender();
});
var lastWidth = this.element.width(),
lastHeight = this.element.height();
BI.ResizeDetector.addResizeListener(this, function () {
self._calculateBlocksToRender();
var width = self.element.width(),
height = self.element.height();
if (width !== lastWidth || height !== lastHeight) {
lastWidth = width;
lastHeight = height;
self._calculateBlocksToRender();
}
});
},
@ -51826,7 +51843,7 @@ BI.shortcut("bi.custom_tree", BI.CustomTree);/*
var zt = $.fn.zTree,
$$ = tools.$,
consts = zt.consts;
})(jQuery);/*
})(BI.jQuery);/*
* JQuery zTree excheck v3.5.18
* http://zTree.me/
*
@ -52455,7 +52472,7 @@ BI.shortcut("bi.custom_tree", BI.CustomTree);/*
}
return html;
}
})(jQuery);/**
})(BI.jQuery);/**
* 可以改变图标的button
*
* Created by GUY on 2016/2/2.
@ -54675,7 +54692,8 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.ColorChooser.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-color-chooser",
value: ""
value: "",
height: 24
});
},
@ -54695,8 +54713,8 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.trigger = _ref;
},
width: o.width,
height: o.height
width: o.width - 2,
height: o.height - 2
}, o.el),
popup: {
el: BI.extend({
@ -55109,7 +55127,7 @@ BI.ColorChooserTrigger = BI.inherit(BI.Trigger, {
var conf = BI.ColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border",
height: 24
height: 22
});
},
@ -55173,7 +55191,7 @@ BI.LongColorChooserTrigger = BI.inherit(BI.Trigger, {
var conf = BI.LongColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border",
height: 24
height: 22
});
},
@ -56478,9 +56496,11 @@ BI.TextBubblePopupBarView = BI.inherit(BI.Widget, {
buttons: [{
level: "ignore",
value: false,
stopPropagation: true,
text: BI.i18nText("BI-Basic_Cancel")
}, {
value: true,
stopPropagation: true,
text: BI.i18nText("BI-Basic_Sure")
}]
};
@ -61609,7 +61629,7 @@ BI.DisplayTree = BI.inherit(BI.TreeView, {
initTree: function (nodes, setting) {
var setting = setting || this._configSetting();
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);
this.nodes = BI.$.fn.zTree.init(this.tree.element, setting, nodes);
},
destroy: function () {
@ -61686,7 +61706,7 @@ BI.ListDisplayTree = BI.inherit(BI.ListTreeView, {
initTree: function (nodes, setting) {
var setting = setting || this._configSetting();
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);
this.nodes = BI.$.fn.zTree.init(this.tree.element, setting, nodes);
},
destroy: function () {
@ -63371,6 +63391,7 @@ BI.shortcut("bi.static_date_pane_card", BI.StaticDatePaneCard);BI.DynamicDatePan
default:
break;
}
self.fireEvent("EVENT_CHANGE");
}
}],
ref: function () {
@ -68969,7 +68990,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.setValue([value]);
self.combo.hideView();
}
}]
@ -70151,7 +70172,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.setValue([value]);
self.combo.hideView();
}
}]
@ -74937,6 +74958,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE);
});
}
}
@ -75010,16 +75032,14 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -75120,8 +75140,6 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}
@ -75277,6 +75295,7 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE);
});
}
}
@ -75353,16 +75372,14 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -75465,8 +75482,6 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}
@ -75600,6 +75615,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
});
}
}
@ -75672,16 +75688,14 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -75812,8 +75826,6 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}
@ -76784,7 +76796,8 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
height: 24,
allowEdit: true
allowEdit: true,
allowInsertValue: true
});
},
@ -76813,7 +76826,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
type: "bi.multi_list_tree_searcher",
itemsCreator: o.itemsCreator,
popup: {
type: "bi.multi_tree_search_insert_pane",
type: o.allowInsertValue ? "bi.multi_tree_search_insert_pane" : "bi.multi_tree_search_pane",
el: {
type: "bi.list_part_tree"
},
@ -87693,7 +87706,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
path.push(split);
childrenCount.push(expanded.length);
// 如果只有一个值且取消的就是这个值
if (i === parents.length - 1 && expanded.length === 1 && expanded[0] === notSelectedValue) {
if (i === parents.length - 1 && expanded.length === 1 && expanded[0].value === notSelectedValue) {
for (var j = childrenCount.length - 1; j >= 0; j--) {
if (childrenCount[j] === 1) {
self._deleteNode(selectedValues, path[j]);
@ -88557,6 +88570,8 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser,
text: o.text,
value: o.value,
watermark: o.watermark,
allowInsertValue: o.allowInsertValue,
allowEdit: o.allowEdit,
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,

2
dist/2.0/fineui.min.css vendored

File diff suppressed because one or more lines are too long

74
dist/2.0/fineui.min.js vendored

File diff suppressed because one or more lines are too long

3
dist/base.css vendored

@ -2034,6 +2034,9 @@ ul.ztree.zTreeDragUL {
-moz-border-radius: 2px;
border-radius: 2px;
}
.bi-popover {
border: 1px solid transparent;
}
/**********BI.BIListView*************/
.bi-popup-view {
position: fixed !important;

47
dist/base.js vendored

@ -15,7 +15,7 @@
module.exports = factory;
} else {
// Browser globals
factory(jQuery);
factory(BI.jQuery);
}
}(function ($) {
@ -440,7 +440,11 @@ BI.Single = BI.inherit(BI.Widget, {
clearTimeout(self.hideTimeout);
self.hideTimeout = null;
}
self._showToolTip(self._e || e, opt);
// CHART-10611 在拖拽的情况下, 鼠标拖拽着元素离开了拖拽元素的容器,但是子元素在dom结构上仍然属于容器
// 这样会认为鼠标仍然在容器中, 500ms内放开的话,会在容器之外显示鼠标停留处显示容器的title
if (self.element.__isMouseInBounds__(self._e || e)) {
self._showToolTip(self._e || e, opt);
}
}
}, 500);
@ -904,6 +908,8 @@ BI.BasicButton = BI.inherit(BI.Single, {
el: {
type: "bi.bubble_combo",
trigger: "",
// bubble的提示不需要一直存在在界面上
destroyWhenHide: true,
ref: function () {
self.combo = this;
},
@ -1869,7 +1875,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
track(treeNode.children);
var treeObj = self.nodes;
var nodes = treeObj.getSelectedNodes();
$.each(nodes, function (index, node) {
BI.$.each(nodes, function (index, node) {
node.halfCheck = false;
});
}
@ -2006,7 +2012,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
n.isParent = n.isParent || n.parent;
// 处理标红
if (BI.isKey(o.paras.keyword)) {
n.text = $("<div>").__textKeywordMarked__(n.text, o.paras.keyword, n.py).html();
n.text = BI.$("<div>").__textKeywordMarked__(n.text, o.paras.keyword, n.py).html();
} else {
n.text = BI.htmlEncode(n.text + "");
}
@ -2050,7 +2056,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
if (self._stop === true) {
return;
}
self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
self.nodes = BI.$.fn.zTree.init(tree.element, setting, nodes);
};
var op = BI.extend({}, o.paras, {
times: 1
@ -2100,7 +2106,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
},
callback: {}
};
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);
this.nodes = BI.$.fn.zTree.init(this.tree.element, setting, nodes);
},
start: function () {
@ -2258,7 +2264,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
};
function onClick (event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj(treeId);
var zTree = BI.$.fn.zTree.getZTreeObj(treeId);
// 当前点击节点的状态是半选,且为true_part, 则将其改为false_part,使得点击半选后切换到的是全选
var checked = treeNode.checked;
var status = treeNode.getCheckStatus();
@ -2284,7 +2290,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
track(treeNode.children);
var treeObj = $.fn.zTree.getZTreeObj(treeId);
var treeObj = BI.$.fn.zTree.getZTreeObj(treeId);
var nodes = treeObj.getSelectedNodes();
BI.each(nodes, function (index, node) {
node.halfCheck = false;
@ -2579,7 +2585,7 @@ BI.PartTree = BI.inherit(BI.AsyncTree, {
if (self._stop === true) {
return;
}
self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
self.nodes = BI.$.fn.zTree.init(tree.element, setting, nodes);
}
BI.delay(function () {
@ -2658,7 +2664,7 @@ BI.ListTreeView = BI.inherit(BI.TreeView, {
};
function onClick (event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj(treeId);
var zTree = BI.$.fn.zTree.getZTreeObj(treeId);
var checked = treeNode.checked;
self._checkValue(treeNode, !checked);
zTree.checkNode(treeNode, !checked, true, true);
@ -2771,7 +2777,7 @@ BI.ListAsyncTree = BI.inherit(BI.ListTreeView, {
}
function onClick (event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj(treeId);
var zTree = BI.$.fn.zTree.getZTreeObj(treeId);
var checked = treeNode.checked;
self._checkValue(treeNode, !checked);
zTree.checkNode(treeNode, !checked, true, true);
@ -2909,7 +2915,7 @@ BI.ListPartTree = BI.inherit(BI.ListAsyncTree, {
if (self._stop === true) {
return;
}
self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
self.nodes = BI.$.fn.zTree.init(tree.element, setting, nodes);
}
BI.delay(function () {
@ -6142,7 +6148,7 @@ BI.Popover = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.Popover.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-popover bi-card",
baseCls: "bi-popover bi-card bi-border-radius",
// width: 600,
// height: 500,
size: "normal", // small, normal, big
@ -6190,6 +6196,7 @@ BI.Popover = BI.inherit(BI.Widget, {
cls: "bi-font-bold",
height: this._constant.HEADER_HEIGHT,
text: o.header,
title: o.header,
textAlign: "left"
},
left: 20,
@ -6734,8 +6741,16 @@ BI.ListView = BI.inherit(BI.Widget, {
o.scrollTop = self.element.scrollTop();
self._calculateBlocksToRender();
});
var lastWidth = this.element.width(),
lastHeight = this.element.height();
BI.ResizeDetector.addResizeListener(this, function () {
self._calculateBlocksToRender();
var width = self.element.width(),
height = self.element.height();
if (width !== lastWidth || height !== lastHeight) {
lastWidth = width;
lastHeight = height;
self._calculateBlocksToRender();
}
});
},
@ -13523,7 +13538,7 @@ BI.shortcut("bi.custom_tree", BI.CustomTree);/*
var zt = $.fn.zTree,
$$ = tools.$,
consts = zt.consts;
})(jQuery);/*
})(BI.jQuery);/*
* JQuery zTree excheck v3.5.18
* http://zTree.me/
*
@ -14152,4 +14167,4 @@ BI.shortcut("bi.custom_tree", BI.CustomTree);/*
}
return html;
}
})(jQuery);
})(BI.jQuery);

3
dist/bundle.css vendored

@ -4244,6 +4244,9 @@ ul.ztree.zTreeDragUL {
-moz-border-radius: 2px;
border-radius: 2px;
}
.bi-popover {
border: 1px solid transparent;
}
/**********BI.BIListView*************/
.bi-popup-view {
position: fixed !important;

189
dist/bundle.ie.js vendored

@ -12131,11 +12131,11 @@ if (!_global.BI) {
if (BI.isWidget(widget)) {
var o = widget.options;
if (o.element) {
return $(o.element);
return BI.$(o.element);
}
return $(document.createElement(o.tagName));
return BI.$(document.createElement(o.tagName));
}
return $(widget);
return BI.$(widget);
},
createFragment: function () {
return document.createDocumentFragment();
@ -18360,7 +18360,7 @@ BI.ShowAction = BI.inherit(BI.Action, {
try {
// 注意0啊
// var jo = $.parseJSON(text) || {};
var jo = _global.$ ? _global.$.parseJSON(text) : _global.JSON.parse(text);
var jo = BI.$ ? BI.$.parseJSON(text) : _global.JSON.parse(text);
if (jo == null) {
jo = {};
}
@ -19464,7 +19464,7 @@ BI.ResizeController = BI.inherit(BI.Controller, {
_resize: function (ev) {
BI.each(this.resizerManger, function (key, resizer) {
if (resizer instanceof $) {
if (resizer instanceof BI.$) {
if (resizer.is(":visible")) {
resizer.trigger("__resize__");
}
@ -21790,7 +21790,7 @@ BI.prepares.push(function () {
BI.extend(BI.DOM, {
patchProps: function (fromElement, toElement) {
var elemData = jQuery._data(fromElement[0]);
var elemData = BI.jQuery._data(fromElement[0]);
var events = elemData.events;
BI.each(events, function (eventKey, event) {
BI.each(event, function (i, handler) {
@ -21802,7 +21802,7 @@ BI.prepares.push(function () {
throw new Error("不匹配");
}
BI.each(fromChildren, function (i, child) {
BI.DOM.patchProps(jQuery(child), jQuery(toChildren[i]));
BI.DOM.patchProps(BI.jQuery(child), BI.jQuery(toChildren[i]));
});
BI.each(fromElement.data("__widgets"), function (i, widget) {
widget.element = toElement;
@ -21819,7 +21819,7 @@ BI.prepares.push(function () {
var frag = BI.Widget._renderEngine.createFragment();
BI.each(doms, function (i, dom) {
dom instanceof BI.Widget && (dom = dom.element);
dom instanceof $ && dom[0] && frag.appendChild(dom[0]);
dom instanceof BI.$ && dom[0] && frag.appendChild(dom[0]);
});
return frag;
},
@ -32336,7 +32336,9 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
// })();
// Expose jQuery to the global object
window.jQuery = window.$ = jQuery;
BI.jQuery = BI.$ = jQuery;
window.$ = window.$ || jQuery;
window.jQuery = window.jQuery || jQuery;
// Expose jQuery as an AMD module, but only for AMD loaders that
// understand the issues with loading multiple versions of jQuery
@ -32357,13 +32359,13 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
})( window );/*
* 给jQuery.Event对象添加的工具方法
*/
$.extend($.Event.prototype, {
BI.$.extend(BI.$.Event.prototype, {
// event.stopEvent
stopEvent: function () {
this.stopPropagation();
this.preventDefault();
}
});if (jQuery) {
});if (BI.jQuery) {
(function ($) {
// richer:容器在其各个边缘留出的空间
if (!$.fn.insets) {
@ -32419,9 +32421,9 @@ $.extend($.Event.prototype, {
};
}
})(jQuery);
})(BI.jQuery);
BI.extend(jQuery.fn, {
BI.extend(BI.jQuery.fn, {
destroy: function () {
this.remove();
@ -32464,7 +32466,7 @@ $.extend($.Event.prototype, {
if (tidx >= 0) {
// 标红的text未encode
this.append(BI.htmlEncode(textLeft.substr(0, tidx)));
this.append($("<span>").addClass("bi-keyword-red-mark")
this.append(BI.$("<span>").addClass("bi-keyword-red-mark")
.html(BI.htmlEncode(textLeft.substr(tidx, keyword.length))));
textLeft = textLeft.substr(tidx + keyword.length);
@ -32474,7 +32476,7 @@ $.extend($.Event.prototype, {
} else if (pidx != null && pidx >= 0 && Math.floor(pidx / text.length) === Math.floor((pidx + keyword.length - 1) / text.length)) {
// 标红的text未encode
this.append(BI.htmlEncode(textLeft.substr(0, pidx)));
this.append($("<span>").addClass("bi-keyword-red-mark")
this.append(BI.$("<span>").addClass("bi-keyword-red-mark")
.html(BI.htmlEncode(textLeft.substr(pidx, keyword.length))));
if (py != null) {
py = py.substr(pidx + keyword.length);
@ -32491,8 +32493,8 @@ $.extend($.Event.prototype, {
},
getDomHeight: function (parent) {
var clone = $(this).clone();
clone.appendTo($(parent || "body"));
var clone = BI.$(this).clone();
clone.appendTo(BI.$(parent || "body"));
var height = clone.height();
clone.remove();
return height;
@ -32597,17 +32599,17 @@ _.extend(BI, {
$import: function () {
var _LOADED = {}; // alex:保存加载过的
function loadReady (src, must) {
var $scripts = $("head script, body script");
$.each($scripts, function (i, item) {
var $scripts = BI.$("head script, body script");
BI.$.each($scripts, function (i, item) {
if (item.src.indexOf(src) != -1) {
_LOADED[src] = true;
}
});
var $links = $("head link");
$.each($links, function (i, item) {
var $links = BI.$("head link");
BI.$.each($links, function (i, item) {
if (item.href.indexOf(src) != -1 && must) {
_LOADED[src] = false;
$(item).remove();
BI.$(item).remove();
}
});
}
@ -32629,7 +32631,7 @@ _.extend(BI, {
_LOADED[src] = true;
} else {
// alex:这里用同步调用的方式,必须等待ajax完成
$.ajax({
BI.$.ajax({
url: src,
dataType: "script", // alex:指定dataType为script,jquery会帮忙做globalEval的事情
async: false,
@ -37914,7 +37916,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
module.exports = factory;
} else {
// Browser globals
factory(jQuery);
factory(BI.jQuery);
}
}(function ($) {
@ -38339,7 +38341,11 @@ BI.Single = BI.inherit(BI.Widget, {
clearTimeout(self.hideTimeout);
self.hideTimeout = null;
}
self._showToolTip(self._e || e, opt);
// CHART-10611 在拖拽的情况下, 鼠标拖拽着元素离开了拖拽元素的容器,但是子元素在dom结构上仍然属于容器
// 这样会认为鼠标仍然在容器中, 500ms内放开的话,会在容器之外显示鼠标停留处显示容器的title
if (self.element.__isMouseInBounds__(self._e || e)) {
self._showToolTip(self._e || e, opt);
}
}
}, 500);
@ -38803,6 +38809,8 @@ BI.BasicButton = BI.inherit(BI.Single, {
el: {
type: "bi.bubble_combo",
trigger: "",
// bubble的提示不需要一直存在在界面上
destroyWhenHide: true,
ref: function () {
self.combo = this;
},
@ -39768,7 +39776,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
track(treeNode.children);
var treeObj = self.nodes;
var nodes = treeObj.getSelectedNodes();
$.each(nodes, function (index, node) {
BI.$.each(nodes, function (index, node) {
node.halfCheck = false;
});
}
@ -39905,7 +39913,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
n.isParent = n.isParent || n.parent;
// 处理标红
if (BI.isKey(o.paras.keyword)) {
n.text = $("<div>").__textKeywordMarked__(n.text, o.paras.keyword, n.py).html();
n.text = BI.$("<div>").__textKeywordMarked__(n.text, o.paras.keyword, n.py).html();
} else {
n.text = BI.htmlEncode(n.text + "");
}
@ -39949,7 +39957,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
if (self._stop === true) {
return;
}
self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
self.nodes = BI.$.fn.zTree.init(tree.element, setting, nodes);
};
var op = BI.extend({}, o.paras, {
times: 1
@ -39999,7 +40007,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
},
callback: {}
};
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);
this.nodes = BI.$.fn.zTree.init(this.tree.element, setting, nodes);
},
start: function () {
@ -40157,7 +40165,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
};
function onClick (event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj(treeId);
var zTree = BI.$.fn.zTree.getZTreeObj(treeId);
// 当前点击节点的状态是半选,且为true_part, 则将其改为false_part,使得点击半选后切换到的是全选
var checked = treeNode.checked;
var status = treeNode.getCheckStatus();
@ -40183,7 +40191,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
track(treeNode.children);
var treeObj = $.fn.zTree.getZTreeObj(treeId);
var treeObj = BI.$.fn.zTree.getZTreeObj(treeId);
var nodes = treeObj.getSelectedNodes();
BI.each(nodes, function (index, node) {
node.halfCheck = false;
@ -40478,7 +40486,7 @@ BI.PartTree = BI.inherit(BI.AsyncTree, {
if (self._stop === true) {
return;
}
self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
self.nodes = BI.$.fn.zTree.init(tree.element, setting, nodes);
}
BI.delay(function () {
@ -40557,7 +40565,7 @@ BI.ListTreeView = BI.inherit(BI.TreeView, {
};
function onClick (event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj(treeId);
var zTree = BI.$.fn.zTree.getZTreeObj(treeId);
var checked = treeNode.checked;
self._checkValue(treeNode, !checked);
zTree.checkNode(treeNode, !checked, true, true);
@ -40670,7 +40678,7 @@ BI.ListAsyncTree = BI.inherit(BI.ListTreeView, {
}
function onClick (event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj(treeId);
var zTree = BI.$.fn.zTree.getZTreeObj(treeId);
var checked = treeNode.checked;
self._checkValue(treeNode, !checked);
zTree.checkNode(treeNode, !checked, true, true);
@ -40808,7 +40816,7 @@ BI.ListPartTree = BI.inherit(BI.ListAsyncTree, {
if (self._stop === true) {
return;
}
self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
self.nodes = BI.$.fn.zTree.init(tree.element, setting, nodes);
}
BI.delay(function () {
@ -44041,7 +44049,7 @@ BI.Popover = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.Popover.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-popover bi-card",
baseCls: "bi-popover bi-card bi-border-radius",
// width: 600,
// height: 500,
size: "normal", // small, normal, big
@ -44089,6 +44097,7 @@ BI.Popover = BI.inherit(BI.Widget, {
cls: "bi-font-bold",
height: this._constant.HEADER_HEIGHT,
text: o.header,
title: o.header,
textAlign: "left"
},
left: 20,
@ -44633,8 +44642,16 @@ BI.ListView = BI.inherit(BI.Widget, {
o.scrollTop = self.element.scrollTop();
self._calculateBlocksToRender();
});
var lastWidth = this.element.width(),
lastHeight = this.element.height();
BI.ResizeDetector.addResizeListener(this, function () {
self._calculateBlocksToRender();
var width = self.element.width(),
height = self.element.height();
if (width !== lastWidth || height !== lastHeight) {
lastWidth = width;
lastHeight = height;
self._calculateBlocksToRender();
}
});
},
@ -51422,7 +51439,7 @@ BI.shortcut("bi.custom_tree", BI.CustomTree);/*
var zt = $.fn.zTree,
$$ = tools.$,
consts = zt.consts;
})(jQuery);/*
})(BI.jQuery);/*
* JQuery zTree excheck v3.5.18
* http://zTree.me/
*
@ -52051,7 +52068,7 @@ BI.shortcut("bi.custom_tree", BI.CustomTree);/*
}
return html;
}
})(jQuery);/**
})(BI.jQuery);/**
* 可以改变图标的button
*
* Created by GUY on 2016/2/2.
@ -54271,7 +54288,8 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.ColorChooser.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-color-chooser",
value: ""
value: "",
height: 24
});
},
@ -54291,8 +54309,8 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.trigger = _ref;
},
width: o.width,
height: o.height
width: o.width - 2,
height: o.height - 2
}, o.el),
popup: {
el: BI.extend({
@ -54705,7 +54723,7 @@ BI.ColorChooserTrigger = BI.inherit(BI.Trigger, {
var conf = BI.ColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border",
height: 24
height: 22
});
},
@ -54769,7 +54787,7 @@ BI.LongColorChooserTrigger = BI.inherit(BI.Trigger, {
var conf = BI.LongColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border",
height: 24
height: 22
});
},
@ -56074,9 +56092,11 @@ BI.TextBubblePopupBarView = BI.inherit(BI.Widget, {
buttons: [{
level: "ignore",
value: false,
stopPropagation: true,
text: BI.i18nText("BI-Basic_Cancel")
}, {
value: true,
stopPropagation: true,
text: BI.i18nText("BI-Basic_Sure")
}]
};
@ -61205,7 +61225,7 @@ BI.DisplayTree = BI.inherit(BI.TreeView, {
initTree: function (nodes, setting) {
var setting = setting || this._configSetting();
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);
this.nodes = BI.$.fn.zTree.init(this.tree.element, setting, nodes);
},
destroy: function () {
@ -61282,7 +61302,7 @@ BI.ListDisplayTree = BI.inherit(BI.ListTreeView, {
initTree: function (nodes, setting) {
var setting = setting || this._configSetting();
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);
this.nodes = BI.$.fn.zTree.init(this.tree.element, setting, nodes);
},
destroy: function () {
@ -62967,6 +62987,7 @@ BI.shortcut("bi.static_date_pane_card", BI.StaticDatePaneCard);BI.DynamicDatePan
default:
break;
}
self.fireEvent("EVENT_CHANGE");
}
}],
ref: function () {
@ -68565,7 +68586,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.setValue([value]);
self.combo.hideView();
}
}]
@ -69747,7 +69768,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.setValue([value]);
self.combo.hideView();
}
}]
@ -74533,6 +74554,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE);
});
}
}
@ -74606,16 +74628,14 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -74716,8 +74736,6 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}
@ -74873,6 +74891,7 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE);
});
}
}
@ -74949,16 +74968,14 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -75061,8 +75078,6 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}
@ -75196,6 +75211,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
});
}
}
@ -75268,16 +75284,14 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -75408,8 +75422,6 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}
@ -76380,7 +76392,8 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
height: 24,
allowEdit: true
allowEdit: true,
allowInsertValue: true
});
},
@ -76409,7 +76422,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
type: "bi.multi_list_tree_searcher",
itemsCreator: o.itemsCreator,
popup: {
type: "bi.multi_tree_search_insert_pane",
type: o.allowInsertValue ? "bi.multi_tree_search_insert_pane" : "bi.multi_tree_search_pane",
el: {
type: "bi.list_part_tree"
},
@ -87289,7 +87302,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
path.push(split);
childrenCount.push(expanded.length);
// 如果只有一个值且取消的就是这个值
if (i === parents.length - 1 && expanded.length === 1 && expanded[0] === notSelectedValue) {
if (i === parents.length - 1 && expanded.length === 1 && expanded[0].value === notSelectedValue) {
for (var j = childrenCount.length - 1; j >= 0; j--) {
if (childrenCount[j] === 1) {
self._deleteNode(selectedValues, path[j]);
@ -88153,6 +88166,8 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser,
text: o.text,
value: o.value,
watermark: o.watermark,
allowInsertValue: o.allowInsertValue,
allowEdit: o.allowEdit,
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,

74
dist/bundle.ie.min.js vendored

File diff suppressed because one or more lines are too long

189
dist/bundle.js vendored

@ -12131,11 +12131,11 @@ if (!_global.BI) {
if (BI.isWidget(widget)) {
var o = widget.options;
if (o.element) {
return $(o.element);
return BI.$(o.element);
}
return $(document.createElement(o.tagName));
return BI.$(document.createElement(o.tagName));
}
return $(widget);
return BI.$(widget);
},
createFragment: function () {
return document.createDocumentFragment();
@ -18360,7 +18360,7 @@ BI.ShowAction = BI.inherit(BI.Action, {
try {
// 注意0啊
// var jo = $.parseJSON(text) || {};
var jo = _global.$ ? _global.$.parseJSON(text) : _global.JSON.parse(text);
var jo = BI.$ ? BI.$.parseJSON(text) : _global.JSON.parse(text);
if (jo == null) {
jo = {};
}
@ -19464,7 +19464,7 @@ BI.ResizeController = BI.inherit(BI.Controller, {
_resize: function (ev) {
BI.each(this.resizerManger, function (key, resizer) {
if (resizer instanceof $) {
if (resizer instanceof BI.$) {
if (resizer.is(":visible")) {
resizer.trigger("__resize__");
}
@ -21790,7 +21790,7 @@ BI.prepares.push(function () {
BI.extend(BI.DOM, {
patchProps: function (fromElement, toElement) {
var elemData = jQuery._data(fromElement[0]);
var elemData = BI.jQuery._data(fromElement[0]);
var events = elemData.events;
BI.each(events, function (eventKey, event) {
BI.each(event, function (i, handler) {
@ -21802,7 +21802,7 @@ BI.prepares.push(function () {
throw new Error("不匹配");
}
BI.each(fromChildren, function (i, child) {
BI.DOM.patchProps(jQuery(child), jQuery(toChildren[i]));
BI.DOM.patchProps(BI.jQuery(child), BI.jQuery(toChildren[i]));
});
BI.each(fromElement.data("__widgets"), function (i, widget) {
widget.element = toElement;
@ -21819,7 +21819,7 @@ BI.prepares.push(function () {
var frag = BI.Widget._renderEngine.createFragment();
BI.each(doms, function (i, dom) {
dom instanceof BI.Widget && (dom = dom.element);
dom instanceof $ && dom[0] && frag.appendChild(dom[0]);
dom instanceof BI.$ && dom[0] && frag.appendChild(dom[0]);
});
return frag;
},
@ -32336,7 +32336,9 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
// })();
// Expose jQuery to the global object
window.jQuery = window.$ = jQuery;
BI.jQuery = BI.$ = jQuery;
window.$ = window.$ || jQuery;
window.jQuery = window.jQuery || jQuery;
// Expose jQuery as an AMD module, but only for AMD loaders that
// understand the issues with loading multiple versions of jQuery
@ -32357,13 +32359,13 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
})( window );/*
* 给jQuery.Event对象添加的工具方法
*/
$.extend($.Event.prototype, {
BI.$.extend(BI.$.Event.prototype, {
// event.stopEvent
stopEvent: function () {
this.stopPropagation();
this.preventDefault();
}
});if (jQuery) {
});if (BI.jQuery) {
(function ($) {
// richer:容器在其各个边缘留出的空间
if (!$.fn.insets) {
@ -32419,9 +32421,9 @@ $.extend($.Event.prototype, {
};
}
})(jQuery);
})(BI.jQuery);
BI.extend(jQuery.fn, {
BI.extend(BI.jQuery.fn, {
destroy: function () {
this.remove();
@ -32464,7 +32466,7 @@ $.extend($.Event.prototype, {
if (tidx >= 0) {
// 标红的text未encode
this.append(BI.htmlEncode(textLeft.substr(0, tidx)));
this.append($("<span>").addClass("bi-keyword-red-mark")
this.append(BI.$("<span>").addClass("bi-keyword-red-mark")
.html(BI.htmlEncode(textLeft.substr(tidx, keyword.length))));
textLeft = textLeft.substr(tidx + keyword.length);
@ -32474,7 +32476,7 @@ $.extend($.Event.prototype, {
} else if (pidx != null && pidx >= 0 && Math.floor(pidx / text.length) === Math.floor((pidx + keyword.length - 1) / text.length)) {
// 标红的text未encode
this.append(BI.htmlEncode(textLeft.substr(0, pidx)));
this.append($("<span>").addClass("bi-keyword-red-mark")
this.append(BI.$("<span>").addClass("bi-keyword-red-mark")
.html(BI.htmlEncode(textLeft.substr(pidx, keyword.length))));
if (py != null) {
py = py.substr(pidx + keyword.length);
@ -32491,8 +32493,8 @@ $.extend($.Event.prototype, {
},
getDomHeight: function (parent) {
var clone = $(this).clone();
clone.appendTo($(parent || "body"));
var clone = BI.$(this).clone();
clone.appendTo(BI.$(parent || "body"));
var height = clone.height();
clone.remove();
return height;
@ -32597,17 +32599,17 @@ _.extend(BI, {
$import: function () {
var _LOADED = {}; // alex:保存加载过的
function loadReady (src, must) {
var $scripts = $("head script, body script");
$.each($scripts, function (i, item) {
var $scripts = BI.$("head script, body script");
BI.$.each($scripts, function (i, item) {
if (item.src.indexOf(src) != -1) {
_LOADED[src] = true;
}
});
var $links = $("head link");
$.each($links, function (i, item) {
var $links = BI.$("head link");
BI.$.each($links, function (i, item) {
if (item.href.indexOf(src) != -1 && must) {
_LOADED[src] = false;
$(item).remove();
BI.$(item).remove();
}
});
}
@ -32629,7 +32631,7 @@ _.extend(BI, {
_LOADED[src] = true;
} else {
// alex:这里用同步调用的方式,必须等待ajax完成
$.ajax({
BI.$.ajax({
url: src,
dataType: "script", // alex:指定dataType为script,jquery会帮忙做globalEval的事情
async: false,
@ -38318,7 +38320,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
module.exports = factory;
} else {
// Browser globals
factory(jQuery);
factory(BI.jQuery);
}
}(function ($) {
@ -38743,7 +38745,11 @@ BI.Single = BI.inherit(BI.Widget, {
clearTimeout(self.hideTimeout);
self.hideTimeout = null;
}
self._showToolTip(self._e || e, opt);
// CHART-10611 在拖拽的情况下, 鼠标拖拽着元素离开了拖拽元素的容器,但是子元素在dom结构上仍然属于容器
// 这样会认为鼠标仍然在容器中, 500ms内放开的话,会在容器之外显示鼠标停留处显示容器的title
if (self.element.__isMouseInBounds__(self._e || e)) {
self._showToolTip(self._e || e, opt);
}
}
}, 500);
@ -39207,6 +39213,8 @@ BI.BasicButton = BI.inherit(BI.Single, {
el: {
type: "bi.bubble_combo",
trigger: "",
// bubble的提示不需要一直存在在界面上
destroyWhenHide: true,
ref: function () {
self.combo = this;
},
@ -40172,7 +40180,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
track(treeNode.children);
var treeObj = self.nodes;
var nodes = treeObj.getSelectedNodes();
$.each(nodes, function (index, node) {
BI.$.each(nodes, function (index, node) {
node.halfCheck = false;
});
}
@ -40309,7 +40317,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
n.isParent = n.isParent || n.parent;
// 处理标红
if (BI.isKey(o.paras.keyword)) {
n.text = $("<div>").__textKeywordMarked__(n.text, o.paras.keyword, n.py).html();
n.text = BI.$("<div>").__textKeywordMarked__(n.text, o.paras.keyword, n.py).html();
} else {
n.text = BI.htmlEncode(n.text + "");
}
@ -40353,7 +40361,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
if (self._stop === true) {
return;
}
self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
self.nodes = BI.$.fn.zTree.init(tree.element, setting, nodes);
};
var op = BI.extend({}, o.paras, {
times: 1
@ -40403,7 +40411,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
},
callback: {}
};
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);
this.nodes = BI.$.fn.zTree.init(this.tree.element, setting, nodes);
},
start: function () {
@ -40561,7 +40569,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
};
function onClick (event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj(treeId);
var zTree = BI.$.fn.zTree.getZTreeObj(treeId);
// 当前点击节点的状态是半选,且为true_part, 则将其改为false_part,使得点击半选后切换到的是全选
var checked = treeNode.checked;
var status = treeNode.getCheckStatus();
@ -40587,7 +40595,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
track(treeNode.children);
var treeObj = $.fn.zTree.getZTreeObj(treeId);
var treeObj = BI.$.fn.zTree.getZTreeObj(treeId);
var nodes = treeObj.getSelectedNodes();
BI.each(nodes, function (index, node) {
node.halfCheck = false;
@ -40882,7 +40890,7 @@ BI.PartTree = BI.inherit(BI.AsyncTree, {
if (self._stop === true) {
return;
}
self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
self.nodes = BI.$.fn.zTree.init(tree.element, setting, nodes);
}
BI.delay(function () {
@ -40961,7 +40969,7 @@ BI.ListTreeView = BI.inherit(BI.TreeView, {
};
function onClick (event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj(treeId);
var zTree = BI.$.fn.zTree.getZTreeObj(treeId);
var checked = treeNode.checked;
self._checkValue(treeNode, !checked);
zTree.checkNode(treeNode, !checked, true, true);
@ -41074,7 +41082,7 @@ BI.ListAsyncTree = BI.inherit(BI.ListTreeView, {
}
function onClick (event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj(treeId);
var zTree = BI.$.fn.zTree.getZTreeObj(treeId);
var checked = treeNode.checked;
self._checkValue(treeNode, !checked);
zTree.checkNode(treeNode, !checked, true, true);
@ -41212,7 +41220,7 @@ BI.ListPartTree = BI.inherit(BI.ListAsyncTree, {
if (self._stop === true) {
return;
}
self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
self.nodes = BI.$.fn.zTree.init(tree.element, setting, nodes);
}
BI.delay(function () {
@ -44445,7 +44453,7 @@ BI.Popover = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.Popover.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-popover bi-card",
baseCls: "bi-popover bi-card bi-border-radius",
// width: 600,
// height: 500,
size: "normal", // small, normal, big
@ -44493,6 +44501,7 @@ BI.Popover = BI.inherit(BI.Widget, {
cls: "bi-font-bold",
height: this._constant.HEADER_HEIGHT,
text: o.header,
title: o.header,
textAlign: "left"
},
left: 20,
@ -45037,8 +45046,16 @@ BI.ListView = BI.inherit(BI.Widget, {
o.scrollTop = self.element.scrollTop();
self._calculateBlocksToRender();
});
var lastWidth = this.element.width(),
lastHeight = this.element.height();
BI.ResizeDetector.addResizeListener(this, function () {
self._calculateBlocksToRender();
var width = self.element.width(),
height = self.element.height();
if (width !== lastWidth || height !== lastHeight) {
lastWidth = width;
lastHeight = height;
self._calculateBlocksToRender();
}
});
},
@ -51826,7 +51843,7 @@ BI.shortcut("bi.custom_tree", BI.CustomTree);/*
var zt = $.fn.zTree,
$$ = tools.$,
consts = zt.consts;
})(jQuery);/*
})(BI.jQuery);/*
* JQuery zTree excheck v3.5.18
* http://zTree.me/
*
@ -52455,7 +52472,7 @@ BI.shortcut("bi.custom_tree", BI.CustomTree);/*
}
return html;
}
})(jQuery);/**
})(BI.jQuery);/**
* 可以改变图标的button
*
* Created by GUY on 2016/2/2.
@ -54675,7 +54692,8 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.ColorChooser.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-color-chooser",
value: ""
value: "",
height: 24
});
},
@ -54695,8 +54713,8 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.trigger = _ref;
},
width: o.width,
height: o.height
width: o.width - 2,
height: o.height - 2
}, o.el),
popup: {
el: BI.extend({
@ -55109,7 +55127,7 @@ BI.ColorChooserTrigger = BI.inherit(BI.Trigger, {
var conf = BI.ColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border",
height: 24
height: 22
});
},
@ -55173,7 +55191,7 @@ BI.LongColorChooserTrigger = BI.inherit(BI.Trigger, {
var conf = BI.LongColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border",
height: 24
height: 22
});
},
@ -56478,9 +56496,11 @@ BI.TextBubblePopupBarView = BI.inherit(BI.Widget, {
buttons: [{
level: "ignore",
value: false,
stopPropagation: true,
text: BI.i18nText("BI-Basic_Cancel")
}, {
value: true,
stopPropagation: true,
text: BI.i18nText("BI-Basic_Sure")
}]
};
@ -61609,7 +61629,7 @@ BI.DisplayTree = BI.inherit(BI.TreeView, {
initTree: function (nodes, setting) {
var setting = setting || this._configSetting();
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);
this.nodes = BI.$.fn.zTree.init(this.tree.element, setting, nodes);
},
destroy: function () {
@ -61686,7 +61706,7 @@ BI.ListDisplayTree = BI.inherit(BI.ListTreeView, {
initTree: function (nodes, setting) {
var setting = setting || this._configSetting();
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);
this.nodes = BI.$.fn.zTree.init(this.tree.element, setting, nodes);
},
destroy: function () {
@ -63371,6 +63391,7 @@ BI.shortcut("bi.static_date_pane_card", BI.StaticDatePaneCard);BI.DynamicDatePan
default:
break;
}
self.fireEvent("EVENT_CHANGE");
}
}],
ref: function () {
@ -68969,7 +68990,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.setValue([value]);
self.combo.hideView();
}
}]
@ -70151,7 +70172,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.setValue([value]);
self.combo.hideView();
}
}]
@ -74937,6 +74958,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE);
});
}
}
@ -75010,16 +75032,14 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -75120,8 +75140,6 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}
@ -75277,6 +75295,7 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE);
});
}
}
@ -75353,16 +75372,14 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -75465,8 +75482,6 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}
@ -75600,6 +75615,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
});
}
}
@ -75672,16 +75688,14 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -75812,8 +75826,6 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}
@ -76784,7 +76796,8 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
height: 24,
allowEdit: true
allowEdit: true,
allowInsertValue: true
});
},
@ -76813,7 +76826,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
type: "bi.multi_list_tree_searcher",
itemsCreator: o.itemsCreator,
popup: {
type: "bi.multi_tree_search_insert_pane",
type: o.allowInsertValue ? "bi.multi_tree_search_insert_pane" : "bi.multi_tree_search_pane",
el: {
type: "bi.list_part_tree"
},
@ -87693,7 +87706,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
path.push(split);
childrenCount.push(expanded.length);
// 如果只有一个值且取消的就是这个值
if (i === parents.length - 1 && expanded.length === 1 && expanded[0] === notSelectedValue) {
if (i === parents.length - 1 && expanded.length === 1 && expanded[0].value === notSelectedValue) {
for (var j = childrenCount.length - 1; j >= 0; j--) {
if (childrenCount[j] === 1) {
self._deleteNode(selectedValues, path[j]);
@ -88557,6 +88570,8 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser,
text: o.text,
value: o.value,
watermark: o.watermark,
allowInsertValue: o.allowInsertValue,
allowEdit: o.allowEdit,
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,

2
dist/bundle.min.css vendored

File diff suppressed because one or more lines are too long

74
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

17
dist/case.js vendored

@ -2218,7 +2218,8 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.ColorChooser.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-color-chooser",
value: ""
value: "",
height: 24
});
},
@ -2238,8 +2239,8 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.trigger = _ref;
},
width: o.width,
height: o.height
width: o.width - 2,
height: o.height - 2
}, o.el),
popup: {
el: BI.extend({
@ -2652,7 +2653,7 @@ BI.ColorChooserTrigger = BI.inherit(BI.Trigger, {
var conf = BI.ColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border",
height: 24
height: 22
});
},
@ -2716,7 +2717,7 @@ BI.LongColorChooserTrigger = BI.inherit(BI.Trigger, {
var conf = BI.LongColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border",
height: 24
height: 22
});
},
@ -4021,9 +4022,11 @@ BI.TextBubblePopupBarView = BI.inherit(BI.Widget, {
buttons: [{
level: "ignore",
value: false,
stopPropagation: true,
text: BI.i18nText("BI-Basic_Cancel")
}, {
value: true,
stopPropagation: true,
text: BI.i18nText("BI-Basic_Sure")
}]
};
@ -9152,7 +9155,7 @@ BI.DisplayTree = BI.inherit(BI.TreeView, {
initTree: function (nodes, setting) {
var setting = setting || this._configSetting();
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);
this.nodes = BI.$.fn.zTree.init(this.tree.element, setting, nodes);
},
destroy: function () {
@ -9229,7 +9232,7 @@ BI.ListDisplayTree = BI.inherit(BI.ListTreeView, {
initTree: function (nodes, setting) {
var setting = setting || this._configSetting();
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);
this.nodes = BI.$.fn.zTree.init(this.tree.element, setting, nodes);
},
destroy: function () {

48
dist/core.js vendored

@ -12131,11 +12131,11 @@ if (!_global.BI) {
if (BI.isWidget(widget)) {
var o = widget.options;
if (o.element) {
return $(o.element);
return BI.$(o.element);
}
return $(document.createElement(o.tagName));
return BI.$(document.createElement(o.tagName));
}
return $(widget);
return BI.$(widget);
},
createFragment: function () {
return document.createDocumentFragment();
@ -18360,7 +18360,7 @@ BI.ShowAction = BI.inherit(BI.Action, {
try {
// 注意0啊
// var jo = $.parseJSON(text) || {};
var jo = _global.$ ? _global.$.parseJSON(text) : _global.JSON.parse(text);
var jo = BI.$ ? BI.$.parseJSON(text) : _global.JSON.parse(text);
if (jo == null) {
jo = {};
}
@ -19464,7 +19464,7 @@ BI.ResizeController = BI.inherit(BI.Controller, {
_resize: function (ev) {
BI.each(this.resizerManger, function (key, resizer) {
if (resizer instanceof $) {
if (resizer instanceof BI.$) {
if (resizer.is(":visible")) {
resizer.trigger("__resize__");
}
@ -21790,7 +21790,7 @@ BI.prepares.push(function () {
BI.extend(BI.DOM, {
patchProps: function (fromElement, toElement) {
var elemData = jQuery._data(fromElement[0]);
var elemData = BI.jQuery._data(fromElement[0]);
var events = elemData.events;
BI.each(events, function (eventKey, event) {
BI.each(event, function (i, handler) {
@ -21802,7 +21802,7 @@ BI.prepares.push(function () {
throw new Error("不匹配");
}
BI.each(fromChildren, function (i, child) {
BI.DOM.patchProps(jQuery(child), jQuery(toChildren[i]));
BI.DOM.patchProps(BI.jQuery(child), BI.jQuery(toChildren[i]));
});
BI.each(fromElement.data("__widgets"), function (i, widget) {
widget.element = toElement;
@ -21819,7 +21819,7 @@ BI.prepares.push(function () {
var frag = BI.Widget._renderEngine.createFragment();
BI.each(doms, function (i, dom) {
dom instanceof BI.Widget && (dom = dom.element);
dom instanceof $ && dom[0] && frag.appendChild(dom[0]);
dom instanceof BI.$ && dom[0] && frag.appendChild(dom[0]);
});
return frag;
},
@ -32336,7 +32336,9 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
// })();
// Expose jQuery to the global object
window.jQuery = window.$ = jQuery;
BI.jQuery = BI.$ = jQuery;
window.$ = window.$ || jQuery;
window.jQuery = window.jQuery || jQuery;
// Expose jQuery as an AMD module, but only for AMD loaders that
// understand the issues with loading multiple versions of jQuery
@ -32357,13 +32359,13 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
})( window );/*
* 给jQuery.Event对象添加的工具方法
*/
$.extend($.Event.prototype, {
BI.$.extend(BI.$.Event.prototype, {
// event.stopEvent
stopEvent: function () {
this.stopPropagation();
this.preventDefault();
}
});if (jQuery) {
});if (BI.jQuery) {
(function ($) {
// richer:容器在其各个边缘留出的空间
if (!$.fn.insets) {
@ -32419,9 +32421,9 @@ $.extend($.Event.prototype, {
};
}
})(jQuery);
})(BI.jQuery);
BI.extend(jQuery.fn, {
BI.extend(BI.jQuery.fn, {
destroy: function () {
this.remove();
@ -32464,7 +32466,7 @@ $.extend($.Event.prototype, {
if (tidx >= 0) {
// 标红的text未encode
this.append(BI.htmlEncode(textLeft.substr(0, tidx)));
this.append($("<span>").addClass("bi-keyword-red-mark")
this.append(BI.$("<span>").addClass("bi-keyword-red-mark")
.html(BI.htmlEncode(textLeft.substr(tidx, keyword.length))));
textLeft = textLeft.substr(tidx + keyword.length);
@ -32474,7 +32476,7 @@ $.extend($.Event.prototype, {
} else if (pidx != null && pidx >= 0 && Math.floor(pidx / text.length) === Math.floor((pidx + keyword.length - 1) / text.length)) {
// 标红的text未encode
this.append(BI.htmlEncode(textLeft.substr(0, pidx)));
this.append($("<span>").addClass("bi-keyword-red-mark")
this.append(BI.$("<span>").addClass("bi-keyword-red-mark")
.html(BI.htmlEncode(textLeft.substr(pidx, keyword.length))));
if (py != null) {
py = py.substr(pidx + keyword.length);
@ -32491,8 +32493,8 @@ $.extend($.Event.prototype, {
},
getDomHeight: function (parent) {
var clone = $(this).clone();
clone.appendTo($(parent || "body"));
var clone = BI.$(this).clone();
clone.appendTo(BI.$(parent || "body"));
var height = clone.height();
clone.remove();
return height;
@ -32597,17 +32599,17 @@ _.extend(BI, {
$import: function () {
var _LOADED = {}; // alex:保存加载过的
function loadReady (src, must) {
var $scripts = $("head script, body script");
$.each($scripts, function (i, item) {
var $scripts = BI.$("head script, body script");
BI.$.each($scripts, function (i, item) {
if (item.src.indexOf(src) != -1) {
_LOADED[src] = true;
}
});
var $links = $("head link");
$.each($links, function (i, item) {
var $links = BI.$("head link");
BI.$.each($links, function (i, item) {
if (item.href.indexOf(src) != -1 && must) {
_LOADED[src] = false;
$(item).remove();
BI.$(item).remove();
}
});
}
@ -32629,7 +32631,7 @@ _.extend(BI, {
_LOADED[src] = true;
} else {
// alex:这里用同步调用的方式,必须等待ajax完成
$.ajax({
BI.$.ajax({
url: src,
dataType: "script", // alex:指定dataType为script,jquery会帮忙做globalEval的事情
async: false,

6
dist/demo.js vendored

@ -1,7 +1,7 @@
Demo = {
version: 1.0
};
$(function () {
BI.$(function () {
var ref;
BI.each(Demo.CONFIG, function (index, item) {
@ -8962,13 +8962,13 @@ BI.shortcut("demo.main", Demo.Main);!(function () {
type: "bi.text_button",
text: "星空蓝",
handler: function () {
$("html").removeClass("bi-theme-default").addClass("bi-theme-dark");
BI.$("html").removeClass("bi-theme-default").addClass("bi-theme-dark");
}
}, {
type: "bi.text_button",
text: "典雅白",
handler: function () {
$("html").removeClass("bi-theme-dark").addClass("bi-theme-default");
BI.$("html").removeClass("bi-theme-dark").addClass("bi-theme-default");
}
}]
}

3
dist/fineui.css vendored

@ -4244,6 +4244,9 @@ ul.ztree.zTreeDragUL {
-moz-border-radius: 2px;
border-radius: 2px;
}
.bi-popover {
border: 1px solid transparent;
}
/**********BI.BIListView*************/
.bi-popup-view {
position: fixed !important;

189
dist/fineui.ie.js vendored

@ -12376,11 +12376,11 @@ if (!_global.BI) {
if (BI.isWidget(widget)) {
var o = widget.options;
if (o.element) {
return $(o.element);
return BI.$(o.element);
}
return $(document.createElement(o.tagName));
return BI.$(document.createElement(o.tagName));
}
return $(widget);
return BI.$(widget);
},
createFragment: function () {
return document.createDocumentFragment();
@ -18605,7 +18605,7 @@ BI.ShowAction = BI.inherit(BI.Action, {
try {
// 注意0啊
// var jo = $.parseJSON(text) || {};
var jo = _global.$ ? _global.$.parseJSON(text) : _global.JSON.parse(text);
var jo = BI.$ ? BI.$.parseJSON(text) : _global.JSON.parse(text);
if (jo == null) {
jo = {};
}
@ -19709,7 +19709,7 @@ BI.ResizeController = BI.inherit(BI.Controller, {
_resize: function (ev) {
BI.each(this.resizerManger, function (key, resizer) {
if (resizer instanceof $) {
if (resizer instanceof BI.$) {
if (resizer.is(":visible")) {
resizer.trigger("__resize__");
}
@ -22035,7 +22035,7 @@ BI.prepares.push(function () {
BI.extend(BI.DOM, {
patchProps: function (fromElement, toElement) {
var elemData = jQuery._data(fromElement[0]);
var elemData = BI.jQuery._data(fromElement[0]);
var events = elemData.events;
BI.each(events, function (eventKey, event) {
BI.each(event, function (i, handler) {
@ -22047,7 +22047,7 @@ BI.prepares.push(function () {
throw new Error("不匹配");
}
BI.each(fromChildren, function (i, child) {
BI.DOM.patchProps(jQuery(child), jQuery(toChildren[i]));
BI.DOM.patchProps(BI.jQuery(child), BI.jQuery(toChildren[i]));
});
BI.each(fromElement.data("__widgets"), function (i, widget) {
widget.element = toElement;
@ -22064,7 +22064,7 @@ BI.prepares.push(function () {
var frag = BI.Widget._renderEngine.createFragment();
BI.each(doms, function (i, dom) {
dom instanceof BI.Widget && (dom = dom.element);
dom instanceof $ && dom[0] && frag.appendChild(dom[0]);
dom instanceof BI.$ && dom[0] && frag.appendChild(dom[0]);
});
return frag;
},
@ -32581,7 +32581,9 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
// })();
// Expose jQuery to the global object
window.jQuery = window.$ = jQuery;
BI.jQuery = BI.$ = jQuery;
window.$ = window.$ || jQuery;
window.jQuery = window.jQuery || jQuery;
// Expose jQuery as an AMD module, but only for AMD loaders that
// understand the issues with loading multiple versions of jQuery
@ -32602,13 +32604,13 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
})( window );/*
* 给jQuery.Event对象添加的工具方法
*/
$.extend($.Event.prototype, {
BI.$.extend(BI.$.Event.prototype, {
// event.stopEvent
stopEvent: function () {
this.stopPropagation();
this.preventDefault();
}
});if (jQuery) {
});if (BI.jQuery) {
(function ($) {
// richer:容器在其各个边缘留出的空间
if (!$.fn.insets) {
@ -32664,9 +32666,9 @@ $.extend($.Event.prototype, {
};
}
})(jQuery);
})(BI.jQuery);
BI.extend(jQuery.fn, {
BI.extend(BI.jQuery.fn, {
destroy: function () {
this.remove();
@ -32709,7 +32711,7 @@ $.extend($.Event.prototype, {
if (tidx >= 0) {
// 标红的text未encode
this.append(BI.htmlEncode(textLeft.substr(0, tidx)));
this.append($("<span>").addClass("bi-keyword-red-mark")
this.append(BI.$("<span>").addClass("bi-keyword-red-mark")
.html(BI.htmlEncode(textLeft.substr(tidx, keyword.length))));
textLeft = textLeft.substr(tidx + keyword.length);
@ -32719,7 +32721,7 @@ $.extend($.Event.prototype, {
} else if (pidx != null && pidx >= 0 && Math.floor(pidx / text.length) === Math.floor((pidx + keyword.length - 1) / text.length)) {
// 标红的text未encode
this.append(BI.htmlEncode(textLeft.substr(0, pidx)));
this.append($("<span>").addClass("bi-keyword-red-mark")
this.append(BI.$("<span>").addClass("bi-keyword-red-mark")
.html(BI.htmlEncode(textLeft.substr(pidx, keyword.length))));
if (py != null) {
py = py.substr(pidx + keyword.length);
@ -32736,8 +32738,8 @@ $.extend($.Event.prototype, {
},
getDomHeight: function (parent) {
var clone = $(this).clone();
clone.appendTo($(parent || "body"));
var clone = BI.$(this).clone();
clone.appendTo(BI.$(parent || "body"));
var height = clone.height();
clone.remove();
return height;
@ -32842,17 +32844,17 @@ _.extend(BI, {
$import: function () {
var _LOADED = {}; // alex:保存加载过的
function loadReady (src, must) {
var $scripts = $("head script, body script");
$.each($scripts, function (i, item) {
var $scripts = BI.$("head script, body script");
BI.$.each($scripts, function (i, item) {
if (item.src.indexOf(src) != -1) {
_LOADED[src] = true;
}
});
var $links = $("head link");
$.each($links, function (i, item) {
var $links = BI.$("head link");
BI.$.each($links, function (i, item) {
if (item.href.indexOf(src) != -1 && must) {
_LOADED[src] = false;
$(item).remove();
BI.$(item).remove();
}
});
}
@ -32874,7 +32876,7 @@ _.extend(BI, {
_LOADED[src] = true;
} else {
// alex:这里用同步调用的方式,必须等待ajax完成
$.ajax({
BI.$.ajax({
url: src,
dataType: "script", // alex:指定dataType为script,jquery会帮忙做globalEval的事情
async: false,
@ -38159,7 +38161,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
module.exports = factory;
} else {
// Browser globals
factory(jQuery);
factory(BI.jQuery);
}
}(function ($) {
@ -38584,7 +38586,11 @@ BI.Single = BI.inherit(BI.Widget, {
clearTimeout(self.hideTimeout);
self.hideTimeout = null;
}
self._showToolTip(self._e || e, opt);
// CHART-10611 在拖拽的情况下, 鼠标拖拽着元素离开了拖拽元素的容器,但是子元素在dom结构上仍然属于容器
// 这样会认为鼠标仍然在容器中, 500ms内放开的话,会在容器之外显示鼠标停留处显示容器的title
if (self.element.__isMouseInBounds__(self._e || e)) {
self._showToolTip(self._e || e, opt);
}
}
}, 500);
@ -39048,6 +39054,8 @@ BI.BasicButton = BI.inherit(BI.Single, {
el: {
type: "bi.bubble_combo",
trigger: "",
// bubble的提示不需要一直存在在界面上
destroyWhenHide: true,
ref: function () {
self.combo = this;
},
@ -40013,7 +40021,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
track(treeNode.children);
var treeObj = self.nodes;
var nodes = treeObj.getSelectedNodes();
$.each(nodes, function (index, node) {
BI.$.each(nodes, function (index, node) {
node.halfCheck = false;
});
}
@ -40150,7 +40158,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
n.isParent = n.isParent || n.parent;
// 处理标红
if (BI.isKey(o.paras.keyword)) {
n.text = $("<div>").__textKeywordMarked__(n.text, o.paras.keyword, n.py).html();
n.text = BI.$("<div>").__textKeywordMarked__(n.text, o.paras.keyword, n.py).html();
} else {
n.text = BI.htmlEncode(n.text + "");
}
@ -40194,7 +40202,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
if (self._stop === true) {
return;
}
self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
self.nodes = BI.$.fn.zTree.init(tree.element, setting, nodes);
};
var op = BI.extend({}, o.paras, {
times: 1
@ -40244,7 +40252,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
},
callback: {}
};
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);
this.nodes = BI.$.fn.zTree.init(this.tree.element, setting, nodes);
},
start: function () {
@ -40402,7 +40410,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
};
function onClick (event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj(treeId);
var zTree = BI.$.fn.zTree.getZTreeObj(treeId);
// 当前点击节点的状态是半选,且为true_part, 则将其改为false_part,使得点击半选后切换到的是全选
var checked = treeNode.checked;
var status = treeNode.getCheckStatus();
@ -40428,7 +40436,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
track(treeNode.children);
var treeObj = $.fn.zTree.getZTreeObj(treeId);
var treeObj = BI.$.fn.zTree.getZTreeObj(treeId);
var nodes = treeObj.getSelectedNodes();
BI.each(nodes, function (index, node) {
node.halfCheck = false;
@ -40723,7 +40731,7 @@ BI.PartTree = BI.inherit(BI.AsyncTree, {
if (self._stop === true) {
return;
}
self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
self.nodes = BI.$.fn.zTree.init(tree.element, setting, nodes);
}
BI.delay(function () {
@ -40802,7 +40810,7 @@ BI.ListTreeView = BI.inherit(BI.TreeView, {
};
function onClick (event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj(treeId);
var zTree = BI.$.fn.zTree.getZTreeObj(treeId);
var checked = treeNode.checked;
self._checkValue(treeNode, !checked);
zTree.checkNode(treeNode, !checked, true, true);
@ -40915,7 +40923,7 @@ BI.ListAsyncTree = BI.inherit(BI.ListTreeView, {
}
function onClick (event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj(treeId);
var zTree = BI.$.fn.zTree.getZTreeObj(treeId);
var checked = treeNode.checked;
self._checkValue(treeNode, !checked);
zTree.checkNode(treeNode, !checked, true, true);
@ -41053,7 +41061,7 @@ BI.ListPartTree = BI.inherit(BI.ListAsyncTree, {
if (self._stop === true) {
return;
}
self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
self.nodes = BI.$.fn.zTree.init(tree.element, setting, nodes);
}
BI.delay(function () {
@ -44286,7 +44294,7 @@ BI.Popover = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.Popover.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-popover bi-card",
baseCls: "bi-popover bi-card bi-border-radius",
// width: 600,
// height: 500,
size: "normal", // small, normal, big
@ -44334,6 +44342,7 @@ BI.Popover = BI.inherit(BI.Widget, {
cls: "bi-font-bold",
height: this._constant.HEADER_HEIGHT,
text: o.header,
title: o.header,
textAlign: "left"
},
left: 20,
@ -44878,8 +44887,16 @@ BI.ListView = BI.inherit(BI.Widget, {
o.scrollTop = self.element.scrollTop();
self._calculateBlocksToRender();
});
var lastWidth = this.element.width(),
lastHeight = this.element.height();
BI.ResizeDetector.addResizeListener(this, function () {
self._calculateBlocksToRender();
var width = self.element.width(),
height = self.element.height();
if (width !== lastWidth || height !== lastHeight) {
lastWidth = width;
lastHeight = height;
self._calculateBlocksToRender();
}
});
},
@ -51667,7 +51684,7 @@ BI.shortcut("bi.custom_tree", BI.CustomTree);/*
var zt = $.fn.zTree,
$$ = tools.$,
consts = zt.consts;
})(jQuery);/*
})(BI.jQuery);/*
* JQuery zTree excheck v3.5.18
* http://zTree.me/
*
@ -52296,7 +52313,7 @@ BI.shortcut("bi.custom_tree", BI.CustomTree);/*
}
return html;
}
})(jQuery);/**
})(BI.jQuery);/**
* 可以改变图标的button
*
* Created by GUY on 2016/2/2.
@ -54516,7 +54533,8 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.ColorChooser.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-color-chooser",
value: ""
value: "",
height: 24
});
},
@ -54536,8 +54554,8 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.trigger = _ref;
},
width: o.width,
height: o.height
width: o.width - 2,
height: o.height - 2
}, o.el),
popup: {
el: BI.extend({
@ -54950,7 +54968,7 @@ BI.ColorChooserTrigger = BI.inherit(BI.Trigger, {
var conf = BI.ColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border",
height: 24
height: 22
});
},
@ -55014,7 +55032,7 @@ BI.LongColorChooserTrigger = BI.inherit(BI.Trigger, {
var conf = BI.LongColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border",
height: 24
height: 22
});
},
@ -56319,9 +56337,11 @@ BI.TextBubblePopupBarView = BI.inherit(BI.Widget, {
buttons: [{
level: "ignore",
value: false,
stopPropagation: true,
text: BI.i18nText("BI-Basic_Cancel")
}, {
value: true,
stopPropagation: true,
text: BI.i18nText("BI-Basic_Sure")
}]
};
@ -61450,7 +61470,7 @@ BI.DisplayTree = BI.inherit(BI.TreeView, {
initTree: function (nodes, setting) {
var setting = setting || this._configSetting();
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);
this.nodes = BI.$.fn.zTree.init(this.tree.element, setting, nodes);
},
destroy: function () {
@ -61527,7 +61547,7 @@ BI.ListDisplayTree = BI.inherit(BI.ListTreeView, {
initTree: function (nodes, setting) {
var setting = setting || this._configSetting();
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);
this.nodes = BI.$.fn.zTree.init(this.tree.element, setting, nodes);
},
destroy: function () {
@ -63212,6 +63232,7 @@ BI.shortcut("bi.static_date_pane_card", BI.StaticDatePaneCard);BI.DynamicDatePan
default:
break;
}
self.fireEvent("EVENT_CHANGE");
}
}],
ref: function () {
@ -68810,7 +68831,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.setValue([value]);
self.combo.hideView();
}
}]
@ -69992,7 +70013,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.setValue([value]);
self.combo.hideView();
}
}]
@ -74778,6 +74799,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE);
});
}
}
@ -74851,16 +74873,14 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -74961,8 +74981,6 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}
@ -75118,6 +75136,7 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE);
});
}
}
@ -75194,16 +75213,14 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -75306,8 +75323,6 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}
@ -75441,6 +75456,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
});
}
}
@ -75513,16 +75529,14 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -75653,8 +75667,6 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}
@ -76625,7 +76637,8 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
height: 24,
allowEdit: true
allowEdit: true,
allowInsertValue: true
});
},
@ -76654,7 +76667,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
type: "bi.multi_list_tree_searcher",
itemsCreator: o.itemsCreator,
popup: {
type: "bi.multi_tree_search_insert_pane",
type: o.allowInsertValue ? "bi.multi_tree_search_insert_pane" : "bi.multi_tree_search_pane",
el: {
type: "bi.list_part_tree"
},
@ -87534,7 +87547,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
path.push(split);
childrenCount.push(expanded.length);
// 如果只有一个值且取消的就是这个值
if (i === parents.length - 1 && expanded.length === 1 && expanded[0] === notSelectedValue) {
if (i === parents.length - 1 && expanded.length === 1 && expanded[0].value === notSelectedValue) {
for (var j = childrenCount.length - 1; j >= 0; j--) {
if (childrenCount[j] === 1) {
self._deleteNode(selectedValues, path[j]);
@ -88398,6 +88411,8 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser,
text: o.text,
value: o.value,
watermark: o.watermark,
allowInsertValue: o.allowInsertValue,
allowEdit: o.allowEdit,
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,

74
dist/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

189
dist/fineui.js vendored

@ -12376,11 +12376,11 @@ if (!_global.BI) {
if (BI.isWidget(widget)) {
var o = widget.options;
if (o.element) {
return $(o.element);
return BI.$(o.element);
}
return $(document.createElement(o.tagName));
return BI.$(document.createElement(o.tagName));
}
return $(widget);
return BI.$(widget);
},
createFragment: function () {
return document.createDocumentFragment();
@ -18605,7 +18605,7 @@ BI.ShowAction = BI.inherit(BI.Action, {
try {
// 注意0啊
// var jo = $.parseJSON(text) || {};
var jo = _global.$ ? _global.$.parseJSON(text) : _global.JSON.parse(text);
var jo = BI.$ ? BI.$.parseJSON(text) : _global.JSON.parse(text);
if (jo == null) {
jo = {};
}
@ -19709,7 +19709,7 @@ BI.ResizeController = BI.inherit(BI.Controller, {
_resize: function (ev) {
BI.each(this.resizerManger, function (key, resizer) {
if (resizer instanceof $) {
if (resizer instanceof BI.$) {
if (resizer.is(":visible")) {
resizer.trigger("__resize__");
}
@ -22035,7 +22035,7 @@ BI.prepares.push(function () {
BI.extend(BI.DOM, {
patchProps: function (fromElement, toElement) {
var elemData = jQuery._data(fromElement[0]);
var elemData = BI.jQuery._data(fromElement[0]);
var events = elemData.events;
BI.each(events, function (eventKey, event) {
BI.each(event, function (i, handler) {
@ -22047,7 +22047,7 @@ BI.prepares.push(function () {
throw new Error("不匹配");
}
BI.each(fromChildren, function (i, child) {
BI.DOM.patchProps(jQuery(child), jQuery(toChildren[i]));
BI.DOM.patchProps(BI.jQuery(child), BI.jQuery(toChildren[i]));
});
BI.each(fromElement.data("__widgets"), function (i, widget) {
widget.element = toElement;
@ -22064,7 +22064,7 @@ BI.prepares.push(function () {
var frag = BI.Widget._renderEngine.createFragment();
BI.each(doms, function (i, dom) {
dom instanceof BI.Widget && (dom = dom.element);
dom instanceof $ && dom[0] && frag.appendChild(dom[0]);
dom instanceof BI.$ && dom[0] && frag.appendChild(dom[0]);
});
return frag;
},
@ -32581,7 +32581,9 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
// })();
// Expose jQuery to the global object
window.jQuery = window.$ = jQuery;
BI.jQuery = BI.$ = jQuery;
window.$ = window.$ || jQuery;
window.jQuery = window.jQuery || jQuery;
// Expose jQuery as an AMD module, but only for AMD loaders that
// understand the issues with loading multiple versions of jQuery
@ -32602,13 +32604,13 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
})( window );/*
* 给jQuery.Event对象添加的工具方法
*/
$.extend($.Event.prototype, {
BI.$.extend(BI.$.Event.prototype, {
// event.stopEvent
stopEvent: function () {
this.stopPropagation();
this.preventDefault();
}
});if (jQuery) {
});if (BI.jQuery) {
(function ($) {
// richer:容器在其各个边缘留出的空间
if (!$.fn.insets) {
@ -32664,9 +32666,9 @@ $.extend($.Event.prototype, {
};
}
})(jQuery);
})(BI.jQuery);
BI.extend(jQuery.fn, {
BI.extend(BI.jQuery.fn, {
destroy: function () {
this.remove();
@ -32709,7 +32711,7 @@ $.extend($.Event.prototype, {
if (tidx >= 0) {
// 标红的text未encode
this.append(BI.htmlEncode(textLeft.substr(0, tidx)));
this.append($("<span>").addClass("bi-keyword-red-mark")
this.append(BI.$("<span>").addClass("bi-keyword-red-mark")
.html(BI.htmlEncode(textLeft.substr(tidx, keyword.length))));
textLeft = textLeft.substr(tidx + keyword.length);
@ -32719,7 +32721,7 @@ $.extend($.Event.prototype, {
} else if (pidx != null && pidx >= 0 && Math.floor(pidx / text.length) === Math.floor((pidx + keyword.length - 1) / text.length)) {
// 标红的text未encode
this.append(BI.htmlEncode(textLeft.substr(0, pidx)));
this.append($("<span>").addClass("bi-keyword-red-mark")
this.append(BI.$("<span>").addClass("bi-keyword-red-mark")
.html(BI.htmlEncode(textLeft.substr(pidx, keyword.length))));
if (py != null) {
py = py.substr(pidx + keyword.length);
@ -32736,8 +32738,8 @@ $.extend($.Event.prototype, {
},
getDomHeight: function (parent) {
var clone = $(this).clone();
clone.appendTo($(parent || "body"));
var clone = BI.$(this).clone();
clone.appendTo(BI.$(parent || "body"));
var height = clone.height();
clone.remove();
return height;
@ -32842,17 +32844,17 @@ _.extend(BI, {
$import: function () {
var _LOADED = {}; // alex:保存加载过的
function loadReady (src, must) {
var $scripts = $("head script, body script");
$.each($scripts, function (i, item) {
var $scripts = BI.$("head script, body script");
BI.$.each($scripts, function (i, item) {
if (item.src.indexOf(src) != -1) {
_LOADED[src] = true;
}
});
var $links = $("head link");
$.each($links, function (i, item) {
var $links = BI.$("head link");
BI.$.each($links, function (i, item) {
if (item.href.indexOf(src) != -1 && must) {
_LOADED[src] = false;
$(item).remove();
BI.$(item).remove();
}
});
}
@ -32874,7 +32876,7 @@ _.extend(BI, {
_LOADED[src] = true;
} else {
// alex:这里用同步调用的方式,必须等待ajax完成
$.ajax({
BI.$.ajax({
url: src,
dataType: "script", // alex:指定dataType为script,jquery会帮忙做globalEval的事情
async: false,
@ -38563,7 +38565,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
module.exports = factory;
} else {
// Browser globals
factory(jQuery);
factory(BI.jQuery);
}
}(function ($) {
@ -38988,7 +38990,11 @@ BI.Single = BI.inherit(BI.Widget, {
clearTimeout(self.hideTimeout);
self.hideTimeout = null;
}
self._showToolTip(self._e || e, opt);
// CHART-10611 在拖拽的情况下, 鼠标拖拽着元素离开了拖拽元素的容器,但是子元素在dom结构上仍然属于容器
// 这样会认为鼠标仍然在容器中, 500ms内放开的话,会在容器之外显示鼠标停留处显示容器的title
if (self.element.__isMouseInBounds__(self._e || e)) {
self._showToolTip(self._e || e, opt);
}
}
}, 500);
@ -39452,6 +39458,8 @@ BI.BasicButton = BI.inherit(BI.Single, {
el: {
type: "bi.bubble_combo",
trigger: "",
// bubble的提示不需要一直存在在界面上
destroyWhenHide: true,
ref: function () {
self.combo = this;
},
@ -40417,7 +40425,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
track(treeNode.children);
var treeObj = self.nodes;
var nodes = treeObj.getSelectedNodes();
$.each(nodes, function (index, node) {
BI.$.each(nodes, function (index, node) {
node.halfCheck = false;
});
}
@ -40554,7 +40562,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
n.isParent = n.isParent || n.parent;
// 处理标红
if (BI.isKey(o.paras.keyword)) {
n.text = $("<div>").__textKeywordMarked__(n.text, o.paras.keyword, n.py).html();
n.text = BI.$("<div>").__textKeywordMarked__(n.text, o.paras.keyword, n.py).html();
} else {
n.text = BI.htmlEncode(n.text + "");
}
@ -40598,7 +40606,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
if (self._stop === true) {
return;
}
self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
self.nodes = BI.$.fn.zTree.init(tree.element, setting, nodes);
};
var op = BI.extend({}, o.paras, {
times: 1
@ -40648,7 +40656,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
},
callback: {}
};
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);
this.nodes = BI.$.fn.zTree.init(this.tree.element, setting, nodes);
},
start: function () {
@ -40806,7 +40814,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
};
function onClick (event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj(treeId);
var zTree = BI.$.fn.zTree.getZTreeObj(treeId);
// 当前点击节点的状态是半选,且为true_part, 则将其改为false_part,使得点击半选后切换到的是全选
var checked = treeNode.checked;
var status = treeNode.getCheckStatus();
@ -40832,7 +40840,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
track(treeNode.children);
var treeObj = $.fn.zTree.getZTreeObj(treeId);
var treeObj = BI.$.fn.zTree.getZTreeObj(treeId);
var nodes = treeObj.getSelectedNodes();
BI.each(nodes, function (index, node) {
node.halfCheck = false;
@ -41127,7 +41135,7 @@ BI.PartTree = BI.inherit(BI.AsyncTree, {
if (self._stop === true) {
return;
}
self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
self.nodes = BI.$.fn.zTree.init(tree.element, setting, nodes);
}
BI.delay(function () {
@ -41206,7 +41214,7 @@ BI.ListTreeView = BI.inherit(BI.TreeView, {
};
function onClick (event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj(treeId);
var zTree = BI.$.fn.zTree.getZTreeObj(treeId);
var checked = treeNode.checked;
self._checkValue(treeNode, !checked);
zTree.checkNode(treeNode, !checked, true, true);
@ -41319,7 +41327,7 @@ BI.ListAsyncTree = BI.inherit(BI.ListTreeView, {
}
function onClick (event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj(treeId);
var zTree = BI.$.fn.zTree.getZTreeObj(treeId);
var checked = treeNode.checked;
self._checkValue(treeNode, !checked);
zTree.checkNode(treeNode, !checked, true, true);
@ -41457,7 +41465,7 @@ BI.ListPartTree = BI.inherit(BI.ListAsyncTree, {
if (self._stop === true) {
return;
}
self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
self.nodes = BI.$.fn.zTree.init(tree.element, setting, nodes);
}
BI.delay(function () {
@ -44690,7 +44698,7 @@ BI.Popover = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.Popover.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-popover bi-card",
baseCls: "bi-popover bi-card bi-border-radius",
// width: 600,
// height: 500,
size: "normal", // small, normal, big
@ -44738,6 +44746,7 @@ BI.Popover = BI.inherit(BI.Widget, {
cls: "bi-font-bold",
height: this._constant.HEADER_HEIGHT,
text: o.header,
title: o.header,
textAlign: "left"
},
left: 20,
@ -45282,8 +45291,16 @@ BI.ListView = BI.inherit(BI.Widget, {
o.scrollTop = self.element.scrollTop();
self._calculateBlocksToRender();
});
var lastWidth = this.element.width(),
lastHeight = this.element.height();
BI.ResizeDetector.addResizeListener(this, function () {
self._calculateBlocksToRender();
var width = self.element.width(),
height = self.element.height();
if (width !== lastWidth || height !== lastHeight) {
lastWidth = width;
lastHeight = height;
self._calculateBlocksToRender();
}
});
},
@ -52071,7 +52088,7 @@ BI.shortcut("bi.custom_tree", BI.CustomTree);/*
var zt = $.fn.zTree,
$$ = tools.$,
consts = zt.consts;
})(jQuery);/*
})(BI.jQuery);/*
* JQuery zTree excheck v3.5.18
* http://zTree.me/
*
@ -52700,7 +52717,7 @@ BI.shortcut("bi.custom_tree", BI.CustomTree);/*
}
return html;
}
})(jQuery);/**
})(BI.jQuery);/**
* 可以改变图标的button
*
* Created by GUY on 2016/2/2.
@ -54920,7 +54937,8 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.ColorChooser.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-color-chooser",
value: ""
value: "",
height: 24
});
},
@ -54940,8 +54958,8 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.trigger = _ref;
},
width: o.width,
height: o.height
width: o.width - 2,
height: o.height - 2
}, o.el),
popup: {
el: BI.extend({
@ -55354,7 +55372,7 @@ BI.ColorChooserTrigger = BI.inherit(BI.Trigger, {
var conf = BI.ColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border",
height: 24
height: 22
});
},
@ -55418,7 +55436,7 @@ BI.LongColorChooserTrigger = BI.inherit(BI.Trigger, {
var conf = BI.LongColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border",
height: 24
height: 22
});
},
@ -56723,9 +56741,11 @@ BI.TextBubblePopupBarView = BI.inherit(BI.Widget, {
buttons: [{
level: "ignore",
value: false,
stopPropagation: true,
text: BI.i18nText("BI-Basic_Cancel")
}, {
value: true,
stopPropagation: true,
text: BI.i18nText("BI-Basic_Sure")
}]
};
@ -61854,7 +61874,7 @@ BI.DisplayTree = BI.inherit(BI.TreeView, {
initTree: function (nodes, setting) {
var setting = setting || this._configSetting();
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);
this.nodes = BI.$.fn.zTree.init(this.tree.element, setting, nodes);
},
destroy: function () {
@ -61931,7 +61951,7 @@ BI.ListDisplayTree = BI.inherit(BI.ListTreeView, {
initTree: function (nodes, setting) {
var setting = setting || this._configSetting();
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);
this.nodes = BI.$.fn.zTree.init(this.tree.element, setting, nodes);
},
destroy: function () {
@ -63616,6 +63636,7 @@ BI.shortcut("bi.static_date_pane_card", BI.StaticDatePaneCard);BI.DynamicDatePan
default:
break;
}
self.fireEvent("EVENT_CHANGE");
}
}],
ref: function () {
@ -69214,7 +69235,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.setValue([value]);
self.combo.hideView();
}
}]
@ -70396,7 +70417,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.setValue([value]);
self.combo.hideView();
}
}]
@ -75182,6 +75203,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE);
});
}
}
@ -75255,16 +75277,14 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -75365,8 +75385,6 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}
@ -75522,6 +75540,7 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE);
});
}
}
@ -75598,16 +75617,14 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -75710,8 +75727,6 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}
@ -75845,6 +75860,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
});
}
}
@ -75917,16 +75933,14 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -76057,8 +76071,6 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}
@ -77029,7 +77041,8 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
height: 24,
allowEdit: true
allowEdit: true,
allowInsertValue: true
});
},
@ -77058,7 +77071,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
type: "bi.multi_list_tree_searcher",
itemsCreator: o.itemsCreator,
popup: {
type: "bi.multi_tree_search_insert_pane",
type: o.allowInsertValue ? "bi.multi_tree_search_insert_pane" : "bi.multi_tree_search_pane",
el: {
type: "bi.list_part_tree"
},
@ -87938,7 +87951,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
path.push(split);
childrenCount.push(expanded.length);
// 如果只有一个值且取消的就是这个值
if (i === parents.length - 1 && expanded.length === 1 && expanded[0] === notSelectedValue) {
if (i === parents.length - 1 && expanded.length === 1 && expanded[0].value === notSelectedValue) {
for (var j = childrenCount.length - 1; j >= 0; j--) {
if (childrenCount[j] === 1) {
self._deleteNode(selectedValues, path[j]);
@ -88802,6 +88815,8 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser,
text: o.text,
value: o.value,
watermark: o.watermark,
allowInsertValue: o.allowInsertValue,
allowEdit: o.allowEdit,
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,

2
dist/fineui.min.css vendored

File diff suppressed because one or more lines are too long

74
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

110
dist/fineui_without_jquery_polyfill.js vendored

@ -12131,11 +12131,11 @@ if (!_global.BI) {
if (BI.isWidget(widget)) {
var o = widget.options;
if (o.element) {
return $(o.element);
return BI.$(o.element);
}
return $(document.createElement(o.tagName));
return BI.$(document.createElement(o.tagName));
}
return $(widget);
return BI.$(widget);
},
createFragment: function () {
return document.createDocumentFragment();
@ -18106,7 +18106,7 @@ BI.ShowAction = BI.inherit(BI.Action, {
try {
// 注意0啊
// var jo = $.parseJSON(text) || {};
var jo = _global.$ ? _global.$.parseJSON(text) : _global.JSON.parse(text);
var jo = BI.$ ? BI.$.parseJSON(text) : _global.JSON.parse(text);
if (jo == null) {
jo = {};
}
@ -19210,7 +19210,7 @@ BI.ResizeController = BI.inherit(BI.Controller, {
_resize: function (ev) {
BI.each(this.resizerManger, function (key, resizer) {
if (resizer instanceof $) {
if (resizer instanceof BI.$) {
if (resizer.is(":visible")) {
resizer.trigger("__resize__");
}
@ -27360,7 +27360,11 @@ BI.Single = BI.inherit(BI.Widget, {
clearTimeout(self.hideTimeout);
self.hideTimeout = null;
}
self._showToolTip(self._e || e, opt);
// CHART-10611 在拖拽的情况下, 鼠标拖拽着元素离开了拖拽元素的容器,但是子元素在dom结构上仍然属于容器
// 这样会认为鼠标仍然在容器中, 500ms内放开的话,会在容器之外显示鼠标停留处显示容器的title
if (self.element.__isMouseInBounds__(self._e || e)) {
self._showToolTip(self._e || e, opt);
}
}
}, 500);
@ -27824,6 +27828,8 @@ BI.BasicButton = BI.inherit(BI.Single, {
el: {
type: "bi.bubble_combo",
trigger: "",
// bubble的提示不需要一直存在在界面上
destroyWhenHide: true,
ref: function () {
self.combo = this;
},
@ -31804,7 +31810,7 @@ BI.Popover = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.Popover.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-popover bi-card",
baseCls: "bi-popover bi-card bi-border-radius",
// width: 600,
// height: 500,
size: "normal", // small, normal, big
@ -31852,6 +31858,7 @@ BI.Popover = BI.inherit(BI.Widget, {
cls: "bi-font-bold",
height: this._constant.HEADER_HEIGHT,
text: o.header,
title: o.header,
textAlign: "left"
},
left: 20,
@ -32396,8 +32403,16 @@ BI.ListView = BI.inherit(BI.Widget, {
o.scrollTop = self.element.scrollTop();
self._calculateBlocksToRender();
});
var lastWidth = this.element.width(),
lastHeight = this.element.height();
BI.ResizeDetector.addResizeListener(this, function () {
self._calculateBlocksToRender();
var width = self.element.width(),
height = self.element.height();
if (width !== lastWidth || height !== lastHeight) {
lastWidth = width;
lastHeight = height;
self._calculateBlocksToRender();
}
});
},
@ -39298,9 +39313,11 @@ BI.TextBubblePopupBarView = BI.inherit(BI.Widget, {
buttons: [{
level: "ignore",
value: false,
stopPropagation: true,
text: BI.i18nText("BI-Basic_Cancel")
}, {
value: true,
stopPropagation: true,
text: BI.i18nText("BI-Basic_Sure")
}]
};
@ -45915,6 +45932,7 @@ BI.shortcut("bi.static_date_pane_card", BI.StaticDatePaneCard);BI.DynamicDatePan
default:
break;
}
self.fireEvent("EVENT_CHANGE");
}
}],
ref: function () {
@ -51513,7 +51531,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.setValue([value]);
self.combo.hideView();
}
}]
@ -52695,7 +52713,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.setValue([value]);
self.combo.hideView();
}
}]
@ -57481,6 +57499,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE);
});
}
}
@ -57554,16 +57573,14 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -57664,8 +57681,6 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}
@ -57821,6 +57836,7 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE);
});
}
}
@ -57897,16 +57913,14 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -58009,8 +58023,6 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}
@ -58144,6 +58156,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
});
}
}
@ -58216,16 +58229,14 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -58356,8 +58367,6 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}
@ -59328,7 +59337,8 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
height: 24,
allowEdit: true
allowEdit: true,
allowInsertValue: true
});
},
@ -59357,7 +59367,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
type: "bi.multi_list_tree_searcher",
itemsCreator: o.itemsCreator,
popup: {
type: "bi.multi_tree_search_insert_pane",
type: o.allowInsertValue ? "bi.multi_tree_search_insert_pane" : "bi.multi_tree_search_pane",
el: {
type: "bi.list_part_tree"
},
@ -70237,7 +70247,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
path.push(split);
childrenCount.push(expanded.length);
// 如果只有一个值且取消的就是这个值
if (i === parents.length - 1 && expanded.length === 1 && expanded[0] === notSelectedValue) {
if (i === parents.length - 1 && expanded.length === 1 && expanded[0].value === notSelectedValue) {
for (var j = childrenCount.length - 1; j >= 0; j--) {
if (childrenCount[j] === 1) {
self._deleteNode(selectedValues, path[j]);
@ -71101,6 +71111,8 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser,
text: o.text,
value: o.value,
watermark: o.watermark,
allowInsertValue: o.allowInsertValue,
allowEdit: o.allowEdit,
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,

2
dist/utils.js vendored

@ -12987,7 +12987,7 @@ if (!_global.BI) {
try {
// 注意0啊
// var jo = $.parseJSON(text) || {};
var jo = _global.$ ? _global.$.parseJSON(text) : _global.JSON.parse(text);
var jo = BI.$ ? BI.$.parseJSON(text) : _global.JSON.parse(text);
if (jo == null) {
jo = {};
}

4
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

77
dist/widget.js vendored

@ -996,6 +996,7 @@ BI.shortcut("bi.static_date_pane_card", BI.StaticDatePaneCard);BI.DynamicDatePan
default:
break;
}
self.fireEvent("EVENT_CHANGE");
}
}],
ref: function () {
@ -6594,7 +6595,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.setValue([value]);
self.combo.hideView();
}
}]
@ -7776,7 +7777,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.setValue([value]);
self.combo.hideView();
}
}]
@ -12562,6 +12563,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE);
});
}
}
@ -12635,16 +12637,14 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -12745,8 +12745,6 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}
@ -12902,6 +12900,7 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE);
});
}
}
@ -12978,16 +12977,14 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -13090,8 +13087,6 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}
@ -13225,6 +13220,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
});
}
}
@ -13297,16 +13293,14 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -13437,8 +13431,6 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}
@ -14409,7 +14401,8 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
height: 24,
allowEdit: true
allowEdit: true,
allowInsertValue: true
});
},
@ -14438,7 +14431,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
type: "bi.multi_list_tree_searcher",
itemsCreator: o.itemsCreator,
popup: {
type: "bi.multi_tree_search_insert_pane",
type: o.allowInsertValue ? "bi.multi_tree_search_insert_pane" : "bi.multi_tree_search_pane",
el: {
type: "bi.list_part_tree"
},
@ -25318,7 +25311,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
path.push(split);
childrenCount.push(expanded.length);
// 如果只有一个值且取消的就是这个值
if (i === parents.length - 1 && expanded.length === 1 && expanded[0] === notSelectedValue) {
if (i === parents.length - 1 && expanded.length === 1 && expanded[0].value === notSelectedValue) {
for (var j = childrenCount.length - 1; j >= 0; j--) {
if (childrenCount[j] === 1) {
self._deleteNode(selectedValues, path[j]);
@ -26182,6 +26175,8 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser,
text: o.text,
value: o.value,
watermark: o.watermark,
allowInsertValue: o.allowInsertValue,
allowEdit: o.allowEdit,
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,

3
src/base/layer/layer.popover.js

@ -15,7 +15,7 @@ BI.Popover = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.Popover.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-popover bi-card",
baseCls: "bi-popover bi-card bi-border-radius",
// width: 600,
// height: 500,
size: "normal", // small, normal, big
@ -63,6 +63,7 @@ BI.Popover = BI.inherit(BI.Widget, {
cls: "bi-font-bold",
height: this._constant.HEADER_HEIGHT,
text: o.header,
title: o.header,
textAlign: "left"
},
left: 20,

10
src/base/list/listview.js

@ -45,8 +45,16 @@ BI.ListView = BI.inherit(BI.Widget, {
o.scrollTop = self.element.scrollTop();
self._calculateBlocksToRender();
});
var lastWidth = this.element.width(),
lastHeight = this.element.height();
BI.ResizeDetector.addResizeListener(this, function () {
self._calculateBlocksToRender();
var width = self.element.width(),
height = self.element.height();
if (width !== lastWidth || height !== lastHeight) {
lastWidth = width;
lastHeight = height;
self._calculateBlocksToRender();
}
});
},

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

@ -229,6 +229,8 @@ BI.BasicButton = BI.inherit(BI.Single, {
el: {
type: "bi.bubble_combo",
trigger: "",
// bubble的提示不需要一直存在在界面上
destroyWhenHide: true,
ref: function () {
self.combo = this;
},

6
src/base/single/single.js

@ -111,7 +111,11 @@ BI.Single = BI.inherit(BI.Widget, {
clearTimeout(self.hideTimeout);
self.hideTimeout = null;
}
self._showToolTip(self._e || e, opt);
// CHART-10611 在拖拽的情况下, 鼠标拖拽着元素离开了拖拽元素的容器,但是子元素在dom结构上仍然属于容器
// 这样会认为鼠标仍然在容器中, 500ms内放开的话,会在容器之外显示鼠标停留处显示容器的title
if (self.element.__isMouseInBounds__(self._e || e)) {
self._showToolTip(self._e || e, opt);
}
}
}, 500);

4
src/base/tree/ztree/asynctree.js

@ -50,7 +50,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
};
function onClick (event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj(treeId);
var zTree = BI.$.fn.zTree.getZTreeObj(treeId);
// 当前点击节点的状态是半选,且为true_part, 则将其改为false_part,使得点击半选后切换到的是全选
var checked = treeNode.checked;
var status = treeNode.getCheckStatus();
@ -76,7 +76,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
track(treeNode.children);
var treeObj = $.fn.zTree.getZTreeObj(treeId);
var treeObj = BI.$.fn.zTree.getZTreeObj(treeId);
var nodes = treeObj.getSelectedNodes();
BI.each(nodes, function (index, node) {
node.halfCheck = false;

2
src/base/tree/ztree/jquery.ztree.core-3.5.js

@ -1712,4 +1712,4 @@
var zt = $.fn.zTree,
$$ = tools.$,
consts = zt.consts;
})(jQuery);
})(BI.jQuery);

2
src/base/tree/ztree/jquery.ztree.excheck-3.5.js

@ -627,4 +627,4 @@
}
return html;
}
})(jQuery);
})(BI.jQuery);

2
src/base/tree/ztree/list/listasynctree.js

@ -54,7 +54,7 @@ BI.ListAsyncTree = BI.inherit(BI.ListTreeView, {
}
function onClick (event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj(treeId);
var zTree = BI.$.fn.zTree.getZTreeObj(treeId);
var checked = treeNode.checked;
self._checkValue(treeNode, !checked);
zTree.checkNode(treeNode, !checked, true, true);

2
src/base/tree/ztree/list/listparttree.js

@ -70,7 +70,7 @@ BI.ListPartTree = BI.inherit(BI.ListAsyncTree, {
if (self._stop === true) {
return;
}
self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
self.nodes = BI.$.fn.zTree.init(tree.element, setting, nodes);
}
BI.delay(function () {

2
src/base/tree/ztree/list/listtreeview.js

@ -54,7 +54,7 @@ BI.ListTreeView = BI.inherit(BI.TreeView, {
};
function onClick (event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj(treeId);
var zTree = BI.$.fn.zTree.getZTreeObj(treeId);
var checked = treeNode.checked;
self._checkValue(treeNode, !checked);
zTree.checkNode(treeNode, !checked, true, true);

2
src/base/tree/ztree/parttree.js

@ -143,7 +143,7 @@ BI.PartTree = BI.inherit(BI.AsyncTree, {
if (self._stop === true) {
return;
}
self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
self.nodes = BI.$.fn.zTree.init(tree.element, setting, nodes);
}
BI.delay(function () {

8
src/base/tree/ztree/treeview.js

@ -197,7 +197,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
track(treeNode.children);
var treeObj = self.nodes;
var nodes = treeObj.getSelectedNodes();
$.each(nodes, function (index, node) {
BI.$.each(nodes, function (index, node) {
node.halfCheck = false;
});
}
@ -334,7 +334,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
n.isParent = n.isParent || n.parent;
// 处理标红
if (BI.isKey(o.paras.keyword)) {
n.text = $("<div>").__textKeywordMarked__(n.text, o.paras.keyword, n.py).html();
n.text = BI.$("<div>").__textKeywordMarked__(n.text, o.paras.keyword, n.py).html();
} else {
n.text = BI.htmlEncode(n.text + "");
}
@ -378,7 +378,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
if (self._stop === true) {
return;
}
self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
self.nodes = BI.$.fn.zTree.init(tree.element, setting, nodes);
};
var op = BI.extend({}, o.paras, {
times: 1
@ -428,7 +428,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
},
callback: {}
};
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);
this.nodes = BI.$.fn.zTree.init(this.tree.element, setting, nodes);
},
start: function () {

7
src/case/colorchooser/colorchooser.js

@ -10,7 +10,8 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.ColorChooser.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-color-chooser",
value: ""
value: "",
height: 24
});
},
@ -30,8 +31,8 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.trigger = _ref;
},
width: o.width,
height: o.height
width: o.width - 2,
height: o.height - 2
}, o.el),
popup: {
el: BI.extend({

2
src/case/colorchooser/colorchooser.trigger.js

@ -11,7 +11,7 @@ BI.ColorChooserTrigger = BI.inherit(BI.Trigger, {
var conf = BI.ColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border",
height: 24
height: 22
});
},

2
src/case/colorchooser/colorchooser.trigger.long.js

@ -11,7 +11,7 @@ BI.LongColorChooserTrigger = BI.inherit(BI.Trigger, {
var conf = BI.LongColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border",
height: 24
height: 22
});
},

2
src/case/combo/bubblecombo/popup.bubble.js

@ -110,9 +110,11 @@ BI.TextBubblePopupBarView = BI.inherit(BI.Widget, {
buttons: [{
level: "ignore",
value: false,
stopPropagation: true,
text: BI.i18nText("BI-Basic_Cancel")
}, {
value: true,
stopPropagation: true,
text: BI.i18nText("BI-Basic_Sure")
}]
};

2
src/case/tree/ztree/tree.display.js

@ -61,7 +61,7 @@ BI.DisplayTree = BI.inherit(BI.TreeView, {
initTree: function (nodes, setting) {
var setting = setting || this._configSetting();
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);
this.nodes = BI.$.fn.zTree.init(this.tree.element, setting, nodes);
},
destroy: function () {

2
src/case/tree/ztree/tree.list.display.js

@ -66,7 +66,7 @@ BI.ListDisplayTree = BI.inherit(BI.ListTreeView, {
initTree: function (nodes, setting) {
var setting = setting || this._configSetting();
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);
this.nodes = BI.$.fn.zTree.init(this.tree.element, setting, nodes);
},
destroy: function () {

2
src/component/treevaluechooser/abstract.treevaluechooser.js

@ -220,7 +220,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
path.push(split);
childrenCount.push(expanded.length);
// 如果只有一个值且取消的就是这个值
if (i === parents.length - 1 && expanded.length === 1 && expanded[0] === notSelectedValue) {
if (i === parents.length - 1 && expanded.length === 1 && expanded[0].value === notSelectedValue) {
for (var j = childrenCount.length - 1; j >= 0; j--) {
if (childrenCount[j] === 1) {
self._deleteNode(selectedValues, path[j]);

2
src/component/treevaluechooser/combo.listtreevaluechooser.js

@ -29,6 +29,8 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser,
text: o.text,
value: o.value,
watermark: o.watermark,
allowInsertValue: o.allowInsertValue,
allowEdit: o.allowEdit,
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,

193
src/component/valuechooser/__test__/combo.valuechooser.insert.test.js

@ -0,0 +1,193 @@
/**
* @author windy
* @version 2.0
* Created by windy on 2019/9/23
*/
describe("value_chooser_insert_combo", function () {
var items = BI.map(BI.makeArray(1000, null), function(idx, v) {
return {
text: idx,
value: idx,
title: idx
};
});
var itemSelectorGetter = function (array) {
return BI.map(array, function (idx, num) {
return ".bi-multi-select-popup-view .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")";
});
};
var searchItemSelectorGetter = function (array) {
return BI.map(array, function (idx, num) {
return ".bi-multi-select-search-pane .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")";
});
};
/**
* test_author_windy
**/
it("setValue", function () {
var widget = BI.Test.createWidget({
type: "bi.value_chooser_insert_combo",
width: 220,
itemsCreator: function (op, callback) {
callback(items);
}
});
widget.setValue({
type: 1,
value: [1, 2]
});
expect(widget.getValue()).to.deep.equal({
type: 1,
value: [1, 2]
});
widget.destroy();
});
/**
* test_author_windy
**/
it("getValue", function () {
var widget = BI.Test.createWidget({
type: "bi.value_chooser_insert_combo",
width: 220,
itemsCreator: function (op, callback) {
callback(items);
},
value: {
type: 2,
value: [1, 2, 3]
}
});
expect(widget.getValue()).to.deep.equal({
type: 2,
value: [1, 2, 3]
});
widget.destroy();
});
/**
* test_author_windy
**/
it("点选选值", function (done) {
var widget = BI.Test.createWidget({
type: "bi.value_chooser_insert_combo",
width: 220,
itemsCreator: function (op, callback) {
callback(items);
}
});
widget.element.find(".bi-multi-select-trigger").click();
// 为什么要delay 300呢,因为按钮有debounce
BI.delay(function () {
// 点选1、2、3
BI.each(itemSelectorGetter([1,2,3]), function (idx, selector) {
widget.element.find(selector).click();
});
// 点全选
widget.element.find(".bi-multi-select-popup-view .bi-label:contains(全选)").click();
// 取消勾选1、2、3
BI.delay(function () {
BI.each(itemSelectorGetter([1,2,3]), function (idx, selector) {
widget.element.find(selector).click();
});
expect(widget.getValue()).to.deep.equal({
type: 2,
value: [0, 1, 2]
});
widget.destroy();
done();
}, 300);
}, 300);
});
/**
* test_author_windy
**/
it("搜索选值", function (done) {
var widget = BI.Test.createWidget({
type: "bi.value_chooser_insert_combo",
width: 220,
itemsCreator: function (op, callback) {
callback(items);
}
});
BI.nextTick(function () {
widget.element.find(".bi-multi-select-trigger .tip-text-style").click();
// 这边为啥要加呢,因为input的setValue中有nextTick
BI.nextTick(function () {
BI.Test.triggerKeyDown(widget.element.find(".bi-multi-select-trigger .bi-input"), "2", 50, function () {
BI.nextTick(function () {
BI.each(searchItemSelectorGetter([1,2]), function (idx, selector) {
widget.element.find(selector).click();
});
expect(widget.getValue()).to.deep.equal({
type: 1,
value: [2, 12]
});
widget.destroy();
done();
});
});
});
});
});
/**
* test_author_windy
**/
it("新增值", function (done) {
var widget = BI.Test.createWidget({
type: "bi.value_chooser_insert_combo",
width: 220,
itemsCreator: function (op, callback) {
callback(items);
}
});
BI.nextTick(function () {
widget.element.find(".bi-multi-select-trigger .tip-text-style").click();
// 这边为啥要加呢,因为input的setValue中有nextTick
BI.nextTick(function () {
BI.Test.triggerKeyDown(widget.element.find(".bi-multi-select-trigger .bi-input"), "z", 50, function () {
BI.nextTick(function () {
widget.element.find(".bi-text-button:contains(+点击新增\"z\")").click();
expect(widget.getValue()).to.deep.equal({
type: 1,
value: ["z"]
});
widget.destroy();
done();
});
});
});
});
});
/**
* test_author_windy
**/
it("查看已选", function (done) {
var widget = BI.Test.createWidget({
type: "bi.value_chooser_insert_combo",
width: 220,
itemsCreator: function (op, callback) {
callback(items);
},
value: {
type: 1,
value: [1, 2]
}
});
BI.nextTick(function () {
widget.element.find(".bi-multi-select-check-selected-button").click();
BI.delay(function () {
expect(widget.element.find(".display-list-item").length).to.equal(2);
widget.destroy();
done();
}, 300);
});
});
});

163
src/component/valuechooser/__test__/combo.valuechooser.test.js

@ -0,0 +1,163 @@
/**
* @author windy
* @version 2.0
* Created by windy on 2019/9/23
*/
describe("value_chooser_combo", function () {
var items = BI.map(BI.makeArray(1000, null), function(idx, v) {
return {
text: idx,
value: idx,
title: idx
};
});
var itemSelectorGetter = function (array) {
return BI.map(array, function (idx, num) {
return ".bi-multi-select-popup-view .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")";
});
};
var searchItemSelectorGetter = function (array) {
return BI.map(array, function (idx, num) {
return ".bi-multi-select-search-pane .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")";
});
};
/**
* test_author_windy
**/
it("setValue", function () {
var widget = BI.Test.createWidget({
type: "bi.value_chooser_combo",
width: 220,
itemsCreator: function (op, callback) {
callback(items);
}
});
widget.setValue({
type: 1,
value: [1, 2]
});
expect(widget.getValue()).to.deep.equal({
type: 1,
value: [1, 2]
});
widget.destroy();
});
/**
* test_author_windy
**/
it("getValue", function () {
var widget = BI.Test.createWidget({
type: "bi.value_chooser_combo",
width: 220,
itemsCreator: function (op, callback) {
callback(items);
},
value: {
type: 2,
value: [1, 2, 3]
}
});
expect(widget.getValue()).to.deep.equal({
type: 2,
value: [1, 2, 3]
});
widget.destroy();
});
/**
* test_author_windy
**/
it("点选选值", function (done) {
var widget = BI.Test.createWidget({
type: "bi.value_chooser_combo",
width: 220,
itemsCreator: function (op, callback) {
callback(items);
}
});
widget.element.find(".bi-multi-select-trigger").click();
// 为什么要delay 300呢,因为按钮有debounce
BI.delay(function () {
// 点选1、2、3
BI.each(itemSelectorGetter([1,2,3]), function (idx, selector) {
widget.element.find(selector).click();
});
// 点全选
widget.element.find(".bi-multi-select-popup-view .bi-label:contains(全选)").click();
// 取消勾选1、2、3
BI.delay(function () {
BI.each(itemSelectorGetter([1,2,3]), function (idx, selector) {
widget.element.find(selector).click();
});
expect(widget.getValue()).to.deep.equal({
type: 2,
value: [0, 1, 2]
});
widget.destroy();
done();
}, 300);
}, 300);
});
/**
* test_author_windy
**/
it("搜索选值", function (done) {
var widget = BI.Test.createWidget({
type: "bi.value_chooser_combo",
width: 220,
itemsCreator: function (op, callback) {
callback(items);
}
});
BI.nextTick(function () {
widget.element.find(".bi-multi-select-trigger .tip-text-style").click();
// 这边为啥要加呢,因为input的setValue中有nextTick
BI.nextTick(function () {
BI.Test.triggerKeyDown(widget.element.find(".bi-multi-select-trigger .bi-input"), "2", 50, function () {
BI.nextTick(function () {
BI.each(searchItemSelectorGetter([1,2]), function (idx, selector) {
widget.element.find(selector).click();
});
expect(widget.getValue()).to.deep.equal({
type: 1,
value: [2, 12]
});
widget.destroy();
done();
});
});
});
});
});
/**
* test_author_windy
**/
it("查看已选", function (done) {
var widget = BI.Test.createWidget({
type: "bi.value_chooser_combo",
width: 220,
itemsCreator: function (op, callback) {
callback(items);
},
value: {
type: 1,
value: [1, 2]
}
});
BI.nextTick(function () {
widget.element.find(".bi-multi-select-check-selected-button").click();
BI.delay(function () {
expect(widget.element.find(".display-list-item").length).to.equal(2);
widget.destroy();
done();
}, 300);
});
});
});

111
src/component/valuechooser/__test__/pane.valuechooser.test.js

@ -0,0 +1,111 @@
/**
* @author windy
* @version 2.0
* Created by windy on 2019/9/23
*/
describe("value_chooser_pane", function () {
var items = BI.map(BI.makeArray(1000, null), function(idx, v) {
return {
text: idx,
value: idx,
title: idx
};
});
var itemSelectorGetter = function (array) {
return BI.map(array, function (idx, num) {
return ".popup-multi-select-list .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")";
});
};
var searchItemSelectorGetter = function (array) {
return BI.map(array, function (idx, num) {
return ".bi-multi-select-search-pane .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")";
});
};
/**
* test_author_windy
**/
it("setValue", function () {
var widget = BI.Test.createWidget({
type: "bi.value_chooser_pane",
width: 220,
itemsCreator: function (op, callback) {
callback(items);
}
});
widget.setValue({
type: 1,
value: [1, 2]
});
expect(widget.getValue()).to.deep.equal({
type: 1,
value: [1, 2]
});
widget.destroy();
});
/**
* test_author_windy
**/
it("点选选值", function (done) {
var widget = BI.Test.createWidget({
type: "bi.value_chooser_pane",
width: 220,
items: items
});
BI.nextTick(function () {
// 点选1、2、3
BI.each(itemSelectorGetter([1,2,3]), function (idx, selector) {
widget.element.find(selector).click();
});
// 点全选
widget.element.find(".popup-multi-select-list .bi-label:contains(全选)").click();
// 取消勾选1、2、3
BI.delay(function () {
BI.each(itemSelectorGetter([1,2,3]), function (idx, selector) {
widget.element.find(selector).click();
});
expect(widget.getValue()).to.deep.equal({
type: 2,
value: [0, 1, 2]
});
widget.destroy();
done();
}, 300);
});
});
/**
* test_author_windy
**/
it("搜索选值", function (done) {
var widget = BI.Test.createWidget({
type: "bi.value_chooser_pane",
width: 220,
itemsCreator: function (op, callback) {
callback(items);
}
});
widget.element.find(".bi-water-mark").click();
// 这边为啥要加呢,因为input的setValue中有nextTick
BI.nextTick(function () {
BI.Test.triggerKeyDown(widget.element.find(".bi-input"), "2", 50, function () {
BI.nextTick(function () {
BI.each(searchItemSelectorGetter([1,2]), function (idx, selector) {
widget.element.find(selector).click();
});
expect(widget.getValue()).to.deep.equal({
type: 1,
value: [2, 12]
});
widget.destroy();
done();
});
});
});
});
});

2
src/core/alias.js

@ -562,7 +562,7 @@
try {
// 注意0啊
// var jo = $.parseJSON(text) || {};
var jo = _global.$ ? _global.$.parseJSON(text) : _global.JSON.parse(text);
var jo = BI.$ ? BI.$.parseJSON(text) : _global.JSON.parse(text);
if (jo == null) {
jo = {};
}

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

@ -23,7 +23,7 @@ BI.ResizeController = BI.inherit(BI.Controller, {
_resize: function (ev) {
BI.each(this.resizerManger, function (key, resizer) {
if (resizer instanceof $) {
if (resizer instanceof BI.$) {
if (resizer.is(":visible")) {
resizer.trigger("__resize__");
}

6
src/core/platform/web/dom.js

@ -14,7 +14,7 @@
BI.extend(BI.DOM, {
patchProps: function (fromElement, toElement) {
var elemData = jQuery._data(fromElement[0]);
var elemData = BI.jQuery._data(fromElement[0]);
var events = elemData.events;
BI.each(events, function (eventKey, event) {
BI.each(event, function (i, handler) {
@ -26,7 +26,7 @@
throw new Error("不匹配");
}
BI.each(fromChildren, function (i, child) {
BI.DOM.patchProps(jQuery(child), jQuery(toChildren[i]));
BI.DOM.patchProps(BI.jQuery(child), BI.jQuery(toChildren[i]));
});
BI.each(fromElement.data("__widgets"), function (i, widget) {
widget.element = toElement;
@ -43,7 +43,7 @@
var frag = BI.Widget._renderEngine.createFragment();
BI.each(doms, function (i, dom) {
dom instanceof BI.Widget && (dom = dom.element);
dom instanceof $ && dom[0] && frag.appendChild(dom[0]);
dom instanceof BI.$ && dom[0] && frag.appendChild(dom[0]);
});
return frag;
},

4
src/core/platform/web/jquery/_jquery.js vendored

@ -9595,7 +9595,9 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
// })();
// Expose jQuery to the global object
window.jQuery = window.$ = jQuery;
BI.jQuery = BI.$ = jQuery;
window.$ = window.$ || jQuery;
window.jQuery = window.jQuery || jQuery;
// Expose jQuery as an AMD module, but only for AMD loaders that
// understand the issues with loading multiple versions of jQuery

2
src/core/platform/web/jquery/event.js vendored

@ -1,7 +1,7 @@
/*
* 给jQuery.Event对象添加的工具方法
*/
$.extend($.Event.prototype, {
BI.$.extend(BI.$.Event.prototype, {
// event.stopEvent
stopEvent: function () {
this.stopPropagation();

14
src/core/platform/web/jquery/fn.js vendored

@ -1,4 +1,4 @@
if (jQuery) {
if (BI.jQuery) {
(function ($) {
// richer:容器在其各个边缘留出的空间
if (!$.fn.insets) {
@ -54,9 +54,9 @@ if (jQuery) {
};
}
})(jQuery);
})(BI.jQuery);
BI.extend(jQuery.fn, {
BI.extend(BI.jQuery.fn, {
destroy: function () {
this.remove();
@ -99,7 +99,7 @@ if (jQuery) {
if (tidx >= 0) {
// 标红的text未encode
this.append(BI.htmlEncode(textLeft.substr(0, tidx)));
this.append($("<span>").addClass("bi-keyword-red-mark")
this.append(BI.$("<span>").addClass("bi-keyword-red-mark")
.html(BI.htmlEncode(textLeft.substr(tidx, keyword.length))));
textLeft = textLeft.substr(tidx + keyword.length);
@ -109,7 +109,7 @@ if (jQuery) {
} else if (pidx != null && pidx >= 0 && Math.floor(pidx / text.length) === Math.floor((pidx + keyword.length - 1) / text.length)) {
// 标红的text未encode
this.append(BI.htmlEncode(textLeft.substr(0, pidx)));
this.append($("<span>").addClass("bi-keyword-red-mark")
this.append(BI.$("<span>").addClass("bi-keyword-red-mark")
.html(BI.htmlEncode(textLeft.substr(pidx, keyword.length))));
if (py != null) {
py = py.substr(pidx + keyword.length);
@ -126,8 +126,8 @@ if (jQuery) {
},
getDomHeight: function (parent) {
var clone = $(this).clone();
clone.appendTo($(parent || "body"));
var clone = BI.$(this).clone();
clone.appendTo(BI.$(parent || "body"));
var height = clone.height();
clone.remove();
return height;

12
src/core/platform/web/load.js

@ -2,17 +2,17 @@ _.extend(BI, {
$import: function () {
var _LOADED = {}; // alex:保存加载过的
function loadReady (src, must) {
var $scripts = $("head script, body script");
$.each($scripts, function (i, item) {
var $scripts = BI.$("head script, body script");
BI.$.each($scripts, function (i, item) {
if (item.src.indexOf(src) != -1) {
_LOADED[src] = true;
}
});
var $links = $("head link");
$.each($links, function (i, item) {
var $links = BI.$("head link");
BI.$.each($links, function (i, item) {
if (item.href.indexOf(src) != -1 && must) {
_LOADED[src] = false;
$(item).remove();
BI.$(item).remove();
}
});
}
@ -34,7 +34,7 @@ _.extend(BI, {
_LOADED[src] = true;
} else {
// alex:这里用同步调用的方式,必须等待ajax完成
$.ajax({
BI.$.ajax({
url: src,
dataType: "script", // alex:指定dataType为script,jquery会帮忙做globalEval的事情
async: false,

6
src/core/widget.js

@ -497,11 +497,11 @@
if (BI.isWidget(widget)) {
var o = widget.options;
if (o.element) {
return $(o.element);
return BI.$(o.element);
}
return $(document.createElement(o.tagName));
return BI.$(document.createElement(o.tagName));
}
return $(widget);
return BI.$(widget);
},
createFragment: function () {
return document.createDocumentFragment();

3
src/css/base/view/popover.css

@ -0,0 +1,3 @@
.bi-popover {
border: 1px solid transparent;
}

1
src/less/base/view/popover.less

@ -1,4 +1,5 @@
@import "../../index";
.bi-popover {
border: 1px solid transparent;
}

2
src/third/jquery.mousewheel.js

@ -15,7 +15,7 @@
module.exports = factory;
} else {
// Browser globals
factory(jQuery);
factory(BI.jQuery);
}
}(function ($) {

1
src/widget/datepane/datepane.js

@ -44,6 +44,7 @@ BI.DynamicDatePane = BI.inherit(BI.Widget, {
default:
break;
}
self.fireEvent("EVENT_CHANGE");
}
}],
ref: function () {

2
src/widget/multilayerselecttree/multilayerselecttree.combo.js

@ -141,7 +141,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.setValue([value]);
self.combo.hideView();
}
}]

2
src/widget/multilayersingletree/multilayersingletree.combo.js

@ -144,7 +144,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.setValue([value]);
self.combo.hideView();
}
}]

21
src/widget/multiselectlist/multiselectlist.insert.js

@ -137,6 +137,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE);
});
}
}
@ -210,16 +211,14 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -320,8 +319,6 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}

21
src/widget/multiselectlist/multiselectlist.insert.nobar.js

@ -142,6 +142,7 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE);
});
}
}
@ -218,16 +219,14 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -330,8 +329,6 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}

21
src/widget/multiselectlist/multiselectlist.js

@ -120,6 +120,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
});
}
}
@ -192,16 +193,14 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -332,8 +331,6 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}

5
src/widget/multitree/multi.tree.list.combo.js

@ -21,7 +21,8 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
height: 24,
allowEdit: true
allowEdit: true,
allowInsertValue: true
});
},
@ -50,7 +51,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
type: "bi.multi_list_tree_searcher",
itemsCreator: o.itemsCreator,
popup: {
type: "bi.multi_tree_search_insert_pane",
type: o.allowInsertValue ? "bi.multi_tree_search_insert_pane" : "bi.multi_tree_search_pane",
el: {
type: "bi.list_part_tree"
},

8
test/utils.js

@ -14,19 +14,19 @@
*/
triggerKeyDown: function (element, value, keyCode, callback) {
// keydown
var e = $.Event("keydown");
var e = BI.$.Event("keydown");
e.keyCode = keyCode;
element.trigger(e);
// input
BI.isNotNull(value) && element.val(value);
var e1 = $.Event("input");
var e1 = BI.$.Event("input");
e1.originalEvent = {};
e1.keyCode = keyCode;
element.trigger(e1);
// keyup 至少等300ms后触发
var e2 = $.Event("keyup");
var e2 = BI.$.Event("keyup");
e2.keyCode = keyCode;
element.trigger(e2);
BI.delay(function () {
@ -39,7 +39,7 @@
*/
triggerMouseover: function (element, callback) {
// keydown
var e = $.Event("mouseover");
var e = BI.$.Event("mouseover");
element.trigger(e);
callback && callback();
}

Loading…
Cancel
Save