Browse Source

KERNEL-14316 fix: 过一遍 Demo,把控制台报错,全部解决掉

es6
Treecat 2 years ago
parent
commit
4a5ffb6398
  1. 1
      packages/demo/src/demo/widget/multiselect/demo.multi_select_combo.js
  2. 4
      packages/demo/src/demo/widget/multiselect/demo.multi_select_list.js
  3. 6
      packages/demo/src/demo/widget/singleselct/demo.single_select_combo.js
  4. 3
      packages/fineui/package.json
  5. 7
      packages/fineui/src/base/combination/bubble.js
  6. 3
      packages/fineui/src/case/ztree/parttree.js
  7. 3
      packages/fineui/src/core/controller/controller.bubbles.js
  8. 3
      packages/fineui/src/core/controller/controller.resizer.js
  9. 9
      packages/fineui/src/widget/multiselect/loader.js

1
packages/demo/src/demo/widget/multiselect/demo.multi_select_combo.js

@ -17,6 +17,7 @@ import {
@shortcut() @shortcut()
export class MultiSelectComboDemo extends Widget { export class MultiSelectComboDemo extends Widget {
static xtype = "demo.multi_select_combo"; static xtype = "demo.multi_select_combo";
static EVENT_CONFIRM = "EVENT_CONFIRM";
props = { baseCls: "demo-multi-select-combo" }; props = { baseCls: "demo-multi-select-combo" };

4
packages/demo/src/demo/widget/multiselect/demo.multi_select_list.js

@ -76,8 +76,8 @@ export class MultiSelectListDemo extends Widget {
}); });
if (options.selectedValues) { if (options.selectedValues) {
// 过滤 // 过滤
const filter = makeObject(options.selectedValues, true); const filterItems = makeObject(options.selectedValues, true);
items = filter(items, (i, ob) => !filter[ob.value]); items = filter(items, (i, ob) => !filterItems[ob.value]);
} }
if (options.type == MultiSelectCombo.REQ_GET_ALL_DATA) { if (options.type == MultiSelectCombo.REQ_GET_ALL_DATA) {
callback({ callback({

6
packages/demo/src/demo/widget/singleselct/demo.single_select_combo.js

@ -1,6 +1,6 @@
import { CONSTANTS } from "@/config/constant"; 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() @shortcut()
@ -56,8 +56,8 @@ export class SingleSelectComboDemo extends Widget {
}); });
if (options.selectedValues) { if (options.selectedValues) {
// 过滤 // 过滤
const filter = makeObject(options.selectedValues, true); const filterItems = makeObject(options.selectedValues, true);
items = filter(items, (i, ob) => !filter[ob.value]); items = filter(items, (i, ob) => !filterItems[ob.value]);
} }
if (options.type == SingleSelectCombo.REQ_GET_ALL_DATA) { if (options.type == SingleSelectCombo.REQ_GET_ALL_DATA) {
callback({ callback({

3
packages/fineui/package.json

@ -7,8 +7,9 @@
"types": "dist/type/index.d.ts", "types": "dist/type/index.d.ts",
"sideEffects": [ "sideEffects": [
"dist/es/core/*.js", "dist/es/core/*.js",
"dist/es/polyfill/**/*.js", "dist/es/core/element/**/*.js",
"dist/es/core/platform/**/*.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.core-3.5.js",
"dist/es/case/ztree/jquery.ztree.excheck-3.5.js" "dist/es/case/ztree/jquery.ztree.excheck-3.5.js"
], ],

7
packages/fineui/src/base/combination/bubble.js

@ -19,8 +19,9 @@ import {
emptyFn, emptyFn,
LogicFactory, LogicFactory,
EVENT_RESPONSE_TIME, EVENT_RESPONSE_TIME,
EVENT_BLUR EVENT_BLUR,
} from "@/core"; } from "@/core";
import { createPopper } from "@popperjs/core";
@shortcut() @shortcut()
export class Bubble extends Widget { export class Bubble extends Widget {
@ -427,7 +428,7 @@ export class Bubble extends Widget {
options: { options: {
offset: () => [adjustXOffset, (showArrow ? 12 : 0) + (adjustYOffset + adjustLength)], offset: () => [adjustXOffset, (showArrow ? 12 : 0) + (adjustYOffset + adjustLength)],
}, },
} },
]; ];
if (this.options.showArrow) { if (this.options.showArrow) {
modifiers.push({ 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, placement,
strategy: "fixed", strategy: "fixed",
modifiers, modifiers,

3
packages/fineui/src/case/ztree/parttree.js

@ -65,7 +65,8 @@ export class PartTree extends Asynctree {
}), }),
function (res) { function (res) {
self.options.paras.selectedValues = res; self.options.paras.selectedValues = res;
this.seMethos(...args); // 看起来应该是 self
self.seMethos(...args);
} }
); );
} else { } else {

3
packages/fineui/src/core/controller/controller.bubbles.js

@ -7,6 +7,7 @@
import { Controller } from "./0.controller"; import { Controller } from "./0.controller";
import { isNotNull, each } from "../2.base"; import { isNotNull, each } from "../2.base";
import { createWidget } from "../5.inject"; import { createWidget } from "../5.inject";
import { createPopper } from "@popperjs/core";
export class BubblesController extends Controller { export class BubblesController extends Controller {
init() { init() {
@ -57,7 +58,7 @@ export class BubblesController extends Controller {
if (this.storePoppers[name]) { if (this.storePoppers[name]) {
this.storePoppers[name].destroy(); 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: ({ placement: ({
left: "top-start", left: "top-start",
center: "top", center: "top",

3
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 { isNull, each, debounce, isNotNull, isFunction } from "../2.base";
import { Widget } from "../4.widget"; import { Widget } from "../4.widget";
import { _global } from "../0.foundation"; import { _global } from "../0.foundation";
import { Layout } from "../wrapper/layout";
import $ from "jquery"; import $ from "jquery";
export class ResizeController extends Controller { export class ResizeController extends Controller {
@ -32,7 +33,7 @@ export class ResizeController extends Controller {
return; return;
} }
if (resizer instanceof BI.Layout) { if (resizer instanceof Layout) {
resizer.resize(); resizer.resize();
return; return;

9
packages/fineui/src/widget/multiselect/loader.js

@ -16,7 +16,8 @@ import {
isFunction, isFunction,
makeObject, makeObject,
isArray, isArray,
each each,
Element
} from "@/core"; } from "@/core";
@shortcut() @shortcut()
@ -117,7 +118,7 @@ export class MultiSelectInnerLoader extends Widget {
}); });
const renderEngine = Widget._renderEngine; const renderEngine = Widget._renderEngine;
Widget.registerRenderEngine(BI.Element.renderEngine); Widget.registerRenderEngine(Element.renderEngine);
this.cachGroup = createWidget(o.el, { this.cachGroup = createWidget(o.el, {
type: ButtonGroup.xtype, type: ButtonGroup.xtype,
root: true, root: true,
@ -192,7 +193,7 @@ export class MultiSelectInnerLoader extends Widget {
} }
} }
const renderEngine = Widget._renderEngine; const renderEngine = Widget._renderEngine;
Widget.registerRenderEngine(BI.Element.renderEngine); Widget.registerRenderEngine(Element.renderEngine);
this.cachGroup.addItems(...arguments); this.cachGroup.addItems(...arguments);
Widget.registerRenderEngine(renderEngine); Widget.registerRenderEngine(renderEngine);
this.button_group.addItems(...arguments); this.button_group.addItems(...arguments);
@ -238,7 +239,7 @@ export class MultiSelectInnerLoader extends Widget {
this.cachItems = items.slice(firstItemsCount); this.cachItems = items.slice(firstItemsCount);
} }
const renderEngine = Widget._renderEngine; const renderEngine = Widget._renderEngine;
Widget.registerRenderEngine(BI.Element.renderEngine); Widget.registerRenderEngine(Element.renderEngine);
this.cachGroup.populate.call(this.cachGroup, items, keyword); this.cachGroup.populate.call(this.cachGroup, items, keyword);
Widget.registerRenderEngine(renderEngine); Widget.registerRenderEngine(renderEngine);
this.button_group.populate.call(this.button_group, items.slice(0, firstItemsCount), keyword); this.button_group.populate.call(this.button_group, items.slice(0, firstItemsCount), keyword);

Loading…
Cancel
Save