Browse Source

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

* commit '6c76c4bc06545447923b1e72bed47b179ef7641b':
  改名
  update
master
windy 7 years ago
parent
commit
6d80e36e7f
  1. 642
      bi/base.js
  2. 24
      bi/widget.css
  3. 260
      bi/widget.js
  4. 2
      demo/js/widget/filemanager/demo.file.manager.js
  5. 2
      demo/js/widget/numberinterval/demo.number_interval.js
  6. 24
      dist/bundle.css
  7. 260
      dist/bundle.js
  8. 2
      dist/bundle.min.css
  9. 18
      dist/bundle.min.js
  10. 4
      dist/demo.js
  11. 24
      dist/widget.css
  12. 260
      dist/widget.js
  13. 2
      docs/SUMMARY.md
  14. 2
      docs/_book/detailed/number_interval.md
  15. 2
      docs/_book/detailed/text_input/number_editor.md
  16. 2
      docs/detailed/number_interval.md
  17. 2
      docs/detailed/text_input/number_editor.md
  18. 2
      src/css/widget/numbereditor/number.editor.css
  19. 14
      src/css/widget/numberinterval/numberinterval.css
  20. 2
      src/less/widget/numbereditor/number.editor.less
  21. 10
      src/less/widget/numberinterval/numberinterval.less
  22. 4
      src/less/widget/numberinterval/popup.numberinterval.less
  23. 4
      src/less/widget/numericalinterval/popup.numericalinterval.less
  24. 26
      src/widget/numbereditor/number.editor.js
  25. 52
      src/widget/numberinterval/numberinterval.js

642
bi/base.js

