Browse Source

Merging in latest from upstream (~GUY/fineui:refs/heads/2.0)

* commit 'dcd68ab9f6a55d48437a98134c39f78fb83bdc44':
  add
  add
  整理
  整理
  整理
es6
windy 8 years ago
parent
commit
78c40c33ad
  1. 3
      demo/css/main.css
  2. 0
      demo/js/base/button/demo.button.js
  3. 0
      demo/js/base/button/demo.icon_button.js
  4. 0
      demo/js/base/button/demo.image_button.js
  5. 0
      demo/js/base/button/demo.text_button.js
  6. 120
      demo/js/base/demo.pager.js
  7. 0
      demo/js/base/editor/demo.code_editor.js
  8. 0
      demo/js/base/editor/demo.editor.js
  9. 0
      demo/js/base/editor/demo.formula_editor.js
  10. 0
      demo/js/base/editor/demo.multifile_editor.js
  11. 0
      demo/js/base/editor/demo.textarea_editor.js
  12. 62
      demo/js/base/table/demo.collection_table.js
  13. 57
      demo/js/base/table/demo.grid_table.js
  14. 57
      demo/js/base/table/demo.resizable_table.js
  15. 367
      demo/js/base/table/demo.table_view.js
  16. 0
      demo/js/base/tip/demo.bubble.js
  17. 0
      demo/js/base/tip/demo.title.js
  18. 0
      demo/js/base/tip/demo.toast.js
  19. 9
      demo/js/base/tree/demo.part_tree.js
  20. 9
      demo/js/base/tree/demo.sync_tree.js
  21. 52
      demo/js/base/tree/demo.tree_view.js
  22. 149
      demo/js/case/tree/demo.branch_relation.js
  23. 233
      demo/js/case/tree/demo.branch_tree.js
  24. 43
      demo/js/case/tree/demo.display_tree.js
  25. 103
      demo/js/case/tree/demo.handstand_branch_tree.js
  26. 87
      demo/js/case/tree/demo.level_tree.js
  27. 86
      demo/js/case/tree/demo.simple_tree.js
  28. 29
      demo/js/config/base.js
  29. 104
      demo/js/config/case.js
  30. 8
      demo/js/config/core.js
  31. 39
      demo/js/core/abstract/demo.collection_view.js
  32. 50
      demo/js/core/abstract/demo.grid_view.js
  33. 245
      demo/js/core/abstract/mvc.custom_tree.js
  34. 3
      demo/less/main.less
  35. 24
      dist/base.css
  36. 336
      dist/base.js
  37. 240
      dist/case.js
  38. 74
      dist/core.js
  39. 8
      src/base/combination/tree.button.js
  40. 118
      src/base/layer/layer.scroll.js
  41. 18
      src/base/pager/pager.js
  42. 1
      src/base/svg/svg.js
  43. 190
      src/base/table/table.js
  44. 2
      src/base/tree/treeview.js
  45. 2
      src/case/table/table.tree.js
  46. 0
      src/case/tree/expander/expander.branch.handstand.js
  47. 0
      src/case/tree/expander/expander.branch.js
  48. 2
      src/case/tree/tree.simple.js
  49. 3
      src/core/proto/array.js
  50. 12
      src/core/wrapper/layout.js
  51. 10
      src/core/wrapper/layout/adapt/adapt.center.js
  52. 10
      src/core/wrapper/layout/adapt/adapt.horizontal.js
  53. 10
      src/core/wrapper/layout/adapt/adapt.vertical.js
  54. 10
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.center.js
  55. 10
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js
  56. 9
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js
  57. 6
      src/css/base/tree/display.tree.css
  58. 18
      src/css/base/view/scrollview.css
  59. 230
      src/css/normalize.css
  60. 128
      src/css/reset.css
  61. 30
      src/less/base/logintimeout/login.timeout.less
  62. 20
      src/less/base/reqloading/loading.request.less
  63. 25
      src/less/base/timeouttoast/widget.timeouttoast.less
  64. 6
      src/less/base/tree/display.tree.less
  65. 19
      src/less/base/view/scrollview.less
  66. 231
      src/less/normalize.less
  67. 48
      src/less/reset.less

3
demo/css/main.css

@ -1,6 +1,3 @@
* {
font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
.layout-bg-white { .layout-bg-white {
background-color: #ffffff; background-color: #ffffff;
} }

0
demo/js/base/demo.button.js → demo/js/base/button/demo.button.js

0
demo/js/base/demo.icon_button.js → demo/js/base/button/demo.icon_button.js

0
demo/js/base/demo.image_button.js → demo/js/base/button/demo.image_button.js

0
demo/js/base/demo.text_button.js → demo/js/base/button/demo.text_button.js

120
demo/js/base/demo.pager.js

@ -0,0 +1,120 @@
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
return {
type: "bi.vertical",
items: [{
type: "bi.label",
height: 30,
text: "默认的分页"
}, {
type: "bi.pager",
height: 50,
pages: 18,
groups: 5,
curr: 6,
first: "首页",
last: "尾页"
}, {
type: "bi.label",
height: 30,
text: "显示上一页、下一页、首页、尾页"
}, {
type: "bi.pager",
dynamicShow: false,
height: 50,
pages: 18,
groups: 5,
curr: 1,
first: "首页>",
last: "<尾页"
}, {
type: "bi.label",
height: 30,
text: "显示上一页、下一页"
}, {
type: "bi.pager",
dynamicShow: false,
dynamicShowFirstLast: true,
height: 50,
pages: 18,
groups: 5,
curr: 1,
first: "首页>",
last: "<尾页"
}, {
type: "bi.label",
height: 30,
text: "自定义上一页、下一页"
}, {
type: "bi.pager",
dynamicShow: false,
height: 50,
pages: 18,
groups: 5,
curr: 6,
prev: {
type: "bi.button",
cls: "",
text: "上一页",
value: "prev",
once: false,
height: 30,
handler: function () {
}
},
next: {
type: "bi.button",
cls: "",
text: "下一页",
value: "next",
once: false,
handler: function () {
}
}
}, {
type: "bi.label",
height: 30,
text: "不知道总页数的情况(测试条件 1<=page<=3)"
}, {
type: "bi.pager",
dynamicShow: false,
height: 50,
pages: false,
curr: 1,
prev: {
type: "bi.button",
cls: "",
text: "上一页",
value: "prev",
once: false,
height: 30,
handler: function () {
}
},
next: {
type: "bi.button",
cls: "",
text: "下一页",
value: "next",
once: false,
handler: function () {
}
},
hasPrev: function (v) {
return v > 1;
},
hasNext: function (v) {
return v < 3;
}
}]
}
}
});
$.shortcut("demo.pager", Demo.Func);

0
demo/js/base/demo.code_editor.js → demo/js/base/editor/demo.code_editor.js

0
demo/js/base/demo.editor.js → demo/js/base/editor/demo.editor.js

0
demo/js/base/demo.formula_editor.js → demo/js/base/editor/demo.formula_editor.js

0
demo/js/base/demo.multifile_editor.js → demo/js/base/editor/demo.multifile_editor.js

0
demo/js/base/demo.textarea_editor.js → demo/js/base/editor/demo.textarea_editor.js

62
demo/js/base/table/demo.collection_table.js

@ -0,0 +1,62 @@
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var items = [], header = [], columnSize = [];
var rowCount = 100, columnCount = 100;
for (var i = 0; i < 1; i++) {
header[i] = [];
for (var j = 0; j < columnCount; j++) {
header[i][j] = {
type: "bi.label",
text: "表头" + i + "-" + j
}
columnSize[j] = 100;
}
}
for (var i = 0; i < rowCount; i++) {
items[i] = [];
for (var j = 0; j < columnCount; j++) {
items[i][j] = {
type: "bi.label",
text: (i < 3 ? 0 : i) + "-" + j
}
}
}
var table = BI.createWidget({
type: "bi.resizable_table",
el: {
type: "bi.collection_table"
},
width: 600,
height: 500,
isResizeAdapt: true,
isNeedResize: true,
isNeedMerge: true,
mergeCols: [0, 1],
mergeRule: function (col1, col2) {
return BI.isEqual(col1, col2);
},
isNeedFreeze: true,
freezeCols: [0, 1],
columnSize: columnSize,
items: items,
header: header
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: table,
left: 10,
right: 10,
top: 10,
bottom: 10
}]
})
}
});
$.shortcut("demo.collection_table", Demo.Func);

57
demo/js/base/table/demo.grid_table.js

@ -0,0 +1,57 @@
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var items = [], header = [], columnSize = [];
var rowCount = 100, columnCount = 100;
for (var i = 0; i < 1; i++) {
header[i] = [];
for (var j = 0; j < columnCount; j++) {
header[i][j] = {
type: "bi.label",
text: "表头" + i + "-" + j
}
columnSize[j] = 100;
}
}
for (var i = 0; i < rowCount; i++) {
items[i] = [];
for (var j = 0; j < columnCount; j++) {
items[i][j] = {
type: "bi.label",
text: (i < 3 ? 0 : i) + "-" + j
}
}
}
var table = BI.createWidget({
type: "bi.resizable_table",
el: {
type: "bi.grid_table",
},
width: 600,
height: 500,
isResizeAdapt: true,
isNeedResize: true,
isNeedFreeze: true,
freezeCols: [0, 1],
columnSize: columnSize,
items: items,
header: header
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: table,
left: 10,
right: 10,
top: 10,
bottom: 10
}]
})
}
});
$.shortcut("demo.grid_table", Demo.Func);

57
demo/js/base/table/demo.resizable_table.js

@ -0,0 +1,57 @@
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var items = [], header = [], columnSize = [];
var rowCount = 100, columnCount = 100;
for (var i = 0; i < 1; i++) {
header[i] = [];
for (var j = 0; j < columnCount; j++) {
header[i][j] = {
type: "bi.label",
text: "表头" + i + "-" + j
}
columnSize[j] = 100;
}
}
for (var i = 0; i < rowCount; i++) {
items[i] = [];
for (var j = 0; j < columnCount; j++) {
items[i][j] = {
type: "bi.label",
text: (i < 3 ? 0 : i) + "-" + j
}
}
}
var table = BI.createWidget({
type: "bi.resizable_table",
el: {
type: "bi.grid_table",
},
width: 600,
height: 500,
isResizeAdapt: true,
isNeedResize: true,
isNeedFreeze: true,
freezeCols: [0, 1],
columnSize: columnSize,
items: items,
header: header
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: table,
left: 10,
right: 10,
top: 10,
bottom: 10
}]
})
}
});
$.shortcut("demo.resizable_table", Demo.Func);

367
demo/js/base/table/demo.table_view.js

