Guyi 5 years ago
parent
commit
482c8b3e25
  1. 5
      changelog.md
  2. 184
      dist/2.0/fineui.ie.js
  3. 64
      dist/2.0/fineui.ie.min.js
  4. 184
      dist/2.0/fineui.js
  5. 64
      dist/2.0/fineui.min.js
  6. 8
      dist/base.js
  7. 184
      dist/bundle.ie.js
  8. 64
      dist/bundle.ie.min.js
  9. 184
      dist/bundle.js
  10. 64
      dist/bundle.min.js
  11. 19
      dist/core.js
  12. 184
      dist/fineui.ie.js
  13. 68
      dist/fineui.ie.min.js
  14. 184
      dist/fineui.js
  15. 70
      dist/fineui.min.js
  16. 184
      dist/fineui_without_jquery_polyfill.js
  17. 113
      dist/fix/fix.ie.js
  18. 16
      dist/utils.js
  19. 10
      dist/utils.min.js
  20. 157
      dist/widget.js
  21. 2
      src/base/single/text.js
  22. 16
      src/core/base.js
  23. 1
      src/widget/multilayerselecttree/multilayerselecttree.combo.js
  24. 5
      src/widget/multilayerselecttree/multilayerselecttree.trigger.js
  25. 1
      src/widget/multilayersingletree/multilayersingletree.combo.js
  26. 5
      src/widget/multilayersingletree/multilayersingletree.trigger.js
  27. 1
      src/widget/multiselect/multiselect.insert.combo.js
  28. 1
      src/widget/multiselect/multiselect.insert.trigger.js
  29. 1
      src/widget/multiselect/multiselect.trigger.js
  30. 5
      src/widget/multiselect/trigger/editor.multiselect.js
  31. 1
      src/widget/multiselect/trigger/searcher.multiselect.insert.js
  32. 1
      src/widget/multitree/multi.tree.insert.combo.js
  33. 3
      src/widget/multitree/trigger/searcher.multi.tree.js

5
changelog.md

@ -1,5 +1,10 @@
# 更新日志
2.0(2019-08)
- 可编辑的combo新增水印配置
- 单选下拉树同步状态下内置搜索
2.0(2019-07)
- 修改了下拉框控件默认值的配色
- input及其派生编辑控件在PAUSE事件之前会触发CHANGE事件
2.0(2019-06)

184
dist/2.0/fineui.ie.js vendored

