Browse Source

BI-18754

es6
windy 7 years ago
parent
commit
f397c9c28e
  1. 6
      dist/_fineui.min.js
  2. 76
      dist/bundle.js
  3. 6
      dist/bundle.min.js
  4. 3
      dist/case.js
  5. 105
      dist/demo.js
  6. 76
      dist/fineui.js
  7. 6
      dist/fineui.min.js
  8. 73
      dist/widget.js
  9. 3
      src/case/richeditor/niceditor/niceditor.js

6
dist/_fineui.min.js vendored

File diff suppressed because one or more lines are too long

76
dist/bundle.js vendored

@ -83198,7 +83198,8 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
}
this.instanceDoc = document.defaultView;
this.elm.element.on("mousedown", BI.bind(this.selected, this));
this.elm.element.on("keydown", BI.bind(this.keyDown, this));
this.elm.element.on("keyup", BI.bind(this.keyDown, this));
// this.elm.element.on("keydown", BI.bind(this.keyDown, this));
this.elm.element.on("focus", BI.bind(this.selected, this));
this.elm.element.on("blur", BI.bind(this.blur, this));
this.elm.element.on("keyup", BI.bind(this.selected, this));
@ -109391,20 +109392,7 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY
self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_STOP);
});
editor.on(BI.SignEditor.EVENT_CONFIRM, function () {
var value = editor.getValue();
if (BI.isNotNull(value)) {
editor.setValue(value);
}
var monthValue = self.monthEditor.getValue();
self.storeValue = {
type: BI.DynamicDateCombo.Static,
value: {
year: self.yearEditor.getValue(),
month: BI.isEmptyString(self.monthEditor.getValue()) ? "" : monthValue
}
};
self.setTitle(self._getStaticTitle(self.storeValue.value));
self._doEditorConfirm(editor);
self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_CONFIRM);
});
editor.on(BI.SignEditor.EVENT_SPACE, function () {
@ -109429,21 +109417,40 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY
});
editor.on(BI.SignEditor.EVENT_CHANGE, function () {
if(isYear) {
self._autoSwitch(editor.getValue());
self._autoSwitch(editor);
}
});
return editor;
},
_doEditorConfirm: function (editor) {
var value = editor.getValue();
if (BI.isNotNull(value)) {
editor.setValue(value);
}
var monthValue = this.monthEditor.getValue();
this.storeValue = {
type: BI.DynamicDateCombo.Static,
value: {
year: this.yearEditor.getValue(),
month: BI.isEmptyString(this.monthEditor.getValue()) ? "" : monthValue
}
};
this.setTitle(this._getStaticTitle(this.storeValue.value));
},
_yearCheck: function (v) {
var date = BI.parseDateTime(v, "%Y-%X-%d").print("%Y-%X-%d");
return BI.parseDateTime(v, "%Y").print("%Y") === v && date >= this.options.min && date <= this.options.max;
},
_autoSwitch: function (v) {
_autoSwitch: function (editor) {
var v = editor.getValue();
if (BI.checkDateLegal(v)) {
if (v.length === 4 && this._yearCheck(v)) {
this._doEditorConfirm(editor);
this.fireEvent(BI.DynamicYearMonthTrigger.EVENT_CONFIRM);
this.monthEditor.focus();
}
}
@ -110343,20 +110350,7 @@ BI.shortcut("bi.dynamic_year_quarter_popup", BI.DynamicYearQuarterPopup);BI.Dyna
self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_STOP);
});
editor.on(BI.SignEditor.EVENT_CONFIRM, function () {
var value = editor.getValue();
if (BI.isNotNull(value)) {
editor.setValue(value);
}
var quarterValue = self.quarterEditor.getValue();
self.storeValue = {
type: BI.DynamicYearQuarterCombo.Static,
value: {
year: self.yearEditor.getValue(),
quarter: BI.isEmptyString(self.quarterEditor.getValue()) ? "" : quarterValue
}
};
self.setTitle(self._getStaticTitle(self.storeValue.value));
self._doEditorConfirm(editor);
self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_CONFIRM);
});
editor.on(BI.SignEditor.EVENT_SPACE, function () {
@ -110379,14 +110373,32 @@ BI.shortcut("bi.dynamic_year_quarter_popup", BI.DynamicYearQuarterPopup);BI.Dyna
return editor;
},
_doEditorConfirm: function (editor) {
var value = editor.getValue();
if (BI.isNotNull(value)) {
editor.setValue(value);
}
var quarterValue = this.quarterEditor.getValue();
this.storeValue = {
type: BI.DynamicYearQuarterCombo.Static,
value: {
year: this.yearEditor.getValue(),
quarter: BI.isEmptyString(this.quarterEditor.getValue()) ? "" : quarterValue
}
};
this.setTitle(this._getStaticTitle(this.storeValue.value));
},
_yearCheck: function (v) {
var date = BI.parseDateTime(v, "%Y-%X-%d").print("%Y-%X-%d");
return BI.parseDateTime(v, "%Y").print("%Y") === v && date >= this.options.min && date <= this.options.max;
},
_autoSwitch: function (v) {
_autoSwitch: function (editor) {
var v = editor.getValue();
if (BI.checkDateLegal(v)) {
if (v.length === 4 && this._yearCheck(v)) {
this._doEditorConfirm(editor);
this.quarterEditor.focus();
}
}

6
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

3
dist/case.js vendored

@ -10743,7 +10743,8 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
}
this.instanceDoc = document.defaultView;
this.elm.element.on("mousedown", BI.bind(this.selected, this));
this.elm.element.on("keydown", BI.bind(this.keyDown, this));
this.elm.element.on("keyup", BI.bind(this.keyDown, this));
// this.elm.element.on("keydown", BI.bind(this.keyDown, this));
this.elm.element.on("focus", BI.bind(this.selected, this));
this.elm.element.on("blur", BI.bind(this.blur, this));
this.elm.element.on("keyup", BI.bind(this.selected, this));

105
dist/demo.js vendored

@ -11014,6 +11014,111 @@ BI.shortcut("demo.tmp", Demo.Func);
});
BI.shortcut("demo.fix_global_watcher", Demo.Fix);
}());(function () {
var State = BI.inherit(Fix.Model, {
state: function () {
return {
name: "原始属性",
info: {
age: 12,
sex: "male",
birth: {
year: 2018,
month: 9,
day: 11
}
},
career: [{
a: 1,
b: 2,
c: 3
}]
};
},
computed: {
b: function () {
return this.model.name + "-计算属性";
},
birth: function () {
return this.model.info.birth;
}
}
});
Demo.Fix = BI.inherit(BI.Widget, {
_store: function () {
return new State();
},
watch: {
b: function () {
this.button.setText(this.model.b);
},
"birth.**": function () {
console.log(123);
}
},
render: function () {
var self = this;
return {
type: "bi.vertical",
items: [{
el: {
type: "bi.button",
ref: function () {
self.button = this;
},
handler: function () {
self.model.name = "这是改变后的属性";
},
text: this.model.b
}
}, {
el: {
type: "bi.button",
ref: function () {
self.button = this;
},
handler: function () {
self.model.birth.year = 2019;
},
text: "birthYearButton"
}
}, {
el: {
type: "bi.button",
ref: function () {
self.button = this;
},
handler: function () {
self.model.career.push({
year: 2017,
month: 3,
day: 24
});
},
text: "careerAddButton"
}
}, {
el: {
type: "bi.button",
ref: function () {
self.button = this;
},
handler: function () {
self.model.career[0].a = 24;
},
text: "careerChangeButton"
}
}]
};
},
mounted: function () {
}
});
BI.shortcut("demo.fix_immutable", Demo.Fix);
}());/**
* @Author: Young
* @CreationDate 2017-11-06 10:32

76
dist/fineui.js vendored

@ -83441,7 +83441,8 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
}
this.instanceDoc = document.defaultView;
this.elm.element.on("mousedown", BI.bind(this.selected, this));
this.elm.element.on("keydown", BI.bind(this.keyDown, this));
this.elm.element.on("keyup", BI.bind(this.keyDown, this));
// this.elm.element.on("keydown", BI.bind(this.keyDown, this));
this.elm.element.on("focus", BI.bind(this.selected, this));
this.elm.element.on("blur", BI.bind(this.blur, this));
this.elm.element.on("keyup", BI.bind(this.selected, this));
@ -109634,20 +109635,7 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY
self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_STOP);
});
editor.on(BI.SignEditor.EVENT_CONFIRM, function () {
var value = editor.getValue();
if (BI.isNotNull(value)) {
editor.setValue(value);
}
var monthValue = self.monthEditor.getValue();
self.storeValue = {
type: BI.DynamicDateCombo.Static,
value: {
year: self.yearEditor.getValue(),
month: BI.isEmptyString(self.monthEditor.getValue()) ? "" : monthValue
}
};
self.setTitle(self._getStaticTitle(self.storeValue.value));
self._doEditorConfirm(editor);
self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_CONFIRM);
});
editor.on(BI.SignEditor.EVENT_SPACE, function () {
@ -109672,21 +109660,40 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY
});
editor.on(BI.SignEditor.EVENT_CHANGE, function () {
if(isYear) {
self._autoSwitch(editor.getValue());
self._autoSwitch(editor);
}
});
return editor;
},
_doEditorConfirm: function (editor) {
var value = editor.getValue();
if (BI.isNotNull(value)) {
editor.setValue(value);
}
var monthValue = this.monthEditor.getValue();
this.storeValue = {
type: BI.DynamicDateCombo.Static,
value: {
year: this.yearEditor.getValue(),
month: BI.isEmptyString(this.monthEditor.getValue()) ? "" : monthValue
}
};
this.setTitle(this._getStaticTitle(this.storeValue.value));
},
_yearCheck: function (v) {
var date = BI.parseDateTime(v, "%Y-%X-%d").print("%Y-%X-%d");
return BI.parseDateTime(v, "%Y").print("%Y") === v && date >= this.options.min && date <= this.options.max;
},
_autoSwitch: function (v) {
_autoSwitch: function (editor) {
var v = editor.getValue();
if (BI.checkDateLegal(v)) {
if (v.length === 4 && this._yearCheck(v)) {
this._doEditorConfirm(editor);
this.fireEvent(BI.DynamicYearMonthTrigger.EVENT_CONFIRM);
this.monthEditor.focus();
}
}
@ -110586,20 +110593,7 @@ BI.shortcut("bi.dynamic_year_quarter_popup", BI.DynamicYearQuarterPopup);BI.Dyna
self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_STOP);
});
editor.on(BI.SignEditor.EVENT_CONFIRM, function () {
var value = editor.getValue();
if (BI.isNotNull(value)) {
editor.setValue(value);
}
var quarterValue = self.quarterEditor.getValue();
self.storeValue = {
type: BI.DynamicYearQuarterCombo.Static,
value: {
year: self.yearEditor.getValue(),
quarter: BI.isEmptyString(self.quarterEditor.getValue()) ? "" : quarterValue
}
};
self.setTitle(self._getStaticTitle(self.storeValue.value));
self._doEditorConfirm(editor);
self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_CONFIRM);
});
editor.on(BI.SignEditor.EVENT_SPACE, function () {
@ -110622,14 +110616,32 @@ BI.shortcut("bi.dynamic_year_quarter_popup", BI.DynamicYearQuarterPopup);BI.Dyna
return editor;
},
_doEditorConfirm: function (editor) {
var value = editor.getValue();
if (BI.isNotNull(value)) {
editor.setValue(value);
}
var quarterValue = this.quarterEditor.getValue();
this.storeValue = {
type: BI.DynamicYearQuarterCombo.Static,
value: {
year: this.yearEditor.getValue(),
quarter: BI.isEmptyString(this.quarterEditor.getValue()) ? "" : quarterValue
}
};
this.setTitle(this._getStaticTitle(this.storeValue.value));
},
_yearCheck: function (v) {
var date = BI.parseDateTime(v, "%Y-%X-%d").print("%Y-%X-%d");
return BI.parseDateTime(v, "%Y").print("%Y") === v && date >= this.options.min && date <= this.options.max;
},
_autoSwitch: function (v) {
_autoSwitch: function (editor) {
var v = editor.getValue();
if (BI.checkDateLegal(v)) {
if (v.length === 4 && this._yearCheck(v)) {
this._doEditorConfirm(editor);
this.quarterEditor.focus();
}
}

6
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

73
dist/widget.js vendored

@ -21924,20 +21924,7 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY
self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_STOP);
});
editor.on(BI.SignEditor.EVENT_CONFIRM, function () {
var value = editor.getValue();
if (BI.isNotNull(value)) {
editor.setValue(value);
}
var monthValue = self.monthEditor.getValue();
self.storeValue = {
type: BI.DynamicDateCombo.Static,
value: {
year: self.yearEditor.getValue(),
month: BI.isEmptyString(self.monthEditor.getValue()) ? "" : monthValue
}
};
self.setTitle(self._getStaticTitle(self.storeValue.value));
self._doEditorConfirm(editor);
self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_CONFIRM);
});
editor.on(BI.SignEditor.EVENT_SPACE, function () {
@ -21962,21 +21949,40 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY
});
editor.on(BI.SignEditor.EVENT_CHANGE, function () {
if(isYear) {
self._autoSwitch(editor.getValue());
self._autoSwitch(editor);
}
});
return editor;
},
_doEditorConfirm: function (editor) {
var value = editor.getValue();
if (BI.isNotNull(value)) {
editor.setValue(value);
}
var monthValue = this.monthEditor.getValue();
this.storeValue = {
type: BI.DynamicDateCombo.Static,
value: {
year: this.yearEditor.getValue(),
month: BI.isEmptyString(this.monthEditor.getValue()) ? "" : monthValue
}
};
this.setTitle(this._getStaticTitle(this.storeValue.value));
},
_yearCheck: function (v) {
var date = BI.parseDateTime(v, "%Y-%X-%d").print("%Y-%X-%d");
return BI.parseDateTime(v, "%Y").print("%Y") === v && date >= this.options.min && date <= this.options.max;
},
_autoSwitch: function (v) {
_autoSwitch: function (editor) {
var v = editor.getValue();
if (BI.checkDateLegal(v)) {
if (v.length === 4 && this._yearCheck(v)) {
this._doEditorConfirm(editor);
this.fireEvent(BI.DynamicYearMonthTrigger.EVENT_CONFIRM);
this.monthEditor.focus();
}
}
@ -22876,20 +22882,7 @@ BI.shortcut("bi.dynamic_year_quarter_popup", BI.DynamicYearQuarterPopup);BI.Dyna
self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_STOP);
});
editor.on(BI.SignEditor.EVENT_CONFIRM, function () {
var value = editor.getValue();
if (BI.isNotNull(value)) {
editor.setValue(value);
}
var quarterValue = self.quarterEditor.getValue();
self.storeValue = {
type: BI.DynamicYearQuarterCombo.Static,
value: {
year: self.yearEditor.getValue(),
quarter: BI.isEmptyString(self.quarterEditor.getValue()) ? "" : quarterValue
}
};
self.setTitle(self._getStaticTitle(self.storeValue.value));
self._doEditorConfirm(editor);
self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_CONFIRM);
});
editor.on(BI.SignEditor.EVENT_SPACE, function () {
@ -22912,14 +22905,32 @@ BI.shortcut("bi.dynamic_year_quarter_popup", BI.DynamicYearQuarterPopup);BI.Dyna
return editor;
},
_doEditorConfirm: function (editor) {
var value = editor.getValue();
if (BI.isNotNull(value)) {
editor.setValue(value);
}
var quarterValue = this.quarterEditor.getValue();
this.storeValue = {
type: BI.DynamicYearQuarterCombo.Static,
value: {
year: this.yearEditor.getValue(),
quarter: BI.isEmptyString(this.quarterEditor.getValue()) ? "" : quarterValue
}
};
this.setTitle(this._getStaticTitle(this.storeValue.value));
},
_yearCheck: function (v) {
var date = BI.parseDateTime(v, "%Y-%X-%d").print("%Y-%X-%d");
return BI.parseDateTime(v, "%Y").print("%Y") === v && date >= this.options.min && date <= this.options.max;
},
_autoSwitch: function (v) {
_autoSwitch: function (editor) {
var v = editor.getValue();
if (BI.checkDateLegal(v)) {
if (v.length === 4 && this._yearCheck(v)) {
this._doEditorConfirm(editor);
this.quarterEditor.focus();
}
}

3
src/case/richeditor/niceditor/niceditor.js

@ -129,7 +129,8 @@
}
this.instanceDoc = document.defaultView;
this.elm.element.on("mousedown", BI.bind(this.selected, this));
this.elm.element.on("keydown", BI.bind(this.keyDown, this));
this.elm.element.on("keyup", BI.bind(this.keyDown, this));
// this.elm.element.on("keydown", BI.bind(this.keyDown, this));
this.elm.element.on("focus", BI.bind(this.selected, this));
this.elm.element.on("blur", BI.bind(this.blur, this));
this.elm.element.on("keyup", BI.bind(this.selected, this));

Loading…
Cancel
Save