From e3333e7910857a9874d7eebee5136ee3cc3d47fe Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 2 Apr 2021 16:09:13 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E7=94=9F=E5=91=BD=E5=91=A8=E6=9C=9F?= =?UTF-8?q?=E4=B8=A5=E6=A0=BC=E6=8C=89=E7=85=A7beforemount=20render=20moun?= =?UTF-8?q?ted=E7=9A=84=E9=A1=BA=E5=BA=8F=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/4.widget.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/4.widget.js b/src/core/4.widget.js index e85eefe80..8655b8ef9 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -221,7 +221,10 @@ } this._mount(); - this.__async === true && isMounted && callLifeHook(this, "mounted"); + if (this.__async === true && isMounted) { + callLifeHook(this, "mounted"); + this.fireEvent(BI.Events.MOUNT); + } }, _setParent: function (parent) { From acb54c91ea7c8f8eb6c910c3496bd4b52173ae61 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 2 Apr 2021 22:15:17 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E5=B8=83=E5=B1=80=E5=A4=A7=E4=B8=80?= =?UTF-8?q?=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/platform/web/config.js | 73 +++++++++++++++++---------------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/src/core/platform/web/config.js b/src/core/platform/web/config.js index 030c03897..6b324df12 100644 --- a/src/core/platform/web/config.js +++ b/src/core/platform/web/config.js @@ -20,7 +20,7 @@ BI.prepares.push(function () { } // 在横向自适应场景下我们需要使用table的自适应撑出滚动条的特性(flex处理不了这种情况) // 主要出现在center_adapt或者horizontal_adapt的场景,或者主动设置horizontalAlign的场景 - if (ob.horizontalAlign === BI.HorizontalAlign.Center || ob.horizontalAlign === BI.HorizontalAlign.Stretch) { + // if (ob.horizontalAlign === BI.HorizontalAlign.Center || ob.horizontalAlign === BI.HorizontalAlign.Stretch) { // 虽然有两个元素以上的时候,有场景是控制一个显示一个隐藏的效果,还无法通过flex来实现 // var justOneItem = (ob.items && ob.items.length <= 1); // // 在这种情况下,也可以通过flex支持该布局 @@ -42,8 +42,8 @@ BI.prepares.push(function () { // ? BI.HorizontalAlign.Left : ob.horizontalAlign // }); // } - return BI.extend({}, ob, {type: "bi.table_adapt"}); - } + // return BI.extend({}, ob, {type: "bi.table_adapt"}); + // } if (supportFlex) { // IE下其实也是可以使用flex布局的,只要排除掉出现滚动条的情况 // if (!isIE || (ob.scrollable !== true && ob.scrolly !== true)) { @@ -56,41 +56,42 @@ BI.prepares.push(function () { // type: "bi.inline" // }); // } + return BI.extend({}, ob, {type: "bi.inline"}); // 否则采用table,不过horizontalAlign的right就不支持了。 - return BI.extend({}, ob, {type: "bi.table_adapt"}); - }); - BI.Plugin.configWidget("bi.center_adapt", function (ob) { - var supportFlex = isSupportFlex(), justOneItem = (ob.items && ob.items.length <= 1); - var isAdapt = !ob.horizontalAlign || ob.horizontalAlign === BI.HorizontalAlign.Center || ob.horizontalAlign === BI.HorizontalAlign.Stretch; - if (!isAdapt || justOneItem) { - if (supportFlex) { - // IE下其实也是可以使用flex布局的,只要排除掉出现滚动条的情况 - // if (!isIE || (ob.scrollable !== true && ob.scrollx !== true && ob.scrolly !== true)) { - return BI.extend({}, ob, {type: "bi.flex_center_adapt"}); - // } - } - if (!BI.isIE() || BI.getIEVersion() >= 8) { - return BI.extend({}, ob, {type: "bi.inline_center_adapt"}); - } - } - return ob; - }); - BI.Plugin.configWidget("bi.vertical_adapt", function (ob) { - var supportFlex = isSupportFlex(), justOneItem = (ob.items && ob.items.length <= 1); - var isAdapt = ob.horizontalAlign === BI.HorizontalAlign.Center || ob.horizontalAlign === BI.HorizontalAlign.Stretch; - if (!isAdapt || justOneItem) { - if (supportFlex) { - // IE下其实也是可以使用flex布局的,只要排除掉出现滚动条的情况 - // if (!isIE || (ob.scrollable !== true && ob.scrolly !== true)) { - return BI.extend({}, ob, {type: "bi.flex_vertical_adapt"}); - // } - } - if (!BI.isIE() || BI.getIEVersion() > 8) { - return BI.extend({}, ob, {type: "bi.inline_vertical_adapt"}); - } - } - return ob; + // return BI.extend({}, ob, {type: "bi.table_adapt"}); }); + // BI.Plugin.configWidget("bi.center_adapt", function (ob) { + // var supportFlex = isSupportFlex(), justOneItem = (ob.items && ob.items.length <= 1); + // var isAdapt = !ob.horizontalAlign || ob.horizontalAlign === BI.HorizontalAlign.Center || ob.horizontalAlign === BI.HorizontalAlign.Stretch; + // if (!isAdapt || justOneItem) { + // if (supportFlex) { + // // IE下其实也是可以使用flex布局的,只要排除掉出现滚动条的情况 + // // if (!isIE || (ob.scrollable !== true && ob.scrollx !== true && ob.scrolly !== true)) { + // return BI.extend({}, ob, {type: "bi.flex_center_adapt"}); + // // } + // } + // if (!BI.isIE() || BI.getIEVersion() >= 8) { + // return BI.extend({}, ob, {type: "bi.inline_center_adapt"}); + // } + // } + // return ob; + // }); + // BI.Plugin.configWidget("bi.vertical_adapt", function (ob) { + // var supportFlex = isSupportFlex(), justOneItem = (ob.items && ob.items.length <= 1); + // var isAdapt = ob.horizontalAlign === BI.HorizontalAlign.Center || ob.horizontalAlign === BI.HorizontalAlign.Stretch; + // if (!isAdapt || justOneItem) { + // if (supportFlex) { + // // IE下其实也是可以使用flex布局的,只要排除掉出现滚动条的情况 + // // if (!isIE || (ob.scrollable !== true && ob.scrolly !== true)) { + // return BI.extend({}, ob, {type: "bi.flex_vertical_adapt"}); + // // } + // } + // if (!BI.isIE() || BI.getIEVersion() > 8) { + // return BI.extend({}, ob, {type: "bi.inline_vertical_adapt"}); + // } + // } + // return ob; + // }); BI.Plugin.configWidget("bi.horizontal_adapt", function (ob) { var justOneItem = (ob.items && ob.items.length <= 1); if (!ob.verticalAlign || ob.verticalAlign === BI.VerticalAlign.TOP) { From 5c0f3df3e9a4ca82948823002a74b42b2edc63d5 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 2 Apr 2021 22:20:16 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E5=B8=83=E5=B1=80=E5=A4=A7=E4=B8=80?= =?UTF-8?q?=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/platform/web/config.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/core/platform/web/config.js b/src/core/platform/web/config.js index 6b324df12..cf49db71c 100644 --- a/src/core/platform/web/config.js +++ b/src/core/platform/web/config.js @@ -14,10 +14,6 @@ BI.prepares.push(function () { return _isSupportFlex; }; BI.Plugin.configWidget("bi.horizontal", function (ob) { - var isIE = BI.isIE(), supportFlex = isSupportFlex(), isLessIE8 = isIE && BI.getIEVersion() < 8; - if (isLessIE8) { - return ob; - } // 在横向自适应场景下我们需要使用table的自适应撑出滚动条的特性(flex处理不了这种情况) // 主要出现在center_adapt或者horizontal_adapt的场景,或者主动设置horizontalAlign的场景 // if (ob.horizontalAlign === BI.HorizontalAlign.Center || ob.horizontalAlign === BI.HorizontalAlign.Stretch) { @@ -44,7 +40,7 @@ BI.prepares.push(function () { // } // return BI.extend({}, ob, {type: "bi.table_adapt"}); // } - if (supportFlex) { + if (isSupportFlex()) { // IE下其实也是可以使用flex布局的,只要排除掉出现滚动条的情况 // if (!isIE || (ob.scrollable !== true && ob.scrolly !== true)) { return BI.extend({}, ob, {type: "bi.flex_horizontal"}); From 683dbd435b03fe2f15b63d35c4ca60c3ccb74d61 Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 3 Apr 2021 12:53:00 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E5=B8=83=E5=B1=80=E5=A4=A7=E4=B8=80?= =?UTF-8?q?=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/label/abstract.label.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/base/single/label/abstract.label.js b/src/base/single/label/abstract.label.js index 9a660c46d..d5a377fae 100644 --- a/src/base/single/label/abstract.label.js +++ b/src/base/single/label/abstract.label.js @@ -83,7 +83,7 @@ }); return; } - if (o.whiteSpace == "normal") { // 1.3 + if (o.whiteSpace === "normal") { // 1.3 BI.extend(json, { hgap: o.hgap, vgap: o.vgap, @@ -152,7 +152,7 @@ }); return; } - if (o.whiteSpace == "normal") { // 1.7 + if (o.whiteSpace === "normal") { // 1.7 BI.extend(json, { hgap: o.hgap, vgap: o.vgap, From dd8e8e56a25235411efb8be75dc72bdb19e3dc47 Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 3 Apr 2021 14:03:41 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E5=B8=83=E5=B1=80=E5=A4=A7=E4=B8=80?= =?UTF-8?q?=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/label/abstract.label.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/base/single/label/abstract.label.js b/src/base/single/label/abstract.label.js index d5a377fae..494824051 100644 --- a/src/base/single/label/abstract.label.js +++ b/src/base/single/label/abstract.label.js @@ -211,6 +211,7 @@ var o = this.options; var adaptLayout = "bi.vertical_adapt"; var json = this._createJson(); + json.textAlign = "left"; if (BI.isNumber(o.width) && o.width > 0) { if (BI.isNumber(o.textWidth) && o.textWidth > 0) { json.width = o.textWidth; @@ -251,6 +252,7 @@ return; } if (BI.isNumber(o.height) && o.height > 0) { // 2.3 + json.textAlign = o.textAlign; this.text = BI.createWidget(BI.extend(json, { element: this, hgap: o.hgap, @@ -314,6 +316,7 @@ "line-height": (o.height - (o.vgap * 2)) / BI.pixRatio + BI.pixUnit }); } + json.textAlign = o.textAlign; this.text = BI.createWidget(BI.extend(json, { // 2.6 element: this, hgap: o.hgap, From bc3e70af01346fb154c8011582aecd1c4322523f Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 3 Apr 2021 14:13:56 +0800 Subject: [PATCH 06/14] =?UTF-8?q?=E5=B8=83=E5=B1=80=E5=A4=A7=E4=B8=80?= =?UTF-8?q?=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/label/abstract.label.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/base/single/label/abstract.label.js b/src/base/single/label/abstract.label.js index 494824051..d5a377fae 100644 --- a/src/base/single/label/abstract.label.js +++ b/src/base/single/label/abstract.label.js @@ -211,7 +211,6 @@ var o = this.options; var adaptLayout = "bi.vertical_adapt"; var json = this._createJson(); - json.textAlign = "left"; if (BI.isNumber(o.width) && o.width > 0) { if (BI.isNumber(o.textWidth) && o.textWidth > 0) { json.width = o.textWidth; @@ -252,7 +251,6 @@ return; } if (BI.isNumber(o.height) && o.height > 0) { // 2.3 - json.textAlign = o.textAlign; this.text = BI.createWidget(BI.extend(json, { element: this, hgap: o.hgap, @@ -316,7 +314,6 @@ "line-height": (o.height - (o.vgap * 2)) / BI.pixRatio + BI.pixUnit }); } - json.textAlign = o.textAlign; this.text = BI.createWidget(BI.extend(json, { // 2.6 element: this, hgap: o.hgap, From dc9b683fea32f3b95108f1680b39e864cf159fff Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 3 Apr 2021 21:59:43 +0800 Subject: [PATCH 07/14] =?UTF-8?q?=E5=B8=83=E5=B1=80=E5=A4=A7=E4=B8=80?= =?UTF-8?q?=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 a618e3a59..53ecdd50f 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 e78b4a103..6eeb1abe0 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 8f4eec3f8..b55e14eeb 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 51e657d2a..d1746b1b7 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 6418929cd..66af28988 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 e9ff07f65..379ab5bda 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 f49646076..019ab0826 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 fd90fe085..fe8c1cd91 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 d91abf2d4..711835326 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 { From f1cc052753a0ad2a8fabe6f1f1b826630d74f430 Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 3 Apr 2021 22:16:38 +0800 Subject: [PATCH 08/14] =?UTF-8?q?=E5=B8=83=E5=B1=80=E5=A4=A7=E4=B8=80?= =?UTF-8?q?=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/less/core/wrapper/flex.wrapper.horizontal.less | 7 +++++++ src/less/core/wrapper/flex.wrapper.vertical.less | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/less/core/wrapper/flex.wrapper.horizontal.less b/src/less/core/wrapper/flex.wrapper.horizontal.less index 66af28988..60ee332c7 100644 --- a/src/less/core/wrapper/flex.wrapper.horizontal.less +++ b/src/less/core/wrapper/flex.wrapper.horizontal.less @@ -86,6 +86,13 @@ -moz-flex-grow: 1; -ms-flex-grow: 1; flex-grow: 1; + + &.h-stretch { + -webkit-flex-shrink: 1; + -moz-flex-shrink: 1; + -ms-flex-shrink: 1; + flex-shrink: 1; + } } } diff --git a/src/less/core/wrapper/flex.wrapper.vertical.less b/src/less/core/wrapper/flex.wrapper.vertical.less index 379ab5bda..c4f1b1468 100644 --- a/src/less/core/wrapper/flex.wrapper.vertical.less +++ b/src/less/core/wrapper/flex.wrapper.vertical.less @@ -85,6 +85,13 @@ -moz-flex-grow: 1; -ms-flex-grow: 1; flex-grow: 1; + + &.v-middle { + -webkit-flex-shrink: 1; + -moz-flex-shrink: 1; + -ms-flex-shrink: 1; + flex-shrink: 1; + } } } From 96a9da2d1c08027f0e29220f6dfb8f6f5ba72eb7 Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 4 Apr 2021 13:20:58 +0800 Subject: [PATCH 09/14] =?UTF-8?q?=E5=B8=83=E5=B1=80=E5=A4=A7=E4=B8=80?= =?UTF-8?q?=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 | 2 +- src/core/wrapper/layout/flex/flex.vertical.js | 2 +- src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js | 2 +- src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/wrapper/layout/flex/flex.horizontal.js b/src/core/wrapper/layout/flex/flex.horizontal.js index 53ecdd50f..557aecfe8 100644 --- a/src/core/wrapper/layout/flex/flex.horizontal.js +++ b/src/core/wrapper/layout/flex/flex.horizontal.js @@ -41,7 +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")) { + if (!(o.horizontalAlign === BI.HorizontalAlign.Stretch && (o.columnSize[i] === "fill" || o.columnSize[i] === ""))) { 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 6eeb1abe0..52f66df43 100644 --- a/src/core/wrapper/layout/flex/flex.vertical.js +++ b/src/core/wrapper/layout/flex/flex.vertical.js @@ -40,7 +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")) { + if (!(o.verticalAlign === BI.VerticalAlign.Stretch && (o.rowSize[i] === "fill" || o.rowSize[i] === ""))) { 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 b55e14eeb..e9ec1c3e3 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js @@ -37,7 +37,7 @@ BI.FlexWrapperHorizontalLayout = BI.inherit(BI.Layout, { position: "relative" }); if (o.columnSize[i] !== "auto") { - if (!(o.horizontalAlign === BI.HorizontalAlign.Stretch && o.columnSize[i] === "fill")) { + if (!(o.horizontalAlign === BI.HorizontalAlign.Stretch && (o.columnSize[i] === "fill" || o.columnSize[i] === ""))) { w.element.addClass("f-s-n"); } } 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 d1746b1b7..7f7ce5784 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js @@ -37,7 +37,7 @@ BI.FlexWrapperVerticalLayout = BI.inherit(BI.Layout, { position: "relative" }); if (o.rowSize[i] !== "auto") { - if (!(o.verticalAlign === BI.VerticalAlign.Stretch && o.rowSize[i] === "fill")) { + if (!(o.verticalAlign === BI.VerticalAlign.Stretch && (o.rowSize[i] === "fill" && o.rowSize[i] === ""))) { w.element.addClass("f-s-n"); } } From 7f005618caf95f95eaa7eb3e7cb3bcfaff58894b Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 4 Apr 2021 13:42:48 +0800 Subject: [PATCH 10/14] =?UTF-8?q?=E5=B8=83=E5=B1=80=E5=A4=A7=E4=B8=80?= =?UTF-8?q?=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/less/core/wrapper/flex.wrapper.horizontal.less | 10 ++++++++++ src/less/core/wrapper/flex.wrapper.vertical.less | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/less/core/wrapper/flex.wrapper.horizontal.less b/src/less/core/wrapper/flex.wrapper.horizontal.less index 60ee332c7..3ee074ea6 100644 --- a/src/less/core/wrapper/flex.wrapper.horizontal.less +++ b/src/less/core/wrapper/flex.wrapper.horizontal.less @@ -96,6 +96,16 @@ } } + &.h-stretch { + > .f-s-h-w { + -webkit-flex-shrink: 1; + -moz-flex-shrink: 1; + -ms-flex-shrink: 1; + flex-shrink: 1; + max-width: 100%; + } + } + &.h-right { /* 09版 */ -webkit-box-pack: flex-end; diff --git a/src/less/core/wrapper/flex.wrapper.vertical.less b/src/less/core/wrapper/flex.wrapper.vertical.less index c4f1b1468..16c3ad05c 100644 --- a/src/less/core/wrapper/flex.wrapper.vertical.less +++ b/src/less/core/wrapper/flex.wrapper.vertical.less @@ -95,6 +95,16 @@ } } + &.v-stretch { + > .f-s-v-w { + -webkit-flex-shrink: 1; + -moz-flex-shrink: 1; + -ms-flex-shrink: 1; + flex-shrink: 1; + max-height: 100%; + } + } + &.h-right { /* 09版 */ -webkit-box-align: flex-end; From 08c9043abbf8ac51320c4081583501ce0ed6df9b Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 4 Apr 2021 14:09:00 +0800 Subject: [PATCH 11/14] =?UTF-8?q?=E5=B8=83=E5=B1=80=E5=A4=A7=E4=B8=80?= =?UTF-8?q?=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/wrapper/layout/layout.inline.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core/wrapper/layout/layout.inline.js b/src/core/wrapper/layout/layout.inline.js index ea4c6dc5a..1d2528bcd 100644 --- a/src/core/wrapper/layout/layout.inline.js +++ b/src/core/wrapper/layout/layout.inline.js @@ -42,7 +42,7 @@ BI.InlineLayout = BI.inherit(BI.Layout, { "vertical-align": o.verticalAlign }); w.element.addClass("i-item"); - if (o.columnSize[i] === "fill") { + if (o.columnSize[i] === "fill" || o.columnSize[i] === "") { var left = o.hgap + (item.lgap || 0) + (item.hgap || 0), right = o.hgap + (item.rgap || 0) + (item.hgap || 0); for (var k = 0; k < i; k++) { @@ -51,9 +51,11 @@ BI.InlineLayout = BI.inherit(BI.Layout, { for (var k = i + 1; k < o.columnSize.length; k++) { right += o.hgap + o.lgap + o.rgap + o.columnSize[k]; } - w.element.css("min-width", "calc(100% - " + ((left + right) / BI.pixRatio + BI.pixUnit) + ")"); + if (o.columnSize[i] === "fill") { + w.element.css("min-width", "calc(100% - " + ((left + right) / BI.pixRatio + BI.pixUnit) + ")"); + } if (o.horizontalAlign === BI.HorizontalAlign.Stretch) { - w.element.width(0); + w.element.css("max-width", "calc(100% - " + ((left + right) / BI.pixRatio + BI.pixUnit) + ")"); } } if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { From 6e1bb0287003989fc90f672db1151b917bfb4db1 Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 4 Apr 2021 16:47:06 +0800 Subject: [PATCH 12/14] =?UTF-8?q?=E5=B8=83=E5=B1=80=E5=A4=A7=E4=B8=80?= =?UTF-8?q?=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/wrapper/flex.wrapper.horizontal.less | 16 ++++++++-------- .../core/wrapper/flex.wrapper.vertical.less | 18 +++++++++--------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/less/core/wrapper/flex.wrapper.horizontal.less b/src/less/core/wrapper/flex.wrapper.horizontal.less index 3ee074ea6..d7433f147 100644 --- a/src/less/core/wrapper/flex.wrapper.horizontal.less +++ b/src/less/core/wrapper/flex.wrapper.horizontal.less @@ -168,14 +168,14 @@ &.v-middle { ///* 09版 */ - //-webkit-box-align: center; - ///* 12版 */ - //-webkit-align-items: center; - //-moz-align-items: center; - //-ms-align-items: center; - //-ms-flex-align: center; - //-o-align-items: center; - //align-items: center; + -webkit-box-align: center; + /* 12版 */ + -webkit-align-items: center; + -moz-align-items: center; + -ms-align-items: center; + -ms-flex-align: center; + -o-align-items: center; + align-items: center; //> .c-e { // margin-top: auto !important; diff --git a/src/less/core/wrapper/flex.wrapper.vertical.less b/src/less/core/wrapper/flex.wrapper.vertical.less index 16c3ad05c..c836d9244 100644 --- a/src/less/core/wrapper/flex.wrapper.vertical.less +++ b/src/less/core/wrapper/flex.wrapper.vertical.less @@ -177,15 +177,15 @@ //min-width: 100%; &.h-center { - ///* 09版 */ - //-webkit-box-align: center; - ///* 12版 */ - //-webkit-align-items: center; - //-moz-align-items: center; - //-ms-align-items: center; - //-ms-flex-align: center; - //-o-align-items: center; - //align-items: center; + /* 09版 */ + -webkit-box-align: center; + /* 12版 */ + -webkit-align-items: center; + -moz-align-items: center; + -ms-align-items: center; + -ms-flex-align: center; + -o-align-items: center; + align-items: center; //> .c-e { // margin-left: auto !important; From b2156b4e57f06cad9e2571816e8586de8969872d Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 4 Apr 2021 17:10:20 +0800 Subject: [PATCH 13/14] =?UTF-8?q?=E5=B8=83=E5=B1=80=E5=A4=A7=E4=B8=80?= =?UTF-8?q?=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/less/core/wrapper/flex.wrapper.horizontal.less | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/less/core/wrapper/flex.wrapper.horizontal.less b/src/less/core/wrapper/flex.wrapper.horizontal.less index d7433f147..a54b68075 100644 --- a/src/less/core/wrapper/flex.wrapper.horizontal.less +++ b/src/less/core/wrapper/flex.wrapper.horizontal.less @@ -131,6 +131,18 @@ align-items: flex-end; } + &.v-stretch { + /* 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; + } + & .f-s-h-w, & .flex-scrollable-horizontal-layout-wrapper { .flex(); .horizontal(); From e47da52d7b1f05073229600bb88a42840fdfd3b6 Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 4 Apr 2021 17:44:21 +0800 Subject: [PATCH 14/14] =?UTF-8?q?=E5=B8=83=E5=B1=80=E5=A4=A7=E4=B8=80?= =?UTF-8?q?=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/less/core/wrapper/flex.horizontal.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/less/core/wrapper/flex.horizontal.less b/src/less/core/wrapper/flex.horizontal.less index 5ad67aee9..b58fe25c4 100644 --- a/src/less/core/wrapper/flex.horizontal.less +++ b/src/less/core/wrapper/flex.horizontal.less @@ -73,7 +73,7 @@ -o-align-items: center; align-items: center; - &.f-scroll-x { + &.f-scroll-y { /* 09版 */ -webkit-box-align: flex-start; /* 12版 */