Browse Source

Merge pull request #5 in ~GUY/fineui from ~WINDY/fineui:2.0 to 2.0

* commit 'fbc1900ec410e55bb8c5d3829e211f9f53a4e912':
  无JIRA任务 整理
  update
  base节点
es6
windy 8 years ago
parent
commit
66994514ff
  1. 6
      Gruntfile.js
  2. 172
      demo/js/config/base.js
  3. 114
      demo/js/config/case.js
  4. 6
      demo/js/config/widget.js
  5. 88
      demo/js/widget/demo.multiselectcombo.js
  6. 14
      demo/js/widget/demo.multiselecttree.js
  7. 34259
      dist/base.js
  8. 228
      dist/core.js
  9. BIN
      dist/icon/check-box-disable.png
  10. BIN
      dist/icon/check-box-normal.png
  11. 14
      src/base/collection/collection.js
  12. 58
      src/base/combination/combo.js
  13. 11
      src/base/combination/expander.js
  14. 6
      src/base/combination/group.button.js
  15. 4
      src/base/combination/loader.js
  16. 115
      src/base/combination/map.button.js
  17. 4
      src/base/combination/navigation.js
  18. 29
      src/base/combination/searcher.js
  19. 4
      src/base/combination/switcher.js
  20. 4
      src/base/combination/tab.js
  21. 118
      src/base/combination/tree.button.js
  22. 2
      src/base/farbtastic/farbtastic.js
  23. 88
      src/base/formula/codemirror/addon/formula-hint.js
  24. 80
      src/base/formula/codemirror/addon/formula-mode.js
  25. 432
      src/base/formula/codemirror/addon/show-hint.js
  26. 8736
      src/base/formula/codemirror/codemirror.js
  27. 11
      src/base/formula/formulaeditor.js
  28. 21
      src/base/foundation/bi.message.js
  29. 10
      src/base/grid/grid.js
  30. 19
      src/base/layer/layer.popup.js
  31. 20
      src/base/pager/pager.js
  32. 2
      src/base/pane.js
  33. 192
      src/base/reqloading/loading.request.js
  34. 5
      src/base/single/a/a.js
  35. 4
      src/base/single/bar/bar.loading.js
  36. 63
      src/base/single/button/button.basic.js
  37. 3
      src/base/single/button/buttons/button.icon.js
  38. 3
      src/base/single/button/buttons/button.image.js
  39. 29
      src/base/single/button/buttons/button.text.js
  40. 119
      src/base/single/button/listitem/blankiconicontextitem.js
  41. 4
      src/base/single/editor/editor.code.js
  42. 4
      src/base/single/editor/editor.js
  43. 85
      src/base/single/editor/editor.textarea.js
  44. 4
      src/base/single/img/img.js
  45. 1
      src/base/single/input/checkbox.js
  46. 72
      src/base/single/input/file.js
  47. 60
      src/base/single/input/input.js
  48. 1
      src/base/single/input/radio.js
  49. 44
      src/base/single/label/label.js
  50. 4
      src/base/single/text.js
  51. 117
      src/base/timeouttoast/widget.timeouttoast.js
  52. 0
      src/base/tree/parttree.js
  53. 38
      src/base/tree/synctree.js
  54. 21
      src/base/tree/treeview.js
  55. 286
      src/core/base.js
  56. 2
      src/core/controller.js
  57. 47
      src/core/loader/loader.style.js
  58. 2
      src/core/var.js
  59. 6
      src/core/wrapper/layout/layout.card.js
  60. 21
      src/css/base/base.css
  61. 11
      src/css/base/chart/chart.combine.css
  62. 11
      src/css/base/combo/popup.bubble.css
  63. 9
      src/css/base/dom.css
  64. 32
      src/css/base/logintimeout/login.timeout.css
  65. 9
      src/css/base/pager/pager.all.count.css
  66. 2
      src/css/base/pager/pager.direction.css
  67. 10
      src/css/base/reqloading/loading.request.css
  68. 6
      src/css/base/single/editor/editor.state.css
  69. 6
      src/css/base/single/editor/editor.state.simple.css
  70. 2
      src/css/base/single/text.css
  71. 44
      src/css/base/third/ztree/zTreeStyle.css
  72. 34
      src/css/base/timeouttoast/widget.timeouttoast.css
  73. 1
      src/css/base/view/popupview.css
  74. 38
      src/css/base/wrapper/flex.center.css
  75. 66
      src/css/base/wrapper/flex.horizontal.css
  76. 46
      src/css/base/wrapper/flex.vertical.center.css
  77. 41
      src/css/base/wrapper/flex.wrapper.center.css
  78. 67
      src/css/base/wrapper/flex.wrapper.horizontal.css
  79. 48
      src/css/base/wrapper/flex.wrapper.vertical.center.css
  80. 24
      src/less/base/base.less
  81. 13
      src/less/base/chart/chart.combine.less
  82. 16
      src/less/base/combo/combo.bubble.less
  83. 8
      src/less/base/combo/popup.bubble.less
  84. 7
      src/less/base/dom.less
  85. 30
      src/less/base/logintimeout/login.timeout.less
  86. 5
      src/less/base/pager/pager.all.count.less
  87. 2
      src/less/base/pager/pager.direction.less
  88. 12
      src/less/base/pager/pager.number.less
  89. 12
      src/less/base/pager/pager.skip.less
  90. 19
      src/less/base/reqloading/loading.request.less
  91. 4
      src/less/base/single/editor/editor.state.less
  92. 4
      src/less/base/single/editor/editor.state.simple.less
  93. 2
      src/less/base/single/text.less
  94. 8
      src/less/base/table/table.grid.scrollbar.less
  95. 1796
      src/less/base/third/jquery.mCustomScrollbar.less
  96. BIN
      src/less/base/third/ztree/img/line_conn.gif
  97. BIN
      src/less/base/third/ztree/img/loading.gif
  98. BIN
      src/less/base/third/ztree/img/zTreeStandard.gif
  99. BIN
      src/less/base/third/ztree/img/zTreeStandard.png
  100. 46
      src/less/base/third/ztree/zTreeStyle.less
  101. Some files were not shown because too many files have changed in this diff Show More

6
Gruntfile.js

@ -40,6 +40,12 @@ module.exports = function (grunt) {
'src/base/single/text.js',
'src/base/single/button/button.basic.js',
'src/base/single/button/button.node.js',
'src/base/combination/group.button.js',
'src/base/combination/tree.button.js',
'src/base/combination/map.button.js',
'src/base/tree/treeview.js',
'src/base/tree/synctree.js',
'src/base/tree/parttree.js',
'src/base/**/*.js'
],
dest: 'dist/base.js'

172
demo/js/config/base.js

@ -3,6 +3,174 @@ Demo.BASE_CONFIG = [{
text: "基础控件"
}, {
pId: 2,
text: "bi.center_adapt",
value: "demo.center_adapt"
id: 5,
text: "组合"
}, {
pId: 2,
id: 8,
text: "tree"
}, {
pId: 2,
id: 7,
text: "button"
}, {
pId: 2,
id: 9,
text: "listitem"
}, {
pId: 2,
id: 10,
text: "editor"
}, {
pId: 2,
text: "bi.canvas",
value: "demo.canvas"
}, {
pId: 2,
text: "bi.label",
value: "demo.label"
}, {
pId: 2,
text: "bi.collection",
value: "demo.collection"
}, {
pId: 2,
text: "bi.farbtastic",
value: "demo.farbtastic"
}, {
pId: 2,
text: "bi.formulaeditor",
value: "demo.formulaeditor"
}, {
pId: 2,
text: "bi.message",
value: "demo.message"
}, {
pId: 2,
text: "bi.grid_view",
value: "demo.grid_view"
}, {
pId: 2,
id: 6,
text: "弹出层"
}, {
pId: 2,
text: "bi.pager",
value: "demo.pager"
}, {
pId: 2,
text: "bi.svg",
value: "demo.svg"
}, {
pId: 2,
text: "bi.table",
value: "demo.table"
}, {
pId: 5,
text: "bi.combo",
value: "demo.combo"
}, {
pId: 5,
text: "bi.expander",
value: "demo.expander"
}, {
pId: 5,
text: "bi.group_button",
value: "demo.group_button"
}, {
pId: 5,
text: "bi.group_combo",
value: "demo.group_combo"
}, {
pId: 5,
text: "bi.loader",
value: "demo.loader"
}, {
pId: 5,
text: "bi.navigation",
value: "demo.navigation"
}, {
pId: 5,
text: "bi.searcher",
value: "demo.searcher"
}, {
pId: 5,
text: "bi.switcher",
value: "demo.switcher"
}, {
pId: 5,
text: "bi.tab",
value: "demo.tab"
}, {
pId: 5,
text: "bi.tree_button",
value: "demo.tree_button"
}, {
pId: 6,
text: "bi.layer_float_box",
value: "demo.layer_float_box"
}, {
pId: 6,
text: "bi.layer_popup",
value: "demo.layer_popup"
}, {
pId: 6,
text: "bi.layer_scroll",
value: "demo.layer_scroll"
}, {
pId: 6,
text: "bi.layer_searcher",
value: "demo.layer_searcher"
}, {
pId: 7,
text: "bi.icon_button",
value: "demo.icon_button"
}, {
pId: 7,
text: "bi.image_button",
value: "demo.image_button"
}, {
pId: 7,
text: "bi.button",
value: "demo.button"
}, {
pId: 7,
text: "bi.text_button",
value: "demo.text_button"
}, {
pId: 8,
text: "bi.treeview",
value: "demo.treeview"
}, {
pId: 8,
text: "bi.synctree",
value: "demo.synctree"
}, {
pId: 8,
text: "bi.parttree",
value: "demo.parttree"
}, {
pId: 8,
text: "bi.customtree",
value: "demo.customtree"
}, {
pId: 9,
text: "bi.list_items",
value: "demo.list_items"
}, {
pId: 10,
text: "bi.code_editor",
value: "demo.code_editor"
}, {
pId: 10,
text: "bi.editor",
value: "demo.editor"
}, {
pId: 10,
text: "bi.multifile_editor",
value: "demo.multifile_editor"
}, {
pId: 10,
text: "bi.text_area_editor",
value: "demo.text_area_editor"
}];

114
demo/js/config/case.js

@ -1,8 +1,116 @@
Demo.CASE_CONFIG = [{
id: 3,
text: "基础控件"
text: "实例控件"
}, {
pId: 3,
text: "bi.center_adapt",
value: "demo.center_adapt"
text: "bi.calendar",
value: "demo.calendar"
}, {
pId: 3,
text: "bi.zclip",
value: "demo.zclip"
}, {
pId: 3,
text: "bi.complex_calendar",
value: "demo.complex_calendar"
}, {
pId: 3,
text: "bi.calendar",
value: "demo.calendar"
}, {
pId: 3,
text: "bi.colorpicker",
value: "demo.colorpicker"
}, {
pId: 3,
text: "bi.bubble_combo",
value: "demo.bubble_combo"
}, {
pId: 3,
id: 11,
text: "editors"
}, {
pId: 11,
text: "bi.record_editor",
value: "demo.record_editor"
}, {
pId: 11,
text: "bi.shelter_editor",
value: "demo.shelter_editor"
}, {
pId: 11,
text: "bi.sign_editor",
value: "demo.sign_editor"
}, {
pId: 11,
text: "bi.state_editor",
value: "demo.state_editor"
}, {
pId: 3,
text: "各种checkbox",
value: "demo.checkboxes"
}, {
pId: 3,
text: "各种tip",
value: "demo.tips"
}, {
pId: 3,
text: "bi.branch_expander",
value: "demo.branch_expander"
}, {
pId: 3,
text: "bi.float_box",
value: "demo.float_box"
}, {
pId: 3,
text: "bi.float_box",
value: "demo.float_box"
}, {
pId: 3,
text: "bi.segment",
value: "demo.segment"
}, {
pId: 3,
id: 12,
text: "各种表格"
}, {
pId: 3,
id: 13,
text: "各种tree"
}, {
pId: 3,
text: "各种trigger",
value: "demo.triggers"
}, {
pId: 12,
text: "bi.adaptive_table",
value: "demo.adaptive_table"
}, {
pId: 12,
text: "bi.table_tree",
value: "demo.table_tree"
}, {
pId: 12,
text: "bi.layer_tree_table",
value: "demo.layer_tree_table"
}, {
pId: 13,
text: "bi.branch_tree",
value: "demo.branch_tree"
}, {
pId: 13,
text: "bi.display_tree",
value: "demo.display_tree"
}, {
pId: 13,
text: "bi.level_tree",
value: "demo.level_tree"
}, {
pId: 13,
text: "bi.simple_tree",
value: "demo.simple_tree"
}, {
pId: 13,
text: "bi.handstand_branch_tree",
value: "demo.handstand_branch_tree"
}];

6
demo/js/config/widget.js

@ -1,8 +1,8 @@
Demo.WIDGET_CONFIG = [{
id: 4,
text: "基础控件"
text: "详细控件"
}, {
pId: 4,
text: "bi.center_adapt",
value: "demo.center_adapt"
text: "bi.multi_select_combo",
value: "demo.multi_select_combo"
}];

88
demo/js/widget/demo.multiselectcombo.js

File diff suppressed because one or more lines are too long

14
demo/js/widget/demo.multiselecttree.js

@ -0,0 +1,14 @@
/**
* Created by User on 2017/3/22.
*/
Demo.MultiSelectTree = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-multi-select-tree"
},
render: function () {
return {
type: "bi.vertical",
}
}
});
$.shortcut("demo.multi_select_tree", Demo.MultiSelectTree);

34259
dist/base.js vendored

File diff suppressed because it is too large Load Diff

228
dist/core.js vendored

