windy 7 years ago
parent
commit
358a24f21b
  1. 3
      demo/version.js
  2. 34
      dist/_fineui.min.js
  3. 226
      dist/bundle.js
  4. 36
      dist/bundle.min.js
  5. 3
      dist/config.js
  6. 34
      dist/fineui.min.js
  7. 223
      dist/widget.js
  8. 3
      public/js/index.js
  9. 44
      src/widget/dynamic/year/combo.year.js
  10. 36
      src/widget/dynamic/year/trigger.year.js
  11. 44
      src/widget/dynamic/yearmonth/combo.yearmonth.js
  12. 8
      src/widget/dynamic/yearmonth/trigger.yearmonth.js
  13. 44
      src/widget/dynamic/yearquarter/combo.yearquarter.js
  14. 8
      src/widget/dynamic/yearquarter/trigger.yearquarter.js
  15. 28
      src/widget/dynamicdate/dynamicdate.combo.js
  16. 7
      src/widget/dynamicdate/dynamicdate.param.item.js
  17. 4
      src/widget/dynamicdate/dynamicdate.trigger.js
  18. 3
      ui/js/index.js

3
demo/version.js

@ -145,5 +145,6 @@ BI.i18n = {
"BI-Basic_Current_Month": "本月",
"BI-Basic_Current_Quarter": "本季度",
"BI-Basic_Year_Month": "年月",
"BI-Basic_Year_Quarter": "年季度"
"BI-Basic_Year_Quarter": "年季度",
"BI-Basic_Input_Can_Not_Null": "输入框不能为空"
};

34
dist/_fineui.min.js vendored

File diff suppressed because one or more lines are too long

226
dist/bundle.js vendored

