Browse Source

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

* commit 'baf92636fd79464e733eb3a880ca98b3369fd5a9': (24 commits)
  全局样式
  add
  整理
  add
  add
  formula combo
  日期国际化Key
  bug
  css
  字体兼容ie8
  add
  searcher
  样式
  add
  add
  全局样式
  add
  add
  国际化
  add
  ...
es6
guy 8 years ago
parent
commit
88ba52807a
  1. 70
      bi/base.css
  2. 482
      bi/base.js
  3. 28
      bi/case.js
  4. 89
      bi/core.css
  5. 61
      bi/core.js
  6. 283
      bi/widget.js
  7. 4
      demo/dist/demo.js
  8. 4
      demo/js/component/demo.treevaluechooser.js
  9. 58
      demo/js/core/abstract/combination/demo.sercher.js
  10. 4
      demo/js/widget/demo.multiselectcombo.js
  11. 70
      docs/base.css
  12. 482
      docs/base.js
  13. 28
      docs/case.js
  14. 89
      docs/core.css
  15. 61
      docs/core.js
  16. 67
      docs/demo.js
  17. 3233
      docs/resource.css
  18. 283
      docs/widget.js
  19. 36
      src/base/combination/searcher.js
  20. 2
      src/base/pager/pager.js
  21. 2
      src/base/single/button/button.basic.js
  22. 2
      src/base/single/text.js
  23. 4
      src/base/table/table.grid.js
  24. 4
      src/base/table/table.grid.quick.js
  25. 341
      src/base/table/table.js
  26. 32
      src/base/tree/parttree.js
  27. 24
      src/base/tree/synctree.js
  28. 35
      src/base/tree/treeview.js
  29. 3
      src/case/button/item.multiselect.js
  30. 2
      src/case/combo/formulacombo/trigger.formulacombo.js
  31. 8
      src/case/editor/editor.state.js
  32. 6
      src/case/editor/editor.state.simple.js
  33. 7
      src/case/segment/segment.js
  34. 4
      src/component/allvaluechooser/combo.allvaluechooser.js
  35. 158
      src/component/treevaluechooser/combo.treevaluechooser.js
  36. 4
      src/component/valuechooser/combo.valuechooser.js
  37. 8
      src/config.js
  38. 12
      src/core/base.js
  39. 11
      src/core/func/dom.js
  40. 12
      src/core/func/function.js
  41. 18
      src/core/proto/date.js
  42. 6
      src/css/base/dom.css
  43. 17
      src/css/base/segment/segment.css
  44. 2
      src/css/base/single/button/button.css
  45. 16
      src/css/base/table/table.grid.scrollbar.css
  46. 29
      src/css/base/tree/display.tree.css
  47. 89
      src/css/core/utils/common.css
  48. 3233
      src/css/resource/font.css
  49. 5
      src/less/base/dom.less
  50. 20
      src/less/base/segment/segment.less
  51. 25
      src/less/base/table/table.grid.scrollbar.less
  52. 82
      src/less/core/utils/common.less
  53. 46
      src/less/image.less
  54. 2
      src/less/lib/colors.less
  55. 19
      src/less/lib/constant.less
  56. 356
      src/less/lib/font.less
  57. 297
      src/less/resource/font.less
  58. 6
      src/less/visual.less
  59. 2
      src/widget/date/trigger.date.js
  60. 2
      src/widget/downlist/combo.downlist.js
  61. 2
      src/widget/multiselect/check/multiselect.check.pane.js
  62. 5
      src/widget/multiselect/multiselect.combo.js
  63. 2
      src/widget/multiselect/multiselect.loader.js
  64. 2
      src/widget/multiselect/search/multiselect.search.loader.js
  65. 4
      src/widget/multiselect/trigger/searcher.multiselect.js
  66. 4
      src/widget/multitree/check/multi.tree.check.pane.js
  67. 2
      src/widget/multitree/multi.tree.popup.js
  68. 4
      src/widget/numericalinterval/numericalinterval.js
  69. 2
      src/widget/relationview/relationview.region.container.js
  70. 2
      src/widget/relationview/relationview.region.js
  71. 40
      src/widget/sequencetable/listnumber.sequencetable.js
  72. 44
      src/widget/sequencetable/treenumber.sequencetable.js

70
bi/base.css

