Browse Source

Merge pull request #1104 in VISUAL/fineui from ~WINDY/fineui:master to master

* commit '02bd6ee4688c80944d9be51fdd2fcc78b1dea945':
  REPORT-20994 feat: 单选下拉树新增选中值
es6
guy 5 years ago
parent
commit
1868ea42da
  1. 2
      changelog.md
  2. 253
      dist/2.0/fineui.ie.js
  3. 253
      dist/2.0/fineui.js
  4. 253
      dist/bundle.ie.js
  5. 253
      dist/bundle.js
  6. 6
      dist/case.js
  7. 8
      dist/core.js
  8. 253
      dist/fineui.ie.js
  9. 253
      dist/fineui.js
  10. 245
      dist/fineui_without_jquery_polyfill.js
  11. 239
      dist/widget.js
  12. 6
      src/case/trigger/trigger.icon.js
  13. 2
      src/widget/downlist/combo.downlist.js
  14. 11
      src/widget/multilayerselecttree/multilayerselecttree.combo.js
  15. 92
      src/widget/multilayerselecttree/multilayerselecttree.insert.search.pane.js
  16. 16
      src/widget/multilayerselecttree/multilayerselecttree.trigger.js
  17. 12
      src/widget/multilayersingletree/multilayersingletree.combo.js
  18. 92
      src/widget/multilayersingletree/multilayersingletree.insert.search.pane.js
  19. 16
      src/widget/multilayersingletree/multilayersingletree.trigger.js

2
changelog.md

@ -1,5 +1,7 @@
# 更新日志 # 更新日志
2.0(2019-08) 2.0(2019-08)
- 单选树可展示并选中不存在的值
- 树类型下拉新增可搜索实际值的配置
- 可编辑的combo新增水印配置 - 可编辑的combo新增水印配置
- 单选下拉树同步状态下内置搜索 - 单选下拉树同步状态下内置搜索

253
dist/2.0/fineui.ie.js vendored

@ -21871,14 +21871,16 @@ BI.prepares.push(function () {
var canvas = document.createElement("canvas"); var canvas = document.createElement("canvas");
var ratio = 2; var ratio = 2;
BI.Widget._renderEngine.createElement("body").append(canvas); BI.Widget._renderEngine.createElement("body").append(canvas);
var w = BI.DOM.getTextSizeWidth(param, 12) + 4;
var ctx = canvas.getContext("2d");
ctx.font = "12px Georgia";
var w = ctx.measureText(param).width + 4;
canvas.width = w * ratio; canvas.width = w * ratio;
canvas.height = 16 * ratio; canvas.height = 16 * ratio;
var ctx = canvas.getContext("2d");
// ctx.fillStyle = "#EAF2FD";
ctx.font = 12 * ratio + "px Georgia"; ctx.font = 12 * ratio + "px Georgia";
ctx.fillStyle = fillStyle || "#3685f2"; ctx.fillStyle = fillStyle || "#3685f2";
ctx.textBaseline = "middle"; ctx.textBaseline = "middle";
// ctx.fillStyle = "#EAF2FD";
ctx.fillText(param, 2 * ratio, 9 * ratio); ctx.fillText(param, 2 * ratio, 9 * ratio);
BI.Widget._renderEngine.createElement(canvas).destroy(); BI.Widget._renderEngine.createElement(canvas).destroy();
var backColor = backgroundColor || "rgba(54, 133, 242, 0.1)"; var backColor = backgroundColor || "rgba(54, 133, 242, 0.1)";
@ -61475,7 +61477,8 @@ BI.IconTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-icon-trigger", baseCls: "bi-icon-trigger",
extraCls: "pull-down-font",
el: {}, el: {},
height: 24 height: 24
}); });
@ -61487,7 +61490,8 @@ BI.IconTrigger = BI.inherit(BI.Trigger, {
type: "bi.trigger_icon_button", type: "bi.trigger_icon_button",
element: this, element: this,
width: o.width, width: o.width,
height: o.height height: o.height,
extraCls: o.extraCls
}); });
} }
}); });
@ -63634,7 +63638,7 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
stopPropagation: o.stopPropagation, stopPropagation: o.stopPropagation,
el: BI.createWidget(o.el, { el: BI.createWidget(o.el, {
type: "bi.icon_trigger", type: "bi.icon_trigger",
extraCls: o.iconCls ? o.iconCls : "", extraCls: o.iconCls,
width: o.width, width: o.width,
height: o.height height: o.height
}), }),
@ -68589,7 +68593,8 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
tabIndex: 0 tabIndex: 0
}, },
allowEdit: false, allowEdit: false,
allowSearchValue: false allowSearchValue: false,
allowInsertValue: false
}); });
}, },
@ -68669,6 +68674,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
return { return {
el: { el: {
type: "bi.multilayer_select_tree_trigger", type: "bi.multilayer_select_tree_trigger",
allowInsertValue: o.allowInsertValue,
allowSearchValue: o.allowSearchValue, allowSearchValue: o.allowSearchValue,
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
cls: "multilayer-select-tree-trigger", cls: "multilayer-select-tree-trigger",
@ -68707,6 +68713,13 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
action: function () { action: function () {
self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING); self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING);
} }
}, {
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.hideView();
}
}] }]
}, },
hideChecker: function (e) { hideChecker: function (e) {
@ -68759,6 +68772,97 @@ BI.MultiLayerSelectTreeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSelectTreeCombo.EVENT_FOCUS = "EVENT_FOCUS"; BI.MultiLayerSelectTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo);/** BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo);/**
* Created by GUY on 2016/1/26.
*
* @class BI.MultiLayerSelectTreeInsertSearchPane
* @extends BI.Pane
*/
BI.MultiLayerSelectTreeInsertSearchPane = BI.inherit(BI.Widget, {
props: function() {
return {
baseCls: "bi-multilayer-select-tree-popup",
tipText: BI.i18nText("BI-No_Selected_Item"),
isDefaultInit: false,
itemsCreator: BI.emptyFn,
items: [],
value: ""
};
},
render: function() {
var self = this, o = this.options;
this.tree = BI.createWidget({
type: "bi.multilayer_select_level_tree",
isDefaultInit: o.isDefaultInit,
items: o.items,
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
o.itemsCreator(op, function (res) {
callback(res);
self.setKeyword(o.keywordGetter());
});
},
keywordGetter: o.keywordGetter,
value: o.value,
scrollable: null,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}, {
eventName: BI.MultiLayerSelectLevelTree.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE);
}
}]
});
return {
type: "bi.vertical",
scrolly: false,
scrollable: true,
vgap: 5,
items: [{
type: "bi.text_button",
invisible: true,
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: 24,
cls: "bi-high-light",
hgap: 5,
ref: function (_ref) {
self.addNotMatchTip = _ref;
},
handler: function () {
self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM, o.keywordGetter());
}
}, this.tree]
};
},
setKeyword: function (keyword) {
var showTip = BI.isEmptyArray(this.tree.getAllLeaves());
this.addNotMatchTip.setVisible(showTip);
showTip && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
getValue: function () {
return this.tree.getValue();
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.tree.setValue(v);
},
populate: function (items) {
this.tree.populate(items);
}
});
BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_select_tree_insert_search_pane", BI.MultiLayerSelectTreeInsertSearchPane);/**
* guy * guy
* 二级树 * 二级树
* @class BI.MultiLayerSelectLevelTree * @class BI.MultiLayerSelectLevelTree
@ -69068,7 +69172,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}] }]
}, },
popup: { popup: {
type: "bi.multilayer_select_tree_popup", type: o.allowInsertValue ? "bi.multilayer_select_tree_insert_search_pane" : "bi.multilayer_select_tree_popup",
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) { itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
op.keyword = self.editor.getValue(); op.keyword = self.editor.getValue();
o.itemsCreator(op, callback); o.itemsCreator(op, callback);
@ -69076,12 +69180,23 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
keywordGetter: function () { keywordGetter: function () {
return self.editor.getValue(); return self.editor.getValue();
}, },
cls: "bi-card" cls: "bi-card",
listeners: [{
eventName: BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM,
action: function () {
self.options.text = self.getSearcher().getKeyword();
self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM);
}
}],
ref: function (_ref) {
self.popup = _ref;
}
}, },
onSearch: function (obj, callback) { onSearch: function (obj, callback) {
var keyword = obj.keyword; var keyword = obj.keyword;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
callback(self._getSearchItems(keyword)); callback(self._getSearchItems(keyword));
o.allowInsertValue && self.popup.setKeyword(keyword);
} else { } else {
callback(); callback();
} }
@ -69216,6 +69331,7 @@ BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSelectTreeTrigger.EVENT_STOP = "EVENT_STOP"; BI.MultiLayerSelectTreeTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSelectTreeTrigger.EVENT_START = "EVENT_START"; BI.MultiLayerSelectTreeTrigger.EVENT_START = "EVENT_START";
BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multilayer_select_tree_trigger", BI.MultiLayerSelectTreeTrigger);/** BI.shortcut("bi.multilayer_select_tree_trigger", BI.MultiLayerSelectTreeTrigger);/**
* 加号表示的组节点 * 加号表示的组节点
* *
@ -69641,7 +69757,9 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
attributes: { attributes: {
tabIndex: 0 tabIndex: 0
}, },
allowEdit: false allowEdit: false,
allowSearchValue: false,
allowInsertValue: false
}); });
}, },
@ -69721,6 +69839,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
return { return {
el: { el: {
type: "bi.multilayer_single_tree_trigger", type: "bi.multilayer_single_tree_trigger",
allowInsertValue: o.allowInsertValue,
allowSearchValue: o.allowSearchValue, allowSearchValue: o.allowSearchValue,
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
cls: "multilayer-single-tree-trigger", cls: "multilayer-single-tree-trigger",
@ -69759,6 +69878,13 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
action: function () { action: function () {
self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING); self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING);
} }
}, {
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.hideView();
}
}] }]
}, },
hideChecker: function (e) { hideChecker: function (e) {
@ -69811,6 +69937,97 @@ BI.MultiLayerSingleTreeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSingleTreeCombo.EVENT_FOCUS = "EVENT_FOCUS"; BI.MultiLayerSingleTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_single_tree_combo", BI.MultiLayerSingleTreeCombo);/** BI.shortcut("bi.multilayer_single_tree_combo", BI.MultiLayerSingleTreeCombo);/**
* Created by GUY on 2016/1/26.
*
* @class BI.MultiLayerSingleTreeInsertSearchPane
* @extends BI.Pane
*/
BI.MultiLayerSingleTreeInsertSearchPane = BI.inherit(BI.Widget, {
props: function() {
return {
baseCls: "bi-multilayer-single-tree-popup",
tipText: BI.i18nText("BI-No_Selected_Item"),
isDefaultInit: false,
itemsCreator: BI.emptyFn,
items: [],
value: ""
};
},
render: function() {
var self = this, o = this.options;
this.tree = BI.createWidget({
type: "bi.multilayer_select_level_tree",
isDefaultInit: o.isDefaultInit,
items: o.items,
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
o.itemsCreator(op, function (res) {
callback(res);
self.setKeyword(o.keywordGetter());
});
},
keywordGetter: o.keywordGetter,
value: o.value,
scrollable: null,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}, {
eventName: BI.MultiLayerSelectLevelTree.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE);
}
}]
});
return {
type: "bi.vertical",
scrolly: false,
scrollable: true,
vgap: 5,
items: [{
type: "bi.text_button",
invisible: true,
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: 24,
cls: "bi-high-light",
hgap: 5,
ref: function (_ref) {
self.addNotMatchTip = _ref;
},
handler: function () {
self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM, o.keywordGetter());
}
}, this.tree]
};
},
setKeyword: function (keyword) {
var showTip = BI.isEmptyArray(this.tree.getAllLeaves());
this.addNotMatchTip.setVisible(showTip);
showTip && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
getValue: function () {
return this.tree.getValue();
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.tree.setValue(v);
},
populate: function (items) {
this.tree.populate(items);
}
});
BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_single_tree_insert_search_pane", BI.MultiLayerSingleTreeInsertSearchPane);/**
* guy * guy
* 二级树 * 二级树
* @class BI.MultiLayerSingleLevelTree * @class BI.MultiLayerSingleLevelTree
@ -70120,7 +70337,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}] }]
}, },
popup: { popup: {
type: "bi.multilayer_single_tree_popup", type: o.allowInsertValue ? "bi.multilayer_single_tree_insert_search_pane" : "bi.multilayer_single_tree_popup",
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) { itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
op.keyword = self.editor.getValue(); op.keyword = self.editor.getValue();
o.itemsCreator(op, callback); o.itemsCreator(op, callback);
@ -70128,12 +70345,23 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
keywordGetter: function () { keywordGetter: function () {
return self.editor.getValue(); return self.editor.getValue();
}, },
cls: "bi-card" cls: "bi-card",
listeners: [{
eventName: BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM,
action: function () {
self.options.text = self.getSearcher().getKeyword();
self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM);
}
}],
ref: function (_ref) {
self.popup = _ref;
}
}, },
onSearch: function (obj, callback) { onSearch: function (obj, callback) {
var keyword = obj.keyword; var keyword = obj.keyword;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
callback(self._getSearchItems(keyword)); callback(self._getSearchItems(keyword));
o.allowInsertValue && self.popup.setKeyword(keyword);
} else { } else {
callback(); callback();
} }
@ -70268,6 +70496,7 @@ BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSingleTreeTrigger.EVENT_STOP = "EVENT_STOP"; BI.MultiLayerSingleTreeTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSingleTreeTrigger.EVENT_START = "EVENT_START"; BI.MultiLayerSingleTreeTrigger.EVENT_START = "EVENT_START";
BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multilayer_single_tree_trigger", BI.MultiLayerSingleTreeTrigger);/** BI.shortcut("bi.multilayer_single_tree_trigger", BI.MultiLayerSingleTreeTrigger);/**
* 加号表示的组节点 * 加号表示的组节点
* *

