Browse Source

Pull request #2523: KERNEL-10392 修复时间控件高度调整bug

Merge in VISUAL/fineui from ~AEOLUS.ZHANG/fineui:feature-fixbug to master

* commit '1f060c20647a4c2f682b0dd6e22265b722614571':
  KERNEL-10392 修复时间控件高度调整bug
es6
Aeolus.Zhang 3 years ago
parent
commit
b83054a0a1
  1. 21
      src/widget/datetime/datetime.combo.js
  2. 5
      src/widget/datetime/datetime.trigger.js
  3. 5
      src/widget/dynamicdate/dynamicdate.combo.js
  4. 8
      src/widget/dynamicdate/dynamicdate.trigger.js
  5. 9
      src/widget/dynamicdatetime/dynamicdatetime.combo.js
  6. 4
      src/widget/dynamicdatetime/dynamicdatetime.trigger.js
  7. 5
      src/widget/time/time.combo.js
  8. 8
      src/widget/timeinterval/timeperiods.js
  9. 8
      src/widget/year/combo.year.js
  10. 12
      src/widget/year/trigger.year.js
  11. 5
      src/widget/yearinterval/yearinterval.js
  12. 19
      src/widget/yearmonth/trigger.yearmonth.js
  13. 7
      src/widget/yearquarter/combo.yearquarter.js
  14. 18
      src/widget/yearquarter/trigger.yearquarter.js
  15. 5
      src/widget/yearquarterinterval/yearquarterinterval.js

21
src/widget/datetime/datetime.combo.js

