From 5e505b43a8373ed4c4fea1eb51fbeb807ed36ebb Mon Sep 17 00:00:00 2001 From: freddy Date: Wed, 19 Jan 2022 11:47:39 +0800 Subject: [PATCH 01/58] =?UTF-8?q?REPORT-62021=20fix:=E5=8D=95=E9=80=89?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=A0=91additem=E8=A7=A6=E5=8F=91change?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/multilayerselecttree/multilayerselecttree.combo.js | 1 + src/widget/multilayersingletree/multilayersingletree.combo.js | 1 + 2 files changed, 2 insertions(+) diff --git a/src/widget/multilayerselecttree/multilayerselecttree.combo.js b/src/widget/multilayerselecttree/multilayerselecttree.combo.js index a0a2d6366..412b1f9e7 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.combo.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.combo.js @@ -174,6 +174,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { var value = self.trigger.getSearcher().getKeyword(); self.combo.setValue([value]); self.combo.hideView(); + self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_CHANGE); } }] }, diff --git a/src/widget/multilayersingletree/multilayersingletree.combo.js b/src/widget/multilayersingletree/multilayersingletree.combo.js index a161c3c27..4109f6eb7 100644 --- a/src/widget/multilayersingletree/multilayersingletree.combo.js +++ b/src/widget/multilayersingletree/multilayersingletree.combo.js @@ -176,6 +176,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { var value = self.trigger.getSearcher().getKeyword(); self.combo.setValue([value]); self.combo.hideView(); + self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_CHANGE); } }] }, From 6332644c816059470192f8a958eeab322ae6e69a Mon Sep 17 00:00:00 2001 From: data Date: Thu, 20 Jan 2022 16:42:17 +0800 Subject: [PATCH 02/58] auto upgrade version to 2.0.20220120164210 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 741693633..314097752 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220120115227", + "version": "2.0.20220120164210", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 1a35304ca65e84100530d871081f662ec452bafe Mon Sep 17 00:00:00 2001 From: freddy Date: Thu, 20 Jan 2022 16:46:42 +0800 Subject: [PATCH 03/58] =?UTF-8?q?REPORT-60473=20&&=20REPORT-64922=20fix:?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E6=97=A5=E6=9C=9F=E6=8E=A7=E4=BB=B6=E7=9A=84?= =?UTF-8?q?focus=E3=80=81blur=E5=92=8CsetWaterMark?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/dynamicdate/dynamicdate.combo.js | 16 ++++++++++++++++ src/widget/dynamicdate/dynamicdate.trigger.js | 13 ++++++++++++- .../dynamicdatetime/dynamicdatetime.combo.js | 16 ++++++++++++++++ .../dynamicdatetime/dynamicdatetime.trigger.js | 15 +++++++++++++-- src/widget/time/time.combo.js | 16 ++++++++++++++++ src/widget/time/time.trigger.js | 13 ++++++++++++- .../widget/dynamicdate/dynamicdate.combo.ts | 8 ++++++++ .../dynamicdatetime/dynamicdatetime.combo.ts | 8 ++++++++ typescript/widget/time/time.combo.ts | 8 ++++++++ 9 files changed, 109 insertions(+), 4 deletions(-) diff --git a/src/widget/dynamicdate/dynamicdate.combo.js b/src/widget/dynamicdate/dynamicdate.combo.js index 81fb7faa0..e1c610675 100644 --- a/src/widget/dynamicdate/dynamicdate.combo.js +++ b/src/widget/dynamicdate/dynamicdate.combo.js @@ -298,6 +298,22 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, { }, hidePopupView: function () { this.combo.hideView(); + }, + + hideView: function () { + this.combo.hideView(); + }, + + focus: function () { + this.trigger.focus(); + }, + + blur: function () { + this.trigger.blur(); + }, + + setWaterMark: function (v) { + this.trigger.setWaterMark(v); } }); diff --git a/src/widget/dynamicdate/dynamicdate.trigger.js b/src/widget/dynamicdate/dynamicdate.trigger.js index 06bdb10ff..48e8a4601 100644 --- a/src/widget/dynamicdate/dynamicdate.trigger.js +++ b/src/widget/dynamicdate/dynamicdate.trigger.js @@ -308,8 +308,19 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, { }, getValue: function () { return this.storeValue; - } + }, + + focus: function () { + this.editor.focus(); + }, + blur: function () { + this.editor.blur(); + }, + + setWaterMark: function (v) { + this.editor.setWaterMark(v); + } }); BI.DynamicDateTrigger.EVENT_BLUR = "EVENT_BLUR"; diff --git a/src/widget/dynamicdatetime/dynamicdatetime.combo.js b/src/widget/dynamicdatetime/dynamicdatetime.combo.js index 6565f9943..50e7dde5b 100644 --- a/src/widget/dynamicdatetime/dynamicdatetime.combo.js +++ b/src/widget/dynamicdatetime/dynamicdatetime.combo.js @@ -306,6 +306,22 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, { isValid: function () { return this.trigger.isValid(); + }, + + hideView: function () { + this.combo.hideView(); + }, + + focus: function () { + this.trigger.focus(); + }, + + blur: function () { + this.trigger.blur(); + }, + + setWaterMark: function (v) { + this.trigger.setWaterMark(v); } }); diff --git a/src/widget/dynamicdatetime/dynamicdatetime.trigger.js b/src/widget/dynamicdatetime/dynamicdatetime.trigger.js index 6a1d4d5de..b93c3a508 100644 --- a/src/widget/dynamicdatetime/dynamicdatetime.trigger.js +++ b/src/widget/dynamicdatetime/dynamicdatetime.trigger.js @@ -379,8 +379,19 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, { isValid: function () { return this.editor.isValid(); - } + }, + + focus: function () { + this.editor.focus(); + }, + blur: function () { + this.editor.blur(); + }, + + setWaterMark: function (v) { + this.editor.setWaterMark(v); + } }); BI.DynamicDateTimeTrigger.EVENT_BLUR = "EVENT_BLUR"; @@ -393,4 +404,4 @@ BI.DynamicDateTimeTrigger.EVENT_VALID = "EVENT_VALID"; BI.DynamicDateTimeTrigger.EVENT_ERROR = "EVENT_ERROR"; BI.DynamicDateTimeTrigger.EVENT_TRIGGER_CLICK = "EVENT_TRIGGER_CLICK"; BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; -BI.shortcut("bi.dynamic_date_time_trigger", BI.DynamicDateTimeTrigger); +BI.shortcut("bi.dynamic_date_time_trigger", BI.DynamicDateTimeTrigger); \ No newline at end of file diff --git a/src/widget/time/time.combo.js b/src/widget/time/time.combo.js index e816b8fa6..dba165451 100644 --- a/src/widget/time/time.combo.js +++ b/src/widget/time/time.combo.js @@ -222,6 +222,22 @@ this.setValue(nowTome); this.hidePopupView(); this.fireEvent(BI.TimeCombo.EVENT_CONFIRM); + }, + + hideView: function () { + this.combo.hideView(); + }, + + focus: function () { + this.trigger.focus(); + }, + + blur: function () { + this.trigger.blur(); + }, + + setWaterMark: function (v) { + this.trigger.setWaterMark(v); } }); diff --git a/src/widget/time/time.trigger.js b/src/widget/time/time.trigger.js index 037a03888..3111a0ccf 100644 --- a/src/widget/time/time.trigger.js +++ b/src/widget/time/time.trigger.js @@ -180,8 +180,19 @@ getValue: function () { return this.storeValue; - } + }, + focus: function () { + this.editor.focus(); + }, + + blur: function () { + this.editor.blur(); + }, + + setWaterMark: function (v) { + this.editor.setWaterMark(v); + } }); BI.shortcut("bi.time_trigger", BI.TimeTrigger); })(); \ No newline at end of file diff --git a/typescript/widget/dynamicdate/dynamicdate.combo.ts b/typescript/widget/dynamicdate/dynamicdate.combo.ts index a7ead70cf..32c74536f 100644 --- a/typescript/widget/dynamicdate/dynamicdate.combo.ts +++ b/typescript/widget/dynamicdate/dynamicdate.combo.ts @@ -36,6 +36,14 @@ export declare class DynamicDateCombo extends Single { hidePopupView(): void; getValue(): DynamicDataComboValue; + + hideView(): void; + + focus(): void; + + blur(): void; + + setWaterMark(v: string): void; } export interface DynamicDataComboValue { diff --git a/typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts b/typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts index b6593b2a7..84aef8b40 100644 --- a/typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts +++ b/typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts @@ -32,4 +32,12 @@ export declare class DynamicDateTimeCombo extends Single { getKey(): string; hidePopupView(): void; + + hideView(): void; + + focus(): void; + + blur(): void; + + seWaterMark(v: string): void; } diff --git a/typescript/widget/time/time.combo.ts b/typescript/widget/time/time.combo.ts index fa14d017f..998b9b0d8 100644 --- a/typescript/widget/time/time.combo.ts +++ b/typescript/widget/time/time.combo.ts @@ -10,4 +10,12 @@ export declare class TimeCombo extends Single { static EVENT_BEFORE_POPUPVIEW: string; hidePopupView(): void; + + hideView(): void; + + focus(): void; + + blur(): void; + + setWaterMark(v: string): void; } From 1eda96c4b708c8192200563ecb4800a902a0d8cf Mon Sep 17 00:00:00 2001 From: freddy Date: Thu, 20 Jan 2022 17:13:10 +0800 Subject: [PATCH 04/58] =?UTF-8?q?Revert=20"REPORT-60473=20&&=20REPORT-6492?= =?UTF-8?q?2=20fix:=E5=AE=9E=E7=8E=B0=E6=97=A5=E6=9C=9F=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E7=9A=84focus=E3=80=81blur=E5=92=8CsetWaterMark"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1a35304ca65e84100530d871081f662ec452bafe. --- src/widget/dynamicdate/dynamicdate.combo.js | 16 ---------------- src/widget/dynamicdate/dynamicdate.trigger.js | 13 +------------ .../dynamicdatetime/dynamicdatetime.combo.js | 16 ---------------- .../dynamicdatetime/dynamicdatetime.trigger.js | 15 ++------------- src/widget/time/time.combo.js | 16 ---------------- src/widget/time/time.trigger.js | 13 +------------ .../widget/dynamicdate/dynamicdate.combo.ts | 8 -------- .../dynamicdatetime/dynamicdatetime.combo.ts | 8 -------- typescript/widget/time/time.combo.ts | 8 -------- 9 files changed, 4 insertions(+), 109 deletions(-) diff --git a/src/widget/dynamicdate/dynamicdate.combo.js b/src/widget/dynamicdate/dynamicdate.combo.js index e1c610675..81fb7faa0 100644 --- a/src/widget/dynamicdate/dynamicdate.combo.js +++ b/src/widget/dynamicdate/dynamicdate.combo.js @@ -298,22 +298,6 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, { }, hidePopupView: function () { this.combo.hideView(); - }, - - hideView: function () { - this.combo.hideView(); - }, - - focus: function () { - this.trigger.focus(); - }, - - blur: function () { - this.trigger.blur(); - }, - - setWaterMark: function (v) { - this.trigger.setWaterMark(v); } }); diff --git a/src/widget/dynamicdate/dynamicdate.trigger.js b/src/widget/dynamicdate/dynamicdate.trigger.js index 48e8a4601..06bdb10ff 100644 --- a/src/widget/dynamicdate/dynamicdate.trigger.js +++ b/src/widget/dynamicdate/dynamicdate.trigger.js @@ -308,19 +308,8 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, { }, getValue: function () { return this.storeValue; - }, - - focus: function () { - this.editor.focus(); - }, - - blur: function () { - this.editor.blur(); - }, - - setWaterMark: function (v) { - this.editor.setWaterMark(v); } + }); BI.DynamicDateTrigger.EVENT_BLUR = "EVENT_BLUR"; diff --git a/src/widget/dynamicdatetime/dynamicdatetime.combo.js b/src/widget/dynamicdatetime/dynamicdatetime.combo.js index 50e7dde5b..6565f9943 100644 --- a/src/widget/dynamicdatetime/dynamicdatetime.combo.js +++ b/src/widget/dynamicdatetime/dynamicdatetime.combo.js @@ -306,22 +306,6 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, { isValid: function () { return this.trigger.isValid(); - }, - - hideView: function () { - this.combo.hideView(); - }, - - focus: function () { - this.trigger.focus(); - }, - - blur: function () { - this.trigger.blur(); - }, - - setWaterMark: function (v) { - this.trigger.setWaterMark(v); } }); diff --git a/src/widget/dynamicdatetime/dynamicdatetime.trigger.js b/src/widget/dynamicdatetime/dynamicdatetime.trigger.js index b93c3a508..6a1d4d5de 100644 --- a/src/widget/dynamicdatetime/dynamicdatetime.trigger.js +++ b/src/widget/dynamicdatetime/dynamicdatetime.trigger.js @@ -379,19 +379,8 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, { isValid: function () { return this.editor.isValid(); - }, - - focus: function () { - this.editor.focus(); - }, - - blur: function () { - this.editor.blur(); - }, - - setWaterMark: function (v) { - this.editor.setWaterMark(v); } + }); BI.DynamicDateTimeTrigger.EVENT_BLUR = "EVENT_BLUR"; @@ -404,4 +393,4 @@ BI.DynamicDateTimeTrigger.EVENT_VALID = "EVENT_VALID"; BI.DynamicDateTimeTrigger.EVENT_ERROR = "EVENT_ERROR"; BI.DynamicDateTimeTrigger.EVENT_TRIGGER_CLICK = "EVENT_TRIGGER_CLICK"; BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; -BI.shortcut("bi.dynamic_date_time_trigger", BI.DynamicDateTimeTrigger); \ No newline at end of file +BI.shortcut("bi.dynamic_date_time_trigger", BI.DynamicDateTimeTrigger); diff --git a/src/widget/time/time.combo.js b/src/widget/time/time.combo.js index dba165451..e816b8fa6 100644 --- a/src/widget/time/time.combo.js +++ b/src/widget/time/time.combo.js @@ -222,22 +222,6 @@ this.setValue(nowTome); this.hidePopupView(); this.fireEvent(BI.TimeCombo.EVENT_CONFIRM); - }, - - hideView: function () { - this.combo.hideView(); - }, - - focus: function () { - this.trigger.focus(); - }, - - blur: function () { - this.trigger.blur(); - }, - - setWaterMark: function (v) { - this.trigger.setWaterMark(v); } }); diff --git a/src/widget/time/time.trigger.js b/src/widget/time/time.trigger.js index 3111a0ccf..037a03888 100644 --- a/src/widget/time/time.trigger.js +++ b/src/widget/time/time.trigger.js @@ -180,19 +180,8 @@ getValue: function () { return this.storeValue; - }, - - focus: function () { - this.editor.focus(); - }, - - blur: function () { - this.editor.blur(); - }, - - setWaterMark: function (v) { - this.editor.setWaterMark(v); } + }); BI.shortcut("bi.time_trigger", BI.TimeTrigger); })(); \ No newline at end of file diff --git a/typescript/widget/dynamicdate/dynamicdate.combo.ts b/typescript/widget/dynamicdate/dynamicdate.combo.ts index 32c74536f..a7ead70cf 100644 --- a/typescript/widget/dynamicdate/dynamicdate.combo.ts +++ b/typescript/widget/dynamicdate/dynamicdate.combo.ts @@ -36,14 +36,6 @@ export declare class DynamicDateCombo extends Single { hidePopupView(): void; getValue(): DynamicDataComboValue; - - hideView(): void; - - focus(): void; - - blur(): void; - - setWaterMark(v: string): void; } export interface DynamicDataComboValue { diff --git a/typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts b/typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts index 84aef8b40..b6593b2a7 100644 --- a/typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts +++ b/typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts @@ -32,12 +32,4 @@ export declare class DynamicDateTimeCombo extends Single { getKey(): string; hidePopupView(): void; - - hideView(): void; - - focus(): void; - - blur(): void; - - seWaterMark(v: string): void; } diff --git a/typescript/widget/time/time.combo.ts b/typescript/widget/time/time.combo.ts index 998b9b0d8..fa14d017f 100644 --- a/typescript/widget/time/time.combo.ts +++ b/typescript/widget/time/time.combo.ts @@ -10,12 +10,4 @@ export declare class TimeCombo extends Single { static EVENT_BEFORE_POPUPVIEW: string; hidePopupView(): void; - - hideView(): void; - - focus(): void; - - blur(): void; - - setWaterMark(v: string): void; } From 6cfcde17d697793f4af3ce589f8621fe42cbf31d Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 20 Jan 2022 17:34:09 +0800 Subject: [PATCH 05/58] =?UTF-8?q?feature:=20=E6=B0=94=E6=B3=A1=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=93=81=E7=89=8C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/combination/combo.js | 6 +++--- src/case/combo/bubblecombo/combo.bubble.js | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/base/combination/combo.js b/src/base/combination/combo.js index 58f1b23cd..d07e75c91 100644 --- a/src/base/combination/combo.js +++ b/src/base/combination/combo.js @@ -144,7 +144,7 @@ delete needHideWhenAnotherComboOpen[this.getName()]; delete currentOpenedCombos[this.getName()]; - BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName()); + o.hideWhenClickOutside && BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName()); BI.EVENT_BLUR && o.hideWhenBlur && BI.Widget._renderEngine.createElement(window).unbind("blur." + this.getName()); this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW); }, @@ -170,11 +170,11 @@ this.element.addClass(this.options.comboClass); o.hideWhenClickOutside && BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName()); - BI.Widget._renderEngine.createElement(document).unbind("mousewheel." + this.getName()); + o.hideWhenClickOutside && BI.Widget._renderEngine.createElement(document).unbind("mousewheel." + this.getName()); BI.EVENT_BLUR && o.hideWhenBlur && BI.Widget._renderEngine.createElement(window).unbind("blur." + this.getName()); o.hideWhenClickOutside && BI.Widget._renderEngine.createElement(document).bind("mousedown." + this.getName(), BI.bind(this._hideIf, this)).bind("mousewheel." + this.getName(), BI.bind(this._hideIf, this)); - BI.Widget._renderEngine.createElement(document).bind("mousewheel." + this.getName(), BI.bind(this._hideIf, this)); + o.hideWhenClickOutside && BI.Widget._renderEngine.createElement(document).bind("mousewheel." + this.getName(), BI.bind(this._hideIf, this)); BI.EVENT_BLUR && o.hideWhenBlur && BI.Widget._renderEngine.createElement(window).bind("blur." + this.getName(), BI.bind(this._hideIf, this)); this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW); }, diff --git a/src/case/combo/bubblecombo/combo.bubble.js b/src/case/combo/bubblecombo/combo.bubble.js index dbd42e84d..a6f20bbbd 100644 --- a/src/case/combo/bubblecombo/combo.bubble.js +++ b/src/case/combo/bubblecombo/combo.bubble.js @@ -17,6 +17,7 @@ BI.BubbleCombo = BI.inherit(BI.Widget, { direction: "bottom,left", // top||bottom||left||right||top,left||top,right||bottom,left||bottom,right isDefaultInit: false, destroyWhenHide: false, + hideWhenClickOutside: true, hideWhenBlur: true, isNeedAdjustHeight: true, // 是否需要高度调整 isNeedAdjustWidth: true, @@ -43,6 +44,7 @@ BI.BubbleCombo = BI.inherit(BI.Widget, { direction: o.direction, isDefaultInit: o.isDefaultInit, hideWhenBlur: o.hideWhenBlur, + hideWhenClickOutside: o.hideWhenClickOutside, destroyWhenHide: o.destroyWhenHide, hideWhenAnotherComboOpen: o.hideWhenAnotherComboOpen, isNeedAdjustHeight: o.isNeedAdjustHeight, From 90363dce9c0cd0ddf14d99e61b896d9e21e4aae7 Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 20 Jan 2022 17:46:35 +0800 Subject: [PATCH 06/58] =?UTF-8?q?feature:=20=E6=B0=94=E6=B3=A1=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=93=81=E7=89=8C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jsy.lessconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jsy.lessconfig.json b/jsy.lessconfig.json index 8e2974193..2ac35b60a 100644 --- a/jsy.lessconfig.json +++ b/jsy.lessconfig.json @@ -1,4 +1,5 @@ { + "@background-color-primary": "#003D4D", "@color-primary": "#00acbe", "font-color-normal": "#0d1540", "font-color-light-gray": "#0d1540", @@ -17,4 +18,4 @@ "border-color-disabled": "#e8eaed", "border-color-success": "#28b668", "border-color-negative": "#e65251" -} \ No newline at end of file +} From cc4f324ea03a8ad7dabcb5e6e146494a5795b742 Mon Sep 17 00:00:00 2001 From: data Date: Thu, 20 Jan 2022 18:02:29 +0800 Subject: [PATCH 07/58] auto upgrade version to 2.0.20220120180224 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 314097752..23d39ba43 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220120164210", + "version": "2.0.20220120180224", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 5dd9e3ac2910d9b05a08796454b603e13de80b62 Mon Sep 17 00:00:00 2001 From: "Jimmy.Chai" Date: Thu, 20 Jan 2022 19:23:58 +0800 Subject: [PATCH 08/58] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=20refacto?= =?UTF-8?q?r=EF=BC=9A=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/base/single/button/button.basic.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/base/single/button/button.basic.ts b/typescript/base/single/button/button.basic.ts index 1c91110c4..5fe2ea4db 100644 --- a/typescript/base/single/button/button.basic.ts +++ b/typescript/base/single/button/button.basic.ts @@ -52,7 +52,7 @@ export declare class BasicButton extends Single { beforeClick(): void; - doClick(): void; + doClick(e: Event): void; handle(): BasicButton; From a0b271ba8ceecf705ab99802987c87c82d19ab06 Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 20 Jan 2022 20:32:14 +0800 Subject: [PATCH 09/58] =?UTF-8?q?feature:=20=E6=B0=94=E6=B3=A1=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=93=81=E7=89=8C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jsy.lessconfig.json | 2 +- src/base/layer/layer.popup.js | 4 ++-- src/case/combo/bubblecombo/combo.bubble.js | 17 ++++++++++------- src/less/base/combo/combo.bubble.less | 2 +- src/less/base/view/popupview.less | 13 ++++++++++++- src/less/core/utils/common.less | 2 +- src/less/lib/constant.less | 2 +- 7 files changed, 28 insertions(+), 14 deletions(-) diff --git a/jsy.lessconfig.json b/jsy.lessconfig.json index 2ac35b60a..9efbfa906 100644 --- a/jsy.lessconfig.json +++ b/jsy.lessconfig.json @@ -1,5 +1,5 @@ { - "@background-color-primary": "#003D4D", + "@background-color-card-primary": "#003D4D", "@color-primary": "#00acbe", "font-color-normal": "#0d1540", "font-color-light-gray": "#0d1540", diff --git a/src/base/layer/layer.popup.js b/src/base/layer/layer.popup.js index 53c8e17d1..8ed9e336e 100644 --- a/src/base/layer/layer.popup.js +++ b/src/base/layer/layer.popup.js @@ -4,9 +4,9 @@ * @extends BI.Widget */ BI.PopupView = BI.inherit(BI.Widget, { - _defaultConfig: function () { + _defaultConfig: function (props) { return BI.extend(BI.PopupView.superclass._defaultConfig.apply(this, arguments), { - _baseCls: "bi-popup-view", + _baseCls: "bi-popup-view" + (props.primary ? " bi-primary" : ""), // 品牌色 primary: false, maxWidth: "auto", diff --git a/src/case/combo/bubblecombo/combo.bubble.js b/src/case/combo/bubblecombo/combo.bubble.js index a6f20bbbd..997caff67 100644 --- a/src/case/combo/bubblecombo/combo.bubble.js +++ b/src/case/combo/bubblecombo/combo.bubble.js @@ -99,7 +99,7 @@ BI.BubbleCombo = BI.inherit(BI.Widget, { }, _createTriangle: function (direction) { - var o = this.options, pos = {}, op = {}; + var self = this, o = this.options, pos = {}, op = {}; var adjustLength = this.options.adjustLength; var offset = this.element.offset(); var left = offset.left, right = offset.left + this.element.outerWidth(); @@ -147,15 +147,18 @@ BI.BubbleCombo = BI.inherit(BI.Widget, { cls: "button-combo-triangle-wrapper", items: [{ type: "bi.layout", - cls: "bubble-combo-triangle-" + direction + (o.primary ? " bi-primary": "") + cls: "bubble-combo-triangle-" + direction + (o.primary ? " bi-primary" : "") }] }); pos.el = this.triangle; - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [pos] - }); + // 动画结束后再画三角 + setTimeout(function () { + BI.createWidget({ + type: "bi.absolute", + element: self, + items: [pos] + }); + }, 200); }, _createLeftTriangle: function () { diff --git a/src/less/base/combo/combo.bubble.less b/src/less/base/combo/combo.bubble.less index 16f9f6e9f..e5a59b0cb 100644 --- a/src/less/base/combo/combo.bubble.less +++ b/src/less/base/combo/combo.bubble.less @@ -30,7 +30,7 @@ background-color: @color-bi-background-bubble-combo-triangle; } &.bi-primary:before { - background-color: @background-color-primary; + background-color: @background-color-card-primary; } } } diff --git a/src/less/base/view/popupview.less b/src/less/base/view/popupview.less index efa864778..dae81230c 100644 --- a/src/less/base/view/popupview.less +++ b/src/less/base/view/popupview.less @@ -85,6 +85,17 @@ } } +.bi-popup-view.bi-primary { + .bi-bubble-arrow { + .bubble-arrow { + &:before { + background-color: @background-color-card-primary; + color: @color-card-primary; + } + } + } +} + .bi-theme-dark { .bubble-arrow:before { background: @color-bi-background-default-theme-dark; @@ -102,4 +113,4 @@ & .list-view-shadow { .box-shadow(0 1px 5px 0, fade(@background-color-normal-theme-dark, 80)); } -} \ No newline at end of file +} diff --git a/src/less/core/utils/common.less b/src/less/core/utils/common.less index 0dfefd2af..5d9b11c3e 100644 --- a/src/less/core/utils/common.less +++ b/src/less/core/utils/common.less @@ -123,7 +123,7 @@ color: @color-bi-text-card; } &.bi-primary { - background-color: @background-color-primary; + background-color: @background-color-card-primary; color: @color-card-primary; } } diff --git a/src/less/lib/constant.less b/src/less/lib/constant.less index 6029c7ef9..5236ce2cb 100644 --- a/src/less/lib/constant.less +++ b/src/less/lib/constant.less @@ -24,7 +24,7 @@ // 品牌 @color-primary: #3685f2; @color-card-primary: @color-white; -@background-color-primary: #1e4092; +@background-color-card-primary: #1e4092; //green @color-green-100: #13cd66; From 4c929e437cdaea9a0a66e77be2bb50ad9194ce1e Mon Sep 17 00:00:00 2001 From: data Date: Thu, 20 Jan 2022 20:42:29 +0800 Subject: [PATCH 10/58] auto upgrade version to 2.0.20220120204224 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 23d39ba43..d072a7816 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220120180224", + "version": "2.0.20220120204224", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 3f2592f33b6369944c52ca4003d30e39f4959d45 Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 20 Jan 2022 20:54:20 +0800 Subject: [PATCH 11/58] =?UTF-8?q?feature:=20=E6=B0=94=E6=B3=A1=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=93=81=E7=89=8C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/less/base/view/popupview.less | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/less/base/view/popupview.less b/src/less/base/view/popupview.less index dae81230c..96191b06b 100644 --- a/src/less/base/view/popupview.less +++ b/src/less/base/view/popupview.less @@ -29,48 +29,48 @@ .bi-popup-view[data-popper-placement^='top'] { > .bi-bubble-arrow { - bottom: -10px; + bottom: -12px; > .bubble-arrow { - bottom: 6px; + bottom: 8px; } } } .bi-popup-view[data-popper-placement^='bottom'] { > .bi-bubble-arrow { - top: -10px; + top: -12px; > .bubble-arrow { - top: 6px; + top: 8px; } } } .bi-popup-view[data-popper-placement^='left'] { > .bi-bubble-arrow { - right: -10px; + right: -12px; > .bubble-arrow { - right: 6px; + right: 8px; } } } .bi-popup-view[data-popper-placement^='right'] { > .bi-bubble-arrow { - left: -10px; + left: -12px; > .bubble-arrow { - left: 6px; + left: 8px; } } } .bi-bubble-arrow { - width: 10px; - height: 10px; + width: 12px; + height: 12px; overflow: hidden; .bubble-arrow { - width: 10px; - height: 10px; + width: 12px; + height: 12px; position: absolute; &:before { - width: 10px; - height: 10px; + width: 12px; + height: 12px; position: absolute; content: ""; background: @color-bi-background-default; From 1fb25495699238e378f6ab70d4f946635305f7fa Mon Sep 17 00:00:00 2001 From: data Date: Thu, 20 Jan 2022 21:02:16 +0800 Subject: [PATCH 12/58] auto upgrade version to 2.0.20220120210211 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d072a7816..57a9e38b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220120204224", + "version": "2.0.20220120210211", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 4cb767f920a5568f1838cd1b62e39bf596b8face Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 21 Jan 2022 10:02:27 +0800 Subject: [PATCH 13/58] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E6=9B=B4=E6=96=B0fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/fix/fix.js | 5 +++++ dist/fix/fix.proxy.js | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/dist/fix/fix.js b/dist/fix/fix.js index e16bdf99f..63ebd6374 100644 --- a/dist/fix/fix.js +++ b/dist/fix/fix.js @@ -904,6 +904,10 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons return target; } + function freeze() { + return Object.freeze.apply(null, arguments); + } + /** * Delete a property and trigger change if necessary. */ @@ -1519,6 +1523,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons exports.notify = notify; exports.defineReactive = defineReactive; exports.set = set; + exports.freeze = freeze; exports.del = del; exports.Watcher = Watcher; exports.pushTarget = pushTarget; diff --git a/dist/fix/fix.proxy.js b/dist/fix/fix.proxy.js index f332da88b..19eca6178 100644 --- a/dist/fix/fix.proxy.js +++ b/dist/fix/fix.proxy.js @@ -1838,6 +1838,7 @@ if (!runner.effect.active) { return; } + if (cb) { // watch(source, cb) var newValue = runner(); @@ -2404,6 +2405,15 @@ } target[key] = val; + return target; + } + function freeze(value) { + Object.defineProperty(value, '__v_skip', { + configurable: true, + enumerable: false, + value: value + }); + return value; } function del(target, key) { if (_.isArray(target)) { @@ -2456,6 +2466,7 @@ exports.config = config; exports.define = define; exports.del = del; + exports.freeze = freeze; exports.mixin = mixin; exports.set = set; exports.toJSON = toJSON; From 722b4ff5e24d3fe7136fe84bf794ab740ab68c99 Mon Sep 17 00:00:00 2001 From: data Date: Fri, 21 Jan 2022 10:02:33 +0800 Subject: [PATCH 14/58] auto upgrade version to 2.0.20220121100228 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 57a9e38b9..74ca77d25 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220120210211", + "version": "2.0.20220121100228", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 639c8d9cfa6f189bf4918b215825124f27bbecd9 Mon Sep 17 00:00:00 2001 From: data Date: Fri, 21 Jan 2022 10:12:13 +0800 Subject: [PATCH 15/58] auto upgrade version to 2.0.20220121101208 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 74ca77d25..06dcac66f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220121100228", + "version": "2.0.20220121101208", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 4d2e7b60f009c535c45ce4fb455afaf323e568db Mon Sep 17 00:00:00 2001 From: data Date: Fri, 21 Jan 2022 12:12:02 +0800 Subject: [PATCH 16/58] auto upgrade version to 2.0.20220121121157 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 06dcac66f..ffeb52d71 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220121101208", + "version": "2.0.20220121121157", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 1ae25aa7eff9655057bc8b80a8143df40ed42209 Mon Sep 17 00:00:00 2001 From: iapyang Date: Fri, 21 Jan 2022 14:59:27 +0800 Subject: [PATCH 17/58] =?UTF-8?q?chore:=20=E4=BF=AE=E6=94=B9=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/base/single/button/button.basic.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/base/single/button/button.basic.ts b/typescript/base/single/button/button.basic.ts index 5fe2ea4db..3cd921b93 100644 --- a/typescript/base/single/button/button.basic.ts +++ b/typescript/base/single/button/button.basic.ts @@ -52,7 +52,7 @@ export declare class BasicButton extends Single { beforeClick(): void; - doClick(e: Event): void; + doClick(e?: Event): void; handle(): BasicButton; From 0f403dffcd6ef0d8b7d5d1886013400dcca9e3c1 Mon Sep 17 00:00:00 2001 From: data Date: Fri, 21 Jan 2022 15:12:13 +0800 Subject: [PATCH 18/58] auto upgrade version to 2.0.20220121151205 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ffeb52d71..2e20f7523 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220121121157", + "version": "2.0.20220121151205", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 2cf6e2ec5eb294949a1cd72723479d632e85eb2b Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 21 Jan 2022 15:27:33 +0800 Subject: [PATCH 19/58] =?UTF-8?q?feature:=20=E6=B0=94=E6=B3=A1=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=93=81=E7=89=8C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/combo/bubblecombo/popup.bubble.js | 39 ++++++++++++---------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/src/case/combo/bubblecombo/popup.bubble.js b/src/case/combo/bubblecombo/popup.bubble.js index cbb15070a..d823651fe 100644 --- a/src/case/combo/bubblecombo/popup.bubble.js +++ b/src/case/combo/bubblecombo/popup.bubble.js @@ -13,7 +13,7 @@ BI.BubblePopupView = BI.inherit(BI.PopupView, { maxWidth: 300, minHeight: 50 }); - }, + } }); BI.shortcut("bi.bubble_popup_view", BI.BubblePopupView); @@ -47,33 +47,36 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, { var items = []; BI.each(o.buttons, function (i, buttonOpt) { if (BI.isWidget(buttonOpt)) { - items.push(buttonOpt); + items.push({ + el: buttonOpt, + lgap: i === 0 ? 20 : 15, + rgap: i === o.buttons.length - 1 ? 20 : 0 + }); } else { - items.push(BI.extend({ - type: "bi.button", - height: 24, - handler: function (v) { - self.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON, v); - } - }, buttonOpt)); + items.push({ + el: BI.extend({ + type: "bi.button", + height: 24, + handler: function (v) { + self.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON, v); + } + }, buttonOpt), + lgap: i === 0 ? 20 : 15, + rgap: i === o.buttons.length - 1 ? 20 : 0 + }); } }); return BI.createWidget({ - type: "bi.center", + type: "bi.right_vertical_adapt", height: 54, - rgap: 20, - items: [{ - type: "bi.right_vertical_adapt", - lgap: 15, - items: items - }] + items: items }); }, _createView: function () { var o = this.options; - var button = BI.createWidget({ + var button = BI.createWidget({ type: "bi.button_group", items: [o.el], layouts: [{ @@ -156,7 +159,7 @@ BI.TextBubblePopupBarView = BI.inherit(BI.Widget, { populate: function (v) { this.text.setText(v || this.options.text); - }, + } }); BI.TextBubblePopupBarView.EVENT_CHANGE = "EVENT_CLICK_TOOLBAR_BUTTON"; BI.shortcut("bi.text_bubble_bar_popup_view", BI.TextBubblePopupBarView); From 3679240431d3d1a121a38633b93c51e6cf491bcc Mon Sep 17 00:00:00 2001 From: data Date: Fri, 21 Jan 2022 15:42:12 +0800 Subject: [PATCH 20/58] auto upgrade version to 2.0.20220121154203 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2e20f7523..2ead2886d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220121151205", + "version": "2.0.20220121154203", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 0675b2b76d0ab7829939664b7960478de4b00519 Mon Sep 17 00:00:00 2001 From: iapyang Date: Fri, 21 Jan 2022 16:45:49 +0800 Subject: [PATCH 21/58] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/core/widget.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/typescript/core/widget.ts b/typescript/core/widget.ts index 4c360b400..0a1b63246 100644 --- a/typescript/core/widget.ts +++ b/typescript/core/widget.ts @@ -671,6 +671,7 @@ export declare class Widget extends OB { /** * 新增子元素 */ + addWidget(widget: _Widget): _Widget; addWidget(_name: any, _widget: _Widget): _Widget; /** From d610564ca8df96ef96a5de34575289d1c789225e Mon Sep 17 00:00:00 2001 From: data Date: Fri, 21 Jan 2022 17:02:19 +0800 Subject: [PATCH 22/58] auto upgrade version to 2.0.20220121170213 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2ead2886d..394984f7a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220121154203", + "version": "2.0.20220121170213", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 146a9fa2e1077f66eb91b1e866d8f71138dc71e0 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 21 Jan 2022 18:42:44 +0800 Subject: [PATCH 23/58] =?UTF-8?q?feature:=20=E5=B0=8F=E4=B8=89=E8=A7=92?= =?UTF-8?q?=E6=8D=A2=E4=B8=80=E7=A7=8D=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/combination/bubble.js | 23 +-- src/base/combination/combo.js | 68 ++++---- src/base/layer/layer.popup.js | 179 +++++++++++++++++++-- src/case/combo/bubblecombo/combo.bubble.js | 118 +------------- src/less/base/view/popupview.less | 8 +- 5 files changed, 207 insertions(+), 189 deletions(-) diff --git a/src/base/combination/bubble.js b/src/base/combination/bubble.js index cf0548fb1..5177f3020 100644 --- a/src/base/combination/bubble.js +++ b/src/base/combination/bubble.js @@ -223,17 +223,6 @@ this.combo = BI.createWidget(this.options.el, { value: this.options.value }); - - if (this.options.showArrow) { - this.arrow = BI.createWidget({ - type: "bi.absolute", - cls: "bi-bubble-arrow", - items: [{ - type: "bi.layout", - cls: "bubble-arrow" - }] - }); - } }, _assertPopupView: function () { @@ -241,17 +230,9 @@ if (this.popupView == null) { this.popupView = BI.createWidget(this.options.popup, { type: "bi.bubble_popup_view", + showArrow: o.showArrow, value: o.value }, this); - if (this.options.showArrow) { - BI.createWidget({ - type: "bi.absolute", - element: this.popupView, - items: [{ - el: this.arrow - }] - }); - } this.popupView.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { if (type === BI.Events.CLICK) { self.combo.setValue(self.getValue()); @@ -360,7 +341,7 @@ name: "arrow", options: { padding: 5, - element: this.arrow.element[0] + element: this.popupView.arrow.element[0] } }); } diff --git a/src/base/combination/combo.js b/src/base/combination/combo.js index d07e75c91..6d26d297b 100644 --- a/src/base/combination/combo.js +++ b/src/base/combination/combo.js @@ -6,8 +6,11 @@ * @extends BI.Widget */ BI.Combo = BI.inherit(BI.Bubble, { + _const: { + TRIANGLE_LENGTH: 9 + }, _defaultConfig: function () { - var conf = BI.Bubble.superclass._defaultConfig.apply(this, arguments); + var conf = BI.Combo.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { baseCls: (conf.baseCls || "") + " bi-combo" + (BI.isIE() ? " hack" : ""), attributes: { @@ -102,27 +105,6 @@ }); }, - _assertPopupView: function () { - var self = this, o = this.options; - if (this.popupView == null) { - this.popupView = BI.createWidget(this.options.popup, { - type: "bi.popup_view", - value: o.value - }, this); - this.popupView.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { - if (type === BI.Events.CLICK) { - self.combo.setValue(self.getValue()); - self.fireEvent(BI.Combo.EVENT_CHANGE, value, obj); - } - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); - this.popupView.setVisible(false); - BI.nextTick(function () { - self.fireEvent(BI.Combo.EVENT_AFTER_INIT); - }); - } - }, - _hideView: function (e) { var o = this.options; this.fireEvent(BI.Combo.EVENT_BEFORE_HIDEVIEW); @@ -214,69 +196,79 @@ switch (o.direction) { case "bottom": case "bottom,right": - p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["bottom", "top", "right", "left"], o.offsetStyle); + p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset, (o.adjustYOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight, ["bottom", "top", "right", "left"], o.offsetStyle); break; case "top": case "top,right": - p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["top", "bottom", "right", "left"], o.offsetStyle); + p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset, (o.adjustYOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight, ["top", "bottom", "right", "left"], o.offsetStyle); break; case "left": case "left,bottom": - p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "bottom", "top"], o.offsetStyle); + p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "bottom", "top"], o.offsetStyle); break; case "right": case "right,bottom": - p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "bottom", "top"], o.offsetStyle); + p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "bottom", "top"], o.offsetStyle); break; case "top,left": - p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["top", "bottom", "left", "right"], o.offsetStyle); + p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset, (o.adjustYOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight, ["top", "bottom", "left", "right"], o.offsetStyle); break; case "bottom,left": - p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["bottom", "top", "left", "right"], o.offsetStyle); + p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset, (o.adjustYOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight, ["bottom", "top", "left", "right"], o.offsetStyle); break; case "left,top": - p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "top", "bottom"], o.offsetStyle); + p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "top", "bottom"], o.offsetStyle); break; case "right,top": - p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "top", "bottom"], o.offsetStyle); + p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "top", "bottom"], o.offsetStyle); break; case "right,innerRight": - p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "innerRight", "innerLeft", "bottom", "top"], o.offsetStyle); + p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "innerRight", "innerLeft", "bottom", "top"], o.offsetStyle); break; case "right,innerLeft": - p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "innerLeft", "innerRight", "bottom", "top"], o.offsetStyle); + p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "innerLeft", "innerRight", "bottom", "top"], o.offsetStyle); break; case "innerRight": - p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["innerRight", "innerLeft", "right", "left", "bottom", "top"], o.offsetStyle); + p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["innerRight", "innerLeft", "right", "left", "bottom", "top"], o.offsetStyle); break; case "innerLeft": - p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["innerLeft", "innerRight", "left", "right", "bottom", "top"], o.offsetStyle); + p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["innerLeft", "innerRight", "left", "right", "bottom", "top"], o.offsetStyle); break; case "top,custom": case "custom,top": - p = BI.DOM.getTopAdaptPosition(combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight); + p = BI.DOM.getTopAdaptPosition(combo, this.popupView, (o.adjustYOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight); + p.dir = "top"; break; case "custom,bottom": case "bottom,custom": - p = BI.DOM.getBottomAdaptPosition(combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight); + p = BI.DOM.getBottomAdaptPosition(combo, this.popupView, (o.adjustYOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight); + p.dir = "bottom"; break; case "left,custom": case "custom,left": - p = BI.DOM.getLeftAdaptPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength); + p = BI.DOM.getLeftAdaptPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0)); delete p.top; delete p.adaptHeight; + p.dir = "left"; break; case "custom,right": case "right,custom": - p = BI.DOM.getRightAdaptPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength); + p = BI.DOM.getRightAdaptPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0)); delete p.top; delete p.adaptHeight; + p.dir = "right"; break; } if ("adaptHeight" in p) { this.resetListHeight(p["adaptHeight"]); } + var width = this.combo.element.outerWidth(); + var height = this.combo.element.outerHeight(); + this.popupView.setDirection(p.dir, { + width: width, + height: height + }); if ("left" in p) { this.popupView.element.css({ left: p.left diff --git a/src/base/layer/layer.popup.js b/src/base/layer/layer.popup.js index 8ed9e336e..6dc4b0abb 100644 --- a/src/base/layer/layer.popup.js +++ b/src/base/layer/layer.popup.js @@ -4,9 +4,12 @@ * @extends BI.Widget */ BI.PopupView = BI.inherit(BI.Widget, { + _const: { + TRIANGLE_LENGTH: 9 + }, _defaultConfig: function (props) { return BI.extend(BI.PopupView.superclass._defaultConfig.apply(this, arguments), { - _baseCls: "bi-popup-view" + (props.primary ? " bi-primary" : ""), + _baseCls: "bi-popup-view" + (props.primary ? " bi-primary" : ""), // 品牌色 primary: false, maxWidth: "auto", @@ -21,6 +24,7 @@ BI.PopupView = BI.inherit(BI.Widget, { hgap: 0, innerVGap: 0, innerHGap: 0, + showArrow: true, direction: BI.Direction.Top, // 工具栏的方向 stopEvent: false, // 是否停止mousedown、mouseup事件 stopPropagation: false, // 是否停止mousedown、mouseup向上冒泡 @@ -56,12 +60,12 @@ BI.PopupView = BI.inherit(BI.Widget, { "z-index": BI.zIndex_popup, "min-width": BI.isNumeric(o.minWidth) ? (o.minWidth / BI.pixRatio + BI.pixUnit) : o.minWidth, "max-width": BI.isNumeric(o.maxWidth) ? (o.maxWidth / BI.pixRatio + BI.pixUnit) : o.maxWidth - }).bind({ click: fn }); + }).bind({click: fn}); this.element.bind("mousewheel", fn); - o.stopPropagation && this.element.bind({ mousedown: fn, mouseup: fn, mouseover: fn }); - o.stopEvent && this.element.bind({ mousedown: stop, mouseup: stop, mouseover: stop }); + o.stopPropagation && this.element.bind({mousedown: fn, mouseup: fn, mouseover: fn}); + o.stopEvent && this.element.bind({mousedown: stop, mouseup: stop, mouseover: stop}); this.tool = this._createTool(); this.tab = this._createTab(); this.view = this._createView(); @@ -84,25 +88,47 @@ BI.PopupView = BI.inherit(BI.Widget, { bgap: o.bgap, vgap: o.vgap, hgap: o.hgap, - items: BI.LogicFactory.createLogicItemsByDirection(o.direction, - BI.extend({ + items: BI.LogicFactory.createLogicItemsByDirection(o.direction, BI.extend({ cls: "list-view-outer bi-card list-view-shadow" + (o.primary ? " bi-primary" : "") }, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({}, o.logic, { items: BI.LogicFactory.createLogicItemsByDirection(o.direction, this.tool, this.tab, this.view, this.toolbar) }))) ) })))); + if (o.showArrow) { + this.arrow = BI.createWidget({ + type: "bi.absolute", + cls: "bi-bubble-arrow", + items: [{ + type: "bi.layout", + cls: "bubble-arrow" + }] + }); + // 因为三角符号的原因位置变大了,需要占位 + this.placeholder = BI.createWidget({ + type: "bi.layout" + }); + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: this.arrow + }, { + el: this.placeholder + }] + }); + } }, _createView: function () { var o = this.options; - this.button_group = BI.createWidget(o.el, { type: "bi.button_group", value: o.value }); + this.button_group = BI.createWidget(o.el, {type: "bi.button_group", value: o.value}); this.button_group.element.css({ "min-height": BI.isNumeric(o.minHeight) ? (o.minHeight / BI.pixRatio + BI.pixUnit) : o.minHeight, "padding-top": o.innerVGap / BI.pixRatio + BI.pixUnit, "padding-bottom": o.innerVGap / BI.pixRatio + BI.pixUnit, "padding-left": o.innerHGap / BI.pixRatio + BI.pixUnit, - "padding-right": o.innerHGap / BI.pixRatio + BI.pixUnit, + "padding-right": o.innerHGap / BI.pixRatio + BI.pixUnit }); return this.button_group; }, @@ -147,6 +173,141 @@ BI.PopupView = BI.inherit(BI.Widget, { }); }, + setDirection: function (direction, size) { + if (this.options.showArrow) { + var style, placeholderStyle; + switch (direction) { + case "bottom": + case "bottom,right": + direction = "bottom"; + style = { + left: size.width / 2 - 6 + }; + placeholderStyle = { + width: size.width, + left: 0, + right: 0, + height: this._const.TRIANGLE_LENGTH, + top: -this._const.TRIANGLE_LENGTH, + bottom: "" + }; + break; + case "bottom,left": + direction = "bottom"; + style = { + right: size.width / 2 - 6 + }; + placeholderStyle = { + width: size.width, + left: 0, + right: 0, + height: this._const.TRIANGLE_LENGTH, + top: -this._const.TRIANGLE_LENGTH, + bottom: "" + }; + break; + case "top": + case "top,right": + direction = "top"; + style = { + left: size.width / 2 - 6 + }; + placeholderStyle = { + width: size.width, + left: 0, + right: 0, + height: this._const.TRIANGLE_LENGTH, + top: "", + bottom: -this._const.TRIANGLE_LENGTH + }; + break; + case "top,left": + direction = "top"; + style = { + right: size.width / 2 - 6 + }; + placeholderStyle = { + width: size.width, + left: 0, + right: 0, + height: this._const.TRIANGLE_LENGTH, + top: -this._const.TRIANGLE_LENGTH, + bottom: "" + }; + break; + case "left": + case "left,bottom": + direction = "left"; + style = { + top: size.height / 2 - 6 + }; + placeholderStyle = { + height: size.height, + top: 0, + bottom: 0, + width: this._const.TRIANGLE_LENGTH, + right: -this._const.TRIANGLE_LENGTH, + left: "" + }; + break; + case "left,top": + direction = "left"; + style = { + bottom: size.height / 2 - 6 + }; + placeholderStyle = { + height: size.height, + top: 0, + bottom: 0, + width: this._const.TRIANGLE_LENGTH, + right: -this._const.TRIANGLE_LENGTH, + left: "" + }; + break; + case "right": + case "right,bottom": + direction = "right"; + style = { + top: size.height / 2 - 6 + }; + placeholderStyle = { + height: size.height, + top: 0, + bottom: 0, + width: this._const.TRIANGLE_LENGTH, + left: -this._const.TRIANGLE_LENGTH, + right: "" + }; + break; + case "right,top": + direction = "right"; + style = { + bottom: size.height / 2 - 6 + }; + placeholderStyle = { + height: size.height, + top: 0, + bottom: 0, + width: this._const.TRIANGLE_LENGTH, + left: -this._const.TRIANGLE_LENGTH, + right: "" + }; + break; + case "right,innerRight": + break; + case "right,innerLeft": + break; + case "innerRight": + break; + case "innerLeft": + break; + } + this.element.removeClass("left").removeClass("right").removeClass("top").removeClass("bottom").addClass(direction); + this.arrow.element.css(style); + this.placeholder.element.css(placeholderStyle); + } + }, + getView: function () { return this.view; }, @@ -166,7 +327,7 @@ BI.PopupView = BI.inherit(BI.Widget, { toolHeight = ((this.tool && this.tool.attr("height")) || 24) * ((this.tool && this.tool.isVisible()) ? 1 : 0); var resetHeight = h - tbHeight - tabHeight - toolHeight - 2 * this.options.innerVGap; this.view.resetHeight ? this.view.resetHeight(resetHeight) : - this.view.element.css({ "max-height": resetHeight / BI.pixRatio + BI.pixUnit }); + this.view.element.css({"max-height": resetHeight / BI.pixRatio + BI.pixUnit}); }, setValue: function (selectedValues) { diff --git a/src/case/combo/bubblecombo/combo.bubble.js b/src/case/combo/bubblecombo/combo.bubble.js index 997caff67..b6b6b0f47 100644 --- a/src/case/combo/bubblecombo/combo.bubble.js +++ b/src/case/combo/bubblecombo/combo.bubble.js @@ -5,9 +5,6 @@ * @extends BI.Widget */ BI.BubbleCombo = BI.inherit(BI.Widget, { - _const: { - TRIANGLE_LENGTH: 9 - }, _defaultConfig: function () { return BI.extend(BI.BubbleCombo.superclass._defaultConfig.apply(this, arguments), { baseCls: "bi-bubble-combo", @@ -49,12 +46,12 @@ BI.BubbleCombo = BI.inherit(BI.Widget, { hideWhenAnotherComboOpen: o.hideWhenAnotherComboOpen, isNeedAdjustHeight: o.isNeedAdjustHeight, isNeedAdjustWidth: o.isNeedAdjustWidth, - adjustLength: this._getAdjustLength(), stopPropagation: o.stopPropagation, adjustXOffset: 0, adjustYOffset: 0, hideChecker: o.hideChecker, offsetStyle: o.offsetStyle, + showArrow: true, el: o.el, popup: BI.extend({ type: "bi.bubble_popup_view", @@ -82,11 +79,9 @@ BI.BubbleCombo = BI.inherit(BI.Widget, { self.fireEvent(BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW, arguments); }); this.combo.on(BI.Combo.EVENT_AFTER_POPUPVIEW, function () { - self._showTriangle(); self.fireEvent(BI.BubbleCombo.EVENT_AFTER_POPUPVIEW, arguments); }); this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW, function () { - self._hideTriangle(); self.fireEvent(BI.BubbleCombo.EVENT_BEFORE_HIDEVIEW, arguments); }); this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW, function () { @@ -94,118 +89,7 @@ BI.BubbleCombo = BI.inherit(BI.Widget, { }); }, - _getAdjustLength: function () { - return this._const.TRIANGLE_LENGTH + this.options.adjustLength; - }, - - _createTriangle: function (direction) { - var self = this, o = this.options, pos = {}, op = {}; - var adjustLength = this.options.adjustLength; - var offset = this.element.offset(); - var left = offset.left, right = offset.left + this.element.outerWidth(); - var top = offset.top, bottom = offset.top + this.element.outerHeight(); - switch (direction) { - case "left": - pos = { - top: top, - height: this.element.outerHeight(), - left: left - adjustLength - this._const.TRIANGLE_LENGTH - }; - op = {width: this._const.TRIANGLE_LENGTH}; - break; - case "right": - pos = { - top: top, - height: this.element.outerHeight(), - left: right + adjustLength - }; - op = {width: this._const.TRIANGLE_LENGTH}; - break; - case "top": - pos = { - left: left, - width: this.element.outerWidth(), - top: top - adjustLength - this._const.TRIANGLE_LENGTH - }; - op = {height: this._const.TRIANGLE_LENGTH}; - break; - case "bottom": - pos = { - left: left, - width: this.element.outerWidth(), - top: bottom + adjustLength - }; - op = {height: this._const.TRIANGLE_LENGTH}; - break; - default: - break; - } - this.triangle && this.triangle.destroy(); - this.triangle = BI.createWidget(op, { - type: "bi.center_adapt", - scrollable: false, - cls: "button-combo-triangle-wrapper", - items: [{ - type: "bi.layout", - cls: "bubble-combo-triangle-" + direction + (o.primary ? " bi-primary" : "") - }] - }); - pos.el = this.triangle; - // 动画结束后再画三角 - setTimeout(function () { - BI.createWidget({ - type: "bi.absolute", - element: self, - items: [pos] - }); - }, 200); - }, - - _createLeftTriangle: function () { - this._createTriangle("left"); - }, - - _createRightTriangle: function () { - this._createTriangle("right"); - }, - - _createTopTriangle: function () { - this._createTriangle("top"); - }, - - _createBottomTriangle: function () { - this._createTriangle("bottom"); - }, - - _showTriangle: function () { - var pos = this.combo.getPopupPosition(); - switch (pos.dir) { - case "left,top": - case "left,bottom": - this._createLeftTriangle(); - break; - case "right,top": - case "right,bottom": - this._createRightTriangle(); - break; - case "top,left": - case "top,right": - this._createTopTriangle(); - break; - case "bottom,left": - case "bottom,right": - this._createBottomTriangle(); - break; - } - }, - - _hideTriangle: function () { - this.triangle && this.triangle.destroy(); - this.triangle = null; - }, - hideView: function () { - this._hideTriangle(); this.combo && this.combo.hideView(); }, diff --git a/src/less/base/view/popupview.less b/src/less/base/view/popupview.less index 96191b06b..cc8387fb7 100644 --- a/src/less/base/view/popupview.less +++ b/src/less/base/view/popupview.less @@ -27,7 +27,7 @@ } } -.bi-popup-view[data-popper-placement^='top'] { +.bi-popup-view[data-popper-placement^='top'], .bi-popup-view.top { > .bi-bubble-arrow { bottom: -12px; > .bubble-arrow { @@ -35,7 +35,7 @@ } } } -.bi-popup-view[data-popper-placement^='bottom'] { +.bi-popup-view[data-popper-placement^='bottom'], .bi-popup-view.bottom { > .bi-bubble-arrow { top: -12px; > .bubble-arrow { @@ -43,7 +43,7 @@ } } } -.bi-popup-view[data-popper-placement^='left'] { +.bi-popup-view[data-popper-placement^='left'], .bi-popup-view.left { > .bi-bubble-arrow { right: -12px; > .bubble-arrow { @@ -51,7 +51,7 @@ } } } -.bi-popup-view[data-popper-placement^='right'] { +.bi-popup-view[data-popper-placement^='right'], .bi-popup-view.right { > .bi-bubble-arrow { left: -12px; > .bubble-arrow { From 91263f84783ec0e9b2a70a160ddb71c23ca0f0df Mon Sep 17 00:00:00 2001 From: data Date: Fri, 21 Jan 2022 18:52:22 +0800 Subject: [PATCH 24/58] auto upgrade version to 2.0.20220121185215 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 394984f7a..b6d621e82 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220121170213", + "version": "2.0.20220121185215", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 875b67c3aba562c1948b805d5f838ecf5176d12c Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 21 Jan 2022 19:28:08 +0800 Subject: [PATCH 25/58] =?UTF-8?q?feature:=20=E5=B0=8F=E4=B8=89=E8=A7=92?= =?UTF-8?q?=E6=8D=A2=E4=B8=80=E7=A7=8D=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/combo/bubblecombo/popup.bubble.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/case/combo/bubblecombo/popup.bubble.js b/src/case/combo/bubblecombo/popup.bubble.js index d823651fe..d7f546f7d 100644 --- a/src/case/combo/bubblecombo/popup.bubble.js +++ b/src/case/combo/bubblecombo/popup.bubble.js @@ -138,6 +138,7 @@ BI.TextBubblePopupBarView = BI.inherit(BI.Widget, { return { type: "bi.bubble_bar_popup_view", primary: o.primary, + showArrow: o.showArrow, minWidth: o.minWidth, maxWidth: o.maxWidth, minHeight: o.minHeight, @@ -157,6 +158,9 @@ BI.TextBubblePopupBarView = BI.inherit(BI.Widget, { }; }, + setDirection: function (direction, size) { + this.popup.setDirection(direction, size); + }, populate: function (v) { this.text.setText(v || this.options.text); } From 4aede4f9f18359890333a4b6f9ecf5e630c7b5f9 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 21 Jan 2022 19:38:33 +0800 Subject: [PATCH 26/58] =?UTF-8?q?feature:=20=E5=B0=8F=E4=B8=89=E8=A7=92?= =?UTF-8?q?=E6=8D=A2=E4=B8=80=E7=A7=8D=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/layer/layer.popup.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/base/layer/layer.popup.js b/src/base/layer/layer.popup.js index 6dc4b0abb..78ae47633 100644 --- a/src/base/layer/layer.popup.js +++ b/src/base/layer/layer.popup.js @@ -199,7 +199,7 @@ BI.PopupView = BI.inherit(BI.Widget, { }; placeholderStyle = { width: size.width, - left: 0, + left: "", right: 0, height: this._const.TRIANGLE_LENGTH, top: -this._const.TRIANGLE_LENGTH, @@ -228,11 +228,11 @@ BI.PopupView = BI.inherit(BI.Widget, { }; placeholderStyle = { width: size.width, - left: 0, + left: "", right: 0, height: this._const.TRIANGLE_LENGTH, - top: -this._const.TRIANGLE_LENGTH, - bottom: "" + top: "", + bottom: -this._const.TRIANGLE_LENGTH }; break; case "left": @@ -257,7 +257,7 @@ BI.PopupView = BI.inherit(BI.Widget, { }; placeholderStyle = { height: size.height, - top: 0, + top: "", bottom: 0, width: this._const.TRIANGLE_LENGTH, right: -this._const.TRIANGLE_LENGTH, @@ -286,7 +286,7 @@ BI.PopupView = BI.inherit(BI.Widget, { }; placeholderStyle = { height: size.height, - top: 0, + top: "", bottom: 0, width: this._const.TRIANGLE_LENGTH, left: -this._const.TRIANGLE_LENGTH, From ce99266d784e9d76884a6db6d63a62d4ce0411ed Mon Sep 17 00:00:00 2001 From: data Date: Fri, 21 Jan 2022 19:42:25 +0800 Subject: [PATCH 27/58] auto upgrade version to 2.0.20220121194219 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b6d621e82..54ffd9c59 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220121185215", + "version": "2.0.20220121194219", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 43b6a78cab3a47fab59c315752fd3d2b18ec4e78 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 21 Jan 2022 19:39:57 +0800 Subject: [PATCH 28/58] =?UTF-8?q?feature:=20=E5=B0=8F=E4=B8=89=E8=A7=92?= =?UTF-8?q?=E6=8D=A2=E4=B8=80=E7=A7=8D=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/combination/bubble.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/combination/bubble.js b/src/base/combination/bubble.js index 5177f3020..761ba4185 100644 --- a/src/base/combination/bubble.js +++ b/src/base/combination/bubble.js @@ -22,7 +22,7 @@ isDefaultInit: false, destroyWhenHide: false, hideWhenClickOutside: true, - showArrow: true, + showArrow: false, hideWhenBlur: false, isNeedAdjustHeight: true, // 是否需要高度调整 isNeedAdjustWidth: true, From 73706acfb44d3494c44f20856d3003ccfca603ef Mon Sep 17 00:00:00 2001 From: data Date: Fri, 21 Jan 2022 19:53:24 +0800 Subject: [PATCH 29/58] auto upgrade version to 2.0.20220121195319 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 54ffd9c59..005c37d18 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220121194219", + "version": "2.0.20220121195319", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From d38c916f8bfb7b185a68f6024e26b7448d50074a Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 21 Jan 2022 19:55:02 +0800 Subject: [PATCH 30/58] =?UTF-8?q?feature:=20=E5=B0=8F=E4=B8=89=E8=A7=92?= =?UTF-8?q?=E6=8D=A2=E4=B8=80=E7=A7=8D=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/layer/layer.popup.js | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/src/base/layer/layer.popup.js b/src/base/layer/layer.popup.js index 78ae47633..1b698d61b 100644 --- a/src/base/layer/layer.popup.js +++ b/src/base/layer/layer.popup.js @@ -181,10 +181,10 @@ BI.PopupView = BI.inherit(BI.Widget, { case "bottom,right": direction = "bottom"; style = { - left: size.width / 2 - 6 + // 5表示留出一定的空间 + left: Math.min(size.width / 2 - 6, this.element.outerWidth() - 12 - 5) }; placeholderStyle = { - width: size.width, left: 0, right: 0, height: this._const.TRIANGLE_LENGTH, @@ -195,11 +195,10 @@ BI.PopupView = BI.inherit(BI.Widget, { case "bottom,left": direction = "bottom"; style = { - right: size.width / 2 - 6 + right: Math.min(size.width / 2 - 6, this.element.outerWidth() - 12 - 5) }; placeholderStyle = { - width: size.width, - left: "", + left: 0, right: 0, height: this._const.TRIANGLE_LENGTH, top: -this._const.TRIANGLE_LENGTH, @@ -210,10 +209,9 @@ BI.PopupView = BI.inherit(BI.Widget, { case "top,right": direction = "top"; style = { - left: size.width / 2 - 6 + left: Math.min(size.width / 2 - 6, this.element.outerWidth() - 12 - 5) }; placeholderStyle = { - width: size.width, left: 0, right: 0, height: this._const.TRIANGLE_LENGTH, @@ -224,11 +222,10 @@ BI.PopupView = BI.inherit(BI.Widget, { case "top,left": direction = "top"; style = { - right: size.width / 2 - 6 + right: Math.min(size.width / 2 - 6, this.element.outerWidth() - 12 - 5) }; placeholderStyle = { - width: size.width, - left: "", + left: 0, right: 0, height: this._const.TRIANGLE_LENGTH, top: "", @@ -239,10 +236,9 @@ BI.PopupView = BI.inherit(BI.Widget, { case "left,bottom": direction = "left"; style = { - top: size.height / 2 - 6 + top: Math.min(size.height / 2 - 6, this.element.outerHeight() - 12 - 5) }; placeholderStyle = { - height: size.height, top: 0, bottom: 0, width: this._const.TRIANGLE_LENGTH, @@ -253,11 +249,10 @@ BI.PopupView = BI.inherit(BI.Widget, { case "left,top": direction = "left"; style = { - bottom: size.height / 2 - 6 + bottom: Math.min(size.height / 2 - 6, this.element.outerHeight() - 12 - 5) }; placeholderStyle = { - height: size.height, - top: "", + top: 0, bottom: 0, width: this._const.TRIANGLE_LENGTH, right: -this._const.TRIANGLE_LENGTH, @@ -268,10 +263,9 @@ BI.PopupView = BI.inherit(BI.Widget, { case "right,bottom": direction = "right"; style = { - top: size.height / 2 - 6 + top: Math.min(size.height / 2 - 6, this.element.outerHeight() - 12 - 5) }; placeholderStyle = { - height: size.height, top: 0, bottom: 0, width: this._const.TRIANGLE_LENGTH, @@ -282,11 +276,10 @@ BI.PopupView = BI.inherit(BI.Widget, { case "right,top": direction = "right"; style = { - bottom: size.height / 2 - 6 + bottom: Math.min(size.height / 2 - 6, this.element.outerHeight() - 12 - 5) }; placeholderStyle = { - height: size.height, - top: "", + top: 0, bottom: 0, width: this._const.TRIANGLE_LENGTH, left: -this._const.TRIANGLE_LENGTH, From dfaa50902bacb384072542c7b955467efe56cc68 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 21 Jan 2022 19:58:58 +0800 Subject: [PATCH 31/58] =?UTF-8?q?feature:=20=E5=B0=8F=E4=B8=89=E8=A7=92?= =?UTF-8?q?=E6=8D=A2=E4=B8=80=E7=A7=8D=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/combination/bubble.js | 2 +- src/base/combination/combo.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/base/combination/bubble.js b/src/base/combination/bubble.js index 761ba4185..5177f3020 100644 --- a/src/base/combination/bubble.js +++ b/src/base/combination/bubble.js @@ -22,7 +22,7 @@ isDefaultInit: false, destroyWhenHide: false, hideWhenClickOutside: true, - showArrow: false, + showArrow: true, hideWhenBlur: false, isNeedAdjustHeight: true, // 是否需要高度调整 isNeedAdjustWidth: true, diff --git a/src/base/combination/combo.js b/src/base/combination/combo.js index 6d26d297b..52e9df59a 100644 --- a/src/base/combination/combo.js +++ b/src/base/combination/combo.js @@ -28,6 +28,7 @@ hideWhenBlur: true, hideWhenAnotherComboOpen: false, hideWhenClickOutside: true, + showArrow: false, isNeedAdjustHeight: true, // 是否需要高度调整 isNeedAdjustWidth: true, stopEvent: false, From ae119fd9c3544c87831b030e2a2845e15e975e21 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 21 Jan 2022 20:06:52 +0800 Subject: [PATCH 32/58] =?UTF-8?q?feature:=20=E5=B0=8F=E4=B8=89=E8=A7=92?= =?UTF-8?q?=E6=8D=A2=E4=B8=80=E7=A7=8D=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/combination/bubble.js | 2 +- src/base/combination/combo.js | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/base/combination/bubble.js b/src/base/combination/bubble.js index 5177f3020..47c067e20 100644 --- a/src/base/combination/bubble.js +++ b/src/base/combination/bubble.js @@ -321,7 +321,7 @@ this._assertPopupViewRender(); this.fireEvent(BI.Bubble.EVENT_BEFORE_POPUPVIEW); // popupVisible是为了获取其宽高, 放到可视范围之外以防止在IE下闪一下 - this.popupView.css({left: -999999999, top: -99999999}); + // this.popupView.css({left: -999999999, top: -99999999}); this.popupView.visible(); this.adjustWidth(e); diff --git a/src/base/combination/combo.js b/src/base/combination/combo.js index 52e9df59a..2019dd756 100644 --- a/src/base/combination/combo.js +++ b/src/base/combination/combo.js @@ -106,6 +106,28 @@ }); }, + _assertPopupView: function () { + var self = this, o = this.options; + if (this.popupView == null) { + this.popupView = BI.createWidget(this.options.popup, { + type: "bi.popup_view", + showArrow: o.showArrow, + value: o.value + }, this); + this.popupView.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { + if (type === BI.Events.CLICK) { + self.combo.setValue(self.getValue()); + self.fireEvent(BI.Bubble.EVENT_CHANGE, value, obj); + } + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + }); + this.popupView.setVisible(false); + BI.nextTick(function () { + self.fireEvent(BI.Bubble.EVENT_AFTER_INIT); + }); + } + }, + _hideView: function (e) { var o = this.options; this.fireEvent(BI.Combo.EVENT_BEFORE_HIDEVIEW); From 8af358af4fb4db26ba7ae2b5266d699b46b9ee06 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 21 Jan 2022 20:08:41 +0800 Subject: [PATCH 33/58] =?UTF-8?q?feature:=20=E5=B0=8F=E4=B8=89=E8=A7=92?= =?UTF-8?q?=E6=8D=A2=E4=B8=80=E7=A7=8D=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/combination/combo.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/base/combination/combo.js b/src/base/combination/combo.js index 2019dd756..45ceefa69 100644 --- a/src/base/combination/combo.js +++ b/src/base/combination/combo.js @@ -100,12 +100,6 @@ }, this)); }, - _initCombo: function () { - this.combo = BI.createWidget(this.options.el, { - value: this.options.value - }); - }, - _assertPopupView: function () { var self = this, o = this.options; if (this.popupView == null) { From 8982a9b49089e9478d3b9d8f53b03f8c5be262b2 Mon Sep 17 00:00:00 2001 From: data Date: Fri, 21 Jan 2022 20:24:26 +0800 Subject: [PATCH 34/58] auto upgrade version to 2.0.20220121202421 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 005c37d18..db9a8f88b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220121195319", + "version": "2.0.20220121202421", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From ed1452ea8036e2ebf15caa23b32702b409139cea Mon Sep 17 00:00:00 2001 From: freddy Date: Fri, 21 Jan 2022 21:01:16 +0800 Subject: [PATCH 35/58] =?UTF-8?q?REPORT-60473=20&&=20REPORT-64922=20fix:?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E4=B8=8B=E6=8B=89=E6=A1=86=E5=92=8C=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E6=8E=A7=E4=BB=B6focus=20blur=E5=92=8C=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E6=8E=A7=E4=BB=B6setWaterMark?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/combination/searcher.js | 8 ++++++++ .../treevaluechooser/combo.listtreevaluechooser.js | 8 ++++++++ .../combo.treevaluechooser.insert.js | 8 ++++++++ .../treevaluechooser/combo.treevaluechooser.js | 8 ++++++++ src/widget/dynamicdate/dynamicdate.combo.js | 12 ++++++++++++ src/widget/dynamicdate/dynamicdate.trigger.js | 13 ++++++++++++- src/widget/dynamicdatetime/dynamicdatetime.combo.js | 12 ++++++++++++ .../dynamicdatetime/dynamicdatetime.trigger.js | 13 ++++++++++++- .../multilayerselecttree.combo.js | 12 ++++++++++++ .../multilayerselecttree.trigger.js | 8 ++++++++ .../multilayersingletree.combo.js | 11 +++++++++++ .../multilayersingletree.trigger.js | 8 ++++++++ src/widget/multiselect/multiselect.trigger.js | 8 ++++++++ .../multiselect/trigger/searcher.multiselect.js | 8 ++++++++ src/widget/multitree/multi.tree.combo.js | 11 +++++++++++ src/widget/multitree/multi.tree.insert.combo.js | 11 +++++++++++ src/widget/multitree/multi.tree.list.combo.js | 11 +++++++++++ .../multitree/trigger/searcher.list.multi.tree.js | 8 ++++++++ src/widget/multitree/trigger/searcher.multi.tree.js | 8 ++++++++ src/widget/time/time.combo.js | 12 ++++++++++++ src/widget/time/time.trigger.js | 13 ++++++++++++- .../treevaluechooser/combo.listtreevaluechooser.ts | 4 ++++ .../combo.treevaluechooser.insert.ts | 4 ++++ .../treevaluechooser/combo.treevaluechooser.ts | 4 ++++ typescript/widget/dynamicdate/dynamicdate.combo.ts | 6 ++++++ .../widget/dynamicdatetime/dynamicdatetime.combo.ts | 6 ++++++ .../multilayerselecttree.combo.ts | 4 ++++ .../multilayersingletree.combo.ts | 4 ++++ typescript/widget/multitree/multi.tree.combo.ts | 4 ++++ .../widget/multitree/multi.tree.insert.combo.ts | 4 ++++ .../widget/multitree/multi.tree.list.combo.ts | 4 ++++ typescript/widget/time/time.combo.ts | 6 ++++++ 32 files changed, 258 insertions(+), 3 deletions(-) diff --git a/src/base/combination/searcher.js b/src/base/combination/searcher.js index 7da8689c2..e7d16c53e 100644 --- a/src/base/combination/searcher.js +++ b/src/base/combination/searcher.js @@ -307,6 +307,14 @@ BI.Searcher = BI.inherit(BI.Widget, { destroyed: function () { BI.Maskers.remove(this.getName()); + }, + + focus: function () { + this.editor.focus(); + }, + + blur: function () { + this.editor.blur(); } }); BI.Searcher.EVENT_CHANGE = "EVENT_CHANGE"; diff --git a/src/component/treevaluechooser/combo.listtreevaluechooser.js b/src/component/treevaluechooser/combo.listtreevaluechooser.js index a90c6a4b9..e6bebe3d6 100644 --- a/src/component/treevaluechooser/combo.listtreevaluechooser.js +++ b/src/component/treevaluechooser/combo.listtreevaluechooser.js @@ -102,6 +102,14 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser, this._initData(items); } this.combo.populate(); + }, + + focus: function () { + this.combo.focus(); + }, + + blur: function () { + this.combo.blur(); } }); diff --git a/src/component/treevaluechooser/combo.treevaluechooser.insert.js b/src/component/treevaluechooser/combo.treevaluechooser.insert.js index b01fe2e0f..d506dfe8b 100644 --- a/src/component/treevaluechooser/combo.treevaluechooser.insert.js +++ b/src/component/treevaluechooser/combo.treevaluechooser.insert.js @@ -101,6 +101,14 @@ BI.TreeValueChooserInsertCombo = BI.inherit(BI.AbstractTreeValueChooser, { this._initData(items); } this.combo.populate(); + }, + + focus: function () { + this.combo.focus(); + }, + + blur: function () { + this.combo.blur(); } }); diff --git a/src/component/treevaluechooser/combo.treevaluechooser.js b/src/component/treevaluechooser/combo.treevaluechooser.js index fbff4000a..f47b3f84b 100644 --- a/src/component/treevaluechooser/combo.treevaluechooser.js +++ b/src/component/treevaluechooser/combo.treevaluechooser.js @@ -105,6 +105,14 @@ BI.TreeValueChooserCombo = BI.inherit(BI.AbstractTreeValueChooser, { this._initData(items); } this.combo.populate(); + }, + + focus: function () { + this.combo.focus(); + }, + + blur: function () { + this.combo.blur(); } }); diff --git a/src/widget/dynamicdate/dynamicdate.combo.js b/src/widget/dynamicdate/dynamicdate.combo.js index 81fb7faa0..997211275 100644 --- a/src/widget/dynamicdate/dynamicdate.combo.js +++ b/src/widget/dynamicdate/dynamicdate.combo.js @@ -298,6 +298,18 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, { }, hidePopupView: function () { this.combo.hideView(); + }, + + focus: function () { + this.trigger.focus(); + }, + + blur: function () { + this.trigger.blur(); + }, + + setWaterMark: function (v) { + this.trigger.setWaterMark(v); } }); diff --git a/src/widget/dynamicdate/dynamicdate.trigger.js b/src/widget/dynamicdate/dynamicdate.trigger.js index 06bdb10ff..48e8a4601 100644 --- a/src/widget/dynamicdate/dynamicdate.trigger.js +++ b/src/widget/dynamicdate/dynamicdate.trigger.js @@ -308,8 +308,19 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, { }, getValue: function () { return this.storeValue; - } + }, + + focus: function () { + this.editor.focus(); + }, + blur: function () { + this.editor.blur(); + }, + + setWaterMark: function (v) { + this.editor.setWaterMark(v); + } }); BI.DynamicDateTrigger.EVENT_BLUR = "EVENT_BLUR"; diff --git a/src/widget/dynamicdatetime/dynamicdatetime.combo.js b/src/widget/dynamicdatetime/dynamicdatetime.combo.js index 6565f9943..37655791d 100644 --- a/src/widget/dynamicdatetime/dynamicdatetime.combo.js +++ b/src/widget/dynamicdatetime/dynamicdatetime.combo.js @@ -306,6 +306,18 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, { isValid: function () { return this.trigger.isValid(); + }, + + focus: function () { + this.trigger.focus(); + }, + + blur: function () { + this.trigger.blur(); + }, + + setWaterMark: function (v) { + this.trigger.setWaterMark(v); } }); diff --git a/src/widget/dynamicdatetime/dynamicdatetime.trigger.js b/src/widget/dynamicdatetime/dynamicdatetime.trigger.js index 6a1d4d5de..e58cd99f5 100644 --- a/src/widget/dynamicdatetime/dynamicdatetime.trigger.js +++ b/src/widget/dynamicdatetime/dynamicdatetime.trigger.js @@ -379,8 +379,19 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, { isValid: function () { return this.editor.isValid(); - } + }, + + focus: function () { + this.editor.focus(); + }, + blur: function () { + this.editor.blur(); + }, + + setWaterMark: function (v) { + this.editor.setWaterMark(v); + } }); BI.DynamicDateTimeTrigger.EVENT_BLUR = "EVENT_BLUR"; diff --git a/src/widget/multilayerselecttree/multilayerselecttree.combo.js b/src/widget/multilayerselecttree/multilayerselecttree.combo.js index 412b1f9e7..b11b9bc14 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.combo.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.combo.js @@ -156,6 +156,10 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { }, { eventName: BI.MultiLayerSelectTreeTrigger.EVENT_FOCUS, action: function () { + if (!self.combo.isViewVisible()) { + self.combo.showView(); + } + self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_FOCUS); } }, { @@ -238,6 +242,14 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { populate: function (items) { this.combo.populate(items); + }, + + focus: function () { + this.trigger.focus(); + }, + + blur: function () { + this.trigger.blur(); } }); diff --git a/src/widget/multilayerselecttree/multilayerselecttree.trigger.js b/src/widget/multilayerselecttree/multilayerselecttree.trigger.js index 7203378ba..2fd1c96ec 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.trigger.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.trigger.js @@ -237,6 +237,14 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { getValue: function () { return this.searcher.getValue(); + }, + + focus: function () { + this.searcher.focus(); + }, + + blur: function () { + this.searcher.blur(); } }); diff --git a/src/widget/multilayersingletree/multilayersingletree.combo.js b/src/widget/multilayersingletree/multilayersingletree.combo.js index 4109f6eb7..8d22714e1 100644 --- a/src/widget/multilayersingletree/multilayersingletree.combo.js +++ b/src/widget/multilayersingletree/multilayersingletree.combo.js @@ -158,6 +158,9 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { }, { eventName: BI.MultiLayerSingleTreeTrigger.EVENT_FOCUS, action: function () { + if (!self.combo.isViewVisible()) { + self.combo.showView(); + } self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_FOCUS); } }, { @@ -239,6 +242,14 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { populate: function (items) { this.combo.populate(items); + }, + + focus: function () { + this.trigger.focus(); + }, + + blur: function () { + this.trigger.blur(); } }); diff --git a/src/widget/multilayersingletree/multilayersingletree.trigger.js b/src/widget/multilayersingletree/multilayersingletree.trigger.js index 20e47af0d..0812c8029 100644 --- a/src/widget/multilayersingletree/multilayersingletree.trigger.js +++ b/src/widget/multilayersingletree/multilayersingletree.trigger.js @@ -239,6 +239,14 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { getValue: function () { return this.searcher.getValue(); + }, + + focus: function () { + this.searcher.focus(); + }, + + blur: function () { + this.searcher.blur(); } }); BI.MultiLayerSingleTreeTrigger.EVENT_FOCUS = "EVENT_FOCUS"; diff --git a/src/widget/multiselect/multiselect.trigger.js b/src/widget/multiselect/multiselect.trigger.js index d24d9c23a..d829fa740 100644 --- a/src/widget/multiselect/multiselect.trigger.js +++ b/src/widget/multiselect/multiselect.trigger.js @@ -136,6 +136,14 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, { getValue: function () { return this.searcher.getValue(); + }, + + focus: function () { + this.searcher.focus(); + }, + + blur: function () { + this.searcher.blur(); } }); diff --git a/src/widget/multiselect/trigger/searcher.multiselect.js b/src/widget/multiselect/trigger/searcher.multiselect.js index ec26eccca..ab2688eb4 100644 --- a/src/widget/multiselect/trigger/searcher.multiselect.js +++ b/src/widget/multiselect/trigger/searcher.multiselect.js @@ -94,6 +94,14 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, { } }, + focus: function () { + this.editor.focus(); + }, + + blur: function () { + this.editor.blur(); + }, + adjustView: function () { this.searcher.adjustView(); }, diff --git a/src/widget/multitree/multi.tree.combo.js b/src/widget/multitree/multi.tree.combo.js index 5c6e177a7..67190043b 100644 --- a/src/widget/multitree/multi.tree.combo.js +++ b/src/widget/multitree/multi.tree.combo.js @@ -124,6 +124,9 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { }; this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS, function () { + if (!self.combo.isViewVisible()) { + self.combo.showView(); + } self.fireEvent(BI.MultiTreeCombo.EVENT_FOCUS); }); this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR, function () { @@ -344,6 +347,14 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { populate: function () { this.combo.populate(); + }, + + focus: function () { + this.trigger.focus(); + }, + + blur: function () { + this.trigger.blur(); } }); diff --git a/src/widget/multitree/multi.tree.insert.combo.js b/src/widget/multitree/multi.tree.insert.combo.js index b82d27f3f..632a46a24 100644 --- a/src/widget/multitree/multi.tree.insert.combo.js +++ b/src/widget/multitree/multi.tree.insert.combo.js @@ -140,6 +140,9 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { }; this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS, function () { + if (!self.combo.isViewVisible()) { + self.combo.showView(); + } self.fireEvent(BI.MultiTreeInsertCombo.EVENT_FOCUS); }); this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR, function () { @@ -360,6 +363,14 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { populate: function () { this.combo.populate(); + }, + + focus: function () { + this.trigger.focus(); + }, + + blur: function () { + this.trigger.blur(); } }); diff --git a/src/widget/multitree/multi.tree.list.combo.js b/src/widget/multitree/multi.tree.list.combo.js index 018f7f74b..68d50b989 100644 --- a/src/widget/multitree/multi.tree.list.combo.js +++ b/src/widget/multitree/multi.tree.list.combo.js @@ -158,6 +158,9 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { }; this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS, function () { + if (!self.combo.isViewVisible()) { + self.combo.showView(); + } self.fireEvent(BI.MultiTreeListCombo.EVENT_FOCUS); }); this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR, function () { @@ -378,6 +381,14 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { populate: function () { this.combo.populate(); + }, + + focus: function () { + this.trigger.focus(); + }, + + blur: function () { + this.trigger.blur(); } }); diff --git a/src/widget/multitree/trigger/searcher.list.multi.tree.js b/src/widget/multitree/trigger/searcher.list.multi.tree.js index 2a8d9f4c5..3b126a5a5 100644 --- a/src/widget/multitree/trigger/searcher.list.multi.tree.js +++ b/src/widget/multitree/trigger/searcher.list.multi.tree.js @@ -153,6 +153,14 @@ BI.MultiListTreeSearcher = BI.inherit(BI.Widget, { populate: function (items) { this.searcher.populate.apply(this.searcher, arguments); + }, + + focus: function () { + this.editor.focus(); + }, + + blur: function () { + this.editor.blur(); } }); diff --git a/src/widget/multitree/trigger/searcher.multi.tree.js b/src/widget/multitree/trigger/searcher.multi.tree.js index 6790e2c23..ffece8cb9 100644 --- a/src/widget/multitree/trigger/searcher.multi.tree.js +++ b/src/widget/multitree/trigger/searcher.multi.tree.js @@ -184,6 +184,14 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, { populate: function (items) { this.searcher.populate.apply(this.searcher, arguments); + }, + + focus: function () { + this.editor.focus(); + }, + + blur: function () { + this.editor.blur(); } }); diff --git a/src/widget/time/time.combo.js b/src/widget/time/time.combo.js index e816b8fa6..d69443bc7 100644 --- a/src/widget/time/time.combo.js +++ b/src/widget/time/time.combo.js @@ -222,6 +222,18 @@ this.setValue(nowTome); this.hidePopupView(); this.fireEvent(BI.TimeCombo.EVENT_CONFIRM); + }, + + focus: function () { + this.trigger.focus(); + }, + + blur: function () { + this.trigger.blur(); + }, + + setWaterMark: function (v) { + this.trigger.setWaterMark(v); } }); diff --git a/src/widget/time/time.trigger.js b/src/widget/time/time.trigger.js index 037a03888..cd8e25cd4 100644 --- a/src/widget/time/time.trigger.js +++ b/src/widget/time/time.trigger.js @@ -180,8 +180,19 @@ getValue: function () { return this.storeValue; - } + }, + + focus: function () { + this.editor.focus(); + }, + + blur: function () { + this.editor.blur(); + }, + setWaterMark: function (v) { + this.editor.setWaterMark(v); + } }); BI.shortcut("bi.time_trigger", BI.TimeTrigger); })(); \ No newline at end of file diff --git a/typescript/component/treevaluechooser/combo.listtreevaluechooser.ts b/typescript/component/treevaluechooser/combo.listtreevaluechooser.ts index bc47f39f3..6709fd8e3 100644 --- a/typescript/component/treevaluechooser/combo.listtreevaluechooser.ts +++ b/typescript/component/treevaluechooser/combo.listtreevaluechooser.ts @@ -23,4 +23,8 @@ export declare class ListTreeValueChooserInsertCombo extends AbstractListTreeVal populate(items: T[]): void; getSearcher(): Widget; + + focus(): void; + + blur(): void; } diff --git a/typescript/component/treevaluechooser/combo.treevaluechooser.insert.ts b/typescript/component/treevaluechooser/combo.treevaluechooser.insert.ts index 41b785b18..971f44022 100644 --- a/typescript/component/treevaluechooser/combo.treevaluechooser.insert.ts +++ b/typescript/component/treevaluechooser/combo.treevaluechooser.insert.ts @@ -22,4 +22,8 @@ export declare class TreeValueChooserInsertCombo extends AbstractTreeValueChoose populate(items: T[]): void; getSearcher(): Widget; + + focus(): void; + + blur(): void; } diff --git a/typescript/component/treevaluechooser/combo.treevaluechooser.ts b/typescript/component/treevaluechooser/combo.treevaluechooser.ts index be535af4a..859480ce6 100644 --- a/typescript/component/treevaluechooser/combo.treevaluechooser.ts +++ b/typescript/component/treevaluechooser/combo.treevaluechooser.ts @@ -24,4 +24,8 @@ export declare class TreeValueChooserCombo extends AbstractTreeValueChooser { populate(items: T[]): void; getSearcher(): Widget; + + focus(): void; + + blur(): void; } diff --git a/typescript/widget/dynamicdate/dynamicdate.combo.ts b/typescript/widget/dynamicdate/dynamicdate.combo.ts index a7ead70cf..00921782f 100644 --- a/typescript/widget/dynamicdate/dynamicdate.combo.ts +++ b/typescript/widget/dynamicdate/dynamicdate.combo.ts @@ -36,6 +36,12 @@ export declare class DynamicDateCombo extends Single { hidePopupView(): void; getValue(): DynamicDataComboValue; + + focus(): void; + + blur(): void; + + setWaterMark(v: string): void; } export interface DynamicDataComboValue { diff --git a/typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts b/typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts index b6593b2a7..b4122ead8 100644 --- a/typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts +++ b/typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts @@ -32,4 +32,10 @@ export declare class DynamicDateTimeCombo extends Single { getKey(): string; hidePopupView(): void; + + focus(): void; + + blur(): void; + + setWaterMark(v: string): void } diff --git a/typescript/widget/multilayerselecttree/multilayerselecttree.combo.ts b/typescript/widget/multilayerselecttree/multilayerselecttree.combo.ts index 489186e72..a6625bebf 100644 --- a/typescript/widget/multilayerselecttree/multilayerselecttree.combo.ts +++ b/typescript/widget/multilayerselecttree/multilayerselecttree.combo.ts @@ -15,4 +15,8 @@ export declare class MultiLayerSelectTreeCombo extends Widget { populate(items: T[]): void; getSearcher(): Widget; + + focus(): void; + + blur(): void; } diff --git a/typescript/widget/multilayersingletree/multilayersingletree.combo.ts b/typescript/widget/multilayersingletree/multilayersingletree.combo.ts index 19150a8f6..706d3445f 100644 --- a/typescript/widget/multilayersingletree/multilayersingletree.combo.ts +++ b/typescript/widget/multilayersingletree/multilayersingletree.combo.ts @@ -15,4 +15,8 @@ export declare class MultiLayerSingleTreeCombo extends Widget { populate(items: T[]): void; getSearcher(): Widget; + + focus(): void; + + blur(): void; } diff --git a/typescript/widget/multitree/multi.tree.combo.ts b/typescript/widget/multitree/multi.tree.combo.ts index d8b546441..e96ed9808 100644 --- a/typescript/widget/multitree/multi.tree.combo.ts +++ b/typescript/widget/multitree/multi.tree.combo.ts @@ -15,4 +15,8 @@ export declare class MultiTreeCombo extends Single { hideView(): void; getSearcher(): Widget; + + focus(): void; + + blur(): void; } diff --git a/typescript/widget/multitree/multi.tree.insert.combo.ts b/typescript/widget/multitree/multi.tree.insert.combo.ts index b701f580b..55f2bbdf6 100644 --- a/typescript/widget/multitree/multi.tree.insert.combo.ts +++ b/typescript/widget/multitree/multi.tree.insert.combo.ts @@ -23,4 +23,8 @@ export declare class MultiTreeInsertCombo extends Single { populate(): void; getSearcher(): Widget; + + focus(): void; + + blur(): void; } diff --git a/typescript/widget/multitree/multi.tree.list.combo.ts b/typescript/widget/multitree/multi.tree.list.combo.ts index 375d1f5e1..202b8b9b0 100644 --- a/typescript/widget/multitree/multi.tree.list.combo.ts +++ b/typescript/widget/multitree/multi.tree.list.combo.ts @@ -22,4 +22,8 @@ export declare class MultiTreeListCombo extends Single { populate(): void; getSearcher(): Widget; + + focus(): void; + + blur(): void; } diff --git a/typescript/widget/time/time.combo.ts b/typescript/widget/time/time.combo.ts index fa14d017f..9b52d1fd1 100644 --- a/typescript/widget/time/time.combo.ts +++ b/typescript/widget/time/time.combo.ts @@ -10,4 +10,10 @@ export declare class TimeCombo extends Single { static EVENT_BEFORE_POPUPVIEW: string; hidePopupView(): void; + + focus(): void; + + blur(): void; + + setWaterMark(v: string): void; } From fbf582888920466f041eca4fa1e8fc4e8960bb7e Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 22 Jan 2022 19:19:20 +0800 Subject: [PATCH 36/58] =?UTF-8?q?feature:=20=E5=B0=8F=E4=B8=89=E8=A7=92?= =?UTF-8?q?=E6=8D=A2=E4=B8=80=E7=A7=8D=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/combination/combo.js | 4 +++- src/base/layer/layer.popup.js | 36 ++++++++++++++++++++++++++--------- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/src/base/combination/combo.js b/src/base/combination/combo.js index 45ceefa69..c7c74ce44 100644 --- a/src/base/combination/combo.js +++ b/src/base/combination/combo.js @@ -284,7 +284,9 @@ var height = this.combo.element.outerHeight(); this.popupView.setDirection(p.dir, { width: width, - height: height + height: height, + offsetStyle: o.offsetStyle, + offset: this.combo.element.offset() }); if ("left" in p) { this.popupView.element.css({ diff --git a/src/base/layer/layer.popup.js b/src/base/layer/layer.popup.js index 1b698d61b..e7da9ec8a 100644 --- a/src/base/layer/layer.popup.js +++ b/src/base/layer/layer.popup.js @@ -173,16 +173,34 @@ BI.PopupView = BI.inherit(BI.Widget, { }); }, - setDirection: function (direction, size) { + setDirection: function (direction, position) { if (this.options.showArrow) { var style, placeholderStyle; + var bodyBounds = BI.Widget._renderEngine.createElement("body").bounds(); + var bodyWidth = bodyBounds.width; + var bodyHeight = bodyBounds.height; + var popupWidth = this.element.outerWidth(); + var popupHeight = this.element.outerHeight(); + var offset = position.offset; + var offsetStyle = position.offsetStyle; + var middle = offsetStyle === "center" || offsetStyle === "middle"; + + var minLeft = Math.max(5, offset.left + 5 + popupWidth - bodyWidth); + var minRight = Math.max(5, popupWidth - (offset.left + 5)); + var minTop = Math.max(5, offset.top + 5 + popupHeight - bodyHeight); + var minBottom = Math.max(5, popupHeight - (offset.top + 5)); + + var maxLeft = Math.min(popupWidth - 12 - 5, offset.left + position.width - 12 - 5); + var maxRight = Math.min(popupWidth - 12 - 5, bodyWidth - (offset.left + position.width - 12 - 5)); + var maxTop = Math.min(popupHeight - 12 - 5, offset.top + position.height - 12 - 5); + var maxBottom = Math.min(popupHeight - 12 - 5, bodyHeight - (offset.top + position.height - 12 - 5)); switch (direction) { case "bottom": case "bottom,right": direction = "bottom"; style = { // 5表示留出一定的空间 - left: Math.min(size.width / 2 - 6, this.element.outerWidth() - 12 - 5) + left: BI.clamp((middle ? popupWidth : position.width) / 2 - 6, minLeft, maxLeft) }; placeholderStyle = { left: 0, @@ -195,7 +213,7 @@ BI.PopupView = BI.inherit(BI.Widget, { case "bottom,left": direction = "bottom"; style = { - right: Math.min(size.width / 2 - 6, this.element.outerWidth() - 12 - 5) + right: BI.clamp((middle ? popupWidth : position.width) / 2 - 6, minRight, maxRight) }; placeholderStyle = { left: 0, @@ -209,7 +227,7 @@ BI.PopupView = BI.inherit(BI.Widget, { case "top,right": direction = "top"; style = { - left: Math.min(size.width / 2 - 6, this.element.outerWidth() - 12 - 5) + left: BI.clamp((middle ? popupWidth : position.width) / 2 - 6, minLeft, maxLeft) }; placeholderStyle = { left: 0, @@ -222,7 +240,7 @@ BI.PopupView = BI.inherit(BI.Widget, { case "top,left": direction = "top"; style = { - right: Math.min(size.width / 2 - 6, this.element.outerWidth() - 12 - 5) + right: BI.clamp((middle ? popupWidth : position.width) / 2 - 6, minRight, maxRight) }; placeholderStyle = { left: 0, @@ -236,7 +254,7 @@ BI.PopupView = BI.inherit(BI.Widget, { case "left,bottom": direction = "left"; style = { - top: Math.min(size.height / 2 - 6, this.element.outerHeight() - 12 - 5) + top: BI.clamp((middle ? popupHeight : position.height) / 2 - 6, minTop, maxTop) }; placeholderStyle = { top: 0, @@ -249,7 +267,7 @@ BI.PopupView = BI.inherit(BI.Widget, { case "left,top": direction = "left"; style = { - bottom: Math.min(size.height / 2 - 6, this.element.outerHeight() - 12 - 5) + bottom: BI.clamp((middle ? popupHeight : position.height) / 2 - 6, minBottom, maxBottom) }; placeholderStyle = { top: 0, @@ -263,7 +281,7 @@ BI.PopupView = BI.inherit(BI.Widget, { case "right,bottom": direction = "right"; style = { - top: Math.min(size.height / 2 - 6, this.element.outerHeight() - 12 - 5) + top: BI.clamp((middle ? popupHeight : position.height) / 2 - 6, minTop, maxTop) }; placeholderStyle = { top: 0, @@ -276,7 +294,7 @@ BI.PopupView = BI.inherit(BI.Widget, { case "right,top": direction = "right"; style = { - bottom: Math.min(size.height / 2 - 6, this.element.outerHeight() - 12 - 5) + bottom: BI.clamp((middle ? popupHeight : position.height) / 2 - 6, minBottom, maxBottom) }; placeholderStyle = { top: 0, From 2bd887ed412b9cd2297a44785a48b5af247f7f97 Mon Sep 17 00:00:00 2001 From: data Date: Sat, 22 Jan 2022 19:32:16 +0800 Subject: [PATCH 37/58] auto upgrade version to 2.0.20220122193211 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index db9a8f88b..45f9e99f9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220121202421", + "version": "2.0.20220122193211", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From dbab202a202390c9a1c43b4324ae08c2c312afc4 Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 22 Jan 2022 19:43:25 +0800 Subject: [PATCH 38/58] =?UTF-8?q?feature:=20=E5=B0=8F=E4=B8=89=E8=A7=92?= =?UTF-8?q?=E6=8D=A2=E4=B8=80=E7=A7=8D=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/combo/bubblecombo/popup.bubble.js | 4 ++-- src/widget/multiselect/multiselect.popup.view.js | 6 +++++- src/widget/multiselect/multiselect.popup.view.nobar.js | 6 +++++- src/widget/multitree/multi.tree.popup.js | 4 ++++ .../multitextvalue.popup.view.search.js | 6 +++++- src/widget/singleselect/singleselect.popup.view.js | 8 ++++++-- 6 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/case/combo/bubblecombo/popup.bubble.js b/src/case/combo/bubblecombo/popup.bubble.js index d7f546f7d..92311b725 100644 --- a/src/case/combo/bubblecombo/popup.bubble.js +++ b/src/case/combo/bubblecombo/popup.bubble.js @@ -158,8 +158,8 @@ BI.TextBubblePopupBarView = BI.inherit(BI.Widget, { }; }, - setDirection: function (direction, size) { - this.popup.setDirection(direction, size); + setDirection: function (direction, position) { + this.popup.setDirection(direction, position); }, populate: function (v) { this.text.setText(v || this.options.text); diff --git a/src/widget/multiselect/multiselect.popup.view.js b/src/widget/multiselect/multiselect.popup.view.js index 53e6209c4..cefe9f0b2 100644 --- a/src/widget/multiselect/multiselect.popup.view.js +++ b/src/widget/multiselect/multiselect.popup.view.js @@ -84,7 +84,11 @@ BI.MultiSelectPopupView = BI.inherit(BI.Widget, { resetWidth: function (w) { this.popupView.resetWidth(w); - } + }, + + setDirection: function (direction, position) { + this.popupView.setDirection(direction, position); + }, }); BI.MultiSelectPopupView.EVENT_CHANGE = "EVENT_CHANGE"; diff --git a/src/widget/multiselect/multiselect.popup.view.nobar.js b/src/widget/multiselect/multiselect.popup.view.nobar.js index 26325a94e..9132ae5ee 100644 --- a/src/widget/multiselect/multiselect.popup.view.nobar.js +++ b/src/widget/multiselect/multiselect.popup.view.nobar.js @@ -80,7 +80,11 @@ BI.MultiSelectNoBarPopupView = BI.inherit(BI.Widget, { resetWidth: function (w) { this.popupView.resetWidth(w); - } + }, + + setDirection: function (direction, position) { + this.popupView.setDirection(direction, position); + }, }); BI.MultiSelectNoBarPopupView.EVENT_CHANGE = "EVENT_CHANGE"; diff --git a/src/widget/multitree/multi.tree.popup.js b/src/widget/multitree/multi.tree.popup.js index 3032e34cf..970c76cc6 100644 --- a/src/widget/multitree/multi.tree.popup.js +++ b/src/widget/multitree/multi.tree.popup.js @@ -84,6 +84,10 @@ BI.MultiTreePopup = BI.inherit(BI.Pane, { return this.tree.hasChecked(); }, + setDirection: function (direction, position) { + this.popupView.setDirection(direction, position); + }, + resetHeight: function (h) { this.popupView.resetHeight(h); }, diff --git a/src/widget/searchmultitextvaluecombo/multitextvalue.popup.view.search.js b/src/widget/searchmultitextvaluecombo/multitextvalue.popup.view.search.js index f1e6d7231..cb8027f0c 100644 --- a/src/widget/searchmultitextvaluecombo/multitextvalue.popup.view.search.js +++ b/src/widget/searchmultitextvaluecombo/multitextvalue.popup.view.search.js @@ -77,7 +77,11 @@ BI.SearchMultiSelectPopupView = BI.inherit(BI.Widget, { resetWidth: function (w) { this.popupView.resetWidth(w); - } + }, + + setDirection: function (direction, position) { + this.popupView.setDirection(direction, position); + }, }); BI.SearchMultiSelectPopupView.EVENT_CHANGE = "EVENT_CHANGE"; diff --git a/src/widget/singleselect/singleselect.popup.view.js b/src/widget/singleselect/singleselect.popup.view.js index 8c22afbd3..4e33c004f 100644 --- a/src/widget/singleselect/singleselect.popup.view.js +++ b/src/widget/singleselect/singleselect.popup.view.js @@ -69,10 +69,14 @@ BI.SingleSelectPopupView = BI.inherit(BI.Widget, { resetWidth: function (w) { this.popupView.resetWidth(w); - } + }, + + setDirection: function (direction, position) { + this.popupView.setDirection(direction, position); + }, }); BI.SingleSelectPopupView.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.single_select_popup_view", BI.SingleSelectPopupView); \ No newline at end of file +BI.shortcut("bi.single_select_popup_view", BI.SingleSelectPopupView); From 6a510524e63a1eaecc67fac25873ff6e87f9dd36 Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 22 Jan 2022 19:44:08 +0800 Subject: [PATCH 39/58] =?UTF-8?q?feature:=20=E5=B0=8F=E4=B8=89=E8=A7=92?= =?UTF-8?q?=E6=8D=A2=E4=B8=80=E7=A7=8D=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/combination/combo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/combination/combo.js b/src/base/combination/combo.js index c7c74ce44..ed66ac0f7 100644 --- a/src/base/combination/combo.js +++ b/src/base/combination/combo.js @@ -282,7 +282,7 @@ } var width = this.combo.element.outerWidth(); var height = this.combo.element.outerHeight(); - this.popupView.setDirection(p.dir, { + this.popupView.setDirection && this.popupView.setDirection(p.dir, { width: width, height: height, offsetStyle: o.offsetStyle, From ea530db286eee98e55eb73b9d016c6135601ea25 Mon Sep 17 00:00:00 2001 From: data Date: Sat, 22 Jan 2022 19:54:20 +0800 Subject: [PATCH 40/58] auto upgrade version to 2.0.20220122195415 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 45f9e99f9..627cb5ecb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220122193211", + "version": "2.0.20220122195415", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From c6e6f2ea2685dc68e9f934dafbff73ec54de4807 Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 22 Jan 2022 19:56:34 +0800 Subject: [PATCH 41/58] =?UTF-8?q?feature:=20=E5=B0=8F=E4=B8=89=E8=A7=92?= =?UTF-8?q?=E6=8D=A2=E4=B8=80=E7=A7=8D=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/layer/layer.popup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/layer/layer.popup.js b/src/base/layer/layer.popup.js index e7da9ec8a..93bd91d3d 100644 --- a/src/base/layer/layer.popup.js +++ b/src/base/layer/layer.popup.js @@ -24,7 +24,7 @@ BI.PopupView = BI.inherit(BI.Widget, { hgap: 0, innerVGap: 0, innerHGap: 0, - showArrow: true, + showArrow: false, direction: BI.Direction.Top, // 工具栏的方向 stopEvent: false, // 是否停止mousedown、mouseup事件 stopPropagation: false, // 是否停止mousedown、mouseup向上冒泡 From be5ad7469d066d12588a1c0f00f630c86c947577 Mon Sep 17 00:00:00 2001 From: data Date: Sat, 22 Jan 2022 20:13:20 +0800 Subject: [PATCH 42/58] auto upgrade version to 2.0.20220122201315 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 627cb5ecb..6a9422424 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220122195415", + "version": "2.0.20220122201315", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 2897b1048ac7f1bbac6ebb9029657bfb48e68f44 Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 22 Jan 2022 22:19:21 +0800 Subject: [PATCH 43/58] =?UTF-8?q?feature:=20switch=E5=AD=97=E4=BD=93?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/less/base/single/button/switch.less | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/less/base/single/button/switch.less b/src/less/base/single/button/switch.less index 9fbab0e73..22ba538c9 100644 --- a/src/less/base/single/button/switch.less +++ b/src/less/base/single/button/switch.less @@ -1,6 +1,7 @@ @import "../../../index"; -.bi-switch{ +.bi-switch { + font-size: @font-size-12; .border-radius(40px 40px 40px 40px); background-color: @color-bi-background-switch; .transition(all .2s); From a663284784e5366465cee968628d56c0dadeb287 Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 22 Jan 2022 22:31:44 +0800 Subject: [PATCH 44/58] =?UTF-8?q?chore:=20=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../interactivearrangement.less | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 src/less/widget/interactivearrangement/interactivearrangement.less diff --git a/src/less/widget/interactivearrangement/interactivearrangement.less b/src/less/widget/interactivearrangement/interactivearrangement.less deleted file mode 100644 index c368c3b96..000000000 --- a/src/less/widget/interactivearrangement/interactivearrangement.less +++ /dev/null @@ -1,11 +0,0 @@ -@import "../../index"; - -.bi-interactive-arrangement { - & .interactive-arrangement-dragtag-line { - z-index: @zIndex-tip; - background-color: @color-bi-background-interactive-arrangement-dragtag-line; - } - & .interactive-arrangement-dragtag-icon { - z-index: @zIndex-tip; - } -} \ No newline at end of file From a5407abe8a4d3b5a6423393db5d202d3c53f3092 Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 23 Jan 2022 12:57:53 +0800 Subject: [PATCH 45/58] =?UTF-8?q?chore:=20=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/combination/combo.js | 2 ++ src/base/layer/layer.popup.js | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/base/combination/combo.js b/src/base/combination/combo.js index ed66ac0f7..de401bdd6 100644 --- a/src/base/combination/combo.js +++ b/src/base/combination/combo.js @@ -286,6 +286,8 @@ width: width, height: height, offsetStyle: o.offsetStyle, + adjustXOffset: o.adjustXOffset, + adjustYOffset: o.adjustYOffset, offset: this.combo.element.offset() }); if ("left" in p) { diff --git a/src/base/layer/layer.popup.js b/src/base/layer/layer.popup.js index 93bd91d3d..a0d8220f8 100644 --- a/src/base/layer/layer.popup.js +++ b/src/base/layer/layer.popup.js @@ -176,6 +176,8 @@ BI.PopupView = BI.inherit(BI.Widget, { setDirection: function (direction, position) { if (this.options.showArrow) { var style, placeholderStyle; + var adjustXOffset = position.adjustXOffset || 0; + var adjustYOffset = position.adjustYOffset || 0; var bodyBounds = BI.Widget._renderEngine.createElement("body").bounds(); var bodyWidth = bodyBounds.width; var bodyHeight = bodyBounds.height; @@ -200,7 +202,7 @@ BI.PopupView = BI.inherit(BI.Widget, { direction = "bottom"; style = { // 5表示留出一定的空间 - left: BI.clamp((middle ? popupWidth : position.width) / 2 - 6, minLeft, maxLeft) + left: BI.clamp(((middle ? popupWidth : position.width) - adjustXOffset) / 2 - 6, minLeft, maxLeft) }; placeholderStyle = { left: 0, @@ -213,7 +215,7 @@ BI.PopupView = BI.inherit(BI.Widget, { case "bottom,left": direction = "bottom"; style = { - right: BI.clamp((middle ? popupWidth : position.width) / 2 - 6, minRight, maxRight) + right: BI.clamp(((middle ? popupWidth : position.width) + adjustXOffset) / 2 - 6, minRight, maxRight) }; placeholderStyle = { left: 0, @@ -227,7 +229,7 @@ BI.PopupView = BI.inherit(BI.Widget, { case "top,right": direction = "top"; style = { - left: BI.clamp((middle ? popupWidth : position.width) / 2 - 6, minLeft, maxLeft) + left: BI.clamp(((middle ? popupWidth : position.width) - adjustXOffset) / 2 - 6, minLeft, maxLeft) }; placeholderStyle = { left: 0, @@ -240,7 +242,7 @@ BI.PopupView = BI.inherit(BI.Widget, { case "top,left": direction = "top"; style = { - right: BI.clamp((middle ? popupWidth : position.width) / 2 - 6, minRight, maxRight) + right: BI.clamp(((middle ? popupWidth : position.width) + adjustXOffset) / 2 - 6, minRight, maxRight) }; placeholderStyle = { left: 0, @@ -254,7 +256,7 @@ BI.PopupView = BI.inherit(BI.Widget, { case "left,bottom": direction = "left"; style = { - top: BI.clamp((middle ? popupHeight : position.height) / 2 - 6, minTop, maxTop) + top: BI.clamp(((middle ? popupHeight : position.height) - adjustYOffset) / 2 - 6, minTop, maxTop) }; placeholderStyle = { top: 0, @@ -267,7 +269,7 @@ BI.PopupView = BI.inherit(BI.Widget, { case "left,top": direction = "left"; style = { - bottom: BI.clamp((middle ? popupHeight : position.height) / 2 - 6, minBottom, maxBottom) + bottom: BI.clamp(((middle ? popupHeight : position.height) + adjustYOffset) / 2 - 6, minBottom, maxBottom) }; placeholderStyle = { top: 0, @@ -281,7 +283,7 @@ BI.PopupView = BI.inherit(BI.Widget, { case "right,bottom": direction = "right"; style = { - top: BI.clamp((middle ? popupHeight : position.height) / 2 - 6, minTop, maxTop) + top: BI.clamp(((middle ? popupHeight : position.height) - adjustYOffset) / 2 - 6, minTop, maxTop) }; placeholderStyle = { top: 0, @@ -294,7 +296,7 @@ BI.PopupView = BI.inherit(BI.Widget, { case "right,top": direction = "right"; style = { - bottom: BI.clamp((middle ? popupHeight : position.height) / 2 - 6, minBottom, maxBottom) + bottom: BI.clamp(((middle ? popupHeight : position.height) + adjustYOffset) / 2 - 6, minBottom, maxBottom) }; placeholderStyle = { top: 0, From 8e7e4cc71f12f12af22796ce8077943b3227be56 Mon Sep 17 00:00:00 2001 From: data Date: Sun, 23 Jan 2022 13:12:21 +0800 Subject: [PATCH 46/58] auto upgrade version to 2.0.20220123131215 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6a9422424..8d2e2ddb3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220122201315", + "version": "2.0.20220123131215", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 0bc476572b2cd6604a704665527b92f5dc34c67a Mon Sep 17 00:00:00 2001 From: freddy Date: Mon, 24 Jan 2022 14:30:46 +0800 Subject: [PATCH 47/58] =?UTF-8?q?REPORT-60473=20&&=20REPORT-64922=20fix:?= =?UTF-8?q?=E5=8E=BB=E6=8E=89focus=E6=97=B6showView?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/multilayerselecttree/multilayerselecttree.combo.js | 4 ---- src/widget/multilayersingletree/multilayersingletree.combo.js | 3 --- src/widget/multitree/multi.tree.combo.js | 3 --- src/widget/multitree/multi.tree.insert.combo.js | 3 --- src/widget/multitree/multi.tree.list.combo.js | 3 --- 5 files changed, 16 deletions(-) diff --git a/src/widget/multilayerselecttree/multilayerselecttree.combo.js b/src/widget/multilayerselecttree/multilayerselecttree.combo.js index b11b9bc14..0f4e78fff 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.combo.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.combo.js @@ -156,10 +156,6 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { }, { eventName: BI.MultiLayerSelectTreeTrigger.EVENT_FOCUS, action: function () { - if (!self.combo.isViewVisible()) { - self.combo.showView(); - } - self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_FOCUS); } }, { diff --git a/src/widget/multilayersingletree/multilayersingletree.combo.js b/src/widget/multilayersingletree/multilayersingletree.combo.js index 8d22714e1..29e97b93e 100644 --- a/src/widget/multilayersingletree/multilayersingletree.combo.js +++ b/src/widget/multilayersingletree/multilayersingletree.combo.js @@ -158,9 +158,6 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { }, { eventName: BI.MultiLayerSingleTreeTrigger.EVENT_FOCUS, action: function () { - if (!self.combo.isViewVisible()) { - self.combo.showView(); - } self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_FOCUS); } }, { diff --git a/src/widget/multitree/multi.tree.combo.js b/src/widget/multitree/multi.tree.combo.js index 67190043b..b65692bdc 100644 --- a/src/widget/multitree/multi.tree.combo.js +++ b/src/widget/multitree/multi.tree.combo.js @@ -124,9 +124,6 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { }; this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS, function () { - if (!self.combo.isViewVisible()) { - self.combo.showView(); - } self.fireEvent(BI.MultiTreeCombo.EVENT_FOCUS); }); this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR, function () { diff --git a/src/widget/multitree/multi.tree.insert.combo.js b/src/widget/multitree/multi.tree.insert.combo.js index 632a46a24..0b1e9701c 100644 --- a/src/widget/multitree/multi.tree.insert.combo.js +++ b/src/widget/multitree/multi.tree.insert.combo.js @@ -140,9 +140,6 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { }; this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS, function () { - if (!self.combo.isViewVisible()) { - self.combo.showView(); - } self.fireEvent(BI.MultiTreeInsertCombo.EVENT_FOCUS); }); this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR, function () { diff --git a/src/widget/multitree/multi.tree.list.combo.js b/src/widget/multitree/multi.tree.list.combo.js index 68d50b989..5848eb41b 100644 --- a/src/widget/multitree/multi.tree.list.combo.js +++ b/src/widget/multitree/multi.tree.list.combo.js @@ -158,9 +158,6 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { }; this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS, function () { - if (!self.combo.isViewVisible()) { - self.combo.showView(); - } self.fireEvent(BI.MultiTreeListCombo.EVENT_FOCUS); }); this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR, function () { From 2ec953f9639a386bb45c0dde24c190e88bd568c8 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 24 Jan 2022 20:52:18 +0800 Subject: [PATCH 48/58] update --- src/component/allvaluechooser/abstract.allvaluechooser.js | 3 +++ src/component/treevaluechooser/abstract.treevaluechooser.js | 3 +++ src/component/valuechooser/abstract.valuechooser.js | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/component/allvaluechooser/abstract.allvaluechooser.js b/src/component/allvaluechooser/abstract.allvaluechooser.js index 1f30e8de8..90cd4afd0 100644 --- a/src/component/allvaluechooser/abstract.allvaluechooser.js +++ b/src/component/allvaluechooser/abstract.allvaluechooser.js @@ -24,6 +24,9 @@ BI.AbstractAllValueChooser = BI.inherit(BI.Widget, { _valueFormatter: function (v) { var text = v; + if (this.options.valueFormatter) { + return this.options.valueFormatter(v); + } if (BI.isNotNull(this.items)) { BI.some(this.items, function (i, item) { // 把value都换成字符串 diff --git a/src/component/treevaluechooser/abstract.treevaluechooser.js b/src/component/treevaluechooser/abstract.treevaluechooser.js index cf00c985b..6288cc4dc 100644 --- a/src/component/treevaluechooser/abstract.treevaluechooser.js +++ b/src/component/treevaluechooser/abstract.treevaluechooser.js @@ -14,6 +14,9 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { _valueFormatter: function (v) { var text = v; + if (this.options.valueFormatter) { + return this.options.valueFormatter(v); + } if (BI.isNotNull(this.items)) { BI.some(this.items, function (i, item) { if (item.value === v || item.value + "" === v) { diff --git a/src/component/valuechooser/abstract.valuechooser.js b/src/component/valuechooser/abstract.valuechooser.js index bd1ab309c..a97434a84 100644 --- a/src/component/valuechooser/abstract.valuechooser.js +++ b/src/component/valuechooser/abstract.valuechooser.js @@ -22,6 +22,9 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, { _valueFormatter: function (v) { var text = v; + if (this.options.valueFormatter) { + return this.options.valueFormatter(v); + } if (BI.isNotNull(this.items)) { BI.some(this.items, function (i, item) { // 把value都换成字符串 From 4b86d0562778f51705c701ec2cad7ea3c31d7ef6 Mon Sep 17 00:00:00 2001 From: data Date: Mon, 24 Jan 2022 21:02:19 +0800 Subject: [PATCH 49/58] auto upgrade version to 2.0.20220124210214 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8d2e2ddb3..690ca7880 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220123131215", + "version": "2.0.20220124210214", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From ac0cd0566c68e29701011c0fabc68594c923c6d9 Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 25 Jan 2022 13:23:16 +0800 Subject: [PATCH 50/58] =?UTF-8?q?chore:=20=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js | 2 +- src/widget/multilayerselecttree/multilayerselecttree.combo.js | 4 ++-- src/widget/multilayersingletree/multilayersingletree.combo.js | 4 ++-- src/widget/multiselect/multiselect.combo.js | 2 +- src/widget/multiselect/multiselect.combo.nobar.js | 2 +- src/widget/multiselect/multiselect.insert.combo.js | 2 +- src/widget/multiselect/multiselect.insert.combo.nobar.js | 2 +- src/widget/multitree/multi.tree.combo.js | 2 +- src/widget/multitree/multi.tree.insert.combo.js | 2 +- src/widget/multitree/multi.tree.list.combo.js | 2 +- src/widget/singleselect/singleselect.combo.js | 2 +- src/widget/singleselect/singleselect.insert.combo.js | 2 +- 12 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js b/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js index 4095cb09e..e86bec863 100644 --- a/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js +++ b/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js @@ -35,7 +35,7 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, { self.trigger = this; }, items: o.items, - height: o.height - 2, + height: o.height - (o.simple ? 1 : 2), text: o.text, defaultText: o.defaultText, value: o.value, diff --git a/src/widget/multilayerselecttree/multilayerselecttree.combo.js b/src/widget/multilayerselecttree/multilayerselecttree.combo.js index 412b1f9e7..ef7f8867d 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.combo.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.combo.js @@ -139,7 +139,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { itemsCreator: o.itemsCreator, valueFormatter: o.valueFormatter, watermark: o.watermark, - height: o.height - 2, + height: o.height - (o.simple ? 1 : 2), text: o.text, value: o.value, tipType: o.tipType, @@ -247,4 +247,4 @@ BI.MultiLayerSelectTreeCombo.EVENT_FOCUS = "EVENT_FOCUS"; BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSelectTreeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; BI.MultiLayerSelectTreeCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; -BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo); \ No newline at end of file +BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo); diff --git a/src/widget/multilayersingletree/multilayersingletree.combo.js b/src/widget/multilayersingletree/multilayersingletree.combo.js index 4109f6eb7..824cb9bae 100644 --- a/src/widget/multilayersingletree/multilayersingletree.combo.js +++ b/src/widget/multilayersingletree/multilayersingletree.combo.js @@ -142,7 +142,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { items: o.items, itemsCreator: o.itemsCreator, valueFormatter: o.valueFormatter, - height: o.height - 2, + height: o.height - (o.simple ? 1 : 2), text: o.text, value: o.value, tipType: o.tipType, @@ -247,4 +247,4 @@ BI.MultiLayerSingleTreeCombo.EVENT_BLUR = "EVENT_BLUR"; BI.MultiLayerSingleTreeCombo.EVENT_FOCUS = "EVENT_FOCUS"; BI.MultiLayerSingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSingleTreeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; -BI.shortcut("bi.multilayer_single_tree_combo", BI.MultiLayerSingleTreeCombo); \ No newline at end of file +BI.shortcut("bi.multilayer_single_tree_combo", BI.MultiLayerSingleTreeCombo); diff --git a/src/widget/multiselect/multiselect.combo.js b/src/widget/multiselect/multiselect.combo.js index d5047405f..09c06b6a3 100644 --- a/src/widget/multiselect/multiselect.combo.js +++ b/src/widget/multiselect/multiselect.combo.js @@ -44,7 +44,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, { this.trigger = BI.createWidget({ type: "bi.multi_select_trigger", allowEdit: o.allowEdit, - height: o.height - 2, + height: o.height - (o.simple ? 1 : 2), text: o.text, // adapter: this.popup, masker: { diff --git a/src/widget/multiselect/multiselect.combo.nobar.js b/src/widget/multiselect/multiselect.combo.nobar.js index 4cdc69560..b4fe04154 100644 --- a/src/widget/multiselect/multiselect.combo.nobar.js +++ b/src/widget/multiselect/multiselect.combo.nobar.js @@ -41,7 +41,7 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, { this.trigger = BI.createWidget({ type: "bi.multi_select_trigger", - height: o.height - 2, + height: o.height - (o.simple ? 1 : 2), text: o.text, // adapter: this.popup, masker: { diff --git a/src/widget/multiselect/multiselect.insert.combo.js b/src/widget/multiselect/multiselect.insert.combo.js index 3ba055f46..0cedaf020 100644 --- a/src/widget/multiselect/multiselect.insert.combo.js +++ b/src/widget/multiselect/multiselect.insert.combo.js @@ -40,7 +40,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, { this.trigger = BI.createWidget({ type: "bi.multi_select_insert_trigger", allowEdit: o.allowEdit, - height: o.height - 2, + height: o.height - (o.simple ? 1 : 2), text: o.text, watermark: o.watermark, // adapter: this.popup, diff --git a/src/widget/multiselect/multiselect.insert.combo.nobar.js b/src/widget/multiselect/multiselect.insert.combo.nobar.js index 3c33de408..39099bbde 100644 --- a/src/widget/multiselect/multiselect.insert.combo.nobar.js +++ b/src/widget/multiselect/multiselect.insert.combo.nobar.js @@ -41,7 +41,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, { this.trigger = BI.createWidget({ type: "bi.multi_select_insert_trigger", - height: o.height - 2, + height: o.height - (o.simple ? 1 : 2), text: o.text, // adapter: this.popup, masker: { diff --git a/src/widget/multitree/multi.tree.combo.js b/src/widget/multitree/multi.tree.combo.js index 5c6e177a7..b6a3aca37 100644 --- a/src/widget/multitree/multi.tree.combo.js +++ b/src/widget/multitree/multi.tree.combo.js @@ -27,7 +27,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { this.trigger = BI.createWidget({ type: "bi.multi_select_trigger", allowEdit: o.allowEdit, - height: o.height - 2, + height: o.height - (o.simple ? 1 : 2), valueFormatter: o.valueFormatter, text: o.text, watermark: o.watermark, diff --git a/src/widget/multitree/multi.tree.insert.combo.js b/src/widget/multitree/multi.tree.insert.combo.js index b82d27f3f..c48ca8b36 100644 --- a/src/widget/multitree/multi.tree.insert.combo.js +++ b/src/widget/multitree/multi.tree.insert.combo.js @@ -28,7 +28,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { this.trigger = BI.createWidget({ type: "bi.multi_select_trigger", allowEdit: o.allowEdit, - height: o.height - 2, + height: o.height - (o.simple ? 1 : 2), valueFormatter: o.valueFormatter, // adapter: this.popup, masker: { diff --git a/src/widget/multitree/multi.tree.list.combo.js b/src/widget/multitree/multi.tree.list.combo.js index 018f7f74b..dfa1e0ac5 100644 --- a/src/widget/multitree/multi.tree.list.combo.js +++ b/src/widget/multitree/multi.tree.list.combo.js @@ -30,7 +30,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { allowEdit: o.allowEdit, text: o.text, watermark: o.watermark, - height: o.height - 2, + height: o.height - (o.simple ? 1 : 2), valueFormatter: o.valueFormatter, // adapter: this.popup, masker: { diff --git a/src/widget/singleselect/singleselect.combo.js b/src/widget/singleselect/singleselect.combo.js index 0cfb9cc48..fb873438f 100644 --- a/src/widget/singleselect/singleselect.combo.js +++ b/src/widget/singleselect/singleselect.combo.js @@ -30,7 +30,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { this.trigger = BI.createWidget({ type: "bi.single_select_trigger", - height: o.height - 2, + height: o.height - (o.simple ? 1 : 2), // adapter: this.popup, allowNoSelect: o.allowNoSelect, allowEdit: o.allowEdit, diff --git a/src/widget/singleselect/singleselect.insert.combo.js b/src/widget/singleselect/singleselect.insert.combo.js index 66bdb0c47..b8b21cd09 100644 --- a/src/widget/singleselect/singleselect.insert.combo.js +++ b/src/widget/singleselect/singleselect.insert.combo.js @@ -31,7 +31,7 @@ BI.SingleSelectInsertCombo = BI.inherit(BI.Single, { this.trigger = BI.createWidget({ type: "bi.single_select_trigger", watermark: o.watermark, - height: o.height - 2, + height: o.height - (o.simple ? 1 : 2), allowNoSelect: o.allowNoSelect, allowEdit: o.allowEdit, // adapter: this.popup, From 565faf3dfb1ebda751d4e5ce5c86525ada0a3014 Mon Sep 17 00:00:00 2001 From: data Date: Tue, 25 Jan 2022 13:32:19 +0800 Subject: [PATCH 51/58] auto upgrade version to 2.0.20220125133212 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 690ca7880..1876fbd2c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220124210214", + "version": "2.0.20220125133212", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 54d6c63be9929ad7a0bc413a2c2bbf22da412115 Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 30 Jan 2022 18:10:32 +0800 Subject: [PATCH 52/58] =?UTF-8?q?chore:=20=E6=8C=89=E9=92=AE=E6=94=AF?= =?UTF-8?q?=E6=8C=81enter=E9=94=AE=E7=A1=AE=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/button/button.basic.js | 11 +++++++++++ src/less/base/single/button/button.less | 23 ++++++++++++----------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/base/single/button/button.basic.js b/src/base/single/button/button.basic.js index d975bdb81..5640dea30 100644 --- a/src/base/single/button/button.basic.js +++ b/src/base/single/button/button.basic.js @@ -11,6 +11,9 @@ BI.BasicButton = BI.inherit(BI.Single, { return BI.extend(conf, { _baseCls: (conf._baseCls || "") + " bi-basic-button" + (conf.invalid ? "" : " cursor-pointer") + ((BI.isIE() && BI.getIEVersion() < 10) ? " hack" : ""), // el: {} // 可以通过el来创建button元素 + attributes: { + tabIndex: 1 + }, value: "", stopEvent: false, stopPropagation: false, @@ -204,6 +207,12 @@ BI.BasicButton = BI.inherit(BI.Single, { }); } hand.click(clk); + // enter键等同于点击 + hand.keyup(function (e) { + if (e.keyCode === BI.KeyCode.ENTER) { + clk(e); + } + }); break; } }); @@ -403,8 +412,10 @@ BI.BasicButton = BI.inherit(BI.Single, { BI.BasicButton.superclass._setEnable.apply(this, arguments); if (enable === true) { this.element.removeClass("base-disabled disabled"); + this.element.attr("tabIndex", 1); } else if (enable === false) { this.element.addClass("base-disabled disabled"); + this.element.removeAttr("tabIndex"); } if (!enable) { if (this.options.shadow) { diff --git a/src/less/base/single/button/button.less b/src/less/base/single/button/button.less index a4657294c..d8f511c01 100644 --- a/src/less/base/single/button/button.less +++ b/src/less/base/single/button/button.less @@ -7,6 +7,7 @@ body .bi-button, #body .bi-button { .border-radius(0px); } .border-radius(2px); + outline: 0; border: 1px solid @color-bi-border-button; background-color: @color-bi-background-button; .box-sizing(border-box); @@ -22,7 +23,7 @@ body .bi-button, #body .bi-button { font-size: inherit; border-width: 0; background-color: transparent; - &:hover { + &:hover, &:focus { .opacity(0.8); } &:active { @@ -47,7 +48,7 @@ body .bi-button, #body .bi-button { &, & .b-font:before { color: @color-bi-text-common-ghost-button; } - &:hover { + &:hover, &:focus { color: @color-bi-text; background-color: @color-bi-background-hover-common-ghost-button; } @@ -73,7 +74,7 @@ body .bi-button, #body .bi-button { border-width: 0; } &.ghost { - &:hover { + &:hover, &:focus { border-color: @color-bi-border-ignore-button; &, & .b-font:before { color: @color-bi-text-ignore-button; @@ -103,7 +104,7 @@ body .bi-button, #body .bi-button { color: @color-bi-text-success-ghost-button; } background-color: transparent; - &:hover { + &:hover, &:focus { color: @color-bi-text; background-color: @color-bi-background-success-button; } @@ -132,7 +133,7 @@ body .bi-button, #body .bi-button { color: @color-bi-text-warning-ghost-button; } background-color: transparent; - &:hover { + &:hover, &:focus { color: @color-bi-text; background-color: @color-bi-background-warning-button; } @@ -161,7 +162,7 @@ body .bi-button, #body .bi-button { color: @color-bi-text-error-ghost-button; } background-color: transparent; - &:hover { + &:hover, &:focus { color: @color-bi-text; background-color: @color-bi-background-error-button; } @@ -208,7 +209,7 @@ body .bi-button, #body .bi-button { } background: transparent !important; border-width: 0 !important; - &:hover, &:active { + &:hover, &:focus, &:active { .opacity(1); } } @@ -285,7 +286,7 @@ body .bi-button, #body .bi-button { .opacity(0.1); .transition(@activeStopVal) } - &:hover{ + &:hover, &:focus { & .bi-button-mask { .opacity(0.1); background-color: @color-bi-background-hover-button-mask; @@ -317,7 +318,7 @@ body .bi-button, #body .bi-button { .opacity(0.1); .transition(@activeStopVal) } - &:hover { + &:hover, &:focus { &:not(.clear, .ghost) { background-color: @color-bi-background-hover-ignore-button-mask; } @@ -333,10 +334,10 @@ body .bi-button, #body .bi-button { .bi-button, #body .bi-button { &.button-ignore { background-color: @color-bi-background-ignore-button-theme-dark; - &:hover{ + &:hover, &:focus { background-color: @color-bi-background-hover-ignore-button-theme-dark; } - &:active{ + &:active { background-color: @color-bi-background-active-ignore-button-theme-dark; } &.clear { From ca119b93c9559bc79d1153e0b6636d9da24598a2 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 31 Jan 2022 00:01:54 +0800 Subject: [PATCH 53/58] =?UTF-8?q?chore:=20=E6=8C=89=E9=92=AE=E6=94=AF?= =?UTF-8?q?=E6=8C=81enter=E9=94=AE=E7=A1=AE=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/foundation/message.js | 25 +++++++++++++++++++ src/base/single/button/button.basic.js | 5 ---- src/base/single/button/buttons/button.js | 12 +++++++++ .../single/button/listitem/icontextitem.js | 14 +++++------ src/base/single/button/node/icontextnode.js | 14 +++++------ src/case/button/item.multiselect.js | 12 +++++++++ src/case/button/item.singleselect.icontext.js | 18 +++++++++---- src/case/button/item.singleselect.js | 12 +++++++++ src/case/button/item.singleselect.radio.js | 12 +++++++++ src/case/button/switch.js | 12 +++++++++ 10 files changed, 112 insertions(+), 24 deletions(-) diff --git a/src/base/foundation/message.js b/src/base/foundation/message.js index 9653995c3..860449ab4 100644 --- a/src/base/foundation/message.js +++ b/src/base/foundation/message.js @@ -133,6 +133,31 @@ BI.Msg = function () { items: [ { type: "bi.border", + attributes: { + tabIndex: 1 + }, + mounted: function () { + this.element.keyup(function (e) { + if (e.keyCode === BI.KeyCode.ENTER) { + close(); + if (BI.isFunction(callback)) { + callback.apply(null, [true]); + } + } else if (e.keyCode === BI.KeyCode.ESCAPE) { + close(); + if (hasCancel === true) { + if (BI.isFunction(callback)) { + callback.apply(null, [false]); + } + } + } + }); + try { + this.element.focus(); + } catch (e) { + + } + }, cls: "bi-card", items: { north: { diff --git a/src/base/single/button/button.basic.js b/src/base/single/button/button.basic.js index 5640dea30..e3d8a1493 100644 --- a/src/base/single/button/button.basic.js +++ b/src/base/single/button/button.basic.js @@ -11,9 +11,6 @@ BI.BasicButton = BI.inherit(BI.Single, { return BI.extend(conf, { _baseCls: (conf._baseCls || "") + " bi-basic-button" + (conf.invalid ? "" : " cursor-pointer") + ((BI.isIE() && BI.getIEVersion() < 10) ? " hack" : ""), // el: {} // 可以通过el来创建button元素 - attributes: { - tabIndex: 1 - }, value: "", stopEvent: false, stopPropagation: false, @@ -412,10 +409,8 @@ BI.BasicButton = BI.inherit(BI.Single, { BI.BasicButton.superclass._setEnable.apply(this, arguments); if (enable === true) { this.element.removeClass("base-disabled disabled"); - this.element.attr("tabIndex", 1); } else if (enable === false) { this.element.addClass("base-disabled disabled"); - this.element.removeAttr("tabIndex"); } if (!enable) { if (this.options.shadow) { diff --git a/src/base/single/button/buttons/button.js b/src/base/single/button/buttons/button.js index 4337a9540..0863d0935 100644 --- a/src/base/single/button/buttons/button.js +++ b/src/base/single/button/buttons/button.js @@ -16,6 +16,9 @@ BI.Button = BI.inherit(BI.BasicButton, { var conf = BI.Button.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { baseCls: (conf.baseCls || "") + " bi-button" + ((BI.isIE() && BI.isIE9Below()) ? " hack" : ""), + attributes: { + tabIndex: 1 + }, minWidth: (props.block === true || props.clear === true) ? 0 : 80, height: 24, shadow: props.clear !== true, @@ -125,6 +128,15 @@ BI.Button = BI.inherit(BI.BasicButton, { } }, + _setEnable: function (enable) { + BI.Button.superclass._setEnable.apply(this, arguments); + if (enable === true) { + this.element.attr("tabIndex", 1); + } else if (enable === false) { + this.element.removeAttr("tabIndex"); + } + }, + setText: function (text) { BI.Button.superclass.setText.apply(this, arguments); this.text.setText(text); diff --git a/src/base/single/button/listitem/icontextitem.js b/src/base/single/button/listitem/icontextitem.js index 648b98381..44f83f376 100644 --- a/src/base/single/button/listitem/icontextitem.js +++ b/src/base/single/button/listitem/icontextitem.js @@ -57,6 +57,13 @@ BI.IconTextItem = BI.inherit(BI.BasicButton, { })))); }, + doClick: function () { + BI.IconTextItem.superclass.doClick.apply(this, arguments); + if (this.isValid()) { + this.fireEvent(BI.IconTextItem.EVENT_CHANGE, this.getValue(), this); + } + }, + setValue: function () { if (!this.isReadOnly()) { this.text.setValue.apply(this.text, arguments); @@ -75,13 +82,6 @@ BI.IconTextItem = BI.inherit(BI.BasicButton, { return this.text.getText(); }, - doClick: function () { - BI.IconTextItem.superclass.doClick.apply(this, arguments); - if (this.isValid()) { - this.fireEvent(BI.IconTextItem.EVENT_CHANGE, this.getValue(), this); - } - }, - doRedMark: function () { this.text.doRedMark.apply(this.text, arguments); }, diff --git a/src/base/single/button/node/icontextnode.js b/src/base/single/button/node/icontextnode.js index 35e5757b8..deb2c73be 100644 --- a/src/base/single/button/node/icontextnode.js +++ b/src/base/single/button/node/icontextnode.js @@ -53,6 +53,13 @@ BI.IconTextNode = BI.inherit(BI.NodeButton, { })))); }, + doClick: function () { + BI.IconTextNode.superclass.doClick.apply(this, arguments); + if (this.isValid()) { + this.fireEvent(BI.IconTextNode.EVENT_CHANGE, this.getValue(), this); + } + }, + setValue: function () { if (!this.isReadOnly()) { this.text.setValue.apply(this.text, arguments); @@ -71,13 +78,6 @@ BI.IconTextNode = BI.inherit(BI.NodeButton, { return this.text.getText(); }, - doClick: function () { - BI.IconTextNode.superclass.doClick.apply(this, arguments); - if (this.isValid()) { - this.fireEvent(BI.IconTextNode.EVENT_CHANGE, this.getValue(), this); - } - }, - doRedMark: function () { this.text.doRedMark.apply(this.text, arguments); }, diff --git a/src/case/button/item.multiselect.js b/src/case/button/item.multiselect.js index 965363418..8a082a16b 100644 --- a/src/case/button/item.multiselect.js +++ b/src/case/button/item.multiselect.js @@ -7,6 +7,9 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, { _defaultConfig: function () { return BI.extend(BI.MultiSelectItem.superclass._defaultConfig.apply(this, arguments), { extraCls: "bi-multi-select-item", + attributes: { + tabIndex: 1 + }, height: 24, logic: { dynamic: false @@ -55,6 +58,15 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, { })))); }, + _setEnable: function (enable) { + BI.MultiSelectItem.superclass._setEnable.apply(this, arguments); + if (enable === true) { + this.element.attr("tabIndex", 1); + } else if (enable === false) { + this.element.removeAttr("tabIndex"); + } + }, + doRedMark: function () { this.text.doRedMark.apply(this.text, arguments); }, diff --git a/src/case/button/item.singleselect.icontext.js b/src/case/button/item.singleselect.icontext.js index 1a70d4c01..e1a3e4f05 100644 --- a/src/case/button/item.singleselect.icontext.js +++ b/src/case/button/item.singleselect.icontext.js @@ -8,6 +8,9 @@ BI.SingleSelectIconTextItem = BI.inherit(BI.Single, { _defaultConfig: function () { return BI.extend(BI.SingleSelectIconTextItem.superclass._defaultConfig.apply(this, arguments), { extraCls: "bi-single-select-icon-text-item bi-list-item-active", + attributes: { + tabIndex: 1 + }, iconCls: "", height: 24 }); @@ -35,6 +38,15 @@ BI.SingleSelectIconTextItem = BI.inherit(BI.Single, { }); }, + _setEnable: function (enable) { + BI.SingleSelectIconTextItem.superclass._setEnable.apply(this, arguments); + if (enable === true) { + this.element.attr("tabIndex", 1); + } else if (enable === false) { + this.element.removeAttr("tabIndex"); + } + }, + isSelected: function () { return this.text.isSelected(); }, @@ -49,11 +61,7 @@ BI.SingleSelectIconTextItem = BI.inherit(BI.Single, { unRedMark: function () { this.text.unRedMark.apply(this.text, arguments); - }, - - doClick: function () { - BI.SingleSelectIconTextItem.superclass.doClick.apply(this, arguments); } }); -BI.shortcut("bi.single_select_icon_text_item", BI.SingleSelectIconTextItem); \ No newline at end of file +BI.shortcut("bi.single_select_icon_text_item", BI.SingleSelectIconTextItem); diff --git a/src/case/button/item.singleselect.js b/src/case/button/item.singleselect.js index 8c5931f15..030dcff8f 100644 --- a/src/case/button/item.singleselect.js +++ b/src/case/button/item.singleselect.js @@ -2,6 +2,9 @@ BI.SingleSelectItem = BI.inherit(BI.BasicButton, { _defaultConfig: function () { return BI.extend(BI.SingleSelectItem.superclass._defaultConfig.apply(this, arguments), { extraCls: "bi-single-select-item bi-list-item-active", + attributes: { + tabIndex: 1 + }, hgap: 10, height: 24, textAlign: "left" @@ -25,6 +28,15 @@ BI.SingleSelectItem = BI.inherit(BI.BasicButton, { }); }, + _setEnable: function (enable) { + BI.SingleSelectItem.superclass._setEnable.apply(this, arguments); + if (enable === true) { + this.element.attr("tabIndex", 1); + } else if (enable === false) { + this.element.removeAttr("tabIndex"); + } + }, + doRedMark: function () { this.text.doRedMark.apply(this.text, arguments); }, diff --git a/src/case/button/item.singleselect.radio.js b/src/case/button/item.singleselect.radio.js index 0c6a55d3e..42c628247 100644 --- a/src/case/button/item.singleselect.radio.js +++ b/src/case/button/item.singleselect.radio.js @@ -7,6 +7,9 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, { _defaultConfig: function () { return BI.extend(BI.SingleSelectRadioItem.superclass._defaultConfig.apply(this, arguments), { extraCls: "bi-single-select-radio-item", + attributes: { + tabIndex: 1 + }, logic: { dynamic: false }, @@ -51,6 +54,15 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, { })))); }, + _setEnable: function (enable) { + BI.SingleSelectRadioItem.superclass._setEnable.apply(this, arguments); + if (enable === true) { + this.element.attr("tabIndex", 1); + } else if (enable === false) { + this.element.removeAttr("tabIndex"); + } + }, + doRedMark: function () { this.text.doRedMark.apply(this.text, arguments); }, diff --git a/src/case/button/switch.js b/src/case/button/switch.js index 2fcbf2c8f..e88360266 100644 --- a/src/case/button/switch.js +++ b/src/case/button/switch.js @@ -9,6 +9,9 @@ BI.Switch = BI.inherit(BI.BasicButton, { props: { extraCls: "bi-switch", + attributes: { + tabIndex: 1 + }, height: 20, width: 44, logic: { @@ -58,6 +61,15 @@ BI.Switch = BI.inherit(BI.BasicButton, { }; }, + _setEnable: function (enable) { + BI.Switch.superclass._setEnable.apply(this, arguments); + if (enable === true) { + this.element.attr("tabIndex", 1); + } else if (enable === false) { + this.element.removeAttr("tabIndex"); + } + }, + setSelected: function (v) { BI.Switch.superclass.setSelected.apply(this, arguments); this.layout.attr("items")[0].left = v ? 28 : 4; From ccf4905b1c19a55da92de6604e6d6f14d59b1821 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 7 Feb 2022 11:37:24 +0800 Subject: [PATCH 54/58] =?UTF-8?q?KERNEL-9882=20toast=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bi.lessconfig.json | 13 ++++++++++++- demo/js/base/tip/demo.toast.js | 6 ++++-- src/base/single/tip/tip.toast.js | 1 + src/less/base/single/tip/tip.toast.less | 2 +- src/less/lib/theme.less | 5 +++++ src/less/resource/font.less | 9 +++++---- 6 files changed, 28 insertions(+), 8 deletions(-) diff --git a/bi.lessconfig.json b/bi.lessconfig.json index 975ecf6b6..ecd7c55cb 100644 --- a/bi.lessconfig.json +++ b/bi.lessconfig.json @@ -16,5 +16,16 @@ "@color-bi-background-disabled-active-radio-content": "#D0D4DA", "@color-bi-background-disabled-active-radio-content-theme-dark": "#606479", "@color-bi-background-disabled-active-checkbox-content": "#D0D4DA", - "@color-bi-background-disabled-active-checkbox-content-theme-dark": "#606479" + "@color-bi-background-disabled-active-checkbox-content-theme-dark": "#606479", + "@color-bi-background-tooltip-success": "#2E3A4D", + "@color-bi-border-tooltip-success": "#2E3A4D", + "@color-bi-background-toast-success": "#FFFFFF", + "@color-bi-background-toast-warning": "#FFFFFF", + "@color-bi-background-toast-error": "#FFFFFF", + "@color-bi-background-toast-normal": "#FFFFFF", + "@color-bi-color-toast-success": "#3FC47B", + "@color-bi-color-toast-warning": "#FAAA39", + "@color-bi-color-toast-error": "#E65251", + "@color-bi-color-toast-normal": "#2C60DB", + "@color-bi-color-toast-text": "#000A19" } diff --git a/demo/js/base/tip/demo.toast.js b/demo/js/base/tip/demo.toast.js index 9d0352a6f..fcb845964 100644 --- a/demo/js/base/tip/demo.toast.js +++ b/demo/js/base/tip/demo.toast.js @@ -10,7 +10,9 @@ Demo.Toast = BI.inherit(BI.Widget, { text: "简单Toast测试(success)", height: 30, handler: function () { - BI.Msg.toast("这是一条简单的数据"); + BI.Msg.toast("这是一条简单的数据", { + level: "success" + }); } } }, { @@ -20,7 +22,7 @@ Demo.Toast = BI.inherit(BI.Widget, { height: 30, handler: function () { BI.Msg.toast("这是一条很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长的数据", { - level: "normal" + }); } } diff --git a/src/base/single/tip/tip.toast.js b/src/base/single/tip/tip.toast.js index f853d8659..cf2a61476 100644 --- a/src/base/single/tip/tip.toast.js +++ b/src/base/single/tip/tip.toast.js @@ -93,6 +93,7 @@ BI.Toast = BI.inherit(BI.Tip, { this.text = BI.createWidget({ type: "bi.horizontal", horizontalAlign: BI.HorizontalAlign.Stretch, + verticalAlign: BI.VerticalAlign.Middle, element: this, items: items, vgap: 7, diff --git a/src/less/base/single/tip/tip.toast.less b/src/less/base/single/tip/tip.toast.less index 6ac76d4a6..7f7838f29 100644 --- a/src/less/base/single/tip/tip.toast.less +++ b/src/less/base/single/tip/tip.toast.less @@ -1,7 +1,7 @@ @import "../../../index"; .bi-toast{ - color: @color-bi-text; + color: @color-bi-color-toast-text; max-width: 400px; min-width: 150px; line-height: @font-size-16; diff --git a/src/less/lib/theme.less b/src/less/lib/theme.less index 9575a2ae1..d83ef3789 100644 --- a/src/less/lib/theme.less +++ b/src/less/lib/theme.less @@ -27,6 +27,11 @@ @color-bi-background-toast-warning: @color-bi-background-warning; @color-bi-background-toast-error: @color-bi-background-failure; @color-bi-background-toast-normal: @color-bi-background-highlight; +@color-bi-color-toast-success: @color-bi-text; +@color-bi-color-toast-warning: @color-bi-text; +@color-bi-color-toast-error: @color-bi-text; +@color-bi-color-toast-normal: @color-bi-text; +@color-bi-color-toast-text: @color-bi-text; //bubble @color-bi-background-bubble-success: @color-bi-background-light-success; diff --git a/src/less/resource/font.less b/src/less/resource/font.less index d1a6b6354..6c7b3994d 100644 --- a/src/less/resource/font.less +++ b/src/less/resource/font.less @@ -1,5 +1,6 @@ @import "../lib/font"; @import "../lib/colors"; +@import "../lib/theme"; @import "../image"; .addFontRes(); @@ -81,10 +82,10 @@ .font-hover-active(pull-down-ha-font, @font-down-triangle, @color-bi-text-light-gray); //toast -.font(toast-error-font, @font-tip-error); -.font(toast-success-font, @font-tip-success); -.font(toast-warning-font, @font-tip-warning); -.font(toast-message-font, @font-tip-message); +.font(toast-error-font, @font-tip-error, @color-bi-color-toast-error); +.font(toast-success-font, @font-tip-success, @color-bi-color-toast-error); +.font(toast-warning-font, @font-tip-warning, @color-bi-color-toast-warning); +.font(toast-message-font, @font-tip-message, @color-bi-color-toast-normal); //数值区间 .font(less-font, @font-less); From 87ef16c3f7fa48eeee91da57546c497510167a08 Mon Sep 17 00:00:00 2001 From: iapyang Date: Mon, 7 Feb 2022 11:56:56 +0800 Subject: [PATCH 55/58] =?UTF-8?q?chore:=20=E5=A2=9E=E5=8A=A0=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/base/combination/combo.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/typescript/base/combination/combo.ts b/typescript/base/combination/combo.ts index 38191df7a..bec2a7b75 100644 --- a/typescript/base/combination/combo.ts +++ b/typescript/base/combination/combo.ts @@ -11,6 +11,7 @@ export declare class Combo extends Widget { static EVENT_AFTER_POPUPVIEW: string; static EVENT_BEFORE_HIDEVIEW: string; static EVENT_AFTER_HIDEVIEW: string; + static closeAll: Function; props: { trigger?: 'click' | 'hover' | 'click-hover' | ''; From 7de75833d32a9158a600f365783fcf1967e7f9b8 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 7 Feb 2022 13:37:02 +0800 Subject: [PATCH 56/58] dark-line --- bi.lessconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bi.lessconfig.json b/bi.lessconfig.json index ecd7c55cb..e1e853591 100644 --- a/bi.lessconfig.json +++ b/bi.lessconfig.json @@ -7,7 +7,7 @@ "@color-black": "#000A19", "@color-light-gray": "#ECEEF3", "@color-light-gray-theme-dark": "#292F45", - "@color-dim-gray": "#2E3A4D", + "@border-color-dark-line": "#2E3A4D", "@color-sliver-theme-dark": "363E55", "@border-color-disabled": "#E7E8EB", From 3554163cd89df34d732265aa6e035b18535ee1d3 Mon Sep 17 00:00:00 2001 From: data Date: Mon, 7 Feb 2022 16:47:48 +0800 Subject: [PATCH 57/58] auto upgrade version to 2.0.20220207164709 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1876fbd2c..3df8005d4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220125133212", + "version": "2.0.20220207164709", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 467e27795ff773b681052941b8eafc5e6078b487 Mon Sep 17 00:00:00 2001 From: data Date: Tue, 8 Feb 2022 11:12:38 +0800 Subject: [PATCH 58/58] auto upgrade version to 2.0.20220208111230 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3df8005d4..f52cc05b8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220207164709", + "version": "2.0.20220208111230", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts",