From 545ae9e8bd7bb11b064d2f417c55a5b61856d846 Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 15 Jun 2022 13:04:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feature:=20=E5=B8=83=E5=B1=80=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/wrapper/layout/flex/flex.horizontal.js | 3 +++ .../wrapper/layout/flex/flex.leftrightvertical.center.js | 3 +++ src/core/wrapper/layout/flex/flex.vertical.js | 3 +++ .../wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js | 4 ++++ .../wrapper/layout/flex/wrapper/flex.wrapper.vertical.js | 4 ++++ src/less/core/wrapper/flex.horizontal.less | 6 ++++++ src/less/core/wrapper/flex.vertical.less | 6 ++++++ src/less/core/wrapper/flex.wrapper.horizontal.less | 6 ++++++ src/less/core/wrapper/flex.wrapper.vertical.less | 6 ++++++ 9 files changed, 41 insertions(+) diff --git a/src/core/wrapper/layout/flex/flex.horizontal.js b/src/core/wrapper/layout/flex/flex.horizontal.js index 7d53dfe0e..75326335b 100644 --- a/src/core/wrapper/layout/flex/flex.horizontal.js +++ b/src/core/wrapper/layout/flex/flex.horizontal.js @@ -82,6 +82,9 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, { if (columnSize === "fill") { w.element.addClass("f-f"); } + if (columnSize === "" || columnSize === "auto") { + w.element.addClass("f-auto"); + } w.element.addClass("c-e"); if (i === 0) { w.element.addClass("f-c"); diff --git a/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js b/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js index 01a462707..155d72541 100644 --- a/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js +++ b/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js @@ -2,6 +2,7 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { props: function () { return BI.extend(BI.FlexLeftRightVerticalAdaptLayout.superclass.props.apply(this, arguments), { baseCls: "bi-f-lr-v-c", + columnSize: [], items: {}, llgap: 0, lrgap: 0, @@ -25,6 +26,7 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { ref: function (_ref) { self.layout = _ref; }, + columnSize: o.columnSize, items: this._formatItems(o.items), scrollx: o.scrollx, scrolly: o.scrolly, @@ -70,6 +72,7 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { return leftItems.concat({ el: { type: "bi.flex_vertical_adapt", + columnSize: o.columnSize.slice(leftItems.length), css: { "margin-left": "auto" }, diff --git a/src/core/wrapper/layout/flex/flex.vertical.js b/src/core/wrapper/layout/flex/flex.vertical.js index 46b175e9b..1c56586cc 100644 --- a/src/core/wrapper/layout/flex/flex.vertical.js +++ b/src/core/wrapper/layout/flex/flex.vertical.js @@ -81,6 +81,9 @@ BI.FlexVerticalLayout = BI.inherit(BI.Layout, { if (rowSize === "fill") { w.element.addClass("f-f"); } + if (rowSize === "" || rowSize === "auto") { + w.element.addClass("f-auto"); + } w.element.addClass("c-e"); if (i === 0) { w.element.addClass("f-c"); diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js index 8c803abaa..fa90b0543 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js @@ -79,6 +79,10 @@ BI.FlexWrapperHorizontalLayout = BI.inherit(BI.Layout, { w.element.addClass("f-f"); this.element.addClass("f-f"); } + if (columnSize === "" || columnSize === "auto") { + w.element.addClass("f-auto"); + this.element.addClass("f-auto"); + } w.element.addClass("c-e"); if (i === 0) { w.element.addClass("f-c"); diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js index 33609e717..76beeb601 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js @@ -79,6 +79,10 @@ BI.FlexWrapperVerticalLayout = BI.inherit(BI.Layout, { w.element.addClass("f-f"); this.element.addClass("f-f"); } + if (rowSize === "" || rowSize === "auto") { + w.element.addClass("f-auto"); + this.element.addClass("f-auto"); + } w.element.addClass("c-e"); if (i === 0) { w.element.addClass("f-c"); diff --git a/src/less/core/wrapper/flex.horizontal.less b/src/less/core/wrapper/flex.horizontal.less index 606e929d5..1ae9458c5 100644 --- a/src/less/core/wrapper/flex.horizontal.less +++ b/src/less/core/wrapper/flex.horizontal.less @@ -183,4 +183,10 @@ -ms-flex-shrink: 1; flex-shrink: 1; } + + > .f-auto { + &:not(.f-s-n) { + min-width: 1px; + } + } } diff --git a/src/less/core/wrapper/flex.vertical.less b/src/less/core/wrapper/flex.vertical.less index 8124422b3..3d1b23d50 100644 --- a/src/less/core/wrapper/flex.vertical.less +++ b/src/less/core/wrapper/flex.vertical.less @@ -182,4 +182,10 @@ -ms-flex-shrink: 1; flex-shrink: 1; } + + > .f-auto { + &:not(.f-s-n) { + min-width: 1px; + } + } } diff --git a/src/less/core/wrapper/flex.wrapper.horizontal.less b/src/less/core/wrapper/flex.wrapper.horizontal.less index 70ae040d7..fedf8e853 100644 --- a/src/less/core/wrapper/flex.wrapper.horizontal.less +++ b/src/less/core/wrapper/flex.wrapper.horizontal.less @@ -279,5 +279,11 @@ -ms-flex-shrink: 1; flex-shrink: 1; } + + > .f-auto { + &:not(.f-s-n) { + min-width: 1px; + } + } } } diff --git a/src/less/core/wrapper/flex.wrapper.vertical.less b/src/less/core/wrapper/flex.wrapper.vertical.less index 755289825..32200f498 100644 --- a/src/less/core/wrapper/flex.wrapper.vertical.less +++ b/src/less/core/wrapper/flex.wrapper.vertical.less @@ -273,5 +273,11 @@ -ms-flex-shrink: 1; flex-shrink: 1; } + + > .f-auto { + &:not(.f-s-n) { + min-width: 1px; + } + } } } From 727383972b27689465c878126f53684cc663dfe8 Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 15 Jun 2022 13:10:06 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feature:=20=E5=B8=83=E5=B1=80=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wrapper/layout/flex/flex.leftrightvertical.center.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js b/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js index 155d72541..b52b1e456 100644 --- a/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js +++ b/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js @@ -21,18 +21,19 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { render: function () { var o = this.options, self = this; BI.FlexLeftRightVerticalAdaptLayout.superclass.render.apply(this, arguments); + var items = this._formatItems(o.items); return { type: "bi.flex_vertical_adapt", ref: function (_ref) { self.layout = _ref; }, - columnSize: o.columnSize, - items: this._formatItems(o.items), + columnSize: o.columnSize.slice(0, (o.items.left || []).length).concat((o.items.right || []).length > 0 ? [""] : []), + items: items, scrollx: o.scrollx, scrolly: o.scrolly, scrollable: o.scrollable, innerHgap: o.innerHgap, - innerVgap: o.innerVgap, + innerVgap: o.innerVgap }; },