253
dist/2.0/fineui.js vendored

@ -21871,14 +21871,16 @@ BI.prepares.push(function () {
var canvas = document.createElement("canvas"); var canvas = document.createElement("canvas");
var ratio = 2; var ratio = 2;
BI.Widget._renderEngine.createElement("body").append(canvas); BI.Widget._renderEngine.createElement("body").append(canvas);
var w = BI.DOM.getTextSizeWidth(param, 12) + 4;
var ctx = canvas.getContext("2d");
ctx.font = "12px Georgia";
var w = ctx.measureText(param).width + 4;
canvas.width = w * ratio; canvas.width = w * ratio;
canvas.height = 16 * ratio; canvas.height = 16 * ratio;
var ctx = canvas.getContext("2d");
// ctx.fillStyle = "#EAF2FD";
ctx.font = 12 * ratio + "px Georgia"; ctx.font = 12 * ratio + "px Georgia";
ctx.fillStyle = fillStyle || "#3685f2"; ctx.fillStyle = fillStyle || "#3685f2";
ctx.textBaseline = "middle"; ctx.textBaseline = "middle";
// ctx.fillStyle = "#EAF2FD";
ctx.fillText(param, 2 * ratio, 9 * ratio); ctx.fillText(param, 2 * ratio, 9 * ratio);
BI.Widget._renderEngine.createElement(canvas).destroy(); BI.Widget._renderEngine.createElement(canvas).destroy();
var backColor = backgroundColor || "rgba(54, 133, 242, 0.1)"; var backColor = backgroundColor || "rgba(54, 133, 242, 0.1)";
@ -61879,7 +61881,8 @@ BI.IconTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-icon-trigger", baseCls: "bi-icon-trigger",
extraCls: "pull-down-font",
el: {}, el: {},
height: 24 height: 24
}); });
@ -61891,7 +61894,8 @@ BI.IconTrigger = BI.inherit(BI.Trigger, {
type: "bi.trigger_icon_button", type: "bi.trigger_icon_button",
element: this, element: this,
width: o.width, width: o.width,
height: o.height height: o.height,
extraCls: o.extraCls
}); });
} }
}); });
@ -64038,7 +64042,7 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
stopPropagation: o.stopPropagation, stopPropagation: o.stopPropagation,
el: BI.createWidget(o.el, { el: BI.createWidget(o.el, {
type: "bi.icon_trigger", type: "bi.icon_trigger",
extraCls: o.iconCls ? o.iconCls : "", extraCls: o.iconCls,
width: o.width, width: o.width,
height: o.height height: o.height
}), }),
@ -68993,7 +68997,8 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
tabIndex: 0 tabIndex: 0
}, },
allowEdit: false, allowEdit: false,
allowSearchValue: false allowSearchValue: false,
allowInsertValue: false
}); });
}, },
@ -69073,6 +69078,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
return { return {
el: { el: {
type: "bi.multilayer_select_tree_trigger", type: "bi.multilayer_select_tree_trigger",
allowInsertValue: o.allowInsertValue,
allowSearchValue: o.allowSearchValue, allowSearchValue: o.allowSearchValue,
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
cls: "multilayer-select-tree-trigger", cls: "multilayer-select-tree-trigger",
@ -69111,6 +69117,13 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
action: function () { action: function () {
self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING); self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING);
} }
}, {
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.hideView();
}
}] }]
}, },
hideChecker: function (e) { hideChecker: function (e) {
@ -69163,6 +69176,97 @@ BI.MultiLayerSelectTreeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSelectTreeCombo.EVENT_FOCUS = "EVENT_FOCUS"; BI.MultiLayerSelectTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo);/** BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo);/**
* Created by GUY on 2016/1/26.
*
* @class BI.MultiLayerSelectTreeInsertSearchPane
* @extends BI.Pane
*/
BI.MultiLayerSelectTreeInsertSearchPane = BI.inherit(BI.Widget, {
props: function() {
return {
baseCls: "bi-multilayer-select-tree-popup",
tipText: BI.i18nText("BI-No_Selected_Item"),
isDefaultInit: false,
itemsCreator: BI.emptyFn,
items: [],
value: ""
};
},
render: function() {
var self = this, o = this.options;
this.tree = BI.createWidget({
type: "bi.multilayer_select_level_tree",
isDefaultInit: o.isDefaultInit,
items: o.items,
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
o.itemsCreator(op, function (res) {
callback(res);
self.setKeyword(o.keywordGetter());
});
},
keywordGetter: o.keywordGetter,
value: o.value,
scrollable: null,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}, {
eventName: BI.MultiLayerSelectLevelTree.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE);
}
}]
});
return {
type: "bi.vertical",
scrolly: false,
scrollable: true,
vgap: 5,
items: [{
type: "bi.text_button",
invisible: true,
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: 24,
cls: "bi-high-light",
hgap: 5,
ref: function (_ref) {
self.addNotMatchTip = _ref;
},
handler: function () {
self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM, o.keywordGetter());
}
}, this.tree]
};
},
setKeyword: function (keyword) {
var showTip = BI.isEmptyArray(this.tree.getAllLeaves());
this.addNotMatchTip.setVisible(showTip);
showTip && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
getValue: function () {
return this.tree.getValue();
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.tree.setValue(v);
},
populate: function (items) {
this.tree.populate(items);
}
});
BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_select_tree_insert_search_pane", BI.MultiLayerSelectTreeInsertSearchPane);/**
* guy * guy
* 二级树 * 二级树
* @class BI.MultiLayerSelectLevelTree * @class BI.MultiLayerSelectLevelTree
@ -69472,7 +69576,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}] }]
}, },
popup: { popup: {
type: "bi.multilayer_select_tree_popup", type: o.allowInsertValue ? "bi.multilayer_select_tree_insert_search_pane" : "bi.multilayer_select_tree_popup",
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) { itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
op.keyword = self.editor.getValue(); op.keyword = self.editor.getValue();
o.itemsCreator(op, callback); o.itemsCreator(op, callback);
@ -69480,12 +69584,23 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
keywordGetter: function () { keywordGetter: function () {
return self.editor.getValue(); return self.editor.getValue();
}, },
cls: "bi-card" cls: "bi-card",
listeners: [{
eventName: BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM,
action: function () {
self.options.text = self.getSearcher().getKeyword();
self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM);
}
}],
ref: function (_ref) {
self.popup = _ref;
}
}, },
onSearch: function (obj, callback) { onSearch: function (obj, callback) {
var keyword = obj.keyword; var keyword = obj.keyword;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
callback(self._getSearchItems(keyword)); callback(self._getSearchItems(keyword));
o.allowInsertValue && self.popup.setKeyword(keyword);
} else { } else {
callback(); callback();
} }
@ -69620,6 +69735,7 @@ BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSelectTreeTrigger.EVENT_STOP = "EVENT_STOP"; BI.MultiLayerSelectTreeTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSelectTreeTrigger.EVENT_START = "EVENT_START"; BI.MultiLayerSelectTreeTrigger.EVENT_START = "EVENT_START";
BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multilayer_select_tree_trigger", BI.MultiLayerSelectTreeTrigger);/** BI.shortcut("bi.multilayer_select_tree_trigger", BI.MultiLayerSelectTreeTrigger);/**
* 加号表示的组节点 * 加号表示的组节点
* *
@ -70045,7 +70161,9 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
attributes: { attributes: {
tabIndex: 0 tabIndex: 0
}, },
allowEdit: false allowEdit: false,
allowSearchValue: false,
allowInsertValue: false
}); });
}, },
@ -70125,6 +70243,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
return { return {
el: { el: {
type: "bi.multilayer_single_tree_trigger", type: "bi.multilayer_single_tree_trigger",
allowInsertValue: o.allowInsertValue,
allowSearchValue: o.allowSearchValue, allowSearchValue: o.allowSearchValue,
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
cls: "multilayer-single-tree-trigger", cls: "multilayer-single-tree-trigger",
@ -70163,6 +70282,13 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
action: function () { action: function () {
self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING); self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING);
} }
}, {
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.hideView();
}
}] }]
}, },
hideChecker: function (e) { hideChecker: function (e) {
@ -70215,6 +70341,97 @@ BI.MultiLayerSingleTreeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSingleTreeCombo.EVENT_FOCUS = "EVENT_FOCUS"; BI.MultiLayerSingleTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_single_tree_combo", BI.MultiLayerSingleTreeCombo);/** BI.shortcut("bi.multilayer_single_tree_combo", BI.MultiLayerSingleTreeCombo);/**
* Created by GUY on 2016/1/26.
*
* @class BI.MultiLayerSingleTreeInsertSearchPane
* @extends BI.Pane
*/
BI.MultiLayerSingleTreeInsertSearchPane = BI.inherit(BI.Widget, {
props: function() {
return {
baseCls: "bi-multilayer-single-tree-popup",
tipText: BI.i18nText("BI-No_Selected_Item"),
isDefaultInit: false,
itemsCreator: BI.emptyFn,
items: [],
value: ""
};
},
render: function() {
var self = this, o = this.options;
this.tree = BI.createWidget({
type: "bi.multilayer_select_level_tree",
isDefaultInit: o.isDefaultInit,
items: o.items,
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
o.itemsCreator(op, function (res) {
callback(res);
self.setKeyword(o.keywordGetter());
});
},
keywordGetter: o.keywordGetter,
value: o.value,
scrollable: null,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}, {
eventName: BI.MultiLayerSelectLevelTree.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE);
}
}]
});
return {
type: "bi.vertical",
scrolly: false,
scrollable: true,
vgap: 5,
items: [{
type: "bi.text_button",
invisible: true,
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: 24,
cls: "bi-high-light",
hgap: 5,
ref: function (_ref) {
self.addNotMatchTip = _ref;
},
handler: function () {
self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM, o.keywordGetter());
}
}, this.tree]
};
},
setKeyword: function (keyword) {
var showTip = BI.isEmptyArray(this.tree.getAllLeaves());
this.addNotMatchTip.setVisible(showTip);
showTip && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
getValue: function () {
return this.tree.getValue();
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.tree.setValue(v);
},
populate: function (items) {
this.tree.populate(items);
}
});
BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_single_tree_insert_search_pane", BI.MultiLayerSingleTreeInsertSearchPane);/**
* guy * guy
* 二级树 * 二级树
* @class BI.MultiLayerSingleLevelTree * @class BI.MultiLayerSingleLevelTree
@ -70524,7 +70741,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}] }]
}, },
popup: { popup: {
type: "bi.multilayer_single_tree_popup", type: o.allowInsertValue ? "bi.multilayer_single_tree_insert_search_pane" : "bi.multilayer_single_tree_popup",
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) { itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
op.keyword = self.editor.getValue(); op.keyword = self.editor.getValue();
o.itemsCreator(op, callback); o.itemsCreator(op, callback);
@ -70532,12 +70749,23 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
keywordGetter: function () { keywordGetter: function () {
return self.editor.getValue(); return self.editor.getValue();
}, },
cls: "bi-card" cls: "bi-card",
listeners: [{
eventName: BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM,
action: function () {
self.options.text = self.getSearcher().getKeyword();
self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM);
}
}],
ref: function (_ref) {
self.popup = _ref;
}
}, },
onSearch: function (obj, callback) { onSearch: function (obj, callback) {
var keyword = obj.keyword; var keyword = obj.keyword;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
callback(self._getSearchItems(keyword)); callback(self._getSearchItems(keyword));
o.allowInsertValue && self.popup.setKeyword(keyword);
} else { } else {
callback(); callback();
} }
@ -70672,6 +70900,7 @@ BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSingleTreeTrigger.EVENT_STOP = "EVENT_STOP"; BI.MultiLayerSingleTreeTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSingleTreeTrigger.EVENT_START = "EVENT_START"; BI.MultiLayerSingleTreeTrigger.EVENT_START = "EVENT_START";
BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multilayer_single_tree_trigger", BI.MultiLayerSingleTreeTrigger);/** BI.shortcut("bi.multilayer_single_tree_trigger", BI.MultiLayerSingleTreeTrigger);/**
* 加号表示的组节点 * 加号表示的组节点
* *

253
dist/bundle.ie.js vendored