@ -13698,6 +13698,10 @@ if (!window.BI) {
return (string + "").toLocaleLowerCase();
},
isEndWithBlank: function (string) {
return /(\s|\u00A0)$/.test(string);
},
isLiteral: function (exp) {
var literalValueRE = /^\s?(true|false|-?[\d\.]+|'[^']*'|"[^"]*")\s?$/
return literalValueRE.test(exp)
@ -19644,7 +19648,7 @@ BI.Cache = {
* 控制器
* Controller层超类
* @class BI.Controller
* @extends FR.OB
* @extends BI.OB
* @abstract
*/
BI.Controller = BI.inherit(BI.OB, {
@ -22009,6 +22013,52 @@ BI.ShowListener = BI.inherit(BI.OB, {
}
});
BI.ShowListener.EVENT_CHANGE = "ShowListener.EVENT_CHANGE";/**
* style加载管理器
*
* Created by GUY on 2015/9/7.
* @class
*/
BI.StyleLoaderManager = BI.inherit(BI.OB, {
_defaultConfig: function () {
return BI.extend(BI.StyleLoaderManager.superclass._defaultConfig.apply(this, arguments), {});
},
_init: function () {
BI.StyleLoaderManager.superclass._init.apply(this, arguments);
this.stylesManager = {};
},
loadStyle: function (name, styleString) {
var d = document, styles = d.createElement('style');
d.getElementsByTagName('head')[0].appendChild(styles);
styles.setAttribute('type', 'text/css');
if (styles.styleSheet) {
styles.styleSheet.cssText = styleString;
} else {
styles.appendChild(document.createTextNode(styleString));
}
this.stylesManager[name] = styles;
return this;
},
get: function (name) {
return this.stylesManager[name];
},
has: function (name) {
return this.stylesManager[name] != null;
},
removeStyle: function (name) {
if (!this.has(name)) {
return this;
}
this.stylesManager[name].parentNode.removeChild(this.stylesManager[name]);
delete this.stylesManager[name];
return this;
}
});/**
* @class BI.Logic
* @extends BI.OB
*/
@ -23160,6 +23210,66 @@ Function.prototype.after = function (func) {
func.apply(this, arguments);
return ret;
}
};/*!
* jLayout JQuery Plugin v0.11
*
* Licensed under the revised BSD License.
* Copyright 2008, Bram Stein
* All rights reserved.
*/
if (jQuery) {
(function($){
// richer:容器在其各个边缘留出的空间
$.fn.insets = function () {
var p = this.padding(),
b = this.border();
return {
'top': p.top,
'bottom': p.bottom + b.bottom + b.top,
'left': p.left,
'right': p.right + b.right + b.left
};
};
// richer:获取 && 设置jQuery元素的边界
$.fn.bounds = function (value) {
var tmp = {hasIgnoredBounds : true};
if (value) {
if (!isNaN(value.x)) {
tmp.left = value.x;
}
if (!isNaN(value.y)) {
tmp.top = value.y;
}
if (value.width != null) {
tmp.width = (value.width - (this.outerWidth(true) - this.width()));
tmp.width = (tmp.width >= 0) ? tmp.width : value.width;
// fix chrome
//tmp.width = (tmp.width >= 0) ? tmp.width : 0;
}
if (value.height != null) {
tmp.height = value.height - (this.outerHeight(true) - this.height());
tmp.height = (tmp.height >= 0) ? tmp.height : value.height;
// fix chrome
//tmp.height = (tmp.height >= 0) ? tmp.height : value.0;
}
this.css(tmp);
return this;
}
else {
// richer:注意此方法只对可见元素有效
tmp = this.position();
return {
'x': tmp.left,
'y': tmp.top,
// richer:这里计算外部宽度和高度的时候,都不包括边框
'width': this.outerWidth(),
'height': this.outerHeight()
};
}
};
})(jQuery);
};if (!Number.prototype.toFixed || (0.00008).toFixed(3) !== '0.000' ||
(0.9).toFixed(0) === '0' || (1.255).toFixed(2) !== '1.25' ||
(1000000000000000128).toFixed(0) !== "1000000000000000128") {
@ -23644,51 +23754,6 @@ $.extend(String, {
return args[i];
});
}
});/**
* guy
* 状态常量
*/
_.extend(BI, {
Status: {
SUCCESS: 1,
WRONG: 2,
START: 3,
END: 4,
WAITING: 5,
READY: 6,
RUNNING: 7,
OUTOFBOUNDS: 8,
NULL: -1
},
Direction: {
Top: "top",
Bottom: "bottom",
Left: "left",
Right: "right",
Custom: "custom"
},
Axis: {
Vertical: "vertical",
Horizontal: "horizontal"
},
Selection: {
Default: -999,
None: -1,
Single: 0,
Multi: 1,
All: 2
},
HorizontalAlign: {
Left: "left",
Right: "right",
Center: "center"
},
VerticalAlign: {
Middle: "middle",
Top: "top",
Bottom: "bottom"
}
});BI.EventListener = {
listen: function listen(target, eventType, callback) {
if (target.addEventListener) {
@ -23995,7 +24060,70 @@ _.extend(BI, {
emptyStr: "",
emptyFn: function () {
},
empty: null
empty: null,
KeyCode: {
BACKSPACE: 8,
COMMA: 188,
DELETE: 46,
DOWN: 40,
END: 35,
ENTER: 13,
ESCAPE: 27,
HOME: 36,
LEFT: 37,
NUMPAD_ADD: 107,
NUMPAD_DECIMAL: 110,
NUMPAD_DIVIDE: 111,
NUMPAD_ENTER: 108,
NUMPAD_MULTIPLY: 106,
NUMPAD_SUBTRACT: 109,
PAGE_DOWN: 34,
PAGE_UP: 33,
PERIOD: 190,
RIGHT: 39,
SPACE: 32,
TAB: 9,
UP: 38
},
Status: {
SUCCESS: 1,
WRONG: 2,
START: 3,
END: 4,
WAITING: 5,
READY: 6,
RUNNING: 7,
OUTOFBOUNDS: 8,
NULL: -1
},
Direction: {
Top: "top",
Bottom: "bottom",
Left: "left",
Right: "right",
Custom: "custom"
},
Axis: {
Vertical: "vertical",
Horizontal: "horizontal"
},
Selection: {
Default: -999,
None: -1,
Single: 0,
Multi: 1,
All: 2
},
HorizontalAlign: {
Left: "left",
Right: "right",
Center: "center"
},
VerticalAlign: {
Middle: "middle",
Top: "top",
Bottom: "bottom"
}
});/**
* absolute实现的居中布局
* @class BI.AbsoluteCenterLayout
@ -25844,7 +25972,6 @@ BI.CardLayout = BI.inherit(BI.Layout, {
.appendTo(this.element);
widget.invisible();
this.addWidget(this._getCardName(cardName), widget);
widget._mount();
return widget;
},
@ -25862,7 +25989,10 @@ BI.CardLayout = BI.inherit(BI.Layout, {
//动画效果只有在全部都隐藏的时候才有意义,且只要执行一次动画操作就够了
!flag && !exist && (BI.Action && action instanceof BI.Action) ? (action.actionBack(el), flag = true) : el.element.hide();
} else {
(BI.Action && action instanceof BI.Action) ? action.actionPerformed(void 0, el, callback) : el.element.show(0, callback);
(BI.Action && action instanceof BI.Action) ? action.actionPerformed(void 0, el, callback) : el.element.show(0, function () {
el._mount();
callback && callback();
});
}
});
},

BIN
dist/icon/check-box-disable.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

BIN
dist/icon/check-box-normal.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

14
src/base/collection/collection.js

@ -58,20 +58,14 @@ BI.Collection = BI.inherit(BI.Widget, {
this._calculateSizeAndPositionData();
this._populate();
}
},
mounted: function () {
var o = this.options;
if (o.scrollLeft !== 0 || o.scrollTop !== 0) {
this.element.scrollTop(o.scrollTop);
this.element.scrollLeft(o.scrollLeft);
BI.nextTick(function () {
self.element.scrollTop(o.scrollTop);
self.element.scrollLeft(o.scrollLeft);
});
}
},
destroyed: function () {
this._debounceRelease = null;
},
_calculateSizeAndPositionData: function () {
var o = this.options;
var cellMetadata = [];

58
src/base/combination/combo.js

@ -4,14 +4,17 @@
*/
BI.Combo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.Combo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-combo",
var conf = BI.Combo.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-combo",
trigger: "click",
toggle: true,
direction: "bottom", //top||bottom||left||right||top,left||top,right||bottom,left||bottom,right
isDefaultInit: false,
isNeedAdjustHeight: true,//是否需要高度调整
isNeedAdjustWidth: true,
stopEvent: false,
stopPropagation: false,
adjustLength: 0,//调整的距离
adjustXOffset: 0,
adjustYOffset: 0,
@ -88,6 +91,14 @@ BI.Combo = BI.inherit(BI.Widget, {
_initPullDownAction: function () {
var self = this, o = this.options;
var evs = this.options.trigger.split(",");
var st = function (e) {
if (o.stopEvent) {
e.stopEvent();
}
if (o.stopPropagation) {
e.stopPropagation();
}
};
BI.each(evs, function (i, ev) {
switch (ev) {
case "hover":
@ -107,25 +118,27 @@ BI.Combo = BI.inherit(BI.Widget, {
});
break;
case "click":
if (ev) {
self.element.off(ev + "." + self.getName()).on(ev + "." + self.getName(), BI.debounce(function (e) {
if (self.combo.element.__isMouseInBounds__(e)) {
if (self.isEnabled() && self.combo.isEnabled()) {
o.toggle ? self._toggle() : self._popupView();
if (self.isViewVisible()) {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.combo);
self.fireEvent(BI.Combo.EVENT_EXPAND);
} else {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.combo);
self.fireEvent(BI.Combo.EVENT_COLLAPSE);
}
var debounce = BI.debounce(function (e) {
if (self.combo.element.__isMouseInBounds__(e)) {
if (self.isEnabled() && self.combo.isEnabled()) {
o.toggle ? self._toggle() : self._popupView();
if (self.isViewVisible()) {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.combo);
self.fireEvent(BI.Combo.EVENT_EXPAND);
} else {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.combo);
self.fireEvent(BI.Combo.EVENT_COLLAPSE);
}
}
}, BI.EVENT_RESPONSE_TIME, true));
}
}
}, BI.EVENT_RESPONSE_TIME, true);
self.element.off(ev + "." + self.getName()).on(ev + "." + self.getName(), function(e){
debounce(e);
st(e);
});
break;
}
})
});
},
_initCombo: function () {
@ -292,6 +305,7 @@ BI.Combo = BI.inherit(BI.Widget, {
top: p.top
});
}
this.position = p;
this.popupView.setVisible(isVisible);
},
@ -315,7 +329,7 @@ BI.Combo = BI.inherit(BI.Widget, {
BI.Combo.superclass.setEnable.apply(this, arguments);
this.combo && this.combo.setEnable(arg);
this.popupView && this.popupView.setEnable(arg);
!arg && this._hideView();
!arg && this.isViewVisible() && this._hideView();
},
setValue: function (v) {
@ -347,6 +361,10 @@ BI.Combo = BI.inherit(BI.Widget, {
return this.popupView;
},
getPopupPosition: function () {
return this.position;
},
doBehavior: function () {
this._assertPopupView();
this.popupView && this.popupView.doBehavior.apply(this.popupView, arguments);
@ -356,14 +374,14 @@ BI.Combo = BI.inherit(BI.Widget, {
this._toggle();
},
destroyed: function () {
destroy: function () {
$(document).unbind("mousedown." + this.getName())
.unbind("mousewheel." + this.getName())
.unbind("mouseenter." + this.getName())
.unbind("mousemove." + this.getName())
.unbind("mouseleave." + this.getName());
this.popupView && this.popupView.destroy();
BI.Resizers.remove(this.getName());
BI.Combo.superclass.destroy.apply(this, arguments);
}
});
BI.Combo.EVENT_TRIGGER_CHANGE = "EVENT_TRIGGER_CHANGE";

11
src/base/combination/expander.js

@ -35,8 +35,13 @@ BI.Expander = BI.inherit(BI.Widget, {
self._hideView();
}
if (self.isEnabled() && this.isEnabled()) {
if (type === BI.Events.EXPAND || type === BI.Events.COLLAPSE) {
if (type === BI.Events.EXPAND) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
self.fireEvent(BI.Expander.EVENT_EXPAND);
}
if(type === BI.Events.COLLAPSE) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
self.fireEvent(BI.Expander.EVENT_COLLAPSE);
}
if (type === BI.Events.CLICK) {
self.fireEvent(BI.Expander.EVENT_TRIGGER_CHANGE, value, obj);
@ -254,8 +259,8 @@ BI.Expander = BI.inherit(BI.Widget, {
return this.popupView && this.popupView.getNodeByValue(value);
},
destroyed: function () {
this.popupView && this.popupView.destroy();
destroy: function () {
BI.Expander.superclass.destroy.apply(this, arguments);
}
});
BI.Expander.EVENT_EXPAND = "EVENT_EXPAND";

6
src/base/combination/group.button.js

@ -298,6 +298,10 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
}
});
return node;
},
destroy: function () {
BI.ButtonGroup.superclass.destroy.apply(this, arguments);
}
});
BI.extend(BI.ButtonGroup, {
@ -309,4 +313,4 @@ BI.extend(BI.ButtonGroup, {
});
BI.ButtonGroup.EVENT_CHANGE = "EVENT_CHANGE";
$.shortcut("bi.button_group", BI.ButtonGroup);
$.shortcut("bi.button_group", BI.ButtonGroup);

4
src/base/combination/loader.js

@ -252,6 +252,10 @@ BI.Loader = BI.inherit(BI.Widget, {
BI.each([this.prev, this.next], function (i, ob) {
ob && ob.setVisible(false);
});
},
destroy: function () {
BI.Loader.superclass.destroy.apply(this, arguments);
}
});
BI.Loader.EVENT_CHANGE = "EVENT_CHANGE";

115
src/base/combination/map.button.js

@ -0,0 +1,115 @@
/**
* value作为key值缓存button 不支持顺序读写
* 适合用于频繁增删的一组button
* Created by GUY on 2015/8/10.
* @class BI.ButtonMap
* @extends BI.ButtonTree
*/
BI.ButtonMap = BI.inherit(BI.ButtonTree, {
_defaultConfig: function () {
return BI.extend(BI.ButtonMap.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-button-map"
})
},
_init: function () {
BI.ButtonMap.superclass._init.apply(this, arguments);
},
_createBtns: function (items) {
var self = this, o = this.options;
var buttons = BI.createWidgets(BI.createItems(items, {type: "bi.text_button", once: o.chooseType === 0}));
var keys = BI.map(items, function (i, item) {
item = BI.stripEL(item);
if (!(item.id || item.value)) {
throw new Error("item必须包含id或value属性");
}
return item.id || item.value;
});
return BI.object(keys, buttons);
},
setValue: function (v) {
var self = this;
v = BI.isArray(v) ? v : [v];
BI.each(this.buttons, function (val, item) {
if (!BI.isFunction(item.setSelected)) {
item.setValue(v);
return;
}
if (v.contains(val)) {
item.setSelected && item.setSelected(true);
} else {
item.setSelected && item.setSelected(false);
}
});
},
setNotSelectedValue: function (v) {
var self = this;
v = BI.isArray(v) ? v : [v];
BI.each(this.buttons, function (val, item) {
if (!BI.isFunction(item.setSelected)) {
item.setNotSelectedValue(v);
return;
}
if (v.contains(val)) {
item.setSelected && item.setSelected(false);
} else {
item.setSelected && item.setSelected(true);
}
});
},
populate: function (items) {
var self = this;
var args = [].slice.call(arguments);
var linkHashMap = new BI.LinkHashMap();
var val = function (item) {
return item.id || item.value;
};
if (!this.buttons) {
this.buttons = {};
}
//所有已存在的和新添加的
var willCreated = [];
BI.each(items, function (i, item) {
item = BI.stripEL(item);
if (self.buttons[val(item)]) {
var ob = self.buttons[val(item)];
args[0] = item.items;
args[2] = item;
ob.populate && ob.populate.apply(ob, args);
} else {
willCreated.push(item);
}
});
//创建新元素
args[0] = willCreated;
var newBtns = this._btnsCreator.apply(this, args);
//整理
var array = [];
BI.each(items, function (i, item) {
item = BI.stripEL(item);
var button = self.buttons[val(item)] || newBtns[val(item)];
linkHashMap.add(val(item), button);
array.push(button);
});
this.buttons = linkHashMap.map;
BI.DOM.hang(this.buttons);
this.empty();
var packages = this._packageItems(items, this._packageBtns(array));
BI.createWidget(BI.extend({element: this}, this._packageLayout(packages)));
},
getIndexByValue: function (value) {
throw new Error("不能使用getIndexByValue方法");
}
});
BI.ButtonMap.EVENT_CHANGE = "EVENT_CHANGE";
$.shortcut("bi.button_map", BI.ButtonMap);

4
src/base/combination/navigation.js

@ -127,6 +127,10 @@ BI.Navigation = BI.inherit(BI.Widget, {
empty: function(){
this.layout.deleteAllCard();
this.cardMap = {};
},
destroy: function(){
BI.Navigation.superclass.destroy.apply(this, arguments);
}
});
BI.Navigation.EVENT_CHANGE = "EVENT_CHANGE";

29
src/base/combination/searcher.js