@ -89683,7 +89683,7 @@ BI.StaticYearCard.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.static_year_card", BI.StaticYearCard);BI.DynamicYearCombo = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-year-combo",
baseCls: "bi-year-combo bi-border",
behaviors: {},
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
@ -89728,7 +89728,6 @@ BI.shortcut("bi.static_year_card", BI.StaticYearCard);BI.DynamicYearCombo = BI.i
this.combo = BI.createWidget({
type: "bi.combo",
element: this,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: this.trigger,
@ -89781,11 +89780,52 @@ BI.shortcut("bi.static_year_card", BI.StaticYearCard);BI.DynamicYearCombo = BI.i
self.popup.setValue(self.storeValue);
self.fireEvent(BI.DynamicYearCombo.EVENT_BEFORE_POPUPVIEW);
});
BI.createWidget({
type: "bi.htape",
element: this,
ref: function () {
self.comboWrapper = this;
},
items: [{
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font",
width: 24,
height: 24,
ref: function () {
self.changeIcon = this;
}
},
width: 30
}, this.combo]
});
this._checkDynamicValue(o.value);
},
_checkDynamicValue: function (v) {
var type = null;
if (BI.isNotNull(v)) {
type = v.type;
}
switch (type) {
case BI.DynamicYearCombo.Dynamic:
this.changeIcon.setVisible(true);
this.comboWrapper.attr("items")[0].width = 30;
this.comboWrapper.resize();
break;
default:
this.comboWrapper.attr("items")[0].width = 0;
this.comboWrapper.resize();
this.changeIcon.setVisible(false);
break;
}
},
setValue: function (v) {
this.storeValue = v;
this.trigger.setValue(v);
this._checkDynamicValue(v);
},
getValue: function () {
@ -90016,7 +90056,7 @@ BI.shortcut("bi.dynamic_year_popup", BI.DynamicYearPopup);BI.DynamicYearTrigger
_defaultConfig: function () {
return BI.extend(BI.DynamicYearTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-year-trigger bi-border",
extraCls: "bi-year-trigger",
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
height: 24
@ -90036,6 +90076,7 @@ BI.shortcut("bi.dynamic_year_popup", BI.DynamicYearPopup);BI.DynamicYearTrigger
},
hgap: c.hgap,
vgap: c.vgap,
watermark: BI.i18nText("BI-Basic_Unrestricted"),
allowBlank: true,
errorText: function (v) {
return !BI.isPositiveInteger(v) ? c.errorText : c.errorTextInvalid;
@ -90077,25 +90118,23 @@ BI.shortcut("bi.dynamic_year_popup", BI.DynamicYearPopup);BI.DynamicYearTrigger
BI.createWidget({
element: this,
type: "bi.htape",
items: [
{
el: this.editor
}, {
el: {
type: "bi.text_button",
baseCls: "bi-trigger-year-text",
text: BI.i18nText("BI-Multi_Date_Year"),
width: o.height
},
items: [{
el: this.editor
}, {
el: {
type: "bi.text_button",
baseCls: "bi-trigger-year-text",
text: BI.i18nText("BI-Multi_Date_Year"),
width: o.height
}, {
el: {
type: "bi.trigger_icon_button",
width: o.height
},
},
width: o.height
}, {
el: {
type: "bi.trigger_icon_button",
width: o.height
}
]
},
width: o.height
}]
});
this.setValue(o.value);
},
@ -90131,6 +90170,7 @@ BI.shortcut("bi.dynamic_year_popup", BI.DynamicYearPopup);BI.DynamicYearTrigger
break;
case BI.DynamicDateCombo.Static:
default:
value = value || {};
this.editor.setState(value.year);
this.editor.setValue(value.year);
this.editor.setTitle(value.year);
@ -90345,7 +90385,7 @@ BI.StaticYearMonthCard.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.static_year_month_card", BI.StaticYearMonthCard);BI.DynamicYearMonthCombo = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-year-month-combo",
baseCls: "bi-year-month-combo bi-border",
behaviors: {},
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
@ -90381,7 +90421,6 @@ BI.shortcut("bi.static_year_month_card", BI.StaticYearMonthCard);BI.DynamicYearM
this.combo = BI.createWidget({
type: "bi.combo",
element: this,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: this.trigger,
@ -90434,11 +90473,52 @@ BI.shortcut("bi.static_year_month_card", BI.StaticYearMonthCard);BI.DynamicYearM
self.popup.setValue(self.storeValue);
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW);
});
BI.createWidget({
type: "bi.htape",
element: this,
ref: function () {
self.comboWrapper = this;
},
items: [{
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font",
width: 24,
height: 24,
ref: function () {
self.changeIcon = this;
}
},
width: 30
}, this.combo]
});
this._checkDynamicValue(o.value);
},
_checkDynamicValue: function (v) {
var type = null;
if (BI.isNotNull(v)) {
type = v.type;
}
switch (type) {
case BI.DynamicYearMonthCombo.Dynamic:
this.changeIcon.setVisible(true);
this.comboWrapper.attr("items")[0].width = 30;
this.comboWrapper.resize();
break;
default:
this.comboWrapper.attr("items")[0].width = 0;
this.comboWrapper.resize();
this.changeIcon.setVisible(false);
break;
}
},
setValue: function (v) {
this.storeValue = v;
this.trigger.setValue(v);
this._checkDynamicValue(v);
},
getValue: function () {
@ -90668,7 +90748,7 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY
},
props: {
extraCls: "bi-year-month-trigger bi-border",
extraCls: "bi-year-month-trigger",
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
height: 24
@ -90723,11 +90803,15 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY
type: "bi.sign_editor",
height: o.height,
validationChecker: function (v) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(isYear ? v : BI.getDate().getFullYear(), isYear ? 1 : v, 1, o.min, o.max)[0]);
if(isYear) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]);
}
return v === "" || ((v >= 1 && v <= 12) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]);
},
quitChecker: function () {
return false;
},
watermark: BI.i18nText("BI-Basic_Unrestricted"),
errorText: function (v) {
return !BI.isPositiveInteger(v) ? c.errorText : c.errorTextInvalid;
},
@ -91031,7 +91115,7 @@ BI.StaticYearQuarterCard.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.static_year_quarter_card", BI.StaticYearQuarterCard);BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-year-quarter-combo",
baseCls: "bi-year-quarter-combo bi-border",
behaviors: {},
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
@ -91067,7 +91151,6 @@ BI.shortcut("bi.static_year_quarter_card", BI.StaticYearQuarterCard);BI.DynamicY
this.combo = BI.createWidget({
type: "bi.combo",
element: this,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: this.trigger,
@ -91120,11 +91203,52 @@ BI.shortcut("bi.static_year_quarter_card", BI.StaticYearQuarterCard);BI.DynamicY
self.popup.setValue(self.storeValue);
self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_BEFORE_POPUPVIEW);
});
BI.createWidget({
type: "bi.htape",
element: this,
ref: function () {
self.comboWrapper = this;
},
items: [{
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font",
width: 24,
height: 24,
ref: function () {
self.changeIcon = this;
}
},
width: 30
}, this.combo]
});
this._checkDynamicValue(o.value);
},
_checkDynamicValue: function (v) {
var type = null;
if (BI.isNotNull(v)) {
type = v.type;
}
switch (type) {
case BI.DynamicYearQuarterCombo.Dynamic:
this.changeIcon.setVisible(true);
this.comboWrapper.attr("items")[0].width = 30;
this.comboWrapper.resize();
break;
default:
this.comboWrapper.attr("items")[0].width = 0;
this.comboWrapper.resize();
this.changeIcon.setVisible(false);
break;
}
},
setValue: function (v) {
this.storeValue = v;
this.trigger.setValue(v);
this._checkDynamicValue(v);
},
getValue: function () {
@ -91347,7 +91471,7 @@ BI.shortcut("bi.dynamic_year_quarter_popup", BI.DynamicYearQuarterPopup);BI.Dyna
},
props: {
extraCls: "bi-year-quarter-trigger bi-border",
extraCls: "bi-year-quarter-trigger",
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
height: 24
@ -91402,7 +91526,10 @@ BI.shortcut("bi.dynamic_year_quarter_popup", BI.DynamicYearQuarterPopup);BI.Dyna
type: "bi.sign_editor",
height: o.height,
validationChecker: function (v) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(isYear ? v : BI.getDate().getFullYear(), isYear ? 1 : v, 1, o.min, o.max)[0]);
if(isYear) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]);
}
return v === "" || ((v >= 1 && v <= 4) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]);
},
quitChecker: function () {
return false;
@ -91410,6 +91537,7 @@ BI.shortcut("bi.dynamic_year_quarter_popup", BI.DynamicYearQuarterPopup);BI.Dyna
errorText: function (v) {
return !BI.isPositiveInteger(v) ? c.errorText : c.errorTextInvalid;
},
watermark: BI.i18nText("BI-Basic_Unrestricted"),
hgap: c.hgap,
vgap: c.vgap,
allowBlank: true
@ -91912,6 +92040,17 @@ BI.extend(BI.DynamicDateCard, {
return {
type: "bi.htape",
items: [{
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font",
width: 24,
height: 24,
ref: function () {
self.changeIcon = this;
}
},
width: 30
}, {
type: "bi.absolute",
items: [{
el: {
@ -92074,19 +92213,8 @@ BI.extend(BI.DynamicDateCard, {
}]
},
top: 0,
left: 0
right: 0
}]
}, {
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font",
width: 24,
height: 24,
ref: function () {
self.changeIcon = this;
}
},
width: 30
}],
ref: function (_ref) {
self.comboWrapper = _ref;
@ -92106,11 +92234,11 @@ BI.extend(BI.DynamicDateCard, {
switch (type) {
case BI.DynamicDateCombo.Dynamic:
this.changeIcon.setVisible(true);
this.comboWrapper.attr("items")[1].width = 30;
this.comboWrapper.attr("items")[0].width = 30;
this.comboWrapper.resize();
break;
default:
this.comboWrapper.attr("items")[1].width = 0;
this.comboWrapper.attr("items")[0].width = 0;
this.comboWrapper.resize();
this.changeIcon.setVisible(false);
break;
@ -92171,6 +92299,13 @@ BI.extend(BI.DynamicDateCombo, {
ref: function () {
self.editor = this;
},
errorText: function (v) {
if(BI.isEmptyString(v)) {
return BI.i18nText("BI-Basic_Input_Can_Not_Null");
}
return BI.i18nText("BI-Please_Input_Positive_Integer");
},
allowBlank: false,
listeners: [{
eventName: BI.SignEditor.EVENT_CONFIRM,
action: function () {
@ -92559,10 +92694,10 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
type: "bi.htape",
element: this,
items: [{
el: this.editor
}, {
el: BI.createWidget(),
width: 30
}, {
el: this.editor
}]
});
this.setValue(o.value);
@ -110399,5 +110534,6 @@ BI.i18n = {
"BI-Basic_Current_Month": "本月",
"BI-Basic_Current_Quarter": "本季度",
"BI-Basic_Year_Month": "年月",
"BI-Basic_Year_Quarter": "年季度"
"BI-Basic_Year_Quarter": "年季度",
"BI-Basic_Input_Can_Not_Null": "输入框不能为空"
};

36
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

3
dist/config.js vendored

@ -145,5 +145,6 @@ BI.i18n = {
"BI-Basic_Current_Month": "本月",
"BI-Basic_Current_Quarter": "本季度",
"BI-Basic_Year_Month": "年月",
"BI-Basic_Year_Quarter": "年季度"
"BI-Basic_Year_Quarter": "年季度",
"BI-Basic_Input_Can_Not_Null": "输入框不能为空"
};

34
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

223
dist/widget.js vendored

@ -3012,7 +3012,7 @@ BI.StaticYearCard.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.static_year_card", BI.StaticYearCard);BI.DynamicYearCombo = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-year-combo",
baseCls: "bi-year-combo bi-border",
behaviors: {},
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
@ -3057,7 +3057,6 @@ BI.shortcut("bi.static_year_card", BI.StaticYearCard);BI.DynamicYearCombo = BI.i
this.combo = BI.createWidget({
type: "bi.combo",
element: this,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: this.trigger,
@ -3110,11 +3109,52 @@ BI.shortcut("bi.static_year_card", BI.StaticYearCard);BI.DynamicYearCombo = BI.i
self.popup.setValue(self.storeValue);
self.fireEvent(BI.DynamicYearCombo.EVENT_BEFORE_POPUPVIEW);
});
BI.createWidget({
type: "bi.htape",
element: this,
ref: function () {
self.comboWrapper = this;
},
items: [{
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font",
width: 24,
height: 24,
ref: function () {
self.changeIcon = this;
}
},
width: 30
}, this.combo]
});
this._checkDynamicValue(o.value);
},
_checkDynamicValue: function (v) {
var type = null;
if (BI.isNotNull(v)) {
type = v.type;
}
switch (type) {
case BI.DynamicYearCombo.Dynamic:
this.changeIcon.setVisible(true);
this.comboWrapper.attr("items")[0].width = 30;
this.comboWrapper.resize();
break;
default:
this.comboWrapper.attr("items")[0].width = 0;
this.comboWrapper.resize();
this.changeIcon.setVisible(false);
break;
}
},
setValue: function (v) {
this.storeValue = v;
this.trigger.setValue(v);
this._checkDynamicValue(v);
},
getValue: function () {
@ -3345,7 +3385,7 @@ BI.shortcut("bi.dynamic_year_popup", BI.DynamicYearPopup);BI.DynamicYearTrigger
_defaultConfig: function () {
return BI.extend(BI.DynamicYearTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-year-trigger bi-border",
extraCls: "bi-year-trigger",
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
height: 24
@ -3365,6 +3405,7 @@ BI.shortcut("bi.dynamic_year_popup", BI.DynamicYearPopup);BI.DynamicYearTrigger
},
hgap: c.hgap,
vgap: c.vgap,
watermark: BI.i18nText("BI-Basic_Unrestricted"),
allowBlank: true,
errorText: function (v) {
return !BI.isPositiveInteger(v) ? c.errorText : c.errorTextInvalid;
@ -3406,25 +3447,23 @@ BI.shortcut("bi.dynamic_year_popup", BI.DynamicYearPopup);BI.DynamicYearTrigger
BI.createWidget({
element: this,
type: "bi.htape",
items: [
{
el: this.editor
}, {
el: {
type: "bi.text_button",
baseCls: "bi-trigger-year-text",
text: BI.i18nText("BI-Multi_Date_Year"),
width: o.height
},
items: [{
el: this.editor
}, {
el: {
type: "bi.text_button",
baseCls: "bi-trigger-year-text",
text: BI.i18nText("BI-Multi_Date_Year"),
width: o.height
}, {
el: {
type: "bi.trigger_icon_button",
width: o.height
},
},
width: o.height
}, {
el: {
type: "bi.trigger_icon_button",
width: o.height
}
]
},
width: o.height
}]
});
this.setValue(o.value);
},
@ -3460,6 +3499,7 @@ BI.shortcut("bi.dynamic_year_popup", BI.DynamicYearPopup);BI.DynamicYearTrigger
break;
case BI.DynamicDateCombo.Static:
default:
value = value || {};
this.editor.setState(value.year);
this.editor.setValue(value.year);
this.editor.setTitle(value.year);
@ -3674,7 +3714,7 @@ BI.StaticYearMonthCard.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.static_year_month_card", BI.StaticYearMonthCard);BI.DynamicYearMonthCombo = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-year-month-combo",
baseCls: "bi-year-month-combo bi-border",
behaviors: {},
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
@ -3710,7 +3750,6 @@ BI.shortcut("bi.static_year_month_card", BI.StaticYearMonthCard);BI.DynamicYearM
this.combo = BI.createWidget({
type: "bi.combo",
element: this,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: this.trigger,
@ -3763,11 +3802,52 @@ BI.shortcut("bi.static_year_month_card", BI.StaticYearMonthCard);BI.DynamicYearM
self.popup.setValue(self.storeValue);
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW);
});
BI.createWidget({
type: "bi.htape",
element: this,
ref: function () {
self.comboWrapper = this;
},
items: [{
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font",
width: 24,
height: 24,
ref: function () {
self.changeIcon = this;
}
},
width: 30
}, this.combo]
});
this._checkDynamicValue(o.value);
},
_checkDynamicValue: function (v) {
var type = null;
if (BI.isNotNull(v)) {
type = v.type;
}
switch (type) {
case BI.DynamicYearMonthCombo.Dynamic:
this.changeIcon.setVisible(true);
this.comboWrapper.attr("items")[0].width = 30;
this.comboWrapper.resize();
break;
default:
this.comboWrapper.attr("items")[0].width = 0;
this.comboWrapper.resize();
this.changeIcon.setVisible(false);
break;
}
},
setValue: function (v) {
this.storeValue = v;
this.trigger.setValue(v);
this._checkDynamicValue(v);
},
getValue: function () {
@ -3997,7 +4077,7 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY
},
props: {
extraCls: "bi-year-month-trigger bi-border",
extraCls: "bi-year-month-trigger",
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
height: 24
@ -4052,11 +4132,15 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY
type: "bi.sign_editor",
height: o.height,
validationChecker: function (v) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(isYear ? v : BI.getDate().getFullYear(), isYear ? 1 : v, 1, o.min, o.max)[0]);
if(isYear) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]);
}
return v === "" || ((v >= 1 && v <= 12) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]);
},
quitChecker: function () {
return false;
},
watermark: BI.i18nText("BI-Basic_Unrestricted"),
errorText: function (v) {
return !BI.isPositiveInteger(v) ? c.errorText : c.errorTextInvalid;
},
@ -4360,7 +4444,7 @@ BI.StaticYearQuarterCard.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.static_year_quarter_card", BI.StaticYearQuarterCard);BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-year-quarter-combo",
baseCls: "bi-year-quarter-combo bi-border",
behaviors: {},
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
@ -4396,7 +4480,6 @@ BI.shortcut("bi.static_year_quarter_card", BI.StaticYearQuarterCard);BI.DynamicY
this.combo = BI.createWidget({
type: "bi.combo",
element: this,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: this.trigger,
@ -4449,11 +4532,52 @@ BI.shortcut("bi.static_year_quarter_card", BI.StaticYearQuarterCard);BI.DynamicY
self.popup.setValue(self.storeValue);
self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_BEFORE_POPUPVIEW);
});
BI.createWidget({
type: "bi.htape",
element: this,
ref: function () {
self.comboWrapper = this;
},
items: [{
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font",
width: 24,
height: 24,
ref: function () {
self.changeIcon = this;
}
},
width: 30
}, this.combo]
});
this._checkDynamicValue(o.value);
},
_checkDynamicValue: function (v) {
var type = null;
if (BI.isNotNull(v)) {
type = v.type;
}
switch (type) {
case BI.DynamicYearQuarterCombo.Dynamic:
this.changeIcon.setVisible(true);
this.comboWrapper.attr("items")[0].width = 30;
this.comboWrapper.resize();
break;
default:
this.comboWrapper.attr("items")[0].width = 0;
this.comboWrapper.resize();
this.changeIcon.setVisible(false);
break;
}
},
setValue: function (v) {
this.storeValue = v;
this.trigger.setValue(v);
this._checkDynamicValue(v);
},
getValue: function () {
@ -4676,7 +4800,7 @@ BI.shortcut("bi.dynamic_year_quarter_popup", BI.DynamicYearQuarterPopup);BI.Dyna
},
props: {
extraCls: "bi-year-quarter-trigger bi-border",
extraCls: "bi-year-quarter-trigger",
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
height: 24
@ -4731,7 +4855,10 @@ BI.shortcut("bi.dynamic_year_quarter_popup", BI.DynamicYearQuarterPopup);BI.Dyna
type: "bi.sign_editor",
height: o.height,
validationChecker: function (v) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(isYear ? v : BI.getDate().getFullYear(), isYear ? 1 : v, 1, o.min, o.max)[0]);
if(isYear) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]);
}
return v === "" || ((v >= 1 && v <= 4) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]);
},
quitChecker: function () {
return false;
@ -4739,6 +4866,7 @@ BI.shortcut("bi.dynamic_year_quarter_popup", BI.DynamicYearQuarterPopup);BI.Dyna
errorText: function (v) {
return !BI.isPositiveInteger(v) ? c.errorText : c.errorTextInvalid;
},
watermark: BI.i18nText("BI-Basic_Unrestricted"),
hgap: c.hgap,
vgap: c.vgap,
allowBlank: true
@ -5241,6 +5369,17 @@ BI.extend(BI.DynamicDateCard, {
return {
type: "bi.htape",
items: [{
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font",
width: 24,
height: 24,
ref: function () {
self.changeIcon = this;
}
},
width: 30
}, {
type: "bi.absolute",
items: [{
el: {
@ -5403,19 +5542,8 @@ BI.extend(BI.DynamicDateCard, {
}]
},
top: 0,
left: 0
right: 0
}]
}, {
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font",
width: 24,
height: 24,
ref: function () {
self.changeIcon = this;
}
},
width: 30
}],
ref: function (_ref) {
self.comboWrapper = _ref;
@ -5435,11 +5563,11 @@ BI.extend(BI.DynamicDateCard, {
switch (type) {
case BI.DynamicDateCombo.Dynamic:
this.changeIcon.setVisible(true);
this.comboWrapper.attr("items")[1].width = 30;
this.comboWrapper.attr("items")[0].width = 30;
this.comboWrapper.resize();
break;
default:
this.comboWrapper.attr("items")[1].width = 0;
this.comboWrapper.attr("items")[0].width = 0;
this.comboWrapper.resize();
this.changeIcon.setVisible(false);
break;
@ -5500,6 +5628,13 @@ BI.extend(BI.DynamicDateCombo, {
ref: function () {
self.editor = this;
},
errorText: function (v) {
if(BI.isEmptyString(v)) {
return BI.i18nText("BI-Basic_Input_Can_Not_Null");
}
return BI.i18nText("BI-Please_Input_Positive_Integer");
},
allowBlank: false,
listeners: [{
eventName: BI.SignEditor.EVENT_CONFIRM,
action: function () {
@ -5888,10 +6023,10 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
type: "bi.htape",
element: this,
items: [{
el: this.editor
}, {
el: BI.createWidget(),
width: 30
}, {
el: this.editor
}]
});
this.setValue(o.value);

3
public/js/index.js

@ -145,5 +145,6 @@ BI.i18n = {
"BI-Basic_Current_Month": "本月",
"BI-Basic_Current_Quarter": "本季度",
"BI-Basic_Year_Month": "年月",
"BI-Basic_Year_Quarter": "年季度"
"BI-Basic_Year_Quarter": "年季度",
"BI-Basic_Input_Can_Not_Null": "输入框不能为空"
};

44
src/widget/dynamic/year/combo.year.js

@ -1,7 +1,7 @@
BI.DynamicYearCombo = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-year-combo",
baseCls: "bi-year-combo bi-border",
behaviors: {},
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
@ -46,7 +46,6 @@ BI.DynamicYearCombo = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({
type: "bi.combo",
element: this,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: this.trigger,
@ -99,11 +98,52 @@ BI.DynamicYearCombo = BI.inherit(BI.Widget, {
self.popup.setValue(self.storeValue);
self.fireEvent(BI.DynamicYearCombo.EVENT_BEFORE_POPUPVIEW);
});
BI.createWidget({
type: "bi.htape",
element: this,
ref: function () {
self.comboWrapper = this;
},
items: [{
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font",
width: 24,
height: 24,
ref: function () {
self.changeIcon = this;
}
},
width: 30
}, this.combo]
});
this._checkDynamicValue(o.value);
},
_checkDynamicValue: function (v) {
var type = null;
if (BI.isNotNull(v)) {
type = v.type;
}
switch (type) {
case BI.DynamicYearCombo.Dynamic:
this.changeIcon.setVisible(true);
this.comboWrapper.attr("items")[0].width = 30;
this.comboWrapper.resize();
break;
default:
this.comboWrapper.attr("items")[0].width = 0;
this.comboWrapper.resize();
this.changeIcon.setVisible(false);
break;
}
},
setValue: function (v) {
this.storeValue = v;
this.trigger.setValue(v);
this._checkDynamicValue(v);
},
getValue: function () {

36
src/widget/dynamic/year/trigger.year.js

@ -8,7 +8,7 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
return BI.extend(BI.DynamicYearTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-year-trigger bi-border",
extraCls: "bi-year-trigger",
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
height: 24
@ -28,6 +28,7 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, {
},
hgap: c.hgap,
vgap: c.vgap,
watermark: BI.i18nText("BI-Basic_Unrestricted"),
allowBlank: true,
errorText: function (v) {
return !BI.isPositiveInteger(v) ? c.errorText : c.errorTextInvalid;
@ -69,25 +70,23 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, {
BI.createWidget({
element: this,
type: "bi.htape",
items: [
{
el: this.editor
}, {
el: {
type: "bi.text_button",
baseCls: "bi-trigger-year-text",
text: BI.i18nText("BI-Multi_Date_Year"),
width: o.height
},
items: [{
el: this.editor
}, {
el: {
type: "bi.text_button",
baseCls: "bi-trigger-year-text",
text: BI.i18nText("BI-Multi_Date_Year"),
width: o.height
}, {
el: {
type: "bi.trigger_icon_button",
width: o.height
},
},
width: o.height
}, {
el: {
type: "bi.trigger_icon_button",
width: o.height
}
]
},
width: o.height
}]
});
this.setValue(o.value);
},
@ -123,6 +122,7 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, {
break;
case BI.DynamicDateCombo.Static:
default:
value = value || {};
this.editor.setState(value.year);
this.editor.setValue(value.year);
this.editor.setTitle(value.year);

44
src/widget/dynamic/yearmonth/combo.yearmonth.js

@ -1,7 +1,7 @@
BI.DynamicYearMonthCombo = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-year-month-combo",
baseCls: "bi-year-month-combo bi-border",
behaviors: {},
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
@ -37,7 +37,6 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({
type: "bi.combo",
element: this,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: this.trigger,
@ -90,11 +89,52 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Widget, {
self.popup.setValue(self.storeValue);
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW);
});
BI.createWidget({
type: "bi.htape",
element: this,
ref: function () {
self.comboWrapper = this;
},
items: [{
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font",
width: 24,
height: 24,
ref: function () {
self.changeIcon = this;
}
},
width: 30
}, this.combo]
});
this._checkDynamicValue(o.value);
},
_checkDynamicValue: function (v) {
var type = null;
if (BI.isNotNull(v)) {
type = v.type;
}
switch (type) {
case BI.DynamicYearMonthCombo.Dynamic:
this.changeIcon.setVisible(true);
this.comboWrapper.attr("items")[0].width = 30;
this.comboWrapper.resize();
break;
default:
this.comboWrapper.attr("items")[0].width = 0;
this.comboWrapper.resize();
this.changeIcon.setVisible(false);
break;
}
},
setValue: function (v) {
this.storeValue = v;
this.trigger.setValue(v);
this._checkDynamicValue(v);
},
getValue: function () {

8
src/widget/dynamic/yearmonth/trigger.yearmonth.js

@ -7,7 +7,7 @@ BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, {
},
props: {
extraCls: "bi-year-month-trigger bi-border",
extraCls: "bi-year-month-trigger",
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
height: 24
@ -62,11 +62,15 @@ BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, {
type: "bi.sign_editor",
height: o.height,
validationChecker: function (v) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(isYear ? v : BI.getDate().getFullYear(), isYear ? 1 : v, 1, o.min, o.max)[0]);
if(isYear) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]);
}
return v === "" || ((v >= 1 && v <= 12) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]);
},
quitChecker: function () {
return false;
},
watermark: BI.i18nText("BI-Basic_Unrestricted"),
errorText: function (v) {
return !BI.isPositiveInteger(v) ? c.errorText : c.errorTextInvalid;
},

44
src/widget/dynamic/yearquarter/combo.yearquarter.js

@ -1,7 +1,7 @@
BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-year-quarter-combo",
baseCls: "bi-year-quarter-combo bi-border",
behaviors: {},
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
@ -37,7 +37,6 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({
type: "bi.combo",
element: this,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: this.trigger,
@ -90,11 +89,52 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
self.popup.setValue(self.storeValue);
self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_BEFORE_POPUPVIEW);
});
BI.createWidget({
type: "bi.htape",
element: this,
ref: function () {
self.comboWrapper = this;
},
items: [{
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font",
width: 24,
height: 24,
ref: function () {
self.changeIcon = this;
}
},
width: 30
}, this.combo]
});
this._checkDynamicValue(o.value);
},
_checkDynamicValue: function (v) {
var type = null;
if (BI.isNotNull(v)) {
type = v.type;
}
switch (type) {
case BI.DynamicYearQuarterCombo.Dynamic:
this.changeIcon.setVisible(true);
this.comboWrapper.attr("items")[0].width = 30;
this.comboWrapper.resize();
break;
default:
this.comboWrapper.attr("items")[0].width = 0;
this.comboWrapper.resize();
this.changeIcon.setVisible(false);
break;
}
},
setValue: function (v) {
this.storeValue = v;
this.trigger.setValue(v);
this._checkDynamicValue(v);
},
getValue: function () {

8
src/widget/dynamic/yearquarter/trigger.yearquarter.js

@ -7,7 +7,7 @@ BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, {
},
props: {
extraCls: "bi-year-quarter-trigger bi-border",
extraCls: "bi-year-quarter-trigger",
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
height: 24
@ -62,7 +62,10 @@ BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, {
type: "bi.sign_editor",
height: o.height,
validationChecker: function (v) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(isYear ? v : BI.getDate().getFullYear(), isYear ? 1 : v, 1, o.min, o.max)[0]);
if(isYear) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]);
}
return v === "" || ((v >= 1 && v <= 4) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]);
},
quitChecker: function () {
return false;
@ -70,6 +73,7 @@ BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, {
errorText: function (v) {
return !BI.isPositiveInteger(v) ? c.errorText : c.errorTextInvalid;
},
watermark: BI.i18nText("BI-Basic_Unrestricted"),
hgap: c.hgap,
vgap: c.vgap,
allowBlank: true

28
src/widget/dynamicdate/dynamicdate.combo.js

@ -22,6 +22,17 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
return {
type: "bi.htape",
items: [{
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font",
width: 24,
height: 24,
ref: function () {
self.changeIcon = this;
}
},
width: 30
}, {
type: "bi.absolute",
items: [{
el: {
@ -184,19 +195,8 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
}]
},
top: 0,
left: 0
right: 0
}]
}, {
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font",
width: 24,
height: 24,
ref: function () {
self.changeIcon = this;
}
},
width: 30
}],
ref: function (_ref) {
self.comboWrapper = _ref;
@ -216,11 +216,11 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
switch (type) {
case BI.DynamicDateCombo.Dynamic:
this.changeIcon.setVisible(true);
this.comboWrapper.attr("items")[1].width = 30;
this.comboWrapper.attr("items")[0].width = 30;
this.comboWrapper.resize();
break;
default:
this.comboWrapper.attr("items")[1].width = 0;
this.comboWrapper.attr("items")[0].width = 0;
this.comboWrapper.resize();
this.changeIcon.setVisible(false);
break;

7
src/widget/dynamicdate/dynamicdate.param.item.js

@ -24,6 +24,13 @@ BI.DynamicDateParamItem = BI.inherit(BI.Widget, {
ref: function () {
self.editor = this;
},
errorText: function (v) {
if(BI.isEmptyString(v)) {
return BI.i18nText("BI-Basic_Input_Can_Not_Null");
}
return BI.i18nText("BI-Please_Input_Positive_Integer");
},
allowBlank: false,
listeners: [{
eventName: BI.SignEditor.EVENT_CONFIRM,
action: function () {

4
src/widget/dynamicdate/dynamicdate.trigger.js

@ -91,10 +91,10 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, {
type: "bi.htape",
element: this,
items: [{
el: this.editor
}, {
el: BI.createWidget(),
width: 30
}, {
el: this.editor
}]
});
this.setValue(o.value);

3
ui/js/index.js

@ -146,5 +146,6 @@ BI.i18n = {
"BI-Basic_Current_Month": "本月",
"BI-Basic_Current_Quarter": "本季度",
"BI-Basic_Year_Month": "年月",
"BI-Basic_Year_Quarter": "年季度"
"BI-Basic_Year_Quarter": "年季度",
"BI-Basic_Input_Can_Not_Null": "输入框不能为空"
};
Loading…
Cancel
Save