@ -21871,14 +21871,16 @@ BI.prepares.push(function () {
var canvas = document.createElement("canvas"); var canvas = document.createElement("canvas");
var ratio = 2; var ratio = 2;
BI.Widget._renderEngine.createElement("body").append(canvas); BI.Widget._renderEngine.createElement("body").append(canvas);
var w = BI.DOM.getTextSizeWidth(param, 12) + 4;
var ctx = canvas.getContext("2d");
ctx.font = "12px Georgia";
var w = ctx.measureText(param).width + 4;
canvas.width = w * ratio; canvas.width = w * ratio;
canvas.height = 16 * ratio; canvas.height = 16 * ratio;
var ctx = canvas.getContext("2d");
// ctx.fillStyle = "#EAF2FD";
ctx.font = 12 * ratio + "px Georgia"; ctx.font = 12 * ratio + "px Georgia";
ctx.fillStyle = fillStyle || "#3685f2"; ctx.fillStyle = fillStyle || "#3685f2";
ctx.textBaseline = "middle"; ctx.textBaseline = "middle";
// ctx.fillStyle = "#EAF2FD";
ctx.fillText(param, 2 * ratio, 9 * ratio); ctx.fillText(param, 2 * ratio, 9 * ratio);
BI.Widget._renderEngine.createElement(canvas).destroy(); BI.Widget._renderEngine.createElement(canvas).destroy();
var backColor = backgroundColor || "rgba(54, 133, 242, 0.1)"; var backColor = backgroundColor || "rgba(54, 133, 242, 0.1)";
@ -61475,7 +61477,8 @@ BI.IconTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-icon-trigger", baseCls: "bi-icon-trigger",
extraCls: "pull-down-font",
el: {}, el: {},
height: 24 height: 24
}); });
@ -61487,7 +61490,8 @@ BI.IconTrigger = BI.inherit(BI.Trigger, {
type: "bi.trigger_icon_button", type: "bi.trigger_icon_button",
element: this, element: this,
width: o.width, width: o.width,
height: o.height height: o.height,
extraCls: o.extraCls
}); });
} }
}); });
@ -63634,7 +63638,7 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
stopPropagation: o.stopPropagation, stopPropagation: o.stopPropagation,
el: BI.createWidget(o.el, { el: BI.createWidget(o.el, {
type: "bi.icon_trigger", type: "bi.icon_trigger",
extraCls: o.iconCls ? o.iconCls : "", extraCls: o.iconCls,
width: o.width, width: o.width,
height: o.height height: o.height
}), }),
@ -68589,7 +68593,8 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
tabIndex: 0 tabIndex: 0
}, },
allowEdit: false, allowEdit: false,
allowSearchValue: false allowSearchValue: false,
allowInsertValue: false
}); });
}, },
@ -68669,6 +68674,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
return { return {
el: { el: {
type: "bi.multilayer_select_tree_trigger", type: "bi.multilayer_select_tree_trigger",
allowInsertValue: o.allowInsertValue,
allowSearchValue: o.allowSearchValue, allowSearchValue: o.allowSearchValue,
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
cls: "multilayer-select-tree-trigger", cls: "multilayer-select-tree-trigger",
@ -68707,6 +68713,13 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
action: function () { action: function () {
self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING); self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING);
} }
}, {
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.hideView();
}
}] }]
}, },
hideChecker: function (e) { hideChecker: function (e) {
@ -68759,6 +68772,97 @@ BI.MultiLayerSelectTreeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSelectTreeCombo.EVENT_FOCUS = "EVENT_FOCUS"; BI.MultiLayerSelectTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo);/** BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo);/**
* Created by GUY on 2016/1/26.
*
* @class BI.MultiLayerSelectTreeInsertSearchPane
* @extends BI.Pane
*/
BI.MultiLayerSelectTreeInsertSearchPane = BI.inherit(BI.Widget, {
props: function() {
return {
baseCls: "bi-multilayer-select-tree-popup",
tipText: BI.i18nText("BI-No_Selected_Item"),
isDefaultInit: false,
itemsCreator: BI.emptyFn,
items: [],
value: ""
};
},
render: function() {
var self = this, o = this.options;
this.tree = BI.createWidget({
type: "bi.multilayer_select_level_tree",
isDefaultInit: o.isDefaultInit,
items: o.items,
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
o.itemsCreator(op, function (res) {
callback(res);
self.setKeyword(o.keywordGetter());
});
},
keywordGetter: o.keywordGetter,
value: o.value,
scrollable: null,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}, {
eventName: BI.MultiLayerSelectLevelTree.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE);
}
}]
});
return {
type: "bi.vertical",
scrolly: false,
scrollable: true,
vgap: 5,
items: [{
type: "bi.text_button",
invisible: true,
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: 24,
cls: "bi-high-light",
hgap: 5,
ref: function (_ref) {
self.addNotMatchTip = _ref;
},
handler: function () {
self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM, o.keywordGetter());
}
}, this.tree]
};
},
setKeyword: function (keyword) {
var showTip = BI.isEmptyArray(this.tree.getAllLeaves());
this.addNotMatchTip.setVisible(showTip);
showTip && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
getValue: function () {
return this.tree.getValue();
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.tree.setValue(v);
},
populate: function (items) {
this.tree.populate(items);
}
});
BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_select_tree_insert_search_pane", BI.MultiLayerSelectTreeInsertSearchPane);/**
* guy * guy
* 二级树 * 二级树
* @class BI.MultiLayerSelectLevelTree * @class BI.MultiLayerSelectLevelTree
@ -69068,7 +69172,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}] }]
}, },
popup: { popup: {
type: "bi.multilayer_select_tree_popup", type: o.allowInsertValue ? "bi.multilayer_select_tree_insert_search_pane" : "bi.multilayer_select_tree_popup",
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) { itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
op.keyword = self.editor.getValue(); op.keyword = self.editor.getValue();
o.itemsCreator(op, callback); o.itemsCreator(op, callback);
@ -69076,12 +69180,23 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
keywordGetter: function () { keywordGetter: function () {
return self.editor.getValue(); return self.editor.getValue();
}, },
cls: "bi-card" cls: "bi-card",
listeners: [{
eventName: BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM,
action: function () {
self.options.text = self.getSearcher().getKeyword();
self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM);
}
}],
ref: function (_ref) {
self.popup = _ref;
}
}, },
onSearch: function (obj, callback) { onSearch: function (obj, callback) {
var keyword = obj.keyword; var keyword = obj.keyword;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
callback(self._getSearchItems(keyword)); callback(self._getSearchItems(keyword));
o.allowInsertValue && self.popup.setKeyword(keyword);
} else { } else {
callback(); callback();
} }
@ -69216,6 +69331,7 @@ BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSelectTreeTrigger.EVENT_STOP = "EVENT_STOP"; BI.MultiLayerSelectTreeTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSelectTreeTrigger.EVENT_START = "EVENT_START"; BI.MultiLayerSelectTreeTrigger.EVENT_START = "EVENT_START";
BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multilayer_select_tree_trigger", BI.MultiLayerSelectTreeTrigger);/** BI.shortcut("bi.multilayer_select_tree_trigger", BI.MultiLayerSelectTreeTrigger);/**
* 加号表示的组节点 * 加号表示的组节点
* *
@ -69641,7 +69757,9 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
attributes: { attributes: {
tabIndex: 0 tabIndex: 0
}, },
allowEdit: false allowEdit: false,
allowSearchValue: false,
allowInsertValue: false
}); });
}, },
@ -69721,6 +69839,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
return { return {
el: { el: {
type: "bi.multilayer_single_tree_trigger", type: "bi.multilayer_single_tree_trigger",
allowInsertValue: o.allowInsertValue,
allowSearchValue: o.allowSearchValue, allowSearchValue: o.allowSearchValue,
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
cls: "multilayer-single-tree-trigger", cls: "multilayer-single-tree-trigger",
@ -69759,6 +69878,13 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
action: function () { action: function () {
self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING); self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING);
} }
}, {
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.hideView();
}
}] }]
}, },
hideChecker: function (e) { hideChecker: function (e) {
@ -69811,6 +69937,97 @@ BI.MultiLayerSingleTreeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSingleTreeCombo.EVENT_FOCUS = "EVENT_FOCUS"; BI.MultiLayerSingleTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_single_tree_combo", BI.MultiLayerSingleTreeCombo);/** BI.shortcut("bi.multilayer_single_tree_combo", BI.MultiLayerSingleTreeCombo);/**
* Created by GUY on 2016/1/26.
*
* @class BI.MultiLayerSingleTreeInsertSearchPane
* @extends BI.Pane
*/
BI.MultiLayerSingleTreeInsertSearchPane = BI.inherit(BI.Widget, {
props: function() {
return {
baseCls: "bi-multilayer-single-tree-popup",
tipText: BI.i18nText("BI-No_Selected_Item"),
isDefaultInit: false,
itemsCreator: BI.emptyFn,
items: [],
value: ""
};
},
render: function() {
var self = this, o = this.options;
this.tree = BI.createWidget({
type: "bi.multilayer_select_level_tree",
isDefaultInit: o.isDefaultInit,
items: o.items,
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
o.itemsCreator(op, function (res) {
callback(res);
self.setKeyword(o.keywordGetter());
});
},
keywordGetter: o.keywordGetter,
value: o.value,
scrollable: null,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}, {
eventName: BI.MultiLayerSelectLevelTree.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE);
}
}]
});
return {
type: "bi.vertical",
scrolly: false,
scrollable: true,
vgap: 5,
items: [{
type: "bi.text_button",
invisible: true,
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: 24,
cls: "bi-high-light",
hgap: 5,
ref: function (_ref) {
self.addNotMatchTip = _ref;
},
handler: function () {
self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM, o.keywordGetter());
}
}, this.tree]
};
},
setKeyword: function (keyword) {
var showTip = BI.isEmptyArray(this.tree.getAllLeaves());
this.addNotMatchTip.setVisible(showTip);
showTip && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
getValue: function () {
return this.tree.getValue();
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.tree.setValue(v);
},
populate: function (items) {
this.tree.populate(items);
}
});
BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_single_tree_insert_search_pane", BI.MultiLayerSingleTreeInsertSearchPane);/**
* guy * guy
* 二级树 * 二级树
* @class BI.MultiLayerSingleLevelTree * @class BI.MultiLayerSingleLevelTree
@ -70120,7 +70337,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}] }]
}, },
popup: { popup: {
type: "bi.multilayer_single_tree_popup", type: o.allowInsertValue ? "bi.multilayer_single_tree_insert_search_pane" : "bi.multilayer_single_tree_popup",
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) { itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
op.keyword = self.editor.getValue(); op.keyword = self.editor.getValue();
o.itemsCreator(op, callback); o.itemsCreator(op, callback);
@ -70128,12 +70345,23 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
keywordGetter: function () { keywordGetter: function () {
return self.editor.getValue(); return self.editor.getValue();
}, },
cls: "bi-card" cls: "bi-card",
listeners: [{
eventName: BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM,
action: function () {
self.options.text = self.getSearcher().getKeyword();
self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM);
}
}],
ref: function (_ref) {
self.popup = _ref;
}
}, },
onSearch: function (obj, callback) { onSearch: function (obj, callback) {
var keyword = obj.keyword; var keyword = obj.keyword;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
callback(self._getSearchItems(keyword)); callback(self._getSearchItems(keyword));
o.allowInsertValue && self.popup.setKeyword(keyword);
} else { } else {
callback(); callback();
} }
@ -70268,6 +70496,7 @@ BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSingleTreeTrigger.EVENT_STOP = "EVENT_STOP"; BI.MultiLayerSingleTreeTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSingleTreeTrigger.EVENT_START = "EVENT_START"; BI.MultiLayerSingleTreeTrigger.EVENT_START = "EVENT_START";
BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multilayer_single_tree_trigger", BI.MultiLayerSingleTreeTrigger);/** BI.shortcut("bi.multilayer_single_tree_trigger", BI.MultiLayerSingleTreeTrigger);/**
* 加号表示的组节点 * 加号表示的组节点
* *

253
dist/bundle.js vendored

