diff --git a/src/case/colorchooser/colorchooser.js b/src/case/colorchooser/colorchooser.js index 95db2b7f8..bed892c7d 100644 --- a/src/case/colorchooser/colorchooser.js +++ b/src/case/colorchooser/colorchooser.js @@ -9,7 +9,7 @@ BI.ColorChooser = BI.inherit(BI.Widget, { _defaultConfig: function () { return BI.extend(BI.ColorChooser.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-color-chooser bi-border bi-focus-shadow", + baseCls: "bi-color-chooser bi-border", value: "", height: 24, el: {}, @@ -19,6 +19,7 @@ BI.ColorChooser = BI.inherit(BI.Widget, { _init: function () { var self = this, o = this.options; o.height -= 2; + BI.isNumeric(o.width) && (o.width -= 2); BI.ColorChooser.superclass._init.apply(this, arguments); o.value = o.value || ""; this.combo = BI.createWidget({ diff --git a/src/case/combo/icontextvaluecombo/combo.icontextvalue.js b/src/case/combo/icontextvaluecombo/combo.icontextvalue.js index 6ff16b119..d114dddee 100644 --- a/src/case/combo/icontextvaluecombo/combo.icontextvalue.js +++ b/src/case/combo/icontextvaluecombo/combo.icontextvalue.js @@ -5,7 +5,7 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, { _defaultConfig: function () { return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-icon-text-value-combo bi-border bi-focus-shadow bi-border-radius", + baseCls: "bi-icon-text-value-combo bi-border bi-border-radius", height: 24, iconHeight: null, iconWidth: null, @@ -16,6 +16,7 @@ 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.IconTextValueCombo.superclass._init.apply(this, arguments); this.trigger = BI.createWidget({ type: "bi.select_icon_text_trigger", diff --git a/src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js b/src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js index 46c3d65ed..996e7adf6 100644 --- a/src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js +++ b/src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js @@ -6,7 +6,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, { _defaultConfig: function () { return BI.extend(BI.TextValueCheckCombo.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-text-value-check-combo bi-border bi-focus-shadow", + baseCls: "bi-text-value-check-combo bi-border", width: 100, height: 24, chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, @@ -17,6 +17,7 @@ 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.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 c5515c496..b0ff081b7 100644 --- a/src/case/combo/textvaluecombo/combo.textvalue.js +++ b/src/case/combo/textvaluecombo/combo.textvalue.js @@ -7,7 +7,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { _defaultConfig: function () { return BI.extend(BI.TextValueCombo.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-text-value-combo bi-border bi-focus-shadow", + baseCls: "bi-text-value-combo bi-border", height: 24, chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, text: "", @@ -18,6 +18,7 @@ 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.TextValueCombo.superclass._init.apply(this, arguments); this.trigger = BI.createWidget({ type: "bi.select_text_trigger", diff --git a/src/widget/multilayerselecttree/multilayerselecttree.combo.js b/src/widget/multilayerselecttree/multilayerselecttree.combo.js index ce7cbfe3d..e72d71009 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.combo.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.combo.js @@ -6,7 +6,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { _defaultConfig: function () { return BI.extend(BI.MultiLayerSelectTreeCombo.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-multilayer-select-tree-combo bi-border bi-focus-shadow bi-border-radius", + baseCls: "bi-multilayer-select-tree-combo", isDefaultInit: false, height: 24, text: "", @@ -21,7 +21,11 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { }, _init: function () { - this.options.height -= 2; + var o = this.options; + if (this._shouldWrapper()) { + o.height -= 2; + BI.isNumeric(o.width) && (o.width -= 2); + } BI.MultiLayerSelectTreeCombo.superclass._init.apply(this, arguments); }, @@ -30,7 +34,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { var combo = (o.itemsCreator === BI.emptyFn) ? this._getSyncConfig() : this._getAsyncConfig(); - return (!o.allowEdit && o.itemsCreator === BI.emptyFn) ? combo : { + return this._shouldWrapper() ? combo : { type: "bi.absolute", items: [{ el: combo, @@ -62,10 +66,16 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { }; }, + _shouldWrapper: function () { + var o = this.options; + return !o.allowEdit && o.itemsCreator === BI.emptyFn; + }, + _getBaseConfig: function () { var self = this, o = this.options; return { type: "bi.combo", + cls: "bi-border bi-focus-shadow bi-border-radius", container: o.container, destroyWhenHide: o.destroyWhenHide, adjustLength: 2, diff --git a/src/widget/multilayerselecttree/multilayerselecttree.trigger.js b/src/widget/multilayerselecttree/multilayerselecttree.trigger.js index a1716d000..7203378ba 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.trigger.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.trigger.js @@ -5,7 +5,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { props: function() { return { - extraCls: "bi-multi-layer-select-tree-trigger bi-border bi-focus-shadow bi-border-radius", + extraCls: "bi-multi-layer-select-tree-trigger", height: 24, itemsCreator: BI.emptyFn, watermark: BI.i18nText("BI-Basic_Search"), diff --git a/src/widget/multilayersingletree/multilayersingletree.combo.js b/src/widget/multilayersingletree/multilayersingletree.combo.js index b02e33198..702ffcccf 100644 --- a/src/widget/multilayersingletree/multilayersingletree.combo.js +++ b/src/widget/multilayersingletree/multilayersingletree.combo.js @@ -9,7 +9,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { _defaultConfig: function () { return BI.extend(BI.MultiLayerSingleTreeCombo.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-multilayer-single-tree-combo bi-border bi-focus-shadow bi-border-radius", + baseCls: "bi-multilayer-single-tree-combo", isDefaultInit: false, height: 24, text: "", @@ -24,7 +24,11 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { }, _init: function () { - this.options.height -= 2; + var o = this.options; + if (this._shouldWrapper()) { + o.height -= 2; + BI.isNumeric(o.width) && (o.width -= 2); + } BI.MultiLayerSingleTreeCombo.superclass._init.apply(this, arguments); }, @@ -33,7 +37,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { var combo = (o.itemsCreator === BI.emptyFn) ? this._getSyncConfig() : this._getAsyncConfig(); - return (!o.allowEdit && o.itemsCreator === BI.emptyFn) ? combo : { + return this._shouldWrapper() ? combo : { type: "bi.absolute", height: o.height - 2, items: [{ @@ -66,10 +70,16 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { }; }, + _shouldWrapper: function () { + var o = this.options; + return !o.allowEdit && o.itemsCreator === BI.emptyFn; + }, + _getBaseConfig: function () { var self = this, o = this.options; return { type: "bi.combo", + cls: "bi-border bi-focus-shadow bi-border-radius", container: o.container, destroyWhenHide: o.destroyWhenHide, adjustLength: 2, diff --git a/src/widget/multilayersingletree/multilayersingletree.trigger.js b/src/widget/multilayersingletree/multilayersingletree.trigger.js index 376b29af3..20e47af0d 100644 --- a/src/widget/multilayersingletree/multilayersingletree.trigger.js +++ b/src/widget/multilayersingletree/multilayersingletree.trigger.js @@ -5,7 +5,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { props: function() { return { - extraCls: "bi-multi-layer-single-tree-trigger bi-border bi-focus-shadow bi-border-radius", + extraCls: "bi-multi-layer-single-tree-trigger", height: 24, itemsCreator: BI.emptyFn, watermark: BI.i18nText("BI-Basic_Search"), diff --git a/src/widget/multiselect/multiselect.combo.js b/src/widget/multiselect/multiselect.combo.js index 72774a277..520e73eb9 100644 --- a/src/widget/multiselect/multiselect.combo.js +++ b/src/widget/multiselect/multiselect.combo.js @@ -18,7 +18,6 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, { _init: function () { var self = this, o = this.options; - o.height -= 2; BI.MultiSelectCombo.superclass._init.apply(this, arguments); var assertShowValue = function () { if (BI.isKey(self._startValue)) { diff --git a/src/widget/multiselect/multiselect.combo.nobar.js b/src/widget/multiselect/multiselect.combo.nobar.js index 559d07734..61196094e 100644 --- a/src/widget/multiselect/multiselect.combo.nobar.js +++ b/src/widget/multiselect/multiselect.combo.nobar.js @@ -17,7 +17,6 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, { _init: function () { var self = this, o = this.options; - o.height -= 2; BI.MultiSelectNoBarCombo.superclass._init.apply(this, arguments); var assertShowValue = function () { if (BI.isKey(self._startValue)) { diff --git a/src/widget/multiselect/multiselect.insert.combo.js b/src/widget/multiselect/multiselect.insert.combo.js index 598610100..2adc15345 100644 --- a/src/widget/multiselect/multiselect.insert.combo.js +++ b/src/widget/multiselect/multiselect.insert.combo.js @@ -18,7 +18,6 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, { _init: function () { var self = this, o = this.options; - o.height -= 2; BI.MultiSelectInsertCombo.superclass._init.apply(this, arguments); var assertShowValue = function () { if (BI.isKey(self._startValue)) { diff --git a/src/widget/multiselect/multiselect.insert.combo.nobar.js b/src/widget/multiselect/multiselect.insert.combo.nobar.js index aefe50ef0..cf693765f 100644 --- a/src/widget/multiselect/multiselect.insert.combo.nobar.js +++ b/src/widget/multiselect/multiselect.insert.combo.nobar.js @@ -17,7 +17,6 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, { _init: function () { var self = this, o = this.options; - o.height -= 2; BI.MultiSelectInsertNoBarCombo.superclass._init.apply(this, arguments); var assertShowValue = function () { if (BI.isKey(self._startValue)) { diff --git a/src/widget/multitree/multi.tree.combo.js b/src/widget/multitree/multi.tree.combo.js index 5ac0b03a6..f8a015cad 100644 --- a/src/widget/multitree/multi.tree.combo.js +++ b/src/widget/multitree/multi.tree.combo.js @@ -28,7 +28,6 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { _init: function () { var self = this, o = this.options; - o.height -= 2; BI.MultiTreeCombo.superclass._init.apply(this, arguments); var isInit = false; var want2showCounter = false; diff --git a/src/widget/multitree/multi.tree.insert.combo.js b/src/widget/multitree/multi.tree.insert.combo.js index cfaece933..fa1bf4ce6 100644 --- a/src/widget/multitree/multi.tree.insert.combo.js +++ b/src/widget/multitree/multi.tree.insert.combo.js @@ -28,7 +28,6 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { _init: function () { var self = this, o = this.options; - o.height -= 2; BI.MultiTreeInsertCombo.superclass._init.apply(this, arguments); var isInit = false; var want2showCounter = false; diff --git a/src/widget/multitree/multi.tree.list.combo.js b/src/widget/multitree/multi.tree.list.combo.js index 45842cfda..401cb7be7 100644 --- a/src/widget/multitree/multi.tree.list.combo.js +++ b/src/widget/multitree/multi.tree.list.combo.js @@ -29,7 +29,6 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { _init: function () { var self = this, o = this.options; - o.height -= 2; BI.MultiTreeListCombo.superclass._init.apply(this, arguments); var isInit = false; var want2showCounter = false; diff --git a/src/widget/searchmultitextvaluecombo/multitextvalue.combo.search.js b/src/widget/searchmultitextvaluecombo/multitextvalue.combo.search.js index 4410a2132..66cc26fce 100644 --- a/src/widget/searchmultitextvaluecombo/multitextvalue.combo.search.js +++ b/src/widget/searchmultitextvaluecombo/multitextvalue.combo.search.js @@ -15,7 +15,6 @@ BI.SearchMultiTextValueCombo = BI.inherit(BI.Single, { _init: function () { var self = this, o = this.options; - o.height -= 2; BI.SearchMultiTextValueCombo.superclass._init.apply(this, arguments); var assertShowValue = function () { BI.isKey(self._startValue) && (self.storeValue.type === BI.Selection.All ? BI.remove(self.storeValue.value, self._startValue) : BI.pushDistinct(self.storeValue.value, self._startValue)); diff --git a/src/widget/selecttree/selecttree.combo.js b/src/widget/selecttree/selecttree.combo.js index d5e30c98e..98c542686 100644 --- a/src/widget/selecttree/selecttree.combo.js +++ b/src/widget/selecttree/selecttree.combo.js @@ -6,7 +6,7 @@ BI.SelectTreeCombo = BI.inherit(BI.Widget, { _defaultConfig: function () { return BI.extend(BI.SelectTreeCombo.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-select-tree-combo bi-border bi-focus-shadow bi-border-radius", + baseCls: "bi-select-tree-combo bi-border bi-border-radius", height: 24, text: "", items: [], @@ -17,6 +17,7 @@ BI.SelectTreeCombo = BI.inherit(BI.Widget, { _init: function () { var self = this, o = this.options; o.height -= 2; + BI.isNumeric(o.width) && (o.width -= 2); BI.SelectTreeCombo.superclass._init.apply(this, arguments); this.trigger = BI.createWidget({ diff --git a/src/widget/singleselect/singleselect.combo.js b/src/widget/singleselect/singleselect.combo.js index 749569b0e..f965bb507 100644 --- a/src/widget/singleselect/singleselect.combo.js +++ b/src/widget/singleselect/singleselect.combo.js @@ -18,7 +18,6 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { _init: function () { var self = this, o = this.options; - o.height -= 2; BI.SingleSelectCombo.superclass._init.apply(this, arguments); var assertShowValue = function () { diff --git a/src/widget/singleselect/singleselect.insert.combo.js b/src/widget/singleselect/singleselect.insert.combo.js index 9a2ce8833..819859d10 100644 --- a/src/widget/singleselect/singleselect.insert.combo.js +++ b/src/widget/singleselect/singleselect.insert.combo.js @@ -18,7 +18,6 @@ BI.SingleSelectInsertCombo = BI.inherit(BI.Single, { _init: function () { var self = this, o = this.options; - o.height -= 2; BI.SingleSelectInsertCombo.superclass._init.apply(this, arguments); var assertShowValue = function () { BI.isKey(self._startValue) && (self.storeValue = self._startValue); diff --git a/src/widget/singletree/singletree.combo.js b/src/widget/singletree/singletree.combo.js index 858fd3f70..e3d884ce4 100644 --- a/src/widget/singletree/singletree.combo.js +++ b/src/widget/singletree/singletree.combo.js @@ -6,7 +6,7 @@ BI.SingleTreeCombo = BI.inherit(BI.Widget, { _defaultConfig: function () { return BI.extend(BI.SingleTreeCombo.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-single-tree-combo bi-border bi-focus-shadow bi-border-radius", + baseCls: "bi-single-tree-combo bi-border bi-border-radius", trigger: {}, height: 24, text: "", @@ -18,6 +18,7 @@ BI.SingleTreeCombo = BI.inherit(BI.Widget, { _init: function () { var self = this, o = this.options; o.height -= 2; + BI.isNumeric(o.width) && (o.width -= 2); BI.SingleTreeCombo.superclass._init.apply(this, arguments); this.trigger = BI.createWidget(BI.extend({ diff --git a/src/widget/textvaluedownlistcombo/combo.textvaluedownlist.js b/src/widget/textvaluedownlistcombo/combo.textvaluedownlist.js index 67720c572..9479c68fe 100644 --- a/src/widget/textvaluedownlistcombo/combo.textvaluedownlist.js +++ b/src/widget/textvaluedownlistcombo/combo.textvaluedownlist.js @@ -5,7 +5,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { _defaultConfig: function () { return BI.extend(BI.TextValueDownListCombo.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-text-value-down-list-combo bi-border bi-focus-shadow", + baseCls: "bi-text-value-down-list-combo bi-border", height: 24, }); }, @@ -13,6 +13,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { _init: function () { var self = this, o = this.options; o.height -= 2; + BI.isNumeric(o.width) && (o.width -= 2); BI.TextValueDownListCombo.superclass._init.apply(this, arguments); this._createValueMap(); diff --git a/src/widget/time/time.combo.js b/src/widget/time/time.combo.js index f79675f27..24ad058e0 100644 --- a/src/widget/time/time.combo.js +++ b/src/widget/time/time.combo.js @@ -21,7 +21,6 @@ _init: function () { var o = this.options; - o.height -= 2; BI.TimeCombo.superclass._init.apply(this, arguments); }, @@ -176,8 +175,8 @@ el: { type: "bi.icon_button", cls: "bi-trigger-icon-button time-font icon-size-16", - width: 22, - height: 22, + width: opts.height, + height: opts.height, listeners: [{ eventName: BI.IconButton.EVENT_CHANGE, action: function () { diff --git a/src/widget/year/combo.year.js b/src/widget/year/combo.year.js index 7de86c820..6ae10c477 100644 --- a/src/widget/year/combo.year.js +++ b/src/widget/year/combo.year.js @@ -12,6 +12,7 @@ BI.DynamicYearCombo = BI.inherit(BI.Widget, { _init: function () { var self = this, o = this.options; o.height -= 2; + BI.isNumeric(o.width) && (o.width -= 2); BI.DynamicYearCombo.superclass._init.apply(this, arguments); this.storeValue = o.value; this.trigger = BI.createWidget({ diff --git a/src/widget/yearmonth/combo.yearmonth.js b/src/widget/yearmonth/combo.yearmonth.js index 7f2c30a58..3bb38968f 100644 --- a/src/widget/yearmonth/combo.yearmonth.js +++ b/src/widget/yearmonth/combo.yearmonth.js @@ -12,6 +12,7 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { _init: function () { var self = this, o = this.options; o.height -= 2; + BI.isNumeric(o.width) && (o.width -= 2); BI.DynamicYearMonthCombo.superclass._init.apply(this, arguments); this.storeValue = o.value; this.storeTriggerValue = ""; diff --git a/src/widget/yearquarter/combo.yearquarter.js b/src/widget/yearquarter/combo.yearquarter.js index 28b0832d0..6812ec99c 100644 --- a/src/widget/yearquarter/combo.yearquarter.js +++ b/src/widget/yearquarter/combo.yearquarter.js @@ -12,6 +12,7 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, { _init: function () { var self = this, o = this.options; o.height -= 2; + BI.isNumeric(o.width) && (o.width -= 2); BI.DynamicYearQuarterCombo.superclass._init.apply(this, arguments); this.storeValue = o.value; self.storeTriggerValue = "";