@ -90,27 +90,26 @@ BI.Searcher = BI.inherit(BI.Widget, {
type: "bi.searcher_view",
chooseType: o.chooseType
});
BI.Maskers.create(this.getName(), o.adapter, {
offset: o.masker.offset,
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) {
if (o.isAutoSync) {
var values = o.adapter.getValue();
var values = o.adapter && o.adapter.getValue();
if (!obj.isSelected()) {
o.adapter.setValue(BI.deepWithout(values, obj.getValue()));
o.adapter && o.adapter.setValue(BI.deepWithout(values, obj.getValue()));
} else {
switch (o.chooseType) {
case BI.ButtonGroup.CHOOSE_TYPE_SINGLE:
o.adapter.setValue([obj.getValue()]);
o.adapter && o.adapter.setValue([obj.getValue()]);
break;
case BI.ButtonGroup.CHOOSE_TYPE_MULTI:
values.push(obj.getValue());
o.adapter.setValue(values);
o.adapter && o.adapter.setValue(values);
break;
}
}
@ -140,7 +139,9 @@ BI.Searcher = BI.inherit(BI.Widget, {
_pauseSearch: function () {
var o = this.options, name = this.getName();
this._stop = true;
BI.Maskers.hide(name);
BI.nextTick(function (name) {
BI.Maskers.hide(name);
}, this.getName());
if (BI.Maskers.has(name) && this._isSearching === true) {
this.popupView && this.popupView.pauseSearch && this.popupView.pauseSearch();
this.fireEvent(BI.Searcher.EVENT_PAUSE);
@ -181,7 +182,7 @@ BI.Searcher = BI.inherit(BI.Widget, {
o.onSearch({
times: 1,
keyword: keyword,
selectedValues: o.adapter.getValue()
selectedValues: o.adapter && o.adapter.getValue()
}, function (searchResult, matchResult) {
if (!self._stop) {
var args = [].slice.call(arguments);
@ -190,7 +191,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.getValue());
o.isAutoSync && self.popupView.setValue(o.adapter && o.adapter.getValue());
self.popupView.loaded && self.popupView.loaded();
self.fireEvent(BI.Searcher.EVENT_SEARCHING);
}
@ -258,6 +259,10 @@ BI.Searcher = BI.inherit(BI.Widget, {
return this.editor.getValue();
},
getKeywords: function () {
return this.editor.getKeywords();
},
getValue: function () {
var o = this.options;
if (o.isAutoSync) {
@ -283,9 +288,9 @@ BI.Searcher = BI.inherit(BI.Widget, {
this.popupView && this.popupView.empty();
},
destroyed: function () {
this.popupView && this.popupView.destroy();
destroy: function () {
BI.Maskers.remove(this.getName());
BI.Searcher.superclass.destroy.apply(this, arguments);
}
});
BI.Searcher.EVENT_CHANGE = "EVENT_CHANGE";

4
src/base/combination/switcher.js

@ -258,8 +258,8 @@ BI.Switcher = BI.inherit(BI.Widget, {
this.popupView && this.popupView.empty();
},
destroyed: function () {
this.popupView && this.popupView.destroy();
destroy: function () {
BI.Switcher.superclass.destroy.apply(this, arguments);
}
});
BI.Switcher.EVENT_EXPAND = "EVENT_EXPAND";

4
src/base/combination/tab.js

@ -114,9 +114,9 @@ BI.Tab = BI.inherit(BI.Widget, {
this.cardMap = {};
},
destroyed: function () {
this.layout.deleteAllCard();
destroy: function () {
this.cardMap = {};
BI.Tab.superclass.destroy.apply(this, arguments);
}
});
BI.Tab.EVENT_CHANGE = "EVENT_CHANGE";

118
src/base/combination/tree.button.js

@ -179,120 +179,4 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, {
});
BI.ButtonTree.EVENT_CHANGE = "EVENT_CHANGE";
$.shortcut("bi.button_tree", BI.ButtonTree);
/**
* value作为key值缓存button 不支持顺序读写
* 适合用于频繁增删的一组button
* Created by GUY on 2015/8/10.
* @class BI.ButtonMap
* @extends BI.ButtonTree
*/
BI.ButtonMap = BI.inherit(BI.ButtonTree, {
_defaultConfig: function () {
return BI.extend(BI.ButtonMap.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-button-map"
})
},
_init: function () {
BI.ButtonMap.superclass._init.apply(this, arguments);
},
_createBtns: function (items) {
var self = this, o = this.options;
var buttons = BI.createWidgets(BI.createItems(items, {type: "bi.text_button", once: o.chooseType === 0}));
var keys = BI.map(items, function (i, item) {
item = BI.stripEL(item);
if (!(item.id || item.value)) {
throw new Error("item必须包含id或value属性");
}
return item.id || item.value;
});
return BI.object(keys, buttons);
},
setValue: function (v) {
var self = this;
v = BI.isArray(v) ? v : [v];
BI.each(this.buttons, function (val, item) {
if (!BI.isFunction(item.setSelected)) {
item.setValue(v);
return;
}
if (v.contains(val)) {
item.setSelected && item.setSelected(true);
} else {
item.setSelected && item.setSelected(false);
}
});
},
setNotSelectedValue: function (v) {
var self = this;
v = BI.isArray(v) ? v : [v];
BI.each(this.buttons, function (val, item) {
if (!BI.isFunction(item.setSelected)) {
item.setNotSelectedValue(v);
return;
}
if (v.contains(val)) {
item.setSelected && item.setSelected(false);
} else {
item.setSelected && item.setSelected(true);
}
});
},
populate: function (items) {
var self = this;
var args = [].slice.call(arguments);
var linkHashMap = new BI.LinkHashMap();
var val = function (item) {
return item.id || item.value;
};
if (!this.buttons) {
this.buttons = {};
}
//所有已存在的和新添加的
var willCreated = [];
BI.each(items, function (i, item) {
item = BI.stripEL(item);
if (self.buttons[val(item)]) {
var ob = self.buttons[val(item)];
args[0] = item.items;
args[2] = item;
ob.populate && ob.populate.apply(ob, args);
} else {
willCreated.push(item);
}
});
//创建新元素
args[0] = willCreated;
var newBtns = this._btnsCreator.apply(this, args);
//整理
var array = [];
BI.each(items, function (i, item) {
item = BI.stripEL(item);
var button = self.buttons[val(item)] || newBtns[val(item)];
linkHashMap.add(val(item), button);
array.push(button);
});
this.buttons = linkHashMap.map;
BI.DOM.hang(this.buttons);
this.empty();
var packages = this._packageItems(items, this._packageBtns(array));
BI.createWidget(BI.extend({element: this}, this._packageLayout(packages)));
},
getIndexByValue: function (value) {
throw new Error("不能使用getIndexByValue方法");
}
});
BI.ButtonMap.EVENT_CHANGE = "EVENT_CHANGE";
$.shortcut("bi.button_map", BI.ButtonMap);
$.shortcut("bi.button_tree", BI.ButtonTree);

2
src/base/farbtastic/farbtastic.js

@ -18,6 +18,8 @@ BI.Farbtastic = BI.inherit(BI.Widget, {
_init: function () {
BI.Farbtastic.superclass._init.apply(this, arguments);
var self = this;
FR.$defaultImport('/com/fr/bi/web/js/third/farbtastic.js', 'js');
FR.$defaultImport('/com/fr/bi/web/css/base/third/farbtastic/farbtastic.css', 'css');
this.farbtastic = $.farbtastic(this.element, function (v) {
self.fireEvent(BI.Farbtastic.EVENT_CHANGE, self.getValue(), self);

88
src/base/formula/codemirror/addon/formula-hint.js vendored

@ -0,0 +1,88 @@
(function (mod) {
mod(CodeMirror);
})(function (CodeMirror) {
var Pos = CodeMirror.Pos;
function forEach(arr, f) {
for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);
}
function arrayContains(arr, item) {
if (!Array.prototype.indexOf) {
var i = arr.length;
while (i--) {
if (arr[i] === item) {
return true;
}
}
return false;
}
return arr.indexOf(item) != -1;
}
function scriptHint(editor, keywords, getToken, options) {
// Find the token at the cursor
var cur = editor.getCursor(), token = getToken(editor, cur);
if (/\b(?:string)\b/.test(token.type)) {
return;
}
token.state = CodeMirror.innerMode(editor.getMode(), token.state).state;
if (!/^[\w$_]*$/.test(token.string)) {
token = {
start: cur.ch, end: cur.ch, string: "", state: token.state,
type: token.string == "." ? "property" : null
};
} else if (token.end > cur.ch) {
token.end = cur.ch;
token.string = token.string.slice(0, cur.ch - token.start);
}
var tprop = token;
// If it is a property, find out what it is a property of.
while (tprop.type == "property") {
tprop = getToken(editor, Pos(cur.line, tprop.start));
if (tprop.string != ".") return;
tprop = getToken(editor, Pos(cur.line, tprop.start));
if (!context) var context = [];
context.push(tprop);
}
return {
list: getCompletions(token, context, keywords, options),
from: Pos(cur.line, token.start),
to: Pos(cur.line, token.end)
};
}
function getFormulaKeywords() {
return FormulaCollections;
}
function formulaHint(editor, options) {
return scriptHint(editor, getFormulaKeywords(),
function (e, cur) {
return e.getTokenAt(cur);
},
options);
};
CodeMirror.registerHelper("hint", "formula", formulaHint);
function getCompletions(token, context, keywords, options) {
var found = [], start = token.string;
if (!start) {
return found;
}
function maybeAdd(str) {
if (str.lastIndexOf(start, 0) == 0 && !arrayContains(found, str)) {
found.push(str);
}
}
if (context && context.length) {
context.pop();
} else {
forEach(keywords, maybeAdd);
}
return found;
}
});

80
src/base/formula/codemirror/addon/formula-mode.js vendored

@ -0,0 +1,80 @@
(function (mod) {
mod(CodeMirror);
})(function (CodeMirror) {
"use strict";
CodeMirror.defineMode('formula', function () {
function wordObj(words) {
var o = {};
for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true;
return o;
}
var atoms = wordObj(['false', 'true']);
var keywords = wordObj(FormulaCollections);
function tokenBase(stream, state) {
if (stream.eatSpace()) {
return null;
}
var ch = stream.next();
if (ch === '"' || ch === '\'') {
nextUntilUnescaped(stream, ch);
return "string";
}
if (/[\[\],\(\)]/.test(ch)) {
return 'bracket';
}
// richie:暂时不需要解析操作符号
//if (/[+\-*\/=<>!&|]/.test(ch)) {
// return 'operator';
//}
//if (/\d|\d./.test(ch)) {
// stream.eatWhile(/\d|\./);
// if (stream.eol() || !/\w/.test(stream.peek())) {
// return 'number';
// }
//}
stream.eatWhile(/[\w-]/);
var word = stream.current();
if (atoms.hasOwnProperty(word)) {
return "atom";
}
if (keywords.hasOwnProperty(word)) {
return "keyword";
}
return null;
}
function nextUntilUnescaped(stream, end) {
var escaped = false, next;
while ((next = stream.next()) != null) {
if (next === end && !escaped) {
return false;
}
escaped = !escaped && next === "\\";
}
return escaped;
}
function tokenize(stream, state) {
return (state.tokens[0] || tokenBase)(stream, state);
}
return {
startState: function () {
return {tokens: []};
},
token: function (stream, state) {
return tokenize(stream, state);
},
fold: "brace"
};
});
CodeMirror.defineMIME("text/fx-formula", "formula");
});

432
src/base/formula/codemirror/addon/show-hint.js vendored

@ -0,0 +1,432 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function (mod) {
mod(CodeMirror);
})(function (CodeMirror) {
"use strict";
var HINT_ELEMENT_CLASS = "CodeMirror-hint";
var ACTIVE_HINT_ELEMENT_CLASS = "CodeMirror-hint-active";
// This is the old interface, kept around for now to stay
// backwards-compatible.
CodeMirror.showHint = function (cm, getHints, options) {
if (!getHints) return cm.showHint(options);
if (options && options.async) getHints.async = true;
var newOpts = {hint: getHints};
if (options) for (var prop in options) newOpts[prop] = options[prop];
return cm.showHint(newOpts);
};
CodeMirror.defineExtension("showHint", function (options) {
// We want a single cursor position.
if (this.listSelections().length > 1 || this.somethingSelected()) return;
if (this.state.completionActive) this.state.completionActive.close();
var completion = this.state.completionActive = new Completion(this, options);
if (!completion.options.hint) return;
CodeMirror.signal(this, "startCompletion", this);
completion.update(true);
});
function Completion(cm, options) {
this.cm = cm;
this.options = this.buildOptions(options);
this.widget = null;
this.debounce = 0;
this.tick = 0;
this.startPos = this.cm.getCursor();
this.startLen = this.cm.getLine(this.startPos.line).length;
var self = this;
cm.on("cursorActivity", this.activityFunc = function () {
self.cursorActivity();
});
}
var requestAnimationFrame = window.requestAnimationFrame || function (fn) {
return setTimeout(fn, 1000 / 60);
};
var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout;
Completion.prototype = {
close: function () {
if (!this.active()) return;
this.cm.state.completionActive = null;
this.tick = null;
this.cm.off("cursorActivity", this.activityFunc);
if (this.widget && this.data) CodeMirror.signal(this.data, "close");
if (this.widget) this.widget.close();
CodeMirror.signal(this.cm, "endCompletion", this.cm);
},
active: function () {
return this.cm.state.completionActive == this;
},
pick: function (data, i) {
var completion = data.list[i];
if (completion.hint) completion.hint(this.cm, data, completion);
else {
this.cm.replaceRange(getText(completion), completion.from || data.from,
completion.to || data.to, "complete");
var to = this.cm.getCursor();
this.cm.markText(completion.from || data.from, to, {className: "#function", atomic: true});
this.cm.replaceSelection("() ");
to = this.cm.getCursor();
to.ch = to.ch - 2;
this.cm.setCursor(to);
this.cm.focus();
}
CodeMirror.signal(data, "pick", completion);
this.close();
},
cursorActivity: function () {
if (this.debounce) {
cancelAnimationFrame(this.debounce);
this.debounce = 0;
}
var pos = this.cm.getCursor(), line = this.cm.getLine(pos.line);
if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch ||
pos.ch < this.startPos.ch || this.cm.somethingSelected() ||
(pos.ch && this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) {
this.close();
} else {
var self = this;
this.debounce = requestAnimationFrame(function () {
self.update();
});
if (this.widget) this.widget.disable();
}
},
update: function (first) {
if (this.tick == null) return;
if (this.data) CodeMirror.signal(this.data, "update");
if (!this.options.hint.async) {
this.finishUpdate(this.options.hint(this.cm, this.options), first);
} else {
var myTick = ++this.tick, self = this;
this.options.hint(this.cm, function (data) {
if (self.tick == myTick) self.finishUpdate(data, first);
}, this.options);
}
},
finishUpdate: function (data, first) {
this.data = data;
var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle);
if (this.widget) this.widget.close();
if (data && data.list.length) {
if (picked && data.list.length == 1) {
this.pick(data, 0);
} else {
this.widget = new Widget(this, data);
CodeMirror.signal(data, "shown");
}
}
},
buildOptions: function (options) {
var editor = this.cm.options.hintOptions;
var out = {};
for (var prop in defaultOptions) out[prop] = defaultOptions[prop];
if (editor) for (var prop in editor)
if (editor[prop] !== undefined) out[prop] = editor[prop];
if (options) for (var prop in options)
if (options[prop] !== undefined) out[prop] = options[prop];
return out;
}
};
function getText(completion) {
if (typeof completion == "string") return completion;
else return completion.text;
}
function buildKeyMap(completion, handle) {
var baseMap = {
Up: function () {
handle.moveFocus(-1);
},
Down: function () {
handle.moveFocus(1);
},
PageUp: function () {
handle.moveFocus(-handle.menuSize() + 1, true);
},
PageDown: function () {
handle.moveFocus(handle.menuSize() - 1, true);
},
Home: function () {
handle.setFocus(0);
},
End: function () {
handle.setFocus(handle.length - 1);
},
Enter: handle.pick,
Tab: handle.pick,
Esc: handle.close
};
var custom = completion.options.customKeys;
var ourMap = custom ? {} : baseMap;
function addBinding(key, val) {
var bound;
if (typeof val != "string")
bound = function (cm) {
return val(cm, handle);
};
// This mechanism is deprecated
else if (baseMap.hasOwnProperty(val))
bound = baseMap[val];
else
bound = val;
ourMap[key] = bound;
}
if (custom)
for (var key in custom) if (custom.hasOwnProperty(key))
addBinding(key, custom[key]);
var extra = completion.options.extraKeys;
if (extra)
for (var key in extra) if (extra.hasOwnProperty(key))
addBinding(key, extra[key]);
return ourMap;
}
function getHintElement(hintsElement, el) {
while (el && el != hintsElement) {
if (el.nodeName.toUpperCase() === "LI" && el.parentNode == hintsElement) return el;
el = el.parentNode;
}
}
function Widget(completion, data) {
this.completion = completion;
this.data = data;
this.picked = false;
var widget = this, cm = completion.cm;
var hints = this.hints = document.createElement("ul");
hints.className = "CodeMirror-hints";
this.selectedHint = data.selectedHint || 0;
var completions = data.list;
for (var i = 0; i < completions.length; ++i) {
var elt = hints.appendChild(document.createElement("li")), cur = completions[i];
var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? "" : " " + ACTIVE_HINT_ELEMENT_CLASS);
if (cur.className != null) className = cur.className + " " + className;
elt.className = className;
if (cur.render) cur.render(elt, data, cur);
else elt.appendChild(document.createTextNode(cur.displayText || getText(cur)));
elt.hintId = i;
}
var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null);
var left = pos.left, top = pos.bottom, below = true;
hints.style.left = left + "px";
hints.style.top = top + "px";
// If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.
var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth);
var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight);
(completion.options.container || document.body).appendChild(hints);
var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH;
if (overlapY > 0) {
var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top);
if (curTop - height > 0) { // Fits above cursor
hints.style.top = (top = pos.top - height) + "px";
below = false;
} else if (height > winH) {
hints.style.height = (winH - 5) + "px";
hints.style.top = (top = pos.bottom - box.top) + "px";
var cursor = cm.getCursor();
if (data.from.ch != cursor.ch) {
pos = cm.cursorCoords(cursor);
hints.style.left = (left = pos.left) + "px";
box = hints.getBoundingClientRect();
}
}
}
var overlapX = box.right - winW;
if (overlapX > 0) {
if (box.right - box.left > winW) {
hints.style.width = (winW - 5) + "px";
overlapX -= (box.right - box.left) - winW;
}
hints.style.left = (left = pos.left - overlapX) + "px";
}
cm.addKeyMap(this.keyMap = buildKeyMap(completion, {
moveFocus: function (n, avoidWrap) {
widget.changeActive(widget.selectedHint + n, avoidWrap);
},
setFocus: function (n) {
widget.changeActive(n);
},
menuSize: function () {
return widget.screenAmount();
},
length: completions.length,
close: function () {
completion.close();
},
pick: function () {
widget.pick();
},
data: data
}));
if (completion.options.closeOnUnfocus) {
var closingOnBlur;
cm.on("blur", this.onBlur = function () {
closingOnBlur = setTimeout(function () {
completion.close();
}, 100);
});
cm.on("focus", this.onFocus = function () {
clearTimeout(closingOnBlur);
});
}
var startScroll = cm.getScrollInfo();
cm.on("scroll", this.onScroll = function () {
var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect();
var newTop = top + startScroll.top - curScroll.top;
var point = newTop - (window.pageYOffset || (document.documentElement || document.body).scrollTop);
if (!below) point += hints.offsetHeight;
if (point <= editor.top || point >= editor.bottom) return completion.close();
hints.style.top = newTop + "px";
hints.style.left = (left + startScroll.left - curScroll.left) + "px";
});
CodeMirror.on(hints, "dblclick", function (e) {
var t = getHintElement(hints, e.target || e.srcElement);
if (t && t.hintId != null) {
widget.changeActive(t.hintId);
widget.pick();
}
});
CodeMirror.on(hints, "click", function (e) {
var t = getHintElement(hints, e.target || e.srcElement);
if (t && t.hintId != null) {
widget.changeActive(t.hintId);
if (completion.options.completeOnSingleClick) widget.pick();
}
});
CodeMirror.on(hints, "mousedown", function () {
setTimeout(function () {
cm.focus();
}, 20);
});
CodeMirror.signal(data, "select", completions[0], hints.firstChild);
return true;
}
Widget.prototype = {
close: function () {
if (this.completion.widget != this) return;
this.completion.widget = null;
this.hints.parentNode.removeChild(this.hints);
this.completion.cm.removeKeyMap(this.keyMap);
var cm = this.completion.cm;
if (this.completion.options.closeOnUnfocus) {
cm.off("blur", this.onBlur);
cm.off("focus", this.onFocus);
}
cm.off("scroll", this.onScroll);
},
disable: function () {
this.completion.cm.removeKeyMap(this.keyMap);
var widget = this;
this.keyMap = {
Enter: function () {
widget.picked = true;
}
};
this.completion.cm.addKeyMap(this.keyMap);
},
pick: function () {
this.completion.pick(this.data, this.selectedHint);
},
changeActive: function (i, avoidWrap) {
if (i >= this.data.list.length)
i = avoidWrap ? this.data.list.length - 1 : 0;
else if (i < 0)
i = avoidWrap ? 0 : this.data.list.length - 1;
if (this.selectedHint == i) return;
var node = this.hints.childNodes[this.selectedHint];
node.className = node.className.replace(" " + ACTIVE_HINT_ELEMENT_CLASS, "");
node = this.hints.childNodes[this.selectedHint = i];
node.className += " " + ACTIVE_HINT_ELEMENT_CLASS;
if (node.offsetTop < this.hints.scrollTop)
this.hints.scrollTop = node.offsetTop - 3;
else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight)
this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + 3;
CodeMirror.signal(this.data, "select", this.data.list[this.selectedHint], node);
},
screenAmount: function () {
return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1;
}
};
CodeMirror.registerHelper("hint", "auto", function (cm, options) {
var helpers = cm.getHelpers(cm.getCursor(), "hint"), words;
if (helpers.length) {
for (var i = 0; i < helpers.length; i++) {
var cur = helpers[i](cm, options);
if (cur && cur.list.length) return cur;
}
} else if (words = cm.getHelper(cm.getCursor(), "hintWords")) {
if (words) return CodeMirror.hint.fromList(cm, {words: words});
} else if (CodeMirror.hint.anyword) {
return CodeMirror.hint.anyword(cm, options);
}
});
CodeMirror.registerHelper("hint", "fromList", function (cm, options) {
var cur = cm.getCursor(), token = cm.getTokenAt(cur);
var found = [];
for (var i = 0; i < options.words.length; i++) {
var word = options.words[i];
if (word.slice(0, token.string.length) == token.string)
found.push(word);
}
if (found.length) return {
list: found,
from: CodeMirror.Pos(cur.line, token.start),
to: CodeMirror.Pos(cur.line, token.end)
};
});
CodeMirror.commands.autocomplete = CodeMirror.showHint;
var defaultOptions = {
hint: CodeMirror.hint.auto,
completeSingle: true,
alignWithWord: true,
closeCharacters: /[\s()\[\]{};:>,]/,
closeOnUnfocus: true,
completeOnSingleClick: true,
container: null,
customKeys: null,
extraKeys: null
};
CodeMirror.defineOption("hintOptions", null);
});

8736
src/base/formula/codemirror/codemirror.js

File diff suppressed because it is too large Load Diff

11
src/base/formula/formulaeditor.js

@ -11,7 +11,8 @@
baseCls: 'bi-formula-editor',
watermark: '',
value: '',
fieldTextValueMap: {}
fieldTextValueMap: {},
showHint: true
});
},
_init: function () {
@ -25,7 +26,9 @@
});
this.editor.on("change", function (cm, change) {
self._checkWaterMark();
CodeMirror.showHint(cm, CodeMirror.formulaHint, {completeSingle: false});
if(o.showHint){
CodeMirror.showHint(cm, CodeMirror.formulaHint, {completeSingle: false});
}
BI.nextTick(function () {
self.fireEvent(BI.FormulaEditor.EVENT_CHANGE)
});
@ -99,6 +102,10 @@
this._checkWaterMark();
},
focus: function() {
this.editor.focus();
},
/**
* 添加字段
* @param field

21
src/base/foundation/bi.message.js

@ -9,6 +9,15 @@ $.extend(BI, {
var messageShow, $mask, $pop;
return {
alert: function (title, message, callback) {
this._show(false, title, message, callback);
},
confirm: function (title, message, callback, min_width) {
this._show(true, title, message, callback);
},
prompt: function (title, message, value, callback, min_width) {
FR.Msg.prompt(title, message, value, callback, min_width);
},
toast: function (message, level, context) {
context = context || $("body");
var toast = BI.createWidget({
@ -41,16 +50,16 @@ $.extend(BI, {
_show: function (hasCancel, title, message, callback) {
$mask = $('<div class="bi-message-mask">').css({
position: 'absolute',
'zIndex': 99999998,
'zIndex': BI.zIndex_tip - 2,
top: 0,
left: 0,
right: 0,
bottom: 0,
opacity: 0.1
opacity: 0.5
}).appendTo('body');
$pop = $('<div class="bi-message-depend">').css({
position: 'absolute',
'zIndex': 99999999,
'zIndex': BI.zIndex_tip - 1,
top: 0,
left: 0,
right: 0,
@ -65,7 +74,7 @@ $.extend(BI, {
controlItems.push({
el: {
type: 'bi.button',
text: BI.i18nText("BI-Cancel"),
text: BI.i18nText("BI-Basic_Cancel"),
height: 30,
level: 'ignore',
handler: function () {
@ -80,7 +89,7 @@ $.extend(BI, {
controlItems.push({
el: {
type: 'bi.button',
text: BI.i18nText("BI-OK"),
text: BI.i18nText("BI-Basic_OK"),
height: 30,
handler: function () {
close();
@ -106,7 +115,7 @@ $.extend(BI, {
center: {
el: {
type: 'bi.label',
text: title || BI.i18nText("BI-Prompt"),
text: title || BI.i18nText("BI-Basic_Prompt"),
textAlign: 'left',
hgap: 20,
height: 50

10
src/base/grid/grid.js

@ -60,13 +60,11 @@ BI.Grid = BI.inherit(BI.Widget, {
if (o.items.length > 0) {
this._populate();
}
},
mounted: function () {
var o = this.options;
if (o.scrollLeft !== 0 || o.scrollTop !== 0) {
this.element.scrollTop(o.scrollTop);
this.element.scrollLeft(o.scrollLeft);
BI.nextTick(function () {
self.element.scrollTop(o.scrollTop);
self.element.scrollLeft(o.scrollLeft);
});
}
},

19
src/base/layer/layer.popup.js

@ -53,7 +53,14 @@ BI.PopupView = BI.inherit(BI.Widget, {
"z-index": BI.zIndex_popup,
"min-width": o.minWidth + "px",
"max-width": o.maxWidth + "px"
}).bind({"click": fn, "mousewheel": fn});
}).bind({"click": fn});
//FIXME IE8下 jquery.mousewheeel.js 第一次执行65行$elem["offsetParent"]()的时候报错:未指明的错误 但是第二次或者调试的时候展开一下$elem内容均能避免上述问题
try {
this.element.bind("mousewheel", fn);
} catch (e) {
this.element.bind("mousewheel", fn);
}
o.stopPropagation && this.element.bind({"mousedown": fn, "mouseup": fn, "mouseover": fn});
o.stopEvent && this.element.bind({"mousedown": stop, "mouseup": stop, "mouseover": stop});
@ -135,6 +142,10 @@ BI.PopupView = BI.inherit(BI.Widget, {
})
},
getView: function () {
return this.button_group;
},
populate: function (items) {
this.button_group.populate.apply(this.button_group, arguments);
},
@ -145,9 +156,9 @@ BI.PopupView = BI.inherit(BI.Widget, {
},
resetHeight: function (h) {
var tbHeight = 30 * (this.toolbar ? 1 : 0),
tabHeight = 25 * (this.tab ? 1 : 0),
toolHeight = ((this.tool && this.tool.element.outerHeight()) || 25) * ((this.tool && this.tool.isVisible()) ? 1 : 0);
var tbHeight = this.toolbar ? (this.toolbar.attr("height") || 30) : 0,
tabHeight = this.tab ? (this.tab.attr("height") || 25) : 0,
toolHeight = ((this.tool && this.tool.attr("height")) || 25) * ((this.tool && this.tool.isVisible()) ? 1 : 0);
this.view.resetHeight ? this.view.resetHeight(h - tbHeight - tabHeight - toolHeight - 2) :
this.view.element.css({"max-height": (h - tbHeight - tabHeight - toolHeight - 2) + "px"})
},

20
src/base/pager/pager.js

@ -52,15 +52,6 @@ BI.Pager = BI.inherit(BI.Widget, {
this._populate();
},
populate: function () {
this.currPage = BI.result(this.options, "curr");
this._populate();
},
refresh: function () {
this._populate();
},
_populate: function () {
var self = this, o = this.options, view = [], dict = {};
this.empty();
@ -279,6 +270,17 @@ BI.Pager = BI.inherit(BI.Widget, {
default :
return val;
}
},
attr: function (key, value) {
BI.Pager.superclass.attr.apply(this, arguments);
if (key === "curr") {
this.currPage = BI.result(this.options, "curr");
}
},
populate: function () {
this._populate();
}
});
BI.Pager.EVENT_CHANGE = "EVENT_CHANGE";

2
src/base/pane.js

@ -56,7 +56,7 @@ BI.Pane = BI.inherit(BI.Widget, {
});
}
BI.Maskers.show(self.getName());
} else {
} else if (BI.isNull(this._loading)) {
this._loading = BI.createWidget({
type: "bi.layout",
cls: "loading-background",

192
src/base/reqloading/loading.request.js

@ -0,0 +1,192 @@
/**
* Created by Young's on 2016/8/17.
* 加载面板一般只用于 requestAsync
*/
BI.RequstLoading = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.RequstLoading.superclass._defaultConfig.apply(this, arguments), {});
},
_init: function () {
BI.RequstLoading.superclass._init.apply(this, arguments);
var self = this, o = this.options;
var mask = BI.Maskers.create(BI.RequstLoading.MASK_ID);
this.callback = o.callback;
this.paneTab = BI.createWidget({
type: "bi.tab",
cardCreator: BI.bind(this._cardCreator, this),
defaultShowIndex: BI.RequstLoading.ERROR,
width: 400,
height: 300
});
var tempIcon = BI.createWidget({
type: "bi.icon_button",
cls: "data-link-test-fail-icon",
width: 0,
height: 0
});
BI.createWidget({
type: "bi.absolute",
element: $('body'),
items: [{
el: tempIcon,
bottom: 0
}]
});
BI.createWidget({
type: "bi.absolute",
element: mask,
cls: "bi-request-loading",
items: [{
el: {
type: "bi.layout",
cls: "mask-pane"
},
top: 0,
left: 0,
bottom: 0,
right: 0
}, {
el: {
type: "bi.center_adapt",
items: [this.paneTab]
},
top: 0,
left: 0,
right: 0,
bottom: 0
}]
});
},
_cardCreator: function (v) {
var self = this;
var cancel = BI.createWidget({
type: "bi.button",
text: BI.i18nText("BI-Basic_Cancel"),
title: BI.i18nText("BI-Basic_Cancel"),
level: "ignore",
height: 28,
width: 90,
handler: function () {
BI.Maskers.hide(BI.RequstLoading.MASK_ID);
}
});
var retry = BI.createWidget({
type: "bi.button",
text: BI.i18nText("BI-Basic_Retry"),
title: BI.i18nText("BI-Basic_Retry"),
level: "common",
height: 28,
width: 90,
handler: function () {
self.paneTab.setSelect(BI.RequstLoading.LOADING);
self.callback();
}
});
switch (v) {
case BI.RequstLoading.LOADING:
return BI.createWidget({
type: "bi.vertical",
items: [{
type: "bi.center_adapt",
cls: "loading-bar-icon",
items: [{
type: "bi.icon",
width: 208,
height: 15
}]
}, {
type: "bi.label",
cls: "loading-comment",
text: BI.i18nText("BI-Basic_Loading"),
height: 30
}],
width: 208,
height: 200,
vgap: 10
});
case BI.RequstLoading.LOADING_TIMEOUT:
return BI.createWidget({
type: "bi.vertical",
items: [{
type: "bi.center_adapt",
cls: "loading-bar-icon",
items: [{
type: "bi.icon",
width: 208,
height: 15
}]
}, {
type: "bi.label",
cls: "loading-comment",
text: BI.i18nText("BI-Basic_Loading"),
height: 30
}, {
type: "bi.label",
text: BI.i18nText("BI-Request_Time_Out_Toast_Tip"),
cls: "load-timeout-warning"
}, {
type: "bi.left_right_vertical_adapt",
items: {
left: [cancel],
right: [retry]
},
height: 30,
llgap: 100,
rrgap: 100
}],
vgap: 10
});
case BI.RequstLoading.ERROR:
return BI.createWidget({
type: "bi.vertical",
items: [{
type: "bi.center_adapt",
cls: "data-link-test-fail-icon",
items: [{
type: "bi.icon",
width: 126,
height: 126
}]
}, {
type: "bi.label",
text: BI.i18nText("BI-Connection_Lost"),
cls: "load-fail-comment"
}, {
type: "bi.left_right_vertical_adapt",
items: {
left: [cancel],
right: [retry]
},
height: 30,
llgap: 100,
rrgap: 100
}],
vgap: 20
});
}
},
showLoading: function () {
BI.Maskers.show(BI.RequstLoading.MASK_ID);
this.paneTab.setSelect(BI.RequstLoading.LOADING);
},
showError: function () {
BI.Maskers.show(BI.RequstLoading.MASK_ID);
this.paneTab.setSelect(BI.RequstLoading.ERROR);
},
setCallback: function (callback) {
this.callback = callback;
}
});
BI.extend(BI.RequstLoading, {
MASK_ID: "___request__loading___",
LOADING: 1,
LOADING_TIMEOUT: 2,
ERROR: 3
});
$.shortcut("bi.request_loading", BI.RequstLoading);

