From e340a242d862d595dc9ed2c8b5a88eb555c1df04 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Thu, 25 Jul 2019 09:26:22 +0800 Subject: [PATCH 1/8] =?UTF-8?q?REPORT-19888=20textareaeditor=E6=B0=B4?= =?UTF-8?q?=E5=8D=B0=E5=8F=AF=E6=8D=A2=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/editor/editor.textarea.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/single/editor/editor.textarea.js b/src/base/single/editor/editor.textarea.js index 9b51b63c70..0e66cf2837 100644 --- a/src/base/single/editor/editor.textarea.js +++ b/src/base/single/editor/editor.textarea.js @@ -83,7 +83,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, { type: "bi.text_button", cls: "bi-water-mark cursor-default", textAlign: "left", - height: 20, + whiteSpace: "normal", text: o.watermark, invalid: o.invalid, disabled: o.disabled From ab1ae0da1678c6a3029efd971d1063d012e98587 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Thu, 25 Jul 2019 10:51:47 +0800 Subject: [PATCH 2/8] =?UTF-8?q?BI-48579=20refactor:=20=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=BB=98=E8=AE=A4=E5=80=BC=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=E6=96=87=E6=9C=AC=E6=90=9E=E6=88=90=E6=B0=B4=E5=8D=B0?= =?UTF-8?q?=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/editor/editor.state.js | 16 ++++++++-------- src/case/editor/editor.state.simple.js | 14 +++++++------- src/case/trigger/trigger.icon.text.js | 10 ++++++++-- src/case/trigger/trigger.icon.text.select.js | 4 ++++ src/case/trigger/trigger.text.js | 10 ++++++++-- src/case/trigger/trigger.text.select.js | 18 ++++++++++++++---- 6 files changed, 49 insertions(+), 23 deletions(-) diff --git a/src/case/editor/editor.state.js b/src/case/editor/editor.state.js index 1de0de2624..7514e6ad9a 100644 --- a/src/case/editor/editor.state.js +++ b/src/case/editor/editor.state.js @@ -46,7 +46,7 @@ BI.StateEditor = BI.inherit(BI.Widget, { }); this.text = BI.createWidget({ type: "bi.text_button", - cls: "state-editor-infinite-text tip-text-style", + cls: "bi-water-mark tip-text-style", textAlign: "left", height: o.height, text: o.text, @@ -243,31 +243,31 @@ BI.StateEditor = BI.inherit(BI.Widget, { if (BI.isNumber(v)) { if (v === BI.Selection.All) { this.text.setText(BI.i18nText("BI-Select_All")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (v === BI.Selection.Multi) { this.text.setText(BI.i18nText("BI-Select_Part")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } return; } if (BI.isString(v)) { this.text.setText(v); - this.text.element.removeClass("state-editor-infinite-text"); + v === o.text ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark"); return; } if (BI.isArray(v)) { if (BI.isEmpty(v)) { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } else if (v.length === 1) { this.text.setText(v[0]); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(BI.i18nText("BI-Select_Part")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } } }, diff --git a/src/case/editor/editor.state.simple.js b/src/case/editor/editor.state.simple.js index 449e5e8bc6..c95b160a0b 100644 --- a/src/case/editor/editor.state.simple.js +++ b/src/case/editor/editor.state.simple.js @@ -47,7 +47,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, { }); this.text = BI.createWidget({ type: "bi.text_button", - cls: "state-editor-infinite-text", + cls: "bi-water-mark", textAlign: "left", text: o.text, height: o.height, @@ -229,26 +229,26 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, { if (BI.isNumber(v)) { if (v === BI.Selection.All) { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (v === BI.Selection.Multi) { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } return; } if (!BI.isArray(v) || v.length === 1) { this.text.setText(v); this.text.setTitle(v); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (BI.isEmpty(v)) { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } else { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } } }); diff --git a/src/case/trigger/trigger.icon.text.js b/src/case/trigger/trigger.icon.text.js index c4ea4c27d5..35005606c8 100644 --- a/src/case/trigger/trigger.icon.text.js +++ b/src/case/trigger/trigger.icon.text.js @@ -16,7 +16,8 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { baseCls: (conf.baseCls || "") + " bi-text-trigger", height: 24, iconHeight: null, - iconWidth: null + iconWidth: null, + textCls: "" }); }, @@ -25,7 +26,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options, c = this._const; this.text = BI.createWidget({ type: "bi.label", - cls: "select-text-label", + cls: "select-text-label" + (BI.isKey(o.textCls) ? (" " + o.textCls) : ""), textAlign: "left", height: o.height, text: o.text @@ -90,6 +91,11 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { } }, + setTextCls: function(cls) { + var o = this.options; + this.text.element.removeClass(o.textCls).addClass(cls); + }, + setText: function (text) { this.text.setText(text); } diff --git a/src/case/trigger/trigger.icon.text.select.js b/src/case/trigger/trigger.icon.text.select.js index 75d909ce52..752cde1c7f 100644 --- a/src/case/trigger/trigger.icon.text.select.js +++ b/src/case/trigger/trigger.icon.text.select.js @@ -22,6 +22,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { type: "bi.icon_text_trigger", element: this, text: obj.text, + textCls: obj.textCls, iconCls: obj.iconCls, height: o.height, iconHeight: o.iconHeight, @@ -48,11 +49,13 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { if (BI.isNotNull(result)) { return { text: result.text, + textCls: "", iconCls: result.iconCls }; } else { return { text: o.text, + textCls: "bi-water-mark", iconCls: o.iconCls }; } @@ -62,6 +65,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { var obj = this._digist(vals, this.options.items); this.trigger.setText(obj.text); this.trigger.setIcon(obj.iconCls); + this.trigger.setTextCls(obj.textCls); }, populate: function (items) { diff --git a/src/case/trigger/trigger.text.js b/src/case/trigger/trigger.text.js index 80bce8ec3a..80674c8152 100644 --- a/src/case/trigger/trigger.text.js +++ b/src/case/trigger/trigger.text.js @@ -14,7 +14,8 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { var conf = BI.TextTrigger.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { baseCls: (conf.baseCls || "") + " bi-text-trigger", - height: 24 + height: 24, + textCls: "" }); }, @@ -23,7 +24,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options, c = this._const; this.text = BI.createWidget({ type: "bi.label", - cls: "select-text-label", + cls: "select-text-label" + (BI.isKey(o.textCls) ? (" " + o.textCls) : ""), textAlign: "left", height: o.height, text: o.text, @@ -54,6 +55,11 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { }); }, + setTextCls: function(cls) { + var o = this.options; + this.text.element.removeClass(o.textCls).addClass(cls); + }, + setText: function (text) { this.text.setText(text); }, diff --git a/src/case/trigger/trigger.text.select.js b/src/case/trigger/trigger.text.select.js index a5eae5e932..4c6b519433 100644 --- a/src/case/trigger/trigger.text.select.js +++ b/src/case/trigger/trigger.text.select.js @@ -18,12 +18,14 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { this.options.height -= 2; BI.SelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; + var obj = this._digest(o.text, o.items); this.trigger = BI.createWidget({ type: "bi.text_trigger", element: this, height: o.height, readonly: o.readonly, - text: this._digest(o.value, o.items), + text: obj.text, + textCls: obj.textCls, tipType: o.tipType, warningTitle: o.warningTitle }); @@ -41,14 +43,22 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { }); if (result.length > 0) { - return result.join(","); + return { + textCls: "", + text: result.join(",") + } } else { - return BI.isFunction(o.text) ? o.text() : o.text; + return { + textCls: "bi-water-mark", + text: BI.isFunction(o.text) ? o.text() : o.text + } } }, setValue: function (vals) { - this.trigger.setText(this._digest(vals, this.options.items)); + var formatValue = this._digest(vals, this.options.items); + this.trigger.setTextCls(formatValue.textCls); + this.trigger.setText(formatValue.text); }, setTipType: function (v) { From 2e9563cc43695427c10e513b0871faad8b6944c0 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Thu, 25 Jul 2019 10:59:18 +0800 Subject: [PATCH 3/8] =?UTF-8?q?refactor:=20=E5=88=A0=E9=99=A4=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E6=8E=A7=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../combo.textvaluechecksmall.js | 67 ------------------- 1 file changed, 67 deletions(-) delete mode 100644 src/case/combo/textvaluecheckcombo/combo.textvaluechecksmall.js diff --git a/src/case/combo/textvaluecheckcombo/combo.textvaluechecksmall.js b/src/case/combo/textvaluecheckcombo/combo.textvaluechecksmall.js deleted file mode 100644 index 9ab74e048c..0000000000 --- a/src/case/combo/textvaluecheckcombo/combo.textvaluechecksmall.js +++ /dev/null @@ -1,67 +0,0 @@ -/** - * @class BI.SmallTextValueCheckCombo - * @extend BI.Widget - * combo : text + icon, popup : check + text - */ -BI.SmallTextValueCheckCombo = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.SmallTextValueCheckCombo.superclass._defaultConfig.apply(this, arguments), { - width: 100, - height: 24, - chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, - text: "" - }); - }, - - _init: function () { - BI.SmallTextValueCheckCombo.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.trigger = BI.createWidget({ - type: "bi.small_select_text_trigger", - items: o.items, - height: o.height, - text: o.text, - value: o.value - }); - this.popup = BI.createWidget({ - type: "bi.text_value_check_combo_popup", - chooseType: o.chooseType, - items: o.items, - value: o.value - }); - this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE, function () { - self.setValue(self.popup.getValue()); - self.SmallTextIconCheckCombo.hideView(); - self.fireEvent(BI.SmallTextValueCheckCombo.EVENT_CHANGE); - }); - this.popup.on(BI.Controller.EVENT_CHANGE, function () { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); - this.SmallTextIconCheckCombo = BI.createWidget({ - type: "bi.combo", - container: o.container, - element: this, - adjustLength: 2, - el: this.trigger, - popup: { - el: this.popup, - maxHeight: 300 - } - }); - }, - - setValue: function (v) { - this.SmallTextIconCheckCombo.setValue(v); - }, - - getValue: function () { - return this.popup.getValue(); - }, - - populate: function (items) { - this.options.items = items; - this.SmallTextIconCheckCombo.populate(items); - } -}); -BI.SmallTextValueCheckCombo.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.small_text_value_check_combo", BI.SmallTextValueCheckCombo); \ No newline at end of file From 414775c959a3161c656102618052ada4ae876f0a Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Thu, 25 Jul 2019 15:29:46 +0800 Subject: [PATCH 4/8] =?UTF-8?q?fix:=20=E6=A0=B9=E6=8D=AEcomment=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/trigger/trigger.icon.text.js | 1 + src/case/trigger/trigger.text.js | 1 + 2 files changed, 2 insertions(+) diff --git a/src/case/trigger/trigger.icon.text.js b/src/case/trigger/trigger.icon.text.js index 35005606c8..4721eefa4e 100644 --- a/src/case/trigger/trigger.icon.text.js +++ b/src/case/trigger/trigger.icon.text.js @@ -94,6 +94,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { setTextCls: function(cls) { var o = this.options; this.text.element.removeClass(o.textCls).addClass(cls); + o.textCls = cls; }, setText: function (text) { diff --git a/src/case/trigger/trigger.text.js b/src/case/trigger/trigger.text.js index 80674c8152..8d7ffb251f 100644 --- a/src/case/trigger/trigger.text.js +++ b/src/case/trigger/trigger.text.js @@ -58,6 +58,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { setTextCls: function(cls) { var o = this.options; this.text.element.removeClass(o.textCls).addClass(cls); + o.textCls = cls; }, setText: function (text) { From a258ba1cb2ca836ecbf74fdde84e1e40157ec1ba Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Thu, 25 Jul 2019 16:22:51 +0800 Subject: [PATCH 5/8] =?UTF-8?q?REPORT-19859=20fix:=20=E5=B9=B4=E6=9C=88?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E6=94=AF=E6=8C=81=E6=9C=80=E5=A4=A7=E6=9C=80?= =?UTF-8?q?=E5=B0=8F=E6=97=A5=E6=9C=9F=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/yearmonth/card.static.yearmonth.js | 27 ++++++++++++++++++- src/widget/yearmonth/combo.yearmonth.js | 12 ++++----- src/widget/yearmonth/trigger.yearmonth.js | 3 ++- 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/widget/yearmonth/card.static.yearmonth.js b/src/widget/yearmonth/card.static.yearmonth.js index 2f46a05c50..3b6c8bb713 100644 --- a/src/widget/yearmonth/card.static.yearmonth.js +++ b/src/widget/yearmonth/card.static.yearmonth.js @@ -6,6 +6,7 @@ BI.StaticYearMonthCard = BI.inherit(BI.Widget, { }, _createMonths: function () { + var self = this; // 纵向排列月 var month = [1, 7, 2, 8, 3, 9, 4, 10, 5, 11, 6, 12]; var items = []; @@ -27,7 +28,10 @@ BI.StaticYearMonthCard = BI.inherit(BI.Widget, { height: 23, width: 38, value: td, - text: td + text: td, + ref: function (_ref) { + self.monthMap[j === 0 ? i : i + 6] = _ref; + } }; }); }); @@ -35,10 +39,13 @@ BI.StaticYearMonthCard = BI.inherit(BI.Widget, { render: function () { var self = this, o = this.options; + this.monthMap = {}; return { type: "bi.vertical", items: [{ type: "bi.year_picker", + min: o.min, + max: o.max, ref: function () { self.yearPicker = this; }, @@ -48,6 +55,7 @@ BI.StaticYearMonthCard = BI.inherit(BI.Widget, { eventName: BI.YearPicker.EVENT_CHANGE, action: function () { var value = this.getValue(); + self._checkMonthStatus(value); self.setValue({ year: value, month: self.selectedMonth @@ -87,6 +95,23 @@ BI.StaticYearMonthCard = BI.inherit(BI.Widget, { }; }, + mounted: function() { + this._checkMonthStatus(this.selectedYear); + }, + + _checkMonthStatus: function (year) { + var o = this.options; + var minDate = BI.parseDateTime(o.min, "%Y-%X-%d"), maxDate = BI.parseDateTime(o.max, "%Y-%X-%d"); + var minYear = minDate.getFullYear(), maxYear = maxDate.getFullYear(); + var minMonth = 0; var maxMonth = 11; + minYear === year && (minMonth = minDate.getMonth()); + maxYear === year && (maxMonth = maxDate.getMonth()); + var yearInvalid = year < minYear || year > maxYear; + BI.each(this.monthMap, function (month, obj) { + var monthInvalid = month < minMonth || month > maxMonth; + obj.setEnable(!yearInvalid && !monthInvalid); + }); + }, getValue: function () { return { diff --git a/src/widget/yearmonth/combo.yearmonth.js b/src/widget/yearmonth/combo.yearmonth.js index 2abd8149a7..461fa7fb00 100644 --- a/src/widget/yearmonth/combo.yearmonth.js +++ b/src/widget/yearmonth/combo.yearmonth.js @@ -3,8 +3,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { props: { baseCls: "bi-year-month-combo bi-border bi-focus-shadow", behaviors: {}, - min: "1900-01-01", // 最小日期 - max: "2099-12-31", // 最大日期 + minDate: "1900-01-01", // 最小日期 + maxDate: "2099-12-31", // 最大日期 height: 22 }, @@ -15,8 +15,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { this.storeTriggerValue = ""; this.trigger = BI.createWidget({ type: "bi.dynamic_year_month_trigger", - min: o.min, - max: o.max, + min: o.minDate, + max: o.maxDate, height: o.height, value: o.value || "" }); @@ -100,8 +100,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { } }], behaviors: o.behaviors, - min: o.min, - max: o.max + min: o.minDate, + max: o.maxDate }, value: o.value || "" } diff --git a/src/widget/yearmonth/trigger.yearmonth.js b/src/widget/yearmonth/trigger.yearmonth.js index 3ba51864d9..1c062f7d56 100644 --- a/src/widget/yearmonth/trigger.yearmonth.js +++ b/src/widget/yearmonth/trigger.yearmonth.js @@ -62,12 +62,13 @@ BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, { _createEditor: function (isYear) { var self = this, o = this.options, c = this._const; + var minDate = BI.parseDateTime(o.min, "%Y-%X-%d"); var editor = BI.createWidget({ type: "bi.sign_editor", height: o.height, validationChecker: function (v) { if(isYear) { - return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]); + return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, v === minDate.getFullYear() ? minDate.getMonth() + 1 : 1, 1, o.min, o.max)[0]); } return v === "" || ((BI.isPositiveInteger(v) && v >= 1 && v <= 12) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]); }, From f43d9db54f5b77fc29c4c19713c9f8c9f2cfc2fd Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Thu, 25 Jul 2019 16:30:29 +0800 Subject: [PATCH 6/8] =?UTF-8?q?dist=E6=8F=90=E4=BA=A4=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/2.0/fineui.ie.js | 190 ++++++++++----------- dist/2.0/fineui.js | 190 ++++++++++----------- dist/base.js | 2 +- dist/bundle.ie.js | 190 ++++++++++----------- dist/bundle.js | 190 ++++++++++----------- dist/case.js | 142 ++++++--------- dist/core.js | 4 +- dist/fineui.ie.js | 190 ++++++++++----------- dist/fineui.js | 190 ++++++++++----------- dist/fineui_without_jquery_polyfill.js | 228 ++++++++++++++----------- dist/widget.js | 42 ++++- 11 files changed, 759 insertions(+), 799 deletions(-) diff --git a/dist/2.0/fineui.ie.js b/dist/2.0/fineui.ie.js index 66ebe5e51f..637b265515 100644 --- a/dist/2.0/fineui.ie.js +++ b/dist/2.0/fineui.ie.js @@ -32414,7 +32414,9 @@ $.extend($.Event.prototype, { py = BI.toUpperCase(py); } this.empty(); - while (true) { + // BI-48487 性能: makeFirstPY出来的py中包含多音字是必要的,但虽然此方法中做了限制。但是对于一个长度为60,包含14个多音字的字符串 + // 获取的的py长度将达到1966080, 远超过text的长度,到后面都是在做"".substring的无用功,所以此循环应保证py和textLeft长度不为0 + while (py.length > 0 && textLeft.length > 0) { var tidx = BI.toUpperCase(textLeft).indexOf(keyword); var pidx = null; if (py != null) { @@ -47272,7 +47274,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, { type: "bi.text_button", cls: "bi-water-mark cursor-default", textAlign: "left", - height: 20, + whiteSpace: "normal", text: o.watermark, invalid: o.invalid, disabled: o.disabled @@ -57022,73 +57024,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, { } }); BI.TextValueCheckCombo.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.text_value_check_combo", BI.TextValueCheckCombo);/** - * @class BI.SmallTextValueCheckCombo - * @extend BI.Widget - * combo : text + icon, popup : check + text - */ -BI.SmallTextValueCheckCombo = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.SmallTextValueCheckCombo.superclass._defaultConfig.apply(this, arguments), { - width: 100, - height: 24, - chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, - text: "" - }); - }, - - _init: function () { - BI.SmallTextValueCheckCombo.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.trigger = BI.createWidget({ - type: "bi.small_select_text_trigger", - items: o.items, - height: o.height, - text: o.text, - value: o.value - }); - this.popup = BI.createWidget({ - type: "bi.text_value_check_combo_popup", - chooseType: o.chooseType, - items: o.items, - value: o.value - }); - this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE, function () { - self.setValue(self.popup.getValue()); - self.SmallTextIconCheckCombo.hideView(); - self.fireEvent(BI.SmallTextValueCheckCombo.EVENT_CHANGE); - }); - this.popup.on(BI.Controller.EVENT_CHANGE, function () { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); - this.SmallTextIconCheckCombo = BI.createWidget({ - type: "bi.combo", - container: o.container, - element: this, - adjustLength: 2, - el: this.trigger, - popup: { - el: this.popup, - maxHeight: 300 - } - }); - }, - - setValue: function (v) { - this.SmallTextIconCheckCombo.setValue(v); - }, - - getValue: function () { - return this.popup.getValue(); - }, - - populate: function (items) { - this.options.items = items; - this.SmallTextIconCheckCombo.populate(items); - } -}); -BI.SmallTextValueCheckCombo.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.small_text_value_check_combo", BI.SmallTextValueCheckCombo);BI.TextValueCheckComboPopup = BI.inherit(BI.Pane, { +BI.shortcut("bi.text_value_check_combo", BI.TextValueCheckCombo);BI.TextValueCheckComboPopup = BI.inherit(BI.Pane, { _defaultConfig: function () { return BI.extend(BI.TextValueCheckComboPopup.superclass._defaultConfig.apply(this, arguments), { baseCls: "bi-text-icon-popup", @@ -58307,7 +58243,7 @@ BI.StateEditor = BI.inherit(BI.Widget, { }); this.text = BI.createWidget({ type: "bi.text_button", - cls: "state-editor-infinite-text tip-text-style", + cls: "bi-water-mark tip-text-style", textAlign: "left", height: o.height, text: o.text, @@ -58504,31 +58440,31 @@ BI.StateEditor = BI.inherit(BI.Widget, { if (BI.isNumber(v)) { if (v === BI.Selection.All) { this.text.setText(BI.i18nText("BI-Select_All")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (v === BI.Selection.Multi) { this.text.setText(BI.i18nText("BI-Select_Part")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } return; } if (BI.isString(v)) { this.text.setText(v); - this.text.element.removeClass("state-editor-infinite-text"); + v === o.text ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark"); return; } if (BI.isArray(v)) { if (BI.isEmpty(v)) { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } else if (v.length === 1) { this.text.setText(v[0]); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(BI.i18nText("BI-Select_Part")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } } }, @@ -58606,7 +58542,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, { }); this.text = BI.createWidget({ type: "bi.text_button", - cls: "state-editor-infinite-text", + cls: "bi-water-mark", textAlign: "left", text: o.text, height: o.height, @@ -58788,26 +58724,26 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, { if (BI.isNumber(v)) { if (v === BI.Selection.All) { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (v === BI.Selection.Multi) { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } return; } if (!BI.isArray(v) || v.length === 1) { this.text.setText(v); this.text.setTitle(v); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (BI.isEmpty(v)) { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } else { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } } }); @@ -61568,7 +61504,8 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { baseCls: (conf.baseCls || "") + " bi-text-trigger", height: 24, iconHeight: null, - iconWidth: null + iconWidth: null, + textCls: "" }); }, @@ -61577,7 +61514,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options, c = this._const; this.text = BI.createWidget({ type: "bi.label", - cls: "select-text-label", + cls: "select-text-label" + (BI.isKey(o.textCls) ? (" " + o.textCls) : ""), textAlign: "left", height: o.height, text: o.text @@ -61642,6 +61579,12 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { } }, + setTextCls: function(cls) { + var o = this.options; + this.text.element.removeClass(o.textCls).addClass(cls); + o.textCls = cls; + }, + setText: function (text) { this.text.setText(text); } @@ -61670,6 +61613,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { type: "bi.icon_text_trigger", element: this, text: obj.text, + textCls: obj.textCls, iconCls: obj.iconCls, height: o.height, iconHeight: o.iconHeight, @@ -61696,11 +61640,13 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { if (BI.isNotNull(result)) { return { text: result.text, + textCls: "", iconCls: result.iconCls }; } else { return { text: o.text, + textCls: "bi-water-mark", iconCls: o.iconCls }; } @@ -61710,6 +61656,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { var obj = this._digist(vals, this.options.items); this.trigger.setText(obj.text); this.trigger.setIcon(obj.iconCls); + this.trigger.setTextCls(obj.textCls); }, populate: function (items) { @@ -61732,7 +61679,8 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { var conf = BI.TextTrigger.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { baseCls: (conf.baseCls || "") + " bi-text-trigger", - height: 24 + height: 24, + textCls: "" }); }, @@ -61741,7 +61689,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options, c = this._const; this.text = BI.createWidget({ type: "bi.label", - cls: "select-text-label", + cls: "select-text-label" + (BI.isKey(o.textCls) ? (" " + o.textCls) : ""), textAlign: "left", height: o.height, text: o.text, @@ -61772,6 +61720,12 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { }); }, + setTextCls: function(cls) { + var o = this.options; + this.text.element.removeClass(o.textCls).addClass(cls); + o.textCls = cls; + }, + setText: function (text) { this.text.setText(text); }, @@ -61801,12 +61755,14 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { this.options.height -= 2; BI.SelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; + var obj = this._digest(o.text, o.items); this.trigger = BI.createWidget({ type: "bi.text_trigger", element: this, height: o.height, readonly: o.readonly, - text: this._digest(o.value, o.items), + text: obj.text, + textCls: obj.textCls, tipType: o.tipType, warningTitle: o.warningTitle }); @@ -61824,14 +61780,22 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { }); if (result.length > 0) { - return result.join(","); + return { + textCls: "", + text: result.join(",") + } } else { - return BI.isFunction(o.text) ? o.text() : o.text; + return { + textCls: "bi-water-mark", + text: BI.isFunction(o.text) ? o.text() : o.text + } } }, setValue: function (vals) { - this.trigger.setText(this._digest(vals, this.options.items)); + var formatValue = this._digest(vals, this.options.items); + this.trigger.setTextCls(formatValue.textCls); + this.trigger.setText(formatValue.text); }, setTipType: function (v) { @@ -85018,6 +84982,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear }, _createMonths: function () { + var self = this; // 纵向排列月 var month = [1, 7, 2, 8, 3, 9, 4, 10, 5, 11, 6, 12]; var items = []; @@ -85039,7 +85004,10 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear height: 23, width: 38, value: td, - text: td + text: td, + ref: function (_ref) { + self.monthMap[j === 0 ? i : i + 6] = _ref; + } }; }); }); @@ -85047,10 +85015,13 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear render: function () { var self = this, o = this.options; + this.monthMap = {}; return { type: "bi.vertical", items: [{ type: "bi.year_picker", + min: o.min, + max: o.max, ref: function () { self.yearPicker = this; }, @@ -85060,6 +85031,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear eventName: BI.YearPicker.EVENT_CHANGE, action: function () { var value = this.getValue(); + self._checkMonthStatus(value); self.setValue({ year: value, month: self.selectedMonth @@ -85099,6 +85071,23 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear }; }, + mounted: function() { + this._checkMonthStatus(this.selectedYear); + }, + + _checkMonthStatus: function (year) { + var o = this.options; + var minDate = BI.parseDateTime(o.min, "%Y-%X-%d"), maxDate = BI.parseDateTime(o.max, "%Y-%X-%d"); + var minYear = minDate.getFullYear(), maxYear = maxDate.getFullYear(); + var minMonth = 0; var maxMonth = 11; + minYear === year && (minMonth = minDate.getMonth()); + maxYear === year && (maxMonth = maxDate.getMonth()); + var yearInvalid = year < minYear || year > maxYear; + BI.each(this.monthMap, function (month, obj) { + var monthInvalid = month < minMonth || month > maxMonth; + obj.setEnable(!yearInvalid && !monthInvalid); + }); + }, getValue: function () { return { @@ -85133,8 +85122,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { props: { baseCls: "bi-year-month-combo bi-border bi-focus-shadow", behaviors: {}, - min: "1900-01-01", // 最小日期 - max: "2099-12-31", // 最大日期 + minDate: "1900-01-01", // 最小日期 + maxDate: "2099-12-31", // 最大日期 height: 22 }, @@ -85145,8 +85134,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { this.storeTriggerValue = ""; this.trigger = BI.createWidget({ type: "bi.dynamic_year_month_trigger", - min: o.min, - max: o.max, + min: o.minDate, + max: o.maxDate, height: o.height, value: o.value || "" }); @@ -85230,8 +85219,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { } }], behaviors: o.behaviors, - min: o.min, - max: o.max + min: o.minDate, + max: o.maxDate }, value: o.value || "" } @@ -85585,12 +85574,13 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY _createEditor: function (isYear) { var self = this, o = this.options, c = this._const; + var minDate = BI.parseDateTime(o.min, "%Y-%X-%d"); var editor = BI.createWidget({ type: "bi.sign_editor", height: o.height, validationChecker: function (v) { if(isYear) { - return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]); + return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, v === minDate.getFullYear() ? minDate.getMonth() + 1 : 1, 1, o.min, o.max)[0]); } return v === "" || ((BI.isPositiveInteger(v) && v >= 1 && v <= 12) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]); }, diff --git a/dist/2.0/fineui.js b/dist/2.0/fineui.js index f1b910b431..5789702206 100644 --- a/dist/2.0/fineui.js +++ b/dist/2.0/fineui.js @@ -32414,7 +32414,9 @@ $.extend($.Event.prototype, { py = BI.toUpperCase(py); } this.empty(); - while (true) { + // BI-48487 性能: makeFirstPY出来的py中包含多音字是必要的,但虽然此方法中做了限制。但是对于一个长度为60,包含14个多音字的字符串 + // 获取的的py长度将达到1966080, 远超过text的长度,到后面都是在做"".substring的无用功,所以此循环应保证py和textLeft长度不为0 + while (py.length > 0 && textLeft.length > 0) { var tidx = BI.toUpperCase(textLeft).indexOf(keyword); var pidx = null; if (py != null) { @@ -47676,7 +47678,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, { type: "bi.text_button", cls: "bi-water-mark cursor-default", textAlign: "left", - height: 20, + whiteSpace: "normal", text: o.watermark, invalid: o.invalid, disabled: o.disabled @@ -57426,73 +57428,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, { } }); BI.TextValueCheckCombo.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.text_value_check_combo", BI.TextValueCheckCombo);/** - * @class BI.SmallTextValueCheckCombo - * @extend BI.Widget - * combo : text + icon, popup : check + text - */ -BI.SmallTextValueCheckCombo = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.SmallTextValueCheckCombo.superclass._defaultConfig.apply(this, arguments), { - width: 100, - height: 24, - chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, - text: "" - }); - }, - - _init: function () { - BI.SmallTextValueCheckCombo.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.trigger = BI.createWidget({ - type: "bi.small_select_text_trigger", - items: o.items, - height: o.height, - text: o.text, - value: o.value - }); - this.popup = BI.createWidget({ - type: "bi.text_value_check_combo_popup", - chooseType: o.chooseType, - items: o.items, - value: o.value - }); - this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE, function () { - self.setValue(self.popup.getValue()); - self.SmallTextIconCheckCombo.hideView(); - self.fireEvent(BI.SmallTextValueCheckCombo.EVENT_CHANGE); - }); - this.popup.on(BI.Controller.EVENT_CHANGE, function () { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); - this.SmallTextIconCheckCombo = BI.createWidget({ - type: "bi.combo", - container: o.container, - element: this, - adjustLength: 2, - el: this.trigger, - popup: { - el: this.popup, - maxHeight: 300 - } - }); - }, - - setValue: function (v) { - this.SmallTextIconCheckCombo.setValue(v); - }, - - getValue: function () { - return this.popup.getValue(); - }, - - populate: function (items) { - this.options.items = items; - this.SmallTextIconCheckCombo.populate(items); - } -}); -BI.SmallTextValueCheckCombo.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.small_text_value_check_combo", BI.SmallTextValueCheckCombo);BI.TextValueCheckComboPopup = BI.inherit(BI.Pane, { +BI.shortcut("bi.text_value_check_combo", BI.TextValueCheckCombo);BI.TextValueCheckComboPopup = BI.inherit(BI.Pane, { _defaultConfig: function () { return BI.extend(BI.TextValueCheckComboPopup.superclass._defaultConfig.apply(this, arguments), { baseCls: "bi-text-icon-popup", @@ -58711,7 +58647,7 @@ BI.StateEditor = BI.inherit(BI.Widget, { }); this.text = BI.createWidget({ type: "bi.text_button", - cls: "state-editor-infinite-text tip-text-style", + cls: "bi-water-mark tip-text-style", textAlign: "left", height: o.height, text: o.text, @@ -58908,31 +58844,31 @@ BI.StateEditor = BI.inherit(BI.Widget, { if (BI.isNumber(v)) { if (v === BI.Selection.All) { this.text.setText(BI.i18nText("BI-Select_All")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (v === BI.Selection.Multi) { this.text.setText(BI.i18nText("BI-Select_Part")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } return; } if (BI.isString(v)) { this.text.setText(v); - this.text.element.removeClass("state-editor-infinite-text"); + v === o.text ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark"); return; } if (BI.isArray(v)) { if (BI.isEmpty(v)) { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } else if (v.length === 1) { this.text.setText(v[0]); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(BI.i18nText("BI-Select_Part")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } } }, @@ -59010,7 +58946,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, { }); this.text = BI.createWidget({ type: "bi.text_button", - cls: "state-editor-infinite-text", + cls: "bi-water-mark", textAlign: "left", text: o.text, height: o.height, @@ -59192,26 +59128,26 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, { if (BI.isNumber(v)) { if (v === BI.Selection.All) { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (v === BI.Selection.Multi) { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } return; } if (!BI.isArray(v) || v.length === 1) { this.text.setText(v); this.text.setTitle(v); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (BI.isEmpty(v)) { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } else { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } } }); @@ -61972,7 +61908,8 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { baseCls: (conf.baseCls || "") + " bi-text-trigger", height: 24, iconHeight: null, - iconWidth: null + iconWidth: null, + textCls: "" }); }, @@ -61981,7 +61918,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options, c = this._const; this.text = BI.createWidget({ type: "bi.label", - cls: "select-text-label", + cls: "select-text-label" + (BI.isKey(o.textCls) ? (" " + o.textCls) : ""), textAlign: "left", height: o.height, text: o.text @@ -62046,6 +61983,12 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { } }, + setTextCls: function(cls) { + var o = this.options; + this.text.element.removeClass(o.textCls).addClass(cls); + o.textCls = cls; + }, + setText: function (text) { this.text.setText(text); } @@ -62074,6 +62017,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { type: "bi.icon_text_trigger", element: this, text: obj.text, + textCls: obj.textCls, iconCls: obj.iconCls, height: o.height, iconHeight: o.iconHeight, @@ -62100,11 +62044,13 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { if (BI.isNotNull(result)) { return { text: result.text, + textCls: "", iconCls: result.iconCls }; } else { return { text: o.text, + textCls: "bi-water-mark", iconCls: o.iconCls }; } @@ -62114,6 +62060,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { var obj = this._digist(vals, this.options.items); this.trigger.setText(obj.text); this.trigger.setIcon(obj.iconCls); + this.trigger.setTextCls(obj.textCls); }, populate: function (items) { @@ -62136,7 +62083,8 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { var conf = BI.TextTrigger.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { baseCls: (conf.baseCls || "") + " bi-text-trigger", - height: 24 + height: 24, + textCls: "" }); }, @@ -62145,7 +62093,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options, c = this._const; this.text = BI.createWidget({ type: "bi.label", - cls: "select-text-label", + cls: "select-text-label" + (BI.isKey(o.textCls) ? (" " + o.textCls) : ""), textAlign: "left", height: o.height, text: o.text, @@ -62176,6 +62124,12 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { }); }, + setTextCls: function(cls) { + var o = this.options; + this.text.element.removeClass(o.textCls).addClass(cls); + o.textCls = cls; + }, + setText: function (text) { this.text.setText(text); }, @@ -62205,12 +62159,14 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { this.options.height -= 2; BI.SelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; + var obj = this._digest(o.text, o.items); this.trigger = BI.createWidget({ type: "bi.text_trigger", element: this, height: o.height, readonly: o.readonly, - text: this._digest(o.value, o.items), + text: obj.text, + textCls: obj.textCls, tipType: o.tipType, warningTitle: o.warningTitle }); @@ -62228,14 +62184,22 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { }); if (result.length > 0) { - return result.join(","); + return { + textCls: "", + text: result.join(",") + } } else { - return BI.isFunction(o.text) ? o.text() : o.text; + return { + textCls: "bi-water-mark", + text: BI.isFunction(o.text) ? o.text() : o.text + } } }, setValue: function (vals) { - this.trigger.setText(this._digest(vals, this.options.items)); + var formatValue = this._digest(vals, this.options.items); + this.trigger.setTextCls(formatValue.textCls); + this.trigger.setText(formatValue.text); }, setTipType: function (v) { @@ -85422,6 +85386,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear }, _createMonths: function () { + var self = this; // 纵向排列月 var month = [1, 7, 2, 8, 3, 9, 4, 10, 5, 11, 6, 12]; var items = []; @@ -85443,7 +85408,10 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear height: 23, width: 38, value: td, - text: td + text: td, + ref: function (_ref) { + self.monthMap[j === 0 ? i : i + 6] = _ref; + } }; }); }); @@ -85451,10 +85419,13 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear render: function () { var self = this, o = this.options; + this.monthMap = {}; return { type: "bi.vertical", items: [{ type: "bi.year_picker", + min: o.min, + max: o.max, ref: function () { self.yearPicker = this; }, @@ -85464,6 +85435,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear eventName: BI.YearPicker.EVENT_CHANGE, action: function () { var value = this.getValue(); + self._checkMonthStatus(value); self.setValue({ year: value, month: self.selectedMonth @@ -85503,6 +85475,23 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear }; }, + mounted: function() { + this._checkMonthStatus(this.selectedYear); + }, + + _checkMonthStatus: function (year) { + var o = this.options; + var minDate = BI.parseDateTime(o.min, "%Y-%X-%d"), maxDate = BI.parseDateTime(o.max, "%Y-%X-%d"); + var minYear = minDate.getFullYear(), maxYear = maxDate.getFullYear(); + var minMonth = 0; var maxMonth = 11; + minYear === year && (minMonth = minDate.getMonth()); + maxYear === year && (maxMonth = maxDate.getMonth()); + var yearInvalid = year < minYear || year > maxYear; + BI.each(this.monthMap, function (month, obj) { + var monthInvalid = month < minMonth || month > maxMonth; + obj.setEnable(!yearInvalid && !monthInvalid); + }); + }, getValue: function () { return { @@ -85537,8 +85526,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { props: { baseCls: "bi-year-month-combo bi-border bi-focus-shadow", behaviors: {}, - min: "1900-01-01", // 最小日期 - max: "2099-12-31", // 最大日期 + minDate: "1900-01-01", // 最小日期 + maxDate: "2099-12-31", // 最大日期 height: 22 }, @@ -85549,8 +85538,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { this.storeTriggerValue = ""; this.trigger = BI.createWidget({ type: "bi.dynamic_year_month_trigger", - min: o.min, - max: o.max, + min: o.minDate, + max: o.maxDate, height: o.height, value: o.value || "" }); @@ -85634,8 +85623,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { } }], behaviors: o.behaviors, - min: o.min, - max: o.max + min: o.minDate, + max: o.maxDate }, value: o.value || "" } @@ -85989,12 +85978,13 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY _createEditor: function (isYear) { var self = this, o = this.options, c = this._const; + var minDate = BI.parseDateTime(o.min, "%Y-%X-%d"); var editor = BI.createWidget({ type: "bi.sign_editor", height: o.height, validationChecker: function (v) { if(isYear) { - return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]); + return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, v === minDate.getFullYear() ? minDate.getMonth() + 1 : 1, 1, o.min, o.max)[0]); } return v === "" || ((BI.isPositiveInteger(v) && v >= 1 && v <= 12) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]); }, diff --git a/dist/base.js b/dist/base.js index 6a93ee117c..ee6761a36f 100644 --- a/dist/base.js +++ b/dist/base.js @@ -9412,7 +9412,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, { type: "bi.text_button", cls: "bi-water-mark cursor-default", textAlign: "left", - height: 20, + whiteSpace: "normal", text: o.watermark, invalid: o.invalid, disabled: o.disabled diff --git a/dist/bundle.ie.js b/dist/bundle.ie.js index 66ebe5e51f..637b265515 100644 --- a/dist/bundle.ie.js +++ b/dist/bundle.ie.js @@ -32414,7 +32414,9 @@ $.extend($.Event.prototype, { py = BI.toUpperCase(py); } this.empty(); - while (true) { + // BI-48487 性能: makeFirstPY出来的py中包含多音字是必要的,但虽然此方法中做了限制。但是对于一个长度为60,包含14个多音字的字符串 + // 获取的的py长度将达到1966080, 远超过text的长度,到后面都是在做"".substring的无用功,所以此循环应保证py和textLeft长度不为0 + while (py.length > 0 && textLeft.length > 0) { var tidx = BI.toUpperCase(textLeft).indexOf(keyword); var pidx = null; if (py != null) { @@ -47272,7 +47274,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, { type: "bi.text_button", cls: "bi-water-mark cursor-default", textAlign: "left", - height: 20, + whiteSpace: "normal", text: o.watermark, invalid: o.invalid, disabled: o.disabled @@ -57022,73 +57024,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, { } }); BI.TextValueCheckCombo.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.text_value_check_combo", BI.TextValueCheckCombo);/** - * @class BI.SmallTextValueCheckCombo - * @extend BI.Widget - * combo : text + icon, popup : check + text - */ -BI.SmallTextValueCheckCombo = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.SmallTextValueCheckCombo.superclass._defaultConfig.apply(this, arguments), { - width: 100, - height: 24, - chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, - text: "" - }); - }, - - _init: function () { - BI.SmallTextValueCheckCombo.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.trigger = BI.createWidget({ - type: "bi.small_select_text_trigger", - items: o.items, - height: o.height, - text: o.text, - value: o.value - }); - this.popup = BI.createWidget({ - type: "bi.text_value_check_combo_popup", - chooseType: o.chooseType, - items: o.items, - value: o.value - }); - this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE, function () { - self.setValue(self.popup.getValue()); - self.SmallTextIconCheckCombo.hideView(); - self.fireEvent(BI.SmallTextValueCheckCombo.EVENT_CHANGE); - }); - this.popup.on(BI.Controller.EVENT_CHANGE, function () { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); - this.SmallTextIconCheckCombo = BI.createWidget({ - type: "bi.combo", - container: o.container, - element: this, - adjustLength: 2, - el: this.trigger, - popup: { - el: this.popup, - maxHeight: 300 - } - }); - }, - - setValue: function (v) { - this.SmallTextIconCheckCombo.setValue(v); - }, - - getValue: function () { - return this.popup.getValue(); - }, - - populate: function (items) { - this.options.items = items; - this.SmallTextIconCheckCombo.populate(items); - } -}); -BI.SmallTextValueCheckCombo.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.small_text_value_check_combo", BI.SmallTextValueCheckCombo);BI.TextValueCheckComboPopup = BI.inherit(BI.Pane, { +BI.shortcut("bi.text_value_check_combo", BI.TextValueCheckCombo);BI.TextValueCheckComboPopup = BI.inherit(BI.Pane, { _defaultConfig: function () { return BI.extend(BI.TextValueCheckComboPopup.superclass._defaultConfig.apply(this, arguments), { baseCls: "bi-text-icon-popup", @@ -58307,7 +58243,7 @@ BI.StateEditor = BI.inherit(BI.Widget, { }); this.text = BI.createWidget({ type: "bi.text_button", - cls: "state-editor-infinite-text tip-text-style", + cls: "bi-water-mark tip-text-style", textAlign: "left", height: o.height, text: o.text, @@ -58504,31 +58440,31 @@ BI.StateEditor = BI.inherit(BI.Widget, { if (BI.isNumber(v)) { if (v === BI.Selection.All) { this.text.setText(BI.i18nText("BI-Select_All")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (v === BI.Selection.Multi) { this.text.setText(BI.i18nText("BI-Select_Part")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } return; } if (BI.isString(v)) { this.text.setText(v); - this.text.element.removeClass("state-editor-infinite-text"); + v === o.text ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark"); return; } if (BI.isArray(v)) { if (BI.isEmpty(v)) { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } else if (v.length === 1) { this.text.setText(v[0]); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(BI.i18nText("BI-Select_Part")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } } }, @@ -58606,7 +58542,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, { }); this.text = BI.createWidget({ type: "bi.text_button", - cls: "state-editor-infinite-text", + cls: "bi-water-mark", textAlign: "left", text: o.text, height: o.height, @@ -58788,26 +58724,26 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, { if (BI.isNumber(v)) { if (v === BI.Selection.All) { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (v === BI.Selection.Multi) { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } return; } if (!BI.isArray(v) || v.length === 1) { this.text.setText(v); this.text.setTitle(v); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (BI.isEmpty(v)) { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } else { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } } }); @@ -61568,7 +61504,8 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { baseCls: (conf.baseCls || "") + " bi-text-trigger", height: 24, iconHeight: null, - iconWidth: null + iconWidth: null, + textCls: "" }); }, @@ -61577,7 +61514,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options, c = this._const; this.text = BI.createWidget({ type: "bi.label", - cls: "select-text-label", + cls: "select-text-label" + (BI.isKey(o.textCls) ? (" " + o.textCls) : ""), textAlign: "left", height: o.height, text: o.text @@ -61642,6 +61579,12 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { } }, + setTextCls: function(cls) { + var o = this.options; + this.text.element.removeClass(o.textCls).addClass(cls); + o.textCls = cls; + }, + setText: function (text) { this.text.setText(text); } @@ -61670,6 +61613,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { type: "bi.icon_text_trigger", element: this, text: obj.text, + textCls: obj.textCls, iconCls: obj.iconCls, height: o.height, iconHeight: o.iconHeight, @@ -61696,11 +61640,13 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { if (BI.isNotNull(result)) { return { text: result.text, + textCls: "", iconCls: result.iconCls }; } else { return { text: o.text, + textCls: "bi-water-mark", iconCls: o.iconCls }; } @@ -61710,6 +61656,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { var obj = this._digist(vals, this.options.items); this.trigger.setText(obj.text); this.trigger.setIcon(obj.iconCls); + this.trigger.setTextCls(obj.textCls); }, populate: function (items) { @@ -61732,7 +61679,8 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { var conf = BI.TextTrigger.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { baseCls: (conf.baseCls || "") + " bi-text-trigger", - height: 24 + height: 24, + textCls: "" }); }, @@ -61741,7 +61689,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options, c = this._const; this.text = BI.createWidget({ type: "bi.label", - cls: "select-text-label", + cls: "select-text-label" + (BI.isKey(o.textCls) ? (" " + o.textCls) : ""), textAlign: "left", height: o.height, text: o.text, @@ -61772,6 +61720,12 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { }); }, + setTextCls: function(cls) { + var o = this.options; + this.text.element.removeClass(o.textCls).addClass(cls); + o.textCls = cls; + }, + setText: function (text) { this.text.setText(text); }, @@ -61801,12 +61755,14 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { this.options.height -= 2; BI.SelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; + var obj = this._digest(o.text, o.items); this.trigger = BI.createWidget({ type: "bi.text_trigger", element: this, height: o.height, readonly: o.readonly, - text: this._digest(o.value, o.items), + text: obj.text, + textCls: obj.textCls, tipType: o.tipType, warningTitle: o.warningTitle }); @@ -61824,14 +61780,22 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { }); if (result.length > 0) { - return result.join(","); + return { + textCls: "", + text: result.join(",") + } } else { - return BI.isFunction(o.text) ? o.text() : o.text; + return { + textCls: "bi-water-mark", + text: BI.isFunction(o.text) ? o.text() : o.text + } } }, setValue: function (vals) { - this.trigger.setText(this._digest(vals, this.options.items)); + var formatValue = this._digest(vals, this.options.items); + this.trigger.setTextCls(formatValue.textCls); + this.trigger.setText(formatValue.text); }, setTipType: function (v) { @@ -85018,6 +84982,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear }, _createMonths: function () { + var self = this; // 纵向排列月 var month = [1, 7, 2, 8, 3, 9, 4, 10, 5, 11, 6, 12]; var items = []; @@ -85039,7 +85004,10 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear height: 23, width: 38, value: td, - text: td + text: td, + ref: function (_ref) { + self.monthMap[j === 0 ? i : i + 6] = _ref; + } }; }); }); @@ -85047,10 +85015,13 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear render: function () { var self = this, o = this.options; + this.monthMap = {}; return { type: "bi.vertical", items: [{ type: "bi.year_picker", + min: o.min, + max: o.max, ref: function () { self.yearPicker = this; }, @@ -85060,6 +85031,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear eventName: BI.YearPicker.EVENT_CHANGE, action: function () { var value = this.getValue(); + self._checkMonthStatus(value); self.setValue({ year: value, month: self.selectedMonth @@ -85099,6 +85071,23 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear }; }, + mounted: function() { + this._checkMonthStatus(this.selectedYear); + }, + + _checkMonthStatus: function (year) { + var o = this.options; + var minDate = BI.parseDateTime(o.min, "%Y-%X-%d"), maxDate = BI.parseDateTime(o.max, "%Y-%X-%d"); + var minYear = minDate.getFullYear(), maxYear = maxDate.getFullYear(); + var minMonth = 0; var maxMonth = 11; + minYear === year && (minMonth = minDate.getMonth()); + maxYear === year && (maxMonth = maxDate.getMonth()); + var yearInvalid = year < minYear || year > maxYear; + BI.each(this.monthMap, function (month, obj) { + var monthInvalid = month < minMonth || month > maxMonth; + obj.setEnable(!yearInvalid && !monthInvalid); + }); + }, getValue: function () { return { @@ -85133,8 +85122,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { props: { baseCls: "bi-year-month-combo bi-border bi-focus-shadow", behaviors: {}, - min: "1900-01-01", // 最小日期 - max: "2099-12-31", // 最大日期 + minDate: "1900-01-01", // 最小日期 + maxDate: "2099-12-31", // 最大日期 height: 22 }, @@ -85145,8 +85134,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { this.storeTriggerValue = ""; this.trigger = BI.createWidget({ type: "bi.dynamic_year_month_trigger", - min: o.min, - max: o.max, + min: o.minDate, + max: o.maxDate, height: o.height, value: o.value || "" }); @@ -85230,8 +85219,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { } }], behaviors: o.behaviors, - min: o.min, - max: o.max + min: o.minDate, + max: o.maxDate }, value: o.value || "" } @@ -85585,12 +85574,13 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY _createEditor: function (isYear) { var self = this, o = this.options, c = this._const; + var minDate = BI.parseDateTime(o.min, "%Y-%X-%d"); var editor = BI.createWidget({ type: "bi.sign_editor", height: o.height, validationChecker: function (v) { if(isYear) { - return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]); + return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, v === minDate.getFullYear() ? minDate.getMonth() + 1 : 1, 1, o.min, o.max)[0]); } return v === "" || ((BI.isPositiveInteger(v) && v >= 1 && v <= 12) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]); }, diff --git a/dist/bundle.js b/dist/bundle.js index f1b910b431..5789702206 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -32414,7 +32414,9 @@ $.extend($.Event.prototype, { py = BI.toUpperCase(py); } this.empty(); - while (true) { + // BI-48487 性能: makeFirstPY出来的py中包含多音字是必要的,但虽然此方法中做了限制。但是对于一个长度为60,包含14个多音字的字符串 + // 获取的的py长度将达到1966080, 远超过text的长度,到后面都是在做"".substring的无用功,所以此循环应保证py和textLeft长度不为0 + while (py.length > 0 && textLeft.length > 0) { var tidx = BI.toUpperCase(textLeft).indexOf(keyword); var pidx = null; if (py != null) { @@ -47676,7 +47678,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, { type: "bi.text_button", cls: "bi-water-mark cursor-default", textAlign: "left", - height: 20, + whiteSpace: "normal", text: o.watermark, invalid: o.invalid, disabled: o.disabled @@ -57426,73 +57428,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, { } }); BI.TextValueCheckCombo.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.text_value_check_combo", BI.TextValueCheckCombo);/** - * @class BI.SmallTextValueCheckCombo - * @extend BI.Widget - * combo : text + icon, popup : check + text - */ -BI.SmallTextValueCheckCombo = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.SmallTextValueCheckCombo.superclass._defaultConfig.apply(this, arguments), { - width: 100, - height: 24, - chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, - text: "" - }); - }, - - _init: function () { - BI.SmallTextValueCheckCombo.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.trigger = BI.createWidget({ - type: "bi.small_select_text_trigger", - items: o.items, - height: o.height, - text: o.text, - value: o.value - }); - this.popup = BI.createWidget({ - type: "bi.text_value_check_combo_popup", - chooseType: o.chooseType, - items: o.items, - value: o.value - }); - this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE, function () { - self.setValue(self.popup.getValue()); - self.SmallTextIconCheckCombo.hideView(); - self.fireEvent(BI.SmallTextValueCheckCombo.EVENT_CHANGE); - }); - this.popup.on(BI.Controller.EVENT_CHANGE, function () { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); - this.SmallTextIconCheckCombo = BI.createWidget({ - type: "bi.combo", - container: o.container, - element: this, - adjustLength: 2, - el: this.trigger, - popup: { - el: this.popup, - maxHeight: 300 - } - }); - }, - - setValue: function (v) { - this.SmallTextIconCheckCombo.setValue(v); - }, - - getValue: function () { - return this.popup.getValue(); - }, - - populate: function (items) { - this.options.items = items; - this.SmallTextIconCheckCombo.populate(items); - } -}); -BI.SmallTextValueCheckCombo.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.small_text_value_check_combo", BI.SmallTextValueCheckCombo);BI.TextValueCheckComboPopup = BI.inherit(BI.Pane, { +BI.shortcut("bi.text_value_check_combo", BI.TextValueCheckCombo);BI.TextValueCheckComboPopup = BI.inherit(BI.Pane, { _defaultConfig: function () { return BI.extend(BI.TextValueCheckComboPopup.superclass._defaultConfig.apply(this, arguments), { baseCls: "bi-text-icon-popup", @@ -58711,7 +58647,7 @@ BI.StateEditor = BI.inherit(BI.Widget, { }); this.text = BI.createWidget({ type: "bi.text_button", - cls: "state-editor-infinite-text tip-text-style", + cls: "bi-water-mark tip-text-style", textAlign: "left", height: o.height, text: o.text, @@ -58908,31 +58844,31 @@ BI.StateEditor = BI.inherit(BI.Widget, { if (BI.isNumber(v)) { if (v === BI.Selection.All) { this.text.setText(BI.i18nText("BI-Select_All")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (v === BI.Selection.Multi) { this.text.setText(BI.i18nText("BI-Select_Part")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } return; } if (BI.isString(v)) { this.text.setText(v); - this.text.element.removeClass("state-editor-infinite-text"); + v === o.text ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark"); return; } if (BI.isArray(v)) { if (BI.isEmpty(v)) { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } else if (v.length === 1) { this.text.setText(v[0]); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(BI.i18nText("BI-Select_Part")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } } }, @@ -59010,7 +58946,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, { }); this.text = BI.createWidget({ type: "bi.text_button", - cls: "state-editor-infinite-text", + cls: "bi-water-mark", textAlign: "left", text: o.text, height: o.height, @@ -59192,26 +59128,26 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, { if (BI.isNumber(v)) { if (v === BI.Selection.All) { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (v === BI.Selection.Multi) { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } return; } if (!BI.isArray(v) || v.length === 1) { this.text.setText(v); this.text.setTitle(v); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (BI.isEmpty(v)) { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } else { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } } }); @@ -61972,7 +61908,8 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { baseCls: (conf.baseCls || "") + " bi-text-trigger", height: 24, iconHeight: null, - iconWidth: null + iconWidth: null, + textCls: "" }); }, @@ -61981,7 +61918,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options, c = this._const; this.text = BI.createWidget({ type: "bi.label", - cls: "select-text-label", + cls: "select-text-label" + (BI.isKey(o.textCls) ? (" " + o.textCls) : ""), textAlign: "left", height: o.height, text: o.text @@ -62046,6 +61983,12 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { } }, + setTextCls: function(cls) { + var o = this.options; + this.text.element.removeClass(o.textCls).addClass(cls); + o.textCls = cls; + }, + setText: function (text) { this.text.setText(text); } @@ -62074,6 +62017,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { type: "bi.icon_text_trigger", element: this, text: obj.text, + textCls: obj.textCls, iconCls: obj.iconCls, height: o.height, iconHeight: o.iconHeight, @@ -62100,11 +62044,13 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { if (BI.isNotNull(result)) { return { text: result.text, + textCls: "", iconCls: result.iconCls }; } else { return { text: o.text, + textCls: "bi-water-mark", iconCls: o.iconCls }; } @@ -62114,6 +62060,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { var obj = this._digist(vals, this.options.items); this.trigger.setText(obj.text); this.trigger.setIcon(obj.iconCls); + this.trigger.setTextCls(obj.textCls); }, populate: function (items) { @@ -62136,7 +62083,8 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { var conf = BI.TextTrigger.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { baseCls: (conf.baseCls || "") + " bi-text-trigger", - height: 24 + height: 24, + textCls: "" }); }, @@ -62145,7 +62093,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options, c = this._const; this.text = BI.createWidget({ type: "bi.label", - cls: "select-text-label", + cls: "select-text-label" + (BI.isKey(o.textCls) ? (" " + o.textCls) : ""), textAlign: "left", height: o.height, text: o.text, @@ -62176,6 +62124,12 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { }); }, + setTextCls: function(cls) { + var o = this.options; + this.text.element.removeClass(o.textCls).addClass(cls); + o.textCls = cls; + }, + setText: function (text) { this.text.setText(text); }, @@ -62205,12 +62159,14 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { this.options.height -= 2; BI.SelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; + var obj = this._digest(o.text, o.items); this.trigger = BI.createWidget({ type: "bi.text_trigger", element: this, height: o.height, readonly: o.readonly, - text: this._digest(o.value, o.items), + text: obj.text, + textCls: obj.textCls, tipType: o.tipType, warningTitle: o.warningTitle }); @@ -62228,14 +62184,22 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { }); if (result.length > 0) { - return result.join(","); + return { + textCls: "", + text: result.join(",") + } } else { - return BI.isFunction(o.text) ? o.text() : o.text; + return { + textCls: "bi-water-mark", + text: BI.isFunction(o.text) ? o.text() : o.text + } } }, setValue: function (vals) { - this.trigger.setText(this._digest(vals, this.options.items)); + var formatValue = this._digest(vals, this.options.items); + this.trigger.setTextCls(formatValue.textCls); + this.trigger.setText(formatValue.text); }, setTipType: function (v) { @@ -85422,6 +85386,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear }, _createMonths: function () { + var self = this; // 纵向排列月 var month = [1, 7, 2, 8, 3, 9, 4, 10, 5, 11, 6, 12]; var items = []; @@ -85443,7 +85408,10 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear height: 23, width: 38, value: td, - text: td + text: td, + ref: function (_ref) { + self.monthMap[j === 0 ? i : i + 6] = _ref; + } }; }); }); @@ -85451,10 +85419,13 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear render: function () { var self = this, o = this.options; + this.monthMap = {}; return { type: "bi.vertical", items: [{ type: "bi.year_picker", + min: o.min, + max: o.max, ref: function () { self.yearPicker = this; }, @@ -85464,6 +85435,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear eventName: BI.YearPicker.EVENT_CHANGE, action: function () { var value = this.getValue(); + self._checkMonthStatus(value); self.setValue({ year: value, month: self.selectedMonth @@ -85503,6 +85475,23 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear }; }, + mounted: function() { + this._checkMonthStatus(this.selectedYear); + }, + + _checkMonthStatus: function (year) { + var o = this.options; + var minDate = BI.parseDateTime(o.min, "%Y-%X-%d"), maxDate = BI.parseDateTime(o.max, "%Y-%X-%d"); + var minYear = minDate.getFullYear(), maxYear = maxDate.getFullYear(); + var minMonth = 0; var maxMonth = 11; + minYear === year && (minMonth = minDate.getMonth()); + maxYear === year && (maxMonth = maxDate.getMonth()); + var yearInvalid = year < minYear || year > maxYear; + BI.each(this.monthMap, function (month, obj) { + var monthInvalid = month < minMonth || month > maxMonth; + obj.setEnable(!yearInvalid && !monthInvalid); + }); + }, getValue: function () { return { @@ -85537,8 +85526,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { props: { baseCls: "bi-year-month-combo bi-border bi-focus-shadow", behaviors: {}, - min: "1900-01-01", // 最小日期 - max: "2099-12-31", // 最大日期 + minDate: "1900-01-01", // 最小日期 + maxDate: "2099-12-31", // 最大日期 height: 22 }, @@ -85549,8 +85538,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { this.storeTriggerValue = ""; this.trigger = BI.createWidget({ type: "bi.dynamic_year_month_trigger", - min: o.min, - max: o.max, + min: o.minDate, + max: o.maxDate, height: o.height, value: o.value || "" }); @@ -85634,8 +85623,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { } }], behaviors: o.behaviors, - min: o.min, - max: o.max + min: o.minDate, + max: o.maxDate }, value: o.value || "" } @@ -85989,12 +85978,13 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY _createEditor: function (isYear) { var self = this, o = this.options, c = this._const; + var minDate = BI.parseDateTime(o.min, "%Y-%X-%d"); var editor = BI.createWidget({ type: "bi.sign_editor", height: o.height, validationChecker: function (v) { if(isYear) { - return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]); + return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, v === minDate.getFullYear() ? minDate.getMonth() + 1 : 1, 1, o.min, o.max)[0]); } return v === "" || ((BI.isPositiveInteger(v) && v >= 1 && v <= 12) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]); }, diff --git a/dist/case.js b/dist/case.js index 7538932a52..79200c8b25 100644 --- a/dist/case.js +++ b/dist/case.js @@ -5004,73 +5004,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, { } }); BI.TextValueCheckCombo.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.text_value_check_combo", BI.TextValueCheckCombo);/** - * @class BI.SmallTextValueCheckCombo - * @extend BI.Widget - * combo : text + icon, popup : check + text - */ -BI.SmallTextValueCheckCombo = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.SmallTextValueCheckCombo.superclass._defaultConfig.apply(this, arguments), { - width: 100, - height: 24, - chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, - text: "" - }); - }, - - _init: function () { - BI.SmallTextValueCheckCombo.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.trigger = BI.createWidget({ - type: "bi.small_select_text_trigger", - items: o.items, - height: o.height, - text: o.text, - value: o.value - }); - this.popup = BI.createWidget({ - type: "bi.text_value_check_combo_popup", - chooseType: o.chooseType, - items: o.items, - value: o.value - }); - this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE, function () { - self.setValue(self.popup.getValue()); - self.SmallTextIconCheckCombo.hideView(); - self.fireEvent(BI.SmallTextValueCheckCombo.EVENT_CHANGE); - }); - this.popup.on(BI.Controller.EVENT_CHANGE, function () { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); - this.SmallTextIconCheckCombo = BI.createWidget({ - type: "bi.combo", - container: o.container, - element: this, - adjustLength: 2, - el: this.trigger, - popup: { - el: this.popup, - maxHeight: 300 - } - }); - }, - - setValue: function (v) { - this.SmallTextIconCheckCombo.setValue(v); - }, - - getValue: function () { - return this.popup.getValue(); - }, - - populate: function (items) { - this.options.items = items; - this.SmallTextIconCheckCombo.populate(items); - } -}); -BI.SmallTextValueCheckCombo.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.small_text_value_check_combo", BI.SmallTextValueCheckCombo);BI.TextValueCheckComboPopup = BI.inherit(BI.Pane, { +BI.shortcut("bi.text_value_check_combo", BI.TextValueCheckCombo);BI.TextValueCheckComboPopup = BI.inherit(BI.Pane, { _defaultConfig: function () { return BI.extend(BI.TextValueCheckComboPopup.superclass._defaultConfig.apply(this, arguments), { baseCls: "bi-text-icon-popup", @@ -6289,7 +6223,7 @@ BI.StateEditor = BI.inherit(BI.Widget, { }); this.text = BI.createWidget({ type: "bi.text_button", - cls: "state-editor-infinite-text tip-text-style", + cls: "bi-water-mark tip-text-style", textAlign: "left", height: o.height, text: o.text, @@ -6486,31 +6420,31 @@ BI.StateEditor = BI.inherit(BI.Widget, { if (BI.isNumber(v)) { if (v === BI.Selection.All) { this.text.setText(BI.i18nText("BI-Select_All")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (v === BI.Selection.Multi) { this.text.setText(BI.i18nText("BI-Select_Part")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } return; } if (BI.isString(v)) { this.text.setText(v); - this.text.element.removeClass("state-editor-infinite-text"); + v === o.text ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark"); return; } if (BI.isArray(v)) { if (BI.isEmpty(v)) { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } else if (v.length === 1) { this.text.setText(v[0]); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(BI.i18nText("BI-Select_Part")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } } }, @@ -6588,7 +6522,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, { }); this.text = BI.createWidget({ type: "bi.text_button", - cls: "state-editor-infinite-text", + cls: "bi-water-mark", textAlign: "left", text: o.text, height: o.height, @@ -6770,26 +6704,26 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, { if (BI.isNumber(v)) { if (v === BI.Selection.All) { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (v === BI.Selection.Multi) { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } return; } if (!BI.isArray(v) || v.length === 1) { this.text.setText(v); this.text.setTitle(v); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (BI.isEmpty(v)) { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } else { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } } }); @@ -9550,7 +9484,8 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { baseCls: (conf.baseCls || "") + " bi-text-trigger", height: 24, iconHeight: null, - iconWidth: null + iconWidth: null, + textCls: "" }); }, @@ -9559,7 +9494,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options, c = this._const; this.text = BI.createWidget({ type: "bi.label", - cls: "select-text-label", + cls: "select-text-label" + (BI.isKey(o.textCls) ? (" " + o.textCls) : ""), textAlign: "left", height: o.height, text: o.text @@ -9624,6 +9559,12 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { } }, + setTextCls: function(cls) { + var o = this.options; + this.text.element.removeClass(o.textCls).addClass(cls); + o.textCls = cls; + }, + setText: function (text) { this.text.setText(text); } @@ -9652,6 +9593,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { type: "bi.icon_text_trigger", element: this, text: obj.text, + textCls: obj.textCls, iconCls: obj.iconCls, height: o.height, iconHeight: o.iconHeight, @@ -9678,11 +9620,13 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { if (BI.isNotNull(result)) { return { text: result.text, + textCls: "", iconCls: result.iconCls }; } else { return { text: o.text, + textCls: "bi-water-mark", iconCls: o.iconCls }; } @@ -9692,6 +9636,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { var obj = this._digist(vals, this.options.items); this.trigger.setText(obj.text); this.trigger.setIcon(obj.iconCls); + this.trigger.setTextCls(obj.textCls); }, populate: function (items) { @@ -9714,7 +9659,8 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { var conf = BI.TextTrigger.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { baseCls: (conf.baseCls || "") + " bi-text-trigger", - height: 24 + height: 24, + textCls: "" }); }, @@ -9723,7 +9669,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options, c = this._const; this.text = BI.createWidget({ type: "bi.label", - cls: "select-text-label", + cls: "select-text-label" + (BI.isKey(o.textCls) ? (" " + o.textCls) : ""), textAlign: "left", height: o.height, text: o.text, @@ -9754,6 +9700,12 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { }); }, + setTextCls: function(cls) { + var o = this.options; + this.text.element.removeClass(o.textCls).addClass(cls); + o.textCls = cls; + }, + setText: function (text) { this.text.setText(text); }, @@ -9783,12 +9735,14 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { this.options.height -= 2; BI.SelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; + var obj = this._digest(o.text, o.items); this.trigger = BI.createWidget({ type: "bi.text_trigger", element: this, height: o.height, readonly: o.readonly, - text: this._digest(o.value, o.items), + text: obj.text, + textCls: obj.textCls, tipType: o.tipType, warningTitle: o.warningTitle }); @@ -9806,14 +9760,22 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { }); if (result.length > 0) { - return result.join(","); + return { + textCls: "", + text: result.join(",") + } } else { - return BI.isFunction(o.text) ? o.text() : o.text; + return { + textCls: "bi-water-mark", + text: BI.isFunction(o.text) ? o.text() : o.text + } } }, setValue: function (vals) { - this.trigger.setText(this._digest(vals, this.options.items)); + var formatValue = this._digest(vals, this.options.items); + this.trigger.setTextCls(formatValue.textCls); + this.trigger.setText(formatValue.text); }, setTipType: function (v) { diff --git a/dist/core.js b/dist/core.js index 86c1c9b1f5..af515fc706 100644 --- a/dist/core.js +++ b/dist/core.js @@ -32414,7 +32414,9 @@ $.extend($.Event.prototype, { py = BI.toUpperCase(py); } this.empty(); - while (true) { + // BI-48487 性能: makeFirstPY出来的py中包含多音字是必要的,但虽然此方法中做了限制。但是对于一个长度为60,包含14个多音字的字符串 + // 获取的的py长度将达到1966080, 远超过text的长度,到后面都是在做"".substring的无用功,所以此循环应保证py和textLeft长度不为0 + while (py.length > 0 && textLeft.length > 0) { var tidx = BI.toUpperCase(textLeft).indexOf(keyword); var pidx = null; if (py != null) { diff --git a/dist/fineui.ie.js b/dist/fineui.ie.js index 3fe57fb75a..c70d420816 100644 --- a/dist/fineui.ie.js +++ b/dist/fineui.ie.js @@ -32659,7 +32659,9 @@ $.extend($.Event.prototype, { py = BI.toUpperCase(py); } this.empty(); - while (true) { + // BI-48487 性能: makeFirstPY出来的py中包含多音字是必要的,但虽然此方法中做了限制。但是对于一个长度为60,包含14个多音字的字符串 + // 获取的的py长度将达到1966080, 远超过text的长度,到后面都是在做"".substring的无用功,所以此循环应保证py和textLeft长度不为0 + while (py.length > 0 && textLeft.length > 0) { var tidx = BI.toUpperCase(textLeft).indexOf(keyword); var pidx = null; if (py != null) { @@ -47517,7 +47519,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, { type: "bi.text_button", cls: "bi-water-mark cursor-default", textAlign: "left", - height: 20, + whiteSpace: "normal", text: o.watermark, invalid: o.invalid, disabled: o.disabled @@ -57267,73 +57269,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, { } }); BI.TextValueCheckCombo.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.text_value_check_combo", BI.TextValueCheckCombo);/** - * @class BI.SmallTextValueCheckCombo - * @extend BI.Widget - * combo : text + icon, popup : check + text - */ -BI.SmallTextValueCheckCombo = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.SmallTextValueCheckCombo.superclass._defaultConfig.apply(this, arguments), { - width: 100, - height: 24, - chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, - text: "" - }); - }, - - _init: function () { - BI.SmallTextValueCheckCombo.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.trigger = BI.createWidget({ - type: "bi.small_select_text_trigger", - items: o.items, - height: o.height, - text: o.text, - value: o.value - }); - this.popup = BI.createWidget({ - type: "bi.text_value_check_combo_popup", - chooseType: o.chooseType, - items: o.items, - value: o.value - }); - this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE, function () { - self.setValue(self.popup.getValue()); - self.SmallTextIconCheckCombo.hideView(); - self.fireEvent(BI.SmallTextValueCheckCombo.EVENT_CHANGE); - }); - this.popup.on(BI.Controller.EVENT_CHANGE, function () { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); - this.SmallTextIconCheckCombo = BI.createWidget({ - type: "bi.combo", - container: o.container, - element: this, - adjustLength: 2, - el: this.trigger, - popup: { - el: this.popup, - maxHeight: 300 - } - }); - }, - - setValue: function (v) { - this.SmallTextIconCheckCombo.setValue(v); - }, - - getValue: function () { - return this.popup.getValue(); - }, - - populate: function (items) { - this.options.items = items; - this.SmallTextIconCheckCombo.populate(items); - } -}); -BI.SmallTextValueCheckCombo.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.small_text_value_check_combo", BI.SmallTextValueCheckCombo);BI.TextValueCheckComboPopup = BI.inherit(BI.Pane, { +BI.shortcut("bi.text_value_check_combo", BI.TextValueCheckCombo);BI.TextValueCheckComboPopup = BI.inherit(BI.Pane, { _defaultConfig: function () { return BI.extend(BI.TextValueCheckComboPopup.superclass._defaultConfig.apply(this, arguments), { baseCls: "bi-text-icon-popup", @@ -58552,7 +58488,7 @@ BI.StateEditor = BI.inherit(BI.Widget, { }); this.text = BI.createWidget({ type: "bi.text_button", - cls: "state-editor-infinite-text tip-text-style", + cls: "bi-water-mark tip-text-style", textAlign: "left", height: o.height, text: o.text, @@ -58749,31 +58685,31 @@ BI.StateEditor = BI.inherit(BI.Widget, { if (BI.isNumber(v)) { if (v === BI.Selection.All) { this.text.setText(BI.i18nText("BI-Select_All")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (v === BI.Selection.Multi) { this.text.setText(BI.i18nText("BI-Select_Part")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } return; } if (BI.isString(v)) { this.text.setText(v); - this.text.element.removeClass("state-editor-infinite-text"); + v === o.text ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark"); return; } if (BI.isArray(v)) { if (BI.isEmpty(v)) { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } else if (v.length === 1) { this.text.setText(v[0]); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(BI.i18nText("BI-Select_Part")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } } }, @@ -58851,7 +58787,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, { }); this.text = BI.createWidget({ type: "bi.text_button", - cls: "state-editor-infinite-text", + cls: "bi-water-mark", textAlign: "left", text: o.text, height: o.height, @@ -59033,26 +58969,26 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, { if (BI.isNumber(v)) { if (v === BI.Selection.All) { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (v === BI.Selection.Multi) { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } return; } if (!BI.isArray(v) || v.length === 1) { this.text.setText(v); this.text.setTitle(v); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (BI.isEmpty(v)) { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } else { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } } }); @@ -61813,7 +61749,8 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { baseCls: (conf.baseCls || "") + " bi-text-trigger", height: 24, iconHeight: null, - iconWidth: null + iconWidth: null, + textCls: "" }); }, @@ -61822,7 +61759,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options, c = this._const; this.text = BI.createWidget({ type: "bi.label", - cls: "select-text-label", + cls: "select-text-label" + (BI.isKey(o.textCls) ? (" " + o.textCls) : ""), textAlign: "left", height: o.height, text: o.text @@ -61887,6 +61824,12 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { } }, + setTextCls: function(cls) { + var o = this.options; + this.text.element.removeClass(o.textCls).addClass(cls); + o.textCls = cls; + }, + setText: function (text) { this.text.setText(text); } @@ -61915,6 +61858,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { type: "bi.icon_text_trigger", element: this, text: obj.text, + textCls: obj.textCls, iconCls: obj.iconCls, height: o.height, iconHeight: o.iconHeight, @@ -61941,11 +61885,13 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { if (BI.isNotNull(result)) { return { text: result.text, + textCls: "", iconCls: result.iconCls }; } else { return { text: o.text, + textCls: "bi-water-mark", iconCls: o.iconCls }; } @@ -61955,6 +61901,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { var obj = this._digist(vals, this.options.items); this.trigger.setText(obj.text); this.trigger.setIcon(obj.iconCls); + this.trigger.setTextCls(obj.textCls); }, populate: function (items) { @@ -61977,7 +61924,8 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { var conf = BI.TextTrigger.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { baseCls: (conf.baseCls || "") + " bi-text-trigger", - height: 24 + height: 24, + textCls: "" }); }, @@ -61986,7 +61934,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options, c = this._const; this.text = BI.createWidget({ type: "bi.label", - cls: "select-text-label", + cls: "select-text-label" + (BI.isKey(o.textCls) ? (" " + o.textCls) : ""), textAlign: "left", height: o.height, text: o.text, @@ -62017,6 +61965,12 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { }); }, + setTextCls: function(cls) { + var o = this.options; + this.text.element.removeClass(o.textCls).addClass(cls); + o.textCls = cls; + }, + setText: function (text) { this.text.setText(text); }, @@ -62046,12 +62000,14 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { this.options.height -= 2; BI.SelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; + var obj = this._digest(o.text, o.items); this.trigger = BI.createWidget({ type: "bi.text_trigger", element: this, height: o.height, readonly: o.readonly, - text: this._digest(o.value, o.items), + text: obj.text, + textCls: obj.textCls, tipType: o.tipType, warningTitle: o.warningTitle }); @@ -62069,14 +62025,22 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { }); if (result.length > 0) { - return result.join(","); + return { + textCls: "", + text: result.join(",") + } } else { - return BI.isFunction(o.text) ? o.text() : o.text; + return { + textCls: "bi-water-mark", + text: BI.isFunction(o.text) ? o.text() : o.text + } } }, setValue: function (vals) { - this.trigger.setText(this._digest(vals, this.options.items)); + var formatValue = this._digest(vals, this.options.items); + this.trigger.setTextCls(formatValue.textCls); + this.trigger.setText(formatValue.text); }, setTipType: function (v) { @@ -85263,6 +85227,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear }, _createMonths: function () { + var self = this; // 纵向排列月 var month = [1, 7, 2, 8, 3, 9, 4, 10, 5, 11, 6, 12]; var items = []; @@ -85284,7 +85249,10 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear height: 23, width: 38, value: td, - text: td + text: td, + ref: function (_ref) { + self.monthMap[j === 0 ? i : i + 6] = _ref; + } }; }); }); @@ -85292,10 +85260,13 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear render: function () { var self = this, o = this.options; + this.monthMap = {}; return { type: "bi.vertical", items: [{ type: "bi.year_picker", + min: o.min, + max: o.max, ref: function () { self.yearPicker = this; }, @@ -85305,6 +85276,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear eventName: BI.YearPicker.EVENT_CHANGE, action: function () { var value = this.getValue(); + self._checkMonthStatus(value); self.setValue({ year: value, month: self.selectedMonth @@ -85344,6 +85316,23 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear }; }, + mounted: function() { + this._checkMonthStatus(this.selectedYear); + }, + + _checkMonthStatus: function (year) { + var o = this.options; + var minDate = BI.parseDateTime(o.min, "%Y-%X-%d"), maxDate = BI.parseDateTime(o.max, "%Y-%X-%d"); + var minYear = minDate.getFullYear(), maxYear = maxDate.getFullYear(); + var minMonth = 0; var maxMonth = 11; + minYear === year && (minMonth = minDate.getMonth()); + maxYear === year && (maxMonth = maxDate.getMonth()); + var yearInvalid = year < minYear || year > maxYear; + BI.each(this.monthMap, function (month, obj) { + var monthInvalid = month < minMonth || month > maxMonth; + obj.setEnable(!yearInvalid && !monthInvalid); + }); + }, getValue: function () { return { @@ -85378,8 +85367,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { props: { baseCls: "bi-year-month-combo bi-border bi-focus-shadow", behaviors: {}, - min: "1900-01-01", // 最小日期 - max: "2099-12-31", // 最大日期 + minDate: "1900-01-01", // 最小日期 + maxDate: "2099-12-31", // 最大日期 height: 22 }, @@ -85390,8 +85379,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { this.storeTriggerValue = ""; this.trigger = BI.createWidget({ type: "bi.dynamic_year_month_trigger", - min: o.min, - max: o.max, + min: o.minDate, + max: o.maxDate, height: o.height, value: o.value || "" }); @@ -85475,8 +85464,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { } }], behaviors: o.behaviors, - min: o.min, - max: o.max + min: o.minDate, + max: o.maxDate }, value: o.value || "" } @@ -85830,12 +85819,13 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY _createEditor: function (isYear) { var self = this, o = this.options, c = this._const; + var minDate = BI.parseDateTime(o.min, "%Y-%X-%d"); var editor = BI.createWidget({ type: "bi.sign_editor", height: o.height, validationChecker: function (v) { if(isYear) { - return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]); + return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, v === minDate.getFullYear() ? minDate.getMonth() + 1 : 1, 1, o.min, o.max)[0]); } return v === "" || ((BI.isPositiveInteger(v) && v >= 1 && v <= 12) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]); }, diff --git a/dist/fineui.js b/dist/fineui.js index 820aac8bb0..0b22e6ea69 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -32659,7 +32659,9 @@ $.extend($.Event.prototype, { py = BI.toUpperCase(py); } this.empty(); - while (true) { + // BI-48487 性能: makeFirstPY出来的py中包含多音字是必要的,但虽然此方法中做了限制。但是对于一个长度为60,包含14个多音字的字符串 + // 获取的的py长度将达到1966080, 远超过text的长度,到后面都是在做"".substring的无用功,所以此循环应保证py和textLeft长度不为0 + while (py.length > 0 && textLeft.length > 0) { var tidx = BI.toUpperCase(textLeft).indexOf(keyword); var pidx = null; if (py != null) { @@ -47921,7 +47923,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, { type: "bi.text_button", cls: "bi-water-mark cursor-default", textAlign: "left", - height: 20, + whiteSpace: "normal", text: o.watermark, invalid: o.invalid, disabled: o.disabled @@ -57671,73 +57673,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, { } }); BI.TextValueCheckCombo.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.text_value_check_combo", BI.TextValueCheckCombo);/** - * @class BI.SmallTextValueCheckCombo - * @extend BI.Widget - * combo : text + icon, popup : check + text - */ -BI.SmallTextValueCheckCombo = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.SmallTextValueCheckCombo.superclass._defaultConfig.apply(this, arguments), { - width: 100, - height: 24, - chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, - text: "" - }); - }, - - _init: function () { - BI.SmallTextValueCheckCombo.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.trigger = BI.createWidget({ - type: "bi.small_select_text_trigger", - items: o.items, - height: o.height, - text: o.text, - value: o.value - }); - this.popup = BI.createWidget({ - type: "bi.text_value_check_combo_popup", - chooseType: o.chooseType, - items: o.items, - value: o.value - }); - this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE, function () { - self.setValue(self.popup.getValue()); - self.SmallTextIconCheckCombo.hideView(); - self.fireEvent(BI.SmallTextValueCheckCombo.EVENT_CHANGE); - }); - this.popup.on(BI.Controller.EVENT_CHANGE, function () { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); - this.SmallTextIconCheckCombo = BI.createWidget({ - type: "bi.combo", - container: o.container, - element: this, - adjustLength: 2, - el: this.trigger, - popup: { - el: this.popup, - maxHeight: 300 - } - }); - }, - - setValue: function (v) { - this.SmallTextIconCheckCombo.setValue(v); - }, - - getValue: function () { - return this.popup.getValue(); - }, - - populate: function (items) { - this.options.items = items; - this.SmallTextIconCheckCombo.populate(items); - } -}); -BI.SmallTextValueCheckCombo.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.small_text_value_check_combo", BI.SmallTextValueCheckCombo);BI.TextValueCheckComboPopup = BI.inherit(BI.Pane, { +BI.shortcut("bi.text_value_check_combo", BI.TextValueCheckCombo);BI.TextValueCheckComboPopup = BI.inherit(BI.Pane, { _defaultConfig: function () { return BI.extend(BI.TextValueCheckComboPopup.superclass._defaultConfig.apply(this, arguments), { baseCls: "bi-text-icon-popup", @@ -58956,7 +58892,7 @@ BI.StateEditor = BI.inherit(BI.Widget, { }); this.text = BI.createWidget({ type: "bi.text_button", - cls: "state-editor-infinite-text tip-text-style", + cls: "bi-water-mark tip-text-style", textAlign: "left", height: o.height, text: o.text, @@ -59153,31 +59089,31 @@ BI.StateEditor = BI.inherit(BI.Widget, { if (BI.isNumber(v)) { if (v === BI.Selection.All) { this.text.setText(BI.i18nText("BI-Select_All")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (v === BI.Selection.Multi) { this.text.setText(BI.i18nText("BI-Select_Part")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } return; } if (BI.isString(v)) { this.text.setText(v); - this.text.element.removeClass("state-editor-infinite-text"); + v === o.text ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark"); return; } if (BI.isArray(v)) { if (BI.isEmpty(v)) { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } else if (v.length === 1) { this.text.setText(v[0]); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(BI.i18nText("BI-Select_Part")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } } }, @@ -59255,7 +59191,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, { }); this.text = BI.createWidget({ type: "bi.text_button", - cls: "state-editor-infinite-text", + cls: "bi-water-mark", textAlign: "left", text: o.text, height: o.height, @@ -59437,26 +59373,26 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, { if (BI.isNumber(v)) { if (v === BI.Selection.All) { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (v === BI.Selection.Multi) { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } return; } if (!BI.isArray(v) || v.length === 1) { this.text.setText(v); this.text.setTitle(v); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (BI.isEmpty(v)) { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } else { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } } }); @@ -62217,7 +62153,8 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { baseCls: (conf.baseCls || "") + " bi-text-trigger", height: 24, iconHeight: null, - iconWidth: null + iconWidth: null, + textCls: "" }); }, @@ -62226,7 +62163,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options, c = this._const; this.text = BI.createWidget({ type: "bi.label", - cls: "select-text-label", + cls: "select-text-label" + (BI.isKey(o.textCls) ? (" " + o.textCls) : ""), textAlign: "left", height: o.height, text: o.text @@ -62291,6 +62228,12 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { } }, + setTextCls: function(cls) { + var o = this.options; + this.text.element.removeClass(o.textCls).addClass(cls); + o.textCls = cls; + }, + setText: function (text) { this.text.setText(text); } @@ -62319,6 +62262,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { type: "bi.icon_text_trigger", element: this, text: obj.text, + textCls: obj.textCls, iconCls: obj.iconCls, height: o.height, iconHeight: o.iconHeight, @@ -62345,11 +62289,13 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { if (BI.isNotNull(result)) { return { text: result.text, + textCls: "", iconCls: result.iconCls }; } else { return { text: o.text, + textCls: "bi-water-mark", iconCls: o.iconCls }; } @@ -62359,6 +62305,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { var obj = this._digist(vals, this.options.items); this.trigger.setText(obj.text); this.trigger.setIcon(obj.iconCls); + this.trigger.setTextCls(obj.textCls); }, populate: function (items) { @@ -62381,7 +62328,8 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { var conf = BI.TextTrigger.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { baseCls: (conf.baseCls || "") + " bi-text-trigger", - height: 24 + height: 24, + textCls: "" }); }, @@ -62390,7 +62338,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options, c = this._const; this.text = BI.createWidget({ type: "bi.label", - cls: "select-text-label", + cls: "select-text-label" + (BI.isKey(o.textCls) ? (" " + o.textCls) : ""), textAlign: "left", height: o.height, text: o.text, @@ -62421,6 +62369,12 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { }); }, + setTextCls: function(cls) { + var o = this.options; + this.text.element.removeClass(o.textCls).addClass(cls); + o.textCls = cls; + }, + setText: function (text) { this.text.setText(text); }, @@ -62450,12 +62404,14 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { this.options.height -= 2; BI.SelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; + var obj = this._digest(o.text, o.items); this.trigger = BI.createWidget({ type: "bi.text_trigger", element: this, height: o.height, readonly: o.readonly, - text: this._digest(o.value, o.items), + text: obj.text, + textCls: obj.textCls, tipType: o.tipType, warningTitle: o.warningTitle }); @@ -62473,14 +62429,22 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { }); if (result.length > 0) { - return result.join(","); + return { + textCls: "", + text: result.join(",") + } } else { - return BI.isFunction(o.text) ? o.text() : o.text; + return { + textCls: "bi-water-mark", + text: BI.isFunction(o.text) ? o.text() : o.text + } } }, setValue: function (vals) { - this.trigger.setText(this._digest(vals, this.options.items)); + var formatValue = this._digest(vals, this.options.items); + this.trigger.setTextCls(formatValue.textCls); + this.trigger.setText(formatValue.text); }, setTipType: function (v) { @@ -85667,6 +85631,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear }, _createMonths: function () { + var self = this; // 纵向排列月 var month = [1, 7, 2, 8, 3, 9, 4, 10, 5, 11, 6, 12]; var items = []; @@ -85688,7 +85653,10 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear height: 23, width: 38, value: td, - text: td + text: td, + ref: function (_ref) { + self.monthMap[j === 0 ? i : i + 6] = _ref; + } }; }); }); @@ -85696,10 +85664,13 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear render: function () { var self = this, o = this.options; + this.monthMap = {}; return { type: "bi.vertical", items: [{ type: "bi.year_picker", + min: o.min, + max: o.max, ref: function () { self.yearPicker = this; }, @@ -85709,6 +85680,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear eventName: BI.YearPicker.EVENT_CHANGE, action: function () { var value = this.getValue(); + self._checkMonthStatus(value); self.setValue({ year: value, month: self.selectedMonth @@ -85748,6 +85720,23 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear }; }, + mounted: function() { + this._checkMonthStatus(this.selectedYear); + }, + + _checkMonthStatus: function (year) { + var o = this.options; + var minDate = BI.parseDateTime(o.min, "%Y-%X-%d"), maxDate = BI.parseDateTime(o.max, "%Y-%X-%d"); + var minYear = minDate.getFullYear(), maxYear = maxDate.getFullYear(); + var minMonth = 0; var maxMonth = 11; + minYear === year && (minMonth = minDate.getMonth()); + maxYear === year && (maxMonth = maxDate.getMonth()); + var yearInvalid = year < minYear || year > maxYear; + BI.each(this.monthMap, function (month, obj) { + var monthInvalid = month < minMonth || month > maxMonth; + obj.setEnable(!yearInvalid && !monthInvalid); + }); + }, getValue: function () { return { @@ -85782,8 +85771,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { props: { baseCls: "bi-year-month-combo bi-border bi-focus-shadow", behaviors: {}, - min: "1900-01-01", // 最小日期 - max: "2099-12-31", // 最大日期 + minDate: "1900-01-01", // 最小日期 + maxDate: "2099-12-31", // 最大日期 height: 22 }, @@ -85794,8 +85783,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { this.storeTriggerValue = ""; this.trigger = BI.createWidget({ type: "bi.dynamic_year_month_trigger", - min: o.min, - max: o.max, + min: o.minDate, + max: o.maxDate, height: o.height, value: o.value || "" }); @@ -85879,8 +85868,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { } }], behaviors: o.behaviors, - min: o.min, - max: o.max + min: o.minDate, + max: o.maxDate }, value: o.value || "" } @@ -86234,12 +86223,13 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY _createEditor: function (isYear) { var self = this, o = this.options, c = this._const; + var minDate = BI.parseDateTime(o.min, "%Y-%X-%d"); var editor = BI.createWidget({ type: "bi.sign_editor", height: o.height, validationChecker: function (v) { if(isYear) { - return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]); + return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, v === minDate.getFullYear() ? minDate.getMonth() + 1 : 1, 1, o.min, o.max)[0]); } return v === "" || ((BI.isPositiveInteger(v) && v >= 1 && v <= 12) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]); }, diff --git a/dist/fineui_without_jquery_polyfill.js b/dist/fineui_without_jquery_polyfill.js index 94e5d63bda..1a2bb4e896 100644 --- a/dist/fineui_without_jquery_polyfill.js +++ b/dist/fineui_without_jquery_polyfill.js @@ -28756,6 +28756,48 @@ describe("TextTest", function () { expect(text.element.children(".bi-keyword-red-mark").length).to.equal(0); text.destroy(); }); + + /** + * test_author_windy + */ + it("setValue", function () { + var text = BI.Test.createWidget({ + type: "bi.text", + text: "我是要标红的A", + keyword: "A" + }); + text.unRedMark(); + expect(text.element.children(".bi-keyword-red-mark").length).to.equal(0); + text.destroy(); + }); + + /** + * test_author_windy + */ + it("gap测试", function () { + var text = BI.Test.createWidget({ + type: "bi.text", + text: "我是要标红的A", + keyword: "A" + }); + text.unRedMark(); + expect(text.element.children(".bi-keyword-red-mark").length).to.equal(0); + text.destroy(); + }); + + /** + * test_author_windy + */ + it("空格测试", function () { + var text = BI.Test.createWidget({ + type: "bi.text", + text: "我是要标红的 A", + keyword: "A" + }); + text.unRedMark(); + expect(text.element.children(".bi-keyword-red-mark").length).to.equal(0); + text.destroy(); + }); }); BI.prepares.push(function () { BI.Resizers = new BI.ResizeController(); @@ -35240,7 +35282,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, { type: "bi.text_button", cls: "bi-water-mark cursor-default", textAlign: "left", - height: 20, + whiteSpace: "normal", text: o.watermark, invalid: o.invalid, disabled: o.disabled @@ -40452,73 +40494,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, { } }); BI.TextValueCheckCombo.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.text_value_check_combo", BI.TextValueCheckCombo);/** - * @class BI.SmallTextValueCheckCombo - * @extend BI.Widget - * combo : text + icon, popup : check + text - */ -BI.SmallTextValueCheckCombo = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.SmallTextValueCheckCombo.superclass._defaultConfig.apply(this, arguments), { - width: 100, - height: 24, - chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, - text: "" - }); - }, - - _init: function () { - BI.SmallTextValueCheckCombo.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.trigger = BI.createWidget({ - type: "bi.small_select_text_trigger", - items: o.items, - height: o.height, - text: o.text, - value: o.value - }); - this.popup = BI.createWidget({ - type: "bi.text_value_check_combo_popup", - chooseType: o.chooseType, - items: o.items, - value: o.value - }); - this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE, function () { - self.setValue(self.popup.getValue()); - self.SmallTextIconCheckCombo.hideView(); - self.fireEvent(BI.SmallTextValueCheckCombo.EVENT_CHANGE); - }); - this.popup.on(BI.Controller.EVENT_CHANGE, function () { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); - this.SmallTextIconCheckCombo = BI.createWidget({ - type: "bi.combo", - container: o.container, - element: this, - adjustLength: 2, - el: this.trigger, - popup: { - el: this.popup, - maxHeight: 300 - } - }); - }, - - setValue: function (v) { - this.SmallTextIconCheckCombo.setValue(v); - }, - - getValue: function () { - return this.popup.getValue(); - }, - - populate: function (items) { - this.options.items = items; - this.SmallTextIconCheckCombo.populate(items); - } -}); -BI.SmallTextValueCheckCombo.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.small_text_value_check_combo", BI.SmallTextValueCheckCombo);BI.TextValueCheckComboPopup = BI.inherit(BI.Pane, { +BI.shortcut("bi.text_value_check_combo", BI.TextValueCheckCombo);BI.TextValueCheckComboPopup = BI.inherit(BI.Pane, { _defaultConfig: function () { return BI.extend(BI.TextValueCheckComboPopup.superclass._defaultConfig.apply(this, arguments), { baseCls: "bi-text-icon-popup", @@ -41737,7 +41713,7 @@ BI.StateEditor = BI.inherit(BI.Widget, { }); this.text = BI.createWidget({ type: "bi.text_button", - cls: "state-editor-infinite-text tip-text-style", + cls: "bi-water-mark tip-text-style", textAlign: "left", height: o.height, text: o.text, @@ -41934,31 +41910,31 @@ BI.StateEditor = BI.inherit(BI.Widget, { if (BI.isNumber(v)) { if (v === BI.Selection.All) { this.text.setText(BI.i18nText("BI-Select_All")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (v === BI.Selection.Multi) { this.text.setText(BI.i18nText("BI-Select_Part")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } return; } if (BI.isString(v)) { this.text.setText(v); - this.text.element.removeClass("state-editor-infinite-text"); + v === o.text ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark"); return; } if (BI.isArray(v)) { if (BI.isEmpty(v)) { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } else if (v.length === 1) { this.text.setText(v[0]); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(BI.i18nText("BI-Select_Part")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } } }, @@ -42036,7 +42012,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, { }); this.text = BI.createWidget({ type: "bi.text_button", - cls: "state-editor-infinite-text", + cls: "bi-water-mark", textAlign: "left", text: o.text, height: o.height, @@ -42218,26 +42194,26 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, { if (BI.isNumber(v)) { if (v === BI.Selection.All) { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (v === BI.Selection.Multi) { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } return; } if (!BI.isArray(v) || v.length === 1) { this.text.setText(v); this.text.setTitle(v); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (BI.isEmpty(v)) { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } else { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } } }); @@ -44722,7 +44698,8 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { baseCls: (conf.baseCls || "") + " bi-text-trigger", height: 24, iconHeight: null, - iconWidth: null + iconWidth: null, + textCls: "" }); }, @@ -44731,7 +44708,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options, c = this._const; this.text = BI.createWidget({ type: "bi.label", - cls: "select-text-label", + cls: "select-text-label" + (BI.isKey(o.textCls) ? (" " + o.textCls) : ""), textAlign: "left", height: o.height, text: o.text @@ -44796,6 +44773,12 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { } }, + setTextCls: function(cls) { + var o = this.options; + this.text.element.removeClass(o.textCls).addClass(cls); + o.textCls = cls; + }, + setText: function (text) { this.text.setText(text); } @@ -44824,6 +44807,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { type: "bi.icon_text_trigger", element: this, text: obj.text, + textCls: obj.textCls, iconCls: obj.iconCls, height: o.height, iconHeight: o.iconHeight, @@ -44850,11 +44834,13 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { if (BI.isNotNull(result)) { return { text: result.text, + textCls: "", iconCls: result.iconCls }; } else { return { text: o.text, + textCls: "bi-water-mark", iconCls: o.iconCls }; } @@ -44864,6 +44850,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { var obj = this._digist(vals, this.options.items); this.trigger.setText(obj.text); this.trigger.setIcon(obj.iconCls); + this.trigger.setTextCls(obj.textCls); }, populate: function (items) { @@ -44886,7 +44873,8 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { var conf = BI.TextTrigger.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { baseCls: (conf.baseCls || "") + " bi-text-trigger", - height: 24 + height: 24, + textCls: "" }); }, @@ -44895,7 +44883,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options, c = this._const; this.text = BI.createWidget({ type: "bi.label", - cls: "select-text-label", + cls: "select-text-label" + (BI.isKey(o.textCls) ? (" " + o.textCls) : ""), textAlign: "left", height: o.height, text: o.text, @@ -44926,6 +44914,12 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { }); }, + setTextCls: function(cls) { + var o = this.options; + this.text.element.removeClass(o.textCls).addClass(cls); + o.textCls = cls; + }, + setText: function (text) { this.text.setText(text); }, @@ -44955,12 +44949,14 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { this.options.height -= 2; BI.SelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; + var obj = this._digest(o.text, o.items); this.trigger = BI.createWidget({ type: "bi.text_trigger", element: this, height: o.height, readonly: o.readonly, - text: this._digest(o.value, o.items), + text: obj.text, + textCls: obj.textCls, tipType: o.tipType, warningTitle: o.warningTitle }); @@ -44978,14 +44974,22 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { }); if (result.length > 0) { - return result.join(","); + return { + textCls: "", + text: result.join(",") + } } else { - return BI.isFunction(o.text) ? o.text() : o.text; + return { + textCls: "bi-water-mark", + text: BI.isFunction(o.text) ? o.text() : o.text + } } }, setValue: function (vals) { - this.trigger.setText(this._digest(vals, this.options.items)); + var formatValue = this._digest(vals, this.options.items); + this.trigger.setTextCls(formatValue.textCls); + this.trigger.setText(formatValue.text); }, setTipType: function (v) { @@ -68172,6 +68176,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear }, _createMonths: function () { + var self = this; // 纵向排列月 var month = [1, 7, 2, 8, 3, 9, 4, 10, 5, 11, 6, 12]; var items = []; @@ -68193,7 +68198,10 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear height: 23, width: 38, value: td, - text: td + text: td, + ref: function (_ref) { + self.monthMap[j === 0 ? i : i + 6] = _ref; + } }; }); }); @@ -68201,10 +68209,13 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear render: function () { var self = this, o = this.options; + this.monthMap = {}; return { type: "bi.vertical", items: [{ type: "bi.year_picker", + min: o.min, + max: o.max, ref: function () { self.yearPicker = this; }, @@ -68214,6 +68225,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear eventName: BI.YearPicker.EVENT_CHANGE, action: function () { var value = this.getValue(); + self._checkMonthStatus(value); self.setValue({ year: value, month: self.selectedMonth @@ -68253,6 +68265,23 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear }; }, + mounted: function() { + this._checkMonthStatus(this.selectedYear); + }, + + _checkMonthStatus: function (year) { + var o = this.options; + var minDate = BI.parseDateTime(o.min, "%Y-%X-%d"), maxDate = BI.parseDateTime(o.max, "%Y-%X-%d"); + var minYear = minDate.getFullYear(), maxYear = maxDate.getFullYear(); + var minMonth = 0; var maxMonth = 11; + minYear === year && (minMonth = minDate.getMonth()); + maxYear === year && (maxMonth = maxDate.getMonth()); + var yearInvalid = year < minYear || year > maxYear; + BI.each(this.monthMap, function (month, obj) { + var monthInvalid = month < minMonth || month > maxMonth; + obj.setEnable(!yearInvalid && !monthInvalid); + }); + }, getValue: function () { return { @@ -68287,8 +68316,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { props: { baseCls: "bi-year-month-combo bi-border bi-focus-shadow", behaviors: {}, - min: "1900-01-01", // 最小日期 - max: "2099-12-31", // 最大日期 + minDate: "1900-01-01", // 最小日期 + maxDate: "2099-12-31", // 最大日期 height: 22 }, @@ -68299,8 +68328,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { this.storeTriggerValue = ""; this.trigger = BI.createWidget({ type: "bi.dynamic_year_month_trigger", - min: o.min, - max: o.max, + min: o.minDate, + max: o.maxDate, height: o.height, value: o.value || "" }); @@ -68384,8 +68413,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { } }], behaviors: o.behaviors, - min: o.min, - max: o.max + min: o.minDate, + max: o.maxDate }, value: o.value || "" } @@ -68739,12 +68768,13 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY _createEditor: function (isYear) { var self = this, o = this.options, c = this._const; + var minDate = BI.parseDateTime(o.min, "%Y-%X-%d"); var editor = BI.createWidget({ type: "bi.sign_editor", height: o.height, validationChecker: function (v) { if(isYear) { - return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]); + return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, v === minDate.getFullYear() ? minDate.getMonth() + 1 : 1, 1, o.min, o.max)[0]); } return v === "" || ((BI.isPositiveInteger(v) && v >= 1 && v <= 12) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]); }, diff --git a/dist/widget.js b/dist/widget.js index 4d1354e12f..78b6a74008 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -23054,6 +23054,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear }, _createMonths: function () { + var self = this; // 纵向排列月 var month = [1, 7, 2, 8, 3, 9, 4, 10, 5, 11, 6, 12]; var items = []; @@ -23075,7 +23076,10 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear height: 23, width: 38, value: td, - text: td + text: td, + ref: function (_ref) { + self.monthMap[j === 0 ? i : i + 6] = _ref; + } }; }); }); @@ -23083,10 +23087,13 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear render: function () { var self = this, o = this.options; + this.monthMap = {}; return { type: "bi.vertical", items: [{ type: "bi.year_picker", + min: o.min, + max: o.max, ref: function () { self.yearPicker = this; }, @@ -23096,6 +23103,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear eventName: BI.YearPicker.EVENT_CHANGE, action: function () { var value = this.getValue(); + self._checkMonthStatus(value); self.setValue({ year: value, month: self.selectedMonth @@ -23135,6 +23143,23 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear }; }, + mounted: function() { + this._checkMonthStatus(this.selectedYear); + }, + + _checkMonthStatus: function (year) { + var o = this.options; + var minDate = BI.parseDateTime(o.min, "%Y-%X-%d"), maxDate = BI.parseDateTime(o.max, "%Y-%X-%d"); + var minYear = minDate.getFullYear(), maxYear = maxDate.getFullYear(); + var minMonth = 0; var maxMonth = 11; + minYear === year && (minMonth = minDate.getMonth()); + maxYear === year && (maxMonth = maxDate.getMonth()); + var yearInvalid = year < minYear || year > maxYear; + BI.each(this.monthMap, function (month, obj) { + var monthInvalid = month < minMonth || month > maxMonth; + obj.setEnable(!yearInvalid && !monthInvalid); + }); + }, getValue: function () { return { @@ -23169,8 +23194,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { props: { baseCls: "bi-year-month-combo bi-border bi-focus-shadow", behaviors: {}, - min: "1900-01-01", // 最小日期 - max: "2099-12-31", // 最大日期 + minDate: "1900-01-01", // 最小日期 + maxDate: "2099-12-31", // 最大日期 height: 22 }, @@ -23181,8 +23206,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { this.storeTriggerValue = ""; this.trigger = BI.createWidget({ type: "bi.dynamic_year_month_trigger", - min: o.min, - max: o.max, + min: o.minDate, + max: o.maxDate, height: o.height, value: o.value || "" }); @@ -23266,8 +23291,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { } }], behaviors: o.behaviors, - min: o.min, - max: o.max + min: o.minDate, + max: o.maxDate }, value: o.value || "" } @@ -23621,12 +23646,13 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY _createEditor: function (isYear) { var self = this, o = this.options, c = this._const; + var minDate = BI.parseDateTime(o.min, "%Y-%X-%d"); var editor = BI.createWidget({ type: "bi.sign_editor", height: o.height, validationChecker: function (v) { if(isYear) { - return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]); + return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, v === minDate.getFullYear() ? minDate.getMonth() + 1 : 1, 1, o.min, o.max)[0]); } return v === "" || ((BI.isPositiveInteger(v) && v >= 1 && v <= 12) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]); }, From b2ea4d925704d4373dc210b7329f0ddea5c86f0b Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Thu, 25 Jul 2019 19:44:30 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E6=94=B9=E5=A4=9A=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/2.0/fineui.ie.js | 4 ++-- dist/2.0/fineui.js | 4 ++-- dist/bundle.ie.js | 4 ++-- dist/bundle.js | 4 ++-- dist/case.js | 4 ++-- dist/fineui.ie.js | 4 ++-- dist/fineui.js | 4 ++-- dist/fineui_without_jquery_polyfill.js | 4 ++-- src/case/trigger/trigger.text.select.js | 2 +- src/case/trigger/trigger.text.select.small.js | 2 +- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/dist/2.0/fineui.ie.js b/dist/2.0/fineui.ie.js index 637b265515..8a5901bf19 100644 --- a/dist/2.0/fineui.ie.js +++ b/dist/2.0/fineui.ie.js @@ -61755,7 +61755,7 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { this.options.height -= 2; BI.SelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; - var obj = this._digest(o.text, o.items); + var obj = this._digest(o.value, o.items); this.trigger = BI.createWidget({ type: "bi.text_trigger", element: this, @@ -61826,7 +61826,7 @@ BI.SmallSelectTextTrigger = BI.inherit(BI.Trigger, { this.options.height -= 2; BI.SmallSelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; - var obj = this._digest(o.text, o.items); + var obj = this._digest(o.value, o.items); this.trigger = BI.createWidget({ type: "bi.small_text_trigger", element: this, diff --git a/dist/2.0/fineui.js b/dist/2.0/fineui.js index 5789702206..db2861f63b 100644 --- a/dist/2.0/fineui.js +++ b/dist/2.0/fineui.js @@ -62159,7 +62159,7 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { this.options.height -= 2; BI.SelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; - var obj = this._digest(o.text, o.items); + var obj = this._digest(o.value, o.items); this.trigger = BI.createWidget({ type: "bi.text_trigger", element: this, @@ -62230,7 +62230,7 @@ BI.SmallSelectTextTrigger = BI.inherit(BI.Trigger, { this.options.height -= 2; BI.SmallSelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; - var obj = this._digest(o.text, o.items); + var obj = this._digest(o.value, o.items); this.trigger = BI.createWidget({ type: "bi.small_text_trigger", element: this, diff --git a/dist/bundle.ie.js b/dist/bundle.ie.js index 637b265515..8a5901bf19 100644 --- a/dist/bundle.ie.js +++ b/dist/bundle.ie.js @@ -61755,7 +61755,7 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { this.options.height -= 2; BI.SelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; - var obj = this._digest(o.text, o.items); + var obj = this._digest(o.value, o.items); this.trigger = BI.createWidget({ type: "bi.text_trigger", element: this, @@ -61826,7 +61826,7 @@ BI.SmallSelectTextTrigger = BI.inherit(BI.Trigger, { this.options.height -= 2; BI.SmallSelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; - var obj = this._digest(o.text, o.items); + var obj = this._digest(o.value, o.items); this.trigger = BI.createWidget({ type: "bi.small_text_trigger", element: this, diff --git a/dist/bundle.js b/dist/bundle.js index 5789702206..db2861f63b 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -62159,7 +62159,7 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { this.options.height -= 2; BI.SelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; - var obj = this._digest(o.text, o.items); + var obj = this._digest(o.value, o.items); this.trigger = BI.createWidget({ type: "bi.text_trigger", element: this, @@ -62230,7 +62230,7 @@ BI.SmallSelectTextTrigger = BI.inherit(BI.Trigger, { this.options.height -= 2; BI.SmallSelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; - var obj = this._digest(o.text, o.items); + var obj = this._digest(o.value, o.items); this.trigger = BI.createWidget({ type: "bi.small_text_trigger", element: this, diff --git a/dist/case.js b/dist/case.js index 79200c8b25..11e603be1a 100644 --- a/dist/case.js +++ b/dist/case.js @@ -9735,7 +9735,7 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { this.options.height -= 2; BI.SelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; - var obj = this._digest(o.text, o.items); + var obj = this._digest(o.value, o.items); this.trigger = BI.createWidget({ type: "bi.text_trigger", element: this, @@ -9806,7 +9806,7 @@ BI.SmallSelectTextTrigger = BI.inherit(BI.Trigger, { this.options.height -= 2; BI.SmallSelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; - var obj = this._digest(o.text, o.items); + var obj = this._digest(o.value, o.items); this.trigger = BI.createWidget({ type: "bi.small_text_trigger", element: this, diff --git a/dist/fineui.ie.js b/dist/fineui.ie.js index c70d420816..62806340e0 100644 --- a/dist/fineui.ie.js +++ b/dist/fineui.ie.js @@ -62000,7 +62000,7 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { this.options.height -= 2; BI.SelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; - var obj = this._digest(o.text, o.items); + var obj = this._digest(o.value, o.items); this.trigger = BI.createWidget({ type: "bi.text_trigger", element: this, @@ -62071,7 +62071,7 @@ BI.SmallSelectTextTrigger = BI.inherit(BI.Trigger, { this.options.height -= 2; BI.SmallSelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; - var obj = this._digest(o.text, o.items); + var obj = this._digest(o.value, o.items); this.trigger = BI.createWidget({ type: "bi.small_text_trigger", element: this, diff --git a/dist/fineui.js b/dist/fineui.js index 0b22e6ea69..d2acd37aaf 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -62404,7 +62404,7 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { this.options.height -= 2; BI.SelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; - var obj = this._digest(o.text, o.items); + var obj = this._digest(o.value, o.items); this.trigger = BI.createWidget({ type: "bi.text_trigger", element: this, @@ -62475,7 +62475,7 @@ BI.SmallSelectTextTrigger = BI.inherit(BI.Trigger, { this.options.height -= 2; BI.SmallSelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; - var obj = this._digest(o.text, o.items); + var obj = this._digest(o.value, o.items); this.trigger = BI.createWidget({ type: "bi.small_text_trigger", element: this, diff --git a/dist/fineui_without_jquery_polyfill.js b/dist/fineui_without_jquery_polyfill.js index 1a2bb4e896..26fc584b37 100644 --- a/dist/fineui_without_jquery_polyfill.js +++ b/dist/fineui_without_jquery_polyfill.js @@ -44949,7 +44949,7 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { this.options.height -= 2; BI.SelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; - var obj = this._digest(o.text, o.items); + var obj = this._digest(o.value, o.items); this.trigger = BI.createWidget({ type: "bi.text_trigger", element: this, @@ -45020,7 +45020,7 @@ BI.SmallSelectTextTrigger = BI.inherit(BI.Trigger, { this.options.height -= 2; BI.SmallSelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; - var obj = this._digest(o.text, o.items); + var obj = this._digest(o.value, o.items); this.trigger = BI.createWidget({ type: "bi.small_text_trigger", element: this, diff --git a/src/case/trigger/trigger.text.select.js b/src/case/trigger/trigger.text.select.js index 4c6b519433..04d3e92db6 100644 --- a/src/case/trigger/trigger.text.select.js +++ b/src/case/trigger/trigger.text.select.js @@ -18,7 +18,7 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { this.options.height -= 2; BI.SelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; - var obj = this._digest(o.text, o.items); + var obj = this._digest(o.value, o.items); this.trigger = BI.createWidget({ type: "bi.text_trigger", element: this, diff --git a/src/case/trigger/trigger.text.select.small.js b/src/case/trigger/trigger.text.select.small.js index 9eda6bc33f..79f58800c4 100644 --- a/src/case/trigger/trigger.text.select.small.js +++ b/src/case/trigger/trigger.text.select.small.js @@ -17,7 +17,7 @@ BI.SmallSelectTextTrigger = BI.inherit(BI.Trigger, { this.options.height -= 2; BI.SmallSelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; - var obj = this._digest(o.text, o.items); + var obj = this._digest(o.value, o.items); this.trigger = BI.createWidget({ type: "bi.small_text_trigger", element: this, From 088a3c3dc06458188e224e5c9aec6b182ffddf93 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 26 Jul 2019 09:06:26 +0800 Subject: [PATCH 8/8] =?UTF-8?q?fix:=20=E6=A0=B9=E6=8D=AEcomment=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/trigger/trigger.icon.text.js | 3 ++- src/case/trigger/trigger.text.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/case/trigger/trigger.icon.text.js b/src/case/trigger/trigger.icon.text.js index 4721eefa4e..eac94ab508 100644 --- a/src/case/trigger/trigger.icon.text.js +++ b/src/case/trigger/trigger.icon.text.js @@ -93,8 +93,9 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { setTextCls: function(cls) { var o = this.options; - this.text.element.removeClass(o.textCls).addClass(cls); + var oldCls = o.textCls; o.textCls = cls; + this.text.element.removeClass(oldCls).addClass(cls); }, setText: function (text) { diff --git a/src/case/trigger/trigger.text.js b/src/case/trigger/trigger.text.js index 8d7ffb251f..81815e2496 100644 --- a/src/case/trigger/trigger.text.js +++ b/src/case/trigger/trigger.text.js @@ -57,8 +57,9 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { setTextCls: function(cls) { var o = this.options; - this.text.element.removeClass(o.textCls).addClass(cls); + var oldCls = o.textCls; o.textCls = cls; + this.text.element.removeClass(oldCls).addClass(cls); }, setText: function (text) {