From c5ea536fd7ccc77692746aa089d898fd47a94c0f Mon Sep 17 00:00:00 2001 From: Treecat Date: Fri, 6 Jan 2023 15:31:54 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-14022=20refact:=20=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E5=B9=B2=E6=8E=89=20apply?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/button/button.basic.js | 4 ++-- src/base/single/button/button.node.js | 4 ++-- src/base/single/button/buttons/button.icon.js | 5 ++--- src/base/single/button/buttons/button.image.js | 6 +++--- src/base/single/button/buttons/button.js | 8 ++++---- src/base/single/button/buttons/button.text.js | 14 +++++++------- .../button/listitem/blankiconicontextitem.js | 8 ++++---- .../button/listitem/blankicontexticonitem.js | 2 +- .../single/button/listitem/blankicontextitem.js | 2 +- .../single/button/listitem/icontexticonitem.js | 2 +- src/base/single/button/listitem/icontextitem.js | 4 ++-- src/base/single/button/listitem/texticonitem.js | 6 +++--- src/base/single/button/listitem/textitem.js | 8 ++++---- src/base/single/button/node/icontexticonnode.js | 2 +- src/base/single/button/node/icontextnode.js | 4 ++-- src/base/single/button/node/texticonnode.js | 2 +- src/base/single/button/node/textnode.js | 6 +++--- src/case/button/icon/icon.change.js | 6 +++--- src/case/button/icon/icon.trigger.js | 2 +- src/case/button/icon/iconhalf/icon.half.js | 2 +- src/case/button/item.multiselect.js | 6 +++--- src/case/button/item.singleselect.icontext.js | 6 +++--- src/case/button/item.singleselect.js | 6 +++--- src/case/button/item.singleselect.radio.js | 8 ++++---- src/case/button/node/node.arrow.js | 6 +++--- src/case/button/node/node.first.plus.js | 4 ++-- src/case/button/node/node.icon.arrow.js | 8 ++++---- src/case/button/node/node.last.plus.js | 8 ++++---- src/case/button/node/node.mid.plus.js | 6 +++--- src/case/button/node/node.multilayer.icon.arrow.js | 14 +++++++------- src/case/button/node/node.plus.js | 4 ++-- src/case/button/node/siwtcher.tree.node.js | 4 ++-- src/case/button/node/treenode.js | 8 ++++---- src/case/button/switch.js | 6 +++--- src/case/button/treeitem/item.first.treeleaf.js | 4 ++-- src/case/button/treeitem/item.icon.treeleaf.js | 6 +++--- src/case/button/treeitem/item.last.treeleaf.js | 4 ++-- src/case/button/treeitem/item.mid.treeleaf.js | 2 +- .../treeitem/item.multilayer.icon.treeleaf.js | 12 ++++++------ src/case/button/treeitem/item.treetextleaf.js | 2 +- 40 files changed, 110 insertions(+), 111 deletions(-) diff --git a/src/base/single/button/button.basic.js b/src/base/single/button/button.basic.js index f2f09216c..ce2d1dfa8 100644 --- a/src/base/single/button/button.basic.js +++ b/src/base/single/button/button.basic.js @@ -439,7 +439,7 @@ export class BasicButton extends Single { } _setEnable(enable) { - super._setEnable.apply(this, arguments); + super._setEnable(...arguments); if (enable === true) { this.element.removeClass("base-disabled disabled"); } else if (enable === false) { @@ -454,7 +454,7 @@ export class BasicButton extends Single { empty() { Widget._renderEngine.createElement(document).unbind(`mouseup.${this.getName()}`); - super.empty.apply(this, arguments); + super.empty(...arguments); } } diff --git a/src/base/single/button/button.node.js b/src/base/single/button/button.node.js index 7b8cc4632..d48bab2fb 100644 --- a/src/base/single/button/button.node.js +++ b/src/base/single/button/button.node.js @@ -27,11 +27,11 @@ export class NodeButton extends BasicButton { if (this.isOpened()) { this.setOpened(this.isOpened()); } - super._initRef.apply(this, arguments); + super._initRef(...arguments); } doClick() { - super.doClick.apply(this, arguments); + super.doClick(...arguments); this.setOpened(!this.isOpened()); } diff --git a/src/base/single/button/buttons/button.icon.js b/src/base/single/button/buttons/button.icon.js index 9e8228a55..5f3100a9b 100644 --- a/src/base/single/button/buttons/button.icon.js +++ b/src/base/single/button/buttons/button.icon.js @@ -8,7 +8,6 @@ import { shortcut, extend, isNumber, createWidget, isNull } from "../../../../co */ @shortcut() export class IconButton extends BasicButton { - static EVENT_CHANGE = "EVENT_CHANGE"; static xtype = "bi.icon_button"; @@ -16,7 +15,7 @@ export class IconButton extends BasicButton { const conf = super._defaultConfig(arguments); return extend(conf, { - _baseCls: (conf._baseCls || "") + " bi-icon-button horizon-center", + _baseCls: `${conf._baseCls || ""} bi-icon-button horizon-center`, hgap: 0, vgap: 0, tgap: 0, @@ -68,7 +67,7 @@ export class IconButton extends BasicButton { } doClick() { - super.doClick.apply(this, arguments); + super.doClick(...arguments); if (this.isValid()) { this.fireEvent(IconButton.EVENT_CHANGE, this); } diff --git a/src/base/single/button/buttons/button.image.js b/src/base/single/button/buttons/button.image.js index c6486e359..e8fcf6ede 100644 --- a/src/base/single/button/buttons/button.image.js +++ b/src/base/single/button/buttons/button.image.js @@ -50,12 +50,12 @@ export class ImageButton extends BasicButton { } setWidth(w) { - super.setWidth.apply(this, arguments); + super.setWidth(...arguments); this.options.width = w; } setHeight(h) { - super.setHeight.apply(this, arguments); + super.setHeight(...arguments); this.options.height = h; } @@ -85,7 +85,7 @@ export class ImageButton extends BasicButton { } doClick() { - super.doClick.apply(this, arguments); + super.doClick(...arguments); if (this.isValid()) { this.fireEvent(ImageButton.EVENT_CHANGE, this); } diff --git a/src/base/single/button/buttons/button.js b/src/base/single/button/buttons/button.js index 674400853..edc4cf32d 100644 --- a/src/base/single/button/buttons/button.js +++ b/src/base/single/button/buttons/button.js @@ -188,14 +188,14 @@ export class Button extends BasicButton { } doClick() { - super.doClick.apply(this, arguments); + super.doClick(...arguments); if (this.isValid()) { this.fireEvent(Button.EVENT_CHANGE, this); } } _setEnable(enable) { - super._setEnable.apply(this, arguments); + super._setEnable(...arguments); if (enable === true) { this.element.attr("tabIndex", 1); } else if (enable === false) { @@ -236,12 +236,12 @@ export class Button extends BasicButton { } setText(text) { - super.setText.apply(this, arguments); + super.setText(...arguments); this.text.setText(text); } setValue(text) { - super.setValue.apply(this, arguments); + super.setValue(...arguments); if (!this.isReadOnly()) { this.text.setValue(text); } diff --git a/src/base/single/button/buttons/button.text.js b/src/base/single/button/buttons/button.text.js index 281047b55..107a8ba38 100644 --- a/src/base/single/button/buttons/button.text.js +++ b/src/base/single/button/buttons/button.text.js @@ -1,5 +1,5 @@ import { BasicButton } from "../button.basic"; -import { shortcut, extend, createWidget } from "../../../../core"; +import { shortcut, extend, createWidget, isArray } from "../../../../core"; /** * guy @@ -53,9 +53,9 @@ export class TextButton extends BasicButton { } doClick() { - super.doClick.apply(this, arguments); + super.doClick(...arguments); if (this.isValid()) { - this.fireEvent(BI.TextButton.EVENT_CHANGE, this.getValue(), this); + this.fireEvent(TextButton.EVENT_CHANGE, this.getValue(), this); } } @@ -76,8 +76,8 @@ export class TextButton extends BasicButton { } setText(text) { - super.setText.apply(this, arguments); - text = BI.isArray(text) ? text.join(",") : text; + super.setText(...arguments); + text = isArray(text) ? text.join(",") : text; this.text.setText(text); } @@ -86,9 +86,9 @@ export class TextButton extends BasicButton { } setValue(text) { - super.setValue.apply(this, arguments); + super.setValue(...arguments); if (!this.isReadOnly()) { - text = BI.isArray(text) ? text.join(",") : text; + text = isArray(text) ? text.join(",") : text; this.text.setValue(text); } } diff --git a/src/base/single/button/listitem/blankiconicontextitem.js b/src/base/single/button/listitem/blankiconicontextitem.js index 2a471e7b7..d57267110 100644 --- a/src/base/single/button/listitem/blankiconicontextitem.js +++ b/src/base/single/button/listitem/blankiconicontextitem.js @@ -1,5 +1,5 @@ import { BasicButton } from "../button.basic"; -import { shortcut } from "../../../../core"; +import { shortcut, extend } from "../../../../core"; /** * 带有一个占位 @@ -16,7 +16,7 @@ export class BlankIconIconTextItem extends BasicButton { _defaultConfig() { const conf = super._defaultConfig(arguments); - return BI.extend(conf, { + return extend(conf, { baseCls: `${conf.baseCls || ""} bi-blank-icon-icon-text-item`, iconCls1: "", iconCls2: "", @@ -74,14 +74,14 @@ export class BlankIconIconTextItem extends BasicButton { } doClick() { - super.doClick.apply(this, arguments); + super.doClick(...arguments); if (this.isValid()) { this.fireEvent(BlankIconIconTextItem.EVENT_CHANGE, this.getValue(), this); } } setSelected(b) { - super.setSelected.apply(this, arguments); + super.setSelected(...arguments); this.icon1.setSelected(b); this.icon2.setSelected(b); } diff --git a/src/base/single/button/listitem/blankicontexticonitem.js b/src/base/single/button/listitem/blankicontexticonitem.js index 217906da8..1880cdcb3 100644 --- a/src/base/single/button/listitem/blankicontexticonitem.js +++ b/src/base/single/button/listitem/blankicontexticonitem.js @@ -75,7 +75,7 @@ export class BlankIconTextIconItem extends BasicButton { } doClick() { - super.doClick.apply(this, arguments); + super.doClick(...arguments); if (this.isValid()) { this.fireEvent(BI.BlankIconTextIconItem.EVENT_CHANGE, this.getValue(), this); } diff --git a/src/base/single/button/listitem/blankicontextitem.js b/src/base/single/button/listitem/blankicontextitem.js index fd2b34d32..30be259d2 100644 --- a/src/base/single/button/listitem/blankicontextitem.js +++ b/src/base/single/button/listitem/blankicontextitem.js @@ -67,7 +67,7 @@ export class BlankIconTextItem extends BasicButton { } doClick() { - super.doClick.apply(this, arguments); + super.doClick(...arguments); if (this.isValid()) { this.fireEvent(BlankIconTextItem.EVENT_CHANGE, this.getValue(), this); } diff --git a/src/base/single/button/listitem/icontexticonitem.js b/src/base/single/button/listitem/icontexticonitem.js index 1209e8054..3d95eac4e 100644 --- a/src/base/single/button/listitem/icontexticonitem.js +++ b/src/base/single/button/listitem/icontexticonitem.js @@ -72,7 +72,7 @@ export class IconTextIconItem extends BasicButton { } doClick() { - super.doClick.apply(this, arguments); + super.doClick(...arguments); if (this.isValid()) { this.fireEvent(IconTextIconItem.EVENT_CHANGE, this.getValue(), this); } diff --git a/src/base/single/button/listitem/icontextitem.js b/src/base/single/button/listitem/icontextitem.js index 70ce49654..b906cc6e7 100644 --- a/src/base/single/button/listitem/icontextitem.js +++ b/src/base/single/button/listitem/icontextitem.js @@ -65,9 +65,9 @@ export class IconTextItem extends BasicButton { } doClick() { - super.doClick.apply(this, arguments); + super.doClick(...arguments); if (this.isValid()) { - this.fireEvent(BI.IconTextItem.EVENT_CHANGE, this.getValue(), this); + this.fireEvent(IconTextItem.EVENT_CHANGE, this.getValue(), this); } } diff --git a/src/base/single/button/listitem/texticonitem.js b/src/base/single/button/listitem/texticonitem.js index db9b30478..c17811c92 100644 --- a/src/base/single/button/listitem/texticonitem.js +++ b/src/base/single/button/listitem/texticonitem.js @@ -39,8 +39,8 @@ export class TextIconItem extends BasicButton { items: [{ el: { type: "bi.label", - ref (_ref) { - self.text = _ref; + ref: _ref => { + this.text = _ref; }, cls: "list-item-text", textAlign: "left", @@ -65,7 +65,7 @@ export class TextIconItem extends BasicButton { } doClick() { - super.doClick.apply(this, arguments); + super.doClick(...arguments); if (this.isValid()) { this.fireEvent(TextIconItem.EVENT_CHANGE, this.getValue(), this); } diff --git a/src/base/single/button/listitem/textitem.js b/src/base/single/button/listitem/textitem.js index a1bb719b5..698843370 100644 --- a/src/base/single/button/listitem/textitem.js +++ b/src/base/single/button/listitem/textitem.js @@ -1,5 +1,5 @@ import { BasicButton } from "../button.basic"; -import { extend, shortcut } from "../../../../core"; +import { extend, shortcut, createWidget } from "../../../../core"; /** * guy @@ -30,7 +30,7 @@ export class TextItem extends BasicButton { render() { const o = this.options; - this.text = BI.createWidget({ + this.text = createWidget({ type: "bi.label", element: this, textAlign: o.textAlign, @@ -49,9 +49,9 @@ export class TextItem extends BasicButton { } doClick() { - super.doClick.apply(this, arguments); + super.doClick(...arguments); if (this.isValid()) { - this.fireEvent(BI.TextItem.EVENT_CHANGE, this.getValue(), this); + this.fireEvent(TextItem.EVENT_CHANGE, this.getValue(), this); } } diff --git a/src/base/single/button/node/icontexticonnode.js b/src/base/single/button/node/icontexticonnode.js index a08b63c8d..77a737b48 100644 --- a/src/base/single/button/node/icontexticonnode.js +++ b/src/base/single/button/node/icontexticonnode.js @@ -69,7 +69,7 @@ export class IconTextIconNode extends NodeButton { } doClick() { - super.doClick.apply(this, arguments); + super.doClick(...arguments); if (this.isValid()) { this.fireEvent(IconTextIconNode.EVENT_CHANGE, this.getValue(), this); } diff --git a/src/base/single/button/node/icontextnode.js b/src/base/single/button/node/icontextnode.js index 5135030db..54c2b60bf 100644 --- a/src/base/single/button/node/icontextnode.js +++ b/src/base/single/button/node/icontextnode.js @@ -62,9 +62,9 @@ export class IconTextNode extends NodeButton { } doClick() { - super.doClick.apply(this, arguments); + super.doClick(...arguments); if (this.isValid()) { - this.fireEvent(BI.IconTextNode.EVENT_CHANGE, this.getValue(), this); + this.fireEvent(IconTextNode.EVENT_CHANGE, this.getValue(), this); } } diff --git a/src/base/single/button/node/texticonnode.js b/src/base/single/button/node/texticonnode.js index cc3f2dea8..e4ca824a1 100644 --- a/src/base/single/button/node/texticonnode.js +++ b/src/base/single/button/node/texticonnode.js @@ -61,7 +61,7 @@ export default class TextIconNode extends NodeButton { } doClick() { - super.doClick.apply(this, arguments); + super.doClick(...arguments); if (this.isValid()) { this.fireEvent(TextIconNode.EVENT_CHANGE, this.getValue(), this); } diff --git a/src/base/single/button/node/textnode.js b/src/base/single/button/node/textnode.js index e6e990cf7..c7b56766d 100644 --- a/src/base/single/button/node/textnode.js +++ b/src/base/single/button/node/textnode.js @@ -1,5 +1,5 @@ import { NodeButton } from "../button.node"; -import { extend, shortcut } from "../../../../core"; +import { extend, shortcut, createWidget } from "../../../../core"; /** * guy @@ -31,7 +31,7 @@ export class TextNode extends NodeButton { render() { const o = this.options; - this.text = BI.createWidget({ + this.text = createWidget({ type: "bi.label", element: this, textAlign: o.textAlign, @@ -50,7 +50,7 @@ export class TextNode extends NodeButton { } doClick() { - super.doClick.apply(this, arguments); + super.doClick(...arguments); if (this.isValid()) { this.fireEvent(TextNode.EVENT_CHANGE, this.getValue(), this); } diff --git a/src/case/button/icon/icon.change.js b/src/case/button/icon/icon.change.js index 3e5ad6c46..f477373e5 100644 --- a/src/case/button/icon/icon.change.js +++ b/src/case/button/icon/icon.change.js @@ -45,7 +45,7 @@ export class IconChangeButton extends Single { o.iconCls = isFunction(o.iconCls) ? this.__watch(o.iconCls, (context, newValue) => { this.setIcon(newValue); }) : o.iconCls; - super._init.apply(this, arguments); + super._init(...arguments); this.button = createWidget({ type: "bi.icon_button", element: this, @@ -69,10 +69,10 @@ export class IconChangeButton extends Single { }); this.button.on(Controller.EVENT_CHANGE, (...args) => { - this.fireEvent(Controller.EVENT_CHANGE, args); + this.fireEvent(Controller.EVENT_CHANGE, ...args); }); this.button.on(IconButton.EVENT_CHANGE, (...args) => { - this.fireEvent(IconChangeButton.EVENT_CHANGE, args); + this.fireEvent(IconChangeButton.EVENT_CHANGE, ...args); }); } diff --git a/src/case/button/icon/icon.trigger.js b/src/case/button/icon/icon.trigger.js index 1c799edd4..a9afa3d8a 100644 --- a/src/case/button/icon/icon.trigger.js +++ b/src/case/button/icon/icon.trigger.js @@ -11,7 +11,7 @@ import { shortcut, extend } from "../../../core"; @shortcut() export class TriggerIconButton extends IconButton { static xtype = "bi.trigger_icon_button"; - EVENT_CHANGE = IconButton.EVENT_CHANGE; + static EVENT_CHANGE = IconButton.EVENT_CHANGE; _defaultConfig() { const conf = super._defaultConfig(arguments); diff --git a/src/case/button/icon/iconhalf/icon.half.js b/src/case/button/icon/iconhalf/icon.half.js index 1efe6c110..7a72e5823 100644 --- a/src/case/button/icon/iconhalf/icon.half.js +++ b/src/case/button/icon/iconhalf/icon.half.js @@ -38,7 +38,7 @@ export class HalfButton extends BasicButton { } doClick() { - super.doClick.apply(this, arguments); + super.doClick(...arguments); if (this.isValid()) { this.fireEvent(HalfButton.EVENT_CHANGE); } diff --git a/src/case/button/item.multiselect.js b/src/case/button/item.multiselect.js index df74642c9..dd5548f4a 100644 --- a/src/case/button/item.multiselect.js +++ b/src/case/button/item.multiselect.js @@ -77,14 +77,14 @@ export class MultiSelectItem extends BasicButton { } doClick() { - BI.MultiSelectItem.superclass.doClick.apply(this, arguments); + super.doClick(...arguments); if (this.isValid()) { - this.fireEvent(BI.MultiSelectItem.EVENT_CHANGE, this.getValue(), this); + this.fireEvent(MultiSelectItem.EVENT_CHANGE, this.getValue(), this); } } setSelected(v) { - BI.MultiSelectItem.superclass.setSelected.apply(this, arguments); + super.setSelected(...arguments); this.checkbox.setSelected(v); } } diff --git a/src/case/button/item.singleselect.icontext.js b/src/case/button/item.singleselect.icontext.js index d92f59050..c32fc6b5a 100644 --- a/src/case/button/item.singleselect.icontext.js +++ b/src/case/button/item.singleselect.icontext.js @@ -43,13 +43,13 @@ export class SingleSelectIconTextItem extends Single { value: o.value, py: o.py, }); - this.text.on(Controller.EVENT_CHANGE, function () { - self.fireEvent(Controller.EVENT_CHANGE, arguments); + this.text.on(Controller.EVENT_CHANGE, (...args) => { + this.fireEvent(Controller.EVENT_CHANGE, ...args); }); } _setEnable(enable) { - super._setEnable.apply(this, arguments); + super._setEnable(...arguments); if (enable === true) { this.element.attr("tabIndex", 1); } else if (enable === false) { diff --git a/src/case/button/item.singleselect.js b/src/case/button/item.singleselect.js index 9b3e682c7..e06f1c4a9 100644 --- a/src/case/button/item.singleselect.js +++ b/src/case/button/item.singleselect.js @@ -39,7 +39,7 @@ export class SingleSelectItem extends BasicButton { } _setEnable(enable) { - super._setEnable.apply(this, arguments); + super._setEnable(...arguments); if (enable === true) { this.element.attr("tabIndex", 1); } else if (enable === false) { @@ -56,14 +56,14 @@ export class SingleSelectItem extends BasicButton { } doClick() { - super.doClick.apply(this, arguments); + super.doClick(...arguments); if (this.isValid()) { this.fireEvent(SingleSelectItem.EVENT_CHANGE, this.isSelected(), this); } } setSelected(v) { - super.setSelected.apply(this, arguments); + super.setSelected(...arguments); } } diff --git a/src/case/button/item.singleselect.radio.js b/src/case/button/item.singleselect.radio.js index 19a04f120..8a314165d 100644 --- a/src/case/button/item.singleselect.radio.js +++ b/src/case/button/item.singleselect.radio.js @@ -62,7 +62,7 @@ export class SingleSelectRadioItem extends BasicButton { } _setEnable(enable) { - super._setEnable.apply(this, arguments); + super._setEnable(...arguments); if (enable === true) { this.element.attr("tabIndex", 1); } else if (enable === false) { @@ -79,14 +79,14 @@ export class SingleSelectRadioItem extends BasicButton { } doClick() { - BI.SingleSelectRadioItem.superclass.doClick.apply(this, arguments); + super.doClick(...arguments); if (this.isValid()) { - this.fireEvent(BI.SingleSelectRadioItem.EVENT_CHANGE, this.isSelected(), this); + this.fireEvent(SingleSelectRadioItem.EVENT_CHANGE, this.isSelected(), this); } } setSelected(v) { - BI.SingleSelectRadioItem.superclass.setSelected.apply(this, arguments); + super.setSelected(...arguments); this.radio.setSelected(v); } } diff --git a/src/case/button/node/node.arrow.js b/src/case/button/node/node.arrow.js index 08cc58605..aac112417 100644 --- a/src/case/button/node/node.arrow.js +++ b/src/case/button/node/node.arrow.js @@ -64,17 +64,17 @@ export class ArrowNode extends NodeButton { } doClick() { - super.doClick.apply(this, arguments); + super.doClick(...arguments); this.checkbox.setSelected(this.isOpened()); } setText(text) { - super.setText.apply(this, arguments); + super.setText(...arguments); this.text.setText(text); } setOpened(v) { - super.setOpened.apply(this, arguments); + super.setOpened(...arguments); this.checkbox.setSelected(v); } } diff --git a/src/case/button/node/node.first.plus.js b/src/case/button/node/node.first.plus.js index 60a266d49..5202c77ee 100644 --- a/src/case/button/node/node.first.plus.js +++ b/src/case/button/node/node.first.plus.js @@ -78,12 +78,12 @@ export class FirstPlusGroupNode extends NodeButton { } doClick() { - super.doClick.apply(this, arguments); + super.doClick(...arguments); this.checkbox.setSelected(this.isSelected()); } setOpened(v) { - super.setOpened.apply(this, arguments); + super.setOpened(...arguments); if (BI.isNotNull(this.checkbox)) { this.checkbox.setSelected(v); } diff --git a/src/case/button/node/node.icon.arrow.js b/src/case/button/node/node.icon.arrow.js index 2aa910a9b..c779795ec 100644 --- a/src/case/button/node/node.icon.arrow.js +++ b/src/case/button/node/node.icon.arrow.js @@ -1,5 +1,5 @@ import { NodeButton } from "../../../base/single/button/button.node"; -import { shortcut, extend, createWidget, Controller } from "../../../core"; +import { shortcut, extend, createWidget, Controller, isNotNull } from "../../../core"; /** * Created by User on 2016/3/31. @@ -96,13 +96,13 @@ export class IconArrowNode extends NodeButton { } doClick() { - BI.IconArrowNode.superclass.doClick.apply(this, arguments); + super.doClick(...arguments); this.checkbox.setSelected(this.isSelected()); } setOpened(v) { - BI.IconArrowNode.superclass.setOpened.apply(this, arguments); - if (BI.isNotNull(this.checkbox)) { + super.setOpened(...arguments); + if (isNotNull(this.checkbox)) { this.checkbox.setSelected(v); } } diff --git a/src/case/button/node/node.last.plus.js b/src/case/button/node/node.last.plus.js index 0dba75eaf..2f273f1d8 100644 --- a/src/case/button/node/node.last.plus.js +++ b/src/case/button/node/node.last.plus.js @@ -1,5 +1,5 @@ import { NodeButton } from "../../../base/single/button/button.node"; -import { shortcut, extend, createWidget, isNotNull } from "../../../core"; +import { shortcut, extend, createWidget, isNotNull, Controller } from "../../../core"; /** * 加号表示的组节点 @@ -46,7 +46,7 @@ export class LastPlusGroupNode extends NodeButton { py: o.py, keyword: o.keyword, }); - this.checkbox.on(BI.Controller.EVENT_CHANGE, type => { + this.checkbox.on(Controller.EVENT_CHANGE, type => { if (type === BI.Events.CLICK) { if (this.checkbox.isSelected()) { this.triggerExpand(); @@ -76,12 +76,12 @@ export class LastPlusGroupNode extends NodeButton { } doClick() { - super.doClick.apply(this, arguments); + super.doClick(...arguments); this.checkbox.setSelected(this.isSelected()); } setOpened(v) { - super.setOpened.apply(this, arguments); + super.setOpened(...arguments); if (isNotNull(this.checkbox)) { this.checkbox.setSelected(v); } diff --git a/src/case/button/node/node.mid.plus.js b/src/case/button/node/node.mid.plus.js index 94ce8b1b9..116a73a48 100644 --- a/src/case/button/node/node.mid.plus.js +++ b/src/case/button/node/node.mid.plus.js @@ -27,7 +27,7 @@ export class MidPlusGroupNode extends NodeButton { } _init() { - super._init.apply(this, arguments); + super._init(...arguments); const o = this.options; this.checkbox = createWidget({ type: "bi.mid_tree_node_checkbox", @@ -77,12 +77,12 @@ export class MidPlusGroupNode extends NodeButton { } doClick() { - super.doClick.apply(this, arguments); + super.doClick(...arguments); this.checkbox.setSelected(this.isSelected()); } setOpened(v) { - BI.MidPlusGroupNode.superclass.setOpened.apply(this, arguments); + super.setOpened(...arguments); if (BI.isNotNull(this.checkbox)) { this.checkbox.setSelected(v); } diff --git a/src/case/button/node/node.multilayer.icon.arrow.js b/src/case/button/node/node.multilayer.icon.arrow.js index c1a9b35da..958e88b79 100644 --- a/src/case/button/node/node.multilayer.icon.arrow.js +++ b/src/case/button/node/node.multilayer.icon.arrow.js @@ -1,5 +1,5 @@ import { NodeButton } from "../../../base/single/button/button.node"; -import { shortcut, extend, createWidget, Controller, count } from "../../../core"; +import { shortcut, extend, createWidget, Controller, count, makeArray } from "../../../core"; @shortcut() export class MultiLayerIconArrowNode extends NodeButton { @@ -22,7 +22,7 @@ export class MultiLayerIconArrowNode extends NodeButton { } _init() { - super._init.apply(this, arguments); + super._init(...arguments); const o = this.options; this.node = createWidget({ type: "bi.icon_arrow_node", @@ -42,7 +42,7 @@ export class MultiLayerIconArrowNode extends NodeButton { }); this.node.on(Controller.EVENT_CHANGE, (...args) => { this.setSelected(this.isSelected()); - this.fireEvent(Controller.EVENT_CHANGE, args); + this.fireEvent(Controller.EVENT_CHANGE, ...args); }); const items = []; @@ -57,7 +57,7 @@ export class MultiLayerIconArrowNode extends NodeButton { createWidget({ type: "bi.horizontal_adapt", element: this, - columnSize: BI.makeArray(o.layer, 15), + columnSize: makeArray(o.layer, 15), items, }); } @@ -79,17 +79,17 @@ export class MultiLayerIconArrowNode extends NodeButton { } setSelected(b) { - super.setSelected.apply(this, arguments); + super.setSelected(...arguments); this.node.setSelected(b); } doClick() { - super.doClick.apply(this, arguments); + super.doClick(...arguments); this.node.setSelected(this.isSelected()); } setOpened(v) { - super.setOpened.apply(this, arguments); + super.setOpened(...arguments); this.node.setOpened(v); } } diff --git a/src/case/button/node/node.plus.js b/src/case/button/node/node.plus.js index f3f08b0cf..b04624456 100644 --- a/src/case/button/node/node.plus.js +++ b/src/case/button/node/node.plus.js @@ -73,12 +73,12 @@ export class PlusGroupNode extends NodeButton { } doClick() { - super.doClick.apply(this, arguments); + super.doClick(...arguments); this.checkbox.setSelected(this.isSelected()); } setOpened(v) { - super.setOpened.apply(this, arguments); + super.setOpened(...arguments); if (this.checkbox) { this.checkbox.setSelected(v); } diff --git a/src/case/button/node/siwtcher.tree.node.js b/src/case/button/node/siwtcher.tree.node.js index 46519ecb5..fe89b6569 100644 --- a/src/case/button/node/siwtcher.tree.node.js +++ b/src/case/button/node/siwtcher.tree.node.js @@ -46,7 +46,7 @@ export class TreeNodeSwitcher extends NodeButton { } setOpened(b) { - super.setOpened.apply(this, arguments); + super.setOpened(...arguments); const [collapse, expand] = this.getIconCls(); if (b) { this.element.addClass(expand).removeClass(collapse); @@ -56,7 +56,7 @@ export class TreeNodeSwitcher extends NodeButton { } doClick() { - super.doClick.apply(this, arguments); + super.doClick(...arguments); this.fireEvent(TreeNodeSwitcher.EVENT_CHANGE, this); } } diff --git a/src/case/button/node/treenode.js b/src/case/button/node/treenode.js index b2977e50a..e0a931e7d 100644 --- a/src/case/button/node/treenode.js +++ b/src/case/button/node/treenode.js @@ -28,7 +28,7 @@ export class BasicTreeNode extends NodeButton { const checkbox = { type: "bi.tree_node_switcher", - __ref: _ref => { + ref: _ref => { this.switcher = _ref; }, iconHeight: o.height, @@ -97,16 +97,16 @@ export class BasicTreeNode extends NodeButton { if (this.options.selectable) { return; } - super.doClick.apply(this, arguments); + super.doClick(...arguments); } setOpened(v) { - super.setOpened.apply(this, arguments); + super.setOpened(...arguments); this.switcher.setOpened(v); } setValue() { - super.setValue.apply(this, arguments); + super.setValue(...arguments); } } diff --git a/src/case/button/switch.js b/src/case/button/switch.js index c05baa832..f40cf3cf4 100644 --- a/src/case/button/switch.js +++ b/src/case/button/switch.js @@ -72,7 +72,7 @@ export class Switch extends BasicButton { } _setEnable(enable) { - super._setEnable.apply(this, arguments); + super._setEnable(...arguments); if (enable === true) { this.element.attr("tabIndex", 1); } else if (enable === false) { @@ -81,7 +81,7 @@ export class Switch extends BasicButton { } setSelected(v) { - super.setSelected.apply(this, arguments); + super.setSelected(...arguments); this.layout.attr("items")[0].left = v ? 28 : 4; this.layout.resize(); this.options.showTip && this.openTip.setVisible(v); @@ -89,7 +89,7 @@ export class Switch extends BasicButton { } doClick() { - super.doClick.apply(this, arguments); + super.doClick(...arguments); this.fireEvent(Switch.EVENT_CHANGE, this.isSelected()); } } diff --git a/src/case/button/treeitem/item.first.treeleaf.js b/src/case/button/treeitem/item.first.treeleaf.js index d09376bc0..f379f65c0 100644 --- a/src/case/button/treeitem/item.first.treeleaf.js +++ b/src/case/button/treeitem/item.first.treeleaf.js @@ -19,7 +19,7 @@ export class FirstTreeLeafItem extends BasicButton { } _init() { - super._init.apply(this, arguments); + super._init(...arguments); const o = this.options; this.text = createWidget({ type: "bi.label", @@ -55,7 +55,7 @@ export class FirstTreeLeafItem extends BasicButton { }); createWidget(extend({ element: this, - }, BI.LogicFactory.createLogic(type, BI.extend(o.logic, { + }, BI.LogicFactory.createLogic(type, extend(o.logic, { items, })))); } diff --git a/src/case/button/treeitem/item.icon.treeleaf.js b/src/case/button/treeitem/item.icon.treeleaf.js index 280270774..56b94723b 100644 --- a/src/case/button/treeitem/item.icon.treeleaf.js +++ b/src/case/button/treeitem/item.icon.treeleaf.js @@ -19,7 +19,7 @@ export class IconTreeLeafItem extends BasicButton { } _init() { - super._init.apply(this, arguments); + super._init(...arguments); const o = this.options; const icon = createWidget({ @@ -52,9 +52,9 @@ export class IconTreeLeafItem extends BasicButton { }, { el: this.text, }); - createWidget(BI.extend({ + createWidget(extend({ element: this, - }, BI.LogicFactory.createLogic(type, BI.extend(o.logic, { + }, BI.LogicFactory.createLogic(type, extend(o.logic, { items, hgap: 5, })))); diff --git a/src/case/button/treeitem/item.last.treeleaf.js b/src/case/button/treeitem/item.last.treeleaf.js index 887b95a2f..e8317f892 100644 --- a/src/case/button/treeitem/item.last.treeleaf.js +++ b/src/case/button/treeitem/item.last.treeleaf.js @@ -19,7 +19,7 @@ export class LastTreeLeafItem extends BasicButton { } _init() { - super._init.apply(this, arguments); + super._init(...arguments); const o = this.options; this.text = createWidget({ type: "bi.label", @@ -53,7 +53,7 @@ export class LastTreeLeafItem extends BasicButton { }, { el: this.text, }); - createWidget(BI.extend({ + createWidget(extend({ element: this, }, BI.LogicFactory.createLogic(type, extend(o.logic, { items, diff --git a/src/case/button/treeitem/item.mid.treeleaf.js b/src/case/button/treeitem/item.mid.treeleaf.js index 69e7bee6b..dfc00d4db 100644 --- a/src/case/button/treeitem/item.mid.treeleaf.js +++ b/src/case/button/treeitem/item.mid.treeleaf.js @@ -19,7 +19,7 @@ export class MidTreeLeafItem extends BasicButton { } _init() { - super._init.apply(this, arguments); + super._init(...arguments); const o = this.options; this.text = createWidget({ type: "bi.label", diff --git a/src/case/button/treeitem/item.multilayer.icon.treeleaf.js b/src/case/button/treeitem/item.multilayer.icon.treeleaf.js index 2d5e043fb..b39108611 100644 --- a/src/case/button/treeitem/item.multilayer.icon.treeleaf.js +++ b/src/case/button/treeitem/item.multilayer.icon.treeleaf.js @@ -1,5 +1,5 @@ import { BasicButton } from "../../../base/single/button/button.basic"; -import { shortcut, extend, createWidget, Controller, makeArray } from "../../../core"; +import { shortcut, extend, createWidget, Controller, makeArray, count } from "../../../core"; /** * @class BI.MultiLayerIconTreeLeafItem @@ -21,7 +21,7 @@ export class MultiLayerIconTreeLeafItem extends BasicButton { } _init() { - super._init.apply(this, arguments); + super._init(...arguments); const o = this.options; this.item = createWidget({ type: "bi.icon_tree_leaf_item", @@ -44,11 +44,11 @@ export class MultiLayerIconTreeLeafItem extends BasicButton { if (type === BI.Events.CLICK) {// 本身实现click功能 return; } - this.fireEvent(Controller.EVENT_CHANGE, args); + this.fireEvent(Controller.EVENT_CHANGE, ...args); }); const items = []; - BI.count(0, o.layer, () => { + count(0, o.layer, () => { items.push({ type: "bi.layout", width: 15, @@ -89,12 +89,12 @@ export class MultiLayerIconTreeLeafItem extends BasicButton { } doClick () { - BI.MultiLayerIconTreeLeafItem.superclass.doClick.apply(this, arguments); + super.doClick(...arguments); this.item.setSelected(this.isSelected()); } setSelected(v) { - BI.MultiLayerIconTreeLeafItem.superclass.setSelected.apply(this, arguments); + super.setSelected(...arguments); this.item.setSelected(v); } diff --git a/src/case/button/treeitem/item.treetextleaf.js b/src/case/button/treeitem/item.treetextleaf.js index 2dca402e8..7bc273210 100644 --- a/src/case/button/treeitem/item.treetextleaf.js +++ b/src/case/button/treeitem/item.treetextleaf.js @@ -24,7 +24,7 @@ export class TreeTextLeafItem extends BasicButton { } _init() { - super._init.apply(this, arguments); + super._init(...arguments); const o = this.options; this.text = createWidget({ type: "bi.label",