Browse Source

KERNEL-6440 refactor: loadingPane加载动画提供small和big两种尺寸

master
windy 4 years ago
parent
commit
95c815db02
  1. 1
      changelog.md
  2. 26
      src/base/pane.js

1
changelog.md

@ -1,5 +1,6 @@
# 更新日志 # 更新日志
2.0(2020-12) 2.0(2020-12)
- Pane系列提供small和big两种大小的加载动画
- 同步树列表系列支持不显示节点连接线和展开收起图标 - 同步树列表系列支持不显示节点连接线和展开收起图标
- 规范了下拉树trigger中显示值的显示顺序 - 规范了下拉树trigger中显示值的显示顺序
- bi.editor支持传入autocomplete - bi.editor支持传入autocomplete

26
src/base/pane.js

@ -13,6 +13,7 @@ BI.Pane = BI.inherit(BI.Widget, {
_baseCls: "bi-pane", _baseCls: "bi-pane",
tipText: BI.i18nText("BI-No_Selected_Item"), tipText: BI.i18nText("BI-No_Selected_Item"),
loadingText: "", loadingText: "",
loadingSize: "small",
overlap: true, overlap: true,
onLoaded: BI.emptyFn onLoaded: BI.emptyFn
}); });
@ -41,25 +42,25 @@ BI.Pane = BI.inherit(BI.Widget, {
var loadingAnimation = BI.createWidget({ var loadingAnimation = BI.createWidget({
type: "bi.horizontal", type: "bi.horizontal",
cls: "bi-loading-widget" + (isIE ? " wave-loading hack" : ""), cls: "bi-loading-widget" + (isIE ? " wave-loading hack" : ""),
height: 30, height: this._getSize(60),
width: 30, width: this._getSize(60),
hgap: 5, hgap: this._getSize(10),
vgap: 2.5, vgap: 2.5,
items: isIE ? [] : [{ items: isIE ? [] : [{
type: "bi.layout", type: "bi.layout",
cls: "animate-rect rect1", cls: "animate-rect rect1",
height: 25, height: this._getSize(50),
width: 3 width: this._getSize(5),
}, { }, {
type: "bi.layout", type: "bi.layout",
cls: "animate-rect rect2", cls: "animate-rect rect2",
height: 25, height: this._getSize(50),
width: 3 width: this._getSize(5),
}, { }, {
type: "bi.layout", type: "bi.layout",
cls: "animate-rect rect3", cls: "animate-rect rect3",
height: 25, height: this._getSize(50),
width: 3 width: this._getSize(5),
}] }]
}); });
// pane在同步方式下由items决定tipText的显示与否 // pane在同步方式下由items决定tipText的显示与否
@ -88,6 +89,10 @@ BI.Pane = BI.inherit(BI.Widget, {
this.element.addClass("loading-status"); this.element.addClass("loading-status");
}, },
_getSize: function(v) {
return Math.ceil(v / (this.options.loadingSize === 'small' ? 2 : 1));
},
_getLoadingTipItems: function (loadingTip) { _getLoadingTipItems: function (loadingTip) {
var o = this.options; var o = this.options;
var loadingTipItems = [{ var loadingTipItems = [{
@ -96,7 +101,8 @@ BI.Pane = BI.inherit(BI.Widget, {
}]; }];
BI.isNotEmptyString(o.loadingText) && loadingTipItems.push({ BI.isNotEmptyString(o.loadingText) && loadingTipItems.push({
type: "bi.text", type: "bi.text",
text: o.loadingText text: o.loadingText,
tgap: this._getSize(10),
}); });
return [{ return [{

Loading…
Cancel
Save