@ -21871,14 +21871,16 @@ BI.prepares.push(function () {
var canvas = document.createElement("canvas"); var canvas = document.createElement("canvas");
var ratio = 2; var ratio = 2;
BI.Widget._renderEngine.createElement("body").append(canvas); BI.Widget._renderEngine.createElement("body").append(canvas);
var w = BI.DOM.getTextSizeWidth(param, 12) + 4;
var ctx = canvas.getContext("2d");
ctx.font = "12px Georgia";
var w = ctx.measureText(param).width + 4;
canvas.width = w * ratio; canvas.width = w * ratio;
canvas.height = 16 * ratio; canvas.height = 16 * ratio;
var ctx = canvas.getContext("2d");
// ctx.fillStyle = "#EAF2FD";
ctx.font = 12 * ratio + "px Georgia"; ctx.font = 12 * ratio + "px Georgia";
ctx.fillStyle = fillStyle || "#3685f2"; ctx.fillStyle = fillStyle || "#3685f2";
ctx.textBaseline = "middle"; ctx.textBaseline = "middle";
// ctx.fillStyle = "#EAF2FD";
ctx.fillText(param, 2 * ratio, 9 * ratio); ctx.fillText(param, 2 * ratio, 9 * ratio);
BI.Widget._renderEngine.createElement(canvas).destroy(); BI.Widget._renderEngine.createElement(canvas).destroy();
var backColor = backgroundColor || "rgba(54, 133, 242, 0.1)"; var backColor = backgroundColor || "rgba(54, 133, 242, 0.1)";
@ -61879,7 +61881,8 @@ BI.IconTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-icon-trigger", baseCls: "bi-icon-trigger",
extraCls: "pull-down-font",
el: {}, el: {},
height: 24 height: 24
}); });
@ -61891,7 +61894,8 @@ BI.IconTrigger = BI.inherit(BI.Trigger, {
type: "bi.trigger_icon_button", type: "bi.trigger_icon_button",
element: this, element: this,
width: o.width, width: o.width,
height: o.height height: o.height,
extraCls: o.extraCls
}); });
} }
}); });
@ -64038,7 +64042,7 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
stopPropagation: o.stopPropagation, stopPropagation: o.stopPropagation,
el: BI.createWidget(o.el, { el: BI.createWidget(o.el, {
type: "bi.icon_trigger", type: "bi.icon_trigger",
extraCls: o.iconCls ? o.iconCls : "", extraCls: o.iconCls,
width: o.width, width: o.width,
height: o.height height: o.height
}), }),
@ -68993,7 +68997,8 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
tabIndex: 0 tabIndex: 0
}, },
allowEdit: false, allowEdit: false,
allowSearchValue: false allowSearchValue: false,
allowInsertValue: false
}); });
}, },
@ -69073,6 +69078,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
return { return {
el: { el: {
type: "bi.multilayer_select_tree_trigger", type: "bi.multilayer_select_tree_trigger",
allowInsertValue: o.allowInsertValue,
allowSearchValue: o.allowSearchValue, allowSearchValue: o.allowSearchValue,
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
cls: "multilayer-select-tree-trigger", cls: "multilayer-select-tree-trigger",
@ -69111,6 +69117,13 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
action: function () { action: function () {
self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING); self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING);
} }
}, {
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.hideView();
}
}] }]
}, },
hideChecker: function (e) { hideChecker: function (e) {
@ -69163,6 +69176,97 @@ BI.MultiLayerSelectTreeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSelectTreeCombo.EVENT_FOCUS = "EVENT_FOCUS"; BI.MultiLayerSelectTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo);/** BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo);/**
* Created by GUY on 2016/1/26.
*
* @class BI.MultiLayerSelectTreeInsertSearchPane
* @extends BI.Pane
*/
BI.MultiLayerSelectTreeInsertSearchPane = BI.inherit(BI.Widget, {
props: function() {
return {
baseCls: "bi-multilayer-select-tree-popup",
tipText: BI.i18nText("BI-No_Selected_Item"),
isDefaultInit: false,
itemsCreator: BI.emptyFn,
items: [],
value: ""
};
},
render: function() {
var self = this, o = this.options;
this.tree = BI.createWidget({
type: "bi.multilayer_select_level_tree",
isDefaultInit: o.isDefaultInit,
items: o.items,
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
o.itemsCreator(op, function (res) {
callback(res);
self.setKeyword(o.keywordGetter());
});
},
keywordGetter: o.keywordGetter,
value: o.value,
scrollable: null,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}, {
eventName: BI.MultiLayerSelectLevelTree.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE);
}
}]
});
return {
type: "bi.vertical",
scrolly: false,
scrollable: true,
vgap: 5,
items: [{
type: "bi.text_button",
invisible: true,
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: 24,
cls: "bi-high-light",
hgap: 5,
ref: function (_ref) {
self.addNotMatchTip = _ref;
},
handler: function () {
self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM, o.keywordGetter());
}
}, this.tree]
};
},
setKeyword: function (keyword) {
var showTip = BI.isEmptyArray(this.tree.getAllLeaves());
this.addNotMatchTip.setVisible(showTip);
showTip && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
getValue: function () {
return this.tree.getValue();
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.tree.setValue(v);
},
populate: function (items) {
this.tree.populate(items);
}
});
BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_select_tree_insert_search_pane", BI.MultiLayerSelectTreeInsertSearchPane);/**
* guy * guy
* 二级树 * 二级树
* @class BI.MultiLayerSelectLevelTree * @class BI.MultiLayerSelectLevelTree
@ -69472,7 +69576,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}] }]
}, },
popup: { popup: {
type: "bi.multilayer_select_tree_popup", type: o.allowInsertValue ? "bi.multilayer_select_tree_insert_search_pane" : "bi.multilayer_select_tree_popup",
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) { itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
op.keyword = self.editor.getValue(); op.keyword = self.editor.getValue();
o.itemsCreator(op, callback); o.itemsCreator(op, callback);
@ -69480,12 +69584,23 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
keywordGetter: function () { keywordGetter: function () {
return self.editor.getValue(); return self.editor.getValue();
}, },
cls: "bi-card" cls: "bi-card",
listeners: [{
eventName: BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM,
action: function () {
self.options.text = self.getSearcher().getKeyword();
self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM);
}
}],
ref: function (_ref) {
self.popup = _ref;
}
}, },
onSearch: function (obj, callback) { onSearch: function (obj, callback) {
var keyword = obj.keyword; var keyword = obj.keyword;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
callback(self._getSearchItems(keyword)); callback(self._getSearchItems(keyword));
o.allowInsertValue && self.popup.setKeyword(keyword);
} else { } else {
callback(); callback();
} }
@ -69620,6 +69735,7 @@ BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSelectTreeTrigger.EVENT_STOP = "EVENT_STOP"; BI.MultiLayerSelectTreeTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSelectTreeTrigger.EVENT_START = "EVENT_START"; BI.MultiLayerSelectTreeTrigger.EVENT_START = "EVENT_START";
BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multilayer_select_tree_trigger", BI.MultiLayerSelectTreeTrigger);/** BI.shortcut("bi.multilayer_select_tree_trigger", BI.MultiLayerSelectTreeTrigger);/**
* 加号表示的组节点 * 加号表示的组节点
* *
@ -70045,7 +70161,9 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
attributes: { attributes: {
tabIndex: 0 tabIndex: 0
}, },
allowEdit: false allowEdit: false,
allowSearchValue: false,
allowInsertValue: false
}); });
}, },
@ -70125,6 +70243,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
return { return {
el: { el: {
type: "bi.multilayer_single_tree_trigger", type: "bi.multilayer_single_tree_trigger",
allowInsertValue: o.allowInsertValue,
allowSearchValue: o.allowSearchValue, allowSearchValue: o.allowSearchValue,
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
cls: "multilayer-single-tree-trigger", cls: "multilayer-single-tree-trigger",
@ -70163,6 +70282,13 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
action: function () { action: function () {
self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING); self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING);
} }
}, {
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.hideView();
}
}] }]
}, },
hideChecker: function (e) { hideChecker: function (e) {
@ -70215,6 +70341,97 @@ BI.MultiLayerSingleTreeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSingleTreeCombo.EVENT_FOCUS = "EVENT_FOCUS"; BI.MultiLayerSingleTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_single_tree_combo", BI.MultiLayerSingleTreeCombo);/** BI.shortcut("bi.multilayer_single_tree_combo", BI.MultiLayerSingleTreeCombo);/**
* Created by GUY on 2016/1/26.
*
* @class BI.MultiLayerSingleTreeInsertSearchPane
* @extends BI.Pane
*/
BI.MultiLayerSingleTreeInsertSearchPane = BI.inherit(BI.Widget, {
props: function() {
return {
baseCls: "bi-multilayer-single-tree-popup",
tipText: BI.i18nText("BI-No_Selected_Item"),
isDefaultInit: false,
itemsCreator: BI.emptyFn,
items: [],
value: ""
};
},
render: function() {
var self = this, o = this.options;
this.tree = BI.createWidget({
type: "bi.multilayer_select_level_tree",
isDefaultInit: o.isDefaultInit,
items: o.items,
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
o.itemsCreator(op, function (res) {
callback(res);
self.setKeyword(o.keywordGetter());
});
},
keywordGetter: o.keywordGetter,
value: o.value,
scrollable: null,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}, {
eventName: BI.MultiLayerSelectLevelTree.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE);
}
}]
});
return {
type: "bi.vertical",
scrolly: false,
scrollable: true,
vgap: 5,
items: [{
type: "bi.text_button",
invisible: true,
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: 24,
cls: "bi-high-light",
hgap: 5,
ref: function (_ref) {
self.addNotMatchTip = _ref;
},
handler: function () {
self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM, o.keywordGetter());
}
}, this.tree]
};
},
setKeyword: function (keyword) {
var showTip = BI.isEmptyArray(this.tree.getAllLeaves());
this.addNotMatchTip.setVisible(showTip);
showTip && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
getValue: function () {
return this.tree.getValue();
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.tree.setValue(v);
},
populate: function (items) {
this.tree.populate(items);
}
});
BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_single_tree_insert_search_pane", BI.MultiLayerSingleTreeInsertSearchPane);/**
* guy * guy
* 二级树 * 二级树
* @class BI.MultiLayerSingleLevelTree * @class BI.MultiLayerSingleLevelTree
@ -70524,7 +70741,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}] }]
}, },
popup: { popup: {
type: "bi.multilayer_single_tree_popup", type: o.allowInsertValue ? "bi.multilayer_single_tree_insert_search_pane" : "bi.multilayer_single_tree_popup",
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) { itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
op.keyword = self.editor.getValue(); op.keyword = self.editor.getValue();
o.itemsCreator(op, callback); o.itemsCreator(op, callback);
@ -70532,12 +70749,23 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
keywordGetter: function () { keywordGetter: function () {
return self.editor.getValue(); return self.editor.getValue();
}, },
cls: "bi-card" cls: "bi-card",
listeners: [{
eventName: BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM,
action: function () {
self.options.text = self.getSearcher().getKeyword();
self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM);
}
}],
ref: function (_ref) {
self.popup = _ref;
}
}, },
onSearch: function (obj, callback) { onSearch: function (obj, callback) {
var keyword = obj.keyword; var keyword = obj.keyword;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
callback(self._getSearchItems(keyword)); callback(self._getSearchItems(keyword));
o.allowInsertValue && self.popup.setKeyword(keyword);
} else { } else {
callback(); callback();
} }
@ -70672,6 +70900,7 @@ BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSingleTreeTrigger.EVENT_STOP = "EVENT_STOP"; BI.MultiLayerSingleTreeTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSingleTreeTrigger.EVENT_START = "EVENT_START"; BI.MultiLayerSingleTreeTrigger.EVENT_START = "EVENT_START";
BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multilayer_single_tree_trigger", BI.MultiLayerSingleTreeTrigger);/** BI.shortcut("bi.multilayer_single_tree_trigger", BI.MultiLayerSingleTreeTrigger);/**
* 加号表示的组节点 * 加号表示的组节点
* *

6
dist/case.js vendored

@ -9453,7 +9453,8 @@ BI.IconTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-icon-trigger", baseCls: "bi-icon-trigger",
extraCls: "pull-down-font",
el: {}, el: {},
height: 24 height: 24
}); });
@ -9465,7 +9466,8 @@ BI.IconTrigger = BI.inherit(BI.Trigger, {
type: "bi.trigger_icon_button", type: "bi.trigger_icon_button",
element: this, element: this,
width: o.width, width: o.width,
height: o.height height: o.height,
extraCls: o.extraCls
}); });
} }
}); });

8
dist/core.js vendored

