guy 8 years ago
parent
commit
d06e722e3c
  1. 2
      demo/config.js
  2. 26
      demo/js/base/demo.bubble.js
  3. 84
      demo/js/case/demo.calendar.js
  4. 181
      demo/js/config/base.js
  5. 5
      demo/js/config/case.js
  6. 184
      demo/js/config/core.js
  7. 76
      demo/js/config/layout.js
  8. 11
      demo/js/core/abstract/combination/demo.combo.js
  9. 24
      demo/js/core/abstract/demo.button_group.js
  10. 26
      demo/js/core/abstract/demo.button_map.js
  11. 26
      demo/js/core/abstract/demo.button_tree.js
  12. 0
      demo/js/core/layout/demo.absolute.js
  13. 0
      demo/js/core/layout/demo.border.js
  14. 0
      demo/js/core/layout/demo.center.js
  15. 0
      demo/js/core/layout/demo.center_adapt.js
  16. 0
      demo/js/core/layout/demo.float_center.js
  17. 0
      demo/js/core/layout/demo.flow.js
  18. 0
      demo/js/core/layout/demo.grid.js
  19. 0
      demo/js/core/layout/demo.horizontal.js
  20. 0
      demo/js/core/layout/demo.horizontal_adapt.js
  21. 0
      demo/js/core/layout/demo.horizontal_auto.js
  22. 0
      demo/js/core/layout/demo.horizontal_float.js
  23. 0
      demo/js/core/layout/demo.htape.js
  24. 0
      demo/js/core/layout/demo.inline.js
  25. 0
      demo/js/core/layout/demo.left_right_vertical_adapt.js
  26. 0
      demo/js/core/layout/demo.table.js
  27. 0
      demo/js/core/layout/demo.td.js
  28. 0
      demo/js/core/layout/demo.vertical.js
  29. 0
      demo/js/core/layout/demo.vertical_adapt.js
  30. 0
      demo/js/core/layout/demo.vtape.js
  31. 4
      demo/version.js
  32. 315
      dist/base.js
  33. 1227
      dist/case.js
  34. 44
      dist/core.js
  35. 1175
      dist/widget.js
  36. 6
      src/base/combination/group.button.js
  37. 2
      src/base/combination/map.button.js
  38. 192
      src/base/reqloading/loading.request.js
  39. 117
      src/base/timeouttoast/widget.timeouttoast.js
  40. 0
      src/case/combo/editoriconcheckcombo/combo.editoriconcheck.js
  41. 2
      src/case/combo/formulacombo/combo.formula.js
  42. 0
      src/case/combo/formulacombo/popup.formulacombo.js
  43. 0
      src/case/combo/formulacombo/trigger.formulacombo.js
  44. 0
      src/case/combo/iconcombo/combo.icon.js
  45. 0
      src/case/combo/iconcombo/popup.iconcombo.js
  46. 0
      src/case/combo/iconcombo/trigger.iconcombo.js
  47. 0
      src/case/combo/staticcombo/combo.static.js
  48. 0
      src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js
  49. 0
      src/case/combo/textvaluecheckcombo/combo.textvaluechecksmall.js
  50. 0
      src/case/combo/textvaluecheckcombo/popup.textvaluecheck.js
  51. 0
      src/case/combo/textvaluecombo/combo.textvalue.js
  52. 0
      src/case/combo/textvaluecombo/combo.textvaluesmall.js
  53. 0
      src/case/combo/textvaluecombo/popup.textvalue.js
  54. 0
      src/case/combo/textvaluedownlistcombo/combo.textvaluedownlist.js
  55. 0
      src/case/combo/textvaluedownlistcombo/trigger.textvaluedownlist.js
  56. 44
      src/core/controller/controller.bubbles.js

2
demo/config.js

@ -1 +1 @@
Demo.CONFIG = Demo.LAYOUT_CONFIG.concat(Demo.BASE_CONFIG).concat(Demo.CASE_CONFIG).concat(Demo.WIDGET_CONFIG).concat(Demo.COMPONENT_CONFIG);
Demo.CONFIG = Demo.CORE_CONFIG.concat(Demo.BASE_CONFIG).concat(Demo.CASE_CONFIG).concat(Demo.WIDGET_CONFIG).concat(Demo.COMPONENT_CONFIG);

26
demo/js/base/demo.bubble.js

