Browse Source

Merge branch 'master' of ssh://cloud.finedevelop.com:7999/~nieshichao/fineui

es6
NieShichao 7 years ago
parent
commit
1b45050f0b
  1. 157
      .eslintrc
  2. 14
      Gruntfile.js
  3. 12
      bi/base.css
  4. 165
      bi/base.js
  5. 281
      bi/case.js
  6. 126
      bi/core.js
  7. 2536
      bi/widget.js
  8. 2
      demo/app.js
  9. 3004
      demo/config.js
  10. 132
      demo/js/base/button/demo.button.js
  11. 4
      demo/js/base/button/demo.icon_button.js
  12. 4
      demo/js/base/button/demo.image_button.js
  13. 6
      demo/js/base/button/demo.text_button.js
  14. 8
      demo/js/base/demo.canvas.js
  15. 2
      demo/js/base/demo.label.js
  16. 16
      demo/js/base/demo.message.js
  17. 2
      demo/js/base/demo.pager.js
  18. 2
      demo/js/base/demo.svg.js
  19. 2
      demo/js/base/editor/demo.code_editor.js
  20. 2
      demo/js/base/editor/demo.editor.js
  21. 10
      demo/js/base/editor/demo.formula_editor.js
  22. 2
      demo/js/base/editor/demo.multifile_editor.js
  23. 6
      demo/js/base/editor/demo.rich_editor.js
  24. 2
      demo/js/base/editor/demo.textarea_editor.js
  25. 6
      demo/js/base/table/demo.collection_table.js
  26. 6
      demo/js/base/table/demo.grid_table.js
  27. 6
      demo/js/base/table/demo.resizable_table.js
  28. 6
      demo/js/base/table/demo.table_view.js
  29. 14
      demo/js/base/tip/demo.bubble.js
  30. 2
      demo/js/base/tip/demo.title.js
  31. 42
      demo/js/base/tip/demo.toast.js
  32. 22
      demo/js/base/tree/demo.tree_view.js
  33. 6
      demo/js/case/combo/demo.bubble_combo.js
  34. 10
      demo/js/case/combo/demo.editor_icon_check_combo.js
  35. 8
      demo/js/case/combo/demo.icon_combo.js
  36. 35
      demo/js/case/combo/demo.icon_text_value_combo.js
  37. 4
      demo/js/case/combo/demo.static_combo.js
  38. 9
      demo/js/case/combo/demo.text_value_combo.js
  39. 4
      demo/js/case/combo/demo.text_value_down_list_combo.js
  40. 4
      demo/js/case/combo/demo.text_vlaue_check_combo.js
  41. 4
      demo/js/case/demo.calendar.js
  42. 6
      demo/js/case/demo.clipboard.js
  43. 2
      demo/js/case/demo.color_chooser.js
  44. 2
      demo/js/case/demo.color_chooser_popup.js
  45. 2
      demo/js/case/demo.complex_canvas.js
  46. 2
      demo/js/case/demo.segment.js
  47. 4
      demo/js/case/editor/demo.clear_editor.js
  48. 8
      demo/js/case/editor/demo.shelter_editor.js
  49. 6
      demo/js/case/editor/demo.sign_editor.js
  50. 6
      demo/js/case/editor/demo.sign_initial_editor.js
  51. 6
      demo/js/case/editor/demo.simple_state_editor.js
  52. 6
      demo/js/case/editor/demo.state_editor.js
  53. 2
      demo/js/case/item/demo.multi_select_item.js
  54. 2
      demo/js/case/item/demo.single_select_item.js
  55. 2
      demo/js/case/item/demo.single_select_radio_item.js
  56. 2
      demo/js/case/list/demo.lazy_loader.js
  57. 2
      demo/js/case/list/demo.select_list.js
  58. 2
      demo/js/case/pager/demo.all_count_pager.js
  59. 2
      demo/js/case/pager/demo.direction_pager.js
  60. 6
      demo/js/case/pane/demo.list_pane.js
  61. 2
      demo/js/case/pane/demo.multi_popup_view.js
  62. 2
      demo/js/case/pane/demo.panel.js
  63. 2
      demo/js/case/pane/demo.popup_panel.js
  64. 2
      demo/js/case/table/demo.adaptive_table.js
  65. 2
      demo/js/case/table/demo.layer_tree_table.js
  66. 2
      demo/js/case/table/demo.tree_table.js
  67. 2
      demo/js/case/tree/demo.branch_relation.js
  68. 6
      demo/js/case/tree/demo.branch_tree.js
  69. 2
      demo/js/case/tree/demo.handstand_branch_tree.js
  70. 4
      demo/js/case/tree/demo.level_tree.js
  71. 6
      demo/js/case/tree/demo.simple_tree.js
  72. 2
      demo/js/case/triggers/demo.editor_trigger.js
  73. 2
      demo/js/case/triggers/demo.icon_trigger.js
  74. 2
      demo/js/case/triggers/demo.select_text_trigger.js
  75. 2
      demo/js/case/triggers/demo.text_trigger.js
  76. 84
      demo/js/category/customATree/demo.multilayerselecttree.leveltree.js
  77. 6
      demo/js/category/largeTable/cell.js
  78. 4
      demo/js/category/largeTable/header.js
  79. 6
      demo/js/category/largeTable/largeTable.js
  80. 2
      demo/js/category/largeTable/sequenceheadercell.normal.js
  81. 4
      demo/js/category/largeTable/table.js
  82. 18
      demo/js/category/sortTree/demo.sortTree.js
  83. 2
      demo/js/center.js
  84. 48
      demo/js/chart/demo.axis_chart.js
  85. 4
      demo/js/config/case.js
  86. 4
      demo/js/config/core.js
  87. 35
      demo/js/config/fix.js
  88. 14
      demo/js/config/widget.js
  89. 18
      demo/js/core/abstract/combination/demo.combo.js
  90. 16
      demo/js/core/abstract/combination/demo.combo2.js
  91. 4
      demo/js/core/abstract/combination/demo.combo_group.js
  92. 2
      demo/js/core/abstract/combination/demo.expander.js
  93. 6
      demo/js/core/abstract/combination/demo.loader.js
  94. 4
      demo/js/core/abstract/combination/demo.navigation.js
  95. 4
      demo/js/core/abstract/combination/demo.sercher.js
  96. 2
      demo/js/core/abstract/combination/demo.switcher.js
  97. 6
      demo/js/core/abstract/combination/demo.tab.js
  98. 4
      demo/js/core/abstract/demo.button_group.js
  99. 2
      demo/js/core/abstract/demo.button_tree.js
  100. 4
      demo/js/core/abstract/demo.collection_view.js
  101. Some files were not shown because too many files have changed in this diff Show More

157
.eslintrc

@ -0,0 +1,157 @@
{
"extends": "eslint:recommended",
"rules": {
// 声明
"no-use-before-define": "error",
//禁止定义前使用
// 对象
"no-dupe-keys": "error",
// 禁止在对象字面量中出现重复的键
"quote-props": [
"error",
"as-needed"
],
// 对象属性只在需要的时候加引号
// 字符串
"quotes": [
"error",
"double",
{
"allowTemplateLiterals": true
}
],
// 字符串开头和结束使用双引号
"no-useless-concat": "error",
// 禁止没有必要的字符拼接
"no-useless-escape": "error",
// 禁用不必要的转义
// 函数
"no-dupe-args": "error",
// 禁止在 function 定义中出现重复的参数
"space-before-function-paren": "error",
// 函数括号前必须要有空格
// 变量
"no-undef": "error",
// 禁止使用未声明的变量
// 比较运算符 & 相等运算符
"eqeqeq": "error",
// 使用 === 和 !== 代替 == 和 !=
"no-unneeded-ternary": "error",
//禁止可以在有更简单的可替代的表达式时使用三元操作符
// 条件
"default-case": "error",
// 要求 Switch 语句中有 Default 分支
"no-else-return": "error",
// 如果 if 块中包含了一个 return 语句,else 块就成了多余的了。可以将其内容移至块外
// 代码块
"brace-style": [
"error",
"1tbs",
{
"allowSingleLine": true
}
],
// 代码块左括号紧跟上一行结束
"curly": [
"error",
"multi-line"
],
// if、else if、else、for、while强制使用大括号,但允许在单行中省略大括号
// 注释
"spaced-comment": "error",
// 注释前有空格
// 空白
"indent": [
"error",
4,
{
"SwitchCase": 1
}
],
// 缩进控制4空格
"no-mixed-spaces-and-tabs": "error",
// 禁止使用 空格 和 tab 混合缩进
"space-before-blocks": [
"error",
"always"
],
// 语句块之前的需要有空格
"space-infix-ops": ["error", {
"int32Hint": false
}], // 要求中缀操作符周围有空格,设置 int32Hint 选项为 true (默认 false) 允许 a|0 不带空格
"no-trailing-spaces": ["error", {
"skipBlankLines": true
}], // 禁用行尾空格
"key-spacing": ["error", {
"afterColon": true
}], // 要求在对象字面量的冒号和值之间存在至少有一个空格
// 逗号
"comma-style": "error",
// 逗号必须放在行末
"comma-dangle": [
"error",
"never"
],
// 多行对象字面量中要求不要拖尾逗号
"comma-spacing": [
"error",
{
"before": false,
"after": true
}
],
//在变量声明、数组字面量、对象字面量、函数参数 和 序列中禁止在逗号前使用空格,要求在逗号后使用一个或多个空格
// 分号
"semi": "error",
//不得省略语句结束的分号
"semi-spacing": [
"error",
{
"before": false,
"after": true
}
],
//禁止分号周围的空格
"no-extra-semi": "error",
// 禁用不必要的分号
// 类型转换
"no-extra-boolean-cast": "error",
// 禁止不必要的布尔类型转换
// 其他最佳实践或规范
"no-unexpected-multiline": "error",
// 禁止使用令人困惑的多行表达式
"no-unreachable": "error",
// 禁止在 return、throw、continue 和 break 语句后出现不可达代码
"valid-typeof": "error",
// 强制 typeof 表达式与有效的字符串进行比较
"no-new-wrappers": "error"
// 禁止通过 new 操作符使用 String、Number 和 Boolean
},
"globals": {
"window": true,
"$": true,
"WebUI": true,
"BI": true,
"BICst": true,
"Data": true,
"Fix": true,
"module": true
}
}

14
Gruntfile.js

