Browse Source

Merge remote-tracking branch 'origin/master' into bugfix

es6
iapyang 4 years ago
parent
commit
76c6cf6818
  1. 8
      changelog.md
  2. 8
      demo/js/config/widget.js
  3. 51
      demo/js/widget/yearinterval/demo.year_interval.js
  4. 52
      demo/js/widget/yearquarterinterval/demo.yearquarterinterval.js
  5. 4
      dist/2.0/fineui.css
  6. 4
      dist/2.0/fineui.ie.min.js
  7. 2
      dist/2.0/fineui.ie.min.js.map
  8. 5980
      dist/2.0/fineui.js
  9. 2
      dist/2.0/fineui.js.map
  10. 4
      dist/2.0/fineui.min.css
  11. 4
      dist/2.0/fineui.min.js
  12. 2
      dist/2.0/fineui.min.js.map
  13. 4
      dist/2.0/fineui_without_normalize.css
  14. 4
      dist/2.0/fineui_without_normalize.min.css
  15. 4
      dist/core.css
  16. 5939
      dist/core.js
  17. 2
      dist/core.js.map
  18. 4
      dist/demo.css
  19. 6449
      dist/demo.js
  20. 2
      dist/demo.js.map
  21. 4
      dist/fineui.css
  22. 4
      dist/fineui.ie.min.js
  23. 2
      dist/fineui.ie.min.js.map
  24. 5989
      dist/fineui.js
  25. 2
      dist/fineui.js.map
  26. 4
      dist/fineui.min.css
  27. 4
      dist/fineui.min.js
  28. 2
      dist/fineui.min.js.map
  29. 4609
      dist/fineui_without_jquery_polyfill.js
  30. 2
      dist/fineui_without_jquery_polyfill.js.map
  31. 155
      dist/fix/fix.js
  32. 4
      dist/font.css
  33. BIN
      dist/font/iconfont.eot
  34. 35
      dist/font/iconfont.svg
  35. BIN
      dist/font/iconfont.ttf
  36. BIN
      dist/font/iconfont.woff
  37. BIN
      dist/font/iconfont.woff2
  38. 4
      dist/lib/base/combination/tab.d.ts
  39. 1
      dist/lib/base/pane.d.ts
  40. 14
      dist/lib/base/single/button/buttons/button.image.d.ts
  41. 10
      dist/lib/base/single/button/node/textnode.d.ts
  42. 8
      dist/lib/case/combo/textvaluecheckcombo/popup.textvaluecheck.d.ts
  43. 1
      dist/lib/core/utils/events/wheelhandler.d.ts
  44. 4
      dist/lib/core/utils/tree.d.ts
  45. 11
      dist/lib/index.d.ts
  46. 18
      dist/lib/widget/date/calendar/popup.calendar.date.d.ts
  47. 2
      dist/lib/widget/editor/editor.search.d.ts
  48. 4
      dist/resource.css
  49. 7
      dist/resource.js
  50. 98
      dist/utils.js
  51. 2
      dist/utils.js.map
  52. 4
      dist/utils.min.js
  53. 2
      dist/utils.min.js.map
  54. 7
      i18n/i18n.cn.js
  55. 2
      package.json
  56. 4
      src/base/collection/collection.js
  57. 4
      src/base/grid/grid.js
  58. 32
      src/base/layer/layer.popup.js
  59. 4
      src/base/pane.js
  60. 4
      src/base/single/button/buttons/button.icon.js
  61. 8
      src/base/single/button/buttons/button.js
  62. 7
      src/base/single/editor/editor.textarea.js
  63. 14
      src/base/single/html/html.js
  64. 20
      src/base/single/label/abstract.label.js
  65. 4
      src/base/single/label/icon.label.js
  66. 3
      src/base/single/single.js
  67. 17
      src/base/single/text.js
  68. 4
      src/base/single/tip/tip.toast.js
  69. 8
      src/case/button/item.singleselect.radio.js
  70. 13
      src/case/colorchooser/colorchooser.js
  71. 4
      src/case/colorchooser/colorchooser.trigger.js
  72. 4
      src/case/colorchooser/colorchooser.trigger.long.js
  73. 2
      src/case/combo/bubblecombo/combo.bubble.js
  74. 9
      src/case/combo/icontextvaluecombo/combo.icontextvalue.js
  75. 4
      src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js
  76. 2
      src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js
  77. 9
      src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js
  78. 9
      src/case/combo/textvaluecombo/combo.textvalue.js
  79. 2
      src/case/linersegment/linear.segment.js
  80. 4
      src/case/list/list.select.js
  81. 3
      src/case/trigger/trigger.icon.text.select.js
  82. 3
      src/case/trigger/trigger.text.select.js
  83. 7
      src/core/base.js
  84. 6
      src/core/controller/controller.popover.js
  85. 6
      src/core/controller/controller.resizer.js
  86. 6
      src/core/controller/controller.tooltips.js
  87. 1
      src/core/func/date.js
  88. 68
      src/core/platform/web/config.js
  89. 83
      src/core/platform/web/dom.js
  90. 5
      src/core/shortcut.js
  91. 4
      src/core/var.js
  92. 31
      src/core/widget.js
  93. 8
      src/core/wrapper/layout.js
  94. 12
      src/core/wrapper/layout/adapt/absolute.center.js
  95. 12
      src/core/wrapper/layout/adapt/absolute.horizontal.js
  96. 16
      src/core/wrapper/layout/adapt/absolute.vertical.js
  97. 2
      src/core/wrapper/layout/adapt/adapt.center.js
  98. 2
      src/core/wrapper/layout/adapt/adapt.horizontal.js
  99. 95
      src/core/wrapper/layout/adapt/adapt.leftrightvertical.js
  100. 14
      src/core/wrapper/layout/adapt/adapt.table.js
  101. Some files were not shown because too many files have changed in this diff Show More

8
changelog.md

@ -1,4 +1,12 @@
# 更新日志
2.0(2021-01)
- 修改了日期下拉面板中的当前时间按钮的交互效果
- 新增年区间和年季度区间控件
- 日期类型控件不操作下拉面板收起不发Confirm事件
- 日期类型控件全系列可设置是否显示动态日期
- 日期类型控件全系列可设置最大最小日期
- 调整了combo的popup显示位置计算逻辑
2.0(2020-12)
- multi_layer_down_list_combo支持无限层级
- 新增不带全选的同步复选下拉框

8
demo/js/config/widget.js

@ -174,6 +174,14 @@ Demo.WIDGET_CONFIG = [{
pId: 412,
text: "bi.year_month_interval",
value: "demo.year_month_interval"
}, {
pId: 412,
text: "bi.year_quarter_interval",
value: "demo.year_quarter_interval"
}, {
pId: 412,
text: "bi.year_interval",
value: "demo.year_interval"
}, {
pId: 4,
id: 413,

51
demo/js/widget/yearinterval/demo.year_interval.js

@ -0,0 +1,51 @@
/**
* @author windy
* @version 2.0
* Created by windy on 2021/1/25
*/
Demo.YearInterval = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var self = this;
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.year_interval",
ref: function (_ref) {
self.widget = _ref;
},
width: 300,
minDate: "2012-01-01",
maxDate: "2013-12-31",
value: {
type: 1,
value: {
year: 2012
}
}
}, {
type: "bi.button",
text: "getValue",
handler: function () {
BI.Msg.toast(JSON.stringify(self.widget.getValue()));
},
width: 300
}, {
type: "bi.button",
text: "setValue '2017-12'",
width: 300,
handler: function () {
self.widget.setValue({
year: 2017
});
}
}],
vgap: 20
};
}
});
BI.shortcut("demo.year_interval", Demo.YearInterval);

52
demo/js/widget/yearquarterinterval/demo.yearquarterinterval.js

@ -0,0 +1,52 @@
/**
* @author windy
* @version 2.0
* Created by windy on 2021/1/25
*/
Demo.YearQuarterInterval = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var self = this;
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.year_quarter_interval",
ref: function (_ref) {
self.interval = _ref;
},
minDate: "2012-07-01",
maxDate: "2012-12-31",
value: {
start: {
type: 2,
value: {
year: -1,
month: 1
}
},
end: {
type: 1,
value: {
year: 2018,
month: 1
}
}
},
width: 400
}, {
type: "bi.button",
text: "getValue",
handler: function () {
BI.Msg.toast(JSON.stringify(self.interval.getValue()));
},
width: 300
}],
vgap: 20
};
}
});
BI.shortcut("demo.year_quarter_interval", Demo.YearQuarterInterval);

4
dist/2.0/fineui.css vendored

File diff suppressed because one or more lines are too long

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

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui.ie.min.js.map vendored

File diff suppressed because one or more lines are too long

5980
dist/2.0/fineui.js vendored

File diff suppressed because it is too large Load Diff

2
dist/2.0/fineui.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/2.0/fineui.min.css vendored

File diff suppressed because one or more lines are too long

4
dist/2.0/fineui.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui.min.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/2.0/fineui_without_normalize.css vendored

File diff suppressed because one or more lines are too long

4
dist/2.0/fineui_without_normalize.min.css vendored

File diff suppressed because one or more lines are too long

4
dist/core.css vendored

File diff suppressed because one or more lines are too long

5939
dist/core.js vendored

File diff suppressed because it is too large Load Diff

2
dist/core.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/demo.css vendored

File diff suppressed because one or more lines are too long

6449
dist/demo.js vendored

File diff suppressed because it is too large Load Diff

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.css vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.ie.min.js.map vendored

File diff suppressed because one or more lines are too long

5989
dist/fineui.js vendored

File diff suppressed because it is too large Load Diff

2
dist/fineui.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.min.css vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.min.js.map vendored

File diff suppressed because one or more lines are too long

4609
dist/fineui_without_jquery_polyfill.js vendored

File diff suppressed because it is too large Load Diff

2
dist/fineui_without_jquery_polyfill.js.map vendored

File diff suppressed because one or more lines are too long

155
dist/fix/fix.js vendored