@ -3,22 +3,29 @@ Demo.Bubble = BI.inherit(BI.Widget, {
baseCls: "demo-bubble"
},
render: function () {
var btns = [];
var items = [
{
el: {
ref: function (_ref) {
btns.push(_ref);
},
type: 'bi.button',
text: 'bubble测试',
height : 30,
handler: function(){
height: 30,
handler: function () {
BI.Bubbles.show("singleBubble1", "bubble测试", this);
}
}
}, {
el: {
ref: function (_ref) {
btns.push(_ref);
},
type: 'bi.button',
text: 'bubble测试(居中显示)',
height : 30,
handler: function(){
height: 30,
handler: function () {
BI.Bubbles.show("singleBubble2", "bubble测试", this, {
offsetStyle: "center"
});
@ -26,10 +33,13 @@ Demo.Bubble = BI.inherit(BI.Widget, {
}
}, {
el: {
ref: function (_ref) {
btns.push(_ref);
},
type: 'bi.button',
text: 'bubble测试(右边显示)',
height : 30,
handler: function(){
height: 30,
handler: function () {
BI.Bubbles.show("singleBubble3", "bubble测试", this, {
offsetStyle: "right"
});
@ -39,8 +49,8 @@ Demo.Bubble = BI.inherit(BI.Widget, {
];
return {
type: "bi.left",
vgap : 200,
hgap : 20,
vgap: 200,
hgap: 20,
items: items
}
}

84
demo/js/case/demo.calendar.js

@ -0,0 +1,84 @@
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
_createNav: function(v){
var m = this.MONTH, y = this.YEAR;
m += v;
while(m < 0){
y--;
m += 12;
}
while(m > 11){
y++;
m -= 12;
}
var calendar = BI.createWidget({
type: "bi.calendar",
logic: {
dynamic: false
},
year: y,
month: m,
day: this.DAY
})
calendar.setValue(this.selectedTime);
return calendar;
},
_stringfyTimeObject: function(timeOb){
return timeOb.year + "-" + (timeOb.month + 1) + "-" + timeOb.day;
},
render: function () {
var self = this, d = new Date();
this.YEAR = d.getFullYear();
this.MONTH = d.getMonth();
this.DAY = d.getDate();
this.selectedTime = {
year: this.YEAR,
month: this.MONTH,
day: this.DAY
};
var tip = BI.createWidget({
type: "bi.label"
});
var nav = BI.createWidget({
type: "bi.navigation",
element: this,
tab: {
height: 30,
items: [{
once: false,
text: "后退",
value: -1,
cls: "mvc-button layout-bg3"
},tip, {
once: false,
text: "前进",
value: 1,
cls: "mvc-button layout-bg4"
}]
},
cardCreator: BI.bind(this._createNav, this),
afterCardCreated: function(){
},
afterCardShow: function(){
this.setValue(self.selectedTime);
}
})
nav.on(BI.Navigation.EVENT_CHANGE, function(){
self.selectedTime = nav.getValue();
tip.setText(self._stringfyTimeObject(self.selectedTime));
});
tip.setText(this._stringfyTimeObject(this.selectedTime));
}
});
$.shortcut("demo.calendar", Demo.Func);

181
demo/js/config/base.js

@ -1,7 +1,6 @@
Demo.BASE_CONFIG = [{
id: 2,
text: "基础控件",
open: true,
}, {
pId: 2,
text: "bi.label",
@ -66,134 +65,52 @@ Demo.BASE_CONFIG = [{
pId: 202,
text: "bi.formula_editor",
value: "demo.formula_editor"
},
{
pId: 2,
id: 5,
text: "组合控件"
}, {
pId: 2,
id: 8,
text: "树控件"
}, {
pId: 2,
id: 7,
text: "按钮"
}, {
pId: 2,
id: 9,
text: "listitem"
}, {
pId: 2,
text: "bi.canvas",
value: "demo.canvas"
}, {
pId: 2,
text: "bi.collection",
value: "demo.collection"
}, {
pId: 2,
text: "bi.farbtastic",
value: "demo.farbtastic"
}, {
pId: 2,
text: "bi.message",
value: "demo.message"
}, {
pId: 2,
text: "bi.grid_view",
value: "demo.grid_view"
}, {
pId: 2,
id: 6,
text: "弹出层"
}, {
pId: 2,
text: "bi.pager",
value: "demo.pager"
}, {
pId: 2,
text: "bi.svg",
value: "demo.svg"
}, {
pId: 2,
text: "bi.table",
value: "demo.table"
}, {
pId: 5,
text: "bi.combo",
value: "demo.combo"
}, {
pId: 5,
text: "bi.expander",
value: "demo.expander"
}, {
pId: 5,
text: "bi.group_button",
value: "demo.group_button"
}, {
pId: 5,
text: "bi.group_combo",
value: "demo.group_combo"
}, {
pId: 5,
text: "bi.loader",
value: "demo.loader"
}, {
pId: 5,
text: "bi.navigation",
value: "demo.navigation"
}, {
pId: 5,
text: "bi.searcher",
value: "demo.searcher"
}, {
pId: 5,
text: "bi.switcher",
value: "demo.switcher"
}, {
pId: 5,
text: "bi.tab",
value: "demo.tab"
}, {
pId: 5,
text: "bi.tree_button",
value: "demo.tree_button"
}, {
pId: 6,
text: "bi.layer_float_box",
value: "demo.layer_float_box"
}, {
pId: 6,
text: "bi.layer_popup",
value: "demo.layer_popup"
}, {
pId: 6,
text: "bi.layer_scroll",
value: "demo.layer_scroll"
}, {
pId: 6,
text: "bi.layer_searcher",
value: "demo.layer_searcher"
}, {
pId: 8,
text: "bi.treeview",
value: "demo.treeview"
}, {
pId: 8,
text: "bi.synctree",
value: "demo.synctree"
}, {
pId: 8,
text: "bi.parttree",
value: "demo.parttree"
}, {
pId: 8,
text: "bi.customtree",
value: "demo.customtree"
}, {
pId: 9,
text: "bi.list_items",
value: "demo.list_items"
},];
}, {
pId: 2,
id: 203,
text: "树控件"
}, {
pId: 203,
text: "bi.treeview",
value: "demo.treeview"
}, {
pId: 203,
text: "bi.synctree",
value: "demo.synctree"
}, {
pId: 203,
text: "bi.parttree",
value: "demo.parttree"
}, {
pId: 2,
id: 204,
text: "表格"
}, {
pId: 204,
text: "bi.table_view",
value: "demo.table_view"
}, {
pId: 204,
text: "bi.table_grid",
value: "demo.table_grid"
}, {
pId: 204,
text: "bi.table_collection",
value: "demo.table_collection"
}, {
pId: 2,
text: "bi.canvas",
value: "demo.canvas"
}, {
pId: 2,
text: "bi.farbtastic",
value: "demo.farbtastic"
}, {
pId: 2,
text: "bi.pager",
value: "demo.pager"
}, {
pId: 2,
text: "bi.svg",
value: "demo.svg"
}];

5
demo/js/config/case.js

@ -1,7 +1,10 @@
Demo.CASE_CONFIG = [{
id: 3,
text: "实例控件"
text: "实例控件",
open: true,
}, {
},{
pId: 3,
text: "bi.calendar",
value: "demo.calendar"

184
demo/js/config/core.js

@ -0,0 +1,184 @@
Demo.CORE_CONFIG = [{
id: 1,
text: "核心控件",
}, {
id: 101,
pId: 1,
text: "布局"
}, {
pId: 101,
text: "bi.center_adapt",
value: "demo.center_adapt"
}, {
pId: 101,
text: "bi.vertical_adapt",
value: "demo.vertical_adapt"
}, {
pId: 101,
text: "bi.horizontal_adapt",
value: "demo.horizontal_adapt"
}, {
pId: 101,
text: "bi.horizontal_auto",
value: "demo.horizontal_auto"
}, {
pId: 101,
text: "bi.horizontal_float",
value: "demo.horizontal_float"
}, {
pId: 101,
text: "bi.left_right_vertical_adapt",
value: "demo.left_right_vertical_adapt"
}, {
pId: 101,
text: "bi.center",
value: "demo.center_layout"
}, {
pId: 101,
text: "bi.float_center",
value: "demo.float_center"
}, {
pId: 101,
text: "bi.vertical",
value: "demo.vertical"
}, {
pId: 101,
text: "bi.horizontal",
value: "demo.horizontal"
}, {
pId: 101,
text: "bi.border",
value: "demo.border"
}, {
pId: 101,
text: "bi.left, bi.right",
value: "demo.flow"
}, {
pId: 101,
text: "bi.inline",
value: "demo.inline"
}, {
pId: 101,
text: "bi.htape",
value: "demo.htape"
}, {
pId: 101,
text: "bi.vtape",
value: "demo.vtape"
}, {
pId: 101,
text: "bi.grid",
value: "demo.grid"
}, {
pId: 101,
text: "bi.table",
value: "demo.table_layout"
}, {
pId: 101,
text: "bi.td",
value: "demo.td"
}, {
pId: 1,
id: 102,
text: "抽象控件"
}, {
pId: 102,
text: "bi.button_group",
value: "demo.button_group"
}, {
pId: 102,
text: "bi.button_tree",
value: "demo.button_tree"
}, {
pId: 102,
text: "bi.button_map",
value: "demo.button_map"
}, {
pId: 102,
id: 10201,
text: "组合控件"
}, {
pId: 10201,
text: "bi.combo",
value: "demo.combo"
}, {
pId: 10201,
text: "bi.expander",
value: "demo.expander"
}, {
pId: 10201,
text: "bi.group_combo",
value: "demo.group_combo"
}, {
pId: 10201,
text: "bi.loader",
value: "demo.loader"
}, {
pId: 10201,
text: "bi.navigation",
value: "demo.navigation"
}, {
pId: 10201,
text: "bi.searcher",
value: "demo.searcher"
}, {
pId: 10201,
text: "bi.switcher",
value: "demo.switcher"
}, {
pId: 10201,
text: "bi.tab",
value: "demo.tab"
}, {
pId: 102,
id: 10202,
text: "弹出层"
}, {
pId: 10202,
text: "bi.layer_float_box",
value: "demo.layer_float_box"
}, {
pId: 10202,
text: "bi.layer_popup",
value: "demo.layer_popup"
}, {
pId: 10202,
text: "bi.layer_scroll",
value: "demo.layer_scroll"
}, {
pId: 10202,
text: "bi.layer_searcher",
value: "demo.layer_searcher"
}, {
pId: 102,
text: "bi.customtree",
value: "demo.customtree"
}, {
pId: 102,
text: "bi.grid_view",
value: "demo.grid_view"
}, {
pId: 102,
text: "bi.collection",
value: "demo.collection"
}, {
pId: 1,
text: "widget",
value: "demo.widget"
}, {
pId: 1,
text: "single",
value: "demo.single"
}, {
pId: 1,
text: "BasicButton",
value: "demo.basic_button"
}, {
pId: 1,
text: "NodeButton",
value: "demo.node_button"
}, {
pId: 1,
text: "pane",
value: "demo.pane"
}];

76
demo/js/config/layout.js

@ -1,76 +0,0 @@
Demo.LAYOUT_CONFIG = [{
id: 1,
text: "布局"
}, {
pId: 1,
text: "bi.center_adapt",
value: "demo.center_adapt"
}, {
pId: 1,
text: "bi.vertical_adapt",
value: "demo.vertical_adapt"
}, {
pId: 1,
text: "bi.horizontal_adapt",
value: "demo.horizontal_adapt"
}, {
pId: 1,
text: "bi.horizontal_auto",
value: "demo.horizontal_auto"
}, {
pId: 1,
text: "bi.horizontal_float",
value: "demo.horizontal_float"
}, {
pId: 1,
text: "bi.left_right_vertical_adapt",
value: "demo.left_right_vertical_adapt"
}, {
pId: 1,
text: "bi.center",
value: "demo.center_layout"
}, {
pId: 1,
text: "bi.float_center",
value: "demo.float_center"
}, {
pId: 1,
text: "bi.vertical",
value: "demo.vertical"
}, {
pId: 1,
text: "bi.horizontal",
value: "demo.horizontal"
}, {
pId: 1,
text: "bi.border",
value: "demo.border"
}, {
pId: 1,
text: "bi.left, bi.right",
value: "demo.flow"
}, {
pId: 1,
text: "bi.inline",
value: "demo.inline"
}, {
pId: 1,
text: "bi.htape",
value: "demo.htape"
}, {
pId: 1,
text: "bi.vtape",
value: "demo.vtape"
}, {
pId: 1,
text: "bi.grid",
value: "demo.grid"
}, {
pId: 1,
text: "bi.table",
value: "demo.table_layout"
}, {
pId: 1,
text: "bi.td",
value: "demo.td"
}];

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

@ -0,0 +1,11 @@
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
return {
type: "bi.layout",
}
}
});
$.shortcut("demo.combo", Demo.Func);

24
demo/js/core/abstract/demo.button_group.js

@ -0,0 +1,24 @@
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
return {
type: "bi.button_group",
chooseType: BI.ButtonGroup.CHOOSE_TYPE_NONE,
layouts: [{
type: "bi.vertical"
}, {
type: "bi.center_adapt",
}],
items: [{
type: "bi.label",
text: "button_group是一类具有相同属性或相似属性的抽象, 本案例实现的是布局的嵌套(vertical布局下内嵌center_adapt布局)"
}, {
type: "bi.button",
text: "1"
}]
}
}
});
$.shortcut("demo.button_group", Demo.Func);

26
demo/js/core/abstract/demo.button_map.js

@ -0,0 +1,26 @@
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
return {
type: "bi.button_map",
chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
layouts: [{
type: "bi.vertical"
}, {
type: "bi.center_adapt",
}],
items: [{
type: "bi.label",
text: "0",
value: 0
}, {
type: "bi.button",
text: "1",
value: 1
}]
}
}
});
$.shortcut("demo.button_map", Demo.Func);

26
demo/js/core/abstract/demo.button_tree.js

@ -0,0 +1,26 @@
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
return {
type: "bi.button_tree",
chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
layouts: [{
type: "bi.vertical"
}, {
type: "bi.center_adapt",
}],
items: [{
type: "bi.label",
text: "0",
value: 0
}, {
type: "bi.button",
text: "1",
value: 1
}]
}
}
});
$.shortcut("demo.button_tree", Demo.Func);

