From f02c6fe047bbf83b733bb57da257da68c2627417 Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 13 Mar 2022 15:50:49 +0800 Subject: [PATCH] bugfix --- .../button/listitem/blankiconicontextitem.js | 28 +++++++++-------- .../button/listitem/blankicontexticonitem.js | 28 +++++++++-------- .../button/listitem/blankicontextitem.js | 30 ++++++++++--------- .../button/listitem/icontexticonitem.js | 28 +++++++++-------- .../single/button/listitem/icontextitem.js | 30 ++++++++++--------- .../single/button/listitem/texticonitem.js | 30 ++++++++++--------- .../single/button/node/icontexticonnode.js | 28 +++++++++-------- src/base/single/button/node/icontextnode.js | 30 ++++++++++--------- src/base/single/button/node/texticonnode.js | 30 ++++++++++--------- src/case/button/item.multiselect.js | 8 +++-- src/case/button/item.singleselect.icontext.js | 4 +++ src/case/button/item.singleselect.js | 7 +++-- src/case/button/item.singleselect.radio.js | 9 +++--- src/case/button/node/node.arrow.js | 5 +++- src/case/button/node/node.plus.js | 5 +++- src/case/combo/iconcombo/combo.icon.js | 8 ++++- .../icontextvaluecombo/combo.icontextvalue.js | 8 ++++- .../combo.searchtextvalue.js | 6 ++++ .../combo.textvaluecheck.js | 8 ++++- .../combo/textvaluecombo/combo.textvalue.js | 8 ++++- .../textvaluecombo/combo.textvaluesmall.js | 8 ++++- src/case/trigger/trigger.text.js | 5 ++-- 22 files changed, 211 insertions(+), 140 deletions(-) diff --git a/src/base/single/button/listitem/blankiconicontextitem.js b/src/base/single/button/listitem/blankiconicontextitem.js index 3c0fcb94b..ed8f0b6d1 100644 --- a/src/base/single/button/listitem/blankiconicontextitem.js +++ b/src/base/single/button/listitem/blankiconicontextitem.js @@ -50,19 +50,21 @@ BI.BlankIconIconTextItem = BI.inherit(BI.BasicButton, { iconWidth: o.iconWidth, iconHeight: o.iconHeight }, { - type: "bi.label", - ref: function (_ref) { - self.text = _ref; - }, - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height + el: { + type: "bi.label", + ref: function (_ref) { + self.text = _ref; + }, + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + } }] }; }, diff --git a/src/base/single/button/listitem/blankicontexticonitem.js b/src/base/single/button/listitem/blankicontexticonitem.js index 9085d997d..815589387 100644 --- a/src/base/single/button/listitem/blankicontexticonitem.js +++ b/src/base/single/button/listitem/blankicontexticonitem.js @@ -44,19 +44,21 @@ BI.BlankIconTextIconItem = BI.inherit(BI.BasicButton, { iconWidth: o.iconWidth, iconHeight: o.iconHeight }, { - type: "bi.label", - ref: function (_ref) { - self.text = _ref; - }, - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height + el: { + type: "bi.label", + ref: function (_ref) { + self.text = _ref; + }, + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + } }, { type: "bi.icon_label", cls: o.iconCls2, diff --git a/src/base/single/button/listitem/blankicontextitem.js b/src/base/single/button/listitem/blankicontextitem.js index f83e14c57..54be05c5b 100644 --- a/src/base/single/button/listitem/blankicontextitem.js +++ b/src/base/single/button/listitem/blankicontextitem.js @@ -42,20 +42,22 @@ BI.BlankIconTextItem = BI.inherit(BI.BasicButton, { iconWidth: o.iconWidth, iconHeight: o.iconHeight }, { - type: "bi.label", - ref: function (_ref) { - self.text = _ref; - }, - cls: "list-item-text", - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height + el: { + type: "bi.label", + ref: function (_ref) { + self.text = _ref; + }, + cls: "list-item-text", + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + } }] }; }, diff --git a/src/base/single/button/listitem/icontexticonitem.js b/src/base/single/button/listitem/icontexticonitem.js index 80e0d0a1c..8db8ae483 100644 --- a/src/base/single/button/listitem/icontexticonitem.js +++ b/src/base/single/button/listitem/icontexticonitem.js @@ -40,19 +40,21 @@ BI.IconTextIconItem = BI.inherit(BI.BasicButton, { iconWidth: o.iconWidth, iconHeight: o.iconHeight }, { - type: "bi.label", - ref: function (_ref) { - self.text = _ref; - }, - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height + el: { + type: "bi.label", + ref: function (_ref) { + self.text = _ref; + }, + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + } }, { type: "bi.icon_label", cls: o.iconCls2, diff --git a/src/base/single/button/listitem/icontextitem.js b/src/base/single/button/listitem/icontextitem.js index 6d3bf7199..76c19e25d 100644 --- a/src/base/single/button/listitem/icontextitem.js +++ b/src/base/single/button/listitem/icontextitem.js @@ -40,20 +40,22 @@ BI.IconTextItem = BI.inherit(BI.BasicButton, { iconWidth: o.iconWidth, iconHeight: o.iconHeight }, { - type: "bi.label", - ref: function (_ref) { - self.text = _ref; - }, - cls: "list-item-text", - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height + el: { + type: "bi.label", + ref: function (_ref) { + self.text = _ref; + }, + cls: "list-item-text", + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + } }] }; }, diff --git a/src/base/single/button/listitem/texticonitem.js b/src/base/single/button/listitem/texticonitem.js index 87d188859..92c696780 100644 --- a/src/base/single/button/listitem/texticonitem.js +++ b/src/base/single/button/listitem/texticonitem.js @@ -33,20 +33,22 @@ BI.TextIconItem = BI.inherit(BI.BasicButton, { type: "bi.vertical_adapt", columnSize: ["fill", o.iconWrapperWidth || o.height], items: [{ - type: "bi.label", - ref: function (_ref) { - self.text = _ref; - }, - cls: "list-item-text", - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height + el: { + type: "bi.label", + ref: function (_ref) { + self.text = _ref; + }, + cls: "list-item-text", + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + } }, { type: "bi.icon_label", cls: o.iconCls, diff --git a/src/base/single/button/node/icontexticonnode.js b/src/base/single/button/node/icontexticonnode.js index df2e28eb5..79bc0167f 100644 --- a/src/base/single/button/node/icontexticonnode.js +++ b/src/base/single/button/node/icontexticonnode.js @@ -38,19 +38,21 @@ BI.IconTextIconNode = BI.inherit(BI.NodeButton, { iconWidth: o.iconWidth, iconHeight: o.iconHeight }, { - type: "bi.label", - ref: function (_ref) { - self.text = _ref; - }, - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height + el: { + type: "bi.label", + ref: function (_ref) { + self.text = _ref; + }, + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + } }, { type: "bi.icon_label", cls: o.iconCls2, diff --git a/src/base/single/button/node/icontextnode.js b/src/base/single/button/node/icontextnode.js index 653888a4a..00f1adf86 100644 --- a/src/base/single/button/node/icontextnode.js +++ b/src/base/single/button/node/icontextnode.js @@ -37,20 +37,22 @@ BI.IconTextNode = BI.inherit(BI.NodeButton, { iconWidth: o.iconWidth, iconHeight: o.iconHeight }, { - type: "bi.label", - ref: function (_ref) { - self.text = _ref; - }, - cls: "list-item-text", - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height + el: { + type: "bi.label", + ref: function (_ref) { + self.text = _ref; + }, + cls: "list-item-text", + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + } }] }; }, diff --git a/src/base/single/button/node/texticonnode.js b/src/base/single/button/node/texticonnode.js index 71217b746..67844bddc 100644 --- a/src/base/single/button/node/texticonnode.js +++ b/src/base/single/button/node/texticonnode.js @@ -29,20 +29,22 @@ BI.TextIconNode = BI.inherit(BI.NodeButton, { type: "bi.vertical_adapt", columnSize: ["fill", o.iconWrapperWidth || o.height], items: [{ - type: "bi.label", - ref: function (_ref) { - self.text = _ref; - }, - cls: "list-item-text", - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height + el: { + type: "bi.label", + ref: function (_ref) { + self.text = _ref; + }, + cls: "list-item-text", + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + } }, { type: "bi.icon_label", cls: o.iconCls, diff --git a/src/case/button/item.multiselect.js b/src/case/button/item.multiselect.js index 648036f61..83071a763 100644 --- a/src/case/button/item.multiselect.js +++ b/src/case/button/item.multiselect.js @@ -17,7 +17,8 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, { iconWrapperWidth: 26, textHgap: 0, textLgap: 0, - textRgap: 0 + textRgap: 0, + textVgap: 0, }); }, @@ -48,9 +49,10 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, { whiteSpace: "nowrap", textHeight: o.height, height: o.height, - hgap: o.hgap, - rgap: o.rgap, + hgap: o.textHgap, + rgap: o.textRgap, lgap: o.textLgap, + vgap: o.textVgap, text: o.text, keyword: o.keyword, value: o.value, diff --git a/src/case/button/item.singleselect.icontext.js b/src/case/button/item.singleselect.icontext.js index a84170cb4..de00e362a 100644 --- a/src/case/button/item.singleselect.icontext.js +++ b/src/case/button/item.singleselect.icontext.js @@ -28,6 +28,10 @@ BI.SingleSelectIconTextItem = BI.inherit(BI.Single, { height: o.height, iconHeight: o.iconHeight, iconWidth: o.iconWidth, + textHgap: o.textHgap, + textVgap: o.textVgap, + textLgap: o.textLgap, + textRgap: o.textRgap, text: o.text, keyword: o.keyword, value: o.value, diff --git a/src/case/button/item.singleselect.js b/src/case/button/item.singleselect.js index 56d7ac6a4..791c66383 100644 --- a/src/case/button/item.singleselect.js +++ b/src/case/button/item.singleselect.js @@ -5,7 +5,7 @@ BI.SingleSelectItem = BI.inherit(BI.BasicButton, { attributes: { tabIndex: 1 }, - hgap: 10, + textHgap: 10, height: 24, textAlign: "left" }); @@ -20,7 +20,10 @@ BI.SingleSelectItem = BI.inherit(BI.BasicButton, { whiteSpace: "nowrap", textHeight: o.height, height: o.height, - hgap: o.hgap, + hgap: o.hgap || o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, text: o.text, keyword: o.keyword, value: o.value, diff --git a/src/case/button/item.singleselect.radio.js b/src/case/button/item.singleselect.radio.js index 911dd56e0..910ec253e 100644 --- a/src/case/button/item.singleselect.radio.js +++ b/src/case/button/item.singleselect.radio.js @@ -15,8 +15,8 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, { }, height: 24, iconWrapperWidth: 16, - hgap: 10, - textHgap: 0, + textHgap: 10, + textVgap: 0, textLgap: 0, textRgap: 0 }); @@ -46,9 +46,10 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, { whiteSpace: "nowrap", textHeight: o.height, height: o.height, - hgap: o.hgap, - rgap: o.textRgap, + hgap: o.hgap || o.textHgap, + vgap: o.textVgap, lgap: o.textLgap, + rgap: o.textRgap, text: o.text, keyword: o.keyword, value: o.value, diff --git a/src/case/button/node/node.arrow.js b/src/case/button/node/node.arrow.js index 259ea3158..6fc690d7b 100644 --- a/src/case/button/node/node.arrow.js +++ b/src/case/button/node/node.arrow.js @@ -41,7 +41,10 @@ BI.ArrowNode = BI.inherit(BI.NodeButton, { whiteSpace: "nowrap", textHeight: o.height, height: o.height, - hgap: o.hgap, + hgap: o.hgap || o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, text: o.text, value: o.value, py: o.py, diff --git a/src/case/button/node/node.plus.js b/src/case/button/node/node.plus.js index d5de8817b..ec38ca0e0 100644 --- a/src/case/button/node/node.plus.js +++ b/src/case/button/node/node.plus.js @@ -46,7 +46,10 @@ BI.PlusGroupNode = BI.inherit(BI.NodeButton, { whiteSpace: "nowrap", textHeight: o.height, height: o.height, - hgap: o.hgap, + hgap: o.hgap || o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, text: o.text, value: o.value, keyword: o.keyword, diff --git a/src/case/combo/iconcombo/combo.icon.js b/src/case/combo/iconcombo/combo.icon.js index 409e1a003..81050859a 100644 --- a/src/case/combo/iconcombo/combo.icon.js +++ b/src/case/combo/iconcombo/combo.icon.js @@ -25,8 +25,14 @@ BI.IconCombo = BI.inherit(BI.Widget, { }, _init: function () { - BI.IconCombo.superclass._init.apply(this, arguments); var self = this, o = this.options; + o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) { + self.setValue(newValue); + }) : o.value; + o.items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) { + self.populate(newValue); + }) : o.items; + BI.IconCombo.superclass._init.apply(this, arguments); this.trigger = BI.createWidget(o.el, { type: "bi.icon_combo_trigger", iconCls: o.iconCls, diff --git a/src/case/combo/icontextvaluecombo/combo.icontextvalue.js b/src/case/combo/icontextvaluecombo/combo.icontextvalue.js index 35758a089..92732d9b1 100644 --- a/src/case/combo/icontextvaluecombo/combo.icontextvalue.js +++ b/src/case/combo/icontextvaluecombo/combo.icontextvalue.js @@ -15,8 +15,14 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, { _init: function () { var self = this, o = this.options; - o.height -= 2; BI.isNumeric(o.width) && (o.width -= 2); + BI.isNumeric(o.height) && (o.height -= 2); + o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) { + self.setValue(newValue); + }) : o.value; + o.items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) { + self.populate(newValue); + }) : o.items; BI.IconTextValueCombo.superclass._init.apply(this, arguments); this.trigger = BI.createWidget({ type: "bi.select_icon_text_trigger", diff --git a/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js b/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js index e86bec863..ac3fad335 100644 --- a/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js +++ b/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js @@ -15,6 +15,12 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, { render: function () { var self = this, o = this.options; + o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) { + self.setValue(newValue); + }) : o.value; + o.items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) { + self.populate(newValue); + }) : o.items; return { type: "bi.absolute", items: [{ diff --git a/src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js b/src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js index 891481a8a..1b9b9a0ce 100644 --- a/src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js +++ b/src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js @@ -16,8 +16,14 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, { _init: function () { var self = this, o = this.options; - o.height -= 2; BI.isNumeric(o.width) && (o.width -= 2); + BI.isNumeric(o.height) && (o.height -= 2); + o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) { + self.setValue(newValue); + }) : o.value; + o.items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) { + self.populate(newValue); + }) : o.items; BI.TextValueCheckCombo.superclass._init.apply(this, arguments); this.trigger = BI.createWidget({ type: "bi.select_text_trigger", diff --git a/src/case/combo/textvaluecombo/combo.textvalue.js b/src/case/combo/textvaluecombo/combo.textvalue.js index 7dc38d9fe..6b9ef321b 100644 --- a/src/case/combo/textvaluecombo/combo.textvalue.js +++ b/src/case/combo/textvaluecombo/combo.textvalue.js @@ -17,8 +17,14 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { _init: function () { var self = this, o = this.options; - o.height -= 2; BI.isNumeric(o.width) && (o.width -= 2); + BI.isNumeric(o.height) && (o.height -= 2); + o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) { + self.setValue(newValue); + }) : o.value; + o.items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) { + self.populate(newValue); + }) : o.items; BI.TextValueCombo.superclass._init.apply(this, arguments); this.trigger = BI.createWidget({ type: "bi.select_text_trigger", diff --git a/src/case/combo/textvaluecombo/combo.textvaluesmall.js b/src/case/combo/textvaluecombo/combo.textvaluesmall.js index 70e551737..b6609544b 100644 --- a/src/case/combo/textvaluecombo/combo.textvaluesmall.js +++ b/src/case/combo/textvaluecombo/combo.textvaluesmall.js @@ -16,8 +16,14 @@ BI.SmallTextValueCombo = BI.inherit(BI.Widget, { }, _init: function () { - BI.SmallTextValueCombo.superclass._init.apply(this, arguments); var self = this, o = this.options; + o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) { + self.setValue(newValue); + }) : o.value; + o.items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) { + self.populate(newValue); + }) : o.items; + BI.SmallTextValueCombo.superclass._init.apply(this, arguments); this.trigger = BI.createWidget(o.el, { type: "bi.small_select_text_trigger", items: o.items, diff --git a/src/case/trigger/trigger.text.js b/src/case/trigger/trigger.text.js index eb9c7c937..f5481222c 100644 --- a/src/case/trigger/trigger.text.js +++ b/src/case/trigger/trigger.text.js @@ -44,10 +44,11 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { BI.createWidget({ element: this, - type: "bi.htape", + type: "bi.horizontal_fill", items: [ { - el: this.text + el: this.text, + width: "fill" }, { el: this.trigerButton, width: o.triggerWidth || o.height