From e926e5b51fbe58b00bf408b97cf1b302e4ebc511 Mon Sep 17 00:00:00 2001 From: git Date: Wed, 28 Jul 2021 22:40:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 1 + src/core/platform/web/config.js | 21 +++++++++++++++++++ .../wrapper/layout/fill/fill.horizontal.js | 6 ++++++ src/core/wrapper/layout/fill/vertical.fill.js | 6 ++++++ 4 files changed, 34 insertions(+) create mode 100644 src/core/wrapper/layout/fill/fill.horizontal.js create mode 100644 src/core/wrapper/layout/fill/vertical.fill.js diff --git a/changelog.md b/changelog.md index 757efbbfb..b9aecbc54 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # 更新日志 2.0(2021-07) +- 新增bi.horizontal_fill、bi.vertical_fill布局 - 增加module定义插件版本号 - bubble使用popper.js实现 - 优化了日期类型控件标红时的报错提示 diff --git a/src/core/platform/web/config.js b/src/core/platform/web/config.js index 03eaefbdd..7a9471bc2 100644 --- a/src/core/platform/web/config.js +++ b/src/core/platform/web/config.js @@ -90,6 +90,27 @@ BI.prepares.push(function () { return BI.extend({}, ob, {type: "bi.inline_horizontal_adapt"}); }); + BI.Plugin.configWidget("bi.horizontal_fill", function (ob) { + if (isSupportFlex()) { + return BI.extend({ + horizontalAlign: BI.HorizontalAlign.Stretch, + verticalAlign: BI.VerticalAlign.Stretch, + scrollx: false + }, ob, {type: "bi.flex_horizontal"}); + } + return BI.extend({}, ob, {type: "bi.htape"}); + }); + BI.Plugin.configWidget("bi.vertical_fill", function (ob) { + if (isSupportFlex()) { + return BI.extend({ + horizontalAlign: BI.HorizontalAlign.Stretch, + verticalAlign: BI.VerticalAlign.Stretch, + scrolly: false + }, ob, {type: "bi.flex_vertical"}); + } + return BI.extend({}, ob, {type: "bi.vtape"}); + }); + BI.Plugin.configWidget("bi.left_right_vertical_adapt", function (ob) { if (isSupportFlex()) { // IE下其实也是可以使用flex布局的,只要排除掉出现滚动条的情况 diff --git a/src/core/wrapper/layout/fill/fill.horizontal.js b/src/core/wrapper/layout/fill/fill.horizontal.js new file mode 100644 index 000000000..72ce8d393 --- /dev/null +++ b/src/core/wrapper/layout/fill/fill.horizontal.js @@ -0,0 +1,6 @@ +/** + * 横向填满布局 + */ +BI.HorizontalFillLayout = function () { +}; +BI.shortcut("bi.horizontal_fill", BI.HorizontalFillLayout); diff --git a/src/core/wrapper/layout/fill/vertical.fill.js b/src/core/wrapper/layout/fill/vertical.fill.js new file mode 100644 index 000000000..9acd9c307 --- /dev/null +++ b/src/core/wrapper/layout/fill/vertical.fill.js @@ -0,0 +1,6 @@ +/** + * 纵向填满布局 + */ +BI.VerticalFillLayout = function () { +}; +BI.shortcut("bi.vertical_fill", BI.VerticalFillLayout);