5
src/base/single/a/a.js

@ -13,13 +13,14 @@ BI.A = BI.inherit(BI.Text, {
baseCls: (conf.baseCls || "") + " bi-a display-block",
href: "",
target: "_blank",
el: null
el: null,
element: "<a/>"
})
},
_init: function () {
var o = this.options;
this.options.element = $("<a href='" + o.href + "' target='" + o.target + "'>");
BI.A.superclass._init.apply(this, arguments);
this.element.attr({href: o.href, target: o.target});
if (o.el) {
BI.createWidget(o.el, {
element: this

4
src/base/single/bar/bar.loading.js

@ -5,8 +5,8 @@
*/
BI.LoadingBar = BI.inherit(BI.Single, {
consts: {
loadedText: '加载更多',
endText: '无更多数据'
loadedText: BI.i18nText("BI-Load_More"),
endText: BI.i18nText("BI-No_More_Data")
},
_defaultConfig: function() {
var conf = BI.LoadingBar.superclass._defaultConfig.apply(this, arguments);

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

@ -9,7 +9,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.BasicButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-basic-button cursor-pointer",
baseCls: (conf.baseCls || "") + " bi-basic-button" + (conf.invalid ? "" : " cursor-pointer"),
value: "",
text: "",
stopEvent: false,
@ -122,42 +122,36 @@ BI.BasicButton = BI.inherit(BI.Single, {
var selected = false;
hand.mousedown(function (e) {
// if (e.button === 0) {
if (mouseDown === true) {
return;
$(document).bind("mouseup." + self.getName(), function (e) {
// if (e.button === 0) {
if (BI.DOM.isExist(self) && !hand.__isMouseInBounds__(e) && mouseDown === true && !selected) {
self.setSelected(!self.isSelected());
self._trigger();
}
if (self.isSelected()) {
selected = true;
} else {
clk(e);
}
mouseDown = true;
ev(e);
mouseDown = false;
$(document).unbind("mouseup." + self.getName());
// }
});
if (mouseDown === true) {
return;
}
if (self.isSelected()) {
selected = true;
} else {
clk(e);
}
mouseDown = true;
ev(e);
// }
});
hand.mouseup(function (e) {
// if (e.button === 0) {
if (mouseDown === true && selected === true) {
clk(e);
}
mouseDown = false;
selected = false;
// }
});
var checking = BI.debounce(function () {
if (!BI.DOM.isExist(self)) {
$(document).unbind("mouseup." + self.getName());
if (BI.DOM.isExist(self) && mouseDown === true && selected === true) {
clk(e);
}
}, 3000);
$(document).bind("mouseup." + this.getName(), function (e) {
// if (e.button === 0) {
if (BI.DOM.isExist(self)) {
if (!hand.__isMouseInBounds__(e) && mouseDown === true && !selected) {
self.setSelected(!self.isSelected());
self._trigger();
}
mouseDown = false;
checking();
}
mouseDown = false;
selected = false;
$(document).unbind("mouseup." + self.getName());
// }
});
break;
@ -284,8 +278,13 @@ BI.BasicButton = BI.inherit(BI.Single, {
}
},
destroyed: function () {
empty: function () {
$(document).unbind("mouseup." + this.getName());
BI.BasicButton.superclass.empty.apply(this, arguments);
},
destroy: function () {
BI.BasicButton.superclass.destroy.apply(this, arguments);
}
});
BI.BasicButton.EVENT_CHANGE = "BasicButton.EVENT_CHANGE";

3
src/base/single/button/buttons/button.icon.js

@ -7,8 +7,7 @@ BI.IconButton = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.IconButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
tagName: "a",
baseCls: (conf.baseCls || "") + " bi-icon-button horizon-center display-block",
baseCls: (conf.baseCls || "") + " bi-icon-button horizon-center",
iconWidth: null,
iconHeight: null
})

3
src/base/single/button/buttons/button.image.js

@ -9,8 +9,7 @@ BI.ImageButton = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.ImageButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
tagName: "a",
baseCls: (conf.baseCls || "") + " bi-image-button display-block",
baseCls: (conf.baseCls || "") + " bi-image-button",
src: "",
iconWidth: "100%",
iconHeight: "100%"

29
src/base/single/button/buttons/button.text.js

@ -6,11 +6,10 @@
* 文字button
*/
BI.TextButton = BI.inherit(BI.BasicButton, {
_defaultConfig: function() {
_defaultConfig: function () {
var conf = BI.TextButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend( conf, {
tagName: "a",
baseCls: (conf.baseCls || "") + " bi-text-button display-block",
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-button",
textAlign: "center",
whiteSpace: "nowrap",
forceCenter: false,
@ -19,12 +18,12 @@ BI.TextButton = BI.inherit(BI.BasicButton, {
hgap: 0,
lgap: 0,
rgap: 0,
text:"",
text: "",
py: ""
})
},
_init:function() {
_init: function () {
BI.TextButton.superclass._init.apply(this, arguments);
var o = this.options;
this.text = BI.createWidget({
@ -46,18 +45,18 @@ BI.TextButton = BI.inherit(BI.BasicButton, {
});
},
doClick: function(){
doClick: function () {
BI.TextButton.superclass.doClick.apply(this, arguments);
if(this.isValid()) {
if (this.isValid()) {
this.fireEvent(BI.TextButton.EVENT_CHANGE, this.getValue(), this);
}
},
doRedMark: function(){
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function(){
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
@ -69,15 +68,19 @@ BI.TextButton = BI.inherit(BI.BasicButton, {
this.text.unHighLight.apply(this.text, arguments);
},
setText: function(text){
setText: function (text) {
BI.TextButton.superclass.setText.apply(this, arguments);
text = BI.isArray(text) ? text.join(",") : text;
this.text.setText(text);
},
setValue: function(text){
setStyle: function (style) {
this.text.setStyle(style);
},
setValue: function (text) {
BI.TextButton.superclass.setValue.apply(this, arguments);
if(!this.isReadOnly()) {
if (!this.isReadOnly()) {
text = BI.isArray(text) ? text.join(",") : text;
this.text.setValue(text);
}

119
src/base/single/button/listitem/blankiconicontextitem.js

@ -0,0 +1,119 @@
/**
* 带有一个占位
*
* Created by GUY on 2015/9/11.
* @class BI.BlankIconIconTextItem
* @extends BI.BasicButton
*/
BI.BlankIconIconTextItem = BI.inherit(BI.BasicButton, {
_const: {
commonWidth: 25
},
_defaultConfig: function () {
var conf = BI.BlankIconIconTextItem.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-blank-icon-text-item",
logic: {
dynamic: false
},
iconCls1: "close-ha-font",
iconCls2: "close-ha-font",
blankWidth: 0,
iconHeight: null,
iconWidth: null,
textHgap: 0,
textVgap: 0,
textLgap: 0,
textRgap: 0
})
},
_init: function () {
BI.BlankIconIconTextItem.superclass._init.apply(this, arguments);
var o = this.options, c = this._const;
var blank = BI.createWidget({
type: "bi.layout",
width: o.blankWidth
})
this.text = BI.createWidget({
type: "bi.label",
cls: "list-item-text",
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
});
this.icon1 = BI.createWidget({
type: "bi.icon_button",
cls: o.iconCls1,
forceNotSelected: true,
width: c.commonWidth
});
this.icon2 = BI.createWidget({
type: "bi.icon_button",
cls: o.iconCls2,
forceNotSelected: true,
width: c.commonWidth
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", blank, this.icon1, this.icon2, this.text)
}))));
},
doClick: function () {
BI.BlankIconIconTextItem.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.BlankIconIconTextItem.EVENT_CHANGE, this.getValue(), this);
}
},
setSelected: function (b) {
BI.BlankIconIconTextItem.superclass.setSelected.apply(this, arguments);
this.icon1.setSelected(b);
this.icon2.setSelected(b);
},
setValue: function () {
if (!this.isReadOnly()) {
this.text.setValue.apply(this.text, arguments);
}
},
getValue: function () {
return this.text.getValue();
},
setText: function () {
this.text.setText.apply(this.text, arguments);
},
getText: function () {
return this.text.getText();
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
}
});
BI.BlankIconIconTextItem.EVENT_CHANGE = "EVENT_CHANGE";
$.shortcut("bi.blank_icon_icon_text_item", BI.BlankIconIconTextItem);

4
src/base/single/editor/editor.code.js

@ -104,7 +104,7 @@ BI.CodeEditor = BI.inherit(BI.Single, {
case "param":
var fieldNameLength = i.to - i.from;
value = value.substr(0, i.from + num) + "$\{" + value.substr(i.from + num, fieldNameLength) + "\}" + value.substr(i.to + num, value.length);
num += fieldNameLength + 3;
num += 3;
break;
}
});
@ -113,7 +113,7 @@ BI.CodeEditor = BI.inherit(BI.Single, {
},
_analyzeContent: function (v) {
var regx = /\$[\{][^\}]*[\}]|\w*\w|\$\{[^\$\(\)\+\-\*\/)\$,]*\w\}|\$\{[^\$\(\)\+\-\*\/]*\w\}|\$\{[^\$\(\)\+\-\*\/]*[\u4e00-\u9fa5]\}|\w|(.)|\n/g;
var regx = /\$[\{][^\}]*[\}]|(\s+)|\w*\w|\$\{[^\$\(\)\+\-\*\/)\$,]*\w\}|\$\{[^\$\(\)\+\-\*\/]*\w\}|\$\{[^\$\(\)\+\-\*\/]*[\u4e00-\u9fa5]\}|\w|(.)|\n/g;
return v.match(regx);
},

4
src/base/single/editor/editor.js

@ -50,7 +50,9 @@ BI.Editor = BI.inherit(BI.Single, {
type: "bi.label",
cls: "bi-water-mark",
text: this.options.watermark,
height: this.options.height,
forceCenter: true,
height: o.height - 2 * (o.vgap + o.tgap),
whiteSpace: "nowrap",
textAlign: "left"
});
@ -275,7 +277,7 @@ BI.Editor = BI.inherit(BI.Single, {
},
getLastValidValue: function () {
return BI.trim(this.editor.getLastValidValue());
return this.editor.getLastValidValue();
},
resetLastValidValue: function () {

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

@ -37,26 +37,96 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
}]
});
this.content.element.on("input propertychange", function (e) {
self._checkWaterMark();
self.fireEvent(BI.TextAreaEditor.EVENT_CHANGE);
});
this.content.element.focus(function () {
self.content.element.addClass("textarea-editor-focus");
self.fireEvent(BI.TextAreaEditor.EVENT_FOCUS);
if (self.isValid()) {
self._focus();
self.fireEvent(BI.TextAreaEditor.EVENT_FOCUS);
}
$(document).bind("mousedown." + self.getName(), function (e) {
if (BI.DOM.isExist(self) && !self.element.__isMouseInBounds__(e)) {
$(document).unbind("mousedown." + self.getName());
self.content.element.blur();
}
});
});
this.content.element.blur(function () {
self.content.element.removeClass("textarea-editor-focus");
self.fireEvent(BI.TextAreaEditor.EVENT_BLUR);
if (self.isValid()) {
self._blur();
self.fireEvent(BI.TextAreaEditor.EVENT_BLUR);
}
$(document).unbind("mousedown." + self.getName());
});
if (BI.isKey(o.value)) {
self.setValue(o.value);
}
if (BI.isNotNull(o.style)) {
self.setValue(o.style);
}
this._checkWaterMark();
},
focus: function () {
_checkWaterMark: function () {
var self = this, o = this.options;
var val = this.getValue();
if (BI.isNotEmptyString(val)) {
this.watermark && this.watermark.destroy();
this.watermark = null;
} else {
if (BI.isNotEmptyString(o.watermark)) {
if (!this.watermark) {
this.watermark = BI.createWidget({
type: "bi.text_button",
cls: "bi-water-mark",
textAlign: "left",
height: 30,
text: o.watermark,
invalid: o.invalid,
disabled: o.disabled
});
this.watermark.on(BI.TextButton.EVENT_CHANGE, function () {
self.focus();
});
BI.createWidget({
type: 'bi.absolute',
element: this,
items: [{
el: this.watermark,
left: 0,
top: 0,
right: 0
}]
})
} else {
this.watermark.setText(o.watermark);
this.watermark.setValid(!o.invalid);
this.watermark.setEnable(!o.disabled);
}
}
}
},
_focus: function () {
this.content.element.addClass("textarea-editor-focus");
this._checkWaterMark();
},
_blur: function () {
this.content.element.removeClass("textarea-editor-focus");
this._checkWaterMark();
},
focus: function () {
this._focus();
this.content.element.focus();
},
blur: function () {
this.content.element.removeClass("textarea-editor-focus");
this._blur();
this.content.element.blur();
},
@ -81,13 +151,16 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
setValid: function (b) {
BI.TextAreaEditor.superclass.setValid.apply(this, arguments);
this.content.setValid(b);
this.watermark && this.watermark.setValid(b);
},
setEnable: function (b) {
BI.TextAreaEditor.superclass.setEnable.apply(this, arguments);
this.content.setEnable(b);
this.watermark && this.watermark.setEnable(b);
}
});
BI.TextAreaEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.TextAreaEditor.EVENT_BLUR = "EVENT_BLUR";
BI.TextAreaEditor.EVENT_FOCUS = "EVENT_FOCUS";
$.shortcut("bi.textarea_editor", BI.TextAreaEditor);

4
src/base/single/img/img.js

@ -10,7 +10,7 @@ BI.Img = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Img.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-img",
baseCls: (conf.baseCls || "") + " bi-img display-block",
src: "",
width: "100%",
height: "100%"
@ -33,4 +33,4 @@ BI.Img = BI.inherit(BI.Single, {
}
});
$.shortcut("bi.img", BI.Img);
$.shortcut("bi.img", BI.Img);

1
src/base/single/input/checkbox.js

@ -7,7 +7,6 @@ BI.Checkbox = BI.inherit(BI.IconButton, {
_defaultConfig: function() {
var conf = BI.Checkbox.superclass._defaultConfig.apply(this,arguments);
return BI.extend(conf, {
tagName: "a",
baseCls: (conf.baseCls || "") + " bi-checkbox check-box-icon",
selected: false,
handler: BI.emptyFn,

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

@ -16,8 +16,9 @@
var F = (function (item) {
return function (input) {
var files = input.files || [input];
if (!files.item)
if (!files.item) {
files.item = item;
}
return files;
};
})(function (i) {
@ -67,8 +68,9 @@
*/
stop: function (e) {
if (!e) {
if (self.event)
if (self.event) {
event.returnValue = !(event.cancelBubble = true);
}
} else {
e.stopPropagation ? e.stopPropagation() : e.cancelBubble = true;
e.preventDefault ? e.preventDefault() : e.returnValue = false;
@ -82,7 +84,7 @@
var multipart = function (boundary, name, file) {
return "--".concat(
boundary, CRLF,
'Content-Disposition: form-data; name="', name, '"; filename="', BI.cjkEncode(file.fileName), '"', CRLF,
'Content-Disposition: form-data; name="', name, '"; filename="', FR.cjkEncode(file.fileName), '"', CRLF,
"Content-Type: application/octet-stream", CRLF,
CRLF,
file.getAsBinary(), CRLF,
@ -99,11 +101,12 @@
sendFile;
// FireFox 3+, Safari 4 beta (Chrome 2 beta file is buggy and will not work)
if (xhr.upload || xhr.sendAsBinary)
if (xhr.upload || xhr.sendAsBinary) {
sendFile = function (handler, maxSize, width, height) {
if (-1 < maxSize && maxSize < handler.file.fileSize) {
if (isFunction(handler.onerror))
if (isFunction(handler.onerror)) {
handler.onerror();
}
return;
}
for (var
@ -116,28 +119,32 @@
i = 0;
i < length;
i++
)
) {
upload.addEventListener(
split[i].substring(2),
(function (event) {
return function (rpe) {
if (isFunction(handler[event]))
if (isFunction(handler[event])) {
handler[event](rpe, xhr);
}
};
})(split[i]),
false
);
}
upload.addEventListener(
"load",
function (rpe) {
if (handler.onreadystatechange === false) {
if (isFunction(handler.onload))
if (isFunction(handler.onload)) {
handler.onload(rpe, xhr);
}
} else {
setTimeout(function () {
if (xhr.readyState === 4) {
if (isFunction(handler.onload))
if (isFunction(handler.onload)) {
handler.onload(rpe, xhr);
}
} else {
setTimeout(arguments.callee, 15);
}
@ -146,13 +153,14 @@
},
false
);
xhr.open("post", handler.url + '&filename=' + BI.cjkEncode(handler.file.fileName), true);
xhr.open("post", handler.url + '&filename=' + FR.cjkEncode(handler.file.fileName), true);
if (!xhr.upload) {
var rpe = {loaded: 0, total: handler.file.fileSize || handler.file.size, simulation: true};
rpe.interval = setInterval(function () {
rpe.loaded += 1024 / 4;
if (rpe.total <= rpe.loaded)
if (rpe.total <= rpe.loaded) {
rpe.loaded = rpe.total;
}
upload.onprogress(rpe);
}, 100);
xhr.onabort = function () {
@ -176,8 +184,8 @@
upload.onprogress(rpe);
if (199 < xhr.status && xhr.status < 400) {
upload["onload"]({});
var attachO = BI.jsonDecode(xhr.responseText);
attachO.filename = BI.cjkDecode(handler.file.fileName);
var attachO = FR.jsonDecode(xhr.responseText);
attachO.filename = FR.cjkDecode(handler.file.fileName);
if (handler.file.type.indexOf('image') != -1) {
attachO.attach_type = "image";
}
@ -193,11 +201,11 @@
xhr.onreadystatechange = function () {
switch (xhr.readyState) {
case 4:
var attachO = BI.jsonDecode(xhr.responseText);
var attachO = FR.jsonDecode(xhr.responseText);
if (handler.file.type.indexOf('image') != -1) {
attachO.attach_type = "image";
}
attachO.filename = BI.cjkDecode(handler.file.fileName);
attachO.filename = handler.file.fileName;
if (handler.maxlength == 1) {
handler.attach_array[0] = attachO;
// handler.attach_array.push(attachO);
@ -222,8 +230,9 @@
}
return handler;
};
}
// Internet Explorer, Opera, others
else
else {
sendFile = function (handler, maxSize, width, height) {
var url = handler.url.concat(-1 === handler.url.indexOf("?") ? "?" : "&", "AjaxUploadFrame=true"),
rpe = {
@ -242,13 +251,13 @@
//rpe.loaded = rpe.total;
try {
var responseText = (iframe.contentWindow.document || iframe.contentWindow.contentDocument).body.innerHTML;
var attachO = BI.jsonDecode(responseText);
var attachO = FR.jsonDecode(responseText);
if (handler.file.type.indexOf('image') != -1) {
attachO.attach_type = "image";
}
//attachO.fileSize = responseText.length;
attachO.filename = BI.cjkDecode(handler.file.fileName);
attachO.filename = FR.cjkDecode(handler.file.fileName);
if (handler.maxlength == 1) {
handler.attach_array[0] = attachO;
} else {
@ -272,13 +281,13 @@
iframe.setAttribute("name", iframe.id = target);
iframe.setAttribute("src", url);
}
;
iframe.style.position = "absolute";
iframe.style.left = iframe.style.top = "-10000px";
iframe.onload = onload;
iframe.onerror = function (event) {
if (isFunction(handler.onerror))
if (isFunction(handler.onerror)) {
handler.onerror(rpe, event || window.event);
}
};
iframe.onreadystatechange = function () {
if (/loaded|complete/i.test(iframe.readyState)) {
@ -287,8 +296,9 @@
//wei : todo,将附件信息放到handler.attach
}
else if (isFunction(handler.onloadprogress)) {
if (rpe.loaded < rpe.total)
if (rpe.loaded < rpe.total) {
++rpe.loaded;
}
handler.onloadprogress(rpe, {
readyState: {
loading: 2,
@ -299,13 +309,14 @@
});
}
};
form.setAttribute("action", handler.url + '&width=' + width + '&height=' + height);
form.setAttribute("action", handler.url);
form.setAttribute("target", iframe.id);
form.setAttribute("method", "post");
form.appendChild(handler.file);
form.style.display = "none";
if (isFunction(handler.onloadstart))
if (isFunction(handler.onloadstart)) {
handler.onloadstart(rpe, {});
}
with (document.body || document.documentElement) {
appendChild(iframe);
appendChild(form);
@ -314,6 +325,7 @@
;
return handler;
};
}
xhr = null;
return sendFile;
})(Object.prototype.toString);
@ -359,7 +371,6 @@
handler.iframe.parentNode.removeChild(handler.iframe);
handler.iframe = null;
}
;
setTimeout(function () {
handler.file = handler.files[handler.current];
sendFile(handler, maxSize, width, height).onload = callee;
@ -463,7 +474,7 @@
// enable again the submit button/element
}, 1000);
};
_wrap.url = o.url ? o.url : BI.servletURL
_wrap.url = o.url ? o.url : FR.servletURL
+ '?op=fr_attach&cmd=ah_upload';
_wrap.fileType = o.accept; //文件类型限制
_wrap.attach_array = [];
@ -484,14 +495,14 @@
size = item.fileSize || item.size;
if (wrap.fileType && -1 === wrap.fileType.indexOf("*." + ext)) {
//文件类型不支持
BI.Msg.toast("文件类型不支持");
BI.Msg.toast(BI.i18nText("BI-Upload_File_Type_Error"));
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 0,
file: item
});
} else if (wrap.maxSize !== -1 && size && wrap.maxSize < size) {
//文件大小不支持
BI.Msg.toast("文件大小不支持");
BI.Msg.toast(BI.i18nText("BI-Upload_File_Size_Error"));
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 1,
file: item
@ -516,7 +527,9 @@
var self = this, o = this.options;
// be sure input accept multiple files
var input = this.element[0];
this.element.attr("multiple", "multiple");
if (o.multiple === true) {
this.element.attr("multiple", "multiple");
}
input.value = "";
// wrap Object
@ -542,8 +555,9 @@
// something like {onload:function(){alert("OK")},onerror:function(){alert("Error")}, etc ...}
upload: function (handler) {
if (handler) {
for (var key in handler)
for (var key in handler) {
this[key] = handler[key];
}
}
sendFiles(this, this.maxSize);
return this;

60
src/base/single/input/input.js

@ -20,21 +20,28 @@ BI.Input = BI.inherit(BI.Single, {
_init: function () {
BI.Input.superclass._init.apply(this, arguments);
var self = this;
var ctrlKey = false;
var inputEventValid = false;
var _keydown = BI.debounce(function (keyCode) {
self.onKeyDown(keyCode);
self.onKeyDown(keyCode, ctrlKey);
self._keydown_ = false;
}, 300);
var _clk = BI.debounce(BI.bind(this._click, this), BI.EVENT_RESPONSE_TIME, true);
this._blurDebounce = BI.debounce(BI.bind(this._blur, this), BI.EVENT_RESPONSE_TIME, true);
this.element
.keydown(function (e) {
inputEventValid = false;
ctrlKey = e.ctrlKey;
self.fireEvent(BI.Input.EVENT_QUICK_DOWN);
})
.keyup(function (e) {
self._keydown_ = true;
_keydown(e.keyCode);
if (!(inputEventValid && e.keyCode === BI.KeyCode.ENTER)) {
self._keydown_ = true;
_keydown(e.keyCode);
}
})
.on("input propertychange", function (e) {
inputEventValid = true;
self._keydown_ = true;
_keydown(e.keyCode);
})
@ -97,29 +104,10 @@ BI.Input = BI.inherit(BI.Single, {
this._click();
},
onKeyDown: function (keyCode) {
onKeyDown: function (keyCode, ctrlKey) {
if (!this.isValid() || BI.trim(this._lastValidValue) !== BI.trim(this.getValue())) {
this._checkValidationOnValueChange();
}
if (keyCode == BI.keyCode.ENTER) {
if (this.isValid() || this.options.quitChecker.apply(this, [BI.trim(this.getValue())]) !== false) {
this.blur();
this.fireEvent(BI.Input.EVENT_ENTER);
} else {
this.fireEvent(BI.Input.EVENT_RESTRICT);
}
}
if (keyCode == BI.keyCode.SPACE) {
this.fireEvent(BI.Input.EVENT_SPACE);
}
if (keyCode == BI.keyCode.BACKSPACE && this._lastValue == "") {
this.fireEvent(BI.Input.EVENT_REMOVE);
}
if (keyCode == BI.keyCode.BACKSPACE || keyCode == BI.keyCode.DELETE) {
this.fireEvent(BI.Input.EVENT_BACKSPACE);
}
this.fireEvent(BI.Input.EVENT_KEY_DOWN);
if (this.isValid() && BI.trim(this.getValue()) !== "") {
if (BI.trim(this.getValue()) !== this._lastValue && (!this._start || this._lastValue == null || this._lastValue === "")
|| (this._pause === true && !/(\s|\u00A0)$/.test(this.getValue()))) {
@ -129,13 +117,35 @@ BI.Input = BI.inherit(BI.Single, {
this.fireEvent(BI.Input.EVENT_START);
}
}
if (ctrlKey === true && keyCode === 86) {//ctrlKey+V
this._valueChange();
} else {
if (keyCode == BI.KeyCode.ENTER) {
if (this.isValid() || this.options.quitChecker.apply(this, [BI.trim(this.getValue())]) !== false) {
this.blur();
this.fireEvent(BI.Input.EVENT_ENTER);
} else {
this.fireEvent(BI.Input.EVENT_RESTRICT);
}
}
if (keyCode == BI.KeyCode.SPACE) {
this.fireEvent(BI.Input.EVENT_SPACE);
}
if (keyCode == BI.KeyCode.BACKSPACE && this._lastValue == "") {
this.fireEvent(BI.Input.EVENT_REMOVE);
}
if (keyCode == BI.KeyCode.BACKSPACE || keyCode == BI.KeyCode.DELETE) {
this.fireEvent(BI.Input.EVENT_BACKSPACE);
}
}
this.fireEvent(BI.Input.EVENT_KEY_DOWN);
if (/(\s|\u00A0)$/.test(this.getValue())) {
if (BI.isEndWithBlank(this.getValue())) {
this._pause = true;
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.PAUSE, "", this);
this.fireEvent(BI.Input.EVENT_PAUSE);
this._defaultState();
} else if ((keyCode === BI.keyCode.BACKSPACE || keyCode === BI.keyCode.DELETE) &&
} else if ((keyCode === BI.KeyCode.BACKSPACE || keyCode === BI.KeyCode.DELETE) &&
BI.trim(this.getValue()) === "" && (this._lastValue !== null && BI.trim(this._lastValue) !== "")) {
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.STOPEDIT, this.getValue(), this);
this.fireEvent(BI.Input.EVENT_STOP);

1
src/base/single/input/radio.js

@ -7,7 +7,6 @@ BI.Radio = BI.inherit(BI.IconButton, {
_defaultConfig: function() {
var conf = BI.Radio.superclass._defaultConfig.apply(this,arguments);
return BI.extend(conf, {
tagName: "a",
baseCls: (conf.baseCls || "") + " bi-radio radio-icon",
selected: false,
handler: BI.emptyFn,

44
src/base/single/label/label.js

@ -58,7 +58,7 @@ BI.Label = BI.inherit(BI.Single, {
BI.createWidget({
type: "bi.adaptive",
height: o.height,
scrollable: true,
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
@ -76,7 +76,7 @@ BI.Label = BI.inherit(BI.Single, {
json.width = o.textWidth;
BI.createWidget({
type: "bi.center_adapt",
scrollable: true,
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
@ -90,7 +90,7 @@ BI.Label = BI.inherit(BI.Single, {
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: true,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
@ -108,7 +108,7 @@ BI.Label = BI.inherit(BI.Single, {
});
BI.createWidget({
type: "bi.absolute",
scrollable: true,
scrollable: o.whiteSpace === "normal",
element: this,
items: [{
el: (this.text = BI.createWidget(json)),
@ -123,7 +123,7 @@ BI.Label = BI.inherit(BI.Single, {
json.width = o.width - 2 * o.hgap;
BI.createWidget({
type: "bi.center_adapt",
scrollable: true,
scrollable: o.whiteSpace === "normal",
element: this,
items: [{
el: (this.text = BI.createWidget(json))
@ -135,7 +135,7 @@ BI.Label = BI.inherit(BI.Single, {
json.width = o.textWidth;
BI.createWidget({
type: "bi.center_adapt",
scrollable: true,
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
@ -155,7 +155,7 @@ BI.Label = BI.inherit(BI.Single, {
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
scrollable: true,
scrollable: o.whiteSpace === "normal",
element: this,
items: [this.text]
});
@ -169,7 +169,7 @@ BI.Label = BI.inherit(BI.Single, {
BI.createWidget({
type: "bi.adaptive",
height: o.height,
scrollable: true,
scrollable: o.whiteSpace === "normal",
element: this,
items: [{
el: (this.text = BI.createWidget(json)),
@ -198,7 +198,7 @@ BI.Label = BI.inherit(BI.Single, {
BI.createWidget({
type: "bi.layout",
element: this.text,
scrollable: true
scrollable: o.whiteSpace === "normal"
});
return;
}
@ -225,7 +225,7 @@ BI.Label = BI.inherit(BI.Single, {
BI.createWidget({
type: "bi.layout",
element: this.text,
scrollable: true
scrollable: o.whiteSpace === "normal"
})
},
@ -238,7 +238,7 @@ BI.Label = BI.inherit(BI.Single, {
BI.createWidget({
type: "bi.adaptive",
height: o.height,
scrollable: true,
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
@ -256,7 +256,7 @@ BI.Label = BI.inherit(BI.Single, {
json.width = o.textWidth;
BI.createWidget({
type: "bi.vertical_adapt",
scrollable: true,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
@ -276,7 +276,7 @@ BI.Label = BI.inherit(BI.Single, {
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.vertical_adapt",
scrollable: true,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
@ -294,7 +294,7 @@ BI.Label = BI.inherit(BI.Single, {
});
BI.createWidget({
type: "bi.absolute",
scrollable: true,
scrollable: o.whiteSpace === "normal",
element: this,
items: [{
el: (this.text = BI.createWidget(json)),
@ -309,7 +309,7 @@ BI.Label = BI.inherit(BI.Single, {
json.width = o.width - 2 * o.hgap - o.lgap - o.rgap;
BI.createWidget({
type: "bi.vertical_adapt",
scrollable: true,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
@ -327,7 +327,7 @@ BI.Label = BI.inherit(BI.Single, {
json.width = o.textWidth;
BI.createWidget({
type: "bi.vertical_adapt",
scrollable: true,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
@ -347,7 +347,7 @@ BI.Label = BI.inherit(BI.Single, {
this.text = BI.createWidget(json)
this.text = BI.createWidget({
type: "bi.vertical_adapt",
scrollable: true,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
@ -367,7 +367,7 @@ BI.Label = BI.inherit(BI.Single, {
BI.createWidget({
type: "bi.adaptive",
height: o.height,
scrollable: true,
scrollable: o.whiteSpace === "normal",
element: this,
items: [{
el: (this.text = BI.createWidget(json)),
@ -396,7 +396,7 @@ BI.Label = BI.inherit(BI.Single, {
BI.createWidget({
type: "bi.layout",
element: this.text,
scrollable: true
scrollable: o.whiteSpace === "normal"
});
return;
}
@ -423,7 +423,7 @@ BI.Label = BI.inherit(BI.Single, {
BI.createWidget({
type: "bi.layout",
element: this.text,
scrollable: true
scrollable: o.whiteSpace === "normal"
})
},
@ -452,6 +452,10 @@ BI.Label = BI.inherit(BI.Single, {
return this.options.text;
},
setStyle: function (css) {
this.text.setStyle(css)
},
setValue: function (v) {
BI.Label.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {

4
src/base/single/text.js

@ -99,6 +99,10 @@ BI.Text = BI.inherit(BI.Single, {
}
},
setStyle: function (css) {
this.text.element.css(css)
},
setText: function (text) {
BI.Text.superclass.setText.apply(this, arguments);
this.options.text = text;

117
src/base/timeouttoast/widget.timeouttoast.js

@ -0,0 +1,117 @@
/**
* 组件请求数据超时提示
* Created by Young's on 2017/2/4.
*/
BI.TimeoutToast = BI.inherit(BI.Tip, {
_defaultConfig: function () {
return BI.extend(BI.TimeoutToast.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-timeout-toast"
});
},
_init: function () {
BI.TimeoutToast.superclass._init.apply(this, arguments);
var self = this;
this.requests = [];
this.toast = BI.createWidget({
type: "bi.vertical_adapt",
element: this,
items: [{
type: "bi.label",
text: BI.i18nText("BI-Request_Time_Out_Toast_Tip")
}, {
type: "bi.text_button",
cls: "cancel-button",
width: 60,
height: 22,
text: BI.i18nText("BI-Basic_Cancel"),
title: BI.i18nText("BI-Basic_Cancel"),
handler: function () {
self.cancelAllRequests();
}
}, {
type: "bi.text_button",
cls: "retry-button",
width: 60,
height: 22,
text: BI.i18nText("BI-Basic_Retry"),
title: BI.i18nText("BI-Basic_Retry"),
handler: function () {
self.toast.element.slideUp(500);
self._retryAll();
}
}, {
type: "bi.icon_button",
cls: "close-font",
width: 20,
height: 20,
title: BI.i18nText("BI-Basic_Close"),
handler: function () {
self.toast.element.slideUp(500);
}
}],
width: 520,
height: 30,
hgap: 2
});
BI.createWidget({
type: "bi.absolute",
element: $("body"),
items: [{
el: this.toast,
left: "50%",
top: 0
}]
});
this.toast.element.css({"margin-left": -1 * this.toast.element.outerWidth() / 2});
this.toast.setVisible(false);
},
_retryAll: function () {
var self = this;
var clonedRequests = BI.deepClone(this.requests);
this.requests = [];
BI.each(clonedRequests, function (i, options) {
BI.isFunction(self.callback) && self.callback(options);
});
},
cancelAllRequests: function () {
this.toast.element.slideUp(500);
BI.each(this.requests, function (i, reqArgs) {
if (BI.isNotNull(reqArgs) && BI.isFunction(reqArgs.complete)) {
reqArgs.complete();
}
});
this.requests = [];
},
setCallback: function (callback) {
this.callback = callback;
},
addReq: function (options) {
var self = this;
if (this.requests.length === 0) {
setTimeout(function () {
if (self.requests.contains(options)) {
self.toast.element.slideDown(500);
}
}, 5 * 60 * 1000); //5 min
}
this.requests.push(options);
},
removeReq: function (options) {
BI.remove(this.requests, options);
if (this.requests.length === 0) {
this.toast.element.slideUp(500);
}
},
hasReq: function (options) {
return this.requests.contains(options);
}
});
$.shortcut("bi.timeout_toast", BI.TimeoutToast);

0
src/base/tree/3parttree.js → src/base/tree/parttree.js

38
src/base/tree/2synctree.js → src/base/tree/synctree.js

@ -19,7 +19,7 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
var setting = {
async: {
enable: false,
otherParam: BI.cjkEncodeDO(paras)
otherParam: FR.cjkEncodeDO(paras)
},
check: {
enable: true
@ -157,36 +157,24 @@ BI.SyncTree = BI.inherit(BI.TreeView, {
}
},
_joinTree: function (map, values, isLast) {
var cur = map;
BI.each(values, function (i, value) {
if (i > 0 && BI.isPlainObject(cur) && BI.isEmpty(cur)) {
return;
}
if (isLast === true && i === values.length - 1) {
cur[value] = {};
return;
}
if (cur[value] == null) {
cur[value] = {};
}
cur = cur[value];
})
},
_join: function (valueA, valueB) {
var self = this;
var hashMap = valueA || {};
track([], valueB);
function track(parent, node) {
var map = {};
track([], valueA, valueB);
track([], valueB, valueA);
function track(parent, node, compare) {
BI.each(node, function (n, item) {
var next = parent.concat([n]);
self._joinTree(hashMap, next, BI.isPlainObject(item) && BI.isEmpty(item));
track(next, item);
if (BI.isNull(compare[n])) {
self._addTreeNode(map, parent, n, item);
} else if (BI.isEmpty(compare[n])) {
self._addTreeNode(map, parent, n, {});
} else {
track(parent.concat([n]), node[n], compare[n]);
}
})
}
return hashMap;
return map;
},
hasChecked: function () {

21
src/base/tree/1treeview.js → src/base/tree/treeview.js

@ -14,6 +14,9 @@ BI.TreeView = BI.inherit(BI.Pane, {
},
_init: function () {
BI.TreeView.superclass._init.apply(this, arguments);
FR.$defaultImport('/com/fr/bi/web/js/third/ztree/jquery.ztree.core-3.5.js', 'js');
FR.$defaultImport('/com/fr/bi/web/js/third/ztree/jquery.ztree.excheck-3.5.js', 'js');
FR.$defaultImport('/com/fr/bi/web/css/base/third/ztree/zTreeStyle.css', 'css');
this._stop = false;
this.container = BI.createWidget();
@ -68,7 +71,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
enable: true,
url: getUrl,
autoParam: ["id", "name"],
otherParam: BI.cjkEncodeDO(paras)
otherParam: FR.cjkEncodeDO(paras)
},
check: {
enable: true
@ -110,10 +113,10 @@ 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()));
+ "&parent_values= " + window.encodeURIComponent(FR.jsonEncode(parentNode))
+ "&check_state=" + window.encodeURIComponent(FR.jsonEncode(treeNode.getCheckStatus()));
return BI.servletURL + '?op=' + self.options.op + '&cmd=' + self.options.cmd + "&" + param;
return FR.servletURL + '?op=' + self.options.op + '&cmd=' + self.options.cmd + "&" + param;
}
function beforeExpand(treeId, treeNode) {
@ -310,7 +313,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
//处理标红
if (BI.isKey(o.paras.keyword)) {
var keyword = o.paras.keyword;
var ns = BI.Tree.transformToArrayFormat(nodes);
var ns = BI.Tree.arrayFormat(nodes);
BI.each(ns, function (i, n) {
n.text = $("<div>").__textKeywordMarked__(n.text, keyword, n.py).html();
});
@ -443,13 +446,17 @@ BI.TreeView = BI.inherit(BI.Pane, {
},
setValue: function (value, param) {
this.options.paras.selected_values = value || {};
this.selected_values = BI.deepClone(value) || {};
this.setSelectedValue(value);
this.checkAll(false);
this.updateValue(value, param);
this.refresh();
},
setSelectedValue: function (value) {
this.options.paras.selected_values = value || {};
this.selected_values = BI.deepClone(value) || {};
},
updateValue: function (values, param) {
if (!this.nodes) {
return;

286
src/core/base.js

@ -33,7 +33,7 @@ if (!window.BI) {
//Utility
_.extend(BI, {
i18nText: function (key) {
var localeText = key;
var localeText = FR.i18n[key];
if (!localeText) {
localeText = key;
}
@ -50,7 +50,7 @@ if (!window.BI) {
assert: function (v, is) {
if (this.isFunction(is)) {
if (!is(v)) {
throw new Error(v + "值不合法");
throw new Error(v + " error");
} else {
return true;
}
@ -59,7 +59,7 @@ if (!window.BI) {
is = [is];
}
if (!this.deepContains(is, v)) {
throw new Error(v + "值不合法");
throw new Error(v + " error");
}
},
@ -81,9 +81,33 @@ if (!window.BI) {
return widget instanceof BI.Widget || (BI.View && widget instanceof BI.View);
},
createWidget: function (item, options) {
var el;
options || (options = {});
if (BI.isEmpty(item) && BI.isEmpty(options)) {
return BI.Plugin.getObject("bi.layout", BI.createWidget({
type: "bi.layout"
}));
}
if (BI.isWidget(item)) {
return item;
}
if (item && (item.type || options.type)) {
el = BI.extend({}, options, item);
return BI.Plugin.getObject(el.type, FR.createWidget(BI.Plugin.getWidget(el.type, el), true));
}
if (item && item.el && (item.el.type || options.type)) {
el = BI.extend({}, options, item.el);
return BI.Plugin.getObject(el.type, FR.createWidget(BI.Plugin.getWidget(el.type, el), true));
}
if (item && BI.isWidget(item.el)) {
return item.el;
}
},
createWidgets: function (items, options) {
if (!BI.isArray(items)) {
throw new Error("无法根据items创建组件?")
throw new Error("cannot create Widgets")
}
return BI.map(BI.flatten(items), function (i, item) {
return BI.createWidget(item, BI.deepClone(options));
@ -254,7 +278,9 @@ if (!window.BI) {
backAny: function (obj, predicate, context) {
predicate = BI.iteratee(predicate, context);
for (var index = obj.length - 1; index >= 0; index--) {
if (predicate(index, obj[index], obj)) return true;
if (predicate(index, obj[index], obj)) {
return true;
}
}
return false;
},
@ -262,7 +288,9 @@ if (!window.BI) {
backEvery: function (obj, predicate, context) {
predicate = BI.iteratee(predicate, context);
for (var index = obj.length - 1; index >= 0; index--) {
if (!predicate(index, obj[index], obj)) return false;
if (!predicate(index, obj[index], obj)) {
return false;
}
}
return true;
},
@ -388,7 +416,9 @@ if (!window.BI) {
},
uniq: function (array, isSorted, iteratee, context) {
if (array == null) return [];
if (array == null) {
return [];
}
if (!_.isBoolean(isSorted)) {
context = iteratee;
iteratee = isSorted;
@ -455,11 +485,7 @@ if (!window.BI) {
},
isWidthOrHeight: function (w) {
if (typeof w == 'number') {
return w >= 0;
} else if (typeof w == 'string') {
return /^\d{1,3}%$/.exec(w) || w == 'auto' || /^\d+px$/.exec(w);
}
return FR.isWidthOrHeight(w);
},
isNotNull: function (obj) {
@ -550,11 +576,15 @@ if (!window.BI) {
isDeepMatch: function (object, attrs) {
var keys = BI.keys(attrs), length = keys.length;
if (object == null) return !length;
if (object == null) {
return !length;
}
var obj = Object(object);
for (var i = 0; i < length; i++) {
var key = keys[i];
if (!BI.isEqual(attrs[key], obj[key]) || !(key in obj)) return false;
if (!BI.isEqual(attrs[key], obj[key]) || !(key in obj)) {
return false;
}
}
return true;
},
@ -580,20 +610,24 @@ if (!window.BI) {
},
deepRemove: function (obj, target) {
var done = false;
var i;
if (BI.isArray(obj)) {
for (i = 0; i < obj.length; i++) {
if (BI.isEqual(target, obj[i])) {
obj.splice(i--, 1);
done = true;
}
}
} else {
BI.each(obj, function (i, v) {
if (BI.isEqual(target, obj[i])) {
delete obj[i];
done = true;
}
});
}
return done;
},
deepWithout: function (obj, target) {
@ -616,8 +650,14 @@ if (!window.BI) {
}
},
deepUniq: function () {
deepUnique: function (array) {
var result = [];
BI.each(array, function (i, item) {
if (!BI.deepContains(result, item)) {
result.push(item);
}
});
return result;
},
//比较两个对象得出不一样的key值
@ -668,31 +708,54 @@ if (!window.BI) {
var copies = callbacks.slice(0);
callbacks = [];
for (var i = 0; i < copies.length; i++) {
copies[i].func.apply(null, copies[i].args);
copies[i]();
}
}
if (typeof Promise !== 'undefined') {
var p = Promise.resolve();
timerFunc = function () {
p.then(nextTickHandler);
}
} else
/* istanbul ignore if */
if (typeof MutationObserver !== 'undefined') {
var counter = 1;
var observer = new MutationObserver(nextTickHandler);
var textNode = document.createTextNode(counter);
var textNode = document.createTextNode(counter + "");
observer.observe(textNode, {
characterData: true
});
timerFunc = function () {
counter = (counter + 1) % 2;
textNode.data = counter;
textNode.data = counter + "";
}
} else {
timerFunc = setTimeout
timerFunc = function () {
setTimeout(nextTickHandler, 0)
}
}
return function (cb) {
return function queueNextTick(cb) {
var _resolve;
var args = [].slice.call(arguments, 1);
callbacks.push({func: cb, args: args});
if (pending) return;
pending = true;
timerFunc(nextTickHandler, 0);
callbacks.push(function () {
if (cb) {
cb.apply(null, args);
}
if (_resolve) {
_resolve.apply(null, args);
}
});
if (!pending) {
pending = true;
timerFunc();
}
if (!cb && typeof Promise !== 'undefined') {
return new Promise(function (resolve) {
_resolve = resolve
})
}
}
})()
});
@ -726,7 +789,7 @@ if (!window.BI) {
try {
return parseInt(number, radix);
} catch (e) {
throw new Error("转成int类型失败");
throw new Error(number + "parse int error");
return NaN;
}
},
@ -735,7 +798,7 @@ if (!window.BI) {
try {
return parseFloat(number);
} catch (e) {
throw new Error("转成float类型失败");
throw new Error(number + "parse float error");
return NaN;
}
},
@ -797,9 +860,9 @@ if (!window.BI) {
var sum = 0;
BI.each(array, function (i, item) {
if (iteratee) {
sum += new Number(iteratee.apply(context, [i, item]));
sum += Number(iteratee.apply(context, [i, item]));
} else {
sum += new Number(item);
sum += Number(item);
}
});
return sum;
@ -825,6 +888,10 @@ if (!window.BI) {
return (string + "").toLocaleLowerCase();
},
isEndWithBlank: function (string) {
return /(\s|\u00A0)$/.test(string);
},
isLiteral: function (exp) {
var literalValueRE = /^\s?(true|false|-?[\d\.]+|'[^']*'|"[^"]*")\s?$/
return literalValueRE.test(exp)
@ -858,6 +925,10 @@ if (!window.BI) {
return BI.isString(str) && BI.isEmpty(str);
},
contentFormat: function () {
return FR.contentFormat.apply(FR, arguments);
},
/**
* 对字符串进行加密 {@link #decrypt}
* @static
@ -971,23 +1042,23 @@ if (!window.BI) {
//浏览器相关方法
_.extend(BI, {
isIE: function () {
return $.browser.msie;
return /(msie|trident)/i.test(navigator.userAgent.toLowerCase());
},
isChrome: function () {
return $.browser.chrome;
return /chrome/i.test(navigator.userAgent.toLowerCase());
},
isFireFox: function () {
return $.browser.mozilla;
return /firefox/i.test(navigator.userAgent.toLowerCase());
},
isOpera: function () {
return $.browser.opera;
return /opera/i.test(navigator.userAgent.toLowerCase());
},
isSafari: function () {
return $.browser.safari;
return /safari/i.test(navigator.userAgent.toLowerCase());
},
isKhtml: function () {
@ -1021,6 +1092,124 @@ if (!window.BI) {
//BI请求
_.extend(BI, {
ajax: (function () {
var loading, timeoutToast;
return function (option) {
option || (option = {});
option.data = BI.extend({}, Data.SharingPool.cat("urlParameters"), option.data);
//encode
encodeBIParam(option.data);
var async = true;
if (BI.isNotNull(option.async)) {
async = option.async;
}
if (BI.isNull(loading)) {
loading = BI.createWidget({
type: "bi.request_loading"
});
}
if (BI.isNull(timeoutToast)) {
timeoutToast = BI.createWidget({
type: "bi.timeout_toast"
});
timeoutToast.setCallback(function (op) {
decodeBIParam(op.data);
BI.ajax(op);
});
}
timeoutToast.addReq(option);
FR.ajax({
url: option.url,
type: "POST",
data: option.data,
async: async,
error: function () {
if (!timeoutToast.hasReq(option)) {
return;
}
timeoutToast.removeReq(option);
//失败 取消、重新加载
loading.setCallback(function () {
decodeBIParam(option.data);
BI.ajax(option);
});
loading.showError();
},
complete: function (res, status) {
if (!timeoutToast.hasReq(option)) {
return;
}
timeoutToast.removeReq(option);
//登录超时
if (BI.isNotNull(res.responseText) &&
res.responseText.indexOf("fs-login-content") > -1 &&
res.responseText.indexOf("fs-login-input-password-confirm") === -1) {
if (BI.Popovers.isVisible(BI.LoginTimeOut.POPOVER_ID)) {
return;
}
if (BI.isNotNull(BI.Popovers.get(BI.LoginTimeOut.POPOVER_ID))) {
BI.Popovers.open(BI.LoginTimeOut.POPOVER_ID);
return;
}
var loginTimeout = BI.createWidget({
type: "bi.login_timeout"
});
loginTimeout.on(BI.LoginTimeOut.EVENT_LOGIN, function () {
decodeBIParam(option.data);
BI.ajax(option);
BI.Popovers.remove(BI.LoginTimeOut.POPOVER_ID);
});
BI.Popovers.create(BI.LoginTimeOut.POPOVER_ID, loginTimeout, {
width: 600,
height: 400
}).open(BI.LoginTimeOut.POPOVER_ID);
} else if (BI.isNotNull(res.responseText) &&
res.responseText.indexOf("script") > -1 &&
res.responseText.indexOf("Session Timeout...") > -1) {
//登录失效
loading.setCallback(function () {
location.reload();
});
loading.showError();
} else if (status === "success" && BI.isFunction(option.success)) {
option.success(FR.jsonDecode(res.responseText));
}
if (BI.isFunction(option.complete)) {
option.complete(FR.jsonDecode(res.responseText), status);
}
}
});
return function cancel() {
timeoutToast.removeReq(option);
};
function encodeBIParam(data) {
for (var key in data) {
if (_.isObject(data[key])) {
data[key] = window.encodeURIComponent(FR.jsonEncode(data[key]));
} else {
data[key] = window.encodeURIComponent(data[key]);
}
}
}
function decodeBIParam(data) {
for (var key in data) {
data[key] = window.decodeURIComponent(data[key]);
if (_.isObject(data[key])) {
data[key] = FR.jsonDecode(data[key]);
}
}
}
}
})(),
/**
* 异步ajax请求
* @param {String} op op参数
@ -1030,38 +1219,29 @@ if (!window.BI) {
* @param {Function} complete 回调
*/
requestAsync: function (op, cmd, data, callback, complete) {
// if (BI.isNull(BI.REQUEST_LOADING)) {
// BI.REQUEST_LOADING = BI.createWidget({
// type: "bi.request_loading"
// });
// }
data = data || {};
if (!BI.isKey(op)) {
op = 'fr_bi_dezi';
}
if (op === "fr_bi_dezi") {
if (op === "fr_bi_dezi" || op === "fr_bi_configure") {
data.sessionID = Data.SharingPool.get("sessionID");
}
var url = FR.servletURL + '?op=' + op + '&cmd=' + cmd + "&_=" + Math.random();
(BI.ajax || FR.ajax)({
return (BI.ajax)({
url: url,
type: 'POST',
data: data,
error: function () {
// BI.Msg.toast(BI.i18nText("BI-Ajax_Error"));
//失败 取消、重新加载
// BI.REQUEST_LOADING.setCallback(function () {
// BI.requestAsync(op, cmd, data, callback, complete);
// });
// BI.REQUEST_LOADING.showError();
},
complete: function (res, status) {
if (BI.isFunction(callback) && status === 'success') {
callback(BI.jsonDecode(res.responseText));
BI.Maskers.hide(BI.RequstLoading.MASK_ID);
success: function (res) {
if (BI.isFunction(callback)) {
callback(res);
}
},
complete: function (res, status) {
if (BI.isFunction(complete)) {
complete();
complete(res);
}
}
});
@ -1084,7 +1264,7 @@ if (!window.BI) {
}
var url = FR.servletURL + '?op=' + op + '&cmd=' + cmd + "&_=" + Math.random();
var result = {};
(BI.ajax || FR.ajax)({
(BI.ajax)({
url: url,
type: 'POST',
async: false,
@ -1094,7 +1274,7 @@ if (!window.BI) {
},
complete: function (res, status) {
if (status === 'success') {
result = BI.jsonDecode(res.responseText);
result = res;
}
}
});

2
src/core/controller.js

@ -3,7 +3,7 @@
* 控制器
* Controller层超类
* @class BI.Controller
* @extends FR.OB
* @extends BI.OB
* @abstract
*/
BI.Controller = BI.inherit(BI.OB, {

47
src/core/loader/loader.style.js

@ -0,0 +1,47 @@
/**
* style加载管理器
*
* Created by GUY on 2015/9/7.
* @class
*/
BI.StyleLoaderManager = BI.inherit(BI.OB, {
_defaultConfig: function () {
return BI.extend(BI.StyleLoaderManager.superclass._defaultConfig.apply(this, arguments), {});
},
_init: function () {
BI.StyleLoaderManager.superclass._init.apply(this, arguments);
this.stylesManager = {};
},
loadStyle: function (name, styleString) {
var d = document, styles = d.createElement('style');
d.getElementsByTagName('head')[0].appendChild(styles);
styles.setAttribute('type', 'text/css');
if (styles.styleSheet) {
styles.styleSheet.cssText = styleString;
} else {
styles.appendChild(document.createTextNode(styleString));
}
this.stylesManager[name] = styles;
return this;
},
get: function (name) {
return this.stylesManager[name];
},
has: function (name) {
return this.stylesManager[name] != null;
},
removeStyle: function (name) {
if (!this.has(name)) {
return this;
}
this.stylesManager[name].parentNode.removeChild(this.stylesManager[name]);
delete this.stylesManager[name];
return this;
}
});

2
src/core/var.js

@ -15,7 +15,7 @@ _.extend(BI, {
emptyFn: function () {
},
empty: null,
keyCode: {
KeyCode: {
BACKSPACE: 8,
COMMA: 188,
DELETE: 46,

6
src/core/wrapper/layout/layout.card.js

@ -83,7 +83,6 @@ BI.CardLayout = BI.inherit(BI.Layout, {
.appendTo(this.element);
widget.invisible();
this.addWidget(this._getCardName(cardName), widget);
widget._mount();
return widget;
},
@ -101,7 +100,10 @@ BI.CardLayout = BI.inherit(BI.Layout, {
//动画效果只有在全部都隐藏的时候才有意义,且只要执行一次动画操作就够了
!flag && !exist && (BI.Action && action instanceof BI.Action) ? (action.actionBack(el), flag = true) : el.element.hide();
} else {
(BI.Action && action instanceof BI.Action) ? action.actionPerformed(void 0, el, callback) : el.element.show(0, callback);
(BI.Action && action instanceof BI.Action) ? action.actionPerformed(void 0, el, callback) : el.element.show(0, function () {
el._mount();
callback && callback();
});
}
});
},

21
src/css/base/base.css

@ -0,0 +1,21 @@
/****添加计算宽度的--运算符直接需要space****/
/****** common color(常用颜色,可用于普遍场景) *****/
/**** custom color(自定义颜色,用于特定场景) ****/
@font-face {
font-family: 'bbr';
src: url('/resources/fonts/iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('/resources/fonts/iconfont.woff') format('woff'), /* chrome、firefox */ url('/resources/fonts/iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('/resources/fonts/iconfont.svg#svgFontName') format('svg');
/* iOS 4.1- */
}
.b-font {
font-family: "bi";
font-style: normal;
-webkit-font-smoothing: antialiased;
-webkit-text-stroke-width: 0.2px;
-moz-osx-font-smoothing: grayscale;
}
.bi-base-request-fail-mask .mask-pane {
background: #ffffff;
opacity: 0.8;
filter: alpha(opacity=80);
}

11
src/css/base/chart/chart.combine.css

@ -0,0 +1,11 @@
/****添加计算宽度的--运算符直接需要space****/
/****** common color(常用颜色,可用于普遍场景) *****/
/**** custom color(自定义颜色,用于特定场景) ****/
.bi-combine-chart .bi-linkage-list {
background-color: #ffffff;
border: 1px solid #eaeaea;
z-index: 1000000000;
}
.bi-combine-chart .bi-linkage-list .bi-linkage-list-item:hover {
background-color: #f4f4f4;
}

11
src/css/base/combo/popup.bubble.css

@ -0,0 +1,11 @@
/****添加计算宽度的--运算符直接需要space****/
/****** common color(常用颜色,可用于普遍场景) *****/
/**** custom color(自定义颜色,用于特定场景) ****/
.bi-bubble-popup-view {
-webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}
.bi-bubble-popup-view .bubble-popup-line {
background-color: #009de3;
}

9
src/css/base/dom.css

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

32
src/css/base/logintimeout/login.timeout.css

@ -0,0 +1,32 @@
/****添加计算宽度的--运算符直接需要space****/
/****** common color(常用颜色,可用于普遍场景) *****/
/**** custom color(自定义颜色,用于特定场景) ****/
.bi-login-timeout-center .input-wrapper {
border-bottom: 1px solid #eaeaea;
}
.bi-login-timeout-center .input-wrapper .login-input {
font-size: 16px;
}
.bi-login-timeout-center .input-wrapper .error-mask {
background: #1a1a1a;
opacity: 0.25;
filter: alpha(opacity=25);
color: #ffffff;
font-size: 16px;
}
.bi-login-timeout-center .login-button {
background: #009de3;
-webkit-border-radius: 25px;
-moz-border-radius: 25px;
border-radius: 25px;
font-size: 22px;
color: #ffffff;
}
.bi-login-timeout-center .login-button:hover {
opacity: 0.8;
filter: alpha(opacity=80);
}
.bi-login-timeout-south .keep-state {
font-size: 14px;
color: #808080;
}

9
src/css/base/pager/pager.all.count.css

@ -0,0 +1,9 @@
/****添加计算宽度的--运算符直接需要space****/
/****** common color(常用颜色,可用于普遍场景) *****/
/**** custom color(自定义颜色,用于特定场景) ****/
.bi-all-count-pager .all-pager-prev {
font-size: 16px;
}
.bi-all-count-pager .all-pager-next {
font-size: 16px;
}

2
src/css/base/pager/pager.direction.css

@ -3,9 +3,7 @@
/**** custom color(自定义颜色,用于特定场景) ****/
.bi-direction-pager .direction-pager-prev {
font-size: 16px;
background: #f4f4f4;
}
.bi-direction-pager .direction-pager-next {
font-size: 16px;
background: #f4f4f4;
}

10
src/css/base/reqloading/loading.request.css

@ -7,8 +7,14 @@
filter: alpha(opacity=80);
}
.bi-request-loading .loading-comment {
font-size: 14px;
font-size: 20px;
color: #808080;
}
.bi-request-loading .load-fail-comment {
font-size: 14px;
font-size: 20px;
color: #808080;
}
.bi-request-loading .load-timeout-warning {
font-size: 16px;
color: #e85050;
}

6
src/css/base/single/editor/editor.state.css

@ -1,10 +1,6 @@
/****添加计算宽度的--运算符直接需要space****/
/****** common color(常用颜色,可用于普遍场景) *****/
/**** custom color(自定义颜色,用于特定场景) ****/
.bi-state-editor {
font-size: 12px;
}
.bi-state-editor .state-editor-infinite-text {
font-size: 12px;
color: #1a1a1a;
color: #cccccc;
}

6
src/css/base/single/editor/editor.state.simple.css

@ -1,10 +1,6 @@
/****添加计算宽度的--运算符直接需要space****/
/****** common color(常用颜色,可用于普遍场景) *****/
/**** custom color(自定义颜色,用于特定场景) ****/
.bi-simple-state-editor {
font-size: 12px;
}
.bi-simple-state-editor .state-editor-infinite-text {
font-size: 12px;
color: #1a1a1a;
color: #cccccc;
}

2
src/css/base/single/text.css

@ -5,5 +5,5 @@
text-overflow: ellipsis;
overflow-x: hidden;
white-space: nowrap;
word-break: break-word;
word-break: break-all;
}

44
src/css/base/third/ztree/zTreeStyle.css

@ -10,13 +10,10 @@ website: http://code.google.com/p/jquerytree/
.ztree * {
padding: 0;
margin: 0;
font-size: 12px;
font-family: Verdana, Arial, Helvetica, AppleGothic, sans-serif;
}
.ztree {
margin: 0;
padding: 5px;
color: #333333;
}
.ztree li {
padding: 0;
@ -32,14 +29,13 @@ website: http://code.google.com/p/jquerytree/
padding: 0 0 0 18px;
}
.ztree li ul.line {
background: url(icon/tree-vertical-line-1.png) 0 0 repeat-y;
background: url(${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-1.png) 0 0 repeat-y;
}
.ztree li a {
padding: 1px 3px 0 0;
margin: 0;
cursor: pointer;
height: 24px;
color: #333;
background-color: transparent;
text-decoration: none;
vertical-align: top;
@ -98,31 +94,31 @@ website: http://code.google.com/p/jquerytree/
cursor: auto;
}
.ztree li span.button.chk.checkbox_false_full {
background-image: url("icon/check-box-normal.png");
background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-normal.png");
}
.ztree li span.button.chk.checkbox_false_full_focus {
background-image: url("icon/check-box-normal.png");
background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-normal.png");
}
.ztree li span.button.chk.checkbox_false_part {
background-image: url("icon/half_selected.png");
background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png");
}
.ztree li span.button.chk.checkbox_false_part_focus {
background-image: url("icon/half_selected.png");
background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png");
}
.ztree li span.button.chk.checkbox_false_disable {
background-position: 0 -56px;
}
.ztree li span.button.chk.checkbox_true_full {
background-image: url("icon/check-box-active.png");
background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-active.png");
}
.ztree li span.button.chk.checkbox_true_full_focus {
background-image: url("icon/check-box-active.png");
background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-active.png");
}
.ztree li span.button.chk.checkbox_true_part {
background-image: url("icon/half_selected.png");
background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png");
}
.ztree li span.button.chk.checkbox_true_part_focus {
background-image: url("icon/half_selected.png");
background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png");
}
.ztree li span.button.chk.checkbox_true_disable {
background-position: -14px -56px;
@ -162,28 +158,28 @@ website: http://code.google.com/p/jquerytree/
height: 25px;
}
.ztree li span.button.root_open {
background-image: url("icon/tree-expand-1.png");
background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-1.png");
}
.ztree li span.button.root_close {
background-image: url("icon/tree-collapse-1.png");
background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-1.png");
}
.ztree li span.button.roots_open {
background-image: url("icon/tree-expand-2.png");
background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-2.png");
}
.ztree li span.button.roots_close {
background-image: url("icon/tree-collapse-2.png");
background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-2.png");
}
.ztree li span.button.center_open {
background-image: url("icon/tree-expand-3.png");
background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-3.png");
}
.ztree li span.button.center_close {
background-image: url("icon/tree-collapse-3.png");
background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-3.png");
}
.ztree li span.button.bottom_open {
background-image: url("icon/tree-expand-4.png");
background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-4.png");
}
.ztree li span.button.bottom_close {
background-image: url("icon/tree-collapse-4.png");
background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-4.png");
}
.ztree li span.button.noline_open {
background-position: -92px -72px;
@ -195,13 +191,13 @@ website: http://code.google.com/p/jquerytree/
background: none;
}
.ztree li span.button.roots_docu {
background-image: url("icon/tree-vertical-line-2.png");
background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-2.png");
}
.ztree li span.button.center_docu {
background-image: url("icon/tree-vertical-line-3.png");
background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-3.png");
}
.ztree li span.button.bottom_docu {
background-image: url("icon/tree-vertical-line-4.png");
background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-4.png");
}
.ztree li span.button.noline_docu {
background: none;

34
src/css/base/timeouttoast/widget.timeouttoast.css

@ -0,0 +1,34 @@
/****添加计算宽度的--运算符直接需要space****/
/****** common color(常用颜色,可用于普遍场景) *****/
/**** custom color(自定义颜色,用于特定场景) ****/
.bi-timeout-toast {
font-size: 14px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
background: #fddddd;
color: #e85050;
}
.bi-timeout-toast .cancel-button {
background: #ffffff;
border: 1px solid #d4dadd;
color: #1a1a1a;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
}
.bi-timeout-toast .cancel-button:hover {
opacity: 0.8;
filter: alpha(opacity=80);
}
.bi-timeout-toast .retry-button {
background: #009de3;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
color: #ffffff;
}
.bi-timeout-toast .retry-button:hover {
opacity: 0.8;
filter: alpha(opacity=80);
}

1
src/css/base/view/popupview.css

@ -14,6 +14,7 @@
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
color: #1a1a1a;
background: #ffffff;
}
.bi-list-view .list-view-toolbar {

38
src/css/base/wrapper/flex.center.css

@ -0,0 +1,38 @@
.bi-flex-center-layout {
display: box;
/* OLD - Android 4.4- */
display: -webkit-box;
/* OLD - iOS 6-, Safari 3.1-6 */
display: -moz-box;
/* OLD - Firefox 19- (buggy but mostly works) */
display: -ms-flexbox;
/* TWEENER - IE 10 */
display: -webkit-flex;
/* NEW - Chrome */
display: flex;
/* NEW, Spec - Opera 12.1, Firefox 20+ */
/* 09版 */
-webkit-box-orient: horizontal;
/* 12版 */
-webkit-flex-direction: row;
-moz-flex-direction: row;
-ms-flex-direction: row;
-o-flex-direction: row;
flex-direction: row;
/* 09版 */
-webkit-box-pack: center;
/* 12版 */
-webkit-justify-content: center;
-moz-justify-content: center;
-ms-justify-content: center;
-o-justify-content: center;
justify-content: center;
/* 09版 */
-webkit-box-align: center;
/* 12版 */
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-o-align-items: center;
align-items: center;
}

66
src/css/base/wrapper/flex.horizontal.css

@ -0,0 +1,66 @@
.bi-flex-horizontal-layout {
display: box;
/* OLD - Android 4.4- */
display: -webkit-box;
/* OLD - iOS 6-, Safari 3.1-6 */
display: -moz-box;
/* OLD - Firefox 19- (buggy but mostly works) */
display: -ms-flexbox;
/* TWEENER - IE 10 */
display: -webkit-flex;
/* NEW - Chrome */
display: flex;
/* NEW, Spec - Opera 12.1, Firefox 20+ */
/* 09版 */
-webkit-box-orient: horizontal;
/* 12版 */
-webkit-flex-direction: row;
-moz-flex-direction: row;
-ms-flex-direction: row;
-o-flex-direction: row;
flex-direction: row;
/* 09版 */
-webkit-box-pack: flex-start;
/* 12版 */
-webkit-justify-content: flex-start;
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
-o-justify-content: flex-start;
justify-content: flex-start;
/* 09版 */
-webkit-box-align: flex-start;
/* 12版 */
-webkit-align-items: flex-start;
-moz-align-items: flex-start;
-ms-align-items: flex-start;
-o-align-items: flex-start;
align-items: flex-start;
/* 09版 */
/*-webkit-box-lines: multiple;*/
/* 12版 */
-webkit-flex-wrap: nowrap;
-moz-flex-wrap: nowrap;
-ms-flex-wrap: nowrap;
-o-flex-wrap: nowrap;
flex-wrap: nowrap;
}
.bi-flex-horizontal-layout.middle {
/* 09版 */
-webkit-box-align: center;
/* 12版 */
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-o-align-items: center;
align-items: center;
}
.bi-flex-horizontal-layout.bottom {
/* 09版 */
-webkit-box-align: flex-end;
/* 12版 */
-webkit-align-items: flex-end;
-moz-align-items: flex-end;
-ms-align-items: flex-end;
-o-align-items: flex-end;
align-items: flex-end;
}

46
src/css/base/wrapper/flex.vertical.center.css

@ -0,0 +1,46 @@
.bi-flex-vertical-center {
display: box;
/* OLD - Android 4.4- */
display: -webkit-box;
/* OLD - iOS 6-, Safari 3.1-6 */
display: -moz-box;
/* OLD - Firefox 19- (buggy but mostly works) */
display: -ms-flexbox;
/* TWEENER - IE 10 */
display: -webkit-flex;
/* NEW - Chrome */
display: flex;
/* NEW, Spec - Opera 12.1, Firefox 20+ */
/* 09版 */
-webkit-box-orient: horizontal;
/* 12版 */
-webkit-flex-direction: row;
-moz-flex-direction: row;
-ms-flex-direction: row;
-o-flex-direction: row;
flex-direction: row;
/* 09版 */
-webkit-box-pack: flex-start;
/* 12版 */
-webkit-justify-content: flex-start;
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
-o-justify-content: flex-start;
justify-content: flex-start;
/* 09版 */
-webkit-box-align: center;
/* 12版 */
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-o-align-items: center;
align-items: center;
/* 09版 */
/*-webkit-box-lines: multiple;*/
/* 12版 */
-webkit-flex-wrap: nowrap;
-moz-flex-wrap: nowrap;
-ms-flex-wrap: nowrap;
-o-flex-wrap: nowrap;
flex-wrap: nowrap;
}

41
src/css/base/wrapper/flex.wrapper.center.css

@ -0,0 +1,41 @@
.bi-flex-wrapper-center-layout .flex-wrapper-center-layout-wrapper {
display: box;
/* OLD - Android 4.4- */
display: -webkit-box;
/* OLD - iOS 6-, Safari 3.1-6 */
display: -moz-box;
/* OLD - Firefox 19- (buggy but mostly works) */
display: -ms-flexbox;
/* TWEENER - IE 10 */
display: -webkit-flex;
/* NEW - Chrome */
display: flex;
/* NEW, Spec - Opera 12.1, Firefox 20+ */
/* 09版 */
-webkit-box-orient: horizontal;
/* 12版 */
-webkit-flex-direction: row;
-moz-flex-direction: row;
-ms-flex-direction: row;
-o-flex-direction: row;
flex-direction: row;
/* 09版 */
-webkit-box-pack: center;
/* 12版 */
-webkit-justify-content: center;
-moz-justify-content: center;
-ms-justify-content: center;
-o-justify-content: center;
justify-content: center;
/* 09版 */
-webkit-box-align: center;
/* 12版 */
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-o-align-items: center;
align-items: center;
min-width: 100%;
min-height: 100%;
float: left;
}

67
src/css/base/wrapper/flex.wrapper.horizontal.css

@ -0,0 +1,67 @@
.bi-flex-wrapper-horizontal-layout .flex-wrapper-horizontal-layout-wrapper {
display: box;
/* OLD - Android 4.4- */
display: -webkit-box;
/* OLD - iOS 6-, Safari 3.1-6 */
display: -moz-box;
/* OLD - Firefox 19- (buggy but mostly works) */
display: -ms-flexbox;
/* TWEENER - IE 10 */
display: -webkit-flex;
/* NEW - Chrome */
display: flex;
/* NEW, Spec - Opera 12.1, Firefox 20+ */
/* 09版 */
-webkit-box-orient: horizontal;
/* 12版 */
-webkit-flex-direction: row;
-moz-flex-direction: row;
-ms-flex-direction: row;
-o-flex-direction: row;
flex-direction: row;
/* 09版 */
-webkit-box-pack: flex-start;
/* 12版 */
-webkit-justify-content: flex-start;
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
-o-justify-content: flex-start;
justify-content: flex-start;
/* 09版 */
-webkit-box-align: flex-start;
/* 12版 */
-webkit-align-items: flex-start;
-moz-align-items: flex-start;
-ms-align-items: flex-start;
-o-align-items: flex-start;
align-items: flex-start;
/* 09版 */
/*-webkit-box-lines: multiple;*/
/* 12版 */
-webkit-flex-wrap: nowrap;
-moz-flex-wrap: nowrap;
-ms-flex-wrap: nowrap;
-o-flex-wrap: nowrap;
flex-wrap: nowrap;
min-height: 100%;
}
.bi-flex-wrapper-horizontal-layout .flex-wrapper-horizontal-layout-wrapper.middle {
/* 09版 */
-webkit-box-align: center;
/* 12版 */
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-o-align-items: center;
align-items: center;
}
.bi-flex-wrapper-horizontal-layout .flex-wrapper-horizontal-layout-wrapper.bottom {
/* 09版 */
-webkit-box-align: flex-end;
/* 12版 */
-webkit-align-items: flex-end;
-moz-align-items: flex-end;
-ms-align-items: flex-end;
-o-align-items: flex-end;
align-items: flex-end;
}

48
src/css/base/wrapper/flex.wrapper.vertical.center.css

@ -0,0 +1,48 @@
.bi-flex-wrapper-vertical-center .flex-wrapper-vertical-center-wrapper {
display: box;
/* OLD - Android 4.4- */
display: -webkit-box;
/* OLD - iOS 6-, Safari 3.1-6 */
display: -moz-box;
/* OLD - Firefox 19- (buggy but mostly works) */
display: -ms-flexbox;
/* TWEENER - IE 10 */
display: -webkit-flex;
/* NEW - Chrome */
display: flex;
/* NEW, Spec - Opera 12.1, Firefox 20+ */
/* 09版 */
-webkit-box-orient: horizontal;
/* 12版 */
-webkit-flex-direction: row;
-moz-flex-direction: row;
-ms-flex-direction: row;
-o-flex-direction: row;
flex-direction: row;
/* 09版 */
-webkit-box-pack: flex-start;
/* 12版 */
-webkit-justify-content: flex-start;
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
-o-justify-content: flex-start;
justify-content: flex-start;
/* 09版 */
-webkit-box-align: center;
/* 12版 */
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-o-align-items: center;
align-items: center;
/* 09版 */
/*-webkit-box-lines: multiple;*/
/* 12版 */
-webkit-flex-wrap: nowrap;
-moz-flex-wrap: nowrap;
-ms-flex-wrap: nowrap;
-o-flex-wrap: nowrap;
flex-wrap: nowrap;
min-height: 100%;
float: left;
}

24
src/less/base/base.less

@ -0,0 +1,24 @@
@import "../bibase";
@font-face {
font-family: 'bbr';
src: url('@{webUrl}/resources/fonts/iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('@{webUrl}/resources/fonts/iconfont.woff') format('woff'), /* chrome、firefox */
url('@{webUrl}/resources/fonts/iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/
url('@{webUrl}/resources/fonts/iconfont.svg#svgFontName') format('svg'); /* iOS 4.1- */
}
.b-font {
font-family: "bi";
font-style: normal;
-webkit-font-smoothing: antialiased;
-webkit-text-stroke-width: 0.2px;
-moz-osx-font-smoothing: grayscale;
}
.bi-base-request-fail-mask{
& .mask-pane{
background: @color-bi-background-default;
.opacity(0.8);
}
}

13
src/less/base/chart/chart.combine.less

@ -0,0 +1,13 @@
@import "../../bibase";
.bi-combine-chart {
& .bi-linkage-list {
background-color: @background-color-default;
border: 1px solid @border-color-line;
z-index: @zIndex-tip;
& .bi-linkage-list-item {
&:hover {
background-color: @color-bi-background-gray;
}
}
}
}

16
src/less/base/combo/combo.bubble.less

@ -0,0 +1,16 @@
@import "../../bibase";
.bi-bubble-combo {
& .bubble-combo-triangle-left {
.solid-triangle-right(@color-bi-background-highlight);
}
& .bubble-combo-triangle-right {
.solid-triangle-left(@color-bi-background-highlight);
}
& .bubble-combo-triangle-top {
.solid-triangle-down(@color-bi-background-highlight);
}
& .bubble-combo-triangle-bottom {
.solid-triangle-up(@color-bi-background-highlight);
}
}

8
src/less/base/combo/popup.bubble.less

@ -0,0 +1,8 @@
@import "../../bibase";
.bi-bubble-popup-view {
& .bubble-popup-line {
background-color: @color-bi-background-highlight;
}
.box-shadow(0 0 10px, rgba(0, 0, 0, 0.2));
}

7
src/less/base/dom.less

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

30
src/less/base/logintimeout/login.timeout.less

@ -0,0 +1,30 @@
@import "../../bibase";
.bi-login-timeout-center{
& .input-wrapper{
border-bottom: 1px solid @color-bi-border-line;
& .login-input{
font-size: @font-size-16;
}
& .error-mask{
background: @color-bi-background-black;
.opacity(0.25);
color: @color-bi-text;
font-size: @font-size-16;
}
}
& .login-button{
background: @color-bi-background-highlight;
.border-radius(25px);
font-size: @font-size-22;
color: @color-bi-text;
&:hover{
.opacity(0.8);
}
}
}
.bi-login-timeout-south{
& .keep-state{
font-size: @font-size-14;
color: @color-bi-text-gray;
}
}

5
src/less/base/pager/pager.all.less → src/less/base/pager/pager.all.count.less

@ -1,15 +1,12 @@
@import "../../bibase";
.bi-all-pager {
.bi-all-count-pager {
& .pager-editor {
background-color: @color-bi-background-default;
}
& .all-pager-prev {
font-size: @font-size-16;
background: @color-bi-background-gray;
}
& .all-pager-next {
font-size: @font-size-16;
background: @color-bi-background-gray;
}
}

2
src/less/base/pager/pager.direction.less

@ -3,10 +3,8 @@
.bi-direction-pager {
& .direction-pager-prev {
font-size: @font-size-16;
background: @color-bi-background-gray;
}
& .direction-pager-next {
font-size: @font-size-16;
background: @color-bi-background-gray;
}
}

12
src/less/base/pager/pager.number.less

@ -1,12 +0,0 @@
@import "../../bibase";
.bi-number-pager {
& .number-pager-prev {
font-size: @font-size-16;
background: @color-bi-background-gray;
}
& .number-pager-next {
font-size: @font-size-16;
background: @color-bi-background-gray;
}
}

12
src/less/base/pager/pager.skip.less

@ -1,12 +0,0 @@
@import "../../bibase";
.bi-skip-pager {
& .skip-pager-prev {
font-size: @font-size-16;
background: @color-bi-background-gray;
}
& .skip-pager-next {
font-size: @font-size-16;
background: @color-bi-background-gray;
}
}

19
src/less/base/reqloading/loading.request.less

@ -1,13 +1,20 @@
@import "../../bibase";
.bi-request-loading{
& .mask-pane{
.bi-request-loading {
& .mask-pane {
background: @color-bi-background-default;
.opacity(0.8);
}
& .loading-comment{
font-size: @font-size-14;
& .loading-comment {
font-size: 20px;
color: @color-bi-text-gray;
}
& .load-fail-comment{
font-size: @font-size-14;
& .load-fail-comment {
font-size: 20px;
color: @color-bi-text-gray;
}
& .load-timeout-warning {
font-size: @font-size-16;
color: @color-bi-text-warning;
}
}

4
src/less/base/single/editor/editor.state.less

@ -2,9 +2,7 @@
.bi-state-editor{
font-size: @font-size-12;
& .state-editor-infinite-text{
font-size: @font-size-12;
color: @font-color-normal;
color: @water-mark-color;
}
}

4
src/less/base/single/editor/editor.state.simple.less

@ -2,9 +2,7 @@
.bi-simple-state-editor{
font-size: @font-size-12;
& .state-editor-infinite-text{
font-size: @font-size-12;
color: @font-color-normal;
color: @water-mark-color;
}
}

2
src/less/base/single/text.less

@ -2,5 +2,5 @@
.bi-text{
.overflow-dot();
word-break: break-word;
word-break: break-all;
}

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

@ -7,15 +7,14 @@
transition-timing-function: ease;
user-select: none;
background-color: rgba(0, 0, 0, 0.1);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#19000000, endColorstr=#19000000);
border-radius: 5px;
border-radius:5px;
}
.scrollbar-layout-main-vertical {
bottom: 0;
right: 0;
top: 0;
transition-property: background-color;
transition-property: background-color ;
width: 10px;
}
@ -28,9 +27,8 @@
bottom: 0;
height: 10px;
left: 0;
transition-property: background-color;
transition-property: background-color ;
background-color: rgba(0, 0, 0, 0.1);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#19000000, endColorstr=#19000000);
}
/* Touching the scroll-track directly makes the scroll-track bolder */

1796
src/less/base/third/jquery.mCustomScrollbar.less

File diff suppressed because it is too large Load Diff

BIN
src/less/base/third/ztree/img/line_conn.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 B

BIN
src/less/base/third/ztree/img/loading.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

BIN
src/less/base/third/ztree/img/zTreeStandard.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
src/less/base/third/ztree/img/zTreeStandard.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

46
src/less/base/third/ztree/zTreeStyle.less

@ -8,13 +8,13 @@ website: http://code.google.com/p/jquerytree/
-------------------------------------*/
.ztree * {padding:0; margin:0; font-size:12px; font-family: Verdana, Arial, Helvetica, AppleGothic, sans-serif}
.ztree {margin:0; padding:5px; color:#333}
.ztree * {padding:0; margin:0; }
.ztree {margin:0; padding:5px; }
.ztree li{padding:0; margin:0; list-style:none; line-height:14px; text-align:left; white-space:nowrap; outline:0}
.ztree li ul{ margin:0; padding:0 0 0 18px}
.ztree li ul.line{ background:url(icon/tree-vertical-line-1.png) 0 0 repeat-y;}
.ztree li ul.line{ background:url(${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-1.png) 0 0 repeat-y;}
.ztree li a {padding:1px 3px 0 0; margin:0; cursor:pointer; height:24px; color:#333; background-color: transparent;
.ztree li a {padding:1px 3px 0 0; margin:0; cursor:pointer; height:24px; background-color: transparent;
text-decoration:none; vertical-align:top; display: inline-block}
.ztree li a.curSelectedNode {}
.ztree li a.curSelectedNode_Edit {padding-top:0px; background-color:#FFE6B0; color:black; height:16px; border:1px #FFB951 solid; opacity:0.8;}
@ -32,29 +32,29 @@ website: http://code.google.com/p/jquerytree/
.ztree li span.button.chk {width:16px; height:16px; margin:0 3px 0 0; cursor: auto}
.ztree li span.button.chk.checkbox_false_full {
background-image:url("icon/check-box-normal.png");
background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-normal.png");
}
.ztree li span.button.chk.checkbox_false_full_focus {
background-image:url("icon/check-box-normal.png");
background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-normal.png");
}
.ztree li span.button.chk.checkbox_false_part {
background-image:url("icon/half_selected.png");
background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png");
}
.ztree li span.button.chk.checkbox_false_part_focus {
background-image:url("icon/half_selected.png");
background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png");
}
.ztree li span.button.chk.checkbox_false_disable {background-position:0 -56px}
.ztree li span.button.chk.checkbox_true_full {
background-image:url("icon/check-box-active.png");
background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-active.png");
}
.ztree li span.button.chk.checkbox_true_full_focus {
background-image:url("icon/check-box-active.png");
background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/check-box-active.png");
}
.ztree li span.button.chk.checkbox_true_part {
background-image:url("icon/half_selected.png");
background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png");
}
.ztree li span.button.chk.checkbox_true_part_focus {
background-image:url("icon/half_selected.png");
background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/half_selected.png");
}
.ztree li span.button.chk.checkbox_true_disable {background-position:-14px -56px}
.ztree li span.button.chk.radio_false_full {background-position:-28px 0}
@ -70,40 +70,40 @@ website: http://code.google.com/p/jquerytree/
.ztree li span.button.switch {width:25px; height:25px}
.ztree li span.button.root_open{
background-image:url("icon/tree-expand-1.png");
background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-1.png");
}
.ztree li span.button.root_close{
background-image:url("icon/tree-collapse-1.png");
background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-1.png");
}
.ztree li span.button.roots_open{
background-image:url("icon/tree-expand-2.png");
background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-2.png");
}
.ztree li span.button.roots_close{
background-image:url("icon/tree-collapse-2.png");
background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-2.png");
}
.ztree li span.button.center_open{
background-image:url("icon/tree-expand-3.png");
background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-3.png");
}
.ztree li span.button.center_close{
background-image:url("icon/tree-collapse-3.png");
background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-3.png");
}
.ztree li span.button.bottom_open{
background-image:url("icon/tree-expand-4.png");
background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-expand-4.png");
}
.ztree li span.button.bottom_close{
background-image:url("icon/tree-collapse-4.png");
background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-collapse-4.png");
}
.ztree li span.button.noline_open{background-position:-92px -72px}
.ztree li span.button.noline_close{background-position:-74px -72px}
.ztree li span.button.root_docu{ background:none;}
.ztree li span.button.roots_docu{
background-image:url("icon/tree-vertical-line-2.png");
background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-2.png");
}
.ztree li span.button.center_docu{
background-image:url("icon/tree-vertical-line-3.png");
background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-3.png");
}
.ztree li span.button.bottom_docu{
background-image:url("icon/tree-vertical-line-4.png");
background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-4.png");
}
.ztree li span.button.noline_docu{ background:none;}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save