diff --git a/dist/font/iconfont.eot b/dist/font/iconfont.eot index b11de9ca4..72e145f57 100644 Binary files a/dist/font/iconfont.eot and b/dist/font/iconfont.eot differ diff --git a/dist/font/iconfont.svg b/dist/font/iconfont.svg index 0e6a2d923..b5678472f 100644 --- a/dist/font/iconfont.svg +++ b/dist/font/iconfont.svg @@ -14,6 +14,18 @@ /> + + + + + + + + + + + + diff --git a/dist/font/iconfont.ttf b/dist/font/iconfont.ttf index 1c884f5ca..6001a1a04 100644 Binary files a/dist/font/iconfont.ttf and b/dist/font/iconfont.ttf differ diff --git a/dist/font/iconfont.woff b/dist/font/iconfont.woff index 501fc8f12..d8c629fdd 100644 Binary files a/dist/font/iconfont.woff and b/dist/font/iconfont.woff differ diff --git a/dist/font/iconfont.woff2 b/dist/font/iconfont.woff2 index 5e4470215..165d01f51 100644 Binary files a/dist/font/iconfont.woff2 and b/dist/font/iconfont.woff2 differ diff --git a/package.json b/package.json index 6041dd3fc..bd500280a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220209172240", + "version": "2.0.20220216115117", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", @@ -81,4 +81,4 @@ }, "author": "fanruan", "license": "MIT" -} +} \ No newline at end of file diff --git a/src/base/combination/bubble.js b/src/base/combination/bubble.js index 47c067e20..e35fa38ca 100644 --- a/src/base/combination/bubble.js +++ b/src/base/combination/bubble.js @@ -332,7 +332,7 @@ name: "offset", options: { offset: function () { - return [o.adjustXOffset, (o.showArrow ? 9 : 0) + (o.adjustYOffset || o.adjustLength)]; + return [o.adjustXOffset, (o.showArrow ? 9 : 0) + (o.adjustYOffset + o.adjustLength)]; } } }]; diff --git a/src/base/combination/combo.js b/src/base/combination/combo.js index de401bdd6..bdb488e4c 100644 --- a/src/base/combination/combo.js +++ b/src/base/combination/combo.js @@ -213,64 +213,64 @@ switch (o.direction) { case "bottom": case "bottom,right": - p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset, (o.adjustYOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight, ["bottom", "top", "right", "left"], o.offsetStyle); + p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset, (o.adjustYOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight, ["bottom", "top", "right", "left"], o.offsetStyle); break; case "top": case "top,right": - p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset, (o.adjustYOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight, ["top", "bottom", "right", "left"], o.offsetStyle); + p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset, (o.adjustYOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight, ["top", "bottom", "right", "left"], o.offsetStyle); break; case "left": case "left,bottom": - p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "bottom", "top"], o.offsetStyle); + p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "bottom", "top"], o.offsetStyle); break; case "right": case "right,bottom": - p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "bottom", "top"], o.offsetStyle); + p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "bottom", "top"], o.offsetStyle); break; case "top,left": - p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset, (o.adjustYOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight, ["top", "bottom", "left", "right"], o.offsetStyle); + p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset, (o.adjustYOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight, ["top", "bottom", "left", "right"], o.offsetStyle); break; case "bottom,left": - p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset, (o.adjustYOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight, ["bottom", "top", "left", "right"], o.offsetStyle); + p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset, (o.adjustYOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight, ["bottom", "top", "left", "right"], o.offsetStyle); break; case "left,top": - p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "top", "bottom"], o.offsetStyle); + p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "top", "bottom"], o.offsetStyle); break; case "right,top": - p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "top", "bottom"], o.offsetStyle); + p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "top", "bottom"], o.offsetStyle); break; case "right,innerRight": - p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "innerRight", "innerLeft", "bottom", "top"], o.offsetStyle); + p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "innerRight", "innerLeft", "bottom", "top"], o.offsetStyle); break; case "right,innerLeft": - p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "innerLeft", "innerRight", "bottom", "top"], o.offsetStyle); + p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "innerLeft", "innerRight", "bottom", "top"], o.offsetStyle); break; case "innerRight": - p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["innerRight", "innerLeft", "right", "left", "bottom", "top"], o.offsetStyle); + p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["innerRight", "innerLeft", "right", "left", "bottom", "top"], o.offsetStyle); break; case "innerLeft": - p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["innerLeft", "innerRight", "left", "right", "bottom", "top"], o.offsetStyle); + p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["innerLeft", "innerRight", "left", "right", "bottom", "top"], o.offsetStyle); break; case "top,custom": case "custom,top": - p = BI.DOM.getTopAdaptPosition(combo, this.popupView, (o.adjustYOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight); + p = BI.DOM.getTopAdaptPosition(combo, this.popupView, (o.adjustYOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight); p.dir = "top"; break; case "custom,bottom": case "bottom,custom": - p = BI.DOM.getBottomAdaptPosition(combo, this.popupView, (o.adjustYOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight); + p = BI.DOM.getBottomAdaptPosition(combo, this.popupView, (o.adjustYOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight); p.dir = "bottom"; break; case "left,custom": case "custom,left": - p = BI.DOM.getLeftAdaptPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0)); + p = BI.DOM.getLeftAdaptPosition(combo, this.popupView, (o.adjustXOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0)); delete p.top; delete p.adaptHeight; p.dir = "left"; break; case "custom,right": case "right,custom": - p = BI.DOM.getRightAdaptPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0)); + p = BI.DOM.getRightAdaptPosition(combo, this.popupView, (o.adjustXOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0)); delete p.top; delete p.adaptHeight; p.dir = "right"; diff --git a/src/base/layer/layer.popup.js b/src/base/layer/layer.popup.js index a0d8220f8..509f011c9 100644 --- a/src/base/layer/layer.popup.js +++ b/src/base/layer/layer.popup.js @@ -104,6 +104,12 @@ BI.PopupView = BI.inherit(BI.Widget, { cls: "bubble-arrow" }] }); + this.arrowWrapper = BI.createWidget({ + type: "bi.absolute", + items: [{ + el: this.arrow, + }] + }) // 因为三角符号的原因位置变大了,需要占位 this.placeholder = BI.createWidget({ type: "bi.layout" @@ -112,7 +118,9 @@ BI.PopupView = BI.inherit(BI.Widget, { type: "bi.absolute", element: this, items: [{ - el: this.arrow + el: this.arrowWrapper, + left: 0, + top: 0, }, { el: this.placeholder }] @@ -174,8 +182,9 @@ BI.PopupView = BI.inherit(BI.Widget, { }, setDirection: function (direction, position) { - if (this.options.showArrow) { - var style, placeholderStyle; + var o = this.options; + if (o.showArrow) { + var style, wrapperStyle, placeholderStyle; var adjustXOffset = position.adjustXOffset || 0; var adjustYOffset = position.adjustYOffset || 0; var bodyBounds = BI.Widget._renderEngine.createElement("body").bounds(); @@ -204,6 +213,12 @@ BI.PopupView = BI.inherit(BI.Widget, { // 5表示留出一定的空间 left: BI.clamp(((middle ? popupWidth : position.width) - adjustXOffset) / 2 - 6, minLeft, maxLeft) }; + wrapperStyle = { + top: o.tgap + o.vgap, + left: 0, + right: "", + bottom: "", + }; placeholderStyle = { left: 0, right: 0, @@ -217,6 +232,12 @@ BI.PopupView = BI.inherit(BI.Widget, { style = { right: BI.clamp(((middle ? popupWidth : position.width) + adjustXOffset) / 2 - 6, minRight, maxRight) }; + wrapperStyle = { + bottom: o.bgap + o.vgap, + left: "", + right: 0, + top: "", + }; placeholderStyle = { left: 0, right: 0, @@ -231,12 +252,18 @@ BI.PopupView = BI.inherit(BI.Widget, { style = { left: BI.clamp(((middle ? popupWidth : position.width) - adjustXOffset) / 2 - 6, minLeft, maxLeft) }; + wrapperStyle = { + bottom: o.bgap + o.vgap, + left: 0, + right: "", + top: "", + }; placeholderStyle = { left: 0, right: 0, height: this._const.TRIANGLE_LENGTH, top: "", - bottom: -this._const.TRIANGLE_LENGTH + bottom: -this._const.TRIANGLE_LENGTH, }; break; case "top,left": @@ -244,12 +271,18 @@ BI.PopupView = BI.inherit(BI.Widget, { style = { right: BI.clamp(((middle ? popupWidth : position.width) + adjustXOffset) / 2 - 6, minRight, maxRight) }; + wrapperStyle = { + bottom: o.bgap + o.vgap, + right: 0, + left: "", + top: "", + }; placeholderStyle = { left: 0, right: 0, height: this._const.TRIANGLE_LENGTH, top: "", - bottom: -this._const.TRIANGLE_LENGTH + bottom: -this._const.TRIANGLE_LENGTH, }; break; case "left": @@ -258,6 +291,12 @@ BI.PopupView = BI.inherit(BI.Widget, { style = { top: BI.clamp(((middle ? popupHeight : position.height) - adjustYOffset) / 2 - 6, minTop, maxTop) }; + wrapperStyle = { + right: o.rgap + o.hgap, + top: 0, + bottom: "", + left: "", + }; placeholderStyle = { top: 0, bottom: 0, @@ -271,6 +310,12 @@ BI.PopupView = BI.inherit(BI.Widget, { style = { bottom: BI.clamp(((middle ? popupHeight : position.height) + adjustYOffset) / 2 - 6, minBottom, maxBottom) }; + wrapperStyle = { + right: o.rgap + o.hgap, + bottom: 0, + top: "", + left: "", + }; placeholderStyle = { top: 0, bottom: 0, @@ -285,6 +330,12 @@ BI.PopupView = BI.inherit(BI.Widget, { style = { top: BI.clamp(((middle ? popupHeight : position.height) - adjustYOffset) / 2 - 6, minTop, maxTop) }; + wrapperStyle = { + left: o.lgap + o.hgap, + top: 0, + bottom: "", + right: "", + }; placeholderStyle = { top: 0, bottom: 0, @@ -298,6 +349,12 @@ BI.PopupView = BI.inherit(BI.Widget, { style = { bottom: BI.clamp(((middle ? popupHeight : position.height) + adjustYOffset) / 2 - 6, minBottom, maxBottom) }; + wrapperStyle = { + left: o.lgap + o.hgap, + bottom: 0, + top: "", + right: "", + }; placeholderStyle = { top: 0, bottom: 0, @@ -317,6 +374,7 @@ BI.PopupView = BI.inherit(BI.Widget, { } this.element.removeClass("left").removeClass("right").removeClass("top").removeClass("bottom").addClass(direction); this.arrow.element.css(style); + this.arrowWrapper.element.css(wrapperStyle); this.placeholder.element.css(placeholderStyle); } }, diff --git a/src/base/single/button/listitem/blankiconicontextitem.js b/src/base/single/button/listitem/blankiconicontextitem.js index 9e8301a53..3c0fcb94b 100644 --- a/src/base/single/button/listitem/blankiconicontextitem.js +++ b/src/base/single/button/listitem/blankiconicontextitem.js @@ -27,45 +27,44 @@ BI.BlankIconIconTextItem = BI.inherit(BI.BasicButton, { }, render: function () { - var o = this.options, c = this._const; - var blank = BI.createWidget({ - type: "bi.layout", - width: o.blankWidth, - height: o.height - }); - this.text = BI.createWidget({ - type: "bi.label", - cls: "list-item-text", - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height - }); - this.icon1 = BI.createWidget({ - type: "bi.icon_button", - cls: o.iconCls1, - forceNotSelected: true, - width: o.height, - height: o.height - }); - this.icon2 = BI.createWidget({ - type: "bi.icon_button", - cls: o.iconCls2, - forceNotSelected: true, - width: o.height, - height: o.height - }); + var self = this, o = this.options; - BI.createWidget(BI.extend({ - element: this - }, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { - items: BI.LogicFactory.createLogicItemsByDirection("left", blank, this.icon1, this.icon2, this.text) - })))); + return { + type: "bi.vertical_adapt", + columnSize: [o.blankWidth, o.leftIconWrapperWidth || o.height, o.rightIconWrapperWidth || o.height, "fill"], + items: [{ + type: "bi.layout", + width: o.blankWidth + }, { + type: "bi.icon_label", + cls: o.iconCls1, + width: o.leftIconWrapperWidth || o.height, + height: o.height, + iconWidth: o.iconWidth, + iconHeight: o.iconHeight + }, { + type: "bi.icon_label", + cls: o.iconCls2, + width: o.rightIconWrapperWidth || o.height, + height: o.height, + iconWidth: o.iconWidth, + iconHeight: o.iconHeight + }, { + type: "bi.label", + ref: function (_ref) { + self.text = _ref; + }, + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + }] + }; }, doClick: function () { diff --git a/src/base/single/button/listitem/blankicontexticonitem.js b/src/base/single/button/listitem/blankicontexticonitem.js index 99d6ad575..9085d997d 100644 --- a/src/base/single/button/listitem/blankicontexticonitem.js +++ b/src/base/single/button/listitem/blankicontexticonitem.js @@ -28,57 +28,44 @@ BI.BlankIconTextIconItem = BI.inherit(BI.BasicButton, { }, render: function () { - var o = this.options, c = this._const; - this.text = BI.createWidget({ - type: "bi.label", - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height - }); + var self = this, o = this.options; - var icon1 = BI.createWidget({ - type: "bi.icon_label", - cls: o.iconCls1, - width: o.height, - height: o.height, - iconWidth: o.iconWidth, - iconHeight: o.iconHeight - }); - BI.createWidget({ - type: "bi.absolute", - element: this, + return { + type: "bi.vertical_adapt", + columnSize: [o.blankWidth, o.leftIconWrapperWidth || o.height, "fill", o.rightIconWrapperWidth || o.height], items: [{ - el: { - type: "bi.icon_label", - cls: o.iconCls2, - width: o.height, - height: o.height, - iconWidth: o.iconWidth, - iconHeight: o.iconHeight - }, - top: 0, - bottom: 0, - right: 0 - }] - }); - - BI.createWidget(BI.extend({ - element: this - }, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { - items: BI.LogicFactory.createLogicItemsByDirection("left", { type: "bi.layout", width: o.blankWidth - }, icon1, this.text, { - type: "bi.layout", - width: o.height - }) - })))); + }, { + type: "bi.icon_label", + cls: o.iconCls1, + width: o.leftIconWrapperWidth || o.height, + height: o.height, + iconWidth: o.iconWidth, + iconHeight: o.iconHeight + }, { + type: "bi.label", + ref: function (_ref) { + self.text = _ref; + }, + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + }, { + type: "bi.icon_label", + cls: o.iconCls2, + width: o.rightIconWrapperWidth || o.height, + height: o.height, + iconWidth: o.iconWidth, + iconHeight: o.iconHeight + }] + }; }, doClick: function () { diff --git a/src/base/single/button/listitem/blankicontextitem.js b/src/base/single/button/listitem/blankicontextitem.js index d647637dc..f35dbe582 100644 --- a/src/base/single/button/listitem/blankicontextitem.js +++ b/src/base/single/button/listitem/blankicontextitem.js @@ -26,38 +26,38 @@ BI.BlankIconTextItem = BI.inherit(BI.BasicButton, { }, render: function () { - var o = this.options, c = this._const; - var blank = BI.createWidget({ - type: "bi.layout", - width: o.blankWidth - }); - this.text = BI.createWidget({ - type: "bi.label", - cls: "list-item-text", - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height - }); - this.icon = BI.createWidget({ - type: "bi.icon_label", - cls: o.iconCls, - width: o.height, - height: o.height, - iconWidth: o.iconWidth, - iconHeight: o.iconHeight - }); + var self = this, o = this.options; - BI.createWidget(BI.extend({ - element: this - }, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { - items: BI.LogicFactory.createLogicItemsByDirection("left", blank, this.icon, this.text) - })))); + return { + type: "bi.vertical_adapt", + columnSize: [o.blankWidth, "fill", o.iconWrapperWidth || o.height], + items: [{ + type: "bi.layout", + width: o.blankWidth + }, { + type: "bi.label", + ref: function (_ref) { + self.text = _ref; + }, + cls: "list-item-text", + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + }, { + type: "bi.icon_label", + cls: o.iconCls, + width: o.iconWrapperWidth || o.height, + height: o.height, + iconWidth: o.iconWidth, + iconHeight: o.iconHeight + }] + }; }, doClick: function () { diff --git a/src/base/single/button/listitem/icontexticonitem.js b/src/base/single/button/listitem/icontexticonitem.js index 1624e50e4..80e0d0a1c 100644 --- a/src/base/single/button/listitem/icontexticonitem.js +++ b/src/base/single/button/listitem/icontexticonitem.js @@ -27,55 +27,41 @@ BI.IconTextIconItem = BI.inherit(BI.BasicButton, { }, render: function () { - var o = this.options, c = this._const; - this.text = BI.createWidget({ - type: "bi.label", - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height - }); + var self = this, o = this.options; - var icon1 = BI.createWidget({ - type: "bi.icon_label", - cls: o.iconCls1, - width: o.leftIconWrapperWidth || o.height, - height: o.height, - iconWidth: o.iconWidth, - iconHeight: o.iconHeight - }); - var blank = BI.createWidget({ - type: "bi.layout", - width: o.height - }); - BI.createWidget({ - type: "bi.absolute", - element: this, + return { + type: "bi.vertical_adapt", + columnSize: [o.leftIconWrapperWidth || o.height, "fill", o.rightIconWrapperWidth || o.height], items: [{ - el: { - type: "bi.icon_label", - cls: o.iconCls2, - width: o.rightIconWrapperWidth || o.height, - height: o.height, - iconWidth: o.iconWidth, - iconHeight: o.iconHeight + type: "bi.icon_label", + cls: o.iconCls1, + width: o.leftIconWrapperWidth || o.height, + height: o.height, + iconWidth: o.iconWidth, + iconHeight: o.iconHeight + }, { + type: "bi.label", + ref: function (_ref) { + self.text = _ref; }, - top: 0, - bottom: 0, - right: 0 + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + }, { + type: "bi.icon_label", + cls: o.iconCls2, + width: o.rightIconWrapperWidth || o.height, + height: o.height, + iconWidth: o.iconWidth, + iconHeight: o.iconHeight }] - }); - - BI.createWidget(BI.extend({ - element: this - }, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { - items: BI.LogicFactory.createLogicItemsByDirection("left", icon1, this.text, blank) - })))); + }; }, doClick: function () { diff --git a/src/base/single/button/listitem/icontextitem.js b/src/base/single/button/listitem/icontextitem.js index 44f83f376..6d3bf7199 100644 --- a/src/base/single/button/listitem/icontextitem.js +++ b/src/base/single/button/listitem/icontextitem.js @@ -27,34 +27,35 @@ BI.IconTextItem = BI.inherit(BI.BasicButton, { }, render: function () { - var o = this.options, c = this._const; - this.text = BI.createWidget({ - type: "bi.label", - cls: "list-item-text", - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height - }); - this.icon = BI.createWidget({ - type: "bi.icon_label", - cls: o.iconCls, - width: o.iconWrapperWidth || o.height, - height: o.height, - iconWidth: o.iconWidth, - iconHeight: o.iconHeight - }); + var self = this, o = this.options; - BI.createWidget(BI.extend({ - element: this - }, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend(o.logic, { - items: BI.LogicFactory.createLogicItemsByDirection(o.direction, this.icon, this.text) - })))); + return { + type: "bi.vertical_adapt", + columnSize: [o.iconWrapperWidth || o.height, "fill"], + items: [{ + type: "bi.icon_label", + cls: o.iconCls, + width: o.iconWrapperWidth || o.height, + height: o.height, + iconWidth: o.iconWidth, + iconHeight: o.iconHeight + }, { + type: "bi.label", + ref: function (_ref) { + self.text = _ref; + }, + cls: "list-item-text", + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + }] + }; }, doClick: function () { diff --git a/src/base/single/button/listitem/texticonitem.js b/src/base/single/button/listitem/texticonitem.js index 7eb468087..87d188859 100644 --- a/src/base/single/button/listitem/texticonitem.js +++ b/src/base/single/button/listitem/texticonitem.js @@ -15,6 +15,7 @@ BI.TextIconItem = BI.inherit(BI.BasicButton, { logic: { dynamic: false }, + iconWrapperWidth: null, iconHeight: null, iconWidth: null, iconCls: "", @@ -26,34 +27,35 @@ BI.TextIconItem = BI.inherit(BI.BasicButton, { }, render: function () { - var o = this.options, c = this._const; - this.text = BI.createWidget({ - type: "bi.label", - cls: "list-item-text", - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height - }); - this.icon = BI.createWidget({ - type: "bi.icon_label", - cls: o.iconCls, - width: o.height, - height: o.height, - iconWidth: o.iconWidth, - iconHeight: o.iconHeight - }); + var self = this, o = this.options; - BI.createWidget(BI.extend({ - element: this - }, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { - items: BI.LogicFactory.createLogicItemsByDirection("left", this.text, this.icon) - })))); + return { + type: "bi.vertical_adapt", + columnSize: ["fill", o.iconWrapperWidth || o.height], + items: [{ + type: "bi.label", + ref: function (_ref) { + self.text = _ref; + }, + cls: "list-item-text", + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + }, { + type: "bi.icon_label", + cls: o.iconCls, + width: o.iconWrapperWidth || o.height, + height: o.height, + iconWidth: o.iconWidth, + iconHeight: o.iconHeight + }] + }; }, doClick: function () { diff --git a/src/base/single/button/node/icontexticonnode.js b/src/base/single/button/node/icontexticonnode.js index 01870423f..df2e28eb5 100644 --- a/src/base/single/button/node/icontexticonnode.js +++ b/src/base/single/button/node/icontexticonnode.js @@ -25,55 +25,41 @@ BI.IconTextIconNode = BI.inherit(BI.NodeButton, { }, render: function () { - var o = this.options, c = this._const; - this.text = BI.createWidget({ - type: "bi.label", - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height - }); + var self = this, o = this.options; - var icon1 = BI.createWidget({ - type: "bi.icon_label", - cls: o.iconCls1, - width: o.height, - height: o.height, - iconWidth: o.iconWidth, - iconHeight: o.iconHeight - }); - var blank = BI.createWidget({ - type: "bi.layout", - width: o.height, - height: o.height - }); - BI.createWidget({ - type: "bi.absolute", - element: this, + return { + type: "bi.vertical_adapt", + columnSize: [o.leftIconWrapperWidth || o.height, "fill", o.rightIconWrapperWidth || o.height], items: [{ - el: { - type: "bi.icon_label", - cls: o.iconCls2, - width: o.height, - iconWidth: o.iconWidth, - iconHeight: o.iconHeight + type: "bi.icon_label", + cls: o.iconCls1, + width: o.leftIconWrapperWidth || o.height, + height: o.height, + iconWidth: o.iconWidth, + iconHeight: o.iconHeight + }, { + type: "bi.label", + ref: function (_ref) { + self.text = _ref; }, - top: 0, - bottom: 0, - right: 0 + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + }, { + type: "bi.icon_label", + cls: o.iconCls2, + width: o.rightIconWrapperWidth || o.height, + height: o.height, + iconWidth: o.iconWidth, + iconHeight: o.iconHeight }] - }); - - BI.createWidget(BI.extend({ - element: this - }, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { - items: BI.LogicFactory.createLogicItemsByDirection("left", icon1, this.text, blank) - })))); + }; }, doClick: function () { diff --git a/src/base/single/button/node/icontextnode.js b/src/base/single/button/node/icontextnode.js index deb2c73be..653888a4a 100644 --- a/src/base/single/button/node/icontextnode.js +++ b/src/base/single/button/node/icontextnode.js @@ -24,33 +24,35 @@ BI.IconTextNode = BI.inherit(BI.NodeButton, { }, render: function () { - var o = this.options, c = this._const; - this.text = BI.createWidget({ - type: "bi.label", - cls: "list-item-text", - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height - }); - this.icon = BI.createWidget({ - type: "bi.icon_label", - width: o.height, - height: o.height, - iconWidth: o.iconWidth, - iconHeight: o.iconHeight - }); + var self = this, o = this.options; - BI.createWidget(BI.extend({ - element: this - }, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { - items: BI.LogicFactory.createLogicItemsByDirection("left", this.icon, this.text) - })))); + return { + type: "bi.vertical_adapt", + columnSize: [o.iconWrapperWidth || o.height, "fill"], + items: [{ + type: "bi.icon_label", + cls: o.iconCls, + width: o.iconWrapperWidth || o.height, + height: o.height, + iconWidth: o.iconWidth, + iconHeight: o.iconHeight + }, { + type: "bi.label", + ref: function (_ref) { + self.text = _ref; + }, + cls: "list-item-text", + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + }] + }; }, doClick: function () { diff --git a/src/base/single/button/node/texticonnode.js b/src/base/single/button/node/texticonnode.js index 2231c4c88..71217b746 100644 --- a/src/base/single/button/node/texticonnode.js +++ b/src/base/single/button/node/texticonnode.js @@ -23,33 +23,35 @@ BI.TextIconNode = BI.inherit(BI.NodeButton, { }, render: function () { - var o = this.options, c = this._const; - this.text = BI.createWidget({ - type: "bi.label", - cls: "list-item-text", - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height - }); - this.icon = BI.createWidget({ - type: "bi.icon_label", - width: o.height, - height: o.height, - iconWidth: o.iconWidth, - iconHeight: o.iconHeight - }); + var self = this, o = this.options; - BI.createWidget(BI.extend({ - element: this - }, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { - items: BI.LogicFactory.createLogicItemsByDirection("left", this.text, this.icon) - })))); + return { + type: "bi.vertical_adapt", + columnSize: ["fill", o.iconWrapperWidth || o.height], + items: [{ + type: "bi.label", + ref: function (_ref) { + self.text = _ref; + }, + cls: "list-item-text", + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + }, { + type: "bi.icon_label", + cls: o.iconCls, + width: o.iconWrapperWidth || o.height, + height: o.height, + iconWidth: o.iconWidth, + iconHeight: o.iconHeight + }] + }; }, doClick: function () { diff --git a/src/base/single/input/input.js b/src/base/single/input/input.js index 837d6d205..41e1ca0de 100644 --- a/src/base/single/input/input.js +++ b/src/base/single/input/input.js @@ -24,7 +24,7 @@ BI.Input = BI.inherit(BI.Single, { var _keydown = BI.debounce(function (keyCode) { self.onKeyDown(keyCode, ctrlKey); self._keydown_ = false; - }, 300); + }, BI.EVENT_RESPONSE_TIME); var _clk = BI.debounce(BI.bind(this._click, this), BI.EVENT_RESPONSE_TIME, { "leading": true, "trailing": false @@ -96,7 +96,7 @@ BI.Input = BI.inherit(BI.Single, { _blur: function () { var self = this; if (self._keydown_ === true) { - BI.delay(blur, 300); + BI.delay(blur, BI.EVENT_RESPONSE_TIME); } else { blur(); } diff --git a/src/case/ztree/0.treeview.js b/src/case/ztree/0.treeview.js index 5bf3188dc..66544e347 100644 --- a/src/case/ztree/0.treeview.js +++ b/src/case/ztree/0.treeview.js @@ -140,7 +140,9 @@ BI.TreeView = BI.inherit(BI.Pane, { } return true; } - BI.Msg.toast("Please Wait。", "warning"); // 不展开节点,也不触发onExpand事件 + BI.Msg.toast("Please Wait。", { + level: "warning" + }); // 不展开节点,也不触发onExpand事件 return false; } @@ -184,6 +186,9 @@ BI.TreeView = BI.inherit(BI.Pane, { } function beforeCheck (treeId, treeNode) { + if (treeNode.disabled) { + return false; + } // 下面主动修改了node的halfCheck属性, 节点属性的判断依赖halfCheck,改之前就获取一下 var status = treeNode.getCheckStatus(); treeNode.halfCheck = false; @@ -213,14 +218,23 @@ BI.TreeView = BI.inherit(BI.Pane, { } function onCheck (event, treeId, treeNode) { + if (treeNode.disabled) { + return false; + } self._selectTreeNode(treeId, treeNode); } function onExpand (event, treeId, treeNode) { + if (treeNode.disabled) { + return false; + } treeNode.halfCheck = false; } function onCollapse (event, treeId, treeNode) { + if (treeNode.disabled) { + return false; + } } return setting; @@ -335,22 +349,33 @@ BI.TreeView = BI.inherit(BI.Pane, { var ns = BI.Tree.arrayFormat(nodes); BI.each(ns, function (i, n) { n.isParent = n.isParent || n.parent; - n.value = BI.isUndefined(n.value) ? n.text : n.value; - n.text = BI.isUndefined(n.text) ? n.value : n.text; - if (n.text === null) { - n.text = ""; - } + // n.value = BI.isUndefined(n.value) ? n.text : n.value; + // n.text = BI.isUndefined(n.text) ? n.value : n.text; + // if (n.text === null) { + // n.text = ""; + // } if (BI.isNull(n.title)) { n.title = n.text; } - // 处理标红 - if (BI.isNotNull(n.text)) { - if (BI.isKey(o.paras.keyword)) { - n.text = BI.$("
").__textKeywordMarked__(BI.Text.formatText(n.text + ""), o.paras.keyword, n.py).html(); - } else { - n.text = BI.htmlEncode(BI.Text.formatText(n.text + "")); - } - } + var text = BI.createWidget(BI.extend({ + type: "bi.text", + cls: "tree-node-text", + css: { + display: "inline" + }, + root: true + }, n)); + var fragment = BI.Widget._renderEngine.createElement("
"); + fragment.append(text.element[0]); + n.text = fragment.html(); + // // 处理标红 + // if (BI.isNotNull(n.text)) { + // if (BI.isKey(o.paras.keyword)) { + // n.text = BI.$("
").__textKeywordMarked__(BI.Text.formatText(n.text + ""), o.paras.keyword, n.py).html(); + // } else { + // n.text = BI.htmlEncode(BI.Text.formatText(n.text + "")); + // } + // } }); return nodes; }, diff --git a/src/case/ztree/1.asynctree.js b/src/case/ztree/1.asynctree.js index 9bff9ee63..261f2d112 100644 --- a/src/case/ztree/1.asynctree.js +++ b/src/case/ztree/1.asynctree.js @@ -59,6 +59,9 @@ BI.AsyncTree = BI.inherit(BI.TreeView, { }; function onClick (event, treeId, treeNode) { + if (treeNode.disabled) { + return false; + } var zTree = BI.$.fn.zTree.getZTreeObj(treeId); // 当前点击节点的状态是半选,且为true_part, 则将其改为false_part,使得点击半选后切换到的是全选 var checked = treeNode.checked; @@ -70,6 +73,9 @@ BI.AsyncTree = BI.inherit(BI.TreeView, { } function beforeCheck (treeId, treeNode) { + if (treeNode.disabled) { + return false; + } // 下面主动修改了node的halfCheck属性, 节点属性的判断依赖halfCheck,改之前就获取一下 var status = treeNode.getCheckStatus(); treeNode.halfCheck = false; @@ -98,18 +104,30 @@ BI.AsyncTree = BI.inherit(BI.TreeView, { } function beforeExpand (treeId, treeNode) { + if (treeNode.disabled) { + return false; + } self._beforeExpandNode(treeId, treeNode); } function onCheck (event, treeId, treeNode) { + if (treeNode.disabled) { + return false; + } self._selectTreeNode(treeId, treeNode); } function onExpand (event, treeId, treeNode) { + if (treeNode.disabled) { + return false; + } treeNode.halfCheck = false; } function onCollapse (event, treeId, treeNode) { + if (treeNode.disabled) { + return false; + } treeNode.halfCheck = false; } @@ -245,4 +263,4 @@ BI.AsyncTree = BI.inherit(BI.TreeView, { } }); -BI.shortcut("bi.async_tree", BI.AsyncTree); \ No newline at end of file +BI.shortcut("bi.async_tree", BI.AsyncTree); diff --git a/src/case/ztree/jquery.ztree.excheck-3.5.js b/src/case/ztree/jquery.ztree.excheck-3.5.js index ea1e9d277..e28915a6f 100644 --- a/src/case/ztree/jquery.ztree.excheck-3.5.js +++ b/src/case/ztree/jquery.ztree.excheck-3.5.js @@ -455,7 +455,7 @@ chClass += ' bi-checkbox checkbox-content'; break; } - return chClass; + return chClass + (node.disabled ? " disabled" : ""); }, repairAllChk: function(setting, checked) { if (setting.check.enable && setting.check.chkStyle === consts.checkbox.STYLE) { diff --git a/src/less/base/colorchooser/colorchooser.trigger.less b/src/less/base/colorchooser/colorchooser.trigger.less index 20d6f268e..95739ca30 100644 --- a/src/less/base/colorchooser/colorchooser.trigger.less +++ b/src/less/base/colorchooser/colorchooser.trigger.less @@ -5,7 +5,7 @@ } .bi-combo-popup { - .bi-color-chooser-trigger { + &>.bi-color-chooser-trigger { border-color: @color-bi-border-hover-combo; } } diff --git a/src/less/base/combo/combo.bubble.less b/src/less/base/combo/combo.bubble.less index e5a59b0cb..a6f21add1 100644 --- a/src/less/base/combo/combo.bubble.less +++ b/src/less/base/combo/combo.bubble.less @@ -1,57 +1,12 @@ @import "../../index"; -.bi-bubble-combo { - & .button-combo-triangle-wrapper { - position: fixed !important; - // 消除祖先节点设置的line-height:normal对空白节点的行高影响 - line-height: 0; - .z-index-layer(@zIndex-popup); - // ie10一下无背景色会鼠标穿透 - .background-color(@color-bi-background-default, 0); - } - & .bubble-combo-triangle-left { - z-index: 1; - .triangle-right(); - } - & .bubble-combo-triangle-right { - z-index: 1; - .triangle-left(); - } - & .bubble-combo-triangle-top { - z-index: 1; - .triangle-bottom(); - } - & .bubble-combo-triangle-bottom { - z-index: 1; - .triangle-top(); - } - & .bubble-combo-triangle-left, & .bubble-combo-triangle-right, & .bubble-combo-triangle-top, & .bubble-combo-triangle-bottom { - &:before { - background-color: @color-bi-background-bubble-combo-triangle; - } - &.bi-primary:before { - background-color: @background-color-card-primary; - } - } -} - -// .bi-combo-popup .bi-bubble-popup-view { -// &.bi-zoom-big-leave{ -// .zoom-big-motion-enter(); -// } -// &.bi-zoom-big-leave-active{ -// .zoom-big-motion-enter-active(); +// .bi-bubble-combo { +// & .button-combo-triangle-wrapper { +// position: fixed !important; +// // 消除祖先节点设置的line-height:normal对空白节点的行高影响 +// line-height: 0; +// .z-index-layer(@zIndex-popup); +// // ie10一下无背景色会鼠标穿透 +// .background-color(@color-bi-background-default, 0); // } // } - -.bi-theme-dark { - .bi-bubble-combo { - & .bubble-combo-triangle-left, & .bubble-combo-triangle-right, & .bubble-combo-triangle-top, & .bubble-combo-triangle-bottom { - &:before { - background-color: @color-bi-background-bubble-combo-triangle-theme-dark; - border-bottom: 1px solid @color-bi-border-bubble-combo-triangle-theme-dark; - border-right: 1px solid @color-bi-border-bubble-combo-triangle-theme-dark; - } - } - } -} diff --git a/src/less/base/single/input/checkbox.less b/src/less/base/single/input/checkbox.less index 21088cdc7..89c9b205b 100644 --- a/src/less/base/single/input/checkbox.less +++ b/src/less/base/single/input/checkbox.less @@ -27,7 +27,7 @@ border-color: @color-bi-border-hover-active-checkbox; } } - &.active, &:active { + &.active { & .checkbox-content, &.checkbox-content{ border-color: @color-bi-border-hover-active-checkbox; background-color: @color-bi-background-active-checkbox; @@ -65,7 +65,7 @@ border-color: @color-bi-border-hover-active-checkbox-theme-dark; } } - &.active, &:active { + &.active { & .checkbox-content, &.checkbox-content { border-color: @color-bi-border-hover-active-checkbox-theme-dark; background-color: @color-bi-background-active-checkbox-theme-dark; diff --git a/src/less/base/single/input/radio.less b/src/less/base/single/input/radio.less index 53dfc7952..1f5383177 100644 --- a/src/less/base/single/input/radio.less +++ b/src/less/base/single/input/radio.less @@ -13,7 +13,7 @@ border-color: @color-bi-border-hover-active-radio; } } - &:active, &.active { + &.active { & .radio-content, &.radio-content { border-color: @color-bi-border-hover-active-radio; background-color: @color-bi-background-active-radio; @@ -59,7 +59,7 @@ border-color: @color-bi-border-hover-active-radio-theme-dark; } } - &.active, &:active { + &.active { & .radio-content, &.radio-content { border-color:@color-bi-border-hover-active-radio-theme-dark; &:after { diff --git a/src/less/base/single/label.less b/src/less/base/single/label.less index 726d2a208..df3cc7e93 100644 --- a/src/less/base/single/label.less +++ b/src/less/base/single/label.less @@ -2,5 +2,6 @@ .bi-label { .overflow-hidden(); + word-wrap: break-word; word-break: break-all; } \ No newline at end of file diff --git a/src/less/base/single/text.less b/src/less/base/single/text.less index ec0841923..0a6078dd1 100644 --- a/src/less/base/single/text.less +++ b/src/less/base/single/text.less @@ -3,5 +3,6 @@ .bi-text { .overflow-hidden(); .box-sizing(border-box); + word-wrap: break-word; word-break: break-all; } \ No newline at end of file diff --git a/src/less/base/tree/ztree.less b/src/less/base/tree/ztree.less index eb20d2818..630c48b45 100644 --- a/src/less/base/tree/ztree.less +++ b/src/less/base/tree/ztree.less @@ -76,12 +76,16 @@ text-decoration: none; vertical-align: top; display: inline-block; - &:hover { - .background-color(@color-bi-background-highlight, 10%); - } - &:active { - color: @color-bi-text-highlight; - .background-color(@color-bi-background-highlight, 15%); + .tree-node-text { + &:not(.disabled) { + &:hover { + .background-color(@color-bi-background-highlight, 10%); + } + &:active { + color: @color-bi-text-highlight; + .background-color(@color-bi-background-highlight, 15%); + } + } } } @@ -161,7 +165,14 @@ box-sizing: border-box; &.active { background-color: @color-bi-background-highlight; - border-color: @color-bi-border-highlight;; + border-color: @color-bi-border-highlight; + } + &.disabled { + border: 1px solid @color-bi-border-disabled; + background-color: @color-bi-background-disabled; + &.active { + border-color: @color-bi-border-disabled; + } } } &.bi-half-button { diff --git a/src/less/base/view/popupview.less b/src/less/base/view/popupview.less index cc8387fb7..b14bb4e35 100644 --- a/src/less/base/view/popupview.less +++ b/src/less/base/view/popupview.less @@ -28,34 +28,42 @@ } .bi-popup-view[data-popper-placement^='top'], .bi-popup-view.top { - > .bi-bubble-arrow { + > div > .bi-bubble-arrow { bottom: -12px; + width: 14px; > .bubble-arrow { bottom: 8px; + left: 1px; } } } .bi-popup-view[data-popper-placement^='bottom'], .bi-popup-view.bottom { - > .bi-bubble-arrow { + > div > .bi-bubble-arrow { top: -12px; + width: 14px; > .bubble-arrow { top: 8px; + left: 1px; } } } .bi-popup-view[data-popper-placement^='left'], .bi-popup-view.left { - > .bi-bubble-arrow { + > div > .bi-bubble-arrow { right: -12px; + height: 14px; > .bubble-arrow { right: 8px; + top: 1px; } } } .bi-popup-view[data-popper-placement^='right'], .bi-popup-view.right { - > .bi-bubble-arrow { + > div > .bi-bubble-arrow { left: -12px; + height: 14px; > .bubble-arrow { left: 8px; + top: 1px; } } } @@ -63,6 +71,8 @@ .bi-bubble-arrow { width: 12px; height: 12px; + // 消除祖先节点设置的line-height:normal对空白节点的行高影响 + line-height: 0; overflow: hidden; .bubble-arrow { width: 12px; diff --git a/typescript/index.ts b/typescript/index.ts index bcb501473..619ab72ce 100644 --- a/typescript/index.ts +++ b/typescript/index.ts @@ -49,6 +49,7 @@ import { VerticalFillLayout } from "./core/wrapper/layout/fill/fill.vertical"; import { VerticalLayout } from "./core/wrapper/layout/layout.vertical"; import { DefaultLayout } from "./core/wrapper/layout/layout.default"; import { DownListCombo } from "./widget/downlist/combo.downlist"; +import { DownListPopup } from "./widget/downlist/popup.downlist"; import { Icon } from "./base/single/icon/icon"; import { LeftVerticalAdaptLayout } from "./core/wrapper/layout/adapt/adapt.leftvertical"; import { LeftRightVerticalAdaptLayout, RightVerticalAdaptLayout } from "./core/wrapper/layout/adapt/adapt.leftrightvertical"; @@ -245,6 +246,7 @@ export interface BI extends _func, _i18n, _base, _inject, _var, _web, _utils { MultiTreeInsertCombo: typeof MultiTreeInsertCombo; Decorators: typeof decorator; DownListCombo: typeof DownListCombo; + DownListPopup: typeof DownListPopup; Iframe: typeof Iframe; AbsoluteLayout: typeof AbsoluteLayout; HorizontalFillLayout: typeof HorizontalFillLayout; @@ -423,6 +425,7 @@ export { Label, TextButton, DownListCombo, + DownListPopup, IconChangeButton, Button, TextEditor, diff --git a/typescript/widget/downlist/popup.downlist.ts b/typescript/widget/downlist/popup.downlist.ts new file mode 100644 index 000000000..08d4ef4ef --- /dev/null +++ b/typescript/widget/downlist/popup.downlist.ts @@ -0,0 +1,9 @@ +import { Widget } from "../../core/widget"; + +export declare class DownListPopup extends Widget { + static xtype: string; + static EVENT_CHANGE: string; + static EVENT_SON_VALUE_CHANGE: string; + + populate: (items: any) => void; +} \ No newline at end of file