Browse Source

Merge pull request #238391 in DEC/fineui from final/11.0 to persist/11.0

* commit '822536679a19f6ef947104c4c6f3bc3ec5a00382': (40 commits)
  BI-126227 feat: 图标更新
  REPORT-80311 fix: 给一下默认值
  BI-124556 fix: 图标更新
  BI-124907 fix: 下拉无选项
  BI-124747 fix: 更新图标
  BI-125050 【6.0.9冒烟】火狐浏览器,组件产生滚动条时没办法调整最后一列的组件宽度
  auto upgrade version to 2.0.20230413101426
  auto upgrade version to 2.0.20230413093600
  BI-124805 fix: revert BI-122401
  auto upgrade version to 2.0.20230412174452
  BI-124805 fix: revert BI-122401
  BI-124559 fix: 升级BI6版本后,老版本火狐浏览器无法打开仪表板
  auto upgrade version to 2.0.20230411181532
  auto upgrade version to 2.0.20230411180538
  BI-124616 更新字体文件
  BI-124616 更新字体文件
  auto upgrade version to 2.0.20230411093545
  BI-124616 更新字体文件
  auto upgrade version to 2.0.20230410093737
  无JIRA fix: 书写错误_isOverflowY判断
  ...
research/test
superman 2 years ago
parent
commit
47d1e2dca2
  1. BIN
      dist/font/iconfont.eot
  2. 192
      dist/font/iconfont.svg
  3. BIN
      dist/font/iconfont.ttf
  4. BIN
      dist/font/iconfont.woff
  5. BIN
      dist/font/iconfont.woff2
  6. 2
      package.json
  7. 2
      src/base/collection/collection.js
  8. 8
      src/base/combination/group.combo.js
  9. 38
      src/base/combination/loader.js
  10. 5
      src/base/combination/searcher.js
  11. 16
      src/base/pager/pager.js
  12. 8
      src/base/single/input/input.js
  13. 1
      src/case/combo/textvaluecombo/combo.textvaluesmall.js
  14. 14
      src/case/layer/pane.list.js
  15. 26
      src/case/loader/loader.list.js
  16. 2
      src/case/trigger/trigger.editor.js
  17. 1
      src/case/trigger/trigger.text.js
  18. 2
      src/case/trigger/trigger.text.select.js
  19. 1
      src/component/allvaluechooser/combo.allvaluechooser.js
  20. 20
      src/core/2.base.js
  21. 6
      src/core/4.widget.js
  22. 40
      src/core/5.inject.js
  23. 4
      src/core/6.plugin.js
  24. 2
      src/core/controller/controller.layer.js
  25. 2
      src/core/listener/listener.show.js
  26. 29
      src/core/platform/web/dom.js
  27. 15
      src/core/structure/tree.js
  28. 4
      src/core/wrapper/layout/adapt/absolute.leftrightvertical.js
  29. 18
      src/core/wrapper/layout/adapt/adapt.leftrightvertical.js
  30. 4
      src/core/wrapper/layout/fill/float.fill.horizontal.js
  31. 2
      src/core/wrapper/layout/flex/flex.leftrightvertical.center.js
  32. 4
      src/core/wrapper/layout/float/float.absolute.leftrightvertical.js
  33. 2
      src/core/wrapper/layout/layout.border.js
  34. 8
      src/core/wrapper/layout/layout.card.js
  35. 22
      src/core/wrapper/layout/layout.division.js
  36. 8
      src/core/wrapper/layout/layout.grid.js
  37. 4
      src/core/wrapper/layout/layout.tape.js
  38. 20
      src/core/wrapper/layout/layout.window.js
  39. 2
      src/core/wrapper/layout/middle/middle.center.js
  40. 2
      src/core/wrapper/layout/middle/middle.float.center.js
  41. 2
      src/core/wrapper/layout/middle/middle.horizontal.js
  42. 2
      src/core/wrapper/layout/middle/middle.vertical.js
  43. 5
      src/less/base/single/text.less
  44. 9
      src/less/widget/multitree/check/multi.tree.check.pane.less
  45. 38
      src/widget/multiselect/loader.js
  46. 2
      src/widget/multiselectlist/multiselectlist.insert.js
  47. 4
      src/widget/multiselecttree/multiselecttree.js
  48. 2
      src/widget/multitree/check/multi.tree.check.pane.js
  49. 2
      src/widget/singleselect/singleselectlist.insert.js
  50. 2
      src/widget/textvaluedownlistcombo/combo.textvaluedownlist.js
  51. 1
      src/widget/timeinterval/dateinterval.js
  52. 4
      src/widget/yearmonthinterval/yearmonthinterval.js
  53. 2
      webpack/webpack.prod.js

BIN
dist/font/iconfont.eot vendored

Binary file not shown.

192
dist/font/iconfont.svg vendored

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 849 KiB

After

Width:  |  Height:  |  Size: 898 KiB

BIN
dist/font/iconfont.ttf vendored

Binary file not shown.

BIN
dist/font/iconfont.woff vendored

Binary file not shown.

BIN
dist/font/iconfont.woff2 vendored

Binary file not shown.

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "fineui", "name": "fineui",
"version": "2.0.20230314171452", "version": "2.0.20230413101426",
"description": "fineui", "description": "fineui",
"main": "dist/fineui_without_conflict.min.js", "main": "dist/fineui_without_conflict.min.js",
"types": "dist/lib/index.d.ts", "types": "dist/lib/index.d.ts",

2
src/base/collection/collection.js

