Browse Source

Merge pull request #291 in ~GUY/fineui from ~WINDY/fineui:master to master

* commit '4cddf3c652a1554997fe6cd7022b7188e0934a8a':
  value传值 editor
es6
windy 7 years ago
parent
commit
d60a8bc9ce
  1. 1
      demo/js/base/editor/demo.editor.js
  2. 16
      dist/base.js
  3. 23
      dist/bundle.js
  4. 7
      dist/case.js
  5. 1
      dist/demo.js
  6. 23
      dist/fineui.js
  7. 9
      src/base/combination/group.button.js
  8. 4
      src/base/single/editor/editor.js
  9. 3
      src/base/single/input/input.js
  10. 4
      src/case/combo/staticcombo/combo.static.js
  11. 3
      src/case/combo/textvaluecombo/popup.textvalue.js

1
demo/js/base/editor/demo.editor.js

@ -35,6 +35,7 @@ Demo.Editor = BI.inherit(BI.Widget, {
cls: "mvc-border",
watermark: "输入'a'会有错误信息且回车键不能退出编辑",
errorText: "字段不可重名",
value: "a",
validationChecker: function (v) {
if (v == "a") {
return false;

16
dist/base.js vendored

@ -1021,6 +1021,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
baseCls: "bi-button-group",
behaviors: {},
items: [],
value: "",
chooseType: BI.Selection.Single,
layouts: [{
type: "bi.center",
@ -1032,14 +1033,18 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
_init: function () {
BI.ButtonGroup.superclass._init.apply(this, arguments);
var o = this.options;
var behaviors = {};
BI.each(this.options.behaviors, function (key, rule) {
BI.each(o.behaviors, function (key, rule) {
behaviors[key] = BI.BehaviorFactory.createBehavior(key, {
rule: rule
});
});
this.behaviors = behaviors;
this.populate(this.options.items);
this.populate(o.items);
if(BI.isKey(o.value) || BI.isNotEmptyArray(o.value)){
this.setValue(o.value);
}
},
_createBtns: function (items) {
@ -18071,6 +18076,7 @@ BI.Editor = BI.inherit(BI.Single, {
type: "bi.input",
element: "<input type='" + o.inputType + "'/>",
root: true,
value: o.value,
watermark: o.watermark,
validationChecker: o.validationChecker,
quitChecker: o.quitChecker,
@ -18213,7 +18219,8 @@ BI.Editor = BI.inherit(BI.Single, {
return false;
});
if (BI.isKey(this.options.value) || BI.isEmptyString(this.options.value)) {
this.setValue(this.options.value);
this._checkError();
this._checkWaterMark();
} else {
this._checkWaterMark();
}
@ -19417,6 +19424,9 @@ BI.Input = BI.inherit(BI.Single, {
.focusout(function (e) {
self._blurDebounce();
});
if (BI.isKey(this.options.value) || BI.isEmptyString(this.options.value)) {
this.setValue(this.options.value);
}
},
_focus: function () {

23
dist/bundle.js vendored

@ -26799,6 +26799,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
baseCls: "bi-button-group",
behaviors: {},
items: [],
value: "",
chooseType: BI.Selection.Single,
layouts: [{
type: "bi.center",
@ -26810,14 +26811,18 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
_init: function () {
BI.ButtonGroup.superclass._init.apply(this, arguments);
var o = this.options;
var behaviors = {};
BI.each(this.options.behaviors, function (key, rule) {
BI.each(o.behaviors, function (key, rule) {
behaviors[key] = BI.BehaviorFactory.createBehavior(key, {
rule: rule
});
});
this.behaviors = behaviors;
this.populate(this.options.items);
this.populate(o.items);
if(BI.isKey(o.value) || BI.isNotEmptyArray(o.value)){
this.setValue(o.value);
}
},
_createBtns: function (items) {
@ -43849,6 +43854,7 @@ BI.Editor = BI.inherit(BI.Single, {
type: "bi.input",
element: "<input type='" + o.inputType + "'/>",
root: true,
value: o.value,
watermark: o.watermark,
validationChecker: o.validationChecker,
quitChecker: o.quitChecker,
@ -43991,7 +43997,8 @@ BI.Editor = BI.inherit(BI.Single, {
return false;
});
if (BI.isKey(this.options.value) || BI.isEmptyString(this.options.value)) {
this.setValue(this.options.value);
this._checkError();
this._checkWaterMark();
} else {
this._checkWaterMark();
}
@ -45195,6 +45202,9 @@ BI.Input = BI.inherit(BI.Single, {
.focusout(function (e) {
self._blurDebounce();
});
if (BI.isKey(this.options.value) || BI.isEmptyString(this.options.value)) {
this.setValue(this.options.value);
}
},
_focus: function () {
@ -67718,6 +67728,7 @@ BI.StaticCombo = BI.inherit(BI.Widget, {
type: "bi.text_icon_item",
cls: "bi-select-text-trigger bi-border pull-down-font",
text: o.text,
value: o.value,
readonly: true,
textLgap: 5,
height: o.height - 2
@ -67726,7 +67737,8 @@ BI.StaticCombo = BI.inherit(BI.Widget, {
type: "bi.text_value_combo_popup",
textAlign: o.textAlign,
chooseType: o.chooseType,
items: o.items
items: o.items,
value: o.value
});
this.popup.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -68110,7 +68122,8 @@ BI.shortcut("bi.small_text_value_combo", BI.SmallTextValueCombo);BI.TextValueCom
chooseType: o.chooseType,
layouts: [{
type: "bi.vertical"
}]
}],
value: o.value
});
this.popup.on(BI.Controller.EVENT_CHANGE, function (type, val, obj) {

7
dist/case.js vendored

@ -5584,6 +5584,7 @@ BI.StaticCombo = BI.inherit(BI.Widget, {
type: "bi.text_icon_item",
cls: "bi-select-text-trigger bi-border pull-down-font",
text: o.text,
value: o.value,
readonly: true,
textLgap: 5,
height: o.height - 2
@ -5592,7 +5593,8 @@ BI.StaticCombo = BI.inherit(BI.Widget, {
type: "bi.text_value_combo_popup",
textAlign: o.textAlign,
chooseType: o.chooseType,
items: o.items
items: o.items,
value: o.value
});
this.popup.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -5976,7 +5978,8 @@ BI.shortcut("bi.small_text_value_combo", BI.SmallTextValueCombo);BI.TextValueCom
chooseType: o.chooseType,
layouts: [{
type: "bi.vertical"
}]
}],
value: o.value
});
this.popup.on(BI.Controller.EVENT_CHANGE, function (type, val, obj) {

1
dist/demo.js vendored

@ -704,6 +704,7 @@ BI.shortcut("demo.code_editor", Demo.CodeEditor);Demo.Editor = BI.inherit(BI.Wid
cls: "mvc-border",
watermark: "输入'a'会有错误信息且回车键不能退出编辑",
errorText: "字段不可重名",
value: "a",
validationChecker: function (v) {
if (v == "a") {
return false;

23
dist/fineui.js vendored

@ -28493,6 +28493,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
baseCls: "bi-button-group",
behaviors: {},
items: [],
value: "",
chooseType: BI.Selection.Single,
layouts: [{
type: "bi.center",
@ -28504,14 +28505,18 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
_init: function () {
BI.ButtonGroup.superclass._init.apply(this, arguments);
var o = this.options;
var behaviors = {};
BI.each(this.options.behaviors, function (key, rule) {
BI.each(o.behaviors, function (key, rule) {
behaviors[key] = BI.BehaviorFactory.createBehavior(key, {
rule: rule
});
});
this.behaviors = behaviors;
this.populate(this.options.items);
this.populate(o.items);
if(BI.isKey(o.value) || BI.isNotEmptyArray(o.value)){
this.setValue(o.value);
}
},
_createBtns: function (items) {
@ -45543,6 +45548,7 @@ BI.Editor = BI.inherit(BI.Single, {
type: "bi.input",
element: "<input type='" + o.inputType + "'/>",
root: true,
value: o.value,
watermark: o.watermark,
validationChecker: o.validationChecker,
quitChecker: o.quitChecker,
@ -45685,7 +45691,8 @@ BI.Editor = BI.inherit(BI.Single, {
return false;
});
if (BI.isKey(this.options.value) || BI.isEmptyString(this.options.value)) {
this.setValue(this.options.value);
this._checkError();
this._checkWaterMark();
} else {
this._checkWaterMark();
}
@ -46889,6 +46896,9 @@ BI.Input = BI.inherit(BI.Single, {
.focusout(function (e) {
self._blurDebounce();
});
if (BI.isKey(this.options.value) || BI.isEmptyString(this.options.value)) {
this.setValue(this.options.value);
}
},
_focus: function () {
@ -69412,6 +69422,7 @@ BI.StaticCombo = BI.inherit(BI.Widget, {
type: "bi.text_icon_item",
cls: "bi-select-text-trigger bi-border pull-down-font",
text: o.text,
value: o.value,
readonly: true,
textLgap: 5,
height: o.height - 2
@ -69420,7 +69431,8 @@ BI.StaticCombo = BI.inherit(BI.Widget, {
type: "bi.text_value_combo_popup",
textAlign: o.textAlign,
chooseType: o.chooseType,
items: o.items
items: o.items,
value: o.value
});
this.popup.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -69804,7 +69816,8 @@ BI.shortcut("bi.small_text_value_combo", BI.SmallTextValueCombo);BI.TextValueCom
chooseType: o.chooseType,
layouts: [{
type: "bi.vertical"
}]
}],
value: o.value
});
this.popup.on(BI.Controller.EVENT_CHANGE, function (type, val, obj) {

9
src/base/combination/group.button.js

@ -10,6 +10,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
baseCls: "bi-button-group",
behaviors: {},
items: [],
value: "",
chooseType: BI.Selection.Single,
layouts: [{
type: "bi.center",
@ -21,14 +22,18 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
_init: function () {
BI.ButtonGroup.superclass._init.apply(this, arguments);
var o = this.options;
var behaviors = {};
BI.each(this.options.behaviors, function (key, rule) {
BI.each(o.behaviors, function (key, rule) {
behaviors[key] = BI.BehaviorFactory.createBehavior(key, {
rule: rule
});
});
this.behaviors = behaviors;
this.populate(this.options.items);
this.populate(o.items);
if(BI.isKey(o.value) || BI.isNotEmptyArray(o.value)){
this.setValue(o.value);
}
},
_createBtns: function (items) {

4
src/base/single/editor/editor.js

@ -32,6 +32,7 @@ BI.Editor = BI.inherit(BI.Single, {
type: "bi.input",
element: "<input type='" + o.inputType + "'/>",
root: true,
value: o.value,
watermark: o.watermark,
validationChecker: o.validationChecker,
quitChecker: o.quitChecker,
@ -174,7 +175,8 @@ BI.Editor = BI.inherit(BI.Single, {
return false;
});
if (BI.isKey(this.options.value) || BI.isEmptyString(this.options.value)) {
this.setValue(this.options.value);
this._checkError();
this._checkWaterMark();
} else {
this._checkWaterMark();
}

3
src/base/single/input/input.js

@ -57,6 +57,9 @@ BI.Input = BI.inherit(BI.Single, {
.focusout(function (e) {
self._blurDebounce();
});
if (BI.isKey(this.options.value) || BI.isEmptyString(this.options.value)) {
this.setValue(this.options.value);
}
},
_focus: function () {

4
src/case/combo/staticcombo/combo.static.js

@ -23,6 +23,7 @@ BI.StaticCombo = BI.inherit(BI.Widget, {
type: "bi.text_icon_item",
cls: "bi-select-text-trigger bi-border pull-down-font",
text: o.text,
value: o.value,
readonly: true,
textLgap: 5,
height: o.height - 2
@ -31,7 +32,8 @@ BI.StaticCombo = BI.inherit(BI.Widget, {
type: "bi.text_value_combo_popup",
textAlign: o.textAlign,
chooseType: o.chooseType,
items: o.items
items: o.items,
value: o.value
});
this.popup.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);

3
src/case/combo/textvaluecombo/popup.textvalue.js

@ -19,7 +19,8 @@ BI.TextValueComboPopup = BI.inherit(BI.Pane, {
chooseType: o.chooseType,
layouts: [{
type: "bi.vertical"
}]
}],
value: o.value
});
this.popup.on(BI.Controller.EVENT_CHANGE, function (type, val, obj) {

Loading…
Cancel
Save