Browse Source

Merge pull request #373 in FUI/fineui from ~WINDY/fui:master to master

* commit '55ba6bda19b088aba6c34a559443e5719c5e9664':
  BI-19491
  BI-18754
  BI-18932
master
guy 7 years ago
parent
commit
a06b69d8a6
  1. 8
      dist/_fineui.min.js
  2. 89
      dist/bundle.js
  3. 18
      dist/bundle.min.js
  4. 4
      dist/case.js
  5. 105
      dist/demo.js
  6. 89
      dist/fineui.js
  7. 8
      dist/fineui.min.js
  8. 85
      dist/widget.js
  9. 4
      src/case/richeditor/niceditor/niceditor.js
  10. 6
      src/widget/multiselectlist/multiselectlist.insert.js
  11. 6
      src/widget/multiselectlist/multiselectlist.js
  12. 38
      src/widget/yearmonth/trigger.yearmonth.js
  13. 35
      src/widget/yearquarter/trigger.yearquarter.js

8
dist/_fineui.min.js vendored

File diff suppressed because one or more lines are too long

89
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));
@ -83300,6 +83301,7 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
},
selected: function (e) {
console.log(123);
var t = e.target;
if (!t && !(t = this.selElm())) {
t = this.selElm();
@ -99093,8 +99095,8 @@ BI.MultiSelectInsertList = BI.inherit(BI.Widget, {
return self.trigger.getKeyword();
},
itemsCreator: function (op, callback) {
op.keyword = self.trigger.getKeyword();
this.setKeyword(op.keyword);
op.keywords = [self.trigger.getKeyword()];
this.setKeyword(op.keywords[0]);
o.itemsCreator(op, callback);
}
});
@ -99276,7 +99278,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Widget, {
this._assertValue(res);
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA,
keyword: self.trigger.getKeyword()
keywords: [self.trigger.getKeyword()]
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {
@ -99421,8 +99423,8 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
return self.trigger.getKeyword();
},
itemsCreator: function (op, callback) {
op.keyword = self.trigger.getKeyword();
this.setKeyword(op.keyword);
op.keywords = [self.trigger.getKeyword()];
this.setKeyword(op.keywords[0]);
o.itemsCreator(op, callback);
}
});
@ -99590,7 +99592,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
this._assertValue(res);
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA,
keyword: self.trigger.getKeyword()
keywords: [this.trigger.getKey()]
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {
@ -109391,20 +109393,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 +109418,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 +110351,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 +110374,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();
}
}

18
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

4
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));
@ -10845,6 +10846,7 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
},
selected: function (e) {
console.log(123);
var t = e.target;
if (!t && !(t = this.selElm())) {
t = this.selElm();

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

89
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));
@ -83543,6 +83544,7 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
},
selected: function (e) {
console.log(123);
var t = e.target;
if (!t && !(t = this.selElm())) {
t = this.selElm();
@ -99336,8 +99338,8 @@ BI.MultiSelectInsertList = BI.inherit(BI.Widget, {
return self.trigger.getKeyword();
},
itemsCreator: function (op, callback) {
op.keyword = self.trigger.getKeyword();
this.setKeyword(op.keyword);
op.keywords = [self.trigger.getKeyword()];
this.setKeyword(op.keywords[0]);
o.itemsCreator(op, callback);
}
});
@ -99519,7 +99521,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Widget, {
this._assertValue(res);
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA,
keyword: self.trigger.getKeyword()
keywords: [self.trigger.getKeyword()]
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {
@ -99664,8 +99666,8 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
return self.trigger.getKeyword();
},
itemsCreator: function (op, callback) {
op.keyword = self.trigger.getKeyword();
this.setKeyword(op.keyword);
op.keywords = [self.trigger.getKeyword()];
this.setKeyword(op.keywords[0]);
o.itemsCreator(op, callback);
}
});
@ -99833,7 +99835,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
this._assertValue(res);
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA,
keyword: self.trigger.getKeyword()
keywords: [this.trigger.getKey()]
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {
@ -109634,20 +109636,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 +109661,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 +110594,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 +110617,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();
}
}

8
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

85
dist/widget.js vendored

@ -11626,8 +11626,8 @@ BI.MultiSelectInsertList = BI.inherit(BI.Widget, {
return self.trigger.getKeyword();
},
itemsCreator: function (op, callback) {
op.keyword = self.trigger.getKeyword();
this.setKeyword(op.keyword);
op.keywords = [self.trigger.getKeyword()];
this.setKeyword(op.keywords[0]);
o.itemsCreator(op, callback);
}
});
@ -11809,7 +11809,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Widget, {
this._assertValue(res);
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA,
keyword: self.trigger.getKeyword()
keywords: [self.trigger.getKeyword()]
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {
@ -11954,8 +11954,8 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
return self.trigger.getKeyword();
},
itemsCreator: function (op, callback) {
op.keyword = self.trigger.getKeyword();
this.setKeyword(op.keyword);
op.keywords = [self.trigger.getKeyword()];
this.setKeyword(op.keywords[0]);
o.itemsCreator(op, callback);
}
});
@ -12123,7 +12123,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
this._assertValue(res);
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA,
keyword: self.trigger.getKeyword()
keywords: [this.trigger.getKey()]
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {
@ -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();
}
}

4
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));
@ -231,6 +232,7 @@
},
selected: function (e) {
console.log(123);
var t = e.target;
if (!t && !(t = this.selElm())) {
t = this.selElm();

6
src/widget/multiselectlist/multiselectlist.insert.js

@ -46,8 +46,8 @@ BI.MultiSelectInsertList = BI.inherit(BI.Widget, {
return self.trigger.getKeyword();
},
itemsCreator: function (op, callback) {
op.keyword = self.trigger.getKeyword();
this.setKeyword(op.keyword);
op.keywords = [self.trigger.getKeyword()];
this.setKeyword(op.keywords[0]);
o.itemsCreator(op, callback);
}
});
@ -229,7 +229,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Widget, {
this._assertValue(res);
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA,
keyword: self.trigger.getKeyword()
keywords: [self.trigger.getKeyword()]
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {

6
src/widget/multiselectlist/multiselectlist.js

@ -47,8 +47,8 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
return self.trigger.getKeyword();
},
itemsCreator: function (op, callback) {
op.keyword = self.trigger.getKeyword();
this.setKeyword(op.keyword);
op.keywords = [self.trigger.getKeyword()];
this.setKeyword(op.keywords[0]);
o.itemsCreator(op, callback);
}
});
@ -216,7 +216,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
this._assertValue(res);
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA,
keyword: self.trigger.getKeyword()
keywords: [this.trigger.getKey()]
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {

38
src/widget/yearmonth/trigger.yearmonth.js

@ -86,20 +86,7 @@ BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, {
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 () {
@ -124,21 +111,40 @@ BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, {
});
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();
}
}

35
src/widget/yearquarter/trigger.yearquarter.js

@ -87,20 +87,7 @@ BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, {
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 () {
@ -123,14 +110,32 @@ BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, {
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();
}
}

Loading…
Cancel
Save