|
|
@ -10235,8 +10235,8 @@ if (!_global.BI) { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
createItems: function (data, innerAttr, outerAttr) { |
|
|
|
createItems: function (data, innerAttr, outerAttr) { |
|
|
|
innerAttr = BI.isArray(innerAttr) ? innerAttr : BI.makeArray(BI.flatten(data).length, innerAttr); |
|
|
|
innerAttr = BI.isArray(innerAttr) ? innerAttr : BI.makeArray(BI.flatten(data).length, innerAttr || {}); |
|
|
|
outerAttr = BI.isArray(outerAttr) ? outerAttr : BI.makeArray(BI.flatten(data).length, outerAttr); |
|
|
|
outerAttr = BI.isArray(outerAttr) ? outerAttr : BI.makeArray(BI.flatten(data).length, outerAttr || {}); |
|
|
|
return BI.map(data, function (i, item) { |
|
|
|
return BI.map(data, function (i, item) { |
|
|
|
if (BI.isArray(item)) { |
|
|
|
if (BI.isArray(item)) { |
|
|
|
return BI.createItems(item, innerAttr, outerAttr); |
|
|
|
return BI.createItems(item, innerAttr, outerAttr); |
|
|
@ -19759,6 +19759,12 @@ BI.prepares.push(function () { |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getInnerLeftPosition: function (combo, popup, extraWidth) { |
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
left: combo.element.offset().left + (extraWidth || 0) |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getRightPosition: function (combo, popup, extraWidth) { |
|
|
|
getRightPosition: function (combo, popup, extraWidth) { |
|
|
|
var el = combo.element; |
|
|
|
var el = combo.element; |
|
|
|
return { |
|
|
|
return { |
|
|
@ -19766,6 +19772,13 @@ BI.prepares.push(function () { |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getInnerRightPosition: function (combo, popup, extraWidth) { |
|
|
|
|
|
|
|
var el = combo.element, viewBounds = popup.element.bounds(); |
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
left: el.offset().left + el.outerWidth() - viewBounds.width - (extraWidth || 0) |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getTopPosition: function (combo, popup, extraHeight) { |
|
|
|
getTopPosition: function (combo, popup, extraHeight) { |
|
|
|
return { |
|
|
|
return { |
|
|
|
top: combo.element.offset().top - popup.element.outerHeight() - (extraHeight || 0) |
|
|
|
top: combo.element.offset().top - popup.element.outerHeight() - (extraHeight || 0) |
|
|
@ -19783,12 +19796,21 @@ BI.prepares.push(function () { |
|
|
|
return BI.DOM.getLeftPosition(combo, popup, extraWidth).left >= 0; |
|
|
|
return BI.DOM.getLeftPosition(combo, popup, extraWidth).left >= 0; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
isInnerLeftSpaceEnough: function (combo, popup, extraWidth) { |
|
|
|
|
|
|
|
var viewBounds = popup.element.bounds(),windowBounds = BI.Widget._renderEngine.createElement("body").bounds(); |
|
|
|
|
|
|
|
return BI.DOM.getInnerLeftPosition(combo, popup, extraWidth).left + viewBounds.width <= windowBounds.width; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
isRightSpaceEnough: function (combo, popup, extraWidth) { |
|
|
|
isRightSpaceEnough: function (combo, popup, extraWidth) { |
|
|
|
var viewBounds = popup.element.bounds(), |
|
|
|
var viewBounds = popup.element.bounds(), |
|
|
|
windowBounds = BI.Widget._renderEngine.createElement("body").bounds(); |
|
|
|
windowBounds = BI.Widget._renderEngine.createElement("body").bounds(); |
|
|
|
return BI.DOM.getRightPosition(combo, popup, extraWidth).left + viewBounds.width <= windowBounds.width; |
|
|
|
return BI.DOM.getRightPosition(combo, popup, extraWidth).left + viewBounds.width <= windowBounds.width; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
isInnerRightSpaceEnough: function (combo, popup, extraWidth) { |
|
|
|
|
|
|
|
return BI.DOM.getInnerRightPosition(combo, popup, extraWidth).left >= 0; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
isTopSpaceEnough: function (combo, popup, extraHeight) { |
|
|
|
isTopSpaceEnough: function (combo, popup, extraHeight) { |
|
|
|
return BI.DOM.getTopPosition(combo, popup, extraHeight).top >= 0; |
|
|
|
return BI.DOM.getTopPosition(combo, popup, extraHeight).top >= 0; |
|
|
|
}, |
|
|
|
}, |
|
|
@ -19994,7 +20016,7 @@ BI.prepares.push(function () { |
|
|
|
extraWidth || (extraWidth = 0); |
|
|
|
extraWidth || (extraWidth = 0); |
|
|
|
extraHeight || (extraHeight = 0); |
|
|
|
extraHeight || (extraHeight = 0); |
|
|
|
var i, direct; |
|
|
|
var i, direct; |
|
|
|
var leftRight = [], topBottom = []; |
|
|
|
var leftRight = [], topBottom = [], innerLeftRight = []; |
|
|
|
var isNeedAdaptHeight = false, tbFirst = false, lrFirst = false; |
|
|
|
var isNeedAdaptHeight = false, tbFirst = false, lrFirst = false; |
|
|
|
var left, top, pos, firstDir = directions[0]; |
|
|
|
var left, top, pos, firstDir = directions[0]; |
|
|
|
for (i = 0; i < directions.length; i++) { |
|
|
|
for (i = 0; i < directions.length; i++) { |
|
|
@ -20012,6 +20034,12 @@ BI.prepares.push(function () { |
|
|
|
case "bottom": |
|
|
|
case "bottom": |
|
|
|
topBottom.push(direct); |
|
|
|
topBottom.push(direct); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case "innerLeft": |
|
|
|
|
|
|
|
innerLeftRight.push(direct); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "innerRight": |
|
|
|
|
|
|
|
innerLeftRight.push(direct); |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
for (i = 0; i < directions.length; i++) { |
|
|
|
for (i = 0; i < directions.length; i++) { |
|
|
@ -20103,6 +20131,48 @@ BI.prepares.push(function () { |
|
|
|
} |
|
|
|
} |
|
|
|
tbFirst = true; |
|
|
|
tbFirst = true; |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case "innerLeft": |
|
|
|
|
|
|
|
if (!isNeedAdaptHeight) { |
|
|
|
|
|
|
|
var tW = tbFirst ? extraHeight : extraWidth, tH = tbFirst ? 0 : extraHeight; |
|
|
|
|
|
|
|
if (BI.DOM.isInnerLeftSpaceEnough(combo, popup, tW)) { |
|
|
|
|
|
|
|
left = BI.DOM.getInnerLeftPosition(combo, popup, tW).left; |
|
|
|
|
|
|
|
if (topBottom[0] === "bottom") { |
|
|
|
|
|
|
|
pos = BI.DOM.getTopAlignPosition(combo, popup, tH, needAdaptHeight); |
|
|
|
|
|
|
|
pos.dir = "innerLeft,bottom"; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
pos = BI.DOM.getBottomAlignPosition(combo, popup, tH, needAdaptHeight); |
|
|
|
|
|
|
|
pos.dir = "innerLeft,top"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (tbFirst) { |
|
|
|
|
|
|
|
pos.change = "innerLeft"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
pos.left = left; |
|
|
|
|
|
|
|
return pos; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
lrFirst = true; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "innerRight": |
|
|
|
|
|
|
|
if (!isNeedAdaptHeight) { |
|
|
|
|
|
|
|
var tW = tbFirst ? extraHeight : extraWidth, tH = tbFirst ? extraWidth : extraHeight; |
|
|
|
|
|
|
|
if (BI.DOM.isInnerRightSpaceEnough(combo, popup, tW)) { |
|
|
|
|
|
|
|
left = BI.DOM.getInnerRightPosition(combo, popup, tW).left; |
|
|
|
|
|
|
|
if (topBottom[0] === "bottom") { |
|
|
|
|
|
|
|
pos = BI.DOM.getTopAlignPosition(combo, popup, tH, needAdaptHeight); |
|
|
|
|
|
|
|
pos.dir = "innerRight,bottom"; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
pos = BI.DOM.getBottomAlignPosition(combo, popup, tH, needAdaptHeight); |
|
|
|
|
|
|
|
pos.dir = "innerRight,top"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (tbFirst) { |
|
|
|
|
|
|
|
pos.change = "innerRight"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
pos.left = left; |
|
|
|
|
|
|
|
return pos; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -38811,7 +38881,10 @@ BI.Combo = BI.inherit(BI.Widget, { |
|
|
|
baseCls: (conf.baseCls || "") + " bi-combo", |
|
|
|
baseCls: (conf.baseCls || "") + " bi-combo", |
|
|
|
trigger: "click", |
|
|
|
trigger: "click", |
|
|
|
toggle: true, |
|
|
|
toggle: true, |
|
|
|
direction: "bottom", // top||bottom||left||right||top,left||top,right||bottom,left||bottom,right
|
|
|
|
direction: "bottom", // top||bottom||left||right||top,left||top,right||bottom,left||bottom,right||right,innerRight
|
|
|
|
|
|
|
|
logic: { |
|
|
|
|
|
|
|
dynamic: true |
|
|
|
|
|
|
|
}, |
|
|
|
container: null, // popupview放置的容器,默认为this.element
|
|
|
|
container: null, // popupview放置的容器,默认为this.element
|
|
|
|
isDefaultInit: false, |
|
|
|
isDefaultInit: false, |
|
|
|
destroyWhenHide: false, |
|
|
|
destroyWhenHide: false, |
|
|
@ -38869,14 +38942,13 @@ BI.Combo = BI.inherit(BI.Widget, { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
BI.createWidget({ |
|
|
|
BI.createWidget(BI.extend({ |
|
|
|
type: "bi.vertical", |
|
|
|
element: this |
|
|
|
scrolly: false, |
|
|
|
}, BI.LogicFactory.createLogic("vertical", BI.extend(o.logic, { |
|
|
|
element: this, |
|
|
|
|
|
|
|
items: [ |
|
|
|
items: [ |
|
|
|
{el: this.combo} |
|
|
|
{ el: this.combo } |
|
|
|
] |
|
|
|
] |
|
|
|
}); |
|
|
|
})))); |
|
|
|
o.isDefaultInit && (this._assertPopupView()); |
|
|
|
o.isDefaultInit && (this._assertPopupView()); |
|
|
|
BI.Resizers.add(this.getName(), BI.bind(function () { |
|
|
|
BI.Resizers.add(this.getName(), BI.bind(function () { |
|
|
|
if (this.isViewVisible()) { |
|
|
|
if (this.isViewVisible()) { |
|
|
@ -39183,6 +39255,9 @@ BI.Combo = BI.inherit(BI.Widget, { |
|
|
|
case "right,top": |
|
|
|
case "right,top": |
|
|
|
p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "top", "bottom"], o.offsetStyle); |
|
|
|
p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "top", "bottom"], o.offsetStyle); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case "right,innerRight": |
|
|
|
|
|
|
|
p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "innerRight", "innerLeft", "bottom", "top"], o.offsetStyle); |
|
|
|
|
|
|
|
break; |
|
|
|
case "top,custom": |
|
|
|
case "top,custom": |
|
|
|
case "custom,top": |
|
|
|
case "custom,top": |
|
|
|
p = BI.DOM.getTopAdaptPosition(combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight); |
|
|
|
p = BI.DOM.getTopAdaptPosition(combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight); |
|
|
|