Browse Source

BI-19047

es6
windy 7 years ago
parent
commit
b5f917e5d0
  1. 22
      demo/js/widget/date/demo.datepane.js
  2. 28
      dist/_fineui.min.js
  3. 24
      dist/bundle.js
  4. 28
      dist/bundle.min.js
  5. 22
      dist/demo.js
  6. 28
      dist/fineui.min.js
  7. 24
      dist/widget.js
  8. 22
      src/widget/datetimepane/card.static.datetimepane.js
  9. 1
      src/widget/timeinterval/dateinterval.js
  10. 1
      src/widget/timeinterval/timeinterval.js

22
demo/js/widget/date/demo.datepane.js

@ -35,17 +35,17 @@ Demo.DatePane = BI.inherit(BI.Widget, {
} }
}, { }, {
type: "bi.dynamic_date_time_pane", type: "bi.dynamic_date_time_pane",
// value: { value: {
// type: 1, type: 1,
// value: { value: {
// year: 2017, year: 2017,
// month: 12, month: 12,
// day: 11, day: 11,
// hour: 12, hour: 12,
// minute: 12, minute: 12,
// second: 12 second: 12
// } }
// }, },
ref: function (_ref) { ref: function (_ref) {
self.dateTimePane = _ref; self.dateTimePane = _ref;
}, },

28
dist/_fineui.min.js vendored

File diff suppressed because one or more lines are too long

24
dist/bundle.js vendored

@ -88994,8 +88994,20 @@ BI.shortcut("bi.date_time_trigger", BI.DateTimeTrigger);BI.StaticDateTimePaneCar
max: o.max max: o.max
}); });
this.datePicker.on(BI.DatePicker.EVENT_CHANGE, function () { this.datePicker.on(BI.DatePicker.EVENT_CHANGE, function () {
self.selectedTime = BI.extend(self.datePicker.getValue(), self.timeSelect.getValue()); var value = self.datePicker.getValue();
var monthDay = BI.getDate(value.year, value.month - 1, 1).getMonthDays();
var day = self.selectedTime.day || 0;
if (day > monthDay) {
day = monthDay;
}
self.selectedTime = BI.extend(self.selectedTime, {
year: value.year,
month: value.month,
day: day
});
self.calendar.setSelect(BI.Calendar.getPageByDateJSON(self.selectedTime)); self.calendar.setSelect(BI.Calendar.getPageByDateJSON(self.selectedTime));
self.calendar.setValue(self.selectedTime);
self.fireEvent("EVENT_CHANGE");
}); });
this.calendar = BI.createWidget({ this.calendar = BI.createWidget({
@ -89022,7 +89034,13 @@ BI.shortcut("bi.date_time_trigger", BI.DateTimeTrigger);BI.StaticDateTimePaneCar
type: "bi.dynamic_date_time_select", type: "bi.dynamic_date_time_select",
ref: function () { ref: function () {
self.timeSelect = this; self.timeSelect = this;
},
listeners: [{
eventName: BI.DynamicDateTimeSelect.EVENT_CONFIRM,
action: function () {
self.fireEvent("EVENT_CHANGE");
} }
}]
}, },
height: 40 height: 40
}] }]
@ -89058,7 +89076,7 @@ BI.shortcut("bi.date_time_trigger", BI.DateTimeTrigger);BI.StaticDateTimePaneCar
_setCalenderValue: function (date) { _setCalenderValue: function (date) {
this.calendar.setSelect(BI.Calendar.getPageByDateJSON(date)); this.calendar.setSelect(BI.Calendar.getPageByDateJSON(date));
this.calendar.setValue(date); this.calendar.setValue(date);
this.selectedTime = BI.extend(date, this.timeSelect.getValue()); this.selectedTime = BI.extend({}, this.timeSelect.getValue(), date);
}, },
_setDatePicker: function (timeOb) { _setDatePicker: function (timeOb) {
@ -107342,6 +107360,7 @@ BI.DateInterval = BI.inherit(BI.Single, {
}); });
combo.on(BI.DynamicDateCombo.EVENT_ERROR, function () { combo.on(BI.DynamicDateCombo.EVENT_ERROR, function () {
self._clearTitle(); self._clearTitle();
BI.Bubbles.hide("error");
self.element.removeClass(self.constants.timeErrorCls); self.element.removeClass(self.constants.timeErrorCls);
self.fireEvent(BI.DateInterval.EVENT_ERROR); self.fireEvent(BI.DateInterval.EVENT_ERROR);
}); });
@ -107520,6 +107539,7 @@ BI.TimeInterval = BI.inherit(BI.Single, {
}); });
combo.on(BI.DynamicDateTimeCombo.EVENT_ERROR, function () { combo.on(BI.DynamicDateTimeCombo.EVENT_ERROR, function () {
self._clearTitle(); self._clearTitle();
BI.Bubbles.hide("error");
self.element.removeClass(self.constants.timeErrorCls); self.element.removeClass(self.constants.timeErrorCls);
self.fireEvent(BI.TimeInterval.EVENT_ERROR); self.fireEvent(BI.TimeInterval.EVENT_ERROR);
}); });

