Browse Source

Merge pull request #236 in FUI/fineui from ~GUY/fineui:master to master

* commit '29bbd5903bf30cd3cdb8b4ff5a200fd6111eabc6':
  IE8兼容
  widget中的控件支持value
es6
guy 7 years ago
parent
commit
2ede59403b
  1. 2
      demo/js/widget/date/demo.datepane.js
  2. 7
      demo/js/widget/date/demo.multidate_combo.js
  3. 292
      demo/js/widget/downlist/demo.downlist.js
  4. 3
      demo/js/widget/month/demo.month.js
  5. 7
      demo/js/widget/numberinterval/demo.number_interval.js
  6. 3
      demo/js/widget/quarter/demo.quarter.js
  7. 11
      demo/js/widget/timeinterval/demo.time_interval.js
  8. 3
      demo/js/widget/year/demo.year.js
  9. 6
      demo/js/widget/yearmonth/demo.year_month_combo.js
  10. 6
      demo/js/widget/yearquarter/demo.year_quarter_combo.js
  11. 174
      dist/bundle.js
  12. 12
      dist/case.js
  13. 82
      dist/core.js
  14. 340
      dist/demo.js
  15. 204
      dist/fineui.js
  16. 30
      dist/polyfill.js
  17. 80
      dist/widget.js
  18. 5
      src/case/combo/icontextvaluecombo/combo.icontextvalue.js
  19. 2
      src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js
  20. 5
      src/case/combo/textvaluecombo/combo.textvalue.js
  21. 82
      src/core/proto/date.js
  22. 29
      src/polyfill/function.js
  23. 1
      src/widget/date/trigger.date.js
  24. 1
      src/widget/datepane/datepane.js
  25. 6
      src/widget/month/combo.month.js
  26. 3
      src/widget/month/popup.month.js
  27. 1
      src/widget/month/trigger.month.js
  28. 10
      src/widget/multidate/multidate.combo.js
  29. 1
      src/widget/multidate/multidate.popup.js
  30. 2
      src/widget/numberinterval/numberinterval.js
  31. 6
      src/widget/quarter/combo.quarter.js
  32. 5
      src/widget/quarter/popup.quarter.js
  33. 1
      src/widget/quarter/trigger.quarter.js
  34. 12
      src/widget/timeinterval/timeinterval.js
  35. 6
      src/widget/year/combo.year.js
  36. 6
      src/widget/year/popup.year.js
  37. 3
      src/widget/year/trigger.year.js
  38. 8
      src/widget/yearmonth/combo.yearmonth.js
  39. 8
      src/widget/yearquarter/combo.yearquarter.js

2
demo/js/widget/date/demo.datepane.js

