Browse Source

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

* commit '13bd30b321df8e81a82932d8c42bd22c8485b518': (232 commits)
  Update src/less/lib/constant.less
  chore: 去掉ie6-8字体支持
  REPORT-73699 fix: 允许编辑时外部传递进来的text可能是一个方法
  无JIRA 修改配置
  auto upgrade version to 2.0.20220617213406
  无JIRA 同步
  无JIRA任务 simple
  auto upgrade version to 2.0.20220617172333
  无JIRA 同步
  auto upgrade version to 2.0.20220617145310
  无JIRA 同步
  无JIRA任务 暗色系popover头背景
  auto upgrade version to 2.0.20220617120359
  auto upgrade version to 2.0.20220617115451
  auto upgrade version to 2.0.20220617114413
  DESIGN-3918 feat: 拓展box-shadow,允许配置常量一样自定义个阴影效果
  无JIRA 同步
  无JIRA任务 同步lessconfig
  auto upgrade version to 2.0.20220616223849
  无JIRA任务 simple
  ...
master
superman 3 years ago
parent
commit
1b7c9d8815
  1. 22
      bi.lessconfig.json
  2. 15
      changelog.md
  3. 96
      demo/js/base/button/demo.button.js
  4. 206
      dist/fix/fix.js
  5. BIN
      dist/font/iconfont.eot
  6. 468
      dist/font/iconfont.svg
  7. BIN
      dist/font/iconfont.ttf
  8. BIN
      dist/font/iconfont.woff
  9. BIN
      dist/font/iconfont.woff2
  10. 2
      package.json
  11. 2
      src/base/combination/searcher.js
  12. 8
      src/base/grid/grid.js
  13. 5
      src/base/list/virtualgrouplist.js
  14. 75
      src/base/single/button/buttons/button.js
  15. 5
      src/base/single/button/listitem/blankiconicontextitem.js
  16. 3
      src/base/single/button/listitem/blankicontexticonitem.js
  17. 3
      src/base/single/button/listitem/blankicontextitem.js
  18. 3
      src/base/single/button/listitem/icontexticonitem.js
  19. 3
      src/base/single/button/listitem/icontextitem.js
  20. 3
      src/base/single/button/listitem/texticonitem.js
  21. 3
      src/base/single/button/node/icontexticonnode.js
  22. 3
      src/base/single/button/node/icontextnode.js
  23. 3
      src/base/single/button/node/texticonnode.js
  24. 4
      src/base/single/editor/editor.js
  25. 3
      src/base/single/editor/editor.multifile.js
  26. 18
      src/base/single/input/file.js
  27. 43
      src/base/single/input/input.js
  28. 10
      src/base/single/tip/tip.toast.js
  29. 3
      src/case/button/item.multiselect.js
  30. 13
      src/case/button/item.singleselect.radio.js
  31. 7
      src/case/button/node/node.arrow.js
  32. 2
      src/case/button/node/node.icon.arrow.js
  33. 4
      src/case/button/node/node.plus.js
  34. 3
      src/case/button/switch.js
  35. 16
      src/case/checkbox/check.arrownode.js
  36. 2
      src/case/colorchooser/colorchooser.js
  37. 1
      src/case/colorchooser/colorchooser.simple.js
  38. 2
      src/case/colorchooser/colorchooser.trigger.js
  39. 2
      src/case/colorchooser/colorchooser.trigger.long.js
  40. 12
      src/case/combo/bubblecombo/popup.bubble.js
  41. 2
      src/case/combo/icontextvaluecombo/combo.icontextvalue.js
  42. 58
      src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js
  43. 77
      src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js
  44. 47
      src/case/combo/textvaluecombo/combo.textvalue.js
  45. 5
      src/case/editor/editor.clear.js
  46. 282
      src/case/editor/editor.defaulttext.js
  47. 5
      src/case/editor/editor.shelter.js
  48. 9
      src/case/editor/editor.sign.js
  49. 7
      src/case/layer/panel.js
  50. 4
      src/case/tree/treeexpander/tree.expander.popup.js
  51. 4
      src/case/trigger/trigger.editor.js
  52. 70
      src/case/trigger/trigger.text.js
  53. 32
      src/case/trigger/trigger.text.select.js
  54. 34
      src/case/ztree/0.treeview.js
  55. 25
      src/case/ztree/1.asynctree.js
  56. 19
      src/core/platform/web/config.js
  57. 11
      src/core/system.js
  58. 71
      src/core/wrapper/layout.js
  59. 8
      src/core/wrapper/layout/adapt/absolute.center.js
  60. 34
      src/core/wrapper/layout/adapt/absolute.leftrightvertical.js
  61. 4
      src/core/wrapper/layout/adapt/adapt.table.js
  62. 8
      src/core/wrapper/layout/fill/auto.vtape.js
  63. 28
      src/core/wrapper/layout/fill/float.fill.horizontal.js
  64. 3
      src/core/wrapper/layout/flex/flex.horizontal.js
  65. 26
      src/core/wrapper/layout/flex/flex.leftrightvertical.center.js
  66. 3
      src/core/wrapper/layout/flex/flex.vertical.js
  67. 4
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js
  68. 4
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js
  69. 18
      src/core/wrapper/layout/float/float.absolute.leftrightvertical.js
  70. 36
      src/core/wrapper/layout/layout.flow.js
  71. 8
      src/core/wrapper/layout/layout.inline.js
  72. 24
      src/core/wrapper/layout/layout.tape.js
  73. 4
      src/core/wrapper/layout/layout.td.js
  74. 3
      src/core/wrapper/layout/sticky/sticky.horizontal.js
  75. 3
      src/core/wrapper/layout/sticky/sticky.vertical.js
  76. 4
      src/less/base/colorchooser/colorchooser.trigger.less
  77. 39
      src/less/base/combo/combo.less
  78. 28
      src/less/base/combo/combo.searchtextvalue.less
  79. 14
      src/less/base/combo/combo.textvalue.less
  80. 1
      src/less/base/editor/editor.search.less
  81. 72
      src/less/base/single/button/button.less
  82. 18
      src/less/base/single/tip/tip.toast.less
  83. 40
      src/less/base/tree/tree.expander.less
  84. 15
      src/less/base/trigger/trigger.searchtextvalue.less
  85. 15
      src/less/base/trigger/trigger.text.less
  86. 20
      src/less/core/utils/common.less
  87. 11
      src/less/core/wrapper/flex.horizontal.less
  88. 11
      src/less/core/wrapper/flex.vertical.less
  89. 11
      src/less/core/wrapper/flex.wrapper.horizontal.less
  90. 11
      src/less/core/wrapper/flex.wrapper.vertical.less
  91. 2
      src/less/image.less
  92. 4
      src/less/lib/colors.less
  93. 3
      src/less/lib/constant.less
  94. 1
      src/less/lib/font.less
  95. 23
      src/less/lib/theme.less
  96. 1
      src/less/resource/font.less
  97. 7
      src/less/theme/dark.less
  98. 6
      src/less/visual.less
  99. 28
      src/less/widget/multilayerselecttree/multilayerselecttree.combo.less
  100. 27
      src/less/widget/multilayersingletree/multilayersingletree.combo.less
  101. Some files were not shown because too many files have changed in this diff Show More

22
bi.lessconfig.json

@ -4,21 +4,29 @@
"@color-light-blue-100": "#19B8EA", "@color-light-blue-100": "#19B8EA",
"@color-orange-100": "#FAAA39", "@color-orange-100": "#FAAA39",
"@color-red-100": "#E65251", "@color-red-100": "#E65251",
"@color-black": "#000A19", "@color-black": "#091E40",
"@color-light-gray": "#ECEEF3", "@color-light-gray": "#ECEEF3",
"@color-light-gray-theme-dark": "#292F45", "@color-light-gray-theme-dark": "#292F45",
"@border-color-line": "rgba(9, 30, 64, 0.15)",
"@border-color-light-line": "#E6E9EF",
"@border-color-dark-line": "#2E3A4D", "@border-color-dark-line": "#2E3A4D",
"@color-sliver-theme-dark": "#363E55", "@color-sliver-theme-dark": "#363E55",
"@border-color-disabled": "#E7E8EB", "@border-color-disabled": "rgba(9, 30, 64, 0.07)",
"@font-color-normal": "#091E40",
"@font-color-gray": "rgba(9, 30, 64, 0.9)",
"@font-color-light-gray": "rgba(9, 30, 64, 0.66)",
"@font-color-tips": "rgba(9, 30, 64, 0.47)",
"@font-color-disabled": "rgba(9, 30, 64, 0.25)",
"@background-color-normal": "#F8F9FC",
"@color-bi-background-active-radio": "transparent", "@color-bi-background-active-radio": "transparent",
"@color-bi-border-radio": "rgba(9, 30, 64, 0.37)",
"@color-bi-border-disabled-radio": "rgba(9, 30, 64, 0.19)",
"@color-bi-background-active-radio-content": "#2C60DB", "@color-bi-background-active-radio-content": "#2C60DB",
"@color-bi-background-disabled-active-radio-content": "#D0D4DA", "@color-bi-background-disabled-active-radio-content": "#FFFFFF",
"@color-bi-background-disabled-active-radio-content-theme-dark": "#606479", "@color-bi-background-disabled-active-radio-content-theme-dark": "#606479",
"@color-bi-background-disabled-active-checkbox-content": "#FFFFFF", "@color-bi-background-disabled-active-checkbox-content": "#FFFFFF",
"@color-bi-background-disabled-active-checkbox-content-theme-dark": "#606479", "@color-bi-background-disabled-active-checkbox-content-theme-dark": "#606479",
"@color-bi-background-tooltip-success": "#2E3A4D", "@color-bi-background-tooltip-success": "#2E3A4D",
"@color-bi-text-header-background": "#647185",
"@color-bi-border-tooltip-success": "#2E3A4D", "@color-bi-border-tooltip-success": "#2E3A4D",
"@color-bi-background-toast-success": "#FFFFFF", "@color-bi-background-toast-success": "#FFFFFF",
"@color-bi-background-toast-warning": "#FFFFFF", "@color-bi-background-toast-warning": "#FFFFFF",
@ -28,5 +36,7 @@
"@color-bi-color-toast-warning": "#FAAA39", "@color-bi-color-toast-warning": "#FAAA39",
"@color-bi-color-toast-error": "#E65251", "@color-bi-color-toast-error": "#E65251",
"@color-bi-color-toast-normal": "#2C60DB", "@color-bi-color-toast-normal": "#2C60DB",
"@color-bi-color-toast-text": "#000A19" "@color-bi-color-toast-text": "#000A19",
"@color-bi-text-header-background": "rgba(9, 30, 64, 0.9)",
"@color-bi-text-header-background-theme-dark": "rgba(255, 255, 255, 0.9)"
} }

15
changelog.md

@ -1,4 +1,19 @@
# 更新日志 # 更新日志
3.0(2022-05)
- 下拉选择框支持清空
3.0(2022-03)
- 支持响应式
- 全面支持Typescript
- 增加JSX支持
- 布局组件支持更多动态特性
- 底层API支持动画
- 增加WebWorker支持
- 支持路由
- 插件支持版本控制
- Fix数据流支持proxy版本
2.0(2022-01) 2.0(2022-01)
- 提供自定义表单 - 提供自定义表单

96
demo/js/base/button/demo.button.js

@ -193,6 +193,41 @@ Demo.Button = BI.inherit(BI.Widget, {
ghost: true, ghost: true,
height: 30 height: 30
} }
}, {
el: {
type: "bi.button",
iconCls: "plus-font",
text: "幽灵按钮(common)",
ghost: true,
height: 30
}
}, {
el: {
type: "bi.button",
iconCls: "plus-font",
text: "幽灵按钮(common)",
ghost: true,
level: "warning",
height: 30
}
}, {
el: {
type: "bi.button",
iconCls: "plus-font",
text: "幽灵按钮(common)",
ghost: true,
level: "error",
height: 30
}
}, {
el: {
type: "bi.button",
iconCls: "plus-font",
text: "幽灵按钮(common)",
ghost: true,
level: "success",
height: 30
}
}, { }, {
el: { el: {
type: "bi.button", type: "bi.button",
@ -213,6 +248,67 @@ Demo.Button = BI.inherit(BI.Widget, {
}, },
height: 30 height: 30
} }
}, {
el: {
type: "bi.button",
text: "图标在上面的按钮,而且可以自动撑开高度",
iconCls: "close-font",
iconGap: 24,
iconPosition: "top"
}
}, {
el: {
type: "bi.button",
text: "图标在下面的按钮",
iconCls: "close-font",
iconPosition: "bottom"
}
}, {
el: {
type: "bi.button",
text: "图标在左边的按钮",
iconCls: "close-font",
iconPosition: "left"
}
}, {
el: {
type: "bi.button",
text: "图标在右边的按钮",
iconCls: "close-font",
iconPosition: "right"
}
}, {
el: {
type: "bi.button",
text: "浅色的一般按钮",
iconCls: "plus-font",
light: true
}
}, {
el: {
type: "bi.button",
text: "浅色的成功按钮",
level: "success",
iconCls: "plus-font",
light: true
}
}, {
el: {
type: "bi.button",
text: "浅色的警告按钮",
level: "warning",
iconCls: "plus-font",
light: true
}
}, {
el: {
type: "bi.button",
iconCls: "plus-font",
text: "浅色的失败按钮",
level: "error",
cls: "hover-mask",
light: true
}
}]; }];
// BI.each(items, function (i, item) { // BI.each(items, function (i, item) {
// item.el.handler = function () { // item.el.handler = function () {

206
dist/fix/fix.js vendored

