diff --git a/package.json b/package.json index 55f3b59f3..dbb5f3031 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220831110508", + "version": "2.0.20220831171040", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", diff --git a/src/case/combo/textvaluecombo/combo.textvalue.js b/src/case/combo/textvaluecombo/combo.textvalue.js index dc39d1b1e..b9aaac2ba 100644 --- a/src/case/combo/textvaluecombo/combo.textvalue.js +++ b/src/case/combo/textvaluecombo/combo.textvalue.js @@ -14,7 +14,8 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { value: "", defaultText: "", allowClear: false, - status: "success", // success | warning | error + status: "success", // success | warning | error, + title: null, }); }, @@ -35,6 +36,21 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { const o = this.options; + const title = () => { + if (BI.isFunction(o.title)) { + return o.title(); + } + if (this.options.status === "error") { + return { + level: "warning", + text: o.warningTitle, + }; + } + return { + level: "success", + }; + }; + const trigger = { type: "bi.select_text_trigger", ref: ref => this.trigger = ref, @@ -43,17 +59,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { height: o.height, text: o.text, value: o.value, - title: () => { - if (this.options.status === "error") { - return { - level: "warning", - text: o.warningTitle, - }; - } - return { - level: "success", - }; - }, + title, allowClear: o.allowClear, defaultText: o.defaultText, listeners: [