@ -17,7 +17,7 @@ Demo.DatePane = BI.inherit(BI.Widget, {
type: "bi.date_pane",
selectedTime: {
year: 2017,
month: 12,
month: 11,
day: 11
},
ref: function (_ref) {

7
demo/js/widget/date/demo.multidate_combo.js

@ -20,7 +20,12 @@ Demo.Date = BI.inherit(BI.Widget, {
ref: function () {
self.datecombo = this;
},
width: 300
width: 300,
value: {
year: 2018,
month: 1,
day: 23
}
}, {
type: "bi.button",
text: "getVlaue",

292
demo/js/widget/downlist/demo.downlist.js

@ -26,119 +26,6 @@ BICst.CONF.GROUP.NUMBER.WEEKDAY = 21;
BICst.CONF.GROUP.NUMBER.RENAME = 22;
BICst.CONF.GROUP.NUMBER.DELETE = 23;
// 数值字段汇总设置
var items = [[{
text: BI.i18nText("BI-Basic_Qiu_Sum"),
value: BICst.CONF.GROUP.NUMBER.SUM,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Avg"),
value: BICst.CONF.GROUP.NUMBER.AVG,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Median"),
value: BICst.CONF.GROUP.NUMBER.MEDIAN,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Max"),
value: BICst.CONF.GROUP.NUMBER.MAX,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Min"),
value: BICst.CONF.GROUP.NUMBER.MIN,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Standard_Deviation"),
value: BICst.CONF.GROUP.NUMBER.STANDARD_DEVIATION,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Variance"),
value: BICst.CONF.GROUP.NUMBER.VARIANCE,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_No_Repeat_Count"),
value: BICst.CONF.GROUP.NUMBER.COUNT,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Record_Count"),
value: BICst.CONF.GROUP.NUMBER.RECORD_COUNT,
cls: "dot-ha-font"
}], [{
text: BI.i18nText("BI-Basic_None"),
value: BICst.CONF.GROUP.NUMBER.NONE,
cls: "dot-ha-font"
}, {
el: {
text: BI.i18nText("BI-Basic_Qiu_Same_Period"),
value: BICst.CONF.GROUP.NUMBER.PERIOD,
cls: "dot-ha-font"
},
children: [{
text: BI.i18nText("BI-Basic_Multi_Date_Year"),
value: BICst.CONF.GROUP.NUMBER.YEAR,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Quarter"),
value: BICst.CONF.GROUP.NUMBER.QUARTER,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Multi_Date_Month"),
value: BICst.CONF.GROUP.NUMBER.MONTH,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Multi_Date_Week"),
value: BICst.CONF.GROUP.NUMBER.WEEK,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Week_XingQi"),
value: BICst.CONF.GROUP.NUMBER.WEEKDAY,
cls: "dot-ha-font"
}]
}, {
text: BI.i18nText("BI-Basic_Qiu_Same_Ring"),
value: BICst.CONF.GROUP.NUMBER.RING,
cls: "dot-ha-font"
}, {
el: {
text: BI.i18nText("BI-Basic_Qiu_Same_Period_Rate"),
value: BICst.CONF.GROUP.NUMBER.PERIOD_RATE,
cls: "dot-ha-font"
},
children: [{
text: BI.i18nText("BI-Basic_Multi_Date_Year"),
value: BICst.CONF.GROUP.NUMBER.YEAR,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Quarter"),
value: BICst.CONF.GROUP.NUMBER.QUARTER,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Multi_Date_Month"),
value: BICst.CONF.GROUP.NUMBER.MONTH,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Multi_Date_Week"),
value: BICst.CONF.GROUP.NUMBER.WEEK,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Week_XingQi"),
value: BICst.CONF.GROUP.NUMBER.WEEKDAY,
cls: "dot-ha-font"
}]
}, {
text: BI.i18nText("BI-Basic_Qiu_Same_Ring_Rate"),
value: BICst.CONF.GROUP.NUMBER.RING_RATE,
cls: "dot-ha-font"
}], [{
text: BI.i18nText("BI-Basic_Rename"),
value: BICst.CONF.GROUP.NUMBER.RENAME,
cls: "widget-combo-rename-edit-font"
}], [{
text: BI.i18nText("BI-Basic_Remove"),
value: BICst.CONF.GROUP.NUMBER.DELETE,
cls: "delete-h-font"
}]];
Demo.Downlist = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-downlist"
@ -167,98 +54,97 @@ Demo.Downlist = BI.inherit(BI.Widget, {
self.downlist = _ref;
},
cls: "layout-bg3",
//value: [{"childValue":22,"value":11},{"value":18},{"value":20}],
value: [{"childValue":22,"value":11},{"value":18},{"value":20}],
height: 30,
width: 100,
items: items
// items: [
// [{
// el: {
// text: "column 1111",
// iconCls1: "check-mark-e-font",
// value: 11
// },
// children: [{
// text: "column 1.1",
// value: 21,
// cls: "dot-e-font"
// }, {
// text: "column 1.222222222222222222222222222222222222",
// cls: "dot-e-font",
// value: 22
// }]
// }],
// [{
// el: {
// type: "bi.icon_text_icon_item",
// text: "column 2",
// iconCls1: "chart-type-e-font",
// cls: "dot-e-font",
// value: 12
// },
// disabled: true,
// children: [{
// type: "bi.icon_text_item",
// cls: "dot-e-font",
// height: 25,
// text: "column 2.1",
// value: 11
// }, {
// text: "column 2.2",
// value: 12,
// cls: "dot-e-font"
// }]
// }],
// [{
// text: "column 8",
// value: 18,
// cls: "dot-e-font"
// },
// {
//
// text: "column 9",
// cls: "dot-e-font",
// value: 19
// }
// ],
// [{
// text: "column 10",
// value: 20,
// cls: "dot-e-font"
// },
// {
//
// text: "column 11",
// cls: "dot-e-font",
// value: 21
// },
// {
//
// text: "column 12",
// cls: "dot-e-font",
// value: 22
// },
// {
//
// text: "column 13",
// cls: "dot-e-font",
// value: 23
// },
// {
//
// text: "column 14",
// cls: "dot-e-font",
// value: 24
// },
// {
//
// text: "column 15",
// cls: "dot-e-font",
// value: 23
// }
// ]
//
// ]
items: [
[{
el: {
text: "column 1111",
iconCls1: "check-mark-e-font",
value: 11
},
children: [{
text: "column 1.1",
value: 21,
cls: "dot-e-font"
}, {
text: "column 1.222222222222222222222222222222222222",
cls: "dot-e-font",
value: 22
}]
}],
[{
el: {
type: "bi.icon_text_icon_item",
text: "column 2",
iconCls1: "chart-type-e-font",
cls: "dot-e-font",
value: 12
},
disabled: true,
children: [{
type: "bi.icon_text_item",
cls: "dot-e-font",
height: 25,
text: "column 2.1",
value: 11
}, {
text: "column 2.2",
value: 12,
cls: "dot-e-font"
}]
}],
[{
text: "column 8",
value: 18,
cls: "dot-e-font"
},
{
text: "column 9",
cls: "dot-e-font",
value: 19
}
],
[{
text: "column 10",
value: 20,
cls: "dot-e-font"
},
{
text: "column 11",
cls: "dot-e-font",
value: 21
},
{
text: "column 12",
cls: "dot-e-font",
value: 22
},
{
text: "column 13",
cls: "dot-e-font",
value: 23
},
{
text: "column 14",
cls: "dot-e-font",
value: 24
},
{
text: "column 15",
cls: "dot-e-font",
value: 23
}
]
]
}, {
type: "bi.label",
text: "显示选择值",

3
demo/js/widget/month/demo.month.js

@ -14,7 +14,8 @@ Demo.Month = BI.inherit(BI.Widget, {
width: 300,
ref: function () {
self.monthcombo = this;
}
},
value: 11
}, {
type: "bi.button",
text: "getValue",

7
demo/js/widget/numberinterval/demo.number_interval.js

@ -26,7 +26,12 @@ Demo.NumericalInterval = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.numerical = _ref;
},
width: 500
width: 500,
value: {
max: 300,
closeMax: true,
closeMin: false
}
}, {
type: "bi.label",
ref: function (_ref) {

3
demo/js/widget/quarter/demo.quarter.js

@ -14,7 +14,8 @@ Demo.Quarter = BI.inherit(BI.Widget, {
width: 300,
ref: function () {
self.quartercombo = this;
}
},
value: 3
}, {
type: "bi.button",
text: "getValue",

11
demo/js/widget/timeinterval/demo.time_interval.js

@ -16,6 +16,17 @@ Demo.TimeInterval = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.interval = _ref;
},
value: {
start: {
type: 1,
value: 2
},
end: {
year: 2018,
month: 0,
day: 12
}
},
width: 300
}, {
type: "bi.button",

3
demo/js/widget/year/demo.year.js

@ -14,7 +14,8 @@ Demo.Year = BI.inherit(BI.Widget, {
width: 300,
ref: function () {
self.yearcombo = this;
}
},
value: 2017
}, {
type: "bi.button",
text: "getValue",

6
demo/js/widget/yearmonth/demo.year_month_combo.js

@ -15,7 +15,11 @@ Demo.YearMonthCombo = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.widget = _ref;
},
width: 300
width: 300,
value:{
year: 2018,
month: 0
}
}, {
type: "bi.button",
text: "getValue",

6
demo/js/widget/yearquarter/demo.year_quarter_combo.js

@ -16,7 +16,11 @@ Demo.YearQuarterCombo = BI.inherit(BI.Widget, {
self.widget = _ref;
},
yearBehaviors: {},
quarterBehaviors: {}
quarterBehaviors: {},
value: {
year: 2018,
quarter: 1
}
}, {
type: "bi.button",
text: "getValue",

174
dist/bundle.js vendored

@ -21315,7 +21315,46 @@ Date.parseDateTime = function (str, fmt) {
};
Date.getDate = function () {
var dt = new (Function.prototype.bind.apply(Date, BI.concat([null], [].slice.apply(arguments))))();
var length = arguments.length;
var args = arguments;
var dt;
switch (length) {
// new Date()
case 0:
dt = new Date();
break;
// new Date(long)
case 1:
dt = new Date(args[0]);
break;
// new Date(year, month)
case 2:
dt = new Date(args[0], args[1]);
break;
// new Date(year, month, day)
case 3:
dt = new Date(args[0], args[1], args[2]);
break;
// new Date(year, month, day, hour)
case 4:
dt = new Date(args[0], args[1], args[2], args[3]);
break;
// new Date(year, month, day, hour, minute)
case 5:
dt = new Date(args[0], args[1], args[2], args[3], args[4]);
break;
// new Date(year, month, day, hour, minute, second)
case 6:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5]);
break;
// new Date(year, month, day, hour, minute, second, millisecond)
case 7:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
break;
default:
dt = new Date();
break;
}
if(BI.isNotNull(Date.timeZone) && (arguments.length === 0 || (arguments.length === 1 && BI.isNumber(arguments[0])))) {
var localTime = dt.getTime();
var localOffset = dt.getTimezoneOffset() * 60000; // 获得当地时间偏移的毫秒数
@ -21327,7 +21366,46 @@ Date.getDate = function () {
};
Date.getTime = function () {
var dt = Function.prototype.bind.apply(Date.getDate, BI.concat([null], [].slice.apply(arguments)))();
var length = arguments.length;
var args = arguments;
var dt;
switch (length) {
// new Date()
case 0:
dt = new Date();
break;
// new Date(long)
case 1:
dt = new Date(args[0]);
break;
// new Date(year, month)
case 2:
dt = new Date(args[0], args[1]);
break;
// new Date(year, month, day)
case 3:
dt = new Date(args[0], args[1], args[2]);
break;
// new Date(year, month, day, hour)
case 4:
dt = new Date(args[0], args[1], args[2], args[3]);
break;
// new Date(year, month, day, hour, minute)
case 5:
dt = new Date(args[0], args[1], args[2], args[3], args[4]);
break;
// new Date(year, month, day, hour, minute, second)
case 6:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5]);
break;
// new Date(year, month, day, hour, minute, second, millisecond)
case 7:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
break;
default:
dt = new Date();
break;
}
if(BI.isNotNull(Date.timeZone)) {
return dt.getTime() - Date.timeZone - dt.getTimezoneOffset() * 60000;
}
@ -67811,15 +67889,14 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, {
return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this, arguments), {
baseClass: "bi-icon-text-value-combo",
height: 30,
value: "",
el: {}
value: ""
});
},
_init: function () {
BI.IconTextValueCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(o.el, {
this.trigger = BI.createWidget({
type: "bi.select_icon_text_trigger",
items: o.items,
height: o.height,
@ -68016,7 +68093,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, {
_init: function () {
BI.TextValueCheckCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(o.el, {
this.trigger = BI.createWidget({
type: "bi.select_text_trigger",
items: o.items,
height: o.height,
@ -68214,15 +68291,14 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
height: 30,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
text: "",
value: "",
el: {}
value: ""
});
},
_init: function () {
BI.TextValueCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(o.el, {
this.trigger = BI.createWidget({
type: "bi.select_text_trigger",
items: o.items,
height: o.height,
@ -78833,6 +78909,7 @@ BI.shortcut("bi.date_combo", BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
el: this.editor
}]
});
this.setValue(o.value);
},
_dateCheck: function (date) {
return Date.parseDateTime(date, "%Y-%x-%d").print("%Y-%x-%d") == date || Date.parseDateTime(date, "%Y-%X-%d").print("%Y-%X-%d") == date || Date.parseDateTime(date, "%Y-%x-%e").print("%Y-%x-%e") == date || Date.parseDateTime(date, "%Y-%X-%e").print("%Y-%X-%e") == date;
@ -79109,6 +79186,7 @@ BI.DatePaneWidget = BI.inherit(BI.Widget, {
self.setValue(self.selectedTime);
self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE);
});
this.setValue(o.selectedTime);
},
@ -82846,7 +82924,8 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.month_trigger"
type: "bi.month_trigger",
value: o.value
});
this.trigger.on(BI.MonthTrigger.EVENT_CONFIRM, function (v) {
@ -82874,7 +82953,8 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
this.popup = BI.createWidget({
type: "bi.month_popup",
behaviors: o.behaviors
behaviors: o.behaviors,
value: o.value
});
this.popup.on(BI.MonthPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
@ -82972,7 +83052,8 @@ BI.MonthPopup = BI.inherit(BI.Widget, {
type: "bi.center_adapt",
vgap: 1,
hgap: 2
}]
}],
value: o.value
});
this.month.on(BI.Controller.EVENT_CHANGE, function (type) {
@ -83077,6 +83158,7 @@ BI.MonthTrigger = BI.inherit(BI.Trigger, {
}
]
});
this.setValue(o.value);
},
setValue: function (v) {
if(BI.isNotNull(v)) {
@ -83277,11 +83359,12 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
var self = this, opts = this.options;
this.storeTriggerValue = "";
var date = Date.getDate();
this.storeValue = null;
this.storeValue = opts.value;
this.trigger = BI.createWidget({
type: "bi.date_trigger",
min: this.constants.DATE_MIN_VALUE,
max: this.constants.DATE_MAX_VALUE
max: this.constants.DATE_MAX_VALUE,
value: opts.value
});
this.trigger.on(BI.DateTrigger.EVENT_KEY_DOWN, function () {
if (self.combo.isViewVisible()) {
@ -83335,7 +83418,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
this.popup = BI.createWidget({
type: "bi.multidate_popup",
min: this.constants.DATE_MIN_VALUE,
max: this.constants.DATE_MAX_VALUE
max: this.constants.DATE_MAX_VALUE,
value: opts.value
});
this.popup.on(BI.MultiDatePopup.BUTTON_CLEAR_EVENT_CHANGE, function () {
self.setValue();
@ -83429,6 +83513,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
self.comboWrapper = _ref;
}
});
this._checkDynamicValue(opts.value);
},
_checkDynamicValue: function (v) {
@ -83826,6 +83912,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
height: 30
}]
});
this.setValue(opts.value);
},
_setInnerValue: function (obj) {
if (this.dateTab.getSelect() === BI.MultiDateCombo.MULTI_DATE_YMD_CARD) {
@ -89598,6 +89685,8 @@ BI.NumberInterval = BI.inherit(BI.Single, {
self._setComboValueChangedEvent(self.smallCombo);
self._setEditorValueChangedEvent(self.bigEditor);
self._setEditorValueChangedEvent(self.smallEditor);
this.setValue(o.value);
},
_checkValidation: function () {
@ -91090,7 +91179,8 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.storeValue = "";
this.trigger = BI.createWidget({
type: "bi.quarter_trigger"
type: "bi.quarter_trigger",
value: o.value
});
this.trigger.on(BI.QuarterTrigger.EVENT_FOCUS, function () {
@ -91117,7 +91207,8 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
});
this.popup = BI.createWidget({
type: "bi.quarter_popup",
behaviors: o.behaviors
behaviors: o.behaviors,
value: o.value
});
this.popup.on(BI.QuarterPopup.EVENT_CHANGE, function () {
@ -91175,7 +91266,7 @@ BI.QuarterPopup = BI.inherit(BI.Widget, {
var self = this, o = this.options;
var items = [{
text: Date._QN[01],
text: Date._QN[1],
value: 1
}, {
text: Date._QN[2],
@ -91206,7 +91297,8 @@ BI.QuarterPopup = BI.inherit(BI.Widget, {
items: BI.createItems(items, {}),
layouts: [{
type: "bi.vertical"
}]
}],
value: o.value
});
this.quarter.on(BI.Controller.EVENT_CHANGE, function (type) {
@ -91313,6 +91405,7 @@ BI.QuarterTrigger = BI.inherit(BI.Trigger, {
}
]
});
this.setValue(o.value);
},
setValue: function (v) {
@ -97044,11 +97137,12 @@ BI.TimeInterval = BI.inherit(BI.Single, {
});
},
_init: function () {
var self = this;
var self = this, o = this.options;
BI.TimeInterval.superclass._init.apply(this, arguments);
this.left = this._createCombo();
this.right = this._createCombo();
o.value = o.value || {};
this.left = this._createCombo(o.value.start);
this.right = this._createCombo(o.value.end);
this.label = BI.createWidget({
type: "bi.label",
height: this.constants.height,
@ -97089,10 +97183,11 @@ BI.TimeInterval = BI.inherit(BI.Single, {
});
},
_createCombo: function () {
_createCombo: function (v) {
var self = this;
var combo = BI.createWidget({
type: "bi.multidate_combo"
type: "bi.multidate_combo",
value: v
});
combo.on(BI.MultiDateCombo.EVENT_ERROR, function () {
self._clearTitle();
@ -97236,7 +97331,8 @@ BI.YearCombo = BI.inherit(BI.Widget, {
this.trigger = BI.createWidget({
type: "bi.year_trigger",
min: o.min,
max: o.max
max: o.max,
value: o.value || ""
});
this.trigger.on(BI.YearTrigger.EVENT_FOCUS, function () {
self.storeValue = this.getKey();
@ -97288,7 +97384,8 @@ BI.YearCombo = BI.inherit(BI.Widget, {
behaviors: o.behaviors,
min: o.min,
max: o.max
}
},
value: o.value || ""
}
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
@ -97351,7 +97448,7 @@ BI.YearPopup = BI.inherit(BI.Widget, {
_init: function () {
BI.YearPopup.superclass._init.apply(this, arguments);
var self = this;
var self = this, o = this.options;
this.selectedYear = this._year = Date.getDate().getFullYear();
@ -97398,6 +97495,10 @@ BI.YearPopup = BI.inherit(BI.Widget, {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
self.fireEvent(BI.YearPopup.EVENT_CHANGE, self.selectedYear);
});
if(BI.isKey(o.value)){
this.setValue(o.value);
}
},
getValue: function () {
@ -97458,7 +97559,8 @@ BI.YearTrigger = BI.inherit(BI.Trigger, {
hgap: c.hgap,
vgap: c.vgap,
allowBlank: true,
errorText: c.errorText
errorText: c.errorText,
value: o.value
});
this.editor.on(BI.SignEditor.EVENT_FOCUS, function () {
self.fireEvent(BI.YearTrigger.EVENT_FOCUS);
@ -97542,14 +97644,18 @@ BI.YearMonthCombo = BI.inherit(BI.Widget, {
BI.YearMonthCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
o.value = o.value || {};
this.year = BI.createWidget({
type: "bi.year_combo",
behaviors: o.yearBehaviors
behaviors: o.yearBehaviors,
value: o.value.year
});
this.month = BI.createWidget({
type: "bi.month_combo",
behaviors: o.monthBehaviors
behaviors: o.monthBehaviors,
value: o.value.month
});
this.year.on(BI.YearCombo.EVENT_CONFIRM, function () {
@ -97609,14 +97715,18 @@ BI.YearQuarterCombo = BI.inherit(BI.Widget, {
BI.YearQuarterCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
o.value = o.value || {};
this.year = BI.createWidget({
type: "bi.year_combo",
behaviors: o.yearBehaviors
behaviors: o.yearBehaviors,
value: o.value.year
});
this.quarter = BI.createWidget({
type: "bi.quarter_combo",
behaviors: o.quarterBehaviors
behaviors: o.quarterBehaviors,
value: o.value.quarter
});
this.year.on(BI.YearCombo.EVENT_CONFIRM, function () {

12
dist/case.js vendored

@ -5474,15 +5474,14 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, {
return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this, arguments), {
baseClass: "bi-icon-text-value-combo",
height: 30,
value: "",
el: {}
value: ""
});
},
_init: function () {
BI.IconTextValueCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(o.el, {
this.trigger = BI.createWidget({
type: "bi.select_icon_text_trigger",
items: o.items,
height: o.height,
@ -5679,7 +5678,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, {
_init: function () {
BI.TextValueCheckCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(o.el, {
this.trigger = BI.createWidget({
type: "bi.select_text_trigger",
items: o.items,
height: o.height,
@ -5877,15 +5876,14 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
height: 30,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
text: "",
value: "",
el: {}
value: ""
});
},
_init: function () {
BI.TextValueCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(o.el, {
this.trigger = BI.createWidget({
type: "bi.select_text_trigger",
items: o.items,
height: o.height,

82
dist/core.js vendored

@ -21315,7 +21315,46 @@ Date.parseDateTime = function (str, fmt) {
};
Date.getDate = function () {
var dt = new (Function.prototype.bind.apply(Date, BI.concat([null], [].slice.apply(arguments))))();
var length = arguments.length;
var args = arguments;
var dt;
switch (length) {
// new Date()
case 0:
dt = new Date();
break;
// new Date(long)
case 1:
dt = new Date(args[0]);
break;
// new Date(year, month)
case 2:
dt = new Date(args[0], args[1]);
break;
// new Date(year, month, day)
case 3:
dt = new Date(args[0], args[1], args[2]);
break;
// new Date(year, month, day, hour)
case 4:
dt = new Date(args[0], args[1], args[2], args[3]);
break;
// new Date(year, month, day, hour, minute)
case 5:
dt = new Date(args[0], args[1], args[2], args[3], args[4]);
break;
// new Date(year, month, day, hour, minute, second)
case 6:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5]);
break;
// new Date(year, month, day, hour, minute, second, millisecond)
case 7:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
break;
default:
dt = new Date();
break;
}
if(BI.isNotNull(Date.timeZone) && (arguments.length === 0 || (arguments.length === 1 && BI.isNumber(arguments[0])))) {
var localTime = dt.getTime();
var localOffset = dt.getTimezoneOffset() * 60000; // 获得当地时间偏移的毫秒数
@ -21327,7 +21366,46 @@ Date.getDate = function () {
};
Date.getTime = function () {
var dt = Function.prototype.bind.apply(Date.getDate, BI.concat([null], [].slice.apply(arguments)))();
var length = arguments.length;
var args = arguments;
var dt;
switch (length) {
// new Date()
case 0:
dt = new Date();
break;
// new Date(long)
case 1:
dt = new Date(args[0]);
break;
// new Date(year, month)
case 2:
dt = new Date(args[0], args[1]);
break;
// new Date(year, month, day)
case 3:
dt = new Date(args[0], args[1], args[2]);
break;
// new Date(year, month, day, hour)
case 4:
dt = new Date(args[0], args[1], args[2], args[3]);
break;
// new Date(year, month, day, hour, minute)
case 5:
dt = new Date(args[0], args[1], args[2], args[3], args[4]);
break;
// new Date(year, month, day, hour, minute, second)
case 6:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5]);
break;
// new Date(year, month, day, hour, minute, second, millisecond)
case 7:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
break;
default:
dt = new Date();
break;
}
if(BI.isNotNull(Date.timeZone)) {
return dt.getTime() - Date.timeZone - dt.getTimezoneOffset() * 60000;
}

340
dist/demo.js vendored

@ -12232,7 +12232,7 @@ BI.shortcut("demo.tips", Demo.Tips);Demo.DatePane = BI.inherit(BI.Widget, {
type: "bi.date_pane",
selectedTime: {
year: 2017,
month: 12,
month: 11,
day: 11
},
ref: function (_ref) {
@ -12289,7 +12289,12 @@ Demo.Date = BI.inherit(BI.Widget, {
ref: function () {
self.datecombo = this;
},
width: 300
width: 300,
value: {
year: 2018,
month: 1,
day: 23
}
}, {
type: "bi.button",
text: "getVlaue",
@ -12381,119 +12386,6 @@ BICst.CONF.GROUP.NUMBER.WEEKDAY = 21;
BICst.CONF.GROUP.NUMBER.RENAME = 22;
BICst.CONF.GROUP.NUMBER.DELETE = 23;
// 数值字段汇总设置
var items = [[{
text: BI.i18nText("BI-Basic_Qiu_Sum"),
value: BICst.CONF.GROUP.NUMBER.SUM,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Avg"),
value: BICst.CONF.GROUP.NUMBER.AVG,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Median"),
value: BICst.CONF.GROUP.NUMBER.MEDIAN,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Max"),
value: BICst.CONF.GROUP.NUMBER.MAX,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Min"),
value: BICst.CONF.GROUP.NUMBER.MIN,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Standard_Deviation"),
value: BICst.CONF.GROUP.NUMBER.STANDARD_DEVIATION,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Variance"),
value: BICst.CONF.GROUP.NUMBER.VARIANCE,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_No_Repeat_Count"),
value: BICst.CONF.GROUP.NUMBER.COUNT,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Record_Count"),
value: BICst.CONF.GROUP.NUMBER.RECORD_COUNT,
cls: "dot-ha-font"
}], [{
text: BI.i18nText("BI-Basic_None"),
value: BICst.CONF.GROUP.NUMBER.NONE,
cls: "dot-ha-font"
}, {
el: {
text: BI.i18nText("BI-Basic_Qiu_Same_Period"),
value: BICst.CONF.GROUP.NUMBER.PERIOD,
cls: "dot-ha-font"
},
children: [{
text: BI.i18nText("BI-Basic_Multi_Date_Year"),
value: BICst.CONF.GROUP.NUMBER.YEAR,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Quarter"),
value: BICst.CONF.GROUP.NUMBER.QUARTER,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Multi_Date_Month"),
value: BICst.CONF.GROUP.NUMBER.MONTH,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Multi_Date_Week"),
value: BICst.CONF.GROUP.NUMBER.WEEK,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Week_XingQi"),
value: BICst.CONF.GROUP.NUMBER.WEEKDAY,
cls: "dot-ha-font"
}]
}, {
text: BI.i18nText("BI-Basic_Qiu_Same_Ring"),
value: BICst.CONF.GROUP.NUMBER.RING,
cls: "dot-ha-font"
}, {
el: {
text: BI.i18nText("BI-Basic_Qiu_Same_Period_Rate"),
value: BICst.CONF.GROUP.NUMBER.PERIOD_RATE,
cls: "dot-ha-font"
},
children: [{
text: BI.i18nText("BI-Basic_Multi_Date_Year"),
value: BICst.CONF.GROUP.NUMBER.YEAR,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Quarter"),
value: BICst.CONF.GROUP.NUMBER.QUARTER,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Multi_Date_Month"),
value: BICst.CONF.GROUP.NUMBER.MONTH,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Multi_Date_Week"),
value: BICst.CONF.GROUP.NUMBER.WEEK,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Week_XingQi"),
value: BICst.CONF.GROUP.NUMBER.WEEKDAY,
cls: "dot-ha-font"
}]
}, {
text: BI.i18nText("BI-Basic_Qiu_Same_Ring_Rate"),
value: BICst.CONF.GROUP.NUMBER.RING_RATE,
cls: "dot-ha-font"
}], [{
text: BI.i18nText("BI-Basic_Rename"),
value: BICst.CONF.GROUP.NUMBER.RENAME,
cls: "widget-combo-rename-edit-font"
}], [{
text: BI.i18nText("BI-Basic_Remove"),
value: BICst.CONF.GROUP.NUMBER.DELETE,
cls: "delete-h-font"
}]];
Demo.Downlist = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-downlist"
@ -12522,98 +12414,97 @@ Demo.Downlist = BI.inherit(BI.Widget, {
self.downlist = _ref;
},
cls: "layout-bg3",
//value: [{"childValue":22,"value":11},{"value":18},{"value":20}],
value: [{"childValue":22,"value":11},{"value":18},{"value":20}],
height: 30,
width: 100,
items: items
// items: [
// [{
// el: {
// text: "column 1111",
// iconCls1: "check-mark-e-font",
// value: 11
// },
// children: [{
// text: "column 1.1",
// value: 21,
// cls: "dot-e-font"
// }, {
// text: "column 1.222222222222222222222222222222222222",
// cls: "dot-e-font",
// value: 22
// }]
// }],
// [{
// el: {
// type: "bi.icon_text_icon_item",
// text: "column 2",
// iconCls1: "chart-type-e-font",
// cls: "dot-e-font",
// value: 12
// },
// disabled: true,
// children: [{
// type: "bi.icon_text_item",
// cls: "dot-e-font",
// height: 25,
// text: "column 2.1",
// value: 11
// }, {
// text: "column 2.2",
// value: 12,
// cls: "dot-e-font"
// }]
// }],
// [{
// text: "column 8",
// value: 18,
// cls: "dot-e-font"
// },
// {
//
// text: "column 9",
// cls: "dot-e-font",
// value: 19
// }
// ],
// [{
// text: "column 10",
// value: 20,
// cls: "dot-e-font"
// },
// {
//
// text: "column 11",
// cls: "dot-e-font",
// value: 21
// },
// {
//
// text: "column 12",
// cls: "dot-e-font",
// value: 22
// },
// {
//
// text: "column 13",
// cls: "dot-e-font",
// value: 23
// },
// {
//
// text: "column 14",
// cls: "dot-e-font",
// value: 24
// },
// {
//
// text: "column 15",
// cls: "dot-e-font",
// value: 23
// }
// ]
//
// ]
items: [
[{
el: {
text: "column 1111",
iconCls1: "check-mark-e-font",
value: 11
},
children: [{
text: "column 1.1",
value: 21,
cls: "dot-e-font"
}, {
text: "column 1.222222222222222222222222222222222222",
cls: "dot-e-font",
value: 22
}]
}],
[{
el: {
type: "bi.icon_text_icon_item",
text: "column 2",
iconCls1: "chart-type-e-font",
cls: "dot-e-font",
value: 12
},
disabled: true,
children: [{
type: "bi.icon_text_item",
cls: "dot-e-font",
height: 25,
text: "column 2.1",
value: 11
}, {
text: "column 2.2",
value: 12,
cls: "dot-e-font"
}]
}],
[{
text: "column 8",
value: 18,
cls: "dot-e-font"
},
{
text: "column 9",
cls: "dot-e-font",
value: 19
}
],
[{
text: "column 10",
value: 20,
cls: "dot-e-font"
},
{
text: "column 11",
cls: "dot-e-font",
value: 21
},
{
text: "column 12",
cls: "dot-e-font",
value: 22
},
{
text: "column 13",
cls: "dot-e-font",
value: 23
},
{
text: "column 14",
cls: "dot-e-font",
value: 24
},
{
text: "column 15",
cls: "dot-e-font",
value: 23
}
]
]
}, {
type: "bi.label",
text: "显示选择值",
@ -12752,7 +12643,8 @@ Demo.Month = BI.inherit(BI.Widget, {
width: 300,
ref: function () {
self.monthcombo = this;
}
},
value: 11
}, {
type: "bi.button",
text: "getValue",
@ -12979,7 +12871,12 @@ Demo.NumericalInterval = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.numerical = _ref;
},
width: 500
width: 500,
value: {
max: 300,
closeMax: true,
closeMin: false
}
}, {
type: "bi.label",
ref: function (_ref) {
@ -13260,7 +13157,8 @@ Demo.Quarter = BI.inherit(BI.Widget, {
width: 300,
ref: function () {
self.quartercombo = this;
}
},
value: 3
}, {
type: "bi.button",
text: "getValue",
@ -14518,6 +14416,17 @@ Demo.TimeInterval = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.interval = _ref;
},
value: {
start: {
type: 1,
value: 2
},
end: {
year: 2018,
month: 0,
day: 12
}
},
width: 300
}, {
type: "bi.button",
@ -14788,7 +14697,8 @@ Demo.Year = BI.inherit(BI.Widget, {
width: 300,
ref: function () {
self.yearcombo = this;
}
},
value: 2017
}, {
type: "bi.button",
text: "getValue",
@ -14826,7 +14736,11 @@ Demo.YearMonthCombo = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.widget = _ref;
},
width: 300
width: 300,
value:{
year: 2018,
month: 0
}
}, {
type: "bi.button",
text: "getValue",
@ -14868,7 +14782,11 @@ Demo.YearQuarterCombo = BI.inherit(BI.Widget, {
self.widget = _ref;
},
yearBehaviors: {},
quarterBehaviors: {}
quarterBehaviors: {},
value: {
year: 2018,
quarter: 1
}
}, {
type: "bi.button",
text: "getValue",

204
dist/fineui.js vendored

@ -106,7 +106,35 @@ window.console = window.console || (function () {
};
return c;
})();
/*
if (!Function.prototype.bind) {
Function.prototype.bind = function(oThis) {
if (typeof this !== 'function') {
// closest thing possible to the ECMAScript 5
// internal IsCallable function
throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
}
var aArgs = Array.prototype.slice.call(arguments, 1),
fToBind = this,
fNOP = function() {},
fBound = function() {
return fToBind.apply(this instanceof fNOP
? this
: oThis,
// 获取调用时(fBound)的传参.bind 返回的函数入参往往是这么传递的
aArgs.concat(Array.prototype.slice.call(arguments)));
};
// 维护原型关系
if (this.prototype) {
// Function.prototype doesn't have a prototype property
fNOP.prototype = this.prototype;
}
fBound.prototype = new fNOP();
return fBound;
};
}/*
* 前端缓存
*/
window.localStorage || (window.localStorage = {
@ -21488,7 +21516,46 @@ Date.parseDateTime = function (str, fmt) {
};
Date.getDate = function () {
var dt = new (Function.prototype.bind.apply(Date, BI.concat([null], [].slice.apply(arguments))))();
var length = arguments.length;
var args = arguments;
var dt;
switch (length) {
// new Date()
case 0:
dt = new Date();
break;
// new Date(long)
case 1:
dt = new Date(args[0]);
break;
// new Date(year, month)
case 2:
dt = new Date(args[0], args[1]);
break;
// new Date(year, month, day)
case 3:
dt = new Date(args[0], args[1], args[2]);
break;
// new Date(year, month, day, hour)
case 4:
dt = new Date(args[0], args[1], args[2], args[3]);
break;
// new Date(year, month, day, hour, minute)
case 5:
dt = new Date(args[0], args[1], args[2], args[3], args[4]);
break;
// new Date(year, month, day, hour, minute, second)
case 6:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5]);
break;
// new Date(year, month, day, hour, minute, second, millisecond)
case 7:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
break;
default:
dt = new Date();
break;
}
if(BI.isNotNull(Date.timeZone) && (arguments.length === 0 || (arguments.length === 1 && BI.isNumber(arguments[0])))) {
var localTime = dt.getTime();
var localOffset = dt.getTimezoneOffset() * 60000; // 获得当地时间偏移的毫秒数
@ -21500,7 +21567,46 @@ Date.getDate = function () {
};
Date.getTime = function () {
var dt = Function.prototype.bind.apply(Date.getDate, BI.concat([null], [].slice.apply(arguments)))();
var length = arguments.length;
var args = arguments;
var dt;
switch (length) {
// new Date()
case 0:
dt = new Date();
break;
// new Date(long)
case 1:
dt = new Date(args[0]);
break;
// new Date(year, month)
case 2:
dt = new Date(args[0], args[1]);
break;
// new Date(year, month, day)
case 3:
dt = new Date(args[0], args[1], args[2]);
break;
// new Date(year, month, day, hour)
case 4:
dt = new Date(args[0], args[1], args[2], args[3]);
break;
// new Date(year, month, day, hour, minute)
case 5:
dt = new Date(args[0], args[1], args[2], args[3], args[4]);
break;
// new Date(year, month, day, hour, minute, second)
case 6:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5]);
break;
// new Date(year, month, day, hour, minute, second, millisecond)
case 7:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
break;
default:
dt = new Date();
break;
}
if(BI.isNotNull(Date.timeZone)) {
return dt.getTime() - Date.timeZone - dt.getTimezoneOffset() * 60000;
}
@ -69537,15 +69643,14 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, {
return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this, arguments), {
baseClass: "bi-icon-text-value-combo",
height: 30,
value: "",
el: {}
value: ""
});
},
_init: function () {
BI.IconTextValueCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(o.el, {
this.trigger = BI.createWidget({
type: "bi.select_icon_text_trigger",
items: o.items,
height: o.height,
@ -69742,7 +69847,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, {
_init: function () {
BI.TextValueCheckCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(o.el, {
this.trigger = BI.createWidget({
type: "bi.select_text_trigger",
items: o.items,
height: o.height,
@ -69940,15 +70045,14 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
height: 30,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
text: "",
value: "",
el: {}
value: ""
});
},
_init: function () {
BI.TextValueCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(o.el, {
this.trigger = BI.createWidget({
type: "bi.select_text_trigger",
items: o.items,
height: o.height,
@ -80559,6 +80663,7 @@ BI.shortcut("bi.date_combo", BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
el: this.editor
}]
});
this.setValue(o.value);
},
_dateCheck: function (date) {
return Date.parseDateTime(date, "%Y-%x-%d").print("%Y-%x-%d") == date || Date.parseDateTime(date, "%Y-%X-%d").print("%Y-%X-%d") == date || Date.parseDateTime(date, "%Y-%x-%e").print("%Y-%x-%e") == date || Date.parseDateTime(date, "%Y-%X-%e").print("%Y-%X-%e") == date;
@ -80835,6 +80940,7 @@ BI.DatePaneWidget = BI.inherit(BI.Widget, {
self.setValue(self.selectedTime);
self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE);
});
this.setValue(o.selectedTime);
},
@ -84572,7 +84678,8 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.month_trigger"
type: "bi.month_trigger",
value: o.value
});
this.trigger.on(BI.MonthTrigger.EVENT_CONFIRM, function (v) {
@ -84600,7 +84707,8 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
this.popup = BI.createWidget({
type: "bi.month_popup",
behaviors: o.behaviors
behaviors: o.behaviors,
value: o.value
});
this.popup.on(BI.MonthPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
@ -84698,7 +84806,8 @@ BI.MonthPopup = BI.inherit(BI.Widget, {
type: "bi.center_adapt",
vgap: 1,
hgap: 2
}]
}],
value: o.value
});
this.month.on(BI.Controller.EVENT_CHANGE, function (type) {
@ -84803,6 +84912,7 @@ BI.MonthTrigger = BI.inherit(BI.Trigger, {
}
]
});
this.setValue(o.value);
},
setValue: function (v) {
if(BI.isNotNull(v)) {
@ -85003,11 +85113,12 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
var self = this, opts = this.options;
this.storeTriggerValue = "";
var date = Date.getDate();
this.storeValue = null;
this.storeValue = opts.value;
this.trigger = BI.createWidget({
type: "bi.date_trigger",
min: this.constants.DATE_MIN_VALUE,
max: this.constants.DATE_MAX_VALUE
max: this.constants.DATE_MAX_VALUE,
value: opts.value
});
this.trigger.on(BI.DateTrigger.EVENT_KEY_DOWN, function () {
if (self.combo.isViewVisible()) {
@ -85061,7 +85172,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
this.popup = BI.createWidget({
type: "bi.multidate_popup",
min: this.constants.DATE_MIN_VALUE,
max: this.constants.DATE_MAX_VALUE
max: this.constants.DATE_MAX_VALUE,
value: opts.value
});
this.popup.on(BI.MultiDatePopup.BUTTON_CLEAR_EVENT_CHANGE, function () {
self.setValue();
@ -85155,6 +85267,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
self.comboWrapper = _ref;
}
});
this._checkDynamicValue(opts.value);
},
_checkDynamicValue: function (v) {
@ -85552,6 +85666,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
height: 30
}]
});
this.setValue(opts.value);
},
_setInnerValue: function (obj) {
if (this.dateTab.getSelect() === BI.MultiDateCombo.MULTI_DATE_YMD_CARD) {
@ -91324,6 +91439,8 @@ BI.NumberInterval = BI.inherit(BI.Single, {
self._setComboValueChangedEvent(self.smallCombo);
self._setEditorValueChangedEvent(self.bigEditor);
self._setEditorValueChangedEvent(self.smallEditor);
this.setValue(o.value);
},
_checkValidation: function () {
@ -92816,7 +92933,8 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.storeValue = "";
this.trigger = BI.createWidget({
type: "bi.quarter_trigger"
type: "bi.quarter_trigger",
value: o.value
});
this.trigger.on(BI.QuarterTrigger.EVENT_FOCUS, function () {
@ -92843,7 +92961,8 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
});
this.popup = BI.createWidget({
type: "bi.quarter_popup",
behaviors: o.behaviors
behaviors: o.behaviors,
value: o.value
});
this.popup.on(BI.QuarterPopup.EVENT_CHANGE, function () {
@ -92901,7 +93020,7 @@ BI.QuarterPopup = BI.inherit(BI.Widget, {
var self = this, o = this.options;
var items = [{
text: Date._QN[01],
text: Date._QN[1],
value: 1
}, {
text: Date._QN[2],
@ -92932,7 +93051,8 @@ BI.QuarterPopup = BI.inherit(BI.Widget, {
items: BI.createItems(items, {}),
layouts: [{
type: "bi.vertical"
}]
}],
value: o.value
});
this.quarter.on(BI.Controller.EVENT_CHANGE, function (type) {
@ -93039,6 +93159,7 @@ BI.QuarterTrigger = BI.inherit(BI.Trigger, {
}
]
});
this.setValue(o.value);
},
setValue: function (v) {
@ -98770,11 +98891,12 @@ BI.TimeInterval = BI.inherit(BI.Single, {
});
},
_init: function () {
var self = this;
var self = this, o = this.options;
BI.TimeInterval.superclass._init.apply(this, arguments);
this.left = this._createCombo();
this.right = this._createCombo();
o.value = o.value || {};
this.left = this._createCombo(o.value.start);
this.right = this._createCombo(o.value.end);
this.label = BI.createWidget({
type: "bi.label",
height: this.constants.height,
@ -98815,10 +98937,11 @@ BI.TimeInterval = BI.inherit(BI.Single, {
});
},
_createCombo: function () {
_createCombo: function (v) {
var self = this;
var combo = BI.createWidget({
type: "bi.multidate_combo"
type: "bi.multidate_combo",
value: v
});
combo.on(BI.MultiDateCombo.EVENT_ERROR, function () {
self._clearTitle();
@ -98962,7 +99085,8 @@ BI.YearCombo = BI.inherit(BI.Widget, {
this.trigger = BI.createWidget({
type: "bi.year_trigger",
min: o.min,
max: o.max
max: o.max,
value: o.value || ""
});
this.trigger.on(BI.YearTrigger.EVENT_FOCUS, function () {
self.storeValue = this.getKey();
@ -99014,7 +99138,8 @@ BI.YearCombo = BI.inherit(BI.Widget, {
behaviors: o.behaviors,
min: o.min,
max: o.max
}
},
value: o.value || ""
}
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
@ -99077,7 +99202,7 @@ BI.YearPopup = BI.inherit(BI.Widget, {
_init: function () {
BI.YearPopup.superclass._init.apply(this, arguments);
var self = this;
var self = this, o = this.options;
this.selectedYear = this._year = Date.getDate().getFullYear();
@ -99124,6 +99249,10 @@ BI.YearPopup = BI.inherit(BI.Widget, {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
self.fireEvent(BI.YearPopup.EVENT_CHANGE, self.selectedYear);
});
if(BI.isKey(o.value)){
this.setValue(o.value);
}
},
getValue: function () {
@ -99184,7 +99313,8 @@ BI.YearTrigger = BI.inherit(BI.Trigger, {
hgap: c.hgap,
vgap: c.vgap,
allowBlank: true,
errorText: c.errorText
errorText: c.errorText,
value: o.value
});
this.editor.on(BI.SignEditor.EVENT_FOCUS, function () {
self.fireEvent(BI.YearTrigger.EVENT_FOCUS);
@ -99268,14 +99398,18 @@ BI.YearMonthCombo = BI.inherit(BI.Widget, {
BI.YearMonthCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
o.value = o.value || {};
this.year = BI.createWidget({
type: "bi.year_combo",
behaviors: o.yearBehaviors
behaviors: o.yearBehaviors,
value: o.value.year
});
this.month = BI.createWidget({
type: "bi.month_combo",
behaviors: o.monthBehaviors
behaviors: o.monthBehaviors,
value: o.value.month
});
this.year.on(BI.YearCombo.EVENT_CONFIRM, function () {
@ -99335,14 +99469,18 @@ BI.YearQuarterCombo = BI.inherit(BI.Widget, {
BI.YearQuarterCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
o.value = o.value || {};
this.year = BI.createWidget({
type: "bi.year_combo",
behaviors: o.yearBehaviors
behaviors: o.yearBehaviors,
value: o.value.year
});
this.quarter = BI.createWidget({
type: "bi.quarter_combo",
behaviors: o.quarterBehaviors
behaviors: o.quarterBehaviors,
value: o.value.quarter
});
this.year.on(BI.YearCombo.EVENT_CONFIRM, function () {

30
dist/polyfill.js vendored

@ -106,7 +106,35 @@ window.console = window.console || (function () {
};
return c;
})();
/*
if (!Function.prototype.bind) {
Function.prototype.bind = function(oThis) {
if (typeof this !== 'function') {
// closest thing possible to the ECMAScript 5
// internal IsCallable function
throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
}
var aArgs = Array.prototype.slice.call(arguments, 1),
fToBind = this,
fNOP = function() {},
fBound = function() {
return fToBind.apply(this instanceof fNOP
? this
: oThis,
// 获取调用时(fBound)的传参.bind 返回的函数入参往往是这么传递的
aArgs.concat(Array.prototype.slice.call(arguments)));
};
// 维护原型关系
if (this.prototype) {
// Function.prototype doesn't have a prototype property
fNOP.prototype = this.prototype;
}
fBound.prototype = new fNOP();
return fBound;
};
}/*
* 前端缓存
*/
window.localStorage || (window.localStorage = {

80
dist/widget.js vendored

@ -2399,6 +2399,7 @@ BI.shortcut("bi.date_combo", BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
el: this.editor
}]
});
this.setValue(o.value);
},
_dateCheck: function (date) {
return Date.parseDateTime(date, "%Y-%x-%d").print("%Y-%x-%d") == date || Date.parseDateTime(date, "%Y-%X-%d").print("%Y-%X-%d") == date || Date.parseDateTime(date, "%Y-%x-%e").print("%Y-%x-%e") == date || Date.parseDateTime(date, "%Y-%X-%e").print("%Y-%X-%e") == date;
@ -2675,6 +2676,7 @@ BI.DatePaneWidget = BI.inherit(BI.Widget, {
self.setValue(self.selectedTime);
self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE);
});
this.setValue(o.selectedTime);
},
@ -6412,7 +6414,8 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.month_trigger"
type: "bi.month_trigger",
value: o.value
});
this.trigger.on(BI.MonthTrigger.EVENT_CONFIRM, function (v) {
@ -6440,7 +6443,8 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
this.popup = BI.createWidget({
type: "bi.month_popup",
behaviors: o.behaviors
behaviors: o.behaviors,
value: o.value
});
this.popup.on(BI.MonthPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
@ -6538,7 +6542,8 @@ BI.MonthPopup = BI.inherit(BI.Widget, {
type: "bi.center_adapt",
vgap: 1,
hgap: 2
}]
}],
value: o.value
});
this.month.on(BI.Controller.EVENT_CHANGE, function (type) {
@ -6643,6 +6648,7 @@ BI.MonthTrigger = BI.inherit(BI.Trigger, {
}
]
});
this.setValue(o.value);
},
setValue: function (v) {
if(BI.isNotNull(v)) {
@ -6843,11 +6849,12 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
var self = this, opts = this.options;
this.storeTriggerValue = "";
var date = Date.getDate();
this.storeValue = null;
this.storeValue = opts.value;
this.trigger = BI.createWidget({
type: "bi.date_trigger",
min: this.constants.DATE_MIN_VALUE,
max: this.constants.DATE_MAX_VALUE
max: this.constants.DATE_MAX_VALUE,
value: opts.value
});
this.trigger.on(BI.DateTrigger.EVENT_KEY_DOWN, function () {
if (self.combo.isViewVisible()) {
@ -6901,7 +6908,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
this.popup = BI.createWidget({
type: "bi.multidate_popup",
min: this.constants.DATE_MIN_VALUE,
max: this.constants.DATE_MAX_VALUE
max: this.constants.DATE_MAX_VALUE,
value: opts.value
});
this.popup.on(BI.MultiDatePopup.BUTTON_CLEAR_EVENT_CHANGE, function () {
self.setValue();
@ -6995,6 +7003,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
self.comboWrapper = _ref;
}
});
this._checkDynamicValue(opts.value);
},
_checkDynamicValue: function (v) {
@ -7392,6 +7402,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
height: 30
}]
});
this.setValue(opts.value);
},
_setInnerValue: function (obj) {
if (this.dateTab.getSelect() === BI.MultiDateCombo.MULTI_DATE_YMD_CARD) {
@ -13164,6 +13175,8 @@ BI.NumberInterval = BI.inherit(BI.Single, {
self._setComboValueChangedEvent(self.smallCombo);
self._setEditorValueChangedEvent(self.bigEditor);
self._setEditorValueChangedEvent(self.smallEditor);
this.setValue(o.value);
},
_checkValidation: function () {
@ -14656,7 +14669,8 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.storeValue = "";
this.trigger = BI.createWidget({
type: "bi.quarter_trigger"
type: "bi.quarter_trigger",
value: o.value
});
this.trigger.on(BI.QuarterTrigger.EVENT_FOCUS, function () {
@ -14683,7 +14697,8 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
});
this.popup = BI.createWidget({
type: "bi.quarter_popup",
behaviors: o.behaviors
behaviors: o.behaviors,
value: o.value
});
this.popup.on(BI.QuarterPopup.EVENT_CHANGE, function () {
@ -14741,7 +14756,7 @@ BI.QuarterPopup = BI.inherit(BI.Widget, {
var self = this, o = this.options;
var items = [{
text: Date._QN[01],
text: Date._QN[1],
value: 1
}, {
text: Date._QN[2],
@ -14772,7 +14787,8 @@ BI.QuarterPopup = BI.inherit(BI.Widget, {
items: BI.createItems(items, {}),
layouts: [{
type: "bi.vertical"
}]
}],
value: o.value
});
this.quarter.on(BI.Controller.EVENT_CHANGE, function (type) {
@ -14879,6 +14895,7 @@ BI.QuarterTrigger = BI.inherit(BI.Trigger, {
}
]
});
this.setValue(o.value);
},
setValue: function (v) {
@ -20610,11 +20627,12 @@ BI.TimeInterval = BI.inherit(BI.Single, {
});
},
_init: function () {
var self = this;
var self = this, o = this.options;
BI.TimeInterval.superclass._init.apply(this, arguments);
this.left = this._createCombo();
this.right = this._createCombo();
o.value = o.value || {};
this.left = this._createCombo(o.value.start);
this.right = this._createCombo(o.value.end);
this.label = BI.createWidget({
type: "bi.label",
height: this.constants.height,
@ -20655,10 +20673,11 @@ BI.TimeInterval = BI.inherit(BI.Single, {
});
},
_createCombo: function () {
_createCombo: function (v) {
var self = this;
var combo = BI.createWidget({
type: "bi.multidate_combo"
type: "bi.multidate_combo",
value: v
});
combo.on(BI.MultiDateCombo.EVENT_ERROR, function () {
self._clearTitle();
@ -20802,7 +20821,8 @@ BI.YearCombo = BI.inherit(BI.Widget, {
this.trigger = BI.createWidget({
type: "bi.year_trigger",
min: o.min,
max: o.max
max: o.max,
value: o.value || ""
});
this.trigger.on(BI.YearTrigger.EVENT_FOCUS, function () {
self.storeValue = this.getKey();
@ -20854,7 +20874,8 @@ BI.YearCombo = BI.inherit(BI.Widget, {
behaviors: o.behaviors,
min: o.min,
max: o.max
}
},
value: o.value || ""
}
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
@ -20917,7 +20938,7 @@ BI.YearPopup = BI.inherit(BI.Widget, {
_init: function () {
BI.YearPopup.superclass._init.apply(this, arguments);
var self = this;
var self = this, o = this.options;
this.selectedYear = this._year = Date.getDate().getFullYear();
@ -20964,6 +20985,10 @@ BI.YearPopup = BI.inherit(BI.Widget, {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
self.fireEvent(BI.YearPopup.EVENT_CHANGE, self.selectedYear);
});
if(BI.isKey(o.value)){
this.setValue(o.value);
}
},
getValue: function () {
@ -21024,7 +21049,8 @@ BI.YearTrigger = BI.inherit(BI.Trigger, {
hgap: c.hgap,
vgap: c.vgap,
allowBlank: true,
errorText: c.errorText
errorText: c.errorText,
value: o.value
});
this.editor.on(BI.SignEditor.EVENT_FOCUS, function () {
self.fireEvent(BI.YearTrigger.EVENT_FOCUS);
@ -21108,14 +21134,18 @@ BI.YearMonthCombo = BI.inherit(BI.Widget, {
BI.YearMonthCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
o.value = o.value || {};
this.year = BI.createWidget({
type: "bi.year_combo",
behaviors: o.yearBehaviors
behaviors: o.yearBehaviors,
value: o.value.year
});
this.month = BI.createWidget({
type: "bi.month_combo",
behaviors: o.monthBehaviors
behaviors: o.monthBehaviors,
value: o.value.month
});
this.year.on(BI.YearCombo.EVENT_CONFIRM, function () {
@ -21175,14 +21205,18 @@ BI.YearQuarterCombo = BI.inherit(BI.Widget, {
BI.YearQuarterCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
o.value = o.value || {};
this.year = BI.createWidget({
type: "bi.year_combo",
behaviors: o.yearBehaviors
behaviors: o.yearBehaviors,
value: o.value.year
});
this.quarter = BI.createWidget({
type: "bi.quarter_combo",
behaviors: o.quarterBehaviors
behaviors: o.quarterBehaviors,
value: o.value.quarter
});
this.year.on(BI.YearCombo.EVENT_CONFIRM, function () {

5
src/case/combo/icontextvaluecombo/combo.icontextvalue.js

@ -7,15 +7,14 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, {
return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this, arguments), {
baseClass: "bi-icon-text-value-combo",
height: 30,
value: "",
el: {}
value: ""
});
},
_init: function () {
BI.IconTextValueCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(o.el, {
this.trigger = BI.createWidget({
type: "bi.select_icon_text_trigger",
items: o.items,
height: o.height,

2
src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js

@ -17,7 +17,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, {
_init: function () {
BI.TextValueCheckCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(o.el, {
this.trigger = BI.createWidget({
type: "bi.select_text_trigger",
items: o.items,
height: o.height,

5
src/case/combo/textvaluecombo/combo.textvalue.js

@ -11,15 +11,14 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
height: 30,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
text: "",
value: "",
el: {}
value: ""
});
},
_init: function () {
BI.TextValueCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(o.el, {
this.trigger = BI.createWidget({
type: "bi.select_text_trigger",
items: o.items,
height: o.height,

82
src/core/proto/date.js

@ -499,7 +499,46 @@ Date.parseDateTime = function (str, fmt) {
};
Date.getDate = function () {
var dt = new (Function.prototype.bind.apply(Date, BI.concat([null], [].slice.apply(arguments))))();
var length = arguments.length;
var args = arguments;
var dt;
switch (length) {
// new Date()
case 0:
dt = new Date();
break;
// new Date(long)
case 1:
dt = new Date(args[0]);
break;
// new Date(year, month)
case 2:
dt = new Date(args[0], args[1]);
break;
// new Date(year, month, day)
case 3:
dt = new Date(args[0], args[1], args[2]);
break;
// new Date(year, month, day, hour)
case 4:
dt = new Date(args[0], args[1], args[2], args[3]);
break;
// new Date(year, month, day, hour, minute)
case 5:
dt = new Date(args[0], args[1], args[2], args[3], args[4]);
break;
// new Date(year, month, day, hour, minute, second)
case 6:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5]);
break;
// new Date(year, month, day, hour, minute, second, millisecond)
case 7:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
break;
default:
dt = new Date();
break;
}
if(BI.isNotNull(Date.timeZone) && (arguments.length === 0 || (arguments.length === 1 && BI.isNumber(arguments[0])))) {
var localTime = dt.getTime();
var localOffset = dt.getTimezoneOffset() * 60000; // 获得当地时间偏移的毫秒数
@ -511,7 +550,46 @@ Date.getDate = function () {
};
Date.getTime = function () {
var dt = Function.prototype.bind.apply(Date.getDate, BI.concat([null], [].slice.apply(arguments)))();
var length = arguments.length;
var args = arguments;
var dt;
switch (length) {
// new Date()
case 0:
dt = new Date();
break;
// new Date(long)
case 1:
dt = new Date(args[0]);
break;
// new Date(year, month)
case 2:
dt = new Date(args[0], args[1]);
break;
// new Date(year, month, day)
case 3:
dt = new Date(args[0], args[1], args[2]);
break;
// new Date(year, month, day, hour)
case 4:
dt = new Date(args[0], args[1], args[2], args[3]);
break;
// new Date(year, month, day, hour, minute)
case 5:
dt = new Date(args[0], args[1], args[2], args[3], args[4]);
break;
// new Date(year, month, day, hour, minute, second)
case 6:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5]);
break;
// new Date(year, month, day, hour, minute, second, millisecond)
case 7:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
break;
default:
dt = new Date();
break;
}
if(BI.isNotNull(Date.timeZone)) {
return dt.getTime() - Date.timeZone - dt.getTimezoneOffset() * 60000;
}

29
src/polyfill/function.js

@ -0,0 +1,29 @@
if (!Function.prototype.bind) {
Function.prototype.bind = function(oThis) {
if (typeof this !== 'function') {
// closest thing possible to the ECMAScript 5
// internal IsCallable function
throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
}
var aArgs = Array.prototype.slice.call(arguments, 1),
fToBind = this,
fNOP = function() {},
fBound = function() {
return fToBind.apply(this instanceof fNOP
? this
: oThis,
// 获取调用时(fBound)的传参.bind 返回的函数入参往往是这么传递的
aArgs.concat(Array.prototype.slice.call(arguments)));
};
// 维护原型关系
if (this.prototype) {
// Function.prototype doesn't have a prototype property
fNOP.prototype = this.prototype;
}
fBound.prototype = new fNOP();
return fBound;
};
}

1
src/widget/date/trigger.date.js

@ -98,6 +98,7 @@ BI.DateTrigger = BI.inherit(BI.Trigger, {
el: this.editor
}]
});
this.setValue(o.value);
},
_dateCheck: function (date) {
return Date.parseDateTime(date, "%Y-%x-%d").print("%Y-%x-%d") == date || Date.parseDateTime(date, "%Y-%X-%d").print("%Y-%X-%d") == date || Date.parseDateTime(date, "%Y-%x-%e").print("%Y-%x-%e") == date || Date.parseDateTime(date, "%Y-%X-%e").print("%Y-%X-%e") == date;

1
src/widget/datepane/datepane.js

@ -59,6 +59,7 @@ BI.DatePaneWidget = BI.inherit(BI.Widget, {
self.setValue(self.selectedTime);
self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE);
});
this.setValue(o.selectedTime);
},

6
src/widget/month/combo.month.js

@ -18,7 +18,8 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.month_trigger"
type: "bi.month_trigger",
value: o.value
});
this.trigger.on(BI.MonthTrigger.EVENT_CONFIRM, function (v) {
@ -46,7 +47,8 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
this.popup = BI.createWidget({
type: "bi.month_popup",
behaviors: o.behaviors
behaviors: o.behaviors,
value: o.value
});
this.popup.on(BI.MonthPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());

3
src/widget/month/popup.month.js

@ -60,7 +60,8 @@ BI.MonthPopup = BI.inherit(BI.Widget, {
type: "bi.center_adapt",
vgap: 1,
hgap: 2
}]
}],
value: o.value
});
this.month.on(BI.Controller.EVENT_CHANGE, function (type) {

1
src/widget/month/trigger.month.js

@ -83,6 +83,7 @@ BI.MonthTrigger = BI.inherit(BI.Trigger, {
}
]
});
this.setValue(o.value);
},
setValue: function (v) {
if(BI.isNotNull(v)) {

10
src/widget/multidate/multidate.combo.js

@ -23,11 +23,12 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
var self = this, opts = this.options;
this.storeTriggerValue = "";
var date = Date.getDate();
this.storeValue = null;
this.storeValue = opts.value;
this.trigger = BI.createWidget({
type: "bi.date_trigger",
min: this.constants.DATE_MIN_VALUE,
max: this.constants.DATE_MAX_VALUE
max: this.constants.DATE_MAX_VALUE,
value: opts.value
});
this.trigger.on(BI.DateTrigger.EVENT_KEY_DOWN, function () {
if (self.combo.isViewVisible()) {
@ -81,7 +82,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
this.popup = BI.createWidget({
type: "bi.multidate_popup",
min: this.constants.DATE_MIN_VALUE,
max: this.constants.DATE_MAX_VALUE
max: this.constants.DATE_MAX_VALUE,
value: opts.value
});
this.popup.on(BI.MultiDatePopup.BUTTON_CLEAR_EVENT_CHANGE, function () {
self.setValue();
@ -175,6 +177,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
self.comboWrapper = _ref;
}
});
this._checkDynamicValue(opts.value);
},
_checkDynamicValue: function (v) {

1
src/widget/multidate/multidate.popup.js

@ -202,6 +202,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
height: 30
}]
});
this.setValue(opts.value);
},
_setInnerValue: function (obj) {
if (this.dateTab.getSelect() === BI.MultiDateCombo.MULTI_DATE_YMD_CARD) {

2
src/widget/numberinterval/numberinterval.js

@ -236,6 +236,8 @@ BI.NumberInterval = BI.inherit(BI.Single, {
self._setComboValueChangedEvent(self.smallCombo);
self._setEditorValueChangedEvent(self.bigEditor);
self._setEditorValueChangedEvent(self.smallEditor);
this.setValue(o.value);
},
_checkValidation: function () {

6
src/widget/quarter/combo.quarter.js

@ -18,7 +18,8 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.storeValue = "";
this.trigger = BI.createWidget({
type: "bi.quarter_trigger"
type: "bi.quarter_trigger",
value: o.value
});
this.trigger.on(BI.QuarterTrigger.EVENT_FOCUS, function () {
@ -45,7 +46,8 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
});
this.popup = BI.createWidget({
type: "bi.quarter_popup",
behaviors: o.behaviors
behaviors: o.behaviors,
value: o.value
});
this.popup.on(BI.QuarterPopup.EVENT_CHANGE, function () {

5
src/widget/quarter/popup.quarter.js

@ -19,7 +19,7 @@ BI.QuarterPopup = BI.inherit(BI.Widget, {
var self = this, o = this.options;
var items = [{
text: Date._QN[01],
text: Date._QN[1],
value: 1
}, {
text: Date._QN[2],
@ -50,7 +50,8 @@ BI.QuarterPopup = BI.inherit(BI.Widget, {
items: BI.createItems(items, {}),
layouts: [{
type: "bi.vertical"
}]
}],
value: o.value
});
this.quarter.on(BI.Controller.EVENT_CHANGE, function (type) {

1
src/widget/quarter/trigger.quarter.js

@ -85,6 +85,7 @@ BI.QuarterTrigger = BI.inherit(BI.Trigger, {
}
]
});
this.setValue(o.value);
},
setValue: function (v) {

12
src/widget/timeinterval/timeinterval.js

@ -18,11 +18,12 @@ BI.TimeInterval = BI.inherit(BI.Single, {
});
},
_init: function () {
var self = this;
var self = this, o = this.options;
BI.TimeInterval.superclass._init.apply(this, arguments);
this.left = this._createCombo();
this.right = this._createCombo();
o.value = o.value || {};
this.left = this._createCombo(o.value.start);
this.right = this._createCombo(o.value.end);
this.label = BI.createWidget({
type: "bi.label",
height: this.constants.height,
@ -63,10 +64,11 @@ BI.TimeInterval = BI.inherit(BI.Single, {
});
},
_createCombo: function () {
_createCombo: function (v) {
var self = this;
var combo = BI.createWidget({
type: "bi.multidate_combo"
type: "bi.multidate_combo",
value: v
});
combo.on(BI.MultiDateCombo.EVENT_ERROR, function () {
self._clearTitle();

6
src/widget/year/combo.year.js

@ -22,7 +22,8 @@ BI.YearCombo = BI.inherit(BI.Widget, {
this.trigger = BI.createWidget({
type: "bi.year_trigger",
min: o.min,
max: o.max
max: o.max,
value: o.value || ""
});
this.trigger.on(BI.YearTrigger.EVENT_FOCUS, function () {
self.storeValue = this.getKey();
@ -74,7 +75,8 @@ BI.YearCombo = BI.inherit(BI.Widget, {
behaviors: o.behaviors,
min: o.min,
max: o.max
}
},
value: o.value || ""
}
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {

6
src/widget/year/popup.year.js

@ -35,7 +35,7 @@ BI.YearPopup = BI.inherit(BI.Widget, {
_init: function () {
BI.YearPopup.superclass._init.apply(this, arguments);
var self = this;
var self = this, o = this.options;
this.selectedYear = this._year = Date.getDate().getFullYear();
@ -82,6 +82,10 @@ BI.YearPopup = BI.inherit(BI.Widget, {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
self.fireEvent(BI.YearPopup.EVENT_CHANGE, self.selectedYear);
});
if(BI.isKey(o.value)){
this.setValue(o.value);
}
},
getValue: function () {

3
src/widget/year/trigger.year.js

@ -37,7 +37,8 @@ BI.YearTrigger = BI.inherit(BI.Trigger, {
hgap: c.hgap,
vgap: c.vgap,
allowBlank: true,
errorText: c.errorText
errorText: c.errorText,
value: o.value
});
this.editor.on(BI.SignEditor.EVENT_FOCUS, function () {
self.fireEvent(BI.YearTrigger.EVENT_FOCUS);

8
src/widget/yearmonth/combo.yearmonth.js

@ -17,14 +17,18 @@ BI.YearMonthCombo = BI.inherit(BI.Widget, {
BI.YearMonthCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
o.value = o.value || {};
this.year = BI.createWidget({
type: "bi.year_combo",
behaviors: o.yearBehaviors
behaviors: o.yearBehaviors,
value: o.value.year
});
this.month = BI.createWidget({
type: "bi.month_combo",
behaviors: o.monthBehaviors
behaviors: o.monthBehaviors,
value: o.value.month
});
this.year.on(BI.YearCombo.EVENT_CONFIRM, function () {

8
src/widget/yearquarter/combo.yearquarter.js

@ -17,14 +17,18 @@ BI.YearQuarterCombo = BI.inherit(BI.Widget, {
BI.YearQuarterCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
o.value = o.value || {};
this.year = BI.createWidget({
type: "bi.year_combo",
behaviors: o.yearBehaviors
behaviors: o.yearBehaviors,
value: o.value.year
});
this.quarter = BI.createWidget({
type: "bi.quarter_combo",
behaviors: o.quarterBehaviors
behaviors: o.quarterBehaviors,
value: o.value.quarter
});
this.year.on(BI.YearCombo.EVENT_CONFIRM, function () {

Loading…
Cancel
Save