Browse Source

Merge remote-tracking branch 'origin/master'

es6
guy 2 years ago
parent
commit
bc9622428e
  1. 4
      bi.lessconfig.json
  2. 5
      demo/js/base/button/demo.button.js
  3. BIN
      dist/font/iconfont.eot
  4. 204
      dist/font/iconfont.svg
  5. BIN
      dist/font/iconfont.ttf
  6. BIN
      dist/font/iconfont.woff
  7. BIN
      dist/font/iconfont.woff2
  8. 2
      package.json
  9. 0
      plugins/webpack-fui-worker-plugin/empty.js
  10. 23
      plugins/webpack-fui-worker-plugin/worker-loader.js
  11. 20
      src/base/0.base.js
  12. 1
      src/base/list/virtualgrouplist.js
  13. 1
      src/base/list/virtuallist.js
  14. 3
      src/base/single/button/buttons/button.js
  15. 4
      src/base/single/input/file.js
  16. 4
      src/case/combo/iconcombo/combo.icon.js
  17. 0
      src/core/6.plugin.js
  18. 70
      src/core/platform/web/config.js
  19. 39
      src/less/base/tree/ztree.less
  20. 3
      src/widget/multilayerselecttree/multilayerselecttree.combo.js
  21. 2
      src/widget/multilayerselecttree/multilayerselecttree.trigger.js
  22. 3
      src/widget/multilayersingletree/multilayersingletree.combo.js
  23. 2
      src/widget/multilayersingletree/multilayersingletree.trigger.js
  24. 3
      src/widget/multiselect/multiselect.loader.nobar.js
  25. 3
      src/widget/singleselect/trigger/searcher.singleselect.js

4
bi.lessconfig.json

@ -38,5 +38,7 @@
"@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": "rgba(9, 30, 64, 0.9)",
"@color-bi-text-header-background-theme-dark": "rgba(255, 255, 255, 0.9)" "@color-bi-text-header-background-theme-dark": "rgba(255, 255, 255, 0.9)",
"@font-down-triangle": "e70b",
"@font-date": "e733"
} }

5
demo/js/base/button/demo.button.js