@ -6,7 +6,8 @@ BI.DateTimeCombo = BI.inherit(BI.Single, {
popupHeight: 290, popupHeight: 290,
popupWidth: 270, popupWidth: 270,
comboAdjustHeight: 1, comboAdjustHeight: 1,
border: 1 border: 1,
iconWidth: 24
}, },
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.DateTimeCombo.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.DateTimeCombo.superclass._defaultConfig.apply(this, arguments), {
@ -83,7 +84,7 @@ BI.DateTimeCombo = BI.inherit(BI.Single, {
var triggerBtn = BI.createWidget({ var triggerBtn = BI.createWidget({
type: "bi.icon_button", type: "bi.icon_button",
cls: "bi-trigger-icon-button date-font", cls: "bi-trigger-icon-button date-font",
width: opts.height, width: this.constants.iconWidth,
height: opts.height, height: opts.height,
}); });
triggerBtn.on(BI.IconButton.EVENT_CHANGE, function () { triggerBtn.on(BI.IconButton.EVENT_CHANGE, function () {
@ -96,21 +97,9 @@ BI.DateTimeCombo = BI.inherit(BI.Single, {
BI.createWidget({ BI.createWidget({
type: "bi.htape", type: "bi.htape",
columnSize: ["", this.constants.iconWidth],
element: this, element: this,
items: [{ items: [this.combo, triggerBtn]
type: "bi.absolute",
items: [{
el: this.combo,
top: 0,
left: 0,
right: 0,
bottom: 0
}, {
el: triggerBtn,
top: 0,
right: 0
}]
}]
}); });
}, },

5
src/widget/datetime/datetime.trigger.js

@ -3,7 +3,8 @@
*/ */
BI.DateTimeTrigger = BI.inherit(BI.Trigger, { BI.DateTimeTrigger = BI.inherit(BI.Trigger, {
_const: { _const: {
hgap: 4 hgap: 4,
iconWidth:24
}, },
_defaultConfig: function () { _defaultConfig: function () {
@ -33,7 +34,7 @@ BI.DateTimeTrigger = BI.inherit(BI.Trigger, {
el: this.text el: this.text
},{ },{
el: BI.createWidget(), el: BI.createWidget(),
width: o.height width: this._const.iconWidth
}] }]
}); });
this.setValue(o.value); this.setValue(o.value);

5
src/widget/dynamicdate/dynamicdate.combo.js

@ -3,7 +3,8 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
popupHeight: 259, popupHeight: 259,
popupWidth: 270, popupWidth: 270,
comboAdjustHeight: 1, comboAdjustHeight: 1,
border: 1 border: 1,
iconWidth: 24
}, },
props: { props: {
@ -48,7 +49,7 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
destroyWhenHide: true, destroyWhenHide: true,
el: { el: {
type: "bi.horizontal_fill", type: "bi.horizontal_fill",
columnSize: [opts.height - border, "fill"], columnSize: [this.constants.iconWidth, "fill"],
height: opts.height - border, height: opts.height - border,
items: [{ items: [{
el: { el: {

8
src/widget/dynamicdate/dynamicdate.trigger.js

@ -5,7 +5,8 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, {
yearLength: 4, yearLength: 4,
yearMonthLength: 6, yearMonthLength: 6,
yearFullMonthLength: 7, yearFullMonthLength: 7,
compareFormat: "%Y-%X-%d" compareFormat: "%Y-%X-%d",
iconWidth: 24
}, },
props: { props: {
@ -120,15 +121,16 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, {
BI.createWidget({ BI.createWidget({
type: "bi.htape", type: "bi.htape",
element: this, element: this,
columnSize: ["", this._const.iconWidth],
items: [{ items: [{
el: this.editor el: this.editor
}, { }, {
el: { el: {
type: "bi.icon_button", type: "bi.icon_button",
cls: "bi-trigger-icon-button date-font", 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({ !o.allowEdit && BI.createWidget({

9
src/widget/dynamicdatetime/dynamicdatetime.combo.js

@ -3,7 +3,8 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
popupHeight: 259, popupHeight: 259,
popupWidth: 270, popupWidth: 270,
comboAdjustHeight: 1, comboAdjustHeight: 1,
border: 1 border: 1,
iconWidth: 24
}, },
props: { props: {
@ -48,13 +49,13 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
isNeedAdjustWidth: opts.isNeedAdjustWidth, isNeedAdjustWidth: opts.isNeedAdjustWidth,
el: { el: {
type: "bi.horizontal_fill", type: "bi.horizontal_fill",
columnSize: [opts.height - border, "fill"], columnSize: [this.constants.iconWidth, "fill"],
height: opts.height - border, height: opts.height - border,
items: [{ items: [{
el: { el: {
type: "bi.icon_button", type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font", cls: "bi-trigger-icon-button date-change-h-font",
width: opts.height - border, width: this.constants.iconWidth,
height: opts.height - border, height: opts.height - border,
ref: function () { ref: function () {
self.changeIcon = this; self.changeIcon = this;
@ -68,7 +69,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
allowEdit: opts.allowEdit, allowEdit: opts.allowEdit,
watermark: opts.watermark, watermark: opts.watermark,
format: opts.format, format: opts.format,
iconWidth: opts.height - border, iconWidth: this.constants.iconWidth,
height: opts.height - border, height: opts.height - border,
value: opts.value, value: opts.value,
ref: function () { ref: function () {

4
src/widget/dynamicdatetime/dynamicdatetime.trigger.js

@ -5,7 +5,8 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, {
yearLength: 4, yearLength: 4,
yearMonthLength: 6, yearMonthLength: 6,
yearFullMonthLength: 7, yearFullMonthLength: 7,
compareFormat: "%Y-%X-%d %H:%M:%S" compareFormat: "%Y-%X-%d %H:%M:%S",
iconWidth: 24
}, },
props: { props: {
@ -118,6 +119,7 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, {
BI.createWidget({ BI.createWidget({
type: "bi.htape", type: "bi.htape",
element: this, element: this,
columnSize: ["", this._const.iconWidth],
items: [{ items: [{
el: this.editor el: this.editor
}, { }, {

5
src/widget/time/time.combo.js

@ -10,7 +10,8 @@
popupHeight: 80, popupHeight: 80,
popupWidth: 240, popupWidth: 240,
comboAdjustHeight: 1, comboAdjustHeight: 1,
border: 1 border: 1,
iconWidth: 24
}, },
props: { props: {
baseCls: "bi-time-combo", baseCls: "bi-time-combo",
@ -177,7 +178,7 @@
el: { el: {
type: "bi.icon_button", type: "bi.icon_button",
cls: "bi-trigger-icon-button time-font icon-size-16", cls: "bi-trigger-icon-button time-font icon-size-16",
width: opts.height, width: this.constants.iconWidth,
height: opts.height, height: opts.height,
listeners: [{ listeners: [{
eventName: BI.IconButton.EVENT_CHANGE, eventName: BI.IconButton.EVENT_CHANGE,

8
src/widget/timeinterval/timeperiods.js

@ -21,13 +21,13 @@
return { return {
type: "bi.absolute", type: "bi.absolute",
height: this.constants.height, height: o.height,
items: [{ items: [{
el: { el: {
type: "bi.horizontal_auto", type: "bi.horizontal_auto",
items: [{ items: [{
type: "bi.label", type: "bi.label",
height: this.constants.height, height: o.height,
width: this.constants.width, width: this.constants.width,
text: "-", text: "-",
ref: function (_ref) { ref: function (_ref) {
@ -42,7 +42,7 @@
}, { }, {
el: { el: {
type: "bi.center", type: "bi.center",
height: this.constants.height, height: o.height,
hgap: this.constants.hgap, hgap: this.constants.hgap,
items: [{ items: [{
type: "bi.absolute", type: "bi.absolute",
@ -82,9 +82,11 @@
_createCombo: function (v) { _createCombo: function (v) {
var self = this; var self = this;
var o = this.options;
return { return {
type: "bi.time_combo", type: "bi.time_combo",
value: v, value: v,
height: o.height,
listeners: [{ listeners: [{
eventName: BI.TimeCombo.EVENT_BEFORE_POPUPVIEW, eventName: BI.TimeCombo.EVENT_BEFORE_POPUPVIEW,
action: function () { action: function () {

8
src/widget/year/combo.year.js

@ -1,5 +1,9 @@
BI.DynamicYearCombo = BI.inherit(BI.Widget, { BI.DynamicYearCombo = BI.inherit(BI.Widget, {
_const: {
iconWidth: 24
},
props: { props: {
baseCls: "bi-year-combo", baseCls: "bi-year-combo",
behaviors: {}, behaviors: {},
@ -136,13 +140,13 @@ BI.DynamicYearCombo = BI.inherit(BI.Widget, {
el: { el: {
type: "bi.icon_button", type: "bi.icon_button",
cls: "bi-trigger-icon-button", cls: "bi-trigger-icon-button",
width: o.height - border, width: this._const.iconWidth,
height: o.height - border, height: o.height - border,
ref: function () { ref: function () {
self.changeIcon = this; self.changeIcon = this;
} }
}, },
width: o.height - border width: this._const.iconWidth
}, this.combo] }, this.combo]
}, },
top: 0, top: 0,

12
src/widget/year/trigger.year.js

@ -1,7 +1,8 @@
BI.DynamicYearTrigger = BI.inherit(BI.Trigger, { BI.DynamicYearTrigger = BI.inherit(BI.Trigger, {
_const: { _const: {
hgap: 4, hgap: 4,
vgap: 2 vgap: 2,
iconWidth: 24
}, },
_defaultConfig: function () { _defaultConfig: function () {
@ -90,7 +91,8 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, {
}); });
BI.createWidget({ BI.createWidget({
element: this, element: this,
type: "bi.htape", type: "bi.horizontal_fill",
columnSize: ["fill", ""],
items: [{ items: [{
el: this.editor el: this.editor
}, { }, {
@ -98,15 +100,13 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, {
type: "bi.text_button", type: "bi.text_button",
baseCls: "bi-trigger-year-text", baseCls: "bi-trigger-year-text",
text: BI.i18nText("BI-Multi_Date_Year"), text: BI.i18nText("BI-Multi_Date_Year"),
width: o.height
}, },
width: o.height
}, { }, {
el: { el: {
type: "bi.trigger_icon_button", type: "bi.trigger_icon_button",
width: o.height width: this._const.iconWidth
}, },
width: o.height width: this._const.iconWidth
}] }]
}); });
this.setValue(o.value); this.setValue(o.value);

5
src/widget/yearinterval/yearinterval.js

@ -29,7 +29,7 @@ BI.YearInterval = BI.inherit(BI.Single, {
return [{ return [{
type: "bi.center", type: "bi.center",
hgap: 15, hgap: 15,
height: this.constants.height, height: o.height,
items: [{ items: [{
type: "bi.absolute", type: "bi.absolute",
items: [{ items: [{
@ -53,7 +53,7 @@ BI.YearInterval = BI.inherit(BI.Single, {
type: "bi.horizontal_auto", type: "bi.horizontal_auto",
items: [{ items: [{
type: "bi.label", type: "bi.label",
height: this.constants.height, height: o.height,
width: this.constants.width, width: this.constants.width,
text: "-", text: "-",
ref: function (_ref) { ref: function (_ref) {
@ -70,6 +70,7 @@ BI.YearInterval = BI.inherit(BI.Single, {
supportDynamic: o.supportDynamic, supportDynamic: o.supportDynamic,
minDate: o.minDate, minDate: o.minDate,
maxDate: o.maxDate, maxDate: o.maxDate,
height: o.height,
behaviors: o.behaviors, behaviors: o.behaviors,
value: v, value: v,
listeners: [{ listeners: [{

19
src/widget/yearmonth/trigger.yearmonth.js

@ -1,7 +1,8 @@
BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, { BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, {
_const: { _const: {
hgap: 4, hgap: 4,
vgap: 2 vgap: 2,
iconWidth: 24
}, },
props: { props: {
@ -20,7 +21,6 @@ BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, {
_init: function () { _init: function () {
BI.DynamicYearMonthTrigger.superclass._init.apply(this, arguments); BI.DynamicYearMonthTrigger.superclass._init.apply(this, arguments);
var o = this.options; var o = this.options;
this.yearEditor = this._createEditor(true); this.yearEditor = this._createEditor(true);
this.monthEditor = this._createEditor(false); this.monthEditor = this._createEditor(false);
@ -30,31 +30,30 @@ BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, {
items: [{ items: [{
type: "bi.center", type: "bi.center",
items: [{ items: [{
type: "bi.htape", type: "bi.horizontal_fill",
columnSize: ["fill", ""],
items: [this.yearEditor, { items: [this.yearEditor, {
el: { el: {
type: "bi.text_button", type: "bi.text_button",
text: BI.i18nText("BI-Multi_Date_Year"), 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, { items: [this.monthEditor, {
el: { el: {
type: "bi.text_button", type: "bi.text_button",
text: BI.i18nText("BI-Multi_Date_Month"), text: BI.i18nText("BI-Multi_Date_Month"),
width: o.height
}, },
width: o.height}] }]
}] }]
}, { }, {
el: { el: {
type: "bi.trigger_icon_button", type: "bi.trigger_icon_button",
width: o.height width: this._const.iconWidth
}, },
width: o.height width: this._const.iconWidth
}] }]
}); });
this.setValue(o.value); this.setValue(o.value);

7
src/widget/yearquarter/combo.yearquarter.js

@ -1,5 +1,8 @@
BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, { BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
_consts:{
iconWidth: 24
},
props: { props: {
baseCls: "bi-year-quarter-combo", baseCls: "bi-year-quarter-combo",
behaviors: {}, behaviors: {},
@ -140,13 +143,13 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
el: { el: {
type: "bi.icon_button", type: "bi.icon_button",
cls: "bi-trigger-icon-button", cls: "bi-trigger-icon-button",
width: o.height - border, width: this._consts.iconWidth,
height: o.height - border, height: o.height - border,
ref: function () { ref: function () {
self.changeIcon = this; self.changeIcon = this;
} }
}, },
width: o.height - border width: this._consts.iconWidth
}, this.combo] }, this.combo]
}, },
top: 0, top: 0,

18
src/widget/yearquarter/trigger.yearquarter.js

@ -1,7 +1,8 @@
BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, { BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, {
_const: { _const: {
hgap: 4, hgap: 4,
vgap: 2 vgap: 2,
iconWidth: 24
}, },
props: { props: {
@ -14,7 +15,6 @@ BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, {
_init: function () { _init: function () {
BI.DynamicYearQuarterTrigger.superclass._init.apply(this, arguments); BI.DynamicYearQuarterTrigger.superclass._init.apply(this, arguments);
var o = this.options; var o = this.options;
this.yearEditor = this._createEditor(true); this.yearEditor = this._createEditor(true);
this.quarterEditor = this._createEditor(false); this.quarterEditor = this._createEditor(false);
@ -27,32 +27,30 @@ BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, {
items: [{ items: [{
type: "bi.center", type: "bi.center",
items: [{ items: [{
type: "bi.htape", type: "bi.horizontal_fill",
columnSize: ["fill", ""],
items: [this.yearEditor, { items: [this.yearEditor, {
el: { el: {
type: "bi.text_button", type: "bi.text_button",
text: BI.i18nText("BI-Multi_Date_Year"), text: BI.i18nText("BI-Multi_Date_Year"),
width: height
}, },
width: height
}] }]
}, { }, {
type: "bi.htape", type: "bi.horizontal_fill",
columnSize: ["fill", ""],
items: [this.quarterEditor, { items: [this.quarterEditor, {
el: { el: {
type: "bi.text_button", type: "bi.text_button",
text: BI.i18nText("BI-Multi_Date_Quarter"), text: BI.i18nText("BI-Multi_Date_Quarter"),
width: height
}, },
width: height
}] }]
}] }]
}, { }, {
el: { el: {
type: "bi.trigger_icon_button", type: "bi.trigger_icon_button",
width: height width: this._const.iconWidth,
}, },
width: height width: this._const.iconWidth,
}] }]
}); });
this.setValue(o.value); this.setValue(o.value);

5
src/widget/yearquarterinterval/yearquarterinterval.js

@ -29,7 +29,7 @@ BI.YearQuarterInterval = BI.inherit(BI.Single, {
return [{ return [{
type: "bi.center", type: "bi.center",
hgap: 15, hgap: 15,
height: this.constants.height, height: o.height,
items: [{ items: [{
type: "bi.absolute", type: "bi.absolute",
items: [{ items: [{
@ -53,7 +53,7 @@ BI.YearQuarterInterval = BI.inherit(BI.Single, {
type: "bi.horizontal_auto", type: "bi.horizontal_auto",
items: [{ items: [{
type: "bi.label", type: "bi.label",
height: this.constants.height, height: o.height,
width: this.constants.width, width: this.constants.width,
text: "-", text: "-",
ref: function (_ref) { ref: function (_ref) {
@ -72,6 +72,7 @@ BI.YearQuarterInterval = BI.inherit(BI.Single, {
maxDate: o.maxDate, maxDate: o.maxDate,
behaviors: o.behaviors, behaviors: o.behaviors,
value: v, value: v,
height: o.height,
listeners: [{ listeners: [{
eventName: BI.DynamicYearQuarterCombo.EVENT_BEFORE_POPUPVIEW, eventName: BI.DynamicYearQuarterCombo.EVENT_BEFORE_POPUPVIEW,
action: function () { action: function () {

Loading…
Cancel
Save