guy 8 years ago
parent
commit
aff2619023
  1. 203
      bi/case.js
  2. 2
      bi/widget.js
  3. 203
      docs/case.js
  4. 2
      docs/widget.js
  5. 162
      src/case/editor/editor.adapt.js
  6. 2
      src/case/editor/editor.search.js
  7. 15
      src/case/editor/editor.shelter.js
  8. 2
      src/case/editor/editor.sign.initial.js
  9. 17
      src/case/editor/editor.sign.js
  10. 2
      src/case/editor/editor.state.js
  11. 2
      src/case/editor/editor.state.simple.js
  12. 2
      src/case/editor/editor.text.js
  13. 2
      src/widget/year/trigger.year.js

203
bi/case.js

@ -4903,167 +4903,6 @@ BI.DownListSelectTextTrigger = BI.inherit(BI.Trigger, {
}
});
BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);/**
* 根据内容自适应长度的输入框
* @class BI.AdaptiveEditor
* @extends BI.Single
*/
BI.AdaptiveEditor = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.AdaptiveEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-adapt-editor",
hgap: 4,
vgap: 2,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn,
mouseOut: false,
allowBlank: true,
watermark: "",
errorText: "",
height: 30
})
},
_init: function () {
BI.AdaptiveEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.sign_editor",
element: this,
height: o.height,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
value: o.value,
validationChecker: o.validationChecker,
quitChecker: o.quitChecker,
mouseOut: o.mouseOut,
allowBlank: o.allowBlank,
watermark: o.watermark,
errorText: o.errorText
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.editor.on(BI.SignEditor.EVENT_FOCUS, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_FOCUS);
});
this.editor.on(BI.SignEditor.EVENT_BLUR, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_BLUR);
});
this.editor.on(BI.SignEditor.EVENT_CLICK, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_CLICK);
});
this.editor.on(BI.SignEditor.EVENT_CHANGE, function () {
self._checkEditorLength();
self.fireEvent(BI.AdaptiveEditor.EVENT_CHANGE);
});
this.editor.on(BI.SignEditor.EVENT_KEY_DOWN, function (v) {
self.fireEvent(BI.AdaptiveEditor.EVENT_KEY_DOWN);
});
this.editor.on(BI.SignEditor.EVENT_VALID, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_VALID);
});
this.editor.on(BI.SignEditor.EVENT_CONFIRM, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_CONFIRM);
});
this.editor.on(BI.SignEditor.EVENT_START, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_START);
});
this.editor.on(BI.SignEditor.EVENT_PAUSE, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_PAUSE);
});
this.editor.on(BI.Editor.EVENT_STOP, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_STOP);
});
this.editor.on(BI.SignEditor.EVENT_SPACE, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_SPACE);
});
this.editor.on(BI.SignEditor.EVENT_ERROR, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_ERROR);
});
this.editor.on(BI.SignEditor.EVENT_ENTER, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_ENTER);
});
this.editor.on(BI.SignEditor.EVENT_RESTRICT, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_RESTRICT);
});
this.editor.on(BI.SignEditor.EVENT_EMPTY, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_EMPTY);
});
this._checkEditorLength();
},
_checkEditorLength: function () {
var o = this.options;
this.element.width(BI.DOM.getTextSizeWidth(this.getValue(), 14) + 2 * o.hgap + o.lgap + o.rgap);
},
focus: function () {
this.editor.focus();
},
blur: function () {
this.editor.blur();
},
isValid: function () {
return this.editor.isValid();
},
setErrorText: function (text) {
this.editor.setErrorText(text);
},
getErrorText: function () {
return this.editor.getErrorText();
},
setValue: function (k) {
this.editor.setValue(k);
this._checkEditorLength();
},
getValue: function () {
return this.editor.getValue();
},
getState: function () {
return this.editor.getState();
},
setState: function (v) {
}
});
BI.AdaptiveEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.AdaptiveEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.AdaptiveEditor.EVENT_BLUR = "EVENT_BLUR";
BI.AdaptiveEditor.EVENT_CLICK = "EVENT_CLICK";
BI.AdaptiveEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.AdaptiveEditor.EVENT_CLICK_LABEL = "EVENT_CLICK_LABEL";
BI.AdaptiveEditor.EVENT_START = "EVENT_START";
BI.AdaptiveEditor.EVENT_PAUSE = "EVENT_PAUSE";
BI.AdaptiveEditor.EVENT_STOP = "EVENT_STOP";
BI.AdaptiveEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.AdaptiveEditor.EVENT_VALID = "EVENT_VALID";
BI.AdaptiveEditor.EVENT_ERROR = "EVENT_ERROR";
BI.AdaptiveEditor.EVENT_ENTER = "EVENT_ENTER";
BI.AdaptiveEditor.EVENT_RESTRICT = "EVENT_RESTRICT";
BI.AdaptiveEditor.EVENT_SPACE = "EVENT_SPACE";
BI.AdaptiveEditor.EVENT_EMPTY = "EVENT_EMPTY";
BI.shortcut("bi.adapt_editor", BI.AdaptiveEditor);/**
* 有清楚按钮的文本框
* Created by GUY on 2015/9/29.
* @class BI.SmallTextEditor
@ -5406,7 +5245,7 @@ BI.SearchEditor = BI.inherit(BI.Widget, {
setEnable: function (b) {
BI.Editor.superclass.setEnable.apply(this, arguments);
this.editor && this.editor.setEnable(b);
this.clear.setEnabled(b);
this.clear.setEnable(b);
}
});
BI.SearchEditor.EVENT_CHANGE = "EVENT_CHANGE";
@ -5451,9 +5290,9 @@ BI.shortcut("bi.small_search_editor", BI.SmallSearchEditor);/**
* 带标记的文本框
* Created by GUY on 2016/1/25.
* @class BI.ShelterEditor
* @extends BI.Single
* @extends BI.Widget
*/
BI.ShelterEditor = BI.inherit(BI.Single, {
BI.ShelterEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.ShelterEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
@ -5498,6 +5337,9 @@ BI.ShelterEditor = BI.inherit(BI.Single, {
this.text = BI.createWidget({
type: "bi.text_button",
cls: "shelter-editor-text",
title: o.title,
warningTitle: o.warningTitle,
tipType: o.tipType,
textAlign: o.textAlign,
height: o.height,
hgap: 4
@ -5603,6 +5445,14 @@ BI.ShelterEditor = BI.inherit(BI.Single, {
this.text.visible();
},
setTitle: function (title) {
this.text.setTitle(title);
},
setWarningTitle: function (title) {
this.text.setWarningTitle(title);
},
focus: function () {
this._showInput();
this.editor.focus();
@ -5701,7 +5551,7 @@ BI.shortcut("bi.shelter_editor", BI.ShelterEditor);/**
* @class BI.SignInitialEditor
* @extends BI.Single
*/
BI.SignInitialEditor = BI.inherit(BI.Single, {
BI.SignInitialEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.SignInitialEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
@ -5864,9 +5714,9 @@ BI.shortcut("bi.sign_initial_editor", BI.SignInitialEditor);/**
* 带标记的文本框
* Created by GUY on 2015/8/28.
* @class BI.SignEditor
* @extends BI.Single
* @extends BI.Widget
*/
BI.SignEditor = BI.inherit(BI.Single, {
BI.SignEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.SignEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
@ -5910,6 +5760,9 @@ BI.SignEditor = BI.inherit(BI.Single, {
this.text = BI.createWidget({
type: "bi.text_button",
cls: "sign-editor-text",
title: o.title,
warningTitle: o.warningTitle,
tipType: o.tipType,
textAlign: "left",
height: o.height,
hgap: 4,
@ -6020,6 +5873,14 @@ BI.SignEditor = BI.inherit(BI.Single, {
this.text.visible();
},
setTitle: function (title) {
this.text.setTitle(title);
},
setWarningTitle: function (title) {
this.text.setWarningTitle(title);
},
focus: function () {
this._showInput();
this.editor.focus();
@ -6057,7 +5918,7 @@ BI.SignEditor = BI.inherit(BI.Single, {
return this.editor.isValid();
},
setValid: function(v){
setValid: function (v) {
BI.SignEditor.superclass.setValid.apply(this, arguments);
this.editor.setValid(v);
},
@ -6120,7 +5981,7 @@ BI.shortcut("bi.sign_editor", BI.SignEditor);/**
* @class BI.StateEditor
* @extends BI.Single
*/
BI.StateEditor = BI.inherit(BI.Single, {
BI.StateEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.StateEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
@ -6400,7 +6261,7 @@ BI.shortcut("bi.state_editor", BI.StateEditor);/**
* @class BI.SimpleStateEditor
* @extends BI.Single
*/
BI.SimpleStateEditor = BI.inherit(BI.Single, {
BI.SimpleStateEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.SimpleStateEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
@ -6659,7 +6520,7 @@ BI.shortcut("bi.simple_state_editor", BI.SimpleStateEditor);/**
* @class BI.TextEditor
* @extends BI.Single
*/
BI.TextEditor = BI.inherit(BI.Single, {
BI.TextEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.TextEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {

2
bi/widget.js

@ -16811,7 +16811,7 @@ BI.YearTrigger = BI.inherit(BI.Trigger, {
self.editor.setTitle(value);
}
self.fireEvent(BI.YearTrigger.EVENT_CONFIRM);
})
});
this.editor.on(BI.SignEditor.EVENT_SPACE, function () {
if (self.editor.isValid()) {
self.editor.blur();

203
docs/case.js

@ -4903,167 +4903,6 @@ BI.DownListSelectTextTrigger = BI.inherit(BI.Trigger, {
}
});
BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);/**
* 根据内容自适应长度的输入框
* @class BI.AdaptiveEditor
* @extends BI.Single
*/
BI.AdaptiveEditor = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.AdaptiveEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-adapt-editor",
hgap: 4,
vgap: 2,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn,
mouseOut: false,
allowBlank: true,
watermark: "",
errorText: "",
height: 30
})
},
_init: function () {
BI.AdaptiveEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.sign_editor",
element: this,
height: o.height,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
value: o.value,
validationChecker: o.validationChecker,
quitChecker: o.quitChecker,
mouseOut: o.mouseOut,
allowBlank: o.allowBlank,
watermark: o.watermark,
errorText: o.errorText
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.editor.on(BI.SignEditor.EVENT_FOCUS, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_FOCUS);
});
this.editor.on(BI.SignEditor.EVENT_BLUR, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_BLUR);
});
this.editor.on(BI.SignEditor.EVENT_CLICK, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_CLICK);
});
this.editor.on(BI.SignEditor.EVENT_CHANGE, function () {
self._checkEditorLength();
self.fireEvent(BI.AdaptiveEditor.EVENT_CHANGE);
});
this.editor.on(BI.SignEditor.EVENT_KEY_DOWN, function (v) {
self.fireEvent(BI.AdaptiveEditor.EVENT_KEY_DOWN);
});
this.editor.on(BI.SignEditor.EVENT_VALID, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_VALID);
});
this.editor.on(BI.SignEditor.EVENT_CONFIRM, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_CONFIRM);
});
this.editor.on(BI.SignEditor.EVENT_START, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_START);
});
this.editor.on(BI.SignEditor.EVENT_PAUSE, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_PAUSE);
});
this.editor.on(BI.Editor.EVENT_STOP, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_STOP);
});
this.editor.on(BI.SignEditor.EVENT_SPACE, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_SPACE);
});
this.editor.on(BI.SignEditor.EVENT_ERROR, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_ERROR);
});
this.editor.on(BI.SignEditor.EVENT_ENTER, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_ENTER);
});
this.editor.on(BI.SignEditor.EVENT_RESTRICT, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_RESTRICT);
});
this.editor.on(BI.SignEditor.EVENT_EMPTY, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_EMPTY);
});
this._checkEditorLength();
},
_checkEditorLength: function () {
var o = this.options;
this.element.width(BI.DOM.getTextSizeWidth(this.getValue(), 14) + 2 * o.hgap + o.lgap + o.rgap);
},
focus: function () {
this.editor.focus();
},
blur: function () {
this.editor.blur();
},
isValid: function () {
return this.editor.isValid();
},
setErrorText: function (text) {
this.editor.setErrorText(text);
},
getErrorText: function () {
return this.editor.getErrorText();
},
setValue: function (k) {
this.editor.setValue(k);
this._checkEditorLength();
},
getValue: function () {
return this.editor.getValue();
},
getState: function () {
return this.editor.getState();
},
setState: function (v) {
}
});
BI.AdaptiveEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.AdaptiveEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.AdaptiveEditor.EVENT_BLUR = "EVENT_BLUR";
BI.AdaptiveEditor.EVENT_CLICK = "EVENT_CLICK";
BI.AdaptiveEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.AdaptiveEditor.EVENT_CLICK_LABEL = "EVENT_CLICK_LABEL";
BI.AdaptiveEditor.EVENT_START = "EVENT_START";
BI.AdaptiveEditor.EVENT_PAUSE = "EVENT_PAUSE";
BI.AdaptiveEditor.EVENT_STOP = "EVENT_STOP";
BI.AdaptiveEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.AdaptiveEditor.EVENT_VALID = "EVENT_VALID";
BI.AdaptiveEditor.EVENT_ERROR = "EVENT_ERROR";
BI.AdaptiveEditor.EVENT_ENTER = "EVENT_ENTER";
BI.AdaptiveEditor.EVENT_RESTRICT = "EVENT_RESTRICT";
BI.AdaptiveEditor.EVENT_SPACE = "EVENT_SPACE";
BI.AdaptiveEditor.EVENT_EMPTY = "EVENT_EMPTY";
BI.shortcut("bi.adapt_editor", BI.AdaptiveEditor);/**
* 有清楚按钮的文本框
* Created by GUY on 2015/9/29.
* @class BI.SmallTextEditor
@ -5406,7 +5245,7 @@ BI.SearchEditor = BI.inherit(BI.Widget, {
setEnable: function (b) {
BI.Editor.superclass.setEnable.apply(this, arguments);
this.editor && this.editor.setEnable(b);
this.clear.setEnabled(b);
this.clear.setEnable(b);
}
});
BI.SearchEditor.EVENT_CHANGE = "EVENT_CHANGE";
@ -5451,9 +5290,9 @@ BI.shortcut("bi.small_search_editor", BI.SmallSearchEditor);/**
* 带标记的文本框
* Created by GUY on 2016/1/25.
* @class BI.ShelterEditor
* @extends BI.Single
* @extends BI.Widget
*/
BI.ShelterEditor = BI.inherit(BI.Single, {
BI.ShelterEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.ShelterEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
@ -5498,6 +5337,9 @@ BI.ShelterEditor = BI.inherit(BI.Single, {
this.text = BI.createWidget({
type: "bi.text_button",
cls: "shelter-editor-text",
title: o.title,
warningTitle: o.warningTitle,
tipType: o.tipType,
textAlign: o.textAlign,
height: o.height,
hgap: 4
@ -5603,6 +5445,14 @@ BI.ShelterEditor = BI.inherit(BI.Single, {
this.text.visible();
},
setTitle: function (title) {
this.text.setTitle(title);
},
setWarningTitle: function (title) {
this.text.setWarningTitle(title);
},
focus: function () {
this._showInput();
this.editor.focus();
@ -5701,7 +5551,7 @@ BI.shortcut("bi.shelter_editor", BI.ShelterEditor);/**
* @class BI.SignInitialEditor
* @extends BI.Single
*/
BI.SignInitialEditor = BI.inherit(BI.Single, {
BI.SignInitialEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.SignInitialEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
@ -5864,9 +5714,9 @@ BI.shortcut("bi.sign_initial_editor", BI.SignInitialEditor);/**
* 带标记的文本框
* Created by GUY on 2015/8/28.
* @class BI.SignEditor
* @extends BI.Single
* @extends BI.Widget
*/
BI.SignEditor = BI.inherit(BI.Single, {
BI.SignEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.SignEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
@ -5910,6 +5760,9 @@ BI.SignEditor = BI.inherit(BI.Single, {
this.text = BI.createWidget({
type: "bi.text_button",
cls: "sign-editor-text",
title: o.title,
warningTitle: o.warningTitle,
tipType: o.tipType,
textAlign: "left",
height: o.height,
hgap: 4,
@ -6020,6 +5873,14 @@ BI.SignEditor = BI.inherit(BI.Single, {
this.text.visible();
},
setTitle: function (title) {
this.text.setTitle(title);
},
setWarningTitle: function (title) {
this.text.setWarningTitle(title);
},
focus: function () {
this._showInput();
this.editor.focus();
@ -6057,7 +5918,7 @@ BI.SignEditor = BI.inherit(BI.Single, {
return this.editor.isValid();
},
setValid: function(v){
setValid: function (v) {
BI.SignEditor.superclass.setValid.apply(this, arguments);
this.editor.setValid(v);
},
@ -6120,7 +5981,7 @@ BI.shortcut("bi.sign_editor", BI.SignEditor);/**
* @class BI.StateEditor
* @extends BI.Single
*/
BI.StateEditor = BI.inherit(BI.Single, {
BI.StateEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.StateEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
@ -6400,7 +6261,7 @@ BI.shortcut("bi.state_editor", BI.StateEditor);/**
* @class BI.SimpleStateEditor
* @extends BI.Single
*/
BI.SimpleStateEditor = BI.inherit(BI.Single, {
BI.SimpleStateEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.SimpleStateEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
@ -6659,7 +6520,7 @@ BI.shortcut("bi.simple_state_editor", BI.SimpleStateEditor);/**
* @class BI.TextEditor
* @extends BI.Single
*/
BI.TextEditor = BI.inherit(BI.Single, {
BI.TextEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.TextEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {

2
docs/widget.js

@ -16811,7 +16811,7 @@ BI.YearTrigger = BI.inherit(BI.Trigger, {
self.editor.setTitle(value);
}
self.fireEvent(BI.YearTrigger.EVENT_CONFIRM);
})
});
this.editor.on(BI.SignEditor.EVENT_SPACE, function () {
if (self.editor.isValid()) {
self.editor.blur();

162
src/case/editor/editor.adapt.js

@ -1,162 +0,0 @@
/**
* 根据内容自适应长度的输入框
* @class BI.AdaptiveEditor
* @extends BI.Single
*/
BI.AdaptiveEditor = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.AdaptiveEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-adapt-editor",
hgap: 4,
vgap: 2,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn,
mouseOut: false,
allowBlank: true,
watermark: "",
errorText: "",
height: 30
})
},
_init: function () {
BI.AdaptiveEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.sign_editor",
element: this,
height: o.height,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
value: o.value,
validationChecker: o.validationChecker,
quitChecker: o.quitChecker,
mouseOut: o.mouseOut,
allowBlank: o.allowBlank,
watermark: o.watermark,
errorText: o.errorText
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.editor.on(BI.SignEditor.EVENT_FOCUS, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_FOCUS);
});
this.editor.on(BI.SignEditor.EVENT_BLUR, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_BLUR);
});
this.editor.on(BI.SignEditor.EVENT_CLICK, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_CLICK);
});
this.editor.on(BI.SignEditor.EVENT_CHANGE, function () {
self._checkEditorLength();
self.fireEvent(BI.AdaptiveEditor.EVENT_CHANGE);
});
this.editor.on(BI.SignEditor.EVENT_KEY_DOWN, function (v) {
self.fireEvent(BI.AdaptiveEditor.EVENT_KEY_DOWN);
});
this.editor.on(BI.SignEditor.EVENT_VALID, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_VALID);
});
this.editor.on(BI.SignEditor.EVENT_CONFIRM, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_CONFIRM);
});
this.editor.on(BI.SignEditor.EVENT_START, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_START);
});
this.editor.on(BI.SignEditor.EVENT_PAUSE, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_PAUSE);
});
this.editor.on(BI.Editor.EVENT_STOP, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_STOP);
});
this.editor.on(BI.SignEditor.EVENT_SPACE, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_SPACE);
});
this.editor.on(BI.SignEditor.EVENT_ERROR, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_ERROR);
});
this.editor.on(BI.SignEditor.EVENT_ENTER, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_ENTER);
});
this.editor.on(BI.SignEditor.EVENT_RESTRICT, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_RESTRICT);
});
this.editor.on(BI.SignEditor.EVENT_EMPTY, function () {
self.fireEvent(BI.AdaptiveEditor.EVENT_EMPTY);
});
this._checkEditorLength();
},
_checkEditorLength: function () {
var o = this.options;
this.element.width(BI.DOM.getTextSizeWidth(this.getValue(), 14) + 2 * o.hgap + o.lgap + o.rgap);
},
focus: function () {
this.editor.focus();
},
blur: function () {
this.editor.blur();
},
isValid: function () {
return this.editor.isValid();
},
setErrorText: function (text) {
this.editor.setErrorText(text);
},
getErrorText: function () {
return this.editor.getErrorText();
},
setValue: function (k) {
this.editor.setValue(k);
this._checkEditorLength();
},
getValue: function () {
return this.editor.getValue();
},
getState: function () {
return this.editor.getState();
},
setState: function (v) {
}
});
BI.AdaptiveEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.AdaptiveEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.AdaptiveEditor.EVENT_BLUR = "EVENT_BLUR";
BI.AdaptiveEditor.EVENT_CLICK = "EVENT_CLICK";
BI.AdaptiveEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.AdaptiveEditor.EVENT_CLICK_LABEL = "EVENT_CLICK_LABEL";
BI.AdaptiveEditor.EVENT_START = "EVENT_START";
BI.AdaptiveEditor.EVENT_PAUSE = "EVENT_PAUSE";
BI.AdaptiveEditor.EVENT_STOP = "EVENT_STOP";
BI.AdaptiveEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.AdaptiveEditor.EVENT_VALID = "EVENT_VALID";
BI.AdaptiveEditor.EVENT_ERROR = "EVENT_ERROR";
BI.AdaptiveEditor.EVENT_ENTER = "EVENT_ENTER";
BI.AdaptiveEditor.EVENT_RESTRICT = "EVENT_RESTRICT";
BI.AdaptiveEditor.EVENT_SPACE = "EVENT_SPACE";
BI.AdaptiveEditor.EVENT_EMPTY = "EVENT_EMPTY";
BI.shortcut("bi.adapt_editor", BI.AdaptiveEditor);

