Holiday 3 years ago
parent
commit
a72a8b64e2
  1. 2
      package.json
  2. 2
      src/base/combination/bubble.js
  3. 32
      src/base/combination/combo.js
  4. 68
      src/base/layer/layer.popup.js
  5. 55
      src/base/single/button/listitem/blankiconicontextitem.js
  6. 57
      src/base/single/button/listitem/blankicontexticonitem.js
  7. 28
      src/base/single/button/listitem/blankicontextitem.js
  8. 50
      src/base/single/button/listitem/icontexticonitem.js
  9. 35
      src/base/single/button/listitem/icontextitem.js
  10. 26
      src/base/single/button/listitem/texticonitem.js
  11. 54
      src/base/single/button/node/icontexticonnode.js
  12. 34
      src/base/single/button/node/icontextnode.js
  13. 26
      src/base/single/button/node/texticonnode.js
  14. 53
      src/case/ztree/0.treeview.js
  15. 18
      src/case/ztree/1.asynctree.js
  16. 2
      src/case/ztree/jquery.ztree.excheck-3.5.js
  17. 61
      src/less/base/combo/combo.bubble.less
  18. 4
      src/less/base/single/input/checkbox.less
  19. 4
      src/less/base/single/input/radio.less
  20. 1
      src/less/base/single/label.less
  21. 1
      src/less/base/single/text.less
  22. 16
      src/less/base/tree/ztree.less
  23. 18
      src/less/base/view/popupview.less

2
package.json

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

2
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)];
}
}
}];

32
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";

68
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);
}
},

55
src/base/single/button/listitem/blankiconicontextitem.js