@ -11,47 +11,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
return typeof Ctor === 'function' && /native code/.test(Ctor.toString()); return typeof Ctor === 'function' && /native code/.test(Ctor.toString());
} }
var rhashcode = /\d\.\d{4}/;
//生成UUID http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
function makeHashCode(prefix) {
/* istanbul ignore next*/
prefix = prefix || 'bi';
/* istanbul ignore next*/
return String(Math.random() + Math.random()).replace(rhashcode, prefix);
}
var hasProto = '__proto__' in {}; var hasProto = '__proto__' in {};
var isIE = function isIE() {
if (typeof navigator === "undefined") {
return false;
}
return (/(msie|trident)/i.test(navigator.userAgent.toLowerCase())
);
};
var getIEVersion = function getIEVersion() {
var version = 0;
if (typeof navigator === "undefined") {
return false;
}
var agent = navigator.userAgent.toLowerCase();
var v1 = agent.match(/(?:msie\s([\w.]+))/);
var v2 = agent.match(/(?:trident.*rv:([\w.]+))/);
if (v1 && v2 && v1[1] && v2[1]) {
version = Math.max(v1[1] * 1, v2[1] * 1);
} else if (v1 && v1[1]) {
version = v1[1] * 1;
} else if (v2 && v2[1]) {
version = v2[1] * 1;
} else {
version = 0;
}
return version;
};
var isIE9Below = isIE() && getIEVersion() < 9;
var _toString = Object.prototype.toString; var _toString = Object.prototype.toString;
function isPlainObject(obj) { function isPlainObject(obj) {
@ -266,7 +227,6 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var createViewModel = Object.defineProperties; var createViewModel = Object.defineProperties;
var defineProperty = void 0; var defineProperty = void 0;
var timeBucket = new Date() - 0;
/* istanbul ignore if*/ /* istanbul ignore if*/
if (!canHideProperty) { if (!canHideProperty) {
if ('__defineGetter__' in {}) { if ('__defineGetter__' in {}) {
@ -291,76 +251,6 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
return obj; return obj;
}; };
} }
/* istanbul ignore if*/
if (isIE9Below) {
var VBClassPool = {};
window.execScript([// jshint ignore:line
'Function parseVB(code)', '\tExecuteGlobal(code)', 'End Function' //转换一段文本为VB代码
].join('\n'), 'VBScript');
var VBMediator = function VBMediator(instance, accessors, name, value) {
// jshint ignore:line
var accessor = accessors[name];
if (arguments.length === 4) {
accessor.set.call(instance, value);
} else {
return accessor.get.call(instance);
}
};
createViewModel = function createViewModel(name, accessors, properties) {
// 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');
//添加普通属性,因为VBScript对象不能像JS那样随意增删属性,必须在这里预先定义好
var uniq = {
$vbthis: true,
$vbsetter: true,
$accessors: true
};
for (name in $$skipArray) {
if (!uniq[name]) {
buffer.push('\tPublic [' + name + ']');
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');
}
for (name in properties) {
if (!uniq[name]) {
uniq[name] = true;
buffer.push('\tPublic [' + name + ']');
}
}
buffer.push('\tPublic [hasOwnProperty]');
buffer.push('End Class');
var body = buffer.join('\r\n');
var className = VBClassPool[body];
if (!className) {
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'));
VBClassPool[body] = className;
}
var ret = window[className + 'Factory'](accessors, VBMediator); //得到其产品
return ret; //得到其产品
};
}
} }
var createViewModel$1 = createViewModel; var createViewModel$1 = createViewModel;
@ -700,12 +590,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
} else { } else {
this.model = this.walk(value); this.model = this.walk(value);
} }
if (isIE9Below) {
this.model['__ob__'] = this;
} else {
def(this.model, "__ob__", this); def(this.model, "__ob__", this);
} }
}
Observer.prototype.walk = function walk(obj) { Observer.prototype.walk = function walk(obj) {
return defineReactive(obj, this); return defineReactive(obj, this);
@ -788,53 +674,6 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
function defineReactive(obj, observer, shallow) { function defineReactive(obj, observer, shallow) {
var props = {}; var props = {};
var model = void 0; var model = void 0;
// if (typeof Proxy === 'function') {
// const deps = {}, childObs = {}, cache = {}
// _.each(obj, function (val, key) {
// if (key in $$skipArray) {
// return
// }
// cache[key] = val
// const dep = deps[key] = (observer && observer['__dep' + key]) || new Dep()
// observer && (observer['__dep' + key] = dep)
// childObs[key] = !shallow && observe(val, observer, key)
// })
// return model = new Proxy(props, {
// has: function (target, key) {
// return key in obj;
// },
// get: function (target, key) {
// if (key in $$skipArray) {
// return target[key]
// }
// const value = cache[key]
// if (Dep.target) {
// deps[key].depend()
// if (childObs[key]) {
// childObs[key].dep.depend()
// if (_.isArray(value)) {
// dependArray(value)
// }
// }
// }
// return value
// },
// set: function (target, key, newVal) {
// if (key in $$skipArray) {
// return target[key] = newVal
// }
// const value = cache[key], dep = deps[key]
// if (newVal === value || (newVal !== newVal && value !== value)) {
// return newVal
// }
// cache[key] = newVal
// childObs[key] = !shallow && observe(newVal, observer, key)
// obj[key] = childObs[key] ? childObs[key].model : newVal
// notify(model, key, dep)
// return obj[key]
// }
// })
// }
_.each(obj, function (val, key) { _.each(obj, function (val, key) {
if (key in $$skipArray) { if (key in $$skipArray) {
return; return;
@ -878,6 +717,50 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
return model = createViewModel$1(obj, props); return model = createViewModel$1(obj, props);
} }
function defineReactiveProperty(obj, key, val, shallow) {
var dep = new Dep();
var configurable = isConfigurable(obj, key);
if (!configurable) {
return;
}
if (arguments.length === 2) {
val = obj[key];
}
var childOb = !shallow && observe(val);
Object.defineProperty(obj, key, {
enumerable: true,
configurable: true,
get: function reactiveGetter() {
var value = childOb ? childOb.model : val;
if (Dep.target) {
dep.depend();
if (childOb) {
childOb.dep.depend();
if (_.isArray(value)) {
dependArray(value);
}
}
}
return value;
},
set: function reactiveSetter(newVal) {
var value = childOb ? childOb.model : val;
if (newVal === value || newVal !== newVal && value !== value) {
return;
}
childOb = configurable && !shallow && observe(newVal);
val = newVal;
obj[key] = childOb ? childOb.model : newVal;
dep.notify();
}
});
}
/** /**
* Set a property on an object. Adds the new property and * Set a property on an object. Adds the new property and
* triggers change notification if the property doesn't * triggers change notification if the property doesn't
@ -1522,6 +1405,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
exports.observe = observe; exports.observe = observe;
exports.notify = notify; exports.notify = notify;
exports.defineReactive = defineReactive; exports.defineReactive = defineReactive;
exports.defineReactiveProperty = defineReactiveProperty;
exports.set = set; exports.set = set;
exports.freeze = freeze; exports.freeze = freeze;
exports.del = del; exports.del = del;

BIN
dist/font/iconfont.eot vendored

Binary file not shown.

468
dist/font/iconfont.svg vendored

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 632 KiB

After

Width:  |  Height:  |  Size: 673 KiB

BIN
dist/font/iconfont.ttf vendored

Binary file not shown.

BIN
dist/font/iconfont.woff vendored

Binary file not shown.

BIN
dist/font/iconfont.woff2 vendored

Binary file not shown.

2
package.json

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

2
src/base/combination/searcher.js

@ -183,7 +183,7 @@ BI.Searcher = BI.inherit(BI.Widget, {
keyword: keyword, keyword: keyword,
selectedValues: o.adapter && o.adapter.getValue() selectedValues: o.adapter && o.adapter.getValue()
}, function (searchResult, matchResult) { }, function (searchResult, matchResult) {
if (!self._stop) { if (!self._stop && keyword === self.editor.getValue()) {
var args = [].slice.call(arguments); var args = [].slice.call(arguments);
if (args.length > 0) { if (args.length > 0) {
args.push(keyword); args.push(keyword);

8
src/base/grid/grid.js

@ -130,9 +130,9 @@ BI.GridView = BI.inherit(BI.Widget, {
var visibleColumnIndices = this._columnSizeAndPositionManager.getVisibleCellRange(width, scrollLeft); var visibleColumnIndices = this._columnSizeAndPositionManager.getVisibleCellRange(width, scrollLeft);
var visibleRowIndices = this._rowSizeAndPositionManager.getVisibleCellRange(height, scrollTop); var visibleRowIndices = this._rowSizeAndPositionManager.getVisibleCellRange(height, scrollTop);
if (BI.isEmpty(visibleColumnIndices) || BI.isEmpty(visibleRowIndices)) { var renderedCells = [], renderedKeys = {}, renderedWidgets = {};
return; // 没有可见的单元格就干掉所有渲染过的
} if (!BI.isEmpty(visibleColumnIndices) && !BI.isEmpty(visibleRowIndices)) {
var horizontalOffsetAdjustment = this._columnSizeAndPositionManager.getOffsetAdjustment(width, scrollLeft); var horizontalOffsetAdjustment = this._columnSizeAndPositionManager.getOffsetAdjustment(width, scrollLeft);
var verticalOffsetAdjustment = this._rowSizeAndPositionManager.getOffsetAdjustment(height, scrollTop); var verticalOffsetAdjustment = this._rowSizeAndPositionManager.getOffsetAdjustment(height, scrollTop);
@ -164,7 +164,6 @@ BI.GridView = BI.inherit(BI.Widget, {
return; return;
} }
var renderedCells = [], renderedKeys = {}, renderedWidgets = {};
var minX = this._getMaxScrollLeft(), minY = this._getMaxScrollTop(), maxX = 0, maxY = 0; var minX = this._getMaxScrollLeft(), minY = this._getMaxScrollTop(), maxX = 0, maxY = 0;
var count = 0; var count = 0;
for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) { for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) {
@ -225,6 +224,7 @@ BI.GridView = BI.inherit(BI.Widget, {
count++; count++;
} }
} }
}
// 已存在的, 需要添加的和需要删除的 // 已存在的, 需要添加的和需要删除的
var existSet = {}, addSet = {}, deleteArray = []; var existSet = {}, addSet = {}, deleteArray = [];
BI.each(renderedKeys, function (i, key) { BI.each(renderedKeys, function (i, key) {

5
src/base/list/virtualgrouplist.js

@ -14,6 +14,7 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, {
scrollTop: 0, scrollTop: 0,
rowHeight: "auto", rowHeight: "auto",
items: [], items: [],
el: {},
itemFormatter: function (item, index) { itemFormatter: function (item, index) {
return item; return item;
} }
@ -39,10 +40,10 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, {
ref: function () { ref: function () {
self.container = this; self.container = this;
}, },
layouts: [{ layouts: [BI.extend({
type: "bi.vertical", type: "bi.vertical",
scrolly: false scrolly: false
}] }, o.el)]
}, { }, {
type: "bi.layout", type: "bi.layout",
ref: function () { ref: function () {

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

@ -1,4 +1,9 @@
/** (function () {
function isVertical(position) {
return position === "top" || position === "bottom";
}
/**
* 文字类型的按钮 * 文字类型的按钮
* @class BI.Button * @class BI.Button
* @extends BI.BasicButton * @extends BI.BasicButton
@ -6,21 +11,23 @@
* @cfg {JSON} options 配置属性 * @cfg {JSON} options 配置属性
* @cfg {'common'/'success'/'warning'/'ignore'} [options.level='common'] 按钮类型用不同颜色强调不同的场景 * @cfg {'common'/'success'/'warning'/'ignore'} [options.level='common'] 按钮类型用不同颜色强调不同的场景
*/ */
BI.Button = BI.inherit(BI.BasicButton, { BI.Button = BI.inherit(BI.BasicButton, {
_const: { _const: {
iconWidth: 18 iconWidth: 16
}, },
_defaultConfig: function (props) { _defaultConfig: function (props) {
var conf = BI.Button.superclass._defaultConfig.apply(this, arguments); var conf = BI.Button.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-button" + ((BI.isIE() && BI.isIE9Below()) ? " hack" : ""), baseCls: (conf.baseCls || "") + " bi-button" + ((BI.isIE() && BI.isIE9Below()) ? " hack" : ""),
attributes: { attributes: {
tabIndex: 1 tabIndex: 1
}, },
minWidth: (props.block === true || props.clear === true) ? 0 : 80, minWidth: (props.block === true || props.clear === true) ? 0 : 80,
height: 24, // 44 = 垂直间距 6 + 边框 2 + 图标 16 + 图标和文字间隔 8 + 文字 12
height: isVertical(props.iconPosition) ? 44 + ((props.iconGap || 8) - 8) : 24,
shadow: props.clear !== true, shadow: props.clear !== true,
isShadowShowingOnSelected: true, isShadowShowingOnSelected: true,
readonly: true, readonly: true,
@ -29,6 +36,8 @@ BI.Button = BI.inherit(BI.BasicButton, {
block: false, // 是否块状显示,即不显示边框,没有最小宽度的限制 block: false, // 是否块状显示,即不显示边框,没有最小宽度的限制
clear: false, // 是否去掉边框和背景 clear: false, // 是否去掉边框和背景
ghost: false, // 是否幽灵显示, 即正常状态无背景 ghost: false, // 是否幽灵显示, 即正常状态无背景
loading: false, // 是否处于加载中
light: false, // 是否使用浅色
textAlign: "center", textAlign: "center",
whiteSpace: "nowrap", whiteSpace: "nowrap",
textWidth: null, textWidth: null,
@ -38,21 +47,27 @@ BI.Button = BI.inherit(BI.BasicButton, {
tgap: 0, tgap: 0,
bgap: 0, bgap: 0,
lgap: 0, lgap: 0,
rgap: 0 rgap: 0,
iconGap: 8,
iconPosition: "left"
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this; var o = this.options;
// 由于button默认情况下有个边框,所以要主动算行高 // 由于button默认情况下有个边框,所以要主动算行高
var lineHeight, textHeight = o.textHeight; var lineHeight, textHeight = o.textHeight;
if (BI.isNumber(o.height)) { if (BI.isNumber(o.height)) {
if (o.clear || o.block) { if (!isVertical(o.iconPosition)) {
if (o.clear || o.block || o.light) {
lineHeight = o.height; lineHeight = o.height;
} else { } else {
lineHeight = o.height - 2; lineHeight = o.height - 2;
} }
} else {
lineHeight = textHeight;
}
} }
if (!textHeight) { if (!textHeight) {
if (o.whiteSpace === "nowrap") { if (o.whiteSpace === "nowrap") {
@ -65,9 +80,7 @@ BI.Button = BI.inherit(BI.BasicButton, {
cls: o.iconCls, cls: o.iconCls,
width: this._const.iconWidth, width: this._const.iconWidth,
height: lineHeight, height: lineHeight,
lineHeight: lineHeight, lineHeight: lineHeight
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
}); });
this.text = BI.createWidget({ this.text = BI.createWidget({
type: "bi.label", type: "bi.label",
@ -77,15 +90,30 @@ BI.Button = BI.inherit(BI.BasicButton, {
height: lineHeight, height: lineHeight,
value: o.value value: o.value
}); });
var layoutType = "bi.horizontal";
var gapContainer = {
lgap: o.iconPosition === "left" && o.text ? o.iconGap : 0,
rgap: o.iconPosition === "right" ? o.iconGap : 0,
tgap: o.iconPosition === "top" ? o.iconGap : 0,
bgap: o.iconPosition === "bottom" ? o.iconGap : 0
};
var items = [this.icon, BI.extend({el: this.text}, gapContainer)];
if (isVertical(o.iconPosition)) {
layoutType = "bi.vertical";
}
if (o.iconPosition === "right" || o.iconPosition === "bottom") {
items = [BI.extend({el: this.text}, gapContainer), this.icon];
}
BI.createWidget({ BI.createWidget({
type: "bi.center_adapt", type: "bi.center_adapt",
element: this, element: this,
hgap: o.hgap, hgap: o.hgap,
vgap: o.vgap, vgap: o.vgap,
items: [{ items: [{
type: "bi.horizontal", type: layoutType,
columnSize: ["", "fill"], horizontalAlign: "center",
items: [this.icon, this.text] verticalAlign: "middle",
items: items
}] }]
}); });
} else { } else {
@ -116,6 +144,12 @@ BI.Button = BI.inherit(BI.BasicButton, {
if (o.ghost === true) { if (o.ghost === true) {
this.element.addClass("ghost"); this.element.addClass("ghost");
} }
if (o.loading === true) {
this.element.addClass("loading");
}
if (o.light === true) {
this.element.addClass("light");
}
if (o.minWidth > 0) { if (o.minWidth > 0) {
this.element.css({"min-width": o.minWidth / BI.pixRatio + BI.pixUnit}); this.element.css({"min-width": o.minWidth / BI.pixRatio + BI.pixUnit});
} }
@ -137,6 +171,14 @@ BI.Button = BI.inherit(BI.BasicButton, {
} }
}, },
setLoading: function (loading) {
if (loading) {
this.element.addClass("loading");
} else {
this.element.removeClass("loading");
}
},
setText: function (text) { setText: function (text) {
BI.Button.superclass.setText.apply(this, arguments); BI.Button.superclass.setText.apply(this, arguments);
this.text.setText(text); this.text.setText(text);
@ -164,6 +206,7 @@ BI.Button = BI.inherit(BI.BasicButton, {
unHighLight: function () { unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments); this.text.unHighLight.apply(this.text, arguments);
} }
}); });
BI.shortcut("bi.button", BI.Button); BI.shortcut("bi.button", BI.Button);
BI.Button.EVENT_CHANGE = "EVENT_CHANGE"; BI.Button.EVENT_CHANGE = "EVENT_CHANGE";
}());

5
src/base/single/button/listitem/blankiconicontextitem.js

@ -10,10 +10,7 @@ BI.BlankIconIconTextItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.BlankIconIconTextItem.superclass._defaultConfig.apply(this, arguments); var conf = BI.BlankIconIconTextItem.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-blank-icon-text-item", baseCls: (conf.baseCls || "") + " bi-blank-icon-icon-text-item",
logic: {
dynamic: false
},
iconCls1: "", iconCls1: "",
iconCls2: "", iconCls2: "",
blankWidth: 0, blankWidth: 0,

3
src/base/single/button/listitem/blankicontexticonitem.js

@ -12,9 +12,6 @@ BI.BlankIconTextIconItem = BI.inherit(BI.BasicButton, {
var conf = BI.BlankIconTextIconItem.superclass._defaultConfig.apply(this, arguments); var conf = BI.BlankIconTextIconItem.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-blank-icon-text-icon-item", baseCls: (conf.baseCls || "") + " bi-blank-icon-text-icon-item",
logic: {
dynamic: false
},
iconCls1: "", iconCls1: "",
iconCls2: "", iconCls2: "",
blankWidth: 0, blankWidth: 0,

3
src/base/single/button/listitem/blankicontextitem.js

@ -11,9 +11,6 @@ BI.BlankIconTextItem = BI.inherit(BI.BasicButton, {
var conf = BI.BlankIconTextItem.superclass._defaultConfig.apply(this, arguments); var conf = BI.BlankIconTextItem.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-blank-icon-text-item", baseCls: (conf.baseCls || "") + " bi-blank-icon-text-item",
logic: {
dynamic: false
},
blankWidth: 0, blankWidth: 0,
iconHeight: null, iconHeight: null,
iconWidth: null, iconWidth: null,

3
src/base/single/button/listitem/icontexticonitem.js

@ -12,9 +12,6 @@ BI.IconTextIconItem = BI.inherit(BI.BasicButton, {
var conf = BI.IconTextIconItem.superclass._defaultConfig.apply(this, arguments); var conf = BI.IconTextIconItem.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-icon-text-icon-item", baseCls: (conf.baseCls || "") + " bi-icon-text-icon-item",
logic: {
dynamic: false
},
iconCls1: "", iconCls1: "",
iconCls2: "", iconCls2: "",
iconHeight: null, iconHeight: null,

3
src/base/single/button/listitem/icontextitem.js

@ -12,9 +12,6 @@ BI.IconTextItem = BI.inherit(BI.BasicButton, {
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-icon-text-item", baseCls: (conf.baseCls || "") + " bi-icon-text-item",
direction: BI.Direction.Left, direction: BI.Direction.Left,
logic: {
dynamic: false
},
iconWrapperWidth: null, iconWrapperWidth: null,
iconHeight: null, iconHeight: null,
iconWidth: null, iconWidth: null,

3
src/base/single/button/listitem/texticonitem.js

@ -12,9 +12,6 @@ BI.TextIconItem = BI.inherit(BI.BasicButton, {
var conf = BI.TextIconItem.superclass._defaultConfig.apply(this, arguments); var conf = BI.TextIconItem.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-icon-item", baseCls: (conf.baseCls || "") + " bi-text-icon-item",
logic: {
dynamic: false
},
iconWrapperWidth: null, iconWrapperWidth: null,
iconHeight: null, iconHeight: null,
iconWidth: null, iconWidth: null,

3
src/base/single/button/node/icontexticonnode.js

@ -10,9 +10,6 @@ BI.IconTextIconNode = BI.inherit(BI.NodeButton, {
var conf = BI.IconTextIconNode.superclass._defaultConfig.apply(this, arguments); var conf = BI.IconTextIconNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-icon-text-icon-node", baseCls: (conf.baseCls || "") + " bi-icon-text-icon-node",
logic: {
dynamic: false
},
iconCls1: "close-ha-font", iconCls1: "close-ha-font",
iconCls2: "close-ha-font", iconCls2: "close-ha-font",
iconHeight: null, iconHeight: null,

3
src/base/single/button/node/icontextnode.js

@ -10,9 +10,6 @@ BI.IconTextNode = BI.inherit(BI.NodeButton, {
var conf = BI.IconTextNode.superclass._defaultConfig.apply(this, arguments); var conf = BI.IconTextNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-icon-text-node", baseCls: (conf.baseCls || "") + " bi-icon-text-node",
logic: {
dynamic: false
},
cls: "close-ha-font", cls: "close-ha-font",
iconHeight: null, iconHeight: null,
iconWidth: null, iconWidth: null,

3
src/base/single/button/node/texticonnode.js

@ -9,9 +9,6 @@ BI.TextIconNode = BI.inherit(BI.NodeButton, {
var conf = BI.TextIconNode.superclass._defaultConfig.apply(this, arguments); var conf = BI.TextIconNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-icon-node", baseCls: (conf.baseCls || "") + " bi-text-icon-node",
logic: {
dynamic: false
},
cls: "close-ha-font", cls: "close-ha-font",
iconHeight: null, iconHeight: null,
iconWidth: null, iconWidth: null,

4
src/base/single/editor/editor.js

@ -240,9 +240,6 @@ BI.Editor = BI.inherit(BI.Single, {
}, },
setWaterMark: function (v) { setWaterMark: function (v) {
if (!BI.isKey(v)) {
return;
}
this.options.watermark = v; this.options.watermark = v;
@ -261,6 +258,7 @@ BI.Editor = BI.inherit(BI.Single, {
}); });
} }
this.watermark.setText(v); this.watermark.setText(v);
this._checkWaterMark();
}, },
_setErrorVisible: function (b) { _setErrorVisible: function (b) {

3
src/base/single/editor/editor.multifile.js

@ -31,7 +31,8 @@ BI.MultifileEditor = BI.inherit(BI.Widget, {
accept: o.accept, accept: o.accept,
maxSize: o.maxSize, maxSize: o.maxSize,
maxLength: o.maxLength, maxLength: o.maxLength,
title: o.title title: o.title,
errorText: o.errorText,
}); });
this.file.on(BI.File.EVENT_CHANGE, function () { this.file.on(BI.File.EVENT_CHANGE, function () {
self.fireEvent(BI.MultifileEditor.EVENT_CHANGE, arguments); self.fireEvent(BI.MultifileEditor.EVENT_CHANGE, arguments);

18
src/base/single/input/file.js

@ -445,8 +445,9 @@
url: "", url: "",
multiple: true, multiple: true,
accept: "", // .png,.pdf,image/jpg,image/* 等 accept: "", // .png,.pdf,image/jpg,image/* 等
maxSize: -1, // 1024 * 1024 maxSize: -1, // 1024 * 1024 单位b
maxLength: -1 // 无限制, 与multiple配合使用 maxLength: -1, // 无限制, 与multiple配合使用
errorText: BI.emptyFn,
}); });
}, },
@ -472,12 +473,10 @@
// handlers // handlers
_wrap.onloadstart = function (rpe, xhr) { _wrap.onloadstart = function (rpe, xhr) {
// BI.Msg.toast("loadstart");
self.fireEvent(BI.File.EVENT_UPLOADSTART, arguments); self.fireEvent(BI.File.EVENT_UPLOADSTART, arguments);
}; };
_wrap.onprogress = function (rpe, xhr) { _wrap.onprogress = function (rpe, xhr) {
// BI.Msg.toast("onprogress");
// percent for each bar // percent for each bar
// fileSize is -1 only if browser does not support file info access // fileSize is -1 only if browser does not support file info access
@ -561,21 +560,26 @@
var validateFileType = fileTypeValidate(value, wrap.fileType); var validateFileType = fileTypeValidate(value, wrap.fileType);
if (!validateFileType) { if (!validateFileType) {
// 文件类型不支持 // 文件类型不支持
BI.Msg.toast(BI.i18nText("BI-Upload_File_Type_Error"), { level: "error" }); BI.Msg.toast(o.errorText({
errorType: 0,
file: item
}) || BI.i18nText("BI-Upload_File_Type_Error", wrap.fileType), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, { self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 0, errorType: 0,
file: item file: item
}); });
} else if (wrap.maxSize !== -1 && size && wrap.maxSize < size) { } else if (wrap.maxSize !== -1 && size && wrap.maxSize < size) {
// 文件大小不支持 // 文件大小不支持
BI.Msg.toast(BI.i18nText("BI-Upload_File_Size_Error"), { level: "error" }); BI.Msg.toast(o.errorText({
errorType: 1,
file: item
}) || BI.i18nText("BI-Upload_File_Size_Error", Math.ceil(wrap.maxSize / 1024 / 1024)), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, { self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 1, errorType: 1,
file: item file: item
}); });
} else { } else {
wrap.files.unshift(item); wrap.files.unshift(item);
// BI.Msg.toast(value);
} }
} }
} }

43
src/base/single/input/input.js

@ -206,14 +206,29 @@ BI.Input = BI.inherit(BI.Single, {
this._lastValue = this.getValue(); this._lastValue = this.getValue();
}, },
_checkValidationOnValueChange: function () { _checkValidationOnValueChange: function (callback) {
var o = this.options; var self = this, o = this.options;
var v = this.getValue(); var v = this.getValue();
this.setValid( if (o.allowBlank === true && BI.trim(v) == "") {
(o.allowBlank === true && BI.trim(v) == "") || ( this.setValid(true);
BI.isNotEmptyString(BI.trim(v)) && o.validationChecker.apply(this, [BI.trim(v)]) !== false callback && callback();
) return;
); }
if (BI.trim(v) == "") {
this.setValid(false);
callback && callback();
return;
}
var checker = o.validationChecker.apply(this, [BI.trim(v)]);
if (checker instanceof Promise) {
checker.then(function (validate) {
self.setValid(validate !== false);
callback && callback();
})
} else {
this.setValid(checker !== false);
callback && callback();
}
}, },
focus: function () { focus: function () {
@ -245,14 +260,16 @@ BI.Input = BI.inherit(BI.Single, {
}, },
setValue: function (textValue) { setValue: function (textValue) {
var self = this;
this.element.val(textValue); this.element.val(textValue);
BI.nextTick(BI.bind(function () { BI.nextTick(function () {
this._checkValidationOnValueChange(); self._checkValidationOnValueChange(function () {
this._defaultState(); self._defaultState();
if (this.isValid()) { if (self.isValid()) {
this._lastValidValue = this._lastSubmitValue = this.getValue(); self._lastValidValue = self._lastSubmitValue = self.getValue();
} }
}, this)); });
});
}, },
getValue: function () { getValue: function () {

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

@ -8,7 +8,7 @@
BI.Toast = BI.inherit(BI.Tip, { BI.Toast = BI.inherit(BI.Tip, {
_const: { _const: {
closableMinWidth: 146, closableMinWidth: 146,
minWidth: 124, minWidth: 100,
closableMaxWidth: 410, closableMaxWidth: 410,
maxWidth: 400, maxWidth: 400,
hgap: 8 hgap: 8
@ -20,7 +20,8 @@ BI.Toast = BI.inherit(BI.Tip, {
text: "", text: "",
level: "success", // success或warning level: "success", // success或warning
autoClose: true, autoClose: true,
closable: null closable: null,
vgap: 7,
}); });
}, },
@ -56,6 +57,9 @@ BI.Toast = BI.inherit(BI.Tip, {
case "warning": case "warning":
cls = "toast-warning-font"; cls = "toast-warning-font";
break; break;
case "loading":
cls = "toast-loading-font anim-rotate";
break;
case "normal": case "normal":
default: default:
cls = "toast-message-font"; cls = "toast-message-font";
@ -99,7 +103,7 @@ BI.Toast = BI.inherit(BI.Tip, {
horizontalAlign: BI.HorizontalAlign.Stretch, horizontalAlign: BI.HorizontalAlign.Stretch,
element: this, element: this,
items: items, items: items,
vgap: 12, vgap: o.vgap,
columnSize: columnSize columnSize: columnSize
}); });
}, },

3
src/case/button/item.multiselect.js

@ -11,9 +11,6 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, {
tabIndex: 1 tabIndex: 1
}, },
height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT,
logic: {
dynamic: false
},
iconWrapperWidth: 26, iconWrapperWidth: 26,
}); });
}, },

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

@ -10,9 +10,6 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, {
attributes: { attributes: {
tabIndex: 1 tabIndex: 1
}, },
logic: {
dynamic: false
},
height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT,
iconWrapperWidth: 16, iconWrapperWidth: 16,
textHgap: 10, textHgap: 10,
@ -31,6 +28,16 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, {
ref: function (_ref) { ref: function (_ref) {
self.radio = _ref; self.radio = _ref;
}, },
listeners: [
{
eventName: BI.Controller.EVENT_CHANGE,
action: function (type) {
if (type === BI.Events.CLICK) {
self.setSelected(self.isSelected());
}
}
}
],
}] }]
}, { }, {
el: { el: {

7
src/case/button/node/node.arrow.js

@ -6,9 +6,6 @@ BI.ArrowNode = BI.inherit(BI.NodeButton, {
var conf = BI.ArrowNode.superclass._defaultConfig.apply(this, arguments); var conf = BI.ArrowNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-arrow-group-node bi-list-item", baseCls: (conf.baseCls || "") + " bi-arrow-group-node bi-list-item",
logic: {
dynamic: false
},
id: "", id: "",
pId: "", pId: "",
open: false, open: false,
@ -20,7 +17,9 @@ BI.ArrowNode = BI.inherit(BI.NodeButton, {
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
this.checkbox = BI.createWidget({ this.checkbox = BI.createWidget({
type: "bi.arrow_group_node_checkbox" type: "bi.arrow_group_node_checkbox",
expandIcon: o.expandIcon,
collapseIcon: o.collapseIcon,
}); });
return { return {
type: "bi.vertical_adapt", type: "bi.vertical_adapt",

2
src/case/button/node/node.icon.arrow.js

@ -29,6 +29,8 @@ BI.IconArrowNode = BI.inherit(BI.NodeButton, {
var self = this, o = this.options; var self = this, o = this.options;
this.checkbox = BI.createWidget({ this.checkbox = BI.createWidget({
type: "bi.arrow_group_node_checkbox", type: "bi.arrow_group_node_checkbox",
expandIcon: o.expandIcon,
collapseIcon: o.collapseIcon,
width: 24, width: 24,
stopPropagation: true stopPropagation: true
}); });

4
src/case/button/node/node.plus.js

@ -9,13 +9,9 @@ BI.PlusGroupNode = BI.inherit(BI.NodeButton, {
var conf = BI.PlusGroupNode.superclass._defaultConfig.apply(this, arguments); var conf = BI.PlusGroupNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-plus-group-node bi-list-item", baseCls: (conf.baseCls || "") + " bi-plus-group-node bi-list-item",
logic: {
dynamic: false
},
id: "", id: "",
pId: "", pId: "",
open: false, open: false,
iconWrapperWidth: null,
height: 24 height: 24
}); });
}, },

3
src/case/button/switch.js

@ -14,9 +14,6 @@ BI.Switch = BI.inherit(BI.BasicButton, {
}, },
height: 20, height: 20,
width: 44, width: 44,
logic: {
dynamic: false
},
showTip: false showTip: false
}, },

16
src/case/checkbox/check.arrownode.js

@ -3,18 +3,22 @@
* 右与下箭头切换的树节点 * 右与下箭头切换的树节点
*/ */
BI.ArrowTreeGroupNodeCheckbox = BI.inherit(BI.IconButton, { BI.ArrowTreeGroupNodeCheckbox = BI.inherit(BI.IconButton, {
_defaultConfig: function () {
return BI.extend(BI.ArrowTreeGroupNodeCheckbox.superclass._defaultConfig.apply(this, arguments), { props: function (conf) {
extraCls: "bi-arrow-group-node-checkbox expander-right-font" return {
}); extraCls: "bi-arrow-group-node-checkbox " + (conf.collapseIcon || "expander-right-font"),
expandIcon: "expander-down-font",
collapseIcon: "expander-right-font"
};
}, },
setSelected: function (v) { setSelected: function (v) {
var o = this.options;
BI.ArrowTreeGroupNodeCheckbox.superclass.setSelected.apply(this, arguments); BI.ArrowTreeGroupNodeCheckbox.superclass.setSelected.apply(this, arguments);
if(v) { if(v) {
this.element.removeClass("expander-right-font").addClass("expander-down-font"); this.element.removeClass(o.collapseIcon).addClass(o.expandIcon);
} else { } else {
this.element.removeClass("expander-down-font").addClass("expander-right-font"); this.element.removeClass(o.expandIcon).addClass(o.collapseIcon);
} }
} }
}); });

2
src/case/colorchooser/colorchooser.js

@ -13,6 +13,7 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
value: "", value: "",
height: 24, height: 24,
el: {}, el: {},
simple: false
}); });
}, },
@ -30,6 +31,7 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
isNeedAdjustHeight: false, isNeedAdjustHeight: false,
el: BI.extend({ el: BI.extend({
type: o.width <= 24 ? "bi.color_chooser_trigger" : "bi.long_color_chooser_trigger", type: o.width <= 24 ? "bi.color_chooser_trigger" : "bi.long_color_chooser_trigger",
simple: o.simple,
ref: function (_ref) { ref: function (_ref) {
self.trigger = _ref; self.trigger = _ref;
}, },

1
src/case/colorchooser/colorchooser.simple.js

@ -20,6 +20,7 @@ BI.SimpleColorChooser = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({ this.combo = BI.createWidget({
type: "bi.color_chooser", type: "bi.color_chooser",
simple: o.simple,
element: this, element: this,
container: o.container, container: o.container,
value: o.value, value: o.value,

2
src/case/colorchooser/colorchooser.trigger.js

@ -10,7 +10,7 @@ BI.ColorChooserTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function (config) { _defaultConfig: function (config) {
var conf = BI.ColorChooserTrigger.superclass._defaultConfig.apply(this, arguments); var conf = BI.ColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-focus-shadow " + (config.simple ? "bi-border-bottom" : "bi-border"), baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-focus-shadow " + (config.simple ? "bi-border-bottom" : "bi-border bi-border-radius"),
height: 22 height: 22
}); });
}, },

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

@ -10,7 +10,7 @@ BI.LongColorChooserTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function (config) { _defaultConfig: function (config) {
var conf = BI.LongColorChooserTrigger.superclass._defaultConfig.apply(this, arguments); var conf = BI.LongColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-focus-shadow " + (config.simple ? "bi-border-bottom" : "bi-border"), baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-focus-shadow " + (config.simple ? "bi-border-bottom" : "bi-border bi-border-radius"),
height: 24 height: 24
}); });
}, },

12
src/case/combo/bubblecombo/popup.bubble.js

@ -48,8 +48,8 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, {
if (BI.isWidget(buttonOpt)) { if (BI.isWidget(buttonOpt)) {
items.push({ items.push({
el: buttonOpt, el: buttonOpt,
lgap: i === 0 ? 20 : 15, lgap: i === 0 ? 15 : 10,
rgap: i === o.buttons.length - 1 ? 20 : 0 rgap: i === o.buttons.length - 1 ? 15 : 0
}); });
} else { } else {
items.push({ items.push({
@ -60,14 +60,14 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, {
self.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON, v); self.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON, v);
} }
}, buttonOpt), }, buttonOpt),
lgap: i === 0 ? 20 : 15, lgap: i === 0 ? 15 : 10,
rgap: i === o.buttons.length - 1 ? 20 : 0 rgap: i === o.buttons.length - 1 ? 15 : 0
}); });
} }
}); });
return BI.createWidget({ return BI.createWidget({
type: "bi.right_vertical_adapt", type: "bi.right_vertical_adapt",
height: 54, height: 44,
items: items items: items
}); });
}, },
@ -90,7 +90,7 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, {
}] }]
}); });
button.element.css("min-height", o.minHeight - 54); button.element.css("min-height", o.minHeight - 44);
return button; return button;
} }

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