@ -0,0 +1,367 @@
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var items = [[{
text: "第一行第一列"
}, {
text: "第一行第一列"
}, {
text: "第一行第一列"
}], [{
text: "第一行第一列"
}, {
text: "第一行第一列"
}, {
text: "第一行第一列"
}], [{
text: "第三行第一列"
}, {
text: "第三行第二列"
}, {
text: "第三行第三列"
}], [{
text: "第四行第一列"
}, {
text: "第四行第二列"
}, {
text: "第四行第三列"
}], [{
text: "第五行第一列"
}, {
text: "第五行第二列"
}, {
text: "第五行第三列"
}], [{
text: "第六行第一列"
}, {
text: "第六行第二列"
}, {
text: "第六行第三列"
}], [{
text: "第七行第一列"
}, {
text: "第七行第二列"
}, {
text: "第七行第三列"
}], [{
text: "第八行第一列"
}, {
text: "第八行第二列"
}, {
text: "第八行第三列"
}], [{
text: "第九行第一列"
}, {
text: "第九行第二列"
}, {
text: "第九行第三列"
}], [{
text: "第十行第一列"
}, {
text: "第十行第二列"
}, {
text: "第十行第三列"
}], [{
text: "第十一行第一列"
}, {
text: "第十一行第二列"
}, {
text: "第十一行第三列"
}], [{
text: "第十二行第一列"
}, {
text: "第十二行第二列"
}, {
text: "第十二行第三列"
}], [{
text: "第十三行第一列"
}, {
text: "第十三行第二列"
}, {
text: "第十三行第三列"
}], [{
text: "第十四行第一列"
}, {
text: "第十四行第二列"
}, {
text: "第十四行第三列"
}], [{
text: "第十五行第一列"
}, {
text: "第十五行第二列"
}, {
text: "第十五行第三列"
}], [{
text: "第十六行第一列"
}, {
text: "第十六行第二列"
}, {
text: "第十六行第三列"
}], [{
text: "第十七行第一列"
}, {
text: "第十七行第二列"
}, {
text: "第十七行第三列"
}], [{
text: "第十八行第一列"
}, {
text: "第十八行第二列"
}, {
text: "第十八行第三列"
}]];
var items2 = [[{
text: "第一行第一列"
}, {
text: "第一行第二列"
}, {
text: "第一行第三列"
}, {
text: "第一行第四列"
}, {
text: "第一行第五列"
}], [{
text: "第二行第一列"
}, {
text: "第二行第二列"
}, {
text: "第二行第三列"
}, {
text: "第二行第四列"
}, {
text: "第二行第五列"
}], [{
text: "第二行第一列"
}, {
text: "第二行第二列"
}, {
text: "第三行第三列"
}, {
text: "第三行第四列"
}, {
text: "第三行第五列"
}], [{
text: "第二行第一列"
}, {
text: "第四行第二列"
}, {
text: "第四行第三列"
}, {
text: "第四行第四列"
}, {
text: "第四行第五列"
}]
, [{
text: "第五行第一列"
}, {
text: "第五行第一列"
}, {
text: "第五行第三列"
}, {
text: "第五行第四列"
}, {
text: "第五行第五列"
}], [{
text: "第六行第一列"
}, {
text: "第六行第一列"
}, {
text: "第六行第三列"
}, {
text: "第六行第四列"
}, {
text: "第六行第五列"
}], [{
text: "第七行第一列"
}, {
text: "第七行第二列"
}, {
text: "第七行第三列"
}, {
text: "第七行第四列"
}, {
text: "第七行第五列"
}], [{
text: "第八行第一列"
}, {
text: "第八行第二列"
}, {
text: "第八行第三列"
}, {
text: "第八行第四列"
}, {
text: "第八行第五列"
}], [{
text: "第九行第一列"
}, {
text: "第九行第二列"
}, {
text: "第九行第三列"
}, {
text: "第九行第四列"
}, {
text: "第九行第五列"
}], [{
text: "第十行第一列"
}, {
text: "第十行第二列"
}, {
text: "第十行第三列"
}, {
text: "第十行第四列"
}, {
text: "第十行第五列"
}], [{
text: "第十一行第一列"
}, {
text: "第十一行第二列"
}, {
text: "第十一行第三列"
}, {
text: "第十一行第四列"
}, {
text: "第十一行第五列"
}], [{
text: "第十二行第一列"
}, {
text: "第十二行第二列"
}, {
text: "第十二行第三列"
}, {
text: "第十二行第四列"
}, {
text: "第十二行第五列"
}], [{
text: "第十三行第一列"
}, {
text: "第十三行第二列"
}, {
text: "第十三行第三列"
}, {
text: "第十三行第四列"
}, {
text: "第十三行第五列"
}], [{
text: "第十四行第一列"
}, {
text: "第十四行第二列"
}, {
text: "第十四行第三列"
}, {
text: "第十四行第四列"
}, {
text: "第十四行第五列"
}]];
var header = [[{
text: "表头1"
}, {
text: "表头2"
}, {
text: "表头3"
}]];
var header2 = [[{
text: "表头1"
}, {
text: "表头2"
}, {
text: "表头3"
}, {
text: "表头4"
}, {
text: "表头5"
}]];
var table1 = BI.createWidget({
type: "bi.table_view",
isNeedResize: true,
isNeedMerge: true,
mergeCols: [0, 1],
columnSize: [100, 200, 300],
items: items,
header: header
});
var table2 = BI.createWidget({
type: "bi.table_view",
isNeedMerge: true,
isNeedFreeze: true,
freezeCols: [0, 1],
mergeCols: [0, 1],
columnSize: [100, 200, 300, 400, 500],
items: items2,
header: header2
});
var table3 = BI.createWidget({
type: "bi.table_view",
isNeedMerge: true,
isNeedFreeze: true,
freezeCols: [4],
mergeCols: [0, 1],
columnSize: [100, 200, 300, 400, 100],
items: items2,
header: header2
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: {
type: "bi.grid",
columns: 2,
rows: 2,
items: [{
column: 0,
row: 0,
el: table1
}, {
column: 1,
row: 0,
el: table2
}, {
column: 0,
row: 1,
el: table3
}, {
column: 1,
row: 1,
el: {
type: "bi.vertical",
items: [{
type: "bi.button",
text: "第一个表setColumnSize([300, 200, 100])",
handler: function () {
table1.setColumnSize([300, 200, 100]);
}
}, {
type: "bi.button",
text: "第二个表setColumnSize([50, 100, 150, 200, 250])",
handler: function () {
table2.setColumnSize([50, 100, 150, 200, 250]);
}
}, {
type: "bi.button",
text: "第三个表setColumnSize([50, 100, 150, 200, 50])",
handler: function () {
table3.setColumnSize([50, 100, 150, 200, 50]);
}
}],
vgap: 10
}
}]
},
left: 10,
right: 10,
top: 10,
bottom: 10
}]
})
}
});
$.shortcut("demo.table_view", Demo.Func);

0
demo/js/base/demo.bubble.js → demo/js/base/tip/demo.bubble.js

0
demo/js/base/demo.title.js → demo/js/base/tip/demo.title.js

0
demo/js/base/demo.toast.js → demo/js/base/tip/demo.toast.js

9
demo/js/base/tree/demo.part_tree.js

@ -0,0 +1,9 @@
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
}
});
$.shortcut("demo.part_tree", Demo.Func);

9
demo/js/base/tree/demo.sync_tree.js

@ -0,0 +1,9 @@
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
}
});
$.shortcut("demo.sync_tree", Demo.Func);

52
demo/js/base/tree/demo.tree_view.js

@ -0,0 +1,52 @@
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
_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"}
])
return tree;
},
render: function () {
var self = this;
BI.createWidget({
type: "bi.grid",
columns: 1,
rows: 1,
element: this,
items: [{
column: 0,
row: 0,
el: {
type: "bi.vtape",
items: [
{
el: this._createDefaultTree()
},
{
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"}])',
whiteSpace: "normal"
},
height: 50
}
]
}
}]
})
}
});
$.shortcut("demo.tree_view", Demo.Func);

149
demo/js/case/tree/demo.branch_relation.js

@ -0,0 +1,149 @@
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var relation = BI.createWidget({
type: "bi.branch_relation",
items: [
{
id: -1,
value: "根目录",
type: "bi.text_button",
cls: "layout-bg2",
width: 180,
height: 100
},
{
id: 1,
pId: -1,
value: "第一级目录1",
type: "bi.text_button",
cls: "layout-bg2",
width: 180,
height: 100
},
{
id: 11,
pId: 1,
value: "第二级文件1",
type: "bi.text_button",
cls: "layout-bg2",
width: 180,
height: 100
},
{
id: 12,
pId: 1,
value: "第二级目录1",
type: "bi.text_button",
cls: "layout-bg2",
width: 180,
height: 100
},
{
id: 121,
pId: 12,
value: "第三级目录1",
type: "bi.text_button",
cls: "layout-bg2",
width: 180,
height: 100
},
{
id: 122,
pId: 12,
value: "第三级文件1",
type: "bi.text_button",
cls: "layout-bg2",
width: 180,
height: 100
},
{
id: 1211,
pId: 121,
value: "第四级目录",
type: "bi.text_button",
cls: "layout-bg2",
width: 180,
height: 100
},
{
id: 12111,
pId: 1211,
value: "第五级文件1",
type: "bi.text_button",
cls: "layout-bg2",
width: 180,
height: 100
},
{
id: 2,
pId: -1,
value: "第一级目录2",
type: "bi.text_button",
cls: "layout-bg2",
width: 180,
height: 100
},
{
id: 21,
pId: 2,
value: "第二级目录2",
type: "bi.text_button",
cls: "layout-bg2",
width: 180,
height: 100
},
{
id: 22,
pId: 2,
value: "第二级文件2",
type: "bi.text_button",
cls: "layout-bg2",
width: 180,
height: 100
},
{
id: 211,
pId: 21,
value: "第三级目录2",
type: "bi.text_button",
cls: "layout-bg2",
width: 180,
height: 100
},
{
id: 212,
pId: 21,
value: "第三级文件2",
type: "bi.text_button",
cls: "layout-bg2",
width: 180,
height: 100
},
{
id: 2111,
pId: 211,
value: "第四级文件2",
type: "bi.text_button",
cls: "layout-bg2",
width: 180,
height: 100
}
],
direction: BI.Direction.Right,
align: BI.HorizontalAlign.Right,
centerOffset: -50
});
BI.createWidget({
type: "bi.adaptive",
element: this,
items: [relation]
})
}
});
$.shortcut("demo.branch_relation", Demo.Func);

233
demo/js/case/tree/demo.branch_tree.js

@ -0,0 +1,233 @@
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
_createBranchTree: function () {
var tree = BI.createWidget({
type: "bi.branch_tree",
items: [{
el: {
text: "且",
value: "且1",
cls: "layout-bg7"
},
children: [{
type: "bi.label",
height: 30,
textAlign: "left",
text: "这里是一段文字1",
value: "这里是一段文字1"
}, {
el: {
text: "或",
value: "或2",
cls: "layout-bg7"
},
children: [{
type: "bi.label",
height: 30,
textAlign: "left",
text: "这里是一段文字1435",
value: "这里是一段文字1435"
}, {
type: "bi.label",
height: 30,
textAlign: "left",
text: "这里是一段文字1xx",
value: "这里是一段文字1xx"
}, {
el: {
text: "且",
value: "且3",
cls: "layout-bg7"
},
children: [{
type: "bi.label",
height: 30,
textAlign: "left",
text: "可以理解为一个条件",
value: "可以理解为一个条件"
}, {
type: "bi.label",
height: 30,
textAlign: "left",
text: "可以理解为一个条件v",
value: "可以理解为一个条件v"
}]
}]
}, {
type: "bi.label",
height: 30,
textAlign: "left",
text: "这里是一段文字1xa",
value: "这里是一段文字1xa"
}]
}]
});
return tree;
},
_createBranchMapTree: function () {
var tree = BI.createWidget({
type: "bi.branch_tree",
el: {
type: "bi.button_group"
},
items: [{
text: "且",
value: "且1",
cls: "layout-bg7",
children: [{
type: "bi.label",
height: 30,
textAlign: "left",
text: "这里是一段文字1",
value: "这里是一段文字1"
}, {
text: "或",
value: "或2",
cls: "layout-bg7",
children: [{
type: "bi.label",
height: 30,
textAlign: "left",
text: "这里是一段文字1435",
value: "这里是一段文字1435"
}, {
type: "bi.label",
height: 30,
textAlign: "left",
text: "这里是一段文字1xx",
value: "这里是一段文字1xx"
}, {
text: "且",
value: "且3",
cls: "layout-bg7",
children: [{
type: "bi.label",
height: 30,
textAlign: "left",
text: "可以理解为一个条件",
value: "可以理解为一个条件"
}, {
type: "bi.label",
height: 30,
textAlign: "left",
text: "可以理解为一个条件v",
value: "可以理解为一个条件v"
}]
}]
}, {
type: "bi.label",
height: 30,
textAlign: "left",
text: "这里是一段文字1xa",
value: "这里是一段文字1xa"
}]
}]
});
return tree;
},
render: function () {
var tree = this._createBranchTree();
var mapTree = this._createBranchMapTree();
function getItems() {
return [{
text: "且",
value: "且",
cls: "layout-bg7",
children: [{
type: "bi.label",
height: 30,
textAlign: "left",
text: "这里是一段文字",
value: "这里是一段文字"
}, {
text: "或",
value: "或2",
cls: "layout-bg7",
children: [{
type: "bi.label",
height: 30,
textAlign: "left",
text: "这里是一段文字",
value: "这里是一段文字"
}, {
type: "bi.label",
height: 30,
textAlign: "left",
text: "这里是一段文字" + BI.UUID(),
value: "这里是一段文字" + BI.UUID()
}, {
text: "且",
value: "且3",
cls: "layout-bg7",
children: [{
type: "bi.label",
height: 30,
textAlign: "left",
text: "可以理解为一个条件",
value: "可以理解为一个条件"
}]
}]
}, {
type: "bi.label",
height: 30,
textAlign: "left",
text: "这里是一段文字1xa",
value: "这里是一段文字1xa"
}]
}];
}
BI.createWidget({
type: "bi.center",
element: this,
items: [{
type: "bi.vtape",
items: [{
el: tree
}, {
height: 30,
el: {
type: "bi.button",
height: 30,
text: "getValue",
handler: function () {
BI.Msg.alert("", tree.getValue());
}
}
}]
}, {
type: "bi.vtape",
items: [{
el: mapTree
}, {
height: 30,
el: {
type: "bi.button",
height: 30,
text: "populate",
handler: function () {
mapTree.populate(getItems());
}
}
}, {
height: 30,
el: {
type: "bi.button",
height: 30,
text: "getValue",
handler: function () {
BI.Msg.alert("", mapTree.getValue());
}
}
}]
}]
})
}
});
$.shortcut("demo.branch_tree", Demo.Func);

43
demo/js/case/tree/demo.display_tree.js

@ -0,0 +1,43 @@
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var tree = BI.createWidget({
type: "bi.display_tree",
element: this
});
tree.initTree([{
id: 1,
text: "第一项",
open: true
}, {
id: 2,
text: "第二项"
}, {
id: 11,
pId: 1,
text: "子项1(共2个)",
open: true
}, {
id: 111,
pId: 11,
text: "子子项1"
}, {
id: 112,
pId: 11,
text: "子子项2"
}, {
id: 12,
pId: 1,
text: "子项2"
}, {
id: 13,
pId: 1,
text: "子项3"
}]);
}
});
$.shortcut("demo.display_tree", Demo.Func);

103
demo/js/case/tree/demo.handstand_branch_tree.js