@ -10620,7 +10620,7 @@ if (!_global.BI) {
};
}
var F = function () {
}, spp = sp.prototype;
}, spp = sp.prototype;
F.prototype = spp;
sb.prototype = new F();
sb.superclass = spp;
@ -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;
}
return value;
},
// 数字和字符串可以作为key
@ -10856,7 +10854,7 @@ if (!_global.BI) {
var pending = false;
var timerFunc;
function nextTickHandler() {
function nextTickHandler () {
pending = false;
var copies = callbacks.slice(0);
callbacks = [];
@ -10889,7 +10887,7 @@ if (!_global.BI) {
setTimeout(nextTickHandler, 0);
};
}
return function queueNextTick(cb) {
return function queueNextTick (cb) {
var _resolve;
var args = [].slice.call(arguments, 1);
callbacks.push(function () {
@ -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
});
},
@ -38455,7 +38452,7 @@ BI.Text = BI.inherit(BI.Single, {
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
textOverflow: o.whiteSpace === "nowrap" ? "ellipsis" : "",
overflow: o.whiteSpace === "nowrap" ? "" : "auto"
overflow: o.whiteSpace === "nowrap" ? "" : (BI.isWidthOrHeight(o.height) ? "auto" : "")
});
if (o.handler) {
this.text = BI.createWidget({
@ -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,
@ -68696,6 +68677,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
items: o.items,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
height: o.height - 2,
text: o.text,
value: o.value,
@ -68735,9 +68717,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);
@ -69015,11 +69016,16 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
valueFormatter: function (v) {
return v;
},
itemsCreator: BI.emptyFn
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
},
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: [
@ -69040,7 +69046,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
value: o.value,
height: o.height,
tipText: "",
watermark: BI.i18nText("BI-Basic_Search"),
watermark: o.watermark,
listeners: [{
eventName: BI.StateEditor.EVENT_FOCUS,
action: function () {
@ -69074,7 +69080,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 +69122,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 +69677,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,
@ -69672,6 +69687,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.trigger = _ref;
},
watermark: o.watermark,
items: o.items,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
@ -69714,9 +69730,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);
@ -69993,11 +70028,16 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
valueFormatter: function (v) {
return v;
},
itemsCreator: BI.emptyFn
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
},
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: [
@ -70018,7 +70058,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
value: o.value,
height: o.height,
tipText: "",
watermark: BI.i18nText("BI-Basic_Search"),
watermark: o.watermark,
listeners: [{
eventName: BI.StateEditor.EVENT_FOCUS,
action: function () {
@ -70052,7 +70092,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 +70134,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;
@ -71446,6 +71509,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
allowEdit: o.allowEdit,
height: o.height,
text: o.text,
watermark: o.watermark,
// adapter: this.popup,
masker: {
offset: {
@ -72246,6 +72310,7 @@ BI.MultiSelectInsertTrigger = BI.inherit(BI.Trigger, {
text: o.text,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
popup: {},
adapter: o.adapter,
masker: o.masker,
@ -72972,6 +73037,7 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
text: o.text,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
popup: {},
adapter: o.adapter,
masker: o.masker,
@ -73570,7 +73636,8 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-editor",
el: {}
el: {},
watermark: BI.i18nText("BI-Basic_Search")
});
},
@ -73581,7 +73648,7 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
type: "bi.state_editor",
element: this,
height: o.height,
watermark: BI.i18nText("BI-Basic_Search"),
watermark: o.watermark,
allowBlank: true,
value: o.value,
defaultText: o.text,
@ -73678,6 +73745,7 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.editor = BI.createWidget(o.el, {
type: "bi.multi_select_editor",
watermark: o.watermark,
height: o.height,
text: o.text,
listeners: [{
@ -75842,6 +75910,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
searcher: {
type: "bi.multi_tree_searcher",
text: o.text,
watermark: o.watermark,
itemsCreator: o.itemsCreator,
popup: {
type: "bi.multi_tree_search_insert_pane",
@ -76948,7 +77017,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
popup: {},
adapter: null,
masker: {}
masker: {},
});
},
@ -76957,6 +77026,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.multi_select_editor",
watermark: o.watermark,
height: o.height,
el: {
type: "bi.simple_state_editor",

64
dist/2.0/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

184
dist/2.0/fineui.js vendored

@ -10620,7 +10620,7 @@ if (!_global.BI) {
};
}
var F = function () {
}, spp = sp.prototype;
}, spp = sp.prototype;
F.prototype = spp;
sb.prototype = new F();
sb.superclass = spp;
@ -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;
}
return value;
},
// 数字和字符串可以作为key
@ -10856,7 +10854,7 @@ if (!_global.BI) {
var pending = false;
var timerFunc;
function nextTickHandler() {
function nextTickHandler () {
pending = false;
var copies = callbacks.slice(0);
callbacks = [];
@ -10889,7 +10887,7 @@ if (!_global.BI) {
setTimeout(nextTickHandler, 0);
};
}
return function queueNextTick(cb) {
return function queueNextTick (cb) {
var _resolve;
var args = [].slice.call(arguments, 1);
callbacks.push(function () {
@ -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
});
},
@ -38859,7 +38856,7 @@ BI.Text = BI.inherit(BI.Single, {
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
textOverflow: o.whiteSpace === "nowrap" ? "ellipsis" : "",
overflow: o.whiteSpace === "nowrap" ? "" : "auto"
overflow: o.whiteSpace === "nowrap" ? "" : (BI.isWidthOrHeight(o.height) ? "auto" : "")
});
if (o.handler) {
this.text = BI.createWidget({
@ -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,
@ -69100,6 +69081,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
items: o.items,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
height: o.height - 2,
text: o.text,
value: o.value,
@ -69139,9 +69121,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);
@ -69419,11 +69420,16 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
valueFormatter: function (v) {
return v;
},
itemsCreator: BI.emptyFn
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
},
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: [
@ -69444,7 +69450,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
value: o.value,
height: o.height,
tipText: "",
watermark: BI.i18nText("BI-Basic_Search"),
watermark: o.watermark,
listeners: [{
eventName: BI.StateEditor.EVENT_FOCUS,
action: function () {
@ -69478,7 +69484,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 +69526,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 +70081,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,
@ -70076,6 +70091,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.trigger = _ref;
},
watermark: o.watermark,
items: o.items,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
@ -70118,9 +70134,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);
@ -70397,11 +70432,16 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
valueFormatter: function (v) {
return v;
},
itemsCreator: BI.emptyFn
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
},
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: [
@ -70422,7 +70462,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
value: o.value,
height: o.height,
tipText: "",
watermark: BI.i18nText("BI-Basic_Search"),
watermark: o.watermark,
listeners: [{
eventName: BI.StateEditor.EVENT_FOCUS,
action: function () {
@ -70456,7 +70496,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 +70538,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;
@ -71850,6 +71913,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
allowEdit: o.allowEdit,
height: o.height,
text: o.text,
watermark: o.watermark,
// adapter: this.popup,
masker: {
offset: {
@ -72650,6 +72714,7 @@ BI.MultiSelectInsertTrigger = BI.inherit(BI.Trigger, {
text: o.text,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
popup: {},
adapter: o.adapter,
masker: o.masker,
@ -73376,6 +73441,7 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
text: o.text,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
popup: {},
adapter: o.adapter,
masker: o.masker,
@ -73974,7 +74040,8 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-editor",
el: {}
el: {},
watermark: BI.i18nText("BI-Basic_Search")
});
},
@ -73985,7 +74052,7 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
type: "bi.state_editor",
element: this,
height: o.height,
watermark: BI.i18nText("BI-Basic_Search"),
watermark: o.watermark,
allowBlank: true,
value: o.value,
defaultText: o.text,
@ -74082,6 +74149,7 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.editor = BI.createWidget(o.el, {
type: "bi.multi_select_editor",
watermark: o.watermark,
height: o.height,
text: o.text,
listeners: [{
@ -76246,6 +76314,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
searcher: {
type: "bi.multi_tree_searcher",
text: o.text,
watermark: o.watermark,
itemsCreator: o.itemsCreator,
popup: {
type: "bi.multi_tree_search_insert_pane",
@ -77352,7 +77421,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
popup: {},
adapter: null,
masker: {}
masker: {},
});
},
@ -77361,6 +77430,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.multi_select_editor",
watermark: o.watermark,
height: o.height,
el: {
type: "bi.simple_state_editor",

64
dist/2.0/fineui.min.js vendored

File diff suppressed because one or more lines are too long

8
dist/base.js vendored

@ -585,7 +585,7 @@ BI.Text = BI.inherit(BI.Single, {
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
textOverflow: o.whiteSpace === "nowrap" ? "ellipsis" : "",
overflow: o.whiteSpace === "nowrap" ? "" : "auto"
overflow: o.whiteSpace === "nowrap" ? "" : (BI.isWidthOrHeight(o.height) ? "auto" : "")
});
if (o.handler) {
this.text = BI.createWidget({
@ -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
});
}

184
dist/bundle.ie.js vendored

@ -10620,7 +10620,7 @@ if (!_global.BI) {
};
}
var F = function () {
}, spp = sp.prototype;
}, spp = sp.prototype;
F.prototype = spp;
sb.prototype = new F();
sb.superclass = spp;
@ -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;
}
return value;
},
// 数字和字符串可以作为key
@ -10856,7 +10854,7 @@ if (!_global.BI) {
var pending = false;
var timerFunc;
function nextTickHandler() {
function nextTickHandler () {
pending = false;
var copies = callbacks.slice(0);
callbacks = [];
@ -10889,7 +10887,7 @@ if (!_global.BI) {
setTimeout(nextTickHandler, 0);
};
}
return function queueNextTick(cb) {
return function queueNextTick (cb) {
var _resolve;
var args = [].slice.call(arguments, 1);
callbacks.push(function () {
@ -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
});
},
@ -38455,7 +38452,7 @@ BI.Text = BI.inherit(BI.Single, {
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
textOverflow: o.whiteSpace === "nowrap" ? "ellipsis" : "",
overflow: o.whiteSpace === "nowrap" ? "" : "auto"
overflow: o.whiteSpace === "nowrap" ? "" : (BI.isWidthOrHeight(o.height) ? "auto" : "")
});
if (o.handler) {
this.text = BI.createWidget({
@ -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,
@ -68696,6 +68677,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
items: o.items,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
height: o.height - 2,
text: o.text,
value: o.value,
@ -68735,9 +68717,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);
@ -69015,11 +69016,16 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
valueFormatter: function (v) {
return v;
},
itemsCreator: BI.emptyFn
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
},
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: [
@ -69040,7 +69046,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
value: o.value,
height: o.height,
tipText: "",
watermark: BI.i18nText("BI-Basic_Search"),
watermark: o.watermark,
listeners: [{
eventName: BI.StateEditor.EVENT_FOCUS,
action: function () {
@ -69074,7 +69080,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 +69122,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 +69677,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,
@ -69672,6 +69687,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.trigger = _ref;
},
watermark: o.watermark,
items: o.items,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
@ -69714,9 +69730,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);
@ -69993,11 +70028,16 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
valueFormatter: function (v) {
return v;
},
itemsCreator: BI.emptyFn
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
},
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: [
@ -70018,7 +70058,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
value: o.value,
height: o.height,
tipText: "",
watermark: BI.i18nText("BI-Basic_Search"),
watermark: o.watermark,
listeners: [{
eventName: BI.StateEditor.EVENT_FOCUS,
action: function () {
@ -70052,7 +70092,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 +70134,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;
@ -71446,6 +71509,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
allowEdit: o.allowEdit,
height: o.height,
text: o.text,
watermark: o.watermark,
// adapter: this.popup,
masker: {
offset: {
@ -72246,6 +72310,7 @@ BI.MultiSelectInsertTrigger = BI.inherit(BI.Trigger, {
text: o.text,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
popup: {},
adapter: o.adapter,
masker: o.masker,
@ -72972,6 +73037,7 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
text: o.text,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
popup: {},
adapter: o.adapter,
masker: o.masker,
@ -73570,7 +73636,8 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-editor",
el: {}
el: {},
watermark: BI.i18nText("BI-Basic_Search")
});
},
@ -73581,7 +73648,7 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
type: "bi.state_editor",
element: this,
height: o.height,
watermark: BI.i18nText("BI-Basic_Search"),
watermark: o.watermark,
allowBlank: true,
value: o.value,
defaultText: o.text,
@ -73678,6 +73745,7 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.editor = BI.createWidget(o.el, {
type: "bi.multi_select_editor",
watermark: o.watermark,
height: o.height,
text: o.text,
listeners: [{
@ -75842,6 +75910,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
searcher: {
type: "bi.multi_tree_searcher",
text: o.text,
watermark: o.watermark,
itemsCreator: o.itemsCreator,
popup: {
type: "bi.multi_tree_search_insert_pane",
@ -76948,7 +77017,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
popup: {},
adapter: null,
masker: {}
masker: {},
});
},
@ -76957,6 +77026,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.multi_select_editor",
watermark: o.watermark,
height: o.height,
el: {
type: "bi.simple_state_editor",

64
dist/bundle.ie.min.js vendored

File diff suppressed because one or more lines are too long

184
dist/bundle.js vendored

@ -10620,7 +10620,7 @@ if (!_global.BI) {
};
}
var F = function () {
}, spp = sp.prototype;
}, spp = sp.prototype;
F.prototype = spp;
sb.prototype = new F();
sb.superclass = spp;
@ -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;
}
return value;
},
// 数字和字符串可以作为key
@ -10856,7 +10854,7 @@ if (!_global.BI) {
var pending = false;
var timerFunc;
function nextTickHandler() {
function nextTickHandler () {
pending = false;
var copies = callbacks.slice(0);
callbacks = [];
@ -10889,7 +10887,7 @@ if (!_global.BI) {
setTimeout(nextTickHandler, 0);
};
}
return function queueNextTick(cb) {
return function queueNextTick (cb) {
var _resolve;
var args = [].slice.call(arguments, 1);
callbacks.push(function () {
@ -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
});
},
@ -38859,7 +38856,7 @@ BI.Text = BI.inherit(BI.Single, {
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
textOverflow: o.whiteSpace === "nowrap" ? "ellipsis" : "",
overflow: o.whiteSpace === "nowrap" ? "" : "auto"
overflow: o.whiteSpace === "nowrap" ? "" : (BI.isWidthOrHeight(o.height) ? "auto" : "")
});
if (o.handler) {
this.text = BI.createWidget({
@ -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,
@ -69100,6 +69081,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
items: o.items,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
height: o.height - 2,
text: o.text,
value: o.value,
@ -69139,9 +69121,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);
@ -69419,11 +69420,16 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
valueFormatter: function (v) {
return v;
},
itemsCreator: BI.emptyFn
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
},
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: [
@ -69444,7 +69450,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
value: o.value,
height: o.height,
tipText: "",
watermark: BI.i18nText("BI-Basic_Search"),
watermark: o.watermark,
listeners: [{
eventName: BI.StateEditor.EVENT_FOCUS,
action: function () {
@ -69478,7 +69484,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 +69526,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 +70081,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,
@ -70076,6 +70091,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.trigger = _ref;
},
watermark: o.watermark,
items: o.items,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
@ -70118,9 +70134,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);
@ -70397,11 +70432,16 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
valueFormatter: function (v) {
return v;
},
itemsCreator: BI.emptyFn
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
},
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: [
@ -70422,7 +70462,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
value: o.value,
height: o.height,
tipText: "",
watermark: BI.i18nText("BI-Basic_Search"),
watermark: o.watermark,
listeners: [{
eventName: BI.StateEditor.EVENT_FOCUS,
action: function () {
@ -70456,7 +70496,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 +70538,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;
@ -71850,6 +71913,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
allowEdit: o.allowEdit,
height: o.height,
text: o.text,
watermark: o.watermark,
// adapter: this.popup,
masker: {
offset: {
@ -72650,6 +72714,7 @@ BI.MultiSelectInsertTrigger = BI.inherit(BI.Trigger, {
text: o.text,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
popup: {},
adapter: o.adapter,
masker: o.masker,
@ -73376,6 +73441,7 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
text: o.text,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
popup: {},
adapter: o.adapter,
masker: o.masker,
@ -73974,7 +74040,8 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-editor",
el: {}
el: {},
watermark: BI.i18nText("BI-Basic_Search")
});
},
@ -73985,7 +74052,7 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
type: "bi.state_editor",
element: this,
height: o.height,
watermark: BI.i18nText("BI-Basic_Search"),
watermark: o.watermark,
allowBlank: true,
value: o.value,
defaultText: o.text,
@ -74082,6 +74149,7 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.editor = BI.createWidget(o.el, {
type: "bi.multi_select_editor",
watermark: o.watermark,
height: o.height,
text: o.text,
listeners: [{
@ -76246,6 +76314,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
searcher: {
type: "bi.multi_tree_searcher",
text: o.text,
watermark: o.watermark,
itemsCreator: o.itemsCreator,
popup: {
type: "bi.multi_tree_search_insert_pane",
@ -77352,7 +77421,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
popup: {},
adapter: null,
masker: {}
masker: {},
});
},
@ -77361,6 +77430,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.multi_select_editor",
watermark: o.watermark,
height: o.height,
el: {
type: "bi.simple_state_editor",

64
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

19
dist/core.js vendored

@ -10620,7 +10620,7 @@ if (!_global.BI) {
};
}
var F = function () {
}, spp = sp.prototype;
}, spp = sp.prototype;
F.prototype = spp;
sb.prototype = new F();
sb.superclass = spp;
@ -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;
}
return value;
},
// 数字和字符串可以作为key
@ -10856,7 +10854,7 @@ if (!_global.BI) {
var pending = false;
var timerFunc;
function nextTickHandler() {
function nextTickHandler () {
pending = false;
var copies = callbacks.slice(0);
callbacks = [];
@ -10889,7 +10887,7 @@ if (!_global.BI) {
setTimeout(nextTickHandler, 0);
};
}
return function queueNextTick(cb) {
return function queueNextTick (cb) {
var _resolve;
var args = [].slice.call(arguments, 1);
callbacks.push(function () {
@ -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
});
},

184
dist/fineui.ie.js vendored

@ -10865,7 +10865,7 @@ if (!_global.BI) {
};
}
var F = function () {
}, spp = sp.prototype;
}, spp = sp.prototype;
F.prototype = spp;
sb.prototype = new F();
sb.superclass = spp;
@ -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;
}
return value;
},
// 数字和字符串可以作为key
@ -11101,7 +11099,7 @@ if (!_global.BI) {
var pending = false;
var timerFunc;
function nextTickHandler() {
function nextTickHandler () {
pending = false;
var copies = callbacks.slice(0);
callbacks = [];
@ -11134,7 +11132,7 @@ if (!_global.BI) {
setTimeout(nextTickHandler, 0);
};
}
return function queueNextTick(cb) {
return function queueNextTick (cb) {
var _resolve;
var args = [].slice.call(arguments, 1);
callbacks.push(function () {
@ -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
});
},
@ -38700,7 +38697,7 @@ BI.Text = BI.inherit(BI.Single, {
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
textOverflow: o.whiteSpace === "nowrap" ? "ellipsis" : "",
overflow: o.whiteSpace === "nowrap" ? "" : "auto"
overflow: o.whiteSpace === "nowrap" ? "" : (BI.isWidthOrHeight(o.height) ? "auto" : "")
});
if (o.handler) {
this.text = BI.createWidget({
@ -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,
@ -68941,6 +68922,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
items: o.items,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
height: o.height - 2,
text: o.text,
value: o.value,
@ -68980,9 +68962,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);
@ -69260,11 +69261,16 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
valueFormatter: function (v) {
return v;
},
itemsCreator: BI.emptyFn
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
},
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: [
@ -69285,7 +69291,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
value: o.value,
height: o.height,
tipText: "",
watermark: BI.i18nText("BI-Basic_Search"),
watermark: o.watermark,
listeners: [{
eventName: BI.StateEditor.EVENT_FOCUS,
action: function () {
@ -69319,7 +69325,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 +69367,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 +69922,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,
@ -69917,6 +69932,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.trigger = _ref;
},
watermark: o.watermark,
items: o.items,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
@ -69959,9 +69975,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);
@ -70238,11 +70273,16 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
valueFormatter: function (v) {
return v;
},
itemsCreator: BI.emptyFn
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
},
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: [
@ -70263,7 +70303,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
value: o.value,
height: o.height,
tipText: "",
watermark: BI.i18nText("BI-Basic_Search"),
watermark: o.watermark,
listeners: [{
eventName: BI.StateEditor.EVENT_FOCUS,
action: function () {
@ -70297,7 +70337,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 +70379,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;
@ -71691,6 +71754,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
allowEdit: o.allowEdit,
height: o.height,
text: o.text,
watermark: o.watermark,
// adapter: this.popup,
masker: {
offset: {
@ -72491,6 +72555,7 @@ BI.MultiSelectInsertTrigger = BI.inherit(BI.Trigger, {
text: o.text,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
popup: {},
adapter: o.adapter,
masker: o.masker,
@ -73217,6 +73282,7 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
text: o.text,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
popup: {},
adapter: o.adapter,
masker: o.masker,
@ -73815,7 +73881,8 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-editor",
el: {}
el: {},
watermark: BI.i18nText("BI-Basic_Search")
});
},
@ -73826,7 +73893,7 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
type: "bi.state_editor",
element: this,
height: o.height,
watermark: BI.i18nText("BI-Basic_Search"),
watermark: o.watermark,
allowBlank: true,
value: o.value,
defaultText: o.text,
@ -73923,6 +73990,7 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.editor = BI.createWidget(o.el, {
type: "bi.multi_select_editor",
watermark: o.watermark,
height: o.height,
text: o.text,
listeners: [{
@ -76087,6 +76155,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
searcher: {
type: "bi.multi_tree_searcher",
text: o.text,
watermark: o.watermark,
itemsCreator: o.itemsCreator,
popup: {
type: "bi.multi_tree_search_insert_pane",
@ -77193,7 +77262,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
popup: {},
adapter: null,
masker: {}
masker: {},
});
},
@ -77202,6 +77271,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.multi_select_editor",
watermark: o.watermark,
height: o.height,
el: {
type: "bi.simple_state_editor",

68
dist/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

184
dist/fineui.js vendored

@ -10865,7 +10865,7 @@ if (!_global.BI) {
};
}
var F = function () {
}, spp = sp.prototype;
}, spp = sp.prototype;
F.prototype = spp;
sb.prototype = new F();
sb.superclass = spp;
@ -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;
}
return value;
},
// 数字和字符串可以作为key
@ -11101,7 +11099,7 @@ if (!_global.BI) {
var pending = false;
var timerFunc;
function nextTickHandler() {
function nextTickHandler () {
pending = false;
var copies = callbacks.slice(0);
callbacks = [];
@ -11134,7 +11132,7 @@ if (!_global.BI) {
setTimeout(nextTickHandler, 0);
};
}
return function queueNextTick(cb) {
return function queueNextTick (cb) {
var _resolve;
var args = [].slice.call(arguments, 1);
callbacks.push(function () {
@ -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
});
},
@ -39104,7 +39101,7 @@ BI.Text = BI.inherit(BI.Single, {
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
textOverflow: o.whiteSpace === "nowrap" ? "ellipsis" : "",
overflow: o.whiteSpace === "nowrap" ? "" : "auto"
overflow: o.whiteSpace === "nowrap" ? "" : (BI.isWidthOrHeight(o.height) ? "auto" : "")
});
if (o.handler) {
this.text = BI.createWidget({
@ -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,
@ -69345,6 +69326,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
items: o.items,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
height: o.height - 2,
text: o.text,
value: o.value,
@ -69384,9 +69366,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);
@ -69664,11 +69665,16 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
valueFormatter: function (v) {
return v;
},
itemsCreator: BI.emptyFn
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
},
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: [
@ -69689,7 +69695,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
value: o.value,
height: o.height,
tipText: "",
watermark: BI.i18nText("BI-Basic_Search"),
watermark: o.watermark,
listeners: [{
eventName: BI.StateEditor.EVENT_FOCUS,
action: function () {
@ -69723,7 +69729,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 +69771,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 +70326,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,
@ -70321,6 +70336,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.trigger = _ref;
},
watermark: o.watermark,
items: o.items,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
@ -70363,9 +70379,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);
@ -70642,11 +70677,16 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
valueFormatter: function (v) {
return v;
},
itemsCreator: BI.emptyFn
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
},
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: [
@ -70667,7 +70707,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
value: o.value,
height: o.height,
tipText: "",
watermark: BI.i18nText("BI-Basic_Search"),
watermark: o.watermark,
listeners: [{
eventName: BI.StateEditor.EVENT_FOCUS,
action: function () {
@ -70701,7 +70741,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 +70783,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;
@ -72095,6 +72158,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
allowEdit: o.allowEdit,
height: o.height,
text: o.text,
watermark: o.watermark,
// adapter: this.popup,
masker: {
offset: {
@ -72895,6 +72959,7 @@ BI.MultiSelectInsertTrigger = BI.inherit(BI.Trigger, {
text: o.text,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
popup: {},
adapter: o.adapter,
masker: o.masker,
@ -73621,6 +73686,7 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
text: o.text,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
popup: {},
adapter: o.adapter,
masker: o.masker,
@ -74219,7 +74285,8 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-editor",
el: {}
el: {},
watermark: BI.i18nText("BI-Basic_Search")
});
},
@ -74230,7 +74297,7 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
type: "bi.state_editor",
element: this,
height: o.height,
watermark: BI.i18nText("BI-Basic_Search"),
watermark: o.watermark,
allowBlank: true,
value: o.value,
defaultText: o.text,
@ -74327,6 +74394,7 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.editor = BI.createWidget(o.el, {
type: "bi.multi_select_editor",
watermark: o.watermark,
height: o.height,
text: o.text,
listeners: [{
@ -76491,6 +76559,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
searcher: {
type: "bi.multi_tree_searcher",
text: o.text,
watermark: o.watermark,
itemsCreator: o.itemsCreator,
popup: {
type: "bi.multi_tree_search_insert_pane",
@ -77597,7 +77666,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
popup: {},
adapter: null,
masker: {}
masker: {},
});
},
@ -77606,6 +77675,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.multi_select_editor",
watermark: o.watermark,
height: o.height,
el: {
type: "bi.simple_state_editor",

70
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

184
dist/fineui_without_jquery_polyfill.js vendored

@ -10620,7 +10620,7 @@ if (!_global.BI) {
};
}
var F = function () {
}, spp = sp.prototype;
}, spp = sp.prototype;
F.prototype = spp;
sb.prototype = new F();
sb.superclass = spp;
@ -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;
}
return value;
},
// 数字和字符串可以作为key
@ -10856,7 +10854,7 @@ if (!_global.BI) {
var pending = false;
var timerFunc;
function nextTickHandler() {
function nextTickHandler () {
pending = false;
var copies = callbacks.slice(0);
callbacks = [];
@ -10889,7 +10887,7 @@ if (!_global.BI) {
setTimeout(nextTickHandler, 0);
};
}
return function queueNextTick(cb) {
return function queueNextTick (cb) {
var _resolve;
var args = [].slice.call(arguments, 1);
callbacks.push(function () {
@ -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
});
},
@ -27478,7 +27475,7 @@ BI.Text = BI.inherit(BI.Single, {
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
textOverflow: o.whiteSpace === "nowrap" ? "ellipsis" : "",
overflow: o.whiteSpace === "nowrap" ? "" : "auto"
overflow: o.whiteSpace === "nowrap" ? "" : (BI.isWidthOrHeight(o.height) ? "auto" : "")
});
if (o.handler) {
this.text = BI.createWidget({
@ -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,
@ -51951,6 +51932,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
items: o.items,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
height: o.height - 2,
text: o.text,
value: o.value,
@ -51990,9 +51972,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);
@ -52270,11 +52271,16 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
valueFormatter: function (v) {
return v;
},
itemsCreator: BI.emptyFn
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
},
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: [
@ -52295,7 +52301,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
value: o.value,
height: o.height,
tipText: "",
watermark: BI.i18nText("BI-Basic_Search"),
watermark: o.watermark,
listeners: [{
eventName: BI.StateEditor.EVENT_FOCUS,
action: function () {
@ -52329,7 +52335,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 +52377,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 +52932,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,
@ -52927,6 +52942,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.trigger = _ref;
},
watermark: o.watermark,
items: o.items,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
@ -52969,9 +52985,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);
@ -53248,11 +53283,16 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
valueFormatter: function (v) {
return v;
},
itemsCreator: BI.emptyFn
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
},
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: [
@ -53273,7 +53313,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
value: o.value,
height: o.height,
tipText: "",
watermark: BI.i18nText("BI-Basic_Search"),
watermark: o.watermark,
listeners: [{
eventName: BI.StateEditor.EVENT_FOCUS,
action: function () {
@ -53307,7 +53347,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 +53389,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;
@ -54701,6 +54764,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
allowEdit: o.allowEdit,
height: o.height,
text: o.text,
watermark: o.watermark,
// adapter: this.popup,
masker: {
offset: {
@ -55501,6 +55565,7 @@ BI.MultiSelectInsertTrigger = BI.inherit(BI.Trigger, {
text: o.text,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
popup: {},
adapter: o.adapter,
masker: o.masker,
@ -56227,6 +56292,7 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
text: o.text,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
popup: {},
adapter: o.adapter,
masker: o.masker,
@ -56825,7 +56891,8 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-editor",
el: {}
el: {},
watermark: BI.i18nText("BI-Basic_Search")
});
},
@ -56836,7 +56903,7 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
type: "bi.state_editor",
element: this,
height: o.height,
watermark: BI.i18nText("BI-Basic_Search"),
watermark: o.watermark,
allowBlank: true,
value: o.value,
defaultText: o.text,
@ -56933,6 +57000,7 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.editor = BI.createWidget(o.el, {
type: "bi.multi_select_editor",
watermark: o.watermark,
height: o.height,
text: o.text,
listeners: [{
@ -59097,6 +59165,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
searcher: {
type: "bi.multi_tree_searcher",
text: o.text,
watermark: o.watermark,
itemsCreator: o.itemsCreator,
popup: {
type: "bi.multi_tree_search_insert_pane",
@ -60203,7 +60272,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
popup: {},
adapter: null,
masker: {}
masker: {},
});
},
@ -60212,6 +60281,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.multi_select_editor",
watermark: o.watermark,
height: o.height,
el: {
type: "bi.simple_state_editor",

113
dist/fix/fix.ie.js vendored

@ -15,6 +15,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
$vm: falsy
};
var $$skips = ['$accessors', '$vbthis', '$vbsetter', '$vm'];
var originalMethods = [];
_$1.each(['slice', 'splice'], function (method) {
originalMethods[method] = Array.prototype[method];
@ -128,7 +130,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
} else if (model && isPlainObject(model)) {
result = {};
for (var key in model) {
if (!_$1.has($$skipArray, key)) {
if ($$skips.indexOf(key) === -1) {
result[key] = toJSON(model[key]);
}
}
@ -148,15 +150,6 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
}
return toJSON(obj);
// const type = typeof obj;
//
// switch (type) {
// case 'object':
// return _.extend({}, obj);
// default:
// return obj;
// }
}
var nextTick = function () {
@ -263,8 +256,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
/* eslint no-use-before-define: ["off"] */
var deepEq = function deepEq(a, b, aStack, bStack) {
// Unwrap any wrapped objects.
if (a instanceof _$1) a = a._wrapped;
if (b instanceof _$1) b = b._wrapped;
if (a instanceof _) a = a._wrapped;
if (b instanceof _) b = b._wrapped;
// Compare `[[Class]]` names.
var className = toString.call(a);
if (className !== toString.call(b)) return false;
@ -343,7 +336,11 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
while (length--) {
// Deep compare each member
key = keys[length];
if (!(_$1.has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
if ($$skips.indexOf(key) !== -1) {
return true;
}
if (!(Object.keys(b).indexOf(key) !== -1 && eq(a[key], b[key], aStack, bStack))) return false;
}
}
// Remove the first object from the stack of traversed objects.
@ -371,37 +368,46 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
return deepEq(a, b, aStack, bStack);
};
var shadowEq = function shadowEq(a, b, aStack, bStack) {
// Identical objects are equal. `0 === -0`, but they aren't identical.
// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
if (a === b) return a !== 0 || 1 / a === 1 / b;
// `null` or `undefined` only equal to itself (strict comparison).
if (a == null || b == null) return false;
// `NaN`s are equivalent, but non-reflexive.
if (a !== a) return b !== b;
// Exhaust primitive checks
var type = typeof a;
if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;
// export function isShadowEqual(a, b) {
// return shadowEq(a, b);
// }
// skip function
if (type === 'function') return true;
function isShadowEqual(a, b) {
if (a === b) return true;
if (a && b && typeof a == 'object' && typeof b == 'object') {
if (a.constructor !== b.constructor) return false;
var length, i, key, keys;
if (Array.isArray(a)) {
length = a.length;
if (length != b.length) return false;
for (i = length; i-- !== 0;) {
if (!isShadowEqual(a[i], b[i])) return false;
}return true;
}
if (Array.isArray(a) && Array.isArray(b) && (a.__ref__ || b.__ref__)) {
if (a.length !== b.length) return false;
// for (let i = 0; i < a.length; i++) {
// if (a[i] !== b[i]) {
// return false;
// }
// }
if (a.constructor === RegExp) return true;
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
return a.__ref__ === b.__ref__;
}
keys = Object.keys(a);
length = keys.length;
if (length !== Object.keys(b).length) return false;
for (i = length; i-- !== 0;) {
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
}for (i = length; i-- !== 0;) {
key = keys[i];
if ($$skips.indexOf(key) !== -1) continue;
if (!isShadowEqual(a[key], b[key])) return false;
}
return deepEq(a, b, aStack, bStack);
};
return true;
}
function isShadowEqual(a, b) {
return shadowEq(a, b);
// true if both NaN, false otherwise
return a !== a && b !== b;
}
var mixinInjection = {};
@ -765,21 +771,13 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
});
}
function addToListenerQueue(vm, watcher, cur, last) {
var listener = {
id: watcher.id,
cb: _$1.bind(watcher.listener, vm, cur, last, vm)
};
watcher.sync === true ? vm.syncListeners.push(listener) : vm.asyncListeners.push(listener);
}
function digestState(vm) {
var dirty = false;
_$1.each(vm._stateWatchers, function (watcher, key) {
var cur = watcher.get();
var last = watcher.last;
if (!isShadowEqual(cur, last)) {
addToListenerQueue(vm, watcher, cur, last);
// addToListenerQueue(vm, watcher, cur, last);
vm.model[key] = cur;
dirty = true;
watcher.last = cloneShadow(cur);
@ -801,7 +799,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var cur = watcher.get();
var last = watcher.last;
if (!isShadowEqual(cur, last)) {
addToListenerQueue(vm, watcher, cur, last);
// addToListenerQueue(vm, watcher, cur, last);
vm.model[key] = cur;
dirty = true;
dirtyQueue.push(key);
@ -902,15 +900,16 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
_$1.each(syncListeners, function (listener) {
listener.cb();
});
nextTick(function () {
_$1.each(contextListeners, function (listener) {
listener.cb();
});
_$1.each(asyncListeners, function (listener) {
listener.cb();
if (contextListeners.length !== 0 || asyncListeners.length !== 0) {
nextTick(function () {
_$1.each(contextListeners, function (listener) {
listener.cb();
});
_$1.each(asyncListeners, function (listener) {
listener.cb();
});
});
});
}
}
function refreshAllDefineModel() {

16
dist/utils.js vendored

@ -11399,7 +11399,7 @@ if (!_global.BI) {
};
}
var F = function () {
}, spp = sp.prototype;
}, spp = sp.prototype;
F.prototype = spp;
sb.prototype = new F();
sb.superclass = spp;
@ -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;
}
return value;
},
// 数字和字符串可以作为key
@ -11635,7 +11633,7 @@ if (!_global.BI) {
var pending = false;
var timerFunc;
function nextTickHandler() {
function nextTickHandler () {
pending = false;
var copies = callbacks.slice(0);
callbacks = [];
@ -11668,7 +11666,7 @@ if (!_global.BI) {
setTimeout(nextTickHandler, 0);
};
}
return function queueNextTick(cb) {
return function queueNextTick (cb) {
var _resolve;
var args = [].slice.call(arguments, 1);
callbacks.push(function () {

10
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

157
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,
@ -6755,6 +6741,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
items: o.items,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
height: o.height - 2,
text: o.text,
value: o.value,
@ -6794,9 +6781,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);
@ -7074,11 +7080,16 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
valueFormatter: function (v) {
return v;
},
itemsCreator: BI.emptyFn
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
},
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: [
@ -7099,7 +7110,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
value: o.value,
height: o.height,
tipText: "",
watermark: BI.i18nText("BI-Basic_Search"),
watermark: o.watermark,
listeners: [{
eventName: BI.StateEditor.EVENT_FOCUS,
action: function () {
@ -7133,7 +7144,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 +7186,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 +7741,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,
@ -7731,6 +7751,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.trigger = _ref;
},
watermark: o.watermark,
items: o.items,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
@ -7773,9 +7794,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);
@ -8052,11 +8092,16 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
valueFormatter: function (v) {
return v;
},
itemsCreator: BI.emptyFn
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
},
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: [
@ -8077,7 +8122,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
value: o.value,
height: o.height,
tipText: "",
watermark: BI.i18nText("BI-Basic_Search"),
watermark: o.watermark,
listeners: [{
eventName: BI.StateEditor.EVENT_FOCUS,
action: function () {
@ -8111,7 +8156,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 +8198,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;
@ -9505,6 +9573,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
allowEdit: o.allowEdit,
height: o.height,
text: o.text,
watermark: o.watermark,
// adapter: this.popup,
masker: {
offset: {
@ -10305,6 +10374,7 @@ BI.MultiSelectInsertTrigger = BI.inherit(BI.Trigger, {
text: o.text,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
popup: {},
adapter: o.adapter,
masker: o.masker,
@ -11031,6 +11101,7 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
text: o.text,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
popup: {},
adapter: o.adapter,
masker: o.masker,
@ -11629,7 +11700,8 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-editor",
el: {}
el: {},
watermark: BI.i18nText("BI-Basic_Search")
});
},
@ -11640,7 +11712,7 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
type: "bi.state_editor",
element: this,
height: o.height,
watermark: BI.i18nText("BI-Basic_Search"),
watermark: o.watermark,
allowBlank: true,
value: o.value,
defaultText: o.text,
@ -11737,6 +11809,7 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.editor = BI.createWidget(o.el, {
type: "bi.multi_select_editor",
watermark: o.watermark,
height: o.height,
text: o.text,
listeners: [{
@ -13901,6 +13974,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
searcher: {
type: "bi.multi_tree_searcher",
text: o.text,
watermark: o.watermark,
itemsCreator: o.itemsCreator,
popup: {
type: "bi.multi_tree_search_insert_pane",
@ -15007,7 +15081,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
popup: {},
adapter: null,
masker: {}
masker: {},
});
},
@ -15016,6 +15090,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.multi_select_editor",
watermark: o.watermark,
height: o.height,
el: {
type: "bi.simple_state_editor",

2
src/base/single/text.js

@ -57,7 +57,7 @@ BI.Text = BI.inherit(BI.Single, {
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
textOverflow: o.whiteSpace === "nowrap" ? "ellipsis" : "",
overflow: o.whiteSpace === "nowrap" ? "" : "auto"
overflow: o.whiteSpace === "nowrap" ? "" : (BI.isWidthOrHeight(o.height) ? "auto" : "")
});
if (o.handler) {
this.text = BI.createWidget({

16
src/core/base.js

@ -441,7 +441,7 @@ if (!_global.BI) {
};
}
var F = function () {
}, spp = sp.prototype;
}, spp = sp.prototype;
F.prototype = spp;
sb.prototype = new F();
sb.superclass = spp;
@ -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;
}
return value;
},
// 数字和字符串可以作为key
@ -677,7 +675,7 @@ if (!_global.BI) {
var pending = false;
var timerFunc;
function nextTickHandler() {
function nextTickHandler () {
pending = false;
var copies = callbacks.slice(0);
callbacks = [];
@ -710,7 +708,7 @@ if (!_global.BI) {
setTimeout(nextTickHandler, 0);
};
}
return function queueNextTick(cb) {
return function queueNextTick (cb) {
var _resolve;
var args = [].slice.call(arguments, 1);
callbacks.push(function () {

1
src/widget/multilayerselecttree/multilayerselecttree.combo.js

@ -104,6 +104,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
items: o.items,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
height: o.height - 2,
text: o.text,
value: o.value,

5
src/widget/multilayerselecttree/multilayerselecttree.trigger.js

@ -9,7 +9,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
valueFormatter: function (v) {
return v;
},
itemsCreator: BI.emptyFn
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
},
render: function () {
@ -38,7 +39,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
value: o.value,
height: o.height,
tipText: "",
watermark: BI.i18nText("BI-Basic_Search"),
watermark: o.watermark,
listeners: [{
eventName: BI.StateEditor.EVENT_FOCUS,
action: function () {

1
src/widget/multilayersingletree/multilayersingletree.combo.js

@ -104,6 +104,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.trigger = _ref;
},
watermark: o.watermark,
items: o.items,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,

5
src/widget/multilayersingletree/multilayersingletree.trigger.js

@ -9,7 +9,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
valueFormatter: function (v) {
return v;
},
itemsCreator: BI.emptyFn
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search")
},
render: function () {
@ -38,7 +39,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
value: o.value,
height: o.height,
tipText: "",
watermark: BI.i18nText("BI-Basic_Search"),
watermark: o.watermark,
listeners: [{
eventName: BI.StateEditor.EVENT_FOCUS,
action: function () {

1
src/widget/multiselect/multiselect.insert.combo.js

@ -36,6 +36,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
allowEdit: o.allowEdit,
height: o.height,
text: o.text,
watermark: o.watermark,
// adapter: this.popup,
masker: {
offset: {

1
src/widget/multiselect/multiselect.insert.trigger.js

@ -41,6 +41,7 @@ BI.MultiSelectInsertTrigger = BI.inherit(BI.Trigger, {
text: o.text,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
popup: {},
adapter: o.adapter,
masker: o.masker,

1
src/widget/multiselect/multiselect.trigger.js

@ -41,6 +41,7 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
text: o.text,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
popup: {},
adapter: o.adapter,
masker: o.masker,

5
src/widget/multiselect/trigger/editor.multiselect.js

@ -9,7 +9,8 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-editor",
el: {}
el: {},
watermark: BI.i18nText("BI-Basic_Search")
});
},
@ -20,7 +21,7 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
type: "bi.state_editor",
element: this,
height: o.height,
watermark: BI.i18nText("BI-Basic_Search"),
watermark: o.watermark,
allowBlank: true,
value: o.value,
defaultText: o.text,

1
src/widget/multiselect/trigger/searcher.multiselect.insert.js

@ -24,6 +24,7 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.editor = BI.createWidget(o.el, {
type: "bi.multi_select_editor",
watermark: o.watermark,
height: o.height,
text: o.text,
listeners: [{

1
src/widget/multitree/multi.tree.insert.combo.js

@ -47,6 +47,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
searcher: {
type: "bi.multi_tree_searcher",
text: o.text,
watermark: o.watermark,
itemsCreator: o.itemsCreator,
popup: {
type: "bi.multi_tree_search_insert_pane",

3
src/widget/multitree/trigger/searcher.multi.tree.js

@ -16,7 +16,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
popup: {},
adapter: null,
masker: {}
masker: {},
});
},
@ -25,6 +25,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.multi_select_editor",
watermark: o.watermark,
height: o.height,
el: {
type: "bi.simple_state_editor",

Loading…
Cancel
Save