@ -90,6 +90,10 @@ module.exports = function (grunt) {
src: ['src/css/core/**/*.css', 'src/css/theme/**/*.css'],
dest: 'dist/core.css'
},
coreWithoutNormalizeCss: {
src: ['src/css/core/**/*.css', 'src/css/theme/**/*.css', '!src/css/core/normalize.css','!src/css/core/normalize2.css'],
dest: 'dist/core_without_normalize.css'
},
baseCss: {
src: ['src/css/base/**/*.css'],
dest: 'dist/base.css'
@ -103,11 +107,21 @@ module.exports = function (grunt) {
dest: 'dist/resource.css'
},
publicBundleJs: {
src: ['public/js/**/*.js', 'public/js/index.js'],
dest: 'public/bundle.js'
},
bundleJs: {
src: ['dist/core.js', 'dist/base.js', 'dist/case.js', 'dist/widget.js', 'dist/router.js', 'public/js/**/*.js', 'public/js/index.js'],
dest: 'dist/bundle.js'
},
publicBundleCss: {
src: ['public/css/app.css', 'public/css/**/*.css'],
dest: 'public/bundle.css'
},
bundleCss: {
src: ['dist/core.css', 'dist/base.css', 'dist/widget.css', 'public/css/app.css', 'public/css/**/*.css'],
dest: 'dist/bundle.css'

12
bi/base.css

@ -2,9 +2,9 @@
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
box-shadow: 0px 0px 2px 1px #232e40 inset;
-webkit-box-shadow: 0px 0px 2px 1px #232e40 inset;
-moz-box-shadow: 0px 0px 2px 1px #232e40 inset;
box-shadow: 0px 0px 2px 1px #d4dadd inset;
-webkit-box-shadow: 0px 0px 2px 1px #d4dadd inset;
-moz-box-shadow: 0px 0px 2px 1px #d4dadd inset;
}
.bi-color-picker-button .color-picker-button-mask {
border: 1px solid #1a1a1a;
@ -16,9 +16,9 @@
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
box-shadow: 0px 0px 2px 1px #232e40 inset;
-webkit-box-shadow: 0px 0px 2px 1px #232e40 inset;
-moz-box-shadow: 0px 0px 2px 1px #232e40 inset;
box-shadow: 0px 0px 2px 1px #d4dadd inset;
-webkit-box-shadow: 0px 0px 2px 1px #d4dadd inset;
-moz-box-shadow: 0px 0px 2px 1px #d4dadd inset;
}
.farbtastic {
position: relative;

165
bi/base.js

@ -581,7 +581,7 @@ BI.Text = BI.inherit(BI.Single, {
setText: function (text) {
BI.Text.superclass.setText.apply(this, arguments);
this.options.text = text;
this.text.element.html((text + "").replaceAll(" ", " "));
this.text.element.html(BI.Func.formatSpecialCharInHtml(text));
}
});
@ -2023,13 +2023,13 @@ BI.shortcut("bi.tree_view", BI.TreeView);/**
*/
BI.AsyncTree = BI.inherit(BI.TreeView, {
_defaultConfig: function () {
return BI.extend(BI.AsyncTree.superclass._defaultConfig.apply(this, arguments), {})
return BI.extend(BI.AsyncTree.superclass._defaultConfig.apply(this, arguments), {});
},
_init: function () {
BI.AsyncTree.superclass._init.apply(this, arguments);
},
//配置属性
// 配置属性
_configSetting: function () {
var paras = this.options.paras;
var self = this;
@ -2066,23 +2066,23 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
}
};
function onClick(event, treeId, treeNode) {
function onClick (event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj(treeId);
zTree.checkNode(treeNode, !treeNode.checked, true, true);
}
function beforeCheck(treeId, treeNode) {
function beforeCheck (treeId, treeNode) {
treeNode.halfCheck = false;
if (treeNode.checked === true) {
//将展开的节点halfCheck设为false,解决展开节点存在halfCheck=true的情况 guy
//所有的半选状态都需要取消halfCheck=true的情况
function track(children) {
// 将展开的节点halfCheck设为false,解决展开节点存在halfCheck=true的情况 guy
// 所有的半选状态都需要取消halfCheck=true的情况
function track (children) {
BI.each(children, function (i, ch) {
if (ch.halfCheck === true) {
ch.halfCheck = false;
track(ch.children);
}
})
});
}
track(treeNode.children);
@ -2091,23 +2091,23 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
var nodes = treeObj.getSelectedNodes();
BI.each(nodes, function (index, node) {
node.halfCheck = false;
})
});
}
}
function beforeExpand(treeId, treeNode) {
function beforeExpand (treeId, treeNode) {
self._beforeExpandNode(treeId, treeNode);
}
function onCheck(event, treeId, treeNode) {
function onCheck (event, treeId, treeNode) {
self._selectTreeNode(treeId, treeNode);
}
function onExpand(event, treeId, treeNode) {
function onExpand (event, treeId, treeNode) {
treeNode.halfCheck = false;
}
function onCollapse(event, treeId, treeNode) {
function onCollapse (event, treeId, treeNode) {
treeNode.halfCheck = false;
}
@ -2118,7 +2118,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
var self = this, o = this.options;
var parentValues = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode));
var name = this._getNodeValue(treeNode);
// var values = parentValues.concat([name]);
// var values = parentValues.concat([name]);
if (treeNode.checked === true) {
} else {
var tNode = treeNode;
@ -2139,7 +2139,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
BI.AsyncTree.superclass._selectTreeNode.apply(self, arguments);
},
//展开节点
// 展开节点
_beforeExpandNode: function (treeId, treeNode) {
var self = this, o = this.options;
var parentValues = treeNode.parentValues || self._getParentValues(treeNode);
@ -2157,7 +2157,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
};
var times = 1;
function callback(nodes, hasNext) {
function callback (nodes, hasNext) {
self.nodes.addNodes(treeNode, nodes);
if (hasNext === true) {
@ -2170,7 +2170,9 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
}
if (!treeNode.children) {
o.itemsCreator(op, complete)
setTimeout(function () {
o.itemsCreator(op, complete);
}, 17);
}
},
@ -2179,7 +2181,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
var map = {};
track([], valueA, valueB);
track([], valueB, valueA);
function track(parent, node, compare) {
function track (parent, node, compare) {
BI.each(node, function (n, item) {
if (BI.isNull(compare[n])) {
self._addTreeNode(map, parent, n, item);
@ -2188,7 +2190,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
} else {
track(parent.concat([n]), node[n], compare[n]);
}
})
});
}
return map;
@ -2212,7 +2214,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
return this._join(checkedValues, this.options.paras.selectedValues);
},
//生成树方法
// 生成树方法
stroke: function (config) {
delete this.options.keyword;
BI.extend(this.options.paras, config);
@ -3035,6 +3037,7 @@ BI.Combo = BI.inherit(BI.Widget, {
}
});
self.element.on("mouseleave." + self.getName(), function (e) {
if (self.popupView) {
self.popupView.element.on("mouseenter." + self.getName(), function (e) {
enterPopup = true;
self.popupView.element.on("mouseleave." + self.getName(), function (e) {
@ -3047,6 +3050,7 @@ BI.Combo = BI.inherit(BI.Widget, {
hide();
}
}, 50);
}
});
break;
case "click":
@ -3092,6 +3096,7 @@ BI.Combo = BI.inherit(BI.Widget, {
st(e);
});
self.element.on("mouseleave." + self.getName(), function (e) {
if (self.popupView) {
self.popupView.element.on("mouseenter." + self.getName(), function (e) {
enterPopup = true;
self.popupView.element.on("mouseleave." + self.getName(), function (e) {
@ -3104,6 +3109,7 @@ BI.Combo = BI.inherit(BI.Widget, {
hide();
}
}, 50);
}
});
break;
}
@ -14357,7 +14363,9 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
textWrapping: true,
lineWrapping: true,
lineNumbers: false,
mode: 'formula'
mode: 'formula',
//解决插入字段由括号或其他特殊字符包围时分裂的bug
specialChars: /[\u0000-\u001f\u007f\u00ad\u200c-\u200f\u2028\u2029\ufeff]/
});
o.lineHeight === 1 ? this.element.addClass("codemirror-low-line-height") : this.element.addClass("codemirror-high-line-height");
this.editor.on("change", function (cm, change) {
@ -14448,7 +14456,8 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
*/
insertField: function (field) {
var from = this.editor.getCursor();
this.editor.replaceSelection(field);
//解决插入字段由括号或其他特殊字符包围时分裂的bug,在两端以不可见字符包裹一下
this.editor.replaceSelection('\u200b' + field + '\u200b');
var to = this.editor.getCursor();
this.editor.markText(from, to, {className: 'fieldName', atomic: true, startStyle: "start", endStyle: "end"});
this.editor.replaceSelection(" ");
@ -14499,7 +14508,8 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
_.forEach(line.markedSpans, function (i, ms) {
switch (i.marker.className) {
case "fieldName":
var dId = fieldMap[value.substr(i.from, i.to - i.from)];
//因为插入字段的时候首尾加了不可见字符,所以首尾缩进一个字符
var dId = fieldMap[value.substr(i.from + 1, i.to - i.from - 2)];
if (!fields.contains(dId)) {
fields.push(dId);
}
@ -14538,8 +14548,10 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
switch (i.marker.className) {
case "fieldName":
var fieldNameLength = i.to - i.from;
var fieldId = fieldMap[value.substr(i.from + num, fieldNameLength)];
value = value.substr(0, i.from + num) + "$\{" + fieldMap[value.substr(i.from + num, fieldNameLength)] + "\}" + value.substr(i.to + num, value.length);
var start = i.from + num + 1;
var end = fieldNameLength - 2;
var fieldId = fieldMap[value.substr(start, end)];
value = value.substr(0, i.from + num) + "$\{" + fieldId + "\}" + value.substr(i.to + num, value.length);
num += fieldId.length - fieldNameLength + 3;
break;
}
@ -15669,7 +15681,7 @@ BI.ListView = BI.inherit(BI.Widget, {
if (items && this.options.items !== items) {
this.restore();
}
this._populate();
this._populate(items);
},
destroyed: function () {
@ -16181,10 +16193,6 @@ BI.shortcut("bi.a", BI.A);/**
* @type {*|void|Object}
*/
BI.LoadingBar = BI.inherit(BI.Single, {
consts: {
loadedText: BI.i18nText("BI-Load_More"),
endText: BI.i18nText("BI-No_More_Data")
},
_defaultConfig: function() {
var conf = BI.LoadingBar.superclass._defaultConfig.apply(this, arguments);
return BI.extend( conf, {
@ -16199,7 +16207,7 @@ BI.LoadingBar = BI.inherit(BI.Single, {
this.loaded = BI.createWidget({
type: "bi.text_button",
cls: "loading-text bi-list-item-simple",
text: this.consts.loadedText,
text: BI.i18nText("BI-Load_More"),
width: 120,
handler: this.options.handler
})
@ -16237,7 +16245,7 @@ BI.LoadingBar = BI.inherit(BI.Single, {
_reset: function(){
this.visible();
this.loaded.setText(this.consts.loadedText);
this.loaded.setText(BI.i18nText("BI-Load_More"));
this.loaded.enable();
},
@ -16248,7 +16256,7 @@ BI.LoadingBar = BI.inherit(BI.Single, {
setEnd: function(){
this.setLoaded();
this.loaded.setText(this.consts.endText);
this.loaded.setText(BI.i18nText("BI-No_More_Data"));
this.loaded.disable();
},
@ -18809,7 +18817,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
e.stopPropagation ? e.stopPropagation() : e.cancelBubble = true;
e.preventDefault ? e.preventDefault() : e.returnValue = false;
}
;
return false;
}
};
@ -18818,7 +18826,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
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=\"", BI.cjkEncode(file.fileName), "\"", CRLF,
"Content-Type: application/octet-stream", CRLF,
CRLF,
file.getAsBinary(), CRLF,
@ -18847,7 +18855,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
xhr = new XMLHttpRequest,
upload = xhr.upload || {
addEventListener: function (event, callback) {
this["on" + event] = callback
this["on" + event] = callback;
}
},
i = 0;
@ -18887,7 +18895,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
},
false
);
xhr.open("post", handler.url + '&filename=' + window.encodeURIComponent(handler.file.fileName), true);
xhr.open("post", handler.url + "&filename=" + window.encodeURIComponent(handler.file.fileName), true);
if (!xhr.upload) {
var rpe = {loaded: 0, total: handler.file.fileSize || handler.file.size, simulation: true};
rpe.interval = setInterval(function () {
@ -18907,8 +18915,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
switch (xhr.readyState) {
case 2:
case 3:
if (rpe.total <= rpe.loaded)
rpe.loaded = rpe.total;
if (rpe.total <= rpe.loaded) {rpe.loaded = rpe.total;}
upload.onprogress(rpe);
break;
case 4:
@ -18920,7 +18927,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
upload["onload"]({});
var attachO = BI.jsonDecode(xhr.responseText);
attachO.filename = handler.file.fileName;
if (handler.file.type.indexOf('image') != -1) {
if (handler.file.type.indexOf("image") != -1) {
attachO.attach_type = "image";
}
handler.attach_array.push(attachO);
@ -18936,7 +18943,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
switch (xhr.readyState) {
case 4:
var attachO = BI.jsonDecode(xhr.responseText);
if (handler.file.type.indexOf('image') != -1) {
if (handler.file.type.indexOf("image") != -1) {
attachO.attach_type = "image";
}
attachO.filename = handler.file.fileName;
@ -18948,7 +18955,8 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
}
break;
}
}
};
upload.onloadstart();
}
var boundary = "AjaxUploadBoundary" + (new Date).getTime();
xhr.setRequestHeader("Content-Type", "multipart/form-data; boundary=" + boundary);
@ -18956,8 +18964,8 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
xhr[xhr.sendAsBinary ? "sendAsBinary" : "send"](multipart(boundary, handler.name, handler.file));
} else {
xhr.setRequestHeader("Content-Type", "multipart/form-data");
// xhr.setRequestHeader("X-Name", handler.name);
// xhr.setRequestHeader("X-File-Name", handler.file.fileName);
// xhr.setRequestHeader("X-Name", handler.name);
// xhr.setRequestHeader("X-File-Name", handler.file.fileName);
var form = new FormData();
form.append("FileData", handler.file);
xhr.send(form);
@ -18971,10 +18979,8 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
var url = handler.url.concat(-1 === handler.url.indexOf("?") ? "?" : "&", "AjaxUploadFrame=true"),
rpe = {
loaded: 1, total: 100, simulation: true, interval: setInterval(function () {
if (rpe.loaded < rpe.total)
++rpe.loaded;
if (isFunction(handler.onprogress))
handler.onprogress(rpe, {});
if (rpe.loaded < rpe.total) {++rpe.loaded;}
if (isFunction(handler.onprogress)) {handler.onprogress(rpe, {});}
}, 100)
},
onload = function () {
@ -18982,15 +18988,15 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
form.parentNode.removeChild(form);
form = null;
clearInterval(rpe.interval);
//rpe.loaded = rpe.total;
// rpe.loaded = rpe.total;
try {
var responseText = (iframe.contentWindow.document || iframe.contentWindow.contentDocument).body.innerHTML;
var attachO = BI.jsonDecode(responseText);
if (handler.file.type.indexOf('image') != -1) {
if (handler.file.type.indexOf("image") != -1) {
attachO.attach_type = "image";
}
//attachO.fileSize = responseText.length;
// attachO.fileSize = responseText.length;
attachO.filename = BI.cjkDecode(handler.file.fileName);
if (handler.maxlength == 1) {
handler.attach_array[0] = attachO;
@ -18998,18 +19004,16 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
handler.attach_array.push(attachO);
}
} catch (e) {
if (isFunction(handler.onerror))
handler.onerror(rpe, event || window.event);
if (isFunction(handler.onerror)) {handler.onerror(rpe, event || window.event);}
}
if (isFunction(handler.onload))
handler.onload(rpe, {responseText: responseText});
if (isFunction(handler.onload)) {handler.onload(rpe, {responseText: responseText});}
},
target = ["AjaxUpload", (new Date).getTime(), String(Math.random()).substring(2)].join("_");
try { // IE < 8 does not accept enctype attribute ...
var form = document.createElement('<form enctype="multipart/form-data"></form>'),
iframe = handler.iframe || (handler.iframe = document.createElement('<iframe id="' + target + '" name="' + target + '" src="' + url + '"></iframe>'));
var form = document.createElement("<form enctype=\"multipart/form-data\"></form>"),
iframe = handler.iframe || (handler.iframe = document.createElement("<iframe id=\"" + target + "\" name=\"" + target + "\" src=\"" + url + "\"></iframe>"));
} catch (e) {
var form = document.createElement('form'),
var form = document.createElement("form"),
iframe = handler.iframe || (handler.iframe = document.createElement("iframe"));
form.setAttribute("enctype", "multipart/form-data");
iframe.setAttribute("name", iframe.id = target);
@ -19027,9 +19031,8 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
if (/loaded|complete/i.test(iframe.readyState)) {
onload();
//wei : todo,将附件信息放到handler.attach
}
else if (isFunction(handler.onloadprogress)) {
// wei : todo,将附件信息放到handler.attach
} else if (isFunction(handler.onloadprogress)) {
if (rpe.loaded < rpe.total) {
++rpe.loaded;
}
@ -19056,7 +19059,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
appendChild(form);
form.submit();
}
;
return handler;
};
}
@ -19132,9 +19135,9 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
name: "",
url: "",
multiple: true,
accept: "", /**'*.jpg; *.zip'**/
maxSize: -1 //1024 * 1024
})
accept: "", /** '*.jpg; *.zip'**/
maxSize: -1 // 1024 * 1024
});
},
_init: function () {
@ -19144,24 +19147,26 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
this.element.attr("multiple", "multiple");
}
this.element.attr("name", o.name || this.getName());
},
BI.nextTick(function () {
mounted: function () {
var self = this, o = this.options;
// create the noswfupload.wrap Object
// wrap.maxSize 文件大小限制
// wrap.maxlength 文件个数限制
var _wrap = self.wrap = self._wrap(self.element[0], o.maxSize);
var _wrap = this.wrap = this._wrap(this.element[0], o.maxSize);
// fileType could contain whatever text but filter checks *.{extension}
// if present
// handlers
_wrap.onloadstart = function (rpe, xhr) {
//BI.Msg.toast("loadstart");
self.fireEvent(BI.File.EVENT_UPLOADSTART);
// BI.Msg.toast("loadstart");
self.fireEvent(BI.File.EVENT_UPLOADSTART, arguments);
};
_wrap.onprogress = function (rpe, xhr) {
//BI.Msg.toast("onprogress");
// BI.Msg.toast("onprogress");
// percent for each bar
// fileSize is -1 only if browser does not support file info access
@ -19203,18 +19208,17 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
self_.clean(); // remove files from list
self_.hide(); // hide progress bars and enable input file
//BI.Msg.toast("onload");
// BI.Msg.toast("onload");
self.fireEvent(BI.File.EVENT_UPLOADED);
// enable again the submit button/element
}, 1000);
};
_wrap.url = o.url ? o.url : BI.servletURL
+ '?op=fr_attach&cmd=ah_upload';
_wrap.fileType = o.accept; //文件类型限制
+ "?op=fr_attach&cmd=ah_upload";
_wrap.fileType = o.accept; // 文件类型限制
_wrap.attach_array = [];
_wrap.attach_names = [];
_wrap.attachNum = 0;
});
},
_events: function (wrap) {
@ -19228,14 +19232,14 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
ext = -1 !== value.indexOf(".") ? value.split(".").pop().toLowerCase() : "unknown",
size = item.fileSize || item.size;
if (wrap.fileType && -1 === wrap.fileType.indexOf("*." + ext)) {
//文件类型不支持
// 文件类型不支持
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.i18nText("BI-Upload_File_Size_Error"));
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 1,
@ -19243,7 +19247,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
});
} else {
wrap.files.unshift(item);
//BI.Msg.toast(value);
// BI.Msg.toast(value);
self.fireEvent(BI.File.EVENT_CHANGE, {
file: item
});
@ -30511,6 +30515,11 @@ BI.QuickGridTable = BI.inherit(BI.GridTable, {
this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.bottomRightGrid.setEstimatedRowSize(o.rowSize);
this.topLeftGrid.setColumnCount(freezeColLength);
this.topRightGrid.setColumnCount(o.columnSize.length - freezeColLength);
this.bottomLeftGrid.setColumnCount(freezeColLength);
this.bottomRightGrid.setColumnCount(o.columnSize.length - freezeColLength);
var items = this.contextLayout.attr("items");
items[1].left = regionSize;
items[2].top = this._getFreezeHeaderHeight();

281
bi/case.js

@ -344,9 +344,6 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, {
type: "bi.radio"
});
this.radio.on(BI.Controller.EVENT_CHANGE, function (type) {
if (type === BI.Events.CLICK) {
self.setSelected(!self.isSelected());
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.text = BI.createWidget({
@ -1643,7 +1640,7 @@ BI.Calendar = BI.inherit(BI.Widget, {
},
_dateCreator: function (Y, M, D) {
var self = this, o = this.options, log = {}, De = new Date();
var self = this, o = this.options, log = {}, De = Date.getDate();
var mins = o.min.match(/\d+/g);
var maxs = o.max.match(/\d+/g);
Y < (mins[0] | 0) && (Y = (mins[0] | 0));
@ -1753,7 +1750,7 @@ BI.Calendar = BI.inherit(BI.Widget, {
isFrontDate: function () {
var o = this.options, c = this._const;
var Y = o.year, M = o.month, De = new Date(), day = De.getDay();
var Y = o.year, M = o.month, De = Date.getDate(), day = De.getDay();
Y = Y | 0;
De.setFullYear(Y, M, 1);
var newDate = De.getOffsetDate(-1 * (day + 1));
@ -1762,7 +1759,7 @@ BI.Calendar = BI.inherit(BI.Widget, {
isFinalDate: function () {
var o = this.options, c = this._const;
var Y = o.year, M = o.month, De = new Date(), day = De.getDay();
var Y = o.year, M = o.month, De = Date.getDate(), day = De.getDay();
Y = Y | 0;
De.setFullYear(Y, M, 1);
var newDate = De.getOffsetDate(42 - day);
@ -1785,14 +1782,14 @@ BI.Calendar = BI.inherit(BI.Widget, {
BI.extend(BI.Calendar, {
getPageByDateJSON: function (json) {
var year = new Date().getFullYear();
var month = new Date().getMonth();
var year = Date.getDate().getFullYear();
var month = Date.getDate().getMonth();
var page = (json.year - year) * 12;
page += json.month - month;
return page;
},
getDateJSONByPage: function(v){
var months = new Date().getMonth();
var months = Date.getDate().getMonth();
var page = v;
//对当前page做偏移,使到当前年初
@ -1804,7 +1801,7 @@ BI.extend(BI.Calendar, {
}
var month = page >= 0 ? (page % 12) : ((12 + page % 12) % 12);
return {
year: new Date().getFullYear() + year,
year: Date.getDate().getFullYear() + year,
month: month
}
}
@ -1850,7 +1847,7 @@ BI.YearCalendar = BI.inherit(BI.Widget, {
_init: function () {
BI.YearCalendar.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.currentYear = new Date().getFullYear();
this.currentYear = Date.getDate().getFullYear();
var years = this._yearCreator(o.year || this.currentYear);
//纵向排列年
@ -1937,7 +1934,7 @@ BI.extend(BI.YearCalendar, {
//获取显示的第一年
getStartYear: function (year) {
var cur = new Date().getFullYear();
var cur = Date.getDate().getFullYear();
return year - ((year - cur + 3) % BI.YearCalendar.INTERVAL + 12) % BI.YearCalendar.INTERVAL;
},
@ -1946,7 +1943,7 @@ BI.extend(BI.YearCalendar, {
},
getPageByYear: function (year) {
var cur = new Date().getFullYear();
var cur = Date.getDate().getFullYear();
year = BI.YearCalendar.getStartYear(year);
return (year - cur + 3) / BI.YearCalendar.INTERVAL;
}
@ -3607,8 +3604,7 @@ BI.CustomColorChooser = BI.inherit(BI.Widget, {
BI.CustomColorChooser.superclass._init.apply(this, arguments);
var self = this;
this.editor = BI.createWidget({
type: "bi.color_picker_editor",
width: 195
type: "bi.color_picker_editor"
});
this.editor.on(BI.ColorPickerEditor.EVENT_CHANGE, function () {
self.setValue(this.getValue());
@ -3627,9 +3623,9 @@ BI.CustomColorChooser = BI.inherit(BI.Widget, {
type: "bi.absolute",
items: [{
el: this.editor,
left: 15,
left: 10,
top: 10,
right: 15
right: 10
}],
height: 30
}, {
@ -4261,7 +4257,7 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.ColorPickerEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-color-picker-editor",
width: 200,
// width: 200,
height: 20
})
},
@ -5458,6 +5454,125 @@ BI.IconComboTrigger = BI.inherit(BI.Trigger, {
});
BI.IconComboTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_combo_trigger", BI.IconComboTrigger);/**
* Created by Windy on 2017/12/12.
* combo : icon + text + icon, popup : icon + text
*/
BI.IconTextValueCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this, arguments), {
baseClass: "bi-icon-text-value-combo",
height: 30,
text: "",
el: {}
})
},
_init: function () {
BI.IconTextValueCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(o.el, {
type: "bi.select_icon_text_trigger",
items: o.items,
height: o.height,
text: o.text
});
this.popup = BI.createWidget({
type: "bi.icon_text_value_combo_popup",
items: o.items
});
this.popup.on(BI.IconTextValueComboPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
self.textIconCombo.hideView();
self.fireEvent(BI.IconTextValueCombo.EVENT_CHANGE, arguments);
});
this.popup.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.textIconCombo = BI.createWidget({
type: "bi.combo",
element: this,
adjustLength: 2,
el: this.trigger,
popup: {
el: this.popup,
maxHeight: 300
}
});
},
setValue: function (v) {
this.textIconCombo.setValue(v);
},
getValue: function () {
return this.textIconCombo.getValue();
},
populate: function (items) {
this.options.items = items;
this.textIconCombo.populate(items);
}
});
BI.IconTextValueCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_text_value_combo", BI.IconTextValueCombo);/**
* Created by Windy on 2017/12/12.
*/
BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
_defaultConfig: function () {
return BI.extend(BI.IconTextValueComboPopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-icon-text-icon-popup"
});
},
_init: function () {
BI.IconTextValueComboPopup.superclass._init.apply(this, arguments);
var o = this.options, self = this;
this.popup = BI.createWidget({
type: "bi.button_group",
items: BI.createItems(o.items, {
type: "bi.single_select_icon_text_item",
height: 30
}),
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
layouts: [{
type: "bi.vertical"
}]
});
this.popup.on(BI.Controller.EVENT_CHANGE, function (type, val, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
self.fireEvent(BI.IconTextValueComboPopup.EVENT_CHANGE, val, obj);
}
});
BI.createWidget({
type: "bi.vertical",
element: this,
items: [this.popup]
});
},
populate: function (items) {
BI.IconTextValueComboPopup.superclass.populate.apply(this, arguments);
items = BI.createItems(items, {
type: "bi.single_select_icon_text_item",
height: 30
});
this.popup.populate(items);
},
getValue: function () {
return this.popup.getValue();
},
setValue: function (v) {
this.popup.setValue(v);
}
});
BI.IconTextValueComboPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_text_value_combo_popup", BI.IconTextValueComboPopup);/**
* 单选combo
*
* @class BI.StaticCombo
@ -7555,7 +7670,7 @@ BI.BarPopoverSection = BI.inherit(BI.PopoverSection, {
BI.createWidget({
type: 'bi.right_vertical_adapt',
element: south,
hgap: 5,
lgap: 10,
items: [this.cancel, this.sure]
});
},
@ -9419,6 +9534,10 @@ BI.RichEditorAction = BI.inherit(BI.Widget, {
keydown: function () {
},
hideIf: function (e) {
},
activate: function () {
},
@ -9552,7 +9671,7 @@ BI.RichEditorTextToolbar = BI.inherit(BI.Widget, {
{type: "bi.rich_editor_align_left_button"},
{type: "bi.rich_editor_align_center_button"},
{type: "bi.rich_editor_align_right_button"},
{type: "bi.rich_editor_param_button"},
{type: "bi.rich_editor_param_button"}
],
height: 28
});
@ -9561,22 +9680,28 @@ BI.RichEditorTextToolbar = BI.inherit(BI.Widget, {
_init: function () {
BI.RichEditorTextToolbar.superclass._init.apply(this, arguments);
var self = this, o = this.options;
BI.createWidget({
type: "bi.left",
element: this,
items: BI.map(o.buttons, function (i, btn) {
var buttons = BI.createWidgets(BI.map(o.buttons, function (i, btn) {
return BI.extend(btn, {
editor: o.editor
});
}),
}));
this.element.mousedown(function (e) {
BI.each(buttons, function (i, btn) {
btn.hideIf(e);
});
});
BI.createWidget({
type: "bi.left",
element: this,
items: buttons,
hgap: 3,
vgap: 3
})
});
},
mounted: function () {
var self = this;
if (BI.isIE9Below()) {//IE8下必须要设置unselectable才能不blur输入框
if (BI.isIE9Below()) {// IE8下必须要设置unselectable才能不blur输入框
this.element.mousedown(function () {
self._noSelect(self.element[0]);
});
@ -9585,15 +9710,15 @@ BI.RichEditorTextToolbar = BI.inherit(BI.Widget, {
},
_noSelect: function (element) {
if (element.setAttribute && element.nodeName.toLowerCase() != 'input' && element.nodeName.toLowerCase() != 'textarea') {
element.setAttribute('unselectable', 'on');
if (element.setAttribute && element.nodeName.toLowerCase() != "input" && element.nodeName.toLowerCase() != "textarea") {
element.setAttribute("unselectable", "on");
}
for (var i = 0; i < element.childNodes.length; i++) {
this._noSelect(element.childNodes[i]);
}
}
});
BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar);/**
BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
* 富文本编辑器
*
* Created by GUY on 2017/9/15.
@ -10281,10 +10406,16 @@ BI.RichEditorBackgroundColorChooser = BI.inherit(BI.RichEditorAction, {
});
},
hideIf: function (e) {
if(!this.colorchooser.element.find(e.target).length > 0) {
this.colorchooser.hideView();
}
},
deactivate: function () {
}
});
BI.shortcut('bi.rich_editor_background_color_chooser', BI.RichEditorBackgroundColorChooser);/**
BI.shortcut("bi.rich_editor_background_color_chooser", BI.RichEditorBackgroundColorChooser);/**
* 颜色选择
*
* Created by GUY on 2015/11/26.
@ -10320,6 +10451,12 @@ BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, {
},
hideIf: function (e) {
if(!this.colorchooser.element.find(e.target).length > 0) {
this.colorchooser.hideView();
}
},
deactivate: function () {
this.colorchooser.setValue("");
}
@ -10396,10 +10533,16 @@ BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, {
self.doCommand(val);
this.hideView();
this.setValue([]);
})
});
},
hideIf: function (e) {
if(!this.combo.element.find(e.target).length > 0) {
this.combo.hideView();
}
}
});
BI.shortcut('bi.rich_editor_size_chooser', BI.RichEditorSizeChooser);/**
BI.shortcut("bi.rich_editor_size_chooser", BI.RichEditorSizeChooser);/**
* 富文本编辑器
*
* Created by GUY on 2017/9/15.
@ -10430,7 +10573,7 @@ BI.RichEditor = BI.inherit(BI.Widget, {
type: "bi.combo",
element: this,
toggle: false,
direction: "top",
direction: "top,left",
isNeedAdjustWidth: false,
isNeedAdjustHeight: false,
adjustLength: 1,
@ -13508,6 +13651,9 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
BI.createWidget({
element: this,
type: 'bi.htape',
ref: function (_ref) {
self.wrapper = _ref;
},
items: [{
el: {
type: "bi.icon_change_button",
@ -13535,7 +13681,20 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
},
setIcon: function (iconCls) {
var o = this.options;
this.icon.setIcon(iconCls);
var iconItem = this.wrapper.attr("items")[0];
if(BI.isNull(iconCls) || BI.isEmptyString(iconCls)){
if(iconItem.width !== 0){
iconItem.width = 0;
this.wrapper.resize();
}
}else{
if(iconItem.width !== (o.triggerWidth || o.height)){
iconItem.width = (o.triggerWidth || o.height);
this.wrapper.resize();
}
}
},
setText: function (text) {
@ -13544,6 +13703,60 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
}
});
BI.shortcut("bi.icon_text_trigger", BI.IconTextTrigger);/**
* Created by Windy on 2017/12/12.
*/
BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
return BI.extend(BI.SelectIconTextTrigger.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-select-text-trigger bi-border",
height: 24
});
},
_init: function () {
this.options.height -= 2;
BI.SelectIconTextTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.icon_text_trigger",
element: this,
height: o.height
});
if (BI.isKey(o.text)) {
this.setValue(o.text);
}
},
setValue: function (vals) {
var o = this.options;
vals = BI.isArray(vals) ? vals : [vals];
var result;
var items = BI.Tree.transformToArrayFormat(this.options.items);
BI.any(items, function (i, item) {
if (BI.deepContains(vals, item.value)) {
result = {
text: item.text || item.value,
iconClass: item.iconClass
};
return true;
}
});
if (BI.isNotNull(result)) {
this.trigger.setText(result.text);
this.trigger.setIcon(result.iconClass);
} else {
this.trigger.setText(o.text);
this.trigger.setIcon("");
}
},
populate: function (items) {
this.options.items = items;
}
});
BI.shortcut("bi.select_icon_text_trigger", BI.SelectIconTextTrigger);/**
* 文字trigger
*
* Created by GUY on 2015/9/15.

126
bi/core.js

@ -11695,7 +11695,7 @@ if (!window.BI) {
// Date
if (type === '[object Date]') {
return new Date(obj.getTime());
return Date.getDate(obj.getTime());
}
var i, clone, key;
@ -11925,7 +11925,7 @@ if (!window.BI) {
if (Date.now) {
return Date.now();
} else {
return new Date().getTime();
return Date.getDate().getTime();
}
}
}
@ -18776,9 +18776,9 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
tooltip.visible();
tooltip.element.height(tooltip.element[0].scrollHeight);
this.showingTips[name] = true;
var x = e.pageX || e.clientX, y = (e.pageY || e.clientY) + 15;
var x = (e.pageX || e.clientX) + 15, y = (e.pageY || e.clientY) + 15;
if (x + tooltip.element.outerWidth() > $("body").outerWidth()) {
x -= tooltip.element.outerWidth();
x -= tooltip.element.outerWidth() + 15;
}
if (y + tooltip.element.outerHeight() > $("body").outerHeight()) {
y -= tooltip.element.outerHeight() + 15;
@ -19278,7 +19278,7 @@ BI.extend(jQuery.fn, {
*/
__textKeywordMarked__: function (text, keyword, py) {
if (!BI.isKey(keyword) || (text + "").length > 100) {
return this.html((text + "").replaceAll(" ", "&nbsp;"));
return this.html(BI.Func.formatSpecialCharInHtml(text));
}
keyword = keyword + "";
keyword = BI.toUpperCase(keyword);
@ -19301,7 +19301,7 @@ BI.extend(jQuery.fn, {
if (tidx >= 0) {
this.append(textLeft.substr(0, tidx));
this.append($("<span>").addClass("bi-keyword-red-mark")
.html(textLeft.substr(tidx, keyword.length).replaceAll(" ", "&nbsp;")));
.html(BI.Func.formatSpecialCharInHtml(textLeft.substr(tidx, keyword.length))));
textLeft = textLeft.substr(tidx + keyword.length);
if (py != null) {
@ -19310,7 +19310,7 @@ BI.extend(jQuery.fn, {
} else if (pidx != null && pidx >= 0 && Math.floor(pidx / text.length) === Math.floor((pidx + keyword.length - 1) / text.length)) {
this.append(textLeft.substr(0, pidx));
this.append($("<span>").addClass("bi-keyword-red-mark")
.html(textLeft.substr(pidx, keyword.length).replaceAll(" ", "&nbsp;")));
.html(BI.Func.formatSpecialCharInHtml(textLeft.substr(pidx, keyword.length))));
if (py != null) {
py = py.substr(pidx + keyword.length);
}
@ -19915,6 +19915,27 @@ BI.extend(BI.Func, {
matched: matched,
finded: finded
}
},
/**
* 将字符串中的尖括号等字符encode成html能解析的形式
* @param str
*/
formatSpecialCharInHtml: function (str) {
return (str + "").replaceAll("\\s|<=?|>=?", function (str) {
switch (str) {
case "<":
return "&lt;";
case "<=":
return "&le;";
case ">":
return "&gt;";
case ">=":
return "&ge;";
default:
return "&nbsp;";
}
});
}
});
@ -20172,6 +20193,14 @@ BI.extend(BI.DOM, {
storeInjection[xtype] = cls;
};
var serviceInjection = {};
BI.service = function (xtype, cls) {
if (serviceInjection[xtype] != null) {
throw ("service:[" + xtype + "] has been registed");
}
serviceInjection[xtype] = cls;
};
var providerInjection = {};
BI.provider = function (xtype, cls) {
if (providerInjection[xtype] != null) {
@ -20232,6 +20261,20 @@ BI.extend(BI.DOM, {
}
}
var services = {};
BI.Services = {
getService: function (type, config) {
if (services[type]) {
return services[type];
}
return services[type] = new serviceInjection[type](config);
},
releaseService: function (type) {
delete services[type];
}
}
var providers = {}, providerInstance = {}
BI.Providers = {
@ -20832,20 +20875,21 @@ Date.prototype.getMonthDays = function (month) {
* @returns {Date}
*/
Date.prototype.getLastDateOfMonth = function () {
return new Date(this.getFullYear(), this.getMonth(), this.getMonthDays());
return Date.getDate(this.getFullYear(), this.getMonth(), this.getMonthDays());
};
/** Returns the number of day in the year. */
Date.prototype.getDayOfYear = function () {
var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
var then = new Date(this.getFullYear(), 0, 0, 0, 0, 0);
var now = Date.getDate(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
var then = Date.getDate(this.getFullYear(), 0, 0, 0, 0, 0);
var time = now - then;
return Math.floor(time / Date.DAY);
};
/** Returns the number of the week in year, as defined in ISO 8601. */
Date.prototype.getWeekNumber = function () {
var d = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
var d = Date.getDate(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
//周一是一周第一天
var week = d.getDay();
if (this.getMonth() === 0 && this.getDate() <= week) {
return 1;
@ -20861,19 +20905,23 @@ Date.prototype.getWeekNumber = function () {
return offset;
};
Date.prototype.getQuarter = function () {
return Math.floor(this.getMonth() / 3) + 1;
};
//离当前时间多少天的时间
Date.prototype.getOffsetDate = function (offset) {
return new Date(this.getTime() + offset * 864e5);
return Date.getDate(this.getTime() + offset * 864e5);
};
Date.prototype.getAfterMulQuarter = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() + n * 3);
return dt;
};
//获得n个季度前的日期
Date.prototype.getBeforeMulQuarter = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() - n * 3);
return dt;
};
@ -20897,32 +20945,32 @@ Date.prototype.getQuarterStartMonth = function () {
};
//获得本季度的起始日期
Date.prototype.getQuarterStartDate = function () {
return new Date(this.getFullYear(), this.getQuarterStartMonth(), 1);
return Date.getDate(this.getFullYear(), this.getQuarterStartMonth(), 1);
};
//得到本季度的结束日期
Date.prototype.getQuarterEndDate = function () {
var quarterEndMonth = this.getQuarterStartMonth() + 2;
return new Date(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth));
return Date.getDate(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth));
};
Date.prototype.getAfterMultiMonth = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() + n | 0);
return dt;
};
Date.prototype.getBeforeMultiMonth = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() - n | 0);
return dt;
};
Date.prototype.getAfterMulQuarter = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() + n * 3);
return dt;
};
//获得n个季度前的日期
Date.prototype.getBeforeMulQuarter = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() - n * 3);
return dt;
};
@ -20947,9 +20995,9 @@ Date.prototype.getQuarterStartMonth = function () {
//指定日期n个月之前或之后的日期
Date.prototype.getOffsetMonth = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
var day = dt.getDate();
var monthDay = new Date(dt.getFullYear(), dt.getMonth() + parseInt(n), 1).getMonthDays();
var monthDay = Date.getDate(dt.getFullYear(), dt.getMonth() + parseInt(n), 1).getMonthDays();
if (day > monthDay) {
day = monthDay;
}
@ -20972,31 +21020,31 @@ Date.prototype.getWeekEndDate = function () {
//获得本季度的起始日期
Date.prototype.getQuarterStartDate = function () {
return new Date(this.getFullYear(), this.getQuarterStartMonth(), 1);
return Date.getDate(this.getFullYear(), this.getQuarterStartMonth(), 1);
};
//得到本季度的结束日期
Date.prototype.getQuarterEndDate = function () {
var quarterEndMonth = this.getQuarterStartMonth() + 2;
return new Date(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth));
return Date.getDate(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth));
};
Date.prototype.getAfterMultiMonth = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() + n | 0);
return dt;
};
Date.prototype.getBeforeMultiMonth = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() - n | 0);
return dt;
};
//获得当前时区对应指定时区的时间
Date.prototype.getTimeZoneTimeByTimezoneOffset = function (offset) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
var localTime = dt.getTime();
var localOffset = dt.getTimezoneOffset() * 60000; //获得当地时间偏移的毫秒数
var utc = localTime + localOffset; //utc即GMT时间标准时区
return new Date(utc + offset);
return Date.getDate(utc + offset);
};
/** Checks date and time equality */
@ -21011,7 +21059,7 @@ Date.prototype.equalsTo = function (date) {
/** Set only the year, month, date parts (keep existing time) */
Date.prototype.setDateOnly = function (date) {
var tmp = new Date(date);
var tmp = Date.getDate(date);
this.setDate(1);
this.setFullYear(tmp.getFullYear());
this.setMonth(tmp.getMonth());
@ -21023,6 +21071,7 @@ Date.prototype.print = function (str) {
var d = this.getDate();
var y = this.getFullYear();
var wn = this.getWeekNumber();
var qr = this.getQuarter();
var w = this.getDay();
var s = {};
var hr = this.getHours();
@ -21069,6 +21118,7 @@ Date.prototype.print = function (str) {
s["%y"] = ('' + y).substr(2, 2); // year without the century (range 00 to 99)
s["%Y"] = y; // year with the century
s["%%"] = "%"; // a literal '%' character
s["%Q"] = qr;
var re = /%./g;
if (!BI.isKhtml()) {
@ -21157,7 +21207,7 @@ Date.checkLegal = function (str) {
};
Date.parseDateTime = function (str, fmt) {
var today = new Date();
var today = Date.getDate();
var y = 0;
var m = 0;
var d = 1;
@ -21250,7 +21300,7 @@ Date.parseDateTime = function (str, fmt) {
sec = today.getSeconds();
}
if (y != 0) {
return new Date(y, m, d, hr, min, sec);
return Date.getDate(y, m, d, hr, min, sec);
}
y = 0;
m = -1;
@ -21283,10 +21333,22 @@ Date.parseDateTime = function (str, fmt) {
y = today.getFullYear();
}
if (m != -1 && d != 0) {
return new Date(y, m, d, hr, min, sec);
return Date.getDate(y, m, d, hr, min, sec);
}
return today;
};
Date.getDate = function () {
var dt = new (Function.prototype.bind.apply(Date, BI.concat([null], [].slice.apply(arguments))))();
if(BI.isNotNull(Date.timeZone) && (arguments.length === 0 || (arguments.length === 1 && BI.isNumber(arguments[0])))){
var localTime = dt.getTime();
var localOffset = dt.getTimezoneOffset() * 60000; //获得当地时间偏移的毫秒数
var utc = localTime + localOffset; //utc即GMT时间标准时区
return new Date(utc + Date.timeZone);//+ Pool.timeZone.offset);
}else{
return dt;
}
};
/*
* 给jQuery.Event对象添加的工具方法
*/

2536
bi/widget.js

File diff suppressed because it is too large Load Diff

2
demo/app.js

@ -11,7 +11,7 @@ $(function () {
console.log(_ref);
ref = _ref;
},
element: '#wrapper'
element: "#wrapper"
});
}
});

3004
demo/config.js

File diff suppressed because one or more lines are too long

132
demo/js/base/button/demo.button.js

@ -6,174 +6,174 @@ Demo.Button = BI.inherit(BI.Widget, {
var items = [
{
el: {
type: 'bi.button',
text: '一般按钮',
level: 'common',
type: "bi.button",
text: "一般按钮",
level: "common",
height: 30
}
}, {
el: {
type: 'bi.button',
text: '表示成功状态按钮',
level: 'success',
type: "bi.button",
text: "表示成功状态按钮",
level: "success",
height: 30
}
},
{
el: {
type: 'bi.button',
text: '表示警告状态的按钮',
level: 'warning',
type: "bi.button",
text: "表示警告状态的按钮",
level: "warning",
height: 30
}
}, {
el: {
type: 'bi.button',
text: '表示忽略状态的按钮',
level: 'ignore',
type: "bi.button",
text: "表示忽略状态的按钮",
level: "ignore",
height: 30
}
}, {
el: {
type: 'bi.button',
text: '普通灰化按钮',
type: "bi.button",
text: "普通灰化按钮",
disabled: true,
level: 'success',
level: "success",
height: 30
}
}, {
el: {
type: 'bi.button',
text: '忽略状态灰化按钮',
type: "bi.button",
text: "忽略状态灰化按钮",
disabled: true,
level: 'ignore',
level: "ignore",
height: 30
}
}, {
el: {
type: 'bi.button',
text: '带图标的按钮',
//level: 'ignore',
type: "bi.button",
text: "带图标的按钮",
// level: 'ignore',
iconClass: "close-font",
height: 30
}
}, {
el: {
type: 'bi.button',
text: '一般按钮',
type: "bi.button",
text: "一般按钮",
block: true,
level: 'common',
level: "common",
height: 30
}
}, {
el: {
type: 'bi.button',
text: '表示成功状态按钮',
type: "bi.button",
text: "表示成功状态按钮",
block: true,
level: 'success',
level: "success",
height: 30
}
},
{
el: {
type: 'bi.button',
text: '表示警告状态的按钮',
type: "bi.button",
text: "表示警告状态的按钮",
block: true,
level: 'warning',
level: "warning",
height: 30
}
}, {
el: {
type: 'bi.button',
text: '表示忽略状态的按钮',
type: "bi.button",
text: "表示忽略状态的按钮",
block: true,
level: 'ignore',
level: "ignore",
height: 30
}
}, {
el: {
type: 'bi.button',
text: '普通灰化按钮',
type: "bi.button",
text: "普通灰化按钮",
block: true,
disabled: true,
level: 'success',
level: "success",
height: 30
}
}, {
el: {
type: 'bi.button',
text: '忽略状态灰化按钮',
type: "bi.button",
text: "忽略状态灰化按钮",
block: true,
disabled: true,
level: 'ignore',
level: "ignore",
height: 30
}
}, {
el: {
type: 'bi.button',
text: '带图标的按钮',
type: "bi.button",
text: "带图标的按钮",
block: true,
//level: 'ignore',
// level: 'ignore',
iconClass: "close-font",
height: 30
}
}, {
el: {
type: 'bi.button',
text: '一般按钮',
type: "bi.button",
text: "一般按钮",
clear: true,
level: 'common',
level: "common",
height: 30
}
}, {
el: {
type: 'bi.button',
text: '表示成功状态按钮',
type: "bi.button",
text: "表示成功状态按钮",
clear: true,
level: 'success',
level: "success",
height: 30
}
},
{
el: {
type: 'bi.button',
text: '表示警告状态的按钮',
type: "bi.button",
text: "表示警告状态的按钮",
clear: true,
level: 'warning',
level: "warning",
height: 30
}
}, {
el: {
type: 'bi.button',
text: '表示忽略状态的按钮',
type: "bi.button",
text: "表示忽略状态的按钮",
clear: true,
level: 'ignore',
level: "ignore",
height: 30
}
}, {
el: {
type: 'bi.button',
text: '普通灰化按钮',
type: "bi.button",
text: "普通灰化按钮",
clear: true,
disabled: true,
level: 'success',
level: "success",
height: 30
}
}, {
el: {
type: 'bi.button',
text: '忽略状态灰化按钮',
type: "bi.button",
text: "忽略状态灰化按钮",
clear: true,
disabled: true,
level: 'ignore',
level: "ignore",
height: 30
}
}, {
el: {
type: 'bi.button',
text: '带图标的按钮',
type: "bi.button",
text: "带图标的按钮",
clear: true,
//level: 'ignore',
// level: 'ignore',
iconClass: "close-font",
height: 30
}
@ -181,15 +181,15 @@ Demo.Button = BI.inherit(BI.Widget, {
];
BI.each(items, function (i, item) {
item.el.handler = function () {
BI.Msg.alert('按钮', this.options.text);
}
BI.Msg.alert("按钮", this.options.text);
};
});
return {
type: "bi.left",
vgap: 100,
hgap: 20,
items: items
}
};
}
});
BI.shortcut("demo.button", Demo.Button);

4
demo/js/base/button/demo.icon_button.js

@ -6,7 +6,7 @@ Demo.Button = BI.inherit(BI.Widget, {
var items = [
{
el: {
type: 'bi.icon_button',
type: "bi.icon_button",
cls: "close-ha-font",
width: 20,
height: 20
@ -18,7 +18,7 @@ Demo.Button = BI.inherit(BI.Widget, {
vgap: 200,
hgap: 20,
items: items
}
};
}
});
BI.shortcut("demo.icon_button", Demo.Button);

4
demo/js/base/button/demo.image_button.js

@ -6,7 +6,7 @@ Demo.Button = BI.inherit(BI.Widget, {
var items = [
{
el: {
type: 'bi.image_button',
type: "bi.image_button",
src: "http://www.easyicon.net/api/resizeApi.php?id=1206741&size=128",
width: 100,
height: 100
@ -18,7 +18,7 @@ Demo.Button = BI.inherit(BI.Widget, {
vgap: 200,
hgap: 20,
items: items
}
};
}
});
BI.shortcut("demo.image_button", Demo.Button);

6
demo/js/base/button/demo.text_button.js

@ -6,8 +6,8 @@ Demo.Button = BI.inherit(BI.Widget, {
var items = [
{
el: {
type: 'bi.text_button',
text: '文字按钮',
type: "bi.text_button",
text: "文字按钮",
height: 30
}
}
@ -17,7 +17,7 @@ Demo.Button = BI.inherit(BI.Widget, {
vgap: 200,
hgap: 20,
items: items
}
};
}
});
BI.shortcut("demo.text_button", Demo.Button);

8
demo/js/base/demo.canvas.js

@ -18,15 +18,15 @@ Demo.Func = BI.inherit(BI.Widget, {
canvas.circle(150, 50, 20, "green");
//渐变矩形
// 渐变矩形
canvas.rect(0, 120, 80, 100, canvas.gradient(0, 120, 80, 220, "#FF0000", "#00FF00"));
//空心图形
// 空心图形
canvas.hollow(100, 120, 100, 220, 200, 120, {
strokeStyle: "blue"
});
//实心图形
// 实心图形
canvas.solid(100, 240, 200, 240, 150, 280, 200, 320, 100, 320, {
strokeStyle: "yellow",
fillStyle: "pink"
@ -42,7 +42,7 @@ Demo.Func = BI.inherit(BI.Widget, {
left: 100,
top: 50
}]
})
});
}
});
BI.shortcut("demo.canvas", Demo.Func);

2
demo/js/base/demo.label.js

@ -132,7 +132,7 @@ Demo.Label = BI.inherit(BI.Widget, {
}],
hgap: 300,
vgap: 20
}
};
}
});
BI.shortcut("demo.label", Demo.Label);

16
demo/js/base/demo.message.js

@ -5,19 +5,19 @@ Demo.Message = BI.inherit(BI.Widget, {
render: function () {
return {
type: "bi.center_adapt",
items : [
items: [
{
el : {
type : 'bi.button',
text : '点击我弹出一个消息框',
height : 30,
handler : function() {
BI.Msg.alert('测试消息框', '我是测试消息框的内容');
el: {
type: "bi.button",
text: "点击我弹出一个消息框",
height: 30,
handler: function () {
BI.Msg.alert("测试消息框", "我是测试消息框的内容");
}
}
}
]
}
};
}
});
BI.shortcut("demo.message", Demo.Message);

2
demo/js/base/demo.pager.js

@ -114,7 +114,7 @@ Demo.Func = BI.inherit(BI.Widget, {
return v < 3;
}
}]
}
};
}
});
BI.shortcut("demo.pager", Demo.Func);

2
demo/js/base/demo.svg.js

@ -26,7 +26,7 @@ Demo.Func = BI.inherit(BI.Widget, {
left: 100,
top: 50
}]
})
});
}
});
BI.shortcut("demo.svg", Demo.Func);

2
demo/js/base/editor/demo.code_editor.js

@ -27,7 +27,7 @@ Demo.CodeEditor = BI.inherit(BI.Widget, {
editor.setValue("测试数据");
}
}]
})
});
}
});
BI.shortcut("demo.code_editor", Demo.CodeEditor);

2
demo/js/base/editor/demo.editor.js

@ -90,7 +90,7 @@ Demo.Editor = BI.inherit(BI.Widget, {
left: 200,
bottom: 60
}]
})
});
}
});
BI.shortcut("demo.editor", Demo.Editor);

