Browse Source

Pull request #211564: Release/11.0

Merge in DEC/fineui from ~IMP/dec-fineui:release/11.0 to release/11.0

* commit 'a2fdd6ac25d8fdc7dbff51d023dc27fc4ea228e3':
  auto upgrade version to 2.0.20221210193709
  KERNEL-11877 feat: direction:bottom和direction:top空间不够时的调整逻辑
  KERNEL-11877 feat: container支持函数, 修复错误
  auto upgrade version to 2.0.20221209162625
  auto upgrade version to 2.0.20221209142506
  auto upgrade version to 2.0.20221209120344
research/test
imp-张健 2 years ago
parent
commit
bd1ae3840f
  1. 2
      package.json
  2. 1
      src/case/combo/bubblecombo/combo.bubble.js
  3. 35
      src/core/platform/web/dom.js
  4. 2
      src/less/core/utils/motion/zoom.less

2
package.json

@ -1,6 +1,6 @@
{
"name": "fineui",
"version": "2.0.20221208185443",
"version": "2.0.20221210193709",
"description": "fineui",
"main": "dist/fineui_without_conflict.min.js",
"types": "dist/lib/index.d.ts",

1
src/case/combo/bubblecombo/combo.bubble.js

@ -53,6 +53,7 @@ BI.BubbleCombo = BI.inherit(BI.Widget, {
offsetStyle: o.offsetStyle,
showArrow: true,
comboClass: o.comboClass,
supportCSSTransform: o.supportCSSTransform,
el: o.el,
popup: () => BI.extend({
type: "bi.bubble_popup_view",

35
src/core/platform/web/dom.js

@ -219,9 +219,9 @@
},
isRightSpaceEnough: function (combo, popup, extraWidth) {
var viewBounds = popup.element.bounds(),
windowBounds = BI.Widget._renderEngine.createElement("body").bounds();
return BI.DOM.getRightPosition(combo, popup, extraWidth).left + viewBounds.width <= windowBounds.width;
var viewBounds = popup.element[0].getBoundingClientRect(),
viewportBounds = document.documentElement.getBoundingClientRect();
return BI.DOM.getRightPosition(combo, popup, extraWidth).left + viewBounds.width <= viewportBounds.width;
},
isInnerRightSpaceEnough: function (combo, popup, extraWidth) {
@ -233,9 +233,9 @@
},
isBottomSpaceEnough: function (combo, popup, extraHeight) {
var viewBounds = popup.element.bounds(),
windowBounds = BI.Widget._renderEngine.createElement("body").bounds();
return BI.DOM.getBottomPosition(combo, popup, extraHeight).top + viewBounds.height <= windowBounds.height;
var viewBounds = popup.element[0].getBoundingClientRect(),
viewportBounds = document.documentElement.getBoundingClientRect();
return BI.DOM.getBottomPosition(combo, popup, extraHeight).top + viewBounds.height <= viewportBounds.height;
},
isRightSpaceLarger: function (combo) {
@ -318,23 +318,24 @@
getTopAlignPosition: function (combo, popup, extraHeight, needAdaptHeight, container) {
var comboOffset = combo.element.offset();
var comboBounds = combo.element.bounds(), popupBounds = popup.element.bounds(),
windowBounds = BI.Widget._renderEngine.createElement("body").bounds(),
var comboBounds = combo.element[0].getBoundingClientRect(),
popupBounds = popup.element[0].getBoundingClientRect(),
viewportBounds = document.documentElement.getBoundingClientRect(),
containerBounds = container ? container.getBoundingClientRect() : { top: 0 };
var top, adaptHeight, dir;
if (BI.DOM.isBottomSpaceEnough(combo, popup, -1 * comboBounds.height + extraHeight)) {
top = comboOffset.top - containerBounds.top + extraHeight;
} else if (needAdaptHeight) {
top = comboOffset.top + extraHeight;
adaptHeight = windowBounds.height - top;
top = comboBounds.top - containerBounds.top + extraHeight;
adaptHeight = viewportBounds.height - top;
} else if (BI.DOM.isTopSpaceEnough(combo, popup, -1 * comboBounds.height + extraHeight)) {
// 下方空间不足且不允许调整高度的情况下,优先使用上对齐
top = comboOffset.top + comboBounds.height - popupBounds.height - extraHeight;
top = comboBounds.top + comboBounds.height - popupBounds.height - containerBounds.top - extraHeight;
dir = "top";
} else {
top = windowBounds.height - popupBounds.height;
top = viewportBounds.height - popupBounds.height;
if (top < extraHeight) {
adaptHeight = windowBounds.height - extraHeight;
adaptHeight = viewportBounds.height - extraHeight;
}
}
if (top < extraHeight) {
@ -383,11 +384,11 @@
if (BI.DOM.isTopSpaceEnough(combo, popup, -1 * comboBounds.height + extraHeight)) {
top = comboOffset.top + comboBounds.height - containerBounds.top - popupBounds.height;
} else if (needAdaptHeight) {
top = 0;
adaptHeight = comboOffset.top + comboBounds.height - extraHeight;
top = 0 - containerBounds.top;
adaptHeight = comboBounds.top + comboBounds.height - extraHeight;
} else if (BI.DOM.isBottomSpaceEnough(combo, popup, -1 * comboBounds.height + extraHeight)) {
// 上方空间不足且不允许调整高度的情况下,优先使用下对齐
top = comboOffset.top + extraHeight;
top = comboOffset.top - containerBounds.top + extraHeight;
dir = "bottom";
} else {
top = 0;
@ -395,7 +396,7 @@
adaptHeight = windowBounds.height - extraHeight;
}
}
if (top < 0) {
if (top + containerBounds.top < 0) {
top = 0;
}
return adaptHeight ? {

2
src/less/core/utils/motion/zoom.less

@ -4,7 +4,7 @@
.make-motion(@className, @keyframeName, @duration);
.@{className}-enter,
.@{className}-appear {
transform: scale(0); // need this by yiminghe
//transform: scale(0); // need this by yiminghe, but dailer did not need this
opacity: 0;
animation-timing-function: @ease-out-circ;

Loading…
Cancel
Save