Browse Source

Pull request #2607: 无JIRA任务 feature: 小三角

Merge in VISUAL/fineui from ~GUY/fineui:master to master

* commit 'bb7e72ea3dfc66913c1677f6455592e36b1a75a1':
  feature: 小三角
  feature: 小三角
es6
guy 3 years ago
parent
commit
2454d76abe
  1. 4
      src/base/combination/bubble.js
  2. 2
      src/base/combination/combo.js
  3. 34
      src/base/layer/layer.popup.js
  4. 2
      src/less/base/combo/popup.bubble.less
  5. 30
      src/less/base/view/popupview.less

4
src/base/combination/bubble.js

@ -332,7 +332,7 @@
name: "offset", name: "offset",
options: { options: {
offset: function () { offset: function () {
return [o.adjustXOffset, (o.showArrow ? 9 : 0) + (o.adjustYOffset + o.adjustLength)]; return [o.adjustXOffset, (o.showArrow ? 12 : 0) + (o.adjustYOffset + o.adjustLength)];
} }
} }
}]; }];
@ -340,7 +340,7 @@
modifiers.push({ modifiers.push({
name: "arrow", name: "arrow",
options: { options: {
padding: 5, padding: 4,
element: this.popupView.arrow.element[0] element: this.popupView.arrow.element[0]
} }
}); });

2
src/base/combination/combo.js