@ -27,15 +27,33 @@ BI.BlankIconIconTextItem = BI.inherit(BI.BasicButton, {
},
render: function () {
var o = this.options, c = this._const;
var blank = BI.createWidget({
var self = this, o = this.options;
return {
type: "bi.vertical_adapt",
columnSize: [o.blankWidth, o.leftIconWrapperWidth || o.height, o.rightIconWrapperWidth || o.height, "fill"],
items: [{
type: "bi.layout",
width: o.blankWidth,
height: o.height
});
this.text = BI.createWidget({
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",
cls: "list-item-text",
ref: function (_ref) {
self.text = _ref;
},
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
@ -45,27 +63,8 @@ BI.BlankIconIconTextItem = BI.inherit(BI.BasicButton, {
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
});
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)
}))));
}]
};
},
doClick: function () {

57
src/base/single/button/listitem/blankicontexticonitem.js

@ -28,9 +28,26 @@ BI.BlankIconTextIconItem = BI.inherit(BI.BasicButton, {
},
render: function () {
var o = this.options, c = this._const;
this.text = BI.createWidget({
var self = this, o = this.options;
return {
type: "bi.vertical_adapt",
columnSize: [o.blankWidth, o.leftIconWrapperWidth || o.height, "fill", o.rightIconWrapperWidth || o.height],
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.label",
ref: function (_ref) {
self.text = _ref;
},
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
@ -40,45 +57,15 @@ BI.BlankIconTextIconItem = BI.inherit(BI.BasicButton, {
value: o.value,
keyword: o.keyword,
height: o.height
});
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,
items: [{
el: {
}, {
type: "bi.icon_label",
cls: o.iconCls2,
width: o.height,
width: o.rightIconWrapperWidth || 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
})
}))));
};
},
doClick: function () {

28
src/base/single/button/listitem/blankicontextitem.js

@ -26,13 +26,19 @@ BI.BlankIconTextItem = BI.inherit(BI.BasicButton, {
},
render: function () {
var o = this.options, c = this._const;
var blank = BI.createWidget({
var self = this, o = this.options;
return {
type: "bi.vertical_adapt",
columnSize: [o.blankWidth, "fill", o.iconWrapperWidth || o.height],
items: [{
type: "bi.layout",
width: o.blankWidth
});
this.text = BI.createWidget({
}, {
type: "bi.label",
ref: function (_ref) {
self.text = _ref;
},
cls: "list-item-text",
textAlign: "left",
hgap: o.textHgap,
@ -43,21 +49,15 @@ BI.BlankIconTextItem = BI.inherit(BI.BasicButton, {
value: o.value,
keyword: o.keyword,
height: o.height
});
this.icon = BI.createWidget({
}, {
type: "bi.icon_label",
cls: o.iconCls,
width: o.height,
width: o.iconWrapperWidth || 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", blank, this.icon, this.text)
}))));
}]
};
},
doClick: function () {

50
src/base/single/button/listitem/icontexticonitem.js

@ -27,9 +27,23 @@ BI.IconTextIconItem = BI.inherit(BI.BasicButton, {
},
render: function () {
var o = this.options, c = this._const;
this.text = BI.createWidget({
var self = this, o = this.options;
return {
type: "bi.vertical_adapt",
columnSize: [o.leftIconWrapperWidth || o.height, "fill", o.rightIconWrapperWidth || o.height],
items: [{
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,
@ -39,43 +53,15 @@ BI.IconTextIconItem = BI.inherit(BI.BasicButton, {
value: o.value,
keyword: o.keyword,
height: o.height
});
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,
items: [{
el: {
}, {
type: "bi.icon_label",
cls: o.iconCls2,
width: o.rightIconWrapperWidth || 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", icon1, this.text, blank)
}))));
};
},
doClick: function () {

35
src/base/single/button/listitem/icontextitem.js

@ -27,9 +27,23 @@ BI.IconTextItem = BI.inherit(BI.BasicButton, {
},
render: function () {
var o = this.options, c = this._const;
this.text = BI.createWidget({
var self = this, o = this.options;
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,
@ -40,21 +54,8 @@ BI.IconTextItem = BI.inherit(BI.BasicButton, {
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
});
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)
}))));
}]
};
},
doClick: function () {

26
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,9 +27,16 @@ BI.TextIconItem = BI.inherit(BI.BasicButton, {
},
render: function () {
var o = this.options, c = this._const;
this.text = BI.createWidget({
var self = this, o = this.options;
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,
@ -39,21 +47,15 @@ BI.TextIconItem = BI.inherit(BI.BasicButton, {
value: o.value,
keyword: o.keyword,
height: o.height
});
this.icon = BI.createWidget({
}, {
type: "bi.icon_label",
cls: o.iconCls,
width: o.height,
width: o.iconWrapperWidth || 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", this.text, this.icon)
}))));
}]
};
},
doClick: function () {

54
src/base/single/button/node/icontexticonnode.js

@ -25,9 +25,23 @@ BI.IconTextIconNode = BI.inherit(BI.NodeButton, {
},
render: function () {
var o = this.options, c = this._const;
this.text = BI.createWidget({
var self = this, o = this.options;
return {
type: "bi.vertical_adapt",
columnSize: [o.leftIconWrapperWidth || o.height, "fill", o.rightIconWrapperWidth || o.height],
items: [{
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,
@ -37,43 +51,15 @@ BI.IconTextIconNode = BI.inherit(BI.NodeButton, {
value: o.value,
keyword: o.keyword,
height: o.height
});
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,
items: [{
el: {
}, {
type: "bi.icon_label",
cls: o.iconCls2,
width: o.height,
width: o.rightIconWrapperWidth || 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", icon1, this.text, blank)
}))));
};
},
doClick: function () {

34
src/base/single/button/node/icontextnode.js

@ -24,9 +24,23 @@ BI.IconTextNode = BI.inherit(BI.NodeButton, {
},
render: function () {
var o = this.options, c = this._const;
this.text = BI.createWidget({
var self = this, o = this.options;
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,
@ -37,20 +51,8 @@ BI.IconTextNode = BI.inherit(BI.NodeButton, {
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
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", this.icon, this.text)
}))));
}]
};
},
doClick: function () {

26
src/base/single/button/node/texticonnode.js

@ -23,9 +23,16 @@ BI.TextIconNode = BI.inherit(BI.NodeButton, {
},
render: function () {
var o = this.options, c = this._const;
this.text = BI.createWidget({
var self = this, o = this.options;
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,
@ -36,20 +43,15 @@ BI.TextIconNode = BI.inherit(BI.NodeButton, {
value: o.value,
keyword: o.keyword,
height: o.height
});
this.icon = BI.createWidget({
}, {
type: "bi.icon_label",
width: o.height,
cls: o.iconCls,
width: o.iconWrapperWidth || 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", this.text, this.icon)
}))));
}]
};
},
doClick: function () {

53
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.$("<div>").__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("<div>");
fragment.append(text.element[0]);
n.text = fragment.html();
// // 处理标红
// if (BI.isNotNull(n.text)) {
// if (BI.isKey(o.paras.keyword)) {
// n.text = BI.$("<div>").__textKeywordMarked__(BI.Text.formatText(n.text + ""), o.paras.keyword, n.py).html();
// } else {
// n.text = BI.htmlEncode(BI.Text.formatText(n.text + ""));
// }
// }
});
return nodes;
},

18
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;
}

2
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) {

61
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;
}
}
}
}

4
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;

4
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 {

1
src/less/base/single/label.less

@ -2,5 +2,6 @@
.bi-label {
.overflow-hidden();
word-wrap: break-word;
word-break: break-all;
}

1
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;
}

16
src/less/base/tree/ztree.less

@ -76,6 +76,8 @@
text-decoration: none;
vertical-align: top;
display: inline-block;
.tree-node-text {
&:not(.disabled) {
&:hover {
.background-color(@color-bi-background-highlight, 10%);
}
@ -83,6 +85,8 @@
color: @color-bi-text-highlight;
.background-color(@color-bi-background-highlight, 15%);
}
}
}
}
.ztree.solid li a {
@ -161,7 +165,17 @@
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;
&:after {
opacity: 0;
}
}
}
}
&.bi-half-button {

18
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;

Loading…
Cancel
Save