10
demo/js/base/editor/demo.formula_editor.js

@ -4,10 +4,10 @@ Demo.CodeEditor = BI.inherit(BI.Widget, {
},
render: function () {
this.formula = BI.createWidget({
type : 'bi.formula_editor',
width : 300,
height : 200,
value : 'SUM(C5, 16, 26)'
type: "bi.formula_editor",
width: 300,
height: 200,
value: "SUM(C5, 16, 26)"
});
BI.createWidget({
type: "bi.left",
@ -15,7 +15,7 @@ Demo.CodeEditor = BI.inherit(BI.Widget, {
items: [this.formula],
hgap: 20,
vgap: 20
})
});
}
});
BI.shortcut("demo.formula_editor", Demo.CodeEditor);

2
demo/js/base/editor/demo.multifile_editor.js

@ -20,7 +20,7 @@ Demo.CodeEditor = BI.inherit(BI.Widget, {
top: 50,
left: 50
}]
}
};
}
});
BI.shortcut("demo.multifile_editor", Demo.CodeEditor);

6
demo/js/base/editor/demo.rich_editor.js

@ -15,11 +15,11 @@ Demo.RichEditor = BI.inherit(BI.Widget, {
hgap: 30,
vgap: 50,
items: [this.editor]
})
});
},
mounted: function(){
this.editor.setValue('这是一条<font size="4" color="#009de3">测试</font>数据')
mounted: function () {
this.editor.setValue("这是一条<font size=\"4\" color=\"#009de3\">测试</font>数据");
}
});
BI.shortcut("demo.rich_editor", Demo.RichEditor);