@ -5,7 +5,7 @@
BI.IconTextValueCombo = BI.inherit(BI.Widget, { BI.IconTextValueCombo = BI.inherit(BI.Widget, {
_defaultConfig: function (config) { _defaultConfig: function (config) {
return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-icon-text-value-combo bi-border-radius " + (config.simple ? "bi-border-bottom" : "bi-border"), baseCls: "bi-icon-text-value-combo " + (config.simple ? "bi-border-bottom" : "bi-border bi-border-radius"),
height: 24, height: 24,
iconHeight: null, iconHeight: null,
iconWidth: null, iconWidth: null,

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

@ -11,6 +11,7 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
items: [], items: [],
tipType: "", tipType: "",
warningTitle: "", warningTitle: "",
allowClear: false,
}, },
render: function () { render: function () {
@ -21,14 +22,17 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
o.items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) { o.items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue); self.populate(newValue);
}) : o.items; }) : o.items;
var height = BI.isNumeric(o.height) ? (o.height - (o.simple ? 1 : 2)) : o.height;
var width = BI.isNumeric(o.width) ? (o.width - 2) : o.width;
return { return {
type: "bi.absolute",
items: [{
el: {
type: "bi.combo", type: "bi.combo",
cls: (o.simple ? "bi-border-bottom" : "bi-border") + " bi-focus-shadow", cls: (o.simple ? "bi-border-bottom" : "bi-border bi-border-radius") + " bi-focus-shadow",
container: o.container, container: o.container,
adjustLength: 2, adjustLength: 2,
height: height,
width: width,
toggle: false, toggle: false,
ref: function () { ref: function () {
self.combo = this; self.combo = this;
@ -41,20 +45,27 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
self.trigger = this; self.trigger = this;
}, },
items: o.items, items: o.items,
height: o.height - (o.simple ? 1 : 2), height: height,
text: o.text, text: o.text,
defaultText: o.defaultText, defaultText: o.defaultText,
value: o.value, value: o.value,
tipType: o.tipType, tipType: o.tipType,
warningTitle: o.warningTitle, warningTitle: o.warningTitle,
title: o.title, title: o.title,
allowClear: o.allowClear,
listeners: [{ listeners: [{
eventName: BI.SearchTextValueTrigger.EVENT_CHANGE, eventName: BI.SearchTextValueTrigger.EVENT_CHANGE,
action: function () { action: function () {
self.setValue(this.getValue()); self.setValue(this.getValue()[0]);
self.combo.hideView(); self.combo.hideView();
self.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE); self.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE);
} }
}, {
eventName: BI.SearchTextValueTrigger.EVENT_CLEAR,
action: function () {
self._clear();
self.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE);
}
}] }]
}, },
popup: { popup: {
@ -70,7 +81,7 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
listeners: [{ listeners: [{
eventName: BI.TextValueComboPopup.EVENT_CHANGE, eventName: BI.TextValueComboPopup.EVENT_CHANGE,
action: function () { action: function () {
self.setValue(this.getValue()); self.setValue(this.getValue()[0]);
self.combo.hideView(); self.combo.hideView();
self.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE); self.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE);
} }
@ -91,35 +102,6 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
self.fireEvent(BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW); self.fireEvent(BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW);
} }
}], }],
hideChecker: function (e) {
return self.triggerBtn.element.find(e.target).length === 0;
}
},
left: 0,
right: 0,
bottom: 0,
top: 0
}, {
el: {
type: "bi.trigger_icon_button",
cls: "trigger-icon-button",
ref: function () {
self.triggerBtn = this;
},
width: o.height,
height: o.height,
handler: function () {
if (self.combo.isViewVisible()) {
self.combo.hideView();
} else {
self.combo.showView();
}
}
},
right: 0,
bottom: 0,
top: 0
}]
}; };
}, },
@ -130,6 +112,10 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
} }
}, },
_clear: function () {
this.setValue();
},
_checkError: function (v) { _checkError: function (v) {
if (BI.isNull(v) || BI.isEmptyArray(v) || BI.isEmptyString(v)) { if (BI.isNull(v) || BI.isEmptyArray(v) || BI.isEmptyString(v)) {
this.trigger.options.tipType = "success"; this.trigger.options.tipType = "success";

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

@ -5,16 +5,33 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, {
props: function () { props: function () {
return { return {
extraCls: "bi-search-text-value-trigger", baseCls: "bi-search-text-value-trigger",
height: 24, height: 24,
watermark: BI.i18nText("BI-Basic_Search") watermark: BI.i18nText("BI-Basic_Search"),
allowClear: false,
title: () => this.editor.getText(),
}; };
}, },
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
var triggerButton = {
type: "bi.trigger_icon_button",
cls: "trigger-icon-button",
ref: function () {
self.triggerBtn = this;
},
width: o.height,
height: o.height,
width: 24,
};
var stateText = this._digest(o.value, o.items) || o.text;
return { return {
type: "bi.htape", type: "bi.horizontal_fill",
columnSize: ["fill", 24],
items: [ items: [
{ {
el: { el: {
@ -24,16 +41,15 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, {
}, },
isAutoSearch: false, isAutoSearch: false,
el: { el: {
type: "bi.state_editor", type: "bi.default_text_editor",
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
watermark: o.watermark, watermark: o.watermark,
defaultText: o.defaultText, defaultText: o.defaultText,
text: this._digest(o.value, o.items), text: stateText,
value: o.value, value: o.value,
height: o.height, height: o.height,
tipText: ""
}, },
popup: { popup: {
type: "bi.search_text_value_combo_popup", type: "bi.search_text_value_combo_popup",
@ -55,10 +71,31 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, {
}] }]
} }
}, { }, {
el: o.allowClear ? {
type: "bi.vertical_adapt",
horizontalAlign: "left",
scrollable: false,
items: [
{
el: { el: {
type: "bi.layout", type: "bi.icon_button",
width: 24 ref: function (_ref) {
self.clearBtn = _ref;
}, },
cls: "close-h-font " + (o.allowClear ? "clear-button" : ""),
stopPropagation: true,
invisible: !BI.isNotEmptyString(stateText),
width: o.height,
height: o.height,
handler: function () {
self.fireEvent(BI.SearchTextValueTrigger.EVENT_CLEAR);
},
},
}, {
el: triggerButton,
}
]
} : triggerButton,
width: 24 width: 24
} }
] ]
@ -69,22 +106,11 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, {
this.editor.setState(v); this.editor.setState(v);
}, },
_digest: function (vals, items) { _digest: function (value, items) {
var o = this.options; var result = BI.find(items, function (i, item) {
vals = BI.isArray(vals) ? vals : [vals]; return item.value === value;
var result = [];
var formatItems = BI.Tree.transformToArrayFormat(items);
BI.each(formatItems, function (i, item) {
if (BI.deepContains(vals, item.value) && !BI.contains(result, item.text || item.value)) {
result.push(item.text || item.value);
}
}); });
return result?.text;
if (result.length > 0) {
return result.join(",");
} else {
return BI.isFunction(o.text) ? o.text() : o.text;
}
}, },
stopEditing: function () { stopEditing: function () {
@ -100,7 +126,9 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, {
}, },
setValue: function (vals) { setValue: function (vals) {
this._setState(this._digest(vals, this.options.items)); var digestText = this._digest(vals, this.options.items);
this._setState(digestText);
this.options.allowClear && this.clearBtn.setVisible(BI.isNotEmptyString(digestText));
}, },
getValue: function () { getValue: function () {
@ -111,4 +139,5 @@ BI.SearchTextValueTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.SearchTextValueTrigger.EVENT_STOP = "EVENT_STOP"; BI.SearchTextValueTrigger.EVENT_STOP = "EVENT_STOP";
BI.SearchTextValueTrigger.EVENT_START = "EVENT_START"; BI.SearchTextValueTrigger.EVENT_START = "EVENT_START";
BI.SearchTextValueTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.SearchTextValueTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.SearchTextValueTrigger.EVENT_CLEAR = "EVENT_CLEAR";
BI.shortcut("bi.search_text_value_trigger", BI.SearchTextValueTrigger); BI.shortcut("bi.search_text_value_trigger", BI.SearchTextValueTrigger);

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

@ -7,18 +7,19 @@
BI.TextValueCombo = BI.inherit(BI.Widget, { BI.TextValueCombo = BI.inherit(BI.Widget, {
_defaultConfig: function (config) { _defaultConfig: function (config) {
return BI.extend(BI.TextValueCombo.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.TextValueCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-text-value-combo " + (config.simple ? "bi-border-bottom" : "bi-border"), baseCls: "bi-text-value-combo " + (config.simple ? "bi-border-bottom" : "bi-border bi-border-radius"),
height: 24, height: 24,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
text: "", text: "",
value: "", value: "",
allowClear: false,
}); });
}, },
_init: function () { _init: function () {
var self = this, o = this.options; var self = this, o = this.options;
BI.isNumeric(o.width) && (o.width -= 2); BI.isNumeric(o.width) && (o.width -= (o.simple ? 0 : 2));
BI.isNumeric(o.height) && (o.height -= 2); BI.isNumeric(o.height) && (o.height -= (o.simple ? 1 : 2));
o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) { o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) {
self.setValue(newValue); self.setValue(newValue);
}) : o.value; }) : o.value;
@ -33,7 +34,17 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
height: o.height, height: o.height,
text: o.text, text: o.text,
value: o.value, value: o.value,
warningTitle: o.warningTitle warningTitle: o.warningTitle,
allowClear: o.allowClear,
listeners: [
{
eventName: BI.SelectTextTrigger.EVENT_CLEAR,
action: function () {
self._clear();
self.fireEvent(BI.TextValueCombo.EVENT_CHANGE);
}
}
],
}); });
this.popup = BI.createWidget({ this.popup = BI.createWidget({
type: "bi.text_value_combo_popup", type: "bi.text_value_combo_popup",
@ -62,28 +73,32 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
minHeight: 25 minHeight: 25
} }
}); });
if(BI.isKey(o.value)) { if (BI.isKey(o.value)) {
this._checkError(o.value); this._checkError(o.value);
} }
}, },
_clear: function () {
this.setValue();
},
_checkError: function (v) { _checkError: function (v) {
if(BI.isNull(v) || BI.isEmptyArray(v) || BI.isEmptyString(v)) { v = BI.isArray(v) ? v[0] : v;
this.trigger.options.tipType = "success"; var tipType = null;
this.element.removeClass("combo-error");
} else {
v = BI.isArray(v) ? v : [v];
var result = BI.find(this.options.items, function (idx, item) { var result = BI.find(this.options.items, function (idx, item) {
return BI.contains(v, item.value); return v === item.value;
}); });
if (BI.isNull(result)) { if (BI.isNull(result)) {
this.trigger.setTipType("warning"); if (this.isEnabled()) {
this.element.removeClass("combo-error").addClass("combo-error"); tipType = "warning";
} else {
this.trigger.setTipType("success");
this.element.removeClass("combo-error");
} }
this.element.addClass("error");
this.trigger.element.addClass("error");
} else {
this.element.removeClass("error");
this.trigger.element.removeClass("error");
} }
this.trigger.setTipType(tipType);
}, },
setValue: function (v) { setValue: function (v) {

5
src/case/editor/editor.clear.js

@ -17,8 +17,11 @@ BI.ClearEditor = BI.inherit(BI.Widget, {
}); });
}, },
_init: function () { _init: function () {
BI.ClearEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) {
self.setValue(newValue);
}) : o.value;
BI.ClearEditor.superclass._init.apply(this, arguments);
this.editor = BI.createWidget({ this.editor = BI.createWidget({
type: "bi.editor", type: "bi.editor",
simple: o.simple, simple: o.simple,

282
src/case/editor/editor.defaulttext.js

@ -0,0 +1,282 @@
/**
* dailer
* 有默认提示文字的输入框
* @class BI.DefaultTextEditor
* @extends BI.Widget
*/
BI.DefaultTextEditor = BI.inherit(BI.Widget, {
props: function () {
return {
baseCls: "bi-default-text-editor",
hgap: 4,
vgap: 2,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn,
allowBlank: true,
watermark: "",
errorText: "",
height: 24,
defaultText: "", // 默认显示值,默认显示值与显示值的区别是默认显示值标记灰色
text: "", // 显示值
el: {}
};
},
render: function () {
var self = this, o = this.options;
this.editor = BI.createWidget(o.el, {
type: "bi.editor",
simple: o.simple,
height: o.height,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
value: o.value,
validationChecker: o.validationChecker,
quitChecker: o.quitChecker,
allowBlank: o.allowBlank,
watermark: o.watermark,
errorText: o.errorText,
invisible: true,
});
this.text = BI.createWidget({
type: "bi.text_button",
cls: BI.isKey(o.text) ? "tip-text-style" : "bi-water-mark tip-text-style",
textAlign: "left",
height: o.height,
text: BI.isKey(o.text) ? o.text : o.defaultText,
hgap: o.hgap + 2,
handler: function () {
self._showInput();
self.editor.focus();
self.editor.setValue("");
},
title: o.title,
warningTitle: o.warningTitle,
tipType: o.tipType
});
this.text.on(BI.TextButton.EVENT_CHANGE, function () {
BI.nextTick(function () {
self.fireEvent(BI.DefaultTextEditor.EVENT_CLICK_LABEL);
});
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.editor.on(BI.Editor.EVENT_FOCUS, function () {
self.fireEvent(BI.DefaultTextEditor.EVENT_FOCUS, arguments);
});
this.editor.on(BI.Editor.EVENT_BLUR, function () {
self.fireEvent(BI.DefaultTextEditor.EVENT_BLUR, arguments);
});
this.editor.on(BI.Editor.EVENT_CLICK, function () {
self.fireEvent(BI.DefaultTextEditor.EVENT_CLICK, arguments);
});
this.editor.on(BI.Editor.EVENT_CHANGE, function () {
self.fireEvent(BI.DefaultTextEditor.EVENT_CHANGE, arguments);
});
this.editor.on(BI.Editor.EVENT_KEY_DOWN, function (v) {
self.fireEvent(BI.DefaultTextEditor.EVENT_KEY_DOWN, arguments);
});
this.editor.on(BI.Editor.EVENT_VALID, function () {
self.fireEvent(BI.DefaultTextEditor.EVENT_VALID, arguments);
});
this.editor.on(BI.Editor.EVENT_CONFIRM, function () {
self._showHint();
self.fireEvent(BI.DefaultTextEditor.EVENT_CONFIRM, arguments);
});
this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM, function () {
self._showHint();
self.fireEvent(BI.DefaultTextEditor.EVENT_CHANGE_CONFIRM, arguments);
});
this.editor.on(BI.Editor.EVENT_START, function () {
self.fireEvent(BI.DefaultTextEditor.EVENT_START, arguments);
});
this.editor.on(BI.Editor.EVENT_PAUSE, function () {
self.fireEvent(BI.DefaultTextEditor.EVENT_PAUSE, arguments);
});
this.editor.on(BI.Editor.EVENT_STOP, function () {
self.fireEvent(BI.DefaultTextEditor.EVENT_STOP, arguments);
});
this.editor.on(BI.Editor.EVENT_SPACE, function () {
self.fireEvent(BI.DefaultTextEditor.EVENT_SPACE, arguments);
});
this.editor.on(BI.Editor.EVENT_ERROR, function () {
self.fireEvent(BI.DefaultTextEditor.EVENT_ERROR, arguments);
});
this.editor.on(BI.Editor.EVENT_ENTER, function () {
self.fireEvent(BI.DefaultTextEditor.EVENT_ENTER, arguments);
});
this.editor.on(BI.Editor.EVENT_RESTRICT, function () {
self.fireEvent(BI.DefaultTextEditor.EVENT_RESTRICT, arguments);
});
this.editor.on(BI.Editor.EVENT_EMPTY, function () {
self.fireEvent(BI.DefaultTextEditor.EVENT_EMPTY, arguments);
});
return {
type: "bi.absolute",
items: [
{
el: this.editor,
left: 0,
right: 0,
top: 0,
bottom: 0
}, {
el: this.text,
left: 0,
right: 0,
top: 0,
bottom: 0
}
]
};
},
setWaterMark: function (v) {
this.options.watermark = v;
this.editor.setWaterMark(v);
},
setTitle: function (title) {
this.text.setTitle(title);
},
setWarningTitle: function (title) {
this.text.setWarningTitle(title);
},
doRedMark: function () {
if (this.editor.getValue() === "" && BI.isKey(this.options.watermark)) {
return;
}
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
if (this.editor.getValue() === "" && BI.isKey(this.options.watermark)) {
return;
}
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
focus: function () {
if (this.options.disabled === false) {
this._showInput();
this.editor.focus();
}
},
blur: function () {
this.editor.blur();
this._showHint();
},
_showInput: function () {
this.editor.visible();
this.text.invisible();
},
_showHint: function () {
this.editor.invisible();
this.text.visible();
},
_setText: function (v) {
this.text.setText(v);
this.text.setTitle(v);
},
isValid: function () {
return this.editor.isValid();
},
setErrorText: function (text) {
this.editor.setErrorText(text);
},
getErrorText: function () {
return this.editor.getErrorText();
},
isEditing: function () {
return this.editor.isEditing();
},
getLastValidValue: function () {
return this.editor.getLastValidValue();
},
getLastChangedValue: function () {
return this.editor.getLastChangedValue();
},
setValue: function (k) {
this.editor.setValue(k);
},
getValue: function () {
return this.editor.getValue();
},
getState: function () {
return this.text.getValue();
},
setState: function (v) {
var o = this.options;
if (BI.isKey(v)) {
this.text.setText(v);
this.text.element.removeClass("bi-water-mark");
return;
}
this.text.setText(o.defaultText);
this.text.element.addClass("bi-water-mark");
},
setTipType: function (v) {
this.text.options.tipType = v;
},
getText: function () {
return this.text.getText();
}
});
BI.DefaultTextEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.DefaultTextEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.DefaultTextEditor.EVENT_BLUR = "EVENT_BLUR";
BI.DefaultTextEditor.EVENT_CLICK = "EVENT_CLICK";
BI.DefaultTextEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.DefaultTextEditor.EVENT_CLICK_LABEL = "EVENT_CLICK_LABEL";
BI.DefaultTextEditor.EVENT_START = "EVENT_START";
BI.DefaultTextEditor.EVENT_PAUSE = "EVENT_PAUSE";
BI.DefaultTextEditor.EVENT_STOP = "EVENT_STOP";
BI.DefaultTextEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DefaultTextEditor.EVENT_CHANGE_CONFIRM = "EVENT_CHANGE_CONFIRM";
BI.DefaultTextEditor.EVENT_VALID = "EVENT_VALID";
BI.DefaultTextEditor.EVENT_ERROR = "EVENT_ERROR";
BI.DefaultTextEditor.EVENT_ENTER = "EVENT_ENTER";
BI.DefaultTextEditor.EVENT_RESTRICT = "EVENT_RESTRICT";
BI.DefaultTextEditor.EVENT_SPACE = "EVENT_SPACE";
BI.DefaultTextEditor.EVENT_EMPTY = "EVENT_EMPTY";
BI.shortcut("bi.default_text_editor", BI.DefaultTextEditor);

5
src/case/editor/editor.shelter.js

@ -26,8 +26,11 @@ BI.ShelterEditor = BI.inherit(BI.Widget, {
}, },
_init: function () { _init: function () {
BI.ShelterEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) {
self.setValue(newValue);
}) : o.value;
BI.ShelterEditor.superclass._init.apply(this, arguments);
this.editor = BI.createWidget({ this.editor = BI.createWidget({
type: "bi.editor", type: "bi.editor",
simple: o.simple, simple: o.simple,

9
src/case/editor/editor.sign.js

@ -26,8 +26,11 @@ BI.SignEditor = BI.inherit(BI.Widget, {
}, },
_init: function () { _init: function () {
BI.SignEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) {
self.setValue(newValue);
}) : o.value;
BI.SignEditor.superclass._init.apply(this, arguments);
this.editor = BI.createWidget({ this.editor = BI.createWidget({
type: "bi.editor", type: "bi.editor",
simple: o.simple, simple: o.simple,
@ -171,6 +174,10 @@ BI.SignEditor = BI.inherit(BI.Widget, {
this.text.setTitle(title); this.text.setTitle(title);
}, },
setTipType: function (v) {
this.text.setTipType(v);
},
setWarningTitle: function (title) { setWarningTitle: function (title) {
this.text.setWarningTitle(title); this.text.setWarningTitle(title);
}, },

7
src/case/layer/panel.js

@ -8,6 +8,7 @@ BI.Panel = BI.inherit(BI.Widget, {
return BI.extend(BI.Panel.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.Panel.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-panel bi-border", baseCls: "bi-panel bi-border",
title: "", title: "",
titleHeight: 30,
titleButtons: [], titleButtons: [],
el: {}, el: {},
logic: { logic: {
@ -34,7 +35,7 @@ BI.Panel = BI.inherit(BI.Widget, {
type: "bi.label", type: "bi.label",
cls: "panel-title-text", cls: "panel-title-text",
text: o.title, text: o.title,
height: 30 height: o.titleHeight
}); });
this.button_group = BI.createWidget({ this.button_group = BI.createWidget({
@ -58,7 +59,7 @@ BI.Panel = BI.inherit(BI.Widget, {
el: { el: {
type: "bi.left_right_vertical_adapt", type: "bi.left_right_vertical_adapt",
cls: "panel-title bi-header-background bi-border-bottom", cls: "panel-title bi-header-background bi-border-bottom",
height: 29, height: o.titleHeight - 1,
items: { items: {
left: [this.text], left: [this.text],
right: [this.button_group] right: [this.button_group]
@ -66,7 +67,7 @@ BI.Panel = BI.inherit(BI.Widget, {
lhgap: 10, lhgap: 10,
rhgap: 10 rhgap: 10
}, },
height: 29 height: o.titleHeight - 1
}; };
}, },

4
src/case/tree/treeexpander/tree.expander.popup.js

@ -22,8 +22,8 @@
this.popupView.on(BI.Controller.EVENT_CHANGE, function () { this.popupView.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}); });
this.popupView.element.css("margin-left", -offset * o.layer); this.popupView.element.css("margin-left", -offset * (o.layer + 1));
this.element.css("margin-left", offset * o.layer); this.element.css("margin-left", offset * (o.layer + 1));
return { return {
type: "bi.vertical", type: "bi.vertical",

4
src/case/trigger/trigger.editor.js

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

70
src/case/trigger/trigger.text.js

@ -7,25 +7,27 @@
*/ */
BI.TextTrigger = BI.inherit(BI.Trigger, { BI.TextTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () { props: function () {
var self = this; var self = this;
var conf = BI.TextTrigger.superclass._defaultConfig.apply(this, arguments); return {
return BI.extend(conf, { baseCls: "bi-text-trigger",
baseCls: (conf.baseCls || "") + " bi-text-trigger",
height: 24, height: 24,
textHgap: 6, textHgap: 6,
textCls: "", textCls: "",
allowClear: false,
title: function () { title: function () {
return self.text.getText(); return self.text.getText();
} }
}); };
}, },
_init: function () { render: function () {
BI.TextTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options, c = this._const; var self = this, o = this.options, c = this._const;
this.text = BI.createWidget({ var text = {
type: "bi.label", type: "bi.label",
ref: function (_ref) {
self.text = _ref;
},
cls: "select-text-label" + (BI.isKey(o.textCls) ? (" " + o.textCls) : ""), cls: "select-text-label" + (BI.isKey(o.textCls) ? (" " + o.textCls) : ""),
textAlign: "left", textAlign: "left",
height: o.height, height: o.height,
@ -39,32 +41,59 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
tgap: o.textTgap, tgap: o.textTgap,
bgap: o.textBgap, bgap: o.textBgap,
readonly: o.readonly readonly: o.readonly
}); };
this.trigerButton = BI.createWidget({
var triggerButton = {
type: "bi.trigger_icon_button", type: "bi.trigger_icon_button",
ref: function (_ref) {
self.triggerButton = _ref;
},
width: o.triggerWidth || o.height width: o.triggerWidth || o.height
}); };
BI.createWidget({ return ({
element: this,
type: "bi.horizontal_fill", type: "bi.horizontal_fill",
columnSize: ["fill", o.triggerWidth || o.height],
items: [ items: [
{ {
el: this.text, el: text,
width: "fill" width: "fill"
}, { }, {
el: this.trigerButton, el: o.allowClear ? {
width: o.triggerWidth || o.height type: "bi.vertical_adapt",
horizontalAlign: "left",
scrollable: false,
items: [
{
el: {
type: "bi.icon_button",
ref: function (_ref) {
self.clearBtn = _ref;
},
cls: "close-h-font " + (o.allowClear ? "clear-button" : ""),
stopPropagation: true,
width: o.triggerWidth || o.height,
height: o.height,
invisible: !BI.isNotEmptyString(o.text),
handler: function () {
self.fireEvent(BI.TextTrigger.EVENT_CLEAR);
},
},
}, {
el: triggerButton,
}
]
} : triggerButton,
} }
] ]
}); });
}, },
getTextor: function() { getTextor: function () {
return this.text; return this.text;
}, },
setTextCls: function(cls) { setTextCls: function (cls) {
var o = this.options; var o = this.options;
var oldCls = o.textCls; var oldCls = o.textCls;
o.textCls = cls; o.textCls = cls;
@ -73,6 +102,9 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
setText: function (text) { setText: function (text) {
this.text.setText(text); this.text.setText(text);
if (this.options.allowClear) {
this.clearBtn.setVisible(BI.isNotEmptyString(text));
}
}, },
setTipType: function (v) { setTipType: function (v) {
@ -80,4 +112,6 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
this.options.tipType = v; this.options.tipType = v;
} }
}); });
BI.TextTrigger.EVENT_CLEAR = "EVENT_CLEAR";
BI.shortcut("bi.text_trigger", BI.TextTrigger); BI.shortcut("bi.text_trigger", BI.TextTrigger);

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

@ -11,6 +11,8 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, {
return BI.extend(BI.SelectTextTrigger.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.SelectTextTrigger.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-select-text-trigger", baseCls: "bi-select-text-trigger",
height: 24, height: 24,
allowClear: false,
valueFormatter: BI.emptyFn,
}); });
}, },
@ -32,11 +34,21 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, {
textTgap: o.textTgap, textTgap: o.textTgap,
textBgap: o.textBgap, textBgap: o.textBgap,
tipType: o.tipType, tipType: o.tipType,
warningTitle: o.warningTitle warningTitle: o.warningTitle,
allowClear: o.allowClear,
listeners: [
{
eventName: BI.TextTrigger.EVENT_CLEAR,
action: function () {
self.setText("");
self.fireEvent(BI.SelectTextTrigger.EVENT_CLEAR);
}
}
]
}); });
}, },
_digest: function(vals, items){ _digest: function (vals, items) {
var o = this.options; var o = this.options;
vals = BI.isArray(vals) ? vals : [vals]; vals = BI.isArray(vals) ? vals : [vals];
var result = []; var result = [];
@ -50,16 +62,21 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, {
if (result.length > 0) { if (result.length > 0) {
return { return {
textCls: "", textCls: "",
text: result.join(",") text: o.valueFormatter(vals[0]) || result.join(","), // 只保留单个value的场景,后续会把BI.isArray(vals) ? vals : [vals];这种都去掉
} };
} else { } else {
return { return {
textCls: "bi-water-mark", textCls: "bi-water-mark",
text: BI.isFunction(o.text) ? o.text() : o.text text: BI.isFunction(o.text) ? o.text() : o.text
} };
} }
}, },
setText: function (text) {
this.options.text = text;
this.trigger.setText(text);
},
setValue: function (vals) { setValue: function (vals) {
var formatValue = this._digest(vals, this.options.items); var formatValue = this._digest(vals, this.options.items);
this.trigger.setTextCls(formatValue.textCls); this.trigger.setTextCls(formatValue.textCls);
@ -67,10 +84,11 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, {
}, },
setTipType: function (v) { setTipType: function (v) {
this.options.tipType = v;
this.trigger.setTipType(v); this.trigger.setTipType(v);
}, },
getTextor: function() { getTextor: function () {
return this.trigger.getTextor(); return this.trigger.getTextor();
}, },
@ -78,4 +96,6 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, {
this.options.items = items; this.options.items = items;
} }
}); });
BI.SelectTextTrigger.EVENT_CLEAR = "EVENT_CLEAR";
BI.shortcut("bi.select_text_trigger", BI.SelectTextTrigger); BI.shortcut("bi.select_text_trigger", BI.SelectTextTrigger);

34
src/case/ztree/0.treeview.js

@ -110,7 +110,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
}; };
var className = "dark", perTime = 100; var className = "dark", perTime = 100;
function onClick (event, treeId, treeNode) { function onClick(event, treeId, treeNode) {
// 当前点击节点的状态是半选,且为true_part, 则将其改为false_part,使得点击半选后切换到的是全选 // 当前点击节点的状态是半选,且为true_part, 则将其改为false_part,使得点击半选后切换到的是全选
var checked = treeNode.checked; var checked = treeNode.checked;
var status = treeNode.getCheckStatus(); var status = treeNode.getCheckStatus();
@ -121,7 +121,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
self.nodes.checkNode(treeNode, !checked, true, true); self.nodes.checkNode(treeNode, !checked, true, true);
} }
function getUrl (treeId, treeNode) { function getUrl(treeId, treeNode) {
var parentNode = self._getParentValues(treeNode); var parentNode = self._getParentValues(treeNode);
treeNode.times = treeNode.times || 1; treeNode.times = treeNode.times || 1;
var param = "id=" + treeNode.id var param = "id=" + treeNode.id
@ -132,7 +132,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
return "&" + param; return "&" + param;
} }
function beforeExpand (treeId, treeNode) { function beforeExpand(treeId, treeNode) {
if (!treeNode.isAjaxing) { if (!treeNode.isAjaxing) {
if (!treeNode.children) { if (!treeNode.children) {
treeNode.times = 1; treeNode.times = 1;
@ -147,7 +147,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
} }
function onAsyncSuccess (event, treeId, treeNode, msg) { function onAsyncSuccess(event, treeId, treeNode, msg) {
treeNode.halfCheck = false; treeNode.halfCheck = false;
if (!msg || msg.length === 0 || /^<html>[\s,\S]*<\/html>$/gi.test(msg) || self._stop) { if (!msg || msg.length === 0 || /^<html>[\s,\S]*<\/html>$/gi.test(msg) || self._stop) {
return; return;
@ -170,14 +170,14 @@ BI.TreeView = BI.inherit(BI.Pane, {
} }
} }
function onAsyncError (event, treeId, treeNode, XMLHttpRequest, textStatus, errorThrown) { function onAsyncError(event, treeId, treeNode, XMLHttpRequest, textStatus, errorThrown) {
var zTree = self.nodes; var zTree = self.nodes;
BI.Msg.toast("Error!", "warning"); BI.Msg.toast("Error!", "warning");
// treeNode.icon = ""; // treeNode.icon = "";
// zTree.updateNode(treeNode); // zTree.updateNode(treeNode);
} }
function ajaxGetNodes (treeNode, reloadType) { function ajaxGetNodes(treeNode, reloadType) {
var zTree = self.nodes; var zTree = self.nodes;
if (reloadType == "refresh") { if (reloadType == "refresh") {
zTree.updateNode(treeNode); // 刷新一下当前节点,如果treeNode.xxx被改了的话 zTree.updateNode(treeNode); // 刷新一下当前节点,如果treeNode.xxx被改了的话
@ -185,7 +185,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
zTree.reAsyncChildNodes(treeNode, reloadType, true); // 强制加载子节点,reloadType === refresh为先清空再加载,否则为追加到现有子节点之后 zTree.reAsyncChildNodes(treeNode, reloadType, true); // 强制加载子节点,reloadType === refresh为先清空再加载,否则为追加到现有子节点之后
} }
function beforeCheck (treeId, treeNode) { function beforeCheck(treeId, treeNode) {
if (treeNode.disabled) { if (treeNode.disabled) {
return false; return false;
} }
@ -195,7 +195,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
if (treeNode.checked === true) { if (treeNode.checked === true) {
// 将展开的节点halfCheck设为false,解决展开节点存在halfCheck=true的情况 guy // 将展开的节点halfCheck设为false,解决展开节点存在halfCheck=true的情况 guy
// 所有的半选状态都需要取消halfCheck=true的情况 // 所有的半选状态都需要取消halfCheck=true的情况
function track (children) { function track(children) {
BI.each(children, function (i, ch) { BI.each(children, function (i, ch) {
if (ch.halfCheck === true) { if (ch.halfCheck === true) {
ch.halfCheck = false; ch.halfCheck = false;
@ -217,24 +217,18 @@ BI.TreeView = BI.inherit(BI.Pane, {
} }
} }
function onCheck (event, treeId, treeNode) { function onCheck(event, treeId, treeNode) {
if (treeNode.disabled) { if (treeNode.disabled) {
return false; return false;
} }
self._selectTreeNode(treeId, treeNode); self._selectTreeNode(treeId, treeNode);
} }
function onExpand (event, treeId, treeNode) { function onExpand(event, treeId, treeNode) {
if (treeNode.disabled) {
return false;
}
treeNode.halfCheck = false; treeNode.halfCheck = false;
} }
function onCollapse (event, treeId, treeNode) { function onCollapse(event, treeId, treeNode) {
if (treeNode.disabled) {
return false;
}
} }
return setting; return setting;
@ -325,7 +319,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
var hashMap = {}; var hashMap = {};
var rootNoots = this.nodes.getNodes(); var rootNoots = this.nodes.getNodes();
track(rootNoots); // 可以看到这个方法没有递归调用,所以在_getHalfSelectedValues中需要关心全选的节点 track(rootNoots); // 可以看到这个方法没有递归调用,所以在_getHalfSelectedValues中需要关心全选的节点
function track (nodes) { function track(nodes) {
BI.each(nodes, function (i, node) { BI.each(nodes, function (i, node) {
var checkState = node.getCheckStatus(); var checkState = node.getCheckStatus();
if (checkState.checked === true || checkState.half === true) { if (checkState.checked === true || checkState.half === true) {
@ -503,7 +497,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
}, },
checkAll: function (checked) { checkAll: function (checked) {
function setNode (children) { function setNode(children) {
BI.each(children, function (i, child) { BI.each(children, function (i, child) {
child.halfCheck = false; child.halfCheck = false;
setNode(child.children); setNode(child.children);
@ -545,7 +539,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
BI.each(values, function (v, op) { BI.each(values, function (v, op) {
var nodes = treeObj.getNodesByParam(param, v, null); var nodes = treeObj.getNodesByParam(param, v, null);
BI.each(nodes, function (j, node) { BI.each(nodes, function (j, node) {
BI.extend(node, {checked: true}, op); BI.extend(node, { checked: true }, op);
treeObj.updateNode(node); treeObj.updateNode(node);
}); });
}); });

25
src/case/ztree/1.asynctree.js

@ -58,7 +58,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
} }
}; };
function onClick (event, treeId, treeNode) { function onClick(event, treeId, treeNode) {
if (treeNode.disabled) { if (treeNode.disabled) {
return false; return false;
} }
@ -72,7 +72,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
zTree.checkNode(treeNode, !checked, true, true); zTree.checkNode(treeNode, !checked, true, true);
} }
function beforeCheck (treeId, treeNode) { function beforeCheck(treeId, treeNode) {
if (treeNode.disabled) { if (treeNode.disabled) {
return false; return false;
} }
@ -82,7 +82,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
if (treeNode.checked === true) { if (treeNode.checked === true) {
// 将展开的节点halfCheck设为false,解决展开节点存在halfCheck=true的情况 guy // 将展开的节点halfCheck设为false,解决展开节点存在halfCheck=true的情况 guy
// 所有的半选状态都需要取消halfCheck=true的情况 // 所有的半选状态都需要取消halfCheck=true的情况
function track (children) { function track(children) {
BI.each(children, function (i, ch) { BI.each(children, function (i, ch) {
ch.halfCheck = false; ch.halfCheck = false;
track(ch.children); track(ch.children);
@ -103,31 +103,22 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
} }
} }
function beforeExpand (treeId, treeNode) { function beforeExpand(treeId, treeNode) {
if (treeNode.disabled) {
return false;
}
self._beforeExpandNode(treeId, treeNode); self._beforeExpandNode(treeId, treeNode);
} }
function onCheck (event, treeId, treeNode) { function onCheck(event, treeId, treeNode) {
if (treeNode.disabled) { if (treeNode.disabled) {
return false; return false;
} }
self._selectTreeNode(treeId, treeNode); self._selectTreeNode(treeId, treeNode);
} }
function onExpand (event, treeId, treeNode) { function onExpand(event, treeId, treeNode) {
if (treeNode.disabled) {
return false;
}
treeNode.halfCheck = false; treeNode.halfCheck = false;
} }
function onCollapse (event, treeId, treeNode) { function onCollapse(event, treeId, treeNode) {
if (treeNode.disabled) {
return false;
}
treeNode.halfCheck = false; treeNode.halfCheck = false;
} }
@ -216,7 +207,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
track([], valueA, valueB); track([], valueA, valueB);
track([], valueB, valueA); track([], valueB, valueA);
function track (parent, node, compare) { function track(parent, node, compare) {
BI.each(node, function (n, item) { BI.each(node, function (n, item) {
if (BI.isNull(compare[n])) { if (BI.isNull(compare[n])) {
self._addTreeNode(map, parent, n, item); self._addTreeNode(map, parent, n, item);

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

@ -45,6 +45,25 @@ BI.prepares.push(function () {
scrollx: true scrollx: true
}, ob, {type: "bi.inline"}); }, ob, {type: "bi.inline"});
}); });
BI.Plugin.configWidget("bi.vertical", function (ob) {
if (ob.horizontalAlign === BI.HorizontalAlign.Left || ob.horizontalAlign === BI.HorizontalAlign.Right) {
if (isSupportFlex()) {
return BI.extend({}, ob, {type: "bi.flex_vertical"});
}
return BI.extend({}, ob, {
horizontalAlign: BI.HorizontalAlign.Stretch,
type: "bi.vertical",
items: BI.map(ob.items, function (i, item) {
return {
type: "bi.inline",
horizontalAlign: ob.horizontalAlign,
items: [item]
};
})
});
}
return ob;
});
BI.Plugin.configWidget("bi.inline", function (ob) { BI.Plugin.configWidget("bi.inline", function (ob) {
// 当列宽既需要自动列宽又需要自适应列宽时,inline布局也处理不了了,降级table处理吧 // 当列宽既需要自动列宽又需要自适应列宽时,inline布局也处理不了了,降级table处理吧
var hasAutoAndFillColumnSize = false; var hasAutoAndFillColumnSize = false;

11
src/core/system.js

@ -7,6 +7,7 @@
!(function () { !(function () {
var system = { var system = {
dependencies: {}, dependencies: {},
layoutOptimize: false,
responsiveMode: false, responsiveMode: false,
workerMode: false, workerMode: false,
size: { size: {
@ -24,7 +25,7 @@
// 具体尺寸还没定,先写着 // 具体尺寸还没定,先写着
var sizeMap = { var sizeMap = {
"S": 10, "S": 10,
"M" : 20, "M": 20,
"L": 24 "L": 24
}; };
@ -44,6 +45,10 @@
system.workerMode = !!mode; system.workerMode = !!mode;
}; };
this.setLayoutOptimize = function (layoutOptimize) {
system.layoutOptimize = layoutOptimize;
};
this.addDependency = function (moduleId, minVersion, maxVersion) { this.addDependency = function (moduleId, minVersion, maxVersion) {
system.dependencies[moduleId] = { system.dependencies[moduleId] = {
min: minVersion, min: minVersion,
@ -77,6 +82,10 @@
return system.workerMode; return system.workerMode;
}, },
getLayoutOptimize: function () {
return system.layoutOptimize;
},
getDependencies: function () { getDependencies: function () {
return system.dependencies; return system.dependencies;
} }

71
src/core/wrapper/layout.js

@ -16,7 +16,7 @@ BI.Layout = BI.inherit(BI.Widget, {
scrolly: false, // true, false scrolly: false, // true, false
items: [], items: [],
innerHgap: 0, innerHgap: 0,
innerVgap: 0, innerVgap: 0
}; };
}, },
@ -292,6 +292,43 @@ BI.Layout = BI.inherit(BI.Widget, {
return (gap > 0 && gap < 1) ? (gap * 100).toFixed(1) + "%" : gap / BI.pixRatio + BI.pixUnit; return (gap > 0 && gap < 1) ? (gap * 100).toFixed(1) + "%" : gap / BI.pixRatio + BI.pixUnit;
}, },
_optimiseItemLgap: function (item) {
if (BI.Providers.getProvider("bi.provider.system").getLayoutOptimize()) {
return ((!item.type && item.el) ? ((item._lgap || 0) + (item.lgap || 0)) : item._lgap) || 0;
}
return (item._lgap || 0) + (item.lgap || 0);
},
_optimiseItemRgap: function (item) {
if (BI.Providers.getProvider("bi.provider.system").getLayoutOptimize()) {
return ((!item.type && item.el) ? ((item._rgap || 0) + (item.rgap || 0)) : item._rgap) || 0;
}
return (item._rgap || 0) + (item.rgap || 0);
},
_optimiseItemTgap: function (item) {
if (BI.Providers.getProvider("bi.provider.system").getLayoutOptimize()) {
return ((!item.type && item.el) ? ((item._tgap || 0) + (item.tgap || 0)) : item._tgap) || 0;
}
return (item._tgap || 0) + (item.tgap || 0);
},
_optimiseItemBgap: function (item) {
if (BI.Providers.getProvider("bi.provider.system").getLayoutOptimize()) {
return ((!item.type && item.el) ? ((item._bgap || 0) + (item.bgap || 0)) : item._bgap) || 0;
}
return (item._bgap || 0) + (item.bgap || 0);
},
_optimiseItemHgap: function (item) {
if (BI.Providers.getProvider("bi.provider.system").getLayoutOptimize()) {
return ((!item.type && item.el) ? ((item._hgap || 0) + (item.hgap || 0)) : item._hgap) || 0;
}
return (item._hgap || 0) + (item.hgap || 0);
},
_optimiseItemVgap: function (item) {
if (BI.Providers.getProvider("bi.provider.system").getLayoutOptimize()) {
return ((!item.type && item.el) ? ((item._vgap || 0) + (item.vgap || 0)) : item._vgap) || 0;
}
return (item._vgap || 0) + (item.vgap || 0);
},
_handleGap: function (w, item, hIndex, vIndex) { _handleGap: function (w, item, hIndex, vIndex) {
var o = this.options; var o = this.options;
var innerLgap, innerRgap, innerTgap, innerBgap; var innerLgap, innerRgap, innerTgap, innerBgap;
@ -304,26 +341,26 @@ BI.Layout = BI.inherit(BI.Widget, {
innerTgap = vIndex === 0 ? o.innerVgap : 0; innerTgap = vIndex === 0 ? o.innerVgap : 0;
innerBgap = vIndex === o.items.length - 1 ? o.innerVgap : 0; innerBgap = vIndex === o.items.length - 1 ? o.innerVgap : 0;
} }
if (o.vgap + o.tgap + innerTgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { if (o.vgap + o.tgap + innerTgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) {
var top = ((BI.isNull(vIndex) || vIndex === 0) ? o.vgap : 0) + o.tgap + innerTgap + (item.tgap || 0) + (item.vgap || 0); var top = ((BI.isNull(vIndex) || vIndex === 0) ? o.vgap : 0) + o.tgap + innerTgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item);
w.element.css({ w.element.css({
"margin-top": this._optimiseGap(top) "margin-top": this._optimiseGap(top)
}); });
} }
if (o.hgap + o.lgap + innerLgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { if (o.hgap + o.lgap + innerLgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) {
var left = ((BI.isNull(hIndex) || hIndex === 0) ? o.hgap : 0) + o.lgap + innerLgap + (item.lgap || 0) + (item.hgap || 0); var left = ((BI.isNull(hIndex) || hIndex === 0) ? o.hgap : 0) + o.lgap + innerLgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item);
w.element.css({ w.element.css({
"margin-left": this._optimiseGap(left) "margin-left": this._optimiseGap(left)
}); });
} }
if (o.hgap + o.rgap + innerRgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { if (o.hgap + o.rgap + innerRgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) {
var right = o.hgap + o.rgap + innerRgap + (item.rgap || 0) + (item.hgap || 0); var right = o.hgap + o.rgap + innerRgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item);
w.element.css({ w.element.css({
"margin-right": this._optimiseGap(right) "margin-right": this._optimiseGap(right)
}); });
} }
if (o.vgap + o.bgap + innerBgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { if (o.vgap + o.bgap + innerBgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) {
var bottom = o.vgap + o.bgap + innerBgap + (item.bgap || 0) + (item.vgap || 0); var bottom = o.vgap + o.bgap + innerBgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item);
w.element.css({ w.element.css({
"margin-bottom": this._optimiseGap(bottom) "margin-bottom": this._optimiseGap(bottom)
}); });
@ -337,27 +374,27 @@ BI.Layout = BI.inherit(BI.Widget, {
innerLgap = innerRgap = o.innerHgap; innerLgap = innerRgap = o.innerHgap;
innerTgap = index === 0 ? o.innerVgap : 0; innerTgap = index === 0 ? o.innerVgap : 0;
innerBgap = index === o.items.length - 1 ? o.innerVgap : 0; innerBgap = index === o.items.length - 1 ? o.innerVgap : 0;
if (o.vgap + o.tgap + innerTgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { if (o.vgap + o.tgap + innerTgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) {
var top = (index === 0 ? o.vgap : 0) + (index === 0 ? o.tgap : 0) + innerTgap + (item.tgap || 0) + (item.vgap || 0); var top = (index === 0 ? o.vgap : 0) + (index === 0 ? o.tgap : 0) + innerTgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item);
w.element.css({ w.element.css({
"margin-top": this._optimiseGap(top) "margin-top": this._optimiseGap(top)
}); });
} }
if (o.hgap + o.lgap + innerLgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { if (o.hgap + o.lgap + innerLgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) {
var left = o.hgap + o.lgap + innerLgap + (item.lgap || 0) + (item.hgap || 0); var left = o.hgap + o.lgap + innerLgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item);
w.element.css({ w.element.css({
"margin-left": this._optimiseGap(left) "margin-left": this._optimiseGap(left)
}); });
} }
if (o.hgap + o.rgap + innerRgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { if (o.hgap + o.rgap + innerRgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) {
var right = o.hgap + o.rgap + innerRgap + (item.rgap || 0) + (item.hgap || 0); var right = o.hgap + o.rgap + innerRgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item);
w.element.css({ w.element.css({
"margin-right": this._optimiseGap(right) "margin-right": this._optimiseGap(right)
}); });
} }
// 这里的代码是关键 // 这里的代码是关键
if (o.vgap + o.hgap + o.bgap + innerBgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { if (o.vgap + o.hgap + o.bgap + innerBgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) {
var bottom = (index === o.items.length - 1 ? o.vgap : o.hgap) + (index === o.items.length - 1 ? o.bgap : 0) + innerBgap + (item.bgap || 0) + (item.vgap || 0); var bottom = (index === o.items.length - 1 ? o.vgap : o.hgap) + (index === o.items.length - 1 ? o.bgap : 0) + innerBgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item);
w.element.css({ w.element.css({
"margin-bottom": this._optimiseGap(bottom) "margin-bottom": this._optimiseGap(bottom)
}); });

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

@ -30,10 +30,10 @@ BI.AbsoluteCenterLayout = BI.inherit(BI.Layout, {
var w = BI.AbsoluteCenterLayout.superclass._addElement.apply(this, arguments); var w = BI.AbsoluteCenterLayout.superclass._addElement.apply(this, arguments);
w.element.css({ w.element.css({
position: "absolute", position: "absolute",
left: this._optimiseGap(o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0)), left: this._optimiseGap(o.hgap + o.lgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item)),
right: this._optimiseGap(o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0)), right: this._optimiseGap(o.hgap + o.rgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item)),
top: this._optimiseGap(o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0)), top: this._optimiseGap(o.vgap + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item)),
bottom: this._optimiseGap(o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0)), bottom: this._optimiseGap(o.vgap + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item)),
margin: "auto" margin: "auto"
}); });
return w; return w;

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

@ -37,7 +37,7 @@ BI.AbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
_formatItems: function (items) { _formatItems: function (items) {
var o = this.options; var self = this, o = this.options;
var left, right; var left, right;
if (BI.isArray(items)) { if (BI.isArray(items)) {
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
@ -56,17 +56,17 @@ BI.AbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
el: BI.stripEL(item), el: BI.stripEL(item),
width: item.width width: item.width
}; };
if (o.lvgap + o.ltgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { if (o.lvgap + o.ltgap + self._optimiseItemTgap(item) + self._optimiseItemVgap(item) !== 0) {
json.tgap = o.lvgap + o.ltgap + (item.tgap || 0) + (item.vgap || 0); json.tgap = o.lvgap + o.ltgap + self._optimiseItemTgap(item) + self._optimiseItemVgap(item);
} }
if (o.lhgap + o.llgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { if (o.lhgap + o.llgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) !== 0) {
json.lgap = (i === 0 ? o.lhgap : 0) + o.llgap + (item.lgap || 0) + (item.hgap || 0); json.lgap = (i === 0 ? o.lhgap : 0) + o.llgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item);
} }
if (o.lhgap + o.lrgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { if (o.lhgap + o.lrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) !== 0) {
json.rgap = o.lhgap + o.lrgap + (item.rgap || 0) + (item.hgap || 0); json.rgap = o.lhgap + o.lrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item);
} }
if (o.lvgap + o.lbgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { if (o.lvgap + o.lbgap + self._optimiseItemBgap(item) + self._optimiseItemVgap(item) !== 0) {
json.bgap = o.lvgap + o.lbgap + (item.bgap || 0) + (item.vgap || 0); json.bgap = o.lvgap + o.lbgap + self._optimiseItemBgap(item) + self._optimiseItemVgap(item);
} }
return json; return json;
}); });
@ -75,17 +75,17 @@ BI.AbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
el: BI.stripEL(item), el: BI.stripEL(item),
width: item.width width: item.width
}; };
if (o.rvgap + o.rtgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { if (o.rvgap + o.rtgap + self._optimiseItemTgap(item) + self._optimiseItemVgap(item) !== 0) {
json.tgap = o.rvgap + o.rtgap + (item.tgap || 0) + (item.vgap || 0); json.tgap = o.rvgap + o.rtgap + self._optimiseItemTgap(item) + self._optimiseItemVgap(item);
} }
if (o.rhgap + o.rlgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { if (o.rhgap + o.rlgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) !== 0) {
json.lgap = (i === 0 ? o.rhgap : 0) + o.rlgap + (item.lgap || 0) + (item.hgap || 0); json.lgap = (i === 0 ? o.rhgap : 0) + o.rlgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item);
} }
if (o.rhgap + o.rrgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { if (o.rhgap + o.rrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) !== 0) {
json.rgap = o.rhgap + o.rrgap + (item.rgap || 0) + (item.hgap || 0); json.rgap = o.rhgap + o.rrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item);
} }
if (o.rvgap + o.rbgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { if (o.rvgap + o.rbgap + self._optimiseItemBgap(item) + self._optimiseItemVgap(item) !== 0) {
json.bgap = o.rvgap + o.rbgap + (item.bgap || 0) + (item.vgap || 0); json.bgap = o.rvgap + o.rbgap + self._optimiseItemBgap(item) + self._optimiseItemVgap(item);
} }
return json; return json;
}); });

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

@ -70,8 +70,8 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, {
td.element.width(width); td.element.width(width);
} }
if (o.verticalAlign === BI.VerticalAlign.Stretch) { if (o.verticalAlign === BI.VerticalAlign.Stretch) {
var top = o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0), var top = o.vgap + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item),
bottom = o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0); bottom = o.vgap + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item);
w.element.css("height", "calc(100% - " + this._optimiseGap(top + bottom) + ")"); w.element.css("height", "calc(100% - " + this._optimiseGap(top + bottom) + ")");
} }
// 对于表现为td的元素设置最大宽度,有几点需要注意 // 对于表现为td的元素设置最大宽度,有几点需要注意

8
src/core/wrapper/layout/fill/auto.vtape.js

@ -60,10 +60,10 @@ BI.AutoVerticalTapeLayout = BI.inherit(BI.Layout, {
if (preRowSize === "") { if (preRowSize === "") {
preRowSize = self.layout.getWidgetByName(self._getChildName(i - 1)).element.height(); preRowSize = self.layout.getWidgetByName(self._getChildName(i - 1)).element.height();
} }
top[i] = top[i - 1] + preRowSize + (items[i - 1].tgap || 0) + (items[i - 1].bgap || 0) + 2 * (items[i - 1].vgap || 0) + o.vgap + o.tgap + o.bgap; top[i] = top[i - 1] + preRowSize + self._optimiseItemTgap(items[i - 1]) + self._optimiseItemBgap(items[i - 1]) + 2 * self._optimiseItemVgap(items[i - 1]) + o.vgap + o.tgap + o.bgap;
} }
w.element.css({ w.element.css({
top: self._optimiseGap(top[i] + (item.vgap || 0) + (item.tgap || 0) + o.vgap + o.tgap) top: self._optimiseGap(top[i] + self._optimiseItemTgap(item) + self._optimiseItemVgap(item) + o.vgap + o.tgap)
}); });
if (rowSize === "fill") { if (rowSize === "fill") {
@ -81,10 +81,10 @@ BI.AutoVerticalTapeLayout = BI.inherit(BI.Layout, {
if (nextRowSize === "") { if (nextRowSize === "") {
nextRowSize = self.layout.getWidgetByName(self._getChildName(i + 1)).element.height(); nextRowSize = self.layout.getWidgetByName(self._getChildName(i + 1)).element.height();
} }
bottom[i] = bottom[i + 1] + nextRowSize + (items[i + 1].tgap || 0) + (items[i + 1].bgap || 0) + 2 * (items[i + 1].vgap || 0) + o.vgap + o.tgap + o.bgap; bottom[i] = bottom[i + 1] + nextRowSize + self._optimiseItemTgap(items[i + 1]) + self._optimiseItemBgap(items[i + 1]) + 2 * self._optimiseItemVgap(items[i + 1]) + o.vgap + o.tgap + o.bgap;
} }
w.element.css({ w.element.css({
bottom: self._optimiseGap(bottom[i] + (item.vgap || 0) + (item.bgap || 0) + o.vgap + o.bgap), bottom: self._optimiseGap(bottom[i] + self._optimiseItemBgap(item) + self._optimiseItemVgap(item) + o.vgap + o.bgap),
}); });
if (rowSize === "fill") { if (rowSize === "fill") {

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

@ -45,41 +45,41 @@ BI.FloatHorizontalFillLayout = BI.inherit(BI.Layout, {
} else { } else {
var w = BI._lazyCreateWidget(item); var w = BI._lazyCreateWidget(item);
} }
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { if (o.vgap + o.tgap + self._optimiseItemTgap(item) + self._optimiseItemVgap(item) !== 0) {
w.element.css({ w.element.css({
"margin-top": self._optimiseGap(o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0)) "margin-top": self._optimiseGap(o.vgap + o.tgap + self._optimiseItemTgap(item) + self._optimiseItemVgap(item))
}); });
} }
if (desc) { if (desc) {
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { if (o.hgap + o.rgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) !== 0) {
w.element.css({ w.element.css({
"margin-right": self._optimiseGap((i === o.items.length - 1 ? o.hgap : 0) + o.rgap + (item.rgap || 0) + (item.hgap || 0)) "margin-right": self._optimiseGap((i === o.items.length - 1 ? o.hgap : 0) + o.rgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item))
}); });
} }
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { if (o.hgap + o.lgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) !== 0) {
w.element.css({ w.element.css({
"margin-left": self._optimiseGap(o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0)) "margin-left": self._optimiseGap(o.hgap + o.lgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item))
}); });
} }
} else { } else {
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { if (o.hgap + o.lgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) !== 0) {
w.element.css({ w.element.css({
"margin-left": self._optimiseGap((i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0)) "margin-left": self._optimiseGap((i === 0 ? o.hgap : 0) + o.lgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item))
}); });
} }
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { if (o.hgap + o.rgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) !== 0) {
w.element.css({ w.element.css({
"margin-right": self._optimiseGap(o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0)) "margin-right": self._optimiseGap(o.hgap + o.rgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item))
}); });
} }
} }
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { if (o.vgap + o.bgap + self._optimiseItemBgap(item) + self._optimiseItemVgap(item) !== 0) {
w.element.css({ w.element.css({
"margin-bottom": self._optimiseGap(o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0)) "margin-bottom": self._optimiseGap(o.vgap + o.bgap + self._optimiseItemBgap(item) + self._optimiseItemVgap(item))
}); });
} }
var top = o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0), var top = o.vgap + o.tgap + self._optimiseItemTgap(item) + self._optimiseItemVgap(item),
bottom = o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0); bottom = o.vgap + o.bgap + self._optimiseItemBgap(item) + self._optimiseItemVgap(item);
if (o.verticalAlign === BI.VerticalAlign.Stretch && BI.isNull(item.height)) { if (o.verticalAlign === BI.VerticalAlign.Stretch && BI.isNull(item.height)) {
w.element.css({ w.element.css({
height: "calc(100% - " + self._optimiseGap(top + bottom) + ")" height: "calc(100% - " + self._optimiseGap(top + bottom) + ")"

3
src/core/wrapper/layout/flex/flex.horizontal.js

@ -82,6 +82,9 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, {
if (columnSize === "fill") { if (columnSize === "fill") {
w.element.addClass("f-f"); w.element.addClass("f-f");
} }
if (columnSize === "" || columnSize === "auto") {
w.element.addClass("f-auto");
}
w.element.addClass("c-e"); w.element.addClass("c-e");
if (i === 0) { if (i === 0) {
w.element.addClass("f-c"); w.element.addClass("f-c");

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

@ -2,6 +2,7 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
props: function () { props: function () {
return BI.extend(BI.FlexLeftRightVerticalAdaptLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.FlexLeftRightVerticalAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-f-lr-v-c", baseCls: "bi-f-lr-v-c",
columnSize: [],
items: {}, items: {},
llgap: 0, llgap: 0,
lrgap: 0, lrgap: 0,
@ -20,22 +21,24 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
render: function () { render: function () {
var o = this.options, self = this; var o = this.options, self = this;
BI.FlexLeftRightVerticalAdaptLayout.superclass.render.apply(this, arguments); BI.FlexLeftRightVerticalAdaptLayout.superclass.render.apply(this, arguments);
var items = this._formatItems(o.items);
return { return {
type: "bi.flex_vertical_adapt", type: "bi.flex_vertical_adapt",
ref: function (_ref) { ref: function (_ref) {
self.layout = _ref; self.layout = _ref;
}, },
items: this._formatItems(o.items), columnSize: o.columnSize.slice(0, (o.items.left || []).length).concat((o.items.right || []).length > 0 ? [""] : []),
items: items,
scrollx: o.scrollx, scrollx: o.scrollx,
scrolly: o.scrolly, scrolly: o.scrolly,
scrollable: o.scrollable, scrollable: o.scrollable,
innerHgap: o.innerHgap, innerHgap: o.innerHgap,
innerVgap: o.innerVgap, innerVgap: o.innerVgap
}; };
}, },
_formatItems: function (items) { _formatItems: function (items) {
var o = this.options; var self = this, o = this.options;
var left, right; var left, right;
if (BI.isArray(items)) { if (BI.isArray(items)) {
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
@ -53,23 +56,24 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
var json = { var json = {
el: BI.stripEL(item) el: BI.stripEL(item)
}; };
if (o.lvgap + o.ltgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { if (o.lvgap + o.ltgap + self._optimiseItemTgap(item) + self._optimiseItemVgap(item) !== 0) {
json.tgap = o.lvgap + o.ltgap + (item.tgap || 0) + (item.vgap || 0); json.tgap = o.lvgap + o.ltgap + self._optimiseItemTgap(item) + self._optimiseItemVgap(item);
} }
if (o.lhgap + o.llgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { if (o.lhgap + o.llgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) !== 0) {
json.lgap = (i === 0 ? o.lhgap : 0) + o.llgap + (item.lgap || 0) + (item.hgap || 0); json.lgap = (i === 0 ? o.lhgap : 0) + o.llgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item);
} }
if (o.lhgap + o.lrgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { if (o.lhgap + o.lrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) !== 0) {
json.rgap = o.lhgap + o.lrgap + (item.rgap || 0) + (item.hgap || 0); json.rgap = o.lhgap + o.lrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item);
} }
if (o.lvgap + o.lbgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { if (o.lvgap + o.lbgap + self._optimiseItemBgap(item) + self._optimiseItemVgap(item) !== 0) {
json.bgap = o.lvgap + o.lbgap + (item.bgap || 0) + (item.vgap || 0); json.bgap = o.lvgap + o.lbgap + self._optimiseItemBgap(item) + self._optimiseItemVgap(item);
} }
return json; return json;
}); });
return leftItems.concat({ return leftItems.concat({
el: { el: {
type: "bi.flex_vertical_adapt", type: "bi.flex_vertical_adapt",
columnSize: o.columnSize.slice(leftItems.length),
css: { css: {
"margin-left": "auto" "margin-left": "auto"
}, },

3
src/core/wrapper/layout/flex/flex.vertical.js

@ -81,6 +81,9 @@ BI.FlexVerticalLayout = BI.inherit(BI.Layout, {
if (rowSize === "fill") { if (rowSize === "fill") {
w.element.addClass("f-f"); w.element.addClass("f-f");
} }
if (rowSize === "" || rowSize === "auto") {
w.element.addClass("f-auto");
}
w.element.addClass("c-e"); w.element.addClass("c-e");
if (i === 0) { if (i === 0) {
w.element.addClass("f-c"); w.element.addClass("f-c");

4
src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js

@ -79,6 +79,10 @@ BI.FlexWrapperHorizontalLayout = BI.inherit(BI.Layout, {
w.element.addClass("f-f"); w.element.addClass("f-f");
this.element.addClass("f-f"); this.element.addClass("f-f");
} }
if (columnSize === "" || columnSize === "auto") {
w.element.addClass("f-auto");
this.element.addClass("f-auto");
}
w.element.addClass("c-e"); w.element.addClass("c-e");
if (i === 0) { if (i === 0) {
w.element.addClass("f-c"); w.element.addClass("f-c");

4
src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js

@ -79,6 +79,10 @@ BI.FlexWrapperVerticalLayout = BI.inherit(BI.Layout, {
w.element.addClass("f-f"); w.element.addClass("f-f");
this.element.addClass("f-f"); this.element.addClass("f-f");
} }
if (rowSize === "" || rowSize === "auto") {
w.element.addClass("f-auto");
this.element.addClass("f-auto");
}
w.element.addClass("c-e"); w.element.addClass("c-e");
if (i === 0) { if (i === 0) {
w.element.addClass("f-c"); w.element.addClass("f-c");

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

@ -38,7 +38,7 @@ BI.FloatAbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
_formatItems: function (items) { _formatItems: function (items) {
var o = this.options; var self = this, o = this.options;
var left, right; var left, right;
if (BI.isArray(items)) { if (BI.isArray(items)) {
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
@ -68,11 +68,11 @@ BI.FloatAbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
// if (o.lvgap + o.ltgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { // if (o.lvgap + o.ltgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
// json.tgap = o.lvgap + o.ltgap + (item.tgap || 0) + (item.vgap || 0); // json.tgap = o.lvgap + o.ltgap + (item.tgap || 0) + (item.vgap || 0);
// } // }
if (o.lhgap + o.llgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { if (o.lhgap + o.llgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) !== 0) {
json.lgap = (i === 0 ? o.lhgap : 0) + o.llgap + (item.lgap || 0) + (item.hgap || 0); json.lgap = (i === 0 ? o.lhgap : 0) + o.llgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item);
} }
if (o.lhgap + o.lrgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { if (o.lhgap + o.lrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) !== 0) {
json.rgap = o.lhgap + o.lrgap + (item.rgap || 0) + (item.hgap || 0); json.rgap = o.lhgap + o.lrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item);
} }
// if (o.lvgap + o.lbgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { // if (o.lvgap + o.lbgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
// json.bgap = o.lvgap + o.lbgap + (item.bgap || 0) + (item.vgap || 0); // json.bgap = o.lvgap + o.lbgap + (item.bgap || 0) + (item.vgap || 0);
@ -95,11 +95,11 @@ BI.FloatAbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
// if (o.rvgap + o.rtgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { // if (o.rvgap + o.rtgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
// json.tgap = o.rvgap + o.rtgap + (item.tgap || 0) + (item.vgap || 0); // json.tgap = o.rvgap + o.rtgap + (item.tgap || 0) + (item.vgap || 0);
// } // }
if (o.rhgap + o.rlgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { if (o.rhgap + o.rlgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) !== 0) {
json.lgap = (i === 0 ? o.rhgap : 0) + o.rlgap + (item.lgap || 0) + (item.hgap || 0); json.lgap = (i === 0 ? o.rhgap : 0) + o.rlgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item);
} }
if (o.rhgap + o.rrgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { if (o.rhgap + o.rrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) !== 0) {
json.rgap = o.rhgap + o.rrgap + (item.rgap || 0) + (item.hgap || 0); json.rgap = o.rhgap + o.rrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item);
} }
// if (o.rvgap + o.rbgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { // if (o.rvgap + o.rbgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
// json.bgap = o.rvgap + o.rbgap + (item.bgap || 0) + (item.vgap || 0); // json.bgap = o.rvgap + o.rbgap + (item.bgap || 0) + (item.vgap || 0);

36
src/core/wrapper/layout/layout.flow.js

@ -56,26 +56,26 @@ BI.FloatLeftLayout = BI.inherit(BI.Layout, {
if (BI.isNotNull(item.bottom)) { if (BI.isNotNull(item.bottom)) {
w.element.css({bottom: BI.isNumber(item.bottom) ? this._optimiseGap(item.bottom) : item.bottom}); w.element.css({bottom: BI.isNumber(item.bottom) ? this._optimiseGap(item.bottom) : item.bottom});
} }
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { if (o.vgap + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) {
var top = o.vgap / 2 + o.tgap + (item.tgap || 0) + (item.vgap || 0); var top = o.vgap / 2 + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item);
w.element.css({ w.element.css({
"margin-top": this._optimiseGap(top) "margin-top": this._optimiseGap(top)
}); });
} }
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { if (o.hgap + o.lgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) {
var left = o.hgap / 2 + o.lgap + (item.lgap || 0) + (item.hgap || 0); var left = o.hgap / 2 + o.lgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item);
w.element.css({ w.element.css({
"margin-left": this._optimiseGap(left) "margin-left": this._optimiseGap(left)
}); });
} }
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { if (o.hgap + o.rgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) {
var right = o.hgap / 2 + o.rgap + (item.rgap || 0) + (item.hgap || 0); var right = o.hgap / 2 + o.rgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item);
w.element.css({ w.element.css({
"margin-right": this._optimiseGap(right) "margin-right": this._optimiseGap(right)
}); });
} }
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { if (o.vgap + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) {
var bottom = o.vgap / 2 + o.bgap + (item.bgap || 0) + (item.vgap || 0); var bottom = o.vgap / 2 + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item);
w.element.css({ w.element.css({
"margin-bottom": this._optimiseGap(bottom) "margin-bottom": this._optimiseGap(bottom)
}); });
@ -148,24 +148,28 @@ BI.FloatRightLayout = BI.inherit(BI.Layout, {
if (BI.isNotNull(item.bottom)) { if (BI.isNotNull(item.bottom)) {
w.element.css({bottom: BI.isNumber(item.bottom) ? item.bottom / BI.pixRatio + BI.pixUnit : item.bottom}); w.element.css({bottom: BI.isNumber(item.bottom) ? item.bottom / BI.pixRatio + BI.pixUnit : item.bottom});
} }
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { if (o.vgap + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) {
var top = o.vgap / 2 + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item);
w.element.css({ w.element.css({
"margin-top": (o.vgap / 2 + o.tgap + (item.tgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit "margin-top": this._optimiseGap(top)
}); });
} }
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { if (o.hgap + o.lgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) {
var left = o.hgap / 2 + o.lgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item);
w.element.css({ w.element.css({
"margin-left": (o.hgap / 2 + o.lgap + (item.lgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit "margin-left": this._optimiseGap(left)
}); });
} }
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { if (o.hgap + o.rgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) {
var right = o.hgap / 2 + o.rgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item);
w.element.css({ w.element.css({
"margin-right": (o.hgap / 2 + o.rgap + (item.rgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit "margin-right": this._optimiseGap(right)
}); });
} }
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { if (o.vgap + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) {
var bottom = o.vgap / 2 + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item);
w.element.css({ w.element.css({
"margin-bottom": (o.vgap / 2 + o.bgap + (item.bgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit "margin-bottom": this._optimiseGap(bottom)
}); });
} }
return w; return w;

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

@ -40,7 +40,7 @@ BI.InlineLayout = BI.inherit(BI.Layout, {
_addElement: function (i, item) { _addElement: function (i, item) {
var o = this.options; var o = this.options;
var w = BI.InlineLayout.superclass._addElement.apply(this, arguments); var w = BI.InlineLayout.superclass._addElement.apply(this, arguments);
var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width >= 1 ? null : item.width; var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width;
if (o.columnSize.length > 0) { if (o.columnSize.length > 0) {
if (item.width >= 1 && o.columnSize[i] >= 1 && o.columnSize[i] !== item.width) { if (item.width >= 1 && o.columnSize[i] >= 1 && o.columnSize[i] !== item.width) {
columnSize = null; columnSize = null;
@ -66,7 +66,7 @@ BI.InlineLayout = BI.inherit(BI.Layout, {
autoCount++; autoCount++;
cz = 0; cz = 0;
} }
gap += o.hgap + o.lgap + o.rgap + (o.items[k].lgap || 0) + (o.items[k].rgap || 0) + (o.items[k].hgap || 0); gap += o.hgap + o.lgap + o.rgap + this._optimiseItemLgap(o.items[k]) + this._optimiseItemRgap(o.items[k]) + this._optimiseItemHgap(o.items[k]);
length += cz; length += cz;
} }
length = length > 0 && length < 1 ? (length * 100).toFixed(1) + "%" : length / BI.pixRatio + BI.pixUnit; length = length > 0 && length < 1 ? (length * 100).toFixed(1) + "%" : length / BI.pixRatio + BI.pixUnit;
@ -84,8 +84,8 @@ BI.InlineLayout = BI.inherit(BI.Layout, {
} }
this._handleGap(w, item, i); this._handleGap(w, item, i);
if (o.verticalAlign === BI.VerticalAlign.Stretch && BI.isNull(item.height)) { if (o.verticalAlign === BI.VerticalAlign.Stretch && BI.isNull(item.height)) {
var top = o.innerVgap + o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0), var top = o.innerVgap + o.vgap + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item),
bottom = o.innerVgap + o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0); bottom = o.innerVgap + o.vgap + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item);
var gap = (top + bottom) > 0 && (top + bottom) < 1 ? ((top + bottom) * 100).toFixed(1) + "%" : (top + bottom) / BI.pixRatio + BI.pixUnit; var gap = (top + bottom) > 0 && (top + bottom) < 1 ? ((top + bottom) * 100).toFixed(1) + "%" : (top + bottom) / BI.pixRatio + BI.pixUnit;
w.element.css("height", "calc(100% - " + gap + ")"); w.element.css("height", "calc(100% - " + gap + ")");
} }

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

@ -53,8 +53,8 @@ BI.HTapeLayout = BI.inherit(BI.Layout, {
} }
w.element.css({ w.element.css({
position: "absolute", position: "absolute",
top: self._optimiseGap((item.vgap || 0) + (item.tgap || 0) + o.innerVgap + o.vgap + o.tgap), top: self._optimiseGap(self._optimiseItemTgap(item) + self._optimiseItemVgap(item) + o.innerVgap + o.vgap + o.tgap),
bottom: self._optimiseGap((item.bgap || 0) + (item.vgap || 0) + o.innerVgap + o.vgap + o.bgap), bottom: self._optimiseGap(self._optimiseItemBgap(item) + self._optimiseItemVgap(item) + o.innerVgap + o.vgap + o.bgap),
width: BI.isNumber(columnSize) ? self._optimiseGap(columnSize) : "" width: BI.isNumber(columnSize) ? self._optimiseGap(columnSize) : ""
}); });
if (o.verticalAlign === BI.VerticalAlign.Middle) { if (o.verticalAlign === BI.VerticalAlign.Middle) {
@ -86,10 +86,10 @@ BI.HTapeLayout = BI.inherit(BI.Layout, {
} }
if (BI.isNull(left[i])) { if (BI.isNull(left[i])) {
var preColumnSize = o.columnSize.length > 0 ? o.columnSize[i - 1] : items[i - 1].width; var preColumnSize = o.columnSize.length > 0 ? o.columnSize[i - 1] : items[i - 1].width;
left[i] = left[i - 1] + preColumnSize + (items[i - 1].lgap || 0) + (items[i - 1].rgap || 0) + 2 * (items[i - 1].hgap || 0) + o.hgap + o.lgap + o.rgap; left[i] = left[i - 1] + preColumnSize + self._optimiseItemLgap(items[i - 1]) + self._optimiseItemRgap(items[i - 1]) + 2 * self._optimiseItemHgap(items[i - 1]) + o.hgap + o.lgap + o.rgap;
} }
w.element.css({ w.element.css({
left: self._optimiseGap(left[i] + (item.lgap || 0) + (item.hgap || 0) + o.hgap + o.lgap) left: self._optimiseGap(left[i] + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) + o.hgap + o.lgap)
}); });
if (columnSize === "" || columnSize === "fill") { if (columnSize === "" || columnSize === "fill") {
@ -104,10 +104,10 @@ BI.HTapeLayout = BI.inherit(BI.Layout, {
var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width; var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width;
if (BI.isNull(right[i])) { if (BI.isNull(right[i])) {
var nextColumnSize = o.columnSize.length > 0 ? o.columnSize[i + 1] : items[i + 1].width; var nextColumnSize = o.columnSize.length > 0 ? o.columnSize[i + 1] : items[i + 1].width;
right[i] = right[i + 1] + nextColumnSize + (items[i + 1].lgap || 0) + (items[i + 1].rgap || 0) + 2 * (items[i + 1].hgap || 0) + o.hgap + o.lgap + o.rgap; right[i] = right[i + 1] + nextColumnSize + self._optimiseItemLgap(items[i + 1]) + self._optimiseItemRgap(items[i + 1]) + 2 * self._optimiseItemHgap(items[i + 1]) + o.hgap + o.lgap + o.rgap;
} }
w.element.css({ w.element.css({
right: self._optimiseGap(right[i] + (item.rgap || 0) + (item.hgap || 0) + o.hgap + o.rgap) right: self._optimiseGap(right[i] + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) + o.hgap + o.rgap)
}); });
if (columnSize === "" || columnSize === "fill") { if (columnSize === "" || columnSize === "fill") {
@ -178,8 +178,8 @@ BI.VTapeLayout = BI.inherit(BI.Layout, {
} }
w.element.css({ w.element.css({
position: "absolute", position: "absolute",
left: self._optimiseGap((item.lgap || 0) + (item.hgap || 0) + o.innerHgap + o.hgap + o.lgap), left: self._optimiseGap(self._optimiseItemLgap(item) + self._optimiseItemHgap(item) + o.innerHgap + o.hgap + o.lgap),
right: self._optimiseGap((item.hgap || 0) + (item.rgap || 0) + o.innerHgap + o.hgap + o.rgap), right: self._optimiseGap(self._optimiseItemRgap(item) + self._optimiseItemHgap(item) + o.innerHgap + o.hgap + o.rgap),
height: BI.isNumber(rowSize) ? self._optimiseGap(rowSize) : "" height: BI.isNumber(rowSize) ? self._optimiseGap(rowSize) : ""
}); });
if (o.horizontalAlign === BI.HorizontalAlign.Center) { if (o.horizontalAlign === BI.HorizontalAlign.Center) {
@ -211,10 +211,10 @@ BI.VTapeLayout = BI.inherit(BI.Layout, {
} }
if (BI.isNull(top[i])) { if (BI.isNull(top[i])) {
var preRowSize = o.rowSize.length > 0 ? o.rowSize[i - 1] : items[i - 1].height; var preRowSize = o.rowSize.length > 0 ? o.rowSize[i - 1] : items[i - 1].height;
top[i] = top[i - 1] + preRowSize + (items[i - 1].tgap || 0) + (items[i - 1].bgap || 0) + 2 * (items[i - 1].vgap || 0) + o.vgap + o.tgap + o.bgap; top[i] = top[i - 1] + preRowSize + self._optimiseItemTgap(items[i - 1]) + self._optimiseItemBgap(items[i - 1]) + 2 * self._optimiseItemVgap(items[i - 1]) + o.vgap + o.tgap + o.bgap;
} }
w.element.css({ w.element.css({
top: self._optimiseGap(top[i] + (item.vgap || 0) + (item.tgap || 0) + o.vgap + o.tgap) top: self._optimiseGap(top[i] + self._optimiseItemTgap(item) + self._optimiseItemVgap(item) + o.vgap + o.tgap)
}); });
if (rowSize === "" || rowSize === "fill") { if (rowSize === "" || rowSize === "fill") {
@ -229,10 +229,10 @@ BI.VTapeLayout = BI.inherit(BI.Layout, {
var rowSize = o.rowSize.length > 0 ? o.rowSize[i] : item.height; var rowSize = o.rowSize.length > 0 ? o.rowSize[i] : item.height;
if (BI.isNull(bottom[i])) { if (BI.isNull(bottom[i])) {
var nextRowSize = o.rowSize.length > 0 ? o.rowSize[i + 1] : items[i + 1].height; var nextRowSize = o.rowSize.length > 0 ? o.rowSize[i + 1] : items[i + 1].height;
bottom[i] = bottom[i + 1] + nextRowSize + (items[i + 1].tgap || 0) + (items[i + 1].bgap || 0) + 2 * (items[i + 1].vgap || 0) + o.vgap + o.tgap + o.bgap; bottom[i] = bottom[i + 1] + nextRowSize + self._optimiseItemTgap(items[i + 1]) + self._optimiseItemBgap(items[i + 1]) + 2 * self._optimiseItemVgap(items[i + 1]) + o.vgap + o.tgap + o.bgap;
} }
w.element.css({ w.element.css({
bottom: self._optimiseGap(bottom[i] + (item.vgap || 0) + (item.bgap || 0) + o.vgap + o.bgap) bottom: self._optimiseGap(bottom[i] + self._optimiseItemBgap(item) + self._optimiseItemVgap(item) + o.vgap + o.bgap)
}); });
if (rowSize === "" || rowSize === "fill") { if (rowSize === "" || rowSize === "fill") {

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

@ -92,8 +92,8 @@ BI.TdLayout = BI.inherit(BI.Layout, {
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
var w = BI._lazyCreateWidget(arr[i]); var w = BI._lazyCreateWidget(arr[i]);
if (o.verticalAlign === BI.VerticalAlign.Stretch) { if (o.verticalAlign === BI.VerticalAlign.Stretch) {
var top = o.vgap + o.tgap + (arr[i].tgap || 0) + (arr[i].vgap || 0), var top = o.vgap + o.tgap + this._optimiseItemTgap(arr[i]) + this._optimiseItemVgap(arr[i]),
bottom = o.vgap + o.bgap + (arr[i].bgap || 0) + (arr[i].vgap || 0); bottom = o.vgap + o.bgap + this._optimiseItemBgap(arr[i]) + this._optimiseItemVgap(arr[i]);
w.element.css("height", "calc(100% - " + this._optimiseGap(top + bottom) + ")"); w.element.css("height", "calc(100% - " + this._optimiseGap(top + bottom) + ")");
} }
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"}); w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});

3
src/core/wrapper/layout/sticky/sticky.horizontal.js

@ -5,7 +5,8 @@ BI.HorizontalStickyLayout = BI.inherit(BI.FlexHorizontalLayout, {
props: function () { props: function () {
return BI.extend(BI.HorizontalStickyLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.HorizontalStickyLayout.superclass.props.apply(this, arguments), {
extraCls: "bi-h-sticky", extraCls: "bi-h-sticky",
horizontalAlign: BI.HorizontalAlign.Stretch, scrollx: true,
// horizontalAlign: BI.HorizontalAlign.Stretch,
verticalAlign: BI.VerticalAlign.Stretch verticalAlign: BI.VerticalAlign.Stretch
}); });
}, },

3
src/core/wrapper/layout/sticky/sticky.vertical.js

@ -5,8 +5,9 @@ BI.VerticalStickyLayout = BI.inherit(BI.FlexVerticalLayout, {
props: function () { props: function () {
return BI.extend(BI.VerticalStickyLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.VerticalStickyLayout.superclass.props.apply(this, arguments), {
extraCls: "bi-v-sticky", extraCls: "bi-v-sticky",
scrolly: true,
horizontalAlign: BI.HorizontalAlign.Stretch, horizontalAlign: BI.HorizontalAlign.Stretch,
verticalAlign: BI.VerticalAlign.Stretch // verticalAlign: BI.VerticalAlign.Stretch
}); });
}, },

4
src/less/base/colorchooser/colorchooser.trigger.less

@ -1,9 +1,5 @@
@import "../../index.less"; @import "../../index.less";
.bi-color-chooser-trigger {
.border-radius(2px);
}
.bi-combo-popup { .bi-combo-popup {
&>.bi-color-chooser-trigger { &>.bi-color-chooser-trigger {
border-color: @color-bi-border-hover-combo; border-color: @color-bi-border-hover-combo;

39
src/less/base/combo/combo.less

@ -1,19 +1,22 @@
@import "../../index.less"; @import "../../index.less";
@val: transform .3s ease; @val: transform .3s ease;
.bi-combo { .bi-combo {
& > .bi-trigger { & > .bi-trigger {
& .bi-trigger-icon-button{ & .bi-trigger-icon-button {
& .x-icon { & .x-icon {
.rotate(0deg); .rotate(0deg);
.transition(@val); .transition(@val);
} }
} }
} }
&.bi-combo-popup { &.bi-combo-popup {
display: block !important; display: block !important;
visibility: visible !important; visibility: visible !important;
& > .bi-trigger { & > .bi-trigger {
& .bi-trigger-icon-button{ & .bi-trigger-icon-button {
& .x-icon { & .x-icon {
.rotate(180deg); .rotate(180deg);
.transition(@val); .transition(@val);
@ -21,11 +24,13 @@
} }
} }
} }
&.bi-combo-popup, &.bi-combo-hover, &:hover { &.bi-combo-popup, &.bi-combo-hover, &:hover {
&.bi-border, &.bi-border-bottom { &.bi-border, &.bi-border-bottom {
border-color: @color-bi-border-hover-combo; border-color: @color-bi-border-hover-combo;
} }
} }
&.disabled { &.disabled {
&.bi-combo-hover, &:hover { &.bi-combo-hover, &:hover {
&.bi-border, &.bi-border-bottom { &.bi-border, &.bi-border-bottom {
@ -33,6 +38,36 @@
} }
} }
} }
&.error {
&.bi-combo-hover, &:hover {
&.bi-border, &.bi-border-bottom {
border-color: @border-color-negative;
}
}
}
// 将来统一变成combo的特性
//&.status-error {
// &.bi-border, &.bi-border-bottom {
// border-color: @border-color-negative;
// }
//
// .bi-trigger .select-text-label {
// color: @color-bi-text-error-text-trigger;
// }
//}
//
//&.status-warning {
// &.bi-border, &.bi-border-bottom {
// border-color: @border-color-warning;
// }
//
// .bi-trigger .select-text-label {
// color: @font-color-warning;
// }
//}
} }
.bi-theme-dark { .bi-theme-dark {

28
src/less/base/combo/combo.searchtextvalue.less

@ -1,33 +1,19 @@
@import "../../index.less"; @import "../../index.less";
@val: transform .3s ease;
.bi-search-text-value-combo{ .bi-search-text-value-combo {
& .trigger-icon-button{ & .trigger-icon-button {
font-size: 16px; font-size: 16px;
} }
& .search-text-value-trigger{
.border-radius(2px);
}
&.combo-error { &.combo-error {
& .bi-search-text-value-trigger{ & .bi-search-text-value-trigger {
& .bi-text-button { & .bi-text-button {
color: @color-bi-text-error-hover-search-text-value-combo; color: @color-bi-text-error-hover-search-text-value-combo;
} }
} }
&>.bi-border, &>.bi-border-bottom {
&.bi-border, &.bi-border-bottom {
border-color: @border-color-negative; border-color: @border-color-negative;
} }
} }
// 此combo的trigger_button是absolute上去的,与bi-combo在同一层级,独立写一下
& .bi-combo.bi-combo-popup + .bi-trigger-icon-button {
& .x-icon {
.rotate(180deg);
.transition(@val);
}
}
& .bi-combo + .bi-trigger-icon-button {
& .x-icon {
.rotate(0deg);
.transition(@val);
}
}
} }

14
src/less/base/combo/combo.textvalue.less

@ -1,14 +0,0 @@
@import "../../index.less";
.bi-text-value-combo {
&.combo-error {
& .bi-select-text-trigger {
& .select-text-label {
color: @color-bi-text-error-hover-text-value-combo;
}
}
&.bi-border, &.bi-border-bottom {
border-color: @border-color-negative;
}
}
}

1
src/less/base/editor/editor.search.less

@ -1,7 +1,6 @@
@import "../../index.less"; @import "../../index.less";
/*************BI.SearchEditor******************/ /*************BI.SearchEditor******************/
.bi-search-editor { .bi-search-editor {
.border-radius(2px);
& .circle-close-font{ & .circle-close-font{
font-size: @font-size-18; font-size: @font-size-18;
} }

72
src/less/base/single/button/button.less

@ -41,6 +41,22 @@ body .bi-button, #body .bi-button {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-common-button; color: @color-bi-text-common-button;
} }
&.light {
border-width: 0;
background-color: @color-bi-background-common-light-button;
&, & .b-font:before {
color: @color-bi-text-common-light-button;
}
&:hover, &:focus {
background-color: @color-bi-background-hover-common-light-button;
}
&.active {
background-color: @color-bi-background-active-common-light-button;
}
}
&.clear, &.clear .b-font:before { &.clear, &.clear .b-font:before {
color: @color-bi-text-common-clear-button; color: @color-bi-text-common-clear-button;
} }
@ -48,7 +64,7 @@ body .bi-button, #body .bi-button {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-common-ghost-button; color: @color-bi-text-common-ghost-button;
} }
&:hover, &:focus { &:hover, &:focus, &:hover .b-font:before, &:focus .b-font:before {
color: @color-bi-text; color: @color-bi-text;
background-color: @color-bi-background-hover-common-ghost-button; background-color: @color-bi-background-hover-common-ghost-button;
} }
@ -92,6 +108,22 @@ body .bi-button, #body .bi-button {
background-color: @color-bi-background-success-button; background-color: @color-bi-background-success-button;
border-color: @color-bi-border-success-button; border-color: @color-bi-border-success-button;
} }
&.light {
border-width: 0;
background-color: @color-bi-background-success-light-button;
&, & .b-font:before {
color: @color-bi-text-success-light-button;
}
&:hover, &:focus {
background-color: @color-bi-background-hover-success-light-button;
}
&.active {
background-color: @color-bi-background-active-success-light-button;
}
}
&.clear { &.clear {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-success-clear-button; color: @color-bi-text-success-clear-button;
@ -104,7 +136,7 @@ body .bi-button, #body .bi-button {
color: @color-bi-text-success-ghost-button; color: @color-bi-text-success-ghost-button;
} }
background-color: transparent; background-color: transparent;
&:hover, &:focus { &:hover, &:focus, &:hover .b-font:before, &:focus .b-font:before {
color: @color-bi-text; color: @color-bi-text;
background-color: @color-bi-background-success-button; background-color: @color-bi-background-success-button;
} }
@ -121,6 +153,22 @@ body .bi-button, #body .bi-button {
background-color: @color-bi-background-warning-button; background-color: @color-bi-background-warning-button;
border-color: @color-bi-border-warning-button; border-color: @color-bi-border-warning-button;
} }
&.light {
border-width: 0;
background-color: @color-bi-background-warning-light-button;
&, & .b-font:before {
color: @color-bi-text-warning-light-button;
}
&:hover, &:focus {
background-color: @color-bi-background-hover-warning-light-button;
}
&.active {
background-color: @color-bi-background-active-warning-light-button;
}
}
&.clear { &.clear {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-warning-clear-button; color: @color-bi-text-warning-clear-button;
@ -133,7 +181,7 @@ body .bi-button, #body .bi-button {
color: @color-bi-text-warning-ghost-button; color: @color-bi-text-warning-ghost-button;
} }
background-color: transparent; background-color: transparent;
&:hover, &:focus { &:hover, &:focus, &:hover .b-font:before, &:focus .b-font:before {
color: @color-bi-text; color: @color-bi-text;
background-color: @color-bi-background-warning-button; background-color: @color-bi-background-warning-button;
} }
@ -150,6 +198,22 @@ body .bi-button, #body .bi-button {
background-color: @color-bi-background-error-button; background-color: @color-bi-background-error-button;
border-color: @color-bi-border-error-button; border-color: @color-bi-border-error-button;
} }
&.light {
border-width: 0;
background-color: @color-bi-background-error-light-button;
&, & .b-font:before {
color: @color-bi-text-error-light-button;
}
&:hover, &:focus {
background-color: @color-bi-background-hover-error-light-button;
}
&.active {
background-color: @color-bi-background-active-error-light-button;
}
}
&.clear { &.clear {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-error-clear-button; color: @color-bi-text-error-clear-button;
@ -162,7 +226,7 @@ body .bi-button, #body .bi-button {
color: @color-bi-text-error-ghost-button; color: @color-bi-text-error-ghost-button;
} }
background-color: transparent; background-color: transparent;
&:hover, &:focus { &:hover, &:focus, &:hover .b-font:before, &:focus .b-font:before {
color: @color-bi-text; color: @color-bi-text;
background-color: @color-bi-background-error-button; background-color: @color-bi-background-error-button;
} }

18
src/less/base/single/tip/tip.toast.less

@ -1,22 +1,28 @@
@import "../../../index.less"; @import "../../../index.less";
.bi-toast{ .bi-toast {
color: @color-bi-color-toast-text; color: @color-bi-color-toast-text;
line-height: @font-size-16; line-height: @font-size-16;
.border-radius(2px); .border-radius(2px);
&.toast-success{ .box-shadow(@box-shadow-toast) ;
&.toast-success {
background: @color-bi-background-toast-success; background: @color-bi-background-toast-success;
} }
&.toast-warning{
&.toast-warning {
background: @color-bi-background-toast-warning; background: @color-bi-background-toast-warning;
} }
&.toast-error{
&.toast-error {
background: @color-bi-background-toast-error; background: @color-bi-background-toast-error;
} }
&.toast-normal, &.toast-common{
&.toast-normal, &.toast-common, &.toast-loading {
background: @color-bi-background-toast-normal; background: @color-bi-background-toast-normal;
} }
& .toast-icon{
& .toast-icon {
font-size: @font-size-16; font-size: @font-size-16;
} }
} }

40
src/less/base/tree/tree.expander.less

@ -1,28 +1,36 @@
@import "../../index.less"; @import "../../index.less";
@import "../../image.less";
@import "../../lib/icon.less"; @import "../../lib/icon.less";
.bi-tree-expander-popup.line:before {
.bi-tree-expander-popup.line {
&:after {
border-left: 1px dashed @border-color-dark-gray-line;
position: absolute; position: absolute;
content: ""; content: "";
height: 100%; height: 100%;
width: 24px; left: -1px;
.imagePath(@icon-tree-vertical-line-1, 0, 0, repeat-y); top: 0;
} }
.bi-tree-expander-popup.line.solid:before { &.solid:after {
.imagePath(@icon-tree-solid-vertical-line-1, 0, 0, repeat-y); border-left: 1px solid @border-color-dark-gray-line;
width: 24px; }
left: 8px;
} }
.bi-theme-dark { .bi-theme-dark {
.bi-tree-expander-popup.line:before { .bi-tree-expander-popup.line {
width: 24px;
.imagePath(@icon-tree-vertical-line-1-theme-dark, 0, 0, repeat-y); &:after {
border-left: 1px dashed @border-color-dark-gray-line-theme-dark;
position: absolute;
content: "";
height: 100%;
left: -1px;
top: 0;
}
&.solid:after {
border-left: 1px solid @border-color-dark-gray-line-theme-dark;
} }
.bi-tree-expander-popup.line.solid:before {
.imagePath(@icon-tree-solid-vertical-line-1-theme-dark, 0, 0, repeat-y);
width: 24px;
left: 8px;
} }
} }

15
src/less/base/trigger/trigger.searchtextvalue.less

@ -0,0 +1,15 @@
@import "../../index.less";
.bi-search-text-value-trigger {
&.error .select-text-label {
color: @color-bi-text-error-text-trigger;
}
.clear-button {
display: none;
}
&:hover .clear-button {
display: block;
}
}

15
src/less/base/trigger/trigger.text.less

@ -0,0 +1,15 @@
@import "../../index.less";
.bi-text-trigger {
&.error .select-text-label {
color: @color-bi-text-error-text-trigger;
}
.clear-button {
display: none;
}
&:hover .clear-button {
display: block;
}
}

20
src/less/core/utils/common.less

@ -175,6 +175,18 @@
} }
} }
.bi-theme-dark {
.bi-tips {
color: @color-bi-text-tips-theme-dark;
& .bi-input {
color: @color-bi-text-tips-theme-dark;;
}
& .bi-textarea {
color: @color-bi-text-tips-theme-dark;
}
}
}
// 边框 // 边框
.bi-border { .bi-border {
border: 1px solid @color-bi-border-line; border: 1px solid @color-bi-border-line;
@ -339,6 +351,14 @@
.border-radius(2px); .border-radius(2px);
} }
.bi-border-corner-left-radius {
.border-corner-left-radius(2px, 2px);
}
.bi-border-corner-right-radius {
.border-corner-right-radius(2px, 2px);
}
.bi-font-bold { .bi-font-bold {
font-weight: 700; font-weight: 700;
} }

11
src/less/core/wrapper/flex.horizontal.less

@ -169,7 +169,10 @@
} }
> .f-f { > .f-f {
min-width: 0; &:not(.f-s-n) {
min-width: 1px;
}
-webkit-flex-grow: 1; -webkit-flex-grow: 1;
-moz-flex-grow: 1; -moz-flex-grow: 1;
-ms-flex-grow: 1; -ms-flex-grow: 1;
@ -180,4 +183,10 @@
-ms-flex-shrink: 1; -ms-flex-shrink: 1;
flex-shrink: 1; flex-shrink: 1;
} }
> .f-auto {
&:not(.f-s-n) {
min-width: 1px;
}
}
} }

11
src/less/core/wrapper/flex.vertical.less

@ -168,7 +168,10 @@
} }
> .f-f { > .f-f {
min-height: 0; &:not(.f-s-n) {
min-height: 1px;
}
-webkit-flex-grow: 1; -webkit-flex-grow: 1;
-moz-flex-grow: 1; -moz-flex-grow: 1;
-ms-flex-grow: 1; -ms-flex-grow: 1;
@ -179,4 +182,10 @@
-ms-flex-shrink: 1; -ms-flex-shrink: 1;
flex-shrink: 1; flex-shrink: 1;
} }
> .f-auto {
&:not(.f-s-n) {
min-width: 1px;
}
}
} }

11
src/less/core/wrapper/flex.wrapper.horizontal.less

@ -265,7 +265,10 @@
} }
> .f-f { > .f-f {
min-width: 0; &:not(.f-s-n) {
min-width: 1px;
}
-webkit-flex-grow: 1; -webkit-flex-grow: 1;
-moz-flex-grow: 1; -moz-flex-grow: 1;
-ms-flex-grow: 1; -ms-flex-grow: 1;
@ -276,5 +279,11 @@
-ms-flex-shrink: 1; -ms-flex-shrink: 1;
flex-shrink: 1; flex-shrink: 1;
} }
> .f-auto {
&:not(.f-s-n) {
min-width: 1px;
}
}
} }
} }

11
src/less/core/wrapper/flex.wrapper.vertical.less

@ -259,7 +259,10 @@
} }
> .f-f { > .f-f {
min-height: 0; &:not(.f-s-n) {
min-height: 1px;
}
-webkit-flex-grow: 1; -webkit-flex-grow: 1;
-moz-flex-grow: 1; -moz-flex-grow: 1;
-ms-flex-grow: 1; -ms-flex-grow: 1;
@ -270,5 +273,11 @@
-ms-flex-shrink: 1; -ms-flex-shrink: 1;
flex-shrink: 1; flex-shrink: 1;
} }
> .f-auto {
&:not(.f-s-n) {
min-width: 1px;
}
}
} }
} }

2
src/less/image.less

@ -333,7 +333,7 @@
@font-face { @font-face {
font-family: "@{name}"; font-family: "@{name}";
src: url('@{fontUrl}iconfont.eot'); src: url('@{fontUrl}iconfont.eot');
src: url('@{fontUrl}iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('@{fontUrl}iconfont.woff') format('woff'), /* chrome、firefox */ url('@{fontUrl}iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('@{fontUrl}iconfont.svg#svgFontName') format('svg'); /* iOS 4.1- */ src: url('@{fontUrl}iconfont.woff') format('woff'), /* chrome、firefox */ url('@{fontUrl}iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('@{fontUrl}iconfont.svg#svgFontName') format('svg'); /* iOS 4.1- */
} }
} }

4
src/less/lib/colors.less

@ -34,6 +34,7 @@
@color-bi-text-success: @font-color-success; @color-bi-text-success: @font-color-success;
//失败字体颜色 //失败字体颜色
@color-bi-text-failure: @font-color-negative; @color-bi-text-failure: @font-color-negative;
//基本提亮颜色 //基本提亮颜色
@color-bi-text-highlight: @font-color-highlight; @color-bi-text-highlight: @font-color-highlight;
//标红色 //标红色
@ -98,6 +99,9 @@
@color-bi-background-highlight: @background-color-highlight; @color-bi-background-highlight: @background-color-highlight;
//背景提亮色(浅) //背景提亮色(浅)
@color-bi-background-light-highlight: @background-color-light-highlight; @color-bi-background-light-highlight: @background-color-light-highlight;
// 浅蓝色的背景
@color-bi-background-light-blue: @color-blue-10;
//黑色边框色 //黑色边框色
@color-bi-border-black: @border-color-black; @color-bi-border-black: @border-color-black;

3
src/less/lib/constant.less

@ -244,3 +244,6 @@
@scroll-color-theme-dark: @color-white; @scroll-color-theme-dark: @color-white;
@scroll-thumb-color: @color-black; @scroll-thumb-color: @color-black;
@scroll-thumb-color-theme-dark: @color-black; @scroll-thumb-color-theme-dark: @color-black;
//box-shadow效果
@box-shadow-toast: 0 6px 20px -2px rgba(9, 30, 64, 0.16);

1
src/less/lib/font.less

@ -51,6 +51,7 @@
@font-tip-success: "e1db"; @font-tip-success: "e1db";
@font-tip-warning: "e1d7"; @font-tip-warning: "e1d7";
@font-tip-message: "e1d9"; @font-tip-message: "e1d9";
@font-tip-loading: "e7cd";
@font-key: "e1d0"; @font-key: "e1d0";

23
src/less/lib/theme.less

@ -72,6 +72,12 @@
@color-bi-background-hover-common-ghost-button: @color-bi-background-highlight; @color-bi-background-hover-common-ghost-button: @color-bi-background-highlight;
@color-bi-text-hover-common-ghost-button-theme-dark: @color-bi-text-normal; @color-bi-text-hover-common-ghost-button-theme-dark: @color-bi-text-normal;
@color-bi-background-hover-common-ghost-button-theme-dark: @color-bi-background-default; @color-bi-background-hover-common-ghost-button-theme-dark: @color-bi-background-default;
@color-bi-text-common-light-button: @color-bi-text-highlight;
@color-bi-background-common-light-button: @color-bi-background-light-blue;
@color-bi-background-hover-common-light-button: @color-bi-background-light-blue;
@color-bi-background-active-common-light-button: @color-bi-background-light-blue;
@color-bi-background-active-common-ghost-button: @color-bi-background-highlight; @color-bi-background-active-common-ghost-button: @color-bi-background-highlight;
@color-bi-background-active-common-ghost-button-theme-dark: @color-bi-background-default; @color-bi-background-active-common-ghost-button-theme-dark: @color-bi-background-default;
@color-bi-text-ignore-button: @color-bi-text-highlight; @color-bi-text-ignore-button: @color-bi-text-highlight;
@ -80,18 +86,34 @@
@color-bi-background-ignore-button-theme-dark: @color-bi-background-default-theme-dark; @color-bi-background-ignore-button-theme-dark: @color-bi-background-default-theme-dark;
@color-bi-background-hover-ignore-button-theme-dark: @color-blue-10; @color-bi-background-hover-ignore-button-theme-dark: @color-blue-10;
@color-bi-background-active-ignore-button-theme-dark: @color-blue-10; @color-bi-background-active-ignore-button-theme-dark: @color-blue-10;
@color-bi-text-success-button: @color-bi-text; @color-bi-text-success-button: @color-bi-text;
@color-bi-background-success-button: @color-bi-background-success; @color-bi-background-success-button: @color-bi-background-success;
@color-bi-border-success-button: @color-bi-border-success; @color-bi-border-success-button: @color-bi-border-success;
@color-bi-text-success-clear-button: @color-bi-text-success; @color-bi-text-success-clear-button: @color-bi-text-success;
@color-bi-text-success-ghost-button: @color-bi-text-success; @color-bi-text-success-ghost-button: @color-bi-text-success;
@color-bi-text-success-light-button: @color-bi-text-success;
@color-bi-background-success-light-button: @color-bi-background-light-success;
@color-bi-background-hover-success-light-button: @color-bi-background-light-success;
@color-bi-background-active-success-light-button: @color-bi-background-light-success;
@color-bi-text-warning-button: @color-bi-text; @color-bi-text-warning-button: @color-bi-text;
@color-bi-text-warning-light-button: @color-bi-text-redmark;
@color-bi-background-warning-light-button: @color-bi-background-light-warning;
@color-bi-background-hover-warning-light-button: @color-bi-background-light-warning;
@color-bi-background-active-warning-light-button: @color-bi-background-light-warning;
@color-bi-background-warning-button: @color-bi-background-warning; @color-bi-background-warning-button: @color-bi-background-warning;
@color-bi-border-warning-button: @color-bi-border-warning; @color-bi-border-warning-button: @color-bi-border-warning;
@color-bi-text-warning-clear-button: @color-bi-text-redmark; @color-bi-text-warning-clear-button: @color-bi-text-redmark;
@color-bi-text-warning-ghost-button: @color-bi-text-redmark; @color-bi-text-warning-ghost-button: @color-bi-text-redmark;
@color-bi-text-error-button: @color-bi-text; @color-bi-text-error-button: @color-bi-text;
@color-bi-background-error-light-button: @color-bi-background-light-failure;
@color-bi-background-error-button: @color-bi-background-failure; @color-bi-background-error-button: @color-bi-background-failure;
@color-bi-text-error-light-button: @color-bi-text-failure;
@color-bi-background-hover-error-light-button: @color-bi-background-light-failure;
@color-bi-background-active-error-light-button: @color-bi-background-light-failure;
@color-bi-border-error-button: @color-bi-border-failure; @color-bi-border-error-button: @color-bi-border-failure;
@color-bi-text-error-clear-button: @color-bi-text-failure; @color-bi-text-error-clear-button: @color-bi-text-failure;
@color-bi-text-error-ghost-button: @color-bi-text-failure; @color-bi-text-error-ghost-button: @color-bi-text-failure;
@ -179,6 +201,7 @@
@color-bi-border-hover-text-value-down-list-combo: @color-bi-border-highlight; @color-bi-border-hover-text-value-down-list-combo: @color-bi-border-highlight;
@color-bi-border-hover-text-value-check-combo: @color-bi-border-highlight; @color-bi-border-hover-text-value-check-combo: @color-bi-border-highlight;
@color-bi-text-error-hover-text-value-combo: @color-bi-text-failure; @color-bi-text-error-hover-text-value-combo: @color-bi-text-failure;
@color-bi-text-error-text-trigger: @color-bi-text-failure;
@color-bi-text-error-hover-text-value-icon-combo: @color-bi-text-failure; @color-bi-text-error-hover-text-value-icon-combo: @color-bi-text-failure;
@color-bi-text-error-hover-search-text-value-combo: @color-bi-text-failure; @color-bi-text-error-hover-search-text-value-combo: @color-bi-text-failure;
@color-bi-background-bubble-combo-triangle: @color-bi-background-default; @color-bi-background-bubble-combo-triangle: @color-bi-background-default;

1
src/less/resource/font.less

@ -86,6 +86,7 @@
.font(toast-success-font, @font-tip-success, @color-bi-color-toast-success); .font(toast-success-font, @font-tip-success, @color-bi-color-toast-success);
.font(toast-warning-font, @font-tip-warning, @color-bi-color-toast-warning); .font(toast-warning-font, @font-tip-warning, @color-bi-color-toast-warning);
.font(toast-message-font, @font-tip-message, @color-bi-color-toast-normal); .font(toast-message-font, @font-tip-message, @color-bi-color-toast-normal);
.font(toast-loading-font, @font-tip-loading, @color-bi-color-toast-normal);
//数值区间 //数值区间
.font(less-font, @font-less); .font(less-font, @font-less);

7
src/less/theme/dark.less

@ -2,7 +2,14 @@
.bi-theme-dark { .bi-theme-dark {
color: @color-bi-text-theme-dark; color: @color-bi-text-theme-dark;
& .bi-input { & .bi-input {
color: @color-bi-text; color: @color-bi-text;
} }
& .bi-textarea {
color: @color-bi-text;
}
} }

6
src/less/visual.less

@ -16,6 +16,12 @@
box-shadow: none; box-shadow: none;
} }
.box-shadow(@shadow) {
-webkit-box-shadow: @shadow;
-moz-box-shadow: @shadow;
box-shadow: @shadow;
}
.box-shadow(@style, @c) when (iscolor(@c)) { .box-shadow(@style, @c) when (iscolor(@c)) {
-webkit-box-shadow: @style @c; -webkit-box-shadow: @style @c;
-moz-box-shadow: @style @c; -moz-box-shadow: @style @c;

28
src/less/widget/multilayerselecttree/multilayerselecttree.combo.less

@ -1,20 +1,24 @@
@import "../../index.less"; @import "../../index.less";
@val: transform .3s ease;
.bi-multilayer-select-tree-combo { .bi-multilayer-select-tree-combo {
& .trigger-icon-button{
font-size: @font-size-16; &.status-error {
&.bi-border, &.bi-border-bottom {
border-color: @border-color-negative;
} }
// 此combo的trigger_button是absolute上去的,与bi-combo在同一层级,独立写一下
& .bi-combo.bi-combo-popup + .bi-trigger-icon-button { .bi-trigger .select-text-label, .tip-text-style {
& .x-icon { color: @color-bi-text-error-text-trigger;
.rotate(180deg);
.transition(@val);
} }
} }
& .bi-combo + .bi-trigger-icon-button {
& .x-icon { &.status-warning {
.rotate(0deg); &.bi-border, &.bi-border-bottom {
.transition(@val); border-color: @border-color-warning;
}
.bi-trigger .select-text-label {
color: @font-color-warning;
} }
} }
} }

27
src/less/widget/multilayersingletree/multilayersingletree.combo.less

@ -1,20 +1,23 @@
@import "../../index.less"; @import "../../index.less";
@val: transform .3s ease;
.bi-multilayer-single-tree-combo { .bi-multilayer-single-tree-combo {
& .trigger-icon-button{ &.status-error {
font-size: @font-size-16; &.bi-border, &.bi-border-bottom {
border-color: @border-color-negative;
} }
// 此combo的trigger_button是absolute上去的,与bi-combo在同一层级,独立写一下
& .bi-combo.bi-combo-popup + .bi-trigger-icon-button { .bi-trigger .select-text-label, .tip-text-style {
& .x-icon { color: @color-bi-text-error-text-trigger;
.rotate(180deg);
.transition(@val);
} }
} }
& .bi-combo + .bi-trigger-icon-button {
& .x-icon { &.status-warning {
.rotate(0deg); &.bi-border, &.bi-border-bottom {
.transition(@val); border-color: @border-color-warning;
}
.bi-trigger .select-text-label {
color: @font-color-warning;
} }
} }
} }

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

Loading…
Cancel
Save