diff --git a/src/widget/datetime/datetime.combo.js b/src/widget/datetime/datetime.combo.js index 81224c021..d436da1a8 100644 --- a/src/widget/datetime/datetime.combo.js +++ b/src/widget/datetime/datetime.combo.js @@ -6,7 +6,8 @@ BI.DateTimeCombo = BI.inherit(BI.Single, { popupHeight: 290, popupWidth: 270, comboAdjustHeight: 1, - border: 1 + border: 1, + iconWidth: 24 }, _defaultConfig: function () { return BI.extend(BI.DateTimeCombo.superclass._defaultConfig.apply(this, arguments), { @@ -83,7 +84,7 @@ BI.DateTimeCombo = BI.inherit(BI.Single, { var triggerBtn = BI.createWidget({ type: "bi.icon_button", cls: "bi-trigger-icon-button date-font", - width: opts.height, + width: this.constants.iconWidth, height: opts.height, }); triggerBtn.on(BI.IconButton.EVENT_CHANGE, function () { @@ -96,21 +97,9 @@ BI.DateTimeCombo = BI.inherit(BI.Single, { BI.createWidget({ type: "bi.htape", + columnSize: ["", this.constants.iconWidth], element: this, - items: [{ - type: "bi.absolute", - items: [{ - el: this.combo, - top: 0, - left: 0, - right: 0, - bottom: 0 - }, { - el: triggerBtn, - top: 0, - right: 0 - }] - }] + items: [this.combo, triggerBtn] }); }, diff --git a/src/widget/datetime/datetime.trigger.js b/src/widget/datetime/datetime.trigger.js index ea0d047cb..d161585e6 100644 --- a/src/widget/datetime/datetime.trigger.js +++ b/src/widget/datetime/datetime.trigger.js @@ -3,7 +3,8 @@ */ BI.DateTimeTrigger = BI.inherit(BI.Trigger, { _const: { - hgap: 4 + hgap: 4, + iconWidth:24 }, _defaultConfig: function () { @@ -33,7 +34,7 @@ BI.DateTimeTrigger = BI.inherit(BI.Trigger, { el: this.text },{ el: BI.createWidget(), - width: o.height + width: this._const.iconWidth }] }); this.setValue(o.value); diff --git a/src/widget/dynamicdate/dynamicdate.combo.js b/src/widget/dynamicdate/dynamicdate.combo.js index 997211275..185e1ca35 100644 --- a/src/widget/dynamicdate/dynamicdate.combo.js +++ b/src/widget/dynamicdate/dynamicdate.combo.js @@ -3,7 +3,8 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, { popupHeight: 259, popupWidth: 270, comboAdjustHeight: 1, - border: 1 + border: 1, + iconWidth: 24 }, props: { @@ -48,7 +49,7 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, { destroyWhenHide: true, el: { type: "bi.horizontal_fill", - columnSize: [opts.height - border, "fill"], + columnSize: [this.constants.iconWidth, "fill"], height: opts.height - border, items: [{ el: { diff --git a/src/widget/dynamicdate/dynamicdate.trigger.js b/src/widget/dynamicdate/dynamicdate.trigger.js index 48e8a4601..1412fae69 100644 --- a/src/widget/dynamicdate/dynamicdate.trigger.js +++ b/src/widget/dynamicdate/dynamicdate.trigger.js @@ -5,7 +5,8 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, { yearLength: 4, yearMonthLength: 6, yearFullMonthLength: 7, - compareFormat: "%Y-%X-%d" + compareFormat: "%Y-%X-%d", + iconWidth: 24 }, props: { @@ -120,15 +121,16 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, { BI.createWidget({ type: "bi.htape", element: this, + columnSize: ["", this._const.iconWidth], items: [{ el: this.editor }, { el: { type: "bi.icon_button", cls: "bi-trigger-icon-button date-font", - width: o.iconWidth + width: this._const.iconWidth }, - width: o.iconWidth + width: this._const.iconWidth }] }); !o.allowEdit && BI.createWidget({ diff --git a/src/widget/dynamicdatetime/dynamicdatetime.combo.js b/src/widget/dynamicdatetime/dynamicdatetime.combo.js index 37655791d..1b8a58243 100644 --- a/src/widget/dynamicdatetime/dynamicdatetime.combo.js +++ b/src/widget/dynamicdatetime/dynamicdatetime.combo.js @@ -3,7 +3,8 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, { popupHeight: 259, popupWidth: 270, comboAdjustHeight: 1, - border: 1 + border: 1, + iconWidth: 24 }, props: { @@ -48,13 +49,13 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, { isNeedAdjustWidth: opts.isNeedAdjustWidth, el: { type: "bi.horizontal_fill", - columnSize: [opts.height - border, "fill"], + columnSize: [this.constants.iconWidth, "fill"], height: opts.height - border, items: [{ el: { type: "bi.icon_button", cls: "bi-trigger-icon-button date-change-h-font", - width: opts.height - border, + width: this.constants.iconWidth, height: opts.height - border, ref: function () { self.changeIcon = this; @@ -68,7 +69,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, { allowEdit: opts.allowEdit, watermark: opts.watermark, format: opts.format, - iconWidth: opts.height - border, + iconWidth: this.constants.iconWidth, height: opts.height - border, value: opts.value, ref: function () { diff --git a/src/widget/dynamicdatetime/dynamicdatetime.trigger.js b/src/widget/dynamicdatetime/dynamicdatetime.trigger.js index e58cd99f5..dd5c7ed6f 100644 --- a/src/widget/dynamicdatetime/dynamicdatetime.trigger.js +++ b/src/widget/dynamicdatetime/dynamicdatetime.trigger.js @@ -5,7 +5,8 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, { yearLength: 4, yearMonthLength: 6, yearFullMonthLength: 7, - compareFormat: "%Y-%X-%d %H:%M:%S" + compareFormat: "%Y-%X-%d %H:%M:%S", + iconWidth: 24 }, props: { @@ -118,6 +119,7 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, { BI.createWidget({ type: "bi.htape", element: this, + columnSize: ["", this._const.iconWidth], items: [{ el: this.editor }, { diff --git a/src/widget/time/time.combo.js b/src/widget/time/time.combo.js index d69443bc7..30c40e0ab 100644 --- a/src/widget/time/time.combo.js +++ b/src/widget/time/time.combo.js @@ -10,7 +10,8 @@ popupHeight: 80, popupWidth: 240, comboAdjustHeight: 1, - border: 1 + border: 1, + iconWidth: 24 }, props: { baseCls: "bi-time-combo", @@ -177,7 +178,7 @@ el: { type: "bi.icon_button", cls: "bi-trigger-icon-button time-font icon-size-16", - width: opts.height, + width: this.constants.iconWidth, height: opts.height, listeners: [{ eventName: BI.IconButton.EVENT_CHANGE, diff --git a/src/widget/timeinterval/timeperiods.js b/src/widget/timeinterval/timeperiods.js index dbc73333e..45c5a970f 100644 --- a/src/widget/timeinterval/timeperiods.js +++ b/src/widget/timeinterval/timeperiods.js @@ -21,13 +21,13 @@ return { type: "bi.absolute", - height: this.constants.height, + height: o.height, items: [{ el: { type: "bi.horizontal_auto", items: [{ type: "bi.label", - height: this.constants.height, + height: o.height, width: this.constants.width, text: "-", ref: function (_ref) { @@ -42,7 +42,7 @@ }, { el: { type: "bi.center", - height: this.constants.height, + height: o.height, hgap: this.constants.hgap, items: [{ type: "bi.absolute", @@ -82,9 +82,11 @@ _createCombo: function (v) { var self = this; + var o = this.options; return { type: "bi.time_combo", value: v, + height: o.height, listeners: [{ eventName: BI.TimeCombo.EVENT_BEFORE_POPUPVIEW, action: function () { diff --git a/src/widget/year/combo.year.js b/src/widget/year/combo.year.js index 0770ed3c8..62a498d54 100644 --- a/src/widget/year/combo.year.js +++ b/src/widget/year/combo.year.js @@ -1,5 +1,9 @@ BI.DynamicYearCombo = BI.inherit(BI.Widget, { + _const: { + iconWidth: 24 + }, + props: { baseCls: "bi-year-combo", behaviors: {}, @@ -136,13 +140,13 @@ BI.DynamicYearCombo = BI.inherit(BI.Widget, { el: { type: "bi.icon_button", cls: "bi-trigger-icon-button", - width: o.height - border, + width: this._const.iconWidth, height: o.height - border, ref: function () { self.changeIcon = this; } }, - width: o.height - border + width: this._const.iconWidth }, this.combo] }, top: 0, diff --git a/src/widget/year/trigger.year.js b/src/widget/year/trigger.year.js index 612b51362..91b80a431 100644 --- a/src/widget/year/trigger.year.js +++ b/src/widget/year/trigger.year.js @@ -1,7 +1,8 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, { _const: { hgap: 4, - vgap: 2 + vgap: 2, + iconWidth: 24 }, _defaultConfig: function () { @@ -90,7 +91,8 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, { }); BI.createWidget({ element: this, - type: "bi.htape", + type: "bi.horizontal_fill", + columnSize: ["fill", ""], items: [{ el: this.editor }, { @@ -98,15 +100,13 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, { type: "bi.text_button", baseCls: "bi-trigger-year-text", text: BI.i18nText("BI-Multi_Date_Year"), - width: o.height }, - width: o.height }, { el: { type: "bi.trigger_icon_button", - width: o.height + width: this._const.iconWidth }, - width: o.height + width: this._const.iconWidth }] }); this.setValue(o.value); diff --git a/src/widget/yearinterval/yearinterval.js b/src/widget/yearinterval/yearinterval.js index 9a2986271..7c27f24f4 100644 --- a/src/widget/yearinterval/yearinterval.js +++ b/src/widget/yearinterval/yearinterval.js @@ -29,7 +29,7 @@ BI.YearInterval = BI.inherit(BI.Single, { return [{ type: "bi.center", hgap: 15, - height: this.constants.height, + height: o.height, items: [{ type: "bi.absolute", items: [{ @@ -53,7 +53,7 @@ BI.YearInterval = BI.inherit(BI.Single, { type: "bi.horizontal_auto", items: [{ type: "bi.label", - height: this.constants.height, + height: o.height, width: this.constants.width, text: "-", ref: function (_ref) { @@ -70,6 +70,7 @@ BI.YearInterval = BI.inherit(BI.Single, { supportDynamic: o.supportDynamic, minDate: o.minDate, maxDate: o.maxDate, + height: o.height, behaviors: o.behaviors, value: v, listeners: [{ diff --git a/src/widget/yearmonth/trigger.yearmonth.js b/src/widget/yearmonth/trigger.yearmonth.js index 11a15a785..56a6b420a 100644 --- a/src/widget/yearmonth/trigger.yearmonth.js +++ b/src/widget/yearmonth/trigger.yearmonth.js @@ -1,7 +1,8 @@ BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, { _const: { hgap: 4, - vgap: 2 + vgap: 2, + iconWidth: 24 }, props: { @@ -20,7 +21,6 @@ BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, { _init: function () { BI.DynamicYearMonthTrigger.superclass._init.apply(this, arguments); var o = this.options; - this.yearEditor = this._createEditor(true); this.monthEditor = this._createEditor(false); @@ -30,31 +30,30 @@ BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, { items: [{ type: "bi.center", items: [{ - type: "bi.htape", + type: "bi.horizontal_fill", + columnSize: ["fill", ""], items: [this.yearEditor, { el: { type: "bi.text_button", text: BI.i18nText("BI-Multi_Date_Year"), - width: o.height }, - width: o.height }] }, { - type: "bi.htape", + type: "bi.horizontal_fill", + columnSize: ["fill", ""], items: [this.monthEditor, { el: { type: "bi.text_button", text: BI.i18nText("BI-Multi_Date_Month"), - width: o.height }, - width: o.height}] + }] }] }, { el: { type: "bi.trigger_icon_button", - width: o.height + width: this._const.iconWidth }, - width: o.height + width: this._const.iconWidth }] }); this.setValue(o.value); diff --git a/src/widget/yearquarter/combo.yearquarter.js b/src/widget/yearquarter/combo.yearquarter.js index c8820fdb3..ae42bec41 100644 --- a/src/widget/yearquarter/combo.yearquarter.js +++ b/src/widget/yearquarter/combo.yearquarter.js @@ -1,5 +1,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, { + _consts:{ + iconWidth: 24 + }, props: { baseCls: "bi-year-quarter-combo", behaviors: {}, @@ -140,13 +143,13 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, { el: { type: "bi.icon_button", cls: "bi-trigger-icon-button", - width: o.height - border, + width: this._consts.iconWidth, height: o.height - border, ref: function () { self.changeIcon = this; } }, - width: o.height - border + width: this._consts.iconWidth }, this.combo] }, top: 0, diff --git a/src/widget/yearquarter/trigger.yearquarter.js b/src/widget/yearquarter/trigger.yearquarter.js index 4e3765c36..ea7cb6f4e 100644 --- a/src/widget/yearquarter/trigger.yearquarter.js +++ b/src/widget/yearquarter/trigger.yearquarter.js @@ -1,7 +1,8 @@ BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, { _const: { hgap: 4, - vgap: 2 + vgap: 2, + iconWidth: 24 }, props: { @@ -14,7 +15,6 @@ BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, { _init: function () { BI.DynamicYearQuarterTrigger.superclass._init.apply(this, arguments); var o = this.options; - this.yearEditor = this._createEditor(true); this.quarterEditor = this._createEditor(false); @@ -27,32 +27,30 @@ BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, { items: [{ type: "bi.center", items: [{ - type: "bi.htape", + type: "bi.horizontal_fill", + columnSize: ["fill", ""], items: [this.yearEditor, { el: { type: "bi.text_button", text: BI.i18nText("BI-Multi_Date_Year"), - width: height }, - width: height }] }, { - type: "bi.htape", + type: "bi.horizontal_fill", + columnSize: ["fill", ""], items: [this.quarterEditor, { el: { type: "bi.text_button", text: BI.i18nText("BI-Multi_Date_Quarter"), - width: height }, - width: height }] }] }, { el: { type: "bi.trigger_icon_button", - width: height + width: this._const.iconWidth, }, - width: height + width: this._const.iconWidth, }] }); this.setValue(o.value); diff --git a/src/widget/yearquarterinterval/yearquarterinterval.js b/src/widget/yearquarterinterval/yearquarterinterval.js index 4dbf4f691..e148a92f0 100644 --- a/src/widget/yearquarterinterval/yearquarterinterval.js +++ b/src/widget/yearquarterinterval/yearquarterinterval.js @@ -29,7 +29,7 @@ BI.YearQuarterInterval = BI.inherit(BI.Single, { return [{ type: "bi.center", hgap: 15, - height: this.constants.height, + height: o.height, items: [{ type: "bi.absolute", items: [{ @@ -53,7 +53,7 @@ BI.YearQuarterInterval = BI.inherit(BI.Single, { type: "bi.horizontal_auto", items: [{ type: "bi.label", - height: this.constants.height, + height: o.height, width: this.constants.width, text: "-", ref: function (_ref) { @@ -72,6 +72,7 @@ BI.YearQuarterInterval = BI.inherit(BI.Single, { maxDate: o.maxDate, behaviors: o.behaviors, value: v, + height: o.height, listeners: [{ eventName: BI.DynamicYearQuarterCombo.EVENT_BEFORE_POPUPVIEW, action: function () {