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