@ -21871,14 +21871,16 @@ BI.prepares.push(function () {
var canvas = document.createElement("canvas"); var canvas = document.createElement("canvas");
var ratio = 2; var ratio = 2;
BI.Widget._renderEngine.createElement("body").append(canvas); BI.Widget._renderEngine.createElement("body").append(canvas);
var w = BI.DOM.getTextSizeWidth(param, 12) + 4;
var ctx = canvas.getContext("2d");
ctx.font = "12px Georgia";
var w = ctx.measureText(param).width + 4;
canvas.width = w * ratio; canvas.width = w * ratio;
canvas.height = 16 * ratio; canvas.height = 16 * ratio;
var ctx = canvas.getContext("2d");
// ctx.fillStyle = "#EAF2FD";
ctx.font = 12 * ratio + "px Georgia"; ctx.font = 12 * ratio + "px Georgia";
ctx.fillStyle = fillStyle || "#3685f2"; ctx.fillStyle = fillStyle || "#3685f2";
ctx.textBaseline = "middle"; ctx.textBaseline = "middle";
// ctx.fillStyle = "#EAF2FD";
ctx.fillText(param, 2 * ratio, 9 * ratio); ctx.fillText(param, 2 * ratio, 9 * ratio);
BI.Widget._renderEngine.createElement(canvas).destroy(); BI.Widget._renderEngine.createElement(canvas).destroy();
var backColor = backgroundColor || "rgba(54, 133, 242, 0.1)"; var backColor = backgroundColor || "rgba(54, 133, 242, 0.1)";

253
dist/fineui.ie.js vendored

@ -22116,14 +22116,16 @@ BI.prepares.push(function () {
var canvas = document.createElement("canvas"); var canvas = document.createElement("canvas");
var ratio = 2; var ratio = 2;
BI.Widget._renderEngine.createElement("body").append(canvas); BI.Widget._renderEngine.createElement("body").append(canvas);
var w = BI.DOM.getTextSizeWidth(param, 12) + 4;
var ctx = canvas.getContext("2d");
ctx.font = "12px Georgia";
var w = ctx.measureText(param).width + 4;
canvas.width = w * ratio; canvas.width = w * ratio;
canvas.height = 16 * ratio; canvas.height = 16 * ratio;
var ctx = canvas.getContext("2d");
// ctx.fillStyle = "#EAF2FD";
ctx.font = 12 * ratio + "px Georgia"; ctx.font = 12 * ratio + "px Georgia";
ctx.fillStyle = fillStyle || "#3685f2"; ctx.fillStyle = fillStyle || "#3685f2";
ctx.textBaseline = "middle"; ctx.textBaseline = "middle";
// ctx.fillStyle = "#EAF2FD";
ctx.fillText(param, 2 * ratio, 9 * ratio); ctx.fillText(param, 2 * ratio, 9 * ratio);
BI.Widget._renderEngine.createElement(canvas).destroy(); BI.Widget._renderEngine.createElement(canvas).destroy();
var backColor = backgroundColor || "rgba(54, 133, 242, 0.1)"; var backColor = backgroundColor || "rgba(54, 133, 242, 0.1)";
@ -61720,7 +61722,8 @@ BI.IconTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-icon-trigger", baseCls: "bi-icon-trigger",
extraCls: "pull-down-font",
el: {}, el: {},
height: 24 height: 24
}); });
@ -61732,7 +61735,8 @@ BI.IconTrigger = BI.inherit(BI.Trigger, {
type: "bi.trigger_icon_button", type: "bi.trigger_icon_button",
element: this, element: this,
width: o.width, width: o.width,
height: o.height height: o.height,
extraCls: o.extraCls
}); });
} }
}); });
@ -63879,7 +63883,7 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
stopPropagation: o.stopPropagation, stopPropagation: o.stopPropagation,
el: BI.createWidget(o.el, { el: BI.createWidget(o.el, {
type: "bi.icon_trigger", type: "bi.icon_trigger",
extraCls: o.iconCls ? o.iconCls : "", extraCls: o.iconCls,
width: o.width, width: o.width,
height: o.height height: o.height
}), }),
@ -68834,7 +68838,8 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
tabIndex: 0 tabIndex: 0
}, },
allowEdit: false, allowEdit: false,
allowSearchValue: false allowSearchValue: false,
allowInsertValue: false
}); });
}, },
@ -68914,6 +68919,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
return { return {
el: { el: {
type: "bi.multilayer_select_tree_trigger", type: "bi.multilayer_select_tree_trigger",
allowInsertValue: o.allowInsertValue,
allowSearchValue: o.allowSearchValue, allowSearchValue: o.allowSearchValue,
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
cls: "multilayer-select-tree-trigger", cls: "multilayer-select-tree-trigger",
@ -68952,6 +68958,13 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
action: function () { action: function () {
self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING); self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING);
} }
}, {
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.hideView();
}
}] }]
}, },
hideChecker: function (e) { hideChecker: function (e) {
@ -69004,6 +69017,97 @@ BI.MultiLayerSelectTreeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSelectTreeCombo.EVENT_FOCUS = "EVENT_FOCUS"; BI.MultiLayerSelectTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo);/** BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo);/**
* Created by GUY on 2016/1/26.
*
* @class BI.MultiLayerSelectTreeInsertSearchPane
* @extends BI.Pane
*/
BI.MultiLayerSelectTreeInsertSearchPane = BI.inherit(BI.Widget, {
props: function() {
return {
baseCls: "bi-multilayer-select-tree-popup",
tipText: BI.i18nText("BI-No_Selected_Item"),
isDefaultInit: false,
itemsCreator: BI.emptyFn,
items: [],
value: ""
};
},
render: function() {
var self = this, o = this.options;
this.tree = BI.createWidget({
type: "bi.multilayer_select_level_tree",
isDefaultInit: o.isDefaultInit,
items: o.items,
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
o.itemsCreator(op, function (res) {
callback(res);
self.setKeyword(o.keywordGetter());
});
},
keywordGetter: o.keywordGetter,
value: o.value,
scrollable: null,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}, {
eventName: BI.MultiLayerSelectLevelTree.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE);
}
}]
});
return {
type: "bi.vertical",
scrolly: false,
scrollable: true,
vgap: 5,
items: [{
type: "bi.text_button",
invisible: true,
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: 24,
cls: "bi-high-light",
hgap: 5,
ref: function (_ref) {
self.addNotMatchTip = _ref;
},
handler: function () {
self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM, o.keywordGetter());
}
}, this.tree]
};
},
setKeyword: function (keyword) {
var showTip = BI.isEmptyArray(this.tree.getAllLeaves());
this.addNotMatchTip.setVisible(showTip);
showTip && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
getValue: function () {
return this.tree.getValue();
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.tree.setValue(v);
},
populate: function (items) {
this.tree.populate(items);
}
});
BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_select_tree_insert_search_pane", BI.MultiLayerSelectTreeInsertSearchPane);/**
* guy * guy
* 二级树 * 二级树
* @class BI.MultiLayerSelectLevelTree * @class BI.MultiLayerSelectLevelTree
@ -69313,7 +69417,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}] }]
}, },
popup: { popup: {
type: "bi.multilayer_select_tree_popup", type: o.allowInsertValue ? "bi.multilayer_select_tree_insert_search_pane" : "bi.multilayer_select_tree_popup",
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) { itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
op.keyword = self.editor.getValue(); op.keyword = self.editor.getValue();
o.itemsCreator(op, callback); o.itemsCreator(op, callback);
@ -69321,12 +69425,23 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
keywordGetter: function () { keywordGetter: function () {
return self.editor.getValue(); return self.editor.getValue();
}, },
cls: "bi-card" cls: "bi-card",
listeners: [{
eventName: BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM,
action: function () {
self.options.text = self.getSearcher().getKeyword();
self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM);
}
}],
ref: function (_ref) {
self.popup = _ref;
}
}, },
onSearch: function (obj, callback) { onSearch: function (obj, callback) {
var keyword = obj.keyword; var keyword = obj.keyword;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
callback(self._getSearchItems(keyword)); callback(self._getSearchItems(keyword));
o.allowInsertValue && self.popup.setKeyword(keyword);
} else { } else {
callback(); callback();
} }
@ -69461,6 +69576,7 @@ BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSelectTreeTrigger.EVENT_STOP = "EVENT_STOP"; BI.MultiLayerSelectTreeTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSelectTreeTrigger.EVENT_START = "EVENT_START"; BI.MultiLayerSelectTreeTrigger.EVENT_START = "EVENT_START";
BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multilayer_select_tree_trigger", BI.MultiLayerSelectTreeTrigger);/** BI.shortcut("bi.multilayer_select_tree_trigger", BI.MultiLayerSelectTreeTrigger);/**
* 加号表示的组节点 * 加号表示的组节点
* *
@ -69886,7 +70002,9 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
attributes: { attributes: {
tabIndex: 0 tabIndex: 0
}, },
allowEdit: false allowEdit: false,
allowSearchValue: false,
allowInsertValue: false
}); });
}, },
@ -69966,6 +70084,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
return { return {
el: { el: {
type: "bi.multilayer_single_tree_trigger", type: "bi.multilayer_single_tree_trigger",
allowInsertValue: o.allowInsertValue,
allowSearchValue: o.allowSearchValue, allowSearchValue: o.allowSearchValue,
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
cls: "multilayer-single-tree-trigger", cls: "multilayer-single-tree-trigger",
@ -70004,6 +70123,13 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
action: function () { action: function () {
self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING); self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING);
} }
}, {
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.hideView();
}
}] }]
}, },
hideChecker: function (e) { hideChecker: function (e) {
@ -70056,6 +70182,97 @@ BI.MultiLayerSingleTreeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSingleTreeCombo.EVENT_FOCUS = "EVENT_FOCUS"; BI.MultiLayerSingleTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_single_tree_combo", BI.MultiLayerSingleTreeCombo);/** BI.shortcut("bi.multilayer_single_tree_combo", BI.MultiLayerSingleTreeCombo);/**
* Created by GUY on 2016/1/26.
*
* @class BI.MultiLayerSingleTreeInsertSearchPane
* @extends BI.Pane
*/
BI.MultiLayerSingleTreeInsertSearchPane = BI.inherit(BI.Widget, {
props: function() {
return {
baseCls: "bi-multilayer-single-tree-popup",
tipText: BI.i18nText("BI-No_Selected_Item"),
isDefaultInit: false,
itemsCreator: BI.emptyFn,
items: [],
value: ""
};
},
render: function() {
var self = this, o = this.options;
this.tree = BI.createWidget({
type: "bi.multilayer_select_level_tree",
isDefaultInit: o.isDefaultInit,
items: o.items,
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
o.itemsCreator(op, function (res) {
callback(res);
self.setKeyword(o.keywordGetter());
});
},
keywordGetter: o.keywordGetter,
value: o.value,
scrollable: null,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}, {
eventName: BI.MultiLayerSelectLevelTree.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE);
}
}]
});
return {
type: "bi.vertical",
scrolly: false,
scrollable: true,
vgap: 5,
items: [{
type: "bi.text_button",
invisible: true,
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: 24,
cls: "bi-high-light",
hgap: 5,
ref: function (_ref) {
self.addNotMatchTip = _ref;
},
handler: function () {
self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM, o.keywordGetter());
}
}, this.tree]
};
},
setKeyword: function (keyword) {
var showTip = BI.isEmptyArray(this.tree.getAllLeaves());
this.addNotMatchTip.setVisible(showTip);
showTip && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
getValue: function () {
return this.tree.getValue();
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.tree.setValue(v);
},
populate: function (items) {
this.tree.populate(items);
}
});
BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_single_tree_insert_search_pane", BI.MultiLayerSingleTreeInsertSearchPane);/**
* guy * guy
* 二级树 * 二级树
* @class BI.MultiLayerSingleLevelTree * @class BI.MultiLayerSingleLevelTree
@ -70365,7 +70582,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}] }]
}, },
popup: { popup: {
type: "bi.multilayer_single_tree_popup", type: o.allowInsertValue ? "bi.multilayer_single_tree_insert_search_pane" : "bi.multilayer_single_tree_popup",
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) { itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
op.keyword = self.editor.getValue(); op.keyword = self.editor.getValue();
o.itemsCreator(op, callback); o.itemsCreator(op, callback);
@ -70373,12 +70590,23 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
keywordGetter: function () { keywordGetter: function () {
return self.editor.getValue(); return self.editor.getValue();
}, },
cls: "bi-card" cls: "bi-card",
listeners: [{
eventName: BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM,
action: function () {
self.options.text = self.getSearcher().getKeyword();
self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM);
}
}],
ref: function (_ref) {
self.popup = _ref;
}
}, },
onSearch: function (obj, callback) { onSearch: function (obj, callback) {
var keyword = obj.keyword; var keyword = obj.keyword;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
callback(self._getSearchItems(keyword)); callback(self._getSearchItems(keyword));
o.allowInsertValue && self.popup.setKeyword(keyword);
} else { } else {
callback(); callback();
} }
@ -70513,6 +70741,7 @@ BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSingleTreeTrigger.EVENT_STOP = "EVENT_STOP"; BI.MultiLayerSingleTreeTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSingleTreeTrigger.EVENT_START = "EVENT_START"; BI.MultiLayerSingleTreeTrigger.EVENT_START = "EVENT_START";
BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multilayer_single_tree_trigger", BI.MultiLayerSingleTreeTrigger);/** BI.shortcut("bi.multilayer_single_tree_trigger", BI.MultiLayerSingleTreeTrigger);/**
* 加号表示的组节点 * 加号表示的组节点
* *

253
dist/fineui.js vendored

