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. 2
      src/base/0.base.js
  12. 1
      src/base/list/virtualgrouplist.js
  13. 1
      src/base/list/virtuallist.js
  14. 1
      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. 4
      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-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;
` `
) )
}); });

2
src/base/0.base.js

@ -1,4 +1,3 @@
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();
@ -8,4 +7,3 @@ BI.prepares.push(function () {
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();
} }
}, },

1
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,

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

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

@ -1,5 +1,5 @@
// 工程配置 // 工程配置
BI.prepares.push(function () { !(function () {
// 注册布局 // 注册布局
// adapt类布局优先级规则 // adapt类布局优先级规则
// 1、支持flex的浏览器下使用flex布局 // 1、支持flex的浏览器下使用flex布局
@ -276,4 +276,4 @@ BI.prepares.push(function () {
} }
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; 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%);
@ -91,10 +90,9 @@
} }
} }
} }
}
.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 {

1
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,

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: "",

1
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,

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