@ -300,7 +300,7 @@ BI.CollectionView = BI.inherit(BI.Widget, {
var o = this.options; var o = this.options;
// 兼容一下 // 兼容一下
var scrollable = o.scrollable, scrolly = o.scrolly; var scrollable = o.scrollable, scrolly = o.scrolly;
if (o.overflowX === false) { if (o.overflowY === false) {
return false; return false;
} }
if (scrolly) { if (scrolly) {

8
src/base/combination/group.combo.js

@ -22,9 +22,11 @@ BI.ComboGroup = BI.inherit(BI.Widget, {
el: { el: {
type: "bi.button_tree", type: "bi.button_tree",
chooseType: 0, chooseType: 0,
layouts: [{ layouts: [
{
type: "bi.vertical", type: "bi.vertical",
}], }
],
}, },
}, },
}); });
@ -38,7 +40,7 @@ BI.ComboGroup = BI.inherit(BI.Widget, {
var self = this, o = this.options; var self = this, o = this.options;
var children = o.items; var children = o.items;
if (BI.isEmpty(children)) { if (BI.isEmpty(children)) {
throw new Error("ComboGroup构造错误"); throw new Error("ComboGroup create items error");
} }
BI.each(children, function (i, ch) { BI.each(children, function (i, ch) {
var son = BI.formatEL(ch).el.children; var son = BI.formatEL(ch).el.children;

38
src/base/combination/loader.js

@ -38,19 +38,23 @@ BI.Loader = BI.inherit(BI.Widget, {
_prevLoad: function () { _prevLoad: function () {
var self = this, o = this.options; var self = this, o = this.options;
this.prev.setLoading(); this.prev.setLoading();
o.itemsCreator.apply(this, [{ times: --this.times }, function () { o.itemsCreator.apply(this, [
{ times: --this.times }, function () {
self.prev.setLoaded(); self.prev.setLoaded();
self.prependItems.apply(self, arguments); self.prependItems.apply(self, arguments);
}]); }
]);
}, },
_nextLoad: function () { _nextLoad: function () {
var self = this, o = this.options; var self = this, o = this.options;
this.next.setLoading(); this.next.setLoading();
o.itemsCreator.apply(this, [{ times: ++this.times }, function () { o.itemsCreator.apply(this, [
{ times: ++this.times }, function () {
self.next.setLoaded(); self.next.setLoaded();
self.addItems.apply(self, arguments); self.addItems.apply(self, arguments);
}]); }
]);
}, },
render: function () { render: function () {
@ -75,9 +79,11 @@ BI.Loader = BI.inherit(BI.Widget, {
chooseType: 0, chooseType: 0,
items: o.items, items: o.items,
behaviors: {}, behaviors: {},
layouts: [{ layouts: [
{
type: "bi.vertical", type: "bi.vertical",
}], }
],
value: o.value, value: o.value,
}); });
this.button_group.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { this.button_group.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
@ -123,10 +129,12 @@ BI.Loader = BI.inherit(BI.Widget, {
return this.count < o.count; return this.count < o.count;
} }
return !!o.hasPrev.apply(this, [{ return !!o.hasPrev.apply(this, [
{
times: this.times, times: this.times,
count: this.count, count: this.count,
}]); }
]);
}, },
hasNext: function () { hasNext: function () {
@ -135,10 +143,12 @@ BI.Loader = BI.inherit(BI.Widget, {
return this.count < o.count; return this.count < o.count;
} }
return !!o.hasNext.apply(this, [{ return !!o.hasNext.apply(this, [
{
times: this.times, times: this.times,
count: this.count, count: this.count,
}]); }
]);
}, },
prependItems: function (items) { prependItems: function (items) {
@ -170,13 +180,15 @@ BI.Loader = BI.inherit(BI.Widget, {
_populate: function (items) { _populate: function (items) {
var self = this, o = this.options; var self = this, o = this.options;
if (arguments.length === 0 && (BI.isFunction(o.itemsCreator))) { if (arguments.length === 0 && (BI.isFunction(o.itemsCreator))) {
o.itemsCreator.apply(this, [{ times: 1 }, function () { o.itemsCreator.apply(this, [
{ times: 1 }, function () {
if (arguments.length === 0) { if (arguments.length === 0) {
throw new Error("参数不能为空"); throw new Error("Parameter cannot be empty");
} }
self.populate.apply(self, arguments); self.populate.apply(self, arguments);
o.onLoaded(); o.onLoaded();
}]); }
]);
return false; return false;
} }

5
src/base/combination/searcher.js

@ -39,6 +39,8 @@ BI.Searcher = BI.inherit(BI.Widget, {
masker: { // masker层 masker: { // masker层
offset: {}, offset: {},
}, },
simple: false,
}); });
}, },
@ -47,6 +49,7 @@ BI.Searcher = BI.inherit(BI.Widget, {
this.editor = BI.createWidget(o.el, { this.editor = BI.createWidget(o.el, {
type: "bi.search_editor", type: "bi.search_editor",
simple: o.simple,
}); });
BI.createWidget({ BI.createWidget({
@ -230,7 +233,7 @@ BI.Searcher = BI.inherit(BI.Widget, {
this.editor.blur(); this.editor.blur();
} catch (e) { } catch (e) {
if (!this.editor.blur) { if (!this.editor.blur) {
throw new Error("editor没有实现blur方法"); throw new Error("The editor does not implement the blur method ");
} }
} finally { } finally {
this.editor.setValue(""); this.editor.setValue("");

16
src/base/pager/pager.js

@ -10,11 +10,13 @@ BI.Pager = BI.inherit(BI.Widget, {
return BI.extend(BI.Pager.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.Pager.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-pager", baseCls: "bi-pager",
behaviors: {}, behaviors: {},
layouts: [{ layouts: [
{
type: "bi.horizontal", type: "bi.horizontal",
hgap: 10, hgap: 10,
vgap: 0, vgap: 0,
}], }
],
dynamicShow: true, // 是否动态显示上一页、下一页、首页、尾页, 若为false,则指对其设置使能状态 dynamicShow: true, // 是否动态显示上一页、下一页、首页、尾页, 若为false,则指对其设置使能状态
// dynamicShow为false时以下两个有用 // dynamicShow为false时以下两个有用
@ -28,8 +30,8 @@ BI.Pager = BI.inherit(BI.Widget, {
jump: BI.emptyFn, // 分页的回调函数 jump: BI.emptyFn, // 分页的回调函数
first: false, // 是否显示首页 first: false, // 是否显示首页
last: false, // 是否显示尾页 last: false, // 是否显示尾页
prev: "上一页", prev: BI.i18nText("BI-Previous_Page"),
next: "下一页", next: BI.i18nText("BI-Next_Page"),
firstPage: 1, firstPage: 1,
lastPage: function () { // 在万不得已时才会调用这个函数获取最后一页的页码, 主要作用于setValue方法 lastPage: function () { // 在万不得已时才会调用这个函数获取最后一页的页码, 主要作用于setValue方法
@ -217,10 +219,12 @@ BI.Pager = BI.inherit(BI.Widget, {
self.currPage = v; self.currPage = v;
break; break;
} }
o.jump.apply(self, [{ o.jump.apply(self, [
{
pages: pages, pages: pages,
curr: self.currPage, curr: self.currPage,
}]); }
]);
self._populate(); self._populate();
self.fireEvent(BI.Pager.EVENT_CHANGE, obj); self.fireEvent(BI.Pager.EVENT_CHANGE, obj);
} }

8
src/base/single/input/input.js

@ -102,7 +102,7 @@ BI.Input = BI.inherit(BI.Single, {
blur(); blur();
} }
function blur () { function blur() {
if (!self.isValid() && self.options.quitChecker.apply(self, [BI.trim(self.getValue())]) !== false) { if (!self.isValid() && self.options.quitChecker.apply(self, [BI.trim(self.getValue())]) !== false) {
self.element.val(self._lastValidValue ? self._lastValidValue : ""); self.element.val(self._lastValidValue ? self._lastValidValue : "");
self._checkValidationOnValueChange(); self._checkValidationOnValueChange();
@ -236,7 +236,7 @@ BI.Input = BI.inherit(BI.Single, {
focus: function () { focus: function () {
if (!this.element.is(":visible")) { if (!this.element.is(":visible")) {
throw new Error("input输入框在不可见下不能focus"); throw new Error("input cannot be focus when it's invisible");
} }
if (!this._isEditing === true) { if (!this._isEditing === true) {
this.element.focus(); this.element.focus();
@ -246,7 +246,7 @@ BI.Input = BI.inherit(BI.Single, {
blur: function () { blur: function () {
if (!this.element.is(":visible")) { if (!this.element.is(":visible")) {
throw new Error("input输入框在不可见下不能blur"); throw new Error("input cannot be blur when it's invisible");
} }
if (this._isEditing === true) { if (this._isEditing === true) {
this.element.blur(); this.element.blur();
@ -256,7 +256,7 @@ BI.Input = BI.inherit(BI.Single, {
selectAll: function () { selectAll: function () {
if (!this.element.is(":visible")) { if (!this.element.is(":visible")) {
throw new Error("input输入框在不可见下不能select"); throw new Error("input cannot be select when it's invisible");
} }
this.element.select(); this.element.select();
this._isEditing = true; this._isEditing = true;

1
src/case/combo/textvaluecombo/combo.textvaluesmall.js

@ -28,6 +28,7 @@ BI.SmallTextValueCombo = BI.inherit(BI.Widget, {
type: "bi.small_select_text_trigger", type: "bi.small_select_text_trigger",
...o.el ...o.el
}, },
items: o.items,
text: o.text, text: o.text,
value: o.value, value: o.value,
defaultText: o.defaultText, defaultText: o.defaultText,

14
src/case/layer/pane.list.js

@ -60,9 +60,11 @@ BI.ListPane = BI.inherit(BI.Pane, {
}); });
}, },
hasNext: o.hasNext, hasNext: o.hasNext,
layouts: [{ layouts: [
{
type: "bi.vertical" type: "bi.vertical"
}] }
]
}); });
this.button_group.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { this.button_group.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
@ -118,12 +120,14 @@ BI.ListPane = BI.inherit(BI.Pane, {
populate: function (items) { populate: function (items) {
var self = this, o = this.options; var self = this, o = this.options;
if (arguments.length === 0 && (BI.isFunction(this.button_group.attr("itemsCreator")))) {// 接管loader的populate方法 if (arguments.length === 0 && (BI.isFunction(this.button_group.attr("itemsCreator")))) {// 接管loader的populate方法
this.button_group.attr("itemsCreator").apply(this, [{ times: 1 }, function () { this.button_group.attr("itemsCreator").apply(this, [
{ times: 1 }, function () {
if (arguments.length === 0) { if (arguments.length === 0) {
throw new Error("参数不能为空"); throw new Error("Parameter cannot be empty");
} }
self.populate.apply(self, arguments); self.populate.apply(self, arguments);
}]); }
]);
return; return;
} }

26
src/case/loader/loader.list.js

@ -31,10 +31,12 @@ BI.ListLoader = BI.inherit(BI.Widget, {
_nextLoad: function () { _nextLoad: function () {
var self = this, o = this.options; var self = this, o = this.options;
this.next.setLoading(); this.next.setLoading();
o.itemsCreator.apply(this, [{times: ++this.times}, function () { o.itemsCreator.apply(this, [
{ times: ++this.times }, function () {
self.next.setLoaded(); self.next.setLoaded();
self.addItems.apply(self, arguments); self.addItems.apply(self, arguments);
}]); }
]);
}, },
_init: function () { _init: function () {
@ -50,9 +52,11 @@ BI.ListLoader = BI.inherit(BI.Widget, {
chooseType: 0, chooseType: 0,
items: o.items, items: o.items,
behaviors: {}, behaviors: {},
layouts: [{ layouts: [
{
type: "bi.vertical" type: "bi.vertical"
}] }
]
}); });
this.button_group.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { this.button_group.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -91,10 +95,12 @@ BI.ListLoader = BI.inherit(BI.Widget, {
if (BI.isNumber(o.count)) { if (BI.isNumber(o.count)) {
return this.count < o.count; return this.count < o.count;
} }
return !!o.hasNext.apply(this, [{ return !!o.hasNext.apply(this, [
{
times: this.times, times: this.times,
count: this.count count: this.count
}]); }
]);
}, },
addItems: function (items) { addItems: function (items) {
@ -114,13 +120,15 @@ BI.ListLoader = BI.inherit(BI.Widget, {
populate: function (items) { populate: function (items) {
var self = this, o = this.options; var self = this, o = this.options;
if (arguments.length === 0 && (BI.isFunction(o.itemsCreator))) { if (arguments.length === 0 && (BI.isFunction(o.itemsCreator))) {
o.itemsCreator.apply(this, [{times: 1}, function () { o.itemsCreator.apply(this, [
{ times: 1 }, function () {
if (arguments.length === 0) { if (arguments.length === 0) {
throw new Error("参数不能为空"); throw new Error("Parameter cannot be empty");
} }
self.populate.apply(self, arguments); self.populate.apply(self, arguments);
o.onLoaded(); o.onLoaded();
}]); }
]);
return; return;
} }
this.options.items = items; this.options.items = items;

2
src/case/trigger/trigger.editor.js

@ -9,7 +9,7 @@ BI.EditorTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function (config) { _defaultConfig: function (config) {
var conf = BI.EditorTrigger.superclass._defaultConfig.apply(this, arguments); var conf = BI.EditorTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-editor-trigger bi-border-radius " + (config.simple ? "bi-border-bottom" : "bi-border"), baseCls: (conf.baseCls || "") + " bi-editor-trigger " + (config.simple ? "bi-border-bottom" : "bi-border bi-border-radius"),
height: 24, height: 24,
validationChecker: BI.emptyFn, validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn, quitChecker: BI.emptyFn,

1
src/case/trigger/trigger.text.js

@ -40,7 +40,6 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
height: o.height, height: o.height,
text: text || o.defaultText, text: text || o.defaultText,
tipType: o.tipType, tipType: o.tipType,
title: o.title,
warningTitle: o.warningTitle, warningTitle: o.warningTitle,
hgap: o.textHgap, hgap: o.textHgap,
vgap: o.textVgap, vgap: o.textVgap,

2
src/case/trigger/trigger.text.select.js

@ -35,7 +35,7 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, {
textTgap: o.textTgap, textTgap: o.textTgap,
textBgap: o.textBgap, textBgap: o.textBgap,
tipType: o.tipType, tipType: o.tipType,
title: o.title, title: null,
allowClear: o.allowClear, allowClear: o.allowClear,
listeners: [ listeners: [
{ {

1
src/component/allvaluechooser/combo.allvaluechooser.js

@ -34,6 +34,7 @@ BI.AllValueChooserCombo = BI.inherit(BI.AbstractAllValueChooser, {
valueFormatter: BI.bind(this._valueFormatter, this), valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width, width: o.width,
height: o.height, height: o.height,
defaultText: o.defaultText,
value: this._assertValue({ value: this._assertValue({
type: BI.Selection.Multi, type: BI.Selection.Multi,
value: o.value || [] value: o.value || []

20
src/core/2.base.js

@ -61,7 +61,7 @@
createWidgets: function (items, options, context) { createWidgets: function (items, options, context) {
if (!BI.isArray(items)) { if (!BI.isArray(items)) {
throw new Error("items必须是数组", items); throw new Error("items must be array", items);
} }
if (BI.isWidget(options)) { if (BI.isWidget(options)) {
context = options; context = options;
@ -149,8 +149,10 @@
BI._.each(["where", "findWhere", "invoke", "pluck", "shuffle", "sample", "toArray", "size"], function (name) { BI._.each(["where", "findWhere", "invoke", "pluck", "shuffle", "sample", "toArray", "size"], function (name) {
BI[name] = _apply(name); BI[name] = _apply(name);
}); });
BI._.each(["get", "set", "each", "map", "reduce", "reduceRight", "find", "filter", "reject", "every", "all", "some", "any", "max", "min", BI._.each([
"sortBy", "groupBy", "indexBy", "countBy", "partition", "clamp"], function (name) { "get", "set", "each", "map", "reduce", "reduceRight", "find", "filter", "reject", "every", "all", "some", "any", "max", "min",
"sortBy", "groupBy", "indexBy", "countBy", "partition", "clamp"
], function (name) {
if (name === "any") { if (name === "any") {
BI[name] = _applyFunc("some"); BI[name] = _applyFunc("some");
} else { } else {
@ -347,8 +349,10 @@
}); });
// 数组相关的方法 // 数组相关的方法
BI._.each(["first", "initial", "last", "rest", "compact", "flatten", "without", "union", "intersection", BI._.each([
"difference", "zip", "unzip", "object", "indexOf", "lastIndexOf", "sortedIndex", "range", "take", "takeRight", "uniqBy"], function (name) { "first", "initial", "last", "rest", "compact", "flatten", "without", "union", "intersection",
"difference", "zip", "unzip", "object", "indexOf", "lastIndexOf", "sortedIndex", "range", "take", "takeRight", "uniqBy"
], function (name) {
BI[name] = _apply(name); BI[name] = _apply(name);
}); });
BI._.each(["findIndex", "findLastIndex"], function (name) { BI._.each(["findIndex", "findLastIndex"], function (name) {
@ -412,10 +416,12 @@
}); });
// 对象相关方法 // 对象相关方法
BI._.each(["keys", "allKeys", "values", "pairs", "invert", "create", "functions", "extend", "extendOwn", BI._.each([
"keys", "allKeys", "values", "pairs", "invert", "create", "functions", "extend", "extendOwn",
"defaults", "clone", "property", "propertyOf", "matcher", "isEqual", "isMatch", "isEmpty", "defaults", "clone", "property", "propertyOf", "matcher", "isEqual", "isMatch", "isEmpty",
"isElement", "isNumber", "isString", "isArray", "isObject", "isPlainObject", "isArguments", "isFunction", "isFinite", "isElement", "isNumber", "isString", "isArray", "isObject", "isPlainObject", "isArguments", "isFunction", "isFinite",
"isBoolean", "isDate", "isRegExp", "isError", "isNaN", "isUndefined", "zipObject", "cloneDeep"], function (name) { "isBoolean", "isDate", "isRegExp", "isError", "isNaN", "isUndefined", "zipObject", "cloneDeep"
], function (name) {
BI[name] = _apply(name); BI[name] = _apply(name);
}); });
BI._.each(["mapObject", "findKey", "pick", "omit", "tap"], function (name) { BI._.each(["mapObject", "findKey", "pick", "omit", "tap"], function (name) {

6
src/core/4.widget.js

@ -129,7 +129,7 @@
function init() { function init() {
// 加个保险 // 加个保险
if (initCallbackCalled === true) { if (initCallbackCalled === true) {
_global.console && console.error("组件: 请检查beforeInit内部的写法,callback只能执行一次"); _global.console && console.error("widget:please check the beforeInit method. The callback can only be executed once");
return; return;
} }
initCallbackCalled = true; initCallbackCalled = true;
@ -137,7 +137,7 @@
function render() { function render() {
// 加个保险 // 加个保险
if (renderCallbackCalled === true) { if (renderCallbackCalled === true) {
_global.console && console.error("组件: 请检查beforeRender内部的写法,callback只能执行一次"); _global.console && console.error("widget:please check the beforeRender method. The callback can only be executed once");
return; return;
} }
renderCallbackCalled = true; renderCallbackCalled = true;
@ -607,7 +607,7 @@
} }
name = name || widget.getName() || BI.uniqueId("widget"); name = name || widget.getName() || BI.uniqueId("widget");
if (this._children[name]) { if (this._children[name]) {
throw new Error("组件:组件名已存在,不能进行添加"); throw new Error("widget:widget name already exists, cannot be added ");
} }
widget._setParent && widget._setParent(this); widget._setParent && widget._setParent(this);
widget.on(BI.Events.DESTROY, function () { widget.on(BI.Events.DESTROY, function () {

40
src/core/5.inject.js

@ -9,7 +9,7 @@
}; };
BI.module = BI.module || function (xtype, cls) { BI.module = BI.module || function (xtype, cls) {
if (moduleInjection[xtype] != null) { if (moduleInjection[xtype] != null) {
_global.console && console.error("module: [" + xtype + "] 已经注册过了"); _global.console && console.error("module: [" + xtype + "] already registered");
} else { } else {
if (BI.isFunction(cls)) { if (BI.isFunction(cls)) {
cls = cls(); cls = cls();
@ -41,7 +41,7 @@
var constantInjection = {}; var constantInjection = {};
BI.constant = BI.constant || function (xtype, cls) { BI.constant = BI.constant || function (xtype, cls) {
if (constantInjection[xtype] != null) { if (constantInjection[xtype] != null) {
_global.console && console.error("constant: [" + xtype + "]已经注册过了"); _global.console && console.error("constant: [" + xtype + "]already registered");
} else { } else {
constantInjection[xtype] = cls; constantInjection[xtype] = cls;
} }
@ -54,7 +54,7 @@
var modelInjection = {}; var modelInjection = {};
BI.model = BI.model || function (xtype, cls) { BI.model = BI.model || function (xtype, cls) {
if (modelInjection[xtype] != null) { if (modelInjection[xtype] != null) {
_global.console && console.error("model: [" + xtype + "] 已经注册过了"); _global.console && console.error("model: [" + xtype + "] already registered");
} else { } else {
modelInjection[xtype] = cls; modelInjection[xtype] = cls;
} }
@ -67,7 +67,7 @@
var storeInjection = {}; var storeInjection = {};
BI.store = BI.store || function (xtype, cls) { BI.store = BI.store || function (xtype, cls) {
if (storeInjection[xtype] != null) { if (storeInjection[xtype] != null) {
_global.console && console.error("store: [" + xtype + "] 已经注册过了"); _global.console && console.error("store: [" + xtype + "] already registered");
} else { } else {
storeInjection[xtype] = cls; storeInjection[xtype] = cls;
} }
@ -80,7 +80,7 @@
var serviceInjection = {}; var serviceInjection = {};
BI.service = BI.service || function (xtype, cls) { BI.service = BI.service || function (xtype, cls) {
if (serviceInjection[xtype] != null) { if (serviceInjection[xtype] != null) {
_global.console && console.error("service: [" + xtype + "] 已经注册过了"); _global.console && console.error("service: [" + xtype + "] already registered");
} }
serviceInjection[xtype] = cls; serviceInjection[xtype] = cls;
@ -93,7 +93,7 @@
var providerInjection = {}; var providerInjection = {};
BI.provider = BI.provider || function (xtype, cls) { BI.provider = BI.provider || function (xtype, cls) {
if (providerInjection[xtype] != null) { if (providerInjection[xtype] != null) {
_global.console && console.error("provider: [" + xtype + "] 已经注册过了"); _global.console && console.error("provider: [" + xtype + "] already registered");
} else { } else {
providerInjection[xtype] = cls; providerInjection[xtype] = cls;
} }
@ -151,7 +151,7 @@
} }
} }
if (findVersion === true) { if (findVersion === true) {
_global.console && console.error("moduleId: [" + module.moduleId + "] 接口: [" + type + "] 接口版本: [" + version + "] 已过期,版本要求为:", dependencies[module.moduleId], "=>", moduleInjection[module.moduleId]); _global.console && console.error("moduleId: [" + module.moduleId + "] interface : [" + type + "] version: [" + version + "] has expired,The version requirement is:", dependencies[module.moduleId], "=>", moduleInjection[module.moduleId]);
continue; continue;
} }
} }
@ -251,7 +251,7 @@
BI.Modules = BI.Modules || { BI.Modules = BI.Modules || {
getModule: function (type) { getModule: function (type) {
if (!moduleInjection[type]) { if (!moduleInjection[type]) {
_global.console && console.error("module: [" + type + "] 未定义"); _global.console && console.error("module: [" + type + "] undefined");
} }
return moduleInjection[type]; return moduleInjection[type];
}, },
@ -263,7 +263,7 @@
BI.Constants = BI.Constants || { BI.Constants = BI.Constants || {
getConstant: function (type) { getConstant: function (type) {
if (BI.isNull(constantInjection[type])) { if (BI.isNull(constantInjection[type])) {
_global.console && console.error("constant: [" + type + "] 未定义"); _global.console && console.error("constant: [" + type + "] undefined");
} }
runConfigFunction(type); runConfigFunction(type);
return BI.isFunction(constantInjection[type]) ? constantInjection[type]() : constantInjection[type]; return BI.isFunction(constantInjection[type]) ? constantInjection[type]() : constantInjection[type];
@ -311,7 +311,7 @@
BI.Models = BI.Models || { BI.Models = BI.Models || {
getModel: function (type, config) { getModel: function (type, config) {
if (!modelInjection[type]) { if (!modelInjection[type]) {
_global.console && console.error("model: [" + type + "] 未定义"); _global.console && console.error("model: [" + type + "] undefined");
} }
runConfigFunction(type); runConfigFunction(type);
var inst = new modelInjection[type](config); var inst = new modelInjection[type](config);
@ -327,7 +327,7 @@
BI.Stores = BI.Stores || { BI.Stores = BI.Stores || {
getStore: function (type, config) { getStore: function (type, config) {
if (!storeInjection[type]) { if (!storeInjection[type]) {
_global.console && console.error("store: [" + type + "] 未定义"); _global.console && console.error("store: [" + type + "] undefined");
} }
if (stores[type]) { if (stores[type]) {
return stores[type]; return stores[type];
@ -346,7 +346,7 @@
BI.Services = BI.Services || { BI.Services = BI.Services || {
getService: function (type, config) { getService: function (type, config) {
if (!serviceInjection[type]) { if (!serviceInjection[type]) {
_global.console && console.error("service: [" + type + "] 未定义"); _global.console && console.error("service: [" + type + "] undefined");
} }
if (services[type]) { if (services[type]) {
return services[type]; return services[type];
@ -363,7 +363,7 @@
BI.Providers = BI.Providers || { BI.Providers = BI.Providers || {
getProvider: function (type, config) { getProvider: function (type, config) {
if (!providerInjection[type]) { if (!providerInjection[type]) {
_global.console && console.error("provider: [" + type + "] 未定义"); _global.console && console.error("provider: [" + type + "] undefined");
} }
runConfigFunction(type); runConfigFunction(type);
if (!providers[type]) { if (!providers[type]) {
@ -401,7 +401,7 @@
var kv = {}; var kv = {};
BI.shortcut = BI.component = BI.shortcut || function (xtype, cls) { BI.shortcut = BI.component = BI.shortcut || function (xtype, cls) {
if (kv[xtype] != null) { if (kv[xtype] != null) {
_global.console && console.error("组件: [" + xtype + "] 已经注册过了"); _global.console && console.error("widget: [" + xtype + "] already registered");
} }
if (cls) { if (cls) {
cls["xtype"] = xtype; cls["xtype"] = xtype;
@ -414,7 +414,7 @@
var cls = BI.isFunction(config.type) ? config.type : kv[config.type]; var cls = BI.isFunction(config.type) ? config.type : kv[config.type];
if (!cls) { if (!cls) {
throw new Error("组件: [" + config.type + "] 未定义"); throw new Error("widget: [" + config.type + "] undefined");
} }
var pushed = false; var pushed = false;
var widget = new cls(); var widget = new cls();
@ -472,12 +472,14 @@
if (wType === elType) { if (wType === elType) {
if (BI.Plugin.hasObject(elType)) { if (BI.Plugin.hasObject(elType)) {
if (!w.listeners || BI.isArray(w.listeners)) { if (!w.listeners || BI.isArray(w.listeners)) {
w.listeners = (w.listeners || []).concat([{ w.listeners = (w.listeners || []).concat([
{
eventName: BI.Events.MOUNT, eventName: BI.Events.MOUNT,
action: function () { action: function () {
BI.Plugin.getObject(elType, this); BI.Plugin.getObject(elType, this);
} }
}]); }
]);
} else { } else {
w.listeners[BI.Events.MOUNT] = [ w.listeners[BI.Events.MOUNT] = [
function () { function () {
@ -493,7 +495,7 @@
if (BI.isWidget(item.el)) { if (BI.isWidget(item.el)) {
return item.el; return item.el;
} }
throw new Error("组件:无法根据item创建组件", item); throw new Error("widget: Unable to create widget from item ", item);
}; };
BI._lazyCreateWidget = BI._lazyCreateWidget || function (item, options, context) { BI._lazyCreateWidget = BI._lazyCreateWidget || function (item, options, context) {
@ -521,6 +523,6 @@
if (providerInjection[type]) { if (providerInjection[type]) {
return BI.Providers.getProvider(type, config); return BI.Providers.getProvider(type, config);
} }
throw new Error("未知类型: [" + type + "] 未定义"); throw new Error("unknown type: [" + type + "] undefined");
}; };
})(); })();

4
src/core/6.plugin.js

@ -73,7 +73,7 @@ BI.Plugin = BI.Plugin || {};
_WidgetsPlugin[type] = []; _WidgetsPlugin[type] = [];
} }
if (_WidgetsPlugin[type].length > 0) { if (_WidgetsPlugin[type].length > 0) {
console.log("组件已经注册过了!"); console.log("widget already registered!");
} }
_WidgetsPlugin[type].push(fn); _WidgetsPlugin[type].push(fn);
}, },
@ -111,7 +111,7 @@ BI.Plugin = BI.Plugin || {};
_ObjectPlugin[type] = []; _ObjectPlugin[type] = [];
} }
if (_ObjectPlugin[type].length > 0) { if (_ObjectPlugin[type].length > 0) {
console.log("对象已经注册过了!"); console.log("object already registered!");
} }
_ObjectPlugin[type].push(fn); _ObjectPlugin[type].push(fn);
}, },

2
src/core/controller/controller.layer.js

@ -141,7 +141,7 @@ BI.LayerController = BI.inherit(BI.Controller, {
add: function (name, layer, layout) { add: function (name, layer, layout) {
if (this.has(name)) { if (this.has(name)) {
throw new Error("不能创建同名的Layer"); throw new Error("can not create Layers with the same name");
} }
layout.setVisible(false); layout.setVisible(false);
this.layerManager[name] = layer; this.layerManager[name] = layer;

2
src/core/listener/listener.show.js

@ -27,7 +27,7 @@ BI.ShowListener = BI.inherit(BI.OB, {
v = v || o.eventObj.getValue(); v = v || o.eventObj.getValue();
v = BI.isArray(v) ? (v.length > 1 ? v.toString() : v[0]) : v; v = BI.isArray(v) ? (v.length > 1 ? v.toString() : v[0]) : v;
if (BI.isNull(v)) { if (BI.isNull(v)) {
throw new Error("不能为null"); throw new Error("canot be null");
} }
var cardName = o.cardNameCreator(v); var cardName = o.cardNameCreator(v);
if (!o.cardLayout.isCardExisted(cardName)) { if (!o.cardLayout.isCardExisted(cardName)) {

29
src/core/platform/web/dom.js

@ -23,7 +23,7 @@
}); });
var fromChildren = fromElement.children(), toChildren = toElement.children(); var fromChildren = fromElement.children(), toChildren = toElement.children();
if (fromChildren.length !== toChildren.length) { if (fromChildren.length !== toChildren.length) {
throw new Error("不匹配"); throw new Error("don't match");
} }
BI.each(fromChildren, function (i, child) { BI.each(fromChildren, function (i, child) {
BI.DOM.patchProps(BI.jQuery(child), BI.jQuery(toChildren[i])); BI.DOM.patchProps(BI.jQuery(child), BI.jQuery(toChildren[i]));
@ -108,12 +108,13 @@
}, },
// 获取滚动条的宽度,页面display: none时候获取到的为0 // 获取滚动条的宽度,页面display: none时候获取到的为0
getScrollWidth: function () { getScrollWidth: function (css) {
if (BI.isNull(this._scrollWidth) || this._scrollWidth === 0) { if (BI.isNull(this._scrollWidth) || BI.isNotNull(css) || this._scrollWidth === 0) {
var ul = BI.Widget._renderEngine.createElement("<div>").width(50).height(50).css({ var ul = BI.Widget._renderEngine.createElement("<div>").width(50).height(50).css({
position: "absolute", position: "absolute",
top: "-9999px", top: "-9999px",
overflow: "scroll" overflow: "scroll",
...css
}).appendTo("body"); }).appendTo("body");
this._scrollWidth = ul[0].offsetWidth - ul[0].clientWidth; this._scrollWidth = ul[0].offsetWidth - ul[0].clientWidth;
ul.destroy(); ul.destroy();
@ -156,7 +157,7 @@
var popupEl = popup.element; var popupEl = popup.element;
var elRect = el[0].getBoundingClientRect(); var elRect = el[0].getBoundingClientRect();
var popupElRect = popupEl[0].getBoundingClientRect(); var popupElRect = popupEl[0].getBoundingClientRect();
var containerRect = container ? container.getBoundingClientRect() : { left: 0 }; var containerRect = container ? container.getBoundingClientRect() : {left: 0};
return { return {
left: elRect.left - containerRect.left - popupElRect.width - (extraWidth || 0) left: elRect.left - containerRect.left - popupElRect.width - (extraWidth || 0)
@ -172,7 +173,7 @@
getRightPosition: function (combo, popup, extraWidth, container) { getRightPosition: function (combo, popup, extraWidth, container) {
var el = combo.element; var el = combo.element;
var elRect = el[0].getBoundingClientRect(); var elRect = el[0].getBoundingClientRect();
var containerRect = container ? container.getBoundingClientRect() : { left: 0 }; var containerRect = container ? container.getBoundingClientRect() : {left: 0};
return { return {
left: elRect.left + elRect.width - containerRect.left + (extraWidth || 0) left: elRect.left + elRect.width - containerRect.left + (extraWidth || 0)
@ -191,7 +192,7 @@
var popupEl = popup.element; var popupEl = popup.element;
var elRect = el[0].getBoundingClientRect(); var elRect = el[0].getBoundingClientRect();
var popupElRect = popupEl[0].getBoundingClientRect(); var popupElRect = popupEl[0].getBoundingClientRect();
var containerRect = container ? container.getBoundingClientRect() : { top: 0 }; var containerRect = container ? container.getBoundingClientRect() : {top: 0};
return { return {
top: elRect.top - containerRect.top - popupElRect.height - (extraHeight || 0) top: elRect.top - containerRect.top - popupElRect.height - (extraHeight || 0)
@ -201,7 +202,7 @@
getBottomPosition: function (combo, popup, extraHeight, container) { getBottomPosition: function (combo, popup, extraHeight, container) {
var el = combo.element; var el = combo.element;
var elRect = el[0].getBoundingClientRect(); var elRect = el[0].getBoundingClientRect();
var containerRect = container ? container.getBoundingClientRect() : { top: 0 }; var containerRect = container ? container.getBoundingClientRect() : {top: 0};
return { return {
top: elRect.top - containerRect.top + elRect.height + (extraHeight || 0) top: elRect.top - containerRect.top + elRect.height + (extraHeight || 0)
@ -254,7 +255,7 @@
var comboRect = combo.element[0].getBoundingClientRect(), var comboRect = combo.element[0].getBoundingClientRect(),
popupRect = popup.element[0].getBoundingClientRect(), popupRect = popup.element[0].getBoundingClientRect(),
viewportRect = document.documentElement.getBoundingClientRect(), viewportRect = document.documentElement.getBoundingClientRect(),
containerRect = container ? container.getBoundingClientRect() : { left: 0 }; containerRect = container ? container.getBoundingClientRect() : {left: 0};
var left = comboRect.left - containerRect.left + extraWidth; var left = comboRect.left - containerRect.left + extraWidth;
if (comboRect.left + popupRect.width > viewportRect.width) { if (comboRect.left + popupRect.width > viewportRect.width) {
@ -267,7 +268,7 @@
var left = this._getLeftAlignPosition(combo, popup, extraWidth, container); var left = this._getLeftAlignPosition(combo, popup, extraWidth, container);
var dir = ""; var dir = "";
// 如果放不下,优先使用RightAlign, 如果RightAlign也放不下, 再使用left=0 // 如果放不下,优先使用RightAlign, 如果RightAlign也放不下, 再使用left=0
var containerRect = container ? container.getBoundingClientRect() : { left: 0 }; var containerRect = container ? container.getBoundingClientRect() : {left: 0};
if (left + containerRect.left < 0) { if (left + containerRect.left < 0) {
left = this._getRightAlignPosition(combo, popup, extraWidth); left = this._getRightAlignPosition(combo, popup, extraWidth);
dir = "left"; dir = "left";
@ -293,7 +294,7 @@
_getRightAlignPosition: function (combo, popup, extraWidth, container) { _getRightAlignPosition: function (combo, popup, extraWidth, container) {
var comboBounds = combo.element[0].getBoundingClientRect(), var comboBounds = combo.element[0].getBoundingClientRect(),
viewBounds = popup.element[0].getBoundingClientRect(), viewBounds = popup.element[0].getBoundingClientRect(),
containerRect = container ? container.getBoundingClientRect() : { left: 0 }; containerRect = container ? container.getBoundingClientRect() : {left: 0};
return comboBounds.left + comboBounds.width - viewBounds.width - extraWidth - containerRect.left; return comboBounds.left + comboBounds.width - viewBounds.width - extraWidth - containerRect.left;
}, },
@ -327,7 +328,7 @@
var comboBounds = combo.element[0].getBoundingClientRect(), var comboBounds = combo.element[0].getBoundingClientRect(),
popupBounds = popup.element[0].getBoundingClientRect(), popupBounds = popup.element[0].getBoundingClientRect(),
viewportBounds = document.documentElement.getBoundingClientRect(), viewportBounds = document.documentElement.getBoundingClientRect(),
containerBounds = container ? container.getBoundingClientRect() : { top: 0 }; containerBounds = container ? container.getBoundingClientRect() : {top: 0};
var top, adaptHeight, dir; var top, adaptHeight, dir;
if (BI.DOM.isBottomSpaceEnough(combo, popup, -1 * comboBounds.height + extraHeight)) { if (BI.DOM.isBottomSpaceEnough(combo, popup, -1 * comboBounds.height + extraHeight)) {
top = comboBounds.top - containerBounds.top + extraHeight; top = comboBounds.top - containerBounds.top + extraHeight;
@ -386,7 +387,7 @@
var comboBounds = combo.element[0].getBoundingClientRect(), var comboBounds = combo.element[0].getBoundingClientRect(),
popupBounds = popup.element[0].getBoundingClientRect(), popupBounds = popup.element[0].getBoundingClientRect(),
windowBounds = BI.Widget._renderEngine.createElement("body").bounds(), windowBounds = BI.Widget._renderEngine.createElement("body").bounds(),
containerBounds = container ? container.getBoundingClientRect() : { top: 0 }; containerBounds = container ? container.getBoundingClientRect() : {top: 0};
var top, adaptHeight, dir; var top, adaptHeight, dir;
if (BI.DOM.isTopSpaceEnough(combo, popup, -1 * comboBounds.height + extraHeight)) { if (BI.DOM.isTopSpaceEnough(combo, popup, -1 * comboBounds.height + extraHeight)) {
top = comboBounds.top + comboBounds.height - containerBounds.top - popupBounds.height; top = comboBounds.top + comboBounds.height - containerBounds.top - popupBounds.height;
@ -746,7 +747,7 @@
*/ */
getPositionRelativeContainingBlockRect: function (element) { getPositionRelativeContainingBlockRect: function (element) {
const positionRelativeElement = BI.DOM.getPositionRelativeContainingBlock(element); const positionRelativeElement = BI.DOM.getPositionRelativeContainingBlock(element);
const { top, right, bottom, left, width, height, x, y } = positionRelativeElement.getBoundingClientRect(); const {top, right, bottom, left, width, height, x, y} = positionRelativeElement.getBoundingClientRect();
return { return {

15
src/core/structure/tree.js

@ -30,23 +30,26 @@
initTree: function (nodes) { initTree: function (nodes) {
var self = this; var self = this;
this.clear(); this.clear();
var queue = []; var queue = new Set();
BI.each(nodes, function (i, node) { BI.each(nodes, function (i, node) {
var n = new BI.Node(node); var n = new BI.Node(node);
n.set("data", node); n.set("data", node);
self.addNode(n); self.addNode(n);
queue.push(n); queue.add(n);
}); });
while (!BI.isEmpty(queue)) {
var parent = queue.shift(); queue.forEach(parent => {
queue.delete(parent);
var node = parent.get("data"); var node = parent.get("data");
BI.each(node.children, function (i, child) { BI.each(node.children, function (i, child) {
var n = new BI.Node(child); var n = new BI.Node(child);
n.set("data", child); n.set("data", child);
queue.push(n); queue.add(n);
self.addNode(parent, n); self.addNode(parent, n);
}); });
} });
}, },
_toJSON: function (node) { _toJSON: function (node) {

4
src/core/wrapper/layout/adapt/absolute.leftrightvertical.js

@ -98,7 +98,7 @@ BI.AbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
addItem: function () { addItem: function () {
// do nothing // do nothing
throw new Error("不能添加子组件"); throw new Error("Cannot add subwidget");
}, },
populate: function (items) { populate: function (items) {
@ -149,7 +149,7 @@ BI.AbsoluteRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
addItem: function () { addItem: function () {
// do nothing // do nothing
throw new Error("不能添加子组件"); throw new Error("Cannot add subwidget");
}, },
populate: function (items) { populate: function (items) {

18
src/core/wrapper/layout/adapt/adapt.leftrightvertical.js

@ -36,7 +36,8 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
type: "bi.left", type: "bi.left",
lgap: o.innerHgap, lgap: o.innerHgap,
vgap: o.innerVgap, vgap: o.innerVgap,
items: [{ items: [
{
el: { el: {
type: "bi.vertical_adapt", type: "bi.vertical_adapt",
ref: function (_ref) { ref: function (_ref) {
@ -51,7 +52,8 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
bgap: o.lbgap, bgap: o.lbgap,
vgap: o.lvgap vgap: o.lvgap
} }
}] }
]
}); });
} }
if (leftRight.right || "right" in o.items) { if (leftRight.right || "right" in o.items) {
@ -59,7 +61,8 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
type: "bi.right", type: "bi.right",
rgap: o.innerHgap, rgap: o.innerHgap,
vgap: o.innerVgap, vgap: o.innerVgap,
items: [{ items: [
{
el: { el: {
type: "bi.vertical_adapt", type: "bi.vertical_adapt",
ref: function (_ref) { ref: function (_ref) {
@ -74,7 +77,8 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
bgap: o.rbgap, bgap: o.rbgap,
vgap: o.rvgap vgap: o.rvgap
} }
}] }
]
}); });
} }
return layoutArray; return layoutArray;
@ -106,7 +110,7 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
addItem: function () { addItem: function () {
// do nothing // do nothing
throw new Error("不能添加子组件"); throw new Error("Cannot add subwidget");
}, },
populate: function (items) { populate: function (items) {
@ -162,7 +166,7 @@ BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, {
addItem: function () { addItem: function () {
// do nothing // do nothing
throw new Error("不能添加子组件"); throw new Error("Cannot add subwidget");
}, },
populate: function (items) { populate: function (items) {
@ -216,7 +220,7 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, {
addItem: function () { addItem: function () {
// do nothing // do nothing
throw new Error("不能添加子组件"); throw new Error("Cannot add subwidget");
}, },
populate: function (items) { populate: function (items) {

4
src/core/wrapper/layout/fill/float.fill.horizontal.js

@ -25,7 +25,7 @@ BI.FloatHorizontalFillLayout = BI.inherit(BI.Layout, {
addItem: function (item) { addItem: function (item) {
// do nothing // do nothing
throw new Error("不能添加子组件"); throw new Error("Cannot add subwidget");
}, },
stroke: function (items) { stroke: function (items) {
@ -33,7 +33,7 @@ BI.FloatHorizontalFillLayout = BI.inherit(BI.Layout, {
items = BI.compact(items); items = BI.compact(items);
var rank = 0; var rank = 0;
function createWidget (i, item, desc) { function createWidget(i, item, desc) {
if (o.verticalAlign !== BI.VerticalAlign.Stretch) { if (o.verticalAlign !== BI.VerticalAlign.Stretch) {
var w = BI._lazyCreateWidget({ var w = BI._lazyCreateWidget({
type: "bi.vertical_adapt", type: "bi.vertical_adapt",

2
src/core/wrapper/layout/flex/flex.leftrightvertical.center.js

@ -94,7 +94,7 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
addItem: function () { addItem: function () {
// do nothing // do nothing
throw new Error("不能添加子组件"); throw new Error("Cannot add subwidget");
}, },
populate: function (items) { populate: function (items) {

4
src/core/wrapper/layout/float/float.absolute.leftrightvertical.js

@ -115,7 +115,7 @@ BI.FloatAbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
addItem: function () { addItem: function () {
// do nothing // do nothing
throw new Error("不能添加子组件"); throw new Error("Cannot add subwidget");
}, },
populate: function (items) { populate: function (items) {
@ -179,7 +179,7 @@ BI.FloatAbsoluteRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
addItem: function () { addItem: function () {
// do nothing // do nothing
throw new Error("不能添加子组件"); throw new Error("Cannot add subwidget");
}, },
populate: function (items) { populate: function (items) {

2
src/core/wrapper/layout/layout.border.js

@ -22,7 +22,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
addItem: function (item) { addItem: function (item) {
// do nothing // do nothing
throw new Error("不能添加子组件"); throw new Error("Cannot add subwidget");
}, },
stroke: function (regions) { stroke: function (regions) {

8
src/core/wrapper/layout/layout.card.js

@ -81,7 +81,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
getCardByName: function (cardName) { getCardByName: function (cardName) {
if (!this.isCardExisted(cardName)) { if (!this.isCardExisted(cardName)) {
throw new Error("cardName不存在", cardName); throw new Error("cardName not exist", cardName);
} }
return this._children[this._getChildName(cardName)]; return this._children[this._getChildName(cardName)];
}, },
@ -98,7 +98,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
deleteCardByName: function (cardName) { deleteCardByName: function (cardName) {
if (!this.isCardExisted(cardName)) { if (!this.isCardExisted(cardName)) {
throw new Error("cardName不存在", cardName); throw new Error("cardName not exist", cardName);
} }
var child = this._children[this._getChildName(cardName)]; var child = this._children[this._getChildName(cardName)];
@ -108,7 +108,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
addCardByName: function (cardName, cardItem) { addCardByName: function (cardName, cardItem) {
if (this.isCardExisted(cardName)) { if (this.isCardExisted(cardName)) {
throw new Error("cardName 已存在", cardName); throw new Error("cardName already exist", cardName);
} }
var widget = BI._lazyCreateWidget(cardItem, this); var widget = BI._lazyCreateWidget(cardItem, this);
widget.element.css({ widget.element.css({
@ -120,7 +120,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
}).appendTo(this.element); }).appendTo(this.element);
widget.invisible(); widget.invisible();
this.addWidget(this._getChildName(cardName), widget); this.addWidget(this._getChildName(cardName), widget);
this.options.items.push({el: cardItem, cardName: cardName}); this.options.items.push({ el: cardItem, cardName: cardName });
return widget; return widget;
}, },

22
src/core/wrapper/layout/layout.division.js

@ -24,7 +24,7 @@ BI.DivisionLayout = BI.inherit(BI.Layout, {
addItem: function (item) { addItem: function (item) {
// do nothing // do nothing
throw new Error("不能添加子组件"); throw new Error("Cannot add subwidget");
}, },
stroke: function (items) { stroke: function (items) {
@ -32,19 +32,19 @@ BI.DivisionLayout = BI.inherit(BI.Layout, {
var rows = o.rows || o.items.length, columns = o.columns || ((o.items[0] && o.items[0].length) | 0); var rows = o.rows || o.items.length, columns = o.columns || ((o.items[0] && o.items[0].length) | 0);
var map = BI.makeArray(rows), widths = {}, heights = {}; var map = BI.makeArray(rows), widths = {}, heights = {};
function firstElement (item, cls) { function firstElement(item, cls) {
item.addClass(cls); item.addClass(cls);
return item; return item;
} }
function firstObject (item, cls) { function firstObject(item, cls) {
item.cls = (item.cls || "") + cls; item.cls = (item.cls || "") + cls;
return item; return item;
} }
function first (item, cls) { function first(item, cls) {
if (item instanceof BI.Widget) { if (item instanceof BI.Widget) {
firstElement(item.element, cls); firstElement(item.element, cls);
} else if (item.el instanceof BI.Widget) { } else if (item.el instanceof BI.Widget) {
@ -77,7 +77,7 @@ BI.DivisionLayout = BI.inherit(BI.Layout, {
var totalW = 0; var totalW = 0;
for (var j = 0; j < columns; j++) { for (var j = 0; j < columns; j++) {
if (!map[i][j]) { if (!map[i][j]) {
throw new Error("item(" + i + "" + j + ") 必须", map); throw new Error("item(" + i + "" + j + ") must exist", map);
} }
if (!this.hasWidget(this._getChildName(i + "_" + j))) { if (!this.hasWidget(this._getChildName(i + "_" + j))) {
var w = BI._lazyCreateWidget(map[i][j]); var w = BI._lazyCreateWidget(map[i][j]);
@ -86,13 +86,13 @@ BI.DivisionLayout = BI.inherit(BI.Layout, {
w = this.getWidgetByName(this._getChildName(i + "_" + j)); w = this.getWidgetByName(this._getChildName(i + "_" + j));
} }
var left = totalW * 100 / widths[i]; var left = totalW * 100 / widths[i];
w.element.css({position: "absolute", left: left + "%"}); w.element.css({ position: "absolute", left: left + "%" });
if (j > 0) { if (j > 0) {
var lastW = this.getWidgetByName(this._getChildName(i + "_" + (j - 1))); var lastW = this.getWidgetByName(this._getChildName(i + "_" + (j - 1)));
lastW.element.css({right: (100 - left) + "%"}); lastW.element.css({ right: (100 - left) + "%" });
} }
if (j == o.columns - 1) { if (j == o.columns - 1) {
w.element.css({right: "0%"}); w.element.css({ right: "0%" });
} }
first(w, self.getRowColumnCls(i, j, rows - 1, columns - 1)); first(w, self.getRowColumnCls(i, j, rows - 1, columns - 1));
totalW += map[i][j].width; totalW += map[i][j].width;
@ -103,13 +103,13 @@ BI.DivisionLayout = BI.inherit(BI.Layout, {
for (var i = 0; i < o.rows; i++) { for (var i = 0; i < o.rows; i++) {
var w = this.getWidgetByName(this._getChildName(i + "_" + j)); var w = this.getWidgetByName(this._getChildName(i + "_" + j));
var top = totalH * 100 / heights[j]; var top = totalH * 100 / heights[j];
w.element.css({top: top + "%"}); w.element.css({ top: top + "%" });
if (i > 0) { if (i > 0) {
var lastW = this.getWidgetByName(this._getChildName((i - 1) + "_" + j)); var lastW = this.getWidgetByName(this._getChildName((i - 1) + "_" + j));
lastW.element.css({bottom: (100 - top) + "%"}); lastW.element.css({ bottom: (100 - top) + "%" });
} }
if (i == o.rows - 1) { if (i == o.rows - 1) {
w.element.css({bottom: "0%"}); w.element.css({ bottom: "0%" });
} }
totalH += map[i][j].height; totalH += map[i][j].height;
} }

8
src/core/wrapper/layout/layout.grid.js

@ -24,7 +24,7 @@ BI.GridLayout = BI.inherit(BI.Layout, {
addItem: function () { addItem: function () {
// do nothing // do nothing
throw new Error("不能添加子组件"); throw new Error("Cannot add subwidget");
}, },
stroke: function (items) { stroke: function (items) {
@ -36,19 +36,19 @@ BI.GridLayout = BI.inherit(BI.Layout, {
els[i] = []; els[i] = [];
} }
function firstElement (item, cls) { function firstElement(item, cls) {
item.addClass(cls); item.addClass(cls);
return item; return item;
} }
function firstObject (item, cls) { function firstObject(item, cls) {
item.cls = (item.cls || "") + cls; item.cls = (item.cls || "") + cls;
return item; return item;
} }
function first (item, row, col) { function first(item, row, col) {
if (item instanceof BI.Widget) { if (item instanceof BI.Widget) {
firstElement(item.element, row, col); firstElement(item.element, row, col);
} else if (item.el instanceof BI.Widget) { } else if (item.el instanceof BI.Widget) {

4
src/core/wrapper/layout/layout.tape.js

@ -29,7 +29,7 @@ BI.HTapeLayout = BI.inherit(BI.Layout, {
addItem: function (item) { addItem: function (item) {
// do nothing // do nothing
throw new Error("不能添加子组件"); throw new Error("Cannot add subwidget");
}, },
stroke: function (items) { stroke: function (items) {
@ -154,7 +154,7 @@ BI.VTapeLayout = BI.inherit(BI.Layout, {
addItem: function (item) { addItem: function (item) {
// do nothing // do nothing
throw new Error("不能添加子组件"); throw new Error("Cannot add subwidget");
}, },
stroke: function (items) { stroke: function (items) {

20
src/core/wrapper/layout/layout.window.js

@ -31,7 +31,7 @@ BI.WindowLayout = BI.inherit(BI.Layout, {
addItem: function (item) { addItem: function (item) {
// do nothing // do nothing
throw new Error("不能添加子组件"); throw new Error("Cannot add subwidget");
}, },
stroke: function (items) { stroke: function (items) {
@ -43,19 +43,19 @@ BI.WindowLayout = BI.inherit(BI.Layout, {
o.columnSize = BI.makeArray(o.items[0].length, 1 / o.items[0].length); o.columnSize = BI.makeArray(o.items[0].length, 1 / o.items[0].length);
} }
function firstElement (item, cls) { function firstElement(item, cls) {
item.addClass(cls); item.addClass(cls);
return item; return item;
} }
function firstObject (item, cls) { function firstObject(item, cls) {
item.cls = (item.cls || "") + cls; item.cls = (item.cls || "") + cls;
return item; return item;
} }
function first (item, row, col) { function first(item, row, col) {
if (item instanceof BI.Widget) { if (item instanceof BI.Widget) {
firstElement(item.element, row, col); firstElement(item.element, row, col);
} else if (item.el instanceof BI.Widget) { } else if (item.el instanceof BI.Widget) {
@ -70,11 +70,11 @@ BI.WindowLayout = BI.inherit(BI.Layout, {
for (var i = 0; i < o.rows; i++) { for (var i = 0; i < o.rows; i++) {
for (var j = 0; j < o.columns; j++) { for (var j = 0; j < o.columns; j++) {
if (!o.items[i][j]) { if (!o.items[i][j]) {
throw new Error("构造错误", o.items); throw new Error("create items error", o.items);
} }
if (!this.hasWidget(this._getChildName(i + "_" + j))) { if (!this.hasWidget(this._getChildName(i + "_" + j))) {
var w = BI._lazyCreateWidget(o.items[i][j]); var w = BI._lazyCreateWidget(o.items[i][j]);
w.element.css({position: "absolute"}); w.element.css({ position: "absolute" });
this.addWidget(this._getChildName(i + "_" + j), w); this.addWidget(this._getChildName(i + "_" + j), w);
} }
} }
@ -95,7 +95,7 @@ BI.WindowLayout = BI.inherit(BI.Layout, {
if (BI.isNumber(o.rowSize[i])) { if (BI.isNumber(o.rowSize[i])) {
h = this._optimiseGap(o.rowSize[i]); h = this._optimiseGap(o.rowSize[i]);
} }
wi.element.css({top: t, height: h}); wi.element.css({ top: t, height: h });
first(wi, self.getRowColumnCls(i, j, o.rows - 1, o.columns - 1)); first(wi, self.getRowColumnCls(i, j, o.rows - 1, o.columns - 1));
} }
if (!BI.isNumber(o.rowSize[i])) { if (!BI.isNumber(o.rowSize[i])) {
@ -113,7 +113,7 @@ BI.WindowLayout = BI.inherit(BI.Layout, {
if (BI.isNumber(o.rowSize[i])) { if (BI.isNumber(o.rowSize[i])) {
h = this._optimiseGap(o.rowSize[i]); h = this._optimiseGap(o.rowSize[i]);
} }
wi.element.css({bottom: b, height: h}); wi.element.css({ bottom: b, height: h });
first(wi, self.getRowColumnCls(i, j, o.rows - 1, o.columns - 1)); first(wi, self.getRowColumnCls(i, j, o.rows - 1, o.columns - 1));
} }
if (!BI.isNumber(o.rowSize[i])) { if (!BI.isNumber(o.rowSize[i])) {
@ -131,7 +131,7 @@ BI.WindowLayout = BI.inherit(BI.Layout, {
if (BI.isNumber(o.columnSize[j])) { if (BI.isNumber(o.columnSize[j])) {
w = this._optimiseGap(o.columnSize[j]); w = this._optimiseGap(o.columnSize[j]);
} }
wi.element.css({left: l, width: w}); wi.element.css({ left: l, width: w });
first(wi, self.getRowColumnCls(i, j, o.rows - 1, o.columns - 1)); first(wi, self.getRowColumnCls(i, j, o.rows - 1, o.columns - 1));
} }
if (!BI.isNumber(o.columnSize[j])) { if (!BI.isNumber(o.columnSize[j])) {
@ -149,7 +149,7 @@ BI.WindowLayout = BI.inherit(BI.Layout, {
if (BI.isNumber(o.columnSize[j])) { if (BI.isNumber(o.columnSize[j])) {
w = this._optimiseGap(o.columnSize[j]); w = this._optimiseGap(o.columnSize[j]);
} }
wi.element.css({right: r, width: w}); wi.element.css({ right: r, width: w });
first(wi, self.getRowColumnCls(i, j, o.rows - 1, o.columns - 1)); first(wi, self.getRowColumnCls(i, j, o.rows - 1, o.columns - 1));
} }
if (!BI.isNumber(o.columnSize[j])) { if (!BI.isNumber(o.columnSize[j])) {

2
src/core/wrapper/layout/middle/middle.center.js

@ -62,7 +62,7 @@ BI.CenterLayout = BI.inherit(BI.Layout, {
addItem: function (item) { addItem: function (item) {
// do nothing // do nothing
throw new Error("不能添加子组件"); throw new Error("Cannot add subwidget");
}, },
populate: function (items) { populate: function (items) {

2
src/core/wrapper/layout/middle/middle.float.center.js

@ -61,7 +61,7 @@ BI.FloatCenterLayout = BI.inherit(BI.Layout, {
addItem: function (item) { addItem: function (item) {
// do nothing // do nothing
throw new Error("不能添加子组件"); throw new Error("Cannot add subwidget");
}, },
populate: function (items) { populate: function (items) {

2
src/core/wrapper/layout/middle/middle.horizontal.js

@ -60,7 +60,7 @@ BI.HorizontalCenterLayout = BI.inherit(BI.Layout, {
addItem: function (item) { addItem: function (item) {
// do nothing // do nothing
throw new Error("不能添加子组件"); throw new Error("Cannot add subwidget");
}, },
populate: function (items) { populate: function (items) {

2
src/core/wrapper/layout/middle/middle.vertical.js

@ -61,7 +61,7 @@ BI.VerticalCenterLayout = BI.inherit(BI.Layout, {
addItem: function (item) { addItem: function (item) {
// do nothing // do nothing
throw new Error("不能添加子组件"); throw new Error("Cannot add subwidget");
}, },
populate: function (items) { populate: function (items) {

5
src/less/base/single/text.less

@ -3,5 +3,8 @@
.bi-text { .bi-text {
.overflow-hidden(); .overflow-hidden();
.box-sizing(border-box); .box-sizing(border-box);
word-break: break-all;
// https://developer.mozilla.org/en-US/docs/Web/CSS/word-break 参考mdn最标准的规范. 不再接受任何质疑
word-break: normal;
overflow-wrap: anywhere;
} }

9
src/less/widget/multitree/check/multi.tree.check.pane.less

@ -1,9 +0,0 @@
@import "../../../index.less";
.bi-multi-tree-check-pane {
& .multi-tree-continue-select {
}
& .multi-tree-check-selected {
color: @color-bi-text-multi-tree-check-pane-check-button;
}
}

38
src/widget/multiselect/loader.js

@ -26,9 +26,11 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, {
return true; return true;
} }
}, },
layouts: [{ layouts: [
{
type: "bi.vertical" type: "bi.vertical"
}] }
]
}, },
items: [], items: [],
@ -53,10 +55,12 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, {
this.cachItems = this.cachItems.slice(100); this.cachItems = this.cachItems.slice(100);
return; return;
} }
o.itemsCreator.apply(this, [{times: ++this.times}, function () { o.itemsCreator.apply(this, [
{ times: ++this.times }, function () {
self.next.setLoaded(); self.next.setLoaded();
self.addItems.apply(self, arguments); self.addItems.apply(self, arguments);
}]); }
]);
}, },
render: function () { render: function () {
@ -69,9 +73,11 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, {
chooseType: 0, chooseType: 0,
items: o.items, items: o.items,
behaviors: {}, behaviors: {},
layouts: [{ layouts: [
{
type: "bi.vertical" type: "bi.vertical"
}], }
],
value: o.value value: o.value
}); });
this.button_group.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { this.button_group.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
@ -95,9 +101,11 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, {
chooseType: 0, chooseType: 0,
items: o.items, items: o.items,
behaviors: {}, behaviors: {},
layouts: [{ layouts: [
{
type: "bi.vertical" type: "bi.vertical"
}], }
],
value: o.value value: o.value
}); });
BI.Widget.registerRenderEngine(renderEngine); BI.Widget.registerRenderEngine(renderEngine);
@ -132,10 +140,12 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, {
if (this.cachItems && this.cachItems.length > 0) { if (this.cachItems && this.cachItems.length > 0) {
return true; return true;
} }
return !!o.hasNext.apply(this, [{ return !!o.hasNext.apply(this, [
{
times: this.times, times: this.times,
count: this.count count: this.count
}]); }
]);
}, },
addItems: function (items) { addItems: function (items) {
@ -158,13 +168,15 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, {
_populate: function (items) { _populate: function (items) {
var self = this, o = this.options; var self = this, o = this.options;
if (arguments.length === 0 && (BI.isFunction(o.itemsCreator))) { if (arguments.length === 0 && (BI.isFunction(o.itemsCreator))) {
o.itemsCreator.apply(this, [{times: 1}, function (items, keyword) { o.itemsCreator.apply(this, [
{ times: 1 }, function (items, keyword) {
if (arguments.length === 0) { if (arguments.length === 0) {
throw new Error("参数不能为空"); throw new Error("Parameter cannot be empty");
} }
self.populate.apply(self, arguments); self.populate.apply(self, arguments);
o.onLoaded(); o.onLoaded();
}]); }
]);
return false; return false;
} }
this.options.items = (items || []).slice(0, 100 + (items || []).length % 100); this.options.items = (items || []).slice(0, 100 + (items || []).length % 100);

2
src/widget/multiselectlist/multiselectlist.insert.js

@ -9,6 +9,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
valueFormatter: BI.emptyFn, valueFormatter: BI.emptyFn,
searcherHeight: BI.SIZE_CONSANTS.TRIGGER_HEIGHT, searcherHeight: BI.SIZE_CONSANTS.TRIGGER_HEIGHT,
itemHeight: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, itemHeight: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT,
simple: false,
}); });
}, },
_init: function () { _init: function () {
@ -70,6 +71,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
el: { el: {
type: "bi.search_editor", type: "bi.search_editor",
watermark: BI.i18nText("BI-Basic_Search_And_Patch_Paste"), watermark: BI.i18nText("BI-Basic_Search_And_Patch_Paste"),
simple: o.simple,
}, },
ref: function (ref) { ref: function (ref) {
self.editor = ref; self.editor = ref;

4
src/widget/multiselecttree/multiselecttree.js

@ -9,7 +9,8 @@ BI.MultiSelectTree = BI.inherit(BI.Single, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.MultiSelectTree.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.MultiSelectTree.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-tree", baseCls: "bi-multi-select-tree",
itemsCreator: BI.emptyFn itemsCreator: BI.emptyFn,
simple: false,
}); });
}, },
@ -51,6 +52,7 @@ BI.MultiSelectTree = BI.inherit(BI.Single, {
type: "bi.searcher", type: "bi.searcher",
isAutoSearch: false, isAutoSearch: false,
isAutoSync: false, isAutoSync: false,
simple: o.simple,
onSearch: function (op, callback) { onSearch: function (op, callback) {
callback({ callback({
keyword: self.searcher.getKeyword() keyword: self.searcher.getKeyword()

2
src/widget/multitree/check/multi.tree.check.pane.js

@ -32,7 +32,7 @@ BI.MultiTreeCheckPane = BI.inherit(BI.Pane, {
type: "bi.text_button", type: "bi.text_button",
title: BI.i18nText("BI-Continue_Select"), title: BI.i18nText("BI-Continue_Select"),
text: BI.i18nText("BI-Continue_Select"), text: BI.i18nText("BI-Continue_Select"),
cls: "multi-tree-check-selected" cls: "bi-high-light",
}); });
continueSelect.on(BI.TextButton.EVENT_CHANGE, function () { continueSelect.on(BI.TextButton.EVENT_CHANGE, function () {
opts.onClickContinueSelect(); opts.onClickContinueSelect();

2
src/widget/singleselect/singleselectlist.insert.js

@ -12,6 +12,7 @@ BI.SingleSelectInsertList = BI.inherit(BI.Single, {
itemWrapper: BI.emptyFn, itemWrapper: BI.emptyFn,
valueFormatter: BI.emptyFn, valueFormatter: BI.emptyFn,
searcherHeight: 24, searcherHeight: 24,
simple: false,
}); });
}, },
_init: function () { _init: function () {
@ -70,6 +71,7 @@ BI.SingleSelectInsertList = BI.inherit(BI.Single, {
el: { el: {
type: "bi.search_editor", type: "bi.search_editor",
watermark: BI.i18nText("BI-Basic_Search_And_Patch_Paste"), watermark: BI.i18nText("BI-Basic_Search_And_Patch_Paste"),
simple: o.simple,
}, },
ref: function (ref) { ref: function (ref) {
self.editor = ref; self.editor = ref;

2
src/widget/textvaluedownlistcombo/combo.textvaluedownlist.js

@ -5,7 +5,7 @@
BI.TextValueDownListCombo = BI.inherit(BI.Widget, { BI.TextValueDownListCombo = BI.inherit(BI.Widget, {
_defaultConfig: function (config) { _defaultConfig: function (config) {
return BI.extend(BI.TextValueDownListCombo.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.TextValueDownListCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-text-value-down-list-combo bi-border-radius " + (config.simple ? "bi-border-bottom" : "bi-border"), baseCls: "bi-text-value-down-list-combo " + (config.simple ? "bi-border-bottom" : "bi-border bi-border-radius"),
height: 24, height: 24,
}); });
}, },

1
src/widget/timeinterval/dateinterval.js

@ -17,6 +17,7 @@ BI.DateInterval = BI.inherit(BI.Single, {
maxDate: "2099-12-31", maxDate: "2099-12-31",
height: 24, height: 24,
supportDynamic: true, supportDynamic: true,
simple: false,
}); });
}, },

4
src/widget/yearmonthinterval/yearmonthinterval.js

@ -11,7 +11,8 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
minDate: "1900-01-01", minDate: "1900-01-01",
maxDate: "2099-12-31", maxDate: "2099-12-31",
supportDynamic: true, supportDynamic: true,
height: 24 height: 24,
simple: false,
}, },
render: function () { render: function () {
@ -45,6 +46,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
var self = this, o = this.options; var self = this, o = this.options;
var combo = BI.createWidget({ var combo = BI.createWidget({
type: "bi.dynamic_year_month_combo", type: "bi.dynamic_year_month_combo",
simple: o.simple,
supportDynamic: o.supportDynamic, supportDynamic: o.supportDynamic,
height: o.height, height: o.height,
minDate: o.minDate, minDate: o.minDate,

2
webpack/webpack.prod.js

@ -72,7 +72,7 @@ module.exports = merge.smart(common, {
} }
}), }),
new webpack.BannerPlugin({ new webpack.BannerPlugin({
banner: `time: ${new Date().toLocaleString()}; branch: ${git( banner: `time: ${new Date().toLocaleString("en-US")}; branch: ${git(
'name-rev --name-only HEAD' 'name-rev --name-only HEAD'
)} commit: ${git( )} commit: ${git(
'rev-parse HEAD' 'rev-parse HEAD'

Loading…
Cancel
Save