@ -22116,14 +22116,16 @@ BI.prepares.push(function () {
var canvas = document.createElement("canvas"); var canvas = document.createElement("canvas");
var ratio = 2; var ratio = 2;
BI.Widget._renderEngine.createElement("body").append(canvas); BI.Widget._renderEngine.createElement("body").append(canvas);
var w = BI.DOM.getTextSizeWidth(param, 12) + 4;
var ctx = canvas.getContext("2d");
ctx.font = "12px Georgia";
var w = ctx.measureText(param).width + 4;
canvas.width = w * ratio; canvas.width = w * ratio;
canvas.height = 16 * ratio; canvas.height = 16 * ratio;
var ctx = canvas.getContext("2d");
// ctx.fillStyle = "#EAF2FD";
ctx.font = 12 * ratio + "px Georgia"; ctx.font = 12 * ratio + "px Georgia";
ctx.fillStyle = fillStyle || "#3685f2"; ctx.fillStyle = fillStyle || "#3685f2";
ctx.textBaseline = "middle"; ctx.textBaseline = "middle";
// ctx.fillStyle = "#EAF2FD";
ctx.fillText(param, 2 * ratio, 9 * ratio); ctx.fillText(param, 2 * ratio, 9 * ratio);
BI.Widget._renderEngine.createElement(canvas).destroy(); BI.Widget._renderEngine.createElement(canvas).destroy();
var backColor = backgroundColor || "rgba(54, 133, 242, 0.1)"; var backColor = backgroundColor || "rgba(54, 133, 242, 0.1)";
@ -62124,7 +62126,8 @@ BI.IconTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-icon-trigger", baseCls: "bi-icon-trigger",
extraCls: "pull-down-font",
el: {}, el: {},
height: 24 height: 24
}); });
@ -62136,7 +62139,8 @@ BI.IconTrigger = BI.inherit(BI.Trigger, {
type: "bi.trigger_icon_button", type: "bi.trigger_icon_button",
element: this, element: this,
width: o.width, width: o.width,
height: o.height height: o.height,
extraCls: o.extraCls
}); });
} }
}); });
@ -64283,7 +64287,7 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
stopPropagation: o.stopPropagation, stopPropagation: o.stopPropagation,
el: BI.createWidget(o.el, { el: BI.createWidget(o.el, {
type: "bi.icon_trigger", type: "bi.icon_trigger",
extraCls: o.iconCls ? o.iconCls : "", extraCls: o.iconCls,
width: o.width, width: o.width,
height: o.height height: o.height
}), }),
@ -69238,7 +69242,8 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
tabIndex: 0 tabIndex: 0
}, },
allowEdit: false, allowEdit: false,
allowSearchValue: false allowSearchValue: false,
allowInsertValue: false
}); });
}, },
@ -69318,6 +69323,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
return { return {
el: { el: {
type: "bi.multilayer_select_tree_trigger", type: "bi.multilayer_select_tree_trigger",
allowInsertValue: o.allowInsertValue,
allowSearchValue: o.allowSearchValue, allowSearchValue: o.allowSearchValue,
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
cls: "multilayer-select-tree-trigger", cls: "multilayer-select-tree-trigger",
@ -69356,6 +69362,13 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
action: function () { action: function () {
self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING); self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING);
} }
}, {
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.hideView();
}
}] }]
}, },
hideChecker: function (e) { hideChecker: function (e) {
@ -69408,6 +69421,97 @@ BI.MultiLayerSelectTreeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSelectTreeCombo.EVENT_FOCUS = "EVENT_FOCUS"; BI.MultiLayerSelectTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo);/** BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo);/**
* Created by GUY on 2016/1/26.
*
* @class BI.MultiLayerSelectTreeInsertSearchPane
* @extends BI.Pane
*/
BI.MultiLayerSelectTreeInsertSearchPane = BI.inherit(BI.Widget, {
props: function() {
return {
baseCls: "bi-multilayer-select-tree-popup",
tipText: BI.i18nText("BI-No_Selected_Item"),
isDefaultInit: false,
itemsCreator: BI.emptyFn,
items: [],
value: ""
};
},
render: function() {
var self = this, o = this.options;
this.tree = BI.createWidget({
type: "bi.multilayer_select_level_tree",
isDefaultInit: o.isDefaultInit,
items: o.items,
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
o.itemsCreator(op, function (res) {
callback(res);
self.setKeyword(o.keywordGetter());
});
},
keywordGetter: o.keywordGetter,
value: o.value,
scrollable: null,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}, {
eventName: BI.MultiLayerSelectLevelTree.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE);
}
}]
});
return {
type: "bi.vertical",
scrolly: false,
scrollable: true,
vgap: 5,
items: [{
type: "bi.text_button",
invisible: true,
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: 24,
cls: "bi-high-light",
hgap: 5,
ref: function (_ref) {
self.addNotMatchTip = _ref;
},
handler: function () {
self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM, o.keywordGetter());
}
}, this.tree]
};
},
setKeyword: function (keyword) {
var showTip = BI.isEmptyArray(this.tree.getAllLeaves());
this.addNotMatchTip.setVisible(showTip);
showTip && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
getValue: function () {
return this.tree.getValue();
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.tree.setValue(v);
},
populate: function (items) {
this.tree.populate(items);
}
});
BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_select_tree_insert_search_pane", BI.MultiLayerSelectTreeInsertSearchPane);/**
* guy * guy
* 二级树 * 二级树
* @class BI.MultiLayerSelectLevelTree * @class BI.MultiLayerSelectLevelTree
@ -69717,7 +69821,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}] }]
}, },
popup: { popup: {
type: "bi.multilayer_select_tree_popup", type: o.allowInsertValue ? "bi.multilayer_select_tree_insert_search_pane" : "bi.multilayer_select_tree_popup",
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) { itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
op.keyword = self.editor.getValue(); op.keyword = self.editor.getValue();
o.itemsCreator(op, callback); o.itemsCreator(op, callback);
@ -69725,12 +69829,23 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
keywordGetter: function () { keywordGetter: function () {
return self.editor.getValue(); return self.editor.getValue();
}, },
cls: "bi-card" cls: "bi-card",
listeners: [{
eventName: BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM,
action: function () {
self.options.text = self.getSearcher().getKeyword();
self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM);
}
}],
ref: function (_ref) {
self.popup = _ref;
}
}, },
onSearch: function (obj, callback) { onSearch: function (obj, callback) {
var keyword = obj.keyword; var keyword = obj.keyword;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
callback(self._getSearchItems(keyword)); callback(self._getSearchItems(keyword));
o.allowInsertValue && self.popup.setKeyword(keyword);
} else { } else {
callback(); callback();
} }
@ -69865,6 +69980,7 @@ BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSelectTreeTrigger.EVENT_STOP = "EVENT_STOP"; BI.MultiLayerSelectTreeTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSelectTreeTrigger.EVENT_START = "EVENT_START"; BI.MultiLayerSelectTreeTrigger.EVENT_START = "EVENT_START";
BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multilayer_select_tree_trigger", BI.MultiLayerSelectTreeTrigger);/** BI.shortcut("bi.multilayer_select_tree_trigger", BI.MultiLayerSelectTreeTrigger);/**
* 加号表示的组节点 * 加号表示的组节点
* *
@ -70290,7 +70406,9 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
attributes: { attributes: {
tabIndex: 0 tabIndex: 0
}, },
allowEdit: false allowEdit: false,
allowSearchValue: false,
allowInsertValue: false
}); });
}, },
@ -70370,6 +70488,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
return { return {
el: { el: {
type: "bi.multilayer_single_tree_trigger", type: "bi.multilayer_single_tree_trigger",
allowInsertValue: o.allowInsertValue,
allowSearchValue: o.allowSearchValue, allowSearchValue: o.allowSearchValue,
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
cls: "multilayer-single-tree-trigger", cls: "multilayer-single-tree-trigger",
@ -70408,6 +70527,13 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
action: function () { action: function () {
self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING); self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING);
} }
}, {
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.hideView();
}
}] }]
}, },
hideChecker: function (e) { hideChecker: function (e) {
@ -70460,6 +70586,97 @@ BI.MultiLayerSingleTreeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSingleTreeCombo.EVENT_FOCUS = "EVENT_FOCUS"; BI.MultiLayerSingleTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_single_tree_combo", BI.MultiLayerSingleTreeCombo);/** BI.shortcut("bi.multilayer_single_tree_combo", BI.MultiLayerSingleTreeCombo);/**
* Created by GUY on 2016/1/26.
*
* @class BI.MultiLayerSingleTreeInsertSearchPane
* @extends BI.Pane
*/
BI.MultiLayerSingleTreeInsertSearchPane = BI.inherit(BI.Widget, {
props: function() {
return {
baseCls: "bi-multilayer-single-tree-popup",
tipText: BI.i18nText("BI-No_Selected_Item"),
isDefaultInit: false,
itemsCreator: BI.emptyFn,
items: [],
value: ""
};
},
render: function() {
var self = this, o = this.options;
this.tree = BI.createWidget({
type: "bi.multilayer_select_level_tree",
isDefaultInit: o.isDefaultInit,
items: o.items,
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
o.itemsCreator(op, function (res) {
callback(res);
self.setKeyword(o.keywordGetter());
});
},
keywordGetter: o.keywordGetter,
value: o.value,
scrollable: null,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}, {
eventName: BI.MultiLayerSelectLevelTree.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE);
}
}]
});
return {
type: "bi.vertical",
scrolly: false,
scrollable: true,
vgap: 5,
items: [{
type: "bi.text_button",
invisible: true,
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: 24,
cls: "bi-high-light",
hgap: 5,
ref: function (_ref) {
self.addNotMatchTip = _ref;
},
handler: function () {
self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM, o.keywordGetter());
}
}, this.tree]
};
},
setKeyword: function (keyword) {
var showTip = BI.isEmptyArray(this.tree.getAllLeaves());
this.addNotMatchTip.setVisible(showTip);
showTip && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
getValue: function () {
return this.tree.getValue();
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.tree.setValue(v);
},
populate: function (items) {
this.tree.populate(items);
}
});
BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_single_tree_insert_search_pane", BI.MultiLayerSingleTreeInsertSearchPane);/**
* guy * guy
* 二级树 * 二级树
* @class BI.MultiLayerSingleLevelTree * @class BI.MultiLayerSingleLevelTree
@ -70769,7 +70986,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}] }]
}, },
popup: { popup: {
type: "bi.multilayer_single_tree_popup", type: o.allowInsertValue ? "bi.multilayer_single_tree_insert_search_pane" : "bi.multilayer_single_tree_popup",
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) { itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
op.keyword = self.editor.getValue(); op.keyword = self.editor.getValue();
o.itemsCreator(op, callback); o.itemsCreator(op, callback);
@ -70777,12 +70994,23 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
keywordGetter: function () { keywordGetter: function () {
return self.editor.getValue(); return self.editor.getValue();
}, },
cls: "bi-card" cls: "bi-card",
listeners: [{
eventName: BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM,
action: function () {
self.options.text = self.getSearcher().getKeyword();
self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM);
}
}],
ref: function (_ref) {
self.popup = _ref;
}
}, },
onSearch: function (obj, callback) { onSearch: function (obj, callback) {
var keyword = obj.keyword; var keyword = obj.keyword;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
callback(self._getSearchItems(keyword)); callback(self._getSearchItems(keyword));
o.allowInsertValue && self.popup.setKeyword(keyword);
} else { } else {
callback(); callback();
} }
@ -70917,6 +71145,7 @@ BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSingleTreeTrigger.EVENT_STOP = "EVENT_STOP"; BI.MultiLayerSingleTreeTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSingleTreeTrigger.EVENT_START = "EVENT_START"; BI.MultiLayerSingleTreeTrigger.EVENT_START = "EVENT_START";
BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multilayer_single_tree_trigger", BI.MultiLayerSingleTreeTrigger);/** BI.shortcut("bi.multilayer_single_tree_trigger", BI.MultiLayerSingleTreeTrigger);/**
* 加号表示的组节点 * 加号表示的组节点
* *

245
dist/fineui_without_jquery_polyfill.js vendored