2
demo/js/base/editor/demo.textarea_editor.js

@ -33,7 +33,7 @@ Demo.CodeEditor = BI.inherit(BI.Widget, {
editor.setValue("测试数据");
}
}]
})
});
}
});
BI.shortcut("demo.textarea_editor", Demo.CodeEditor);

6
demo/js/base/table/demo.collection_table.js

@ -12,7 +12,7 @@ Demo.Func = BI.inherit(BI.Widget, {
header[i][j] = {
type: "bi.label",
text: "表头" + i + "-" + j
}
};
columnSize[j] = 100;
}
}
@ -22,7 +22,7 @@ Demo.Func = BI.inherit(BI.Widget, {
items[i][j] = {
type: "bi.label",
text: (i < 3 ? 0 : i) + "-" + j
}
};
}
}
@ -56,7 +56,7 @@ Demo.Func = BI.inherit(BI.Widget, {
top: 10,
bottom: 10
}]
})
});
}
});
BI.shortcut("demo.collection_table", Demo.Func);

6
demo/js/base/table/demo.grid_table.js

@ -12,7 +12,7 @@ Demo.Func = BI.inherit(BI.Widget, {
header[i][j] = {
type: "bi.label",
text: "表头" + i + "-" + j
}
};
columnSize[j] = 100;
}
}
@ -22,7 +22,7 @@ Demo.Func = BI.inherit(BI.Widget, {
items[i][j] = {
type: "bi.label",
text: (i < 3 ? 0 : i) + "-" + j
}
};
}
}
@ -51,7 +51,7 @@ Demo.Func = BI.inherit(BI.Widget, {
top: 10,
bottom: 10
}]
})
});
}
});
BI.shortcut("demo.grid_table", Demo.Func);

