Browse Source

KERNEL-16294 fix: 导出适配1、导出widgetEngin构造的Element没有width方法,通过css设置 2、打包添加基本控件fineuiwithoutjquery = worker+基本控件

research/test
jian 1 year ago
parent
commit
b2b59c9d40
  1. 8
      package.json
  2. 6
      packages/fineui/src/core/wrapper/layout/flex/flex.horizontal.js
  3. 14
      packages/fineui/src/without_Jquery_Polyfill.js
  4. 8
      packages/fineui/webpack/attachments.js
  5. 2
      packages/fineui/webpack/webpack.common.js
  6. 7
      packages/fineui/webpack/webpack.dev.js
  7. 4
      packages/fineui/webpack/webpack.prod.js

8
package.json

@ -41,17 +41,17 @@
"less-loader": "^11.1.0", "less-loader": "^11.1.0",
"mini-css-extract-plugin": "^2.7.5", "mini-css-extract-plugin": "^2.7.5",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"prettier": "^3.0.0",
"postcss": "^8.4.21", "postcss": "^8.4.21",
"postcss-loader": "^7.1.0", "postcss-loader": "^7.1.0",
"prettier": "^3.0.0",
"style-loader": "^3.3.1", "style-loader": "^3.3.1",
"terser-webpack-plugin": "^5.3.7", "terser-webpack-plugin": "^5.3.7",
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
"typescript": "^4.9.5", "typescript": "^4.9.5",
"webpack": "^5.75.0", "webpack": "^5.75.0",
"webpack-bundle-analyzer": "^4.8.0", "webpack-bundle-analyzer": "^4.8.0",
"webpack-cli": "^5.0.1", "webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.11.1", "webpack-dev-server": "^4.15.1",
"webpack-merge": "^5.8.0" "webpack-merge": "^5.9.0"
} }
} }

6
packages/fineui/src/core/wrapper/layout/flex/flex.horizontal.js

@ -51,7 +51,7 @@ export class FlexHorizontalLayout extends Layout {
if (o.columnSize.length > 0) { if (o.columnSize.length > 0) {
return o.columnSize.indexOf("fill") >= 0 || o.columnSize.indexOf("auto") >= 0; return o.columnSize.indexOf("fill") >= 0 || o.columnSize.indexOf("auto") >= 0;
} }
return some(o.items, (i, item) => { return some(o.items, (i, item) => {
if (item.width === "fill" || item.width === "auto") { if (item.width === "fill" || item.width === "auto") {
return true; return true;
@ -87,7 +87,7 @@ export class FlexHorizontalLayout extends Layout {
} }
} }
if (columnSize > 0) { if (columnSize > 0) {
w.element.width(this._optimiseGap(columnSize)); w.element.css({ width: this._optimiseGap(columnSize) });
} }
if (columnSize === "fill") { if (columnSize === "fill") {
w.element.addClass("f-f"); w.element.addClass("f-f");
@ -103,7 +103,7 @@ export class FlexHorizontalLayout extends Layout {
w.element.addClass("l-c"); w.element.addClass("l-c");
} }
this._handleGap(w, item, i); this._handleGap(w, item, i);
return w; return w;
} }

14
packages/fineui/src/without_Jquery_Polyfill.js

@ -0,0 +1,14 @@
export * from './worker.js';
// "!src/base/single/input/file.js",
// "!src/case/ztree/**/*.js",
import * as _case from './case';
import * as _widget from './widget';
import { _global } from "@/core/0.foundation";
const fuiExport = {
..._case,
..._widget
};
Object.assign(_global.BI, fuiExport);

8
packages/fineui/webpack/attachments.js

@ -21,6 +21,7 @@ const basicAttachmentMap = {
]), ]),
js_bundle: sync(["src/bundle.js"]), js_bundle: sync(["src/bundle.js"]),
js_worker: sync(["src/worker.js"]), js_worker: sync(["src/worker.js"]),
js_without_Jquery_polyfill: sync(["src/without_Jquery_Polyfill.js"]),
}; };
const bundleCss = uniq([].concat(basicAttachmentMap.less, basicAttachmentMap.ui, sync(["public/less/app.less", "public/less/**/*.less"]))); const bundleCss = uniq([].concat(basicAttachmentMap.less, basicAttachmentMap.ui, sync(["public/less/app.less", "public/less/**/*.less"])));
@ -38,9 +39,14 @@ const fineuiForWorker = [].concat(
basicAttachmentMap.ts basicAttachmentMap.ts
); );
const fineuiWithout_Jquery_Polyfill = [].concat(
basicAttachmentMap.js_withoutJquery,
basicAttachmentMap.ts
);
module.exports = { module.exports = {
fineui: uniq(fineui), fineui: uniq(fineui),
fineuiForWorker: uniq(fineuiForWorker), fineuiForWorker: uniq(fineuiForWorker),
fineuiForV8Export: uniq(fineuiForWorker), fineuiWithout_Jquery_Polyfill: uniq(fineuiWithout_Jquery_Polyfill),
bundleCss, bundleCss,
}; };

2
packages/fineui/webpack/webpack.common.js

@ -25,6 +25,8 @@ function git(command) {
module.exports = { module.exports = {
entry: { entry: {
fineui: attachments.fineui, fineui: attachments.fineui,
"fineui.worker": attachments.fineuiForWorker,
"fineui_without_jquery_polyfill": attachments.fineuiWithout_Jquery_Polyfill,
}, },
externals: { externals: {
lodash: "_", lodash: "_",

7
packages/fineui/webpack/webpack.dev.js

@ -16,5 +16,12 @@ module.exports = merge(common, {
devServer: { devServer: {
port: 9001, port: 9001,
// liveReload: true, // liveReload: true,
client: {
logging: 'error',
overlay: {
errors: true,
warnings: false,
},
},
} }
}); });

4
packages/fineui/webpack/webpack.prod.js

@ -10,9 +10,7 @@ module.exports = merge(common, {
entry: { entry: {
"fineui.min": attachments.fineui, "fineui.min": attachments.fineui,
"fineui.worker.min": attachments.fineuiForWorker, "fineui.worker.min": attachments.fineuiForWorker,
"fineui.worker": attachments.fineuiForWorker, "fineui_without_jquery_polyfill.min": attachments.fineuiWithout_Jquery_Polyfill,
"fineui_without_jquery_polyfill.min": attachments.fineuiForWorker,
"fineui_without_jquery_polyfill": attachments.fineuiForWorker,
}, },
output: { output: {

Loading…
Cancel
Save