From 9c75b92cd10d7e22ff18074261bd7a70a3477717 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 20 Nov 2017 09:55:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0validationCherker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bi/widget.js | 8 ++++++-- demo/js/widget/slider/demo.slider.js | 8 ++++++-- dist/bundle.js | 8 ++++++-- dist/demo.js | 8 ++++++-- dist/widget.js | 8 ++++++-- src/widget/intervalslider/intervalslider.js | 7 +++++-- src/widget/singleslider/button/editor.sign.text.js | 1 + 7 files changed, 36 insertions(+), 12 deletions(-) diff --git a/bi/widget.js b/bi/widget.js index d7b82fcea..377632cde 100644 --- a/bi/widget.js +++ b/bi/widget.js @@ -5632,7 +5632,10 @@ BI.IntervalSlider = BI.inherit(BI.Widget, { return BI.extend(BI.IntervalSlider.superclass._defaultConfig.apply(this, arguments), { baseCls: "bi-interval-slider bi-slider-track", digit: false, - unit: "" + unit: "", + validationChecker: function (v) { + return true; + } }) }, @@ -5909,7 +5912,7 @@ BI.IntervalSlider = BI.inherit(BI.Widget, { }, _checkValidation: function (v) { - return BI.isNumeric(v) && !(BI.isNull(v) || v < this.min || v > this.max) + return this.options.validationChecker(v) && (BI.isNumeric(v) && !(BI.isNull(v) || v < this.min || v > this.max)); }, _checkOverlap: function () { @@ -17496,6 +17499,7 @@ BI.SignTextEditor = BI.inherit(BI.Widget, { } }); BI.SignTextEditor.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.SignTextEditor.EVENT_CLICK_LABEL = "EVENT_CLICK_LABEL"; BI.shortcut("bi.sign_text_editor", BI.SignTextEditor);/** * Created by zcf on 2016/9/22. diff --git a/demo/js/widget/slider/demo.slider.js b/demo/js/widget/slider/demo.slider.js index 0d766405e..ddf12d580 100644 --- a/demo/js/widget/slider/demo.slider.js +++ b/demo/js/widget/slider/demo.slider.js @@ -77,8 +77,12 @@ Demo.Slider = BI.inherit(BI.Widget, { var intervalSliderLabel = BI.createWidget({ type: "bi.interval_slider", width: o.width, - unit: "个", - cls: "layout-bg-white" + unit: "px", + cls: "layout-bg-white", + digit: 0, + validationChecker: function (v) { + return BI.isInteger(v); + } }); intervalSliderLabel.setMinAndMax({ min: 0, diff --git a/dist/bundle.js b/dist/bundle.js index efbb2ee20..ad562612e 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -80822,7 +80822,10 @@ BI.IntervalSlider = BI.inherit(BI.Widget, { return BI.extend(BI.IntervalSlider.superclass._defaultConfig.apply(this, arguments), { baseCls: "bi-interval-slider bi-slider-track", digit: false, - unit: "" + unit: "", + validationChecker: function (v) { + return true; + } }) }, @@ -81099,7 +81102,7 @@ BI.IntervalSlider = BI.inherit(BI.Widget, { }, _checkValidation: function (v) { - return BI.isNumeric(v) && !(BI.isNull(v) || v < this.min || v > this.max) + return this.options.validationChecker(v) && (BI.isNumeric(v) && !(BI.isNull(v) || v < this.min || v > this.max)); }, _checkOverlap: function () { @@ -92686,6 +92689,7 @@ BI.SignTextEditor = BI.inherit(BI.Widget, { } }); BI.SignTextEditor.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.SignTextEditor.EVENT_CLICK_LABEL = "EVENT_CLICK_LABEL"; BI.shortcut("bi.sign_text_editor", BI.SignTextEditor);/** * Created by zcf on 2016/9/22. diff --git a/dist/demo.js b/dist/demo.js index b2cb856fc..a46b72308 100644 --- a/dist/demo.js +++ b/dist/demo.js @@ -13063,8 +13063,12 @@ Demo.Slider = BI.inherit(BI.Widget, { var intervalSliderLabel = BI.createWidget({ type: "bi.interval_slider", width: o.width, - unit: "个", - cls: "layout-bg-white" + unit: "px", + cls: "layout-bg-white", + digit: 0, + validationChecker: function (v) { + return BI.isInteger(v); + } }); intervalSliderLabel.setMinAndMax({ min: 0, diff --git a/dist/widget.js b/dist/widget.js index d7b82fcea..377632cde 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -5632,7 +5632,10 @@ BI.IntervalSlider = BI.inherit(BI.Widget, { return BI.extend(BI.IntervalSlider.superclass._defaultConfig.apply(this, arguments), { baseCls: "bi-interval-slider bi-slider-track", digit: false, - unit: "" + unit: "", + validationChecker: function (v) { + return true; + } }) }, @@ -5909,7 +5912,7 @@ BI.IntervalSlider = BI.inherit(BI.Widget, { }, _checkValidation: function (v) { - return BI.isNumeric(v) && !(BI.isNull(v) || v < this.min || v > this.max) + return this.options.validationChecker(v) && (BI.isNumeric(v) && !(BI.isNull(v) || v < this.min || v > this.max)); }, _checkOverlap: function () { @@ -17496,6 +17499,7 @@ BI.SignTextEditor = BI.inherit(BI.Widget, { } }); BI.SignTextEditor.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.SignTextEditor.EVENT_CLICK_LABEL = "EVENT_CLICK_LABEL"; BI.shortcut("bi.sign_text_editor", BI.SignTextEditor);/** * Created by zcf on 2016/9/22. diff --git a/src/widget/intervalslider/intervalslider.js b/src/widget/intervalslider/intervalslider.js index a972f4803..70d8b86d6 100644 --- a/src/widget/intervalslider/intervalslider.js +++ b/src/widget/intervalslider/intervalslider.js @@ -16,7 +16,10 @@ BI.IntervalSlider = BI.inherit(BI.Widget, { return BI.extend(BI.IntervalSlider.superclass._defaultConfig.apply(this, arguments), { baseCls: "bi-interval-slider bi-slider-track", digit: false, - unit: "" + unit: "", + validationChecker: function (v) { + return true; + } }) }, @@ -293,7 +296,7 @@ BI.IntervalSlider = BI.inherit(BI.Widget, { }, _checkValidation: function (v) { - return BI.isNumeric(v) && !(BI.isNull(v) || v < this.min || v > this.max) + return this.options.validationChecker(v) && (BI.isNumeric(v) && !(BI.isNull(v) || v < this.min || v > this.max)); }, _checkOverlap: function () { diff --git a/src/widget/singleslider/button/editor.sign.text.js b/src/widget/singleslider/button/editor.sign.text.js index c58de71f0..ceef43810 100644 --- a/src/widget/singleslider/button/editor.sign.text.js +++ b/src/widget/singleslider/button/editor.sign.text.js @@ -200,5 +200,6 @@ BI.SignTextEditor = BI.inherit(BI.Widget, { } }); BI.SignTextEditor.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.SignTextEditor.EVENT_CLICK_LABEL = "EVENT_CLICK_LABEL"; BI.shortcut("bi.sign_text_editor", BI.SignTextEditor); \ No newline at end of file