Browse Source

ES6 fix: 减少 sideEffects 粒度和修复 button 循环依赖

es6
Treecat 2 years ago
parent
commit
6673ac6da5
  1. 3
      package.json
  2. 7
      src/base/single/button/button.basic.js
  3. 4
      src/core/platform/web/config.js
  4. 3
      src/core/utils/i18n.js
  5. 3
      src/index.js

3
package.json

@ -5,7 +5,8 @@
"main": "dist/fineui_without_conflict.min.js", "main": "dist/fineui_without_conflict.min.js",
"module": "dist/esm/index.js", "module": "dist/esm/index.js",
"sideEffects": [ "sideEffects": [
"dist/esm/core/**" "dist/esm/polyfill/**/*",
"dist/esm/core/platform/**/*.js"
], ],
"types": "dist/lib/index.d.ts", "types": "dist/lib/index.d.ts",
"bin": { "bin": {

7
src/base/single/button/button.basic.js

@ -21,9 +21,7 @@ import {
Events, Events,
Actions Actions
} from "@/core"; } from "@/core";
import { BubbleCombo } from "@/case/combo/bubblecombo/combo.bubble";
import { Single } from "../0.single"; import { Single } from "../0.single";
import { BubblePopupBarView, TextBubblePopupBarView } from "@/case/combo/bubblecombo/popup.bubble";
/** /**
* guy * guy
@ -170,7 +168,7 @@ export class BasicButton extends Single {
return bubble; return bubble;
}; };
const clk = e => { const clk = async e => {
ev(e); ev(e);
if (!this.isEnabled() || !this.isValid()) { if (!this.isEnabled() || !this.isValid()) {
return; return;
@ -180,6 +178,9 @@ export class BasicButton extends Single {
} }
if (isKey(o.bubble) || isFunction(o.bubble)) { if (isKey(o.bubble) || isFunction(o.bubble)) {
if (isNull(this.combo)) { 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; let popup;
createWidget({ createWidget({
type: AbsoluteLayout.xtype, type: AbsoluteLayout.xtype,

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

@ -4,7 +4,7 @@ import { Plugin } from "../../6.plugin";
import { isSupportCss3, isIE, getIEVersion } from "../../platform/web"; import { isSupportCss3, isIE, getIEVersion } from "../../platform/web";
import { HorizontalAlign, VerticalAlign } from "../../constant"; import { HorizontalAlign, VerticalAlign } from "../../constant";
import { FlexCenterLayout, FlexHorizontalLayout, VerticalLayout, import { FlexCenterLayout, FlexHorizontalLayout, VerticalLayout,
FlexVerticalLayout, TdLayout, InlineLayout, TableAdaptLayout, FlexVerticalLayout, TdLayout, InlineLayout,
FloatHorizontalFillLayout, ResponsiveInlineLayout, FloatHorizontalFillLayout, ResponsiveInlineLayout,
InlineCenterAdaptLayout, FlexVerticalCenterAdapt, InlineCenterAdaptLayout, FlexVerticalCenterAdapt,
InlineVerticalAdaptLayout, HorizontalAutoLayout, InlineVerticalAdaptLayout, HorizontalAutoLayout,
@ -15,7 +15,7 @@ import { FlexCenterLayout, FlexHorizontalLayout, VerticalLayout,
FlexLeftRightVerticalAdaptLayout, ResponsiveFlexWrapperHorizontalLayout, FlexLeftRightVerticalAdaptLayout, ResponsiveFlexWrapperHorizontalLayout,
FlexWrapperHorizontalLayout, ResponsiveFlexHorizontalLayout, FlexWrapperHorizontalLayout, ResponsiveFlexHorizontalLayout,
FlexWrapperVerticalLayout FlexWrapperVerticalLayout
} from "@/core/wrapper/layout/index"; } from "@/core/wrapper";
import { SystemProvider } from "@/core/system"; import { SystemProvider } from "@/core/system";

3
src/core/utils/i18n.js

@ -15,7 +15,8 @@ export function addI18n(i18n) {
} }
export function i18nText(key) { 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) { if (!localeText) {
localeText = key; localeText = key;
} }

3
src/index.js

@ -1,4 +1,7 @@
// sideEffects
import "./polyfill"; import "./polyfill";
import "./core/platform/web/jquery";
import _jquery from "jquery"; import _jquery from "jquery";
export * from "./core"; export * from "./core";

Loading…
Cancel
Save