0
demo/js/layout/demo.absolute.js → demo/js/core/layout/demo.absolute.js

0
demo/js/layout/demo.border.js → demo/js/core/layout/demo.border.js

0
demo/js/layout/demo.center.js → demo/js/core/layout/demo.center.js

0
demo/js/layout/demo.center_adapt.js → demo/js/core/layout/demo.center_adapt.js

0
demo/js/layout/demo.float_center.js → demo/js/core/layout/demo.float_center.js

0
demo/js/layout/demo.flow.js → demo/js/core/layout/demo.flow.js

0
demo/js/layout/demo.grid.js → demo/js/core/layout/demo.grid.js

0
demo/js/layout/demo.horizontal.js → demo/js/core/layout/demo.horizontal.js

0
demo/js/layout/demo.horizontal_adapt.js → demo/js/core/layout/demo.horizontal_adapt.js

0
demo/js/layout/demo.horizontal_auto.js → demo/js/core/layout/demo.horizontal_auto.js

0
demo/js/layout/demo.horizontal_float.js → demo/js/core/layout/demo.horizontal_float.js

0
demo/js/layout/demo.htape.js → demo/js/core/layout/demo.htape.js

0
demo/js/layout/demo.inline.js → demo/js/core/layout/demo.inline.js

0
demo/js/layout/demo.left_right_vertical_adapt.js → demo/js/core/layout/demo.left_right_vertical_adapt.js

