Browse Source

Merge pull request #1130 in VISUAL/fineui from ~WINDY/fineui:master to master

* commit 'b444a56848de9d68c2a2c7eabc877bffb1d54baa':
  REPORT-21493 && REPORT-21002 && BI-51100 单测 && 视觉修改
master
guy 5 years ago
parent
commit
4dcb088c1b
  1. 39
      dist/2.0/fineui.ie.js
  2. 39
      dist/2.0/fineui.js
  3. 4
      dist/base.js
  4. 39
      dist/bundle.ie.js
  5. 39
      dist/bundle.js
  6. 39
      dist/fineui.ie.js
  7. 39
      dist/fineui.js
  8. 39
      dist/fineui_without_jquery_polyfill.js
  9. 35
      dist/widget.js
  10. 2
      src/base/single/a/__test__/a.test.js
  11. 107
      src/widget/datetime/__test__/datetime.test.js
  12. 19
      src/widget/downlist/__test__/combo.downlist.test.js
  13. 63
      src/widget/downlist/__test__/downlist.test.js
  14. 65
      src/widget/dynamicdate/__test__/dynamicdate.test.js
  15. 6
      src/widget/dynamicdate/dynamicdate.combo.js
  16. 4
      src/widget/dynamicdate/dynamicdate.trigger.js
  17. 330
      src/widget/dynamicdatetime/__test__/dynamicdatetime.test.js
  18. 8
      src/widget/dynamicdatetime/dynamicdatetime.combo.js
  19. 6
      src/widget/dynamicdatetime/dynamicdatetime.trigger.js
  20. 6
      src/widget/time/time.combo.js
  21. 5
      src/widget/time/time.trigger.js
  22. 10
      test/utils.js

39
dist/2.0/fineui.ie.js vendored

@ -48406,7 +48406,7 @@ BI.Input = BI.inherit(BI.Single, {
blur();
}
function blur() {
function blur () {
if (!self.isValid() && self.options.quitChecker.apply(self, [BI.trim(self.getValue())]) !== false) {
self.element.val(self._lastValidValue ? self._lastValidValue : "");
self._checkValidationOnValueChange();
@ -48473,7 +48473,7 @@ BI.Input = BI.inherit(BI.Single, {
// _valueChange中会更新_lastValue, 这边缓存用以后续STOP事件服务
var lastValue = this._lastValue;
if (BI.trim(this.getValue()) !== BI.trim(this._lastValue || "")) {
if(BI.trim(this.getValue()) !== BI.trim(this._lastValue || "")){
this._valueChange();
}
if (BI.isEndWithBlank(this.getValue())) {
@ -64721,6 +64721,11 @@ BI.extend(BI.DynamicDateCard, {
}
self.fireEvent(BI.DynamicDateCombo.EVENT_FOCUS);
}
}, {
eventName: BI.DynamicDateTrigger.EVENT_BLUR,
action: function () {
self.fireEvent(BI.DynamicDateCombo.EVENT_BLUR);
}
}, {
eventName: BI.DynamicDateTrigger.EVENT_ERROR,
action: function () {
@ -64920,6 +64925,7 @@ BI.extend(BI.DynamicDateCard, {
BI.DynamicDateCombo.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.DynamicDateCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicDateCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateCombo.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDateCombo.EVENT_VALID = "EVENT_VALID";
BI.DynamicDateCombo.EVENT_ERROR = "EVENT_ERROR";
@ -65324,6 +65330,9 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
self.storeTriggerValue = self.getKey();
self.fireEvent(BI.DynamicDateTrigger.EVENT_FOCUS);
});
this.editor.on(BI.SignEditor.EVENT_BLUR, function () {
self.fireEvent(BI.DynamicDateTrigger.EVENT_BLUR);
});
this.editor.on(BI.SignEditor.EVENT_STOP, function () {
self.fireEvent(BI.DynamicDateTrigger.EVENT_STOP);
});
@ -65590,6 +65599,7 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
});
BI.DynamicDateTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTrigger.EVENT_START = "EVENT_START";
BI.DynamicDateTrigger.EVENT_STOP = "EVENT_STOP";
@ -65609,7 +65619,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
},
props: {
baseCls: "bi-dynamic-date-combo bi-border bi-focus-shadow",
baseCls: "bi-dynamic-date-combo bi-border bi-focus-shadow bi-border-radius",
height: 22,
minDate: "1900-01-01",
maxDate: "2099-12-31",
@ -65689,6 +65699,11 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
}
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_FOCUS);
}
}, {
eventName: BI.DynamicDateTimeTrigger.EVENT_BLUR,
action: function () {
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_BLUR);
}
}, {
eventName: BI.DynamicDateTimeTrigger.EVENT_ERROR,
action: function () {
@ -65891,6 +65906,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
BI.DynamicDateTimeCombo.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.DynamicDateTimeCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicDateTimeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTimeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTimeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDateTimeCombo.EVENT_VALID = "EVENT_VALID";
BI.DynamicDateTimeCombo.EVENT_ERROR = "EVENT_ERROR";
@ -66402,6 +66418,9 @@ BI.extend(BI.DynamicDateTimeSelect, {
self.storeTriggerValue = self.getKey();
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_FOCUS);
});
this.editor.on(BI.SignEditor.EVENT_BLUR, function () {
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_BLUR);
});
this.editor.on(BI.SignEditor.EVENT_STOP, function () {
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_STOP);
});
@ -66521,7 +66540,7 @@ BI.extend(BI.DynamicDateTimeSelect, {
v = BI.print(date, c.compareFormat);
result = [0, 1, 2];
}
var dateArray = v.match(/\d+/g);
var dateArray = v.match(/\d+/g) || [];
var newArray = [];
// 处理乱序的年月日
BI.each(dateArray.slice(0, 3), function (idx) {
@ -66693,6 +66712,7 @@ BI.extend(BI.DynamicDateTimeSelect, {
});
BI.DynamicDateTimeTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTimeTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTimeTrigger.EVENT_START = "EVENT_START";
BI.DynamicDateTimeTrigger.EVENT_STOP = "EVENT_STOP";
@ -83799,6 +83819,7 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
isNeedAdjustWidth: false,
el: {
type: "bi.time_trigger",
height: opts.height,
allowEdit: opts.allowEdit,
watermark: opts.watermark,
format: opts.format,
@ -83830,6 +83851,11 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
}
self.fireEvent("EVENT_FOCUS");
}
}, {
eventName: "EVENT_BLUR",
action: function () {
self.fireEvent("EVENT_BLUR");
}
}, {
eventName: "EVENT_ERROR",
action: function () {
@ -84019,6 +84045,11 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
self.storeTriggerValue = self.getKey();
self.fireEvent("EVENT_FOCUS");
}
}, {
eventName: "EVENT_BLUR",
action: function () {
self.fireEvent("EVENT_BLUR");
}
}, {
eventName: "EVENT_STOP",
action: function () {

39
dist/2.0/fineui.js vendored

@ -48810,7 +48810,7 @@ BI.Input = BI.inherit(BI.Single, {
blur();
}
function blur() {
function blur () {
if (!self.isValid() && self.options.quitChecker.apply(self, [BI.trim(self.getValue())]) !== false) {
self.element.val(self._lastValidValue ? self._lastValidValue : "");
self._checkValidationOnValueChange();
@ -48877,7 +48877,7 @@ BI.Input = BI.inherit(BI.Single, {
// _valueChange中会更新_lastValue, 这边缓存用以后续STOP事件服务
var lastValue = this._lastValue;
if (BI.trim(this.getValue()) !== BI.trim(this._lastValue || "")) {
if(BI.trim(this.getValue()) !== BI.trim(this._lastValue || "")){
this._valueChange();
}
if (BI.isEndWithBlank(this.getValue())) {
@ -65125,6 +65125,11 @@ BI.extend(BI.DynamicDateCard, {
}
self.fireEvent(BI.DynamicDateCombo.EVENT_FOCUS);
}
}, {
eventName: BI.DynamicDateTrigger.EVENT_BLUR,
action: function () {
self.fireEvent(BI.DynamicDateCombo.EVENT_BLUR);
}
}, {
eventName: BI.DynamicDateTrigger.EVENT_ERROR,
action: function () {
@ -65324,6 +65329,7 @@ BI.extend(BI.DynamicDateCard, {
BI.DynamicDateCombo.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.DynamicDateCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicDateCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateCombo.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDateCombo.EVENT_VALID = "EVENT_VALID";
BI.DynamicDateCombo.EVENT_ERROR = "EVENT_ERROR";
@ -65728,6 +65734,9 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
self.storeTriggerValue = self.getKey();
self.fireEvent(BI.DynamicDateTrigger.EVENT_FOCUS);
});
this.editor.on(BI.SignEditor.EVENT_BLUR, function () {
self.fireEvent(BI.DynamicDateTrigger.EVENT_BLUR);
});
this.editor.on(BI.SignEditor.EVENT_STOP, function () {
self.fireEvent(BI.DynamicDateTrigger.EVENT_STOP);
});
@ -65994,6 +66003,7 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
});
BI.DynamicDateTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTrigger.EVENT_START = "EVENT_START";
BI.DynamicDateTrigger.EVENT_STOP = "EVENT_STOP";
@ -66013,7 +66023,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
},
props: {
baseCls: "bi-dynamic-date-combo bi-border bi-focus-shadow",
baseCls: "bi-dynamic-date-combo bi-border bi-focus-shadow bi-border-radius",
height: 22,
minDate: "1900-01-01",
maxDate: "2099-12-31",
@ -66093,6 +66103,11 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
}
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_FOCUS);
}
}, {
eventName: BI.DynamicDateTimeTrigger.EVENT_BLUR,
action: function () {
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_BLUR);
}
}, {
eventName: BI.DynamicDateTimeTrigger.EVENT_ERROR,
action: function () {
@ -66295,6 +66310,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
BI.DynamicDateTimeCombo.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.DynamicDateTimeCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicDateTimeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTimeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTimeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDateTimeCombo.EVENT_VALID = "EVENT_VALID";
BI.DynamicDateTimeCombo.EVENT_ERROR = "EVENT_ERROR";
@ -66806,6 +66822,9 @@ BI.extend(BI.DynamicDateTimeSelect, {
self.storeTriggerValue = self.getKey();
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_FOCUS);
});
this.editor.on(BI.SignEditor.EVENT_BLUR, function () {
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_BLUR);
});
this.editor.on(BI.SignEditor.EVENT_STOP, function () {
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_STOP);
});
@ -66925,7 +66944,7 @@ BI.extend(BI.DynamicDateTimeSelect, {
v = BI.print(date, c.compareFormat);
result = [0, 1, 2];
}
var dateArray = v.match(/\d+/g);
var dateArray = v.match(/\d+/g) || [];
var newArray = [];
// 处理乱序的年月日
BI.each(dateArray.slice(0, 3), function (idx) {
@ -67097,6 +67116,7 @@ BI.extend(BI.DynamicDateTimeSelect, {
});
BI.DynamicDateTimeTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTimeTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTimeTrigger.EVENT_START = "EVENT_START";
BI.DynamicDateTimeTrigger.EVENT_STOP = "EVENT_STOP";
@ -84203,6 +84223,7 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
isNeedAdjustWidth: false,
el: {
type: "bi.time_trigger",
height: opts.height,
allowEdit: opts.allowEdit,
watermark: opts.watermark,
format: opts.format,
@ -84234,6 +84255,11 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
}
self.fireEvent("EVENT_FOCUS");
}
}, {
eventName: "EVENT_BLUR",
action: function () {
self.fireEvent("EVENT_BLUR");
}
}, {
eventName: "EVENT_ERROR",
action: function () {
@ -84423,6 +84449,11 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
self.storeTriggerValue = self.getKey();
self.fireEvent("EVENT_FOCUS");
}
}, {
eventName: "EVENT_BLUR",
action: function () {
self.fireEvent("EVENT_BLUR");
}
}, {
eventName: "EVENT_STOP",
action: function () {

4
dist/base.js vendored

@ -10537,7 +10537,7 @@ BI.Input = BI.inherit(BI.Single, {
blur();
}
function blur() {
function blur () {
if (!self.isValid() && self.options.quitChecker.apply(self, [BI.trim(self.getValue())]) !== false) {
self.element.val(self._lastValidValue ? self._lastValidValue : "");
self._checkValidationOnValueChange();
@ -10604,7 +10604,7 @@ BI.Input = BI.inherit(BI.Single, {
// _valueChange中会更新_lastValue, 这边缓存用以后续STOP事件服务
var lastValue = this._lastValue;
if (BI.trim(this.getValue()) !== BI.trim(this._lastValue || "")) {
if(BI.trim(this.getValue()) !== BI.trim(this._lastValue || "")){
this._valueChange();
}
if (BI.isEndWithBlank(this.getValue())) {

39
dist/bundle.ie.js vendored

@ -48406,7 +48406,7 @@ BI.Input = BI.inherit(BI.Single, {
blur();
}
function blur() {
function blur () {
if (!self.isValid() && self.options.quitChecker.apply(self, [BI.trim(self.getValue())]) !== false) {
self.element.val(self._lastValidValue ? self._lastValidValue : "");
self._checkValidationOnValueChange();
@ -48473,7 +48473,7 @@ BI.Input = BI.inherit(BI.Single, {
// _valueChange中会更新_lastValue, 这边缓存用以后续STOP事件服务
var lastValue = this._lastValue;
if (BI.trim(this.getValue()) !== BI.trim(this._lastValue || "")) {
if(BI.trim(this.getValue()) !== BI.trim(this._lastValue || "")){
this._valueChange();
}
if (BI.isEndWithBlank(this.getValue())) {
@ -64721,6 +64721,11 @@ BI.extend(BI.DynamicDateCard, {
}
self.fireEvent(BI.DynamicDateCombo.EVENT_FOCUS);
}
}, {
eventName: BI.DynamicDateTrigger.EVENT_BLUR,
action: function () {
self.fireEvent(BI.DynamicDateCombo.EVENT_BLUR);
}
}, {
eventName: BI.DynamicDateTrigger.EVENT_ERROR,
action: function () {
@ -64920,6 +64925,7 @@ BI.extend(BI.DynamicDateCard, {
BI.DynamicDateCombo.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.DynamicDateCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicDateCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateCombo.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDateCombo.EVENT_VALID = "EVENT_VALID";
BI.DynamicDateCombo.EVENT_ERROR = "EVENT_ERROR";
@ -65324,6 +65330,9 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
self.storeTriggerValue = self.getKey();
self.fireEvent(BI.DynamicDateTrigger.EVENT_FOCUS);
});
this.editor.on(BI.SignEditor.EVENT_BLUR, function () {
self.fireEvent(BI.DynamicDateTrigger.EVENT_BLUR);
});
this.editor.on(BI.SignEditor.EVENT_STOP, function () {
self.fireEvent(BI.DynamicDateTrigger.EVENT_STOP);
});
@ -65590,6 +65599,7 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
});
BI.DynamicDateTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTrigger.EVENT_START = "EVENT_START";
BI.DynamicDateTrigger.EVENT_STOP = "EVENT_STOP";
@ -65609,7 +65619,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
},
props: {
baseCls: "bi-dynamic-date-combo bi-border bi-focus-shadow",
baseCls: "bi-dynamic-date-combo bi-border bi-focus-shadow bi-border-radius",
height: 22,
minDate: "1900-01-01",
maxDate: "2099-12-31",
@ -65689,6 +65699,11 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
}
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_FOCUS);
}
}, {
eventName: BI.DynamicDateTimeTrigger.EVENT_BLUR,
action: function () {
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_BLUR);
}
}, {
eventName: BI.DynamicDateTimeTrigger.EVENT_ERROR,
action: function () {
@ -65891,6 +65906,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
BI.DynamicDateTimeCombo.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.DynamicDateTimeCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicDateTimeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTimeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTimeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDateTimeCombo.EVENT_VALID = "EVENT_VALID";
BI.DynamicDateTimeCombo.EVENT_ERROR = "EVENT_ERROR";
@ -66402,6 +66418,9 @@ BI.extend(BI.DynamicDateTimeSelect, {
self.storeTriggerValue = self.getKey();
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_FOCUS);
});
this.editor.on(BI.SignEditor.EVENT_BLUR, function () {
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_BLUR);
});
this.editor.on(BI.SignEditor.EVENT_STOP, function () {
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_STOP);
});
@ -66521,7 +66540,7 @@ BI.extend(BI.DynamicDateTimeSelect, {
v = BI.print(date, c.compareFormat);
result = [0, 1, 2];
}
var dateArray = v.match(/\d+/g);
var dateArray = v.match(/\d+/g) || [];
var newArray = [];
// 处理乱序的年月日
BI.each(dateArray.slice(0, 3), function (idx) {
@ -66693,6 +66712,7 @@ BI.extend(BI.DynamicDateTimeSelect, {
});
BI.DynamicDateTimeTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTimeTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTimeTrigger.EVENT_START = "EVENT_START";
BI.DynamicDateTimeTrigger.EVENT_STOP = "EVENT_STOP";
@ -83799,6 +83819,7 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
isNeedAdjustWidth: false,
el: {
type: "bi.time_trigger",
height: opts.height,
allowEdit: opts.allowEdit,
watermark: opts.watermark,
format: opts.format,
@ -83830,6 +83851,11 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
}
self.fireEvent("EVENT_FOCUS");
}
}, {
eventName: "EVENT_BLUR",
action: function () {
self.fireEvent("EVENT_BLUR");
}
}, {
eventName: "EVENT_ERROR",
action: function () {
@ -84019,6 +84045,11 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
self.storeTriggerValue = self.getKey();
self.fireEvent("EVENT_FOCUS");
}
}, {
eventName: "EVENT_BLUR",
action: function () {
self.fireEvent("EVENT_BLUR");
}
}, {
eventName: "EVENT_STOP",
action: function () {

39
dist/bundle.js vendored

@ -48810,7 +48810,7 @@ BI.Input = BI.inherit(BI.Single, {
blur();
}
function blur() {
function blur () {
if (!self.isValid() && self.options.quitChecker.apply(self, [BI.trim(self.getValue())]) !== false) {
self.element.val(self._lastValidValue ? self._lastValidValue : "");
self._checkValidationOnValueChange();
@ -48877,7 +48877,7 @@ BI.Input = BI.inherit(BI.Single, {
// _valueChange中会更新_lastValue, 这边缓存用以后续STOP事件服务
var lastValue = this._lastValue;
if (BI.trim(this.getValue()) !== BI.trim(this._lastValue || "")) {
if(BI.trim(this.getValue()) !== BI.trim(this._lastValue || "")){
this._valueChange();
}
if (BI.isEndWithBlank(this.getValue())) {
@ -65125,6 +65125,11 @@ BI.extend(BI.DynamicDateCard, {
}
self.fireEvent(BI.DynamicDateCombo.EVENT_FOCUS);
}
}, {
eventName: BI.DynamicDateTrigger.EVENT_BLUR,
action: function () {
self.fireEvent(BI.DynamicDateCombo.EVENT_BLUR);
}
}, {
eventName: BI.DynamicDateTrigger.EVENT_ERROR,
action: function () {
@ -65324,6 +65329,7 @@ BI.extend(BI.DynamicDateCard, {
BI.DynamicDateCombo.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.DynamicDateCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicDateCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateCombo.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDateCombo.EVENT_VALID = "EVENT_VALID";
BI.DynamicDateCombo.EVENT_ERROR = "EVENT_ERROR";
@ -65728,6 +65734,9 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
self.storeTriggerValue = self.getKey();
self.fireEvent(BI.DynamicDateTrigger.EVENT_FOCUS);
});
this.editor.on(BI.SignEditor.EVENT_BLUR, function () {
self.fireEvent(BI.DynamicDateTrigger.EVENT_BLUR);
});
this.editor.on(BI.SignEditor.EVENT_STOP, function () {
self.fireEvent(BI.DynamicDateTrigger.EVENT_STOP);
});
@ -65994,6 +66003,7 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
});
BI.DynamicDateTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTrigger.EVENT_START = "EVENT_START";
BI.DynamicDateTrigger.EVENT_STOP = "EVENT_STOP";
@ -66013,7 +66023,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
},
props: {
baseCls: "bi-dynamic-date-combo bi-border bi-focus-shadow",
baseCls: "bi-dynamic-date-combo bi-border bi-focus-shadow bi-border-radius",
height: 22,
minDate: "1900-01-01",
maxDate: "2099-12-31",
@ -66093,6 +66103,11 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
}
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_FOCUS);
}
}, {
eventName: BI.DynamicDateTimeTrigger.EVENT_BLUR,
action: function () {
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_BLUR);
}
}, {
eventName: BI.DynamicDateTimeTrigger.EVENT_ERROR,
action: function () {
@ -66295,6 +66310,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
BI.DynamicDateTimeCombo.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.DynamicDateTimeCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicDateTimeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTimeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTimeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDateTimeCombo.EVENT_VALID = "EVENT_VALID";
BI.DynamicDateTimeCombo.EVENT_ERROR = "EVENT_ERROR";
@ -66806,6 +66822,9 @@ BI.extend(BI.DynamicDateTimeSelect, {
self.storeTriggerValue = self.getKey();
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_FOCUS);
});
this.editor.on(BI.SignEditor.EVENT_BLUR, function () {
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_BLUR);
});
this.editor.on(BI.SignEditor.EVENT_STOP, function () {
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_STOP);
});
@ -66925,7 +66944,7 @@ BI.extend(BI.DynamicDateTimeSelect, {
v = BI.print(date, c.compareFormat);
result = [0, 1, 2];
}
var dateArray = v.match(/\d+/g);
var dateArray = v.match(/\d+/g) || [];
var newArray = [];
// 处理乱序的年月日
BI.each(dateArray.slice(0, 3), function (idx) {
@ -67097,6 +67116,7 @@ BI.extend(BI.DynamicDateTimeSelect, {
});
BI.DynamicDateTimeTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTimeTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTimeTrigger.EVENT_START = "EVENT_START";
BI.DynamicDateTimeTrigger.EVENT_STOP = "EVENT_STOP";
@ -84203,6 +84223,7 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
isNeedAdjustWidth: false,
el: {
type: "bi.time_trigger",
height: opts.height,
allowEdit: opts.allowEdit,
watermark: opts.watermark,
format: opts.format,
@ -84234,6 +84255,11 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
}
self.fireEvent("EVENT_FOCUS");
}
}, {
eventName: "EVENT_BLUR",
action: function () {
self.fireEvent("EVENT_BLUR");
}
}, {
eventName: "EVENT_ERROR",
action: function () {
@ -84423,6 +84449,11 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
self.storeTriggerValue = self.getKey();
self.fireEvent("EVENT_FOCUS");
}
}, {
eventName: "EVENT_BLUR",
action: function () {
self.fireEvent("EVENT_BLUR");
}
}, {
eventName: "EVENT_STOP",
action: function () {

39
dist/fineui.ie.js vendored

@ -48651,7 +48651,7 @@ BI.Input = BI.inherit(BI.Single, {
blur();
}
function blur() {
function blur () {
if (!self.isValid() && self.options.quitChecker.apply(self, [BI.trim(self.getValue())]) !== false) {
self.element.val(self._lastValidValue ? self._lastValidValue : "");
self._checkValidationOnValueChange();
@ -48718,7 +48718,7 @@ BI.Input = BI.inherit(BI.Single, {
// _valueChange中会更新_lastValue, 这边缓存用以后续STOP事件服务
var lastValue = this._lastValue;
if (BI.trim(this.getValue()) !== BI.trim(this._lastValue || "")) {
if(BI.trim(this.getValue()) !== BI.trim(this._lastValue || "")){
this._valueChange();
}
if (BI.isEndWithBlank(this.getValue())) {
@ -64966,6 +64966,11 @@ BI.extend(BI.DynamicDateCard, {
}
self.fireEvent(BI.DynamicDateCombo.EVENT_FOCUS);
}
}, {
eventName: BI.DynamicDateTrigger.EVENT_BLUR,
action: function () {
self.fireEvent(BI.DynamicDateCombo.EVENT_BLUR);
}
}, {
eventName: BI.DynamicDateTrigger.EVENT_ERROR,
action: function () {
@ -65165,6 +65170,7 @@ BI.extend(BI.DynamicDateCard, {
BI.DynamicDateCombo.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.DynamicDateCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicDateCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateCombo.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDateCombo.EVENT_VALID = "EVENT_VALID";
BI.DynamicDateCombo.EVENT_ERROR = "EVENT_ERROR";
@ -65569,6 +65575,9 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
self.storeTriggerValue = self.getKey();
self.fireEvent(BI.DynamicDateTrigger.EVENT_FOCUS);
});
this.editor.on(BI.SignEditor.EVENT_BLUR, function () {
self.fireEvent(BI.DynamicDateTrigger.EVENT_BLUR);
});
this.editor.on(BI.SignEditor.EVENT_STOP, function () {
self.fireEvent(BI.DynamicDateTrigger.EVENT_STOP);
});
@ -65835,6 +65844,7 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
});
BI.DynamicDateTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTrigger.EVENT_START = "EVENT_START";
BI.DynamicDateTrigger.EVENT_STOP = "EVENT_STOP";
@ -65854,7 +65864,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
},
props: {
baseCls: "bi-dynamic-date-combo bi-border bi-focus-shadow",
baseCls: "bi-dynamic-date-combo bi-border bi-focus-shadow bi-border-radius",
height: 22,
minDate: "1900-01-01",
maxDate: "2099-12-31",
@ -65934,6 +65944,11 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
}
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_FOCUS);
}
}, {
eventName: BI.DynamicDateTimeTrigger.EVENT_BLUR,
action: function () {
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_BLUR);
}
}, {
eventName: BI.DynamicDateTimeTrigger.EVENT_ERROR,
action: function () {
@ -66136,6 +66151,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
BI.DynamicDateTimeCombo.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.DynamicDateTimeCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicDateTimeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTimeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTimeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDateTimeCombo.EVENT_VALID = "EVENT_VALID";
BI.DynamicDateTimeCombo.EVENT_ERROR = "EVENT_ERROR";
@ -66647,6 +66663,9 @@ BI.extend(BI.DynamicDateTimeSelect, {
self.storeTriggerValue = self.getKey();
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_FOCUS);
});
this.editor.on(BI.SignEditor.EVENT_BLUR, function () {
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_BLUR);
});
this.editor.on(BI.SignEditor.EVENT_STOP, function () {
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_STOP);
});
@ -66766,7 +66785,7 @@ BI.extend(BI.DynamicDateTimeSelect, {
v = BI.print(date, c.compareFormat);
result = [0, 1, 2];
}
var dateArray = v.match(/\d+/g);
var dateArray = v.match(/\d+/g) || [];
var newArray = [];
// 处理乱序的年月日
BI.each(dateArray.slice(0, 3), function (idx) {
@ -66938,6 +66957,7 @@ BI.extend(BI.DynamicDateTimeSelect, {
});
BI.DynamicDateTimeTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTimeTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTimeTrigger.EVENT_START = "EVENT_START";
BI.DynamicDateTimeTrigger.EVENT_STOP = "EVENT_STOP";
@ -84044,6 +84064,7 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
isNeedAdjustWidth: false,
el: {
type: "bi.time_trigger",
height: opts.height,
allowEdit: opts.allowEdit,
watermark: opts.watermark,
format: opts.format,
@ -84075,6 +84096,11 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
}
self.fireEvent("EVENT_FOCUS");
}
}, {
eventName: "EVENT_BLUR",
action: function () {
self.fireEvent("EVENT_BLUR");
}
}, {
eventName: "EVENT_ERROR",
action: function () {
@ -84264,6 +84290,11 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
self.storeTriggerValue = self.getKey();
self.fireEvent("EVENT_FOCUS");
}
}, {
eventName: "EVENT_BLUR",
action: function () {
self.fireEvent("EVENT_BLUR");
}
}, {
eventName: "EVENT_STOP",
action: function () {

39
dist/fineui.js vendored

@ -49055,7 +49055,7 @@ BI.Input = BI.inherit(BI.Single, {
blur();
}
function blur() {
function blur () {
if (!self.isValid() && self.options.quitChecker.apply(self, [BI.trim(self.getValue())]) !== false) {
self.element.val(self._lastValidValue ? self._lastValidValue : "");
self._checkValidationOnValueChange();
@ -49122,7 +49122,7 @@ BI.Input = BI.inherit(BI.Single, {
// _valueChange中会更新_lastValue, 这边缓存用以后续STOP事件服务
var lastValue = this._lastValue;
if (BI.trim(this.getValue()) !== BI.trim(this._lastValue || "")) {
if(BI.trim(this.getValue()) !== BI.trim(this._lastValue || "")){
this._valueChange();
}
if (BI.isEndWithBlank(this.getValue())) {
@ -65370,6 +65370,11 @@ BI.extend(BI.DynamicDateCard, {
}
self.fireEvent(BI.DynamicDateCombo.EVENT_FOCUS);
}
}, {
eventName: BI.DynamicDateTrigger.EVENT_BLUR,
action: function () {
self.fireEvent(BI.DynamicDateCombo.EVENT_BLUR);
}
}, {
eventName: BI.DynamicDateTrigger.EVENT_ERROR,
action: function () {
@ -65569,6 +65574,7 @@ BI.extend(BI.DynamicDateCard, {
BI.DynamicDateCombo.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.DynamicDateCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicDateCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateCombo.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDateCombo.EVENT_VALID = "EVENT_VALID";
BI.DynamicDateCombo.EVENT_ERROR = "EVENT_ERROR";
@ -65973,6 +65979,9 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
self.storeTriggerValue = self.getKey();
self.fireEvent(BI.DynamicDateTrigger.EVENT_FOCUS);
});
this.editor.on(BI.SignEditor.EVENT_BLUR, function () {
self.fireEvent(BI.DynamicDateTrigger.EVENT_BLUR);
});
this.editor.on(BI.SignEditor.EVENT_STOP, function () {
self.fireEvent(BI.DynamicDateTrigger.EVENT_STOP);
});
@ -66239,6 +66248,7 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
});
BI.DynamicDateTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTrigger.EVENT_START = "EVENT_START";
BI.DynamicDateTrigger.EVENT_STOP = "EVENT_STOP";
@ -66258,7 +66268,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
},
props: {
baseCls: "bi-dynamic-date-combo bi-border bi-focus-shadow",
baseCls: "bi-dynamic-date-combo bi-border bi-focus-shadow bi-border-radius",
height: 22,
minDate: "1900-01-01",
maxDate: "2099-12-31",
@ -66338,6 +66348,11 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
}
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_FOCUS);
}
}, {
eventName: BI.DynamicDateTimeTrigger.EVENT_BLUR,
action: function () {
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_BLUR);
}
}, {
eventName: BI.DynamicDateTimeTrigger.EVENT_ERROR,
action: function () {
@ -66540,6 +66555,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
BI.DynamicDateTimeCombo.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.DynamicDateTimeCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicDateTimeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTimeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTimeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDateTimeCombo.EVENT_VALID = "EVENT_VALID";
BI.DynamicDateTimeCombo.EVENT_ERROR = "EVENT_ERROR";
@ -67051,6 +67067,9 @@ BI.extend(BI.DynamicDateTimeSelect, {
self.storeTriggerValue = self.getKey();
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_FOCUS);
});
this.editor.on(BI.SignEditor.EVENT_BLUR, function () {
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_BLUR);
});
this.editor.on(BI.SignEditor.EVENT_STOP, function () {
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_STOP);
});
@ -67170,7 +67189,7 @@ BI.extend(BI.DynamicDateTimeSelect, {
v = BI.print(date, c.compareFormat);
result = [0, 1, 2];
}
var dateArray = v.match(/\d+/g);
var dateArray = v.match(/\d+/g) || [];
var newArray = [];
// 处理乱序的年月日
BI.each(dateArray.slice(0, 3), function (idx) {
@ -67342,6 +67361,7 @@ BI.extend(BI.DynamicDateTimeSelect, {
});
BI.DynamicDateTimeTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTimeTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTimeTrigger.EVENT_START = "EVENT_START";
BI.DynamicDateTimeTrigger.EVENT_STOP = "EVENT_STOP";
@ -84448,6 +84468,7 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
isNeedAdjustWidth: false,
el: {
type: "bi.time_trigger",
height: opts.height,
allowEdit: opts.allowEdit,
watermark: opts.watermark,
format: opts.format,
@ -84479,6 +84500,11 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
}
self.fireEvent("EVENT_FOCUS");
}
}, {
eventName: "EVENT_BLUR",
action: function () {
self.fireEvent("EVENT_BLUR");
}
}, {
eventName: "EVENT_ERROR",
action: function () {
@ -84668,6 +84694,11 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
self.storeTriggerValue = self.getKey();
self.fireEvent("EVENT_FOCUS");
}
}, {
eventName: "EVENT_BLUR",
action: function () {
self.fireEvent("EVENT_BLUR");
}
}, {
eventName: "EVENT_STOP",
action: function () {

39
dist/fineui_without_jquery_polyfill.js vendored

@ -35527,7 +35527,7 @@ BI.Input = BI.inherit(BI.Single, {
blur();
}
function blur() {
function blur () {
if (!self.isValid() && self.options.quitChecker.apply(self, [BI.trim(self.getValue())]) !== false) {
self.element.val(self._lastValidValue ? self._lastValidValue : "");
self._checkValidationOnValueChange();
@ -35594,7 +35594,7 @@ BI.Input = BI.inherit(BI.Single, {
// _valueChange中会更新_lastValue, 这边缓存用以后续STOP事件服务
var lastValue = this._lastValue;
if (BI.trim(this.getValue()) !== BI.trim(this._lastValue || "")) {
if(BI.trim(this.getValue()) !== BI.trim(this._lastValue || "")){
this._valueChange();
}
if (BI.isEndWithBlank(this.getValue())) {
@ -47669,6 +47669,11 @@ BI.extend(BI.DynamicDateCard, {
}
self.fireEvent(BI.DynamicDateCombo.EVENT_FOCUS);
}
}, {
eventName: BI.DynamicDateTrigger.EVENT_BLUR,
action: function () {
self.fireEvent(BI.DynamicDateCombo.EVENT_BLUR);
}
}, {
eventName: BI.DynamicDateTrigger.EVENT_ERROR,
action: function () {
@ -47868,6 +47873,7 @@ BI.extend(BI.DynamicDateCard, {
BI.DynamicDateCombo.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.DynamicDateCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicDateCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateCombo.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDateCombo.EVENT_VALID = "EVENT_VALID";
BI.DynamicDateCombo.EVENT_ERROR = "EVENT_ERROR";
@ -48272,6 +48278,9 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
self.storeTriggerValue = self.getKey();
self.fireEvent(BI.DynamicDateTrigger.EVENT_FOCUS);
});
this.editor.on(BI.SignEditor.EVENT_BLUR, function () {
self.fireEvent(BI.DynamicDateTrigger.EVENT_BLUR);
});
this.editor.on(BI.SignEditor.EVENT_STOP, function () {
self.fireEvent(BI.DynamicDateTrigger.EVENT_STOP);
});
@ -48538,6 +48547,7 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
});
BI.DynamicDateTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTrigger.EVENT_START = "EVENT_START";
BI.DynamicDateTrigger.EVENT_STOP = "EVENT_STOP";
@ -48557,7 +48567,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
},
props: {
baseCls: "bi-dynamic-date-combo bi-border bi-focus-shadow",
baseCls: "bi-dynamic-date-combo bi-border bi-focus-shadow bi-border-radius",
height: 22,
minDate: "1900-01-01",
maxDate: "2099-12-31",
@ -48637,6 +48647,11 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
}
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_FOCUS);
}
}, {
eventName: BI.DynamicDateTimeTrigger.EVENT_BLUR,
action: function () {
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_BLUR);
}
}, {
eventName: BI.DynamicDateTimeTrigger.EVENT_ERROR,
action: function () {
@ -48839,6 +48854,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
BI.DynamicDateTimeCombo.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.DynamicDateTimeCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicDateTimeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTimeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTimeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDateTimeCombo.EVENT_VALID = "EVENT_VALID";
BI.DynamicDateTimeCombo.EVENT_ERROR = "EVENT_ERROR";
@ -49350,6 +49366,9 @@ BI.extend(BI.DynamicDateTimeSelect, {
self.storeTriggerValue = self.getKey();
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_FOCUS);
});
this.editor.on(BI.SignEditor.EVENT_BLUR, function () {
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_BLUR);
});
this.editor.on(BI.SignEditor.EVENT_STOP, function () {
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_STOP);
});
@ -49469,7 +49488,7 @@ BI.extend(BI.DynamicDateTimeSelect, {
v = BI.print(date, c.compareFormat);
result = [0, 1, 2];
}
var dateArray = v.match(/\d+/g);
var dateArray = v.match(/\d+/g) || [];
var newArray = [];
// 处理乱序的年月日
BI.each(dateArray.slice(0, 3), function (idx) {
@ -49641,6 +49660,7 @@ BI.extend(BI.DynamicDateTimeSelect, {
});
BI.DynamicDateTimeTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTimeTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTimeTrigger.EVENT_START = "EVENT_START";
BI.DynamicDateTimeTrigger.EVENT_STOP = "EVENT_STOP";
@ -66747,6 +66767,7 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
isNeedAdjustWidth: false,
el: {
type: "bi.time_trigger",
height: opts.height,
allowEdit: opts.allowEdit,
watermark: opts.watermark,
format: opts.format,
@ -66778,6 +66799,11 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
}
self.fireEvent("EVENT_FOCUS");
}
}, {
eventName: "EVENT_BLUR",
action: function () {
self.fireEvent("EVENT_BLUR");
}
}, {
eventName: "EVENT_ERROR",
action: function () {
@ -66967,6 +66993,11 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
self.storeTriggerValue = self.getKey();
self.fireEvent("EVENT_FOCUS");
}
}, {
eventName: "EVENT_BLUR",
action: function () {
self.fireEvent("EVENT_BLUR");
}
}, {
eventName: "EVENT_STOP",
action: function () {

35
dist/widget.js vendored

@ -2780,6 +2780,11 @@ BI.extend(BI.DynamicDateCard, {
}
self.fireEvent(BI.DynamicDateCombo.EVENT_FOCUS);
}
}, {
eventName: BI.DynamicDateTrigger.EVENT_BLUR,
action: function () {
self.fireEvent(BI.DynamicDateCombo.EVENT_BLUR);
}
}, {
eventName: BI.DynamicDateTrigger.EVENT_ERROR,
action: function () {
@ -2979,6 +2984,7 @@ BI.extend(BI.DynamicDateCard, {
BI.DynamicDateCombo.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.DynamicDateCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicDateCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateCombo.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDateCombo.EVENT_VALID = "EVENT_VALID";
BI.DynamicDateCombo.EVENT_ERROR = "EVENT_ERROR";
@ -3383,6 +3389,9 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
self.storeTriggerValue = self.getKey();
self.fireEvent(BI.DynamicDateTrigger.EVENT_FOCUS);
});
this.editor.on(BI.SignEditor.EVENT_BLUR, function () {
self.fireEvent(BI.DynamicDateTrigger.EVENT_BLUR);
});
this.editor.on(BI.SignEditor.EVENT_STOP, function () {
self.fireEvent(BI.DynamicDateTrigger.EVENT_STOP);
});
@ -3649,6 +3658,7 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
});
BI.DynamicDateTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTrigger.EVENT_START = "EVENT_START";
BI.DynamicDateTrigger.EVENT_STOP = "EVENT_STOP";
@ -3668,7 +3678,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
},
props: {
baseCls: "bi-dynamic-date-combo bi-border bi-focus-shadow",
baseCls: "bi-dynamic-date-combo bi-border bi-focus-shadow bi-border-radius",
height: 22,
minDate: "1900-01-01",
maxDate: "2099-12-31",
@ -3748,6 +3758,11 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
}
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_FOCUS);
}
}, {
eventName: BI.DynamicDateTimeTrigger.EVENT_BLUR,
action: function () {
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_BLUR);
}
}, {
eventName: BI.DynamicDateTimeTrigger.EVENT_ERROR,
action: function () {
@ -3950,6 +3965,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
BI.DynamicDateTimeCombo.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.DynamicDateTimeCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicDateTimeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTimeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTimeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDateTimeCombo.EVENT_VALID = "EVENT_VALID";
BI.DynamicDateTimeCombo.EVENT_ERROR = "EVENT_ERROR";
@ -4461,6 +4477,9 @@ BI.extend(BI.DynamicDateTimeSelect, {
self.storeTriggerValue = self.getKey();
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_FOCUS);
});
this.editor.on(BI.SignEditor.EVENT_BLUR, function () {
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_BLUR);
});
this.editor.on(BI.SignEditor.EVENT_STOP, function () {
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_STOP);
});
@ -4580,7 +4599,7 @@ BI.extend(BI.DynamicDateTimeSelect, {
v = BI.print(date, c.compareFormat);
result = [0, 1, 2];
}
var dateArray = v.match(/\d+/g);
var dateArray = v.match(/\d+/g) || [];
var newArray = [];
// 处理乱序的年月日
BI.each(dateArray.slice(0, 3), function (idx) {
@ -4752,6 +4771,7 @@ BI.extend(BI.DynamicDateTimeSelect, {
});
BI.DynamicDateTimeTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTimeTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTimeTrigger.EVENT_START = "EVENT_START";
BI.DynamicDateTimeTrigger.EVENT_STOP = "EVENT_STOP";
@ -21858,6 +21878,7 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
isNeedAdjustWidth: false,
el: {
type: "bi.time_trigger",
height: opts.height,
allowEdit: opts.allowEdit,
watermark: opts.watermark,
format: opts.format,
@ -21889,6 +21910,11 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
}
self.fireEvent("EVENT_FOCUS");
}
}, {
eventName: "EVENT_BLUR",
action: function () {
self.fireEvent("EVENT_BLUR");
}
}, {
eventName: "EVENT_ERROR",
action: function () {
@ -22078,6 +22104,11 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
self.storeTriggerValue = self.getKey();
self.fireEvent("EVENT_FOCUS");
}
}, {
eventName: "EVENT_BLUR",
action: function () {
self.fireEvent("EVENT_BLUR");
}
}, {
eventName: "EVENT_STOP",
action: function () {

2
src/base/single/a/__test__/a.test.js

@ -12,6 +12,7 @@ describe("ALinkTest", function () {
text: "CCC"
});
expect(a.element.is('a')).to.equal(true);
a.destroy();
});
/**
@ -26,5 +27,6 @@ describe("ALinkTest", function () {
}
});
expect(a.element.is('a') && a.element.hasClass("bi-label")).to.equal(true);
a.destroy();
});
});

107
src/widget/datetime/__test__/datetime.test.js

@ -0,0 +1,107 @@
/**
* @author windy
* @version 2.0
* Created by windy on 2019/9/6
*/
describe("DateTime", function () {
before(function () {
BI.holidays = {
"2010-02-28": true,
"2010-02-27": true
};
});
/**
* test_author_windy
*/
it("defaultValue", function () {
var dateCombo = BI.Test.createWidget({
type: "bi.date_time_combo",
value: {
year: 2018,
month: 2,
day: 23,
hour: 12,
minute: 12,
second: 12
}
});
expect(dateCombo.element.find(".bi-date-time-trigger .bi-label").text()).to.equal("2018-02-23 12:12:12");
dateCombo.destroy();
});
/**
* test_author_windy
*/
it("trigger的confirm-下拉面板选值confirm", function (done) {
var dateCombo = BI.Test.createWidget({
type: "bi.dynamic_date_combo",
width: 220,
height: 30
});
// 点击日期,是否收起下拉
dateCombo.element.find(".bi-date-time-trigger .bi-basic-button").click();
BI.nextTick(function () {
dateCombo.element.find(".bi-calendar:visible .bi-list-item-select :contains(5)").parent().click();
expect(dateCombo.element.find(".bi-date-time-trigger + .bi-popup-view").css("display")).to.equal("block");
dateCombo.destroy();
done();
})
});
/**
* test_author_windy
*/
it("下拉后直接点击外部的触发的confirm", function (done) {
var dateCombo = BI.Test.createWidget({
type: "bi.dynamic_date_combo",
width: 220,
height: 30,
});
// 点击日期,是否收起下拉
BI.nextTick(function () {
dateCombo.element.find(".bi-date-time-trigger .bi-basic-button").click();
BI.nextTick(function () {
var input = dateCombo.element.find(".bi-date-time-trigger .bi-input");
BI.Test.triggerKeyDown(input, null, BI.KeyCode.ENTER, function () {
BI.delay(function () {
expect(dateCombo.element.find(".bi-date-time-trigger + .bi-popup-view").css("display")).to.equal("none");
dateCombo.destroy();
done();
}, 300);
});
})
});
});
/**
* test_author_windy
*/
it("点击确定", function (done) {
var dateCombo = BI.Test.createWidget({
type: "bi.dynamic_date_combo",
width: 220,
height: 30,
value: {
year: 2018,
month: 2,
day: 23
}
});
dateCombo.element.find(".bi-date-time-trigger .bi-basic-button").click();
BI.nextTick(function () {
dateCombo.element.find(".bi-dynamic-date-popup .bi-text:contains(确定)").parent().click();
expect(dateCombo.getValue()).to.deep.equal({
year: 2018,
month: 2,
day: 23
});
dateCombo.destroy();
done();
})
});
});

19
src/widget/downlist/__test__/combo.downlist.test.js

@ -1,19 +0,0 @@
/**
* @author windy
* @version 2.0
* Created by windy on 2019/9/3
*/
describe("DownListCombo", function () {
/**
* test_author_windy
*/
it("defaultValue", function () {
var datePane = BI.Test.createWidget({
type: "bi.down_list_combo",
adjustLength: 10,
items: [[{"el":{"text":"column 1111","iconCls1":"dot-e-font","value":12},"children":[{"text":"column 1.1","value":21,"cls":"dot-e-font"},{"text":"column 1.2","value":22,"cls":"dot-e-font"}]}],[{"el":{"text":"column 1111","iconCls1":"dot-e-font","value":11},"children":[{"text":"column 1.1","value":21,"cls":"dot-e-font"},{"text":"column 1.2","value":22,"cls":"dot-e-font"}]}]]
});
});
});

63
src/widget/downlist/__test__/downlist.test.js

@ -0,0 +1,63 @@
/**
* @author windy
* @version 2.0
* Created by windy on 2019/9/3
*/
describe("DownListCombo", function () {
/**
* test_author_windy
*/
it("defaultValue", function () {
var downListCombo = BI.Test.createWidget({
type: "bi.down_list_combo",
adjustLength: 10,
items: [[{"el":{"text":"column 1111","iconCls1":"dot-e-font","value":12},"children":[{"text":"column 1.1","value":21,"cls":"dot-e-font"},{"text":"column 1.2","value":22,"cls":"dot-e-font"}]}],[{"el":{"text":"column 1111","iconCls1":"dot-e-font","value":11},"children":[{"text":"column 1.1","value":21,"cls":"dot-e-font"},{"text":"column 1.2","value":22,"cls":"dot-e-font"}]}]]
});
downListCombo.setValue([{value: 12, childValue: 21}]);
expect(downListCombo.getValue()).to.deep.equal([ { childValue: 21, value: 12 } ]);
downListCombo.destroy();
});
/**
* test_author_windy
*/
it("点击父亲选值", function (done) {
var downListCombo = BI.Test.createWidget({
type: "bi.down_list_combo",
height: 30,
width: 30,
items: [[{"el":{"text":"column 1111","iconCls1":"dot-e-font","value":12},"children":[{"text":"column 1.1","value":21,"cls":"dot-e-font"},{"text":"column 1.2","value":22,"cls":"dot-e-font"}]}],[{"el":{"text":"column 1111","iconCls1":"dot-e-font","value":11},"children":[{"text":"column 1.1","value":21,"cls":"dot-e-font"},{"text":"column 1.2","value":22,"cls":"dot-e-font"}]}], [{"text": "column 1122", value: 32}, {"text": "column 1133", value: 33}]]
});
downListCombo.element.children(".pull-down-font").click();
BI.nextTick(function () {
downListCombo.element.find(".bi-down-list-group:last-child .bi-down-list-item").click();
expect(downListCombo.getValue()).to.deep.equal([ { value: 33 } ]);
done();
});
});
/**
* test_author_windy
*/
it("点击儿子选值", function (done) {
var downListCombo = BI.Test.createWidget({
type: "bi.down_list_combo",
height: 30,
width: 30,
items: [[{"el":{"text":"column 1111","iconCls1":"dot-e-font","value":12},"children":[{"text":"column 1.1","value":21,"cls":"dot-e-font"},{"text":"column 1.2","value":22,"cls":"dot-e-font"}]}],[{"el":{"text":"column 1111","iconCls1":"dot-e-font","value":11},"children":[{"text":"column 1.1","value":21,"cls":"dot-e-font"},{"text":"column 1.2","value":22,"cls":"dot-e-font"}]}]]
});
downListCombo.element.children(".pull-down-font").click();
BI.Test.triggerMouseover(downListCombo.element.find(".bi-down-list-group:first-child .bi-down-list-group-item"), function () {
BI.nextTick(function () {
downListCombo.element.find(".child-down-list-item:first-child").click();
expect(downListCombo.getValue()).to.deep.equal([ { childValue: 21, value: 12 } ]);
downListCombo.destroy();
done();
});
});
});
});

65
src/widget/dynamicdate/__test__/dynamicdate.combo.test.js → src/widget/dynamicdate/__test__/dynamicdate.test.js

@ -6,6 +6,13 @@
describe("DateCombo", function () {
before(function () {
BI.holidays = {
"2010-02-28": true,
"2010-02-27": true
};
});
/**
* test_author_windy
*/
@ -202,6 +209,64 @@ describe("DateCombo", function () {
})
});
/**
* test_author_windy
*/
it("测试动态默认值", function () {
var dateCombo = BI.Test.createWidget({
type: "bi.dynamic_date_combo",
width: 220,
height: 30,
value: {
type: 2,
value: {
year: -1,
month: 1,
quarter: -1,
week: 1,
day: -1,
position: 2
}
}
});
expect(dateCombo.getValue()).to.deep.equal({
type: 2,
value: {
year: -1,
month: 1,
quarter: -1,
week: 1,
day: -1,
position: 2
}
});
dateCombo.destroy();
});
/**
* test_author_windy
*/
it("测试工作日动态默认值", function () {
var dateCombo = BI.Test.createWidget({
type: "bi.dynamic_date_combo",
width: 220,
height: 30,
value: {
type: 2,
value: {
workDay: -1
}
}
});
expect(dateCombo.getValue()).to.deep.equal({
type: 2,
value: {
workDay: -1
}
});
dateCombo.destroy();
});
/**
* test_author_windy

6
src/widget/dynamicdate/dynamicdate.combo.js

@ -82,6 +82,11 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
}
self.fireEvent(BI.DynamicDateCombo.EVENT_FOCUS);
}
}, {
eventName: BI.DynamicDateTrigger.EVENT_BLUR,
action: function () {
self.fireEvent(BI.DynamicDateCombo.EVENT_BLUR);
}
}, {
eventName: BI.DynamicDateTrigger.EVENT_ERROR,
action: function () {
@ -281,6 +286,7 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
BI.DynamicDateCombo.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.DynamicDateCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicDateCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateCombo.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDateCombo.EVENT_VALID = "EVENT_VALID";
BI.DynamicDateCombo.EVENT_ERROR = "EVENT_ERROR";

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

@ -58,6 +58,9 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, {
self.storeTriggerValue = self.getKey();
self.fireEvent(BI.DynamicDateTrigger.EVENT_FOCUS);
});
this.editor.on(BI.SignEditor.EVENT_BLUR, function () {
self.fireEvent(BI.DynamicDateTrigger.EVENT_BLUR);
});
this.editor.on(BI.SignEditor.EVENT_STOP, function () {
self.fireEvent(BI.DynamicDateTrigger.EVENT_STOP);
});
@ -324,6 +327,7 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, {
});
BI.DynamicDateTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTrigger.EVENT_START = "EVENT_START";
BI.DynamicDateTrigger.EVENT_STOP = "EVENT_STOP";

330
src/widget/dynamicdatetime/__test__/dynamicdatetime.test.js

@ -0,0 +1,330 @@
/**
* @author windy
* @version 2.0
* Created by windy on 2019/9/4
*/
describe("DateTimeCombo", function () {
before(function () {
BI.holidays = {
"2010-02-28": true,
"2010-02-27": true
};
});
/**
* test_author_windy
*/
it("defaultValue", function (done) {
var dateCombo = BI.Test.createWidget({
type: "bi.dynamic_date_time_combo",
value: {
type: 1,
value: {
year: 2018,
month: 2,
day: 23,
hour: 12,
minute: 12,
second: 12
}
}
});
BI.nextTick(function () {
expect(dateCombo.element.find(".bi-date-time-trigger .bi-label").text()).to.equal("2018-02-23 12:12:12");
dateCombo.destroy();
done();
})
});
/**
* test_author_windy
*/
it("测试输入值收起下拉清空值下拉出现", function (done) {
var dateCombo = BI.Test.createWidget({
type: "bi.dynamic_date_time_combo",
width: 220,
height: 30,
value: {
type: 1,
value: {
year: 2018,
month: 2,
day: 23,
hour: 12,
minute: 12,
second: 12
}
}
});
BI.nextTick(function () {
dateCombo.element.find(".bi-date-time-trigger .bi-basic-button").click();
// 输入8, 检查popup是否收起
BI.Test.triggerKeyDown(dateCombo.element.find(".bi-date-time-trigger .bi-input"), "8", 56, function () {
BI.nextTick(function () {
expect(dateCombo.element.find(".bi-date-time-trigger + .bi-popup-view").css("display")).to.equal("none");
// 清空输入, 检查popup是否弹出
BI.Test.triggerKeyDown(dateCombo.element.find(".bi-date-time-trigger .bi-input"), "", BI.KeyCode.BACKSPACE, function () {
BI.nextTick(function () {
expect(dateCombo.element.find(".bi-date-time-trigger + .bi-popup-view").css("display")).to.equal("block");
dateCombo.destroy();
done();
});
});
});
});
});
});
/**
* test_author_windy
*/
it("trigger的confirm-下拉面板选值confirm", function (done) {
var dateCombo = BI.Test.createWidget({
type: "bi.dynamic_date_time_combo",
width: 220,
height: 30
});
// 点击日期,是否收起下拉
dateCombo.element.find(".bi-date-time-trigger .bi-basic-button").click();
BI.nextTick(function () {
dateCombo.element.find(".bi-calendar:visible .bi-list-item-select :contains(5)").parent().click();
expect(dateCombo.element.find(".bi-date-time-trigger + .bi-popup-view").css("display")).to.equal("block");
dateCombo.destroy();
done();
})
});
/**
* test_author_windy
*/
it("下拉后直接点击外部的触发的confirm", function (done) {
var dateCombo = BI.Test.createWidget({
type: "bi.dynamic_date_time_combo",
width: 220,
height: 30,
});
// 点击日期,是否收起下拉
BI.nextTick(function () {
dateCombo.element.find(".bi-date-time-trigger .bi-basic-button").click();
BI.nextTick(function () {
var input = dateCombo.element.find(".bi-date-time-trigger .bi-input");
BI.Test.triggerKeyDown(input, null, BI.KeyCode.ENTER, function () {
BI.delay(function () {
expect(dateCombo.element.find(".bi-date-time-trigger + .bi-popup-view").css("display")).to.equal("none");
dateCombo.destroy();
done();
}, 300);
});
})
});
});
/**
* test_author_windy
*/
it("点击清空", function (done) {
var dateCombo = BI.Test.createWidget({
type: "bi.dynamic_date_time_combo",
width: 220,
height: 30,
value: {
type: 1,
value: {
year: 2018,
month: 2,
day: 23,
hour: 12,
minute: 12,
second: 12
}
}
});
dateCombo.element.find(".bi-date-time-trigger .bi-basic-button").click();
BI.nextTick(function () {
dateCombo.element.find(".bi-dynamic-date-time-popup .bi-text:contains(清除)").parent().click();
expect(BI.isNull(dateCombo.getValue())).to.equal(true);
dateCombo.destroy();
done();
})
});
/**
* test_author_windy
*/
it("点击今天", function (done) {
var dateCombo = BI.Test.createWidget({
type: "bi.dynamic_date_time_combo",
width: 220,
height: 30,
value: {
type: 1,
value: {
year: 2018,
month: 2,
day: 23,
hour: 12,
minute: 12,
second: 12
}
}
});
dateCombo.element.find(".bi-date-time-trigger .bi-basic-button").click();
BI.nextTick(function () {
dateCombo.element.find(".bi-dynamic-date-time-popup .bi-text:contains(今天)").parent().click();
var date = BI.getDate();
expect(dateCombo.getValue()).to.deep.equal({
type: 1,
value: {
year: date.getFullYear(),
month: date.getMonth() + 1,
day: date.getDate(),
hour: 0,
minute: 0,
second: 0
}
});
dateCombo.destroy();
done();
})
});
/**
* test_author_windy
*/
it("点击确定", function (done) {
var dateCombo = BI.Test.createWidget({
type: "bi.dynamic_date_time_combo",
width: 220,
height: 30,
value: {
type: 1,
value: {
year: 2018,
month: 2,
day: 23,
hour: 12,
minute: 12,
second: 12
}
}
});
dateCombo.element.find(".bi-date-time-trigger .bi-basic-button").click();
BI.nextTick(function () {
dateCombo.element.find(".bi-dynamic-date-time-popup .bi-text:contains(确定)").parent().click();
expect(dateCombo.getValue()).to.deep.equal({
type: 1,
value: {
year: 2018,
month: 2,
day: 23,
hour: 12,
minute: 12,
second: 12
}
});
dateCombo.destroy();
done();
})
});
/**
* test_author_windy
*/
it("测试动态默认值", function () {
var dateCombo = BI.Test.createWidget({
type: "bi.dynamic_date_time_combo",
width: 220,
height: 30,
value: {
type: 2,
value: {
year: -1,
month: 1,
quarter: -1,
week: 1,
day: -1,
position: 2
}
}
});
dateCombo.element.find(".bi-date-time-trigger .bi-basic-button").click();
expect(dateCombo.getValue()).to.deep.equal({
type: 2,
value: {
year: -1,
month: 1,
quarter: -1,
week: 1,
day: -1,
position: 2
}
});
dateCombo.destroy();
});
/**
* test_author_windy
*/
it("测试工作日动态默认值", function () {
var dateCombo = BI.Test.createWidget({
type: "bi.dynamic_date_time_combo",
width: 220,
height: 30,
value: {
type: 2,
value: {
workDay: -1
}
}
});
expect(dateCombo.getValue()).to.deep.equal({
type: 2,
value: {
workDay: -1
}
});
dateCombo.destroy();
});
/**
* test_author_windy
*/
it("trigger的输入日期后confirm", function (done) {
var dateCombo = BI.Test.createWidget({
type: "bi.dynamic_date_time_combo",
width: 220,
height: 30,
value: {
type: 1,
value: {
year: 2018,
month: 2,
day: 23
}
}
});
BI.nextTick(function () {
dateCombo.element.find(".bi-date-time-trigger .bi-basic-button").click();
BI.nextTick(function () {
var input = dateCombo.element.find(".bi-date-time-trigger .bi-input");
input.val("2017-1-1");
BI.Test.triggerKeyDown(dateCombo.element.find(".bi-date-time-trigger .bi-input"), null, BI.KeyCode.ENTER, function () {
BI.delay(function () {
expect(dateCombo.element.find(".bi-date-time-trigger .bi-text-button").text()).to.equal("2017-01-01 00:00:00");
dateCombo.destroy();
done();
}, 300);
});
});
})
});
});

8
src/widget/dynamicdatetime/dynamicdatetime.combo.js

@ -7,7 +7,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
},
props: {
baseCls: "bi-dynamic-date-combo bi-border bi-focus-shadow",
baseCls: "bi-dynamic-date-combo bi-border bi-focus-shadow bi-border-radius",
height: 22,
minDate: "1900-01-01",
maxDate: "2099-12-31",
@ -87,6 +87,11 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
}
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_FOCUS);
}
}, {
eventName: BI.DynamicDateTimeTrigger.EVENT_BLUR,
action: function () {
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_BLUR);
}
}, {
eventName: BI.DynamicDateTimeTrigger.EVENT_ERROR,
action: function () {
@ -289,6 +294,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
BI.DynamicDateTimeCombo.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.DynamicDateTimeCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicDateTimeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTimeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTimeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDateTimeCombo.EVENT_VALID = "EVENT_VALID";
BI.DynamicDateTimeCombo.EVENT_ERROR = "EVENT_ERROR";

6
src/widget/dynamicdatetime/dynamicdatetime.trigger.js

@ -58,6 +58,9 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, {
self.storeTriggerValue = self.getKey();
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_FOCUS);
});
this.editor.on(BI.SignEditor.EVENT_BLUR, function () {
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_BLUR);
});
this.editor.on(BI.SignEditor.EVENT_STOP, function () {
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_STOP);
});
@ -177,7 +180,7 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, {
v = BI.print(date, c.compareFormat);
result = [0, 1, 2];
}
var dateArray = v.match(/\d+/g);
var dateArray = v.match(/\d+/g) || [];
var newArray = [];
// 处理乱序的年月日
BI.each(dateArray.slice(0, 3), function (idx) {
@ -349,6 +352,7 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, {
});
BI.DynamicDateTimeTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTimeTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTimeTrigger.EVENT_START = "EVENT_START";
BI.DynamicDateTimeTrigger.EVENT_STOP = "EVENT_STOP";

6
src/widget/time/time.combo.js

@ -65,6 +65,7 @@
isNeedAdjustWidth: false,
el: {
type: "bi.time_trigger",
height: opts.height,
allowEdit: opts.allowEdit,
watermark: opts.watermark,
format: opts.format,
@ -96,6 +97,11 @@
}
self.fireEvent("EVENT_FOCUS");
}
}, {
eventName: "EVENT_BLUR",
action: function () {
self.fireEvent("EVENT_BLUR");
}
}, {
eventName: "EVENT_ERROR",
action: function () {

5
src/widget/time/time.trigger.js

@ -64,6 +64,11 @@
self.storeTriggerValue = self.getKey();
self.fireEvent("EVENT_FOCUS");
}
}, {
eventName: "EVENT_BLUR",
action: function () {
self.fireEvent("EVENT_BLUR");
}
}, {
eventName: "EVENT_STOP",
action: function () {

10
test/utils.js

@ -32,6 +32,16 @@
element.trigger(e2);
callback();
}, 300);
},
/**
* 模拟一次鼠标hover
*/
triggerMouseover: function (element, callback) {
// keydown
var e = $.Event("mouseover");
element.trigger(e);
callback && callback();
}
})
})();
Loading…
Cancel
Save