28
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

22
dist/demo.js vendored

@ -12187,17 +12187,17 @@ BI.shortcut("demo.tips", Demo.Tips);Demo.DatePane = BI.inherit(BI.Widget, {
} }
}, { }, {
type: "bi.dynamic_date_time_pane", type: "bi.dynamic_date_time_pane",
// value: { value: {
// type: 1, type: 1,
// value: { value: {
// year: 2017, year: 2017,
// month: 12, month: 12,
// day: 11, day: 11,
// hour: 12, hour: 12,
// minute: 12, minute: 12,
// second: 12 second: 12
// } }
// }, },
ref: function (_ref) { ref: function (_ref) {
self.dateTimePane = _ref; self.dateTimePane = _ref;
}, },

28
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

24
dist/widget.js vendored

@ -1841,8 +1841,20 @@ BI.shortcut("bi.date_time_trigger", BI.DateTimeTrigger);BI.StaticDateTimePaneCar
max: o.max max: o.max
}); });
this.datePicker.on(BI.DatePicker.EVENT_CHANGE, function () { this.datePicker.on(BI.DatePicker.EVENT_CHANGE, function () {
self.selectedTime = BI.extend(self.datePicker.getValue(), self.timeSelect.getValue()); var value = self.datePicker.getValue();
var monthDay = BI.getDate(value.year, value.month - 1, 1).getMonthDays();
var day = self.selectedTime.day || 0;
if (day > monthDay) {
day = monthDay;
}
self.selectedTime = BI.extend(self.selectedTime, {
year: value.year,
month: value.month,
day: day
});
self.calendar.setSelect(BI.Calendar.getPageByDateJSON(self.selectedTime)); self.calendar.setSelect(BI.Calendar.getPageByDateJSON(self.selectedTime));
self.calendar.setValue(self.selectedTime);
self.fireEvent("EVENT_CHANGE");
}); });
this.calendar = BI.createWidget({ this.calendar = BI.createWidget({
@ -1869,7 +1881,13 @@ BI.shortcut("bi.date_time_trigger", BI.DateTimeTrigger);BI.StaticDateTimePaneCar
type: "bi.dynamic_date_time_select", type: "bi.dynamic_date_time_select",
ref: function () { ref: function () {
self.timeSelect = this; self.timeSelect = this;
},
listeners: [{
eventName: BI.DynamicDateTimeSelect.EVENT_CONFIRM,
action: function () {
self.fireEvent("EVENT_CHANGE");
} }
}]
}, },
height: 40 height: 40
}] }]
@ -1905,7 +1923,7 @@ BI.shortcut("bi.date_time_trigger", BI.DateTimeTrigger);BI.StaticDateTimePaneCar
_setCalenderValue: function (date) { _setCalenderValue: function (date) {
this.calendar.setSelect(BI.Calendar.getPageByDateJSON(date)); this.calendar.setSelect(BI.Calendar.getPageByDateJSON(date));
this.calendar.setValue(date); this.calendar.setValue(date);
this.selectedTime = BI.extend(date, this.timeSelect.getValue()); this.selectedTime = BI.extend({}, this.timeSelect.getValue(), date);
}, },
_setDatePicker: function (timeOb) { _setDatePicker: function (timeOb) {
@ -20189,6 +20207,7 @@ BI.DateInterval = BI.inherit(BI.Single, {
}); });
combo.on(BI.DynamicDateCombo.EVENT_ERROR, function () { combo.on(BI.DynamicDateCombo.EVENT_ERROR, function () {
self._clearTitle(); self._clearTitle();
BI.Bubbles.hide("error");
self.element.removeClass(self.constants.timeErrorCls); self.element.removeClass(self.constants.timeErrorCls);
self.fireEvent(BI.DateInterval.EVENT_ERROR); self.fireEvent(BI.DateInterval.EVENT_ERROR);
}); });
@ -20367,6 +20386,7 @@ BI.TimeInterval = BI.inherit(BI.Single, {
}); });
combo.on(BI.DynamicDateTimeCombo.EVENT_ERROR, function () { combo.on(BI.DynamicDateTimeCombo.EVENT_ERROR, function () {
self._clearTitle(); self._clearTitle();
BI.Bubbles.hide("error");
self.element.removeClass(self.constants.timeErrorCls); self.element.removeClass(self.constants.timeErrorCls);
self.fireEvent(BI.TimeInterval.EVENT_ERROR); self.fireEvent(BI.TimeInterval.EVENT_ERROR);
}); });