0
demo/js/layout/demo.table.js → demo/js/core/layout/demo.table.js

0
demo/js/layout/demo.td.js → demo/js/core/layout/demo.td.js

0
demo/js/layout/demo.vertical.js → demo/js/core/layout/demo.vertical.js

0
demo/js/layout/demo.vertical_adapt.js → demo/js/core/layout/demo.vertical_adapt.js

0
demo/js/layout/demo.vtape.js → demo/js/core/layout/demo.vtape.js

4
demo/version.js

@ -1,3 +1,7 @@
Demo = {
version: 1.0
};
BI.i18n = {
"BI-Basic_OK": "确定"
};

315
dist/base.js vendored

@ -20660,11 +20660,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
return BI.extend(BI.ButtonGroup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-button-group",
behaviors: {},
items: [
{
el: {type: "bi.text_button", text: "", value: ""}
}
],
items: [],
chooseType: BI.Selection.Single,
layouts: [{
type: "bi.center",
@ -21169,7 +21165,7 @@ BI.ButtonMap = BI.inherit(BI.ButtonTree, {
var buttons = BI.createWidgets(BI.createItems(items, {type: "bi.text_button", once: o.chooseType === 0}));
var keys = BI.map(items, function (i, item) {
item = BI.stripEL(item);
if (!(item.id || item.value)) {
if (!(BI.isKey(item.id) || BI.isKey(item.value))) {
throw new Error("item必须包含id或value属性");
}
return item.id || item.value;
@ -26712,197 +26708,6 @@ BI.Pager = BI.inherit(BI.Widget, {
BI.Pager.EVENT_CHANGE = "EVENT_CHANGE";
BI.Pager.EVENT_AFTER_POPULATE = "EVENT_AFTER_POPULATE";
$.shortcut("bi.pager", BI.Pager);/**
* Created by Young's on 2016/8/17.
* 加载面板一般只用于 requestAsync
*/
BI.RequstLoading = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.RequstLoading.superclass._defaultConfig.apply(this, arguments), {});
},
_init: function () {
BI.RequstLoading.superclass._init.apply(this, arguments);
var self = this, o = this.options;
var mask = BI.Maskers.create(BI.RequstLoading.MASK_ID);
this.callback = o.callback;
this.paneTab = BI.createWidget({
type: "bi.tab",
cardCreator: BI.bind(this._cardCreator, this),
defaultShowIndex: BI.RequstLoading.ERROR,
width: 400,
height: 300
});
var tempIcon = BI.createWidget({
type: "bi.icon_button",
cls: "data-link-test-fail-icon",
width: 0,
height: 0
});
BI.createWidget({
type: "bi.absolute",
element: $('body'),
items: [{
el: tempIcon,
bottom: 0
}]
});
BI.createWidget({
type: "bi.absolute",
element: mask,
cls: "bi-request-loading",
items: [{
el: {
type: "bi.layout",
cls: "mask-pane"
},
top: 0,
left: 0,
bottom: 0,
right: 0
}, {
el: {
type: "bi.center_adapt",
items: [this.paneTab]
},
top: 0,
left: 0,
right: 0,
bottom: 0
}]
});
},
_cardCreator: function (v) {
var self = this;
var cancel = BI.createWidget({
type: "bi.button",
text: BI.i18nText("BI-Basic_Cancel"),
title: BI.i18nText("BI-Basic_Cancel"),
level: "ignore",
height: 28,
width: 90,
handler: function () {
BI.Maskers.hide(BI.RequstLoading.MASK_ID);
}
});
var retry = BI.createWidget({
type: "bi.button",
text: BI.i18nText("BI-Basic_Retry"),
title: BI.i18nText("BI-Basic_Retry"),
level: "common",
height: 28,
width: 90,
handler: function () {
self.paneTab.setSelect(BI.RequstLoading.LOADING);
self.callback();
}
});
switch (v) {
case BI.RequstLoading.LOADING:
return BI.createWidget({
type: "bi.vertical",
items: [{
type: "bi.center_adapt",
cls: "loading-bar-icon",
items: [{
type: "bi.icon",
width: 208,
height: 15
}]
}, {
type: "bi.label",
cls: "loading-comment",
text: BI.i18nText("BI-Basic_Loading"),
height: 30
}],
width: 208,
height: 200,
vgap: 10
});
case BI.RequstLoading.LOADING_TIMEOUT:
return BI.createWidget({
type: "bi.vertical",
items: [{
type: "bi.center_adapt",
cls: "loading-bar-icon",
items: [{
type: "bi.icon",
width: 208,
height: 15
}]
}, {
type: "bi.label",
cls: "loading-comment",
text: BI.i18nText("BI-Basic_Loading"),
height: 30
}, {
type: "bi.label",
text: BI.i18nText("BI-Request_Time_Out_Toast_Tip"),
cls: "load-timeout-warning"
}, {
type: "bi.left_right_vertical_adapt",
items: {
left: [cancel],
right: [retry]
},
height: 30,
llgap: 100,
rrgap: 100
}],
vgap: 10
});
case BI.RequstLoading.ERROR:
return BI.createWidget({
type: "bi.vertical",
items: [{
type: "bi.center_adapt",
cls: "data-link-test-fail-icon",
items: [{
type: "bi.icon",
width: 126,
height: 126
}]
}, {
type: "bi.label",
text: BI.i18nText("BI-Connection_Lost"),
cls: "load-fail-comment"
}, {
type: "bi.left_right_vertical_adapt",
items: {
left: [cancel],
right: [retry]
},
height: 30,
llgap: 100,
rrgap: 100
}],
vgap: 20
});
}
},
showLoading: function () {
BI.Maskers.show(BI.RequstLoading.MASK_ID);
this.paneTab.setSelect(BI.RequstLoading.LOADING);
},
showError: function () {
BI.Maskers.show(BI.RequstLoading.MASK_ID);
this.paneTab.setSelect(BI.RequstLoading.ERROR);
},
setCallback: function (callback) {
this.callback = callback;
}
});
BI.extend(BI.RequstLoading, {
MASK_ID: "___request__loading___",
LOADING: 1,
LOADING_TIMEOUT: 2,
ERROR: 3
});
$.shortcut("bi.request_loading", BI.RequstLoading);/**
* 超链接
*
* Created by GUY on 2015/9/9.
@ -35707,122 +35512,6 @@ BI.ResizableTable = BI.inherit(BI.Widget, {
});
$.shortcut("bi.resizable_table", BI.ResizableTable);/**
* 组件请求数据超时提示
* Created by Young's on 2017/2/4.
*/
BI.TimeoutToast = BI.inherit(BI.Tip, {
_defaultConfig: function () {
return BI.extend(BI.TimeoutToast.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-timeout-toast"
});
},
_init: function () {
BI.TimeoutToast.superclass._init.apply(this, arguments);
var self = this;
this.requests = [];
this.toast = BI.createWidget({
type: "bi.vertical_adapt",
element: this,
items: [{
type: "bi.label",
text: BI.i18nText("BI-Request_Time_Out_Toast_Tip")
}, {
type: "bi.text_button",
cls: "cancel-button",
width: 60,
height: 22,
text: BI.i18nText("BI-Basic_Cancel"),
title: BI.i18nText("BI-Basic_Cancel"),
handler: function () {
self.cancelAllRequests();
}
}, {
type: "bi.text_button",
cls: "retry-button",
width: 60,
height: 22,
text: BI.i18nText("BI-Basic_Retry"),
title: BI.i18nText("BI-Basic_Retry"),
handler: function () {
self.toast.element.slideUp(500);
self._retryAll();
}
}, {
type: "bi.icon_button",
cls: "close-font",
width: 20,
height: 20,
title: BI.i18nText("BI-Basic_Close"),
handler: function () {
self.toast.element.slideUp(500);
}
}],
width: 520,
height: 30,
hgap: 2
});
BI.createWidget({
type: "bi.absolute",
element: $("body"),
items: [{
el: this.toast,
left: "50%",
top: 0
}]
});
this.toast.element.css({"margin-left": -1 * this.toast.element.outerWidth() / 2});
this.toast.setVisible(false);
},
_retryAll: function () {
var self = this;
var clonedRequests = BI.deepClone(this.requests);
this.requests = [];
BI.each(clonedRequests, function (i, options) {
BI.isFunction(self.callback) && self.callback(options);
});
},
cancelAllRequests: function () {
this.toast.element.slideUp(500);
BI.each(this.requests, function (i, reqArgs) {
if (BI.isNotNull(reqArgs) && BI.isFunction(reqArgs.complete)) {
reqArgs.complete();
}
});
this.requests = [];
},
setCallback: function (callback) {
this.callback = callback;
},
addReq: function (options) {
var self = this;
if (this.requests.length === 0) {
setTimeout(function () {
if (self.requests.contains(options)) {
self.toast.element.slideDown(500);
}
}, 5 * 60 * 1000); //5 min
}
this.requests.push(options);
},
removeReq: function (options) {
BI.remove(this.requests, options);
if (this.requests.length === 0) {
this.toast.element.slideUp(500);
}
},
hasReq: function (options) {
return this.requests.contains(options);
}
});
$.shortcut("bi.timeout_toast", BI.TimeoutToast);/**
*
* 自定义树
*

1227
dist/case.js vendored

File diff suppressed because it is too large Load Diff

44
dist/core.js vendored

@ -20404,16 +20404,7 @@ BI.BubblesController = BI.inherit(BI.Controller, {
});
},
hide: function (name, callback) {
if (!this.has(name)) {
return this;
}
this.get(name).element.hide(0, callback);
this.get(name).invisible();
return this;
},
_getOffsetLeft: function(name, context, offsetStyle){
_getOffsetLeft: function (name, context, offsetStyle) {
var left = 0;
if ("center" === offsetStyle) {
left = context.element.offset().left + (context.element.bounds().width - this.get(name).element.bounds().width) / 2;
@ -20432,7 +20423,7 @@ BI.BubblesController = BI.inherit(BI.Controller, {
return context.element.offset().left;
},
_getOffsetTop: function(name, context, offsetStyle){
_getOffsetTop: function (name, context, offsetStyle) {
var top = 0;
if ("center" === offsetStyle) {
top = context.element.offset().top + (context.element.bounds().height - this.get(name).element.bounds().height) / 2;
@ -20450,25 +20441,25 @@ BI.BubblesController = BI.inherit(BI.Controller, {
return context.element.offset().top;
},
_getLeftPosition: function(name, context, offsetStyle){
_getLeftPosition: function (name, context, offsetStyle) {
var position = $.getLeftPosition(context, this.get(name));
position.top = this._getOffsetTop(name, context, offsetStyle);
return position;
},
_getBottomPosition: function(name, context, offsetStyle){
_getBottomPosition: function (name, context, offsetStyle) {
var position = $.getBottomPosition(context, this.get(name));
position.left = this._getOffsetLeft(name, context, offsetStyle);
return position;
},
_getTopPosition: function(name, context, offsetStyle){
_getTopPosition: function (name, context, offsetStyle) {
var position = $.getTopPosition(context, this.get(name));
position.left = this._getOffsetLeft(name, context, offsetStyle);
return position;
},
_getRightPosition: function(name, context, offsetStyle){
_getRightPosition: function (name, context, offsetStyle) {
var position = $.getRightPosition(context, this.get(name));
position.top = this._getOffsetTop(name, context, offsetStyle);
return position;
@ -20498,8 +20489,8 @@ BI.BubblesController = BI.inherit(BI.Controller, {
items: [{
el: this.storeBubbles[name]["top"]
}]
})
this.set(name, this.storeBubbles[name]["top"])
});
this.set(name, this.storeBubbles[name]["top"]);
var position = this._getTopPosition(name, context, offsetStyle);
this.get(name).element.css({left: position.left, top: position.top});
this.get(name).invisible();
@ -20513,7 +20504,7 @@ BI.BubblesController = BI.inherit(BI.Controller, {
items: [{
el: this.storeBubbles[name]["left"]
}]
})
});
this.set(name, this.storeBubbles[name]["left"]);
var position = this._getLeftPosition(name, context, offsetStyle);
this.get(name).element.css({left: position.left, top: position.top});
@ -20528,8 +20519,8 @@ BI.BubblesController = BI.inherit(BI.Controller, {
items: [{
el: this.storeBubbles[name]["right"]
}]
})
this.set(name, this.storeBubbles[name]["right"])
});
this.set(name, this.storeBubbles[name]["right"]);
var position = this._getRightPosition(name, context, offsetStyle);
this.get(name).element.css({left: position.left, top: position.top});
this.get(name).invisible();
@ -20556,6 +20547,14 @@ BI.BubblesController = BI.inherit(BI.Controller, {
return this;
},
hide: function (name) {
if (!this.has(name)) {
return this;
}
this.get(name).invisible();
return this;
},
add: function (name, bubble) {
if (this.has(name)) {
return this;
@ -20580,7 +20579,10 @@ BI.BubblesController = BI.inherit(BI.Controller, {
if (!this.has(name)) {
return this;
}
this.bubblesManager[name].destroy();
BI.each(this.storeBubbles[name], function (dir, bubble) {
bubble.destroy();
});
delete this.storeBubbles[name];
delete this.bubblesManager[name];
return this;
}

1175
dist/widget.js vendored

File diff suppressed because it is too large Load Diff

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

@ -9,11 +9,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
return BI.extend(BI.ButtonGroup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-button-group",
behaviors: {},
items: [
{
el: {type: "bi.text_button", text: "", value: ""}
}
],
items: [],
chooseType: BI.Selection.Single,
layouts: [{
type: "bi.center",

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

@ -22,7 +22,7 @@ BI.ButtonMap = BI.inherit(BI.ButtonTree, {
var buttons = BI.createWidgets(BI.createItems(items, {type: "bi.text_button", once: o.chooseType === 0}));
var keys = BI.map(items, function (i, item) {
item = BI.stripEL(item);
if (!(item.id || item.value)) {
if (!(BI.isKey(item.id) || BI.isKey(item.value))) {
throw new Error("item必须包含id或value属性");
}
return item.id || item.value;

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

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

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

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

0
src/widget/base/combo/editoriconcheckcombo/combo.editoriconcheck.js → src/case/combo/editoriconcheckcombo/combo.editoriconcheck.js

2
src/widget/base/combo/formulacombo/combo.formula.js → src/case/combo/formulacombo/combo.formula.js

@ -45,7 +45,7 @@ BI.FormulaCombo = BI.inherit(BI.Widget, {
element: this,
isNeedAdjustHeight: true,
isNeedAdjustWidth: false,
adjustLength: this._constant.CONDITION_TYPE_COMBO_ADJUST,
adjustLength: this._constant.ADJUST_LENGTH,
el: this.input,
popup: {
el: {

0
src/widget/base/combo/formulacombo/popup.formulacombo.js → src/case/combo/formulacombo/popup.formulacombo.js

0
src/widget/base/combo/formulacombo/trigger.formulacombo.js → src/case/combo/formulacombo/trigger.formulacombo.js

0
src/widget/base/combo/iconcombo/combo.icon.js → src/case/combo/iconcombo/combo.icon.js

0
src/widget/base/combo/iconcombo/popup.iconcombo.js → src/case/combo/iconcombo/popup.iconcombo.js

0
src/widget/base/combo/iconcombo/trigger.iconcombo.js → src/case/combo/iconcombo/trigger.iconcombo.js

0
src/widget/base/combo/staticcombo/combo.static.js → src/case/combo/staticcombo/combo.static.js

0
src/widget/base/combo/textvaluecheckcombo/combo.textvaluecheck.js → src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js

0
src/widget/base/combo/textvaluecheckcombo/combo.textvaluechecksmall.js → src/case/combo/textvaluecheckcombo/combo.textvaluechecksmall.js

0
src/widget/base/combo/textvaluecheckcombo/popup.textvaluecheck.js → src/case/combo/textvaluecheckcombo/popup.textvaluecheck.js

0
src/widget/base/combo/textvaluecombo/combo.textvalue.js → src/case/combo/textvaluecombo/combo.textvalue.js

0
src/widget/base/combo/textvaluecombo/combo.textvaluesmall.js → src/case/combo/textvaluecombo/combo.textvaluesmall.js

0
src/widget/base/combo/textvaluecombo/popup.textvalue.js → src/case/combo/textvaluecombo/popup.textvalue.js

0
src/widget/base/combo/textvaluedownlistcombo/combo.textvaluedownlist.js → src/case/combo/textvaluedownlistcombo/combo.textvaluedownlist.js

0
src/widget/base/combo/textvaluedownlistcombo/trigger.textvaluedownlist.js → src/case/combo/textvaluedownlistcombo/trigger.textvaluedownlist.js

44
src/core/controller/controller.bubbles.js

@ -29,16 +29,7 @@ BI.BubblesController = BI.inherit(BI.Controller, {
});
},
hide: function (name, callback) {
if (!this.has(name)) {
return this;
}
this.get(name).element.hide(0, callback);
this.get(name).invisible();
return this;
},
_getOffsetLeft: function(name, context, offsetStyle){
_getOffsetLeft: function (name, context, offsetStyle) {
var left = 0;
if ("center" === offsetStyle) {
left = context.element.offset().left + (context.element.bounds().width - this.get(name).element.bounds().width) / 2;
@ -57,7 +48,7 @@ BI.BubblesController = BI.inherit(BI.Controller, {
return context.element.offset().left;
},
_getOffsetTop: function(name, context, offsetStyle){
_getOffsetTop: function (name, context, offsetStyle) {
var top = 0;
if ("center" === offsetStyle) {
top = context.element.offset().top + (context.element.bounds().height - this.get(name).element.bounds().height) / 2;
@ -75,25 +66,25 @@ BI.BubblesController = BI.inherit(BI.Controller, {
return context.element.offset().top;
},
_getLeftPosition: function(name, context, offsetStyle){
_getLeftPosition: function (name, context, offsetStyle) {
var position = $.getLeftPosition(context, this.get(name));
position.top = this._getOffsetTop(name, context, offsetStyle);
return position;
},
_getBottomPosition: function(name, context, offsetStyle){
_getBottomPosition: function (name, context, offsetStyle) {
var position = $.getBottomPosition(context, this.get(name));
position.left = this._getOffsetLeft(name, context, offsetStyle);
return position;
},
_getTopPosition: function(name, context, offsetStyle){
_getTopPosition: function (name, context, offsetStyle) {
var position = $.getTopPosition(context, this.get(name));
position.left = this._getOffsetLeft(name, context, offsetStyle);
return position;
},
_getRightPosition: function(name, context, offsetStyle){
_getRightPosition: function (name, context, offsetStyle) {
var position = $.getRightPosition(context, this.get(name));
position.top = this._getOffsetTop(name, context, offsetStyle);
return position;
@ -123,8 +114,8 @@ BI.BubblesController = BI.inherit(BI.Controller, {
items: [{
el: this.storeBubbles[name]["top"]
}]
})
this.set(name, this.storeBubbles[name]["top"])
});
this.set(name, this.storeBubbles[name]["top"]);
var position = this._getTopPosition(name, context, offsetStyle);
this.get(name).element.css({left: position.left, top: position.top});
this.get(name).invisible();
@ -138,7 +129,7 @@ BI.BubblesController = BI.inherit(BI.Controller, {
items: [{
el: this.storeBubbles[name]["left"]
}]
})
});
this.set(name, this.storeBubbles[name]["left"]);
var position = this._getLeftPosition(name, context, offsetStyle);
this.get(name).element.css({left: position.left, top: position.top});
@ -153,8 +144,8 @@ BI.BubblesController = BI.inherit(BI.Controller, {
items: [{
el: this.storeBubbles[name]["right"]
}]
})
this.set(name, this.storeBubbles[name]["right"])
});
this.set(name, this.storeBubbles[name]["right"]);
var position = this._getRightPosition(name, context, offsetStyle);
this.get(name).element.css({left: position.left, top: position.top});
this.get(name).invisible();
@ -181,6 +172,14 @@ BI.BubblesController = BI.inherit(BI.Controller, {
return this;
},
hide: function (name) {
if (!this.has(name)) {
return this;
}
this.get(name).invisible();
return this;
},
add: function (name, bubble) {
if (this.has(name)) {
return this;
@ -205,7 +204,10 @@ BI.BubblesController = BI.inherit(BI.Controller, {
if (!this.has(name)) {
return this;
}
this.bubblesManager[name].destroy();
BI.each(this.storeBubbles[name], function (dir, bubble) {
bubble.destroy();
});
delete this.storeBubbles[name];
delete this.bubblesManager[name];
return this;
}

Loading…
Cancel
Save