@ -74,12 +74,6 @@
/****添加计算宽度的--运算符直接需要space****/
/****** common color(常用颜色,可用于普遍场景) *****/
/**** custom color(自定义颜色,用于特定场景) ****/
/************hing light*****************/
.bi-z-index-mask {
background-color: #1a1a1a;
opacity: 0.5;
filter: alpha(opacity=50);
}
/****添加计算宽度的--运算符直接需要space****/
/****** common color(常用颜色,可用于普遍场景) *****/
/**** custom color(自定义颜色,用于特定场景) ****/
@ -678,8 +672,13 @@ li.CodeMirror-hint-active {
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
background: #ffffff;
border-right: 1px solid #d4dadd;
border-top: 1px solid #d4dadd;
border-bottom: 1px solid #d4dadd;
}
.bi-segment > .first-element {
border-left: 1px solid #d4dadd;
-webkit-border-radius: 6px 0px 0px 6px;
-moz-border-radius: 6px 0px 0px 6px;
border-radius: 6px 0px 0px 6px;
@ -689,6 +688,18 @@ li.CodeMirror-hint-active {
-moz-border-radius: 0px 6px 6px 0px;
border-radius: 0px 6px 6px 0px;
}
.bi-theme-dark .bi-segment > .center-element {
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
background: #242640;
border-right: 1px solid #525466;
border-top: 1px solid #525466;
border-bottom: 1px solid #525466;
}
.bi-theme-dark .bi-segment > .first-element {
border-left: 1px solid #242640;
}
/****添加计算宽度的--运算符直接需要space****/
/****** common color(常用颜色,可用于普遍场景) *****/
/**** custom color(自定义颜色,用于特定场景) ****/
@ -746,7 +757,7 @@ li.CodeMirror-hint-active {
.bi-button.button-common.disabled,
.bi-button.button-success.disabled,
.bi-button.button-warning.disabled {
background: #c4c6c6 !important;
background: #cccccc !important;
border-color: #c4c6c6 !important;
}
.bi-button.button-common.disabled,
@ -1098,12 +1109,12 @@ li.CodeMirror-hint-active {
transition-timing-function: ease;
user-select: none;
background-color: rgba(102, 102, 102, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0D666666,endColorstr=#0D666666);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d666666,endColorstr=#0d666666);
border-radius: 5px;
}
.bi-theme-dark .scrollbar-layout-main {
background-color: rgba(204, 204, 204, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0Dcccccc,endColorstr=#0Dcccccc);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dcccccc,endColorstr=#0dcccccc);
}
.scrollbar-layout-main-vertical {
bottom: 0;
@ -1122,11 +1133,11 @@ li.CodeMirror-hint-active {
left: 0;
transition-property: background-color;
background-color: rgba(102, 102, 102, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0D666666,endColorstr=#0D666666);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d666666,endColorstr=#0d666666);
}
.bi-theme-dark .scrollbar-layout-main-horizontal {
background-color: rgba(204, 204, 204, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0Dcccccc,endColorstr=#0Dcccccc);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dcccccc,endColorstr=#0dcccccc);
}
/* Touching the scroll-track directly makes the scroll-track bolder */
.scrollbar-layout-main-horizontal.public-scrollbar-main-active,
@ -1180,23 +1191,23 @@ li.CodeMirror-hint-active {
/* Touching the scroll-track directly makes the scroll-track bolder */
.public-scrollbar-face:after {
background-color: rgba(102, 102, 102, 0.3);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4C666666,endColorstr=#4C666666);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4d666666,endColorstr=#4d666666);
}
.bi-theme-dark .public-scrollbar-face:after {
background-color: rgba(204, 204, 204, 0.3);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4Ccccccc,endColorstr=#4Ccccccc);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4dcccccc,endColorstr=#4dcccccc);
}
.public-scrollbar-main:hover .public-scrollbar-face:after,
.public-scrollbar-main-active .public-scrollbar-face:after,
.public-scrollbar-faceActive:after {
background-color: rgba(102, 102, 102, 0.7);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#B2666666,endColorstr=#B2666666);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#b3666666,endColorstr=#b3666666);
}
.bi-theme-dark .public-scrollbar-main:hover .public-scrollbar-face:after,
.bi-theme-dark .public-scrollbar-main-active .public-scrollbar-face:after,
.bi-theme-dark .public-scrollbar-faceActive:after {
background-color: rgba(204, 204, 204, 0.7);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#B2cccccc,endColorstr=#B2cccccc);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#b3cccccc,endColorstr=#b3cccccc);
}
.horizontal-scrollbar {
bottom: 0;
@ -1241,35 +1252,6 @@ li.CodeMirror-hint-active {
/****添加计算宽度的--运算符直接需要space****/
/****** common color(常用颜色,可用于普遍场景) *****/
/**** custom color(自定义颜色,用于特定场景) ****/
.bi-display-tree .ztree * {
color: #808080;
}
.bi-display-tree .ztree li span.button.switch.center_open {
background-image: url("/icon/tree-vertical-line-3.png");
}
.bi-display-tree .ztree li span.button.switch.roots_open {
background-image: url("/icon/tree-vertical-line-2.png");
}
.bi-display-tree .ztree li span.button.switch.bottom_open {
background-image: url("/icon/tree-vertical-line-4.png");
}
.bi-display-tree .ztree li a,
.bi-display-tree .ztree li span {
cursor: default !important;
}
.bi-display-tree .ztree li a:hover {
text-decoration: none;
}
.bi-display-tree .ztree li a.curSelectedNode {
padding-top: 1px;
border: none;
background-color: inherit;
opacity: 1;
filter: alpha(opacity=100);
}
/****添加计算宽度的--运算符直接需要space****/
/****** common color(常用颜色,可用于普遍场景) *****/
/**** custom color(自定义颜色,用于特定场景) ****/
.bi-trigger .bi-trigger-icon-button {
font-size: 16px;
}

482
bi/base.js

@ -577,7 +577,7 @@ BI.Text = BI.inherit(BI.Single, {
setText: function (text) {
BI.Text.superclass.setText.apply(this, arguments);
this.options.text = text;
this.text.element.html(BI.escape(text).replaceAll(" ", " "));
this.text.element.text((text + "").replaceAll(" ", " "));
}
});
@ -767,12 +767,14 @@ BI.BasicButton = BI.inherit(BI.Single, {
});
break;
default:
if (o.stopEvent || o.stopPropagation) {
hand.mousedown(function (e) {
ev(e);
});
hand.mouseup(function (e) {
ev(e);
});
}
hand.click(clk);
break;
}
@ -1596,8 +1598,8 @@ BI.TreeView = BI.inherit(BI.Pane, {
treeNode.times = treeNode.times || 1;
var param = "id=" + treeNode.id
+ "&times=" + (treeNode.times++)
+ "&parent_values= " + window.encodeURIComponent(BI.jsonEncode(parentNode))
+ "&check_state=" + window.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus()));
+ "&parentValues= " + window.encodeURIComponent(BI.jsonEncode(parentNode))
+ "&checkState=" + window.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus()));
return BI.servletURL + '?op=' + self.options.op + '&cmd=' + self.options.cmd + "&" + param;
}
@ -1728,7 +1730,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
this._buildTree(map, path);
return;
}
var storeValues = BI.deepClone(this.options.paras.selected_values);
var storeValues = BI.deepClone(this.options.paras.selectedValues);
var treeNode = this._getTree(storeValues, path);
this._addTreeNode(map, parent, this._getNodeValue(node), treeNode);
},
@ -1793,14 +1795,15 @@ BI.TreeView = BI.inherit(BI.Pane, {
//处理节点
_dealWidthNodes: function (nodes) {
var self = this, o = this.options;
//处理标红
if (BI.isKey(o.paras.keyword)) {
var keyword = o.paras.keyword;
var ns = BI.Tree.arrayFormat(nodes);
BI.each(ns, function (i, n) {
n.text = $("<div>").__textKeywordMarked__(n.text, keyword, n.py).html();
});
//处理标红
if (BI.isKey(o.paras.keyword)) {
n.text = $("<div>").__textKeywordMarked__(n.text, o.paras.keyword, n.py).html();
} else {
n.text = (n.text + "").replaceAll(" ", " ");
}
});
return nodes;
},
@ -1843,8 +1846,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
};
var op = BI.extend({}, o.paras, {
times: 1,
type: BI.TreeView.REQ_TYPE_INIT_DATA
times: 1
});
o.itemsCreator(op, function (res) {
@ -1886,7 +1888,8 @@ BI.TreeView = BI.inherit(BI.Pane, {
},
view: {
showIcon: false,
expandSpeed: ""
expandSpeed: "",
nameIsHTML: true
},
callback: {}
};
@ -1936,8 +1939,8 @@ BI.TreeView = BI.inherit(BI.Pane, {
},
setSelectedValue: function (value) {
this.options.paras.selected_values = value || {};
this.selected_values = BI.deepClone(value) || {};
this.options.paras.selectedValues = value || {};
this.selectedValues = BI.deepClone(value) || {};
},
updateValue: function (values, param) {
@ -1977,10 +1980,10 @@ BI.TreeView = BI.inherit(BI.Pane, {
}
});
BI.extend(BI.TreeView, {
REQ_TYPE_INIT_DATA: 0,
REQ_TYPE_ADJUST_DATA: 1,
REQ_TYPE_CALCULATE_SELECT_DATA: 2,
REQ_TYPE_SELECTED_DATA: 3
REQ_TYPE_INIT_DATA: 1,
REQ_TYPE_ADJUST_DATA: 2,
REQ_TYPE_SELECT_DATA: 3,
REQ_TYPE_GET_SELECTED_DATA: 4
});
BI.TreeView.EVENT_CHANGE = "EVENT_CHANGE";
@ -2088,21 +2091,21 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
_selectTreeNode: function (treeId, treeNode) {
var self = this, o = this.options;
var parent_values = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode));
var parentValues = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode));
var name = this._getNodeValue(treeNode)
// var values = parent_values.concat([name]);
// var values = parentValues.concat([name]);
if (treeNode.checked === true) {
} else {
var tNode = treeNode;
var pNode = this._getTree(this.selected_values, parent_values);
var pNode = this._getTree(this.selectedValues, parentValues);
if (BI.isNotNull(pNode[name])) {
delete pNode[name];
}
while (tNode != null && BI.isEmpty(pNode)) {
parent_values = parent_values.slice(0, parent_values.length - 1);
parentValues = parentValues.slice(0, parentValues.length - 1);
tNode = tNode.getParentNode();
if (tNode != null) {
pNode = this._getTree(this.selected_values, parent_values);
pNode = this._getTree(this.selectedValues, parentValues);
name = this._getNodeValue(tNode);
delete pNode[name];
}
@ -2118,8 +2121,8 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
var op = BI.extend({}, o.paras, {
"id": treeNode.id,
"times": 1,
"parent_values": parentValues.concat(this._getNodeValue(treeNode)),
"check_state": treeNode.getCheckStatus()
"parentValues": parentValues.concat(this._getNodeValue(treeNode)),
"checkState": treeNode.getCheckStatus()
});
var complete = function (d) {
var nodes = d.items || [];
@ -2167,7 +2170,7 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
},
hasChecked: function () {
return !BI.isEmpty(this.selected_values) || BI.SyncTree.superclass.hasChecked.apply(this, arguments);
return !BI.isEmpty(this.selectedValues) || BI.SyncTree.superclass.hasChecked.apply(this, arguments);
},
getValue: function () {
@ -2176,12 +2179,12 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
}
var checkedValues = this._getSelectedValues();
if (BI.isEmpty(checkedValues)) {
return this.selected_values;
return this.selectedValues;
}
if (BI.isEmpty(this.selected_values)) {
if (BI.isEmpty(this.selectedValues)) {
return checkedValues;
}
return this._join(checkedValues, this.selected_values);
return this._join(checkedValues, this.selectedValues);
},
//生成树方法
@ -2189,7 +2192,7 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
delete this.options.keyword;
BI.extend(this.options.paras, config);
//取消选中时使用
this.selected_values = BI.deepClone(this.options.paras.selected_values) || {};
this.selectedValues = BI.deepClone(this.options.paras.selectedValues) || {};
var setting = this._configSetting();
this._initTree(setting);
}
@ -2219,7 +2222,7 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
this.tip.setLoading();
o.itemsCreator(op, function (d) {
var hasNext = !!d.hasNext, nodes = d.items || [];
o.paras.last_search_value = d.last_search_value;
o.paras.lastSearchValue = d.lastSearchValue;
if (self._stop === true) {
return;
}
@ -2236,35 +2239,35 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
_selectTreeNode: function (treeId, treeNode) {
var self = this, o = this.options;
var parent_values = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode));
var parentValues = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode));
var name = this._getNodeValue(treeNode)
// var values = parent_values.concat([name]);
// var values = parentValues.concat([name]);
if (treeNode.checked === true) {
BI.SyncTree.superclass._selectTreeNode.apply(self, arguments);
} else {
o.itemsCreator(BI.extend({}, o.paras, {
type: BI.TreeView.REQ_TYPE_CALCULATE_SELECT_DATA,
selected_values: this.selected_values,
not_selected_value: name,
parent_values: parent_values
selectedValues: this.selectedValues,
notSelectedValue: name,
parentValues: parentValues
}), function (new_values) {
if (BI.isEqual(self.selected_values, new_values)) {
if (BI.isEqual(self.selectedValues, new_values)) {
var tNode = treeNode;
var pNode = self._getTree(new_values, parent_values);
var pNode = self._getTree(new_values, parentValues);
if (pNode[name]) {
delete pNode[name];
}
while (tNode != null && BI.isEmpty(pNode)) {
parent_values = parent_values.slice(0, parent_values.length - 1);
parentValues = parentValues.slice(0, parentValues.length - 1);
tNode = tNode.getParentNode();
if (tNode != null) {
pNode = self._getTree(new_values, parent_values);
pNode = self._getTree(new_values, parentValues);
name = self._getNodeValue(tNode);
delete pNode[name];
}
}
}
self.selected_values = new_values;
self.selectedValues = new_values;
BI.SyncTree.superclass._selectTreeNode.apply(self, arguments);
});
}
@ -2317,7 +2320,7 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
return;
}
var hasNext = !!d.hasNext, nodes = d.items || [];
o.paras.last_search_value = d.last_search_value;
o.paras.lastSearchValue = d.lastSearchValue;
if (nodes.length > 0) {
callback(self._dealWidthNodes(nodes));
}
@ -2348,7 +2351,7 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
var result = BI.PartTree.superclass.getValue.apply(this, arguments);
o.itemsCreator({
type: BI.TreeView.REQ_TYPE_ADJUST_DATA,
selected_values: result
selectedValues: result
}, function (res) {
result = res;
});
@ -2360,10 +2363,10 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
var o = this.options;
delete o.paras.keyword;
BI.extend(o.paras, config);
delete o.paras.last_search_value;
delete o.paras.lastSearchValue;
//取消选中时使用
this.selected_values = BI.deepClone(o.paras.selected_values) || {};
//delete this.options.paras.selected_values;
this.selectedValues = BI.deepClone(o.paras.selectedValues) || {};
//delete this.options.paras.selectedValues;
var setting = this._configSetting();
this._initTree(setting, o.paras.keyword);
}
@ -4103,7 +4106,6 @@ BI.Searcher = BI.inherit(BI.Widget, {
callback([])
},
el: {
type: "bi.search_editor"
},
@ -4161,16 +4163,11 @@ BI.Searcher = BI.inherit(BI.Widget, {
_assertPopupView: function () {
var self = this, o = this.options;
if (!BI.Maskers.has(this.getName())) {
if ((o.masker && !BI.Maskers.has(this.getName())) || (o.masker === false && !this.popupView)) {
this.popupView = BI.createWidget(o.popup, {
type: "bi.searcher_view",
chooseType: o.chooseType
});
BI.Maskers.create(this.getName(), o.adapter, BI.extend({
container: this,
render: this.popupView
}, o.masker));
this.popupView.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
@ -4197,6 +4194,12 @@ BI.Searcher = BI.inherit(BI.Widget, {
self.fireEvent(BI.Searcher.EVENT_AFTER_INIT);
});
}
if (o.masker && !BI.Maskers.has(this.getName())) {
BI.Maskers.create(this.getName(), o.adapter, BI.extend({
container: this,
render: this.popupView
}, o.masker));
}
},
_startSearch: function () {
@ -4218,7 +4221,7 @@ BI.Searcher = BI.inherit(BI.Widget, {
BI.nextTick(function (name) {
BI.Maskers.hide(name);
}, this.getName());
if (BI.Maskers.has(name) && this._isSearching === true) {
if (this._isSearching === true) {
this.popupView && this.popupView.pauseSearch && this.popupView.pauseSearch();
this.fireEvent(BI.Searcher.EVENT_PAUSE);
}
@ -4229,11 +4232,7 @@ BI.Searcher = BI.inherit(BI.Widget, {
var o = this.options, name = this.getName();
this._stop = true;
BI.Maskers.hide(name);
if (BI.Maskers.has(name) && this._isSearching === true) {
//搜索后清空dom
// BI.nextTick(function () {
// BI.Maskers.has(name) && BI.Maskers.get(name).empty();
// });
if (this._isSearching === true) {
this.popupView && this.popupView.stopSearch && this.popupView.stopSearch();
this.fireEvent(BI.Searcher.EVENT_STOP);
}
@ -4246,11 +4245,11 @@ BI.Searcher = BI.inherit(BI.Widget, {
return;
}
if (o.isAutoSearch) {
var items = (o.adapter.getItems && o.adapter.getItems()) || o.adapter.attr("items") || [];
var items = (o.adapter && ((o.adapter.getItems && o.adapter.getItems()) || o.adapter.attr("items"))) || [];
var finding = BI.Func.getSearchResult(items, keyword);
var matched = finding.matched, finded = finding.finded;
this.popupView.populate(finded, matched, keyword);
o.isAutoSync && this.popupView.setValue(o.adapter.getValue());
o.isAutoSync && o.adapter && o.adapter.getValue && this.popupView.setValue(o.adapter.getValue());
self.fireEvent(BI.Searcher.EVENT_SEARCHING);
return;
}
@ -4267,7 +4266,7 @@ BI.Searcher = BI.inherit(BI.Widget, {
}
BI.Maskers.show(self.getName());
self.popupView.populate.apply(self.popupView, args);
o.isAutoSync && self.popupView.setValue(o.adapter && o.adapter.getValue());
o.isAutoSync && o.adapter && o.adapter.getValue && self.popupView.setValue(o.adapter.getValue());
self.popupView.loaded && self.popupView.loaded();
self.fireEvent(BI.Searcher.EVENT_SEARCHING);
}
@ -4341,13 +4340,15 @@ BI.Searcher = BI.inherit(BI.Widget, {
getValue: function () {
var o = this.options;
if (o.isAutoSync) {
if (o.isAutoSync && o.adapter && o.adapter.getValue) {
return o.adapter.getValue();
}
if (this.isSearching()) {
return this.popupView.getValue();
} else {
} else if (o.adapter && o.adapter.getValue) {
return o.adapter.getValue();
} else {
return this.popupView.getValue();
}
},
@ -4355,7 +4356,7 @@ BI.Searcher = BI.inherit(BI.Widget, {
var o = this.options;
this._assertPopupView();
this.popupView.populate.apply(this.popupView, arguments);
if (o.isAutoSync) {
if (o.isAutoSync && o.adapter && o.adapter.getValue) {
this.popupView.setValue(o.adapter.getValue());
}
},
@ -15512,7 +15513,7 @@ BI.Pager = BI.inherit(BI.Widget, {
type: "bi.button_group",
element: this,
items: BI.createItems(view, {
cls: "page-item",
cls: "bi-list-item-select",
height: 23,
hgap: 10
}),
@ -29374,11 +29375,11 @@ BI.GridTable = BI.inherit(BI.Widget, {
this.topLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0);
this.topLeftGrid.setEstimatedRowSize(o.headerRowSize);
this.topRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength));
this.topRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.topRightGrid.setEstimatedRowSize(o.headerRowSize);
this.bottomLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0);
this.bottomLeftGrid.setEstimatedRowSize(o.rowSize);
this.bottomRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength));
this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.bottomRightGrid.setEstimatedRowSize(o.rowSize);
var items = this.contextLayout.attr("items");
@ -29612,11 +29613,11 @@ BI.QuickGridTable = BI.inherit(BI.GridTable, {
this.topLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0);
this.topLeftGrid.setEstimatedRowSize(o.headerRowSize);
this.topRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength));
this.topRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.topRightGrid.setEstimatedRowSize(o.headerRowSize);
this.bottomLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0);
this.bottomLeftGrid.setEstimatedRowSize(o.rowSize);
this.bottomRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength));
this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.bottomRightGrid.setEstimatedRowSize(o.rowSize);
var items = this.contextLayout.attr("items");
@ -30458,10 +30459,6 @@ BI.Table = BI.inherit(BI.Widget, {
}]]
}))));
//var scrollElement = isRight ? scrollBottomLeft.element : scrollBottomRight.element;
//var scrollTopElement = isRight ? scrollTopLeft.element : scrollTopRight.element;
//var otherElement = isRight ? scrollBottomRight.element : scrollBottomLeft.element;
this._initFreezeScroll();
BI.nextTick(function () {
if (self.element.is(":visible")) {
@ -30478,268 +30475,19 @@ BI.Table = BI.inherit(BI.Widget, {
_initFreezeScroll: function () {
var self = this, o = this.options;
scroll(this.scrollBottomRight.element, this.scrollTopRight.element, this.scrollBottomLeft.element);
scroll(this.scrollBottomLeft.element, this.scrollTopLeft.element, this.scrollBottomRight.element);
// scroll(this.scrollBottomLeft.element, this.scrollTopLeft.element, this.scrollBottomRight.element);
function scroll(scrollElement, scrollTopElement, otherElement) {
var scrolling, scrollingX;
var fn = function (event, delta, deltaX, deltaY) {
var inf = self._getScrollOffsetAndDur(event);
if (deltaY < 0 || deltaY > 0) {
if (scrolling) {
scrollElement[0].scrollTop = scrolling;
}
scrolling = scrollElement[0].scrollTop - delta * inf.offset;
var stopPropagation = false;
var st = scrollElement[0].scrollTop;
scrollElement[0].scrollTop = scrolling;
if (scrollElement[0].scrollTop !== st) {
stopPropagation = true;
}
scrollElement[0].scrollTop = st;
self._animateScrollTo(scrollElement, scrollElement[0].scrollTop, scrolling, inf.dur, "linear", {
onStart: function () {
},
onUpdate: function (top) {
otherElement[0].scrollTop = top;
self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, top);
},
onComplete: function () {
self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, scrolling);
scrolling = null;
}
});
//otherElement[0].scrollTop = scrollTop;
//scrollElement[0].scrollTop = scrollTop;
//self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, scrollTop);
if (stopPropagation === true) {
event.stopPropagation();
return false;
}
return;
}
//if (deltaX < 0 || deltaX > 0) {
// if (scrollingX) {
// scrollElement[0].scrollLeft = scrollingX;
// }
// scrollingX = scrollElement[0].scrollLeft + delta * inf.offset;
// var stopPropagation = false;
// var sl = scrollElement[0].scrollLeft;
// scrollElement[0].scrollLeft = scrollingX;
// if (scrollElement[0].scrollLeft !== sl) {
// stopPropagation = true;
// }
// scrollElement[0].scrollLeft = sl;
// self._animateScrollTo(scrollElement, scrollElement[0].scrollLeft, scrollingX, inf.dur, "linear", {
// direction: "left",
// onStart: function () {
// },
// onUpdate: function (left) {
// scrollTopElement[0].scrollLeft = left;
// self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, null, left);
// },
// onComplete: function () {
// self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, null, scrollingX);
// scrollingX = null;
// }
// });
//
//
// //otherElement[0].scrollTop = scrollTop;
// //scrollElement[0].scrollTop = scrollTop;
// //self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, scrollTop);
// if (stopPropagation === true) {
// event.stopPropagation();
// return false;
// }
//}
};
scrollElement.mousewheel(fn);
var scrollTop = 0, scrollLeft = 0;
scrollElement.scroll(function (e) {
var change = false;
if (scrollElement.scrollTop() != scrollTop) {
var old = otherElement.scrollTop();
otherElement.scrollTop(scrollElement.scrollTop());
scrollTop = scrollElement.scrollTop();
if (Math.abs(old - otherElement[0].scrollTop) > 0.1) {
e.stopPropagation();
change = true;
}
}
if (scrollElement.scrollLeft() != scrollLeft) {
var old = scrollTopElement.scrollLeft();
scrollTopElement.scrollLeft(scrollElement.scrollLeft());
scrollLeft = scrollElement.scrollLeft();
if (Math.abs(old - scrollTopElement[0].scrollLeft) > 0.1) {
e.stopPropagation();
change = true;
}
}
// self.fireEvent(BI.Table.EVENT_TABLE_SCROLL);
if (change === true) {
e.stopPropagation();
//return false;
}
self.fireEvent(BI.Table.EVENT_TABLE_SCROLL);
});
}
},
_animateScrollTo: function (el, from, to, duration, easing, op) {
var self = this;
var onStart = op.onStart, onComplete = op.onComplete, onUpdate = op.onUpdate;
var startTime = BI.getTime(), _delay, progress = 0, _request;
_cancelTween();
_startTween();
var diff = to - from;
el._stop = 0;
function _step() {
if (el._stop) {
return;
}
if (!progress) {
onStart.call();
}
progress = BI.getTime() - startTime;
_tween();
if (progress >= el.time) {
el.time = (progress > el.time) ? progress + _delay - (progress - el.time) : progress + _delay - 1;
if (el.time < progress + 1) {
el.time = progress + 1;
}
}
if (el.time < duration) {
el._id = _request(_step);
} else {
el[op.direction == 'left' ? "scrollLeft" : "scrollTop"](to);
onComplete.call();
}
}
function _tween() {
var top = to;
if (duration > 0) {
el.currVal = _ease(el.time, from, diff, duration, easing);
el[op.direction == 'left' ? "scrollLeft" : "scrollTop"](top = Math.round(el.currVal));
} else {
el[op.direction == 'left' ? "scrollLeft" : "scrollTop"](to);
}
onUpdate(top);
}
function _startTween() {
_delay = 1000 / 60;
el.time = progress + _delay;
_request = (!requestAnimationFrame()) ? function (f) {
_tween();
return setTimeout(f, 0.01);
} : requestAnimationFrame();
el._id = _request(_step);
}
function requestAnimationFrame() {
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.msRequestAnimationFrame ||
window.oRequestAnimationFrame;
}
function cancelAnimationFrame() {
return window.cancelAnimationFrame ||
window.webkitCancelAnimationFrame ||
window.mozCancelAnimationFrame ||
window.msCancelAnimationFrame ||
window.oCancelAnimationFrame ||
window.cancelRequestAnimationFrame ||
window.webkitCancelRequestAnimationFrame ||
window.mozCancelRequestAnimationFrame ||
window.msCancelRequestAnimationFrame ||
window.oCancelRequestAnimationFrame
}
function _cancelTween() {
if (el._id == null) {
return;
}
if (!cancelAnimationFrame()) {
clearTimeout(el._id);
} else {
cancelAnimationFrame()(el._id);
}
el._id = null;
}
function _ease(t, b, c, d, type) {
switch (type) {
case "linear":
return c * t / d + b;
break;
case "mcsLinearOut":
t /= d;
t--;
return c * Math.sqrt(1 - t * t) + b;
break;
case "easeInOutSmooth":
t /= d / 2;
if (t < 1) {
return c / 2 * t * t + b;
}
t--;
return -c / 2 * (t * (t - 2) - 1) + b;
break;
case "easeInOutStrong":
t /= d / 2;
if (t < 1) {
return c / 2 * Math.pow(2, 10 * (t - 1)) + b;
}
t--;
return c / 2 * ( -Math.pow(2, -10 * t) + 2 ) + b;
break;
case "easeInOut":
case "mcsEaseInOut":
t /= d / 2;
if (t < 1) {
return c / 2 * t * t * t + b;
}
t -= 2;
return c / 2 * (t * t * t + 2) + b;
break;
case "easeOutSmooth":
t /= d;
t--;
return -c * (t * t * t * t - 1) + b;
break;
case "easeOutStrong":
return c * ( -Math.pow(2, -10 * t / d) + 1 ) + b;
break;
case "easeOut":
case "mcsEaseOut":
default:
var ts = (t /= d) * t, tc = ts * t;
return b + c * (0.499999999999997 * tc * ts + -2.5 * ts * ts + 5.5 * tc + -6.5 * ts + 4 * t);
}
}
},
_getScrollOffsetAndDur: function (event) {
var offset = 40, dur = 200;
if (event.originalEvent.wheelDelta) {
offset = Math.abs(event.originalEvent.wheelDelta);
}
if (event.deltaFactor < 2) {
offset = 3;
dur = 17;
}
return {
offset: offset,
dur: dur
};
},
resize: function () {
this._resize();
this._resize && this._resize();
},
_createCells: function (items, columnSize, mergeCols, TDs, Ws, start, rowSize) {
@ -30991,17 +30739,7 @@ BI.Table = BI.inherit(BI.Widget, {
items: [this.scrollBottomRight]
});
this._resize = function () {
if (self.element.is(":visible")) {
self.setColumnSize(o.columnSize);
}
};
this._initNormalScroll();
BI.ResizeDetector.addResizeListener(this, function () {
self._resize();
self.fireEvent(BI.Table.EVENT_TABLE_RESIZE);
});
BI.nextTick(function () {
if (self.element.is(":visible")) {
self.fireEvent(BI.Table.EVENT_TABLE_AFTER_INIT);
@ -31011,66 +30749,8 @@ BI.Table = BI.inherit(BI.Widget, {
_initNormalScroll: function () {
var self = this;
var scrolling, scrollX;
this.scrollBottomRight.element.mousewheel(function (event, delta, deltaX, deltaY) {
var inf = self._getScrollOffsetAndDur(event);
if (deltaY < 0 || deltaY > 0) {
var ele = self.scrollBottomRight.element;
if (scrolling) {
ele[0].scrollTop = scrolling;
}
scrolling = ele[0].scrollTop - delta * inf.offset;
var stopPropagation = false;
var st = ele[0].scrollTop;
ele[0].scrollTop = scrolling;
if (ele[0].scrollTop !== st) {
stopPropagation = true;
}
ele[0].scrollTop = st;
self._animateScrollTo(ele, ele[0].scrollTop, scrolling, inf.dur, "linear", {
onStart: function () {
},
onUpdate: function (top) {
self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, top);
},
onComplete: function () {
self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, scrolling);
scrolling = null;
}
});
//var scrollTop = self.scrollBottomRight.element[0].scrollTop = self.scrollBottomRight.element[0].scrollTop - delta * offset;
//self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, scrollTop);
if (stopPropagation === true) {
event.stopPropagation();
return false;
}
}
});
var scrollTop = 0, scrollLeft = 0;
this.scrollBottomRight.element.scroll(function (e) {
var change = false;
var scrollElement = self.scrollBottomRight.element;
if (scrollElement.scrollTop() != scrollTop) {
if (Math.abs(scrollElement.scrollTop() - scrollTop) > 0.1) {
e.stopPropagation();
change = true;
}
scrollTop = scrollElement.scrollTop();
}
if (scrollElement.scrollLeft() != scrollLeft) {
if (Math.abs(scrollElement.scrollLeft() - scrollLeft) > 0.1) {
e.stopPropagation();
change = true;
}
scrollLeft = scrollElement.scrollLeft();
}
self.fireEvent(BI.Table.EVENT_TABLE_SCROLL);
if (change === true) {
e.stopPropagation();
//return false;
}
return false;
});
},
@ -31184,7 +30864,7 @@ BI.Table = BI.inherit(BI.Widget, {
}
BI.each(colgroupTds, function (i, colgroup) {
var width = colgroup.attr("width") | 0;
if (width !== sizes[i]) {
if (sizes[i] !== "" && width !== sizes[i]) {
var w = self._calculateWidth(sizes[i]);
colgroup.attr("width", w).css("width", w);
BI.each(bodyTds, function (j, items) {
@ -31291,7 +30971,7 @@ BI.Table = BI.inherit(BI.Widget, {
} else {
BI.each(this.colgroupTds, function (i, colgroup) {
var width = colgroup.attr("width") | 0;
if (width !== o.columnSize[i]) {
if (o.columnSize[i] !== "" && width !== o.columnSize[i]) {
var w = self._calculateWidth(o.columnSize[i]);
colgroup.attr("width", w).css("width", w);
BI.each(self.bodyTds, function (j, items) {
@ -31498,8 +31178,10 @@ BI.Table = BI.inherit(BI.Widget, {
if (w > 1.05) {
w += o.columnSize.length;
}
if (w > 1.05) {
this.tableContainer.element.width(w);
}
}
},
getColumnSize: function () {
@ -32023,14 +31705,6 @@ BI.Table = BI.inherit(BI.Widget, {
} else {
this._createNormalTable();
}
},
empty: function () {
BI.Table.superclass.empty.apply(this, arguments);
},
destroy: function () {
BI.Table.superclass.destroy.apply(this, arguments);
}
})
;

28
bi/case.js

@ -213,6 +213,9 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, {
doClick: function () {
BI.MultiSelectItem.superclass.doClick.apply(this, arguments);
this.checkbox.setSelected(this.isSelected());
if (this.isValid()) {
this.fireEvent(BI.MultiSelectItem.EVENT_CHANGE, this.getValue(), this);
}
},
setSelected: function (v) {
@ -4023,7 +4026,7 @@ BI.FormulaComboTrigger = BI.inherit(BI.Widget, {
var str = item.match(fieldRegx);
if (BI.isNotEmptyArray(str)) {
var id = str[0].substring(2, item.length - 1);
var item = BI.find(self.options.items, function (i, item) {
var item = BI.find(BI.flatten(self.options.items), function (i, item) {
return id === item.value;
});
formulaString = formulaString + item.text;
@ -6159,7 +6162,7 @@ BI.StateEditor = BI.inherit(BI.Single, {
cls: "state-editor-infinite-text bi-disabled",
textAlign: "left",
height: o.height,
text: BI.i18nText("BI-Unrestricted"),
text: BI.i18nText("BI-Basic_Unrestricted"),
hgap: 4,
handler: function () {
self._showInput();
@ -6335,7 +6338,7 @@ BI.StateEditor = BI.inherit(BI.Single, {
this.text.setTitle("");
this.text.element.removeClass("state-editor-infinite-text");
} else {
this.text.setText(BI.i18nText("BI-Unrestricted"));
this.text.setText(BI.i18nText("BI-Basic_Unrestricted"));
this.text.setTitle("");
this.text.element.addClass("state-editor-infinite-text");
}
@ -6343,7 +6346,7 @@ BI.StateEditor = BI.inherit(BI.Single, {
}
if (BI.isString(v)) {
if (BI.isEmpty(v)) {
this.text.setText(BI.i18nText("BI-Unrestricted"));
this.text.setText(BI.i18nText("BI-Basic_Unrestricted"));
this.text.setTitle("");
this.text.element.addClass("state-editor-infinite-text");
} else {
@ -6355,7 +6358,7 @@ BI.StateEditor = BI.inherit(BI.Single, {
}
if (BI.isArray(v)) {
if (BI.isEmpty(v)) {
this.text.setText(BI.i18nText("BI-Unrestricted"));
this.text.setText(BI.i18nText("BI-Basic_Unrestricted"));
this.text.element.addClass("state-editor-infinite-text");
} else if (v.length === 1) {
this.text.setText(v[0]);
@ -6439,7 +6442,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Single, {
cls: "state-editor-infinite-text bi-disabled",
textAlign: "left",
height: o.height,
text: BI.i18nText("BI-Unrestricted"),
text: BI.i18nText("BI-Basic_Unrestricted"),
hgap: 4,
handler: function () {
self._showInput();
@ -6611,7 +6614,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Single, {
this.text.setText(BI.i18nText("BI-Already_Selected"));
this.text.element.removeClass("state-editor-infinite-text");
} else {
this.text.setText(BI.i18nText("BI-Unrestricted"));
this.text.setText(BI.i18nText("BI-Basic_Unrestricted"));
this.text.element.addClass("state-editor-infinite-text");
}
return;
@ -6621,7 +6624,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Single, {
this.text.setTitle(v);
this.text.element.removeClass("state-editor-infinite-text");
} else if (BI.isEmpty(v)) {
this.text.setText(BI.i18nText("BI-Unrestricted"));
this.text.setText(BI.i18nText("BI-Basic_Unrestricted"));
this.text.element.addClass("state-editor-infinite-text");
} else {
this.text.setText(BI.i18nText("BI-Already_Selected"));
@ -8804,15 +8807,10 @@ BI.Segment = BI.inherit(BI.Widget, {
this.buttonGroup = BI.createWidget({
element: this,
type: "bi.button_group",
items: BI.map(o.items, function (i, item) {
return BI.extend({
items: BI.createItems(o.items, {
type: "bi.segment_button",
height: o.height - 2,
whiteSpace: o.whiteSpace
}, item, {
cls: (i === 0 ? "bi-border-left " : "")
+ (item.cls || "") + " bi-border-top bi-border-right bi-border-bottom"
});
}),
layout: [
{
@ -11981,7 +11979,7 @@ BI.ZeroClip = BI.inherit(BI.BasicButton, {
BI.nextTick(function () {
self.element.zclip({
path: BI.resourceURL + "ZeroClipboard.swf",
path: BI.resourceURL + "/ZeroClipboard.swf",
copy: o.copy,
beforeCopy: o.beforeCopy,
afterCopy: o.afterCopy

89
bi/core.css

@ -3058,19 +3058,21 @@ i {
background: #1a1a1a;
opacity: 0.2;
filter: alpha(opacity=20);
z-index: 1000000000;
z-index: 1000000000 !important;
}
.bi-theme-dark .bi-resizer {
background: #ffffff;
}
.bi-z-index-mask {
color: #ffffff;
background-color: rgba(26, 26, 26, 0.5);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#7f1a1a1a,endColorstr=#7f1a1a1a);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#801a1a1a,endColorstr=#801a1a1a);
}
.bi-list-item:hover,
.bi-list-item.hover {
background-color: #eff1f4;
color: #1a1a1a;
background-color: rgba(26, 26, 26, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d1a1a1a,endColorstr=#0d1a1a1a);
}
.bi-list-item.disabled,
.bi-list-item.disabled:hover,
@ -3085,8 +3087,9 @@ i {
}
.bi-theme-dark .bi-list-item:hover,
.bi-theme-dark .bi-list-item.hover {
background-color: #191b2b;
color: #ffffff;
background-color: rgba(255, 255, 255, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff);
}
.bi-theme-dark .bi-list-item.disabled,
.bi-theme-dark .bi-list-item.disabled:hover,
@ -3099,9 +3102,12 @@ i {
.bi-theme-dark .bi-list-item.disabled:active .bi-high-light {
color: #666666 !important;
}
.bi-list-item-simple {
color: #999999;
}
.bi-list-item-simple:hover,
.bi-list-item-simple.hover {
color: #1a1a1a;
color: #3f8ce8;
}
.bi-list-item-simple.disabled,
.bi-list-item-simple.disabled:hover,
@ -3113,20 +3119,6 @@ i {
.bi-list-item-simple.disabled:active .bi-high-light {
color: #cccccc !important;
}
.bi-theme-dark .bi-list-item-simple:hover,
.bi-theme-dark .bi-list-item-simple.hover {
color: #ffffff;
}
.bi-theme-dark .bi-list-item-simple.disabled,
.bi-theme-dark .bi-list-item-simple.disabled:hover,
.bi-theme-dark .bi-list-item-simple.disabled:active {
color: #666666 !important;
}
.bi-theme-dark .bi-list-item-simple.disabled .bi-high-light,
.bi-theme-dark .bi-list-item-simple.disabled:hover .bi-high-light,
.bi-theme-dark .bi-list-item-simple.disabled:active .bi-high-light {
color: #666666 !important;
}
.bi-list-item-effect:hover {
color: #1a1a1a;
}
@ -3165,12 +3157,14 @@ i {
.bi-list-item-active:hover,
.bi-list-item-active.hover {
color: #1a1a1a;
background-color: #eff1f4;
background-color: rgba(26, 26, 26, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d1a1a1a,endColorstr=#0d1a1a1a);
}
.bi-list-item-active.active,
.bi-list-item-active:active {
color: #3f8ce8;
background-color: #eff1f4;
background-color: rgba(26, 26, 26, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d1a1a1a,endColorstr=#0d1a1a1a);
}
.bi-list-item-active.disabled,
.bi-list-item-active.disabled:hover,
@ -3185,13 +3179,15 @@ i {
}
.bi-theme-dark .bi-list-item-active:hover,
.bi-theme-dark .bi-list-item-active.hover {
background-color: #191b2b;
color: #ffffff;
background-color: rgba(255, 255, 255, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff);
}
.bi-theme-dark .bi-list-item-active.active,
.bi-theme-dark .bi-list-item-active:active {
color: #3f8ce8;
background-color: #191b2b;
background-color: rgba(255, 255, 255, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff);
}
.bi-theme-dark .bi-list-item-active.disabled,
.bi-theme-dark .bi-list-item-active.disabled:hover,
@ -3206,8 +3202,9 @@ i {
}
.bi-list-item-select:hover,
.bi-list-item-select.hover {
color: #3f8ce8;
background-color: #eff1f4;
color: #1a1a1a;
background-color: rgba(26, 26, 26, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d1a1a1a,endColorstr=#0d1a1a1a);
}
.bi-list-item-select:active,
.bi-list-item-select.active {
@ -3231,8 +3228,9 @@ i {
}
.bi-theme-dark .bi-list-item-select:hover,
.bi-theme-dark .bi-list-item-select.hover {
color: #3f8ce8;
background-color: #191b2b;
color: #ffffff;
background-color: rgba(255, 255, 255, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff);
}
.bi-theme-dark .bi-list-item-select:active,
.bi-theme-dark .bi-list-item-select.active {
@ -3254,43 +3252,6 @@ i {
.bi-theme-dark .bi-list-item-select.disabled:active .bi-high-light {
color: #666666 !important;
}
.bi-list-item-choose:hover {
color: #1a1a1a;
}
.bi-list-item-choose:active,
.bi-list-item-choose.active {
color: #ffffff;
background-color: #3f8ce8;
}
.bi-list-item-choose:active .bi-high-light,
.bi-list-item-choose.active .bi-high-light {
color: #ffffff;
}
.bi-list-item-choose.disabled,
.bi-list-item-choose.disabled:hover,
.bi-list-item-choose.disabled:active {
color: #cccccc !important;
background-color: transparent !important;
}
.bi-list-item-choose.disabled .bi-high-light,
.bi-list-item-choose.disabled:hover .bi-high-light,
.bi-list-item-choose.disabled:active .bi-high-light {
color: #cccccc !important;
}
.bi-theme-dark .bi-list-item-choose:hover {
color: #ffffff;
}
.bi-theme-dark .bi-list-item-choose.disabled,
.bi-theme-dark .bi-list-item-choose.disabled:hover,
.bi-theme-dark .bi-list-item-choose.disabled:active {
color: #666666 !important;
background-color: transparent !important;
}
.bi-theme-dark .bi-list-item-choose.disabled .bi-high-light,
.bi-theme-dark .bi-list-item-choose.disabled:hover .bi-high-light,
.bi-theme-dark .bi-list-item-choose.disabled:active .bi-high-light {
color: #666666 !important;
}
/*****************cursor*****************/
.cursor-pointer {
cursor: pointer;

61
bi/core.js

@ -2920,6 +2920,10 @@ if (!window.BI) {
return /(msie|trident)/i.test(navigator.userAgent.toLowerCase());
},
isEdge: function () {
return /edge/i.test(navigator.userAgent.toLowerCase());
},
isChrome: function () {
return /chrome/i.test(navigator.userAgent.toLowerCase());
},
@ -2940,6 +2944,14 @@ if (!window.BI) {
return /Konqueror|Safari|KHTML/i.test(navigator.userAgent);
},
isMac: function () {
return /macintosh|mac os x/i.test(navigator.userAgent);
},
isWindows: function () {
return /windows|win32/i.test(navigator.userAgent);
},
isSupportCss3: function (style) {
var prefix = ['webkit', 'Moz', 'ms', 'o'],
i, len,
@ -6169,19 +6181,19 @@ Date._DN = [BI.i18nText("BI-Basic_Sunday"),
BI.i18nText("BI-Basic_Sunday")];
// short day names
Date._SDN = [BI.i18nText("BI-Day_Ri"),
BI.i18nText("BI-Basic_One"),
BI.i18nText("BI-Basic_Two"),
BI.i18nText("BI-Basic_Three"),
BI.i18nText("BI-Basic_Four"),
BI.i18nText("BI-Basic_Five"),
BI.i18nText("BI-Basic_Six"),
BI.i18nText("BI-Day_Ri")];
Date._SDN = [BI.i18nText("BI-Basic_Simple_Sunday"),
BI.i18nText("BI-Basic_Simple_Monday"),
BI.i18nText("BI-Basic_Simple_Tuesday"),
BI.i18nText("BI-Basic_Simple_Wednesday"),
BI.i18nText("BI-Basic_Simple_Thursday"),
BI.i18nText("BI-Basic_Simple_Friday"),
BI.i18nText("BI-Basic_Simple_Saturday"),
BI.i18nText("BI-Basic_Simple_Sunday")];
// Monday first, etc.
Date._FD = 1;
// full month names
// full month namesdat
Date._MN = [
BI.i18nText("BI-Basic_January"),
BI.i18nText("BI-Basic_February"),
@ -16452,7 +16464,7 @@ BI.extend(jQuery.fn, {
*/
__textKeywordMarked__: function (text, keyword, py) {
if (!BI.isKey(keyword)) {
return this.text(text);
return this.text((text + "").replaceAll(" ", " "));
}
keyword = keyword + "";
keyword = BI.toUpperCase(keyword);
@ -16475,7 +16487,7 @@ BI.extend(jQuery.fn, {
if (tidx >= 0) {
this.append(textLeft.substr(0, tidx));
this.append($("<span>").addClass("bi-keyword-red-mark")
.text(textLeft.substr(tidx, keyword.length)));
.text(textLeft.substr(tidx, keyword.length).replaceAll(" ", " ")));
textLeft = textLeft.substr(tidx + keyword.length);
if (py != null) {
@ -16484,7 +16496,7 @@ BI.extend(jQuery.fn, {
} else if (pidx != null && pidx >= 0 && Math.floor(pidx / text.length) === Math.floor((pidx + keyword.length - 1) / text.length)) {
this.append(textLeft.substr(0, pidx));
this.append($("<span>").addClass("bi-keyword-red-mark")
.text(textLeft.substr(pidx, keyword.length)));
.text(textLeft.substr(pidx, keyword.length).replaceAll(" ", " ")));
if (py != null) {
py = py.substr(pidx + keyword.length);
}
@ -16985,8 +16997,8 @@ BI.extend(jQuery, {
getComboPosition: function (combo, popup, extraWidth, extraHeight, needAdaptHeight, directions, offsetStyle) {
extraWidth || (extraWidth = 0);
extraHeight || (extraHeight = 0);
var maxHeight = $("body").bounds().height - extraHeight;
maxHeight = Math.min(popup.attr("maxHeight") || maxHeight, maxHeight);
var bodyHeight = $("body").bounds().height - extraHeight;
var maxHeight = Math.min(popup.attr("maxHeight") || bodyHeight, bodyHeight);
popup.resetHeight && popup.resetHeight(maxHeight);
var position = $.getComboPositionByDirections(combo, popup, extraWidth, extraHeight, needAdaptHeight, directions || ['bottom', 'top', 'right', 'left']);
switch (offsetStyle) {
@ -17009,6 +17021,7 @@ BI.extend(jQuery, {
}
break;
}
popup.resetHeight && popup.resetHeight(Math.min(bodyHeight - position.top, maxHeight));
return position;
}
});/**
@ -17238,9 +17251,9 @@ $(function () {
return tempValue;
},
rgba2rgb: function (rgbColour, BGcolur) {
if (BI.isNull(BGcolur)) {
BGcolur = 1;
rgba2rgb: function (rgbColour, BGcolor) {
if (BI.isNull(BGcolor)) {
BGcolor = 1;
}
if (rgbColour.substr(0, 4) != "rgba") {
return "";
@ -17254,9 +17267,9 @@ $(function () {
var B = BI.parseFloat(rgbValues[2]);
var A = BI.parseFloat(rgbValues[3]);
return "rgb(" + Math.floor(255 * (BGcolur * (1 - A )) + R * A) + "," +
Math.floor(255 * (BGcolur * (1 - A )) + G * A) + "," +
Math.floor(255 * (BGcolur * (1 - A )) + B * A) + ")";
return "rgb(" + Math.floor(255 * (BGcolor * (1 - A )) + R * A) + "," +
Math.floor(255 * (BGcolor * (1 - A )) + G * A) + "," +
Math.floor(255 * (BGcolor * (1 - A )) + B * A) + ")";
},
getTextSizeWidth: function (text, fontSize) {
@ -17798,16 +17811,16 @@ $(function () {
//注册控件
BI.Plugin.registerWidget("bi.grid_table", function (ob) {
//IE下滚动条滑动效果不好,禁止掉
if (BI.isIE() || BI.isFireFox()) {
//非chrome下滚动条滑动效果不好,禁止掉
if (!(BI.isChrome() && BI.isWindows() && !BI.isEdge())) {
return BI.extend(ob, {type: "bi.quick_grid_table"});
} else {
return ob;
}
});
BI.Plugin.registerWidget("bi.collection_table", function (ob) {
//IE下滚动条滑动效果不好,禁止掉
if (BI.isIE() || BI.isFireFox()) {
//非chrome下滚动条滑动效果不好,禁止掉
if (!(BI.isChrome() && BI.isWindows() && !BI.isEdge())) {
return BI.extend(ob, {type: "bi.quick_collection_table"});
} else {
return ob;

283
bi/widget.js

@ -35,12 +35,6 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, {
this.renderedCells = [];
this.renderedKeys = [];
this.header = BI.createWidget(o.sequenceHeaderCreator || {
type: "bi.table_style_cell",
cls: "sequence-table-title-cell bi-border",
styleGetter: o.headerCellStyleGetter,
text: BI.i18nText("BI-Number_Index")
});
this.container = BI.createWidget({
type: "bi.absolute",
width: 60,
@ -54,13 +48,20 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, {
items: [this.container]
});
this.headerContainer = BI.createWidget({
type: "bi.absolute",
cls: "bi-border",
width: 58,
scrollable: false
});
this.layout = BI.createWidget({
type: "bi.vtape",
element: this,
items: [{
el: this.header,
height: this._getHeaderHeight()
}, {
el: this.headerContainer,
height: this._getHeaderHeight() - 2
}, {el: {type: "bi.layout"}, height: 2}, {
el: this.scrollContainer
}]
});
@ -168,7 +169,7 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, {
_layout: function () {
var self = this, o = this.options;
var headerHeight = this._getHeaderHeight();
var headerHeight = this._getHeaderHeight() - 2;
var items = this.layout.attr("items");
if (o.isNeedFreeze === false) {
items[0].height = 0;
@ -217,6 +218,26 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, {
return Math.max(0, cnt * this.options.rowSize - (this.options.height - this._getHeaderHeight()) + BI.DOM.getScrollWidth());
},
_createHeader: function () {
var o = this.options;
BI.createWidget({
type: "bi.absolute",
element: this.headerContainer,
items: [{
el: o.sequenceHeaderCreator || {
type: "bi.table_style_cell",
cls: "sequence-table-title-cell",
styleGetter: o.headerCellStyleGetter,
text: BI.i18nText("BI-Number_Index")
},
left: 0,
top: 0,
right: 0,
bottom: 0
}]
});
},
_calculateChildrenToRender: function () {
var self = this, o = this.options;
@ -322,7 +343,8 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, {
task.apply(self);
});
this.tasks = [];
this.header.populate && this.header.populate();
this.headerContainer.empty();
this._createHeader();
this._layout();
this._calculateChildrenToRender();
},
@ -4905,7 +4927,7 @@ BI.shortcut('bi.date_combo', BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
hgap: c.hgap,
vgap: c.vgap,
allowBlank: true,
watermark: BI.i18nText("BI-Unrestricted"),
watermark: BI.i18nText("BI-Basic_Unrestricted"),
errorText: function () {
if (self.editor.isEditing()) {
return BI.i18nText("BI-Date_Trigger_Error_Text");
@ -5595,7 +5617,7 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
popup: {
el: this.popupview,
stopPropagation: true,
maxHeight: 400
maxHeight: 1000
}
});
@ -9343,7 +9365,7 @@ BI.MultiSelectCheckPane = BI.inherit(BI.Widget, {
items: opts.items,
itemsCreator: function (op, callback) {
op = BI.extend(op || {}, {
selected_values: self.storeValue.value
selectedValues: self.storeValue.value
});
if (self.storeValue.type === BI.Selection.Multi) {
callback({
@ -9643,7 +9665,10 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
toggle: false,
el: this.trigger,
adjustLength: 1,
popup: this.popup
popup: this.popup,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
@ -9906,7 +9931,7 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
itemsCreator: function (op, callback) {
var startValue = self._startValue;
self.storeValue && (op = BI.extend(op || {}, {
selected_values: BI.isKey(startValue) && self.storeValue.type === BI.Selection.Multi
selectedValues: BI.isKey(startValue) && self.storeValue.type === BI.Selection.Multi
? self.storeValue.value.concat(startValue) : self.storeValue.value
}));
opts.itemsCreator(op, function (ob) {
@ -10318,7 +10343,7 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, {
},
itemsCreator: function (op, callback) {
self.storeValue && (op = BI.extend(op || {}, {
selected_values: self.storeValue.value
selectedValues: self.storeValue.value
}));
opts.itemsCreator(op, function (ob) {
var keyword = ob.keyword = opts.keywordGetter();
@ -10788,13 +10813,13 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
ob.value || (ob.value = []);
if (ob.type === BI.Selection.All) {
if (BI.size(ob.assist) === 1) {
this.editor.setState(o.valueFormatter(ob.assist[0] + "") || ob.assist[0] + "");
this.editor.setState(o.valueFormatter(ob.assist[0] + "") || (ob.assist[0] + ""));
} else {
this.editor.setState(BI.size(ob.value) > 0 ? BI.Selection.Multi : BI.Selection.All);
}
} else {
if (BI.size(ob.value) === 1) {
this.editor.setState(o.valueFormatter(ob.value[0] + "" || ob.value[0] + ""));
this.editor.setState(o.valueFormatter(ob.value[0] + "") || (ob.value[0] + ""));
} else {
this.editor.setState(BI.size(ob.value) > 0 ? BI.Selection.Multi : BI.Selection.None);
}
@ -11266,7 +11291,7 @@ BI.MultiTreeCheckPane = BI.inherit(BI.Pane, {
var self = this, opts = this.options;
this.selected_values = {};
this.selectedValues = {};
var continueSelect = BI.createWidget({
type: 'bi.text_button',
@ -11303,7 +11328,7 @@ BI.MultiTreeCheckPane = BI.inherit(BI.Pane, {
type: "bi.display_tree",
cls: "bi-multi-tree-display",
itemsCreator: function (op, callback) {
op.type = BI.TreeView.REQ_TYPE_SELECTED_DATA;
op.type = BI.TreeView.REQ_TYPE_GET_SELECTED_DATA;
opts.itemsCreator(op, callback);
}
});
@ -11628,7 +11653,7 @@ BI.MultiTreePopup = BI.inherit(BI.Pane, {
var self = this, opts = this.options;
this.selected_values = {};
this.selectedValues = {};
this.tree = BI.createWidget({
type: "bi.sync_tree",
@ -12238,7 +12263,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
this.smallEditor = BI.createWidget({
type: "bi.sign_editor",
height: o.height - 2,
watermark: BI.i18nText("BI-Unrestricted"),
watermark: BI.i18nText("BI-Basic_Unrestricted"),
allowBlank: true,
value: o.min,
level: "warning",
@ -12275,7 +12300,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
this.bigEditor = BI.createWidget({
type: "bi.sign_editor",
height: o.height - 2,
watermark: BI.i18nText("BI-Unrestricted"),
watermark: BI.i18nText("BI-Basic_Unrestricted"),
allowBlank: true,
value: o.max,
level: "warning",
@ -14547,7 +14572,7 @@ BI.shortcut('bi.relation_view', BI.RelationView);/**
BI.RelationViewRegionContainer = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.RelationViewRegionContainer.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-relation-view-region-container bi-card bi-border",
baseCls: "bi-relation-view-region-container",
width: 150
});
},
@ -14701,7 +14726,7 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, {
cls: "relation-view-region-container bi-card bi-border " + (o.belongPackage ? "" : "other-package"),
items: [{
type: "bi.vertical_adapt",
cls: "relation-view-region-title bi-border",
cls: "relation-view-region-title bi-border-bottom",
items: [this.preview, this.title]
}, this.button_group]
}],
@ -15746,12 +15771,6 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, {
this.renderedCells = [];
this.renderedKeys = [];
this.header = BI.createWidget(o.sequenceHeaderCreator || {
type: "bi.table_style_cell",
cls: "sequence-table-title-cell bi-border",
styleGetter: o.headerCellStyleGetter,
text: BI.i18nText("BI-Number_Index")
});
this.container = BI.createWidget({
type: "bi.absolute",
width: 60,
@ -15765,12 +15784,19 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, {
items: [this.container]
});
this.headerContainer = BI.createWidget({
type: "bi.absolute",
cls: "bi-border",
width: 58,
scrollable: false
});
this.layout = BI.createWidget({
type: "bi.vtape",
element: this,
items: [{
el: this.header,
height: o.headerRowSize * o.header.length
el: this.headerContainer,
height: o.headerRowSize * o.header.length - 2
}, {
el: this.scrollContainer
}]
@ -15793,6 +15819,26 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, {
this.scrollContainer.element.scrollTop(o.scrollTop);
},
_createHeader: function () {
var o = this.options;
BI.createWidget({
type: "bi.absolute",
element: this.headerContainer,
items: [{
el: o.sequenceHeaderCreator || {
type: "bi.table_style_cell",
cls: "sequence-table-title-cell",
styleGetter: o.headerCellStyleGetter,
text: BI.i18nText("BI-Number_Index")
},
left: 0,
top: 0,
right: 0,
bottom: 0
}]
});
},
_calculateChildrenToRender: function () {
var self = this, o = this.options;
var scrollTop = BI.clamp(o.scrollTop, 0, o.rowSize * o.items.length - (o.height - o.header.length * o.headerRowSize) + BI.DOM.getScrollWidth());
@ -15870,7 +15916,8 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, {
},
_populate: function () {
this.header.populate && this.header.populate();
this.headerContainer.empty();
this._createHeader();
this._layout();
this._calculateChildrenToRender();
},
@ -16958,8 +17005,8 @@ BI.AllValueChooserCombo = BI.inherit(BI.Widget, {
var search = BI.Func.getSearchResult(items, kw);
items = search.matched.concat(search.finded);
});
if (options.selected_values) {//过滤
var filter = BI.makeObject(options.selected_values, true);
if (options.selectedValues) {//过滤
var filter = BI.makeObject(options.selectedValues, true);
items = BI.filter(items, function (i, ob) {
return !filter[ob.value];
});
@ -17086,10 +17133,10 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
case BI.TreeView.REQ_TYPE_ADJUST_DATA:
self._reqAdjustTreeNode(options, callback);
break;
case BI.TreeView.REQ_TYPE_CALCULATE_SELECT_DATA:
case BI.TreeView.REQ_TYPE_SELECT_DATA:
self._reqSelectedTreeNode(options, callback);
break;
case BI.TreeView.REQ_TYPE_SELECTED_DATA:
case BI.TreeView.REQ_TYPE_GET_SELECTED_DATA:
self._reqDisplayTreeNode(options, callback);
break;
default :
@ -17102,27 +17149,27 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
_reqDisplayTreeNode: function (op, callback) {
var self = this;
var result = [];
var selected_values = op.selected_values;
var selectedValues = op.selectedValues;
if (selected_values == null || BI.isEmpty(selected_values)) {
if (selectedValues == null || BI.isEmpty(selectedValues)) {
callback({});
return;
}
doCheck(0, [], selected_values);
doCheck(0, [], selectedValues);
callback({
items: result
});
function doCheck(floor, parent_values, selected) {
function doCheck(floor, parentValues, selected) {
if (floor >= self.floors) {
return;
}
if (selected == null || BI.isEmpty(selected)) {
var children = self._getChildren(parent_values);
var children = self._getChildren(parentValues);
BI.each(children, function (i, child) {
var newParents = BI.clone(parent_values);
var newParents = BI.clone(parentValues);
newParents.push(child.value);
var llen = self._getChildCount(newParents);
createOneJson(child, llen);
@ -17132,19 +17179,19 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
}
BI.each(selected, function (k) {
var node = self._getNode(k);
var newParents = BI.clone(parent_values);
var newParents = BI.clone(parentValues);
newParents.push(node.value);
createOneJson(node, getCount(selected[k], newParents));
doCheck(floor + 1, newParents, selected[k]);
})
}
function getCount(jo, parent_values) {
function getCount(jo, parentValues) {
if (jo == null) {
return 0;
}
if (BI.isEmpty(jo)) {
return self._getChildCount(parent_values);
return self._getChildCount(parentValues);
}
return BI.size(jo);
@ -17163,30 +17210,30 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
_reqSelectedTreeNode: function (op, callback) {
var self = this;
var selected_values = op.selected_values;
var not_selected_value = op.not_selected_value || {};
var selectedValues = op.selectedValues;
var notSelectedValue = op.notSelectedValue || {};
var keyword = op.keyword || "";
var parent_values = op.parent_values || [];
var parentValues = op.parentValues || [];
if (selected_values == null || BI.isEmpty(selected_values)) {
if (selectedValues == null || BI.isEmpty(selectedValues)) {
callback({});
return;
}
dealWithSelectedValues(selected_values);
callback(selected_values);
dealWithSelectedValues(selectedValues);
callback(selectedValues);
function dealWithSelectedValues(selected_values) {
var p = BI.clone(parent_values);
p.push(not_selected_value);
function dealWithSelectedValues(selectedValues) {
var p = BI.clone(parentValues);
p.push(notSelectedValue);
if (isChild(selected_values, p)) {
if (isChild(selectedValues, p)) {
var result = [];
var finded = search(parent_values.length + 1, parent_values, not_selected_value, result);
var finded = search(parentValues.length + 1, parentValues, notSelectedValue, result);
if (finded === true) {
var next = selected_values;
var next = selectedValues;
BI.each(p, function (i, v) {
var t = next[v];
if (t == null) {
@ -17194,7 +17241,7 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
var split = p.slice(0, i);
var expanded = self._getChildren(split);
BI.each(expanded, function (m, child) {
if (i === p.length - 1 && child.value === not_selected_value) {
if (i === p.length - 1 && child.value === notSelectedValue) {
return true;
}
next[child.value] = {};
@ -17211,7 +17258,7 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
if (result.length > 0) {
BI.each(result, function (i, strs) {
self._buildTree(selected_values, strs);
self._buildTree(selectedValues, strs);
})
}
}
@ -17251,8 +17298,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return can;
}
function isChild(selected_values, parents) {
var t = selected_values;
function isChild(selectedValues, parents) {
var t = selectedValues;
for (var i = 0; i < parents.length; i++) {
var v = parents[i];
if (!BI.has(t, v)) {
@ -17270,16 +17317,16 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
_reqAdjustTreeNode: function (op, callback) {
var self = this;
var result = [];
var selected_values = op.selected_values;
if (selected_values == null || BI.isEmpty(selected_values)) {
var selectedValues = op.selectedValues;
if (selectedValues == null || BI.isEmpty(selectedValues)) {
callback({});
return;
}
BI.each(selected_values, function (k, v) {
BI.each(selectedValues, function (k, v) {
result.push([k]);
});
dealWithSelectedValues(selected_values, []);
dealWithSelectedValues(selectedValues, []);
var jo = {};
BI.each(result, function (i, strs) {
@ -17316,23 +17363,23 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
var self = this;
var result = [];
var keyword = op.keyword || "";
var selected_values = op.selected_values;
var last_search_value = op.last_search_value || "";
var selectedValues = op.selectedValues;
var lastSearchValue = op.lastSearchValue || "";
var output = search();
BI.nextTick(function () {
callback({
hasNext: output.length > self._const.perPage,
items: result,
last_search_value: BI.last(output)
lastSearchValue: BI.last(output)
})
});
function search() {
var children = self._getChildren([]);
var start = children.length;
if (last_search_value !== "") {
if (lastSearchValue !== "") {
for (var j = 0, len = start; j < len; j++) {
if (children[j].value === last_search_value) {
if (children[j].value === lastSearchValue) {
start = j + 1;
break;
}
@ -17357,22 +17404,22 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return output;
}
function nodeSearch(deep, parent_values, current, isAllSelect, result) {
function nodeSearch(deep, parentValues, current, isAllSelect, result) {
if (self._isMatch(current, keyword)) {
var checked = isAllSelect || isSelected(parent_values, current);
createOneJson(parent_values, current, false, checked, !isAllSelect && isHalf(parent_values, current), true, result);
var checked = isAllSelect || isSelected(parentValues, current);
createOneJson(parentValues, current, false, checked, !isAllSelect && isHalf(parentValues, current), true, result);
return [true, checked];
}
if (deep >= self.floors) {
return [false, false];
}
var newParents = BI.clone(parent_values);
var newParents = BI.clone(parentValues);
newParents.push(current);
var children = self._getChildren(newParents);
var can = false, checked = false;
var isCurAllSelected = isAllSelect || isAllSelected(parent_values, current);
var isCurAllSelected = isAllSelect || isAllSelected(parentValues, current);
BI.each(children, function (i, child) {
var state = nodeSearch(deep + 1, newParents, child.value, isCurAllSelected, result);
if (state[1] === true) {
@ -17383,13 +17430,13 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
}
});
if (can === true) {
checked = isCurAllSelected || (isSelected(parent_values, current) && checked);
createOneJson(parent_values, current, true, checked, false, false, result);
checked = isCurAllSelected || (isSelected(parentValues, current) && checked);
createOneJson(parentValues, current, true, checked, false, false, result);
}
return [can, checked];
}
function createOneJson(parent_values, value, isOpen, checked, half, flag, result) {
function createOneJson(parentValues, value, isOpen, checked, half, flag, result) {
var node = self.map[value];
result.push({
id: node.id,
@ -17397,7 +17444,7 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
text: node.text,
value: node.value,
title: node.title,
isParent: parent_values.length + 1 < self.floors,
isParent: parentValues.length + 1 < self.floors,
open: isOpen,
checked: checked,
halfCheck: half,
@ -17405,8 +17452,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
});
}
function isHalf(parent_values, value) {
var find = findSelectedObj(parent_values);
function isHalf(parentValues, value) {
var find = findSelectedObj(parentValues);
if (find == null) {
return null;
}
@ -17419,8 +17466,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
});
}
function isAllSelected(parent_values, value) {
var find = findSelectedObj(parent_values);
function isAllSelected(parentValues, value) {
var find = findSelectedObj(parentValues);
if (find == null) {
return null;
}
@ -17433,8 +17480,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
});
}
function isSelected(parent_values, value) {
var find = findSelectedObj(parent_values);
function isSelected(parentValues, value) {
var find = findSelectedObj(parentValues);
if (find == null) {
return false;
}
@ -17445,12 +17492,12 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
});
}
function findSelectedObj(parent_values) {
var find = selected_values;
function findSelectedObj(parentValues) {
var find = selectedValues;
if (find == null) {
return null;
}
BI.every(parent_values, function (i, v) {
BI.every(parentValues, function (i, v) {
find = find[v];
if (find == null) {
return false;
@ -17465,23 +17512,23 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
var self = this;
var result = [];
var times = op.times;
var check_state = op.check_state || {};
var parent_values = op.parent_values || [];
var selected_values = op.selected_values;
var checkState = op.checkState || {};
var parentValues = op.parentValues || [];
var selectedValues = op.selectedValues;
var valueMap = {};
if (judgeState(parent_values, selected_values, check_state)) {
valueMap = dealWidthSelectedValue(parent_values, selected_values);
if (judgeState(parentValues, selectedValues, checkState)) {
valueMap = dealWidthSelectedValue(parentValues, selectedValues);
}
var nodes = this._getChildren(parent_values);
var nodes = this._getChildren(parentValues);
for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) {
var state = getCheckState(nodes[i].value, parent_values, valueMap, check_state);
var state = getCheckState(nodes[i].value, parentValues, valueMap, checkState);
result.push({
id: nodes[i].id,
pId: nodes[i].pId,
value: nodes[i].value,
text: nodes[i].text,
times: 1,
isParent: parent_values.length + 1 < this.floors,
isParent: parentValues.length + 1 < this.floors,
checked: state[0],
halfCheck: state[1]
})
@ -17493,20 +17540,20 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
});
});
function judgeState(parent_values, selected_value, check_state) {
var checked = check_state.checked, half = check_state.half;
if (parent_values.length > 0 && !checked) {
function judgeState(parentValues, selected_value, checkState) {
var checked = checkState.checked, half = checkState.half;
if (parentValues.length > 0 && !checked) {
return false;
}
return (parent_values.length === 0 || (checked && half) && !BI.isEmpty(selected_value));
return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value));
}
function dealWidthSelectedValue(parent_values, selected_values) {
function dealWidthSelectedValue(parentValues, selectedValues) {
var valueMap = {};
BI.each(parent_values, function (i, v) {
selected_values = selected_values[v];
BI.each(parentValues, function (i, v) {
selectedValues = selectedValues[v];
});
BI.each(selected_values, function (value, obj) {
BI.each(selectedValues, function (value, obj) {
if (BI.isNull(obj)) {
valueMap[value] = [0, 0];
return;
@ -17526,14 +17573,14 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return valueMap;
}
function getCheckState(current, parent_values, valueMap, check_state) {
var checked = check_state.checked, half = check_state.half;
var hasChild = parent_values.length + 1 < self.floors;
function getCheckState(current, parentValues, valueMap, checkState) {
var checked = checkState.checked, half = checkState.half;
var hasChild = parentValues.length + 1 < self.floors;
var tempCheck = false, halfCheck = false;
if (BI.has(valueMap, current)) {
//可能是半选
if (valueMap[current][0] === 1) {
var values = BI.clone(parent_values);
var values = BI.clone(parentValues);
values.push(current);
if (hasChild && self._getChildCount(values) != valueMap[current][1]) {
halfCheck = true;
@ -17572,9 +17619,9 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return this.tree.search(v, "value");
},
_getChildren: function (parent_values) {
if (parent_values.length > 0) {
var value = BI.last(parent_values);
_getChildren: function (parentValues) {
if (parentValues.length > 0) {
var value = BI.last(parentValues);
var parent = this.tree.search(value, "value");
} else {
var parent = this.tree.getRoot();
@ -17582,8 +17629,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return parent.getChildren();
},
_getChildCount: function (parent_values) {
return this._getChildren(parent_values).length;
_getChildCount: function (parentValues) {
return this._getChildren(parentValues).length;
},
setValue: function (v) {
@ -17685,8 +17732,8 @@ BI.ValueChooserCombo = BI.inherit(BI.Widget, {
var search = BI.Func.getSearchResult(items, kw);
items = search.matched.concat(search.finded);
});
if (options.selected_values) {//过滤
var filter = BI.makeObject(options.selected_values, true);
if (options.selectedValues) {//过滤
var filter = BI.makeObject(options.selectedValues, true);
items = BI.filter(items, function (i, ob) {
return !filter[ob.value];
});

4
demo/dist/demo.js vendored

@ -4703,8 +4703,8 @@ Demo.MultiSelectCombo = BI.inherit(BI.Widget, {
var search = BI.Func.getSearchResult(items, kw);
items = search.matched.concat(search.finded);
});
if (options.selected_values) {//过滤
var filter = BI.makeObject(options.selected_values, true);
if (options.selectedValues) {//过滤
var filter = BI.makeObject(options.selectedValues, true);
items = BI.filter(items, function (i, ob) {
return !filter[ob.value];
});

4
demo/js/component/demo.treevaluechooser.js

@ -7,8 +7,8 @@ Demo.TreeValueChooser = BI.inherit(BI.Widget, {
var tree = [];
for (var i = 0; i < 21; i++) {
tree.push({
value: i + "",
text: i + "",
value: " " + i + "",
text: " " + i + "",
id: i + "",
pId: null
});

58
demo/js/core/abstract/combination/demo.sercher.js

@ -0,0 +1,58 @@
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var items = [{
type: "bi.label",
value: "张三"
}, {
type: "bi.label",
value: "李四"
}];
var popup = BI.createWidget({
type: "bi.button_group",
cls: "bi-border",
items: items,
layouts: [{
type: "bi.vertical"
}]
});
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.searcher",
listeners: [{
eventName: BI.Searcher.EVENT_STOP,
action: function () {
popup.populate(items)
}
}, {
eventName: BI.Searcher.EVENT_PAUSE,
action: function () {
popup.populate(items)
}
}],
adapter: {
getItems: function () {
return items
}
},
popup: popup,
masker: false
},
left: 0,
right: 0,
top: 0
}, {
el: popup,
left: 0,
right: 0,
top: 50,
bottom: 0
}]
}
}
});
BI.shortcut("demo.searcher", Demo.Func);

4
demo/js/widget/demo.multiselectcombo.js

@ -44,8 +44,8 @@ Demo.MultiSelectCombo = BI.inherit(BI.Widget, {
var search = BI.Func.getSearchResult(items, kw);
items = search.matched.concat(search.finded);
});
if (options.selected_values) {//过滤
var filter = BI.makeObject(options.selected_values, true);
if (options.selectedValues) {//过滤
var filter = BI.makeObject(options.selectedValues, true);
items = BI.filter(items, function (i, ob) {
return !filter[ob.value];
});

70
docs/base.css

@ -74,12 +74,6 @@
/****添加计算宽度的--运算符直接需要space****/
/****** common color(常用颜色,可用于普遍场景) *****/
/**** custom color(自定义颜色,用于特定场景) ****/
/************hing light*****************/
.bi-z-index-mask {
background-color: #1a1a1a;
opacity: 0.5;
filter: alpha(opacity=50);
}
/****添加计算宽度的--运算符直接需要space****/
/****** common color(常用颜色,可用于普遍场景) *****/
/**** custom color(自定义颜色,用于特定场景) ****/
@ -678,8 +672,13 @@ li.CodeMirror-hint-active {
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
background: #ffffff;
border-right: 1px solid #d4dadd;
border-top: 1px solid #d4dadd;
border-bottom: 1px solid #d4dadd;
}
.bi-segment > .first-element {
border-left: 1px solid #d4dadd;
-webkit-border-radius: 6px 0px 0px 6px;
-moz-border-radius: 6px 0px 0px 6px;
border-radius: 6px 0px 0px 6px;
@ -689,6 +688,18 @@ li.CodeMirror-hint-active {
-moz-border-radius: 0px 6px 6px 0px;
border-radius: 0px 6px 6px 0px;
}
.bi-theme-dark .bi-segment > .center-element {
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
background: #242640;
border-right: 1px solid #525466;
border-top: 1px solid #525466;
border-bottom: 1px solid #525466;
}
.bi-theme-dark .bi-segment > .first-element {
border-left: 1px solid #242640;
}
/****添加计算宽度的--运算符直接需要space****/
/****** common color(常用颜色,可用于普遍场景) *****/
/**** custom color(自定义颜色,用于特定场景) ****/
@ -746,7 +757,7 @@ li.CodeMirror-hint-active {
.bi-button.button-common.disabled,
.bi-button.button-success.disabled,
.bi-button.button-warning.disabled {
background: #c4c6c6 !important;
background: #cccccc !important;
border-color: #c4c6c6 !important;
}
.bi-button.button-common.disabled,
@ -1098,12 +1109,12 @@ li.CodeMirror-hint-active {
transition-timing-function: ease;
user-select: none;
background-color: rgba(102, 102, 102, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0D666666,endColorstr=#0D666666);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d666666,endColorstr=#0d666666);
border-radius: 5px;
}
.bi-theme-dark .scrollbar-layout-main {
background-color: rgba(204, 204, 204, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0Dcccccc,endColorstr=#0Dcccccc);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dcccccc,endColorstr=#0dcccccc);
}
.scrollbar-layout-main-vertical {
bottom: 0;
@ -1122,11 +1133,11 @@ li.CodeMirror-hint-active {
left: 0;
transition-property: background-color;
background-color: rgba(102, 102, 102, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0D666666,endColorstr=#0D666666);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d666666,endColorstr=#0d666666);
}
.bi-theme-dark .scrollbar-layout-main-horizontal {
background-color: rgba(204, 204, 204, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0Dcccccc,endColorstr=#0Dcccccc);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dcccccc,endColorstr=#0dcccccc);
}
/* Touching the scroll-track directly makes the scroll-track bolder */
.scrollbar-layout-main-horizontal.public-scrollbar-main-active,
@ -1180,23 +1191,23 @@ li.CodeMirror-hint-active {
/* Touching the scroll-track directly makes the scroll-track bolder */
.public-scrollbar-face:after {
background-color: rgba(102, 102, 102, 0.3);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4C666666,endColorstr=#4C666666);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4d666666,endColorstr=#4d666666);
}
.bi-theme-dark .public-scrollbar-face:after {
background-color: rgba(204, 204, 204, 0.3);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4Ccccccc,endColorstr=#4Ccccccc);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4dcccccc,endColorstr=#4dcccccc);
}
.public-scrollbar-main:hover .public-scrollbar-face:after,
.public-scrollbar-main-active .public-scrollbar-face:after,
.public-scrollbar-faceActive:after {
background-color: rgba(102, 102, 102, 0.7);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#B2666666,endColorstr=#B2666666);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#b3666666,endColorstr=#b3666666);
}
.bi-theme-dark .public-scrollbar-main:hover .public-scrollbar-face:after,
.bi-theme-dark .public-scrollbar-main-active .public-scrollbar-face:after,
.bi-theme-dark .public-scrollbar-faceActive:after {
background-color: rgba(204, 204, 204, 0.7);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#B2cccccc,endColorstr=#B2cccccc);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#b3cccccc,endColorstr=#b3cccccc);
}
.horizontal-scrollbar {
bottom: 0;
@ -1241,35 +1252,6 @@ li.CodeMirror-hint-active {
/****添加计算宽度的--运算符直接需要space****/
/****** common color(常用颜色,可用于普遍场景) *****/
/**** custom color(自定义颜色,用于特定场景) ****/
.bi-display-tree .ztree * {
color: #808080;
}
.bi-display-tree .ztree li span.button.switch.center_open {
background-image: url("/icon/tree-vertical-line-3.png");
}
.bi-display-tree .ztree li span.button.switch.roots_open {
background-image: url("/icon/tree-vertical-line-2.png");
}
.bi-display-tree .ztree li span.button.switch.bottom_open {
background-image: url("/icon/tree-vertical-line-4.png");
}
.bi-display-tree .ztree li a,
.bi-display-tree .ztree li span {
cursor: default !important;
}
.bi-display-tree .ztree li a:hover {
text-decoration: none;
}
.bi-display-tree .ztree li a.curSelectedNode {
padding-top: 1px;
border: none;
background-color: inherit;
opacity: 1;
filter: alpha(opacity=100);
}
/****添加计算宽度的--运算符直接需要space****/
/****** common color(常用颜色,可用于普遍场景) *****/
/**** custom color(自定义颜色,用于特定场景) ****/
.bi-trigger .bi-trigger-icon-button {
font-size: 16px;
}

482
docs/base.js

@ -577,7 +577,7 @@ BI.Text = BI.inherit(BI.Single, {
setText: function (text) {
BI.Text.superclass.setText.apply(this, arguments);
this.options.text = text;
this.text.element.html(BI.escape(text).replaceAll(" ", "&nbsp;"));
this.text.element.text((text + "").replaceAll(" ", " "));
}
});
@ -767,12 +767,14 @@ BI.BasicButton = BI.inherit(BI.Single, {
});
break;
default:
if (o.stopEvent || o.stopPropagation) {
hand.mousedown(function (e) {
ev(e);
});
hand.mouseup(function (e) {
ev(e);
});
}
hand.click(clk);
break;
}
@ -1596,8 +1598,8 @@ BI.TreeView = BI.inherit(BI.Pane, {
treeNode.times = treeNode.times || 1;
var param = "id=" + treeNode.id
+ "&times=" + (treeNode.times++)
+ "&parent_values= " + window.encodeURIComponent(BI.jsonEncode(parentNode))
+ "&check_state=" + window.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus()));
+ "&parentValues= " + window.encodeURIComponent(BI.jsonEncode(parentNode))
+ "&checkState=" + window.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus()));
return BI.servletURL + '?op=' + self.options.op + '&cmd=' + self.options.cmd + "&" + param;
}
@ -1728,7 +1730,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
this._buildTree(map, path);
return;
}
var storeValues = BI.deepClone(this.options.paras.selected_values);
var storeValues = BI.deepClone(this.options.paras.selectedValues);
var treeNode = this._getTree(storeValues, path);
this._addTreeNode(map, parent, this._getNodeValue(node), treeNode);
},
@ -1793,14 +1795,15 @@ BI.TreeView = BI.inherit(BI.Pane, {
//处理节点
_dealWidthNodes: function (nodes) {
var self = this, o = this.options;
//处理标红
if (BI.isKey(o.paras.keyword)) {
var keyword = o.paras.keyword;
var ns = BI.Tree.arrayFormat(nodes);
BI.each(ns, function (i, n) {
n.text = $("<div>").__textKeywordMarked__(n.text, keyword, n.py).html();
});
//处理标红
if (BI.isKey(o.paras.keyword)) {
n.text = $("<div>").__textKeywordMarked__(n.text, o.paras.keyword, n.py).html();
} else {
n.text = (n.text + "").replaceAll(" ", " ");
}
});
return nodes;
},
@ -1843,8 +1846,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
};
var op = BI.extend({}, o.paras, {
times: 1,
type: BI.TreeView.REQ_TYPE_INIT_DATA
times: 1
});
o.itemsCreator(op, function (res) {
@ -1886,7 +1888,8 @@ BI.TreeView = BI.inherit(BI.Pane, {
},
view: {
showIcon: false,
expandSpeed: ""
expandSpeed: "",
nameIsHTML: true
},
callback: {}
};
@ -1936,8 +1939,8 @@ BI.TreeView = BI.inherit(BI.Pane, {
},
setSelectedValue: function (value) {
this.options.paras.selected_values = value || {};
this.selected_values = BI.deepClone(value) || {};
this.options.paras.selectedValues = value || {};
this.selectedValues = BI.deepClone(value) || {};
},
updateValue: function (values, param) {
@ -1977,10 +1980,10 @@ BI.TreeView = BI.inherit(BI.Pane, {
}
});
BI.extend(BI.TreeView, {
REQ_TYPE_INIT_DATA: 0,
REQ_TYPE_ADJUST_DATA: 1,
REQ_TYPE_CALCULATE_SELECT_DATA: 2,
REQ_TYPE_SELECTED_DATA: 3
REQ_TYPE_INIT_DATA: 1,
REQ_TYPE_ADJUST_DATA: 2,
REQ_TYPE_SELECT_DATA: 3,
REQ_TYPE_GET_SELECTED_DATA: 4
});
BI.TreeView.EVENT_CHANGE = "EVENT_CHANGE";
@ -2088,21 +2091,21 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
_selectTreeNode: function (treeId, treeNode) {
var self = this, o = this.options;
var parent_values = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode));
var parentValues = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode));
var name = this._getNodeValue(treeNode)
// var values = parent_values.concat([name]);
// var values = parentValues.concat([name]);
if (treeNode.checked === true) {
} else {
var tNode = treeNode;
var pNode = this._getTree(this.selected_values, parent_values);
var pNode = this._getTree(this.selectedValues, parentValues);
if (BI.isNotNull(pNode[name])) {
delete pNode[name];
}
while (tNode != null && BI.isEmpty(pNode)) {
parent_values = parent_values.slice(0, parent_values.length - 1);
parentValues = parentValues.slice(0, parentValues.length - 1);
tNode = tNode.getParentNode();
if (tNode != null) {
pNode = this._getTree(this.selected_values, parent_values);
pNode = this._getTree(this.selectedValues, parentValues);
name = this._getNodeValue(tNode);
delete pNode[name];
}
@ -2118,8 +2121,8 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
var op = BI.extend({}, o.paras, {
"id": treeNode.id,
"times": 1,
"parent_values": parentValues.concat(this._getNodeValue(treeNode)),
"check_state": treeNode.getCheckStatus()
"parentValues": parentValues.concat(this._getNodeValue(treeNode)),
"checkState": treeNode.getCheckStatus()
});
var complete = function (d) {
var nodes = d.items || [];
@ -2167,7 +2170,7 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
},
hasChecked: function () {
return !BI.isEmpty(this.selected_values) || BI.SyncTree.superclass.hasChecked.apply(this, arguments);
return !BI.isEmpty(this.selectedValues) || BI.SyncTree.superclass.hasChecked.apply(this, arguments);
},
getValue: function () {
@ -2176,12 +2179,12 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
}
var checkedValues = this._getSelectedValues();
if (BI.isEmpty(checkedValues)) {
return this.selected_values;
return this.selectedValues;
}
if (BI.isEmpty(this.selected_values)) {
if (BI.isEmpty(this.selectedValues)) {
return checkedValues;
}
return this._join(checkedValues, this.selected_values);
return this._join(checkedValues, this.selectedValues);
},
//生成树方法
@ -2189,7 +2192,7 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
delete this.options.keyword;
BI.extend(this.options.paras, config);
//取消选中时使用
this.selected_values = BI.deepClone(this.options.paras.selected_values) || {};
this.selectedValues = BI.deepClone(this.options.paras.selectedValues) || {};
var setting = this._configSetting();
this._initTree(setting);
}
@ -2219,7 +2222,7 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
this.tip.setLoading();
o.itemsCreator(op, function (d) {
var hasNext = !!d.hasNext, nodes = d.items || [];
o.paras.last_search_value = d.last_search_value;
o.paras.lastSearchValue = d.lastSearchValue;
if (self._stop === true) {
return;
}
@ -2236,35 +2239,35 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
_selectTreeNode: function (treeId, treeNode) {
var self = this, o = this.options;
var parent_values = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode));
var parentValues = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode));
var name = this._getNodeValue(treeNode)
// var values = parent_values.concat([name]);
// var values = parentValues.concat([name]);
if (treeNode.checked === true) {
BI.SyncTree.superclass._selectTreeNode.apply(self, arguments);
} else {
o.itemsCreator(BI.extend({}, o.paras, {
type: BI.TreeView.REQ_TYPE_CALCULATE_SELECT_DATA,
selected_values: this.selected_values,
not_selected_value: name,
parent_values: parent_values
selectedValues: this.selectedValues,
notSelectedValue: name,
parentValues: parentValues
}), function (new_values) {
if (BI.isEqual(self.selected_values, new_values)) {
if (BI.isEqual(self.selectedValues, new_values)) {
var tNode = treeNode;
var pNode = self._getTree(new_values, parent_values);
var pNode = self._getTree(new_values, parentValues);
if (pNode[name]) {
delete pNode[name];
}
while (tNode != null && BI.isEmpty(pNode)) {
parent_values = parent_values.slice(0, parent_values.length - 1);
parentValues = parentValues.slice(0, parentValues.length - 1);
tNode = tNode.getParentNode();
if (tNode != null) {
pNode = self._getTree(new_values, parent_values);
pNode = self._getTree(new_values, parentValues);
name = self._getNodeValue(tNode);
delete pNode[name];
}
}
}
self.selected_values = new_values;
self.selectedValues = new_values;
BI.SyncTree.superclass._selectTreeNode.apply(self, arguments);
});
}
@ -2317,7 +2320,7 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
return;
}
var hasNext = !!d.hasNext, nodes = d.items || [];
o.paras.last_search_value = d.last_search_value;
o.paras.lastSearchValue = d.lastSearchValue;
if (nodes.length > 0) {
callback(self._dealWidthNodes(nodes));
}
@ -2348,7 +2351,7 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
var result = BI.PartTree.superclass.getValue.apply(this, arguments);
o.itemsCreator({
type: BI.TreeView.REQ_TYPE_ADJUST_DATA,
selected_values: result
selectedValues: result
}, function (res) {
result = res;
});
@ -2360,10 +2363,10 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
var o = this.options;
delete o.paras.keyword;
BI.extend(o.paras, config);
delete o.paras.last_search_value;
delete o.paras.lastSearchValue;
//取消选中时使用
this.selected_values = BI.deepClone(o.paras.selected_values) || {};
//delete this.options.paras.selected_values;
this.selectedValues = BI.deepClone(o.paras.selectedValues) || {};
//delete this.options.paras.selectedValues;
var setting = this._configSetting();
this._initTree(setting, o.paras.keyword);
}
@ -4103,7 +4106,6 @@ BI.Searcher = BI.inherit(BI.Widget, {
callback([])
},
el: {
type: "bi.search_editor"
},
@ -4161,16 +4163,11 @@ BI.Searcher = BI.inherit(BI.Widget, {
_assertPopupView: function () {
var self = this, o = this.options;
if (!BI.Maskers.has(this.getName())) {
if ((o.masker && !BI.Maskers.has(this.getName())) || (o.masker === false && !this.popupView)) {
this.popupView = BI.createWidget(o.popup, {
type: "bi.searcher_view",
chooseType: o.chooseType
});
BI.Maskers.create(this.getName(), o.adapter, BI.extend({
container: this,
render: this.popupView
}, o.masker));
this.popupView.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
@ -4197,6 +4194,12 @@ BI.Searcher = BI.inherit(BI.Widget, {
self.fireEvent(BI.Searcher.EVENT_AFTER_INIT);
});
}
if (o.masker && !BI.Maskers.has(this.getName())) {
BI.Maskers.create(this.getName(), o.adapter, BI.extend({
container: this,
render: this.popupView
}, o.masker));
}
},
_startSearch: function () {
@ -4218,7 +4221,7 @@ BI.Searcher = BI.inherit(BI.Widget, {
BI.nextTick(function (name) {
BI.Maskers.hide(name);
}, this.getName());
if (BI.Maskers.has(name) && this._isSearching === true) {
if (this._isSearching === true) {
this.popupView && this.popupView.pauseSearch && this.popupView.pauseSearch();
this.fireEvent(BI.Searcher.EVENT_PAUSE);
}
@ -4229,11 +4232,7 @@ BI.Searcher = BI.inherit(BI.Widget, {
var o = this.options, name = this.getName();
this._stop = true;
BI.Maskers.hide(name);
if (BI.Maskers.has(name) && this._isSearching === true) {
//搜索后清空dom
// BI.nextTick(function () {
// BI.Maskers.has(name) && BI.Maskers.get(name).empty();
// });
if (this._isSearching === true) {
this.popupView && this.popupView.stopSearch && this.popupView.stopSearch();
this.fireEvent(BI.Searcher.EVENT_STOP);
}
@ -4246,11 +4245,11 @@ BI.Searcher = BI.inherit(BI.Widget, {
return;
}
if (o.isAutoSearch) {
var items = (o.adapter.getItems && o.adapter.getItems()) || o.adapter.attr("items") || [];
var items = (o.adapter && ((o.adapter.getItems && o.adapter.getItems()) || o.adapter.attr("items"))) || [];
var finding = BI.Func.getSearchResult(items, keyword);
var matched = finding.matched, finded = finding.finded;
this.popupView.populate(finded, matched, keyword);
o.isAutoSync && this.popupView.setValue(o.adapter.getValue());
o.isAutoSync && o.adapter && o.adapter.getValue && this.popupView.setValue(o.adapter.getValue());
self.fireEvent(BI.Searcher.EVENT_SEARCHING);
return;
}
@ -4267,7 +4266,7 @@ BI.Searcher = BI.inherit(BI.Widget, {
}
BI.Maskers.show(self.getName());
self.popupView.populate.apply(self.popupView, args);
o.isAutoSync && self.popupView.setValue(o.adapter && o.adapter.getValue());
o.isAutoSync && o.adapter && o.adapter.getValue && self.popupView.setValue(o.adapter.getValue());
self.popupView.loaded && self.popupView.loaded();
self.fireEvent(BI.Searcher.EVENT_SEARCHING);
}
@ -4341,13 +4340,15 @@ BI.Searcher = BI.inherit(BI.Widget, {
getValue: function () {
var o = this.options;
if (o.isAutoSync) {
if (o.isAutoSync && o.adapter && o.adapter.getValue) {
return o.adapter.getValue();
}
if (this.isSearching()) {
return this.popupView.getValue();
} else {
} else if (o.adapter && o.adapter.getValue) {
return o.adapter.getValue();
} else {
return this.popupView.getValue();
}
},
@ -4355,7 +4356,7 @@ BI.Searcher = BI.inherit(BI.Widget, {
var o = this.options;
this._assertPopupView();
this.popupView.populate.apply(this.popupView, arguments);
if (o.isAutoSync) {
if (o.isAutoSync && o.adapter && o.adapter.getValue) {
this.popupView.setValue(o.adapter.getValue());
}
},
@ -15512,7 +15513,7 @@ BI.Pager = BI.inherit(BI.Widget, {
type: "bi.button_group",
element: this,
items: BI.createItems(view, {
cls: "page-item",
cls: "bi-list-item-select",
height: 23,
hgap: 10
}),
@ -29374,11 +29375,11 @@ BI.GridTable = BI.inherit(BI.Widget, {
this.topLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0);
this.topLeftGrid.setEstimatedRowSize(o.headerRowSize);
this.topRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength));
this.topRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.topRightGrid.setEstimatedRowSize(o.headerRowSize);
this.bottomLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0);
this.bottomLeftGrid.setEstimatedRowSize(o.rowSize);
this.bottomRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength));
this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.bottomRightGrid.setEstimatedRowSize(o.rowSize);
var items = this.contextLayout.attr("items");
@ -29612,11 +29613,11 @@ BI.QuickGridTable = BI.inherit(BI.GridTable, {
this.topLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0);
this.topLeftGrid.setEstimatedRowSize(o.headerRowSize);
this.topRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength));
this.topRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.topRightGrid.setEstimatedRowSize(o.headerRowSize);
this.bottomLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0);
this.bottomLeftGrid.setEstimatedRowSize(o.rowSize);
this.bottomRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength));
this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.bottomRightGrid.setEstimatedRowSize(o.rowSize);
var items = this.contextLayout.attr("items");
@ -30458,10 +30459,6 @@ BI.Table = BI.inherit(BI.Widget, {
}]]
}))));
//var scrollElement = isRight ? scrollBottomLeft.element : scrollBottomRight.element;
//var scrollTopElement = isRight ? scrollTopLeft.element : scrollTopRight.element;
//var otherElement = isRight ? scrollBottomRight.element : scrollBottomLeft.element;
this._initFreezeScroll();
BI.nextTick(function () {
if (self.element.is(":visible")) {
@ -30478,268 +30475,19 @@ BI.Table = BI.inherit(BI.Widget, {
_initFreezeScroll: function () {
var self = this, o = this.options;
scroll(this.scrollBottomRight.element, this.scrollTopRight.element, this.scrollBottomLeft.element);
scroll(this.scrollBottomLeft.element, this.scrollTopLeft.element, this.scrollBottomRight.element);
// scroll(this.scrollBottomLeft.element, this.scrollTopLeft.element, this.scrollBottomRight.element);
function scroll(scrollElement, scrollTopElement, otherElement) {
var scrolling, scrollingX;
var fn = function (event, delta, deltaX, deltaY) {
var inf = self._getScrollOffsetAndDur(event);
if (deltaY < 0 || deltaY > 0) {
if (scrolling) {
scrollElement[0].scrollTop = scrolling;
}
scrolling = scrollElement[0].scrollTop - delta * inf.offset;
var stopPropagation = false;
var st = scrollElement[0].scrollTop;
scrollElement[0].scrollTop = scrolling;
if (scrollElement[0].scrollTop !== st) {
stopPropagation = true;
}
scrollElement[0].scrollTop = st;
self._animateScrollTo(scrollElement, scrollElement[0].scrollTop, scrolling, inf.dur, "linear", {
onStart: function () {
},
onUpdate: function (top) {
otherElement[0].scrollTop = top;
self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, top);
},
onComplete: function () {
self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, scrolling);
scrolling = null;
}
});
//otherElement[0].scrollTop = scrollTop;
//scrollElement[0].scrollTop = scrollTop;
//self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, scrollTop);
if (stopPropagation === true) {
event.stopPropagation();
return false;
}
return;
}
//if (deltaX < 0 || deltaX > 0) {
// if (scrollingX) {
// scrollElement[0].scrollLeft = scrollingX;
// }
// scrollingX = scrollElement[0].scrollLeft + delta * inf.offset;
// var stopPropagation = false;
// var sl = scrollElement[0].scrollLeft;
// scrollElement[0].scrollLeft = scrollingX;
// if (scrollElement[0].scrollLeft !== sl) {
// stopPropagation = true;
// }
// scrollElement[0].scrollLeft = sl;
// self._animateScrollTo(scrollElement, scrollElement[0].scrollLeft, scrollingX, inf.dur, "linear", {
// direction: "left",
// onStart: function () {
// },
// onUpdate: function (left) {
// scrollTopElement[0].scrollLeft = left;
// self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, null, left);
// },
// onComplete: function () {
// self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, null, scrollingX);
// scrollingX = null;
// }
// });
//
//
// //otherElement[0].scrollTop = scrollTop;
// //scrollElement[0].scrollTop = scrollTop;
// //self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, scrollTop);
// if (stopPropagation === true) {
// event.stopPropagation();
// return false;
// }
//}
};
scrollElement.mousewheel(fn);
var scrollTop = 0, scrollLeft = 0;
scrollElement.scroll(function (e) {
var change = false;
if (scrollElement.scrollTop() != scrollTop) {
var old = otherElement.scrollTop();
otherElement.scrollTop(scrollElement.scrollTop());
scrollTop = scrollElement.scrollTop();
if (Math.abs(old - otherElement[0].scrollTop) > 0.1) {
e.stopPropagation();
change = true;
}
}
if (scrollElement.scrollLeft() != scrollLeft) {
var old = scrollTopElement.scrollLeft();
scrollTopElement.scrollLeft(scrollElement.scrollLeft());
scrollLeft = scrollElement.scrollLeft();
if (Math.abs(old - scrollTopElement[0].scrollLeft) > 0.1) {
e.stopPropagation();
change = true;
}
}
// self.fireEvent(BI.Table.EVENT_TABLE_SCROLL);
if (change === true) {
e.stopPropagation();
//return false;
}
self.fireEvent(BI.Table.EVENT_TABLE_SCROLL);
});
}
},
_animateScrollTo: function (el, from, to, duration, easing, op) {
var self = this;
var onStart = op.onStart, onComplete = op.onComplete, onUpdate = op.onUpdate;
var startTime = BI.getTime(), _delay, progress = 0, _request;
_cancelTween();
_startTween();
var diff = to - from;
el._stop = 0;
function _step() {
if (el._stop) {
return;
}
if (!progress) {
onStart.call();
}
progress = BI.getTime() - startTime;
_tween();
if (progress >= el.time) {
el.time = (progress > el.time) ? progress + _delay - (progress - el.time) : progress + _delay - 1;
if (el.time < progress + 1) {
el.time = progress + 1;
}
}
if (el.time < duration) {
el._id = _request(_step);
} else {
el[op.direction == 'left' ? "scrollLeft" : "scrollTop"](to);
onComplete.call();
}
}
function _tween() {
var top = to;
if (duration > 0) {
el.currVal = _ease(el.time, from, diff, duration, easing);
el[op.direction == 'left' ? "scrollLeft" : "scrollTop"](top = Math.round(el.currVal));
} else {
el[op.direction == 'left' ? "scrollLeft" : "scrollTop"](to);
}
onUpdate(top);
}
function _startTween() {
_delay = 1000 / 60;
el.time = progress + _delay;
_request = (!requestAnimationFrame()) ? function (f) {
_tween();
return setTimeout(f, 0.01);
} : requestAnimationFrame();
el._id = _request(_step);
}
function requestAnimationFrame() {
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.msRequestAnimationFrame ||
window.oRequestAnimationFrame;
}
function cancelAnimationFrame() {
return window.cancelAnimationFrame ||
window.webkitCancelAnimationFrame ||
window.mozCancelAnimationFrame ||
window.msCancelAnimationFrame ||
window.oCancelAnimationFrame ||
window.cancelRequestAnimationFrame ||
window.webkitCancelRequestAnimationFrame ||
window.mozCancelRequestAnimationFrame ||
window.msCancelRequestAnimationFrame ||
window.oCancelRequestAnimationFrame
}
function _cancelTween() {
if (el._id == null) {
return;
}
if (!cancelAnimationFrame()) {
clearTimeout(el._id);
} else {
cancelAnimationFrame()(el._id);
}
el._id = null;
}
function _ease(t, b, c, d, type) {
switch (type) {
case "linear":
return c * t / d + b;
break;
case "mcsLinearOut":
t /= d;
t--;
return c * Math.sqrt(1 - t * t) + b;
break;
case "easeInOutSmooth":
t /= d / 2;
if (t < 1) {
return c / 2 * t * t + b;
}
t--;
return -c / 2 * (t * (t - 2) - 1) + b;
break;
case "easeInOutStrong":
t /= d / 2;
if (t < 1) {
return c / 2 * Math.pow(2, 10 * (t - 1)) + b;
}
t--;
return c / 2 * ( -Math.pow(2, -10 * t) + 2 ) + b;
break;
case "easeInOut":
case "mcsEaseInOut":
t /= d / 2;
if (t < 1) {
return c / 2 * t * t * t + b;
}
t -= 2;
return c / 2 * (t * t * t + 2) + b;
break;
case "easeOutSmooth":
t /= d;
t--;
return -c * (t * t * t * t - 1) + b;
break;
case "easeOutStrong":
return c * ( -Math.pow(2, -10 * t / d) + 1 ) + b;
break;
case "easeOut":
case "mcsEaseOut":
default:
var ts = (t /= d) * t, tc = ts * t;
return b + c * (0.499999999999997 * tc * ts + -2.5 * ts * ts + 5.5 * tc + -6.5 * ts + 4 * t);
}
}
},
_getScrollOffsetAndDur: function (event) {
var offset = 40, dur = 200;
if (event.originalEvent.wheelDelta) {
offset = Math.abs(event.originalEvent.wheelDelta);
}
if (event.deltaFactor < 2) {
offset = 3;
dur = 17;
}
return {
offset: offset,
dur: dur
};
},
resize: function () {
this._resize();
this._resize && this._resize();
},
_createCells: function (items, columnSize, mergeCols, TDs, Ws, start, rowSize) {
@ -30991,17 +30739,7 @@ BI.Table = BI.inherit(BI.Widget, {
items: [this.scrollBottomRight]
});
this._resize = function () {
if (self.element.is(":visible")) {
self.setColumnSize(o.columnSize);
}
};
this._initNormalScroll();
BI.ResizeDetector.addResizeListener(this, function () {
self._resize();
self.fireEvent(BI.Table.EVENT_TABLE_RESIZE);
});
BI.nextTick(function () {
if (self.element.is(":visible")) {
self.fireEvent(BI.Table.EVENT_TABLE_AFTER_INIT);
@ -31011,66 +30749,8 @@ BI.Table = BI.inherit(BI.Widget, {
_initNormalScroll: function () {
var self = this;
var scrolling, scrollX;
this.scrollBottomRight.element.mousewheel(function (event, delta, deltaX, deltaY) {
var inf = self._getScrollOffsetAndDur(event);
if (deltaY < 0 || deltaY > 0) {
var ele = self.scrollBottomRight.element;
if (scrolling) {
ele[0].scrollTop = scrolling;
}
scrolling = ele[0].scrollTop - delta * inf.offset;
var stopPropagation = false;
var st = ele[0].scrollTop;
ele[0].scrollTop = scrolling;
if (ele[0].scrollTop !== st) {
stopPropagation = true;
}
ele[0].scrollTop = st;
self._animateScrollTo(ele, ele[0].scrollTop, scrolling, inf.dur, "linear", {
onStart: function () {
},
onUpdate: function (top) {
self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, top);
},
onComplete: function () {
self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, scrolling);
scrolling = null;
}
});
//var scrollTop = self.scrollBottomRight.element[0].scrollTop = self.scrollBottomRight.element[0].scrollTop - delta * offset;
//self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, scrollTop);
if (stopPropagation === true) {
event.stopPropagation();
return false;
}
}
});
var scrollTop = 0, scrollLeft = 0;
this.scrollBottomRight.element.scroll(function (e) {
var change = false;
var scrollElement = self.scrollBottomRight.element;
if (scrollElement.scrollTop() != scrollTop) {
if (Math.abs(scrollElement.scrollTop() - scrollTop) > 0.1) {
e.stopPropagation();
change = true;
}
scrollTop = scrollElement.scrollTop();
}
if (scrollElement.scrollLeft() != scrollLeft) {
if (Math.abs(scrollElement.scrollLeft() - scrollLeft) > 0.1) {
e.stopPropagation();
change = true;
}
scrollLeft = scrollElement.scrollLeft();
}
self.fireEvent(BI.Table.EVENT_TABLE_SCROLL);
if (change === true) {
e.stopPropagation();
//return false;
}
return false;
});
},
@ -31184,7 +30864,7 @@ BI.Table = BI.inherit(BI.Widget, {
}
BI.each(colgroupTds, function (i, colgroup) {
var width = colgroup.attr("width") | 0;
if (width !== sizes[i]) {
if (sizes[i] !== "" && width !== sizes[i]) {
var w = self._calculateWidth(sizes[i]);
colgroup.attr("width", w).css("width", w);
BI.each(bodyTds, function (j, items) {
@ -31291,7 +30971,7 @@ BI.Table = BI.inherit(BI.Widget, {
} else {
BI.each(this.colgroupTds, function (i, colgroup) {
var width = colgroup.attr("width") | 0;
if (width !== o.columnSize[i]) {
if (o.columnSize[i] !== "" && width !== o.columnSize[i]) {
var w = self._calculateWidth(o.columnSize[i]);
colgroup.attr("width", w).css("width", w);
BI.each(self.bodyTds, function (j, items) {
@ -31498,8 +31178,10 @@ BI.Table = BI.inherit(BI.Widget, {
if (w > 1.05) {
w += o.columnSize.length;
}
if (w > 1.05) {
this.tableContainer.element.width(w);
}
}
},
getColumnSize: function () {
@ -32023,14 +31705,6 @@ BI.Table = BI.inherit(BI.Widget, {
} else {
this._createNormalTable();
}
},
empty: function () {
BI.Table.superclass.empty.apply(this, arguments);
},
destroy: function () {
BI.Table.superclass.destroy.apply(this, arguments);
}
})
;

28
docs/case.js

@ -213,6 +213,9 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, {
doClick: function () {
BI.MultiSelectItem.superclass.doClick.apply(this, arguments);
this.checkbox.setSelected(this.isSelected());
if (this.isValid()) {
this.fireEvent(BI.MultiSelectItem.EVENT_CHANGE, this.getValue(), this);
}
},
setSelected: function (v) {
@ -4023,7 +4026,7 @@ BI.FormulaComboTrigger = BI.inherit(BI.Widget, {
var str = item.match(fieldRegx);
if (BI.isNotEmptyArray(str)) {
var id = str[0].substring(2, item.length - 1);
var item = BI.find(self.options.items, function (i, item) {
var item = BI.find(BI.flatten(self.options.items), function (i, item) {
return id === item.value;
});
formulaString = formulaString + item.text;
@ -6159,7 +6162,7 @@ BI.StateEditor = BI.inherit(BI.Single, {
cls: "state-editor-infinite-text bi-disabled",
textAlign: "left",
height: o.height,
text: BI.i18nText("BI-Unrestricted"),
text: BI.i18nText("BI-Basic_Unrestricted"),
hgap: 4,
handler: function () {
self._showInput();
@ -6335,7 +6338,7 @@ BI.StateEditor = BI.inherit(BI.Single, {
this.text.setTitle("");
this.text.element.removeClass("state-editor-infinite-text");
} else {
this.text.setText(BI.i18nText("BI-Unrestricted"));
this.text.setText(BI.i18nText("BI-Basic_Unrestricted"));
this.text.setTitle("");
this.text.element.addClass("state-editor-infinite-text");
}
@ -6343,7 +6346,7 @@ BI.StateEditor = BI.inherit(BI.Single, {
}
if (BI.isString(v)) {
if (BI.isEmpty(v)) {
this.text.setText(BI.i18nText("BI-Unrestricted"));
this.text.setText(BI.i18nText("BI-Basic_Unrestricted"));
this.text.setTitle("");
this.text.element.addClass("state-editor-infinite-text");
} else {
@ -6355,7 +6358,7 @@ BI.StateEditor = BI.inherit(BI.Single, {
}
if (BI.isArray(v)) {
if (BI.isEmpty(v)) {
this.text.setText(BI.i18nText("BI-Unrestricted"));
this.text.setText(BI.i18nText("BI-Basic_Unrestricted"));
this.text.element.addClass("state-editor-infinite-text");
} else if (v.length === 1) {
this.text.setText(v[0]);
@ -6439,7 +6442,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Single, {
cls: "state-editor-infinite-text bi-disabled",
textAlign: "left",
height: o.height,
text: BI.i18nText("BI-Unrestricted"),
text: BI.i18nText("BI-Basic_Unrestricted"),
hgap: 4,
handler: function () {
self._showInput();
@ -6611,7 +6614,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Single, {
this.text.setText(BI.i18nText("BI-Already_Selected"));
this.text.element.removeClass("state-editor-infinite-text");
} else {
this.text.setText(BI.i18nText("BI-Unrestricted"));
this.text.setText(BI.i18nText("BI-Basic_Unrestricted"));
this.text.element.addClass("state-editor-infinite-text");
}
return;
@ -6621,7 +6624,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Single, {
this.text.setTitle(v);
this.text.element.removeClass("state-editor-infinite-text");
} else if (BI.isEmpty(v)) {
this.text.setText(BI.i18nText("BI-Unrestricted"));
this.text.setText(BI.i18nText("BI-Basic_Unrestricted"));
this.text.element.addClass("state-editor-infinite-text");
} else {
this.text.setText(BI.i18nText("BI-Already_Selected"));
@ -8804,15 +8807,10 @@ BI.Segment = BI.inherit(BI.Widget, {
this.buttonGroup = BI.createWidget({
element: this,
type: "bi.button_group",
items: BI.map(o.items, function (i, item) {
return BI.extend({
items: BI.createItems(o.items, {
type: "bi.segment_button",
height: o.height - 2,
whiteSpace: o.whiteSpace
}, item, {
cls: (i === 0 ? "bi-border-left " : "")
+ (item.cls || "") + " bi-border-top bi-border-right bi-border-bottom"
});
}),
layout: [
{
@ -11981,7 +11979,7 @@ BI.ZeroClip = BI.inherit(BI.BasicButton, {
BI.nextTick(function () {
self.element.zclip({
path: BI.resourceURL + "ZeroClipboard.swf",
path: BI.resourceURL + "/ZeroClipboard.swf",
copy: o.copy,
beforeCopy: o.beforeCopy,
afterCopy: o.afterCopy

89
docs/core.css

@ -3058,19 +3058,21 @@ i {
background: #1a1a1a;
opacity: 0.2;
filter: alpha(opacity=20);
z-index: 1000000000;
z-index: 1000000000 !important;
}
.bi-theme-dark .bi-resizer {
background: #ffffff;
}
.bi-z-index-mask {
color: #ffffff;
background-color: rgba(26, 26, 26, 0.5);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#7f1a1a1a,endColorstr=#7f1a1a1a);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#801a1a1a,endColorstr=#801a1a1a);
}
.bi-list-item:hover,
.bi-list-item.hover {
background-color: #eff1f4;
color: #1a1a1a;
background-color: rgba(26, 26, 26, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d1a1a1a,endColorstr=#0d1a1a1a);
}
.bi-list-item.disabled,
.bi-list-item.disabled:hover,
@ -3085,8 +3087,9 @@ i {
}
.bi-theme-dark .bi-list-item:hover,
.bi-theme-dark .bi-list-item.hover {
background-color: #191b2b;
color: #ffffff;
background-color: rgba(255, 255, 255, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff);
}
.bi-theme-dark .bi-list-item.disabled,
.bi-theme-dark .bi-list-item.disabled:hover,
@ -3099,9 +3102,12 @@ i {
.bi-theme-dark .bi-list-item.disabled:active .bi-high-light {
color: #666666 !important;
}
.bi-list-item-simple {
color: #999999;
}
.bi-list-item-simple:hover,
.bi-list-item-simple.hover {
color: #1a1a1a;
color: #3f8ce8;
}
.bi-list-item-simple.disabled,
.bi-list-item-simple.disabled:hover,
@ -3113,20 +3119,6 @@ i {
.bi-list-item-simple.disabled:active .bi-high-light {
color: #cccccc !important;
}
.bi-theme-dark .bi-list-item-simple:hover,
.bi-theme-dark .bi-list-item-simple.hover {
color: #ffffff;
}
.bi-theme-dark .bi-list-item-simple.disabled,
.bi-theme-dark .bi-list-item-simple.disabled:hover,
.bi-theme-dark .bi-list-item-simple.disabled:active {
color: #666666 !important;
}
.bi-theme-dark .bi-list-item-simple.disabled .bi-high-light,
.bi-theme-dark .bi-list-item-simple.disabled:hover .bi-high-light,
.bi-theme-dark .bi-list-item-simple.disabled:active .bi-high-light {
color: #666666 !important;
}
.bi-list-item-effect:hover {
color: #1a1a1a;
}
@ -3165,12 +3157,14 @@ i {
.bi-list-item-active:hover,
.bi-list-item-active.hover {
color: #1a1a1a;
background-color: #eff1f4;
background-color: rgba(26, 26, 26, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d1a1a1a,endColorstr=#0d1a1a1a);
}
.bi-list-item-active.active,
.bi-list-item-active:active {
color: #3f8ce8;
background-color: #eff1f4;
background-color: rgba(26, 26, 26, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d1a1a1a,endColorstr=#0d1a1a1a);
}
.bi-list-item-active.disabled,
.bi-list-item-active.disabled:hover,
@ -3185,13 +3179,15 @@ i {
}
.bi-theme-dark .bi-list-item-active:hover,
.bi-theme-dark .bi-list-item-active.hover {
background-color: #191b2b;
color: #ffffff;
background-color: rgba(255, 255, 255, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff);
}
.bi-theme-dark .bi-list-item-active.active,
.bi-theme-dark .bi-list-item-active:active {
color: #3f8ce8;
background-color: #191b2b;
background-color: rgba(255, 255, 255, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff);
}
.bi-theme-dark .bi-list-item-active.disabled,
.bi-theme-dark .bi-list-item-active.disabled:hover,
@ -3206,8 +3202,9 @@ i {
}
.bi-list-item-select:hover,
.bi-list-item-select.hover {
color: #3f8ce8;
background-color: #eff1f4;
color: #1a1a1a;
background-color: rgba(26, 26, 26, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d1a1a1a,endColorstr=#0d1a1a1a);
}
.bi-list-item-select:active,
.bi-list-item-select.active {
@ -3231,8 +3228,9 @@ i {
}
.bi-theme-dark .bi-list-item-select:hover,
.bi-theme-dark .bi-list-item-select.hover {
color: #3f8ce8;
background-color: #191b2b;
color: #ffffff;
background-color: rgba(255, 255, 255, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff);
}
.bi-theme-dark .bi-list-item-select:active,
.bi-theme-dark .bi-list-item-select.active {
@ -3254,43 +3252,6 @@ i {
.bi-theme-dark .bi-list-item-select.disabled:active .bi-high-light {
color: #666666 !important;
}
.bi-list-item-choose:hover {
color: #1a1a1a;
}
.bi-list-item-choose:active,
.bi-list-item-choose.active {
color: #ffffff;
background-color: #3f8ce8;
}
.bi-list-item-choose:active .bi-high-light,
.bi-list-item-choose.active .bi-high-light {
color: #ffffff;
}
.bi-list-item-choose.disabled,
.bi-list-item-choose.disabled:hover,
.bi-list-item-choose.disabled:active {
color: #cccccc !important;
background-color: transparent !important;
}
.bi-list-item-choose.disabled .bi-high-light,
.bi-list-item-choose.disabled:hover .bi-high-light,
.bi-list-item-choose.disabled:active .bi-high-light {
color: #cccccc !important;
}
.bi-theme-dark .bi-list-item-choose:hover {
color: #ffffff;
}
.bi-theme-dark .bi-list-item-choose.disabled,
.bi-theme-dark .bi-list-item-choose.disabled:hover,
.bi-theme-dark .bi-list-item-choose.disabled:active {
color: #666666 !important;
background-color: transparent !important;
}
.bi-theme-dark .bi-list-item-choose.disabled .bi-high-light,
.bi-theme-dark .bi-list-item-choose.disabled:hover .bi-high-light,
.bi-theme-dark .bi-list-item-choose.disabled:active .bi-high-light {
color: #666666 !important;
}
/*****************cursor*****************/
.cursor-pointer {
cursor: pointer;

61
docs/core.js

@ -14062,6 +14062,10 @@ if (!window.BI) {
return /(msie|trident)/i.test(navigator.userAgent.toLowerCase());
},
isEdge: function () {
return /edge/i.test(navigator.userAgent.toLowerCase());
},
isChrome: function () {
return /chrome/i.test(navigator.userAgent.toLowerCase());
},
@ -14082,6 +14086,14 @@ if (!window.BI) {
return /Konqueror|Safari|KHTML/i.test(navigator.userAgent);
},
isMac: function () {
return /macintosh|mac os x/i.test(navigator.userAgent);
},
isWindows: function () {
return /windows|win32/i.test(navigator.userAgent);
},
isSupportCss3: function (style) {
var prefix = ['webkit', 'Moz', 'ms', 'o'],
i, len,
@ -21978,7 +21990,7 @@ BI.extend(jQuery.fn, {
*/
__textKeywordMarked__: function (text, keyword, py) {
if (!BI.isKey(keyword)) {
return this.text(text);
return this.text((text + "").replaceAll(" ", " "));
}
keyword = keyword + "";
keyword = BI.toUpperCase(keyword);
@ -22001,7 +22013,7 @@ BI.extend(jQuery.fn, {
if (tidx >= 0) {
this.append(textLeft.substr(0, tidx));
this.append($("<span>").addClass("bi-keyword-red-mark")
.text(textLeft.substr(tidx, keyword.length)));
.text(textLeft.substr(tidx, keyword.length).replaceAll(" ", " ")));
textLeft = textLeft.substr(tidx + keyword.length);
if (py != null) {
@ -22010,7 +22022,7 @@ BI.extend(jQuery.fn, {
} else if (pidx != null && pidx >= 0 && Math.floor(pidx / text.length) === Math.floor((pidx + keyword.length - 1) / text.length)) {
this.append(textLeft.substr(0, pidx));
this.append($("<span>").addClass("bi-keyword-red-mark")
.text(textLeft.substr(pidx, keyword.length)));
.text(textLeft.substr(pidx, keyword.length).replaceAll(" ", " ")));
if (py != null) {
py = py.substr(pidx + keyword.length);
}
@ -22511,8 +22523,8 @@ BI.extend(jQuery, {
getComboPosition: function (combo, popup, extraWidth, extraHeight, needAdaptHeight, directions, offsetStyle) {
extraWidth || (extraWidth = 0);
extraHeight || (extraHeight = 0);
var maxHeight = $("body").bounds().height - extraHeight;
maxHeight = Math.min(popup.attr("maxHeight") || maxHeight, maxHeight);
var bodyHeight = $("body").bounds().height - extraHeight;
var maxHeight = Math.min(popup.attr("maxHeight") || bodyHeight, bodyHeight);
popup.resetHeight && popup.resetHeight(maxHeight);
var position = $.getComboPositionByDirections(combo, popup, extraWidth, extraHeight, needAdaptHeight, directions || ['bottom', 'top', 'right', 'left']);
switch (offsetStyle) {
@ -22535,6 +22547,7 @@ BI.extend(jQuery, {
}
break;
}
popup.resetHeight && popup.resetHeight(Math.min(bodyHeight - position.top, maxHeight));
return position;
}
});/**
@ -22764,9 +22777,9 @@ $(function () {
return tempValue;
},
rgba2rgb: function (rgbColour, BGcolur) {
if (BI.isNull(BGcolur)) {
BGcolur = 1;
rgba2rgb: function (rgbColour, BGcolor) {
if (BI.isNull(BGcolor)) {
BGcolor = 1;
}
if (rgbColour.substr(0, 4) != "rgba") {
return "";
@ -22780,9 +22793,9 @@ $(function () {
var B = BI.parseFloat(rgbValues[2]);
var A = BI.parseFloat(rgbValues[3]);
return "rgb(" + Math.floor(255 * (BGcolur * (1 - A )) + R * A) + "," +
Math.floor(255 * (BGcolur * (1 - A )) + G * A) + "," +
Math.floor(255 * (BGcolur * (1 - A )) + B * A) + ")";
return "rgb(" + Math.floor(255 * (BGcolor * (1 - A )) + R * A) + "," +
Math.floor(255 * (BGcolor * (1 - A )) + G * A) + "," +
Math.floor(255 * (BGcolor * (1 - A )) + B * A) + ")";
},
getTextSizeWidth: function (text, fontSize) {
@ -23645,19 +23658,19 @@ Date._DN = [BI.i18nText("BI-Basic_Sunday"),
BI.i18nText("BI-Basic_Sunday")];
// short day names
Date._SDN = [BI.i18nText("BI-Day_Ri"),
BI.i18nText("BI-Basic_One"),
BI.i18nText("BI-Basic_Two"),
BI.i18nText("BI-Basic_Three"),
BI.i18nText("BI-Basic_Four"),
BI.i18nText("BI-Basic_Five"),
BI.i18nText("BI-Basic_Six"),
BI.i18nText("BI-Day_Ri")];
Date._SDN = [BI.i18nText("BI-Basic_Simple_Sunday"),
BI.i18nText("BI-Basic_Simple_Monday"),
BI.i18nText("BI-Basic_Simple_Tuesday"),
BI.i18nText("BI-Basic_Simple_Wednesday"),
BI.i18nText("BI-Basic_Simple_Thursday"),
BI.i18nText("BI-Basic_Simple_Friday"),
BI.i18nText("BI-Basic_Simple_Saturday"),
BI.i18nText("BI-Basic_Simple_Sunday")];
// Monday first, etc.
Date._FD = 1;
// full month names
// full month namesdat
Date._MN = [
BI.i18nText("BI-Basic_January"),
BI.i18nText("BI-Basic_February"),
@ -28940,16 +28953,16 @@ $(function () {
//注册控件
BI.Plugin.registerWidget("bi.grid_table", function (ob) {
//IE下滚动条滑动效果不好,禁止掉
if (BI.isIE() || BI.isFireFox()) {
//非chrome下滚动条滑动效果不好,禁止掉
if (!(BI.isChrome() && BI.isWindows() && !BI.isEdge())) {
return BI.extend(ob, {type: "bi.quick_grid_table"});
} else {
return ob;
}
});
BI.Plugin.registerWidget("bi.collection_table", function (ob) {
//IE下滚动条滑动效果不好,禁止掉
if (BI.isIE() || BI.isFireFox()) {
//非chrome下滚动条滑动效果不好,禁止掉
if (!(BI.isChrome() && BI.isWindows() && !BI.isEdge())) {
return BI.extend(ob, {type: "bi.quick_collection_table"});
} else {
return ob;

67
docs/demo.js

@ -7,7 +7,7 @@ BI.i18n = {
};
BI.servletURL = "dist/";
BI.resourceURL = "dist/resource";
BI.resourceURL = "dist/resource/";
BI.i18n = {};$(function () {
var ref;
BI.createWidget({
@ -2436,8 +2436,8 @@ BI.shortcut("demo.center", Demo.Center);Demo.TreeValueChooser = BI.inherit(BI.Wi
var tree = [];
for (var i = 0; i < 21; i++) {
tree.push({
value: i + "",
text: i + "",
value: " " + i + "",
text: " " + i + "",
id: i + "",
pId: null
});
@ -2937,6 +2937,63 @@ Demo.COMPONENT_CONFIG = [{
}
});
BI.shortcut("demo.combo", Demo.Func);Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var items = [{
type: "bi.label",
value: "张三"
}, {
type: "bi.label",
value: "李四"
}];
var popup = BI.createWidget({
type: "bi.button_group",
cls: "bi-border",
items: items,
layouts: [{
type: "bi.vertical"
}]
});
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.searcher",
listeners: [{
eventName: BI.Searcher.EVENT_STOP,
action: function () {
popup.populate(items)
}
}, {
eventName: BI.Searcher.EVENT_PAUSE,
action: function () {
popup.populate(items)
}
}],
adapter: {
getItems: function () {
return items
}
},
popup: popup,
masker: false
},
left: 0,
right: 0,
top: 0
}, {
el: popup,
left: 0,
right: 0,
top: 50,
bottom: 0
}]
}
}
});
BI.shortcut("demo.searcher", Demo.Func);Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
@ -5434,8 +5491,8 @@ Demo.MultiSelectCombo = BI.inherit(BI.Widget, {
var search = BI.Func.getSearchResult(items, kw);
items = search.matched.concat(search.finded);
});
if (options.selected_values) {//过滤
var filter = BI.makeObject(options.selected_values, true);
if (options.selectedValues) {//过滤
var filter = BI.makeObject(options.selectedValues, true);
items = BI.filter(items, function (i, ob) {
return !filter[ob.value];
});

3233
docs/resource.css

File diff suppressed because it is too large Load Diff

283
docs/widget.js

@ -35,12 +35,6 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, {
this.renderedCells = [];
this.renderedKeys = [];
this.header = BI.createWidget(o.sequenceHeaderCreator || {
type: "bi.table_style_cell",
cls: "sequence-table-title-cell bi-border",
styleGetter: o.headerCellStyleGetter,
text: BI.i18nText("BI-Number_Index")
});
this.container = BI.createWidget({
type: "bi.absolute",
width: 60,
@ -54,13 +48,20 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, {
items: [this.container]
});
this.headerContainer = BI.createWidget({
type: "bi.absolute",
cls: "bi-border",
width: 58,
scrollable: false
});
this.layout = BI.createWidget({
type: "bi.vtape",
element: this,
items: [{
el: this.header,
height: this._getHeaderHeight()
}, {
el: this.headerContainer,
height: this._getHeaderHeight() - 2
}, {el: {type: "bi.layout"}, height: 2}, {
el: this.scrollContainer
}]
});
@ -168,7 +169,7 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, {
_layout: function () {
var self = this, o = this.options;
var headerHeight = this._getHeaderHeight();
var headerHeight = this._getHeaderHeight() - 2;
var items = this.layout.attr("items");
if (o.isNeedFreeze === false) {
items[0].height = 0;
@ -217,6 +218,26 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, {
return Math.max(0, cnt * this.options.rowSize - (this.options.height - this._getHeaderHeight()) + BI.DOM.getScrollWidth());
},
_createHeader: function () {
var o = this.options;
BI.createWidget({
type: "bi.absolute",
element: this.headerContainer,
items: [{
el: o.sequenceHeaderCreator || {
type: "bi.table_style_cell",
cls: "sequence-table-title-cell",
styleGetter: o.headerCellStyleGetter,
text: BI.i18nText("BI-Number_Index")
},
left: 0,
top: 0,
right: 0,
bottom: 0
}]
});
},
_calculateChildrenToRender: function () {
var self = this, o = this.options;
@ -322,7 +343,8 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, {
task.apply(self);
});
this.tasks = [];
this.header.populate && this.header.populate();
this.headerContainer.empty();
this._createHeader();
this._layout();
this._calculateChildrenToRender();
},
@ -4905,7 +4927,7 @@ BI.shortcut('bi.date_combo', BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
hgap: c.hgap,
vgap: c.vgap,
allowBlank: true,
watermark: BI.i18nText("BI-Unrestricted"),
watermark: BI.i18nText("BI-Basic_Unrestricted"),
errorText: function () {
if (self.editor.isEditing()) {
return BI.i18nText("BI-Date_Trigger_Error_Text");
@ -5595,7 +5617,7 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
popup: {
el: this.popupview,
stopPropagation: true,
maxHeight: 400
maxHeight: 1000
}
});
@ -9343,7 +9365,7 @@ BI.MultiSelectCheckPane = BI.inherit(BI.Widget, {
items: opts.items,
itemsCreator: function (op, callback) {
op = BI.extend(op || {}, {
selected_values: self.storeValue.value
selectedValues: self.storeValue.value
});
if (self.storeValue.type === BI.Selection.Multi) {
callback({
@ -9643,7 +9665,10 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
toggle: false,
el: this.trigger,
adjustLength: 1,
popup: this.popup
popup: this.popup,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
@ -9906,7 +9931,7 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
itemsCreator: function (op, callback) {
var startValue = self._startValue;
self.storeValue && (op = BI.extend(op || {}, {
selected_values: BI.isKey(startValue) && self.storeValue.type === BI.Selection.Multi
selectedValues: BI.isKey(startValue) && self.storeValue.type === BI.Selection.Multi
? self.storeValue.value.concat(startValue) : self.storeValue.value
}));
opts.itemsCreator(op, function (ob) {
@ -10318,7 +10343,7 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, {
},
itemsCreator: function (op, callback) {
self.storeValue && (op = BI.extend(op || {}, {
selected_values: self.storeValue.value
selectedValues: self.storeValue.value
}));
opts.itemsCreator(op, function (ob) {
var keyword = ob.keyword = opts.keywordGetter();
@ -10788,13 +10813,13 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
ob.value || (ob.value = []);
if (ob.type === BI.Selection.All) {
if (BI.size(ob.assist) === 1) {
this.editor.setState(o.valueFormatter(ob.assist[0] + "") || ob.assist[0] + "");
this.editor.setState(o.valueFormatter(ob.assist[0] + "") || (ob.assist[0] + ""));
} else {
this.editor.setState(BI.size(ob.value) > 0 ? BI.Selection.Multi : BI.Selection.All);
}
} else {
if (BI.size(ob.value) === 1) {
this.editor.setState(o.valueFormatter(ob.value[0] + "" || ob.value[0] + ""));
this.editor.setState(o.valueFormatter(ob.value[0] + "") || (ob.value[0] + ""));
} else {
this.editor.setState(BI.size(ob.value) > 0 ? BI.Selection.Multi : BI.Selection.None);
}
@ -11266,7 +11291,7 @@ BI.MultiTreeCheckPane = BI.inherit(BI.Pane, {
var self = this, opts = this.options;
this.selected_values = {};
this.selectedValues = {};
var continueSelect = BI.createWidget({
type: 'bi.text_button',
@ -11303,7 +11328,7 @@ BI.MultiTreeCheckPane = BI.inherit(BI.Pane, {
type: "bi.display_tree",
cls: "bi-multi-tree-display",
itemsCreator: function (op, callback) {
op.type = BI.TreeView.REQ_TYPE_SELECTED_DATA;
op.type = BI.TreeView.REQ_TYPE_GET_SELECTED_DATA;
opts.itemsCreator(op, callback);
}
});
@ -11628,7 +11653,7 @@ BI.MultiTreePopup = BI.inherit(BI.Pane, {
var self = this, opts = this.options;
this.selected_values = {};
this.selectedValues = {};
this.tree = BI.createWidget({
type: "bi.sync_tree",
@ -12238,7 +12263,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
this.smallEditor = BI.createWidget({
type: "bi.sign_editor",
height: o.height - 2,
watermark: BI.i18nText("BI-Unrestricted"),
watermark: BI.i18nText("BI-Basic_Unrestricted"),
allowBlank: true,
value: o.min,
level: "warning",
@ -12275,7 +12300,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
this.bigEditor = BI.createWidget({
type: "bi.sign_editor",
height: o.height - 2,
watermark: BI.i18nText("BI-Unrestricted"),
watermark: BI.i18nText("BI-Basic_Unrestricted"),
allowBlank: true,
value: o.max,
level: "warning",
@ -14547,7 +14572,7 @@ BI.shortcut('bi.relation_view', BI.RelationView);/**
BI.RelationViewRegionContainer = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.RelationViewRegionContainer.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-relation-view-region-container bi-card bi-border",
baseCls: "bi-relation-view-region-container",
width: 150
});
},
@ -14701,7 +14726,7 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, {
cls: "relation-view-region-container bi-card bi-border " + (o.belongPackage ? "" : "other-package"),
items: [{
type: "bi.vertical_adapt",
cls: "relation-view-region-title bi-border",
cls: "relation-view-region-title bi-border-bottom",
items: [this.preview, this.title]
}, this.button_group]
}],
@ -15746,12 +15771,6 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, {
this.renderedCells = [];
this.renderedKeys = [];
this.header = BI.createWidget(o.sequenceHeaderCreator || {
type: "bi.table_style_cell",
cls: "sequence-table-title-cell bi-border",
styleGetter: o.headerCellStyleGetter,
text: BI.i18nText("BI-Number_Index")
});
this.container = BI.createWidget({
type: "bi.absolute",
width: 60,
@ -15765,12 +15784,19 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, {
items: [this.container]
});
this.headerContainer = BI.createWidget({
type: "bi.absolute",
cls: "bi-border",
width: 58,
scrollable: false
});
this.layout = BI.createWidget({
type: "bi.vtape",
element: this,
items: [{
el: this.header,
height: o.headerRowSize * o.header.length
el: this.headerContainer,
height: o.headerRowSize * o.header.length - 2
}, {
el: this.scrollContainer
}]
@ -15793,6 +15819,26 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, {
this.scrollContainer.element.scrollTop(o.scrollTop);
},
_createHeader: function () {
var o = this.options;
BI.createWidget({
type: "bi.absolute",
element: this.headerContainer,
items: [{
el: o.sequenceHeaderCreator || {
type: "bi.table_style_cell",
cls: "sequence-table-title-cell",
styleGetter: o.headerCellStyleGetter,
text: BI.i18nText("BI-Number_Index")
},
left: 0,
top: 0,
right: 0,
bottom: 0
}]
});
},
_calculateChildrenToRender: function () {
var self = this, o = this.options;
var scrollTop = BI.clamp(o.scrollTop, 0, o.rowSize * o.items.length - (o.height - o.header.length * o.headerRowSize) + BI.DOM.getScrollWidth());
@ -15870,7 +15916,8 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, {
},
_populate: function () {
this.header.populate && this.header.populate();
this.headerContainer.empty();
this._createHeader();
this._layout();
this._calculateChildrenToRender();
},
@ -16958,8 +17005,8 @@ BI.AllValueChooserCombo = BI.inherit(BI.Widget, {
var search = BI.Func.getSearchResult(items, kw);
items = search.matched.concat(search.finded);
});
if (options.selected_values) {//过滤
var filter = BI.makeObject(options.selected_values, true);
if (options.selectedValues) {//过滤
var filter = BI.makeObject(options.selectedValues, true);
items = BI.filter(items, function (i, ob) {
return !filter[ob.value];
});
@ -17086,10 +17133,10 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
case BI.TreeView.REQ_TYPE_ADJUST_DATA:
self._reqAdjustTreeNode(options, callback);
break;
case BI.TreeView.REQ_TYPE_CALCULATE_SELECT_DATA:
case BI.TreeView.REQ_TYPE_SELECT_DATA:
self._reqSelectedTreeNode(options, callback);
break;
case BI.TreeView.REQ_TYPE_SELECTED_DATA:
case BI.TreeView.REQ_TYPE_GET_SELECTED_DATA:
self._reqDisplayTreeNode(options, callback);
break;
default :
@ -17102,27 +17149,27 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
_reqDisplayTreeNode: function (op, callback) {
var self = this;
var result = [];
var selected_values = op.selected_values;
var selectedValues = op.selectedValues;
if (selected_values == null || BI.isEmpty(selected_values)) {
if (selectedValues == null || BI.isEmpty(selectedValues)) {
callback({});
return;
}
doCheck(0, [], selected_values);
doCheck(0, [], selectedValues);
callback({
items: result
});
function doCheck(floor, parent_values, selected) {
function doCheck(floor, parentValues, selected) {
if (floor >= self.floors) {
return;
}
if (selected == null || BI.isEmpty(selected)) {
var children = self._getChildren(parent_values);
var children = self._getChildren(parentValues);
BI.each(children, function (i, child) {
var newParents = BI.clone(parent_values);
var newParents = BI.clone(parentValues);
newParents.push(child.value);
var llen = self._getChildCount(newParents);
createOneJson(child, llen);
@ -17132,19 +17179,19 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
}
BI.each(selected, function (k) {
var node = self._getNode(k);
var newParents = BI.clone(parent_values);
var newParents = BI.clone(parentValues);
newParents.push(node.value);
createOneJson(node, getCount(selected[k], newParents));
doCheck(floor + 1, newParents, selected[k]);
})
}
function getCount(jo, parent_values) {
function getCount(jo, parentValues) {
if (jo == null) {
return 0;
}
if (BI.isEmpty(jo)) {
return self._getChildCount(parent_values);
return self._getChildCount(parentValues);
}
return BI.size(jo);
@ -17163,30 +17210,30 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
_reqSelectedTreeNode: function (op, callback) {
var self = this;
var selected_values = op.selected_values;
var not_selected_value = op.not_selected_value || {};
var selectedValues = op.selectedValues;
var notSelectedValue = op.notSelectedValue || {};
var keyword = op.keyword || "";
var parent_values = op.parent_values || [];
var parentValues = op.parentValues || [];
if (selected_values == null || BI.isEmpty(selected_values)) {
if (selectedValues == null || BI.isEmpty(selectedValues)) {
callback({});
return;
}
dealWithSelectedValues(selected_values);
callback(selected_values);
dealWithSelectedValues(selectedValues);
callback(selectedValues);
function dealWithSelectedValues(selected_values) {
var p = BI.clone(parent_values);
p.push(not_selected_value);
function dealWithSelectedValues(selectedValues) {
var p = BI.clone(parentValues);
p.push(notSelectedValue);
if (isChild(selected_values, p)) {
if (isChild(selectedValues, p)) {
var result = [];
var finded = search(parent_values.length + 1, parent_values, not_selected_value, result);
var finded = search(parentValues.length + 1, parentValues, notSelectedValue, result);
if (finded === true) {
var next = selected_values;
var next = selectedValues;
BI.each(p, function (i, v) {
var t = next[v];
if (t == null) {
@ -17194,7 +17241,7 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
var split = p.slice(0, i);
var expanded = self._getChildren(split);
BI.each(expanded, function (m, child) {
if (i === p.length - 1 && child.value === not_selected_value) {
if (i === p.length - 1 && child.value === notSelectedValue) {
return true;
}
next[child.value] = {};
@ -17211,7 +17258,7 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
if (result.length > 0) {
BI.each(result, function (i, strs) {
self._buildTree(selected_values, strs);
self._buildTree(selectedValues, strs);
})
}
}
@ -17251,8 +17298,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return can;
}
function isChild(selected_values, parents) {
var t = selected_values;
function isChild(selectedValues, parents) {
var t = selectedValues;
for (var i = 0; i < parents.length; i++) {
var v = parents[i];
if (!BI.has(t, v)) {
@ -17270,16 +17317,16 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
_reqAdjustTreeNode: function (op, callback) {
var self = this;
var result = [];
var selected_values = op.selected_values;
if (selected_values == null || BI.isEmpty(selected_values)) {
var selectedValues = op.selectedValues;
if (selectedValues == null || BI.isEmpty(selectedValues)) {
callback({});
return;
}
BI.each(selected_values, function (k, v) {
BI.each(selectedValues, function (k, v) {
result.push([k]);
});
dealWithSelectedValues(selected_values, []);
dealWithSelectedValues(selectedValues, []);
var jo = {};
BI.each(result, function (i, strs) {
@ -17316,23 +17363,23 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
var self = this;
var result = [];
var keyword = op.keyword || "";
var selected_values = op.selected_values;
var last_search_value = op.last_search_value || "";
var selectedValues = op.selectedValues;
var lastSearchValue = op.lastSearchValue || "";
var output = search();
BI.nextTick(function () {
callback({
hasNext: output.length > self._const.perPage,
items: result,
last_search_value: BI.last(output)
lastSearchValue: BI.last(output)
})
});
function search() {
var children = self._getChildren([]);
var start = children.length;
if (last_search_value !== "") {
if (lastSearchValue !== "") {
for (var j = 0, len = start; j < len; j++) {
if (children[j].value === last_search_value) {
if (children[j].value === lastSearchValue) {
start = j + 1;
break;
}
@ -17357,22 +17404,22 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return output;
}
function nodeSearch(deep, parent_values, current, isAllSelect, result) {
function nodeSearch(deep, parentValues, current, isAllSelect, result) {
if (self._isMatch(current, keyword)) {
var checked = isAllSelect || isSelected(parent_values, current);
createOneJson(parent_values, current, false, checked, !isAllSelect && isHalf(parent_values, current), true, result);
var checked = isAllSelect || isSelected(parentValues, current);
createOneJson(parentValues, current, false, checked, !isAllSelect && isHalf(parentValues, current), true, result);
return [true, checked];
}
if (deep >= self.floors) {
return [false, false];
}
var newParents = BI.clone(parent_values);
var newParents = BI.clone(parentValues);
newParents.push(current);
var children = self._getChildren(newParents);
var can = false, checked = false;
var isCurAllSelected = isAllSelect || isAllSelected(parent_values, current);
var isCurAllSelected = isAllSelect || isAllSelected(parentValues, current);
BI.each(children, function (i, child) {
var state = nodeSearch(deep + 1, newParents, child.value, isCurAllSelected, result);
if (state[1] === true) {
@ -17383,13 +17430,13 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
}
});
if (can === true) {
checked = isCurAllSelected || (isSelected(parent_values, current) && checked);
createOneJson(parent_values, current, true, checked, false, false, result);
checked = isCurAllSelected || (isSelected(parentValues, current) && checked);
createOneJson(parentValues, current, true, checked, false, false, result);
}
return [can, checked];
}
function createOneJson(parent_values, value, isOpen, checked, half, flag, result) {
function createOneJson(parentValues, value, isOpen, checked, half, flag, result) {
var node = self.map[value];
result.push({
id: node.id,
@ -17397,7 +17444,7 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
text: node.text,
value: node.value,
title: node.title,
isParent: parent_values.length + 1 < self.floors,
isParent: parentValues.length + 1 < self.floors,
open: isOpen,
checked: checked,
halfCheck: half,
@ -17405,8 +17452,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
});
}
function isHalf(parent_values, value) {
var find = findSelectedObj(parent_values);
function isHalf(parentValues, value) {
var find = findSelectedObj(parentValues);
if (find == null) {
return null;
}
@ -17419,8 +17466,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
});
}
function isAllSelected(parent_values, value) {
var find = findSelectedObj(parent_values);
function isAllSelected(parentValues, value) {
var find = findSelectedObj(parentValues);
if (find == null) {
return null;
}
@ -17433,8 +17480,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
});
}
function isSelected(parent_values, value) {
var find = findSelectedObj(parent_values);
function isSelected(parentValues, value) {
var find = findSelectedObj(parentValues);
if (find == null) {
return false;
}
@ -17445,12 +17492,12 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
});
}
function findSelectedObj(parent_values) {
var find = selected_values;
function findSelectedObj(parentValues) {
var find = selectedValues;
if (find == null) {
return null;
}
BI.every(parent_values, function (i, v) {
BI.every(parentValues, function (i, v) {
find = find[v];
if (find == null) {
return false;
@ -17465,23 +17512,23 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
var self = this;
var result = [];
var times = op.times;
var check_state = op.check_state || {};
var parent_values = op.parent_values || [];
var selected_values = op.selected_values;
var checkState = op.checkState || {};
var parentValues = op.parentValues || [];
var selectedValues = op.selectedValues;
var valueMap = {};
if (judgeState(parent_values, selected_values, check_state)) {
valueMap = dealWidthSelectedValue(parent_values, selected_values);
if (judgeState(parentValues, selectedValues, checkState)) {
valueMap = dealWidthSelectedValue(parentValues, selectedValues);
}
var nodes = this._getChildren(parent_values);
var nodes = this._getChildren(parentValues);
for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) {
var state = getCheckState(nodes[i].value, parent_values, valueMap, check_state);
var state = getCheckState(nodes[i].value, parentValues, valueMap, checkState);
result.push({
id: nodes[i].id,
pId: nodes[i].pId,
value: nodes[i].value,
text: nodes[i].text,
times: 1,
isParent: parent_values.length + 1 < this.floors,
isParent: parentValues.length + 1 < this.floors,
checked: state[0],
halfCheck: state[1]
})
@ -17493,20 +17540,20 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
});
});
function judgeState(parent_values, selected_value, check_state) {
var checked = check_state.checked, half = check_state.half;
if (parent_values.length > 0 && !checked) {
function judgeState(parentValues, selected_value, checkState) {
var checked = checkState.checked, half = checkState.half;
if (parentValues.length > 0 && !checked) {
return false;
}
return (parent_values.length === 0 || (checked && half) && !BI.isEmpty(selected_value));
return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value));
}
function dealWidthSelectedValue(parent_values, selected_values) {
function dealWidthSelectedValue(parentValues, selectedValues) {
var valueMap = {};
BI.each(parent_values, function (i, v) {
selected_values = selected_values[v];
BI.each(parentValues, function (i, v) {
selectedValues = selectedValues[v];
});
BI.each(selected_values, function (value, obj) {
BI.each(selectedValues, function (value, obj) {
if (BI.isNull(obj)) {
valueMap[value] = [0, 0];
return;
@ -17526,14 +17573,14 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return valueMap;
}
function getCheckState(current, parent_values, valueMap, check_state) {
var checked = check_state.checked, half = check_state.half;
var hasChild = parent_values.length + 1 < self.floors;
function getCheckState(current, parentValues, valueMap, checkState) {
var checked = checkState.checked, half = checkState.half;
var hasChild = parentValues.length + 1 < self.floors;
var tempCheck = false, halfCheck = false;
if (BI.has(valueMap, current)) {
//可能是半选
if (valueMap[current][0] === 1) {
var values = BI.clone(parent_values);
var values = BI.clone(parentValues);
values.push(current);
if (hasChild && self._getChildCount(values) != valueMap[current][1]) {
halfCheck = true;
@ -17572,9 +17619,9 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return this.tree.search(v, "value");
},
_getChildren: function (parent_values) {
if (parent_values.length > 0) {
var value = BI.last(parent_values);
_getChildren: function (parentValues) {
if (parentValues.length > 0) {
var value = BI.last(parentValues);
var parent = this.tree.search(value, "value");
} else {
var parent = this.tree.getRoot();
@ -17582,8 +17629,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return parent.getChildren();
},
_getChildCount: function (parent_values) {
return this._getChildren(parent_values).length;
_getChildCount: function (parentValues) {
return this._getChildren(parentValues).length;
},
setValue: function (v) {
@ -17685,8 +17732,8 @@ BI.ValueChooserCombo = BI.inherit(BI.Widget, {
var search = BI.Func.getSearchResult(items, kw);
items = search.matched.concat(search.finded);
});
if (options.selected_values) {//过滤
var filter = BI.makeObject(options.selected_values, true);
if (options.selectedValues) {//过滤
var filter = BI.makeObject(options.selectedValues, true);
items = BI.filter(items, function (i, ob) {
return !filter[ob.value];
});

36
src/base/combination/searcher.js

@ -27,7 +27,6 @@ BI.Searcher = BI.inherit(BI.Widget, {
callback([])
},
el: {
type: "bi.search_editor"
},
@ -85,16 +84,11 @@ BI.Searcher = BI.inherit(BI.Widget, {
_assertPopupView: function () {
var self = this, o = this.options;
if (!BI.Maskers.has(this.getName())) {
if ((o.masker && !BI.Maskers.has(this.getName())) || (o.masker === false && !this.popupView)) {
this.popupView = BI.createWidget(o.popup, {
type: "bi.searcher_view",
chooseType: o.chooseType
});
BI.Maskers.create(this.getName(), o.adapter, BI.extend({
container: this,
render: this.popupView
}, o.masker));
this.popupView.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
@ -121,6 +115,12 @@ BI.Searcher = BI.inherit(BI.Widget, {
self.fireEvent(BI.Searcher.EVENT_AFTER_INIT);
});
}
if (o.masker && !BI.Maskers.has(this.getName())) {
BI.Maskers.create(this.getName(), o.adapter, BI.extend({
container: this,
render: this.popupView
}, o.masker));
}
},
_startSearch: function () {
@ -142,7 +142,7 @@ BI.Searcher = BI.inherit(BI.Widget, {
BI.nextTick(function (name) {
BI.Maskers.hide(name);
}, this.getName());
if (BI.Maskers.has(name) && this._isSearching === true) {
if (this._isSearching === true) {
this.popupView && this.popupView.pauseSearch && this.popupView.pauseSearch();
this.fireEvent(BI.Searcher.EVENT_PAUSE);
}
@ -153,11 +153,7 @@ BI.Searcher = BI.inherit(BI.Widget, {
var o = this.options, name = this.getName();
this._stop = true;
BI.Maskers.hide(name);
if (BI.Maskers.has(name) && this._isSearching === true) {
//搜索后清空dom
// BI.nextTick(function () {
// BI.Maskers.has(name) && BI.Maskers.get(name).empty();
// });
if (this._isSearching === true) {
this.popupView && this.popupView.stopSearch && this.popupView.stopSearch();
this.fireEvent(BI.Searcher.EVENT_STOP);
}
@ -170,11 +166,11 @@ BI.Searcher = BI.inherit(BI.Widget, {
return;
}
if (o.isAutoSearch) {
var items = (o.adapter.getItems && o.adapter.getItems()) || o.adapter.attr("items") || [];
var items = (o.adapter && ((o.adapter.getItems && o.adapter.getItems()) || o.adapter.attr("items"))) || [];
var finding = BI.Func.getSearchResult(items, keyword);
var matched = finding.matched, finded = finding.finded;
this.popupView.populate(finded, matched, keyword);
o.isAutoSync && this.popupView.setValue(o.adapter.getValue());
o.isAutoSync && o.adapter && o.adapter.getValue && this.popupView.setValue(o.adapter.getValue());
self.fireEvent(BI.Searcher.EVENT_SEARCHING);
return;
}
@ -191,7 +187,7 @@ BI.Searcher = BI.inherit(BI.Widget, {
}
BI.Maskers.show(self.getName());
self.popupView.populate.apply(self.popupView, args);
o.isAutoSync && self.popupView.setValue(o.adapter && o.adapter.getValue());
o.isAutoSync && o.adapter && o.adapter.getValue && self.popupView.setValue(o.adapter.getValue());
self.popupView.loaded && self.popupView.loaded();
self.fireEvent(BI.Searcher.EVENT_SEARCHING);
}
@ -265,13 +261,15 @@ BI.Searcher = BI.inherit(BI.Widget, {
getValue: function () {
var o = this.options;
if (o.isAutoSync) {
if (o.isAutoSync && o.adapter && o.adapter.getValue) {
return o.adapter.getValue();
}
if (this.isSearching()) {
return this.popupView.getValue();
} else {
} else if (o.adapter && o.adapter.getValue) {
return o.adapter.getValue();
} else {
return this.popupView.getValue();
}
},
@ -279,7 +277,7 @@ BI.Searcher = BI.inherit(BI.Widget, {
var o = this.options;
this._assertPopupView();
this.popupView.populate.apply(this.popupView, arguments);
if (o.isAutoSync) {
if (o.isAutoSync && o.adapter && o.adapter.getValue) {
this.popupView.setValue(o.adapter.getValue());
}
},

2
src/base/pager/pager.js

@ -176,7 +176,7 @@ BI.Pager = BI.inherit(BI.Widget, {
type: "bi.button_group",
element: this,
items: BI.createItems(view, {
cls: "page-item",
cls: "bi-list-item-select",
height: 23,
hgap: 10
}),

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

@ -184,12 +184,14 @@ BI.BasicButton = BI.inherit(BI.Single, {
});
break;
default:
if (o.stopEvent || o.stopPropagation) {
hand.mousedown(function (e) {
ev(e);
});
hand.mouseup(function (e) {
ev(e);
});
}
hand.click(clk);
break;
}

2
src/base/single/text.js

@ -110,7 +110,7 @@ BI.Text = BI.inherit(BI.Single, {
setText: function (text) {
BI.Text.superclass.setText.apply(this, arguments);
this.options.text = text;
this.text.element.html(BI.escape(text).replaceAll(" ", "&nbsp;"));
this.text.element.text((text + "").replaceAll(" ", " "));
}
});

4
src/base/table/table.grid.js

@ -330,11 +330,11 @@ BI.GridTable = BI.inherit(BI.Widget, {
this.topLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0);
this.topLeftGrid.setEstimatedRowSize(o.headerRowSize);
this.topRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength));
this.topRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.topRightGrid.setEstimatedRowSize(o.headerRowSize);
this.bottomLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0);
this.bottomLeftGrid.setEstimatedRowSize(o.rowSize);
this.bottomRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength));
this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.bottomRightGrid.setEstimatedRowSize(o.rowSize);
var items = this.contextLayout.attr("items");

4
src/base/table/table.grid.quick.js

@ -115,11 +115,11 @@ BI.QuickGridTable = BI.inherit(BI.GridTable, {
this.topLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0);
this.topLeftGrid.setEstimatedRowSize(o.headerRowSize);
this.topRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength));
this.topRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.topRightGrid.setEstimatedRowSize(o.headerRowSize);
this.bottomLeftGrid.setEstimatedColumnSize(freezeColLength > 0 ? totalLeftColumnSize / freezeColLength : 0);
this.bottomLeftGrid.setEstimatedRowSize(o.rowSize);
this.bottomRightGrid.setEstimatedColumnSize(totalRightColumnSize / (o.columnSize.length - freezeColLength));
this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.bottomRightGrid.setEstimatedRowSize(o.rowSize);
var items = this.contextLayout.attr("items");

341
src/base/table/table.js

@ -348,10 +348,6 @@ BI.Table = BI.inherit(BI.Widget, {
}]]
}))));
//var scrollElement = isRight ? scrollBottomLeft.element : scrollBottomRight.element;
//var scrollTopElement = isRight ? scrollTopLeft.element : scrollTopRight.element;
//var otherElement = isRight ? scrollBottomRight.element : scrollBottomLeft.element;
this._initFreezeScroll();
BI.nextTick(function () {
if (self.element.is(":visible")) {
@ -368,268 +364,19 @@ BI.Table = BI.inherit(BI.Widget, {
_initFreezeScroll: function () {
var self = this, o = this.options;
scroll(this.scrollBottomRight.element, this.scrollTopRight.element, this.scrollBottomLeft.element);
scroll(this.scrollBottomLeft.element, this.scrollTopLeft.element, this.scrollBottomRight.element);
// scroll(this.scrollBottomLeft.element, this.scrollTopLeft.element, this.scrollBottomRight.element);
function scroll(scrollElement, scrollTopElement, otherElement) {
var scrolling, scrollingX;
var fn = function (event, delta, deltaX, deltaY) {
var inf = self._getScrollOffsetAndDur(event);
if (deltaY < 0 || deltaY > 0) {
if (scrolling) {
scrollElement[0].scrollTop = scrolling;
}
scrolling = scrollElement[0].scrollTop - delta * inf.offset;
var stopPropagation = false;
var st = scrollElement[0].scrollTop;
scrollElement[0].scrollTop = scrolling;
if (scrollElement[0].scrollTop !== st) {
stopPropagation = true;
}
scrollElement[0].scrollTop = st;
self._animateScrollTo(scrollElement, scrollElement[0].scrollTop, scrolling, inf.dur, "linear", {
onStart: function () {
},
onUpdate: function (top) {
otherElement[0].scrollTop = top;
self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, top);
},
onComplete: function () {
self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, scrolling);
scrolling = null;
}
});
//otherElement[0].scrollTop = scrollTop;
//scrollElement[0].scrollTop = scrollTop;
//self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, scrollTop);
if (stopPropagation === true) {
event.stopPropagation();
return false;
}
return;
}
//if (deltaX < 0 || deltaX > 0) {
// if (scrollingX) {
// scrollElement[0].scrollLeft = scrollingX;
// }
// scrollingX = scrollElement[0].scrollLeft + delta * inf.offset;
// var stopPropagation = false;
// var sl = scrollElement[0].scrollLeft;
// scrollElement[0].scrollLeft = scrollingX;
// if (scrollElement[0].scrollLeft !== sl) {
// stopPropagation = true;
// }
// scrollElement[0].scrollLeft = sl;
// self._animateScrollTo(scrollElement, scrollElement[0].scrollLeft, scrollingX, inf.dur, "linear", {
// direction: "left",
// onStart: function () {
// },
// onUpdate: function (left) {
// scrollTopElement[0].scrollLeft = left;
// self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, null, left);
// },
// onComplete: function () {
// self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, null, scrollingX);
// scrollingX = null;
// }
// });
//
//
// //otherElement[0].scrollTop = scrollTop;
// //scrollElement[0].scrollTop = scrollTop;
// //self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, scrollTop);
// if (stopPropagation === true) {
// event.stopPropagation();
// return false;
// }
//}
};
scrollElement.mousewheel(fn);
var scrollTop = 0, scrollLeft = 0;
scrollElement.scroll(function (e) {
var change = false;
if (scrollElement.scrollTop() != scrollTop) {
var old = otherElement.scrollTop();
otherElement.scrollTop(scrollElement.scrollTop());
scrollTop = scrollElement.scrollTop();
if (Math.abs(old - otherElement[0].scrollTop) > 0.1) {
e.stopPropagation();
change = true;
}
}
if (scrollElement.scrollLeft() != scrollLeft) {
var old = scrollTopElement.scrollLeft();
scrollTopElement.scrollLeft(scrollElement.scrollLeft());
scrollLeft = scrollElement.scrollLeft();
if (Math.abs(old - scrollTopElement[0].scrollLeft) > 0.1) {
e.stopPropagation();
change = true;
}
}
// self.fireEvent(BI.Table.EVENT_TABLE_SCROLL);
if (change === true) {
e.stopPropagation();
//return false;
}
self.fireEvent(BI.Table.EVENT_TABLE_SCROLL);
});
}
},
_animateScrollTo: function (el, from, to, duration, easing, op) {
var self = this;
var onStart = op.onStart, onComplete = op.onComplete, onUpdate = op.onUpdate;
var startTime = BI.getTime(), _delay, progress = 0, _request;
_cancelTween();
_startTween();
var diff = to - from;
el._stop = 0;
function _step() {
if (el._stop) {
return;
}
if (!progress) {
onStart.call();
}
progress = BI.getTime() - startTime;
_tween();
if (progress >= el.time) {
el.time = (progress > el.time) ? progress + _delay - (progress - el.time) : progress + _delay - 1;
if (el.time < progress + 1) {
el.time = progress + 1;
}
}
if (el.time < duration) {
el._id = _request(_step);
} else {
el[op.direction == 'left' ? "scrollLeft" : "scrollTop"](to);
onComplete.call();
}
}
function _tween() {
var top = to;
if (duration > 0) {
el.currVal = _ease(el.time, from, diff, duration, easing);
el[op.direction == 'left' ? "scrollLeft" : "scrollTop"](top = Math.round(el.currVal));
} else {
el[op.direction == 'left' ? "scrollLeft" : "scrollTop"](to);
}
onUpdate(top);
}
function _startTween() {
_delay = 1000 / 60;
el.time = progress + _delay;
_request = (!requestAnimationFrame()) ? function (f) {
_tween();
return setTimeout(f, 0.01);
} : requestAnimationFrame();
el._id = _request(_step);
}
function requestAnimationFrame() {
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.msRequestAnimationFrame ||
window.oRequestAnimationFrame;
}
function cancelAnimationFrame() {
return window.cancelAnimationFrame ||
window.webkitCancelAnimationFrame ||
window.mozCancelAnimationFrame ||
window.msCancelAnimationFrame ||
window.oCancelAnimationFrame ||
window.cancelRequestAnimationFrame ||
window.webkitCancelRequestAnimationFrame ||
window.mozCancelRequestAnimationFrame ||
window.msCancelRequestAnimationFrame ||
window.oCancelRequestAnimationFrame
}
function _cancelTween() {
if (el._id == null) {
return;
}
if (!cancelAnimationFrame()) {
clearTimeout(el._id);
} else {
cancelAnimationFrame()(el._id);
}
el._id = null;
}
function _ease(t, b, c, d, type) {
switch (type) {
case "linear":
return c * t / d + b;
break;
case "mcsLinearOut":
t /= d;
t--;
return c * Math.sqrt(1 - t * t) + b;
break;
case "easeInOutSmooth":
t /= d / 2;
if (t < 1) {
return c / 2 * t * t + b;
}
t--;
return -c / 2 * (t * (t - 2) - 1) + b;
break;
case "easeInOutStrong":
t /= d / 2;
if (t < 1) {
return c / 2 * Math.pow(2, 10 * (t - 1)) + b;
}
t--;
return c / 2 * ( -Math.pow(2, -10 * t) + 2 ) + b;
break;
case "easeInOut":
case "mcsEaseInOut":
t /= d / 2;
if (t < 1) {
return c / 2 * t * t * t + b;
}
t -= 2;
return c / 2 * (t * t * t + 2) + b;
break;
case "easeOutSmooth":
t /= d;
t--;
return -c * (t * t * t * t - 1) + b;
break;
case "easeOutStrong":
return c * ( -Math.pow(2, -10 * t / d) + 1 ) + b;
break;
case "easeOut":
case "mcsEaseOut":
default:
var ts = (t /= d) * t, tc = ts * t;
return b + c * (0.499999999999997 * tc * ts + -2.5 * ts * ts + 5.5 * tc + -6.5 * ts + 4 * t);
}
}
},
_getScrollOffsetAndDur: function (event) {
var offset = 40, dur = 200;
if (event.originalEvent.wheelDelta) {
offset = Math.abs(event.originalEvent.wheelDelta);
}
if (event.deltaFactor < 2) {
offset = 3;
dur = 17;
}
return {
offset: offset,
dur: dur
};
},
resize: function () {
this._resize();
this._resize && this._resize();
},
_createCells: function (items, columnSize, mergeCols, TDs, Ws, start, rowSize) {
@ -881,17 +628,7 @@ BI.Table = BI.inherit(BI.Widget, {
items: [this.scrollBottomRight]
});
this._resize = function () {
if (self.element.is(":visible")) {
self.setColumnSize(o.columnSize);
}
};
this._initNormalScroll();
BI.ResizeDetector.addResizeListener(this, function () {
self._resize();
self.fireEvent(BI.Table.EVENT_TABLE_RESIZE);
});
BI.nextTick(function () {
if (self.element.is(":visible")) {
self.fireEvent(BI.Table.EVENT_TABLE_AFTER_INIT);
@ -901,66 +638,8 @@ BI.Table = BI.inherit(BI.Widget, {
_initNormalScroll: function () {
var self = this;
var scrolling, scrollX;
this.scrollBottomRight.element.mousewheel(function (event, delta, deltaX, deltaY) {
var inf = self._getScrollOffsetAndDur(event);
if (deltaY < 0 || deltaY > 0) {
var ele = self.scrollBottomRight.element;
if (scrolling) {
ele[0].scrollTop = scrolling;
}
scrolling = ele[0].scrollTop - delta * inf.offset;
var stopPropagation = false;
var st = ele[0].scrollTop;
ele[0].scrollTop = scrolling;
if (ele[0].scrollTop !== st) {
stopPropagation = true;
}
ele[0].scrollTop = st;
self._animateScrollTo(ele, ele[0].scrollTop, scrolling, inf.dur, "linear", {
onStart: function () {
},
onUpdate: function (top) {
self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, top);
},
onComplete: function () {
self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, scrolling);
scrolling = null;
}
});
//var scrollTop = self.scrollBottomRight.element[0].scrollTop = self.scrollBottomRight.element[0].scrollTop - delta * offset;
//self.fireEvent(BI.Table.EVENT_TABLE_SCROLL, scrollTop);
if (stopPropagation === true) {
event.stopPropagation();
return false;
}
}
});
var scrollTop = 0, scrollLeft = 0;
this.scrollBottomRight.element.scroll(function (e) {
var change = false;
var scrollElement = self.scrollBottomRight.element;
if (scrollElement.scrollTop() != scrollTop) {
if (Math.abs(scrollElement.scrollTop() - scrollTop) > 0.1) {
e.stopPropagation();
change = true;
}
scrollTop = scrollElement.scrollTop();
}
if (scrollElement.scrollLeft() != scrollLeft) {
if (Math.abs(scrollElement.scrollLeft() - scrollLeft) > 0.1) {
e.stopPropagation();
change = true;
}
scrollLeft = scrollElement.scrollLeft();
}
self.fireEvent(BI.Table.EVENT_TABLE_SCROLL);
if (change === true) {
e.stopPropagation();
//return false;
}
return false;
});
},
@ -1074,7 +753,7 @@ BI.Table = BI.inherit(BI.Widget, {
}
BI.each(colgroupTds, function (i, colgroup) {
var width = colgroup.attr("width") | 0;
if (width !== sizes[i]) {
if (sizes[i] !== "" && width !== sizes[i]) {
var w = self._calculateWidth(sizes[i]);
colgroup.attr("width", w).css("width", w);
BI.each(bodyTds, function (j, items) {
@ -1181,7 +860,7 @@ BI.Table = BI.inherit(BI.Widget, {
} else {
BI.each(this.colgroupTds, function (i, colgroup) {
var width = colgroup.attr("width") | 0;
if (width !== o.columnSize[i]) {
if (o.columnSize[i] !== "" && width !== o.columnSize[i]) {
var w = self._calculateWidth(o.columnSize[i]);
colgroup.attr("width", w).css("width", w);
BI.each(self.bodyTds, function (j, items) {
@ -1388,8 +1067,10 @@ BI.Table = BI.inherit(BI.Widget, {
if (w > 1.05) {
w += o.columnSize.length;
}
if (w > 1.05) {
this.tableContainer.element.width(w);
}
}
},
getColumnSize: function () {
@ -1913,14 +1594,6 @@ BI.Table = BI.inherit(BI.Widget, {
} else {
this._createNormalTable();
}
},
empty: function () {
BI.Table.superclass.empty.apply(this, arguments);
},
destroy: function () {
BI.Table.superclass.destroy.apply(this, arguments);
}
})
;

32
src/base/tree/parttree.js

@ -22,7 +22,7 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
this.tip.setLoading();
o.itemsCreator(op, function (d) {
var hasNext = !!d.hasNext, nodes = d.items || [];
o.paras.last_search_value = d.last_search_value;
o.paras.lastSearchValue = d.lastSearchValue;
if (self._stop === true) {
return;
}
@ -39,35 +39,35 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
_selectTreeNode: function (treeId, treeNode) {
var self = this, o = this.options;
var parent_values = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode));
var parentValues = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode));
var name = this._getNodeValue(treeNode)
// var values = parent_values.concat([name]);
// var values = parentValues.concat([name]);
if (treeNode.checked === true) {
BI.SyncTree.superclass._selectTreeNode.apply(self, arguments);
} else {
o.itemsCreator(BI.extend({}, o.paras, {
type: BI.TreeView.REQ_TYPE_CALCULATE_SELECT_DATA,
selected_values: this.selected_values,
not_selected_value: name,
parent_values: parent_values
selectedValues: this.selectedValues,
notSelectedValue: name,
parentValues: parentValues
}), function (new_values) {
if (BI.isEqual(self.selected_values, new_values)) {
if (BI.isEqual(self.selectedValues, new_values)) {
var tNode = treeNode;
var pNode = self._getTree(new_values, parent_values);
var pNode = self._getTree(new_values, parentValues);
if (pNode[name]) {
delete pNode[name];
}
while (tNode != null && BI.isEmpty(pNode)) {
parent_values = parent_values.slice(0, parent_values.length - 1);
parentValues = parentValues.slice(0, parentValues.length - 1);
tNode = tNode.getParentNode();
if (tNode != null) {
pNode = self._getTree(new_values, parent_values);
pNode = self._getTree(new_values, parentValues);
name = self._getNodeValue(tNode);
delete pNode[name];
}
}
}
self.selected_values = new_values;
self.selectedValues = new_values;
BI.SyncTree.superclass._selectTreeNode.apply(self, arguments);
});
}
@ -120,7 +120,7 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
return;
}
var hasNext = !!d.hasNext, nodes = d.items || [];
o.paras.last_search_value = d.last_search_value;
o.paras.lastSearchValue = d.lastSearchValue;
if (nodes.length > 0) {
callback(self._dealWidthNodes(nodes));
}
@ -151,7 +151,7 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
var result = BI.PartTree.superclass.getValue.apply(this, arguments);
o.itemsCreator({
type: BI.TreeView.REQ_TYPE_ADJUST_DATA,
selected_values: result
selectedValues: result
}, function (res) {
result = res;
});
@ -163,10 +163,10 @@ BI.PartTree = BI.inherit(BI.SyncTree, {
var o = this.options;
delete o.paras.keyword;
BI.extend(o.paras, config);
delete o.paras.last_search_value;
delete o.paras.lastSearchValue;
//取消选中时使用
this.selected_values = BI.deepClone(o.paras.selected_values) || {};
//delete this.options.paras.selected_values;
this.selectedValues = BI.deepClone(o.paras.selectedValues) || {};
//delete this.options.paras.selectedValues;
var setting = this._configSetting();
this._initTree(setting, o.paras.keyword);
}

24
src/base/tree/synctree.js

@ -99,21 +99,21 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
_selectTreeNode: function (treeId, treeNode) {
var self = this, o = this.options;
var parent_values = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode));
var parentValues = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode));
var name = this._getNodeValue(treeNode)
// var values = parent_values.concat([name]);
// var values = parentValues.concat([name]);
if (treeNode.checked === true) {
} else {
var tNode = treeNode;
var pNode = this._getTree(this.selected_values, parent_values);
var pNode = this._getTree(this.selectedValues, parentValues);
if (BI.isNotNull(pNode[name])) {
delete pNode[name];
}
while (tNode != null && BI.isEmpty(pNode)) {
parent_values = parent_values.slice(0, parent_values.length - 1);
parentValues = parentValues.slice(0, parentValues.length - 1);
tNode = tNode.getParentNode();
if (tNode != null) {
pNode = this._getTree(this.selected_values, parent_values);
pNode = this._getTree(this.selectedValues, parentValues);
name = this._getNodeValue(tNode);
delete pNode[name];
}
@ -129,8 +129,8 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
var op = BI.extend({}, o.paras, {
"id": treeNode.id,
"times": 1,
"parent_values": parentValues.concat(this._getNodeValue(treeNode)),
"check_state": treeNode.getCheckStatus()
"parentValues": parentValues.concat(this._getNodeValue(treeNode)),
"checkState": treeNode.getCheckStatus()
});
var complete = function (d) {
var nodes = d.items || [];
@ -178,7 +178,7 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
},
hasChecked: function () {
return !BI.isEmpty(this.selected_values) || BI.SyncTree.superclass.hasChecked.apply(this, arguments);
return !BI.isEmpty(this.selectedValues) || BI.SyncTree.superclass.hasChecked.apply(this, arguments);
},
getValue: function () {
@ -187,12 +187,12 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
}
var checkedValues = this._getSelectedValues();
if (BI.isEmpty(checkedValues)) {
return this.selected_values;
return this.selectedValues;
}
if (BI.isEmpty(this.selected_values)) {
if (BI.isEmpty(this.selectedValues)) {
return checkedValues;
}
return this._join(checkedValues, this.selected_values);
return this._join(checkedValues, this.selectedValues);
},
//生成树方法
@ -200,7 +200,7 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
delete this.options.keyword;
BI.extend(this.options.paras, config);
//取消选中时使用
this.selected_values = BI.deepClone(this.options.paras.selected_values) || {};
this.selectedValues = BI.deepClone(this.options.paras.selectedValues) || {};
var setting = this._configSetting();
this._initTree(setting);
}

35
src/base/tree/treeview.js

@ -109,8 +109,8 @@ BI.TreeView = BI.inherit(BI.Pane, {
treeNode.times = treeNode.times || 1;
var param = "id=" + treeNode.id
+ "&times=" + (treeNode.times++)
+ "&parent_values= " + window.encodeURIComponent(BI.jsonEncode(parentNode))
+ "&check_state=" + window.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus()));
+ "&parentValues= " + window.encodeURIComponent(BI.jsonEncode(parentNode))
+ "&checkState=" + window.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus()));
return BI.servletURL + '?op=' + self.options.op + '&cmd=' + self.options.cmd + "&" + param;
}
@ -241,7 +241,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
this._buildTree(map, path);
return;
}
var storeValues = BI.deepClone(this.options.paras.selected_values);
var storeValues = BI.deepClone(this.options.paras.selectedValues);
var treeNode = this._getTree(storeValues, path);
this._addTreeNode(map, parent, this._getNodeValue(node), treeNode);
},
@ -306,14 +306,15 @@ BI.TreeView = BI.inherit(BI.Pane, {
//处理节点
_dealWidthNodes: function (nodes) {
var self = this, o = this.options;
//处理标红
if (BI.isKey(o.paras.keyword)) {
var keyword = o.paras.keyword;
var ns = BI.Tree.arrayFormat(nodes);
BI.each(ns, function (i, n) {
n.text = $("<div>").__textKeywordMarked__(n.text, keyword, n.py).html();
});
//处理标红
if (BI.isKey(o.paras.keyword)) {
n.text = $("<div>").__textKeywordMarked__(n.text, o.paras.keyword, n.py).html();
} else {
n.text = (n.text + "").replaceAll(" ", " ");
}
});
return nodes;
},
@ -356,8 +357,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
self.nodes = $.fn.zTree.init(tree.element, setting, nodes);
};
var op = BI.extend({}, o.paras, {
times: 1,
type: BI.TreeView.REQ_TYPE_INIT_DATA
times: 1
});
o.itemsCreator(op, function (res) {
@ -399,7 +399,8 @@ BI.TreeView = BI.inherit(BI.Pane, {
},
view: {
showIcon: false,
expandSpeed: ""
expandSpeed: "",
nameIsHTML: true
},
callback: {}
};
@ -449,8 +450,8 @@ BI.TreeView = BI.inherit(BI.Pane, {
},
setSelectedValue: function (value) {
this.options.paras.selected_values = value || {};
this.selected_values = BI.deepClone(value) || {};
this.options.paras.selectedValues = value || {};
this.selectedValues = BI.deepClone(value) || {};
},
updateValue: function (values, param) {
@ -490,10 +491,10 @@ BI.TreeView = BI.inherit(BI.Pane, {
}
});
BI.extend(BI.TreeView, {
REQ_TYPE_INIT_DATA: 0,
REQ_TYPE_ADJUST_DATA: 1,
REQ_TYPE_CALCULATE_SELECT_DATA: 2,
REQ_TYPE_SELECTED_DATA: 3
REQ_TYPE_INIT_DATA: 1,
REQ_TYPE_ADJUST_DATA: 2,
REQ_TYPE_SELECT_DATA: 3,
REQ_TYPE_GET_SELECTED_DATA: 4
});
BI.TreeView.EVENT_CHANGE = "EVENT_CHANGE";

3
src/case/button/item.multiselect.js

@ -66,6 +66,9 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, {
doClick: function () {
BI.MultiSelectItem.superclass.doClick.apply(this, arguments);
this.checkbox.setSelected(this.isSelected());
if (this.isValid()) {
this.fireEvent(BI.MultiSelectItem.EVENT_CHANGE, this.getValue(), this);
}
},
setSelected: function (v) {

2
src/case/combo/formulacombo/trigger.formulacombo.js

@ -36,7 +36,7 @@ BI.FormulaComboTrigger = BI.inherit(BI.Widget, {
var str = item.match(fieldRegx);
if (BI.isNotEmptyArray(str)) {
var id = str[0].substring(2, item.length - 1);
var item = BI.find(self.options.items, function (i, item) {
var item = BI.find(BI.flatten(self.options.items), function (i, item) {
return id === item.value;
});
formulaString = formulaString + item.text;

8
src/case/editor/editor.state.js

@ -50,7 +50,7 @@ BI.StateEditor = BI.inherit(BI.Single, {
cls: "state-editor-infinite-text bi-disabled",
textAlign: "left",
height: o.height,
text: BI.i18nText("BI-Unrestricted"),
text: BI.i18nText("BI-Basic_Unrestricted"),
hgap: 4,
handler: function () {
self._showInput();
@ -226,7 +226,7 @@ BI.StateEditor = BI.inherit(BI.Single, {
this.text.setTitle("");
this.text.element.removeClass("state-editor-infinite-text");
} else {
this.text.setText(BI.i18nText("BI-Unrestricted"));
this.text.setText(BI.i18nText("BI-Basic_Unrestricted"));
this.text.setTitle("");
this.text.element.addClass("state-editor-infinite-text");
}
@ -234,7 +234,7 @@ BI.StateEditor = BI.inherit(BI.Single, {
}
if (BI.isString(v)) {
if (BI.isEmpty(v)) {
this.text.setText(BI.i18nText("BI-Unrestricted"));
this.text.setText(BI.i18nText("BI-Basic_Unrestricted"));
this.text.setTitle("");
this.text.element.addClass("state-editor-infinite-text");
} else {
@ -246,7 +246,7 @@ BI.StateEditor = BI.inherit(BI.Single, {
}
if (BI.isArray(v)) {
if (BI.isEmpty(v)) {
this.text.setText(BI.i18nText("BI-Unrestricted"));
this.text.setText(BI.i18nText("BI-Basic_Unrestricted"));
this.text.element.addClass("state-editor-infinite-text");
} else if (v.length === 1) {
this.text.setText(v[0]);

6
src/case/editor/editor.state.simple.js

@ -50,7 +50,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Single, {
cls: "state-editor-infinite-text bi-disabled",
textAlign: "left",
height: o.height,
text: BI.i18nText("BI-Unrestricted"),
text: BI.i18nText("BI-Basic_Unrestricted"),
hgap: 4,
handler: function () {
self._showInput();
@ -222,7 +222,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Single, {
this.text.setText(BI.i18nText("BI-Already_Selected"));
this.text.element.removeClass("state-editor-infinite-text");
} else {
this.text.setText(BI.i18nText("BI-Unrestricted"));
this.text.setText(BI.i18nText("BI-Basic_Unrestricted"));
this.text.element.addClass("state-editor-infinite-text");
}
return;
@ -232,7 +232,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Single, {
this.text.setTitle(v);
this.text.element.removeClass("state-editor-infinite-text");
} else if (BI.isEmpty(v)) {
this.text.setText(BI.i18nText("BI-Unrestricted"));
this.text.setText(BI.i18nText("BI-Basic_Unrestricted"));
this.text.element.addClass("state-editor-infinite-text");
} else {
this.text.setText(BI.i18nText("BI-Already_Selected"));

7
src/case/segment/segment.js

@ -19,15 +19,10 @@ BI.Segment = BI.inherit(BI.Widget, {
this.buttonGroup = BI.createWidget({
element: this,
type: "bi.button_group",
items: BI.map(o.items, function (i, item) {
return BI.extend({
items: BI.createItems(o.items, {
type: "bi.segment_button",
height: o.height - 2,
whiteSpace: o.whiteSpace
}, item, {
cls: (i === 0 ? "bi-border-left " : "")
+ (item.cls || "") + " bi-border-top bi-border-right bi-border-bottom"
});
}),
layout: [
{

4
src/component/allvaluechooser/combo.allvaluechooser.js

@ -72,8 +72,8 @@ BI.AllValueChooserCombo = BI.inherit(BI.Widget, {
var search = BI.Func.getSearchResult(items, kw);
items = search.matched.concat(search.finded);
});
if (options.selected_values) {//过滤
var filter = BI.makeObject(options.selected_values, true);
if (options.selectedValues) {//过滤
var filter = BI.makeObject(options.selectedValues, true);
items = BI.filter(items, function (i, ob) {
return !filter[ob.value];
});

158
src/component/treevaluechooser/combo.treevaluechooser.js

@ -83,10 +83,10 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
case BI.TreeView.REQ_TYPE_ADJUST_DATA:
self._reqAdjustTreeNode(options, callback);
break;
case BI.TreeView.REQ_TYPE_CALCULATE_SELECT_DATA:
case BI.TreeView.REQ_TYPE_SELECT_DATA:
self._reqSelectedTreeNode(options, callback);
break;
case BI.TreeView.REQ_TYPE_SELECTED_DATA:
case BI.TreeView.REQ_TYPE_GET_SELECTED_DATA:
self._reqDisplayTreeNode(options, callback);
break;
default :
@ -99,27 +99,27 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
_reqDisplayTreeNode: function (op, callback) {
var self = this;
var result = [];
var selected_values = op.selected_values;
var selectedValues = op.selectedValues;
if (selected_values == null || BI.isEmpty(selected_values)) {
if (selectedValues == null || BI.isEmpty(selectedValues)) {
callback({});
return;
}
doCheck(0, [], selected_values);
doCheck(0, [], selectedValues);
callback({
items: result
});
function doCheck(floor, parent_values, selected) {
function doCheck(floor, parentValues, selected) {
if (floor >= self.floors) {
return;
}
if (selected == null || BI.isEmpty(selected)) {
var children = self._getChildren(parent_values);
var children = self._getChildren(parentValues);
BI.each(children, function (i, child) {
var newParents = BI.clone(parent_values);
var newParents = BI.clone(parentValues);
newParents.push(child.value);
var llen = self._getChildCount(newParents);
createOneJson(child, llen);
@ -129,19 +129,19 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
}
BI.each(selected, function (k) {
var node = self._getNode(k);
var newParents = BI.clone(parent_values);
var newParents = BI.clone(parentValues);
newParents.push(node.value);
createOneJson(node, getCount(selected[k], newParents));
doCheck(floor + 1, newParents, selected[k]);
})
}
function getCount(jo, parent_values) {
function getCount(jo, parentValues) {
if (jo == null) {
return 0;
}
if (BI.isEmpty(jo)) {
return self._getChildCount(parent_values);
return self._getChildCount(parentValues);
}
return BI.size(jo);
@ -160,30 +160,30 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
_reqSelectedTreeNode: function (op, callback) {
var self = this;
var selected_values = op.selected_values;
var not_selected_value = op.not_selected_value || {};
var selectedValues = op.selectedValues;
var notSelectedValue = op.notSelectedValue || {};
var keyword = op.keyword || "";
var parent_values = op.parent_values || [];
var parentValues = op.parentValues || [];
if (selected_values == null || BI.isEmpty(selected_values)) {
if (selectedValues == null || BI.isEmpty(selectedValues)) {
callback({});
return;
}
dealWithSelectedValues(selected_values);
callback(selected_values);
dealWithSelectedValues(selectedValues);
callback(selectedValues);
function dealWithSelectedValues(selected_values) {
var p = BI.clone(parent_values);
p.push(not_selected_value);
function dealWithSelectedValues(selectedValues) {
var p = BI.clone(parentValues);
p.push(notSelectedValue);
if (isChild(selected_values, p)) {
if (isChild(selectedValues, p)) {
var result = [];
var finded = search(parent_values.length + 1, parent_values, not_selected_value, result);
var finded = search(parentValues.length + 1, parentValues, notSelectedValue, result);
if (finded === true) {
var next = selected_values;
var next = selectedValues;
BI.each(p, function (i, v) {
var t = next[v];
if (t == null) {
@ -191,7 +191,7 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
var split = p.slice(0, i);
var expanded = self._getChildren(split);
BI.each(expanded, function (m, child) {
if (i === p.length - 1 && child.value === not_selected_value) {
if (i === p.length - 1 && child.value === notSelectedValue) {
return true;
}
next[child.value] = {};
@ -208,7 +208,7 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
if (result.length > 0) {
BI.each(result, function (i, strs) {
self._buildTree(selected_values, strs);
self._buildTree(selectedValues, strs);
})
}
}
@ -248,8 +248,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return can;
}
function isChild(selected_values, parents) {
var t = selected_values;
function isChild(selectedValues, parents) {
var t = selectedValues;
for (var i = 0; i < parents.length; i++) {
var v = parents[i];
if (!BI.has(t, v)) {
@ -267,16 +267,16 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
_reqAdjustTreeNode: function (op, callback) {
var self = this;
var result = [];
var selected_values = op.selected_values;
if (selected_values == null || BI.isEmpty(selected_values)) {
var selectedValues = op.selectedValues;
if (selectedValues == null || BI.isEmpty(selectedValues)) {
callback({});
return;
}
BI.each(selected_values, function (k, v) {
BI.each(selectedValues, function (k, v) {
result.push([k]);
});
dealWithSelectedValues(selected_values, []);
dealWithSelectedValues(selectedValues, []);
var jo = {};
BI.each(result, function (i, strs) {
@ -313,23 +313,23 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
var self = this;
var result = [];
var keyword = op.keyword || "";
var selected_values = op.selected_values;
var last_search_value = op.last_search_value || "";
var selectedValues = op.selectedValues;
var lastSearchValue = op.lastSearchValue || "";
var output = search();
BI.nextTick(function () {
callback({
hasNext: output.length > self._const.perPage,
items: result,
last_search_value: BI.last(output)
lastSearchValue: BI.last(output)
})
});
function search() {
var children = self._getChildren([]);
var start = children.length;
if (last_search_value !== "") {
if (lastSearchValue !== "") {
for (var j = 0, len = start; j < len; j++) {
if (children[j].value === last_search_value) {
if (children[j].value === lastSearchValue) {
start = j + 1;
break;
}
@ -354,22 +354,22 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return output;
}
function nodeSearch(deep, parent_values, current, isAllSelect, result) {
function nodeSearch(deep, parentValues, current, isAllSelect, result) {
if (self._isMatch(current, keyword)) {
var checked = isAllSelect || isSelected(parent_values, current);
createOneJson(parent_values, current, false, checked, !isAllSelect && isHalf(parent_values, current), true, result);
var checked = isAllSelect || isSelected(parentValues, current);
createOneJson(parentValues, current, false, checked, !isAllSelect && isHalf(parentValues, current), true, result);
return [true, checked];
}
if (deep >= self.floors) {
return [false, false];
}
var newParents = BI.clone(parent_values);
var newParents = BI.clone(parentValues);
newParents.push(current);
var children = self._getChildren(newParents);
var can = false, checked = false;
var isCurAllSelected = isAllSelect || isAllSelected(parent_values, current);
var isCurAllSelected = isAllSelect || isAllSelected(parentValues, current);
BI.each(children, function (i, child) {
var state = nodeSearch(deep + 1, newParents, child.value, isCurAllSelected, result);
if (state[1] === true) {
@ -380,13 +380,13 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
}
});
if (can === true) {
checked = isCurAllSelected || (isSelected(parent_values, current) && checked);
createOneJson(parent_values, current, true, checked, false, false, result);
checked = isCurAllSelected || (isSelected(parentValues, current) && checked);
createOneJson(parentValues, current, true, checked, false, false, result);
}
return [can, checked];
}
function createOneJson(parent_values, value, isOpen, checked, half, flag, result) {
function createOneJson(parentValues, value, isOpen, checked, half, flag, result) {
var node = self.map[value];
result.push({
id: node.id,
@ -394,7 +394,7 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
text: node.text,
value: node.value,
title: node.title,
isParent: parent_values.length + 1 < self.floors,
isParent: parentValues.length + 1 < self.floors,
open: isOpen,
checked: checked,
halfCheck: half,
@ -402,8 +402,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
});
}
function isHalf(parent_values, value) {
var find = findSelectedObj(parent_values);
function isHalf(parentValues, value) {
var find = findSelectedObj(parentValues);
if (find == null) {
return null;
}
@ -416,8 +416,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
});
}
function isAllSelected(parent_values, value) {
var find = findSelectedObj(parent_values);
function isAllSelected(parentValues, value) {
var find = findSelectedObj(parentValues);
if (find == null) {
return null;
}
@ -430,8 +430,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
});
}
function isSelected(parent_values, value) {
var find = findSelectedObj(parent_values);
function isSelected(parentValues, value) {
var find = findSelectedObj(parentValues);
if (find == null) {
return false;
}
@ -442,12 +442,12 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
});
}
function findSelectedObj(parent_values) {
var find = selected_values;
function findSelectedObj(parentValues) {
var find = selectedValues;
if (find == null) {
return null;
}
BI.every(parent_values, function (i, v) {
BI.every(parentValues, function (i, v) {
find = find[v];
if (find == null) {
return false;
@ -462,23 +462,23 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
var self = this;
var result = [];
var times = op.times;
var check_state = op.check_state || {};
var parent_values = op.parent_values || [];
var selected_values = op.selected_values;
var checkState = op.checkState || {};
var parentValues = op.parentValues || [];
var selectedValues = op.selectedValues;
var valueMap = {};
if (judgeState(parent_values, selected_values, check_state)) {
valueMap = dealWidthSelectedValue(parent_values, selected_values);
if (judgeState(parentValues, selectedValues, checkState)) {
valueMap = dealWidthSelectedValue(parentValues, selectedValues);
}
var nodes = this._getChildren(parent_values);
var nodes = this._getChildren(parentValues);
for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) {
var state = getCheckState(nodes[i].value, parent_values, valueMap, check_state);
var state = getCheckState(nodes[i].value, parentValues, valueMap, checkState);
result.push({
id: nodes[i].id,
pId: nodes[i].pId,
value: nodes[i].value,
text: nodes[i].text,
times: 1,
isParent: parent_values.length + 1 < this.floors,
isParent: parentValues.length + 1 < this.floors,
checked: state[0],
halfCheck: state[1]
})
@ -490,20 +490,20 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
});
});
function judgeState(parent_values, selected_value, check_state) {
var checked = check_state.checked, half = check_state.half;
if (parent_values.length > 0 && !checked) {
function judgeState(parentValues, selected_value, checkState) {
var checked = checkState.checked, half = checkState.half;
if (parentValues.length > 0 && !checked) {
return false;
}
return (parent_values.length === 0 || (checked && half) && !BI.isEmpty(selected_value));
return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value));
}
function dealWidthSelectedValue(parent_values, selected_values) {
function dealWidthSelectedValue(parentValues, selectedValues) {
var valueMap = {};
BI.each(parent_values, function (i, v) {
selected_values = selected_values[v];
BI.each(parentValues, function (i, v) {
selectedValues = selectedValues[v];
});
BI.each(selected_values, function (value, obj) {
BI.each(selectedValues, function (value, obj) {
if (BI.isNull(obj)) {
valueMap[value] = [0, 0];
return;
@ -523,14 +523,14 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return valueMap;
}
function getCheckState(current, parent_values, valueMap, check_state) {
var checked = check_state.checked, half = check_state.half;
var hasChild = parent_values.length + 1 < self.floors;
function getCheckState(current, parentValues, valueMap, checkState) {
var checked = checkState.checked, half = checkState.half;
var hasChild = parentValues.length + 1 < self.floors;
var tempCheck = false, halfCheck = false;
if (BI.has(valueMap, current)) {
//可能是半选
if (valueMap[current][0] === 1) {
var values = BI.clone(parent_values);
var values = BI.clone(parentValues);
values.push(current);
if (hasChild && self._getChildCount(values) != valueMap[current][1]) {
halfCheck = true;
@ -569,9 +569,9 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return this.tree.search(v, "value");
},
_getChildren: function (parent_values) {
if (parent_values.length > 0) {
var value = BI.last(parent_values);
_getChildren: function (parentValues) {
if (parentValues.length > 0) {
var value = BI.last(parentValues);
var parent = this.tree.search(value, "value");
} else {
var parent = this.tree.getRoot();
@ -579,8 +579,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.Widget, {
return parent.getChildren();
},
_getChildCount: function (parent_values) {
return this._getChildren(parent_values).length;
_getChildCount: function (parentValues) {
return this._getChildren(parentValues).length;
},
setValue: function (v) {

4
src/component/valuechooser/combo.valuechooser.js

@ -84,8 +84,8 @@ BI.ValueChooserCombo = BI.inherit(BI.Widget, {
var search = BI.Func.getSearchResult(items, kw);
items = search.matched.concat(search.finded);
});
if (options.selected_values) {//过滤
var filter = BI.makeObject(options.selected_values, true);
if (options.selectedValues) {//过滤
var filter = BI.makeObject(options.selectedValues, true);
items = BI.filter(items, function (i, ob) {
return !filter[ob.value];
});

8
src/config.js

@ -57,16 +57,16 @@ $(function () {
//注册控件
BI.Plugin.registerWidget("bi.grid_table", function (ob) {
//IE下滚动条滑动效果不好,禁止掉
if (BI.isIE() || BI.isFireFox()) {
//非chrome下滚动条滑动效果不好,禁止掉
if (!(BI.isChrome() && BI.isWindows() && !BI.isEdge())) {
return BI.extend(ob, {type: "bi.quick_grid_table"});
} else {
return ob;
}
});
BI.Plugin.registerWidget("bi.collection_table", function (ob) {
//IE下滚动条滑动效果不好,禁止掉
if (BI.isIE() || BI.isFireFox()) {
//非chrome下滚动条滑动效果不好,禁止掉
if (!(BI.isChrome() && BI.isWindows() && !BI.isEdge())) {
return BI.extend(ob, {type: "bi.quick_collection_table"});
} else {
return ob;

12
src/core/base.js

@ -1025,6 +1025,10 @@ if (!window.BI) {
return /(msie|trident)/i.test(navigator.userAgent.toLowerCase());
},
isEdge: function () {
return /edge/i.test(navigator.userAgent.toLowerCase());
},
isChrome: function () {
return /chrome/i.test(navigator.userAgent.toLowerCase());
},
@ -1045,6 +1049,14 @@ if (!window.BI) {
return /Konqueror|Safari|KHTML/i.test(navigator.userAgent);
},
isMac: function () {
return /macintosh|mac os x/i.test(navigator.userAgent);
},
isWindows: function () {
return /windows|win32/i.test(navigator.userAgent);
},
isSupportCss3: function (style) {
var prefix = ['webkit', 'Moz', 'ms', 'o'],
i, len,

11
src/core/func/dom.js

@ -20,7 +20,7 @@ BI.extend(jQuery.fn, {
*/
__textKeywordMarked__: function (text, keyword, py) {
if (!BI.isKey(keyword)) {
return this.text(text);
return this.text((text + "").replaceAll(" ", " "));
}
keyword = keyword + "";
keyword = BI.toUpperCase(keyword);
@ -43,7 +43,7 @@ BI.extend(jQuery.fn, {
if (tidx >= 0) {
this.append(textLeft.substr(0, tidx));
this.append($("<span>").addClass("bi-keyword-red-mark")
.text(textLeft.substr(tidx, keyword.length)));
.text(textLeft.substr(tidx, keyword.length).replaceAll(" ", " ")));
textLeft = textLeft.substr(tidx + keyword.length);
if (py != null) {
@ -52,7 +52,7 @@ BI.extend(jQuery.fn, {
} else if (pidx != null && pidx >= 0 && Math.floor(pidx / text.length) === Math.floor((pidx + keyword.length - 1) / text.length)) {
this.append(textLeft.substr(0, pidx));
this.append($("<span>").addClass("bi-keyword-red-mark")
.text(textLeft.substr(pidx, keyword.length)));
.text(textLeft.substr(pidx, keyword.length).replaceAll(" ", " ")));
if (py != null) {
py = py.substr(pidx + keyword.length);
}
@ -553,8 +553,8 @@ BI.extend(jQuery, {
getComboPosition: function (combo, popup, extraWidth, extraHeight, needAdaptHeight, directions, offsetStyle) {
extraWidth || (extraWidth = 0);
extraHeight || (extraHeight = 0);
var maxHeight = $("body").bounds().height - extraHeight;
maxHeight = Math.min(popup.attr("maxHeight") || maxHeight, maxHeight);
var bodyHeight = $("body").bounds().height - extraHeight;
var maxHeight = Math.min(popup.attr("maxHeight") || bodyHeight, bodyHeight);
popup.resetHeight && popup.resetHeight(maxHeight);
var position = $.getComboPositionByDirections(combo, popup, extraWidth, extraHeight, needAdaptHeight, directions || ['bottom', 'top', 'right', 'left']);
switch (offsetStyle) {
@ -577,6 +577,7 @@ BI.extend(jQuery, {
}
break;
}
popup.resetHeight && popup.resetHeight(Math.min(bodyHeight - position.top, maxHeight));
return position;
}
});

12
src/core/func/function.js

@ -225,9 +225,9 @@ $(function () {
return tempValue;
},
rgba2rgb: function (rgbColour, BGcolur) {
if (BI.isNull(BGcolur)) {
BGcolur = 1;
rgba2rgb: function (rgbColour, BGcolor) {
if (BI.isNull(BGcolor)) {
BGcolor = 1;
}
if (rgbColour.substr(0, 4) != "rgba") {
return "";
@ -241,9 +241,9 @@ $(function () {
var B = BI.parseFloat(rgbValues[2]);
var A = BI.parseFloat(rgbValues[3]);
return "rgb(" + Math.floor(255 * (BGcolur * (1 - A )) + R * A) + "," +
Math.floor(255 * (BGcolur * (1 - A )) + G * A) + "," +
Math.floor(255 * (BGcolur * (1 - A )) + B * A) + ")";
return "rgb(" + Math.floor(255 * (BGcolor * (1 - A )) + R * A) + "," +
Math.floor(255 * (BGcolor * (1 - A )) + G * A) + "," +
Math.floor(255 * (BGcolor * (1 - A )) + B * A) + ")";
},
getTextSizeWidth: function (text, fontSize) {

18
src/core/proto/date.js

@ -9,19 +9,19 @@ Date._DN = [BI.i18nText("BI-Basic_Sunday"),
BI.i18nText("BI-Basic_Sunday")];
// short day names
Date._SDN = [BI.i18nText("BI-Day_Ri"),
BI.i18nText("BI-Basic_One"),
BI.i18nText("BI-Basic_Two"),
BI.i18nText("BI-Basic_Three"),
BI.i18nText("BI-Basic_Four"),
BI.i18nText("BI-Basic_Five"),
BI.i18nText("BI-Basic_Six"),
BI.i18nText("BI-Day_Ri")];
Date._SDN = [BI.i18nText("BI-Basic_Simple_Sunday"),
BI.i18nText("BI-Basic_Simple_Monday"),
BI.i18nText("BI-Basic_Simple_Tuesday"),
BI.i18nText("BI-Basic_Simple_Wednesday"),
BI.i18nText("BI-Basic_Simple_Thursday"),
BI.i18nText("BI-Basic_Simple_Friday"),
BI.i18nText("BI-Basic_Simple_Saturday"),
BI.i18nText("BI-Basic_Simple_Sunday")];
// Monday first, etc.
Date._FD = 1;
// full month names
// full month namesdat
Date._MN = [
BI.i18nText("BI-Basic_January"),
BI.i18nText("BI-Basic_February"),

6
src/css/base/dom.css

@ -1,9 +1,3 @@
/****添加计算宽度的--运算符直接需要space****/
/****** common color(常用颜色,可用于普遍场景) *****/
/**** custom color(自定义颜色,用于特定场景) ****/
/************hing light*****************/
.bi-z-index-mask {
background-color: #1a1a1a;
opacity: 0.5;
filter: alpha(opacity=50);
}

17
src/css/base/segment/segment.css

@ -5,8 +5,13 @@
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
background: #ffffff;
border-right: 1px solid #d4dadd;
border-top: 1px solid #d4dadd;
border-bottom: 1px solid #d4dadd;
}
.bi-segment > .first-element {
border-left: 1px solid #d4dadd;
-webkit-border-radius: 6px 0px 0px 6px;
-moz-border-radius: 6px 0px 0px 6px;
border-radius: 6px 0px 0px 6px;
@ -16,3 +21,15 @@
-moz-border-radius: 0px 6px 6px 0px;
border-radius: 0px 6px 6px 0px;
}
.bi-theme-dark .bi-segment > .center-element {
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
background: #242640;
border-right: 1px solid #525466;
border-top: 1px solid #525466;
border-bottom: 1px solid #525466;
}
.bi-theme-dark .bi-segment > .first-element {
border-left: 1px solid #242640;
}

2
src/css/base/single/button/button.css

@ -52,7 +52,7 @@
.bi-button.button-common.disabled,
.bi-button.button-success.disabled,
.bi-button.button-warning.disabled {
background: #c4c6c6 !important;
background: #cccccc !important;
border-color: #c4c6c6 !important;
}
.bi-button.button-common.disabled,

16
src/css/base/table/table.grid.scrollbar.css

@ -10,12 +10,12 @@
transition-timing-function: ease;
user-select: none;
background-color: rgba(102, 102, 102, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0D666666,endColorstr=#0D666666);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d666666,endColorstr=#0d666666);
border-radius: 5px;
}
.bi-theme-dark .scrollbar-layout-main {
background-color: rgba(204, 204, 204, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0Dcccccc,endColorstr=#0Dcccccc);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dcccccc,endColorstr=#0dcccccc);
}
.scrollbar-layout-main-vertical {
bottom: 0;
@ -34,11 +34,11 @@
left: 0;
transition-property: background-color;
background-color: rgba(102, 102, 102, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0D666666,endColorstr=#0D666666);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d666666,endColorstr=#0d666666);
}
.bi-theme-dark .scrollbar-layout-main-horizontal {
background-color: rgba(204, 204, 204, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0Dcccccc,endColorstr=#0Dcccccc);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dcccccc,endColorstr=#0dcccccc);
}
/* Touching the scroll-track directly makes the scroll-track bolder */
.scrollbar-layout-main-horizontal.public-scrollbar-main-active,
@ -92,23 +92,23 @@
/* Touching the scroll-track directly makes the scroll-track bolder */
.public-scrollbar-face:after {
background-color: rgba(102, 102, 102, 0.3);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4C666666,endColorstr=#4C666666);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4d666666,endColorstr=#4d666666);
}
.bi-theme-dark .public-scrollbar-face:after {
background-color: rgba(204, 204, 204, 0.3);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4Ccccccc,endColorstr=#4Ccccccc);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4dcccccc,endColorstr=#4dcccccc);
}
.public-scrollbar-main:hover .public-scrollbar-face:after,
.public-scrollbar-main-active .public-scrollbar-face:after,
.public-scrollbar-faceActive:after {
background-color: rgba(102, 102, 102, 0.7);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#B2666666,endColorstr=#B2666666);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#b3666666,endColorstr=#b3666666);
}
.bi-theme-dark .public-scrollbar-main:hover .public-scrollbar-face:after,
.bi-theme-dark .public-scrollbar-main-active .public-scrollbar-face:after,
.bi-theme-dark .public-scrollbar-faceActive:after {
background-color: rgba(204, 204, 204, 0.7);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#B2cccccc,endColorstr=#B2cccccc);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#b3cccccc,endColorstr=#b3cccccc);
}
.horizontal-scrollbar {
bottom: 0;

29
src/css/base/tree/display.tree.css

@ -1,29 +0,0 @@
/****添加计算宽度的--运算符直接需要space****/
/****** common color(常用颜色,可用于普遍场景) *****/
/**** custom color(自定义颜色,用于特定场景) ****/
.bi-display-tree .ztree * {
color: #808080;
}
.bi-display-tree .ztree li span.button.switch.center_open {
background-image: url("/icon/tree-vertical-line-3.png");
}
.bi-display-tree .ztree li span.button.switch.roots_open {
background-image: url("/icon/tree-vertical-line-2.png");
}
.bi-display-tree .ztree li span.button.switch.bottom_open {
background-image: url("/icon/tree-vertical-line-4.png");
}
.bi-display-tree .ztree li a,
.bi-display-tree .ztree li span {
cursor: default !important;
}
.bi-display-tree .ztree li a:hover {
text-decoration: none;
}
.bi-display-tree .ztree li a.curSelectedNode {
padding-top: 1px;
border: none;
background-color: inherit;
opacity: 1;
filter: alpha(opacity=100);
}

89
src/css/core/utils/common.css

@ -105,19 +105,21 @@
background: #1a1a1a;
opacity: 0.2;
filter: alpha(opacity=20);
z-index: 1000000000;
z-index: 1000000000 !important;
}
.bi-theme-dark .bi-resizer {
background: #ffffff;
}
.bi-z-index-mask {
color: #ffffff;
background-color: rgba(26, 26, 26, 0.5);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#7f1a1a1a,endColorstr=#7f1a1a1a);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#801a1a1a,endColorstr=#801a1a1a);
}
.bi-list-item:hover,
.bi-list-item.hover {
background-color: #eff1f4;
color: #1a1a1a;
background-color: rgba(26, 26, 26, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d1a1a1a,endColorstr=#0d1a1a1a);
}
.bi-list-item.disabled,
.bi-list-item.disabled:hover,
@ -132,8 +134,9 @@
}
.bi-theme-dark .bi-list-item:hover,
.bi-theme-dark .bi-list-item.hover {
background-color: #191b2b;
color: #ffffff;
background-color: rgba(255, 255, 255, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff);
}
.bi-theme-dark .bi-list-item.disabled,
.bi-theme-dark .bi-list-item.disabled:hover,
@ -146,9 +149,12 @@
.bi-theme-dark .bi-list-item.disabled:active .bi-high-light {
color: #666666 !important;
}
.bi-list-item-simple {
color: #999999;
}
.bi-list-item-simple:hover,
.bi-list-item-simple.hover {
color: #1a1a1a;
color: #3f8ce8;
}
.bi-list-item-simple.disabled,
.bi-list-item-simple.disabled:hover,
@ -160,20 +166,6 @@
.bi-list-item-simple.disabled:active .bi-high-light {
color: #cccccc !important;
}
.bi-theme-dark .bi-list-item-simple:hover,
.bi-theme-dark .bi-list-item-simple.hover {
color: #ffffff;
}
.bi-theme-dark .bi-list-item-simple.disabled,
.bi-theme-dark .bi-list-item-simple.disabled:hover,
.bi-theme-dark .bi-list-item-simple.disabled:active {
color: #666666 !important;
}
.bi-theme-dark .bi-list-item-simple.disabled .bi-high-light,
.bi-theme-dark .bi-list-item-simple.disabled:hover .bi-high-light,
.bi-theme-dark .bi-list-item-simple.disabled:active .bi-high-light {
color: #666666 !important;
}
.bi-list-item-effect:hover {
color: #1a1a1a;
}
@ -212,12 +204,14 @@
.bi-list-item-active:hover,
.bi-list-item-active.hover {
color: #1a1a1a;
background-color: #eff1f4;
background-color: rgba(26, 26, 26, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d1a1a1a,endColorstr=#0d1a1a1a);
}
.bi-list-item-active.active,
.bi-list-item-active:active {
color: #3f8ce8;
background-color: #eff1f4;
background-color: rgba(26, 26, 26, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d1a1a1a,endColorstr=#0d1a1a1a);
}
.bi-list-item-active.disabled,
.bi-list-item-active.disabled:hover,
@ -232,13 +226,15 @@
}
.bi-theme-dark .bi-list-item-active:hover,
.bi-theme-dark .bi-list-item-active.hover {
background-color: #191b2b;
color: #ffffff;
background-color: rgba(255, 255, 255, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff);
}
.bi-theme-dark .bi-list-item-active.active,
.bi-theme-dark .bi-list-item-active:active {
color: #3f8ce8;
background-color: #191b2b;
background-color: rgba(255, 255, 255, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff);
}
.bi-theme-dark .bi-list-item-active.disabled,
.bi-theme-dark .bi-list-item-active.disabled:hover,
@ -253,8 +249,9 @@
}
.bi-list-item-select:hover,
.bi-list-item-select.hover {
color: #3f8ce8;
background-color: #eff1f4;
color: #1a1a1a;
background-color: rgba(26, 26, 26, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d1a1a1a,endColorstr=#0d1a1a1a);
}
.bi-list-item-select:active,
.bi-list-item-select.active {
@ -278,8 +275,9 @@
}
.bi-theme-dark .bi-list-item-select:hover,
.bi-theme-dark .bi-list-item-select.hover {
color: #3f8ce8;
background-color: #191b2b;
color: #ffffff;
background-color: rgba(255, 255, 255, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff);
}
.bi-theme-dark .bi-list-item-select:active,
.bi-theme-dark .bi-list-item-select.active {
@ -301,40 +299,3 @@
.bi-theme-dark .bi-list-item-select.disabled:active .bi-high-light {
color: #666666 !important;
}
.bi-list-item-choose:hover {
color: #1a1a1a;
}
.bi-list-item-choose:active,
.bi-list-item-choose.active {
color: #ffffff;
background-color: #3f8ce8;
}
.bi-list-item-choose:active .bi-high-light,
.bi-list-item-choose.active .bi-high-light {
color: #ffffff;
}
.bi-list-item-choose.disabled,
.bi-list-item-choose.disabled:hover,
.bi-list-item-choose.disabled:active {
color: #cccccc !important;
background-color: transparent !important;
}
.bi-list-item-choose.disabled .bi-high-light,
.bi-list-item-choose.disabled:hover .bi-high-light,
.bi-list-item-choose.disabled:active .bi-high-light {
color: #cccccc !important;
}
.bi-theme-dark .bi-list-item-choose:hover {
color: #ffffff;
}
.bi-theme-dark .bi-list-item-choose.disabled,
.bi-theme-dark .bi-list-item-choose.disabled:hover,
.bi-theme-dark .bi-list-item-choose.disabled:active {
color: #666666 !important;
background-color: transparent !important;
}
.bi-theme-dark .bi-list-item-choose.disabled .bi-high-light,
.bi-theme-dark .bi-list-item-choose.disabled:hover .bi-high-light,
.bi-theme-dark .bi-list-item-choose.disabled:active .bi-high-light {
color: #666666 !important;
}

3233
src/css/resource/font.css

File diff suppressed because it is too large Load Diff

5
src/less/base/dom.less

@ -1,7 +1,2 @@
@import "../bibase";
@import "../lib/colors";
/************hing light*****************/
.bi-z-index-mask{
background-color: @color-bi-background-black;
.opacity(0.5);
}

20
src/less/base/segment/segment.less

@ -3,11 +3,31 @@
.bi-segment{
& > .center-element{
.overflow-hidden();
background: @color-bi-background-default;
border-right: 1px solid @color-bi-border-line;
border-top: 1px solid @color-bi-border-line;
border-bottom: 1px solid @color-bi-border-line;
}
& > .first-element{
border-left: 1px solid @color-bi-border-line;
.border-corner-radius(6px,0px,0px,6px)
}
& > .last-element{
.border-corner-radius(0px,6px,6px,0px)
}
}
.bi-theme-dark {
.bi-segment {
& > .center-element{
.overflow-hidden();
background: @color-bi-background-default-theme-dark;
border-right: 1px solid @color-bi-border-line-theme-dark;
border-top: 1px solid @color-bi-border-line-theme-dark;
border-bottom: 1px solid @color-bi-border-line-theme-dark;
}
& > .first-element{
border-left: 1px solid @color-bi-background-default-theme-dark;
}
}
}

25
src/less/base/table/table.grid.scrollbar.less

@ -1,4 +1,5 @@
@import "../../bibase";
.scrollbar-layout-main {
box-sizing: border-box;
outline: none;
@ -7,15 +8,13 @@
transition-duration: 250ms;
transition-timing-function: ease;
user-select: none;
background-color: @scroll-color;
filter:~"progid:DXImageTransform.Microsoft.gradient(startColorstr=#0D666666,endColorstr=#0D666666)";
.background-color(@scroll-color, 5%);
border-radius: 5px;
}
.bi-theme-dark {
.scrollbar-layout-main {
background-color: @scroll-color-theme-dark;
filter:~"progid:DXImageTransform.Microsoft.gradient(startColorstr=#0Dcccccc,endColorstr=#0Dcccccc)";
.background-color(@scroll-color-theme-dark, 5%);
}
}
@ -37,14 +36,12 @@
height: 10px;
left: 0;
transition-property: background-color;
background-color: @scroll-color;
filter:~"progid:DXImageTransform.Microsoft.gradient(startColorstr=#0D666666,endColorstr=#0D666666)";
.background-color(@scroll-color, 5%);
}
.bi-theme-dark {
.scrollbar-layout-main-horizontal {
background-color: @scroll-color-theme-dark;
filter:~"progid:DXImageTransform.Microsoft.gradient(startColorstr=#0Dcccccc,endColorstr=#0Dcccccc)";
.background-color(@scroll-color-theme-dark, 5%);
}
}
@ -118,30 +115,26 @@
}
.public-scrollbar-face:after {
background-color: @scroll-thumb-color;
filter:~"progid:DXImageTransform.Microsoft.gradient(startColorstr=#4C666666,endColorstr=#4C666666)";
.background-color(@scroll-color, 30%);
}
.bi-theme-dark {
.public-scrollbar-face:after {
background-color: @scroll-thumb-color-theme-dark;
filter:~"progid:DXImageTransform.Microsoft.gradient(startColorstr=#4Ccccccc,endColorstr=#4Ccccccc)";
.background-color(@scroll-color-theme-dark, 30%);
}
}
.public-scrollbar-main:hover .public-scrollbar-face:after,
.public-scrollbar-main-active .public-scrollbar-face:after,
.public-scrollbar-faceActive:after {
background-color: @scroll-thumb-focus-color;
filter:~"progid:DXImageTransform.Microsoft.gradient(startColorstr=#B2666666,endColorstr=#B2666666)";
.background-color(@scroll-color, 70%);
}
.bi-theme-dark {
.public-scrollbar-main:hover .public-scrollbar-face:after,
.public-scrollbar-main-active .public-scrollbar-face:after,
.public-scrollbar-faceActive:after {
background-color: @scroll-thumb-focus-color-theme-dark;
filter:~"progid:DXImageTransform.Microsoft.gradient(startColorstr=#B2cccccc,endColorstr=#B2cccccc)";
.background-color(@scroll-color-theme-dark, 70%);
}
}

82
src/less/core/utils/common.less

@ -148,7 +148,7 @@
.bi-resizer {
background: @color-bi-background-black;
.opacity(0.2);
z-index: @zIndex-tip;
z-index: @zIndex-tip !important;
}
.bi-theme-dark {
@ -158,15 +158,15 @@
}
.bi-z-index-mask {
background-color: rgba(26, 26, 26, .5);
filter: ~"progid:DXImageTransform.Microsoft.gradient(startColorstr=#7f1a1a1a,endColorstr=#7f1a1a1a)";
color: @color-bi-background-default;
.background-color(@color-bi-background-black, 50%);
}
//只有背景变化
.bi-list-item {
&:hover, &.hover {
background-color: @color-bi-background-normal;
color: @color-bi-text-black;
.background-color(@color-bi-background-black, 5%);
}
&.disabled {
&, &:hover, &:active {
@ -182,8 +182,8 @@
.bi-theme-dark {
.bi-list-item {
&:hover, &.hover {
background-color: @color-bi-background-normal-theme-dark;
color: @color-bi-text;
.background-color(@color-bi-background-default, 5%);
}
&.disabled {
&, &:hover, &:active {
@ -199,8 +199,9 @@
//极简
.bi-list-item-simple {
color: @color-bi-text-tips;
&:hover, &.hover {
color: @color-bi-text-black;
color: @color-bi-text-highlight;
}
&.disabled {
&, &:hover, &:active {
@ -212,22 +213,6 @@
}
}
.bi-theme-dark {
.bi-list-item-simple {
&:hover, &.hover {
color: @color-bi-text;
}
&.disabled {
&, &:hover, &:active {
color: @color-bi-text-disabled-theme-dark !important;
& .bi-high-light {
color: @color-bi-text-disabled-theme-dark !important;
}
}
}
}
}
//文字active时变化
.bi-list-item-effect {
&:hover {
@ -270,11 +255,11 @@
.bi-list-item-active {
&:hover, &.hover {
color: @color-bi-text-black;
background-color: @color-bi-background-normal;
.background-color(@color-bi-background-black, 5%);
}
&.active, &:active {
color: @color-bi-text-highlight;
background-color: @color-bi-background-normal;
.background-color(@color-bi-background-black, 5%);
}
&.disabled {
&, &:hover, &:active {
@ -290,12 +275,12 @@
.bi-theme-dark {
.bi-list-item-active {
&:hover, &.hover {
background-color: @color-bi-background-normal-theme-dark;
color: @color-bi-text;
.background-color(@color-bi-background-default, 5%);
}
&.active, &:active {
color: @color-bi-text-highlight;
background-color: @color-bi-background-normal-theme-dark;
.background-color(@color-bi-background-default, 5%);
}
&.disabled {
&, &:hover, &:active {
@ -312,8 +297,8 @@
//有选中效果
.bi-list-item-select {
&:hover, &.hover {
color: @color-bi-text-highlight;
background-color: @color-bi-background-normal;
color: @color-bi-text-black;
.background-color(@color-bi-background-black, 5%);
}
&:active, &.active {
color: @color-bi-text;
@ -336,31 +321,8 @@
.bi-theme-dark {
.bi-list-item-select {
&:hover, &.hover {
color: @color-bi-text-highlight;
background-color: @color-bi-background-normal-theme-dark;
}
&:active, &.active {
color: @color-bi-text;
background-color: @color-bi-background-highlight;
& .bi-high-light {
color: @color-bi-text;
}
}
&.disabled {
&, &:hover, &:active {
background-color: transparent !important;
color: @color-bi-text-disabled-theme-dark !important;
& .bi-high-light {
color: @color-bi-text-disabled-theme-dark !important;
}
}
}
}
}
.bi-list-item-choose {
&:hover {
color: @color-bi-text-black;
.background-color(@color-bi-background-default, 5%);
}
&:active, &.active {
color: @color-bi-text;
@ -371,24 +333,8 @@
}
&.disabled {
&, &:hover, &:active {
color: @color-bi-text-disabled !important;
background-color: transparent !important;
& .bi-high-light {
color: @color-bi-text-disabled !important;
}
}
}
}
.bi-theme-dark {
.bi-list-item-choose {
&:hover {
color: @color-bi-text;
}
&.disabled {
&, &:hover, &:active {
color: @color-bi-text-disabled-theme-dark !important;
background-color: transparent !important;
& .bi-high-light {
color: @color-bi-text-disabled-theme-dark !important;
}

46
src/less/image.less

@ -172,91 +172,107 @@
//active
@color-bi-font-hover: inherit;
//hover
@color-bi-font-active: #009de3;
@color-bi-font-active: #3f8ce8;
.font(@class,@content, @color: @color-bi-font-native) {
@fc: "\@{content}";
.@{class} {
& .b-font{
*zoom: ~"expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = '&#x@{content}')";
}
& .b-font:before {
content: @content;
content: @fc;
color: @color;
}
&.native .b-font:before,
&.disabled .b-font:before {
content: @content;
content: @fc;
color: @color;
}
}
}
.font-hover(@class,@content,@color-native: @color-bi-font-native, @color-hover: @color-bi-font-hover) {
@fc: "\@{content}";
.@{class} {
& .b-font{
*zoom: ~"expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = '&#x@{content}')";
}
& .b-font:before {
content: @content;
content: @fc;
color: @color-native;
}
&:hover .b-font:before,
&:focus .b-font:before,
&.hover .b-font:before {
content: @content;
content: @fc;
color: @color-hover;
}
&.native .b-font:before,
&.disabled .b-font:before {
content: @content;
content: @fc;
color: @color-native;
}
}
}
.font-effect(@class,@content,@color-native: @color-bi-font-native, @color-hover: @color-bi-font-hover, @color-active: @color-bi-font-active, @color-selected: @color-bi-font-active) {
@fc: "\@{content}";
.@{class} {
& .b-font{
*zoom: ~"expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = '&#x@{content}')";
}
& .b-font:before {
content: @content;
content: @fc;
color: @color-native;
}
&:hover .b-font:before,
&:focus .b-font:before,
&.hover .b-font:before {
content: @content;
content: @fc;
color: @color-hover;
}
&.active .b-font:before {
content: @content;
content: @fc;
color: @color-selected;
}
&:active .b-font:before {
content: @content;
content: @fc;
color: @color-active;
}
&.native .b-font:before,
&.disabled .b-font:before {
content: @content;
content: @fc;
color: @color-native;
}
}
}
.font-hover-active(@class,@content,@color-native: @color-bi-font-native, @color-hover: @color-bi-font-hover, @color-active: @color-bi-font-active) {
@fc: "\@{content}";
.@{class} {
& .b-font{
*zoom: ~"expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = '&#x@{content}')";
}
& .b-font:before {
content: @content;
content: @fc;
color: @color-native;
}
&:hover .b-font:before,
&:focus .b-font:before,
&.hover .b-font:before {
content: @content;
content: @fc;
color: @color-hover;
}
&:active .b-font:before,
&.active .b-font:before {
content: @content;
content: @fc;
color: @color-active;
}
&.native .b-font:before,
&.disabled .b-font:before {
content: @content;
content: @fc;
color: @color-native;
}
}

2
src/less/lib/colors.less

@ -85,8 +85,6 @@
@color-bi-border-delete: @border-color-negative;
//警示边框色
@color-bi-border-warning: @border-color-warning;
//拖拽边框
@color-bi-border-resize: @border-color-resize;
//边框提亮
@color-bi-border-highlight: @border-color-highlight;

19
src/less/lib/constant.less

@ -31,10 +31,6 @@
@font-color-redmark: #f07d0a;
@font-color-orange: #fcc550;
//font-icon color
@icon-color-normal: #999999;
@icon-color-active: #3f8ce8;
//background color
@background-color-black: #1a1a1a;//
@background-color-default: #ffffff;//
@ -43,8 +39,7 @@
@background-color-normal-theme-dark: #191B2B;//
@background-color-highlight: #3f8ce8;
@background-color-dark: #d4dadd;
@background-color-disabled: #c4c6c6;
@background-color-alert: #fddddd;
@background-color-disabled: #cccccc;
@background-color-light-blue: #d8f2fd;//
@background-color-light-green: #e1f4e7;//
@ -56,6 +51,7 @@
@background-color-yellow: #f9a744;
@background-color-virtual-blue: #d8f3fe;
@background-color-alert: #fddddd;
@background-color-warning: #fbb03b;
@background-color-negative: #e85050;
@ -66,12 +62,10 @@
//border color
@border-color-default: #ffffff;
@border-color-black: #1a1a1a;
@border-color-normal: #d4dadd;
@border-color-line: #d4dadd;
@border-color-line-theme-dark: #525466;
@border-color-outline: #3f8ce8;
@border-color-highlight: #178cdf;
@border-color-resize: #e85050;
@border-color-warning: #fbb03b;
@border-color-negative: #e85050;
@ -87,13 +81,8 @@
@border-color-dark: #c4c6c6;
//scroll color
@scroll-color: rgba(102,102,102,.05);
@scroll-thumb-color: rgba(102,102,102,.3);
@scroll-thumb-focus-color: rgba(102,102,102,.7);
@scroll-color-theme-dark: rgba(204,204,204,.05);
@scroll-thumb-color-theme-dark: rgba(204,204,204,.3);
@scroll-thumb-focus-color-theme-dark: rgba(204,204,204,.7);
@scroll-color: #666666;
@scroll-color-theme-dark: #cccccc;
@water-mark-color: #cccccc;
@water-mark-color-theme-dark: #666666;

356
src/less/lib/font.less

@ -1,183 +1,183 @@
//字体库
@font-cross: "\e600";
@font-arrow-left: "\e601";
@font-arrow-right: "\e602";
@font-arrow-down: "\e603";
@font-search: "\e604";
@font-delete: "\e605";
@font-dot: "\e606";
@font-right-triangle: "\e607";
@font-down-triangle: "\e608";
@font-left-triangle: "\e6ae";
@font-top-triangle: "\e6ad";
@font-summary: "\e60e";
@font-axis: "\e626";
@font-bar: "\e620";
@font-accumulate-bar: "\e60a";
@font-pie: "\e618";
@font-map: "\e62c";
@font-dashboard: "\e623";
@font-doughnut: "\e624";
@font-detail: "\e615";
@font-more-cn: "\e60d";
@font-bubble: "\e62a";
@font-scatter: "\e61d";
@font-radar: "\e614";
@font-content: "\e621";
@font-image: "\e68d";
@font-web: "\e68c";
@font-text: "\e622";
@font-number: "\e61f";
@font-tree: "\e61e";
@font-date: "\e61b";
@font-year: "\e628";
@font-year-month: "\e627";
@font-quarter: "\e629";
@font-YMD: "\e61c";
@font-date-range: "\e616";
@font-and-or: "\e62b";
@font-query-cn: "\e609";
@font-reset-cn: "\e61a";
@font-text-area: "\e622";
@font-reuse: "\e60b";
@font-save: "\e617";
@font-undo: "\e619";
@font-redo: "\e625";
@font-style-set: "\e60c";
@font-filter: "\e60f";
@font-copy: "\e610";
@font-check-mark: "\e611";
@font-dimension-from: "\e612";
@font-chart-type: "\e613";
@font-share: "\e632";
@font-edit: "\e631";
@font-up: "\e630";
@font-right: "\e62f";
@font-down: "\e62d";
@font-left: "\e62e";
@font-less: "\e633";
@font-less-equal: "\e636";
@font-less-arrow: "\e637";
@font-less-equal-arrow: "\e638";
@font-asc: "\e63f";
@font-des: "\e63a";
@font-add: "\e649";
@font-field-calc: "\e6a3";
@font-field-string: "\e642";
@font-field-number: "\e641";
@font-field-date: "\e640";
@font-preview: "\e65f";
@font-setting: "\e678";
@font-warning: "\e64e";
@font-linkage: "\e63c";
@font-detail-set: "\e634";
@font-export-excel: "\e635";
@font-change: "\e660";
@font-sortable: "\e63b";
@font-clear: "\e63d";
@font-bold: "\e64d";
@font-color: "\e69c";
@font-italic: "\e656";
@font-underline: "\e650";
@font-background: "\e696";
@font-color-underline: "\e69d";
@font-align-left: "\e654";
@font-align-center: "\e64f";
@font-align-right: "\e651";
@font-move: "\e65e";
@font-share: "\e65a";
@font-new-folder: "\e65d";
@font-letter: "\e659";
@font-time: "\e658";
@font-file: "\e65b";
@font-folder: "\e65c";
@font-rename: "\e687";
@font-rename-edit: "\e670";
@font-source-table: "\e67b";
@font-excel-table: "\e682";
@font-etl-table: "\e680";
@font-sql-table: "\e681";
@font-key: "\e67d;";
@font-refresh: "\e683";
@font-tile-view: "\e685";
@font-relation-view: "\e684";
@font-test-link: "\e686";
@font-upload: "\e6ba";
@font-image-size: "\e68b";
@font-href: "\e688";
@font-shutdown: "\e689";
@font-doubt: "\e69a";
@font-new: "\e692";
@font-database: "\e693";
@font-series: "\e695";
@font-classify: "\e694";
@font-solid-left: "\e6be";
@font-solid-right: "\e6bd";
@font-solid-top: "\e6bc";
@font-solid-bottom: "\e6bb";
@font-no-sort-no-filter: "\e66a";
@font-no-sort-filter: "\e66b";
@font-descending-filter: "\e667";
@font-ascending-filter: "\e669";
@font-descending-no-filter: "\e666";
@font-ascending-no-filter: "\e668";
@font-no-sort: "\e66c";
@font-table-col-open: "\e672";
@font-table-row-open: "\e671";
@font-tip: "\e69e";
@font-mark-dot: "\e6a2";
@font-mark-up-arrow: "\e6a0";
@font-mark-down-arrow: "\e6a1";
@font-mark-equal: "\e69f";
@font-pull-down: "\e6ab";
@font-check: "\e64c";
@font-hellip: "\e6ac";
@font-cross: "e600";
@font-arrow-left: "e601";
@font-arrow-right: "e602";
@font-arrow-down: "e603";
@font-search: "e604";
@font-delete: "e605";
@font-dot: "e606";
@font-right-triangle: "e607";
@font-down-triangle: "e608";
@font-left-triangle: "e6ae";
@font-top-triangle: "e6ad";
@font-summary: "e60e";
@font-axis: "e626";
@font-bar: "e620";
@font-accumulate-bar: "e60a";
@font-pie: "e618";
@font-map: "e62c";
@font-dashboard: "e623";
@font-doughnut: "e624";
@font-detail: "e615";
@font-more-cn: "e60d";
@font-bubble: "e62a";
@font-scatter: "e61d";
@font-radar: "e614";
@font-content: "e621";
@font-image: "e68d";
@font-web: "e68c";
@font-text: "e622";
@font-number: "e61f";
@font-tree: "e61e";
@font-date: "e61b";
@font-year: "e628";
@font-year-month: "e627";
@font-quarter: "e629";
@font-YMD: "e61c";
@font-date-range: "e616";
@font-and-or: "e62b";
@font-query-cn: "e609";
@font-reset-cn: "e61a";
@font-text-area: "e622";
@font-reuse: "e60b";
@font-save: "e617";
@font-undo: "e619";
@font-redo: "e625";
@font-style-set: "e60c";
@font-filter: "e60f";
@font-copy: "e610";
@font-check-mark: "e611";
@font-dimension-from: "e612";
@font-chart-type: "e613";
@font-share: "e632";
@font-edit: "e631";
@font-up: "e630";
@font-right: "e62f";
@font-down: "e62d";
@font-left: "e62e";
@font-less: "e633";
@font-less-equal: "e636";
@font-less-arrow: "e637";
@font-less-equal-arrow: "e638";
@font-asc: "e63f";
@font-des: "e63a";
@font-add: "e649";
@font-field-calc: "e6a3";
@font-field-string: "e642";
@font-field-number: "e641";
@font-field-date: "e640";
@font-preview: "e65f";
@font-setting: "e678";
@font-warning: "e64e";
@font-linkage: "e63c";
@font-detail-set: "e634";
@font-export-excel: "e635";
@font-change: "e660";
@font-sortable: "e63b";
@font-clear: "e63d";
@font-bold: "e64d";
@font-color: "e69c";
@font-italic: "e656";
@font-underline: "e650";
@font-background: "e696";
@font-color-underline: "e69d";
@font-align-left: "e654";
@font-align-center: "e64f";
@font-align-right: "e651";
@font-move: "e65e";
@font-share: "e65a";
@font-new-folder: "e65d";
@font-letter: "e659";
@font-time: "e658";
@font-file: "e65b";
@font-folder: "e65c";
@font-rename: "e687";
@font-rename-edit: "e670";
@font-source-table: "e67b";
@font-excel-table: "e682";
@font-etl-table: "e680";
@font-sql-table: "e681";
@font-key: "e67d;";
@font-refresh: "e683";
@font-tile-view: "e685";
@font-relation-view: "e684";
@font-test-link: "e686";
@font-upload: "e6ba";
@font-image-size: "e68b";
@font-href: "e688";
@font-shutdown: "e689";
@font-doubt: "e69a";
@font-new: "e692";
@font-database: "e693";
@font-series: "e695";
@font-classify: "e694";
@font-solid-left: "e6be";
@font-solid-right: "e6bd";
@font-solid-top: "e6bc";
@font-solid-bottom: "e6bb";
@font-no-sort-no-filter: "e66a";
@font-no-sort-filter: "e66b";
@font-descending-filter: "e667";
@font-ascending-filter: "e669";
@font-descending-no-filter: "e666";
@font-ascending-no-filter: "e668";
@font-no-sort: "e66c";
@font-table-col-open: "e672";
@font-table-row-open: "e671";
@font-tip: "e69e";
@font-mark-dot: "e6a2";
@font-mark-up-arrow: "e6a0";
@font-mark-down-arrow: "e6a1";
@font-mark-equal: "e69f";
@font-pull-down: "e6ab";
@font-check: "e64c";
@font-hellip: "e6ac";
@font-report-filter-open: "\e648";
@font-report-filter-close: "\e645";
@font-apply-hangout: "\e66d";
@font-hangout: "\e64b";
@font-report-filter-open: "e648";
@font-report-filter-close: "e645";
@font-apply-hangout: "e66d";
@font-hangout: "e64b";
@font-real-time: "\e6af";
@font-real-time: "e6af";
@font-info: "\e66e";
@font-cancel-share: "\e6b5";
@font-check-box-selected: "\e6b3";
@font-check-box-not-selected: "\e6b2";
@font-recover-chart: "\e6b4";
@font-check-box-not-selected: "\e6b2";
@font-solid-setting: "\e697";
@font-info: "e66e";
@font-cancel-share: "e6b5";
@font-check-box-selected: "e6b3";
@font-check-box-not-selected: "e6b2";
@font-recover-chart: "e6b4";
@font-check-box-not-selected: "e6b2";
@font-solid-setting: "e697";

297
src/less/resource/font.less

@ -3,39 +3,18 @@
@import "../image";
.font(close-font, @font-cross);
.font(close-red-font, @font-cross, @color-bi-text-warning);
.font-hover(close-h-font, @font-cross);
.font-effect(close-e-font, @font-cross);
.font-hover-active(close-ha-font, @font-cross);
//搜索框中的带有hover后颜色变红的图标
.font-hover(search-close-h-font, @font-cross, inherit, @color-bi-text-warning);
.font(trigger-font, @font-arrow-down);
.font-hover(trigger-h-font, @font-arrow-down);
.font-hover-active(trigger-ha-font, @font-arrow-down);
.font(pre-page-font, @font-arrow-left);
.font-hover(pre-page-h-font, @font-arrow-left);
.font-hover-active(pre-page-ha-font, @font-arrow-left);
.font(next-page-font, @font-arrow-right);
.font-hover(next-page-h-font, @font-arrow-right);
.font-hover-active(next-page-ha-font, @font-arrow-right);
.font(search-font, @font-search);
.font-hover(search-h-font, @font-search);
.font-hover-active(search-ha-font, @font-search);
.font(share-font, @font-share);
.font-hover(share-h-font, @font-share);
.font-hover-active(share-ha-font, @font-share);
/**维度/指标 下拉列表图标字体 ~begin~**/
//删除
.font(delete-font, @font-delete);
.font-hover(delete-h-font, @font-delete);
.font-hover-active(delete-ha-font, @font-delete);
.font-effect(delete-e-font, @font-delete);
//子菜单选中
.font(dot-font, @font-dot, @color-bi-text-black);
.font-hover(dot-h-font, @font-dot, @color-bi-text-black);
@ -60,46 +39,6 @@
.font-hover-active(check-mark-ha-font, @font-check-mark);
.font-effect(check-mark-e-font, @font-check-mark);
//指标来自
.font(dimension-from-font, @font-dimension-from);
.font-hover(dimension-from-h-font, @font-dimension-from);
.font-hover-active(dimension-from-ha-font, @font-dimension-from);
.font-effect(dimension-from-e-font, @font-dimension-from);
//图表类型选择
.font(chart-type-font, @font-chart-type);
.font-hover(chart-type-h-font, @font-chart-type);
.font-hover-active(chart-type-ha-font, @font-chart-type);
.font-effect(chart-type-e-font, @font-chart-type);
//样式设置
.font(style-set-font, @font-style-set);
.font-hover(style-set-h-font, @font-style-set);
.font-hover-active(style-set-ha-font, @font-style-set);
.font-effect(style-set-e-font, @font-style-set);
//超级链接
.font(hyper-link-font, @font-href);
//过滤
.font(filter-font, @font-filter);
.font-hover(filter-h-font, @font-filter);
.font-hover-active(filter-ha-font, @font-filter);
.font-effect(filter-e-font, @font-filter);
//维度过滤
.font(classify-font, @font-classify, @color-bi-text-highlight);
.font(series-font, @font-series, @color-bi-border-success);
/**维度/指标 下拉列表图标字体 ~end~**/
/** dashboard组件/控件 下拉列表图标字体 ~begin~**/
.font-hover(link-to-widget-h-font, @font-cross, @color-bi-text-gray, @color-bi-text-highlight);
.font-hover(link-to-detail-h-font, @font-cross, @color-bi-text-gray, @color-bi-text-highlight);
.font-hover(detail-setting-h-font, @font-cross, @color-bi-text-gray, @color-bi-text-highlight);
.font-hover(export-to-excel-h-font, @font-cross, @color-bi-text-gray, @color-bi-text-highlight);
.font-hover(widget-copy-h-font, @font-copy, @color-bi-text-gray, @color-bi-text-highlight);
.font-hover(widget-delete-h-font, @font-delete, @color-bi-text-gray, @color-bi-text-highlight);
/** dashboard组件/控件 下拉列表图标字体 ~end~**/
//树控件图标
@ -115,252 +54,16 @@
//下拉框小小三角
.font-hover-active(trigger-triangle-font, @font-no-sort-no-filter, @color-bi-text-gray, @color-bi-text-gray, @color-bi-text-highlight);
//日期控件字体图标
.font-hover(widget-date-next-h-font, @font-right);
.font-hover(widget-date-pre-h-font, @font-left);
.font-hover(widget-date-h-change-font, @font-change);
//单选下拉框
//向下展开子菜单
.font(pull-down-font, @font-down-triangle);
.font-hover(pull-down-h-font, @font-down-triangle);
.font-hover-active(pull-down-ha-font, @font-down-triangle);
//字段区域
//TODO 向下展开的图表暂时没有(不同于普通的向下箭头,角度应该更小一点)
.font(delete-field-font, @font-delete);
.font-hover(delete-field-h-font, @font-delete);
.font-hover-active(delete-field-ha-font, @font-delete);
//dashboard
.font-hover(toolbar-save-font, @font-save);
.font-hover(toolbar-undo-font, @font-undo);
.font-hover(toolbar-redo-font, @font-redo);
.font-hover(toolbar-edit-font, @font-edit);
.font-hover(toolbar-preview-font, @font-preview);
.font-hover-active(chart-table-font, @font-summary);
.font-hover-active(chart-axis-font, @font-axis);
.font-hover-active(chart-bar-font, @font-bar);
.font-hover-active(chart-accumulate-bar-font, @font-accumulate-bar);
.font-hover-active(chart-pie-font, @font-pie);
.font-hover-active(chart-map-font, @font-map);
.font-hover-active(chart-dashboard-font, @font-dashboard);
.font-hover-active(chart-doughnut-font, @font-doughnut);
.font-hover-active(chart-detail-font, @font-detail);
.font-hover-active(chart-more-font, @font-more-cn);
.font-hover-active(chart-bubble-font, @font-bubble);
.font-hover-active(chart-scatter-font, @font-scatter);
.font-hover-active(chart-radar-font, @font-radar);
.font-hover-active(chart-content-font, @font-content);
.font-hover-active(chart-image-font, @font-image);
.font-hover-active(chart-web-font, @font-web);
.font-hover-active(chart-string-font, @font-text);
.font-hover-active(chart-number-font, @font-number);
.font-hover-active(chart-tree-font, @font-tree);
.font-hover-active(chart-date-font, @font-date);
.font-hover-active(chart-year-font, @font-year);
.font-hover-active(chart-month-font, @font-year-month);
.font-hover-active(chart-quarter-font, @font-quarter);
.font-hover-active(chart-ymd-font, @font-YMD);
.font-hover-active(chart-date-range-font, @font-date-range);
.font-hover-active(chart-general-query-font, @font-and-or);
.font-hover-active(chart-query-font, @font-query-cn);
.font-hover-active(chart-reset-font, @font-reset-cn);
.font-hover-active(chart-textarea-font, @font-text-area);
.font-hover-active(chart-reuse-font, @font-reuse);
.font(chart-date-normal-font, @font-date);
//数值区间
.font-hover-active(less-font, @font-less);
.font-hover-active(less-equal-font, @font-less-equal);
.font(check-font, @font-check-mark, @color-bi-text-highlight);
//移动到分组
.font(move2group-add-font, @font-add, @color-bi-text-highlight);
//选择字段
.font-hover-active(select-data-field-calc-font, @font-field-calc, inherit, inherit, @color-bi-text);
.font-hover-active(select-data-field-string-font, @font-field-string, inherit, inherit, @color-bi-text);
.font-hover-active(select-data-field-number-font, @font-field-number, inherit, inherit, @color-bi-text);
.font-hover-active(select-data-field-date-font, @font-field-date, inherit, inherit, @color-bi-text);
.font(select-data-field-string-group-font, @font-field-string);
.font(select-data-field-number-group-font, @font-field-number);
.font(select-data-field-date-group-font, @font-field-date);
.font-hover-active(select-data-preview-font, @font-preview, @color-bi-text-gray, @color-bi-text-highlight, @color-bi-text-highlight);
.font-hover(detail-dimension-set-font, @font-setting);
.font-hover(detail-real-data-warning-font, @font-warning, @color-bi-text-redmark, @color-bi-text-redmark);
//数据配置分组统计中的选择字段
.font-hover-active(select-group-field-string-font, @font-field-string, @color-bi-text-highlight, @color-bi-text-highlight, @color-bi-text-highlight);
.font-hover-active(select-group-field-number-font, @font-field-number, @color-bi-text-highlight, @color-bi-text-highlight, @color-bi-text-highlight);
.font-hover-active(select-group-field-date-font, @font-field-date, @color-bi-text-highlight, @color-bi-text-highlight, @color-bi-text-highlight);
//详细设置
.font-hover(dashboard-widget-combo-detail-set-font, @font-detail-set);
.font(group-add-font, @font-add, @icon-color-normal);
//自定义排序
.font(sortable-font, @font-sortable);
//文本控件
.font(text-bold-font, @font-bold);
.font(text-italic-font, @font-italic);
.font(text-underline-font, @font-underline);
.font(text-color-font, @font-color);
.font(text-background-font, @font-background);
.font(text-color-underline-font, @font-color-underline);
.font(text-align-left-font, @font-align-left);
.font(text-align-center-font, @font-align-center);
.font(text-align-right-font, @font-align-right);
//图片控件
.font(img-upload-font, @font-upload, @icon-color-active);
.font(img-size-font, @font-image-size, @icon-color-active);
.font(img-href-font, @font-href, @icon-color-active);
.font(img-shutdown-font, @font-shutdown, @icon-color-active);
//平台-我创建的
.font(move-font, @font-move);
.font(share-font, @font-share);
.font(new-file-font, @font-new-folder);
.font(file-font, @font-file, @color-create-file-text);
.font(folder-font, @font-folder, @color-bi-text-highlight);
.font-hover-active(letter-font, @font-letter);
.font-hover-active(time-font, @font-time);
.font(rename-font, @font-rename);
.font(delete-template-font, @font-delete, @color-bi-text-gray);
.font(real-time-font, @font-real-time, @color-create-file-text);
//选择表
.font-hover-active(data-source-table-font, @font-source-table, @color-bi-text-highlight, @color-bi-text-highlight, @color-bi-text);
.font-hover-active(etl-table-font, @font-etl-table, @color-bi-text-highlight, @color-bi-text-highlight, @color-bi-text);
.font-hover-active(excel-table-font, @font-excel-table, @color-bi-text-highlight, @color-bi-text-highlight, @color-bi-text);
.font-hover-active(sql-table-font, @font-sql-table, @color-bi-text-highlight, @color-bi-text-highlight, @color-bi-text);
.font(refresh-table-font, @font-refresh);
.font(recover-chart-font-hightlight, @font-recover-chart);
.font-hover-active(tables-tile-view-font, @font-tile-view, inherit, inherit, @color-bi-text);
.font-hover-active(tables-relation-view-font, @font-relation-view, inherit, inherit, @color-bi-text);
.font(add-new-table-pull-down-font, @font-down, @color-bi-text);
.font-hover-active(data-link-check-font, @font-check-mark, @color-bi-text, @color-bi-text-gray, @color-bi-text-highlight);
//点击编辑
.font-hover(edit-set-font, @font-detail-set);
//新建分析、数据配置
.font-hover(new-analysis-font, @font-new, @color-bi-text, @color-bi-text);
.font-hover(data-config-font, @font-database, @color-bi-text, @color-bi-text);
//切换文件夹视图
.font-hover-active(folder-list-view, @font-classify, inherit, inherit, @color-bi-text);
.font-hover-active(folder-card-view, @font-tile-view, inherit, inherit, @color-bi-text);
.font-hover-active(item-check-font, @font-check-mark, @color-bi-text, @color-bi-text-gray, @color-bi-font-active);
//表格上面的相关操作——升序、降序、不排序、过滤
.font-hover(table-no-sort-no-filter-font, @font-no-sort-no-filter);
.font-hover(table-no-sort-filter-font, @font-no-sort-filter);
.font-hover(table-descending-filter-font, @font-descending-filter);
.font-hover(table-ascending-filter-font, @font-ascending-filter);
.font-hover(table-descending-no-filter-font, @font-descending-no-filter);
.font-hover(table-ascending-no-filter-font, @font-ascending-no-filter);
.font-hover(table-no-sort-font, @font-no-sort);
.font-hover(primary-key-font, @font-key);
.font-hover-active(table-open-row-style-font, @font-table-row-open);
.font-hover-active(table-open-col-style-font, @font-table-col-open);
//气泡图计算函数
.font(calculate-function-font, @font-field-calc, @font-color-normal);
//匹配关系
.font(path-set-doubt, @font-doubt, @color-bi-text-highlight);
.font(rename-report-font, @font-rename, @color-bi-text-highlight);
.font(remove-report-font, @font-delete, @color-bi-text-warning);
.font(excel-upload-tip-font, @font-tip, @color-bi-text-highlight);
.font(excel-field-type-string-font, @font-text, @color-bi-text-highlight);
.font(excel-field-type-number-font, @font-number, @color-bi-text-highlight);
.font(excel-field-type-date-font, @font-date, @color-bi-text-highlight);
.font(excel-field-type-pull-down-font, @font-down-triangle, @color-bi-text-highlight);
.font(data-link-set-font, @font-setting, @color-bi-text-highlight);
.font(data-link-test-font, @font-test-link, @color-bi-text-highlight);
.font(data-link-copy-font, @font-copy, @color-bi-background-success);
.font(data-link-remove-font, @font-cross, @color-bi-text-warning);
.font(cube-path-confirm-font, @font-warning, @color-bi-background-warning);
.font(target-style-less-dot-font, @font-mark-dot, @color-target-style-less);
.font(target-style-equal-dot-font, @font-mark-dot, @color-target-style-equal);
.font(target-style-more-dot-font, @font-mark-dot, @color-target-style-more);
.font(target-style-less-arrow-font, @font-mark-down-arrow, @color-target-style-less);
.font(target-style-equal-arrow-font, @font-mark-equal, @color-target-style-equal);
.font(target-style-more-arrow-font, @font-mark-up-arrow, @color-target-style-more);
.font(calculate-target-font, @font-field-calc);
.font(task-list-font, @font-classify, @color-bi-text-highlight);
.font(widget-combo-detail-font, @font-solid-setting, @color-bi-text-highlight);
.font(widget-combo-pull-down-font, @font-pull-down, @color-bi-text-highlight);
.font(widget-tools-filter-font, @font-filter, @color-bi-text-highlight);
.font(widget-tools-clear-font, @font-clear, @color-bi-text-highlight);
.font(widget-tools-export-excel-font, @font-export-excel, @color-bi-text-highlight);
.font(widget-combo-expand-font, @font-solid-setting);
.font(widget-combo-linkage-font, @font-linkage);
.font(widget-combo-rename-edit-font, @font-rename-edit);
.font(widget-combo-show-title-font, @font-check);
.font(widget-combo-title-left-font, @font-align-left);
.font(widget-combo-title-center-font, @font-align-center);
.font(widget-combo-show-filter-font, @font-filter);
.font(widget-combo-export-excel-font, @font-export-excel);
.font(widget-combo-copy, @font-copy);
.font(widget-combo-delete, @font-delete);
.font(widget-combo-asc-font, @font-asc);
.font(widget-combo-des-font, @font-des);
.font(widget-combo-clear-font, @font-clear);
.font-hover(detail-table-popup-font, @font-hellip, inherit, @color-bi-font-active);
.font(chart-drill-up, @font-top-triangle);
.font(chart-drill-down, @font-down-triangle);
.font(report-filter-open-font, @font-report-filter-open);
.font(report-filter-close-font, @font-report-filter-close);
.font(report-apply-hangout-normal-font, @font-apply-hangout, @color-bi-text-gray);
.font(report-apply-hangout-ing-font, @font-apply-hangout, @color-bi-text-highlight);
.font(report-hangout-font, @font-hangout, @color-bi-background-success);
.font(report-cancel-hangout-font, @font-hangout, @color-bi-text-gray);
.font(report-hangout-ing-mark-font, @font-hangout, @color-bi-background-highlight);
//业务包管理
.font(delete-font-package, @font-delete, @color-bi-text-warning);
.font(delete-h-font-package, @font-delete, @color-bi-text-warning);
.font(rename-font-package, @font-rename, @color-bi-text-highlight);
.font(package-selected-font, @font-check-box-selected, @color-bi-text-highlight);
.font(package-not-selected-font, @font-check-box-not-selected, @color-bi-text-highlight);
.font(report-detail-info-font, @font-info, @color-bi-text-redmark);
.font(report-rename-font, @font-rename-edit, @color-bi-background-success);
.font(report-cancel-share-font, @font-cancel-share, @color-bi-text-highlight);
.font(drill-push-up-font, @font-up);
.font(drill-push-down-font, @font-down);
.font(drag-tag-font, @font-cross, @color-bi-text-redmark);

6
src/less/visual.less

@ -28,6 +28,12 @@
-moz-box-shadow: @arguments;
}
.background-color(@color, @alpha) {
background-color: fade(@color, @alpha);
@ieColor: argb(fade(@color, @alpha));
filter: ~"progid:DXImageTransform.Microsoft.gradient(startColorstr=@{ieColor},endColorstr=@{ieColor})";
}
.opacity(@opa) {
opacity: @opa;
@opa-ie: @opa*100;

2
src/widget/date/trigger.date.js

@ -36,7 +36,7 @@ BI.DateTrigger = BI.inherit(BI.Trigger, {
hgap: c.hgap,
vgap: c.vgap,
allowBlank: true,
watermark: BI.i18nText("BI-Unrestricted"),
watermark: BI.i18nText("BI-Basic_Unrestricted"),
errorText: function () {
if (self.editor.isEditing()) {
return BI.i18nText("BI-Date_Trigger_Error_Text");

2
src/widget/downlist/combo.downlist.js

@ -47,7 +47,7 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
popup: {
el: this.popupview,
stopPropagation: true,
maxHeight: 400
maxHeight: 1000
}
});

2
src/widget/multiselect/check/multiselect.check.pane.js

@ -32,7 +32,7 @@ BI.MultiSelectCheckPane = BI.inherit(BI.Widget, {
items: opts.items,
itemsCreator: function (op, callback) {
op = BI.extend(op || {}, {
selected_values: self.storeValue.value
selectedValues: self.storeValue.value
});
if (self.storeValue.type === BI.Selection.Multi) {
callback({

5
src/widget/multiselect/multiselect.combo.js

@ -140,7 +140,10 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
toggle: false,
el: this.trigger,
adjustLength: 1,
popup: this.popup
popup: this.popup,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {

2
src/widget/multiselect/multiselect.loader.js

@ -56,7 +56,7 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
itemsCreator: function (op, callback) {
var startValue = self._startValue;
self.storeValue && (op = BI.extend(op || {}, {
selected_values: BI.isKey(startValue) && self.storeValue.type === BI.Selection.Multi
selectedValues: BI.isKey(startValue) && self.storeValue.type === BI.Selection.Multi
? self.storeValue.value.concat(startValue) : self.storeValue.value
}));
opts.itemsCreator(op, function (ob) {

2
src/widget/multiselect/search/multiselect.search.loader.js

@ -51,7 +51,7 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, {
},
itemsCreator: function (op, callback) {
self.storeValue && (op = BI.extend(op || {}, {
selected_values: self.storeValue.value
selectedValues: self.storeValue.value
}));
opts.itemsCreator(op, function (ob) {
var keyword = ob.keyword = opts.keywordGetter();

4
src/widget/multiselect/trigger/searcher.multiselect.js

@ -104,13 +104,13 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
ob.value || (ob.value = []);
if (ob.type === BI.Selection.All) {
if (BI.size(ob.assist) === 1) {
this.editor.setState(o.valueFormatter(ob.assist[0] + "") || ob.assist[0] + "");
this.editor.setState(o.valueFormatter(ob.assist[0] + "") || (ob.assist[0] + ""));
} else {
this.editor.setState(BI.size(ob.value) > 0 ? BI.Selection.Multi : BI.Selection.All);
}
} else {
if (BI.size(ob.value) === 1) {
this.editor.setState(o.valueFormatter(ob.value[0] + "" || ob.value[0] + ""));
this.editor.setState(o.valueFormatter(ob.value[0] + "") || (ob.value[0] + ""));
} else {
this.editor.setState(BI.size(ob.value) > 0 ? BI.Selection.Multi : BI.Selection.None);
}

4
src/widget/multitree/check/multi.tree.check.pane.js

@ -23,7 +23,7 @@ BI.MultiTreeCheckPane = BI.inherit(BI.Pane, {
var self = this, opts = this.options;
this.selected_values = {};
this.selectedValues = {};
var continueSelect = BI.createWidget({
type: 'bi.text_button',
@ -60,7 +60,7 @@ BI.MultiTreeCheckPane = BI.inherit(BI.Pane, {
type: "bi.display_tree",
cls: "bi-multi-tree-display",
itemsCreator: function (op, callback) {
op.type = BI.TreeView.REQ_TYPE_SELECTED_DATA;
op.type = BI.TreeView.REQ_TYPE_GET_SELECTED_DATA;
opts.itemsCreator(op, callback);
}
});

2
src/widget/multitree/multi.tree.popup.js

@ -20,7 +20,7 @@ BI.MultiTreePopup = BI.inherit(BI.Pane, {
var self = this, opts = this.options;
this.selected_values = {};
this.selectedValues = {};
this.tree = BI.createWidget({
type: "bi.sync_tree",

4
src/widget/numericalinterval/numericalinterval.js

@ -33,7 +33,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
this.smallEditor = BI.createWidget({
type: "bi.sign_editor",
height: o.height - 2,
watermark: BI.i18nText("BI-Unrestricted"),
watermark: BI.i18nText("BI-Basic_Unrestricted"),
allowBlank: true,
value: o.min,
level: "warning",
@ -70,7 +70,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
this.bigEditor = BI.createWidget({
type: "bi.sign_editor",
height: o.height - 2,
watermark: BI.i18nText("BI-Unrestricted"),
watermark: BI.i18nText("BI-Basic_Unrestricted"),
allowBlank: true,
value: o.max,
level: "warning",

2
src/widget/relationview/relationview.region.container.js

@ -4,7 +4,7 @@
BI.RelationViewRegionContainer = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.RelationViewRegionContainer.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-relation-view-region-container bi-card bi-border",
baseCls: "bi-relation-view-region-container",
width: 150
});
},

2
src/widget/relationview/relationview.region.js

@ -65,7 +65,7 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, {
cls: "relation-view-region-container bi-card bi-border " + (o.belongPackage ? "" : "other-package"),
items: [{
type: "bi.vertical_adapt",
cls: "relation-view-region-title bi-border",
cls: "relation-view-region-title bi-border-bottom",
items: [this.preview, this.title]
}, this.button_group]
}],

40
src/widget/sequencetable/listnumber.sequencetable.js

@ -35,12 +35,6 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, {
this.renderedCells = [];
this.renderedKeys = [];
this.header = BI.createWidget(o.sequenceHeaderCreator || {
type: "bi.table_style_cell",
cls: "sequence-table-title-cell bi-border",
styleGetter: o.headerCellStyleGetter,
text: BI.i18nText("BI-Number_Index")
});
this.container = BI.createWidget({
type: "bi.absolute",
width: 60,
@ -54,12 +48,19 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, {
items: [this.container]
});
this.headerContainer = BI.createWidget({
type: "bi.absolute",
cls: "bi-border",
width: 58,
scrollable: false
});
this.layout = BI.createWidget({
type: "bi.vtape",
element: this,
items: [{
el: this.header,
height: o.headerRowSize * o.header.length
el: this.headerContainer,
height: o.headerRowSize * o.header.length - 2
}, {
el: this.scrollContainer
}]
@ -82,6 +83,26 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, {
this.scrollContainer.element.scrollTop(o.scrollTop);
},
_createHeader: function () {
var o = this.options;
BI.createWidget({
type: "bi.absolute",
element: this.headerContainer,
items: [{
el: o.sequenceHeaderCreator || {
type: "bi.table_style_cell",
cls: "sequence-table-title-cell",
styleGetter: o.headerCellStyleGetter,
text: BI.i18nText("BI-Number_Index")
},
left: 0,
top: 0,
right: 0,
bottom: 0
}]
});
},
_calculateChildrenToRender: function () {
var self = this, o = this.options;
var scrollTop = BI.clamp(o.scrollTop, 0, o.rowSize * o.items.length - (o.height - o.header.length * o.headerRowSize) + BI.DOM.getScrollWidth());
@ -159,7 +180,8 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, {
},
_populate: function () {
this.header.populate && this.header.populate();
this.headerContainer.empty();
this._createHeader();
this._layout();
this._calculateChildrenToRender();
},

44
src/widget/sequencetable/treenumber.sequencetable.js

@ -35,12 +35,6 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, {
this.renderedCells = [];
this.renderedKeys = [];
this.header = BI.createWidget(o.sequenceHeaderCreator || {
type: "bi.table_style_cell",
cls: "sequence-table-title-cell bi-border",
styleGetter: o.headerCellStyleGetter,
text: BI.i18nText("BI-Number_Index")
});
this.container = BI.createWidget({
type: "bi.absolute",
width: 60,
@ -54,13 +48,20 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, {
items: [this.container]
});
this.headerContainer = BI.createWidget({
type: "bi.absolute",
cls: "bi-border",
width: 58,
scrollable: false
});
this.layout = BI.createWidget({
type: "bi.vtape",
element: this,
items: [{
el: this.header,
height: this._getHeaderHeight()
}, {
el: this.headerContainer,
height: this._getHeaderHeight() - 2
}, {el: {type: "bi.layout"}, height: 2}, {
el: this.scrollContainer
}]
});
@ -168,7 +169,7 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, {
_layout: function () {
var self = this, o = this.options;
var headerHeight = this._getHeaderHeight();
var headerHeight = this._getHeaderHeight() - 2;
var items = this.layout.attr("items");
if (o.isNeedFreeze === false) {
items[0].height = 0;
@ -217,6 +218,26 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, {
return Math.max(0, cnt * this.options.rowSize - (this.options.height - this._getHeaderHeight()) + BI.DOM.getScrollWidth());
},
_createHeader: function () {
var o = this.options;
BI.createWidget({
type: "bi.absolute",
element: this.headerContainer,
items: [{
el: o.sequenceHeaderCreator || {
type: "bi.table_style_cell",
cls: "sequence-table-title-cell",
styleGetter: o.headerCellStyleGetter,
text: BI.i18nText("BI-Number_Index")
},
left: 0,
top: 0,
right: 0,
bottom: 0
}]
});
},
_calculateChildrenToRender: function () {
var self = this, o = this.options;
@ -322,7 +343,8 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, {
task.apply(self);
});
this.tasks = [];
this.header.populate && this.header.populate();
this.headerContainer.empty();
this._createHeader();
this._layout();
this._calculateChildrenToRender();
},

Loading…
Cancel
Save