From dc9b683fea32f3b95108f1680b39e864cf159fff Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 3 Apr 2021 21:59:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=83=E5=B1=80=E5=A4=A7=E4=B8=80=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/wrapper/layout/flex/flex.horizontal.js | 4 +--- src/core/wrapper/layout/flex/flex.vertical.js | 4 +--- .../flex/wrapper/flex.wrapper.horizontal.js | 5 ++--- .../flex/wrapper/flex.wrapper.vertical.js | 5 ++--- .../core/wrapper/flex.wrapper.horizontal.less | 17 +++++++++++++---- .../core/wrapper/flex.wrapper.vertical.less | 17 +++++++++++++---- src/less/core/wrapper/inline.center.less | 4 ++-- src/less/core/wrapper/inline.horizontal.less | 4 ++-- src/less/core/wrapper/inline.vertical.less | 4 ++-- 9 files changed, 38 insertions(+), 26 deletions(-) diff --git a/src/core/wrapper/layout/flex/flex.horizontal.js b/src/core/wrapper/layout/flex/flex.horizontal.js index a618e3a592..53ecdd50fa 100644 --- a/src/core/wrapper/layout/flex/flex.horizontal.js +++ b/src/core/wrapper/layout/flex/flex.horizontal.js @@ -41,9 +41,7 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, { position: "relative" }); if (o.columnSize[i] !== "auto") { - if (o.horizontalAlign === BI.HorizontalAlign.Stretch && o.columnSize[i] === "fill") { - w.element.addClass("f-f"); - } else { + if (!(o.horizontalAlign === BI.HorizontalAlign.Stretch && o.columnSize[i] === "fill")) { w.element.addClass("f-s-n"); } } diff --git a/src/core/wrapper/layout/flex/flex.vertical.js b/src/core/wrapper/layout/flex/flex.vertical.js index e78b4a1033..6eeb1abe05 100644 --- a/src/core/wrapper/layout/flex/flex.vertical.js +++ b/src/core/wrapper/layout/flex/flex.vertical.js @@ -40,9 +40,7 @@ BI.FlexVerticalLayout = BI.inherit(BI.Layout, { position: "relative" }); if (o.rowSize[i] !== "auto") { - if (o.verticalAlign === BI.VerticalAlign.Stretch && o.rowSize[i] === "fill") { - w.element.addClass("f-f"); - } else { + if (!(o.verticalAlign === BI.VerticalAlign.Stretch && o.rowSize[i] === "fill")) { w.element.addClass("f-s-n"); } } 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 8f4eec3f84..b55e14eeb0 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js @@ -37,9 +37,7 @@ BI.FlexWrapperHorizontalLayout = BI.inherit(BI.Layout, { position: "relative" }); if (o.columnSize[i] !== "auto") { - if (o.horizontalAlign === BI.HorizontalAlign.Stretch && o.columnSize[i] !== "") { - w.element.addClass("f-f"); - } else { + if (!(o.horizontalAlign === BI.HorizontalAlign.Stretch && o.columnSize[i] === "fill")) { w.element.addClass("f-s-n"); } } @@ -48,6 +46,7 @@ BI.FlexWrapperHorizontalLayout = BI.inherit(BI.Layout, { } if (o.columnSize[i] === "fill") { w.element.addClass("f-f"); + this.element.addClass("f-f"); } w.element.addClass("c-e"); if (i === 0) { 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 51e657d2a1..d1746b1b7d 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js @@ -37,9 +37,7 @@ BI.FlexWrapperVerticalLayout = BI.inherit(BI.Layout, { position: "relative" }); if (o.rowSize[i] !== "auto") { - if (o.verticalAlign === BI.VerticalAlign.Stretch && o.rowSize[i] !== "") { - w.element.addClass("f-f"); - } else { + if (!(o.verticalAlign === BI.VerticalAlign.Stretch && o.rowSize[i] === "fill")) { w.element.addClass("f-s-n"); } } @@ -48,6 +46,7 @@ BI.FlexWrapperVerticalLayout = BI.inherit(BI.Layout, { } if (o.rowSize[i] === "fill") { w.element.addClass("f-f"); + this.element.addClass("f-f"); } w.element.addClass("c-e"); if (i === 0) { diff --git a/src/less/core/wrapper/flex.wrapper.horizontal.less b/src/less/core/wrapper/flex.wrapper.horizontal.less index 6418929cd5..66af289883 100644 --- a/src/less/core/wrapper/flex.wrapper.horizontal.less +++ b/src/less/core/wrapper/flex.wrapper.horizontal.less @@ -76,6 +76,19 @@ } } + &.f-f { + > .f-s-h-w { + -webkit-flex-shrink: 0; + -moz-flex-shrink: 0; + -ms-flex-shrink: 0; + flex-shrink: 0; + -webkit-flex-grow: 1; + -moz-flex-grow: 1; + -ms-flex-grow: 1; + flex-grow: 1; + } + } + &.h-right { /* 09版 */ -webkit-box-pack: flex-end; @@ -181,10 +194,6 @@ align-items: stretch; } - &.h-stretch { - min-width: 100%; - } - &.h-center { ///* 09版 */ //-webkit-box-pack: center; diff --git a/src/less/core/wrapper/flex.wrapper.vertical.less b/src/less/core/wrapper/flex.wrapper.vertical.less index e9ff07f65b..379ab5bda3 100644 --- a/src/less/core/wrapper/flex.wrapper.vertical.less +++ b/src/less/core/wrapper/flex.wrapper.vertical.less @@ -75,6 +75,19 @@ } } + &.f-f { + > .f-s-v-w { + -webkit-flex-shrink: 0; + -moz-flex-shrink: 0; + -ms-flex-shrink: 0; + flex-shrink: 0; + -webkit-flex-grow: 1; + -moz-flex-grow: 1; + -ms-flex-grow: 1; + flex-grow: 1; + } + } + &.h-right { /* 09版 */ -webkit-box-align: flex-end; @@ -187,10 +200,6 @@ align-items: stretch; } - &.v-stretch { - min-height: 100%; - } - &.v-middle { ///* 09版 */ //-webkit-box-pack: center; diff --git a/src/less/core/wrapper/inline.center.less b/src/less/core/wrapper/inline.center.less index f496460768..019ab0826b 100644 --- a/src/less/core/wrapper/inline.center.less +++ b/src/less/core/wrapper/inline.center.less @@ -1,4 +1,4 @@ -.bi-i-c-a, .bi-inline-center-adapt-layout { +.bi-inline-center-adapt-layout { &:after { display: inline-block; width: 0; @@ -7,7 +7,7 @@ content: ' '; } - & > .i-c-a-item, & > .inline-center-adapt-item { + & > .inline-center-adapt-item { display: inline-block; &.x-icon { diff --git a/src/less/core/wrapper/inline.horizontal.less b/src/less/core/wrapper/inline.horizontal.less index fd90fe0858..fe8c1cd91b 100644 --- a/src/less/core/wrapper/inline.horizontal.less +++ b/src/less/core/wrapper/inline.horizontal.less @@ -1,4 +1,4 @@ -.bi-i-h-a, .bi-inline-horizontal-adapt-layout { +.bi-inline-horizontal-adapt-layout { &:after { display: inline-block; width: 0; @@ -7,7 +7,7 @@ content: ' '; } - & > .i-h-a-item, & > .inline-horizontal-adapt-item { + & > .inline-horizontal-adapt-item { display: inline-block; &.x-icon { diff --git a/src/less/core/wrapper/inline.vertical.less b/src/less/core/wrapper/inline.vertical.less index d91abf2d4b..7118353266 100644 --- a/src/less/core/wrapper/inline.vertical.less +++ b/src/less/core/wrapper/inline.vertical.less @@ -1,4 +1,4 @@ -.bi-i-v-a, .bi-inline-vertical-adapt-layout { +.bi-inline-vertical-adapt-layout { &:after { display: inline-block; width: 0; @@ -7,7 +7,7 @@ content: ' '; } - & > .i-v-a-item, & > .inline-vertical-adapt-item { + & > .inline-vertical-adapt-item { display: inline-block; &.x-icon {