@ -0,0 +1,103 @@
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
_createHandStandBranchTree: function () {
var tree = BI.createWidget({
type: "bi.handstand_branch_tree",
expander: {},
el: {
layouts: [{
type: "bi.horizontal_adapt",
verticalAlign: BI.VerticalAlign.Top
}]
},
items: [{
el: {
text: "且",
value: "且1",
cls: "layout-bg7"
},
children: [{
type: "bi.label",
height: 30,
textAlign: "left",
text: "这里是一段文字1",
value: "这里是一段文字1"
}, {
el: {
text: "或",
value: "或2",
cls: "layout-bg7"
},
children: [{
type: "bi.label",
height: 30,
textAlign: "left",
text: "这里是一段文字1435",
value: "这里是一段文字1435"
}, {
type: "bi.label",
height: 30,
textAlign: "left",
text: "这里是一段文字1xx",
value: "这里是一段文字1xx"
}, {
el: {
text: "且",
value: "且3",
cls: "layout-bg7"
},
children: [{
type: "bi.label",
height: 30,
textAlign: "left",
text: "可以理解为一个条件",
value: "可以理解为一个条件"
}, {
type: "bi.label",
height: 30,
textAlign: "left",
text: "可以理解为一个条件v",
value: "可以理解为一个条件v"
}]
}]
}, {
type: "bi.label",
height: 30,
textAlign: "left",
text: "这里是一段文字1xa",
value: "这里是一段文字1xa"
}]
}]
});
return tree;
},
render: function () {
var tree = this._createHandStandBranchTree();
BI.createWidget({
type: "bi.center",
element: this,
items: [{
type: "bi.vtape",
items: [{
el: tree
}, {
height: 30,
el: {
type: "bi.button",
height: 30,
text: "getValue",
handler: function () {
BI.Msg.alert("", tree.getValue());
}
}
}]
}]
})
}
});
$.shortcut("demo.handstand_branch_tree", Demo.Func);

87
demo/js/case/tree/demo.level_tree.js

@ -0,0 +1,87 @@
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var tree = BI.createWidget({
type: "bi.level_tree",
chooseType: 0,
items: [{
id: 1,
text: "第一项",
value: 1,
isParent: true
}, {
id: 2,
text: "第二项",
value: 2,
isParent: true
}, {
id: 3,
text: "第三项",
value: 1,
isParent: true,
open: true
}, {
id: 4,
text: "第四项",
value: 1
}, {
id: 11,
pId: 1,
text: "子项1",
value: 11
}, {
id: 12,
pId: 1,
text: "子项2",
value: 12
}, {
id: 13,
pId: 1,
text: "子项3",
value: 13
}, {
id: 21,
pId: 2,
text: "子项1",
value: 21
}, {
id: 31,
pId: 3,
text: "子项1",
value: 31
}, {
id: 32,
pId: 3,
text: "子项2",
value: 32
}, {
id: 33,
pId: 3,
text: "子项3",
value: 33
}]
})
BI.createWidget({
type: "bi.vtape",
element: this,
items: [{
el: tree
}, {
height: 30,
el: {
type: "bi.button",
height: 30,
text: "getValue",
handler: function () {
BI.Msg.alert("", tree.getValue());
}
}
}]
})
}
});
$.shortcut("demo.level_tree", Demo.Func);

86
demo/js/case/tree/demo.simple_tree.js

@ -0,0 +1,86 @@
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
//value值一定要是字符串
var tree = BI.createWidget({
type: "bi.simple_tree",
items: []
});
tree.populate([{
id: 1,
text: "第一项",
value: "1"
}, {
id: 2,
text: "第二项",
value: "2"
}, {
id: 3,
text: "第三项",
value: "3",
open: true
}, {
id: 11,
pId: 1,
text: "子项1",
value: "11"
}, {
id: 12,
pId: 1,
text: "子项2",
value: "12"
}, {
id: 13,
pId: 1,
text: "子项3",
value: "13"
}, {
id: 31,
pId: 3,
text: "子项1",
value: "31"
}, {
id: 32,
pId: 3,
text: "子项2",
value: "32"
}, {
id: 33,
pId: 3,
text: "子项3",
value: "33"
}], "z");
BI.createWidget({
type: "bi.vtape",
element: this,
items: [{
el: tree
}, {
height: 30,
el: {
type: "bi.button",
height: 30,
text: "setValue(['31', '32', '33'])",
handler: function () {
tree.setValue(['31', '32', '33']);
}
}
}, {
height: 30,
el: {
type: "bi.button",
height: 30,
text: "getValue",
handler: function () {
BI.Msg.alert("", JSON.stringify(tree.getValue()));
}
}
}]
})
}
});
$.shortcut("demo.simple_tree", Demo.Func);

29
demo/js/config/base.js

@ -1,6 +1,7 @@
Demo.BASE_CONFIG = [{ Demo.BASE_CONFIG = [{
id: 2, id: 2,
text: "基础控件", text: "基础控件",
open: true
}, { }, {
pId: 2, pId: 2,
text: "bi.label", text: "bi.label",
@ -68,35 +69,39 @@ Demo.BASE_CONFIG = [{
}, { }, {
pId: 2, pId: 2,
id: 203, id: 203,
text: "树控件" text: "tree"
}, { }, {
pId: 203, pId: 203,
text: "bi.treeview", text: "bi.tree_view",
value: "demo.treeview" value: "demo.tree_view"
}, { }, {
pId: 203, pId: 203,
text: "bi.synctree", text: "bi.sync_tree",
value: "demo.synctree" value: "demo.sync_tree"
}, { }, {
pId: 203, pId: 203,
text: "bi.parttree", text: "bi.part_tree",
value: "demo.parttree" value: "demo.part_tree"
}, { }, {
pId: 2, pId: 2,
id: 204, id: 204,
text: "表格" text: "table"
}, { }, {
pId: 204, pId: 204,
text: "bi.table_view", text: "bi.table_view",
value: "demo.table_view" value: "demo.table_view"
}, { }, {
pId: 204, pId: 204,
text: "bi.table_grid", text: "bi.grid_table",
value: "demo.table_grid" value: "demo.grid_table"
}, { }, {
pId: 204, pId: 204,
text: "bi.table_collection", text: "bi.collection_table",
value: "demo.table_collection" value: "demo.collection_table"
}, {
pId: 204,
text: "bi.resizable_table",
value: "demo.resizable_table"
}, { }, {
pId: 2, pId: 2,
text: "bi.canvas", text: "bi.canvas",

104
demo/js/config/case.js

@ -32,86 +32,66 @@ Demo.CASE_CONFIG = [{
value: "demo.bubble_combo" value: "demo.bubble_combo"
}, { }, {
pId: 3, pId: 3,
text: "bi.calendar", id: 303,
value: "demo.calendar" text: "tree"
}, {
pId: 3,
text: "bi.zclip",
value: "demo.zclip"
}, {
pId: 3,
text: "bi.complex_canvas",
value: "demo.complex_canvas"
}, {
pId: 3,
text: "bi.color_chooser",
value: "demo.color_chooser"
}, {
pId: 3,
text: "各种checkbox",
value: "demo.checkboxes"
}, { }, {
pId: 3, pId: 303,
text: "各种tip", text: "bi.branch_tree",
value: "demo.tips" value: "demo.branch_tree"
}, {
pId: 3,
text: "bi.branch_expander",
value: "demo.branch_expander"
}, { }, {
pId: 3, pId: 303,
text: "bi.float_box", text: "bi.handstand_branch_tree",
value: "demo.float_box" value: "demo.handstand_branch_tree"
}, { }, {
pId: 3, pId: 303,
text: "bi.float_box", text: "bi.display_tree",
value: "demo.float_box" value: "demo.display_tree"
}, { }, {
pId: 3, pId: 303,
text: "bi.segment", text: "bi.simple_tree",
value: "demo.segment" value: "demo.simple_tree"
}, { }, {
pId: 3, pId: 303,
id: 12, text: "bi.level_tree",
text: "各种表格" value: "demo.level_tree"
}, { }, {
pId: 3, pId: 303,
id: 13, text: "bi.branch_relation",
text: "各种tree" value: "demo.branch_relation"
}, { }, {
pId: 3, pId: 3,
text: "各种trigger", id: 304,
value: "demo.triggers" text: "table"
}, { }, {
pId: 12, pId: 304,
text: "bi.adaptive_table", text: "bi.adaptive_table",
value: "demo.adaptive_table" value: "demo.adaptive_table"
}, { }, {
pId: 12, pId: 304,
text: "bi.table_tree", text: "bi.tree_table",
value: "demo.table_tree" value: "demo.tree_table"
}, { }, {
pId: 12, pId: 304,
text: "bi.layer_tree_table", text: "bi.layer_tree_table",
value: "demo.layer_tree_table" value: "demo.layer_tree_table"
}, { }, {
pId: 13, pId: 3,
text: "bi.branch_tree", text: "bi.calendar",
value: "demo.branch_tree" value: "demo.calendar"
}, { }, {
pId: 13, pId: 3,
text: "bi.display_tree", text: "bi.zclip",
value: "demo.display_tree" value: "demo.zclip"
}, { }, {
pId: 13, pId: 3,
text: "bi.level_tree", text: "bi.complex_canvas",
value: "demo.level_tree" value: "demo.complex_canvas"
}, { }, {
pId: 13, pId: 3,
text: "bi.simple_tree", text: "bi.color_chooser",
value: "demo.simple_tree" value: "demo.color_chooser"
}, { }, {
pId: 13, pId: 3,
text: "bi.handstand_branch_tree", text: "bi.segment",
value: "demo.handstand_branch_tree" value: "demo.segment"
}]; }];

8
demo/js/config/core.js

@ -151,16 +151,16 @@ Demo.CORE_CONFIG = [{
value: "demo.layer_searcher" value: "demo.layer_searcher"
}, { }, {
pId: 102, pId: 102,
text: "bi.customtree", text: "bi.custom_tree",
value: "demo.customtree" value: "demo.custom_tree"
}, { }, {
pId: 102, pId: 102,
text: "bi.grid_view", text: "bi.grid_view",
value: "demo.grid_view" value: "demo.grid_view"
}, { }, {
pId: 102, pId: 102,
text: "bi.collection", text: "bi.collection_view",
value: "demo.collection" value: "demo.collection_view"
}, { }, {
pId: 1, pId: 1,
text: "widget", text: "widget",

39
demo/js/core/abstract/demo.collection_view.js

@ -0,0 +1,39 @@
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var items = [];
var cellCount = 100;
for (var i = 0; i < cellCount; i++) {
items[i] = {
type: "bi.label",
text: i
};
}
var grid = BI.createWidget({
type: "bi.collection_view",
items: items,
cellSizeAndPositionGetter: function (index) {
return {
x: index % 10 * 50,
y: Math.floor(index / 10) * 50,
width: 50,
height: 50
}
}
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: grid,
left: 10,
right: 10,
top: 10,
bottom: 10
}]
})
}
});
$.shortcut("demo.collection_view", Demo.Func);

50
demo/js/core/abstract/demo.grid_view.js

@ -0,0 +1,50 @@
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var items = [];
var rowCount = 10000, columnCount = 100;
for (var i = 0; i < rowCount; i++) {
items[i] = [];
for (var j = 0; j < columnCount; j++) {
items[i][j] = {
type: "bi.label",
text: i + "-" + j
}
}
}
var grid = BI.createWidget({
type: "bi.grid_view",
items: items,
scrollTop: 100,
rowHeightGetter: function () {
return 30;
},
columnWidthGetter: function () {
return 100;
}
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: {
type: "bi.grid",
columns: 1,
rows: 1,
items: [{
column: 0,
row: 0,
el: grid
}]
},
left: 10,
right: 10,
top: 10,
bottom: 10
}]
})
}
});
$.shortcut("demo.grid_view", Demo.Func);

245
demo/js/core/abstract/mvc.custom_tree.js

