From 278de9016a7885c15706d61631db704df73a84fc Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Thu, 28 Apr 2022 17:23:58 +0800 Subject: [PATCH 01/60] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E6=94=AF=E6=8C=81base=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/router.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/router/router.js b/src/router/router.js index 02eb68904..7a44bb5d9 100644 --- a/src/router/router.js +++ b/src/router/router.js @@ -3127,7 +3127,8 @@ init: function () { this.$router = this._router = BI.Router.$router = $router = new VueRouter({ mode: this.options.mode, - routes: this.options.routes + routes: this.options.routes, + base: this.options.base, }); this.$router.beforeEach(function (to, from, next) { if (to.matched.length === 0) { From 718b926cefaacd965f86b69f16df096f6aafa5c0 Mon Sep 17 00:00:00 2001 From: data Date: Thu, 28 Apr 2022 18:54:31 +0800 Subject: [PATCH 02/60] auto upgrade version to 2.0.20220428185416 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 42955fcce..92da2ba3a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220427103402", + "version": "2.0.20220428185416", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From bb0eba2e62e112d6926816cb5be89292deba2a71 Mon Sep 17 00:00:00 2001 From: data Date: Thu, 28 Apr 2022 19:04:14 +0800 Subject: [PATCH 03/60] auto upgrade version to 2.0.20220428190402 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 92da2ba3a..a4c83d143 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220428185416", + "version": "2.0.20220428190402", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From effb93e90df3099a5299507be8aa6b5ec8270c3a Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 29 Apr 2022 15:32:02 +0800 Subject: [PATCH 04/60] =?UTF-8?q?feature:=20=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/less/core/wrapper/flex.horizontal.less | 1 + src/less/core/wrapper/flex.vertical.less | 1 + src/less/core/wrapper/flex.wrapper.horizontal.less | 1 + src/less/core/wrapper/flex.wrapper.vertical.less | 1 + 4 files changed, 4 insertions(+) diff --git a/src/less/core/wrapper/flex.horizontal.less b/src/less/core/wrapper/flex.horizontal.less index b6a8ccc97..a6a38704d 100644 --- a/src/less/core/wrapper/flex.horizontal.less +++ b/src/less/core/wrapper/flex.horizontal.less @@ -169,6 +169,7 @@ } > .f-f { + min-width: 0; -webkit-flex-grow: 1; -moz-flex-grow: 1; -ms-flex-grow: 1; diff --git a/src/less/core/wrapper/flex.vertical.less b/src/less/core/wrapper/flex.vertical.less index c8fbefa6b..d856d0dee 100644 --- a/src/less/core/wrapper/flex.vertical.less +++ b/src/less/core/wrapper/flex.vertical.less @@ -168,6 +168,7 @@ } > .f-f { + min-width: 0; -webkit-flex-grow: 1; -moz-flex-grow: 1; -ms-flex-grow: 1; diff --git a/src/less/core/wrapper/flex.wrapper.horizontal.less b/src/less/core/wrapper/flex.wrapper.horizontal.less index 89de62f88..1b38fa0be 100644 --- a/src/less/core/wrapper/flex.wrapper.horizontal.less +++ b/src/less/core/wrapper/flex.wrapper.horizontal.less @@ -265,6 +265,7 @@ } > .f-f { + min-width: 0; -webkit-flex-grow: 1; -moz-flex-grow: 1; -ms-flex-grow: 1; diff --git a/src/less/core/wrapper/flex.wrapper.vertical.less b/src/less/core/wrapper/flex.wrapper.vertical.less index 477891105..cb9a86f69 100644 --- a/src/less/core/wrapper/flex.wrapper.vertical.less +++ b/src/less/core/wrapper/flex.wrapper.vertical.less @@ -259,6 +259,7 @@ } > .f-f { + min-width: 0; -webkit-flex-grow: 1; -moz-flex-grow: 1; -ms-flex-grow: 1; From 1f21e397bd1b1b5654c0db853cce7d0d81b59116 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 29 Apr 2022 15:35:13 +0800 Subject: [PATCH 05/60] =?UTF-8?q?feature:=20=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/less/core/wrapper/flex.vertical.less | 2 +- src/less/core/wrapper/flex.wrapper.vertical.less | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/less/core/wrapper/flex.vertical.less b/src/less/core/wrapper/flex.vertical.less index d856d0dee..5b97ea999 100644 --- a/src/less/core/wrapper/flex.vertical.less +++ b/src/less/core/wrapper/flex.vertical.less @@ -168,7 +168,7 @@ } > .f-f { - min-width: 0; + min-height: 0; -webkit-flex-grow: 1; -moz-flex-grow: 1; -ms-flex-grow: 1; diff --git a/src/less/core/wrapper/flex.wrapper.vertical.less b/src/less/core/wrapper/flex.wrapper.vertical.less index cb9a86f69..09693c348 100644 --- a/src/less/core/wrapper/flex.wrapper.vertical.less +++ b/src/less/core/wrapper/flex.wrapper.vertical.less @@ -259,7 +259,7 @@ } > .f-f { - min-width: 0; + min-height: 0; -webkit-flex-grow: 1; -moz-flex-grow: 1; -ms-flex-grow: 1; From 39410b8ec2f2f1879726c83a5f15102d3dda835f Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 29 Apr 2022 15:38:05 +0800 Subject: [PATCH 06/60] =?UTF-8?q?feature:=20=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/wrapper/layout/flex/flex.horizontal.js | 1 - src/core/wrapper/layout/flex/flex.vertical.js | 1 - 2 files changed, 2 deletions(-) diff --git a/src/core/wrapper/layout/flex/flex.horizontal.js b/src/core/wrapper/layout/flex/flex.horizontal.js index 1228e7e59..7d53dfe0e 100644 --- a/src/core/wrapper/layout/flex/flex.horizontal.js +++ b/src/core/wrapper/layout/flex/flex.horizontal.js @@ -81,7 +81,6 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, { } if (columnSize === "fill") { w.element.addClass("f-f"); - w.element.css({ minWidth: 0 }); } w.element.addClass("c-e"); if (i === 0) { diff --git a/src/core/wrapper/layout/flex/flex.vertical.js b/src/core/wrapper/layout/flex/flex.vertical.js index 40f252ed2..46b175e9b 100644 --- a/src/core/wrapper/layout/flex/flex.vertical.js +++ b/src/core/wrapper/layout/flex/flex.vertical.js @@ -80,7 +80,6 @@ BI.FlexVerticalLayout = BI.inherit(BI.Layout, { } if (rowSize === "fill") { w.element.addClass("f-f"); - w.element.css({ minHeight: 0 }); } w.element.addClass("c-e"); if (i === 0) { From 6d8e8bc85c31f8ae1ec8577950262a206140a433 Mon Sep 17 00:00:00 2001 From: data Date: Fri, 29 Apr 2022 15:54:36 +0800 Subject: [PATCH 07/60] auto upgrade version to 2.0.20220429155425 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a4c83d143..3642d7207 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220428190402", + "version": "2.0.20220429155425", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 8c1b9dcfcd2e21d31da348b2f733d9c7fca6028c Mon Sep 17 00:00:00 2001 From: data Date: Fri, 29 Apr 2022 16:04:30 +0800 Subject: [PATCH 08/60] auto upgrade version to 2.0.20220429160420 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3642d7207..c87354dbc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220429155425", + "version": "2.0.20220429160420", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 6b6302d383788e358d87e62868368cf98c254843 Mon Sep 17 00:00:00 2001 From: "Zhenfei.Li" Date: Thu, 5 May 2022 00:12:43 +0800 Subject: [PATCH 09/60] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20style:?= =?UTF-8?q?=20less=E5=BC=95=E7=94=A8=E4=B8=8D=E7=9C=81=E7=95=A5=E5=90=8E?= =?UTF-8?q?=E7=BC=80=EF=BC=8C=E9=81=BF=E5=85=8Dcodesandbox=E4=B8=AD?= =?UTF-8?q?=E6=89=BE=E4=B8=8D=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/less/face.less | 2 +- demo/less/index.less | 2 +- demo/less/main.less | 2 +- demo/less/north.less | 2 +- demo/less/preview.less | 2 +- demo/less/vm.less | 2 +- demo/less/west.less | 2 +- private/less/app.less | 4 ++-- private/less/background.less | 4 ++-- private/less/font.less | 4 ++-- private/less/icon.less | 4 ++-- public/less/app.less | 4 ++-- public/less/background.less | 4 ++-- public/less/font.less | 4 ++-- public/less/icon.less | 4 ++-- .../base/colorchooser/colorchooser.popup.less | 2 +- .../base/colorchooser/colorchooser.trigger.less | 2 +- .../colorpicker/button.colorpicker.less | 2 +- .../colorpicker/button.colorshow.less | 2 +- .../colorpicker/editor.colorpicker.less | 2 +- .../base/colorchooser/farbtastic/farbtastic.less | 4 ++-- src/less/base/combo/combo.bubble.less | 2 +- src/less/base/combo/combo.less | 2 +- src/less/base/combo/combo.searchtextvalue.less | 2 +- src/less/base/combo/combo.textvalue.icon.less | 2 +- src/less/base/combo/combo.textvalue.less | 2 +- src/less/base/combo/combo.textvaluecheck.less | 2 +- src/less/base/combo/combo.textvaluedownlist.less | 2 +- src/less/base/combo/popup.bubble.less | 2 +- src/less/base/dom.less | 4 ++-- src/less/base/editor/editor.search.less | 2 +- src/less/base/editor/editor.search.small.less | 2 +- src/less/base/foundation/bi.message.less | 2 +- src/less/base/layer/layer.multiselect.less | 2 +- src/less/base/layer/panel.less | 2 +- src/less/base/loader/sort.list.less | 2 +- src/less/base/pager/pager.all.count.less | 2 +- src/less/base/pager/pager.direction.less | 2 +- src/less/base/pager/pager.less | 2 +- src/less/base/pane.less | 6 +++--- src/less/base/segment/button.segment.less | 2 +- src/less/base/segment/segment.less | 2 +- src/less/base/single/button/button.half.less | 2 +- src/less/base/single/button/button.less | 2 +- .../button/item.singleselect.icontext.less | 2 +- src/less/base/single/button/switch.less | 2 +- .../base/single/editor/editor.multifile.less | 2 +- src/less/base/single/editor/editor.textarea.less | 2 +- src/less/base/single/html.less | 2 +- src/less/base/single/input/checkbox.less | 2 +- src/less/base/single/input/file.less | 2 +- src/less/base/single/input/input.less | 2 +- src/less/base/single/input/radio.less | 2 +- src/less/base/single/label.less | 2 +- src/less/base/single/text.less | 2 +- src/less/base/single/tip/tip.bubble.less | 2 +- src/less/base/single/tip/tip.less | 2 +- src/less/base/single/tip/tip.toast.less | 2 +- src/less/base/single/tip/tip.tooltip.less | 2 +- src/less/base/tree/tree.branch.less | 2 +- src/less/base/tree/tree.display.less | 2 +- src/less/base/tree/tree.expander.less | 6 +++--- src/less/base/tree/tree.list.display.less | 2 +- src/less/base/tree/ztree.less | 2 +- src/less/base/trigger/trigger.less | 2 +- src/less/base/trigger/trigger.selecttext.less | 2 +- .../base/trigger/trigger.selecttextsmall.less | 2 +- src/less/base/view/drawer.less | 2 +- src/less/base/view/popover.less | 2 +- src/less/base/view/popupview.less | 2 +- src/less/component/form/form.less | 2 +- src/less/core/normalize2.less | 2 +- src/less/core/utils/animation.less | 2 +- src/less/core/utils/common.less | 2 +- src/less/core/utils/list-item.less | 2 +- src/less/core/utils/motion/fade.less | 2 +- src/less/core/utils/motion/move.less | 2 +- src/less/core/utils/motion/slide.less | 2 +- src/less/core/utils/motion/zoom.less | 2 +- src/less/core/utils/position.less | 2 +- src/less/core/utils/size.less | 4 ++-- src/less/core/utils/sizing.less | 2 +- src/less/core/utils/typographic.less | 2 +- src/less/image.less | 2 +- src/less/index.less | 16 ++++++++-------- src/less/lib/colors.less | 2 +- src/less/lib/theme-modern.less | 2 +- src/less/lib/theme.less | 2 +- src/less/resource/app.less | 2 +- src/less/resource/background.less | 6 +++--- src/less/resource/font.less | 8 ++++---- src/less/resource/icon.less | 4 ++-- src/less/theme/dark.less | 2 +- src/less/theme/default.less | 2 +- src/less/theme/light.less | 2 +- src/less/widget/date/trigger.date.less | 2 +- src/less/widget/downlist/popup.downlist.less | 2 +- .../dynamicdatecombo/dynamicdatepopup.less | 2 +- .../dynamicdatecombo/dynamicdatetime.combo.less | 2 +- .../dynamicdatecombo/dynamicdatetimepopup.less | 2 +- src/less/widget/month/trigger.month.less | 2 +- .../multilayerselecttree.combo.less | 2 +- .../multilayersingletree.combo.less | 2 +- .../check/multiselect.check.pane.less | 2 +- .../widget/multiselect/multiselect.combo.less | 2 +- .../multiselect/multiselect.insert.combo.less | 2 +- .../search/multiselect.search.pane.less | 2 +- .../trigger/button.checkselected.less | 2 +- .../multistringlist/multistringlist.insert.less | 2 +- .../widget/multistringlist/multistringlist.less | 2 +- .../multitree/check/multi.tree.check.pane.less | 2 +- src/less/widget/multitree/multi.tree.combo.less | 2 +- src/less/widget/multitree/popup.multi.tree.less | 2 +- .../trigger/multi.tree.button.checkselected.less | 2 +- src/less/widget/numbereditor/number.editor.less | 2 +- .../widget/numberinterval/numberinterval.less | 2 +- src/less/widget/quarter/trigger.quarter.less | 2 +- .../searchmultiselect/searchmultiselect.less | 2 +- .../search/singleselect.search.pane.less | 2 +- .../widget/singleselect/singleselect.combo.less | 2 +- .../singleslider/slider/widget.slider.less | 2 +- .../widget/singleslider/track/widget.track.less | 2 +- src/less/widget/timecombo/timecombo.less | 2 +- src/less/widget/timeinterval/dateinterval.less | 2 +- src/less/widget/timeinterval/timeinterval.less | 2 +- src/less/widget/year/popup.year.less | 2 +- src/less/widget/year/trigger.year.less | 2 +- src/less/widget/yearinterval/yearinterval.less | 2 +- src/less/widget/yearmonth/popup.yearmonth.less | 2 +- .../yearmonthinterval/yearmonthinterval.less | 2 +- .../widget/yearquarter/popup.yearquarter.less | 2 +- .../yearquarterinterval/yearquarterinterval.less | 2 +- ui/less/app.less | 4 ++-- ui/less/background.less | 4 ++-- ui/less/font.less | 4 ++-- ui/less/icon.less | 4 ++-- 136 files changed, 168 insertions(+), 168 deletions(-) diff --git a/demo/less/face.less b/demo/less/face.less index 6c0577491..b9c4fe499 100644 --- a/demo/less/face.less +++ b/demo/less/face.less @@ -1,4 +1,4 @@ -@import "index"; +@import "index.less"; .demo-face { .face-config { diff --git a/demo/less/index.less b/demo/less/index.less index 6c2ad3201..9c7a9a367 100644 --- a/demo/less/index.less +++ b/demo/less/index.less @@ -1 +1 @@ -@import "../../src/less/index"; \ No newline at end of file +@import "../../src/less/index.less"; \ No newline at end of file diff --git a/demo/less/main.less b/demo/less/main.less index 184d3c197..4e6cb4376 100644 --- a/demo/less/main.less +++ b/demo/less/main.less @@ -1,4 +1,4 @@ -@import "index"; +@import "index.less"; .layout-bg-white { background-color: #ffffff; } diff --git a/demo/less/north.less b/demo/less/north.less index 1991671f5..0114afd65 100644 --- a/demo/less/north.less +++ b/demo/less/north.less @@ -1,4 +1,4 @@ -@import "index"; +@import "index.less"; .demo-north { background-color: #3c8dbc; diff --git a/demo/less/preview.less b/demo/less/preview.less index 50f9e79dc..600ec4476 100644 --- a/demo/less/preview.less +++ b/demo/less/preview.less @@ -1,4 +1,4 @@ -@import "index"; +@import "index.less"; .demo-preview { } \ No newline at end of file diff --git a/demo/less/vm.less b/demo/less/vm.less index 22ff13396..45094646a 100644 --- a/demo/less/vm.less +++ b/demo/less/vm.less @@ -1,4 +1,4 @@ -@import "index"; +@import "index.less"; .mvc-button { &:hover, &.hover { diff --git a/demo/less/west.less b/demo/less/west.less index a3ed9a55e..c9f6477ee 100644 --- a/demo/less/west.less +++ b/demo/less/west.less @@ -1,4 +1,4 @@ -@import "index"; +@import "index.less"; .demo-west { } diff --git a/private/less/app.less b/private/less/app.less index d086387ac..dd4d62029 100644 --- a/private/less/app.less +++ b/private/less/app.less @@ -1,2 +1,2 @@ -@import "../../src/less/resource/app"; -@import "var"; +@import "../../src/less/resource/app.less"; +@import "var.less"; diff --git a/private/less/background.less b/private/less/background.less index 996147127..0897148ea 100644 --- a/private/less/background.less +++ b/private/less/background.less @@ -1,2 +1,2 @@ -@import "../../src/less/resource/background"; -@import "var"; +@import "../../src/less/resource/background.less"; +@import "var.less"; diff --git a/private/less/font.less b/private/less/font.less index c236f82ed..d7399c46e 100644 --- a/private/less/font.less +++ b/private/less/font.less @@ -1,2 +1,2 @@ -@import "../../src/less/resource/font"; -@import "var"; +@import "../../src/less/resource/font.less"; +@import "var.less"; diff --git a/private/less/icon.less b/private/less/icon.less index 43e3123c5..8aa44a2ae 100644 --- a/private/less/icon.less +++ b/private/less/icon.less @@ -1,5 +1,5 @@ -@import "../../src/less/resource/icon"; -@import "var"; +@import "../../src/less/resource/icon.less"; +@import "var.less"; diff --git a/public/less/app.less b/public/less/app.less index d086387ac..dd4d62029 100644 --- a/public/less/app.less +++ b/public/less/app.less @@ -1,2 +1,2 @@ -@import "../../src/less/resource/app"; -@import "var"; +@import "../../src/less/resource/app.less"; +@import "var.less"; diff --git a/public/less/background.less b/public/less/background.less index 996147127..0897148ea 100644 --- a/public/less/background.less +++ b/public/less/background.less @@ -1,2 +1,2 @@ -@import "../../src/less/resource/background"; -@import "var"; +@import "../../src/less/resource/background.less"; +@import "var.less"; diff --git a/public/less/font.less b/public/less/font.less index c236f82ed..d7399c46e 100644 --- a/public/less/font.less +++ b/public/less/font.less @@ -1,2 +1,2 @@ -@import "../../src/less/resource/font"; -@import "var"; +@import "../../src/less/resource/font.less"; +@import "var.less"; diff --git a/public/less/icon.less b/public/less/icon.less index 43e3123c5..8aa44a2ae 100644 --- a/public/less/icon.less +++ b/public/less/icon.less @@ -1,5 +1,5 @@ -@import "../../src/less/resource/icon"; -@import "var"; +@import "../../src/less/resource/icon.less"; +@import "var.less"; diff --git a/src/less/base/colorchooser/colorchooser.popup.less b/src/less/base/colorchooser/colorchooser.popup.less index c1dd8ecda..6568f8319 100644 --- a/src/less/base/colorchooser/colorchooser.popup.less +++ b/src/less/base/colorchooser/colorchooser.popup.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-color-chooser-popup { & .disable-mask { diff --git a/src/less/base/colorchooser/colorchooser.trigger.less b/src/less/base/colorchooser/colorchooser.trigger.less index 95739ca30..a647bb9f2 100644 --- a/src/less/base/colorchooser/colorchooser.trigger.less +++ b/src/less/base/colorchooser/colorchooser.trigger.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-color-chooser-trigger { .border-radius(2px); diff --git a/src/less/base/colorchooser/colorpicker/button.colorpicker.less b/src/less/base/colorchooser/colorpicker/button.colorpicker.less index 3e85065bc..05219eb3e 100644 --- a/src/less/base/colorchooser/colorpicker/button.colorpicker.less +++ b/src/less/base/colorchooser/colorpicker/button.colorpicker.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-color-picker-button { & .color-picker-button-mask { diff --git a/src/less/base/colorchooser/colorpicker/button.colorshow.less b/src/less/base/colorchooser/colorpicker/button.colorshow.less index 85aac4635..c754a42cd 100644 --- a/src/less/base/colorchooser/colorpicker/button.colorshow.less +++ b/src/less/base/colorchooser/colorpicker/button.colorshow.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-color-chooser-show-button { &.active, &:active { diff --git a/src/less/base/colorchooser/colorpicker/editor.colorpicker.less b/src/less/base/colorchooser/colorpicker/editor.colorpicker.less index 12239c7de..ce0979d5b 100644 --- a/src/less/base/colorchooser/colorpicker/editor.colorpicker.less +++ b/src/less/base/colorchooser/colorpicker/editor.colorpicker.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-color-picker-editor { & .color-picker-editor-display { diff --git a/src/less/base/colorchooser/farbtastic/farbtastic.less b/src/less/base/colorchooser/farbtastic/farbtastic.less index 38e719ea6..757d57599 100644 --- a/src/less/base/colorchooser/farbtastic/farbtastic.less +++ b/src/less/base/colorchooser/farbtastic/farbtastic.less @@ -1,5 +1,5 @@ -@import "../../../index"; -@import "../../../image"; +@import "../../../index.less"; +@import "../../../image.less"; .bi-farbtastic { & * { diff --git a/src/less/base/combo/combo.bubble.less b/src/less/base/combo/combo.bubble.less index a6f21add1..c3c14ac0a 100644 --- a/src/less/base/combo/combo.bubble.less +++ b/src/less/base/combo/combo.bubble.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; // .bi-bubble-combo { // & .button-combo-triangle-wrapper { diff --git a/src/less/base/combo/combo.less b/src/less/base/combo/combo.less index e6b8bcded..9725ac58a 100644 --- a/src/less/base/combo/combo.less +++ b/src/less/base/combo/combo.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; @val: transform .3s ease; .bi-combo { & > .bi-trigger { diff --git a/src/less/base/combo/combo.searchtextvalue.less b/src/less/base/combo/combo.searchtextvalue.less index de0ec79b3..5d5a5524c 100644 --- a/src/less/base/combo/combo.searchtextvalue.less +++ b/src/less/base/combo/combo.searchtextvalue.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; @val: transform .3s ease; .bi-search-text-value-combo{ & .trigger-icon-button{ diff --git a/src/less/base/combo/combo.textvalue.icon.less b/src/less/base/combo/combo.textvalue.icon.less index 79fef76ed..9d32d4971 100644 --- a/src/less/base/combo/combo.textvalue.icon.less +++ b/src/less/base/combo/combo.textvalue.icon.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-icon-text-value-combo{ &.combo-error { diff --git a/src/less/base/combo/combo.textvalue.less b/src/less/base/combo/combo.textvalue.less index dbf76aaa0..1feec1972 100644 --- a/src/less/base/combo/combo.textvalue.less +++ b/src/less/base/combo/combo.textvalue.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-text-value-combo { &.combo-error { diff --git a/src/less/base/combo/combo.textvaluecheck.less b/src/less/base/combo/combo.textvaluecheck.less index 9965f103f..7bed7c0db 100644 --- a/src/less/base/combo/combo.textvaluecheck.less +++ b/src/less/base/combo/combo.textvaluecheck.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-text-value-check-combo { &.bi-combo-popup, &:hover { diff --git a/src/less/base/combo/combo.textvaluedownlist.less b/src/less/base/combo/combo.textvaluedownlist.less index 823410272..be66b4294 100644 --- a/src/less/base/combo/combo.textvaluedownlist.less +++ b/src/less/base/combo/combo.textvaluedownlist.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-text-value-down-list-combo { &.bi-combo-popup, &:hover { diff --git a/src/less/base/combo/popup.bubble.less b/src/less/base/combo/popup.bubble.less index 2bfd50acc..09b440c28 100644 --- a/src/less/base/combo/popup.bubble.less +++ b/src/less/base/combo/popup.bubble.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-bubble-popup-view { &.bi-popup-view > .list-view-shadow { diff --git a/src/less/base/dom.less b/src/less/base/dom.less index 6dc909e1a..ffac75ef8 100644 --- a/src/less/base/dom.less +++ b/src/less/base/dom.less @@ -1,2 +1,2 @@ -@import "../index"; -@import "../lib/colors"; +@import "../index.less"; +@import "../lib/colors.less"; diff --git a/src/less/base/editor/editor.search.less b/src/less/base/editor/editor.search.less index f9094473b..cf29965b0 100644 --- a/src/less/base/editor/editor.search.less +++ b/src/less/base/editor/editor.search.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; /*************BI.SearchEditor******************/ .bi-search-editor { .border-radius(2px); diff --git a/src/less/base/editor/editor.search.small.less b/src/less/base/editor/editor.search.small.less index 234609f99..4eadc15aa 100644 --- a/src/less/base/editor/editor.search.small.less +++ b/src/less/base/editor/editor.search.small.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-small-search-editor { & .bi-editor { diff --git a/src/less/base/foundation/bi.message.less b/src/less/base/foundation/bi.message.less index 1e48abe01..c1605f47b 100644 --- a/src/less/base/foundation/bi.message.less +++ b/src/less/base/foundation/bi.message.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-message-title { font-size: @font-size-14; diff --git a/src/less/base/layer/layer.multiselect.less b/src/less/base/layer/layer.multiselect.less index 50b0f492e..adabe161e 100644 --- a/src/less/base/layer/layer.multiselect.less +++ b/src/less/base/layer/layer.multiselect.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-multi-list-view{ & .bi-button-mask{ diff --git a/src/less/base/layer/panel.less b/src/less/base/layer/panel.less index 79332582f..a76212335 100644 --- a/src/less/base/layer/panel.less +++ b/src/less/base/layer/panel.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-panel{ .border-radius(2px); diff --git a/src/less/base/loader/sort.list.less b/src/less/base/loader/sort.list.less index 14dc71457..a8239b708 100644 --- a/src/less/base/loader/sort.list.less +++ b/src/less/base/loader/sort.list.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-sortable-holder { border: 1px dashed @color-bi-border-sortable-holder; diff --git a/src/less/base/pager/pager.all.count.less b/src/less/base/pager/pager.all.count.less index 717c2f5ec..71a90bb9a 100644 --- a/src/less/base/pager/pager.all.count.less +++ b/src/less/base/pager/pager.all.count.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-all-count-pager { & .all-pager-prev { diff --git a/src/less/base/pager/pager.direction.less b/src/less/base/pager/pager.direction.less index c558a3472..5c946cd29 100644 --- a/src/less/base/pager/pager.direction.less +++ b/src/less/base/pager/pager.direction.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-direction-pager { & .direction-pager-prev { diff --git a/src/less/base/pager/pager.less b/src/less/base/pager/pager.less index 8b4530186..bd4b5abcc 100644 --- a/src/less/base/pager/pager.less +++ b/src/less/base/pager/pager.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-pager{ & .page-item{ diff --git a/src/less/base/pane.less b/src/less/base/pane.less index a83e80756..ea7783f0a 100644 --- a/src/less/base/pane.less +++ b/src/less/base/pane.less @@ -1,6 +1,6 @@ -@import "../index"; -@import "../image"; -@import "../lib/icon"; +@import "../index.less"; +@import "../image.less"; +@import "../lib/icon.less"; .bi-pane { min-height: 25px; &.loading-status{ diff --git a/src/less/base/segment/button.segment.less b/src/less/base/segment/button.segment.less index acb0a7b43..451d65f33 100644 --- a/src/less/base/segment/button.segment.less +++ b/src/less/base/segment/button.segment.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-segment-button { @transition: color 0.3s, background 0.3s, border-color 0.3s, box-shadow 0.3s; diff --git a/src/less/base/segment/segment.less b/src/less/base/segment/segment.less index cfbf6c77e..f106ddc75 100644 --- a/src/less/base/segment/segment.less +++ b/src/less/base/segment/segment.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-segment{ & > .center-element{ diff --git a/src/less/base/single/button/button.half.less b/src/less/base/single/button/button.half.less index 3f8c1377f..b652328fb 100644 --- a/src/less/base/single/button/button.half.less +++ b/src/less/base/single/button/button.half.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-half-button { .border-radius(2px); diff --git a/src/less/base/single/button/button.less b/src/less/base/single/button/button.less index d8f511c01..e34c4f5f0 100644 --- a/src/less/base/single/button/button.less +++ b/src/less/base/single/button/button.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; @hoverVal: opacity .3s ease; @activeVal: transform .5s ease, opacity 1s ease; @activeStopVal: transform 0s; diff --git a/src/less/base/single/button/item.singleselect.icontext.less b/src/less/base/single/button/item.singleselect.icontext.less index 94228aaf8..2f698d894 100644 --- a/src/less/base/single/button/item.singleselect.icontext.less +++ b/src/less/base/single/button/item.singleselect.icontext.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-single-select-icon-text-item{ &:active, &.active { diff --git a/src/less/base/single/button/switch.less b/src/less/base/single/button/switch.less index 22ba538c9..f7101201a 100644 --- a/src/less/base/single/button/switch.less +++ b/src/less/base/single/button/switch.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-switch { font-size: @font-size-12; diff --git a/src/less/base/single/editor/editor.multifile.less b/src/less/base/single/editor/editor.multifile.less index fea7b2e9e..1bf507ca7 100644 --- a/src/less/base/single/editor/editor.multifile.less +++ b/src/less/base/single/editor/editor.multifile.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-multifile-editor { .multifile-editor { diff --git a/src/less/base/single/editor/editor.textarea.less b/src/less/base/single/editor/editor.textarea.less index 2ba0dd548..dc0a77a03 100644 --- a/src/less/base/single/editor/editor.textarea.less +++ b/src/less/base/single/editor/editor.textarea.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-textarea-editor { .overflow-hidden(); diff --git a/src/less/base/single/html.less b/src/less/base/single/html.less index 0af012d03..3159bc630 100644 --- a/src/less/base/single/html.less +++ b/src/less/base/single/html.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-html { article, diff --git a/src/less/base/single/input/checkbox.less b/src/less/base/single/input/checkbox.less index 89c9b205b..7141d75a9 100644 --- a/src/less/base/single/input/checkbox.less +++ b/src/less/base/single/input/checkbox.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-checkbox { & .checkbox-content, &.checkbox-content { diff --git a/src/less/base/single/input/file.less b/src/less/base/single/input/file.less index 4a4e31aef..03488689f 100644 --- a/src/less/base/single/input/file.less +++ b/src/less/base/single/input/file.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-file{ .opacity(0); diff --git a/src/less/base/single/input/input.less b/src/less/base/single/input/input.less index 6d4017e5c..504088485 100644 --- a/src/less/base/single/input/input.less +++ b/src/less/base/single/input/input.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-input, .bi-textarea{ border: none; diff --git a/src/less/base/single/input/radio.less b/src/less/base/single/input/radio.less index 1f5383177..8e48818e7 100644 --- a/src/less/base/single/input/radio.less +++ b/src/less/base/single/input/radio.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-radio { & .radio-content, &.radio-content { diff --git a/src/less/base/single/label.less b/src/less/base/single/label.less index 726d2a208..e0d6982d5 100644 --- a/src/less/base/single/label.less +++ b/src/less/base/single/label.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-label { .overflow-hidden(); diff --git a/src/less/base/single/text.less b/src/less/base/single/text.less index ec0841923..bd4aada73 100644 --- a/src/less/base/single/text.less +++ b/src/less/base/single/text.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-text { .overflow-hidden(); diff --git a/src/less/base/single/tip/tip.bubble.less b/src/less/base/single/tip/tip.bubble.less index ea40fd784..e18e3ffc9 100644 --- a/src/less/base/single/tip/tip.bubble.less +++ b/src/less/base/single/tip/tip.bubble.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-bubble { z-index: @zIndex-tip; diff --git a/src/less/base/single/tip/tip.less b/src/less/base/single/tip/tip.less index 087f342a6..209fbb664 100644 --- a/src/less/base/single/tip/tip.less +++ b/src/less/base/single/tip/tip.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-tip{ position: fixed !important; diff --git a/src/less/base/single/tip/tip.toast.less b/src/less/base/single/tip/tip.toast.less index 49b174614..875dfa586 100644 --- a/src/less/base/single/tip/tip.toast.less +++ b/src/less/base/single/tip/tip.toast.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-toast{ color: @color-bi-color-toast-text; diff --git a/src/less/base/single/tip/tip.tooltip.less b/src/less/base/single/tip/tip.tooltip.less index d78cd410f..bd1b22f98 100644 --- a/src/less/base/single/tip/tip.tooltip.less +++ b/src/less/base/single/tip/tip.tooltip.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-tooltip{ max-width: 250px; diff --git a/src/less/base/tree/tree.branch.less b/src/less/base/tree/tree.branch.less index 8c4ba3b9c..7328be6f5 100644 --- a/src/less/base/tree/tree.branch.less +++ b/src/less/base/tree/tree.branch.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-branch-tree{ & .bi-branch-tree-view{ min-width: 300px; diff --git a/src/less/base/tree/tree.display.less b/src/less/base/tree/tree.display.less index 20124e7d6..2343d4054 100644 --- a/src/less/base/tree/tree.display.less +++ b/src/less/base/tree/tree.display.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-display-tree{ .ztree * { diff --git a/src/less/base/tree/tree.expander.less b/src/less/base/tree/tree.expander.less index 67aac48d3..04bdd64ac 100644 --- a/src/less/base/tree/tree.expander.less +++ b/src/less/base/tree/tree.expander.less @@ -1,6 +1,6 @@ -@import "../../index"; -@import "../../image"; -@import "../../lib/icon"; +@import "../../index.less"; +@import "../../image.less"; +@import "../../lib/icon.less"; .bi-tree-expander-popup.line:before { position: absolute; content: ""; diff --git a/src/less/base/tree/tree.list.display.less b/src/less/base/tree/tree.list.display.less index e58d3a5dd..0a6b114d2 100644 --- a/src/less/base/tree/tree.list.display.less +++ b/src/less/base/tree/tree.list.display.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-list-display-tree{ diff --git a/src/less/base/tree/ztree.less b/src/less/base/tree/ztree.less index 630c48b45..4d3cfc877 100644 --- a/src/less/base/tree/ztree.less +++ b/src/less/base/tree/ztree.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .ztree * { padding: 0; diff --git a/src/less/base/trigger/trigger.less b/src/less/base/trigger/trigger.less index 1d25e3fd0..bcd89590a 100644 --- a/src/less/base/trigger/trigger.less +++ b/src/less/base/trigger/trigger.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-trigger{ & .bi-trigger-icon-button{ diff --git a/src/less/base/trigger/trigger.selecttext.less b/src/less/base/trigger/trigger.selecttext.less index 309aa7ef5..2c353833e 100644 --- a/src/less/base/trigger/trigger.selecttext.less +++ b/src/less/base/trigger/trigger.selecttext.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-select-text-trigger{ .border-radius(2px); diff --git a/src/less/base/trigger/trigger.selecttextsmall.less b/src/less/base/trigger/trigger.selecttextsmall.less index a4480d44e..749fd67f9 100644 --- a/src/less/base/trigger/trigger.selecttextsmall.less +++ b/src/less/base/trigger/trigger.selecttextsmall.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-small-select-text-trigger{ .border-radius(2px); diff --git a/src/less/base/view/drawer.less b/src/less/base/view/drawer.less index 80a8ca1be..76ab23d18 100644 --- a/src/less/base/view/drawer.less +++ b/src/less/base/view/drawer.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-drawer { .box-shadows(-6px 0 16px -8px #00000014, -9px 0 28px #0000000d, -12px 0 48px 16px #00000008); diff --git a/src/less/base/view/popover.less b/src/less/base/view/popover.less index 27b65a895..98dedcc7a 100644 --- a/src/less/base/view/popover.less +++ b/src/less/base/view/popover.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-popover { border: 1px solid transparent; diff --git a/src/less/base/view/popupview.less b/src/less/base/view/popupview.less index c9aeb1333..676e19f1d 100644 --- a/src/less/base/view/popupview.less +++ b/src/less/base/view/popupview.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-popup-view { position: fixed !important; diff --git a/src/less/component/form/form.less b/src/less/component/form/form.less index b4e77e0a8..5dfc027b2 100644 --- a/src/less/component/form/form.less +++ b/src/less/component/form/form.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-form { & .bi-form-field.error { diff --git a/src/less/core/normalize2.less b/src/less/core/normalize2.less index 11c876b5c..e2bea8699 100644 --- a/src/less/core/normalize2.less +++ b/src/less/core/normalize2.less @@ -1,4 +1,4 @@ -@import "../index"; +@import "../index.less"; a { outline: none; diff --git a/src/less/core/utils/animation.less b/src/less/core/utils/animation.less index 22bd65cde..809604ee2 100644 --- a/src/less/core/utils/animation.less +++ b/src/less/core/utils/animation.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; /** 循环旋转动画 **/ .anim-rotate { .animation(rotate 1s infinite linear both); diff --git a/src/less/core/utils/common.less b/src/less/core/utils/common.less index 5d9b11c3e..fd9b61c4a 100644 --- a/src/less/core/utils/common.less +++ b/src/less/core/utils/common.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .base-disabled { cursor: not-allowed !important; diff --git a/src/less/core/utils/list-item.less b/src/less/core/utils/list-item.less index 8964830cd..c084ac275 100644 --- a/src/less/core/utils/list-item.less +++ b/src/less/core/utils/list-item.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; // hover的时候背景变化,文字变黑 .bi-list-item { diff --git a/src/less/core/utils/motion/fade.less b/src/less/core/utils/motion/fade.less index d51a68c75..5f0fee5ff 100644 --- a/src/less/core/utils/motion/fade.less +++ b/src/less/core/utils/motion/fade.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .fade-motion(@className, @keyframeName) { .make-motion(@className, @keyframeName); diff --git a/src/less/core/utils/motion/move.less b/src/less/core/utils/motion/move.less index 3024c2a8b..eac06e005 100644 --- a/src/less/core/utils/motion/move.less +++ b/src/less/core/utils/motion/move.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .move-motion(@className, @keyframeName) { .make-motion(@className, @keyframeName); diff --git a/src/less/core/utils/motion/slide.less b/src/less/core/utils/motion/slide.less index 0fa6567a4..fd62e95fe 100644 --- a/src/less/core/utils/motion/slide.less +++ b/src/less/core/utils/motion/slide.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .slide-motion(@className, @keyframeName) { .make-motion(@className, @keyframeName); diff --git a/src/less/core/utils/motion/zoom.less b/src/less/core/utils/motion/zoom.less index 2407b8428..7e0e0ec44 100644 --- a/src/less/core/utils/motion/zoom.less +++ b/src/less/core/utils/motion/zoom.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .zoom-motion(@className, @keyframeName, @duration: @animation-duration-base) { .make-motion(@className, @keyframeName, @duration); diff --git a/src/less/core/utils/position.less b/src/less/core/utils/position.less index a9693147e..12f687077 100644 --- a/src/less/core/utils/position.less +++ b/src/less/core/utils/position.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .display-block { display: block; diff --git a/src/less/core/utils/size.less b/src/less/core/utils/size.less index e14cca14c..575729c28 100644 --- a/src/less/core/utils/size.less +++ b/src/less/core/utils/size.less @@ -1,5 +1,5 @@ -@import "../../lib/constant"; -@import "../../image"; +@import "../../lib/constant.less"; +@import "../../image.less"; .iconSize(icon-size-12, @font-size-12); .iconSize(icon-size-13, @font-size-13); diff --git a/src/less/core/utils/sizing.less b/src/less/core/utils/sizing.less index 643984a57..e199658b2 100644 --- a/src/less/core/utils/sizing.less +++ b/src/less/core/utils/sizing.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; /*类似ie6的盒子模型 可以在有百分比的时候加border 支持到ie8*/ .border-sizing{ .box-sizing(border-box); diff --git a/src/less/core/utils/typographic.less b/src/less/core/utils/typographic.less index e15f24cf9..ebdedf85e 100644 --- a/src/less/core/utils/typographic.less +++ b/src/less/core/utils/typographic.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .y-overflow-auto { overflow-y: auto; diff --git a/src/less/image.less b/src/less/image.less index 0e4a7d49f..bd2bcfabc 100644 --- a/src/less/image.less +++ b/src/less/image.less @@ -1,4 +1,4 @@ -@import "var"; +@import "var.less"; .imagePath(none) { background: none; diff --git a/src/less/index.less b/src/less/index.less index 3644b8e34..47f735cef 100644 --- a/src/less/index.less +++ b/src/less/index.less @@ -1,8 +1,8 @@ -@import "position"; -@import "box-model"; -@import "typographic"; -@import "visual"; -@import "motion"; -@import "var"; -@import "lib/colors"; -@import "lib/theme"; +@import "position.less"; +@import "box-model.less"; +@import "typographic.less"; +@import "visual.less"; +@import "motion.less"; +@import "var.less"; +@import "lib/colors.less"; +@import "lib/theme.less"; diff --git a/src/less/lib/colors.less b/src/less/lib/colors.less index 394bb5f66..060768c03 100644 --- a/src/less/lib/colors.less +++ b/src/less/lib/colors.less @@ -1,4 +1,4 @@ -@import "constant"; +@import "constant.less"; // 通用色彩库。从constant.less中获取相关颜色,不要出现#xxxxxx diff --git a/src/less/lib/theme-modern.less b/src/less/lib/theme-modern.less index 000a92253..c2f3d9c55 100644 --- a/src/less/lib/theme-modern.less +++ b/src/less/lib/theme-modern.less @@ -1,4 +1,4 @@ -@import "colors"; +@import "colors.less"; // 专属组件色彩库,通用配色中有的用通用配色,否则选constant自定义配色 diff --git a/src/less/lib/theme.less b/src/less/lib/theme.less index 9fddef950..db42c9ef4 100644 --- a/src/less/lib/theme.less +++ b/src/less/lib/theme.less @@ -1,4 +1,4 @@ -@import "colors"; +@import "colors.less"; // 专属组件色彩库,通用配色中有的用通用配色,否则选constant自定义配色 diff --git a/src/less/resource/app.less b/src/less/resource/app.less index 4d80b12b9..4f61322d1 100644 --- a/src/less/resource/app.less +++ b/src/less/resource/app.less @@ -1,4 +1,4 @@ -@import "../index"; +@import "../index.less"; html { height: 100%; diff --git a/src/less/resource/background.less b/src/less/resource/background.less index 4e1c6a51e..8aca40b17 100644 --- a/src/less/resource/background.less +++ b/src/less/resource/background.less @@ -1,6 +1,6 @@ -@import "../image"; -@import "../lib/icon"; -@import "../lib/background"; +@import "../image.less"; +@import "../lib/icon.less"; +@import "../lib/background.less"; @import "../base/tree/tree.expander.less"; .bi-display-tree { diff --git a/src/less/resource/font.less b/src/less/resource/font.less index 7e7e4e91c..a6551f864 100644 --- a/src/less/resource/font.less +++ b/src/less/resource/font.less @@ -1,7 +1,7 @@ -@import "../lib/font"; -@import "../lib/colors"; -@import "../lib/theme"; -@import "../image"; +@import "../lib/font.less"; +@import "../lib/colors.less"; +@import "../lib/theme.less"; +@import "../image.less"; .addFontRes(); .activateFont(); diff --git a/src/less/resource/icon.less b/src/less/resource/icon.less index a97b429da..be2f6885d 100644 --- a/src/less/resource/icon.less +++ b/src/less/resource/icon.less @@ -1,5 +1,5 @@ -@import "../image"; -@import "../lib/icon"; +@import "../image.less"; +@import "../lib/icon.less"; //Tree Widget .icon(tree-collapse-icon-type1, @icon-tree-collapse-type1); diff --git a/src/less/theme/dark.less b/src/less/theme/dark.less index ed4bc3c67..a0149a1f9 100644 --- a/src/less/theme/dark.less +++ b/src/less/theme/dark.less @@ -1,4 +1,4 @@ -@import "../index"; +@import "../index.less"; .bi-theme-dark { color: @color-bi-text-theme-dark; diff --git a/src/less/theme/default.less b/src/less/theme/default.less index 303dfa0a4..ad1daefb1 100644 --- a/src/less/theme/default.less +++ b/src/less/theme/default.less @@ -1,4 +1,4 @@ -@import "../index"; +@import "../index.less"; .bi-theme-default{ diff --git a/src/less/theme/light.less b/src/less/theme/light.less index 0accbb8b3..50210951d 100644 --- a/src/less/theme/light.less +++ b/src/less/theme/light.less @@ -1,4 +1,4 @@ -@import "../index"; +@import "../index.less"; .bi-theme-light { } \ No newline at end of file diff --git a/src/less/widget/date/trigger.date.less b/src/less/widget/date/trigger.date.less index 99162d9c2..50e341418 100644 --- a/src/less/widget/date/trigger.date.less +++ b/src/less/widget/date/trigger.date.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-date-trigger { .border-radius(2px); diff --git a/src/less/widget/downlist/popup.downlist.less b/src/less/widget/downlist/popup.downlist.less index cdddf37da..ba48525f2 100644 --- a/src/less/widget/downlist/popup.downlist.less +++ b/src/less/widget/downlist/popup.downlist.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-down-list-popup { & .list-group-item-text { diff --git a/src/less/widget/dynamicdatecombo/dynamicdatepopup.less b/src/less/widget/dynamicdatecombo/dynamicdatepopup.less index 81b8893a2..4c4cb053e 100644 --- a/src/less/widget/dynamicdatecombo/dynamicdatepopup.less +++ b/src/less/widget/dynamicdatecombo/dynamicdatepopup.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-dynamic-date-popup{ & .dynamic-date-pane { diff --git a/src/less/widget/dynamicdatecombo/dynamicdatetime.combo.less b/src/less/widget/dynamicdatecombo/dynamicdatetime.combo.less index d15ab68dc..79bbf4542 100644 --- a/src/less/widget/dynamicdatecombo/dynamicdatetime.combo.less +++ b/src/less/widget/dynamicdatecombo/dynamicdatetime.combo.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-dynamic-date-combo { & .date-font { diff --git a/src/less/widget/dynamicdatecombo/dynamicdatetimepopup.less b/src/less/widget/dynamicdatecombo/dynamicdatetimepopup.less index 81a06aff7..100770f16 100644 --- a/src/less/widget/dynamicdatecombo/dynamicdatetimepopup.less +++ b/src/less/widget/dynamicdatecombo/dynamicdatetimepopup.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-dynamic-date-time-popup{ & .dynamic-date-pane { diff --git a/src/less/widget/month/trigger.month.less b/src/less/widget/month/trigger.month.less index ff75d4df7..17796dbd5 100644 --- a/src/less/widget/month/trigger.month.less +++ b/src/less/widget/month/trigger.month.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-month-trigger{ .border-radius(2px); } \ No newline at end of file diff --git a/src/less/widget/multilayerselecttree/multilayerselecttree.combo.less b/src/less/widget/multilayerselecttree/multilayerselecttree.combo.less index 4a725cd98..ca3a79fbc 100644 --- a/src/less/widget/multilayerselecttree/multilayerselecttree.combo.less +++ b/src/less/widget/multilayerselecttree/multilayerselecttree.combo.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; @val: transform .3s ease; .bi-multilayer-select-tree-combo { & .trigger-icon-button{ diff --git a/src/less/widget/multilayersingletree/multilayersingletree.combo.less b/src/less/widget/multilayersingletree/multilayersingletree.combo.less index a589309fd..af046bc74 100644 --- a/src/less/widget/multilayersingletree/multilayersingletree.combo.less +++ b/src/less/widget/multilayersingletree/multilayersingletree.combo.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; @val: transform .3s ease; .bi-multilayer-single-tree-combo { & .trigger-icon-button{ diff --git a/src/less/widget/multiselect/check/multiselect.check.pane.less b/src/less/widget/multiselect/check/multiselect.check.pane.less index 7f0db5920..f64d2e8c2 100644 --- a/src/less/widget/multiselect/check/multiselect.check.pane.less +++ b/src/less/widget/multiselect/check/multiselect.check.pane.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-multi-select-check-pane { & .multi-select-check-selected { diff --git a/src/less/widget/multiselect/multiselect.combo.less b/src/less/widget/multiselect/multiselect.combo.less index 643062ec9..0399dd67a 100644 --- a/src/less/widget/multiselect/multiselect.combo.less +++ b/src/less/widget/multiselect/multiselect.combo.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; @val: transform .3s ease; .bi-multi-select-combo{ & .multi-select-trigger-icon-button{ diff --git a/src/less/widget/multiselect/multiselect.insert.combo.less b/src/less/widget/multiselect/multiselect.insert.combo.less index ed721fce8..ae89eed14 100644 --- a/src/less/widget/multiselect/multiselect.insert.combo.less +++ b/src/less/widget/multiselect/multiselect.insert.combo.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; @val: transform .3s ease; .bi-multi-select-insert-combo{ & .multi-select-trigger-icon-button{ diff --git a/src/less/widget/multiselect/search/multiselect.search.pane.less b/src/less/widget/multiselect/search/multiselect.search.pane.less index 97dfa3ace..27560e350 100644 --- a/src/less/widget/multiselect/search/multiselect.search.pane.less +++ b/src/less/widget/multiselect/search/multiselect.search.pane.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-multi-select-search-pane{ diff --git a/src/less/widget/multiselect/trigger/button.checkselected.less b/src/less/widget/multiselect/trigger/button.checkselected.less index deea8a46b..35c00dec0 100644 --- a/src/less/widget/multiselect/trigger/button.checkselected.less +++ b/src/less/widget/multiselect/trigger/button.checkselected.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-multi-select-check-selected-button { z-index: 1; diff --git a/src/less/widget/multistringlist/multistringlist.insert.less b/src/less/widget/multistringlist/multistringlist.insert.less index 0f33e2779..63362ff92 100644 --- a/src/less/widget/multistringlist/multistringlist.insert.less +++ b/src/less/widget/multistringlist/multistringlist.insert.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-multi-select-insert-list{ & .bi-search-editor{ .border-corner-bottom-radius(0px, 0px) diff --git a/src/less/widget/multistringlist/multistringlist.less b/src/less/widget/multistringlist/multistringlist.less index fb8e5030e..b21d88709 100644 --- a/src/less/widget/multistringlist/multistringlist.less +++ b/src/less/widget/multistringlist/multistringlist.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-multi-select-list{ & .bi-search-editor{ .border-corner-bottom-radius(0px, 0px) diff --git a/src/less/widget/multitree/check/multi.tree.check.pane.less b/src/less/widget/multitree/check/multi.tree.check.pane.less index 3d40ae597..e193fb210 100644 --- a/src/less/widget/multitree/check/multi.tree.check.pane.less +++ b/src/less/widget/multitree/check/multi.tree.check.pane.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-multi-tree-check-pane { & .multi-tree-continue-select { diff --git a/src/less/widget/multitree/multi.tree.combo.less b/src/less/widget/multitree/multi.tree.combo.less index 73db11ef5..7e193b7d3 100644 --- a/src/less/widget/multitree/multi.tree.combo.less +++ b/src/less/widget/multitree/multi.tree.combo.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; @val: transform .3s ease; .bi-multi-tree-combo{ & .multi-select-trigger-icon-button{ diff --git a/src/less/widget/multitree/popup.multi.tree.less b/src/less/widget/multitree/popup.multi.tree.less index c19617edd..e1a55ac69 100644 --- a/src/less/widget/multitree/popup.multi.tree.less +++ b/src/less/widget/multitree/popup.multi.tree.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-multi-tree-popup{ & .popup-view-tree{ diff --git a/src/less/widget/multitree/trigger/multi.tree.button.checkselected.less b/src/less/widget/multitree/trigger/multi.tree.button.checkselected.less index b4903d3ba..55207b67a 100644 --- a/src/less/widget/multitree/trigger/multi.tree.button.checkselected.less +++ b/src/less/widget/multitree/trigger/multi.tree.button.checkselected.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-multi-tree-check-selected-button { & .trigger-check-selected{ diff --git a/src/less/widget/numbereditor/number.editor.less b/src/less/widget/numbereditor/number.editor.less index 6a86c5372..ba8ab84ac 100644 --- a/src/less/widget/numbereditor/number.editor.less +++ b/src/less/widget/numbereditor/number.editor.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-number-editor { .border-radius(2px); diff --git a/src/less/widget/numberinterval/numberinterval.less b/src/less/widget/numberinterval/numberinterval.less index 811caf679..67b5a835a 100644 --- a/src/less/widget/numberinterval/numberinterval.less +++ b/src/less/widget/numberinterval/numberinterval.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-number-interval { &.hack { diff --git a/src/less/widget/quarter/trigger.quarter.less b/src/less/widget/quarter/trigger.quarter.less index 7d50e896c..f50734871 100644 --- a/src/less/widget/quarter/trigger.quarter.less +++ b/src/less/widget/quarter/trigger.quarter.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-quarter-trigger{ .border-radius(2px); } \ No newline at end of file diff --git a/src/less/widget/searchmultiselect/searchmultiselect.less b/src/less/widget/searchmultiselect/searchmultiselect.less index ff7a3c41c..bd43f3a11 100644 --- a/src/less/widget/searchmultiselect/searchmultiselect.less +++ b/src/less/widget/searchmultiselect/searchmultiselect.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-search-multi-text-value-combo{ & .multi-select-trigger-icon-button{ diff --git a/src/less/widget/singleselect/search/singleselect.search.pane.less b/src/less/widget/singleselect/search/singleselect.search.pane.less index 0ac8837e0..e9fcd04ec 100644 --- a/src/less/widget/singleselect/search/singleselect.search.pane.less +++ b/src/less/widget/singleselect/search/singleselect.search.pane.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-single-select-search-pane{ diff --git a/src/less/widget/singleselect/singleselect.combo.less b/src/less/widget/singleselect/singleselect.combo.less index c32f46b04..c75ee780f 100644 --- a/src/less/widget/singleselect/singleselect.combo.less +++ b/src/less/widget/singleselect/singleselect.combo.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; @val: transform .3s ease; .bi-single-select-combo{ & .single-select-trigger-icon-button{ diff --git a/src/less/widget/singleslider/slider/widget.slider.less b/src/less/widget/singleslider/slider/widget.slider.less index 9ecc523d8..dc6f563b4 100644 --- a/src/less/widget/singleslider/slider/widget.slider.less +++ b/src/less/widget/singleslider/slider/widget.slider.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-single-slider-button { & .slider-button { diff --git a/src/less/widget/singleslider/track/widget.track.less b/src/less/widget/singleslider/track/widget.track.less index ba1fdebb3..833fdb4be 100644 --- a/src/less/widget/singleslider/track/widget.track.less +++ b/src/less/widget/singleslider/track/widget.track.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-slider-track { & .gray-track { diff --git a/src/less/widget/timecombo/timecombo.less b/src/less/widget/timecombo/timecombo.less index 6ed973121..4929b415d 100644 --- a/src/less/widget/timecombo/timecombo.less +++ b/src/less/widget/timecombo/timecombo.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-time-trigger{ & .show-text { diff --git a/src/less/widget/timeinterval/dateinterval.less b/src/less/widget/timeinterval/dateinterval.less index 0680ad971..f39baa3f5 100644 --- a/src/less/widget/timeinterval/dateinterval.less +++ b/src/less/widget/timeinterval/dateinterval.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-date-interval{ &.time-error .bi-input{ diff --git a/src/less/widget/timeinterval/timeinterval.less b/src/less/widget/timeinterval/timeinterval.less index 81e252c20..6f64b0ae7 100644 --- a/src/less/widget/timeinterval/timeinterval.less +++ b/src/less/widget/timeinterval/timeinterval.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-time-interval{ & .bi-date-time-trigger{ diff --git a/src/less/widget/year/popup.year.less b/src/less/widget/year/popup.year.less index 814878f89..148f40508 100644 --- a/src/less/widget/year/popup.year.less +++ b/src/less/widget/year/popup.year.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-year-popup { & .year-popup-navigation { diff --git a/src/less/widget/year/trigger.year.less b/src/less/widget/year/trigger.year.less index 8b1c1296e..ed8d0d442 100644 --- a/src/less/widget/year/trigger.year.less +++ b/src/less/widget/year/trigger.year.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-year-trigger{ .border-radius(2px); } \ No newline at end of file diff --git a/src/less/widget/yearinterval/yearinterval.less b/src/less/widget/yearinterval/yearinterval.less index 8a4929dac..e2f7a497e 100644 --- a/src/less/widget/yearinterval/yearinterval.less +++ b/src/less/widget/yearinterval/yearinterval.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-year-interval{ &.time-error .bi-input{ diff --git a/src/less/widget/yearmonth/popup.yearmonth.less b/src/less/widget/yearmonth/popup.yearmonth.less index 614fbd4c8..1ec1ab0b0 100644 --- a/src/less/widget/yearmonth/popup.yearmonth.less +++ b/src/less/widget/yearmonth/popup.yearmonth.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-year-month-popup{ & .dynamic-year-month-pane { diff --git a/src/less/widget/yearmonthinterval/yearmonthinterval.less b/src/less/widget/yearmonthinterval/yearmonthinterval.less index 12db6801c..807140f67 100644 --- a/src/less/widget/yearmonthinterval/yearmonthinterval.less +++ b/src/less/widget/yearmonthinterval/yearmonthinterval.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-year-month-interval{ &.time-error .bi-input{ diff --git a/src/less/widget/yearquarter/popup.yearquarter.less b/src/less/widget/yearquarter/popup.yearquarter.less index 37c00f9dc..7c9d97ffb 100644 --- a/src/less/widget/yearquarter/popup.yearquarter.less +++ b/src/less/widget/yearquarter/popup.yearquarter.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-year-quarter-popup{ & .dynamic-year-quarter-pane { diff --git a/src/less/widget/yearquarterinterval/yearquarterinterval.less b/src/less/widget/yearquarterinterval/yearquarterinterval.less index 380e59fbe..35508cb67 100644 --- a/src/less/widget/yearquarterinterval/yearquarterinterval.less +++ b/src/less/widget/yearquarterinterval/yearquarterinterval.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-year-quarter-interval{ &.time-error .bi-input{ diff --git a/ui/less/app.less b/ui/less/app.less index d086387ac..27e4631e7 100644 --- a/ui/less/app.less +++ b/ui/less/app.less @@ -1,2 +1,2 @@ -@import "../../src/less/resource/app"; -@import "var"; +@import "../../src/less/resource/app.less"; +@import "var.less"; diff --git a/ui/less/background.less b/ui/less/background.less index 996147127..a6cbde36b 100644 --- a/ui/less/background.less +++ b/ui/less/background.less @@ -1,2 +1,2 @@ -@import "../../src/less/resource/background"; -@import "var"; +@import "../../src/less/resource/background.less"; +@import "var.less"; diff --git a/ui/less/font.less b/ui/less/font.less index c236f82ed..d7399c46e 100644 --- a/ui/less/font.less +++ b/ui/less/font.less @@ -1,2 +1,2 @@ -@import "../../src/less/resource/font"; -@import "var"; +@import "../../src/less/resource/font.less"; +@import "var.less"; diff --git a/ui/less/icon.less b/ui/less/icon.less index 43e3123c5..8aa44a2ae 100644 --- a/ui/less/icon.less +++ b/ui/less/icon.less @@ -1,5 +1,5 @@ -@import "../../src/less/resource/icon"; -@import "var"; +@import "../../src/less/resource/icon.less"; +@import "var.less"; From c70f92dd369de21220faa4a42123b85d89f86b5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=95=AC=E5=B3=A5?= Date: Thu, 5 May 2022 14:55:56 +0800 Subject: [PATCH 10/60] =?UTF-8?q?BI-105186:=E5=A4=8D=E9=80=89=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E6=A1=86=E5=85=A8=E9=80=89=E9=80=BB=E8=BE=91=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E9=94=99=E8=AF=AF,type:2=E8=AE=BE=E7=BD=AE=E5=85=A8?= =?UTF-8?q?=E9=80=89=E6=97=B6,=E5=88=A4=E6=96=AD=E5=85=A8=E9=80=89?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E9=80=89=E6=8B=A9=E7=8A=B6=E6=80=81=E9=9C=80?= =?UTF-8?q?=E8=80=83=E8=99=91=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/list/list.select.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/case/list/list.select.js b/src/case/list/list.select.js index 12037b9a9..bab4a15af 100644 --- a/src/case/list/list.select.js +++ b/src/case/list/list.select.js @@ -94,7 +94,7 @@ BI.SelectList = BI.inherit(BI.Widget, { var hasNext = this.list.hasNext(); var isAlreadyAllSelected = this.toolbar.isSelected(); var isHalf = selectLength > 0 && notSelectLength > 0; - var allSelected = isAlreadyAllSelected; + var allSelected = selectLength > 0 && notSelectLength <= 0 && (!hasNext || isAlreadyAllSelected); if (this.isAllSelected() === false) { hasNext && (isHalf = selectLength > 0); From a3705a97c56c9e88b96fa6206ce094e1973c0099 Mon Sep 17 00:00:00 2001 From: data Date: Thu, 5 May 2022 16:03:29 +0800 Subject: [PATCH 11/60] auto upgrade version to 2.0.20220505160323 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c87354dbc..bdbc00acb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220429160420", + "version": "2.0.20220505160323", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From b546cc6c51479fb77000e68844202df228410840 Mon Sep 17 00:00:00 2001 From: data Date: Thu, 5 May 2022 16:13:58 +0800 Subject: [PATCH 12/60] auto upgrade version to 2.0.20220505161347 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bdbc00acb..b3355d4f6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220505160323", + "version": "2.0.20220505161347", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 172f50c994c2528b772e8c74680ebe3a0b2ce5fe Mon Sep 17 00:00:00 2001 From: zsmj Date: Thu, 5 May 2022 16:28:05 +0800 Subject: [PATCH 13/60] =?UTF-8?q?=E6=97=A0JIRA=20bi.search=5Feditor=20?= =?UTF-8?q?=E5=9C=A8=E6=9C=89=E5=88=9D=E5=A7=8B=E5=80=BC=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=E6=98=BE=E7=A4=BAclear=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/editor/editor.search.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/widget/editor/editor.search.js b/src/widget/editor/editor.search.js index af9a14614..dac41e92d 100644 --- a/src/widget/editor/editor.search.js +++ b/src/widget/editor/editor.search.js @@ -32,7 +32,8 @@ BI.SearchEditor = BI.inherit(BI.Widget, { this.clear = BI.createWidget({ type: "bi.icon_button", stopEvent: true, - cls: "close-font" + cls: "close-font", + invisible: !o.value }); this.clear.on(BI.IconButton.EVENT_CHANGE, function () { self.setValue(""); @@ -123,8 +124,6 @@ BI.SearchEditor = BI.inherit(BI.Widget, { this.editor.on(BI.Editor.EVENT_STOP, function () { self.fireEvent(BI.SearchEditor.EVENT_STOP); }); - - this.clear.invisible(); }, _checkClear: function () { @@ -214,4 +213,4 @@ BI.SearchEditor.EVENT_ENTER = "EVENT_ENTER"; BI.SearchEditor.EVENT_RESTRICT = "EVENT_RESTRICT"; BI.SearchEditor.EVENT_REMOVE = "EVENT_REMOVE"; BI.SearchEditor.EVENT_EMPTY = "EVENT_EMPTY"; -BI.shortcut("bi.search_editor", BI.SearchEditor); \ No newline at end of file +BI.shortcut("bi.search_editor", BI.SearchEditor); From 34b277068ead96acef0a86d08954468fffa3e79f Mon Sep 17 00:00:00 2001 From: zsmj Date: Thu, 5 May 2022 16:31:35 +0800 Subject: [PATCH 14/60] =?UTF-8?q?Revert=20"=E6=97=A0JIRA=20bi.search=5Fedi?= =?UTF-8?q?tor=20=E5=9C=A8=E6=9C=89=E5=88=9D=E5=A7=8B=E5=80=BC=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=E6=98=BE=E7=A4=BAclear=E6=8C=89=E9=92=AE"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 172f50c994c2528b772e8c74680ebe3a0b2ce5fe. --- src/widget/editor/editor.search.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/widget/editor/editor.search.js b/src/widget/editor/editor.search.js index dac41e92d..af9a14614 100644 --- a/src/widget/editor/editor.search.js +++ b/src/widget/editor/editor.search.js @@ -32,8 +32,7 @@ BI.SearchEditor = BI.inherit(BI.Widget, { this.clear = BI.createWidget({ type: "bi.icon_button", stopEvent: true, - cls: "close-font", - invisible: !o.value + cls: "close-font" }); this.clear.on(BI.IconButton.EVENT_CHANGE, function () { self.setValue(""); @@ -124,6 +123,8 @@ BI.SearchEditor = BI.inherit(BI.Widget, { this.editor.on(BI.Editor.EVENT_STOP, function () { self.fireEvent(BI.SearchEditor.EVENT_STOP); }); + + this.clear.invisible(); }, _checkClear: function () { @@ -213,4 +214,4 @@ BI.SearchEditor.EVENT_ENTER = "EVENT_ENTER"; BI.SearchEditor.EVENT_RESTRICT = "EVENT_RESTRICT"; BI.SearchEditor.EVENT_REMOVE = "EVENT_REMOVE"; BI.SearchEditor.EVENT_EMPTY = "EVENT_EMPTY"; -BI.shortcut("bi.search_editor", BI.SearchEditor); +BI.shortcut("bi.search_editor", BI.SearchEditor); \ No newline at end of file From fe722020d9b16a9de2668931a3a0dc0aa4e63792 Mon Sep 17 00:00:00 2001 From: freddy Date: Thu, 5 May 2022 16:52:55 +0800 Subject: [PATCH 15/60] =?UTF-8?q?REPORT-70807=20fix:=E5=B9=B4=E4=BB=BD?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E6=8E=A7=E4=BB=B6=E9=80=82=E9=85=8Dwatermark?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/year/combo.year.js | 8 ++++++-- src/widget/year/trigger.year.js | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/widget/year/combo.year.js b/src/widget/year/combo.year.js index 62a498d54..1774ca384 100644 --- a/src/widget/year/combo.year.js +++ b/src/widget/year/combo.year.js @@ -24,7 +24,8 @@ BI.DynamicYearCombo = BI.inherit(BI.Widget, { min: o.minDate, max: o.maxDate, height: o.height - border, - value: o.value || "" + value: o.value || "", + watermark: o.watermark }); this.trigger.on(BI.DynamicYearTrigger.EVENT_KEY_DOWN, function () { if (self.combo.isViewVisible()) { @@ -211,8 +212,11 @@ BI.DynamicYearCombo = BI.inherit(BI.Widget, { isStateValid: function () { return this.trigger.isValid(); - } + }, + setWaterMark: function (v) { + this.trigger.setWaterMark(v); + } }); BI.DynamicYearCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.DynamicYearCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; diff --git a/src/widget/year/trigger.year.js b/src/widget/year/trigger.year.js index 91b80a431..1cbbbd683 100644 --- a/src/widget/year/trigger.year.js +++ b/src/widget/year/trigger.year.js @@ -35,7 +35,7 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, { }, hgap: c.hgap, vgap: c.vgap, - watermark: BI.i18nText("BI-Basic_Unrestricted"), + watermark: BI.isKey(o.watermark) ? o.watermark : BI.i18nText("BI-Basic_Unrestricted"), allowBlank: true, errorText: function (v) { if (BI.isPositiveInteger(v)) { @@ -188,6 +188,10 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, { getKey: function () { return this.editor.getValue() | 0; + }, + + setWaterMark: function (v) { + this.editor.setWaterMark(v); } }); BI.DynamicYearTrigger.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; From 6d30eca76f8d7f8d43c6d72ef7840e67e3238009 Mon Sep 17 00:00:00 2001 From: freddy Date: Thu, 5 May 2022 17:13:40 +0800 Subject: [PATCH 16/60] =?UTF-8?q?REPORT-70807=20fix:=E7=BB=99watermark?= =?UTF-8?q?=E5=8A=A0=E4=B8=AAprops?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/year/trigger.year.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/widget/year/trigger.year.js b/src/widget/year/trigger.year.js index 1cbbbd683..fe8976b2f 100644 --- a/src/widget/year/trigger.year.js +++ b/src/widget/year/trigger.year.js @@ -10,7 +10,8 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, { extraCls: "bi-year-trigger", min: "1900-01-01", // 最小日期 max: "2099-12-31", // 最大日期 - height: 24 + height: 24, + watermark: BI.i18nText("BI-Basic_Unrestricted") }); }, @@ -35,7 +36,7 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, { }, hgap: c.hgap, vgap: c.vgap, - watermark: BI.isKey(o.watermark) ? o.watermark : BI.i18nText("BI-Basic_Unrestricted"), + watermark: o.watermark, allowBlank: true, errorText: function (v) { if (BI.isPositiveInteger(v)) { From f61a0ce59a353d6e8a7d17a0718bb262716f4e9f Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 6 May 2022 15:40:22 +0800 Subject: [PATCH 17/60] =?UTF-8?q?feature:=20=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/less/core/wrapper/flex.horizontal.less | 4 +++- src/less/core/wrapper/flex.vertical.less | 4 +++- src/less/core/wrapper/flex.wrapper.horizontal.less | 4 +++- src/less/core/wrapper/flex.wrapper.vertical.less | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/less/core/wrapper/flex.horizontal.less b/src/less/core/wrapper/flex.horizontal.less index a6a38704d..24d8862f6 100644 --- a/src/less/core/wrapper/flex.horizontal.less +++ b/src/less/core/wrapper/flex.horizontal.less @@ -169,7 +169,9 @@ } > .f-f { - min-width: 0; + &:not(.f-s-n) { + min-width: 0; + } -webkit-flex-grow: 1; -moz-flex-grow: 1; -ms-flex-grow: 1; diff --git a/src/less/core/wrapper/flex.vertical.less b/src/less/core/wrapper/flex.vertical.less index 5b97ea999..007396436 100644 --- a/src/less/core/wrapper/flex.vertical.less +++ b/src/less/core/wrapper/flex.vertical.less @@ -168,7 +168,9 @@ } > .f-f { - min-height: 0; + &:not(.f-s-n) { + min-height: 0; + } -webkit-flex-grow: 1; -moz-flex-grow: 1; -ms-flex-grow: 1; diff --git a/src/less/core/wrapper/flex.wrapper.horizontal.less b/src/less/core/wrapper/flex.wrapper.horizontal.less index 1b38fa0be..09926f54b 100644 --- a/src/less/core/wrapper/flex.wrapper.horizontal.less +++ b/src/less/core/wrapper/flex.wrapper.horizontal.less @@ -265,7 +265,9 @@ } > .f-f { - min-width: 0; + &:not(.f-s-n) { + min-width: 0; + } -webkit-flex-grow: 1; -moz-flex-grow: 1; -ms-flex-grow: 1; diff --git a/src/less/core/wrapper/flex.wrapper.vertical.less b/src/less/core/wrapper/flex.wrapper.vertical.less index 09693c348..118759152 100644 --- a/src/less/core/wrapper/flex.wrapper.vertical.less +++ b/src/less/core/wrapper/flex.wrapper.vertical.less @@ -259,7 +259,9 @@ } > .f-f { - min-height: 0; + &:not(.f-s-n) { + min-height: 0; + } -webkit-flex-grow: 1; -moz-flex-grow: 1; -ms-flex-grow: 1; From ce32c94936274a4a2b4f65f57ec0d9ffca93fbe7 Mon Sep 17 00:00:00 2001 From: data Date: Fri, 6 May 2022 16:14:14 +0800 Subject: [PATCH 18/60] auto upgrade version to 2.0.20220506161353 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b3355d4f6..0170e3fa3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220505161347", + "version": "2.0.20220506161353", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 5b309f8cde10b785c9b1a175747e497cc0ddbbbb Mon Sep 17 00:00:00 2001 From: data Date: Sat, 7 May 2022 14:23:51 +0800 Subject: [PATCH 19/60] auto upgrade version to 2.0.20220507142342 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0170e3fa3..74384cb8c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220506161353", + "version": "2.0.20220507142342", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 9a33d16a64ef7fe7dd43a886a7a9b7ff44ae0069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=95=AC=E5=B3=A5?= Date: Sat, 7 May 2022 14:33:05 +0800 Subject: [PATCH 20/60] =?UTF-8?q?multi=5Fselect=5Flev=E7=9A=84plus=5Fbutto?= =?UTF-8?q?n=E7=B3=BB=E7=BB=9F=E5=8F=82=E6=95=B0=E5=B8=B8=E9=87=8F?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/checkbox/check.first.treenode.js | 4 ++-- src/case/checkbox/check.last.treenode.js | 4 ++-- src/case/checkbox/check.mid.treenode.js | 4 ++-- src/case/checkbox/check.treenode.js | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/case/checkbox/check.first.treenode.js b/src/case/checkbox/check.first.treenode.js index aa808488f..40568e700 100644 --- a/src/case/checkbox/check.first.treenode.js +++ b/src/case/checkbox/check.first.treenode.js @@ -7,8 +7,8 @@ BI.FirstTreeNodeCheckbox = BI.inherit(BI.IconButton, { _defaultConfig: function () { return BI.extend( BI.FirstTreeNodeCheckbox.superclass._defaultConfig.apply(this, arguments), { extraCls: BI.STYLE_CONSTANTS.LINK_LINE_TYPE === "solid" ? "tree-solid-collapse-icon-type2" : "tree-collapse-icon-type2", - iconWidth: 24, - iconHeight: 24 + iconWidth: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, + iconHeight: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT }); }, diff --git a/src/case/checkbox/check.last.treenode.js b/src/case/checkbox/check.last.treenode.js index cb536f8cc..653dd785d 100644 --- a/src/case/checkbox/check.last.treenode.js +++ b/src/case/checkbox/check.last.treenode.js @@ -7,8 +7,8 @@ BI.LastTreeNodeCheckbox = BI.inherit(BI.IconButton, { _defaultConfig: function () { return BI.extend(BI.LastTreeNodeCheckbox.superclass._defaultConfig.apply(this, arguments), { extraCls: BI.STYLE_CONSTANTS.LINK_LINE_TYPE === "solid" ? "tree-solid-collapse-icon-type4" : "tree-collapse-icon-type4", - iconWidth: 24, - iconHeight: 24 + iconWidth: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, + iconHeight: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT }); }, diff --git a/src/case/checkbox/check.mid.treenode.js b/src/case/checkbox/check.mid.treenode.js index 7ec4e5230..716cb0142 100644 --- a/src/case/checkbox/check.mid.treenode.js +++ b/src/case/checkbox/check.mid.treenode.js @@ -7,8 +7,8 @@ BI.MidTreeNodeCheckbox = BI.inherit(BI.IconButton, { _defaultConfig: function () { return BI.extend( BI.MidTreeNodeCheckbox.superclass._defaultConfig.apply(this, arguments), { extraCls: BI.STYLE_CONSTANTS.LINK_LINE_TYPE === "solid" ? "tree-solid-collapse-icon-type3" : "tree-collapse-icon-type3", - iconWidth: 24, - iconHeight: 24 + iconWidth: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, + iconHeight: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT }); }, diff --git a/src/case/checkbox/check.treenode.js b/src/case/checkbox/check.treenode.js index 128bb73c6..ab186f4fb 100644 --- a/src/case/checkbox/check.treenode.js +++ b/src/case/checkbox/check.treenode.js @@ -7,8 +7,8 @@ BI.TreeNodeCheckbox = BI.inherit(BI.IconButton, { _defaultConfig: function () { return BI.extend( BI.TreeNodeCheckbox.superclass._defaultConfig.apply(this, arguments), { extraCls: BI.STYLE_CONSTANTS.LINK_LINE_TYPE === "solid" ? "tree-solid-collapse-icon-type1" : "tree-collapse-icon-type1", - iconWidth: 24, - iconHeight: 24 + iconWidth: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, + iconHeight: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT }); }, From 45e25f37a89fb13e57060039894a57ea70dd319d Mon Sep 17 00:00:00 2001 From: data Date: Sat, 7 May 2022 15:06:03 +0800 Subject: [PATCH 21/60] auto upgrade version to 2.0.20220507150550 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 74384cb8c..f24311602 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220507142342", + "version": "2.0.20220507150550", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 2e1322acf11fa1ee087ca1ca0f7ee23aae3bff17 Mon Sep 17 00:00:00 2001 From: zsmj Date: Mon, 9 May 2022 13:54:37 +0800 Subject: [PATCH 22/60] =?UTF-8?q?=E6=97=A0JIRA=20feat:=E5=8D=95=E9=80=89?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=A1=86=E6=94=AF=E6=8C=81=E6=B8=85=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit clear既清空value,也清空text --- .../trigger.searchtextvalue.js | 1 + .../combo/textvaluecombo/combo.textvalue.js | 21 ++++- src/case/trigger/trigger.text.js | 77 ++++++++++++++----- src/case/trigger/trigger.text.select.js | 22 ++++-- 4 files changed, 95 insertions(+), 26 deletions(-) diff --git a/src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js b/src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js index 7e84a4452..5673d3f47 100644 --- a/src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js +++ b/src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js @@ -111,4 +111,5 @@ BI.SearchTextValueTrigger.EVENT_SEARCHING = "EVENT_SEARCHING"; BI.SearchTextValueTrigger.EVENT_STOP = "EVENT_STOP"; BI.SearchTextValueTrigger.EVENT_START = "EVENT_START"; BI.SearchTextValueTrigger.EVENT_CHANGE = "EVENT_CHANGE"; +BI.SearchTextValueTrigger.EVENT_CLEAR = "EVENT_CLEAR"; BI.shortcut("bi.search_text_value_trigger", BI.SearchTextValueTrigger); diff --git a/src/case/combo/textvaluecombo/combo.textvalue.js b/src/case/combo/textvaluecombo/combo.textvalue.js index 6b9ef321b..75f2fd41f 100644 --- a/src/case/combo/textvaluecombo/combo.textvalue.js +++ b/src/case/combo/textvaluecombo/combo.textvalue.js @@ -12,6 +12,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, text: "", value: "", + allowClear: false, }); }, @@ -33,7 +34,16 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { height: o.height, text: o.text, value: o.value, - warningTitle: o.warningTitle + warningTitle: o.warningTitle, + allowClear: o.allowClear, + listeners: [ + { + eventName: BI.SelectTextTrigger.EVENT_CLEAR, + action: function () { + self._clear(); + } + } + ], }); this.popup = BI.createWidget({ type: "bi.text_value_combo_popup", @@ -62,13 +72,18 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { minHeight: 25 } }); - if(BI.isKey(o.value)) { + if (BI.isKey(o.value)) { this._checkError(o.value); } }, + _clear: function () { + this.trigger.attr("text", ""); + this.setValue(); + }, + _checkError: function (v) { - if(BI.isNull(v) || BI.isEmptyArray(v) || BI.isEmptyString(v)) { + if (BI.isNull(v) || BI.isEmptyArray(v) || BI.isEmptyString(v)) { this.trigger.options.tipType = "success"; this.element.removeClass("combo-error"); } else { diff --git a/src/case/trigger/trigger.text.js b/src/case/trigger/trigger.text.js index e8ee789df..a85506c95 100644 --- a/src/case/trigger/trigger.text.js +++ b/src/case/trigger/trigger.text.js @@ -7,25 +7,27 @@ */ BI.TextTrigger = BI.inherit(BI.Trigger, { - _defaultConfig: function () { + props: function () { var self = this; - var conf = BI.TextTrigger.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-text-trigger", + return { + baseCls: "bi-text-trigger", height: 24, textHgap: 6, textCls: "", + allowClear: false, title: function () { return self.text.getText(); } - }); + }; }, - _init: function () { - BI.TextTrigger.superclass._init.apply(this, arguments); + render: function () { var self = this, o = this.options, c = this._const; - this.text = BI.createWidget({ + var text = { type: "bi.label", + ref: function (_ref) { + self.text = _ref; + }, cls: "select-text-label" + (BI.isKey(o.textCls) ? (" " + o.textCls) : ""), textAlign: "left", height: o.height, @@ -39,32 +41,69 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { tgap: o.textTgap, bgap: o.textBgap, readonly: o.readonly - }); - this.trigerButton = BI.createWidget({ + }; + + var triggerButton = { type: "bi.trigger_icon_button", + ref: function (_ref) { + self.triggerButton = _ref; + }, width: o.triggerWidth || o.height - }); + }; - BI.createWidget({ - element: this, + return ({ type: "bi.horizontal_fill", items: [ { - el: this.text, + el: text, width: "fill" }, { - el: this.trigerButton, - width: o.triggerWidth || o.height + type: "bi.vertical_adapt", + horizontalAlign: "left", + width: o.triggerWidth || o.height, + scrollable: false, + items: [ + { + el: { + type: "bi.icon_button", + ref: function (_ref) { + self.clearBtn = _ref; + }, + cls: "close-h-font", + stopPropagation: true, + handler: function () { + self.fireEvent(BI.TextTrigger.EVENT_CLEAR); + self.clearBtn.setVisible(false); + }, + invisible: true, + }, + width: o.triggerWidth || o.height + }, { + el: triggerButton, + width: o.triggerWidth || o.height + } + ] } ] }); }, - getTextor: function() { + mounted: function () { + var self = this; + if (this.options.allowClear) { + this.element.hover(function () { + BI.isKey(self.text.getText()) && self.clearBtn.setVisible(true); + }, function () { + self.clearBtn.setVisible(false); + }); + } + }, + + getTextor: function () { return this.text; }, - setTextCls: function(cls) { + setTextCls: function (cls) { var o = this.options; var oldCls = o.textCls; o.textCls = cls; @@ -80,4 +119,6 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { this.options.tipType = v; } }); + +BI.TextTrigger.EVENT_CLEAR = "EVENT_CLEAR"; BI.shortcut("bi.text_trigger", BI.TextTrigger); diff --git a/src/case/trigger/trigger.text.select.js b/src/case/trigger/trigger.text.select.js index 8b24c1c9c..f9b8a770e 100644 --- a/src/case/trigger/trigger.text.select.js +++ b/src/case/trigger/trigger.text.select.js @@ -11,6 +11,7 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { return BI.extend(BI.SelectTextTrigger.superclass._defaultConfig.apply(this, arguments), { baseCls: "bi-select-text-trigger", height: 24, + allowClear: false, }); }, @@ -32,11 +33,20 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { textTgap: o.textTgap, textBgap: o.textBgap, tipType: o.tipType, - warningTitle: o.warningTitle + warningTitle: o.warningTitle, + allowClear: o.allowClear, + listeners: [ + { + eventName: BI.TextTrigger.EVENT_CLEAR, + action: function () { + self.fireEvent(BI.SelectTextTrigger.EVENT_CLEAR); + } + } + ] }); }, - _digest: function(vals, items){ + _digest: function (vals, items) { var o = this.options; vals = BI.isArray(vals) ? vals : [vals]; var result = []; @@ -51,12 +61,12 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { return { textCls: "", text: result.join(",") - } + }; } else { return { textCls: "bi-water-mark", text: BI.isFunction(o.text) ? o.text() : o.text - } + }; } }, @@ -70,7 +80,7 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { this.trigger.setTipType(v); }, - getTextor: function() { + getTextor: function () { return this.trigger.getTextor(); }, @@ -78,4 +88,6 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { this.options.items = items; } }); + +BI.SelectTextTrigger.EVENT_CLEAR = "EVENT_CLEAR"; BI.shortcut("bi.select_text_trigger", BI.SelectTextTrigger); From 0c2fa953cf0dc895ea5862fcfd3b1b44df0b6672 Mon Sep 17 00:00:00 2001 From: zsmj Date: Mon, 9 May 2022 13:54:59 +0800 Subject: [PATCH 23/60] update changelog --- changelog.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/changelog.md b/changelog.md index f6824f6d6..dbcca9ccd 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,19 @@ # 更新日志 + +3.0(2022-05) +- 下拉选择框支持清空 + +3.0(2022-03) +- 支持响应式 +- 全面支持Typescript +- 增加JSX支持 +- 布局组件支持更多动态特性 +- 底层API支持动画 +- 增加WebWorker支持 +- 支持路由 +- 插件支持版本控制 +- Fix数据流支持proxy版本 + 2.0(2022-01) - 提供自定义表单 From 11a0f98c421fbabd75ba248f324925c51fbeac67 Mon Sep 17 00:00:00 2001 From: Freddy Date: Sat, 7 May 2022 13:55:19 +0800 Subject: [PATCH 24/60] =?UTF-8?q?Pull=20request=20#2666:=20REPORT-70807=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B9=B4=E4=BB=BD=E6=97=A5=E6=9C=9F=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E6=B0=B4=E5=8D=B0=E5=8F=AA=E6=98=BE=E7=A4=BA=E6=97=A0?= =?UTF-8?q?=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge in VISUAL/fineui from ~FREDDY/fineui:master to master * commit '6d30eca76f8d7f8d43c6d72ef7840e67e3238009': REPORT-70807 fix:给watermark加个props REPORT-70807 fix:年份日期控件适配watermark (cherry picked from commit e60d977be0ad7e5e5ae984163ac92675188675d6) --- src/widget/year/combo.year.js | 8 ++++++-- src/widget/year/trigger.year.js | 9 +++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/widget/year/combo.year.js b/src/widget/year/combo.year.js index 62a498d54..1774ca384 100644 --- a/src/widget/year/combo.year.js +++ b/src/widget/year/combo.year.js @@ -24,7 +24,8 @@ BI.DynamicYearCombo = BI.inherit(BI.Widget, { min: o.minDate, max: o.maxDate, height: o.height - border, - value: o.value || "" + value: o.value || "", + watermark: o.watermark }); this.trigger.on(BI.DynamicYearTrigger.EVENT_KEY_DOWN, function () { if (self.combo.isViewVisible()) { @@ -211,8 +212,11 @@ BI.DynamicYearCombo = BI.inherit(BI.Widget, { isStateValid: function () { return this.trigger.isValid(); - } + }, + setWaterMark: function (v) { + this.trigger.setWaterMark(v); + } }); BI.DynamicYearCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.DynamicYearCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; diff --git a/src/widget/year/trigger.year.js b/src/widget/year/trigger.year.js index 91b80a431..fe8976b2f 100644 --- a/src/widget/year/trigger.year.js +++ b/src/widget/year/trigger.year.js @@ -10,7 +10,8 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, { extraCls: "bi-year-trigger", min: "1900-01-01", // 最小日期 max: "2099-12-31", // 最大日期 - height: 24 + height: 24, + watermark: BI.i18nText("BI-Basic_Unrestricted") }); }, @@ -35,7 +36,7 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, { }, hgap: c.hgap, vgap: c.vgap, - watermark: BI.i18nText("BI-Basic_Unrestricted"), + watermark: o.watermark, allowBlank: true, errorText: function (v) { if (BI.isPositiveInteger(v)) { @@ -188,6 +189,10 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, { getKey: function () { return this.editor.getValue() | 0; + }, + + setWaterMark: function (v) { + this.editor.setWaterMark(v); } }); BI.DynamicYearTrigger.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; From 406b42e8d20cd8838194ed9d3aa4fa3251926de5 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 9 May 2022 15:10:34 +0800 Subject: [PATCH 25/60] =?UTF-8?q?=E5=B8=83=E5=B1=80=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/wrapper/layout/layout.inline.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/wrapper/layout/layout.inline.js b/src/core/wrapper/layout/layout.inline.js index a1d889337..04b38a47a 100644 --- a/src/core/wrapper/layout/layout.inline.js +++ b/src/core/wrapper/layout/layout.inline.js @@ -40,7 +40,7 @@ BI.InlineLayout = BI.inherit(BI.Layout, { _addElement: function (i, item) { var o = this.options; var w = BI.InlineLayout.superclass._addElement.apply(this, arguments); - var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width >= 1 ? null : item.width; + var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width; if (o.columnSize.length > 0) { if (item.width >= 1 && o.columnSize[i] >= 1 && o.columnSize[i] !== item.width) { columnSize = null; From 13123d29500c86b0f377559037abd3533af043ea Mon Sep 17 00:00:00 2001 From: data Date: Mon, 9 May 2022 15:24:10 +0800 Subject: [PATCH 26/60] auto upgrade version to 2.0.20220509152356 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f24311602..2d4eb2f3d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220507150550", + "version": "2.0.20220509152356", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 310f4144f715b72f685b44a937ba04532d9c3d84 Mon Sep 17 00:00:00 2001 From: data Date: Mon, 9 May 2022 15:34:52 +0800 Subject: [PATCH 27/60] auto upgrade version to 2.0.20220509153445 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2d4eb2f3d..764120cdd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220509152356", + "version": "2.0.20220509153445", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 59b332512a06f79dbfc37b5d999ece082e05f48e Mon Sep 17 00:00:00 2001 From: zsmj Date: Mon, 9 May 2022 17:31:05 +0800 Subject: [PATCH 28/60] =?UTF-8?q?DESIGN-4103=20feat:=20=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=A1=86=E7=BB=84=E4=BB=B6=E6=94=AF=E6=8C=81clear,=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E6=A0=91=E6=94=AF=E6=8C=81=E7=BC=BA=E5=A4=B1=E6=A0=87?= =?UTF-8?q?=E7=BA=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../combo.searchtextvalue.js | 9 +++ .../combo/textvaluecombo/combo.textvalue.js | 10 ++-- src/case/trigger/trigger.text.js | 60 ++++++++----------- src/case/trigger/trigger.text.select.js | 6 ++ src/less/base/combo/combo.less | 17 +++++- src/less/base/combo/combo.textvalue.less | 14 ----- src/less/base/trigger/trigger.text.less | 11 ++++ src/less/lib/theme.less | 1 + src/widget/selecttree/selecttree.combo.js | 42 ++++++++++++- src/widget/singletree/singletree.combo.js | 42 ++++++++++++- src/widget/singletree/singletree.trigger.js | 22 ++++++- 11 files changed, 172 insertions(+), 62 deletions(-) delete mode 100644 src/less/base/combo/combo.textvalue.less create mode 100644 src/less/base/trigger/trigger.text.less diff --git a/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js b/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js index ac3fad335..cb4aa29f8 100644 --- a/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js +++ b/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js @@ -11,6 +11,7 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, { items: [], tipType: "", warningTitle: "", + allowClear: false, }, render: function () { @@ -48,6 +49,7 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, { tipType: o.tipType, warningTitle: o.warningTitle, title: o.title, + allowClear: o.allowClear, listeners: [{ eventName: BI.SearchTextValueTrigger.EVENT_CHANGE, action: function () { @@ -55,6 +57,13 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, { self.combo.hideView(); self.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE); } + }, { + eventName: BI.SearchTextValueTrigger.EVENT_CLEAR, + action: function () { + self.setValue(); + self.combo.hideView(); + self.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE); + } }] }, popup: { diff --git a/src/case/combo/textvaluecombo/combo.textvalue.js b/src/case/combo/textvaluecombo/combo.textvalue.js index 75f2fd41f..69075f739 100644 --- a/src/case/combo/textvaluecombo/combo.textvalue.js +++ b/src/case/combo/textvaluecombo/combo.textvalue.js @@ -78,14 +78,14 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { }, _clear: function () { - this.trigger.attr("text", ""); this.setValue(); }, _checkError: function (v) { if (BI.isNull(v) || BI.isEmptyArray(v) || BI.isEmptyString(v)) { this.trigger.options.tipType = "success"; - this.element.removeClass("combo-error"); + this.element.removeClass("error"); + this.trigger.element.removeClass("error"); } else { v = BI.isArray(v) ? v : [v]; var result = BI.find(this.options.items, function (idx, item) { @@ -93,10 +93,12 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { }); if (BI.isNull(result)) { this.trigger.setTipType("warning"); - this.element.removeClass("combo-error").addClass("combo-error"); + this.element.addClass("error"); + this.trigger.element.addClass("error"); } else { this.trigger.setTipType("success"); - this.element.removeClass("combo-error"); + this.element.removeClass("error"); + this.trigger.element.removeClass("error"); } } }, diff --git a/src/case/trigger/trigger.text.js b/src/case/trigger/trigger.text.js index a85506c95..b9a51cc6f 100644 --- a/src/case/trigger/trigger.text.js +++ b/src/case/trigger/trigger.text.js @@ -53,52 +53,39 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { return ({ type: "bi.horizontal_fill", + columnSize: ["fill", o.triggerWidth || o.height], items: [ { el: text, width: "fill" }, { - type: "bi.vertical_adapt", - horizontalAlign: "left", - width: o.triggerWidth || o.height, - scrollable: false, - items: [ - { - el: { - type: "bi.icon_button", - ref: function (_ref) { - self.clearBtn = _ref; + el: o.allowClear ? { + type: "bi.vertical_adapt", + horizontalAlign: "left", + scrollable: false, + items: [ + { + el: { + type: "bi.icon_button", + ref: function (_ref) { + self.clearBtn = _ref; + }, + cls: "close-h-font " + (o.allowClear ? "clear-button" : ""), + stopPropagation: true, + handler: function () { + self.fireEvent(BI.TextTrigger.EVENT_CLEAR); + }, }, - cls: "close-h-font", - stopPropagation: true, - handler: function () { - self.fireEvent(BI.TextTrigger.EVENT_CLEAR); - self.clearBtn.setVisible(false); - }, - invisible: true, - }, - width: o.triggerWidth || o.height - }, { - el: triggerButton, - width: o.triggerWidth || o.height - } - ] + }, { + el: triggerButton, + } + ] + } : triggerButton, } ] }); }, - mounted: function () { - var self = this; - if (this.options.allowClear) { - this.element.hover(function () { - BI.isKey(self.text.getText()) && self.clearBtn.setVisible(true); - }, function () { - self.clearBtn.setVisible(false); - }); - } - }, - getTextor: function () { return this.text; }, @@ -112,6 +99,9 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { setText: function (text) { this.text.setText(text); + if (this.options.allowClear) { + this.clearBtn.setVisible(BI.isNotEmptyString(text)); + } }, setTipType: function (v) { diff --git a/src/case/trigger/trigger.text.select.js b/src/case/trigger/trigger.text.select.js index f9b8a770e..a63fc4bb0 100644 --- a/src/case/trigger/trigger.text.select.js +++ b/src/case/trigger/trigger.text.select.js @@ -39,6 +39,7 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { { eventName: BI.TextTrigger.EVENT_CLEAR, action: function () { + self.setText(""); self.fireEvent(BI.SelectTextTrigger.EVENT_CLEAR); } } @@ -70,6 +71,11 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { } }, + setText: function (text) { + this.options.text = text; + this.trigger.setText(text); + }, + setValue: function (vals) { var formatValue = this._digest(vals, this.options.items); this.trigger.setTextCls(formatValue.textCls); diff --git a/src/less/base/combo/combo.less b/src/less/base/combo/combo.less index 9725ac58a..f96f4b008 100644 --- a/src/less/base/combo/combo.less +++ b/src/less/base/combo/combo.less @@ -1,19 +1,22 @@ @import "../../index.less"; + @val: transform .3s ease; .bi-combo { & > .bi-trigger { - & .bi-trigger-icon-button{ + & .bi-trigger-icon-button { & .x-icon { .rotate(0deg); .transition(@val); } } } + &.bi-combo-popup { display: block !important; visibility: visible !important; + & > .bi-trigger { - & .bi-trigger-icon-button{ + & .bi-trigger-icon-button { & .x-icon { .rotate(180deg); .transition(@val); @@ -21,11 +24,13 @@ } } } + &.bi-combo-popup, &.bi-combo-hover, &:hover { &.bi-border, &.bi-border-bottom { border-color: @color-bi-border-hover-combo; } } + &.disabled { &.bi-combo-hover, &:hover { &.bi-border, &.bi-border-bottom { @@ -33,6 +38,14 @@ } } } + + &.error { + &.bi-combo-hover, &:hover { + &.bi-border, &.bi-border-bottom { + border-color: @border-color-negative; + } + } + } } .bi-theme-dark { diff --git a/src/less/base/combo/combo.textvalue.less b/src/less/base/combo/combo.textvalue.less deleted file mode 100644 index 1feec1972..000000000 --- a/src/less/base/combo/combo.textvalue.less +++ /dev/null @@ -1,14 +0,0 @@ -@import "../../index.less"; - -.bi-text-value-combo { - &.combo-error { - & .bi-select-text-trigger { - & .select-text-label { - color: @color-bi-text-error-hover-text-value-combo; - } - } - &.bi-border, &.bi-border-bottom { - border-color: @border-color-negative; - } - } -} \ No newline at end of file diff --git a/src/less/base/trigger/trigger.text.less b/src/less/base/trigger/trigger.text.less new file mode 100644 index 000000000..9e2040512 --- /dev/null +++ b/src/less/base/trigger/trigger.text.less @@ -0,0 +1,11 @@ +@import "../../index.less"; + +.bi-text-trigger { + &.error .select-text-label { + color: @color-bi-text-error-text-trigger; + } + + &:where(:not(&:hover)) .clear-button { + display: none; + } +} diff --git a/src/less/lib/theme.less b/src/less/lib/theme.less index db42c9ef4..3c85b8031 100644 --- a/src/less/lib/theme.less +++ b/src/less/lib/theme.less @@ -179,6 +179,7 @@ @color-bi-border-hover-text-value-down-list-combo: @color-bi-border-highlight; @color-bi-border-hover-text-value-check-combo: @color-bi-border-highlight; @color-bi-text-error-hover-text-value-combo: @color-bi-text-failure; +@color-bi-text-error-text-trigger: @color-bi-text-failure; @color-bi-text-error-hover-text-value-icon-combo: @color-bi-text-failure; @color-bi-text-error-hover-search-text-value-combo: @color-bi-text-failure; @color-bi-background-bubble-combo-triangle: @color-bi-background-default; diff --git a/src/widget/selecttree/selecttree.combo.js b/src/widget/selecttree/selecttree.combo.js index 98c542686..c6aca0c62 100644 --- a/src/widget/selecttree/selecttree.combo.js +++ b/src/widget/selecttree/selecttree.combo.js @@ -11,6 +11,7 @@ BI.SelectTreeCombo = BI.inherit(BI.Widget, { text: "", items: [], value: "", + allowClear: false, }); }, @@ -25,7 +26,13 @@ BI.SelectTreeCombo = BI.inherit(BI.Widget, { text: o.text, height: o.height, items: o.items, - value: o.value + value: o.value, + allowClear: o.allowClear, + warningTitle: o.warningTitle, + }); + + this.trigger.on(BI.SingleTreeTrigger.EVENT_CLEAR, function () { + self._clear(); }); this.popup = BI.createWidget({ @@ -53,12 +60,43 @@ BI.SelectTreeCombo = BI.inherit(BI.Widget, { self.setValue(self.popup.getValue()); self.combo.hideView(); }); + + if (BI.isKey(o.value)) { + this._checkError(o.value); + } + }, + + _checkError: function (v) { + if (BI.isNull(v) || BI.isEmptyArray(v) || BI.isEmptyString(v)) { + this.trigger.options.tipType = "success"; + this.trigger.element.removeClass("error"); + this.element.removeClass("error"); + } else { + v = BI.isArray(v) ? v : [v]; + var result = BI.find(this.options.items, function (idx, item) { + return BI.contains(v, item.value); + }); + if (BI.isNull(result)) { + this.trigger.setTipType("warning"); + this.element.removeClass("error").addClass("error"); + this.trigger.element.removeClass("error").addClass("error"); + } else { + this.trigger.setTipType("success"); + this.trigger.element.removeClass("error"); + this.element.removeClass("error"); + } + } + }, + + _clear: function () { + this.setValue([]); }, setValue: function (v) { v = BI.isArray(v) ? v : [v]; this.trigger.setValue(v); this.popup.setValue(v); + this._checkError(v); }, getValue: function () { @@ -71,4 +109,4 @@ BI.SelectTreeCombo = BI.inherit(BI.Widget, { }); -BI.shortcut("bi.select_tree_combo", BI.SelectTreeCombo); \ No newline at end of file +BI.shortcut("bi.select_tree_combo", BI.SelectTreeCombo); diff --git a/src/widget/singletree/singletree.combo.js b/src/widget/singletree/singletree.combo.js index ce6d255d4..32d39d338 100644 --- a/src/widget/singletree/singletree.combo.js +++ b/src/widget/singletree/singletree.combo.js @@ -12,6 +12,7 @@ BI.SingleTreeCombo = BI.inherit(BI.Widget, { text: "", items: [], value: "", + allowClear: false, }); }, @@ -26,9 +27,15 @@ BI.SingleTreeCombo = BI.inherit(BI.Widget, { text: o.text, height: o.height, items: o.items, - value: o.value + value: o.value, + allowClear: o.allowClear, + warningTitle: o.warningTitle, }, o.trigger)); + this.trigger.on(BI.SingleTreeTrigger.EVENT_CLEAR, function () { + self._clear(); + }); + this.popup = BI.createWidget({ type: "bi.single_level_tree", items: o.items, @@ -58,6 +65,36 @@ BI.SingleTreeCombo = BI.inherit(BI.Widget, { self.combo.hideView(); self.fireEvent(BI.SingleTreeCombo.EVENT_CHANGE); }); + + if (BI.isKey(o.value)) { + this._checkError(o.value); + } + }, + + _checkError: function (v) { + if (BI.isNull(v) || BI.isEmptyArray(v) || BI.isEmptyString(v)) { + this.trigger.options.tipType = "success"; + this.trigger.element.removeClass("error"); + this.element.removeClass("error"); + } else { + v = BI.isArray(v) ? v : [v]; + var result = BI.find(this.options.items, function (idx, item) { + return BI.contains(v, item.value); + }); + if (BI.isNull(result)) { + this.trigger.setTipType("warning"); + this.element.removeClass("error").addClass("error"); + this.trigger.element.removeClass("error").addClass("error"); + } else { + this.trigger.setTipType("success"); + this.trigger.element.removeClass("error"); + this.element.removeClass("error"); + } + } + }, + + _clear: function () { + this.setValue([]); }, populate: function (items) { @@ -68,6 +105,7 @@ BI.SingleTreeCombo = BI.inherit(BI.Widget, { v = BI.isArray(v) ? v : [v]; this.trigger.setValue(v); this.popup.setValue(v); + this._checkError(v); }, getValue: function () { @@ -77,4 +115,4 @@ BI.SingleTreeCombo = BI.inherit(BI.Widget, { BI.SingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.SingleTreeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; -BI.shortcut("bi.single_tree_combo", BI.SingleTreeCombo); \ No newline at end of file +BI.shortcut("bi.single_tree_combo", BI.SingleTreeCombo); diff --git a/src/widget/singletree/singletree.trigger.js b/src/widget/singletree/singletree.trigger.js index 91183c033..d8dd3f69c 100644 --- a/src/widget/singletree/singletree.trigger.js +++ b/src/widget/singletree/singletree.trigger.js @@ -11,7 +11,8 @@ BI.SingleTreeTrigger = BI.inherit(BI.Trigger, { height: 24, text: "", items: [], - value: "" + value: "", + allowClear: false, }); }, @@ -26,7 +27,17 @@ BI.SingleTreeTrigger = BI.inherit(BI.Trigger, { text: o.text, items: o.items, height: o.height, - value: o.value + warningTitle: o.warningTitle, + value: o.value, + allowClear: o.allowClear, + listeners: [ + { + eventName: BI.SelectTextTrigger.EVENT_CLEAR, + action: function () { + self.fireEvent(BI.SingleTreeTrigger.EVENT_CLEAR); + } + } + ] }); }, @@ -47,11 +58,15 @@ BI.SingleTreeTrigger = BI.inherit(BI.Trigger, { this._checkTitle(); }, + setTipType: function (v) { + this.trigger.setTipType(v); + }, + getValue: function () { return this.options.value || []; }, - getTextor: function() { + getTextor: function () { return this.trigger.getTextor(); }, @@ -61,4 +76,5 @@ BI.SingleTreeTrigger = BI.inherit(BI.Trigger, { }); +BI.SingleTreeTrigger.EVENT_CLEAR = "EVENT_CLEAR"; BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger); From 307bc13b00ed15e0d0178aa3ebf91285ab297d89 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 9 May 2022 22:25:57 +0800 Subject: [PATCH 29/60] feature: checker --- src/base/single/input/input.js | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/base/single/input/input.js b/src/base/single/input/input.js index 41e1ca0de..145129dc2 100644 --- a/src/base/single/input/input.js +++ b/src/base/single/input/input.js @@ -207,13 +207,24 @@ BI.Input = BI.inherit(BI.Single, { }, _checkValidationOnValueChange: function () { - var o = this.options; + var self = this, o = this.options; var v = this.getValue(); - this.setValid( - (o.allowBlank === true && BI.trim(v) == "") || ( - BI.isNotEmptyString(BI.trim(v)) && o.validationChecker.apply(this, [BI.trim(v)]) !== false - ) - ); + if (o.allowBlank === true && BI.trim(v) == "") { + this.setValid(true); + return; + } + if (BI.trim(v) == "") { + this.setValid(false); + return; + } + var checker = o.validationChecker.apply(this, [BI.trim(v)]); + if (checker instanceof Promise) { + checker.then(function (validate) { + self.setValid(validate !== false); + }) + } else { + this.setValid(checker !== false); + } }, focus: function () { From fff0cc07dfd95110888086ff41d55e210b9b30f1 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 9 May 2022 23:54:35 +0800 Subject: [PATCH 30/60] update --- src/base/single/input/input.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/base/single/input/input.js b/src/base/single/input/input.js index 145129dc2..e868a5747 100644 --- a/src/base/single/input/input.js +++ b/src/base/single/input/input.js @@ -206,24 +206,28 @@ BI.Input = BI.inherit(BI.Single, { this._lastValue = this.getValue(); }, - _checkValidationOnValueChange: function () { + _checkValidationOnValueChange: function (callback) { var self = this, o = this.options; var v = this.getValue(); if (o.allowBlank === true && BI.trim(v) == "") { this.setValid(true); + callback && callback(); return; } if (BI.trim(v) == "") { this.setValid(false); + callback && callback(); return; } var checker = o.validationChecker.apply(this, [BI.trim(v)]); if (checker instanceof Promise) { checker.then(function (validate) { self.setValid(validate !== false); + callback && callback(); }) } else { this.setValid(checker !== false); + callback && callback(); } }, @@ -256,14 +260,16 @@ BI.Input = BI.inherit(BI.Single, { }, setValue: function (textValue) { + var self = this; this.element.val(textValue); - BI.nextTick(BI.bind(function () { - this._checkValidationOnValueChange(); - this._defaultState(); - if (this.isValid()) { - this._lastValidValue = this._lastSubmitValue = this.getValue(); - } - }, this)); + BI.nextTick(function () { + self._checkValidationOnValueChange(function () { + self._defaultState(); + if (self.isValid()) { + self._lastValidValue = self._lastSubmitValue = self.getValue(); + } + }); + }); }, getValue: function () { From 3ca37b200491795dcf173e0e8d3f442b37d51206 Mon Sep 17 00:00:00 2001 From: data Date: Tue, 10 May 2022 09:35:16 +0800 Subject: [PATCH 31/60] auto upgrade version to 2.0.20220510093508 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 764120cdd..591cbef84 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220509153445", + "version": "2.0.20220510093508", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 5ebb3dfe201f4d15278b58a849ae318b9c15fe72 Mon Sep 17 00:00:00 2001 From: data Date: Tue, 10 May 2022 10:35:30 +0800 Subject: [PATCH 32/60] auto upgrade version to 2.0.20220510103520 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 591cbef84..f960dc0de 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220510093508", + "version": "2.0.20220510103520", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 882817a6d484d39975968c5be86c724705c0a312 Mon Sep 17 00:00:00 2001 From: data Date: Tue, 10 May 2022 13:54:42 +0800 Subject: [PATCH 33/60] auto upgrade version to 2.0.20220510135434 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f960dc0de..557ce0550 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220510103520", + "version": "2.0.20220510135434", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 2b81ffd4031edc7af999a010fd2c1768ad1d3f62 Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 10 May 2022 16:21:27 +0800 Subject: [PATCH 34/60] =?UTF-8?q?DESIGN-4103=20feat:=20=E9=87=8D=E5=86=99?= =?UTF-8?q?=E4=B8=80=E4=B8=8B=E4=B8=8B=E6=8B=89=E6=A0=91=E7=9A=84=E5=B8=83?= =?UTF-8?q?=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../multilayerselecttree.combo.js | 65 +++++-------------- .../multilayerselecttree.trigger.js | 61 +++++++---------- .../multilayersingletree.combo.js | 22 +++---- .../multilayersingletree.trigger.js | 59 +++++++---------- src/widget/singletree/singletree.trigger.js | 1 + 5 files changed, 76 insertions(+), 132 deletions(-) diff --git a/src/widget/multilayerselecttree/multilayerselecttree.combo.js b/src/widget/multilayerselecttree/multilayerselecttree.combo.js index 6365ef484..1613e9fbf 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.combo.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.combo.js @@ -16,59 +16,21 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { allowEdit: false, allowSearchValue: false, allowInsertValue: false, - isNeedAdjustWidth: true + isNeedAdjustWidth: true, }); }, _init: function () { var o = this.options; - if (this._shouldWrapper()) { - o.height -= 2; - BI.isNumeric(o.width) && (o.width -= 2); - } + BI.isNumeric(o.width) && (o.width -= 2); + BI.isNumeric(o.height) && (o.height -= 2); BI.MultiLayerSelectTreeCombo.superclass._init.apply(this, arguments); }, render: function () { var self = this, o = this.options; - var combo = (o.itemsCreator === BI.emptyFn) ? this._getSyncConfig() : this._getAsyncConfig(); - - return this._shouldWrapper() ? combo : { - type: "bi.absolute", - items: [{ - el: combo, - left: 0, - right: 0, - top: 0, - bottom: 0 - }, { - el: { - type: "bi.trigger_icon_button", - cls: "trigger-icon-button", - ref: function (_ref) { - self.triggerBtn = _ref; - }, - width: o.height, - height: o.height, - handler: function () { - if (self.combo.isViewVisible()) { - self.combo.hideView(); - } else { - self.combo.showView(); - } - } - }, - right: 0, - bottom: 0, - top: 0 - }] - }; - }, - - _shouldWrapper: function () { - var o = this.options; - return !o.allowEdit && o.itemsCreator === BI.emptyFn; + return (o.itemsCreator === BI.emptyFn) ? this._getSyncConfig() : this._getAsyncConfig(); }, _getBaseConfig: function () { @@ -122,7 +84,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { }; }, - _getSearchConfig: function() { + _getSearchConfig: function () { var self = this, o = this.options; return { el: { @@ -139,7 +101,8 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { itemsCreator: o.itemsCreator, valueFormatter: o.valueFormatter, watermark: o.watermark, - height: o.height - (o.simple ? 1 : 2), + // height: o.height - (o.simple ? 1 : 2), + height: o.height, text: o.text, value: o.value, tipType: o.tipType, @@ -184,7 +147,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { // IE11下,popover(position: fixed)下放置下拉控件(position: fixed), 滚动的时候会异常卡顿 // 通过container参数将popup放置于popover之外解决此问题, 其他下拉控件由于元素少或者有分页,所以 // 卡顿不明显, 先在此做尝试, 并在FineUI特殊处理待解决文档中标记跟踪 - return (o.container && self.trigger.getSearcher().isSearching() && self.trigger.getSearcher().getView().element.find(e.target).length > 0) ? false : self.triggerBtn.element.find(e.target).length === 0; + return !(o.container && self.trigger.getSearcher().isSearching() && self.trigger.getSearcher().getView().element.find(e.target).length > 0); }, listeners: [{ @@ -198,7 +161,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_BEFORE_POPUPVIEW); } }] - } + }; }, _getSyncConfig: function () { @@ -207,13 +170,15 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { return BI.extend(baseConfig, o.allowEdit ? this._getSearchConfig() : { el: { type: "bi.single_tree_trigger", - ref: function(_ref) { + ref: function (_ref) { self.textTrigger = _ref; }, text: o.text, height: o.height, items: o.items, - value: o.value + value: o.value, + tipType: o.tipType, + warningTitle: o.warningTitle, } }); }, @@ -236,6 +201,10 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { return this.trigger ? this.trigger.getSearcher() : this.textTrigger.getTextor(); }, + clear: function () { + // do some work + }, + populate: function (items) { this.combo.populate(items); }, diff --git a/src/widget/multilayerselecttree/multilayerselecttree.trigger.js b/src/widget/multilayerselecttree/multilayerselecttree.trigger.js index 4b66b58f7..11789b5ac 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.trigger.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.trigger.js @@ -3,7 +3,7 @@ */ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { - props: function() { + props: function () { return { extraCls: "bi-multi-layer-select-tree-trigger", height: 24, @@ -16,11 +16,12 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { render: function () { var self = this, o = this.options; - if(o.itemsCreator === BI.emptyFn) { + if (o.itemsCreator === BI.emptyFn) { this._initData(); } - var content = { - type: "bi.htape", + + return { + type: "bi.horizontal_fill", items: [ { el: { @@ -86,7 +87,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { }, onSearch: function (obj, callback) { var keyword = obj.keyword; - if(o.itemsCreator === BI.emptyFn) { + if (o.itemsCreator === BI.emptyFn) { callback(self._getSearchItems(keyword)); o.allowInsertValue && self.popup.setKeyword(keyword); } else { @@ -99,51 +100,37 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE); } }] - } + }, + width: "fill", }, { el: { - type: "bi.layout", - width: 24 + type: "bi.trigger_icon_button", + cls: "trigger-icon-button", + ref: function (_ref) { + self.triggerBtn = _ref; + }, + width: 24, }, - width: 24 + width: 24, } ] }; - - return o.allowEdit ? content : { - type: "bi.absolute", - items: [{ - el: content, - left: 0, - right: 0, - top: 0, - bottom: 0 - }, { - el: { - type: "bi.layout" - }, - left: 0, - right: 24, - top: 0, - bottom: 0 - }] - }; }, - _initData: function() { + _initData: function () { var o = this.options; this.tree = new BI.Tree(); this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); this.tree.initTree(this.nodes); }, - _getSearchItems: function(keyword) { + _getSearchItems: function (keyword) { var self = this, o = this.options; // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 var items = []; this.tree.traverse(function (node) { var find = BI.Func.getSearchResult(self.tree.isRoot(node) ? [] : BI.concat([node.text], (o.allowSearchValue ? [node.value] : [])), keyword); - if(find.find.length > 0 || find.match.length > 0) { + if (find.find.length > 0 || find.match.length > 0) { items.push(node); return true; } @@ -151,7 +138,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { return this._fillTreeStructure4Search(items, "id"); }, - _createJson: function(node, open) { + _createJson: function (node, open) { return { id: node.id, pId: node.pId, @@ -159,10 +146,10 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { value: node.value, isParent: BI.isNotEmptyArray(node.children), open: open - } + }; }, - _getChildren: function(node) { + _getChildren: function (node) { var self = this; node.children = node.children || []; var nodes = []; @@ -179,7 +166,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { var result = []; var queue = []; BI.each(leaves, function (idx, node) { - queue.push({pId: node.pId}); + queue.push({ pId: node.pId }); result.push(node); result = result.concat(self._getChildren(node)); }); @@ -188,7 +175,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id"); if (pNode != null) { pNode.open = true; - queue.push({pId: pNode.pId}); + queue.push({ pId: pNode.pId }); result.push(pNode); } } @@ -259,4 +246,4 @@ BI.MultiLayerSelectTreeTrigger.EVENT_STOP = "EVENT_STOP"; BI.MultiLayerSelectTreeTrigger.EVENT_START = "EVENT_START"; BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM"; -BI.shortcut("bi.multilayer_select_tree_trigger", BI.MultiLayerSelectTreeTrigger); \ No newline at end of file +BI.shortcut("bi.multilayer_select_tree_trigger", BI.MultiLayerSelectTreeTrigger); diff --git a/src/widget/multilayersingletree/multilayersingletree.combo.js b/src/widget/multilayersingletree/multilayersingletree.combo.js index 779e645bf..d0e11182f 100644 --- a/src/widget/multilayersingletree/multilayersingletree.combo.js +++ b/src/widget/multilayersingletree/multilayersingletree.combo.js @@ -25,17 +25,15 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { _init: function () { var o = this.options; - if (this._shouldWrapper()) { - o.height -= 2; - BI.isNumeric(o.width) && (o.width -= 2); - } + BI.isNumeric(o.width) && (o.width -= 2); + BI.isNumeric(o.height) && (o.height -= 2); BI.MultiLayerSingleTreeCombo.superclass._init.apply(this, arguments); }, render: function () { var self = this, o = this.options; - var combo = (o.itemsCreator === BI.emptyFn) ? this._getSyncConfig() : this._getAsyncConfig(); + return (o.itemsCreator === BI.emptyFn) ? this._getSyncConfig() : this._getAsyncConfig(); return this._shouldWrapper() ? combo : { type: "bi.absolute", @@ -125,7 +123,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { }; }, - _getSearchConfig: function() { + _getSearchConfig: function () { var self = this, o = this.options; return { el: { @@ -142,7 +140,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { items: o.items, itemsCreator: o.itemsCreator, valueFormatter: o.valueFormatter, - height: o.height - (o.simple ? 1 : 2), + height: o.height, text: o.text, value: o.value, tipType: o.tipType, @@ -186,7 +184,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { // IE11下,popover(position: fixed)下放置下拉控件(position: fixed), 滚动的时候会异常卡顿 // 通过container参数将popup放置于popover之外解决此问题, 其他下拉控件由于元素少或者有分页,所以 // 卡顿不明显, 先在此做尝试, 并在FineUI特殊处理待解决文档中标记跟踪 - return (o.container && self.trigger.getSearcher().isSearching() && self.trigger.getSearcher().getView().element.find(e.target).length > 0) ? false : self.triggerBtn.element.find(e.target).length === 0 + return !(o.container && self.trigger.getSearcher().isSearching() && self.trigger.getSearcher().getView().element.find(e.target).length > 0); }, listeners: [{ eventName: BI.Combo.EVENT_AFTER_HIDEVIEW, @@ -199,7 +197,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_BEFORE_POPUPVIEW); } }] - } + }; }, _getSyncConfig: function () { @@ -208,13 +206,15 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { return BI.extend(baseConfig, o.allowEdit ? this._getSearchConfig() : { el: { type: "bi.single_tree_trigger", - ref: function(_ref) { + ref: function (_ref) { self.textTrigger = _ref; }, text: o.text, height: o.height, items: o.items, - value: o.value + value: o.value, + tipType: o.tipType, + warningTitle: o.warningTitle, } }); }, diff --git a/src/widget/multilayersingletree/multilayersingletree.trigger.js b/src/widget/multilayersingletree/multilayersingletree.trigger.js index 75a515129..8c58b0c8c 100644 --- a/src/widget/multilayersingletree/multilayersingletree.trigger.js +++ b/src/widget/multilayersingletree/multilayersingletree.trigger.js @@ -3,7 +3,7 @@ */ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { - props: function() { + props: function () { return { extraCls: "bi-multi-layer-single-tree-trigger", height: 24, @@ -16,11 +16,12 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { render: function () { var self = this, o = this.options; - if(o.itemsCreator === BI.emptyFn) { + if (o.itemsCreator === BI.emptyFn) { this._initData(); } - var content = { - type: "bi.htape", + + return { + type: "bi.horizontal_fill", items: [ { el: { @@ -86,7 +87,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { }, onSearch: function (obj, callback) { var keyword = obj.keyword; - if(o.itemsCreator === BI.emptyFn) { + if (o.itemsCreator === BI.emptyFn) { callback(self._getSearchItems(keyword)); o.allowInsertValue && self.popup.setKeyword(keyword); } else { @@ -99,51 +100,37 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE); } }] - } + }, + width: "fill", }, { el: { - type: "bi.layout", - width: 24 + type: "bi.trigger_icon_button", + cls: "trigger-icon-button", + ref: function (_ref) { + self.triggerBtn = _ref; + }, + width: 24, }, width: 24 } ] }; - - return o.allowEdit ? content : { - type: "bi.absolute", - items: [{ - el: content, - left: 0, - right: 0, - top: 0, - bottom: 0 - }, { - el: { - type: "bi.layout" - }, - left: 0, - right: 24, - top: 0, - bottom: 0 - }] - }; }, - _initData: function() { + _initData: function () { var o = this.options; this.tree = new BI.Tree(); this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); this.tree.initTree(this.nodes); }, - _getSearchItems: function(keyword) { + _getSearchItems: function (keyword) { var self = this, o = this.options; // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 var items = []; this.tree.traverse(function (node) { var find = BI.Func.getSearchResult(self.tree.isRoot(node) ? [] : BI.concat([node.text], (o.allowSearchValue ? [node.value] : [])), keyword); - if(find.find.length > 0 || find.match.length > 0) { + if (find.find.length > 0 || find.match.length > 0) { items.push(node); return true; } @@ -151,7 +138,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { return this._fillTreeStructure4Search(items, "id"); }, - _createJson: function(node, open) { + _createJson: function (node, open) { return { id: node.id, pId: node.pId, @@ -159,10 +146,10 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { value: node.value, isParent: BI.isNotEmptyArray(node.children), open: open - } + }; }, - _getChildren: function(node) { + _getChildren: function (node) { var self = this; node.children = node.children || []; var nodes = []; @@ -179,7 +166,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { var result = []; var queue = []; BI.each(leaves, function (idx, node) { - queue.push({pId: node.pId}); + queue.push({ pId: node.pId }); result.push(node); result = result.concat(self._getChildren(node)); }); @@ -188,7 +175,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id"); if (pNode != null) { pNode.open = true; - queue.push({pId: pNode.pId}); + queue.push({ pId: pNode.pId }); result.push(pNode); } } @@ -260,4 +247,4 @@ BI.MultiLayerSingleTreeTrigger.EVENT_STOP = "EVENT_STOP"; BI.MultiLayerSingleTreeTrigger.EVENT_START = "EVENT_START"; BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM"; -BI.shortcut("bi.multilayer_single_tree_trigger", BI.MultiLayerSingleTreeTrigger); \ No newline at end of file +BI.shortcut("bi.multilayer_single_tree_trigger", BI.MultiLayerSingleTreeTrigger); diff --git a/src/widget/singletree/singletree.trigger.js b/src/widget/singletree/singletree.trigger.js index d8dd3f69c..2df5a259c 100644 --- a/src/widget/singletree/singletree.trigger.js +++ b/src/widget/singletree/singletree.trigger.js @@ -28,6 +28,7 @@ BI.SingleTreeTrigger = BI.inherit(BI.Trigger, { items: o.items, height: o.height, warningTitle: o.warningTitle, + tipType: o.tipType, value: o.value, allowClear: o.allowClear, listeners: [ From c22d517f5d36c6a373ac9dd594ec89a8a4c8f1c9 Mon Sep 17 00:00:00 2001 From: data Date: Tue, 10 May 2022 23:14:36 +0800 Subject: [PATCH 35/60] auto upgrade version to 2.0.20220510231427 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 557ce0550..c94be22b7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220510135434", + "version": "2.0.20220510231427", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 8fa0c051f10cd8e03a3d21931f9f051f50286727 Mon Sep 17 00:00:00 2001 From: zsmj Date: Wed, 11 May 2022 10:56:07 +0800 Subject: [PATCH 36/60] =?UTF-8?q?DESIGN-4103=20feat:=20=E5=A4=9A=E5=B1=82?= =?UTF-8?q?=E7=BA=A7=E4=B8=8B=E6=8B=89=E6=A0=91=E6=8F=90=E4=BE=9B=E4=B8=80?= =?UTF-8?q?=E5=A5=97=E7=94=B1=E5=BC=80=E5=8F=91=E8=80=85=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E7=9A=84=E6=A0=87=E7=BA=A2=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 由于多层级下拉树有同步和异步方式,无法想单选下拉框一样根据items自动判断缺失,所以交给外部手动控制了 --- src/case/trigger/trigger.text.select.js | 1 + src/less/base/combo/combo.less | 22 ++++++++++++++ .../multilayerselecttree.combo.less | 30 +++++++++++-------- .../multilayersingletree.combo.less | 29 ++++++++++-------- .../multilayerselecttree.combo.js | 15 +++++++++- .../multilayersingletree.combo.js | 14 ++++++++- src/widget/singletree/singletree.trigger.js | 1 + .../multilayerselecttree.combo.ts | 2 ++ .../multilayersingletree.combo.ts | 2 ++ 9 files changed, 88 insertions(+), 28 deletions(-) diff --git a/src/case/trigger/trigger.text.select.js b/src/case/trigger/trigger.text.select.js index a63fc4bb0..5461292c1 100644 --- a/src/case/trigger/trigger.text.select.js +++ b/src/case/trigger/trigger.text.select.js @@ -83,6 +83,7 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { }, setTipType: function (v) { + this.options.tipType = v; this.trigger.setTipType(v); }, diff --git a/src/less/base/combo/combo.less b/src/less/base/combo/combo.less index f96f4b008..206953d4b 100644 --- a/src/less/base/combo/combo.less +++ b/src/less/base/combo/combo.less @@ -46,6 +46,28 @@ } } } + + + // 将来统一变成combo的特性 + //&.status-error { + // &.bi-border, &.bi-border-bottom { + // border-color: @border-color-negative; + // } + // + // .bi-trigger .select-text-label { + // color: @color-bi-text-error-text-trigger; + // } + //} + // + //&.status-warning { + // &.bi-border, &.bi-border-bottom { + // border-color: @border-color-warning; + // } + // + // .bi-trigger .select-text-label { + // color: @font-color-warning; + // } + //} } .bi-theme-dark { diff --git a/src/less/widget/multilayerselecttree/multilayerselecttree.combo.less b/src/less/widget/multilayerselecttree/multilayerselecttree.combo.less index ca3a79fbc..4ac60cf49 100644 --- a/src/less/widget/multilayerselecttree/multilayerselecttree.combo.less +++ b/src/less/widget/multilayerselecttree/multilayerselecttree.combo.less @@ -1,20 +1,24 @@ @import "../../index.less"; -@val: transform .3s ease; + .bi-multilayer-select-tree-combo { - & .trigger-icon-button{ - font-size: @font-size-16; - } - // 此combo的trigger_button是absolute上去的,与bi-combo在同一层级,独立写一下 - & .bi-combo.bi-combo-popup + .bi-trigger-icon-button { - & .x-icon { - .rotate(180deg); - .transition(@val); + + &.status-error { + &.bi-border, &.bi-border-bottom { + border-color: @border-color-negative; + } + + .bi-trigger .select-text-label { + color: @color-bi-text-error-text-trigger; } } - & .bi-combo + .bi-trigger-icon-button { - & .x-icon { - .rotate(0deg); - .transition(@val); + + &.status-warning { + &.bi-border, &.bi-border-bottom { + border-color: @border-color-warning; + } + + .bi-trigger .select-text-label { + color: @font-color-warning; } } } diff --git a/src/less/widget/multilayersingletree/multilayersingletree.combo.less b/src/less/widget/multilayersingletree/multilayersingletree.combo.less index af046bc74..6a1390230 100644 --- a/src/less/widget/multilayersingletree/multilayersingletree.combo.less +++ b/src/less/widget/multilayersingletree/multilayersingletree.combo.less @@ -1,20 +1,23 @@ @import "../../index.less"; -@val: transform .3s ease; + .bi-multilayer-single-tree-combo { - & .trigger-icon-button{ - font-size: @font-size-16; - } - // 此combo的trigger_button是absolute上去的,与bi-combo在同一层级,独立写一下 - & .bi-combo.bi-combo-popup + .bi-trigger-icon-button { - & .x-icon { - .rotate(180deg); - .transition(@val); + &.status-error { + &.bi-border, &.bi-border-bottom { + border-color: @border-color-negative; + } + + .bi-trigger .select-text-label { + color: @color-bi-text-error-text-trigger; } } - & .bi-combo + .bi-trigger-icon-button { - & .x-icon { - .rotate(0deg); - .transition(@val); + + &.status-warning { + &.bi-border, &.bi-border-bottom { + border-color: @border-color-warning; + } + + .bi-trigger .select-text-label { + color: @font-color-warning; } } } diff --git a/src/widget/multilayerselecttree/multilayerselecttree.combo.js b/src/widget/multilayerselecttree/multilayerselecttree.combo.js index 1613e9fbf..8230ace71 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.combo.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.combo.js @@ -17,6 +17,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { allowSearchValue: false, allowInsertValue: false, isNeedAdjustWidth: true, + status: "", // "error","warning" }); }, @@ -37,7 +38,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { var self = this, o = this.options; return { type: "bi.combo", - cls: (o.simple ? "bi-border-bottom" : "bi-border") + " bi-border-radius", + cls: (o.simple ? "bi-border-bottom" : "bi-border") + " bi-border-radius " + (BI.isKey(o.status) ? ("status-" + o.status) : ""), container: o.container, destroyWhenHide: o.destroyWhenHide, adjustLength: 2, @@ -205,6 +206,18 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { // do some work }, + setStatus: function (status) { + if (BI.isKey(this.options.status)) { + this.element.removeClass("status-" + this.options.status); + } + this.element.addClass("status-" + status); + this.options.status = status; + }, + + setTipType: function (v) { + this.trigger ? this.trigger.setTipType(v) : this.textTrigger.setTipType(v); + }, + populate: function (items) { this.combo.populate(items); }, diff --git a/src/widget/multilayersingletree/multilayersingletree.combo.js b/src/widget/multilayersingletree/multilayersingletree.combo.js index d0e11182f..2060eeaa6 100644 --- a/src/widget/multilayersingletree/multilayersingletree.combo.js +++ b/src/widget/multilayersingletree/multilayersingletree.combo.js @@ -77,7 +77,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { var self = this, o = this.options; return { type: "bi.combo", - cls: (o.simple ? "bi-border-bottom" : "bi-border") + " bi-border-radius", + cls: (o.simple ? "bi-border-bottom" : "bi-border") + " bi-border-radius " + (BI.isKey(o.status) ? ("status-" + o.status) : ""), container: o.container, destroyWhenHide: o.destroyWhenHide, adjustLength: 2, @@ -237,6 +237,18 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { return this.combo.getValue(); }, + setStatus: function (status) { + if (BI.isKey(this.options.status)) { + this.element.removeClass("status-" + this.options.status); + } + this.element.addClass("status-" + status); + this.options.status = status; + }, + + setTipType: function (v) { + this.trigger ? this.trigger.setTipType(v) : this.textTrigger.setTipType(v); + }, + populate: function (items) { this.combo.populate(items); }, diff --git a/src/widget/singletree/singletree.trigger.js b/src/widget/singletree/singletree.trigger.js index 2df5a259c..f4a4ca7df 100644 --- a/src/widget/singletree/singletree.trigger.js +++ b/src/widget/singletree/singletree.trigger.js @@ -60,6 +60,7 @@ BI.SingleTreeTrigger = BI.inherit(BI.Trigger, { }, setTipType: function (v) { + this.options.tipType = v; this.trigger.setTipType(v); }, diff --git a/typescript/widget/multilayerselecttree/multilayerselecttree.combo.ts b/typescript/widget/multilayerselecttree/multilayerselecttree.combo.ts index 1fc9e1519..6146190b8 100644 --- a/typescript/widget/multilayerselecttree/multilayerselecttree.combo.ts +++ b/typescript/widget/multilayerselecttree/multilayerselecttree.combo.ts @@ -21,4 +21,6 @@ export declare class MultiLayerSelectTreeCombo extends Widget { blur(): void; showView(): void; + + setStatus(status: "error" | "warning"): void; } diff --git a/typescript/widget/multilayersingletree/multilayersingletree.combo.ts b/typescript/widget/multilayersingletree/multilayersingletree.combo.ts index fcecc32c4..ebbf5c607 100644 --- a/typescript/widget/multilayersingletree/multilayersingletree.combo.ts +++ b/typescript/widget/multilayersingletree/multilayersingletree.combo.ts @@ -21,4 +21,6 @@ export declare class MultiLayerSingleTreeCombo extends Widget { blur(): void; showView(): void; + + setStatus(status: "error" | "warning"): void; } From 9c6649e03b87ba0ffade45d095a097285dfaf03d Mon Sep 17 00:00:00 2001 From: data Date: Wed, 11 May 2022 14:13:48 +0800 Subject: [PATCH 37/60] auto upgrade version to 2.0.20220511141337 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c94be22b7..de865fa9e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220510231427", + "version": "2.0.20220511141337", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 5eeec69323ab479d52a52ae221e85a49838a7baa Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 11 May 2022 19:59:41 +0800 Subject: [PATCH 38/60] =?UTF-8?q?feature:=20=E5=B8=83=E5=B1=80=E6=94=AF?= =?UTF-8?q?=E6=8C=81=5Flgap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/wrapper/layout.js | 51 +++++++++++++------ .../wrapper/layout/adapt/absolute.center.js | 8 +-- .../adapt/absolute.leftrightvertical.js | 32 ++++++------ src/core/wrapper/layout/adapt/adapt.table.js | 4 +- src/core/wrapper/layout/fill/auto.vtape.js | 8 +-- .../layout/fill/float.fill.horizontal.js | 28 +++++----- .../flex/flex.leftrightvertical.center.js | 18 +++---- .../float/float.absolute.leftrightvertical.js | 18 +++---- src/core/wrapper/layout/layout.flow.js | 36 +++++++------ src/core/wrapper/layout/layout.inline.js | 6 +-- src/core/wrapper/layout/layout.tape.js | 24 ++++----- src/core/wrapper/layout/layout.td.js | 4 +- 12 files changed, 130 insertions(+), 107 deletions(-) diff --git a/src/core/wrapper/layout.js b/src/core/wrapper/layout.js index 2bb053c6d..badad1805 100644 --- a/src/core/wrapper/layout.js +++ b/src/core/wrapper/layout.js @@ -292,6 +292,25 @@ BI.Layout = BI.inherit(BI.Widget, { return (gap > 0 && gap < 1) ? (gap * 100).toFixed(1) + "%" : gap / BI.pixRatio + BI.pixUnit; }, + _optimiseItemLgap: function (item) { + return ((!item.type && item.el) ? item.lgap : item._lgap) || 0; + }, + _optimiseItemRgap: function (item) { + return ((!item.type && item.el) ? item.rgap : item._rgap) || 0; + }, + _optimiseItemTgap: function (item) { + return ((!item.type && item.el) ? item.tgap : item._tgap) || 0; + }, + _optimiseItemBgap: function (item) { + return ((!item.type && item.el) ? item.bgap : item._bgap) || 0; + }, + _optimiseItemHgap: function (item) { + return ((!item.type && item.el) ? item.hgap : item._hgap) || 0; + }, + _optimiseItemVgap: function (item) { + return ((!item.type && item.el) ? item.vgap : item._vgap) || 0; + }, + _handleGap: function (w, item, hIndex, vIndex) { var o = this.options; var innerLgap, innerRgap, innerTgap, innerBgap; @@ -304,26 +323,26 @@ BI.Layout = BI.inherit(BI.Widget, { innerTgap = vIndex === 0 ? o.innerVgap : 0; innerBgap = vIndex === o.items.length - 1 ? o.innerVgap : 0; } - if (o.vgap + o.tgap + innerTgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { - var top = ((BI.isNull(vIndex) || vIndex === 0) ? o.vgap : 0) + o.tgap + innerTgap + (item.tgap || 0) + (item.vgap || 0); + if (o.vgap + o.tgap + innerTgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { + var top = ((BI.isNull(vIndex) || vIndex === 0) ? o.vgap : 0) + o.tgap + innerTgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); w.element.css({ "margin-top": this._optimiseGap(top) }); } - if (o.hgap + o.lgap + innerLgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { - var left = ((BI.isNull(hIndex) || hIndex === 0) ? o.hgap : 0) + o.lgap + innerLgap + (item.lgap || 0) + (item.hgap || 0); + if (o.hgap + o.lgap + innerLgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) { + var left = ((BI.isNull(hIndex) || hIndex === 0) ? o.hgap : 0) + o.lgap + innerLgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item); w.element.css({ "margin-left": this._optimiseGap(left) }); } - if (o.hgap + o.rgap + innerRgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { - var right = o.hgap + o.rgap + innerRgap + (item.rgap || 0) + (item.hgap || 0); + if (o.hgap + o.rgap + innerRgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) { + var right = o.hgap + o.rgap + innerRgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item); w.element.css({ "margin-right": this._optimiseGap(right) }); } - if (o.vgap + o.bgap + innerBgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { - var bottom = o.vgap + o.bgap + innerBgap + (item.bgap || 0) + (item.vgap || 0); + if (o.vgap + o.bgap + innerBgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) { + var bottom = o.vgap + o.bgap + innerBgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); w.element.css({ "margin-bottom": this._optimiseGap(bottom) }); @@ -337,27 +356,27 @@ BI.Layout = BI.inherit(BI.Widget, { innerLgap = innerRgap = o.innerHgap; innerTgap = index === 0 ? o.innerVgap : 0; innerBgap = index === o.items.length - 1 ? o.innerVgap : 0; - if (o.vgap + o.tgap + innerTgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { - var top = (index === 0 ? o.vgap : 0) + (index === 0 ? o.tgap : 0) + innerTgap + (item.tgap || 0) + (item.vgap || 0); + if (o.vgap + o.tgap + innerTgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { + var top = (index === 0 ? o.vgap : 0) + (index === 0 ? o.tgap : 0) + innerTgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); w.element.css({ "margin-top": this._optimiseGap(top) }); } - if (o.hgap + o.lgap + innerLgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { - var left = o.hgap + o.lgap + innerLgap + (item.lgap || 0) + (item.hgap || 0); + if (o.hgap + o.lgap + innerLgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) { + var left = o.hgap + o.lgap + innerLgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item); w.element.css({ "margin-left": this._optimiseGap(left) }); } - if (o.hgap + o.rgap + innerRgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { - var right = o.hgap + o.rgap + innerRgap + (item.rgap || 0) + (item.hgap || 0); + if (o.hgap + o.rgap + innerRgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) { + var right = o.hgap + o.rgap + innerRgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item); w.element.css({ "margin-right": this._optimiseGap(right) }); } // 这里的代码是关键 - if (o.vgap + o.hgap + o.bgap + innerBgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { - var bottom = (index === o.items.length - 1 ? o.vgap : o.hgap) + (index === o.items.length - 1 ? o.bgap : 0) + innerBgap + (item.bgap || 0) + (item.vgap || 0); + if (o.vgap + o.hgap + o.bgap + innerBgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) { + var bottom = (index === o.items.length - 1 ? o.vgap : o.hgap) + (index === o.items.length - 1 ? o.bgap : 0) + innerBgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); w.element.css({ "margin-bottom": this._optimiseGap(bottom) }); diff --git a/src/core/wrapper/layout/adapt/absolute.center.js b/src/core/wrapper/layout/adapt/absolute.center.js index 67d37c4bc..14a122f00 100644 --- a/src/core/wrapper/layout/adapt/absolute.center.js +++ b/src/core/wrapper/layout/adapt/absolute.center.js @@ -30,10 +30,10 @@ BI.AbsoluteCenterLayout = BI.inherit(BI.Layout, { var w = BI.AbsoluteCenterLayout.superclass._addElement.apply(this, arguments); w.element.css({ position: "absolute", - left: this._optimiseGap(o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0)), - right: this._optimiseGap(o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0)), - top: this._optimiseGap(o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0)), - bottom: this._optimiseGap(o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0)), + left: this._optimiseGap(o.hgap + o.lgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item)), + right: this._optimiseGap(o.hgap + o.rgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item)), + top: this._optimiseGap(o.vgap + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item)), + bottom: this._optimiseGap(o.vgap + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item)), margin: "auto" }); return w; diff --git a/src/core/wrapper/layout/adapt/absolute.leftrightvertical.js b/src/core/wrapper/layout/adapt/absolute.leftrightvertical.js index 148897cfe..1aff2a7a9 100644 --- a/src/core/wrapper/layout/adapt/absolute.leftrightvertical.js +++ b/src/core/wrapper/layout/adapt/absolute.leftrightvertical.js @@ -56,17 +56,17 @@ BI.AbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { el: BI.stripEL(item), width: item.width }; - if (o.lvgap + o.ltgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { - json.tgap = o.lvgap + o.ltgap + (item.tgap || 0) + (item.vgap || 0); + if (o.lvgap + o.ltgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { + json.tgap = o.lvgap + o.ltgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); } - if (o.lhgap + o.llgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { - json.lgap = (i === 0 ? o.lhgap : 0) + o.llgap + (item.lgap || 0) + (item.hgap || 0); + if (o.lhgap + o.llgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) { + json.lgap = (i === 0 ? o.lhgap : 0) + o.llgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item); } - if (o.lhgap + o.lrgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { - json.rgap = o.lhgap + o.lrgap + (item.rgap || 0) + (item.hgap || 0); + if (o.lhgap + o.lrgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) { + json.rgap = o.lhgap + o.lrgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item); } - if (o.lvgap + o.lbgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { - json.bgap = o.lvgap + o.lbgap + (item.bgap || 0) + (item.vgap || 0); + if (o.lvgap + o.lbgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) { + json.bgap = o.lvgap + o.lbgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); } return json; }); @@ -75,17 +75,17 @@ BI.AbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { el: BI.stripEL(item), width: item.width }; - if (o.rvgap + o.rtgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { - json.tgap = o.rvgap + o.rtgap + (item.tgap || 0) + (item.vgap || 0); + if (o.rvgap + o.rtgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { + json.tgap = o.rvgap + o.rtgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); } - if (o.rhgap + o.rlgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { - json.lgap = (i === 0 ? o.rhgap : 0) + o.rlgap + (item.lgap || 0) + (item.hgap || 0); + if (o.rhgap + o.rlgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) { + json.lgap = (i === 0 ? o.rhgap : 0) + o.rlgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item); } - if (o.rhgap + o.rrgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { - json.rgap = o.rhgap + o.rrgap + (item.rgap || 0) + (item.hgap || 0); + if (o.rhgap + o.rrgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) { + json.rgap = o.rhgap + o.rrgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item); } - if (o.rvgap + o.rbgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { - json.bgap = o.rvgap + o.rbgap + (item.bgap || 0) + (item.vgap || 0); + if (o.rvgap + o.rbgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) { + json.bgap = o.rvgap + o.rbgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); } return json; }); diff --git a/src/core/wrapper/layout/adapt/adapt.table.js b/src/core/wrapper/layout/adapt/adapt.table.js index 9af2aa8cc..5691840af 100644 --- a/src/core/wrapper/layout/adapt/adapt.table.js +++ b/src/core/wrapper/layout/adapt/adapt.table.js @@ -70,8 +70,8 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, { td.element.width(width); } if (o.verticalAlign === BI.VerticalAlign.Stretch) { - var top = o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0), - bottom = o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0); + var top = o.vgap + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item), + bottom = o.vgap + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); w.element.css("height", "calc(100% - " + this._optimiseGap(top + bottom) + ")"); } // 对于表现为td的元素设置最大宽度,有几点需要注意 diff --git a/src/core/wrapper/layout/fill/auto.vtape.js b/src/core/wrapper/layout/fill/auto.vtape.js index 16491ebab..efc784f5d 100644 --- a/src/core/wrapper/layout/fill/auto.vtape.js +++ b/src/core/wrapper/layout/fill/auto.vtape.js @@ -60,10 +60,10 @@ BI.AutoVerticalTapeLayout = BI.inherit(BI.Layout, { if (preRowSize === "") { preRowSize = self.layout.getWidgetByName(self._getChildName(i - 1)).element.height(); } - top[i] = top[i - 1] + preRowSize + (items[i - 1].tgap || 0) + (items[i - 1].bgap || 0) + 2 * (items[i - 1].vgap || 0) + o.vgap + o.tgap + o.bgap; + top[i] = top[i - 1] + preRowSize + self._optimiseItemTgap(items[i - 1]) + self._optimiseItemBgap(items[i - 1]) + 2 * self._optimiseItemVgap(items[i - 1]) + o.vgap + o.tgap + o.bgap; } w.element.css({ - top: self._optimiseGap(top[i] + (item.vgap || 0) + (item.tgap || 0) + o.vgap + o.tgap) + top: self._optimiseGap(top[i] + self._optimiseItemTgap(item) + self._optimiseItemVgap(item) + o.vgap + o.tgap) }); if (rowSize === "fill") { @@ -81,10 +81,10 @@ BI.AutoVerticalTapeLayout = BI.inherit(BI.Layout, { if (nextRowSize === "") { nextRowSize = self.layout.getWidgetByName(self._getChildName(i + 1)).element.height(); } - bottom[i] = bottom[i + 1] + nextRowSize + (items[i + 1].tgap || 0) + (items[i + 1].bgap || 0) + 2 * (items[i + 1].vgap || 0) + o.vgap + o.tgap + o.bgap; + bottom[i] = bottom[i + 1] + nextRowSize + self._optimiseItemTgap(items[i + 1]) + self._optimiseItemBgap(items[i + 1]) + 2 * self._optimiseItemVgap(items[i + 1]) + o.vgap + o.tgap + o.bgap; } w.element.css({ - bottom: self._optimiseGap(bottom[i] + (item.vgap || 0) + (item.bgap || 0) + o.vgap + o.bgap), + bottom: self._optimiseGap(bottom[i] + self._optimiseItemBgap(item) + self._optimiseItemVgap(item) + o.vgap + o.bgap), }); if (rowSize === "fill") { diff --git a/src/core/wrapper/layout/fill/float.fill.horizontal.js b/src/core/wrapper/layout/fill/float.fill.horizontal.js index d6607703b..512ffb627 100644 --- a/src/core/wrapper/layout/fill/float.fill.horizontal.js +++ b/src/core/wrapper/layout/fill/float.fill.horizontal.js @@ -45,41 +45,41 @@ BI.FloatHorizontalFillLayout = BI.inherit(BI.Layout, { } else { var w = BI._lazyCreateWidget(item); } - if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { + if (o.vgap + o.tgap + self._optimiseItemTgap(item) + self._optimiseItemVgap(item) !== 0) { w.element.css({ - "margin-top": self._optimiseGap(o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0)) + "margin-top": self._optimiseGap(o.vgap + o.tgap + self._optimiseItemTgap(item) + self._optimiseItemVgap(item)) }); } if (desc) { - if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { + if (o.hgap + o.rgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) !== 0) { w.element.css({ - "margin-right": self._optimiseGap((i === o.items.length - 1 ? o.hgap : 0) + o.rgap + (item.rgap || 0) + (item.hgap || 0)) + "margin-right": self._optimiseGap((i === o.items.length - 1 ? o.hgap : 0) + o.rgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item)) }); } - if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { + if (o.hgap + o.lgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) !== 0) { w.element.css({ - "margin-left": self._optimiseGap(o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0)) + "margin-left": self._optimiseGap(o.hgap + o.lgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item)) }); } } else { - if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { + if (o.hgap + o.lgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) !== 0) { w.element.css({ - "margin-left": self._optimiseGap((i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0)) + "margin-left": self._optimiseGap((i === 0 ? o.hgap : 0) + o.lgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item)) }); } - if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { + if (o.hgap + o.rgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) !== 0) { w.element.css({ - "margin-right": self._optimiseGap(o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0)) + "margin-right": self._optimiseGap(o.hgap + o.rgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item)) }); } } - if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { + if (o.vgap + o.bgap + self._optimiseItemBgap(item) + self._optimiseItemVgap(item) !== 0) { w.element.css({ - "margin-bottom": self._optimiseGap(o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0)) + "margin-bottom": self._optimiseGap(o.vgap + o.bgap + self._optimiseItemBgap(item) + self._optimiseItemVgap(item)) }); } - var top = o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0), - bottom = o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0); + var top = o.vgap + o.tgap + self._optimiseItemTgap(item) + self._optimiseItemVgap(item), + bottom = o.vgap + o.bgap + self._optimiseItemBgap(item) + self._optimiseItemVgap(item); if (o.verticalAlign === BI.VerticalAlign.Stretch && BI.isNull(item.height)) { w.element.css({ height: "calc(100% - " + self._optimiseGap(top + bottom) + ")" diff --git a/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js b/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js index 322d48fb4..01a462707 100644 --- a/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js +++ b/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js @@ -35,7 +35,7 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { }, _formatItems: function (items) { - var o = this.options; + var self = this, o = this.options; var left, right; if (BI.isArray(items)) { BI.each(items, function (i, item) { @@ -53,17 +53,17 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { var json = { el: BI.stripEL(item) }; - if (o.lvgap + o.ltgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { - json.tgap = o.lvgap + o.ltgap + (item.tgap || 0) + (item.vgap || 0); + if (o.lvgap + o.ltgap + self._optimiseItemTgap(item) + self._optimiseItemVgap(item) !== 0) { + json.tgap = o.lvgap + o.ltgap + self._optimiseItemTgap(item) + self._optimiseItemVgap(item); } - if (o.lhgap + o.llgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { - json.lgap = (i === 0 ? o.lhgap : 0) + o.llgap + (item.lgap || 0) + (item.hgap || 0); + if (o.lhgap + o.llgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) !== 0) { + json.lgap = (i === 0 ? o.lhgap : 0) + o.llgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item); } - if (o.lhgap + o.lrgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { - json.rgap = o.lhgap + o.lrgap + (item.rgap || 0) + (item.hgap || 0); + if (o.lhgap + o.lrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) !== 0) { + json.rgap = o.lhgap + o.lrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item); } - if (o.lvgap + o.lbgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { - json.bgap = o.lvgap + o.lbgap + (item.bgap || 0) + (item.vgap || 0); + if (o.lvgap + o.lbgap + self._optimiseItemBgap(item) + self._optimiseItemVgap(item) !== 0) { + json.bgap = o.lvgap + o.lbgap + self._optimiseItemBgap(item) + self._optimiseItemVgap(item); } return json; }); diff --git a/src/core/wrapper/layout/float/float.absolute.leftrightvertical.js b/src/core/wrapper/layout/float/float.absolute.leftrightvertical.js index 26bea2558..9de105651 100644 --- a/src/core/wrapper/layout/float/float.absolute.leftrightvertical.js +++ b/src/core/wrapper/layout/float/float.absolute.leftrightvertical.js @@ -38,7 +38,7 @@ BI.FloatAbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { }, _formatItems: function (items) { - var o = this.options; + var self = this, o = this.options; var left, right; if (BI.isArray(items)) { BI.each(items, function (i, item) { @@ -68,11 +68,11 @@ BI.FloatAbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { // if (o.lvgap + o.ltgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { // json.tgap = o.lvgap + o.ltgap + (item.tgap || 0) + (item.vgap || 0); // } - if (o.lhgap + o.llgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { - json.lgap = (i === 0 ? o.lhgap : 0) + o.llgap + (item.lgap || 0) + (item.hgap || 0); + if (o.lhgap + o.llgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) !== 0) { + json.lgap = (i === 0 ? o.lhgap : 0) + o.llgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item); } - if (o.lhgap + o.lrgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { - json.rgap = o.lhgap + o.lrgap + (item.rgap || 0) + (item.hgap || 0); + if (o.lhgap + o.lrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) !== 0) { + json.rgap = o.lhgap + o.lrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item); } // if (o.lvgap + o.lbgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { // json.bgap = o.lvgap + o.lbgap + (item.bgap || 0) + (item.vgap || 0); @@ -95,11 +95,11 @@ BI.FloatAbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { // if (o.rvgap + o.rtgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { // json.tgap = o.rvgap + o.rtgap + (item.tgap || 0) + (item.vgap || 0); // } - if (o.rhgap + o.rlgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { - json.lgap = (i === 0 ? o.rhgap : 0) + o.rlgap + (item.lgap || 0) + (item.hgap || 0); + if (o.rhgap + o.rlgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) !== 0) { + json.lgap = (i === 0 ? o.rhgap : 0) + o.rlgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item); } - if (o.rhgap + o.rrgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { - json.rgap = o.rhgap + o.rrgap + (item.rgap || 0) + (item.hgap || 0); + if (o.rhgap + o.rrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) !== 0) { + json.rgap = o.rhgap + o.rrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item); } // if (o.rvgap + o.rbgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { // json.bgap = o.rvgap + o.rbgap + (item.bgap || 0) + (item.vgap || 0); diff --git a/src/core/wrapper/layout/layout.flow.js b/src/core/wrapper/layout/layout.flow.js index 4efc35123..e3c26638d 100644 --- a/src/core/wrapper/layout/layout.flow.js +++ b/src/core/wrapper/layout/layout.flow.js @@ -56,26 +56,26 @@ BI.FloatLeftLayout = BI.inherit(BI.Layout, { if (BI.isNotNull(item.bottom)) { w.element.css({bottom: BI.isNumber(item.bottom) ? this._optimiseGap(item.bottom) : item.bottom}); } - if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { - var top = o.vgap / 2 + o.tgap + (item.tgap || 0) + (item.vgap || 0); + if (o.vgap + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { + var top = o.vgap / 2 + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); w.element.css({ "margin-top": this._optimiseGap(top) }); } - if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { - var left = o.hgap / 2 + o.lgap + (item.lgap || 0) + (item.hgap || 0); + if (o.hgap + o.lgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) { + var left = o.hgap / 2 + o.lgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item); w.element.css({ "margin-left": this._optimiseGap(left) }); } - if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { - var right = o.hgap / 2 + o.rgap + (item.rgap || 0) + (item.hgap || 0); + if (o.hgap + o.rgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) { + var right = o.hgap / 2 + o.rgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item); w.element.css({ "margin-right": this._optimiseGap(right) }); } - if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { - var bottom = o.vgap / 2 + o.bgap + (item.bgap || 0) + (item.vgap || 0); + if (o.vgap + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) { + var bottom = o.vgap / 2 + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); w.element.css({ "margin-bottom": this._optimiseGap(bottom) }); @@ -148,24 +148,28 @@ BI.FloatRightLayout = BI.inherit(BI.Layout, { if (BI.isNotNull(item.bottom)) { w.element.css({bottom: BI.isNumber(item.bottom) ? item.bottom / BI.pixRatio + BI.pixUnit : item.bottom}); } - if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { + if (o.vgap + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { + var top = o.vgap / 2 + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); w.element.css({ - "margin-top": (o.vgap / 2 + o.tgap + (item.tgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit + "margin-top": this._optimiseGap(top) }); } - if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { + if (o.hgap + o.lgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) { + var left = o.hgap / 2 + o.lgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item); w.element.css({ - "margin-left": (o.hgap / 2 + o.lgap + (item.lgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit + "margin-left": this._optimiseGap(left) }); } - if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { + if (o.hgap + o.rgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) { + var right = o.hgap / 2 + o.rgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item); w.element.css({ - "margin-right": (o.hgap / 2 + o.rgap + (item.rgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit + "margin-right": this._optimiseGap(right) }); } - if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { + if (o.vgap + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) { + var bottom = o.vgap / 2 + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); w.element.css({ - "margin-bottom": (o.vgap / 2 + o.bgap + (item.bgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit + "margin-bottom": this._optimiseGap(bottom) }); } return w; diff --git a/src/core/wrapper/layout/layout.inline.js b/src/core/wrapper/layout/layout.inline.js index 04b38a47a..99fa1b96e 100644 --- a/src/core/wrapper/layout/layout.inline.js +++ b/src/core/wrapper/layout/layout.inline.js @@ -66,7 +66,7 @@ BI.InlineLayout = BI.inherit(BI.Layout, { autoCount++; cz = 0; } - gap += o.hgap + o.lgap + o.rgap + (o.items[k].lgap || 0) + (o.items[k].rgap || 0) + (o.items[k].hgap || 0); + gap += o.hgap + o.lgap + o.rgap + this._optimiseItemLgap(o.items[k]) + this._optimiseItemRgap(o.items[k]) + this._optimiseItemHgap(o.items[k]); length += cz; } length = length > 0 && length < 1 ? (length * 100).toFixed(1) + "%" : length / BI.pixRatio + BI.pixUnit; @@ -84,8 +84,8 @@ BI.InlineLayout = BI.inherit(BI.Layout, { } this._handleGap(w, item, i); if (o.verticalAlign === BI.VerticalAlign.Stretch && BI.isNull(item.height)) { - var top = o.innerVgap + o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0), - bottom = o.innerVgap + o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0); + var top = o.innerVgap + o.vgap + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item), + bottom = o.innerVgap + o.vgap + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); var gap = (top + bottom) > 0 && (top + bottom) < 1 ? ((top + bottom) * 100).toFixed(1) + "%" : (top + bottom) / BI.pixRatio + BI.pixUnit; w.element.css("height", "calc(100% - " + gap + ")"); } diff --git a/src/core/wrapper/layout/layout.tape.js b/src/core/wrapper/layout/layout.tape.js index 8652862da..a3fa8bcf0 100644 --- a/src/core/wrapper/layout/layout.tape.js +++ b/src/core/wrapper/layout/layout.tape.js @@ -53,8 +53,8 @@ BI.HTapeLayout = BI.inherit(BI.Layout, { } w.element.css({ position: "absolute", - top: self._optimiseGap((item.vgap || 0) + (item.tgap || 0) + o.innerVgap + o.vgap + o.tgap), - bottom: self._optimiseGap((item.bgap || 0) + (item.vgap || 0) + o.innerVgap + o.vgap + o.bgap), + top: self._optimiseGap(self._optimiseItemTgap(item) + self._optimiseItemVgap(item) + o.innerVgap + o.vgap + o.tgap), + bottom: self._optimiseGap(self._optimiseItemBgap(item) + self._optimiseItemVgap(item) + o.innerVgap + o.vgap + o.bgap), width: BI.isNumber(columnSize) ? self._optimiseGap(columnSize) : "" }); if (o.verticalAlign === BI.VerticalAlign.Middle) { @@ -86,10 +86,10 @@ BI.HTapeLayout = BI.inherit(BI.Layout, { } if (BI.isNull(left[i])) { var preColumnSize = o.columnSize.length > 0 ? o.columnSize[i - 1] : items[i - 1].width; - left[i] = left[i - 1] + preColumnSize + (items[i - 1].lgap || 0) + (items[i - 1].rgap || 0) + 2 * (items[i - 1].hgap || 0) + o.hgap + o.lgap + o.rgap; + left[i] = left[i - 1] + preColumnSize + self._optimiseItemLgap(items[i - 1]) + self._optimiseItemRgap(items[i - 1]) + 2 * self._optimiseItemHgap(items[i - 1]) + o.hgap + o.lgap + o.rgap; } w.element.css({ - left: self._optimiseGap(left[i] + (item.lgap || 0) + (item.hgap || 0) + o.hgap + o.lgap) + left: self._optimiseGap(left[i] + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) + o.hgap + o.lgap) }); if (columnSize === "" || columnSize === "fill") { @@ -104,10 +104,10 @@ BI.HTapeLayout = BI.inherit(BI.Layout, { var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width; if (BI.isNull(right[i])) { var nextColumnSize = o.columnSize.length > 0 ? o.columnSize[i + 1] : items[i + 1].width; - right[i] = right[i + 1] + nextColumnSize + (items[i + 1].lgap || 0) + (items[i + 1].rgap || 0) + 2 * (items[i + 1].hgap || 0) + o.hgap + o.lgap + o.rgap; + right[i] = right[i + 1] + nextColumnSize + self._optimiseItemLgap(items[i + 1]) + self._optimiseItemRgap(items[i + 1]) + 2 * self._optimiseItemHgap(items[i + 1]) + o.hgap + o.lgap + o.rgap; } w.element.css({ - right: self._optimiseGap(right[i] + (item.rgap || 0) + (item.hgap || 0) + o.hgap + o.rgap) + right: self._optimiseGap(right[i] + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) + o.hgap + o.rgap) }); if (columnSize === "" || columnSize === "fill") { @@ -178,8 +178,8 @@ BI.VTapeLayout = BI.inherit(BI.Layout, { } w.element.css({ position: "absolute", - left: self._optimiseGap((item.lgap || 0) + (item.hgap || 0) + o.innerHgap + o.hgap + o.lgap), - right: self._optimiseGap((item.hgap || 0) + (item.rgap || 0) + o.innerHgap + o.hgap + o.rgap), + left: self._optimiseGap(self._optimiseItemLgap(item) + self._optimiseItemHgap(item) + o.innerHgap + o.hgap + o.lgap), + right: self._optimiseGap(self._optimiseItemRgap(item) + self._optimiseItemHgap(item) + o.innerHgap + o.hgap + o.rgap), height: BI.isNumber(rowSize) ? self._optimiseGap(rowSize) : "" }); if (o.horizontalAlign === BI.HorizontalAlign.Center) { @@ -211,10 +211,10 @@ BI.VTapeLayout = BI.inherit(BI.Layout, { } if (BI.isNull(top[i])) { var preRowSize = o.rowSize.length > 0 ? o.rowSize[i - 1] : items[i - 1].height; - top[i] = top[i - 1] + preRowSize + (items[i - 1].tgap || 0) + (items[i - 1].bgap || 0) + 2 * (items[i - 1].vgap || 0) + o.vgap + o.tgap + o.bgap; + top[i] = top[i - 1] + preRowSize + self._optimiseItemTgap(items[i - 1]) + self._optimiseItemBgap(items[i - 1]) + 2 * self._optimiseItemVgap(items[i - 1]) + o.vgap + o.tgap + o.bgap; } w.element.css({ - top: self._optimiseGap(top[i] + (item.vgap || 0) + (item.tgap || 0) + o.vgap + o.tgap) + top: self._optimiseGap(top[i] + self._optimiseItemTgap(item) + self._optimiseItemVgap(item) + o.vgap + o.tgap) }); if (rowSize === "" || rowSize === "fill") { @@ -229,10 +229,10 @@ BI.VTapeLayout = BI.inherit(BI.Layout, { var rowSize = o.rowSize.length > 0 ? o.rowSize[i] : item.height; if (BI.isNull(bottom[i])) { var nextRowSize = o.rowSize.length > 0 ? o.rowSize[i + 1] : items[i + 1].height; - bottom[i] = bottom[i + 1] + nextRowSize + (items[i + 1].tgap || 0) + (items[i + 1].bgap || 0) + 2 * (items[i + 1].vgap || 0) + o.vgap + o.tgap + o.bgap; + bottom[i] = bottom[i + 1] + nextRowSize + self._optimiseItemTgap(items[i + 1]) + self._optimiseItemBgap(items[i + 1]) + 2 * self._optimiseItemVgap(items[i + 1]) + o.vgap + o.tgap + o.bgap; } w.element.css({ - bottom: self._optimiseGap(bottom[i] + (item.vgap || 0) + (item.bgap || 0) + o.vgap + o.bgap) + bottom: self._optimiseGap(bottom[i] + self._optimiseItemBgap(item) + self._optimiseItemVgap(item) + o.vgap + o.bgap) }); if (rowSize === "" || rowSize === "fill") { diff --git a/src/core/wrapper/layout/layout.td.js b/src/core/wrapper/layout/layout.td.js index 17a469754..cb3221570 100644 --- a/src/core/wrapper/layout/layout.td.js +++ b/src/core/wrapper/layout/layout.td.js @@ -92,8 +92,8 @@ BI.TdLayout = BI.inherit(BI.Layout, { for (var i = 0; i < arr.length; i++) { var w = BI._lazyCreateWidget(arr[i]); if (o.verticalAlign === BI.VerticalAlign.Stretch) { - var top = o.vgap + o.tgap + (arr[i].tgap || 0) + (arr[i].vgap || 0), - bottom = o.vgap + o.bgap + (arr[i].bgap || 0) + (arr[i].vgap || 0); + var top = o.vgap + o.tgap + this._optimiseItemTgap(arr[i]) + this._optimiseItemVgap(arr[i]), + bottom = o.vgap + o.bgap + this._optimiseItemBgap(arr[i]) + this._optimiseItemVgap(arr[i]); w.element.css("height", "calc(100% - " + this._optimiseGap(top + bottom) + ")"); } w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"}); From 186be7574daca94a435ca12e0906591ed5f3f9b2 Mon Sep 17 00:00:00 2001 From: Claire <1119518763@qq.com> Date: Wed, 11 May 2022 20:12:56 +0800 Subject: [PATCH 39/60] =?UTF-8?q?KERNEL-10641=20refactor:=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=AE=9A=E4=B9=89=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/case/colorchooser/colorchooser.simple.ts | 3 ++- typescript/case/colorchooser/colorchooser.ts | 13 +++++++++++++ typescript/index.ts | 3 +++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 typescript/case/colorchooser/colorchooser.ts diff --git a/typescript/case/colorchooser/colorchooser.simple.ts b/typescript/case/colorchooser/colorchooser.simple.ts index 4ecb0d7c3..274a1f140 100644 --- a/typescript/case/colorchooser/colorchooser.simple.ts +++ b/typescript/case/colorchooser/colorchooser.simple.ts @@ -3,7 +3,8 @@ import { Widget } from '../../core/widget'; export declare class SimpleColorChooser extends Widget { static xtype: string; static EVENT_CHANGE: string; - + static EVENT_AFTER_POPUPVIEW: string; + isViewVisible(): boolean; hideView(): void; diff --git a/typescript/case/colorchooser/colorchooser.ts b/typescript/case/colorchooser/colorchooser.ts new file mode 100644 index 000000000..b58869e37 --- /dev/null +++ b/typescript/case/colorchooser/colorchooser.ts @@ -0,0 +1,13 @@ +import { Widget } from '../../core/widget'; + +export declare class ColorChooser extends Widget { + static xtype: string; + static EVENT_CHANGE: string; + static EVENT_AFTER_POPUPVIEW: string; + + isViewVisible(): boolean; + + hideView(): void; + + showView(): void; +} diff --git a/typescript/index.ts b/typescript/index.ts index 448266b96..fa9a08d19 100644 --- a/typescript/index.ts +++ b/typescript/index.ts @@ -82,6 +82,7 @@ import { MultiSelectCombo } from "./widget/multiselect/multiselect.combo"; import { SearchEditor } from "./widget/editor/editor.search"; import { MultiLayerSingleLevelTree } from "./widget/multilayersingletree/multilayersingletree.leveltree"; import { SimpleColorChooser } from "./case/colorchooser/colorchooser.simple"; +import { ColorChooser } from './case/colorchooser/colorchooser'; import { A } from "./base/a/a"; import { Html } from "./base/single/html/html"; import { Switcher } from "./base/combination/switcher"; @@ -307,6 +308,7 @@ export interface BI extends _func, _i18n, _base, _inject, _var, _web, _utils { SearchEditor: typeof SearchEditor; MultiLayerSingleLevelTree: typeof MultiLayerSingleLevelTree; SimpleColorChooser: typeof SimpleColorChooser; + ColorChooser: typeof ColorChooser; AbstractAllValueChooser: typeof AbstractAllValueChooser; AllValueChooserCombo: typeof AllValueChooserCombo; TextAreaEditor: typeof TextAreaEditor; @@ -496,6 +498,7 @@ export { Text, Pane, MultiLayerSingleLevelTree, + ColorChooser, SimpleColorChooser, AbstractAllValueChooser, AllValueChooserCombo, From 6cce574f7e83ae0809c14889886d3d8e5cbc239d Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 11 May 2022 20:13:25 +0800 Subject: [PATCH 40/60] =?UTF-8?q?feature:=20=E5=B8=83=E5=B1=80=E6=94=AF?= =?UTF-8?q?=E6=8C=81=5Flgap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/wrapper/layout/sticky/sticky.horizontal.js | 3 ++- src/core/wrapper/layout/sticky/sticky.vertical.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/wrapper/layout/sticky/sticky.horizontal.js b/src/core/wrapper/layout/sticky/sticky.horizontal.js index c5b644542..a59dd6edf 100644 --- a/src/core/wrapper/layout/sticky/sticky.horizontal.js +++ b/src/core/wrapper/layout/sticky/sticky.horizontal.js @@ -5,7 +5,8 @@ BI.HorizontalStickyLayout = BI.inherit(BI.FlexHorizontalLayout, { props: function () { return BI.extend(BI.HorizontalStickyLayout.superclass.props.apply(this, arguments), { extraCls: "bi-h-sticky", - horizontalAlign: BI.HorizontalAlign.Stretch, + scrollx: true, + // horizontalAlign: BI.HorizontalAlign.Stretch, verticalAlign: BI.VerticalAlign.Stretch }); }, diff --git a/src/core/wrapper/layout/sticky/sticky.vertical.js b/src/core/wrapper/layout/sticky/sticky.vertical.js index a5ba3d837..970d84eef 100644 --- a/src/core/wrapper/layout/sticky/sticky.vertical.js +++ b/src/core/wrapper/layout/sticky/sticky.vertical.js @@ -5,8 +5,9 @@ BI.VerticalStickyLayout = BI.inherit(BI.FlexVerticalLayout, { props: function () { return BI.extend(BI.VerticalStickyLayout.superclass.props.apply(this, arguments), { extraCls: "bi-v-sticky", + scrolly: true, horizontalAlign: BI.HorizontalAlign.Stretch, - verticalAlign: BI.VerticalAlign.Stretch + // verticalAlign: BI.VerticalAlign.Stretch }); }, From 1a35e7e5cee3c7e4da7714f106973798bb946ac0 Mon Sep 17 00:00:00 2001 From: data Date: Thu, 12 May 2022 10:16:02 +0800 Subject: [PATCH 41/60] auto upgrade version to 2.0.20220512101555 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index de865fa9e..2628ea301 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220511141337", + "version": "2.0.20220512101555", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 8d0c6b2efc1b4f51aff8c39da5e22acc5e2dfb1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=95=AC=E5=B3=A5?= Date: Thu, 12 May 2022 10:22:19 +0800 Subject: [PATCH 42/60] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1,selecttre?= =?UTF-8?q?e=E7=BB=84=E4=BB=B6=E6=B2=A1=E4=BC=A0iconWidth:o.height?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E5=85=A8=E5=B1=80=E9=85=8D=E7=BD=AE=E5=B0=BA?= =?UTF-8?q?=E5=AF=B8=E5=90=8Eicon=E5=A4=A7=E5=B0=8F=E6=B2=A1=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/button/node/node.plus.js | 2 +- src/case/checkbox/check.first.treenode.js | 4 ++-- src/case/checkbox/check.last.treenode.js | 4 ++-- src/case/checkbox/check.mid.treenode.js | 4 ++-- src/case/checkbox/check.treenode.js | 4 ++-- src/widget/selecttree/nodes/node.first.plus.js | 4 +++- src/widget/selecttree/nodes/node.last.plus.js | 4 +++- src/widget/selecttree/nodes/node.mid.plus.js | 4 +++- src/widget/selecttree/nodes/node.plus.js | 5 ++++- 9 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/case/button/node/node.plus.js b/src/case/button/node/node.plus.js index ec38ca0e0..0b4b3ee2d 100644 --- a/src/case/button/node/node.plus.js +++ b/src/case/button/node/node.plus.js @@ -14,8 +14,8 @@ BI.PlusGroupNode = BI.inherit(BI.NodeButton, { }, id: "", pId: "", - open: false, iconWrapperWidth: null, + open: false, height: 24 }); }, diff --git a/src/case/checkbox/check.first.treenode.js b/src/case/checkbox/check.first.treenode.js index 40568e700..aa808488f 100644 --- a/src/case/checkbox/check.first.treenode.js +++ b/src/case/checkbox/check.first.treenode.js @@ -7,8 +7,8 @@ BI.FirstTreeNodeCheckbox = BI.inherit(BI.IconButton, { _defaultConfig: function () { return BI.extend( BI.FirstTreeNodeCheckbox.superclass._defaultConfig.apply(this, arguments), { extraCls: BI.STYLE_CONSTANTS.LINK_LINE_TYPE === "solid" ? "tree-solid-collapse-icon-type2" : "tree-collapse-icon-type2", - iconWidth: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, - iconHeight: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT + iconWidth: 24, + iconHeight: 24 }); }, diff --git a/src/case/checkbox/check.last.treenode.js b/src/case/checkbox/check.last.treenode.js index 653dd785d..cb536f8cc 100644 --- a/src/case/checkbox/check.last.treenode.js +++ b/src/case/checkbox/check.last.treenode.js @@ -7,8 +7,8 @@ BI.LastTreeNodeCheckbox = BI.inherit(BI.IconButton, { _defaultConfig: function () { return BI.extend(BI.LastTreeNodeCheckbox.superclass._defaultConfig.apply(this, arguments), { extraCls: BI.STYLE_CONSTANTS.LINK_LINE_TYPE === "solid" ? "tree-solid-collapse-icon-type4" : "tree-collapse-icon-type4", - iconWidth: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, - iconHeight: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT + iconWidth: 24, + iconHeight: 24 }); }, diff --git a/src/case/checkbox/check.mid.treenode.js b/src/case/checkbox/check.mid.treenode.js index 716cb0142..7ec4e5230 100644 --- a/src/case/checkbox/check.mid.treenode.js +++ b/src/case/checkbox/check.mid.treenode.js @@ -7,8 +7,8 @@ BI.MidTreeNodeCheckbox = BI.inherit(BI.IconButton, { _defaultConfig: function () { return BI.extend( BI.MidTreeNodeCheckbox.superclass._defaultConfig.apply(this, arguments), { extraCls: BI.STYLE_CONSTANTS.LINK_LINE_TYPE === "solid" ? "tree-solid-collapse-icon-type3" : "tree-collapse-icon-type3", - iconWidth: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, - iconHeight: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT + iconWidth: 24, + iconHeight: 24 }); }, diff --git a/src/case/checkbox/check.treenode.js b/src/case/checkbox/check.treenode.js index ab186f4fb..128bb73c6 100644 --- a/src/case/checkbox/check.treenode.js +++ b/src/case/checkbox/check.treenode.js @@ -7,8 +7,8 @@ BI.TreeNodeCheckbox = BI.inherit(BI.IconButton, { _defaultConfig: function () { return BI.extend( BI.TreeNodeCheckbox.superclass._defaultConfig.apply(this, arguments), { extraCls: BI.STYLE_CONSTANTS.LINK_LINE_TYPE === "solid" ? "tree-solid-collapse-icon-type1" : "tree-collapse-icon-type1", - iconWidth: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, - iconHeight: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT + iconWidth: 24, + iconHeight: 24 }); }, diff --git a/src/widget/selecttree/nodes/node.first.plus.js b/src/widget/selecttree/nodes/node.first.plus.js index f8f23c2b5..378eac230 100644 --- a/src/widget/selecttree/nodes/node.first.plus.js +++ b/src/widget/selecttree/nodes/node.first.plus.js @@ -24,7 +24,9 @@ BI.SelectTreeFirstPlusGroupNode = BI.inherit(BI.NodeButton, { var self = this, o = this.options; this.checkbox = BI.createWidget({ type: "bi.first_tree_node_checkbox", - stopPropagation: true + stopPropagation: true, + iconHeight: o.height, + iconWidth: o.height }); this.text = BI.createWidget({ type: "bi.label", diff --git a/src/widget/selecttree/nodes/node.last.plus.js b/src/widget/selecttree/nodes/node.last.plus.js index 2c4cca80c..f8e764e10 100644 --- a/src/widget/selecttree/nodes/node.last.plus.js +++ b/src/widget/selecttree/nodes/node.last.plus.js @@ -24,7 +24,9 @@ BI.SelectTreeLastPlusGroupNode = BI.inherit(BI.NodeButton, { var self = this, o = this.options; this.checkbox = BI.createWidget({ type: "bi.last_tree_node_checkbox", - stopPropagation: true + stopPropagation: true, + iconHeight: o.height, + iconWidth: o.height }); this.text = BI.createWidget({ type: "bi.label", diff --git a/src/widget/selecttree/nodes/node.mid.plus.js b/src/widget/selecttree/nodes/node.mid.plus.js index 289136242..ddafe5704 100644 --- a/src/widget/selecttree/nodes/node.mid.plus.js +++ b/src/widget/selecttree/nodes/node.mid.plus.js @@ -24,7 +24,9 @@ BI.SelectTreeMidPlusGroupNode = BI.inherit(BI.NodeButton, { var self = this, o = this.options; this.checkbox = BI.createWidget({ type: "bi.mid_tree_node_checkbox", - stopPropagation: true + stopPropagation: true, + iconHeight: o.height, + iconWidth: o.height }); this.text = BI.createWidget({ type: "bi.label", diff --git a/src/widget/selecttree/nodes/node.plus.js b/src/widget/selecttree/nodes/node.plus.js index e0f8e8632..ebebfa314 100644 --- a/src/widget/selecttree/nodes/node.plus.js +++ b/src/widget/selecttree/nodes/node.plus.js @@ -14,6 +14,7 @@ BI.SelectTreePlusGroupNode = BI.inherit(BI.NodeButton, { }, id: "", pId: "", + iconWrapperWidth: null, readonly: true, open: false, height: 24 @@ -24,7 +25,9 @@ BI.SelectTreePlusGroupNode = BI.inherit(BI.NodeButton, { var self = this, o = this.options; this.checkbox = BI.createWidget({ type: "bi.tree_node_checkbox", - stopPropagation: true + stopPropagation: true, + iconHeight: o.height, + iconWidth: o.iconWrapperWidth || o.height }); this.text = BI.createWidget({ type: "bi.label", From 511ebb73abd53e54e484727441ee33af1f7f7aeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=95=AC=E5=B3=A5?= Date: Thu, 12 May 2022 10:43:01 +0800 Subject: [PATCH 43/60] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=A0=91=E7=BB=84=E4=BB=B6iconWrapperWidth?= =?UTF-8?q?=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/button/node/node.plus.js | 1 - src/widget/selecttree/nodes/node.plus.js | 1 - 2 files changed, 2 deletions(-) diff --git a/src/case/button/node/node.plus.js b/src/case/button/node/node.plus.js index 0b4b3ee2d..708ad4300 100644 --- a/src/case/button/node/node.plus.js +++ b/src/case/button/node/node.plus.js @@ -14,7 +14,6 @@ BI.PlusGroupNode = BI.inherit(BI.NodeButton, { }, id: "", pId: "", - iconWrapperWidth: null, open: false, height: 24 }); diff --git a/src/widget/selecttree/nodes/node.plus.js b/src/widget/selecttree/nodes/node.plus.js index ebebfa314..d5cd39c66 100644 --- a/src/widget/selecttree/nodes/node.plus.js +++ b/src/widget/selecttree/nodes/node.plus.js @@ -14,7 +14,6 @@ BI.SelectTreePlusGroupNode = BI.inherit(BI.NodeButton, { }, id: "", pId: "", - iconWrapperWidth: null, readonly: true, open: false, height: 24 From 95027b0d20cbe40bebac4e92a77619d0cdd77c54 Mon Sep 17 00:00:00 2001 From: zsmj Date: Thu, 12 May 2022 11:44:17 +0800 Subject: [PATCH 44/60] =?UTF-8?q?DESIGN-4103=20feat:=20"bi.search=5Ftext?= =?UTF-8?q?=5Fvalue=5Fcombo"=20=E4=B9=9F=E6=94=AF=E6=8C=81=E6=B8=85?= =?UTF-8?q?=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../combo.searchtextvalue.js | 175 ++++++++---------- .../trigger.searchtextvalue.js | 56 +++++- src/case/trigger/trigger.text.js | 2 + 3 files changed, 126 insertions(+), 107 deletions(-) diff --git a/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js b/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js index cb4aa29f8..bba605576 100644 --- a/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js +++ b/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js @@ -22,113 +22,87 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, { o.items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) { self.populate(newValue); }) : o.items; + return { - type: "bi.absolute", - items: [{ + type: "bi.combo", + cls: (o.simple ? "bi-border-bottom" : "bi-border") + " bi-focus-shadow", + container: o.container, + adjustLength: 2, + toggle: false, + ref: function () { + self.combo = this; + }, + el: { + type: "bi.search_text_value_trigger", + cls: "search-text-value-trigger", + watermark: o.watermark, + ref: function () { + self.trigger = this; + }, + items: o.items, + height: o.height - (o.simple ? 1 : 2), + text: o.text, + defaultText: o.defaultText, + value: o.value, + tipType: o.tipType, + warningTitle: o.warningTitle, + title: o.title, + allowClear: o.allowClear, + listeners: [{ + eventName: BI.SearchTextValueTrigger.EVENT_CHANGE, + action: function () { + self.setValue(this.getValue()); + self.combo.hideView(); + self.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE); + } + }, { + eventName: BI.SearchTextValueTrigger.EVENT_CLEAR, + action: function () { + self.setValue(); + self.combo.hideView(); + self.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE); + } + }, { + eventName: BI.SearchTextValueTrigger.EVENT_CLEAR, + action: function () { + self._clear(); + } + }] + }, + popup: { el: { - type: "bi.combo", - cls: (o.simple ? "bi-border-bottom" : "bi-border") + " bi-focus-shadow", - container: o.container, - adjustLength: 2, - toggle: false, + type: "bi.text_value_combo_popup", + chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, + value: o.value, + items: o.items, ref: function () { - self.combo = this; - }, - el: { - type: "bi.search_text_value_trigger", - cls: "search-text-value-trigger", - watermark: o.watermark, - ref: function () { - self.trigger = this; - }, - items: o.items, - height: o.height - (o.simple ? 1 : 2), - text: o.text, - defaultText: o.defaultText, - value: o.value, - tipType: o.tipType, - warningTitle: o.warningTitle, - title: o.title, - allowClear: o.allowClear, - listeners: [{ - eventName: BI.SearchTextValueTrigger.EVENT_CHANGE, - action: function () { - self.setValue(this.getValue()); - self.combo.hideView(); - self.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE); - } - }, { - eventName: BI.SearchTextValueTrigger.EVENT_CLEAR, - action: function () { - self.setValue(); - self.combo.hideView(); - self.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE); - } - }] - }, - popup: { - el: { - type: "bi.text_value_combo_popup", - chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, - value: o.value, - items: o.items, - ref: function () { - self.popup = this; - self.trigger.getSearcher().setAdapter(self.popup); - }, - listeners: [{ - eventName: BI.TextValueComboPopup.EVENT_CHANGE, - action: function () { - self.setValue(this.getValue()); - self.combo.hideView(); - self.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE); - } - }] - }, - value: o.value, - maxHeight: 252, - minHeight: 25 + self.popup = this; + self.trigger.getSearcher().setAdapter(self.popup); }, listeners: [{ - eventName: BI.Combo.EVENT_AFTER_HIDEVIEW, + eventName: BI.TextValueComboPopup.EVENT_CHANGE, action: function () { - self.trigger.stopEditing(); - } - }, { - eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW, - action: function () { - self.fireEvent(BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW); - } - }], - hideChecker: function (e) { - return self.triggerBtn.element.find(e.target).length === 0; - } - }, - left: 0, - right: 0, - bottom: 0, - top: 0 - }, { - el: { - type: "bi.trigger_icon_button", - cls: "trigger-icon-button", - ref: function () { - self.triggerBtn = this; - }, - width: o.height, - height: o.height, - handler: function () { - if (self.combo.isViewVisible()) { + self.setValue(this.getValue()); self.combo.hideView(); - } else { - self.combo.showView(); + self.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE); } - } + }] }, - right: 0, - bottom: 0, - top: 0 - }] + value: o.value, + maxHeight: 252, + minHeight: 25 + }, + listeners: [{ + eventName: BI.Combo.EVENT_AFTER_HIDEVIEW, + action: function () { + self.trigger.stopEditing(); + } + }, { + eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW, + action: function () { + self.fireEvent(BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW); + } + }], }; }, @@ -139,6 +113,11 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, { } }, + _clear: function () { + this.trigger.attr("text", ""); + this.setValue([]); + }, + _checkError: function (v) { if (BI.isNull(v) || BI.isEmptyArray(v) || BI.isEmptyString(v)) { this.trigger.options.tipType = "success"; diff --git a/src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js b/src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js index 5673d3f47..2dd67933a 100644 --- a/src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js +++ b/src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js @@ -5,16 +5,32 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, { props: function () { return { - extraCls: "bi-search-text-value-trigger", + baseCls: "bi-search-text-value-trigger", height: 24, - watermark: BI.i18nText("BI-Basic_Search") + watermark: BI.i18nText("BI-Basic_Search"), + allowClear: false, }; }, render: function () { var self = this, o = this.options; + + var triggerButton = { + type: "bi.trigger_icon_button", + cls: "trigger-icon-button", + ref: function () { + self.triggerBtn = this; + }, + width: o.height, + height: o.height, + width: 24, + }; + + var stateText = this._digest(o.value, o.items); + return { - type: "bi.htape", + type: "bi.horizontal_fill", + columnSize: ["fill", 24], items: [ { el: { @@ -30,7 +46,7 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, { }, watermark: o.watermark, defaultText: o.defaultText, - text: this._digest(o.value, o.items), + text: stateText, value: o.value, height: o.height, tipText: "" @@ -55,10 +71,30 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, { }] } }, { - el: { - type: "bi.layout", - width: 24 - }, + el: o.allowClear ? { + type: "bi.vertical_adapt", + horizontalAlign: "left", + scrollable: false, + items: [ + { + el: { + type: "bi.icon_button", + ref: function (_ref) { + self.clearBtn = _ref; + }, + cls: "close-h-font " + (o.allowClear ? "clear-button" : ""), + stopPropagation: true, + invisible: !BI.isNotEmptyString(stateText), + width: o.height, + handler: function () { + self.fireEvent(BI.SearchTextValueTrigger.EVENT_CLEAR); + }, + }, + }, { + el: triggerButton, + } + ] + } : triggerButton, width: 24 } ] @@ -100,7 +136,9 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, { }, setValue: function (vals) { - this._setState(this._digest(vals, this.options.items)); + var stateText = this._digest(vals, this.options.items); + this._setState(stateText); + this.options.allowClear && this.clearBtn.setVisible(BI.isNotEmptyString(stateText)); }, getValue: function () { diff --git a/src/case/trigger/trigger.text.js b/src/case/trigger/trigger.text.js index b9a51cc6f..52da67200 100644 --- a/src/case/trigger/trigger.text.js +++ b/src/case/trigger/trigger.text.js @@ -72,6 +72,8 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { }, cls: "close-h-font " + (o.allowClear ? "clear-button" : ""), stopPropagation: true, + width: o.triggerWidth || o.height, + invisible: !BI.isNotEmptyString(o.text), handler: function () { self.fireEvent(BI.TextTrigger.EVENT_CLEAR); }, From a40178ab25c6c13167b0cc00cbbbb447439829f1 Mon Sep 17 00:00:00 2001 From: data Date: Thu, 12 May 2022 13:36:13 +0800 Subject: [PATCH 45/60] auto upgrade version to 2.0.20220512133600 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2628ea301..8a27cc6fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220512101555", + "version": "2.0.20220512133600", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 9b1c354ca4b1ecabd60f7569d2e46e7862c1cc23 Mon Sep 17 00:00:00 2001 From: zsmj Date: Thu, 12 May 2022 14:35:27 +0800 Subject: [PATCH 46/60] =?UTF-8?q?DESIGN-4103=20feat:=20=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E6=B8=85=E9=99=A4=E4=B9=8B=E5=90=8E=E9=9C=80=E8=A6=81=E5=AF=B9?= =?UTF-8?q?=E5=A4=96=E6=8A=9B=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../combo/searchtextvaluecombo/combo.searchtextvalue.js | 8 +------- src/case/combo/textvaluecombo/combo.textvalue.js | 1 + 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js b/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js index bba605576..b3e6ddc95 100644 --- a/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js +++ b/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js @@ -55,17 +55,11 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, { self.combo.hideView(); self.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE); } - }, { - eventName: BI.SearchTextValueTrigger.EVENT_CLEAR, - action: function () { - self.setValue(); - self.combo.hideView(); - self.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE); - } }, { eventName: BI.SearchTextValueTrigger.EVENT_CLEAR, action: function () { self._clear(); + self.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE); } }] }, diff --git a/src/case/combo/textvaluecombo/combo.textvalue.js b/src/case/combo/textvaluecombo/combo.textvalue.js index 69075f739..c49785126 100644 --- a/src/case/combo/textvaluecombo/combo.textvalue.js +++ b/src/case/combo/textvaluecombo/combo.textvalue.js @@ -41,6 +41,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { eventName: BI.SelectTextTrigger.EVENT_CLEAR, action: function () { self._clear(); + self.fireEvent(BI.TextValueCombo.EVENT_CHANGE); } } ], From 10f55cf253d430c00b6a602167320e899dd8011f Mon Sep 17 00:00:00 2001 From: data Date: Thu, 12 May 2022 14:35:56 +0800 Subject: [PATCH 47/60] auto upgrade version to 2.0.20220512143541 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8a27cc6fd..9d98ee6bd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220512133600", + "version": "2.0.20220512143541", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 39a8714d8d15d45166ebe45338cd5ea96ebf28b2 Mon Sep 17 00:00:00 2001 From: data Date: Thu, 12 May 2022 15:13:48 +0800 Subject: [PATCH 48/60] auto upgrade version to 2.0.20220512151342 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9d98ee6bd..d75528406 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220512143541", + "version": "2.0.20220512151342", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 490cf3ff2efccff8697b122ed7893856efe3ce50 Mon Sep 17 00:00:00 2001 From: zsmj Date: Thu, 12 May 2022 17:03:42 +0800 Subject: [PATCH 49/60] =?UTF-8?q?Revert=20"feature:=20=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E6=94=AF=E6=8C=81=5Flgap"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5eeec69323ab479d52a52ae221e85a49838a7baa. --- src/core/wrapper/layout.js | 51 ++++++------------- .../wrapper/layout/adapt/absolute.center.js | 8 +-- .../adapt/absolute.leftrightvertical.js | 32 ++++++------ src/core/wrapper/layout/adapt/adapt.table.js | 4 +- src/core/wrapper/layout/fill/auto.vtape.js | 8 +-- .../layout/fill/float.fill.horizontal.js | 28 +++++----- .../flex/flex.leftrightvertical.center.js | 18 +++---- .../float/float.absolute.leftrightvertical.js | 18 +++---- src/core/wrapper/layout/layout.flow.js | 36 ++++++------- src/core/wrapper/layout/layout.inline.js | 6 +-- src/core/wrapper/layout/layout.tape.js | 24 ++++----- src/core/wrapper/layout/layout.td.js | 4 +- 12 files changed, 107 insertions(+), 130 deletions(-) diff --git a/src/core/wrapper/layout.js b/src/core/wrapper/layout.js index badad1805..2bb053c6d 100644 --- a/src/core/wrapper/layout.js +++ b/src/core/wrapper/layout.js @@ -292,25 +292,6 @@ BI.Layout = BI.inherit(BI.Widget, { return (gap > 0 && gap < 1) ? (gap * 100).toFixed(1) + "%" : gap / BI.pixRatio + BI.pixUnit; }, - _optimiseItemLgap: function (item) { - return ((!item.type && item.el) ? item.lgap : item._lgap) || 0; - }, - _optimiseItemRgap: function (item) { - return ((!item.type && item.el) ? item.rgap : item._rgap) || 0; - }, - _optimiseItemTgap: function (item) { - return ((!item.type && item.el) ? item.tgap : item._tgap) || 0; - }, - _optimiseItemBgap: function (item) { - return ((!item.type && item.el) ? item.bgap : item._bgap) || 0; - }, - _optimiseItemHgap: function (item) { - return ((!item.type && item.el) ? item.hgap : item._hgap) || 0; - }, - _optimiseItemVgap: function (item) { - return ((!item.type && item.el) ? item.vgap : item._vgap) || 0; - }, - _handleGap: function (w, item, hIndex, vIndex) { var o = this.options; var innerLgap, innerRgap, innerTgap, innerBgap; @@ -323,26 +304,26 @@ BI.Layout = BI.inherit(BI.Widget, { innerTgap = vIndex === 0 ? o.innerVgap : 0; innerBgap = vIndex === o.items.length - 1 ? o.innerVgap : 0; } - if (o.vgap + o.tgap + innerTgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { - var top = ((BI.isNull(vIndex) || vIndex === 0) ? o.vgap : 0) + o.tgap + innerTgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); + if (o.vgap + o.tgap + innerTgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { + var top = ((BI.isNull(vIndex) || vIndex === 0) ? o.vgap : 0) + o.tgap + innerTgap + (item.tgap || 0) + (item.vgap || 0); w.element.css({ "margin-top": this._optimiseGap(top) }); } - if (o.hgap + o.lgap + innerLgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) { - var left = ((BI.isNull(hIndex) || hIndex === 0) ? o.hgap : 0) + o.lgap + innerLgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item); + if (o.hgap + o.lgap + innerLgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { + var left = ((BI.isNull(hIndex) || hIndex === 0) ? o.hgap : 0) + o.lgap + innerLgap + (item.lgap || 0) + (item.hgap || 0); w.element.css({ "margin-left": this._optimiseGap(left) }); } - if (o.hgap + o.rgap + innerRgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) { - var right = o.hgap + o.rgap + innerRgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item); + if (o.hgap + o.rgap + innerRgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { + var right = o.hgap + o.rgap + innerRgap + (item.rgap || 0) + (item.hgap || 0); w.element.css({ "margin-right": this._optimiseGap(right) }); } - if (o.vgap + o.bgap + innerBgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) { - var bottom = o.vgap + o.bgap + innerBgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); + if (o.vgap + o.bgap + innerBgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { + var bottom = o.vgap + o.bgap + innerBgap + (item.bgap || 0) + (item.vgap || 0); w.element.css({ "margin-bottom": this._optimiseGap(bottom) }); @@ -356,27 +337,27 @@ BI.Layout = BI.inherit(BI.Widget, { innerLgap = innerRgap = o.innerHgap; innerTgap = index === 0 ? o.innerVgap : 0; innerBgap = index === o.items.length - 1 ? o.innerVgap : 0; - if (o.vgap + o.tgap + innerTgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { - var top = (index === 0 ? o.vgap : 0) + (index === 0 ? o.tgap : 0) + innerTgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); + if (o.vgap + o.tgap + innerTgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { + var top = (index === 0 ? o.vgap : 0) + (index === 0 ? o.tgap : 0) + innerTgap + (item.tgap || 0) + (item.vgap || 0); w.element.css({ "margin-top": this._optimiseGap(top) }); } - if (o.hgap + o.lgap + innerLgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) { - var left = o.hgap + o.lgap + innerLgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item); + if (o.hgap + o.lgap + innerLgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { + var left = o.hgap + o.lgap + innerLgap + (item.lgap || 0) + (item.hgap || 0); w.element.css({ "margin-left": this._optimiseGap(left) }); } - if (o.hgap + o.rgap + innerRgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) { - var right = o.hgap + o.rgap + innerRgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item); + if (o.hgap + o.rgap + innerRgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { + var right = o.hgap + o.rgap + innerRgap + (item.rgap || 0) + (item.hgap || 0); w.element.css({ "margin-right": this._optimiseGap(right) }); } // 这里的代码是关键 - if (o.vgap + o.hgap + o.bgap + innerBgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) { - var bottom = (index === o.items.length - 1 ? o.vgap : o.hgap) + (index === o.items.length - 1 ? o.bgap : 0) + innerBgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); + if (o.vgap + o.hgap + o.bgap + innerBgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { + var bottom = (index === o.items.length - 1 ? o.vgap : o.hgap) + (index === o.items.length - 1 ? o.bgap : 0) + innerBgap + (item.bgap || 0) + (item.vgap || 0); w.element.css({ "margin-bottom": this._optimiseGap(bottom) }); diff --git a/src/core/wrapper/layout/adapt/absolute.center.js b/src/core/wrapper/layout/adapt/absolute.center.js index 14a122f00..67d37c4bc 100644 --- a/src/core/wrapper/layout/adapt/absolute.center.js +++ b/src/core/wrapper/layout/adapt/absolute.center.js @@ -30,10 +30,10 @@ BI.AbsoluteCenterLayout = BI.inherit(BI.Layout, { var w = BI.AbsoluteCenterLayout.superclass._addElement.apply(this, arguments); w.element.css({ position: "absolute", - left: this._optimiseGap(o.hgap + o.lgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item)), - right: this._optimiseGap(o.hgap + o.rgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item)), - top: this._optimiseGap(o.vgap + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item)), - bottom: this._optimiseGap(o.vgap + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item)), + left: this._optimiseGap(o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0)), + right: this._optimiseGap(o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0)), + top: this._optimiseGap(o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0)), + bottom: this._optimiseGap(o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0)), margin: "auto" }); return w; diff --git a/src/core/wrapper/layout/adapt/absolute.leftrightvertical.js b/src/core/wrapper/layout/adapt/absolute.leftrightvertical.js index 1aff2a7a9..148897cfe 100644 --- a/src/core/wrapper/layout/adapt/absolute.leftrightvertical.js +++ b/src/core/wrapper/layout/adapt/absolute.leftrightvertical.js @@ -56,17 +56,17 @@ BI.AbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { el: BI.stripEL(item), width: item.width }; - if (o.lvgap + o.ltgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { - json.tgap = o.lvgap + o.ltgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); + if (o.lvgap + o.ltgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { + json.tgap = o.lvgap + o.ltgap + (item.tgap || 0) + (item.vgap || 0); } - if (o.lhgap + o.llgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) { - json.lgap = (i === 0 ? o.lhgap : 0) + o.llgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item); + if (o.lhgap + o.llgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { + json.lgap = (i === 0 ? o.lhgap : 0) + o.llgap + (item.lgap || 0) + (item.hgap || 0); } - if (o.lhgap + o.lrgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) { - json.rgap = o.lhgap + o.lrgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item); + if (o.lhgap + o.lrgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { + json.rgap = o.lhgap + o.lrgap + (item.rgap || 0) + (item.hgap || 0); } - if (o.lvgap + o.lbgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) { - json.bgap = o.lvgap + o.lbgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); + if (o.lvgap + o.lbgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { + json.bgap = o.lvgap + o.lbgap + (item.bgap || 0) + (item.vgap || 0); } return json; }); @@ -75,17 +75,17 @@ BI.AbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { el: BI.stripEL(item), width: item.width }; - if (o.rvgap + o.rtgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { - json.tgap = o.rvgap + o.rtgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); + if (o.rvgap + o.rtgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { + json.tgap = o.rvgap + o.rtgap + (item.tgap || 0) + (item.vgap || 0); } - if (o.rhgap + o.rlgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) { - json.lgap = (i === 0 ? o.rhgap : 0) + o.rlgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item); + if (o.rhgap + o.rlgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { + json.lgap = (i === 0 ? o.rhgap : 0) + o.rlgap + (item.lgap || 0) + (item.hgap || 0); } - if (o.rhgap + o.rrgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) { - json.rgap = o.rhgap + o.rrgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item); + if (o.rhgap + o.rrgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { + json.rgap = o.rhgap + o.rrgap + (item.rgap || 0) + (item.hgap || 0); } - if (o.rvgap + o.rbgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) { - json.bgap = o.rvgap + o.rbgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); + if (o.rvgap + o.rbgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { + json.bgap = o.rvgap + o.rbgap + (item.bgap || 0) + (item.vgap || 0); } return json; }); diff --git a/src/core/wrapper/layout/adapt/adapt.table.js b/src/core/wrapper/layout/adapt/adapt.table.js index 5691840af..9af2aa8cc 100644 --- a/src/core/wrapper/layout/adapt/adapt.table.js +++ b/src/core/wrapper/layout/adapt/adapt.table.js @@ -70,8 +70,8 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, { td.element.width(width); } if (o.verticalAlign === BI.VerticalAlign.Stretch) { - var top = o.vgap + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item), - bottom = o.vgap + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); + var top = o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0), + bottom = o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0); w.element.css("height", "calc(100% - " + this._optimiseGap(top + bottom) + ")"); } // 对于表现为td的元素设置最大宽度,有几点需要注意 diff --git a/src/core/wrapper/layout/fill/auto.vtape.js b/src/core/wrapper/layout/fill/auto.vtape.js index efc784f5d..16491ebab 100644 --- a/src/core/wrapper/layout/fill/auto.vtape.js +++ b/src/core/wrapper/layout/fill/auto.vtape.js @@ -60,10 +60,10 @@ BI.AutoVerticalTapeLayout = BI.inherit(BI.Layout, { if (preRowSize === "") { preRowSize = self.layout.getWidgetByName(self._getChildName(i - 1)).element.height(); } - top[i] = top[i - 1] + preRowSize + self._optimiseItemTgap(items[i - 1]) + self._optimiseItemBgap(items[i - 1]) + 2 * self._optimiseItemVgap(items[i - 1]) + o.vgap + o.tgap + o.bgap; + top[i] = top[i - 1] + preRowSize + (items[i - 1].tgap || 0) + (items[i - 1].bgap || 0) + 2 * (items[i - 1].vgap || 0) + o.vgap + o.tgap + o.bgap; } w.element.css({ - top: self._optimiseGap(top[i] + self._optimiseItemTgap(item) + self._optimiseItemVgap(item) + o.vgap + o.tgap) + top: self._optimiseGap(top[i] + (item.vgap || 0) + (item.tgap || 0) + o.vgap + o.tgap) }); if (rowSize === "fill") { @@ -81,10 +81,10 @@ BI.AutoVerticalTapeLayout = BI.inherit(BI.Layout, { if (nextRowSize === "") { nextRowSize = self.layout.getWidgetByName(self._getChildName(i + 1)).element.height(); } - bottom[i] = bottom[i + 1] + nextRowSize + self._optimiseItemTgap(items[i + 1]) + self._optimiseItemBgap(items[i + 1]) + 2 * self._optimiseItemVgap(items[i + 1]) + o.vgap + o.tgap + o.bgap; + bottom[i] = bottom[i + 1] + nextRowSize + (items[i + 1].tgap || 0) + (items[i + 1].bgap || 0) + 2 * (items[i + 1].vgap || 0) + o.vgap + o.tgap + o.bgap; } w.element.css({ - bottom: self._optimiseGap(bottom[i] + self._optimiseItemBgap(item) + self._optimiseItemVgap(item) + o.vgap + o.bgap), + bottom: self._optimiseGap(bottom[i] + (item.vgap || 0) + (item.bgap || 0) + o.vgap + o.bgap), }); if (rowSize === "fill") { diff --git a/src/core/wrapper/layout/fill/float.fill.horizontal.js b/src/core/wrapper/layout/fill/float.fill.horizontal.js index 512ffb627..d6607703b 100644 --- a/src/core/wrapper/layout/fill/float.fill.horizontal.js +++ b/src/core/wrapper/layout/fill/float.fill.horizontal.js @@ -45,41 +45,41 @@ BI.FloatHorizontalFillLayout = BI.inherit(BI.Layout, { } else { var w = BI._lazyCreateWidget(item); } - if (o.vgap + o.tgap + self._optimiseItemTgap(item) + self._optimiseItemVgap(item) !== 0) { + if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { w.element.css({ - "margin-top": self._optimiseGap(o.vgap + o.tgap + self._optimiseItemTgap(item) + self._optimiseItemVgap(item)) + "margin-top": self._optimiseGap(o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0)) }); } if (desc) { - if (o.hgap + o.rgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) !== 0) { + if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { w.element.css({ - "margin-right": self._optimiseGap((i === o.items.length - 1 ? o.hgap : 0) + o.rgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item)) + "margin-right": self._optimiseGap((i === o.items.length - 1 ? o.hgap : 0) + o.rgap + (item.rgap || 0) + (item.hgap || 0)) }); } - if (o.hgap + o.lgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) !== 0) { + if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { w.element.css({ - "margin-left": self._optimiseGap(o.hgap + o.lgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item)) + "margin-left": self._optimiseGap(o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0)) }); } } else { - if (o.hgap + o.lgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) !== 0) { + if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { w.element.css({ - "margin-left": self._optimiseGap((i === 0 ? o.hgap : 0) + o.lgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item)) + "margin-left": self._optimiseGap((i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0)) }); } - if (o.hgap + o.rgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) !== 0) { + if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { w.element.css({ - "margin-right": self._optimiseGap(o.hgap + o.rgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item)) + "margin-right": self._optimiseGap(o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0)) }); } } - if (o.vgap + o.bgap + self._optimiseItemBgap(item) + self._optimiseItemVgap(item) !== 0) { + if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { w.element.css({ - "margin-bottom": self._optimiseGap(o.vgap + o.bgap + self._optimiseItemBgap(item) + self._optimiseItemVgap(item)) + "margin-bottom": self._optimiseGap(o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0)) }); } - var top = o.vgap + o.tgap + self._optimiseItemTgap(item) + self._optimiseItemVgap(item), - bottom = o.vgap + o.bgap + self._optimiseItemBgap(item) + self._optimiseItemVgap(item); + var top = o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0), + bottom = o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0); if (o.verticalAlign === BI.VerticalAlign.Stretch && BI.isNull(item.height)) { w.element.css({ height: "calc(100% - " + self._optimiseGap(top + bottom) + ")" diff --git a/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js b/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js index 01a462707..322d48fb4 100644 --- a/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js +++ b/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js @@ -35,7 +35,7 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { }, _formatItems: function (items) { - var self = this, o = this.options; + var o = this.options; var left, right; if (BI.isArray(items)) { BI.each(items, function (i, item) { @@ -53,17 +53,17 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { var json = { el: BI.stripEL(item) }; - if (o.lvgap + o.ltgap + self._optimiseItemTgap(item) + self._optimiseItemVgap(item) !== 0) { - json.tgap = o.lvgap + o.ltgap + self._optimiseItemTgap(item) + self._optimiseItemVgap(item); + if (o.lvgap + o.ltgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { + json.tgap = o.lvgap + o.ltgap + (item.tgap || 0) + (item.vgap || 0); } - if (o.lhgap + o.llgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) !== 0) { - json.lgap = (i === 0 ? o.lhgap : 0) + o.llgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item); + if (o.lhgap + o.llgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { + json.lgap = (i === 0 ? o.lhgap : 0) + o.llgap + (item.lgap || 0) + (item.hgap || 0); } - if (o.lhgap + o.lrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) !== 0) { - json.rgap = o.lhgap + o.lrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item); + if (o.lhgap + o.lrgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { + json.rgap = o.lhgap + o.lrgap + (item.rgap || 0) + (item.hgap || 0); } - if (o.lvgap + o.lbgap + self._optimiseItemBgap(item) + self._optimiseItemVgap(item) !== 0) { - json.bgap = o.lvgap + o.lbgap + self._optimiseItemBgap(item) + self._optimiseItemVgap(item); + if (o.lvgap + o.lbgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { + json.bgap = o.lvgap + o.lbgap + (item.bgap || 0) + (item.vgap || 0); } return json; }); diff --git a/src/core/wrapper/layout/float/float.absolute.leftrightvertical.js b/src/core/wrapper/layout/float/float.absolute.leftrightvertical.js index 9de105651..26bea2558 100644 --- a/src/core/wrapper/layout/float/float.absolute.leftrightvertical.js +++ b/src/core/wrapper/layout/float/float.absolute.leftrightvertical.js @@ -38,7 +38,7 @@ BI.FloatAbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { }, _formatItems: function (items) { - var self = this, o = this.options; + var o = this.options; var left, right; if (BI.isArray(items)) { BI.each(items, function (i, item) { @@ -68,11 +68,11 @@ BI.FloatAbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { // if (o.lvgap + o.ltgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { // json.tgap = o.lvgap + o.ltgap + (item.tgap || 0) + (item.vgap || 0); // } - if (o.lhgap + o.llgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) !== 0) { - json.lgap = (i === 0 ? o.lhgap : 0) + o.llgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item); + if (o.lhgap + o.llgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { + json.lgap = (i === 0 ? o.lhgap : 0) + o.llgap + (item.lgap || 0) + (item.hgap || 0); } - if (o.lhgap + o.lrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) !== 0) { - json.rgap = o.lhgap + o.lrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item); + if (o.lhgap + o.lrgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { + json.rgap = o.lhgap + o.lrgap + (item.rgap || 0) + (item.hgap || 0); } // if (o.lvgap + o.lbgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { // json.bgap = o.lvgap + o.lbgap + (item.bgap || 0) + (item.vgap || 0); @@ -95,11 +95,11 @@ BI.FloatAbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { // if (o.rvgap + o.rtgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { // json.tgap = o.rvgap + o.rtgap + (item.tgap || 0) + (item.vgap || 0); // } - if (o.rhgap + o.rlgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) !== 0) { - json.lgap = (i === 0 ? o.rhgap : 0) + o.rlgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item); + if (o.rhgap + o.rlgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { + json.lgap = (i === 0 ? o.rhgap : 0) + o.rlgap + (item.lgap || 0) + (item.hgap || 0); } - if (o.rhgap + o.rrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) !== 0) { - json.rgap = o.rhgap + o.rrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item); + if (o.rhgap + o.rrgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { + json.rgap = o.rhgap + o.rrgap + (item.rgap || 0) + (item.hgap || 0); } // if (o.rvgap + o.rbgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { // json.bgap = o.rvgap + o.rbgap + (item.bgap || 0) + (item.vgap || 0); diff --git a/src/core/wrapper/layout/layout.flow.js b/src/core/wrapper/layout/layout.flow.js index e3c26638d..4efc35123 100644 --- a/src/core/wrapper/layout/layout.flow.js +++ b/src/core/wrapper/layout/layout.flow.js @@ -56,26 +56,26 @@ BI.FloatLeftLayout = BI.inherit(BI.Layout, { if (BI.isNotNull(item.bottom)) { w.element.css({bottom: BI.isNumber(item.bottom) ? this._optimiseGap(item.bottom) : item.bottom}); } - if (o.vgap + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { - var top = o.vgap / 2 + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); + if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { + var top = o.vgap / 2 + o.tgap + (item.tgap || 0) + (item.vgap || 0); w.element.css({ "margin-top": this._optimiseGap(top) }); } - if (o.hgap + o.lgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) { - var left = o.hgap / 2 + o.lgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item); + if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { + var left = o.hgap / 2 + o.lgap + (item.lgap || 0) + (item.hgap || 0); w.element.css({ "margin-left": this._optimiseGap(left) }); } - if (o.hgap + o.rgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) { - var right = o.hgap / 2 + o.rgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item); + if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { + var right = o.hgap / 2 + o.rgap + (item.rgap || 0) + (item.hgap || 0); w.element.css({ "margin-right": this._optimiseGap(right) }); } - if (o.vgap + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) { - var bottom = o.vgap / 2 + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); + if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { + var bottom = o.vgap / 2 + o.bgap + (item.bgap || 0) + (item.vgap || 0); w.element.css({ "margin-bottom": this._optimiseGap(bottom) }); @@ -148,28 +148,24 @@ BI.FloatRightLayout = BI.inherit(BI.Layout, { if (BI.isNotNull(item.bottom)) { w.element.css({bottom: BI.isNumber(item.bottom) ? item.bottom / BI.pixRatio + BI.pixUnit : item.bottom}); } - if (o.vgap + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { - var top = o.vgap / 2 + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); + if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { w.element.css({ - "margin-top": this._optimiseGap(top) + "margin-top": (o.vgap / 2 + o.tgap + (item.tgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit }); } - if (o.hgap + o.lgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) { - var left = o.hgap / 2 + o.lgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item); + if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { w.element.css({ - "margin-left": this._optimiseGap(left) + "margin-left": (o.hgap / 2 + o.lgap + (item.lgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit }); } - if (o.hgap + o.rgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) { - var right = o.hgap / 2 + o.rgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item); + if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { w.element.css({ - "margin-right": this._optimiseGap(right) + "margin-right": (o.hgap / 2 + o.rgap + (item.rgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit }); } - if (o.vgap + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) { - var bottom = o.vgap / 2 + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); + if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { w.element.css({ - "margin-bottom": this._optimiseGap(bottom) + "margin-bottom": (o.vgap / 2 + o.bgap + (item.bgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit }); } return w; diff --git a/src/core/wrapper/layout/layout.inline.js b/src/core/wrapper/layout/layout.inline.js index 99fa1b96e..04b38a47a 100644 --- a/src/core/wrapper/layout/layout.inline.js +++ b/src/core/wrapper/layout/layout.inline.js @@ -66,7 +66,7 @@ BI.InlineLayout = BI.inherit(BI.Layout, { autoCount++; cz = 0; } - gap += o.hgap + o.lgap + o.rgap + this._optimiseItemLgap(o.items[k]) + this._optimiseItemRgap(o.items[k]) + this._optimiseItemHgap(o.items[k]); + gap += o.hgap + o.lgap + o.rgap + (o.items[k].lgap || 0) + (o.items[k].rgap || 0) + (o.items[k].hgap || 0); length += cz; } length = length > 0 && length < 1 ? (length * 100).toFixed(1) + "%" : length / BI.pixRatio + BI.pixUnit; @@ -84,8 +84,8 @@ BI.InlineLayout = BI.inherit(BI.Layout, { } this._handleGap(w, item, i); if (o.verticalAlign === BI.VerticalAlign.Stretch && BI.isNull(item.height)) { - var top = o.innerVgap + o.vgap + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item), - bottom = o.innerVgap + o.vgap + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); + var top = o.innerVgap + o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0), + bottom = o.innerVgap + o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0); var gap = (top + bottom) > 0 && (top + bottom) < 1 ? ((top + bottom) * 100).toFixed(1) + "%" : (top + bottom) / BI.pixRatio + BI.pixUnit; w.element.css("height", "calc(100% - " + gap + ")"); } diff --git a/src/core/wrapper/layout/layout.tape.js b/src/core/wrapper/layout/layout.tape.js index a3fa8bcf0..8652862da 100644 --- a/src/core/wrapper/layout/layout.tape.js +++ b/src/core/wrapper/layout/layout.tape.js @@ -53,8 +53,8 @@ BI.HTapeLayout = BI.inherit(BI.Layout, { } w.element.css({ position: "absolute", - top: self._optimiseGap(self._optimiseItemTgap(item) + self._optimiseItemVgap(item) + o.innerVgap + o.vgap + o.tgap), - bottom: self._optimiseGap(self._optimiseItemBgap(item) + self._optimiseItemVgap(item) + o.innerVgap + o.vgap + o.bgap), + top: self._optimiseGap((item.vgap || 0) + (item.tgap || 0) + o.innerVgap + o.vgap + o.tgap), + bottom: self._optimiseGap((item.bgap || 0) + (item.vgap || 0) + o.innerVgap + o.vgap + o.bgap), width: BI.isNumber(columnSize) ? self._optimiseGap(columnSize) : "" }); if (o.verticalAlign === BI.VerticalAlign.Middle) { @@ -86,10 +86,10 @@ BI.HTapeLayout = BI.inherit(BI.Layout, { } if (BI.isNull(left[i])) { var preColumnSize = o.columnSize.length > 0 ? o.columnSize[i - 1] : items[i - 1].width; - left[i] = left[i - 1] + preColumnSize + self._optimiseItemLgap(items[i - 1]) + self._optimiseItemRgap(items[i - 1]) + 2 * self._optimiseItemHgap(items[i - 1]) + o.hgap + o.lgap + o.rgap; + left[i] = left[i - 1] + preColumnSize + (items[i - 1].lgap || 0) + (items[i - 1].rgap || 0) + 2 * (items[i - 1].hgap || 0) + o.hgap + o.lgap + o.rgap; } w.element.css({ - left: self._optimiseGap(left[i] + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) + o.hgap + o.lgap) + left: self._optimiseGap(left[i] + (item.lgap || 0) + (item.hgap || 0) + o.hgap + o.lgap) }); if (columnSize === "" || columnSize === "fill") { @@ -104,10 +104,10 @@ BI.HTapeLayout = BI.inherit(BI.Layout, { var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width; if (BI.isNull(right[i])) { var nextColumnSize = o.columnSize.length > 0 ? o.columnSize[i + 1] : items[i + 1].width; - right[i] = right[i + 1] + nextColumnSize + self._optimiseItemLgap(items[i + 1]) + self._optimiseItemRgap(items[i + 1]) + 2 * self._optimiseItemHgap(items[i + 1]) + o.hgap + o.lgap + o.rgap; + right[i] = right[i + 1] + nextColumnSize + (items[i + 1].lgap || 0) + (items[i + 1].rgap || 0) + 2 * (items[i + 1].hgap || 0) + o.hgap + o.lgap + o.rgap; } w.element.css({ - right: self._optimiseGap(right[i] + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) + o.hgap + o.rgap) + right: self._optimiseGap(right[i] + (item.rgap || 0) + (item.hgap || 0) + o.hgap + o.rgap) }); if (columnSize === "" || columnSize === "fill") { @@ -178,8 +178,8 @@ BI.VTapeLayout = BI.inherit(BI.Layout, { } w.element.css({ position: "absolute", - left: self._optimiseGap(self._optimiseItemLgap(item) + self._optimiseItemHgap(item) + o.innerHgap + o.hgap + o.lgap), - right: self._optimiseGap(self._optimiseItemRgap(item) + self._optimiseItemHgap(item) + o.innerHgap + o.hgap + o.rgap), + left: self._optimiseGap((item.lgap || 0) + (item.hgap || 0) + o.innerHgap + o.hgap + o.lgap), + right: self._optimiseGap((item.hgap || 0) + (item.rgap || 0) + o.innerHgap + o.hgap + o.rgap), height: BI.isNumber(rowSize) ? self._optimiseGap(rowSize) : "" }); if (o.horizontalAlign === BI.HorizontalAlign.Center) { @@ -211,10 +211,10 @@ BI.VTapeLayout = BI.inherit(BI.Layout, { } if (BI.isNull(top[i])) { var preRowSize = o.rowSize.length > 0 ? o.rowSize[i - 1] : items[i - 1].height; - top[i] = top[i - 1] + preRowSize + self._optimiseItemTgap(items[i - 1]) + self._optimiseItemBgap(items[i - 1]) + 2 * self._optimiseItemVgap(items[i - 1]) + o.vgap + o.tgap + o.bgap; + top[i] = top[i - 1] + preRowSize + (items[i - 1].tgap || 0) + (items[i - 1].bgap || 0) + 2 * (items[i - 1].vgap || 0) + o.vgap + o.tgap + o.bgap; } w.element.css({ - top: self._optimiseGap(top[i] + self._optimiseItemTgap(item) + self._optimiseItemVgap(item) + o.vgap + o.tgap) + top: self._optimiseGap(top[i] + (item.vgap || 0) + (item.tgap || 0) + o.vgap + o.tgap) }); if (rowSize === "" || rowSize === "fill") { @@ -229,10 +229,10 @@ BI.VTapeLayout = BI.inherit(BI.Layout, { var rowSize = o.rowSize.length > 0 ? o.rowSize[i] : item.height; if (BI.isNull(bottom[i])) { var nextRowSize = o.rowSize.length > 0 ? o.rowSize[i + 1] : items[i + 1].height; - bottom[i] = bottom[i + 1] + nextRowSize + self._optimiseItemTgap(items[i + 1]) + self._optimiseItemBgap(items[i + 1]) + 2 * self._optimiseItemVgap(items[i + 1]) + o.vgap + o.tgap + o.bgap; + bottom[i] = bottom[i + 1] + nextRowSize + (items[i + 1].tgap || 0) + (items[i + 1].bgap || 0) + 2 * (items[i + 1].vgap || 0) + o.vgap + o.tgap + o.bgap; } w.element.css({ - bottom: self._optimiseGap(bottom[i] + self._optimiseItemBgap(item) + self._optimiseItemVgap(item) + o.vgap + o.bgap) + bottom: self._optimiseGap(bottom[i] + (item.vgap || 0) + (item.bgap || 0) + o.vgap + o.bgap) }); if (rowSize === "" || rowSize === "fill") { diff --git a/src/core/wrapper/layout/layout.td.js b/src/core/wrapper/layout/layout.td.js index cb3221570..17a469754 100644 --- a/src/core/wrapper/layout/layout.td.js +++ b/src/core/wrapper/layout/layout.td.js @@ -92,8 +92,8 @@ BI.TdLayout = BI.inherit(BI.Layout, { for (var i = 0; i < arr.length; i++) { var w = BI._lazyCreateWidget(arr[i]); if (o.verticalAlign === BI.VerticalAlign.Stretch) { - var top = o.vgap + o.tgap + this._optimiseItemTgap(arr[i]) + this._optimiseItemVgap(arr[i]), - bottom = o.vgap + o.bgap + this._optimiseItemBgap(arr[i]) + this._optimiseItemVgap(arr[i]); + var top = o.vgap + o.tgap + (arr[i].tgap || 0) + (arr[i].vgap || 0), + bottom = o.vgap + o.bgap + (arr[i].bgap || 0) + (arr[i].vgap || 0); w.element.css("height", "calc(100% - " + this._optimiseGap(top + bottom) + ")"); } w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"}); From 6b4d0dbb3417319311bbcd86706b37cce935d582 Mon Sep 17 00:00:00 2001 From: zsmj Date: Thu, 12 May 2022 17:03:56 +0800 Subject: [PATCH 50/60] =?UTF-8?q?Revert=20"feature:=20=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E6=94=AF=E6=8C=81=5Flgap"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6cce574f7e83ae0809c14889886d3d8e5cbc239d. --- src/core/wrapper/layout/sticky/sticky.horizontal.js | 3 +-- src/core/wrapper/layout/sticky/sticky.vertical.js | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/core/wrapper/layout/sticky/sticky.horizontal.js b/src/core/wrapper/layout/sticky/sticky.horizontal.js index a59dd6edf..c5b644542 100644 --- a/src/core/wrapper/layout/sticky/sticky.horizontal.js +++ b/src/core/wrapper/layout/sticky/sticky.horizontal.js @@ -5,8 +5,7 @@ BI.HorizontalStickyLayout = BI.inherit(BI.FlexHorizontalLayout, { props: function () { return BI.extend(BI.HorizontalStickyLayout.superclass.props.apply(this, arguments), { extraCls: "bi-h-sticky", - scrollx: true, - // horizontalAlign: BI.HorizontalAlign.Stretch, + horizontalAlign: BI.HorizontalAlign.Stretch, verticalAlign: BI.VerticalAlign.Stretch }); }, diff --git a/src/core/wrapper/layout/sticky/sticky.vertical.js b/src/core/wrapper/layout/sticky/sticky.vertical.js index 970d84eef..a5ba3d837 100644 --- a/src/core/wrapper/layout/sticky/sticky.vertical.js +++ b/src/core/wrapper/layout/sticky/sticky.vertical.js @@ -5,9 +5,8 @@ BI.VerticalStickyLayout = BI.inherit(BI.FlexVerticalLayout, { props: function () { return BI.extend(BI.VerticalStickyLayout.superclass.props.apply(this, arguments), { extraCls: "bi-v-sticky", - scrolly: true, horizontalAlign: BI.HorizontalAlign.Stretch, - // verticalAlign: BI.VerticalAlign.Stretch + verticalAlign: BI.VerticalAlign.Stretch }); }, From 8fcbd104593e93e17807439087e9be624c8bba02 Mon Sep 17 00:00:00 2001 From: data Date: Thu, 12 May 2022 17:35:26 +0800 Subject: [PATCH 51/60] auto upgrade version to 2.0.20220512173520 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d75528406..5d53290b3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220512151342", + "version": "2.0.20220512173520", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From ff22d7cb2e89a482873a597b0ebd81b46b450c84 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 13 May 2022 10:02:15 +0800 Subject: [PATCH 52/60] =?UTF-8?q?feature:=20=E5=B8=83=E5=B1=80=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=86=99=E6=B3=95=EF=BC=8C=E4=B8=BA=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=81=9A=E5=87=86=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/wrapper/layout.js | 51 +++-- .../wrapper/layout/adapt/absolute.center.js | 8 +- .../layout/adapt/adapt.leftrightvertical.js | 215 ++++++------------ src/core/wrapper/layout/adapt/adapt.table.js | 4 +- src/core/wrapper/layout/fill/auto.vtape.js | 8 +- .../layout/fill/float.fill.horizontal.js | 28 +-- .../flex/flex.leftrightvertical.center.js | 18 +- .../float/float.absolute.leftrightvertical.js | 18 +- src/core/wrapper/layout/layout.flow.js | 36 +-- src/core/wrapper/layout/layout.inline.js | 6 +- src/core/wrapper/layout/layout.tape.js | 24 +- src/core/wrapper/layout/layout.td.js | 4 +- .../layout/sticky/sticky.horizontal.js | 3 +- .../wrapper/layout/sticky/sticky.vertical.js | 3 +- 14 files changed, 192 insertions(+), 234 deletions(-) diff --git a/src/core/wrapper/layout.js b/src/core/wrapper/layout.js index 2bb053c6d..a79b3775b 100644 --- a/src/core/wrapper/layout.js +++ b/src/core/wrapper/layout.js @@ -292,6 +292,25 @@ BI.Layout = BI.inherit(BI.Widget, { return (gap > 0 && gap < 1) ? (gap * 100).toFixed(1) + "%" : gap / BI.pixRatio + BI.pixUnit; }, + _optimiseItemLgap: function (item) { + return item.lgap || 0; + }, + _optimiseItemRgap: function (item) { + return item.rgap || 0; + }, + _optimiseItemTgap: function (item) { + return item.tgap || 0; + }, + _optimiseItemBgap: function (item) { + return item.bgap || 0; + }, + _optimiseItemHgap: function (item) { + return item.hgap || 0; + }, + _optimiseItemVgap: function (item) { + return item.vgap || 0; + }, + _handleGap: function (w, item, hIndex, vIndex) { var o = this.options; var innerLgap, innerRgap, innerTgap, innerBgap; @@ -304,26 +323,26 @@ BI.Layout = BI.inherit(BI.Widget, { innerTgap = vIndex === 0 ? o.innerVgap : 0; innerBgap = vIndex === o.items.length - 1 ? o.innerVgap : 0; } - if (o.vgap + o.tgap + innerTgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { - var top = ((BI.isNull(vIndex) || vIndex === 0) ? o.vgap : 0) + o.tgap + innerTgap + (item.tgap || 0) + (item.vgap || 0); + if (o.vgap + o.tgap + innerTgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { + var top = ((BI.isNull(vIndex) || vIndex === 0) ? o.vgap : 0) + o.tgap + innerTgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); w.element.css({ "margin-top": this._optimiseGap(top) }); } - if (o.hgap + o.lgap + innerLgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { - var left = ((BI.isNull(hIndex) || hIndex === 0) ? o.hgap : 0) + o.lgap + innerLgap + (item.lgap || 0) + (item.hgap || 0); + if (o.hgap + o.lgap + innerLgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) { + var left = ((BI.isNull(hIndex) || hIndex === 0) ? o.hgap : 0) + o.lgap + innerLgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item); w.element.css({ "margin-left": this._optimiseGap(left) }); } - if (o.hgap + o.rgap + innerRgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { - var right = o.hgap + o.rgap + innerRgap + (item.rgap || 0) + (item.hgap || 0); + if (o.hgap + o.rgap + innerRgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) { + var right = o.hgap + o.rgap + innerRgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item); w.element.css({ "margin-right": this._optimiseGap(right) }); } - if (o.vgap + o.bgap + innerBgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { - var bottom = o.vgap + o.bgap + innerBgap + (item.bgap || 0) + (item.vgap || 0); + if (o.vgap + o.bgap + innerBgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) { + var bottom = o.vgap + o.bgap + innerBgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); w.element.css({ "margin-bottom": this._optimiseGap(bottom) }); @@ -337,27 +356,27 @@ BI.Layout = BI.inherit(BI.Widget, { innerLgap = innerRgap = o.innerHgap; innerTgap = index === 0 ? o.innerVgap : 0; innerBgap = index === o.items.length - 1 ? o.innerVgap : 0; - if (o.vgap + o.tgap + innerTgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { - var top = (index === 0 ? o.vgap : 0) + (index === 0 ? o.tgap : 0) + innerTgap + (item.tgap || 0) + (item.vgap || 0); + if (o.vgap + o.tgap + innerTgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { + var top = (index === 0 ? o.vgap : 0) + (index === 0 ? o.tgap : 0) + innerTgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); w.element.css({ "margin-top": this._optimiseGap(top) }); } - if (o.hgap + o.lgap + innerLgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { - var left = o.hgap + o.lgap + innerLgap + (item.lgap || 0) + (item.hgap || 0); + if (o.hgap + o.lgap + innerLgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) { + var left = o.hgap + o.lgap + innerLgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item); w.element.css({ "margin-left": this._optimiseGap(left) }); } - if (o.hgap + o.rgap + innerRgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { - var right = o.hgap + o.rgap + innerRgap + (item.rgap || 0) + (item.hgap || 0); + if (o.hgap + o.rgap + innerRgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) { + var right = o.hgap + o.rgap + innerRgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item); w.element.css({ "margin-right": this._optimiseGap(right) }); } // 这里的代码是关键 - if (o.vgap + o.hgap + o.bgap + innerBgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { - var bottom = (index === o.items.length - 1 ? o.vgap : o.hgap) + (index === o.items.length - 1 ? o.bgap : 0) + innerBgap + (item.bgap || 0) + (item.vgap || 0); + if (o.vgap + o.hgap + o.bgap + innerBgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) { + var bottom = (index === o.items.length - 1 ? o.vgap : o.hgap) + (index === o.items.length - 1 ? o.bgap : 0) + innerBgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); w.element.css({ "margin-bottom": this._optimiseGap(bottom) }); diff --git a/src/core/wrapper/layout/adapt/absolute.center.js b/src/core/wrapper/layout/adapt/absolute.center.js index 67d37c4bc..14a122f00 100644 --- a/src/core/wrapper/layout/adapt/absolute.center.js +++ b/src/core/wrapper/layout/adapt/absolute.center.js @@ -30,10 +30,10 @@ BI.AbsoluteCenterLayout = BI.inherit(BI.Layout, { var w = BI.AbsoluteCenterLayout.superclass._addElement.apply(this, arguments); w.element.css({ position: "absolute", - left: this._optimiseGap(o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0)), - right: this._optimiseGap(o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0)), - top: this._optimiseGap(o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0)), - bottom: this._optimiseGap(o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0)), + left: this._optimiseGap(o.hgap + o.lgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item)), + right: this._optimiseGap(o.hgap + o.rgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item)), + top: this._optimiseGap(o.vgap + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item)), + bottom: this._optimiseGap(o.vgap + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item)), margin: "auto" }); return w; diff --git a/src/core/wrapper/layout/adapt/adapt.leftrightvertical.js b/src/core/wrapper/layout/adapt/adapt.leftrightvertical.js index cafc1dafb..1aff2a7a9 100644 --- a/src/core/wrapper/layout/adapt/adapt.leftrightvertical.js +++ b/src/core/wrapper/layout/adapt/adapt.leftrightvertical.js @@ -1,16 +1,8 @@ -/** - * 左右分离,垂直方向居中容器 - * items:{ - left: [{el:{type:"bi.button"}}], - right:[{el:{type:"bi.button"}}] - } - * @class BI.LeftRightVerticalAdaptLayout - * @extends BI.Layout - */ -BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { +BI.AbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { props: function () { - return BI.extend(BI.LeftRightVerticalAdaptLayout.superclass.props.apply(this, arguments), { - baseCls: "bi-lr-v-a", + return BI.extend(BI.AbsoluteLeftRightVerticalAdaptLayout.superclass.props.apply(this, arguments), { + baseCls: "bi-abs-lr-v-a", + verticalAlign: BI.VerticalAlign.Middle, items: {}, llgap: 0, lrgap: 0, @@ -28,59 +20,24 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { }, render: function () { var o = this.options, self = this; - BI.LeftRightVerticalAdaptLayout.superclass.render.apply(this, arguments); - var leftRight = this._getLeftRight(o.items); - var layoutArray = []; - if (leftRight.left || "left" in o.items) { - layoutArray.push({ - type: "bi.left", - lgap: o.innerHgap, - vgap: o.innerVgap, - items: [{ - el: { - type: "bi.vertical_adapt", - ref: function (_ref) { - self.left = _ref; - }, - height: "100%", - items: leftRight.left || o.items.left, - hgap: o.lhgap, - lgap: o.llgap, - rgap: o.lrgap, - tgap: o.ltgap, - bgap: o.lbgap, - vgap: o.lvgap - } - }] - }); - } - if (leftRight.right || "right" in o.items) { - layoutArray.push({ - type: "bi.right", - rgap: o.innerHgap, - vgap: o.innerVgap, - items: [{ - el: { - type: "bi.vertical_adapt", - ref: function (_ref) { - self.right = _ref; - }, - height: "100%", - items: leftRight.right || o.items.right, - hgap: o.rhgap, - lgap: o.rlgap, - rgap: o.rrgap, - tgap: o.rtgap, - bgap: o.rbgap, - vgap: o.rvgap - } - }] - }); - } - return layoutArray; + BI.AbsoluteLeftRightVerticalAdaptLayout.superclass.render.apply(this, arguments); + return { + type: "bi.htape", + innerHgap: o.innerHgap, + innerVgap: o.innerVgap, + ref: function (_ref) { + self.layout = _ref; + }, + verticalAlign: o.verticalAlign, + items: this._formatItems(o.items), + scrollx: o.scrollx, + scrolly: o.scrolly, + scrollable: o.scrollable + }; }, - _getLeftRight: function (items) { + _formatItems: function (items) { + var o = this.options; var left, right; if (BI.isArray(items)) { BI.each(items, function (i, item) { @@ -92,72 +49,51 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { } }); } - return { - left: left, - right: right - }; - }, - - resize: function () { - var leftRight = this._getLeftRight(this.options.items); - this.left.stroke(leftRight.left || this.options.items.left); - this.right.stroke(leftRight.right || this.options.items.right); - }, - - addItem: function () { - // do nothing - throw new Error("不能添加子组件"); - }, - - populate: function (items) { - var leftRight = this._getLeftRight(items); - this.left.populate(leftRight.left || items.left); - this.right.populate(leftRight.right || items.right); - } -}); -BI.shortcut("bi.left_right_vertical_adapt", BI.LeftRightVerticalAdaptLayout); - - -BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, { - props: function () { - return BI.extend(BI.LeftRightVerticalAdaptLayout.superclass.props.apply(this, arguments), { - baseCls: "bi-l-v-a", - items: [], - columnSize: [], - lgap: 0, - rgap: 0, - hgap: 0, - tgap: 0, - bgap: 0, - vgap: 0 + var leftItems = left || items.left || []; + var rightItems = right || items.right || []; + leftItems = BI.map(leftItems, function (i, item) { + var json = { + el: BI.stripEL(item), + width: item.width + }; + if (o.lvgap + o.ltgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { + json.tgap = o.lvgap + o.ltgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); + } + if (o.lhgap + o.llgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) { + json.lgap = (i === 0 ? o.lhgap : 0) + o.llgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item); + } + if (o.lhgap + o.lrgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) { + json.rgap = o.lhgap + o.lrgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item); + } + if (o.lvgap + o.lbgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) { + json.bgap = o.lvgap + o.lbgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); + } + return json; }); - }, - render: function () { - var o = this.options, self = this; - BI.LeftVerticalAdaptLayout.superclass.render.apply(this, arguments); - return { - type: "bi.vertical_adapt", - ref: function (_ref) { - self.layout = _ref; - }, - items: o.items, - columnSize: o.columnSize, - hgap: o.hgap, - lgap: o.lgap, - rgap: o.rgap, - tgap: o.tgap, - bgap: o.bgap, - vgap: o.vgap, - innerHgap: o.innerHgap, - innerVgap: o.innerVgap, - scrollx: o.scrollx, - scrolly: o.scrolly, - scrollable: o.scrollable - }; + rightItems = BI.map(rightItems, function (i, item) { + var json = { + el: BI.stripEL(item), + width: item.width + }; + if (o.rvgap + o.rtgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { + json.tgap = o.rvgap + o.rtgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); + } + if (o.rhgap + o.rlgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) { + json.lgap = (i === 0 ? o.rhgap : 0) + o.rlgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item); + } + if (o.rhgap + o.rrgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) { + json.rgap = o.rhgap + o.rrgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item); + } + if (o.rvgap + o.rbgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) { + json.bgap = o.rvgap + o.rbgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); + } + return json; + }); + return leftItems.concat({}, rightItems); }, resize: function () { - this.layout.resize(); + this.layout.stroke(this._formatItems(this.options.items)); }, addItem: function () { @@ -166,17 +102,17 @@ BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, { }, populate: function (items) { - this.layout.populate.apply(this, arguments); + this.layout.populate(this._formatItems(items)); } }); -BI.shortcut("bi.left_vertical_adapt", BI.LeftVerticalAdaptLayout); +BI.shortcut("bi.absolute_left_right_vertical_adapt", BI.AbsoluteLeftRightVerticalAdaptLayout); -BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, { +BI.AbsoluteRightVerticalAdaptLayout = BI.inherit(BI.Layout, { props: function () { - return BI.extend(BI.RightVerticalAdaptLayout.superclass.props.apply(this, arguments), { - baseCls: "bi-r-v-a", + return BI.extend(BI.AbsoluteRightVerticalAdaptLayout.superclass.props.apply(this, arguments), { + baseCls: "bi-abs-r-v-a", + verticalAlign: BI.VerticalAlign.Middle, items: [], - columnSize: [], lgap: 0, rgap: 0, hgap: 0, @@ -187,23 +123,20 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, { }, render: function () { var o = this.options, self = this; - BI.RightVerticalAdaptLayout.superclass.render.apply(this, arguments); + BI.AbsoluteRightVerticalAdaptLayout.superclass.render.apply(this, arguments); return { - type: "bi.vertical_adapt", + type: "bi.htape", ref: function (_ref) { self.layout = _ref; }, - horizontalAlign: BI.HorizontalAlign.Right, - items: o.items, - columnSize: o.columnSize, + verticalAlign: o.verticalAlign, + items: [{}].concat(o.items), hgap: o.hgap, lgap: o.lgap, rgap: o.rgap, tgap: o.tgap, bgap: o.bgap, vgap: o.vgap, - innerHgap: o.innerHgap, - innerVgap: o.innerVgap, scrollx: o.scrollx, scrolly: o.scrolly, scrollable: o.scrollable @@ -211,7 +144,7 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, { }, resize: function () { - this.layout.resize(); + this.layout.stroke([{}].concat(this.options.items)); }, addItem: function () { @@ -220,7 +153,7 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, { }, populate: function (items) { - this.layout.populate(items); + this.layout.populate([{}].concat(items)); } }); -BI.shortcut("bi.right_vertical_adapt", BI.RightVerticalAdaptLayout); +BI.shortcut("bi.absolute_right_vertical_adapt", BI.AbsoluteRightVerticalAdaptLayout); diff --git a/src/core/wrapper/layout/adapt/adapt.table.js b/src/core/wrapper/layout/adapt/adapt.table.js index 9af2aa8cc..5691840af 100644 --- a/src/core/wrapper/layout/adapt/adapt.table.js +++ b/src/core/wrapper/layout/adapt/adapt.table.js @@ -70,8 +70,8 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, { td.element.width(width); } if (o.verticalAlign === BI.VerticalAlign.Stretch) { - var top = o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0), - bottom = o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0); + var top = o.vgap + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item), + bottom = o.vgap + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); w.element.css("height", "calc(100% - " + this._optimiseGap(top + bottom) + ")"); } // 对于表现为td的元素设置最大宽度,有几点需要注意 diff --git a/src/core/wrapper/layout/fill/auto.vtape.js b/src/core/wrapper/layout/fill/auto.vtape.js index 16491ebab..efc784f5d 100644 --- a/src/core/wrapper/layout/fill/auto.vtape.js +++ b/src/core/wrapper/layout/fill/auto.vtape.js @@ -60,10 +60,10 @@ BI.AutoVerticalTapeLayout = BI.inherit(BI.Layout, { if (preRowSize === "") { preRowSize = self.layout.getWidgetByName(self._getChildName(i - 1)).element.height(); } - top[i] = top[i - 1] + preRowSize + (items[i - 1].tgap || 0) + (items[i - 1].bgap || 0) + 2 * (items[i - 1].vgap || 0) + o.vgap + o.tgap + o.bgap; + top[i] = top[i - 1] + preRowSize + self._optimiseItemTgap(items[i - 1]) + self._optimiseItemBgap(items[i - 1]) + 2 * self._optimiseItemVgap(items[i - 1]) + o.vgap + o.tgap + o.bgap; } w.element.css({ - top: self._optimiseGap(top[i] + (item.vgap || 0) + (item.tgap || 0) + o.vgap + o.tgap) + top: self._optimiseGap(top[i] + self._optimiseItemTgap(item) + self._optimiseItemVgap(item) + o.vgap + o.tgap) }); if (rowSize === "fill") { @@ -81,10 +81,10 @@ BI.AutoVerticalTapeLayout = BI.inherit(BI.Layout, { if (nextRowSize === "") { nextRowSize = self.layout.getWidgetByName(self._getChildName(i + 1)).element.height(); } - bottom[i] = bottom[i + 1] + nextRowSize + (items[i + 1].tgap || 0) + (items[i + 1].bgap || 0) + 2 * (items[i + 1].vgap || 0) + o.vgap + o.tgap + o.bgap; + bottom[i] = bottom[i + 1] + nextRowSize + self._optimiseItemTgap(items[i + 1]) + self._optimiseItemBgap(items[i + 1]) + 2 * self._optimiseItemVgap(items[i + 1]) + o.vgap + o.tgap + o.bgap; } w.element.css({ - bottom: self._optimiseGap(bottom[i] + (item.vgap || 0) + (item.bgap || 0) + o.vgap + o.bgap), + bottom: self._optimiseGap(bottom[i] + self._optimiseItemBgap(item) + self._optimiseItemVgap(item) + o.vgap + o.bgap), }); if (rowSize === "fill") { diff --git a/src/core/wrapper/layout/fill/float.fill.horizontal.js b/src/core/wrapper/layout/fill/float.fill.horizontal.js index d6607703b..512ffb627 100644 --- a/src/core/wrapper/layout/fill/float.fill.horizontal.js +++ b/src/core/wrapper/layout/fill/float.fill.horizontal.js @@ -45,41 +45,41 @@ BI.FloatHorizontalFillLayout = BI.inherit(BI.Layout, { } else { var w = BI._lazyCreateWidget(item); } - if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { + if (o.vgap + o.tgap + self._optimiseItemTgap(item) + self._optimiseItemVgap(item) !== 0) { w.element.css({ - "margin-top": self._optimiseGap(o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0)) + "margin-top": self._optimiseGap(o.vgap + o.tgap + self._optimiseItemTgap(item) + self._optimiseItemVgap(item)) }); } if (desc) { - if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { + if (o.hgap + o.rgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) !== 0) { w.element.css({ - "margin-right": self._optimiseGap((i === o.items.length - 1 ? o.hgap : 0) + o.rgap + (item.rgap || 0) + (item.hgap || 0)) + "margin-right": self._optimiseGap((i === o.items.length - 1 ? o.hgap : 0) + o.rgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item)) }); } - if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { + if (o.hgap + o.lgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) !== 0) { w.element.css({ - "margin-left": self._optimiseGap(o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0)) + "margin-left": self._optimiseGap(o.hgap + o.lgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item)) }); } } else { - if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { + if (o.hgap + o.lgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) !== 0) { w.element.css({ - "margin-left": self._optimiseGap((i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0)) + "margin-left": self._optimiseGap((i === 0 ? o.hgap : 0) + o.lgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item)) }); } - if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { + if (o.hgap + o.rgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) !== 0) { w.element.css({ - "margin-right": self._optimiseGap(o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0)) + "margin-right": self._optimiseGap(o.hgap + o.rgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item)) }); } } - if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { + if (o.vgap + o.bgap + self._optimiseItemBgap(item) + self._optimiseItemVgap(item) !== 0) { w.element.css({ - "margin-bottom": self._optimiseGap(o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0)) + "margin-bottom": self._optimiseGap(o.vgap + o.bgap + self._optimiseItemBgap(item) + self._optimiseItemVgap(item)) }); } - var top = o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0), - bottom = o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0); + var top = o.vgap + o.tgap + self._optimiseItemTgap(item) + self._optimiseItemVgap(item), + bottom = o.vgap + o.bgap + self._optimiseItemBgap(item) + self._optimiseItemVgap(item); if (o.verticalAlign === BI.VerticalAlign.Stretch && BI.isNull(item.height)) { w.element.css({ height: "calc(100% - " + self._optimiseGap(top + bottom) + ")" diff --git a/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js b/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js index 322d48fb4..01a462707 100644 --- a/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js +++ b/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js @@ -35,7 +35,7 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { }, _formatItems: function (items) { - var o = this.options; + var self = this, o = this.options; var left, right; if (BI.isArray(items)) { BI.each(items, function (i, item) { @@ -53,17 +53,17 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { var json = { el: BI.stripEL(item) }; - if (o.lvgap + o.ltgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { - json.tgap = o.lvgap + o.ltgap + (item.tgap || 0) + (item.vgap || 0); + if (o.lvgap + o.ltgap + self._optimiseItemTgap(item) + self._optimiseItemVgap(item) !== 0) { + json.tgap = o.lvgap + o.ltgap + self._optimiseItemTgap(item) + self._optimiseItemVgap(item); } - if (o.lhgap + o.llgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { - json.lgap = (i === 0 ? o.lhgap : 0) + o.llgap + (item.lgap || 0) + (item.hgap || 0); + if (o.lhgap + o.llgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) !== 0) { + json.lgap = (i === 0 ? o.lhgap : 0) + o.llgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item); } - if (o.lhgap + o.lrgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { - json.rgap = o.lhgap + o.lrgap + (item.rgap || 0) + (item.hgap || 0); + if (o.lhgap + o.lrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) !== 0) { + json.rgap = o.lhgap + o.lrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item); } - if (o.lvgap + o.lbgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { - json.bgap = o.lvgap + o.lbgap + (item.bgap || 0) + (item.vgap || 0); + if (o.lvgap + o.lbgap + self._optimiseItemBgap(item) + self._optimiseItemVgap(item) !== 0) { + json.bgap = o.lvgap + o.lbgap + self._optimiseItemBgap(item) + self._optimiseItemVgap(item); } return json; }); diff --git a/src/core/wrapper/layout/float/float.absolute.leftrightvertical.js b/src/core/wrapper/layout/float/float.absolute.leftrightvertical.js index 26bea2558..9de105651 100644 --- a/src/core/wrapper/layout/float/float.absolute.leftrightvertical.js +++ b/src/core/wrapper/layout/float/float.absolute.leftrightvertical.js @@ -38,7 +38,7 @@ BI.FloatAbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { }, _formatItems: function (items) { - var o = this.options; + var self = this, o = this.options; var left, right; if (BI.isArray(items)) { BI.each(items, function (i, item) { @@ -68,11 +68,11 @@ BI.FloatAbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { // if (o.lvgap + o.ltgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { // json.tgap = o.lvgap + o.ltgap + (item.tgap || 0) + (item.vgap || 0); // } - if (o.lhgap + o.llgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { - json.lgap = (i === 0 ? o.lhgap : 0) + o.llgap + (item.lgap || 0) + (item.hgap || 0); + if (o.lhgap + o.llgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) !== 0) { + json.lgap = (i === 0 ? o.lhgap : 0) + o.llgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item); } - if (o.lhgap + o.lrgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { - json.rgap = o.lhgap + o.lrgap + (item.rgap || 0) + (item.hgap || 0); + if (o.lhgap + o.lrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) !== 0) { + json.rgap = o.lhgap + o.lrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item); } // if (o.lvgap + o.lbgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { // json.bgap = o.lvgap + o.lbgap + (item.bgap || 0) + (item.vgap || 0); @@ -95,11 +95,11 @@ BI.FloatAbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { // if (o.rvgap + o.rtgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { // json.tgap = o.rvgap + o.rtgap + (item.tgap || 0) + (item.vgap || 0); // } - if (o.rhgap + o.rlgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { - json.lgap = (i === 0 ? o.rhgap : 0) + o.rlgap + (item.lgap || 0) + (item.hgap || 0); + if (o.rhgap + o.rlgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) !== 0) { + json.lgap = (i === 0 ? o.rhgap : 0) + o.rlgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item); } - if (o.rhgap + o.rrgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { - json.rgap = o.rhgap + o.rrgap + (item.rgap || 0) + (item.hgap || 0); + if (o.rhgap + o.rrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) !== 0) { + json.rgap = o.rhgap + o.rrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item); } // if (o.rvgap + o.rbgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { // json.bgap = o.rvgap + o.rbgap + (item.bgap || 0) + (item.vgap || 0); diff --git a/src/core/wrapper/layout/layout.flow.js b/src/core/wrapper/layout/layout.flow.js index 4efc35123..e3c26638d 100644 --- a/src/core/wrapper/layout/layout.flow.js +++ b/src/core/wrapper/layout/layout.flow.js @@ -56,26 +56,26 @@ BI.FloatLeftLayout = BI.inherit(BI.Layout, { if (BI.isNotNull(item.bottom)) { w.element.css({bottom: BI.isNumber(item.bottom) ? this._optimiseGap(item.bottom) : item.bottom}); } - if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { - var top = o.vgap / 2 + o.tgap + (item.tgap || 0) + (item.vgap || 0); + if (o.vgap + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { + var top = o.vgap / 2 + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); w.element.css({ "margin-top": this._optimiseGap(top) }); } - if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { - var left = o.hgap / 2 + o.lgap + (item.lgap || 0) + (item.hgap || 0); + if (o.hgap + o.lgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) { + var left = o.hgap / 2 + o.lgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item); w.element.css({ "margin-left": this._optimiseGap(left) }); } - if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { - var right = o.hgap / 2 + o.rgap + (item.rgap || 0) + (item.hgap || 0); + if (o.hgap + o.rgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) { + var right = o.hgap / 2 + o.rgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item); w.element.css({ "margin-right": this._optimiseGap(right) }); } - if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { - var bottom = o.vgap / 2 + o.bgap + (item.bgap || 0) + (item.vgap || 0); + if (o.vgap + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) { + var bottom = o.vgap / 2 + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); w.element.css({ "margin-bottom": this._optimiseGap(bottom) }); @@ -148,24 +148,28 @@ BI.FloatRightLayout = BI.inherit(BI.Layout, { if (BI.isNotNull(item.bottom)) { w.element.css({bottom: BI.isNumber(item.bottom) ? item.bottom / BI.pixRatio + BI.pixUnit : item.bottom}); } - if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { + if (o.vgap + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { + var top = o.vgap / 2 + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); w.element.css({ - "margin-top": (o.vgap / 2 + o.tgap + (item.tgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit + "margin-top": this._optimiseGap(top) }); } - if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { + if (o.hgap + o.lgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) { + var left = o.hgap / 2 + o.lgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item); w.element.css({ - "margin-left": (o.hgap / 2 + o.lgap + (item.lgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit + "margin-left": this._optimiseGap(left) }); } - if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { + if (o.hgap + o.rgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) { + var right = o.hgap / 2 + o.rgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item); w.element.css({ - "margin-right": (o.hgap / 2 + o.rgap + (item.rgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit + "margin-right": this._optimiseGap(right) }); } - if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { + if (o.vgap + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) { + var bottom = o.vgap / 2 + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); w.element.css({ - "margin-bottom": (o.vgap / 2 + o.bgap + (item.bgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit + "margin-bottom": this._optimiseGap(bottom) }); } return w; diff --git a/src/core/wrapper/layout/layout.inline.js b/src/core/wrapper/layout/layout.inline.js index 04b38a47a..99fa1b96e 100644 --- a/src/core/wrapper/layout/layout.inline.js +++ b/src/core/wrapper/layout/layout.inline.js @@ -66,7 +66,7 @@ BI.InlineLayout = BI.inherit(BI.Layout, { autoCount++; cz = 0; } - gap += o.hgap + o.lgap + o.rgap + (o.items[k].lgap || 0) + (o.items[k].rgap || 0) + (o.items[k].hgap || 0); + gap += o.hgap + o.lgap + o.rgap + this._optimiseItemLgap(o.items[k]) + this._optimiseItemRgap(o.items[k]) + this._optimiseItemHgap(o.items[k]); length += cz; } length = length > 0 && length < 1 ? (length * 100).toFixed(1) + "%" : length / BI.pixRatio + BI.pixUnit; @@ -84,8 +84,8 @@ BI.InlineLayout = BI.inherit(BI.Layout, { } this._handleGap(w, item, i); if (o.verticalAlign === BI.VerticalAlign.Stretch && BI.isNull(item.height)) { - var top = o.innerVgap + o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0), - bottom = o.innerVgap + o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0); + var top = o.innerVgap + o.vgap + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item), + bottom = o.innerVgap + o.vgap + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); var gap = (top + bottom) > 0 && (top + bottom) < 1 ? ((top + bottom) * 100).toFixed(1) + "%" : (top + bottom) / BI.pixRatio + BI.pixUnit; w.element.css("height", "calc(100% - " + gap + ")"); } diff --git a/src/core/wrapper/layout/layout.tape.js b/src/core/wrapper/layout/layout.tape.js index 8652862da..a3fa8bcf0 100644 --- a/src/core/wrapper/layout/layout.tape.js +++ b/src/core/wrapper/layout/layout.tape.js @@ -53,8 +53,8 @@ BI.HTapeLayout = BI.inherit(BI.Layout, { } w.element.css({ position: "absolute", - top: self._optimiseGap((item.vgap || 0) + (item.tgap || 0) + o.innerVgap + o.vgap + o.tgap), - bottom: self._optimiseGap((item.bgap || 0) + (item.vgap || 0) + o.innerVgap + o.vgap + o.bgap), + top: self._optimiseGap(self._optimiseItemTgap(item) + self._optimiseItemVgap(item) + o.innerVgap + o.vgap + o.tgap), + bottom: self._optimiseGap(self._optimiseItemBgap(item) + self._optimiseItemVgap(item) + o.innerVgap + o.vgap + o.bgap), width: BI.isNumber(columnSize) ? self._optimiseGap(columnSize) : "" }); if (o.verticalAlign === BI.VerticalAlign.Middle) { @@ -86,10 +86,10 @@ BI.HTapeLayout = BI.inherit(BI.Layout, { } if (BI.isNull(left[i])) { var preColumnSize = o.columnSize.length > 0 ? o.columnSize[i - 1] : items[i - 1].width; - left[i] = left[i - 1] + preColumnSize + (items[i - 1].lgap || 0) + (items[i - 1].rgap || 0) + 2 * (items[i - 1].hgap || 0) + o.hgap + o.lgap + o.rgap; + left[i] = left[i - 1] + preColumnSize + self._optimiseItemLgap(items[i - 1]) + self._optimiseItemRgap(items[i - 1]) + 2 * self._optimiseItemHgap(items[i - 1]) + o.hgap + o.lgap + o.rgap; } w.element.css({ - left: self._optimiseGap(left[i] + (item.lgap || 0) + (item.hgap || 0) + o.hgap + o.lgap) + left: self._optimiseGap(left[i] + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) + o.hgap + o.lgap) }); if (columnSize === "" || columnSize === "fill") { @@ -104,10 +104,10 @@ BI.HTapeLayout = BI.inherit(BI.Layout, { var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width; if (BI.isNull(right[i])) { var nextColumnSize = o.columnSize.length > 0 ? o.columnSize[i + 1] : items[i + 1].width; - right[i] = right[i + 1] + nextColumnSize + (items[i + 1].lgap || 0) + (items[i + 1].rgap || 0) + 2 * (items[i + 1].hgap || 0) + o.hgap + o.lgap + o.rgap; + right[i] = right[i + 1] + nextColumnSize + self._optimiseItemLgap(items[i + 1]) + self._optimiseItemRgap(items[i + 1]) + 2 * self._optimiseItemHgap(items[i + 1]) + o.hgap + o.lgap + o.rgap; } w.element.css({ - right: self._optimiseGap(right[i] + (item.rgap || 0) + (item.hgap || 0) + o.hgap + o.rgap) + right: self._optimiseGap(right[i] + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) + o.hgap + o.rgap) }); if (columnSize === "" || columnSize === "fill") { @@ -178,8 +178,8 @@ BI.VTapeLayout = BI.inherit(BI.Layout, { } w.element.css({ position: "absolute", - left: self._optimiseGap((item.lgap || 0) + (item.hgap || 0) + o.innerHgap + o.hgap + o.lgap), - right: self._optimiseGap((item.hgap || 0) + (item.rgap || 0) + o.innerHgap + o.hgap + o.rgap), + left: self._optimiseGap(self._optimiseItemLgap(item) + self._optimiseItemHgap(item) + o.innerHgap + o.hgap + o.lgap), + right: self._optimiseGap(self._optimiseItemRgap(item) + self._optimiseItemHgap(item) + o.innerHgap + o.hgap + o.rgap), height: BI.isNumber(rowSize) ? self._optimiseGap(rowSize) : "" }); if (o.horizontalAlign === BI.HorizontalAlign.Center) { @@ -211,10 +211,10 @@ BI.VTapeLayout = BI.inherit(BI.Layout, { } if (BI.isNull(top[i])) { var preRowSize = o.rowSize.length > 0 ? o.rowSize[i - 1] : items[i - 1].height; - top[i] = top[i - 1] + preRowSize + (items[i - 1].tgap || 0) + (items[i - 1].bgap || 0) + 2 * (items[i - 1].vgap || 0) + o.vgap + o.tgap + o.bgap; + top[i] = top[i - 1] + preRowSize + self._optimiseItemTgap(items[i - 1]) + self._optimiseItemBgap(items[i - 1]) + 2 * self._optimiseItemVgap(items[i - 1]) + o.vgap + o.tgap + o.bgap; } w.element.css({ - top: self._optimiseGap(top[i] + (item.vgap || 0) + (item.tgap || 0) + o.vgap + o.tgap) + top: self._optimiseGap(top[i] + self._optimiseItemTgap(item) + self._optimiseItemVgap(item) + o.vgap + o.tgap) }); if (rowSize === "" || rowSize === "fill") { @@ -229,10 +229,10 @@ BI.VTapeLayout = BI.inherit(BI.Layout, { var rowSize = o.rowSize.length > 0 ? o.rowSize[i] : item.height; if (BI.isNull(bottom[i])) { var nextRowSize = o.rowSize.length > 0 ? o.rowSize[i + 1] : items[i + 1].height; - bottom[i] = bottom[i + 1] + nextRowSize + (items[i + 1].tgap || 0) + (items[i + 1].bgap || 0) + 2 * (items[i + 1].vgap || 0) + o.vgap + o.tgap + o.bgap; + bottom[i] = bottom[i + 1] + nextRowSize + self._optimiseItemTgap(items[i + 1]) + self._optimiseItemBgap(items[i + 1]) + 2 * self._optimiseItemVgap(items[i + 1]) + o.vgap + o.tgap + o.bgap; } w.element.css({ - bottom: self._optimiseGap(bottom[i] + (item.vgap || 0) + (item.bgap || 0) + o.vgap + o.bgap) + bottom: self._optimiseGap(bottom[i] + self._optimiseItemBgap(item) + self._optimiseItemVgap(item) + o.vgap + o.bgap) }); if (rowSize === "" || rowSize === "fill") { diff --git a/src/core/wrapper/layout/layout.td.js b/src/core/wrapper/layout/layout.td.js index 17a469754..cb3221570 100644 --- a/src/core/wrapper/layout/layout.td.js +++ b/src/core/wrapper/layout/layout.td.js @@ -92,8 +92,8 @@ BI.TdLayout = BI.inherit(BI.Layout, { for (var i = 0; i < arr.length; i++) { var w = BI._lazyCreateWidget(arr[i]); if (o.verticalAlign === BI.VerticalAlign.Stretch) { - var top = o.vgap + o.tgap + (arr[i].tgap || 0) + (arr[i].vgap || 0), - bottom = o.vgap + o.bgap + (arr[i].bgap || 0) + (arr[i].vgap || 0); + var top = o.vgap + o.tgap + this._optimiseItemTgap(arr[i]) + this._optimiseItemVgap(arr[i]), + bottom = o.vgap + o.bgap + this._optimiseItemBgap(arr[i]) + this._optimiseItemVgap(arr[i]); w.element.css("height", "calc(100% - " + this._optimiseGap(top + bottom) + ")"); } w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"}); diff --git a/src/core/wrapper/layout/sticky/sticky.horizontal.js b/src/core/wrapper/layout/sticky/sticky.horizontal.js index c5b644542..a59dd6edf 100644 --- a/src/core/wrapper/layout/sticky/sticky.horizontal.js +++ b/src/core/wrapper/layout/sticky/sticky.horizontal.js @@ -5,7 +5,8 @@ BI.HorizontalStickyLayout = BI.inherit(BI.FlexHorizontalLayout, { props: function () { return BI.extend(BI.HorizontalStickyLayout.superclass.props.apply(this, arguments), { extraCls: "bi-h-sticky", - horizontalAlign: BI.HorizontalAlign.Stretch, + scrollx: true, + // horizontalAlign: BI.HorizontalAlign.Stretch, verticalAlign: BI.VerticalAlign.Stretch }); }, diff --git a/src/core/wrapper/layout/sticky/sticky.vertical.js b/src/core/wrapper/layout/sticky/sticky.vertical.js index a5ba3d837..970d84eef 100644 --- a/src/core/wrapper/layout/sticky/sticky.vertical.js +++ b/src/core/wrapper/layout/sticky/sticky.vertical.js @@ -5,8 +5,9 @@ BI.VerticalStickyLayout = BI.inherit(BI.FlexVerticalLayout, { props: function () { return BI.extend(BI.VerticalStickyLayout.superclass.props.apply(this, arguments), { extraCls: "bi-v-sticky", + scrolly: true, horizontalAlign: BI.HorizontalAlign.Stretch, - verticalAlign: BI.VerticalAlign.Stretch + // verticalAlign: BI.VerticalAlign.Stretch }); }, From 06e450d1ef53e8d94d03eca59b18e839598aa36c Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 13 May 2022 10:22:39 +0800 Subject: [PATCH 53/60] =?UTF-8?q?feature:=20=E5=B8=83=E5=B1=80=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=86=99=E6=B3=95=EF=BC=8C=E4=B8=BA=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=81=9A=E5=87=86=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adapt/absolute.leftrightvertical.js | 32 +-- .../layout/adapt/adapt.leftrightvertical.js | 215 ++++++++++++------ 2 files changed, 157 insertions(+), 90 deletions(-) diff --git a/src/core/wrapper/layout/adapt/absolute.leftrightvertical.js b/src/core/wrapper/layout/adapt/absolute.leftrightvertical.js index 148897cfe..1aff2a7a9 100644 --- a/src/core/wrapper/layout/adapt/absolute.leftrightvertical.js +++ b/src/core/wrapper/layout/adapt/absolute.leftrightvertical.js @@ -56,17 +56,17 @@ BI.AbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { el: BI.stripEL(item), width: item.width }; - if (o.lvgap + o.ltgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { - json.tgap = o.lvgap + o.ltgap + (item.tgap || 0) + (item.vgap || 0); + if (o.lvgap + o.ltgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { + json.tgap = o.lvgap + o.ltgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); } - if (o.lhgap + o.llgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { - json.lgap = (i === 0 ? o.lhgap : 0) + o.llgap + (item.lgap || 0) + (item.hgap || 0); + if (o.lhgap + o.llgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) { + json.lgap = (i === 0 ? o.lhgap : 0) + o.llgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item); } - if (o.lhgap + o.lrgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { - json.rgap = o.lhgap + o.lrgap + (item.rgap || 0) + (item.hgap || 0); + if (o.lhgap + o.lrgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) { + json.rgap = o.lhgap + o.lrgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item); } - if (o.lvgap + o.lbgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { - json.bgap = o.lvgap + o.lbgap + (item.bgap || 0) + (item.vgap || 0); + if (o.lvgap + o.lbgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) { + json.bgap = o.lvgap + o.lbgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); } return json; }); @@ -75,17 +75,17 @@ BI.AbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { el: BI.stripEL(item), width: item.width }; - if (o.rvgap + o.rtgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { - json.tgap = o.rvgap + o.rtgap + (item.tgap || 0) + (item.vgap || 0); + if (o.rvgap + o.rtgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { + json.tgap = o.rvgap + o.rtgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); } - if (o.rhgap + o.rlgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { - json.lgap = (i === 0 ? o.rhgap : 0) + o.rlgap + (item.lgap || 0) + (item.hgap || 0); + if (o.rhgap + o.rlgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) { + json.lgap = (i === 0 ? o.rhgap : 0) + o.rlgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item); } - if (o.rhgap + o.rrgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { - json.rgap = o.rhgap + o.rrgap + (item.rgap || 0) + (item.hgap || 0); + if (o.rhgap + o.rrgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) { + json.rgap = o.rhgap + o.rrgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item); } - if (o.rvgap + o.rbgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { - json.bgap = o.rvgap + o.rbgap + (item.bgap || 0) + (item.vgap || 0); + if (o.rvgap + o.rbgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) { + json.bgap = o.rvgap + o.rbgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); } return json; }); diff --git a/src/core/wrapper/layout/adapt/adapt.leftrightvertical.js b/src/core/wrapper/layout/adapt/adapt.leftrightvertical.js index 1aff2a7a9..cafc1dafb 100644 --- a/src/core/wrapper/layout/adapt/adapt.leftrightvertical.js +++ b/src/core/wrapper/layout/adapt/adapt.leftrightvertical.js @@ -1,8 +1,16 @@ -BI.AbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { +/** + * 左右分离,垂直方向居中容器 + * items:{ + left: [{el:{type:"bi.button"}}], + right:[{el:{type:"bi.button"}}] + } + * @class BI.LeftRightVerticalAdaptLayout + * @extends BI.Layout + */ +BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { props: function () { - return BI.extend(BI.AbsoluteLeftRightVerticalAdaptLayout.superclass.props.apply(this, arguments), { - baseCls: "bi-abs-lr-v-a", - verticalAlign: BI.VerticalAlign.Middle, + return BI.extend(BI.LeftRightVerticalAdaptLayout.superclass.props.apply(this, arguments), { + baseCls: "bi-lr-v-a", items: {}, llgap: 0, lrgap: 0, @@ -20,24 +28,59 @@ BI.AbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { }, render: function () { var o = this.options, self = this; - BI.AbsoluteLeftRightVerticalAdaptLayout.superclass.render.apply(this, arguments); - return { - type: "bi.htape", - innerHgap: o.innerHgap, - innerVgap: o.innerVgap, - ref: function (_ref) { - self.layout = _ref; - }, - verticalAlign: o.verticalAlign, - items: this._formatItems(o.items), - scrollx: o.scrollx, - scrolly: o.scrolly, - scrollable: o.scrollable - }; + BI.LeftRightVerticalAdaptLayout.superclass.render.apply(this, arguments); + var leftRight = this._getLeftRight(o.items); + var layoutArray = []; + if (leftRight.left || "left" in o.items) { + layoutArray.push({ + type: "bi.left", + lgap: o.innerHgap, + vgap: o.innerVgap, + items: [{ + el: { + type: "bi.vertical_adapt", + ref: function (_ref) { + self.left = _ref; + }, + height: "100%", + items: leftRight.left || o.items.left, + hgap: o.lhgap, + lgap: o.llgap, + rgap: o.lrgap, + tgap: o.ltgap, + bgap: o.lbgap, + vgap: o.lvgap + } + }] + }); + } + if (leftRight.right || "right" in o.items) { + layoutArray.push({ + type: "bi.right", + rgap: o.innerHgap, + vgap: o.innerVgap, + items: [{ + el: { + type: "bi.vertical_adapt", + ref: function (_ref) { + self.right = _ref; + }, + height: "100%", + items: leftRight.right || o.items.right, + hgap: o.rhgap, + lgap: o.rlgap, + rgap: o.rrgap, + tgap: o.rtgap, + bgap: o.rbgap, + vgap: o.rvgap + } + }] + }); + } + return layoutArray; }, - _formatItems: function (items) { - var o = this.options; + _getLeftRight: function (items) { var left, right; if (BI.isArray(items)) { BI.each(items, function (i, item) { @@ -49,51 +92,72 @@ BI.AbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { } }); } - var leftItems = left || items.left || []; - var rightItems = right || items.right || []; - leftItems = BI.map(leftItems, function (i, item) { - var json = { - el: BI.stripEL(item), - width: item.width - }; - if (o.lvgap + o.ltgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { - json.tgap = o.lvgap + o.ltgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); - } - if (o.lhgap + o.llgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) { - json.lgap = (i === 0 ? o.lhgap : 0) + o.llgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item); - } - if (o.lhgap + o.lrgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) { - json.rgap = o.lhgap + o.lrgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item); - } - if (o.lvgap + o.lbgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) { - json.bgap = o.lvgap + o.lbgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); - } - return json; - }); - rightItems = BI.map(rightItems, function (i, item) { - var json = { - el: BI.stripEL(item), - width: item.width - }; - if (o.rvgap + o.rtgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { - json.tgap = o.rvgap + o.rtgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); - } - if (o.rhgap + o.rlgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) { - json.lgap = (i === 0 ? o.rhgap : 0) + o.rlgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item); - } - if (o.rhgap + o.rrgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) { - json.rgap = o.rhgap + o.rrgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item); - } - if (o.rvgap + o.rbgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) { - json.bgap = o.rvgap + o.rbgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); - } - return json; + return { + left: left, + right: right + }; + }, + + resize: function () { + var leftRight = this._getLeftRight(this.options.items); + this.left.stroke(leftRight.left || this.options.items.left); + this.right.stroke(leftRight.right || this.options.items.right); + }, + + addItem: function () { + // do nothing + throw new Error("不能添加子组件"); + }, + + populate: function (items) { + var leftRight = this._getLeftRight(items); + this.left.populate(leftRight.left || items.left); + this.right.populate(leftRight.right || items.right); + } +}); +BI.shortcut("bi.left_right_vertical_adapt", BI.LeftRightVerticalAdaptLayout); + + +BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, { + props: function () { + return BI.extend(BI.LeftRightVerticalAdaptLayout.superclass.props.apply(this, arguments), { + baseCls: "bi-l-v-a", + items: [], + columnSize: [], + lgap: 0, + rgap: 0, + hgap: 0, + tgap: 0, + bgap: 0, + vgap: 0 }); - return leftItems.concat({}, rightItems); + }, + render: function () { + var o = this.options, self = this; + BI.LeftVerticalAdaptLayout.superclass.render.apply(this, arguments); + return { + type: "bi.vertical_adapt", + ref: function (_ref) { + self.layout = _ref; + }, + items: o.items, + columnSize: o.columnSize, + hgap: o.hgap, + lgap: o.lgap, + rgap: o.rgap, + tgap: o.tgap, + bgap: o.bgap, + vgap: o.vgap, + innerHgap: o.innerHgap, + innerVgap: o.innerVgap, + scrollx: o.scrollx, + scrolly: o.scrolly, + scrollable: o.scrollable + }; }, resize: function () { - this.layout.stroke(this._formatItems(this.options.items)); + this.layout.resize(); }, addItem: function () { @@ -102,17 +166,17 @@ BI.AbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { }, populate: function (items) { - this.layout.populate(this._formatItems(items)); + this.layout.populate.apply(this, arguments); } }); -BI.shortcut("bi.absolute_left_right_vertical_adapt", BI.AbsoluteLeftRightVerticalAdaptLayout); +BI.shortcut("bi.left_vertical_adapt", BI.LeftVerticalAdaptLayout); -BI.AbsoluteRightVerticalAdaptLayout = BI.inherit(BI.Layout, { +BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, { props: function () { - return BI.extend(BI.AbsoluteRightVerticalAdaptLayout.superclass.props.apply(this, arguments), { - baseCls: "bi-abs-r-v-a", - verticalAlign: BI.VerticalAlign.Middle, + return BI.extend(BI.RightVerticalAdaptLayout.superclass.props.apply(this, arguments), { + baseCls: "bi-r-v-a", items: [], + columnSize: [], lgap: 0, rgap: 0, hgap: 0, @@ -123,20 +187,23 @@ BI.AbsoluteRightVerticalAdaptLayout = BI.inherit(BI.Layout, { }, render: function () { var o = this.options, self = this; - BI.AbsoluteRightVerticalAdaptLayout.superclass.render.apply(this, arguments); + BI.RightVerticalAdaptLayout.superclass.render.apply(this, arguments); return { - type: "bi.htape", + type: "bi.vertical_adapt", ref: function (_ref) { self.layout = _ref; }, - verticalAlign: o.verticalAlign, - items: [{}].concat(o.items), + horizontalAlign: BI.HorizontalAlign.Right, + items: o.items, + columnSize: o.columnSize, hgap: o.hgap, lgap: o.lgap, rgap: o.rgap, tgap: o.tgap, bgap: o.bgap, vgap: o.vgap, + innerHgap: o.innerHgap, + innerVgap: o.innerVgap, scrollx: o.scrollx, scrolly: o.scrolly, scrollable: o.scrollable @@ -144,7 +211,7 @@ BI.AbsoluteRightVerticalAdaptLayout = BI.inherit(BI.Layout, { }, resize: function () { - this.layout.stroke([{}].concat(this.options.items)); + this.layout.resize(); }, addItem: function () { @@ -153,7 +220,7 @@ BI.AbsoluteRightVerticalAdaptLayout = BI.inherit(BI.Layout, { }, populate: function (items) { - this.layout.populate([{}].concat(items)); + this.layout.populate(items); } }); -BI.shortcut("bi.absolute_right_vertical_adapt", BI.AbsoluteRightVerticalAdaptLayout); +BI.shortcut("bi.right_vertical_adapt", BI.RightVerticalAdaptLayout); From cfc3a7e318caf9747e1590cbf25c16497fac74df Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 13 May 2022 10:24:18 +0800 Subject: [PATCH 54/60] =?UTF-8?q?feature:=20=E5=B8=83=E5=B1=80=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=86=99=E6=B3=95=EF=BC=8C=E4=B8=BA=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=81=9A=E5=87=86=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adapt/absolute.leftrightvertical.js | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/core/wrapper/layout/adapt/absolute.leftrightvertical.js b/src/core/wrapper/layout/adapt/absolute.leftrightvertical.js index 1aff2a7a9..25d5aab94 100644 --- a/src/core/wrapper/layout/adapt/absolute.leftrightvertical.js +++ b/src/core/wrapper/layout/adapt/absolute.leftrightvertical.js @@ -37,7 +37,7 @@ BI.AbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { }, _formatItems: function (items) { - var o = this.options; + var self = this, o = this.options; var left, right; if (BI.isArray(items)) { BI.each(items, function (i, item) { @@ -56,17 +56,17 @@ BI.AbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { el: BI.stripEL(item), width: item.width }; - if (o.lvgap + o.ltgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { - json.tgap = o.lvgap + o.ltgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); + if (o.lvgap + o.ltgap + self._optimiseItemTgap(item) + self._optimiseItemVgap(item) !== 0) { + json.tgap = o.lvgap + o.ltgap + self._optimiseItemTgap(item) + self._optimiseItemVgap(item); } - if (o.lhgap + o.llgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) { - json.lgap = (i === 0 ? o.lhgap : 0) + o.llgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item); + if (o.lhgap + o.llgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) !== 0) { + json.lgap = (i === 0 ? o.lhgap : 0) + o.llgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item); } - if (o.lhgap + o.lrgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) { - json.rgap = o.lhgap + o.lrgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item); + if (o.lhgap + o.lrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) !== 0) { + json.rgap = o.lhgap + o.lrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item); } - if (o.lvgap + o.lbgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) { - json.bgap = o.lvgap + o.lbgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); + if (o.lvgap + o.lbgap + self._optimiseItemBgap(item) + self._optimiseItemVgap(item) !== 0) { + json.bgap = o.lvgap + o.lbgap + self._optimiseItemBgap(item) + self._optimiseItemVgap(item); } return json; }); @@ -75,17 +75,17 @@ BI.AbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { el: BI.stripEL(item), width: item.width }; - if (o.rvgap + o.rtgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { - json.tgap = o.rvgap + o.rtgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); + if (o.rvgap + o.rtgap + self._optimiseItemTgap(item) + self._optimiseItemVgap(item) !== 0) { + json.tgap = o.rvgap + o.rtgap + self._optimiseItemTgap(item) + self._optimiseItemVgap(item); } - if (o.rhgap + o.rlgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item) !== 0) { - json.lgap = (i === 0 ? o.rhgap : 0) + o.rlgap + this._optimiseItemLgap(item) + this._optimiseItemHgap(item); + if (o.rhgap + o.rlgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) !== 0) { + json.lgap = (i === 0 ? o.rhgap : 0) + o.rlgap + self._optimiseItemLgap(item) + self._optimiseItemHgap(item); } - if (o.rhgap + o.rrgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item) !== 0) { - json.rgap = o.rhgap + o.rrgap + this._optimiseItemRgap(item) + this._optimiseItemHgap(item); + if (o.rhgap + o.rrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) !== 0) { + json.rgap = o.rhgap + o.rrgap + self._optimiseItemRgap(item) + self._optimiseItemHgap(item); } - if (o.rvgap + o.rbgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item) !== 0) { - json.bgap = o.rvgap + o.rbgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); + if (o.rvgap + o.rbgap + self._optimiseItemBgap(item) + self._optimiseItemVgap(item) !== 0) { + json.bgap = o.rvgap + o.rbgap + self._optimiseItemBgap(item) + self._optimiseItemVgap(item); } return json; }); From c69f37ed5e8af0c27e6d11c54b74838995bfaff1 Mon Sep 17 00:00:00 2001 From: data Date: Fri, 13 May 2022 10:54:28 +0800 Subject: [PATCH 55/60] auto upgrade version to 2.0.20220513105417 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5d53290b3..d1cba8d5b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220512173520", + "version": "2.0.20220513105417", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From b2abf387d524fa5cd84669b1d7cb6928d116fe70 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 13 May 2022 12:56:13 +0800 Subject: [PATCH 56/60] =?UTF-8?q?feature:=20=E5=B8=83=E5=B1=80=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=86=99=E6=B3=95=EF=BC=8C=E6=8F=90=E4=BE=9B=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/system.js | 11 ++++++++++- src/core/wrapper/layout.js | 20 +++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/core/system.js b/src/core/system.js index 123bd88be..652a9c256 100644 --- a/src/core/system.js +++ b/src/core/system.js @@ -7,6 +7,7 @@ !(function () { var system = { dependencies: {}, + layoutOptimize: false, responsiveMode: false, workerMode: false, size: { @@ -24,7 +25,7 @@ // 具体尺寸还没定,先写着 var sizeMap = { "S": 10, - "M" : 20, + "M": 20, "L": 24 }; @@ -44,6 +45,10 @@ system.workerMode = !!mode; }; + this.setLayoutOptimize = function (layoutOptimize) { + system.layoutOptimize = layoutOptimize; + }; + this.addDependency = function (moduleId, minVersion, maxVersion) { system.dependencies[moduleId] = { min: minVersion, @@ -77,6 +82,10 @@ return system.workerMode; }, + getLayoutOptimize: function () { + return system.layoutOptimize; + }, + getDependencies: function () { return system.dependencies; } diff --git a/src/core/wrapper/layout.js b/src/core/wrapper/layout.js index a79b3775b..28dadbd08 100644 --- a/src/core/wrapper/layout.js +++ b/src/core/wrapper/layout.js @@ -16,7 +16,7 @@ BI.Layout = BI.inherit(BI.Widget, { scrolly: false, // true, false items: [], innerHgap: 0, - innerVgap: 0, + innerVgap: 0 }; }, @@ -293,21 +293,39 @@ BI.Layout = BI.inherit(BI.Widget, { }, _optimiseItemLgap: function (item) { + if (BI.Providers.getProvider("bi.provider.system").getLayoutOptimize()) { + return ((!item.type && item.el) ? item.lgap : item._lgap) || 0; + } return item.lgap || 0; }, _optimiseItemRgap: function (item) { + if (BI.Providers.getProvider("bi.provider.system").getLayoutOptimize()) { + return ((!item.type && item.el) ? item.rgap : item._rgap) || 0; + } return item.rgap || 0; }, _optimiseItemTgap: function (item) { + if (BI.Providers.getProvider("bi.provider.system").getLayoutOptimize()) { + return ((!item.type && item.el) ? item.tgap : item._tgap) || 0; + } return item.tgap || 0; }, _optimiseItemBgap: function (item) { + if (BI.Providers.getProvider("bi.provider.system").getLayoutOptimize()) { + return ((!item.type && item.el) ? item.bgap : item._bgap) || 0; + } return item.bgap || 0; }, _optimiseItemHgap: function (item) { + if (BI.Providers.getProvider("bi.provider.system").getLayoutOptimize()) { + return ((!item.type && item.el) ? item.hgap : item._hgap) || 0; + } return item.hgap || 0; }, _optimiseItemVgap: function (item) { + if (BI.Providers.getProvider("bi.provider.system").getLayoutOptimize()) { + return ((!item.type && item.el) ? item.vgap : item._vgap) || 0; + } return item.vgap || 0; }, From 0cb5d35b243edbeb5b1cc8371787aed7a66fdf78 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 13 May 2022 13:40:24 +0800 Subject: [PATCH 57/60] =?UTF-8?q?feature:=20=E5=B8=83=E5=B1=80=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=86=99=E6=B3=95=EF=BC=8C=E6=8F=90=E4=BE=9B=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/wrapper/layout.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/wrapper/layout.js b/src/core/wrapper/layout.js index 28dadbd08..786e522d1 100644 --- a/src/core/wrapper/layout.js +++ b/src/core/wrapper/layout.js @@ -296,37 +296,37 @@ BI.Layout = BI.inherit(BI.Widget, { if (BI.Providers.getProvider("bi.provider.system").getLayoutOptimize()) { return ((!item.type && item.el) ? item.lgap : item._lgap) || 0; } - return item.lgap || 0; + return (item._lgap || 0) + (item.lgap || 0); }, _optimiseItemRgap: function (item) { if (BI.Providers.getProvider("bi.provider.system").getLayoutOptimize()) { return ((!item.type && item.el) ? item.rgap : item._rgap) || 0; } - return item.rgap || 0; + return (item._rgap || 0) + (item.rgap || 0); }, _optimiseItemTgap: function (item) { if (BI.Providers.getProvider("bi.provider.system").getLayoutOptimize()) { return ((!item.type && item.el) ? item.tgap : item._tgap) || 0; } - return item.tgap || 0; + return (item._tgap || 0) + (item.tgap || 0); }, _optimiseItemBgap: function (item) { if (BI.Providers.getProvider("bi.provider.system").getLayoutOptimize()) { return ((!item.type && item.el) ? item.bgap : item._bgap) || 0; } - return item.bgap || 0; + return (item._bgap || 0) + (item.bgap || 0); }, _optimiseItemHgap: function (item) { if (BI.Providers.getProvider("bi.provider.system").getLayoutOptimize()) { return ((!item.type && item.el) ? item.hgap : item._hgap) || 0; } - return item.hgap || 0; + return (item._hgap || 0) + (item.hgap || 0); }, _optimiseItemVgap: function (item) { if (BI.Providers.getProvider("bi.provider.system").getLayoutOptimize()) { return ((!item.type && item.el) ? item.vgap : item._vgap) || 0; } - return item.vgap || 0; + return (item._vgap || 0) + (item.vgap || 0); }, _handleGap: function (w, item, hIndex, vIndex) { From cbc86f158950a870b724373edcfb2388125b2744 Mon Sep 17 00:00:00 2001 From: zsmj Date: Fri, 13 May 2022 13:48:18 +0800 Subject: [PATCH 58/60] =?UTF-8?q?DESIGN-4103=20feat:=20=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E5=8F=AF=E6=90=9C=E7=B4=A2trigger=E7=9A=84less?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/less/base/trigger/trigger.searchtextvalue.less | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/less/base/trigger/trigger.searchtextvalue.less diff --git a/src/less/base/trigger/trigger.searchtextvalue.less b/src/less/base/trigger/trigger.searchtextvalue.less new file mode 100644 index 000000000..33508ae3b --- /dev/null +++ b/src/less/base/trigger/trigger.searchtextvalue.less @@ -0,0 +1,11 @@ +@import "../../index.less"; + +.bi-search-text-value-trigger { + &.error .select-text-label { + color: @color-bi-text-error-text-trigger; + } + + &:where(:not(&:hover)) .clear-button { + display: none; + } +} From 8520baf219155d3f83d996fbcab435b28183b759 Mon Sep 17 00:00:00 2001 From: data Date: Fri, 13 May 2022 14:16:08 +0800 Subject: [PATCH 59/60] auto upgrade version to 2.0.20220513141559 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d1cba8d5b..219649505 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220513105417", + "version": "2.0.20220513141559", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 8979681c34f938abb472ca016751a847dd6115f6 Mon Sep 17 00:00:00 2001 From: data Date: Fri, 13 May 2022 15:06:39 +0800 Subject: [PATCH 60/60] auto upgrade version to 2.0.20220513150627 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 219649505..30ec11f85 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220513141559", + "version": "2.0.20220513150627", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts",