Browse Source

refactor: 重构numbereditor存值逻辑

es6
windy 5 years ago
parent
commit
c5cfb38435
  1. 8
      dist/2.0/fineui.ie.js
  2. 8
      dist/2.0/fineui.js
  3. 8
      dist/bundle.ie.js
  4. 8
      dist/bundle.js
  5. 8
      dist/fineui.ie.js
  6. 8
      dist/fineui.js
  7. 8
      dist/fineui_without_jquery_polyfill.js
  8. 8
      dist/widget.js
  9. 4
      src/widget/datetimepane/__test__/datetimepane.test.js
  10. 8
      src/widget/numbereditor/number.editor.js

8
dist/2.0/fineui.ie.js vendored

@ -77562,11 +77562,15 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
errorText: o.errorText
});
this.editor.on(BI.TextEditor.EVENT_CHANGE, function () {
o.value = BI.parseFloat(this.getValue());
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () {
this.editor.on(BI.TextEditor.EVENT_ERROR, function () {
o.value = BI.parseFloat(this.getLastValidValue());
});
this.editor.on(BI.TextEditor.EVENT_VALID, function () {
o.value = BI.parseFloat(this.getValue());
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () {
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
});
this.topBtn = BI.createWidget({

8
dist/2.0/fineui.js vendored

@ -77966,11 +77966,15 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
errorText: o.errorText
});
this.editor.on(BI.TextEditor.EVENT_CHANGE, function () {
o.value = BI.parseFloat(this.getValue());
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () {
this.editor.on(BI.TextEditor.EVENT_ERROR, function () {
o.value = BI.parseFloat(this.getLastValidValue());
});
this.editor.on(BI.TextEditor.EVENT_VALID, function () {
o.value = BI.parseFloat(this.getValue());
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () {
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
});
this.topBtn = BI.createWidget({

8
dist/bundle.ie.js vendored

@ -77562,11 +77562,15 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
errorText: o.errorText
});
this.editor.on(BI.TextEditor.EVENT_CHANGE, function () {
o.value = BI.parseFloat(this.getValue());
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () {
this.editor.on(BI.TextEditor.EVENT_ERROR, function () {
o.value = BI.parseFloat(this.getLastValidValue());
});
this.editor.on(BI.TextEditor.EVENT_VALID, function () {
o.value = BI.parseFloat(this.getValue());
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () {
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
});
this.topBtn = BI.createWidget({

8
dist/bundle.js vendored

@ -77966,11 +77966,15 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
errorText: o.errorText
});
this.editor.on(BI.TextEditor.EVENT_CHANGE, function () {
o.value = BI.parseFloat(this.getValue());
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () {
this.editor.on(BI.TextEditor.EVENT_ERROR, function () {
o.value = BI.parseFloat(this.getLastValidValue());
});
this.editor.on(BI.TextEditor.EVENT_VALID, function () {
o.value = BI.parseFloat(this.getValue());
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () {
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
});
this.topBtn = BI.createWidget({

8
dist/fineui.ie.js vendored

@ -77807,11 +77807,15 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
errorText: o.errorText
});
this.editor.on(BI.TextEditor.EVENT_CHANGE, function () {
o.value = BI.parseFloat(this.getValue());
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () {
this.editor.on(BI.TextEditor.EVENT_ERROR, function () {
o.value = BI.parseFloat(this.getLastValidValue());
});
this.editor.on(BI.TextEditor.EVENT_VALID, function () {
o.value = BI.parseFloat(this.getValue());
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () {
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
});
this.topBtn = BI.createWidget({

8
dist/fineui.js vendored

@ -78211,11 +78211,15 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
errorText: o.errorText
});
this.editor.on(BI.TextEditor.EVENT_CHANGE, function () {
o.value = BI.parseFloat(this.getValue());
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () {
this.editor.on(BI.TextEditor.EVENT_ERROR, function () {
o.value = BI.parseFloat(this.getLastValidValue());
});
this.editor.on(BI.TextEditor.EVENT_VALID, function () {
o.value = BI.parseFloat(this.getValue());
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () {
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
});
this.topBtn = BI.createWidget({

8
dist/fineui_without_jquery_polyfill.js vendored

@ -60510,11 +60510,15 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
errorText: o.errorText
});
this.editor.on(BI.TextEditor.EVENT_CHANGE, function () {
o.value = BI.parseFloat(this.getValue());
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () {
this.editor.on(BI.TextEditor.EVENT_ERROR, function () {
o.value = BI.parseFloat(this.getLastValidValue());
});
this.editor.on(BI.TextEditor.EVENT_VALID, function () {
o.value = BI.parseFloat(this.getValue());
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () {
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
});
this.topBtn = BI.createWidget({

8
dist/widget.js vendored

@ -15621,11 +15621,15 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
errorText: o.errorText
});
this.editor.on(BI.TextEditor.EVENT_CHANGE, function () {
o.value = BI.parseFloat(this.getValue());
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () {
this.editor.on(BI.TextEditor.EVENT_ERROR, function () {
o.value = BI.parseFloat(this.getLastValidValue());
});
this.editor.on(BI.TextEditor.EVENT_VALID, function () {
o.value = BI.parseFloat(this.getValue());
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () {
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
});
this.topBtn = BI.createWidget({

4
src/widget/datetimepane/__test__/datetimepane.test.js

@ -102,14 +102,14 @@ describe("DateTimePane", function () {
datePane.element.find(".bi-month-combo .bi-list-item-select").get(2).click();
BI.nextTick(function () {
datePane.element.find(".bi-calendar:visible .bi-list-item-select :contains(27)").parent().click();
datePane.element.find(".bi-date-time-select .bi-number-editor .top-button").click();
datePane.element.find(".bi-date-time-select .bi-number-editor .top-button").get(0).click();
expect(datePane.getValue()).to.deep.equal({
type: 1,
value: {
year: 2019,
month: 2,
day: 27,
hour: 0,
hour: 1,
minute: 0,
second: 0
}

8
src/widget/numbereditor/number.editor.js

@ -31,11 +31,15 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
errorText: o.errorText
});
this.editor.on(BI.TextEditor.EVENT_CHANGE, function () {
o.value = BI.parseFloat(this.getValue());
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () {
this.editor.on(BI.TextEditor.EVENT_ERROR, function () {
o.value = BI.parseFloat(this.getLastValidValue());
});
this.editor.on(BI.TextEditor.EVENT_VALID, function () {
o.value = BI.parseFloat(this.getValue());
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () {
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
});
this.topBtn = BI.createWidget({

Loading…
Cancel
Save