@ -0,0 +1,245 @@
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
_createDefaultTree: function () {
var TREEITEMS = [{id: -1, pId: -2, value: "根目录", open: true, type: "bi.plus_group_node", height: 25},
{id: 1, pId: -1, value: "第一级目录1", type: "bi.plus_group_node", height: 25},
{id: 11, pId: 1, value: "第二级文件1", type: "bi.single_select_item", height: 25},
{id: 12, pId: 1, value: "第二级目录2", type: "bi.plus_group_node", height: 25},
{id: 121, pId: 12, value: "第三级目录1", type: "bi.plus_group_node", height: 25},
{id: 122, pId: 12, value: "第三级文件1", type: "bi.single_select_item", height: 25},
{id: 1211, pId: 121, value: "第四级目录1", type: "bi.plus_group_node", height: 25},
{id: 12111, pId: 1211, value: "第五级文件1", type: "bi.single_select_item", height: 25},
{id: 2, pId: -1, value: "第一级目录2", type: "bi.plus_group_node", height: 25},
{id: 21, pId: 2, value: "第二级目录3", type: "bi.plus_group_node", height: 25},
{id: 22, pId: 2, value: "第二级文件2", type: "bi.single_select_item", height: 25},
{id: 211, pId: 21, value: "第三级目录2", type: "bi.plus_group_node", height: 25},
{id: 212, pId: 21, value: "第三级文件2", type: "bi.single_select_item", height: 25},
{id: 2111, pId: 211, value: "第四级文件1", type: "bi.single_select_item", height: 25}];
this.tree = BI.createWidget({
type: "bi.custom_tree",
el: {
type: "bi.button_tree",
chooseType: 0,
layouts: [{
type: "bi.vertical",
hgap: 30
}]
},
items: BI.deepClone(TREEITEMS)
});
return this.tree;
},
_createAsyncTree: function () {
this.asyncTree = BI.createWidget({
type: "bi.custom_tree",
itemsCreator: function (op, callback) {
if (!op.node) {//根节点
callback([{
"id": 1,
"pId": 0,
type: "bi.plus_group_node",
text: "test1",
value: 1,
height: 25,
isParent: true
}, {
"id": 2,
"pId": 0,
type: "bi.plus_group_node",
"text": "test2",
value: 1,
isParent: true,
open: true,
height: 25
}])
} else {
if (op.node.id == 1) {
callback([
{
"id": 11,
"pId": 1,
type: "bi.plus_group_node",
"text": "test11",
value: 11,
height: 25,
isParent: true
},
{
"id": 12,
"pId": 1,
type: "bi.single_select_item",
"text": "test12",
value: 12,
height: 35
},
{
"id": 13,
"pId": 1,
type: "bi.single_select_item",
"text": "test13",
value: 13,
height: 35
},
{
"id": 14,
"pId": 1,
type: "bi.single_select_item",
"text": "test14",
value: 14,
height: 35
},
{
"id": 15,
"pId": 1,
type: "bi.single_select_item",
"text": "test15",
value: 15,
height: 35
},
{
"id": 16,
"pId": 1,
type: "bi.single_select_item",
"text": "test16",
value: 16,
height: 35
},
{"id": 17, "pId": 1, type: "bi.single_select_item", "text": "test17", value: 17, height: 35}
])
} else if (op.node.id == 2) {
callback([{
"id": 21,
"pId": 2,
type: "bi.single_select_item",
"text": "test21",
value: 21,
height: 35
},
{
"id": 22,
"pId": 2,
type: "bi.single_select_item",
"text": "test22",
value: 22,
height: 35
}])
} else if (op.node.id == 11) {
callback([{
"id": 111,
"pId": 11,
type: "bi.single_select_item",
"text": "test111",
value: 111,
height: 35
}])
}
}
},
el: {
type: "bi.loader",
next: false,
el: {
type: "bi.button_tree",
chooseType: 0,
layouts: [{
type: "bi.vertical",
hgap: 30,
vgap: 0
}]
}
}
});
return this.asyncTree;
},
render: function () {
var self = this;
BI.createWidget({
type: "bi.grid",
columns: 2,
rows: 1,
element: this,
items: [{
column: 0,
row: 0,
el: {
type: "bi.vtape",
items: [
{
el: this._createDefaultTree()
},
{
el: {
type: "bi.center",
hgap: 10,
items: [{
type: "bi.text_button",
cls: "mvc-button layout-bg2",
text: "getValue",
height: 30,
handler: function () {
BI.Msg.alert("", JSON.stringify(self.tree.getValue()));
}
}, {
type: "bi.text_button",
cls: "mvc-button layout-bg2",
text: "getNodeByValue(第一级目录1)",
height: 30,
handler: function () {
BI.Msg.alert("", "节点名称为: " + self.tree.getNodeByValue("第一级目录1").getValue());
}
}]
},
height: 30
}
]
}
}, {
column: 1,
row: 0,
el: {
type: "bi.vtape",
items: [
{
type: "bi.label",
text: "异步加载数据",
height: 30
},
{
el: this._createAsyncTree()
},
{
el: {
type: "bi.center",
hgap: 10,
items: [{
type: "bi.text_button",
cls: "mvc-button layout-bg2",
text: "getValue",
height: 30,
handler: function () {
BI.Msg.alert("", JSON.stringify(self.asyncTree.getValue()));
}
}, {
type: "bi.text_button",
cls: "mvc-button layout-bg2",
text: "getNodeById(11)",
height: 30,
handler: function () {
BI.Msg.alert("", "节点名称为: " + (self.asyncTree.getNodeById(11) && self.asyncTree.getNodeById(11).getText()));
}
}]
},
height: 30
}
]
}
}]
})
}
});
$.shortcut("demo.custom_tree", Demo.Func);

3
demo/less/main.less

