Browse Source

KERNEL-741 refactor: BI.freeze兼容ie

es6
Kira 5 years ago
parent
commit
d9ff1da7d2
  1. 149
      dist/2.0/fineui.ie.js
  2. 149
      dist/2.0/fineui.js
  3. 62
      dist/2.0/fineui.min.js
  4. 6
      dist/base.js
  5. 149
      dist/bundle.ie.js
  6. 62
      dist/bundle.ie.min.js
  7. 149
      dist/bundle.js
  8. 62
      dist/bundle.min.js
  9. 11
      dist/core.js
  10. 149
      dist/fineui.ie.js
  11. 70
      dist/fineui.ie.min.js
  12. 149
      dist/fineui.js
  13. 66
      dist/fineui.min.js
  14. 149
      dist/fineui_without_jquery_polyfill.js
  15. 8
      dist/utils.js
  16. 10
      dist/utils.min.js
  17. 132
      dist/widget.js
  18. 8
      src/core/base.js

149
dist/2.0/fineui.ie.js vendored

@ -10650,14 +10650,12 @@ if (!_global.BI) {
},
freeze: function (value) {
if (Object.freeze) {
// 在ES5中,如果这个方法的参数不是一个对象(一个原始值),那么它会导致 TypeError
// 在ES2015中,非对象参数将被视为要被冻结的普通对象,并被简单地返回。
if (Object.freeze && BI.isObject(value)) {
return Object.freeze(value);
} else {
if (!BI.isObject(value)) {
throw new TypeError('Object.freeze can only be called on Objects.');
}
return value;
}
},
// 数字和字符串可以作为key
@ -19537,8 +19535,7 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
type: "bi.tooltip",
text: text,
level: level,
stopEvent: true,
height: this._const.height
stopEvent: true
});
},
@ -49444,8 +49441,7 @@ BI.Tooltip = BI.inherit(BI.Tip, {
text: "",
level: "success", // success或warning
stopEvent: false,
stopPropagation: false,
height: 18
stopPropagation: false
});
},
_init: function () {
@ -49489,8 +49485,7 @@ BI.Tooltip = BI.inherit(BI.Tip, {
textAlign: "left",
whiteSpace: "normal",
text: o.text,
height: o.height,
textHeight: o.height - 2,
textHeight: 18,
hgap: this._const.hgap
});
}
@ -68669,23 +68664,9 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
};
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
baseConfig.el = {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
};
return baseConfig;
},
_getAsyncConfig: function () {
_getSearchConfig: function() {
var self = this, o = this.options;
var config = this._getBaseConfig();
return BI.extend(config, {
return {
el: {
type: "bi.multilayer_select_tree_trigger",
allowEdit: o.allowEdit,
@ -68735,9 +68716,28 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
self.trigger.stopEditing();
}
}]
}
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
return BI.extend(baseConfig, o.allowEdit ? this._getSearchConfig() : {
el: {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
}
});
},
_getAsyncConfig: function () {
var config = this._getBaseConfig();
return BI.extend(config, this._getSearchConfig());
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.combo.setValue(v);
@ -69020,6 +69020,10 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.tree.initTree(BI.deepClone(BI.Tree.treeFormat(BI.deepClone(o.items))));
}
var content = {
type: "bi.htape",
items: [
@ -69074,7 +69078,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
if(o.itemsCreator === BI.emptyFn) {
var finding = BI.Func.getSearchResult(o.items, keyword);
var matched = finding.match, find = finding.find;
callback(find.concat(matched));
callback(self._fillTreeStructure4Search(find.concat(matched)));
} else {
callback();
}
@ -69116,6 +69120,29 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
};
},
// 将搜索到的节点进行补充,构造成一棵完整的树
_fillTreeStructure4Search: function (leaves) {
var result = BI.map(leaves, "id");
var queue = leaves.reverse() || [];
while (BI.isNotEmptyArray(queue)) {
var node = queue.pop();
var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id");
if (pNode != null) {
queue.push(pNode);
result.push(pNode.id);
}
}
var nodes = [];
BI.each(this.options.items, function (idx, item) {
if(BI.contains(result, item.id)) {
nodes.push(BI.extend({}, item, {
open: true
}))
}
});
return nodes;
},
_digest: function (v) {
var o = this.options;
return o.valueFormatter(v) || o.text;
@ -69648,23 +69675,9 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
};
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
baseConfig.el = {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
};
return baseConfig;
},
_getAsyncConfig: function () {
_getSearchConfig: function() {
var self = this, o = this.options;
var config = this._getBaseConfig();
return BI.extend(config, {
return {
el: {
type: "bi.multilayer_single_tree_trigger",
allowEdit: o.allowEdit,
@ -69714,9 +69727,28 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
self.trigger.stopEditing();
}
}]
}
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
return BI.extend(baseConfig, o.allowEdit ? this._getSearchConfig() : {
el: {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
}
});
},
_getAsyncConfig: function () {
var config = this._getBaseConfig();
return BI.extend(config, this._getSearchConfig());
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.combo.setValue(v);
@ -69998,6 +70030,10 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.tree.initTree(BI.deepClone(BI.Tree.treeFormat(BI.deepClone(o.items))));
}
var content = {
type: "bi.htape",
items: [
@ -70052,7 +70088,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
if(o.itemsCreator === BI.emptyFn) {
var finding = BI.Func.getSearchResult(o.items, keyword);
var matched = finding.match, find = finding.find;
callback(find.concat(matched));
callback(self._fillTreeStructure4Search(find.concat(matched)));
} else {
callback();
}
@ -70094,6 +70130,29 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
};
},
// 将搜索到的节点进行补充,构造成一棵完整的树
_fillTreeStructure4Search: function (leaves) {
var result = BI.map(leaves, "id");
var queue = leaves.reverse() || [];
while (BI.isNotEmptyArray(queue)) {
var node = queue.pop();
var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id");
if (pNode != null) {
queue.push(pNode);
result.push(pNode.id);
}
}
var nodes = [];
BI.each(this.options.items, function (idx, item) {
if(BI.contains(result, item.id)) {
nodes.push(BI.extend({}, item, {
open: true
}))
}
});
return nodes;
},
_digest: function (v) {
var o = this.options;
return o.valueFormatter(v) || o.text;

149
dist/2.0/fineui.js vendored

@ -10650,14 +10650,12 @@ if (!_global.BI) {
},
freeze: function (value) {
if (Object.freeze) {
// 在ES5中,如果这个方法的参数不是一个对象(一个原始值),那么它会导致 TypeError
// 在ES2015中,非对象参数将被视为要被冻结的普通对象,并被简单地返回。
if (Object.freeze && BI.isObject(value)) {
return Object.freeze(value);
} else {
if (!BI.isObject(value)) {
throw new TypeError('Object.freeze can only be called on Objects.');
}
return value;
}
},
// 数字和字符串可以作为key
@ -19537,8 +19535,7 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
type: "bi.tooltip",
text: text,
level: level,
stopEvent: true,
height: this._const.height
stopEvent: true
});
},
@ -49848,8 +49845,7 @@ BI.Tooltip = BI.inherit(BI.Tip, {
text: "",
level: "success", // success或warning
stopEvent: false,
stopPropagation: false,
height: 18
stopPropagation: false
});
},
_init: function () {
@ -49893,8 +49889,7 @@ BI.Tooltip = BI.inherit(BI.Tip, {
textAlign: "left",
whiteSpace: "normal",
text: o.text,
height: o.height,
textHeight: o.height - 2,
textHeight: 18,
hgap: this._const.hgap
});
}
@ -69073,23 +69068,9 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
};
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
baseConfig.el = {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
};
return baseConfig;
},
_getAsyncConfig: function () {
_getSearchConfig: function() {
var self = this, o = this.options;
var config = this._getBaseConfig();
return BI.extend(config, {
return {
el: {
type: "bi.multilayer_select_tree_trigger",
allowEdit: o.allowEdit,
@ -69139,9 +69120,28 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
self.trigger.stopEditing();
}
}]
}
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
return BI.extend(baseConfig, o.allowEdit ? this._getSearchConfig() : {
el: {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
}
});
},
_getAsyncConfig: function () {
var config = this._getBaseConfig();
return BI.extend(config, this._getSearchConfig());
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.combo.setValue(v);
@ -69424,6 +69424,10 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.tree.initTree(BI.deepClone(BI.Tree.treeFormat(BI.deepClone(o.items))));
}
var content = {
type: "bi.htape",
items: [
@ -69478,7 +69482,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
if(o.itemsCreator === BI.emptyFn) {
var finding = BI.Func.getSearchResult(o.items, keyword);
var matched = finding.match, find = finding.find;
callback(find.concat(matched));
callback(self._fillTreeStructure4Search(find.concat(matched)));
} else {
callback();
}
@ -69520,6 +69524,29 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
};
},
// 将搜索到的节点进行补充,构造成一棵完整的树
_fillTreeStructure4Search: function (leaves) {
var result = BI.map(leaves, "id");
var queue = leaves.reverse() || [];
while (BI.isNotEmptyArray(queue)) {
var node = queue.pop();
var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id");
if (pNode != null) {
queue.push(pNode);
result.push(pNode.id);
}
}
var nodes = [];
BI.each(this.options.items, function (idx, item) {
if(BI.contains(result, item.id)) {
nodes.push(BI.extend({}, item, {
open: true
}))
}
});
return nodes;
},
_digest: function (v) {
var o = this.options;
return o.valueFormatter(v) || o.text;
@ -70052,23 +70079,9 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
};
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
baseConfig.el = {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
};
return baseConfig;
},
_getAsyncConfig: function () {
_getSearchConfig: function() {
var self = this, o = this.options;
var config = this._getBaseConfig();
return BI.extend(config, {
return {
el: {
type: "bi.multilayer_single_tree_trigger",
allowEdit: o.allowEdit,
@ -70118,9 +70131,28 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
self.trigger.stopEditing();
}
}]
}
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
return BI.extend(baseConfig, o.allowEdit ? this._getSearchConfig() : {
el: {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
}
});
},
_getAsyncConfig: function () {
var config = this._getBaseConfig();
return BI.extend(config, this._getSearchConfig());
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.combo.setValue(v);
@ -70402,6 +70434,10 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.tree.initTree(BI.deepClone(BI.Tree.treeFormat(BI.deepClone(o.items))));
}
var content = {
type: "bi.htape",
items: [
@ -70456,7 +70492,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
if(o.itemsCreator === BI.emptyFn) {
var finding = BI.Func.getSearchResult(o.items, keyword);
var matched = finding.match, find = finding.find;
callback(find.concat(matched));
callback(self._fillTreeStructure4Search(find.concat(matched)));
} else {
callback();
}
@ -70498,6 +70534,29 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
};
},
// 将搜索到的节点进行补充,构造成一棵完整的树
_fillTreeStructure4Search: function (leaves) {
var result = BI.map(leaves, "id");
var queue = leaves.reverse() || [];
while (BI.isNotEmptyArray(queue)) {
var node = queue.pop();
var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id");
if (pNode != null) {
queue.push(pNode);
result.push(pNode.id);
}
}
var nodes = [];
BI.each(this.options.items, function (idx, item) {
if(BI.contains(result, item.id)) {
nodes.push(BI.extend({}, item, {
open: true
}))
}
});
return nodes;
},
_digest: function (v) {
var o = this.options;
return o.valueFormatter(v) || o.text;

62
dist/2.0/fineui.min.js vendored

File diff suppressed because one or more lines are too long

6
dist/base.js vendored

@ -11574,8 +11574,7 @@ BI.Tooltip = BI.inherit(BI.Tip, {
text: "",
level: "success", // success或warning
stopEvent: false,
stopPropagation: false,
height: 18
stopPropagation: false
});
},
_init: function () {
@ -11619,8 +11618,7 @@ BI.Tooltip = BI.inherit(BI.Tip, {
textAlign: "left",
whiteSpace: "normal",
text: o.text,
height: o.height,
textHeight: o.height - 2,
textHeight: 18,
hgap: this._const.hgap
});
}

149
dist/bundle.ie.js vendored

@ -10650,14 +10650,12 @@ if (!_global.BI) {
},
freeze: function (value) {
if (Object.freeze) {
// 在ES5中,如果这个方法的参数不是一个对象(一个原始值),那么它会导致 TypeError
// 在ES2015中,非对象参数将被视为要被冻结的普通对象,并被简单地返回。
if (Object.freeze && BI.isObject(value)) {
return Object.freeze(value);
} else {
if (!BI.isObject(value)) {
throw new TypeError('Object.freeze can only be called on Objects.');
}
return value;
}
},
// 数字和字符串可以作为key
@ -19537,8 +19535,7 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
type: "bi.tooltip",
text: text,
level: level,
stopEvent: true,
height: this._const.height
stopEvent: true
});
},
@ -49444,8 +49441,7 @@ BI.Tooltip = BI.inherit(BI.Tip, {
text: "",
level: "success", // success或warning
stopEvent: false,
stopPropagation: false,
height: 18
stopPropagation: false
});
},
_init: function () {
@ -49489,8 +49485,7 @@ BI.Tooltip = BI.inherit(BI.Tip, {
textAlign: "left",
whiteSpace: "normal",
text: o.text,
height: o.height,
textHeight: o.height - 2,
textHeight: 18,
hgap: this._const.hgap
});
}
@ -68669,23 +68664,9 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
};
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
baseConfig.el = {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
};
return baseConfig;
},
_getAsyncConfig: function () {
_getSearchConfig: function() {
var self = this, o = this.options;
var config = this._getBaseConfig();
return BI.extend(config, {
return {
el: {
type: "bi.multilayer_select_tree_trigger",
allowEdit: o.allowEdit,
@ -68735,9 +68716,28 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
self.trigger.stopEditing();
}
}]
}
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
return BI.extend(baseConfig, o.allowEdit ? this._getSearchConfig() : {
el: {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
}
});
},
_getAsyncConfig: function () {
var config = this._getBaseConfig();
return BI.extend(config, this._getSearchConfig());
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.combo.setValue(v);
@ -69020,6 +69020,10 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.tree.initTree(BI.deepClone(BI.Tree.treeFormat(BI.deepClone(o.items))));
}
var content = {
type: "bi.htape",
items: [
@ -69074,7 +69078,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
if(o.itemsCreator === BI.emptyFn) {
var finding = BI.Func.getSearchResult(o.items, keyword);
var matched = finding.match, find = finding.find;
callback(find.concat(matched));
callback(self._fillTreeStructure4Search(find.concat(matched)));
} else {
callback();
}
@ -69116,6 +69120,29 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
};
},
// 将搜索到的节点进行补充,构造成一棵完整的树
_fillTreeStructure4Search: function (leaves) {
var result = BI.map(leaves, "id");
var queue = leaves.reverse() || [];
while (BI.isNotEmptyArray(queue)) {
var node = queue.pop();
var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id");
if (pNode != null) {
queue.push(pNode);
result.push(pNode.id);
}
}
var nodes = [];
BI.each(this.options.items, function (idx, item) {
if(BI.contains(result, item.id)) {
nodes.push(BI.extend({}, item, {
open: true
}))
}
});
return nodes;
},
_digest: function (v) {
var o = this.options;
return o.valueFormatter(v) || o.text;
@ -69648,23 +69675,9 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
};
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
baseConfig.el = {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
};
return baseConfig;
},
_getAsyncConfig: function () {
_getSearchConfig: function() {
var self = this, o = this.options;
var config = this._getBaseConfig();
return BI.extend(config, {
return {
el: {
type: "bi.multilayer_single_tree_trigger",
allowEdit: o.allowEdit,
@ -69714,9 +69727,28 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
self.trigger.stopEditing();
}
}]
}
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
return BI.extend(baseConfig, o.allowEdit ? this._getSearchConfig() : {
el: {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
}
});
},
_getAsyncConfig: function () {
var config = this._getBaseConfig();
return BI.extend(config, this._getSearchConfig());
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.combo.setValue(v);
@ -69998,6 +70030,10 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.tree.initTree(BI.deepClone(BI.Tree.treeFormat(BI.deepClone(o.items))));
}
var content = {
type: "bi.htape",
items: [
@ -70052,7 +70088,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
if(o.itemsCreator === BI.emptyFn) {
var finding = BI.Func.getSearchResult(o.items, keyword);
var matched = finding.match, find = finding.find;
callback(find.concat(matched));
callback(self._fillTreeStructure4Search(find.concat(matched)));
} else {
callback();
}
@ -70094,6 +70130,29 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
};
},
// 将搜索到的节点进行补充,构造成一棵完整的树
_fillTreeStructure4Search: function (leaves) {
var result = BI.map(leaves, "id");
var queue = leaves.reverse() || [];
while (BI.isNotEmptyArray(queue)) {
var node = queue.pop();
var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id");
if (pNode != null) {
queue.push(pNode);
result.push(pNode.id);
}
}
var nodes = [];
BI.each(this.options.items, function (idx, item) {
if(BI.contains(result, item.id)) {
nodes.push(BI.extend({}, item, {
open: true
}))
}
});
return nodes;
},
_digest: function (v) {
var o = this.options;
return o.valueFormatter(v) || o.text;

62
dist/bundle.ie.min.js vendored

File diff suppressed because one or more lines are too long

149
dist/bundle.js vendored

@ -10650,14 +10650,12 @@ if (!_global.BI) {
},
freeze: function (value) {
if (Object.freeze) {
// 在ES5中,如果这个方法的参数不是一个对象(一个原始值),那么它会导致 TypeError
// 在ES2015中,非对象参数将被视为要被冻结的普通对象,并被简单地返回。
if (Object.freeze && BI.isObject(value)) {
return Object.freeze(value);
} else {
if (!BI.isObject(value)) {
throw new TypeError('Object.freeze can only be called on Objects.');
}
return value;
}
},
// 数字和字符串可以作为key
@ -19537,8 +19535,7 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
type: "bi.tooltip",
text: text,
level: level,
stopEvent: true,
height: this._const.height
stopEvent: true
});
},
@ -49848,8 +49845,7 @@ BI.Tooltip = BI.inherit(BI.Tip, {
text: "",
level: "success", // success或warning
stopEvent: false,
stopPropagation: false,
height: 18
stopPropagation: false
});
},
_init: function () {
@ -49893,8 +49889,7 @@ BI.Tooltip = BI.inherit(BI.Tip, {
textAlign: "left",
whiteSpace: "normal",
text: o.text,
height: o.height,
textHeight: o.height - 2,
textHeight: 18,
hgap: this._const.hgap
});
}
@ -69073,23 +69068,9 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
};
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
baseConfig.el = {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
};
return baseConfig;
},
_getAsyncConfig: function () {
_getSearchConfig: function() {
var self = this, o = this.options;
var config = this._getBaseConfig();
return BI.extend(config, {
return {
el: {
type: "bi.multilayer_select_tree_trigger",
allowEdit: o.allowEdit,
@ -69139,9 +69120,28 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
self.trigger.stopEditing();
}
}]
}
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
return BI.extend(baseConfig, o.allowEdit ? this._getSearchConfig() : {
el: {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
}
});
},
_getAsyncConfig: function () {
var config = this._getBaseConfig();
return BI.extend(config, this._getSearchConfig());
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.combo.setValue(v);
@ -69424,6 +69424,10 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.tree.initTree(BI.deepClone(BI.Tree.treeFormat(BI.deepClone(o.items))));
}
var content = {
type: "bi.htape",
items: [
@ -69478,7 +69482,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
if(o.itemsCreator === BI.emptyFn) {
var finding = BI.Func.getSearchResult(o.items, keyword);
var matched = finding.match, find = finding.find;
callback(find.concat(matched));
callback(self._fillTreeStructure4Search(find.concat(matched)));
} else {
callback();
}
@ -69520,6 +69524,29 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
};
},
// 将搜索到的节点进行补充,构造成一棵完整的树
_fillTreeStructure4Search: function (leaves) {
var result = BI.map(leaves, "id");
var queue = leaves.reverse() || [];
while (BI.isNotEmptyArray(queue)) {
var node = queue.pop();
var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id");
if (pNode != null) {
queue.push(pNode);
result.push(pNode.id);
}
}
var nodes = [];
BI.each(this.options.items, function (idx, item) {
if(BI.contains(result, item.id)) {
nodes.push(BI.extend({}, item, {
open: true
}))
}
});
return nodes;
},
_digest: function (v) {
var o = this.options;
return o.valueFormatter(v) || o.text;
@ -70052,23 +70079,9 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
};
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
baseConfig.el = {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
};
return baseConfig;
},
_getAsyncConfig: function () {
_getSearchConfig: function() {
var self = this, o = this.options;
var config = this._getBaseConfig();
return BI.extend(config, {
return {
el: {
type: "bi.multilayer_single_tree_trigger",
allowEdit: o.allowEdit,
@ -70118,9 +70131,28 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
self.trigger.stopEditing();
}
}]
}
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
return BI.extend(baseConfig, o.allowEdit ? this._getSearchConfig() : {
el: {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
}
});
},
_getAsyncConfig: function () {
var config = this._getBaseConfig();
return BI.extend(config, this._getSearchConfig());
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.combo.setValue(v);
@ -70402,6 +70434,10 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.tree.initTree(BI.deepClone(BI.Tree.treeFormat(BI.deepClone(o.items))));
}
var content = {
type: "bi.htape",
items: [
@ -70456,7 +70492,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
if(o.itemsCreator === BI.emptyFn) {
var finding = BI.Func.getSearchResult(o.items, keyword);
var matched = finding.match, find = finding.find;
callback(find.concat(matched));
callback(self._fillTreeStructure4Search(find.concat(matched)));
} else {
callback();
}
@ -70498,6 +70534,29 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
};
},
// 将搜索到的节点进行补充,构造成一棵完整的树
_fillTreeStructure4Search: function (leaves) {
var result = BI.map(leaves, "id");
var queue = leaves.reverse() || [];
while (BI.isNotEmptyArray(queue)) {
var node = queue.pop();
var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id");
if (pNode != null) {
queue.push(pNode);
result.push(pNode.id);
}
}
var nodes = [];
BI.each(this.options.items, function (idx, item) {
if(BI.contains(result, item.id)) {
nodes.push(BI.extend({}, item, {
open: true
}))
}
});
return nodes;
},
_digest: function (v) {
var o = this.options;
return o.valueFormatter(v) || o.text;

62
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

11
dist/core.js vendored

@ -10650,14 +10650,12 @@ if (!_global.BI) {
},
freeze: function (value) {
if (Object.freeze) {
// 在ES5中,如果这个方法的参数不是一个对象(一个原始值),那么它会导致 TypeError
// 在ES2015中,非对象参数将被视为要被冻结的普通对象,并被简单地返回。
if (Object.freeze && BI.isObject(value)) {
return Object.freeze(value);
} else {
if (!BI.isObject(value)) {
throw new TypeError('Object.freeze can only be called on Objects.');
}
return value;
}
},
// 数字和字符串可以作为key
@ -19537,8 +19535,7 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
type: "bi.tooltip",
text: text,
level: level,
stopEvent: true,
height: this._const.height
stopEvent: true
});
},