6
demo/js/base/table/demo.resizable_table.js

@ -12,7 +12,7 @@ Demo.Func = BI.inherit(BI.Widget, {
header[i][j] = {
type: "bi.label",
text: "表头" + i + "-" + j
}
};
columnSize[j] = 100;
}
}
@ -22,7 +22,7 @@ Demo.Func = BI.inherit(BI.Widget, {
items[i][j] = {
type: "bi.label",
text: (i < 3 ? 0 : i) + "-" + j
}
};
}
}
@ -51,7 +51,7 @@ Demo.Func = BI.inherit(BI.Widget, {
top: 10,
bottom: 10
}]
})
});
}
});
BI.shortcut("demo.resizable_table", Demo.Func);

6
demo/js/base/table/demo.table_view.js

@ -154,10 +154,10 @@ Demo.Func = BI.inherit(BI.Widget, {
text: "第四行第四列"
}, {
text: "第四行第五列"
}]
}],
, [{
[{
text: "第五行第一列"
}, {
text: "第五行第一列"
@ -361,7 +361,7 @@ Demo.Func = BI.inherit(BI.Widget, {
top: 10,
bottom: 10
}]
})
});
}
});
BI.shortcut("demo.table_view", Demo.Func);

14
demo/js/base/tip/demo.bubble.js

