Browse Source

Merge pull request #148 in FUI/fineui from ~GUY/fineui:master to master

* commit 'eaae9aa8f51002cab64a602105d7d58ce777f1f5':
  update
  针对codemirrior的修改
  update
  update
  update
es6
guy 7 years ago
parent
commit
d0761ba0a0
  1. 644
      bi/base.js
  2. 2
      bi/core.js
  3. 1
      bi/sliders.js
  4. 60
      demo/js/addons/slider/demo.slider.js
  5. 2
      dist/base.js
  6. 4
      dist/bundle.js
  7. 26
      dist/bundle.min.js
  8. 2
      dist/core.js
  9. 60
      dist/demo.js
  10. 1
      dist/sliders.js
  11. 1
      src/addons/sliders/js/singleslider/singleslider.js
  12. 2
      src/base/combination/combo.js
  13. 2
      src/core/wrapper/layout/adapt/adapt.horizontal.js

644
bi/base.js

@ -3261,7 +3261,7 @@ BI.Combo = BI.inherit(BI.Widget, {
// if (this.element.__isMouseInBounds__(e) || (this.popupView && this.popupView.element.__isMouseInBounds__(e))) {
// return;
// }
if (this.element.find(e.target).length > 0 || $(e.target).closest(".CodeMirror-hints").length > 0) {//BI-9887 CodeMirror的公式弹框需要特殊处理下
if (this.element.find(e.target).length > 0 || e.target.className === "CodeMirror-cursor" || $(e.target).closest(".CodeMirror-hints").length > 0) {//BI-9887 CodeMirror的公式弹框需要特殊处理下
return;
}
var isHide = this.options.hideChecker.apply(this, [e]);
@ -16402,68 +16402,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);/**
* 富文本编辑器
*
@ -16744,57 +16744,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.
@ -17062,214 +17062,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);/**
* 富文本编辑器
*

2
bi/core.js

@ -12013,7 +12013,7 @@ BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.HorizontalAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-horizontal-adapt-layout",
verticalAlign: BI.VerticalAlign.Middle,
verticalAlign: BI.VerticalAlign.Top,
columnSize: [],
hgap: 0,
vgap: 0,

1
bi/sliders.js

@ -1451,6 +1451,7 @@ BI.SingleSlider = BI.inherit(BI.Widget, {
this.min = 0;
this.max = 0;
this._setBlueTrack(0);
},
populate: function () {

60
demo/js/addons/slider/demo.slider.js

@ -2,24 +2,27 @@
* Created by Urthur on 2017/9/4.
*/
Demo.Slider = BI.inherit(BI.Widget, {
_props: {
baseCls: "demo-slider",
min: 10,
max: 50
props: {
baseCls: "demo-slider",
width: 300,
height: 50,
min: 0,
max: 100
},
render: function () {
var self = this, o = this.options;
var singleSlider = BI.createWidget({
type: "bi.single_slider",
digit: 0,
width: 300,
height: 50,
width: o.width,
height: o.height,
cls: "layout-bg-white"
});
singleSlider.setMinAndMax({
min: 10,
max: 100
max: o.max
});
singleSlider.setValue(30);
@ -28,43 +31,42 @@ Demo.Slider = BI.inherit(BI.Widget, {
console.log(this.getValue());
});
var singleSliderLabel = BI.createWidget({
type: "bi.single_slider_label",
height: 50,
width: 300,
digit: 0,
unit: "个",
cls: "layout-bg-white"
});
singleSliderLabel.setMinAndMax({
min: 0,
max: 100
});
singleSliderLabel.setValue(10);
singleSliderLabel.populate();
var normalSingleSlider = BI.createWidget({
type: "bi.single_slider_normal",
width: o.width,
height: 30,
width: 300,
cls: "layout-bg-white"
});
normalSingleSlider.setMinAndMax({
min: 0,
max: 100
min: o.min,
max: o.max
});
normalSingleSlider.setValue(10);
normalSingleSlider.populate();
var singleSliderLabel = BI.createWidget({
type: "bi.single_slider_label",
width: o.width,
height: o.height,
digit: 0,
unit: "个",
cls: "layout-bg-white"
});
singleSliderLabel.setMinAndMax({
min: o.min,
max: o.max
});
singleSliderLabel.setValue(10);
singleSliderLabel.populate();
var intervalSlider = BI.createWidget({
type: "bi.interval_slider",
width: 300,
width: o.width,
cls: "layout-bg-white"
});
intervalSlider.setMinAndMax({
min: 0,
max: 120
min: o.min,
max: o.max
});
intervalSlider.setValue({
min: 10,
@ -74,7 +76,7 @@ Demo.Slider = BI.inherit(BI.Widget, {
var intervalSliderLabel = BI.createWidget({
type: "bi.interval_slider_label",
width: 300,
width: o.width,
unit: "个",
cls: "layout-bg-white"
});

2
dist/base.js vendored

@ -3261,7 +3261,7 @@ BI.Combo = BI.inherit(BI.Widget, {
// if (this.element.__isMouseInBounds__(e) || (this.popupView && this.popupView.element.__isMouseInBounds__(e))) {
// return;
// }
if (this.element.find(e.target).length > 0 || $(e.target).closest(".CodeMirror-hints").length > 0) {//BI-9887 CodeMirror的公式弹框需要特殊处理下
if (this.element.find(e.target).length > 0 || e.target.className === "CodeMirror-cursor" || $(e.target).closest(".CodeMirror-hints").length > 0) {//BI-9887 CodeMirror的公式弹框需要特殊处理下
return;
}
var isHide = this.options.hideChecker.apply(this, [e]);

4
dist/bundle.js vendored

@ -25590,7 +25590,7 @@ BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.HorizontalAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-horizontal-adapt-layout",
verticalAlign: BI.VerticalAlign.Middle,
verticalAlign: BI.VerticalAlign.Top,
columnSize: [],
hgap: 0,
vgap: 0,
@ -32284,7 +32284,7 @@ BI.Combo = BI.inherit(BI.Widget, {
// if (this.element.__isMouseInBounds__(e) || (this.popupView && this.popupView.element.__isMouseInBounds__(e))) {
// return;
// }
if (this.element.find(e.target).length > 0 || $(e.target).closest(".CodeMirror-hints").length > 0) {//BI-9887 CodeMirror的公式弹框需要特殊处理下
if (this.element.find(e.target).length > 0 || e.target.className === "CodeMirror-cursor" || $(e.target).closest(".CodeMirror-hints").length > 0) {//BI-9887 CodeMirror的公式弹框需要特殊处理下
return;
}
var isHide = this.options.hideChecker.apply(this, [e]);

26
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/core.js vendored

@ -25539,7 +25539,7 @@ BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.HorizontalAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-horizontal-adapt-layout",
verticalAlign: BI.VerticalAlign.Middle,
verticalAlign: BI.VerticalAlign.Top,
columnSize: [],
hgap: 0,
vgap: 0,

60
dist/demo.js vendored

@ -13,24 +13,27 @@ $(function () {
* Created by Urthur on 2017/9/4.
*/
Demo.Slider = BI.inherit(BI.Widget, {
_props: {
baseCls: "demo-slider",
min: 10,
max: 50
props: {
baseCls: "demo-slider",
width: 300,
height: 50,
min: 0,
max: 100
},
render: function () {
var self = this, o = this.options;
var singleSlider = BI.createWidget({
type: "bi.single_slider",
digit: 0,
width: 300,
height: 50,
width: o.width,
height: o.height,
cls: "layout-bg-white"
});
singleSlider.setMinAndMax({
min: 10,
max: 100
max: o.max
});
singleSlider.setValue(30);
@ -39,43 +42,42 @@ Demo.Slider = BI.inherit(BI.Widget, {
console.log(this.getValue());
});
var singleSliderLabel = BI.createWidget({
type: "bi.single_slider_label",
height: 50,
width: 300,
digit: 0,
unit: "个",
cls: "layout-bg-white"
});
singleSliderLabel.setMinAndMax({
min: 0,
max: 100
});
singleSliderLabel.setValue(10);
singleSliderLabel.populate();
var normalSingleSlider = BI.createWidget({
type: "bi.single_slider_normal",
width: o.width,
height: 30,
width: 300,
cls: "layout-bg-white"
});
normalSingleSlider.setMinAndMax({
min: 0,
max: 100
min: o.min,
max: o.max
});
normalSingleSlider.setValue(10);
normalSingleSlider.populate();
var singleSliderLabel = BI.createWidget({
type: "bi.single_slider_label",
width: o.width,
height: o.height,
digit: 0,
unit: "个",
cls: "layout-bg-white"
});
singleSliderLabel.setMinAndMax({
min: o.min,
max: o.max
});
singleSliderLabel.setValue(10);
singleSliderLabel.populate();
var intervalSlider = BI.createWidget({
type: "bi.interval_slider",
width: 300,
width: o.width,
cls: "layout-bg-white"
});
intervalSlider.setMinAndMax({
min: 0,
max: 120
min: o.min,
max: o.max
});
intervalSlider.setValue({
min: 10,
@ -85,7 +87,7 @@ Demo.Slider = BI.inherit(BI.Widget, {
var intervalSliderLabel = BI.createWidget({
type: "bi.interval_slider_label",
width: 300,
width: o.width,
unit: "个",
cls: "layout-bg-white"
});

1
dist/sliders.js vendored

@ -1451,6 +1451,7 @@ BI.SingleSlider = BI.inherit(BI.Widget, {
this.min = 0;
this.max = 0;
this._setBlueTrack(0);
},
populate: function () {

1
src/addons/sliders/js/singleslider/singleslider.js

@ -272,6 +272,7 @@ BI.SingleSlider = BI.inherit(BI.Widget, {
this.min = 0;
this.max = 0;
this._setBlueTrack(0);
},
populate: function () {

2
src/base/combination/combo.js

@ -219,7 +219,7 @@ BI.Combo = BI.inherit(BI.Widget, {
// if (this.element.__isMouseInBounds__(e) || (this.popupView && this.popupView.element.__isMouseInBounds__(e))) {
// return;
// }
if (this.element.find(e.target).length > 0 || $(e.target).closest(".CodeMirror-hints").length > 0) {//BI-9887 CodeMirror的公式弹框需要特殊处理下
if (this.element.find(e.target).length > 0 || e.target.className === "CodeMirror-cursor" || $(e.target).closest(".CodeMirror-hints").length > 0) {//BI-9887 CodeMirror的公式弹框需要特殊处理下
return;
}
var isHide = this.options.hideChecker.apply(this, [e]);

2
src/core/wrapper/layout/adapt/adapt.horizontal.js

@ -7,7 +7,7 @@ BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.HorizontalAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-horizontal-adapt-layout",
verticalAlign: BI.VerticalAlign.Middle,
verticalAlign: BI.VerticalAlign.Top,
columnSize: [],
hgap: 0,
vgap: 0,

Loading…
Cancel
Save