diff --git a/dist/bundle.css b/dist/bundle.css index 4e7332708a..73ed85675f 100644 --- a/dist/bundle.css +++ b/dist/bundle.css @@ -6039,24 +6039,24 @@ textarea::-webkit-scrollbar-thumb:hover { color: inherit; } .trigger-triangle-font .b-font { - *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); } .trigger-triangle-font .b-font:before { - content: "\e6f0"; + content: "\e64e"; color: #999999; } .trigger-triangle-font:hover .b-font:before, .trigger-triangle-font.hover .b-font:before { - content: "\e6f0"; + content: "\e64e"; color: #999999; } .trigger-triangle-font:active .b-font:before, .trigger-triangle-font.active .b-font:before { - content: "\e6f0"; + content: "\e64e"; color: #3685f2; } .trigger-triangle-font.disabled .b-font:before { - content: "\e6f0"; + content: "\e64e"; color: #999999; } .pull-down-font .b-font { @@ -6167,45 +6167,45 @@ textarea::-webkit-scrollbar-thumb:hover { color: #faaa39; } .less-font .b-font { - *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); } .less-font .b-font:before { - content: "\e75f"; + content: "\e75e"; color: inherit; } .less-font:hover .b-font:before, .less-font.hover .b-font:before { - content: "\e75f"; + content: "\e75e"; color: inherit; } .less-font:active .b-font:before, .less-font.active .b-font:before { - content: "\e75f"; + content: "\e75e"; color: #3f8ce8; } .less-font.disabled .b-font:before { - content: "\e75f"; + content: "\e75e"; color: inherit; } .less-equal-font .b-font { - *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); } .less-equal-font .b-font:before { - content: "\e760"; + content: "\e761"; color: inherit; } .less-equal-font:hover .b-font:before, .less-equal-font.hover .b-font:before { - content: "\e760"; + content: "\e761"; color: inherit; } .less-equal-font:active .b-font:before, .less-equal-font.active .b-font:before { - content: "\e760"; + content: "\e761"; color: #3f8ce8; } .less-equal-font.disabled .b-font:before { - content: "\e760"; + content: "\e761"; color: inherit; } .text-bold-font .b-font { diff --git a/dist/bundle.js b/dist/bundle.js index bdf977b341..8bf419e1e7 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -77737,8 +77737,7 @@ BI.IconCombo = BI.inherit(BI.Widget, { adjustXOffset: 0, adjustYOffset: 0, offsetStyle: "left", - chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, - isShowDown: true + chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE }); }, @@ -77754,8 +77753,7 @@ BI.IconCombo = BI.inherit(BI.Widget, { height: o.height, iconWidth: o.iconWidth, iconHeight: o.iconHeight, - value: o.value, - isShowDown: o.isShowDown + value: o.value }); this.popup = BI.createWidget(o.popup, { type: "bi.icon_combo_popup", @@ -77921,7 +77919,7 @@ BI.IconComboTrigger = BI.inherit(BI.Trigger, { disableSelected: true, cls: "icon-combo-down-icon trigger-triangle-font", width: 12, - height: o.height, + height: 8, selected: BI.isNotEmptyString(iconCls) }); this.down.setVisible(o.isShowDown); @@ -90933,7 +90931,8 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger break; case this._const.yearMonthLength: case this._const.yearFullMonthLength: - if (this._monthCheck(v)) { + var splitMonth = v.split("-")[1]; + if ((BI.isNotNull(splitMonth) && splitMonth.length === 2) || this._monthCheck(v)) { this.editor.setValue(v + "-"); } break; @@ -91872,7 +91871,9 @@ BI.extend(BI.DynamicDateTimeSelect, { } break; case this._const.yearMonthLength: - if (this._monthCheck(v)) { + case this._const.yearFullMonthLength: + var splitMonth = v.split("-")[1]; + if ((BI.isNotNull(splitMonth) && splitMonth.length === 2) || this._monthCheck(v)) { this.editor.setValue(v + "-"); } break; @@ -100596,7 +100597,6 @@ BI.NumberInterval = BI.inherit(BI.Single, { type: "bi.icon_combo", cls: "number-interval-small-combo bi-border", height: o.height - 2, - isShowDown: false, items: [{ text: "(" + BI.i18nText("BI-Less_Than") + ")", iconCls: "less-font", @@ -100615,7 +100615,6 @@ BI.NumberInterval = BI.inherit(BI.Single, { this.bigCombo = BI.createWidget({ type: "bi.icon_combo", cls: "number-interval-big-combo bi-border", - isShowDown: false, height: o.height - 2, items: [{ text: "(" + BI.i18nText("BI-Less_Than") + ")", @@ -103650,19 +103649,9 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { self.storeValue = this.getValue(); self._adjust(function () { assertShowValue(); + self._defaultState(); }); } - }, { - eventName: BI.SingleSelectPopupView.EVENT_CLICK_CONFIRM, - action: function () { - self._defaultState(); - } - }, { - eventName: BI.SingleSelectPopupView.EVENT_CLICK_CLEAR, - action: function () { - self.setValue(); - self._defaultState(); - } }], itemsCreator: o.itemsCreator, valueFormatter: o.valueFormatter, @@ -104200,13 +104189,12 @@ BI.SingleSelectPopupView = BI.inherit(BI.Widget, { }); this.popupView = BI.createWidget({ - type: "bi.multi_popup_view", + type: "bi.popup_view", stopPropagation: false, maxWidth: opts.maxWidth, minWidth: opts.minWidth, maxHeight: opts.maxHeight, element: this, - buttons: [BI.i18nText("BI-Basic_Clears"), BI.i18nText("BI-Basic_Sure")], el: this.loader, value: opts.value }); @@ -104214,16 +104202,6 @@ BI.SingleSelectPopupView = BI.inherit(BI.Widget, { this.popupView.on(BI.MultiPopupView.EVENT_CHANGE, function () { self.fireEvent(BI.SingleSelectPopupView.EVENT_CHANGE); }); - this.popupView.on(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON, function (index) { - switch (index) { - case 0: - self.fireEvent(BI.SingleSelectPopupView.EVENT_CLICK_CLEAR); - break; - case 1: - self.fireEvent(BI.SingleSelectPopupView.EVENT_CLICK_CONFIRM); - break; - } - }); }, setStartValue: function (v) { @@ -104252,8 +104230,6 @@ BI.SingleSelectPopupView = BI.inherit(BI.Widget, { }); BI.SingleSelectPopupView.EVENT_CHANGE = "EVENT_CHANGE"; -BI.SingleSelectPopupView.EVENT_CLICK_CONFIRM = "EVENT_CLICK_CONFIRM"; -BI.SingleSelectPopupView.EVENT_CLICK_CLEAR = "EVENT_CLICK_CLEAR"; BI.shortcut("bi.single_select_popup_view", BI.SingleSelectPopupView);/** @@ -105184,13 +105160,13 @@ BI.SingleSelectSearchPane.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.single_select_search_add_pane", BI.SingleSelectSearchPane);/** * - * @class BI.SingleSelectCombo + * @class BI.SingleSelectInsertCombo * @extends BI.Single */ -BI.SingleSelectCombo = BI.inherit(BI.Single, { +BI.SingleSelectInsertCombo = BI.inherit(BI.Single, { _defaultConfig: function () { - return BI.extend(BI.SingleSelectCombo.superclass._defaultConfig.apply(this, arguments), { + return BI.extend(BI.SingleSelectInsertCombo.superclass._defaultConfig.apply(this, arguments), { baseCls: "bi-single-select-combo", itemsCreator: BI.emptyFn, valueFormatter: BI.emptyFn, @@ -105199,7 +105175,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { }, _init: function () { - BI.SingleSelectCombo.superclass._init.apply(this, arguments); + BI.SingleSelectInsertCombo.superclass._init.apply(this, arguments); var self = this, o = this.options; var assertShowValue = function () { @@ -105301,19 +105277,9 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { self.storeValue = this.getValue(); self._adjust(function () { assertShowValue(); + self._defaultState(); }); } - }, { - eventName: BI.SingleSelectPopupView.EVENT_CLICK_CONFIRM, - action: function () { - self._defaultState(); - } - }, { - eventName: BI.SingleSelectPopupView.EVENT_CLICK_CLEAR, - action: function () { - self.setValue(); - self._defaultState(); - } }], itemsCreator: o.itemsCreator, valueFormatter: o.valueFormatter, @@ -105344,7 +105310,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { if (self.requesting === true) { self.wants2Quit = true; } else { - self.fireEvent(BI.SingleSelectCombo.EVENT_CONFIRM); + self.fireEvent(BI.SingleSelectInsertCombo.EVENT_CONFIRM); } }); @@ -105397,7 +105363,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { this._assertValue(this.storeValue); this.requesting = true; o.itemsCreator({ - type: BI.SingleSelectCombo.REQ_GET_ALL_DATA, + type: BI.SingleSelectInsertCombo.REQ_GET_ALL_DATA, keywords: keywords }, function (ob) { var values = BI.map(ob.items, "value"); @@ -105420,7 +105386,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { this._assertValue(res); this.requesting = true; o.itemsCreator({ - type: BI.SingleSelectCombo.REQ_GET_ALL_DATA, + type: BI.SingleSelectInsertCombo.REQ_GET_ALL_DATA, keywords: [this.trigger.getKey()] }, function (ob) { var items = BI.map(ob.items, "value"); @@ -105457,7 +105423,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { var self = this, o = this.options; if (!this._count) { o.itemsCreator({ - type: BI.SingleSelectCombo.REQ_GET_DATA_LENGTH + type: BI.SingleSelectInsertCombo.REQ_GET_DATA_LENGTH }, function (res) { self._count = res.count; adjust(); @@ -105471,7 +105437,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { function adjust () { if (self.wants2Quit === true) { - self.fireEvent(BI.SingleSelectCombo.EVENT_CONFIRM); + self.fireEvent(BI.SingleSelectInsertCombo.EVENT_CONFIRM); self.wants2Quit = false; } self.requesting = false; @@ -105525,14 +105491,14 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { } }); -BI.extend(BI.SingleSelectCombo, { +BI.extend(BI.SingleSelectInsertCombo, { REQ_GET_DATA_LENGTH: 0, REQ_GET_ALL_DATA: -1 }); -BI.SingleSelectCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.SingleSelectInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; -BI.shortcut("bi.single_select_add_combo", BI.SingleSelectCombo);/** +BI.shortcut("bi.single_select_insert_combo", BI.SingleSelectInsertCombo);/** * * 单选下拉框 * @class BI.SingleSelectTrigger @@ -108203,8 +108169,8 @@ BI.shortcut("bi.dynamic_year_popup", BI.DynamicYearPopup);BI.DynamicYearTrigger vgap: c.vgap, watermark: BI.i18nText("BI-Basic_Unrestricted"), allowBlank: true, - errorText: function (v) { - return !BI.isPositiveInteger(v) ? BI.i18nText("BI-Please_Input_Positive_Integer") : BI.i18nText("BI-Year_Trigger_Invalid_Text"); + errorText: function () { + return BI.i18nText("BI-Year_Trigger_Invalid_Text"); } }); this.editor.on(BI.SignEditor.EVENT_FOCUS, function () { @@ -108491,9 +108457,9 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear obj = obj || {}; obj.year = obj.year || 0; obj.month = obj.month || 0; - if (BI.checkDateVoid(obj.year, obj.month, 1, o.min, o.max)[0]) { + if (obj.year === 0 || obj.month === 0 || BI.checkDateVoid(obj.year, obj.month, 1, o.min, o.max)[0]) { var year = BI.getDate().getFullYear(); - this.selectedYear = ""; + this.selectedYear = year; this.selectedMonth = ""; this.yearPicker.setValue(year); this.month.setValue(); @@ -108527,6 +108493,9 @@ BI.shortcut("bi.static_year_month_card", BI.StaticYearMonthCard);BI.DynamicYearM max: o.max, value: o.value || "" }); + this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN, function () { + self.combo.isViewVisible() && self.combo.hideView(); + }); this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_START, function () { self.combo.isViewVisible() && self.combo.hideView(); }); @@ -108838,7 +108807,7 @@ BI.DynamicYearMonthPopup = BI.inherit(BI.Widget, { switch (v) { case BI.DynamicYearCombo.Static: var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue()); - self.year.setValue({year: date.getFullYear(), month: date.getMonth()}); + self.year.setValue({year: date.getFullYear(), month: date.getMonth() + 1}); self._setInnerValue(); break; case BI.DynamicYearCombo.Dynamic: @@ -108964,12 +108933,15 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY }, watermark: BI.i18nText("BI-Basic_Unrestricted"), errorText: function (v) { - return !BI.isPositiveInteger(v) ? BI.i18nText("BI-Please_Input_Positive_Integer") : BI.i18nText("BI-Year_Trigger_Invalid_Text"); + return BI.i18nText("BI-Year_Trigger_Invalid_Text"); }, hgap: c.hgap, vgap: c.vgap, allowBlank: true }); + editor.on(BI.SignEditor.EVENT_KEY_DOWN, function () { + self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN); + }); editor.on(BI.SignEditor.EVENT_FOCUS, function () { self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_FOCUS); }); @@ -108981,16 +108953,14 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY if (BI.isNotNull(value)) { editor.setValue(value); } - if (BI.isNotEmptyString(value)) { - var monthValue = self.monthEditor.getValue(); - self.storeValue = { - type: BI.DynamicDateCombo.Static, - value: { - year: self.yearEditor.getValue(), - month: BI.isEmptyString(self.monthEditor.getValue()) ? "" : monthValue - } - }; - } + var monthValue = self.monthEditor.getValue(); + self.storeValue = { + type: BI.DynamicDateCombo.Static, + value: { + year: self.yearEditor.getValue(), + month: BI.isEmptyString(self.monthEditor.getValue()) ? "" : monthValue + } + }; self.setTitle(self._getStaticTitle(self.storeValue.value)); self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_CONFIRM); @@ -109057,8 +109027,8 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY _getStaticTitle: function (value) { value = value || {}; - var yearStr = (BI.isNull(value.year) || BI.isEmptyString(value.year)) ? "" : value.year + "-"; - var monthStr = (BI.isNull(value.month) || BI.isEmptyString(value.month)) ? "" : value.month; + var yearStr = (BI.isNull(value.year) || BI.isEmptyString(value.year)) ? "" : value.year; + var monthStr = (BI.isNull(value.month) || BI.isEmptyString(value.month)) ? "" : "-" + value.month; return yearStr + monthStr; }, @@ -109107,6 +109077,7 @@ BI.DynamicYearMonthTrigger.EVENT_ERROR = "EVENT_ERROR"; BI.DynamicYearMonthTrigger.EVENT_START = "EVENT_START"; BI.DynamicYearMonthTrigger.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.DynamicYearMonthTrigger.EVENT_STOP = "EVENT_STOP"; +BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; BI.shortcut("bi.dynamic_year_month_trigger", BI.DynamicYearMonthTrigger);BI.YearMonthInterval = BI.inherit(BI.Single, { constants: { height: 26, @@ -109461,9 +109432,9 @@ BI.shortcut("bi.dynamic_year_quarter_card", BI.DynamicYearQuarterCard);BI.Static obj = obj || {}; obj.year = obj.year || 0; obj.quarter = obj.quarter || 0; - if (BI.checkDateVoid(obj.year, obj.quarter, 1, o.min, o.max)[0]) { + if (obj.quarter === 0 || obj.year === 0 || BI.checkDateVoid(obj.year, obj.quarter, 1, o.min, o.max)[0]) { var year = BI.getDate().getFullYear(); - this.selectedYear = ""; + this.selectedYear = year; this.selectedQuarter = ""; this.yearPicker.setValue(year); this.quarter.setValue(); @@ -109497,6 +109468,9 @@ BI.shortcut("bi.static_year_quarter_card", BI.StaticYearQuarterCard);BI.DynamicY max: o.max, value: o.value || "" }); + this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN, function () { + self.combo.isViewVisible() && self.combo.hideView(); + }); this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_START, function () { self.combo.isViewVisible() && self.combo.hideView(); }); @@ -109907,13 +109881,16 @@ BI.shortcut("bi.dynamic_year_quarter_popup", BI.DynamicYearQuarterPopup);BI.Dyna return false; }, errorText: function (v) { - return !BI.isPositiveInteger(v) ? BI.i18nText("BI-Please_Input_Positive_Integer") : BI.i18nText("BI-Year_Trigger_Invalid_Text"); + return BI.i18nText("BI-Year_Trigger_Invalid_Text"); }, watermark: BI.i18nText("BI-Basic_Unrestricted"), hgap: c.hgap, vgap: c.vgap, allowBlank: true }); + editor.on(BI.SignEditor.EVENT_KEY_DOWN, function () { + self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN); + }); editor.on(BI.SignEditor.EVENT_FOCUS, function () { self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_FOCUS); }); @@ -109925,16 +109902,14 @@ BI.shortcut("bi.dynamic_year_quarter_popup", BI.DynamicYearQuarterPopup);BI.Dyna if (BI.isNotNull(value)) { editor.setValue(value); } - if (BI.isNotEmptyString(value)) { - var quarterValue = self.quarterEditor.getValue(); - self.storeValue = { - type: BI.DynamicYearQuarterCombo.Static, - value: { - year: self.yearEditor.getValue(), - quarter: BI.isEmptyString(self.quarterEditor.getValue()) ? "" : quarterValue - } - }; - } + var quarterValue = self.quarterEditor.getValue(); + self.storeValue = { + type: BI.DynamicYearQuarterCombo.Static, + value: { + year: self.yearEditor.getValue(), + quarter: BI.isEmptyString(self.quarterEditor.getValue()) ? "" : quarterValue + } + }; self.setTitle(self._getStaticTitle(self.storeValue.value)); self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_CONFIRM); @@ -109974,8 +109949,8 @@ BI.shortcut("bi.dynamic_year_quarter_popup", BI.DynamicYearQuarterPopup);BI.Dyna _getStaticTitle: function (value) { value = value || {}; - var yearStr = (BI.isNull(value.year) || BI.isEmptyString(value.year)) ? "" : value.year + "-"; - var quarterStr = (BI.isNull(value.quarter) || BI.isEmptyString(value.quarter)) ? "" : value.quarter; + var yearStr = (BI.isNull(value.year) || BI.isEmptyString(value.year)) ? "" : value.year; + var quarterStr = (BI.isNull(value.quarter) || BI.isEmptyString(value.quarter)) ? "" : "-" + value.quarter; return yearStr + quarterStr; }, @@ -110033,6 +110008,7 @@ BI.DynamicYearQuarterTrigger.EVENT_ERROR = "EVENT_ERROR"; BI.DynamicYearQuarterTrigger.EVENT_START = "EVENT_START"; BI.DynamicYearQuarterTrigger.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.DynamicYearQuarterTrigger.EVENT_STOP = "EVENT_STOP"; +BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; BI.shortcut("bi.dynamic_year_quarter_trigger", BI.DynamicYearQuarterTrigger);/** * 简单的复选下拉框控件, 适用于数据量少的情况, 与valuechooser的区别是allvaluechooser setValue和getValue返回的是所有值 * 封装了字段处理逻辑 diff --git a/dist/case.js b/dist/case.js index 151ff6fcb5..ee105c13ac 100644 --- a/dist/case.js +++ b/dist/case.js @@ -5288,8 +5288,7 @@ BI.IconCombo = BI.inherit(BI.Widget, { adjustXOffset: 0, adjustYOffset: 0, offsetStyle: "left", - chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, - isShowDown: true + chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE }); }, @@ -5305,8 +5304,7 @@ BI.IconCombo = BI.inherit(BI.Widget, { height: o.height, iconWidth: o.iconWidth, iconHeight: o.iconHeight, - value: o.value, - isShowDown: o.isShowDown + value: o.value }); this.popup = BI.createWidget(o.popup, { type: "bi.icon_combo_popup", @@ -5472,7 +5470,7 @@ BI.IconComboTrigger = BI.inherit(BI.Trigger, { disableSelected: true, cls: "icon-combo-down-icon trigger-triangle-font", width: 12, - height: o.height, + height: 8, selected: BI.isNotEmptyString(iconCls) }); this.down.setVisible(o.isShowDown); diff --git a/dist/fineui.css b/dist/fineui.css index a8fec71565..803e44c43b 100644 --- a/dist/fineui.css +++ b/dist/fineui.css @@ -6039,24 +6039,24 @@ textarea::-webkit-scrollbar-thumb:hover { color: inherit; } .trigger-triangle-font .b-font { - *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); } .trigger-triangle-font .b-font:before { - content: "\e6f0"; + content: "\e64e"; color: #999999; } .trigger-triangle-font:hover .b-font:before, .trigger-triangle-font.hover .b-font:before { - content: "\e6f0"; + content: "\e64e"; color: #999999; } .trigger-triangle-font:active .b-font:before, .trigger-triangle-font.active .b-font:before { - content: "\e6f0"; + content: "\e64e"; color: #3685f2; } .trigger-triangle-font.disabled .b-font:before { - content: "\e6f0"; + content: "\e64e"; color: #999999; } .pull-down-font .b-font { @@ -6167,45 +6167,45 @@ textarea::-webkit-scrollbar-thumb:hover { color: #faaa39; } .less-font .b-font { - *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); } .less-font .b-font:before { - content: "\e75f"; + content: "\e75e"; color: inherit; } .less-font:hover .b-font:before, .less-font.hover .b-font:before { - content: "\e75f"; + content: "\e75e"; color: inherit; } .less-font:active .b-font:before, .less-font.active .b-font:before { - content: "\e75f"; + content: "\e75e"; color: #3f8ce8; } .less-font.disabled .b-font:before { - content: "\e75f"; + content: "\e75e"; color: inherit; } .less-equal-font .b-font { - *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); } .less-equal-font .b-font:before { - content: "\e760"; + content: "\e761"; color: inherit; } .less-equal-font:hover .b-font:before, .less-equal-font.hover .b-font:before { - content: "\e760"; + content: "\e761"; color: inherit; } .less-equal-font:active .b-font:before, .less-equal-font.active .b-font:before { - content: "\e760"; + content: "\e761"; color: #3f8ce8; } .less-equal-font.disabled .b-font:before { - content: "\e760"; + content: "\e761"; color: inherit; } .text-bold-font .b-font { diff --git a/dist/font/iconfont.eot b/dist/font/iconfont.eot index 4b831c55d9..94a8128aa8 100644 Binary files a/dist/font/iconfont.eot and b/dist/font/iconfont.eot differ diff --git a/dist/font/iconfont.svg b/dist/font/iconfont.svg index cde692e9a3..438e4ab5c2 100644 --- a/dist/font/iconfont.svg +++ b/dist/font/iconfont.svg @@ -522,7 +522,7 @@ t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q- - + @@ -531,7 +531,7 @@ t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q- - + @@ -543,7 +543,7 @@ t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q- - + @@ -837,7 +837,7 @@ t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q- - + @@ -924,6 +924,39 @@ t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dist/font/iconfont.ttf b/dist/font/iconfont.ttf index b3f057a3aa..fc77b954ec 100644 Binary files a/dist/font/iconfont.ttf and b/dist/font/iconfont.ttf differ diff --git a/dist/font/iconfont.woff b/dist/font/iconfont.woff index 4610f45f15..2678e8c69b 100644 Binary files a/dist/font/iconfont.woff and b/dist/font/iconfont.woff differ diff --git a/dist/resource.css b/dist/resource.css index b29298149b..765b5eda76 100644 --- a/dist/resource.css +++ b/dist/resource.css @@ -820,24 +820,24 @@ textarea::-webkit-scrollbar-thumb:hover { color: inherit; } .trigger-triangle-font .b-font { - *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); } .trigger-triangle-font .b-font:before { - content: "\e6f0"; + content: "\e64e"; color: #999999; } .trigger-triangle-font:hover .b-font:before, .trigger-triangle-font.hover .b-font:before { - content: "\e6f0"; + content: "\e64e"; color: #999999; } .trigger-triangle-font:active .b-font:before, .trigger-triangle-font.active .b-font:before { - content: "\e6f0"; + content: "\e64e"; color: #3685f2; } .trigger-triangle-font.disabled .b-font:before { - content: "\e6f0"; + content: "\e64e"; color: #999999; } .pull-down-font .b-font { @@ -948,45 +948,45 @@ textarea::-webkit-scrollbar-thumb:hover { color: #faaa39; } .less-font .b-font { - *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); } .less-font .b-font:before { - content: "\e75f"; + content: "\e75e"; color: inherit; } .less-font:hover .b-font:before, .less-font.hover .b-font:before { - content: "\e75f"; + content: "\e75e"; color: inherit; } .less-font:active .b-font:before, .less-font.active .b-font:before { - content: "\e75f"; + content: "\e75e"; color: #3f8ce8; } .less-font.disabled .b-font:before { - content: "\e75f"; + content: "\e75e"; color: inherit; } .less-equal-font .b-font { - *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); } .less-equal-font .b-font:before { - content: "\e760"; + content: "\e761"; color: inherit; } .less-equal-font:hover .b-font:before, .less-equal-font.hover .b-font:before { - content: "\e760"; + content: "\e761"; color: inherit; } .less-equal-font:active .b-font:before, .less-equal-font.active .b-font:before { - content: "\e760"; + content: "\e761"; color: #3f8ce8; } .less-equal-font.disabled .b-font:before { - content: "\e760"; + content: "\e761"; color: inherit; } .text-bold-font .b-font { diff --git a/dist/widget.js b/dist/widget.js index 1c4292c724..4796f32a45 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -3772,7 +3772,8 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger break; case this._const.yearMonthLength: case this._const.yearFullMonthLength: - if (this._monthCheck(v)) { + var splitMonth = v.split("-")[1]; + if ((BI.isNotNull(splitMonth) && splitMonth.length === 2) || this._monthCheck(v)) { this.editor.setValue(v + "-"); } break; @@ -4711,7 +4712,9 @@ BI.extend(BI.DynamicDateTimeSelect, { } break; case this._const.yearMonthLength: - if (this._monthCheck(v)) { + case this._const.yearFullMonthLength: + var splitMonth = v.split("-")[1]; + if ((BI.isNotNull(splitMonth) && splitMonth.length === 2) || this._monthCheck(v)) { this.editor.setValue(v + "-"); } break; @@ -13435,7 +13438,6 @@ BI.NumberInterval = BI.inherit(BI.Single, { type: "bi.icon_combo", cls: "number-interval-small-combo bi-border", height: o.height - 2, - isShowDown: false, items: [{ text: "(" + BI.i18nText("BI-Less_Than") + ")", iconCls: "less-font", @@ -13454,7 +13456,6 @@ BI.NumberInterval = BI.inherit(BI.Single, { this.bigCombo = BI.createWidget({ type: "bi.icon_combo", cls: "number-interval-big-combo bi-border", - isShowDown: false, height: o.height - 2, items: [{ text: "(" + BI.i18nText("BI-Less_Than") + ")", @@ -16489,19 +16490,9 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { self.storeValue = this.getValue(); self._adjust(function () { assertShowValue(); + self._defaultState(); }); } - }, { - eventName: BI.SingleSelectPopupView.EVENT_CLICK_CONFIRM, - action: function () { - self._defaultState(); - } - }, { - eventName: BI.SingleSelectPopupView.EVENT_CLICK_CLEAR, - action: function () { - self.setValue(); - self._defaultState(); - } }], itemsCreator: o.itemsCreator, valueFormatter: o.valueFormatter, @@ -17039,13 +17030,12 @@ BI.SingleSelectPopupView = BI.inherit(BI.Widget, { }); this.popupView = BI.createWidget({ - type: "bi.multi_popup_view", + type: "bi.popup_view", stopPropagation: false, maxWidth: opts.maxWidth, minWidth: opts.minWidth, maxHeight: opts.maxHeight, element: this, - buttons: [BI.i18nText("BI-Basic_Clears"), BI.i18nText("BI-Basic_Sure")], el: this.loader, value: opts.value }); @@ -17053,16 +17043,6 @@ BI.SingleSelectPopupView = BI.inherit(BI.Widget, { this.popupView.on(BI.MultiPopupView.EVENT_CHANGE, function () { self.fireEvent(BI.SingleSelectPopupView.EVENT_CHANGE); }); - this.popupView.on(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON, function (index) { - switch (index) { - case 0: - self.fireEvent(BI.SingleSelectPopupView.EVENT_CLICK_CLEAR); - break; - case 1: - self.fireEvent(BI.SingleSelectPopupView.EVENT_CLICK_CONFIRM); - break; - } - }); }, setStartValue: function (v) { @@ -17091,8 +17071,6 @@ BI.SingleSelectPopupView = BI.inherit(BI.Widget, { }); BI.SingleSelectPopupView.EVENT_CHANGE = "EVENT_CHANGE"; -BI.SingleSelectPopupView.EVENT_CLICK_CONFIRM = "EVENT_CLICK_CONFIRM"; -BI.SingleSelectPopupView.EVENT_CLICK_CLEAR = "EVENT_CLICK_CLEAR"; BI.shortcut("bi.single_select_popup_view", BI.SingleSelectPopupView);/** @@ -18023,13 +18001,13 @@ BI.SingleSelectSearchPane.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.single_select_search_add_pane", BI.SingleSelectSearchPane);/** * - * @class BI.SingleSelectCombo + * @class BI.SingleSelectInsertCombo * @extends BI.Single */ -BI.SingleSelectCombo = BI.inherit(BI.Single, { +BI.SingleSelectInsertCombo = BI.inherit(BI.Single, { _defaultConfig: function () { - return BI.extend(BI.SingleSelectCombo.superclass._defaultConfig.apply(this, arguments), { + return BI.extend(BI.SingleSelectInsertCombo.superclass._defaultConfig.apply(this, arguments), { baseCls: "bi-single-select-combo", itemsCreator: BI.emptyFn, valueFormatter: BI.emptyFn, @@ -18038,7 +18016,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { }, _init: function () { - BI.SingleSelectCombo.superclass._init.apply(this, arguments); + BI.SingleSelectInsertCombo.superclass._init.apply(this, arguments); var self = this, o = this.options; var assertShowValue = function () { @@ -18140,19 +18118,9 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { self.storeValue = this.getValue(); self._adjust(function () { assertShowValue(); + self._defaultState(); }); } - }, { - eventName: BI.SingleSelectPopupView.EVENT_CLICK_CONFIRM, - action: function () { - self._defaultState(); - } - }, { - eventName: BI.SingleSelectPopupView.EVENT_CLICK_CLEAR, - action: function () { - self.setValue(); - self._defaultState(); - } }], itemsCreator: o.itemsCreator, valueFormatter: o.valueFormatter, @@ -18183,7 +18151,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { if (self.requesting === true) { self.wants2Quit = true; } else { - self.fireEvent(BI.SingleSelectCombo.EVENT_CONFIRM); + self.fireEvent(BI.SingleSelectInsertCombo.EVENT_CONFIRM); } }); @@ -18236,7 +18204,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { this._assertValue(this.storeValue); this.requesting = true; o.itemsCreator({ - type: BI.SingleSelectCombo.REQ_GET_ALL_DATA, + type: BI.SingleSelectInsertCombo.REQ_GET_ALL_DATA, keywords: keywords }, function (ob) { var values = BI.map(ob.items, "value"); @@ -18259,7 +18227,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { this._assertValue(res); this.requesting = true; o.itemsCreator({ - type: BI.SingleSelectCombo.REQ_GET_ALL_DATA, + type: BI.SingleSelectInsertCombo.REQ_GET_ALL_DATA, keywords: [this.trigger.getKey()] }, function (ob) { var items = BI.map(ob.items, "value"); @@ -18296,7 +18264,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { var self = this, o = this.options; if (!this._count) { o.itemsCreator({ - type: BI.SingleSelectCombo.REQ_GET_DATA_LENGTH + type: BI.SingleSelectInsertCombo.REQ_GET_DATA_LENGTH }, function (res) { self._count = res.count; adjust(); @@ -18310,7 +18278,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { function adjust () { if (self.wants2Quit === true) { - self.fireEvent(BI.SingleSelectCombo.EVENT_CONFIRM); + self.fireEvent(BI.SingleSelectInsertCombo.EVENT_CONFIRM); self.wants2Quit = false; } self.requesting = false; @@ -18364,14 +18332,14 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { } }); -BI.extend(BI.SingleSelectCombo, { +BI.extend(BI.SingleSelectInsertCombo, { REQ_GET_DATA_LENGTH: 0, REQ_GET_ALL_DATA: -1 }); -BI.SingleSelectCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.SingleSelectInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; -BI.shortcut("bi.single_select_add_combo", BI.SingleSelectCombo);/** +BI.shortcut("bi.single_select_insert_combo", BI.SingleSelectInsertCombo);/** * * 单选下拉框 * @class BI.SingleSelectTrigger @@ -21042,8 +21010,8 @@ BI.shortcut("bi.dynamic_year_popup", BI.DynamicYearPopup);BI.DynamicYearTrigger vgap: c.vgap, watermark: BI.i18nText("BI-Basic_Unrestricted"), allowBlank: true, - errorText: function (v) { - return !BI.isPositiveInteger(v) ? BI.i18nText("BI-Please_Input_Positive_Integer") : BI.i18nText("BI-Year_Trigger_Invalid_Text"); + errorText: function () { + return BI.i18nText("BI-Year_Trigger_Invalid_Text"); } }); this.editor.on(BI.SignEditor.EVENT_FOCUS, function () { @@ -21330,9 +21298,9 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear obj = obj || {}; obj.year = obj.year || 0; obj.month = obj.month || 0; - if (BI.checkDateVoid(obj.year, obj.month, 1, o.min, o.max)[0]) { + if (obj.year === 0 || obj.month === 0 || BI.checkDateVoid(obj.year, obj.month, 1, o.min, o.max)[0]) { var year = BI.getDate().getFullYear(); - this.selectedYear = ""; + this.selectedYear = year; this.selectedMonth = ""; this.yearPicker.setValue(year); this.month.setValue(); @@ -21366,6 +21334,9 @@ BI.shortcut("bi.static_year_month_card", BI.StaticYearMonthCard);BI.DynamicYearM max: o.max, value: o.value || "" }); + this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN, function () { + self.combo.isViewVisible() && self.combo.hideView(); + }); this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_START, function () { self.combo.isViewVisible() && self.combo.hideView(); }); @@ -21677,7 +21648,7 @@ BI.DynamicYearMonthPopup = BI.inherit(BI.Widget, { switch (v) { case BI.DynamicYearCombo.Static: var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue()); - self.year.setValue({year: date.getFullYear(), month: date.getMonth()}); + self.year.setValue({year: date.getFullYear(), month: date.getMonth() + 1}); self._setInnerValue(); break; case BI.DynamicYearCombo.Dynamic: @@ -21803,12 +21774,15 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY }, watermark: BI.i18nText("BI-Basic_Unrestricted"), errorText: function (v) { - return !BI.isPositiveInteger(v) ? BI.i18nText("BI-Please_Input_Positive_Integer") : BI.i18nText("BI-Year_Trigger_Invalid_Text"); + return BI.i18nText("BI-Year_Trigger_Invalid_Text"); }, hgap: c.hgap, vgap: c.vgap, allowBlank: true }); + editor.on(BI.SignEditor.EVENT_KEY_DOWN, function () { + self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN); + }); editor.on(BI.SignEditor.EVENT_FOCUS, function () { self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_FOCUS); }); @@ -21820,16 +21794,14 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY if (BI.isNotNull(value)) { editor.setValue(value); } - if (BI.isNotEmptyString(value)) { - var monthValue = self.monthEditor.getValue(); - self.storeValue = { - type: BI.DynamicDateCombo.Static, - value: { - year: self.yearEditor.getValue(), - month: BI.isEmptyString(self.monthEditor.getValue()) ? "" : monthValue - } - }; - } + var monthValue = self.monthEditor.getValue(); + self.storeValue = { + type: BI.DynamicDateCombo.Static, + value: { + year: self.yearEditor.getValue(), + month: BI.isEmptyString(self.monthEditor.getValue()) ? "" : monthValue + } + }; self.setTitle(self._getStaticTitle(self.storeValue.value)); self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_CONFIRM); @@ -21896,8 +21868,8 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY _getStaticTitle: function (value) { value = value || {}; - var yearStr = (BI.isNull(value.year) || BI.isEmptyString(value.year)) ? "" : value.year + "-"; - var monthStr = (BI.isNull(value.month) || BI.isEmptyString(value.month)) ? "" : value.month; + var yearStr = (BI.isNull(value.year) || BI.isEmptyString(value.year)) ? "" : value.year; + var monthStr = (BI.isNull(value.month) || BI.isEmptyString(value.month)) ? "" : "-" + value.month; return yearStr + monthStr; }, @@ -21946,6 +21918,7 @@ BI.DynamicYearMonthTrigger.EVENT_ERROR = "EVENT_ERROR"; BI.DynamicYearMonthTrigger.EVENT_START = "EVENT_START"; BI.DynamicYearMonthTrigger.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.DynamicYearMonthTrigger.EVENT_STOP = "EVENT_STOP"; +BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; BI.shortcut("bi.dynamic_year_month_trigger", BI.DynamicYearMonthTrigger);BI.YearMonthInterval = BI.inherit(BI.Single, { constants: { height: 26, @@ -22300,9 +22273,9 @@ BI.shortcut("bi.dynamic_year_quarter_card", BI.DynamicYearQuarterCard);BI.Static obj = obj || {}; obj.year = obj.year || 0; obj.quarter = obj.quarter || 0; - if (BI.checkDateVoid(obj.year, obj.quarter, 1, o.min, o.max)[0]) { + if (obj.quarter === 0 || obj.year === 0 || BI.checkDateVoid(obj.year, obj.quarter, 1, o.min, o.max)[0]) { var year = BI.getDate().getFullYear(); - this.selectedYear = ""; + this.selectedYear = year; this.selectedQuarter = ""; this.yearPicker.setValue(year); this.quarter.setValue(); @@ -22336,6 +22309,9 @@ BI.shortcut("bi.static_year_quarter_card", BI.StaticYearQuarterCard);BI.DynamicY max: o.max, value: o.value || "" }); + this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN, function () { + self.combo.isViewVisible() && self.combo.hideView(); + }); this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_START, function () { self.combo.isViewVisible() && self.combo.hideView(); }); @@ -22746,13 +22722,16 @@ BI.shortcut("bi.dynamic_year_quarter_popup", BI.DynamicYearQuarterPopup);BI.Dyna return false; }, errorText: function (v) { - return !BI.isPositiveInteger(v) ? BI.i18nText("BI-Please_Input_Positive_Integer") : BI.i18nText("BI-Year_Trigger_Invalid_Text"); + return BI.i18nText("BI-Year_Trigger_Invalid_Text"); }, watermark: BI.i18nText("BI-Basic_Unrestricted"), hgap: c.hgap, vgap: c.vgap, allowBlank: true }); + editor.on(BI.SignEditor.EVENT_KEY_DOWN, function () { + self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN); + }); editor.on(BI.SignEditor.EVENT_FOCUS, function () { self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_FOCUS); }); @@ -22764,16 +22743,14 @@ BI.shortcut("bi.dynamic_year_quarter_popup", BI.DynamicYearQuarterPopup);BI.Dyna if (BI.isNotNull(value)) { editor.setValue(value); } - if (BI.isNotEmptyString(value)) { - var quarterValue = self.quarterEditor.getValue(); - self.storeValue = { - type: BI.DynamicYearQuarterCombo.Static, - value: { - year: self.yearEditor.getValue(), - quarter: BI.isEmptyString(self.quarterEditor.getValue()) ? "" : quarterValue - } - }; - } + var quarterValue = self.quarterEditor.getValue(); + self.storeValue = { + type: BI.DynamicYearQuarterCombo.Static, + value: { + year: self.yearEditor.getValue(), + quarter: BI.isEmptyString(self.quarterEditor.getValue()) ? "" : quarterValue + } + }; self.setTitle(self._getStaticTitle(self.storeValue.value)); self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_CONFIRM); @@ -22813,8 +22790,8 @@ BI.shortcut("bi.dynamic_year_quarter_popup", BI.DynamicYearQuarterPopup);BI.Dyna _getStaticTitle: function (value) { value = value || {}; - var yearStr = (BI.isNull(value.year) || BI.isEmptyString(value.year)) ? "" : value.year + "-"; - var quarterStr = (BI.isNull(value.quarter) || BI.isEmptyString(value.quarter)) ? "" : value.quarter; + var yearStr = (BI.isNull(value.year) || BI.isEmptyString(value.year)) ? "" : value.year; + var quarterStr = (BI.isNull(value.quarter) || BI.isEmptyString(value.quarter)) ? "" : "-" + value.quarter; return yearStr + quarterStr; }, @@ -22872,6 +22849,7 @@ BI.DynamicYearQuarterTrigger.EVENT_ERROR = "EVENT_ERROR"; BI.DynamicYearQuarterTrigger.EVENT_START = "EVENT_START"; BI.DynamicYearQuarterTrigger.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.DynamicYearQuarterTrigger.EVENT_STOP = "EVENT_STOP"; +BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; BI.shortcut("bi.dynamic_year_quarter_trigger", BI.DynamicYearQuarterTrigger);/** * 简单的复选下拉框控件, 适用于数据量少的情况, 与valuechooser的区别是allvaluechooser setValue和getValue返回的是所有值 * 封装了字段处理逻辑 diff --git a/public/css/font.css b/public/css/font.css index da93ad8cdf..8838c6cdad 100644 --- a/public/css/font.css +++ b/public/css/font.css @@ -499,24 +499,24 @@ color: inherit; } .trigger-triangle-font .b-font { - *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); } .trigger-triangle-font .b-font:before { - content: "\e6f0"; + content: "\e64e"; color: #999999; } .trigger-triangle-font:hover .b-font:before, .trigger-triangle-font.hover .b-font:before { - content: "\e6f0"; + content: "\e64e"; color: #999999; } .trigger-triangle-font:active .b-font:before, .trigger-triangle-font.active .b-font:before { - content: "\e6f0"; + content: "\e64e"; color: #3685f2; } .trigger-triangle-font.disabled .b-font:before { - content: "\e6f0"; + content: "\e64e"; color: #999999; } .pull-down-font .b-font { @@ -627,45 +627,45 @@ color: #faaa39; } .less-font .b-font { - *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); } .less-font .b-font:before { - content: "\e75f"; + content: "\e75e"; color: inherit; } .less-font:hover .b-font:before, .less-font.hover .b-font:before { - content: "\e75f"; + content: "\e75e"; color: inherit; } .less-font:active .b-font:before, .less-font.active .b-font:before { - content: "\e75f"; + content: "\e75e"; color: #3f8ce8; } .less-font.disabled .b-font:before { - content: "\e75f"; + content: "\e75e"; color: inherit; } .less-equal-font .b-font { - *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); } .less-equal-font .b-font:before { - content: "\e760"; + content: "\e761"; color: inherit; } .less-equal-font:hover .b-font:before, .less-equal-font.hover .b-font:before { - content: "\e760"; + content: "\e761"; color: inherit; } .less-equal-font:active .b-font:before, .less-equal-font.active .b-font:before { - content: "\e760"; + content: "\e761"; color: #3f8ce8; } .less-equal-font.disabled .b-font:before { - content: "\e760"; + content: "\e761"; color: inherit; } .text-bold-font .b-font { diff --git a/src/case/combo/iconcombo/combo.icon.js b/src/case/combo/iconcombo/combo.icon.js index 040e9e1a81..84185a4f8e 100644 --- a/src/case/combo/iconcombo/combo.icon.js +++ b/src/case/combo/iconcombo/combo.icon.js @@ -20,8 +20,7 @@ BI.IconCombo = BI.inherit(BI.Widget, { adjustXOffset: 0, adjustYOffset: 0, offsetStyle: "left", - chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, - isShowDown: true + chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE }); }, @@ -37,8 +36,7 @@ BI.IconCombo = BI.inherit(BI.Widget, { height: o.height, iconWidth: o.iconWidth, iconHeight: o.iconHeight, - value: o.value, - isShowDown: o.isShowDown + value: o.value }); this.popup = BI.createWidget(o.popup, { type: "bi.icon_combo_popup", diff --git a/src/case/combo/iconcombo/trigger.iconcombo.js b/src/case/combo/iconcombo/trigger.iconcombo.js index 3529d1bc02..7d1c4431ac 100644 --- a/src/case/combo/iconcombo/trigger.iconcombo.js +++ b/src/case/combo/iconcombo/trigger.iconcombo.js @@ -41,7 +41,7 @@ BI.IconComboTrigger = BI.inherit(BI.Trigger, { disableSelected: true, cls: "icon-combo-down-icon trigger-triangle-font", width: 12, - height: o.height, + height: 8, selected: BI.isNotEmptyString(iconCls) }); this.down.setVisible(o.isShowDown); diff --git a/src/css/resource/font.css b/src/css/resource/font.css index d5d59fcbe6..3ab1bb65cf 100644 --- a/src/css/resource/font.css +++ b/src/css/resource/font.css @@ -499,24 +499,24 @@ color: inherit; } .trigger-triangle-font .b-font { - *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); } .trigger-triangle-font .b-font:before { - content: "\e6f0"; + content: "\e64e"; color: #999999; } .trigger-triangle-font:hover .b-font:before, .trigger-triangle-font.hover .b-font:before { - content: "\e6f0"; + content: "\e64e"; color: #999999; } .trigger-triangle-font:active .b-font:before, .trigger-triangle-font.active .b-font:before { - content: "\e6f0"; + content: "\e64e"; color: #3685f2; } .trigger-triangle-font.disabled .b-font:before { - content: "\e6f0"; + content: "\e64e"; color: #999999; } .pull-down-font .b-font { @@ -627,45 +627,45 @@ color: #faaa39; } .less-font .b-font { - *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); } .less-font .b-font:before { - content: "\e75f"; + content: "\e75e"; color: inherit; } .less-font:hover .b-font:before, .less-font.hover .b-font:before { - content: "\e75f"; + content: "\e75e"; color: inherit; } .less-font:active .b-font:before, .less-font.active .b-font:before { - content: "\e75f"; + content: "\e75e"; color: #3f8ce8; } .less-font.disabled .b-font:before { - content: "\e75f"; + content: "\e75e"; color: inherit; } .less-equal-font .b-font { - *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); } .less-equal-font .b-font:before { - content: "\e760"; + content: "\e761"; color: inherit; } .less-equal-font:hover .b-font:before, .less-equal-font.hover .b-font:before { - content: "\e760"; + content: "\e761"; color: inherit; } .less-equal-font:active .b-font:before, .less-equal-font.active .b-font:before { - content: "\e760"; + content: "\e761"; color: #3f8ce8; } .less-equal-font.disabled .b-font:before { - content: "\e760"; + content: "\e761"; color: inherit; } .text-bold-font .b-font { diff --git a/src/less/lib/font.less b/src/less/lib/font.less index e3ae6bf281..bc9236a93e 100644 --- a/src/less/lib/font.less +++ b/src/less/lib/font.less @@ -18,9 +18,9 @@ @font-arrow-right: "e70c"; @font-change: "e72f"; @font-dot: "e762"; -@font-no-sort-no-filter: "e6f0"; -@font-less: "e75f"; -@font-less-equal: "e760"; +@font-no-sort-no-filter: "e64e"; +@font-less: "e75e"; +@font-less-equal: "e761"; @font-bold: "e75b"; @font-italic: "e75c"; diff --git a/src/widget/dynamicdate/dynamicdate.trigger.js b/src/widget/dynamicdate/dynamicdate.trigger.js index d14b80caa1..733e2a144b 100644 --- a/src/widget/dynamicdate/dynamicdate.trigger.js +++ b/src/widget/dynamicdate/dynamicdate.trigger.js @@ -119,7 +119,8 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, { break; case this._const.yearMonthLength: case this._const.yearFullMonthLength: - if (this._monthCheck(v)) { + var splitMonth = v.split("-")[1]; + if ((BI.isNotNull(splitMonth) && splitMonth.length === 2) || this._monthCheck(v)) { this.editor.setValue(v + "-"); } break; diff --git a/src/widget/dynamicdatetime/dynamicdatetime.trigger.js b/src/widget/dynamicdatetime/dynamicdatetime.trigger.js index 7f53564a9b..fa15aee1ce 100644 --- a/src/widget/dynamicdatetime/dynamicdatetime.trigger.js +++ b/src/widget/dynamicdatetime/dynamicdatetime.trigger.js @@ -121,7 +121,9 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, { } break; case this._const.yearMonthLength: - if (this._monthCheck(v)) { + case this._const.yearFullMonthLength: + var splitMonth = v.split("-")[1]; + if ((BI.isNotNull(splitMonth) && splitMonth.length === 2) || this._monthCheck(v)) { this.editor.setValue(v + "-"); } break; diff --git a/src/widget/numberinterval/numberinterval.js b/src/widget/numberinterval/numberinterval.js index 0f3cfcc137..b7abef11f1 100644 --- a/src/widget/numberinterval/numberinterval.js +++ b/src/widget/numberinterval/numberinterval.js @@ -123,7 +123,6 @@ BI.NumberInterval = BI.inherit(BI.Single, { type: "bi.icon_combo", cls: "number-interval-small-combo bi-border", height: o.height - 2, - isShowDown: false, items: [{ text: "(" + BI.i18nText("BI-Less_Than") + ")", iconCls: "less-font", @@ -142,7 +141,6 @@ BI.NumberInterval = BI.inherit(BI.Single, { this.bigCombo = BI.createWidget({ type: "bi.icon_combo", cls: "number-interval-big-combo bi-border", - isShowDown: false, height: o.height - 2, items: [{ text: "(" + BI.i18nText("BI-Less_Than") + ")", diff --git a/src/widget/singleselect/singleselect.combo.js b/src/widget/singleselect/singleselect.combo.js index d556ee45d3..ecd8d37d12 100644 --- a/src/widget/singleselect/singleselect.combo.js +++ b/src/widget/singleselect/singleselect.combo.js @@ -118,19 +118,9 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { self.storeValue = this.getValue(); self._adjust(function () { assertShowValue(); + self._defaultState(); }); } - }, { - eventName: BI.SingleSelectPopupView.EVENT_CLICK_CONFIRM, - action: function () { - self._defaultState(); - } - }, { - eventName: BI.SingleSelectPopupView.EVENT_CLICK_CLEAR, - action: function () { - self.setValue(); - self._defaultState(); - } }], itemsCreator: o.itemsCreator, valueFormatter: o.valueFormatter, diff --git a/src/widget/singleselect/singleselect.popup.view.js b/src/widget/singleselect/singleselect.popup.view.js index 5d33b8c9bc..a29164ba2f 100644 --- a/src/widget/singleselect/singleselect.popup.view.js +++ b/src/widget/singleselect/singleselect.popup.view.js @@ -30,13 +30,12 @@ BI.SingleSelectPopupView = BI.inherit(BI.Widget, { }); this.popupView = BI.createWidget({ - type: "bi.multi_popup_view", + type: "bi.popup_view", stopPropagation: false, maxWidth: opts.maxWidth, minWidth: opts.minWidth, maxHeight: opts.maxHeight, element: this, - buttons: [BI.i18nText("BI-Basic_Clears"), BI.i18nText("BI-Basic_Sure")], el: this.loader, value: opts.value }); @@ -44,16 +43,6 @@ BI.SingleSelectPopupView = BI.inherit(BI.Widget, { this.popupView.on(BI.MultiPopupView.EVENT_CHANGE, function () { self.fireEvent(BI.SingleSelectPopupView.EVENT_CHANGE); }); - this.popupView.on(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON, function (index) { - switch (index) { - case 0: - self.fireEvent(BI.SingleSelectPopupView.EVENT_CLICK_CLEAR); - break; - case 1: - self.fireEvent(BI.SingleSelectPopupView.EVENT_CLICK_CONFIRM); - break; - } - }); }, setStartValue: function (v) { @@ -82,8 +71,6 @@ BI.SingleSelectPopupView = BI.inherit(BI.Widget, { }); BI.SingleSelectPopupView.EVENT_CHANGE = "EVENT_CHANGE"; -BI.SingleSelectPopupView.EVENT_CLICK_CONFIRM = "EVENT_CLICK_CONFIRM"; -BI.SingleSelectPopupView.EVENT_CLICK_CLEAR = "EVENT_CLICK_CLEAR"; BI.shortcut("bi.single_select_popup_view", BI.SingleSelectPopupView); \ No newline at end of file diff --git a/src/widget/singleselectaddsearch/singleselect.combo.js b/src/widget/singleselectaddsearch/singleselect.combo.js index 6280e67638..c0abdf60dc 100644 --- a/src/widget/singleselectaddsearch/singleselect.combo.js +++ b/src/widget/singleselectaddsearch/singleselect.combo.js @@ -1,12 +1,12 @@ /** * - * @class BI.SingleSelectCombo + * @class BI.SingleSelectInsertCombo * @extends BI.Single */ -BI.SingleSelectCombo = BI.inherit(BI.Single, { +BI.SingleSelectInsertCombo = BI.inherit(BI.Single, { _defaultConfig: function () { - return BI.extend(BI.SingleSelectCombo.superclass._defaultConfig.apply(this, arguments), { + return BI.extend(BI.SingleSelectInsertCombo.superclass._defaultConfig.apply(this, arguments), { baseCls: "bi-single-select-combo", itemsCreator: BI.emptyFn, valueFormatter: BI.emptyFn, @@ -15,7 +15,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { }, _init: function () { - BI.SingleSelectCombo.superclass._init.apply(this, arguments); + BI.SingleSelectInsertCombo.superclass._init.apply(this, arguments); var self = this, o = this.options; var assertShowValue = function () { @@ -117,19 +117,9 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { self.storeValue = this.getValue(); self._adjust(function () { assertShowValue(); + self._defaultState(); }); } - }, { - eventName: BI.SingleSelectPopupView.EVENT_CLICK_CONFIRM, - action: function () { - self._defaultState(); - } - }, { - eventName: BI.SingleSelectPopupView.EVENT_CLICK_CLEAR, - action: function () { - self.setValue(); - self._defaultState(); - } }], itemsCreator: o.itemsCreator, valueFormatter: o.valueFormatter, @@ -160,7 +150,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { if (self.requesting === true) { self.wants2Quit = true; } else { - self.fireEvent(BI.SingleSelectCombo.EVENT_CONFIRM); + self.fireEvent(BI.SingleSelectInsertCombo.EVENT_CONFIRM); } }); @@ -213,7 +203,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { this._assertValue(this.storeValue); this.requesting = true; o.itemsCreator({ - type: BI.SingleSelectCombo.REQ_GET_ALL_DATA, + type: BI.SingleSelectInsertCombo.REQ_GET_ALL_DATA, keywords: keywords }, function (ob) { var values = BI.map(ob.items, "value"); @@ -236,7 +226,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { this._assertValue(res); this.requesting = true; o.itemsCreator({ - type: BI.SingleSelectCombo.REQ_GET_ALL_DATA, + type: BI.SingleSelectInsertCombo.REQ_GET_ALL_DATA, keywords: [this.trigger.getKey()] }, function (ob) { var items = BI.map(ob.items, "value"); @@ -273,7 +263,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { var self = this, o = this.options; if (!this._count) { o.itemsCreator({ - type: BI.SingleSelectCombo.REQ_GET_DATA_LENGTH + type: BI.SingleSelectInsertCombo.REQ_GET_DATA_LENGTH }, function (res) { self._count = res.count; adjust(); @@ -287,7 +277,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { function adjust () { if (self.wants2Quit === true) { - self.fireEvent(BI.SingleSelectCombo.EVENT_CONFIRM); + self.fireEvent(BI.SingleSelectInsertCombo.EVENT_CONFIRM); self.wants2Quit = false; } self.requesting = false; @@ -341,11 +331,11 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { } }); -BI.extend(BI.SingleSelectCombo, { +BI.extend(BI.SingleSelectInsertCombo, { REQ_GET_DATA_LENGTH: 0, REQ_GET_ALL_DATA: -1 }); -BI.SingleSelectCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.SingleSelectInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; -BI.shortcut("bi.single_select_add_combo", BI.SingleSelectCombo); \ No newline at end of file +BI.shortcut("bi.single_select_insert_combo", BI.SingleSelectInsertCombo); \ No newline at end of file diff --git a/src/widget/year/trigger.year.js b/src/widget/year/trigger.year.js index ac30fedf16..6b7b958de2 100644 --- a/src/widget/year/trigger.year.js +++ b/src/widget/year/trigger.year.js @@ -28,8 +28,8 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, { vgap: c.vgap, watermark: BI.i18nText("BI-Basic_Unrestricted"), allowBlank: true, - errorText: function (v) { - return !BI.isPositiveInteger(v) ? BI.i18nText("BI-Please_Input_Positive_Integer") : BI.i18nText("BI-Year_Trigger_Invalid_Text"); + errorText: function () { + return BI.i18nText("BI-Year_Trigger_Invalid_Text"); } }); this.editor.on(BI.SignEditor.EVENT_FOCUS, function () { diff --git a/src/widget/yearmonth/card.static.yearmonth.js b/src/widget/yearmonth/card.static.yearmonth.js index f665fa6610..d208ba6d20 100644 --- a/src/widget/yearmonth/card.static.yearmonth.js +++ b/src/widget/yearmonth/card.static.yearmonth.js @@ -98,9 +98,9 @@ BI.StaticYearMonthCard = BI.inherit(BI.Widget, { obj = obj || {}; obj.year = obj.year || 0; obj.month = obj.month || 0; - if (BI.checkDateVoid(obj.year, obj.month, 1, o.min, o.max)[0]) { + if (obj.year === 0 || obj.month === 0 || BI.checkDateVoid(obj.year, obj.month, 1, o.min, o.max)[0]) { var year = BI.getDate().getFullYear(); - this.selectedYear = ""; + this.selectedYear = year; this.selectedMonth = ""; this.yearPicker.setValue(year); this.month.setValue(); diff --git a/src/widget/yearmonth/combo.yearmonth.js b/src/widget/yearmonth/combo.yearmonth.js index 90d693a192..a0d47d3527 100644 --- a/src/widget/yearmonth/combo.yearmonth.js +++ b/src/widget/yearmonth/combo.yearmonth.js @@ -19,6 +19,9 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { max: o.max, value: o.value || "" }); + this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN, function () { + self.combo.isViewVisible() && self.combo.hideView(); + }); this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_START, function () { self.combo.isViewVisible() && self.combo.hideView(); }); diff --git a/src/widget/yearmonth/popup.yearmonth.js b/src/widget/yearmonth/popup.yearmonth.js index 86e98d340d..067a66844b 100644 --- a/src/widget/yearmonth/popup.yearmonth.js +++ b/src/widget/yearmonth/popup.yearmonth.js @@ -149,7 +149,7 @@ BI.DynamicYearMonthPopup = BI.inherit(BI.Widget, { switch (v) { case BI.DynamicYearCombo.Static: var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue()); - self.year.setValue({year: date.getFullYear(), month: date.getMonth()}); + self.year.setValue({year: date.getFullYear(), month: date.getMonth() + 1}); self._setInnerValue(); break; case BI.DynamicYearCombo.Dynamic: diff --git a/src/widget/yearmonth/trigger.yearmonth.js b/src/widget/yearmonth/trigger.yearmonth.js index 534c7e568a..c58f3f6229 100644 --- a/src/widget/yearmonth/trigger.yearmonth.js +++ b/src/widget/yearmonth/trigger.yearmonth.js @@ -70,12 +70,15 @@ BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, { }, watermark: BI.i18nText("BI-Basic_Unrestricted"), errorText: function (v) { - return !BI.isPositiveInteger(v) ? BI.i18nText("BI-Please_Input_Positive_Integer") : BI.i18nText("BI-Year_Trigger_Invalid_Text"); + return BI.i18nText("BI-Year_Trigger_Invalid_Text"); }, hgap: c.hgap, vgap: c.vgap, allowBlank: true }); + editor.on(BI.SignEditor.EVENT_KEY_DOWN, function () { + self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN); + }); editor.on(BI.SignEditor.EVENT_FOCUS, function () { self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_FOCUS); }); @@ -87,16 +90,14 @@ BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, { if (BI.isNotNull(value)) { editor.setValue(value); } - if (BI.isNotEmptyString(value)) { - var monthValue = self.monthEditor.getValue(); - self.storeValue = { - type: BI.DynamicDateCombo.Static, - value: { - year: self.yearEditor.getValue(), - month: BI.isEmptyString(self.monthEditor.getValue()) ? "" : monthValue - } - }; - } + var monthValue = self.monthEditor.getValue(); + self.storeValue = { + type: BI.DynamicDateCombo.Static, + value: { + year: self.yearEditor.getValue(), + month: BI.isEmptyString(self.monthEditor.getValue()) ? "" : monthValue + } + }; self.setTitle(self._getStaticTitle(self.storeValue.value)); self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_CONFIRM); @@ -163,8 +164,8 @@ BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, { _getStaticTitle: function (value) { value = value || {}; - var yearStr = (BI.isNull(value.year) || BI.isEmptyString(value.year)) ? "" : value.year + "-"; - var monthStr = (BI.isNull(value.month) || BI.isEmptyString(value.month)) ? "" : value.month; + var yearStr = (BI.isNull(value.year) || BI.isEmptyString(value.year)) ? "" : value.year; + var monthStr = (BI.isNull(value.month) || BI.isEmptyString(value.month)) ? "" : "-" + value.month; return yearStr + monthStr; }, @@ -213,4 +214,5 @@ BI.DynamicYearMonthTrigger.EVENT_ERROR = "EVENT_ERROR"; BI.DynamicYearMonthTrigger.EVENT_START = "EVENT_START"; BI.DynamicYearMonthTrigger.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.DynamicYearMonthTrigger.EVENT_STOP = "EVENT_STOP"; +BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; BI.shortcut("bi.dynamic_year_month_trigger", BI.DynamicYearMonthTrigger); \ No newline at end of file diff --git a/src/widget/yearquarter/card.static.yearquarter.js b/src/widget/yearquarter/card.static.yearquarter.js index 4413a1644f..8e0fc27fa9 100644 --- a/src/widget/yearquarter/card.static.yearquarter.js +++ b/src/widget/yearquarter/card.static.yearquarter.js @@ -90,9 +90,9 @@ BI.StaticYearQuarterCard = BI.inherit(BI.Widget, { obj = obj || {}; obj.year = obj.year || 0; obj.quarter = obj.quarter || 0; - if (BI.checkDateVoid(obj.year, obj.quarter, 1, o.min, o.max)[0]) { + if (obj.quarter === 0 || obj.year === 0 || BI.checkDateVoid(obj.year, obj.quarter, 1, o.min, o.max)[0]) { var year = BI.getDate().getFullYear(); - this.selectedYear = ""; + this.selectedYear = year; this.selectedQuarter = ""; this.yearPicker.setValue(year); this.quarter.setValue(); diff --git a/src/widget/yearquarter/combo.yearquarter.js b/src/widget/yearquarter/combo.yearquarter.js index c8841d5407..99a19c6624 100644 --- a/src/widget/yearquarter/combo.yearquarter.js +++ b/src/widget/yearquarter/combo.yearquarter.js @@ -19,6 +19,9 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, { max: o.max, value: o.value || "" }); + this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN, function () { + self.combo.isViewVisible() && self.combo.hideView(); + }); this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_START, function () { self.combo.isViewVisible() && self.combo.hideView(); }); diff --git a/src/widget/yearquarter/trigger.yearquarter.js b/src/widget/yearquarter/trigger.yearquarter.js index edc0c20a0e..8c3108a88d 100644 --- a/src/widget/yearquarter/trigger.yearquarter.js +++ b/src/widget/yearquarter/trigger.yearquarter.js @@ -69,13 +69,16 @@ BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, { return false; }, errorText: function (v) { - return !BI.isPositiveInteger(v) ? BI.i18nText("BI-Please_Input_Positive_Integer") : BI.i18nText("BI-Year_Trigger_Invalid_Text"); + return BI.i18nText("BI-Year_Trigger_Invalid_Text"); }, watermark: BI.i18nText("BI-Basic_Unrestricted"), hgap: c.hgap, vgap: c.vgap, allowBlank: true }); + editor.on(BI.SignEditor.EVENT_KEY_DOWN, function () { + self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN); + }); editor.on(BI.SignEditor.EVENT_FOCUS, function () { self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_FOCUS); }); @@ -87,16 +90,14 @@ BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, { if (BI.isNotNull(value)) { editor.setValue(value); } - if (BI.isNotEmptyString(value)) { - var quarterValue = self.quarterEditor.getValue(); - self.storeValue = { - type: BI.DynamicYearQuarterCombo.Static, - value: { - year: self.yearEditor.getValue(), - quarter: BI.isEmptyString(self.quarterEditor.getValue()) ? "" : quarterValue - } - }; - } + var quarterValue = self.quarterEditor.getValue(); + self.storeValue = { + type: BI.DynamicYearQuarterCombo.Static, + value: { + year: self.yearEditor.getValue(), + quarter: BI.isEmptyString(self.quarterEditor.getValue()) ? "" : quarterValue + } + }; self.setTitle(self._getStaticTitle(self.storeValue.value)); self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_CONFIRM); @@ -136,8 +137,8 @@ BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, { _getStaticTitle: function (value) { value = value || {}; - var yearStr = (BI.isNull(value.year) || BI.isEmptyString(value.year)) ? "" : value.year + "-"; - var quarterStr = (BI.isNull(value.quarter) || BI.isEmptyString(value.quarter)) ? "" : value.quarter; + var yearStr = (BI.isNull(value.year) || BI.isEmptyString(value.year)) ? "" : value.year; + var quarterStr = (BI.isNull(value.quarter) || BI.isEmptyString(value.quarter)) ? "" : "-" + value.quarter; return yearStr + quarterStr; }, @@ -195,4 +196,5 @@ BI.DynamicYearQuarterTrigger.EVENT_ERROR = "EVENT_ERROR"; BI.DynamicYearQuarterTrigger.EVENT_START = "EVENT_START"; BI.DynamicYearQuarterTrigger.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.DynamicYearQuarterTrigger.EVENT_STOP = "EVENT_STOP"; +BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; BI.shortcut("bi.dynamic_year_quarter_trigger", BI.DynamicYearQuarterTrigger); \ No newline at end of file diff --git a/ui/css/font.css b/ui/css/font.css index fb1c090e39..dfc6792156 100644 --- a/ui/css/font.css +++ b/ui/css/font.css @@ -499,24 +499,24 @@ color: inherit; } .trigger-triangle-font .b-font { - *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); } .trigger-triangle-font .b-font:before { - content: "\e6f0"; + content: "\e64e"; color: #999999; } .trigger-triangle-font:hover .b-font:before, .trigger-triangle-font.hover .b-font:before { - content: "\e6f0"; + content: "\e64e"; color: #999999; } .trigger-triangle-font:active .b-font:before, .trigger-triangle-font.active .b-font:before { - content: "\e6f0"; + content: "\e64e"; color: #3685f2; } .trigger-triangle-font.disabled .b-font:before { - content: "\e6f0"; + content: "\e64e"; color: #999999; } .pull-down-font .b-font { @@ -627,45 +627,45 @@ color: #faaa39; } .less-font .b-font { - *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); } .less-font .b-font:before { - content: "\e75f"; + content: "\e75e"; color: inherit; } .less-font:hover .b-font:before, .less-font.hover .b-font:before { - content: "\e75f"; + content: "\e75e"; color: inherit; } .less-font:active .b-font:before, .less-font.active .b-font:before { - content: "\e75f"; + content: "\e75e"; color: #3f8ce8; } .less-font.disabled .b-font:before { - content: "\e75f"; + content: "\e75e"; color: inherit; } .less-equal-font .b-font { - *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); } .less-equal-font .b-font:before { - content: "\e760"; + content: "\e761"; color: inherit; } .less-equal-font:hover .b-font:before, .less-equal-font.hover .b-font:before { - content: "\e760"; + content: "\e761"; color: inherit; } .less-equal-font:active .b-font:before, .less-equal-font.active .b-font:before { - content: "\e760"; + content: "\e761"; color: #3f8ce8; } .less-equal-font.disabled .b-font:before { - content: "\e760"; + content: "\e761"; color: inherit; } .text-bold-font .b-font {