From 6673ac6da5486023963fbc1d6205a3b82906490f Mon Sep 17 00:00:00 2001 From: Treecat Date: Wed, 8 Mar 2023 14:42:45 +0800 Subject: [PATCH] =?UTF-8?q?ES6=20fix:=20=E5=87=8F=E5=B0=91=20sideEffects?= =?UTF-8?q?=20=E7=B2=92=E5=BA=A6=E5=92=8C=E4=BF=AE=E5=A4=8D=20button=20?= =?UTF-8?q?=E5=BE=AA=E7=8E=AF=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 ++- src/base/single/button/button.basic.js | 7 ++++--- src/core/platform/web/config.js | 4 ++-- src/core/utils/i18n.js | 3 ++- src/index.js | 3 +++ 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 7b56d27f1..aeaef1f66 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "main": "dist/fineui_without_conflict.min.js", "module": "dist/esm/index.js", "sideEffects": [ - "dist/esm/core/**" + "dist/esm/polyfill/**/*", + "dist/esm/core/platform/**/*.js" ], "types": "dist/lib/index.d.ts", "bin": { diff --git a/src/base/single/button/button.basic.js b/src/base/single/button/button.basic.js index 79f7632f8..b186daca6 100644 --- a/src/base/single/button/button.basic.js +++ b/src/base/single/button/button.basic.js @@ -21,9 +21,7 @@ import { Events, Actions } from "@/core"; -import { BubbleCombo } from "@/case/combo/bubblecombo/combo.bubble"; import { Single } from "../0.single"; -import { BubblePopupBarView, TextBubblePopupBarView } from "@/case/combo/bubblecombo/popup.bubble"; /** * guy @@ -170,7 +168,7 @@ export class BasicButton extends Single { return bubble; }; - const clk = e => { + const clk = async e => { ev(e); if (!this.isEnabled() || !this.isValid()) { return; @@ -180,6 +178,9 @@ export class BasicButton extends Single { } if (isKey(o.bubble) || isFunction(o.bubble)) { if (isNull(this.combo)) { + const { BubbleCombo } = await import("@/case/combo/bubblecombo/combo.bubble"); + const { BubblePopupBarView, TextBubblePopupBarView } = await import("@/case/combo/bubblecombo/popup.bubble"); + let popup; createWidget({ type: AbsoluteLayout.xtype, diff --git a/src/core/platform/web/config.js b/src/core/platform/web/config.js index c9e24139c..741bc29b0 100644 --- a/src/core/platform/web/config.js +++ b/src/core/platform/web/config.js @@ -4,7 +4,7 @@ import { Plugin } from "../../6.plugin"; import { isSupportCss3, isIE, getIEVersion } from "../../platform/web"; import { HorizontalAlign, VerticalAlign } from "../../constant"; import { FlexCenterLayout, FlexHorizontalLayout, VerticalLayout, - FlexVerticalLayout, TdLayout, InlineLayout, TableAdaptLayout, + FlexVerticalLayout, TdLayout, InlineLayout, FloatHorizontalFillLayout, ResponsiveInlineLayout, InlineCenterAdaptLayout, FlexVerticalCenterAdapt, InlineVerticalAdaptLayout, HorizontalAutoLayout, @@ -15,7 +15,7 @@ import { FlexCenterLayout, FlexHorizontalLayout, VerticalLayout, FlexLeftRightVerticalAdaptLayout, ResponsiveFlexWrapperHorizontalLayout, FlexWrapperHorizontalLayout, ResponsiveFlexHorizontalLayout, FlexWrapperVerticalLayout -} from "@/core/wrapper/layout/index"; +} from "@/core/wrapper"; import { SystemProvider } from "@/core/system"; diff --git a/src/core/utils/i18n.js b/src/core/utils/i18n.js index 3fa951695..bfa7cd302 100644 --- a/src/core/utils/i18n.js +++ b/src/core/utils/i18n.js @@ -15,7 +15,8 @@ export function addI18n(i18n) { } export function i18nText(key) { - let localeText = i18nStore[key] || (BI.i18n && BI.i18n[key]) || ""; + // eslint-disable-next-line no-var + let localeText = i18nStore[key] || (_global.BI && BI.i18n && BI.i18n[key]) || ""; if (!localeText) { localeText = key; } diff --git a/src/index.js b/src/index.js index c4769cee1..5858f7041 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,7 @@ +// sideEffects import "./polyfill"; +import "./core/platform/web/jquery"; + import _jquery from "jquery"; export * from "./core";