@ -44426,7 +44426,8 @@ BI.IconTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-icon-trigger", baseCls: "bi-icon-trigger",
extraCls: "pull-down-font",
el: {}, el: {},
height: 24 height: 24
}); });
@ -44438,7 +44439,8 @@ BI.IconTrigger = BI.inherit(BI.Trigger, {
type: "bi.trigger_icon_button", type: "bi.trigger_icon_button",
element: this, element: this,
width: o.width, width: o.width,
height: o.height height: o.height,
extraCls: o.extraCls
}); });
} }
}); });
@ -46585,7 +46587,7 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
stopPropagation: o.stopPropagation, stopPropagation: o.stopPropagation,
el: BI.createWidget(o.el, { el: BI.createWidget(o.el, {
type: "bi.icon_trigger", type: "bi.icon_trigger",
extraCls: o.iconCls ? o.iconCls : "", extraCls: o.iconCls,
width: o.width, width: o.width,
height: o.height height: o.height
}), }),
@ -51540,7 +51542,8 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
tabIndex: 0 tabIndex: 0
}, },
allowEdit: false, allowEdit: false,
allowSearchValue: false allowSearchValue: false,
allowInsertValue: false
}); });
}, },
@ -51620,6 +51623,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
return { return {
el: { el: {
type: "bi.multilayer_select_tree_trigger", type: "bi.multilayer_select_tree_trigger",
allowInsertValue: o.allowInsertValue,
allowSearchValue: o.allowSearchValue, allowSearchValue: o.allowSearchValue,
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
cls: "multilayer-select-tree-trigger", cls: "multilayer-select-tree-trigger",
@ -51658,6 +51662,13 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
action: function () { action: function () {
self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING); self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING);
} }
}, {
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.hideView();
}
}] }]
}, },
hideChecker: function (e) { hideChecker: function (e) {
@ -51710,6 +51721,97 @@ BI.MultiLayerSelectTreeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSelectTreeCombo.EVENT_FOCUS = "EVENT_FOCUS"; BI.MultiLayerSelectTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo);/** BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo);/**
* Created by GUY on 2016/1/26.
*
* @class BI.MultiLayerSelectTreeInsertSearchPane
* @extends BI.Pane
*/
BI.MultiLayerSelectTreeInsertSearchPane = BI.inherit(BI.Widget, {
props: function() {
return {
baseCls: "bi-multilayer-select-tree-popup",
tipText: BI.i18nText("BI-No_Selected_Item"),
isDefaultInit: false,
itemsCreator: BI.emptyFn,
items: [],
value: ""
};
},
render: function() {
var self = this, o = this.options;
this.tree = BI.createWidget({
type: "bi.multilayer_select_level_tree",
isDefaultInit: o.isDefaultInit,
items: o.items,
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
o.itemsCreator(op, function (res) {
callback(res);
self.setKeyword(o.keywordGetter());
});
},
keywordGetter: o.keywordGetter,
value: o.value,
scrollable: null,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}, {
eventName: BI.MultiLayerSelectLevelTree.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE);
}
}]
});
return {
type: "bi.vertical",
scrolly: false,
scrollable: true,
vgap: 5,
items: [{
type: "bi.text_button",
invisible: true,
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: 24,
cls: "bi-high-light",
hgap: 5,
ref: function (_ref) {
self.addNotMatchTip = _ref;
},
handler: function () {
self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM, o.keywordGetter());
}
}, this.tree]
};
},
setKeyword: function (keyword) {
var showTip = BI.isEmptyArray(this.tree.getAllLeaves());
this.addNotMatchTip.setVisible(showTip);
showTip && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
getValue: function () {
return this.tree.getValue();
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.tree.setValue(v);
},
populate: function (items) {
this.tree.populate(items);
}
});
BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_select_tree_insert_search_pane", BI.MultiLayerSelectTreeInsertSearchPane);/**
* guy * guy
* 二级树 * 二级树
* @class BI.MultiLayerSelectLevelTree * @class BI.MultiLayerSelectLevelTree
@ -52019,7 +52121,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}] }]
}, },
popup: { popup: {
type: "bi.multilayer_select_tree_popup", type: o.allowInsertValue ? "bi.multilayer_select_tree_insert_search_pane" : "bi.multilayer_select_tree_popup",
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) { itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
op.keyword = self.editor.getValue(); op.keyword = self.editor.getValue();
o.itemsCreator(op, callback); o.itemsCreator(op, callback);
@ -52027,12 +52129,23 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
keywordGetter: function () { keywordGetter: function () {
return self.editor.getValue(); return self.editor.getValue();
}, },
cls: "bi-card" cls: "bi-card",
listeners: [{
eventName: BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM,
action: function () {
self.options.text = self.getSearcher().getKeyword();
self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM);
}
}],
ref: function (_ref) {
self.popup = _ref;
}
}, },
onSearch: function (obj, callback) { onSearch: function (obj, callback) {
var keyword = obj.keyword; var keyword = obj.keyword;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
callback(self._getSearchItems(keyword)); callback(self._getSearchItems(keyword));
o.allowInsertValue && self.popup.setKeyword(keyword);
} else { } else {
callback(); callback();
} }
@ -52167,6 +52280,7 @@ BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSelectTreeTrigger.EVENT_STOP = "EVENT_STOP"; BI.MultiLayerSelectTreeTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSelectTreeTrigger.EVENT_START = "EVENT_START"; BI.MultiLayerSelectTreeTrigger.EVENT_START = "EVENT_START";
BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multilayer_select_tree_trigger", BI.MultiLayerSelectTreeTrigger);/** BI.shortcut("bi.multilayer_select_tree_trigger", BI.MultiLayerSelectTreeTrigger);/**
* 加号表示的组节点 * 加号表示的组节点
* *
@ -52592,7 +52706,9 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
attributes: { attributes: {
tabIndex: 0 tabIndex: 0
}, },
allowEdit: false allowEdit: false,
allowSearchValue: false,
allowInsertValue: false
}); });
}, },
@ -52672,6 +52788,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
return { return {
el: { el: {
type: "bi.multilayer_single_tree_trigger", type: "bi.multilayer_single_tree_trigger",
allowInsertValue: o.allowInsertValue,
allowSearchValue: o.allowSearchValue, allowSearchValue: o.allowSearchValue,
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
cls: "multilayer-single-tree-trigger", cls: "multilayer-single-tree-trigger",
@ -52710,6 +52827,13 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
action: function () { action: function () {
self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING); self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING);
} }
}, {
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.hideView();
}
}] }]
}, },
hideChecker: function (e) { hideChecker: function (e) {
@ -52762,6 +52886,97 @@ BI.MultiLayerSingleTreeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSingleTreeCombo.EVENT_FOCUS = "EVENT_FOCUS"; BI.MultiLayerSingleTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_single_tree_combo", BI.MultiLayerSingleTreeCombo);/** BI.shortcut("bi.multilayer_single_tree_combo", BI.MultiLayerSingleTreeCombo);/**
* Created by GUY on 2016/1/26.
*
* @class BI.MultiLayerSingleTreeInsertSearchPane
* @extends BI.Pane
*/
BI.MultiLayerSingleTreeInsertSearchPane = BI.inherit(BI.Widget, {
props: function() {
return {
baseCls: "bi-multilayer-single-tree-popup",
tipText: BI.i18nText("BI-No_Selected_Item"),
isDefaultInit: false,
itemsCreator: BI.emptyFn,
items: [],
value: ""
};
},
render: function() {
var self = this, o = this.options;
this.tree = BI.createWidget({
type: "bi.multilayer_select_level_tree",
isDefaultInit: o.isDefaultInit,
items: o.items,
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
o.itemsCreator(op, function (res) {
callback(res);
self.setKeyword(o.keywordGetter());
});
},
keywordGetter: o.keywordGetter,
value: o.value,
scrollable: null,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}, {
eventName: BI.MultiLayerSelectLevelTree.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE);
}
}]
});
return {
type: "bi.vertical",
scrolly: false,
scrollable: true,
vgap: 5,
items: [{
type: "bi.text_button",
invisible: true,
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: 24,
cls: "bi-high-light",
hgap: 5,
ref: function (_ref) {
self.addNotMatchTip = _ref;
},
handler: function () {
self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM, o.keywordGetter());
}
}, this.tree]
};
},
setKeyword: function (keyword) {
var showTip = BI.isEmptyArray(this.tree.getAllLeaves());
this.addNotMatchTip.setVisible(showTip);
showTip && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
getValue: function () {
return this.tree.getValue();
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.tree.setValue(v);
},
populate: function (items) {
this.tree.populate(items);
}
});
BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_single_tree_insert_search_pane", BI.MultiLayerSingleTreeInsertSearchPane);/**
* guy * guy
* 二级树 * 二级树
* @class BI.MultiLayerSingleLevelTree * @class BI.MultiLayerSingleLevelTree
@ -53071,7 +53286,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}] }]
}, },
popup: { popup: {
type: "bi.multilayer_single_tree_popup", type: o.allowInsertValue ? "bi.multilayer_single_tree_insert_search_pane" : "bi.multilayer_single_tree_popup",
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) { itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
op.keyword = self.editor.getValue(); op.keyword = self.editor.getValue();
o.itemsCreator(op, callback); o.itemsCreator(op, callback);
@ -53079,12 +53294,23 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
keywordGetter: function () { keywordGetter: function () {
return self.editor.getValue(); return self.editor.getValue();
}, },
cls: "bi-card" cls: "bi-card",
listeners: [{
eventName: BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM,
action: function () {
self.options.text = self.getSearcher().getKeyword();
self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM);
}
}],
ref: function (_ref) {
self.popup = _ref;
}
}, },
onSearch: function (obj, callback) { onSearch: function (obj, callback) {
var keyword = obj.keyword; var keyword = obj.keyword;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
callback(self._getSearchItems(keyword)); callback(self._getSearchItems(keyword));
o.allowInsertValue && self.popup.setKeyword(keyword);
} else { } else {
callback(); callback();
} }
@ -53219,6 +53445,7 @@ BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSingleTreeTrigger.EVENT_STOP = "EVENT_STOP"; BI.MultiLayerSingleTreeTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSingleTreeTrigger.EVENT_START = "EVENT_START"; BI.MultiLayerSingleTreeTrigger.EVENT_START = "EVENT_START";
BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multilayer_single_tree_trigger", BI.MultiLayerSingleTreeTrigger);/** BI.shortcut("bi.multilayer_single_tree_trigger", BI.MultiLayerSingleTreeTrigger);/**
* 加号表示的组节点 * 加号表示的组节点
* *

239
dist/widget.js vendored

@ -1699,7 +1699,7 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
stopPropagation: o.stopPropagation, stopPropagation: o.stopPropagation,
el: BI.createWidget(o.el, { el: BI.createWidget(o.el, {
type: "bi.icon_trigger", type: "bi.icon_trigger",
extraCls: o.iconCls ? o.iconCls : "", extraCls: o.iconCls,
width: o.width, width: o.width,
height: o.height height: o.height
}), }),
@ -6654,7 +6654,8 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
tabIndex: 0 tabIndex: 0
}, },
allowEdit: false, allowEdit: false,
allowSearchValue: false allowSearchValue: false,
allowInsertValue: false
}); });
}, },
@ -6734,6 +6735,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
return { return {
el: { el: {
type: "bi.multilayer_select_tree_trigger", type: "bi.multilayer_select_tree_trigger",
allowInsertValue: o.allowInsertValue,
allowSearchValue: o.allowSearchValue, allowSearchValue: o.allowSearchValue,
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
cls: "multilayer-select-tree-trigger", cls: "multilayer-select-tree-trigger",
@ -6772,6 +6774,13 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
action: function () { action: function () {
self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING); self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING);
} }
}, {
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.hideView();
}
}] }]
}, },
hideChecker: function (e) { hideChecker: function (e) {
@ -6824,6 +6833,97 @@ BI.MultiLayerSelectTreeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSelectTreeCombo.EVENT_FOCUS = "EVENT_FOCUS"; BI.MultiLayerSelectTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo);/** BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo);/**
* Created by GUY on 2016/1/26.
*
* @class BI.MultiLayerSelectTreeInsertSearchPane
* @extends BI.Pane
*/
BI.MultiLayerSelectTreeInsertSearchPane = BI.inherit(BI.Widget, {
props: function() {
return {
baseCls: "bi-multilayer-select-tree-popup",
tipText: BI.i18nText("BI-No_Selected_Item"),
isDefaultInit: false,
itemsCreator: BI.emptyFn,
items: [],
value: ""
};
},
render: function() {
var self = this, o = this.options;
this.tree = BI.createWidget({
type: "bi.multilayer_select_level_tree",
isDefaultInit: o.isDefaultInit,
items: o.items,
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
o.itemsCreator(op, function (res) {
callback(res);
self.setKeyword(o.keywordGetter());
});
},
keywordGetter: o.keywordGetter,
value: o.value,
scrollable: null,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}, {
eventName: BI.MultiLayerSelectLevelTree.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE);
}
}]
});
return {
type: "bi.vertical",
scrolly: false,
scrollable: true,
vgap: 5,
items: [{
type: "bi.text_button",
invisible: true,
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: 24,
cls: "bi-high-light",
hgap: 5,
ref: function (_ref) {
self.addNotMatchTip = _ref;
},
handler: function () {
self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM, o.keywordGetter());
}
}, this.tree]
};
},
setKeyword: function (keyword) {
var showTip = BI.isEmptyArray(this.tree.getAllLeaves());
this.addNotMatchTip.setVisible(showTip);
showTip && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
getValue: function () {
return this.tree.getValue();
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.tree.setValue(v);
},
populate: function (items) {
this.tree.populate(items);
}
});
BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_select_tree_insert_search_pane", BI.MultiLayerSelectTreeInsertSearchPane);/**
* guy * guy
* 二级树 * 二级树
* @class BI.MultiLayerSelectLevelTree * @class BI.MultiLayerSelectLevelTree
@ -7133,7 +7233,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}] }]
}, },
popup: { popup: {
type: "bi.multilayer_select_tree_popup", type: o.allowInsertValue ? "bi.multilayer_select_tree_insert_search_pane" : "bi.multilayer_select_tree_popup",
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) { itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
op.keyword = self.editor.getValue(); op.keyword = self.editor.getValue();
o.itemsCreator(op, callback); o.itemsCreator(op, callback);
@ -7141,12 +7241,23 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
keywordGetter: function () { keywordGetter: function () {
return self.editor.getValue(); return self.editor.getValue();
}, },
cls: "bi-card" cls: "bi-card",
listeners: [{
eventName: BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM,
action: function () {
self.options.text = self.getSearcher().getKeyword();
self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM);
}
}],
ref: function (_ref) {
self.popup = _ref;
}
}, },
onSearch: function (obj, callback) { onSearch: function (obj, callback) {
var keyword = obj.keyword; var keyword = obj.keyword;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
callback(self._getSearchItems(keyword)); callback(self._getSearchItems(keyword));
o.allowInsertValue && self.popup.setKeyword(keyword);
} else { } else {
callback(); callback();
} }
@ -7281,6 +7392,7 @@ BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSelectTreeTrigger.EVENT_STOP = "EVENT_STOP"; BI.MultiLayerSelectTreeTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSelectTreeTrigger.EVENT_START = "EVENT_START"; BI.MultiLayerSelectTreeTrigger.EVENT_START = "EVENT_START";
BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multilayer_select_tree_trigger", BI.MultiLayerSelectTreeTrigger);/** BI.shortcut("bi.multilayer_select_tree_trigger", BI.MultiLayerSelectTreeTrigger);/**
* 加号表示的组节点 * 加号表示的组节点
* *
@ -7706,7 +7818,9 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
attributes: { attributes: {
tabIndex: 0 tabIndex: 0
}, },
allowEdit: false allowEdit: false,
allowSearchValue: false,
allowInsertValue: false
}); });
}, },
@ -7786,6 +7900,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
return { return {
el: { el: {
type: "bi.multilayer_single_tree_trigger", type: "bi.multilayer_single_tree_trigger",
allowInsertValue: o.allowInsertValue,
allowSearchValue: o.allowSearchValue, allowSearchValue: o.allowSearchValue,
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
cls: "multilayer-single-tree-trigger", cls: "multilayer-single-tree-trigger",
@ -7824,6 +7939,13 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
action: function () { action: function () {
self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING); self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING);
} }
}, {
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.hideView();
}
}] }]
}, },
hideChecker: function (e) { hideChecker: function (e) {
@ -7876,6 +7998,97 @@ BI.MultiLayerSingleTreeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSingleTreeCombo.EVENT_FOCUS = "EVENT_FOCUS"; BI.MultiLayerSingleTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_single_tree_combo", BI.MultiLayerSingleTreeCombo);/** BI.shortcut("bi.multilayer_single_tree_combo", BI.MultiLayerSingleTreeCombo);/**
* Created by GUY on 2016/1/26.
*
* @class BI.MultiLayerSingleTreeInsertSearchPane
* @extends BI.Pane
*/
BI.MultiLayerSingleTreeInsertSearchPane = BI.inherit(BI.Widget, {
props: function() {
return {
baseCls: "bi-multilayer-single-tree-popup",
tipText: BI.i18nText("BI-No_Selected_Item"),
isDefaultInit: false,
itemsCreator: BI.emptyFn,
items: [],
value: ""
};
},
render: function() {
var self = this, o = this.options;
this.tree = BI.createWidget({
type: "bi.multilayer_select_level_tree",
isDefaultInit: o.isDefaultInit,
items: o.items,
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
o.itemsCreator(op, function (res) {
callback(res);
self.setKeyword(o.keywordGetter());
});
},
keywordGetter: o.keywordGetter,
value: o.value,
scrollable: null,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}, {
eventName: BI.MultiLayerSelectLevelTree.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE);
}
}]
});
return {
type: "bi.vertical",
scrolly: false,
scrollable: true,
vgap: 5,
items: [{
type: "bi.text_button",
invisible: true,
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: 24,
cls: "bi-high-light",
hgap: 5,
ref: function (_ref) {
self.addNotMatchTip = _ref;
},
handler: function () {
self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM, o.keywordGetter());
}
}, this.tree]
};
},
setKeyword: function (keyword) {
var showTip = BI.isEmptyArray(this.tree.getAllLeaves());
this.addNotMatchTip.setVisible(showTip);
showTip && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
getValue: function () {
return this.tree.getValue();
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.tree.setValue(v);
},
populate: function (items) {
this.tree.populate(items);
}
});
BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_single_tree_insert_search_pane", BI.MultiLayerSingleTreeInsertSearchPane);/**
* guy * guy
* 二级树 * 二级树
* @class BI.MultiLayerSingleLevelTree * @class BI.MultiLayerSingleLevelTree
@ -8185,7 +8398,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}] }]
}, },
popup: { popup: {
type: "bi.multilayer_single_tree_popup", type: o.allowInsertValue ? "bi.multilayer_single_tree_insert_search_pane" : "bi.multilayer_single_tree_popup",
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) { itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
op.keyword = self.editor.getValue(); op.keyword = self.editor.getValue();
o.itemsCreator(op, callback); o.itemsCreator(op, callback);
@ -8193,12 +8406,23 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
keywordGetter: function () { keywordGetter: function () {
return self.editor.getValue(); return self.editor.getValue();
}, },
cls: "bi-card" cls: "bi-card",
listeners: [{
eventName: BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM,
action: function () {
self.options.text = self.getSearcher().getKeyword();
self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM);
}
}],
ref: function (_ref) {
self.popup = _ref;
}
}, },
onSearch: function (obj, callback) { onSearch: function (obj, callback) {
var keyword = obj.keyword; var keyword = obj.keyword;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
callback(self._getSearchItems(keyword)); callback(self._getSearchItems(keyword));
o.allowInsertValue && self.popup.setKeyword(keyword);
} else { } else {
callback(); callback();
} }
@ -8333,6 +8557,7 @@ BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSingleTreeTrigger.EVENT_STOP = "EVENT_STOP"; BI.MultiLayerSingleTreeTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSingleTreeTrigger.EVENT_START = "EVENT_START"; BI.MultiLayerSingleTreeTrigger.EVENT_START = "EVENT_START";
BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multilayer_single_tree_trigger", BI.MultiLayerSingleTreeTrigger);/** BI.shortcut("bi.multilayer_single_tree_trigger", BI.MultiLayerSingleTreeTrigger);/**
* 加号表示的组节点 * 加号表示的组节点
* *