@ -376,6 +376,11 @@ Demo.Button = BI.inherit(BI.Widget, {
this.loaded(); this.loaded();
}, 5 * 1000); }, 5 * 1000);
}, },
}, {
type: "bi.button",
text: "文字偏左的按钮",
textAlign: "left",
width: 200,
}]; }];
return { return {

BIN
dist/font/iconfont.eot vendored

Binary file not shown.

204
dist/font/iconfont.svg vendored

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 695 KiB

After

Width:  |  Height:  |  Size: 693 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.20220822112610", "version": "2.0.20220826171804",
"description": "fineui", "description": "fineui",
"main": "dist/fineui_without_conflict.min.js", "main": "dist/fineui_without_conflict.min.js",
"types": "dist/lib/index.d.ts", "types": "dist/lib/index.d.ts",

0
plugins/webpack-fui-worker-plugin/empty.js

23
plugins/webpack-fui-worker-plugin/worker-loader.js

@ -6,6 +6,7 @@ const webpack = require('webpack');
const loaderUtils = require('loader-utils'); const loaderUtils = require('loader-utils');
const SingleEntryPlugin = require('webpack/lib/SingleEntryPlugin'); const SingleEntryPlugin = require('webpack/lib/SingleEntryPlugin');
const { WorkerLoaderName, FileNamePrefix } = require('./constants'); const { WorkerLoaderName, FileNamePrefix } = require('./constants');
const { resolve } = require('path');
// 正常 loader 处理逻辑 // 正常 loader 处理逻辑
function loader() { function loader() {
@ -67,6 +68,22 @@ function loader() {
entryOnly: true, entryOnly: true,
}).apply(childCompiler); }).apply(childCompiler);
// 去除源码中的less css引用
const regExp = /\.(css|less)$/;
new webpack.NormalModuleReplacementPlugin(
regExp,
result => {
if (regExp.test(result.request)) {
result.request = resolve(__dirname, './empty.js');
}
if (regExp.test(result.resource)) {
result.resource = resolve(__dirname, './empty.js');
}
},
).apply(childCompiler);
const subCache = `subcache ${__dirname} ${workerEntry}`; const subCache = `subcache ${__dirname} ${workerEntry}`;
childCompiler.hooks.compilation.tap(WorkerLoaderName, compilation => { childCompiler.hooks.compilation.tap(WorkerLoaderName, compilation => {
if (compilation.cache) { if (compilation.cache) {
@ -98,16 +115,18 @@ function loader() {
null, null,
// 插入代码的转译和压缩由主构建配置的 babel/ts loader 处理, 不需要 worker-worker 来处理 // 插入代码的转译和压缩由主构建配置的 babel/ts loader 处理, 不需要 worker-worker 来处理
// 添加 @ts-nocheck 避免 ts-check 报错 // 添加 @ts-nocheck 避免 ts-check 报错
// 修复export const 下 const不会被转译的问题
`// @ts-nocheck `// @ts-nocheck
const blob = new Blob([${JSON.stringify(compilation.assets[entry].source())}]); const blob = new Blob([${JSON.stringify(compilation.assets[entry].source())}]);
export const workerUrl = window.URL.createObjectURL(blob); const workerUrl = window.URL.createObjectURL(blob);
export default workerUrl;
` `
) )
: callback( : callback(
null, null,
`// @ts-nocheck `// @ts-nocheck
const servicePath = __webpack_public_path__ + ${JSON.stringify(entry)}; const servicePath = __webpack_public_path__ + ${JSON.stringify(entry)};
export const workerUrl = servicePath; export default servicePath;
` `
) )
}); });

20
src/base/0.base.js

@ -1,11 +1,9 @@
BI.prepares.push(function () { BI.Resizers = new BI.ResizeController();
BI.Resizers = new BI.ResizeController(); BI.Layers = new BI.LayerController();
BI.Layers = new BI.LayerController(); BI.Maskers = new BI.MaskersController();
BI.Maskers = new BI.MaskersController(); BI.Bubbles = new BI.BubblesController();
BI.Bubbles = new BI.BubblesController(); BI.Tooltips = new BI.TooltipsController();
BI.Tooltips = new BI.TooltipsController(); BI.Popovers = new BI.PopoverController();
BI.Popovers = new BI.PopoverController(); BI.Drawers = new BI.DrawerController();
BI.Drawers = new BI.DrawerController(); BI.Broadcasts = new BI.BroadcastController();
BI.Broadcasts = new BI.BroadcastController(); BI.StyleLoaders = new BI.StyleLoaderManager();
BI.StyleLoaders = new BI.StyleLoaderManager();
});

1
src/base/list/virtualgrouplist.js

@ -102,6 +102,7 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, {
this.renderedIndex = cnt; this.renderedIndex = cnt;
cnt++; cnt++;
index += o.blockSize; index += o.blockSize;
lastHeight = this.renderedIndex === -1 ? 0 : getElementHeight();
} }
}, },

1
src/base/list/virtuallist.js

@ -85,6 +85,7 @@ BI.VirtualList = BI.inherit(BI.Widget, {
this.renderedIndex = cnt; this.renderedIndex = cnt;
cnt++; cnt++;
index += o.blockSize; index += o.blockSize;
lastHeight = getElementHeight();
} }
}, },

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

@ -141,6 +141,7 @@
// bi.center_adapt 作用:让 hgap 不影响 iconGap。 // bi.center_adapt 作用:让 hgap 不影响 iconGap。
BI.createWidget({ BI.createWidget({
type: "bi.center_adapt", type: "bi.center_adapt",
horizontalAlign: o.textAlign,
element: this, element: this,
hgap: o.hgap, hgap: o.hgap,
vgap: o.vgap, vgap: o.vgap,
@ -161,7 +162,7 @@
}); });
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 });
} }
}, },

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

