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",
"module": "dist/esm/index.js",
"sideEffects": [
"dist/esm/core/**"
"dist/esm/polyfill/**/*",
"dist/esm/core/platform/**/*.js"
],
"types": "dist/lib/index.d.ts",
"bin": {

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

4
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";

3
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;
}

3
src/index.js

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

Loading…
Cancel
Save