@ -134,8 +134,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
setImmediate(nextTickHandler);
};
} else if (typeof MessageChannel !== 'undefined' && (isNative(MessageChannel) ||
// PhantomJS
MessageChannel.toString() === '[object MessageChannelConstructor]')) {
// PhantomJS
MessageChannel.toString() === '[object MessageChannelConstructor]')) {
var channel = new MessageChannel();
var port = channel.port2;
channel.port1.onmessage = nextTickHandler;
@ -144,18 +144,18 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
};
} else
/* istanbul ignore next */
if (typeof Promise !== 'undefined' && isNative(Promise)) {
// use microtask in non-DOM environments, e.g. Weex
var p = Promise.resolve();
timerFunc = function timerFunc() {
p.then(nextTickHandler);
};
} else {
// fallback to setTimeout
timerFunc = function timerFunc() {
setTimeout(nextTickHandler, 0);
};
}
if (typeof Promise !== 'undefined' && isNative(Promise)) {
// use microtask in non-DOM environments, e.g. Weex
var p = Promise.resolve();
timerFunc = function timerFunc() {
p.then(nextTickHandler);
};
} else {
// fallback to setTimeout
timerFunc = function timerFunc() {
setTimeout(nextTickHandler, 0);
};
}
return function queueNextTick(cb, ctx) {
var _resolve = void 0;
@ -294,7 +294,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
if (isIE9Below) {
var VBClassPool = {};
window.execScript([// jshint ignore:line
'Function parseVB(code)', '\tExecuteGlobal(code)', 'End Function' //转换一段文本为VB代码
'Function parseVB(code)', '\tExecuteGlobal(code)', 'End Function' //转换一段文本为VB代码
].join('\n'), 'VBScript');
var VBMediator = function VBMediator(instance, accessors, name, value) {
@ -310,7 +310,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
// jshint ignore:line
var buffer = [];
buffer.push('\tPrivate [$vbsetter]', '\tPublic [$accessors]', '\tPublic Default Function [$vbthis](ac' + timeBucket + ', s' + timeBucket + ')', '\t\tSet [$accessors] = ac' + timeBucket + ': set [$vbsetter] = s' + timeBucket, '\t\tSet [$vbthis] = Me', //链式调用
'\tEnd Function');
'\tEnd Function');
//添加普通属性,因为VBScript对象不能像JS那样随意增删属性,必须在这里预先定义好
var uniq = {
$vbthis: true,
@ -323,19 +323,19 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
uniq[name] = true;
}
}
//添加访问器属性
//添加访问器属性
for (name in accessors) {
if (uniq[name]) {
continue;
}
uniq[name] = true;
buffer.push(
//由于不知对方会传入什么,因此set, let都用上
'\tPublic Property Let [' + name + '](val' + timeBucket + ')', //setter
'\t\tCall [$vbsetter](Me, [$accessors], "' + name + '", val' + timeBucket + ')', '\tEnd Property', '\tPublic Property Set [' + name + '](val' + timeBucket + ')', //setter
'\t\tCall [$vbsetter](Me, [$accessors], "' + name + '", val' + timeBucket + ')', '\tEnd Property', '\tPublic Property Get [' + name + ']', //getter
'\tOn Error Resume Next', //必须优先使用set语句,否则它会误将数组当字符串返回
'\t\tSet[' + name + '] = [$vbsetter](Me, [$accessors],"' + name + '")', '\tIf Err.Number <> 0 Then', '\t\t[' + name + '] = [$vbsetter](Me, [$accessors],"' + name + '")', '\tEnd If', '\tOn Error Goto 0', '\tEnd Property');
//由于不知对方会传入什么,因此set, let都用上
'\tPublic Property Let [' + name + '](val' + timeBucket + ')', //setter
'\t\tCall [$vbsetter](Me, [$accessors], "' + name + '", val' + timeBucket + ')', '\tEnd Property', '\tPublic Property Set [' + name + '](val' + timeBucket + ')', //setter
'\t\tCall [$vbsetter](Me, [$accessors], "' + name + '", val' + timeBucket + ')', '\tEnd Property', '\tPublic Property Get [' + name + ']', //getter
'\tOn Error Resume Next', //必须优先使用set语句,否则它会误将数组当字符串返回
'\t\tSet[' + name + '] = [$vbsetter](Me, [$accessors],"' + name + '")', '\tIf Err.Number <> 0 Then', '\t\t[' + name + '] = [$vbsetter](Me, [$accessors],"' + name + '")', '\tEnd If', '\tOn Error Goto 0', '\tEnd Property');
}
for (name in properties) {
@ -353,7 +353,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
className = makeHashCode('VBClass');
window.parseVB('Class ' + className + body);
window.parseVB(['Function ' + className + 'Factory(acc, vbm)', //创建实例并传入两个关键的参数
'\tDim o', '\tSet o = (New ' + className + ')(acc, vbm)', '\tSet ' + className + 'Factory = o', 'End Function'].join('\r\n'));
'\tDim o', '\tSet o = (New ' + className + ')(acc, vbm)', '\tSet ' + className + 'Factory = o', 'End Function'].join('\r\n'));
VBClassPool[body] = className;
}
var ret = window[className + 'Factory'](accessors, VBMediator); //得到其产品
@ -537,10 +537,10 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
if (this.active) {
var value = this.get();
if (value !== this.value ||
// Deep watchers and watchers on Object/Arrays should fire even
// when the value is the same, because the value may
// have mutated.
_.isObject(value) && options && options.refresh || this.deep) {
// Deep watchers and watchers on Object/Arrays should fire even
// when the value is the same, because the value may
// have mutated.
_.isObject(value) && options && options.refresh || this.deep) {
// set new value
var oldValue = this.value;
this.value = value;
@ -630,8 +630,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
_.each(['push', 'pop', 'shift', 'unshift', 'splice', 'sort', 'reverse'], function (method) {
var original = arrayProto[method];
arrayMethods[method] = function mutator() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
for (var _len = arguments.length, args = Array(_len), _key2 = 0; _key2 < _len; _key2++) {
args[_key2] = arguments[_key2];
}
var ob = this.__ob__;
@ -773,10 +773,12 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
root = parent;
parent = parent.parent;
}
for (var _key2 in root._globalDeps) {
var reg = new RegExp(_key2);
for (var _key in root._globalDeps) {
var reg = new RegExp(_key);
if (reg.test(route)) {
root._globalDeps[_key2].notify({ observer: observer, key: _key2 });
for (var i = 0; i < root._globalDeps[_key].length; i++) {
root._globalDeps[_key][i].notify({ observer: observer, key: _key });
}
}
}
}
@ -958,7 +960,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
}
function routeToRegExp(route) {
route = route.replace(/\*./g, '[a-zA-Z0-9_]+.');
route = route.replace(/\*\*/g, '[a-zA-Z0-9_]+').replace(/\*./g, '[a-zA-Z0-9_]+.');
return '^' + route + '$';
}
@ -1047,21 +1049,12 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
});
return;
}
if (/\*\*$|\*$/.test(exp)) {
throw new Error('not support');
}
//其他含有*的情况,如*.a,*.*.a,a.*.a
if (/\*/.test(exp)) {
var currentModel = model;
// **.a.**的情况,场景:a.b.c, 如果用b.**监听, a被重新赋值b上的_scopeDes就不存在了
if (/^(\*\*\.)+[1-9a-zA-Z]+(\.\*\*$)/.test(exp)) {
//先获取到能获取到的对象
var paths = exp.split(".");
for (var _i = 0, len = paths.length; _i < len; _i++) {
if (paths[_i] === "*") {
break;
}
currentModel = model[paths[_i]];
}
exp = exp.substr(exp.indexOf("*"));
var currentModel = model[paths[1]];
exp = paths[1] + ".**";
//补全路径
var parent = currentModel.__ob__.parent,
root = currentModel.__ob__;
@ -1073,7 +1066,11 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var regStr = routeToRegExp(exp);
var _dep = new Dep();
root._globalDeps || (root._globalDeps = {});
root._globalDeps[regStr] = _dep;
if (_.isArray(root._globalDeps[regStr])) {
root._globalDeps[regStr].push(_dep);
} else {
root._globalDeps[regStr] = [_dep];
}
var _w = new Watcher(currentModel, function () {
_dep.depend();
@ -1082,8 +1079,64 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
callback(i, newValue, oldValue, _.extend({ index: i }, attrs));
}, options);
watchers.push(function unwatchFn() {
_w.teardown();
root._globalDeps && delete root._globalDeps[regStr];
if (root._globalDeps) {
remove(root._globalDeps[regStr], _dep);
if (root._globalDeps[regStr].length === 0) {
delete root._globalDeps[regStr];
_w.teardown();
}
}
});
return;
}
if (/\*\*$|\*$/.test(exp)) {
throw new Error('not support');
}
//其他含有*的情况,如*.a,*.*.a,a.*.a
if (/\*/.test(exp)) {
var _currentModel = model;
//先获取到能获取到的对象
var _paths = exp.split(".");
for (var _i = 0, len = _paths.length; _i < len; _i++) {
if (_paths[_i] === "*") {
break;
}
_currentModel = model[_paths[_i]];
}
exp = exp.substr(exp.indexOf("*"));
//补全路径
var _parent = _currentModel.__ob__.parent,
_root = _currentModel.__ob__;
while (_parent) {
exp = '*.' + exp;
_root = _parent;
_parent = _parent.parent;
}
var _regStr = routeToRegExp(exp);
var _dep2 = new Dep();
_root._globalDeps || (_root._globalDeps = {});
if (_.isArray(_root._globalDeps[_regStr])) {
_root._globalDeps[_regStr].push(_dep2);
} else {
_root._globalDeps[_regStr] = [_dep2];
}
var _w2 = new Watcher(_currentModel, function () {
_dep2.depend();
return NaN;
}, function (newValue, oldValue, attrs) {
callback(i, newValue, oldValue, _.extend({ index: i }, attrs));
}, options);
watchers.push(function unwatchFn() {
if (_root._globalDeps) {
remove(_root._globalDeps[_regStr], _dep2);
if (_root._globalDeps[_regStr].length === 0) {
delete _root._globalDeps[_regStr];
_w2.teardown();
}
}
});
return;
}
@ -1470,4 +1523,4 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
exports.toJSON = toJSON;
exports.__esModule = true;
});
});

4
dist/font.css vendored

File diff suppressed because one or more lines are too long

BIN
dist/font/iconfont.eot vendored

Binary file not shown.

35
dist/font/iconfont.svg vendored