@ -10,8 +10,8 @@ Demo.Bubble = BI.inherit(BI.Widget, {
ref: function (_ref) {
btns.push(_ref);
},
type: 'bi.button',
text: 'bubble测试',
type: "bi.button",
text: "bubble测试",
height: 30,
handler: function () {
BI.Bubbles.show("singleBubble1", "bubble测试", this);
@ -22,8 +22,8 @@ Demo.Bubble = BI.inherit(BI.Widget, {
ref: function (_ref) {
btns.push(_ref);
},
type: 'bi.button',
text: 'bubble测试(居中显示)',
type: "bi.button",
text: "bubble测试(居中显示)",
height: 30,
handler: function () {
BI.Bubbles.show("singleBubble2", "bubble测试", this, {
@ -36,8 +36,8 @@ Demo.Bubble = BI.inherit(BI.Widget, {
ref: function (_ref) {
btns.push(_ref);
},
type: 'bi.button',
text: 'bubble测试(右边显示)',
type: "bi.button",
text: "bubble测试(右边显示)",
height: 30,
handler: function () {
BI.Bubbles.show("singleBubble3", "bubble测试", this, {
@ -52,7 +52,7 @@ Demo.Bubble = BI.inherit(BI.Widget, {
vgap: 200,
hgap: 20,
items: items
}
};
}
});
BI.shortcut("demo.bubble", Demo.Bubble);

2
demo/js/base/tip/demo.title.js

@ -33,7 +33,7 @@ Demo.Title = BI.inherit(BI.Widget, {
}],
hgap: 300,
vgap: 20
}
};
}
});
BI.shortcut("demo.title", Demo.Title);

42
demo/js/base/tip/demo.toast.js

@ -6,38 +6,38 @@ Demo.Toast = BI.inherit(BI.Widget, {
var items = [
{
el: {
type: 'bi.button',
text: '简单Toast测试',
height : 30,
handler: function(){
type: "bi.button",
text: "简单Toast测试",
height: 30,
handler: function () {
BI.Msg.toast("这是一条简单的数据");
}
}
}, {
el: {
type: 'bi.button',
text: '很长的Toast测试',
height : 30,
handler: function(){
BI.Msg.toast("这是一条很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长的数据")
type: "bi.button",
text: "很长的Toast测试",
height: 30,
handler: function () {
BI.Msg.toast("这是一条很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长的数据");
}
}
}, {
el: {
type: 'bi.button',
text: '非常长的Toast测试',
height : 30,
handler: function(){
BI.Msg.toast("这是一条非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长的数据")
type: "bi.button",
text: "非常长的Toast测试",
height: 30,
handler: function () {
BI.Msg.toast("这是一条非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长的数据");
}
}
}, {
el: {
type: 'bi.button',
text: '错误提示Toast测试',
type: "bi.button",
text: "错误提示Toast测试",
level: "warning",
height : 30,
handler: function(){
height: 30,
handler: function () {
BI.Msg.toast("错误提示Toast测试", "warning");
}
}
@ -46,10 +46,10 @@ Demo.Toast = BI.inherit(BI.Widget, {
BI.createWidget({
type: "bi.left",
element: this,
vgap : 200,
hgap : 20,
vgap: 200,
hgap: 20,
items: items
})
});
}
});
BI.shortcut("demo.toast", Demo.Toast);

22
demo/js/base/tree/demo.tree_view.js

@ -3,19 +3,19 @@ Demo.Func = BI.inherit(BI.Widget, {
baseCls: "demo-func"
},
_createDefaultTree: function(){
_createDefaultTree: function () {
var tree = BI.createWidget({
type: "bi.tree_view"
});
tree.initTree([
{"id":1, "pId":0, "text":"test1", open:true},
{"id":11, "pId":1, "text":"test11"},
{"id":12, "pId":1, "text":"test12"},
{"id":111, "pId":11, "text":"test111"},
{"id":2, "pId":0, "text":"test2", open:true},
{"id":21, "pId":2, "text":"test21"},
{"id":22, "pId":2, "text":"test22"}
])
{id: 1, pId: 0, text: "test1", open: true},
{id: 11, pId: 1, text: "test11"},
{id: 12, pId: 1, text: "test12"},
{id: 111, pId: 11, text: "test111"},
{id: 2, pId: 0, text: "test2", open: true},
{id: 21, pId: 2, text: "test21"},
{id: 22, pId: 2, text: "test22"}
]);
return tree;
},
@ -38,7 +38,7 @@ Demo.Func = BI.inherit(BI.Widget, {
{
el: {
type: "bi.label",
text: 'tree.initTree([{"id":1, "pId":0, "text":"test1", open:true},{"id":11, "pId":1, "text":"test11"},{"id":12, "pId":1, "text":"test12"},{"id":111, "pId":11, "text":"test111"}])',
text: "tree.initTree([{\"id\":1, \"pId\":0, \"text\":\"test1\", open:true},{\"id\":11, \"pId\":1, \"text\":\"test11\"},{\"id\":12, \"pId\":1, \"text\":\"test12\"},{\"id\":111, \"pId\":11, \"text\":\"test111\"}])",
whiteSpace: "normal"
},
height: 50
@ -46,7 +46,7 @@ Demo.Func = BI.inherit(BI.Widget, {
]
}
}]
})
});
}
});
BI.shortcut("demo.tree_view", Demo.Func);

6
demo/js/case/combo/demo.bubble_combo.js

@ -27,7 +27,7 @@ Demo.Func = BI.inherit(BI.Widget, {
},
maxHeight: 200
}
})
});
var combo2 = BI.createWidget({
type: "bi.bubble_combo",
el: {
@ -51,7 +51,7 @@ Demo.Func = BI.inherit(BI.Widget, {
maxHeight: 200,
minWidth: 600
}
})
});
BI.createWidget({
type: "bi.absolute",
element: this,
@ -64,7 +64,7 @@ Demo.Func = BI.inherit(BI.Widget, {
left: 100,
bottom: 100
}]
})
});
}
});
BI.shortcut("demo.bubble_combo", Demo.Func);

10
demo/js/case/combo/demo.editor_icon_check_combo.js

@ -15,19 +15,19 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, {
width: 200,
height: 30,
items: [{
//text: "MVC-1",
// text: "MVC-1",
value: "1"
}, {
//text: "MVC-2",
// text: "MVC-2",
value: "2"
}, {
//text: "MVC-3",
// text: "MVC-3",
value: "3"
}]
}],
vgap: 20
};
}
}
})
});
BI.shortcut("demo.editor_icon_check_combo", Demo.TextValueCombo);

8
demo/js/case/combo/demo.icon_combo.js

@ -17,8 +17,8 @@ Demo.IconCombo = BI.inherit(BI.Widget, {
type: "bi.icon_combo",
trigger: "click-hover",
container: "body",
ref:function(_ref){
self.refs=_ref;
ref: function (_ref) {
self.refs = _ref;
},
iconClass: "search-font",
items: [{
@ -33,8 +33,8 @@ Demo.IconCombo = BI.inherit(BI.Widget, {
}]
}],
vgap: 20
};
}
}
})
});
BI.shortcut("demo.icon_combo", Demo.IconCombo);

35
demo/js/case/combo/demo.icon_text_value_combo.js

@ -0,0 +1,35 @@
/**
* Created by Windy on 2017/12/13.
*/
Demo.IconTextValueCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.icon_text_value_combo",
text: "默认值",
width: 300,
items: [{
text: "MVC-1",
iconClass: "close-font",
value: 1
}, {
text: "MVC-2",
iconClass: "date-font",
value: 2
}, {
text: "MVC-3",
iconClass: "search-close-h-font",
value: 3
}]
}],
vgap: 20
};
}
});
BI.shortcut("demo.icon_text_value_combo", Demo.IconTextValueCombo);

4
demo/js/case/combo/demo.static_combo.js

@ -38,8 +38,8 @@ Demo.StaticCombo = BI.inherit(BI.Widget, {
]
}],
vgap: 20
};
}
}
})
});
BI.shortcut("demo.static_combo", Demo.StaticCombo);

9
demo/js/case/combo/demo.text_value_combo.js

@ -10,23 +10,26 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, {
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.text_value_combo",
type: "bi.icon_text_value_combo",
text: "默认值",
width: 300,
items: [{
text: "MVC-1",
iconClass: "date-font",
value: 1
}, {
text: "MVC-2",
iconClass: "search-font",
value: 2
}, {
text: "MVC-3",
iconClass: "pull-right-font",
value: 3
}]
}],
vgap: 20
};
}
}
})
});
BI.shortcut("demo.text_value_combo", Demo.TextValueCombo);

4
demo/js/case/combo/demo.text_value_down_list_combo.js

@ -37,12 +37,12 @@ Demo.TextValueDownListCombo = BI.inherit(BI.Widget, {
]
}],
vgap: 20
}
};
},
mounted: function () {
this.refs.setValue(2);
}
})
});
BI.shortcut("demo.text_value_down_list_combo", Demo.TextValueDownListCombo);

4
demo/js/case/combo/demo.text_vlaue_check_combo.js

@ -25,8 +25,8 @@ Demo.TextValueCheckCombo = BI.inherit(BI.Widget, {
}]
}],
vgap: 20
};
}
}
})
});
BI.shortcut("demo.text_value_check_combo", Demo.TextValueCheckCombo);

4
demo/js/case/demo.calendar.js

@ -17,7 +17,7 @@ Demo.Func = BI.inherit(BI.Widget, {
year: date.getFullYear(),
month: date.getMonth(),
day: date.getDate()
}
};
},
mounted: function () {
@ -26,7 +26,7 @@ Demo.Func = BI.inherit(BI.Widget, {
year: date.getFullYear(),
month: date.getMonth(),
day: date.getDate()
})
});
}
});
BI.shortcut("demo.calendar", Demo.Func);

6
demo/js/case/demo.clipboard.js

@ -11,10 +11,10 @@ Demo.Func = BI.inherit(BI.Widget, {
value: "这是复制的内容"
});
var clipboard = BI.createWidget({
type: 'bi.clipboard',
type: "bi.clipboard",
width: 100,
height: 100,
cls: 'layout-bg1',
cls: "layout-bg1",
copy: function () {
return editor.getValue();
},
@ -36,7 +36,7 @@ Demo.Func = BI.inherit(BI.Widget, {
left: 100,
top: 100
}]
})
});
}
});
BI.shortcut("demo.clipboard", Demo.Func);

2
demo/js/case/demo.color_chooser.js

@ -15,7 +15,7 @@ Demo.Func = BI.inherit(BI.Widget, {
left: 100,
top: 250
}]
}
};
}
});
BI.shortcut("demo.color_chooser", Demo.Func);

2
demo/js/case/demo.color_chooser_popup.js

@ -14,7 +14,7 @@ Demo.Func = BI.inherit(BI.Widget, {
left: 100,
top: 250
}]
}
};
}
});
BI.shortcut("demo.color_chooser_popup", Demo.Func);

2
demo/js/case/demo.complex_canvas.js

@ -29,7 +29,7 @@ Demo.Func = BI.inherit(BI.Widget, {
left: 100,
top: 50
}]
})
});
}
});
BI.shortcut("demo.complex_canvas", Demo.Func);

2
demo/js/case/demo.segment.js

@ -22,7 +22,7 @@ Demo.Func = BI.inherit(BI.Widget, {
value: 3
}]
}]
})
});
}
});
BI.shortcut("demo.segment", Demo.Func);

4
demo/js/case/editor/demo.clear_editor.js

@ -15,8 +15,8 @@ Demo.ClearEditor = BI.inherit(BI.Widget, {
watermark: "这个是带清除按钮的"
}],
vgap: 20
};
}
}
})
});
BI.shortcut("demo.clear_editor", Demo.ClearEditor);

8
demo/js/case/editor/demo.shelter_editor.js

@ -14,7 +14,7 @@ Demo.ClearEditor = BI.inherit(BI.Widget, {
},
watermark: "可以设置标记的输入框",
text: "这是一个遮罩"
})
});
BI.createWidget({
type: "bi.vertical",
element: this,
@ -22,7 +22,7 @@ Demo.ClearEditor = BI.inherit(BI.Widget, {
vgap: 20,
bgap: 50,
items: [editor]
})
});
BI.createWidget({
type: "bi.absolute",
element: this,
@ -39,8 +39,8 @@ Demo.ClearEditor = BI.inherit(BI.Widget, {
left: 10,
bottom: 10
}]
})
});
}
})
});
BI.shortcut("demo.shelter_editor", Demo.ClearEditor);

6
demo/js/case/editor/demo.sign_editor.js

@ -14,7 +14,7 @@ Demo.SignEditor = BI.inherit(BI.Widget, {
},
watermark: "可以设置标记的输入框",
text: "这是一个标记,点击它即可进行输入"
})
});
editor.setValue(2);
BI.createWidget({
type: "bi.vertical",
@ -22,8 +22,8 @@ Demo.SignEditor = BI.inherit(BI.Widget, {
hgap: 30,
vgap: 20,
items: [editor]
})
});
}
})
});
BI.shortcut("demo.sign_editor", Demo.SignEditor);

6
demo/js/case/editor/demo.sign_initial_editor.js

@ -9,7 +9,7 @@ Demo.SignInitialEditor = BI.inherit(BI.Widget, {
this.editor.setValue({
value: "123",
text: "sdga"
})
});
},
render: function () {
var self = this;
@ -26,8 +26,8 @@ Demo.SignInitialEditor = BI.inherit(BI.Widget, {
}],
vgap: 20
};
}
}
})
});
BI.shortcut("demo.sign_initial_editor", Demo.SignInitialEditor);

6
demo/js/case/editor/demo.simple_state_editor.js

@ -19,15 +19,15 @@ Demo.SimpleStateEditor = BI.inherit(BI.Widget, {
}],
vgap: 20
}
};
},
mounted: function () {
var self = this;
setTimeout(function () {
self.editor.setState(["*", "*"]);
}, 1000)
}, 1000);
}
})
});
BI.shortcut("demo.simple_state_editor", Demo.SimpleStateEditor);

6
demo/js/case/editor/demo.state_editor.js

@ -19,7 +19,7 @@ Demo.StateEditor = BI.inherit(BI.Widget, {
}],
vgap: 20
}
};
},
@ -27,8 +27,8 @@ Demo.StateEditor = BI.inherit(BI.Widget, {
var self = this;
setTimeout(function () {
self.editor.setState(["*", "*"]);
}, 1000)
}, 1000);
}
})
});
BI.shortcut("demo.state_editor", Demo.StateEditor);

2
demo/js/case/item/demo.multi_select_item.js

@ -16,7 +16,7 @@ Demo.Func = BI.inherit(BI.Widget, {
text: "复选项"
}],
hgap: 300
}
};
}
});
BI.shortcut("demo.multi_select_item", Demo.Func);

2
demo/js/case/item/demo.single_select_item.js

@ -17,7 +17,7 @@ Demo.Items = BI.inherit(BI.Widget, {
text: "单选项"
}],
hgap: 300
}
};
}
});

2
demo/js/case/item/demo.single_select_radio_item.js

@ -17,7 +17,7 @@ Demo.Items = BI.inherit(BI.Widget, {
text: "单选项"
}],
hgap: 300
}
};
}
});

2
demo/js/case/list/demo.lazy_loader.js

