Browse Source

KERNEL-14022 refact: 按钮干掉 apply

es6
Treecat 2 years ago
parent
commit
c5ea536fd7
  1. 4
      src/base/single/button/button.basic.js
  2. 4
      src/base/single/button/button.node.js
  3. 5
      src/base/single/button/buttons/button.icon.js
  4. 6
      src/base/single/button/buttons/button.image.js
  5. 8
      src/base/single/button/buttons/button.js
  6. 14
      src/base/single/button/buttons/button.text.js
  7. 8
      src/base/single/button/listitem/blankiconicontextitem.js
  8. 2
      src/base/single/button/listitem/blankicontexticonitem.js
  9. 2
      src/base/single/button/listitem/blankicontextitem.js
  10. 2
      src/base/single/button/listitem/icontexticonitem.js
  11. 4
      src/base/single/button/listitem/icontextitem.js
  12. 6
      src/base/single/button/listitem/texticonitem.js
  13. 8
      src/base/single/button/listitem/textitem.js
  14. 2
      src/base/single/button/node/icontexticonnode.js
  15. 4
      src/base/single/button/node/icontextnode.js
  16. 2
      src/base/single/button/node/texticonnode.js
  17. 6
      src/base/single/button/node/textnode.js
  18. 6
      src/case/button/icon/icon.change.js
  19. 2
      src/case/button/icon/icon.trigger.js
  20. 2
      src/case/button/icon/iconhalf/icon.half.js
  21. 6
      src/case/button/item.multiselect.js
  22. 6
      src/case/button/item.singleselect.icontext.js
  23. 6
      src/case/button/item.singleselect.js
  24. 8
      src/case/button/item.singleselect.radio.js
  25. 6
      src/case/button/node/node.arrow.js
  26. 4
      src/case/button/node/node.first.plus.js
  27. 8
      src/case/button/node/node.icon.arrow.js
  28. 8
      src/case/button/node/node.last.plus.js
  29. 6
      src/case/button/node/node.mid.plus.js
  30. 14
      src/case/button/node/node.multilayer.icon.arrow.js
  31. 4
      src/case/button/node/node.plus.js
  32. 4
      src/case/button/node/siwtcher.tree.node.js
  33. 8
      src/case/button/node/treenode.js
  34. 6
      src/case/button/switch.js
  35. 4
      src/case/button/treeitem/item.first.treeleaf.js
  36. 6
      src/case/button/treeitem/item.icon.treeleaf.js
  37. 4
      src/case/button/treeitem/item.last.treeleaf.js
  38. 2
      src/case/button/treeitem/item.mid.treeleaf.js
  39. 12
      src/case/button/treeitem/item.multilayer.icon.treeleaf.js
  40. 2
      src/case/button/treeitem/item.treetextleaf.js

4
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);
}
}

4
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());
}

5
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);
}

6
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);
}

8
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);
}

14
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);
}
}

8
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);
}

2
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);
}

2
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);
}

2
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);
}

4
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);
}
}

6
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);
}

8
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);
}
}

2
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);
}

4
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);
}
}

2
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);
}

6
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);
}

6
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);
});
}

2
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);

2
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);
}

6
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);
}
}

6
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) {

6
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);
}
}

8
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);
}
}

6
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);
}
}

4
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);
}

8
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);
}
}

8
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);
}

6
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);
}

14
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);
}
}

4
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);
}

4
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);
}
}

8
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);
}
}

6
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());
}
}

4
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,
}))));
}

6
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,
}))));

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

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

12
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);
}

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

Loading…
Cancel
Save