149
dist/fineui.ie.js vendored

@ -10895,14 +10895,12 @@ if (!_global.BI) {
},
freeze: function (value) {
if (Object.freeze) {
// 在ES5中,如果这个方法的参数不是一个对象(一个原始值),那么它会导致 TypeError
// 在ES2015中,非对象参数将被视为要被冻结的普通对象,并被简单地返回。
if (Object.freeze && BI.isObject(value)) {
return Object.freeze(value);
} else {
if (!BI.isObject(value)) {
throw new TypeError('Object.freeze can only be called on Objects.');
}
return value;
}
},
// 数字和字符串可以作为key
@ -19782,8 +19780,7 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
type: "bi.tooltip",
text: text,
level: level,
stopEvent: true,
height: this._const.height
stopEvent: true
});
},
@ -49689,8 +49686,7 @@ BI.Tooltip = BI.inherit(BI.Tip, {
text: "",
level: "success", // success或warning
stopEvent: false,
stopPropagation: false,
height: 18
stopPropagation: false
});
},
_init: function () {
@ -49734,8 +49730,7 @@ BI.Tooltip = BI.inherit(BI.Tip, {
textAlign: "left",
whiteSpace: "normal",
text: o.text,
height: o.height,
textHeight: o.height - 2,
textHeight: 18,
hgap: this._const.hgap
});
}
@ -68914,23 +68909,9 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
};
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
baseConfig.el = {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
};
return baseConfig;
},
_getAsyncConfig: function () {
_getSearchConfig: function() {
var self = this, o = this.options;
var config = this._getBaseConfig();
return BI.extend(config, {
return {
el: {
type: "bi.multilayer_select_tree_trigger",
allowEdit: o.allowEdit,
@ -68980,9 +68961,28 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
self.trigger.stopEditing();
}
}]
}
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
return BI.extend(baseConfig, o.allowEdit ? this._getSearchConfig() : {
el: {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
}
});
},
_getAsyncConfig: function () {
var config = this._getBaseConfig();
return BI.extend(config, this._getSearchConfig());
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.combo.setValue(v);
@ -69265,6 +69265,10 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.tree.initTree(BI.deepClone(BI.Tree.treeFormat(BI.deepClone(o.items))));
}
var content = {
type: "bi.htape",
items: [
@ -69319,7 +69323,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
if(o.itemsCreator === BI.emptyFn) {
var finding = BI.Func.getSearchResult(o.items, keyword);
var matched = finding.match, find = finding.find;
callback(find.concat(matched));
callback(self._fillTreeStructure4Search(find.concat(matched)));
} else {
callback();
}
@ -69361,6 +69365,29 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
};
},
// 将搜索到的节点进行补充,构造成一棵完整的树
_fillTreeStructure4Search: function (leaves) {
var result = BI.map(leaves, "id");
var queue = leaves.reverse() || [];
while (BI.isNotEmptyArray(queue)) {
var node = queue.pop();
var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id");
if (pNode != null) {
queue.push(pNode);
result.push(pNode.id);
}
}
var nodes = [];
BI.each(this.options.items, function (idx, item) {
if(BI.contains(result, item.id)) {
nodes.push(BI.extend({}, item, {
open: true
}))
}
});
return nodes;
},
_digest: function (v) {
var o = this.options;
return o.valueFormatter(v) || o.text;
@ -69893,23 +69920,9 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
};
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
baseConfig.el = {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
};
return baseConfig;
},
_getAsyncConfig: function () {
_getSearchConfig: function() {
var self = this, o = this.options;
var config = this._getBaseConfig();
return BI.extend(config, {
return {
el: {
type: "bi.multilayer_single_tree_trigger",
allowEdit: o.allowEdit,
@ -69959,9 +69972,28 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
self.trigger.stopEditing();
}
}]
}
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
return BI.extend(baseConfig, o.allowEdit ? this._getSearchConfig() : {
el: {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
}
});
},
_getAsyncConfig: function () {
var config = this._getBaseConfig();
return BI.extend(config, this._getSearchConfig());
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.combo.setValue(v);
@ -70243,6 +70275,10 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.tree.initTree(BI.deepClone(BI.Tree.treeFormat(BI.deepClone(o.items))));
}
var content = {
type: "bi.htape",
items: [
@ -70297,7 +70333,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
if(o.itemsCreator === BI.emptyFn) {
var finding = BI.Func.getSearchResult(o.items, keyword);
var matched = finding.match, find = finding.find;
callback(find.concat(matched));
callback(self._fillTreeStructure4Search(find.concat(matched)));
} else {
callback();
}
@ -70339,6 +70375,29 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
};
},
// 将搜索到的节点进行补充,构造成一棵完整的树
_fillTreeStructure4Search: function (leaves) {
var result = BI.map(leaves, "id");
var queue = leaves.reverse() || [];
while (BI.isNotEmptyArray(queue)) {
var node = queue.pop();
var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id");
if (pNode != null) {
queue.push(pNode);
result.push(pNode.id);
}
}
var nodes = [];
BI.each(this.options.items, function (idx, item) {
if(BI.contains(result, item.id)) {
nodes.push(BI.extend({}, item, {
open: true
}))
}
});
return nodes;
},
_digest: function (v) {
var o = this.options;
return o.valueFormatter(v) || o.text;

70
dist/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

149
dist/fineui.js vendored

@ -10895,14 +10895,12 @@ if (!_global.BI) {
},
freeze: function (value) {
if (Object.freeze) {
// 在ES5中,如果这个方法的参数不是一个对象(一个原始值),那么它会导致 TypeError
// 在ES2015中,非对象参数将被视为要被冻结的普通对象,并被简单地返回。
if (Object.freeze && BI.isObject(value)) {
return Object.freeze(value);
} else {
if (!BI.isObject(value)) {
throw new TypeError('Object.freeze can only be called on Objects.');
}
return value;
}
},
// 数字和字符串可以作为key
@ -19782,8 +19780,7 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
type: "bi.tooltip",
text: text,
level: level,
stopEvent: true,
height: this._const.height
stopEvent: true
});
},
@ -50093,8 +50090,7 @@ BI.Tooltip = BI.inherit(BI.Tip, {
text: "",
level: "success", // success或warning
stopEvent: false,
stopPropagation: false,
height: 18
stopPropagation: false
});
},
_init: function () {
@ -50138,8 +50134,7 @@ BI.Tooltip = BI.inherit(BI.Tip, {
textAlign: "left",
whiteSpace: "normal",
text: o.text,
height: o.height,
textHeight: o.height - 2,
textHeight: 18,
hgap: this._const.hgap
});
}
@ -69318,23 +69313,9 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
};
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
baseConfig.el = {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
};
return baseConfig;
},
_getAsyncConfig: function () {
_getSearchConfig: function() {
var self = this, o = this.options;
var config = this._getBaseConfig();
return BI.extend(config, {
return {
el: {
type: "bi.multilayer_select_tree_trigger",
allowEdit: o.allowEdit,
@ -69384,9 +69365,28 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
self.trigger.stopEditing();
}
}]
}
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
return BI.extend(baseConfig, o.allowEdit ? this._getSearchConfig() : {
el: {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
}
});
},
_getAsyncConfig: function () {
var config = this._getBaseConfig();
return BI.extend(config, this._getSearchConfig());
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.combo.setValue(v);
@ -69669,6 +69669,10 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.tree.initTree(BI.deepClone(BI.Tree.treeFormat(BI.deepClone(o.items))));
}
var content = {
type: "bi.htape",
items: [
@ -69723,7 +69727,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
if(o.itemsCreator === BI.emptyFn) {
var finding = BI.Func.getSearchResult(o.items, keyword);
var matched = finding.match, find = finding.find;
callback(find.concat(matched));
callback(self._fillTreeStructure4Search(find.concat(matched)));
} else {
callback();
}
@ -69765,6 +69769,29 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
};
},
// 将搜索到的节点进行补充,构造成一棵完整的树
_fillTreeStructure4Search: function (leaves) {
var result = BI.map(leaves, "id");
var queue = leaves.reverse() || [];
while (BI.isNotEmptyArray(queue)) {
var node = queue.pop();
var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id");
if (pNode != null) {
queue.push(pNode);
result.push(pNode.id);
}
}
var nodes = [];
BI.each(this.options.items, function (idx, item) {
if(BI.contains(result, item.id)) {
nodes.push(BI.extend({}, item, {
open: true
}))
}
});
return nodes;
},
_digest: function (v) {
var o = this.options;
return o.valueFormatter(v) || o.text;
@ -70297,23 +70324,9 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
};
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
baseConfig.el = {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
};
return baseConfig;
},
_getAsyncConfig: function () {
_getSearchConfig: function() {
var self = this, o = this.options;
var config = this._getBaseConfig();
return BI.extend(config, {
return {
el: {
type: "bi.multilayer_single_tree_trigger",
allowEdit: o.allowEdit,
@ -70363,9 +70376,28 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
self.trigger.stopEditing();
}
}]
}
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
return BI.extend(baseConfig, o.allowEdit ? this._getSearchConfig() : {
el: {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
}
});
},
_getAsyncConfig: function () {
var config = this._getBaseConfig();
return BI.extend(config, this._getSearchConfig());
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.combo.setValue(v);
@ -70647,6 +70679,10 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.tree.initTree(BI.deepClone(BI.Tree.treeFormat(BI.deepClone(o.items))));
}
var content = {
type: "bi.htape",
items: [
@ -70701,7 +70737,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
if(o.itemsCreator === BI.emptyFn) {
var finding = BI.Func.getSearchResult(o.items, keyword);
var matched = finding.match, find = finding.find;
callback(find.concat(matched));
callback(self._fillTreeStructure4Search(find.concat(matched)));
} else {
callback();
}
@ -70743,6 +70779,29 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
};
},
// 将搜索到的节点进行补充,构造成一棵完整的树
_fillTreeStructure4Search: function (leaves) {
var result = BI.map(leaves, "id");
var queue = leaves.reverse() || [];
while (BI.isNotEmptyArray(queue)) {
var node = queue.pop();
var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id");
if (pNode != null) {
queue.push(pNode);
result.push(pNode.id);
}
}
var nodes = [];
BI.each(this.options.items, function (idx, item) {
if(BI.contains(result, item.id)) {
nodes.push(BI.extend({}, item, {
open: true
}))
}
});
return nodes;
},
_digest: function (v) {
var o = this.options;
return o.valueFormatter(v) || o.text;

66
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

149
dist/fineui_without_jquery_polyfill.js vendored

@ -10650,14 +10650,12 @@ if (!_global.BI) {
},
freeze: function (value) {
if (Object.freeze) {
// 在ES5中,如果这个方法的参数不是一个对象(一个原始值),那么它会导致 TypeError
// 在ES2015中,非对象参数将被视为要被冻结的普通对象,并被简单地返回。
if (Object.freeze && BI.isObject(value)) {
return Object.freeze(value);
} else {
if (!BI.isObject(value)) {
throw new TypeError('Object.freeze can only be called on Objects.');
}
return value;
}
},
// 数字和字符串可以作为key
@ -19283,8 +19281,7 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
type: "bi.tooltip",
text: text,
level: level,
stopEvent: true,
height: this._const.height
stopEvent: true
});
},
@ -36871,8 +36868,7 @@ BI.Tooltip = BI.inherit(BI.Tip, {
text: "",
level: "success", // success或warning
stopEvent: false,
stopPropagation: false,
height: 18
stopPropagation: false
});
},
_init: function () {
@ -36916,8 +36912,7 @@ BI.Tooltip = BI.inherit(BI.Tip, {
textAlign: "left",
whiteSpace: "normal",
text: o.text,
height: o.height,
textHeight: o.height - 2,
textHeight: 18,
hgap: this._const.hgap
});
}
@ -51924,23 +51919,9 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
};
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
baseConfig.el = {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
};
return baseConfig;
},
_getAsyncConfig: function () {
_getSearchConfig: function() {
var self = this, o = this.options;
var config = this._getBaseConfig();
return BI.extend(config, {
return {
el: {
type: "bi.multilayer_select_tree_trigger",
allowEdit: o.allowEdit,
@ -51990,9 +51971,28 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
self.trigger.stopEditing();
}
}]
}
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
return BI.extend(baseConfig, o.allowEdit ? this._getSearchConfig() : {
el: {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
}
});
},
_getAsyncConfig: function () {
var config = this._getBaseConfig();
return BI.extend(config, this._getSearchConfig());
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.combo.setValue(v);
@ -52275,6 +52275,10 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.tree.initTree(BI.deepClone(BI.Tree.treeFormat(BI.deepClone(o.items))));
}
var content = {
type: "bi.htape",
items: [
@ -52329,7 +52333,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
if(o.itemsCreator === BI.emptyFn) {
var finding = BI.Func.getSearchResult(o.items, keyword);
var matched = finding.match, find = finding.find;
callback(find.concat(matched));
callback(self._fillTreeStructure4Search(find.concat(matched)));
} else {
callback();
}
@ -52371,6 +52375,29 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
};
},
// 将搜索到的节点进行补充,构造成一棵完整的树
_fillTreeStructure4Search: function (leaves) {
var result = BI.map(leaves, "id");
var queue = leaves.reverse() || [];
while (BI.isNotEmptyArray(queue)) {
var node = queue.pop();
var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id");
if (pNode != null) {
queue.push(pNode);
result.push(pNode.id);
}
}
var nodes = [];
BI.each(this.options.items, function (idx, item) {
if(BI.contains(result, item.id)) {
nodes.push(BI.extend({}, item, {
open: true
}))
}
});
return nodes;
},
_digest: function (v) {
var o = this.options;
return o.valueFormatter(v) || o.text;
@ -52903,23 +52930,9 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
};
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
baseConfig.el = {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
};
return baseConfig;
},
_getAsyncConfig: function () {
_getSearchConfig: function() {
var self = this, o = this.options;
var config = this._getBaseConfig();
return BI.extend(config, {
return {
el: {
type: "bi.multilayer_single_tree_trigger",
allowEdit: o.allowEdit,
@ -52969,9 +52982,28 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
self.trigger.stopEditing();
}
}]
}
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
return BI.extend(baseConfig, o.allowEdit ? this._getSearchConfig() : {
el: {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
}
});
},
_getAsyncConfig: function () {
var config = this._getBaseConfig();
return BI.extend(config, this._getSearchConfig());
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.combo.setValue(v);
@ -53253,6 +53285,10 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.tree.initTree(BI.deepClone(BI.Tree.treeFormat(BI.deepClone(o.items))));
}
var content = {
type: "bi.htape",
items: [
@ -53307,7 +53343,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
if(o.itemsCreator === BI.emptyFn) {
var finding = BI.Func.getSearchResult(o.items, keyword);
var matched = finding.match, find = finding.find;
callback(find.concat(matched));
callback(self._fillTreeStructure4Search(find.concat(matched)));
} else {
callback();
}
@ -53349,6 +53385,29 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
};
},
// 将搜索到的节点进行补充,构造成一棵完整的树
_fillTreeStructure4Search: function (leaves) {
var result = BI.map(leaves, "id");
var queue = leaves.reverse() || [];
while (BI.isNotEmptyArray(queue)) {
var node = queue.pop();
var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id");
if (pNode != null) {
queue.push(pNode);
result.push(pNode.id);
}
}
var nodes = [];
BI.each(this.options.items, function (idx, item) {
if(BI.contains(result, item.id)) {
nodes.push(BI.extend({}, item, {
open: true
}))
}
});
return nodes;
},
_digest: function (v) {
var o = this.options;
return o.valueFormatter(v) || o.text;

8
dist/utils.js vendored

@ -11429,14 +11429,12 @@ if (!_global.BI) {
},
freeze: function (value) {
if (Object.freeze) {
// 在ES5中,如果这个方法的参数不是一个对象(一个原始值),那么它会导致 TypeError
// 在ES2015中,非对象参数将被视为要被冻结的普通对象,并被简单地返回。
if (Object.freeze && BI.isObject(value)) {
return Object.freeze(value);
} else {
if (!BI.isObject(value)) {
throw new TypeError('Object.freeze can only be called on Objects.');
}
return value;
}
},
// 数字和字符串可以作为key

10
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

132
dist/widget.js vendored

@ -6728,23 +6728,9 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
};
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
baseConfig.el = {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
};
return baseConfig;
},
_getAsyncConfig: function () {
_getSearchConfig: function() {
var self = this, o = this.options;
var config = this._getBaseConfig();
return BI.extend(config, {
return {
el: {
type: "bi.multilayer_select_tree_trigger",
allowEdit: o.allowEdit,
@ -6794,9 +6780,28 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
self.trigger.stopEditing();
}
}]
}
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
return BI.extend(baseConfig, o.allowEdit ? this._getSearchConfig() : {
el: {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
}
});
},
_getAsyncConfig: function () {
var config = this._getBaseConfig();
return BI.extend(config, this._getSearchConfig());
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.combo.setValue(v);
@ -7079,6 +7084,10 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.tree.initTree(BI.deepClone(BI.Tree.treeFormat(BI.deepClone(o.items))));
}
var content = {
type: "bi.htape",
items: [
@ -7133,7 +7142,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
if(o.itemsCreator === BI.emptyFn) {
var finding = BI.Func.getSearchResult(o.items, keyword);
var matched = finding.match, find = finding.find;
callback(find.concat(matched));
callback(self._fillTreeStructure4Search(find.concat(matched)));
} else {
callback();
}
@ -7175,6 +7184,29 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
};
},
// 将搜索到的节点进行补充,构造成一棵完整的树
_fillTreeStructure4Search: function (leaves) {
var result = BI.map(leaves, "id");
var queue = leaves.reverse() || [];
while (BI.isNotEmptyArray(queue)) {
var node = queue.pop();
var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id");
if (pNode != null) {
queue.push(pNode);
result.push(pNode.id);
}
}
var nodes = [];
BI.each(this.options.items, function (idx, item) {
if(BI.contains(result, item.id)) {
nodes.push(BI.extend({}, item, {
open: true
}))
}
});
return nodes;
},
_digest: function (v) {
var o = this.options;
return o.valueFormatter(v) || o.text;
@ -7707,23 +7739,9 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
};
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
baseConfig.el = {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
};
return baseConfig;
},
_getAsyncConfig: function () {
_getSearchConfig: function() {
var self = this, o = this.options;
var config = this._getBaseConfig();
return BI.extend(config, {
return {
el: {
type: "bi.multilayer_single_tree_trigger",
allowEdit: o.allowEdit,
@ -7773,9 +7791,28 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
self.trigger.stopEditing();
}
}]
}
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
return BI.extend(baseConfig, o.allowEdit ? this._getSearchConfig() : {
el: {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
}
});
},
_getAsyncConfig: function () {
var config = this._getBaseConfig();
return BI.extend(config, this._getSearchConfig());
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.combo.setValue(v);
@ -8057,6 +8094,10 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.tree.initTree(BI.deepClone(BI.Tree.treeFormat(BI.deepClone(o.items))));
}
var content = {
type: "bi.htape",
items: [
@ -8111,7 +8152,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
if(o.itemsCreator === BI.emptyFn) {
var finding = BI.Func.getSearchResult(o.items, keyword);
var matched = finding.match, find = finding.find;
callback(find.concat(matched));
callback(self._fillTreeStructure4Search(find.concat(matched)));
} else {
callback();
}
@ -8153,6 +8194,29 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
};
},
// 将搜索到的节点进行补充,构造成一棵完整的树
_fillTreeStructure4Search: function (leaves) {
var result = BI.map(leaves, "id");
var queue = leaves.reverse() || [];
while (BI.isNotEmptyArray(queue)) {
var node = queue.pop();
var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id");
if (pNode != null) {
queue.push(pNode);
result.push(pNode.id);
}
}
var nodes = [];
BI.each(this.options.items, function (idx, item) {
if(BI.contains(result, item.id)) {
nodes.push(BI.extend({}, item, {
open: true
}))
}
});
return nodes;
},
_digest: function (v) {
var o = this.options;
return o.valueFormatter(v) || o.text;

8
src/core/base.js

@ -471,14 +471,12 @@ if (!_global.BI) {
},
freeze: function (value) {
if (Object.freeze) {
// 在ES5中,如果这个方法的参数不是一个对象(一个原始值),那么它会导致 TypeError
// 在ES2015中,非对象参数将被视为要被冻结的普通对象,并被简单地返回
if (Object.freeze && BI.isObject(value)) {
return Object.freeze(value);
} else {
if (!BI.isObject(value)) {
throw new TypeError('Object.freeze can only be called on Objects.');
}
return value;
}
},
// 数字和字符串可以作为key

Loading…
Cancel
Save