@ -7,7 +7,7 @@
*/ */
BI.Combo = BI.inherit(BI.Bubble, { BI.Combo = BI.inherit(BI.Bubble, {
_const: { _const: {
TRIANGLE_LENGTH: 9 TRIANGLE_LENGTH: 12
}, },
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.Combo.superclass._defaultConfig.apply(this, arguments); var conf = BI.Combo.superclass._defaultConfig.apply(this, arguments);

34
src/base/layer/layer.popup.js

@ -5,7 +5,7 @@
*/ */
BI.PopupView = BI.inherit(BI.Widget, { BI.PopupView = BI.inherit(BI.Widget, {
_const: { _const: {
TRIANGLE_LENGTH: 9 TRIANGLE_LENGTH: 12
}, },
_defaultConfig: function (props) { _defaultConfig: function (props) {
return BI.extend(BI.PopupView.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.PopupView.superclass._defaultConfig.apply(this, arguments), {
@ -197,22 +197,22 @@ BI.PopupView = BI.inherit(BI.Widget, {
var offsetStyle = position.offsetStyle; var offsetStyle = position.offsetStyle;
var middle = offsetStyle === "center" || offsetStyle === "middle"; var middle = offsetStyle === "center" || offsetStyle === "middle";
var minLeft = Math.max(5, offset.left + 5 + popupWidth - bodyWidth); var minLeft = Math.max(4, offset.left + 4 + popupWidth - bodyWidth);
var minRight = Math.max(5, popupWidth - (offset.left + 5)); var minRight = Math.max(4, popupWidth - (offset.left + 4));
var minTop = Math.max(5, offset.top + 5 + popupHeight - bodyHeight); var minTop = Math.max(4, offset.top + 4 + popupHeight - bodyHeight);
var minBottom = Math.max(5, popupHeight - (offset.top + 5)); var minBottom = Math.max(4, popupHeight - (offset.top + 4));
var maxLeft = Math.min(popupWidth - 12 - 5, offset.left + position.width - 12 - 5); var maxLeft = Math.min(popupWidth - 16 - 4, offset.left + position.width - 16 - 4);
var maxRight = Math.min(popupWidth - 12 - 5, bodyWidth - (offset.left + position.width - 12 - 5)); var maxRight = Math.min(popupWidth - 16 - 4, bodyWidth - (offset.left + position.width - 16 - 4));
var maxTop = Math.min(popupHeight - 12 - 5, offset.top + position.height - 12 - 5); var maxTop = Math.min(popupHeight - 16 - 4, offset.top + position.height - 16 - 4);
var maxBottom = Math.min(popupHeight - 12 - 5, bodyHeight - (offset.top + position.height - 12 - 5)); var maxBottom = Math.min(popupHeight - 16 - 4, bodyHeight - (offset.top + position.height - 16 - 4));
switch (direction) { switch (direction) {
case "bottom": case "bottom":
case "bottom,right": case "bottom,right":
direction = "bottom"; direction = "bottom";
style = { style = {
// 5表示留出一定的空间 // 5表示留出一定的空间
left: BI.clamp(((middle ? popupWidth : position.width) - adjustXOffset) / 2 - 6, minLeft, maxLeft) left: BI.clamp(((middle ? popupWidth : position.width) - adjustXOffset) / 2 - 8, minLeft, maxLeft)
}; };
wrapperStyle = { wrapperStyle = {
top: o.tgap + o.vgap, top: o.tgap + o.vgap,
@ -231,7 +231,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
case "bottom,left": case "bottom,left":
direction = "bottom"; direction = "bottom";
style = { style = {
right: BI.clamp(((middle ? popupWidth : position.width) + adjustXOffset) / 2 - 6, minRight, maxRight) right: BI.clamp(((middle ? popupWidth : position.width) + adjustXOffset) / 2 - 8, minRight, maxRight)
}; };
wrapperStyle = { wrapperStyle = {
top: o.bgap + o.vgap, top: o.bgap + o.vgap,
@ -251,7 +251,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
case "top,right": case "top,right":
direction = "top"; direction = "top";
style = { style = {
left: BI.clamp(((middle ? popupWidth : position.width) - adjustXOffset) / 2 - 6, minLeft, maxLeft) left: BI.clamp(((middle ? popupWidth : position.width) - adjustXOffset) / 2 - 8, minLeft, maxLeft)
}; };
wrapperStyle = { wrapperStyle = {
bottom: o.bgap + o.vgap, bottom: o.bgap + o.vgap,
@ -270,7 +270,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
case "top,left": case "top,left":
direction = "top"; direction = "top";
style = { style = {
right: BI.clamp(((middle ? popupWidth : position.width) + adjustXOffset) / 2 - 6, minRight, maxRight) right: BI.clamp(((middle ? popupWidth : position.width) + adjustXOffset) / 2 - 8, minRight, maxRight)
}; };
wrapperStyle = { wrapperStyle = {
bottom: o.bgap + o.vgap, bottom: o.bgap + o.vgap,
@ -290,7 +290,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
case "left,bottom": case "left,bottom":
direction = "left"; direction = "left";
style = { style = {
top: BI.clamp(((middle ? popupHeight : position.height) - adjustYOffset) / 2 - 6, minTop, maxTop) top: BI.clamp(((middle ? popupHeight : position.height) - adjustYOffset) / 2 - 8, minTop, maxTop)
}; };
wrapperStyle = { wrapperStyle = {
right: o.rgap + o.hgap, right: o.rgap + o.hgap,
@ -309,7 +309,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
case "left,top": case "left,top":
direction = "left"; direction = "left";
style = { style = {
bottom: BI.clamp(((middle ? popupHeight : position.height) + adjustYOffset) / 2 - 6, minBottom, maxBottom) bottom: BI.clamp(((middle ? popupHeight : position.height) + adjustYOffset) / 2 - 8, minBottom, maxBottom)
}; };
wrapperStyle = { wrapperStyle = {
right: o.rgap + o.hgap, right: o.rgap + o.hgap,
@ -329,7 +329,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
case "right,bottom": case "right,bottom":
direction = "right"; direction = "right";
style = { style = {
top: BI.clamp(((middle ? popupHeight : position.height) - adjustYOffset) / 2 - 6, minTop, maxTop) top: BI.clamp(((middle ? popupHeight : position.height) - adjustYOffset) / 2 - 8, minTop, maxTop)
}; };
wrapperStyle = { wrapperStyle = {
left: o.lgap + o.hgap, left: o.lgap + o.hgap,
@ -348,7 +348,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
case "right,top": case "right,top":
direction = "right"; direction = "right";
style = { style = {
bottom: BI.clamp(((middle ? popupHeight : position.height) + adjustYOffset) / 2 - 6, minBottom, maxBottom) bottom: BI.clamp(((middle ? popupHeight : position.height) + adjustYOffset) / 2 - 8, minBottom, maxBottom)
}; };
wrapperStyle = { wrapperStyle = {
left: o.lgap + o.hgap, left: o.lgap + o.hgap,

2
src/less/base/combo/popup.bubble.less

@ -5,4 +5,4 @@
.box-shadows(0px 9px 28px 8px rgba(0, 0, 0, 0.05), 0px 6px 16px 0px rgba(0, 0, 0, 0.08), 0px 3px 6px -4px rgba(0, 0, 0, 0.12)); .box-shadows(0px 9px 28px 8px rgba(0, 0, 0, 0.05), 0px 6px 16px 0px rgba(0, 0, 0, 0.08), 0px 3px 6px -4px rgba(0, 0, 0, 0.12));
.border-radius(4px); .border-radius(4px);
} }
} }

30
src/less/base/view/popupview.less

@ -33,9 +33,9 @@
left: 0; left: 0;
> .bi-bubble-arrow { > .bi-bubble-arrow {
bottom: -12px; bottom: -12px;
width: 14px; width: 16px;
> .bubble-arrow { > .bubble-arrow {
bottom: 8px; bottom: 7px;
left: 1px; left: 1px;
} }
} }
@ -47,9 +47,9 @@
left: 0; left: 0;
> .bi-bubble-arrow { > .bi-bubble-arrow {
top: -12px; top: -12px;
width: 14px; width: 16px;
> .bubble-arrow { > .bubble-arrow {
top: 8px; top: 7px;
left: 1px; left: 1px;
} }
} }
@ -61,9 +61,9 @@
top: 0; top: 0;
> .bi-bubble-arrow { > .bi-bubble-arrow {
right: -12px; right: -12px;
height: 14px; height: 16px;
> .bubble-arrow { > .bubble-arrow {
right: 8px; right: 7px;
top: 1px; top: 1px;
} }
} }
@ -75,9 +75,9 @@
top: 0; top: 0;
> .bi-bubble-arrow { > .bi-bubble-arrow {
left: -12px; left: -12px;
height: 14px; height: 16px;
> .bubble-arrow { > .bubble-arrow {
left: 8px; left: 7px;
top: 1px; top: 1px;
} }
} }
@ -85,18 +85,18 @@
} }
.bi-bubble-arrow { .bi-bubble-arrow {
width: 12px; width: 14px;
height: 12px; height: 14px;
// 消除祖先节点设置的line-height:normal对空白节点的行高影响 // 消除祖先节点设置的line-height:normal对空白节点的行高影响
line-height: 0; line-height: 0;
overflow: hidden; overflow: hidden;
.bubble-arrow { .bubble-arrow {
width: 12px; width: 14px;
height: 12px; height: 14px;
position: absolute; position: absolute;
&:before { &:before {
width: 12px; width: 14px;
height: 12px; height: 14px;
position: absolute; position: absolute;
content: ""; content: "";
background: @color-bi-background-default; background: @color-bi-background-default;
@ -106,7 +106,7 @@
visibility: visible; visibility: visible;
transform: translateX(0px) rotate(-135deg); transform: translateX(0px) rotate(-135deg);
transform-origin: center center; transform-origin: center center;
.box-shadow(3px 3px 10px 0,rgba(0,0,0,6%)); .box-shadow(3px 3px 10px 0,rgba(0, 0, 0, 6%));
} }
} }
} }

Loading…
Cancel
Save