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. 25
      src/less/base/tree/ztree.less
  20. 1
      src/widget/multilayerselecttree/multilayerselecttree.combo.js
  21. 2
      src/widget/multilayerselecttree/multilayerselecttree.trigger.js
  22. 1
      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-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)"
"@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();
}, 5 * 1000);
},
}, {
type: "bi.button",
text: "文字偏左的按钮",
textAlign: "left",
width: 200,
}];
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",
"version": "2.0.20220822112610",
"version": "2.0.20220826171804",
"description": "fineui",
"main": "dist/fineui_without_conflict.min.js",
"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 SingleEntryPlugin = require('webpack/lib/SingleEntryPlugin');
const { WorkerLoaderName, FileNamePrefix } = require('./constants');
const { resolve } = require('path');
// 正常 loader 处理逻辑
function loader() {
@ -67,6 +68,22 @@ function loader() {
entryOnly: true,
}).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}`;
childCompiler.hooks.compilation.tap(WorkerLoaderName, compilation => {
if (compilation.cache) {
@ -98,16 +115,18 @@ function loader() {
null,
// 插入代码的转译和压缩由主构建配置的 babel/ts loader 处理, 不需要 worker-worker 来处理
// 添加 @ts-nocheck 避免 ts-check 报错
// 修复export const 下 const不会被转译的问题
`// @ts-nocheck
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(
null,
`// @ts-nocheck
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.Layers = new BI.LayerController();
BI.Maskers = new BI.MaskersController();
BI.Bubbles = new BI.BubblesController();
BI.Tooltips = new BI.TooltipsController();
BI.Popovers = new BI.PopoverController();
BI.Drawers = new BI.DrawerController();
BI.Broadcasts = new BI.BroadcastController();
BI.StyleLoaders = new BI.StyleLoaderManager();
});
BI.Resizers = new BI.ResizeController();
BI.Layers = new BI.LayerController();
BI.Maskers = new BI.MaskersController();
BI.Bubbles = new BI.BubblesController();
BI.Tooltips = new BI.TooltipsController();
BI.Popovers = new BI.PopoverController();
BI.Drawers = new BI.DrawerController();
BI.Broadcasts = new BI.BroadcastController();
BI.StyleLoaders = new BI.StyleLoaderManager();

1
src/base/list/virtualgrouplist.js

@ -102,6 +102,7 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, {
this.renderedIndex = cnt;
cnt++;
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;
cnt++;
index += o.blockSize;
lastHeight = getElementHeight();
}
},

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

@ -141,6 +141,7 @@
// bi.center_adapt 作用:让 hgap 不影响 iconGap。
BI.createWidget({
type: "bi.center_adapt",
horizontalAlign: o.textAlign,
element: this,
hgap: o.hgap,
vgap: o.vgap,
@ -161,7 +162,7 @@
});
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;
}
for (var
xhr = new XMLHttpRequest,
for (var xhr = new XMLHttpRequest,
upload = xhr.upload || {
addEventListener: function (event, callback) {
this["on" + event] = callback;
@ -129,6 +128,7 @@
) {
upload.addEventListener(
split[i].substring(2),
// eslint-disable-next-line no-loop-func
(function (event) {
return function (rpe) {
if (isFunction(handler[event])) {

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

@ -21,7 +21,8 @@ BI.IconCombo = BI.inherit(BI.Widget, {
adjustYOffset: 0,
offsetStyle: "left",
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,
offsetStyle: o.offsetStyle,
el: this.trigger,
hideWhenAnotherComboOpen: o.hideWhenAnotherComboOpen,
popup: {
el: this.popup,
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类布局优先级规则
// 1、支持flex的浏览器下使用flex布局
@ -39,16 +39,16 @@ BI.prepares.push(function () {
// return BI.extend({}, ob, {type: "bi.table_adapt"});
// }
if (supportFlex) {
return BI.extend({}, ob, {type: "bi.flex_horizontal"});
return BI.extend({}, ob, { type: "bi.flex_horizontal" });
}
return BI.extend({
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, { type: "bi.flex_vertical" });
}
return BI.extend({}, ob, {
horizontalAlign: BI.HorizontalAlign.Stretch,
@ -88,14 +88,14 @@ BI.prepares.push(function () {
if ((ob.scrollable !== true && ob.scrollx !== true) || ob.horizontalAlign === BI.HorizontalAlign.Stretch) {
return BI.extend({
verticalAlign: BI.VerticalAlign.Top
}, ob, {type: "bi.horizontal_float_fill"});
}, ob, { type: "bi.horizontal_float_fill" });
}
return BI.extend({
horizontalAlign: BI.HorizontalAlign.Stretch
}, ob, {type: "bi.table_adapt"});
}, ob, { type: "bi.table_adapt" });
}
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;
});
@ -104,9 +104,9 @@ BI.prepares.push(function () {
// var isAdapt = !ob.horizontalAlign || ob.horizontalAlign === BI.HorizontalAlign.Center || ob.horizontalAlign === BI.HorizontalAlign.Stretch;
// if (!isAdapt || justOneItem) {
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;
});
@ -115,9 +115,9 @@ BI.prepares.push(function () {
// var isAdapt = ob.horizontalAlign === BI.HorizontalAlign.Center || ob.horizontalAlign === BI.HorizontalAlign.Stretch;
// if (!isAdapt || justOneItem) {
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;
});
@ -126,7 +126,7 @@ BI.prepares.push(function () {
var isAdapt = !ob.horizontalAlign || ob.horizontalAlign === BI.HorizontalAlign.Center || ob.horizontalAlign === BI.HorizontalAlign.Stretch;
var verticalAlignTop = !ob.verticalAlign || ob.verticalAlign === BI.VerticalAlign.TOP;
if (verticalAlignTop && justOneItem) {
return BI.extend({}, ob, {type: "bi.horizontal_auto"});
return BI.extend({}, ob, { type: "bi.horizontal_auto" });
}
var supportFlex = isSupportFlex();
// 在横向自适应场景下我们需要使用table的自适应撑出滚动条的特性(flex处理不了这种情况)
@ -134,24 +134,24 @@ BI.prepares.push(function () {
if (isAdapt) {
return BI.extend({
horizontalAlign: BI.HorizontalAlign.Center
}, ob, {type: "bi.table_adapt"});
}, ob, { type: "bi.table_adapt" });
}
if (supportFlex) {
return BI.extend({
horizontalAlign: BI.HorizontalAlign.Center,
scrollx: false
}, ob, {type: "bi.flex_horizontal"});
}, ob, { type: "bi.flex_horizontal" });
}
return BI.extend({
horizontalAlign: BI.HorizontalAlign.Center
}, ob, {type: "bi.table_adapt"});
}, ob, { type: "bi.table_adapt" });
});
BI.Plugin.configWidget("bi.horizontal_float", function (ob) {
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) {
return BI.extend({}, ob, {type: "bi.inline_horizontal_adapt"});
return BI.extend({}, ob, { type: "bi.inline_horizontal_adapt" });
}
return ob;
});
@ -162,16 +162,16 @@ BI.prepares.push(function () {
horizontalAlign: BI.HorizontalAlign.Stretch,
verticalAlign: BI.VerticalAlign.Stretch,
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)) {
// 宽度不受限,要用table布局
return BI.extend({
horizontalAlign: BI.HorizontalAlign.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) {
if (isSupportFlex()) {
@ -179,7 +179,7 @@ BI.prepares.push(function () {
horizontalAlign: BI.HorizontalAlign.Stretch,
verticalAlign: BI.VerticalAlign.Stretch,
scrolly: false
}, ob, {type: "bi.flex_vertical"});
}, ob, { type: "bi.flex_vertical" });
}
if (ob.scrollable === true || ob.scrollx === true || ob.scrolly === true) {
// 有滚动条,降级到table布局处理
@ -204,18 +204,18 @@ BI.prepares.push(function () {
}
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) {
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) {
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()) {
// IE下其实也是可以使用flex布局的,只要排除掉出现滚动条的情况
// 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;
@ -232,40 +232,40 @@ BI.prepares.push(function () {
if (ob.scrollable === true || ob.scrollx !== false) {
if (ob.hgap > 0 || ob.lgap > 0 || ob.rgap > 0) {
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()) {
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) {
if (ob.scrollable === true || ob.scrollx === true) {
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) {
if (!isSupportGrid()) {
return BI.extend({}, ob, {type: "bi.td"});
return BI.extend({}, ob, { type: "bi.td" });
}
return ob;
});
BI.Plugin.configWidget("bi.radio", function (ob) {
if (BI.isIE() && BI.getIEVersion() <= 9) {
return BI.extend({}, ob, {type: "bi.image_radio"});
return BI.extend({}, ob, { type: "bi.image_radio" });
}
return ob;
});
BI.Plugin.configWidget("bi.checkbox", function (ob) {
if (BI.isIE() && BI.getIEVersion() <= 9) {
return BI.extend({}, ob, {type: "bi.image_checkbox"});
return BI.extend({}, ob, { type: "bi.image_checkbox" });
}
return ob;
});
@ -274,6 +274,6 @@ BI.prepares.push(function () {
if (BI.isIE() && BI.getIEVersion() < 9) {
return ob;
}
return BI.extend({}, ob, {type: "bi.half_button"});
return BI.extend({}, ob, { type: "bi.half_button" });
});
});
}());

25
src/less/base/tree/ztree.less

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

1
src/widget/multilayerselecttree/multilayerselecttree.combo.js

@ -13,7 +13,6 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
defaultText: "",
itemsCreator: BI.emptyFn,
items: [],
value: "",
allowEdit: false,
allowSearchValue: false,
allowInsertValue: false,

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

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

1
src/widget/multilayersingletree/multilayersingletree.combo.js

@ -16,7 +16,6 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
defaultText: "",
itemsCreator: BI.emptyFn,
items: [],
value: "",
allowEdit: false,
allowSearchValue: false,
allowInsertValue: false,

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

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

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

@ -18,7 +18,8 @@ BI.MultiSelectNoBarLoader = BI.inherit(BI.Widget, {
valueFormatter: BI.emptyFn,
itemsCreator: BI.emptyFn,
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) {
var o = this.options;
if (BI.isNull(v)) {
if (BI.isUndefined(v)) {
this.editor.setState(BI.Selection.None);
} else {
v = v || "";
this.editor.setState(o.valueFormatter(v + "") || (v + ""));
}
},

Loading…
Cancel
Save