@ -116,8 +116,7 @@
return; return;
} }
for (var for (var xhr = new XMLHttpRequest,
xhr = new XMLHttpRequest,
upload = xhr.upload || { upload = xhr.upload || {
addEventListener: function (event, callback) { addEventListener: function (event, callback) {
this["on" + event] = callback; this["on" + event] = callback;
@ -129,6 +128,7 @@
) { ) {
upload.addEventListener( upload.addEventListener(
split[i].substring(2), split[i].substring(2),
// eslint-disable-next-line no-loop-func
(function (event) { (function (event) {
return function (rpe) { return function (rpe) {
if (isFunction(handler[event])) { if (isFunction(handler[event])) {

4
src/case/combo/iconcombo/combo.icon.js

@ -21,7 +21,8 @@ BI.IconCombo = BI.inherit(BI.Widget, {
adjustYOffset: 0, adjustYOffset: 0,
offsetStyle: "left", offsetStyle: "left",
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
isShowDown: true isShowDown: true,
hideWhenAnotherComboOpen: false
}); });
}, },
@ -71,6 +72,7 @@ BI.IconCombo = BI.inherit(BI.Widget, {
adjustYOffset: o.adjustYOffset, adjustYOffset: o.adjustYOffset,
offsetStyle: o.offsetStyle, offsetStyle: o.offsetStyle,
el: this.trigger, el: this.trigger,
hideWhenAnotherComboOpen: o.hideWhenAnotherComboOpen,
popup: { popup: {
el: this.popup, el: this.popup,
maxWidth: o.maxWidth, maxWidth: o.maxWidth,

0
src/core/plugin.js → src/core/6.plugin.js

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

@ -1,5 +1,5 @@
// 工程配置 // 工程配置
BI.prepares.push(function () { !(function () {
// 注册布局 // 注册布局
// adapt类布局优先级规则 // adapt类布局优先级规则
// 1、支持flex的浏览器下使用flex布局 // 1、支持flex的浏览器下使用flex布局
@ -39,16 +39,16 @@ BI.prepares.push(function () {
// return BI.extend({}, ob, {type: "bi.table_adapt"}); // return BI.extend({}, ob, {type: "bi.table_adapt"});
// } // }
if (supportFlex) { if (supportFlex) {
return BI.extend({}, ob, {type: "bi.flex_horizontal"}); return BI.extend({}, ob, { type: "bi.flex_horizontal" });
} }
return BI.extend({ return BI.extend({
scrollx: true scrollx: true
}, ob, {type: "bi.inline"}); }, ob, { type: "bi.inline" });
}); });
BI.Plugin.configWidget("bi.vertical", function (ob) { BI.Plugin.configWidget("bi.vertical", function (ob) {
if (ob.horizontalAlign === BI.HorizontalAlign.Left || ob.horizontalAlign === BI.HorizontalAlign.Right) { if (ob.horizontalAlign === BI.HorizontalAlign.Left || ob.horizontalAlign === BI.HorizontalAlign.Right) {
if (isSupportFlex()) { if (isSupportFlex()) {
return BI.extend({}, ob, {type: "bi.flex_vertical"}); return BI.extend({}, ob, { type: "bi.flex_vertical" });
} }
return BI.extend({}, ob, { return BI.extend({}, ob, {
horizontalAlign: BI.HorizontalAlign.Stretch, horizontalAlign: BI.HorizontalAlign.Stretch,
@ -88,14 +88,14 @@ BI.prepares.push(function () {
if ((ob.scrollable !== true && ob.scrollx !== true) || ob.horizontalAlign === BI.HorizontalAlign.Stretch) { if ((ob.scrollable !== true && ob.scrollx !== true) || ob.horizontalAlign === BI.HorizontalAlign.Stretch) {
return BI.extend({ return BI.extend({
verticalAlign: BI.VerticalAlign.Top verticalAlign: BI.VerticalAlign.Top
}, ob, {type: "bi.horizontal_float_fill"}); }, ob, { type: "bi.horizontal_float_fill" });
} }
return BI.extend({ return BI.extend({
horizontalAlign: BI.HorizontalAlign.Stretch horizontalAlign: BI.HorizontalAlign.Stretch
}, ob, {type: "bi.table_adapt"}); }, ob, { type: "bi.table_adapt" });
} }
if (BI.Providers.getProvider("bi.provider.system").getResponsiveMode()) { if (BI.Providers.getProvider("bi.provider.system").getResponsiveMode()) {
return BI.extend({}, ob, {type: "bi.responsive_inline"}); return BI.extend({}, ob, { type: "bi.responsive_inline" });
} }
return ob; return ob;
}); });
@ -104,9 +104,9 @@ BI.prepares.push(function () {
// var isAdapt = !ob.horizontalAlign || ob.horizontalAlign === BI.HorizontalAlign.Center || ob.horizontalAlign === BI.HorizontalAlign.Stretch; // var isAdapt = !ob.horizontalAlign || ob.horizontalAlign === BI.HorizontalAlign.Center || ob.horizontalAlign === BI.HorizontalAlign.Stretch;
// if (!isAdapt || justOneItem) { // if (!isAdapt || justOneItem) {
if (supportFlex) { if (supportFlex) {
return BI.extend({}, ob, {type: "bi.flex_center_adapt"}); return BI.extend({}, ob, { type: "bi.flex_center_adapt" });
} }
return BI.extend({}, ob, {type: "bi.inline_center_adapt"}); return BI.extend({}, ob, { type: "bi.inline_center_adapt" });
// } // }
// return ob; // return ob;
}); });
@ -115,9 +115,9 @@ BI.prepares.push(function () {
// var isAdapt = ob.horizontalAlign === BI.HorizontalAlign.Center || ob.horizontalAlign === BI.HorizontalAlign.Stretch; // var isAdapt = ob.horizontalAlign === BI.HorizontalAlign.Center || ob.horizontalAlign === BI.HorizontalAlign.Stretch;
// if (!isAdapt || justOneItem) { // if (!isAdapt || justOneItem) {
if (supportFlex) { if (supportFlex) {
return BI.extend({}, ob, {type: "bi.flex_vertical_center_adapt"}); return BI.extend({}, ob, { type: "bi.flex_vertical_center_adapt" });
} }
return BI.extend({}, ob, {type: "bi.inline_vertical_adapt"}); return BI.extend({}, ob, { type: "bi.inline_vertical_adapt" });
// } // }
// return ob; // return ob;
}); });
@ -126,7 +126,7 @@ BI.prepares.push(function () {
var isAdapt = !ob.horizontalAlign || ob.horizontalAlign === BI.HorizontalAlign.Center || ob.horizontalAlign === BI.HorizontalAlign.Stretch; var isAdapt = !ob.horizontalAlign || ob.horizontalAlign === BI.HorizontalAlign.Center || ob.horizontalAlign === BI.HorizontalAlign.Stretch;
var verticalAlignTop = !ob.verticalAlign || ob.verticalAlign === BI.VerticalAlign.TOP; var verticalAlignTop = !ob.verticalAlign || ob.verticalAlign === BI.VerticalAlign.TOP;
if (verticalAlignTop && justOneItem) { if (verticalAlignTop && justOneItem) {
return BI.extend({}, ob, {type: "bi.horizontal_auto"}); return BI.extend({}, ob, { type: "bi.horizontal_auto" });
} }
var supportFlex = isSupportFlex(); var supportFlex = isSupportFlex();
// 在横向自适应场景下我们需要使用table的自适应撑出滚动条的特性(flex处理不了这种情况) // 在横向自适应场景下我们需要使用table的自适应撑出滚动条的特性(flex处理不了这种情况)
@ -134,24 +134,24 @@ BI.prepares.push(function () {
if (isAdapt) { if (isAdapt) {
return BI.extend({ return BI.extend({
horizontalAlign: BI.HorizontalAlign.Center horizontalAlign: BI.HorizontalAlign.Center
}, ob, {type: "bi.table_adapt"}); }, ob, { type: "bi.table_adapt" });
} }
if (supportFlex) { if (supportFlex) {
return BI.extend({ return BI.extend({
horizontalAlign: BI.HorizontalAlign.Center, horizontalAlign: BI.HorizontalAlign.Center,
scrollx: false scrollx: false
}, ob, {type: "bi.flex_horizontal"}); }, ob, { type: "bi.flex_horizontal" });
} }
return BI.extend({ return BI.extend({
horizontalAlign: BI.HorizontalAlign.Center horizontalAlign: BI.HorizontalAlign.Center
}, ob, {type: "bi.table_adapt"}); }, ob, { type: "bi.table_adapt" });
}); });
BI.Plugin.configWidget("bi.horizontal_float", function (ob) { BI.Plugin.configWidget("bi.horizontal_float", function (ob) {
if (isSupportFlex()) { if (isSupportFlex()) {
return BI.extend({}, ob, {type: "bi.flex_horizontal_adapt"}); return BI.extend({}, ob, { type: "bi.flex_horizontal_adapt" });
} }
if (ob.items && ob.items.length <= 1) { if (ob.items && ob.items.length <= 1) {
return BI.extend({}, ob, {type: "bi.inline_horizontal_adapt"}); return BI.extend({}, ob, { type: "bi.inline_horizontal_adapt" });
} }
return ob; return ob;
}); });
@ -162,16 +162,16 @@ BI.prepares.push(function () {
horizontalAlign: BI.HorizontalAlign.Stretch, horizontalAlign: BI.HorizontalAlign.Stretch,
verticalAlign: BI.VerticalAlign.Stretch, verticalAlign: BI.VerticalAlign.Stretch,
scrollx: false scrollx: false
}, ob, {type: "bi.flex_horizontal"}); }, ob, { type: "bi.flex_horizontal" });
} }
if ((ob.horizontalAlign && ob.horizontalAlign !== BI.HorizontalAlign.Stretch) || (ob.scrollable === true || ob.scrollx === true)) { if ((ob.horizontalAlign && ob.horizontalAlign !== BI.HorizontalAlign.Stretch) || (ob.scrollable === true || ob.scrollx === true)) {
// 宽度不受限,要用table布局 // 宽度不受限,要用table布局
return BI.extend({ return BI.extend({
horizontalAlign: BI.HorizontalAlign.Stretch, horizontalAlign: BI.HorizontalAlign.Stretch,
verticalAlign: BI.VerticalAlign.Stretch verticalAlign: BI.VerticalAlign.Stretch
}, ob, {type: "bi.table_adapt"}); }, ob, { type: "bi.table_adapt" });
} }
return BI.extend({}, ob, {type: "bi.horizontal_float_fill"}); return BI.extend({}, ob, { type: "bi.horizontal_float_fill" });
}); });
BI.Plugin.configWidget("bi.vertical_fill", function (ob) { BI.Plugin.configWidget("bi.vertical_fill", function (ob) {
if (isSupportFlex()) { if (isSupportFlex()) {
@ -179,7 +179,7 @@ BI.prepares.push(function () {
horizontalAlign: BI.HorizontalAlign.Stretch, horizontalAlign: BI.HorizontalAlign.Stretch,
verticalAlign: BI.VerticalAlign.Stretch, verticalAlign: BI.VerticalAlign.Stretch,
scrolly: false scrolly: false
}, ob, {type: "bi.flex_vertical"}); }, ob, { type: "bi.flex_vertical" });
} }
if (ob.scrollable === true || ob.scrollx === true || ob.scrolly === true) { if (ob.scrollable === true || ob.scrollx === true || ob.scrolly === true) {
// 有滚动条,降级到table布局处理 // 有滚动条,降级到table布局处理
@ -204,18 +204,18 @@ BI.prepares.push(function () {
} }
if (hasAuto) { if (hasAuto) {
// 有自动高的时候 // 有自动高的时候
return BI.extend({}, ob, {type: "bi.vtape_auto"}); return BI.extend({}, ob, { type: "bi.vtape_auto" });
} }
return BI.extend({}, ob, {type: "bi.vtape"}); return BI.extend({}, ob, { type: "bi.vtape" });
}); });
BI.Plugin.configWidget("bi.horizontal_sticky", function (ob) { BI.Plugin.configWidget("bi.horizontal_sticky", function (ob) {
if (!isSupportSticky) { if (!isSupportSticky) {
return BI.extend({ scrollx: true }, ob, {type: "bi.horizontal_fill"}); return BI.extend({ scrollx: true }, ob, { type: "bi.horizontal_fill" });
} }
}); });
BI.Plugin.configWidget("bi.vertical_sticky", function (ob) { BI.Plugin.configWidget("bi.vertical_sticky", function (ob) {
if (!isSupportSticky) { if (!isSupportSticky) {
return BI.extend({ scrolly: true }, ob, {type: "bi.vertical_fill"}); return BI.extend({ scrolly: true }, ob, { type: "bi.vertical_fill" });
} }
}); });
@ -223,7 +223,7 @@ BI.prepares.push(function () {
if (isSupportFlex()) { if (isSupportFlex()) {
// IE下其实也是可以使用flex布局的,只要排除掉出现滚动条的情况 // IE下其实也是可以使用flex布局的,只要排除掉出现滚动条的情况
// if (!BI.isIE() || (ob.scrollable !== true && ob.scrolly !== true)) { // if (!BI.isIE() || (ob.scrollable !== true && ob.scrolly !== true)) {
return BI.extend({}, ob, {type: "bi.flex_left_right_vertical_adapt"}); return BI.extend({}, ob, { type: "bi.flex_left_right_vertical_adapt" });
// } // }
} }
return ob; return ob;
@ -232,40 +232,40 @@ BI.prepares.push(function () {
if (ob.scrollable === true || ob.scrollx !== false) { if (ob.scrollable === true || ob.scrollx !== false) {
if (ob.hgap > 0 || ob.lgap > 0 || ob.rgap > 0) { if (ob.hgap > 0 || ob.lgap > 0 || ob.rgap > 0) {
if (BI.Providers.getProvider("bi.provider.system").getResponsiveMode()) { if (BI.Providers.getProvider("bi.provider.system").getResponsiveMode()) {
return BI.extend({}, ob, {type: "bi.responsive_flex_scrollable_horizontal"}); return BI.extend({}, ob, { type: "bi.responsive_flex_scrollable_horizontal" });
} }
return BI.extend({}, ob, {type: "bi.flex_scrollable_horizontal"}); return BI.extend({}, ob, { type: "bi.flex_scrollable_horizontal" });
} }
} }
if (BI.Providers.getProvider("bi.provider.system").getResponsiveMode()) { if (BI.Providers.getProvider("bi.provider.system").getResponsiveMode()) {
return BI.extend({}, ob, {type: "bi.responsive_flex_horizontal"}); return BI.extend({}, ob, { type: "bi.responsive_flex_horizontal" });
} }
}); });
BI.Plugin.configWidget("bi.flex_vertical", function (ob) { BI.Plugin.configWidget("bi.flex_vertical", function (ob) {
if (ob.scrollable === true || ob.scrollx === true) { if (ob.scrollable === true || ob.scrollx === true) {
if (ob.hgap > 0 || ob.lgap > 0 || ob.rgap > 0) { if (ob.hgap > 0 || ob.lgap > 0 || ob.rgap > 0) {
return BI.extend({}, ob, {type: "bi.flex_scrollable_vertical"}); return BI.extend({}, ob, { type: "bi.flex_scrollable_vertical" });
} }
} }
}); });
BI.Plugin.configWidget("bi.table", function (ob) { BI.Plugin.configWidget("bi.table", function (ob) {
if (!isSupportGrid()) { if (!isSupportGrid()) {
return BI.extend({}, ob, {type: "bi.td"}); return BI.extend({}, ob, { type: "bi.td" });
} }
return ob; return ob;
}); });
BI.Plugin.configWidget("bi.radio", function (ob) { BI.Plugin.configWidget("bi.radio", function (ob) {
if (BI.isIE() && BI.getIEVersion() <= 9) { if (BI.isIE() && BI.getIEVersion() <= 9) {
return BI.extend({}, ob, {type: "bi.image_radio"}); return BI.extend({}, ob, { type: "bi.image_radio" });
} }
return ob; return ob;
}); });
BI.Plugin.configWidget("bi.checkbox", function (ob) { BI.Plugin.configWidget("bi.checkbox", function (ob) {
if (BI.isIE() && BI.getIEVersion() <= 9) { if (BI.isIE() && BI.getIEVersion() <= 9) {
return BI.extend({}, ob, {type: "bi.image_checkbox"}); return BI.extend({}, ob, { type: "bi.image_checkbox" });
} }
return ob; return ob;
}); });
@ -274,6 +274,6 @@ BI.prepares.push(function () {
if (BI.isIE() && BI.getIEVersion() < 9) { if (BI.isIE() && BI.getIEVersion() < 9) {
return ob; return ob;
} }
return BI.extend({}, ob, {type: "bi.half_button"}); return BI.extend({}, ob, { type: "bi.half_button" });
}); });
}); }());

39
src/less/base/tree/ztree.less

@ -79,22 +79,20 @@
vertical-align: top; vertical-align: top;
display: inline-block; display: inline-block;
.tree-node-text { &:not(.disabled) {
&:not(.disabled) { &:hover {
&:hover { .background-color(@color-bi-background-highlight, 10%);
.background-color(@color-bi-background-highlight, 10%); }
}
&:active { &:active {
color: @color-bi-text-highlight; color: @color-bi-text-highlight;
.background-color(@color-bi-background-highlight, 15%); .background-color(@color-bi-background-highlight, 15%);
}
} }
} }
} }
.ztree.solid li a { .ztree.solid li a {
height: 32px; height: 30px;
} }
.ztree li a.curSelectedNode { .ztree li a.curSelectedNode {
@ -145,22 +143,17 @@
} }
.ztree.solid li span { .ztree.solid li span {
line-height: 32px; line-height: 30px;
} }
.ztree li span.icon { .ztree li span.icon {
display: inline-block; display: inline-block;
vertical-align: top;
text-align: center; text-align: center;
width: 24px; width: 16px;
height: 24px; height: 16px;
line-height: 24px; line-height: 16px;
} padding: 0 2px;
vertical-align: middle;
.ztree li span.icon {
width: 32px;
height: 32px;
line-height: 32px;
} }
.ztree li span.button { .ztree li span.button {
@ -289,8 +282,8 @@
} }
.ztree.solid li span.button.switch { .ztree.solid li span.button.switch {
width: 32px; width: 30px;
height: 32px height: 30px
} }
.ztree li span.button.switch.noline_open { .ztree li span.button.switch.noline_open {

3
src/widget/multilayerselecttree/multilayerselecttree.combo.js

@ -13,7 +13,6 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
defaultText: "", defaultText: "",
itemsCreator: BI.emptyFn, itemsCreator: BI.emptyFn,
items: [], items: [],
value: "",
allowEdit: false, allowEdit: false,
allowSearchValue: false, allowSearchValue: false,
allowInsertValue: false, allowInsertValue: false,
@ -289,4 +288,4 @@ BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSelectTreeCombo.EVENT_STOP = "EVENT_STOP"; BI.MultiLayerSelectTreeCombo.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSelectTreeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; BI.MultiLayerSelectTreeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.MultiLayerSelectTreeCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; BI.MultiLayerSelectTreeCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo); BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo);

2
src/widget/multilayerselecttree/multilayerselecttree.trigger.js

@ -42,7 +42,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
self.editor = this; self.editor = this;
}, },
defaultText: o.defaultText, defaultText: o.defaultText,
text: this._digest(o.value), text: BI.isKey(o.value) ? this._digest(o.value) : o.text,
value: o.value, value: o.value,
height: o.height, height: o.height,
tipText: "", tipText: "",

3
src/widget/multilayersingletree/multilayersingletree.combo.js

@ -16,7 +16,6 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
defaultText: "", defaultText: "",
itemsCreator: BI.emptyFn, itemsCreator: BI.emptyFn,
items: [], items: [],
value: "",
allowEdit: false, allowEdit: false,
allowSearchValue: false, allowSearchValue: false,
allowInsertValue: false, allowInsertValue: false,
@ -263,4 +262,4 @@ BI.MultiLayerSingleTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSingleTreeCombo.EVENT_STOP = "EVENT_STOP"; BI.MultiLayerSingleTreeCombo.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSingleTreeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; BI.MultiLayerSingleTreeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.multilayer_single_tree_combo", BI.MultiLayerSingleTreeCombo); BI.shortcut("bi.multilayer_single_tree_combo", BI.MultiLayerSingleTreeCombo);

2
src/widget/multilayersingletree/multilayersingletree.trigger.js

@ -42,7 +42,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
self.editor = this; self.editor = this;
}, },
defaultText: o.defaultText, defaultText: o.defaultText,
text: this._digest(o.value), text: BI.isKey(o.value) ? this._digest(o.value) : o.text,
value: o.value, value: o.value,
height: o.height, height: o.height,
tipText: "", tipText: "",

3
src/widget/multiselect/multiselect.loader.nobar.js

@ -18,7 +18,8 @@ BI.MultiSelectNoBarLoader = BI.inherit(BI.Widget, {
valueFormatter: BI.emptyFn, valueFormatter: BI.emptyFn,
itemsCreator: BI.emptyFn, itemsCreator: BI.emptyFn,
itemHeight: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, itemHeight: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT,
onLoaded: BI.emptyFn onLoaded: BI.emptyFn,
itemFormatter: BI.emptyFn,
}); });
}, },

3
src/widget/singleselect/trigger/searcher.singleselect.js

@ -125,9 +125,10 @@ BI.SingleSelectSearcher = BI.inherit(BI.Widget, {
setState: function (v) { setState: function (v) {
var o = this.options; var o = this.options;
if (BI.isNull(v)) { if (BI.isUndefined(v)) {
this.editor.setState(BI.Selection.None); this.editor.setState(BI.Selection.None);
} else { } else {
v = v || "";
this.editor.setState(o.valueFormatter(v + "") || (v + "")); this.editor.setState(o.valueFormatter(v + "") || (v + ""));
} }
}, },

Loading…
Cancel
Save