Browse Source

update

master
guy 7 years ago
parent
commit
8474f8c123
  1. 30
      bi/widget.js
  2. 46
      demo/config.js
  3. 0
      demo/js/addons/slider/demo.slider.js
  4. 0
      demo/js/case/combo/demo.icon_combo.js
  5. 0
      demo/js/case/combo/demo.static_combo.js
  6. 0
      demo/js/case/combo/demo.text_value_combo.js
  7. 0
      demo/js/case/combo/demo.text_value_down_list_combo.js
  8. 0
      demo/js/case/combo/demo.text_vlaue_check_combo.js
  9. 0
      demo/js/case/editor/demo.clear_editor.js
  10. 198
      demo/js/config/widget.js
  11. 0
      demo/js/widget/datetime/demo.datetime.js
  12. 46
      demo/js/widget/editor/demo.adapt_editor.js
  13. 27
      demo/js/widget/filemanager/demo.filemanager.js
  14. 8
      demo/js/widget/multiselect/demo.multi_select_combo.js
  15. 19
      demo/js/widget/multitree/demo.multi_tree_combo.js
  16. 35
      demo/js/widget/numbereditor/demo.number_editor.js
  17. 2
      demo/js/widget/selecttree/demo.select_tree_combo.js
  18. 2
      demo/js/widget/singletree/demo.single_tree_combo.js
  19. 46
      demo/js/widget/tree/demo.multilayer_select_level_tree.js
  20. 46
      demo/js/widget/tree/demo.multilayer_single_level_tree.js
  21. 46
      demo/js/widget/tree/demo.select_level_tree.js
  22. 46
      demo/js/widget/tree/demo.single_level_tree.js
  23. 30
      dist/bundle.js
  24. 6
      dist/bundle.min.js
  25. 6393
      dist/demo.js
  26. 30
      dist/widget.js
  27. 0
      src/widget/datepane/datepane.js
  28. 18
      src/widget/numbereditor/number.editor.js
  29. 2
      src/widget/selecttree/selecttree.combo.js
  30. 4
      src/widget/selecttree/selecttree.popup.js
  31. 2
      src/widget/singletree/singletree.combo.js
  32. 4
      src/widget/singletree/singletree.popup.js

30
bi/widget.js

