|
|
|
@ -12,6 +12,7 @@ import {
|
|
|
|
|
} from "@/core"; |
|
|
|
|
import { BubbleCombo } from "@/case/combo/bubblecombo/combo.bubble"; |
|
|
|
|
import { Single } from "../0.single"; |
|
|
|
|
import { BubblePopupView } from "@/case/combo/bubblecombo/popup.bubble"; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* guy |
|
|
|
@ -105,7 +106,7 @@ export class BasicButton extends Single {
|
|
|
|
|
right: 0, |
|
|
|
|
top: 0, |
|
|
|
|
bottom: 0, |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
@ -117,7 +118,7 @@ export class BasicButton extends Single {
|
|
|
|
|
this.$mask.invisible(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
this.element.on(`mouseenter.${this.getName()}`, (e) => { |
|
|
|
|
this.element.on(`mouseenter.${this.getName()}`, e => { |
|
|
|
|
if (this.element.__isMouseInBounds__(e)) { |
|
|
|
|
if (this.isEnabled() && !this._hover && (o.isShadowShowingOnSelected || !this.isSelected())) { |
|
|
|
|
assertMask(); |
|
|
|
@ -125,7 +126,7 @@ export class BasicButton extends Single {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
this.element.on(`mousemove.${this.getName()}`, (e) => { |
|
|
|
|
this.element.on(`mousemove.${this.getName()}`, e => { |
|
|
|
|
if (!this.element.__isMouseInBounds__(e)) { |
|
|
|
|
if (this.isEnabled() && !this._hover) { |
|
|
|
|
assertMask(); |
|
|
|
@ -158,7 +159,7 @@ export class BasicButton extends Single {
|
|
|
|
|
return bubble; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const clk = (e) => { |
|
|
|
|
const clk = e => { |
|
|
|
|
ev(e); |
|
|
|
|
if (!this.isEnabled() || !this.isValid()) { |
|
|
|
|
return; |
|
|
|
@ -179,7 +180,7 @@ export class BasicButton extends Single {
|
|
|
|
|
trigger: "", |
|
|
|
|
// bubble的提示不需要一直存在在界面上
|
|
|
|
|
destroyWhenHide: true, |
|
|
|
|
ref: (_ref) => { |
|
|
|
|
ref: _ref => { |
|
|
|
|
this.combo = _ref; |
|
|
|
|
}, |
|
|
|
|
el: { |
|
|
|
@ -187,9 +188,9 @@ export class BasicButton extends Single {
|
|
|
|
|
height: "100%", |
|
|
|
|
}, |
|
|
|
|
popup: { |
|
|
|
|
type: "bi.text_bubble_bar_popup_view", |
|
|
|
|
type: BubblePopupView.xtype, |
|
|
|
|
text: getBubble(), |
|
|
|
|
ref: (_ref) => { |
|
|
|
|
ref: _ref => { |
|
|
|
|
popup = _ref; |
|
|
|
|
}, |
|
|
|
|
listeners: [ |
|
|
|
@ -202,7 +203,7 @@ export class BasicButton extends Single {
|
|
|
|
|
onClick.apply(this, args); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
listeners: [ |
|
|
|
@ -211,14 +212,14 @@ export class BasicButton extends Single {
|
|
|
|
|
action() { |
|
|
|
|
popup.populate(getBubble()); |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
bottom: 0, |
|
|
|
|
top: 0, |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
@ -234,7 +235,7 @@ export class BasicButton extends Single {
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const triggerArr = (o.trigger || "").split(","); |
|
|
|
|
triggerArr.forEach((trigger) => { |
|
|
|
|
triggerArr.forEach(trigger => { |
|
|
|
|
let mouseDown = false; |
|
|
|
|
let selected = false; |
|
|
|
|
let interval; |
|
|
|
@ -243,7 +244,7 @@ export class BasicButton extends Single {
|
|
|
|
|
hand.mousedown(() => { |
|
|
|
|
mouseDown = true; |
|
|
|
|
}); |
|
|
|
|
hand.mouseup((e) => { |
|
|
|
|
hand.mouseup(e => { |
|
|
|
|
if (mouseDown === true) { |
|
|
|
|
clk(e); |
|
|
|
|
} |
|
|
|
@ -253,9 +254,9 @@ export class BasicButton extends Single {
|
|
|
|
|
break; |
|
|
|
|
case "mousedown": |
|
|
|
|
// let mouseDown = false;
|
|
|
|
|
hand.mousedown((e) => { |
|
|
|
|
hand.mousedown(e => { |
|
|
|
|
// if (e.button === 0) {
|
|
|
|
|
Widget._renderEngine.createElement(document).bind(`mouseup.${this.getName()}`, (e) => { |
|
|
|
|
Widget._renderEngine.createElement(document).bind(`mouseup.${this.getName()}`, e => { |
|
|
|
|
// if (e.button === 0) {
|
|
|
|
|
if ( |
|
|
|
|
BI.DOM.isExist(this) && |
|
|
|
@ -282,7 +283,7 @@ export class BasicButton extends Single {
|
|
|
|
|
ev(e); |
|
|
|
|
// }
|
|
|
|
|
}); |
|
|
|
|
hand.mouseup((e) => { |
|
|
|
|
hand.mouseup(e => { |
|
|
|
|
// if (e.button === 0) {
|
|
|
|
|
if (BI.DOM.isExist(this) && mouseDown === true && selected === true) { |
|
|
|
|
clk(e); |
|
|
|
@ -297,7 +298,7 @@ export class BasicButton extends Single {
|
|
|
|
|
hand.dblclick(clk); |
|
|
|
|
break; |
|
|
|
|
case "lclick": |
|
|
|
|
hand.mousedown((e) => { |
|
|
|
|
hand.mousedown(e => { |
|
|
|
|
Widget._renderEngine.createElement(document).bind(`mouseup.${this.getName()}`, () => { |
|
|
|
|
interval && clearInterval(interval); |
|
|
|
|
interval = null; |
|
|
|
@ -322,7 +323,7 @@ export class BasicButton extends Single {
|
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
if (o.stopEvent || o.stopPropagation) { |
|
|
|
|
hand.mousedown((e) => { |
|
|
|
|
hand.mousedown(e => { |
|
|
|
|
ev(e); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
@ -330,7 +331,7 @@ export class BasicButton extends Single {
|
|
|
|
|
// enter键等同于点击
|
|
|
|
|
o.attributes && |
|
|
|
|
o.attributes.zIndex >= 0 && |
|
|
|
|
hand.keyup((e) => { |
|
|
|
|
hand.keyup(e => { |
|
|
|
|
if (e.keyCode === BI.KeyCode.ENTER) { |
|
|
|
|
clk(e); |
|
|
|
|
} |
|
|
|
|