22
src/widget/datetimepane/card.static.datetimepane.js

@ -27,8 +27,20 @@ BI.StaticDateTimePaneCard = BI.inherit(BI.Widget, {
max: o.max max: o.max
}); });
this.datePicker.on(BI.DatePicker.EVENT_CHANGE, function () { this.datePicker.on(BI.DatePicker.EVENT_CHANGE, function () {
self.selectedTime = BI.extend(self.datePicker.getValue(), self.timeSelect.getValue()); var value = self.datePicker.getValue();
var monthDay = BI.getDate(value.year, value.month - 1, 1).getMonthDays();
var day = self.selectedTime.day || 0;
if (day > monthDay) {
day = monthDay;
}
self.selectedTime = BI.extend(self.selectedTime, {
year: value.year,
month: value.month,
day: day
});
self.calendar.setSelect(BI.Calendar.getPageByDateJSON(self.selectedTime)); self.calendar.setSelect(BI.Calendar.getPageByDateJSON(self.selectedTime));
self.calendar.setValue(self.selectedTime);
self.fireEvent("EVENT_CHANGE");
}); });
this.calendar = BI.createWidget({ this.calendar = BI.createWidget({
@ -55,7 +67,13 @@ BI.StaticDateTimePaneCard = BI.inherit(BI.Widget, {
type: "bi.dynamic_date_time_select", type: "bi.dynamic_date_time_select",
ref: function () { ref: function () {
self.timeSelect = this; self.timeSelect = this;
},
listeners: [{
eventName: BI.DynamicDateTimeSelect.EVENT_CONFIRM,
action: function () {
self.fireEvent("EVENT_CHANGE");
} }
}]
}, },
height: 40 height: 40
}] }]
@ -91,7 +109,7 @@ BI.StaticDateTimePaneCard = BI.inherit(BI.Widget, {
_setCalenderValue: function (date) { _setCalenderValue: function (date) {
this.calendar.setSelect(BI.Calendar.getPageByDateJSON(date)); this.calendar.setSelect(BI.Calendar.getPageByDateJSON(date));
this.calendar.setValue(date); this.calendar.setValue(date);
this.selectedTime = BI.extend(date, this.timeSelect.getValue()); this.selectedTime = BI.extend({}, this.timeSelect.getValue(), date);
}, },
_setDatePicker: function (timeOb) { _setDatePicker: function (timeOb) {

1
src/widget/timeinterval/dateinterval.js

@ -72,6 +72,7 @@ BI.DateInterval = BI.inherit(BI.Single, {
}); });
combo.on(BI.DynamicDateCombo.EVENT_ERROR, function () { combo.on(BI.DynamicDateCombo.EVENT_ERROR, function () {
self._clearTitle(); self._clearTitle();
BI.Bubbles.hide("error");
self.element.removeClass(self.constants.timeErrorCls); self.element.removeClass(self.constants.timeErrorCls);
self.fireEvent(BI.DateInterval.EVENT_ERROR); self.fireEvent(BI.DateInterval.EVENT_ERROR);
}); });

1
src/widget/timeinterval/timeinterval.js

@ -72,6 +72,7 @@ BI.TimeInterval = BI.inherit(BI.Single, {
}); });
combo.on(BI.DynamicDateTimeCombo.EVENT_ERROR, function () { combo.on(BI.DynamicDateTimeCombo.EVENT_ERROR, function () {
self._clearTitle(); self._clearTitle();
BI.Bubbles.hide("error");
self.element.removeClass(self.constants.timeErrorCls); self.element.removeClass(self.constants.timeErrorCls);
self.fireEvent(BI.TimeInterval.EVENT_ERROR); self.fireEvent(BI.TimeInterval.EVENT_ERROR);
}); });

Loading…
Cancel
Save