|
|
|
@ -1,40 +1,24 @@
|
|
|
|
|
import { shortcut, extend, i18nText, each, isWidget, createWidget } from "@/core"; |
|
|
|
|
import { PopupView } from "@/base/layer/layer.popup"; |
|
|
|
|
import { Button } from "@/base"; |
|
|
|
|
import { Label } from "@/base/single/label/label"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@shortcut() |
|
|
|
|
export class BubblePopupView extends PopupView { |
|
|
|
|
static xtype = "bi.bubble_popup_view"; |
|
|
|
|
|
|
|
|
|
static EVENT_CLICK_TOOLBAR_BUTTON = "EVENT_CLICK_TOOLBAR_BUTTON"; |
|
|
|
|
static EVENT_CHANGE = "EVENT_CLICK_TOOLBAR_BUTTON"; |
|
|
|
|
|
|
|
|
|
_defaultConfig() { |
|
|
|
|
const config = super._defaultConfig(...arguments); |
|
|
|
|
|
|
|
|
|
return extend(config, { |
|
|
|
|
baseCls: `${config.baseCls} bi-text-bubble-bar-popup-view`, |
|
|
|
|
text: "", |
|
|
|
|
baseCls: `${config.baseCls} bi-bubble-popup-view`, |
|
|
|
|
minWidth: 70, |
|
|
|
|
maxWidth: 300, |
|
|
|
|
// minHeight: 50,
|
|
|
|
|
showArrow: true, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_createContent() { |
|
|
|
|
const o = this.options; |
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
type: Label.xtype, |
|
|
|
|
text: o.text, |
|
|
|
|
whiteSpace: "normal", |
|
|
|
|
textAlign: "left", |
|
|
|
|
ref: _ref => { |
|
|
|
|
this.text = _ref; |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
populate(v) { |
|
|
|
|
this.text.setText(v || this.options.text); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@shortcut() |
|
|
|
@ -72,7 +56,7 @@ export class BubblePopupBarView extends BubblePopupView {
|
|
|
|
|
} else { |
|
|
|
|
items.push({ |
|
|
|
|
el: extend({ |
|
|
|
|
type: "bi.button", |
|
|
|
|
type: Button.xtype, |
|
|
|
|
height: 24, |
|
|
|
|
handler: v => { |
|
|
|
|
this.fireEvent(BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON, v); |
|
|
|
@ -131,7 +115,7 @@ export class TextBubblePopupBarView extends BubblePopupBarView {
|
|
|
|
|
const o = this.options; |
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
type: "bi.label", |
|
|
|
|
type: Label.xtype, |
|
|
|
|
text: o.text, |
|
|
|
|
whiteSpace: "normal", |
|
|
|
|
textAlign: "left", |
|
|
|
|