From 4a5ffb63986b257c943fb4a6838179759beffa32 Mon Sep 17 00:00:00 2001 From: Treecat Date: Wed, 15 Mar 2023 16:11:50 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-14316=20fix:=20=E8=BF=87=E4=B8=80?= =?UTF-8?q?=E9=81=8D=20Demo=EF=BC=8C=E6=8A=8A=E6=8E=A7=E5=88=B6=E5=8F=B0?= =?UTF-8?q?=E6=8A=A5=E9=94=99=EF=BC=8C=E5=85=A8=E9=83=A8=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../demo/widget/multiselect/demo.multi_select_combo.js | 1 + .../demo/widget/multiselect/demo.multi_select_list.js | 4 ++-- .../demo/widget/singleselct/demo.single_select_combo.js | 6 +++--- packages/fineui/package.json | 3 ++- packages/fineui/src/base/combination/bubble.js | 7 ++++--- packages/fineui/src/case/ztree/parttree.js | 3 ++- .../fineui/src/core/controller/controller.bubbles.js | 3 ++- .../fineui/src/core/controller/controller.resizer.js | 3 ++- packages/fineui/src/widget/multiselect/loader.js | 9 +++++---- 9 files changed, 23 insertions(+), 16 deletions(-) diff --git a/packages/demo/src/demo/widget/multiselect/demo.multi_select_combo.js b/packages/demo/src/demo/widget/multiselect/demo.multi_select_combo.js index e4f1d1219..ecc3818bc 100644 --- a/packages/demo/src/demo/widget/multiselect/demo.multi_select_combo.js +++ b/packages/demo/src/demo/widget/multiselect/demo.multi_select_combo.js @@ -17,6 +17,7 @@ import { @shortcut() export class MultiSelectComboDemo extends Widget { static xtype = "demo.multi_select_combo"; + static EVENT_CONFIRM = "EVENT_CONFIRM"; props = { baseCls: "demo-multi-select-combo" }; diff --git a/packages/demo/src/demo/widget/multiselect/demo.multi_select_list.js b/packages/demo/src/demo/widget/multiselect/demo.multi_select_list.js index 367380644..f071f54c7 100644 --- a/packages/demo/src/demo/widget/multiselect/demo.multi_select_list.js +++ b/packages/demo/src/demo/widget/multiselect/demo.multi_select_list.js @@ -76,8 +76,8 @@ export class MultiSelectListDemo extends Widget { }); if (options.selectedValues) { // 过滤 - const filter = makeObject(options.selectedValues, true); - items = filter(items, (i, ob) => !filter[ob.value]); + const filterItems = makeObject(options.selectedValues, true); + items = filter(items, (i, ob) => !filterItems[ob.value]); } if (options.type == MultiSelectCombo.REQ_GET_ALL_DATA) { callback({ diff --git a/packages/demo/src/demo/widget/singleselct/demo.single_select_combo.js b/packages/demo/src/demo/widget/singleselct/demo.single_select_combo.js index 707389335..86ffbe8bc 100644 --- a/packages/demo/src/demo/widget/singleselct/demo.single_select_combo.js +++ b/packages/demo/src/demo/widget/singleselct/demo.single_select_combo.js @@ -1,6 +1,6 @@ import { CONSTANTS } from "@/config/constant"; -import { SingleSelectCombo, AbsoluteLayout, Button, shortcut, Widget, Func, createWidget, bind, each, makeObject } from "@fui/core" +import { SingleSelectCombo, AbsoluteLayout, Button, shortcut, Widget, Func, createWidget, bind, each, makeObject, filter, delay } from "@fui/core" @shortcut() @@ -56,8 +56,8 @@ export class SingleSelectComboDemo extends Widget { }); if (options.selectedValues) { // 过滤 - const filter = makeObject(options.selectedValues, true); - items = filter(items, (i, ob) => !filter[ob.value]); + const filterItems = makeObject(options.selectedValues, true); + items = filter(items, (i, ob) => !filterItems[ob.value]); } if (options.type == SingleSelectCombo.REQ_GET_ALL_DATA) { callback({ diff --git a/packages/fineui/package.json b/packages/fineui/package.json index a7dd64fb6..a12e7eea4 100644 --- a/packages/fineui/package.json +++ b/packages/fineui/package.json @@ -7,8 +7,9 @@ "types": "dist/type/index.d.ts", "sideEffects": [ "dist/es/core/*.js", - "dist/es/polyfill/**/*.js", + "dist/es/core/element/**/*.js", "dist/es/core/platform/**/*.js", + "dist/es/polyfill/**/*.js", "dist/es/case/ztree/jquery.ztree.core-3.5.js", "dist/es/case/ztree/jquery.ztree.excheck-3.5.js" ], diff --git a/packages/fineui/src/base/combination/bubble.js b/packages/fineui/src/base/combination/bubble.js index c81c3a79c..974b1633d 100644 --- a/packages/fineui/src/base/combination/bubble.js +++ b/packages/fineui/src/base/combination/bubble.js @@ -19,8 +19,9 @@ import { emptyFn, LogicFactory, EVENT_RESPONSE_TIME, - EVENT_BLUR + EVENT_BLUR, } from "@/core"; +import { createPopper } from "@popperjs/core"; @shortcut() export class Bubble extends Widget { @@ -427,7 +428,7 @@ export class Bubble extends Widget { options: { offset: () => [adjustXOffset, (showArrow ? 12 : 0) + (adjustYOffset + adjustLength)], }, - } + }, ]; if (this.options.showArrow) { modifiers.push({ @@ -438,7 +439,7 @@ export class Bubble extends Widget { }, }); } - this.popper = BI.Popper.createPopper(this.combo.element[0], this.popupView.element[0], { + this.popper = createPopper(this.combo.element[0], this.popupView.element[0], { placement, strategy: "fixed", modifiers, diff --git a/packages/fineui/src/case/ztree/parttree.js b/packages/fineui/src/case/ztree/parttree.js index b9ccb74f1..5bc75b7ba 100644 --- a/packages/fineui/src/case/ztree/parttree.js +++ b/packages/fineui/src/case/ztree/parttree.js @@ -65,7 +65,8 @@ export class PartTree extends Asynctree { }), function (res) { self.options.paras.selectedValues = res; - this.seMethos(...args); + // 看起来应该是 self + self.seMethos(...args); } ); } else { diff --git a/packages/fineui/src/core/controller/controller.bubbles.js b/packages/fineui/src/core/controller/controller.bubbles.js index 8935a1f88..e92613312 100644 --- a/packages/fineui/src/core/controller/controller.bubbles.js +++ b/packages/fineui/src/core/controller/controller.bubbles.js @@ -7,6 +7,7 @@ import { Controller } from "./0.controller"; import { isNotNull, each } from "../2.base"; import { createWidget } from "../5.inject"; +import { createPopper } from "@popperjs/core"; export class BubblesController extends Controller { init() { @@ -57,7 +58,7 @@ export class BubblesController extends Controller { if (this.storePoppers[name]) { this.storePoppers[name].destroy(); } - this.storePoppers[name] = BI.Popper.createPopper(context.element[0], bubble.element[0], { + this.storePoppers[name] = createPopper(context.element[0], bubble.element[0], { placement: ({ left: "top-start", center: "top", diff --git a/packages/fineui/src/core/controller/controller.resizer.js b/packages/fineui/src/core/controller/controller.resizer.js index 1431904cb..421f06c6d 100644 --- a/packages/fineui/src/core/controller/controller.resizer.js +++ b/packages/fineui/src/core/controller/controller.resizer.js @@ -7,6 +7,7 @@ import { Controller } from "./0.controller"; import { isNull, each, debounce, isNotNull, isFunction } from "../2.base"; import { Widget } from "../4.widget"; import { _global } from "../0.foundation"; +import { Layout } from "../wrapper/layout"; import $ from "jquery"; export class ResizeController extends Controller { @@ -32,7 +33,7 @@ export class ResizeController extends Controller { return; } - if (resizer instanceof BI.Layout) { + if (resizer instanceof Layout) { resizer.resize(); return; diff --git a/packages/fineui/src/widget/multiselect/loader.js b/packages/fineui/src/widget/multiselect/loader.js index c63ee1c77..07aaab62f 100644 --- a/packages/fineui/src/widget/multiselect/loader.js +++ b/packages/fineui/src/widget/multiselect/loader.js @@ -16,7 +16,8 @@ import { isFunction, makeObject, isArray, - each + each, + Element } from "@/core"; @shortcut() @@ -117,7 +118,7 @@ export class MultiSelectInnerLoader extends Widget { }); const renderEngine = Widget._renderEngine; - Widget.registerRenderEngine(BI.Element.renderEngine); + Widget.registerRenderEngine(Element.renderEngine); this.cachGroup = createWidget(o.el, { type: ButtonGroup.xtype, root: true, @@ -192,7 +193,7 @@ export class MultiSelectInnerLoader extends Widget { } } const renderEngine = Widget._renderEngine; - Widget.registerRenderEngine(BI.Element.renderEngine); + Widget.registerRenderEngine(Element.renderEngine); this.cachGroup.addItems(...arguments); Widget.registerRenderEngine(renderEngine); this.button_group.addItems(...arguments); @@ -238,7 +239,7 @@ export class MultiSelectInnerLoader extends Widget { this.cachItems = items.slice(firstItemsCount); } const renderEngine = Widget._renderEngine; - Widget.registerRenderEngine(BI.Element.renderEngine); + Widget.registerRenderEngine(Element.renderEngine); this.cachGroup.populate.call(this.cachGroup, items, keyword); Widget.registerRenderEngine(renderEngine); this.button_group.populate.call(this.button_group, items.slice(0, firstItemsCount), keyword);