@ -20,6 +20,36 @@ Created by iconfont
/>
<missing-glyph />
<glyph glyph-name="beizhu" unicode="&#59199;" d="M777.152 818.816c65.344 0 118.848-53.504 118.848-118.848V454.4l-2.816-4.8a32.832 32.832 0 0 0-56.384 4.352l-0.192 0.448V699.968c0 35.648-23.808 59.392-59.52 59.392H182.912c-35.648 0-59.392-23.744-59.392-59.392v-475.456c0-35.648 23.744-59.456 59.392-59.456h54.848c11.904 0 29.76-5.888 41.6-17.792l77.248-71.296v29.696c0 17.792 5.952 29.696 17.856 41.6a53.952 53.952 0 0 0 41.6 17.792h143.872a42.88 42.88 0 0 0 3.84-3.392l3.072-3.648a37.504 37.504 0 0 0-7.744-52.48l0.064 0.192-143.104-0.064v-83.2c0-23.808-17.856-35.648-35.648-35.648-5.952 0-11.904 0-17.856 5.952l-124.8 112.896h-54.848A119.232 119.232 0 0 0 64 224.512V699.968c0 65.344 53.504 118.848 118.848 118.848z m-218.176-416v-59.392H272c-15.872 0-27.008 9.344-29.312 23.936l-0.384 5.76c0 17.792 11.84 29.696 29.696 29.696h286.976z m129.024 178.24c17.856 0 29.696-11.84 29.696-29.696 0-17.792-11.84-29.696-29.696-29.696h-416c-17.856 0-29.696 11.904-29.696 29.696 0 17.856 11.84 29.696 29.696 29.696zM880.256 405.504l52.416-36.672a64 64 0 0 0 15.744-89.152l-208-297.088a64 64 0 0 0-32.576-24.064l-91.2-29.888a32 32 0 0 0-41.984 29.376l-3.072 95.936a64 64 0 0 0 11.52 38.784l208 297.088a64 64 0 0 0 89.152 15.68z m-36.736-52.416l-208-297.088 1.728-53.248 50.688 16.576L896 316.416l-52.416 36.672z" horiz-adv-x="1024" />
<glyph glyph-name="normal123" unicode="&#59463;" d="M99.456 305.216c0-11.52 5.696-22.144 14.976-27.904 9.216-5.76 20.608-5.76 29.824 0a32.832 32.832 0 0 1 14.976 27.904 32.64 32.64 0 0 1-14.976 27.84 27.968 27.968 0 0 1-29.824 0 32.64 32.64 0 0 1-14.976-27.84z m0 138.624c0-11.52 5.696-22.08 14.976-27.84 9.216-5.76 20.608-5.76 29.824 0a32.832 32.832 0 0 1 14.976 27.84 32.64 32.64 0 0 1-14.976 27.904 27.968 27.968 0 0 1-29.824 0 32.64 32.64 0 0 1-14.976-27.904z m55.488-266.88v-80.896c0-35.392 26.688-64.192 59.52-64.192h593.6c32.768 0 59.52 28.8 59.52 64.192V673.152c0 35.392-26.752 64.192-59.52 64.192l-593.536-1.728c-32.768 0-59.52-28.8-59.52-64.192v-80.192c0-17.728-13.312-32.128-29.824-32.128s-29.824 14.4-29.824 32.128l0.064 2.432V671.296c0 70.912 53.184 128.32 118.848 128.32l594.24 1.664c65.536 0 118.72-57.536 118.72-128.32v-575.36c0-70.912-53.12-128.32-118.848-128.32H214.208c-65.664 0-118.848 57.408-118.848 128.32v77.056c-0.128 0.832-0.128 1.6-0.128 2.432 0 17.664 13.376 32 29.888 32s29.824-14.336 29.824-32.064z m416.192 22.912a28.352 28.352 0 0 1 42.176 0l125.76 135.68 0.832 0.832 0.768 0.704a33.472 33.472 0 0 1 0 44.8L614.4 518.208a27.84 27.84 0 0 1-41.6 0l-0.64-0.704a33.472 33.472 0 0 1 0-44.8l76.16-82.176H302.848c-16.128 0-29.312-14.208-29.312-31.616 0-17.344 13.184-31.552 29.312-31.552h344.32l-75.84-82.048a33.92 33.92 0 0 1-0.192-45.44z" horiz-adv-x="1024" />
<glyph glyph-name="normal122" unicode="&#59462;" d="M446.976 801.28l118.336-131.392H825.6c74.24 0 134.4-58.816 134.4-131.328v-175.168h-64v62.592H128v-330.048c0-32 26.688-57.856 59.584-57.856L576 38.144v-68.864H198.4c-74.24 0-134.4 58.816-134.4 131.392V801.28h382.976z m334.976-497.408l4.992-3.968 136-132.992 0.512-0.512a30.912 30.912 0 0 0-0.32-44.032L787.2-10.496a32 32 0 0 0-44.8 0l-0.192 0.256a30.912 30.912 0 0 0-0.512 43.776l0.512 0.512 81.024 79.232H607.296a31.296 31.296 0 1 0 0 62.528h216.128l-81.472 79.68-0.256 0.192a31.04 31.04 0 0 0-3.392 39.744l3.648 4.288 0.256 0.256a32 32 0 0 0 39.744 3.968z m-373.12 434.88H128v-250.24h768V545.92c0 31.936-26.688 57.792-59.584 57.792H531.2l-122.368 135.04z" horiz-adv-x="1024" />
<glyph glyph-name="bupaixu" unicode="&#59461;" d="M750.4 63.04a32 32 0 0 0 32-32v-10.624a32 32 0 0 0-32-32H533.568a32 32 0 0 0-32 32v10.624a32 32 0 0 0 32 32h216.832z m-493.44 654.08a25.6 25.6 0 0 0 0.512-0.576l137.472-141.632a25.6 25.6 0 0 0-18.432-43.392H277.568v-318.4h98.944a25.6 25.6 0 0 0 14.016-4.224l3.84-3.072a25.6 25.6 0 0 0 0.576-36.16l-137.472-141.696a25.6 25.6 0 0 0-36.736 0L83.2 169.664a25.6 25.6 0 0 0 18.368 43.392h101.312V531.584H101.632a25.6 25.6 0 0 0-18.368 43.392L220.8 716.544a25.6 25.6 0 0 0 36.16 0.576z m655.36-430.144a32 32 0 0 0 32-32v-10.624a32 32 0 0 0-32-32H533.632a32 32 0 0 0-32 32v10.624a32 32 0 0 0 32 32h378.816z m-161.152 223.872a32 32 0 0 0 32-32v-10.624a32 32 0 0 0-32-32h-217.6a32 32 0 0 0-32 32v10.624a32 32 0 0 0 32 32h217.6z m166.208 223.936a32 32 0 0 0 32-32v-10.624a32 32 0 0 0-32-32H533.568a32 32 0 0 0-32 32V702.72a32 32 0 0 0 32 32h383.808z" horiz-adv-x="1024" />
<glyph glyph-name="anleixingpaixu" unicode="&#59460;" d="M370.368 333.632v-54.592h-114.56v-278.656h-62.208V279.04h-106.88v54.592h283.648zM627.072 76.8a32 32 0 0 0 32-32v-10.88a32 32 0 0 0-32-32H510.272a32 32 0 0 0-32 32v10.88a32 32 0 0 0 32 32h116.8z m60.288 217.216a32 32 0 0 0 32-32v-10.88a32 32 0 0 0-32-32H510.272a32 32 0 0 0-32 32v10.88a32 32 0 0 0 32 32h177.088zM250.88 755.52l-15.872-57.92h102.656l14.912 57.92h52.928l-13.952-57.92h56.768v-43.584h-63.744l-26.88-109.888h76.672v-46.08H351.68l-15.936-68.288H282.88l15.936 68.224H192.192l-17.92-68.224h-54.784l17.92 68.224h-50.624v46.08h57.6l29.888 109.952H103.68V697.6h76.544l15.936 57.92h54.784z m556.992-244.416a32 32 0 0 0 32-32v-10.88a32 32 0 0 0-32-32h-297.6a32 32 0 0 0-32 32v10.88a32 32 0 0 0 32 32h297.6zM332.672 654.08H230.016l-30.848-109.888h105.6l27.904 109.888z m595.712 74.24a32 32 0 0 0 32-32v-10.88a32 32 0 0 0-32-32H510.272a32 32 0 0 0-32 32v10.88a32 32 0 0 0 32 32h418.112z" horiz-adv-x="1024" />
<glyph glyph-name="ziduanshezhi" unicode="&#59459;" d="M992 768a32 32 0 0 0 32-32v-704a32 32 0 0 0-32-32H32a32 32 0 0 0-32 32v704A32 32 0 0 0 32 768h960zM960 704H64v-640h896V704zM576 603.776h64v-137.024h153.472c51.84 0 92.8-42.56 92.8-93.888v-123.52c0-51.264-40.96-93.824-92.8-93.824H668.8c-51.84 0-92.8 42.56-92.8 93.888V603.776z m-199.872-4.928c28.672-9.6 51.2-32.064 60.672-60.8l127.488-382.336H496.96l-42.752 128.064H237.312l-42.56-127.872H127.296l127.36 382.208a96 96 0 0 0 121.472 60.736zM640 249.408c0-16.512 12.864-29.888 28.8-29.888h124.672c15.936 0 28.8 13.44 28.8 29.888V372.864a29.376 29.376 0 0 1-28.8 29.824H668.8a29.376 29.376 0 0 1-28.8-29.824v-123.52zM315.392 517.888l-56.704-170.112h174.144l-56.704 170.112a32 32 0 0 1-60.736 0z" horiz-adv-x="1024" />
<glyph glyph-name="biaogetuozhuai-shubiaoxuanfu" unicode="&#59458;" d="M512 588.8a102.4 102.4 0 1 0-204.8 0 102.4 102.4 0 0 0 204.8 0z m0-409.6a102.4 102.4 0 1 0-204.8 0 102.4 102.4 0 0 0 204.8 0z m409.6 409.6a102.4 102.4 0 1 0-204.8 0 102.4 102.4 0 0 0 204.8 0z m0-409.6a102.4 102.4 0 1 0-204.8 0 102.4 102.4 0 0 0 204.8 0z m409.6 409.6a102.4 102.4 0 1 0-204.8 0 102.4 102.4 0 0 0 204.8 0z m0-409.6a102.4 102.4 0 1 0-204.8 0 102.4 102.4 0 0 0 204.8 0z m409.6 409.6a102.4 102.4 0 1 0-204.8 0 102.4 102.4 0 0 0 204.8 0z m0-409.6a102.4 102.4 0 1 0-204.8 0 102.4 102.4 0 0 0 204.8 0z m409.6 409.6a102.4 102.4 0 1 0-204.8 0 102.4 102.4 0 0 0 204.8 0z m0-409.6a102.4 102.4 0 1 0-204.8 0 102.4 102.4 0 0 0 204.8 0z" horiz-adv-x="2457" />
<glyph glyph-name="xianshileixing" unicode="&#59455;" d="M896 768a64 64 0 0 0 64-64v-640a64 64 0 0 0-64-64H128a64 64 0 0 0-64 64V704a64 64 0 0 0 64 64h768z m0-64H128v-640h768V704z m-96-320v-224H576v64h160V384h64z m-384 256v-64H256v-160H192V640h224z" horiz-adv-x="1024" />
<glyph glyph-name="tupiansuoxiao" unicode="&#59456;" d="M472.192 832a388.928 388.928 0 0 0 388.928-388.992c0-99.2-37.952-194.56-106.24-266.56l174.08-174.08a38.976 38.976 0 0 0-55.04-55.04l-177.92 177.92a386.56 386.56 0 0 0-223.808-71.168A388.928 388.928 0 1 0 472.192 832z m0-77.76a311.168 311.168 0 1 1 0-622.4 311.168 311.168 0 0 1 0 622.4zM665.6 473.6a32 32 0 1 0 0-64h-384a32 32 0 0 0 0 64h384z" horiz-adv-x="1024" />
<glyph glyph-name="tupianfangda" unicode="&#59457;" d="M472.192 832a388.928 388.928 0 0 0 388.928-388.992c0-99.2-37.952-194.56-106.24-266.56l174.08-174.08a38.976 38.976 0 0 0-55.04-55.04l-177.92 177.92a386.56 386.56 0 0 0-223.808-71.168A388.928 388.928 0 1 0 472.192 832z m0-77.76a311.168 311.168 0 1 1 0-622.4 311.168 311.168 0 0 1 0 622.4zM473.6 665.6a32 32 0 0 0 32-32v-160h160a32 32 0 1 0 0-64H505.6v-160a32 32 0 1 0-64 0V409.6H281.6a32 32 0 0 0 0 64h160V633.6a32 32 0 0 0 32 32z" horiz-adv-x="1024" />
<glyph glyph-name="normal121" unicode="&#59454;" d="M512 800a416 416 0 1 0 0-832 416 416 0 0 0 0 832zM736.32 320H263.04a6.4 6.4 0 0 1-4.48-11.008l178.944-170.688a6.4 6.4 0 0 1 10.88 4.672V256h288a32 32 0 1 1 0 64zM582.4 631.424a6.4 6.4 0 0 1-6.4-6.4V512H288a32 32 0 0 1 0-64h473.344a6.4 6.4 0 0 1 4.416 11.008L586.816 629.76a6.4 6.4 0 0 1-4.416 1.728z" horiz-adv-x="1024" />
@ -1070,7 +1100,7 @@ Created by iconfont
<glyph glyph-name="zhengwu_dui" unicode="&#58964;" d="M960 384c0-247.424-200.576-448-448-448S64 136.57600000000002 64 384 264.576 832 512 832 960 631.424 960 384z m-204.544 129.365333l-67.925333 67.925334-259.712-259.797334-115.968 115.925334-67.84-67.84 115.925333-115.968-0.725333-0.725334 67.84-67.882666 0.768 0.768 0.725333-0.768 67.882667 67.882666-0.768 0.725334 259.797333 259.754666z" horiz-adv-x="1024" />
<glyph glyph-name="zhengwu_cuo1" unicode="&#58965;" d="M835.84-35.84H188.16a96 96 0 0 0-96 96V707.84a96 96 0 0 0 96 96h647.68a96 96 0 0 0 96-96v-647.68a96 96 0 0 0-96-96z m0 64a32 32 0 0 1 32 32V707.84a32 32 0 0 1-32 32H188.16a32 32 0 0 1-32-32v-647.68c0-17.706667 14.293333-32 32-32h647.68zM557.312 384l103.552-103.594667a32 32 0 0 0-45.226667-45.226666L512 338.645333l-103.552-103.552a32 32 0 0 0-45.226667 45.226667l103.509334 103.68-103.552 103.509333a31.914667 31.914667 0 0 0 0 45.226667 31.914667 31.914667 0 0 0 45.226666 0l103.594667-103.509333 103.552 103.552a32 32 0 0 0 45.226667-45.226667L557.269333 384z" horiz-adv-x="1024" />
<glyph glyph-name="zhengwu_cuo1" unicode="&#58965;" d="M853.333333 810.666667a85.333333 85.333333 0 0 0 85.333334-85.333334v-682.666666a85.333333 85.333333 0 0 0-85.333334-85.333334H170.666667a85.333333 85.333333 0 0 0-85.333334 85.333334V725.333333a85.333333 85.333333 0 0 0 85.333334 85.333334h682.666666z m0-64H170.666667a21.333333 21.333333 0 0 1-20.992-17.493334L149.333333 725.333333v-682.666666a21.333333 21.333333 0 0 1 17.493334-20.992L170.666667 21.33333300000004h682.666666a21.333333 21.333333 0 0 1 20.992 17.493334L874.666667 42.66666699999996V725.333333a21.333333 21.333333 0 0 1-17.493334 20.992L853.333333 746.666667z m-180.650666-201.984a34.133333 34.133333 0 0 0 3.072-44.714667l-3.072-3.498667L560.213333 384l112.469334-112.469333a34.090667 34.090667 0 0 0-44.714667-51.285334l-3.498667 3.072L512 335.78666699999997l-112.469333-112.469334a34.090667 34.090667 0 0 0-51.285334 44.714667l3.072 3.498667L463.786667 384 351.317333 496.469333a34.090667 34.090667 0 0 0 44.714667 51.285334l3.498667-3.072L512 432.213333l112.469333 112.469334a34.090667 34.090667 0 0 0 48.213334 0z" horiz-adv-x="1024" />
<glyph glyph-name="zhengwu_dui1" unicode="&#58966;" d="M835.84-35.84H188.16a96 96 0 0 0-96 96V707.84a96 96 0 0 0 96 96h647.68a96 96 0 0 0 96-96v-647.68a96 96 0 0 0-96-96z m0 64a32 32 0 0 1 32 32V707.84a32 32 0 0 1-32 32H188.16a32 32 0 0 1-32-32v-647.68c0-17.706667 14.293333-32 32-32h647.68zM726.101333 532.906667a32 32 0 0 0 0-45.226667l-252.245333-252.330667c-0.128-0.042667-0.128-0.170667-0.170667-0.256a32 32 0 0 0-45.226666 0l-130.389334 130.304a31.914667 31.914667 0 0 0 0 45.226667 31.914667 31.914667 0 0 0 45.226667 0l107.648-107.605333 229.888 229.888a32 32 0 0 0 45.226667 0z" horiz-adv-x="1024" />
@ -1271,9 +1301,6 @@ Created by iconfont
<glyph glyph-name="yewubao" unicode="&#59198;" d="M106.666667 469.333333h810.666666v-384a106.666667 106.666667 0 0 0-106.666666-106.666666H213.333333a106.666667 106.666667 0 0 0-106.666666 106.666666V469.333333z m0 42.666667v170.666667a106.666667 106.666667 0 0 0 106.666666 106.666666h193.109334a85.333333 85.333333 0 0 0 58.666666-23.36l63.317334-59.946666A85.333333 85.333333 0 0 1 587.093333 682.666667H810.666667a106.666667 106.666667 0 0 0 106.666666-106.666667v-64H106.666667z m106.666666-128a21.333333 21.333333 0 0 1 0-42.666667h256a21.333333 21.333333 0 0 1 0 42.666667H213.333333z m0-128a21.333333 21.333333 0 0 1 0-42.666667h128a21.333333 21.333333 0 0 1 0 42.666667h-128z" horiz-adv-x="1024" />
<glyph glyph-name="normal95" unicode="&#59199;" d="M631.488 382.784L549.952 464.32a32 32 0 0 0 45.248 45.248l135.744-135.744a32 32 0 0 0 0.192-45.504l-135.744-135.808a32 32 0 1 0-45.248 45.248l81.024 81.024H312.256a32 32 0 1 0 0 64h319.232zM128 800h320l128-128h320a64 64 0 0 0 64-64v-576a64 64 0 0 0-64-64H128a64 64 0 0 0-64 64v704a64 64 0 0 0 64 64z m293.504-64H128v-704h768v576H549.504l-128 128z" horiz-adv-x="1024" />
<glyph glyph-name="zhujian" unicode="&#59200;" d="M246.528 75.904c1.024-0.768 1.92-1.664 2.816-2.56l49.152-49.088a32 32 0 0 0-45.248-45.248l-49.152 49.088a32.32 32.32 0 0 0-2.496 2.816l-44.544-44.544a32 32 0 1 0-45.312 45.248L405.952 325.76a32.512 32.512 0 0 0 1.408 1.344 288 288 0 1 0 46.08-44.096 32.384 32.384 0 0 0-2.24-2.496L355.648 184.96000000000004l86.272-86.272a32 32 0 0 0-45.248-45.248L310.4 139.712l-63.872-63.808zM628.224 288a224 224 0 1 1 0 448 224 224 0 0 1 0-448z" horiz-adv-x="1024" />

Before

Width:  |  Height:  |  Size: 371 KiB

After

Width:  |  Height:  |  Size: 379 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.

4
dist/lib/base/combination/tab.d.ts vendored

@ -5,7 +5,7 @@ export declare class Tab extends Widget {
setSelect(v: string | number): void;
removeTab(v: string | number): void;
getSelect(): string | number;
getSelectedTab(): any;
getTab(v: string | number): any;
getSelectedTab<T>(): T;
getTab<T>(v: string | number): T;
populate(): void;
}

1
dist/lib/base/pane.d.ts vendored