@ -11624,8 +11624,12 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.NumberEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-number-editor bi-border",
validationChecker: function () {return true;},
valueFormatter: function (v) {return v;},
validationChecker: function () {
return true;
},
valueFormatter: function (v) {
return v;
},
value: 0,
errorText: "",
step: 1
@ -11646,7 +11650,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
o.value = this.getValue();
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function(){
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () {
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
});
this.topBtn = BI.createWidget({
@ -11654,7 +11658,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
trigger: "lclick,",
cls: "column-pre-page-h-font top-button bi-border-left bi-border-bottom"
});
this.topBtn.on(BI.IconButton.EVENT_CHANGE, function(){
this.topBtn.on(BI.IconButton.EVENT_CHANGE, function () {
self._finetuning(o.step);
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
@ -11664,7 +11668,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
trigger: "lclick,",
cls: "column-next-page-h-font bottom-button bi-border-left bi-border-top"
});
this.bottomBtn.on(BI.IconButton.EVENT_CHANGE, function(){
this.bottomBtn.on(BI.IconButton.EVENT_CHANGE, function () {
self._finetuning(-o.step);
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
@ -11693,7 +11697,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
},
//微调
_finetuning: function(add){
_finetuning: function (add) {
var v = BI.parseFloat(this.getValue());
this.setValue(v.add(add));
},
@ -11702,7 +11706,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
this.topBtn.setEnable(!!v);
},
setBottomEnable: function (v) {
setDownEnable: function (v) {
this.bottomBtn.setEnable(!!v);
},
@ -14958,7 +14962,7 @@ BI.SelectTreeCombo = BI.inherit(BI.Widget, {
});
this.popup = BI.createWidget({
type: "bi.select_tree_popup",
type: "bi.select_level_tree",
items: o.items
});
@ -15079,7 +15083,7 @@ BI.SelectTreePopup = BI.inherit(BI.Pane, {
_defaultConfig: function () {
return BI.extend(BI.SelectTreePopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-select-tree-popup",
baseCls: "bi-select-level-tree",
tipText: BI.i18nText("BI-No_Selected_Item"),
items: []
});
@ -15166,7 +15170,7 @@ BI.SelectTreePopup = BI.inherit(BI.Pane, {
});
BI.SelectTreePopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.select_tree_popup", BI.SelectTreePopup);/**
BI.shortcut("bi.select_level_tree", BI.SelectTreePopup);/**
*
* Created by GUY on 2016/8/10.
* @class BI.SequenceTableDynamicNumber
@ -15759,7 +15763,7 @@ BI.SingleTreeCombo = BI.inherit(BI.Widget, {
}, o.trigger));
this.popup = BI.createWidget({
type: "bi.single_tree_popup",
type: "bi.single_level_tree",
items: o.items
});
@ -15813,7 +15817,7 @@ BI.SingleTreePopup = BI.inherit(BI.Pane, {
_defaultConfig: function () {
return BI.extend(BI.SingleTreePopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-tree-popup",
baseCls: "bi-single-level-tree",
tipText: BI.i18nText("BI-No_Selected_Item"),
items: []
});
@ -15866,7 +15870,7 @@ BI.SingleTreePopup = BI.inherit(BI.Pane, {
});
BI.SingleTreePopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.single_tree_popup", BI.SingleTreePopup);/**
BI.shortcut("bi.single_level_tree", BI.SingleTreePopup);/**
* @class BI.SingleTreeTrigger
* @extends BI.Trigger
*/

46
demo/config.js

@ -23,6 +23,50 @@ Demo.CONSTANTS = {
{id: 22, pId: 2, value: "第二级文件2", text: "第二级文件2"},
{id: 211, pId: 21, value: "第三级目录2", text: "第三级目录2"},
{id: 212, pId: 21, value: "第三级文件2", text: "第三级文件2"},
{id: 2111, pId: 211, value: "第四级文件1", text: "第四级文件1"}]
{id: 2111, pId: 211, value: "第四级文件1", text: "第四级文件1"}],
LEVELTREE: [{
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"
}]
};

0
demo/js/widget/slider/demo.slider.js → demo/js/addons/slider/demo.slider.js

0
demo/js/widget/combo/demo.icon_combo.js → demo/js/case/combo/demo.icon_combo.js

0
demo/js/widget/combo/demo.static_combo.js → demo/js/case/combo/demo.static_combo.js

0
demo/js/widget/combo/demo.text_value_combo.js → demo/js/case/combo/demo.text_value_combo.js

0
demo/js/widget/combo/demo.text_value_down_list_combo.js → demo/js/case/combo/demo.text_value_down_list_combo.js

0
demo/js/widget/combo/demo.text_vlaue_check_combo.js → demo/js/case/combo/demo.text_vlaue_check_combo.js

0
demo/js/widget/editor/demo.clear_editor.js → demo/js/case/editor/demo.clear_editor.js

198
demo/js/config/widget.js

@ -4,92 +4,88 @@ Demo.WIDGET_CONFIG = [{
open: true
}, {
pId: 4,
id: 420,
id: 401,
text: '各种小控件'
}, {
pId: 420,
pId: 401,
text: "各种通用按钮",
value: "demo.buttons"
}, {
pId: 420,
pId: 401,
text: "各种提示性信息",
value: "demo.tips"
}, {
pId: 420,
pId: 401,
text: "各种items",
value: "demo.items"
}, {
pId: 420,
pId: 401,
text: "各种节点node",
value: "demo.nodes"
}, {
pId: 420,
pId: 401,
text: "各种segment",
value: "demo.segments"
}, {
pId: 420,
text: "可以切换的树",
value: "demo.switch_tree"
pId: 4,
id: 402,
text: "文本框控件"
}, {
pId: 402,
text: "bi.text_editor",
value: "demo.text_editor"
}, {
pId: 402,
text: "bi.search_editor",
value: "demo.search_editor"
}, {
pId: 402,
text: "bi.number_editor",
value: "demo.number_editor"
}, {
id: 400,
pId: 4,
id: 403,
text: "tree"
}, {
pId: 400,
text: "bi.multi_tree_combo",
value: "demo.multi_tree_combo"
pId: 403,
text: "bi.single_level_tree",
value: "demo.single_level_tree"
}, {
pId: 403,
text: "bi.select_level_tree",
value: "demo.select_level_tree"
}, {
pId: 400,
pId: 403,
text: "bi.multilayer_single_level_tree",
value: "demo.multilayer_single_level_tree"
}, {
pId: 403,
text: "bi.multilayer_select_level_tree",
value: "demo.multilayer_select_level_tree"
}, {
pId: 403,
text: "bi.switch_tree",
value: "demo.switch_tree"
}, {
id: 401,
pId: 4,
id: 404,
text: "table"
}, {
pId: 401,
pId: 404,
text: "bi.preview_table",
value: "demo.preview_table"
}, {
pId: 401,
pId: 404,
text: "bi.responsive_table",
value: "demo.responsive_table"
}, {
pId: 401,
pId: 404,
text: "bi.excel_table",
value: "demo.excel_table"
}, {
pId: 4,
id: 402,
text: "年份控件",
open: false
}, {
pId: 402,
text: "bi.year_combo",
value: "demo.year"
}, {
pId: 4,
id: 403,
text: "月份控件",
open: false
}, {
pId: 403,
text: "bi.month_combo",
value: "demo.month"
}, {
pId: 4,
id: 404,
text: "季度控件",
open: false
}, {
pId: 404,
text: "bi.quarter_combo",
value: "demo.quarter"
}, {
pId: 4,
id: 405,
text: "下拉列表",
open: false
text: "下拉列表"
}, {
pId: 405,
text: "bi.down_list_combo",
@ -97,77 +93,75 @@ Demo.WIDGET_CONFIG = [{
}, {
pId: 4,
id: 406,
text: "文本框控件",
open: false
}, {
pId: 406,
text: "bi.text_editor",
value: "demo.text_editor"
text: "复选下拉框"
}, {
pId: 406,
text: "bi.search_editor",
value: "demo.search_editor"
}, {
pId: 406,
text: "bi.clear_editor",
value: "demo.clear_editor"
text: "bi.multi_select_combo",
value: "demo.multi_select_combo"
}, {
pId: 4,
id: 407,
text: "下拉框控件",
open: false
}, {
pId: 407,
text: "bi.text_value_combo",
value: "demo.text_value_combo"
text: "简单下拉树"
}, {
pId: 407,
text: "bi.text_value_check_combo",
value: "demo.text_value_check_combo"
text: "bi.single_tree_combo",
value: "demo.single_tree_combo"
}, {
pId: 407,
text: "bi.text_value_down_list_combo",
value: "demo.text_value_down_list_combo"
pId: 4,
id: 408,
text: "多层级下拉树"
}, {
pId: 407,
text: "bi.static_combo",
value: "demo.static_combo"
pId: 408,
text: "bi.multilayer_single_tree_combo",
value: "demo.multilayer_single_tree_combo"
}, {
pId: 407,
text: "bi.icon_combo",
value: "demo.icon_combo"
pId: 4,
id: 409,
text: "可选下拉树"
}, {
pId: 407,
text: "bi.formula_combo",
value: "demo.formula_combo"
pId: 409,
text: "bi.select_tree_combo",
value: "demo.select_tree_combo"
}, {
pId: 4,
id: 410,
text: "数值区间控件"
text: "多层级可选下拉树"
}, {
pId: 410,
text: "bi.numerical_interval",
value: "demo.numberical_interval"
text: "bi.multilayer_select_tree_combo",
value: "demo.multilayer_select_tree_combo"
}, {
pId: 4,
id: 411,
text: "下拉复选框有确定按钮"
text: "复选下拉树"
}, {
pId: 411,
text: "bi.multi_select_combo",
value: "demo.multi_select_combo"
text: "bi.multi_tree_combo",
value: "demo.multi_tree_combo"
}, {
pId: 4,
id: 412,
text: "简单日期控件"
text: "日期相关控件"
}, {
pId: 412,
text: "bi.year_combo",
value: "demo.year"
}, {
pId: 412,
text: "bi.month_combo",
value: "demo.month"
}, {
pId: 412,
text: "bi.quarter_combo",
value: "demo.quarter"
}, {
pId: 412,
text: "bi.date_combo",
value: "demo.date"
}, {
pId: 412,
text: "bi.date_pane_widget",
value: "demo.date_pane_widget"
text: "bi.date_pane",
value: "demo.date_pane"
}, {
pId: 412,
text: "bi.year_month_combo",
@ -180,30 +174,26 @@ Demo.WIDGET_CONFIG = [{
pId: 412,
text: "bi.custom_date_time",
value: "demo.custom_date_time"
}, {
pId: 412,
text: '时间间隔',
value: 'demo.time_interval'
}, {
pId: 4,
id: 413,
text: "简单下拉树"
}, {
pId: 413,
text: "bi.single_tree_combo",
value: "demo.single_tree_combo"
text: "数值区间控件"
}, {
pId: 413,
text: "bi.multilayer_single_tree_combo",
value: "demo.multilayer_single_tree_combo"
text: "bi.number_interval",
value: "demo.number_interval"
}, {
pId: 4,
id: 414,
text: "可选下拉树"
}, {
pId: 414,
text: "bi.select_tree_combo",
value: "demo.select_tree_combo"
text: "公式下拉框"
}, {
pId: 414,
text: "bi.multilayer_select_tree_combo",
value: "demo.multilayer_select_tree_combo"
text: "bi.formula_combo",
value: "demo.formula_combo"
}, {
pId: 4,
id: 415,
@ -252,8 +242,4 @@ Demo.WIDGET_CONFIG = [{
pId: 419,
text: "bi.file_manager",
value: "demo.file_manager"
}, {
pId: 4,
text: '时间间隔',
value: 'demo.time_interval'
}];

0
demo/js/widget/demo.datetime.js → demo/js/widget/datetime/demo.datetime.js

46
demo/js/widget/editor/demo.adapt_editor.js

@ -1,46 +0,0 @@
/**
* Created by Dailer on 2017/7/11.
*/
Demo.AdaptEditor = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
//这东西好奇怪,不支持设置宽度,那么渲染出来宽度几乎没有,无奈之下只能假装给他个默认值了
beforeMount: function () {
this.refs.setValue("Winter is coming !")
},
render: function () {
var self = this;
var editor = BI.createWidget({
type: "bi.adapt_editor",
cls: "layout-bg5",
ref: function (_ref) {
self.refs = _ref;
}
})
var text=["You know nothing! Jon Snow","A Lannister always pays his debts.","Power is a curious thing."]
return {
type: "bi.horizontal_auto",
items: [{
el: editor
}, {
type: "bi.button",
text: "为了展示长度真的是可变的,每点一下就换一行字",
handler: function () {
var temp=text.shift();
editor.setValue(temp);
text.push(temp);
}
}],
vgap: 20
}
}
})
BI.shortcut("demo.adapt_editor", Demo.AdaptEditor);

27
demo/js/widget/filemanager/demo.file.manager.js → demo/js/widget/filemanager/demo.filemanager.js

@ -1,6 +1,6 @@
/*
Created by dailer on 2017 / 7 / 21.
*/
Created by dailer on 2017 / 7 / 21.
*/
Demo.FileManager = BI.inherit(BI.Widget, {
props: {
baseCls: ""
@ -45,28 +45,9 @@ Demo.FileManager = BI.inherit(BI.Widget, {
text: "文件2",
lastModify: 1454316355142
}];
var filemanager = BI.createWidget({
type: "bi.number_editor",
validationChecker: function (v) {
return BI.parseFloat(v) <= 100 && BI.parseFloat(v) >= 0
},
height: 24,
width: 150,
errorText: "hahah"
});
filemanager.on(BI.FineTuningNumberEditor.EVENT_CHANGE, function () {
if(BI.parseFloat(this.getValue()) < 1){
filemanager.setBottomEnable(false);
}else{
filemanager.setBottomEnable(true);
}
});
return {
type: "bi.vertical",
items: [{
el: filemanager,
height: 24
}]
type: "bi.file_manager",
items: items
}
}
});

8
demo/js/widget/multiselect/demo.multi_select_combo.js

@ -23,14 +23,14 @@ Demo.MultiSelectCombo = BI.inherit(BI.Widget, {
_getItemsByTimes: function (items, times) {
var res = [];
for (var i = (times - 1) * 3; items[i] && i < times * 3; i++) {
for (var i = (times - 1) * 10; items[i] && i < times * 10; i++) {
res.push(items[i]);
}
return res;
},
_hasNextByTimes: function (items, times) {
return times * 3 < items.length;
return times * 10 < items.length;
},
_itemsCreator: function (options, callback) {
@ -44,8 +44,8 @@ Demo.MultiSelectCombo = BI.inherit(BI.Widget, {
var search = BI.Func.getSearchResult(items, kw);
items = search.matched.concat(search.finded);
});
if (options.selected_values) {//过滤
var filter = BI.makeObject(options.selected_values, true);
if (options.selectedValues) {//过滤
var filter = BI.makeObject(options.selectedValues, true);
items = BI.filter(items, function (i, ob) {
return !filter[ob.value];
});

19
demo/js/widget/multitree/demo.multi_tree_combo.js

@ -17,9 +17,20 @@ Demo.MultiTreeCombo = BI.inherit(BI.Widget, {
self.tree = _ref;
},
itemsCreator: function (options, callback) {
console.log(options);
console.log(options);
//根据不同的类型处理相应的结果
switch (options.type) {
case BI.TreeView.REQ_TYPE_INIT_DATA:
break;
case BI.TreeView.REQ_TYPE_ADJUST_DATA:
break;
case BI.TreeView.REQ_TYPE_SELECT_DATA:
break;
case BI.TreeView.REQ_TYPE_GET_SELECTED_DATA:
break;
default :
break;
}
callback({
items: items
});
@ -27,7 +38,7 @@ Demo.MultiTreeCombo = BI.inherit(BI.Widget, {
width: 300
}, {
type: "bi.button",
text: "getVlaue",
text: "getValue",
handler: function () {
BI.Msg.toast(JSON.stringify(self.tree.getValue()));
},

35
demo/js/widget/numbereditor/demo.number_editor.js

@ -0,0 +1,35 @@
/*
Created by dailer on 2017 / 7 / 21.
*/
Demo.FileManager = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var editor = BI.createWidget({
type: "bi.number_editor",
validationChecker: function (v) {
return BI.parseFloat(v) <= 100 && BI.parseFloat(v) >= 0
},
height: 24,
width: 150,
errorText: "hahah"
});
editor.on(BI.NumberEditor.EVENT_CHANGE, function () {
if (BI.parseFloat(this.getValue()) < 1) {
editor.setDownEnable(false);
} else {
editor.setDownEnable(true);
}
});
return {
type: "bi.vertical",
items: [{
el: editor,
height: 24
}]
}
}
});
BI.shortcut("demo.number_editor", Demo.FileManager);

2
demo/js/widget/selecttree/demo.select_tree_combo.js

@ -8,7 +8,7 @@ Demo.SelectTreeCombo = BI.inherit(BI.Widget, {
render: function () {
var self = this;
var items = BI.deepClone(Demo.CONSTANTS.TREE);
var items = BI.deepClone(Demo.CONSTANTS.LEVELTREE);
return {
type: "bi.horizontal_auto",
items: [{

2
demo/js/widget/singletree/demo.single_tree_combo.js

@ -8,7 +8,7 @@ Demo.SingleTreeCombo = BI.inherit(BI.Widget, {
render: function () {
var self = this;
var items = BI.deepClone(Demo.CONSTANTS.TREE);
var items = BI.deepClone(Demo.CONSTANTS.LEVELTREE);
return {
type: "bi.horizontal_auto",
items: [{

46
demo/js/widget/tree/demo.multilayer_select_level_tree.js

@ -0,0 +1,46 @@
/**
* Created by Dailer on 2017/7/26.
*/
Demo.MultiLayerSelectLevelTree = BI.inherit(BI.Widget, {
render: function () {
var self = this;
var tree = BI.createWidget({
type: "bi.multilayer_select_level_tree",
items: BI.deepClone(Demo.CONSTANTS.TREE)
});
return {
type: "bi.vtape",
items: [{
el: tree
}, {
el: {
type: "bi.button",
height: 25,
text: "getValue",
handler: function () {
BI.Msg.alert("", JSON.stringify(tree.getValue()));
}
},
height: 25
}, {
el: {
type: "bi.button",
height: 25,
text: "setValue (第二级文件1)",
handler: function () {
tree.setValue(["第二级文件1"]);
}
},
height: 25
}],
width: 500,
hgap: 300
}
}
});
BI.shortcut("demo.multilayer_select_level_tree", Demo.MultiLayerSelectLevelTree);

46
demo/js/widget/tree/demo.multilayer_single_level_tree.js

@ -0,0 +1,46 @@
/**
* Created by Dailer on 2017/7/26.
*/
Demo.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, {
render: function () {
var self = this;
var tree = BI.createWidget({
type: "bi.multilayer_single_level_tree",
items: BI.deepClone(Demo.CONSTANTS.TREE)
});
return {
type: "bi.vtape",
items: [{
el: tree
}, {
el: {
type: "bi.button",
height: 25,
text: "getValue",
handler: function () {
BI.Msg.alert("", JSON.stringify(tree.getValue()));
}
},
height: 25
}, {
el: {
type: "bi.button",
height: 25,
text: "setValue (第二级文件1)",
handler: function () {
tree.setValue(["第二级文件1"]);
}
},
height: 25
}],
width: 500,
hgap: 300
}
}
});
BI.shortcut("demo.multilayer_single_level_tree", Demo.MultiLayerSingleLevelTree);

46
demo/js/widget/tree/demo.select_level_tree.js

@ -0,0 +1,46 @@
/**
* Created by Dailer on 2017/7/26.
*/
Demo.SelectLevelTree = BI.inherit(BI.Widget, {
render: function () {
var self = this;
var tree = BI.createWidget({
type: "bi.select_level_tree",
items: BI.deepClone(Demo.CONSTANTS.LEVELTREE)
});
return {
type: "bi.vtape",
items: [{
el: tree
}, {
el: {
type: "bi.button",
height: 25,
text: "getValue",
handler: function () {
BI.Msg.alert("", JSON.stringify(tree.getValue()));
}
},
height: 25
}, {
el: {
type: "bi.button",
height: 25,
text: "setValue (第二级文件1)",
handler: function () {
tree.setValue(["第二级文件1"]);
}
},
height: 25
}],
width: 500,
hgap: 300
}
}
});
BI.shortcut("demo.select_level_tree", Demo.SelectLevelTree);

46
demo/js/widget/tree/demo.single_level_tree.js

@ -0,0 +1,46 @@
/**
* Created by Dailer on 2017/7/26.
*/
Demo.SingleLevelTree = BI.inherit(BI.Widget, {
render: function () {
var self = this;
var tree = BI.createWidget({
type: "bi.single_level_tree",
items: BI.deepClone(Demo.CONSTANTS.LEVELTREE)
});
return {
type: "bi.vtape",
items: [{
el: tree
}, {
el: {
type: "bi.button",
height: 25,
text: "getValue",
handler: function () {
BI.Msg.alert("", JSON.stringify(tree.getValue()));
}
},
height: 25
}, {
el: {
type: "bi.button",
height: 25,
text: "setValue (第二级文件1)",
handler: function () {
tree.setValue(["第二级文件1"]);
}
},
height: 25
}],
width: 500,
hgap: 300
}
}
});
BI.shortcut("demo.single_level_tree", Demo.SingleLevelTree);

30
dist/bundle.js vendored

@ -90252,8 +90252,12 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.NumberEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-number-editor bi-border",
validationChecker: function () {return true;},
valueFormatter: function (v) {return v;},
validationChecker: function () {
return true;
},
valueFormatter: function (v) {
return v;
},
value: 0,
errorText: "",
step: 1
@ -90274,7 +90278,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
o.value = this.getValue();
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function(){
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () {
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
});
this.topBtn = BI.createWidget({
@ -90282,7 +90286,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
trigger: "lclick,",
cls: "column-pre-page-h-font top-button bi-border-left bi-border-bottom"
});
this.topBtn.on(BI.IconButton.EVENT_CHANGE, function(){
this.topBtn.on(BI.IconButton.EVENT_CHANGE, function () {
self._finetuning(o.step);
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
@ -90292,7 +90296,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
trigger: "lclick,",
cls: "column-next-page-h-font bottom-button bi-border-left bi-border-top"
});
this.bottomBtn.on(BI.IconButton.EVENT_CHANGE, function(){
this.bottomBtn.on(BI.IconButton.EVENT_CHANGE, function () {
self._finetuning(-o.step);
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
@ -90321,7 +90325,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
},
//微调
_finetuning: function(add){
_finetuning: function (add) {
var v = BI.parseFloat(this.getValue());
this.setValue(v.add(add));
},
@ -90330,7 +90334,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
this.topBtn.setEnable(!!v);
},
setBottomEnable: function (v) {
setDownEnable: function (v) {
this.bottomBtn.setEnable(!!v);
},
@ -93586,7 +93590,7 @@ BI.SelectTreeCombo = BI.inherit(BI.Widget, {
});
this.popup = BI.createWidget({
type: "bi.select_tree_popup",
type: "bi.select_level_tree",
items: o.items
});
@ -93707,7 +93711,7 @@ BI.SelectTreePopup = BI.inherit(BI.Pane, {
_defaultConfig: function () {
return BI.extend(BI.SelectTreePopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-select-tree-popup",
baseCls: "bi-select-level-tree",
tipText: BI.i18nText("BI-No_Selected_Item"),
items: []
});
@ -93794,7 +93798,7 @@ BI.SelectTreePopup = BI.inherit(BI.Pane, {
});
BI.SelectTreePopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.select_tree_popup", BI.SelectTreePopup);/**
BI.shortcut("bi.select_level_tree", BI.SelectTreePopup);/**
*
* Created by GUY on 2016/8/10.
* @class BI.SequenceTableDynamicNumber
@ -94387,7 +94391,7 @@ BI.SingleTreeCombo = BI.inherit(BI.Widget, {
}, o.trigger));
this.popup = BI.createWidget({
type: "bi.single_tree_popup",
type: "bi.single_level_tree",
items: o.items
});
@ -94441,7 +94445,7 @@ BI.SingleTreePopup = BI.inherit(BI.Pane, {
_defaultConfig: function () {
return BI.extend(BI.SingleTreePopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-tree-popup",
baseCls: "bi-single-level-tree",
tipText: BI.i18nText("BI-No_Selected_Item"),
items: []
});
@ -94494,7 +94498,7 @@ BI.SingleTreePopup = BI.inherit(BI.Pane, {
});
BI.SingleTreePopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.single_tree_popup", BI.SingleTreePopup);/**
BI.shortcut("bi.single_level_tree", BI.SingleTreePopup);/**
* @class BI.SingleTreeTrigger
* @extends BI.Trigger
*/

6
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

6393
dist/demo.js vendored

File diff suppressed because it is too large Load Diff

30
dist/widget.js vendored

@ -11624,8 +11624,12 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.NumberEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-number-editor bi-border",
validationChecker: function () {return true;},
valueFormatter: function (v) {return v;},
validationChecker: function () {
return true;
},
valueFormatter: function (v) {
return v;
},
value: 0,
errorText: "",
step: 1
@ -11646,7 +11650,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
o.value = this.getValue();
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function(){
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () {
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
});
this.topBtn = BI.createWidget({
@ -11654,7 +11658,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
trigger: "lclick,",
cls: "column-pre-page-h-font top-button bi-border-left bi-border-bottom"
});
this.topBtn.on(BI.IconButton.EVENT_CHANGE, function(){
this.topBtn.on(BI.IconButton.EVENT_CHANGE, function () {
self._finetuning(o.step);
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
@ -11664,7 +11668,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
trigger: "lclick,",
cls: "column-next-page-h-font bottom-button bi-border-left bi-border-top"
});
this.bottomBtn.on(BI.IconButton.EVENT_CHANGE, function(){
this.bottomBtn.on(BI.IconButton.EVENT_CHANGE, function () {
self._finetuning(-o.step);
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
@ -11693,7 +11697,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
},
//微调
_finetuning: function(add){
_finetuning: function (add) {
var v = BI.parseFloat(this.getValue());
this.setValue(v.add(add));
},
@ -11702,7 +11706,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
this.topBtn.setEnable(!!v);
},
setBottomEnable: function (v) {
setDownEnable: function (v) {
this.bottomBtn.setEnable(!!v);
},
@ -14958,7 +14962,7 @@ BI.SelectTreeCombo = BI.inherit(BI.Widget, {
});
this.popup = BI.createWidget({
type: "bi.select_tree_popup",
type: "bi.select_level_tree",
items: o.items
});
@ -15079,7 +15083,7 @@ BI.SelectTreePopup = BI.inherit(BI.Pane, {
_defaultConfig: function () {
return BI.extend(BI.SelectTreePopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-select-tree-popup",
baseCls: "bi-select-level-tree",
tipText: BI.i18nText("BI-No_Selected_Item"),
items: []
});
@ -15166,7 +15170,7 @@ BI.SelectTreePopup = BI.inherit(BI.Pane, {
});
BI.SelectTreePopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.select_tree_popup", BI.SelectTreePopup);/**
BI.shortcut("bi.select_level_tree", BI.SelectTreePopup);/**
*
* Created by GUY on 2016/8/10.
* @class BI.SequenceTableDynamicNumber
@ -15759,7 +15763,7 @@ BI.SingleTreeCombo = BI.inherit(BI.Widget, {
}, o.trigger));
this.popup = BI.createWidget({
type: "bi.single_tree_popup",
type: "bi.single_level_tree",
items: o.items
});
@ -15813,7 +15817,7 @@ BI.SingleTreePopup = BI.inherit(BI.Pane, {
_defaultConfig: function () {
return BI.extend(BI.SingleTreePopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-tree-popup",
baseCls: "bi-single-level-tree",
tipText: BI.i18nText("BI-No_Selected_Item"),
items: []
});
@ -15866,7 +15870,7 @@ BI.SingleTreePopup = BI.inherit(BI.Pane, {
});
BI.SingleTreePopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.single_tree_popup", BI.SingleTreePopup);/**
BI.shortcut("bi.single_level_tree", BI.SingleTreePopup);/**
* @class BI.SingleTreeTrigger
* @extends BI.Trigger
*/

0
src/widget/datepane/datepanenotselectday.js → src/widget/datepane/datepane.js

18
src/widget/numbereditor/number.editor.js

@ -6,8 +6,12 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.NumberEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-number-editor bi-border",
validationChecker: function () {return true;},
valueFormatter: function (v) {return v;},
validationChecker: function () {
return true;
},
valueFormatter: function (v) {
return v;
},
value: 0,
errorText: "",
step: 1
@ -28,7 +32,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
o.value = this.getValue();
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function(){
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () {
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
});
this.topBtn = BI.createWidget({
@ -36,7 +40,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
trigger: "lclick,",
cls: "column-pre-page-h-font top-button bi-border-left bi-border-bottom"
});
this.topBtn.on(BI.IconButton.EVENT_CHANGE, function(){
this.topBtn.on(BI.IconButton.EVENT_CHANGE, function () {
self._finetuning(o.step);
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
@ -46,7 +50,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
trigger: "lclick,",
cls: "column-next-page-h-font bottom-button bi-border-left bi-border-top"
});
this.bottomBtn.on(BI.IconButton.EVENT_CHANGE, function(){
this.bottomBtn.on(BI.IconButton.EVENT_CHANGE, function () {
self._finetuning(-o.step);
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
@ -75,7 +79,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
},
//微调
_finetuning: function(add){
_finetuning: function (add) {
var v = BI.parseFloat(this.getValue());
this.setValue(v.add(add));
},
@ -84,7 +88,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
this.topBtn.setEnable(!!v);
},
setBottomEnable: function (v) {
setDownEnable: function (v) {
this.bottomBtn.setEnable(!!v);
},

2
src/widget/selecttree/selecttree.combo.js

@ -25,7 +25,7 @@ BI.SelectTreeCombo = BI.inherit(BI.Widget, {
});
this.popup = BI.createWidget({
type: "bi.select_tree_popup",
type: "bi.select_level_tree",
items: o.items
});

4
src/widget/selecttree/selecttree.popup.js

@ -7,7 +7,7 @@ BI.SelectTreePopup = BI.inherit(BI.Pane, {
_defaultConfig: function () {
return BI.extend(BI.SelectTreePopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-select-tree-popup",
baseCls: "bi-select-level-tree",
tipText: BI.i18nText("BI-No_Selected_Item"),
items: []
});
@ -94,4 +94,4 @@ BI.SelectTreePopup = BI.inherit(BI.Pane, {
});
BI.SelectTreePopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.select_tree_popup", BI.SelectTreePopup);
BI.shortcut("bi.select_level_tree", BI.SelectTreePopup);

2
src/widget/singletree/singletree.combo.js

@ -26,7 +26,7 @@ BI.SingleTreeCombo = BI.inherit(BI.Widget, {
}, o.trigger));
this.popup = BI.createWidget({
type: "bi.single_tree_popup",
type: "bi.single_level_tree",
items: o.items
});

4
src/widget/singletree/singletree.popup.js

@ -7,7 +7,7 @@ BI.SingleTreePopup = BI.inherit(BI.Pane, {
_defaultConfig: function () {
return BI.extend(BI.SingleTreePopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-tree-popup",
baseCls: "bi-single-level-tree",
tipText: BI.i18nText("BI-No_Selected_Item"),
items: []
});
@ -60,4 +60,4 @@ BI.SingleTreePopup = BI.inherit(BI.Pane, {
});
BI.SingleTreePopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.single_tree_popup", BI.SingleTreePopup);
BI.shortcut("bi.single_level_tree", BI.SingleTreePopup);
Loading…
Cancel
Save