From 0be831e36d6426e5587b790cca1a5495d3e5cd2f Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 19 Feb 2021 18:46:42 +0800 Subject: [PATCH] bugfix --- .../wrapper/layout/flex/flex.horizontal.js | 4 +- src/core/wrapper/layout/flex/flex.vertical.js | 4 +- .../flex/wrapper/flex.wrapper.horizontal.js | 4 +- .../flex/wrapper/flex.wrapper.vertical.js | 4 +- src/less/core/wrapper/flex.horizontal.less | 38 ------------------- src/less/core/wrapper/flex.vertical.less | 38 ------------------- .../core/wrapper/flex.wrapper.horizontal.less | 38 ------------------- .../core/wrapper/flex.wrapper.vertical.less | 38 ------------------- 8 files changed, 12 insertions(+), 156 deletions(-) diff --git a/src/core/wrapper/layout/flex/flex.horizontal.js b/src/core/wrapper/layout/flex/flex.horizontal.js index 7d20450601..a6e23c2f01 100644 --- a/src/core/wrapper/layout/flex/flex.horizontal.js +++ b/src/core/wrapper/layout/flex/flex.horizontal.js @@ -34,7 +34,9 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, { w.element.css({ position: "relative" }); - if (o.horizontalAlign !== BI.HorizontalAlign.Stretch && o.columnSize[i] !== "auto") { + if (o.horizontalAlign === BI.HorizontalAlign.Stretch && o.columnSize[i] !== "") { + w.element.addClass("fill"); + } else { w.element.addClass("shrink-none"); } if (o.columnSize[i] > 0) { diff --git a/src/core/wrapper/layout/flex/flex.vertical.js b/src/core/wrapper/layout/flex/flex.vertical.js index 34acdb4c3f..7a78b1bbab 100644 --- a/src/core/wrapper/layout/flex/flex.vertical.js +++ b/src/core/wrapper/layout/flex/flex.vertical.js @@ -33,7 +33,9 @@ BI.FlexVerticalLayout = BI.inherit(BI.Layout, { w.element.css({ position: "relative" }); - if (o.verticalAlign !== BI.VerticalAlign.Stretch && o.rowSize[i] !== "auto") { + if (o.verticalAlign === BI.VerticalAlign.Stretch && o.rowSize[i] !== "") { + w.element.addClass("fill"); + } else { w.element.addClass("shrink-none"); } if (o.rowSize[i] > 0) { 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 1a3e62bb6e..e8286ddb27 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js @@ -35,7 +35,9 @@ BI.FlexWrapperHorizontalLayout = BI.inherit(BI.Layout, { w.element.css({ position: "relative" }); - if (o.horizontalAlign !== BI.HorizontalAlign.Stretch && o.columnSize[i] !== "auto") { + if (o.horizontalAlign === BI.HorizontalAlign.Stretch && o.columnSize[i] !== "") { + w.element.addClass("fill"); + } else { w.element.addClass("shrink-none"); } if (o.columnSize[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 0af54996ca..3edb0bc9e7 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js @@ -35,7 +35,9 @@ BI.FlexWrapperVerticalLayout = BI.inherit(BI.Layout, { w.element.css({ position: "relative" }); - if (o.verticalAlign !== BI.VerticalAlign.Stretch && o.rowSize[i] !== "auto") { + if (o.verticalAlign === BI.VerticalAlign.Stretch && o.rowSize[i] !== "") { + w.element.addClass("fill"); + } else { w.element.addClass("shrink-none"); } if (o.rowSize[i] > 0) { diff --git a/src/less/core/wrapper/flex.horizontal.less b/src/less/core/wrapper/flex.horizontal.less index d6122ff4fe..2c8f4301f2 100644 --- a/src/less/core/wrapper/flex.horizontal.less +++ b/src/less/core/wrapper/flex.horizontal.less @@ -119,44 +119,6 @@ flex-direction: row-reverse; } - &.h-stretch { - .vertical(); - - /* 09版 */ - -webkit-box-align: stretch; - /* 12版 */ - -webkit-align-items: stretch; - -moz-align-items: stretch; - -ms-align-items: stretch; - -ms-flex-align: stretch; - -o-align-items: stretch; - align-items: stretch; - - &.v-middle { - /* 09版 */ - -webkit-box-pack: center; - /* 12版 */ - -webkit-justify-content: center; - -moz-justify-content: center; - -ms-justify-content: center; - -o-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - } - - &.v-bottom { - /* 09版 */ - -webkit-box-pack: flex-end; - /* 12版 */ - -webkit-justify-content: flex-end; - -moz-justify-content: flex-end; - -ms-justify-content: flex-end; - -o-justify-content: flex-end; - -ms-flex-pack: flex-end; - justify-content: flex-end; - } - } - > .shrink-none { -webkit-flex-shrink: 0; -moz-flex-shrink: 0; diff --git a/src/less/core/wrapper/flex.vertical.less b/src/less/core/wrapper/flex.vertical.less index 0e8c7b5019..d1fe9a73d0 100644 --- a/src/less/core/wrapper/flex.vertical.less +++ b/src/less/core/wrapper/flex.vertical.less @@ -118,44 +118,6 @@ flex-direction: column-reverse; } - &.v-stretch { - .horizontal(); - - /* 09版 */ - -webkit-box-align: stretch; - /* 12版 */ - -webkit-align-items: stretch; - -moz-align-items: stretch; - -ms-align-items: stretch; - -ms-flex-align: stretch; - -o-align-items: stretch; - align-items: stretch; - - &.h-center { - /* 09版 */ - -webkit-box-pack: center; - /* 12版 */ - -webkit-justify-content: center; - -moz-justify-content: center; - -ms-justify-content: center; - -ms-flex-pack: center; - -o-justify-content: center; - justify-content: center; - } - - &.h-right { - /* 09版 */ - -webkit-box-pack: flex-end; - /* 12版 */ - -webkit-justify-content: flex-end; - -moz-justify-content: flex-end; - -ms-justify-content: flex-end; - -ms-flex-pack: flex-end; - -o-justify-content: flex-end; - justify-content: flex-end; - } - } - > .shrink-none { -webkit-flex-shrink: 0; -moz-flex-shrink: 0; diff --git a/src/less/core/wrapper/flex.wrapper.horizontal.less b/src/less/core/wrapper/flex.wrapper.horizontal.less index 98290029f0..d0bb627b99 100644 --- a/src/less/core/wrapper/flex.wrapper.horizontal.less +++ b/src/less/core/wrapper/flex.wrapper.horizontal.less @@ -126,44 +126,6 @@ flex-direction: row-reverse; } - &.h-stretch { - .vertical(); - - /* 09版 */ - -webkit-box-align: stretch; - /* 12版 */ - -webkit-align-items: stretch; - -moz-align-items: stretch; - -ms-align-items: stretch; - -ms-flex-align: stretch; - -o-align-items: stretch; - align-items: stretch; - - &.v-middle { - /* 09版 */ - -webkit-box-pack: center; - /* 12版 */ - -webkit-justify-content: center; - -moz-justify-content: center; - -ms-justify-content: center; - -ms-flex-pack: center; - -o-justify-content: center; - justify-content: center; - } - - &.v-bottom { - /* 09版 */ - -webkit-box-pack: flex-end; - /* 12版 */ - -webkit-justify-content: flex-end; - -moz-justify-content: flex-end; - -ms-justify-content: flex-end; - -ms-flex-pack: end; - -o-justify-content: flex-end; - justify-content: flex-end; - } - } - > .shrink-none { -webkit-flex-shrink: 0; -moz-flex-shrink: 0; diff --git a/src/less/core/wrapper/flex.wrapper.vertical.less b/src/less/core/wrapper/flex.wrapper.vertical.less index 1992d7757f..c429b32aba 100644 --- a/src/less/core/wrapper/flex.wrapper.vertical.less +++ b/src/less/core/wrapper/flex.wrapper.vertical.less @@ -126,44 +126,6 @@ flex-direction: column-reverse; } - &.v-stretch { - .horizontal(); - - /* 09版 */ - -webkit-box-align: stretch; - /* 12版 */ - -webkit-align-items: stretch; - -moz-align-items: stretch; - -ms-align-items: stretch; - -ms-flex-align: stretch; - -o-align-items: stretch; - align-items: stretch; - - &.h-center { - /* 09版 */ - -webkit-box-pack: center; - /* 12版 */ - -webkit-justify-content: center; - -moz-justify-content: center; - -ms-justify-content: center; - -ms-flex-pack: center; - -o-justify-content: center; - justify-content: center; - } - - &.h-right { - /* 09版 */ - -webkit-box-pack: flex-end; - /* 12版 */ - -webkit-justify-content: flex-end; - -moz-justify-content: flex-end; - -ms-justify-content: flex-end; - -ms-flex-pack: flex-end; - -o-justify-content: flex-end; - justify-content: flex-end; - } - } - > .shrink-none { -webkit-flex-shrink: 0; -moz-flex-shrink: 0;