@ -16403,68 +16403,68 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
key: function (e) {
}
});/**
* 颜色选择
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorTextToolbar
* @extends BI.Widget
*/
BI.RichEditorTextToolbar = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorTextToolbar.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-rich-editor-text-toolbar bi-background",
buttons: [
{type: "bi.rich_editor_size_chooser"},
{type: "bi.rich_editor_bold_button"},
{type: "bi.rich_editor_italic_button"},
{type: "bi.rich_editor_underline_button"},
{type: "bi.rich_editor_color_chooser"},
{type: "bi.rich_editor_background_color_chooser"},
{type: "bi.rich_editor_align_left_button"},
{type: "bi.rich_editor_align_center_button"},
{type: "bi.rich_editor_align_right_button"},
{type: "bi.rich_editor_param_button"},
],
height: 28
});
},
_init: function () {
BI.RichEditorTextToolbar.superclass._init.apply(this, arguments);
var self = this, o = this.options;
BI.createWidget({
type: "bi.left",
element: this,
items: BI.map(o.buttons, function (i, btn) {
return BI.extend(btn, {
editor: o.editor
});
}),
hgap: 3,
vgap: 3
})
},
mounted: function () {
var self = this;
if (BI.isIE9Below()) {//IE8下必须要设置unselectable才能不blur输入框
this.element.mousedown(function () {
self._noSelect(self.element[0]);
});
this._noSelect(this.element[0]);
}
},
_noSelect: function (element) {
if (element.setAttribute && element.nodeName.toLowerCase() != 'input' && element.nodeName.toLowerCase() != 'textarea') {
element.setAttribute('unselectable', 'on');
}
for (var i = 0; i < element.childNodes.length; i++) {
this._noSelect(element.childNodes[i]);
}
}
});
});/**
* 颜色选择
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorTextToolbar
* @extends BI.Widget
*/
BI.RichEditorTextToolbar = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorTextToolbar.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-rich-editor-text-toolbar bi-background",
buttons: [
{type: "bi.rich_editor_size_chooser"},
{type: "bi.rich_editor_bold_button"},
{type: "bi.rich_editor_italic_button"},
{type: "bi.rich_editor_underline_button"},
{type: "bi.rich_editor_color_chooser"},
{type: "bi.rich_editor_background_color_chooser"},
{type: "bi.rich_editor_align_left_button"},
{type: "bi.rich_editor_align_center_button"},
{type: "bi.rich_editor_align_right_button"},
{type: "bi.rich_editor_param_button"},
],
height: 28
});
},
_init: function () {
BI.RichEditorTextToolbar.superclass._init.apply(this, arguments);
var self = this, o = this.options;
BI.createWidget({
type: "bi.left",
element: this,
items: BI.map(o.buttons, function (i, btn) {
return BI.extend(btn, {
editor: o.editor
});
}),
hgap: 3,
vgap: 3
})
},
mounted: function () {
var self = this;
if (BI.isIE9Below()) {//IE8下必须要设置unselectable才能不blur输入框
this.element.mousedown(function () {
self._noSelect(self.element[0]);
});
this._noSelect(this.element[0]);
}
},
_noSelect: function (element) {
if (element.setAttribute && element.nodeName.toLowerCase() != 'input' && element.nodeName.toLowerCase() != 'textarea') {
element.setAttribute('unselectable', 'on');
}
for (var i = 0; i < element.childNodes.length; i++) {
this._noSelect(element.childNodes[i]);
}
}
});
BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar);/**
* 富文本编辑器
*
@ -16745,57 +16745,57 @@ BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar);/**
}
});
}());
/**
* 颜色选择trigger
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorBackgroundChooserTrigger
* @extends BI.Widget
*/
BI.RichEditorBackgroundChooserTrigger = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.RichEditorBackgroundChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
width: 20,
height: 20
});
},
_init: function () {
BI.RichEditorBackgroundChooserTrigger.superclass._init.apply(this, arguments);
this.font = BI.createWidget({
type: "bi.icon_button",
cls: "text-background-font"
});
this.underline = BI.createWidget({
type: "bi.icon_button",
cls: "text-color-underline-font"
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.font,
top: 2,
left: 2
}, {
el: this.underline,
top: 7,
left: 2
}]
})
},
setValue: function (color) {
this.underline.element.css("color", color);
},
getValue: function () {
return this.font.element.css("color");
}
});
/**
* 颜色选择trigger
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorBackgroundChooserTrigger
* @extends BI.Widget
*/
BI.RichEditorBackgroundChooserTrigger = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.RichEditorBackgroundChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
width: 20,
height: 20
});
},
_init: function () {
BI.RichEditorBackgroundChooserTrigger.superclass._init.apply(this, arguments);
this.font = BI.createWidget({
type: "bi.icon_button",
cls: "text-background-font"
});
this.underline = BI.createWidget({
type: "bi.icon_button",
cls: "text-color-underline-font"
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.font,
top: 2,
left: 2
}, {
el: this.underline,
top: 7,
left: 2
}]
})
},
setValue: function (color) {
this.underline.element.css("color", color);
},
getValue: function () {
return this.font.element.css("color");
}
});
BI.shortcut('bi.rich_editor_background_color_chooser_trigger', BI.RichEditorBackgroundChooserTrigger);/**
*
* Created by GUY on 2015/11/26.
@ -17063,214 +17063,214 @@ BI.RichEditorUnderlineButton = BI.inherit(BI.RichEditorAction, {
this.underline.setSelected(false);
},
});
BI.shortcut("bi.rich_editor_underline_button", BI.RichEditorUnderlineButton)/**
* 颜色选择trigger
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorColorChooserTrigger
* @extends BI.Widget
*/
BI.RichEditorColorChooserTrigger = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.RichEditorColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
width: 20,
height: 20
});
},
_init: function () {
BI.RichEditorColorChooserTrigger.superclass._init.apply(this, arguments);
this.font = BI.createWidget({
type: "bi.icon_button",
cls: "text-color-font"
});
this.underline = BI.createWidget({
type: "bi.icon_button",
cls: "text-color-underline-font"
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.font,
top: 2,
left: 2
}, {
el: this.underline,
top: 7,
left: 2
}]
})
},
setValue: function (color) {
this.underline.element.css("color", color);
},
getValue: function () {
return this.font.element.css("color");
}
});
BI.shortcut('bi.rich_editor_color_chooser_trigger', BI.RichEditorColorChooserTrigger);/**
* 颜色选择
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorBackgroundColorChooser
* @extends BI.RichEditorAction
*/
BI.RichEditorBackgroundColorChooser = BI.inherit(BI.RichEditorAction, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorBackgroundColorChooser.superclass._defaultConfig.apply(this, arguments), {
width: 20,
height: 20,
});
},
_init: function () {
BI.RichEditorBackgroundColorChooser.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.colorchooser = BI.createWidget({
type: "bi.color_chooser",
element: this,
width: o.width,
height: o.height,
el: {
type: "bi.rich_editor_background_color_chooser_trigger",
title: BI.i18nText("BI-Widget_Background_Colour"),
cls: "text-toolbar-button"
}
});
this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () {
var backgroundColor = this.getValue();
o.editor.element.css({
backgroundColor: backgroundColor,
color: BI.DOM.getContrastColor(backgroundColor)
});
this.setValue("");
});
},
deactivate: function () {
}
});
BI.shortcut('bi.rich_editor_background_color_chooser', BI.RichEditorBackgroundColorChooser);/**
* 颜色选择
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorColorChooser
* @extends BI.RichEditorAction
*/
BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorColorChooser.superclass._defaultConfig.apply(this, arguments), {
width: 20,
height: 20,
command: "foreColor"
});
},
_init: function () {
BI.RichEditorColorChooser.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.colorchooser = BI.createWidget({
type: "bi.color_chooser",
element: this,
width: o.width,
height: o.height,
el: {
type: "bi.rich_editor_color_chooser_trigger",
title: BI.i18nText("BI-Font_Colour"),
cls: "text-toolbar-button"
}
});
this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () {
self.doCommand(this.getValue());
});
},
deactivate: function () {
this.colorchooser.setValue("");
}
});
BI.shortcut('bi.rich_editor_color_chooser', BI.RichEditorColorChooser);/**
* 字体大小选择
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorSizeChooser
* @extends BI.RichEditorAction
*/
BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorSizeChooser.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-rich-editor-size-chooser bi-border bi-card",
command: "FontSize",
width: 50,
height: 20
});
},
_items: [{
value: 1,
text: "1(8pt)"
}, {
value: 2,
text: "2(10pt)"
}, {
value: 3,
text: "3(12pt)"
}, {
value: 4,
text: "4(14pt)"
}, {
value: 5,
text: "5(18pt)"
}, {
value: 6,
text: "6(24pt)"
}],
_init: function () {
BI.RichEditorSizeChooser.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.text_trigger",
readonly: true,
height: o.height,
triggerWidth: 12,
text: BI.i18nText("BI-Font_Size")
});
this.combo = BI.createWidget({
type: "bi.combo",
element: this,
el: this.trigger,
adjustLength: 1,
popup: {
maxWidth: 70,
minWidth: 70,
el: {
type: "bi.button_group",
items: BI.createItems(this._items, {
type: "bi.single_select_item"
}),
layouts: [{
type: "bi.vertical"
}]
}
}
});
this.combo.on(BI.Combo.EVENT_CHANGE, function () {
var val = this.getValue()[0];
self.doCommand(val);
this.hideView();
this.setValue([]);
})
}
});
BI.shortcut("bi.rich_editor_underline_button", BI.RichEditorUnderlineButton)/**
* 颜色选择trigger
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorColorChooserTrigger
* @extends BI.Widget
*/
BI.RichEditorColorChooserTrigger = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.RichEditorColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
width: 20,
height: 20
});
},
_init: function () {
BI.RichEditorColorChooserTrigger.superclass._init.apply(this, arguments);
this.font = BI.createWidget({
type: "bi.icon_button",
cls: "text-color-font"
});
this.underline = BI.createWidget({
type: "bi.icon_button",
cls: "text-color-underline-font"
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.font,
top: 2,
left: 2
}, {
el: this.underline,
top: 7,
left: 2
}]
})
},
setValue: function (color) {
this.underline.element.css("color", color);
},
getValue: function () {
return this.font.element.css("color");
}
});
BI.shortcut('bi.rich_editor_color_chooser_trigger', BI.RichEditorColorChooserTrigger);/**
* 颜色选择
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorBackgroundColorChooser
* @extends BI.RichEditorAction
*/
BI.RichEditorBackgroundColorChooser = BI.inherit(BI.RichEditorAction, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorBackgroundColorChooser.superclass._defaultConfig.apply(this, arguments), {
width: 20,
height: 20,
});
},
_init: function () {
BI.RichEditorBackgroundColorChooser.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.colorchooser = BI.createWidget({
type: "bi.color_chooser",
element: this,
width: o.width,
height: o.height,
el: {
type: "bi.rich_editor_background_color_chooser_trigger",
title: BI.i18nText("BI-Widget_Background_Colour"),
cls: "text-toolbar-button"
}
});
this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () {
var backgroundColor = this.getValue();
o.editor.element.css({
backgroundColor: backgroundColor,
color: BI.DOM.getContrastColor(backgroundColor)
});
this.setValue("");
});
},
deactivate: function () {
}
});
BI.shortcut('bi.rich_editor_background_color_chooser', BI.RichEditorBackgroundColorChooser);/**
* 颜色选择
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorColorChooser
* @extends BI.RichEditorAction
*/
BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorColorChooser.superclass._defaultConfig.apply(this, arguments), {
width: 20,
height: 20,
command: "foreColor"
});
},
_init: function () {
BI.RichEditorColorChooser.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.colorchooser = BI.createWidget({
type: "bi.color_chooser",
element: this,
width: o.width,
height: o.height,
el: {
type: "bi.rich_editor_color_chooser_trigger",
title: BI.i18nText("BI-Font_Colour"),
cls: "text-toolbar-button"
}
});
this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () {
self.doCommand(this.getValue());
});
},
deactivate: function () {
this.colorchooser.setValue("");
}
});
BI.shortcut('bi.rich_editor_color_chooser', BI.RichEditorColorChooser);/**
* 字体大小选择
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorSizeChooser
* @extends BI.RichEditorAction
*/
BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorSizeChooser.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-rich-editor-size-chooser bi-border bi-card",
command: "FontSize",
width: 50,
height: 20
});
},
_items: [{
value: 1,
text: "1(8pt)"
}, {
value: 2,
text: "2(10pt)"
}, {
value: 3,
text: "3(12pt)"
}, {
value: 4,
text: "4(14pt)"
}, {
value: 5,
text: "5(18pt)"
}, {
value: 6,
text: "6(24pt)"
}],
_init: function () {
BI.RichEditorSizeChooser.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.text_trigger",
readonly: true,
height: o.height,
triggerWidth: 12,
text: BI.i18nText("BI-Font_Size")
});
this.combo = BI.createWidget({
type: "bi.combo",
element: this,
el: this.trigger,
adjustLength: 1,
popup: {
maxWidth: 70,
minWidth: 70,
el: {
type: "bi.button_group",
items: BI.createItems(this._items, {
type: "bi.single_select_item"
}),
layouts: [{
type: "bi.vertical"
}]
}
}
});
this.combo.on(BI.Combo.EVENT_CHANGE, function () {
var val = this.getValue()[0];
self.doCommand(val);
this.hideView();
this.setValue([]);
})
}
});
BI.shortcut('bi.rich_editor_size_chooser', BI.RichEditorSizeChooser);/**
* 富文本编辑器
*

24
bi/widget.css

@ -68,11 +68,6 @@
background-color: #191b2b;
color: #999999;
}
.bi-fine-tuning-number-editor {
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
}
.bi-interactive-arrangement .interactive-arrangement-dragtag-line {
z-index: 1000000000;
background-color: #f07d0a;
@ -139,7 +134,12 @@
color: #3f8ce8;
z-index: 1;
}
.bi-numerical-interval .numerical-interval-small-editor {
.bi-number-editor {
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
}
.bi-number-interval .number-interval-small-editor {
-moz-border-radius-topleft: 2px;
-webkit-border-top-left-radius: 2px;
-moz-border-radius-bottomleft: 2px;
@ -147,7 +147,7 @@
border-top-left-radius: 2px;
border-bottom-left-radius: 2px;
}
.bi-numerical-interval .numerical-interval-big-editor {
.bi-number-interval .number-interval-big-editor {
-moz-border-radius-topright: 2px;
-webkit-border-top-right-radius: 2px;
-moz-border-radius-bottomright: 2px;
@ -155,7 +155,7 @@
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
}
.bi-numerical-interval .numerical-interval-big-combo {
.bi-number-interval .number-interval-big-combo {
-moz-border-radius-topleft: 2px;
-webkit-border-top-left-radius: 2px;
-moz-border-radius-bottomleft: 2px;
@ -163,10 +163,10 @@
border-top-left-radius: 2px;
border-bottom-left-radius: 2px;
}
.bi-numerical-interval .numerical-interval-big-combo .bi-icon-combo-trigger .icon-combo-trigger-icon {
.bi-number-interval .number-interval-big-combo .bi-icon-combo-trigger .icon-combo-trigger-icon {
font-size: 14px;
}
.bi-numerical-interval .numerical-interval-small-combo {
.bi-number-interval .number-interval-small-combo {
-moz-border-radius-topright: 2px;
-webkit-border-top-right-radius: 2px;
-moz-border-radius-bottomright: 2px;
@ -174,10 +174,10 @@
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
}
.bi-numerical-interval .numerical-interval-small-combo .bi-icon-combo-trigger .icon-combo-trigger-icon {
.bi-number-interval .number-interval-small-combo .bi-icon-combo-trigger .icon-combo-trigger-icon {
font-size: 14px;
}
.bi-numerical-interval.number-error .bi-input {
.bi-number-interval.number-error .bi-input {
color: #e85050;
}
.bi-page-table-cell {

260
bi/widget.js

@ -5376,109 +5376,6 @@ BI.extend(BI.FileManagerNav, {
});
BI.FileManagerNav.EVENT_CHANGE = "FileManagerNav.EVENT_CHANGE";
BI.shortcut("bi.file_manager_nav", BI.FileManagerNav);/**
* Created by windy on 2017/3/13.
* 数值微调器
*/
BI.FineTuningNumberEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.FineTuningNumberEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-fine-tuning-number-editor bi-border",
validationChecker: function () {return true;},
valueFormatter: function (v) {return v;},
value: 0,
errorText: "",
step: 1
})
},
_init: function () {
BI.FineTuningNumberEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.sign_editor",
height: o.height,
value: o.valueFormatter(o.value),
validationChecker: o.validationChecker,
errorText: o.errorText
});
this.editor.on(BI.TextEditor.EVENT_CHANGE, function () {
o.value = this.getValue();
self.fireEvent(BI.FineTuningNumberEditor.EVENT_CHANGE);
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function(){
self.fireEvent(BI.FineTuningNumberEditor.EVENT_CONFIRM);
});
this.topBtn = BI.createWidget({
type: "bi.icon_button",
trigger: "lclick,",
cls: "column-pre-page-h-font top-button bi-border-left bi-border-bottom"
});
this.topBtn.on(BI.IconButton.EVENT_CHANGE, function(){
self._finetuning(o.step);
self.fireEvent(BI.FineTuningNumberEditor.EVENT_CHANGE);
self.fireEvent(BI.FineTuningNumberEditor.EVENT_CONFIRM);
});
this.bottomBtn = BI.createWidget({
type: "bi.icon_button",
trigger: "lclick,",
cls: "column-next-page-h-font bottom-button bi-border-left bi-border-top"
});
this.bottomBtn.on(BI.IconButton.EVENT_CHANGE, function(){
self._finetuning(-o.step);
self.fireEvent(BI.FineTuningNumberEditor.EVENT_CHANGE);
self.fireEvent(BI.FineTuningNumberEditor.EVENT_CONFIRM);
});
BI.createWidget({
type: "bi.htape",
element: this,
items: [this.editor, {
el: {
type: "bi.grid",
columns: 1,
rows: 2,
items: [{
column: 0,
row: 0,
el: this.topBtn
}, {
column: 0,
row: 1,
el: this.bottomBtn
}]
},
width: 23
}]
});
},
//微调
_finetuning: function(add){
var v = BI.parseFloat(this.getValue());
this.setValue(v.add(add));
},
setUpEnable: function (v) {
this.topBtn.setEnable(!!v);
},
setBottomEnable: function (v) {
this.bottomBtn.setEnable(!!v);
},
getValue: function () {
return this.options.value;
},
setValue: function (v) {
var o = this.options;
o.value = v;
this.editor.setValue(o.valueFormatter(v));
}
});
BI.FineTuningNumberEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.FineTuningNumberEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.fine_tuning_number_editor", BI.FineTuningNumberEditor);/**
* 交互行为布局
*
*
@ -11719,13 +11616,116 @@ BI.MultiTreeSearcher.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiTreeSearcher.EVENT_START = "EVENT_START";
BI.MultiTreeSearcher.EVENT_STOP = "EVENT_STOP";
BI.MultiTreeSearcher.EVENT_PAUSE = "EVENT_PAUSE";
BI.shortcut('bi.multi_tree_searcher', BI.MultiTreeSearcher);//小于号的值为:0,小于等于号的值为:1
BI.shortcut('bi.multi_tree_searcher', BI.MultiTreeSearcher);/**
* Created by windy on 2017/3/13.
* 数值微调器
*/
BI.NumberEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.NumberEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-number-editor bi-border",
validationChecker: function () {return true;},
valueFormatter: function (v) {return v;},
value: 0,
errorText: "",
step: 1
})
},
_init: function () {
BI.NumberEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.sign_editor",
height: o.height,
value: o.valueFormatter(o.value),
validationChecker: o.validationChecker,
errorText: o.errorText
});
this.editor.on(BI.TextEditor.EVENT_CHANGE, function () {
o.value = this.getValue();
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function(){
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
});
this.topBtn = BI.createWidget({
type: "bi.icon_button",
trigger: "lclick,",
cls: "column-pre-page-h-font top-button bi-border-left bi-border-bottom"
});
this.topBtn.on(BI.IconButton.EVENT_CHANGE, function(){
self._finetuning(o.step);
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
});
this.bottomBtn = BI.createWidget({
type: "bi.icon_button",
trigger: "lclick,",
cls: "column-next-page-h-font bottom-button bi-border-left bi-border-top"
});
this.bottomBtn.on(BI.IconButton.EVENT_CHANGE, function(){
self._finetuning(-o.step);
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
});
BI.createWidget({
type: "bi.htape",
element: this,
items: [this.editor, {
el: {
type: "bi.grid",
columns: 1,
rows: 2,
items: [{
column: 0,
row: 0,
el: this.topBtn
}, {
column: 0,
row: 1,
el: this.bottomBtn
}]
},
width: 23
}]
});
},
//微调
_finetuning: function(add){
var v = BI.parseFloat(this.getValue());
this.setValue(v.add(add));
},
setUpEnable: function (v) {
this.topBtn.setEnable(!!v);
},
setBottomEnable: function (v) {
this.bottomBtn.setEnable(!!v);
},
getValue: function () {
return this.options.value;
},
setValue: function (v) {
var o = this.options;
o.value = v;
this.editor.setValue(o.valueFormatter(v));
}
});
BI.NumberEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.NumberEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.number_editor", BI.NumberEditor);//小于号的值为:0,小于等于号的值为:1
//closeMIn:最小值的符号,closeMax:最大值的符号
/**
* Created by roy on 15/9/17.
*
*/
BI.NumericalInterval = BI.inherit(BI.Single, {
BI.NumberInterval = BI.inherit(BI.Single, {
constants: {
typeError: "typeBubble",
numberError: "numberBubble",
@ -11741,16 +11741,16 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
numTip: ""
},
_defaultConfig: function () {
var conf = BI.NumericalInterval.superclass._defaultConfig.apply(this, arguments)
var conf = BI.NumberInterval.superclass._defaultConfig.apply(this, arguments)
return BI.extend(conf, {
extraCls: "bi-numerical-interval",
extraCls: "bi-number-interval",
height: 25,
validation: "valid"
})
},
_init: function () {
var self = this, c = this.constants, o = this.options;
BI.NumericalInterval.superclass._init.apply(this, arguments)
BI.NumberInterval.superclass._init.apply(this, arguments)
this.smallEditor = BI.createWidget({
type: "bi.editor",
height: o.height - 2,
@ -11769,7 +11769,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
}
return true;
},
cls: "numerical-interval-small-editor bi-border-top bi-border-bottom bi-border-left"
cls: "number-interval-small-editor bi-border-top bi-border-bottom bi-border-left"
});
this.smallTip = BI.createWidget({
@ -11806,7 +11806,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
}
return true;
},
cls: "numerical-interval-big-editor bi-border-top bi-border-bottom bi-border-right"
cls: "number-interval-big-editor bi-border-top bi-border-bottom bi-border-right"
});
this.bigTip = BI.createWidget({
@ -11826,23 +11826,23 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
});
//this.smallCombo = BI.createWidget({
// type: "bi.numerical_interval_combo",
// cls: "numerical-interval-small-combo",
// type: "bi.number_interval_combo",
// cls: "number-interval-small-combo",
// height: o.height,
// value: o.closemin ? 1 : 0,
// offsetStyle: "left"
//});
//
//this.bigCombo = BI.createWidget({
// type: "bi.numerical_interval_combo",
// cls: "numerical-interval-big-combo",
// type: "bi.number_interval_combo",
// cls: "number-interval-big-combo",
// height: o.height,
// value: o.closemax ? 1 : 0,
// offsetStyle: "left"
//});
this.smallCombo = BI.createWidget({
type: "bi.icon_combo",
cls: "numerical-interval-small-combo bi-border",
cls: "number-interval-small-combo bi-border",
height: o.height - 2,
items: [{
text: "(" + BI.i18nText("BI-Less_Than") + ")",
@ -11861,7 +11861,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
}
this.bigCombo = BI.createWidget({
type: "bi.icon_combo",
cls: "numerical-interval-big-combo bi-border",
cls: "number-interval-big-combo bi-border",
height: o.height - 2,
items: [{
text: "(" + BI.i18nText("BI-Less_Than") + ")",
@ -12069,7 +12069,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
BI.Bubbles.show(c.typeError, BI.i18nText("BI-Numerical_Interval_Input_Data"), self, {
offsetStyle: "center"
});
self.fireEvent(BI.NumericalInterval.EVENT_ERROR);
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
})
},
@ -12082,16 +12082,16 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
BI.Bubbles.show(c.numberError, BI.i18nText("BI-Numerical_Interval_Number_Value"), self, {
offsetStyle: "center"
});
self.fireEvent(BI.NumericalInterval.EVENT_ERROR);
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
case c.signalError:
BI.Bubbles.show(c.signalError, BI.i18nText("BI-Numerical_Interval_Signal_Value"), self, {
offsetStyle: "center"
});
self.fireEvent(BI.NumericalInterval.EVENT_ERROR);
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
default:
self.fireEvent(BI.NumericalInterval.EVENT_VALID);
self.fireEvent(BI.NumberInterval.EVENT_VALID);
}
})
},
@ -12119,7 +12119,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
default :
break;
}
self.fireEvent(BI.NumericalInterval.EVENT_CHANGE);
self.fireEvent(BI.NumberInterval.EVENT_CHANGE);
});
},
@ -12129,19 +12129,19 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
switch (self._checkValidation()) {
case c.typeError:
self._setTitle(BI.i18nText("BI-Numerical_Interval_Input_Data"));
self.fireEvent(BI.NumericalInterval.EVENT_ERROR);
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
case c.numberError:
self._setTitle(BI.i18nText("BI-Numerical_Interval_Number_Value"));
self.fireEvent(BI.NumericalInterval.EVENT_ERROR);
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
case c.signalError:
self._setTitle(BI.i18nText("BI-Numerical_Interval_Signal_Value"));
self.fireEvent(BI.NumericalInterval.EVENT_ERROR);
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
default :
self.fireEvent(BI.NumericalInterval.EVENT_CHANGE);
self.fireEvent(BI.NumericalInterval.EVENT_VALID);
self.fireEvent(BI.NumberInterval.EVENT_CHANGE);
self.fireEvent(BI.NumberInterval.EVENT_VALID);
}
})
},
@ -12242,10 +12242,10 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
return value;
}
});
BI.NumericalInterval.EVENT_CHANGE = "EVENT_CHANGE";
BI.NumericalInterval.EVENT_VALID = "EVENT_VALID";
BI.NumericalInterval.EVENT_ERROR = "EVENT_ERROR";
BI.shortcut("bi.numerical_interval", BI.NumericalInterval);/**
BI.NumberInterval.EVENT_CHANGE = "EVENT_CHANGE";
BI.NumberInterval.EVENT_VALID = "EVENT_VALID";
BI.NumberInterval.EVENT_ERROR = "EVENT_ERROR";
BI.shortcut("bi.number_interval", BI.NumberInterval);/**
*
* 表格
*

2
demo/js/widget/filemanager/demo.file.manager.js

@ -46,7 +46,7 @@ Demo.FileManager = BI.inherit(BI.Widget, {
lastModify: 1454316355142
}];
var filemanager = BI.createWidget({
type: "bi.fine_tuning_number_editor",
type: "bi.number_editor",
validationChecker: function (v) {
return BI.parseFloat(v) <= 100 && BI.parseFloat(v) >= 0
},

2
demo/js/widget/numericalinterval/demo.numerical_interval.js → demo/js/widget/numberinterval/demo.number_interval.js

@ -24,7 +24,7 @@ Demo.NumericalInterval = BI.inherit(BI.Widget, {
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.numerical_interval",
type: "bi.number_interval",
ref: function (_ref) {
self.numerical = _ref;
},

24
dist/bundle.css vendored

@ -3155,11 +3155,6 @@ ul.ztree.zTreeDragUL {
background-color: #191b2b;
color: #999999;
}
.bi-fine-tuning-number-editor {
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
}
.bi-interactive-arrangement .interactive-arrangement-dragtag-line {
z-index: 1000000000;
background-color: #f07d0a;
@ -3226,7 +3221,12 @@ ul.ztree.zTreeDragUL {
color: #3f8ce8;
z-index: 1;
}
.bi-numerical-interval .numerical-interval-small-editor {
.bi-number-editor {
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
}
.bi-number-interval .number-interval-small-editor {
-moz-border-radius-topleft: 2px;
-webkit-border-top-left-radius: 2px;
-moz-border-radius-bottomleft: 2px;
@ -3234,7 +3234,7 @@ ul.ztree.zTreeDragUL {
border-top-left-radius: 2px;
border-bottom-left-radius: 2px;
}
.bi-numerical-interval .numerical-interval-big-editor {
.bi-number-interval .number-interval-big-editor {
-moz-border-radius-topright: 2px;
-webkit-border-top-right-radius: 2px;
-moz-border-radius-bottomright: 2px;
@ -3242,7 +3242,7 @@ ul.ztree.zTreeDragUL {
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
}
.bi-numerical-interval .numerical-interval-big-combo {
.bi-number-interval .number-interval-big-combo {
-moz-border-radius-topleft: 2px;
-webkit-border-top-left-radius: 2px;
-moz-border-radius-bottomleft: 2px;
@ -3250,10 +3250,10 @@ ul.ztree.zTreeDragUL {
border-top-left-radius: 2px;
border-bottom-left-radius: 2px;
}
.bi-numerical-interval .numerical-interval-big-combo .bi-icon-combo-trigger .icon-combo-trigger-icon {
.bi-number-interval .number-interval-big-combo .bi-icon-combo-trigger .icon-combo-trigger-icon {
font-size: 14px;
}
.bi-numerical-interval .numerical-interval-small-combo {
.bi-number-interval .number-interval-small-combo {
-moz-border-radius-topright: 2px;
-webkit-border-top-right-radius: 2px;
-moz-border-radius-bottomright: 2px;
@ -3261,10 +3261,10 @@ ul.ztree.zTreeDragUL {
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
}
.bi-numerical-interval .numerical-interval-small-combo .bi-icon-combo-trigger .icon-combo-trigger-icon {
.bi-number-interval .number-interval-small-combo .bi-icon-combo-trigger .icon-combo-trigger-icon {
font-size: 14px;
}
.bi-numerical-interval.number-error .bi-input {
.bi-number-interval.number-error .bi-input {
color: #e85050;
}
.bi-page-table-cell {

260
dist/bundle.js vendored

@ -84004,109 +84004,6 @@ BI.extend(BI.FileManagerNav, {
});
BI.FileManagerNav.EVENT_CHANGE = "FileManagerNav.EVENT_CHANGE";
BI.shortcut("bi.file_manager_nav", BI.FileManagerNav);/**
* Created by windy on 2017/3/13.
* 数值微调器
*/
BI.FineTuningNumberEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.FineTuningNumberEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-fine-tuning-number-editor bi-border",
validationChecker: function () {return true;},
valueFormatter: function (v) {return v;},
value: 0,
errorText: "",
step: 1
})
},
_init: function () {
BI.FineTuningNumberEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.sign_editor",
height: o.height,
value: o.valueFormatter(o.value),
validationChecker: o.validationChecker,
errorText: o.errorText
});
this.editor.on(BI.TextEditor.EVENT_CHANGE, function () {
o.value = this.getValue();
self.fireEvent(BI.FineTuningNumberEditor.EVENT_CHANGE);
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function(){
self.fireEvent(BI.FineTuningNumberEditor.EVENT_CONFIRM);
});
this.topBtn = BI.createWidget({
type: "bi.icon_button",
trigger: "lclick,",
cls: "column-pre-page-h-font top-button bi-border-left bi-border-bottom"
});
this.topBtn.on(BI.IconButton.EVENT_CHANGE, function(){
self._finetuning(o.step);
self.fireEvent(BI.FineTuningNumberEditor.EVENT_CHANGE);
self.fireEvent(BI.FineTuningNumberEditor.EVENT_CONFIRM);
});
this.bottomBtn = BI.createWidget({
type: "bi.icon_button",
trigger: "lclick,",
cls: "column-next-page-h-font bottom-button bi-border-left bi-border-top"
});
this.bottomBtn.on(BI.IconButton.EVENT_CHANGE, function(){
self._finetuning(-o.step);
self.fireEvent(BI.FineTuningNumberEditor.EVENT_CHANGE);
self.fireEvent(BI.FineTuningNumberEditor.EVENT_CONFIRM);
});
BI.createWidget({
type: "bi.htape",
element: this,
items: [this.editor, {
el: {
type: "bi.grid",
columns: 1,
rows: 2,
items: [{
column: 0,
row: 0,
el: this.topBtn
}, {
column: 0,
row: 1,
el: this.bottomBtn
}]
},
width: 23
}]
});
},
//微调
_finetuning: function(add){
var v = BI.parseFloat(this.getValue());
this.setValue(v.add(add));
},
setUpEnable: function (v) {
this.topBtn.setEnable(!!v);
},
setBottomEnable: function (v) {
this.bottomBtn.setEnable(!!v);
},
getValue: function () {
return this.options.value;
},
setValue: function (v) {
var o = this.options;
o.value = v;
this.editor.setValue(o.valueFormatter(v));
}
});
BI.FineTuningNumberEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.FineTuningNumberEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.fine_tuning_number_editor", BI.FineTuningNumberEditor);/**
* 交互行为布局
*
*
@ -90347,13 +90244,116 @@ BI.MultiTreeSearcher.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiTreeSearcher.EVENT_START = "EVENT_START";
BI.MultiTreeSearcher.EVENT_STOP = "EVENT_STOP";
BI.MultiTreeSearcher.EVENT_PAUSE = "EVENT_PAUSE";
BI.shortcut('bi.multi_tree_searcher', BI.MultiTreeSearcher);//小于号的值为:0,小于等于号的值为:1
BI.shortcut('bi.multi_tree_searcher', BI.MultiTreeSearcher);/**
* Created by windy on 2017/3/13.
* 数值微调器
*/
BI.NumberEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.NumberEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-number-editor bi-border",
validationChecker: function () {return true;},
valueFormatter: function (v) {return v;},
value: 0,
errorText: "",
step: 1
})
},
_init: function () {
BI.NumberEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.sign_editor",
height: o.height,
value: o.valueFormatter(o.value),
validationChecker: o.validationChecker,
errorText: o.errorText
});
this.editor.on(BI.TextEditor.EVENT_CHANGE, function () {
o.value = this.getValue();
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function(){
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
});
this.topBtn = BI.createWidget({
type: "bi.icon_button",
trigger: "lclick,",
cls: "column-pre-page-h-font top-button bi-border-left bi-border-bottom"
});
this.topBtn.on(BI.IconButton.EVENT_CHANGE, function(){
self._finetuning(o.step);
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
});
this.bottomBtn = BI.createWidget({
type: "bi.icon_button",
trigger: "lclick,",
cls: "column-next-page-h-font bottom-button bi-border-left bi-border-top"
});
this.bottomBtn.on(BI.IconButton.EVENT_CHANGE, function(){
self._finetuning(-o.step);
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
});
BI.createWidget({
type: "bi.htape",
element: this,
items: [this.editor, {
el: {
type: "bi.grid",
columns: 1,
rows: 2,
items: [{
column: 0,
row: 0,
el: this.topBtn
}, {
column: 0,
row: 1,
el: this.bottomBtn
}]
},
width: 23
}]
});
},
//微调
_finetuning: function(add){
var v = BI.parseFloat(this.getValue());
this.setValue(v.add(add));
},
setUpEnable: function (v) {
this.topBtn.setEnable(!!v);
},
setBottomEnable: function (v) {
this.bottomBtn.setEnable(!!v);
},
getValue: function () {
return this.options.value;
},
setValue: function (v) {
var o = this.options;
o.value = v;
this.editor.setValue(o.valueFormatter(v));
}
});
BI.NumberEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.NumberEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.number_editor", BI.NumberEditor);//小于号的值为:0,小于等于号的值为:1
//closeMIn:最小值的符号,closeMax:最大值的符号
/**
* Created by roy on 15/9/17.
*
*/
BI.NumericalInterval = BI.inherit(BI.Single, {
BI.NumberInterval = BI.inherit(BI.Single, {
constants: {
typeError: "typeBubble",
numberError: "numberBubble",
@ -90369,16 +90369,16 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
numTip: ""
},
_defaultConfig: function () {
var conf = BI.NumericalInterval.superclass._defaultConfig.apply(this, arguments)
var conf = BI.NumberInterval.superclass._defaultConfig.apply(this, arguments)
return BI.extend(conf, {
extraCls: "bi-numerical-interval",
extraCls: "bi-number-interval",
height: 25,
validation: "valid"
})
},
_init: function () {
var self = this, c = this.constants, o = this.options;
BI.NumericalInterval.superclass._init.apply(this, arguments)
BI.NumberInterval.superclass._init.apply(this, arguments)
this.smallEditor = BI.createWidget({
type: "bi.editor",
height: o.height - 2,
@ -90397,7 +90397,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
}
return true;
},
cls: "numerical-interval-small-editor bi-border-top bi-border-bottom bi-border-left"
cls: "number-interval-small-editor bi-border-top bi-border-bottom bi-border-left"
});
this.smallTip = BI.createWidget({
@ -90434,7 +90434,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
}
return true;
},
cls: "numerical-interval-big-editor bi-border-top bi-border-bottom bi-border-right"
cls: "number-interval-big-editor bi-border-top bi-border-bottom bi-border-right"
});
this.bigTip = BI.createWidget({
@ -90454,23 +90454,23 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
});
//this.smallCombo = BI.createWidget({
// type: "bi.numerical_interval_combo",
// cls: "numerical-interval-small-combo",
// type: "bi.number_interval_combo",
// cls: "number-interval-small-combo",
// height: o.height,
// value: o.closemin ? 1 : 0,
// offsetStyle: "left"
//});
//
//this.bigCombo = BI.createWidget({
// type: "bi.numerical_interval_combo",
// cls: "numerical-interval-big-combo",
// type: "bi.number_interval_combo",
// cls: "number-interval-big-combo",
// height: o.height,
// value: o.closemax ? 1 : 0,
// offsetStyle: "left"
//});
this.smallCombo = BI.createWidget({
type: "bi.icon_combo",
cls: "numerical-interval-small-combo bi-border",
cls: "number-interval-small-combo bi-border",
height: o.height - 2,
items: [{
text: "(" + BI.i18nText("BI-Less_Than") + ")",
@ -90489,7 +90489,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
}
this.bigCombo = BI.createWidget({
type: "bi.icon_combo",
cls: "numerical-interval-big-combo bi-border",
cls: "number-interval-big-combo bi-border",
height: o.height - 2,
items: [{
text: "(" + BI.i18nText("BI-Less_Than") + ")",
@ -90697,7 +90697,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
BI.Bubbles.show(c.typeError, BI.i18nText("BI-Numerical_Interval_Input_Data"), self, {
offsetStyle: "center"
});
self.fireEvent(BI.NumericalInterval.EVENT_ERROR);
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
})
},
@ -90710,16 +90710,16 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
BI.Bubbles.show(c.numberError, BI.i18nText("BI-Numerical_Interval_Number_Value"), self, {
offsetStyle: "center"
});
self.fireEvent(BI.NumericalInterval.EVENT_ERROR);
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
case c.signalError:
BI.Bubbles.show(c.signalError, BI.i18nText("BI-Numerical_Interval_Signal_Value"), self, {
offsetStyle: "center"
});
self.fireEvent(BI.NumericalInterval.EVENT_ERROR);
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
default:
self.fireEvent(BI.NumericalInterval.EVENT_VALID);
self.fireEvent(BI.NumberInterval.EVENT_VALID);
}
})
},
@ -90747,7 +90747,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
default :
break;
}
self.fireEvent(BI.NumericalInterval.EVENT_CHANGE);
self.fireEvent(BI.NumberInterval.EVENT_CHANGE);
});
},
@ -90757,19 +90757,19 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
switch (self._checkValidation()) {
case c.typeError:
self._setTitle(BI.i18nText("BI-Numerical_Interval_Input_Data"));
self.fireEvent(BI.NumericalInterval.EVENT_ERROR);
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
case c.numberError:
self._setTitle(BI.i18nText("BI-Numerical_Interval_Number_Value"));
self.fireEvent(BI.NumericalInterval.EVENT_ERROR);
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
case c.signalError:
self._setTitle(BI.i18nText("BI-Numerical_Interval_Signal_Value"));
self.fireEvent(BI.NumericalInterval.EVENT_ERROR);
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
default :
self.fireEvent(BI.NumericalInterval.EVENT_CHANGE);
self.fireEvent(BI.NumericalInterval.EVENT_VALID);
self.fireEvent(BI.NumberInterval.EVENT_CHANGE);
self.fireEvent(BI.NumberInterval.EVENT_VALID);
}
})
},
@ -90870,10 +90870,10 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
return value;
}
});
BI.NumericalInterval.EVENT_CHANGE = "EVENT_CHANGE";
BI.NumericalInterval.EVENT_VALID = "EVENT_VALID";
BI.NumericalInterval.EVENT_ERROR = "EVENT_ERROR";
BI.shortcut("bi.numerical_interval", BI.NumericalInterval);/**
BI.NumberInterval.EVENT_CHANGE = "EVENT_CHANGE";
BI.NumberInterval.EVENT_VALID = "EVENT_VALID";
BI.NumberInterval.EVENT_ERROR = "EVENT_ERROR";
BI.shortcut("bi.number_interval", BI.NumberInterval);/**
*
* 表格
*

2
dist/bundle.min.css vendored

File diff suppressed because one or more lines are too long

18
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

4
dist/demo.js vendored

@ -7789,7 +7789,7 @@ Demo.FileManager = BI.inherit(BI.Widget, {
lastModify: 1454316355142
}];
var filemanager = BI.createWidget({
type: "bi.fine_tuning_number_editor",
type: "bi.number_editor",
validationChecker: function (v) {
return BI.parseFloat(v) <= 100 && BI.parseFloat(v) >= 0
},
@ -8002,7 +8002,7 @@ Demo.NumericalInterval = BI.inherit(BI.Widget, {
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.numerical_interval",
type: "bi.number_interval",
ref: function (_ref) {
self.numerical = _ref;
},

24
dist/widget.css vendored

@ -68,11 +68,6 @@
background-color: #191b2b;
color: #999999;
}
.bi-fine-tuning-number-editor {
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
}
.bi-interactive-arrangement .interactive-arrangement-dragtag-line {
z-index: 1000000000;
background-color: #f07d0a;
@ -139,7 +134,12 @@
color: #3f8ce8;
z-index: 1;
}
.bi-numerical-interval .numerical-interval-small-editor {
.bi-number-editor {
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
}
.bi-number-interval .number-interval-small-editor {
-moz-border-radius-topleft: 2px;
-webkit-border-top-left-radius: 2px;
-moz-border-radius-bottomleft: 2px;
@ -147,7 +147,7 @@
border-top-left-radius: 2px;
border-bottom-left-radius: 2px;
}
.bi-numerical-interval .numerical-interval-big-editor {
.bi-number-interval .number-interval-big-editor {
-moz-border-radius-topright: 2px;
-webkit-border-top-right-radius: 2px;
-moz-border-radius-bottomright: 2px;
@ -155,7 +155,7 @@
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
}
.bi-numerical-interval .numerical-interval-big-combo {
.bi-number-interval .number-interval-big-combo {
-moz-border-radius-topleft: 2px;
-webkit-border-top-left-radius: 2px;
-moz-border-radius-bottomleft: 2px;
@ -163,10 +163,10 @@
border-top-left-radius: 2px;
border-bottom-left-radius: 2px;
}
.bi-numerical-interval .numerical-interval-big-combo .bi-icon-combo-trigger .icon-combo-trigger-icon {
.bi-number-interval .number-interval-big-combo .bi-icon-combo-trigger .icon-combo-trigger-icon {
font-size: 14px;
}
.bi-numerical-interval .numerical-interval-small-combo {
.bi-number-interval .number-interval-small-combo {
-moz-border-radius-topright: 2px;
-webkit-border-top-right-radius: 2px;
-moz-border-radius-bottomright: 2px;
@ -174,10 +174,10 @@
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
}
.bi-numerical-interval .numerical-interval-small-combo .bi-icon-combo-trigger .icon-combo-trigger-icon {
.bi-number-interval .number-interval-small-combo .bi-icon-combo-trigger .icon-combo-trigger-icon {
font-size: 14px;
}
.bi-numerical-interval.number-error .bi-input {
.bi-number-interval.number-error .bi-input {
color: #e85050;
}
.bi-page-table-cell {

260
dist/widget.js vendored

@ -5376,109 +5376,6 @@ BI.extend(BI.FileManagerNav, {
});
BI.FileManagerNav.EVENT_CHANGE = "FileManagerNav.EVENT_CHANGE";
BI.shortcut("bi.file_manager_nav", BI.FileManagerNav);/**
* Created by windy on 2017/3/13.
* 数值微调器
*/
BI.FineTuningNumberEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.FineTuningNumberEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-fine-tuning-number-editor bi-border",
validationChecker: function () {return true;},
valueFormatter: function (v) {return v;},
value: 0,
errorText: "",
step: 1
})
},
_init: function () {
BI.FineTuningNumberEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.sign_editor",
height: o.height,
value: o.valueFormatter(o.value),
validationChecker: o.validationChecker,
errorText: o.errorText
});
this.editor.on(BI.TextEditor.EVENT_CHANGE, function () {
o.value = this.getValue();
self.fireEvent(BI.FineTuningNumberEditor.EVENT_CHANGE);
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function(){
self.fireEvent(BI.FineTuningNumberEditor.EVENT_CONFIRM);
});
this.topBtn = BI.createWidget({
type: "bi.icon_button",
trigger: "lclick,",
cls: "column-pre-page-h-font top-button bi-border-left bi-border-bottom"
});
this.topBtn.on(BI.IconButton.EVENT_CHANGE, function(){
self._finetuning(o.step);
self.fireEvent(BI.FineTuningNumberEditor.EVENT_CHANGE);
self.fireEvent(BI.FineTuningNumberEditor.EVENT_CONFIRM);
});
this.bottomBtn = BI.createWidget({
type: "bi.icon_button",
trigger: "lclick,",
cls: "column-next-page-h-font bottom-button bi-border-left bi-border-top"
});
this.bottomBtn.on(BI.IconButton.EVENT_CHANGE, function(){
self._finetuning(-o.step);
self.fireEvent(BI.FineTuningNumberEditor.EVENT_CHANGE);
self.fireEvent(BI.FineTuningNumberEditor.EVENT_CONFIRM);
});
BI.createWidget({
type: "bi.htape",
element: this,
items: [this.editor, {
el: {
type: "bi.grid",
columns: 1,
rows: 2,
items: [{
column: 0,
row: 0,
el: this.topBtn
}, {
column: 0,
row: 1,
el: this.bottomBtn
}]
},
width: 23
}]
});
},
//微调
_finetuning: function(add){
var v = BI.parseFloat(this.getValue());
this.setValue(v.add(add));
},
setUpEnable: function (v) {
this.topBtn.setEnable(!!v);
},
setBottomEnable: function (v) {
this.bottomBtn.setEnable(!!v);
},
getValue: function () {
return this.options.value;
},
setValue: function (v) {
var o = this.options;
o.value = v;
this.editor.setValue(o.valueFormatter(v));
}
});
BI.FineTuningNumberEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.FineTuningNumberEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.fine_tuning_number_editor", BI.FineTuningNumberEditor);/**
* 交互行为布局
*
*
@ -11719,13 +11616,116 @@ BI.MultiTreeSearcher.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiTreeSearcher.EVENT_START = "EVENT_START";
BI.MultiTreeSearcher.EVENT_STOP = "EVENT_STOP";
BI.MultiTreeSearcher.EVENT_PAUSE = "EVENT_PAUSE";
BI.shortcut('bi.multi_tree_searcher', BI.MultiTreeSearcher);//小于号的值为:0,小于等于号的值为:1
BI.shortcut('bi.multi_tree_searcher', BI.MultiTreeSearcher);/**
* Created by windy on 2017/3/13.
* 数值微调器
*/
BI.NumberEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.NumberEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-number-editor bi-border",
validationChecker: function () {return true;},
valueFormatter: function (v) {return v;},
value: 0,
errorText: "",
step: 1
})
},
_init: function () {
BI.NumberEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.sign_editor",
height: o.height,
value: o.valueFormatter(o.value),
validationChecker: o.validationChecker,
errorText: o.errorText
});
this.editor.on(BI.TextEditor.EVENT_CHANGE, function () {
o.value = this.getValue();
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function(){
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
});
this.topBtn = BI.createWidget({
type: "bi.icon_button",
trigger: "lclick,",
cls: "column-pre-page-h-font top-button bi-border-left bi-border-bottom"
});
this.topBtn.on(BI.IconButton.EVENT_CHANGE, function(){
self._finetuning(o.step);
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
});
this.bottomBtn = BI.createWidget({
type: "bi.icon_button",
trigger: "lclick,",
cls: "column-next-page-h-font bottom-button bi-border-left bi-border-top"
});
this.bottomBtn.on(BI.IconButton.EVENT_CHANGE, function(){
self._finetuning(-o.step);
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
});
BI.createWidget({
type: "bi.htape",
element: this,
items: [this.editor, {
el: {
type: "bi.grid",
columns: 1,
rows: 2,
items: [{
column: 0,
row: 0,
el: this.topBtn
}, {
column: 0,
row: 1,
el: this.bottomBtn
}]
},
width: 23
}]
});
},
//微调
_finetuning: function(add){
var v = BI.parseFloat(this.getValue());
this.setValue(v.add(add));
},
setUpEnable: function (v) {
this.topBtn.setEnable(!!v);
},
setBottomEnable: function (v) {
this.bottomBtn.setEnable(!!v);
},
getValue: function () {
return this.options.value;
},
setValue: function (v) {
var o = this.options;
o.value = v;
this.editor.setValue(o.valueFormatter(v));
}
});
BI.NumberEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.NumberEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.number_editor", BI.NumberEditor);//小于号的值为:0,小于等于号的值为:1
//closeMIn:最小值的符号,closeMax:最大值的符号
/**
* Created by roy on 15/9/17.
*
*/
BI.NumericalInterval = BI.inherit(BI.Single, {
BI.NumberInterval = BI.inherit(BI.Single, {
constants: {
typeError: "typeBubble",
numberError: "numberBubble",
@ -11741,16 +11741,16 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
numTip: ""
},
_defaultConfig: function () {
var conf = BI.NumericalInterval.superclass._defaultConfig.apply(this, arguments)
var conf = BI.NumberInterval.superclass._defaultConfig.apply(this, arguments)
return BI.extend(conf, {
extraCls: "bi-numerical-interval",
extraCls: "bi-number-interval",
height: 25,
validation: "valid"
})
},
_init: function () {
var self = this, c = this.constants, o = this.options;
BI.NumericalInterval.superclass._init.apply(this, arguments)
BI.NumberInterval.superclass._init.apply(this, arguments)
this.smallEditor = BI.createWidget({
type: "bi.editor",
height: o.height - 2,
@ -11769,7 +11769,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
}
return true;
},
cls: "numerical-interval-small-editor bi-border-top bi-border-bottom bi-border-left"
cls: "number-interval-small-editor bi-border-top bi-border-bottom bi-border-left"
});
this.smallTip = BI.createWidget({
@ -11806,7 +11806,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
}
return true;
},
cls: "numerical-interval-big-editor bi-border-top bi-border-bottom bi-border-right"
cls: "number-interval-big-editor bi-border-top bi-border-bottom bi-border-right"
});
this.bigTip = BI.createWidget({
@ -11826,23 +11826,23 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
});
//this.smallCombo = BI.createWidget({
// type: "bi.numerical_interval_combo",
// cls: "numerical-interval-small-combo",
// type: "bi.number_interval_combo",
// cls: "number-interval-small-combo",
// height: o.height,
// value: o.closemin ? 1 : 0,
// offsetStyle: "left"
//});
//
//this.bigCombo = BI.createWidget({
// type: "bi.numerical_interval_combo",
// cls: "numerical-interval-big-combo",
// type: "bi.number_interval_combo",
// cls: "number-interval-big-combo",
// height: o.height,
// value: o.closemax ? 1 : 0,
// offsetStyle: "left"
//});
this.smallCombo = BI.createWidget({
type: "bi.icon_combo",
cls: "numerical-interval-small-combo bi-border",
cls: "number-interval-small-combo bi-border",
height: o.height - 2,
items: [{
text: "(" + BI.i18nText("BI-Less_Than") + ")",
@ -11861,7 +11861,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
}
this.bigCombo = BI.createWidget({
type: "bi.icon_combo",
cls: "numerical-interval-big-combo bi-border",
cls: "number-interval-big-combo bi-border",
height: o.height - 2,
items: [{
text: "(" + BI.i18nText("BI-Less_Than") + ")",
@ -12069,7 +12069,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
BI.Bubbles.show(c.typeError, BI.i18nText("BI-Numerical_Interval_Input_Data"), self, {
offsetStyle: "center"
});
self.fireEvent(BI.NumericalInterval.EVENT_ERROR);
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
})
},
@ -12082,16 +12082,16 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
BI.Bubbles.show(c.numberError, BI.i18nText("BI-Numerical_Interval_Number_Value"), self, {
offsetStyle: "center"
});
self.fireEvent(BI.NumericalInterval.EVENT_ERROR);
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
case c.signalError:
BI.Bubbles.show(c.signalError, BI.i18nText("BI-Numerical_Interval_Signal_Value"), self, {
offsetStyle: "center"
});
self.fireEvent(BI.NumericalInterval.EVENT_ERROR);
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
default:
self.fireEvent(BI.NumericalInterval.EVENT_VALID);
self.fireEvent(BI.NumberInterval.EVENT_VALID);
}
})
},
@ -12119,7 +12119,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
default :
break;
}
self.fireEvent(BI.NumericalInterval.EVENT_CHANGE);
self.fireEvent(BI.NumberInterval.EVENT_CHANGE);
});
},
@ -12129,19 +12129,19 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
switch (self._checkValidation()) {
case c.typeError:
self._setTitle(BI.i18nText("BI-Numerical_Interval_Input_Data"));
self.fireEvent(BI.NumericalInterval.EVENT_ERROR);
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
case c.numberError:
self._setTitle(BI.i18nText("BI-Numerical_Interval_Number_Value"));
self.fireEvent(BI.NumericalInterval.EVENT_ERROR);
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
case c.signalError:
self._setTitle(BI.i18nText("BI-Numerical_Interval_Signal_Value"));
self.fireEvent(BI.NumericalInterval.EVENT_ERROR);
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
default :
self.fireEvent(BI.NumericalInterval.EVENT_CHANGE);
self.fireEvent(BI.NumericalInterval.EVENT_VALID);
self.fireEvent(BI.NumberInterval.EVENT_CHANGE);
self.fireEvent(BI.NumberInterval.EVENT_VALID);
}
})
},
@ -12242,10 +12242,10 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
return value;
}
});
BI.NumericalInterval.EVENT_CHANGE = "EVENT_CHANGE";
BI.NumericalInterval.EVENT_VALID = "EVENT_VALID";
BI.NumericalInterval.EVENT_ERROR = "EVENT_ERROR";
BI.shortcut("bi.numerical_interval", BI.NumericalInterval);/**
BI.NumberInterval.EVENT_CHANGE = "EVENT_CHANGE";
BI.NumberInterval.EVENT_VALID = "EVENT_VALID";
BI.NumberInterval.EVENT_ERROR = "EVENT_ERROR";
BI.shortcut("bi.number_interval", BI.NumberInterval);/**
*
* 表格
*

2
docs/SUMMARY.md

@ -154,7 +154,7 @@
* 文本框控件
* [text_editor](detailed/text_input/bi.text_editor.md)
* [search_editor](detailed/text_input/bi.search_editor.md)
* [finetuning_number_editor](detailed/text_input/finetuning_number_editor.md)
* [number_editor](detailed/text_input/number_editor.md)
* [year_combo](detailed/year_combo.md)
* [month_combo](detailed/month_combo.md)
* [quarter_combo](detailed/quarter_combo.md)

2
docs/_book/detailed/numeric_interval.md → docs/_book/detailed/number_interval.md

@ -8,7 +8,7 @@
{% common %}
```javascript
BI.createWidget({
type: "bi.numerical_interval",
type: "bi.number_interval",
element: '#wrapper',
width: 500
});

2
docs/detailed/text_input/finetuning_number_editor.md → docs/_book/detailed/text_input/number_editor.md

@ -8,7 +8,7 @@
{% common %}
```javascript
BI.createWidget({
type: 'bi.fine_tuning_number_editor',
type: 'bi.number_editor',
element: '#wrapper',
width: 300
});

2
docs/detailed/numeric_interval.md → docs/detailed/number_interval.md

@ -8,7 +8,7 @@
{% common %}
```javascript
BI.createWidget({
type: "bi.numerical_interval",
type: "bi.number_interval",
element: '#wrapper',
width: 500
});

2
docs/_book/detailed/text_input/finetuning_number_editor.md → docs/detailed/text_input/number_editor.md

@ -8,7 +8,7 @@
{% common %}
```javascript
BI.createWidget({
type: 'bi.fine_tuning_number_editor',
type: 'bi.number_editor',
element: '#wrapper',
width: 300
});

2
src/css/widget/finetuningnumbereditor/finetuning.number.editor.css → src/css/widget/numbereditor/number.editor.css

@ -1,4 +1,4 @@
.bi-fine-tuning-number-editor {
.bi-number-editor {
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;

14
src/css/widget/numericalinterval/numericalinterval.css → src/css/widget/numberinterval/numberinterval.css

@ -1,4 +1,4 @@
.bi-numerical-interval .numerical-interval-small-editor {
.bi-number-interval .number-interval-small-editor {
-moz-border-radius-topleft: 2px;
-webkit-border-top-left-radius: 2px;
-moz-border-radius-bottomleft: 2px;
@ -6,7 +6,7 @@
border-top-left-radius: 2px;
border-bottom-left-radius: 2px;
}
.bi-numerical-interval .numerical-interval-big-editor {
.bi-number-interval .number-interval-big-editor {
-moz-border-radius-topright: 2px;
-webkit-border-top-right-radius: 2px;
-moz-border-radius-bottomright: 2px;
@ -14,7 +14,7 @@
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
}
.bi-numerical-interval .numerical-interval-big-combo {
.bi-number-interval .number-interval-big-combo {
-moz-border-radius-topleft: 2px;
-webkit-border-top-left-radius: 2px;
-moz-border-radius-bottomleft: 2px;
@ -22,10 +22,10 @@
border-top-left-radius: 2px;
border-bottom-left-radius: 2px;
}
.bi-numerical-interval .numerical-interval-big-combo .bi-icon-combo-trigger .icon-combo-trigger-icon {
.bi-number-interval .number-interval-big-combo .bi-icon-combo-trigger .icon-combo-trigger-icon {
font-size: 14px;
}
.bi-numerical-interval .numerical-interval-small-combo {
.bi-number-interval .number-interval-small-combo {
-moz-border-radius-topright: 2px;
-webkit-border-top-right-radius: 2px;
-moz-border-radius-bottomright: 2px;
@ -33,9 +33,9 @@
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
}
.bi-numerical-interval .numerical-interval-small-combo .bi-icon-combo-trigger .icon-combo-trigger-icon {
.bi-number-interval .number-interval-small-combo .bi-icon-combo-trigger .icon-combo-trigger-icon {
font-size: 14px;
}
.bi-numerical-interval.number-error .bi-input {
.bi-number-interval.number-error .bi-input {
color: #e85050;
}

2
src/less/widget/finetuningnumbereditor/finetuning.number.editor.less → src/less/widget/numbereditor/number.editor.less

@ -1,6 +1,6 @@
@import "../../bibase";
.bi-fine-tuning-number-editor {
.bi-number-editor {
.border-radius(2px);
& .top-button {
}

10
src/less/widget/numericalinterval/numericalinterval.less → src/less/widget/numberinterval/numberinterval.less

@ -1,13 +1,13 @@
@import "../../bibase";
.bi-numerical-interval {
& .numerical-interval-small-editor {
.bi-number-interval {
& .number-interval-small-editor {
.border-corner-left-radius(2px, 2px);
}
& .numerical-interval-big-editor {
& .number-interval-big-editor {
.border-corner-right-radius(2px, 2px);
}
& .numerical-interval-big-combo {
& .number-interval-big-combo {
.border-corner-left-radius(2px, 2px);
& .bi-icon-combo-trigger {
& .icon-combo-trigger-icon {
@ -16,7 +16,7 @@
}
}
& .numerical-interval-small-combo {
& .number-interval-small-combo {
.border-corner-right-radius(2px, 2px);
& .bi-icon-combo-trigger {
& .icon-combo-trigger-icon {

4
src/less/widget/numberinterval/popup.numberinterval.less

@ -0,0 +1,4 @@
@import "../../bibase";
.bi-number-interval-popup{
}

4
src/less/widget/numericalinterval/popup.numericalinterval.less

@ -1,4 +0,0 @@
@import "../../bibase";
.bi-numerical-interval-popup{
}

26
src/widget/finetuningnumbereditor/finetuning.number.editor.js → src/widget/numbereditor/number.editor.js

@ -2,10 +2,10 @@
* Created by windy on 2017/3/13.
* 数值微调器
*/
BI.FineTuningNumberEditor = BI.inherit(BI.Widget, {
BI.NumberEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.FineTuningNumberEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-fine-tuning-number-editor bi-border",
return BI.extend(BI.NumberEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-number-editor bi-border",
validationChecker: function () {return true;},
valueFormatter: function (v) {return v;},
value: 0,
@ -15,7 +15,7 @@ BI.FineTuningNumberEditor = BI.inherit(BI.Widget, {
},
_init: function () {
BI.FineTuningNumberEditor.superclass._init.apply(this, arguments);
BI.NumberEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.sign_editor",
@ -26,10 +26,10 @@ BI.FineTuningNumberEditor = BI.inherit(BI.Widget, {
});
this.editor.on(BI.TextEditor.EVENT_CHANGE, function () {
o.value = this.getValue();
self.fireEvent(BI.FineTuningNumberEditor.EVENT_CHANGE);
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function(){
self.fireEvent(BI.FineTuningNumberEditor.EVENT_CONFIRM);
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
});
this.topBtn = BI.createWidget({
type: "bi.icon_button",
@ -38,8 +38,8 @@ BI.FineTuningNumberEditor = BI.inherit(BI.Widget, {
});
this.topBtn.on(BI.IconButton.EVENT_CHANGE, function(){
self._finetuning(o.step);
self.fireEvent(BI.FineTuningNumberEditor.EVENT_CHANGE);
self.fireEvent(BI.FineTuningNumberEditor.EVENT_CONFIRM);
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
});
this.bottomBtn = BI.createWidget({
type: "bi.icon_button",
@ -48,8 +48,8 @@ BI.FineTuningNumberEditor = BI.inherit(BI.Widget, {
});
this.bottomBtn.on(BI.IconButton.EVENT_CHANGE, function(){
self._finetuning(-o.step);
self.fireEvent(BI.FineTuningNumberEditor.EVENT_CHANGE);
self.fireEvent(BI.FineTuningNumberEditor.EVENT_CONFIRM);
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
});
BI.createWidget({
type: "bi.htape",
@ -99,6 +99,6 @@ BI.FineTuningNumberEditor = BI.inherit(BI.Widget, {
}
});
BI.FineTuningNumberEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.FineTuningNumberEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.fine_tuning_number_editor", BI.FineTuningNumberEditor);
BI.NumberEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.NumberEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.number_editor", BI.NumberEditor);

52
src/widget/numericalinterval/numericalinterval.js → src/widget/numberinterval/numberinterval.js

@ -4,7 +4,7 @@
* Created by roy on 15/9/17.
*
*/
BI.NumericalInterval = BI.inherit(BI.Single, {
BI.NumberInterval = BI.inherit(BI.Single, {
constants: {
typeError: "typeBubble",
numberError: "numberBubble",
@ -20,16 +20,16 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
numTip: ""
},
_defaultConfig: function () {
var conf = BI.NumericalInterval.superclass._defaultConfig.apply(this, arguments)
var conf = BI.NumberInterval.superclass._defaultConfig.apply(this, arguments)
return BI.extend(conf, {
extraCls: "bi-numerical-interval",
extraCls: "bi-number-interval",
height: 25,
validation: "valid"
})
},
_init: function () {
var self = this, c = this.constants, o = this.options;
BI.NumericalInterval.superclass._init.apply(this, arguments)
BI.NumberInterval.superclass._init.apply(this, arguments)
this.smallEditor = BI.createWidget({
type: "bi.editor",
height: o.height - 2,
@ -48,7 +48,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
}
return true;
},
cls: "numerical-interval-small-editor bi-border-top bi-border-bottom bi-border-left"
cls: "number-interval-small-editor bi-border-top bi-border-bottom bi-border-left"
});
this.smallTip = BI.createWidget({
@ -85,7 +85,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
}
return true;
},
cls: "numerical-interval-big-editor bi-border-top bi-border-bottom bi-border-right"
cls: "number-interval-big-editor bi-border-top bi-border-bottom bi-border-right"
});
this.bigTip = BI.createWidget({
@ -105,23 +105,23 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
});
//this.smallCombo = BI.createWidget({
// type: "bi.numerical_interval_combo",
// cls: "numerical-interval-small-combo",
// type: "bi.number_interval_combo",
// cls: "number-interval-small-combo",
// height: o.height,
// value: o.closemin ? 1 : 0,
// offsetStyle: "left"
//});
//
//this.bigCombo = BI.createWidget({
// type: "bi.numerical_interval_combo",
// cls: "numerical-interval-big-combo",
// type: "bi.number_interval_combo",
// cls: "number-interval-big-combo",
// height: o.height,
// value: o.closemax ? 1 : 0,
// offsetStyle: "left"
//});
this.smallCombo = BI.createWidget({
type: "bi.icon_combo",
cls: "numerical-interval-small-combo bi-border",
cls: "number-interval-small-combo bi-border",
height: o.height - 2,
items: [{
text: "(" + BI.i18nText("BI-Less_Than") + ")",
@ -140,7 +140,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
}
this.bigCombo = BI.createWidget({
type: "bi.icon_combo",
cls: "numerical-interval-big-combo bi-border",
cls: "number-interval-big-combo bi-border",
height: o.height - 2,
items: [{
text: "(" + BI.i18nText("BI-Less_Than") + ")",
@ -348,7 +348,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
BI.Bubbles.show(c.typeError, BI.i18nText("BI-Numerical_Interval_Input_Data"), self, {
offsetStyle: "center"
});
self.fireEvent(BI.NumericalInterval.EVENT_ERROR);
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
})
},
@ -361,16 +361,16 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
BI.Bubbles.show(c.numberError, BI.i18nText("BI-Numerical_Interval_Number_Value"), self, {
offsetStyle: "center"
});
self.fireEvent(BI.NumericalInterval.EVENT_ERROR);
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
case c.signalError:
BI.Bubbles.show(c.signalError, BI.i18nText("BI-Numerical_Interval_Signal_Value"), self, {
offsetStyle: "center"
});
self.fireEvent(BI.NumericalInterval.EVENT_ERROR);
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
default:
self.fireEvent(BI.NumericalInterval.EVENT_VALID);
self.fireEvent(BI.NumberInterval.EVENT_VALID);
}
})
},
@ -398,7 +398,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
default :
break;
}
self.fireEvent(BI.NumericalInterval.EVENT_CHANGE);
self.fireEvent(BI.NumberInterval.EVENT_CHANGE);
});
},
@ -408,19 +408,19 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
switch (self._checkValidation()) {
case c.typeError:
self._setTitle(BI.i18nText("BI-Numerical_Interval_Input_Data"));
self.fireEvent(BI.NumericalInterval.EVENT_ERROR);
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
case c.numberError:
self._setTitle(BI.i18nText("BI-Numerical_Interval_Number_Value"));
self.fireEvent(BI.NumericalInterval.EVENT_ERROR);
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
case c.signalError:
self._setTitle(BI.i18nText("BI-Numerical_Interval_Signal_Value"));
self.fireEvent(BI.NumericalInterval.EVENT_ERROR);
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
default :
self.fireEvent(BI.NumericalInterval.EVENT_CHANGE);
self.fireEvent(BI.NumericalInterval.EVENT_VALID);
self.fireEvent(BI.NumberInterval.EVENT_CHANGE);
self.fireEvent(BI.NumberInterval.EVENT_VALID);
}
})
},
@ -521,7 +521,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
return value;
}
});
BI.NumericalInterval.EVENT_CHANGE = "EVENT_CHANGE";
BI.NumericalInterval.EVENT_VALID = "EVENT_VALID";
BI.NumericalInterval.EVENT_ERROR = "EVENT_ERROR";
BI.shortcut("bi.numerical_interval", BI.NumericalInterval);
BI.NumberInterval.EVENT_CHANGE = "EVENT_CHANGE";
BI.NumberInterval.EVENT_VALID = "EVENT_VALID";
BI.NumberInterval.EVENT_ERROR = "EVENT_ERROR";
BI.shortcut("bi.number_interval", BI.NumberInterval);
Loading…
Cancel
Save