@ -17,7 +17,7 @@ Demo.Func = BI.inherit(BI.Widget, {
items: BI.createItems(BI.deepClone(Demo.CONSTANTS.ITEMS), {
type: "bi.button"
})
})
});
}
});
BI.shortcut("demo.lazy_loader", Demo.Func);

2
demo/js/case/list/demo.select_list.js

@ -16,7 +16,7 @@ Demo.Func = BI.inherit(BI.Widget, {
items: BI.createItems(BI.deepClone(Demo.CONSTANTS.SIMPLE_ITEMS), {
type: "bi.multi_select_item"
})
})
});
}
});
BI.shortcut("demo.select_list", Demo.Func);

2
demo/js/case/pager/demo.all_count_pager.js

@ -19,7 +19,7 @@ Demo.Func = BI.inherit(BI.Widget, {
curr: 1,
count: 1000
}]
})
});
}
});
BI.shortcut("demo.all_count_pager", Demo.Func);

2
demo/js/case/pager/demo.direction_pager.js

@ -12,7 +12,7 @@ Demo.Func = BI.inherit(BI.Widget, {
items: [{
type: "bi.direction_pager"
}]
})
});
}
});
BI.shortcut("demo.direction_pager", Demo.Func);

6
demo/js/case/pane/demo.list_pane.js

@ -15,8 +15,8 @@ Demo.Func = BI.inherit(BI.Widget, {
callback(BI.createItems(BI.deepClone(Demo.CONSTANTS.ITEMS), {
type: "bi.multi_select_item",
height: 25
}))
}, 2000)
}));
}, 2000);
},
el: {
type: "bi.button_group",
@ -24,7 +24,7 @@ Demo.Func = BI.inherit(BI.Widget, {
type: "bi.vertical"
}]
}
}
};
},
mounted: function () {

2
demo/js/case/pane/demo.multi_popup_view.js

@ -33,7 +33,7 @@ Demo.Func = BI.inherit(BI.Widget, {
}
}
}]
}
};
}
});
BI.shortcut("demo.multi_popup_view", Demo.Func);

2
demo/js/case/pane/demo.panel.js

@ -22,7 +22,7 @@ Demo.Func = BI.inherit(BI.Widget, {
height: 25
})
}
}
};
}
});
BI.shortcut("demo.panel", Demo.Func);

2
demo/js/case/pane/demo.popup_panel.js

@ -33,7 +33,7 @@ Demo.Func = BI.inherit(BI.Widget, {
}
}
}]
}
};
}
});
BI.shortcut("demo.popup_panel", Demo.Func);

2
demo/js/case/table/demo.adaptive_table.js

@ -154,7 +154,7 @@ Demo.Func = BI.inherit(BI.Widget, {
top: 10,
bottom: 10
}]
})
});
}
});
BI.shortcut("demo.adaptive_table", Demo.Func);

2
demo/js/case/table/demo.layer_tree_table.js

@ -143,7 +143,7 @@ Demo.Func = BI.inherit(BI.Widget, {
top: 10,
bottom: 10
}]
})
});
}
});
BI.shortcut("demo.layer_tree_table", Demo.Func);

2
demo/js/case/table/demo.tree_table.js

@ -143,7 +143,7 @@ Demo.Func = BI.inherit(BI.Widget, {
top: 10,
bottom: 10
}]
})
});
}
});
BI.shortcut("demo.tree_table", Demo.Func);

2
demo/js/case/tree/demo.branch_relation.js

@ -143,7 +143,7 @@ Demo.Func = BI.inherit(BI.Widget, {
type: "bi.adaptive",
element: this,
items: [relation]
})
});
}
});
BI.shortcut("demo.branch_relation", Demo.Func);

6
demo/js/case/tree/demo.branch_tree.js

@ -134,7 +134,7 @@ Demo.Func = BI.inherit(BI.Widget, {
var tree = this._createBranchTree();
var mapTree = this._createBranchMapTree();
function getItems() {
function getItems () {
return [{
text: "且",
value: "且",
@ -159,7 +159,7 @@ Demo.Func = BI.inherit(BI.Widget, {
type: "bi.label",
height: 30,
textAlign: "left",
text: "这里是一段文字" ,
text: "这里是一段文字",
value: "这里是一段文字"
}, {
text: "且",
@ -227,7 +227,7 @@ Demo.Func = BI.inherit(BI.Widget, {
}
}]
}]
})
});
}
});
BI.shortcut("demo.branch_tree", Demo.Func);

2
demo/js/case/tree/demo.handstand_branch_tree.js

@ -97,7 +97,7 @@ Demo.Func = BI.inherit(BI.Widget, {
}
}]
}]
})
});
}
});
BI.shortcut("demo.handstand_branch_tree", Demo.Func);

4
demo/js/case/tree/demo.level_tree.js

@ -63,7 +63,7 @@ Demo.Func = BI.inherit(BI.Widget, {
text: "子项3",
value: 33
}]
})
});
BI.createWidget({
type: "bi.vtape",
@ -81,7 +81,7 @@ Demo.Func = BI.inherit(BI.Widget, {
}
}
}]
})
});
}
});
BI.shortcut("demo.level_tree", Demo.Func);

6
demo/js/case/tree/demo.simple_tree.js

@ -4,7 +4,7 @@ Demo.Func = BI.inherit(BI.Widget, {
},
render: function () {
//value值一定要是字符串
// value值一定要是字符串
var tree = BI.createWidget({
type: "bi.simple_tree",
items: []
@ -66,7 +66,7 @@ Demo.Func = BI.inherit(BI.Widget, {
height: 30,
text: "setValue(['31', '32', '33'])",
handler: function () {
tree.setValue(['31', '32', '33']);
tree.setValue(["31", "32", "33"]);
}
}
}, {
@ -80,7 +80,7 @@ Demo.Func = BI.inherit(BI.Widget, {
}
}
}]
})
});
}
});
BI.shortcut("demo.simple_tree", Demo.Func);

2
demo/js/case/triggers/demo.editor_trigger.js

@ -18,7 +18,7 @@ Demo.Func = BI.inherit(BI.Widget, {
}],
hgap: 20,
vgap: 20
})
});
}
});
BI.shortcut("demo.editor_trigger", Demo.Func);

2
demo/js/case/triggers/demo.icon_trigger.js

@ -18,7 +18,7 @@ Demo.Func = BI.inherit(BI.Widget, {
}],
hgap: 20,
vgap: 20
})
});
}
});
BI.shortcut("demo.icon_trigger", Demo.Func);

2
demo/js/case/triggers/demo.select_text_trigger.js

@ -19,7 +19,7 @@ Demo.Func = BI.inherit(BI.Widget, {
}],
hgap: 20,
vgap: 20
})
});
}
});
BI.shortcut("demo.select_text_trigger", Demo.Func);

2
demo/js/case/triggers/demo.text_trigger.js

@ -19,7 +19,7 @@ Demo.Func = BI.inherit(BI.Widget, {
}],
hgap: 20,
vgap: 20
})
});
}
});
BI.shortcut("demo.text_trigger", Demo.Func);

84
demo/js/category/customATree/demo.multilayerselecttree.leveltree.js

@ -26,8 +26,8 @@ BI.PlatformLevelTree = BI.inherit(BI.Widget, {
itemsCreator: function (op, callback) {
o.itemsCreator(op, function (items) {
callback(self._formatItems(items))
})
callback(self._formatItems(items));
});
},
el: {
@ -44,7 +44,7 @@ BI.PlatformLevelTree = BI.inherit(BI.Widget, {
});
this.tree.on(BI.CustomTree.EVENT_CHANGE, function () {
self.fireEvent(BI.PlatformLevelTree.EVENT_CHANGE, arguments);
})
});
},
_formatItems: function (nodes) {
@ -103,93 +103,93 @@ BI.DemoLevelTree = BI.inherit(BI.Widget, {
self.tree = this;
},
itemsCreator: function (op, callback) {
if (!op.node) {//根节点
if (!op.node) {// 根节点
callback([{
"id": 1,
"pId": 0,
id: 1,
pId: 0,
text: "A",
value: 1,
isParent: true
}, {
"id": 2,
"pId": 0,
"text": "B",
id: 2,
pId: 0,
text: "B",
value: 2,
isParent: true,
open: true
}])
}]);
} else {
if (op.node.id == 1) {
callback([
{
"id": 11,
"pId": 1,
"text": "test11",
id: 11,
pId: 1,
text: "test11",
value: 11,
layer: 1,
isParent: true
},
{
"id": 12,
"pId": 1,
"text": "test12",
id: 12,
pId: 1,
text: "test12",
value: 12,
layer: 1
},
{
"id": 13,
"pId": 1,
"text": "test13",
id: 13,
pId: 1,
text: "test13",
value: 13,
layer: 1
},
{
"id": 14,
"pId": 1,
"text": "test14",
id: 14,
pId: 1,
text: "test14",
value: 14,
layer: 1,
height: 35
},
{
"id": 15,
"pId": 1,
"text": "test15",
id: 15,
pId: 1,
text: "test15",
value: 15,
layer: 1
},
{
"id": 16,
"pId": 1,
"text": "test16",
id: 16,
pId: 1,
text: "test16",
value: 16,
layer: 1
},
{"id": 17, "pId": 1, "text": "test17", layer: 1, value: 17}
])
{id: 17, pId: 1, text: "test17", layer: 1, value: 17}
]);
} else if (op.node.id == 2) {
callback([{
"id": 21,
"pId": 2,
"text": "test21",
id: 21,
pId: 2,
text: "test21",
value: 21,
layer: 1
},
{
"id": 22,
"pId": 2,
"text": "test22",
id: 22,
pId: 2,
text: "test22",
value: 22,
layer: 1
}])
}]);
} else if (op.node.id == 11) {
callback([{
"id": 111,
"pId": 11,
"text": "test111",
id: 111,
pId: 11,
text: "test111",
value: 111,
layer: 2
}])
}]);
}
}
}
@ -205,7 +205,7 @@ BI.DemoLevelTree = BI.inherit(BI.Widget, {
height: 25
}]
}
};
},
mounted: function () {

6
demo/js/category/largeTable/cell.js

@ -8,7 +8,7 @@ BI.DetailTableCell = BI.inherit(BI.Widget, {
baseCls: "bi-detail-table-cell",
dId: "",
text: ""
})
});
},
_init: function () {
@ -36,9 +36,9 @@ BI.DetailTableCell = BI.inherit(BI.Widget, {
type: "bi.vertical",
element: this,
items: [item]
})
});
//表格样式
// 表格样式
if (BI.isNotNull(o.styles) && BI.isObject(o.styles)) {
this.element.css(o.styles);
}

4
demo/js/category/largeTable/header.js

@ -5,7 +5,7 @@ BI.DetailTableHeader = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.DetailTableHeader.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-detail-table-header"
})
});
},
_init: function () {
@ -29,7 +29,7 @@ BI.DetailTableHeader = BI.inherit(BI.Widget, {
}]
});
//表格样式
// 表格样式
if (BI.isNotNull(o.styles) && BI.isObject(o.styles)) {
this.element.css(o.styles);
}

6
demo/js/category/largeTable/largeTable.js

@ -67,7 +67,7 @@ Demo.Face = BI.inherit(BI.Widget, {
top: 0,
bottom: 0
}]
}
};
},
mounted: function () {
@ -114,7 +114,7 @@ Demo.Face = BI.inherit(BI.Widget, {
for (var m = 0; m < times - 1; m++) {
BI.each(items[n % 100], function (j, item) {
copy[n].push(item);
})
});
}
}
return copy;
@ -126,7 +126,7 @@ Demo.Face = BI.inherit(BI.Widget, {
for (var m = 0; m < times - 1; m++) {
BI.each(items[n], function (j, item) {
copy[n].push(item);
})
});
}
}
return copy;

2
demo/js/category/largeTable/sequenceheadercell.normal.js