@ -1,6 +1,7 @@
import { Widget } from "../core/widget";
export declare class Pane extends Widget {
static EVENT_LOADED: string;
static EVENT_LOADING: string;
_assertTip(..._args: any[]): void;
loading(): void;
loaded(): void;

14
dist/lib/base/single/button/buttons/button.image.d.ts vendored

@ -0,0 +1,14 @@
import { BasicButton } from "../button.basic";
export declare class ImageButton extends BasicButton {
static xtype: string;
static EVENT_CHANGE: string;
setWidth(w: number): void;
setHeight(h: number): void;
setImageWidth(w: number): void;
setImageHeight(h: number): void;
getImageWidth(): number;
getImageHeight(): number;
setSrc(src: string): void;
getSrc(): string;
doClick(): void;
}

10
dist/lib/base/single/button/node/textnode.d.ts vendored

@ -0,0 +1,10 @@
import { NodeButton } from "../button.node";
export declare class TextNode extends NodeButton {
static xtype: string;
setText(b: string): void;
getText(): string;
setValue(): void;
getValue(): string;
doRedMark(...args: any[]): void;
unRedMark(...args: any[]): void;
}

8
dist/lib/case/combo/textvaluecheckcombo/popup.textvaluecheck.d.ts vendored

@ -0,0 +1,8 @@
import { Pane } from "../../../base/pane";
export declare class TextValueCheckComboPopup extends Pane {
static xtype: string;
static EVENT_CHANGE: string;
populate(items: any[]): void;
getValue(): any;
setValue(): void;
}

1
dist/lib/core/utils/events/wheelhandler.d.ts vendored

@ -1,4 +1,5 @@
export declare class WheelHandler {
constructor(onWheel: (deltaX: number, deltaY: number) => void, handleScrollX?: boolean | ((deltaX: number, deltaY: number) => boolean), handleScrollY?: boolean | ((deltaY: number, deltaX: number) => boolean), stopPropagation?: boolean | (() => void));
onWheel(event: WheelEvent): void;
_didWheel(): void;
}

4
dist/lib/core/utils/tree.d.ts vendored

@ -24,13 +24,13 @@ export declare class Node {
}
export declare class Tree {
root: Node;
addNode(node: Node, newNode: Node, index: number): void;
addNode(node: Node, newNode: Node, index?: number): void;
isRoot(node: Node): boolean;
getRoot(): Node;
clear(): void;
initTree(nodes: any[]): void;
toJSON<T>(node?: Node): T[];
toJSONWithNode<T>(node: Node): T[];
toJSONWithNode<T>(node?: Node): T[];
search(root: Node, target?: any, param?: any): Node;
traverse(callback: Function): void;
recursion(callback: Function): void;

11
dist/lib/index.d.ts vendored

@ -147,6 +147,11 @@ import { DynamicYearMonthPopup } from './widget/yearmonth/popup.yearmonth';
import { _utils } from './core/utils';
import { Controller } from "./core/controller/controller";
import { LayerController } from "./core/controller/controller.layer";
import { DateCalendarPopup } from "./widget/date/calendar/popup.calendar.date";
import { Tree, Node } from "./core/utils/tree";
import { TextNode } from "./base/single/button/node/textnode";
import { TextValueCheckComboPopup } from "./case/combo/textvaluecheckcombo/popup.textvaluecheck";
import { ImageButton } from './base/single/button/buttons/button.image';
export interface BI extends _func, _i18n, _base, _inject, _var, _web, _utils {
OB: typeof OB;
Plugin: _Plugin;
@ -298,9 +303,13 @@ export interface BI extends _func, _i18n, _base, _inject, _var, _web, _utils {
FloatCenterLayout: typeof FloatCenterLayout;
Msg: _msg;
DynamicYearMonthPopup: typeof DynamicYearMonthPopup;
DateCalendarPopup: typeof DateCalendarPopup;
TextNode: typeof TextNode;
TextValueCheckComboPopup: typeof TextValueCheckComboPopup;
ImageButton: typeof ImageButton;
}
declare const _default: {
Decorators: typeof decorator;
};
export default _default;
export { OB, Widget, Single, BasicButton, Checkbox, Icon, LeftVerticalAdaptLayout, LeftRightVerticalAdaptLayout, SearchTextValueCombo, Input, IconTextItem, AllValueMultiTextValueCombo, IconTextIconItem, Layout, HorizontalAutoLayout, InlineVerticalAdaptLayout, RightVerticalAdaptLayout, TableAdaptLayout, AbsoluteCenterLayout, HorizontalAdaptLayout, FloatLeftLayout, FloatRightLayout, VerticalLayout, AbsoluteLayout, DefaultLayout, HTapeLayout, CenterAdaptLayout, VTapeLayout, VerticalAdaptLayout, IconButton, Trigger, TriggerIconButton, Action, ActionFactory, ShowAction, Controller, LayerController, Behavior, BehaviorFactory, RedMarkBehavior, HighlightBehavior, LoadingPane, Searcher, AbstractLabel, Label, TextButton, DownListCombo, IconChangeButton, Button, TextEditor, A, Html, Switcher, BubbleCombo, Loader, ListPane, MultiSelectBar, SelectList, TextValueCombo, Editor, IconLabel, Popover, BarPopover, Tab, AbstractTreeValueChooser, AbstractListTreeValueChooser, ListTreeValueChooserInsertCombo, TreeValueChooserCombo, TreeValueChooserInsertCombo, MultiLayerSelectTreePopup, MultiLayerSingleTreePopup, TreeView, ListTreeView, ListAsyncTree, AsyncTree, MultiLayerSingleTreeCombo, MultiLayerSelectTreeCombo, MultiTreeListCombo, MultiTreeInsertCombo, Combo, IconCombo, DynamicDateCombo, Radio, MultiSelectItem, CustomTree, ButtonGroup, ButtonTree, NodeButton, IconArrowNode, MidTreeLeafItem, FirstTreeLeafItem, LastTreeLeafItem, SmallTextEditor, MultifileEditor, SignEditor, MultiSelectInsertCombo, MultiSelectCombo, SearchEditor, Text, Pane, MultiLayerSingleLevelTree, SimpleColorChooser, AbstractAllValueChooser, AllValueChooserCombo, TextAreaEditor, SingleSelectItem, DynamicDateTimeCombo, MultiTreeCombo, CenterLayout, VirtualGroup, GridLayout, MultiTreePopup, SingleSelectRadioItem, SingleSelectInsertCombo, SingleSelectCombo, CardLayout, DynamicYearMonthCombo, TimeCombo, Iframe, TextValueDownListCombo, Switch, HorizontalLayout, ShelterEditor, SelectTextTrigger, DateInterval, DynamicDatePane, AllCountPager, PopupView, BubblePopupView, BubblePopupBarView, TextBubblePopupBarView, ArrowTreeGroupNodeCheckbox, NumberInterval, DynamicYearQuarterCombo, DynamicYearCombo, IntervalSlider, MultiSelectInsertList, YearMonthInterval, TextValueCheckCombo, NumberEditor, LinearSegment, Img, EditorIconCheckCombo, IconTextValueCombo, ListView, FloatCenterLayout, DynamicYearMonthPopup, };
export { OB, Widget, Single, BasicButton, Checkbox, Icon, LeftVerticalAdaptLayout, LeftRightVerticalAdaptLayout, SearchTextValueCombo, Input, IconTextItem, AllValueMultiTextValueCombo, IconTextIconItem, Layout, HorizontalAutoLayout, InlineVerticalAdaptLayout, RightVerticalAdaptLayout, TableAdaptLayout, AbsoluteCenterLayout, HorizontalAdaptLayout, FloatLeftLayout, FloatRightLayout, VerticalLayout, AbsoluteLayout, DefaultLayout, HTapeLayout, CenterAdaptLayout, VTapeLayout, VerticalAdaptLayout, IconButton, Trigger, TriggerIconButton, Action, ActionFactory, ShowAction, Controller, LayerController, Behavior, BehaviorFactory, RedMarkBehavior, HighlightBehavior, LoadingPane, Searcher, AbstractLabel, Label, TextButton, DownListCombo, IconChangeButton, Button, TextEditor, A, Html, Switcher, BubbleCombo, Loader, ListPane, MultiSelectBar, SelectList, TextValueCombo, Editor, IconLabel, Popover, BarPopover, Tab, AbstractTreeValueChooser, AbstractListTreeValueChooser, ListTreeValueChooserInsertCombo, TreeValueChooserCombo, TreeValueChooserInsertCombo, MultiLayerSelectTreePopup, MultiLayerSingleTreePopup, TreeView, ListTreeView, ListAsyncTree, AsyncTree, MultiLayerSingleTreeCombo, MultiLayerSelectTreeCombo, MultiTreeListCombo, MultiTreeInsertCombo, Combo, IconCombo, DynamicDateCombo, Radio, MultiSelectItem, CustomTree, ButtonGroup, ButtonTree, NodeButton, IconArrowNode, MidTreeLeafItem, FirstTreeLeafItem, LastTreeLeafItem, SmallTextEditor, MultifileEditor, SignEditor, MultiSelectInsertCombo, MultiSelectCombo, SearchEditor, Text, Pane, MultiLayerSingleLevelTree, SimpleColorChooser, AbstractAllValueChooser, AllValueChooserCombo, TextAreaEditor, SingleSelectItem, DynamicDateTimeCombo, MultiTreeCombo, CenterLayout, VirtualGroup, GridLayout, MultiTreePopup, SingleSelectRadioItem, SingleSelectInsertCombo, SingleSelectCombo, CardLayout, DynamicYearMonthCombo, TimeCombo, Iframe, TextValueDownListCombo, Switch, HorizontalLayout, ShelterEditor, SelectTextTrigger, DateInterval, DynamicDatePane, AllCountPager, PopupView, BubblePopupView, BubblePopupBarView, TextBubblePopupBarView, ArrowTreeGroupNodeCheckbox, NumberInterval, DynamicYearQuarterCombo, DynamicYearCombo, IntervalSlider, MultiSelectInsertList, YearMonthInterval, TextValueCheckCombo, NumberEditor, LinearSegment, Img, EditorIconCheckCombo, IconTextValueCombo, ListView, FloatCenterLayout, DynamicYearMonthPopup, DateCalendarPopup, Tree, Node, TextNode, TextValueCheckComboPopup, ImageButton, };

18
dist/lib/widget/date/calendar/popup.calendar.date.d.ts vendored

@ -0,0 +1,18 @@
import { Widget } from "../../../core/widget";
export declare class DateCalendarPopup extends Widget {
static xtype: string;
static EVENT_CHANGE: string;
static EVENT_BEFORE_YEAR_MONTH_POPUPVIEW: string;
setMinDate(v: string): void;
setMaxDate(v: string): void;
setValue(v: {
year: number;
month: number;
day: number;
}): void;
getValue(): {
year: number;
month: number;
day: number;
};
}

2
dist/lib/widget/editor/editor.search.d.ts vendored

@ -28,4 +28,6 @@ export declare class SearchEditor extends Widget {
getLastChangedValue(): string;
isEditing(): boolean;
isValid(): boolean;
showClearIcon(): void;
hideClearIcon(): void;
}

4
dist/resource.css vendored

File diff suppressed because one or more lines are too long

7
dist/resource.js vendored

@ -184,11 +184,16 @@ BI.i18n = {
"BI-Basic_Hour_Sin": "时",
"BI-Basic_Seconds": "秒",
"BI-Basic_Minute": "分",
"BI-Basic_Thousand": "千",
"BI-Basic_Wan": "万",
"BI-Basic_Million": "百万",
"BI-Basic_Billion": "亿",
"BI-Basic_Quarter": "季度",
"BI-Basic_No_Select": "不选",
"BI-Basic_Now": "此刻",
"BI-Color_Picker_Error_Text_Hex": "请输入6位16进制颜色编号"
"BI-Color_Picker_Error_Text_Hex": "请输入6位16进制颜色编号",
"BI-Basic_Date_Range_Error": "请选择{R1}年{R2}月{R3}日-{R4}年{R5}月{R6}日的日期",
"BI-Basic_Year_Range_Error": "请选择{R1}年-{R2}年的日期",
"BI-Basic_Year_Month_Range_Error": "请选择{R1}年{R2}月-{R3}年{R4}月的日期",
"BI-Basic_Year_Quarter_Range_Error": "请选择{R1}年{R2}季度-{R3}年{R4}季度的日期",
};

98
dist/utils.js vendored

@ -1,4 +1,4 @@
/*! time: 2021-1-4 15:10:21 */
/*! time: 2021-2-26 11:30:39 */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
@ -82,12 +82,12 @@
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 1229);
/******/ return __webpack_require__(__webpack_require__.s = 1238);
/******/ })
/************************************************************************/
/******/ ({
/***/ 1090:
/***/ 1099:
/***/ (function(module, exports) {
BI.i18n = {
@ -275,18 +275,52 @@ BI.i18n = {
"BI-Basic_Hour_Sin": "时",
"BI-Basic_Seconds": "秒",
"BI-Basic_Minute": "分",
"BI-Basic_Thousand": "千",
"BI-Basic_Wan": "万",
"BI-Basic_Million": "百万",
"BI-Basic_Billion": "亿",
"BI-Basic_Quarter": "季度",
"BI-Basic_No_Select": "不选",
"BI-Basic_Now": "此刻",
"BI-Color_Picker_Error_Text_Hex": "请输入6位16进制颜色编号"
"BI-Color_Picker_Error_Text_Hex": "请输入6位16进制颜色编号",
"BI-Basic_Date_Range_Error": "请选择{R1}年{R2}月{R3}日-{R4}年{R5}月{R6}日的日期",
"BI-Basic_Year_Range_Error": "请选择{R1}年-{R2}年的日期",
"BI-Basic_Year_Month_Range_Error": "请选择{R1}年{R2}月-{R3}年{R4}月的日期",
"BI-Basic_Year_Quarter_Range_Error": "请选择{R1}年{R2}季度-{R3}年{R4}季度的日期",
};
/***/ }),
/***/ 1229:
/***/ 123:
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/**
* Created by richie on 15/7/8.
*/
/**
* 初始化BI对象
*/
_global = undefined;
if (typeof window !== "undefined") {
_global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (_global.BI == null) {
_global.BI = {prepares: []};
}
if(_global.BI.prepares == null) {
_global.BI.prepares = [];
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(17)))
/***/ }),
/***/ 1238:
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(123);
@ -316,8 +350,8 @@ __webpack_require__(140);
__webpack_require__(141);
__webpack_require__(142);
__webpack_require__(143);
__webpack_require__(1090);
__webpack_require__(1230);
__webpack_require__(1099);
__webpack_require__(1239);
__webpack_require__(153);
__webpack_require__(154);
module.exports = __webpack_require__(155);
@ -325,36 +359,7 @@ module.exports = __webpack_require__(155);
/***/ }),
/***/ 123:
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/**
* Created by richie on 15/7/8.
*/
/**
* 初始化BI对象
*/
_global = undefined;
if (typeof window !== "undefined") {
_global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (_global.BI == null) {
_global.BI = {prepares: []};
}
if(_global.BI.prepares == null) {
_global.BI.prepares = [];
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(17)))
/***/ }),
/***/ 1230:
/***/ 1239:
/***/ (function(module, exports) {
/**
@ -985,7 +990,7 @@ if (!_global.BI) {
if (typeof w === "number") {
return w >= 0;
} else if (typeof w === "string") {
return /^\d{1,3}%$/.exec(w) || w == "auto" || /^\d+px$/.exec(w);
return /^\d{1,3}(\.\d)?%$/.exec(w) || w == "auto" || /^\d+px$/.exec(w);
}
},
@ -1610,7 +1615,10 @@ if (!_global.BI) {
hr -= 12;
}
break;
case "%Q":
case "%q":
m = (parseInt(a[i], 10) - 1) * 3;
break;
case "%M":
min = parseInt(a[i], 10);
break;
@ -1785,7 +1793,7 @@ if (!_global.BI) {
});
})();
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(17), __webpack_require__(62).setImmediate))
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(17), __webpack_require__(63).setImmediate))
/***/ }),
@ -1996,7 +2004,7 @@ if (!_global.BI) {
attachTo.setImmediate = setImmediate;
attachTo.clearImmediate = clearImmediate;
})(typeof self === "undefined" ? typeof global === "undefined" ? void 0 : global : self);
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(17), __webpack_require__(76)))
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(17), __webpack_require__(77)))
/***/ }),
@ -7992,6 +8000,7 @@ _.extend(BI, {
s["%y"] = yWith4number.substr(2, 2); // year without the century (range 00 to 99)
s["%Y"] = yWith4number; // year with the century
s["%%"] = "%"; // a literal '%' character
s["%q"] = "0" + qr;
s["%Q"] = qr;
var re = /%./g;
@ -8860,6 +8869,8 @@ _.extend(BI, {
zIndex_masker: 1e8,
zIndex_tip: 1e9,
emptyStr: "",
pixUnit: "px",
pixRatio: 1,
emptyFn: function () {
},
empty: null,
@ -8984,6 +8995,7 @@ _.extend(BI, {
StartOfWeek: 1
});
/***/ }),
/***/ 153:
@ -9090,7 +9102,7 @@ module.exports = g;
/***/ }),
/***/ 62:
/***/ 63:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@ -9158,7 +9170,7 @@ exports.clearImmediate = typeof self !== "undefined" && self.clearImmediate || t
/***/ }),
/***/ 76:
/***/ 77:
/***/ (function(module, exports, __webpack_require__) {
"use strict";

2
dist/utils.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/utils.min.js.map vendored

File diff suppressed because one or more lines are too long

7
i18n/i18n.cn.js

@ -183,11 +183,16 @@ BI.i18n = {
"BI-Basic_Hour_Sin": "时",
"BI-Basic_Seconds": "秒",
"BI-Basic_Minute": "分",
"BI-Basic_Thousand": "千",
"BI-Basic_Wan": "万",
"BI-Basic_Million": "百万",
"BI-Basic_Billion": "亿",
"BI-Basic_Quarter": "季度",
"BI-Basic_No_Select": "不选",
"BI-Basic_Now": "此刻",
"BI-Color_Picker_Error_Text_Hex": "请输入6位16进制颜色编号"
"BI-Color_Picker_Error_Text_Hex": "请输入6位16进制颜色编号",
"BI-Basic_Date_Range_Error": "请选择{R1}年{R2}月{R3}日-{R4}年{R5}月{R6}日的日期",
"BI-Basic_Year_Range_Error": "请选择{R1}年-{R2}年的日期",
"BI-Basic_Year_Month_Range_Error": "请选择{R1}年{R2}月-{R3}年{R4}月的日期",
"BI-Basic_Year_Quarter_Range_Error": "请选择{R1}年{R2}季度-{R3}年{R4}季度的日期",
};

2
package.json

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

4
src/base/collection/collection.js

@ -169,10 +169,10 @@ BI.CollectionView = BI.inherit(BI.Widget, {
this.renderedCells[index].el.setHeight(datum.height);
}
if (this.renderedCells[index]._left !== datum.x) {
this.renderedCells[index].el.element.css("left", datum.x + "px");
this.renderedCells[index].el.element.css("left", datum.x / BI.pixRatio + BI.pixUnit);
}
if (this.renderedCells[index]._top !== datum.y) {
this.renderedCells[index].el.element.css("top", datum.y + "px");
this.renderedCells[index].el.element.css("top", datum.y / BI.pixRatio + BI.pixUnit);
}
renderedCells.push(child = this.renderedCells[index]);
} else {

4
src/base/grid/grid.js

@ -145,10 +145,10 @@ BI.GridView = BI.inherit(BI.Widget, {
this.renderedCells[index].el.setHeight(rowDatum.size);
}
if (this.renderedCells[index]._left !== columnDatum.offset + horizontalOffsetAdjustment) {
this.renderedCells[index].el.element.css("left", (columnDatum.offset + horizontalOffsetAdjustment) + "px");
this.renderedCells[index].el.element.css("left", (columnDatum.offset + horizontalOffsetAdjustment) / BI.pixRatio + BI.pixUnit);
}
if (this.renderedCells[index]._top !== rowDatum.offset + verticalOffsetAdjustment) {
this.renderedCells[index].el.element.css("top", (rowDatum.offset + verticalOffsetAdjustment) + "px");
this.renderedCells[index].el.element.css("top", (rowDatum.offset + verticalOffsetAdjustment) / BI.pixRatio + BI.pixUnit);
}
child = this.renderedCells[index].el;
renderedCells.push(this.renderedCells[index]);

32
src/base/layer/layer.popup.js

@ -45,21 +45,21 @@ BI.PopupView = BI.inherit(BI.Widget, {
BI.PopupView.superclass._init.apply(this, arguments);
var self = this, o = this.options;
var fn = function (e) {
e.stopPropagation();
}, stop = function (e) {
e.stopEvent();
return false;
};
e.stopPropagation();
}, stop = function (e) {
e.stopEvent();
return false;
};
this.element.css({
"z-index": BI.zIndex_popup,
"min-width": o.minWidth + "px",
"max-width": o.maxWidth + "px"
}).bind({click: fn});
"min-width": BI.isNumeric(o.minWidth) ? (o.minWidth / BI.pixRatio + BI.pixUnit) : o.minWidth,
"max-width": BI.isNumeric(o.maxWidth) ? (o.maxWidth / BI.pixRatio + BI.pixUnit) : o.maxWidth
}).bind({ click: fn });
this.element.bind("mousewheel", fn);
o.stopPropagation && this.element.bind({mousedown: fn, mouseup: fn, mouseover: fn});
o.stopEvent && this.element.bind({mousedown: stop, mouseup: stop, mouseover: stop});
o.stopPropagation && this.element.bind({ mousedown: fn, mouseup: fn, mouseover: fn });
o.stopEvent && this.element.bind({ mousedown: stop, mouseup: stop, mouseover: stop });
this.tool = this._createTool();
this.tab = this._createTab();
this.view = this._createView();
@ -94,8 +94,12 @@ BI.PopupView = BI.inherit(BI.Widget, {
_createView: function () {
var o = this.options;
this.button_group = BI.createWidget(o.el, {type: "bi.button_group", value: o.value});
this.button_group.element.css({"min-height": o.minHeight + "px", "padding-top": o.innerVGap + "px", "padding-bottom": o.innerVGap + "px"});
this.button_group = BI.createWidget(o.el, { type: "bi.button_group", value: o.value });
this.button_group.element.css({
"min-height": BI.isNumeric(o.minHeight) ? (o.minHeight / BI.pixRatio + BI.pixUnit) : o.minHeight,
"padding-top": o.innerVGap / BI.pixRatio + BI.pixUnit,
"padding-bottom": o.innerVGap / BI.pixRatio + BI.pixUnit
});
return this.button_group;
},
@ -158,7 +162,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
toolHeight = ((this.tool && this.tool.attr("height")) || 24) * ((this.tool && this.tool.isVisible()) ? 1 : 0);
var resetHeight = h - tbHeight - tabHeight - toolHeight - 2 * this.options.innerVGap;
this.view.resetHeight ? this.view.resetHeight(resetHeight) :
this.view.element.css({"max-height": resetHeight + "px"});
this.view.element.css({ "max-height": resetHeight / BI.pixRatio + BI.pixUnit });
},
setValue: function (selectedValues) {
@ -171,4 +175,4 @@ BI.PopupView = BI.inherit(BI.Widget, {
}
});
BI.PopupView.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.popup_view", BI.PopupView);
BI.shortcut("bi.popup_view", BI.PopupView);

4
src/base/pane.js

@ -86,6 +86,7 @@ BI.Pane = BI.inherit(BI.Widget, {
items: this._getLoadingTipItems(this._loading)
});
}
self.fireEvent(BI.Pane.EVENT_LOADING);
this.element.addClass("loading-status");
},
@ -143,4 +144,5 @@ BI.Pane = BI.inherit(BI.Widget, {
}
});
BI.Pane.EVENT_LOADED = "EVENT_LOADED";
BI.Pane.EVENT_LOADED = "EVENT_LOADED";
BI.Pane.EVENT_LOADING = "EVENT_LOADING";

4
src/base/single/button/buttons/button.icon.js

@ -25,7 +25,7 @@ BI.IconButton = BI.inherit(BI.BasicButton, {
height: o.iconHeight
});
if (BI.isNumber(o.height) && o.height > 0 && BI.isNull(o.iconWidth) && BI.isNull(o.iconHeight)) {
this.element.css("lineHeight", o.height + "px");
this.element.css("lineHeight", o.height / BI.pixRatio + BI.pixUnit);
BI.createWidget({
type: "bi.default",
element: this,
@ -49,4 +49,4 @@ BI.IconButton = BI.inherit(BI.BasicButton, {
}
});
BI.IconButton.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_button", BI.IconButton);
BI.shortcut("bi.icon_button", BI.IconButton);

8
src/base/single/button/buttons/button.js

@ -44,11 +44,11 @@ BI.Button = BI.inherit(BI.BasicButton, {
BI.Button.superclass._init.apply(this, arguments);
var o = this.options, self = this;
if (BI.isNumber(o.height) && !o.clear && !o.block) {
this.element.css({height: o.height + "px", lineHeight: (o.height - 2) + "px"});
this.element.css({height: o.height / BI.pixRatio + BI.pixUnit, lineHeight: (o.height - 2) / BI.pixRatio + BI.pixUnit});
} else if (o.clear || o.block) {
this.element.css({lineHeight: o.height + "px"});
this.element.css({lineHeight: o.height / BI.pixRatio + BI.pixUnit});
} else {
this.element.css({lineHeight: (o.height - 2) + "px"});
this.element.css({lineHeight: (o.height - 2) / BI.pixRatio + BI.pixUnit});
}
if (BI.isKey(o.iconCls)) {
this.icon = BI.createWidget({
@ -106,7 +106,7 @@ BI.Button = BI.inherit(BI.BasicButton, {
this.element.addClass("ghost");
}
if (o.minWidth > 0) {
this.element.css({"min-width": o.minWidth + "px"});
this.element.css({"min-width": o.minWidth / BI.pixRatio + BI.pixUnit});
}
},

7
src/base/single/editor/editor.textarea.js

@ -10,6 +10,9 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
baseCls: "bi-textarea-editor",
value: "",
errorText: "",
adjustYOffset: 2,
adjustXOffset: 0,
offsetStyle: "left",
validationChecker: function () {
return true;
},
@ -137,7 +140,9 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
}
if (!this.disabledError && BI.isKey(errorText)) {
BI.Bubbles[b ? "show" : "hide"](this.getName(), errorText, this, {
adjustYOffset: 2
adjustYOffset: o.adjustYOffset,
adjustXOffset: o.adjustXOffset,
offsetStyle: o.offsetStyle,
});
return BI.Bubbles.get(this.getName());
}

14
src/base/single/html/html.js

@ -25,29 +25,29 @@ BI.Html = BI.inherit(BI.Single, {
var self = this, o = this.options;
if (o.hgap + o.lgap > 0) {
this.element.css({
"padding-left": o.hgap + o.lgap + "px"
"padding-left": (o.hgap + o.lgap) / BI.pixRatio + BI.pixUnit
});
}
if (o.hgap + o.rgap > 0) {
this.element.css({
"padding-right": o.hgap + o.rgap + "px"
"padding-right": (o.hgap + o.rgap) / BI.pixRatio + BI.pixUnit
});
}
if (o.vgap + o.tgap > 0) {
this.element.css({
"padding-top": o.vgap + o.tgap + "px"
"padding-top": (o.vgap + o.tgap) / BI.pixRatio + BI.pixUnit
});
}
if (o.vgap + o.bgap > 0) {
this.element.css({
"padding-bottom": o.vgap + o.bgap + "px"
"padding-bottom": (o.vgap + o.bgap) / BI.pixRatio + BI.pixUnit
});
}
if (BI.isNumber(o.height)) {
this.element.css({lineHeight: o.height + "px"});
this.element.css({lineHeight: o.height / BI.pixRatio + BI.pixUnit});
}
if (BI.isNumber(o.lineHeight)) {
this.element.css({lineHeight: o.lineHeight + "px"});
this.element.css({lineHeight: o.lineHeight / BI.pixRatio + BI.pixUnit});
}
if (BI.isWidthOrHeight(o.maxWidth)) {
this.element.css({maxWidth: o.maxWidth});
@ -111,4 +111,4 @@ BI.Html = BI.inherit(BI.Single, {
}
});
BI.shortcut("bi.html", BI.Html);
BI.shortcut("bi.html", BI.Html);

20
src/base/single/label/abstract.label.js

@ -59,6 +59,7 @@
BI.createWidget({
type: "bi.center_adapt",
height: o.height,
columnSize: ["auto"], // important! 让文字在flex布局下shrink为1
scrollable: o.whiteSpace === "normal",
element: this,
items: [
@ -71,6 +72,7 @@
}
BI.createWidget({ // 1.2
type: "bi.center_adapt",
columnSize: ["auto"], // important! 让文字在flex布局下shrink为1
scrollable: o.whiteSpace === "normal",
element: this,
items: [
@ -93,6 +95,7 @@
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
columnSize: ["auto"], // important! 让文字在flex布局下shrink为1
scrollable: o.whiteSpace === "normal",
element: this,
items: [this.text]
@ -101,7 +104,7 @@
}
if (BI.isNumber(o.height) && o.height > 0) { // 1.4
this.element.css({
"line-height": o.height + "px"
"line-height": o.height / BI.pixRatio + BI.pixUnit
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
@ -127,6 +130,7 @@
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
columnSize: ["auto"], // important! 让文字在flex布局下shrink为1
scrollable: o.whiteSpace === "normal",
element: this,
items: [this.text]
@ -137,6 +141,7 @@
json.maxWidth = o.textWidth;
BI.createWidget({
type: "bi.center_adapt",
columnSize: ["auto"], // important! 让文字在flex布局下shrink为1
scrollable: o.whiteSpace === "normal",
element: this,
items: [
@ -159,6 +164,7 @@
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
columnSize: ["auto"], // important! 让文字在flex布局下shrink为1
scrollable: true,
element: this,
items: [this.text]
@ -167,7 +173,7 @@
}
if (BI.isNumber(o.height) && o.height > 0) { // 1.8
this.element.css({
"line-height": o.height + "px"
"line-height": o.height / BI.pixRatio + BI.pixUnit
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
@ -195,6 +201,7 @@
}));
BI.createWidget({
type: "bi.center_adapt",
columnSize: ["auto"], // important! 让文字在flex布局下shrink为1
element: this,
items: [this.text]
});
@ -211,6 +218,7 @@
BI.createWidget({
type: adaptLayout,
horizontalAlign: o.textAlign,
columnSize: ["auto"], // important! 让文字在flex布局下shrink为1
height: o.height,
scrollable: o.whiteSpace === "normal",
element: this,
@ -225,6 +233,7 @@
BI.createWidget({ // 2.2
type: adaptLayout,
horizontalAlign: o.textAlign,
columnSize: ["auto"], // important! 让文字在flex布局下shrink为1
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
@ -253,7 +262,7 @@
}));
if (o.whiteSpace !== "normal") {
this.element.css({
"line-height": o.height - (o.vgap * 2) + "px"
"line-height": (o.height - (o.vgap * 2)) / BI.pixRatio + BI.pixUnit
});
}
return;
@ -262,6 +271,7 @@
BI.createWidget({ // 2.4
type: adaptLayout,
horizontalAlign: o.textAlign,
columnSize: ["auto"], // important! 让文字在flex布局下shrink为1
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
@ -281,6 +291,7 @@
BI.createWidget({ // 2.5
type: adaptLayout,
horizontalAlign: o.textAlign,
columnSize: ["auto"], // important! 让文字在flex布局下shrink为1
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
@ -300,7 +311,7 @@
if (BI.isNumber(o.height) && o.height > 0) {
if (o.whiteSpace !== "normal") {
this.element.css({
"line-height": o.height - (o.vgap * 2) + "px"
"line-height": (o.height - (o.vgap * 2)) / BI.pixRatio + BI.pixUnit
});
}
this.text = BI.createWidget(BI.extend(json, { // 2.6
@ -329,6 +340,7 @@
BI.createWidget({
type: adaptLayout,
horizontalAlign: o.textAlign,
columnSize: ["auto"], // important! 让文字在flex布局下shrink为1
element: this,
scrollable: o.whiteSpace === "normal",
items: [this.text]

4
src/base/single/label/icon.label.js

@ -23,7 +23,7 @@ BI.IconLabel = BI.inherit(BI.Single, {
height: o.iconHeight
});
if (BI.isNumber(o.height) && o.height > 0 && BI.isNull(o.iconWidth) && BI.isNull(o.iconHeight)) {
this.element.css("lineHeight", o.height + "px");
this.element.css("lineHeight", o.height / BI.pixRatio + BI.pixUnit);
BI.createWidget({
type: "bi.default",
element: this,
@ -39,4 +39,4 @@ BI.IconLabel = BI.inherit(BI.Single, {
}
}
});
BI.shortcut("bi.icon_label", BI.IconLabel);
BI.shortcut("bi.icon_label", BI.IconLabel);

3
src/base/single/single.js

@ -13,7 +13,6 @@ BI.Single = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.Single.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
_baseCls: (conf._baseCls || "") + " bi-single",
readonly: false,
title: null,
warningTitle: null,
@ -207,4 +206,4 @@ BI.Single = BI.inherit(BI.Widget, {
}
BI.Tooltips.remove(this.getName());
},
});
});

17
src/base/single/text.js

@ -26,32 +26,32 @@
var self = this, o = this.options;
if (o.hgap + o.lgap > 0) {
this.element.css({
"padding-left": o.hgap + o.lgap + "px"
"padding-left": (o.hgap + o.lgap) / BI.pixRatio + BI.pixUnit
});
}
if (o.hgap + o.rgap > 0) {
this.element.css({
"padding-right": o.hgap + o.rgap + "px"
"padding-right": (o.hgap + o.rgap) / BI.pixRatio + BI.pixUnit
});
}
if (o.vgap + o.tgap > 0) {
this.element.css({
"padding-top": o.vgap + o.tgap + "px"
"padding-top": (o.vgap + o.tgap) / BI.pixRatio + BI.pixUnit
});
}
if (o.vgap + o.bgap > 0) {
this.element.css({
"padding-bottom": o.vgap + o.bgap + "px"
"padding-bottom": (o.vgap + o.bgap) / BI.pixRatio + BI.pixUnit
});
}
if (BI.isNumber(o.height)) {
this.element.css({lineHeight: o.height + "px"});
this.element.css({lineHeight: o.height / BI.pixRatio + BI.pixUnit});
}
if (BI.isNumber(o.lineHeight)) {
this.element.css({lineHeight: o.lineHeight + "px"});
this.element.css({lineHeight: o.lineHeight / BI.pixRatio + BI.pixUnit});
}
if (BI.isWidthOrHeight(o.maxWidth)) {
this.element.css({maxWidth: o.maxWidth});
this.element.css({maxWidth: o.maxWidth / BI.pixRatio + BI.pixUnit});
}
this.element.css({
textAlign: o.textAlign,
@ -96,8 +96,9 @@
case "nowrap":
return "pre";
case "normal":
default:
return "pre-wrap";
default:
return o.whiteSpace;
}
},

4
src/base/single/tip/tip.toast.js

@ -22,7 +22,7 @@ BI.Toast = BI.inherit(BI.Tip, {
BI.Toast.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.element.css({
minWidth: this._const.minWidth + "px"
minWidth: this._const.minWidth / BI.pixRatio + BI.pixUnit
});
this.element.addClass("toast-" + o.level);
var fn = function (e) {
@ -95,4 +95,4 @@ BI.Toast = BI.inherit(BI.Tip, {
}
});
BI.Toast.EVENT_DESTORY = "EVENT_DESTORY";
BI.shortcut("bi.toast", BI.Toast);
BI.shortcut("bi.toast", BI.Toast);

8
src/case/button/item.singleselect.radio.js

@ -10,7 +10,6 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, {
logic: {
dynamic: false
},
hgap: 10,
height: 24
});
},
@ -18,8 +17,7 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, {
BI.SingleSelectRadioItem.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.radio = BI.createWidget({
type: "bi.radio",
once: o.once
type: "bi.radio"
});
this.text = BI.createWidget({
type: "bi.label",
@ -41,7 +39,7 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, {
items: BI.LogicFactory.createLogicItemsByDirection("left", {
type: "bi.center_adapt",
items: [this.radio],
width: 16
width: 26
}, this.text)
}))));
},
@ -70,4 +68,4 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, {
});
BI.SingleSelectRadioItem.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.single_select_radio_item", BI.SingleSelectRadioItem);
BI.shortcut("bi.single_select_radio_item", BI.SingleSelectRadioItem);

13
src/case/colorchooser/colorchooser.js

@ -9,17 +9,18 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.ColorChooser.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-color-chooser",
baseCls: "bi-color-chooser bi-border",
value: "",
height: 24,
el: {}
el: {},
});
},
_init: function () {
BI.ColorChooser.superclass._init.apply(this, arguments);
var self = this, o = this.options;
o.height -= 2;
BI.isNumeric(o.width) && (o.width -= 2);
BI.ColorChooser.superclass._init.apply(this, arguments);
o.value = o.value || "";
this.combo = BI.createWidget({
type: "bi.combo",
@ -33,8 +34,8 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.trigger = _ref;
},
width: o.el.type ? o.width : o.width - 2,
height: o.el.type ? o.height : o.height - 2
width: o.width,
height: o.height
}, o.el),
popup: {
el: BI.extend({

4
src/case/colorchooser/colorchooser.trigger.js

@ -10,8 +10,8 @@ BI.ColorChooserTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
var conf = BI.ColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border",
height: 22
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger",
height: 24
});
},

4
src/case/colorchooser/colorchooser.trigger.long.js

@ -10,8 +10,8 @@ BI.LongColorChooserTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
var conf = BI.LongColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border",
height: 22
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger",
height: 24
});
},

2
src/case/combo/bubblecombo/combo.bubble.js

@ -6,7 +6,7 @@
*/
BI.BubbleCombo = BI.inherit(BI.Widget, {
_const: {
TRIANGLE_LENGTH: 6
TRIANGLE_LENGTH: 9
},
_defaultConfig: function () {
return BI.extend(BI.BubbleCombo.superclass._defaultConfig.apply(this, arguments), {

9
src/case/combo/icontextvaluecombo/combo.icontextvalue.js

@ -5,20 +5,19 @@
BI.IconTextValueCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-icon-text-value-combo",
baseCls: "bi-icon-text-value-combo bi-border bi-border-radius",
height: 24,
iconHeight: null,
iconWidth: null,
value: "",
attributes: {
tabIndex: 0
}
});
},
_init: function () {
BI.IconTextValueCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
o.height -= 2;
BI.isNumeric(o.width) && (o.width -= 2);
BI.IconTextValueCombo.superclass._init.apply(this, arguments);
this.trigger = BI.createWidget({
type: "bi.select_icon_text_trigger",
cls: "icon-text-value-trigger",

4
src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js

@ -10,9 +10,6 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
items: [],
tipType: "",
warningTitle: "",
attributes: {
tabIndex: 0
}
},
render: function () {
@ -22,6 +19,7 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
items: [{
el: {
type: "bi.combo",
cls: "bi-border bi-focus-shadow",
container: o.container,
adjustLength: 2,
toggle: false,

2
src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js

@ -5,7 +5,7 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, {
props: function () {
return {
extraCls: "bi-search-text-value-trigger bi-border",
extraCls: "bi-search-text-value-trigger",
height: 24,
watermark: BI.i18nText("BI-Basic_Search")
};

9
src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js

@ -6,20 +6,19 @@
BI.TextValueCheckCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.TextValueCheckCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-text-value-check-combo",
baseCls: "bi-text-value-check-combo bi-border",
width: 100,
height: 24,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
value: "",
attributes: {
tabIndex: 0
}
});
},
_init: function () {
BI.TextValueCheckCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
o.height -= 2;
BI.isNumeric(o.width) && (o.width -= 2);
BI.TextValueCheckCombo.superclass._init.apply(this, arguments);
this.trigger = BI.createWidget({
type: "bi.select_text_trigger",
cls: "text-value-trigger",

9
src/case/combo/textvaluecombo/combo.textvalue.js

@ -7,20 +7,19 @@
BI.TextValueCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.TextValueCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-text-value-combo",
baseCls: "bi-text-value-combo bi-border",
height: 24,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
text: "",
value: "",
attributes: {
tabIndex: 0
}
});
},
_init: function () {
BI.TextValueCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
o.height -= 2;
BI.isNumeric(o.width) && (o.width -= 2);
BI.TextValueCombo.superclass._init.apply(this, arguments);
this.trigger = BI.createWidget({
type: "bi.select_text_trigger",
cls: "text-value-trigger",

2
src/case/linersegment/linear.segment.js

@ -1,7 +1,7 @@
BI.LinearSegment = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-linear-segment bi-split-bottom",
baseCls: "bi-linear-segment",
items: [],
layouts: [{
type: "bi.center"

4
src/case/list/list.select.js

@ -173,7 +173,7 @@ BI.SelectList = BI.inherit(BI.Widget, {
resetHeight: function (h) {
var toolHeight = ( this.toolbar.element.outerHeight() || 25) * ( this.toolbar.isVisible() ? 1 : 0);
this.list.resetHeight ? this.list.resetHeight(h - toolHeight) :
this.list.element.css({"max-height": h - toolHeight + "px"});
this.list.element.css({"max-height": (h - toolHeight) / BI.pixRatio + BI.pixUnit});
},
setNotSelectedValue: function () {
@ -214,4 +214,4 @@ BI.SelectList = BI.inherit(BI.Widget, {
}
});
BI.SelectList.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.select_list", BI.SelectList);
BI.shortcut("bi.select_list", BI.SelectList);

3
src/case/trigger/trigger.icon.text.select.js

@ -5,7 +5,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
return BI.extend(BI.SelectIconTextTrigger.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-select-text-trigger bi-border",
baseCls: "bi-select-text-trigger",
height: 24,
iconHeight: null,
iconWidth: null,
@ -14,7 +14,6 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, {
},
_init: function () {
this.options.height -= 2;
BI.SelectIconTextTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options;
var obj = this._digist(o.value, o.items);

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

@ -9,13 +9,12 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
return BI.extend(BI.SelectTextTrigger.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-select-text-trigger bi-border bi-focus-shadow",
baseCls: "bi-select-text-trigger",
height: 24
});
},
_init: function () {
this.options.height -= 2;
BI.SelectTextTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options;
var obj = this._digest(o.value, o.items);

7
src/core/base.js

@ -504,7 +504,7 @@ if (!_global.BI) {
if (typeof w === "number") {
return w >= 0;
} else if (typeof w === "string") {
return /^\d{1,3}%$/.exec(w) || w == "auto" || /^\d+px$/.exec(w);
return /^\d{1,3}(\.\d)?%$/.exec(w) || w == "auto" || /^\d+px$/.exec(w);
}
},
@ -1129,7 +1129,10 @@ if (!_global.BI) {
hr -= 12;
}
break;
case "%Q":
case "%q":
m = (parseInt(a[i], 10) - 1) * 3;
break;
case "%M":
min = parseInt(a[i], 10);
break;

6
src/core/controller/controller.popover.js

@ -103,8 +103,8 @@ BI.PopoverController = BI.inherit(BI.Controller, {
top = 0;
}
popover.element.css({
left: left + "px",
top: top + "px"
left: left / BI.pixRatio + BI.pixUnit,
top: top / BI.pixRatio + BI.pixUnit
});
}
return this;
@ -153,4 +153,4 @@ BI.PopoverController = BI.inherit(BI.Controller, {
this.zindexMap = {};
return this;
}
});
});

6
src/core/controller/controller.resizer.js

@ -18,7 +18,11 @@ BI.ResizeController = BI.inherit(BI.Controller, {
self._resize(ev);
// }
}, 30);
BI.Widget._renderEngine.createElement(_global).resize(fn);
if ("onorientationchange" in _global) {
_global.onorientationchange = fn;
} else {
BI.Widget._renderEngine.createElement(_global).resize(fn);
}
},
_resize: function (ev) {

6
src/core/controller/controller.tooltips.js

@ -99,8 +99,8 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
!opt.belowMouse && (y = Math.max(y, top));
}
tooltip.element.css({
left: x < 0 ? 0 : x + "px",
top: y < 0 ? 0 : y + "px"
left: x < 0 ? 0 : x / BI.pixRatio + BI.pixUnit,
top: y < 0 ? 0 : y / BI.pixRatio + BI.pixUnit
});
tooltip.element.hover(function () {
self.remove(name);
@ -137,4 +137,4 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
delete this.tooltipsManager[name];
return this;
}
});
});

1
src/core/func/date.js

@ -193,6 +193,7 @@ _.extend(BI, {
s["%y"] = yWith4number.substr(2, 2); // year without the century (range 00 to 99)
s["%Y"] = yWith4number; // year with the century
s["%%"] = "%"; // a literal '%' character
s["%q"] = "0" + qr;
s["%Q"] = qr;
var re = /%./g;

68
src/core/platform/web/config.js

@ -21,32 +21,29 @@ BI.prepares.push(function () {
// 在横向自适应场景下我们需要使用table的自适应撑出滚动条的特性(flex处理不了这种情况)
// 主要出现在center_adapt或者horizontal_adapt的场景,或者主动设置horizontalAlign的场景
if (ob.horizontalAlign === BI.HorizontalAlign.Center || ob.horizontalAlign === BI.HorizontalAlign.Stretch) {
return BI.extend(ob, {type: "bi.table_adapt"});
return BI.extend({}, ob, {type: "bi.table_adapt"});
}
if (!isIE && supportFlex) {
return BI.extend(ob, {type: "bi.flex_horizontal"});
}
// 解决使用inline_vertical_adapt的顺序问题
// 从右往左放置时,为了兼容,我们统一采用从右到左的放置方式
if (ob.horizontalAlign === BI.HorizontalAlign.Right) {
return BI.extend({verticalAlign: BI.VerticalAlign.Top}, ob, {
type: "bi.inline_vertical_adapt",
items: ob.items && ob.items.reverse()
});
}
return BI.extend(ob, {type: "bi.table_adapt"});
return BI.extend({}, ob, {type: "bi.flex_horizontal"});
}
// // 解决使用inline_vertical_adapt的顺序问题
// // 从右往左放置时,为了兼容,我们统一采用从右到左的放置方式
// if (ob.horizontalAlign === BI.HorizontalAlign.Right) {
// return BI.extend({verticalAlign: BI.VerticalAlign.Top}, ob, {
// type: "bi.inline_vertical_adapt",
// items: ob.items && ob.items.reverse()
// });
// }
return BI.extend({}, ob, {type: "bi.table_adapt"});
});
BI.Plugin.configWidget("bi.center_adapt", function (ob) {
var isIE = BI.isIE(), supportFlex = isSupportFlex(), justOneItem = (ob.items && ob.items.length <= 1);
var isAdapt = !ob.horizontalAlign || ob.horizontalAlign === BI.HorizontalAlign.Center || ob.horizontalAlign === BI.HorizontalAlign.Stretch;
if (!isAdapt || justOneItem) {
if (!isIE && supportFlex) {
return BI.extend(ob, {type: "bi.flex_center_adapt"});
}
if (ob.horizontalAlign === BI.HorizontalAlign.Right) {
return BI.extend(ob, {type: "bi.inline_center_adapt", items: ob.items && ob.items.reverse()});
return BI.extend({}, ob, {type: "bi.flex_center_adapt"});
}
return BI.extend(ob, {type: "bi.inline_center_adapt"});
return BI.extend({}, ob, {type: "bi.inline_center_adapt"});
}
return ob;
});
@ -55,12 +52,9 @@ BI.prepares.push(function () {
var isAdapt = ob.horizontalAlign === BI.HorizontalAlign.Center || ob.horizontalAlign === BI.HorizontalAlign.Stretch;
if (!isAdapt || justOneItem) {
if (!isIE && supportFlex) {
return BI.extend(ob, {type: "bi.flex_vertical_center_adapt"});
return BI.extend({}, ob, {type: "bi.flex_vertical_center_adapt"});
}
if (ob.horizontalAlign === BI.HorizontalAlign.Right) {
return BI.extend(ob, {type: "bi.inline_vertical_adapt", items: ob.items && ob.items.reverse()});
}
return BI.extend(ob, {type: "bi.inline_vertical_adapt"});
return BI.extend({}, ob, {type: "bi.inline_vertical_adapt"});
}
return ob;
});
@ -68,64 +62,64 @@ BI.prepares.push(function () {
var justOneItem = (ob.items && ob.items.length <= 1);
if (!ob.verticalAlign || ob.verticalAlign === BI.VerticalAlign.TOP) {
if (justOneItem) {
return BI.extend(ob, {type: "bi.horizontal_auto"});
return BI.extend({}, ob, {type: "bi.horizontal_auto"});
}
}
return ob;
});
BI.Plugin.configWidget("bi.horizontal_float", function (ob) {
if (!BI.isIE() && isSupportFlex()) {
return BI.extend(ob, {type: "bi.flex_horizontal_adapt"});
return BI.extend({}, ob, {type: "bi.flex_horizontal_adapt"});
}
return BI.extend(ob, {type: "bi.inline_horizontal_adapt"});
return BI.extend({}, ob, {type: "bi.inline_horizontal_adapt"});
});
BI.Plugin.configWidget("bi.flex_horizontal", function (ob) {
if (ob.scrollable === true || ob.scrolly === true) {
return BI.extend(ob, {type: "bi.flex_scrollable_horizontal"});
return BI.extend({}, ob, {type: "bi.flex_scrollable_horizontal"});
}
});
BI.Plugin.configWidget("bi.flex_vertical", function (ob) {
if (ob.scrollable === true || ob.scrollx === true) {
return BI.extend(ob, {type: "bi.flex_scrollable_vertical"});
return BI.extend({}, ob, {type: "bi.flex_scrollable_vertical"});
}
});
BI.Plugin.configWidget("bi.flex_horizontal_adapt", function (ob) {
if (ob.scrollable === true || ob.scrollx === true) {
return BI.extend(ob, {type: "bi.flex_scrollable_horizontal_adapt"});
return BI.extend({}, ob, {type: "bi.flex_scrollable_horizontal_adapt"});
}
});
BI.Plugin.configWidget("bi.flex_vertical_adapt", function (ob) {
if (ob.scrollable === true || ob.scrolly === true) {
return BI.extend(ob, {type: "bi.flex_scrollable_vertical_adapt"});
return BI.extend({}, ob, {type: "bi.flex_scrollable_vertical_adapt"});
}
});
BI.Plugin.configWidget("bi.flex_horizontal_center_adapt", function (ob) {
if (ob.scrollable === true || ob.scrollx === true) {
return BI.extend(ob, {type: "bi.flex_scrollable_horizontal_adapt"});
return BI.extend({}, ob, {type: "bi.flex_scrollable_horizontal_adapt"});
}
});
BI.Plugin.configWidget("bi.flex_vertical_center_adapt", function (ob) {
if (ob.scrollable === true || ob.scrolly === true) {
return BI.extend(ob, {type: "bi.flex_scrollable_vertical_adapt"});
return BI.extend({}, ob, {type: "bi.flex_scrollable_vertical_adapt"});
}
});
BI.Plugin.configWidget("bi.flex_center_adapt", function (ob) {
if (ob.scrollable === true || ob.scrolly === true || ob.scrollx === true) {
return BI.extend(ob, {type: "bi.flex_scrollable_center_adapt"});
return BI.extend({}, ob, {type: "bi.flex_scrollable_center_adapt"});
}
});
BI.Plugin.configWidget("bi.radio", function (ob) {
if (BI.isIE() && BI.getIEVersion() < 9) {
return BI.extend(ob, {type: "bi.image_radio"});
if (BI.isIE() && BI.getIEVersion() <= 9) {
return BI.extend({}, ob, {type: "bi.image_radio"});
}
return ob;
});
BI.Plugin.configWidget("bi.checkbox", function (ob) {
if (BI.isIE() && BI.getIEVersion() < 9) {
return BI.extend(ob, {type: "bi.image_checkbox"});
if (BI.isIE() && BI.getIEVersion() <= 9) {
return BI.extend({}, ob, {type: "bi.image_checkbox"});
}
return ob;
});
@ -134,6 +128,6 @@ BI.prepares.push(function () {
if (BI.isIE() && BI.getIEVersion() < 9) {
return ob;
}
return BI.extend(ob, {type: "bi.half_button"});
return BI.extend({}, ob, {type: "bi.half_button"});
});
});

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

@ -380,18 +380,30 @@
return windowBounds.height - combo.element.offset().top - combo.element.bounds().height >= combo.element.offset().top;
},
getLeftAlignPosition: function (combo, popup, extraWidth) {
_getLeftAlignPosition: function (combo, popup, extraWidth) {
var viewBounds = popup.element.bounds(),
windowBounds = BI.Widget._renderEngine.createElement("body").bounds();
var left = combo.element.offset().left + extraWidth;
if (left + viewBounds.width > windowBounds.width) {
left = windowBounds.width - viewBounds.width;
}
return left;
},
getLeftAlignPosition: function (combo, popup, extraWidth) {
var left = this._getLeftAlignPosition(combo, popup, extraWidth);
var dir = "";
// 如果放不下,优先使用RightAlign, 如果RightAlign也放不下, 再使用left=0
if (left < 0) {
left = this._getRightAlignPosition(combo, popup, extraWidth);
dir = "left";
}
if (left < 0) {
left = 0;
}
return {
left: left
left: left,
dir: dir || "right"
};
},
@ -404,14 +416,25 @@
};
},
getRightAlignPosition: function (combo, popup, extraWidth) {
_getRightAlignPosition: function (combo, popup, extraWidth) {
var comboBounds = combo.element.bounds(), viewBounds = popup.element.bounds();
var left = combo.element.offset().left + comboBounds.width - viewBounds.width - extraWidth;
return combo.element.offset().left + comboBounds.width - viewBounds.width - extraWidth;
},
getRightAlignPosition: function (combo, popup, extraWidth) {
var left = this._getRightAlignPosition(combo, popup, extraWidth);
var dir = "";
// 如果放不下,优先使用LeftAlign, 如果LeftAlign也放不下, 再使用left=0
if (left < 0) {
left = this._getLeftAlignPosition(combo, popup, extraWidth);
dir = "right";
}
if (left < 0) {
left = 0;
}
return {
left: left
left: left,
dir: dir || "left"
};
},
@ -428,12 +451,16 @@
var comboOffset = combo.element.offset();
var comboBounds = combo.element.bounds(), popupBounds = popup.element.bounds(),
windowBounds = BI.Widget._renderEngine.createElement("body").bounds();
var top, adaptHeight;
var top, adaptHeight, dir;
if (BI.DOM.isBottomSpaceEnough(combo, popup, -1 * comboBounds.height + extraHeight)) {
top = comboOffset.top + extraHeight;
} else if (needAdaptHeight) {
top = comboOffset.top + extraHeight;
adaptHeight = windowBounds.height - top;
} else if (BI.DOM.isTopSpaceEnough(combo, popup, -1 * comboBounds.height + extraHeight)) {
// 下方空间不足且不允许调整高度的情况下,优先使用上对齐
top = comboOffset.top + comboBounds.height - popupBounds.height - extraHeight;
dir = "top";
} else {
top = windowBounds.height - popupBounds.height;
if (top < extraHeight) {
@ -445,9 +472,11 @@
}
return adaptHeight ? {
top: top,
adaptHeight: adaptHeight
adaptHeight: adaptHeight,
dir: dir || "bottom"
} : {
top: top
top: top,
dir: dir || "bottom"
};
},
@ -478,12 +507,16 @@
var comboOffset = combo.element.offset();
var comboBounds = combo.element.bounds(), popupBounds = popup.element.bounds(),
windowBounds = BI.Widget._renderEngine.createElement("body").bounds();
var top, adaptHeight;
var top, adaptHeight, dir;
if (BI.DOM.isTopSpaceEnough(combo, popup, -1 * comboBounds.height + extraHeight)) {
top = comboOffset.top + comboBounds.height - popupBounds.height - extraHeight;
} else if (needAdaptHeight) {
top = 0;
adaptHeight = comboOffset.top + comboBounds.height - extraHeight;
} else if (BI.DOM.isBottomSpaceEnough(combo, popup, -1 * comboBounds.height + extraHeight)) {
// 上方空间不足且不允许调整高度的情况下,优先使用下对齐
top = comboOffset.top + extraHeight;
dir = "bottom";
} else {
top = 0;
if (popupBounds.height + extraHeight > windowBounds.height) {
@ -495,9 +528,11 @@
}
return adaptHeight ? {
top: top,
adaptHeight: adaptHeight
adaptHeight: adaptHeight,
dir: dir || "top"
} : {
top: top
top: top,
dir: dir || "top"
};
},
@ -601,11 +636,10 @@
left = BI.DOM.getLeftPosition(combo, popup, tW).left;
if (topBottom[0] === "bottom") {
pos = BI.DOM.getTopAlignPosition(combo, popup, tH, needAdaptHeight);
pos.dir = "left,bottom";
} else {
pos = BI.DOM.getBottomAlignPosition(combo, popup, tH, needAdaptHeight);
pos.dir = "left,top";
}
pos.dir = "left," + pos.dir;
if (tbFirst) {
pos.change = "left";
}
@ -622,11 +656,10 @@
left = BI.DOM.getRightPosition(combo, popup, tW).left;
if (topBottom[0] === "bottom") {
pos = BI.DOM.getTopAlignPosition(combo, popup, tH, needAdaptHeight);
pos.dir = "right,bottom";
} else {
pos = BI.DOM.getBottomAlignPosition(combo, popup, tH, needAdaptHeight);
pos.dir = "right,top";
}
pos.dir = "right," + pos.dir;
if (tbFirst) {
pos.change = "right";
}
@ -642,11 +675,10 @@
top = BI.DOM.getTopPosition(combo, popup, tH).top;
if (leftRight[0] === "right") {
pos = BI.DOM.getLeftAlignPosition(combo, popup, tW, needAdaptHeight);
pos.dir = "top,right";
} else {
pos = BI.DOM.getRightAlignPosition(combo, popup, tW);
pos.dir = "top,left";
}
pos.dir = "top," + pos.dir;
if (lrFirst) {
pos.change = "top";
}
@ -664,11 +696,10 @@
top = BI.DOM.getBottomPosition(combo, popup, tH).top;
if (leftRight[0] === "right") {
pos = BI.DOM.getLeftAlignPosition(combo, popup, tW, needAdaptHeight);
pos.dir = "bottom,right";
} else {
pos = BI.DOM.getRightAlignPosition(combo, popup, tW);
pos.dir = "bottom,left";
}
pos.dir = "bottom," + pos.dir;
if (lrFirst) {
pos.change = "bottom";
}
@ -687,11 +718,10 @@
left = BI.DOM.getInnerLeftPosition(combo, popup, tW).left;
if (topBottom[0] === "bottom") {
pos = BI.DOM.getTopAlignPosition(combo, popup, tH, needAdaptHeight);
pos.dir = "innerLeft,bottom";
} else {
pos = BI.DOM.getBottomAlignPosition(combo, popup, tH, needAdaptHeight);
pos.dir = "innerLeft,top";
}
pos.dir = "innerLeft," + pos.dir;
if (tbFirst) {
pos.change = "innerLeft";
}
@ -708,11 +738,10 @@
left = BI.DOM.getInnerRightPosition(combo, popup, tW).left;
if (topBottom[0] === "bottom") {
pos = BI.DOM.getTopAlignPosition(combo, popup, tH, needAdaptHeight);
pos.dir = "innerRight,bottom";
} else {
pos = BI.DOM.getBottomAlignPosition(combo, popup, tH, needAdaptHeight);
pos.dir = "innerRight,top";
}
pos.dir = "innerLeft," + pos.dir;
if (tbFirst) {
pos.change = "innerRight";
}
@ -740,12 +769,12 @@
if (topBottom[0] === "bottom") {
pos = BI.DOM.getTopAlignPosition(combo, popup, extraHeight, needAdaptHeight);
pos.left = left;
pos.dir = firstDir + ",bottom";
pos.dir = firstDir + "," + pos.dir;
return pos;
}
pos = BI.DOM.getBottomAlignPosition(combo, popup, extraHeight, needAdaptHeight);
pos.left = left;
pos.dir = firstDir + ",top";
pos.dir = firstDir + "," + pos.dir;
return pos;
default :
if (BI.DOM.isBottomSpaceLarger(combo)) {
@ -758,12 +787,12 @@
if (leftRight[0] === "right") {
left = BI.DOM.getLeftAlignPosition(combo, popup, extraWidth, needAdaptHeight).left;
pos.left = left;
pos.dir = firstDir + ",right";
pos.dir = firstDir + "," + pos.dir;
return pos;
}
left = BI.DOM.getRightAlignPosition(combo, popup, extraWidth).left;
pos.left = left;
pos.dir = firstDir + ",left";
pos.dir = firstDir + "," + pos.dir;
return pos;
}
},

5
src/core/shortcut.js

@ -24,6 +24,7 @@
}
var widget = new cls();
widget._initProps(config);
widget._constructed();
widget._initRoot();
// if (!lazy || config.element || config.root) {
widget._lazyConstructor();
@ -60,7 +61,7 @@
BI.Plugin.getObject(el.type, this);
}
}]);
return w.type === el.type ? createWidget(w, context, lazy) : BI.createWidget(BI.extend({}, item, {type: w.type}), options, context, lazy);
return w.type === el.type ? createWidget(w, context, lazy) : BI.createWidget(BI.extend({/**important**/}, el, {type: w.type}), options, context, lazy);
}
if (item.el && (item.el.type || options.type)) {
el = BI.extend({}, options, item.el);
@ -71,7 +72,7 @@
BI.Plugin.getObject(el.type, this);
}
}]);
return w.type === el.type ? createWidget(w, context, lazy) : BI.createWidget(BI.extend({}, item, {type: w.type}), options, context, lazy);
return w.type === el.type ? createWidget(w, context, lazy) : BI.createWidget(BI.extend({/**important**/}, el, {type: w.type}), options, context, lazy);
}
if (BI.isWidget(item.el)) {
return item.el;

4
src/core/var.js

@ -12,6 +12,8 @@ _.extend(BI, {
zIndex_masker: 1e8,
zIndex_tip: 1e9,
emptyStr: "",
pixUnit: "px",
pixRatio: 1,
emptyFn: function () {
},
empty: null,
@ -134,4 +136,4 @@ _.extend(BI, {
Stretch: "stretch"
},
StartOfWeek: 1
});
});

31
src/core/widget.js

@ -7,7 +7,7 @@
*/
!(function () {
function callLifeHook (self, life) {
function callLifeHook(self, life) {
var hook = self.options[life] || self[life];
if (hook) {
var hooks = BI.isArray(hook) ? hook : [hook];
@ -36,18 +36,23 @@
});
},
// 覆盖父类的_constructor方法,widget不走ob的生命周期
_constructor: function () {
},
// 覆盖父类的_constructor方法,widget不走ob的生命周期
_constructed: function () {
if (this.setup) {
pushTarget(this);
this.render = this.setup();
this.service = this.setup(this.options);
this.render = BI.isPlainObject(this.service) ? this.service.render : this.service;
popTarget();
}
},
_lazyConstructor: function () {
if (!this._constructed) {
this._constructed = true;
if (!this.__constructed) {
this.__constructed = true;
this._init();
this._initRef();
}
@ -148,14 +153,14 @@
_initElementWidth: function () {
var o = this.options;
if (BI.isWidthOrHeight(o.width)) {
this.element.css("width", o.width);
this.element.css("width", BI.isNumber(o.width) ? o.width / BI.pixRatio + BI.pixUnit : o.width);
}
},
_initElementHeight: function () {
var o = this.options;
if (BI.isWidthOrHeight(o.height)) {
this.element.css("height", o.height);
this.element.css("height", BI.isNumber(o.height) ? o.height / BI.pixRatio + BI.pixUnit : o.height);
}
},
@ -192,9 +197,11 @@
}
if (BI.isArray(els)) {
BI.each(els, function (i, el) {
BI._lazyCreateWidget(el, {
element: self
});
if (el) {
BI._lazyCreateWidget(el, {
element: self
});
}
});
}
// if (this._isRoot === true || !(this instanceof BI.Layout)) {
@ -527,12 +534,12 @@
BI.Widget.context = context = contextStack.pop();
};
function pushTarget (_current) {
function pushTarget(_current) {
if (current) currentStack.push(current);
BI.Widget.current = current = _current;
}
function popTarget () {
function popTarget() {
BI.Widget.current = current = currentStack.pop();
}

8
src/core/wrapper/layout.js

@ -25,16 +25,16 @@ BI.Layout = BI.inherit(BI.Widget, {
_init4Margin: function () {
if (this.options.top) {
this.element.css("top", this.options.top);
this.element.css("top", BI.isNumber(this.options.top) ? this.options.top / BI.pixRatio + BI.pixUnit : this.options.top);
}
if (this.options.left) {
this.element.css("left", this.options.left);
this.element.css("left", BI.isNumber(this.options.left) ? this.options.left / BI.pixRatio + BI.pixUnit : this.options.left);
}
if (this.options.bottom) {
this.element.css("bottom", this.options.bottom);
this.element.css("bottom", BI.isNumber(this.options.bottom) ? this.options.bottom / BI.pixRatio + BI.pixUnit : this.options.bottom);
}
if (this.options.right) {
this.element.css("right", this.options.right);
this.element.css("right", BI.isNumber(this.options.right) ? this.options.right / BI.pixRatio + BI.pixUnit : this.options.right);
}
},

12
src/core/wrapper/layout/adapt/absolute.center.js

@ -6,7 +6,7 @@
BI.AbsoluteCenterLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.AbsoluteCenterLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-absolute-center-layout",
baseCls: "bi-abs-c-a",
hgap: 0,
lgap: 0,
rgap: 0,
@ -26,10 +26,10 @@ BI.AbsoluteCenterLayout = BI.inherit(BI.Layout, {
var w = BI.AbsoluteCenterLayout.superclass._addElement.apply(this, arguments);
w.element.css({
position: "absolute",
left: o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0),
right: o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0),
top: o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0),
bottom: o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0),
left: (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit,
right: (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit,
top: (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit,
bottom: (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit,
margin: "auto"
});
return w;
@ -44,4 +44,4 @@ BI.AbsoluteCenterLayout = BI.inherit(BI.Layout, {
this._mount();
}
});
BI.shortcut("bi.absolute_center_adapt", BI.AbsoluteCenterLayout);
BI.shortcut("bi.absolute_center_adapt", BI.AbsoluteCenterLayout);

12
src/core/wrapper/layout/adapt/absolute.horizontal.js

@ -6,7 +6,7 @@
BI.AbsoluteHorizontalLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.AbsoluteHorizontalLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-absolute-horizontal-layout",
baseCls: "bi-abs-h-a",
hgap: 0,
lgap: 0,
rgap: 0,
@ -26,15 +26,15 @@ BI.AbsoluteHorizontalLayout = BI.inherit(BI.Layout, {
var w = BI.AbsoluteHorizontalLayout.superclass._addElement.apply(this, arguments);
w.element.css({
position: "absolute",
left: o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0),
right: o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0),
left: (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit,
right: (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit,
margin: "auto"
});
if (o.vgap + o.tgap + (item.vgap || 0) + (item.tgap || 0) !== 0) {
w.element.css("top", o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0));
w.element.css("top", (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit);
}
if (o.vgap + o.bgap + (item.vgap || 0) + (item.bgap || 0) !== 0) {
w.element.css("bottom", o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0));
w.element.css("bottom", (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit);
}
return w;
},
@ -48,4 +48,4 @@ BI.AbsoluteHorizontalLayout = BI.inherit(BI.Layout, {
this._mount();
}
});
BI.shortcut("bi.absolute_horizontal_adapt", BI.AbsoluteHorizontalLayout);
BI.shortcut("bi.absolute_horizontal_adapt", BI.AbsoluteHorizontalLayout);

16
src/core/wrapper/layout/adapt/absolute.vertical.js

@ -6,7 +6,7 @@
BI.AbsoluteVerticalLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.AbsoluteVerticalLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-absolute-vertical-layout",
baseCls: "bi-abs-v-a",
hgap: 0,
lgap: 0,
rgap: 0,
@ -26,17 +26,17 @@ BI.AbsoluteVerticalLayout = BI.inherit(BI.Layout, {
var w = BI.AbsoluteVerticalLayout.superclass._addElement.apply(this, arguments);
w.element.css({
position: "absolute",
left: item.lgap,
right: item.rgap,
top: o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0),
bottom: o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0),
left: item.lgap / BI.pixRatio + BI.pixUnit,
right: item.rgap / BI.pixRatio + BI.pixUnit,
top: (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit,
bottom: (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit,
margin: "auto"
});
if (o.hgap + o.lgap + (item.hgap || 0) + (item.lgap || 0) !== 0) {
w.element.css("left", o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0));
w.element.css("left", (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit);
}
if (o.hgap + o.rgap + (item.hgap || 0) + (item.rgap || 0) !== 0) {
w.element.css("right", o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0));
w.element.css("right", (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit);
}
return w;
},
@ -50,4 +50,4 @@ BI.AbsoluteVerticalLayout = BI.inherit(BI.Layout, {
this._mount();
}
});
BI.shortcut("bi.absolute_vertical_adapt", BI.AbsoluteVerticalLayout);
BI.shortcut("bi.absolute_vertical_adapt", BI.AbsoluteVerticalLayout);

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

@ -6,7 +6,7 @@
BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-center-adapt-layout",
baseCls: "bi-c-a",
horizontalAlign: BI.HorizontalAlign.Center,
columnSize: [],
scrollx: false,

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

@ -6,7 +6,7 @@
BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.HorizontalAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-horizontal-adapt-layout",
baseCls: "bi-h-a",
verticalAlign: BI.VerticalAlign.Top,
columnSize: [],
scrollx: false,

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

@ -10,14 +10,20 @@
BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.LeftRightVerticalAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-left-right-vertical-adapt-layout",
baseCls: "bi-lr-v-a",
items: {},
llgap: 0,
lrgap: 0,
lhgap: 0,
ltgap: 0,
lbgap: 0,
lvgap: 0,
rlgap: 0,
rrgap: 0,
rhgap: 0
rhgap: 0,
rtgap: 0,
rbgap: 0,
rvgap: 0
});
},
render: function () {
@ -30,11 +36,17 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
items: [{
el: {
type: "bi.vertical_adapt",
ref: function (_ref) {
self.left = _ref;
},
height: "100%",
items: o.items.left,
hgap: o.lhgap,
lgap: o.llgap,
rgap: o.lrgap
rgap: o.lrgap,
tgap: o.ltgap,
bgap: o.lbgap,
vgap: o.lvgap
}
}]
});
@ -45,12 +57,17 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
items: [{
el: {
type: "bi.vertical_adapt",
ref: function (_ref) {
self.right = _ref;
},
height: "100%",
items: o.items.right,
textAlign: "right",
hgap: o.rhgap,
lgap: o.rlgap,
rgap: o.rrgap
rgap: o.rrgap,
tgap: o.rtgap,
bgap: o.rbgap,
vgap: o.rvgap
}
}]
});
@ -68,8 +85,8 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
},
populate: function (items) {
BI.LeftRightVerticalAdaptLayout.superclass.populate.apply(this, arguments);
this._mount();
this.left.populate(items.left);
this.right.populate(items.right);
}
});
BI.shortcut("bi.left_right_vertical_adapt", BI.LeftRightVerticalAdaptLayout);
@ -78,31 +95,34 @@ BI.shortcut("bi.left_right_vertical_adapt", BI.LeftRightVerticalAdaptLayout);
BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.LeftRightVerticalAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-left-vertical-adapt-layout",
baseCls: "bi-l-v-a",
items: [],
lgap: 0,
rgap: 0,
hgap: 0
hgap: 0,
tgap: 0,
bgap: 0,
vgap: 0
});
},
render: function () {
var o = this.options, self = this;
BI.LeftVerticalAdaptLayout.superclass.render.apply(this, arguments);
return {
type: "bi.left",
type: "bi.vertical_adapt",
ref: function (_ref) {
self.layout = _ref;
},
items: [{
el: {
type: "bi.vertical_adapt",
height: "100%",
items: o.items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
}
}]
items: o.items,
hgap: o.hgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
vgap: o.vgap,
scrollx: o.scrollx,
scrolly: o.scrolly,
scrollable: o.scrollable
};
},
@ -124,32 +144,35 @@ BI.shortcut("bi.left_vertical_adapt", BI.LeftVerticalAdaptLayout);
BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.RightVerticalAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-right-vertical-adapt-layout",
baseCls: "bi-r-v-a",
items: [],
lgap: 0,
rgap: 0,
hgap: 0
hgap: 0,
tgap: 0,
bgap: 0,
vgap: 0
});
},
render: function () {
var o = this.options, self = this;
BI.RightVerticalAdaptLayout.superclass.render.apply(this, arguments);
return {
type: "bi.right",
type: "bi.vertical_adapt",
ref: function (_ref) {
self.layout = _ref;
},
items: [{
el: {
type: "bi.vertical_adapt",
height: "100%",
textAlign: "right",
items: o.items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
}
}]
horizontalAlign: BI.HorizontalAlign.Right,
items: o.items,
hgap: o.hgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
vgap: o.vgap,
scrollx: o.scrollx,
scrolly: o.scrolly,
scrollable: o.scrollable
};
},
@ -163,7 +186,7 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, {
},
populate: function (items) {
this.layout.populate.apply(this, arguments);
this.layout.populate(items);
}
});
BI.shortcut("bi.right_vertical_adapt", BI.RightVerticalAdaptLayout);
BI.shortcut("bi.right_vertical_adapt", BI.RightVerticalAdaptLayout);

14
src/core/wrapper/layout/adapt/adapt.table.js

@ -6,7 +6,7 @@
BI.TableAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.TableAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-table-adapt-layout",
baseCls: "bi-t-a",
columnSize: [],
verticalAlign: BI.VerticalAlign.Top,
horizontalAlign: BI.HorizontalAlign.Left,
@ -35,7 +35,7 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, {
_addElement: function (i, item) {
var o = this.options;
var td;
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
var width = o.columnSize[i] <= 1 ? ((o.columnSize[i] * 100).toFixed(1) + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) {
var w = BI._lazyCreateWidget(item);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
@ -53,7 +53,7 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, {
// 1、由于直接对td设置最大宽度是在规范中未定义的, 所以要使用类似td:firstChild来迂回实现
// 2、不能给多个td设置最大宽度,这样只会平分宽度
// 3、多百分比宽度就算了
td.element.css({"max-width": o.columnSize[i] <= 1 ? width : width + "px"});
td.element.css({"max-width": BI.isNumber(o.columnSize[i]) ? (o.columnSize[i] <= 1 ? width : width / BI.pixRatio + BI.pixUnit) : width});
if (i === 0) {
td.element.addClass("first-element");
}
@ -67,22 +67,22 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, {
});
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
"margin-top": (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) + "px"
"margin-left": ((i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
"margin-right": (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
"margin-bottom": (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit
});
}
return td;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save