From 45b13253b03eee7d4b71c37eacc9cf4bb4261991 Mon Sep 17 00:00:00 2001 From: Kitetop Date: Tue, 2 Aug 2022 15:11:05 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-77246=20fix:=20=E4=BF=AE=E5=A4=8Dbi.?= =?UTF-8?q?time=5Fcombo=E7=BB=84=E4=BB=B6=E5=86=85=E5=AE=B9=E5=92=8C?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E9=87=8D=E5=8F=A0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/time/time.combo.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/widget/time/time.combo.js b/src/widget/time/time.combo.js index 30c40e0ab..a215cf0f2 100644 --- a/src/widget/time/time.combo.js +++ b/src/widget/time/time.combo.js @@ -62,11 +62,12 @@ return { type: "bi.htape", items: [{ - type: "bi.absolute", + type: "bi.horizontal_fill", + cls: "bi-border bi-border-radius", + columnSize: ["fill", this.constants.iconWidth], items: [{ el: { type: "bi.combo", - cls: "bi-border bi-border-radius", container: opts.container, toggle: false, isNeedAdjustHeight: opts.isNeedAdjustHeight, @@ -170,16 +171,12 @@ self.combo = _ref; } }, - top: 0, - left: 0, - right: 0, - bottom: 0 }, { el: { type: "bi.icon_button", - cls: "bi-trigger-icon-button time-font icon-size-16", + cls: "bi-trigger-icon-button time-font", width: this.constants.iconWidth, - height: opts.height, + height: opts.height - 2, listeners: [{ eventName: BI.IconButton.EVENT_CHANGE, action: function () { @@ -194,8 +191,6 @@ self.triggerBtn = _ref; } }, - top: 0, - right: 0 }] }] }; From f02eedd0b9abb9e2b846eb8fe63b7121a090a221 Mon Sep 17 00:00:00 2001 From: Kitetop Date: Tue, 2 Aug 2022 16:38:15 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-77246=20fix:=20=E6=A0=B9=E6=8D=AErev?= =?UTF-8?q?iew=E5=BB=BA=E8=AE=AE=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/time/time.combo.js | 240 +++++++++++++++++----------------- 1 file changed, 119 insertions(+), 121 deletions(-) diff --git a/src/widget/time/time.combo.js b/src/widget/time/time.combo.js index a215cf0f2..e3aa83713 100644 --- a/src/widget/time/time.combo.js +++ b/src/widget/time/time.combo.js @@ -60,138 +60,136 @@ } }; return { - type: "bi.htape", + type: "bi.horizontal_fill", + cls: "bi-border bi-border-radius", + columnSize: ["fill", this.constants.iconWidth], + height: opts.height - 2, + width: opts.width - 2, items: [{ - type: "bi.horizontal_fill", - cls: "bi-border bi-border-radius", - columnSize: ["fill", this.constants.iconWidth], - items: [{ + el: { + type: "bi.combo", + container: opts.container, + toggle: false, + isNeedAdjustHeight: opts.isNeedAdjustHeight, + isNeedAdjustWidth: opts.isNeedAdjustWidth, el: { - type: "bi.combo", - container: opts.container, - toggle: false, - isNeedAdjustHeight: opts.isNeedAdjustHeight, - isNeedAdjustWidth: opts.isNeedAdjustWidth, - el: { - type: "bi.time_trigger", - height: opts.height - 2, - allowEdit: opts.allowEdit, - watermark: opts.watermark, - format: opts.format, - value: opts.value, - ref: function (_ref) { - self.trigger = _ref; - }, - listeners: [{ - eventName: "EVENT_KEY_DOWN", - action: function () { - if (self.combo.isViewVisible()) { - self.combo.hideView(); - } - self.fireEvent(BI.TimeCombo.EVENT_KEY_DOWN, arguments); - } - }, { - eventName: "EVENT_STOP", - action: function () { - if (!self.combo.isViewVisible()) { - self.combo.showView(); - } - } - }, { - eventName: "EVENT_FOCUS", - action: function () { - self.storeTriggerValue = self.trigger.getKey(); - if (!self.combo.isViewVisible()) { - self.combo.showView(); - } - self.fireEvent("EVENT_FOCUS"); - } - }, { - eventName: "EVENT_BLUR", - action: function () { - self.fireEvent("EVENT_BLUR"); - } - }, { - eventName: "EVENT_ERROR", - action: function () { - var date = BI.getDate(); - self.storeValue = { - hour: date.getHours(), - minute: date.getMinutes(), - second: date.getSeconds() - }; - self.fireEvent("EVENT_ERROR"); - } - }, { - eventName: "EVENT_VALID", - action: function () { - self.fireEvent("EVENT_VALID"); + type: "bi.time_trigger", + height: opts.height - 2, + allowEdit: opts.allowEdit, + watermark: opts.watermark, + format: opts.format, + value: opts.value, + ref: function (_ref) { + self.trigger = _ref; + }, + listeners: [{ + eventName: "EVENT_KEY_DOWN", + action: function () { + if (self.combo.isViewVisible()) { + self.combo.hideView(); } - }, { - eventName: "EVENT_CHANGE", - action: function () { - self.fireEvent("EVENT_CHANGE"); + self.fireEvent(BI.TimeCombo.EVENT_KEY_DOWN, arguments); + } + }, { + eventName: "EVENT_STOP", + action: function () { + if (!self.combo.isViewVisible()) { + self.combo.showView(); } - }, { - eventName: "EVENT_CONFIRM", - action: function () { - if (self.combo.isViewVisible()) { - return; - } - var dateStore = self.storeTriggerValue; - var dateObj = self.trigger.getKey(); - if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) { - self.storeValue = self.trigger.getValue(); - self.setValue(self.trigger.getValue()); - } else if (BI.isEmptyString(dateObj)) { - self.storeValue = null; - self.trigger.setValue(); - } - self.fireEvent("EVENT_CONFIRM"); + } + }, { + eventName: "EVENT_FOCUS", + action: function () { + self.storeTriggerValue = self.trigger.getKey(); + if (!self.combo.isViewVisible()) { + self.combo.showView(); } - }] - }, - adjustLength: this.constants.comboAdjustHeight, - popup: { - el: popup, - width: opts.isNeedAdjustWidth ? opts.width : this.constants.popupWidth, - stopPropagation: false - }, - hideChecker: function (e) { - return self.triggerBtn.element.find(e.target).length === 0; - }, - listeners: [{ - eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW, + self.fireEvent("EVENT_FOCUS"); + } + }, { + eventName: "EVENT_BLUR", action: function () { - self.popup.setValue(self.storeValue); - self.fireEvent(BI.TimeCombo.EVENT_BEFORE_POPUPVIEW); + self.fireEvent("EVENT_BLUR"); } - }], - ref: function (_ref) { - self.combo = _ref; - } - }, - }, { - el: { - type: "bi.icon_button", - cls: "bi-trigger-icon-button time-font", - width: this.constants.iconWidth, - height: opts.height - 2, - listeners: [{ - eventName: BI.IconButton.EVENT_CHANGE, + }, { + eventName: "EVENT_ERROR", + action: function () { + var date = BI.getDate(); + self.storeValue = { + hour: date.getHours(), + minute: date.getMinutes(), + second: date.getSeconds() + }; + self.fireEvent("EVENT_ERROR"); + } + }, { + eventName: "EVENT_VALID", + action: function () { + self.fireEvent("EVENT_VALID"); + } + }, { + eventName: "EVENT_CHANGE", + action: function () { + self.fireEvent("EVENT_CHANGE"); + } + }, { + eventName: "EVENT_CONFIRM", action: function () { if (self.combo.isViewVisible()) { - // self.combo.hideView(); - } else { - self.combo.showView(); + return; + } + var dateStore = self.storeTriggerValue; + var dateObj = self.trigger.getKey(); + if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) { + self.storeValue = self.trigger.getValue(); + self.setValue(self.trigger.getValue()); + } else if (BI.isEmptyString(dateObj)) { + self.storeValue = null; + self.trigger.setValue(); } + self.fireEvent("EVENT_CONFIRM"); } - }], - ref: function (_ref) { - self.triggerBtn = _ref; - } + }] + }, + adjustLength: this.constants.comboAdjustHeight, + popup: { + el: popup, + width: opts.isNeedAdjustWidth ? opts.width : this.constants.popupWidth, + stopPropagation: false + }, + hideChecker: function (e) { + return self.triggerBtn.element.find(e.target).length === 0; }, - }] + listeners: [{ + eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW, + action: function () { + self.popup.setValue(self.storeValue); + self.fireEvent(BI.TimeCombo.EVENT_BEFORE_POPUPVIEW); + } + }], + ref: function (_ref) { + self.combo = _ref; + } + }, + }, { + el: { + type: "bi.icon_button", + cls: "bi-trigger-icon-button time-font", + width: this.constants.iconWidth, + listeners: [{ + eventName: BI.IconButton.EVENT_CHANGE, + action: function () { + if (self.combo.isViewVisible()) { + // self.combo.hideView(); + } else { + self.combo.showView(); + } + } + }], + ref: function (_ref) { + self.triggerBtn = _ref; + } + }, }] }; }, @@ -223,7 +221,7 @@ focus: function () { this.trigger.focus(); }, - + blur: function () { this.trigger.blur(); },