2
src/case/editor/editor.search.js

@ -173,7 +173,7 @@ BI.SearchEditor = BI.inherit(BI.Widget, {
setEnable: function (b) {
BI.Editor.superclass.setEnable.apply(this, arguments);
this.editor && this.editor.setEnable(b);
this.clear.setEnabled(b);
this.clear.setEnable(b);
}
});
BI.SearchEditor.EVENT_CHANGE = "EVENT_CHANGE";

15
src/case/editor/editor.shelter.js

@ -2,9 +2,9 @@
* 带标记的文本框
* Created by GUY on 2016/1/25.
* @class BI.ShelterEditor
* @extends BI.Single
* @extends BI.Widget
*/
BI.ShelterEditor = BI.inherit(BI.Single, {
BI.ShelterEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.ShelterEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
@ -49,6 +49,9 @@ BI.ShelterEditor = BI.inherit(BI.Single, {
this.text = BI.createWidget({
type: "bi.text_button",
cls: "shelter-editor-text",
title: o.title,
warningTitle: o.warningTitle,
tipType: o.tipType,
textAlign: o.textAlign,
height: o.height,
hgap: 4
@ -154,6 +157,14 @@ BI.ShelterEditor = BI.inherit(BI.Single, {
this.text.visible();
},
setTitle: function (title) {
this.text.setTitle(title);
},
setWarningTitle: function (title) {
this.text.setWarningTitle(title);
},
focus: function () {
this._showInput();
this.editor.focus();

2
src/case/editor/editor.sign.initial.js

@ -3,7 +3,7 @@
* @class BI.SignInitialEditor
* @extends BI.Single
*/
BI.SignInitialEditor = BI.inherit(BI.Single, {
BI.SignInitialEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.SignInitialEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {

17
src/case/editor/editor.sign.js

@ -2,9 +2,9 @@
* 带标记的文本框
* Created by GUY on 2015/8/28.
* @class BI.SignEditor
* @extends BI.Single
* @extends BI.Widget
*/
BI.SignEditor = BI.inherit(BI.Single, {
BI.SignEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.SignEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
@ -48,6 +48,9 @@ BI.SignEditor = BI.inherit(BI.Single, {
this.text = BI.createWidget({
type: "bi.text_button",
cls: "sign-editor-text",
title: o.title,
warningTitle: o.warningTitle,
tipType: o.tipType,
textAlign: "left",
height: o.height,
hgap: 4,
@ -158,6 +161,14 @@ BI.SignEditor = BI.inherit(BI.Single, {
this.text.visible();
},
setTitle: function (title) {
this.text.setTitle(title);
},
setWarningTitle: function (title) {
this.text.setWarningTitle(title);
},
focus: function () {
this._showInput();
this.editor.focus();
@ -195,7 +206,7 @@ BI.SignEditor = BI.inherit(BI.Single, {
return this.editor.isValid();
},
setValid: function(v){
setValid: function (v) {
BI.SignEditor.superclass.setValid.apply(this, arguments);
this.editor.setValid(v);
},

2
src/case/editor/editor.state.js

@ -4,7 +4,7 @@
* @class BI.StateEditor
* @extends BI.Single
*/
BI.StateEditor = BI.inherit(BI.Single, {
BI.StateEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.StateEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {

2
src/case/editor/editor.state.simple.js

@ -4,7 +4,7 @@
* @class BI.SimpleStateEditor
* @extends BI.Single
*/
BI.SimpleStateEditor = BI.inherit(BI.Single, {
BI.SimpleStateEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.SimpleStateEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {

2
src/case/editor/editor.text.js

@ -3,7 +3,7 @@
* @class BI.TextEditor
* @extends BI.Single
*/
BI.TextEditor = BI.inherit(BI.Single, {
BI.TextEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.TextEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {

2
src/widget/year/trigger.year.js

@ -53,7 +53,7 @@ BI.YearTrigger = BI.inherit(BI.Trigger, {
self.editor.setTitle(value);
}
self.fireEvent(BI.YearTrigger.EVENT_CONFIRM);
})
});
this.editor.on(BI.SignEditor.EVENT_SPACE, function () {
if (self.editor.isValid()) {
self.editor.blur();

Loading…
Cancel
Save