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,
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]
});
},

5
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);

5
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: {

8
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({

9
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 () {

4
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
}, {

5
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,

8
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 () {

8
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,

12
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);

5
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: [{

19
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);

7
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,

18
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);

5
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 () {

Loading…
Cancel
Save