From 8e6e978c11e170b8217c08f86bd901057302ed5c Mon Sep 17 00:00:00 2001 From: impact Date: Tue, 7 Feb 2023 15:39:54 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-14222=20fix:=20=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=BC=B9=E5=87=BAbubble?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/button/button.basic.js | 4 +-- src/case/combo/bubblecombo/popup.bubble.js | 34 ++++++---------------- src/case/combo/index.js | 2 +- 3 files changed, 12 insertions(+), 28 deletions(-) diff --git a/src/base/single/button/button.basic.js b/src/base/single/button/button.basic.js index 2457fe348..79f7632f8 100644 --- a/src/base/single/button/button.basic.js +++ b/src/base/single/button/button.basic.js @@ -23,7 +23,7 @@ import { } from "@/core"; import { BubbleCombo } from "@/case/combo/bubblecombo/combo.bubble"; import { Single } from "../0.single"; -import { BubblePopupView, BubblePopupBarView } from "@/case/combo/bubblecombo/popup.bubble"; +import { BubblePopupBarView, TextBubblePopupBarView } from "@/case/combo/bubblecombo/popup.bubble"; /** * guy @@ -199,7 +199,7 @@ export class BasicButton extends Single { height: "100%", }, popup: { - type: BubblePopupView.xtype, + type: TextBubblePopupBarView.xtype, text: getBubble(), ref: _ref => { popup = _ref; diff --git a/src/case/combo/bubblecombo/popup.bubble.js b/src/case/combo/bubblecombo/popup.bubble.js index aa94b0d29..6c1b2e012 100644 --- a/src/case/combo/bubblecombo/popup.bubble.js +++ b/src/case/combo/bubblecombo/popup.bubble.js @@ -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", diff --git a/src/case/combo/index.js b/src/case/combo/index.js index 12b79a169..7c3ac2533 100644 --- a/src/case/combo/index.js +++ b/src/case/combo/index.js @@ -1,5 +1,5 @@ export { BubbleCombo } from "./bubblecombo/combo.bubble"; -export { BubblePopupView } from "./bubblecombo/popup.bubble"; +export { BubblePopupView, BubblePopupBarView, TextBubblePopupBarView } from "./bubblecombo/popup.bubble"; export { EditorIconCheckCombo } from "./editoriconcheckcombo/combo.editiconcheck";