From 7871535f63ba8a22bd38a2faddc3905d60b923ae Mon Sep 17 00:00:00 2001 From: "Kevin.King" Date: Mon, 12 Dec 2022 10:28:08 +0800 Subject: [PATCH 1/3] =?UTF-8?q?REPORT-84736=20feat:=20=E5=A4=9A=E9=97=A8?= =?UTF-8?q?=E6=88=B7=E9=A6=96=E9=A1=B5=E5=88=87=E6=8D=A2-=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E5=89=8D=E7=AB=AF=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/linearsegment/linear.segment.js | 10 +++++++++- src/case/segment/segment.js | 9 +++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/case/linearsegment/linear.segment.js b/src/case/linearsegment/linear.segment.js index b0b00f95b..41d282263 100644 --- a/src/case/linearsegment/linear.segment.js +++ b/src/case/linearsegment/linear.segment.js @@ -47,6 +47,14 @@ BI.LinearSegment = BI.inherit(BI.Widget, { getValue: function () { return this.buttonGroup.getValue(); - } + }, + + populate: function (buttons) { + var o = this.options; + this.buttonGroup.populate([BI.createItems(buttons, { + type: "bi.linear_segment_button", + height: o.height + })]) + }, }); BI.shortcut("bi.linear_segment", BI.LinearSegment); diff --git a/src/case/segment/segment.js b/src/case/segment/segment.js index 3f323ffb6..2c1dda918 100644 --- a/src/case/segment/segment.js +++ b/src/case/segment/segment.js @@ -58,6 +58,15 @@ BI.Segment = BI.inherit(BI.Widget, { getValue: function () { return this.buttonGroup.getValue(); }, + + populate: function (buttons) { + var o = this.options; + this.buttonGroup.populate([BI.createItems(buttons, { + type: "bi.segment_button", + height: BI.toPix(o.height, 2), + whiteSpace: o.whiteSpace, + })]); + }, }); BI.Segment.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.segment", BI.Segment); From 142ef968c88af9d055ff1c0a90dfab4cd80d0e8f Mon Sep 17 00:00:00 2001 From: zsmj Date: Mon, 12 Dec 2022 18:43:05 +0800 Subject: [PATCH 2/3] =?UTF-8?q?KERNEL-11877=20feat:=20=E4=BF=AE=E5=A4=8Dbu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 默认支持CSSTransform --- src/base/combination/combo.js | 12 +++++++----- src/core/platform/web/dom.js | 8 ++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/base/combination/combo.js b/src/base/combination/combo.js index 6f2b3a326..879313495 100644 --- a/src/base/combination/combo.js +++ b/src/base/combination/combo.js @@ -220,7 +220,7 @@ }, }, } : this.combo; - var positionRelativeElement = o.supportCSSTransform ? BI.DOM.getPositionRelativeContainingBlock(BI.isNull(o.container) ? this.element[0] : BI.Widget._renderEngine.createElement(BI.isFunction(o.container) ? o.container() : o.container)[0]) : null; + var positionRelativeElement = BI.DOM.getPositionRelativeContainingBlock(BI.isNull(o.container) ? this.element[0] : BI.Widget._renderEngine.createElement(BI.isFunction(o.container) ? o.container() : o.container)[0]); switch (o.direction) { case "bottom": case "bottom,right": @@ -290,10 +290,6 @@ break; } - if ("adaptHeight" in p) { - this.resetListHeight(p.adaptHeight); - } - var width = this.combo.element.outerWidth(); var height = this.combo.element.outerHeight(); this.popupView.setDirection && this.popupView.setDirection(p.dir, { @@ -314,6 +310,12 @@ p.top && (p.top = p.top / scaleY); p.left && (p.left = p.left / scaleX); + + p.adaptHeight && (p.adaptHeight = p.adaptHeight / scaleY); + } + + if ("adaptHeight" in p) { + this.resetListHeight(p.adaptHeight); } if ("left" in p) { diff --git a/src/core/platform/web/dom.js b/src/core/platform/web/dom.js index 66e970b56..17dd9d479 100644 --- a/src/core/platform/web/dom.js +++ b/src/core/platform/web/dom.js @@ -327,7 +327,7 @@ top = comboOffset.top - containerBounds.top + extraHeight; } else if (needAdaptHeight) { top = comboBounds.top - containerBounds.top + extraHeight; - adaptHeight = viewportBounds.height - top; + adaptHeight = viewportBounds.height - comboBounds.top; } else if (BI.DOM.isTopSpaceEnough(combo, popup, -1 * comboBounds.height + extraHeight)) { // 下方空间不足且不允许调整高度的情况下,优先使用上对齐 top = comboBounds.top + comboBounds.height - popupBounds.height - containerBounds.top - extraHeight; @@ -671,13 +671,13 @@ }, - getComboPosition: function (combo, popup, extraWidth, extraHeight, needAdaptHeight, directions, offsetStyle, container) { + getComboPosition: function (combo, popup, extraWidth, extraHeight, needAdaptHeight, directions, offsetStyle, positionRelativeElement) { extraWidth || (extraWidth = 0); extraHeight || (extraHeight = 0); var bodyHeight = BI.Widget._renderEngine.createElement("body").bounds().height - extraHeight; var maxHeight = Math.min(popup.attr("maxHeight") || bodyHeight, bodyHeight); popup.resetHeight && popup.resetHeight(maxHeight); - var position = BI.DOM.getComboPositionByDirections(combo, popup, extraWidth, extraHeight, needAdaptHeight, directions || ["bottom", "top", "right", "left"], container); + var position = BI.DOM.getComboPositionByDirections(combo, popup, extraWidth, extraHeight, needAdaptHeight, directions || ["bottom", "top", "right", "left"], positionRelativeElement); switch (offsetStyle) { case "center": if (position.change) { @@ -699,7 +699,7 @@ break; } if (needAdaptHeight === true) { - popup.resetHeight && popup.resetHeight(Math.min(bodyHeight - position.top, maxHeight)); + popup.resetHeight && popup.resetHeight(Math.min(bodyHeight - position.top + (positionRelativeElement ? positionRelativeElement.getBoundingClientRect().top : 0), maxHeight)); } return position; }, From bba36875288af7f8c063fc6181ffe4028c3d4a3d Mon Sep 17 00:00:00 2001 From: "Jimmy.Chai" Date: Mon, 12 Dec 2022 22:58:27 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=97=A0=20jira=20=E4=BB=BB=E5=8A=A1=20ref?= =?UTF-8?q?actor:=20=E7=B1=BB=E5=9E=8B=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/base/single/button/button.basic.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/base/single/button/button.basic.ts b/typescript/base/single/button/button.basic.ts index 95ee1a3c3..24cfc2484 100644 --- a/typescript/base/single/button/button.basic.ts +++ b/typescript/base/single/button/button.basic.ts @@ -38,7 +38,7 @@ export declare class BasicButton extends Single { trigger?: string | null; handler?: Function; bubble?: Function | null | string; - text?: string; + text?: string | ((context: any) => string); el?: Obj; } & Single["props"];