@ -1,6 +1,3 @@
* {
font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
.layout-bg-white { .layout-bg-white {
background-color: #ffffff; background-color: #ffffff;

24
dist/base.css vendored

@ -2190,13 +2190,13 @@ ul.ztree.zTreeDragUL {
color: #808080; color: #808080;
} }
.bi-display-tree .ztree li span.button.switch.center_open { .bi-display-tree .ztree li span.button.switch.center_open {
background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-3.png"); background-image: url("icon/tree-vertical-line-3.png");
} }
.bi-display-tree .ztree li span.button.switch.roots_open { .bi-display-tree .ztree li span.button.switch.roots_open {
background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-2.png"); background-image: url("icon/tree-vertical-line-2.png");
} }
.bi-display-tree .ztree li span.button.switch.bottom_open { .bi-display-tree .ztree li span.button.switch.bottom_open {
background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-4.png"); background-image: url("icon/tree-vertical-line-4.png");
} }
.bi-display-tree .ztree li a, .bi-display-tree .ztree li a,
.bi-display-tree .ztree li span { .bi-display-tree .ztree li span {
@ -2287,24 +2287,6 @@ ul.ztree.zTreeDragUL {
.bi-list-view .list-view-toolbar > .first-element { .bi-list-view .list-view-toolbar > .first-element {
border-left: none; border-left: none;
} }
/****添加计算宽度的--运算符直接需要space****/
/****** common color(常用颜色,可用于普遍场景) *****/
/**** custom color(自定义颜色,用于特定场景) ****/
.bi-scroll-view .scroll-container {
border-left: 1px solid #d4dadd;
border-right: 1px solid #d4dadd;
border-bottom: 1px solid #d4dadd;
}
.bi-scroll-view .scroll-drop-down-icon {
font-size: 14px;
border-bottom: 1px solid #d4dadd;
border-left: 1px solid #d4dadd;
border-right: 1px solid #d4dadd;
background: #f4f4f4;
}
.bi-scroll-view .scroll-drop-down-icon:active {
background: #d4dadd;
}
.bi-flex-center-layout { .bi-flex-center-layout {
display: box; display: box;
/* OLD - Android 4.4- */ /* OLD - Android 4.4- */

336
dist/base.js vendored

@ -1438,13 +1438,13 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, {
var node; var node;
BI.any(this.buttons, function (i, item) { BI.any(this.buttons, function (i, item) {
if (item.isEnabled()) { if (item.isEnabled()) {
if (item.getValue() === value) { if (BI.isFunction(item.getNodeByValue)) {
node = item;
return true;
} else if (BI.isFunction(item.getNodeByValue)) {
if (node = item.getNodeByValue(value)) { if (node = item.getNodeByValue(value)) {
return true; return true;
} }
} else if (item.attr("value") === value) {
node = item;
return true;
} }
} }
}); });
@ -2073,7 +2073,7 @@ BI.TreeView.EVENT_CHANGE = "EVENT_CHANGE";
BI.TreeView.EVENT_INIT = BI.Events.INIT; BI.TreeView.EVENT_INIT = BI.Events.INIT;
BI.TreeView.EVENT_AFTERINIT = BI.Events.AFTERINIT; BI.TreeView.EVENT_AFTERINIT = BI.Events.AFTERINIT;
$.shortcut("bi.tree", BI.TreeView);/** $.shortcut("bi.tree_view", BI.TreeView);/**
* guy * guy
* 同步树 * 同步树
* @class BI.SyncTree * @class BI.SyncTree
@ -15178,123 +15178,6 @@ BI.PopupView = BI.inherit(BI.Widget, {
}); });
BI.PopupView.EVENT_CHANGE = "EVENT_CHANGE"; BI.PopupView.EVENT_CHANGE = "EVENT_CHANGE";
$.shortcut("bi.popup_view", BI.PopupView);/** $.shortcut("bi.popup_view", BI.PopupView);/**
* guy
* @class BI.ScrollView
* @extends BI.Widget
*/
BI.ScrollView = BI.inherit(BI.Widget, {
_const: {
dropDownHeight: 15,
expandIcon: "column-next-page-h-font",
collapseIcon: "column-pre-page-h-font"
},
_defaultConfig: function() {
return BI.extend(BI.ScrollView.superclass._defaultConfig.apply(this, arguments), {
baseCls:"bi-scroll-view",
scrollHeight: 50,
maxHeight: 300
})
},
_init : function() {
BI.ScrollView.superclass._init.apply(this, arguments);
this.scrollUp = false;
this.scroll = BI.createWidget({
type: "bi.vertical",
cls: "scroll-container",
scrolly: true
})
BI.createWidget({
type: "bi.vertical",
element: this,
scrolly: false,
items: [this.scroll]
})
this.dropdown = BI.createWidget({
type: "bi.icon_button",
height: this._const.dropDownHeight,
cls: "scroll-drop-down-icon " + this._const.expandIcon,
handler: BI.bind(this._dropDownOrUp, this)
})
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.dropdown,
left: 0,
right: 0,
bottom: -1 * this._const.dropDownHeight
}]
})
this.populate(this.options.items);
},
_dropDownOrUp: function(){
if(!this.scrollUp){
var height = this.element.height();
height += this.options.scrollHeight;
height = Math.min(height, this.scroll.element[0].scrollHeight, this.options.maxHeight);
this.element.height(height);
this._checkDropDownState();
} else {
var height = this.element.height();
height -= this.options.scrollHeight;
height = Math.max(height, this.options.height);
this.element.height(height);
this._checkDropDownState();
}
},
_checkDropDownState: function(){
var height = this.element.height();
if(!this._checkScroll() || height >= this.options.maxHeight){
this.scrollUp = true;
this.dropdown.element.removeClass(this._const.expandIcon).addClass(this._const.collapseIcon);
} else if(height <= this.options.height){
this.scrollUp = false;
this.dropdown.element.addClass(this._const.expandIcon);
} else {
this.dropdown.element.addClass(this.scrollUp ? this._const.collapseIcon : this._const.expandIcon);
}
},
_checkScroll: function(){
this.scroll.element.height(this.element.height());
return this.scroll.element[0].scrollHeight > this.scroll.element[0].clientHeight;
},
_checkDropDown: function(){
if(this._checkScroll()){
this.dropdown.visible();
//this.scrollUp = false;
this._checkDropDownState();
} else {
this.dropdown.invisible();
}
},
populate: function(){
this.scroll.populate.apply(this.scroll, arguments);
this.resize();
},
resize: function(){
this.element.height(this.options.height);
BI.nextTick(BI.bind(this._checkDropDown, this));
},
addItem: function(){
this.scroll.addItem.apply(this.scroll, arguments);
BI.nextTick(BI.bind(this._checkDropDown, this));
}
});
$.shortcut("bi.scroll_view", BI.ScrollView);/**
* 搜索面板 * 搜索面板
* *
* Created by GUY on 2015/9/28. * Created by GUY on 2015/9/28.
@ -15479,10 +15362,10 @@ BI.Pager = BI.inherit(BI.Widget, {
var self = this; var self = this;
this.currPage = BI.result(this.options, "curr"); this.currPage = BI.result(this.options, "curr");
//翻页太灵敏 //翻页太灵敏
this._lock = false; // this._lock = false;
this._debouce = BI.debounce(function () { // this._debouce = BI.debounce(function () {
self._lock = false; // self._lock = false;
}, 300); // }, 300);
this._populate(); this._populate();
}, },
@ -15618,11 +15501,11 @@ BI.Pager = BI.inherit(BI.Widget, {
layouts: o.layouts layouts: o.layouts
}); });
this.button_group.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { this.button_group.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
if (self._lock === true) { // if (self._lock === true) {
return; // return;
} // }
self._lock = true; // self._lock = true;
self._debouce(); // self._debouce();
if (type === BI.Events.CLICK) { if (type === BI.Events.CLICK) {
var v = self.button_group.getValue()[0]; var v = self.button_group.getValue()[0];
switch (v) { switch (v) {
@ -28233,6 +28116,7 @@ BI.Svg = BI.inherit(BI.Widget, {
BI.Svg.superclass._init.apply(this, arguments); BI.Svg.superclass._init.apply(this, arguments);
this.paper = Raphael(this.element[0]); this.paper = Raphael(this.element[0]);
this.element.css("overflow", "hidden");
$(this.paper.canvas).width("100%").height("100%").css({"left": "0", "top": "0"}).appendTo(this.element); $(this.paper.canvas).width("100%").height("100%").css({"left": "0", "top": "0"}).appendTo(this.element);
this.top = this.paper.top; this.top = this.paper.top;
@ -30238,9 +30122,6 @@ BI.Table = BI.inherit(BI.Widget, {
dynamic: false dynamic: false
}, },
isNeedResize: false,//是否需要调整列宽
isResizeAdapt: true,//是否需要在调整列宽或区域宽度的时候它们自适应变化
isNeedFreeze: false,//是否需要冻结单元格 isNeedFreeze: false,//是否需要冻结单元格
freezeCols: [], //冻结的列号,从0开始,isNeedFreeze为true时生效 freezeCols: [], //冻结的列号,从0开始,isNeedFreeze为true时生效
@ -30518,111 +30399,6 @@ BI.Table = BI.inherit(BI.Widget, {
return o.columnSize[col] > 1 ? o.columnSize[col] + 1 : o.columnSize[col]; return o.columnSize[col] > 1 ? o.columnSize[col] + 1 : o.columnSize[col];
}); });
if (o.isNeedResize) {
var resizer;
var createResizer = function (size, position) {
var rowSize = self.getCalculateRegionRowSize();
resizer = BI.createWidget({
type: "bi.layout",
cls: "bi-resizer",
width: size.width,
height: rowSize[0] + rowSize[1]
});
BI.createWidget({
type: "bi.absolute",
element: "body",
items: [{
el: resizer,
left: position.left,
top: position.top - rowSize[0]
}]
});
};
var resizeResizer = function (size, position) {
var rowSize = self.getCalculateRegionRowSize();
var columnSize = self.getCalculateRegionColumnSize();
var height = rowSize[0] + rowSize[1];
var sumSize = columnSize[0] + columnSize[1];
if (size.width > sumSize / 5 * 4) {
size.width = sumSize / 5 * 4;
}
if (size.width < 10) {
size.width = 10;
}
resizer.element.css({
"left": position.left + "px",
"width": size.width + "px",
"height": height + "px"
});
};
var stopResizer = function () {
resizer && resizer.destroy();
resizer = null;
};
var handle;
if (o.freezeCols.length > 0 && o.freezeCols.length < o.columnSize.length) {
if (isRight) {
var options = {
handles: "w",
minWidth: 15,
helper: "clone",
start: function (event, ui) {
createResizer(ui.size, ui.position);
self.fireEvent(BI.Table.EVENT_TABLE_BEFORE_REGION_RESIZE);
},
resize: function (e, ui) {
resizeResizer(ui.size, ui.position);
self.fireEvent(BI.Table.EVENT_TABLE_REGION_RESIZE);
e.stopPropagation();
//return false;
},
stop: function (e, ui) {
stopResizer();
if (o.isResizeAdapt) {
var increment = ui.size.width - (BI.sum(self.columnRight) + self.columnRight.length);
o.columnSize[self.columnLeft.length] += increment;
} else {
self.setRegionColumnSize(["fill", ui.size.width]);
}
self._resize();
ui.element.css("left", "");
self.fireEvent(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE);
}
};
self.bottomRight.element.resizable(options);
handle = $(".ui-resizable-handle", this.bottomRight.element).css("top", -1 * headerHeight);
} else {
var options = {
handles: "e",
minWidth: 15,
helper: "clone",
start: function (event, ui) {
createResizer(ui.size, ui.position);
self.fireEvent(BI.Table.EVENT_TABLE_BEFORE_REGION_RESIZE);
},
resize: function (e, ui) {
resizeResizer(ui.size, ui.position);
self.fireEvent(BI.Table.EVENT_TABLE_REGION_RESIZE);
e.stopPropagation();
//return false;
},
stop: function (e, ui) {
stopResizer();
if (o.isResizeAdapt) {
var increment = ui.size.width - (BI.sum(self.columnLeft) + self.columnLeft.length);
o.columnSize[self.columnLeft.length - 1] += increment;
} else {
self.setRegionColumnSize([ui.size.width, "fill"]);
}
self._resize();
self.fireEvent(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE);
}
};
self.bottomLeft.element.resizable(options);
handle = $(".ui-resizable-handle", this.bottomLeft.element).css("top", -1 * headerHeight);
}
}
}
this._resize = function () { this._resize = function () {
if (self.scrollBottomLeft.element.is(":visible")) { if (self.scrollBottomLeft.element.is(":visible")) {
self.scrollBottomLeft.element.css({"overflow-x": "auto"}); self.scrollBottomLeft.element.css({"overflow-x": "auto"});
@ -30650,10 +30426,6 @@ BI.Table = BI.inherit(BI.Widget, {
self.scrollTopLeft.element[0].scrollLeft = self.scrollBottomLeft.element[0].scrollLeft; self.scrollTopLeft.element[0].scrollLeft = self.scrollBottomLeft.element[0].scrollLeft;
self.scrollTopRight.element[0].scrollLeft = self.scrollBottomRight.element[0].scrollLeft; self.scrollTopRight.element[0].scrollLeft = self.scrollBottomRight.element[0].scrollLeft;
self.scrollBottomLeft.element[0].scrollTop = self.scrollBottomRight.element[0].scrollTop; self.scrollBottomLeft.element[0].scrollTop = self.scrollBottomRight.element[0].scrollTop;
//调整拖拽handle的高度
if (o.isNeedResize) {
handle && handle.css("height", self.bottomLeft.element.height() + headerHeight);
}
} }
}; };
@ -31121,70 +30893,6 @@ BI.Table = BI.inherit(BI.Widget, {
start || (start = 0); start || (start = 0);
var frag = this._createCells(items, columnSize, BI.range(o.columnSize.length), TDs, Ws, start, o.headerRowSize || o.rowSize); var frag = this._createCells(items, columnSize, BI.range(o.columnSize.length), TDs, Ws, start, o.headerRowSize || o.rowSize);
if (o.isNeedResize === true) {
var tds = TDs[BI.size(TDs) - 1];
BI.each(tds, function (j, td) {
j = j | 0;
var resizer;
var getHeight = function (size, position) {
var rowSize = self.getCalculateRegionRowSize();
if (o.isNeedFreeze === true) {
var tableHeight = self.bottomRightContainer.element.outerHeight();
return size.height + Math.min(rowSize[1], tableHeight);
} else {
var tableHeight = self.tableContainer.element.outerHeight();
var offset = self.tableContainer.element.offset();
var offsetTop = position.top - offset.top;
var height = tableHeight - offsetTop;
height = Math.min(height, rowSize[0] - offsetTop);
return height;
}
};
if (j < BI.size(tds) - 1) {
td.resizable({
handles: "e",
minWidth: 15,
helper: "clone",
start: function (event, ui) {
var height = getHeight(ui.size, ui.position);
resizer = BI.createWidget({
type: "bi.layout",
cls: "bi-resizer",
width: ui.size.width,
height: height
});
BI.createWidget({
type: "bi.absolute",
element: "body",
items: [{
el: resizer,
left: ui.position.left,
top: ui.position.top
}]
});
self.fireEvent(BI.Table.EVENT_TABLE_BEFORE_COLUMN_RESIZE);
},
resize: function (e, ui) {
var height = getHeight(ui.size, ui.position);
resizer.element.css({"width": ui.size.width + "px", "height": height + "px"});
//o.columnSize[start + j] = ui.size.width;
//self.setColumnSize(o.columnSize);
self.fireEvent(BI.Table.EVENT_TABLE_COLUMN_RESIZE);
e.stopPropagation();
//return false;
},
stop: function (e, ui) {
resizer.destroy();
resizer = null;
o.columnSize[start + j] = ui.size.width - 1;
self.setColumnSize(o.columnSize);
self.fireEvent(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE);
}
})
}
})
}
return frag; return frag;
}, },
@ -31576,13 +31284,6 @@ BI.Table = BI.inherit(BI.Widget, {
this.bottomRightContainer.element.width(isRight ? lw : rw); this.bottomRightContainer.element.width(isRight ? lw : rw);
this.scrollTopLeft.element[0].scrollLeft = this.scrollBottomLeft.element[0].scrollLeft; this.scrollTopLeft.element[0].scrollLeft = this.scrollBottomLeft.element[0].scrollLeft;
this.scrollTopRight.element[0].scrollLeft = this.scrollBottomRight.element[0].scrollLeft; this.scrollTopRight.element[0].scrollLeft = this.scrollBottomRight.element[0].scrollLeft;
if (o.isNeedResize && o.isResizeAdapt) {
var leftWidth = BI.sum(o.freezeCols, function (i, col) {
return o.columnSize[col] > 1 ? o.columnSize[col] + 1 : o.columnSize[col];
});
this.partitions.attr("columnSize", isRight ? ['fill', leftWidth] : [leftWidth, 'fill']);
this.partitions.resize();
}
} else { } else {
BI.each(this.colgroupTds, function (i, colgroup) { BI.each(this.colgroupTds, function (i, colgroup) {
var width = colgroup.attr("width") | 0; var width = colgroup.attr("width") | 0;
@ -32044,13 +31745,6 @@ BI.Table = BI.inherit(BI.Widget, {
this.topRightContainer.element.width(isRight ? lw : rw); this.topRightContainer.element.width(isRight ? lw : rw);
this.scrollTopLeft.element[0].scrollLeft = this.scrollBottomLeft.element[0].scrollLeft; this.scrollTopLeft.element[0].scrollLeft = this.scrollBottomLeft.element[0].scrollLeft;
this.scrollTopRight.element[0].scrollLeft = this.scrollBottomRight.element[0].scrollLeft; this.scrollTopRight.element[0].scrollLeft = this.scrollBottomRight.element[0].scrollLeft;
if (o.isNeedResize && o.isResizeAdapt) {
var leftWidth = BI.sum(o.freezeCols, function (i, col) {
return columnSize[col] > 1 ? columnSize[col] + 1 : columnSize[col];
});
this.partitions.attr("columnSize", isRight ? ['fill', leftWidth] : [leftWidth, 'fill']);
this.partitions.resize();
}
} else { } else {
BI.each(this.colgroupTds, function (i, colgroup) { BI.each(this.colgroupTds, function (i, colgroup) {
var width = colgroup.attr("width") | 0; var width = colgroup.attr("width") | 0;

240
dist/case.js vendored

@ -6165,124 +6165,6 @@ BI.SimpleStateEditor.EVENT_SPACE = "EVENT_SPACE";
BI.SimpleStateEditor.EVENT_EMPTY = "EVENT_EMPTY"; BI.SimpleStateEditor.EVENT_EMPTY = "EVENT_EMPTY";
$.shortcut("bi.simple_state_editor", BI.SimpleStateEditor);/** $.shortcut("bi.simple_state_editor", BI.SimpleStateEditor);/**
* 倒立的Branch
* @class BI.HandStandBranchExpander
* @extend BI.Widget
* create by young
*/
BI.HandStandBranchExpander = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.HandStandBranchExpander.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-handstand-branch-expander",
direction: BI.Direction.Top,
logic: {
dynamic: true
},
el: {type: "bi.label"},
popup: {}
})
},
_init: function () {
BI.HandStandBranchExpander.superclass._init.apply(this, arguments);
var o = this.options;
this._initExpander();
this._initBranchView();
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({}, o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection(o.direction, {
type: "bi.center_adapt",
items: [this.expander]
}, this.branchView)
}))));
},
_initExpander: function () {
var self = this, o = this.options;
this.expander = BI.createWidget(o.el);
this.expander.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
},
_initBranchView: function () {
var self = this, o = this.options;
this.branchView = BI.createWidget(o.popup, {});
this.branchView.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
},
populate: function (items) {
this.branchView.populate.apply(this.branchView, arguments);
},
getValue: function () {
return this.branchView.getValue();
}
});
BI.HandStandBranchExpander.EVENT_CHANGE = "EVENT_CHANGE";
$.shortcut("bi.handstand_branch_expander", BI.HandStandBranchExpander);/**
* @class BI.BranchExpander
* @extend BI.Widget
* create by young
*/
BI.BranchExpander = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.BranchExpander.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-branch-expander",
direction: BI.Direction.Left,
logic: {
dynamic: true
},
el: {},
popup: {}
})
},
_init: function () {
BI.BranchExpander.superclass._init.apply(this, arguments);
var o = this.options;
this._initExpander();
this._initBranchView();
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({}, o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection(o.direction, this.expander, this.branchView)
}))));
},
_initExpander: function () {
var self = this, o = this.options;
this.expander = BI.createWidget(o.el, {
type: "bi.label",
width: 30,
height: "100%"
});
this.expander.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
},
_initBranchView: function () {
var self = this, o = this.options;
this.branchView = BI.createWidget(o.popup, {});
this.branchView.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
},
populate: function (items) {
this.branchView.populate.apply(this.branchView, arguments);
},
getValue: function () {
return this.branchView.getValue();
}
});
BI.BranchExpander.EVENT_CHANGE = "EVENT_CHANGE";
$.shortcut("bi.branch_expander", BI.BranchExpander);/**
* 有确定取消按钮的弹出层 * 有确定取消按钮的弹出层
* @class BI.BarFloatSection * @class BI.BarFloatSection
* @extends BI.FloatSection * @extends BI.FloatSection
@ -9890,7 +9772,7 @@ BI.extend(BI.TableTree, {
} }
}); });
$.shortcut("bi.table_tree", BI.TableTree);/** $.shortcut("bi.tree_table", BI.TableTree);/**
* guy * guy
* 复选导航条 * 复选导航条
* Created by GUY on 2015/8/25. * Created by GUY on 2015/8/25.
@ -10024,6 +9906,124 @@ BI.MultiSelectBar = BI.inherit(BI.BasicButton, {
}); });
BI.MultiSelectBar.EVENT_CHANGE = "MultiSelectBar.EVENT_CHANGE"; BI.MultiSelectBar.EVENT_CHANGE = "MultiSelectBar.EVENT_CHANGE";
$.shortcut("bi.multi_select_bar", BI.MultiSelectBar);/** $.shortcut("bi.multi_select_bar", BI.MultiSelectBar);/**
* 倒立的Branch
* @class BI.HandStandBranchExpander
* @extend BI.Widget
* create by young
*/
BI.HandStandBranchExpander = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.HandStandBranchExpander.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-handstand-branch-expander",
direction: BI.Direction.Top,
logic: {
dynamic: true
},
el: {type: "bi.label"},
popup: {}
})
},
_init: function () {
BI.HandStandBranchExpander.superclass._init.apply(this, arguments);
var o = this.options;
this._initExpander();
this._initBranchView();
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({}, o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection(o.direction, {
type: "bi.center_adapt",
items: [this.expander]
}, this.branchView)
}))));
},
_initExpander: function () {
var self = this, o = this.options;
this.expander = BI.createWidget(o.el);
this.expander.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
},
_initBranchView: function () {
var self = this, o = this.options;
this.branchView = BI.createWidget(o.popup, {});
this.branchView.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
},
populate: function (items) {
this.branchView.populate.apply(this.branchView, arguments);
},
getValue: function () {
return this.branchView.getValue();
}
});
BI.HandStandBranchExpander.EVENT_CHANGE = "EVENT_CHANGE";
$.shortcut("bi.handstand_branch_expander", BI.HandStandBranchExpander);/**
* @class BI.BranchExpander
* @extend BI.Widget
* create by young
*/
BI.BranchExpander = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.BranchExpander.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-branch-expander",
direction: BI.Direction.Left,
logic: {
dynamic: true
},
el: {},
popup: {}
})
},
_init: function () {
BI.BranchExpander.superclass._init.apply(this, arguments);
var o = this.options;
this._initExpander();
this._initBranchView();
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({}, o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection(o.direction, this.expander, this.branchView)
}))));
},
_initExpander: function () {
var self = this, o = this.options;
this.expander = BI.createWidget(o.el, {
type: "bi.label",
width: 30,
height: "100%"
});
this.expander.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
},
_initBranchView: function () {
var self = this, o = this.options;
this.branchView = BI.createWidget(o.popup, {});
this.branchView.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
},
populate: function (items) {
this.branchView.populate.apply(this.branchView, arguments);
},
getValue: function () {
return this.branchView.getValue();
}
});
BI.BranchExpander.EVENT_CHANGE = "EVENT_CHANGE";
$.shortcut("bi.branch_expander", BI.BranchExpander);/**
* @class BI.HandStandBranchTree * @class BI.HandStandBranchTree
* @extends BI.Widget * @extends BI.Widget
* create by young * create by young
@ -10344,7 +10344,7 @@ BI.SimpleTreeView = BI.inherit(BI.Widget, {
var self = this, o = this.options; var self = this, o = this.options;
this.structure = new BI.Tree(); this.structure = new BI.Tree();
this.tree = BI.createWidget({ this.tree = BI.createWidget({
type: "bi.tree", type: "bi.tree_view",
element: this, element: this,
itemsCreator: function (op, callback) { itemsCreator: function (op, callback) {
var fn = function (items) { var fn = function (items) {

74
dist/core.js vendored

@ -19357,17 +19357,17 @@ BI.Layout = BI.inherit(BI.Widget, {
*/ */
addItem: function (item) { addItem: function (item) {
var w = this._addElement(this.options.items.length, item); var w = this._addElement(this.options.items.length, item);
w._mount();
this.options.items.push(item); this.options.items.push(item);
w.element.appendTo(this.element); w.element.appendTo(this.element);
w._mount();
return w; return w;
}, },
prependItem: function (item) { prependItem: function (item) {
var w = this._addElement(this.options.items.length, item); var w = this._addElement(this.options.items.length, item);
w._mount();
this.options.items.unshift(item); this.options.items.unshift(item);
w.element.prependTo(this.element); w.element.prependTo(this.element);
w._mount();
return w; return w;
}, },
@ -19379,10 +19379,10 @@ BI.Layout = BI.inherit(BI.Widget, {
}, },
prependItems: function (items) { prependItems: function (items) {
var self = this; items = items || [];
BI.each(items, function (i, item) { for (var i = items.length - 1; i >= 0; i--) {
self.prependItem(item); this.prependItem(items[i]);
}) }
}, },
getValue: function () { getValue: function () {
@ -23083,6 +23083,9 @@ BI.HorizontalFillLayoutLogic = BI.inherit(BI.Logic, {
* @class Array * @class Array
*/ */
$.extend(Array.prototype, { $.extend(Array.prototype, {
contains: function (o) {
return this.indexOf(o) > -1;
},
/** /**
* 检查指定的值是否在数组中 * 检查指定的值是否在数组中
* @param {Object} o 要检查的值 * @param {Object} o 要检查的值
@ -25048,9 +25051,17 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
addItem: function (item) { addItem: function (item) {
var w = this._addElement(this.options.items.length, item); var w = this._addElement(this.options.items.length, item);
w._mount();
this.options.items.push(item); this.options.items.push(item);
w.element.appendTo(this.$tr); w.element.appendTo(this.$tr);
w._mount();
return w;
},
prependItem: function (item) {
var w = this._addElement(this.options.items.length, item);
this.options.items.unshift(item);
w.element.appendTo(this.$tr);
w._mount();
return w; return w;
}, },
@ -25169,9 +25180,17 @@ BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, {
addItem: function (item) { addItem: function (item) {
var w = this._addElement(this.options.items.length, item); var w = this._addElement(this.options.items.length, item);
w._mount();
this.options.items.push(item); this.options.items.push(item);
w.element.appendTo(this.$tr); w.element.appendTo(this.$tr);
w._mount();
return w;
},
prependItem: function (item) {
var w = this._addElement(this.options.items.length, item);
this.options.items.unshift(item);
w.element.appendTo(this.$tr);
w._mount();
return w; return w;
}, },
@ -25456,9 +25475,17 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
addItem: function (item) { addItem: function (item) {
var w = this._addElement(this.options.items.length, item); var w = this._addElement(this.options.items.length, item);
w._mount();
this.options.items.push(item); this.options.items.push(item);
w.element.appendTo(this.$tr); w.element.appendTo(this.$tr);
w._mount();
return w;
},
prependItem: function (item) {
var w = this._addElement(this.options.items.length, item);
this.options.items.unshift(item);
w.element.appendTo(this.$tr);
w._mount();
return w; return w;
}, },
@ -26038,9 +26065,17 @@ BI.FlexCenterLayout = BI.inherit(BI.Layout, {
addItem: function (item) { addItem: function (item) {
var w = this._addElement(this.options.items.length, item); var w = this._addElement(this.options.items.length, item);
w._mount();
this.options.items.push(item); this.options.items.push(item);
w.element.appendTo(this.$wrapper); w.element.appendTo(this.$wrapper);
w._mount();
return w;
},
prependItem: function (item) {
var w = this._addElement(this.options.items.length, item);
this.options.items.unshift(item);
w.element.appendTo(this.$wrapper);
w._mount();
return w; return w;
}, },
@ -26127,9 +26162,17 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, {
addItem: function (item) { addItem: function (item) {
var w = this._addElement(this.options.items.length, item); var w = this._addElement(this.options.items.length, item);
w._mount();
this.options.items.push(item); this.options.items.push(item);
w.element.appendTo(this.$wrapper); w.element.appendTo(this.$wrapper);
w._mount();
return w;
},
prependItem: function (item) {
var w = this._addElement(this.options.items.length, item);
this.options.items.unshift(item);
w.element.appendTo(this.$wrapper);
w._mount();
return w; return w;
}, },
@ -26216,6 +26259,15 @@ BI.FlexVerticalCenter = BI.inherit(BI.Layout, {
var w = this._addElement(this.options.items.length, item); var w = this._addElement(this.options.items.length, item);
this.options.items.push(item); this.options.items.push(item);
w.element.appendTo(this.$wrapper); w.element.appendTo(this.$wrapper);
w._mount();
return w;
},
prependItem: function (item) {
var w = this._addElement(this.options.items.length, item);
this.options.items.unshift(item);
w.element.appendTo(this.$wrapper);
w._mount();
return w; return w;
}, },

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

@ -164,13 +164,13 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, {
var node; var node;
BI.any(this.buttons, function (i, item) { BI.any(this.buttons, function (i, item) {
if (item.isEnabled()) { if (item.isEnabled()) {
if (item.getValue() === value) { if (BI.isFunction(item.getNodeByValue)) {
node = item;
return true;
} else if (BI.isFunction(item.getNodeByValue)) {
if (node = item.getNodeByValue(value)) { if (node = item.getNodeByValue(value)) {
return true; return true;
} }
} else if (item.attr("value") === value) {
node = item;
return true;
} }
} }
}); });

118
src/base/layer/layer.scroll.js

@ -1,118 +0,0 @@
/**
* guy
* @class BI.ScrollView
* @extends BI.Widget
*/
BI.ScrollView = BI.inherit(BI.Widget, {
_const: {
dropDownHeight: 15,
expandIcon: "column-next-page-h-font",
collapseIcon: "column-pre-page-h-font"
},
_defaultConfig: function() {
return BI.extend(BI.ScrollView.superclass._defaultConfig.apply(this, arguments), {
baseCls:"bi-scroll-view",
scrollHeight: 50,
maxHeight: 300
})
},
_init : function() {
BI.ScrollView.superclass._init.apply(this, arguments);
this.scrollUp = false;
this.scroll = BI.createWidget({
type: "bi.vertical",
cls: "scroll-container",
scrolly: true
})
BI.createWidget({
type: "bi.vertical",
element: this,
scrolly: false,
items: [this.scroll]
})
this.dropdown = BI.createWidget({
type: "bi.icon_button",
height: this._const.dropDownHeight,
cls: "scroll-drop-down-icon " + this._const.expandIcon,
handler: BI.bind(this._dropDownOrUp, this)
})
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.dropdown,
left: 0,
right: 0,
bottom: -1 * this._const.dropDownHeight
}]
})
this.populate(this.options.items);
},
_dropDownOrUp: function(){
if(!this.scrollUp){
var height = this.element.height();
height += this.options.scrollHeight;
height = Math.min(height, this.scroll.element[0].scrollHeight, this.options.maxHeight);
this.element.height(height);
this._checkDropDownState();
} else {
var height = this.element.height();
height -= this.options.scrollHeight;
height = Math.max(height, this.options.height);
this.element.height(height);
this._checkDropDownState();
}
},
_checkDropDownState: function(){
var height = this.element.height();
if(!this._checkScroll() || height >= this.options.maxHeight){
this.scrollUp = true;
this.dropdown.element.removeClass(this._const.expandIcon).addClass(this._const.collapseIcon);
} else if(height <= this.options.height){
this.scrollUp = false;
this.dropdown.element.addClass(this._const.expandIcon);
} else {
this.dropdown.element.addClass(this.scrollUp ? this._const.collapseIcon : this._const.expandIcon);
}
},
_checkScroll: function(){
this.scroll.element.height(this.element.height());
return this.scroll.element[0].scrollHeight > this.scroll.element[0].clientHeight;
},
_checkDropDown: function(){
if(this._checkScroll()){
this.dropdown.visible();
//this.scrollUp = false;
this._checkDropDownState();
} else {
this.dropdown.invisible();
}
},
populate: function(){
this.scroll.populate.apply(this.scroll, arguments);
this.resize();
},
resize: function(){
this.element.height(this.options.height);
BI.nextTick(BI.bind(this._checkDropDown, this));
},
addItem: function(){
this.scroll.addItem.apply(this.scroll, arguments);
BI.nextTick(BI.bind(this._checkDropDown, this));
}
});
$.shortcut("bi.scroll_view", BI.ScrollView);

18
src/base/pager/pager.js

@ -45,10 +45,10 @@ BI.Pager = BI.inherit(BI.Widget, {
var self = this; var self = this;
this.currPage = BI.result(this.options, "curr"); this.currPage = BI.result(this.options, "curr");
//翻页太灵敏 //翻页太灵敏
this._lock = false; // this._lock = false;
this._debouce = BI.debounce(function () { // this._debouce = BI.debounce(function () {
self._lock = false; // self._lock = false;
}, 300); // }, 300);
this._populate(); this._populate();
}, },
@ -184,11 +184,11 @@ BI.Pager = BI.inherit(BI.Widget, {
layouts: o.layouts layouts: o.layouts
}); });
this.button_group.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { this.button_group.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
if (self._lock === true) { // if (self._lock === true) {
return; // return;
} // }
self._lock = true; // self._lock = true;
self._debouce(); // self._debouce();
if (type === BI.Events.CLICK) { if (type === BI.Events.CLICK) {
var v = self.button_group.getValue()[0]; var v = self.button_group.getValue()[0];
switch (v) { switch (v) {

1
src/base/svg/svg.js

@ -17,6 +17,7 @@ BI.Svg = BI.inherit(BI.Widget, {
BI.Svg.superclass._init.apply(this, arguments); BI.Svg.superclass._init.apply(this, arguments);
this.paper = Raphael(this.element[0]); this.paper = Raphael(this.element[0]);
this.element.css("overflow", "hidden");
$(this.paper.canvas).width("100%").height("100%").css({"left": "0", "top": "0"}).appendTo(this.element); $(this.paper.canvas).width("100%").height("100%").css({"left": "0", "top": "0"}).appendTo(this.element);
this.top = this.paper.top; this.top = this.paper.top;

190
src/base/table/table.js

@ -17,9 +17,6 @@ BI.Table = BI.inherit(BI.Widget, {
dynamic: false dynamic: false
}, },
isNeedResize: false,//是否需要调整列宽
isResizeAdapt: true,//是否需要在调整列宽或区域宽度的时候它们自适应变化
isNeedFreeze: false,//是否需要冻结单元格 isNeedFreeze: false,//是否需要冻结单元格
freezeCols: [], //冻结的列号,从0开始,isNeedFreeze为true时生效 freezeCols: [], //冻结的列号,从0开始,isNeedFreeze为true时生效
@ -297,111 +294,6 @@ BI.Table = BI.inherit(BI.Widget, {
return o.columnSize[col] > 1 ? o.columnSize[col] + 1 : o.columnSize[col]; return o.columnSize[col] > 1 ? o.columnSize[col] + 1 : o.columnSize[col];
}); });
if (o.isNeedResize) {
var resizer;
var createResizer = function (size, position) {
var rowSize = self.getCalculateRegionRowSize();
resizer = BI.createWidget({
type: "bi.layout",
cls: "bi-resizer",
width: size.width,
height: rowSize[0] + rowSize[1]
});
BI.createWidget({
type: "bi.absolute",
element: "body",
items: [{
el: resizer,
left: position.left,
top: position.top - rowSize[0]
}]
});
};
var resizeResizer = function (size, position) {
var rowSize = self.getCalculateRegionRowSize();
var columnSize = self.getCalculateRegionColumnSize();
var height = rowSize[0] + rowSize[1];
var sumSize = columnSize[0] + columnSize[1];
if (size.width > sumSize / 5 * 4) {
size.width = sumSize / 5 * 4;
}
if (size.width < 10) {
size.width = 10;
}
resizer.element.css({
"left": position.left + "px",
"width": size.width + "px",
"height": height + "px"
});
};
var stopResizer = function () {
resizer && resizer.destroy();
resizer = null;
};
var handle;
if (o.freezeCols.length > 0 && o.freezeCols.length < o.columnSize.length) {
if (isRight) {
var options = {
handles: "w",
minWidth: 15,
helper: "clone",
start: function (event, ui) {
createResizer(ui.size, ui.position);
self.fireEvent(BI.Table.EVENT_TABLE_BEFORE_REGION_RESIZE);
},
resize: function (e, ui) {
resizeResizer(ui.size, ui.position);
self.fireEvent(BI.Table.EVENT_TABLE_REGION_RESIZE);
e.stopPropagation();
//return false;
},
stop: function (e, ui) {
stopResizer();
if (o.isResizeAdapt) {
var increment = ui.size.width - (BI.sum(self.columnRight) + self.columnRight.length);
o.columnSize[self.columnLeft.length] += increment;
} else {
self.setRegionColumnSize(["fill", ui.size.width]);
}
self._resize();
ui.element.css("left", "");
self.fireEvent(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE);
}
};
self.bottomRight.element.resizable(options);
handle = $(".ui-resizable-handle", this.bottomRight.element).css("top", -1 * headerHeight);
} else {
var options = {
handles: "e",
minWidth: 15,
helper: "clone",
start: function (event, ui) {
createResizer(ui.size, ui.position);
self.fireEvent(BI.Table.EVENT_TABLE_BEFORE_REGION_RESIZE);
},
resize: function (e, ui) {
resizeResizer(ui.size, ui.position);
self.fireEvent(BI.Table.EVENT_TABLE_REGION_RESIZE);
e.stopPropagation();
//return false;
},
stop: function (e, ui) {
stopResizer();
if (o.isResizeAdapt) {
var increment = ui.size.width - (BI.sum(self.columnLeft) + self.columnLeft.length);
o.columnSize[self.columnLeft.length - 1] += increment;
} else {
self.setRegionColumnSize([ui.size.width, "fill"]);
}
self._resize();
self.fireEvent(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE);
}
};
self.bottomLeft.element.resizable(options);
handle = $(".ui-resizable-handle", this.bottomLeft.element).css("top", -1 * headerHeight);
}
}
}
this._resize = function () { this._resize = function () {
if (self.scrollBottomLeft.element.is(":visible")) { if (self.scrollBottomLeft.element.is(":visible")) {
self.scrollBottomLeft.element.css({"overflow-x": "auto"}); self.scrollBottomLeft.element.css({"overflow-x": "auto"});
@ -429,10 +321,6 @@ BI.Table = BI.inherit(BI.Widget, {
self.scrollTopLeft.element[0].scrollLeft = self.scrollBottomLeft.element[0].scrollLeft; self.scrollTopLeft.element[0].scrollLeft = self.scrollBottomLeft.element[0].scrollLeft;
self.scrollTopRight.element[0].scrollLeft = self.scrollBottomRight.element[0].scrollLeft; self.scrollTopRight.element[0].scrollLeft = self.scrollBottomRight.element[0].scrollLeft;
self.scrollBottomLeft.element[0].scrollTop = self.scrollBottomRight.element[0].scrollTop; self.scrollBottomLeft.element[0].scrollTop = self.scrollBottomRight.element[0].scrollTop;
//调整拖拽handle的高度
if (o.isNeedResize) {
handle && handle.css("height", self.bottomLeft.element.height() + headerHeight);
}
} }
}; };
@ -900,70 +788,6 @@ BI.Table = BI.inherit(BI.Widget, {
start || (start = 0); start || (start = 0);
var frag = this._createCells(items, columnSize, BI.range(o.columnSize.length), TDs, Ws, start, o.headerRowSize || o.rowSize); var frag = this._createCells(items, columnSize, BI.range(o.columnSize.length), TDs, Ws, start, o.headerRowSize || o.rowSize);
if (o.isNeedResize === true) {
var tds = TDs[BI.size(TDs) - 1];
BI.each(tds, function (j, td) {
j = j | 0;
var resizer;
var getHeight = function (size, position) {
var rowSize = self.getCalculateRegionRowSize();
if (o.isNeedFreeze === true) {
var tableHeight = self.bottomRightContainer.element.outerHeight();
return size.height + Math.min(rowSize[1], tableHeight);
} else {
var tableHeight = self.tableContainer.element.outerHeight();
var offset = self.tableContainer.element.offset();
var offsetTop = position.top - offset.top;
var height = tableHeight - offsetTop;
height = Math.min(height, rowSize[0] - offsetTop);
return height;
}
};
if (j < BI.size(tds) - 1) {
td.resizable({
handles: "e",
minWidth: 15,
helper: "clone",
start: function (event, ui) {
var height = getHeight(ui.size, ui.position);
resizer = BI.createWidget({
type: "bi.layout",
cls: "bi-resizer",
width: ui.size.width,
height: height
});
BI.createWidget({
type: "bi.absolute",
element: "body",
items: [{
el: resizer,
left: ui.position.left,
top: ui.position.top
}]
});
self.fireEvent(BI.Table.EVENT_TABLE_BEFORE_COLUMN_RESIZE);
},
resize: function (e, ui) {
var height = getHeight(ui.size, ui.position);
resizer.element.css({"width": ui.size.width + "px", "height": height + "px"});
//o.columnSize[start + j] = ui.size.width;
//self.setColumnSize(o.columnSize);
self.fireEvent(BI.Table.EVENT_TABLE_COLUMN_RESIZE);
e.stopPropagation();
//return false;
},
stop: function (e, ui) {
resizer.destroy();
resizer = null;
o.columnSize[start + j] = ui.size.width - 1;
self.setColumnSize(o.columnSize);
self.fireEvent(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE);
}
})
}
})
}
return frag; return frag;
}, },
@ -1355,13 +1179,6 @@ BI.Table = BI.inherit(BI.Widget, {
this.bottomRightContainer.element.width(isRight ? lw : rw); this.bottomRightContainer.element.width(isRight ? lw : rw);
this.scrollTopLeft.element[0].scrollLeft = this.scrollBottomLeft.element[0].scrollLeft; this.scrollTopLeft.element[0].scrollLeft = this.scrollBottomLeft.element[0].scrollLeft;
this.scrollTopRight.element[0].scrollLeft = this.scrollBottomRight.element[0].scrollLeft; this.scrollTopRight.element[0].scrollLeft = this.scrollBottomRight.element[0].scrollLeft;
if (o.isNeedResize && o.isResizeAdapt) {
var leftWidth = BI.sum(o.freezeCols, function (i, col) {
return o.columnSize[col] > 1 ? o.columnSize[col] + 1 : o.columnSize[col];
});
this.partitions.attr("columnSize", isRight ? ['fill', leftWidth] : [leftWidth, 'fill']);
this.partitions.resize();
}
} else { } else {
BI.each(this.colgroupTds, function (i, colgroup) { BI.each(this.colgroupTds, function (i, colgroup) {
var width = colgroup.attr("width") | 0; var width = colgroup.attr("width") | 0;
@ -1823,13 +1640,6 @@ BI.Table = BI.inherit(BI.Widget, {
this.topRightContainer.element.width(isRight ? lw : rw); this.topRightContainer.element.width(isRight ? lw : rw);
this.scrollTopLeft.element[0].scrollLeft = this.scrollBottomLeft.element[0].scrollLeft; this.scrollTopLeft.element[0].scrollLeft = this.scrollBottomLeft.element[0].scrollLeft;
this.scrollTopRight.element[0].scrollLeft = this.scrollBottomRight.element[0].scrollLeft; this.scrollTopRight.element[0].scrollLeft = this.scrollBottomRight.element[0].scrollLeft;
if (o.isNeedResize && o.isResizeAdapt) {
var leftWidth = BI.sum(o.freezeCols, function (i, col) {
return columnSize[col] > 1 ? columnSize[col] + 1 : columnSize[col];
});
this.partitions.attr("columnSize", isRight ? ['fill', leftWidth] : [leftWidth, 'fill']);
this.partitions.resize();
}
} else { } else {
BI.each(this.colgroupTds, function (i, colgroup) { BI.each(this.colgroupTds, function (i, colgroup) {
var width = colgroup.attr("width") | 0; var width = colgroup.attr("width") | 0;

2
src/base/tree/treeview.js

@ -504,4 +504,4 @@ BI.TreeView.EVENT_CHANGE = "EVENT_CHANGE";
BI.TreeView.EVENT_INIT = BI.Events.INIT; BI.TreeView.EVENT_INIT = BI.Events.INIT;
BI.TreeView.EVENT_AFTERINIT = BI.Events.AFTERINIT; BI.TreeView.EVENT_AFTERINIT = BI.Events.AFTERINIT;
$.shortcut("bi.tree", BI.TreeView); $.shortcut("bi.tree_view", BI.TreeView);

2
src/case/table/table.tree.js

@ -327,4 +327,4 @@ BI.extend(BI.TableTree, {
} }
}); });
$.shortcut("bi.table_tree", BI.TableTree); $.shortcut("bi.tree_table", BI.TableTree);

0
src/case/expander/expander.branch.handstand.js → src/case/tree/expander/expander.branch.handstand.js

0
src/case/expander/expander.branch.js → src/case/tree/expander/expander.branch.js

2
src/case/tree/tree.simple.js

@ -18,7 +18,7 @@ BI.SimpleTreeView = BI.inherit(BI.Widget, {
var self = this, o = this.options; var self = this, o = this.options;
this.structure = new BI.Tree(); this.structure = new BI.Tree();
this.tree = BI.createWidget({ this.tree = BI.createWidget({
type: "bi.tree", type: "bi.tree_view",
element: this, element: this,
itemsCreator: function (op, callback) { itemsCreator: function (op, callback) {
var fn = function (items) { var fn = function (items) {

3
src/core/proto/array.js

@ -3,6 +3,9 @@
* @class Array * @class Array
*/ */
$.extend(Array.prototype, { $.extend(Array.prototype, {
contains: function (o) {
return this.indexOf(o) > -1;
},
/** /**
* 检查指定的值是否在数组中 * 检查指定的值是否在数组中
* @param {Object} o 要检查的值 * @param {Object} o 要检查的值

12
src/core/wrapper/layout.js

@ -100,17 +100,17 @@ BI.Layout = BI.inherit(BI.Widget, {
*/ */
addItem: function (item) { addItem: function (item) {
var w = this._addElement(this.options.items.length, item); var w = this._addElement(this.options.items.length, item);
w._mount();
this.options.items.push(item); this.options.items.push(item);
w.element.appendTo(this.element); w.element.appendTo(this.element);
w._mount();
return w; return w;
}, },
prependItem: function (item) { prependItem: function (item) {
var w = this._addElement(this.options.items.length, item); var w = this._addElement(this.options.items.length, item);
w._mount();
this.options.items.unshift(item); this.options.items.unshift(item);
w.element.prependTo(this.element); w.element.prependTo(this.element);
w._mount();
return w; return w;
}, },
@ -122,10 +122,10 @@ BI.Layout = BI.inherit(BI.Widget, {
}, },
prependItems: function (items) { prependItems: function (items) {
var self = this; items = items || [];
BI.each(items, function (i, item) { for (var i = items.length - 1; i >= 0; i--) {
self.prependItem(item); this.prependItem(items[i]);
}) }
}, },
getValue: function () { getValue: function () {

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

@ -109,9 +109,17 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
addItem: function (item) { addItem: function (item) {
var w = this._addElement(this.options.items.length, item); var w = this._addElement(this.options.items.length, item);
w._mount();
this.options.items.push(item); this.options.items.push(item);
w.element.appendTo(this.$tr); w.element.appendTo(this.$tr);
w._mount();
return w;
},
prependItem: function (item) {
var w = this._addElement(this.options.items.length, item);
this.options.items.unshift(item);
w.element.appendTo(this.$tr);
w._mount();
return w; return w;
}, },

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

@ -108,9 +108,17 @@ BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, {
addItem: function (item) { addItem: function (item) {
var w = this._addElement(this.options.items.length, item); var w = this._addElement(this.options.items.length, item);
w._mount();
this.options.items.push(item); this.options.items.push(item);
w.element.appendTo(this.$tr); w.element.appendTo(this.$tr);
w._mount();
return w;
},
prependItem: function (item) {
var w = this._addElement(this.options.items.length, item);
this.options.items.unshift(item);
w.element.appendTo(this.$tr);
w._mount();
return w; return w;
}, },

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

@ -102,9 +102,17 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
addItem: function (item) { addItem: function (item) {
var w = this._addElement(this.options.items.length, item); var w = this._addElement(this.options.items.length, item);
w._mount();
this.options.items.push(item); this.options.items.push(item);
w.element.appendTo(this.$tr); w.element.appendTo(this.$tr);
w._mount();
return w;
},
prependItem: function (item) {
var w = this._addElement(this.options.items.length, item);
this.options.items.unshift(item);
w.element.appendTo(this.$tr);
w._mount();
return w; return w;
}, },

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

@ -42,9 +42,17 @@ BI.FlexCenterLayout = BI.inherit(BI.Layout, {
addItem: function (item) { addItem: function (item) {
var w = this._addElement(this.options.items.length, item); var w = this._addElement(this.options.items.length, item);
w._mount();
this.options.items.push(item); this.options.items.push(item);
w.element.appendTo(this.$wrapper); w.element.appendTo(this.$wrapper);
w._mount();
return w;
},
prependItem: function (item) {
var w = this._addElement(this.options.items.length, item);
this.options.items.unshift(item);
w.element.appendTo(this.$wrapper);
w._mount();
return w; return w;
}, },

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

@ -72,9 +72,17 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, {
addItem: function (item) { addItem: function (item) {
var w = this._addElement(this.options.items.length, item); var w = this._addElement(this.options.items.length, item);
w._mount();
this.options.items.push(item); this.options.items.push(item);
w.element.appendTo(this.$wrapper); w.element.appendTo(this.$wrapper);
w._mount();
return w;
},
prependItem: function (item) {
var w = this._addElement(this.options.items.length, item);
this.options.items.unshift(item);
w.element.appendTo(this.$wrapper);
w._mount();
return w; return w;
}, },

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

@ -72,6 +72,15 @@ BI.FlexVerticalCenter = BI.inherit(BI.Layout, {
var w = this._addElement(this.options.items.length, item); var w = this._addElement(this.options.items.length, item);
this.options.items.push(item); this.options.items.push(item);
w.element.appendTo(this.$wrapper); w.element.appendTo(this.$wrapper);
w._mount();
return w;
},
prependItem: function (item) {
var w = this._addElement(this.options.items.length, item);
this.options.items.unshift(item);
w.element.appendTo(this.$wrapper);
w._mount();
return w; return w;
}, },

6
src/css/base/tree/display.tree.css

@ -5,13 +5,13 @@
color: #808080; color: #808080;
} }
.bi-display-tree .ztree li span.button.switch.center_open { .bi-display-tree .ztree li span.button.switch.center_open {
background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-3.png"); background-image: url("icon/tree-vertical-line-3.png");
} }
.bi-display-tree .ztree li span.button.switch.roots_open { .bi-display-tree .ztree li span.button.switch.roots_open {
background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-2.png"); background-image: url("icon/tree-vertical-line-2.png");
} }
.bi-display-tree .ztree li span.button.switch.bottom_open { .bi-display-tree .ztree li span.button.switch.bottom_open {
background-image: url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-4.png"); background-image: url("icon/tree-vertical-line-4.png");
} }
.bi-display-tree .ztree li a, .bi-display-tree .ztree li a,
.bi-display-tree .ztree li span { .bi-display-tree .ztree li span {

18
src/css/base/view/scrollview.css

@ -1,18 +0,0 @@
/****添加计算宽度的--运算符直接需要space****/
/****** common color(常用颜色,可用于普遍场景) *****/
/**** custom color(自定义颜色,用于特定场景) ****/
.bi-scroll-view .scroll-container {
border-left: 1px solid #d4dadd;
border-right: 1px solid #d4dadd;
border-bottom: 1px solid #d4dadd;
}
.bi-scroll-view .scroll-drop-down-icon {
font-size: 14px;
border-bottom: 1px solid #d4dadd;
border-left: 1px solid #d4dadd;
border-right: 1px solid #d4dadd;
background: #f4f4f4;
}
.bi-scroll-view .scroll-drop-down-icon:active {
background: #d4dadd;
}

230
src/css/normalize.css vendored

@ -1,230 +0,0 @@
/*! normalize.css v1.0.0 | MIT License | git.io/normalize */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section,
summary {
display: block;
}
audio,
canvas,
video {
display: inline-block;
*display: inline;
*zoom: 1;
}
audio:not([controls]) {
display: none;
height: 0;
}
[hidden] {
display: none;
}
html {
font-size: 100%;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
html,
button,
input,
select,
textarea {
font-family: sans-serif;
}
body {
margin: 0;
}
a:focus {
outline: thin dotted;
}
a:active,
a:hover {
outline: 0;
}
h1 {
font-size: 2em;
margin: 0.67em 0;
}
h2 {
font-size: 1.5em;
margin: 0.83em 0;
}
h3 {
font-size: 1.17em;
margin: 1em 0;
}
h4 {
font-size: 1em;
margin: 1.33em 0;
}
h5 {
font-size: .83em;
margin: 1.67em 0;
}
h6 {
font-size: .75em;
margin: 2.33em 0;
}
abbr[title] {
border-bottom: 1px dotted;
}
b,
strong {
font-weight: bold;
}
blockquote {
margin: 1em 40px;
}
dfn {
font-style: italic;
}
mark {
background: #ff0;
color: #000000;
}
p,
pre {
margin: 1em 0;
}
code,
kbd,
pre,
samp {
font-family: monospace, serif;
_font-family: 'courier new', monospace;
font-size: 1em;
}
pre {
white-space: pre;
white-space: pre-wrap;
word-wrap: break-word;
}
q {
quotes: none;
}
q:before,
q:after {
content: '';
content: none;
}
small {
font-size: 75%;
}
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
dl,
menu,
ol,
ul {
margin: 1em 0;
}
dd {
margin: 0 0 0 40px;
}
menu,
ol,
ul {
padding: 0 0 0 40px;
}
nav ul,
nav ol {
list-style: none;
list-style-image: none;
}
img {
border: 0;
-ms-interpolation-mode: bicubic;
}
svg:not(:root) {
overflow: hidden;
}
figure {
margin: 0;
}
form {
margin: 0;
}
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
legend {
border: 0;
padding: 0;
white-space: normal;
*margin-left: -7px;
}
button,
input,
select,
textarea {
font-size: 100%;
margin: 0;
vertical-align: baseline;
*vertical-align: middle;
}
button,
input {
line-height: normal;
}
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button;
cursor: pointer;
*overflow: visible;
}
button[disabled],
input[disabled] {
cursor: default;
}
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box;
padding: 0;
*height: 13px;
*width: 13px;
}
input[type="search"] {
-webkit-appearance: textfield;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
box-sizing: content-box;
}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
textarea {
overflow: auto;
vertical-align: top;
}
table {
border-collapse: collapse;
border-spacing: 0;
}

128
src/css/reset.css

@ -0,0 +1,128 @@
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
display: block;
}
body {
line-height: 1;
}
ol,
ul {
list-style: none;
}
blockquote,
q {
quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}

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

@ -1,30 +0,0 @@
@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;
}
}

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

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

25
src/less/base/timeouttoast/widget.timeouttoast.less

@ -1,25 +0,0 @@
@import "../../bibase";
.bi-timeout-toast {
font-size: @font-size-14;
.border-radius(2px);
background: @color-bi-tip-warning-background;
color: @color-bi-text-warning;
& .cancel-button {
background: @color-bi-background-default;
border: 1px solid @color-bi-border-normal;
color: @color-bi-text-black;
.border-radius(2px);
&:hover {
.opacity(0.8);
}
}
& .retry-button {
background: @color-bi-background-highlight;
.border-radius(2px);
color: @color-bi-text;
&:hover {
.opacity(0.8);
}
}
}

6
src/less/base/tree/display.tree.less

@ -5,15 +5,15 @@
color: @color-bi-text-gray; color: @color-bi-text-gray;
} }
& .ztree li span.button.switch.center_open{ & .ztree li span.button.switch.center_open{
background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-3.png"); background-image:url("icon/tree-vertical-line-3.png");
} }
& .ztree li span.button.switch.roots_open{ & .ztree li span.button.switch.roots_open{
background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-2.png"); background-image:url("icon/tree-vertical-line-2.png");
} }
& .ztree li span.button.switch.bottom_open{ & .ztree li span.button.switch.bottom_open{
background-image:url("${servletURL}?op=resource&resource=/com/fr/bi/web/images/icon/tree-vertical-line-4.png"); background-image:url("icon/tree-vertical-line-4.png");
} }
& .ztree li a, & .ztree li span{ & .ztree li a, & .ztree li span{
cursor: default !important; cursor: default !important;

19
src/less/base/view/scrollview.less

@ -1,19 +0,0 @@
@import "../../bibase";
.bi-scroll-view{
.scroll-container{
border-left: 1px solid @color-bi-split-dark;
border-right: 1px solid @color-bi-split-dark;
border-bottom: 1px solid @color-bi-split-dark;
}
& .scroll-drop-down-icon{
font-size: @font-size-14;
border-bottom: 1px solid @color-bi-split-dark;
border-left: 1px solid @color-bi-split-dark;
border-right: 1px solid @color-bi-split-dark;
background: @color-bi-background-gray;
&:active{
background: @color-bi-background-dark;
}
}
}

231
src/less/normalize.less vendored

@ -1,231 +0,0 @@
/*! normalize.css v1.0.0 | MIT License | git.io/normalize */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section,
summary {
display: block
}
audio,
canvas,
video {
display: inline-block;
*display: inline;
*zoom: 1
}
audio:not([controls]) {
display: none;
height: 0
}
[hidden] {
display: none
}
html {
font-size: 100%;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%
}
html,
button,
input,
select,
textarea {
font-family: sans-serif
}
body {
margin: 0
}
a:focus {
outline: thin dotted
}
a:active,
a:hover {
outline: 0
}
h1 {
font-size: 2em;
margin: .67em 0
}
h2 {
font-size: 1.5em;
margin: .83em 0
}
h3 {
font-size: 1.17em;
margin: 1em 0
}
h4 {
font-size: 1em;
margin: 1.33em 0
}
h5 {
font-size: .83em;
margin: 1.67em 0
}
h6 {
font-size: .75em;
margin: 2.33em 0
}
abbr[title] {
border-bottom: 1px dotted
}
b,
strong {
font-weight: bold
}
blockquote {
margin: 1em 40px
}
dfn {
font-style: italic
}
mark {
background: #ff0;
color: #000
}
p,
pre {
margin: 1em 0
}
code,
kbd,
pre,
samp {
font-family: monospace, serif;
_font-family: 'courier new', monospace;
font-size: 1em
}
pre {
white-space: pre;
white-space: pre-wrap;
word-wrap: break-word
}
q {
quotes: none
}
q:before,
q:after {
content: '';
content: none
}
small {
font-size: 75%
}
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline
}
sup {
top: -0.5em
}
sub {
bottom: -0.25em
}
dl,
menu,
ol,
ul {
margin: 1em 0
}
dd {
margin: 0 0 0 40px
}
menu,
ol,
ul {
padding: 0 0 0 40px
}
nav ul,
nav ol {
list-style: none;
list-style-image: none
}
img {
border: 0;
-ms-interpolation-mode: bicubic
}
svg:not(:root) {
overflow: hidden
}
figure {
margin: 0
}
form {
margin: 0
}
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: .35em .625em .75em
}
legend {
border: 0;
padding: 0;
white-space: normal;
*margin-left: -7px
}
button,
input,
select,
textarea {
font-size: 100%;
margin: 0;
vertical-align: baseline;
*vertical-align: middle
}
button,
input {
line-height: normal
}
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button;
cursor: pointer;
*overflow: visible
}
button[disabled],
input[disabled] {
cursor: default
}
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box;
padding: 0;
*height: 13px;
*width: 13px
}
input[type="search"] {
-webkit-appearance: textfield;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
box-sizing: content-box
}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none
}
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0
}
textarea {
overflow: auto;
vertical-align: top
}
table {
border-collapse: collapse;
border-spacing: 0
}

48
src/less/reset.less

@ -0,0 +1,48 @@
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
Loading…
Cancel
Save