6
src/case/trigger/trigger.icon.js

@ -9,7 +9,8 @@ BI.IconTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-icon-trigger", baseCls: "bi-icon-trigger",
extraCls: "pull-down-font",
el: {}, el: {},
height: 24 height: 24
}); });
@ -21,7 +22,8 @@ BI.IconTrigger = BI.inherit(BI.Trigger, {
type: "bi.trigger_icon_button", type: "bi.trigger_icon_button",
element: this, element: this,
width: o.width, width: o.width,
height: o.height height: o.height,
extraCls: o.extraCls
}); });
} }
}); });

2
src/widget/downlist/combo.downlist.js

@ -48,7 +48,7 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
stopPropagation: o.stopPropagation, stopPropagation: o.stopPropagation,
el: BI.createWidget(o.el, { el: BI.createWidget(o.el, {
type: "bi.icon_trigger", type: "bi.icon_trigger",
extraCls: o.iconCls ? o.iconCls : "", extraCls: o.iconCls,
width: o.width, width: o.width,
height: o.height height: o.height
}), }),

11
src/widget/multilayerselecttree/multilayerselecttree.combo.js

@ -17,7 +17,8 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
tabIndex: 0 tabIndex: 0
}, },
allowEdit: false, allowEdit: false,
allowSearchValue: false allowSearchValue: false,
allowInsertValue: false
}); });
}, },
@ -97,6 +98,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
return { return {
el: { el: {
type: "bi.multilayer_select_tree_trigger", type: "bi.multilayer_select_tree_trigger",
allowInsertValue: o.allowInsertValue,
allowSearchValue: o.allowSearchValue, allowSearchValue: o.allowSearchValue,
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
cls: "multilayer-select-tree-trigger", cls: "multilayer-select-tree-trigger",
@ -135,6 +137,13 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
action: function () { action: function () {
self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING); self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING);
} }
}, {
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.hideView();
}
}] }]
}, },
hideChecker: function (e) { hideChecker: function (e) {

92
src/widget/multilayerselecttree/multilayerselecttree.insert.search.pane.js

@ -0,0 +1,92 @@
/**
* Created by GUY on 2016/1/26.
*
* @class BI.MultiLayerSelectTreeInsertSearchPane
* @extends BI.Pane
*/
BI.MultiLayerSelectTreeInsertSearchPane = BI.inherit(BI.Widget, {
props: function() {
return {
baseCls: "bi-multilayer-select-tree-popup",
tipText: BI.i18nText("BI-No_Selected_Item"),
isDefaultInit: false,
itemsCreator: BI.emptyFn,
items: [],
value: ""
};
},
render: function() {
var self = this, o = this.options;
this.tree = BI.createWidget({
type: "bi.multilayer_select_level_tree",
isDefaultInit: o.isDefaultInit,
items: o.items,
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
o.itemsCreator(op, function (res) {
callback(res);
self.setKeyword(o.keywordGetter());
});
},
keywordGetter: o.keywordGetter,
value: o.value,
scrollable: null,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}, {
eventName: BI.MultiLayerSelectLevelTree.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE);
}
}]
});
return {
type: "bi.vertical",
scrolly: false,
scrollable: true,
vgap: 5,
items: [{
type: "bi.text_button",
invisible: true,
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: 24,
cls: "bi-high-light",
hgap: 5,
ref: function (_ref) {
self.addNotMatchTip = _ref;
},
handler: function () {
self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM, o.keywordGetter());
}
}, this.tree]
};
},
setKeyword: function (keyword) {
var showTip = BI.isEmptyArray(this.tree.getAllLeaves());
this.addNotMatchTip.setVisible(showTip);
showTip && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
getValue: function () {
return this.tree.getValue();
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.tree.setValue(v);
},
populate: function (items) {
this.tree.populate(items);
}
});
BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_select_tree_insert_search_pane", BI.MultiLayerSelectTreeInsertSearchPane);

16
src/widget/multilayerselecttree/multilayerselecttree.trigger.js

@ -60,7 +60,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}] }]
}, },
popup: { popup: {
type: "bi.multilayer_select_tree_popup", type: o.allowInsertValue ? "bi.multilayer_select_tree_insert_search_pane" : "bi.multilayer_select_tree_popup",
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) { itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
op.keyword = self.editor.getValue(); op.keyword = self.editor.getValue();
o.itemsCreator(op, callback); o.itemsCreator(op, callback);
@ -68,12 +68,23 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
keywordGetter: function () { keywordGetter: function () {
return self.editor.getValue(); return self.editor.getValue();
}, },
cls: "bi-card" cls: "bi-card",
listeners: [{
eventName: BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM,
action: function () {
self.options.text = self.getSearcher().getKeyword();
self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM);
}
}],
ref: function (_ref) {
self.popup = _ref;
}
}, },
onSearch: function (obj, callback) { onSearch: function (obj, callback) {
var keyword = obj.keyword; var keyword = obj.keyword;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
callback(self._getSearchItems(keyword)); callback(self._getSearchItems(keyword));
o.allowInsertValue && self.popup.setKeyword(keyword);
} else { } else {
callback(); callback();
} }
@ -208,4 +219,5 @@ BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSelectTreeTrigger.EVENT_STOP = "EVENT_STOP"; BI.MultiLayerSelectTreeTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSelectTreeTrigger.EVENT_START = "EVENT_START"; BI.MultiLayerSelectTreeTrigger.EVENT_START = "EVENT_START";
BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multilayer_select_tree_trigger", BI.MultiLayerSelectTreeTrigger); BI.shortcut("bi.multilayer_select_tree_trigger", BI.MultiLayerSelectTreeTrigger);

12
src/widget/multilayersingletree/multilayersingletree.combo.js

@ -19,7 +19,9 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
attributes: { attributes: {
tabIndex: 0 tabIndex: 0
}, },
allowEdit: false allowEdit: false,
allowSearchValue: false,
allowInsertValue: false
}); });
}, },
@ -99,6 +101,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
return { return {
el: { el: {
type: "bi.multilayer_single_tree_trigger", type: "bi.multilayer_single_tree_trigger",
allowInsertValue: o.allowInsertValue,
allowSearchValue: o.allowSearchValue, allowSearchValue: o.allowSearchValue,
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
cls: "multilayer-single-tree-trigger", cls: "multilayer-single-tree-trigger",
@ -137,6 +140,13 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
action: function () { action: function () {
self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING); self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING);
} }
}, {
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.hideView();
}
}] }]
}, },
hideChecker: function (e) { hideChecker: function (e) {

92
src/widget/multilayersingletree/multilayersingletree.insert.search.pane.js

@ -0,0 +1,92 @@
/**
* Created by GUY on 2016/1/26.
*
* @class BI.MultiLayerSingleTreeInsertSearchPane
* @extends BI.Pane
*/
BI.MultiLayerSingleTreeInsertSearchPane = BI.inherit(BI.Widget, {
props: function() {
return {
baseCls: "bi-multilayer-single-tree-popup",
tipText: BI.i18nText("BI-No_Selected_Item"),
isDefaultInit: false,
itemsCreator: BI.emptyFn,
items: [],
value: ""
};
},
render: function() {
var self = this, o = this.options;
this.tree = BI.createWidget({
type: "bi.multilayer_select_level_tree",
isDefaultInit: o.isDefaultInit,
items: o.items,
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
o.itemsCreator(op, function (res) {
callback(res);
self.setKeyword(o.keywordGetter());
});
},
keywordGetter: o.keywordGetter,
value: o.value,
scrollable: null,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}, {
eventName: BI.MultiLayerSelectLevelTree.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE);
}
}]
});
return {
type: "bi.vertical",
scrolly: false,
scrollable: true,
vgap: 5,
items: [{
type: "bi.text_button",
invisible: true,
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: 24,
cls: "bi-high-light",
hgap: 5,
ref: function (_ref) {
self.addNotMatchTip = _ref;
},
handler: function () {
self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM, o.keywordGetter());
}
}, this.tree]
};
},
setKeyword: function (keyword) {
var showTip = BI.isEmptyArray(this.tree.getAllLeaves());
this.addNotMatchTip.setVisible(showTip);
showTip && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
getValue: function () {
return this.tree.getValue();
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.tree.setValue(v);
},
populate: function (items) {
this.tree.populate(items);
}
});
BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_single_tree_insert_search_pane", BI.MultiLayerSingleTreeInsertSearchPane);

16
src/widget/multilayersingletree/multilayersingletree.trigger.js

@ -61,7 +61,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}] }]
}, },
popup: { popup: {
type: "bi.multilayer_single_tree_popup", type: o.allowInsertValue ? "bi.multilayer_single_tree_insert_search_pane" : "bi.multilayer_single_tree_popup",
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) { itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
op.keyword = self.editor.getValue(); op.keyword = self.editor.getValue();
o.itemsCreator(op, callback); o.itemsCreator(op, callback);
@ -69,12 +69,23 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
keywordGetter: function () { keywordGetter: function () {
return self.editor.getValue(); return self.editor.getValue();
}, },
cls: "bi-card" cls: "bi-card",
listeners: [{
eventName: BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM,
action: function () {
self.options.text = self.getSearcher().getKeyword();
self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM);
}
}],
ref: function (_ref) {
self.popup = _ref;
}
}, },
onSearch: function (obj, callback) { onSearch: function (obj, callback) {
var keyword = obj.keyword; var keyword = obj.keyword;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
callback(self._getSearchItems(keyword)); callback(self._getSearchItems(keyword));
o.allowInsertValue && self.popup.setKeyword(keyword);
} else { } else {
callback(); callback();
} }
@ -209,4 +220,5 @@ BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSingleTreeTrigger.EVENT_STOP = "EVENT_STOP"; BI.MultiLayerSingleTreeTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSingleTreeTrigger.EVENT_START = "EVENT_START"; BI.MultiLayerSingleTreeTrigger.EVENT_START = "EVENT_START";
BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multilayer_single_tree_trigger", BI.MultiLayerSingleTreeTrigger); BI.shortcut("bi.multilayer_single_tree_trigger", BI.MultiLayerSingleTreeTrigger);
Loading…
Cancel
Save