@ -6,7 +6,7 @@ BI.NormalSequenceHeaderCell = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.NormalSequenceHeaderCell.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-normal-sequence-header-cell"
})
});
},
_init: function () {

4
demo/js/category/largeTable/table.js

File diff suppressed because one or more lines are too long

18
demo/js/category/sortTree/demo.sortTree.js

@ -8,7 +8,7 @@ Demo.Expander = BI.inherit(BI.Widget, {
},
el: o.el,
popup: o.popup
}
};
},
update: function (opt) {
@ -16,7 +16,7 @@ Demo.Expander = BI.inherit(BI.Widget, {
return true;
}
});
BI.shortcut("demo.sort_tree_expander", Demo.Expander)
BI.shortcut("demo.sort_tree_expander", Demo.Expander);
/**
* guy
@ -27,6 +27,7 @@ BI.shortcut("demo.sort_tree_expander", Demo.Expander)
Demo.SortTree = BI.inherit(BI.Widget, {
render: function () {
BI.$import("https://coding.net/u/fanruan/p/bi-components/git/raw/master/dist/jqueryui.js");
var self = this, o = this.options;
var tree = new BI.Tree();
tree.initTree(BI.Tree.transformToTreeFormat(Demo.CONSTANTS.TREEITEMS));
@ -47,8 +48,8 @@ Demo.SortTree = BI.inherit(BI.Widget, {
}]
}
});
this.tree.element.sortable({
BI.delay(function () {
self.tree.element.sortable({
items: ".sort-item",
placeholder: {
element: function ($currentItem) {
@ -62,7 +63,7 @@ Demo.SortTree = BI.inherit(BI.Widget, {
"margin-right": $currentItem.css("margin-right"),
"margin-top": $currentItem.css("margin-top"),
"margin-bottom": $currentItem.css("margin-bottom"),
"margin": $currentItem.css("margin")
margin: $currentItem.css("margin")
});
return holder.element;
},
@ -73,12 +74,12 @@ Demo.SortTree = BI.inherit(BI.Widget, {
update: function (event, ui) {
var node = ui.item.data("node");
var findTheNode = tree.search(node.id);
//这里简单处理下找到它的父节点
// 这里简单处理下找到它的父节点
var currentIndex = 0, parentNode;
if (ui.item.next().length > 0) {
var n = ui.item.next().data("node");
var nextId = n.id;
var nextNode = tree.search(nextId)
var nextNode = tree.search(nextId);
parentNode = nextNode.getParent();
var nextIndex = parentNode.getChildIndex(nextId);
currentIndex = nextIndex > 0 && (nextIndex - 1);
@ -86,7 +87,7 @@ Demo.SortTree = BI.inherit(BI.Widget, {
} else if (ui.item.prev().length > 0) {
var n = ui.item.prev().data("node");
var prevId = n.id;
var prevNode = tree.search(prevId)
var prevNode = tree.search(prevId);
parentNode = prevNode.getParent();
var prevIndex = parentNode.getChildIndex(prevId);
currentIndex = prevIndex + 1;
@ -105,6 +106,7 @@ Demo.SortTree = BI.inherit(BI.Widget, {
}
});
}, 2000);
},
_formatItems: function (layer, nodes) {

2
demo/js/center.js

@ -16,7 +16,7 @@ Demo.Center = BI.inherit(BI.Widget, {
type: v
});
}
}
};
},
setValue: function (v) {

48
demo/js/chart/demo.axis_chart.js

@ -13,7 +13,7 @@ Demo.Func = BI.inherit(BI.Widget, {
cardCreator: function (v) {
return {
type: v
}
};
}
};
},
@ -21,32 +21,32 @@ Demo.Func = BI.inherit(BI.Widget, {
mounted: function () {
var self = this;
var items = [[{
"data": [
{"x": "孙林", "y": 789},
{"x": "金士鹏", "y": 156},
{"x": "张珊", "y": 289},
{"x": "孙阳", "y": 562},
{"x": "袁成洁", "y": 546},
{"x": "张颖", "y": 218},
{"x": "王伟", "y": 541},
{"x": "张武", "y": 219},
{"x": "韩文", "y": 345}
data: [
{x: "孙林", y: 789},
{x: "金士鹏", y: 156},
{x: "张珊", y: 289},
{x: "孙阳", y: 562},
{x: "袁成洁", y: 546},
{x: "张颖", y: 218},
{x: "王伟", y: 541},
{x: "张武", y: 219},
{x: "韩文", y: 345}
],
"name": "测试1",
name: "测试1",
stack: 1
}, {
"data": [
{"x": "孙林", "y": 789},
{"x": "金士鹏", "y": 156},
{"x": "张珊", "y": 289},
{"x": "孙阳", "y": 562},
{"x": "袁成洁", "y": 546},
{"x": "张颖", "y": 218},
{"x": "王伟", "y": 541},
{"x": "张武", "y": 219},
{"x": "韩文", "y": 345}
data: [
{x: "孙林", y: 789},
{x: "金士鹏", y: 156},
{x: "张珊", y: 289},
{x: "孙阳", y: 562},
{x: "袁成洁", y: 546},
{x: "张颖", y: 218},
{x: "王伟", y: 541},
{x: "张武", y: 219},
{x: "韩文", y: 345}
],
"name": "测试2",
name: "测试2",
stack: 1
}]];
var types = ["bi.axis_chart", "bi.line_chart", "bi.bar_chart"];
@ -60,7 +60,7 @@ Demo.Func = BI.inherit(BI.Widget, {
}
self.tab.setSelect(types[index]);
self.tab.populate(BI.deepClone(items));
}, 2000)
}, 2000);
},
destroyed: function () {

4
demo/js/config/case.js

@ -130,6 +130,10 @@ Demo.CASE_CONFIG = [{
pId: 306,
text: "bi.text_value_combo",
value: "demo.text_value_combo"
}, {
pId: 306,
text: "bi.icon_text_value_combo",
value: "demo.icon_text_value_combo"
}, {
pId: 306,
text: "bi.text_value_check_combo",

4
demo/js/config/core.js

@ -162,8 +162,8 @@ Demo.CORE_CONFIG = [{
text: "弹出层"
}, {
pId: 10202,
text: "bi.float_box",
value: "demo.float_box"
text: "bi.popover",
value: "demo.popover"
}, {
pId: 10202,
text: "bi.popup_view",

35
demo/js/config/fix.js

@ -1,4 +1,4 @@
//定义Model路由
// 定义Model路由
var modelRouter = new (BI.inherit(BI.WRouter, {
routes: {
"": "index"
@ -8,7 +8,7 @@ var modelRouter = new (BI.inherit(BI.WRouter, {
return {};
}
}));
//定义View路由
// 定义View路由
var viewRouter = new (BI.inherit(BI.WRouter, {
routes: {
"": "TestView",
@ -49,7 +49,7 @@ var viewRouter = new (BI.inherit(BI.WRouter, {
}
}));
//注册路由
// 注册路由
BI.View.registerVMRouter(viewRouter, modelRouter);
@ -87,39 +87,44 @@ Demo.FIX_CONFIG = [{
id: 71,
pId: 7,
text: "定义响应式数据",
value: "demo.fix1"
value: "demo.fix_define"
}, {
id: 72,
pId: 7,
text: "state属性",
value: "demo.fix6"
value: "demo.fix_state"
}, {
id: 78,
id: 73,
pId: 7,
text: "计算属性",
value: "demo.fix2"
value: "demo.fix_computed"
}, {
id: 73,
id: 74,
pId: 7,
text: "store",
value: "demo.fix3"
value: "demo.fix_store"
}, {
id: 74,
id: 75,
pId: 7,
text: "watcher且或表达式",
value: "demo.fix4"
value: "demo.fix_watcher"
}, {
id: 75,
id: 76,
pId: 7,
text: "watcher星号表达式",
value: "demo.fix5"
value: "demo.fix_global_watcher"
}, {
id: 76,
id: 77,
pId: 7,
text: "context",
value: "demo.fix_context"
}, {
id: 78,
pId: 7,
text: "一个混合的例子",
value: "demo.fix"
}, {
id: 77,
id: 79,
pId: 7,
text: "场景",
value: "demo.fix_scene"

14
demo/js/config/widget.js

@ -5,7 +5,7 @@ Demo.WIDGET_CONFIG = [{
}, {
pId: 4,
id: 401,
text: '各种小控件'
text: "各种小控件"
}, {
pId: 401,
text: "各种通用按钮",
@ -180,8 +180,8 @@ Demo.WIDGET_CONFIG = [{
value: "demo.date_time"
}, {
pId: 412,
text: 'bi.time_interval',
value: 'demo.time_interval'
text: "bi.time_interval",
value: "demo.time_interval"
}, {
pId: 4,
id: 413,
@ -238,4 +238,12 @@ Demo.WIDGET_CONFIG = [{
id: 420,
text: "滚动sliders",
value: "demo.slider"
}, {
pId: 4,
id: 421,
text: "单选下拉框"
}, {
pId: 421,
text: "bi.single_select_combo",
value: "demo.single_select_combo"
}];

18
demo/js/core/abstract/combination/demo.combo.js

@ -204,8 +204,8 @@ Demo.Func = BI.inherit(BI.Widget, {
},
isAllCheckedBySelectedValue: function (selectedValue) {
return selectedValue.length == self.years.length
// return true;
return selectedValue.length == self.years.length;
// return true;
}
}],
buttons: [{
@ -294,7 +294,7 @@ Demo.Func = BI.inherit(BI.Widget, {
text: val,
value: val,
height: 25
}
};
});
popuplate(map);
@ -302,7 +302,7 @@ Demo.Func = BI.inherit(BI.Widget, {
},
hasNext: function (options) {
return options.times < 3
return options.times < 3;
}
},
buttons: [{
@ -327,7 +327,7 @@ Demo.Func = BI.inherit(BI.Widget, {
items: [yearCombo, multiCombo, dynamicPopupCombo, dynamicCombo],
hgap: 20,
vgap: 20
})
});
},
_createBottom: function () {
@ -408,7 +408,7 @@ Demo.Func = BI.inherit(BI.Widget, {
type: "bi.table",
columns: 2,
rows: 6,
columnSize: [0.5, 'fill'],
columnSize: [0.5, "fill"],
rowSize: 30
},
left: 4,
@ -458,7 +458,7 @@ Demo.Func = BI.inherit(BI.Widget, {
type: "bi.text_button",
whiteSpace: "normal",
text: new Date().getFullYear() + v
})
});
}
}
},
@ -470,7 +470,7 @@ Demo.Func = BI.inherit(BI.Widget, {
items: [combo, childCombo, monthCombo, yearCombo],
hgap: 20,
vgap: 20
})
});
},
render: function () {
@ -487,7 +487,7 @@ Demo.Func = BI.inherit(BI.Widget, {
row: 1,
el: this._createBottom()
}]
}
};
}
});
BI.shortcut("demo.combo", Demo.Func);

16
demo/js/core/abstract/combination/demo.combo2.js

@ -8,7 +8,7 @@ Demo.Func = BI.inherit(BI.Widget, {
type: "bi.button",
height: 25,
text: "点击"
}
};
},
oneCombo: function () {
@ -71,7 +71,7 @@ Demo.Func = BI.inherit(BI.Widget, {
height: 1200
}
}
})
});
},
fiveCombo: function () {
@ -89,7 +89,7 @@ Demo.Func = BI.inherit(BI.Widget, {
},
maxHeight: 2000
}
})
});
},
sixCombo: function () {
@ -106,7 +106,7 @@ Demo.Func = BI.inherit(BI.Widget, {
height: 1200
}
}
})
});
},
sevenCombo: function () {
@ -116,7 +116,7 @@ Demo.Func = BI.inherit(BI.Widget, {
adjustYOffset: 5,
direction: "bottom",
isNeedAdjustWidth: false,
//isNeedAdjustHeight: false,
// isNeedAdjustHeight: false,
offsetStyle: "center",
el: this._createEl(),
popup: {
@ -126,7 +126,7 @@ Demo.Func = BI.inherit(BI.Widget, {
height: 1200
}
}
})
});
},
eightCombo: function () {
@ -136,7 +136,7 @@ Demo.Func = BI.inherit(BI.Widget, {
adjustYOffset: 5,
direction: "right",
isNeedAdjustWidth: false,
//isNeedAdjustHeight: false,
// isNeedAdjustHeight: false,
offsetStyle: "middle",
el: this._createEl(),
popup: {
@ -146,7 +146,7 @@ Demo.Func = BI.inherit(BI.Widget, {
height: 200
}
}
})
});
},
render: function () {

4
demo/js/core/abstract/combination/demo.combo_group.js

@ -68,7 +68,7 @@ Demo.Func = BI.inherit(BI.Widget, {
items: [childCombo],
hgap: 20,
vgap: 20
})
});
},
render: function () {
@ -81,7 +81,7 @@ Demo.Func = BI.inherit(BI.Widget, {
row: 0,
el: this._createBottom()
}]
}
};
}
});
BI.shortcut("demo.combo_group", Demo.Func);

2
demo/js/core/abstract/combination/demo.expander.js

@ -35,7 +35,7 @@ Demo.Func = BI.inherit(BI.Widget, {
})
}
}]
}
};
}
});
BI.shortcut("demo.expander", Demo.Func);

6
demo/js/core/abstract/combination/demo.loader.js

@ -14,14 +14,14 @@ Demo.Func = BI.inherit(BI.Widget, {
return BI.extend(v, {
type: "bi.single_select_item",
height: 25
})
}))
});
}));
}, 1000);
},
hasNext: function (options) {
return options.times * 10 < items.length;
}
}
};
}
});
BI.shortcut("demo.loader", Demo.Func);

4
demo/js/core/abstract/combination/demo.navigation.js

@ -7,7 +7,7 @@ Demo.Func = BI.inherit(BI.Widget, {
type: "bi.label",
cls: "layout-bg" + BI.random(1, 8),
text: "第" + v + "页"
})
});
},
render: function () {
@ -29,7 +29,7 @@ Demo.Func = BI.inherit(BI.Widget, {
}]
},
cardCreator: BI.bind(this._createNav, this)
}
};
}
});
BI.shortcut("demo.navigation", Demo.Func);

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

@ -10,7 +10,7 @@ Demo.Func = BI.inherit(BI.Widget, {
handler: function (v) {
}
})
});
},
render: function () {
@ -78,7 +78,7 @@ Demo.Func = BI.inherit(BI.Widget, {
top: 100,
left: 300
}]
})
});
}
});
BI.shortcut("demo.searcher", Demo.Func);

2
demo/js/core/abstract/combination/demo.switcher.js

@ -53,7 +53,7 @@ Demo.Func = BI.inherit(BI.Widget, {
},
adapter: adapter
}]
})
});
}
});
BI.shortcut("demo.switcher", Demo.Func);

6
demo/js/core/abstract/combination/demo.tab.js

@ -10,13 +10,13 @@ Demo.Func = BI.inherit(BI.Widget, {
type: "bi.label",
cls: "layout-bg1",
text: "面板1"
})
});
case 2:
return BI.createWidget({
type: "bi.label",
cls: "layout-bg2",
text: "面板2"
})
});
}
},
@ -61,7 +61,7 @@ Demo.Func = BI.inherit(BI.Widget, {
left: 200,
top: 200
}]
})
});
tab.setSelect(2);
}

4
demo/js/core/abstract/demo.button_group.js

@ -52,11 +52,11 @@ Demo.Func = BI.inherit(BI.Widget, {
type: "bi.label",
text: "3"
}
}])
}]);
}
}]
}
};
}
});
BI.shortcut("demo.button_group", Demo.Func);

2
demo/js/core/abstract/demo.button_tree.js

@ -20,7 +20,7 @@ Demo.Func = BI.inherit(BI.Widget, {
text: "1",
value: 1
}]
}
};
}
});
BI.shortcut("demo.button_tree", Demo.Func);

4
demo/js/core/abstract/demo.collection_view.js

@ -22,7 +22,7 @@ Demo.Func = BI.inherit(BI.Widget, {
y: Math.floor(index / 10) * 50,
width: 50,
height: 50
}
};
}
});
BI.createWidget({
@ -35,7 +35,7 @@ Demo.Func = BI.inherit(BI.Widget, {
top: 10,
bottom: 10
}]
})
});
}
});
BI.shortcut("demo.collection_view", Demo.Func);

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

Loading…
Cancel
Save